diff --git a/dist/echarts.js b/dist/echarts.js index 6458ffc8c3..15483f10e9 100644 --- a/dist/echarts.js +++ b/dist/echarts.js @@ -1,85796 +1,72149 @@ - -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT 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 (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.echarts = {})); -}(this, (function (exports) { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - - function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - - var Browser = (function () { - function Browser() { - this.firefox = false; - this.ie = false; - this.edge = false; - this.newEdge = false; - this.weChat = false; - } - return Browser; - }()); - var Env = (function () { - function Env() { - this.browser = new Browser(); - this.node = false; - this.wxa = false; - this.worker = false; - this.svgSupported = false; - this.touchEventsSupported = false; - this.pointerEventsSupported = false; - this.domSupported = false; - this.transformSupported = false; - this.transform3dSupported = false; - this.hasGlobalWindow = typeof window !== 'undefined'; - } - return Env; - }()); - var env = new Env(); - if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') { - env.wxa = true; - env.touchEventsSupported = true; - } - else if (typeof document === 'undefined' && typeof self !== 'undefined') { - env.worker = true; - } - else if (typeof navigator === 'undefined' - || navigator.userAgent.indexOf('Node.js') === 0) { - env.node = true; - env.svgSupported = true; - } - else { - detect(navigator.userAgent, env); - } - function detect(ua, env) { - var browser = env.browser; - var firefox = ua.match(/Firefox\/([\d.]+)/); - var ie = ua.match(/MSIE\s([\d.]+)/) - || ua.match(/Trident\/.+?rv:(([\d.]+))/); - var edge = ua.match(/Edge?\/([\d.]+)/); - var weChat = (/micromessenger/i).test(ua); - if (firefox) { - browser.firefox = true; - browser.version = firefox[1]; - } - if (ie) { - browser.ie = true; - browser.version = ie[1]; - } - if (edge) { - browser.edge = true; - browser.version = edge[1]; - browser.newEdge = +edge[1].split('.')[0] > 18; - } - if (weChat) { - browser.weChat = true; - } - env.svgSupported = typeof SVGRect !== 'undefined'; - env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge; - env.pointerEventsSupported = 'onpointerdown' in window - && (browser.edge || (browser.ie && +browser.version >= 11)); - env.domSupported = typeof document !== 'undefined'; - var style = document.documentElement.style; - env.transform3dSupported = ((browser.ie && 'transition' in style) - || browser.edge - || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix())) - || 'MozPerspective' in style) - && !('OTransition' in style); - env.transformSupported = env.transform3dSupported - || (browser.ie && +browser.version >= 9); - } - - var DEFAULT_FONT_SIZE = 12; - var DEFAULT_FONT_FAMILY = 'sans-serif'; - var DEFAULT_FONT = DEFAULT_FONT_SIZE + "px " + DEFAULT_FONT_FAMILY; - var OFFSET = 20; - var SCALE = 100; - var defaultWidthMapStr = "007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"; - function getTextWidthMap(mapStr) { - var map = {}; - if (typeof JSON === 'undefined') { - return map; - } - for (var i = 0; i < mapStr.length; i++) { - var char = String.fromCharCode(i + 32); - var size = (mapStr.charCodeAt(i) - OFFSET) / SCALE; - map[char] = size; - } - return map; - } - var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr); - var platformApi = { - createCanvas: function () { - return typeof document !== 'undefined' - && document.createElement('canvas'); - }, - measureText: (function () { - var _ctx; - var _cachedFont; - return function (text, font) { - if (!_ctx) { - var canvas = platformApi.createCanvas(); - _ctx = canvas && canvas.getContext('2d'); - } - if (_ctx) { - if (_cachedFont !== font) { - _cachedFont = _ctx.font = font || DEFAULT_FONT; - } - return _ctx.measureText(text); - } - else { - text = text || ''; - font = font || DEFAULT_FONT; - var res = /((?:\d+)?\.?\d*)px/.exec(font); - var fontSize = res && +res[1] || DEFAULT_FONT_SIZE; - var width = 0; - if (font.indexOf('mono') >= 0) { - width = fontSize * text.length; - } - else { - for (var i = 0; i < text.length; i++) { - var preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]]; - width += preCalcWidth == null ? fontSize : (preCalcWidth * fontSize); - } - } - return { width: width }; - } - }; - })(), - loadImage: function (src, onload, onerror) { - var image = new Image(); - image.onload = onload; - image.onerror = onerror; - image.src = src; - return image; +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['exports'], factory); + } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { + // CommonJS + factory(exports); + } else { + // Browser globals + factory((root.echarts = {})); + } +}(typeof self !== 'undefined' ? self : this, function (exports, b) { + +var __defProp = Object.defineProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, {get: all[name], enumerable: true}); +}; + +// src/echarts.all.ts +__export(exports, { + Axis: () => Axis_default, + ChartView: () => Chart_default, + ComponentModel: () => Component_default, + ComponentView: () => Component_default2, + List: () => SeriesData_default, + Model: () => Model_default, + PRIORITY: () => PRIORITY, + SeriesModel: () => Series_default, + color: () => color_exports, + connect: () => connect, + dataTool: () => dataTool, + dependencies: () => dependencies, + disConnect: () => disConnect, + disconnect: () => disconnect, + dispose: () => dispose2, + env: () => env_default, + extendChartView: () => extendChartView, + extendComponentModel: () => extendComponentModel, + extendComponentView: () => extendComponentView, + extendSeriesModel: () => extendSeriesModel, + format: () => format_exports, + getCoordinateSystemDimensions: () => getCoordinateSystemDimensions, + getInstanceByDom: () => getInstanceByDom, + getInstanceById: () => getInstanceById, + getMap: () => getMap, + graphic: () => graphic_exports2, + helper: () => helper_exports, + init: () => init2, + innerDrawElementOnCanvas: () => brushSingle, + matrix: () => matrix_exports, + number: () => number_exports, + parseGeoJSON: () => parseGeoJSON, + parseGeoJson: () => parseGeoJSON, + registerAction: () => registerAction, + registerCoordinateSystem: () => registerCoordinateSystem, + registerLayout: () => registerLayout, + registerLoading: () => registerLoading, + registerLocale: () => registerLocale, + registerMap: () => registerMap, + registerPostInit: () => registerPostInit, + registerPostUpdate: () => registerPostUpdate, + registerPreprocessor: () => registerPreprocessor, + registerProcessor: () => registerProcessor, + registerTheme: () => registerTheme, + registerTransform: () => registerTransform, + registerUpdateLifecycle: () => registerUpdateLifecycle, + registerVisual: () => registerVisual, + setCanvasCreator: () => setCanvasCreator, + setPlatformAPI: () => setPlatformAPI, + throttle: () => throttle, + time: () => time_exports, + use: () => use, + util: () => util_exports2, + vector: () => vector_exports, + version: () => version2, + zrUtil: () => util_exports, + zrender: () => zrender_exports +}); + +// node_modules/zrender/src/zrender.ts +var zrender_exports = {}; +__export(zrender_exports, { + dispose: () => dispose, + disposeAll: () => disposeAll, + getElementSSRData: () => getElementSSRData, + getInstance: () => getInstance, + init: () => init, + registerPainter: () => registerPainter, + registerSSRDataGetter: () => registerSSRDataGetter, + version: () => version +}); + +// node_modules/zrender/src/core/env.ts +var Browser = class { + constructor() { + this.firefox = false; + this.ie = false; + this.edge = false; + this.newEdge = false; + this.weChat = false; + } +}; +var Env = class { + constructor() { + this.browser = new Browser(); + this.node = false; + this.wxa = false; + this.worker = false; + this.svgSupported = false; + this.touchEventsSupported = false; + this.pointerEventsSupported = false; + this.domSupported = false; + this.transformSupported = false; + this.transform3dSupported = false; + this.hasGlobalWindow = typeof window !== "undefined"; + } +}; +var env = new Env(); +if (typeof wx === "object" && typeof wx.getSystemInfoSync === "function") { + env.wxa = true; + env.touchEventsSupported = true; +} else if (typeof document === "undefined" && typeof self !== "undefined") { + env.worker = true; +} else if (!env.hasGlobalWindow || "Deno" in window) { + env.node = true; + env.svgSupported = true; +} else { + detect(navigator.userAgent, env); +} +function detect(ua, env2) { + const browser = env2.browser; + const firefox = ua.match(/Firefox\/([\d.]+)/); + const ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/.+?rv:(([\d.]+))/); + const edge = ua.match(/Edge?\/([\d.]+)/); + const weChat = /micromessenger/i.test(ua); + if (firefox) { + browser.firefox = true; + browser.version = firefox[1]; + } + if (ie) { + browser.ie = true; + browser.version = ie[1]; + } + if (edge) { + browser.edge = true; + browser.version = edge[1]; + browser.newEdge = +edge[1].split(".")[0] > 18; + } + if (weChat) { + browser.weChat = true; + } + env2.svgSupported = typeof SVGRect !== "undefined"; + env2.touchEventsSupported = "ontouchstart" in window && !browser.ie && !browser.edge; + env2.pointerEventsSupported = "onpointerdown" in window && (browser.edge || browser.ie && +browser.version >= 11); + env2.domSupported = typeof document !== "undefined"; + const style = document.documentElement.style; + env2.transform3dSupported = (browser.ie && "transition" in style || browser.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in style) && !("OTransition" in style); + env2.transformSupported = env2.transform3dSupported || browser.ie && +browser.version >= 9; +} +var env_default = env; + +// node_modules/zrender/src/core/util.ts +var util_exports = {}; +__export(util_exports, { + HashMap: () => HashMap, + RADIAN_TO_DEGREE: () => RADIAN_TO_DEGREE, + assert: () => assert, + bind: () => bind, + clone: () => clone, + concatArray: () => concatArray, + createCanvas: () => createCanvas, + createHashMap: () => createHashMap, + createObject: () => createObject, + curry: () => curry, + defaults: () => defaults, + disableUserSelect: () => disableUserSelect, + each: () => each, + eqNaN: () => eqNaN, + extend: () => extend, + filter: () => filter, + find: () => find, + guid: () => guid, + hasOwn: () => hasOwn, + indexOf: () => indexOf, + inherits: () => inherits, + isArray: () => isArray, + isArrayLike: () => isArrayLike, + isBuiltInObject: () => isBuiltInObject, + isDom: () => isDom, + isFunction: () => isFunction, + isGradientObject: () => isGradientObject, + isImagePatternObject: () => isImagePatternObject, + isNumber: () => isNumber, + isObject: () => isObject, + isPrimitive: () => isPrimitive, + isRegExp: () => isRegExp, + isString: () => isString, + isStringSafe: () => isStringSafe, + isTypedArray: () => isTypedArray, + keys: () => keys, + logError: () => logError, + map: () => map, + merge: () => merge, + mergeAll: () => mergeAll, + mixin: () => mixin, + noop: () => noop, + normalizeCssArray: () => normalizeCssArray, + reduce: () => reduce, + retrieve: () => retrieve, + retrieve2: () => retrieve2, + retrieve3: () => retrieve3, + setAsPrimitive: () => setAsPrimitive, + slice: () => slice, + trim: () => trim +}); + +// node_modules/zrender/src/core/platform.ts +var DEFAULT_FONT_SIZE = 12; +var DEFAULT_FONT_FAMILY = "sans-serif"; +var DEFAULT_FONT = `${DEFAULT_FONT_SIZE}px ${DEFAULT_FONT_FAMILY}`; +var OFFSET = 20; +var SCALE = 100; +var defaultWidthMapStr = `007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`; +function getTextWidthMap(mapStr) { + const map3 = {}; + if (typeof JSON === "undefined") { + return map3; + } + for (let i = 0; i < mapStr.length; i++) { + const char = String.fromCharCode(i + 32); + const size = (mapStr.charCodeAt(i) - OFFSET) / SCALE; + map3[char] = size; + } + return map3; +} +var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr); +var platformApi = { + createCanvas() { + return typeof document !== "undefined" && document.createElement("canvas"); + }, + measureText: function() { + let _ctx; + let _cachedFont; + return (text, font) => { + if (!_ctx) { + const canvas = platformApi.createCanvas(); + _ctx = canvas && canvas.getContext("2d"); + } + if (_ctx) { + if (_cachedFont !== font) { + _cachedFont = _ctx.font = font || DEFAULT_FONT; + } + return _ctx.measureText(text); + } else { + text = text || ""; + font = font || DEFAULT_FONT; + const res = /((?:\d+)?\.?\d*)px/.exec(font); + const fontSize = res && +res[1] || DEFAULT_FONT_SIZE; + let width = 0; + if (font.indexOf("mono") >= 0) { + width = fontSize * text.length; + } else { + for (let i = 0; i < text.length; i++) { + const preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]]; + width += preCalcWidth == null ? fontSize : preCalcWidth * fontSize; + } } + return {width}; + } }; - function setPlatformAPI(newPlatformApis) { - for (var key in platformApi) { - if (newPlatformApis[key]) { - platformApi[key] = newPlatformApis[key]; - } - } + }(), + loadImage(src, onload, onerror) { + const image = new Image(); + image.onload = onload; + image.onerror = onerror; + image.src = src; + return image; + } +}; +function setPlatformAPI(newPlatformApis) { + for (let key in platformApi) { + if (newPlatformApis[key]) { + platformApi[key] = newPlatformApis[key]; + } + } +} + +// node_modules/zrender/src/core/util.ts +var BUILTIN_OBJECT = reduce([ + "Function", + "RegExp", + "Date", + "Error", + "CanvasGradient", + "CanvasPattern", + "Image", + "Canvas" +], (obj, val) => { + obj["[object " + val + "]"] = true; + return obj; +}, {}); +var TYPED_ARRAY = reduce([ + "Int8", + "Uint8", + "Uint8Clamped", + "Int16", + "Uint16", + "Int32", + "Uint32", + "Float32", + "Float64" +], (obj, val) => { + obj["[object " + val + "Array]"] = true; + return obj; +}, {}); +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 ctorFunction = function() { +}.constructor; +var protoFunction = ctorFunction ? ctorFunction.prototype : null; +var protoKey = "__proto__"; +var idStart = 2311; +function guid() { + return idStart++; +} +function logError(...args) { + if (typeof console !== "undefined") { + console.error.apply(console, args); + } +} +function clone(source) { + if (source == null || typeof source !== "object") { + return source; + } + let result = source; + const typeStr = objToString.call(source); + if (typeStr === "[object Array]") { + if (!isPrimitive(source)) { + result = []; + for (let i = 0, len2 = source.length; i < len2; i++) { + result[i] = clone(source[i]); + } + } + } else if (TYPED_ARRAY[typeStr]) { + if (!isPrimitive(source)) { + const Ctor = source.constructor; + if (Ctor.from) { + result = Ctor.from(source); + } else { + result = new Ctor(source.length); + for (let i = 0, len2 = source.length; i < len2; i++) { + result[i] = source[i]; + } + } + } + } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) { + result = {}; + for (let key in source) { + if (source.hasOwnProperty(key) && key !== protoKey) { + result[key] = clone(source[key]); + } + } + } + return result; +} +function merge(target, source, overwrite) { + if (!isObject(source) || !isObject(target)) { + return overwrite ? clone(source) : target; + } + for (let key in source) { + if (source.hasOwnProperty(key) && key !== protoKey) { + const targetProp = target[key]; + const 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(targetProp, sourceProp, overwrite); + } else if (overwrite || !(key in target)) { + target[key] = clone(source[key]); + } + } + } + return target; +} +function mergeAll(targetAndSources, overwrite) { + let result = targetAndSources[0]; + for (let i = 1, len2 = targetAndSources.length; i < len2; i++) { + result = merge(result, targetAndSources[i], overwrite); + } + return result; +} +function extend(target, source) { + if (Object.assign) { + Object.assign(target, source); + } else { + for (let key in source) { + if (source.hasOwnProperty(key) && key !== protoKey) { + target[key] = source[key]; + } + } + } + return target; +} +function defaults(target, source, overlay) { + const keysArr = keys(source); + for (let i = 0; i < keysArr.length; i++) { + let key = keysArr[i]; + if (overlay ? source[key] != null : target[key] == null) { + target[key] = source[key]; + } + } + return target; +} +var createCanvas = platformApi.createCanvas; +function indexOf(array, value) { + if (array) { + if (array.indexOf) { + return array.indexOf(value); + } + for (let i = 0, len2 = array.length; i < len2; i++) { + if (array[i] === value) { + return i; + } } - - var BUILTIN_OBJECT = reduce([ - 'Function', - 'RegExp', - 'Date', - 'Error', - 'CanvasGradient', - 'CanvasPattern', - 'Image', - 'Canvas' - ], function (obj, val) { - obj['[object ' + val + ']'] = true; - return obj; - }, {}); - var TYPED_ARRAY = reduce([ - 'Int8', - 'Uint8', - 'Uint8Clamped', - 'Int16', - 'Uint16', - 'Int32', - 'Uint32', - 'Float32', - 'Float64' - ], function (obj, val) { - obj['[object ' + val + 'Array]'] = true; - return obj; - }, {}); - 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 ctorFunction = function () { }.constructor; - var protoFunction = ctorFunction ? ctorFunction.prototype : null; - var protoKey = '__proto__'; - var idStart = 0x0907; - function guid() { - return idStart++; - } - function logError() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (typeof console !== 'undefined') { - console.error.apply(console, args); - } - } - 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 (Ctor.from) { - result = Ctor.from(source); - } - else { - result = new Ctor(source.length); - for (var i = 0, len = source.length; i < len; i++) { - result[i] = source[i]; - } - } - } - } - else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) { - result = {}; - for (var key in source) { - if (source.hasOwnProperty(key) && key !== protoKey) { - result[key] = clone(source[key]); - } - } + } + return -1; +} +function inherits(clazz, baseClazz) { + const clazzPrototype = clazz.prototype; + function F() { + } + F.prototype = baseClazz.prototype; + clazz.prototype = new F(); + for (let prop in clazzPrototype) { + if (clazzPrototype.hasOwnProperty(prop)) { + clazz.prototype[prop] = clazzPrototype[prop]; + } + } + clazz.prototype.constructor = clazz; + clazz.superClass = baseClazz; +} +function mixin(target, source, override) { + target = "prototype" in target ? target.prototype : target; + source = "prototype" in source ? source.prototype : source; + if (Object.getOwnPropertyNames) { + const keyList = Object.getOwnPropertyNames(source); + for (let i = 0; i < keyList.length; i++) { + const key = keyList[i]; + if (key !== "constructor") { + if (override ? source[key] != null : target[key] == null) { + target[key] = source[key]; } - return result; + } } - function merge(target, source, overwrite) { - if (!isObject(source) || !isObject(target)) { - return overwrite ? clone(source) : target; - } - for (var key in source) { - if (source.hasOwnProperty(key) && key !== protoKey) { - 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(targetProp, sourceProp, overwrite); - } - else if (overwrite || !(key in target)) { - target[key] = clone(source[key]); - } - } - } - return target; + } else { + defaults(target, source, override); + } +} +function isArrayLike(data) { + if (!data) { + return false; + } + if (typeof data === "string") { + return false; + } + return typeof data.length === "number"; +} +function each(arr, cb, context) { + if (!(arr && cb)) { + return; + } + if (arr.forEach && arr.forEach === nativeForEach) { + arr.forEach(cb, context); + } else if (arr.length === +arr.length) { + for (let i = 0, len2 = arr.length; i < len2; i++) { + cb.call(context, arr[i], i, arr); + } + } else { + for (let key in arr) { + if (arr.hasOwnProperty(key)) { + cb.call(context, arr[key], key, arr); + } + } + } +} +function map(arr, cb, context) { + if (!arr) { + return []; + } + if (!cb) { + return slice(arr); + } + if (arr.map && arr.map === nativeMap) { + return arr.map(cb, context); + } else { + const result = []; + for (let i = 0, len2 = arr.length; i < len2; i++) { + result.push(cb.call(context, arr[i], i, arr)); + } + return result; + } +} +function reduce(arr, cb, memo, context) { + if (!(arr && cb)) { + return; + } + for (let i = 0, len2 = arr.length; i < len2; i++) { + memo = cb.call(context, memo, arr[i], i, arr); + } + return memo; +} +function filter(arr, cb, context) { + if (!arr) { + return []; + } + if (!cb) { + return slice(arr); + } + if (arr.filter && arr.filter === nativeFilter) { + return arr.filter(cb, context); + } else { + const result = []; + for (let i = 0, len2 = arr.length; i < len2; i++) { + if (cb.call(context, arr[i], i, arr)) { + result.push(arr[i]); + } + } + return result; + } +} +function find(arr, cb, context) { + if (!(arr && cb)) { + return; + } + for (let i = 0, len2 = arr.length; i < len2; i++) { + if (cb.call(context, arr[i], i, arr)) { + return arr[i]; } - 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; + } +} +function keys(obj) { + if (!obj) { + return []; + } + if (Object.keys) { + return Object.keys(obj); + } + let keyList = []; + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + keyList.push(key); + } + } + return keyList; +} +function bindPolyfill(func, context, ...args) { + return function() { + return func.apply(context, args.concat(nativeSlice.call(arguments))); + }; +} +var bind = protoFunction && isFunction(protoFunction.bind) ? protoFunction.call.bind(protoFunction.bind) : bindPolyfill; +function curry(func, ...args) { + return function() { + return func.apply(this, args.concat(nativeSlice.call(arguments))); + }; +} +function isArray(value) { + if (Array.isArray) { + return Array.isArray(value); + } + return objToString.call(value) === "[object Array]"; +} +function isFunction(value) { + return typeof value === "function"; +} +function isString(value) { + return typeof value === "string"; +} +function isStringSafe(value) { + return objToString.call(value) === "[object String]"; +} +function isNumber(value) { + return typeof value === "number"; +} +function isObject(value) { + const type = typeof value; + return type === "function" || !!value && type === "object"; +} +function isBuiltInObject(value) { + return !!BUILTIN_OBJECT[objToString.call(value)]; +} +function isTypedArray(value) { + return !!TYPED_ARRAY[objToString.call(value)]; +} +function isDom(value) { + return typeof value === "object" && typeof value.nodeType === "number" && typeof value.ownerDocument === "object"; +} +function isGradientObject(value) { + return value.colorStops != null; +} +function isImagePatternObject(value) { + return value.image != null; +} +function isRegExp(value) { + return objToString.call(value) === "[object RegExp]"; +} +function eqNaN(value) { + return value !== value; +} +function retrieve(...args) { + for (let i = 0, len2 = args.length; i < len2; i++) { + if (args[i] != null) { + return args[i]; + } + } +} +function retrieve2(value0, value1) { + return value0 != null ? value0 : value1; +} +function retrieve3(value0, value1, value2) { + return value0 != null ? value0 : value1 != null ? value1 : value2; +} +function slice(arr, ...args) { + return nativeSlice.apply(arr, args); +} +function normalizeCssArray(val) { + if (typeof val === "number") { + return [val, val, val, val]; + } + const len2 = val.length; + if (len2 === 2) { + return [val[0], val[1], val[0], val[1]]; + } else if (len2 === 3) { + return [val[0], val[1], val[2], val[1]]; + } + return val; +} +function assert(condition, message) { + if (!condition) { + throw new Error(message); + } +} +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__"; +function setAsPrimitive(obj) { + obj[primitiveKey] = true; +} +function isPrimitive(obj) { + return obj[primitiveKey]; +} +var MapPolyfill = class { + constructor() { + this.data = {}; + } + delete(key) { + const existed = this.has(key); + if (existed) { + delete this.data[key]; + } + return existed; + } + has(key) { + return this.data.hasOwnProperty(key); + } + get(key) { + return this.data[key]; + } + set(key, value) { + this.data[key] = value; + return this; + } + keys() { + return keys(this.data); + } + forEach(callback) { + const data = this.data; + for (const key in data) { + if (data.hasOwnProperty(key)) { + callback(data[key], key); + } + } + } +}; +var isNativeMapSupported = typeof Map === "function"; +function maybeNativeMap() { + return isNativeMapSupported ? new Map() : new MapPolyfill(); +} +var HashMap = class { + constructor(obj) { + const isArr = isArray(obj); + this.data = maybeNativeMap(); + const 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); + } + } + hasKey(key) { + return this.data.has(key); + } + get(key) { + return this.data.get(key); + } + set(key, value) { + this.data.set(key, value); + return value; + } + each(cb, context) { + this.data.forEach((value, key) => { + cb.call(context, value, key); + }); + } + keys() { + const keys2 = this.data.keys(); + return isNativeMapSupported ? Array.from(keys2) : keys2; + } + removeKey(key) { + this.data.delete(key); + } +}; +function createHashMap(obj) { + return new HashMap(obj); +} +function concatArray(a, b) { + const newArray = new a.constructor(a.length + b.length); + for (let i = 0; i < a.length; i++) { + newArray[i] = a[i]; + } + const offset = a.length; + for (let i = 0; i < b.length; i++) { + newArray[i + offset] = b[i]; + } + return newArray; +} +function createObject(proto2, properties) { + let obj; + if (Object.create) { + obj = Object.create(proto2); + } else { + const StyleCtor = function() { + }; + StyleCtor.prototype = proto2; + obj = new StyleCtor(); + } + if (properties) { + extend(obj, properties); + } + return obj; +} +function disableUserSelect(dom) { + const domStyle = dom.style; + domStyle.webkitUserSelect = "none"; + domStyle.userSelect = "none"; + domStyle.webkitTapHighlightColor = "rgba(0,0,0,0)"; + domStyle["-webkit-touch-callout"] = "none"; +} +function hasOwn(own, prop) { + return own.hasOwnProperty(prop); +} +function noop() { +} +var RADIAN_TO_DEGREE = 180 / Math.PI; + +// node_modules/zrender/src/core/vector.ts +var vector_exports = {}; +__export(vector_exports, { + add: () => add, + applyTransform: () => applyTransform, + clone: () => clone2, + copy: () => copy, + create: () => create, + dist: () => dist, + distSquare: () => distSquare, + distance: () => distance, + distanceSquare: () => distanceSquare, + div: () => div, + dot: () => dot, + len: () => len, + lenSquare: () => lenSquare, + length: () => length, + lengthSquare: () => lengthSquare, + lerp: () => lerp, + max: () => max, + min: () => min, + mul: () => mul, + negate: () => negate, + normalize: () => normalize, + scale: () => scale, + scaleAndAdd: () => scaleAndAdd, + set: () => set, + sub: () => sub +}); +function create(x, y) { + if (x == null) { + x = 0; + } + if (y == null) { + y = 0; + } + return [x, y]; +} +function copy(out2, v) { + out2[0] = v[0]; + out2[1] = v[1]; + return out2; +} +function clone2(v) { + return [v[0], v[1]]; +} +function set(out2, a, b) { + out2[0] = a; + out2[1] = b; + return out2; +} +function add(out2, v12, v22) { + out2[0] = v12[0] + v22[0]; + out2[1] = v12[1] + v22[1]; + return out2; +} +function scaleAndAdd(out2, v12, v22, a) { + out2[0] = v12[0] + v22[0] * a; + out2[1] = v12[1] + v22[1] * a; + return out2; +} +function sub(out2, v12, v22) { + out2[0] = v12[0] - v22[0]; + out2[1] = v12[1] - v22[1]; + return out2; +} +function len(v) { + return Math.sqrt(lenSquare(v)); +} +var length = len; +function lenSquare(v) { + return v[0] * v[0] + v[1] * v[1]; +} +var lengthSquare = lenSquare; +function mul(out2, v12, v22) { + out2[0] = v12[0] * v22[0]; + out2[1] = v12[1] * v22[1]; + return out2; +} +function div(out2, v12, v22) { + out2[0] = v12[0] / v22[0]; + out2[1] = v12[1] / v22[1]; + return out2; +} +function dot(v12, v22) { + return v12[0] * v22[0] + v12[1] * v22[1]; +} +function scale(out2, v, s) { + out2[0] = v[0] * s; + out2[1] = v[1] * s; + return out2; +} +function normalize(out2, v) { + const d = len(v); + if (d === 0) { + out2[0] = 0; + out2[1] = 0; + } else { + out2[0] = v[0] / d; + out2[1] = v[1] / d; + } + return out2; +} +function distance(v12, v22) { + return Math.sqrt((v12[0] - v22[0]) * (v12[0] - v22[0]) + (v12[1] - v22[1]) * (v12[1] - v22[1])); +} +var dist = distance; +function distanceSquare(v12, v22) { + return (v12[0] - v22[0]) * (v12[0] - v22[0]) + (v12[1] - v22[1]) * (v12[1] - v22[1]); +} +var distSquare = distanceSquare; +function negate(out2, v) { + out2[0] = -v[0]; + out2[1] = -v[1]; + return out2; +} +function lerp(out2, v12, v22, t) { + out2[0] = v12[0] + t * (v22[0] - v12[0]); + out2[1] = v12[1] + t * (v22[1] - v12[1]); + return out2; +} +function applyTransform(out2, v, m2) { + const x = v[0]; + const y = v[1]; + out2[0] = m2[0] * x + m2[2] * y + m2[4]; + out2[1] = m2[1] * x + m2[3] * y + m2[5]; + return out2; +} +function min(out2, v12, v22) { + out2[0] = Math.min(v12[0], v22[0]); + out2[1] = Math.min(v12[1], v22[1]); + return out2; +} +function max(out2, v12, v22) { + out2[0] = Math.max(v12[0], v22[0]); + out2[1] = Math.max(v12[1], v22[1]); + return out2; +} + +// node_modules/zrender/src/mixin/Draggable.ts +var Param = class { + constructor(target, e2) { + this.target = target; + this.topTarget = e2 && e2.topTarget; + } +}; +var Draggable = class { + constructor(handler) { + this.handler = handler; + handler.on("mousedown", this._dragStart, this); + handler.on("mousemove", this._drag, this); + handler.on("mouseup", this._dragEnd, this); + } + _dragStart(e2) { + let draggingTarget = e2.target; + while (draggingTarget && !draggingTarget.draggable) { + draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget; + } + if (draggingTarget) { + this._draggingTarget = draggingTarget; + draggingTarget.dragging = true; + this._x = e2.offsetX; + this._y = e2.offsetY; + this.handler.dispatchToElement(new Param(draggingTarget, e2), "dragstart", e2.event); + } + } + _drag(e2) { + const draggingTarget = this._draggingTarget; + if (draggingTarget) { + const x = e2.offsetX; + const y = e2.offsetY; + const dx = x - this._x; + const dy = y - this._y; + this._x = x; + this._y = y; + draggingTarget.drift(dx, dy, e2); + this.handler.dispatchToElement(new Param(draggingTarget, e2), "drag", e2.event); + const dropTarget = this.handler.findHover(x, y, draggingTarget).target; + const lastDropTarget = this._dropTarget; + this._dropTarget = dropTarget; + if (draggingTarget !== dropTarget) { + if (lastDropTarget && dropTarget !== lastDropTarget) { + this.handler.dispatchToElement(new Param(lastDropTarget, e2), "dragleave", e2.event); + } + if (dropTarget && dropTarget !== lastDropTarget) { + this.handler.dispatchToElement(new Param(dropTarget, e2), "dragenter", e2.event); + } + } + } + } + _dragEnd(e2) { + const draggingTarget = this._draggingTarget; + if (draggingTarget) { + draggingTarget.dragging = false; + } + this.handler.dispatchToElement(new Param(draggingTarget, e2), "dragend", e2.event); + if (this._dropTarget) { + this.handler.dispatchToElement(new Param(this._dropTarget, e2), "drop", e2.event); + } + this._draggingTarget = null; + this._dropTarget = null; + } +}; +var Draggable_default = Draggable; + +// node_modules/zrender/src/core/Eventful.ts +var Eventful = class { + constructor(eventProcessors) { + if (eventProcessors) { + this._$eventProcessor = eventProcessors; + } + } + on(event, query, handler, context) { + if (!this._$handlers) { + this._$handlers = {}; + } + const _h = this._$handlers; + if (typeof query === "function") { + context = handler; + handler = query; + query = null; + } + if (!handler || !event) { + return this; + } + const eventProcessor = this._$eventProcessor; + if (query != null && eventProcessor && eventProcessor.normalizeQuery) { + query = eventProcessor.normalizeQuery(query); + } + if (!_h[event]) { + _h[event] = []; + } + for (let i = 0; i < _h[event].length; i++) { + if (_h[event][i].h === handler) { + return this; + } } - function extend(target, source) { - if (Object.assign) { - Object.assign(target, source); - } - else { - for (var key in source) { - if (source.hasOwnProperty(key) && key !== protoKey) { - target[key] = source[key]; - } - } + const wrap = { + h: handler, + query, + ctx: context || this, + callAtLast: handler.zrEventfulCallAtLast + }; + const lastIndex = _h[event].length - 1; + const lastWrap = _h[event][lastIndex]; + lastWrap && lastWrap.callAtLast ? _h[event].splice(lastIndex, 0, wrap) : _h[event].push(wrap); + return this; + } + isSilent(eventName) { + const _h = this._$handlers; + return !_h || !_h[eventName] || !_h[eventName].length; + } + off(eventType, handler) { + const _h = this._$handlers; + if (!_h) { + return this; + } + if (!eventType) { + this._$handlers = {}; + return this; + } + if (handler) { + if (_h[eventType]) { + const newList = []; + for (let i = 0, l = _h[eventType].length; i < l; i++) { + if (_h[eventType][i].h !== handler) { + newList.push(_h[eventType][i]); + } + } + _h[eventType] = newList; + } + if (_h[eventType] && _h[eventType].length === 0) { + delete _h[eventType]; + } + } else { + delete _h[eventType]; + } + return this; + } + trigger(eventType, ...args) { + if (!this._$handlers) { + return this; + } + const _h = this._$handlers[eventType]; + const eventProcessor = this._$eventProcessor; + if (_h) { + const argLen = args.length; + const len2 = _h.length; + for (let i = 0; i < len2; i++) { + const hItem = _h[i]; + if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(eventType, hItem.query)) { + continue; } - return target; - } - function defaults(target, source, overlay) { - var keysArr = keys(source); - for (var i = 0; i < keysArr.length; i++) { - var key = keysArr[i]; - if ((overlay ? source[key] != null : target[key] == null)) { - target[key] = source[key]; - } + switch (argLen) { + case 0: + hItem.h.call(hItem.ctx); + break; + case 1: + hItem.h.call(hItem.ctx, args[0]); + break; + case 2: + hItem.h.call(hItem.ctx, args[0], args[1]); + break; + default: + hItem.h.apply(hItem.ctx, args); + break; } - return target; + } } - var createCanvas = platformApi.createCanvas; - 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; + eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(eventType); + return this; + } + triggerWithContext(type, ...args) { + if (!this._$handlers) { + return this; } - 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; - } - function mixin(target, source, override) { - target = 'prototype' in target ? target.prototype : target; - source = 'prototype' in source ? source.prototype : source; - if (Object.getOwnPropertyNames) { - var keyList = Object.getOwnPropertyNames(source); - for (var i = 0; i < keyList.length; i++) { - var key = keyList[i]; - if (key !== 'constructor') { - if ((override ? source[key] != null : target[key] == null)) { - target[key] = source[key]; - } - } - } + const _h = this._$handlers[type]; + const eventProcessor = this._$eventProcessor; + if (_h) { + const argLen = args.length; + const ctx = args[argLen - 1]; + const len2 = _h.length; + for (let i = 0; i < len2; i++) { + const hItem = _h[i]; + if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) { + continue; } - else { - defaults(target, source, override); + switch (argLen) { + case 0: + hItem.h.call(ctx); + break; + case 1: + hItem.h.call(ctx, args[0]); + break; + case 2: + hItem.h.call(ctx, args[0], args[1]); + break; + default: + hItem.h.apply(ctx, args.slice(1, argLen - 1)); + break; } + } } - function isArrayLike(data) { - if (!data) { - return false; - } - if (typeof data === 'string') { - return false; - } - return typeof data.length === 'number'; + eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type); + return this; + } +}; +var Eventful_default = Eventful; + +// node_modules/zrender/src/core/fourPointsTransform.ts +var LN2 = Math.log(2); +function determinant(rows, rank, rowStart, rowMask, colMask, detCache) { + const cacheKey = rowMask + "-" + colMask; + const fullRank = rows.length; + if (detCache.hasOwnProperty(cacheKey)) { + return detCache[cacheKey]; + } + if (rank === 1) { + const colStart = Math.round(Math.log((1 << fullRank) - 1 & ~colMask) / LN2); + return rows[rowStart][colStart]; + } + const subRowMask = rowMask | 1 << rowStart; + let subRowStart = rowStart + 1; + while (rowMask & 1 << subRowStart) { + subRowStart++; + } + let sum2 = 0; + for (let j = 0, colLocalIdx = 0; j < fullRank; j++) { + const colTag = 1 << j; + if (!(colTag & colMask)) { + sum2 += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache); + colLocalIdx++; + } + } + detCache[cacheKey] = sum2; + return sum2; +} +function buildTransformer(src, dest) { + const mA = [ + [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]], + [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]], + [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]], + [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]], + [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]], + [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]], + [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]], + [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]] + ]; + const detCache = {}; + const det = determinant(mA, 8, 0, 0, 0, detCache); + if (det === 0) { + return; + } + const vh = []; + for (let i = 0; i < 8; i++) { + for (let j = 0; j < 8; j++) { + vh[j] == null && (vh[j] = 0); + vh[j] += ((i + j) % 2 ? -1 : 1) * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) / det * dest[i]; + } + } + return function(out2, srcPointX, srcPointY) { + const pk = srcPointX * vh[6] + srcPointY * vh[7] + 1; + out2[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk; + out2[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk; + }; +} + +// node_modules/zrender/src/core/dom.ts +var EVENT_SAVED_PROP = "___zrEVENTSAVED"; +var _calcOut = []; +function transformLocalCoord(out2, elFrom, elTarget, inX, inY) { + return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true) && transformCoordWithViewport(out2, elTarget, _calcOut[0], _calcOut[1]); +} +function transformCoordWithViewport(out2, el, inX, inY, inverse) { + if (el.getBoundingClientRect && env_default.domSupported && !isCanvasEl(el)) { + const saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {}); + const markers = prepareCoordMarkers(el, saved); + const transformer = preparePointerTransformer(markers, saved, inverse); + if (transformer) { + transformer(out2, inX, inY); + return true; } - function each(arr, cb, context) { - if (!(arr && cb)) { - return; - } - if (arr.forEach && arr.forEach === nativeForEach) { - arr.forEach(cb, context); - } - else if (arr.length === +arr.length) { - for (var i = 0, len = arr.length; i < len; i++) { - cb.call(context, arr[i], i, arr); - } - } - else { - for (var key in arr) { - if (arr.hasOwnProperty(key)) { - cb.call(context, arr[key], key, arr); - } - } - } + } + return false; +} +function prepareCoordMarkers(el, saved) { + let markers = saved.markers; + if (markers) { + return markers; + } + markers = saved.markers = []; + const propLR = ["left", "right"]; + const propTB = ["top", "bottom"]; + for (let i = 0; i < 4; i++) { + const marker = document.createElement("div"); + const stl = marker.style; + const idxLR = i % 2; + const idxTB = (i >> 1) % 2; + stl.cssText = [ + "position: absolute", + "visibility: hidden", + "padding: 0", + "margin: 0", + "border-width: 0", + "user-select: none", + "width:0", + "height:0", + propLR[idxLR] + ":0", + propTB[idxTB] + ":0", + propLR[1 - idxLR] + ":auto", + propTB[1 - idxTB] + ":auto", + "" + ].join("!important;"); + el.appendChild(marker); + markers.push(marker); + } + return markers; +} +function preparePointerTransformer(markers, saved, inverse) { + const transformerName = inverse ? "invTrans" : "trans"; + const transformer = saved[transformerName]; + const oldSrcCoords = saved.srcCoords; + const srcCoords = []; + const destCoords = []; + let oldCoordTheSame = true; + for (let i = 0; i < 4; i++) { + const rect = markers[i].getBoundingClientRect(); + const ii = 2 * i; + const x = rect.left; + const y = rect.top; + srcCoords.push(x, y); + oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1]; + destCoords.push(markers[i].offsetLeft, markers[i].offsetTop); + } + return oldCoordTheSame && transformer ? transformer : (saved.srcCoords = srcCoords, saved[transformerName] = inverse ? buildTransformer(destCoords, srcCoords) : buildTransformer(srcCoords, destCoords)); +} +function isCanvasEl(el) { + return el.nodeName.toUpperCase() === "CANVAS"; +} +var replaceReg = /([&<>"'])/g; +var replaceMap = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" +}; +function encodeHTML(source) { + return source == null ? "" : (source + "").replace(replaceReg, function(str, c) { + return replaceMap[c]; + }); +} + +// node_modules/zrender/src/core/event.ts +var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; +var _calcOut2 = []; +var firefoxNotSupportOffsetXY = env_default.browser.firefox && +env_default.browser.version.split(".")[0] < 39; +function clientToLocal(el, e2, out2, calculate) { + out2 = out2 || {}; + if (calculate) { + calculateZrXY(el, e2, out2); + } else if (firefoxNotSupportOffsetXY && e2.layerX != null && e2.layerX !== e2.offsetX) { + out2.zrX = e2.layerX; + out2.zrY = e2.layerY; + } else if (e2.offsetX != null) { + out2.zrX = e2.offsetX; + out2.zrY = e2.offsetY; + } else { + calculateZrXY(el, e2, out2); + } + return out2; +} +function calculateZrXY(el, e2, out2) { + if (env_default.domSupported && el.getBoundingClientRect) { + const ex = e2.clientX; + const ey = e2.clientY; + if (isCanvasEl(el)) { + const box2 = el.getBoundingClientRect(); + out2.zrX = ex - box2.left; + out2.zrY = ey - box2.top; + return; + } else { + if (transformCoordWithViewport(_calcOut2, el, ex, ey)) { + out2.zrX = _calcOut2[0]; + out2.zrY = _calcOut2[1]; + return; + } } - function map(arr, cb, context) { - if (!arr) { - return []; - } - if (!cb) { - return slice(arr); - } - if (arr.map && arr.map === nativeMap) { - return arr.map(cb, context); - } - else { - var result = []; - for (var i = 0, len = arr.length; i < len; i++) { - result.push(cb.call(context, arr[i], i, arr)); - } - return result; - } + } + out2.zrX = out2.zrY = 0; +} +function getNativeEvent(e2) { + return e2 || window.event; +} +function normalizeEvent(el, e2, calculate) { + e2 = getNativeEvent(e2); + if (e2.zrX != null) { + return e2; + } + const eventType = e2.type; + const isTouch = eventType && eventType.indexOf("touch") >= 0; + if (!isTouch) { + clientToLocal(el, e2, e2, calculate); + const wheelDelta = getWheelDeltaMayPolyfill(e2); + e2.zrDelta = wheelDelta ? wheelDelta / 120 : -(e2.detail || 0) / 3; + } else { + const touch = eventType !== "touchend" ? e2.targetTouches[0] : e2.changedTouches[0]; + touch && clientToLocal(el, touch, e2, calculate); + } + const button = e2.button; + if (e2.which == null && button !== void 0 && MOUSE_EVENT_REG.test(e2.type)) { + e2.which = button & 1 ? 1 : button & 2 ? 3 : button & 4 ? 2 : 0; + } + return e2; +} +function getWheelDeltaMayPolyfill(e2) { + const rawWheelDelta = e2.wheelDelta; + if (rawWheelDelta) { + return rawWheelDelta; + } + const deltaX = e2.deltaX; + const deltaY = e2.deltaY; + if (deltaX == null || deltaY == null) { + return rawWheelDelta; + } + const delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX); + const sign = deltaY > 0 ? -1 : deltaY < 0 ? 1 : deltaX > 0 ? -1 : 1; + return 3 * delta * sign; +} +function addEventListener(el, name, handler, opt) { + el.addEventListener(name, handler, opt); +} +function removeEventListener(el, name, handler, opt) { + el.removeEventListener(name, handler, opt); +} +var stop = function(e2) { + e2.preventDefault(); + e2.stopPropagation(); + e2.cancelBubble = true; +}; +function isMiddleOrRightButtonOnMouseUpDown(e2) { + return e2.which === 2 || e2.which === 3; +} + +// node_modules/zrender/src/core/GestureMgr.ts +var GestureMgr = class { + constructor() { + this._track = []; + } + recognize(event, target, root) { + this._doTrack(event, target, root); + return this._recognize(event); + } + clear() { + this._track.length = 0; + return this; + } + _doTrack(event, target, root) { + const touches = event.touches; + if (!touches) { + return; + } + const trackItem = { + points: [], + touches: [], + target, + event + }; + for (let i = 0, len2 = touches.length; i < len2; i++) { + const touch = touches[i]; + const pos = clientToLocal(root, touch, {}); + trackItem.points.push([pos.zrX, pos.zrY]); + trackItem.touches.push(touch); + } + this._track.push(trackItem); + } + _recognize(event) { + for (let eventName in recognizers) { + if (recognizers.hasOwnProperty(eventName)) { + const gestureInfo = recognizers[eventName](this._track, event); + if (gestureInfo) { + return gestureInfo; + } + } + } + } +}; +function dist2(pointPair) { + const dx = pointPair[1][0] - pointPair[0][0]; + const dy = pointPair[1][1] - pointPair[0][1]; + return Math.sqrt(dx * dx + dy * dy); +} +function center(pointPair) { + return [ + (pointPair[0][0] + pointPair[1][0]) / 2, + (pointPair[0][1] + pointPair[1][1]) / 2 + ]; +} +var recognizers = { + pinch: function(tracks, event) { + const trackLen = tracks.length; + if (!trackLen) { + return; + } + const pinchEnd = (tracks[trackLen - 1] || {}).points; + const pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd; + if (pinchPre && pinchPre.length > 1 && pinchEnd && pinchEnd.length > 1) { + let pinchScale = dist2(pinchEnd) / dist2(pinchPre); + !isFinite(pinchScale) && (pinchScale = 1); + event.pinchScale = pinchScale; + const pinchCenter = center(pinchEnd); + event.pinchX = pinchCenter[0]; + event.pinchY = pinchCenter[1]; + return { + type: "pinch", + target: tracks[0].target, + event + }; + } + } +}; + +// node_modules/zrender/src/core/matrix.ts +var matrix_exports = {}; +__export(matrix_exports, { + clone: () => clone3, + copy: () => copy2, + create: () => create2, + identity: () => identity, + invert: () => invert, + mul: () => mul2, + rotate: () => rotate, + scale: () => scale2, + translate: () => translate +}); +function create2() { + return [1, 0, 0, 1, 0, 0]; +} +function identity(out2) { + out2[0] = 1; + out2[1] = 0; + out2[2] = 0; + out2[3] = 1; + out2[4] = 0; + out2[5] = 0; + return out2; +} +function copy2(out2, m2) { + out2[0] = m2[0]; + out2[1] = m2[1]; + out2[2] = m2[2]; + out2[3] = m2[3]; + out2[4] = m2[4]; + out2[5] = m2[5]; + return out2; +} +function mul2(out2, m1, m2) { + const out0 = m1[0] * m2[0] + m1[2] * m2[1]; + const out1 = m1[1] * m2[0] + m1[3] * m2[1]; + const out22 = m1[0] * m2[2] + m1[2] * m2[3]; + const out3 = m1[1] * m2[2] + m1[3] * m2[3]; + const out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + const out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + out2[0] = out0; + out2[1] = out1; + out2[2] = out22; + out2[3] = out3; + out2[4] = out4; + out2[5] = out5; + return out2; +} +function translate(out2, a, v) { + out2[0] = a[0]; + out2[1] = a[1]; + out2[2] = a[2]; + out2[3] = a[3]; + out2[4] = a[4] + v[0]; + out2[5] = a[5] + v[1]; + return out2; +} +function rotate(out2, a, rad, pivot = [0, 0]) { + const aa = a[0]; + const ac = a[2]; + const atx = a[4]; + const ab = a[1]; + const ad = a[3]; + const aty = a[5]; + const st = Math.sin(rad); + const ct = Math.cos(rad); + out2[0] = aa * ct + ab * st; + out2[1] = -aa * st + ab * ct; + out2[2] = ac * ct + ad * st; + out2[3] = -ac * st + ct * ad; + out2[4] = ct * (atx - pivot[0]) + st * (aty - pivot[1]) + pivot[0]; + out2[5] = ct * (aty - pivot[1]) - st * (atx - pivot[0]) + pivot[1]; + return out2; +} +function scale2(out2, a, v) { + const vx = v[0]; + const vy = v[1]; + out2[0] = a[0] * vx; + out2[1] = a[1] * vy; + out2[2] = a[2] * vx; + out2[3] = a[3] * vy; + out2[4] = a[4] * vx; + out2[5] = a[5] * vy; + return out2; +} +function invert(out2, a) { + const aa = a[0]; + const ac = a[2]; + const atx = a[4]; + const ab = a[1]; + const ad = a[3]; + const aty = a[5]; + let det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out2[0] = ad * det; + out2[1] = -ab * det; + out2[2] = -ac * det; + out2[3] = aa * det; + out2[4] = (ac * aty - ad * atx) * det; + out2[5] = (ab * atx - aa * aty) * det; + return out2; +} +function clone3(a) { + const b = create2(); + copy2(b, a); + return b; +} + +// node_modules/zrender/src/core/Point.ts +var Point = class { + constructor(x, y) { + this.x = x || 0; + this.y = y || 0; + } + copy(other) { + this.x = other.x; + this.y = other.y; + return this; + } + clone() { + return new Point(this.x, this.y); + } + set(x, y) { + this.x = x; + this.y = y; + return this; + } + equal(other) { + return other.x === this.x && other.y === this.y; + } + add(other) { + this.x += other.x; + this.y += other.y; + return this; + } + scale(scalar) { + this.x *= scalar; + this.y *= scalar; + } + scaleAndAdd(other, scalar) { + this.x += other.x * scalar; + this.y += other.y * scalar; + } + sub(other) { + this.x -= other.x; + this.y -= other.y; + return this; + } + dot(other) { + return this.x * other.x + this.y * other.y; + } + len() { + return Math.sqrt(this.x * this.x + this.y * this.y); + } + lenSquare() { + return this.x * this.x + this.y * this.y; + } + normalize() { + const len2 = this.len(); + this.x /= len2; + this.y /= len2; + return this; + } + distance(other) { + const dx = this.x - other.x; + const dy = this.y - other.y; + return Math.sqrt(dx * dx + dy * dy); + } + distanceSquare(other) { + const dx = this.x - other.x; + const dy = this.y - other.y; + return dx * dx + dy * dy; + } + negate() { + this.x = -this.x; + this.y = -this.y; + return this; + } + transform(m2) { + if (!m2) { + return; + } + const x = this.x; + const y = this.y; + this.x = m2[0] * x + m2[2] * y + m2[4]; + this.y = m2[1] * x + m2[3] * y + m2[5]; + return this; + } + toArray(out2) { + out2[0] = this.x; + out2[1] = this.y; + return out2; + } + fromArray(input) { + this.x = input[0]; + this.y = input[1]; + } + static set(p, x, y) { + p.x = x; + p.y = y; + } + static copy(p, p2) { + p.x = p2.x; + p.y = p2.y; + } + static len(p) { + return Math.sqrt(p.x * p.x + p.y * p.y); + } + static lenSquare(p) { + return p.x * p.x + p.y * p.y; + } + static dot(p0, p1) { + return p0.x * p1.x + p0.y * p1.y; + } + static add(out2, p0, p1) { + out2.x = p0.x + p1.x; + out2.y = p0.y + p1.y; + } + static sub(out2, p0, p1) { + out2.x = p0.x - p1.x; + out2.y = p0.y - p1.y; + } + static scale(out2, p0, scalar) { + out2.x = p0.x * scalar; + out2.y = p0.y * scalar; + } + static scaleAndAdd(out2, p0, p1, scalar) { + out2.x = p0.x + p1.x * scalar; + out2.y = p0.y + p1.y * scalar; + } + static lerp(out2, p0, p1, t) { + const onet = 1 - t; + out2.x = onet * p0.x + t * p1.x; + out2.y = onet * p0.y + t * p1.y; + } +}; +var Point_default = Point; + +// node_modules/zrender/src/core/BoundingRect.ts +var mathMin = Math.min; +var mathMax = Math.max; +var lt = new Point_default(); +var rb = new Point_default(); +var lb = new Point_default(); +var rt = new Point_default(); +var minTv = new Point_default(); +var maxTv = new Point_default(); +var BoundingRect = class { + constructor(x, y, width, height) { + if (width < 0) { + x = x + width; + width = -width; + } + if (height < 0) { + y = y + height; + height = -height; + } + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + union(other) { + const x = mathMin(other.x, this.x); + const y = mathMin(other.y, this.y); + if (isFinite(this.x) && isFinite(this.width)) { + this.width = mathMax(other.x + other.width, this.x + this.width) - x; + } else { + this.width = other.width; + } + if (isFinite(this.y) && isFinite(this.height)) { + this.height = mathMax(other.y + other.height, this.y + this.height) - y; + } else { + this.height = other.height; + } + this.x = x; + this.y = y; + } + applyTransform(m2) { + BoundingRect.applyTransform(this, this, m2); + } + calculateTransform(b) { + const a = this; + const sx = b.width / a.width; + const sy = b.height / a.height; + const m2 = create2(); + translate(m2, m2, [-a.x, -a.y]); + scale2(m2, m2, [sx, sy]); + translate(m2, m2, [b.x, b.y]); + return m2; + } + intersect(b, mtv) { + if (!b) { + return false; } - function reduce(arr, cb, memo, context) { - if (!(arr && cb)) { - return; + if (!(b instanceof BoundingRect)) { + b = BoundingRect.create(b); + } + const a = this; + const ax0 = a.x; + const ax1 = a.x + a.width; + const ay0 = a.y; + const ay1 = a.y + a.height; + const bx0 = b.x; + const bx1 = b.x + b.width; + const by0 = b.y; + const by1 = b.y + b.height; + let overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0); + if (mtv) { + let dMin = Infinity; + let dMax = 0; + const d0 = Math.abs(ax1 - bx0); + const d1 = Math.abs(bx1 - ax0); + const d2 = Math.abs(ay1 - by0); + const d3 = Math.abs(by1 - ay0); + const dx = Math.min(d0, d1); + const dy = Math.min(d2, d3); + if (ax1 < bx0 || bx1 < ax0) { + if (dx > dMax) { + dMax = dx; + if (d0 < d1) { + Point_default.set(maxTv, -d0, 0); + } else { + Point_default.set(maxTv, d1, 0); + } } - for (var i = 0, len = arr.length; i < len; i++) { - memo = cb.call(context, memo, arr[i], i, arr); + } else { + if (dx < dMin) { + dMin = dx; + if (d0 < d1) { + Point_default.set(minTv, d0, 0); + } else { + Point_default.set(minTv, -d1, 0); + } } - return memo; - } - function filter(arr, cb, context) { - if (!arr) { - return []; + } + if (ay1 < by0 || by1 < ay0) { + if (dy > dMax) { + dMax = dy; + if (d2 < d3) { + Point_default.set(maxTv, 0, -d2); + } else { + Point_default.set(maxTv, 0, d3); + } } - if (!cb) { - return slice(arr); + } else { + if (dx < dMin) { + dMin = dx; + if (d2 < d3) { + Point_default.set(minTv, 0, d2); + } else { + Point_default.set(minTv, 0, -d3); + } + } + } + } + if (mtv) { + Point_default.copy(mtv, overlap ? minTv : maxTv); + } + return overlap; + } + contain(x, y) { + const rect = this; + return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height; + } + clone() { + return new BoundingRect(this.x, this.y, this.width, this.height); + } + copy(other) { + BoundingRect.copy(this, other); + } + plain() { + return { + x: this.x, + y: this.y, + width: this.width, + height: this.height + }; + } + isFinite() { + return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height); + } + isZero() { + return this.width === 0 || this.height === 0; + } + static create(rect) { + return new BoundingRect(rect.x, rect.y, rect.width, rect.height); + } + static copy(target, source) { + target.x = source.x; + target.y = source.y; + target.width = source.width; + target.height = source.height; + } + static applyTransform(target, source, m2) { + if (!m2) { + if (target !== source) { + BoundingRect.copy(target, source); + } + return; + } + if (m2[1] < 1e-5 && m2[1] > -1e-5 && m2[2] < 1e-5 && m2[2] > -1e-5) { + const sx = m2[0]; + const sy = m2[3]; + const tx = m2[4]; + const ty = m2[5]; + target.x = source.x * sx + tx; + target.y = source.y * sy + ty; + target.width = source.width * sx; + target.height = source.height * sy; + if (target.width < 0) { + target.x += target.width; + target.width = -target.width; + } + if (target.height < 0) { + target.y += target.height; + target.height = -target.height; + } + return; + } + lt.x = lb.x = source.x; + lt.y = rt.y = source.y; + rb.x = rt.x = source.x + source.width; + rb.y = lb.y = source.y + source.height; + lt.transform(m2); + rt.transform(m2); + rb.transform(m2); + lb.transform(m2); + target.x = mathMin(lt.x, rb.x, lb.x, rt.x); + target.y = mathMin(lt.y, rb.y, lb.y, rt.y); + const maxX = mathMax(lt.x, rb.x, lb.x, rt.x); + const maxY = mathMax(lt.y, rb.y, lb.y, rt.y); + target.width = maxX - target.x; + target.height = maxY - target.y; + } +}; +var BoundingRect_default = BoundingRect; + +// node_modules/zrender/src/Handler.ts +var SILENT = "silent"; +function makeEventPacket(eveType, targetInfo, event) { + return { + type: eveType, + event, + target: targetInfo.target, + 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() { + stop(this.event); +} +var EmptyProxy = class extends Eventful_default { + constructor() { + super(...arguments); + this.handler = null; + } + dispose() { + } + setCursor() { + } +}; +var HoveredResult = class { + constructor(x, y) { + this.x = x; + this.y = y; + } +}; +var handlerNames = [ + "click", + "dblclick", + "mousewheel", + "mouseout", + "mouseup", + "mousedown", + "mousemove", + "contextmenu" +]; +var tmpRect = new BoundingRect_default(0, 0, 0, 0); +var Handler = class extends Eventful_default { + constructor(storage2, painter, proxy, painterRoot, pointerSize) { + super(); + this._hovered = new HoveredResult(0, 0); + this.storage = storage2; + this.painter = painter; + this.painterRoot = painterRoot; + this._pointerSize = pointerSize; + proxy = proxy || new EmptyProxy(); + this.proxy = null; + this.setHandlerProxy(proxy); + this._draggingMgr = new Draggable_default(this); + } + setHandlerProxy(proxy) { + if (this.proxy) { + this.proxy.dispose(); + } + if (proxy) { + each(handlerNames, function(name) { + proxy.on && proxy.on(name, this[name], this); + }, this); + proxy.handler = this; + } + this.proxy = proxy; + } + mousemove(event) { + const x = event.zrX; + const y = event.zrY; + const isOutside = isOutsideBoundary(this, x, y); + let lastHovered = this._hovered; + let lastHoveredTarget = lastHovered.target; + if (lastHoveredTarget && !lastHoveredTarget.__zr) { + lastHovered = this.findHover(lastHovered.x, lastHovered.y); + lastHoveredTarget = lastHovered.target; + } + const hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y); + const hoveredTarget = hovered.target; + const proxy = this.proxy; + proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : "default"); + if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) { + this.dispatchToElement(lastHovered, "mouseout", event); + } + this.dispatchToElement(hovered, "mousemove", event); + if (hoveredTarget && hoveredTarget !== lastHoveredTarget) { + this.dispatchToElement(hovered, "mouseover", event); + } + } + mouseout(event) { + const eventControl = event.zrEventControl; + if (eventControl !== "only_globalout") { + this.dispatchToElement(this._hovered, "mouseout", event); + } + if (eventControl !== "no_globalout") { + this.trigger("globalout", {type: "globalout", event}); + } + } + resize() { + this._hovered = new HoveredResult(0, 0); + } + dispatch(eventName, eventArgs) { + const handler = this[eventName]; + handler && handler.call(this, eventArgs); + } + dispose() { + this.proxy.dispose(); + this.storage = null; + this.proxy = null; + this.painter = null; + } + setCursorStyle(cursorStyle) { + const proxy = this.proxy; + proxy.setCursor && proxy.setCursor(cursorStyle); + } + dispatchToElement(targetInfo, eventName, event) { + targetInfo = targetInfo || {}; + let el = targetInfo.target; + if (el && el.silent) { + return; + } + const eventKey = "on" + eventName; + const eventPacket = makeEventPacket(eventName, targetInfo, event); + while (el) { + el[eventKey] && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket)); + el.trigger(eventName, eventPacket); + el = el.__hostTarget ? el.__hostTarget : el.parent; + if (eventPacket.cancelBubble) { + break; + } + } + if (!eventPacket.cancelBubble) { + this.trigger(eventName, eventPacket); + if (this.painter && this.painter.eachOtherLayer) { + this.painter.eachOtherLayer(function(layer) { + if (typeof layer[eventKey] === "function") { + layer[eventKey].call(layer, eventPacket); + } + if (layer.trigger) { + layer.trigger(eventName, eventPacket); + } + }); + } + } + } + findHover(x, y, exclude) { + const list = this.storage.getDisplayList(); + const out2 = new HoveredResult(x, y); + setHoverTarget(list, out2, x, y, exclude); + if (this._pointerSize && !out2.target) { + const candidates = []; + const pointerSize = this._pointerSize; + const targetSizeHalf = pointerSize / 2; + const pointerRect = new BoundingRect_default(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize); + for (let i = list.length - 1; i >= 0; i--) { + const el = list[i]; + if (el !== exclude && !el.ignore && !el.ignoreCoarsePointer && (!el.parent || !el.parent.ignoreCoarsePointer)) { + tmpRect.copy(el.getBoundingRect()); + if (el.transform) { + tmpRect.applyTransform(el.transform); + } + if (tmpRect.intersect(pointerRect)) { + candidates.push(el); + } + } + } + if (candidates.length) { + const rStep = 4; + const thetaStep = Math.PI / 12; + const PI210 = Math.PI * 2; + for (let r = 0; r < targetSizeHalf; r += rStep) { + for (let theta = 0; theta < PI210; theta += thetaStep) { + const x1 = x + r * Math.cos(theta); + const y1 = y + r * Math.sin(theta); + setHoverTarget(candidates, out2, x1, y1, exclude); + if (out2.target) { + return out2; + } + } + } + } + } + return out2; + } + processGesture(event, stage) { + if (!this._gestureMgr) { + this._gestureMgr = new GestureMgr(); + } + const gestureMgr = this._gestureMgr; + stage === "start" && gestureMgr.clear(); + const gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom); + stage === "end" && gestureMgr.clear(); + if (gestureInfo) { + const type = gestureInfo.type; + event.gestureEvent = type; + let res = new HoveredResult(); + res.target = gestureInfo.target; + this.dispatchToElement(res, type, gestureInfo.event); + } + } +}; +each(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(name) { + Handler.prototype[name] = function(event) { + const x = event.zrX; + const y = event.zrY; + const isOutside = isOutsideBoundary(this, x, y); + let hovered; + let hoveredTarget; + if (name !== "mouseup" || !isOutside) { + hovered = this.findHover(x, y); + hoveredTarget = hovered.target; + } + if (name === "mousedown") { + this._downEl = hoveredTarget; + this._downPoint = [event.zrX, event.zrY]; + this._upEl = hoveredTarget; + } else if (name === "mouseup") { + this._upEl = hoveredTarget; + } else if (name === "click") { + if (this._downEl !== this._upEl || !this._downPoint || 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)) { + let el = displayable; + let isSilent; + let ignoreClip = false; + while (el) { + if (el.ignoreClip) { + ignoreClip = true; + } + if (!ignoreClip) { + let clipPath = el.getClipPath(); + if (clipPath && !clipPath.contain(x, y)) { + return false; } - if (arr.filter && arr.filter === nativeFilter) { - return arr.filter(cb, context); + } + if (el.silent) { + isSilent = true; + } + const hostEl = el.__hostTarget; + el = hostEl ? hostEl : el.parent; + } + return isSilent ? SILENT : true; + } + return false; +} +function setHoverTarget(list, out2, x, y, exclude) { + for (let i = list.length - 1; i >= 0; i--) { + const el = list[i]; + let hoverCheckResult; + if (el !== exclude && !el.ignore && (hoverCheckResult = isHover(el, x, y))) { + !out2.topTarget && (out2.topTarget = el); + if (hoverCheckResult !== SILENT) { + out2.target = el; + break; + } + } + } +} +function isOutsideBoundary(handlerInstance, x, y) { + const painter = handlerInstance.painter; + return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight(); +} +var Handler_default = Handler; + +// node_modules/zrender/src/core/timsort.ts +var DEFAULT_MIN_MERGE = 32; +var DEFAULT_MIN_GALLOPING = 7; +function minRunLength(n) { + var r = 0; + while (n >= DEFAULT_MIN_MERGE) { + r |= n & 1; + n >>= 1; + } + return n + r; +} +function makeAscendingRun(array, lo, hi, compare2) { + var runHi = lo + 1; + if (runHi === hi) { + return 1; + } + if (compare2(array[runHi++], array[lo]) < 0) { + while (runHi < hi && compare2(array[runHi], array[runHi - 1]) < 0) { + runHi++; + } + reverseRun(array, lo, runHi); + } else { + while (runHi < hi && compare2(array[runHi], array[runHi - 1]) >= 0) { + runHi++; + } + } + return runHi - lo; +} +function reverseRun(array, lo, hi) { + hi--; + while (lo < hi) { + var t = array[lo]; + array[lo++] = array[hi]; + array[hi--] = t; + } +} +function binaryInsertionSort(array, lo, hi, start2, compare2) { + if (start2 === lo) { + start2++; + } + for (; start2 < hi; start2++) { + var pivot = array[start2]; + var left = lo; + var right = start2; + var mid; + while (left < right) { + mid = left + right >>> 1; + if (compare2(pivot, array[mid]) < 0) { + right = mid; + } else { + left = mid + 1; + } + } + var n = start2 - left; + switch (n) { + case 3: + array[left + 3] = array[left + 2]; + case 2: + array[left + 2] = array[left + 1]; + case 1: + array[left + 1] = array[left]; + break; + default: + while (n > 0) { + array[left + n] = array[left + n - 1]; + n--; + } + } + array[left] = pivot; + } +} +function gallopLeft(value, array, start2, length2, hint, compare2) { + var lastOffset = 0; + var maxOffset = 0; + var offset = 1; + if (compare2(value, array[start2 + hint]) > 0) { + maxOffset = length2 - hint; + while (offset < maxOffset && compare2(value, array[start2 + hint + offset]) > 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + lastOffset += hint; + offset += hint; + } else { + maxOffset = hint + 1; + while (offset < maxOffset && compare2(value, array[start2 + hint - offset]) <= 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + var tmp = lastOffset; + lastOffset = hint - offset; + offset = hint - tmp; + } + lastOffset++; + while (lastOffset < offset) { + var m2 = lastOffset + (offset - lastOffset >>> 1); + if (compare2(value, array[start2 + m2]) > 0) { + lastOffset = m2 + 1; + } else { + offset = m2; + } + } + return offset; +} +function gallopRight(value, array, start2, length2, hint, compare2) { + var lastOffset = 0; + var maxOffset = 0; + var offset = 1; + if (compare2(value, array[start2 + hint]) < 0) { + maxOffset = hint + 1; + while (offset < maxOffset && compare2(value, array[start2 + hint - offset]) < 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + var tmp = lastOffset; + lastOffset = hint - offset; + offset = hint - tmp; + } else { + maxOffset = length2 - hint; + while (offset < maxOffset && compare2(value, array[start2 + hint + offset]) >= 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + lastOffset += hint; + offset += hint; + } + lastOffset++; + while (lastOffset < offset) { + var m2 = lastOffset + (offset - lastOffset >>> 1); + if (compare2(value, array[start2 + m2]) < 0) { + offset = m2; + } else { + lastOffset = m2 + 1; + } + } + return offset; +} +function TimSort(array, compare2) { + let minGallop = DEFAULT_MIN_GALLOPING; + let runStart; + let runLength; + let stackSize = 0; + var tmp = []; + runStart = []; + runLength = []; + function pushRun(_runStart, _runLength) { + runStart[stackSize] = _runStart; + runLength[stackSize] = _runLength; + stackSize += 1; + } + function mergeRuns() { + while (stackSize > 1) { + var n = stackSize - 2; + if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) { + if (runLength[n - 1] < runLength[n + 1]) { + n--; + } + } else if (runLength[n] > runLength[n + 1]) { + break; + } + mergeAt(n); + } + } + function forceMergeRuns() { + while (stackSize > 1) { + var n = stackSize - 2; + if (n > 0 && runLength[n - 1] < runLength[n + 1]) { + n--; + } + mergeAt(n); + } + } + function mergeAt(i) { + var start1 = runStart[i]; + var length1 = runLength[i]; + var start2 = runStart[i + 1]; + var length2 = runLength[i + 1]; + runLength[i] = length1 + length2; + if (i === stackSize - 3) { + runStart[i + 1] = runStart[i + 2]; + runLength[i + 1] = runLength[i + 2]; + } + stackSize--; + var k = gallopRight(array[start2], array, start1, length1, 0, compare2); + start1 += k; + length1 -= k; + if (length1 === 0) { + return; + } + length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare2); + if (length2 === 0) { + return; + } + if (length1 <= length2) { + mergeLow(start1, length1, start2, length2); + } else { + mergeHigh(start1, length1, start2, length2); + } + } + function mergeLow(start1, length1, start2, length2) { + var i = 0; + for (i = 0; i < length1; i++) { + tmp[i] = array[start1 + i]; + } + var cursor1 = 0; + var cursor2 = start2; + var dest = start1; + array[dest++] = array[cursor2++]; + if (--length2 === 0) { + for (i = 0; i < length1; i++) { + array[dest + i] = tmp[cursor1 + i]; + } + return; + } + if (length1 === 1) { + for (i = 0; i < length2; i++) { + array[dest + i] = array[cursor2 + i]; + } + array[dest + length2] = tmp[cursor1]; + return; + } + var _minGallop = minGallop; + var count1; + var count2; + var exit; + while (1) { + count1 = 0; + count2 = 0; + exit = false; + do { + if (compare2(array[cursor2], tmp[cursor1]) < 0) { + array[dest++] = array[cursor2++]; + count2++; + count1 = 0; + if (--length2 === 0) { + exit = true; + break; + } + } else { + array[dest++] = tmp[cursor1++]; + count1++; + count2 = 0; + if (--length1 === 1) { + exit = true; + break; + } } - else { - var result = []; - for (var i = 0, len = arr.length; i < len; i++) { - if (cb.call(context, arr[i], i, arr)) { - result.push(arr[i]); - } - } - return result; + } while ((count1 | count2) < _minGallop); + if (exit) { + break; + } + do { + count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare2); + if (count1 !== 0) { + for (i = 0; i < count1; i++) { + array[dest + i] = tmp[cursor1 + i]; + } + dest += count1; + cursor1 += count1; + length1 -= count1; + if (length1 <= 1) { + exit = true; + break; + } } - } - function find(arr, cb, context) { - if (!(arr && cb)) { - return; + array[dest++] = array[cursor2++]; + if (--length2 === 0) { + exit = true; + break; } - for (var i = 0, len = arr.length; i < len; i++) { - if (cb.call(context, arr[i], i, arr)) { - return arr[i]; - } + count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare2); + if (count2 !== 0) { + for (i = 0; i < count2; i++) { + array[dest + i] = array[cursor2 + i]; + } + dest += count2; + cursor2 += count2; + length2 -= count2; + if (length2 === 0) { + exit = true; + break; + } } - } - function keys(obj) { - if (!obj) { - return []; + array[dest++] = tmp[cursor1++]; + if (--length1 === 1) { + exit = true; + break; } - if (Object.keys) { - return Object.keys(obj); + _minGallop--; + } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + if (exit) { + break; + } + if (_minGallop < 0) { + _minGallop = 0; + } + _minGallop += 2; + } + minGallop = _minGallop; + minGallop < 1 && (minGallop = 1); + if (length1 === 1) { + for (i = 0; i < length2; i++) { + array[dest + i] = array[cursor2 + i]; + } + array[dest + length2] = tmp[cursor1]; + } else if (length1 === 0) { + throw new Error(); + } else { + for (i = 0; i < length1; i++) { + array[dest + i] = tmp[cursor1 + i]; + } + } + } + function mergeHigh(start1, length1, start2, length2) { + var i = 0; + for (i = 0; i < length2; i++) { + tmp[i] = array[start2 + i]; + } + var cursor1 = start1 + length1 - 1; + var cursor2 = length2 - 1; + var dest = start2 + length2 - 1; + var customCursor = 0; + var customDest = 0; + array[dest--] = array[cursor1--]; + if (--length1 === 0) { + customCursor = dest - (length2 - 1); + for (i = 0; i < length2; i++) { + array[customCursor + i] = tmp[i]; + } + return; + } + if (length2 === 1) { + dest -= length1; + cursor1 -= length1; + customDest = dest + 1; + customCursor = cursor1 + 1; + for (i = length1 - 1; i >= 0; i--) { + array[customDest + i] = array[customCursor + i]; + } + array[dest] = tmp[cursor2]; + return; + } + var _minGallop = minGallop; + while (true) { + var count1 = 0; + var count2 = 0; + var exit = false; + do { + if (compare2(tmp[cursor2], array[cursor1]) < 0) { + array[dest--] = array[cursor1--]; + count1++; + count2 = 0; + if (--length1 === 0) { + exit = true; + break; + } + } else { + array[dest--] = tmp[cursor2--]; + count2++; + count1 = 0; + if (--length2 === 1) { + exit = true; + break; + } } - var keyList = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - keyList.push(key); - } + } while ((count1 | count2) < _minGallop); + if (exit) { + break; + } + do { + count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare2); + if (count1 !== 0) { + dest -= count1; + cursor1 -= count1; + length1 -= count1; + customDest = dest + 1; + customCursor = cursor1 + 1; + for (i = count1 - 1; i >= 0; i--) { + array[customDest + i] = array[customCursor + i]; + } + if (length1 === 0) { + exit = true; + break; + } } - return keyList; - } - function bindPolyfill(func, context) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; + array[dest--] = tmp[cursor2--]; + if (--length2 === 1) { + exit = true; + break; } - return function () { - return func.apply(context, args.concat(nativeSlice.call(arguments))); - }; - } - var bind = (protoFunction && isFunction(protoFunction.bind)) - ? protoFunction.call.bind(protoFunction.bind) - : bindPolyfill; - function curry(func) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; + count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare2); + if (count2 !== 0) { + dest -= count2; + cursor2 -= count2; + length2 -= count2; + customDest = dest + 1; + customCursor = cursor2 + 1; + for (i = 0; i < count2; i++) { + array[customDest + i] = tmp[customCursor + i]; + } + if (length2 <= 1) { + exit = true; + break; + } } - return function () { - return func.apply(this, args.concat(nativeSlice.call(arguments))); - }; - } - function isArray(value) { - if (Array.isArray) { - return Array.isArray(value); + array[dest--] = array[cursor1--]; + if (--length1 === 0) { + exit = true; + break; } - return objToString.call(value) === '[object Array]'; - } - function isFunction(value) { - return typeof value === 'function'; - } - function isString(value) { - return typeof value === 'string'; - } - function isStringSafe(value) { - return objToString.call(value) === '[object String]'; - } - function isNumber(value) { - return typeof value === 'number'; - } - function isObject(value) { - var type = typeof value; - return type === 'function' || (!!value && type === 'object'); - } - function isBuiltInObject(value) { - return !!BUILTIN_OBJECT[objToString.call(value)]; + _minGallop--; + } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + if (exit) { + break; + } + if (_minGallop < 0) { + _minGallop = 0; + } + _minGallop += 2; + } + minGallop = _minGallop; + if (minGallop < 1) { + minGallop = 1; + } + if (length2 === 1) { + dest -= length1; + cursor1 -= length1; + customDest = dest + 1; + customCursor = cursor1 + 1; + for (i = length1 - 1; i >= 0; i--) { + array[customDest + i] = array[customCursor + i]; + } + array[dest] = tmp[cursor2]; + } else if (length2 === 0) { + throw new Error(); + } else { + customCursor = dest - (length2 - 1); + for (i = 0; i < length2; i++) { + array[customCursor + i] = tmp[i]; + } + } + } + return { + mergeRuns, + forceMergeRuns, + pushRun + }; +} +function sort(array, compare2, lo, hi) { + if (!lo) { + lo = 0; + } + if (!hi) { + hi = array.length; + } + var remaining = hi - lo; + if (remaining < 2) { + return; + } + var runLength = 0; + if (remaining < DEFAULT_MIN_MERGE) { + runLength = makeAscendingRun(array, lo, hi, compare2); + binaryInsertionSort(array, lo, hi, lo + runLength, compare2); + return; + } + var ts = TimSort(array, compare2); + var minRun = minRunLength(remaining); + do { + runLength = makeAscendingRun(array, lo, hi, compare2); + if (runLength < minRun) { + var force = remaining; + if (force > minRun) { + force = minRun; + } + binaryInsertionSort(array, lo, lo + force, lo + runLength, compare2); + runLength = force; + } + ts.pushRun(lo, runLength); + ts.mergeRuns(); + remaining -= runLength; + lo += runLength; + } while (remaining !== 0); + ts.forceMergeRuns(); +} + +// node_modules/zrender/src/graphic/constants.ts +var REDRAW_BIT = 1; +var STYLE_CHANGED_BIT = 2; +var SHAPE_CHANGED_BIT = 4; + +// node_modules/zrender/src/Storage.ts +var invalidZErrorLogged = false; +function logInvalidZError() { + if (invalidZErrorLogged) { + return; + } + invalidZErrorLogged = true; + console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"); +} +function shapeCompareFunc(a, b) { + if (a.zlevel === b.zlevel) { + if (a.z === b.z) { + return a.z2 - b.z2; + } + return a.z - b.z; + } + return a.zlevel - b.zlevel; +} +var Storage = class { + constructor() { + this._roots = []; + this._displayList = []; + this._displayListLen = 0; + this.displayableSortFunc = shapeCompareFunc; + } + traverse(cb, context) { + for (let i = 0; i < this._roots.length; i++) { + this._roots[i].traverse(cb, context); + } + } + getDisplayList(update, includeIgnore) { + includeIgnore = includeIgnore || false; + const displayList = this._displayList; + if (update || !displayList.length) { + this.updateDisplayList(includeIgnore); + } + return displayList; + } + updateDisplayList(includeIgnore) { + this._displayListLen = 0; + const roots2 = this._roots; + const displayList = this._displayList; + for (let i = 0, len2 = roots2.length; i < len2; i++) { + this._updateAndAddDisplayable(roots2[i], null, includeIgnore); + } + displayList.length = this._displayListLen; + sort(displayList, shapeCompareFunc); + } + _updateAndAddDisplayable(el, clipPaths, includeIgnore) { + if (el.ignore && !includeIgnore) { + return; + } + el.beforeUpdate(); + el.update(); + el.afterUpdate(); + const userSetClipPath = el.getClipPath(); + if (el.ignoreClip) { + clipPaths = null; + } else if (userSetClipPath) { + if (clipPaths) { + clipPaths = clipPaths.slice(); + } else { + clipPaths = []; + } + let currentClipPath = userSetClipPath; + let parentClipPath = el; + while (currentClipPath) { + currentClipPath.parent = parentClipPath; + currentClipPath.updateTransform(); + clipPaths.push(currentClipPath); + parentClipPath = currentClipPath; + currentClipPath = currentClipPath.getClipPath(); + } + } + if (el.childrenRef) { + const children = el.childrenRef(); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (el.__dirty) { + child.__dirty |= REDRAW_BIT; + } + this._updateAndAddDisplayable(child, clipPaths, includeIgnore); + } + el.__dirty = 0; + } else { + const disp = el; + if (clipPaths && clipPaths.length) { + disp.__clipPaths = clipPaths; + } else if (disp.__clipPaths && disp.__clipPaths.length > 0) { + disp.__clipPaths = []; + } + if (isNaN(disp.z)) { + logInvalidZError(); + disp.z = 0; + } + if (isNaN(disp.z2)) { + logInvalidZError(); + disp.z2 = 0; + } + if (isNaN(disp.zlevel)) { + logInvalidZError(); + disp.zlevel = 0; + } + this._displayList[this._displayListLen++] = disp; + } + const decalEl = el.getDecalElement && el.getDecalElement(); + if (decalEl) { + this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore); + } + const textGuide = el.getTextGuideLine(); + if (textGuide) { + this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore); + } + const textEl = el.getTextContent(); + if (textEl) { + this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore); + } + } + addRoot(el) { + if (el.__zr && el.__zr.storage === this) { + return; + } + this._roots.push(el); + } + delRoot(el) { + if (el instanceof Array) { + for (let i = 0, l = el.length; i < l; i++) { + this.delRoot(el[i]); + } + return; + } + const idx = indexOf(this._roots, el); + if (idx >= 0) { + this._roots.splice(idx, 1); + } + } + delAllRoots() { + this._roots = []; + this._displayList = []; + this._displayListLen = 0; + return; + } + getRoots() { + return this._roots; + } + dispose() { + this._displayList = null; + this._roots = null; + } +}; +var Storage_default = Storage; + +// node_modules/zrender/src/animation/requestAnimationFrame.ts +var requestAnimationFrame; +requestAnimationFrame = env_default.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(func) { + return setTimeout(func, 16); +}; +var requestAnimationFrame_default = requestAnimationFrame; + +// node_modules/zrender/src/animation/easing.ts +var easingFuncs = { + linear(k) { + return k; + }, + quadraticIn(k) { + return k * k; + }, + quadraticOut(k) { + return k * (2 - k); + }, + quadraticInOut(k) { + if ((k *= 2) < 1) { + return 0.5 * k * k; + } + return -0.5 * (--k * (k - 2) - 1); + }, + cubicIn(k) { + return k * k * k; + }, + cubicOut(k) { + return --k * k * k + 1; + }, + cubicInOut(k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k; + } + return 0.5 * ((k -= 2) * k * k + 2); + }, + quarticIn(k) { + return k * k * k * k; + }, + quarticOut(k) { + return 1 - --k * k * k * k; + }, + quarticInOut(k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + return -0.5 * ((k -= 2) * k * k * k - 2); + }, + quinticIn(k) { + return k * k * k * k * k; + }, + quinticOut(k) { + return --k * k * k * k * k + 1; + }, + quinticInOut(k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k * k; + } + return 0.5 * ((k -= 2) * k * k * k * k + 2); + }, + sinusoidalIn(k) { + return 1 - Math.cos(k * Math.PI / 2); + }, + sinusoidalOut(k) { + return Math.sin(k * Math.PI / 2); + }, + sinusoidalInOut(k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + }, + exponentialIn(k) { + return k === 0 ? 0 : Math.pow(1024, k - 1); + }, + exponentialOut(k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); + }, + exponentialInOut(k) { + if (k === 0) { + return 0; } - function isTypedArray(value) { - return !!TYPED_ARRAY[objToString.call(value)]; + if (k === 1) { + return 1; + } + if ((k *= 2) < 1) { + return 0.5 * Math.pow(1024, k - 1); + } + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); + }, + circularIn(k) { + return 1 - Math.sqrt(1 - k * k); + }, + circularOut(k) { + return Math.sqrt(1 - --k * k); + }, + circularInOut(k) { + if ((k *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - k * k) - 1); + } + return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); + }, + elasticIn(k) { + let s; + let a = 0.1; + let p = 0.4; + if (k === 0) { + return 0; } - function isDom(value) { - return typeof value === 'object' - && typeof value.nodeType === 'number' - && typeof value.ownerDocument === 'object'; + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + }, + elasticOut(k) { + let s; + let a = 0.1; + let p = 0.4; + if (k === 0) { + return 0; } - function isGradientObject(value) { - return value.colorStops != null; + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1; + }, + elasticInOut(k) { + let s; + let a = 0.1; + let p = 0.4; + if (k === 0) { + return 0; } - function isImagePatternObject(value) { - return value.image != null; + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + if ((k *= 2) < 1) { + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + } + return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; + }, + backIn(k) { + let s = 1.70158; + return k * k * ((s + 1) * k - s); + }, + backOut(k) { + let s = 1.70158; + return --k * k * ((s + 1) * k + s) + 1; + }, + backInOut(k) { + let s = 1.70158 * 1.525; + if ((k *= 2) < 1) { + return 0.5 * (k * k * ((s + 1) * k - s)); + } + return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); + }, + bounceIn(k) { + return 1 - easingFuncs.bounceOut(1 - k); + }, + bounceOut(k) { + if (k < 1 / 2.75) { + return 7.5625 * k * k; + } else if (k < 2 / 2.75) { + return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75; + } else if (k < 2.5 / 2.75) { + return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375; + } else { + return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375; + } + }, + bounceInOut(k) { + if (k < 0.5) { + return easingFuncs.bounceIn(k * 2) * 0.5; + } + return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5; + } +}; +var easing_default = easingFuncs; + +// node_modules/zrender/src/core/curve.ts +var mathPow = Math.pow; +var mathSqrt = Math.sqrt; +var EPSILON = 1e-8; +var EPSILON_NUMERIC = 1e-4; +var THREE_SQRT = mathSqrt(3); +var ONE_THIRD = 1 / 3; +var _v0 = create(); +var _v1 = create(); +var _v2 = create(); +function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; +} +function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; +} +function cubicAt(p0, p1, p2, p3, t) { + const onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2); +} +function cubicDerivativeAt(p0, p1, p2, p3, t) { + const onet = 1 - t; + return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t); +} +function cubicRootAt(p0, p1, p2, p3, val, roots2) { + const a = p3 + 3 * (p1 - p2) - p0; + const b = 3 * (p2 - p1 * 2 + p0); + const c = 3 * (p1 - p0); + const d = p0 - val; + const A = b * b - 3 * a * c; + const B = b * c - 9 * a * d; + const C = c * c - 3 * b * d; + let n = 0; + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots2[0] = 0; + } else { + const t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots2[n++] = t1; + } + } + } else { + const disc = B * B - 4 * A * C; + if (isAroundZero(disc)) { + const K = B / A; + const t1 = -b / a + K; + const t2 = -K / 2; + if (t1 >= 0 && t1 <= 1) { + roots2[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots2[n++] = t2; + } + } else if (disc > 0) { + const discSqrt = mathSqrt(disc); + let Y1 = A * b + 1.5 * a * (-B + discSqrt); + let Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -mathPow(-Y1, ONE_THIRD); + } else { + Y1 = mathPow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -mathPow(-Y2, ONE_THIRD); + } else { + Y2 = mathPow(Y2, ONE_THIRD); + } + const t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots2[n++] = t1; + } + } else { + const T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A)); + const theta = Math.acos(T) / 3; + const ASqrt = mathSqrt(A); + const tmp = Math.cos(theta); + const t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + const t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + const t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots2[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots2[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots2[n++] = t3; + } + } + } + return n; +} +function cubicExtrema(p0, p1, p2, p3, extrema2) { + const b = 6 * p2 - 12 * p1 + 6 * p0; + const a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + const c = 3 * p1 - 3 * p0; + let n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + const t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + extrema2[n++] = t1; + } + } + } else { + const disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema2[0] = -b / (2 * a); + } else if (disc > 0) { + const discSqrt = mathSqrt(disc); + const t1 = (-b + discSqrt) / (2 * a); + const t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema2[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema2[n++] = t2; + } + } + } + return n; +} +function cubicSubdivide(p0, p1, p2, p3, t, out2) { + const p01 = (p1 - p0) * t + p0; + const p12 = (p2 - p1) * t + p1; + const p23 = (p3 - p2) * t + p2; + const p012 = (p12 - p01) * t + p01; + const p123 = (p23 - p12) * t + p12; + const p0123 = (p123 - p012) * t + p012; + out2[0] = p0; + out2[1] = p01; + out2[2] = p012; + out2[3] = p0123; + out2[4] = p0123; + out2[5] = p123; + out2[6] = p23; + out2[7] = p3; +} +function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out2) { + let t; + let interval = 5e-3; + let d = Infinity; + let prev; + let next; + let d1; + let d2; + _v0[0] = x; + _v0[1] = y; + for (let _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + d1 = distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + for (let i = 0; i < 32; i++) { + if (interval < EPSILON_NUMERIC) { + break; + } + prev = t - interval; + next = t + interval; + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + d1 = distSquare(_v1, _v0); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + d2 = distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } + if (out2) { + out2[0] = cubicAt(x0, x1, x2, x3, t); + out2[1] = cubicAt(y0, y1, y2, y3, t); + } + return mathSqrt(d); +} +function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) { + let px = x0; + let py = y0; + let d = 0; + const step = 1 / iteration; + for (let i = 1; i <= iteration; i++) { + let t = i * step; + const x = cubicAt(x0, x1, x2, x3, t); + const y = cubicAt(y0, y1, y2, y3, t); + const dx = x - px; + const dy = y - py; + d += Math.sqrt(dx * dx + dy * dy); + px = x; + py = y; + } + return d; +} +function quadraticAt(p0, p1, p2, t) { + const onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; +} +function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); +} +function quadraticRootAt(p0, p1, p2, val, roots2) { + const a = p0 - 2 * p1 + p2; + const b = 2 * (p1 - p0); + const c = p0 - val; + let n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + const t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots2[n++] = t1; + } + } + } else { + const disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + const t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots2[n++] = t1; + } + } else if (disc > 0) { + const discSqrt = mathSqrt(disc); + const t1 = (-b + discSqrt) / (2 * a); + const t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots2[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots2[n++] = t2; + } + } + } + return n; +} +function quadraticExtremum(p0, p1, p2) { + const divider = p0 + p2 - 2 * p1; + if (divider === 0) { + return 0.5; + } else { + return (p0 - p1) / divider; + } +} +function quadraticSubdivide(p0, p1, p2, t, out2) { + const p01 = (p1 - p0) * t + p0; + const p12 = (p2 - p1) * t + p1; + const p012 = (p12 - p01) * t + p01; + out2[0] = p0; + out2[1] = p01; + out2[2] = p012; + out2[3] = p012; + out2[4] = p12; + out2[5] = p2; +} +function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out2) { + let t; + let interval = 5e-3; + let d = Infinity; + _v0[0] = x; + _v0[1] = y; + for (let _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + const d1 = distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + for (let i = 0; i < 32; i++) { + if (interval < EPSILON_NUMERIC) { + break; + } + const prev = t - interval; + const next = t + interval; + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + const d1 = distSquare(_v1, _v0); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + const d2 = distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } + if (out2) { + out2[0] = quadraticAt(x0, x1, x2, t); + out2[1] = quadraticAt(y0, y1, y2, t); + } + return mathSqrt(d); +} +function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) { + let px = x0; + let py = y0; + let d = 0; + const step = 1 / iteration; + for (let i = 1; i <= iteration; i++) { + let t = i * step; + const x = quadraticAt(x0, x1, x2, t); + const y = quadraticAt(y0, y1, y2, t); + const dx = x - px; + const dy = y - py; + d += Math.sqrt(dx * dx + dy * dy); + px = x; + py = y; + } + return d; +} + +// node_modules/zrender/src/animation/cubicEasing.ts +var regexp = /cubic-bezier\(([0-9,\.e ]+)\)/; +function createCubicEasingFunc(cubicEasingStr) { + const cubic2 = cubicEasingStr && regexp.exec(cubicEasingStr); + if (cubic2) { + const points4 = cubic2[1].split(","); + const a = +trim(points4[0]); + const b = +trim(points4[1]); + const c = +trim(points4[2]); + const d = +trim(points4[3]); + if (isNaN(a + b + c + d)) { + return; + } + const roots2 = []; + return (p) => { + return p <= 0 ? 0 : p >= 1 ? 1 : cubicRootAt(0, a, c, 1, p, roots2) && cubicAt(0, b, d, 1, roots2[0]); + }; + } +} + +// node_modules/zrender/src/animation/Clip.ts +var Clip = class { + constructor(opts) { + this._inited = false; + this._startTime = 0; + this._pausedTime = 0; + this._paused = false; + this._life = opts.life || 1e3; + this._delay = opts.delay || 0; + this.loop = opts.loop || false; + this.onframe = opts.onframe || noop; + this.ondestroy = opts.ondestroy || noop; + this.onrestart = opts.onrestart || noop; + opts.easing && this.setEasing(opts.easing); + } + step(globalTime, deltaTime) { + if (!this._inited) { + this._startTime = globalTime + this._delay; + this._inited = true; + } + if (this._paused) { + this._pausedTime += deltaTime; + return; + } + const life = this._life; + let elapsedTime = globalTime - this._startTime - this._pausedTime; + let percent = elapsedTime / life; + if (percent < 0) { + percent = 0; + } + percent = Math.min(percent, 1); + const easingFunc = this.easingFunc; + const schedule = easingFunc ? easingFunc(percent) : percent; + this.onframe(schedule); + if (percent === 1) { + if (this.loop) { + const remainder = elapsedTime % life; + this._startTime = globalTime - remainder; + this._pausedTime = 0; + this.onrestart(); + } else { + return true; + } } - function isRegExp(value) { - return objToString.call(value) === '[object RegExp]'; + return false; + } + pause() { + this._paused = true; + } + resume() { + this._paused = false; + } + setEasing(easing) { + this.easing = easing; + this.easingFunc = isFunction(easing) ? easing : easing_default[easing] || createCubicEasingFunc(easing); + } +}; +var Clip_default = Clip; + +// node_modules/zrender/src/tool/color.ts +var color_exports = {}; +__export(color_exports, { + fastLerp: () => fastLerp, + fastMapToColor: () => fastMapToColor, + lerp: () => lerp2, + lift: () => lift, + liftColor: () => liftColor, + lum: () => lum, + mapToColor: () => mapToColor, + modifyAlpha: () => modifyAlpha, + modifyHSL: () => modifyHSL, + parse: () => parse, + random: () => random, + stringify: () => stringify, + toHex: () => toHex +}); + +// node_modules/zrender/src/core/LRU.ts +var Entry = class { + constructor(val) { + this.value = val; + } +}; +var LinkedList = class { + constructor() { + this._len = 0; + } + insert(val) { + const entry = new Entry(val); + this.insertEntry(entry); + return entry; + } + insertEntry(entry) { + if (!this.head) { + this.head = this.tail = entry; + } else { + this.tail.next = entry; + entry.prev = this.tail; + entry.next = null; + this.tail = entry; + } + this._len++; + } + remove(entry) { + const prev = entry.prev; + const next = entry.next; + if (prev) { + prev.next = next; + } else { + this.head = next; + } + if (next) { + next.prev = prev; + } else { + this.tail = prev; + } + entry.next = entry.prev = null; + this._len--; + } + len() { + return this._len; + } + clear() { + this.head = this.tail = null; + this._len = 0; + } +}; +var LRU = class { + constructor(maxSize) { + this._list = new LinkedList(); + this._maxSize = 10; + this._map = {}; + this._maxSize = maxSize; + } + put(key, value) { + const list = this._list; + const map3 = this._map; + let removed = null; + if (map3[key] == null) { + const len2 = list.len(); + let entry = this._lastRemovedEntry; + if (len2 >= this._maxSize && len2 > 0) { + const leastUsedEntry = list.head; + list.remove(leastUsedEntry); + delete map3[leastUsedEntry.key]; + removed = leastUsedEntry.value; + this._lastRemovedEntry = leastUsedEntry; + } + if (entry) { + entry.value = value; + } else { + entry = new Entry(value); + } + entry.key = key; + list.insertEntry(entry); + map3[key] = entry; + } + return removed; + } + get(key) { + const entry = this._map[key]; + const list = this._list; + if (entry != null) { + if (entry !== list.tail) { + list.remove(entry); + list.insertEntry(entry); + } + return entry.value; + } + } + clear() { + this._list.clear(); + this._map = {}; + } + len() { + return this._list.len(); + } +}; +var LRU_default = LRU; + +// node_modules/zrender/src/tool/color.ts +var kCSSColorTable = { + transparent: [0, 0, 0, 0], + aliceblue: [240, 248, 255, 1], + antiquewhite: [250, 235, 215, 1], + aqua: [0, 255, 255, 1], + aquamarine: [127, 255, 212, 1], + azure: [240, 255, 255, 1], + beige: [245, 245, 220, 1], + bisque: [255, 228, 196, 1], + black: [0, 0, 0, 1], + blanchedalmond: [255, 235, 205, 1], + blue: [0, 0, 255, 1], + blueviolet: [138, 43, 226, 1], + brown: [165, 42, 42, 1], + burlywood: [222, 184, 135, 1], + cadetblue: [95, 158, 160, 1], + chartreuse: [127, 255, 0, 1], + chocolate: [210, 105, 30, 1], + coral: [255, 127, 80, 1], + cornflowerblue: [100, 149, 237, 1], + cornsilk: [255, 248, 220, 1], + crimson: [220, 20, 60, 1], + cyan: [0, 255, 255, 1], + darkblue: [0, 0, 139, 1], + darkcyan: [0, 139, 139, 1], + darkgoldenrod: [184, 134, 11, 1], + darkgray: [169, 169, 169, 1], + darkgreen: [0, 100, 0, 1], + darkgrey: [169, 169, 169, 1], + darkkhaki: [189, 183, 107, 1], + darkmagenta: [139, 0, 139, 1], + darkolivegreen: [85, 107, 47, 1], + darkorange: [255, 140, 0, 1], + darkorchid: [153, 50, 204, 1], + darkred: [139, 0, 0, 1], + darksalmon: [233, 150, 122, 1], + darkseagreen: [143, 188, 143, 1], + darkslateblue: [72, 61, 139, 1], + darkslategray: [47, 79, 79, 1], + darkslategrey: [47, 79, 79, 1], + darkturquoise: [0, 206, 209, 1], + darkviolet: [148, 0, 211, 1], + deeppink: [255, 20, 147, 1], + deepskyblue: [0, 191, 255, 1], + dimgray: [105, 105, 105, 1], + dimgrey: [105, 105, 105, 1], + dodgerblue: [30, 144, 255, 1], + firebrick: [178, 34, 34, 1], + floralwhite: [255, 250, 240, 1], + forestgreen: [34, 139, 34, 1], + fuchsia: [255, 0, 255, 1], + gainsboro: [220, 220, 220, 1], + ghostwhite: [248, 248, 255, 1], + gold: [255, 215, 0, 1], + goldenrod: [218, 165, 32, 1], + gray: [128, 128, 128, 1], + green: [0, 128, 0, 1], + greenyellow: [173, 255, 47, 1], + grey: [128, 128, 128, 1], + honeydew: [240, 255, 240, 1], + hotpink: [255, 105, 180, 1], + indianred: [205, 92, 92, 1], + indigo: [75, 0, 130, 1], + ivory: [255, 255, 240, 1], + khaki: [240, 230, 140, 1], + lavender: [230, 230, 250, 1], + lavenderblush: [255, 240, 245, 1], + lawngreen: [124, 252, 0, 1], + lemonchiffon: [255, 250, 205, 1], + lightblue: [173, 216, 230, 1], + lightcoral: [240, 128, 128, 1], + lightcyan: [224, 255, 255, 1], + lightgoldenrodyellow: [250, 250, 210, 1], + lightgray: [211, 211, 211, 1], + lightgreen: [144, 238, 144, 1], + lightgrey: [211, 211, 211, 1], + lightpink: [255, 182, 193, 1], + lightsalmon: [255, 160, 122, 1], + lightseagreen: [32, 178, 170, 1], + lightskyblue: [135, 206, 250, 1], + lightslategray: [119, 136, 153, 1], + lightslategrey: [119, 136, 153, 1], + lightsteelblue: [176, 196, 222, 1], + lightyellow: [255, 255, 224, 1], + lime: [0, 255, 0, 1], + limegreen: [50, 205, 50, 1], + linen: [250, 240, 230, 1], + magenta: [255, 0, 255, 1], + maroon: [128, 0, 0, 1], + mediumaquamarine: [102, 205, 170, 1], + mediumblue: [0, 0, 205, 1], + mediumorchid: [186, 85, 211, 1], + mediumpurple: [147, 112, 219, 1], + mediumseagreen: [60, 179, 113, 1], + mediumslateblue: [123, 104, 238, 1], + mediumspringgreen: [0, 250, 154, 1], + mediumturquoise: [72, 209, 204, 1], + mediumvioletred: [199, 21, 133, 1], + midnightblue: [25, 25, 112, 1], + mintcream: [245, 255, 250, 1], + mistyrose: [255, 228, 225, 1], + moccasin: [255, 228, 181, 1], + navajowhite: [255, 222, 173, 1], + navy: [0, 0, 128, 1], + oldlace: [253, 245, 230, 1], + olive: [128, 128, 0, 1], + olivedrab: [107, 142, 35, 1], + orange: [255, 165, 0, 1], + orangered: [255, 69, 0, 1], + orchid: [218, 112, 214, 1], + palegoldenrod: [238, 232, 170, 1], + palegreen: [152, 251, 152, 1], + paleturquoise: [175, 238, 238, 1], + palevioletred: [219, 112, 147, 1], + papayawhip: [255, 239, 213, 1], + peachpuff: [255, 218, 185, 1], + peru: [205, 133, 63, 1], + pink: [255, 192, 203, 1], + plum: [221, 160, 221, 1], + powderblue: [176, 224, 230, 1], + purple: [128, 0, 128, 1], + red: [255, 0, 0, 1], + rosybrown: [188, 143, 143, 1], + royalblue: [65, 105, 225, 1], + saddlebrown: [139, 69, 19, 1], + salmon: [250, 128, 114, 1], + sandybrown: [244, 164, 96, 1], + seagreen: [46, 139, 87, 1], + seashell: [255, 245, 238, 1], + sienna: [160, 82, 45, 1], + silver: [192, 192, 192, 1], + skyblue: [135, 206, 235, 1], + slateblue: [106, 90, 205, 1], + slategray: [112, 128, 144, 1], + slategrey: [112, 128, 144, 1], + snow: [255, 250, 250, 1], + springgreen: [0, 255, 127, 1], + steelblue: [70, 130, 180, 1], + tan: [210, 180, 140, 1], + teal: [0, 128, 128, 1], + thistle: [216, 191, 216, 1], + tomato: [255, 99, 71, 1], + turquoise: [64, 224, 208, 1], + violet: [238, 130, 238, 1], + wheat: [245, 222, 179, 1], + white: [255, 255, 255, 1], + whitesmoke: [245, 245, 245, 1], + yellow: [255, 255, 0, 1], + yellowgreen: [154, 205, 50, 1] +}; +function clampCssByte(i) { + i = Math.round(i); + return i < 0 ? 0 : i > 255 ? 255 : i; +} +function clampCssAngle(i) { + i = Math.round(i); + return i < 0 ? 0 : i > 360 ? 360 : i; +} +function clampCssFloat(f) { + return f < 0 ? 0 : f > 1 ? 1 : f; +} +function parseCssInt(val) { + let str = val; + if (str.length && str.charAt(str.length - 1) === "%") { + return clampCssByte(parseFloat(str) / 100 * 255); + } + return clampCssByte(parseInt(str, 10)); +} +function parseCssFloat(val) { + let str = val; + if (str.length && str.charAt(str.length - 1) === "%") { + return clampCssFloat(parseFloat(str) / 100); + } + return clampCssFloat(parseFloat(str)); +} +function cssHueToRgb(m1, m2, h) { + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + if (h * 6 < 1) { + return m1 + (m2 - m1) * h * 6; + } + if (h * 2 < 1) { + return m2; + } + if (h * 3 < 2) { + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + } + return m1; +} +function lerpNumber(a, b, p) { + return a + (b - a) * p; +} +function setRgba(out2, r, g, b, a) { + out2[0] = r; + out2[1] = g; + out2[2] = b; + out2[3] = a; + return out2; +} +function copyRgba(out2, a) { + out2[0] = a[0]; + out2[1] = a[1]; + out2[2] = a[2]; + out2[3] = a[3]; + return out2; +} +var colorCache = new LRU_default(20); +var lastRemovedArr = null; +function putToCache(colorStr, rgbaArr) { + if (lastRemovedArr) { + copyRgba(lastRemovedArr, rgbaArr); + } + lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice()); +} +function parse(colorStr, rgbaArr) { + if (!colorStr) { + return; + } + rgbaArr = rgbaArr || []; + let cached = colorCache.get(colorStr); + if (cached) { + return copyRgba(rgbaArr, cached); + } + colorStr = colorStr + ""; + let str = colorStr.replace(/ /g, "").toLowerCase(); + if (str in kCSSColorTable) { + copyRgba(rgbaArr, kCSSColorTable[str]); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } + const strLen = str.length; + if (str.charAt(0) === "#") { + if (strLen === 4 || strLen === 5) { + const iv = parseInt(str.slice(1, 4), 16); + if (!(iv >= 0 && iv <= 4095)) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + setRgba(rgbaArr, (iv & 3840) >> 4 | (iv & 3840) >> 8, iv & 240 | (iv & 240) >> 4, iv & 15 | (iv & 15) << 4, strLen === 5 ? parseInt(str.slice(4), 16) / 15 : 1); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } else if (strLen === 7 || strLen === 9) { + const iv = parseInt(str.slice(1, 7), 16); + if (!(iv >= 0 && iv <= 16777215)) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + setRgba(rgbaArr, (iv & 16711680) >> 16, (iv & 65280) >> 8, iv & 255, strLen === 9 ? parseInt(str.slice(7), 16) / 255 : 1); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } + return; + } + let op = str.indexOf("("); + let ep = str.indexOf(")"); + if (op !== -1 && ep + 1 === strLen) { + let fname = str.substr(0, op); + let params = str.substr(op + 1, ep - (op + 1)).split(","); + let alpha = 1; + switch (fname) { + case "rgba": + if (params.length !== 4) { + return params.length === 3 ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1) : setRgba(rgbaArr, 0, 0, 0, 1); + } + alpha = parseCssFloat(params.pop()); + case "rgb": + if (params.length >= 3) { + setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3])); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } else { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + case "hsla": + if (params.length !== 4) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + params[3] = parseCssFloat(params[3]); + hsla2rgba(params, rgbaArr); + putToCache(colorStr, rgbaArr); + return rgbaArr; + case "hsl": + if (params.length !== 3) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + hsla2rgba(params, rgbaArr); + putToCache(colorStr, rgbaArr); + return rgbaArr; + default: + return; } - function eqNaN(value) { - return value !== value; + } + setRgba(rgbaArr, 0, 0, 0, 1); + return; +} +function hsla2rgba(hsla, rgba) { + const h = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360; + const s = parseCssFloat(hsla[1]); + const l = parseCssFloat(hsla[2]); + const m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; + const m1 = l * 2 - m2; + rgba = rgba || []; + setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1); + if (hsla.length === 4) { + rgba[3] = hsla[3]; + } + return rgba; +} +function rgba2hsla(rgba) { + if (!rgba) { + return; + } + const R = rgba[0] / 255; + const G = rgba[1] / 255; + const B = rgba[2] / 255; + const vMin = Math.min(R, G, B); + const vMax = Math.max(R, G, B); + const delta = vMax - vMin; + const L = (vMax + vMin) / 2; + let H; + let S; + if (delta === 0) { + H = 0; + S = 0; + } else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } else { + S = delta / (2 - vMax - vMin); + } + const deltaR = ((vMax - R) / 6 + delta / 2) / delta; + const deltaG = ((vMax - G) / 6 + delta / 2) / delta; + const deltaB = ((vMax - B) / 6 + delta / 2) / delta; + if (R === vMax) { + H = deltaB - deltaG; + } else if (G === vMax) { + H = 1 / 3 + deltaR - deltaB; + } else if (B === vMax) { + H = 2 / 3 + deltaG - deltaR; + } + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + const hsla = [H * 360, S, L]; + if (rgba[3] != null) { + hsla.push(rgba[3]); + } + return hsla; +} +function lift(color2, level) { + const colorArr = parse(color2); + if (colorArr) { + for (let i = 0; i < 3; i++) { + if (level < 0) { + colorArr[i] = colorArr[i] * (1 - level) | 0; + } else { + colorArr[i] = (255 - colorArr[i]) * level + colorArr[i] | 0; + } + if (colorArr[i] > 255) { + colorArr[i] = 255; + } else if (colorArr[i] < 0) { + colorArr[i] = 0; + } + } + return stringify(colorArr, colorArr.length === 4 ? "rgba" : "rgb"); + } +} +function toHex(color2) { + const colorArr = parse(color2); + if (colorArr) { + return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + +colorArr[2]).toString(16).slice(1); + } +} +function fastLerp(normalizedValue, colors, out2) { + if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) { + return; + } + out2 = out2 || []; + const value = normalizedValue * (colors.length - 1); + const leftIndex = Math.floor(value); + const rightIndex = Math.ceil(value); + const leftColor = colors[leftIndex]; + const rightColor = colors[rightIndex]; + const dv = value - leftIndex; + out2[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)); + out2[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)); + out2[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)); + out2[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)); + return out2; +} +var fastMapToColor = fastLerp; +function lerp2(normalizedValue, colors, fullOutput) { + if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) { + return; + } + const value = normalizedValue * (colors.length - 1); + const leftIndex = Math.floor(value); + const rightIndex = Math.ceil(value); + const leftColor = parse(colors[leftIndex]); + const rightColor = parse(colors[rightIndex]); + const dv = value - leftIndex; + const color2 = stringify([ + clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)), + clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)), + clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)), + clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)) + ], "rgba"); + return fullOutput ? { + color: color2, + leftIndex, + rightIndex, + value + } : color2; +} +var mapToColor = lerp2; +function modifyHSL(color2, h, s, l) { + let colorArr = parse(color2); + if (color2) { + colorArr = rgba2hsla(colorArr); + h != null && (colorArr[0] = clampCssAngle(h)); + s != null && (colorArr[1] = parseCssFloat(s)); + l != null && (colorArr[2] = parseCssFloat(l)); + return stringify(hsla2rgba(colorArr), "rgba"); + } +} +function modifyAlpha(color2, alpha) { + const colorArr = parse(color2); + if (colorArr && alpha != null) { + colorArr[3] = clampCssFloat(alpha); + return stringify(colorArr, "rgba"); + } +} +function stringify(arrColor, type) { + if (!arrColor || !arrColor.length) { + return; + } + let colorStr = arrColor[0] + "," + arrColor[1] + "," + arrColor[2]; + if (type === "rgba" || type === "hsva" || type === "hsla") { + colorStr += "," + arrColor[3]; + } + return type + "(" + colorStr + ")"; +} +function lum(color2, backgroundLum) { + const arr = parse(color2); + return arr ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255 + (1 - arr[3]) * backgroundLum : 0; +} +function random() { + return stringify([ + Math.round(Math.random() * 255), + Math.round(Math.random() * 255), + Math.round(Math.random() * 255) + ], "rgb"); +} +var liftedColorCache = new LRU_default(100); +function liftColor(color2) { + if (isString(color2)) { + let liftedColor = liftedColorCache.get(color2); + if (!liftedColor) { + liftedColor = lift(color2, -0.1); + liftedColorCache.put(color2, liftedColor); + } + return liftedColor; + } else if (isGradientObject(color2)) { + const ret = extend({}, color2); + ret.colorStops = map(color2.colorStops, (stop2) => ({ + offset: stop2.offset, + color: lift(stop2.color, -0.1) + })); + return ret; + } + return color2; +} + +// node_modules/zrender/src/svg/helper.ts +var mathRound = Math.round; +function normalizeColor(color2) { + let opacity; + if (!color2 || color2 === "transparent") { + color2 = "none"; + } else if (typeof color2 === "string" && color2.indexOf("rgba") > -1) { + const arr = parse(color2); + if (arr) { + color2 = "rgb(" + arr[0] + "," + arr[1] + "," + arr[2] + ")"; + opacity = arr[3]; + } + } + return { + color: color2, + opacity: opacity == null ? 1 : opacity + }; +} +var EPSILON2 = 1e-4; +function isAroundZero2(transform2) { + return transform2 < EPSILON2 && transform2 > -EPSILON2; +} +function round3(transform2) { + return mathRound(transform2 * 1e3) / 1e3; +} +function round4(transform2) { + return mathRound(transform2 * 1e4) / 1e4; +} +function getMatrixStr(m2) { + return "matrix(" + round3(m2[0]) + "," + round3(m2[1]) + "," + round3(m2[2]) + "," + round3(m2[3]) + "," + round4(m2[4]) + "," + round4(m2[5]) + ")"; +} +var TEXT_ALIGN_TO_ANCHOR = { + left: "start", + right: "end", + center: "middle", + middle: "middle" +}; +function adjustTextY(y, lineHeight, textBaseline) { + if (textBaseline === "top") { + y += lineHeight / 2; + } else if (textBaseline === "bottom") { + y -= lineHeight / 2; + } + return y; +} +function hasShadow(style) { + return style && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY); +} +function getShadowKey(displayable) { + const style = displayable.style; + const globalScale = displayable.getGlobalScale(); + return [ + style.shadowColor, + (style.shadowBlur || 0).toFixed(2), + (style.shadowOffsetX || 0).toFixed(2), + (style.shadowOffsetY || 0).toFixed(2), + globalScale[0], + globalScale[1] + ].join(","); +} +function isImagePattern(val) { + return val && !!val.image; +} +function isSVGPattern(val) { + return val && !!val.svgElement; +} +function isPattern(val) { + return isImagePattern(val) || isSVGPattern(val); +} +function isLinearGradient(val) { + return val.type === "linear"; +} +function isRadialGradient(val) { + return val.type === "radial"; +} +function isGradient(val) { + return val && (val.type === "linear" || val.type === "radial"); +} +function getIdURL(id) { + return `url(#${id})`; +} +function getPathPrecision(el) { + const scale4 = el.getGlobalScale(); + const size = Math.max(scale4[0], scale4[1]); + return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1); +} +function getSRTTransformString(transform2) { + const x = transform2.x || 0; + const y = transform2.y || 0; + const rotation = (transform2.rotation || 0) * RADIAN_TO_DEGREE; + const scaleX = retrieve2(transform2.scaleX, 1); + const scaleY = retrieve2(transform2.scaleY, 1); + const skewX = transform2.skewX || 0; + const skewY = transform2.skewY || 0; + const res = []; + if (x || y) { + res.push(`translate(${x}px,${y}px)`); + } + if (rotation) { + res.push(`rotate(${rotation})`); + } + if (scaleX !== 1 || scaleY !== 1) { + res.push(`scale(${scaleX},${scaleY})`); + } + if (skewX || skewY) { + res.push(`skew(${mathRound(skewX * RADIAN_TO_DEGREE)}deg, ${mathRound(skewY * RADIAN_TO_DEGREE)}deg)`); + } + return res.join(" "); +} +var encodeBase64 = function() { + if (env_default.hasGlobalWindow && isFunction(window.btoa)) { + return function(str) { + return window.btoa(unescape(encodeURIComponent(str))); + }; + } + if (typeof Buffer !== "undefined") { + return function(str) { + return Buffer.from(str).toString("base64"); + }; + } + return function(str) { + if (true) { + logError("Base64 isn't natively supported in the current environment."); + } + return null; + }; +}(); + +// node_modules/zrender/src/animation/Animator.ts +var arraySlice = Array.prototype.slice; +function interpolateNumber(p0, p1, percent) { + return (p1 - p0) * percent + p0; +} +function interpolate1DArray(out2, p0, p1, percent) { + const len2 = p0.length; + for (let i = 0; i < len2; i++) { + out2[i] = interpolateNumber(p0[i], p1[i], percent); + } + return out2; +} +function interpolate2DArray(out2, p0, p1, percent) { + const len2 = p0.length; + const len22 = len2 && p0[0].length; + for (let i = 0; i < len2; i++) { + if (!out2[i]) { + out2[i] = []; + } + for (let j = 0; j < len22; j++) { + out2[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent); + } + } + return out2; +} +function add1DArray(out2, p0, p1, sign) { + const len2 = p0.length; + for (let i = 0; i < len2; i++) { + out2[i] = p0[i] + p1[i] * sign; + } + return out2; +} +function add2DArray(out2, p0, p1, sign) { + const len2 = p0.length; + const len22 = len2 && p0[0].length; + for (let i = 0; i < len2; i++) { + if (!out2[i]) { + out2[i] = []; + } + for (let j = 0; j < len22; j++) { + out2[i][j] = p0[i][j] + p1[i][j] * sign; + } + } + return out2; +} +function fillColorStops(val0, val1) { + const len0 = val0.length; + const len1 = val1.length; + const shorterArr = len0 > len1 ? val1 : val0; + const shorterLen = Math.min(len0, len1); + const last = shorterArr[shorterLen - 1] || {color: [0, 0, 0, 0], offset: 0}; + for (let i = shorterLen; i < Math.max(len0, len1); i++) { + shorterArr.push({ + offset: last.offset, + color: last.color.slice() + }); + } +} +function fillArray(val0, val1, arrDim) { + let arr0 = val0; + let arr1 = val1; + if (!arr0.push || !arr1.push) { + return; + } + const arr0Len = arr0.length; + const arr1Len = arr1.length; + if (arr0Len !== arr1Len) { + const isPreviousLarger = arr0Len > arr1Len; + if (isPreviousLarger) { + arr0.length = arr1Len; + } else { + for (let i = arr0Len; i < arr1Len; i++) { + arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i])); + } + } + } + const len2 = arr0[0] && arr0[0].length; + for (let i = 0; i < arr0.length; i++) { + if (arrDim === 1) { + if (isNaN(arr0[i])) { + arr0[i] = arr1[i]; + } + } else { + for (let j = 0; j < len2; j++) { + if (isNaN(arr0[i][j])) { + arr0[i][j] = arr1[i][j]; + } + } + } + } +} +function cloneValue(value) { + if (isArrayLike(value)) { + const len2 = value.length; + if (isArrayLike(value[0])) { + const ret = []; + for (let i = 0; i < len2; i++) { + ret.push(arraySlice.call(value[i])); + } + return ret; } - function retrieve() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; + return arraySlice.call(value); + } + return value; +} +function rgba2String(rgba) { + rgba[0] = Math.floor(rgba[0]) || 0; + rgba[1] = Math.floor(rgba[1]) || 0; + rgba[2] = Math.floor(rgba[2]) || 0; + rgba[3] = rgba[3] == null ? 1 : rgba[3]; + return "rgba(" + rgba.join(",") + ")"; +} +function guessArrayDim(value) { + return isArrayLike(value && value[0]) ? 2 : 1; +} +var VALUE_TYPE_NUMBER = 0; +var VALUE_TYPE_1D_ARRAY = 1; +var VALUE_TYPE_2D_ARRAY = 2; +var VALUE_TYPE_COLOR = 3; +var VALUE_TYPE_LINEAR_GRADIENT = 4; +var VALUE_TYPE_RADIAL_GRADIENT = 5; +var VALUE_TYPE_UNKOWN = 6; +function isGradientValueType(valType) { + return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT; +} +function isArrayValueType(valType) { + return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY; +} +var tmpRgba = [0, 0, 0, 0]; +var Track = class { + constructor(propName) { + this.keyframes = []; + this.discrete = false; + this._invalid = false; + this._needsSort = false; + this._lastFr = 0; + this._lastFrP = 0; + this.propName = propName; + } + isFinished() { + return this._finished; + } + setFinished() { + this._finished = true; + if (this._additiveTrack) { + this._additiveTrack.setFinished(); + } + } + needsAnimate() { + return this.keyframes.length >= 1; + } + getAdditiveTrack() { + return this._additiveTrack; + } + addKeyframe(time, rawValue, easing) { + this._needsSort = true; + let keyframes = this.keyframes; + let len2 = keyframes.length; + let discrete = false; + let valType = VALUE_TYPE_UNKOWN; + let value = rawValue; + if (isArrayLike(rawValue)) { + let arrayDim = guessArrayDim(rawValue); + valType = arrayDim; + if (arrayDim === 1 && !isNumber(rawValue[0]) || arrayDim === 2 && !isNumber(rawValue[0][0])) { + discrete = true; + } + } else { + if (isNumber(rawValue) && !eqNaN(rawValue)) { + valType = VALUE_TYPE_NUMBER; + } else if (isString(rawValue)) { + if (!isNaN(+rawValue)) { + valType = VALUE_TYPE_NUMBER; + } else { + const colorArray = parse(rawValue); + if (colorArray) { + value = colorArray; + valType = VALUE_TYPE_COLOR; + } } - for (var i = 0, len = args.length; i < len; i++) { - if (args[i] != null) { - return args[i]; - } + } else if (isGradientObject(rawValue)) { + const parsedGradient = extend({}, value); + parsedGradient.colorStops = map(rawValue.colorStops, (colorStop) => ({ + offset: colorStop.offset, + color: parse(colorStop.color) + })); + if (isLinearGradient(rawValue)) { + valType = VALUE_TYPE_LINEAR_GRADIENT; + } else if (isRadialGradient(rawValue)) { + valType = VALUE_TYPE_RADIAL_GRADIENT; } + value = parsedGradient; + } } - function retrieve2(value0, value1) { - return value0 != null - ? value0 - : value1; + if (len2 === 0) { + this.valType = valType; + } else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) { + discrete = true; } - function retrieve3(value0, value1, value2) { - return value0 != null - ? value0 - : value1 != null - ? value1 - : value2; + this.discrete = this.discrete || discrete; + const kf = { + time, + value, + rawValue, + percent: 0 + }; + if (easing) { + kf.easing = easing; + kf.easingFunc = isFunction(easing) ? easing : easing_default[easing] || createCubicEasingFunc(easing); + } + keyframes.push(kf); + return kf; + } + prepare(maxTime, additiveTrack) { + let kfs = this.keyframes; + if (this._needsSort) { + kfs.sort(function(a, b) { + return a.time - b.time; + }); } - function slice(arr) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; + const valType = this.valType; + const kfsLen = kfs.length; + const lastKf = kfs[kfsLen - 1]; + const isDiscrete = this.discrete; + const isArr = isArrayValueType(valType); + const isGradient2 = isGradientValueType(valType); + for (let i = 0; i < kfsLen; i++) { + const kf = kfs[i]; + const value = kf.value; + const lastValue = lastKf.value; + kf.percent = kf.time / maxTime; + if (!isDiscrete) { + if (isArr && i !== kfsLen - 1) { + fillArray(value, lastValue, valType); + } else if (isGradient2) { + fillColorStops(value.colorStops, lastValue.colorStops); + } + } + } + if (!isDiscrete && valType !== VALUE_TYPE_RADIAL_GRADIENT && additiveTrack && this.needsAnimate() && additiveTrack.needsAnimate() && valType === additiveTrack.valType && !additiveTrack._finished) { + this._additiveTrack = additiveTrack; + const startValue = kfs[0].value; + for (let i = 0; i < kfsLen; i++) { + if (valType === VALUE_TYPE_NUMBER) { + kfs[i].additiveValue = kfs[i].value - startValue; + } else if (valType === VALUE_TYPE_COLOR) { + kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1); + } else if (isArrayValueType(valType)) { + kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY ? add1DArray([], kfs[i].value, startValue, -1) : add2DArray([], kfs[i].value, startValue, -1); + } + } + } + } + step(target, percent) { + if (this._finished) { + return; + } + if (this._additiveTrack && this._additiveTrack._finished) { + this._additiveTrack = null; + } + const isAdditive = this._additiveTrack != null; + const valueKey = isAdditive ? "additiveValue" : "value"; + const valType = this.valType; + const keyframes = this.keyframes; + const kfsNum = keyframes.length; + const propName = this.propName; + const isValueColor = valType === VALUE_TYPE_COLOR; + let frameIdx; + const lastFrame = this._lastFr; + const mathMin12 = Math.min; + let frame; + let nextFrame; + if (kfsNum === 1) { + frame = nextFrame = keyframes[0]; + } else { + if (percent < 0) { + frameIdx = 0; + } else if (percent < this._lastFrP) { + const start2 = mathMin12(lastFrame + 1, kfsNum - 1); + for (frameIdx = start2; frameIdx >= 0; frameIdx--) { + if (keyframes[frameIdx].percent <= percent) { + break; + } } - return nativeSlice.apply(arr, args); - } - function normalizeCssArray(val) { - if (typeof (val) === 'number') { - return [val, val, val, val]; + frameIdx = mathMin12(frameIdx, kfsNum - 2); + } else { + for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) { + if (keyframes[frameIdx].percent > percent) { + break; + } } - var len = val.length; - if (len === 2) { - return [val[0], val[1], val[0], val[1]]; + frameIdx = mathMin12(frameIdx - 1, kfsNum - 2); + } + nextFrame = keyframes[frameIdx + 1]; + frame = keyframes[frameIdx]; + } + if (!(frame && nextFrame)) { + return; + } + this._lastFr = frameIdx; + this._lastFrP = percent; + const interval = nextFrame.percent - frame.percent; + let w = interval === 0 ? 1 : mathMin12((percent - frame.percent) / interval, 1); + if (nextFrame.easingFunc) { + w = nextFrame.easingFunc(w); + } + let targetArr = isAdditive ? this._additiveValue : isValueColor ? tmpRgba : target[propName]; + if ((isArrayValueType(valType) || isValueColor) && !targetArr) { + targetArr = this._additiveValue = []; + } + if (this.discrete) { + target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue; + } else if (isArrayValueType(valType)) { + valType === VALUE_TYPE_1D_ARRAY ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w) : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w); + } else if (isGradientValueType(valType)) { + const val = frame[valueKey]; + const nextVal = nextFrame[valueKey]; + const isLinearGradient2 = valType === VALUE_TYPE_LINEAR_GRADIENT; + target[propName] = { + type: isLinearGradient2 ? "linear" : "radial", + x: interpolateNumber(val.x, nextVal.x, w), + y: interpolateNumber(val.y, nextVal.y, w), + colorStops: map(val.colorStops, (colorStop, idx) => { + const nextColorStop = nextVal.colorStops[idx]; + return { + offset: interpolateNumber(colorStop.offset, nextColorStop.offset, w), + color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w)) + }; + }), + global: nextVal.global + }; + if (isLinearGradient2) { + target[propName].x2 = interpolateNumber(val.x2, nextVal.x2, w); + target[propName].y2 = interpolateNumber(val.y2, nextVal.y2, w); + } else { + target[propName].r = interpolateNumber(val.r, nextVal.r, w); + } + } else if (isValueColor) { + interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w); + if (!isAdditive) { + target[propName] = rgba2String(targetArr); + } + } else { + const value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w); + if (isAdditive) { + this._additiveValue = value; + } else { + target[propName] = value; + } + } + if (isAdditive) { + this._addToTarget(target); + } + } + _addToTarget(target) { + const valType = this.valType; + const propName = this.propName; + const additiveValue = this._additiveValue; + if (valType === VALUE_TYPE_NUMBER) { + target[propName] = target[propName] + additiveValue; + } else if (valType === VALUE_TYPE_COLOR) { + parse(target[propName], tmpRgba); + add1DArray(tmpRgba, tmpRgba, additiveValue, 1); + target[propName] = rgba2String(tmpRgba); + } else if (valType === VALUE_TYPE_1D_ARRAY) { + add1DArray(target[propName], target[propName], additiveValue, 1); + } else if (valType === VALUE_TYPE_2D_ARRAY) { + add2DArray(target[propName], target[propName], additiveValue, 1); + } + } +}; +var Animator = class { + constructor(target, loop, allowDiscreteAnimation, additiveTo) { + this._tracks = {}; + this._trackKeys = []; + this._maxTime = 0; + this._started = 0; + this._clip = null; + this._target = target; + this._loop = loop; + if (loop && additiveTo) { + logError("Can' use additive animation on looped animation."); + return; + } + this._additiveAnimators = additiveTo; + this._allowDiscrete = allowDiscreteAnimation; + } + getMaxTime() { + return this._maxTime; + } + getDelay() { + return this._delay; + } + getLoop() { + return this._loop; + } + getTarget() { + return this._target; + } + changeTarget(target) { + this._target = target; + } + when(time, props, easing) { + return this.whenWithKeys(time, props, keys(props), easing); + } + whenWithKeys(time, props, propNames, easing) { + const tracks = this._tracks; + for (let i = 0; i < propNames.length; i++) { + const propName = propNames[i]; + let track = tracks[propName]; + if (!track) { + track = tracks[propName] = new Track(propName); + let initialValue; + const additiveTrack = this._getAdditiveTrack(propName); + if (additiveTrack) { + const addtiveTrackKfs = additiveTrack.keyframes; + const lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1]; + initialValue = lastFinalKf && lastFinalKf.value; + if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) { + initialValue = rgba2String(initialValue); + } + } else { + initialValue = this._target[propName]; } - else if (len === 3) { - return [val[0], val[1], val[2], val[1]]; + if (initialValue == null) { + continue; } - return val; - } - function assert(condition, message) { - if (!condition) { - throw new Error(message); + if (time > 0) { + track.addKeyframe(0, cloneValue(initialValue), easing); + } + this._trackKeys.push(propName); + } + track.addKeyframe(time, cloneValue(props[propName]), easing); + } + this._maxTime = Math.max(this._maxTime, time); + return this; + } + pause() { + this._clip.pause(); + this._paused = true; + } + resume() { + this._clip.resume(); + this._paused = false; + } + isPaused() { + return !!this._paused; + } + duration(duration) { + this._maxTime = duration; + this._force = true; + return this; + } + _doneCallback() { + this._setTracksFinished(); + this._clip = null; + const doneList = this._doneCbs; + if (doneList) { + const len2 = doneList.length; + for (let i = 0; i < len2; i++) { + doneList[i].call(this); + } + } + } + _abortedCallback() { + this._setTracksFinished(); + const animation = this.animation; + const abortedList = this._abortedCbs; + if (animation) { + animation.removeClip(this._clip); + } + this._clip = null; + if (abortedList) { + for (let i = 0; i < abortedList.length; i++) { + abortedList[i].call(this); + } + } + } + _setTracksFinished() { + const tracks = this._tracks; + const tracksKeys = this._trackKeys; + for (let i = 0; i < tracksKeys.length; i++) { + tracks[tracksKeys[i]].setFinished(); + } + } + _getAdditiveTrack(trackName) { + let additiveTrack; + const additiveAnimators = this._additiveAnimators; + if (additiveAnimators) { + for (let i = 0; i < additiveAnimators.length; i++) { + const track = additiveAnimators[i].getTrack(trackName); + if (track) { + additiveTrack = track; + } + } + } + return additiveTrack; + } + start(easing) { + if (this._started > 0) { + return; + } + this._started = 1; + const self2 = this; + const tracks = []; + const maxTime = this._maxTime || 0; + for (let i = 0; i < this._trackKeys.length; i++) { + const propName = this._trackKeys[i]; + const track = this._tracks[propName]; + const additiveTrack = this._getAdditiveTrack(propName); + const kfs = track.keyframes; + const kfsNum = kfs.length; + track.prepare(maxTime, additiveTrack); + if (track.needsAnimate()) { + if (!this._allowDiscrete && track.discrete) { + const lastKf = kfs[kfsNum - 1]; + if (lastKf) { + self2._target[track.propName] = lastKf.rawValue; + } + track.setFinished(); + } else { + tracks.push(track); + } + } + } + if (tracks.length || this._force) { + const clip2 = new Clip_default({ + life: maxTime, + loop: this._loop, + delay: this._delay || 0, + onframe(percent) { + self2._started = 2; + const additiveAnimators = self2._additiveAnimators; + if (additiveAnimators) { + let stillHasAdditiveAnimator = false; + for (let i = 0; i < additiveAnimators.length; i++) { + if (additiveAnimators[i]._clip) { + stillHasAdditiveAnimator = true; + break; + } + } + if (!stillHasAdditiveAnimator) { + self2._additiveAnimators = null; + } + } + for (let i = 0; i < tracks.length; i++) { + tracks[i].step(self2._target, percent); + } + const onframeList = self2._onframeCbs; + if (onframeList) { + for (let i = 0; i < onframeList.length; i++) { + onframeList[i](self2._target, percent); + } + } + }, + ondestroy() { + self2._doneCallback(); } + }); + this._clip = clip2; + if (this.animation) { + this.animation.addClip(clip2); + } + if (easing) { + clip2.setEasing(easing); + } + } else { + this._doneCallback(); + } + return this; + } + stop(forwardToLast) { + if (!this._clip) { + return; + } + const clip2 = this._clip; + if (forwardToLast) { + clip2.onframe(1); + } + this._abortedCallback(); + } + delay(time) { + this._delay = time; + return this; + } + during(cb) { + if (cb) { + if (!this._onframeCbs) { + this._onframeCbs = []; + } + this._onframeCbs.push(cb); + } + return this; + } + done(cb) { + if (cb) { + if (!this._doneCbs) { + this._doneCbs = []; + } + this._doneCbs.push(cb); + } + return this; + } + aborted(cb) { + if (cb) { + if (!this._abortedCbs) { + this._abortedCbs = []; + } + this._abortedCbs.push(cb); + } + return this; + } + getClip() { + return this._clip; + } + getTrack(propName) { + return this._tracks[propName]; + } + getTracks() { + return map(this._trackKeys, (key) => this._tracks[key]); + } + stopTracks(propNames, forwardToLast) { + if (!propNames.length || !this._clip) { + return true; + } + const tracks = this._tracks; + const tracksKeys = this._trackKeys; + for (let i = 0; i < propNames.length; i++) { + const track = tracks[propNames[i]]; + if (track && !track.isFinished()) { + if (forwardToLast) { + track.step(this._target, 1); + } else if (this._started === 1) { + track.step(this._target, 0); + } + track.setFinished(); + } + } + let allAborted = true; + for (let i = 0; i < tracksKeys.length; i++) { + if (!tracks[tracksKeys[i]].isFinished()) { + allAborted = false; + break; + } + } + if (allAborted) { + this._abortedCallback(); + } + return allAborted; + } + saveTo(target, trackKeys, firstOrLast) { + if (!target) { + return; + } + trackKeys = trackKeys || this._trackKeys; + for (let i = 0; i < trackKeys.length; i++) { + const propName = trackKeys[i]; + const track = this._tracks[propName]; + if (!track || track.isFinished()) { + continue; + } + const kfs = track.keyframes; + const kf = kfs[firstOrLast ? 0 : kfs.length - 1]; + if (kf) { + target[propName] = cloneValue(kf.rawValue); + } + } + } + __changeFinalValue(finalProps, trackKeys) { + trackKeys = trackKeys || keys(finalProps); + for (let i = 0; i < trackKeys.length; i++) { + const propName = trackKeys[i]; + const track = this._tracks[propName]; + if (!track) { + continue; + } + const kfs = track.keyframes; + if (kfs.length > 1) { + const lastKf = kfs.pop(); + track.addKeyframe(lastKf.time, finalProps[propName]); + track.prepare(this._maxTime, track.getAdditiveTrack()); + } + } + } +}; +var Animator_default = Animator; + +// node_modules/zrender/src/animation/Animation.ts +function getTime() { + return new Date().getTime(); +} +var Animation = class extends Eventful_default { + constructor(opts) { + super(); + this._running = false; + this._time = 0; + this._pausedTime = 0; + this._pauseStart = 0; + this._paused = false; + opts = opts || {}; + this.stage = opts.stage || {}; + } + addClip(clip2) { + if (clip2.animation) { + this.removeClip(clip2); + } + if (!this._head) { + this._head = this._tail = clip2; + } else { + this._tail.next = clip2; + clip2.prev = this._tail; + clip2.next = null; + this._tail = clip2; + } + clip2.animation = this; + } + addAnimator(animator) { + animator.animation = this; + const clip2 = animator.getClip(); + if (clip2) { + this.addClip(clip2); + } + } + removeClip(clip2) { + if (!clip2.animation) { + return; + } + const prev = clip2.prev; + const next = clip2.next; + if (prev) { + prev.next = next; + } else { + this._head = next; + } + if (next) { + next.prev = prev; + } else { + this._tail = prev; + } + clip2.next = clip2.prev = clip2.animation = null; + } + removeAnimator(animator) { + const clip2 = animator.getClip(); + if (clip2) { + this.removeClip(clip2); + } + animator.animation = null; + } + update(notTriggerFrameAndStageUpdate) { + const time = getTime() - this._pausedTime; + const delta = time - this._time; + let clip2 = this._head; + while (clip2) { + const nextClip = clip2.next; + let finished = clip2.step(time, delta); + if (finished) { + clip2.ondestroy(); + this.removeClip(clip2); + clip2 = nextClip; + } else { + clip2 = nextClip; + } + } + this._time = time; + if (!notTriggerFrameAndStageUpdate) { + this.trigger("frame", delta); + this.stage.update && this.stage.update(); + } + } + _startLoop() { + const self2 = this; + this._running = true; + function step() { + if (self2._running) { + requestAnimationFrame_default(step); + !self2._paused && self2.update(); + } + } + requestAnimationFrame_default(step); + } + start() { + if (this._running) { + return; + } + this._time = getTime(); + this._pausedTime = 0; + this._startLoop(); + } + stop() { + this._running = false; + } + pause() { + if (!this._paused) { + this._pauseStart = getTime(); + this._paused = true; + } + } + resume() { + if (this._paused) { + this._pausedTime += getTime() - this._pauseStart; + this._paused = false; + } + } + clear() { + let clip2 = this._head; + while (clip2) { + let nextClip = clip2.next; + clip2.prev = clip2.next = clip2.animation = null; + clip2 = nextClip; + } + this._head = this._tail = null; + } + isFinished() { + return this._head == null; + } + animate(target, options) { + options = options || {}; + this.start(); + const animator = new Animator_default(target, options.loop); + this.addAnimator(animator); + return animator; + } +}; +var Animation_default = Animation; + +// node_modules/zrender/src/dom/HandlerProxy.ts +var TOUCH_CLICK_DELAY = 300; +var globalEventSupported = env_default.domSupported; +var localNativeListenerNames = function() { + const mouseHandlerNames = [ + "click", + "dblclick", + "mousewheel", + "wheel", + "mouseout", + "mouseup", + "mousedown", + "mousemove", + "contextmenu" + ]; + const touchHandlerNames = [ + "touchstart", + "touchend", + "touchmove" + ]; + const pointerEventNameMap = { + pointerdown: 1, + pointerup: 1, + pointermove: 1, + pointerout: 1 + }; + const pointerHandlerNames = map(mouseHandlerNames, function(name) { + const nm = name.replace("mouse", "pointer"); + return pointerEventNameMap.hasOwnProperty(nm) ? nm : name; + }); + return { + mouse: mouseHandlerNames, + touch: touchHandlerNames, + pointer: pointerHandlerNames + }; +}(); +var globalNativeListenerNames = { + mouse: ["mousemove", "mouseup"], + pointer: ["pointermove", "pointerup"] +}; +var wheelEventSupported = false; +function isPointerFromTouch(event) { + const pointerType = event.pointerType; + return pointerType === "pen" || pointerType === "touch"; +} +function setTouchTimer(scope) { + scope.touching = true; + if (scope.touchTimer != null) { + clearTimeout(scope.touchTimer); + scope.touchTimer = null; + } + scope.touchTimer = setTimeout(function() { + scope.touching = false; + scope.touchTimer = null; + }, 700); +} +function markTouch(event) { + event && (event.zrByTouch = true); +} +function normalizeGlobalEvent(instance, event) { + return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true); +} +function isLocalEl(instance, el) { + let elTmp = el; + let isLocal = false; + while (elTmp && elTmp.nodeType !== 9 && !(isLocal = elTmp.domBelongToZr || elTmp !== el && elTmp === instance.painterRoot)) { + elTmp = elTmp.parentNode; + } + return isLocal; +} +var FakeGlobalEvent = class { + constructor(instance, event) { + this.stopPropagation = noop; + this.stopImmediatePropagation = noop; + this.preventDefault = noop; + this.type = event.type; + this.target = this.currentTarget = instance.dom; + this.pointerType = event.pointerType; + this.clientX = event.clientX; + this.clientY = event.clientY; + } +}; +var localDOMHandlers = { + mousedown(event) { + event = normalizeEvent(this.dom, event); + this.__mayPointerCapture = [event.zrX, event.zrY]; + this.trigger("mousedown", event); + }, + mousemove(event) { + event = normalizeEvent(this.dom, event); + const downPoint = this.__mayPointerCapture; + if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) { + this.__togglePointerCapture(true); + } + this.trigger("mousemove", event); + }, + mouseup(event) { + event = normalizeEvent(this.dom, event); + this.__togglePointerCapture(false); + this.trigger("mouseup", event); + }, + mouseout(event) { + event = normalizeEvent(this.dom, event); + const element = event.toElement || event.relatedTarget; + if (!isLocalEl(this, element)) { + if (this.__pointerCapturing) { + event.zrEventControl = "no_globalout"; + } + this.trigger("mouseout", event); + } + }, + wheel(event) { + wheelEventSupported = true; + event = normalizeEvent(this.dom, event); + this.trigger("mousewheel", event); + }, + mousewheel(event) { + if (wheelEventSupported) { + return; + } + event = normalizeEvent(this.dom, event); + this.trigger("mousewheel", event); + }, + touchstart(event) { + event = normalizeEvent(this.dom, event); + markTouch(event); + this.__lastTouchMoment = new Date(); + this.handler.processGesture(event, "start"); + localDOMHandlers.mousemove.call(this, event); + localDOMHandlers.mousedown.call(this, event); + }, + touchmove(event) { + event = normalizeEvent(this.dom, event); + markTouch(event); + this.handler.processGesture(event, "change"); + localDOMHandlers.mousemove.call(this, event); + }, + touchend(event) { + event = normalizeEvent(this.dom, event); + markTouch(event); + this.handler.processGesture(event, "end"); + localDOMHandlers.mouseup.call(this, event); + if (+new Date() - +this.__lastTouchMoment < TOUCH_CLICK_DELAY) { + localDOMHandlers.click.call(this, event); + } + }, + pointerdown(event) { + localDOMHandlers.mousedown.call(this, event); + }, + pointermove(event) { + if (!isPointerFromTouch(event)) { + localDOMHandlers.mousemove.call(this, event); + } + }, + pointerup(event) { + localDOMHandlers.mouseup.call(this, event); + }, + pointerout(event) { + if (!isPointerFromTouch(event)) { + localDOMHandlers.mouseout.call(this, event); + } + } +}; +each(["click", "dblclick", "contextmenu"], function(name) { + localDOMHandlers[name] = function(event) { + event = normalizeEvent(this.dom, event); + this.trigger(name, event); + }; +}); +var globalDOMHandlers = { + pointermove: function(event) { + if (!isPointerFromTouch(event)) { + globalDOMHandlers.mousemove.call(this, event); + } + }, + pointerup: function(event) { + globalDOMHandlers.mouseup.call(this, event); + }, + mousemove: function(event) { + this.trigger("mousemove", event); + }, + mouseup: function(event) { + const pointerCaptureReleasing = this.__pointerCapturing; + this.__togglePointerCapture(false); + this.trigger("mouseup", event); + if (pointerCaptureReleasing) { + event.zrEventControl = "only_globalout"; + this.trigger("mouseout", event); + } + } +}; +function mountLocalDOMEventListeners(instance, scope) { + const domHandlers = scope.domHandlers; + if (env_default.pointerEventsSupported) { + each(localNativeListenerNames.pointer, function(nativeEventName) { + mountSingleDOMEventListener(scope, nativeEventName, function(event) { + domHandlers[nativeEventName].call(instance, event); + }); + }); + } else { + if (env_default.touchEventsSupported) { + each(localNativeListenerNames.touch, function(nativeEventName) { + mountSingleDOMEventListener(scope, nativeEventName, function(event) { + domHandlers[nativeEventName].call(instance, event); + setTouchTimer(scope); + }); + }); } - function trim(str) { - if (str == null) { - return null; + each(localNativeListenerNames.mouse, function(nativeEventName) { + mountSingleDOMEventListener(scope, nativeEventName, function(event) { + event = getNativeEvent(event); + if (!scope.touching) { + domHandlers[nativeEventName].call(instance, event); } - else if (typeof str.trim === 'function') { - return str.trim(); + }); + }); + } +} +function mountGlobalDOMEventListeners(instance, scope) { + if (env_default.pointerEventsSupported) { + each(globalNativeListenerNames.pointer, mount); + } else if (!env_default.touchEventsSupported) { + each(globalNativeListenerNames.mouse, mount); + } + function mount(nativeEventName) { + function nativeEventListener(event) { + event = getNativeEvent(event); + if (!isLocalEl(instance, event.target)) { + event = normalizeGlobalEvent(instance, event); + scope.domHandlers[nativeEventName].call(instance, event); + } + } + mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, {capture: true}); + } +} +function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) { + scope.mounted[nativeEventName] = listener; + scope.listenerOpts[nativeEventName] = opt; + addEventListener(scope.domTarget, nativeEventName, listener, opt); +} +function unmountDOMEventListeners(scope) { + const mounted = scope.mounted; + for (let nativeEventName in mounted) { + if (mounted.hasOwnProperty(nativeEventName)) { + removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]); + } + } + scope.mounted = {}; +} +var DOMHandlerScope = class { + constructor(domTarget, domHandlers) { + this.mounted = {}; + this.listenerOpts = {}; + this.touching = false; + this.domTarget = domTarget; + this.domHandlers = domHandlers; + } +}; +var HandlerDomProxy = class extends Eventful_default { + constructor(dom, painterRoot) { + super(); + this.__pointerCapturing = false; + this.dom = dom; + this.painterRoot = painterRoot; + this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers); + if (globalEventSupported) { + this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers); + } + mountLocalDOMEventListeners(this, this._localHandlerScope); + } + dispose() { + unmountDOMEventListeners(this._localHandlerScope); + if (globalEventSupported) { + unmountDOMEventListeners(this._globalHandlerScope); + } + } + setCursor(cursorStyle) { + this.dom.style && (this.dom.style.cursor = cursorStyle || "default"); + } + __togglePointerCapture(isPointerCapturing) { + this.__mayPointerCapture = null; + if (globalEventSupported && +this.__pointerCapturing ^ +isPointerCapturing) { + this.__pointerCapturing = isPointerCapturing; + const globalHandlerScope = this._globalHandlerScope; + isPointerCapturing ? mountGlobalDOMEventListeners(this, globalHandlerScope) : unmountDOMEventListeners(globalHandlerScope); + } + } +}; +var HandlerProxy_default = HandlerDomProxy; + +// node_modules/zrender/src/config.ts +var dpr = 1; +if (env_default.hasGlobalWindow) { + dpr = Math.max(window.devicePixelRatio || window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1); +} +var devicePixelRatio = dpr; +var DARK_MODE_THRESHOLD = 0.4; +var DARK_LABEL_COLOR = "#333"; +var LIGHT_LABEL_COLOR = "#ccc"; +var LIGHTER_LABEL_COLOR = "#eee"; + +// node_modules/zrender/src/core/Transformable.ts +var mIdentity = identity; +var EPSILON3 = 5e-5; +function isNotAroundZero2(val) { + return val > EPSILON3 || val < -EPSILON3; +} +var scaleTmp = []; +var tmpTransform = []; +var originTransform = create2(); +var abs = Math.abs; +var Transformable2 = class { + getLocalTransform(m2) { + return Transformable2.getLocalTransform(this, m2); + } + setPosition(arr) { + this.x = arr[0]; + this.y = arr[1]; + } + setScale(arr) { + this.scaleX = arr[0]; + this.scaleY = arr[1]; + } + setSkew(arr) { + this.skewX = arr[0]; + this.skewY = arr[1]; + } + setOrigin(arr) { + this.originX = arr[0]; + this.originY = arr[1]; + } + needLocalTransform() { + return isNotAroundZero2(this.rotation) || isNotAroundZero2(this.x) || isNotAroundZero2(this.y) || isNotAroundZero2(this.scaleX - 1) || isNotAroundZero2(this.scaleY - 1) || isNotAroundZero2(this.skewX) || isNotAroundZero2(this.skewY); + } + updateTransform() { + const parentTransform = this.parent && this.parent.transform; + const needLocalTransform = this.needLocalTransform(); + let m2 = this.transform; + if (!(needLocalTransform || parentTransform)) { + if (m2) { + mIdentity(m2); + this.invTransform = null; + } + return; + } + m2 = m2 || create2(); + if (needLocalTransform) { + this.getLocalTransform(m2); + } else { + mIdentity(m2); + } + if (parentTransform) { + if (needLocalTransform) { + mul2(m2, parentTransform, m2); + } else { + copy2(m2, parentTransform); + } + } + this.transform = m2; + this._resolveGlobalScaleRatio(m2); + } + _resolveGlobalScaleRatio(m2) { + const globalScaleRatio = this.globalScaleRatio; + if (globalScaleRatio != null && globalScaleRatio !== 1) { + this.getGlobalScale(scaleTmp); + const relX = scaleTmp[0] < 0 ? -1 : 1; + const relY = scaleTmp[1] < 0 ? -1 : 1; + const sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0; + const sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0; + m2[0] *= sx; + m2[1] *= sx; + m2[2] *= sy; + m2[3] *= sy; + } + this.invTransform = this.invTransform || create2(); + invert(this.invTransform, m2); + } + getComputedTransform() { + let transformNode = this; + const ancestors = []; + while (transformNode) { + ancestors.push(transformNode); + transformNode = transformNode.parent; + } + while (transformNode = ancestors.pop()) { + transformNode.updateTransform(); + } + return this.transform; + } + setLocalTransform(m2) { + if (!m2) { + return; + } + let sx = m2[0] * m2[0] + m2[1] * m2[1]; + let sy = m2[2] * m2[2] + m2[3] * m2[3]; + const rotation = Math.atan2(m2[1], m2[0]); + const shearX = Math.PI / 2 + rotation - Math.atan2(m2[3], m2[2]); + sy = Math.sqrt(sy) * Math.cos(shearX); + sx = Math.sqrt(sx); + this.skewX = shearX; + this.skewY = 0; + this.rotation = -rotation; + this.x = +m2[4]; + this.y = +m2[5]; + this.scaleX = sx; + this.scaleY = sy; + this.originX = 0; + this.originY = 0; + } + decomposeTransform() { + if (!this.transform) { + return; + } + const parent = this.parent; + let m2 = this.transform; + if (parent && parent.transform) { + parent.invTransform = parent.invTransform || create2(); + mul2(tmpTransform, parent.invTransform, m2); + m2 = tmpTransform; + } + const ox = this.originX; + const oy = this.originY; + if (ox || oy) { + originTransform[4] = ox; + originTransform[5] = oy; + mul2(tmpTransform, m2, originTransform); + tmpTransform[4] -= ox; + tmpTransform[5] -= oy; + m2 = tmpTransform; + } + this.setLocalTransform(m2); + } + getGlobalScale(out2) { + const m2 = this.transform; + out2 = out2 || []; + if (!m2) { + out2[0] = 1; + out2[1] = 1; + return out2; + } + out2[0] = Math.sqrt(m2[0] * m2[0] + m2[1] * m2[1]); + out2[1] = Math.sqrt(m2[2] * m2[2] + m2[3] * m2[3]); + if (m2[0] < 0) { + out2[0] = -out2[0]; + } + if (m2[3] < 0) { + out2[1] = -out2[1]; + } + return out2; + } + transformCoordToLocal(x, y) { + const v22 = [x, y]; + const invTransform = this.invTransform; + if (invTransform) { + applyTransform(v22, v22, invTransform); + } + return v22; + } + transformCoordToGlobal(x, y) { + const v22 = [x, y]; + const transform2 = this.transform; + if (transform2) { + applyTransform(v22, v22, transform2); + } + return v22; + } + getLineScale() { + const m2 = this.transform; + return m2 && abs(m2[0] - 1) > 1e-10 && abs(m2[3] - 1) > 1e-10 ? Math.sqrt(abs(m2[0] * m2[3] - m2[2] * m2[1])) : 1; + } + copyTransform(source) { + copyTransform(this, source); + } + static getLocalTransform(target, m2) { + m2 = m2 || []; + const ox = target.originX || 0; + const oy = target.originY || 0; + const sx = target.scaleX; + const sy = target.scaleY; + const ax = target.anchorX; + const ay = target.anchorY; + const rotation = target.rotation || 0; + const x = target.x; + const y = target.y; + const skewX = target.skewX ? Math.tan(target.skewX) : 0; + const skewY = target.skewY ? Math.tan(-target.skewY) : 0; + if (ox || oy || ax || ay) { + const dx = ox + ax; + const dy = oy + ay; + m2[4] = -dx * sx - skewX * dy * sy; + m2[5] = -dy * sy - skewY * dx * sx; + } else { + m2[4] = m2[5] = 0; + } + m2[0] = sx; + m2[3] = sy; + m2[1] = skewY * sx; + m2[2] = skewX * sy; + rotation && rotate(m2, m2, rotation); + m2[4] += ox + x; + m2[5] += oy + y; + return m2; + } +}; +var Transformable = Transformable2; +Transformable.initDefaultProps = function() { + const proto2 = Transformable2.prototype; + proto2.scaleX = proto2.scaleY = proto2.globalScaleRatio = 1; + proto2.x = proto2.y = proto2.originX = proto2.originY = proto2.skewX = proto2.skewY = proto2.rotation = proto2.anchorX = proto2.anchorY = 0; +}(); +var TRANSFORMABLE_PROPS = [ + "x", + "y", + "originX", + "originY", + "anchorX", + "anchorY", + "rotation", + "scaleX", + "scaleY", + "skewX", + "skewY" +]; +function copyTransform(target, source) { + for (let i = 0; i < TRANSFORMABLE_PROPS.length; i++) { + const propName = TRANSFORMABLE_PROPS[i]; + target[propName] = source[propName]; + } +} +var Transformable_default = Transformable; + +// node_modules/zrender/src/contain/text.ts +var textWidthCache = {}; +function getWidth(text, font) { + font = font || DEFAULT_FONT; + let cacheOfFont = textWidthCache[font]; + if (!cacheOfFont) { + cacheOfFont = textWidthCache[font] = new LRU_default(500); + } + let width = cacheOfFont.get(text); + if (width == null) { + width = platformApi.measureText(text, font).width; + cacheOfFont.put(text, width); + } + return width; +} +function innerGetBoundingRect(text, font, textAlign, textBaseline) { + const width = getWidth(text, font); + const height = getLineHeight(font); + const x = adjustTextX(0, width, textAlign); + const y = adjustTextY2(0, height, textBaseline); + const rect = new BoundingRect_default(x, y, width, height); + return rect; +} +function getBoundingRect(text, font, textAlign, textBaseline) { + const textLines = ((text || "") + "").split("\n"); + const len2 = textLines.length; + if (len2 === 1) { + return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline); + } else { + const uniondRect = new BoundingRect_default(0, 0, 0, 0); + for (let i = 0; i < textLines.length; i++) { + const rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline); + i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect); + } + return uniondRect; + } +} +function adjustTextX(x, width, textAlign) { + if (textAlign === "right") { + x -= width; + } else if (textAlign === "center") { + x -= width / 2; + } + return x; +} +function adjustTextY2(y, height, verticalAlign) { + if (verticalAlign === "middle") { + y -= height / 2; + } else if (verticalAlign === "bottom") { + y -= height; + } + return y; +} +function getLineHeight(font) { + return getWidth("\u56FD", font); +} +function parsePercent(value, maxValue) { + if (typeof value === "string") { + if (value.lastIndexOf("%") >= 0) { + return parseFloat(value) / 100 * maxValue; + } + return parseFloat(value); + } + return value; +} +function calculateTextPosition(out2, opts, rect) { + const textPosition = opts.position || "inside"; + const distance2 = opts.distance != null ? opts.distance : 5; + const height = rect.height; + const width = rect.width; + const halfHeight = height / 2; + let x = rect.x; + let y = rect.y; + let textAlign = "left"; + let textVerticalAlign = "top"; + if (textPosition instanceof Array) { + x += parsePercent(textPosition[0], rect.width); + y += parsePercent(textPosition[1], rect.height); + textAlign = null; + textVerticalAlign = null; + } else { + switch (textPosition) { + case "left": + x -= distance2; + y += halfHeight; + textAlign = "right"; + textVerticalAlign = "middle"; + break; + case "right": + x += distance2 + width; + y += halfHeight; + textVerticalAlign = "middle"; + break; + case "top": + x += width / 2; + y -= distance2; + textAlign = "center"; + textVerticalAlign = "bottom"; + break; + case "bottom": + x += width / 2; + y += height + distance2; + textAlign = "center"; + break; + case "inside": + x += width / 2; + y += halfHeight; + textAlign = "center"; + textVerticalAlign = "middle"; + break; + case "insideLeft": + x += distance2; + y += halfHeight; + textVerticalAlign = "middle"; + break; + case "insideRight": + x += width - distance2; + y += halfHeight; + textAlign = "right"; + textVerticalAlign = "middle"; + break; + case "insideTop": + x += width / 2; + y += distance2; + textAlign = "center"; + break; + case "insideBottom": + x += width / 2; + y += height - distance2; + textAlign = "center"; + textVerticalAlign = "bottom"; + break; + case "insideTopLeft": + x += distance2; + y += distance2; + break; + case "insideTopRight": + x += width - distance2; + y += distance2; + textAlign = "right"; + break; + case "insideBottomLeft": + x += distance2; + y += height - distance2; + textVerticalAlign = "bottom"; + break; + case "insideBottomRight": + x += width - distance2; + y += height - distance2; + textAlign = "right"; + textVerticalAlign = "bottom"; + break; + } + } + out2 = out2 || {}; + out2.x = x; + out2.y = y; + out2.align = textAlign; + out2.verticalAlign = textVerticalAlign; + return out2; +} + +// node_modules/zrender/src/Element.ts +var PRESERVED_NORMAL_STATE = "__zr_normal__"; +var PRIMARY_STATES_KEYS = TRANSFORMABLE_PROPS.concat(["ignore"]); +var DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, (obj, key) => { + obj[key] = true; + return obj; +}, {ignore: false}); +var tmpTextPosCalcRes = {}; +var tmpBoundingRect = new BoundingRect_default(0, 0, 0, 0); +var Element2 = class { + constructor(props) { + this.id = guid(); + this.animators = []; + this.currentStates = []; + this.states = {}; + this._init(props); + } + _init(props) { + this.attr(props); + } + drift(dx, dy, e2) { + switch (this.draggable) { + case "horizontal": + dy = 0; + break; + case "vertical": + dx = 0; + break; + } + let m2 = this.transform; + if (!m2) { + m2 = this.transform = [1, 0, 0, 1, 0, 0]; + } + m2[4] += dx; + m2[5] += dy; + this.decomposeTransform(); + this.markRedraw(); + } + beforeUpdate() { + } + afterUpdate() { + } + update() { + this.updateTransform(); + if (this.__dirty) { + this.updateInnerText(); + } + } + updateInnerText(forceUpdate) { + const textEl = this._textContent; + if (textEl && (!textEl.ignore || forceUpdate)) { + if (!this.textConfig) { + this.textConfig = {}; + } + const textConfig = this.textConfig; + const isLocal = textConfig.local; + const innerTransformable = textEl.innerTransformable; + let textAlign; + let textVerticalAlign; + let textStyleChanged = false; + innerTransformable.parent = isLocal ? this : null; + let innerOrigin = false; + innerTransformable.copyTransform(textEl); + if (textConfig.position != null) { + let layoutRect = tmpBoundingRect; + if (textConfig.layoutRect) { + layoutRect.copy(textConfig.layoutRect); + } else { + layoutRect.copy(this.getBoundingRect()); } - else { - return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + if (!isLocal) { + layoutRect.applyTransform(this.transform); } - } - var primitiveKey = '__ec_primitive__'; - function setAsPrimitive(obj) { - obj[primitiveKey] = true; - } - function isPrimitive(obj) { - return obj[primitiveKey]; - } - var MapPolyfill = (function () { - function MapPolyfill() { - this.data = {}; + if (this.calculateTextPosition) { + this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect); + } else { + calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect); + } + innerTransformable.x = tmpTextPosCalcRes.x; + innerTransformable.y = tmpTextPosCalcRes.y; + textAlign = tmpTextPosCalcRes.align; + textVerticalAlign = tmpTextPosCalcRes.verticalAlign; + const textOrigin = textConfig.origin; + if (textOrigin && textConfig.rotation != null) { + let relOriginX; + let relOriginY; + if (textOrigin === "center") { + relOriginX = layoutRect.width * 0.5; + relOriginY = layoutRect.height * 0.5; + } else { + relOriginX = parsePercent(textOrigin[0], layoutRect.width); + relOriginY = parsePercent(textOrigin[1], layoutRect.height); + } + innerOrigin = true; + innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x); + innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y); } - MapPolyfill.prototype["delete"] = function (key) { - var existed = this.has(key); - if (existed) { - delete this.data[key]; - } - return existed; - }; - MapPolyfill.prototype.has = function (key) { - return this.data.hasOwnProperty(key); - }; - MapPolyfill.prototype.get = function (key) { - return this.data[key]; - }; - MapPolyfill.prototype.set = function (key, value) { - this.data[key] = value; - return this; - }; - MapPolyfill.prototype.keys = function () { - return keys(this.data); - }; - MapPolyfill.prototype.forEach = function (callback) { - var data = this.data; - for (var key in data) { - if (data.hasOwnProperty(key)) { - callback(data[key], key); - } - } - }; - return MapPolyfill; - }()); - var isNativeMapSupported = typeof Map === 'function'; - function maybeNativeMap() { - return (isNativeMapSupported ? new Map() : new MapPolyfill()); - } - var HashMap = (function () { - function HashMap(obj) { - var isArr = isArray(obj); - this.data = maybeNativeMap(); - 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); - } + } + if (textConfig.rotation != null) { + innerTransformable.rotation = textConfig.rotation; + } + const textOffset = textConfig.offset; + if (textOffset) { + innerTransformable.x += textOffset[0]; + innerTransformable.y += textOffset[1]; + if (!innerOrigin) { + innerTransformable.originX = -textOffset[0]; + innerTransformable.originY = -textOffset[1]; } - HashMap.prototype.hasKey = function (key) { - return this.data.has(key); - }; - HashMap.prototype.get = function (key) { - return this.data.get(key); - }; - HashMap.prototype.set = function (key, value) { - this.data.set(key, value); - return value; - }; - HashMap.prototype.each = function (cb, context) { - this.data.forEach(function (value, key) { - cb.call(context, value, key); - }); - }; - HashMap.prototype.keys = function () { - var keys = this.data.keys(); - return isNativeMapSupported - ? Array.from(keys) - : keys; - }; - HashMap.prototype.removeKey = function (key) { - this.data["delete"](key); - }; - return HashMap; - }()); - 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 (var i = 0; i < b.length; i++) { - newArray[i + offset] = b[i]; - } - return newArray; - } - function createObject(proto, properties) { - var obj; - if (Object.create) { - obj = Object.create(proto); - } - else { - var StyleCtor = function () { }; - StyleCtor.prototype = proto; - obj = new StyleCtor(); - } - if (properties) { - extend(obj, properties); - } - return obj; - } - function disableUserSelect(dom) { - var domStyle = dom.style; - domStyle.webkitUserSelect = 'none'; - domStyle.userSelect = 'none'; - domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)'; - domStyle['-webkit-touch-callout'] = 'none'; - } - function hasOwn(own, prop) { - return own.hasOwnProperty(prop); - } - function noop() { } - var RADIAN_TO_DEGREE = 180 / Math.PI; - - var util = /*#__PURE__*/Object.freeze({ - __proto__: null, - guid: guid, - logError: logError, - clone: clone, - merge: merge, - mergeAll: mergeAll, - extend: extend, - defaults: defaults, - createCanvas: createCanvas, - indexOf: indexOf, - inherits: inherits, - mixin: mixin, - isArrayLike: isArrayLike, - each: each, - map: map, - reduce: reduce, - filter: filter, - find: find, - keys: keys, - bind: bind, - curry: curry, - isArray: isArray, - isFunction: isFunction, - isString: isString, - isStringSafe: isStringSafe, - isNumber: isNumber, - isObject: isObject, - isBuiltInObject: isBuiltInObject, - isTypedArray: isTypedArray, - isDom: isDom, - isGradientObject: isGradientObject, - isImagePatternObject: isImagePatternObject, - isRegExp: isRegExp, - eqNaN: eqNaN, - retrieve: retrieve, - retrieve2: retrieve2, - retrieve3: retrieve3, - slice: slice, - normalizeCssArray: normalizeCssArray, - assert: assert, - trim: trim, - setAsPrimitive: setAsPrimitive, - isPrimitive: isPrimitive, - HashMap: HashMap, - createHashMap: createHashMap, - concatArray: concatArray, - createObject: createObject, - disableUserSelect: disableUserSelect, - hasOwn: hasOwn, - noop: noop, - RADIAN_TO_DEGREE: RADIAN_TO_DEGREE - }); - - function create(x, y) { - if (x == null) { - x = 0; - } - if (y == null) { - y = 0; - } - return [x, y]; - } - function copy(out, v) { - out[0] = v[0]; - out[1] = v[1]; - return out; - } - function clone$1(v) { - return [v[0], v[1]]; - } - function set(out, a, b) { - out[0] = a; - out[1] = b; - return out; - } - function add(out, v1, v2) { - out[0] = v1[0] + v2[0]; - out[1] = v1[1] + v2[1]; - return out; - } - function scaleAndAdd(out, v1, v2, a) { - out[0] = v1[0] + v2[0] * a; - out[1] = v1[1] + v2[1] * a; - return out; - } - function sub(out, v1, v2) { - out[0] = v1[0] - v2[0]; - out[1] = v1[1] - v2[1]; - return out; - } - function len(v) { - return Math.sqrt(lenSquare(v)); - } - var length = len; - function lenSquare(v) { - return v[0] * v[0] + v[1] * v[1]; - } - var lengthSquare = lenSquare; - function mul(out, v1, v2) { - out[0] = v1[0] * v2[0]; - out[1] = v1[1] * v2[1]; - return out; - } - function div(out, v1, v2) { - out[0] = v1[0] / v2[0]; - out[1] = v1[1] / v2[1]; - return out; - } - function dot(v1, v2) { - return v1[0] * v2[0] + v1[1] * v2[1]; - } - function scale(out, v, s) { - out[0] = v[0] * s; - out[1] = v[1] * s; - return out; - } - function normalize(out, v) { - var d = len(v); - if (d === 0) { - out[0] = 0; - out[1] = 0; - } - else { - out[0] = v[0] / d; - out[1] = v[1] / d; - } - return out; - } - function distance(v1, v2) { - return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) - + (v1[1] - v2[1]) * (v1[1] - v2[1])); - } - var dist = distance; - function distanceSquare(v1, v2) { - return (v1[0] - v2[0]) * (v1[0] - v2[0]) - + (v1[1] - v2[1]) * (v1[1] - v2[1]); - } - var distSquare = distanceSquare; - function negate(out, v) { - out[0] = -v[0]; - out[1] = -v[1]; - return out; - } - function lerp(out, v1, v2, t) { - out[0] = v1[0] + t * (v2[0] - v1[0]); - out[1] = v1[1] + t * (v2[1] - v1[1]); - return out; - } - function applyTransform(out, v, m) { - var x = v[0]; - var y = v[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; - } - function min(out, v1, v2) { - out[0] = Math.min(v1[0], v2[0]); - out[1] = Math.min(v1[1], v2[1]); - return out; - } - function max(out, v1, v2) { - out[0] = Math.max(v1[0], v2[0]); - out[1] = Math.max(v1[1], v2[1]); - return out; - } - - var vector = /*#__PURE__*/Object.freeze({ - __proto__: null, - create: create, - copy: copy, - clone: clone$1, - set: set, - add: add, - scaleAndAdd: scaleAndAdd, - sub: sub, - len: len, - length: length, - lenSquare: lenSquare, - lengthSquare: lengthSquare, - mul: mul, - div: div, - dot: dot, - scale: scale, - normalize: normalize, - distance: distance, - dist: dist, - distanceSquare: distanceSquare, - distSquare: distSquare, - negate: negate, - lerp: lerp, - applyTransform: applyTransform, - min: min, - max: max - }); - - var Param = (function () { - function Param(target, e) { - this.target = target; - this.topTarget = e && e.topTarget; - } - return Param; - }()); - var Draggable = (function () { - function Draggable(handler) { - this.handler = handler; - handler.on('mousedown', this._dragStart, this); - handler.on('mousemove', this._drag, this); - handler.on('mouseup', this._dragEnd, this); - } - Draggable.prototype._dragStart = function (e) { - var draggingTarget = e.target; - while (draggingTarget && !draggingTarget.draggable) { - draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget; - } - if (draggingTarget) { - this._draggingTarget = draggingTarget; - draggingTarget.dragging = true; - this._x = e.offsetX; - this._y = e.offsetY; - this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event); - } - }; - Draggable.prototype._drag = function (e) { - var draggingTarget = this._draggingTarget; - if (draggingTarget) { - var x = e.offsetX; - var y = e.offsetY; - var dx = x - this._x; - var dy = y - this._y; - this._x = x; - this._y = y; - draggingTarget.drift(dx, dy, e); - this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event); - var dropTarget = this.handler.findHover(x, y, draggingTarget).target; - var lastDropTarget = this._dropTarget; - this._dropTarget = dropTarget; - if (draggingTarget !== dropTarget) { - if (lastDropTarget && dropTarget !== lastDropTarget) { - this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event); - } - if (dropTarget && dropTarget !== lastDropTarget) { - this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event); - } - } - } - }; - Draggable.prototype._dragEnd = function (e) { - var draggingTarget = this._draggingTarget; - if (draggingTarget) { - draggingTarget.dragging = false; - } - this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event); - if (this._dropTarget) { - this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event); - } - this._draggingTarget = null; - this._dropTarget = null; - }; - return Draggable; - }()); - - var Eventful = (function () { - function Eventful(eventProcessors) { - if (eventProcessors) { - this._$eventProcessor = eventProcessors; - } + } + const isInside = textConfig.inside == null ? typeof textConfig.position === "string" && textConfig.position.indexOf("inside") >= 0 : textConfig.inside; + const innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {}); + let textFill; + let textStroke; + let autoStroke; + if (isInside && this.canBeInsideText()) { + textFill = textConfig.insideFill; + textStroke = textConfig.insideStroke; + if (textFill == null || textFill === "auto") { + textFill = this.getInsideTextFill(); } - Eventful.prototype.on = function (event, query, handler, context) { - if (!this._$handlers) { - this._$handlers = {}; - } - var _h = this._$handlers; - if (typeof query === 'function') { - context = handler; - handler = query; - query = null; - } - if (!handler || !event) { - return this; - } - var eventProcessor = this._$eventProcessor; - if (query != null && eventProcessor && eventProcessor.normalizeQuery) { - query = eventProcessor.normalizeQuery(query); - } - if (!_h[event]) { - _h[event] = []; - } - for (var i = 0; i < _h[event].length; i++) { - if (_h[event][i].h === handler) { - return this; - } - } - var wrap = { - h: handler, - query: query, - ctx: (context || this), - 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 this; - }; - Eventful.prototype.isSilent = function (eventName) { - var _h = this._$handlers; - return !_h || !_h[eventName] || !_h[eventName].length; - }; - Eventful.prototype.off = function (eventType, handler) { - var _h = this._$handlers; - if (!_h) { - return this; - } - if (!eventType) { - this._$handlers = {}; - return this; - } - if (handler) { - if (_h[eventType]) { - var newList = []; - for (var i = 0, l = _h[eventType].length; i < l; i++) { - if (_h[eventType][i].h !== handler) { - newList.push(_h[eventType][i]); - } - } - _h[eventType] = newList; - } - if (_h[eventType] && _h[eventType].length === 0) { - delete _h[eventType]; - } - } - else { - delete _h[eventType]; - } - return this; - }; - Eventful.prototype.trigger = function (eventType) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - if (!this._$handlers) { - return this; - } - var _h = this._$handlers[eventType]; - var eventProcessor = this._$eventProcessor; - if (_h) { - var argLen = args.length; - var len = _h.length; - for (var i = 0; i < len; i++) { - var hItem = _h[i]; - if (eventProcessor - && eventProcessor.filter - && hItem.query != null - && !eventProcessor.filter(eventType, hItem.query)) { - continue; - } - switch (argLen) { - case 0: - hItem.h.call(hItem.ctx); - break; - case 1: - hItem.h.call(hItem.ctx, args[0]); - break; - case 2: - hItem.h.call(hItem.ctx, args[0], args[1]); - break; - default: - hItem.h.apply(hItem.ctx, args); - break; - } - } - } - eventProcessor && eventProcessor.afterTrigger - && eventProcessor.afterTrigger(eventType); - return this; - }; - Eventful.prototype.triggerWithContext = function (type) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - if (!this._$handlers) { - return this; - } - var _h = this._$handlers[type]; - var eventProcessor = this._$eventProcessor; - if (_h) { - var argLen = args.length; - var ctx = args[argLen - 1]; - var len = _h.length; - for (var i = 0; i < len; i++) { - var hItem = _h[i]; - if (eventProcessor - && eventProcessor.filter - && hItem.query != null - && !eventProcessor.filter(type, hItem.query)) { - continue; - } - switch (argLen) { - case 0: - hItem.h.call(ctx); - break; - case 1: - hItem.h.call(ctx, args[0]); - break; - case 2: - hItem.h.call(ctx, args[0], args[1]); - break; - default: - hItem.h.apply(ctx, args.slice(1, argLen - 1)); - break; - } - } - } - eventProcessor && eventProcessor.afterTrigger - && eventProcessor.afterTrigger(type); - return this; - }; - return Eventful; - }()); - - var LN2 = Math.log(2); - function determinant(rows, rank, rowStart, rowMask, colMask, detCache) { - var cacheKey = rowMask + '-' + colMask; - var fullRank = rows.length; - if (detCache.hasOwnProperty(cacheKey)) { - return detCache[cacheKey]; - } - if (rank === 1) { - var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2); - return rows[rowStart][colStart]; - } - var subRowMask = rowMask | (1 << rowStart); - var subRowStart = rowStart + 1; - while (rowMask & (1 << subRowStart)) { - subRowStart++; - } - var sum = 0; - for (var j = 0, colLocalIdx = 0; j < fullRank; j++) { - var colTag = 1 << j; - if (!(colTag & colMask)) { - sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] - * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache); - colLocalIdx++; - } + if (textStroke == null || textStroke === "auto") { + textStroke = this.getInsideTextStroke(textFill); + autoStroke = true; } - detCache[cacheKey] = sum; - return sum; - } - function buildTransformer(src, dest) { - var mA = [ - [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]], - [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]], - [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]], - [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]], - [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]], - [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]], - [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]], - [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]] - ]; - var detCache = {}; - var det = determinant(mA, 8, 0, 0, 0, detCache); - if (det === 0) { - return; + } else { + textFill = textConfig.outsideFill; + textStroke = textConfig.outsideStroke; + if (textFill == null || textFill === "auto") { + textFill = this.getOutsideFill(); + } + if (textStroke == null || textStroke === "auto") { + textStroke = this.getOutsideStroke(textFill); + autoStroke = true; + } + } + textFill = textFill || "#000"; + if (textFill !== innerTextDefaultStyle.fill || textStroke !== innerTextDefaultStyle.stroke || autoStroke !== innerTextDefaultStyle.autoStroke || textAlign !== innerTextDefaultStyle.align || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) { + textStyleChanged = true; + innerTextDefaultStyle.fill = textFill; + innerTextDefaultStyle.stroke = textStroke; + innerTextDefaultStyle.autoStroke = autoStroke; + innerTextDefaultStyle.align = textAlign; + innerTextDefaultStyle.verticalAlign = textVerticalAlign; + textEl.setDefaultTextStyle(innerTextDefaultStyle); + } + textEl.__dirty |= REDRAW_BIT; + if (textStyleChanged) { + textEl.dirtyStyle(true); + } + } + } + canBeInsideText() { + return true; + } + getInsideTextFill() { + return "#fff"; + } + getInsideTextStroke(textFill) { + return "#000"; + } + getOutsideFill() { + return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR; + } + getOutsideStroke(textFill) { + const backgroundColor2 = this.__zr && this.__zr.getBackgroundColor(); + let colorArr = typeof backgroundColor2 === "string" && parse(backgroundColor2); + if (!colorArr) { + colorArr = [255, 255, 255, 1]; + } + const alpha = colorArr[3]; + const isDark = this.__zr.isDarkMode(); + for (let i = 0; i < 3; i++) { + colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha); + } + colorArr[3] = 1; + return stringify(colorArr, "rgba"); + } + traverse(cb, context) { + } + attrKV(key, value) { + if (key === "textConfig") { + this.setTextConfig(value); + } else if (key === "textContent") { + this.setTextContent(value); + } else if (key === "clipPath") { + this.setClipPath(value); + } else if (key === "extra") { + this.extra = this.extra || {}; + extend(this.extra, value); + } else { + this[key] = value; + } + } + hide() { + this.ignore = true; + this.markRedraw(); + } + show() { + this.ignore = false; + this.markRedraw(); + } + attr(keyOrObj, value) { + if (typeof keyOrObj === "string") { + this.attrKV(keyOrObj, value); + } else if (isObject(keyOrObj)) { + let obj = keyOrObj; + let keysArr = keys(obj); + for (let i = 0; i < keysArr.length; i++) { + let key = keysArr[i]; + this.attrKV(key, keyOrObj[key]); + } + } + this.markRedraw(); + return this; + } + saveCurrentToNormalState(toState) { + this._innerSaveToNormal(toState); + const normalState = this._normalState; + for (let i = 0; i < this.animators.length; i++) { + const animator = this.animators[i]; + const fromStateTransition = animator.__fromStateTransition; + if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) { + continue; + } + const targetName = animator.targetName; + const target = targetName ? normalState[targetName] : normalState; + animator.saveTo(target); + } + } + _innerSaveToNormal(toState) { + let normalState = this._normalState; + if (!normalState) { + normalState = this._normalState = {}; + } + if (toState.textConfig && !normalState.textConfig) { + normalState.textConfig = this.textConfig; + } + this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS); + } + _savePrimaryToNormal(toState, normalState, primaryKeys) { + for (let i = 0; i < primaryKeys.length; i++) { + let key = primaryKeys[i]; + if (toState[key] != null && !(key in normalState)) { + normalState[key] = this[key]; + } + } + } + hasState() { + return this.currentStates.length > 0; + } + getState(name) { + return this.states[name]; + } + ensureState(name) { + const states = this.states; + if (!states[name]) { + states[name] = {}; + } + return states[name]; + } + clearStates(noAnimation) { + this.useState(PRESERVED_NORMAL_STATE, false, noAnimation); + } + useState(stateName, keepCurrentStates, noAnimation, forceUseHoverLayer) { + const toNormalState = stateName === PRESERVED_NORMAL_STATE; + const hasStates = this.hasState(); + if (!hasStates && toNormalState) { + return; + } + const currentStates = this.currentStates; + const animationCfg = this.stateTransition; + if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) { + return; + } + let state; + if (this.stateProxy && !toNormalState) { + state = this.stateProxy(stateName); + } + if (!state) { + state = this.states && this.states[stateName]; + } + if (!state && !toNormalState) { + logError(`State ${stateName} not exists.`); + return; + } + if (!toNormalState) { + this.saveCurrentToNormalState(state); + } + const useHoverLayer = !!(state && state.hoverLayer || forceUseHoverLayer); + if (useHoverLayer) { + this._toggleHoverLayerFlag(true); + } + this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg); + const textContent = this._textContent; + const textGuide = this._textGuide; + if (textContent) { + textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer); + } + if (textGuide) { + textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer); + } + if (toNormalState) { + this.currentStates = []; + this._normalState = {}; + } else { + if (!keepCurrentStates) { + this.currentStates = [stateName]; + } else { + this.currentStates.push(stateName); + } + } + this._updateAnimationTargets(); + this.markRedraw(); + if (!useHoverLayer && this.__inHover) { + this._toggleHoverLayerFlag(false); + this.__dirty &= ~REDRAW_BIT; + } + return state; + } + useStates(states, noAnimation, forceUseHoverLayer) { + if (!states.length) { + this.clearStates(); + } else { + const stateObjects = []; + const currentStates = this.currentStates; + const len2 = states.length; + let notChange = len2 === currentStates.length; + if (notChange) { + for (let i = 0; i < len2; i++) { + if (states[i] !== currentStates[i]) { + notChange = false; + break; + } } - var vh = []; - for (var i = 0; i < 8; i++) { - for (var j = 0; j < 8; j++) { - vh[j] == null && (vh[j] = 0); - vh[j] += ((i + j) % 2 ? -1 : 1) - * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) - / det * dest[i]; - } + } + if (notChange) { + return; + } + for (let i = 0; i < len2; i++) { + const stateName = states[i]; + let stateObj; + if (this.stateProxy) { + stateObj = this.stateProxy(stateName, states); } - return function (out, srcPointX, srcPointY) { - var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1; - out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk; - out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk; - }; + if (!stateObj) { + stateObj = this.states[stateName]; + } + if (stateObj) { + stateObjects.push(stateObj); + } + } + const lastStateObj = stateObjects[len2 - 1]; + const useHoverLayer = !!(lastStateObj && lastStateObj.hoverLayer || forceUseHoverLayer); + if (useHoverLayer) { + this._toggleHoverLayerFlag(true); + } + const mergedState = this._mergeStates(stateObjects); + const animationCfg = this.stateTransition; + this.saveCurrentToNormalState(mergedState); + this._applyStateObj(states.join(","), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg); + const textContent = this._textContent; + const textGuide = this._textGuide; + if (textContent) { + textContent.useStates(states, noAnimation, useHoverLayer); + } + if (textGuide) { + textGuide.useStates(states, noAnimation, useHoverLayer); + } + this._updateAnimationTargets(); + this.currentStates = states.slice(); + this.markRedraw(); + if (!useHoverLayer && this.__inHover) { + this._toggleHoverLayerFlag(false); + this.__dirty &= ~REDRAW_BIT; + } + } + } + isSilent() { + let isSilent = this.silent; + let ancestor = this.parent; + while (!isSilent && ancestor) { + if (ancestor.silent) { + isSilent = true; + break; + } + ancestor = ancestor.parent; + } + return isSilent; + } + _updateAnimationTargets() { + for (let i = 0; i < this.animators.length; i++) { + const animator = this.animators[i]; + if (animator.targetName) { + animator.changeTarget(this[animator.targetName]); + } + } + } + removeState(state) { + const idx = indexOf(this.currentStates, state); + if (idx >= 0) { + const currentStates = this.currentStates.slice(); + currentStates.splice(idx, 1); + this.useStates(currentStates); + } + } + replaceState(oldState, newState, forceAdd) { + const currentStates = this.currentStates.slice(); + const idx = indexOf(currentStates, oldState); + const newStateExists = indexOf(currentStates, newState) >= 0; + if (idx >= 0) { + if (!newStateExists) { + currentStates[idx] = newState; + } else { + currentStates.splice(idx, 1); + } + } else if (forceAdd && !newStateExists) { + currentStates.push(newState); + } + this.useStates(currentStates); + } + toggleState(state, enable) { + if (enable) { + this.useState(state, true); + } else { + this.removeState(state); + } + } + _mergeStates(states) { + const mergedState = {}; + let mergedTextConfig; + for (let i = 0; i < states.length; i++) { + const state = states[i]; + extend(mergedState, state); + if (state.textConfig) { + mergedTextConfig = mergedTextConfig || {}; + extend(mergedTextConfig, state.textConfig); + } + } + if (mergedTextConfig) { + mergedState.textConfig = mergedTextConfig; + } + return mergedState; + } + _applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg) { + const needsRestoreToNormal = !(state && keepCurrentStates); + if (state && state.textConfig) { + this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig); + extend(this.textConfig, state.textConfig); + } else if (needsRestoreToNormal) { + if (normalState.textConfig) { + this.textConfig = normalState.textConfig; + } + } + const transitionTarget = {}; + let hasTransition = false; + for (let i = 0; i < PRIMARY_STATES_KEYS.length; i++) { + const key = PRIMARY_STATES_KEYS[i]; + const propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key]; + if (state && state[key] != null) { + if (propNeedsTransition) { + hasTransition = true; + transitionTarget[key] = state[key]; + } else { + this[key] = state[key]; + } + } else if (needsRestoreToNormal) { + if (normalState[key] != null) { + if (propNeedsTransition) { + hasTransition = true; + transitionTarget[key] = normalState[key]; + } else { + this[key] = normalState[key]; + } + } + } + } + if (!transition) { + for (let i = 0; i < this.animators.length; i++) { + const animator = this.animators[i]; + const targetName = animator.targetName; + if (!animator.getLoop()) { + animator.__changeFinalValue(targetName ? (state || normalState)[targetName] : state || normalState); + } + } + } + if (hasTransition) { + this._transitionState(stateName, transitionTarget, animationCfg); + } + } + _attachComponent(componentEl) { + if (componentEl.__zr && !componentEl.__hostTarget) { + if (true) { + throw new Error("Text element has been added to zrender."); + } + return; + } + if (componentEl === this) { + if (true) { + throw new Error("Recursive component attachment."); + } + return; + } + const zr = this.__zr; + if (zr) { + componentEl.addSelfToZr(zr); + } + componentEl.__zr = zr; + componentEl.__hostTarget = this; + } + _detachComponent(componentEl) { + if (componentEl.__zr) { + componentEl.removeSelfFromZr(componentEl.__zr); + } + componentEl.__zr = null; + componentEl.__hostTarget = null; + } + getClipPath() { + return this._clipPath; + } + setClipPath(clipPath) { + if (this._clipPath && this._clipPath !== clipPath) { + this.removeClipPath(); + } + this._attachComponent(clipPath); + this._clipPath = clipPath; + this.markRedraw(); + } + removeClipPath() { + const clipPath = this._clipPath; + if (clipPath) { + this._detachComponent(clipPath); + this._clipPath = null; + this.markRedraw(); + } + } + getTextContent() { + return this._textContent; + } + setTextContent(textEl) { + const previousTextContent = this._textContent; + if (previousTextContent === textEl) { + return; + } + if (previousTextContent && previousTextContent !== textEl) { + this.removeTextContent(); + } + if (true) { + if (textEl.__zr && !textEl.__hostTarget) { + throw new Error("Text element has been added to zrender."); + } + } + textEl.innerTransformable = new Transformable_default(); + this._attachComponent(textEl); + this._textContent = textEl; + this.markRedraw(); + } + setTextConfig(cfg) { + if (!this.textConfig) { + this.textConfig = {}; + } + extend(this.textConfig, cfg); + this.markRedraw(); + } + removeTextConfig() { + this.textConfig = null; + this.markRedraw(); + } + removeTextContent() { + const textEl = this._textContent; + if (textEl) { + textEl.innerTransformable = null; + this._detachComponent(textEl); + this._textContent = null; + this._innerTextDefaultStyle = null; + this.markRedraw(); + } + } + getTextGuideLine() { + return this._textGuide; + } + setTextGuideLine(guideLine) { + if (this._textGuide && this._textGuide !== guideLine) { + this.removeTextGuideLine(); + } + this._attachComponent(guideLine); + this._textGuide = guideLine; + this.markRedraw(); + } + removeTextGuideLine() { + const textGuide = this._textGuide; + if (textGuide) { + this._detachComponent(textGuide); + this._textGuide = null; + this.markRedraw(); + } + } + markRedraw() { + this.__dirty |= REDRAW_BIT; + const zr = this.__zr; + if (zr) { + if (this.__inHover) { + zr.refreshHover(); + } else { + zr.refresh(); + } } - - var EVENT_SAVED_PROP = '___zrEVENTSAVED'; - var _calcOut = []; - function transformLocalCoord(out, elFrom, elTarget, inX, inY) { - return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true) - && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]); - } - function transformCoordWithViewport(out, el, inX, inY, inverse) { - if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) { - var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {}); - var markers = prepareCoordMarkers(el, saved); - var transformer = preparePointerTransformer(markers, saved, inverse); - if (transformer) { - transformer(out, inX, inY); - return true; - } + if (this.__hostTarget) { + this.__hostTarget.markRedraw(); + } + } + dirty() { + this.markRedraw(); + } + _toggleHoverLayerFlag(inHover) { + this.__inHover = inHover; + const textContent = this._textContent; + const textGuide = this._textGuide; + if (textContent) { + textContent.__inHover = inHover; + } + if (textGuide) { + textGuide.__inHover = inHover; + } + } + addSelfToZr(zr) { + if (this.__zr === zr) { + return; + } + this.__zr = zr; + const animators = this.animators; + if (animators) { + for (let i = 0; i < animators.length; i++) { + zr.animation.addAnimator(animators[i]); + } + } + if (this._clipPath) { + this._clipPath.addSelfToZr(zr); + } + if (this._textContent) { + this._textContent.addSelfToZr(zr); + } + if (this._textGuide) { + this._textGuide.addSelfToZr(zr); + } + } + removeSelfFromZr(zr) { + if (!this.__zr) { + return; + } + this.__zr = null; + const animators = this.animators; + if (animators) { + for (let i = 0; i < animators.length; i++) { + zr.animation.removeAnimator(animators[i]); + } + } + if (this._clipPath) { + this._clipPath.removeSelfFromZr(zr); + } + if (this._textContent) { + this._textContent.removeSelfFromZr(zr); + } + if (this._textGuide) { + this._textGuide.removeSelfFromZr(zr); + } + } + animate(key, loop, allowDiscreteAnimation) { + let target = key ? this[key] : this; + if (true) { + if (!target) { + logError('Property "' + key + '" is not existed in element ' + this.id); + return; + } + } + const animator = new Animator_default(target, loop, allowDiscreteAnimation); + key && (animator.targetName = key); + this.addAnimator(animator, key); + return animator; + } + addAnimator(animator, key) { + const zr = this.__zr; + const el = this; + animator.during(function() { + el.updateDuringAnimation(key); + }).done(function() { + const animators = el.animators; + const idx = indexOf(animators, animator); + if (idx >= 0) { + animators.splice(idx, 1); + } + }); + this.animators.push(animator); + if (zr) { + zr.animation.addAnimator(animator); + } + zr && zr.wakeUp(); + } + updateDuringAnimation(key) { + this.markRedraw(); + } + stopAnimation(scope, forwardToLast) { + const animators = this.animators; + const len2 = animators.length; + const leftAnimators = []; + for (let i = 0; i < len2; i++) { + const animator = animators[i]; + if (!scope || scope === animator.scope) { + animator.stop(forwardToLast); + } else { + leftAnimators.push(animator); + } + } + this.animators = leftAnimators; + return this; + } + animateTo(target, cfg, animationProps) { + animateTo(this, target, cfg, animationProps); + } + animateFrom(target, cfg, animationProps) { + animateTo(this, target, cfg, animationProps, true); + } + _transitionState(stateName, target, cfg, animationProps) { + const animators = animateTo(this, target, cfg, animationProps); + for (let i = 0; i < animators.length; i++) { + animators[i].__fromStateTransition = stateName; + } + } + getBoundingRect() { + return null; + } + getPaintRect() { + return null; + } +}; +var Element = Element2; +Element.initDefaultProps = function() { + const elProto = Element2.prototype; + elProto.type = "element"; + elProto.name = ""; + elProto.ignore = elProto.silent = elProto.isGroup = elProto.draggable = elProto.dragging = elProto.ignoreClip = elProto.__inHover = false; + elProto.__dirty = REDRAW_BIT; + const logs = {}; + function logDeprecatedError(key, xKey, yKey) { + if (!logs[key + xKey + yKey]) { + console.warn(`DEPRECATED: '${key}' has been deprecated. use '${xKey}', '${yKey}' instead`); + logs[key + xKey + yKey] = true; + } + } + function createLegacyProperty(key, privateKey, xKey, yKey) { + Object.defineProperty(elProto, key, { + get() { + if (true) { + logDeprecatedError(key, xKey, yKey); + } + if (!this[privateKey]) { + const pos = this[privateKey] = []; + enhanceArray(this, pos); + } + return this[privateKey]; + }, + set(pos) { + if (true) { + logDeprecatedError(key, xKey, yKey); } - return false; + this[xKey] = pos[0]; + this[yKey] = pos[1]; + this[privateKey] = pos; + enhanceArray(this, pos); + } + }); + function enhanceArray(self2, pos) { + Object.defineProperty(pos, 0, { + get() { + return self2[xKey]; + }, + set(val) { + self2[xKey] = val; + } + }); + Object.defineProperty(pos, 1, { + get() { + return self2[yKey]; + }, + set(val) { + self2[yKey] = val; + } + }); + } + } + if (Object.defineProperty) { + createLegacyProperty("position", "_legacyPos", "x", "y"); + createLegacyProperty("scale", "_legacyScale", "scaleX", "scaleY"); + createLegacyProperty("origin", "_legacyOrigin", "originX", "originY"); + } +}(); +mixin(Element, Eventful_default); +mixin(Element, Transformable_default); +function animateTo(animatable, target, cfg, animationProps, reverse2) { + cfg = cfg || {}; + const animators = []; + animateToShallow(animatable, "", animatable, target, cfg, animationProps, animators, reverse2); + let finishCount = animators.length; + let doneHappened = false; + const cfgDone = cfg.done; + const cfgAborted = cfg.aborted; + const doneCb = () => { + doneHappened = true; + finishCount--; + if (finishCount <= 0) { + doneHappened ? cfgDone && cfgDone() : cfgAborted && cfgAborted(); + } + }; + const abortedCb = () => { + finishCount--; + if (finishCount <= 0) { + doneHappened ? cfgDone && cfgDone() : cfgAborted && cfgAborted(); + } + }; + if (!finishCount) { + cfgDone && cfgDone(); + } + if (animators.length > 0 && cfg.during) { + animators[0].during((target2, percent) => { + cfg.during(percent); + }); + } + for (let i = 0; i < animators.length; i++) { + const animator = animators[i]; + if (doneCb) { + animator.done(doneCb); + } + if (abortedCb) { + animator.aborted(abortedCb); + } + if (cfg.force) { + animator.duration(cfg.duration); + } + animator.start(cfg.easing); + } + return animators; +} +function copyArrShallow(source, target, len2) { + for (let i = 0; i < len2; i++) { + source[i] = target[i]; + } +} +function is2DArray(value) { + return isArrayLike(value[0]); +} +function copyValue(target, source, key) { + if (isArrayLike(source[key])) { + if (!isArrayLike(target[key])) { + target[key] = []; + } + if (isTypedArray(source[key])) { + const len2 = source[key].length; + if (target[key].length !== len2) { + target[key] = new source[key].constructor(len2); + copyArrShallow(target[key], source[key], len2); + } + } else { + const sourceArr = source[key]; + const targetArr = target[key]; + const len0 = sourceArr.length; + if (is2DArray(sourceArr)) { + const len1 = sourceArr[0].length; + for (let i = 0; i < len0; i++) { + if (!targetArr[i]) { + targetArr[i] = Array.prototype.slice.call(sourceArr[i]); + } else { + copyArrShallow(targetArr[i], sourceArr[i], len1); + } + } + } else { + copyArrShallow(targetArr, sourceArr, len0); + } + targetArr.length = sourceArr.length; + } + } else { + target[key] = source[key]; + } +} +function isValueSame(val1, val2) { + return val1 === val2 || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2); +} +function is1DArraySame(arr0, arr1) { + const len2 = arr0.length; + if (len2 !== arr1.length) { + return false; + } + for (let i = 0; i < len2; i++) { + if (arr0[i] !== arr1[i]) { + return false; + } + } + return true; +} +function animateToShallow(animatable, topKey, animateObj, target, cfg, animationProps, animators, reverse2) { + const targetKeys = keys(target); + const duration = cfg.duration; + const delay = cfg.delay; + const additive = cfg.additive; + const setToFinal = cfg.setToFinal; + const animateAll = !isObject(animationProps); + const existsAnimators = animatable.animators; + let animationKeys = []; + for (let k = 0; k < targetKeys.length; k++) { + const innerKey = targetKeys[k]; + const targetVal = target[innerKey]; + if (targetVal != null && animateObj[innerKey] != null && (animateAll || animationProps[innerKey])) { + if (isObject(targetVal) && !isArrayLike(targetVal) && !isGradientObject(targetVal)) { + if (topKey) { + if (!reverse2) { + animateObj[innerKey] = targetVal; + animatable.updateDuringAnimation(topKey); + } + continue; + } + animateToShallow(animatable, innerKey, animateObj[innerKey], targetVal, cfg, animationProps && animationProps[innerKey], animators, reverse2); + } else { + animationKeys.push(innerKey); + } + } else if (!reverse2) { + animateObj[innerKey] = targetVal; + animatable.updateDuringAnimation(topKey); + animationKeys.push(innerKey); + } + } + let keyLen = animationKeys.length; + if (!additive && keyLen) { + for (let i = 0; i < existsAnimators.length; i++) { + const animator = existsAnimators[i]; + if (animator.targetName === topKey) { + const allAborted = animator.stopTracks(animationKeys); + if (allAborted) { + const idx = indexOf(existsAnimators, animator); + existsAnimators.splice(idx, 1); + } + } + } + } + if (!cfg.force) { + animationKeys = filter(animationKeys, (key) => !isValueSame(target[key], animateObj[key])); + keyLen = animationKeys.length; + } + if (keyLen > 0 || cfg.force && !animators.length) { + let revertedSource; + let reversedTarget; + let sourceClone; + if (reverse2) { + reversedTarget = {}; + if (setToFinal) { + revertedSource = {}; + } + for (let i = 0; i < keyLen; i++) { + const innerKey = animationKeys[i]; + reversedTarget[innerKey] = animateObj[innerKey]; + if (setToFinal) { + revertedSource[innerKey] = target[innerKey]; + } else { + animateObj[innerKey] = target[innerKey]; + } + } + } else if (setToFinal) { + sourceClone = {}; + for (let i = 0; i < keyLen; i++) { + const innerKey = animationKeys[i]; + sourceClone[innerKey] = cloneValue(animateObj[innerKey]); + copyValue(animateObj, target, innerKey); + } + } + const animator = new Animator_default(animateObj, false, false, additive ? filter(existsAnimators, (animator2) => animator2.targetName === topKey) : null); + animator.targetName = topKey; + if (cfg.scope) { + animator.scope = cfg.scope; + } + if (setToFinal && revertedSource) { + animator.whenWithKeys(0, revertedSource, animationKeys); + } + if (sourceClone) { + animator.whenWithKeys(0, sourceClone, animationKeys); + } + animator.whenWithKeys(duration == null ? 500 : duration, reverse2 ? reversedTarget : target, animationKeys).delay(delay || 0); + animatable.addAnimator(animator, topKey); + animators.push(animator); + } +} +var Element_default = Element; + +// node_modules/zrender/src/graphic/Group.ts +var Group = class extends Element_default { + constructor(opts) { + super(); + this.isGroup = true; + this._children = []; + this.attr(opts); + } + childrenRef() { + return this._children; + } + children() { + return this._children.slice(); + } + childAt(idx) { + return this._children[idx]; + } + childOfName(name) { + const children = this._children; + for (let i = 0; i < children.length; i++) { + if (children[i].name === name) { + return children[i]; + } + } + } + childCount() { + return this._children.length; + } + add(child) { + if (child) { + if (child !== this && child.parent !== this) { + this._children.push(child); + this._doAdd(child); + } + if (true) { + if (child.__hostTarget) { + throw "This elemenet has been used as an attachment"; + } + } + } + return this; + } + addBefore(child, nextSibling2) { + if (child && child !== this && child.parent !== this && nextSibling2 && nextSibling2.parent === this) { + const children = this._children; + const idx = children.indexOf(nextSibling2); + if (idx >= 0) { + children.splice(idx, 0, child); + this._doAdd(child); + } + } + return this; + } + replace(oldChild, newChild) { + const idx = indexOf(this._children, oldChild); + if (idx >= 0) { + this.replaceAt(newChild, idx); + } + return this; + } + replaceAt(child, index) { + const children = this._children; + const old = children[index]; + if (child && child !== this && child.parent !== this && child !== old) { + children[index] = child; + old.parent = null; + const zr = this.__zr; + if (zr) { + old.removeSelfFromZr(zr); + } + this._doAdd(child); + } + return this; + } + _doAdd(child) { + if (child.parent) { + child.parent.remove(child); + } + child.parent = this; + const zr = this.__zr; + if (zr && zr !== child.__zr) { + child.addSelfToZr(zr); + } + zr && zr.refresh(); + } + remove(child) { + const zr = this.__zr; + const children = this._children; + const idx = indexOf(children, child); + if (idx < 0) { + return this; + } + children.splice(idx, 1); + child.parent = null; + if (zr) { + child.removeSelfFromZr(zr); + } + zr && zr.refresh(); + return this; + } + removeAll() { + const children = this._children; + const zr = this.__zr; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (zr) { + child.removeSelfFromZr(zr); + } + child.parent = null; + } + children.length = 0; + return this; + } + eachChild(cb, context) { + const children = this._children; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + cb.call(context, child, i); + } + return this; + } + traverse(cb, context) { + for (let i = 0; i < this._children.length; i++) { + const child = this._children[i]; + const stopped = cb.call(context, child); + if (child.isGroup && !stopped) { + child.traverse(cb, context); + } + } + return this; + } + addSelfToZr(zr) { + super.addSelfToZr(zr); + for (let i = 0; i < this._children.length; i++) { + const child = this._children[i]; + child.addSelfToZr(zr); + } + } + removeSelfFromZr(zr) { + super.removeSelfFromZr(zr); + for (let i = 0; i < this._children.length; i++) { + const child = this._children[i]; + child.removeSelfFromZr(zr); + } + } + getBoundingRect(includeChildren) { + const tmpRect3 = new BoundingRect_default(0, 0, 0, 0); + const children = includeChildren || this._children; + const tmpMat = []; + let rect = null; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.ignore || child.invisible) { + continue; + } + const childRect = child.getBoundingRect(); + const transform2 = child.getLocalTransform(tmpMat); + if (transform2) { + BoundingRect_default.applyTransform(tmpRect3, childRect, transform2); + rect = rect || tmpRect3.clone(); + rect.union(tmpRect3); + } else { + rect = rect || childRect.clone(); + rect.union(childRect); + } } - function prepareCoordMarkers(el, saved) { - var markers = saved.markers; - if (markers) { - return markers; - } - markers = saved.markers = []; - var propLR = ['left', 'right']; - var propTB = ['top', 'bottom']; - for (var i = 0; i < 4; i++) { - var marker = document.createElement('div'); - var stl = marker.style; - var idxLR = i % 2; - var idxTB = (i >> 1) % 2; - stl.cssText = [ - 'position: absolute', - 'visibility: hidden', - 'padding: 0', - 'margin: 0', - 'border-width: 0', - 'user-select: none', - 'width:0', - 'height:0', - propLR[idxLR] + ':0', - propTB[idxTB] + ':0', - propLR[1 - idxLR] + ':auto', - propTB[1 - idxTB] + ':auto', - '' - ].join('!important;'); - el.appendChild(marker); - markers.push(marker); - } - return markers; - } - function preparePointerTransformer(markers, saved, inverse) { - var transformerName = inverse ? 'invTrans' : 'trans'; - var transformer = saved[transformerName]; - var oldSrcCoords = saved.srcCoords; - var srcCoords = []; - var destCoords = []; - var oldCoordTheSame = true; - for (var i = 0; i < 4; i++) { - var rect = markers[i].getBoundingClientRect(); - var ii = 2 * i; - var x = rect.left; - var y = rect.top; - srcCoords.push(x, y); - oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1]; - destCoords.push(markers[i].offsetLeft, markers[i].offsetTop); - } - return (oldCoordTheSame && transformer) - ? transformer - : (saved.srcCoords = srcCoords, - saved[transformerName] = inverse - ? buildTransformer(destCoords, srcCoords) - : buildTransformer(srcCoords, destCoords)); - } - function isCanvasEl(el) { - return el.nodeName.toUpperCase() === 'CANVAS'; - } - var replaceReg = /([&<>"'])/g; - var replaceMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''' + return rect || tmpRect3; + } +}; +Group.prototype.type = "group"; +var Group_default = Group; + +// node_modules/zrender/src/zrender.ts +/*! +* ZRender, a high performance 2d drawing library. +* +* Copyright (c) 2013, Baidu Inc. +* All rights reserved. +* +* LICENSE +* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt +*/ +var painterCtors = {}; +var instances = {}; +function delInstance(id) { + delete instances[id]; +} +function isDarkMode(backgroundColor2) { + if (!backgroundColor2) { + return false; + } + if (typeof backgroundColor2 === "string") { + return lum(backgroundColor2, 1) < DARK_MODE_THRESHOLD; + } else if (backgroundColor2.colorStops) { + const colorStops = backgroundColor2.colorStops; + let totalLum = 0; + const len2 = colorStops.length; + for (let i = 0; i < len2; i++) { + totalLum += lum(colorStops[i].color, 1); + } + totalLum /= len2; + return totalLum < DARK_MODE_THRESHOLD; + } + return false; +} +var ZRender = class { + constructor(id, dom, opts) { + this._sleepAfterStill = 10; + this._stillFrameAccum = 0; + this._needsRefresh = true; + this._needsRefreshHover = true; + this._darkMode = false; + opts = opts || {}; + this.dom = dom; + this.id = id; + const storage2 = new Storage_default(); + let rendererType = opts.renderer || "canvas"; + if (!painterCtors[rendererType]) { + rendererType = keys(painterCtors)[0]; + } + if (true) { + if (!painterCtors[rendererType]) { + throw new Error(`Renderer '${rendererType}' is not imported. Please import it first.`); + } + } + opts.useDirtyRect = opts.useDirtyRect == null ? false : opts.useDirtyRect; + const painter = new painterCtors[rendererType](dom, storage2, opts, id); + const ssrMode = opts.ssr || painter.ssrOnly; + this.storage = storage2; + this.painter = painter; + const handlerProxy = !env_default.node && !env_default.worker && !ssrMode ? new HandlerProxy_default(painter.getViewportRoot(), painter.root) : null; + const useCoarsePointer = opts.useCoarsePointer; + const usePointerSize = useCoarsePointer == null || useCoarsePointer === "auto" ? env_default.touchEventsSupported : !!useCoarsePointer; + const defaultPointerSize = 44; + let pointerSize; + if (usePointerSize) { + pointerSize = retrieve2(opts.pointerSize, defaultPointerSize); + } + this.handler = new Handler_default(storage2, painter, handlerProxy, painter.root, pointerSize); + this.animation = new Animation_default({ + stage: { + update: ssrMode ? null : () => this._flush(true) + } + }); + if (!ssrMode) { + this.animation.start(); + } + } + add(el) { + if (this._disposed || !el) { + return; + } + this.storage.addRoot(el); + el.addSelfToZr(this); + this.refresh(); + } + remove(el) { + if (this._disposed || !el) { + return; + } + this.storage.delRoot(el); + el.removeSelfFromZr(this); + this.refresh(); + } + configLayer(zLevel, config) { + if (this._disposed) { + return; + } + if (this.painter.configLayer) { + this.painter.configLayer(zLevel, config); + } + this.refresh(); + } + setBackgroundColor(backgroundColor2) { + if (this._disposed) { + return; + } + if (this.painter.setBackgroundColor) { + this.painter.setBackgroundColor(backgroundColor2); + } + this.refresh(); + this._backgroundColor = backgroundColor2; + this._darkMode = isDarkMode(backgroundColor2); + } + getBackgroundColor() { + return this._backgroundColor; + } + setDarkMode(darkMode) { + this._darkMode = darkMode; + } + isDarkMode() { + return this._darkMode; + } + refreshImmediately(fromInside) { + if (this._disposed) { + return; + } + if (!fromInside) { + this.animation.update(true); + } + this._needsRefresh = false; + this.painter.refresh(); + this._needsRefresh = false; + } + refresh() { + if (this._disposed) { + return; + } + this._needsRefresh = true; + this.animation.start(); + } + flush() { + if (this._disposed) { + return; + } + this._flush(false); + } + _flush(fromInside) { + let triggerRendered; + const start2 = getTime(); + if (this._needsRefresh) { + triggerRendered = true; + this.refreshImmediately(fromInside); + } + if (this._needsRefreshHover) { + triggerRendered = true; + this.refreshHoverImmediately(); + } + const end2 = getTime(); + if (triggerRendered) { + this._stillFrameAccum = 0; + this.trigger("rendered", { + elapsedTime: end2 - start2 + }); + } else if (this._sleepAfterStill > 0) { + this._stillFrameAccum++; + if (this._stillFrameAccum > this._sleepAfterStill) { + this.animation.stop(); + } + } + } + setSleepAfterStill(stillFramesCount) { + this._sleepAfterStill = stillFramesCount; + } + wakeUp() { + if (this._disposed) { + return; + } + this.animation.start(); + this._stillFrameAccum = 0; + } + refreshHover() { + this._needsRefreshHover = true; + } + refreshHoverImmediately() { + if (this._disposed) { + return; + } + this._needsRefreshHover = false; + if (this.painter.refreshHover && this.painter.getType() === "canvas") { + this.painter.refreshHover(); + } + } + resize(opts) { + if (this._disposed) { + return; + } + opts = opts || {}; + this.painter.resize(opts.width, opts.height); + this.handler.resize(); + } + clearAnimation() { + if (this._disposed) { + return; + } + this.animation.clear(); + } + getWidth() { + if (this._disposed) { + return; + } + return this.painter.getWidth(); + } + getHeight() { + if (this._disposed) { + return; + } + return this.painter.getHeight(); + } + setCursorStyle(cursorStyle) { + if (this._disposed) { + return; + } + this.handler.setCursorStyle(cursorStyle); + } + findHover(x, y) { + if (this._disposed) { + return; + } + return this.handler.findHover(x, y); + } + on(eventName, eventHandler, context) { + if (!this._disposed) { + this.handler.on(eventName, eventHandler, context); + } + return this; + } + off(eventName, eventHandler) { + if (this._disposed) { + return; + } + this.handler.off(eventName, eventHandler); + } + trigger(eventName, event) { + if (this._disposed) { + return; + } + this.handler.trigger(eventName, event); + } + clear() { + if (this._disposed) { + return; + } + const roots2 = this.storage.getRoots(); + for (let i = 0; i < roots2.length; i++) { + if (roots2[i] instanceof Group_default) { + roots2[i].removeSelfFromZr(this); + } + } + this.storage.delAllRoots(); + this.painter.clear(); + } + dispose() { + if (this._disposed) { + return; + } + this.animation.stop(); + this.clear(); + this.storage.dispose(); + this.painter.dispose(); + this.handler.dispose(); + this.animation = this.storage = this.painter = this.handler = null; + this._disposed = true; + delInstance(this.id); + } +}; +function init(dom, opts) { + const zr = new ZRender(guid(), dom, opts); + instances[zr.id] = zr; + return zr; +} +function dispose(zr) { + zr.dispose(); +} +function disposeAll() { + for (let key in instances) { + if (instances.hasOwnProperty(key)) { + instances[key].dispose(); + } + } + instances = {}; +} +function getInstance(id) { + return instances[id]; +} +function registerPainter(name, Ctor) { + painterCtors[name] = Ctor; +} +var ssrDataGetter; +function getElementSSRData(el) { + if (typeof ssrDataGetter === "function") { + return ssrDataGetter(el); + } +} +function registerSSRDataGetter(getter) { + ssrDataGetter = getter; +} +var version = "5.6.1-dev.20241025"; + +// src/util/number.ts +var RADIAN_EPSILON = 1e-4; +var ROUND_SUPPORTED_PRECISION_MAX = 20; +function _trim(str) { + return str.replace(/^\s+|\s+$/g, ""); +} +function linearMap(val, domain, range, clamp2) { + const d0 = domain[0]; + const d1 = domain[1]; + const r0 = range[0]; + const r1 = range[1]; + const subDomain = d1 - d0; + const subRange = r1 - r0; + if (subDomain === 0) { + return subRange === 0 ? r0 : (r0 + r1) / 2; + } + if (clamp2) { + if (subDomain > 0) { + if (val <= d0) { + return r0; + } else if (val >= d1) { + return r1; + } + } else { + if (val >= d0) { + return r0; + } else if (val <= d1) { + return r1; + } + } + } else { + if (val === d0) { + return r0; + } + if (val === d1) { + return r1; + } + } + return (val - d0) / subDomain * subRange + r0; +} +function parsePercent2(percent, all) { + switch (percent) { + case "center": + case "middle": + percent = "50%"; + break; + case "left": + case "top": + percent = "0%"; + break; + case "right": + case "bottom": + percent = "100%"; + break; + } + if (isString(percent)) { + if (_trim(percent).match(/%$/)) { + return parseFloat(percent) / 100 * all; + } + return parseFloat(percent); + } + return percent == null ? NaN : +percent; +} +function round(x, precision, returnStr) { + if (precision == null) { + precision = 10; + } + precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX); + x = (+x).toFixed(precision); + return returnStr ? x : +x; +} +function asc(arr) { + arr.sort(function(a, b) { + return a - b; + }); + return arr; +} +function getPrecision(val) { + val = +val; + if (isNaN(val)) { + return 0; + } + if (val > 1e-14) { + let e2 = 1; + for (let i = 0; i < 15; i++, e2 *= 10) { + if (Math.round(val * e2) / e2 === val) { + return i; + } + } + } + return getPrecisionSafe(val); +} +function getPrecisionSafe(val) { + const str = val.toString().toLowerCase(); + const eIndex = str.indexOf("e"); + const exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0; + const significandPartLen = eIndex > 0 ? eIndex : str.length; + const dotIndex = str.indexOf("."); + const decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex; + return Math.max(0, decimalPartLen - exp); +} +function getPixelPrecision(dataExtent, pixelExtent) { + const log2 = Math.log; + const LN10 = Math.LN10; + const dataQuantity = Math.floor(log2(dataExtent[1] - dataExtent[0]) / LN10); + const sizeQuantity = Math.round(log2(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); + const precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20); + return !isFinite(precision) ? 20 : precision; +} +function getPercentWithPrecision(valueList, idx, precision) { + if (!valueList[idx]) { + return 0; + } + const seats = getPercentSeats(valueList, precision); + return seats[idx] || 0; +} +function getPercentSeats(valueList, precision) { + const sum2 = reduce(valueList, function(acc, val) { + return acc + (isNaN(val) ? 0 : val); + }, 0); + if (sum2 === 0) { + return []; + } + const digits = Math.pow(10, precision); + const votesPerQuota = map(valueList, function(val) { + return (isNaN(val) ? 0 : val) / sum2 * digits * 100; + }); + const targetSeats = digits * 100; + const seats = map(votesPerQuota, function(votes) { + return Math.floor(votes); + }); + let currentSum = reduce(seats, function(acc, val) { + return acc + val; + }, 0); + const remainder = map(votesPerQuota, function(votes, idx) { + return votes - seats[idx]; + }); + while (currentSum < targetSeats) { + let max3 = Number.NEGATIVE_INFINITY; + let maxId = null; + for (let i = 0, len2 = remainder.length; i < len2; ++i) { + if (remainder[i] > max3) { + max3 = remainder[i]; + maxId = i; + } + } + ++seats[maxId]; + remainder[maxId] = 0; + ++currentSum; + } + return map(seats, function(seat) { + return seat / digits; + }); +} +function addSafe(val0, val1) { + const maxPrecision = Math.max(getPrecision(val0), getPrecision(val1)); + const sum2 = val0 + val1; + return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum2 : round(sum2, maxPrecision); +} +var MAX_SAFE_INTEGER = 9007199254740991; +function remRadian(radian) { + const pi2 = Math.PI * 2; + return (radian % pi2 + pi2) % pi2; +} +function isRadianAroundZero(val) { + return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; +} +var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; +function parseDate(value) { + if (value instanceof Date) { + return value; + } else if (isString(value)) { + const match = TIME_REG.exec(value); + if (!match) { + return new Date(NaN); + } + if (!match[8]) { + return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0); + } else { + let hour = +match[4] || 0; + if (match[8].toUpperCase() !== "Z") { + hour -= +match[8].slice(0, 3); + } + return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0)); + } + } else if (value == null) { + return new Date(NaN); + } + return new Date(Math.round(value)); +} +function quantity(val) { + return Math.pow(10, quantityExponent(val)); +} +function quantityExponent(val) { + if (val === 0) { + return 0; + } + let exp = Math.floor(Math.log(val) / Math.LN10); + if (val / Math.pow(10, exp) >= 10) { + exp++; + } + return exp; +} +function nice(val, round7) { + const exponent = quantityExponent(val); + const exp10 = Math.pow(10, exponent); + const f = val / exp10; + let nf; + if (round7) { + if (f < 1.5) { + nf = 1; + } else if (f < 2.5) { + nf = 2; + } else if (f < 4) { + nf = 3; + } else if (f < 7) { + nf = 5; + } else { + nf = 10; + } + } else { + if (f < 1) { + nf = 1; + } else if (f < 2) { + nf = 2; + } else if (f < 3) { + nf = 3; + } else if (f < 5) { + nf = 5; + } else { + nf = 10; + } + } + val = nf * exp10; + return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val; +} +function quantile(ascArr, p) { + const H = (ascArr.length - 1) * p + 1; + const h = Math.floor(H); + const v = +ascArr[h - 1]; + const e2 = H - h; + return e2 ? v + e2 * (ascArr[h] - v) : v; +} +function reformIntervals(list) { + list.sort(function(a, b) { + return littleThan2(a, b, 0) ? -1 : 1; + }); + let curr = -Infinity; + let currClose = 1; + for (let i = 0; i < list.length; ) { + const interval = list[i].interval; + const close = list[i].close; + for (let lg = 0; lg < 2; lg++) { + if (interval[lg] <= curr) { + interval[lg] = curr; + close[lg] = !lg ? 1 - currClose : 1; + } + curr = interval[lg]; + currClose = close[lg]; + } + if (interval[0] === interval[1] && close[0] * close[1] !== 1) { + list.splice(i, 1); + } else { + i++; + } + } + return list; + function littleThan2(a, b, lg) { + return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan2(a, b, 1)); + } +} +function numericToNumber(val) { + const valFloat = parseFloat(val); + return valFloat == val && (valFloat !== 0 || !isString(val) || val.indexOf("x") <= 0) ? valFloat : NaN; +} +function isNumeric(val) { + return !isNaN(numericToNumber(val)); +} +function getRandomIdBase() { + return Math.round(Math.random() * 9); +} +function getGreatestCommonDividor(a, b) { + if (b === 0) { + return a; + } + return getGreatestCommonDividor(b, a % b); +} +function getLeastCommonMultiple(a, b) { + if (a == null) { + return b; + } + if (b == null) { + return a; + } + return a * b / getGreatestCommonDividor(a, b); +} + +// src/util/log.ts +var ECHARTS_PREFIX = "[ECharts] "; +var storedLogs = {}; +var hasConsole = typeof console !== "undefined" && console.warn && console.log; +function outputLog(type, str, onlyOnce) { + if (hasConsole) { + if (onlyOnce) { + if (storedLogs[str]) { + return; + } + storedLogs[str] = true; + } + console[type](ECHARTS_PREFIX + str); + } +} +function log(str, onlyOnce) { + outputLog("log", str, onlyOnce); +} +function warn(str, onlyOnce) { + outputLog("warn", str, onlyOnce); +} +function error(str, onlyOnce) { + outputLog("error", str, onlyOnce); +} +function deprecateLog(str) { + if (true) { + outputLog("warn", "DEPRECATED: " + str, true); + } +} +function deprecateReplaceLog(oldOpt, newOpt, scope) { + if (true) { + deprecateLog((scope ? `[${scope}]` : "") + `${oldOpt} is deprecated, use ${newOpt} instead.`); + } +} +function makePrintable(...hintInfo) { + let msg = ""; + if (true) { + const makePrintableStringIfPossible = (val) => { + return val === void 0 ? "undefined" : val === Infinity ? "Infinity" : val === -Infinity ? "-Infinity" : eqNaN(val) ? "NaN" : val instanceof Date ? "Date(" + val.toISOString() + ")" : isFunction(val) ? "function () { ... }" : isRegExp(val) ? val + "" : null; }; - function encodeHTML(source) { - return source == null - ? '' - : (source + '').replace(replaceReg, function (str, c) { - return replaceMap[c]; + msg = map(hintInfo, (arg) => { + if (isString(arg)) { + return arg; + } else { + const printableStr = makePrintableStringIfPossible(arg); + if (printableStr != null) { + return printableStr; + } else if (typeof JSON !== "undefined" && JSON.stringify) { + try { + return JSON.stringify(arg, function(n, val) { + const printableStr2 = makePrintableStringIfPossible(val); + return printableStr2 == null ? val : printableStr2; }); + } catch (err) { + return "?"; + } + } else { + return "?"; + } + } + }).join(" "); + } + return msg; +} +function throwError(msg) { + throw new Error(msg); +} + +// src/util/model.ts +function interpolateNumber2(p0, p1, percent) { + return (p1 - p0) * percent + p0; +} +var DUMMY_COMPONENT_NAME_PREFIX = "series\0"; +var INTERNAL_COMPONENT_ID_PREFIX = "\0_ec_\0"; +function normalizeToArray(value) { + return value instanceof Array ? value : value == null ? [] : [value]; +} +function defaultEmphasis(opt, key, subOpts) { + if (opt) { + opt[key] = opt[key] || {}; + opt.emphasis = opt.emphasis || {}; + opt.emphasis[key] = opt.emphasis[key] || {}; + for (let i = 0, len2 = subOpts.length; i < len2; i++) { + const subOptName = subOpts[i]; + if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) { + opt.emphasis[key][subOptName] = opt[key][subOptName]; + } + } + } +} +var TEXT_STYLE_OPTIONS = [ + "fontStyle", + "fontWeight", + "fontSize", + "fontFamily", + "rich", + "tag", + "color", + "textBorderColor", + "textBorderWidth", + "width", + "height", + "lineHeight", + "align", + "verticalAlign", + "baseline", + "shadowColor", + "shadowBlur", + "shadowOffsetX", + "shadowOffsetY", + "textShadowColor", + "textShadowBlur", + "textShadowOffsetX", + "textShadowOffsetY", + "backgroundColor", + "borderColor", + "borderWidth", + "borderRadius", + "padding" +]; +function getDataItemValue(dataItem) { + return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem; +} +function isDataItemOption(dataItem) { + return isObject(dataItem) && !(dataItem instanceof Array); +} +function mappingToExists(existings, newCmptOptions, mode) { + const isNormalMergeMode = mode === "normalMerge"; + const isReplaceMergeMode = mode === "replaceMerge"; + const isReplaceAllMode = mode === "replaceAll"; + existings = existings || []; + newCmptOptions = (newCmptOptions || []).slice(); + const existingIdIdxMap = createHashMap(); + each(newCmptOptions, function(cmptOption, index) { + if (!isObject(cmptOption)) { + newCmptOptions[index] = null; + return; + } + if (true) { + if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) { + warnInvalidateIdOrName(cmptOption.id); + } + if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) { + warnInvalidateIdOrName(cmptOption.name); + } + } + }); + const result = prepareResult(existings, existingIdIdxMap, mode); + if (isNormalMergeMode || isReplaceMergeMode) { + mappingById(result, existings, existingIdIdxMap, newCmptOptions); + } + if (isNormalMergeMode) { + mappingByName(result, newCmptOptions); + } + if (isNormalMergeMode || isReplaceMergeMode) { + mappingByIndex(result, newCmptOptions, isReplaceMergeMode); + } else if (isReplaceAllMode) { + mappingInReplaceAllMode(result, newCmptOptions); + } + makeIdAndName(result); + return result; +} +function prepareResult(existings, existingIdIdxMap, mode) { + const result = []; + if (mode === "replaceAll") { + return result; + } + for (let index = 0; index < existings.length; index++) { + const existing = existings[index]; + if (existing && existing.id != null) { + existingIdIdxMap.set(existing.id, index); + } + result.push({ + existing: mode === "replaceMerge" || isComponentIdInternal(existing) ? null : existing, + newOption: null, + keyInfo: null, + brandNew: null + }); + } + return result; +} +function mappingById(result, existings, existingIdIdxMap, newCmptOptions) { + each(newCmptOptions, function(cmptOption, index) { + if (!cmptOption || cmptOption.id == null) { + return; + } + const optionId = makeComparableKey(cmptOption.id); + const existingIdx = existingIdIdxMap.get(optionId); + if (existingIdx != null) { + const resultItem = result[existingIdx]; + assert(!resultItem.newOption, 'Duplicated option on id "' + optionId + '".'); + resultItem.newOption = cmptOption; + resultItem.existing = existings[existingIdx]; + newCmptOptions[index] = null; + } + }); +} +function mappingByName(result, newCmptOptions) { + each(newCmptOptions, function(cmptOption, index) { + if (!cmptOption || cmptOption.name == null) { + return; + } + for (let i = 0; i < result.length; i++) { + const existing = result[i].existing; + if (!result[i].newOption && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual("name", existing, cmptOption)) { + result[i].newOption = cmptOption; + newCmptOptions[index] = null; + return; + } } - - var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; - var _calcOut$1 = []; - var firefoxNotSupportOffsetXY = env.browser.firefox - && +env.browser.version.split('.')[0] < 39; - function clientToLocal(el, e, out, calculate) { - out = out || {}; - if (calculate) { - calculateZrXY(el, e, out); - } - else if (firefoxNotSupportOffsetXY - && e.layerX != null - && e.layerX !== e.offsetX) { - out.zrX = e.layerX; - out.zrY = e.layerY; - } - else if (e.offsetX != null) { - out.zrX = e.offsetX; - out.zrY = e.offsetY; - } - else { - calculateZrXY(el, e, out); - } - return out; - } - function calculateZrXY(el, e, out) { - if (env.domSupported && el.getBoundingClientRect) { - var ex = e.clientX; - var ey = e.clientY; - if (isCanvasEl(el)) { - var box = el.getBoundingClientRect(); - out.zrX = ex - box.left; - out.zrY = ey - box.top; - return; + }); +} +function mappingByIndex(result, newCmptOptions, brandNew) { + each(newCmptOptions, function(cmptOption) { + if (!cmptOption) { + return; + } + let resultItem; + let nextIdx = 0; + while ((resultItem = result[nextIdx]) && (resultItem.newOption || isComponentIdInternal(resultItem.existing) || resultItem.existing && cmptOption.id != null && !keyExistAndEqual("id", cmptOption, resultItem.existing))) { + nextIdx++; + } + if (resultItem) { + resultItem.newOption = cmptOption; + resultItem.brandNew = brandNew; + } else { + result.push({ + newOption: cmptOption, + brandNew, + existing: null, + keyInfo: null + }); + } + nextIdx++; + }); +} +function mappingInReplaceAllMode(result, newCmptOptions) { + each(newCmptOptions, function(cmptOption) { + result.push({ + newOption: cmptOption, + brandNew: true, + existing: null, + keyInfo: null + }); + }); +} +function makeIdAndName(mapResult) { + const idMap = createHashMap(); + each(mapResult, function(item) { + const existing = item.existing; + existing && idMap.set(existing.id, item); + }); + each(mapResult, function(item) { + const opt = item.newOption; + assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, "id duplicates: " + (opt && opt.id)); + opt && opt.id != null && idMap.set(opt.id, item); + !item.keyInfo && (item.keyInfo = {}); + }); + each(mapResult, function(item, index) { + const existing = item.existing; + const opt = item.newOption; + const keyInfo = item.keyInfo; + if (!isObject(opt)) { + return; + } + keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name : DUMMY_COMPONENT_NAME_PREFIX + index; + if (existing) { + keyInfo.id = makeComparableKey(existing.id); + } else if (opt.id != null) { + keyInfo.id = makeComparableKey(opt.id); + } else { + let idNum = 0; + do { + keyInfo.id = "\0" + keyInfo.name + "\0" + idNum++; + } while (idMap.get(keyInfo.id)); + } + idMap.set(keyInfo.id, item); + }); +} +function keyExistAndEqual(attr, obj1, obj2) { + const key1 = convertOptionIdName(obj1[attr], null); + const key2 = convertOptionIdName(obj2[attr], null); + return key1 != null && key2 != null && key1 === key2; +} +function makeComparableKey(val) { + if (true) { + if (val == null) { + throw new Error(); + } + } + return convertOptionIdName(val, ""); +} +function convertOptionIdName(idOrName, defaultValue) { + if (idOrName == null) { + return defaultValue; + } + return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + "" : defaultValue; +} +function warnInvalidateIdOrName(idOrName) { + if (true) { + warn("`" + idOrName + "` is invalid id or name. Must be a string or number."); + } +} +function isValidIdOrName(idOrName) { + return isStringSafe(idOrName) || isNumeric(idOrName); +} +function isNameSpecified(componentModel) { + const name = componentModel.name; + return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); +} +function isComponentIdInternal(cmptOption) { + return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0; +} +function makeInternalComponentId(idSuffix) { + return INTERNAL_COMPONENT_ID_PREFIX + idSuffix; +} +function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) { + each(mappingResult, function(item) { + const newOption = item.newOption; + if (isObject(newOption)) { + item.keyInfo.mainType = mainType; + item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor); + } + }); +} +function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) { + const subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType : componentModelCtor.determineSubType(mainType, newCmptOption); + return subType; +} +function compressBatches(batchA, batchB) { + const mapA = {}; + const mapB = {}; + makeMap(batchA || [], mapA); + makeMap(batchB || [], mapB, mapA); + return [mapToArray(mapA), mapToArray(mapB)]; + function makeMap(sourceBatch, map3, otherMap) { + for (let i = 0, len2 = sourceBatch.length; i < len2; i++) { + const seriesId = convertOptionIdName(sourceBatch[i].seriesId, null); + if (seriesId == null) { + return; + } + const dataIndices = normalizeToArray(sourceBatch[i].dataIndex); + const otherDataIndices = otherMap && otherMap[seriesId]; + for (let j = 0, lenj = dataIndices.length; j < lenj; j++) { + const dataIndex = dataIndices[j]; + if (otherDataIndices && otherDataIndices[dataIndex]) { + otherDataIndices[dataIndex] = null; + } else { + (map3[seriesId] || (map3[seriesId] = {}))[dataIndex] = 1; + } + } + } + } + function mapToArray(map3, isData) { + const result = []; + for (const i in map3) { + if (map3.hasOwnProperty(i) && map3[i] != null) { + if (isData) { + result.push(+i); + } else { + const dataIndices = mapToArray(map3[i], true); + dataIndices.length && result.push({seriesId: i, dataIndex: dataIndices}); + } + } + } + return result; + } +} +function queryDataIndex(data, payload) { + if (payload.dataIndexInside != null) { + return payload.dataIndexInside; + } else if (payload.dataIndex != null) { + return isArray(payload.dataIndex) ? map(payload.dataIndex, function(value) { + return data.indexOfRawIndex(value); + }) : data.indexOfRawIndex(payload.dataIndex); + } else if (payload.name != null) { + return isArray(payload.name) ? map(payload.name, function(value) { + return data.indexOfName(value); + }) : data.indexOfName(payload.name); + } +} +function makeInner() { + const key = "__ec_inner_" + innerUniqueIndex++; + return function(hostObj) { + return hostObj[key] || (hostObj[key] = {}); + }; +} +var innerUniqueIndex = getRandomIdBase(); +function parseFinder(ecModel, finderInput, opt) { + const {mainTypeSpecified, queryOptionMap, others} = preParseFinder(finderInput, opt); + const result = others; + const defaultMainType = opt ? opt.defaultMainType : null; + if (!mainTypeSpecified && defaultMainType) { + queryOptionMap.set(defaultMainType, {}); + } + queryOptionMap.each(function(queryOption, mainType) { + const queryResult = queryReferringComponents(ecModel, mainType, queryOption, { + useDefault: defaultMainType === mainType, + enableAll: opt && opt.enableAll != null ? opt.enableAll : true, + enableNone: opt && opt.enableNone != null ? opt.enableNone : true + }); + result[mainType + "Models"] = queryResult.models; + result[mainType + "Model"] = queryResult.models[0]; + }); + return result; +} +function preParseFinder(finderInput, opt) { + let finder; + if (isString(finderInput)) { + const obj = {}; + obj[finderInput + "Index"] = 0; + finder = obj; + } else { + finder = finderInput; + } + const queryOptionMap = createHashMap(); + const others = {}; + let mainTypeSpecified = false; + each(finder, function(value, key) { + if (key === "dataIndex" || key === "dataIndexInside") { + others[key] = value; + return; + } + const parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || []; + const mainType = parsedKey[1]; + const queryType = (parsedKey[2] || "").toLowerCase(); + if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) { + return; + } + mainTypeSpecified = mainTypeSpecified || !!mainType; + const queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {}); + queryOption[queryType] = value; + }); + return {mainTypeSpecified, queryOptionMap, others}; +} +var SINGLE_REFERRING = {useDefault: true, enableAll: false, enableNone: false}; +var MULTIPLE_REFERRING = {useDefault: false, enableAll: true, enableNone: true}; +function queryReferringComponents(ecModel, mainType, userOption, opt) { + opt = opt || SINGLE_REFERRING; + let indexOption = userOption.index; + let idOption = userOption.id; + let nameOption = userOption.name; + const result = { + models: null, + specified: indexOption != null || idOption != null || nameOption != null + }; + if (!result.specified) { + let firstCmpt; + result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : []; + return result; + } + if (indexOption === "none" || indexOption === false) { + assert(opt.enableNone, '`"none"` or `false` is not a valid value on index option.'); + result.models = []; + return result; + } + if (indexOption === "all") { + assert(opt.enableAll, '`"all"` is not a valid value on index option.'); + indexOption = idOption = nameOption = null; + } + result.models = ecModel.queryComponents({ + mainType, + index: indexOption, + id: idOption, + name: nameOption + }); + return result; +} +function setAttribute(dom, key, value) { + dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value; +} +function getAttribute(dom, key) { + return dom.getAttribute ? dom.getAttribute(key) : dom[key]; +} +function getTooltipRenderMode(renderModeOption) { + if (renderModeOption === "auto") { + return env_default.domSupported ? "html" : "richText"; + } else { + return renderModeOption || "html"; + } +} +function groupData(array, getKey2) { + const buckets = createHashMap(); + const keys2 = []; + each(array, function(item) { + const key = getKey2(item); + (buckets.get(key) || (keys2.push(key), buckets.set(key, []))).push(item); + }); + return { + keys: keys2, + buckets + }; +} +function interpolateRawValues(data, precision, sourceValue, targetValue, percent) { + const isAutoPrecision = precision == null || precision === "auto"; + if (targetValue == null) { + return targetValue; + } + if (isNumber(targetValue)) { + const value = interpolateNumber2(sourceValue || 0, targetValue, percent); + return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision); + } else if (isString(targetValue)) { + return percent < 1 ? sourceValue : targetValue; + } else { + const interpolated = []; + const leftArr = sourceValue; + const rightArr = targetValue; + const length2 = Math.max(leftArr ? leftArr.length : 0, rightArr.length); + for (let i = 0; i < length2; ++i) { + const info = data.getDimensionInfo(i); + if (info && info.type === "ordinal") { + interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i]; + } else { + const leftVal = leftArr && leftArr[i] ? leftArr[i] : 0; + const rightVal = rightArr[i]; + const value = interpolateNumber2(leftVal, rightVal, percent); + interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision); + } + } + return interpolated; + } +} + +// src/util/clazz.ts +var TYPE_DELIMITER = "."; +var IS_CONTAINER = "___EC__COMPONENT__CONTAINER___"; +var IS_EXTENDED_CLASS = "___EC__EXTENDED_CLASS___"; +function parseClassType(componentType) { + const ret = {main: "", sub: ""}; + if (componentType) { + const typeArr = componentType.split(TYPE_DELIMITER); + ret.main = typeArr[0] || ""; + ret.sub = typeArr[1] || ""; + } + return ret; +} +function checkClassType(componentType) { + assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal'); +} +function isExtendedClass(clz) { + return !!(clz && clz[IS_EXTENDED_CLASS]); +} +function enableClassExtend(rootClz, mandatoryMethods) { + rootClz.$constructor = rootClz; + rootClz.extend = function(proto2) { + if (true) { + each(mandatoryMethods, function(method) { + if (!proto2[method]) { + console.warn("Method `" + method + "` should be implemented" + (proto2.type ? " in " + proto2.type : "") + "."); + } + }); + } + const superClass = this; + let ExtendedClass; + if (isESClass(superClass)) { + ExtendedClass = class extends superClass { + constructor() { + super(...arguments); + } + }; + } else { + ExtendedClass = function() { + (proto2.$constructor || superClass).apply(this, arguments); + }; + inherits(ExtendedClass, this); + } + extend(ExtendedClass.prototype, proto2); + ExtendedClass[IS_EXTENDED_CLASS] = true; + ExtendedClass.extend = this.extend; + ExtendedClass.superCall = superCall; + ExtendedClass.superApply = superApply; + ExtendedClass.superClass = superClass; + return ExtendedClass; + }; +} +function isESClass(fn) { + return isFunction(fn) && /^class\s/.test(Function.prototype.toString.call(fn)); +} +function mountExtend(SubClz, SupperClz) { + SubClz.extend = SupperClz.extend; +} +var classBase = Math.round(Math.random() * 10); +function enableClassCheck(target) { + const classAttr = ["__\0is_clz", classBase++].join("_"); + target.prototype[classAttr] = true; + if (true) { + assert(!target.isInstance, 'The method "is" can not be defined.'); + } + target.isInstance = function(obj) { + return !!(obj && obj[classAttr]); + }; +} +function superCall(context, methodName, ...args) { + return this.superClass.prototype[methodName].apply(context, args); +} +function superApply(context, methodName, args) { + return this.superClass.prototype[methodName].apply(context, args); +} +function enableClassManagement(target) { + const storage2 = {}; + target.registerClass = function(clz) { + const componentFullType = clz.type || clz.prototype.type; + if (componentFullType) { + checkClassType(componentFullType); + clz.prototype.type = componentFullType; + const componentTypeInfo = parseClassType(componentFullType); + if (!componentTypeInfo.sub) { + if (true) { + if (storage2[componentTypeInfo.main]) { + console.warn(componentTypeInfo.main + " exists."); + } + } + storage2[componentTypeInfo.main] = clz; + } else if (componentTypeInfo.sub !== IS_CONTAINER) { + const container = makeContainer(componentTypeInfo); + container[componentTypeInfo.sub] = clz; + } + } + return clz; + }; + target.getClass = function(mainType, subType, throwWhenNotFound) { + let clz = storage2[mainType]; + if (clz && clz[IS_CONTAINER]) { + clz = subType ? clz[subType] : null; + } + if (throwWhenNotFound && !clz) { + throw new Error(!subType ? mainType + ".type should be specified." : "Component " + mainType + "." + (subType || "") + " is used but not imported."); + } + return clz; + }; + target.getClassesByMainType = function(componentType) { + const componentTypeInfo = parseClassType(componentType); + const result = []; + const obj = storage2[componentTypeInfo.main]; + if (obj && obj[IS_CONTAINER]) { + each(obj, function(o, type) { + type !== IS_CONTAINER && result.push(o); + }); + } else { + result.push(obj); + } + return result; + }; + target.hasClass = function(componentType) { + const componentTypeInfo = parseClassType(componentType); + return !!storage2[componentTypeInfo.main]; + }; + target.getAllClassMainTypes = function() { + const types = []; + each(storage2, function(obj, type) { + types.push(type); + }); + return types; + }; + target.hasSubTypes = function(componentType) { + const componentTypeInfo = parseClassType(componentType); + const obj = storage2[componentTypeInfo.main]; + return obj && obj[IS_CONTAINER]; + }; + function makeContainer(componentTypeInfo) { + let container = storage2[componentTypeInfo.main]; + if (!container || !container[IS_CONTAINER]) { + container = storage2[componentTypeInfo.main] = {}; + container[IS_CONTAINER] = true; + } + return container; + } +} + +// src/model/mixin/makeStyleMapper.ts +function makeStyleMapper(properties, ignoreParent) { + for (let i = 0; i < properties.length; i++) { + if (!properties[i][1]) { + properties[i][1] = properties[i][0]; + } + } + ignoreParent = ignoreParent || false; + return function(model, excludes, includes) { + const style = {}; + for (let i = 0; i < properties.length; i++) { + const propName = properties[i][1]; + if (excludes && indexOf(excludes, propName) >= 0 || includes && indexOf(includes, propName) < 0) { + continue; + } + const val = model.getShallow(propName, ignoreParent); + if (val != null) { + style[properties[i][0]] = val; + } + } + return style; + }; +} + +// src/model/mixin/areaStyle.ts +var AREA_STYLE_KEY_MAP = [ + ["fill", "color"], + ["shadowBlur"], + ["shadowOffsetX"], + ["shadowOffsetY"], + ["opacity"], + ["shadowColor"] +]; +var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP); +var AreaStyleMixin = class { + getAreaStyle(excludes, includes) { + return getAreaStyle(this, excludes, includes); + } +}; + +// node_modules/zrender/src/graphic/helper/image.ts +var globalImageCache = new LRU_default(50); +function findExistImage(newImageOrSrc) { + if (typeof newImageOrSrc === "string") { + const cachedImgObj = globalImageCache.get(newImageOrSrc); + return cachedImgObj && cachedImgObj.image; + } else { + return newImageOrSrc; + } +} +function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) { + if (!newImageOrSrc) { + return image; + } else if (typeof newImageOrSrc === "string") { + if (image && image.__zrImageSrc === newImageOrSrc || !hostEl) { + return image; + } + const cachedImgObj = globalImageCache.get(newImageOrSrc); + const pendingWrap = {hostEl, cb: onload, cbPayload}; + if (cachedImgObj) { + image = cachedImgObj.image; + !isImageReady(image) && cachedImgObj.pending.push(pendingWrap); + } else { + image = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad); + image.__zrImageSrc = newImageOrSrc; + globalImageCache.put(newImageOrSrc, image.__cachedImgObj = { + image, + pending: [pendingWrap] + }); + } + return image; + } else { + return newImageOrSrc; + } +} +function imageOnLoad() { + const cachedImgObj = this.__cachedImgObj; + this.onload = this.onerror = this.__cachedImgObj = null; + for (let i = 0; i < cachedImgObj.pending.length; i++) { + const pendingWrap = cachedImgObj.pending[i]; + const cb = pendingWrap.cb; + cb && cb(this, pendingWrap.cbPayload); + pendingWrap.hostEl.dirty(); + } + cachedImgObj.pending.length = 0; +} +function isImageReady(image) { + return image && image.width && image.height; +} + +// node_modules/zrender/src/graphic/helper/parseText.ts +var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g; +function truncateText(text, containerWidth, font, ellipsis, options) { + if (!containerWidth) { + return ""; + } + const textLines = (text + "").split("\n"); + options = prepareTruncateOptions(containerWidth, font, ellipsis, options); + for (let i = 0, len2 = textLines.length; i < len2; i++) { + textLines[i] = truncateSingleLine(textLines[i], options); + } + return textLines.join("\n"); +} +function prepareTruncateOptions(containerWidth, font, ellipsis, options) { + options = options || {}; + let preparedOpts = extend({}, options); + preparedOpts.font = font; + ellipsis = retrieve2(ellipsis, "..."); + preparedOpts.maxIterations = retrieve2(options.maxIterations, 2); + const minChar = preparedOpts.minChar = retrieve2(options.minChar, 0); + preparedOpts.cnCharWidth = getWidth("\u56FD", font); + const ascCharWidth = preparedOpts.ascCharWidth = getWidth("a", font); + preparedOpts.placeholder = retrieve2(options.placeholder, ""); + let contentWidth = containerWidth = Math.max(0, containerWidth - 1); + for (let i = 0; i < minChar && contentWidth >= ascCharWidth; i++) { + contentWidth -= ascCharWidth; + } + let ellipsisWidth = getWidth(ellipsis, font); + if (ellipsisWidth > contentWidth) { + ellipsis = ""; + ellipsisWidth = 0; + } + contentWidth = containerWidth - ellipsisWidth; + preparedOpts.ellipsis = ellipsis; + preparedOpts.ellipsisWidth = ellipsisWidth; + preparedOpts.contentWidth = contentWidth; + preparedOpts.containerWidth = containerWidth; + return preparedOpts; +} +function truncateSingleLine(textLine, options) { + const containerWidth = options.containerWidth; + const font = options.font; + const contentWidth = options.contentWidth; + if (!containerWidth) { + return ""; + } + let lineWidth = getWidth(textLine, font); + if (lineWidth <= containerWidth) { + return textLine; + } + for (let j = 0; ; j++) { + if (lineWidth <= contentWidth || j >= options.maxIterations) { + textLine += options.ellipsis; + break; + } + const 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) { + let width = 0; + let i = 0; + for (let len2 = text.length; i < len2 && width < contentWidth; i++) { + const charCode = text.charCodeAt(i); + width += 0 <= charCode && charCode <= 127 ? ascCharWidth : cnCharWidth; + } + return i; +} +function parsePlainText(text, style) { + text != null && (text += ""); + const overflow = style.overflow; + const padding = style.padding; + const font = style.font; + const truncate = overflow === "truncate"; + const calculatedLineHeight = getLineHeight(font); + const lineHeight = retrieve2(style.lineHeight, calculatedLineHeight); + const bgColorDrawn = !!style.backgroundColor; + const truncateLineOverflow = style.lineOverflow === "truncate"; + let width = style.width; + let lines; + if (width != null && (overflow === "break" || overflow === "breakAll")) { + lines = text ? wrapText(text, style.font, width, overflow === "breakAll", 0).lines : []; + } else { + lines = text ? text.split("\n") : []; + } + const contentHeight = lines.length * lineHeight; + const height = retrieve2(style.height, contentHeight); + if (contentHeight > height && truncateLineOverflow) { + const lineCount = Math.floor(height / lineHeight); + lines = lines.slice(0, lineCount); + } + if (text && truncate && width != null) { + const options = prepareTruncateOptions(width, font, style.ellipsis, { + minChar: style.truncateMinChar, + placeholder: style.placeholder + }); + for (let i = 0; i < lines.length; i++) { + lines[i] = truncateSingleLine(lines[i], options); + } + } + let outerHeight = height; + let contentWidth = 0; + for (let i = 0; i < lines.length; i++) { + contentWidth = Math.max(getWidth(lines[i], font), contentWidth); + } + if (width == null) { + width = contentWidth; + } + let outerWidth = contentWidth; + if (padding) { + outerHeight += padding[0] + padding[2]; + outerWidth += padding[1] + padding[3]; + width += padding[1] + padding[3]; + } + if (bgColorDrawn) { + outerWidth = width; + } + return { + lines, + height, + outerWidth, + outerHeight, + lineHeight, + calculatedLineHeight, + contentWidth, + contentHeight, + width + }; +} +var RichTextToken = class { +}; +var RichTextLine = class { + constructor(tokens) { + this.tokens = []; + if (tokens) { + this.tokens = tokens; + } + } +}; +var RichTextContentBlock = class { + constructor() { + this.width = 0; + this.height = 0; + this.contentWidth = 0; + this.contentHeight = 0; + this.outerWidth = 0; + this.outerHeight = 0; + this.lines = []; + } +}; +function parseRichText(text, style) { + const contentBlock = new RichTextContentBlock(); + text != null && (text += ""); + if (!text) { + return contentBlock; + } + const topWidth = style.width; + const topHeight = style.height; + const overflow = style.overflow; + let wrapInfo = (overflow === "break" || overflow === "breakAll") && topWidth != null ? {width: topWidth, accumWidth: 0, breakAll: overflow === "breakAll"} : null; + let lastIndex = STYLE_REG.lastIndex = 0; + let result; + while ((result = STYLE_REG.exec(text)) != null) { + const matchedIndex = result.index; + if (matchedIndex > lastIndex) { + pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo); + } + pushTokens(contentBlock, result[2], style, wrapInfo, result[1]); + lastIndex = STYLE_REG.lastIndex; + } + if (lastIndex < text.length) { + pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo); + } + let pendingList = []; + let calculatedHeight = 0; + let calculatedWidth = 0; + const stlPadding = style.padding; + const truncate = overflow === "truncate"; + const truncateLine = style.lineOverflow === "truncate"; + function finishLine(line2, lineWidth, lineHeight) { + line2.width = lineWidth; + line2.lineHeight = lineHeight; + calculatedHeight += lineHeight; + calculatedWidth = Math.max(calculatedWidth, lineWidth); + } + outer: + for (let i = 0; i < contentBlock.lines.length; i++) { + const line2 = contentBlock.lines[i]; + let lineHeight = 0; + let lineWidth = 0; + for (let j = 0; j < line2.tokens.length; j++) { + const token = line2.tokens[j]; + const tokenStyle = token.styleName && style.rich[token.styleName] || {}; + const textPadding = token.textPadding = tokenStyle.padding; + const paddingH = textPadding ? textPadding[1] + textPadding[3] : 0; + const font = token.font = tokenStyle.font || style.font; + token.contentHeight = getLineHeight(font); + let tokenHeight = retrieve2(tokenStyle.height, token.contentHeight); + token.innerHeight = tokenHeight; + textPadding && (tokenHeight += textPadding[0] + textPadding[2]); + token.height = tokenHeight; + token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight); + token.align = tokenStyle && tokenStyle.align || style.align; + token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || "middle"; + if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) { + if (j > 0) { + line2.tokens = line2.tokens.slice(0, j); + finishLine(line2, lineWidth, lineHeight); + contentBlock.lines = contentBlock.lines.slice(0, i + 1); + } else { + contentBlock.lines = contentBlock.lines.slice(0, i); + } + break outer; + } + let styleTokenWidth = tokenStyle.width; + let tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === "auto"; + if (typeof styleTokenWidth === "string" && styleTokenWidth.charAt(styleTokenWidth.length - 1) === "%") { + token.percentWidth = styleTokenWidth; + pendingList.push(token); + token.contentWidth = getWidth(token.text, font); + } else { + if (tokenWidthNotSpecified) { + const textBackgroundColor = tokenStyle.backgroundColor; + let bgImg = textBackgroundColor && textBackgroundColor.image; + if (bgImg) { + bgImg = findExistImage(bgImg); + if (isImageReady(bgImg)) { + token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height); + } } - else { - if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) { - out.zrX = _calcOut$1[0]; - out.zrY = _calcOut$1[1]; - return; - } + } + const remainTruncWidth = truncate && topWidth != null ? topWidth - lineWidth : null; + if (remainTruncWidth != null && remainTruncWidth < token.width) { + if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) { + token.text = ""; + token.width = token.contentWidth = 0; + } else { + token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, {minChar: style.truncateMinChar}); + token.width = token.contentWidth = getWidth(token.text, font); } + } else { + token.contentWidth = getWidth(token.text, font); + } + } + token.width += paddingH; + lineWidth += token.width; + tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight)); + } + finishLine(line2, lineWidth, lineHeight); + } + contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth); + contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight); + contentBlock.contentHeight = calculatedHeight; + contentBlock.contentWidth = calculatedWidth; + if (stlPadding) { + contentBlock.outerWidth += stlPadding[1] + stlPadding[3]; + contentBlock.outerHeight += stlPadding[0] + stlPadding[2]; + } + for (let i = 0; i < pendingList.length; i++) { + const token = pendingList[i]; + const percentWidth = token.percentWidth; + token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width; + } + return contentBlock; +} +function pushTokens(block, str, style, wrapInfo, styleName) { + const isEmptyStr = str === ""; + const tokenStyle = styleName && style.rich[styleName] || {}; + const lines = block.lines; + const font = tokenStyle.font || style.font; + let newLine = false; + let strLines; + let linesWidths; + if (wrapInfo) { + const tokenPadding = tokenStyle.padding; + let tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0; + if (tokenStyle.width != null && tokenStyle.width !== "auto") { + const outerWidth = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH; + if (lines.length > 0) { + if (outerWidth + wrapInfo.accumWidth > wrapInfo.width) { + strLines = str.split("\n"); + newLine = true; + } + } + wrapInfo.accumWidth = outerWidth; + } else { + const res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth); + wrapInfo.accumWidth = res.accumWidth + tokenPaddingH; + linesWidths = res.linesWidths; + strLines = res.lines; + } + } else { + strLines = str.split("\n"); + } + for (let i = 0; i < strLines.length; i++) { + const text = strLines[i]; + const token = new RichTextToken(); + token.styleName = styleName; + token.text = text; + token.isLineHolder = !text && !isEmptyStr; + if (typeof tokenStyle.width === "number") { + token.width = tokenStyle.width; + } else { + token.width = linesWidths ? linesWidths[i] : getWidth(text, font); + } + if (!i && !newLine) { + const tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens; + const tokensLen = tokens.length; + tokensLen === 1 && tokens[0].isLineHolder ? tokens[0] = token : (text || !tokensLen || isEmptyStr) && tokens.push(token); + } else { + lines.push(new RichTextLine([token])); + } + } +} +function isAlphabeticLetter(ch) { + let code = ch.charCodeAt(0); + return code >= 32 && code <= 591 || code >= 880 && code <= 4351 || code >= 4608 && code <= 5119 || code >= 7680 && code <= 8303; +} +var breakCharMap = reduce(",&?/;] ".split(""), function(obj, ch) { + obj[ch] = true; + return obj; +}, {}); +function isWordBreakChar(ch) { + if (isAlphabeticLetter(ch)) { + if (breakCharMap[ch]) { + return true; + } + return false; + } + return true; +} +function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) { + let lines = []; + let linesWidths = []; + let line2 = ""; + let currentWord = ""; + let currentWordWidth = 0; + let accumWidth = 0; + for (let i = 0; i < text.length; i++) { + const ch = text.charAt(i); + if (ch === "\n") { + if (currentWord) { + line2 += currentWord; + accumWidth += currentWordWidth; + } + lines.push(line2); + linesWidths.push(accumWidth); + line2 = ""; + currentWord = ""; + currentWordWidth = 0; + accumWidth = 0; + continue; + } + const chWidth = getWidth(ch, font); + const inWord = isBreakAll ? false : !isWordBreakChar(ch); + if (!lines.length ? lastAccumWidth + accumWidth + chWidth > lineWidth : accumWidth + chWidth > lineWidth) { + if (!accumWidth) { + if (inWord) { + lines.push(currentWord); + linesWidths.push(currentWordWidth); + currentWord = ch; + currentWordWidth = chWidth; + } else { + lines.push(ch); + linesWidths.push(chWidth); + } + } else if (line2 || currentWord) { + if (inWord) { + if (!line2) { + line2 = currentWord; + currentWord = ""; + currentWordWidth = 0; + accumWidth = currentWordWidth; + } + lines.push(line2); + linesWidths.push(accumWidth - currentWordWidth); + currentWord += ch; + currentWordWidth += chWidth; + line2 = ""; + accumWidth = currentWordWidth; + } else { + if (currentWord) { + line2 += currentWord; + currentWord = ""; + currentWordWidth = 0; + } + lines.push(line2); + linesWidths.push(accumWidth); + line2 = ch; + accumWidth = chWidth; + } + } + continue; + } + accumWidth += chWidth; + if (inWord) { + currentWord += ch; + currentWordWidth += chWidth; + } else { + if (currentWord) { + line2 += currentWord; + currentWord = ""; + currentWordWidth = 0; + } + line2 += ch; + } + } + if (!lines.length && !line2) { + line2 = text; + currentWord = ""; + currentWordWidth = 0; + } + if (currentWord) { + line2 += currentWord; + } + if (line2) { + lines.push(line2); + linesWidths.push(accumWidth); + } + if (lines.length === 1) { + accumWidth += lastAccumWidth; + } + return { + accumWidth, + lines, + linesWidths + }; +} + +// node_modules/zrender/src/graphic/Displayable.ts +var STYLE_MAGIC_KEY = "__zr_style_" + Math.round(Math.random() * 10); +var DEFAULT_COMMON_STYLE = { + shadowBlur: 0, + shadowOffsetX: 0, + shadowOffsetY: 0, + shadowColor: "#000", + opacity: 1, + blend: "source-over" +}; +var DEFAULT_COMMON_ANIMATION_PROPS = { + style: { + shadowBlur: true, + shadowOffsetX: true, + shadowOffsetY: true, + shadowColor: true, + opacity: true + } +}; +DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true; +var PRIMARY_STATES_KEYS2 = ["z", "z2", "invisible"]; +var PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ["invisible"]; +var Displayable2 = class extends Element_default { + constructor(props) { + super(props); + } + _init(props) { + const keysArr = keys(props); + for (let i = 0; i < keysArr.length; i++) { + const key = keysArr[i]; + if (key === "style") { + this.useStyle(props[key]); + } else { + super.attrKV(key, props[key]); + } + } + if (!this.style) { + this.useStyle({}); + } + } + beforeBrush() { + } + afterBrush() { + } + innerBeforeBrush() { + } + innerAfterBrush() { + } + shouldBePainted(viewWidth, viewHeight, considerClipPath, considerAncestors) { + const m2 = this.transform; + if (this.ignore || this.invisible || this.style.opacity === 0 || this.culling && isDisplayableCulled(this, viewWidth, viewHeight) || m2 && !m2[0] && !m2[3]) { + return false; + } + if (considerClipPath && this.__clipPaths) { + for (let i = 0; i < this.__clipPaths.length; ++i) { + if (this.__clipPaths[i].isZeroArea()) { + return false; } - out.zrX = out.zrY = 0; - } - function getNativeEvent(e) { - return e - || window.event; - } - function normalizeEvent(el, e, calculate) { - e = getNativeEvent(e); - if (e.zrX != null) { - return e; - } - var eventType = e.type; - var isTouch = eventType && eventType.indexOf('touch') >= 0; - if (!isTouch) { - clientToLocal(el, e, e, calculate); - var wheelDelta = getWheelDeltaMayPolyfill(e); - e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3; - } - else { - var touch = eventType !== 'touchend' - ? e.targetTouches[0] - : e.changedTouches[0]; - touch && clientToLocal(el, touch, e, calculate); - } - var button = e.button; - if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) { - e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0))); - } - return e; - } - function getWheelDeltaMayPolyfill(e) { - var rawWheelDelta = e.wheelDelta; - if (rawWheelDelta) { - return rawWheelDelta; - } - var deltaX = e.deltaX; - var deltaY = e.deltaY; - if (deltaX == null || deltaY == null) { - return rawWheelDelta; - } - var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX); - var sign = deltaY > 0 ? -1 - : deltaY < 0 ? 1 - : deltaX > 0 ? -1 - : 1; - return 3 * delta * sign; - } - function addEventListener(el, name, handler, opt) { - el.addEventListener(name, handler, opt); - } - function removeEventListener(el, name, handler, opt) { - el.removeEventListener(name, handler, opt); - } - var stop = function (e) { - e.preventDefault(); - e.stopPropagation(); - e.cancelBubble = true; - }; - function isMiddleOrRightButtonOnMouseUpDown(e) { - return e.which === 2 || e.which === 3; + } } - - var GestureMgr = (function () { - function GestureMgr() { - this._track = []; + if (considerAncestors && this.parent) { + let parent = this.parent; + while (parent) { + if (parent.ignore) { + return false; } - GestureMgr.prototype.recognize = function (event, target, root) { - this._doTrack(event, target, root); - return this._recognize(event); - }; - GestureMgr.prototype.clear = function () { - this._track.length = 0; - return this; - }; - GestureMgr.prototype._doTrack = function (event, target, root) { - var touches = event.touches; - if (!touches) { - return; + parent = parent.parent; + } + } + return true; + } + contain(x, y) { + return this.rectContain(x, y); + } + traverse(cb, context) { + cb.call(context, this); + } + rectContain(x, y) { + const coord = this.transformCoordToLocal(x, y); + const rect = this.getBoundingRect(); + return rect.contain(coord[0], coord[1]); + } + getPaintRect() { + let rect = this._paintRect; + if (!this._paintRect || this.__dirty) { + const transform2 = this.transform; + const elRect = this.getBoundingRect(); + const style = this.style; + const shadowSize = style.shadowBlur || 0; + const shadowOffsetX = style.shadowOffsetX || 0; + const shadowOffsetY = style.shadowOffsetY || 0; + rect = this._paintRect || (this._paintRect = new BoundingRect_default(0, 0, 0, 0)); + if (transform2) { + BoundingRect_default.applyTransform(rect, elRect, transform2); + } else { + rect.copy(elRect); + } + if (shadowSize || shadowOffsetX || shadowOffsetY) { + rect.width += shadowSize * 2 + Math.abs(shadowOffsetX); + rect.height += shadowSize * 2 + Math.abs(shadowOffsetY); + rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize); + rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize); + } + const tolerance = this.dirtyRectTolerance; + if (!rect.isZero()) { + rect.x = Math.floor(rect.x - tolerance); + rect.y = Math.floor(rect.y - tolerance); + rect.width = Math.ceil(rect.width + 1 + tolerance * 2); + rect.height = Math.ceil(rect.height + 1 + tolerance * 2); + } + } + return rect; + } + setPrevPaintRect(paintRect) { + if (paintRect) { + this._prevPaintRect = this._prevPaintRect || new BoundingRect_default(0, 0, 0, 0); + this._prevPaintRect.copy(paintRect); + } else { + this._prevPaintRect = null; + } + } + getPrevPaintRect() { + return this._prevPaintRect; + } + animateStyle(loop) { + return this.animate("style", loop); + } + updateDuringAnimation(targetKey) { + if (targetKey === "style") { + this.dirtyStyle(); + } else { + this.markRedraw(); + } + } + attrKV(key, value) { + if (key !== "style") { + super.attrKV(key, value); + } else { + if (!this.style) { + this.useStyle(value); + } else { + this.setStyle(value); + } + } + } + setStyle(keyOrObj, value) { + if (typeof keyOrObj === "string") { + this.style[keyOrObj] = value; + } else { + extend(this.style, keyOrObj); + } + this.dirtyStyle(); + return this; + } + dirtyStyle(notRedraw) { + if (!notRedraw) { + this.markRedraw(); + } + this.__dirty |= STYLE_CHANGED_BIT; + if (this._rect) { + this._rect = null; + } + } + dirty() { + this.dirtyStyle(); + } + styleChanged() { + return !!(this.__dirty & STYLE_CHANGED_BIT); + } + styleUpdated() { + this.__dirty &= ~STYLE_CHANGED_BIT; + } + createStyle(obj) { + return createObject(DEFAULT_COMMON_STYLE, obj); + } + useStyle(obj) { + if (!obj[STYLE_MAGIC_KEY]) { + obj = this.createStyle(obj); + } + if (this.__inHover) { + this.__hoverStyle = obj; + } else { + this.style = obj; + } + this.dirtyStyle(); + } + isStyleObject(obj) { + return obj[STYLE_MAGIC_KEY]; + } + _innerSaveToNormal(toState) { + super._innerSaveToNormal(toState); + const normalState = this._normalState; + if (toState.style && !normalState.style) { + normalState.style = this._mergeStyle(this.createStyle(), this.style); + } + this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS2); + } + _applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg) { + super._applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg); + const needsRestoreToNormal = !(state && keepCurrentStates); + let targetStyle; + if (state && state.style) { + if (transition) { + if (keepCurrentStates) { + targetStyle = state.style; + } else { + targetStyle = this._mergeStyle(this.createStyle(), normalState.style); + this._mergeStyle(targetStyle, state.style); + } + } else { + targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style); + this._mergeStyle(targetStyle, state.style); + } + } else if (needsRestoreToNormal) { + targetStyle = normalState.style; + } + if (targetStyle) { + if (transition) { + const sourceStyle = this.style; + this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle); + if (needsRestoreToNormal) { + const changedKeys = keys(sourceStyle); + for (let i = 0; i < changedKeys.length; i++) { + const key = changedKeys[i]; + if (key in targetStyle) { + targetStyle[key] = targetStyle[key]; + this.style[key] = sourceStyle[key]; + } + } + } + const targetKeys = keys(targetStyle); + for (let i = 0; i < targetKeys.length; i++) { + const key = targetKeys[i]; + this.style[key] = this.style[key]; + } + this._transitionState(stateName, { + style: targetStyle + }, animationCfg, this.getAnimationStyleProps()); + } else { + this.useStyle(targetStyle); + } + } + const statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS2; + for (let i = 0; i < statesKeys.length; i++) { + let key = statesKeys[i]; + if (state && state[key] != null) { + this[key] = state[key]; + } else if (needsRestoreToNormal) { + if (normalState[key] != null) { + this[key] = normalState[key]; + } + } + } + } + _mergeStates(states) { + const mergedState = super._mergeStates(states); + let mergedStyle; + for (let i = 0; i < states.length; i++) { + const state = states[i]; + if (state.style) { + mergedStyle = mergedStyle || {}; + this._mergeStyle(mergedStyle, state.style); + } + } + if (mergedStyle) { + mergedState.style = mergedStyle; + } + return mergedState; + } + _mergeStyle(targetStyle, sourceStyle) { + extend(targetStyle, sourceStyle); + return targetStyle; + } + getAnimationStyleProps() { + return DEFAULT_COMMON_ANIMATION_PROPS; + } +}; +var Displayable = Displayable2; +Displayable.initDefaultProps = function() { + const dispProto = Displayable2.prototype; + dispProto.type = "displayable"; + dispProto.invisible = false; + dispProto.z = 0; + dispProto.z2 = 0; + dispProto.zlevel = 0; + dispProto.culling = false; + dispProto.cursor = "pointer"; + dispProto.rectHover = false; + dispProto.incremental = false; + dispProto._rect = null; + dispProto.dirtyRectTolerance = 0; + dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT; +}(); +var tmpRect2 = new BoundingRect_default(0, 0, 0, 0); +var viewRect = new BoundingRect_default(0, 0, 0, 0); +function isDisplayableCulled(el, width, height) { + tmpRect2.copy(el.getBoundingRect()); + if (el.transform) { + tmpRect2.applyTransform(el.transform); + } + viewRect.width = width; + viewRect.height = height; + return !tmpRect2.intersect(viewRect); +} +var Displayable_default = Displayable; + +// node_modules/zrender/src/core/bbox.ts +var mathMin2 = Math.min; +var mathMax2 = Math.max; +var mathSin = Math.sin; +var mathCos = Math.cos; +var PI2 = Math.PI * 2; +var start = create(); +var end = create(); +var extremity = create(); +function fromPoints(points4, min3, max3) { + if (points4.length === 0) { + return; + } + let p = points4[0]; + let left = p[0]; + let right = p[0]; + let top = p[1]; + let bottom = p[1]; + for (let i = 1; i < points4.length; i++) { + p = points4[i]; + left = mathMin2(left, p[0]); + right = mathMax2(right, p[0]); + top = mathMin2(top, p[1]); + bottom = mathMax2(bottom, p[1]); + } + min3[0] = left; + min3[1] = top; + max3[0] = right; + max3[1] = bottom; +} +function fromLine(x0, y0, x1, y1, min3, max3) { + min3[0] = mathMin2(x0, x1); + min3[1] = mathMin2(y0, y1); + max3[0] = mathMax2(x0, x1); + max3[1] = mathMax2(y0, y1); +} +var xDim = []; +var yDim = []; +function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min3, max3) { + const cubicExtrema2 = cubicExtrema; + const cubicAt2 = cubicAt; + let n = cubicExtrema2(x0, x1, x2, x3, xDim); + min3[0] = Infinity; + min3[1] = Infinity; + max3[0] = -Infinity; + max3[1] = -Infinity; + for (let i = 0; i < n; i++) { + const x = cubicAt2(x0, x1, x2, x3, xDim[i]); + min3[0] = mathMin2(x, min3[0]); + max3[0] = mathMax2(x, max3[0]); + } + n = cubicExtrema2(y0, y1, y2, y3, yDim); + for (let i = 0; i < n; i++) { + const y = cubicAt2(y0, y1, y2, y3, yDim[i]); + min3[1] = mathMin2(y, min3[1]); + max3[1] = mathMax2(y, max3[1]); + } + min3[0] = mathMin2(x0, min3[0]); + max3[0] = mathMax2(x0, max3[0]); + min3[0] = mathMin2(x3, min3[0]); + max3[0] = mathMax2(x3, max3[0]); + min3[1] = mathMin2(y0, min3[1]); + max3[1] = mathMax2(y0, max3[1]); + min3[1] = mathMin2(y3, min3[1]); + max3[1] = mathMax2(y3, max3[1]); +} +function fromQuadratic(x0, y0, x1, y1, x2, y2, min3, max3) { + const quadraticExtremum2 = quadraticExtremum; + const quadraticAt3 = quadraticAt; + const tx = mathMax2(mathMin2(quadraticExtremum2(x0, x1, x2), 1), 0); + const ty = mathMax2(mathMin2(quadraticExtremum2(y0, y1, y2), 1), 0); + const x = quadraticAt3(x0, x1, x2, tx); + const y = quadraticAt3(y0, y1, y2, ty); + min3[0] = mathMin2(x0, x2, x); + min3[1] = mathMin2(y0, y2, y); + max3[0] = mathMax2(x0, x2, x); + max3[1] = mathMax2(y0, y2, y); +} +function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min3, max3) { + const vec2Min = min; + const vec2Max = max; + const diff = Math.abs(startAngle - endAngle); + if (diff % PI2 < 1e-4 && diff > 1e-4) { + min3[0] = x - rx; + min3[1] = y - ry; + max3[0] = x + rx; + max3[1] = y + ry; + return; + } + start[0] = mathCos(startAngle) * rx + x; + start[1] = mathSin(startAngle) * ry + y; + end[0] = mathCos(endAngle) * rx + x; + end[1] = mathSin(endAngle) * ry + y; + vec2Min(min3, start, end); + vec2Max(max3, start, end); + startAngle = startAngle % PI2; + if (startAngle < 0) { + startAngle = startAngle + PI2; + } + endAngle = endAngle % PI2; + if (endAngle < 0) { + endAngle = endAngle + PI2; + } + if (startAngle > endAngle && !anticlockwise) { + endAngle += PI2; + } else if (startAngle < endAngle && anticlockwise) { + startAngle += PI2; + } + if (anticlockwise) { + const tmp = endAngle; + endAngle = startAngle; + startAngle = tmp; + } + for (let angle = 0; angle < endAngle; angle += Math.PI / 2) { + if (angle > startAngle) { + extremity[0] = mathCos(angle) * rx + x; + extremity[1] = mathSin(angle) * ry + y; + vec2Min(min3, extremity, min3); + vec2Max(max3, extremity, max3); + } + } +} + +// node_modules/zrender/src/core/PathProxy.ts +var CMD = { + M: 1, + L: 2, + C: 3, + Q: 4, + A: 5, + Z: 6, + R: 7 +}; +var tmpOutX = []; +var tmpOutY = []; +var min2 = []; +var max2 = []; +var min22 = []; +var max22 = []; +var mathMin3 = Math.min; +var mathMax3 = Math.max; +var mathCos2 = Math.cos; +var mathSin2 = Math.sin; +var mathAbs = Math.abs; +var PI = Math.PI; +var PI22 = PI * 2; +var hasTypedArray = typeof Float32Array !== "undefined"; +var tmpAngles = []; +function modPI2(radian) { + const n = Math.round(radian / PI * 1e8) / 1e8; + return n % 2 * PI; +} +function normalizeArcAngles(angles, anticlockwise) { + let newStartAngle = modPI2(angles[0]); + if (newStartAngle < 0) { + newStartAngle += PI22; + } + let delta = newStartAngle - angles[0]; + let newEndAngle = angles[1]; + newEndAngle += delta; + if (!anticlockwise && newEndAngle - newStartAngle >= PI22) { + newEndAngle = newStartAngle + PI22; + } else if (anticlockwise && newStartAngle - newEndAngle >= PI22) { + newEndAngle = newStartAngle - PI22; + } else if (!anticlockwise && newStartAngle > newEndAngle) { + newEndAngle = newStartAngle + (PI22 - modPI2(newStartAngle - newEndAngle)); + } else if (anticlockwise && newStartAngle < newEndAngle) { + newEndAngle = newStartAngle - (PI22 - modPI2(newEndAngle - newStartAngle)); + } + angles[0] = newStartAngle; + angles[1] = newEndAngle; +} +var PathProxy2 = class { + constructor(notSaveData) { + this.dpr = 1; + this._xi = 0; + this._yi = 0; + this._x0 = 0; + this._y0 = 0; + this._len = 0; + if (notSaveData) { + this._saveData = false; + } + if (this._saveData) { + this.data = []; + } + } + increaseVersion() { + this._version++; + } + getVersion() { + return this._version; + } + setScale(sx, sy, segmentIgnoreThreshold) { + segmentIgnoreThreshold = segmentIgnoreThreshold || 0; + if (segmentIgnoreThreshold > 0) { + this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0; + this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0; + } + } + setDPR(dpr2) { + this.dpr = dpr2; + } + setContext(ctx) { + this._ctx = ctx; + } + getContext() { + return this._ctx; + } + beginPath() { + this._ctx && this._ctx.beginPath(); + this.reset(); + return this; + } + reset() { + if (this._saveData) { + this._len = 0; + } + if (this._pathSegLen) { + this._pathSegLen = null; + this._pathLen = 0; + } + this._version++; + } + moveTo(x, y) { + this._drawPendingPt(); + this.addData(CMD.M, x, y); + this._ctx && this._ctx.moveTo(x, y); + this._x0 = x; + this._y0 = y; + this._xi = x; + this._yi = y; + return this; + } + lineTo(x, y) { + const dx = mathAbs(x - this._xi); + const dy = mathAbs(y - this._yi); + const exceedUnit = dx > this._ux || dy > this._uy; + this.addData(CMD.L, x, y); + if (this._ctx && exceedUnit) { + this._ctx.lineTo(x, y); + } + if (exceedUnit) { + this._xi = x; + this._yi = y; + this._pendingPtDist = 0; + } else { + const d2 = dx * dx + dy * dy; + if (d2 > this._pendingPtDist) { + this._pendingPtX = x; + this._pendingPtY = y; + this._pendingPtDist = d2; + } + } + return this; + } + bezierCurveTo(x1, y1, x2, y2, x3, y3) { + this._drawPendingPt(); + this.addData(CMD.C, x1, y1, x2, y2, x3, y3); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + this._xi = x3; + this._yi = y3; + return this; + } + quadraticCurveTo(x1, y1, x2, y2) { + this._drawPendingPt(); + this.addData(CMD.Q, x1, y1, x2, y2); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + this._xi = x2; + this._yi = y2; + return this; + } + arc(cx, cy, r, startAngle, endAngle, anticlockwise) { + this._drawPendingPt(); + tmpAngles[0] = startAngle; + tmpAngles[1] = endAngle; + normalizeArcAngles(tmpAngles, anticlockwise); + startAngle = tmpAngles[0]; + endAngle = tmpAngles[1]; + let delta = endAngle - startAngle; + this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1); + this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + this._xi = mathCos2(endAngle) * r + cx; + this._yi = mathSin2(endAngle) * r + cy; + return this; + } + arcTo(x1, y1, x2, y2, radius) { + this._drawPendingPt(); + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + } + rect(x, y, w, h) { + this._drawPendingPt(); + this._ctx && this._ctx.rect(x, y, w, h); + this.addData(CMD.R, x, y, w, h); + return this; + } + closePath() { + this._drawPendingPt(); + this.addData(CMD.Z); + const ctx = this._ctx; + const x0 = this._x0; + const y0 = this._y0; + if (ctx) { + ctx.closePath(); + } + this._xi = x0; + this._yi = y0; + return this; + } + fill(ctx) { + ctx && ctx.fill(); + this.toStatic(); + } + stroke(ctx) { + ctx && ctx.stroke(); + this.toStatic(); + } + len() { + return this._len; + } + setData(data) { + const len2 = data.length; + if (!(this.data && this.data.length === len2) && hasTypedArray) { + this.data = new Float32Array(len2); + } + for (let i = 0; i < len2; i++) { + this.data[i] = data[i]; + } + this._len = len2; + } + appendPath(path) { + if (!(path instanceof Array)) { + path = [path]; + } + const len2 = path.length; + let appendSize = 0; + let offset = this._len; + for (let i = 0; i < len2; i++) { + appendSize += path[i].len(); + } + if (hasTypedArray && (this.data instanceof Float32Array || !this.data)) { + this.data = new Float32Array(offset + appendSize); + } + for (let i = 0; i < len2; i++) { + const appendPathData = path[i].data; + for (let k = 0; k < appendPathData.length; k++) { + this.data[offset++] = appendPathData[k]; + } + } + this._len = offset; + } + addData(cmd, a, b, c, d, e2, f, g, h) { + if (!this._saveData) { + return; + } + let data = this.data; + if (this._len + arguments.length > data.length) { + this._expandData(); + data = this.data; + } + for (let i = 0; i < arguments.length; i++) { + data[this._len++] = arguments[i]; + } + } + _drawPendingPt() { + if (this._pendingPtDist > 0) { + this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY); + this._pendingPtDist = 0; + } + } + _expandData() { + if (!(this.data instanceof Array)) { + const newData = []; + for (let i = 0; i < this._len; i++) { + newData[i] = this.data[i]; + } + this.data = newData; + } + } + toStatic() { + if (!this._saveData) { + return; + } + this._drawPendingPt(); + const data = this.data; + if (data instanceof Array) { + data.length = this._len; + if (hasTypedArray && this._len > 11) { + this.data = new Float32Array(data); + } + } + } + getBoundingRect() { + min2[0] = min2[1] = min22[0] = min22[1] = Number.MAX_VALUE; + max2[0] = max2[1] = max22[0] = max22[1] = -Number.MAX_VALUE; + const data = this.data; + let xi = 0; + let yi = 0; + let x0 = 0; + let y0 = 0; + let i; + for (i = 0; i < this._len; ) { + const cmd = data[i++]; + const isFirst = i === 1; + if (isFirst) { + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + } + switch (cmd) { + case CMD.M: + xi = x0 = data[i++]; + yi = y0 = data[i++]; + min22[0] = x0; + min22[1] = y0; + max22[0] = x0; + max22[1] = y0; + break; + case CMD.L: + fromLine(xi, yi, data[i], data[i + 1], min22, max22); + xi = data[i++]; + yi = data[i++]; + break; + case CMD.C: + fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min22, max22); + xi = data[i++]; + yi = data[i++]; + break; + case CMD.Q: + fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min22, max22); + xi = data[i++]; + yi = data[i++]; + break; + case CMD.A: + const cx = data[i++]; + const cy = data[i++]; + const rx = data[i++]; + const ry = data[i++]; + const startAngle = data[i++]; + const endAngle = data[i++] + startAngle; + i += 1; + const anticlockwise = !data[i++]; + if (isFirst) { + x0 = mathCos2(startAngle) * rx + cx; + y0 = mathSin2(startAngle) * ry + cy; + } + fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min22, max22); + xi = mathCos2(endAngle) * rx + cx; + yi = mathSin2(endAngle) * ry + cy; + break; + case CMD.R: + x0 = xi = data[i++]; + y0 = yi = data[i++]; + const width = data[i++]; + const height = data[i++]; + fromLine(x0, y0, x0 + width, y0 + height, min22, max22); + break; + case CMD.Z: + xi = x0; + yi = y0; + break; + } + min(min2, min2, min22); + max(max2, max2, max22); + } + if (i === 0) { + min2[0] = min2[1] = max2[0] = max2[1] = 0; + } + return new BoundingRect_default(min2[0], min2[1], max2[0] - min2[0], max2[1] - min2[1]); + } + _calculateLength() { + const data = this.data; + const len2 = this._len; + const ux = this._ux; + const uy = this._uy; + let xi = 0; + let yi = 0; + let x0 = 0; + let y0 = 0; + if (!this._pathSegLen) { + this._pathSegLen = []; + } + const pathSegLen = this._pathSegLen; + let pathTotalLen = 0; + let segCount = 0; + for (let i = 0; i < len2; ) { + const cmd = data[i++]; + const isFirst = i === 1; + if (isFirst) { + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + } + let l = -1; + switch (cmd) { + case CMD.M: + xi = x0 = data[i++]; + yi = y0 = data[i++]; + break; + case CMD.L: { + const x2 = data[i++]; + const y2 = data[i++]; + const dx = x2 - xi; + const dy = y2 - yi; + if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len2 - 1) { + l = Math.sqrt(dx * dx + dy * dy); + xi = x2; + yi = y2; + } + break; + } + case CMD.C: { + const x1 = data[i++]; + const y1 = data[i++]; + const x2 = data[i++]; + const y2 = data[i++]; + const x3 = data[i++]; + const y3 = data[i++]; + l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10); + xi = x3; + yi = y3; + break; + } + case CMD.Q: { + const x1 = data[i++]; + const y1 = data[i++]; + const x2 = data[i++]; + const y2 = data[i++]; + l = quadraticLength(xi, yi, x1, y1, x2, y2, 10); + xi = x2; + yi = y2; + break; + } + case CMD.A: + const cx = data[i++]; + const cy = data[i++]; + const rx = data[i++]; + const ry = data[i++]; + const startAngle = data[i++]; + let delta = data[i++]; + const endAngle = delta + startAngle; + i += 1; + if (isFirst) { + x0 = mathCos2(startAngle) * rx + cx; + y0 = mathSin2(startAngle) * ry + cy; + } + l = mathMax3(rx, ry) * mathMin3(PI22, Math.abs(delta)); + xi = mathCos2(endAngle) * rx + cx; + yi = mathSin2(endAngle) * ry + cy; + break; + case CMD.R: { + x0 = xi = data[i++]; + y0 = yi = data[i++]; + const width = data[i++]; + const height = data[i++]; + l = width * 2 + height * 2; + break; + } + case CMD.Z: { + const dx = x0 - xi; + const dy = y0 - yi; + l = Math.sqrt(dx * dx + dy * dy); + xi = x0; + yi = y0; + break; + } + } + if (l >= 0) { + pathSegLen[segCount++] = l; + pathTotalLen += l; + } + } + this._pathLen = pathTotalLen; + return pathTotalLen; + } + rebuildPath(ctx, percent) { + const d = this.data; + const ux = this._ux; + const uy = this._uy; + const len2 = this._len; + let x0; + let y0; + let xi; + let yi; + let x; + let y; + const drawPart = percent < 1; + let pathSegLen; + let pathTotalLen; + let accumLength = 0; + let segCount = 0; + let displayedLength; + let pendingPtDist = 0; + let pendingPtX; + let pendingPtY; + if (drawPart) { + if (!this._pathSegLen) { + this._calculateLength(); + } + pathSegLen = this._pathSegLen; + pathTotalLen = this._pathLen; + displayedLength = percent * pathTotalLen; + if (!displayedLength) { + return; + } + } + lo: + for (let i = 0; i < len2; ) { + const cmd = d[i++]; + const isFirst = i === 1; + if (isFirst) { + xi = d[i]; + yi = d[i + 1]; + x0 = xi; + y0 = yi; + } + if (cmd !== CMD.L && pendingPtDist > 0) { + ctx.lineTo(pendingPtX, pendingPtY); + pendingPtDist = 0; + } + 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++]; + const dx = mathAbs(x - xi); + const dy = mathAbs(y - yi); + if (dx > ux || dy > uy) { + if (drawPart) { + const l = pathSegLen[segCount++]; + if (accumLength + l > displayedLength) { + const t = (displayedLength - accumLength) / l; + ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t); + break lo; + } + accumLength += l; + } + ctx.lineTo(x, y); + xi = x; + yi = y; + pendingPtDist = 0; + } else { + const d2 = dx * dx + dy * dy; + if (d2 > pendingPtDist) { + pendingPtX = x; + pendingPtY = y; + pendingPtDist = d2; + } } - var trackItem = { - points: [], - touches: [], - target: target, - event: event - }; - for (var i = 0, len = touches.length; i < len; i++) { - var touch = touches[i]; - var pos = clientToLocal(root, touch, {}); - trackItem.points.push([pos.zrX, pos.zrY]); - trackItem.touches.push(touch); + break; + } + case CMD.C: { + const x1 = d[i++]; + const y1 = d[i++]; + const x2 = d[i++]; + const y2 = d[i++]; + const x3 = d[i++]; + const y3 = d[i++]; + if (drawPart) { + const l = pathSegLen[segCount++]; + if (accumLength + l > displayedLength) { + const t = (displayedLength - accumLength) / l; + cubicSubdivide(xi, x1, x2, x3, t, tmpOutX); + cubicSubdivide(yi, y1, y2, y3, t, tmpOutY); + ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]); + break lo; + } + accumLength += l; } - this._track.push(trackItem); - }; - GestureMgr.prototype._recognize = function (event) { - for (var eventName in recognizers) { - if (recognizers.hasOwnProperty(eventName)) { - var gestureInfo = recognizers[eventName](this._track, event); - if (gestureInfo) { - return gestureInfo; - } - } + ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + xi = x3; + yi = y3; + break; + } + case CMD.Q: { + const x1 = d[i++]; + const y1 = d[i++]; + const x2 = d[i++]; + const y2 = d[i++]; + if (drawPart) { + const l = pathSegLen[segCount++]; + if (accumLength + l > displayedLength) { + const t = (displayedLength - accumLength) / l; + quadraticSubdivide(xi, x1, x2, t, tmpOutX); + quadraticSubdivide(yi, y1, y2, t, tmpOutY); + ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]); + break lo; + } + accumLength += l; } - }; - return GestureMgr; - }()); - function dist$1(pointPair) { - var dx = pointPair[1][0] - pointPair[0][0]; - var dy = pointPair[1][1] - pointPair[0][1]; - return Math.sqrt(dx * dx + dy * dy); - } - function center(pointPair) { - return [ - (pointPair[0][0] + pointPair[1][0]) / 2, - (pointPair[0][1] + pointPair[1][1]) / 2 - ]; - } - var recognizers = { - pinch: function (tracks, event) { - var trackLen = tracks.length; - if (!trackLen) { - return; + ctx.quadraticCurveTo(x1, y1, x2, y2); + xi = x2; + yi = y2; + break; + } + case CMD.A: + const cx = d[i++]; + const cy = d[i++]; + const rx = d[i++]; + const ry = d[i++]; + let startAngle = d[i++]; + let delta = d[i++]; + const psi = d[i++]; + const anticlockwise = !d[i++]; + const r = rx > ry ? rx : ry; + const isEllipse = mathAbs(rx - ry) > 1e-3; + let endAngle = startAngle + delta; + let breakBuild = false; + if (drawPart) { + const l = pathSegLen[segCount++]; + if (accumLength + l > displayedLength) { + endAngle = startAngle + delta * (displayedLength - accumLength) / l; + breakBuild = true; + } + accumLength += l; } - var pinchEnd = (tracks[trackLen - 1] || {}).points; - var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd; - if (pinchPre - && pinchPre.length > 1 - && pinchEnd - && pinchEnd.length > 1) { - var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre); - !isFinite(pinchScale) && (pinchScale = 1); - event.pinchScale = pinchScale; - var pinchCenter = center(pinchEnd); - event.pinchX = pinchCenter[0]; - event.pinchY = pinchCenter[1]; - return { - type: 'pinch', - target: tracks[0].target, - event: event - }; + if (isEllipse && ctx.ellipse) { + ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise); + } else { + ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); } - } - }; - - function create$1() { - return [1, 0, 0, 1, 0, 0]; - } - function identity(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - return out; - } - function copy$1(out, m) { - out[0] = m[0]; - out[1] = m[1]; - out[2] = m[2]; - out[3] = m[3]; - out[4] = m[4]; - out[5] = m[5]; - return out; - } - function mul$1(out, m1, m2) { - var out0 = m1[0] * m2[0] + m1[2] * m2[1]; - var out1 = m1[1] * m2[0] + m1[3] * m2[1]; - var out2 = m1[0] * m2[2] + m1[2] * m2[3]; - var out3 = m1[1] * m2[2] + m1[3] * m2[3]; - var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; - var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; - out[0] = out0; - out[1] = out1; - out[2] = out2; - out[3] = out3; - out[4] = out4; - out[5] = out5; - return out; - } - function translate(out, a, v) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4] + v[0]; - out[5] = a[5] + v[1]; - return out; - } - function rotate(out, a, rad, pivot) { - if (pivot === void 0) { pivot = [0, 0]; } - var aa = a[0]; - var ac = a[2]; - var atx = a[4]; - var ab = a[1]; - var ad = a[3]; - var aty = a[5]; - var st = Math.sin(rad); - var ct = Math.cos(rad); - out[0] = aa * ct + ab * st; - out[1] = -aa * st + ab * ct; - out[2] = ac * ct + ad * st; - out[3] = -ac * st + ct * ad; - out[4] = ct * (atx - pivot[0]) + st * (aty - pivot[1]) + pivot[0]; - out[5] = ct * (aty - pivot[1]) - st * (atx - pivot[0]) + pivot[1]; - return out; - } - function scale$1(out, a, v) { - var vx = v[0]; - var vy = v[1]; - out[0] = a[0] * vx; - out[1] = a[1] * vy; - out[2] = a[2] * vx; - out[3] = a[3] * vy; - out[4] = a[4] * vx; - out[5] = a[5] * vy; - return out; - } - function invert(out, a) { - var aa = a[0]; - var ac = a[2]; - var atx = a[4]; - var ab = a[1]; - var ad = a[3]; - var aty = a[5]; - var det = aa * ad - ab * ac; - if (!det) { - return null; - } - det = 1.0 / det; - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; - } - function clone$2(a) { - var b = create$1(); - copy$1(b, a); - return b; - } - - var matrix = /*#__PURE__*/Object.freeze({ - __proto__: null, - create: create$1, - identity: identity, - copy: copy$1, - mul: mul$1, - translate: translate, - rotate: rotate, - scale: scale$1, - invert: invert, - clone: clone$2 - }); - - var Point = (function () { - function Point(x, y) { - this.x = x || 0; - this.y = y || 0; - } - Point.prototype.copy = function (other) { - this.x = other.x; - this.y = other.y; - return this; - }; - Point.prototype.clone = function () { - return new Point(this.x, this.y); - }; - Point.prototype.set = function (x, y) { - this.x = x; - this.y = y; - return this; - }; - Point.prototype.equal = function (other) { - return other.x === this.x && other.y === this.y; - }; - Point.prototype.add = function (other) { - this.x += other.x; - this.y += other.y; - return this; - }; - Point.prototype.scale = function (scalar) { - this.x *= scalar; - this.y *= scalar; - }; - Point.prototype.scaleAndAdd = function (other, scalar) { - this.x += other.x * scalar; - this.y += other.y * scalar; - }; - Point.prototype.sub = function (other) { - this.x -= other.x; - this.y -= other.y; - return this; - }; - Point.prototype.dot = function (other) { - return this.x * other.x + this.y * other.y; - }; - Point.prototype.len = function () { - return Math.sqrt(this.x * this.x + this.y * this.y); - }; - Point.prototype.lenSquare = function () { - return this.x * this.x + this.y * this.y; - }; - Point.prototype.normalize = function () { - var len = this.len(); - this.x /= len; - this.y /= len; - return this; - }; - Point.prototype.distance = function (other) { - var dx = this.x - other.x; - var dy = this.y - other.y; - return Math.sqrt(dx * dx + dy * dy); - }; - Point.prototype.distanceSquare = function (other) { - var dx = this.x - other.x; - var dy = this.y - other.y; - return dx * dx + dy * dy; - }; - Point.prototype.negate = function () { - this.x = -this.x; - this.y = -this.y; - return this; - }; - Point.prototype.transform = function (m) { - if (!m) { - return; - } - var x = this.x; - var y = this.y; - this.x = m[0] * x + m[2] * y + m[4]; - this.y = m[1] * x + m[3] * y + m[5]; - return this; - }; - Point.prototype.toArray = function (out) { - out[0] = this.x; - out[1] = this.y; - return out; - }; - Point.prototype.fromArray = function (input) { - this.x = input[0]; - this.y = input[1]; - }; - Point.set = function (p, x, y) { - p.x = x; - p.y = y; - }; - Point.copy = function (p, p2) { - p.x = p2.x; - p.y = p2.y; - }; - Point.len = function (p) { - return Math.sqrt(p.x * p.x + p.y * p.y); - }; - Point.lenSquare = function (p) { - return p.x * p.x + p.y * p.y; - }; - Point.dot = function (p0, p1) { - return p0.x * p1.x + p0.y * p1.y; - }; - Point.add = function (out, p0, p1) { - out.x = p0.x + p1.x; - out.y = p0.y + p1.y; - }; - Point.sub = function (out, p0, p1) { - out.x = p0.x - p1.x; - out.y = p0.y - p1.y; - }; - Point.scale = function (out, p0, scalar) { - out.x = p0.x * scalar; - out.y = p0.y * scalar; - }; - Point.scaleAndAdd = function (out, p0, p1, scalar) { - out.x = p0.x + p1.x * scalar; - out.y = p0.y + p1.y * scalar; - }; - Point.lerp = function (out, p0, p1, t) { - var onet = 1 - t; - out.x = onet * p0.x + t * p1.x; - out.y = onet * p0.y + t * p1.y; - }; - return Point; - }()); - - var mathMin = Math.min; - var mathMax = Math.max; - var lt = new Point(); - var rb = new Point(); - var lb = new Point(); - var rt = new Point(); - var minTv = new Point(); - var maxTv = new Point(); - var BoundingRect = (function () { - function BoundingRect(x, y, width, height) { - if (width < 0) { - x = x + width; - width = -width; - } - if (height < 0) { - y = y + height; - height = -height; - } - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - BoundingRect.prototype.union = function (other) { - var x = mathMin(other.x, this.x); - var y = mathMin(other.y, this.y); - if (isFinite(this.x) && isFinite(this.width)) { - this.width = mathMax(other.x + other.width, this.x + this.width) - x; - } - else { - this.width = other.width; - } - if (isFinite(this.y) && isFinite(this.height)) { - this.height = mathMax(other.y + other.height, this.y + this.height) - y; - } - else { - this.height = other.height; - } - this.x = x; - this.y = y; - }; - BoundingRect.prototype.applyTransform = function (m) { - BoundingRect.applyTransform(this, this, m); - }; - BoundingRect.prototype.calculateTransform = function (b) { - var a = this; - var sx = b.width / a.width; - var sy = b.height / a.height; - var m = create$1(); - translate(m, m, [-a.x, -a.y]); - scale$1(m, m, [sx, sy]); - translate(m, m, [b.x, b.y]); - return m; - }; - BoundingRect.prototype.intersect = function (b, mtv) { - if (!b) { - return false; - } - if (!(b instanceof BoundingRect)) { - b = BoundingRect.create(b); - } - var a = this; - var ax0 = a.x; - var ax1 = a.x + a.width; - var ay0 = a.y; - var ay1 = a.y + a.height; - var bx0 = b.x; - var bx1 = b.x + b.width; - var by0 = b.y; - var by1 = b.y + b.height; - var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0); - if (mtv) { - var dMin = Infinity; - var dMax = 0; - var d0 = Math.abs(ax1 - bx0); - var d1 = Math.abs(bx1 - ax0); - var d2 = Math.abs(ay1 - by0); - var d3 = Math.abs(by1 - ay0); - var dx = Math.min(d0, d1); - var dy = Math.min(d2, d3); - if (ax1 < bx0 || bx1 < ax0) { - if (dx > dMax) { - dMax = dx; - if (d0 < d1) { - Point.set(maxTv, -d0, 0); - } - else { - Point.set(maxTv, d1, 0); - } - } - } - else { - if (dx < dMin) { - dMin = dx; - if (d0 < d1) { - Point.set(minTv, d0, 0); - } - else { - Point.set(minTv, -d1, 0); - } - } - } - if (ay1 < by0 || by1 < ay0) { - if (dy > dMax) { - dMax = dy; - if (d2 < d3) { - Point.set(maxTv, 0, -d2); - } - else { - Point.set(maxTv, 0, d3); - } - } - } - else { - if (dx < dMin) { - dMin = dx; - if (d2 < d3) { - Point.set(minTv, 0, d2); - } - else { - Point.set(minTv, 0, -d3); - } - } - } - } - if (mtv) { - Point.copy(mtv, overlap ? minTv : maxTv); - } - return overlap; - }; - BoundingRect.prototype.contain = function (x, y) { - var rect = this; - return x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height); - }; - BoundingRect.prototype.clone = function () { - return new BoundingRect(this.x, this.y, this.width, this.height); - }; - BoundingRect.prototype.copy = function (other) { - BoundingRect.copy(this, other); - }; - BoundingRect.prototype.plain = function () { - return { - x: this.x, - y: this.y, - width: this.width, - height: this.height - }; - }; - BoundingRect.prototype.isFinite = function () { - return isFinite(this.x) - && isFinite(this.y) - && isFinite(this.width) - && isFinite(this.height); - }; - BoundingRect.prototype.isZero = function () { - return this.width === 0 || this.height === 0; - }; - BoundingRect.create = function (rect) { - return new BoundingRect(rect.x, rect.y, rect.width, rect.height); - }; - BoundingRect.copy = function (target, source) { - target.x = source.x; - target.y = source.y; - target.width = source.width; - target.height = source.height; - }; - BoundingRect.applyTransform = function (target, source, m) { - if (!m) { - if (target !== source) { - BoundingRect.copy(target, source); - } - return; - } - if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) { - var sx = m[0]; - var sy = m[3]; - var tx = m[4]; - var ty = m[5]; - target.x = source.x * sx + tx; - target.y = source.y * sy + ty; - target.width = source.width * sx; - target.height = source.height * sy; - if (target.width < 0) { - target.x += target.width; - target.width = -target.width; - } - if (target.height < 0) { - target.y += target.height; - target.height = -target.height; - } - return; - } - lt.x = lb.x = source.x; - lt.y = rt.y = source.y; - rb.x = rt.x = source.x + source.width; - rb.y = lb.y = source.y + source.height; - lt.transform(m); - rt.transform(m); - rb.transform(m); - lb.transform(m); - target.x = mathMin(lt.x, rb.x, lb.x, rt.x); - target.y = mathMin(lt.y, rb.y, lb.y, rt.y); - var maxX = mathMax(lt.x, rb.x, lb.x, rt.x); - var maxY = mathMax(lt.y, rb.y, lb.y, rt.y); - target.width = maxX - target.x; - target.height = maxY - target.y; - }; - return BoundingRect; - }()); - - var SILENT = 'silent'; - function makeEventPacket(eveType, targetInfo, event) { - return { - type: eveType, - event: event, - target: targetInfo.target, - 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() { - stop(this.event); - } - var EmptyProxy = (function (_super) { - __extends(EmptyProxy, _super); - function EmptyProxy() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.handler = null; - return _this; - } - EmptyProxy.prototype.dispose = function () { }; - EmptyProxy.prototype.setCursor = function () { }; - return EmptyProxy; - }(Eventful)); - var HoveredResult = (function () { - function HoveredResult(x, y) { - this.x = x; - this.y = y; - } - return HoveredResult; - }()); - var handlerNames = [ - 'click', 'dblclick', 'mousewheel', 'mouseout', - 'mouseup', 'mousedown', 'mousemove', 'contextmenu' - ]; - var tmpRect = new BoundingRect(0, 0, 0, 0); - var Handler = (function (_super) { - __extends(Handler, _super); - function Handler(storage, painter, proxy, painterRoot, pointerSize) { - var _this = _super.call(this) || this; - _this._hovered = new HoveredResult(0, 0); - _this.storage = storage; - _this.painter = painter; - _this.painterRoot = painterRoot; - _this._pointerSize = pointerSize; - proxy = proxy || new EmptyProxy(); - _this.proxy = null; - _this.setHandlerProxy(proxy); - _this._draggingMgr = new Draggable(_this); - return _this; - } - Handler.prototype.setHandlerProxy = function (proxy) { - if (this.proxy) { - this.proxy.dispose(); - } - if (proxy) { - each(handlerNames, function (name) { - proxy.on && proxy.on(name, this[name], this); - }, this); - proxy.handler = this; - } - this.proxy = proxy; - }; - Handler.prototype.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 && !lastHoveredTarget.__zr) { - lastHovered = this.findHover(lastHovered.x, lastHovered.y); - lastHoveredTarget = lastHovered.target; - } - var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y); - var hoveredTarget = hovered.target; - var proxy = this.proxy; - proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default'); - if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) { - this.dispatchToElement(lastHovered, 'mouseout', event); - } - this.dispatchToElement(hovered, 'mousemove', event); - if (hoveredTarget && hoveredTarget !== lastHoveredTarget) { - this.dispatchToElement(hovered, 'mouseover', event); - } - }; - Handler.prototype.mouseout = function (event) { - var eventControl = event.zrEventControl; - if (eventControl !== 'only_globalout') { - this.dispatchToElement(this._hovered, 'mouseout', event); - } - if (eventControl !== 'no_globalout') { - this.trigger('globalout', { type: 'globalout', event: event }); - } - }; - Handler.prototype.resize = function () { - this._hovered = new HoveredResult(0, 0); - }; - Handler.prototype.dispatch = function (eventName, eventArgs) { - var handler = this[eventName]; - handler && handler.call(this, eventArgs); - }; - Handler.prototype.dispose = function () { - this.proxy.dispose(); - this.storage = null; - this.proxy = null; - this.painter = null; - }; - Handler.prototype.setCursorStyle = function (cursorStyle) { - var proxy = this.proxy; - proxy.setCursor && proxy.setCursor(cursorStyle); - }; - Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) { - targetInfo = targetInfo || {}; - var el = targetInfo.target; - if (el && el.silent) { - return; - } - var eventKey = ('on' + eventName); - var eventPacket = makeEventPacket(eventName, targetInfo, event); - while (el) { - el[eventKey] - && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket)); - el.trigger(eventName, eventPacket); - el = el.__hostTarget ? el.__hostTarget : el.parent; - if (eventPacket.cancelBubble) { - break; - } - } - if (!eventPacket.cancelBubble) { - this.trigger(eventName, eventPacket); - if (this.painter && this.painter.eachOtherLayer) { - this.painter.eachOtherLayer(function (layer) { - if (typeof (layer[eventKey]) === 'function') { - layer[eventKey].call(layer, eventPacket); - } - if (layer.trigger) { - layer.trigger(eventName, eventPacket); - } - }); - } - } - }; - Handler.prototype.findHover = function (x, y, exclude) { - var list = this.storage.getDisplayList(); - var out = new HoveredResult(x, y); - setHoverTarget(list, out, x, y, exclude); - if (this._pointerSize && !out.target) { - var candidates = []; - var pointerSize = this._pointerSize; - var targetSizeHalf = pointerSize / 2; - var pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize); - for (var i = list.length - 1; i >= 0; i--) { - var el = list[i]; - if (el !== exclude - && !el.ignore - && !el.ignoreCoarsePointer - && (!el.parent || !el.parent.ignoreCoarsePointer)) { - tmpRect.copy(el.getBoundingRect()); - if (el.transform) { - tmpRect.applyTransform(el.transform); - } - if (tmpRect.intersect(pointerRect)) { - candidates.push(el); - } - } - } - if (candidates.length) { - var rStep = 4; - var thetaStep = Math.PI / 12; - var PI2 = Math.PI * 2; - for (var r = 0; r < targetSizeHalf; r += rStep) { - for (var theta = 0; theta < PI2; theta += thetaStep) { - var x1 = x + r * Math.cos(theta); - var y1 = y + r * Math.sin(theta); - setHoverTarget(candidates, out, x1, y1, exclude); - if (out.target) { - return out; - } - } - } - } - } - return out; - }; - Handler.prototype.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(); - if (gestureInfo) { - var type = gestureInfo.type; - event.gestureEvent = type; - var res = new HoveredResult(); - res.target = gestureInfo.target; - this.dispatchToElement(res, type, gestureInfo.event); - } - }; - return Handler; - }(Eventful)); - 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) { - hovered = this.findHover(x, y); - hoveredTarget = hovered.target; - } - if (name === 'mousedown') { - this._downEl = hoveredTarget; - this._downPoint = [event.zrX, event.zrY]; - this._upEl = hoveredTarget; - } - else if (name === 'mouseup') { - this._upEl = hoveredTarget; - } - else if (name === 'click') { - if (this._downEl !== this._upEl - || !this._downPoint - || 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 = void 0; - var ignoreClip = false; - while (el) { - if (el.ignoreClip) { - ignoreClip = true; - } - if (!ignoreClip) { - var clipPath = el.getClipPath(); - if (clipPath && !clipPath.contain(x, y)) { - return false; - } - } - if (el.silent) { - isSilent = true; - } - var hostEl = el.__hostTarget; - el = hostEl ? hostEl : el.parent; - } - return isSilent ? SILENT : true; - } - return false; - } - function setHoverTarget(list, out, x, y, exclude) { - for (var i = list.length - 1; i >= 0; i--) { - var el = list[i]; - var hoverCheckResult = void 0; - if (el !== exclude - && !el.ignore - && (hoverCheckResult = isHover(el, x, y))) { - !out.topTarget && (out.topTarget = el); - if (hoverCheckResult !== SILENT) { - out.target = el; - break; - } - } - } - } - function isOutsideBoundary(handlerInstance, x, y) { - var painter = handlerInstance.painter; - return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight(); - } - - var DEFAULT_MIN_MERGE = 32; - var DEFAULT_MIN_GALLOPING = 7; - function minRunLength(n) { - var r = 0; - while (n >= DEFAULT_MIN_MERGE) { - r |= n & 1; - n >>= 1; - } - return n + r; - } - function makeAscendingRun(array, lo, hi, compare) { - var runHi = lo + 1; - if (runHi === hi) { - return 1; - } - if (compare(array[runHi++], array[lo]) < 0) { - while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) { - runHi++; - } - reverseRun(array, lo, runHi); - } - else { - while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) { - runHi++; - } - } - return runHi - lo; - } - function reverseRun(array, lo, hi) { - hi--; - while (lo < hi) { - var t = array[lo]; - array[lo++] = array[hi]; - array[hi--] = t; - } - } - function binaryInsertionSort(array, lo, hi, start, compare) { - if (start === lo) { - start++; - } - for (; start < hi; start++) { - var pivot = array[start]; - var left = lo; - var right = start; - var mid; - while (left < right) { - mid = left + right >>> 1; - if (compare(pivot, array[mid]) < 0) { - right = mid; - } - else { - left = mid + 1; - } - } - var n = start - left; - switch (n) { - case 3: - array[left + 3] = array[left + 2]; - case 2: - array[left + 2] = array[left + 1]; - case 1: - array[left + 1] = array[left]; - break; - default: - while (n > 0) { - array[left + n] = array[left + n - 1]; - n--; - } - } - array[left] = pivot; - } - } - function gallopLeft(value, array, start, length, hint, compare) { - var lastOffset = 0; - var maxOffset = 0; - var offset = 1; - if (compare(value, array[start + hint]) > 0) { - maxOffset = length - hint; - while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) { - lastOffset = offset; - offset = (offset << 1) + 1; - if (offset <= 0) { - offset = maxOffset; - } - } - if (offset > maxOffset) { - offset = maxOffset; - } - lastOffset += hint; - offset += hint; - } - else { - maxOffset = hint + 1; - while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) { - lastOffset = offset; - offset = (offset << 1) + 1; - if (offset <= 0) { - offset = maxOffset; - } - } - if (offset > maxOffset) { - offset = maxOffset; - } - var tmp = lastOffset; - lastOffset = hint - offset; - offset = hint - tmp; - } - lastOffset++; - while (lastOffset < offset) { - var m = lastOffset + (offset - lastOffset >>> 1); - if (compare(value, array[start + m]) > 0) { - lastOffset = m + 1; - } - else { - offset = m; - } - } - return offset; - } - function gallopRight(value, array, start, length, hint, compare) { - var lastOffset = 0; - var maxOffset = 0; - var offset = 1; - if (compare(value, array[start + hint]) < 0) { - maxOffset = hint + 1; - while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) { - lastOffset = offset; - offset = (offset << 1) + 1; - if (offset <= 0) { - offset = maxOffset; - } - } - if (offset > maxOffset) { - offset = maxOffset; - } - var tmp = lastOffset; - lastOffset = hint - offset; - offset = hint - tmp; - } - else { - maxOffset = length - hint; - while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) { - lastOffset = offset; - offset = (offset << 1) + 1; - if (offset <= 0) { - offset = maxOffset; - } - } - if (offset > maxOffset) { - offset = maxOffset; - } - lastOffset += hint; - offset += hint; - } - lastOffset++; - while (lastOffset < offset) { - var m = lastOffset + (offset - lastOffset >>> 1); - if (compare(value, array[start + m]) < 0) { - offset = m; - } - else { - lastOffset = m + 1; - } - } - return offset; - } - function TimSort(array, compare) { - var minGallop = DEFAULT_MIN_GALLOPING; - var runStart; - var runLength; - var stackSize = 0; - var tmp = []; - runStart = []; - runLength = []; - function pushRun(_runStart, _runLength) { - runStart[stackSize] = _runStart; - runLength[stackSize] = _runLength; - stackSize += 1; - } - function mergeRuns() { - while (stackSize > 1) { - var n = stackSize - 2; - if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1]) - || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) { - if (runLength[n - 1] < runLength[n + 1]) { - n--; - } - } - else if (runLength[n] > runLength[n + 1]) { - break; - } - mergeAt(n); - } - } - function forceMergeRuns() { - while (stackSize > 1) { - var n = stackSize - 2; - if (n > 0 && runLength[n - 1] < runLength[n + 1]) { - n--; - } - mergeAt(n); - } - } - function mergeAt(i) { - var start1 = runStart[i]; - var length1 = runLength[i]; - var start2 = runStart[i + 1]; - var length2 = runLength[i + 1]; - runLength[i] = length1 + length2; - if (i === stackSize - 3) { - runStart[i + 1] = runStart[i + 2]; - runLength[i + 1] = runLength[i + 2]; - } - stackSize--; - var k = gallopRight(array[start2], array, start1, length1, 0, compare); - start1 += k; - length1 -= k; - if (length1 === 0) { - return; - } - length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare); - if (length2 === 0) { - return; - } - if (length1 <= length2) { - mergeLow(start1, length1, start2, length2); - } - else { - mergeHigh(start1, length1, start2, length2); - } - } - function mergeLow(start1, length1, start2, length2) { - var i = 0; - for (i = 0; i < length1; i++) { - tmp[i] = array[start1 + i]; - } - var cursor1 = 0; - var cursor2 = start2; - var dest = start1; - array[dest++] = array[cursor2++]; - if (--length2 === 0) { - for (i = 0; i < length1; i++) { - array[dest + i] = tmp[cursor1 + i]; - } - return; - } - if (length1 === 1) { - for (i = 0; i < length2; i++) { - array[dest + i] = array[cursor2 + i]; - } - array[dest + length2] = tmp[cursor1]; - return; - } - var _minGallop = minGallop; - var count1; - var count2; - var exit; - while (1) { - count1 = 0; - count2 = 0; - exit = false; - do { - if (compare(array[cursor2], tmp[cursor1]) < 0) { - array[dest++] = array[cursor2++]; - count2++; - count1 = 0; - if (--length2 === 0) { - exit = true; - break; - } - } - else { - array[dest++] = tmp[cursor1++]; - count1++; - count2 = 0; - if (--length1 === 1) { - exit = true; - break; - } - } - } while ((count1 | count2) < _minGallop); - if (exit) { - break; - } - do { - count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare); - if (count1 !== 0) { - for (i = 0; i < count1; i++) { - array[dest + i] = tmp[cursor1 + i]; - } - dest += count1; - cursor1 += count1; - length1 -= count1; - if (length1 <= 1) { - exit = true; - break; - } - } - array[dest++] = array[cursor2++]; - if (--length2 === 0) { - exit = true; - break; - } - count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare); - if (count2 !== 0) { - for (i = 0; i < count2; i++) { - array[dest + i] = array[cursor2 + i]; - } - dest += count2; - cursor2 += count2; - length2 -= count2; - if (length2 === 0) { - exit = true; - break; - } - } - array[dest++] = tmp[cursor1++]; - if (--length1 === 1) { - exit = true; - break; - } - _minGallop--; - } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); - if (exit) { - break; - } - if (_minGallop < 0) { - _minGallop = 0; - } - _minGallop += 2; - } - minGallop = _minGallop; - minGallop < 1 && (minGallop = 1); - if (length1 === 1) { - for (i = 0; i < length2; i++) { - array[dest + i] = array[cursor2 + i]; - } - array[dest + length2] = tmp[cursor1]; - } - else if (length1 === 0) { - throw new Error(); - } - else { - for (i = 0; i < length1; i++) { - array[dest + i] = tmp[cursor1 + i]; - } - } - } - function mergeHigh(start1, length1, start2, length2) { - var i = 0; - for (i = 0; i < length2; i++) { - tmp[i] = array[start2 + i]; - } - var cursor1 = start1 + length1 - 1; - var cursor2 = length2 - 1; - var dest = start2 + length2 - 1; - var customCursor = 0; - var customDest = 0; - array[dest--] = array[cursor1--]; - if (--length1 === 0) { - customCursor = dest - (length2 - 1); - for (i = 0; i < length2; i++) { - array[customCursor + i] = tmp[i]; - } - return; - } - if (length2 === 1) { - dest -= length1; - cursor1 -= length1; - customDest = dest + 1; - customCursor = cursor1 + 1; - for (i = length1 - 1; i >= 0; i--) { - array[customDest + i] = array[customCursor + i]; - } - array[dest] = tmp[cursor2]; - return; - } - var _minGallop = minGallop; - while (true) { - var count1 = 0; - var count2 = 0; - var exit = false; - do { - if (compare(tmp[cursor2], array[cursor1]) < 0) { - array[dest--] = array[cursor1--]; - count1++; - count2 = 0; - if (--length1 === 0) { - exit = true; - break; - } - } - else { - array[dest--] = tmp[cursor2--]; - count2++; - count1 = 0; - if (--length2 === 1) { - exit = true; - break; - } - } - } while ((count1 | count2) < _minGallop); - if (exit) { - break; - } - do { - count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare); - if (count1 !== 0) { - dest -= count1; - cursor1 -= count1; - length1 -= count1; - customDest = dest + 1; - customCursor = cursor1 + 1; - for (i = count1 - 1; i >= 0; i--) { - array[customDest + i] = array[customCursor + i]; - } - if (length1 === 0) { - exit = true; - break; - } - } - array[dest--] = tmp[cursor2--]; - if (--length2 === 1) { - exit = true; - break; - } - count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare); - if (count2 !== 0) { - dest -= count2; - cursor2 -= count2; - length2 -= count2; - customDest = dest + 1; - customCursor = cursor2 + 1; - for (i = 0; i < count2; i++) { - array[customDest + i] = tmp[customCursor + i]; - } - if (length2 <= 1) { - exit = true; - break; - } - } - array[dest--] = array[cursor1--]; - if (--length1 === 0) { - exit = true; - break; - } - _minGallop--; - } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); - if (exit) { - break; - } - if (_minGallop < 0) { - _minGallop = 0; - } - _minGallop += 2; - } - minGallop = _minGallop; - if (minGallop < 1) { - minGallop = 1; - } - if (length2 === 1) { - dest -= length1; - cursor1 -= length1; - customDest = dest + 1; - customCursor = cursor1 + 1; - for (i = length1 - 1; i >= 0; i--) { - array[customDest + i] = array[customCursor + i]; - } - array[dest] = tmp[cursor2]; - } - else if (length2 === 0) { - throw new Error(); - } - else { - customCursor = dest - (length2 - 1); - for (i = 0; i < length2; i++) { - array[customCursor + i] = tmp[i]; - } - } - } - return { - mergeRuns: mergeRuns, - forceMergeRuns: forceMergeRuns, - pushRun: pushRun - }; - } - function sort(array, compare, lo, hi) { - if (!lo) { - lo = 0; - } - if (!hi) { - hi = array.length; - } - var remaining = hi - lo; - if (remaining < 2) { - return; - } - var runLength = 0; - if (remaining < DEFAULT_MIN_MERGE) { - runLength = makeAscendingRun(array, lo, hi, compare); - binaryInsertionSort(array, lo, hi, lo + runLength, compare); - return; - } - var ts = TimSort(array, compare); - var minRun = minRunLength(remaining); - do { - runLength = makeAscendingRun(array, lo, hi, compare); - if (runLength < minRun) { - var force = remaining; - if (force > minRun) { - force = minRun; - } - binaryInsertionSort(array, lo, lo + force, lo + runLength, compare); - runLength = force; - } - ts.pushRun(lo, runLength); - ts.mergeRuns(); - remaining -= runLength; - lo += runLength; - } while (remaining !== 0); - ts.forceMergeRuns(); - } - - var REDRAW_BIT = 1; - var STYLE_CHANGED_BIT = 2; - var SHAPE_CHANGED_BIT = 4; - - var invalidZErrorLogged = false; - function logInvalidZError() { - if (invalidZErrorLogged) { - return; - } - invalidZErrorLogged = true; - console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors'); - } - function shapeCompareFunc(a, b) { - if (a.zlevel === b.zlevel) { - if (a.z === b.z) { - return a.z2 - b.z2; - } - return a.z - b.z; - } - return a.zlevel - b.zlevel; - } - var Storage = (function () { - function Storage() { - this._roots = []; - this._displayList = []; - this._displayListLen = 0; - this.displayableSortFunc = shapeCompareFunc; - } - Storage.prototype.traverse = function (cb, context) { - for (var i = 0; i < this._roots.length; i++) { - this._roots[i].traverse(cb, context); - } - }; - Storage.prototype.getDisplayList = function (update, includeIgnore) { - includeIgnore = includeIgnore || false; - var displayList = this._displayList; - if (update || !displayList.length) { - this.updateDisplayList(includeIgnore); - } - return displayList; - }; - Storage.prototype.updateDisplayList = function (includeIgnore) { - this._displayListLen = 0; - var roots = this._roots; - var displayList = this._displayList; - for (var i = 0, len = roots.length; i < len; i++) { - this._updateAndAddDisplayable(roots[i], null, includeIgnore); - } - displayList.length = this._displayListLen; - sort(displayList, shapeCompareFunc); - }; - Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) { - if (el.ignore && !includeIgnore) { - return; - } - el.beforeUpdate(); - el.update(); - el.afterUpdate(); - var userSetClipPath = el.getClipPath(); - if (el.ignoreClip) { - clipPaths = null; - } - else if (userSetClipPath) { - if (clipPaths) { - clipPaths = clipPaths.slice(); - } - else { - clipPaths = []; - } - var currentClipPath = userSetClipPath; - var parentClipPath = el; - while (currentClipPath) { - currentClipPath.parent = parentClipPath; - currentClipPath.updateTransform(); - clipPaths.push(currentClipPath); - parentClipPath = currentClipPath; - currentClipPath = currentClipPath.getClipPath(); - } - } - if (el.childrenRef) { - var children = el.childrenRef(); - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (el.__dirty) { - child.__dirty |= REDRAW_BIT; - } - this._updateAndAddDisplayable(child, clipPaths, includeIgnore); - } - el.__dirty = 0; - } - else { - var disp = el; - if (clipPaths && clipPaths.length) { - disp.__clipPaths = clipPaths; - } - else if (disp.__clipPaths && disp.__clipPaths.length > 0) { - disp.__clipPaths = []; - } - if (isNaN(disp.z)) { - logInvalidZError(); - disp.z = 0; - } - if (isNaN(disp.z2)) { - logInvalidZError(); - disp.z2 = 0; - } - if (isNaN(disp.zlevel)) { - logInvalidZError(); - disp.zlevel = 0; - } - this._displayList[this._displayListLen++] = disp; - } - var decalEl = el.getDecalElement && el.getDecalElement(); - if (decalEl) { - this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore); - } - var textGuide = el.getTextGuideLine(); - if (textGuide) { - this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore); - } - var textEl = el.getTextContent(); - if (textEl) { - this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore); - } - }; - Storage.prototype.addRoot = function (el) { - if (el.__zr && el.__zr.storage === this) { - return; - } - this._roots.push(el); - }; - Storage.prototype.delRoot = function (el) { - if (el instanceof Array) { - for (var i = 0, l = el.length; i < l; i++) { - this.delRoot(el[i]); - } - return; - } - var idx = indexOf(this._roots, el); - if (idx >= 0) { - this._roots.splice(idx, 1); - } - }; - Storage.prototype.delAllRoots = function () { - this._roots = []; - this._displayList = []; - this._displayListLen = 0; - return; - }; - Storage.prototype.getRoots = function () { - return this._roots; - }; - Storage.prototype.dispose = function () { - this._displayList = null; - this._roots = null; - }; - return Storage; - }()); - - var requestAnimationFrame; - requestAnimationFrame = (env.hasGlobalWindow - && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window)) - || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window)) - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame)) || function (func) { - return setTimeout(func, 16); - }; - var requestAnimationFrame$1 = requestAnimationFrame; - - var easingFuncs = { - linear: function (k) { - return k; - }, - quadraticIn: function (k) { - return k * k; - }, - quadraticOut: function (k) { - return k * (2 - k); - }, - quadraticInOut: function (k) { - if ((k *= 2) < 1) { - return 0.5 * k * k; - } - return -0.5 * (--k * (k - 2) - 1); - }, - cubicIn: function (k) { - return k * k * k; - }, - cubicOut: function (k) { - return --k * k * k + 1; - }, - cubicInOut: function (k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k; - } - return 0.5 * ((k -= 2) * k * k + 2); - }, - quarticIn: function (k) { - return k * k * k * k; - }, - quarticOut: function (k) { - return 1 - (--k * k * k * k); - }, - quarticInOut: function (k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k; - } - return -0.5 * ((k -= 2) * k * k * k - 2); - }, - quinticIn: function (k) { - return k * k * k * k * k; - }, - quinticOut: function (k) { - return --k * k * k * k * k + 1; - }, - quinticInOut: function (k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k * k; - } - return 0.5 * ((k -= 2) * k * k * k * k + 2); - }, - sinusoidalIn: function (k) { - return 1 - Math.cos(k * Math.PI / 2); - }, - sinusoidalOut: function (k) { - return Math.sin(k * Math.PI / 2); - }, - sinusoidalInOut: function (k) { - return 0.5 * (1 - Math.cos(Math.PI * k)); - }, - exponentialIn: function (k) { - return k === 0 ? 0 : Math.pow(1024, k - 1); - }, - exponentialOut: function (k) { - return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); - }, - exponentialInOut: function (k) { - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if ((k *= 2) < 1) { - return 0.5 * Math.pow(1024, k - 1); - } - return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); - }, - circularIn: function (k) { - return 1 - Math.sqrt(1 - k * k); - }, - circularOut: function (k) { - return Math.sqrt(1 - (--k * k)); - }, - circularInOut: function (k) { - if ((k *= 2) < 1) { - return -0.5 * (Math.sqrt(1 - k * k) - 1); - } - return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); - }, - elasticIn: function (k) { - var s; - var a = 0.1; - var p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; - s = p / 4; - } - else { - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return -(a * Math.pow(2, 10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p)); - }, - elasticOut: function (k) { - var s; - var a = 0.1; - var p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; - s = p / 4; - } - else { - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return (a * Math.pow(2, -10 * k) - * Math.sin((k - s) * (2 * Math.PI) / p) + 1); - }, - elasticInOut: function (k) { - var s; - var a = 0.1; - var p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; - s = p / 4; - } - else { - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - if ((k *= 2) < 1) { - return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p)); - } - return a * Math.pow(2, -10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; - }, - backIn: function (k) { - var s = 1.70158; - return k * k * ((s + 1) * k - s); - }, - backOut: function (k) { - var s = 1.70158; - return --k * k * ((s + 1) * k + s) + 1; - }, - backInOut: function (k) { - var s = 1.70158 * 1.525; - if ((k *= 2) < 1) { - return 0.5 * (k * k * ((s + 1) * k - s)); - } - return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); - }, - bounceIn: function (k) { - return 1 - easingFuncs.bounceOut(1 - k); - }, - bounceOut: function (k) { - if (k < (1 / 2.75)) { - return 7.5625 * k * k; - } - else if (k < (2 / 2.75)) { - return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; - } - else if (k < (2.5 / 2.75)) { - return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; - } - else { - return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; - } - }, - bounceInOut: function (k) { - if (k < 0.5) { - return easingFuncs.bounceIn(k * 2) * 0.5; - } - return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5; - } - }; - - var mathPow = Math.pow; - var mathSqrt = Math.sqrt; - var EPSILON = 1e-8; - var EPSILON_NUMERIC = 1e-4; - var THREE_SQRT = mathSqrt(3); - var ONE_THIRD = 1 / 3; - var _v0 = create(); - var _v1 = create(); - var _v2 = create(); - function isAroundZero(val) { - return val > -EPSILON && val < EPSILON; - } - function isNotAroundZero(val) { - return val > EPSILON || val < -EPSILON; - } - function cubicAt(p0, p1, p2, p3, t) { - var onet = 1 - t; - return onet * onet * (onet * p0 + 3 * t * p1) - + t * t * (t * p3 + 3 * onet * p2); - } - function cubicDerivativeAt(p0, p1, p2, p3, t) { - var onet = 1 - t; - return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet - + (p3 - p2) * t * t); - } - function cubicRootAt(p0, p1, p2, p3, val, roots) { - var a = p3 + 3 * (p1 - p2) - p0; - var b = 3 * (p2 - p1 * 2 + p0); - var c = 3 * (p1 - p0); - var d = p0 - val; - var A = b * b - 3 * a * c; - var B = b * c - 9 * a * d; - var C = c * c - 3 * b * d; - var n = 0; - if (isAroundZero(A) && isAroundZero(B)) { - if (isAroundZero(b)) { - roots[0] = 0; - } - else { - var t1 = -c / b; - if (t1 >= 0 && t1 <= 1) { - roots[n++] = t1; - } - } - } - else { - var disc = B * B - 4 * A * C; - if (isAroundZero(disc)) { - var K = B / A; - var t1 = -b / a + K; - var t2 = -K / 2; - if (t1 >= 0 && t1 <= 1) { - roots[n++] = t1; - } - if (t2 >= 0 && t2 <= 1) { - roots[n++] = t2; - } - } - else if (disc > 0) { - var discSqrt = mathSqrt(disc); - var Y1 = A * b + 1.5 * a * (-B + discSqrt); - var Y2 = A * b + 1.5 * a * (-B - discSqrt); - if (Y1 < 0) { - Y1 = -mathPow(-Y1, ONE_THIRD); - } - else { - Y1 = mathPow(Y1, ONE_THIRD); - } - if (Y2 < 0) { - Y2 = -mathPow(-Y2, ONE_THIRD); - } - else { - Y2 = mathPow(Y2, ONE_THIRD); - } - var t1 = (-b - (Y1 + Y2)) / (3 * a); - if (t1 >= 0 && t1 <= 1) { - roots[n++] = t1; - } - } - else { - var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A)); - var theta = Math.acos(T) / 3; - var ASqrt = mathSqrt(A); - var tmp = Math.cos(theta); - var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); - var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); - var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); - if (t1 >= 0 && t1 <= 1) { - roots[n++] = t1; - } - if (t2 >= 0 && t2 <= 1) { - roots[n++] = t2; - } - if (t3 >= 0 && t3 <= 1) { - roots[n++] = t3; - } - } - } - return n; - } - function cubicExtrema(p0, p1, p2, p3, extrema) { - var b = 6 * p2 - 12 * p1 + 6 * p0; - var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; - var c = 3 * p1 - 3 * p0; - var n = 0; - if (isAroundZero(a)) { - if (isNotAroundZero(b)) { - var t1 = -c / b; - if (t1 >= 0 && t1 <= 1) { - extrema[n++] = t1; - } - } - } - else { - var disc = b * b - 4 * a * c; - if (isAroundZero(disc)) { - extrema[0] = -b / (2 * a); - } - else if (disc > 0) { - var discSqrt = mathSqrt(disc); - var t1 = (-b + discSqrt) / (2 * a); - var t2 = (-b - discSqrt) / (2 * a); - if (t1 >= 0 && t1 <= 1) { - extrema[n++] = t1; - } - if (t2 >= 0 && t2 <= 1) { - extrema[n++] = t2; - } - } - } - return n; - } - function cubicSubdivide(p0, p1, p2, p3, t, out) { - var p01 = (p1 - p0) * t + p0; - var p12 = (p2 - p1) * t + p1; - var p23 = (p3 - p2) * t + p2; - var p012 = (p12 - p01) * t + p01; - var p123 = (p23 - p12) * t + p12; - var p0123 = (p123 - p012) * t + p012; - out[0] = p0; - out[1] = p01; - out[2] = p012; - out[3] = p0123; - out[4] = p0123; - out[5] = p123; - out[6] = p23; - out[7] = p3; - } - function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) { - var t; - var interval = 0.005; - var d = Infinity; - var prev; - var next; - var d1; - var d2; - _v0[0] = x; - _v0[1] = y; - for (var _t = 0; _t < 1; _t += 0.05) { - _v1[0] = cubicAt(x0, x1, x2, x3, _t); - _v1[1] = cubicAt(y0, y1, y2, y3, _t); - d1 = distSquare(_v0, _v1); - if (d1 < d) { - t = _t; - d = d1; - } - } - d = Infinity; - for (var i = 0; i < 32; i++) { - if (interval < EPSILON_NUMERIC) { - break; - } - prev = t - interval; - next = t + interval; - _v1[0] = cubicAt(x0, x1, x2, x3, prev); - _v1[1] = cubicAt(y0, y1, y2, y3, prev); - d1 = distSquare(_v1, _v0); - if (prev >= 0 && d1 < d) { - t = prev; - d = d1; - } - else { - _v2[0] = cubicAt(x0, x1, x2, x3, next); - _v2[1] = cubicAt(y0, y1, y2, y3, next); - d2 = distSquare(_v2, _v0); - if (next <= 1 && d2 < d) { - t = next; - d = d2; - } - else { - interval *= 0.5; - } - } - } - if (out) { - out[0] = cubicAt(x0, x1, x2, x3, t); - out[1] = cubicAt(y0, y1, y2, y3, t); - } - return mathSqrt(d); - } - function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) { - var px = x0; - var py = y0; - var d = 0; - var step = 1 / iteration; - for (var i = 1; i <= iteration; i++) { - var t = i * step; - var x = cubicAt(x0, x1, x2, x3, t); - var y = cubicAt(y0, y1, y2, y3, t); - var dx = x - px; - var dy = y - py; - d += Math.sqrt(dx * dx + dy * dy); - px = x; - py = y; - } - return d; - } - function quadraticAt(p0, p1, p2, t) { - var onet = 1 - t; - return onet * (onet * p0 + 2 * t * p1) + t * t * p2; - } - function quadraticDerivativeAt(p0, p1, p2, t) { - return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); - } - function quadraticRootAt(p0, p1, p2, val, roots) { - var a = p0 - 2 * p1 + p2; - var b = 2 * (p1 - p0); - var c = p0 - val; - var n = 0; - if (isAroundZero(a)) { - if (isNotAroundZero(b)) { - var t1 = -c / b; - if (t1 >= 0 && t1 <= 1) { - roots[n++] = t1; - } - } - } - else { - var disc = b * b - 4 * a * c; - if (isAroundZero(disc)) { - var t1 = -b / (2 * a); - if (t1 >= 0 && t1 <= 1) { - roots[n++] = t1; - } - } - else if (disc > 0) { - var discSqrt = mathSqrt(disc); - var t1 = (-b + discSqrt) / (2 * a); - var t2 = (-b - discSqrt) / (2 * a); - if (t1 >= 0 && t1 <= 1) { - roots[n++] = t1; - } - if (t2 >= 0 && t2 <= 1) { - roots[n++] = t2; - } - } - } - return n; - } - function quadraticExtremum(p0, p1, p2) { - var divider = p0 + p2 - 2 * p1; - if (divider === 0) { - return 0.5; - } - else { - return (p0 - p1) / divider; - } - } - function quadraticSubdivide(p0, p1, p2, t, out) { - var p01 = (p1 - p0) * t + p0; - var p12 = (p2 - p1) * t + p1; - var p012 = (p12 - p01) * t + p01; - out[0] = p0; - out[1] = p01; - out[2] = p012; - out[3] = p012; - out[4] = p12; - out[5] = p2; - } - function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) { - var t; - var interval = 0.005; - var d = Infinity; - _v0[0] = x; - _v0[1] = y; - for (var _t = 0; _t < 1; _t += 0.05) { - _v1[0] = quadraticAt(x0, x1, x2, _t); - _v1[1] = quadraticAt(y0, y1, y2, _t); - var d1 = distSquare(_v0, _v1); - if (d1 < d) { - t = _t; - d = d1; - } - } - d = Infinity; - for (var i = 0; i < 32; i++) { - if (interval < EPSILON_NUMERIC) { - break; - } - var prev = t - interval; - var next = t + interval; - _v1[0] = quadraticAt(x0, x1, x2, prev); - _v1[1] = quadraticAt(y0, y1, y2, prev); - var d1 = distSquare(_v1, _v0); - if (prev >= 0 && d1 < d) { - t = prev; - d = d1; - } - else { - _v2[0] = quadraticAt(x0, x1, x2, next); - _v2[1] = quadraticAt(y0, y1, y2, next); - var d2 = distSquare(_v2, _v0); - if (next <= 1 && d2 < d) { - t = next; - d = d2; - } - else { - interval *= 0.5; - } - } - } - if (out) { - out[0] = quadraticAt(x0, x1, x2, t); - out[1] = quadraticAt(y0, y1, y2, t); - } - return mathSqrt(d); - } - function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) { - var px = x0; - var py = y0; - var d = 0; - var step = 1 / iteration; - for (var i = 1; i <= iteration; i++) { - var t = i * step; - var x = quadraticAt(x0, x1, x2, t); - var y = quadraticAt(y0, y1, y2, t); - var dx = x - px; - var dy = y - py; - d += Math.sqrt(dx * dx + dy * dy); - px = x; - py = y; - } - return d; - } - - var regexp = /cubic-bezier\(([0-9,\.e ]+)\)/; - function createCubicEasingFunc(cubicEasingStr) { - var cubic = cubicEasingStr && regexp.exec(cubicEasingStr); - if (cubic) { - var points = cubic[1].split(','); - var a_1 = +trim(points[0]); - var b_1 = +trim(points[1]); - var c_1 = +trim(points[2]); - var d_1 = +trim(points[3]); - if (isNaN(a_1 + b_1 + c_1 + d_1)) { - return; - } - var roots_1 = []; - return function (p) { - return p <= 0 - ? 0 : p >= 1 - ? 1 - : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]); - }; - } - } - - var Clip = (function () { - function Clip(opts) { - this._inited = false; - this._startTime = 0; - this._pausedTime = 0; - this._paused = false; - this._life = opts.life || 1000; - this._delay = opts.delay || 0; - this.loop = opts.loop || false; - this.onframe = opts.onframe || noop; - this.ondestroy = opts.ondestroy || noop; - this.onrestart = opts.onrestart || noop; - opts.easing && this.setEasing(opts.easing); - } - Clip.prototype.step = function (globalTime, deltaTime) { - if (!this._inited) { - this._startTime = globalTime + this._delay; - this._inited = true; - } - if (this._paused) { - this._pausedTime += deltaTime; - return; - } - var life = this._life; - var elapsedTime = globalTime - this._startTime - this._pausedTime; - var percent = elapsedTime / life; - if (percent < 0) { - percent = 0; - } - percent = Math.min(percent, 1); - var easingFunc = this.easingFunc; - var schedule = easingFunc ? easingFunc(percent) : percent; - this.onframe(schedule); - if (percent === 1) { - if (this.loop) { - var remainder = elapsedTime % life; - this._startTime = globalTime - remainder; - this._pausedTime = 0; - this.onrestart(); - } - else { - return true; - } - } - return false; - }; - Clip.prototype.pause = function () { - this._paused = true; - }; - Clip.prototype.resume = function () { - this._paused = false; - }; - Clip.prototype.setEasing = function (easing) { - this.easing = easing; - this.easingFunc = isFunction(easing) - ? easing - : easingFuncs[easing] || createCubicEasingFunc(easing); - }; - return Clip; - }()); - - var Entry = (function () { - function Entry(val) { - this.value = val; - } - return Entry; - }()); - var LinkedList = (function () { - function LinkedList() { - this._len = 0; - } - LinkedList.prototype.insert = function (val) { - var entry = new Entry(val); - this.insertEntry(entry); - return entry; - }; - LinkedList.prototype.insertEntry = function (entry) { - if (!this.head) { - this.head = this.tail = entry; - } - else { - this.tail.next = entry; - entry.prev = this.tail; - entry.next = null; - this.tail = entry; - } - this._len++; - }; - LinkedList.prototype.remove = function (entry) { - var prev = entry.prev; - var next = entry.next; - if (prev) { - prev.next = next; - } - else { - this.head = next; - } - if (next) { - next.prev = prev; - } - else { - this.tail = prev; - } - entry.next = entry.prev = null; - this._len--; - }; - LinkedList.prototype.len = function () { - return this._len; - }; - LinkedList.prototype.clear = function () { - this.head = this.tail = null; - this._len = 0; - }; - return LinkedList; - }()); - var LRU = (function () { - function LRU(maxSize) { - this._list = new LinkedList(); - this._maxSize = 10; - this._map = {}; - this._maxSize = maxSize; - } - LRU.prototype.put = function (key, value) { - var list = this._list; - var map = this._map; - var removed = null; - if (map[key] == null) { - var len = list.len(); - var entry = this._lastRemovedEntry; - if (len >= this._maxSize && len > 0) { - var leastUsedEntry = list.head; - list.remove(leastUsedEntry); - delete map[leastUsedEntry.key]; - removed = leastUsedEntry.value; - this._lastRemovedEntry = leastUsedEntry; - } - if (entry) { - entry.value = value; - } - else { - entry = new Entry(value); - } - entry.key = key; - list.insertEntry(entry); - map[key] = entry; - } - return removed; - }; - LRU.prototype.get = function (key) { - var entry = this._map[key]; - var list = this._list; - if (entry != null) { - if (entry !== list.tail) { - list.remove(entry); - list.insertEntry(entry); - } - return entry.value; - } - }; - LRU.prototype.clear = function () { - this._list.clear(); - this._map = {}; - }; - LRU.prototype.len = function () { - return this._list.len(); - }; - return LRU; - }()); - - var kCSSColorTable = { - 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1], - 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1], - 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1], - 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1], - 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1], - 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1], - 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1], - 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1], - 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1], - 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1], - 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1], - 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1], - 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1], - 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1], - 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1], - 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1], - 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1], - 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1], - 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1], - 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1], - 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1], - 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1], - 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1], - 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1], - 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1], - 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1], - 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1], - 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1], - 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1], - 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1], - 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1], - 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1], - 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1], - 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1], - 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1], - 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1], - 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1], - 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1], - 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1], - 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1], - 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1], - 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1], - 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1], - 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1], - 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1], - 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1], - 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1], - 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1], - 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1], - 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1], - 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1], - 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1], - 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1], - 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1], - 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1], - 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1], - 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1], - 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1], - 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1], - 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1], - 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1], - 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1], - 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1], - 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1], - 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1], - 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1], - 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1], - 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1], - 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1], - 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1], - 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1], - 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1], - 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1], - 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1] - }; - function clampCssByte(i) { - i = Math.round(i); - return i < 0 ? 0 : i > 255 ? 255 : i; - } - function clampCssAngle(i) { - i = Math.round(i); - return i < 0 ? 0 : i > 360 ? 360 : i; - } - function clampCssFloat(f) { - return f < 0 ? 0 : f > 1 ? 1 : f; - } - function parseCssInt(val) { - var str = val; - if (str.length && str.charAt(str.length - 1) === '%') { - return clampCssByte(parseFloat(str) / 100 * 255); - } - return clampCssByte(parseInt(str, 10)); - } - function parseCssFloat(val) { - var str = val; - if (str.length && str.charAt(str.length - 1) === '%') { - return clampCssFloat(parseFloat(str) / 100); - } - return clampCssFloat(parseFloat(str)); - } - function cssHueToRgb(m1, m2, h) { - if (h < 0) { - h += 1; - } - else if (h > 1) { - h -= 1; - } - if (h * 6 < 1) { - return m1 + (m2 - m1) * h * 6; - } - if (h * 2 < 1) { - return m2; - } - if (h * 3 < 2) { - return m1 + (m2 - m1) * (2 / 3 - h) * 6; - } - return m1; - } - function lerpNumber(a, b, p) { - return a + (b - a) * p; - } - function setRgba(out, r, g, b, a) { - out[0] = r; - out[1] = g; - out[2] = b; - out[3] = a; - return out; - } - function copyRgba(out, a) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - return out; - } - var colorCache = new LRU(20); - var lastRemovedArr = null; - function putToCache(colorStr, rgbaArr) { - if (lastRemovedArr) { - copyRgba(lastRemovedArr, rgbaArr); - } - lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice())); - } - function parse(colorStr, rgbaArr) { - if (!colorStr) { - return; - } - rgbaArr = rgbaArr || []; - var cached = colorCache.get(colorStr); - if (cached) { - return copyRgba(rgbaArr, cached); - } - colorStr = colorStr + ''; - var str = colorStr.replace(/ /g, '').toLowerCase(); - if (str in kCSSColorTable) { - copyRgba(rgbaArr, kCSSColorTable[str]); - putToCache(colorStr, rgbaArr); - return rgbaArr; - } - var strLen = str.length; - if (str.charAt(0) === '#') { - if (strLen === 4 || strLen === 5) { - var iv = parseInt(str.slice(1, 4), 16); - if (!(iv >= 0 && iv <= 0xfff)) { - setRgba(rgbaArr, 0, 0, 0, 1); - return; - } - setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1); - putToCache(colorStr, rgbaArr); - return rgbaArr; - } - else if (strLen === 7 || strLen === 9) { - var iv = parseInt(str.slice(1, 7), 16); - if (!(iv >= 0 && iv <= 0xffffff)) { - setRgba(rgbaArr, 0, 0, 0, 1); - return; - } - setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1); - putToCache(colorStr, rgbaArr); - return rgbaArr; - } - return; - } - var op = str.indexOf('('); - var ep = str.indexOf(')'); - if (op !== -1 && ep + 1 === strLen) { - var fname = str.substr(0, op); - var params = str.substr(op + 1, ep - (op + 1)).split(','); - var alpha = 1; - switch (fname) { - case 'rgba': - if (params.length !== 4) { - return params.length === 3 - ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1) - : setRgba(rgbaArr, 0, 0, 0, 1); - } - alpha = parseCssFloat(params.pop()); - case 'rgb': - if (params.length >= 3) { - setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3])); - putToCache(colorStr, rgbaArr); - return rgbaArr; - } - else { - setRgba(rgbaArr, 0, 0, 0, 1); - return; - } - case 'hsla': - if (params.length !== 4) { - setRgba(rgbaArr, 0, 0, 0, 1); - return; - } - params[3] = parseCssFloat(params[3]); - hsla2rgba(params, rgbaArr); - putToCache(colorStr, rgbaArr); - return rgbaArr; - case 'hsl': - if (params.length !== 3) { - setRgba(rgbaArr, 0, 0, 0, 1); - return; - } - hsla2rgba(params, rgbaArr); - putToCache(colorStr, rgbaArr); - return rgbaArr; - default: - return; - } - } - setRgba(rgbaArr, 0, 0, 0, 1); - return; - } - function hsla2rgba(hsla, rgba) { - var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360; - var s = parseCssFloat(hsla[1]); - var l = parseCssFloat(hsla[2]); - var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; - var m1 = l * 2 - m2; - rgba = rgba || []; - setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1); - if (hsla.length === 4) { - rgba[3] = hsla[3]; - } - return rgba; - } - function rgba2hsla(rgba) { - if (!rgba) { - return; - } - var R = rgba[0] / 255; - var G = rgba[1] / 255; - var B = rgba[2] / 255; - var vMin = Math.min(R, G, B); - var vMax = Math.max(R, G, B); - var delta = vMax - vMin; - var L = (vMax + vMin) / 2; - var H; - var S; - if (delta === 0) { - H = 0; - S = 0; - } - else { - if (L < 0.5) { - S = delta / (vMax + vMin); - } - else { - S = delta / (2 - vMax - vMin); - } - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - if (R === vMax) { - H = deltaB - deltaG; - } - else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } - else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } - if (H < 0) { - H += 1; - } - if (H > 1) { - H -= 1; - } - } - var hsla = [H * 360, S, L]; - if (rgba[3] != null) { - hsla.push(rgba[3]); - } - return hsla; - } - function lift(color, level) { - var colorArr = parse(color); - if (colorArr) { - for (var i = 0; i < 3; i++) { - if (level < 0) { - colorArr[i] = colorArr[i] * (1 - level) | 0; - } - else { - colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0; - } - if (colorArr[i] > 255) { - colorArr[i] = 255; - } - else if (colorArr[i] < 0) { - colorArr[i] = 0; - } - } - return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb'); - } - } - function toHex(color) { - var colorArr = parse(color); - if (colorArr) { - return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1); - } - } - function fastLerp(normalizedValue, colors, out) { - if (!(colors && colors.length) - || !(normalizedValue >= 0 && normalizedValue <= 1)) { - return; - } - out = out || []; - var value = normalizedValue * (colors.length - 1); - var leftIndex = Math.floor(value); - var rightIndex = Math.ceil(value); - var leftColor = colors[leftIndex]; - var rightColor = colors[rightIndex]; - var dv = value - leftIndex; - out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)); - out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)); - out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)); - out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)); - return out; - } - var fastMapToColor = fastLerp; - function lerp$1(normalizedValue, colors, fullOutput) { - if (!(colors && colors.length) - || !(normalizedValue >= 0 && normalizedValue <= 1)) { - return; - } - var value = normalizedValue * (colors.length - 1); - var leftIndex = Math.floor(value); - var rightIndex = Math.ceil(value); - var leftColor = parse(colors[leftIndex]); - var rightColor = parse(colors[rightIndex]); - var dv = value - leftIndex; - var color = stringify([ - clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)), - clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)), - clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)), - clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)) - ], 'rgba'); - return fullOutput - ? { - color: color, - leftIndex: leftIndex, - rightIndex: rightIndex, - value: value - } - : color; - } - var mapToColor = lerp$1; - function modifyHSL(color, h, s, l) { - var colorArr = parse(color); - if (color) { - colorArr = rgba2hsla(colorArr); - h != null && (colorArr[0] = clampCssAngle(h)); - s != null && (colorArr[1] = parseCssFloat(s)); - l != null && (colorArr[2] = parseCssFloat(l)); - return stringify(hsla2rgba(colorArr), 'rgba'); - } - } - function modifyAlpha(color, alpha) { - var colorArr = parse(color); - if (colorArr && alpha != null) { - colorArr[3] = clampCssFloat(alpha); - return stringify(colorArr, 'rgba'); - } - } - function stringify(arrColor, type) { - if (!arrColor || !arrColor.length) { - return; - } - var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2]; - if (type === 'rgba' || type === 'hsva' || type === 'hsla') { - colorStr += ',' + arrColor[3]; - } - return type + '(' + colorStr + ')'; - } - function lum(color, backgroundLum) { - var arr = parse(color); - return arr - ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255 - + (1 - arr[3]) * backgroundLum - : 0; - } - function random() { - return stringify([ - Math.round(Math.random() * 255), - Math.round(Math.random() * 255), - Math.round(Math.random() * 255) - ], 'rgb'); - } - var liftedColorCache = new LRU(100); - function liftColor(color) { - if (isString(color)) { - var liftedColor = liftedColorCache.get(color); - if (!liftedColor) { - liftedColor = lift(color, -0.1); - liftedColorCache.put(color, liftedColor); - } - return liftedColor; - } - else if (isGradientObject(color)) { - var ret = extend({}, color); - ret.colorStops = map(color.colorStops, function (stop) { return ({ - offset: stop.offset, - color: lift(stop.color, -0.1) - }); }); - return ret; - } - return color; - } - - var color = /*#__PURE__*/Object.freeze({ - __proto__: null, - parse: parse, - lift: lift, - toHex: toHex, - fastLerp: fastLerp, - fastMapToColor: fastMapToColor, - lerp: lerp$1, - mapToColor: mapToColor, - modifyHSL: modifyHSL, - modifyAlpha: modifyAlpha, - stringify: stringify, - lum: lum, - random: random, - liftColor: liftColor - }); - - var mathRound = Math.round; - function normalizeColor(color) { - var opacity; - if (!color || color === 'transparent') { - color = 'none'; - } - else if (typeof color === 'string' && color.indexOf('rgba') > -1) { - var arr = parse(color); - if (arr) { - color = 'rgb(' + arr[0] + ',' + arr[1] + ',' + arr[2] + ')'; - opacity = arr[3]; - } - } - return { - color: color, - opacity: opacity == null ? 1 : opacity - }; - } - var EPSILON$1 = 1e-4; - function isAroundZero$1(transform) { - return transform < EPSILON$1 && transform > -EPSILON$1; - } - function round3(transform) { - return mathRound(transform * 1e3) / 1e3; - } - function round4(transform) { - return mathRound(transform * 1e4) / 1e4; - } - function getMatrixStr(m) { - return 'matrix(' - + round3(m[0]) + ',' - + round3(m[1]) + ',' - + round3(m[2]) + ',' - + round3(m[3]) + ',' - + round4(m[4]) + ',' - + round4(m[5]) - + ')'; - } - var TEXT_ALIGN_TO_ANCHOR = { - left: 'start', - right: 'end', - center: 'middle', - middle: 'middle' - }; - function adjustTextY(y, lineHeight, textBaseline) { - if (textBaseline === 'top') { - y += lineHeight / 2; - } - else if (textBaseline === 'bottom') { - y -= lineHeight / 2; - } - return y; - } - function hasShadow(style) { - return style - && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY); - } - function getShadowKey(displayable) { - var style = displayable.style; - var globalScale = displayable.getGlobalScale(); - return [ - style.shadowColor, - (style.shadowBlur || 0).toFixed(2), - (style.shadowOffsetX || 0).toFixed(2), - (style.shadowOffsetY || 0).toFixed(2), - globalScale[0], - globalScale[1] - ].join(','); - } - function isImagePattern(val) { - return val && (!!val.image); - } - function isSVGPattern(val) { - return val && (!!val.svgElement); - } - function isPattern(val) { - return isImagePattern(val) || isSVGPattern(val); - } - function isLinearGradient(val) { - return val.type === 'linear'; - } - function isRadialGradient(val) { - return val.type === 'radial'; - } - function isGradient(val) { - return val && (val.type === 'linear' - || val.type === 'radial'); - } - function getIdURL(id) { - return "url(#" + id + ")"; - } - function getPathPrecision(el) { - var scale = el.getGlobalScale(); - var size = Math.max(scale[0], scale[1]); - return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1); - } - function getSRTTransformString(transform) { - var x = transform.x || 0; - var y = transform.y || 0; - var rotation = (transform.rotation || 0) * RADIAN_TO_DEGREE; - var scaleX = retrieve2(transform.scaleX, 1); - var scaleY = retrieve2(transform.scaleY, 1); - var skewX = transform.skewX || 0; - var skewY = transform.skewY || 0; - var res = []; - if (x || y) { - res.push("translate(" + x + "px," + y + "px)"); - } - if (rotation) { - res.push("rotate(" + rotation + ")"); - } - if (scaleX !== 1 || scaleY !== 1) { - res.push("scale(" + scaleX + "," + scaleY + ")"); - } - if (skewX || skewY) { - res.push("skew(" + mathRound(skewX * RADIAN_TO_DEGREE) + "deg, " + mathRound(skewY * RADIAN_TO_DEGREE) + "deg)"); - } - return res.join(' '); - } - var encodeBase64 = (function () { - if (env.hasGlobalWindow && isFunction(window.btoa)) { - return function (str) { - return window.btoa(unescape(encodeURIComponent(str))); - }; - } - if (typeof Buffer !== 'undefined') { - return function (str) { - return Buffer.from(str).toString('base64'); - }; - } - return function (str) { - if ("development" !== 'production') { - logError('Base64 isn\'t natively supported in the current environment.'); - } - return null; - }; - })(); - - var arraySlice = Array.prototype.slice; - function interpolateNumber(p0, p1, percent) { - return (p1 - p0) * percent + p0; - } - function interpolate1DArray(out, p0, p1, percent) { - var len = p0.length; - for (var i = 0; i < len; i++) { - out[i] = interpolateNumber(p0[i], p1[i], percent); - } - return out; - } - function interpolate2DArray(out, p0, p1, percent) { - var len = p0.length; - var len2 = len && p0[0].length; - for (var i = 0; i < len; i++) { - if (!out[i]) { - out[i] = []; - } - for (var j = 0; j < len2; j++) { - out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent); - } - } - return out; - } - function add1DArray(out, p0, p1, sign) { - var len = p0.length; - for (var i = 0; i < len; i++) { - out[i] = p0[i] + p1[i] * sign; - } - return out; - } - function add2DArray(out, p0, p1, sign) { - var len = p0.length; - var len2 = len && p0[0].length; - for (var i = 0; i < len; i++) { - if (!out[i]) { - out[i] = []; - } - for (var j = 0; j < len2; j++) { - out[i][j] = p0[i][j] + p1[i][j] * sign; - } - } - return out; - } - function fillColorStops(val0, val1) { - var len0 = val0.length; - var len1 = val1.length; - var shorterArr = len0 > len1 ? val1 : val0; - var shorterLen = Math.min(len0, len1); - var last = shorterArr[shorterLen - 1] || { color: [0, 0, 0, 0], offset: 0 }; - for (var i = shorterLen; i < Math.max(len0, len1); i++) { - shorterArr.push({ - offset: last.offset, - color: last.color.slice() - }); - } - } - function fillArray(val0, val1, arrDim) { - var arr0 = val0; - var arr1 = val1; - if (!arr0.push || !arr1.push) { - return; - } - var arr0Len = arr0.length; - var arr1Len = arr1.length; - if (arr0Len !== arr1Len) { - var isPreviousLarger = arr0Len > arr1Len; - if (isPreviousLarger) { - arr0.length = arr1Len; - } - else { - for (var i = arr0Len; i < arr1Len; i++) { - arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i])); - } - } - } - var len2 = arr0[0] && arr0[0].length; - for (var i = 0; i < arr0.length; i++) { - if (arrDim === 1) { - if (isNaN(arr0[i])) { - arr0[i] = arr1[i]; - } - } - else { - for (var j = 0; j < len2; j++) { - if (isNaN(arr0[i][j])) { - arr0[i][j] = arr1[i][j]; - } - } - } - } - } - function cloneValue(value) { - if (isArrayLike(value)) { - var len = value.length; - if (isArrayLike(value[0])) { - var ret = []; - for (var i = 0; i < len; i++) { - ret.push(arraySlice.call(value[i])); - } - return ret; - } - return arraySlice.call(value); - } - return value; - } - function rgba2String(rgba) { - rgba[0] = Math.floor(rgba[0]) || 0; - rgba[1] = Math.floor(rgba[1]) || 0; - rgba[2] = Math.floor(rgba[2]) || 0; - rgba[3] = rgba[3] == null ? 1 : rgba[3]; - return 'rgba(' + rgba.join(',') + ')'; - } - function guessArrayDim(value) { - return isArrayLike(value && value[0]) ? 2 : 1; - } - var VALUE_TYPE_NUMBER = 0; - var VALUE_TYPE_1D_ARRAY = 1; - var VALUE_TYPE_2D_ARRAY = 2; - var VALUE_TYPE_COLOR = 3; - var VALUE_TYPE_LINEAR_GRADIENT = 4; - var VALUE_TYPE_RADIAL_GRADIENT = 5; - var VALUE_TYPE_UNKOWN = 6; - function isGradientValueType(valType) { - return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT; - } - function isArrayValueType(valType) { - return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY; - } - var tmpRgba = [0, 0, 0, 0]; - var Track = (function () { - function Track(propName) { - this.keyframes = []; - this.discrete = false; - this._invalid = false; - this._needsSort = false; - this._lastFr = 0; - this._lastFrP = 0; - this.propName = propName; - } - Track.prototype.isFinished = function () { - return this._finished; - }; - Track.prototype.setFinished = function () { - this._finished = true; - if (this._additiveTrack) { - this._additiveTrack.setFinished(); - } - }; - Track.prototype.needsAnimate = function () { - return this.keyframes.length >= 1; - }; - Track.prototype.getAdditiveTrack = function () { - return this._additiveTrack; - }; - Track.prototype.addKeyframe = function (time, rawValue, easing) { - this._needsSort = true; - var keyframes = this.keyframes; - var len = keyframes.length; - var discrete = false; - var valType = VALUE_TYPE_UNKOWN; - var value = rawValue; - if (isArrayLike(rawValue)) { - var arrayDim = guessArrayDim(rawValue); - valType = arrayDim; - if (arrayDim === 1 && !isNumber(rawValue[0]) - || arrayDim === 2 && !isNumber(rawValue[0][0])) { - discrete = true; - } - } - else { - if (isNumber(rawValue) && !eqNaN(rawValue)) { - valType = VALUE_TYPE_NUMBER; - } - else if (isString(rawValue)) { - if (!isNaN(+rawValue)) { - valType = VALUE_TYPE_NUMBER; - } - else { - var colorArray = parse(rawValue); - if (colorArray) { - value = colorArray; - valType = VALUE_TYPE_COLOR; - } - } - } - else if (isGradientObject(rawValue)) { - var parsedGradient = extend({}, value); - parsedGradient.colorStops = map(rawValue.colorStops, function (colorStop) { return ({ - offset: colorStop.offset, - color: parse(colorStop.color) - }); }); - if (isLinearGradient(rawValue)) { - valType = VALUE_TYPE_LINEAR_GRADIENT; - } - else if (isRadialGradient(rawValue)) { - valType = VALUE_TYPE_RADIAL_GRADIENT; - } - value = parsedGradient; - } - } - if (len === 0) { - this.valType = valType; - } - else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) { - discrete = true; - } - this.discrete = this.discrete || discrete; - var kf = { - time: time, - value: value, - rawValue: rawValue, - percent: 0 - }; - if (easing) { - kf.easing = easing; - kf.easingFunc = isFunction(easing) - ? easing - : easingFuncs[easing] || createCubicEasingFunc(easing); - } - keyframes.push(kf); - return kf; - }; - Track.prototype.prepare = function (maxTime, additiveTrack) { - var kfs = this.keyframes; - if (this._needsSort) { - kfs.sort(function (a, b) { - return a.time - b.time; - }); - } - var valType = this.valType; - var kfsLen = kfs.length; - var lastKf = kfs[kfsLen - 1]; - var isDiscrete = this.discrete; - var isArr = isArrayValueType(valType); - var isGradient = isGradientValueType(valType); - for (var i = 0; i < kfsLen; i++) { - var kf = kfs[i]; - var value = kf.value; - var lastValue = lastKf.value; - kf.percent = kf.time / maxTime; - if (!isDiscrete) { - if (isArr && i !== kfsLen - 1) { - fillArray(value, lastValue, valType); - } - else if (isGradient) { - fillColorStops(value.colorStops, lastValue.colorStops); - } - } - } - if (!isDiscrete - && valType !== VALUE_TYPE_RADIAL_GRADIENT - && additiveTrack - && this.needsAnimate() - && additiveTrack.needsAnimate() - && valType === additiveTrack.valType - && !additiveTrack._finished) { - this._additiveTrack = additiveTrack; - var startValue = kfs[0].value; - for (var i = 0; i < kfsLen; i++) { - if (valType === VALUE_TYPE_NUMBER) { - kfs[i].additiveValue = kfs[i].value - startValue; - } - else if (valType === VALUE_TYPE_COLOR) { - kfs[i].additiveValue = - add1DArray([], kfs[i].value, startValue, -1); - } - else if (isArrayValueType(valType)) { - kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY - ? add1DArray([], kfs[i].value, startValue, -1) - : add2DArray([], kfs[i].value, startValue, -1); - } - } - } - }; - Track.prototype.step = function (target, percent) { - if (this._finished) { - return; - } - if (this._additiveTrack && this._additiveTrack._finished) { - this._additiveTrack = null; - } - var isAdditive = this._additiveTrack != null; - var valueKey = isAdditive ? 'additiveValue' : 'value'; - var valType = this.valType; - var keyframes = this.keyframes; - var kfsNum = keyframes.length; - var propName = this.propName; - var isValueColor = valType === VALUE_TYPE_COLOR; - var frameIdx; - var lastFrame = this._lastFr; - var mathMin = Math.min; - var frame; - var nextFrame; - if (kfsNum === 1) { - frame = nextFrame = keyframes[0]; - } - else { - if (percent < 0) { - frameIdx = 0; - } - else if (percent < this._lastFrP) { - var start = mathMin(lastFrame + 1, kfsNum - 1); - for (frameIdx = start; frameIdx >= 0; frameIdx--) { - if (keyframes[frameIdx].percent <= percent) { - break; - } - } - frameIdx = mathMin(frameIdx, kfsNum - 2); - } - else { - for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) { - if (keyframes[frameIdx].percent > percent) { - break; - } - } - frameIdx = mathMin(frameIdx - 1, kfsNum - 2); - } - nextFrame = keyframes[frameIdx + 1]; - frame = keyframes[frameIdx]; - } - if (!(frame && nextFrame)) { - return; - } - this._lastFr = frameIdx; - this._lastFrP = percent; - var interval = (nextFrame.percent - frame.percent); - var w = interval === 0 ? 1 : mathMin((percent - frame.percent) / interval, 1); - if (nextFrame.easingFunc) { - w = nextFrame.easingFunc(w); - } - var targetArr = isAdditive ? this._additiveValue - : (isValueColor ? tmpRgba : target[propName]); - if ((isArrayValueType(valType) || isValueColor) && !targetArr) { - targetArr = this._additiveValue = []; - } - if (this.discrete) { - target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue; - } - else if (isArrayValueType(valType)) { - valType === VALUE_TYPE_1D_ARRAY - ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w) - : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w); - } - else if (isGradientValueType(valType)) { - var val = frame[valueKey]; - var nextVal_1 = nextFrame[valueKey]; - var isLinearGradient_1 = valType === VALUE_TYPE_LINEAR_GRADIENT; - target[propName] = { - type: isLinearGradient_1 ? 'linear' : 'radial', - x: interpolateNumber(val.x, nextVal_1.x, w), - y: interpolateNumber(val.y, nextVal_1.y, w), - colorStops: map(val.colorStops, function (colorStop, idx) { - var nextColorStop = nextVal_1.colorStops[idx]; - return { - offset: interpolateNumber(colorStop.offset, nextColorStop.offset, w), - color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w)) - }; - }), - global: nextVal_1.global - }; - if (isLinearGradient_1) { - target[propName].x2 = interpolateNumber(val.x2, nextVal_1.x2, w); - target[propName].y2 = interpolateNumber(val.y2, nextVal_1.y2, w); - } - else { - target[propName].r = interpolateNumber(val.r, nextVal_1.r, w); - } - } - else if (isValueColor) { - interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w); - if (!isAdditive) { - target[propName] = rgba2String(targetArr); - } - } - else { - var value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w); - if (isAdditive) { - this._additiveValue = value; - } - else { - target[propName] = value; - } - } - if (isAdditive) { - this._addToTarget(target); - } - }; - Track.prototype._addToTarget = function (target) { - var valType = this.valType; - var propName = this.propName; - var additiveValue = this._additiveValue; - if (valType === VALUE_TYPE_NUMBER) { - target[propName] = target[propName] + additiveValue; - } - else if (valType === VALUE_TYPE_COLOR) { - parse(target[propName], tmpRgba); - add1DArray(tmpRgba, tmpRgba, additiveValue, 1); - target[propName] = rgba2String(tmpRgba); - } - else if (valType === VALUE_TYPE_1D_ARRAY) { - add1DArray(target[propName], target[propName], additiveValue, 1); - } - else if (valType === VALUE_TYPE_2D_ARRAY) { - add2DArray(target[propName], target[propName], additiveValue, 1); - } - }; - return Track; - }()); - var Animator = (function () { - function Animator(target, loop, allowDiscreteAnimation, additiveTo) { - this._tracks = {}; - this._trackKeys = []; - this._maxTime = 0; - this._started = 0; - this._clip = null; - this._target = target; - this._loop = loop; - if (loop && additiveTo) { - logError('Can\' use additive animation on looped animation.'); - return; - } - this._additiveAnimators = additiveTo; - this._allowDiscrete = allowDiscreteAnimation; - } - Animator.prototype.getMaxTime = function () { - return this._maxTime; - }; - Animator.prototype.getDelay = function () { - return this._delay; - }; - Animator.prototype.getLoop = function () { - return this._loop; - }; - Animator.prototype.getTarget = function () { - return this._target; - }; - Animator.prototype.changeTarget = function (target) { - this._target = target; - }; - Animator.prototype.when = function (time, props, easing) { - return this.whenWithKeys(time, props, keys(props), easing); - }; - Animator.prototype.whenWithKeys = function (time, props, propNames, easing) { - var tracks = this._tracks; - for (var i = 0; i < propNames.length; i++) { - var propName = propNames[i]; - var track = tracks[propName]; - if (!track) { - track = tracks[propName] = new Track(propName); - var initialValue = void 0; - var additiveTrack = this._getAdditiveTrack(propName); - if (additiveTrack) { - var addtiveTrackKfs = additiveTrack.keyframes; - var lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1]; - initialValue = lastFinalKf && lastFinalKf.value; - if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) { - initialValue = rgba2String(initialValue); - } - } - else { - initialValue = this._target[propName]; - } - if (initialValue == null) { - continue; - } - if (time > 0) { - track.addKeyframe(0, cloneValue(initialValue), easing); - } - this._trackKeys.push(propName); - } - track.addKeyframe(time, cloneValue(props[propName]), easing); - } - this._maxTime = Math.max(this._maxTime, time); - return this; - }; - Animator.prototype.pause = function () { - this._clip.pause(); - this._paused = true; - }; - Animator.prototype.resume = function () { - this._clip.resume(); - this._paused = false; - }; - Animator.prototype.isPaused = function () { - return !!this._paused; - }; - Animator.prototype.duration = function (duration) { - this._maxTime = duration; - this._force = true; - return this; - }; - Animator.prototype._doneCallback = function () { - this._setTracksFinished(); - this._clip = null; - var doneList = this._doneCbs; - if (doneList) { - var len = doneList.length; - for (var i = 0; i < len; i++) { - doneList[i].call(this); - } - } - }; - Animator.prototype._abortedCallback = function () { - this._setTracksFinished(); - var animation = this.animation; - var abortedList = this._abortedCbs; - if (animation) { - animation.removeClip(this._clip); - } - this._clip = null; - if (abortedList) { - for (var i = 0; i < abortedList.length; i++) { - abortedList[i].call(this); - } - } - }; - Animator.prototype._setTracksFinished = function () { - var tracks = this._tracks; - var tracksKeys = this._trackKeys; - for (var i = 0; i < tracksKeys.length; i++) { - tracks[tracksKeys[i]].setFinished(); - } - }; - Animator.prototype._getAdditiveTrack = function (trackName) { - var additiveTrack; - var additiveAnimators = this._additiveAnimators; - if (additiveAnimators) { - for (var i = 0; i < additiveAnimators.length; i++) { - var track = additiveAnimators[i].getTrack(trackName); - if (track) { - additiveTrack = track; - } - } - } - return additiveTrack; - }; - Animator.prototype.start = function (easing) { - if (this._started > 0) { - return; - } - this._started = 1; - var self = this; - var tracks = []; - var maxTime = this._maxTime || 0; - for (var i = 0; i < this._trackKeys.length; i++) { - var propName = this._trackKeys[i]; - var track = this._tracks[propName]; - var additiveTrack = this._getAdditiveTrack(propName); - var kfs = track.keyframes; - var kfsNum = kfs.length; - track.prepare(maxTime, additiveTrack); - if (track.needsAnimate()) { - if (!this._allowDiscrete && track.discrete) { - var lastKf = kfs[kfsNum - 1]; - if (lastKf) { - self._target[track.propName] = lastKf.rawValue; - } - track.setFinished(); - } - else { - tracks.push(track); - } - } - } - if (tracks.length || this._force) { - var clip = new Clip({ - life: maxTime, - loop: this._loop, - delay: this._delay || 0, - onframe: function (percent) { - self._started = 2; - var additiveAnimators = self._additiveAnimators; - if (additiveAnimators) { - var stillHasAdditiveAnimator = false; - for (var i = 0; i < additiveAnimators.length; i++) { - if (additiveAnimators[i]._clip) { - stillHasAdditiveAnimator = true; - break; - } - } - if (!stillHasAdditiveAnimator) { - self._additiveAnimators = null; - } - } - for (var i = 0; i < tracks.length; i++) { - tracks[i].step(self._target, percent); - } - var onframeList = self._onframeCbs; - if (onframeList) { - for (var i = 0; i < onframeList.length; i++) { - onframeList[i](self._target, percent); - } - } - }, - ondestroy: function () { - self._doneCallback(); - } - }); - this._clip = clip; - if (this.animation) { - this.animation.addClip(clip); - } - if (easing) { - clip.setEasing(easing); - } - } - else { - this._doneCallback(); - } - return this; - }; - Animator.prototype.stop = function (forwardToLast) { - if (!this._clip) { - return; - } - var clip = this._clip; - if (forwardToLast) { - clip.onframe(1); - } - this._abortedCallback(); - }; - Animator.prototype.delay = function (time) { - this._delay = time; - return this; - }; - Animator.prototype.during = function (cb) { - if (cb) { - if (!this._onframeCbs) { - this._onframeCbs = []; - } - this._onframeCbs.push(cb); - } - return this; - }; - Animator.prototype.done = function (cb) { - if (cb) { - if (!this._doneCbs) { - this._doneCbs = []; - } - this._doneCbs.push(cb); - } - return this; - }; - Animator.prototype.aborted = function (cb) { - if (cb) { - if (!this._abortedCbs) { - this._abortedCbs = []; - } - this._abortedCbs.push(cb); - } - return this; - }; - Animator.prototype.getClip = function () { - return this._clip; - }; - Animator.prototype.getTrack = function (propName) { - return this._tracks[propName]; - }; - Animator.prototype.getTracks = function () { - var _this = this; - return map(this._trackKeys, function (key) { return _this._tracks[key]; }); - }; - Animator.prototype.stopTracks = function (propNames, forwardToLast) { - if (!propNames.length || !this._clip) { - return true; - } - var tracks = this._tracks; - var tracksKeys = this._trackKeys; - for (var i = 0; i < propNames.length; i++) { - var track = tracks[propNames[i]]; - if (track && !track.isFinished()) { - if (forwardToLast) { - track.step(this._target, 1); - } - else if (this._started === 1) { - track.step(this._target, 0); - } - track.setFinished(); - } - } - var allAborted = true; - for (var i = 0; i < tracksKeys.length; i++) { - if (!tracks[tracksKeys[i]].isFinished()) { - allAborted = false; - break; - } - } - if (allAborted) { - this._abortedCallback(); - } - return allAborted; - }; - Animator.prototype.saveTo = function (target, trackKeys, firstOrLast) { - if (!target) { - return; - } - trackKeys = trackKeys || this._trackKeys; - for (var i = 0; i < trackKeys.length; i++) { - var propName = trackKeys[i]; - var track = this._tracks[propName]; - if (!track || track.isFinished()) { - continue; - } - var kfs = track.keyframes; - var kf = kfs[firstOrLast ? 0 : kfs.length - 1]; - if (kf) { - target[propName] = cloneValue(kf.rawValue); - } - } - }; - Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) { - trackKeys = trackKeys || keys(finalProps); - for (var i = 0; i < trackKeys.length; i++) { - var propName = trackKeys[i]; - var track = this._tracks[propName]; - if (!track) { - continue; - } - var kfs = track.keyframes; - if (kfs.length > 1) { - var lastKf = kfs.pop(); - track.addKeyframe(lastKf.time, finalProps[propName]); - track.prepare(this._maxTime, track.getAdditiveTrack()); - } - } - }; - return Animator; - }()); - - function getTime() { - return new Date().getTime(); - } - var Animation = (function (_super) { - __extends(Animation, _super); - function Animation(opts) { - var _this = _super.call(this) || this; - _this._running = false; - _this._time = 0; - _this._pausedTime = 0; - _this._pauseStart = 0; - _this._paused = false; - opts = opts || {}; - _this.stage = opts.stage || {}; - return _this; - } - Animation.prototype.addClip = function (clip) { - if (clip.animation) { - this.removeClip(clip); - } - if (!this._head) { - this._head = this._tail = clip; - } - else { - this._tail.next = clip; - clip.prev = this._tail; - clip.next = null; - this._tail = clip; - } - clip.animation = this; - }; - Animation.prototype.addAnimator = function (animator) { - animator.animation = this; - var clip = animator.getClip(); - if (clip) { - this.addClip(clip); - } - }; - Animation.prototype.removeClip = function (clip) { - if (!clip.animation) { - return; - } - var prev = clip.prev; - var next = clip.next; - if (prev) { - prev.next = next; - } - else { - this._head = next; - } - if (next) { - next.prev = prev; - } - else { - this._tail = prev; - } - clip.next = clip.prev = clip.animation = null; - }; - Animation.prototype.removeAnimator = function (animator) { - var clip = animator.getClip(); - if (clip) { - this.removeClip(clip); - } - animator.animation = null; - }; - Animation.prototype.update = function (notTriggerFrameAndStageUpdate) { - var time = getTime() - this._pausedTime; - var delta = time - this._time; - var clip = this._head; - while (clip) { - var nextClip = clip.next; - var finished = clip.step(time, delta); - if (finished) { - clip.ondestroy(); - this.removeClip(clip); - clip = nextClip; - } - else { - clip = nextClip; - } - } - this._time = time; - if (!notTriggerFrameAndStageUpdate) { - this.trigger('frame', delta); - this.stage.update && this.stage.update(); - } - }; - Animation.prototype._startLoop = function () { - var self = this; - this._running = true; - function step() { - if (self._running) { - requestAnimationFrame$1(step); - !self._paused && self.update(); - } - } - requestAnimationFrame$1(step); - }; - Animation.prototype.start = function () { - if (this._running) { - return; - } - this._time = getTime(); - this._pausedTime = 0; - this._startLoop(); - }; - Animation.prototype.stop = function () { - this._running = false; - }; - Animation.prototype.pause = function () { - if (!this._paused) { - this._pauseStart = getTime(); - this._paused = true; - } - }; - Animation.prototype.resume = function () { - if (this._paused) { - this._pausedTime += getTime() - this._pauseStart; - this._paused = false; - } - }; - Animation.prototype.clear = function () { - var clip = this._head; - while (clip) { - var nextClip = clip.next; - clip.prev = clip.next = clip.animation = null; - clip = nextClip; - } - this._head = this._tail = null; - }; - Animation.prototype.isFinished = function () { - return this._head == null; - }; - Animation.prototype.animate = function (target, options) { - options = options || {}; - this.start(); - var animator = new Animator(target, options.loop); - this.addAnimator(animator); - return animator; - }; - return Animation; - }(Eventful)); - - var TOUCH_CLICK_DELAY = 300; - var globalEventSupported = env.domSupported; - var localNativeListenerNames = (function () { - var mouseHandlerNames = [ - 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout', - 'mouseup', 'mousedown', 'mousemove', 'contextmenu' - ]; - var touchHandlerNames = [ - 'touchstart', 'touchend', 'touchmove' - ]; - var pointerEventNameMap = { - pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1 - }; - var pointerHandlerNames = map(mouseHandlerNames, function (name) { - var nm = name.replace('mouse', 'pointer'); - return pointerEventNameMap.hasOwnProperty(nm) ? nm : name; - }); - return { - mouse: mouseHandlerNames, - touch: touchHandlerNames, - pointer: pointerHandlerNames - }; - })(); - var globalNativeListenerNames = { - mouse: ['mousemove', 'mouseup'], - pointer: ['pointermove', 'pointerup'] - }; - var wheelEventSupported = false; - function isPointerFromTouch(event) { - var pointerType = event.pointerType; - return pointerType === 'pen' || pointerType === 'touch'; - } - function setTouchTimer(scope) { - scope.touching = true; - if (scope.touchTimer != null) { - clearTimeout(scope.touchTimer); - scope.touchTimer = null; - } - scope.touchTimer = setTimeout(function () { - scope.touching = false; - scope.touchTimer = null; - }, 700); - } - function markTouch(event) { - event && (event.zrByTouch = true); - } - function normalizeGlobalEvent(instance, event) { - return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true); - } - function isLocalEl(instance, el) { - var elTmp = el; - var isLocal = false; - while (elTmp && elTmp.nodeType !== 9 - && !(isLocal = elTmp.domBelongToZr - || (elTmp !== el && elTmp === instance.painterRoot))) { - elTmp = elTmp.parentNode; - } - return isLocal; - } - var FakeGlobalEvent = (function () { - function FakeGlobalEvent(instance, event) { - this.stopPropagation = noop; - this.stopImmediatePropagation = noop; - this.preventDefault = noop; - this.type = event.type; - this.target = this.currentTarget = instance.dom; - this.pointerType = event.pointerType; - this.clientX = event.clientX; - this.clientY = event.clientY; - } - return FakeGlobalEvent; - }()); - var localDOMHandlers = { - mousedown: function (event) { - event = normalizeEvent(this.dom, event); - this.__mayPointerCapture = [event.zrX, event.zrY]; - this.trigger('mousedown', event); - }, - mousemove: function (event) { - event = normalizeEvent(this.dom, event); - var downPoint = this.__mayPointerCapture; - if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) { - this.__togglePointerCapture(true); - } - this.trigger('mousemove', event); - }, - mouseup: function (event) { - event = normalizeEvent(this.dom, event); - this.__togglePointerCapture(false); - this.trigger('mouseup', event); - }, - mouseout: function (event) { - event = normalizeEvent(this.dom, event); - var element = event.toElement || event.relatedTarget; - if (!isLocalEl(this, element)) { - if (this.__pointerCapturing) { - event.zrEventControl = 'no_globalout'; - } - this.trigger('mouseout', event); - } - }, - wheel: function (event) { - wheelEventSupported = true; - event = normalizeEvent(this.dom, event); - this.trigger('mousewheel', event); - }, - mousewheel: function (event) { - if (wheelEventSupported) { - return; - } - event = normalizeEvent(this.dom, event); - this.trigger('mousewheel', event); - }, - touchstart: function (event) { - event = normalizeEvent(this.dom, event); - markTouch(event); - this.__lastTouchMoment = new Date(); - this.handler.processGesture(event, 'start'); - localDOMHandlers.mousemove.call(this, event); - localDOMHandlers.mousedown.call(this, event); - }, - touchmove: function (event) { - event = normalizeEvent(this.dom, event); - markTouch(event); - this.handler.processGesture(event, 'change'); - localDOMHandlers.mousemove.call(this, event); - }, - touchend: function (event) { - event = normalizeEvent(this.dom, event); - markTouch(event); - this.handler.processGesture(event, 'end'); - localDOMHandlers.mouseup.call(this, event); - if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) { - localDOMHandlers.click.call(this, event); - } - }, - pointerdown: function (event) { - localDOMHandlers.mousedown.call(this, event); - }, - pointermove: function (event) { - if (!isPointerFromTouch(event)) { - localDOMHandlers.mousemove.call(this, event); - } - }, - pointerup: function (event) { - localDOMHandlers.mouseup.call(this, event); - }, - pointerout: function (event) { - if (!isPointerFromTouch(event)) { - localDOMHandlers.mouseout.call(this, event); - } - } - }; - each(['click', 'dblclick', 'contextmenu'], function (name) { - localDOMHandlers[name] = function (event) { - event = normalizeEvent(this.dom, event); - this.trigger(name, event); - }; - }); - var globalDOMHandlers = { - pointermove: function (event) { - if (!isPointerFromTouch(event)) { - globalDOMHandlers.mousemove.call(this, event); - } - }, - pointerup: function (event) { - globalDOMHandlers.mouseup.call(this, event); - }, - mousemove: function (event) { - this.trigger('mousemove', event); - }, - mouseup: function (event) { - var pointerCaptureReleasing = this.__pointerCapturing; - this.__togglePointerCapture(false); - this.trigger('mouseup', event); - if (pointerCaptureReleasing) { - event.zrEventControl = 'only_globalout'; - this.trigger('mouseout', event); - } - } - }; - function mountLocalDOMEventListeners(instance, scope) { - var domHandlers = scope.domHandlers; - if (env.pointerEventsSupported) { - each(localNativeListenerNames.pointer, function (nativeEventName) { - mountSingleDOMEventListener(scope, nativeEventName, function (event) { - domHandlers[nativeEventName].call(instance, event); - }); - }); - } - else { - if (env.touchEventsSupported) { - each(localNativeListenerNames.touch, function (nativeEventName) { - mountSingleDOMEventListener(scope, nativeEventName, function (event) { - domHandlers[nativeEventName].call(instance, event); - setTouchTimer(scope); - }); - }); - } - each(localNativeListenerNames.mouse, function (nativeEventName) { - mountSingleDOMEventListener(scope, nativeEventName, function (event) { - event = getNativeEvent(event); - if (!scope.touching) { - domHandlers[nativeEventName].call(instance, event); - } - }); - }); - } - } - function mountGlobalDOMEventListeners(instance, scope) { - if (env.pointerEventsSupported) { - each(globalNativeListenerNames.pointer, mount); - } - else if (!env.touchEventsSupported) { - each(globalNativeListenerNames.mouse, mount); - } - function mount(nativeEventName) { - function nativeEventListener(event) { - event = getNativeEvent(event); - if (!isLocalEl(instance, event.target)) { - event = normalizeGlobalEvent(instance, event); - scope.domHandlers[nativeEventName].call(instance, event); - } - } - mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true }); - } - } - function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) { - scope.mounted[nativeEventName] = listener; - scope.listenerOpts[nativeEventName] = opt; - addEventListener(scope.domTarget, nativeEventName, listener, opt); - } - function unmountDOMEventListeners(scope) { - var mounted = scope.mounted; - for (var nativeEventName in mounted) { - if (mounted.hasOwnProperty(nativeEventName)) { - removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]); - } - } - scope.mounted = {}; - } - var DOMHandlerScope = (function () { - function DOMHandlerScope(domTarget, domHandlers) { - this.mounted = {}; - this.listenerOpts = {}; - this.touching = false; - this.domTarget = domTarget; - this.domHandlers = domHandlers; - } - return DOMHandlerScope; - }()); - var HandlerDomProxy = (function (_super) { - __extends(HandlerDomProxy, _super); - function HandlerDomProxy(dom, painterRoot) { - var _this = _super.call(this) || this; - _this.__pointerCapturing = false; - _this.dom = dom; - _this.painterRoot = painterRoot; - _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers); - if (globalEventSupported) { - _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers); - } - mountLocalDOMEventListeners(_this, _this._localHandlerScope); - return _this; - } - HandlerDomProxy.prototype.dispose = function () { - unmountDOMEventListeners(this._localHandlerScope); - if (globalEventSupported) { - unmountDOMEventListeners(this._globalHandlerScope); - } - }; - HandlerDomProxy.prototype.setCursor = function (cursorStyle) { - this.dom.style && (this.dom.style.cursor = cursorStyle || 'default'); - }; - HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) { - this.__mayPointerCapture = null; - if (globalEventSupported - && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) { - this.__pointerCapturing = isPointerCapturing; - var globalHandlerScope = this._globalHandlerScope; - isPointerCapturing - ? mountGlobalDOMEventListeners(this, globalHandlerScope) - : unmountDOMEventListeners(globalHandlerScope); - } - }; - return HandlerDomProxy; - }(Eventful)); - - var dpr = 1; - if (env.hasGlobalWindow) { - dpr = Math.max(window.devicePixelRatio - || (window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI) - || 1, 1); - } - var devicePixelRatio = dpr; - var DARK_MODE_THRESHOLD = 0.4; - var DARK_LABEL_COLOR = '#333'; - var LIGHT_LABEL_COLOR = '#ccc'; - var LIGHTER_LABEL_COLOR = '#eee'; - - var mIdentity = identity; - var EPSILON$2 = 5e-5; - function isNotAroundZero$1(val) { - return val > EPSILON$2 || val < -EPSILON$2; - } - var scaleTmp = []; - var tmpTransform = []; - var originTransform = create$1(); - var abs = Math.abs; - var Transformable = (function () { - function Transformable() { - } - Transformable.prototype.getLocalTransform = function (m) { - return Transformable.getLocalTransform(this, m); - }; - Transformable.prototype.setPosition = function (arr) { - this.x = arr[0]; - this.y = arr[1]; - }; - Transformable.prototype.setScale = function (arr) { - this.scaleX = arr[0]; - this.scaleY = arr[1]; - }; - Transformable.prototype.setSkew = function (arr) { - this.skewX = arr[0]; - this.skewY = arr[1]; - }; - Transformable.prototype.setOrigin = function (arr) { - this.originX = arr[0]; - this.originY = arr[1]; - }; - Transformable.prototype.needLocalTransform = function () { - return isNotAroundZero$1(this.rotation) - || isNotAroundZero$1(this.x) - || isNotAroundZero$1(this.y) - || isNotAroundZero$1(this.scaleX - 1) - || isNotAroundZero$1(this.scaleY - 1) - || isNotAroundZero$1(this.skewX) - || isNotAroundZero$1(this.skewY); - }; - Transformable.prototype.updateTransform = function () { - var parentTransform = this.parent && this.parent.transform; - var needLocalTransform = this.needLocalTransform(); - var m = this.transform; - if (!(needLocalTransform || parentTransform)) { - if (m) { - mIdentity(m); - this.invTransform = null; - } - return; - } - m = m || create$1(); - if (needLocalTransform) { - this.getLocalTransform(m); - } - else { - mIdentity(m); - } - if (parentTransform) { - if (needLocalTransform) { - mul$1(m, parentTransform, m); - } - else { - copy$1(m, parentTransform); - } - } - this.transform = m; - this._resolveGlobalScaleRatio(m); - }; - Transformable.prototype._resolveGlobalScaleRatio = function (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 || create$1(); - invert(this.invTransform, m); - }; - Transformable.prototype.getComputedTransform = function () { - var transformNode = this; - var ancestors = []; - while (transformNode) { - ancestors.push(transformNode); - transformNode = transformNode.parent; - } - while (transformNode = ancestors.pop()) { - transformNode.updateTransform(); - } - return this.transform; - }; - Transformable.prototype.setLocalTransform = function (m) { - if (!m) { - return; - } - var sx = m[0] * m[0] + m[1] * m[1]; - var sy = m[2] * m[2] + m[3] * m[3]; - var rotation = Math.atan2(m[1], m[0]); - var shearX = Math.PI / 2 + rotation - Math.atan2(m[3], m[2]); - sy = Math.sqrt(sy) * Math.cos(shearX); - sx = Math.sqrt(sx); - this.skewX = shearX; - this.skewY = 0; - this.rotation = -rotation; - this.x = +m[4]; - this.y = +m[5]; - this.scaleX = sx; - this.scaleY = sy; - this.originX = 0; - this.originY = 0; - }; - Transformable.prototype.decomposeTransform = function () { - if (!this.transform) { - return; - } - var parent = this.parent; - var m = this.transform; - if (parent && parent.transform) { - parent.invTransform = parent.invTransform || create$1(); - mul$1(tmpTransform, parent.invTransform, m); - m = tmpTransform; - } - var ox = this.originX; - var oy = this.originY; - if (ox || oy) { - originTransform[4] = ox; - originTransform[5] = oy; - mul$1(tmpTransform, m, originTransform); - tmpTransform[4] -= ox; - tmpTransform[5] -= oy; - m = tmpTransform; - } - this.setLocalTransform(m); - }; - Transformable.prototype.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; - }; - Transformable.prototype.transformCoordToLocal = function (x, y) { - var v2 = [x, y]; - var invTransform = this.invTransform; - if (invTransform) { - applyTransform(v2, v2, invTransform); - } - return v2; - }; - Transformable.prototype.transformCoordToGlobal = function (x, y) { - var v2 = [x, y]; - var transform = this.transform; - if (transform) { - applyTransform(v2, v2, transform); - } - return v2; - }; - Transformable.prototype.getLineScale = function () { - var m = this.transform; - return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10 - ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1])) - : 1; - }; - Transformable.prototype.copyTransform = function (source) { - copyTransform(this, source); - }; - Transformable.getLocalTransform = function (target, m) { - m = m || []; - var ox = target.originX || 0; - var oy = target.originY || 0; - var sx = target.scaleX; - var sy = target.scaleY; - var ax = target.anchorX; - var ay = target.anchorY; - var rotation = target.rotation || 0; - var x = target.x; - var y = target.y; - var skewX = target.skewX ? Math.tan(target.skewX) : 0; - var skewY = target.skewY ? Math.tan(-target.skewY) : 0; - if (ox || oy || ax || ay) { - var dx = ox + ax; - var dy = oy + ay; - m[4] = -dx * sx - skewX * dy * sy; - m[5] = -dy * sy - skewY * dx * sx; - } - else { - m[4] = m[5] = 0; - } - m[0] = sx; - m[3] = sy; - m[1] = skewY * sx; - m[2] = skewX * sy; - rotation && rotate(m, m, rotation); - m[4] += ox + x; - m[5] += oy + y; - return m; - }; - Transformable.initDefaultProps = (function () { - var proto = Transformable.prototype; - proto.scaleX = - proto.scaleY = - proto.globalScaleRatio = 1; - proto.x = - proto.y = - proto.originX = - proto.originY = - proto.skewX = - proto.skewY = - proto.rotation = - proto.anchorX = - proto.anchorY = 0; - })(); - return Transformable; - }()); - var TRANSFORMABLE_PROPS = [ - 'x', 'y', 'originX', 'originY', 'anchorX', 'anchorY', 'rotation', 'scaleX', 'scaleY', 'skewX', 'skewY' - ]; - function copyTransform(target, source) { - for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) { - var propName = TRANSFORMABLE_PROPS[i]; - target[propName] = source[propName]; - } - } - - var textWidthCache = {}; - function getWidth(text, font) { - font = font || DEFAULT_FONT; - var cacheOfFont = textWidthCache[font]; - if (!cacheOfFont) { - cacheOfFont = textWidthCache[font] = new LRU(500); - } - var width = cacheOfFont.get(text); - if (width == null) { - width = platformApi.measureText(text, font).width; - cacheOfFont.put(text, width); - } - return width; - } - function innerGetBoundingRect(text, font, textAlign, textBaseline) { - var width = getWidth(text, font); - var height = getLineHeight(font); - var x = adjustTextX(0, width, textAlign); - var y = adjustTextY$1(0, height, textBaseline); - var rect = new BoundingRect(x, y, width, height); - return rect; - } - function getBoundingRect(text, font, textAlign, textBaseline) { - var textLines = ((text || '') + '').split('\n'); - var len = textLines.length; - if (len === 1) { - return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline); - } - else { - var uniondRect = new BoundingRect(0, 0, 0, 0); - for (var i = 0; i < textLines.length; i++) { - var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline); - i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect); - } - return uniondRect; - } - } - function adjustTextX(x, width, textAlign) { - if (textAlign === 'right') { - x -= width; - } - else if (textAlign === 'center') { - x -= width / 2; - } - return x; - } - function adjustTextY$1(y, height, verticalAlign) { - if (verticalAlign === 'middle') { - y -= height / 2; - } - else if (verticalAlign === 'bottom') { - y -= height; - } - return y; - } - function getLineHeight(font) { - return getWidth('国', font); - } - function parsePercent(value, maxValue) { - if (typeof value === 'string') { - if (value.lastIndexOf('%') >= 0) { - return parseFloat(value) / 100 * maxValue; - } - return parseFloat(value); - } - return value; - } - function calculateTextPosition(out, opts, rect) { - var textPosition = opts.position || 'inside'; - var distance = opts.distance != null ? opts.distance : 5; - var height = rect.height; - var width = rect.width; - var halfHeight = height / 2; - var x = rect.x; - var y = rect.y; - var textAlign = 'left'; - var textVerticalAlign = 'top'; - if (textPosition instanceof Array) { - x += parsePercent(textPosition[0], rect.width); - y += parsePercent(textPosition[1], rect.height); - textAlign = null; - textVerticalAlign = null; - } - else { - 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.align = textAlign; - out.verticalAlign = textVerticalAlign; - return out; - } - - var PRESERVED_NORMAL_STATE = '__zr_normal__'; - var PRIMARY_STATES_KEYS = TRANSFORMABLE_PROPS.concat(['ignore']); - var DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) { - obj[key] = true; - return obj; - }, { ignore: false }); - var tmpTextPosCalcRes = {}; - var tmpBoundingRect = new BoundingRect(0, 0, 0, 0); - var Element = (function () { - function Element(props) { - this.id = guid(); - this.animators = []; - this.currentStates = []; - this.states = {}; - this._init(props); - } - Element.prototype._init = function (props) { - this.attr(props); - }; - Element.prototype.drift = function (dx, dy, e) { - switch (this.draggable) { - case 'horizontal': - dy = 0; - break; - case 'vertical': - dx = 0; - break; - } - var m = this.transform; - if (!m) { - m = this.transform = [1, 0, 0, 1, 0, 0]; - } - m[4] += dx; - m[5] += dy; - this.decomposeTransform(); - this.markRedraw(); - }; - Element.prototype.beforeUpdate = function () { }; - Element.prototype.afterUpdate = function () { }; - Element.prototype.update = function () { - this.updateTransform(); - if (this.__dirty) { - this.updateInnerText(); - } - }; - Element.prototype.updateInnerText = function (forceUpdate) { - var textEl = this._textContent; - if (textEl && (!textEl.ignore || forceUpdate)) { - if (!this.textConfig) { - this.textConfig = {}; - } - var textConfig = this.textConfig; - var isLocal = textConfig.local; - var innerTransformable = textEl.innerTransformable; - var textAlign = void 0; - var textVerticalAlign = void 0; - var textStyleChanged = false; - innerTransformable.parent = isLocal ? this : null; - var innerOrigin = false; - innerTransformable.copyTransform(textEl); - if (textConfig.position != null) { - var layoutRect = tmpBoundingRect; - if (textConfig.layoutRect) { - layoutRect.copy(textConfig.layoutRect); - } - else { - layoutRect.copy(this.getBoundingRect()); - } - if (!isLocal) { - layoutRect.applyTransform(this.transform); - } - if (this.calculateTextPosition) { - this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect); - } - else { - calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect); - } - innerTransformable.x = tmpTextPosCalcRes.x; - innerTransformable.y = tmpTextPosCalcRes.y; - textAlign = tmpTextPosCalcRes.align; - textVerticalAlign = tmpTextPosCalcRes.verticalAlign; - var textOrigin = textConfig.origin; - if (textOrigin && textConfig.rotation != null) { - var relOriginX = void 0; - var relOriginY = void 0; - if (textOrigin === 'center') { - relOriginX = layoutRect.width * 0.5; - relOriginY = layoutRect.height * 0.5; - } - else { - relOriginX = parsePercent(textOrigin[0], layoutRect.width); - relOriginY = parsePercent(textOrigin[1], layoutRect.height); - } - innerOrigin = true; - innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x); - innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y); - } - } - if (textConfig.rotation != null) { - innerTransformable.rotation = textConfig.rotation; - } - var textOffset = textConfig.offset; - if (textOffset) { - innerTransformable.x += textOffset[0]; - innerTransformable.y += textOffset[1]; - if (!innerOrigin) { - innerTransformable.originX = -textOffset[0]; - innerTransformable.originY = -textOffset[1]; - } - } - var isInside = textConfig.inside == null - ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0) - : textConfig.inside; - var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {}); - var textFill = void 0; - var textStroke = void 0; - var autoStroke = void 0; - if (isInside && this.canBeInsideText()) { - textFill = textConfig.insideFill; - textStroke = textConfig.insideStroke; - if (textFill == null || textFill === 'auto') { - textFill = this.getInsideTextFill(); - } - if (textStroke == null || textStroke === 'auto') { - textStroke = this.getInsideTextStroke(textFill); - autoStroke = true; - } - } - else { - textFill = textConfig.outsideFill; - textStroke = textConfig.outsideStroke; - if (textFill == null || textFill === 'auto') { - textFill = this.getOutsideFill(); - } - if (textStroke == null || textStroke === 'auto') { - textStroke = this.getOutsideStroke(textFill); - autoStroke = true; - } - } - textFill = textFill || '#000'; - if (textFill !== innerTextDefaultStyle.fill - || textStroke !== innerTextDefaultStyle.stroke - || autoStroke !== innerTextDefaultStyle.autoStroke - || textAlign !== innerTextDefaultStyle.align - || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) { - textStyleChanged = true; - innerTextDefaultStyle.fill = textFill; - innerTextDefaultStyle.stroke = textStroke; - innerTextDefaultStyle.autoStroke = autoStroke; - innerTextDefaultStyle.align = textAlign; - innerTextDefaultStyle.verticalAlign = textVerticalAlign; - textEl.setDefaultTextStyle(innerTextDefaultStyle); - } - textEl.__dirty |= REDRAW_BIT; - if (textStyleChanged) { - textEl.dirtyStyle(true); - } - } - }; - Element.prototype.canBeInsideText = function () { - return true; - }; - Element.prototype.getInsideTextFill = function () { - return '#fff'; - }; - Element.prototype.getInsideTextStroke = function (textFill) { - return '#000'; - }; - Element.prototype.getOutsideFill = function () { - return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR; - }; - Element.prototype.getOutsideStroke = function (textFill) { - var backgroundColor = this.__zr && this.__zr.getBackgroundColor(); - var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor); - if (!colorArr) { - colorArr = [255, 255, 255, 1]; - } - var alpha = colorArr[3]; - var isDark = this.__zr.isDarkMode(); - for (var i = 0; i < 3; i++) { - colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha); - } - colorArr[3] = 1; - return stringify(colorArr, 'rgba'); - }; - Element.prototype.traverse = function (cb, context) { }; - Element.prototype.attrKV = function (key, value) { - if (key === 'textConfig') { - this.setTextConfig(value); - } - else if (key === 'textContent') { - this.setTextContent(value); - } - else if (key === 'clipPath') { - this.setClipPath(value); - } - else if (key === 'extra') { - this.extra = this.extra || {}; - extend(this.extra, value); - } - else { - this[key] = value; - } - }; - Element.prototype.hide = function () { - this.ignore = true; - this.markRedraw(); - }; - Element.prototype.show = function () { - this.ignore = false; - this.markRedraw(); - }; - Element.prototype.attr = function (keyOrObj, value) { - if (typeof keyOrObj === 'string') { - this.attrKV(keyOrObj, value); - } - else if (isObject(keyOrObj)) { - var obj = keyOrObj; - var keysArr = keys(obj); - for (var i = 0; i < keysArr.length; i++) { - var key = keysArr[i]; - this.attrKV(key, keyOrObj[key]); - } - } - this.markRedraw(); - return this; - }; - Element.prototype.saveCurrentToNormalState = function (toState) { - this._innerSaveToNormal(toState); - var normalState = this._normalState; - for (var i = 0; i < this.animators.length; i++) { - var animator = this.animators[i]; - var fromStateTransition = animator.__fromStateTransition; - if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) { - continue; - } - var targetName = animator.targetName; - var target = targetName - ? normalState[targetName] : normalState; - animator.saveTo(target); - } - }; - Element.prototype._innerSaveToNormal = function (toState) { - var normalState = this._normalState; - if (!normalState) { - normalState = this._normalState = {}; - } - if (toState.textConfig && !normalState.textConfig) { - normalState.textConfig = this.textConfig; - } - this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS); - }; - Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) { - for (var i = 0; i < primaryKeys.length; i++) { - var key = primaryKeys[i]; - if (toState[key] != null && !(key in normalState)) { - normalState[key] = this[key]; - } - } - }; - Element.prototype.hasState = function () { - return this.currentStates.length > 0; - }; - Element.prototype.getState = function (name) { - return this.states[name]; - }; - Element.prototype.ensureState = function (name) { - var states = this.states; - if (!states[name]) { - states[name] = {}; - } - return states[name]; - }; - Element.prototype.clearStates = function (noAnimation) { - this.useState(PRESERVED_NORMAL_STATE, false, noAnimation); - }; - Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation, forceUseHoverLayer) { - var toNormalState = stateName === PRESERVED_NORMAL_STATE; - var hasStates = this.hasState(); - if (!hasStates && toNormalState) { - return; - } - var currentStates = this.currentStates; - var animationCfg = this.stateTransition; - if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) { - return; - } - var state; - if (this.stateProxy && !toNormalState) { - state = this.stateProxy(stateName); - } - if (!state) { - state = (this.states && this.states[stateName]); - } - if (!state && !toNormalState) { - logError("State " + stateName + " not exists."); - return; - } - if (!toNormalState) { - this.saveCurrentToNormalState(state); - } - var useHoverLayer = !!((state && state.hoverLayer) || forceUseHoverLayer); - if (useHoverLayer) { - this._toggleHoverLayerFlag(true); - } - this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg); - var textContent = this._textContent; - var textGuide = this._textGuide; - if (textContent) { - textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer); - } - if (textGuide) { - textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer); - } - if (toNormalState) { - this.currentStates = []; - this._normalState = {}; - } - else { - if (!keepCurrentStates) { - this.currentStates = [stateName]; - } - else { - this.currentStates.push(stateName); - } - } - this._updateAnimationTargets(); - this.markRedraw(); - if (!useHoverLayer && this.__inHover) { - this._toggleHoverLayerFlag(false); - this.__dirty &= ~REDRAW_BIT; - } - return state; - }; - Element.prototype.useStates = function (states, noAnimation, forceUseHoverLayer) { - if (!states.length) { - this.clearStates(); - } - else { - var stateObjects = []; - var currentStates = this.currentStates; - var len = states.length; - var notChange = len === currentStates.length; - if (notChange) { - for (var i = 0; i < len; i++) { - if (states[i] !== currentStates[i]) { - notChange = false; - break; - } - } - } - if (notChange) { - return; - } - for (var i = 0; i < len; i++) { - var stateName = states[i]; - var stateObj = void 0; - if (this.stateProxy) { - stateObj = this.stateProxy(stateName, states); - } - if (!stateObj) { - stateObj = this.states[stateName]; - } - if (stateObj) { - stateObjects.push(stateObj); - } - } - var lastStateObj = stateObjects[len - 1]; - var useHoverLayer = !!((lastStateObj && lastStateObj.hoverLayer) || forceUseHoverLayer); - if (useHoverLayer) { - this._toggleHoverLayerFlag(true); - } - var mergedState = this._mergeStates(stateObjects); - var animationCfg = this.stateTransition; - this.saveCurrentToNormalState(mergedState); - this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg); - var textContent = this._textContent; - var textGuide = this._textGuide; - if (textContent) { - textContent.useStates(states, noAnimation, useHoverLayer); - } - if (textGuide) { - textGuide.useStates(states, noAnimation, useHoverLayer); - } - this._updateAnimationTargets(); - this.currentStates = states.slice(); - this.markRedraw(); - if (!useHoverLayer && this.__inHover) { - this._toggleHoverLayerFlag(false); - this.__dirty &= ~REDRAW_BIT; - } - } - }; - Element.prototype.isSilent = function () { - var isSilent = this.silent; - var ancestor = this.parent; - while (!isSilent && ancestor) { - if (ancestor.silent) { - isSilent = true; - break; - } - ancestor = ancestor.parent; - } - return isSilent; - }; - Element.prototype._updateAnimationTargets = function () { - for (var i = 0; i < this.animators.length; i++) { - var animator = this.animators[i]; - if (animator.targetName) { - animator.changeTarget(this[animator.targetName]); - } - } - }; - Element.prototype.removeState = function (state) { - var idx = indexOf(this.currentStates, state); - if (idx >= 0) { - var currentStates = this.currentStates.slice(); - currentStates.splice(idx, 1); - this.useStates(currentStates); - } - }; - Element.prototype.replaceState = function (oldState, newState, forceAdd) { - var currentStates = this.currentStates.slice(); - var idx = indexOf(currentStates, oldState); - var newStateExists = indexOf(currentStates, newState) >= 0; - if (idx >= 0) { - if (!newStateExists) { - currentStates[idx] = newState; - } - else { - currentStates.splice(idx, 1); - } - } - else if (forceAdd && !newStateExists) { - currentStates.push(newState); - } - this.useStates(currentStates); - }; - Element.prototype.toggleState = function (state, enable) { - if (enable) { - this.useState(state, true); - } - else { - this.removeState(state); - } - }; - Element.prototype._mergeStates = function (states) { - var mergedState = {}; - var mergedTextConfig; - for (var i = 0; i < states.length; i++) { - var state = states[i]; - extend(mergedState, state); - if (state.textConfig) { - mergedTextConfig = mergedTextConfig || {}; - extend(mergedTextConfig, state.textConfig); - } - } - if (mergedTextConfig) { - mergedState.textConfig = mergedTextConfig; - } - return mergedState; - }; - Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) { - var needsRestoreToNormal = !(state && keepCurrentStates); - if (state && state.textConfig) { - this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig); - extend(this.textConfig, state.textConfig); - } - else if (needsRestoreToNormal) { - if (normalState.textConfig) { - this.textConfig = normalState.textConfig; - } - } - var transitionTarget = {}; - var hasTransition = false; - for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) { - var key = PRIMARY_STATES_KEYS[i]; - var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key]; - if (state && state[key] != null) { - if (propNeedsTransition) { - hasTransition = true; - transitionTarget[key] = state[key]; - } - else { - this[key] = state[key]; - } - } - else if (needsRestoreToNormal) { - if (normalState[key] != null) { - if (propNeedsTransition) { - hasTransition = true; - transitionTarget[key] = normalState[key]; - } - else { - this[key] = normalState[key]; - } - } - } - } - if (!transition) { - for (var i = 0; i < this.animators.length; i++) { - var animator = this.animators[i]; - var targetName = animator.targetName; - if (!animator.getLoop()) { - animator.__changeFinalValue(targetName - ? (state || normalState)[targetName] - : (state || normalState)); - } - } - } - if (hasTransition) { - this._transitionState(stateName, transitionTarget, animationCfg); - } - }; - Element.prototype._attachComponent = function (componentEl) { - if (componentEl.__zr && !componentEl.__hostTarget) { - if ("development" !== 'production') { - throw new Error('Text element has been added to zrender.'); - } - return; - } - if (componentEl === this) { - if ("development" !== 'production') { - throw new Error('Recursive component attachment.'); - } - return; - } - var zr = this.__zr; - if (zr) { - componentEl.addSelfToZr(zr); - } - componentEl.__zr = zr; - componentEl.__hostTarget = this; - }; - Element.prototype._detachComponent = function (componentEl) { - if (componentEl.__zr) { - componentEl.removeSelfFromZr(componentEl.__zr); - } - componentEl.__zr = null; - componentEl.__hostTarget = null; - }; - Element.prototype.getClipPath = function () { - return this._clipPath; - }; - Element.prototype.setClipPath = function (clipPath) { - if (this._clipPath && this._clipPath !== clipPath) { - this.removeClipPath(); - } - this._attachComponent(clipPath); - this._clipPath = clipPath; - this.markRedraw(); - }; - Element.prototype.removeClipPath = function () { - var clipPath = this._clipPath; - if (clipPath) { - this._detachComponent(clipPath); - this._clipPath = null; - this.markRedraw(); - } - }; - Element.prototype.getTextContent = function () { - return this._textContent; - }; - Element.prototype.setTextContent = function (textEl) { - var previousTextContent = this._textContent; - if (previousTextContent === textEl) { - return; - } - if (previousTextContent && previousTextContent !== textEl) { - this.removeTextContent(); - } - if ("development" !== 'production') { - if (textEl.__zr && !textEl.__hostTarget) { - throw new Error('Text element has been added to zrender.'); - } - } - textEl.innerTransformable = new Transformable(); - this._attachComponent(textEl); - this._textContent = textEl; - this.markRedraw(); - }; - Element.prototype.setTextConfig = function (cfg) { - if (!this.textConfig) { - this.textConfig = {}; - } - extend(this.textConfig, cfg); - this.markRedraw(); - }; - Element.prototype.removeTextConfig = function () { - this.textConfig = null; - this.markRedraw(); - }; - Element.prototype.removeTextContent = function () { - var textEl = this._textContent; - if (textEl) { - textEl.innerTransformable = null; - this._detachComponent(textEl); - this._textContent = null; - this._innerTextDefaultStyle = null; - this.markRedraw(); - } - }; - Element.prototype.getTextGuideLine = function () { - return this._textGuide; - }; - Element.prototype.setTextGuideLine = function (guideLine) { - if (this._textGuide && this._textGuide !== guideLine) { - this.removeTextGuideLine(); - } - this._attachComponent(guideLine); - this._textGuide = guideLine; - this.markRedraw(); - }; - Element.prototype.removeTextGuideLine = function () { - var textGuide = this._textGuide; - if (textGuide) { - this._detachComponent(textGuide); - this._textGuide = null; - this.markRedraw(); - } - }; - Element.prototype.markRedraw = function () { - this.__dirty |= REDRAW_BIT; - var zr = this.__zr; - if (zr) { - if (this.__inHover) { - zr.refreshHover(); - } - else { - zr.refresh(); - } - } - if (this.__hostTarget) { - this.__hostTarget.markRedraw(); - } - }; - Element.prototype.dirty = function () { - this.markRedraw(); - }; - Element.prototype._toggleHoverLayerFlag = function (inHover) { - this.__inHover = inHover; - var textContent = this._textContent; - var textGuide = this._textGuide; - if (textContent) { - textContent.__inHover = inHover; - } - if (textGuide) { - textGuide.__inHover = inHover; - } - }; - Element.prototype.addSelfToZr = function (zr) { - if (this.__zr === zr) { - return; - } - this.__zr = zr; - var animators = this.animators; - if (animators) { - for (var i = 0; i < animators.length; i++) { - zr.animation.addAnimator(animators[i]); - } - } - if (this._clipPath) { - this._clipPath.addSelfToZr(zr); - } - if (this._textContent) { - this._textContent.addSelfToZr(zr); - } - if (this._textGuide) { - this._textGuide.addSelfToZr(zr); - } - }; - Element.prototype.removeSelfFromZr = function (zr) { - if (!this.__zr) { - return; - } - this.__zr = null; - var animators = this.animators; - if (animators) { - for (var i = 0; i < animators.length; i++) { - zr.animation.removeAnimator(animators[i]); - } - } - if (this._clipPath) { - this._clipPath.removeSelfFromZr(zr); - } - if (this._textContent) { - this._textContent.removeSelfFromZr(zr); - } - if (this._textGuide) { - this._textGuide.removeSelfFromZr(zr); - } - }; - Element.prototype.animate = function (key, loop, allowDiscreteAnimation) { - var target = key ? this[key] : this; - if ("development" !== 'production') { - if (!target) { - logError('Property "' - + key - + '" is not existed in element ' - + this.id); - return; - } - } - var animator = new Animator(target, loop, allowDiscreteAnimation); - key && (animator.targetName = key); - this.addAnimator(animator, key); - return animator; - }; - Element.prototype.addAnimator = function (animator, key) { - var zr = this.__zr; - var el = this; - animator.during(function () { - el.updateDuringAnimation(key); - }).done(function () { - var animators = el.animators; - var idx = indexOf(animators, animator); - if (idx >= 0) { - animators.splice(idx, 1); - } - }); - this.animators.push(animator); - if (zr) { - zr.animation.addAnimator(animator); - } - zr && zr.wakeUp(); - }; - Element.prototype.updateDuringAnimation = function (key) { - this.markRedraw(); - }; - Element.prototype.stopAnimation = function (scope, forwardToLast) { - var animators = this.animators; - var len = animators.length; - var leftAnimators = []; - for (var i = 0; i < len; i++) { - var animator = animators[i]; - if (!scope || scope === animator.scope) { - animator.stop(forwardToLast); - } - else { - leftAnimators.push(animator); - } - } - this.animators = leftAnimators; - return this; - }; - Element.prototype.animateTo = function (target, cfg, animationProps) { - animateTo(this, target, cfg, animationProps); - }; - Element.prototype.animateFrom = function (target, cfg, animationProps) { - animateTo(this, target, cfg, animationProps, true); - }; - Element.prototype._transitionState = function (stateName, target, cfg, animationProps) { - var animators = animateTo(this, target, cfg, animationProps); - for (var i = 0; i < animators.length; i++) { - animators[i].__fromStateTransition = stateName; - } - }; - Element.prototype.getBoundingRect = function () { - return null; - }; - Element.prototype.getPaintRect = function () { - return null; - }; - Element.initDefaultProps = (function () { - var elProto = Element.prototype; - elProto.type = 'element'; - elProto.name = ''; - elProto.ignore = - elProto.silent = - elProto.isGroup = - elProto.draggable = - elProto.dragging = - elProto.ignoreClip = - elProto.__inHover = false; - elProto.__dirty = REDRAW_BIT; - var logs = {}; - function logDeprecatedError(key, xKey, yKey) { - if (!logs[key + xKey + yKey]) { - console.warn("DEPRECATED: '" + key + "' has been deprecated. use '" + xKey + "', '" + yKey + "' instead"); - logs[key + xKey + yKey] = true; - } - } - function createLegacyProperty(key, privateKey, xKey, yKey) { - Object.defineProperty(elProto, key, { - get: function () { - if ("development" !== 'production') { - logDeprecatedError(key, xKey, yKey); - } - if (!this[privateKey]) { - var pos = this[privateKey] = []; - enhanceArray(this, pos); - } - return this[privateKey]; - }, - set: function (pos) { - if ("development" !== 'production') { - logDeprecatedError(key, xKey, yKey); - } - this[xKey] = pos[0]; - this[yKey] = pos[1]; - this[privateKey] = pos; - enhanceArray(this, pos); - } - }); - function enhanceArray(self, pos) { - Object.defineProperty(pos, 0, { - get: function () { - return self[xKey]; - }, - set: function (val) { - self[xKey] = val; - } - }); - Object.defineProperty(pos, 1, { - get: function () { - return self[yKey]; - }, - set: function (val) { - self[yKey] = val; - } - }); - } - } - if (Object.defineProperty) { - createLegacyProperty('position', '_legacyPos', 'x', 'y'); - createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY'); - createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY'); - } - })(); - return Element; - }()); - mixin(Element, Eventful); - mixin(Element, Transformable); - function animateTo(animatable, target, cfg, animationProps, reverse) { - cfg = cfg || {}; - var animators = []; - animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse); - var finishCount = animators.length; - var doneHappened = false; - var cfgDone = cfg.done; - var cfgAborted = cfg.aborted; - var doneCb = function () { - doneHappened = true; - finishCount--; - if (finishCount <= 0) { - doneHappened - ? (cfgDone && cfgDone()) - : (cfgAborted && cfgAborted()); - } - }; - var abortedCb = function () { - finishCount--; - if (finishCount <= 0) { - doneHappened - ? (cfgDone && cfgDone()) - : (cfgAborted && cfgAborted()); - } - }; - if (!finishCount) { - cfgDone && cfgDone(); - } - if (animators.length > 0 && cfg.during) { - animators[0].during(function (target, percent) { - cfg.during(percent); - }); - } - for (var i = 0; i < animators.length; i++) { - var animator = animators[i]; - if (doneCb) { - animator.done(doneCb); - } - if (abortedCb) { - animator.aborted(abortedCb); - } - if (cfg.force) { - animator.duration(cfg.duration); - } - animator.start(cfg.easing); - } - return animators; - } - function copyArrShallow(source, target, len) { - for (var i = 0; i < len; i++) { - source[i] = target[i]; - } - } - function is2DArray(value) { - return isArrayLike(value[0]); - } - function copyValue(target, source, key) { - if (isArrayLike(source[key])) { - if (!isArrayLike(target[key])) { - target[key] = []; - } - if (isTypedArray(source[key])) { - var len = source[key].length; - if (target[key].length !== len) { - target[key] = new (source[key].constructor)(len); - copyArrShallow(target[key], source[key], len); - } - } - else { - var sourceArr = source[key]; - var targetArr = target[key]; - var len0 = sourceArr.length; - if (is2DArray(sourceArr)) { - var len1 = sourceArr[0].length; - for (var i = 0; i < len0; i++) { - if (!targetArr[i]) { - targetArr[i] = Array.prototype.slice.call(sourceArr[i]); - } - else { - copyArrShallow(targetArr[i], sourceArr[i], len1); - } - } - } - else { - copyArrShallow(targetArr, sourceArr, len0); - } - targetArr.length = sourceArr.length; - } - } - else { - target[key] = source[key]; - } - } - function isValueSame(val1, val2) { - return val1 === val2 - || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2); - } - function is1DArraySame(arr0, arr1) { - var len = arr0.length; - if (len !== arr1.length) { - return false; - } - for (var i = 0; i < len; i++) { - if (arr0[i] !== arr1[i]) { - return false; - } - } - return true; - } - function animateToShallow(animatable, topKey, animateObj, target, cfg, animationProps, animators, reverse) { - var targetKeys = keys(target); - var duration = cfg.duration; - var delay = cfg.delay; - var additive = cfg.additive; - var setToFinal = cfg.setToFinal; - var animateAll = !isObject(animationProps); - var existsAnimators = animatable.animators; - var animationKeys = []; - for (var k = 0; k < targetKeys.length; k++) { - var innerKey = targetKeys[k]; - var targetVal = target[innerKey]; - if (targetVal != null && animateObj[innerKey] != null - && (animateAll || animationProps[innerKey])) { - if (isObject(targetVal) - && !isArrayLike(targetVal) - && !isGradientObject(targetVal)) { - if (topKey) { - if (!reverse) { - animateObj[innerKey] = targetVal; - animatable.updateDuringAnimation(topKey); - } - continue; - } - animateToShallow(animatable, innerKey, animateObj[innerKey], targetVal, cfg, animationProps && animationProps[innerKey], animators, reverse); - } - else { - animationKeys.push(innerKey); - } - } - else if (!reverse) { - animateObj[innerKey] = targetVal; - animatable.updateDuringAnimation(topKey); - animationKeys.push(innerKey); - } - } - var keyLen = animationKeys.length; - if (!additive && keyLen) { - for (var i = 0; i < existsAnimators.length; i++) { - var animator = existsAnimators[i]; - if (animator.targetName === topKey) { - var allAborted = animator.stopTracks(animationKeys); - if (allAborted) { - var idx = indexOf(existsAnimators, animator); - existsAnimators.splice(idx, 1); - } - } - } - } - if (!cfg.force) { - animationKeys = filter(animationKeys, function (key) { return !isValueSame(target[key], animateObj[key]); }); - keyLen = animationKeys.length; - } - if (keyLen > 0 - || (cfg.force && !animators.length)) { - var revertedSource = void 0; - var reversedTarget = void 0; - var sourceClone = void 0; - if (reverse) { - reversedTarget = {}; - if (setToFinal) { - revertedSource = {}; - } - for (var i = 0; i < keyLen; i++) { - var innerKey = animationKeys[i]; - reversedTarget[innerKey] = animateObj[innerKey]; - if (setToFinal) { - revertedSource[innerKey] = target[innerKey]; - } - else { - animateObj[innerKey] = target[innerKey]; - } - } - } - else if (setToFinal) { - sourceClone = {}; - for (var i = 0; i < keyLen; i++) { - var innerKey = animationKeys[i]; - sourceClone[innerKey] = cloneValue(animateObj[innerKey]); - copyValue(animateObj, target, innerKey); - } - } - var animator = new Animator(animateObj, false, false, additive ? filter(existsAnimators, function (animator) { return animator.targetName === topKey; }) : null); - animator.targetName = topKey; - if (cfg.scope) { - animator.scope = cfg.scope; - } - if (setToFinal && revertedSource) { - animator.whenWithKeys(0, revertedSource, animationKeys); - } - if (sourceClone) { - animator.whenWithKeys(0, sourceClone, animationKeys); - } - animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animationKeys).delay(delay || 0); - animatable.addAnimator(animator, topKey); - animators.push(animator); - } - } - - var Group = (function (_super) { - __extends(Group, _super); - function Group(opts) { - var _this = _super.call(this) || this; - _this.isGroup = true; - _this._children = []; - _this.attr(opts); - return _this; - } - Group.prototype.childrenRef = function () { - return this._children; - }; - Group.prototype.children = function () { - return this._children.slice(); - }; - Group.prototype.childAt = function (idx) { - return this._children[idx]; - }; - Group.prototype.childOfName = function (name) { - var children = this._children; - for (var i = 0; i < children.length; i++) { - if (children[i].name === name) { - return children[i]; - } - } - }; - Group.prototype.childCount = function () { - return this._children.length; - }; - Group.prototype.add = function (child) { - if (child) { - if (child !== this && child.parent !== this) { - this._children.push(child); - this._doAdd(child); - } - if ("development" !== 'production') { - if (child.__hostTarget) { - throw 'This elemenet has been used as an attachment'; - } - } - } - return this; - }; - Group.prototype.addBefore = function (child, nextSibling) { - if (child && child !== this && child.parent !== this - && nextSibling && nextSibling.parent === this) { - var children = this._children; - var idx = children.indexOf(nextSibling); - if (idx >= 0) { - children.splice(idx, 0, child); - this._doAdd(child); - } - } - return this; - }; - Group.prototype.replace = function (oldChild, newChild) { - var idx = indexOf(this._children, oldChild); - if (idx >= 0) { - this.replaceAt(newChild, idx); - } - return this; - }; - Group.prototype.replaceAt = function (child, index) { - var children = this._children; - var old = children[index]; - if (child && child !== this && child.parent !== this && child !== old) { - children[index] = child; - old.parent = null; - var zr = this.__zr; - if (zr) { - old.removeSelfFromZr(zr); - } - this._doAdd(child); - } - return this; - }; - Group.prototype._doAdd = function (child) { - if (child.parent) { - child.parent.remove(child); - } - child.parent = this; - var zr = this.__zr; - if (zr && zr !== child.__zr) { - child.addSelfToZr(zr); - } - zr && zr.refresh(); - }; - Group.prototype.remove = function (child) { - var zr = this.__zr; - var children = this._children; - var idx = indexOf(children, child); - if (idx < 0) { - return this; - } - children.splice(idx, 1); - child.parent = null; - if (zr) { - child.removeSelfFromZr(zr); - } - zr && zr.refresh(); - return this; - }; - Group.prototype.removeAll = function () { - var children = this._children; - var zr = this.__zr; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (zr) { - child.removeSelfFromZr(zr); - } - child.parent = null; - } - children.length = 0; - return this; - }; - Group.prototype.eachChild = function (cb, context) { - var children = this._children; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - cb.call(context, child, i); - } - return this; - }; - Group.prototype.traverse = function (cb, context) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - var stopped = cb.call(context, child); - if (child.isGroup && !stopped) { - child.traverse(cb, context); - } - } - return this; - }; - Group.prototype.addSelfToZr = function (zr) { - _super.prototype.addSelfToZr.call(this, zr); - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - child.addSelfToZr(zr); - } - }; - Group.prototype.removeSelfFromZr = function (zr) { - _super.prototype.removeSelfFromZr.call(this, zr); - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - child.removeSelfFromZr(zr); - } - }; - Group.prototype.getBoundingRect = function (includeChildren) { - var tmpRect = new BoundingRect(0, 0, 0, 0); - var children = includeChildren || this._children; - var tmpMat = []; - var rect = null; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (child.ignore || child.invisible) { - continue; - } - var childRect = child.getBoundingRect(); - var transform = child.getLocalTransform(tmpMat); - if (transform) { - BoundingRect.applyTransform(tmpRect, childRect, transform); - rect = rect || tmpRect.clone(); - rect.union(tmpRect); - } - else { - rect = rect || childRect.clone(); - rect.union(childRect); - } - } - return rect || tmpRect; - }; - return Group; - }(Element)); - Group.prototype.type = 'group'; - - /*! - * ZRender, a high performance 2d drawing library. - * - * Copyright (c) 2013, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt - */ - var painterCtors = {}; - var instances = {}; - function delInstance(id) { - delete instances[id]; - } - function isDarkMode(backgroundColor) { - if (!backgroundColor) { - return false; - } - if (typeof backgroundColor === 'string') { - return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD; - } - else if (backgroundColor.colorStops) { - var colorStops = backgroundColor.colorStops; - var totalLum = 0; - var len = colorStops.length; - for (var i = 0; i < len; i++) { - totalLum += lum(colorStops[i].color, 1); - } - totalLum /= len; - return totalLum < DARK_MODE_THRESHOLD; - } - return false; - } - var ZRender = (function () { - function ZRender(id, dom, opts) { - var _this = this; - this._sleepAfterStill = 10; - this._stillFrameAccum = 0; - this._needsRefresh = true; - this._needsRefreshHover = true; - this._darkMode = false; - opts = opts || {}; - this.dom = dom; - this.id = id; - var storage = new Storage(); - var rendererType = opts.renderer || 'canvas'; - if (!painterCtors[rendererType]) { - rendererType = keys(painterCtors)[0]; - } - if ("development" !== 'production') { - if (!painterCtors[rendererType]) { - throw new Error("Renderer '" + rendererType + "' is not imported. Please import it first."); - } - } - opts.useDirtyRect = opts.useDirtyRect == null - ? false - : opts.useDirtyRect; - var painter = new painterCtors[rendererType](dom, storage, opts, id); - var ssrMode = opts.ssr || painter.ssrOnly; - this.storage = storage; - this.painter = painter; - var handlerProxy = (!env.node && !env.worker && !ssrMode) - ? new HandlerDomProxy(painter.getViewportRoot(), painter.root) - : null; - var useCoarsePointer = opts.useCoarsePointer; - var usePointerSize = (useCoarsePointer == null || useCoarsePointer === 'auto') - ? env.touchEventsSupported - : !!useCoarsePointer; - var defaultPointerSize = 44; - var pointerSize; - if (usePointerSize) { - pointerSize = retrieve2(opts.pointerSize, defaultPointerSize); - } - this.handler = new Handler(storage, painter, handlerProxy, painter.root, pointerSize); - this.animation = new Animation({ - stage: { - update: ssrMode ? null : function () { return _this._flush(true); } - } - }); - if (!ssrMode) { - this.animation.start(); - } - } - ZRender.prototype.add = function (el) { - if (this._disposed || !el) { - return; - } - this.storage.addRoot(el); - el.addSelfToZr(this); - this.refresh(); - }; - ZRender.prototype.remove = function (el) { - if (this._disposed || !el) { - return; - } - this.storage.delRoot(el); - el.removeSelfFromZr(this); - this.refresh(); - }; - ZRender.prototype.configLayer = function (zLevel, config) { - if (this._disposed) { - return; - } - if (this.painter.configLayer) { - this.painter.configLayer(zLevel, config); - } - this.refresh(); - }; - ZRender.prototype.setBackgroundColor = function (backgroundColor) { - if (this._disposed) { - return; - } - if (this.painter.setBackgroundColor) { - this.painter.setBackgroundColor(backgroundColor); - } - this.refresh(); - this._backgroundColor = backgroundColor; - this._darkMode = isDarkMode(backgroundColor); - }; - ZRender.prototype.getBackgroundColor = function () { - return this._backgroundColor; - }; - ZRender.prototype.setDarkMode = function (darkMode) { - this._darkMode = darkMode; - }; - ZRender.prototype.isDarkMode = function () { - return this._darkMode; - }; - ZRender.prototype.refreshImmediately = function (fromInside) { - if (this._disposed) { - return; - } - if (!fromInside) { - this.animation.update(true); - } - this._needsRefresh = false; - this.painter.refresh(); - this._needsRefresh = false; - }; - ZRender.prototype.refresh = function () { - if (this._disposed) { - return; - } - this._needsRefresh = true; - this.animation.start(); - }; - ZRender.prototype.flush = function () { - if (this._disposed) { - return; - } - this._flush(false); - }; - ZRender.prototype._flush = function (fromInside) { - var triggerRendered; - var start = getTime(); - if (this._needsRefresh) { - triggerRendered = true; - this.refreshImmediately(fromInside); - } - if (this._needsRefreshHover) { - triggerRendered = true; - this.refreshHoverImmediately(); - } - var end = getTime(); - if (triggerRendered) { - this._stillFrameAccum = 0; - this.trigger('rendered', { - elapsedTime: end - start - }); - } - else if (this._sleepAfterStill > 0) { - this._stillFrameAccum++; - if (this._stillFrameAccum > this._sleepAfterStill) { - this.animation.stop(); - } - } - }; - ZRender.prototype.setSleepAfterStill = function (stillFramesCount) { - this._sleepAfterStill = stillFramesCount; - }; - ZRender.prototype.wakeUp = function () { - if (this._disposed) { - return; - } - this.animation.start(); - this._stillFrameAccum = 0; - }; - ZRender.prototype.refreshHover = function () { - this._needsRefreshHover = true; - }; - ZRender.prototype.refreshHoverImmediately = function () { - if (this._disposed) { - return; - } - this._needsRefreshHover = false; - if (this.painter.refreshHover && this.painter.getType() === 'canvas') { - this.painter.refreshHover(); - } - }; - ZRender.prototype.resize = function (opts) { - if (this._disposed) { - return; - } - opts = opts || {}; - this.painter.resize(opts.width, opts.height); - this.handler.resize(); - }; - ZRender.prototype.clearAnimation = function () { - if (this._disposed) { - return; - } - this.animation.clear(); - }; - ZRender.prototype.getWidth = function () { - if (this._disposed) { - return; - } - return this.painter.getWidth(); - }; - ZRender.prototype.getHeight = function () { - if (this._disposed) { - return; - } - return this.painter.getHeight(); - }; - ZRender.prototype.setCursorStyle = function (cursorStyle) { - if (this._disposed) { - return; - } - this.handler.setCursorStyle(cursorStyle); - }; - ZRender.prototype.findHover = function (x, y) { - if (this._disposed) { - return; - } - return this.handler.findHover(x, y); - }; - ZRender.prototype.on = function (eventName, eventHandler, context) { - if (!this._disposed) { - this.handler.on(eventName, eventHandler, context); - } - return this; - }; - ZRender.prototype.off = function (eventName, eventHandler) { - if (this._disposed) { - return; - } - this.handler.off(eventName, eventHandler); - }; - ZRender.prototype.trigger = function (eventName, event) { - if (this._disposed) { - return; - } - this.handler.trigger(eventName, event); - }; - ZRender.prototype.clear = function () { - if (this._disposed) { - return; - } - var roots = this.storage.getRoots(); - for (var i = 0; i < roots.length; i++) { - if (roots[i] instanceof Group) { - roots[i].removeSelfFromZr(this); - } - } - this.storage.delAllRoots(); - this.painter.clear(); - }; - ZRender.prototype.dispose = function () { - if (this._disposed) { - return; - } - this.animation.stop(); - this.clear(); - this.storage.dispose(); - this.painter.dispose(); - this.handler.dispose(); - this.animation = - this.storage = - this.painter = - this.handler = null; - this._disposed = true; - delInstance(this.id); - }; - return ZRender; - }()); - function init(dom, opts) { - var zr = new ZRender(guid(), dom, opts); - instances[zr.id] = zr; - return zr; - } - function dispose(zr) { - zr.dispose(); - } - function disposeAll() { - for (var key in instances) { - if (instances.hasOwnProperty(key)) { - instances[key].dispose(); - } - } - instances = {}; - } - function getInstance(id) { - return instances[id]; - } - function registerPainter(name, Ctor) { - painterCtors[name] = Ctor; - } - var ssrDataGetter; - function getElementSSRData(el) { - if (typeof ssrDataGetter === 'function') { - return ssrDataGetter(el); - } - } - function registerSSRDataGetter(getter) { - ssrDataGetter = getter; - } - var version = '5.6.0'; - - var zrender = /*#__PURE__*/Object.freeze({ - __proto__: null, - init: init, - dispose: dispose, - disposeAll: disposeAll, - getInstance: getInstance, - registerPainter: registerPainter, - getElementSSRData: getElementSSRData, - registerSSRDataGetter: registerSSRDataGetter, - version: version - }); - - var RADIAN_EPSILON = 1e-4; - // Although chrome already enlarge this number to 100 for `toFixed`, but - // we sill follow the spec for compatibility. - var ROUND_SUPPORTED_PRECISION_MAX = 20; - function _trim(str) { - return str.replace(/^\s+|\s+$/g, ''); - } - /** - * Linear mapping a value from domain to range - * @param val - * @param domain Domain extent domain[0] can be bigger than domain[1] - * @param range Range extent range[0] can be bigger than range[1] - * @param clamp Default to be false - */ - function linearMap(val, domain, range, clamp) { - var d0 = domain[0]; - var d1 = domain[1]; - var r0 = range[0]; - var r1 = range[1]; - var subDomain = d1 - d0; - var subRange = r1 - r0; - if (subDomain === 0) { - return subRange === 0 ? r0 : (r0 + r1) / 2; - } - // Avoid accuracy problem in edge, such as - // 146.39 - 62.83 === 83.55999999999999. - // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError - // It is a little verbose for efficiency considering this method - // is a hotspot. - if (clamp) { - if (subDomain > 0) { - if (val <= d0) { - return r0; - } else if (val >= d1) { - return r1; - } - } else { - if (val >= d0) { - return r0; - } else if (val <= d1) { - return r1; - } - } - } else { - if (val === d0) { - return r0; - } - if (val === d1) { - return r1; - } - } - return (val - d0) / subDomain * subRange + r0; - } - /** - * Convert a percent string to absolute number. - * Returns NaN if percent is not a valid string or number - */ - function parsePercent$1(percent, all) { - switch (percent) { - case 'center': - case 'middle': - percent = '50%'; - break; - case 'left': - case 'top': - percent = '0%'; - break; - case 'right': - case 'bottom': - percent = '100%'; - break; - } - if (isString(percent)) { - if (_trim(percent).match(/%$/)) { - return parseFloat(percent) / 100 * all; - } - return parseFloat(percent); - } - return percent == null ? NaN : +percent; - } - function round(x, precision, returnStr) { - if (precision == null) { - precision = 10; - } - // Avoid range error - precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX); - // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01' - x = (+x).toFixed(precision); - return returnStr ? x : +x; - } - /** - * Inplacd asc sort arr. - * The input arr will be modified. - */ - function asc(arr) { - arr.sort(function (a, b) { - return a - b; - }); - return arr; - } - /** - * Get precision. - */ - function getPrecision(val) { - val = +val; - if (isNaN(val)) { - return 0; - } - // It is much faster than methods converting number to string as follows - // let tmp = val.toString(); - // return tmp.length - 1 - tmp.indexOf('.'); - // especially when precision is low - // Notice: - // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`. - // (see https://jsbench.me/2vkpcekkvw/1) - // (2) If the val is less than for example 1e-15, the result may be incorrect. - // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`) - if (val > 1e-14) { - var e = 1; - for (var i = 0; i < 15; i++, e *= 10) { - if (Math.round(val * e) / e === val) { - return i; - } - } - } - return getPrecisionSafe(val); - } - /** - * Get precision with slow but safe method - */ - function getPrecisionSafe(val) { - // toLowerCase for: '3.4E-12' - var str = val.toString().toLowerCase(); - // Consider scientific notation: '3.4e-12' '3.4e+12' - var eIndex = str.indexOf('e'); - var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0; - var significandPartLen = eIndex > 0 ? eIndex : str.length; - var dotIndex = str.indexOf('.'); - var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex; - return Math.max(0, decimalPartLen - exp); - } - /** - * Minimal dicernible data precisioin according to a single pixel. - */ - function getPixelPrecision(dataExtent, pixelExtent) { - var log = Math.log; - var LN10 = Math.LN10; - var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10); - var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); - // toFixed() digits argument must be between 0 and 20. - var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20); - return !isFinite(precision) ? 20 : precision; - } - /** - * Get a data of given precision, assuring the sum of percentages - * in valueList is 1. - * The largest remainder method is used. - * https://en.wikipedia.org/wiki/Largest_remainder_method - * - * @param valueList a list of all data - * @param idx index of the data to be processed in valueList - * @param precision integer number showing digits of precision - * @return percent ranging from 0 to 100 - */ - function getPercentWithPrecision(valueList, idx, precision) { - if (!valueList[idx]) { - return 0; - } - var seats = getPercentSeats(valueList, precision); - return seats[idx] || 0; - } - /** - * Get a data of given precision, assuring the sum of percentages - * in valueList is 1. - * The largest remainder method is used. - * https://en.wikipedia.org/wiki/Largest_remainder_method - * - * @param valueList a list of all data - * @param precision integer number showing digits of precision - * @return {Array} - */ - function getPercentSeats(valueList, precision) { - var sum = reduce(valueList, function (acc, val) { - return acc + (isNaN(val) ? 0 : val); - }, 0); - if (sum === 0) { - return []; - } - var digits = Math.pow(10, precision); - var votesPerQuota = map(valueList, function (val) { - return (isNaN(val) ? 0 : val) / sum * digits * 100; - }); - var targetSeats = digits * 100; - var seats = map(votesPerQuota, function (votes) { - // Assign automatic seats. - return Math.floor(votes); - }); - var currentSum = reduce(seats, function (acc, val) { - return acc + val; - }, 0); - var remainder = map(votesPerQuota, function (votes, idx) { - return votes - seats[idx]; - }); - // Has remainding votes. - while (currentSum < targetSeats) { - // Find next largest remainder. - var max = Number.NEGATIVE_INFINITY; - var maxId = null; - for (var i = 0, len = remainder.length; i < len; ++i) { - if (remainder[i] > max) { - max = remainder[i]; - maxId = i; - } - } - // Add a vote to max remainder. - ++seats[maxId]; - remainder[maxId] = 0; - ++currentSum; - } - return map(seats, function (seat) { - return seat / digits; - }); - } - /** - * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004 - * See - */ - function addSafe(val0, val1) { - var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1)); - // const multiplier = Math.pow(10, maxPrecision); - // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier; - var sum = val0 + val1; - // // PENDING: support more? - return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum : round(sum, maxPrecision); - } - // Number.MAX_SAFE_INTEGER, ie do not support. - var MAX_SAFE_INTEGER = 9007199254740991; - /** - * To 0 - 2 * PI, considering negative radian. - */ - function remRadian(radian) { - var pi2 = Math.PI * 2; - return (radian % pi2 + pi2) % pi2; - } - /** - * @param {type} radian - * @return {boolean} - */ - function isRadianAroundZero(val) { - return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; - } - // eslint-disable-next-line - var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; // jshint ignore:line - /** - * @param value valid type: number | string | Date, otherwise return `new Date(NaN)` - * These values can be accepted: - * + An instance of Date, represent a time in its own time zone. - * + Or string in a subset of ISO 8601, only including: - * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06', - * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123', - * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00', - * all of which will be treated as local time if time zone is not specified - * (see ). - * + Or other string format, including (all of which will be treated as local time): - * '2012', '2012-3-1', '2012/3/1', '2012/03/01', - * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123' - * + a timestamp, which represent a time in UTC. - * @return date Never be null/undefined. If invalid, return `new Date(NaN)`. - */ - function parseDate(value) { - if (value instanceof Date) { - return value; - } else if (isString(value)) { - // Different browsers parse date in different way, so we parse it manually. - // Some other issues: - // new Date('1970-01-01') is UTC, - // new Date('1970/01/01') and new Date('1970-1-01') is local. - // See issue #3623 - var match = TIME_REG.exec(value); - if (!match) { - // return Invalid Date. - return new Date(NaN); - } - // Use local time when no timezone offset is specified. - if (!match[8]) { - // match[n] can only be string or undefined. - // But take care of '12' + 1 => '121'. - return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0); - } - // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time, - // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment). - // For example, system timezone is set as "Time Zone: America/Toronto", - // then these code will get different result: - // `new Date(1478411999999).getTimezoneOffset(); // get 240` - // `new Date(1478412000000).getTimezoneOffset(); // get 300` - // So we should not use `new Date`, but use `Date.UTC`. - else { - var hour = +match[4] || 0; - if (match[8].toUpperCase() !== 'Z') { - hour -= +match[8].slice(0, 3); - } - return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0)); - } - } else if (value == null) { - return new Date(NaN); - } - return new Date(Math.round(value)); - } - /** - * Quantity of a number. e.g. 0.1, 1, 10, 100 - * - * @param val - * @return - */ - function quantity(val) { - return Math.pow(10, quantityExponent(val)); - } - /** - * Exponent of the quantity of a number - * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3 - * - * @param val non-negative value - * @return - */ - function quantityExponent(val) { - if (val === 0) { - return 0; - } - var exp = Math.floor(Math.log(val) / Math.LN10); - /** - * exp is expected to be the rounded-down result of the base-10 log of val. - * But due to the precision loss with Math.log(val), we need to restore it - * using 10^exp to make sure we can get val back from exp. #11249 - */ - if (val / Math.pow(10, exp) >= 10) { - exp++; - } - return exp; - } - /** - * find a “nice” number approximately equal to x. Round the number if round = true, - * take ceiling if round = false. The primary observation is that the “nicest” - * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers. - * - * See "Nice Numbers for Graph Labels" of Graphic Gems. - * - * @param val Non-negative value. - * @param round - * @return Niced number - */ - function nice(val, round) { - var exponent = quantityExponent(val); - var exp10 = Math.pow(10, exponent); - var f = val / exp10; // 1 <= f < 10 - var nf; - if (round) { - if (f < 1.5) { - nf = 1; - } else if (f < 2.5) { - nf = 2; - } else if (f < 4) { - nf = 3; - } else if (f < 7) { - nf = 5; - } else { - nf = 10; - } - } else { - if (f < 1) { - nf = 1; - } else if (f < 2) { - nf = 2; - } else if (f < 3) { - nf = 3; - } else if (f < 5) { - nf = 5; - } else { - nf = 10; - } - } - val = nf * exp10; - // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754). - // 20 is the uppper bound of toFixed. - return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val; - } - /** - * This code was copied from "d3.js" - * . - * See the license statement at the head of this file. - * @param ascArr - */ - function quantile(ascArr, p) { - var H = (ascArr.length - 1) * p + 1; - var h = Math.floor(H); - var v = +ascArr[h - 1]; - var e = H - h; - return e ? v + e * (ascArr[h] - v) : v; - } - /** - * Order intervals asc, and split them when overlap. - * expect(numberUtil.reformIntervals([ - * {interval: [18, 62], close: [1, 1]}, - * {interval: [-Infinity, -70], close: [0, 0]}, - * {interval: [-70, -26], close: [1, 1]}, - * {interval: [-26, 18], close: [1, 1]}, - * {interval: [62, 150], close: [1, 1]}, - * {interval: [106, 150], close: [1, 1]}, - * {interval: [150, Infinity], close: [0, 0]} - * ])).toEqual([ - * {interval: [-Infinity, -70], close: [0, 0]}, - * {interval: [-70, -26], close: [1, 1]}, - * {interval: [-26, 18], close: [0, 1]}, - * {interval: [18, 62], close: [0, 1]}, - * {interval: [62, 150], close: [0, 1]}, - * {interval: [150, Infinity], close: [0, 0]} - * ]); - * @param list, where `close` mean open or close - * of the interval, and Infinity can be used. - * @return The origin list, which has been reformed. - */ - function reformIntervals(list) { - list.sort(function (a, b) { - return littleThan(a, b, 0) ? -1 : 1; - }); - var curr = -Infinity; - var currClose = 1; - for (var i = 0; i < list.length;) { - var interval = list[i].interval; - var close_1 = list[i].close; - for (var lg = 0; lg < 2; lg++) { - if (interval[lg] <= curr) { - interval[lg] = curr; - close_1[lg] = !lg ? 1 - currClose : 1; - } - curr = interval[lg]; - currClose = close_1[lg]; - } - if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) { - list.splice(i, 1); - } else { - i++; - } - } - return list; - function littleThan(a, b, lg) { - return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1)); - } - } - /** - * [Numeric is defined as]: - * `parseFloat(val) == val` - * For example: - * numeric: - * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity, - * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec) - * not-numeric: - * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab', - * empty string, string with only white-spaces or line-terminal (see es spec), - * 0x12, '0x12', '-0x12', 012, '012', '-012', - * non-string, ... - * - * @test See full test cases in `test/ut/spec/util/number.js`. - * @return Must be a typeof number. If not numeric, return NaN. - */ - function numericToNumber(val) { - var valFloat = parseFloat(val); - return valFloat == val // eslint-disable-line eqeqeq - && (valFloat !== 0 || !isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '. - ? valFloat : NaN; - } - /** - * Definition of "numeric": see `numericToNumber`. - */ - function isNumeric(val) { - return !isNaN(numericToNumber(val)); - } - /** - * Use random base to prevent users hard code depending on - * this auto generated marker id. - * @return An positive integer. - */ - function getRandomIdBase() { - return Math.round(Math.random() * 9); - } - /** - * Get the greatest common divisor. - * - * @param {number} a one number - * @param {number} b the other number - */ - function getGreatestCommonDividor(a, b) { - if (b === 0) { - return a; - } - return getGreatestCommonDividor(b, a % b); - } - /** - * Get the least common multiple. - * - * @param {number} a one number - * @param {number} b the other number - */ - function getLeastCommonMultiple(a, b) { - if (a == null) { - return b; - } - if (b == null) { - return a; - } - return a * b / getGreatestCommonDividor(a, b); - } - - var ECHARTS_PREFIX = '[ECharts] '; - var storedLogs = {}; - var hasConsole = typeof console !== 'undefined' - // eslint-disable-next-line - && console.warn && console.log; - function outputLog(type, str, onlyOnce) { - if (hasConsole) { - if (onlyOnce) { - if (storedLogs[str]) { - return; - } - storedLogs[str] = true; - } - // eslint-disable-next-line - console[type](ECHARTS_PREFIX + str); - } - } - function log(str, onlyOnce) { - outputLog('log', str, onlyOnce); - } - function warn(str, onlyOnce) { - outputLog('warn', str, onlyOnce); - } - function error(str, onlyOnce) { - outputLog('error', str, onlyOnce); - } - function deprecateLog(str) { - if ("development" !== 'production') { - // Not display duplicate message. - outputLog('warn', 'DEPRECATED: ' + str, true); - } - } - function deprecateReplaceLog(oldOpt, newOpt, scope) { - if ("development" !== 'production') { - deprecateLog((scope ? "[" + scope + "]" : '') + (oldOpt + " is deprecated, use " + newOpt + " instead.")); - } - } - /** - * If in __DEV__ environment, get console printable message for users hint. - * Parameters are separated by ' '. - * @usage - * makePrintable('This is an error on', someVar, someObj); - * - * @param hintInfo anything about the current execution context to hint users. - * @throws Error - */ - function makePrintable() { - var hintInfo = []; - for (var _i = 0; _i < arguments.length; _i++) { - hintInfo[_i] = arguments[_i]; - } - var msg = ''; - if ("development" !== 'production') { - // Fuzzy stringify for print. - // This code only exist in dev environment. - var makePrintableStringIfPossible_1 = function (val) { - return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null; - }; - msg = map(hintInfo, function (arg) { - if (isString(arg)) { - // Print without quotation mark for some statement. - return arg; - } else { - var printableStr = makePrintableStringIfPossible_1(arg); - if (printableStr != null) { - return printableStr; - } else if (typeof JSON !== 'undefined' && JSON.stringify) { - try { - return JSON.stringify(arg, function (n, val) { - var printableStr = makePrintableStringIfPossible_1(val); - return printableStr == null ? val : printableStr; - }); - // In most cases the info object is small, so do not line break. - } catch (err) { - return '?'; - } - } else { - return '?'; - } - } - }).join(' '); - } - return msg; - } - /** - * @throws Error - */ - function throwError(msg) { - throw new Error(msg); - } - - function interpolateNumber$1(p0, p1, percent) { - return (p1 - p0) * percent + p0; - } - /** - * Make the name displayable. But we should - * make sure it is not duplicated with user - * specified name, so use '\0'; - */ - var DUMMY_COMPONENT_NAME_PREFIX = 'series\0'; - var INTERNAL_COMPONENT_ID_PREFIX = '\0_ec_\0'; - /** - * If value is not array, then translate it to array. - * @param {*} value - * @return {Array} [value] or value - */ - function normalizeToArray(value) { - return value instanceof Array ? value : value == null ? [] : [value]; - } - /** - * Sync default option between normal and emphasis like `position` and `show` - * In case some one will write code like - * label: { - * show: false, - * position: 'outside', - * fontSize: 18 - * }, - * emphasis: { - * label: { show: true } - * } - */ - function defaultEmphasis(opt, key, subOpts) { - // Caution: performance sensitive. - if (opt) { - opt[key] = opt[key] || {}; - opt.emphasis = opt.emphasis || {}; - opt.emphasis[key] = opt.emphasis[key] || {}; - // Default emphasis option from normal - for (var i = 0, len = subOpts.length; i < len; i++) { - var subOptName = subOpts[i]; - if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) { - opt.emphasis[key][subOptName] = opt[key][subOptName]; - } - } - } - } - var TEXT_STYLE_OPTIONS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding']; - // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([ - // 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter', - // 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily', - // // FIXME: deprecated, check and remove it. - // 'textStyle' - // ]); - /** - * The method does not ensure performance. - * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] - * This helper method retrieves value from data. - */ - function getDataItemValue(dataItem) { - return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem; - } - /** - * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] - * This helper method determine if dataItem has extra option besides value - */ - function isDataItemOption(dataItem) { - return isObject(dataItem) && !(dataItem instanceof Array); - // // markLine data can be array - // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array)); - } - /** - * Mapping to existings for merge. - * - * Mode "normalMege": - * The mapping result (merge result) will keep the order of the existing - * component, rather than the order of new option. Because we should ensure - * some specified index reference (like xAxisIndex) keep work. - * And in most cases, "merge option" is used to update partial option but not - * be expected to change the order. - * - * Mode "replaceMege": - * (1) Only the id mapped components will be merged. - * (2) Other existing components (except internal components) will be removed. - * (3) Other new options will be used to create new component. - * (4) The index of the existing components will not be modified. - * That means their might be "hole" after the removal. - * The new components are created first at those available index. - * - * Mode "replaceAll": - * This mode try to support that reproduce an echarts instance from another - * echarts instance (via `getOption`) in some simple cases. - * In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`, - * which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is, - * the "hole" in `newCmptOptions` will also be kept. - * On the contrary, other modes try best to eliminate holes. - * PENDING: This is an experimental mode yet. - * - * @return See the comment of . - */ - function mappingToExists(existings, newCmptOptions, mode) { - var isNormalMergeMode = mode === 'normalMerge'; - var isReplaceMergeMode = mode === 'replaceMerge'; - var isReplaceAllMode = mode === 'replaceAll'; - existings = existings || []; - newCmptOptions = (newCmptOptions || []).slice(); - var existingIdIdxMap = createHashMap(); - // Validate id and name on user input option. - each(newCmptOptions, function (cmptOption, index) { - if (!isObject(cmptOption)) { - newCmptOptions[index] = null; - return; - } - if ("development" !== 'production') { - // There is some legacy case that name is set as `false`. - // But should work normally rather than throw error. - if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) { - warnInvalidateIdOrName(cmptOption.id); - } - if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) { - warnInvalidateIdOrName(cmptOption.name); - } - } - }); - var result = prepareResult(existings, existingIdIdxMap, mode); - if (isNormalMergeMode || isReplaceMergeMode) { - mappingById(result, existings, existingIdIdxMap, newCmptOptions); - } - if (isNormalMergeMode) { - mappingByName(result, newCmptOptions); - } - if (isNormalMergeMode || isReplaceMergeMode) { - mappingByIndex(result, newCmptOptions, isReplaceMergeMode); - } else if (isReplaceAllMode) { - mappingInReplaceAllMode(result, newCmptOptions); - } - makeIdAndName(result); - // The array `result` MUST NOT contain elided items, otherwise the - // forEach will omit those items and result in incorrect result. - return result; - } - function prepareResult(existings, existingIdIdxMap, mode) { - var result = []; - if (mode === 'replaceAll') { - return result; - } - // Do not use native `map` to in case that the array `existings` - // contains elided items, which will be omitted. - for (var index = 0; index < existings.length; index++) { - var existing = existings[index]; - // Because of replaceMerge, `existing` may be null/undefined. - if (existing && existing.id != null) { - existingIdIdxMap.set(existing.id, index); - } - // For non-internal-componnets: - // Mode "normalMerge": all existings kept. - // Mode "replaceMerge": all existing removed unless mapped by id. - // For internal-components: - // go with "replaceMerge" approach in both mode. - result.push({ - existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing, - newOption: null, - keyInfo: null, - brandNew: null - }); - } - return result; - } - function mappingById(result, existings, existingIdIdxMap, newCmptOptions) { - // Mapping by id if specified. - each(newCmptOptions, function (cmptOption, index) { - if (!cmptOption || cmptOption.id == null) { - return; - } - var optionId = makeComparableKey(cmptOption.id); - var existingIdx = existingIdIdxMap.get(optionId); - if (existingIdx != null) { - var resultItem = result[existingIdx]; - assert(!resultItem.newOption, 'Duplicated option on id "' + optionId + '".'); - resultItem.newOption = cmptOption; - // In both mode, if id matched, new option will be merged to - // the existings rather than creating new component model. - resultItem.existing = existings[existingIdx]; - newCmptOptions[index] = null; - } - }); - } - function mappingByName(result, newCmptOptions) { - // Mapping by name if specified. - each(newCmptOptions, function (cmptOption, index) { - if (!cmptOption || cmptOption.name == null) { - return; - } - for (var i = 0; i < result.length; i++) { - var existing = result[i].existing; - if (!result[i].newOption // Consider name: two map to one. - // Can not match when both ids existing but different. - && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) { - result[i].newOption = cmptOption; - newCmptOptions[index] = null; - return; - } - } - }); - } - function mappingByIndex(result, newCmptOptions, brandNew) { - each(newCmptOptions, function (cmptOption) { - if (!cmptOption) { - return; - } - // Find the first place that not mapped by id and not internal component (consider the "hole"). - var resultItem; - var nextIdx = 0; - while ( - // Be `!resultItem` only when `nextIdx >= result.length`. - (resultItem = result[nextIdx] - // (1) Existing models that already have id should be able to mapped to. Because - // after mapping performed, model will always be assigned with an id if user not given. - // After that all models have id. - // (2) If new option has id, it can only set to a hole or append to the last. It should - // not be merged to the existings with different id. Because id should not be overwritten. - // (3) Name can be overwritten, because axis use name as 'show label text'. - ) && (resultItem.newOption || isComponentIdInternal(resultItem.existing) || - // In mode "replaceMerge", here no not-mapped-non-internal-existing. - resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) { - nextIdx++; - } - if (resultItem) { - resultItem.newOption = cmptOption; - resultItem.brandNew = brandNew; - } else { - result.push({ - newOption: cmptOption, - brandNew: brandNew, - existing: null, - keyInfo: null - }); - } - nextIdx++; - }); - } - function mappingInReplaceAllMode(result, newCmptOptions) { - each(newCmptOptions, function (cmptOption) { - // The feature "reproduce" requires "hole" will also reproduced - // in case that component index referring are broken. - result.push({ - newOption: cmptOption, - brandNew: true, - existing: null, - keyInfo: null - }); - }); - } - /** - * Make id and name for mapping result (result of mappingToExists) - * into `keyInfo` field. - */ - function makeIdAndName(mapResult) { - // We use this id to hash component models and view instances - // in echarts. id can be specified by user, or auto generated. - // The id generation rule ensures new view instance are able - // to mapped to old instance when setOption are called in - // no-merge mode. So we generate model id by name and plus - // type in view id. - // name can be duplicated among components, which is convenient - // to specify multi components (like series) by one name. - // Ensure that each id is distinct. - var idMap = createHashMap(); - each(mapResult, function (item) { - var existing = item.existing; - existing && idMap.set(existing.id, item); - }); - each(mapResult, function (item) { - var opt = item.newOption; - // Force ensure id not duplicated. - assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id)); - opt && opt.id != null && idMap.set(opt.id, item); - !item.keyInfo && (item.keyInfo = {}); - }); - // Make name and id. - each(mapResult, function (item, index) { - var existing = item.existing; - var opt = item.newOption; - var keyInfo = item.keyInfo; - if (!isObject(opt)) { - return; - } - // Name can be overwritten. Consider case: axis.name = '20km'. - // But id generated by name will not be changed, which affect - // only in that case: setOption with 'not merge mode' and view - // instance will be recreated, which can be accepted. - keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name - // Avoid that different series has the same name, - // because name may be used like in color pallet. - : DUMMY_COMPONENT_NAME_PREFIX + index; - if (existing) { - keyInfo.id = makeComparableKey(existing.id); - } else if (opt.id != null) { - keyInfo.id = makeComparableKey(opt.id); - } else { - // Consider this situatoin: - // optionA: [{name: 'a'}, {name: 'a'}, {..}] - // optionB [{..}, {name: 'a'}, {name: 'a'}] - // Series with the same name between optionA and optionB - // should be mapped. - var idNum = 0; - do { - keyInfo.id = '\0' + keyInfo.name + '\0' + idNum++; - } while (idMap.get(keyInfo.id)); - } - idMap.set(keyInfo.id, item); - }); - } - function keyExistAndEqual(attr, obj1, obj2) { - var key1 = convertOptionIdName(obj1[attr], null); - var key2 = convertOptionIdName(obj2[attr], null); - // See `MappingExistingItem`. `id` and `name` trade string equals to number. - return key1 != null && key2 != null && key1 === key2; - } - /** - * @return return null if not exist. - */ - function makeComparableKey(val) { - if ("development" !== 'production') { - if (val == null) { - throw new Error(); - } - } - return convertOptionIdName(val, ''); - } - function convertOptionIdName(idOrName, defaultValue) { - if (idOrName == null) { - return defaultValue; - } - return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + '' : defaultValue; - } - function warnInvalidateIdOrName(idOrName) { - if ("development" !== 'production') { - warn('`' + idOrName + '` is invalid id or name. Must be a string or number.'); - } - } - function isValidIdOrName(idOrName) { - return isStringSafe(idOrName) || isNumeric(idOrName); - } - function isNameSpecified(componentModel) { - var name = componentModel.name; - // Is specified when `indexOf` get -1 or > 0. - return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); - } - /** - * @public - * @param {Object} cmptOption - * @return {boolean} - */ - function isComponentIdInternal(cmptOption) { - return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0; - } - function makeInternalComponentId(idSuffix) { - return INTERNAL_COMPONENT_ID_PREFIX + idSuffix; - } - function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) { - // Set mainType and complete subType. - each(mappingResult, function (item) { - var newOption = item.newOption; - if (isObject(newOption)) { - item.keyInfo.mainType = mainType; - item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor); - } - }); - } - function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) { - var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType - // Use determineSubType only when there is no existComponent. - : componentModelCtor.determineSubType(mainType, newCmptOption); - // tooltip, markline, markpoint may always has no subType - return subType; - } - /** - * A helper for removing duplicate items between batchA and batchB, - * and in themselves, and categorize by series. - * - * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] - * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] - * @return result: [resultBatchA, resultBatchB] - */ - function compressBatches(batchA, batchB) { - var mapA = {}; - var mapB = {}; - makeMap(batchA || [], mapA); - makeMap(batchB || [], mapB, mapA); - return [mapToArray(mapA), mapToArray(mapB)]; - function makeMap(sourceBatch, map, otherMap) { - for (var i = 0, len = sourceBatch.length; i < len; i++) { - var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null); - if (seriesId == null) { - return; - } - var dataIndices = normalizeToArray(sourceBatch[i].dataIndex); - var otherDataIndices = otherMap && otherMap[seriesId]; - for (var j = 0, lenj = dataIndices.length; j < lenj; j++) { - var dataIndex = dataIndices[j]; - if (otherDataIndices && otherDataIndices[dataIndex]) { - otherDataIndices[dataIndex] = null; - } else { - (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1; - } - } - } - } - function mapToArray(map, isData) { - var result = []; - for (var i in map) { - if (map.hasOwnProperty(i) && map[i] != null) { - if (isData) { - result.push(+i); - } else { - var dataIndices = mapToArray(map[i], true); - dataIndices.length && result.push({ - seriesId: i, - dataIndex: dataIndices - }); - } - } - } - return result; - } - } - /** - * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name - * each of which can be Array or primary type. - * @return dataIndex If not found, return undefined/null. - */ - function queryDataIndex(data, payload) { - if (payload.dataIndexInside != null) { - return payload.dataIndexInside; - } else if (payload.dataIndex != null) { - return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) { - return data.indexOfRawIndex(value); - }) : data.indexOfRawIndex(payload.dataIndex); - } else if (payload.name != null) { - return isArray(payload.name) ? map(payload.name, function (value) { - return data.indexOfName(value); - }) : data.indexOfName(payload.name); - } - } - /** - * Enable property storage to any host object. - * Notice: Serialization is not supported. - * - * For example: - * let inner = zrUitl.makeInner(); - * - * function some1(hostObj) { - * inner(hostObj).someProperty = 1212; - * ... - * } - * function some2() { - * let fields = inner(this); - * fields.someProperty1 = 1212; - * fields.someProperty2 = 'xx'; - * ... - * } - * - * @return {Function} - */ - function makeInner() { - var key = '__ec_inner_' + innerUniqueIndex++; - return function (hostObj) { - return hostObj[key] || (hostObj[key] = {}); - }; - } - var innerUniqueIndex = getRandomIdBase(); - /** - * The same behavior as `component.getReferringComponents`. - */ - function parseFinder(ecModel, finderInput, opt) { - var _a = preParseFinder(finderInput, opt), - mainTypeSpecified = _a.mainTypeSpecified, - queryOptionMap = _a.queryOptionMap, - others = _a.others; - var result = others; - var defaultMainType = opt ? opt.defaultMainType : null; - if (!mainTypeSpecified && defaultMainType) { - queryOptionMap.set(defaultMainType, {}); - } - queryOptionMap.each(function (queryOption, mainType) { - var queryResult = queryReferringComponents(ecModel, mainType, queryOption, { - useDefault: defaultMainType === mainType, - enableAll: opt && opt.enableAll != null ? opt.enableAll : true, - enableNone: opt && opt.enableNone != null ? opt.enableNone : true - }); - result[mainType + 'Models'] = queryResult.models; - result[mainType + 'Model'] = queryResult.models[0]; - }); - return result; - } - function preParseFinder(finderInput, opt) { - var finder; - if (isString(finderInput)) { - var obj = {}; - obj[finderInput + 'Index'] = 0; - finder = obj; - } else { - finder = finderInput; - } - var queryOptionMap = createHashMap(); - var others = {}; - var mainTypeSpecified = false; - each(finder, function (value, key) { - // Exclude 'dataIndex' and other illgal keys. - if (key === 'dataIndex' || key === 'dataIndexInside') { - others[key] = value; - return; - } - var parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || []; - var mainType = parsedKey[1]; - var queryType = (parsedKey[2] || '').toLowerCase(); - if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) { - return; - } - mainTypeSpecified = mainTypeSpecified || !!mainType; - var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {}); - queryOption[queryType] = value; - }); - return { - mainTypeSpecified: mainTypeSpecified, - queryOptionMap: queryOptionMap, - others: others - }; - } - var SINGLE_REFERRING = { - useDefault: true, - enableAll: false, - enableNone: false - }; - var MULTIPLE_REFERRING = { - useDefault: false, - enableAll: true, - enableNone: true - }; - function queryReferringComponents(ecModel, mainType, userOption, opt) { - opt = opt || SINGLE_REFERRING; - var indexOption = userOption.index; - var idOption = userOption.id; - var nameOption = userOption.name; - var result = { - models: null, - specified: indexOption != null || idOption != null || nameOption != null - }; - if (!result.specified) { - // Use the first as default if `useDefault`. - var firstCmpt = void 0; - result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : []; - return result; - } - if (indexOption === 'none' || indexOption === false) { - assert(opt.enableNone, '`"none"` or `false` is not a valid value on index option.'); - result.models = []; - return result; - } - // `queryComponents` will return all components if - // both all of index/id/name are null/undefined. - if (indexOption === 'all') { - assert(opt.enableAll, '`"all"` is not a valid value on index option.'); - indexOption = idOption = nameOption = null; - } - result.models = ecModel.queryComponents({ - mainType: mainType, - index: indexOption, - id: idOption, - name: nameOption - }); - return result; - } - function setAttribute(dom, key, value) { - dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value; - } - function getAttribute(dom, key) { - return dom.getAttribute ? dom.getAttribute(key) : dom[key]; - } - function getTooltipRenderMode(renderModeOption) { - if (renderModeOption === 'auto') { - // Using html when `document` exists, use richText otherwise - return env.domSupported ? 'html' : 'richText'; - } else { - return renderModeOption || 'html'; - } - } - /** - * Group a list by key. - */ - function groupData(array, getKey // return key - ) { - var buckets = createHashMap(); - var keys = []; - each(array, function (item) { - var key = getKey(item); - (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item); - }); - return { - keys: keys, - buckets: buckets - }; - } - /** - * Interpolate raw values of a series with percent - * - * @param data data - * @param labelModel label model of the text element - * @param sourceValue start value. May be null/undefined when init. - * @param targetValue end value - * @param percent 0~1 percentage; 0 uses start value while 1 uses end value - * @return interpolated values - * If `sourceValue` and `targetValue` are `number`, return `number`. - * If `sourceValue` and `targetValue` are `string`, return `string`. - * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`. - * Other cases do not supported. - */ - function interpolateRawValues(data, precision, sourceValue, targetValue, percent) { - var isAutoPrecision = precision == null || precision === 'auto'; - if (targetValue == null) { - return targetValue; - } - if (isNumber(targetValue)) { - var value = interpolateNumber$1(sourceValue || 0, targetValue, percent); - return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision); - } else if (isString(targetValue)) { - return percent < 1 ? sourceValue : targetValue; - } else { - var interpolated = []; - var leftArr = sourceValue; - var rightArr = targetValue; - var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length); - for (var i = 0; i < length_1; ++i) { - var info = data.getDimensionInfo(i); - // Don't interpolate ordinal dims - if (info && info.type === 'ordinal') { - // In init, there is no `sourceValue`, but should better not to get undefined result. - interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i]; - } else { - var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0; - var rightVal = rightArr[i]; - var value = interpolateNumber$1(leftVal, rightVal, percent); - interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision); - } - } - return interpolated; - } - } - - var TYPE_DELIMITER = '.'; - var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___'; - var IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___'; - /** - * Notice, parseClassType('') should returns {main: '', sub: ''} - * @public - */ - function parseClassType(componentType) { - var ret = { - main: '', - sub: '' - }; - if (componentType) { - var typeArr = componentType.split(TYPE_DELIMITER); - ret.main = typeArr[0] || ''; - ret.sub = typeArr[1] || ''; - } - return ret; - } - /** - * @public - */ - function checkClassType(componentType) { - assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal'); - } - function isExtendedClass(clz) { - return !!(clz && clz[IS_EXTENDED_CLASS]); - } - /** - * Implements `ExtendableConstructor` for `rootClz`. - * - * @usage - * ```ts - * class Xxx {} - * type XxxConstructor = typeof Xxx & ExtendableConstructor - * enableClassExtend(Xxx as XxxConstructor); - * ``` - */ - function enableClassExtend(rootClz, mandatoryMethods) { - rootClz.$constructor = rootClz; // FIXME: not necessary? - rootClz.extend = function (proto) { - if ("development" !== 'production') { - each(mandatoryMethods, function (method) { - if (!proto[method]) { - console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.'); - } - }); - } - var superClass = this; - var ExtendedClass; - if (isESClass(superClass)) { - ExtendedClass = /** @class */function (_super) { - __extends(class_1, _super); - function class_1() { - return _super.apply(this, arguments) || this; - } - return class_1; - }(superClass); - } else { - // For backward compat, we both support ts class inheritance and this - // "extend" approach. - // The constructor should keep the same behavior as ts class inheritance: - // If this constructor/$constructor is not declared, auto invoke the super - // constructor. - // If this constructor/$constructor is declared, it is responsible for - // calling the super constructor. - ExtendedClass = function () { - (proto.$constructor || superClass).apply(this, arguments); - }; - inherits(ExtendedClass, this); - } - extend(ExtendedClass.prototype, proto); - ExtendedClass[IS_EXTENDED_CLASS] = true; - ExtendedClass.extend = this.extend; - ExtendedClass.superCall = superCall; - ExtendedClass.superApply = superApply; - ExtendedClass.superClass = superClass; - return ExtendedClass; - }; - } - function isESClass(fn) { - return isFunction(fn) && /^class\s/.test(Function.prototype.toString.call(fn)); - } - /** - * A work around to both support ts extend and this extend mechanism. - * on sub-class. - * @usage - * ```ts - * class Component { ... } - * classUtil.enableClassExtend(Component); - * classUtil.enableClassManagement(Component, {registerWhenExtend: true}); - * - * class Series extends Component { ... } - * // Without calling `markExtend`, `registerWhenExtend` will not work. - * Component.markExtend(Series); - * ``` - */ - function mountExtend(SubClz, SupperClz) { - SubClz.extend = SupperClz.extend; - } - // A random offset. - var classBase = Math.round(Math.random() * 10); - /** - * Implements `CheckableConstructor` for `target`. - * Can not use instanceof, consider different scope by - * cross domain or es module import in ec extensions. - * Mount a method "isInstance()" to Clz. - * - * @usage - * ```ts - * class Xxx {} - * type XxxConstructor = typeof Xxx & CheckableConstructor; - * enableClassCheck(Xxx as XxxConstructor) - * ``` - */ - function enableClassCheck(target) { - var classAttr = ['__\0is_clz', classBase++].join('_'); - target.prototype[classAttr] = true; - if ("development" !== 'production') { - assert(!target.isInstance, 'The method "is" can not be defined.'); - } - target.isInstance = function (obj) { - return !!(obj && obj[classAttr]); - }; - } - // superCall should have class info, which can not be fetched from 'this'. - // Consider this case: - // class A has method f, - // class B inherits class A, overrides method f, f call superApply('f'), - // class C inherits class B, does not override method f, - // then when method of class C is called, dead loop occurred. - function superCall(context, methodName) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return this.superClass.prototype[methodName].apply(context, args); - } - function superApply(context, methodName, args) { - return this.superClass.prototype[methodName].apply(context, args); - } - /** - * Implements `ClassManager` for `target` - * - * @usage - * ```ts - * class Xxx {} - * type XxxConstructor = typeof Xxx & ClassManager - * enableClassManagement(Xxx as XxxConstructor); - * ``` - */ - function enableClassManagement(target) { - /** - * Component model classes - * key: componentType, - * value: - * componentClass, when componentType is 'a' - * or Object., when componentType is 'a.b' - */ - var storage = {}; - target.registerClass = function (clz) { - // `type` should not be a "instance member". - // If using TS class, should better declared as `static type = 'series.pie'`. - // otherwise users have to mount `type` on prototype manually. - // For backward compat and enable instance visit type via `this.type`, - // we still support fetch `type` from prototype. - var componentFullType = clz.type || clz.prototype.type; - if (componentFullType) { - checkClassType(componentFullType); - // If only static type declared, we assign it to prototype mandatorily. - clz.prototype.type = componentFullType; - var componentTypeInfo = parseClassType(componentFullType); - if (!componentTypeInfo.sub) { - if ("development" !== 'production') { - if (storage[componentTypeInfo.main]) { - console.warn(componentTypeInfo.main + ' exists.'); - } - } - storage[componentTypeInfo.main] = clz; - } else if (componentTypeInfo.sub !== IS_CONTAINER) { - var container = makeContainer(componentTypeInfo); - container[componentTypeInfo.sub] = clz; - } - } - return clz; - }; - target.getClass = function (mainType, subType, throwWhenNotFound) { - var clz = storage[mainType]; - if (clz && clz[IS_CONTAINER]) { - clz = subType ? clz[subType] : null; - } - if (throwWhenNotFound && !clz) { - throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.'); - } - return clz; - }; - target.getClassesByMainType = function (componentType) { - var componentTypeInfo = parseClassType(componentType); - var result = []; - var obj = storage[componentTypeInfo.main]; - if (obj && obj[IS_CONTAINER]) { - each(obj, function (o, type) { - type !== IS_CONTAINER && result.push(o); - }); - } else { - result.push(obj); - } - return result; - }; - target.hasClass = function (componentType) { - // Just consider componentType.main. - var componentTypeInfo = parseClassType(componentType); - return !!storage[componentTypeInfo.main]; - }; - /** - * @return Like ['aa', 'bb'], but can not be ['aa.xx'] - */ - target.getAllClassMainTypes = function () { - var types = []; - each(storage, function (obj, type) { - types.push(type); - }); - return types; - }; - /** - * If a main type is container and has sub types - */ - target.hasSubTypes = function (componentType) { - var componentTypeInfo = parseClassType(componentType); - var obj = storage[componentTypeInfo.main]; - return obj && obj[IS_CONTAINER]; - }; - function makeContainer(componentTypeInfo) { - var container = storage[componentTypeInfo.main]; - if (!container || !container[IS_CONTAINER]) { - container = storage[componentTypeInfo.main] = {}; - container[IS_CONTAINER] = true; - } - return container; - } - } - // /** - // * @param {string|Array.} properties - // */ - // export function setReadOnly(obj, properties) { - // FIXME It seems broken in IE8 simulation of IE11 - // if (!zrUtil.isArray(properties)) { - // properties = properties != null ? [properties] : []; - // } - // zrUtil.each(properties, function (prop) { - // let value = obj[prop]; - // Object.defineProperty - // && Object.defineProperty(obj, prop, { - // value: value, writable: false - // }); - // zrUtil.isArray(obj[prop]) - // && Object.freeze - // && Object.freeze(obj[prop]); - // }); - // } - - function makeStyleMapper(properties, ignoreParent) { - // Normalize - for (var i = 0; i < properties.length; i++) { - if (!properties[i][1]) { - properties[i][1] = properties[i][0]; - } - } - ignoreParent = ignoreParent || false; - return function (model, excludes, includes) { - var style = {}; - for (var i = 0; i < properties.length; i++) { - var propName = properties[i][1]; - if (excludes && indexOf(excludes, propName) >= 0 || includes && indexOf(includes, propName) < 0) { - continue; - } - var val = model.getShallow(propName, ignoreParent); - if (val != null) { - style[properties[i][0]] = val; - } - } - // TODO Text or image? - return style; - }; - } - - var AREA_STYLE_KEY_MAP = [['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor'] - // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. - ]; - - var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP); - var AreaStyleMixin = /** @class */function () { - function AreaStyleMixin() {} - AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) { - return getAreaStyle(this, excludes, includes); - }; - return AreaStyleMixin; - }(); - - var globalImageCache = new LRU(50); - function findExistImage(newImageOrSrc) { - if (typeof newImageOrSrc === 'string') { - var cachedImgObj = globalImageCache.get(newImageOrSrc); - return cachedImgObj && cachedImgObj.image; - } - else { - return newImageOrSrc; - } - } - function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) { - if (!newImageOrSrc) { - return image; - } - else if (typeof newImageOrSrc === 'string') { - if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) { - return image; - } - var cachedImgObj = globalImageCache.get(newImageOrSrc); - var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload }; - if (cachedImgObj) { - image = cachedImgObj.image; - !isImageReady(image) && cachedImgObj.pending.push(pendingWrap); - } - else { - image = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad); - image.__zrImageSrc = newImageOrSrc; - globalImageCache.put(newImageOrSrc, image.__cachedImgObj = { - image: image, - pending: [pendingWrap] - }); - } - return image; - } - 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; - } - - var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g; - function truncateText(text, containerWidth, font, ellipsis, options) { - if (!containerWidth) { - return ''; - } - var textLines = (text + '').split('\n'); - options = prepareTruncateOptions(containerWidth, font, ellipsis, options); - 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 = options || {}; - var preparedOpts = extend({}, options); - preparedOpts.font = font; - ellipsis = retrieve2(ellipsis, '...'); - preparedOpts.maxIterations = retrieve2(options.maxIterations, 2); - var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0); - preparedOpts.cnCharWidth = getWidth('国', font); - var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font); - preparedOpts.placeholder = retrieve2(options.placeholder, ''); - var contentWidth = containerWidth = Math.max(0, containerWidth - 1); - 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; - preparedOpts.ellipsis = ellipsis; - preparedOpts.ellipsisWidth = ellipsisWidth; - preparedOpts.contentWidth = contentWidth; - preparedOpts.containerWidth = containerWidth; - return preparedOpts; - } - 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; - } - function parsePlainText(text, style) { - text != null && (text += ''); - var overflow = style.overflow; - var padding = style.padding; - var font = style.font; - var truncate = overflow === 'truncate'; - var calculatedLineHeight = getLineHeight(font); - var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight); - var bgColorDrawn = !!(style.backgroundColor); - var truncateLineOverflow = style.lineOverflow === 'truncate'; - var width = style.width; - var lines; - if (width != null && (overflow === 'break' || overflow === 'breakAll')) { - lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : []; - } - else { - lines = text ? text.split('\n') : []; - } - var contentHeight = lines.length * lineHeight; - var height = retrieve2(style.height, contentHeight); - if (contentHeight > height && truncateLineOverflow) { - var lineCount = Math.floor(height / lineHeight); - lines = lines.slice(0, lineCount); - } - if (text && truncate && width != null) { - var options = prepareTruncateOptions(width, font, style.ellipsis, { - minChar: style.truncateMinChar, - placeholder: style.placeholder - }); - for (var i = 0; i < lines.length; i++) { - lines[i] = truncateSingleLine(lines[i], options); - } - } - var outerHeight = height; - var contentWidth = 0; - for (var i = 0; i < lines.length; i++) { - contentWidth = Math.max(getWidth(lines[i], font), contentWidth); - } - if (width == null) { - width = contentWidth; - } - var outerWidth = contentWidth; - if (padding) { - outerHeight += padding[0] + padding[2]; - outerWidth += padding[1] + padding[3]; - width += padding[1] + padding[3]; - } - if (bgColorDrawn) { - outerWidth = width; - } - return { - lines: lines, - height: height, - outerWidth: outerWidth, - outerHeight: outerHeight, - lineHeight: lineHeight, - calculatedLineHeight: calculatedLineHeight, - contentWidth: contentWidth, - contentHeight: contentHeight, - width: width - }; - } - var RichTextToken = (function () { - function RichTextToken() { - } - return RichTextToken; - }()); - var RichTextLine = (function () { - function RichTextLine(tokens) { - this.tokens = []; - if (tokens) { - this.tokens = tokens; - } - } - return RichTextLine; - }()); - var RichTextContentBlock = (function () { - function RichTextContentBlock() { - this.width = 0; - this.height = 0; - this.contentWidth = 0; - this.contentHeight = 0; - this.outerWidth = 0; - this.outerHeight = 0; - this.lines = []; - } - return RichTextContentBlock; - }()); - function parseRichText(text, style) { - var contentBlock = new RichTextContentBlock(); - text != null && (text += ''); - if (!text) { - return contentBlock; - } - var topWidth = style.width; - var topHeight = style.height; - var overflow = style.overflow; - var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null - ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' } - : null; - 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), style, wrapInfo); - } - pushTokens(contentBlock, result[2], style, wrapInfo, result[1]); - lastIndex = STYLE_REG.lastIndex; - } - if (lastIndex < text.length) { - pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo); - } - var pendingList = []; - var calculatedHeight = 0; - var calculatedWidth = 0; - var stlPadding = style.padding; - var truncate = overflow === 'truncate'; - var truncateLine = style.lineOverflow === 'truncate'; - function finishLine(line, lineWidth, lineHeight) { - line.width = lineWidth; - line.lineHeight = lineHeight; - calculatedHeight += lineHeight; - calculatedWidth = Math.max(calculatedWidth, lineWidth); - } - outer: for (var i = 0; i < contentBlock.lines.length; i++) { - var line = contentBlock.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] || {}; - var textPadding = token.textPadding = tokenStyle.padding; - var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0; - var font = token.font = tokenStyle.font || style.font; - token.contentHeight = getLineHeight(font); - var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight); - token.innerHeight = tokenHeight; - textPadding && (tokenHeight += textPadding[0] + textPadding[2]); - token.height = tokenHeight; - token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight); - token.align = tokenStyle && tokenStyle.align || style.align; - token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle'; - if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) { - if (j > 0) { - line.tokens = line.tokens.slice(0, j); - finishLine(line, lineWidth, lineHeight); - contentBlock.lines = contentBlock.lines.slice(0, i + 1); - } - else { - contentBlock.lines = contentBlock.lines.slice(0, i); - } - break outer; - } - var styleTokenWidth = tokenStyle.width; - var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto'; - if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') { - token.percentWidth = styleTokenWidth; - pendingList.push(token); - token.contentWidth = getWidth(token.text, font); - } - else { - if (tokenWidthNotSpecified) { - var textBackgroundColor = tokenStyle.backgroundColor; - var bgImg = textBackgroundColor && textBackgroundColor.image; - if (bgImg) { - bgImg = findExistImage(bgImg); - if (isImageReady(bgImg)) { - token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height); - } - } - } - var remainTruncWidth = truncate && topWidth != null - ? topWidth - lineWidth : null; - if (remainTruncWidth != null && remainTruncWidth < token.width) { - if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) { - token.text = ''; - token.width = token.contentWidth = 0; - } - else { - token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar }); - token.width = token.contentWidth = getWidth(token.text, font); - } - } - else { - token.contentWidth = getWidth(token.text, font); - } - } - token.width += paddingH; - lineWidth += token.width; - tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight)); - } - finishLine(line, lineWidth, lineHeight); - } - contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth); - contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight); - contentBlock.contentHeight = calculatedHeight; - contentBlock.contentWidth = calculatedWidth; - 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; - token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width; - } - return contentBlock; - } - function pushTokens(block, str, style, wrapInfo, styleName) { - var isEmptyStr = str === ''; - var tokenStyle = styleName && style.rich[styleName] || {}; - var lines = block.lines; - var font = tokenStyle.font || style.font; - var newLine = false; - var strLines; - var linesWidths; - if (wrapInfo) { - var tokenPadding = tokenStyle.padding; - var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0; - if (tokenStyle.width != null && tokenStyle.width !== 'auto') { - var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH; - if (lines.length > 0) { - if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) { - strLines = str.split('\n'); - newLine = true; - } - } - wrapInfo.accumWidth = outerWidth_1; - } - else { - var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth); - wrapInfo.accumWidth = res.accumWidth + tokenPaddingH; - linesWidths = res.linesWidths; - strLines = res.lines; - } - } - else { - strLines = str.split('\n'); - } - for (var i = 0; i < strLines.length; i++) { - var text = strLines[i]; - var token = new RichTextToken(); - token.styleName = styleName; - token.text = text; - token.isLineHolder = !text && !isEmptyStr; - if (typeof tokenStyle.width === 'number') { - token.width = tokenStyle.width; - } - else { - token.width = linesWidths - ? linesWidths[i] - : getWidth(text, font); - } - if (!i && !newLine) { - var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens; - var tokensLen = tokens.length; - (tokensLen === 1 && tokens[0].isLineHolder) - ? (tokens[0] = token) - : ((text || !tokensLen || isEmptyStr) && tokens.push(token)); - } - else { - lines.push(new RichTextLine([token])); - } - } - } - function isAlphabeticLetter(ch) { - var code = ch.charCodeAt(0); - return code >= 0x20 && code <= 0x24F - || code >= 0x370 && code <= 0x10FF - || code >= 0x1200 && code <= 0x13FF - || code >= 0x1E00 && code <= 0x206F; - } - var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) { - obj[ch] = true; - return obj; - }, {}); - function isWordBreakChar(ch) { - if (isAlphabeticLetter(ch)) { - if (breakCharMap[ch]) { - return true; - } - return false; - } - return true; - } - function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) { - var lines = []; - var linesWidths = []; - var line = ''; - var currentWord = ''; - var currentWordWidth = 0; - var accumWidth = 0; - for (var i = 0; i < text.length; i++) { - var ch = text.charAt(i); - if (ch === '\n') { - if (currentWord) { - line += currentWord; - accumWidth += currentWordWidth; - } - lines.push(line); - linesWidths.push(accumWidth); - line = ''; - currentWord = ''; - currentWordWidth = 0; - accumWidth = 0; - continue; - } - var chWidth = getWidth(ch, font); - var inWord = isBreakAll ? false : !isWordBreakChar(ch); - if (!lines.length - ? lastAccumWidth + accumWidth + chWidth > lineWidth - : accumWidth + chWidth > lineWidth) { - if (!accumWidth) { - if (inWord) { - lines.push(currentWord); - linesWidths.push(currentWordWidth); - currentWord = ch; - currentWordWidth = chWidth; - } - else { - lines.push(ch); - linesWidths.push(chWidth); - } - } - else if (line || currentWord) { - if (inWord) { - if (!line) { - line = currentWord; - currentWord = ''; - currentWordWidth = 0; - accumWidth = currentWordWidth; - } - lines.push(line); - linesWidths.push(accumWidth - currentWordWidth); - currentWord += ch; - currentWordWidth += chWidth; - line = ''; - accumWidth = currentWordWidth; - } - else { - if (currentWord) { - line += currentWord; - currentWord = ''; - currentWordWidth = 0; - } - lines.push(line); - linesWidths.push(accumWidth); - line = ch; - accumWidth = chWidth; - } - } - continue; - } - accumWidth += chWidth; - if (inWord) { - currentWord += ch; - currentWordWidth += chWidth; - } - else { - if (currentWord) { - line += currentWord; - currentWord = ''; - currentWordWidth = 0; - } - line += ch; - } - } - if (!lines.length && !line) { - line = text; - currentWord = ''; - currentWordWidth = 0; - } - if (currentWord) { - line += currentWord; - } - if (line) { - lines.push(line); - linesWidths.push(accumWidth); - } - if (lines.length === 1) { - accumWidth += lastAccumWidth; - } - return { - accumWidth: accumWidth, - lines: lines, - linesWidths: linesWidths - }; - } - - var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10)); - var DEFAULT_COMMON_STYLE = { - shadowBlur: 0, - shadowOffsetX: 0, - shadowOffsetY: 0, - shadowColor: '#000', - opacity: 1, - blend: 'source-over' - }; - var DEFAULT_COMMON_ANIMATION_PROPS = { - style: { - shadowBlur: true, - shadowOffsetX: true, - shadowOffsetY: true, - shadowColor: true, - opacity: true - } - }; - DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true; - var PRIMARY_STATES_KEYS$1 = ['z', 'z2', 'invisible']; - var PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ['invisible']; - var Displayable = (function (_super) { - __extends(Displayable, _super); - function Displayable(props) { - return _super.call(this, props) || this; - } - Displayable.prototype._init = function (props) { - var keysArr = keys(props); - for (var i = 0; i < keysArr.length; i++) { - var key = keysArr[i]; - if (key === 'style') { - this.useStyle(props[key]); - } - else { - _super.prototype.attrKV.call(this, key, props[key]); - } - } - if (!this.style) { - this.useStyle({}); - } - }; - Displayable.prototype.beforeBrush = function () { }; - Displayable.prototype.afterBrush = function () { }; - Displayable.prototype.innerBeforeBrush = function () { }; - Displayable.prototype.innerAfterBrush = function () { }; - Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) { - var m = this.transform; - if (this.ignore - || this.invisible - || this.style.opacity === 0 - || (this.culling - && isDisplayableCulled(this, viewWidth, viewHeight)) - || (m && !m[0] && !m[3])) { - return false; - } - if (considerClipPath && this.__clipPaths) { - for (var i = 0; i < this.__clipPaths.length; ++i) { - if (this.__clipPaths[i].isZeroArea()) { - return false; - } - } - } - if (considerAncestors && this.parent) { - var parent_1 = this.parent; - while (parent_1) { - if (parent_1.ignore) { - return false; - } - parent_1 = parent_1.parent; - } - } - return true; - }; - Displayable.prototype.contain = function (x, y) { - return this.rectContain(x, y); - }; - Displayable.prototype.traverse = function (cb, context) { - cb.call(context, this); - }; - Displayable.prototype.rectContain = function (x, y) { - var coord = this.transformCoordToLocal(x, y); - var rect = this.getBoundingRect(); - return rect.contain(coord[0], coord[1]); - }; - Displayable.prototype.getPaintRect = function () { - var rect = this._paintRect; - if (!this._paintRect || this.__dirty) { - var transform = this.transform; - var elRect = this.getBoundingRect(); - var style = this.style; - var shadowSize = style.shadowBlur || 0; - var shadowOffsetX = style.shadowOffsetX || 0; - var shadowOffsetY = style.shadowOffsetY || 0; - rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0)); - if (transform) { - BoundingRect.applyTransform(rect, elRect, transform); - } - else { - rect.copy(elRect); - } - if (shadowSize || shadowOffsetX || shadowOffsetY) { - rect.width += shadowSize * 2 + Math.abs(shadowOffsetX); - rect.height += shadowSize * 2 + Math.abs(shadowOffsetY); - rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize); - rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize); - } - var tolerance = this.dirtyRectTolerance; - if (!rect.isZero()) { - rect.x = Math.floor(rect.x - tolerance); - rect.y = Math.floor(rect.y - tolerance); - rect.width = Math.ceil(rect.width + 1 + tolerance * 2); - rect.height = Math.ceil(rect.height + 1 + tolerance * 2); - } - } - return rect; - }; - Displayable.prototype.setPrevPaintRect = function (paintRect) { - if (paintRect) { - this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0); - this._prevPaintRect.copy(paintRect); - } - else { - this._prevPaintRect = null; - } - }; - Displayable.prototype.getPrevPaintRect = function () { - return this._prevPaintRect; - }; - Displayable.prototype.animateStyle = function (loop) { - return this.animate('style', loop); - }; - Displayable.prototype.updateDuringAnimation = function (targetKey) { - if (targetKey === 'style') { - this.dirtyStyle(); - } - else { - this.markRedraw(); - } - }; - Displayable.prototype.attrKV = function (key, value) { - if (key !== 'style') { - _super.prototype.attrKV.call(this, key, value); - } - else { - if (!this.style) { - this.useStyle(value); - } - else { - this.setStyle(value); - } - } - }; - Displayable.prototype.setStyle = function (keyOrObj, value) { - if (typeof keyOrObj === 'string') { - this.style[keyOrObj] = value; - } - else { - extend(this.style, keyOrObj); - } - this.dirtyStyle(); - return this; - }; - Displayable.prototype.dirtyStyle = function (notRedraw) { - if (!notRedraw) { - this.markRedraw(); - } - this.__dirty |= STYLE_CHANGED_BIT; - if (this._rect) { - this._rect = null; - } - }; - Displayable.prototype.dirty = function () { - this.dirtyStyle(); - }; - Displayable.prototype.styleChanged = function () { - return !!(this.__dirty & STYLE_CHANGED_BIT); - }; - Displayable.prototype.styleUpdated = function () { - this.__dirty &= ~STYLE_CHANGED_BIT; - }; - Displayable.prototype.createStyle = function (obj) { - return createObject(DEFAULT_COMMON_STYLE, obj); - }; - Displayable.prototype.useStyle = function (obj) { - if (!obj[STYLE_MAGIC_KEY]) { - obj = this.createStyle(obj); - } - if (this.__inHover) { - this.__hoverStyle = obj; - } - else { - this.style = obj; - } - this.dirtyStyle(); - }; - Displayable.prototype.isStyleObject = function (obj) { - return obj[STYLE_MAGIC_KEY]; - }; - Displayable.prototype._innerSaveToNormal = function (toState) { - _super.prototype._innerSaveToNormal.call(this, toState); - var normalState = this._normalState; - if (toState.style && !normalState.style) { - normalState.style = this._mergeStyle(this.createStyle(), this.style); - } - this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1); - }; - Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) { - _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg); - var needsRestoreToNormal = !(state && keepCurrentStates); - var targetStyle; - if (state && state.style) { - if (transition) { - if (keepCurrentStates) { - targetStyle = state.style; - } - else { - targetStyle = this._mergeStyle(this.createStyle(), normalState.style); - this._mergeStyle(targetStyle, state.style); - } - } - else { - targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style); - this._mergeStyle(targetStyle, state.style); - } - } - else if (needsRestoreToNormal) { - targetStyle = normalState.style; - } - if (targetStyle) { - if (transition) { - var sourceStyle = this.style; - this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle); - if (needsRestoreToNormal) { - var changedKeys = keys(sourceStyle); - for (var i = 0; i < changedKeys.length; i++) { - var key = changedKeys[i]; - if (key in targetStyle) { - targetStyle[key] = targetStyle[key]; - this.style[key] = sourceStyle[key]; - } - } - } - var targetKeys = keys(targetStyle); - for (var i = 0; i < targetKeys.length; i++) { - var key = targetKeys[i]; - this.style[key] = this.style[key]; - } - this._transitionState(stateName, { - style: targetStyle - }, animationCfg, this.getAnimationStyleProps()); - } - else { - this.useStyle(targetStyle); - } - } - var statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS$1; - for (var i = 0; i < statesKeys.length; i++) { - var key = statesKeys[i]; - if (state && state[key] != null) { - this[key] = state[key]; - } - else if (needsRestoreToNormal) { - if (normalState[key] != null) { - this[key] = normalState[key]; - } - } - } - }; - Displayable.prototype._mergeStates = function (states) { - var mergedState = _super.prototype._mergeStates.call(this, states); - var mergedStyle; - for (var i = 0; i < states.length; i++) { - var state = states[i]; - if (state.style) { - mergedStyle = mergedStyle || {}; - this._mergeStyle(mergedStyle, state.style); - } - } - if (mergedStyle) { - mergedState.style = mergedStyle; - } - return mergedState; - }; - Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) { - extend(targetStyle, sourceStyle); - return targetStyle; - }; - Displayable.prototype.getAnimationStyleProps = function () { - return DEFAULT_COMMON_ANIMATION_PROPS; - }; - Displayable.initDefaultProps = (function () { - var dispProto = Displayable.prototype; - dispProto.type = 'displayable'; - dispProto.invisible = false; - dispProto.z = 0; - dispProto.z2 = 0; - dispProto.zlevel = 0; - dispProto.culling = false; - dispProto.cursor = 'pointer'; - dispProto.rectHover = false; - dispProto.incremental = false; - dispProto._rect = null; - dispProto.dirtyRectTolerance = 0; - dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT; - })(); - return Displayable; - }(Element)); - var tmpRect$1 = new BoundingRect(0, 0, 0, 0); - var viewRect = new BoundingRect(0, 0, 0, 0); - function isDisplayableCulled(el, width, height) { - tmpRect$1.copy(el.getBoundingRect()); - if (el.transform) { - tmpRect$1.applyTransform(el.transform); - } - viewRect.width = width; - viewRect.height = height; - return !tmpRect$1.intersect(viewRect); - } - - var mathMin$1 = Math.min; - var mathMax$1 = Math.max; - var mathSin = Math.sin; - var mathCos = Math.cos; - var PI2 = Math.PI * 2; - var start = create(); - var end = create(); - var extremity = create(); - function fromPoints(points, min, max) { - if (points.length === 0) { - return; - } - var p = points[0]; - var left = p[0]; - var right = p[0]; - var top = p[1]; - var bottom = p[1]; - for (var i = 1; i < points.length; i++) { - p = points[i]; - left = mathMin$1(left, p[0]); - right = mathMax$1(right, p[0]); - top = mathMin$1(top, p[1]); - bottom = mathMax$1(bottom, p[1]); - } - min[0] = left; - min[1] = top; - max[0] = right; - max[1] = bottom; - } - function fromLine(x0, y0, x1, y1, min, max) { - min[0] = mathMin$1(x0, x1); - min[1] = mathMin$1(y0, y1); - max[0] = mathMax$1(x0, x1); - max[1] = mathMax$1(y0, y1); - } - var xDim = []; - var yDim = []; - function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) { - var cubicExtrema$1 = cubicExtrema; - var cubicAt$1 = cubicAt; - var n = cubicExtrema$1(x0, x1, x2, x3, xDim); - min[0] = Infinity; - min[1] = Infinity; - max[0] = -Infinity; - max[1] = -Infinity; - for (var i = 0; i < n; i++) { - var x = cubicAt$1(x0, x1, x2, x3, xDim[i]); - min[0] = mathMin$1(x, min[0]); - max[0] = mathMax$1(x, max[0]); - } - n = cubicExtrema$1(y0, y1, y2, y3, yDim); - for (var i = 0; i < n; i++) { - var y = cubicAt$1(y0, y1, y2, y3, yDim[i]); - min[1] = mathMin$1(y, min[1]); - max[1] = mathMax$1(y, max[1]); - } - min[0] = mathMin$1(x0, min[0]); - max[0] = mathMax$1(x0, max[0]); - min[0] = mathMin$1(x3, min[0]); - max[0] = mathMax$1(x3, max[0]); - min[1] = mathMin$1(y0, min[1]); - max[1] = mathMax$1(y0, max[1]); - min[1] = mathMin$1(y3, min[1]); - max[1] = mathMax$1(y3, max[1]); - } - function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) { - var quadraticExtremum$1 = quadraticExtremum; - var quadraticAt$1 = quadraticAt; - var tx = mathMax$1(mathMin$1(quadraticExtremum$1(x0, x1, x2), 1), 0); - var ty = mathMax$1(mathMin$1(quadraticExtremum$1(y0, y1, y2), 1), 0); - var x = quadraticAt$1(x0, x1, x2, tx); - var y = quadraticAt$1(y0, y1, y2, ty); - min[0] = mathMin$1(x0, x2, x); - min[1] = mathMin$1(y0, y2, y); - max[0] = mathMax$1(x0, x2, x); - max[1] = mathMax$1(y0, y2, y); - } - function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min$1, max$1) { - var vec2Min = min; - var vec2Max = max; - var diff = Math.abs(startAngle - endAngle); - if (diff % PI2 < 1e-4 && diff > 1e-4) { - min$1[0] = x - rx; - min$1[1] = y - ry; - max$1[0] = x + rx; - max$1[1] = y + ry; - return; - } - start[0] = mathCos(startAngle) * rx + x; - start[1] = mathSin(startAngle) * ry + y; - end[0] = mathCos(endAngle) * rx + x; - end[1] = mathSin(endAngle) * ry + y; - vec2Min(min$1, start, end); - vec2Max(max$1, start, end); - startAngle = startAngle % (PI2); - if (startAngle < 0) { - startAngle = startAngle + PI2; - } - endAngle = endAngle % (PI2); - if (endAngle < 0) { - endAngle = endAngle + PI2; - } - if (startAngle > endAngle && !anticlockwise) { - endAngle += PI2; - } - else if (startAngle < endAngle && anticlockwise) { - startAngle += PI2; - } - if (anticlockwise) { - var tmp = endAngle; - endAngle = startAngle; - startAngle = tmp; - } - for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { - if (angle > startAngle) { - extremity[0] = mathCos(angle) * rx + x; - extremity[1] = mathSin(angle) * ry + y; - vec2Min(min$1, extremity, min$1); - vec2Max(max$1, extremity, max$1); - } - } - } - - var CMD = { - M: 1, - L: 2, - C: 3, - Q: 4, - A: 5, - Z: 6, - R: 7 - }; - var tmpOutX = []; - var tmpOutY = []; - var min$1 = []; - var max$1 = []; - var min2 = []; - var max2 = []; - var mathMin$2 = Math.min; - var mathMax$2 = Math.max; - var mathCos$1 = Math.cos; - var mathSin$1 = Math.sin; - var mathAbs = Math.abs; - var PI = Math.PI; - var PI2$1 = PI * 2; - var hasTypedArray = typeof Float32Array !== 'undefined'; - var tmpAngles = []; - function modPI2(radian) { - var n = Math.round(radian / PI * 1e8) / 1e8; - return (n % 2) * PI; - } - function normalizeArcAngles(angles, anticlockwise) { - var newStartAngle = modPI2(angles[0]); - if (newStartAngle < 0) { - newStartAngle += PI2$1; - } - var delta = newStartAngle - angles[0]; - var newEndAngle = angles[1]; - newEndAngle += delta; - if (!anticlockwise && newEndAngle - newStartAngle >= PI2$1) { - newEndAngle = newStartAngle + PI2$1; - } - else if (anticlockwise && newStartAngle - newEndAngle >= PI2$1) { - newEndAngle = newStartAngle - PI2$1; - } - else if (!anticlockwise && newStartAngle > newEndAngle) { - newEndAngle = newStartAngle + (PI2$1 - modPI2(newStartAngle - newEndAngle)); - } - else if (anticlockwise && newStartAngle < newEndAngle) { - newEndAngle = newStartAngle - (PI2$1 - modPI2(newEndAngle - newStartAngle)); - } - angles[0] = newStartAngle; - angles[1] = newEndAngle; - } - var PathProxy = (function () { - function PathProxy(notSaveData) { - this.dpr = 1; - this._xi = 0; - this._yi = 0; - this._x0 = 0; - this._y0 = 0; - this._len = 0; - if (notSaveData) { - this._saveData = false; - } - if (this._saveData) { - this.data = []; - } - } - PathProxy.prototype.increaseVersion = function () { - this._version++; - }; - PathProxy.prototype.getVersion = function () { - return this._version; - }; - PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) { - segmentIgnoreThreshold = segmentIgnoreThreshold || 0; - if (segmentIgnoreThreshold > 0) { - this._ux = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sx) || 0; - this._uy = mathAbs(segmentIgnoreThreshold / devicePixelRatio / sy) || 0; - } - }; - PathProxy.prototype.setDPR = function (dpr) { - this.dpr = dpr; - }; - PathProxy.prototype.setContext = function (ctx) { - this._ctx = ctx; - }; - PathProxy.prototype.getContext = function () { - return this._ctx; - }; - PathProxy.prototype.beginPath = function () { - this._ctx && this._ctx.beginPath(); - this.reset(); - return this; - }; - PathProxy.prototype.reset = function () { - if (this._saveData) { - this._len = 0; - } - if (this._pathSegLen) { - this._pathSegLen = null; - this._pathLen = 0; - } - this._version++; - }; - PathProxy.prototype.moveTo = function (x, y) { - this._drawPendingPt(); - this.addData(CMD.M, x, y); - this._ctx && this._ctx.moveTo(x, y); - this._x0 = x; - this._y0 = y; - this._xi = x; - this._yi = y; - return this; - }; - PathProxy.prototype.lineTo = function (x, y) { - var dx = mathAbs(x - this._xi); - var dy = mathAbs(y - this._yi); - var exceedUnit = dx > this._ux || dy > this._uy; - this.addData(CMD.L, x, y); - if (this._ctx && exceedUnit) { - this._ctx.lineTo(x, y); - } - if (exceedUnit) { - this._xi = x; - this._yi = y; - this._pendingPtDist = 0; - } - else { - var d2 = dx * dx + dy * dy; - if (d2 > this._pendingPtDist) { - this._pendingPtX = x; - this._pendingPtY = y; - this._pendingPtDist = d2; - } - } - return this; - }; - PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { - this._drawPendingPt(); - this.addData(CMD.C, x1, y1, x2, y2, x3, y3); - if (this._ctx) { - this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); - } - this._xi = x3; - this._yi = y3; - return this; - }; - PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { - this._drawPendingPt(); - this.addData(CMD.Q, x1, y1, x2, y2); - if (this._ctx) { - this._ctx.quadraticCurveTo(x1, y1, x2, y2); - } - this._xi = x2; - this._yi = y2; - return this; - }; - PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { - this._drawPendingPt(); - tmpAngles[0] = startAngle; - tmpAngles[1] = endAngle; - normalizeArcAngles(tmpAngles, anticlockwise); - startAngle = tmpAngles[0]; - endAngle = tmpAngles[1]; - var delta = endAngle - startAngle; - this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1); - this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); - this._xi = mathCos$1(endAngle) * r + cx; - this._yi = mathSin$1(endAngle) * r + cy; - return this; - }; - PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { - this._drawPendingPt(); - if (this._ctx) { - this._ctx.arcTo(x1, y1, x2, y2, radius); - } - return this; - }; - PathProxy.prototype.rect = function (x, y, w, h) { - this._drawPendingPt(); - this._ctx && this._ctx.rect(x, y, w, h); - this.addData(CMD.R, x, y, w, h); - return this; - }; - PathProxy.prototype.closePath = function () { - this._drawPendingPt(); - this.addData(CMD.Z); - var ctx = this._ctx; - var x0 = this._x0; - var y0 = this._y0; - if (ctx) { - ctx.closePath(); - } - this._xi = x0; - this._yi = y0; - return this; - }; - PathProxy.prototype.fill = function (ctx) { - ctx && ctx.fill(); - this.toStatic(); - }; - PathProxy.prototype.stroke = function (ctx) { - ctx && ctx.stroke(); - this.toStatic(); - }; - PathProxy.prototype.len = function () { - return this._len; - }; - PathProxy.prototype.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; - }; - PathProxy.prototype.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; - }; - PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) { - if (!this._saveData) { - return; - } - var data = this.data; - if (this._len + arguments.length > data.length) { - this._expandData(); - data = this.data; - } - for (var i = 0; i < arguments.length; i++) { - data[this._len++] = arguments[i]; - } - }; - PathProxy.prototype._drawPendingPt = function () { - if (this._pendingPtDist > 0) { - this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY); - this._pendingPtDist = 0; - } - }; - PathProxy.prototype._expandData = function () { - if (!(this.data instanceof Array)) { - var newData = []; - for (var i = 0; i < this._len; i++) { - newData[i] = this.data[i]; - } - this.data = newData; - } - }; - PathProxy.prototype.toStatic = function () { - if (!this._saveData) { - return; - } - this._drawPendingPt(); - var data = this.data; - if (data instanceof Array) { - data.length = this._len; - if (hasTypedArray && this._len > 11) { - this.data = new Float32Array(data); - } - } - }; - PathProxy.prototype.getBoundingRect = function () { - min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE; - max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE; - var data = this.data; - var xi = 0; - var yi = 0; - var x0 = 0; - var y0 = 0; - var i; - for (i = 0; i < this._len;) { - var cmd = data[i++]; - var isFirst = i === 1; - if (isFirst) { - xi = data[i]; - yi = data[i + 1]; - x0 = xi; - y0 = yi; - } - switch (cmd) { - case CMD.M: - xi = x0 = data[i++]; - yi = y0 = data[i++]; - min2[0] = x0; - min2[1] = y0; - max2[0] = x0; - max2[1] = y0; - break; - case CMD.L: - fromLine(xi, yi, data[i], data[i + 1], min2, max2); - xi = data[i++]; - yi = data[i++]; - break; - case CMD.C: - 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: - fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2); - xi = data[i++]; - yi = data[i++]; - break; - case CMD.A: - 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; - i += 1; - var anticlockwise = !data[i++]; - if (isFirst) { - x0 = mathCos$1(startAngle) * rx + cx; - y0 = mathSin$1(startAngle) * ry + cy; - } - fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2); - xi = mathCos$1(endAngle) * rx + cx; - yi = mathSin$1(endAngle) * ry + cy; - break; - case CMD.R: - x0 = xi = data[i++]; - y0 = yi = data[i++]; - var width = data[i++]; - var height = data[i++]; - fromLine(x0, y0, x0 + width, y0 + height, min2, max2); - break; - case CMD.Z: - xi = x0; - yi = y0; - break; - } - min(min$1, min$1, min2); - max(max$1, max$1, max2); - } - if (i === 0) { - min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0; - } - return new BoundingRect(min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1]); - }; - PathProxy.prototype._calculateLength = function () { - var data = this.data; - var len = this._len; - var ux = this._ux; - var uy = this._uy; - var xi = 0; - var yi = 0; - var x0 = 0; - var y0 = 0; - if (!this._pathSegLen) { - this._pathSegLen = []; - } - var pathSegLen = this._pathSegLen; - var pathTotalLen = 0; - var segCount = 0; - for (var i = 0; i < len;) { - var cmd = data[i++]; - var isFirst = i === 1; - if (isFirst) { - xi = data[i]; - yi = data[i + 1]; - x0 = xi; - y0 = yi; - } - var l = -1; - switch (cmd) { - case CMD.M: - xi = x0 = data[i++]; - yi = y0 = data[i++]; - break; - case CMD.L: { - var x2 = data[i++]; - var y2 = data[i++]; - var dx = x2 - xi; - var dy = y2 - yi; - if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) { - l = Math.sqrt(dx * dx + dy * dy); - xi = x2; - yi = y2; - } - break; - } - case CMD.C: { - var x1 = data[i++]; - var y1 = data[i++]; - var x2 = data[i++]; - var y2 = data[i++]; - var x3 = data[i++]; - var y3 = data[i++]; - l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10); - xi = x3; - yi = y3; - break; - } - case CMD.Q: { - var x1 = data[i++]; - var y1 = data[i++]; - var x2 = data[i++]; - var y2 = data[i++]; - l = quadraticLength(xi, yi, x1, y1, x2, y2, 10); - xi = x2; - yi = y2; - break; - } - case CMD.A: - var cx = data[i++]; - var cy = data[i++]; - var rx = data[i++]; - var ry = data[i++]; - var startAngle = data[i++]; - var delta = data[i++]; - var endAngle = delta + startAngle; - i += 1; - if (isFirst) { - x0 = mathCos$1(startAngle) * rx + cx; - y0 = mathSin$1(startAngle) * ry + cy; - } - l = mathMax$2(rx, ry) * mathMin$2(PI2$1, Math.abs(delta)); - xi = mathCos$1(endAngle) * rx + cx; - yi = mathSin$1(endAngle) * ry + cy; - break; - case CMD.R: { - x0 = xi = data[i++]; - y0 = yi = data[i++]; - var width = data[i++]; - var height = data[i++]; - l = width * 2 + height * 2; - break; - } - case CMD.Z: { - var dx = x0 - xi; - var dy = y0 - yi; - l = Math.sqrt(dx * dx + dy * dy); - xi = x0; - yi = y0; - break; - } - } - if (l >= 0) { - pathSegLen[segCount++] = l; - pathTotalLen += l; - } - } - this._pathLen = pathTotalLen; - return pathTotalLen; - }; - PathProxy.prototype.rebuildPath = function (ctx, percent) { - var d = this.data; - var ux = this._ux; - var uy = this._uy; - var len = this._len; - var x0; - var y0; - var xi; - var yi; - var x; - var y; - var drawPart = percent < 1; - var pathSegLen; - var pathTotalLen; - var accumLength = 0; - var segCount = 0; - var displayedLength; - var pendingPtDist = 0; - var pendingPtX; - var pendingPtY; - if (drawPart) { - if (!this._pathSegLen) { - this._calculateLength(); - } - pathSegLen = this._pathSegLen; - pathTotalLen = this._pathLen; - displayedLength = percent * pathTotalLen; - if (!displayedLength) { - return; - } - } - lo: for (var i = 0; i < len;) { - var cmd = d[i++]; - var isFirst = i === 1; - if (isFirst) { - xi = d[i]; - yi = d[i + 1]; - x0 = xi; - y0 = yi; - } - if (cmd !== CMD.L && pendingPtDist > 0) { - ctx.lineTo(pendingPtX, pendingPtY); - pendingPtDist = 0; - } - 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++]; - var dx = mathAbs(x - xi); - var dy = mathAbs(y - yi); - if (dx > ux || dy > uy) { - if (drawPart) { - var l = pathSegLen[segCount++]; - if (accumLength + l > displayedLength) { - var t = (displayedLength - accumLength) / l; - ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t); - break lo; - } - accumLength += l; - } - ctx.lineTo(x, y); - xi = x; - yi = y; - pendingPtDist = 0; - } - else { - var d2 = dx * dx + dy * dy; - if (d2 > pendingPtDist) { - pendingPtX = x; - pendingPtY = y; - pendingPtDist = d2; - } - } - break; - } - case CMD.C: { - var x1 = d[i++]; - var y1 = d[i++]; - var x2 = d[i++]; - var y2 = d[i++]; - var x3 = d[i++]; - var y3 = d[i++]; - if (drawPart) { - var l = pathSegLen[segCount++]; - if (accumLength + l > displayedLength) { - var t = (displayedLength - accumLength) / l; - cubicSubdivide(xi, x1, x2, x3, t, tmpOutX); - cubicSubdivide(yi, y1, y2, y3, t, tmpOutY); - ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]); - break lo; - } - accumLength += l; - } - ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); - xi = x3; - yi = y3; - break; - } - case CMD.Q: { - var x1 = d[i++]; - var y1 = d[i++]; - var x2 = d[i++]; - var y2 = d[i++]; - if (drawPart) { - var l = pathSegLen[segCount++]; - if (accumLength + l > displayedLength) { - var t = (displayedLength - accumLength) / l; - quadraticSubdivide(xi, x1, x2, t, tmpOutX); - quadraticSubdivide(yi, y1, y2, t, tmpOutY); - ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]); - break lo; - } - accumLength += l; - } - ctx.quadraticCurveTo(x1, y1, x2, y2); - xi = x2; - yi = y2; - break; - } - case CMD.A: - var cx = d[i++]; - var cy = d[i++]; - var rx = d[i++]; - var ry = d[i++]; - var startAngle = d[i++]; - var delta = d[i++]; - var psi = d[i++]; - var anticlockwise = !d[i++]; - var r = (rx > ry) ? rx : ry; - var isEllipse = mathAbs(rx - ry) > 1e-3; - var endAngle = startAngle + delta; - var breakBuild = false; - if (drawPart) { - var l = pathSegLen[segCount++]; - if (accumLength + l > displayedLength) { - endAngle = startAngle + delta * (displayedLength - accumLength) / l; - breakBuild = true; - } - accumLength += l; - } - if (isEllipse && ctx.ellipse) { - ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise); - } - else { - ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); - } - if (breakBuild) { - break lo; - } - if (isFirst) { - x0 = mathCos$1(startAngle) * rx + cx; - y0 = mathSin$1(startAngle) * ry + cy; - } - xi = mathCos$1(endAngle) * rx + cx; - yi = mathSin$1(endAngle) * ry + cy; - break; - case CMD.R: - x0 = xi = d[i]; - y0 = yi = d[i + 1]; - x = d[i++]; - y = d[i++]; - var width = d[i++]; - var height = d[i++]; - if (drawPart) { - var l = pathSegLen[segCount++]; - if (accumLength + l > displayedLength) { - var d_1 = displayedLength - accumLength; - ctx.moveTo(x, y); - ctx.lineTo(x + mathMin$2(d_1, width), y); - d_1 -= width; - if (d_1 > 0) { - ctx.lineTo(x + width, y + mathMin$2(d_1, height)); - } - d_1 -= height; - if (d_1 > 0) { - ctx.lineTo(x + mathMax$2(width - d_1, 0), y + height); - } - d_1 -= width; - if (d_1 > 0) { - ctx.lineTo(x, y + mathMax$2(height - d_1, 0)); - } - break lo; - } - accumLength += l; - } - ctx.rect(x, y, width, height); - break; - case CMD.Z: - if (drawPart) { - var l = pathSegLen[segCount++]; - if (accumLength + l > displayedLength) { - var t = (displayedLength - accumLength) / l; - ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t); - break lo; - } - accumLength += l; - } - ctx.closePath(); - xi = x0; - yi = y0; - } - } - }; - PathProxy.prototype.clone = function () { - var newProxy = new PathProxy(); - var data = this.data; - newProxy.data = data.slice ? data.slice() - : Array.prototype.slice.call(data); - newProxy._len = this._len; - return newProxy; - }; - PathProxy.CMD = CMD; - PathProxy.initDefaultProps = (function () { - var proto = PathProxy.prototype; - proto._saveData = true; - proto._ux = 0; - proto._uy = 0; - proto._pendingPtDist = 0; - proto._version = 0; - })(); - return PathProxy; - }()); - - function containStroke(x0, y0, x1, y1, lineWidth, x, y) { - if (lineWidth === 0) { - return false; - } - var _l = lineWidth; - var _a = 0; - var _b = x0; - if ((y > y0 + _l && y > y1 + _l) - || (y < y0 - _l && y < y1 - _l) - || (x > x0 + _l && x > x1 + _l) - || (x < x0 - _l && x < x1 - _l)) { - return false; - } - if (x0 !== x1) { - _a = (y0 - y1) / (x0 - x1); - _b = (x0 * y1 - x1 * y0) / (x0 - x1); - } - else { - return Math.abs(x - x0) <= _l / 2; - } - var tmp = _a * x - y + _b; - var _s = tmp * tmp / (_a * _a + 1); - return _s <= _l / 2 * _l / 2; - } - - function containStroke$1(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) { - if (lineWidth === 0) { - return false; - } - var _l = lineWidth; - if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) - || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) - || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) - || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) { - return false; - } - var d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null); - return d <= _l / 2; - } - - function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) { - if (lineWidth === 0) { - return false; - } - var _l = lineWidth; - 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; - } - - var PI2$2 = Math.PI * 2; - function normalizeRadian(angle) { - angle %= PI2$2; - if (angle < 0) { - angle += PI2$2; - } - return angle; - } - - var PI2$3 = Math.PI * 2; - function containStroke$3(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$3 < 1e-4) { - 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$3; - } - var angle = Math.atan2(y, x); - if (angle < 0) { - angle += PI2$3; - } - return (angle >= startAngle && angle <= endAngle) - || (angle + PI2$3 >= startAngle && angle + PI2$3 <= endAngle); - } - - function windingLine(x0, y0, x1, y1, x, y) { - if ((y > y0 && y > y1) || (y < y0 && y < y1)) { - return 0; - } - if (y1 === y0) { - return 0; - } - var t = (y - y0) / (y1 - y0); - var dir = y1 < y0 ? 1 : -1; - if (t === 1 || t === 0) { - dir = y1 < y0 ? 0.5 : -0.5; - } - var x_ = t * (x1 - x0) + x0; - return x_ === x ? Infinity : x_ > x ? dir : 0; - } - - var CMD$1 = PathProxy.CMD; - var PI2$4 = Math.PI * 2; - var EPSILON$3 = 1e-4; - function isAroundEqual(a, b) { - return Math.abs(a - b) < EPSILON$3; - } - 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) { - if ((y > y0 && y > y1 && y > y2 && y > y3) - || (y < y0 && y < y1 && y < y2 && y < y3)) { - return 0; - } - var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots); - if (nRoots === 0) { - return 0; - } - else { - var w = 0; - var nExtrema = -1; - var y0_ = void 0; - var y1_ = void 0; - for (var i = 0; i < nRoots; i++) { - var t = roots[i]; - var unit = (t === 0 || t === 1) ? 0.5 : 1; - var x_ = cubicAt(x0, x1, x2, x3, t); - if (x_ < x) { - continue; - } - if (nExtrema < 0) { - nExtrema = cubicExtrema(y0, y1, y2, y3, extrema); - if (extrema[1] < extrema[0] && nExtrema > 1) { - swapExtrema(); - } - y0_ = cubicAt(y0, y1, y2, y3, extrema[0]); - if (nExtrema > 1) { - y1_ = 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) { - if ((y > y0 && y > y1 && y > y2) - || (y < y0 && y < y1 && y < y2)) { - return 0; - } - var nRoots = quadraticRootAt(y0, y1, y2, y, roots); - if (nRoots === 0) { - return 0; - } - else { - var t = quadraticExtremum(y0, y1, y2); - if (t >= 0 && t <= 1) { - var w = 0; - var y_ = quadraticAt(y0, y1, y2, t); - for (var i = 0; i < nRoots; i++) { - var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1; - var x_ = quadraticAt(x0, x1, x2, roots[i]); - if (x_ < x) { - continue; - } - if (roots[i] < t) { - w += y_ < y0 ? unit : -unit; - } - else { - w += y2 < y_ ? unit : -unit; - } - } - return w; - } - else { - var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1; - var x_ = quadraticAt(x0, x1, x2, roots[0]); - if (x_ < x) { - return 0; - } - return y2 < y0 ? unit : -unit; - } - } - } - 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 dTheta = Math.abs(startAngle - endAngle); - if (dTheta < 1e-4) { - return 0; - } - if (dTheta >= PI2$4 - 1e-4) { - startAngle = 0; - endAngle = PI2$4; - var dir = anticlockwise ? 1 : -1; - if (x >= roots[0] + cx && x <= roots[1] + cx) { - return dir; - } - else { - return 0; - } - } - if (startAngle > endAngle) { - var tmp_1 = startAngle; - startAngle = endAngle; - endAngle = tmp_1; - } - if (startAngle < 0) { - startAngle += PI2$4; - endAngle += PI2$4; - } - 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$4 + angle; - } - if ((angle >= startAngle && angle <= endAngle) - || (angle + PI2$4 >= startAngle && angle + PI2$4 <= endAngle)) { - if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { - dir = -dir; - } - w += dir; - } - } - } - return w; - } - function containPath(path, lineWidth, isStroke, x, y) { - var data = path.data; - var len = path.len(); - var w = 0; - var xi = 0; - var yi = 0; - var x0 = 0; - var y0 = 0; - var x1; - var y1; - for (var i = 0; i < len;) { - var cmd = data[i++]; - var isFirst = i === 1; - if (cmd === CMD$1.M && i > 1) { - if (!isStroke) { - w += windingLine(xi, yi, x0, y0, x, y); - } - } - if (isFirst) { - xi = data[i]; - yi = data[i + 1]; - x0 = xi; - y0 = yi; - } - switch (cmd) { - case CMD$1.M: - x0 = data[i++]; - y0 = data[i++]; - xi = x0; - yi = y0; - break; - case CMD$1.L: - if (isStroke) { - if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) { - return true; - } - } - else { - w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0; - } - xi = data[i++]; - yi = data[i++]; - break; - case CMD$1.C: - if (isStroke) { - if (containStroke$1(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$1.Q: - if (isStroke) { - if (containStroke$2(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$1.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++]; - i += 1; - var anticlockwise = !!(1 - data[i++]); - x1 = Math.cos(theta) * rx + cx; - y1 = Math.sin(theta) * ry + cy; - if (!isFirst) { - w += windingLine(xi, yi, x1, y1, x, y); - } - else { - x0 = x1; - y0 = y1; - } - var _x = (x - cx) * ry / rx + cx; - if (isStroke) { - if (containStroke$3(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$1.R: - x0 = xi = data[i++]; - y0 = yi = data[i++]; - var width = data[i++]; - var height = data[i++]; - x1 = x0 + width; - y1 = y0 + height; - if (isStroke) { - if (containStroke(x0, y0, x1, y0, lineWidth, x, y) - || containStroke(x1, y0, x1, y1, lineWidth, x, y) - || containStroke(x1, y1, x0, y1, lineWidth, x, y) - || containStroke(x0, y1, x0, y0, lineWidth, x, y)) { - return true; - } - } - else { - w += windingLine(x1, y0, x1, y1, x, y); - w += windingLine(x0, y1, x0, y0, x, y); - } - break; - case CMD$1.Z: - if (isStroke) { - if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) { - return true; - } - } - else { - w += windingLine(xi, yi, x0, y0, x, y); - } - xi = x0; - yi = y0; - break; - } - } - if (!isStroke && !isAroundEqual(yi, y0)) { - w += windingLine(xi, yi, x0, y0, x, y) || 0; - } - return w !== 0; - } - function contain(pathProxy, x, y) { - return containPath(pathProxy, 0, false, x, y); - } - function containStroke$4(pathProxy, lineWidth, x, y) { - return containPath(pathProxy, lineWidth, true, x, y); - } - - var DEFAULT_PATH_STYLE = defaults({ - fill: '#000', - stroke: null, - strokePercent: 1, - fillOpacity: 1, - strokeOpacity: 1, - lineDashOffset: 0, - lineWidth: 1, - lineCap: 'butt', - miterLimit: 10, - strokeNoScale: false, - strokeFirst: false - }, DEFAULT_COMMON_STYLE); - var DEFAULT_PATH_ANIMATION_PROPS = { - style: defaults({ - fill: true, - stroke: true, - strokePercent: true, - fillOpacity: true, - strokeOpacity: true, - lineDashOffset: true, - lineWidth: true, - miterLimit: true - }, DEFAULT_COMMON_ANIMATION_PROPS.style) - }; - var pathCopyParams = TRANSFORMABLE_PROPS.concat(['invisible', - 'culling', 'z', 'z2', 'zlevel', 'parent' - ]); - var Path = (function (_super) { - __extends(Path, _super); - function Path(opts) { - return _super.call(this, opts) || this; - } - Path.prototype.update = function () { - var _this = this; - _super.prototype.update.call(this); - var style = this.style; - if (style.decal) { - var decalEl = this._decalEl = this._decalEl || new Path(); - if (decalEl.buildPath === Path.prototype.buildPath) { - decalEl.buildPath = function (ctx) { - _this.buildPath(ctx, _this.shape); - }; - } - decalEl.silent = true; - var decalElStyle = decalEl.style; - for (var key in style) { - if (decalElStyle[key] !== style[key]) { - decalElStyle[key] = style[key]; - } - } - decalElStyle.fill = style.fill ? style.decal : null; - decalElStyle.decal = null; - decalElStyle.shadowColor = null; - style.strokeFirst && (decalElStyle.stroke = null); - for (var i = 0; i < pathCopyParams.length; ++i) { - decalEl[pathCopyParams[i]] = this[pathCopyParams[i]]; - } - decalEl.__dirty |= REDRAW_BIT; - } - else if (this._decalEl) { - this._decalEl = null; - } - }; - Path.prototype.getDecalElement = function () { - return this._decalEl; - }; - Path.prototype._init = function (props) { - var keysArr = keys(props); - this.shape = this.getDefaultShape(); - var defaultStyle = this.getDefaultStyle(); - if (defaultStyle) { - this.useStyle(defaultStyle); - } - for (var i = 0; i < keysArr.length; i++) { - var key = keysArr[i]; - var value = props[key]; - if (key === 'style') { - if (!this.style) { - this.useStyle(value); - } - else { - extend(this.style, value); - } - } - else if (key === 'shape') { - extend(this.shape, value); - } - else { - _super.prototype.attrKV.call(this, key, value); - } - } - if (!this.style) { - this.useStyle({}); - } - }; - Path.prototype.getDefaultStyle = function () { - return null; - }; - Path.prototype.getDefaultShape = function () { - return {}; - }; - Path.prototype.canBeInsideText = function () { - return this.hasFill(); - }; - Path.prototype.getInsideTextFill = function () { - var pathFill = this.style.fill; - if (pathFill !== 'none') { - if (isString(pathFill)) { - var fillLum = lum(pathFill, 0); - if (fillLum > 0.5) { - return DARK_LABEL_COLOR; - } - else if (fillLum > 0.2) { - return LIGHTER_LABEL_COLOR; - } - return LIGHT_LABEL_COLOR; - } - else if (pathFill) { - return LIGHT_LABEL_COLOR; - } - } - return DARK_LABEL_COLOR; - }; - Path.prototype.getInsideTextStroke = function (textFill) { - var pathFill = this.style.fill; - if (isString(pathFill)) { - var zr = this.__zr; - var isDarkMode = !!(zr && zr.isDarkMode()); - var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD; - if (isDarkMode === isDarkLabel) { - return pathFill; - } - } - }; - Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { }; - Path.prototype.pathUpdated = function () { - this.__dirty &= ~SHAPE_CHANGED_BIT; - }; - Path.prototype.getUpdatedPathProxy = function (inBatch) { - !this.path && this.createPathProxy(); - this.path.beginPath(); - this.buildPath(this.path, this.shape, inBatch); - return this.path; - }; - Path.prototype.createPathProxy = function () { - this.path = new PathProxy(false); - }; - Path.prototype.hasStroke = function () { - var style = this.style; - var stroke = style.stroke; - return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0)); - }; - Path.prototype.hasFill = function () { - var style = this.style; - var fill = style.fill; - return fill != null && fill !== 'none'; - }; - Path.prototype.getBoundingRect = function () { - var rect = this._rect; - var style = this.style; - var needsUpdateRect = !rect; - if (needsUpdateRect) { - var firstInvoke = false; - if (!this.path) { - firstInvoke = true; - this.createPathProxy(); - } - var path = this.path; - if (firstInvoke || (this.__dirty & SHAPE_CHANGED_BIT)) { - path.beginPath(); - this.buildPath(path, this.shape, false); - this.pathUpdated(); - } - rect = path.getBoundingRect(); - } - this._rect = rect; - if (this.hasStroke() && this.path && this.path.len() > 0) { - var rectStroke = this._rectStroke || (this._rectStroke = rect.clone()); - if (this.__dirty || needsUpdateRect) { - rectStroke.copy(rect); - var lineScale = style.strokeNoScale ? this.getLineScale() : 1; - var w = style.lineWidth; - if (!this.hasFill()) { - var strokeContainThreshold = this.strokeContainThreshold; - w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold); - } - if (lineScale > 1e-10) { - rectStroke.width += w / lineScale; - rectStroke.height += w / lineScale; - rectStroke.x -= w / lineScale / 2; - rectStroke.y -= w / lineScale / 2; - } - } - return rectStroke; - } - return rect; - }; - Path.prototype.contain = function (x, y) { - var localPos = this.transformCoordToLocal(x, y); - var rect = this.getBoundingRect(); - var style = this.style; - x = localPos[0]; - y = localPos[1]; - if (rect.contain(x, y)) { - var pathProxy = this.path; - if (this.hasStroke()) { - var lineWidth = style.lineWidth; - var lineScale = style.strokeNoScale ? this.getLineScale() : 1; - if (lineScale > 1e-10) { - if (!this.hasFill()) { - lineWidth = Math.max(lineWidth, this.strokeContainThreshold); - } - if (containStroke$4(pathProxy, lineWidth / lineScale, x, y)) { - return true; - } - } - } - if (this.hasFill()) { - return contain(pathProxy, x, y); - } - } - return false; - }; - Path.prototype.dirtyShape = function () { - this.__dirty |= SHAPE_CHANGED_BIT; - if (this._rect) { - this._rect = null; - } - if (this._decalEl) { - this._decalEl.dirtyShape(); - } - this.markRedraw(); - }; - Path.prototype.dirty = function () { - this.dirtyStyle(); - this.dirtyShape(); - }; - Path.prototype.animateShape = function (loop) { - return this.animate('shape', loop); - }; - Path.prototype.updateDuringAnimation = function (targetKey) { - if (targetKey === 'style') { - this.dirtyStyle(); - } - else if (targetKey === 'shape') { - this.dirtyShape(); - } - else { - this.markRedraw(); - } - }; - Path.prototype.attrKV = function (key, value) { - if (key === 'shape') { - this.setShape(value); - } - else { - _super.prototype.attrKV.call(this, key, value); - } - }; - Path.prototype.setShape = function (keyOrObj, value) { - var shape = this.shape; - if (!shape) { - shape = this.shape = {}; - } - if (typeof keyOrObj === 'string') { - shape[keyOrObj] = value; - } - else { - extend(shape, keyOrObj); - } - this.dirtyShape(); - return this; - }; - Path.prototype.shapeChanged = function () { - return !!(this.__dirty & SHAPE_CHANGED_BIT); - }; - Path.prototype.createStyle = function (obj) { - return createObject(DEFAULT_PATH_STYLE, obj); - }; - Path.prototype._innerSaveToNormal = function (toState) { - _super.prototype._innerSaveToNormal.call(this, toState); - var normalState = this._normalState; - if (toState.shape && !normalState.shape) { - normalState.shape = extend({}, this.shape); - } - }; - Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) { - _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg); - var needsRestoreToNormal = !(state && keepCurrentStates); - var targetShape; - if (state && state.shape) { - if (transition) { - if (keepCurrentStates) { - targetShape = state.shape; - } - else { - targetShape = extend({}, normalState.shape); - extend(targetShape, state.shape); - } - } - else { - targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape); - extend(targetShape, state.shape); - } - } - else if (needsRestoreToNormal) { - targetShape = normalState.shape; - } - if (targetShape) { - if (transition) { - this.shape = extend({}, this.shape); - var targetShapePrimaryProps = {}; - var shapeKeys = keys(targetShape); - for (var i = 0; i < shapeKeys.length; i++) { - var key = shapeKeys[i]; - if (typeof targetShape[key] === 'object') { - this.shape[key] = targetShape[key]; - } - else { - targetShapePrimaryProps[key] = targetShape[key]; - } - } - this._transitionState(stateName, { - shape: targetShapePrimaryProps - }, animationCfg); - } - else { - this.shape = targetShape; - this.dirtyShape(); - } - } - }; - Path.prototype._mergeStates = function (states) { - var mergedState = _super.prototype._mergeStates.call(this, states); - var mergedShape; - for (var i = 0; i < states.length; i++) { - var state = states[i]; - if (state.shape) { - mergedShape = mergedShape || {}; - this._mergeStyle(mergedShape, state.shape); - } - } - if (mergedShape) { - mergedState.shape = mergedShape; - } - return mergedState; - }; - Path.prototype.getAnimationStyleProps = function () { - return DEFAULT_PATH_ANIMATION_PROPS; - }; - Path.prototype.isZeroArea = function () { - return false; - }; - Path.extend = function (defaultProps) { - var Sub = (function (_super) { - __extends(Sub, _super); - function Sub(opts) { - var _this = _super.call(this, opts) || this; - defaultProps.init && defaultProps.init.call(_this, opts); - return _this; - } - Sub.prototype.getDefaultStyle = function () { - return clone(defaultProps.style); - }; - Sub.prototype.getDefaultShape = function () { - return clone(defaultProps.shape); - }; - return Sub; - }(Path)); - for (var key in defaultProps) { - if (typeof defaultProps[key] === 'function') { - Sub.prototype[key] = defaultProps[key]; - } - } - return Sub; - }; - Path.initDefaultProps = (function () { - var pathProto = Path.prototype; - pathProto.type = 'path'; - pathProto.strokeContainThreshold = 5; - pathProto.segmentIgnoreThreshold = 0; - pathProto.subPixelOptimize = false; - pathProto.autoBatch = false; - pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT; - })(); - return Path; - }(Displayable)); - - var DEFAULT_TSPAN_STYLE = defaults({ - strokeFirst: true, - font: DEFAULT_FONT, - x: 0, - y: 0, - textAlign: 'left', - textBaseline: 'top', - miterLimit: 2 - }, DEFAULT_PATH_STYLE); - var TSpan = (function (_super) { - __extends(TSpan, _super); - function TSpan() { - return _super !== null && _super.apply(this, arguments) || this; - } - TSpan.prototype.hasStroke = function () { - var style = this.style; - var stroke = style.stroke; - return stroke != null && stroke !== 'none' && style.lineWidth > 0; - }; - TSpan.prototype.hasFill = function () { - var style = this.style; - var fill = style.fill; - return fill != null && fill !== 'none'; - }; - TSpan.prototype.createStyle = function (obj) { - return createObject(DEFAULT_TSPAN_STYLE, obj); - }; - TSpan.prototype.setBoundingRect = function (rect) { - this._rect = rect; - }; - TSpan.prototype.getBoundingRect = function () { - var style = this.style; - if (!this._rect) { - var text = style.text; - text != null ? (text += '') : (text = ''); - var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline); - rect.x += style.x || 0; - rect.y += style.y || 0; - if (this.hasStroke()) { - var w = style.lineWidth; - rect.x -= w / 2; - rect.y -= w / 2; - rect.width += w; - rect.height += w; - } - this._rect = rect; - } - return this._rect; - }; - TSpan.initDefaultProps = (function () { - var tspanProto = TSpan.prototype; - tspanProto.dirtyRectTolerance = 10; - })(); - return TSpan; - }(Displayable)); - TSpan.prototype.type = 'tspan'; - - var DEFAULT_IMAGE_STYLE = defaults({ - x: 0, - y: 0 - }, DEFAULT_COMMON_STYLE); - var DEFAULT_IMAGE_ANIMATION_PROPS = { - style: defaults({ - x: true, - y: true, - width: true, - height: true, - sx: true, - sy: true, - sWidth: true, - sHeight: true - }, DEFAULT_COMMON_ANIMATION_PROPS.style) - }; - function isImageLike(source) { - return !!(source - && typeof source !== 'string' - && source.width && source.height); - } - var ZRImage = (function (_super) { - __extends(ZRImage, _super); - function ZRImage() { - return _super !== null && _super.apply(this, arguments) || this; - } - ZRImage.prototype.createStyle = function (obj) { - return createObject(DEFAULT_IMAGE_STYLE, obj); - }; - ZRImage.prototype._getSize = function (dim) { - var style = this.style; - var size = style[dim]; - if (size != null) { - return size; - } - var imageSource = isImageLike(style.image) - ? style.image : this.__image; - if (!imageSource) { - return 0; - } - var otherDim = dim === 'width' ? 'height' : 'width'; - var otherDimSize = style[otherDim]; - if (otherDimSize == null) { - return imageSource[dim]; - } - else { - return imageSource[dim] / imageSource[otherDim] * otherDimSize; - } - }; - ZRImage.prototype.getWidth = function () { - return this._getSize('width'); - }; - ZRImage.prototype.getHeight = function () { - return this._getSize('height'); - }; - ZRImage.prototype.getAnimationStyleProps = function () { - return DEFAULT_IMAGE_ANIMATION_PROPS; - }; - ZRImage.prototype.getBoundingRect = function () { - var style = this.style; - if (!this._rect) { - this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight()); - } - return this._rect; - }; - return ZRImage; - }(Displayable)); - ZRImage.prototype.type = 'image'; - - function buildPath(ctx, shape) { - var x = shape.x; - var y = shape.y; - var width = shape.width; - var height = shape.height; - var r = shape.r; - var r1; - var r2; - var r3; - var r4; - if (width < 0) { - x = x + width; - width = -width; - } - if (height < 0) { - y = y + height; - height = -height; - } - if (typeof r === 'number') { - r1 = r2 = r3 = r4 = r; - } - else if (r instanceof Array) { - if (r.length === 1) { - r1 = r2 = r3 = r4 = r[0]; - } - else if (r.length === 2) { - r1 = r3 = r[0]; - r2 = r4 = r[1]; - } - else if (r.length === 3) { - r1 = r[0]; - r2 = r4 = r[1]; - r3 = r[2]; - } - else { - r1 = r[0]; - r2 = r[1]; - r3 = r[2]; - r4 = r[3]; - } - } - else { - r1 = r2 = r3 = r4 = 0; - } - var total; - if (r1 + r2 > width) { - total = r1 + r2; - r1 *= width / total; - r2 *= width / total; - } - if (r3 + r4 > width) { - total = r3 + r4; - r3 *= width / total; - r4 *= width / total; - } - if (r2 + r3 > height) { - total = r2 + r3; - r2 *= height / total; - r3 *= height / total; - } - if (r1 + r4 > height) { - total = r1 + r4; - r1 *= height / total; - r4 *= height / total; - } - ctx.moveTo(x + r1, y); - ctx.lineTo(x + width - r2, y); - r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0); - ctx.lineTo(x + width, y + height - r3); - r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2); - ctx.lineTo(x + r4, y + height); - r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI); - ctx.lineTo(x, y + r1); - r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5); - } - - var round$1 = Math.round; - function subPixelOptimizeLine(outputShape, inputShape, style) { - if (!inputShape) { - return; - } - var x1 = inputShape.x1; - var x2 = inputShape.x2; - var y1 = inputShape.y1; - var y2 = inputShape.y2; - outputShape.x1 = x1; - outputShape.x2 = x2; - outputShape.y1 = y1; - outputShape.y2 = y2; - var lineWidth = style && style.lineWidth; - if (!lineWidth) { - return outputShape; - } - if (round$1(x1 * 2) === round$1(x2 * 2)) { - outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true); - } - if (round$1(y1 * 2) === round$1(y2 * 2)) { - outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true); - } - return outputShape; - } - function subPixelOptimizeRect(outputShape, inputShape, style) { - if (!inputShape) { - return; - } - var originX = inputShape.x; - var originY = inputShape.y; - var originWidth = inputShape.width; - var originHeight = inputShape.height; - outputShape.x = originX; - outputShape.y = originY; - outputShape.width = originWidth; - outputShape.height = originHeight; - var lineWidth = style && style.lineWidth; - if (!lineWidth) { - return outputShape; - } - outputShape.x = subPixelOptimize(originX, lineWidth, true); - outputShape.y = subPixelOptimize(originY, lineWidth, true); - outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1); - outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1); - return outputShape; - } - function subPixelOptimize(position, lineWidth, positiveOrNegative) { - if (!lineWidth) { - return position; - } - var doubledPosition = round$1(position * 2); - return (doubledPosition + round$1(lineWidth)) % 2 === 0 - ? doubledPosition / 2 - : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2; - } - - var RectShape = (function () { - function RectShape() { - this.x = 0; - this.y = 0; - this.width = 0; - this.height = 0; - } - return RectShape; - }()); - var subPixelOptimizeOutputShape = {}; - var Rect = (function (_super) { - __extends(Rect, _super); - function Rect(opts) { - return _super.call(this, opts) || this; - } - Rect.prototype.getDefaultShape = function () { - return new RectShape(); - }; - Rect.prototype.buildPath = function (ctx, shape) { - var x; - var y; - var width; - var height; - if (this.subPixelOptimize) { - var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style); - x = optimizedShape.x; - y = optimizedShape.y; - width = optimizedShape.width; - height = optimizedShape.height; - optimizedShape.r = shape.r; - shape = optimizedShape; - } - else { - x = shape.x; - y = shape.y; - width = shape.width; - height = shape.height; - } - if (!shape.r) { - ctx.rect(x, y, width, height); - } - else { - buildPath(ctx, shape); - } - }; - Rect.prototype.isZeroArea = function () { - return !this.shape.width || !this.shape.height; - }; - return Rect; - }(Path)); - Rect.prototype.type = 'rect'; - - var DEFAULT_RICH_TEXT_COLOR = { - fill: '#000' - }; - var DEFAULT_STROKE_LINE_WIDTH = 2; - var DEFAULT_TEXT_ANIMATION_PROPS = { - style: defaults({ - fill: true, - stroke: true, - fillOpacity: true, - strokeOpacity: true, - lineWidth: true, - fontSize: true, - lineHeight: true, - width: true, - height: true, - textShadowColor: true, - textShadowBlur: true, - textShadowOffsetX: true, - textShadowOffsetY: true, - backgroundColor: true, - padding: true, - borderColor: true, - borderWidth: true, - borderRadius: true - }, DEFAULT_COMMON_ANIMATION_PROPS.style) - }; - var ZRText = (function (_super) { - __extends(ZRText, _super); - function ZRText(opts) { - var _this = _super.call(this) || this; - _this.type = 'text'; - _this._children = []; - _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR; - _this.attr(opts); - return _this; - } - ZRText.prototype.childrenRef = function () { - return this._children; - }; - ZRText.prototype.update = function () { - _super.prototype.update.call(this); - if (this.styleChanged()) { - this._updateSubTexts(); - } - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - child.zlevel = this.zlevel; - child.z = this.z; - child.z2 = this.z2; - child.culling = this.culling; - child.cursor = this.cursor; - child.invisible = this.invisible; - } - }; - ZRText.prototype.updateTransform = function () { - var innerTransformable = this.innerTransformable; - if (innerTransformable) { - innerTransformable.updateTransform(); - if (innerTransformable.transform) { - this.transform = innerTransformable.transform; - } - } - else { - _super.prototype.updateTransform.call(this); - } - }; - ZRText.prototype.getLocalTransform = function (m) { - var innerTransformable = this.innerTransformable; - return innerTransformable - ? innerTransformable.getLocalTransform(m) - : _super.prototype.getLocalTransform.call(this, m); - }; - ZRText.prototype.getComputedTransform = function () { - if (this.__hostTarget) { - this.__hostTarget.getComputedTransform(); - this.__hostTarget.updateInnerText(true); - } - return _super.prototype.getComputedTransform.call(this); - }; - ZRText.prototype._updateSubTexts = function () { - this._childCursor = 0; - normalizeTextStyle(this.style); - this.style.rich - ? this._updateRichTexts() - : this._updatePlainTexts(); - this._children.length = this._childCursor; - this.styleUpdated(); - }; - ZRText.prototype.addSelfToZr = function (zr) { - _super.prototype.addSelfToZr.call(this, zr); - for (var i = 0; i < this._children.length; i++) { - this._children[i].__zr = zr; - } - }; - ZRText.prototype.removeSelfFromZr = function (zr) { - _super.prototype.removeSelfFromZr.call(this, zr); - for (var i = 0; i < this._children.length; i++) { - this._children[i].__zr = null; - } - }; - ZRText.prototype.getBoundingRect = function () { - if (this.styleChanged()) { - this._updateSubTexts(); - } - if (!this._rect) { - var tmpRect = new BoundingRect(0, 0, 0, 0); - var children = this._children; - var tmpMat = []; - var rect = null; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - var childRect = child.getBoundingRect(); - var transform = child.getLocalTransform(tmpMat); - if (transform) { - tmpRect.copy(childRect); - tmpRect.applyTransform(transform); - rect = rect || tmpRect.clone(); - rect.union(tmpRect); - } - else { - rect = rect || childRect.clone(); - rect.union(childRect); - } - } - this._rect = rect || tmpRect; - } - return this._rect; - }; - ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) { - this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR; - }; - ZRText.prototype.setTextContent = function (textContent) { - if ("development" !== 'production') { - throw new Error('Can\'t attach text on another text'); - } - }; - ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) { - if (!sourceStyle) { - return targetStyle; - } - var sourceRich = sourceStyle.rich; - var targetRich = targetStyle.rich || (sourceRich && {}); - extend(targetStyle, sourceStyle); - if (sourceRich && targetRich) { - this._mergeRich(targetRich, sourceRich); - targetStyle.rich = targetRich; - } - else if (targetRich) { - targetStyle.rich = targetRich; - } - return targetStyle; - }; - ZRText.prototype._mergeRich = function (targetRich, sourceRich) { - var richNames = keys(sourceRich); - for (var i = 0; i < richNames.length; i++) { - var richName = richNames[i]; - targetRich[richName] = targetRich[richName] || {}; - extend(targetRich[richName], sourceRich[richName]); - } - }; - ZRText.prototype.getAnimationStyleProps = function () { - return DEFAULT_TEXT_ANIMATION_PROPS; - }; - ZRText.prototype._getOrCreateChild = function (Ctor) { - var child = this._children[this._childCursor]; - if (!child || !(child instanceof Ctor)) { - child = new Ctor(); - } - this._children[this._childCursor++] = child; - child.__zr = this.__zr; - child.parent = this; - return child; - }; - ZRText.prototype._updatePlainTexts = function () { - var style = this.style; - var textFont = style.font || DEFAULT_FONT; - var textPadding = style.padding; - var text = getStyleText(style); - var contentBlock = parsePlainText(text, style); - var needDrawBg = needDrawBackground(style); - var bgColorDrawn = !!(style.backgroundColor); - var outerHeight = contentBlock.outerHeight; - var outerWidth = contentBlock.outerWidth; - var contentWidth = contentBlock.contentWidth; - var textLines = contentBlock.lines; - var lineHeight = contentBlock.lineHeight; - var defaultStyle = this._defaultStyle; - var baseX = style.x || 0; - var baseY = style.y || 0; - var textAlign = style.align || defaultStyle.align || 'left'; - var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top'; - var textX = baseX; - var textY = adjustTextY$1(baseY, contentBlock.contentHeight, verticalAlign); - if (needDrawBg || textPadding) { - var boxX = adjustTextX(baseX, outerWidth, textAlign); - var boxY = adjustTextY$1(baseY, outerHeight, verticalAlign); - needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight); - } - textY += lineHeight / 2; - if (textPadding) { - textX = getTextXForPadding(baseX, textAlign, textPadding); - if (verticalAlign === 'top') { - textY += textPadding[0]; - } - else if (verticalAlign === 'bottom') { - textY -= textPadding[2]; - } - } - var defaultLineWidth = 0; - var useDefaultFill = false; - var textFill = getFill('fill' in style - ? style.fill - : (useDefaultFill = true, defaultStyle.fill)); - var textStroke = getStroke('stroke' in style - ? style.stroke - : (!bgColorDrawn - && (!defaultStyle.autoStroke || useDefaultFill)) - ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) - : null); - var hasShadow = style.textShadowBlur > 0; - var fixedBoundingRect = style.width != null - && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll'); - var calculatedLineHeight = contentBlock.calculatedLineHeight; - for (var i = 0; i < textLines.length; i++) { - var el = this._getOrCreateChild(TSpan); - var subElStyle = el.createStyle(); - el.useStyle(subElStyle); - subElStyle.text = textLines[i]; - subElStyle.x = textX; - subElStyle.y = textY; - if (textAlign) { - subElStyle.textAlign = textAlign; - } - subElStyle.textBaseline = 'middle'; - subElStyle.opacity = style.opacity; - subElStyle.strokeFirst = true; - if (hasShadow) { - subElStyle.shadowBlur = style.textShadowBlur || 0; - subElStyle.shadowColor = style.textShadowColor || 'transparent'; - subElStyle.shadowOffsetX = style.textShadowOffsetX || 0; - subElStyle.shadowOffsetY = style.textShadowOffsetY || 0; - } - subElStyle.stroke = textStroke; - subElStyle.fill = textFill; - if (textStroke) { - subElStyle.lineWidth = style.lineWidth || defaultLineWidth; - subElStyle.lineDash = style.lineDash; - subElStyle.lineDashOffset = style.lineDashOffset || 0; - } - subElStyle.font = textFont; - setSeparateFont(subElStyle, style); - textY += lineHeight; - if (fixedBoundingRect) { - el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY$1(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), contentWidth, calculatedLineHeight)); - } - } - }; - ZRText.prototype._updateRichTexts = function () { - var style = this.style; - var text = getStyleText(style); - var contentBlock = parseRichText(text, style); - var contentWidth = contentBlock.width; - var outerWidth = contentBlock.outerWidth; - var outerHeight = contentBlock.outerHeight; - var textPadding = style.padding; - var baseX = style.x || 0; - var baseY = style.y || 0; - var defaultStyle = this._defaultStyle; - var textAlign = style.align || defaultStyle.align; - var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign; - var boxX = adjustTextX(baseX, outerWidth, textAlign); - var boxY = adjustTextY$1(baseY, outerHeight, verticalAlign); - var xLeft = boxX; - var lineTop = boxY; - if (textPadding) { - xLeft += textPadding[3]; - lineTop += textPadding[0]; - } - var xRight = xLeft + contentWidth; - if (needDrawBackground(style)) { - this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight); - } - var bgColorDrawn = !!(style.backgroundColor); - 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 remainedWidth = line.width; - var leftIndex = 0; - var lineXLeft = xLeft; - var lineXRight = xRight; - var rightIndex = tokenCount - 1; - var token = void 0; - while (leftIndex < tokenCount - && (token = tokens[leftIndex], !token.align || token.align === 'left')) { - this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn); - remainedWidth -= token.width; - lineXLeft += token.width; - leftIndex++; - } - while (rightIndex >= 0 - && (token = tokens[rightIndex], token.align === 'right')) { - this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn); - remainedWidth -= token.width; - lineXRight -= token.width; - rightIndex--; - } - lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2; - while (leftIndex <= rightIndex) { - token = tokens[leftIndex]; - this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn); - lineXLeft += token.width; - leftIndex++; - } - lineTop += lineHeight; - } - }; - ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) { - var tokenStyle = style.rich[token.styleName] || {}; - tokenStyle.text = token.text; - var verticalAlign = token.verticalAlign; - var y = lineTop + lineHeight / 2; - if (verticalAlign === 'top') { - y = lineTop + token.height / 2; - } - else if (verticalAlign === 'bottom') { - y = lineTop + lineHeight - token.height / 2; - } - var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle); - needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right' - ? x - token.width - : textAlign === 'center' - ? x - token.width / 2 - : x, y - token.height / 2, token.width, token.height); - var bgColorDrawn = !!tokenStyle.backgroundColor; - var textPadding = token.textPadding; - if (textPadding) { - x = getTextXForPadding(x, textAlign, textPadding); - y -= token.height / 2 - textPadding[0] - token.innerHeight / 2; - } - var el = this._getOrCreateChild(TSpan); - var subElStyle = el.createStyle(); - el.useStyle(subElStyle); - var defaultStyle = this._defaultStyle; - var useDefaultFill = false; - var defaultLineWidth = 0; - var textFill = getFill('fill' in tokenStyle ? tokenStyle.fill - : 'fill' in style ? style.fill - : (useDefaultFill = true, defaultStyle.fill)); - var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke - : 'stroke' in style ? style.stroke - : (!bgColorDrawn - && !parentBgColorDrawn - && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) - : null); - var hasShadow = tokenStyle.textShadowBlur > 0 - || style.textShadowBlur > 0; - subElStyle.text = token.text; - subElStyle.x = x; - subElStyle.y = y; - if (hasShadow) { - subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0; - subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent'; - subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0; - subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0; - } - subElStyle.textAlign = textAlign; - subElStyle.textBaseline = 'middle'; - subElStyle.font = token.font || DEFAULT_FONT; - subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1); - setSeparateFont(subElStyle, tokenStyle); - if (textStroke) { - subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth); - subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash); - subElStyle.lineDashOffset = style.lineDashOffset || 0; - subElStyle.stroke = textStroke; - } - if (textFill) { - subElStyle.fill = textFill; - } - var textWidth = token.contentWidth; - var textHeight = token.contentHeight; - el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY$1(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight)); - }; - ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) { - var textBackgroundColor = style.backgroundColor; - var textBorderWidth = style.borderWidth; - var textBorderColor = style.borderColor; - var isImageBg = textBackgroundColor && textBackgroundColor.image; - var isPlainOrGradientBg = textBackgroundColor && !isImageBg; - var textBorderRadius = style.borderRadius; - var self = this; - var rectEl; - var imgEl; - if (isPlainOrGradientBg || style.lineHeight || (textBorderWidth && textBorderColor)) { - rectEl = this._getOrCreateChild(Rect); - rectEl.useStyle(rectEl.createStyle()); - rectEl.style.fill = null; - var rectShape = rectEl.shape; - rectShape.x = x; - rectShape.y = y; - rectShape.width = width; - rectShape.height = height; - rectShape.r = textBorderRadius; - rectEl.dirtyShape(); - } - if (isPlainOrGradientBg) { - var rectStyle = rectEl.style; - rectStyle.fill = textBackgroundColor || null; - rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1); - } - else if (isImageBg) { - imgEl = this._getOrCreateChild(ZRImage); - imgEl.onload = function () { - self.dirtyStyle(); - }; - var imgStyle = imgEl.style; - imgStyle.image = textBackgroundColor.image; - imgStyle.x = x; - imgStyle.y = y; - imgStyle.width = width; - imgStyle.height = height; - } - if (textBorderWidth && textBorderColor) { - var rectStyle = rectEl.style; - rectStyle.lineWidth = textBorderWidth; - rectStyle.stroke = textBorderColor; - rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1); - rectStyle.lineDash = style.borderDash; - rectStyle.lineDashOffset = style.borderDashOffset || 0; - rectEl.strokeContainThreshold = 0; - if (rectEl.hasFill() && rectEl.hasStroke()) { - rectStyle.strokeFirst = true; - rectStyle.lineWidth *= 2; - } - } - var commonStyle = (rectEl || imgEl).style; - commonStyle.shadowBlur = style.shadowBlur || 0; - commonStyle.shadowColor = style.shadowColor || 'transparent'; - commonStyle.shadowOffsetX = style.shadowOffsetX || 0; - commonStyle.shadowOffsetY = style.shadowOffsetY || 0; - commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1); - }; - ZRText.makeFont = function (style) { - var font = ''; - if (hasSeparateFont(style)) { - font = [ - style.fontStyle, - style.fontWeight, - parseFontSize(style.fontSize), - style.fontFamily || 'sans-serif' - ].join(' '); - } - return font && trim(font) || style.textFont || style.font; - }; - return ZRText; - }(Displayable)); - var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 }; - var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 }; - var FONT_PARTS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily']; - function parseFontSize(fontSize) { - if (typeof fontSize === 'string' - && (fontSize.indexOf('px') !== -1 - || fontSize.indexOf('rem') !== -1 - || fontSize.indexOf('em') !== -1)) { - return fontSize; - } - else if (!isNaN(+fontSize)) { - return fontSize + 'px'; - } - else { - return DEFAULT_FONT_SIZE + 'px'; - } - } - function setSeparateFont(targetStyle, sourceStyle) { - for (var i = 0; i < FONT_PARTS.length; i++) { - var fontProp = FONT_PARTS[i]; - var val = sourceStyle[fontProp]; - if (val != null) { - targetStyle[fontProp] = val; - } - } - } - function hasSeparateFont(style) { - return style.fontSize != null || style.fontFamily || style.fontWeight; - } - function normalizeTextStyle(style) { - normalizeStyle(style); - each(style.rich, normalizeStyle); - return style; - } - function normalizeStyle(style) { - if (style) { - style.font = ZRText.makeFont(style); - var textAlign = style.align; - textAlign === 'middle' && (textAlign = 'center'); - style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left'; - var verticalAlign = style.verticalAlign; - verticalAlign === 'center' && (verticalAlign = 'middle'); - style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top'; - var textPadding = style.padding; - if (textPadding) { - style.padding = normalizeCssArray(style.padding); - } - } - } - function getStroke(stroke, lineWidth) { - return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none') - ? null - : (stroke.image || stroke.colorStops) - ? '#000' - : stroke; - } - function getFill(fill) { - return (fill == null || fill === 'none') - ? null - : (fill.image || fill.colorStops) - ? '#000' - : fill; - } - function getTextXForPadding(x, textAlign, textPadding) { - return textAlign === 'right' - ? (x - textPadding[1]) - : textAlign === 'center' - ? (x + textPadding[3] / 2 - textPadding[1] / 2) - : (x + textPadding[3]); - } - function getStyleText(style) { - var text = style.text; - text != null && (text += ''); - return text; - } - function needDrawBackground(style) { - return !!(style.backgroundColor - || style.lineHeight - || (style.borderWidth && style.borderColor)); - } - - var getECData = makeInner(); - var setCommonECData = function (seriesIndex, dataType, dataIdx, el) { - if (el) { - var ecData = getECData(el); - // Add data index and series index for indexing the data by element - // Useful in tooltip - ecData.dataIndex = dataIdx; - ecData.dataType = dataType; - ecData.seriesIndex = seriesIndex; - ecData.ssrType = 'chart'; - // TODO: not store dataIndex on children. - if (el.type === 'group') { - el.traverse(function (child) { - var childECData = getECData(child); - childECData.seriesIndex = seriesIndex; - childECData.dataIndex = dataIdx; - childECData.dataType = dataType; - childECData.ssrType = 'chart'; - }); - } - } - }; - - // Reserve 0 as default. - var _highlightNextDigit = 1; - var _highlightKeyMap = {}; - var getSavedStates = makeInner(); - var getComponentStates = makeInner(); - var HOVER_STATE_NORMAL = 0; - var HOVER_STATE_BLUR = 1; - var HOVER_STATE_EMPHASIS = 2; - var SPECIAL_STATES = ['emphasis', 'blur', 'select']; - var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select']; - var Z2_EMPHASIS_LIFT = 10; - var Z2_SELECT_LIFT = 9; - var HIGHLIGHT_ACTION_TYPE = 'highlight'; - var DOWNPLAY_ACTION_TYPE = 'downplay'; - var SELECT_ACTION_TYPE = 'select'; - var UNSELECT_ACTION_TYPE = 'unselect'; - var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect'; - function hasFillOrStroke(fillOrStroke) { - return fillOrStroke != null && fillOrStroke !== 'none'; - } - function doChangeHoverState(el, stateName, hoverStateEnum) { - if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) { - el.onHoverStateChange(stateName); - } - el.hoverState = hoverStateEnum; - } - function singleEnterEmphasis(el) { - // Only mark the flag. - // States will be applied in the echarts.ts in next frame. - doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS); - } - function singleLeaveEmphasis(el) { - // Only mark the flag. - // States will be applied in the echarts.ts in next frame. - if (el.hoverState === HOVER_STATE_EMPHASIS) { - doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL); - } - } - function singleEnterBlur(el) { - doChangeHoverState(el, 'blur', HOVER_STATE_BLUR); - } - function singleLeaveBlur(el) { - if (el.hoverState === HOVER_STATE_BLUR) { - doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL); - } - } - function singleEnterSelect(el) { - el.selected = true; - } - function singleLeaveSelect(el) { - el.selected = false; - } - function updateElementState(el, updater, commonParam) { - updater(el, commonParam); - } - function traverseUpdateState(el, updater, commonParam) { - updateElementState(el, updater, commonParam); - el.isGroup && el.traverse(function (child) { - updateElementState(child, updater, commonParam); - }); - } - function setStatesFlag(el, stateName) { - switch (stateName) { - case 'emphasis': - el.hoverState = HOVER_STATE_EMPHASIS; - break; - case 'normal': - el.hoverState = HOVER_STATE_NORMAL; - break; - case 'blur': - el.hoverState = HOVER_STATE_BLUR; - break; - case 'select': - el.selected = true; - } - } - function getFromStateStyle(el, props, toStateName, defaultValue) { - var style = el.style; - var fromState = {}; - for (var i = 0; i < props.length; i++) { - var propName = props[i]; - var val = style[propName]; - fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val; - } - for (var i = 0; i < el.animators.length; i++) { - var animator = el.animators[i]; - if (animator.__fromStateTransition - // Don't consider the animation to emphasis state. - && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') { - animator.saveTo(fromState, props); - } - } - return fromState; - } - function createEmphasisDefaultState(el, stateName, targetStates, state) { - var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0; - var cloned = false; - if (el instanceof Path) { - var store = getSavedStates(el); - var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill; - var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke; - if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) { - state = state || {}; - var emphasisStyle = state.style || {}; - // inherit case - if (emphasisStyle.fill === 'inherit') { - cloned = true; - state = extend({}, state); - emphasisStyle = extend({}, emphasisStyle); - emphasisStyle.fill = fromFill; - } - // Apply default color lift - else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) { - cloned = true; - // Not modify the original value. - state = extend({}, state); - emphasisStyle = extend({}, emphasisStyle); - // Already being applied 'emphasis'. DON'T lift color multiple times. - emphasisStyle.fill = liftColor(fromFill); - } - // Not highlight stroke if fill has been highlighted. - else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) { - if (!cloned) { - state = extend({}, state); - emphasisStyle = extend({}, emphasisStyle); - } - emphasisStyle.stroke = liftColor(fromStroke); - } - state.style = emphasisStyle; - } - } - if (state) { - // TODO Share with textContent? - if (state.z2 == null) { - if (!cloned) { - state = extend({}, state); - } - var z2EmphasisLift = el.z2EmphasisLift; - state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT); - } - } - return state; - } - function createSelectDefaultState(el, stateName, state) { - // const hasSelect = indexOf(el.currentStates, stateName) >= 0; - if (state) { - // TODO Share with textContent? - if (state.z2 == null) { - state = extend({}, state); - var z2SelectLift = el.z2SelectLift; - state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT); - } - } - return state; - } - function createBlurDefaultState(el, stateName, state) { - var hasBlur = indexOf(el.currentStates, stateName) >= 0; - var currentOpacity = el.style.opacity; - var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, { - opacity: 1 - }) : null; - state = state || {}; - var blurStyle = state.style || {}; - if (blurStyle.opacity == null) { - // clone state - state = extend({}, state); - blurStyle = extend({ - // Already being applied 'emphasis'. DON'T mul opacity multiple times. - opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1 - }, blurStyle); - state.style = blurStyle; - } - return state; - } - function elementStateProxy(stateName, targetStates) { - var state = this.states[stateName]; - if (this.style) { - if (stateName === 'emphasis') { - return createEmphasisDefaultState(this, stateName, targetStates, state); - } else if (stateName === 'blur') { - return createBlurDefaultState(this, stateName, state); - } else if (stateName === 'select') { - return createSelectDefaultState(this, stateName, state); - } - } - return state; - } - /** - * Set hover style (namely "emphasis style") of element. - * @param el Should not be `zrender/graphic/Group`. - * @param focus 'self' | 'selfInSeries' | 'series' - */ - function setDefaultStateProxy(el) { - el.stateProxy = elementStateProxy; - var textContent = el.getTextContent(); - var textGuide = el.getTextGuideLine(); - if (textContent) { - textContent.stateProxy = elementStateProxy; - } - if (textGuide) { - textGuide.stateProxy = elementStateProxy; - } - } - function enterEmphasisWhenMouseOver(el, e) { - !shouldSilent(el, e) - // "emphasis" event highlight has higher priority than mouse highlight. - && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis); - } - function leaveEmphasisWhenMouseOut(el, e) { - !shouldSilent(el, e) - // "emphasis" event highlight has higher priority than mouse highlight. - && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis); - } - function enterEmphasis(el, highlightDigit) { - el.__highByOuter |= 1 << (highlightDigit || 0); - traverseUpdateState(el, singleEnterEmphasis); - } - function leaveEmphasis(el, highlightDigit) { - !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis); - } - function enterBlur(el) { - traverseUpdateState(el, singleEnterBlur); - } - function leaveBlur(el) { - traverseUpdateState(el, singleLeaveBlur); - } - function enterSelect(el) { - traverseUpdateState(el, singleEnterSelect); - } - function leaveSelect(el) { - traverseUpdateState(el, singleLeaveSelect); - } - function shouldSilent(el, e) { - return el.__highDownSilentOnTouch && e.zrByTouch; - } - function allLeaveBlur(api) { - var model = api.getModel(); - var leaveBlurredSeries = []; - var allComponentViews = []; - model.eachComponent(function (componentType, componentModel) { - var componentStates = getComponentStates(componentModel); - var isSeries = componentType === 'series'; - var view = isSeries ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel); - !isSeries && allComponentViews.push(view); - if (componentStates.isBlured) { - // Leave blur anyway - view.group.traverse(function (child) { - singleLeaveBlur(child); - }); - isSeries && leaveBlurredSeries.push(componentModel); - } - componentStates.isBlured = false; - }); - each(allComponentViews, function (view) { - if (view && view.toggleBlurSeries) { - view.toggleBlurSeries(leaveBlurredSeries, false, model); - } - }); - } - function blurSeries(targetSeriesIndex, focus, blurScope, api) { - var ecModel = api.getModel(); - blurScope = blurScope || 'coordinateSystem'; - function leaveBlurOfIndices(data, dataIndices) { - for (var i = 0; i < dataIndices.length; i++) { - var itemEl = data.getItemGraphicEl(dataIndices[i]); - itemEl && leaveBlur(itemEl); - } - } - if (targetSeriesIndex == null) { - return; - } - if (!focus || focus === 'none') { - return; - } - var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex); - var targetCoordSys = targetSeriesModel.coordinateSystem; - if (targetCoordSys && targetCoordSys.master) { - targetCoordSys = targetCoordSys.master; - } - var blurredSeries = []; - ecModel.eachSeries(function (seriesModel) { - var sameSeries = targetSeriesModel === seriesModel; - var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.master) { - coordSys = coordSys.master; - } - var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead. - if (!( - // Not blur other series if blurScope series - blurScope === 'series' && !sameSeries - // Not blur other coordinate system if blurScope is coordinateSystem - || blurScope === 'coordinateSystem' && !sameCoordSys - // Not blur self series if focus is series. - || focus === 'series' && sameSeries - // TODO blurScope: coordinate system - )) { - var view = api.getViewOfSeriesModel(seriesModel); - view.group.traverse(function (child) { - // For the elements that have been triggered by other components, - // and are still required to be highlighted, - // because the current is directly forced to blur the element, - // it will cause the focus self to be unable to highlight, so skip the blur of this element. - if (child.__highByOuter && sameSeries && focus === 'self') { - return; - } - singleEnterBlur(child); - }); - if (isArrayLike(focus)) { - leaveBlurOfIndices(seriesModel.getData(), focus); - } else if (isObject(focus)) { - var dataTypes = keys(focus); - for (var d = 0; d < dataTypes.length; d++) { - leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]); - } - } - blurredSeries.push(seriesModel); - getComponentStates(seriesModel).isBlured = true; - } - }); - ecModel.eachComponent(function (componentType, componentModel) { - if (componentType === 'series') { - return; - } - var view = api.getViewOfComponentModel(componentModel); - if (view && view.toggleBlurSeries) { - view.toggleBlurSeries(blurredSeries, true, ecModel); - } - }); - } - function blurComponent(componentMainType, componentIndex, api) { - if (componentMainType == null || componentIndex == null) { - return; - } - var componentModel = api.getModel().getComponent(componentMainType, componentIndex); - if (!componentModel) { - return; - } - getComponentStates(componentModel).isBlured = true; - var view = api.getViewOfComponentModel(componentModel); - if (!view || !view.focusBlurEnabled) { - return; - } - view.group.traverse(function (child) { - singleEnterBlur(child); - }); - } - function blurSeriesFromHighlightPayload(seriesModel, payload, api) { - var seriesIndex = seriesModel.seriesIndex; - var data = seriesModel.getData(payload.dataType); - if (!data) { - if ("development" !== 'production') { - error("Unknown dataType " + payload.dataType); - } - return; - } - var dataIndex = queryDataIndex(data, payload); - // Pick the first one if there is multiple/none exists. - dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0; - var el = data.getItemGraphicEl(dataIndex); - if (!el) { - var count = data.count(); - var current = 0; - // If data on dataIndex is NaN. - while (!el && current < count) { - el = data.getItemGraphicEl(current++); - } - } - if (el) { - var ecData = getECData(el); - blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api); - } else { - // If there is no element put on the data. Try getting it from raw option - // TODO Should put it on seriesModel? - var focus_1 = seriesModel.get(['emphasis', 'focus']); - var blurScope = seriesModel.get(['emphasis', 'blurScope']); - if (focus_1 != null) { - blurSeries(seriesIndex, focus_1, blurScope, api); - } - } - } - function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api) { - var ret = { - focusSelf: false, - dispatchers: null - }; - if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) { - return ret; - } - var componentModel = api.getModel().getComponent(componentMainType, componentIndex); - if (!componentModel) { - return ret; - } - var view = api.getViewOfComponentModel(componentModel); - if (!view || !view.findHighDownDispatchers) { - return ret; - } - var dispatchers = view.findHighDownDispatchers(name); - // At presnet, the component (like Geo) only blur inside itself. - // So we do not use `blurScope` in component. - var focusSelf; - for (var i = 0; i < dispatchers.length; i++) { - if ("development" !== 'production' && !isHighDownDispatcher(dispatchers[i])) { - error('param should be highDownDispatcher'); - } - if (getECData(dispatchers[i]).focus === 'self') { - focusSelf = true; - break; - } - } - return { - focusSelf: focusSelf, - dispatchers: dispatchers - }; - } - function handleGlobalMouseOverForHighDown(dispatcher, e, api) { - if ("development" !== 'production' && !isHighDownDispatcher(dispatcher)) { - error('param should be highDownDispatcher'); - } - var ecData = getECData(dispatcher); - var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api), - dispatchers = _a.dispatchers, - focusSelf = _a.focusSelf; - // If `findHighDownDispatchers` is supported on the component, - // highlight/downplay elements with the same name. - if (dispatchers) { - if (focusSelf) { - blurComponent(ecData.componentMainType, ecData.componentIndex, api); - } - each(dispatchers, function (dispatcher) { - return enterEmphasisWhenMouseOver(dispatcher, e); - }); - } else { - // Try blur all in the related series. Then emphasis the hoverred. - // TODO. progressive mode. - blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api); - if (ecData.focus === 'self') { - blurComponent(ecData.componentMainType, ecData.componentIndex, api); - } - // Other than series, component that not support `findHighDownDispatcher` will - // also use it. But in this case, highlight/downplay are only supported in - // mouse hover but not in dispatchAction. - enterEmphasisWhenMouseOver(dispatcher, e); - } - } - function handleGlobalMouseOutForHighDown(dispatcher, e, api) { - if ("development" !== 'production' && !isHighDownDispatcher(dispatcher)) { - error('param should be highDownDispatcher'); - } - allLeaveBlur(api); - var ecData = getECData(dispatcher); - var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers; - if (dispatchers) { - each(dispatchers, function (dispatcher) { - return leaveEmphasisWhenMouseOut(dispatcher, e); - }); - } else { - leaveEmphasisWhenMouseOut(dispatcher, e); - } - } - function toggleSelectionFromPayload(seriesModel, payload, api) { - if (!isSelectChangePayload(payload)) { - return; - } - var dataType = payload.dataType; - var data = seriesModel.getData(dataType); - var dataIndex = queryDataIndex(data, payload); - if (!isArray(dataIndex)) { - dataIndex = [dataIndex]; - } - seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType); - } - function updateSeriesElementSelection(seriesModel) { - var allData = seriesModel.getAllData(); - each(allData, function (_a) { - var data = _a.data, - type = _a.type; - data.eachItemGraphicEl(function (el, idx) { - seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el); - }); - }); - } - function getAllSelectedIndices(ecModel) { - var ret = []; - ecModel.eachSeries(function (seriesModel) { - var allData = seriesModel.getAllData(); - each(allData, function (_a) { - var data = _a.data, - type = _a.type; - var dataIndices = seriesModel.getSelectedDataIndices(); - if (dataIndices.length > 0) { - var item = { - dataIndex: dataIndices, - seriesIndex: seriesModel.seriesIndex - }; - if (type != null) { - item.dataType = type; - } - ret.push(item); - } - }); - }); - return ret; - } - /** - * Enable the function that mouseover will trigger the emphasis state. - * - * NOTE: - * This function should be used on the element with dataIndex, seriesIndex. - * - */ - function enableHoverEmphasis(el, focus, blurScope) { - setAsHighDownDispatcher(el, true); - traverseUpdateState(el, setDefaultStateProxy); - enableHoverFocus(el, focus, blurScope); - } - function disableHoverEmphasis(el) { - setAsHighDownDispatcher(el, false); - } - function toggleHoverEmphasis(el, focus, blurScope, isDisabled) { - isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope); - } - function enableHoverFocus(el, focus, blurScope) { - var ecData = getECData(el); - if (focus != null) { - // TODO dataIndex may be set after this function. This check is not useful. - // if (ecData.dataIndex == null) { - // if (__DEV__) { - // console.warn('focus can only been set on element with dataIndex'); - // } - // } - // else { - ecData.focus = focus; - ecData.blurScope = blurScope; - // } - } else if (ecData.focus) { - ecData.focus = null; - } - } - var OTHER_STATES = ['emphasis', 'blur', 'select']; - var defaultStyleGetterMap = { - itemStyle: 'getItemStyle', - lineStyle: 'getLineStyle', - areaStyle: 'getAreaStyle' - }; - /** - * Set emphasis/blur/selected states of element. - */ - function setStatesStylesFromModel(el, itemModel, styleType, - // default itemStyle - getter) { - styleType = styleType || 'itemStyle'; - for (var i = 0; i < OTHER_STATES.length; i++) { - var stateName = OTHER_STATES[i]; - var model = itemModel.getModel([stateName, styleType]); - var state = el.ensureState(stateName); - // Let it throw error if getterType is not found. - state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]](); - } - } - /** - * - * Set element as highlight / downplay dispatcher. - * It will be checked when element received mouseover event or from highlight action. - * It's in change of all highlight/downplay behavior of it's children. - * - * @param el - * @param el.highDownSilentOnTouch - * 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 asDispatcher If `false`, do not set as "highDownDispatcher". - */ - function setAsHighDownDispatcher(el, asDispatcher) { - var disable = asDispatcher === false; - var extendedEl = el; - // Make `highDownSilentOnTouch` and `onStateChange` only work after - // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly. - if (el.highDownSilentOnTouch) { - extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch; - } - // Simple optimize, since this method might be - // called for each elements of a group in some cases. - if (!disable || extendedEl.__highDownDispatcher) { - // 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. - extendedEl.__highByOuter = extendedEl.__highByOuter || 0; - extendedEl.__highDownDispatcher = !disable; - } - } - function isHighDownDispatcher(el) { - return !!(el && el.__highDownDispatcher); - } - /** - * Enable component highlight/downplay features: - * + hover link (within the same name) - * + focus blur in component - */ - function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) { - var ecData = getECData(el); - ecData.componentMainType = componentModel.mainType; - ecData.componentIndex = componentModel.componentIndex; - ecData.componentHighDownName = componentHighDownName; - } - /** - * Support highlight/downplay record on each elements. - * For the case: hover highlight/downplay (legend, visualMap, ...) and - * user triggered highlight/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; - } - function isSelectChangePayload(payload) { - var payloadType = payload.type; - return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE; - } - function isHighDownPayload(payload) { - var payloadType = payload.type; - return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE; - } - function savePathStates(el) { - var store = getSavedStates(el); - store.normalFill = el.style.fill; - store.normalStroke = el.style.stroke; - var selectState = el.states.select || {}; - store.selectFill = selectState.style && selectState.style.fill || null; - store.selectStroke = selectState.style && selectState.style.stroke || null; - } - - var CMD$2 = PathProxy.CMD; - var points = [[], [], []]; - var mathSqrt$1 = Math.sqrt; - var mathAtan2 = Math.atan2; - function transformPath(path, m) { - if (!m) { - return; - } - var data = path.data; - var len = path.len(); - var cmd; - var nPoint; - var i; - var j; - var k; - var p; - var M = CMD$2.M; - var C = CMD$2.C; - var L = CMD$2.L; - var R = CMD$2.R; - var A = CMD$2.A; - var Q = CMD$2.Q; - for (i = 0, j = 0; i < len;) { - cmd = data[i++]; - j = i; - nPoint = 0; - switch (cmd) { - case M: - nPoint = 1; - break; - case L: - nPoint = 1; - break; - case C: - nPoint = 3; - break; - case Q: - nPoint = 2; - break; - case A: - var x = m[4]; - var y = m[5]; - var sx = mathSqrt$1(m[0] * m[0] + m[1] * m[1]); - var sy = mathSqrt$1(m[2] * m[2] + m[3] * m[3]); - var angle = mathAtan2(-m[1] / sy, m[0] / sx); - data[i] *= sx; - data[i++] += x; - data[i] *= sy; - data[i++] += y; - data[i++] *= sx; - data[i++] *= sy; - data[i++] += angle; - data[i++] += angle; - i += 2; - j = i; - break; - case R: - p[0] = data[i++]; - p[1] = data[i++]; - applyTransform(p, p, m); - data[j++] = p[0]; - data[j++] = p[1]; - p[0] += data[i++]; - p[1] += data[i++]; - applyTransform(p, p, m); - data[j++] = p[0]; - data[j++] = p[1]; - } - for (k = 0; k < nPoint; k++) { - var p_1 = points[k]; - p_1[0] = data[i++]; - p_1[1] = data[i++]; - applyTransform(p_1, p_1, m); - data[j++] = p_1[0]; - data[j++] = p_1[1]; - } - } - path.increaseVersion(); - } - - var mathSqrt$2 = Math.sqrt; - var mathSin$2 = Math.sin; - var mathCos$2 = Math.cos; - var PI$1 = Math.PI; - function vMag(v) { - return Math.sqrt(v[0] * v[0] + v[1] * v[1]); - } - function vRatio(u, v) { - return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); - } - function vAngle(u, v) { - return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) - * Math.acos(vRatio(u, v)); - } - function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) { - var psi = psiDeg * (PI$1 / 180.0); - var xp = mathCos$2(psi) * (x1 - x2) / 2.0 - + mathSin$2(psi) * (y1 - y2) / 2.0; - var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2.0 - + mathCos$2(psi) * (y1 - y2) / 2.0; - var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); - if (lambda > 1) { - rx *= mathSqrt$2(lambda); - ry *= mathSqrt$2(lambda); - } - var f = (fa === fs ? -1 : 1) - * mathSqrt$2((((rx * rx) * (ry * ry)) - - ((rx * rx) * (yp * yp)) - - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) - + (ry * ry) * (xp * xp))) || 0; - var cxp = f * rx * yp / ry; - var cyp = f * -ry * xp / rx; - var cx = (x1 + x2) / 2.0 - + mathCos$2(psi) * cxp - - mathSin$2(psi) * cyp; - var cy = (y1 + y2) / 2.0 - + mathSin$2(psi) * cxp - + mathCos$2(psi) * cyp; - var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]); - var u = [(xp - cxp) / rx, (yp - cyp) / ry]; - var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry]; - var dTheta = vAngle(u, v); - if (vRatio(u, v) <= -1) { - dTheta = PI$1; - } - if (vRatio(u, v) >= 1) { - dTheta = 0; - } - if (dTheta < 0) { - var n = Math.round(dTheta / PI$1 * 1e6) / 1e6; - dTheta = PI$1 * 2 + (n % 2) * PI$1; - } - path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs); - } - var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; - var numberReg = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g; - function createPathProxyFromString(data) { - var path = new PathProxy(); - if (!data) { - return path; - } - var cpx = 0; - var cpy = 0; - var subpathX = cpx; - var subpathY = cpy; - var prevCmd; - var CMD = PathProxy.CMD; - var cmdList = data.match(commandReg); - if (!cmdList) { - return path; - } - for (var l = 0; l < cmdList.length; l++) { - var cmdText = cmdList[l]; - var cmdStr = cmdText.charAt(0); - var cmd = void 0; - var p = cmdText.match(numberReg) || []; - var pLen = p.length; - for (var i = 0; i < pLen; i++) { - p[i] = parseFloat(p[i]); - } - var off = 0; - while (off < pLen) { - var ctlPtx = void 0; - var ctlPty = void 0; - var rx = void 0; - var ry = void 0; - var psi = void 0; - var fa = void 0; - var fs = void 0; - var x1 = cpx; - var y1 = cpy; - var len = void 0; - var pathData = void 0; - switch (cmdStr) { - case 'l': - cpx += p[off++]; - cpy += p[off++]; - cmd = CMD.L; - path.addData(cmd, cpx, cpy); - break; - case 'L': - cpx = p[off++]; - cpy = p[off++]; - cmd = CMD.L; - path.addData(cmd, cpx, cpy); - break; - case 'm': - cpx += p[off++]; - cpy += p[off++]; - cmd = CMD.M; - path.addData(cmd, cpx, cpy); - subpathX = cpx; - subpathY = cpy; - cmdStr = 'l'; - break; - case 'M': - cpx = p[off++]; - cpy = p[off++]; - cmd = CMD.M; - path.addData(cmd, cpx, cpy); - subpathX = cpx; - subpathY = cpy; - cmdStr = 'L'; - break; - case 'h': - cpx += p[off++]; - cmd = CMD.L; - path.addData(cmd, cpx, cpy); - break; - case 'H': - cpx = p[off++]; - cmd = CMD.L; - path.addData(cmd, cpx, cpy); - break; - case 'v': - cpy += p[off++]; - cmd = CMD.L; - path.addData(cmd, cpx, cpy); - break; - case 'V': - cpy = p[off++]; - cmd = CMD.L; - path.addData(cmd, cpx, cpy); - break; - case 'C': - cmd = CMD.C; - path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]); - cpx = p[off - 2]; - cpy = p[off - 1]; - break; - case 'c': - cmd = CMD.C; - path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy); - cpx += p[off - 2]; - cpy += p[off - 1]; - break; - case 'S': - ctlPtx = cpx; - ctlPty = cpy; - len = path.len(); - pathData = path.data; - if (prevCmd === CMD.C) { - ctlPtx += cpx - pathData[len - 4]; - ctlPty += cpy - pathData[len - 3]; - } - cmd = CMD.C; - x1 = p[off++]; - y1 = p[off++]; - cpx = p[off++]; - cpy = p[off++]; - path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); - break; - case 's': - ctlPtx = cpx; - ctlPty = cpy; - len = path.len(); - pathData = path.data; - if (prevCmd === CMD.C) { - ctlPtx += cpx - pathData[len - 4]; - ctlPty += cpy - pathData[len - 3]; - } - cmd = CMD.C; - x1 = cpx + p[off++]; - y1 = cpy + p[off++]; - cpx += p[off++]; - cpy += p[off++]; - path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); - break; - case 'Q': - x1 = p[off++]; - y1 = p[off++]; - cpx = p[off++]; - cpy = p[off++]; - cmd = CMD.Q; - path.addData(cmd, x1, y1, cpx, cpy); - break; - case 'q': - x1 = p[off++] + cpx; - y1 = p[off++] + cpy; - cpx += p[off++]; - cpy += p[off++]; - cmd = CMD.Q; - path.addData(cmd, x1, y1, cpx, cpy); - break; - case 'T': - ctlPtx = cpx; - ctlPty = cpy; - len = path.len(); - pathData = path.data; - if (prevCmd === CMD.Q) { - ctlPtx += cpx - pathData[len - 4]; - ctlPty += cpy - pathData[len - 3]; - } - cpx = p[off++]; - cpy = p[off++]; - cmd = CMD.Q; - path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); - break; - case 't': - ctlPtx = cpx; - ctlPty = cpy; - len = path.len(); - pathData = path.data; - if (prevCmd === CMD.Q) { - ctlPtx += cpx - pathData[len - 4]; - ctlPty += cpy - pathData[len - 3]; - } - cpx += p[off++]; - cpy += p[off++]; - cmd = CMD.Q; - path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); - break; - case 'A': - rx = p[off++]; - ry = p[off++]; - psi = p[off++]; - fa = p[off++]; - fs = p[off++]; - x1 = cpx, y1 = cpy; - cpx = p[off++]; - cpy = p[off++]; - cmd = CMD.A; - processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path); - break; - case 'a': - rx = p[off++]; - ry = p[off++]; - psi = p[off++]; - fa = p[off++]; - fs = p[off++]; - x1 = cpx, y1 = cpy; - cpx += p[off++]; - cpy += p[off++]; - cmd = CMD.A; - processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path); - break; - } - } - if (cmdStr === 'z' || cmdStr === 'Z') { - cmd = CMD.Z; - path.addData(cmd); - cpx = subpathX; - cpy = subpathY; - } - prevCmd = cmd; - } - path.toStatic(); - return path; - } - var SVGPath = (function (_super) { - __extends(SVGPath, _super); - function SVGPath() { - return _super !== null && _super.apply(this, arguments) || this; - } - SVGPath.prototype.applyTransform = function (m) { }; - return SVGPath; - }(Path)); - function isPathProxy(path) { - return path.setData != null; - } - function createPathOptions(str, opts) { - var pathProxy = createPathProxyFromString(str); - var innerOpts = extend({}, opts); - innerOpts.buildPath = function (path) { - if (isPathProxy(path)) { - path.setData(pathProxy.data); - var ctx = path.getContext(); - if (ctx) { - path.rebuildPath(ctx, 1); - } - } - else { - var ctx = path; - pathProxy.rebuildPath(ctx, 1); - } - }; - innerOpts.applyTransform = function (m) { - transformPath(pathProxy, m); - this.dirtyShape(); - }; - return innerOpts; - } - function createFromString(str, opts) { - return new SVGPath(createPathOptions(str, opts)); - } - function extendFromString(str, defaultOpts) { - var innerOpts = createPathOptions(str, defaultOpts); - var Sub = (function (_super) { - __extends(Sub, _super); - function Sub(opts) { - var _this = _super.call(this, opts) || this; - _this.applyTransform = innerOpts.applyTransform; - _this.buildPath = innerOpts.buildPath; - return _this; - } - return Sub; - }(SVGPath)); - return Sub; - } - function mergePath(pathEls, opts) { - var pathList = []; - var len = pathEls.length; - for (var i = 0; i < len; i++) { - var pathEl = pathEls[i]; - pathList.push(pathEl.getUpdatedPathProxy(true)); - } - var pathBundle = new Path(opts); - pathBundle.createPathProxy(); - pathBundle.buildPath = function (path) { - if (isPathProxy(path)) { - path.appendPath(pathList); - var ctx = path.getContext(); - if (ctx) { - path.rebuildPath(ctx, 1); - } - } - }; - return pathBundle; - } - function clonePath(sourcePath, opts) { - opts = opts || {}; - var path = new Path(); - if (sourcePath.shape) { - path.setShape(sourcePath.shape); - } - path.setStyle(sourcePath.style); - if (opts.bakeTransform) { - transformPath(path.path, sourcePath.getComputedTransform()); - } - else { - if (opts.toLocal) { - path.setLocalTransform(sourcePath.getComputedTransform()); - } - else { - path.copyTransform(sourcePath); - } - } - path.buildPath = sourcePath.buildPath; - path.applyTransform = path.applyTransform; - path.z = sourcePath.z; - path.z2 = sourcePath.z2; - path.zlevel = sourcePath.zlevel; - return path; - } - - var CircleShape = (function () { - function CircleShape() { - this.cx = 0; - this.cy = 0; - this.r = 0; - } - return CircleShape; - }()); - var Circle = (function (_super) { - __extends(Circle, _super); - function Circle(opts) { - return _super.call(this, opts) || this; - } - Circle.prototype.getDefaultShape = function () { - return new CircleShape(); - }; - Circle.prototype.buildPath = function (ctx, shape) { - ctx.moveTo(shape.cx + shape.r, shape.cy); - ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2); - }; - return Circle; - }(Path)); - Circle.prototype.type = 'circle'; - - var EllipseShape = (function () { - function EllipseShape() { - this.cx = 0; - this.cy = 0; - this.rx = 0; - this.ry = 0; - } - return EllipseShape; - }()); - var Ellipse = (function (_super) { - __extends(Ellipse, _super); - function Ellipse(opts) { - return _super.call(this, opts) || this; - } - Ellipse.prototype.getDefaultShape = function () { - return new EllipseShape(); - }; - Ellipse.prototype.buildPath = function (ctx, shape) { - var k = 0.5522848; - var x = shape.cx; - var y = shape.cy; - var a = shape.rx; - var b = shape.ry; - var ox = a * k; - var oy = b * k; - ctx.moveTo(x - a, y); - ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); - ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); - ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); - ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); - ctx.closePath(); - }; - return Ellipse; - }(Path)); - Ellipse.prototype.type = 'ellipse'; - - var PI$2 = Math.PI; - var PI2$5 = PI$2 * 2; - var mathSin$3 = Math.sin; - var mathCos$3 = Math.cos; - var mathACos = Math.acos; - var mathATan2 = Math.atan2; - var mathAbs$1 = Math.abs; - var mathSqrt$3 = Math.sqrt; - var mathMax$3 = Math.max; - var mathMin$3 = Math.min; - var e = 1e-4; - function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { - var dx10 = x1 - x0; - var dy10 = y1 - y0; - var dx32 = x3 - x2; - var dy32 = y3 - y2; - var t = dy32 * dx10 - dx32 * dy10; - if (t * t < e) { - return; - } - t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t; - return [x0 + t * dx10, y0 + t * dy10]; - } - function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) { - var x01 = x0 - x1; - var y01 = y0 - y1; - var lo = (clockwise ? cr : -cr) / mathSqrt$3(x01 * x01 + y01 * y01); - var ox = lo * y01; - var oy = -lo * x01; - var x11 = x0 + ox; - var y11 = y0 + oy; - var x10 = x1 + ox; - var y10 = y1 + oy; - var x00 = (x11 + x10) / 2; - var y00 = (y11 + y10) / 2; - var dx = x10 - x11; - var dy = y10 - y11; - var d2 = dx * dx + dy * dy; - var r = radius - cr; - var s = x11 * y10 - x10 * y11; - var d = (dy < 0 ? -1 : 1) * mathSqrt$3(mathMax$3(0, r * r * d2 - s * s)); - var cx0 = (s * dy - dx * d) / d2; - var cy0 = (-s * dx - dy * d) / d2; - var cx1 = (s * dy + dx * d) / d2; - var cy1 = (-s * dx + dy * d) / d2; - var dx0 = cx0 - x00; - var dy0 = cy0 - y00; - var dx1 = cx1 - x00; - var dy1 = cy1 - y00; - if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) { - cx0 = cx1; - cy0 = cy1; - } - return { - cx: cx0, - cy: cy0, - x0: -ox, - y0: -oy, - x1: cx0 * (radius / r - 1), - y1: cy0 * (radius / r - 1) - }; - } - function normalizeCornerRadius(cr) { - var arr; - if (isArray(cr)) { - var len = cr.length; - if (!len) { - return cr; - } - if (len === 1) { - arr = [cr[0], cr[0], 0, 0]; - } - else if (len === 2) { - arr = [cr[0], cr[0], cr[1], cr[1]]; - } - else if (len === 3) { - arr = cr.concat(cr[2]); - } - else { - arr = cr; - } - } - else { - arr = [cr, cr, cr, cr]; - } - return arr; - } - function buildPath$1(ctx, shape) { - var _a; - var radius = mathMax$3(shape.r, 0); - var innerRadius = mathMax$3(shape.r0 || 0, 0); - var hasRadius = radius > 0; - var hasInnerRadius = innerRadius > 0; - if (!hasRadius && !hasInnerRadius) { - return; - } - if (!hasRadius) { - radius = innerRadius; - innerRadius = 0; - } - if (innerRadius > radius) { - var tmp = radius; - radius = innerRadius; - innerRadius = tmp; - } - var startAngle = shape.startAngle, endAngle = shape.endAngle; - if (isNaN(startAngle) || isNaN(endAngle)) { - return; - } - var cx = shape.cx, cy = shape.cy; - var clockwise = !!shape.clockwise; - var arc = mathAbs$1(endAngle - startAngle); - var mod = arc > PI2$5 && arc % PI2$5; - mod > e && (arc = mod); - if (!(radius > e)) { - ctx.moveTo(cx, cy); - } - else if (arc > PI2$5 - e) { - ctx.moveTo(cx + radius * mathCos$3(startAngle), cy + radius * mathSin$3(startAngle)); - ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise); - if (innerRadius > e) { - ctx.moveTo(cx + innerRadius * mathCos$3(endAngle), cy + innerRadius * mathSin$3(endAngle)); - ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise); - } - } - else { - var icrStart = void 0; - var icrEnd = void 0; - var ocrStart = void 0; - var ocrEnd = void 0; - var ocrs = void 0; - var ocre = void 0; - var icrs = void 0; - var icre = void 0; - var ocrMax = void 0; - var icrMax = void 0; - var limitedOcrMax = void 0; - var limitedIcrMax = void 0; - var xre = void 0; - var yre = void 0; - var xirs = void 0; - var yirs = void 0; - var xrs = radius * mathCos$3(startAngle); - var yrs = radius * mathSin$3(startAngle); - var xire = innerRadius * mathCos$3(endAngle); - var yire = innerRadius * mathSin$3(endAngle); - var hasArc = arc > e; - if (hasArc) { - var cornerRadius = shape.cornerRadius; - if (cornerRadius) { - _a = normalizeCornerRadius(cornerRadius), icrStart = _a[0], icrEnd = _a[1], ocrStart = _a[2], ocrEnd = _a[3]; - } - var halfRd = mathAbs$1(radius - innerRadius) / 2; - ocrs = mathMin$3(halfRd, ocrStart); - ocre = mathMin$3(halfRd, ocrEnd); - icrs = mathMin$3(halfRd, icrStart); - icre = mathMin$3(halfRd, icrEnd); - limitedOcrMax = ocrMax = mathMax$3(ocrs, ocre); - limitedIcrMax = icrMax = mathMax$3(icrs, icre); - if (ocrMax > e || icrMax > e) { - xre = radius * mathCos$3(endAngle); - yre = radius * mathSin$3(endAngle); - xirs = innerRadius * mathCos$3(startAngle); - yirs = innerRadius * mathSin$3(startAngle); - if (arc < PI$2) { - var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire); - if (it_1) { - var x0 = xrs - it_1[0]; - var y0 = yrs - it_1[1]; - var x1 = xre - it_1[0]; - var y1 = yre - it_1[1]; - var a = 1 / mathSin$3(mathACos((x0 * x1 + y0 * y1) / (mathSqrt$3(x0 * x0 + y0 * y0) * mathSqrt$3(x1 * x1 + y1 * y1))) / 2); - var b = mathSqrt$3(it_1[0] * it_1[0] + it_1[1] * it_1[1]); - limitedOcrMax = mathMin$3(ocrMax, (radius - b) / (a + 1)); - limitedIcrMax = mathMin$3(icrMax, (innerRadius - b) / (a - 1)); - } - } - } - } - if (!hasArc) { - ctx.moveTo(cx + xrs, cy + yrs); - } - else if (limitedOcrMax > e) { - var crStart = mathMin$3(ocrStart, limitedOcrMax); - var crEnd = mathMin$3(ocrEnd, limitedOcrMax); - var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise); - var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise); - ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0); - if (limitedOcrMax < ocrMax && crStart === crEnd) { - ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise); - } - else { - crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise); - ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise); - crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise); - } - } - else { - ctx.moveTo(cx + xrs, cy + yrs); - ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise); - } - if (!(innerRadius > e) || !hasArc) { - ctx.lineTo(cx + xire, cy + yire); - } - else if (limitedIcrMax > e) { - var crStart = mathMin$3(icrStart, limitedIcrMax); - var crEnd = mathMin$3(icrEnd, limitedIcrMax); - var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise); - var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise); - ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0); - if (limitedIcrMax < icrMax && crStart === crEnd) { - ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise); - } - else { - crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise); - ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise); - crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise); - } - } - else { - ctx.lineTo(cx + xire, cy + yire); - ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise); - } - } - ctx.closePath(); - } - - var SectorShape = (function () { - function SectorShape() { - this.cx = 0; - this.cy = 0; - this.r0 = 0; - this.r = 0; - this.startAngle = 0; - this.endAngle = Math.PI * 2; - this.clockwise = true; - this.cornerRadius = 0; - } - return SectorShape; - }()); - var Sector = (function (_super) { - __extends(Sector, _super); - function Sector(opts) { - return _super.call(this, opts) || this; - } - Sector.prototype.getDefaultShape = function () { - return new SectorShape(); - }; - Sector.prototype.buildPath = function (ctx, shape) { - buildPath$1(ctx, shape); - }; - Sector.prototype.isZeroArea = function () { - return this.shape.startAngle === this.shape.endAngle - || this.shape.r === this.shape.r0; - }; - return Sector; - }(Path)); - Sector.prototype.type = 'sector'; - - var RingShape = (function () { - function RingShape() { - this.cx = 0; - this.cy = 0; - this.r = 0; - this.r0 = 0; - } - return RingShape; - }()); - var Ring = (function (_super) { - __extends(Ring, _super); - function Ring(opts) { - return _super.call(this, opts) || this; - } - Ring.prototype.getDefaultShape = function () { - return new RingShape(); - }; - Ring.prototype.buildPath = function (ctx, shape) { - var x = shape.cx; - var y = shape.cy; - var PI2 = Math.PI * 2; - ctx.moveTo(x + shape.r, y); - ctx.arc(x, y, shape.r, 0, PI2, false); - ctx.moveTo(x + shape.r0, y); - ctx.arc(x, y, shape.r0, 0, PI2, true); - }; - return Ring; - }(Path)); - Ring.prototype.type = 'ring'; - - function smoothBezier(points, smooth, isLoop, constraint) { - var cps = []; - var v = []; - var v1 = []; - var v2 = []; - var prevPoint; - var nextPoint; - var min$1; - var max$1; - if (constraint) { - min$1 = [Infinity, Infinity]; - max$1 = [-Infinity, -Infinity]; - for (var i = 0, len = points.length; i < len; i++) { - min(min$1, min$1, points[i]); - max(max$1, max$1, points[i]); - } - min(min$1, min$1, constraint[0]); - max(max$1, max$1, constraint[1]); - } - for (var i = 0, len = points.length; i < len; i++) { - var point = points[i]; - if (isLoop) { - prevPoint = points[i ? i - 1 : len - 1]; - nextPoint = points[(i + 1) % len]; - } - else { - if (i === 0 || i === len - 1) { - cps.push(clone$1(points[i])); - continue; - } - else { - prevPoint = points[i - 1]; - nextPoint = points[i + 1]; - } - } - sub(v, nextPoint, prevPoint); - scale(v, v, smooth); - var d0 = distance(point, prevPoint); - var d1 = distance(point, nextPoint); - var sum = d0 + d1; - if (sum !== 0) { - d0 /= sum; - d1 /= sum; - } - scale(v1, v, -d0); - scale(v2, v, d1); - var cp0 = add([], point, v1); - var cp1 = add([], point, v2); - if (constraint) { - max(cp0, cp0, min$1); - min(cp0, cp0, max$1); - max(cp1, cp1, min$1); - min(cp1, cp1, max$1); - } - cps.push(cp0); - cps.push(cp1); - } - if (isLoop) { - cps.push(cps.shift()); - } - return cps; - } - - function buildPath$2(ctx, shape, closePath) { - var smooth = shape.smooth; - var points = shape.points; - if (points && points.length >= 2) { - if (smooth) { - var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint); - ctx.moveTo(points[0][0], points[0][1]); - var len = points.length; - for (var i = 0; i < (closePath ? len : len - 1); i++) { - var cp1 = controlPoints[i * 2]; - var cp2 = controlPoints[i * 2 + 1]; - var p = points[(i + 1) % len]; - ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); - } - } - else { - ctx.moveTo(points[0][0], points[0][1]); - for (var i = 1, l = points.length; i < l; i++) { - ctx.lineTo(points[i][0], points[i][1]); - } - } - closePath && ctx.closePath(); - } - } - - var PolygonShape = (function () { - function PolygonShape() { - this.points = null; - this.smooth = 0; - this.smoothConstraint = null; - } - return PolygonShape; - }()); - var Polygon = (function (_super) { - __extends(Polygon, _super); - function Polygon(opts) { - return _super.call(this, opts) || this; - } - Polygon.prototype.getDefaultShape = function () { - return new PolygonShape(); - }; - Polygon.prototype.buildPath = function (ctx, shape) { - buildPath$2(ctx, shape, true); - }; - return Polygon; - }(Path)); - Polygon.prototype.type = 'polygon'; - - var PolylineShape = (function () { - function PolylineShape() { - this.points = null; - this.percent = 1; - this.smooth = 0; - this.smoothConstraint = null; - } - return PolylineShape; - }()); - var Polyline = (function (_super) { - __extends(Polyline, _super); - function Polyline(opts) { - return _super.call(this, opts) || this; - } - Polyline.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - Polyline.prototype.getDefaultShape = function () { - return new PolylineShape(); - }; - Polyline.prototype.buildPath = function (ctx, shape) { - buildPath$2(ctx, shape, false); - }; - return Polyline; - }(Path)); - Polyline.prototype.type = 'polyline'; - - var subPixelOptimizeOutputShape$1 = {}; - var LineShape = (function () { - function LineShape() { - this.x1 = 0; - this.y1 = 0; - this.x2 = 0; - this.y2 = 0; - this.percent = 1; - } - return LineShape; - }()); - var Line = (function (_super) { - __extends(Line, _super); - function Line(opts) { - return _super.call(this, opts) || this; - } - Line.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - Line.prototype.getDefaultShape = function () { - return new LineShape(); - }; - Line.prototype.buildPath = function (ctx, shape) { - var x1; - var y1; - var x2; - var y2; - if (this.subPixelOptimize) { - var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape$1, shape, this.style); - x1 = optimizedShape.x1; - y1 = optimizedShape.y1; - x2 = optimizedShape.x2; - y2 = optimizedShape.y2; - } - else { - x1 = shape.x1; - y1 = shape.y1; - x2 = shape.x2; - y2 = shape.y2; - } - var percent = shape.percent; - if (percent === 0) { - return; - } - ctx.moveTo(x1, y1); - if (percent < 1) { - x2 = x1 * (1 - percent) + x2 * percent; - y2 = y1 * (1 - percent) + y2 * percent; - } - ctx.lineTo(x2, y2); - }; - Line.prototype.pointAt = function (p) { - var shape = this.shape; - return [ - shape.x1 * (1 - p) + shape.x2 * p, - shape.y1 * (1 - p) + shape.y2 * p - ]; - }; - return Line; - }(Path)); - Line.prototype.type = 'line'; - - var out = []; - var BezierCurveShape = (function () { - function BezierCurveShape() { - this.x1 = 0; - this.y1 = 0; - this.x2 = 0; - this.y2 = 0; - this.cpx1 = 0; - this.cpy1 = 0; - this.percent = 1; - } - return BezierCurveShape; - }()); - function someVectorAt(shape, t, isTangent) { - var cpx2 = shape.cpx2; - var cpy2 = shape.cpy2; - if (cpx2 != null || cpy2 != null) { - return [ - (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t), - (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t) - ]; - } - else { - return [ - (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), - (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t) - ]; - } - } - var BezierCurve = (function (_super) { - __extends(BezierCurve, _super); - function BezierCurve(opts) { - return _super.call(this, opts) || this; - } - BezierCurve.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - BezierCurve.prototype.getDefaultShape = function () { - return new BezierCurveShape(); - }; - BezierCurve.prototype.buildPath = function (ctx, shape) { - var x1 = shape.x1; - var y1 = shape.y1; - var x2 = shape.x2; - var y2 = shape.y2; - var cpx1 = shape.cpx1; - var cpy1 = shape.cpy1; - var cpx2 = shape.cpx2; - var cpy2 = shape.cpy2; - var percent = shape.percent; - if (percent === 0) { - return; - } - ctx.moveTo(x1, y1); - if (cpx2 == null || cpy2 == null) { - if (percent < 1) { - quadraticSubdivide(x1, cpx1, x2, percent, out); - cpx1 = out[1]; - x2 = out[2]; - quadraticSubdivide(y1, cpy1, y2, percent, out); - cpy1 = out[1]; - y2 = out[2]; - } - ctx.quadraticCurveTo(cpx1, cpy1, x2, y2); - } - else { - if (percent < 1) { - cubicSubdivide(x1, cpx1, cpx2, x2, percent, out); - cpx1 = out[1]; - cpx2 = out[2]; - x2 = out[3]; - cubicSubdivide(y1, cpy1, cpy2, y2, percent, out); - cpy1 = out[1]; - cpy2 = out[2]; - y2 = out[3]; - } - ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2); - } - }; - BezierCurve.prototype.pointAt = function (t) { - return someVectorAt(this.shape, t, false); - }; - BezierCurve.prototype.tangentAt = function (t) { - var p = someVectorAt(this.shape, t, true); - return normalize(p, p); - }; - return BezierCurve; - }(Path)); - BezierCurve.prototype.type = 'bezier-curve'; - - var ArcShape = (function () { - function ArcShape() { - this.cx = 0; - this.cy = 0; - this.r = 0; - this.startAngle = 0; - this.endAngle = Math.PI * 2; - this.clockwise = true; - } - return ArcShape; - }()); - var Arc = (function (_super) { - __extends(Arc, _super); - function Arc(opts) { - return _super.call(this, opts) || this; - } - Arc.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - Arc.prototype.getDefaultShape = function () { - return new ArcShape(); - }; - Arc.prototype.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); - }; - return Arc; - }(Path)); - Arc.prototype.type = 'arc'; - - var CompoundPath = (function (_super) { - __extends(CompoundPath, _super); - function CompoundPath() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'compound'; - return _this; - } - CompoundPath.prototype._updatePathDirty = function () { - var paths = this.shape.paths; - var dirtyPath = this.shapeChanged(); - for (var i = 0; i < paths.length; i++) { - dirtyPath = dirtyPath || paths[i].shapeChanged(); - } - if (dirtyPath) { - this.dirtyShape(); - } - }; - CompoundPath.prototype.beforeBrush = function () { - this._updatePathDirty(); - var paths = this.shape.paths || []; - var scale = this.getGlobalScale(); - 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); - } - }; - CompoundPath.prototype.buildPath = function (ctx, shape) { - var paths = shape.paths || []; - for (var i = 0; i < paths.length; i++) { - paths[i].buildPath(ctx, paths[i].shape, true); - } - }; - CompoundPath.prototype.afterBrush = function () { - var paths = this.shape.paths || []; - for (var i = 0; i < paths.length; i++) { - paths[i].pathUpdated(); - } - }; - CompoundPath.prototype.getBoundingRect = function () { - this._updatePathDirty.call(this); - return Path.prototype.getBoundingRect.call(this); - }; - return CompoundPath; - }(Path)); - - var Gradient = (function () { - function Gradient(colorStops) { - this.colorStops = colorStops || []; - } - Gradient.prototype.addColorStop = function (offset, color) { - this.colorStops.push({ - offset: offset, - color: color - }); - }; - return Gradient; - }()); - - var LinearGradient = (function (_super) { - __extends(LinearGradient, _super); - function LinearGradient(x, y, x2, y2, colorStops, globalCoord) { - var _this = _super.call(this, colorStops) || this; - _this.x = x == null ? 0 : x; - _this.y = y == null ? 0 : y; - _this.x2 = x2 == null ? 1 : x2; - _this.y2 = y2 == null ? 0 : y2; - _this.type = 'linear'; - _this.global = globalCoord || false; - return _this; - } - return LinearGradient; - }(Gradient)); - - var RadialGradient = (function (_super) { - __extends(RadialGradient, _super); - function RadialGradient(x, y, r, colorStops, globalCoord) { - var _this = _super.call(this, colorStops) || this; - _this.x = x == null ? 0.5 : x; - _this.y = y == null ? 0.5 : y; - _this.r = r == null ? 0.5 : r; - _this.type = 'radial'; - _this.global = globalCoord || false; - return _this; - } - return RadialGradient; - }(Gradient)); - - var extent = [0, 0]; - var extent2 = [0, 0]; - var minTv$1 = new Point(); - var maxTv$1 = new Point(); - var OrientedBoundingRect = (function () { - function OrientedBoundingRect(rect, transform) { - this._corners = []; - this._axes = []; - this._origin = [0, 0]; - for (var i = 0; i < 4; i++) { - this._corners[i] = new Point(); - } - for (var i = 0; i < 2; i++) { - this._axes[i] = new Point(); - } - if (rect) { - this.fromBoundingRect(rect, transform); - } - } - OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) { - var corners = this._corners; - var axes = this._axes; - var x = rect.x; - var y = rect.y; - var x2 = x + rect.width; - var y2 = y + rect.height; - corners[0].set(x, y); - corners[1].set(x2, y); - corners[2].set(x2, y2); - corners[3].set(x, y2); - if (transform) { - for (var i = 0; i < 4; i++) { - corners[i].transform(transform); - } - } - Point.sub(axes[0], corners[1], corners[0]); - Point.sub(axes[1], corners[3], corners[0]); - axes[0].normalize(); - axes[1].normalize(); - for (var i = 0; i < 2; i++) { - this._origin[i] = axes[i].dot(corners[0]); - } - }; - OrientedBoundingRect.prototype.intersect = function (other, mtv) { - var overlapped = true; - var noMtv = !mtv; - minTv$1.set(Infinity, Infinity); - maxTv$1.set(0, 0); - if (!this._intersectCheckOneSide(this, other, minTv$1, maxTv$1, noMtv, 1)) { - overlapped = false; - if (noMtv) { - return overlapped; - } - } - if (!this._intersectCheckOneSide(other, this, minTv$1, maxTv$1, noMtv, -1)) { - overlapped = false; - if (noMtv) { - return overlapped; - } - } - if (!noMtv) { - Point.copy(mtv, overlapped ? minTv$1 : maxTv$1); - } - return overlapped; - }; - OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) { - var overlapped = true; - for (var i = 0; i < 2; i++) { - var axis = this._axes[i]; - this._getProjMinMaxOnAxis(i, self._corners, extent); - this._getProjMinMaxOnAxis(i, other._corners, extent2); - if (extent[1] < extent2[0] || extent[0] > extent2[1]) { - overlapped = false; - if (noMtv) { - return overlapped; - } - var dist0 = Math.abs(extent2[0] - extent[1]); - var dist1 = Math.abs(extent[0] - extent2[1]); - if (Math.min(dist0, dist1) > maxTv.len()) { - if (dist0 < dist1) { - Point.scale(maxTv, axis, -dist0 * inverse); - } - else { - Point.scale(maxTv, axis, dist1 * inverse); - } - } - } - else if (minTv) { - var dist0 = Math.abs(extent2[0] - extent[1]); - var dist1 = Math.abs(extent[0] - extent2[1]); - if (Math.min(dist0, dist1) < minTv.len()) { - if (dist0 < dist1) { - Point.scale(minTv, axis, dist0 * inverse); - } - else { - Point.scale(minTv, axis, -dist1 * inverse); - } - } - } - } - return overlapped; - }; - OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) { - var axis = this._axes[dim]; - var origin = this._origin; - var proj = corners[0].dot(axis) + origin[dim]; - var min = proj; - var max = proj; - for (var i = 1; i < corners.length; i++) { - var proj_1 = corners[i].dot(axis) + origin[dim]; - min = Math.min(proj_1, min); - max = Math.max(proj_1, max); - } - out[0] = min; - out[1] = max; - }; - return OrientedBoundingRect; - }()); - - var m = []; - var IncrementalDisplayable = (function (_super) { - __extends(IncrementalDisplayable, _super); - function IncrementalDisplayable() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.notClear = true; - _this.incremental = true; - _this._displayables = []; - _this._temporaryDisplayables = []; - _this._cursor = 0; - return _this; - } - IncrementalDisplayable.prototype.traverse = function (cb, context) { - cb.call(context, this); - }; - IncrementalDisplayable.prototype.useStyle = function () { - this.style = {}; - }; - IncrementalDisplayable.prototype.getCursor = function () { - return this._cursor; - }; - IncrementalDisplayable.prototype.innerAfterBrush = function () { - this._cursor = this._displayables.length; - }; - IncrementalDisplayable.prototype.clearDisplaybles = function () { - this._displayables = []; - this._temporaryDisplayables = []; - this._cursor = 0; - this.markRedraw(); - this.notClear = false; - }; - IncrementalDisplayable.prototype.clearTemporalDisplayables = function () { - this._temporaryDisplayables = []; - }; - IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) { - if (notPersistent) { - this._temporaryDisplayables.push(displayable); - } - else { - this._displayables.push(displayable); - } - this.markRedraw(); - }; - IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) { - notPersistent = notPersistent || false; - for (var i = 0; i < displayables.length; i++) { - this.addDisplayable(displayables[i], notPersistent); - } - }; - IncrementalDisplayable.prototype.getDisplayables = function () { - return this._displayables; - }; - IncrementalDisplayable.prototype.getTemporalDisplayables = function () { - return this._temporaryDisplayables; - }; - IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) { - for (var i = this._cursor; i < this._displayables.length; i++) { - cb && cb(this._displayables[i]); - } - for (var i = 0; i < this._temporaryDisplayables.length; i++) { - cb && cb(this._temporaryDisplayables[i]); - } - }; - IncrementalDisplayable.prototype.update = function () { - this.updateTransform(); - for (var i = this._cursor; i < this._displayables.length; i++) { - var displayable = this._displayables[i]; - displayable.parent = this; - displayable.update(); - displayable.parent = null; - } - for (var i = 0; i < this._temporaryDisplayables.length; i++) { - var displayable = this._temporaryDisplayables[i]; - displayable.parent = this; - displayable.update(); - displayable.parent = null; - } - }; - IncrementalDisplayable.prototype.getBoundingRect = function () { - if (!this._rect) { - var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity); - for (var i = 0; i < this._displayables.length; i++) { - var displayable = this._displayables[i]; - var childRect = displayable.getBoundingRect().clone(); - if (displayable.needLocalTransform()) { - childRect.applyTransform(displayable.getLocalTransform(m)); - } - rect.union(childRect); - } - this._rect = rect; - } - return this._rect; - }; - IncrementalDisplayable.prototype.contain = function (x, y) { - var localPos = this.transformCoordToLocal(x, y); - var rect = this.getBoundingRect(); - if (rect.contain(localPos[0], localPos[1])) { - for (var i = 0; i < this._displayables.length; i++) { - var displayable = this._displayables[i]; - if (displayable.contain(x, y)) { - return true; - } - } - } - return false; - }; - return IncrementalDisplayable; - }(Displayable)); - - // Stored properties for further transition. - var transitionStore = makeInner(); - /** - * Return null if animation is disabled. - */ - function getAnimationConfig(animationType, animatableModel, dataIndex, - // Extra opts can override the option in animatable model. - extraOpts, - // TODO It's only for pictorial bar now. - extraDelayParams) { - var animationPayload; - // Check if there is global animation configuration from dataZoom/resize can override the config in option. - // If animation is enabled. Will use this animation config in payload. - // If animation is disabled. Just ignore it. - if (animatableModel && animatableModel.ecModel) { - var updatePayload = animatableModel.ecModel.getUpdatePayload(); - animationPayload = updatePayload && updatePayload.animation; - } - var animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); - var isUpdate = animationType === 'update'; - if (animationEnabled) { - var duration = void 0; - var easing = void 0; - var delay = void 0; - if (extraOpts) { - duration = retrieve2(extraOpts.duration, 200); - easing = retrieve2(extraOpts.easing, 'cubicOut'); - delay = 0; - } else { - duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration'); - easing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing'); - delay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay'); - } - // animation from payload has highest priority. - if (animationPayload) { - animationPayload.duration != null && (duration = animationPayload.duration); - animationPayload.easing != null && (easing = animationPayload.easing); - animationPayload.delay != null && (delay = animationPayload.delay); - } - if (isFunction(delay)) { - delay = delay(dataIndex, extraDelayParams); - } - if (isFunction(duration)) { - duration = duration(dataIndex); - } - var config = { - duration: duration || 0, - delay: delay, - easing: easing - }; - return config; - } else { - return null; - } - } - function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) { - var isFrom = false; - var removeOpt; - if (isFunction(dataIndex)) { - during = cb; - cb = dataIndex; - dataIndex = null; - } else if (isObject(dataIndex)) { - cb = dataIndex.cb; - during = dataIndex.during; - isFrom = dataIndex.isFrom; - removeOpt = dataIndex.removeOpt; - dataIndex = dataIndex.dataIndex; - } - var isRemove = animationType === 'leave'; - if (!isRemove) { - // Must stop the remove animation. - el.stopAnimation('leave'); - } - var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null); - if (animationConfig && animationConfig.duration > 0) { - var duration = animationConfig.duration; - var animationDelay = animationConfig.delay; - var animationEasing = animationConfig.easing; - var animateConfig = { - duration: duration, - delay: animationDelay || 0, - easing: animationEasing, - done: cb, - force: !!cb || !!during, - // Set to final state in update/init animation. - // So the post processing based on the path shape can be done correctly. - setToFinal: !isRemove, - scope: animationType, - during: during - }; - isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig); - } else { - el.stopAnimation(); - // If `isFrom`, the props is the "from" props. - !isFrom && el.attr(props); - // Call during at least once. - during && during(1); - 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. - * @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, - // TODO: TYPE AnimatableModel - animatableModel, dataIndex, cb, during) { - animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during); - } - /** - * 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. - */ - function initProps(el, props, animatableModel, dataIndex, cb, during) { - animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during); - } - /** - * If element is removed. - * It can determine if element is having remove animation. - */ - function isElementRemoved(el) { - if (!el.__zr) { - return true; - } - for (var i = 0; i < el.animators.length; i++) { - var animator = el.animators[i]; - if (animator.scope === 'leave') { - return true; - } - } - return false; - } - /** - * Remove graphic element - */ - function removeElement(el, props, animatableModel, dataIndex, cb, during) { - // Don't do remove animation twice. - if (isElementRemoved(el)) { - return; - } - animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during); - } - function fadeOutDisplayable(el, animatableModel, dataIndex, done) { - el.removeTextContent(); - el.removeTextGuideLine(); - removeElement(el, { - style: { - opacity: 0 - } - }, animatableModel, dataIndex, done); - } - function removeElementWithFadeOut(el, animatableModel, dataIndex) { - function doRemove() { - el.parent && el.parent.remove(el); - } - // Hide label and labelLine first - // TODO Also use fade out animation? - if (!el.isGroup) { - fadeOutDisplayable(el, animatableModel, dataIndex, doRemove); - } else { - el.traverse(function (disp) { - if (!disp.isGroup) { - // Can invoke doRemove multiple times. - fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove); - } - }); - } - } - /** - * Save old style for style transition in universalTransition module. - * It's used when element will be reused in each render. - * For chart like map, heatmap, which will always create new element. - * We don't need to save this because universalTransition can get old style from the old element - */ - function saveOldStyle(el) { - transitionStore(el).oldStyle = el.style; - } - function getOldStyle(el) { - return transitionStore(el).oldStyle; - } - - var mathMax$4 = Math.max; - var mathMin$4 = Math.min; - var _customShapeMap = {}; - /** - * Extend shape with parameters - */ - function extendShape(opts) { - return Path.extend(opts); - } - var extendPathFromString = extendFromString; - /** - * Extend path - */ - function extendPath(pathData, opts) { - return extendPathFromString(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 name - * @param 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 registers 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 rarely happens. So we don't make more mechanism - * to resolve this issue here. - * - * @param name - * @return 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 pathData - * @param opts - * @param rect - * @param layout 'center' or 'cover' default to be cover - */ - function makePath(pathData, opts, rect, layout) { - var path = 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 imageUrl image url - * @param opts options - * @param rect constrain rect - * @param layout 'center' or 'cover'. Default to be 'cover' - */ - function makeImage(imageUrl, rect, layout) { - var zrImg = new ZRImage({ - 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 - }; - zrImg.setStyle(centerGraphic(rect, boundingRect)); - } - } - }); - return zrImg; - } - /** - * Get position of centered element in bounding box. - * - * @param rect element local bounding box - * @param boundingRect constraint bounding box - * @return 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$1 = mergePath; - /** - * Resize a path to fit the rect - * @param path - * @param 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 - */ - function subPixelOptimizeLine$1(shape, lineWidth) { - subPixelOptimizeLine(shape, shape, { - lineWidth: lineWidth - }); - return shape; - } - /** - * Sub pixel optimize rect for canvas - */ - function subPixelOptimizeRect$1(param) { - subPixelOptimizeRect(param.shape, param.shape, param.style); - return param; - } - /** - * Sub pixel optimize for canvas - * - * @param position Coordinate, such as x, y - * @param lineWidth Should be nonnegative integer. - * @param positiveOrNegative Default false (negative). - * @return Optimized position. - */ - var subPixelOptimize$1 = subPixelOptimize; - /** - * Get transform matrix of target (param target), - * in coordinate of its ancestor (param ancestor) - * - * @param target - * @param [ancestor] - */ - function getTransform(target, ancestor) { - var mat = identity([]); - while (target && target !== ancestor) { - mul$1(mat, target.getLocalTransform(), mat); - target = target.parent; - } - return mat; - } - /** - * Apply transform to an vertex. - * @param target [x, y] - * @param transform Can be: - * + Transform matrix: like [1, 0, 0, 1, 0, 0] - * + {position, rotation, scale}, the same as `zrender/Transformable`. - * @param invert Whether use invert matrix. - * @return [x, y] - */ - function applyTransform$1(target, transform, invert$1) { - if (transform && !isArrayLike(transform)) { - transform = Transformable.getLocalTransform(transform); - } - if (invert$1) { - transform = invert([], transform); - } - return applyTransform([], target, transform); - } - /** - * @param direction 'left' 'right' 'top' 'bottom' - * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0] - * @param invert Whether use invert matrix. - * @return 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$1(vertex, transform, invert); - return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top'; - } - function isNotGroup(el) { - return !el.isGroup; - } - function isPath(el) { - return el.shape != null; - } - /** - * Apply group transition animation from g1 to g2. - * If no animatableModel, no animation. - */ - function groupTransition(g1, g2, animatableModel) { - if (!g1 || !g2) { - return; - } - function getElMap(g) { - var elMap = {}; - g.traverse(function (el) { - if (isNotGroup(el) && el.anid) { - elMap[el.anid] = el; - } - }); - return elMap; - } - function getAnimatableProps(el) { - var obj = { - x: el.x, - y: el.y, - rotation: el.rotation - }; - if (isPath(el)) { - obj.shape = extend({}, el.shape); - } - return obj; - } - var elMap1 = getElMap(g1); - g2.traverse(function (el) { - if (isNotGroup(el) && el.anid) { - var oldEl = elMap1[el.anid]; - if (oldEl) { - var newProp = getAnimatableProps(el); - el.attr(getAnimatableProps(oldEl)); - updateProps(el, newProp, animatableModel, getECData(el).dataIndex); - } - } - }); - } - function clipPointsByRect(points, rect) { - // FIXME: This way might be incorrect when graphic clipped by a corner - // and when element has a border. - return map(points, function (point) { - var x = point[0]; - x = mathMax$4(x, rect.x); - x = mathMin$4(x, rect.x + rect.width); - var y = point[1]; - y = mathMax$4(y, rect.y); - y = mathMin$4(y, rect.y + rect.height); - return [x, y]; - }); - } - /** - * Return a new clipped rect. If rect size are negative, return undefined. - */ - function clipRectByRect(targetRect, rect) { - var x = mathMax$4(targetRect.x, rect.x); - var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width); - var y = mathMax$4(targetRect.y, rect.y); - var y2 = mathMin$4(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 - }; - } - } - function createIcon(iconStr, - // Support 'image://' or 'path://' or direct svg path. - opt, rect) { - var innerOpts = extend({ - rectHover: true - }, opt); - var style = innerOpts.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), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, 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. - */ - 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. - */ - 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 - // existing `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; - } - function setTooltipConfig(opt) { - var itemTooltipOption = opt.itemTooltipOption; - var componentModel = opt.componentModel; - var itemName = opt.itemName; - var itemTooltipOptionObj = isString(itemTooltipOption) ? { - formatter: itemTooltipOption - } : itemTooltipOption; - var mainType = componentModel.mainType; - var componentIndex = componentModel.componentIndex; - var formatterParams = { - componentType: mainType, - name: itemName, - $vars: ['name'] - }; - formatterParams[mainType + 'Index'] = componentIndex; - var formatterParamsExtra = opt.formatterParamsExtra; - if (formatterParamsExtra) { - each(keys(formatterParamsExtra), function (key) { - if (!hasOwn(formatterParams, key)) { - formatterParams[key] = formatterParamsExtra[key]; - formatterParams.$vars.push(key); - } - }); - } - var ecData = getECData(opt.el); - ecData.componentMainType = mainType; - ecData.componentIndex = componentIndex; - ecData.tooltipConfig = { - name: itemName, - option: defaults({ - content: itemName, - encodeHTMLContent: true, - formatterParams: formatterParams - }, itemTooltipOptionObj) - }; - } - function traverseElement(el, cb) { - var stopped; - // TODO - // Polyfill for fixing zrender group traverse don't visit it's root issue. - if (el.isGroup) { - stopped = cb(el); - } - if (!stopped) { - el.traverse(cb); - } - } - function traverseElements(els, cb) { - if (els) { - if (isArray(els)) { - for (var i = 0; i < els.length; i++) { - traverseElement(els[i], cb); - } - } else { - traverseElement(els, cb); - } - } - } - // Register built-in shapes. These shapes might be overwritten - // by users, although we do not recommend that. - registerShape('circle', Circle); - registerShape('ellipse', Ellipse); - registerShape('sector', Sector); - registerShape('ring', Ring); - registerShape('polygon', Polygon); - registerShape('polyline', Polyline); - registerShape('rect', Rect); - registerShape('line', Line); - registerShape('bezierCurve', BezierCurve); - registerShape('arc', Arc); - - var graphic = /*#__PURE__*/Object.freeze({ - __proto__: null, - updateProps: updateProps, - initProps: initProps, - removeElement: removeElement, - removeElementWithFadeOut: removeElementWithFadeOut, - isElementRemoved: isElementRemoved, - extendShape: extendShape, - extendPath: extendPath, - registerShape: registerShape, - getShapeClass: getShapeClass, - makePath: makePath, - makeImage: makeImage, - mergePath: mergePath$1, - resizePath: resizePath, - subPixelOptimizeLine: subPixelOptimizeLine$1, - subPixelOptimizeRect: subPixelOptimizeRect$1, - subPixelOptimize: subPixelOptimize$1, - getTransform: getTransform, - applyTransform: applyTransform$1, - transformDirection: transformDirection, - groupTransition: groupTransition, - clipPointsByRect: clipPointsByRect, - clipRectByRect: clipRectByRect, - createIcon: createIcon, - linePolygonIntersect: linePolygonIntersect, - lineLineIntersect: lineLineIntersect, - setTooltipConfig: setTooltipConfig, - traverseElements: traverseElements, - Group: Group, - Image: ZRImage, - Text: ZRText, - Circle: Circle, - Ellipse: Ellipse, - Sector: Sector, - Ring: Ring, - Polygon: Polygon, - Polyline: Polyline, - Rect: Rect, - Line: Line, - BezierCurve: BezierCurve, - Arc: Arc, - IncrementalDisplayable: IncrementalDisplayable, - CompoundPath: CompoundPath, - LinearGradient: LinearGradient, - RadialGradient: RadialGradient, - BoundingRect: BoundingRect, - OrientedBoundingRect: OrientedBoundingRect, - Point: Point, - Path: Path - }); - - var EMPTY_OBJ = {}; - function setLabelText(label, labelTexts) { - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var text = labelTexts[stateName]; - var state = label.ensureState(stateName); - state.style = state.style || {}; - state.style.text = text; - } - var oldStates = label.currentStates.slice(); - label.clearStates(true); - label.setStyle({ - text: labelTexts.normal - }); - label.useStates(oldStates, true); - } - function getLabelText(opt, stateModels, interpolatedValue) { - var labelFetcher = opt.labelFetcher; - var labelDataIndex = opt.labelDataIndex; - var labelDimIndex = opt.labelDimIndex; - var normalModel = stateModels.normal; - var baseText; - if (labelFetcher) { - baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? { - interpolatedValue: interpolatedValue - } : null); - } - if (baseText == null) { - baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText; - } - var statesText = { - normal: baseText - }; - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var stateModel = stateModels[stateName]; - statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText); - } - return statesText; - } - function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified - // TODO specified position? - ) { - opt = opt || EMPTY_OBJ; - var isSetOnText = targetEl instanceof ZRText; - var needsCreateText = false; - for (var i = 0; i < DISPLAY_STATES.length; i++) { - var stateModel = labelStatesModels[DISPLAY_STATES[i]]; - if (stateModel && stateModel.getShallow('show')) { - needsCreateText = true; - break; - } - } - var textContent = isSetOnText ? targetEl : targetEl.getTextContent(); - if (needsCreateText) { - if (!isSetOnText) { - // Reuse the previous - if (!textContent) { - textContent = new ZRText(); - targetEl.setTextContent(textContent); - } - // Use same state proxy - if (targetEl.stateProxy) { - textContent.stateProxy = targetEl.stateProxy; - } - } - var labelStatesTexts = getLabelText(opt, labelStatesModels); - var normalModel = labelStatesModels.normal; - var showNormal = !!normalModel.getShallow('show'); - var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText); - normalStyle.text = labelStatesTexts.normal; - if (!isSetOnText) { - // Always create new - targetEl.setTextConfig(createTextConfig(normalModel, opt, false)); - } - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var stateModel = labelStatesModels[stateName]; - if (stateModel) { - var stateObj = textContent.ensureState(stateName); - var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal); - if (stateShow !== showNormal) { - stateObj.ignore = !stateShow; - } - stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText); - stateObj.style.text = labelStatesTexts[stateName]; - if (!isSetOnText) { - var targetElEmphasisState = targetEl.ensureState(stateName); - targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true); - } - } - } - // PENDING: if there is many requirements that emphasis position - // need to be different from normal position, we might consider - // auto silent is those cases. - textContent.silent = !!normalModel.getShallow('silent'); - // Keep x and y - if (textContent.style.x != null) { - normalStyle.x = textContent.style.x; - } - if (textContent.style.y != null) { - normalStyle.y = textContent.style.y; - } - textContent.ignore = !showNormal; - // Always create new style. - textContent.useStyle(normalStyle); - textContent.dirty(); - if (opt.enableTextSetter) { - labelInner(textContent).setLabelText = function (interpolatedValue) { - var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue); - setLabelText(textContent, labelStatesTexts); - }; - } - } else if (textContent) { - // Not display rich text. - textContent.ignore = true; - } - targetEl.dirty(); - } - function getLabelStatesModels(itemModel, labelName) { - labelName = labelName || 'label'; - var statesModels = { - normal: itemModel.getModel(labelName) - }; - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - statesModels[stateName] = itemModel.getModel([stateName, labelName]); - } - return statesModels; - } - /** - * Set basic textStyle properties. - */ - function createTextStyle(textStyleModel, specifiedTextStyle, - // Fixed style in the code. Can't be set by model. - opt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender. - ) { - var textStyle = {}; - setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached); - specifiedTextStyle && extend(textStyle, specifiedTextStyle); - // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); - return textStyle; - } - function createTextConfig(textStyleModel, opt, isNotNormal) { - opt = opt || {}; - var textConfig = {}; - var labelPosition; - var labelRotate = textStyleModel.getShallow('rotate'); - var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5); - var labelOffset = textStyleModel.getShallow('offset'); - labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside'); - // 'outside' is not a valid zr textPostion value, but used - // in bar series, and magric type should be considered. - labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top'); - if (labelPosition != null) { - textConfig.position = labelPosition; - } - if (labelOffset != null) { - textConfig.offset = labelOffset; - } - if (labelRotate != null) { - labelRotate *= Math.PI / 180; - textConfig.rotation = labelRotate; - } - if (labelDistance != null) { - textConfig.distance = labelDistance; - } - // fill and auto is determined by the color of path fill if it's not specified by developers. - textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto'; - return textConfig; - } - /** - * 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.) - */ - function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) { - // Consider there will be abnormal when merge hover style to normal style if given default value. - opt = opt || EMPTY_OBJ; - 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_1 in richItemNames) { - if (richItemNames.hasOwnProperty(name_1)) { - // Cascade is supported in rich. - var richTextStyle = textStyleModel.getModel(['rich', name_1]); - // 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_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true); - } - } - } - if (richResult) { - textStyle.rich = richResult; - } - var overflow = textStyleModel.get('overflow'); - if (overflow) { - textStyle.overflow = overflow; - } - var margin = textStyleModel.get('minMargin'); - if (margin != null) { - textStyle.margin = margin; - } - setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false); - } - // Consider case: - // { - // data: [{ - // value: 12, - // label: { - // rich: { - // // no 'a' here but using parent 'a'. - // } - // } - // }], - // rich: { - // a: { ... } - // } - // } - // TODO TextStyleModel - 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 || {}; - var richKeys = keys(rich); - for (var i = 0; i < richKeys.length; i++) { - var richKey = richKeys[i]; - richItemNameMap[richKey] = 1; - } - } - textStyleModel = textStyleModel.parentModel; - } - return richItemNameMap; - } - var TEXT_PROPS_WITH_GLOBAL = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY']; - var TEXT_PROPS_SELF = ['align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign', 'ellipsis']; - var TEXT_PROPS_BOX = ['padding', 'borderWidth', 'borderRadius', 'borderDashOffset', 'backgroundColor', 'borderColor', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY']; - function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) { - // In merge mode, default value should not be given. - globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ; - var inheritColor = opt && opt.inheritColor; - var fillColor = textStyleModel.getShallow('color'); - var strokeColor = textStyleModel.getShallow('textBorderColor'); - var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity); - if (fillColor === 'inherit' || fillColor === 'auto') { - if ("development" !== 'production') { - if (fillColor === 'auto') { - deprecateReplaceLog('color: \'auto\'', 'color: \'inherit\''); - } - } - if (inheritColor) { - fillColor = inheritColor; - } else { - fillColor = null; - } - } - if (strokeColor === 'inherit' || strokeColor === 'auto') { - if ("development" !== 'production') { - if (strokeColor === 'auto') { - deprecateReplaceLog('color: \'auto\'', 'color: \'inherit\''); - } - } - if (inheritColor) { - strokeColor = inheritColor; - } else { - strokeColor = null; - } - } - if (!isAttached) { - // Only use default global textStyle.color if text is individual. - // Otherwise it will use the strategy of attached text color because text may be on a path. - fillColor = fillColor || globalTextStyle.color; - strokeColor = strokeColor || globalTextStyle.textBorderColor; - } - if (fillColor != null) { - textStyle.fill = fillColor; - } - if (strokeColor != null) { - textStyle.stroke = strokeColor; - } - var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth); - if (textBorderWidth != null) { - textStyle.lineWidth = textBorderWidth; - } - var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType); - if (textBorderType != null) { - textStyle.lineDash = textBorderType; - } - var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset); - if (textBorderDashOffset != null) { - textStyle.lineDashOffset = textBorderDashOffset; - } - if (!isNotNormal && opacity == null && !inRich) { - opacity = opt && opt.defaultOpacity; - } - if (opacity != null) { - textStyle.opacity = opacity; - } - // TODO - if (!isNotNormal && !isAttached) { - // Set default finally. - if (textStyle.fill == null && opt.inheritColor) { - textStyle.fill = opt.inheritColor; - } - } - // 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. - for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) { - var key = TEXT_PROPS_WITH_GLOBAL[i]; - var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]); - if (val != null) { - textStyle[key] = val; - } - } - for (var i = 0; i < TEXT_PROPS_SELF.length; i++) { - var key = TEXT_PROPS_SELF[i]; - var val = textStyleModel.getShallow(key); - if (val != null) { - textStyle[key] = val; - } - } - if (textStyle.verticalAlign == null) { - var baseline = textStyleModel.getShallow('baseline'); - if (baseline != null) { - textStyle.verticalAlign = baseline; - } - } - if (!isBlock || !opt.disableBox) { - for (var i = 0; i < TEXT_PROPS_BOX.length; i++) { - var key = TEXT_PROPS_BOX[i]; - var val = textStyleModel.getShallow(key); - if (val != null) { - textStyle[key] = val; - } - } - var borderType = textStyleModel.getShallow('borderType'); - if (borderType != null) { - textStyle.borderDash = borderType; - } - if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) { - if ("development" !== 'production') { - if (textStyle.backgroundColor === 'auto') { - deprecateReplaceLog('backgroundColor: \'auto\'', 'backgroundColor: \'inherit\''); - } - } - textStyle.backgroundColor = inheritColor; - } - if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) { - if ("development" !== 'production') { - if (textStyle.borderColor === 'auto') { - deprecateReplaceLog('borderColor: \'auto\'', 'borderColor: \'inherit\''); - } - } - textStyle.borderColor = inheritColor; - } - } - } - function getFont(opt, ecModel) { - var gTextStyleModel = ecModel && ecModel.getModel('textStyle'); - return 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(' ')); - } - var labelInner = makeInner(); - function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) { - if (!label) { - return; - } - var obj = labelInner(label); - obj.prevValue = obj.value; - obj.value = value; - var normalLabelModel = labelStatesModels.normal; - obj.valueAnimation = normalLabelModel.get('valueAnimation'); - if (obj.valueAnimation) { - obj.precision = normalLabelModel.get('precision'); - obj.defaultInterpolatedText = getDefaultText; - obj.statesModels = labelStatesModels; - } - } - function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) { - var labelInnerStore = labelInner(textEl); - if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) { - // Value not changed, no new label animation - return; - } - var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText; - // Consider the case that being animating, do not use the `obj.value`, - // Otherwise it will jump to the `obj.value` when this new animation started. - var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue); - var targetValue = labelInnerStore.value; - function during(percent) { - var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent); - labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated; - var labelText = getLabelText({ - labelDataIndex: dataIndex, - labelFetcher: labelFetcher, - defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + '' - }, labelInnerStore.statesModels, interpolated); - setLabelText(textEl, labelText); - } - textEl.percent = 0; - (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, { - // percent is used to prevent animation from being aborted #15916 - percent: 1 - }, animatableModel, dataIndex, null, during); - } - - var PATH_COLOR = ['textStyle', 'color']; - var textStyleParams = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'padding', 'lineHeight', 'rich', 'width', 'height', 'overflow']; - // TODO Performance improvement? - var tmpText = new ZRText(); - var TextStyleMixin = /** @class */function () { - function TextStyleMixin() {} - /** - * Get color property or get color from option.textStyle.color - */ - // TODO Callback - TextStyleMixin.prototype.getTextColor = function (isEmphasis) { - var ecModel = this.ecModel; - return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null); - }; - /** - * Create font string from fontStyle, fontWeight, fontSize, fontFamily - * @return {string} - */ - TextStyleMixin.prototype.getFont = function () { - return getFont({ - fontStyle: this.getShallow('fontStyle'), - fontWeight: this.getShallow('fontWeight'), - fontSize: this.getShallow('fontSize'), - fontFamily: this.getShallow('fontFamily') - }, this.ecModel); - }; - TextStyleMixin.prototype.getTextRect = function (text) { - var style = { - text: text, - verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline') - }; - for (var i = 0; i < textStyleParams.length; i++) { - style[textStyleParams[i]] = this.getShallow(textStyleParams[i]); - } - tmpText.useStyle(style); - tmpText.update(); - return tmpText.getBoundingRect(); - }; - return TextStyleMixin; - }(); - - var LINE_STYLE_KEY_MAP = [['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'type'], ['lineDashOffset', 'dashOffset'], ['lineCap', 'cap'], ['lineJoin', 'join'], ['miterLimit'] - // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. - ]; - - var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP); - var LineStyleMixin = /** @class */function () { - function LineStyleMixin() {} - LineStyleMixin.prototype.getLineStyle = function (excludes) { - return getLineStyle(this, excludes); - }; - return LineStyleMixin; - }(); - - var ITEM_STYLE_KEY_MAP = [['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'borderType'], ['lineDashOffset', 'borderDashOffset'], ['lineCap', 'borderCap'], ['lineJoin', 'borderJoin'], ['miterLimit', 'borderMiterLimit'] - // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. - ]; - - var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP); - var ItemStyleMixin = /** @class */function () { - function ItemStyleMixin() {} - ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) { - return getItemStyle(this, excludes, includes); - }; - return ItemStyleMixin; - }(); - - var Model = /** @class */function () { - function Model(option, parentModel, ecModel) { - this.parentModel = parentModel; - this.ecModel = ecModel; - this.option = option; - // Simple optimization - // if (this.init) { - // if (arguments.length <= 4) { - // this.init(option, parentModel, ecModel, extraOpt); - // } - // else { - // this.init.apply(this, arguments); - // } - // } - } - - Model.prototype.init = function (option, parentModel, ecModel) { - var rest = []; - for (var _i = 3; _i < arguments.length; _i++) { - rest[_i - 3] = arguments[_i]; - } - }; - /** - * Merge the input option to me. - */ - Model.prototype.mergeOption = function (option, ecModel) { - merge(this.option, option, true); - }; - // `path` can be 'a.b.c', so the return value type have to be `ModelOption` - // TODO: TYPE strict key check? - // get(path: string | string[], ignoreParent?: boolean): ModelOption; - Model.prototype.get = function (path, ignoreParent) { - if (path == null) { - return this.option; - } - return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel); - }; - Model.prototype.getShallow = function (key, ignoreParent) { - var option = this.option; - var val = option == null ? option : option[key]; - if (val == null && !ignoreParent) { - var parentModel = this.parentModel; - if (parentModel) { - // FIXME:TS do not know how to make it works - val = parentModel.getShallow(key); - } - } - return val; - }; - // `path` can be 'a.b.c', so the return value type have to be `Model` - // getModel(path: string | string[], parentModel?: Model): Model; - // TODO 'a.b.c' is deprecated - Model.prototype.getModel = function (path, parentModel) { - var hasPath = path != null; - var pathFinal = hasPath ? this.parsePath(path) : null; - var obj = hasPath ? this._doGet(pathFinal) : this.option; - parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal)); - return new Model(obj, parentModel, this.ecModel); - }; - /** - * If model has option - */ - Model.prototype.isEmpty = function () { - return this.option == null; - }; - Model.prototype.restoreData = function () {}; - // Pending - Model.prototype.clone = function () { - var Ctor = this.constructor; - return new Ctor(clone(this.option)); - }; - // setReadOnly(properties): void { - // clazzUtil.setReadOnly(this, properties); - // } - // If path is null/undefined, return null/undefined. - Model.prototype.parsePath = function (path) { - if (typeof path === 'string') { - return path.split('.'); - } - return path; - }; - // Resolve path for parent. Perhaps useful when parent use a different property. - // Default to be a identity resolver. - // Can be modified to a different resolver. - Model.prototype.resolveParentPath = function (path) { - return path; - }; - // FIXME:TS check whether put this method here - Model.prototype.isAnimationEnabled = function () { - if (!env.node && this.option) { - if (this.option.animation != null) { - return !!this.option.animation; - } else if (this.parentModel) { - return this.parentModel.isAnimationEnabled(); - } - } - }; - Model.prototype._doGet = function (pathArr, parentModel) { - var obj = this.option; - if (!pathArr) { - return obj; - } - for (var i = 0; i < pathArr.length; i++) { - // Ignore empty - if (!pathArr[i]) { - continue; - } - // obj could be number/string/... (like 0) - obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null; - if (obj == null) { - break; - } - } - if (obj == null && parentModel) { - obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel); - } - return obj; - }; - return Model; - }(); - // Enable Model.extend. - enableClassExtend(Model); - enableClassCheck(Model); - mixin(Model, LineStyleMixin); - mixin(Model, ItemStyleMixin); - mixin(Model, AreaStyleMixin); - mixin(Model, TextStyleMixin); - - // A random offset - var base = Math.round(Math.random() * 10); - /** - * @public - * @param {string} type - * @return {string} - */ - function getUID(type) { - // Considering the case of crossing js context, - // use Math.random to make id as unique as possible. - return [type || '', base++].join('_'); - } - /** - * Implements `SubTypeDefaulterManager` for `target`. - */ - function enableSubTypeDefaulter(target) { - var subTypeDefaulters = {}; - target.registerSubTypeDefaulter = function (componentType, defaulter) { - var componentTypeInfo = parseClassType(componentType); - subTypeDefaulters[componentTypeInfo.main] = defaulter; - }; - target.determineSubType = function (componentType, option) { - var type = option.type; - if (!type) { - var componentTypeMain = parseClassType(componentType).main; - if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) { - type = subTypeDefaulters[componentTypeMain](option); - } - } - return type; - }; - } - /** - * Implements `TopologicalTravelable` for `entity`. - * - * Topological travel on Activity Network (Activity On Vertices). - * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis']. - * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology. - * If there is circular dependencey, Error will be thrown. - */ - function enableTopologicalTravel(entity, dependencyGetter) { - /** - * @param targetNameList Target Component type list. - * Can be ['aa', 'bb', 'aa.xx'] - * @param fullNameList By which we can build dependency graph. - * @param callback Params: componentType, dependencies. - * @param context Scope of callback. - */ - entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) { - if (!targetNameList.length) { - return; - } - var result = makeDepndencyGraph(fullNameList); - var graph = result.graph; - var noEntryList = result.noEntryList; - var targetNameSet = {}; - each(targetNameList, function (name) { - targetNameSet[name] = true; - }); - while (noEntryList.length) { - var currComponentType = noEntryList.pop(); - var currVertex = graph[currComponentType]; - var isInTargetNameSet = !!targetNameSet[currComponentType]; - if (isInTargetNameSet) { - callback.call(context, currComponentType, currVertex.originalDeps.slice()); - delete targetNameSet[currComponentType]; - } - each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge); - } - each(targetNameSet, function () { - var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList); - } - throw new Error(errMsg); - }); - function removeEdge(succComponentType) { - graph[succComponentType].entryCount--; - if (graph[succComponentType].entryCount === 0) { - noEntryList.push(succComponentType); - } - } - // Consider this case: legend depends on series, and we call - // chart.setOption({series: [...]}), where only series is in option. - // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will - // not be called, but only sereis.mergeOption is called. Thus legend - // have no chance to update its local record about series (like which - // name of series is available in legend). - function removeEdgeAndAdd(succComponentType) { - targetNameSet[succComponentType] = true; - removeEdge(succComponentType); - } - }; - function makeDepndencyGraph(fullNameList) { - var graph = {}; - var noEntryList = []; - each(fullNameList, function (name) { - var thisItem = createDependencyGraphItem(graph, name); - var originalDeps = thisItem.originalDeps = dependencyGetter(name); - var availableDeps = getAvailableDependencies(originalDeps, fullNameList); - thisItem.entryCount = availableDeps.length; - if (thisItem.entryCount === 0) { - noEntryList.push(name); - } - each(availableDeps, function (dependentName) { - if (indexOf(thisItem.predecessor, dependentName) < 0) { - thisItem.predecessor.push(dependentName); - } - var thatItem = createDependencyGraphItem(graph, dependentName); - if (indexOf(thatItem.successor, dependentName) < 0) { - thatItem.successor.push(name); - } - }); - }); - return { - graph: graph, - noEntryList: noEntryList - }; - } - function createDependencyGraphItem(graph, name) { - if (!graph[name]) { - graph[name] = { - predecessor: [], - successor: [] - }; - } - return graph[name]; - } - function getAvailableDependencies(originalDeps, fullNameList) { - var availableDeps = []; - each(originalDeps, function (dep) { - indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep); - }); - return availableDeps; - } - } - function inheritDefaultOption(superOption, subOption) { - // See also `model/Component.ts#getDefaultOption` - return merge(merge({}, superOption, true), subOption, true); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - /** - * Language: English. - */ - var langEN = { - time: { - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] - }, - legend: { - selector: { - all: 'All', - inverse: 'Inv' - } - }, - toolbox: { - brush: { - title: { - rect: 'Box Select', - polygon: 'Lasso Select', - lineX: 'Horizontally Select', - lineY: 'Vertically Select', - keep: 'Keep Selections', - clear: 'Clear Selections' - } - }, - dataView: { - title: 'Data View', - lang: ['Data View', 'Close', 'Refresh'] - }, - dataZoom: { - title: { - zoom: 'Zoom', - back: 'Zoom Reset' - } - }, - magicType: { - title: { - line: 'Switch to Line Chart', - bar: 'Switch to Bar Chart', - stack: 'Stack', - tiled: 'Tile' - } - }, - restore: { - title: 'Restore' - }, - saveAsImage: { - title: 'Save as Image', - lang: ['Right Click to Save Image'] - } - }, - series: { - typeNames: { - pie: 'Pie chart', - bar: 'Bar chart', - line: 'Line chart', - scatter: 'Scatter plot', - effectScatter: 'Ripple scatter plot', - radar: 'Radar chart', - tree: 'Tree', - treemap: 'Treemap', - boxplot: 'Boxplot', - candlestick: 'Candlestick', - k: 'K line chart', - heatmap: 'Heat map', - map: 'Map', - parallel: 'Parallel coordinate map', - lines: 'Line graph', - graph: 'Relationship graph', - sankey: 'Sankey diagram', - funnel: 'Funnel chart', - gauge: 'Gauge', - pictorialBar: 'Pictorial bar', - themeRiver: 'Theme River Map', - sunburst: 'Sunburst', - custom: 'Custom chart', - chart: 'Chart' - } - }, - aria: { - general: { - withTitle: 'This is a chart about "{title}"', - withoutTitle: 'This is a chart' - }, - series: { - single: { - prefix: '', - withName: ' with type {seriesType} named {seriesName}.', - withoutName: ' with type {seriesType}.' - }, - multiple: { - prefix: '. It consists of {seriesCount} series count.', - withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.', - withoutName: ' The {seriesId} series is a {seriesType}.', - separator: { - middle: '', - end: '' - } - } - }, - data: { - allData: 'The data is as follows: ', - partialData: 'The first {displayCnt} items are: ', - withName: 'the data for {name} is {value}', - withoutName: '{value}', - separator: { - middle: ', ', - end: '. ' - } - } - } - }; - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 langZH = { - time: { - month: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - monthAbbr: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - dayOfWeek: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - dayOfWeekAbbr: ['日', '一', '二', '三', '四', '五', '六'] - }, - legend: { - selector: { - all: '全选', - inverse: '反选' - } - }, - toolbox: { - brush: { - title: { - rect: '矩形选择', - polygon: '圈选', - lineX: '横向选择', - lineY: '纵向选择', - keep: '保持选择', - clear: '清除选择' - } - }, - dataView: { - title: '数据视图', - lang: ['数据视图', '关闭', '刷新'] - }, - dataZoom: { - title: { - zoom: '区域缩放', - back: '区域缩放还原' - } - }, - magicType: { - title: { - line: '切换为折线图', - bar: '切换为柱状图', - stack: '切换为堆叠', - tiled: '切换为平铺' - } - }, - restore: { - title: '还原' - }, - saveAsImage: { - title: '保存为图片', - lang: ['右键另存为图片'] - } - }, - series: { - typeNames: { - pie: '饼图', - bar: '柱状图', - line: '折线图', - scatter: '散点图', - effectScatter: '涟漪散点图', - radar: '雷达图', - tree: '树图', - treemap: '矩形树图', - boxplot: '箱型图', - candlestick: 'K线图', - k: 'K线图', - heatmap: '热力图', - map: '地图', - parallel: '平行坐标图', - lines: '线图', - graph: '关系图', - sankey: '桑基图', - funnel: '漏斗图', - gauge: '仪表盘图', - pictorialBar: '象形柱图', - themeRiver: '主题河流图', - sunburst: '旭日图', - custom: '自定义图表', - chart: '图表' - } - }, - aria: { - general: { - withTitle: '这是一个关于“{title}”的图表。', - withoutTitle: '这是一个图表,' - }, - series: { - single: { - prefix: '', - withName: '图表类型是{seriesType},表示{seriesName}。', - withoutName: '图表类型是{seriesType}。' - }, - multiple: { - prefix: '它由{seriesCount}个图表系列组成。', - withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},', - withoutName: '第{seriesId}个系列是一个{seriesType},', - separator: { - middle: ';', - end: '。' - } - } - }, - data: { - allData: '其数据是——', - partialData: '其中,前{displayCnt}项是——', - withName: '{name}的数据是{value}', - withoutName: '{value}', - separator: { - middle: ',', - end: '' - } - } - } - }; - - var LOCALE_ZH = 'ZH'; - var LOCALE_EN = 'EN'; - var DEFAULT_LOCALE = LOCALE_EN; - var localeStorage = {}; - var localeModels = {}; - var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () { - var langStr = ( /* eslint-disable-next-line */ - document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE).toUpperCase(); - return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE; - }(); - function registerLocale(locale, localeObj) { - locale = locale.toUpperCase(); - localeModels[locale] = new Model(localeObj); - localeStorage[locale] = localeObj; - } - // export function getLocale(locale: string) { - // return localeStorage[locale]; - // } - function createLocaleObject(locale) { - if (isString(locale)) { - var localeObj = localeStorage[locale.toUpperCase()] || {}; - if (locale === LOCALE_ZH || locale === LOCALE_EN) { - return clone(localeObj); - } else { - return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false); - } - } else { - return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false); - } - } - function getLocaleModel(lang) { - return localeModels[lang]; - } - function getDefaultLocaleModel() { - return localeModels[DEFAULT_LOCALE]; - } - // Default locale - registerLocale(LOCALE_EN, langEN); - registerLocale(LOCALE_ZH, langZH); - - var ONE_SECOND = 1000; - var ONE_MINUTE = ONE_SECOND * 60; - var ONE_HOUR = ONE_MINUTE * 60; - var ONE_DAY = ONE_HOUR * 24; - var ONE_YEAR = ONE_DAY * 365; - var defaultLeveledFormatter = { - year: '{yyyy}', - month: '{MMM}', - day: '{d}', - hour: '{HH}:{mm}', - minute: '{HH}:{mm}', - second: '{HH}:{mm}:{ss}', - millisecond: '{HH}:{mm}:{ss} {SSS}', - none: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}' - }; - var fullDayFormatter = '{yyyy}-{MM}-{dd}'; - var fullLeveledFormatter = { - year: '{yyyy}', - month: '{yyyy}-{MM}', - day: fullDayFormatter, - hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour, - minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute, - second: fullDayFormatter + ' ' + defaultLeveledFormatter.second, - millisecond: defaultLeveledFormatter.none - }; - var primaryTimeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond']; - var timeUnits = ['year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day', 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond']; - function pad(str, len) { - str += ''; - return '0000'.substr(0, len - str.length) + str; - } - function getPrimaryTimeUnit(timeUnit) { - switch (timeUnit) { - case 'half-year': - case 'quarter': - return 'month'; - case 'week': - case 'half-week': - return 'day'; - case 'half-day': - case 'quarter-day': - return 'hour'; - default: - // year, minutes, second, milliseconds - return timeUnit; - } - } - function isPrimaryTimeUnit(timeUnit) { - return timeUnit === getPrimaryTimeUnit(timeUnit); - } - function getDefaultFormatPrecisionOfInterval(timeUnit) { - switch (timeUnit) { - case 'year': - case 'month': - return 'day'; - case 'millisecond': - return 'millisecond'; - default: - // Also for day, hour, minute, second - return 'second'; - } - } - function format( - // Note: The result based on `isUTC` are totally different, which can not be just simply - // substituted by the result without `isUTC`. So we make the param `isUTC` mandatory. - time, template, isUTC, lang) { - var date = parseDate(time); - var y = date[fullYearGetterName(isUTC)](); - var M = date[monthGetterName(isUTC)]() + 1; - var q = Math.floor((M - 1) / 3) + 1; - var d = date[dateGetterName(isUTC)](); - var e = date['get' + (isUTC ? 'UTC' : '') + 'Day'](); - var H = date[hoursGetterName(isUTC)](); - var h = (H - 1) % 12 + 1; - var m = date[minutesGetterName(isUTC)](); - var s = date[secondsGetterName(isUTC)](); - var S = date[millisecondsGetterName(isUTC)](); - var a = H >= 12 ? 'pm' : 'am'; - var A = a.toUpperCase(); - var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel(); - var timeModel = localeModel.getModel('time'); - var month = timeModel.get('month'); - var monthAbbr = timeModel.get('monthAbbr'); - var dayOfWeek = timeModel.get('dayOfWeek'); - var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr'); - return (template || '').replace(/{a}/g, a + '').replace(/{A}/g, A + '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, pad(y % 100 + '', 2)).replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + ''); - } - function leveledFormat(tick, idx, formatter, lang, isUTC) { - var template = null; - if (isString(formatter)) { - // Single formatter for all units at all levels - template = formatter; - } else if (isFunction(formatter)) { - // Callback formatter - template = formatter(tick.value, idx, { - level: tick.level - }); - } else { - var defaults$1 = extend({}, defaultLeveledFormatter); - if (tick.level > 0) { - for (var i = 0; i < primaryTimeUnits.length; ++i) { - defaults$1[primaryTimeUnits[i]] = "{primary|" + defaults$1[primaryTimeUnits[i]] + "}"; - } - } - var mergedFormatter = formatter ? formatter.inherit === false ? formatter // Use formatter with bigger units - : defaults(formatter, defaults$1) : defaults$1; - var unit = getUnitFromValue(tick.value, isUTC); - if (mergedFormatter[unit]) { - template = mergedFormatter[unit]; - } else if (mergedFormatter.inherit) { - // Unit formatter is not defined and should inherit from bigger units - var targetId = timeUnits.indexOf(unit); - for (var i = targetId - 1; i >= 0; --i) { - if (mergedFormatter[unit]) { - template = mergedFormatter[unit]; - break; - } - } - template = template || defaults$1.none; - } - if (isArray(template)) { - var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level; - levelId = Math.min(levelId, template.length - 1); - template = template[levelId]; - } - } - return format(new Date(tick.value), template, isUTC, lang); - } - function getUnitFromValue(value, isUTC) { - var date = parseDate(value); - var M = date[monthGetterName(isUTC)]() + 1; - var d = date[dateGetterName(isUTC)](); - var h = date[hoursGetterName(isUTC)](); - var m = date[minutesGetterName(isUTC)](); - var s = date[secondsGetterName(isUTC)](); - var S = date[millisecondsGetterName(isUTC)](); - var isSecond = S === 0; - var isMinute = isSecond && s === 0; - var isHour = isMinute && m === 0; - var isDay = isHour && h === 0; - var isMonth = isDay && d === 1; - var isYear = isMonth && M === 1; - if (isYear) { - return 'year'; - } else if (isMonth) { - return 'month'; - } else if (isDay) { - return 'day'; - } else if (isHour) { - return 'hour'; - } else if (isMinute) { - return 'minute'; - } else if (isSecond) { - return 'second'; - } else { - return 'millisecond'; - } - } - function getUnitValue(value, unit, isUTC) { - var date = isNumber(value) ? parseDate(value) : value; - unit = unit || getUnitFromValue(value, isUTC); - switch (unit) { - case 'year': - return date[fullYearGetterName(isUTC)](); - case 'half-year': - return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0; - case 'quarter': - return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4); - case 'month': - return date[monthGetterName(isUTC)](); - case 'day': - return date[dateGetterName(isUTC)](); - case 'half-day': - return date[hoursGetterName(isUTC)]() / 24; - case 'hour': - return date[hoursGetterName(isUTC)](); - case 'minute': - return date[minutesGetterName(isUTC)](); - case 'second': - return date[secondsGetterName(isUTC)](); - case 'millisecond': - return date[millisecondsGetterName(isUTC)](); - } - } - function fullYearGetterName(isUTC) { - return isUTC ? 'getUTCFullYear' : 'getFullYear'; - } - function monthGetterName(isUTC) { - return isUTC ? 'getUTCMonth' : 'getMonth'; - } - function dateGetterName(isUTC) { - return isUTC ? 'getUTCDate' : 'getDate'; - } - function hoursGetterName(isUTC) { - return isUTC ? 'getUTCHours' : 'getHours'; - } - function minutesGetterName(isUTC) { - return isUTC ? 'getUTCMinutes' : 'getMinutes'; - } - function secondsGetterName(isUTC) { - return isUTC ? 'getUTCSeconds' : 'getSeconds'; - } - function millisecondsGetterName(isUTC) { - return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds'; - } - function fullYearSetterName(isUTC) { - return isUTC ? 'setUTCFullYear' : 'setFullYear'; - } - function monthSetterName(isUTC) { - return isUTC ? 'setUTCMonth' : 'setMonth'; - } - function dateSetterName(isUTC) { - return isUTC ? 'setUTCDate' : 'setDate'; - } - function hoursSetterName(isUTC) { - return isUTC ? 'setUTCHours' : 'setHours'; - } - function minutesSetterName(isUTC) { - return isUTC ? 'setUTCMinutes' : 'setMinutes'; - } - function secondsSetterName(isUTC) { - return isUTC ? 'setUTCSeconds' : 'setSeconds'; - } - function millisecondsSetterName(isUTC) { - return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds'; - } - - function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) { - var textEl = new ZRText({ - style: { - text: text, - font: font, - align: align, - verticalAlign: verticalAlign, - padding: padding, - rich: rich, - overflow: truncate ? 'truncate' : null, - lineHeight: lineHeight - } - }); - return textEl.getBoundingRect(); - } - - /** - * Add a comma each three digit. - */ - function addCommas(x) { - if (!isNumeric(x)) { - return isString(x) ? x : '-'; - } - var parts = (x + '').split('.'); - return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : ''); - } - function toCamelCase(str, upperCaseFirst) { - str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) { - return group1.toUpperCase(); - }); - if (upperCaseFirst && str) { - str = str.charAt(0).toUpperCase() + str.slice(1); - } - return str; - } - var normalizeCssArray$1 = normalizeCssArray; - /** - * Make value user readable for tooltip and label. - * "User readable": - * Try to not print programmer-specific text like NaN, Infinity, null, undefined. - * Avoid to display an empty string, which users can not recognize there is - * a value and it might look like a bug. - */ - function makeValueReadable(value, valueType, useUTC) { - var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}'; - function stringToUserReadable(str) { - return str && trim(str) ? str : '-'; - } - function isNumberUserReadable(num) { - return !!(num != null && !isNaN(num) && isFinite(num)); - } - var isTypeTime = valueType === 'time'; - var isValueDate = value instanceof Date; - if (isTypeTime || isValueDate) { - var date = isTypeTime ? parseDate(value) : value; - if (!isNaN(+date)) { - return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC); - } else if (isValueDate) { - return '-'; - } - // In other cases, continue to try to display the value in the following code. - } - - if (valueType === 'ordinal') { - return isStringSafe(value) ? stringToUserReadable(value) : isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-'; - } - // By default. - var numericResult = numericToNumber(value); - return isNumberUserReadable(numericResult) ? addCommas(numericResult) : isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-'; - } - var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g']; - var wrapVar = function (varName, seriesIdx) { - return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}'; - }; - /** - * Template formatter - * @param {Array.|Object} paramsList - */ - function formatTpl(tpl, paramsList, encode) { - if (!isArray(paramsList)) { - paramsList = [paramsList]; - } - var seriesLen = paramsList.length; - if (!seriesLen) { - return ''; - } - var $vars = paramsList[0].$vars || []; - for (var i = 0; i < $vars.length; i++) { - var alias = TPL_VAR_ALIAS[i]; - tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0)); - } - for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) { - for (var k = 0; k < $vars.length; k++) { - var val = paramsList[seriesIdx][$vars[k]]; - tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val); - } - } - return tpl; - } - /** - * simple Template formatter - */ - function formatTplSimple(tpl, param, encode) { - each(param, function (value, key) { - tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value); - }); - return tpl; - } - function getTooltipMarker(inOpt, extraCssText) { - var opt = isString(inOpt) ? { - color: inOpt, - extraCssText: extraCssText - } : inOpt || {}; - var color = opt.color; - var type = opt.type; - extraCssText = opt.extraCssText; - var renderMode = opt.renderMode || 'html'; - if (!color) { - return ''; - } - if (renderMode === 'html') { - return type === 'subItem' ? '' : ''; - } else { - // Should better not to auto generate style name by auto-increment number here. - // Because this util is usually called in tooltip formatter, which is probably - // called repeatedly when mouse move and the auto-increment number increases fast. - // Users can make their own style name by theirselves, make it unique and readable. - var markerId = opt.markerId || 'markerX'; - return { - renderMode: renderMode, - content: '{' + markerId + '|} ', - style: type === 'subItem' ? { - width: 4, - height: 4, - borderRadius: 2, - backgroundColor: color - } : { - width: 10, - height: 10, - borderRadius: 5, - backgroundColor: color - } - }; - } - } - /** - * @deprecated Use `time/format` instead. - * ISO Date format - * @param {string} tpl - * @param {number} value - * @param {boolean} [isUTC=false] Default in local time. - * see `module:echarts/scale/Time` - * and `module:echarts/util/number#parseDate`. - * @inner - */ - function formatTime(tpl, value, isUTC) { - if ("development" !== 'production') { - deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format'); - } - if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') { - tpl = 'MM-dd\nyyyy'; - } - var date = parseDate(value); - var getUTC = isUTC ? 'getUTC' : 'get'; - var y = date[getUTC + 'FullYear'](); - var M = date[getUTC + 'Month']() + 1; - var d = date[getUTC + 'Date'](); - var h = date[getUTC + 'Hours'](); - var m = date[getUTC + 'Minutes'](); - var s = date[getUTC + 'Seconds'](); - var S = date[getUTC + 'Milliseconds'](); - tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', pad(y % 100 + '', 2)).replace('dd', pad(d, 2)).replace('d', d).replace('hh', pad(h, 2)).replace('h', h).replace('mm', pad(m, 2)).replace('m', m).replace('ss', pad(s, 2)).replace('s', s).replace('SSS', pad(S, 3)); - return tpl; - } - /** - * Capital first - * @param {string} str - * @return {string} - */ - function capitalFirst(str) { - return str ? str.charAt(0).toUpperCase() + str.substr(1) : str; - } - /** - * @return Never be null/undefined. - */ - function convertToColorString(color, defaultColor) { - defaultColor = defaultColor || 'transparent'; - return isString(color) ? color : isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor; - } - /** - * open new tab - * @param link url - * @param target blank or self - */ - function windowOpen(link, target) { - /* global window */ - if (target === '_blank' || target === 'blank') { - var blank = window.open(); - blank.opener = null; - blank.location.href = link; - } else { - window.open(link, target); - } - } - - var each$1 = 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 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; - } - child.x = x; - child.y = y; - child.markRedraw(); - orient === 'horizontal' ? x = nextX + gap : y = nextY + gap; - }); - } - /** - * VBox or HBox layouting - * @param {string} orient - * @param {module:zrender/graphic/Group} group - * @param {number} gap - * @param {number} [width=Infinity] - * @param {number} [height=Infinity] - */ - var box = boxLayout; - /** - * VBox layouting - * @param {module:zrender/graphic/Group} group - * @param {number} gap - * @param {number} [width=Infinity] - * @param {number} [height=Infinity] - */ - var vbox = curry(boxLayout, 'vertical'); - /** - * HBox layouting - * @param {module:zrender/graphic/Group} group - * @param {number} gap - * @param {number} [width=Infinity] - * @param {number} [height=Infinity] - */ - var hbox = 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. - */ - function getAvailableSize(positionInfo, containerRect, margin) { - var containerWidth = containerRect.width; - var containerHeight = containerRect.height; - var x = parsePercent$1(positionInfo.left, containerWidth); - var y = parsePercent$1(positionInfo.top, containerHeight); - var x2 = parsePercent$1(positionInfo.right, containerWidth); - var y2 = parsePercent$1(positionInfo.bottom, containerHeight); - (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0); - (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth); - (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0); - (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight); - margin = normalizeCssArray$1(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. - */ - function getLayoutRect(positionInfo, containerRect, margin) { - margin = normalizeCssArray$1(margin || 0); - var containerWidth = containerRect.width; - var containerHeight = containerRect.height; - var left = parsePercent$1(positionInfo.left, containerWidth); - var top = parsePercent$1(positionInfo.top, containerHeight); - var right = parsePercent$1(positionInfo.right, containerWidth); - var bottom = parsePercent$1(positionInfo.bottom, containerHeight); - var width = parsePercent$1(positionInfo.width, containerWidth); - var height = parsePercent$1(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. Translate (with el.position by this method) - * So this method only fixes the last step 'Translate', which does not affect - * scaling and rotating. - * - * If be called repeatedly with the same input el, the same result will be gotten. - * - * Return true if the layout happened. - * - * @param el Should have `getBoundingRect` method. - * @param positionInfo - * @param positionInfo.left - * @param positionInfo.top - * @param positionInfo.right - * @param positionInfo.bottom - * @param positionInfo.width Only for opt.boundingModel: 'raw' - * @param positionInfo.height Only for opt.boundingModel: 'raw' - * @param containerRect - * @param margin - * @param opt - * @param opt.hv Only horizontal or only vertical. Default to be [1, 1] - * @param opt.boundingMode - * 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, out) { - var h = !opt || !opt.hv || opt.hv[0]; - var v = !opt || !opt.hv || opt.hv[1]; - var boundingMode = opt && opt.boundingMode || 'all'; - out = out || el; - out.x = el.x; - out.y = el.y; - if (!h && !v) { - return false; - } - 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. - var layoutRect = getLayoutRect(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 dx = h ? layoutRect.x - rect.x : 0; - var dy = v ? layoutRect.y - rect.y : 0; - if (boundingMode === 'raw') { - out.x = dx; - out.y = dy; - } else { - out.x += dx; - out.y += dy; - } - if (out === el) { - el.markRedraw(); - } - return true; - } - /** - * @param option Contains some of the properties in HV_NAMES. - * @param 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; - } - function fetchLayoutMode(ins) { - var layoutMode = ins.layoutMode || ins.constructor.layoutMode; - return isObject(layoutMode) ? layoutMode : layoutMode ? { - type: layoutMode - } : null; - } - /** - * Consider Case: - * When default 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 () { - * ... - * let inputPositionParams = layout.getLayoutParams(option); - * this.mergeOption(inputPositionParams); - * }, - * mergeOption: function (newOption) { - * newOption && zrUtil.merge(thisOption, newOption, true); - * layout.mergeLayoutParam(thisOption, newOption); - * } - * }); - * - * @param targetOption - * @param newOption - * @param opt - */ - function mergeLayoutParam(targetOption, newOption, opt) { - var ignoreSize = opt && opt.ignoreSize; - !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$1(names, function (name) { - merged[name] = targetOption[name]; - }); - each$1(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_1 = names[i]; - if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) { - newParams[name_1] = targetOption[name_1]; - 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$1(names, function (name) { - target[name] = source[name]; - }); - } - } - /** - * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. - */ - 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$1(LOCATION_PARAMS, function (name) { - source.hasOwnProperty(name) && (target[name] = source[name]); - }); - return target; - } - - var inner = makeInner(); - var ComponentModel = /** @class */function (_super) { - __extends(ComponentModel, _super); - function ComponentModel(option, parentModel, ecModel) { - var _this = _super.call(this, option, parentModel, ecModel) || this; - _this.uid = getUID('ec_cpt_model'); - return _this; - } - ComponentModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - }; - ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { - var layoutMode = fetchLayoutMode(this); - var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; - var themeModel = ecModel.getTheme(); - merge(option, themeModel.get(this.mainType)); - merge(option, this.getDefaultOption()); - if (layoutMode) { - mergeLayoutParam(option, inputPositionParams, layoutMode); - } - }; - ComponentModel.prototype.mergeOption = function (option, ecModel) { - merge(this.option, option, true); - var layoutMode = fetchLayoutMode(this); - if (layoutMode) { - mergeLayoutParam(this.option, option, layoutMode); - } - }; - /** - * Called immediately after `init` or `mergeOption` of this instance called. - */ - ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {}; - /** - * [How to declare defaultOption]: - * - * (A) If using class declaration in typescript (since echarts 5): - * ```ts - * import {ComponentOption} from '../model/option.js'; - * export interface XxxOption extends ComponentOption { - * aaa: number - * } - * export class XxxModel extends Component { - * static type = 'xxx'; - * static defaultOption: XxxOption = { - * aaa: 123 - * } - * } - * Component.registerClass(XxxModel); - * ``` - * ```ts - * import {inheritDefaultOption} from '../util/component.js'; - * import {XxxModel, XxxOption} from './XxxModel.js'; - * export interface XxxSubOption extends XxxOption { - * bbb: number - * } - * class XxxSubModel extends XxxModel { - * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, { - * bbb: 456 - * }) - * fn() { - * let opt = this.getDefaultOption(); - * // opt is {aaa: 123, bbb: 456} - * } - * } - * ``` - * - * (B) If using class extend (previous approach in echarts 3 & 4): - * ```js - * let XxxComponent = Component.extend({ - * defaultOption: { - * xx: 123 - * } - * }) - * ``` - * ```js - * let XxxSubComponent = XxxComponent.extend({ - * defaultOption: { - * yy: 456 - * }, - * fn: function () { - * let opt = this.getDefaultOption(); - * // opt is {xx: 123, yy: 456} - * } - * }) - * ``` - */ - ComponentModel.prototype.getDefaultOption = function () { - var ctor = this.constructor; - // If using class declaration, it is different to travel super class - // in legacy env and auto merge defaultOption. So if using class - // declaration, defaultOption should be merged manually. - if (!isExtendedClass(ctor)) { - // When using ts class, defaultOption must be declared as static. - return ctor.defaultOption; - } - // FIXME: remove this approach? - var fields = inner(this); - if (!fields.defaultOption) { - var optList = []; - var clz = ctor; - while (clz) { - var opt = clz.prototype.defaultOption; - opt && optList.push(opt); - clz = clz.superClass; - } - var defaultOption = {}; - for (var i = optList.length - 1; i >= 0; i--) { - defaultOption = merge(defaultOption, optList[i], true); - } - fields.defaultOption = defaultOption; - } - return fields.defaultOption; - }; - /** - * Notice: always force to input param `useDefault` in case that forget to consider it. - * The same behavior as `modelUtil.parseFinder`. - * - * @param useDefault In many cases like series refer axis and axis refer grid, - * If axis index / axis id not specified, use the first target as default. - * In other cases like dataZoom refer axis, if not specified, measn no refer. - */ - ComponentModel.prototype.getReferringComponents = function (mainType, opt) { - var indexKey = mainType + 'Index'; - var idKey = mainType + 'Id'; - return queryReferringComponents(this.ecModel, mainType, { - index: this.get(indexKey, true), - id: this.get(idKey, true) - }, opt); - }; - ComponentModel.prototype.getBoxLayoutParams = function () { - // Consider itself having box layout configs. - var boxLayoutModel = this; - return { - left: boxLayoutModel.get('left'), - top: boxLayoutModel.get('top'), - right: boxLayoutModel.get('right'), - bottom: boxLayoutModel.get('bottom'), - width: boxLayoutModel.get('width'), - height: boxLayoutModel.get('height') - }; - }; - /** - * Get key for zlevel. - * If developers don't configure zlevel. We will assign zlevel to series based on the key. - * For example, lines with trail effect and progressive series will in an individual zlevel. - */ - ComponentModel.prototype.getZLevelKey = function () { - return ''; - }; - ComponentModel.prototype.setZLevel = function (zlevel) { - this.option.zlevel = zlevel; - }; - ComponentModel.protoInitialize = function () { - var proto = ComponentModel.prototype; - proto.type = 'component'; - proto.id = ''; - proto.name = ''; - proto.mainType = ''; - proto.subType = ''; - proto.componentIndex = 0; - }(); - return ComponentModel; - }(Model); - mountExtend(ComponentModel, Model); - enableClassManagement(ComponentModel); - enableSubTypeDefaulter(ComponentModel); - enableTopologicalTravel(ComponentModel, getDependencies); - function getDependencies(componentType) { - var deps = []; - each(ComponentModel.getClassesByMainType(componentType), function (clz) { - deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []); - }); - // Ensure main type. - deps = map(deps, function (type) { - return parseClassType(type).main; - }); - // Hack dataset for convenience. - if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) { - deps.unshift('dataset'); - } - return deps; - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 platform = ''; - // Navigator not exists in node - if (typeof navigator !== 'undefined') { - /* global navigator */ - platform = navigator.platform || ''; - } - var decalColor = 'rgba(0, 0, 0, 0.2)'; - var globalDefault = { - darkMode: 'auto', - // backgroundColor: 'rgba(0,0,0,0)', - colorBy: 'series', - color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'], - gradientColor: ['#f6efa6', '#d88273', '#bf444c'], - aria: { - decal: { - decals: [{ - color: decalColor, - dashArrayX: [1, 0], - dashArrayY: [2, 5], - symbolSize: 1, - rotation: Math.PI / 6 - }, { - color: decalColor, - symbol: 'circle', - dashArrayX: [[8, 8], [0, 8, 8, 0]], - dashArrayY: [6, 0], - symbolSize: 0.8 - }, { - color: decalColor, - dashArrayX: [1, 0], - dashArrayY: [4, 3], - rotation: -Math.PI / 4 - }, { - color: decalColor, - dashArrayX: [[6, 6], [0, 6, 6, 0]], - dashArrayY: [6, 0] - }, { - color: decalColor, - dashArrayX: [[1, 0], [1, 6]], - dashArrayY: [1, 0, 6, 0], - rotation: Math.PI / 4 - }, { - color: decalColor, - symbol: 'triangle', - dashArrayX: [[9, 9], [0, 9, 9, 0]], - dashArrayY: [7, 2], - symbolSize: 0.75 - }] - } - }, - // If xAxis and yAxis declared, grid is created by default. - // grid: {}, - textStyle: { - // color: '#000', - // decoration: 'none', - // PENDING - fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif', - // fontFamily: 'Arial, Verdana, sans-serif', - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/ - // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation - // Default is source-over - blendMode: null, - stateAnimation: { - duration: 300, - easing: 'cubicOut' - }, - animation: 'auto', - animationDuration: 1000, - animationDurationUpdate: 500, - animationEasing: 'cubicInOut', - animationEasingUpdate: 'cubicInOut', - animationThreshold: 2000, - // Configuration for progressive/incremental rendering - progressiveThreshold: 3000, - progressive: 400, - // Threshold of if use single hover layer to optimize. - // It is recommended that `hoverLayerThreshold` is equivalent to or less than - // `progressiveThreshold`, otherwise hover will cause restart of progressive, - // which is unexpected. - // see example . - hoverLayerThreshold: 3000, - // See: module:echarts/scale/Time - useUTC: false - }; - - var VISUAL_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'itemGroupId', 'itemChildGroupId', 'seriesName']); - 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_TYPED_ARRAY = 'typedArray'; - var SOURCE_FORMAT_UNKNOWN = 'unknown'; - var SERIES_LAYOUT_BY_COLUMN = 'column'; - var SERIES_LAYOUT_BY_ROW = 'row'; - - // The result of `guessOrdinal`. - var BE_ORDINAL = { - Must: 1, - Might: 2, - Not: 3 // Other cases - }; - - var innerGlobalModel = makeInner(); - /** - * MUST be called before mergeOption of all series. - */ - function resetSourceDefaulter(ecModel) { - // `datasetMap` is used to make default encode. - innerGlobalModel(ecModel).datasetMap = createHashMap(); - } - /** - * [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 | - * - * @return encode Never be `null/undefined`. - */ - function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) { - var encode = {}; - var datasetModel = querySeriesUpstreamDatasetModel(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 = innerGlobalModel(ecModel).datasetMap; - var key = datasetModel.uid + '_' + source.seriesLayoutBy; - var baseCategoryDimIndex; - var categoryWayValueDimStart; - coordDimensions = coordDimensions.slice(); - each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) { - var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = { - name: coordDimInfoLoose - }; - if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) { - baseCategoryDimIndex = coordDimIdx; - categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo); - } - 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 multiple series share one dimension - // category axis, series name should better use - // the other dimension 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: ...}, ...]. - * - * @return encode Never be `null/undefined`. - */ - function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) { - var encode = {}; - var datasetModel = querySeriesUpstreamDatasetModel(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; - } - }); - } - 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 uses itemName in charts. - // So we don't set encodeLabel here. - encode.itemName = [nameDimIndex]; - encode.seriesName = [nameDimIndex]; - } - return encode; - } - /** - * @return If return null/undefined, indicate that should not use datasetModel. - */ - function querySeriesUpstreamDatasetModel(seriesModel) { - // 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 = seriesModel.get('data', true); - if (!thisData) { - return queryReferringComponents(seriesModel.ecModel, 'dataset', { - index: seriesModel.get('datasetIndex', true), - id: seriesModel.get('datasetId', true) - }, SINGLE_REFERRING).models[0]; - } - } - /** - * @return Always return an array event empty. - */ - function queryDatasetUpstreamDatasetModels(datasetModel) { - // Only these attributes declared, we by default reference to `datasetIndex: 0`. - // Otherwise, no reference. - if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) { - return []; - } - return queryReferringComponents(datasetModel.ecModel, 'dataset', { - index: datasetModel.get('fromDatasetIndex', true), - id: datasetModel.get('fromDatasetId', true) - }, SINGLE_REFERRING).models; - } - /** - * 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? - */ - 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) { - var dataArrayRows = data; - if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { - var sample = dataArrayRows[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 < dataArrayRows.length && i < maxLoop; i++) { - var row = dataArrayRows[startIndex + i]; - if (row && (result = detectValue(row[dimIndex])) != null) { - return result; - } - } - } - } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { - var dataObjectRows = data; - if (!dimName) { - return BE_ORDINAL.Not; - } - for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) { - var item = dataObjectRows[i]; - if (item && (result = detectValue(item[dimName])) != null) { - return result; - } - } - } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { - var dataKeyedColumns = data; - if (!dimName) { - return BE_ORDINAL.Not; - } - var sample = dataKeyedColumns[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) { - var dataOriginal = data; - for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) { - var item = dataOriginal[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". - // `Number('')` (or any whitespace) is `0`. - if (val != null && Number.isFinite(Number(val)) && val !== '') { - return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not; - } else if (beStr && val !== '-') { - return BE_ORDINAL.Must; - } - } - return BE_ORDINAL.Not; - } - - var internalOptionCreatorMap = createHashMap(); - function registerInternalOptionCreator(mainType, creator) { - assert(internalOptionCreatorMap.get(mainType) == null && creator); - internalOptionCreatorMap.set(mainType, creator); - } - function concatInternalOptions(ecModel, mainType, newCmptOptionList) { - var internalOptionCreator = internalOptionCreatorMap.get(mainType); - if (!internalOptionCreator) { - return newCmptOptionList; - } - var internalOptions = internalOptionCreator(ecModel); - if (!internalOptions) { - return newCmptOptionList; - } - if ("development" !== 'production') { - for (var i = 0; i < internalOptions.length; i++) { - assert(isComponentIdInternal(internalOptions[i])); - } - } - return newCmptOptionList.concat(internalOptions); - } - - var innerColor = makeInner(); - var innerDecal = makeInner(); - var PaletteMixin = /** @class */function () { - function PaletteMixin() {} - PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) { - var defaultPalette = normalizeToArray(this.get('color', true)); - var layeredPalette = this.get('colorLayer', true); - return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum); - }; - PaletteMixin.prototype.clearColorPalette = function () { - clearPalette(this, innerColor); - }; - return PaletteMixin; - }(); - function getDecalFromPalette(ecModel, name, scope, requestNum) { - var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals'])); - return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum); - } - function getNearestPalette(palettes, requestColorNum) { - var paletteNum = palettes.length; - // TODO palettes must be in order - for (var i = 0; i < paletteNum; i++) { - if (palettes[i].length > requestColorNum) { - return palettes[i]; - } - } - return palettes[paletteNum - 1]; - } - /** - * @param name MUST NOT be null/undefined. Otherwise call this function - * twise with the same parameters will get different result. - * @param scope default this. - * @return Can be null/undefined - */ - function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) { - scope = scope || that; - var scopeFields = inner(scope); - var paletteIdx = scopeFields.paletteIdx || 0; - var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {}; - // Use `hasOwnProperty` to avoid conflict with Object.prototype. - if (paletteNameMap.hasOwnProperty(name)) { - return paletteNameMap[name]; - } - var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum); - // In case can't find in layered color palette. - palette = palette || defaultPalette; - if (!palette || !palette.length) { - return; - } - var pickedPaletteItem = palette[paletteIdx]; - if (name) { - paletteNameMap[name] = pickedPaletteItem; - } - scopeFields.paletteIdx = (paletteIdx + 1) % palette.length; - return pickedPaletteItem; - } - function clearPalette(that, inner) { - inner(that).paletteIdx = 0; - inner(that).paletteNameMap = {}; - } - - // ----------------------- - // Internal method names: - // ----------------------- - var reCreateSeriesIndices; - var assertSeriesInitialized; - var initBase; - var OPTION_INNER_KEY = '\0_ec_inner'; - var OPTION_INNER_VALUE = 1; - var BUITIN_COMPONENTS_MAP = { - grid: 'GridComponent', - polar: 'PolarComponent', - geo: 'GeoComponent', - singleAxis: 'SingleAxisComponent', - parallel: 'ParallelComponent', - calendar: 'CalendarComponent', - graphic: 'GraphicComponent', - toolbox: 'ToolboxComponent', - tooltip: 'TooltipComponent', - axisPointer: 'AxisPointerComponent', - brush: 'BrushComponent', - title: 'TitleComponent', - timeline: 'TimelineComponent', - markPoint: 'MarkPointComponent', - markLine: 'MarkLineComponent', - markArea: 'MarkAreaComponent', - legend: 'LegendComponent', - dataZoom: 'DataZoomComponent', - visualMap: 'VisualMapComponent', - // aria: 'AriaComponent', - // dataset: 'DatasetComponent', - // Dependencies - xAxis: 'GridComponent', - yAxis: 'GridComponent', - angleAxis: 'PolarComponent', - radiusAxis: 'PolarComponent' - }; - var BUILTIN_CHARTS_MAP = { - line: 'LineChart', - bar: 'BarChart', - pie: 'PieChart', - scatter: 'ScatterChart', - radar: 'RadarChart', - map: 'MapChart', - tree: 'TreeChart', - treemap: 'TreemapChart', - graph: 'GraphChart', - gauge: 'GaugeChart', - funnel: 'FunnelChart', - parallel: 'ParallelChart', - sankey: 'SankeyChart', - boxplot: 'BoxplotChart', - candlestick: 'CandlestickChart', - effectScatter: 'EffectScatterChart', - lines: 'LinesChart', - heatmap: 'HeatmapChart', - pictorialBar: 'PictorialBarChart', - themeRiver: 'ThemeRiverChart', - sunburst: 'SunburstChart', - custom: 'CustomChart' - }; - var componetsMissingLogPrinted = {}; - function checkMissingComponents(option) { - each(option, function (componentOption, mainType) { - if (!ComponentModel.hasClass(mainType)) { - var componentImportName = BUITIN_COMPONENTS_MAP[mainType]; - if (componentImportName && !componetsMissingLogPrinted[componentImportName]) { - error("Component " + mainType + " is used but not imported.\nimport { " + componentImportName + " } from 'echarts/components';\necharts.use([" + componentImportName + "]);"); - componetsMissingLogPrinted[componentImportName] = true; - } - } - }); - } - var GlobalModel = /** @class */function (_super) { - __extends(GlobalModel, _super); - function GlobalModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) { - theme = theme || {}; - this.option = null; // Mark as not initialized. - this._theme = new Model(theme); - this._locale = new Model(locale); - this._optionManager = optionManager; - }; - GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) { - if ("development" !== 'production') { - assert(option != null, 'option is null/undefined'); - assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()'); - } - var innerOpt = normalizeSetOptionInput(opts); - this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt); - this._resetOption(null, innerOpt); - }; - /** - * @param type null/undefined: reset all. - * 'recreate': force recreate all. - * 'timeline': only reset timeline option - * 'media': only reset media query option - * @return Whether option changed. - */ - GlobalModel.prototype.resetOption = function (type, opt) { - return this._resetOption(type, normalizeSetOptionInput(opt)); - }; - GlobalModel.prototype._resetOption = function (type, opt) { - var optionChanged = false; - var optionManager = this._optionManager; - if (!type || type === 'recreate') { - var baseOption = optionManager.mountOption(type === 'recreate'); - if ("development" !== 'production') { - checkMissingComponents(baseOption); - } - if (!this.option || type === 'recreate') { - initBase(this, baseOption); - } else { - this.restoreData(); - this._mergeOption(baseOption, opt); - } - optionChanged = true; - } - if (type === 'timeline' || type === 'media') { - this.restoreData(); - } - // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`, - // it should better not have the same props with `MediaUnit['option']`. - // Because either `option2` or `MediaUnit['option']` will be always merged to "current option" - // rather than original "baseOption". If they both override a prop, the result might be - // unexpected when media state changed after `setOption` called. - // If we really need to modify a props in each `MediaUnit['option']`, use the full version - // (`{baseOption, media}`) in `setOption`. - // For `timeline`, the case is the same. - if (!type || type === 'recreate' || type === 'timeline') { - var timelineOption = optionManager.getTimelineOption(this); - if (timelineOption) { - optionChanged = true; - this._mergeOption(timelineOption, opt); - } - } - if (!type || type === 'recreate' || type === 'media') { - var mediaOptions = optionManager.getMediaOption(this); - if (mediaOptions.length) { - each(mediaOptions, function (mediaOption) { - optionChanged = true; - this._mergeOption(mediaOption, opt); - }, this); - } - } - return optionChanged; - }; - GlobalModel.prototype.mergeOption = function (option) { - this._mergeOption(option, null); - }; - GlobalModel.prototype._mergeOption = function (newOption, opt) { - var option = this.option; - var componentsMap = this._componentsMap; - var componentsCount = this._componentsCount; - var newCmptTypes = []; - var newCmptTypeMap = createHashMap(); - var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap; - resetSourceDefaulter(this); - // If no component class, merge directly. - // For example: color, animaiton options, etc. - each(newOption, function (componentOption, mainType) { - if (componentOption == null) { - return; - } - if (!ComponentModel.hasClass(mainType)) { - // globalSettingTask.dirty(); - option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true); - } else if (mainType) { - newCmptTypes.push(mainType); - newCmptTypeMap.set(mainType, true); - } - }); - if (replaceMergeMainTypeMap) { - // If there is a mainType `xxx` in `replaceMerge` but not declared in option, - // we trade it as it is declared in option as `{xxx: []}`. Because: - // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`. - // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`. - replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) { - if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) { - newCmptTypes.push(mainTypeInReplaceMerge); - newCmptTypeMap.set(mainTypeInReplaceMerge, true); - } - }); - } - ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this); - function visitComponent(mainType) { - var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType])); - var oldCmptList = componentsMap.get(mainType); - var mergeMode = - // `!oldCmptList` means init. See the comment in `mappingToExists` - !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge'; - var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode); - // Set mainType and complete subType. - setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel); - // Empty it before the travel, in order to prevent `this._componentsMap` - // from being used in the `init`/`mergeOption`/`optionUpdated` of some - // components, which is probably incorrect logic. - option[mainType] = null; - componentsMap.set(mainType, null); - componentsCount.set(mainType, 0); - var optionsByMainType = []; - var cmptsByMainType = []; - var cmptsCountByMainType = 0; - var tooltipExists; - var tooltipWarningLogged; - each(mappingResult, function (resultItem, index) { - var componentModel = resultItem.existing; - var newCmptOption = resultItem.newOption; - if (!newCmptOption) { - if (componentModel) { - // Consider where is no new option and should be merged using {}, - // see removeEdgeAndAdd in topologicalTravel and - // ComponentModel.getAllClassMainTypes. - componentModel.mergeOption({}, this); - componentModel.optionUpdated({}, false); - } - // If no both `resultItem.exist` and `resultItem.option`, - // either it is in `replaceMerge` and not matched by any id, - // or it has been removed in previous `replaceMerge` and left a "hole" in this component index. - } else { - var isSeriesType = mainType === 'series'; - var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists - ); - - if (!ComponentModelClass) { - if ("development" !== 'production') { - var subType = resultItem.keyInfo.subType; - var seriesImportName = BUILTIN_CHARTS_MAP[subType]; - if (!componetsMissingLogPrinted[subType]) { - componetsMissingLogPrinted[subType] = true; - if (seriesImportName) { - error("Series " + subType + " is used but not imported.\nimport { " + seriesImportName + " } from 'echarts/charts';\necharts.use([" + seriesImportName + "]);"); - } else { - error("Unknown series " + subType); - } - } - } - return; - } - // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception. - if (mainType === 'tooltip') { - if (tooltipExists) { - if ("development" !== 'production') { - if (!tooltipWarningLogged) { - warn('Currently only one tooltip component is allowed.'); - tooltipWarningLogged = true; - } - } - return; - } - tooltipExists = true; - } - if (componentModel && componentModel.constructor === ComponentModelClass) { - componentModel.name = resultItem.keyInfo.name; - // componentModel.settingTask && componentModel.settingTask.dirty(); - componentModel.mergeOption(newCmptOption, this); - componentModel.optionUpdated(newCmptOption, false); - } else { - // PENDING Global as parent ? - var extraOpt = extend({ - componentIndex: index - }, resultItem.keyInfo); - componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); - // Assign `keyInfo` - extend(componentModel, extraOpt); - if (resultItem.brandNew) { - componentModel.__requireNewView = true; - } - componentModel.init(newCmptOption, this, this); - // Call optionUpdated after init. - // newCmptOption has been used as componentModel.option - // and may be merged with theme and default, so pass null - // to avoid confusion. - componentModel.optionUpdated(null, true); - } - } - if (componentModel) { - optionsByMainType.push(componentModel.option); - cmptsByMainType.push(componentModel); - cmptsCountByMainType++; - } else { - // Always do assign to avoid elided item in array. - optionsByMainType.push(void 0); - cmptsByMainType.push(void 0); - } - }, this); - option[mainType] = optionsByMainType; - componentsMap.set(mainType, cmptsByMainType); - componentsCount.set(mainType, cmptsCountByMainType); - // Backup series for filtering. - if (mainType === 'series') { - reCreateSeriesIndices(this); - } - } - // If no series declared, ensure `_seriesIndices` initialized. - if (!this._seriesIndices) { - reCreateSeriesIndices(this); - } - }; - /** - * Get option for output (cloned option and inner info removed) - */ - GlobalModel.prototype.getOption = function () { - var option = clone(this.option); - each(option, function (optInMainType, mainType) { - if (ComponentModel.hasClass(mainType)) { - var opts = normalizeToArray(optInMainType); - // Inner cmpts need to be removed. - // Inner cmpts might not be at last since ec5.0, but still - // compatible for users: if inner cmpt at last, splice the returned array. - var realLen = opts.length; - var metNonInner = false; - for (var i = realLen - 1; i >= 0; i--) { - // Remove options with inner id. - if (opts[i] && !isComponentIdInternal(opts[i])) { - metNonInner = true; - } else { - opts[i] = null; - !metNonInner && realLen--; - } - } - opts.length = realLen; - option[mainType] = opts; - } - }); - delete option[OPTION_INNER_KEY]; - return option; - }; - GlobalModel.prototype.getTheme = function () { - return this._theme; - }; - GlobalModel.prototype.getLocaleModel = function () { - return this._locale; - }; - GlobalModel.prototype.setUpdatePayload = function (payload) { - this._payload = payload; - }; - GlobalModel.prototype.getUpdatePayload = function () { - return this._payload; - }; - /** - * @param idx If not specified, return the first one. - */ - GlobalModel.prototype.getComponent = function (mainType, idx) { - var list = this._componentsMap.get(mainType); - if (list) { - var cmpt = list[idx || 0]; - if (cmpt) { - return cmpt; - } else if (idx == null) { - for (var i = 0; i < list.length; i++) { - if (list[i]) { - return list[i]; - } - } - } - } - }; - /** - * @return Never be null/undefined. - */ - GlobalModel.prototype.queryComponents = function (condition) { - var mainType = condition.mainType; - if (!mainType) { - return []; - } - var index = condition.index; - var id = condition.id; - var name = condition.name; - var cmpts = this._componentsMap.get(mainType); - if (!cmpts || !cmpts.length) { - return []; - } - var result; - if (index != null) { - result = []; - each(normalizeToArray(index), function (idx) { - cmpts[idx] && result.push(cmpts[idx]); - }); - } else if (id != null) { - result = queryByIdOrName('id', id, cmpts); - } else if (name != null) { - result = queryByIdOrName('name', name, cmpts); - } else { - // Return all non-empty components in that mainType - result = filter(cmpts, function (cmpt) { - return !!cmpt; - }); - } - return filterBySubType(result, condition); - }; - /** - * The interface is different from queryComponents, - * which is convenient for inner usage. - * - * @usage - * let result = findComponents( - * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}} - * ); - * let result = findComponents( - * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}} - * ); - * let result = findComponents( - * {mainType: 'series', - * filter: function (model, index) {...}} - * ); - * // result like [component0, componnet1, ...] - */ - GlobalModel.prototype.findComponents = function (condition) { - var query = condition.query; - var mainType = condition.mainType; - var queryCond = getQueryCond(query); - var result = queryCond ? this.queryComponents(queryCond) - // Retrieve all non-empty components. - : filter(this._componentsMap.get(mainType), function (cmpt) { - return !!cmpt; - }); - return doFilter(filterBySubType(result, condition)); - function getQueryCond(q) { - var indexAttr = mainType + 'Index'; - var idAttr = mainType + 'Id'; - var nameAttr = mainType + 'Name'; - return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? { - mainType: mainType, - // subType will be filtered finally. - index: q[indexAttr], - id: q[idAttr], - name: q[nameAttr] - } : null; - } - function doFilter(res) { - return condition.filter ? filter(res, condition.filter) : res; - } - }; - GlobalModel.prototype.eachComponent = function (mainType, cb, context) { - var componentsMap = this._componentsMap; - if (isFunction(mainType)) { - var ctxForAll_1 = cb; - var cbForAll_1 = mainType; - componentsMap.each(function (cmpts, componentType) { - for (var i = 0; cmpts && i < cmpts.length; i++) { - var cmpt = cmpts[i]; - cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex); - } - }); - } else { - var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null; - for (var i = 0; cmpts && i < cmpts.length; i++) { - var cmpt = cmpts[i]; - cmpt && cb.call(context, cmpt, cmpt.componentIndex); - } - } - }; - /** - * Get series list before filtered by name. - */ - GlobalModel.prototype.getSeriesByName = function (name) { - var nameStr = convertOptionIdName(name, null); - return filter(this._componentsMap.get('series'), function (oneSeries) { - return !!oneSeries && nameStr != null && oneSeries.name === nameStr; - }); - }; - /** - * Get series list before filtered by index. - */ - GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) { - return this._componentsMap.get('series')[seriesIndex]; - }; - /** - * Get series list before filtered by type. - * FIXME: rename to getRawSeriesByType? - */ - GlobalModel.prototype.getSeriesByType = function (subType) { - return filter(this._componentsMap.get('series'), function (oneSeries) { - return !!oneSeries && oneSeries.subType === subType; - }); - }; - /** - * Get all series before filtered. - */ - GlobalModel.prototype.getSeries = function () { - return filter(this._componentsMap.get('series'), function (oneSeries) { - return !!oneSeries; - }); - }; - /** - * Count series before filtered. - */ - GlobalModel.prototype.getSeriesCount = function () { - return this._componentsCount.get('series'); - }; - /** - * After filtering, series may be different - * from raw series. - */ - GlobalModel.prototype.eachSeries = function (cb, context) { - assertSeriesInitialized(this); - each(this._seriesIndices, function (rawSeriesIndex) { - var series = this._componentsMap.get('series')[rawSeriesIndex]; - cb.call(context, series, rawSeriesIndex); - }, this); - }; - /** - * Iterate raw series before filtered. - * - * @param {Function} cb - * @param {*} context - */ - GlobalModel.prototype.eachRawSeries = function (cb, context) { - each(this._componentsMap.get('series'), function (series) { - series && cb.call(context, series, series.componentIndex); - }); - }; - /** - * After filtering, series may be different. - * from raw series. - */ - GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) { - assertSeriesInitialized(this); - each(this._seriesIndices, function (rawSeriesIndex) { - var series = this._componentsMap.get('series')[rawSeriesIndex]; - if (series.subType === subType) { - cb.call(context, series, rawSeriesIndex); - } - }, this); - }; - /** - * Iterate raw series before filtered of given type. - */ - GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) { - return each(this.getSeriesByType(subType), cb, context); - }; - GlobalModel.prototype.isSeriesFiltered = function (seriesModel) { - assertSeriesInitialized(this); - return this._seriesIndicesMap.get(seriesModel.componentIndex) == null; - }; - GlobalModel.prototype.getCurrentSeriesIndices = function () { - return (this._seriesIndices || []).slice(); - }; - GlobalModel.prototype.filterSeries = function (cb, context) { - assertSeriesInitialized(this); - var newSeriesIndices = []; - each(this._seriesIndices, function (seriesRawIdx) { - var series = this._componentsMap.get('series')[seriesRawIdx]; - cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx); - }, this); - this._seriesIndices = newSeriesIndices; - this._seriesIndicesMap = createHashMap(newSeriesIndices); - }; - GlobalModel.prototype.restoreData = function (payload) { - reCreateSeriesIndices(this); - var componentsMap = this._componentsMap; - var componentTypes = []; - componentsMap.each(function (components, componentType) { - if (ComponentModel.hasClass(componentType)) { - componentTypes.push(componentType); - } - }); - ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) { - each(componentsMap.get(componentType), function (component) { - if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) { - component.restoreData(); - } - }); - }); - }; - GlobalModel.internalField = function () { - reCreateSeriesIndices = function (ecModel) { - var seriesIndices = ecModel._seriesIndices = []; - each(ecModel._componentsMap.get('series'), function (series) { - // series may have been removed by `replaceMerge`. - series && seriesIndices.push(series.componentIndex); - }); - ecModel._seriesIndicesMap = createHashMap(seriesIndices); - }; - assertSeriesInitialized = function (ecModel) { - // Components that use _seriesIndices should depends on series component, - // which make sure that their initialization is after series. - if ("development" !== 'production') { - if (!ecModel._seriesIndices) { - throw new Error('Option should contains series.'); - } - } - }; - initBase = function (ecModel, baseOption) { - // Using OPTION_INNER_KEY to mark that this option cannot be used outside, - // i.e. `chart.setOption(chart.getModel().option);` is forbidden. - ecModel.option = {}; - ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE; - // Init with series: [], in case of calling findSeries method - // before series initialized. - ecModel._componentsMap = createHashMap({ - series: [] - }); - ecModel._componentsCount = createHashMap(); - // If user spefied `option.aria`, aria will be enable. This detection should be - // performed before theme and globalDefault merge. - var airaOption = baseOption.aria; - if (isObject(airaOption) && airaOption.enabled == null) { - airaOption.enabled = true; - } - mergeTheme(baseOption, ecModel._theme.option); - // TODO Needs clone when merging to the unexisted property - merge(baseOption, globalDefault, false); - ecModel._mergeOption(baseOption, null); - }; - }(); - return GlobalModel; - }(Model); - function isNotTargetSeries(seriesModel, payload) { - if (payload) { - var index = payload.seriesIndex; - var id = payload.seriesId; - var name_1 = payload.seriesName; - return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1; - } - } - function mergeTheme(option, theme) { - // PENDING - // NOT use `colorLayer` in theme if option has `color` - var notMergeColorLayer = option.color && !option.colorLayer; - each(theme, function (themeItem, name) { - if (name === 'colorLayer' && notMergeColorLayer) { - return; - } - // If it is component model mainType, the model handles that merge later. - // otherwise, merge them here. - if (!ComponentModel.hasClass(name)) { - if (typeof themeItem === 'object') { - option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false); - } else { - if (option[name] == null) { - option[name] = themeItem; - } - } - } - }); - } - function queryByIdOrName(attr, idOrName, cmpts) { - // Here is a break from echarts4: string and number are - // treated as equal. - if (isArray(idOrName)) { - var keyMap_1 = createHashMap(); - each(idOrName, function (idOrNameItem) { - if (idOrNameItem != null) { - var idName = convertOptionIdName(idOrNameItem, null); - idName != null && keyMap_1.set(idOrNameItem, true); - } - }); - return filter(cmpts, function (cmpt) { - return cmpt && keyMap_1.get(cmpt[attr]); - }); - } else { - var idName_1 = convertOptionIdName(idOrName, null); - return filter(cmpts, function (cmpt) { - return cmpt && idName_1 != null && cmpt[attr] === idName_1; - }); - } - } - function filterBySubType(components, condition) { - // Using hasOwnProperty for restrict. Consider - // subType is undefined in user payload. - return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) { - return cmpt && cmpt.subType === condition.subType; - }) : components; - } - function normalizeSetOptionInput(opts) { - var replaceMergeMainTypeMap = createHashMap(); - opts && each(normalizeToArray(opts.replaceMerge), function (mainType) { - if ("development" !== 'production') { - assert(ComponentModel.hasClass(mainType), '"' + mainType + '" is not valid component main type in "replaceMerge"'); - } - replaceMergeMainTypeMap.set(mainType, true); - }); - return { - replaceMergeMainTypeMap: replaceMergeMainTypeMap - }; - } - mixin(GlobalModel, PaletteMixin); - - var availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isSSR', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', - // 'getModel', - 'getOption', - // 'getViewOfComponentModel', - // 'getViewOfSeriesModel', - 'getId', 'updateLabelLayout']; - var ExtensionAPI = /** @class */function () { - function ExtensionAPI(ecInstance) { - each(availableMethods, function (methodName) { - this[methodName] = bind(ecInstance[methodName], ecInstance); - }, this); - } - return ExtensionAPI; - }(); - - var coordinateSystemCreators = {}; - var CoordinateSystemManager = /** @class */function () { - function CoordinateSystemManager() { - this._coordinateSystems = []; - } - CoordinateSystemManager.prototype.create = function (ecModel, api) { - var coordinateSystems = []; - each(coordinateSystemCreators, function (creator, type) { - var list = creator.create(ecModel, api); - coordinateSystems = coordinateSystems.concat(list || []); - }); - this._coordinateSystems = coordinateSystems; - }; - CoordinateSystemManager.prototype.update = function (ecModel, api) { - each(this._coordinateSystems, function (coordSys) { - coordSys.update && coordSys.update(ecModel, api); - }); - }; - CoordinateSystemManager.prototype.getCoordinateSystems = function () { - return this._coordinateSystems.slice(); - }; - CoordinateSystemManager.register = function (type, creator) { - coordinateSystemCreators[type] = creator; - }; - CoordinateSystemManager.get = function (type) { - return coordinateSystemCreators[type]; - }; - return CoordinateSystemManager; - }(); - - var QUERY_REG = /^(min|max)?(.+)$/; - // Key: mainType - // type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>; - /** - * TERM EXPLANATIONS: - * See `ECOption` and `ECUnitOption` in `src/util/types.ts`. - */ - var OptionManager = /** @class */function () { - // timeline.notMerge is not supported in ec3. Firstly there is rearly - // case that notMerge is needed. Secondly supporting 'notMerge' requires - // rawOption cloned and backuped when timeline changed, which does no - // good to performance. What's more, that both timeline and setOption - // method supply 'notMerge' brings complex and some problems. - // Consider this case: - // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false); - // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false); - function OptionManager(api) { - this._timelineOptions = []; - this._mediaList = []; - /** - * -1, means default. - * empty means no media. - */ - this._currentMediaIndices = []; - this._api = api; - } - OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) { - if (rawOption) { - // That set dat primitive is dangerous if user reuse the data when setOption again. - each(normalizeToArray(rawOption.series), function (series) { - series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data); - }); - each(normalizeToArray(rawOption.dataset), function (dataset) { - dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source); - }); - } - // Caution: some series modify option data, if do not clone, - // it should ensure that the repeat modify correctly - // (create a new object when modify itself). - rawOption = clone(rawOption); - // FIXME - // If some property is set in timeline options or media option but - // not set in baseOption, a warning should be given. - var optionBackup = this._optionBackup; - var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup); - this._newBaseOption = newParsedOption.baseOption; - // For setOption at second time (using merge mode); - if (optionBackup) { - // FIXME - // the restore merge solution is essentially incorrect. - // the mapping can not be 100% consistent with ecModel, which probably brings - // potential bug! - // The first merge is delayed, because in most cases, users do not call `setOption` twice. - // let fakeCmptsMap = this._fakeCmptsMap; - // if (!fakeCmptsMap) { - // fakeCmptsMap = this._fakeCmptsMap = createHashMap(); - // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null); - // } - // mergeToBackupOption( - // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt - // ); - // For simplicity, timeline options and media options do not support merge, - // that is, if you `setOption` twice and both has timeline options, the latter - // timeline options will not be merged to the former, but just substitute them. - if (newParsedOption.timelineOptions.length) { - optionBackup.timelineOptions = newParsedOption.timelineOptions; - } - if (newParsedOption.mediaList.length) { - optionBackup.mediaList = newParsedOption.mediaList; - } - if (newParsedOption.mediaDefault) { - optionBackup.mediaDefault = newParsedOption.mediaDefault; - } - } else { - this._optionBackup = newParsedOption; - } - }; - OptionManager.prototype.mountOption = function (isRecreate) { - var optionBackup = this._optionBackup; - this._timelineOptions = optionBackup.timelineOptions; - this._mediaList = optionBackup.mediaList; - this._mediaDefault = optionBackup.mediaDefault; - this._currentMediaIndices = []; - return clone(isRecreate - // this._optionBackup.baseOption, which is created at the first `setOption` - // called, and is merged into every new option by inner method `mergeToBackupOption` - // each time `setOption` called, can be only used in `isRecreate`, because - // its reliability is under suspicion. In other cases option merge is - // performed by `model.mergeOption`. - ? optionBackup.baseOption : this._newBaseOption); - }; - OptionManager.prototype.getTimelineOption = function (ecModel) { - var option; - var timelineOptions = this._timelineOptions; - if (timelineOptions.length) { - // getTimelineOption can only be called after ecModel inited, - // so we can get currentIndex from timelineModel. - var timelineModel = ecModel.getComponent('timeline'); - if (timelineModel) { - option = clone( - // FIXME:TS as TimelineModel or quivlant interface - timelineOptions[timelineModel.getCurrentIndex()]); - } - } - return option; - }; - OptionManager.prototype.getMediaOption = function (ecModel) { - var ecWidth = this._api.getWidth(); - var ecHeight = this._api.getHeight(); - var mediaList = this._mediaList; - var mediaDefault = this._mediaDefault; - var indices = []; - var result = []; - // No media defined. - if (!mediaList.length && !mediaDefault) { - return result; - } - // Multi media may be applied, the latter defined media has higher priority. - for (var i = 0, len = mediaList.length; i < len; i++) { - if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) { - indices.push(i); - } - } - // FIXME - // Whether mediaDefault should force users to provide? Otherwise - // the change by media query can not be recorvered. - if (!indices.length && mediaDefault) { - indices = [-1]; - } - if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) { - result = map(indices, function (index) { - return clone(index === -1 ? mediaDefault.option : mediaList[index].option); - }); - } - // Otherwise return nothing. - this._currentMediaIndices = indices; - return result; - }; - return OptionManager; - }(); - /** - * [RAW_OPTION_PATTERNS] - * (Note: "series: []" represents all other props in `ECUnitOption`) - * - * (1) No prop "baseOption" declared: - * Root option is used as "baseOption" (except prop "options" and "media"). - * ```js - * option = { - * series: [], - * timeline: {}, - * options: [], - * }; - * option = { - * series: [], - * media: {}, - * }; - * option = { - * series: [], - * timeline: {}, - * options: [], - * media: {}, - * } - * ``` - * - * (2) Prop "baseOption" declared: - * If "baseOption" declared, `ECUnitOption` props can only be declared - * inside "baseOption" except prop "timeline" (compat ec2). - * ```js - * option = { - * baseOption: { - * timeline: {}, - * series: [], - * }, - * options: [] - * }; - * option = { - * baseOption: { - * series: [], - * }, - * media: [] - * }; - * option = { - * baseOption: { - * timeline: {}, - * series: [], - * }, - * options: [] - * media: [] - * }; - * option = { - * // ec3 compat ec2: allow (only) `timeline` declared - * // outside baseOption. Keep this setting for compat. - * timeline: {}, - * baseOption: { - * series: [], - * }, - * options: [], - * media: [] - * }; - * ``` - */ - function parseRawOption( - // `rawOption` May be modified - rawOption, optionPreprocessorFuncs, isNew) { - var mediaList = []; - var mediaDefault; - var baseOption; - var declaredBaseOption = rawOption.baseOption; - // Compatible with ec2, [RAW_OPTION_PATTERNS] above. - var timelineOnRoot = rawOption.timeline; - var timelineOptionsOnRoot = rawOption.options; - var mediaOnRoot = rawOption.media; - var hasMedia = !!rawOption.media; - var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline); - if (declaredBaseOption) { - baseOption = declaredBaseOption; - // For merge option. - if (!baseOption.timeline) { - baseOption.timeline = timelineOnRoot; - } - } - // For convenience, enable to use the root option as the `baseOption`: - // `{ ...normalOptionProps, media: [{ ... }, { ... }] }` - else { - if (hasTimeline || hasMedia) { - rawOption.options = rawOption.media = null; - } - baseOption = rawOption; - } - if (hasMedia) { - if (isArray(mediaOnRoot)) { - each(mediaOnRoot, function (singleMedia) { - if ("development" !== 'production') { - // Real case of wrong config. - if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) { - error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }'); - } - } - if (singleMedia && singleMedia.option) { - if (singleMedia.query) { - mediaList.push(singleMedia); - } else if (!mediaDefault) { - // Use the first media default. - mediaDefault = singleMedia; - } - } - }); - } else { - if ("development" !== 'production') { - // Real case of wrong config. - error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }'); - } - } - } - doPreprocess(baseOption); - each(timelineOptionsOnRoot, function (option) { - return doPreprocess(option); - }); - each(mediaList, function (media) { - return doPreprocess(media.option); - }); - function doPreprocess(option) { - each(optionPreprocessorFuncs, function (preProcess) { - preProcess(option, isNew); - }); - } - return { - baseOption: baseOption, - timelineOptions: timelineOptionsOnRoot || [], - mediaDefault: mediaDefault, - mediaList: mediaList - }; - } - /** - * @see - * Support: width, height, aspectRatio - * Can use max or min as prefix. - */ - function applyMediaQuery(query, ecWidth, ecHeight) { - var realMap = { - width: ecWidth, - height: ecHeight, - aspectratio: ecWidth / ecHeight // lower case for convenience. - }; - - var applicable = true; - each(query, function (value, attr) { - var matched = attr.match(QUERY_REG); - if (!matched || !matched[1] || !matched[2]) { - return; - } - var operator = matched[1]; - var realAttr = matched[2].toLowerCase(); - if (!compare(realMap[realAttr], value, operator)) { - applicable = false; - } - }); - return applicable; - } - function compare(real, expect, operator) { - if (operator === 'min') { - return real >= expect; - } else if (operator === 'max') { - return real <= expect; - } else { - // Equals - return real === expect; - } - } - function indicesEquals(indices1, indices2) { - // indices is always order by asc and has only finite number. - return indices1.join(',') === indices2.join(','); - } - - var each$2 = each; - var isObject$1 = isObject; - var POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine']; - function compatEC2ItemStyle(opt) { - var itemStyleOpt = opt && opt.itemStyle; - if (!itemStyleOpt) { - return; - } - for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) { - var styleName = POSSIBLE_STYLES[i]; - var normalItemStyleOpt = itemStyleOpt.normal; - var emphasisItemStyleOpt = itemStyleOpt.emphasis; - if (normalItemStyleOpt && normalItemStyleOpt[styleName]) { - if ("development" !== 'production') { - deprecateReplaceLog("itemStyle.normal." + styleName, styleName); - } - opt[styleName] = opt[styleName] || {}; - if (!opt[styleName].normal) { - opt[styleName].normal = normalItemStyleOpt[styleName]; - } else { - merge(opt[styleName].normal, normalItemStyleOpt[styleName]); - } - normalItemStyleOpt[styleName] = null; - } - if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) { - if ("development" !== 'production') { - deprecateReplaceLog("itemStyle.emphasis." + styleName, "emphasis." + styleName); - } - opt[styleName] = opt[styleName] || {}; - if (!opt[styleName].emphasis) { - opt[styleName].emphasis = emphasisItemStyleOpt[styleName]; - } else { - merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]); - } - emphasisItemStyleOpt[styleName] = null; - } - } - } - function convertNormalEmphasis(opt, optType, useExtend) { - if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) { - var normalOpt = opt[optType].normal; - var emphasisOpt = opt[optType].emphasis; - if (normalOpt) { - if ("development" !== 'production') { - // eslint-disable-next-line max-len - deprecateLog("'normal' hierarchy in " + optType + " has been removed since 4.0. All style properties are configured in " + optType + " directly now."); - } - // Timeline controlStyle has other properties besides normal and emphasis - if (useExtend) { - opt[optType].normal = opt[optType].emphasis = null; - defaults(opt[optType], normalOpt); - } else { - opt[optType] = normalOpt; - } - } - if (emphasisOpt) { - if ("development" !== 'production') { - deprecateLog(optType + ".emphasis has been changed to emphasis." + optType + " since 4.0"); - } - opt.emphasis = opt.emphasis || {}; - opt.emphasis[optType] = emphasisOpt; - // Also compat the case user mix the style and focus together in ec3 style - // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } } - if (emphasisOpt.focus) { - opt.emphasis.focus = emphasisOpt.focus; - } - if (emphasisOpt.blurScope) { - opt.emphasis.blurScope = emphasisOpt.blurScope; - } - } - } - } - function removeEC3NormalStatus(opt) { - convertNormalEmphasis(opt, 'itemStyle'); - convertNormalEmphasis(opt, 'lineStyle'); - convertNormalEmphasis(opt, 'areaStyle'); - convertNormalEmphasis(opt, 'label'); - convertNormalEmphasis(opt, 'labelLine'); - // treemap - convertNormalEmphasis(opt, 'upperLabel'); - // graph - convertNormalEmphasis(opt, 'edgeLabel'); - } - function compatTextStyle(opt, propName) { - // Check whether is not object (string\null\undefined ...) - var labelOptSingle = isObject$1(opt) && opt[propName]; - var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle; - if (textStyle) { - if ("development" !== 'production') { - // eslint-disable-next-line max-len - deprecateLog("textStyle hierarchy in " + propName + " has been removed since 4.0. All textStyle properties are configured in " + propName + " directly now."); - } - for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) { - var textPropName = TEXT_STYLE_OPTIONS[i]; - if (textStyle.hasOwnProperty(textPropName)) { - labelOptSingle[textPropName] = textStyle[textPropName]; - } - } - } - } - function compatEC3CommonStyles(opt) { - if (opt) { - removeEC3NormalStatus(opt); - compatTextStyle(opt, 'label'); - opt.emphasis && compatTextStyle(opt.emphasis, 'label'); - } - } - function processSeries(seriesOpt) { - if (!isObject$1(seriesOpt)) { - return; - } - compatEC2ItemStyle(seriesOpt); - removeEC3NormalStatus(seriesOpt); - compatTextStyle(seriesOpt, 'label'); - // treemap - compatTextStyle(seriesOpt, 'upperLabel'); - // graph - compatTextStyle(seriesOpt, 'edgeLabel'); - if (seriesOpt.emphasis) { - compatTextStyle(seriesOpt.emphasis, 'label'); - // treemap - compatTextStyle(seriesOpt.emphasis, 'upperLabel'); - // graph - compatTextStyle(seriesOpt.emphasis, 'edgeLabel'); - } - var markPoint = seriesOpt.markPoint; - if (markPoint) { - compatEC2ItemStyle(markPoint); - compatEC3CommonStyles(markPoint); - } - var markLine = seriesOpt.markLine; - if (markLine) { - compatEC2ItemStyle(markLine); - compatEC3CommonStyles(markLine); - } - var markArea = seriesOpt.markArea; - if (markArea) { - compatEC3CommonStyles(markArea); - } - var data = seriesOpt.data; - // Break with ec3: if `setOption` again, there may be no `type` in option, - // then the backward compat based on option type will not be performed. - if (seriesOpt.type === 'graph') { - data = data || seriesOpt.nodes; - var edgeData = seriesOpt.links || seriesOpt.edges; - if (edgeData && !isTypedArray(edgeData)) { - for (var i = 0; i < edgeData.length; i++) { - compatEC3CommonStyles(edgeData[i]); - } - } - each(seriesOpt.categories, function (opt) { - removeEC3NormalStatus(opt); - }); - } - if (data && !isTypedArray(data)) { - for (var i = 0; i < data.length; i++) { - compatEC3CommonStyles(data[i]); - } - } - // mark point data - markPoint = seriesOpt.markPoint; - if (markPoint && markPoint.data) { - var mpData = markPoint.data; - for (var i = 0; i < mpData.length; i++) { - compatEC3CommonStyles(mpData[i]); - } - } - // mark line data - markLine = seriesOpt.markLine; - if (markLine && markLine.data) { - var mlData = markLine.data; - for (var i = 0; i < mlData.length; i++) { - if (isArray(mlData[i])) { - compatEC3CommonStyles(mlData[i][0]); - compatEC3CommonStyles(mlData[i][1]); - } else { - compatEC3CommonStyles(mlData[i]); - } - } - } - // Series - if (seriesOpt.type === 'gauge') { - compatTextStyle(seriesOpt, 'axisLabel'); - compatTextStyle(seriesOpt, 'title'); - compatTextStyle(seriesOpt, 'detail'); - } else if (seriesOpt.type === 'treemap') { - convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle'); - each(seriesOpt.levels, function (opt) { - removeEC3NormalStatus(opt); - }); - } else if (seriesOpt.type === 'tree') { - removeEC3NormalStatus(seriesOpt.leaves); - } - // sunburst starts from ec4, so it does not need to compat levels. - } - - function toArr(o) { - return isArray(o) ? o : o ? [o] : []; - } - function toObj(o) { - return (isArray(o) ? o[0] : o) || {}; - } - function globalCompatStyle(option, isTheme) { - each$2(toArr(option.series), function (seriesOpt) { - isObject$1(seriesOpt) && processSeries(seriesOpt); - }); - var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar']; - isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis'); - each$2(axes, function (axisName) { - each$2(toArr(option[axisName]), function (axisOpt) { - if (axisOpt) { - compatTextStyle(axisOpt, 'axisLabel'); - compatTextStyle(axisOpt.axisPointer, 'label'); - } - }); - }); - each$2(toArr(option.parallel), function (parallelOpt) { - var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault; - compatTextStyle(parallelAxisDefault, 'axisLabel'); - compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label'); - }); - each$2(toArr(option.calendar), function (calendarOpt) { - convertNormalEmphasis(calendarOpt, 'itemStyle'); - compatTextStyle(calendarOpt, 'dayLabel'); - compatTextStyle(calendarOpt, 'monthLabel'); - compatTextStyle(calendarOpt, 'yearLabel'); - }); - // radar.name.textStyle - each$2(toArr(option.radar), function (radarOpt) { - compatTextStyle(radarOpt, 'name'); - // Use axisName instead of name because component has name property - if (radarOpt.name && radarOpt.axisName == null) { - radarOpt.axisName = radarOpt.name; - delete radarOpt.name; - if ("development" !== 'production') { - deprecateLog('name property in radar component has been changed to axisName'); - } - } - if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) { - radarOpt.axisNameGap = radarOpt.nameGap; - delete radarOpt.nameGap; - if ("development" !== 'production') { - deprecateLog('nameGap property in radar component has been changed to axisNameGap'); - } - } - if ("development" !== 'production') { - each$2(radarOpt.indicator, function (indicatorOpt) { - if (indicatorOpt.text) { - deprecateReplaceLog('text', 'name', 'radar.indicator'); - } - }); - } - }); - each$2(toArr(option.geo), function (geoOpt) { - if (isObject$1(geoOpt)) { - compatEC3CommonStyles(geoOpt); - each$2(toArr(geoOpt.regions), function (regionObj) { - compatEC3CommonStyles(regionObj); - }); - } - }); - each$2(toArr(option.timeline), function (timelineOpt) { - compatEC3CommonStyles(timelineOpt); - convertNormalEmphasis(timelineOpt, 'label'); - convertNormalEmphasis(timelineOpt, 'itemStyle'); - convertNormalEmphasis(timelineOpt, 'controlStyle', true); - var data = timelineOpt.data; - isArray(data) && each(data, function (item) { - if (isObject(item)) { - convertNormalEmphasis(item, 'label'); - convertNormalEmphasis(item, 'itemStyle'); - } - }); - }); - each$2(toArr(option.toolbox), function (toolboxOpt) { - convertNormalEmphasis(toolboxOpt, 'iconStyle'); - each$2(toolboxOpt.feature, function (featureOpt) { - convertNormalEmphasis(featureOpt, 'iconStyle'); - }); - }); - compatTextStyle(toObj(option.axisPointer), 'label'); - compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); - // Clean logs - // storedLogs = {}; - } - - function get(opt, path) { - var pathArr = path.split(','); - var obj = opt; - for (var i = 0; i < pathArr.length; i++) { - obj = obj && obj[pathArr[i]]; - if (obj == null) { - break; - } - } - return obj; - } - function set$1(opt, path, val, overwrite) { - var pathArr = path.split(','); - var obj = opt; - var key; - var i = 0; - for (; i < pathArr.length - 1; i++) { - key = pathArr[i]; - if (obj[key] == null) { - obj[key] = {}; - } - obj = obj[key]; - } - if (overwrite || obj[pathArr[i]] == null) { - obj[pathArr[i]] = val; - } - } - function compatLayoutProperties(option) { - option && each(LAYOUT_PROPERTIES, function (prop) { - if (prop[0] in option && !(prop[1] in option)) { - option[prop[1]] = option[prop[0]]; - } - }); - } - var LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']]; - var COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline']; - var BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']]; - function compatBarItemStyle(option) { - var itemStyle = option && option.itemStyle; - if (itemStyle) { - for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) { - var oldName = BAR_ITEM_STYLE_MAP[i][1]; - var newName = BAR_ITEM_STYLE_MAP[i][0]; - if (itemStyle[oldName] != null) { - itemStyle[newName] = itemStyle[oldName]; - if ("development" !== 'production') { - deprecateReplaceLog(oldName, newName); - } - } - } - } - } - function compatPieLabel(option) { - if (!option) { - return; - } - if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) { - if ("development" !== 'production') { - deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie'); - } - option.edgeDistance = option.margin; - } - } - function compatSunburstState(option) { - if (!option) { - return; - } - if (option.downplay && !option.blur) { - option.blur = option.downplay; - if ("development" !== 'production') { - deprecateReplaceLog('downplay', 'blur', 'sunburst'); - } - } - } - function compatGraphFocus(option) { - if (!option) { - return; - } - if (option.focusNodeAdjacency != null) { - option.emphasis = option.emphasis || {}; - if (option.emphasis.focus == null) { - if ("development" !== 'production') { - deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \'adjacency\'}', 'graph/sankey'); - } - option.emphasis.focus = 'adjacency'; - } - } - } - function traverseTree(data, cb) { - if (data) { - for (var i = 0; i < data.length; i++) { - cb(data[i]); - data[i] && traverseTree(data[i].children, cb); - } - } - } - function globalBackwardCompat(option, isTheme) { - globalCompatStyle(option, isTheme); - // Make sure series array for model initialization. - option.series = normalizeToArray(option.series); - each(option.series, function (seriesOpt) { - if (!isObject(seriesOpt)) { - return; - } - var seriesType = seriesOpt.type; - if (seriesType === 'line') { - if (seriesOpt.clipOverflow != null) { - seriesOpt.clip = seriesOpt.clipOverflow; - if ("development" !== 'production') { - deprecateReplaceLog('clipOverflow', 'clip', 'line'); - } - } - } else if (seriesType === 'pie' || seriesType === 'gauge') { - if (seriesOpt.clockWise != null) { - seriesOpt.clockwise = seriesOpt.clockWise; - if ("development" !== 'production') { - deprecateReplaceLog('clockWise', 'clockwise'); - } - } - compatPieLabel(seriesOpt.label); - var data = seriesOpt.data; - if (data && !isTypedArray(data)) { - for (var i = 0; i < data.length; i++) { - compatPieLabel(data[i]); - } - } - if (seriesOpt.hoverOffset != null) { - seriesOpt.emphasis = seriesOpt.emphasis || {}; - if (seriesOpt.emphasis.scaleSize = null) { - if ("development" !== 'production') { - deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize'); - } - seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset; - } - } - } else if (seriesType === 'gauge') { - var pointerColor = get(seriesOpt, 'pointer.color'); - pointerColor != null && set$1(seriesOpt, 'itemStyle.color', pointerColor); - } else if (seriesType === 'bar') { - compatBarItemStyle(seriesOpt); - compatBarItemStyle(seriesOpt.backgroundStyle); - compatBarItemStyle(seriesOpt.emphasis); - var data = seriesOpt.data; - if (data && !isTypedArray(data)) { - for (var i = 0; i < data.length; i++) { - if (typeof data[i] === 'object') { - compatBarItemStyle(data[i]); - compatBarItemStyle(data[i] && data[i].emphasis); - } - } - } - } else if (seriesType === 'sunburst') { - var highlightPolicy = seriesOpt.highlightPolicy; - if (highlightPolicy) { - seriesOpt.emphasis = seriesOpt.emphasis || {}; - if (!seriesOpt.emphasis.focus) { - seriesOpt.emphasis.focus = highlightPolicy; - if ("development" !== 'production') { - deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst'); - } - } - } - compatSunburstState(seriesOpt); - traverseTree(seriesOpt.data, compatSunburstState); - } else if (seriesType === 'graph' || seriesType === 'sankey') { - compatGraphFocus(seriesOpt); - // TODO nodes, edges? - } else if (seriesType === 'map') { - if (seriesOpt.mapType && !seriesOpt.map) { - if ("development" !== 'production') { - deprecateReplaceLog('mapType', 'map', 'map'); - } - seriesOpt.map = seriesOpt.mapType; - } - if (seriesOpt.mapLocation) { - if ("development" !== 'production') { - deprecateLog('`mapLocation` is not used anymore.'); - } - defaults(seriesOpt, seriesOpt.mapLocation); - } - } - if (seriesOpt.hoverAnimation != null) { - seriesOpt.emphasis = seriesOpt.emphasis || {}; - if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) { - if ("development" !== 'production') { - deprecateReplaceLog('hoverAnimation', 'emphasis.scale'); - } - seriesOpt.emphasis.scale = seriesOpt.hoverAnimation; - } - } - compatLayoutProperties(seriesOpt); - }); - // dataRange has changed to visualMap - if (option.dataRange) { - option.visualMap = option.dataRange; - } - each(COMPATITABLE_COMPONENTS, function (componentName) { - var options = option[componentName]; - if (options) { - if (!isArray(options)) { - options = [options]; - } - each(options, function (option) { - compatLayoutProperties(option); - }); - } - }); - } - - // (1) [Caution]: the logic is correct based on the premises: - // data processing stage is blocked in stream. - // See - // (2) Only register once when import repeatedly. - // Should be executed after series is filtered and before stack calculation. - function dataStack(ecModel) { - var stackInfoMap = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var stack = seriesModel.get('stack'); - // Compatible: when `stack` is set as '', do not stack. - if (stack) { - var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []); - var data = seriesModel.getData(); - var stackInfo = { - // Used for calculate axis extent automatically. - // TODO: Type getCalculationInfo return more specific type? - stackResultDimension: data.getCalculationInfo('stackResultDimension'), - stackedOverDimension: data.getCalculationInfo('stackedOverDimension'), - stackedDimension: data.getCalculationInfo('stackedDimension'), - stackedByDimension: data.getCalculationInfo('stackedByDimension'), - isStackedByIndex: data.getCalculationInfo('isStackedByIndex'), - data: data, - seriesModel: seriesModel - }; - // If stacked on axis that do not support data stack. - if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) { - return; - } - stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel); - stackInfoList.push(stackInfo); - } - }); - stackInfoMap.each(calculateStack); - } - function calculateStack(stackInfoList) { - each(stackInfoList, function (targetStackInfo, idxInStack) { - var resultVal = []; - var resultNaN = [NaN, NaN]; - var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension]; - var targetData = targetStackInfo.data; - var isStackedByIndex = targetStackInfo.isStackedByIndex; - var stackStrategy = targetStackInfo.seriesModel.get('stackStrategy') || 'samesign'; - // Should not write on raw data, because stack series model list changes - // depending on legend selection. - targetData.modify(dims, function (v0, v1, dataIndex) { - var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); - // Consider `connectNulls` of line area, if value is NaN, stackedOver - // should also be NaN, to draw a appropriate belt area. - if (isNaN(sum)) { - return resultNaN; - } - var byValue; - var stackedDataRawIndex; - if (isStackedByIndex) { - stackedDataRawIndex = targetData.getRawIndex(dataIndex); - } else { - byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex); - } - // If stackOver is NaN, chart view will render point on value start. - var stackedOver = NaN; - for (var j = idxInStack - 1; j >= 0; j--) { - var stackInfo = stackInfoList[j]; - // Has been optimized by inverted indices on `stackedByDimension`. - if (!isStackedByIndex) { - stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue); - } - if (stackedDataRawIndex >= 0) { - var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); - // Considering positive stack, negative stack and empty data - if (stackStrategy === 'all' // single stack group - || stackStrategy === 'positive' && val > 0 || stackStrategy === 'negative' && val < 0 || stackStrategy === 'samesign' && sum >= 0 && val > 0 // All positive stack - || stackStrategy === 'samesign' && sum <= 0 && val < 0 // All negative stack - ) { - // The sum has to be very small to be affected by the - // floating arithmetic problem. An incorrect result will probably - // cause axis min/max to be filtered incorrectly. - sum = addSafe(sum, val); - stackedOver = val; - break; - } - } - } - resultVal[0] = sum; - resultVal[1] = stackedOver; - return resultVal; - }); - }); - } - - // @inner - var SourceImpl = /** @class */function () { - function SourceImpl(fields) { - this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []); - this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; - // Visit config - this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN; - this.startIndex = fields.startIndex || 0; - this.dimensionsDetectedCount = fields.dimensionsDetectedCount; - this.metaRawOption = fields.metaRawOption; - var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine; - if (dimensionsDefine) { - for (var i = 0; i < dimensionsDefine.length; i++) { - var dim = dimensionsDefine[i]; - if (dim.type == null) { - if (guessOrdinal(this, i) === BE_ORDINAL.Must) { - dim.type = 'ordinal'; - } - } - } - } - } - return SourceImpl; - }(); - function isSourceInstance(val) { - return val instanceof SourceImpl; - } - /** - * Create a source from option. - * NOTE: Created source is immutable. Don't change any properties in it. - */ - function createSource(sourceData, thisMetaRawOption, - // can be null. If not provided, auto detect it from `sourceData`. - sourceFormat) { - sourceFormat = sourceFormat || detectSourceFormat(sourceData); - var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy; - var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions); - var source = new SourceImpl({ - data: sourceData, - sourceFormat: sourceFormat, - seriesLayoutBy: seriesLayoutBy, - dimensionsDefine: determined.dimensionsDefine, - startIndex: determined.startIndex, - dimensionsDetectedCount: determined.dimensionsDetectedCount, - metaRawOption: clone(thisMetaRawOption) - }); - return source; - } - /** - * Wrap original series data for some compatibility cases. - */ - function createSourceFromSeriesDataOption(data) { - return new SourceImpl({ - data: data, - sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL - }); - } - /** - * Clone source but excludes source data. - */ - function cloneSourceShallow(source) { - return new SourceImpl({ - data: source.data, - sourceFormat: source.sourceFormat, - seriesLayoutBy: source.seriesLayoutBy, - dimensionsDefine: clone(source.dimensionsDefine), - startIndex: source.startIndex, - dimensionsDetectedCount: source.dimensionsDetectedCount - }); - } - /** - * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`. - */ - function detectSourceFormat(data) { - 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) || isTypedArray(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 (hasOwn(data, key) && isArrayLike(data[key])) { - sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS; - break; - } - } - } - return sourceFormat; - } - /** - * Determine the source definitions from data standalone dimensions definitions - * are not specified. - */ - function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, - // standalone raw dimensions definition, like: - // { - // dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }] - // } - // in `dataset` or `series` - dimensionsDefine) { - var dimensionsDetectedCount; - var startIndex; - // PENDING: Could data be null/undefined here? - // currently, if `dataset.source` not specified, error thrown. - // if `series.data` not specified, nothing rendered without error thrown. - // Should test these cases. - if (!data) { - return { - dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), - startIndex: startIndex, - dimensionsDetectedCount: dimensionsDetectedCount - }; - } - if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { - var dataArrayRows = data; - // 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, dataArrayRows, 10); - } else { - startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0; - } - if (!dimensionsDefine && startIndex === 1) { - dimensionsDefine = []; - arrayRowsTravelFirst(function (val, index) { - dimensionsDefine[index] = val != null ? val + '' : ''; - }, seriesLayoutBy, dataArrayRows, Infinity); - } - dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[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]); - dimensionsDetectedCount = isArray(value0) && value0.length || 1; - } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { - if ("development" !== 'production') { - assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.'); - } - } - return { - startIndex: startIndex, - dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), - dimensionsDetectedCount: dimensionsDetectedCount - }; - } - function objectRowsCollectDimensions(data) { - var firstIndex = 0; - var obj; - while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line - if (obj) { - return keys(obj); - } - } - // 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/undefined or string. - function normalizeDimensionsOption(dimensionsDefine) { - if (!dimensionsDefine) { - // The meaning of null/undefined is different from empty array. - return; - } - var nameMap = createHashMap(); - return map(dimensionsDefine, function (rawItem, index) { - rawItem = isObject(rawItem) ? rawItem : { - name: rawItem - }; - // Other fields will be discarded. - var item = { - name: rawItem.name, - displayName: rawItem.displayName, - type: rawItem.type - }; - // User can set null in dimensions. - // We don't auto specify name, otherwise a given name may - // cause it to be referred 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) { - 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 shouldRetrieveDataByName(source) { - var sourceFormat = source.sourceFormat; - return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS; - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 _a, _b, _c; - var providerMethods; - var mountMethods; - /** - * If normal array used, mutable chunk size is supported. - * If typed array used, chunk size must be fixed. - */ - var DefaultDataProvider = /** @class */function () { - function DefaultDataProvider(sourceParam, dimSize) { - // let source: Source; - var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; - // declare source is Source; - this._source = source; - var data = this._data = source.data; - // Typed array. TODO IE10+? - if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { - if ("development" !== 'production') { - if (dimSize == null) { - throw new Error('Typed array data must specify dimension size'); - } - } - this._offset = 0; - this._dimSize = dimSize; - this._data = data; - } - mountMethods(this, data, source); - } - DefaultDataProvider.prototype.getSource = function () { - return this._source; - }; - DefaultDataProvider.prototype.count = function () { - return 0; - }; - DefaultDataProvider.prototype.getItem = function (idx, out) { - return; - }; - DefaultDataProvider.prototype.appendData = function (newData) {}; - DefaultDataProvider.prototype.clean = function () {}; - DefaultDataProvider.protoInitialize = function () { - // PENDING: To avoid potential incompat (e.g., prototype - // is visited somewhere), still init them on prototype. - var proto = DefaultDataProvider.prototype; - proto.pure = false; - proto.persistent = true; - }(); - DefaultDataProvider.internalField = function () { - var _a; - mountMethods = function (provider, data, source) { - var sourceFormat = source.sourceFormat; - var seriesLayoutBy = source.seriesLayoutBy; - var startIndex = source.startIndex; - var dimsDef = source.dimensionsDefine; - var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)]; - if ("development" !== 'production') { - assert(methods, 'Invalide sourceFormat: ' + sourceFormat); - } - extend(provider, methods); - if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { - provider.getItem = getItemForTypedArray; - provider.count = countForTypedArray; - provider.fillStorage = fillStorageForTypedArray; - } else { - var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy); - provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef); - var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy); - provider.count = bind(rawCounter, null, data, startIndex, dimsDef); - } - }; - var getItemForTypedArray = function (idx, out) { - idx = idx - this._offset; - out = out || []; - var data = this._data; - var dimSize = this._dimSize; - var offset = dimSize * idx; - for (var i = 0; i < dimSize; i++) { - out[i] = data[offset + i]; - } - return out; - }; - var fillStorageForTypedArray = function (start, end, storage, extent) { - var data = this._data; - var dimSize = this._dimSize; - for (var dim = 0; dim < dimSize; dim++) { - var dimExtent = extent[dim]; - var min = dimExtent[0] == null ? Infinity : dimExtent[0]; - var max = dimExtent[1] == null ? -Infinity : dimExtent[1]; - var count = end - start; - var arr = storage[dim]; - for (var i = 0; i < count; i++) { - // appendData with TypedArray will always do replace in provider. - var val = data[i * dimSize + dim]; - arr[start + i] = val; - val < min && (min = val); - val > max && (max = val); - } - dimExtent[0] = min; - dimExtent[1] = max; - } - }; - var countForTypedArray = function () { - return this._data ? this._data.length / this._dimSize : 0; - }; - providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = { - pure: true, - appendData: appendDataSimply - }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = { - pure: true, - appendData: function () { - throw new Error('Do not support appendData when set seriesLayoutBy: "row".'); - } - }, _a[SOURCE_FORMAT_OBJECT_ROWS] = { - pure: true, - appendData: appendDataSimply - }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = { - pure: true, - appendData: function (newData) { - var data = this._data; - each(newData, function (newCol, key) { - var oldCol = data[key] || (data[key] = []); - for (var i = 0; i < (newCol || []).length; i++) { - oldCol.push(newCol[i]); - } - }); - } - }, _a[SOURCE_FORMAT_ORIGINAL] = { - appendData: appendDataSimply - }, _a[SOURCE_FORMAT_TYPED_ARRAY] = { - persistent: false, - pure: true, - appendData: function (newData) { - if ("development" !== 'production') { - assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray'); - } - this._data = newData; - }, - // Clean self if data is already used. - clean: function () { - // PENDING - this._offset += this.count(); - this._data = null; - } - }, _a); - function appendDataSimply(newData) { - for (var i = 0; i < newData.length; i++) { - this._data.push(newData[i]); - } - } - }(); - return DefaultDataProvider; - }(); - var getItemSimply = function (rawData, startIndex, dimsDef, idx) { - return rawData[idx]; - }; - var rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) { - return rawData[idx + startIndex]; - }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx, out) { - idx += startIndex; - var item = out || []; - var data = rawData; - for (var i = 0; i < data.length; i++) { - var row = data[i]; - item[i] = row ? row[idx] : null; - } - return item; - }, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx, out) { - var item = out || []; - for (var i = 0; i < dimsDef.length; i++) { - var dimName = dimsDef[i].name; - if ("development" !== 'production') { - if (dimName == null) { - throw new Error(); - } - } - var col = rawData[dimName]; - item[i] = col ? col[idx] : null; - } - return item; - }, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a); - function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) { - var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; - if ("development" !== 'production') { - assert(method, 'Do not support get item on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); - } - return method; - } - var countSimply = function (rawData, startIndex, dimsDef) { - return rawData.length; - }; - var rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) { - return Math.max(0, rawData.length - startIndex); - }, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) { - var row = rawData[0]; - return row ? Math.max(0, row.length - startIndex) : 0; - }, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) { - var dimName = dimsDef[0].name; - if ("development" !== 'production') { - if (dimName == null) { - throw new Error(); - } - } - var col = rawData[dimName]; - return col ? col.length : 0; - }, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b); - function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) { - var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; - if ("development" !== 'production') { - assert(method, 'Do not support count on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); - } - return method; - } - var getRawValueSimply = function (dataItem, dimIndex, property) { - return dataItem[dimIndex]; - }; - var rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, property) { - return dataItem[property]; - }, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, property) { - // FIXME: In some case (markpoint in geo (geo-map.html)), - // dataItem is {coord: [...]} - var value = getDataItemValue(dataItem); - return !(value instanceof Array) ? value : value[dimIndex]; - }, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c); - function getRawSourceValueGetter(sourceFormat) { - var method = rawSourceValueGetterMap[sourceFormat]; - if ("development" !== 'production') { - assert(method, 'Do not support get value on "' + sourceFormat + '".'); - } - return method; - } - function getMethodMapKey(sourceFormat, seriesLayoutBy) { - return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat; - } - // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem, - // Consider persistent. - // Caution: why use raw value to display on label or tooltip? - // A reason is to avoid format. For example time value we do not know - // how to format is expected. More over, if stack is used, calculated - // value may be 0.91000000001, which have brings trouble to display. - // TODO: consider how to treat null/undefined/NaN when display? - function retrieveRawValue(data, dataIndex, - // If dimIndex is null/undefined, return OptionDataItem. - // Otherwise, return OptionDataValue. - dim) { - if (!data) { - return; - } - // Consider data may be not persistent. - var dataItem = data.getRawDataItem(dataIndex); - if (dataItem == null) { - return; - } - var store = data.getStore(); - var sourceFormat = store.getSource().sourceFormat; - if (dim != null) { - var dimIndex = data.getDimensionIndex(dim); - var property = store.getDimensionProperty(dimIndex); - return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property); - } else { - var result = dataItem; - if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { - result = getDataItemValue(dataItem); - } - return result; - } - } - - var DIMENSION_LABEL_REG = /\{@(.+?)\}/g; - var DataFormatMixin = /** @class */function () { - function DataFormatMixin() {} - /** - * Get params for formatter - */ - DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) { - var data = this.getData(dataType); - var rawValue = this.getRawValue(dataIndex, dataType); - var rawDataIndex = data.getRawIndex(dataIndex); - var name = data.getName(dataIndex); - var itemOpt = data.getRawDataItem(dataIndex); - var style = data.getItemVisual(dataIndex, 'style'); - var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill']; - var borderColor = style && style.stroke; - var mainType = this.mainType; - var isSeries = mainType === 'series'; - var userOutput = data.userOutput && data.userOutput.get(); - return { - componentType: mainType, - componentSubType: this.subType, - componentIndex: this.componentIndex, - seriesType: isSeries ? this.subType : null, - seriesIndex: this.seriesIndex, - seriesId: isSeries ? this.id : null, - seriesName: isSeries ? this.name : null, - name: name, - dataIndex: rawDataIndex, - data: itemOpt, - dataType: dataType, - value: rawValue, - color: color, - borderColor: borderColor, - dimensionNames: userOutput ? userOutput.fullDimensions : null, - encode: userOutput ? userOutput.encode : null, - // Param name list for mapping `a`, `b`, `c`, `d`, `e` - $vars: ['seriesName', 'name', 'value'] - }; - }; - /** - * Format label - * @param dataIndex - * @param status 'normal' by default - * @param dataType - * @param labelDimIndex Only used in some chart that - * use formatter in different dimensions, like radar. - * @param formatter Formatter given outside. - * @return return null/undefined if no formatter - */ - DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) { - status = status || 'normal'; - var data = this.getData(dataType); - var params = this.getDataParams(dataIndex, dataType); - if (extendParams) { - params.value = extendParams.interpolatedValue; - } - if (labelDimIndex != null && isArray(params.value)) { - params.value = params.value[labelDimIndex]; - } - if (!formatter) { - var itemModel = data.getItemModel(dataIndex); - // @ts-ignore - formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']); - } - if (isFunction(formatter)) { - params.status = status; - params.dimensionIndex = labelDimIndex; - return formatter(params); - } else if (isString(formatter)) { - var str = formatTpl(formatter, params); - // Support 'aaa{@[3]}bbb{@product}ccc'. - // Do not support '}' in dim name util have to. - return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) { - var len = dimStr.length; - var dimLoose = dimStr; - if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') { - dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0 - if ("development" !== 'production') { - if (isNaN(dimLoose)) { - error("Invalide label formatter: @" + dimStr + ", only support @[0], @[1], @[2], ..."); - } - } - } - var val = retrieveRawValue(data, dataIndex, dimLoose); - if (extendParams && isArray(extendParams.interpolatedValue)) { - var dimIndex = data.getDimensionIndex(dimLoose); - if (dimIndex >= 0) { - val = extendParams.interpolatedValue[dimIndex]; - } - } - return val != null ? val + '' : ''; - }); - } - }; - /** - * Get raw value in option - */ - DataFormatMixin.prototype.getRawValue = function (idx, dataType) { - return retrieveRawValue(this.getData(dataType), idx); - }; - /** - * Should be implemented. - * @param {number} dataIndex - * @param {boolean} [multipleSeries=false] - * @param {string} [dataType] - */ - DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - // Empty function - return; - }; - return DataFormatMixin; - }(); - // PENDING: previously we accept this type when calling `formatTooltip`, - // but guess little chance has been used outside. Do we need to backward - // compat it? - // type TooltipFormatResultLegacyObject = { - // // `html` means the markup language text, either in 'html' or 'richText'. - // // The name `html` is not appropriate because in 'richText' it is not a HTML - // // string. But still support it for backward compatibility. - // html: string; - // markers: Dictionary; - // }; - /** - * For backward compat, normalize the return from `formatTooltip`. - */ - function normalizeTooltipFormatResult(result) { - var markupText; - // let markers: Dictionary; - var markupFragment; - if (isObject(result)) { - if (result.type) { - markupFragment = result; - } else { - if ("development" !== 'production') { - console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result)); - } - } - // else { - // markupText = (result as TooltipFormatResultLegacyObject).html; - // markers = (result as TooltipFormatResultLegacyObject).markers; - // if (markersExisting) { - // markers = zrUtil.merge(markersExisting, markers); - // } - // } - } else { - markupText = result; - } - return { - text: markupText, - // markers: markers || markersExisting, - frag: markupFragment - }; - } - - /** - * @param {Object} define - * @return See the return of `createTask`. - */ - function createTask(define) { - return new Task(define); - } - var Task = /** @class */function () { - function Task(define) { - define = define || {}; - this._reset = define.reset; - this._plan = define.plan; - this._count = define.count; - this._onDirty = define.onDirty; - this._dirty = true; - } - /** - * @param step Specified step. - * @param skip Skip customer perform call. - * @param modBy Sampling window size. - * @param modDataCount Sampling count. - * @return whether unfinished. - */ - Task.prototype.perform = function (performArgs) { - var upTask = this._upstream; - var skip = performArgs && performArgs.skip; - // TODO some refactor. - // Pull data. Must pull data each time, because context.data - // may be updated by Series.setData. - if (this._dirty && upTask) { - var context = this.context; - context.data = context.outputData = upTask.context.outputData; - } - if (this.__pipeline) { - this.__pipeline.currentTask = this; - } - var planResult; - if (this._plan && !skip) { - planResult = this._plan(this.context); - } - // Support sharding by mod, which changes the render sequence and makes the rendered graphic - // elements uniformed distributed when progress, especially when moving or zooming. - var lastModBy = normalizeModBy(this._modBy); - var lastModDataCount = this._modDataCount || 0; - var modBy = normalizeModBy(performArgs && performArgs.modBy); - var modDataCount = performArgs && performArgs.modDataCount || 0; - if (lastModBy !== modBy || lastModDataCount !== modDataCount) { - planResult = 'reset'; - } - function normalizeModBy(val) { - !(val >= 1) && (val = 1); // jshint ignore:line - return val; - } - var forceFirstProgress; - if (this._dirty || planResult === 'reset') { - this._dirty = false; - forceFirstProgress = this._doReset(skip); - } - this._modBy = modBy; - this._modDataCount = modDataCount; - var step = performArgs && performArgs.step; - if (upTask) { - if ("development" !== 'production') { - assert(upTask._outputDueEnd != null); - } - this._dueEnd = upTask._outputDueEnd; - } - // DataTask or overallTask - else { - if ("development" !== 'production') { - assert(!this._progress || this._count); - } - this._dueEnd = this._count ? this._count(this.context) : Infinity; - } - // Note: Stubs, that its host overall task let it has progress, has progress. - // If no progress, pass index from upstream to downstream each time plan called. - if (this._progress) { - var start = this._dueIndex; - var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd); - if (!skip && (forceFirstProgress || start < end)) { - var progress = this._progress; - if (isArray(progress)) { - for (var i = 0; i < progress.length; i++) { - this._doProgress(progress[i], start, end, modBy, modDataCount); - } - } else { - this._doProgress(progress, start, end, modBy, modDataCount); - } - } - this._dueIndex = end; - // If no `outputDueEnd`, assume that output data and - // input data is the same, so use `dueIndex` as `outputDueEnd`. - var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end; - if ("development" !== 'production') { - // ??? Can not rollback. - assert(outputDueEnd >= this._outputDueEnd); - } - this._outputDueEnd = outputDueEnd; - } else { - // (1) Some overall task has no progress. - // (2) Stubs, that its host overall task do not let it has progress, has no progress. - // This should always be performed so it can be passed to downstream. - this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd; - } - return this.unfinished(); - }; - Task.prototype.dirty = function () { - this._dirty = true; - this._onDirty && this._onDirty(this.context); - }; - Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) { - iterator.reset(start, end, modBy, modDataCount); - this._callingProgress = progress; - this._callingProgress({ - start: start, - end: end, - count: end - start, - next: iterator.next - }, this.context); - }; - Task.prototype._doReset = function (skip) { - this._dueIndex = this._outputDueEnd = this._dueEnd = 0; - this._settedOutputEnd = null; - var progress; - var forceFirstProgress; - if (!skip && this._reset) { - progress = this._reset(this.context); - if (progress && progress.progress) { - forceFirstProgress = progress.forceFirstProgress; - progress = progress.progress; - } - // To simplify no progress checking, array must has item. - if (isArray(progress) && !progress.length) { - progress = null; - } - } - this._progress = progress; - this._modBy = this._modDataCount = null; - var downstream = this._downstream; - downstream && downstream.dirty(); - return forceFirstProgress; - }; - Task.prototype.unfinished = function () { - return this._progress && this._dueIndex < this._dueEnd; - }; - /** - * @param downTask The downstream task. - * @return The downstream task. - */ - Task.prototype.pipe = function (downTask) { - if ("development" !== 'production') { - assert(downTask && !downTask._disposed && downTask !== this); - } - // If already downstream, do not dirty downTask. - if (this._downstream !== downTask || this._dirty) { - this._downstream = downTask; - downTask._upstream = this; - downTask.dirty(); - } - }; - Task.prototype.dispose = function () { - if (this._disposed) { - return; - } - this._upstream && (this._upstream._downstream = null); - this._downstream && (this._downstream._upstream = null); - this._dirty = false; - this._disposed = true; - }; - Task.prototype.getUpstream = function () { - return this._upstream; - }; - Task.prototype.getDownstream = function () { - return this._downstream; - }; - Task.prototype.setOutputEnd = function (end) { - // This only happens in dataTask, dataZoom, map, currently. - // where dataZoom do not set end each time, but only set - // when reset. So we should record the set end, in case - // that the stub of dataZoom perform again and earse the - // set end by upstream. - this._outputDueEnd = this._settedOutputEnd = end; - }; - return Task; - }(); - var iterator = function () { - var end; - var current; - var modBy; - var modDataCount; - var winCount; - var it = { - reset: function (s, e, sStep, sCount) { - current = s; - end = e; - modBy = sStep; - modDataCount = sCount; - winCount = Math.ceil(modDataCount / modBy); - it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext; - } - }; - return it; - function sequentialNext() { - return current < end ? current++ : null; - } - function modNext() { - var dataIndex = current % winCount * modBy + Math.ceil(current / winCount); - var result = current >= end ? null : dataIndex < modDataCount ? dataIndex - // If modDataCount is smaller than data.count() (consider `appendData` case), - // Use normal linear rendering mode. - : current; - current++; - return result; - } - }(); - // ----------------------------------------------------------------------------- - // For stream debug (Should be commented out after used!) - // @usage: printTask(this, 'begin'); - // @usage: printTask(this, null, {someExtraProp}); - // @usage: Use `__idxInPipeline` as conditional breakpiont. - // - // window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void { - // window.ecTaskUID == null && (window.ecTaskUID = 0); - // task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`); - // task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`); - // let props = []; - // if (task.__pipeline) { - // let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`; - // props.push({text: '__idxInPipeline/total', value: val}); - // } else { - // let stubCount = 0; - // task.agentStubMap.each(() => stubCount++); - // props.push({text: 'idx', value: `overall (stubs: ${stubCount})`}); - // } - // props.push({text: 'uid', value: task.uidDebug}); - // if (task.__pipeline) { - // props.push({text: 'pipelineId', value: task.__pipeline.id}); - // task.agent && props.push( - // {text: 'stubFor', value: task.agent.uidDebug} - // ); - // } - // props.push( - // {text: 'dirty', value: task._dirty}, - // {text: 'dueIndex', value: task._dueIndex}, - // {text: 'dueEnd', value: task._dueEnd}, - // {text: 'outputDueEnd', value: task._outputDueEnd} - // ); - // if (extra) { - // Object.keys(extra).forEach(key => { - // props.push({text: key, value: extra[key]}); - // }); - // } - // let args = ['color: blue']; - // let msg = `%c[${prefix || 'T'}] %c` + props.map(item => ( - // args.push('color: green', 'color: red'), - // `${item.text}: %c${item.value}` - // )).join('%c, '); - // console.log.apply(console, [msg].concat(args)); - // // console.log(this); - // }; - // window.printPipeline = function (task: any, prefix: string) { - // const pipeline = task.__pipeline; - // let currTask = pipeline.head; - // while (currTask) { - // window.printTask(currTask, prefix); - // currTask = currTask._downstream; - // } - // }; - // window.showChain = function (chainHeadTask) { - // var chain = []; - // var task = chainHeadTask; - // while (task) { - // chain.push({ - // task: task, - // up: task._upstream, - // down: task._downstream, - // idxInPipeline: task.__idxInPipeline - // }); - // task = task._downstream; - // } - // return chain; - // }; - // window.findTaskInChain = function (task, chainHeadTask) { - // let chain = window.showChain(chainHeadTask); - // let result = []; - // for (let i = 0; i < chain.length; i++) { - // let chainItem = chain[i]; - // if (chainItem.task === task) { - // result.push(i); - // } - // } - // return result; - // }; - // window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) { - // let chainA = window.showChain(chainHeadTaskA); - // for (let i = 0; i < chainA.length; i++) { - // console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB)); - // } - // }; - - /** - * Convert raw the value in to inner value in List. - * - * [Performance sensitive] - * - * [Caution]: this is the key logic of user value parser. - * For backward compatibility, do not modify it until you have to! - */ - function parseDataValue(value, - // For high performance, do not omit the second param. - opt) { - // Performance sensitive. - var dimType = opt && opt.type; - if (dimType === 'ordinal') { - // If given value is a category string - return value; - } - if (dimType === 'time' - // spead up when using timestamp - && !isNumber(value) && value != null && value !== '-') { - value = +parseDate(value); - } - // dimType defaults 'number'. - // If dimType is not ordinal and value is null or undefined or NaN or '-', - // parse to NaN. - // number-like string (like ' 123 ') can be converted to a number. - // where null/undefined or other string will be converted to NaN. - return value == null || value === '' ? NaN - // If string (like '-'), using '+' parse to NaN - // If object, also parse to NaN - : Number(value); - } - var valueParserMap = createHashMap({ - 'number': function (val) { - // Do not use `numericToNumber` here. We have `numericToNumber` by default. - // Here the number parser can have loose rule: - // enable to cut suffix: "120px" => 120, "14%" => 14. - return parseFloat(val); - }, - 'time': function (val) { - // return timestamp. - return +parseDate(val); - }, - 'trim': function (val) { - return isString(val) ? trim(val) : val; - } - }); - function getRawValueParser(type) { - return valueParserMap.get(type); - } - var ORDER_COMPARISON_OP_MAP = { - lt: function (lval, rval) { - return lval < rval; - }, - lte: function (lval, rval) { - return lval <= rval; - }, - gt: function (lval, rval) { - return lval > rval; - }, - gte: function (lval, rval) { - return lval >= rval; - } - }; - var FilterOrderComparator = /** @class */function () { - function FilterOrderComparator(op, rval) { - if (!isNumber(rval)) { - var errMsg = ''; - if ("development" !== 'production') { - errMsg = 'rvalue of "<", ">", "<=", ">=" can only be number in filter.'; - } - throwError(errMsg); - } - this._opFn = ORDER_COMPARISON_OP_MAP[op]; - this._rvalFloat = numericToNumber(rval); - } - // Performance sensitive. - FilterOrderComparator.prototype.evaluate = function (lval) { - // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat. - return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat); - }; - return FilterOrderComparator; - }(); - var SortOrderComparator = /** @class */function () { - /** - * @param order by default: 'asc' - * @param incomparable by default: Always on the tail. - * That is, if 'asc' => 'max', if 'desc' => 'min' - * See the definition of "incomparable" in [SORT_COMPARISON_RULE]. - */ - function SortOrderComparator(order, incomparable) { - var isDesc = order === 'desc'; - this._resultLT = isDesc ? 1 : -1; - if (incomparable == null) { - incomparable = isDesc ? 'min' : 'max'; - } - this._incomparable = incomparable === 'min' ? -Infinity : Infinity; - } - // See [SORT_COMPARISON_RULE]. - // Performance sensitive. - SortOrderComparator.prototype.evaluate = function (lval, rval) { - // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat. - var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval); - var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval); - var lvalNotNumeric = isNaN(lvalFloat); - var rvalNotNumeric = isNaN(rvalFloat); - if (lvalNotNumeric) { - lvalFloat = this._incomparable; - } - if (rvalNotNumeric) { - rvalFloat = this._incomparable; - } - if (lvalNotNumeric && rvalNotNumeric) { - var lvalIsStr = isString(lval); - var rvalIsStr = isString(rval); - if (lvalIsStr) { - lvalFloat = rvalIsStr ? lval : 0; - } - if (rvalIsStr) { - rvalFloat = lvalIsStr ? rval : 0; - } - } - return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0; - }; - return SortOrderComparator; - }(); - var FilterEqualityComparator = /** @class */function () { - function FilterEqualityComparator(isEq, rval) { - this._rval = rval; - this._isEQ = isEq; - this._rvalTypeof = typeof rval; - this._rvalFloat = numericToNumber(rval); - } - // Performance sensitive. - FilterEqualityComparator.prototype.evaluate = function (lval) { - var eqResult = lval === this._rval; - if (!eqResult) { - var lvalTypeof = typeof lval; - if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) { - eqResult = numericToNumber(lval) === this._rvalFloat; - } - } - return this._isEQ ? eqResult : !eqResult; - }; - return FilterEqualityComparator; - }(); - /** - * [FILTER_COMPARISON_RULE] - * `lt`|`lte`|`gt`|`gte`: - * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare. - * `eq`: - * + If same type, compare with `===`. - * + If there is one number, convert to number (`numericToNumber`) to compare. - * + Else return `false`. - * `ne`: - * + Not `eq`. - * - * - * [SORT_COMPARISON_RULE] - * All the values are grouped into three categories: - * + "numeric" (number and numeric string) - * + "non-numeric-string" (string that excluding numeric string) - * + "others" - * "numeric" vs "numeric": values are ordered by number order. - * "non-numeric-string" vs "non-numeric-string": values are ordered by ES spec (#sec-abstract-relational-comparison). - * "others" vs "others": do not change order (always return 0). - * "numeric" vs "non-numeric-string": "non-numeric-string" is treated as "incomparable". - * "number" vs "others": "others" is treated as "incomparable". - * "non-numeric-string" vs "others": "others" is treated as "incomparable". - * "incomparable" will be seen as -Infinity or Infinity (depends on the settings). - * MEMO: - * Non-numeric string sort makes sense when we need to put the items with the same tag together. - * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`, - * So we treat "numeric-string" sorted by number order rather than string comparison. - * - * - * [CHECK_LIST_OF_THE_RULE_DESIGN] - * + Do not support string comparison until required. And also need to - * avoid the misleading of "2" > "12". - * + Should avoid the misleading case: - * `" 22 " gte "22"` is `true` but `" 22 " eq "22"` is `false`. - * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ... - * + Only "numeric" can be converted to comparable number, otherwise converted to NaN. - * See `util/number.ts#numericToNumber`. - * - * @return If `op` is not `RelationalOperator`, return null; - */ - function createFilterComparator(op, rval) { - return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null; - } - - /** - * TODO: disable writable. - * This structure will be exposed to users. - */ - var ExternalSource = /** @class */function () { - function ExternalSource() {} - ExternalSource.prototype.getRawData = function () { - // Only built-in transform available. - throw new Error('not supported'); - }; - ExternalSource.prototype.getRawDataItem = function (dataIndex) { - // Only built-in transform available. - throw new Error('not supported'); - }; - ExternalSource.prototype.cloneRawData = function () { - return; - }; - /** - * @return If dimension not found, return null/undefined. - */ - ExternalSource.prototype.getDimensionInfo = function (dim) { - return; - }; - /** - * dimensions defined if and only if either: - * (a) dataset.dimensions are declared. - * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`). - * If dimensions are defined, `dimensionInfoAll` is corresponding to - * the defined dimensions. - * Otherwise, `dimensionInfoAll` is determined by data columns. - * @return Always return an array (even empty array). - */ - ExternalSource.prototype.cloneAllDimensionInfo = function () { - return; - }; - ExternalSource.prototype.count = function () { - return; - }; - /** - * Only support by dimension index. - * No need to support by dimension name in transform function, - * because transform function is not case-specific, no need to use name literally. - */ - ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) { - return; - }; - ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) { - return; - }; - ExternalSource.prototype.convertValue = function (rawVal, dimInfo) { - return parseDataValue(rawVal, dimInfo); - }; - return ExternalSource; - }(); - function createExternalSource(internalSource, externalTransform) { - var extSource = new ExternalSource(); - var data = internalSource.data; - var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat; - var sourceHeaderCount = internalSource.startIndex; - var errMsg = ''; - if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) { - // For the logic simplicity in transformer, only 'culumn' is - // supported in data transform. Otherwise, the `dimensionsDefine` - // might be detected by 'row', which probably confuses users. - if ("development" !== 'production') { - errMsg = '`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'; - } - throwError(errMsg); - } - // [MEMO] - // Create a new dimensions structure for exposing. - // Do not expose all dimension info to users directly. - // Because the dimension is probably auto detected from data and not might reliable. - // Should not lead the transformers to think that is reliable and return it. - // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`. - var dimensions = []; - var dimsByName = {}; - var dimsDef = internalSource.dimensionsDefine; - if (dimsDef) { - each(dimsDef, function (dimDef, idx) { - var name = dimDef.name; - var dimDefExt = { - index: idx, - name: name, - displayName: dimDef.displayName - }; - dimensions.push(dimDefExt); - // Users probably do not specify dimension name. For simplicity, data transform - // does not generate dimension name. - if (name != null) { - // Dimension name should not be duplicated. - // For simplicity, data transform forbids name duplication, do not generate - // new name like module `completeDimensions.ts` did, but just tell users. - var errMsg_1 = ''; - if (hasOwn(dimsByName, name)) { - if ("development" !== 'production') { - errMsg_1 = 'dimension name "' + name + '" duplicated.'; - } - throwError(errMsg_1); - } - dimsByName[name] = dimDefExt; - } - }); - } - // If dimension definitions are not defined and can not be detected. - // e.g., pure data `[[11, 22], ...]`. - else { - for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) { - // Do not generete name or anything others. The consequence process in - // `transform` or `series` probably have there own name generation strategry. - dimensions.push({ - index: i - }); - } - } - // Implement public methods: - var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); - if (externalTransform.__isBuiltIn) { - extSource.getRawDataItem = function (dataIndex) { - return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); - }; - extSource.getRawData = bind(getRawData, null, internalSource); - } - extSource.cloneRawData = bind(cloneRawData, null, internalSource); - var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); - extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions); - var rawValueGetter = getRawSourceValueGetter(sourceFormat); - extSource.retrieveValue = function (dataIndex, dimIndex) { - var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); - return retrieveValueFromItem(rawItem, dimIndex); - }; - var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) { - if (dataItem == null) { - return; - } - var dimDef = dimensions[dimIndex]; - // When `dimIndex` is `null`, `rawValueGetter` return the whole item. - if (dimDef) { - return rawValueGetter(dataItem, dimIndex, dimDef.name); - } - }; - extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName); - extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions); - return extSource; - } - function getRawData(upstream) { - var sourceFormat = upstream.sourceFormat; - if (!isSupportedSourceFormat(sourceFormat)) { - var errMsg = ''; - if ("development" !== 'production') { - errMsg = '`getRawData` is not supported in source format ' + sourceFormat; - } - throwError(errMsg); - } - return upstream.data; - } - function cloneRawData(upstream) { - var sourceFormat = upstream.sourceFormat; - var data = upstream.data; - if (!isSupportedSourceFormat(sourceFormat)) { - var errMsg = ''; - if ("development" !== 'production') { - errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat; - } - throwError(errMsg); - } - if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { - var result = []; - for (var i = 0, len = data.length; i < len; i++) { - // Not strictly clone for performance - result.push(data[i].slice()); - } - return result; - } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { - var result = []; - for (var i = 0, len = data.length; i < len; i++) { - // Not strictly clone for performance - result.push(extend({}, data[i])); - } - return result; - } - } - function getDimensionInfo(dimensions, dimsByName, dim) { - if (dim == null) { - return; - } - // Keep the same logic as `List::getDimension` did. - if (isNumber(dim) - // If being a number-like string but not being defined a dimension name. - || !isNaN(dim) && !hasOwn(dimsByName, dim)) { - return dimensions[dim]; - } else if (hasOwn(dimsByName, dim)) { - return dimsByName[dim]; - } - } - function cloneAllDimensionInfo(dimensions) { - return clone(dimensions); - } - var externalTransformMap = createHashMap(); - function registerExternalTransform(externalTransform) { - externalTransform = clone(externalTransform); - var type = externalTransform.type; - var errMsg = ''; - if (!type) { - if ("development" !== 'production') { - errMsg = 'Must have a `type` when `registerTransform`.'; - } - throwError(errMsg); - } - var typeParsed = type.split(':'); - if (typeParsed.length !== 2) { - if ("development" !== 'production') { - errMsg = 'Name must include namespace like "ns:regression".'; - } - throwError(errMsg); - } - // Namespace 'echarts:xxx' is official namespace, where the transforms should - // be called directly via 'xxx' rather than 'echarts:xxx'. - var isBuiltIn = false; - if (typeParsed[0] === 'echarts') { - type = typeParsed[1]; - isBuiltIn = true; - } - externalTransform.__isBuiltIn = isBuiltIn; - externalTransformMap.set(type, externalTransform); - } - function applyDataTransform(rawTransOption, sourceList, infoForPrint) { - var pipedTransOption = normalizeToArray(rawTransOption); - var pipeLen = pipedTransOption.length; - var errMsg = ''; - if (!pipeLen) { - if ("development" !== 'production') { - errMsg = 'If `transform` declared, it should at least contain one transform.'; - } - throwError(errMsg); - } - for (var i = 0, len = pipeLen; i < len; i++) { - var transOption = pipedTransOption[i]; - sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); - // piped transform only support single input, except the fist one. - // piped transform only support single output, except the last one. - if (i !== len - 1) { - sourceList.length = Math.max(sourceList.length, 1); - } - } - return sourceList; - } - function applySingleDataTransform(transOption, upSourceList, infoForPrint, - // If `pipeIndex` is null/undefined, no piped transform. - pipeIndex) { - var errMsg = ''; - if (!upSourceList.length) { - if ("development" !== 'production') { - errMsg = 'Must have at least one upstream dataset.'; - } - throwError(errMsg); - } - if (!isObject(transOption)) { - if ("development" !== 'production') { - errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.'; - } - throwError(errMsg); - } - var transType = transOption.type; - var externalTransform = externalTransformMap.get(transType); - if (!externalTransform) { - if ("development" !== 'production') { - errMsg = 'Can not find transform on type "' + transType + '".'; - } - throwError(errMsg); - } - // Prepare source - var extUpSourceList = map(upSourceList, function (upSource) { - return createExternalSource(upSource, externalTransform); - }); - var resultList = normalizeToArray(externalTransform.transform({ - upstream: extUpSourceList[0], - upstreamList: extUpSourceList, - config: clone(transOption.config) - })); - if ("development" !== 'production') { - if (transOption.print) { - var printStrArr = map(resultList, function (extSource) { - var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : ''; - return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\n'); - }).join('\n'); - log(printStrArr); - } - } - return map(resultList, function (result, resultIndex) { - var errMsg = ''; - if (!isObject(result)) { - if ("development" !== 'production') { - errMsg = 'A transform should not return some empty results.'; - } - throwError(errMsg); - } - if (!result.data) { - if ("development" !== 'production') { - errMsg = 'Transform result data should be not be null or undefined'; - } - throwError(errMsg); - } - var sourceFormat = detectSourceFormat(result.data); - if (!isSupportedSourceFormat(sourceFormat)) { - if ("development" !== 'production') { - errMsg = 'Transform result data should be array rows or object rows.'; - } - throwError(errMsg); - } - var resultMetaRawOption; - var firstUpSource = upSourceList[0]; - /** - * Intuitively, the end users known the content of the original `dataset.source`, - * calucating the transform result in mind. - * Suppose the original `dataset.source` is: - * ```js - * [ - * ['product', '2012', '2013', '2014', '2015'], - * ['AAA', 41.1, 30.4, 65.1, 53.3], - * ['BBB', 86.5, 92.1, 85.7, 83.1], - * ['CCC', 24.1, 67.2, 79.5, 86.4] - * ] - * ``` - * The dimension info have to be detected from the source data. - * Some of the transformers (like filter, sort) will follow the dimension info - * of upstream, while others use new dimensions (like aggregate). - * Transformer can output a field `dimensions` to define the its own output dimensions. - * We also allow transformers to ignore the output `dimensions` field, and - * inherit the upstream dimensions definition. It can reduce the burden of handling - * dimensions in transformers. - * - * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`. - */ - if (firstUpSource && resultIndex === 0 - // If transformer returns `dimensions`, it means that the transformer has different - // dimensions definitions. We do not inherit anything from upstream. - && !result.dimensions) { - var startIndex = firstUpSource.startIndex; - // We copy the header of upstream to the result, because: - // (1) The returned data always does not contain header line and can not be used - // as dimension-detection. In this case we can not use "detected dimensions" of - // upstream directly, because it might be detected based on different `seriesLayoutBy`. - // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`. - // So the original detected header should be add to the result, otherwise they can not be read. - if (startIndex) { - result.data = firstUpSource.data.slice(0, startIndex).concat(result.data); - } - resultMetaRawOption = { - seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, - sourceHeader: startIndex, - dimensions: firstUpSource.metaRawOption.dimensions - }; - } else { - resultMetaRawOption = { - seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, - sourceHeader: 0, - dimensions: result.dimensions - }; - } - return createSource(result.data, resultMetaRawOption, null); - }); - } - function isSupportedSourceFormat(sourceFormat) { - return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS; - } - - var UNDEFINED = 'undefined'; - /* global Float64Array, Int32Array, Uint32Array, Uint16Array */ - // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is - // different from the Ctor of typed array. - var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array; - var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array; - var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array; - var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array; - /** - * Multi dimensional data store - */ - var dataCtors = { - 'float': CtorFloat64Array, - 'int': CtorInt32Array, - // Ordinal data type can be string or int - 'ordinal': Array, - 'number': Array, - 'time': CtorFloat64Array - }; - var defaultDimValueGetters; - function getIndicesCtor(rawCount) { - // The possible max value in this._indicies is always this._rawCount despite of filtering. - return rawCount > 65535 ? CtorUint32Array : CtorUint16Array; - } - function getInitialExtent() { - return [Infinity, -Infinity]; - } - function cloneChunk(originalChunk) { - var Ctor = originalChunk.constructor; - // Only shallow clone is enough when Array. - return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk); - } - function prepareStore(store, dimIdx, dimType, end, append) { - var DataCtor = dataCtors[dimType || 'float']; - if (append) { - var oldStore = store[dimIdx]; - var oldLen = oldStore && oldStore.length; - if (!(oldLen === end)) { - var newStore = new DataCtor(end); - // The cost of the copy is probably inconsiderable - // within the initial chunkSize. - for (var j = 0; j < oldLen; j++) { - newStore[j] = oldStore[j]; - } - store[dimIdx] = newStore; - } - } else { - store[dimIdx] = new DataCtor(end); - } - } - /** - * Basically, DataStore API keep immutable. - */ - var DataStore = /** @class */function () { - function DataStore() { - this._chunks = []; - // It will not be calculated until needed. - this._rawExtent = []; - this._extent = []; - this._count = 0; - this._rawCount = 0; - this._calcDimNameToIdx = createHashMap(); - } - /** - * Initialize from data - */ - DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) { - if ("development" !== 'production') { - assert(isFunction(provider.getItem) && isFunction(provider.count), 'Invalid data provider.'); - } - this._provider = provider; - // Clear - this._chunks = []; - this._indices = null; - this.getRawIndex = this._getRawIdxIdentity; - var source = provider.getSource(); - var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat]; - // Default dim value getter - this._dimValueGetter = dimValueGetter || defaultGetter; - // Reset raw extent. - this._rawExtent = []; - var willRetrieveDataByName = shouldRetrieveDataByName(source); - this._dimensions = map(inputDimensions, function (dim) { - if ("development" !== 'production') { - if (willRetrieveDataByName) { - assert(dim.property != null); - } - } - return { - // Only pick these two props. Not leak other properties like orderMeta. - type: dim.type, - property: dim.property - }; - }); - this._initDataFromProvider(0, provider.count()); - }; - DataStore.prototype.getProvider = function () { - return this._provider; - }; - /** - * Caution: even when a `source` instance owned by a series, the created data store - * may still be shared by different sereis (the source hash does not use all `source` - * props, see `sourceManager`). In this case, the `source` props that are not used in - * hash (like `source.dimensionDefine`) probably only belongs to a certain series and - * thus should not be fetch here. - */ - DataStore.prototype.getSource = function () { - return this._provider.getSource(); - }; - /** - * @caution Only used in dataStack. - */ - DataStore.prototype.ensureCalculationDimension = function (dimName, type) { - var calcDimNameToIdx = this._calcDimNameToIdx; - var dimensions = this._dimensions; - var calcDimIdx = calcDimNameToIdx.get(dimName); - if (calcDimIdx != null) { - if (dimensions[calcDimIdx].type === type) { - return calcDimIdx; - } - } else { - calcDimIdx = dimensions.length; - } - dimensions[calcDimIdx] = { - type: type - }; - calcDimNameToIdx.set(dimName, calcDimIdx); - this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount); - this._rawExtent[calcDimIdx] = getInitialExtent(); - return calcDimIdx; - }; - DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) { - var chunk = this._chunks[dimIdx]; - var dim = this._dimensions[dimIdx]; - var rawExtents = this._rawExtent; - var offset = dim.ordinalOffset || 0; - var len = chunk.length; - if (offset === 0) { - // We need to reset the rawExtent if collect is from start. - // Because this dimension may be guessed as number and calcuating a wrong extent. - rawExtents[dimIdx] = getInitialExtent(); - } - var dimRawExtent = rawExtents[dimIdx]; - // Parse from previous data offset. len may be changed after appendData - for (var i = offset; i < len; i++) { - var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]); - if (!isNaN(val)) { - dimRawExtent[0] = Math.min(val, dimRawExtent[0]); - dimRawExtent[1] = Math.max(val, dimRawExtent[1]); - } - } - dim.ordinalMeta = ordinalMeta; - dim.ordinalOffset = len; - dim.type = 'ordinal'; // Force to be ordinal - }; - - DataStore.prototype.getOrdinalMeta = function (dimIdx) { - var dimInfo = this._dimensions[dimIdx]; - var ordinalMeta = dimInfo.ordinalMeta; - return ordinalMeta; - }; - DataStore.prototype.getDimensionProperty = function (dimIndex) { - var item = this._dimensions[dimIndex]; - return item && item.property; - }; - /** - * Caution: Can be only called on raw data (before `this._indices` created). - */ - DataStore.prototype.appendData = function (data) { - if ("development" !== 'production') { - assert(!this._indices, 'appendData can only be called on raw data.'); - } - var provider = this._provider; - var start = this.count(); - provider.appendData(data); - var end = provider.count(); - if (!provider.persistent) { - end += start; - } - if (start < end) { - this._initDataFromProvider(start, end, true); - } - return [start, end]; - }; - DataStore.prototype.appendValues = function (values, minFillLen) { - var chunks = this._chunks; - var dimensions = this._dimensions; - var dimLen = dimensions.length; - var rawExtent = this._rawExtent; - var start = this.count(); - var end = start + Math.max(values.length, minFillLen || 0); - for (var i = 0; i < dimLen; i++) { - var dim = dimensions[i]; - prepareStore(chunks, i, dim.type, end, true); - } - var emptyDataItem = []; - for (var idx = start; idx < end; idx++) { - var sourceIdx = idx - start; - // Store the data by dimensions - for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) { - var dim = dimensions[dimIdx]; - var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx); - chunks[dimIdx][idx] = val; - var dimRawExtent = rawExtent[dimIdx]; - val < dimRawExtent[0] && (dimRawExtent[0] = val); - val > dimRawExtent[1] && (dimRawExtent[1] = val); - } - } - this._rawCount = this._count = end; - return { - start: start, - end: end - }; - }; - DataStore.prototype._initDataFromProvider = function (start, end, append) { - var provider = this._provider; - var chunks = this._chunks; - var dimensions = this._dimensions; - var dimLen = dimensions.length; - var rawExtent = this._rawExtent; - var dimNames = map(dimensions, function (dim) { - return dim.property; - }); - for (var i = 0; i < dimLen; i++) { - var dim = dimensions[i]; - if (!rawExtent[i]) { - rawExtent[i] = getInitialExtent(); - } - prepareStore(chunks, i, dim.type, end, append); - } - if (provider.fillStorage) { - provider.fillStorage(start, end, chunks, rawExtent); - } else { - var dataItem = []; - for (var idx = start; idx < end; idx++) { - // NOTICE: Try not to write things into dataItem - dataItem = provider.getItem(idx, dataItem); - // Each data item is value - // [1, 2] - // 2 - // Bar chart, line chart which uses category axis - // only gives the 'y' value. 'x' value is the indices of category - // Use a tempValue to normalize the value to be a (x, y) value - // Store the data by dimensions - for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) { - var dimStorage = chunks[dimIdx]; - // PENDING NULL is empty or zero - var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx); - dimStorage[idx] = val; - var dimRawExtent = rawExtent[dimIdx]; - val < dimRawExtent[0] && (dimRawExtent[0] = val); - val > dimRawExtent[1] && (dimRawExtent[1] = val); - } - } - } - if (!provider.persistent && provider.clean) { - // Clean unused data if data source is typed array. - provider.clean(); - } - this._rawCount = this._count = end; - // Reset data extent - this._extent = []; - }; - DataStore.prototype.count = function () { - return this._count; - }; - /** - * Get value. Return NaN if idx is out of range. - */ - DataStore.prototype.get = function (dim, idx) { - if (!(idx >= 0 && idx < this._count)) { - return NaN; - } - var dimStore = this._chunks[dim]; - return dimStore ? dimStore[this.getRawIndex(idx)] : NaN; - }; - DataStore.prototype.getValues = function (dimensions, idx) { - var values = []; - var dimArr = []; - if (idx == null) { - idx = dimensions; - // TODO get all from store? - dimensions = []; - // All dimensions - for (var i = 0; i < this._dimensions.length; i++) { - dimArr.push(i); - } - } else { - dimArr = dimensions; - } - for (var i = 0, len = dimArr.length; i < len; i++) { - values.push(this.get(dimArr[i], idx)); - } - return values; - }; - /** - * @param dim concrete dim - */ - DataStore.prototype.getByRawIndex = function (dim, rawIdx) { - if (!(rawIdx >= 0 && rawIdx < this._rawCount)) { - return NaN; - } - var dimStore = this._chunks[dim]; - return dimStore ? dimStore[rawIdx] : NaN; - }; - /** - * Get sum of data in one dimension - */ - DataStore.prototype.getSum = function (dim) { - var dimData = this._chunks[dim]; - var sum = 0; - if (dimData) { - for (var i = 0, len = this.count(); i < len; i++) { - var value = this.get(dim, i); - if (!isNaN(value)) { - sum += value; - } - } - } - return sum; - }; - /** - * Get median of data in one dimension - */ - DataStore.prototype.getMedian = function (dim) { - var dimDataArray = []; - // map all data of one dimension - this.each([dim], function (val) { - if (!isNaN(val)) { - dimDataArray.push(val); - } - }); - // TODO - // Use quick select? - var sortedDimDataArray = dimDataArray.sort(function (a, b) { - return a - b; - }); - var len = this.count(); - // calculate median - return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; - }; - /** - * Retrieve the index with given raw data index. - */ - DataStore.prototype.indexOfRawIndex = function (rawIndex) { - if (rawIndex >= this._rawCount || rawIndex < 0) { - return -1; - } - if (!this._indices) { - return rawIndex; - } - // Indices are ascending - var indices = this._indices; - // If rawIndex === dataIndex - var rawDataIndex = indices[rawIndex]; - if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) { - return rawIndex; - } - var left = 0; - var right = this._count - 1; - while (left <= right) { - var mid = (left + right) / 2 | 0; - if (indices[mid] < rawIndex) { - left = mid + 1; - } else if (indices[mid] > rawIndex) { - right = mid - 1; - } else { - return mid; - } - } - return -1; - }; - /** - * Retrieve the index of nearest value. - * @param dim - * @param value - * @param [maxDistance=Infinity] - * @return If and only if multiple indices have - * the same value, they are put to the result. - */ - DataStore.prototype.indicesOfNearest = function (dim, value, maxDistance) { - var chunks = this._chunks; - var dimData = chunks[dim]; - var nearestIndices = []; - if (!dimData) { - return nearestIndices; - } - if (maxDistance == null) { - maxDistance = Infinity; - } - var minDist = Infinity; - var minDiff = -1; - var nearestIndicesLen = 0; - // Check the test case of `test/ut/spec/data/SeriesData.js`. - for (var i = 0, len = this.count(); i < len; i++) { - var dataIndex = this.getRawIndex(i); - var diff = value - dimData[dataIndex]; - var dist = Math.abs(diff); - if (dist <= maxDistance) { - // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`, - // we'd better not push both of them to `nearestIndices`, otherwise it is easy to - // get more than one item in `nearestIndices` (more specifically, in `tooltip`). - // So we choose the one that `diff >= 0` in this case. - // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them - // should be push to `nearestIndices`. - if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) { - minDist = dist; - minDiff = diff; - nearestIndicesLen = 0; - } - if (diff === minDiff) { - nearestIndices[nearestIndicesLen++] = i; - } - } - } - nearestIndices.length = nearestIndicesLen; - return nearestIndices; - }; - DataStore.prototype.getIndices = function () { - var newIndices; - var indices = this._indices; - if (indices) { - var Ctor = indices.constructor; - var thisCount = this._count; - // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`. - if (Ctor === Array) { - newIndices = new Ctor(thisCount); - for (var i = 0; i < thisCount; i++) { - newIndices[i] = indices[i]; - } - } else { - newIndices = new Ctor(indices.buffer, 0, thisCount); - } - } else { - var Ctor = getIndicesCtor(this._rawCount); - newIndices = new Ctor(this.count()); - for (var i = 0; i < newIndices.length; i++) { - newIndices[i] = i; - } - } - return newIndices; - }; - /** - * Data filter. - */ - DataStore.prototype.filter = function (dims, cb) { - if (!this._count) { - return this; - } - var newStore = this.clone(); - var count = newStore.count(); - var Ctor = getIndicesCtor(newStore._rawCount); - var newIndices = new Ctor(count); - var value = []; - var dimSize = dims.length; - var offset = 0; - var dim0 = dims[0]; - var chunks = newStore._chunks; - for (var i = 0; i < count; i++) { - var keep = void 0; - var rawIdx = newStore.getRawIndex(i); - // Simple optimization - if (dimSize === 0) { - keep = cb(i); - } else if (dimSize === 1) { - var val = chunks[dim0][rawIdx]; - keep = cb(val, i); - } else { - var k = 0; - for (; k < dimSize; k++) { - value[k] = chunks[dims[k]][rawIdx]; - } - value[k] = i; - keep = cb.apply(null, value); - } - if (keep) { - newIndices[offset++] = rawIdx; - } - } - // Set indices after filtered. - if (offset < count) { - newStore._indices = newIndices; - } - newStore._count = offset; - // Reset data extent - newStore._extent = []; - newStore._updateGetRawIdx(); - return newStore; - }; - /** - * Select data in range. (For optimization of filter) - * (Manually inline code, support 5 million data filtering in data zoom.) - */ - DataStore.prototype.selectRange = function (range) { - var newStore = this.clone(); - var len = newStore._count; - if (!len) { - return this; - } - var dims = keys(range); - var dimSize = dims.length; - if (!dimSize) { - return this; - } - var originalCount = newStore.count(); - var Ctor = getIndicesCtor(newStore._rawCount); - var newIndices = new Ctor(originalCount); - var offset = 0; - var dim0 = dims[0]; - var min = range[dim0][0]; - var max = range[dim0][1]; - var storeArr = newStore._chunks; - var quickFinished = false; - if (!newStore._indices) { - // Extreme optimization for common case. About 2x faster in chrome. - var idx = 0; - if (dimSize === 1) { - var dimStorage = storeArr[dims[0]]; - for (var i = 0; i < len; i++) { - var val = dimStorage[i]; - // NaN will not be filtered. Consider the case, in line chart, empty - // value indicates the line should be broken. But for the case like - // scatter plot, a data item with empty value will not be rendered, - // but the axis extent may be effected if some other dim of the data - // item has value. Fortunately it is not a significant negative effect. - if (val >= min && val <= max || isNaN(val)) { - newIndices[offset++] = idx; - } - idx++; - } - quickFinished = true; - } else if (dimSize === 2) { - var dimStorage = storeArr[dims[0]]; - var dimStorage2 = storeArr[dims[1]]; - var min2 = range[dims[1]][0]; - var max2 = range[dims[1]][1]; - for (var i = 0; i < len; i++) { - var val = dimStorage[i]; - var val2 = dimStorage2[i]; - // Do not filter NaN, see comment above. - if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) { - newIndices[offset++] = idx; - } - idx++; - } - quickFinished = true; - } - } - if (!quickFinished) { - if (dimSize === 1) { - for (var i = 0; i < originalCount; i++) { - var rawIndex = newStore.getRawIndex(i); - var val = storeArr[dims[0]][rawIndex]; - // Do not filter NaN, see comment above. - if (val >= min && val <= max || isNaN(val)) { - newIndices[offset++] = rawIndex; - } - } - } else { - for (var i = 0; i < originalCount; i++) { - var keep = true; - var rawIndex = newStore.getRawIndex(i); - for (var k = 0; k < dimSize; k++) { - var dimk = dims[k]; - var val = storeArr[dimk][rawIndex]; - // Do not filter NaN, see comment above. - if (val < range[dimk][0] || val > range[dimk][1]) { - keep = false; - } - } - if (keep) { - newIndices[offset++] = newStore.getRawIndex(i); - } - } - } - } - // Set indices after filtered. - if (offset < originalCount) { - newStore._indices = newIndices; - } - newStore._count = offset; - // Reset data extent - newStore._extent = []; - newStore._updateGetRawIdx(); - return newStore; - }; - // /** - // * Data mapping to a plain array - // */ - // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] { - // const result: any[] = []; - // this.each(dims, function () { - // result.push(cb && (cb as MapArrayCb).apply(null, arguments)); - // }); - // return result; - // } - /** - * Data mapping to a new List with given dimensions - */ - DataStore.prototype.map = function (dims, cb) { - // TODO only clone picked chunks. - var target = this.clone(dims); - this._updateDims(target, dims, cb); - return target; - }; - /** - * @caution Danger!! Only used in dataStack. - */ - DataStore.prototype.modify = function (dims, cb) { - this._updateDims(this, dims, cb); - }; - DataStore.prototype._updateDims = function (target, dims, cb) { - var targetChunks = target._chunks; - var tmpRetValue = []; - var dimSize = dims.length; - var dataCount = target.count(); - var values = []; - var rawExtent = target._rawExtent; - for (var i = 0; i < dims.length; i++) { - rawExtent[dims[i]] = getInitialExtent(); - } - for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) { - var rawIndex = target.getRawIndex(dataIndex); - for (var k = 0; k < dimSize; k++) { - values[k] = targetChunks[dims[k]][rawIndex]; - } - values[dimSize] = dataIndex; - var retValue = cb && cb.apply(null, values); - if (retValue != null) { - // a number or string (in oridinal dimension)? - if (typeof retValue !== 'object') { - tmpRetValue[0] = retValue; - retValue = tmpRetValue; - } - for (var i = 0; i < retValue.length; i++) { - var dim = dims[i]; - var val = retValue[i]; - var rawExtentOnDim = rawExtent[dim]; - var dimStore = targetChunks[dim]; - if (dimStore) { - dimStore[rawIndex] = val; - } - if (val < rawExtentOnDim[0]) { - rawExtentOnDim[0] = val; - } - if (val > rawExtentOnDim[1]) { - rawExtentOnDim[1] = val; - } - } - } - } - }; - /** - * Large data down sampling using largest-triangle-three-buckets - * @param {string} valueDimension - * @param {number} targetCount - */ - DataStore.prototype.lttbDownSample = function (valueDimension, rate) { - var target = this.clone([valueDimension], true); - var targetStorage = target._chunks; - var dimStore = targetStorage[valueDimension]; - var len = this.count(); - var sampledIndex = 0; - var frameSize = Math.floor(1 / rate); - var currentRawIndex = this.getRawIndex(0); - var maxArea; - var area; - var nextRawIndex; - var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len)); - // First frame use the first data. - newIndices[sampledIndex++] = currentRawIndex; - for (var i = 1; i < len - 1; i += frameSize) { - var nextFrameStart = Math.min(i + frameSize, len - 1); - var nextFrameEnd = Math.min(i + frameSize * 2, len); - var avgX = (nextFrameEnd + nextFrameStart) / 2; - var avgY = 0; - for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) { - var rawIndex = this.getRawIndex(idx); - var y = dimStore[rawIndex]; - if (isNaN(y)) { - continue; - } - avgY += y; - } - avgY /= nextFrameEnd - nextFrameStart; - var frameStart = i; - var frameEnd = Math.min(i + frameSize, len); - var pointAX = i - 1; - var pointAY = dimStore[currentRawIndex]; - maxArea = -1; - nextRawIndex = frameStart; - var firstNaNIndex = -1; - var countNaN = 0; - // Find a point from current frame that construct a triangle with largest area with previous selected point - // And the average of next frame. - for (var idx = frameStart; idx < frameEnd; idx++) { - var rawIndex = this.getRawIndex(idx); - var y = dimStore[rawIndex]; - if (isNaN(y)) { - countNaN++; - if (firstNaNIndex < 0) { - firstNaNIndex = rawIndex; - } - continue; - } - // Calculate triangle area over three buckets - area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY)); - if (area > maxArea) { - maxArea = area; - nextRawIndex = rawIndex; // Next a is this b - } - } - - if (countNaN > 0 && countNaN < frameEnd - frameStart) { - // Append first NaN point in every bucket. - // It is necessary to ensure the correct order of indices. - newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex); - nextRawIndex = Math.max(firstNaNIndex, nextRawIndex); - } - newIndices[sampledIndex++] = nextRawIndex; - currentRawIndex = nextRawIndex; // This a is the next a (chosen b) - } - // First frame use the last data. - newIndices[sampledIndex++] = this.getRawIndex(len - 1); - target._count = sampledIndex; - target._indices = newIndices; - target.getRawIndex = this._getRawIdx; - return target; - }; - /** - * Large data down sampling on given dimension - * @param sampleIndex Sample index for name and id - */ - DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) { - var target = this.clone([dimension], true); - var targetStorage = target._chunks; - var frameValues = []; - var frameSize = Math.floor(1 / rate); - var dimStore = targetStorage[dimension]; - var len = this.count(); - var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent(); - var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize)); - var offset = 0; - for (var i = 0; i < len; i += frameSize) { - // Last frame - if (frameSize > len - i) { - frameSize = len - i; - frameValues.length = frameSize; - } - for (var k = 0; k < frameSize; k++) { - var dataIdx = this.getRawIndex(i + k); - frameValues[k] = dimStore[dataIdx]; - } - var value = sampleValue(frameValues); - var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); - // Only write value on the filtered data - dimStore[sampleFrameIdx] = value; - if (value < rawExtentOnDim[0]) { - rawExtentOnDim[0] = value; - } - if (value > rawExtentOnDim[1]) { - rawExtentOnDim[1] = value; - } - newIndices[offset++] = sampleFrameIdx; - } - target._count = offset; - target._indices = newIndices; - target._updateGetRawIdx(); - return target; - }; - /** - * Data iteration - * @param ctx default this - * @example - * list.each('x', function (x, idx) {}); - * list.each(['x', 'y'], function (x, y, idx) {}); - * list.each(function (idx) {}) - */ - DataStore.prototype.each = function (dims, cb) { - if (!this._count) { - return; - } - var dimSize = dims.length; - var chunks = this._chunks; - for (var i = 0, len = this.count(); i < len; i++) { - var rawIdx = this.getRawIndex(i); - // Simple optimization - switch (dimSize) { - case 0: - cb(i); - break; - case 1: - cb(chunks[dims[0]][rawIdx], i); - break; - case 2: - cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i); - break; - default: - var k = 0; - var value = []; - for (; k < dimSize; k++) { - value[k] = chunks[dims[k]][rawIdx]; - } - // Index - value[k] = i; - cb.apply(null, value); - } - } - }; - /** - * Get extent of data in one dimension - */ - DataStore.prototype.getDataExtent = function (dim) { - // Make sure use concrete dim as cache name. - var dimData = this._chunks[dim]; - var initialExtent = getInitialExtent(); - if (!dimData) { - return initialExtent; - } - // Make more strict checkings to ensure hitting cache. - var currEnd = this.count(); - // Consider the most cases when using data zoom, `getDataExtent` - // happened before filtering. We cache raw extent, which is not - // necessary to be cleared and recalculated when restore data. - var useRaw = !this._indices; - var dimExtent; - if (useRaw) { - return this._rawExtent[dim].slice(); - } - dimExtent = this._extent[dim]; - if (dimExtent) { - return dimExtent.slice(); - } - dimExtent = initialExtent; - var min = dimExtent[0]; - var max = dimExtent[1]; - for (var i = 0; i < currEnd; i++) { - var rawIdx = this.getRawIndex(i); - var value = dimData[rawIdx]; - value < min && (min = value); - value > max && (max = value); - } - dimExtent = [min, max]; - this._extent[dim] = dimExtent; - return dimExtent; - }; - /** - * Get raw data item - */ - DataStore.prototype.getRawDataItem = function (idx) { - var rawIdx = this.getRawIndex(idx); - if (!this._provider.persistent) { - var val = []; - var chunks = this._chunks; - for (var i = 0; i < chunks.length; i++) { - val.push(chunks[i][rawIdx]); - } - return val; - } else { - return this._provider.getItem(rawIdx); - } - }; - /** - * Clone shallow. - * - * @param clonedDims Determine which dims to clone. Will share the data if not specified. - */ - DataStore.prototype.clone = function (clonedDims, ignoreIndices) { - var target = new DataStore(); - var chunks = this._chunks; - var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) { - obj[dimIdx] = true; - return obj; - }, {}); - if (clonedDimsMap) { - for (var i = 0; i < chunks.length; i++) { - // Not clone if dim is not picked. - target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]); - } - } else { - target._chunks = chunks; - } - this._copyCommonProps(target); - if (!ignoreIndices) { - target._indices = this._cloneIndices(); - } - target._updateGetRawIdx(); - return target; - }; - DataStore.prototype._copyCommonProps = function (target) { - target._count = this._count; - target._rawCount = this._rawCount; - target._provider = this._provider; - target._dimensions = this._dimensions; - target._extent = clone(this._extent); - target._rawExtent = clone(this._rawExtent); - }; - DataStore.prototype._cloneIndices = function () { - if (this._indices) { - var Ctor = this._indices.constructor; - var indices = void 0; - if (Ctor === Array) { - var thisCount = this._indices.length; - indices = new Ctor(thisCount); - for (var i = 0; i < thisCount; i++) { - indices[i] = this._indices[i]; - } - } else { - indices = new Ctor(this._indices); - } - return indices; - } - return null; - }; - DataStore.prototype._getRawIdxIdentity = function (idx) { - return idx; - }; - DataStore.prototype._getRawIdx = function (idx) { - if (idx < this._count && idx >= 0) { - return this._indices[idx]; - } - return -1; - }; - DataStore.prototype._updateGetRawIdx = function () { - this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity; - }; - DataStore.internalField = function () { - function getDimValueSimply(dataItem, property, dataIndex, dimIndex) { - return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]); - } - defaultDimValueGetters = { - arrayRows: getDimValueSimply, - objectRows: function (dataItem, property, dataIndex, dimIndex) { - return parseDataValue(dataItem[property], this._dimensions[dimIndex]); - }, - keyedColumns: getDimValueSimply, - original: function (dataItem, property, dataIndex, dimIndex) { - // Performance sensitive, do not use modelUtil.getDataItemValue. - // If dataItem is an plain object with no value field, the let `value` - // will be assigned with the object, but it will be tread correctly - // in the `convertValue`. - var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); - return parseDataValue(value instanceof Array ? value[dimIndex] - // If value is a single number or something else not array. - : value, this._dimensions[dimIndex]); - }, - typedArray: function (dataItem, property, dataIndex, dimIndex) { - return dataItem[dimIndex]; - } - }; - }(); - return DataStore; - }(); - - /** - * [REQUIREMENT_MEMO]: - * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option. - * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and - * `root-dataset`. Them on `series` has higher priority. - * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might - * confuse users: whether those props indicate how to visit the upstream source or visit - * the transform result source, and some transforms has nothing to do with these props, - * and some transforms might have multiple upstream. - * (3) Transforms should specify `metaRawOption` in each output, just like they can be - * declared in `root-dataset`. - * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms. - * That is for reducing complexity in transforms. - * PENDING: Whether to provide transposition transform? - * - * [IMPLEMENTAION_MEMO]: - * "sourceVisitConfig" are calculated from `metaRawOption` and `data`. - * They will not be calculated until `source` is about to be visited (to prevent from - * duplicate calcuation). `source` is visited only in series and input to transforms. - * - * [DIMENSION_INHERIT_RULE]: - * By default the dimensions are inherited from ancestors, unless a transform return - * a new dimensions definition. - * Consider the case: - * ```js - * dataset: [{ - * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...] - * }, { - * transform: { type: 'filter', ... } - * }] - * dataset: [{ - * dimension: ['Product', 'Sales', 'Prise'], - * source: [ ['Cookies', 321, 44.21], ...] - * }, { - * transform: { type: 'filter', ... } - * }] - * ``` - * The two types of option should have the same behavior after transform. - * - * - * [SCENARIO]: - * (1) Provide source data directly: - * ```js - * series: { - * encode: {...}, - * dimensions: [...] - * seriesLayoutBy: 'row', - * data: [[...]] - * } - * ``` - * (2) Series refer to dataset. - * ```js - * series: [{ - * encode: {...} - * // Ignore datasetIndex means `datasetIndex: 0` - * // and the dimensions defination in dataset is used - * }, { - * encode: {...}, - * seriesLayoutBy: 'column', - * datasetIndex: 1 - * }] - * ``` - * (3) dataset transform - * ```js - * dataset: [{ - * source: [...] - * }, { - * source: [...] - * }, { - * // By default from 0. - * transform: { type: 'filter', config: {...} } - * }, { - * // Piped. - * transform: [ - * { type: 'filter', config: {...} }, - * { type: 'sort', config: {...} } - * ] - * }, { - * id: 'regressionData', - * fromDatasetIndex: 1, - * // Third-party transform - * transform: { type: 'ecStat:regression', config: {...} } - * }, { - * // retrieve the extra result. - * id: 'regressionFormula', - * fromDatasetId: 'regressionData', - * fromTransformResult: 1 - * }] - * ``` - */ - var SourceManager = /** @class */function () { - function SourceManager(sourceHost) { - // Cached source. Do not repeat calculating if not dirty. - this._sourceList = []; - this._storeList = []; - // version sign of each upstream source manager. - this._upstreamSignList = []; - this._versionSignBase = 0; - this._dirty = true; - this._sourceHost = sourceHost; - } - /** - * Mark dirty. - */ - SourceManager.prototype.dirty = function () { - this._setLocalSource([], []); - this._storeList = []; - this._dirty = true; - }; - SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) { - this._sourceList = sourceList; - this._upstreamSignList = upstreamSignList; - this._versionSignBase++; - if (this._versionSignBase > 9e10) { - this._versionSignBase = 0; - } - }; - /** - * For detecting whether the upstream source is dirty, so that - * the local cached source (in `_sourceList`) should be discarded. - */ - SourceManager.prototype._getVersionSign = function () { - return this._sourceHost.uid + '_' + this._versionSignBase; - }; - /** - * Always return a source instance. Otherwise throw error. - */ - SourceManager.prototype.prepareSource = function () { - // For the case that call `setOption` multiple time but no data changed, - // cache the result source to prevent from repeating transform. - if (this._isDirty()) { - this._createSource(); - this._dirty = false; - } - }; - SourceManager.prototype._createSource = function () { - this._setLocalSource([], []); - var sourceHost = this._sourceHost; - var upSourceMgrList = this._getUpstreamSourceManagers(); - var hasUpstream = !!upSourceMgrList.length; - var resultSourceList; - var upstreamSignList; - if (isSeries(sourceHost)) { - var seriesModel = sourceHost; - var data = void 0; - var sourceFormat = void 0; - var upSource = void 0; - // Has upstream dataset - if (hasUpstream) { - var upSourceMgr = upSourceMgrList[0]; - upSourceMgr.prepareSource(); - upSource = upSourceMgr.getSource(); - data = upSource.data; - sourceFormat = upSource.sourceFormat; - upstreamSignList = [upSourceMgr._getVersionSign()]; - } - // Series data is from own. - else { - data = seriesModel.get('data', true); - sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL; - upstreamSignList = []; - } - // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root. - var newMetaRawOption = this._getSourceMetaRawOption() || {}; - var upMetaRawOption = upSource && upSource.metaRawOption || {}; - var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null; - var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader); - // Note here we should not use `upSource.dimensionsDefine`. Consider the case: - // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`, - // but series need `seriesLayoutBy: 'row'`. - var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions); - // We share source with dataset as much as possible - // to avoid extra memory cost of high dimensional data. - var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions; - resultSourceList = needsCreateSource ? [createSource(data, { - seriesLayoutBy: seriesLayoutBy, - sourceHeader: sourceHeader, - dimensions: dimensions - }, sourceFormat)] : []; - } else { - var datasetModel = sourceHost; - // Has upstream dataset. - if (hasUpstream) { - var result = this._applyTransform(upSourceMgrList); - resultSourceList = result.sourceList; - upstreamSignList = result.upstreamSignList; - } - // Is root dataset. - else { - var sourceData = datasetModel.get('source', true); - resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)]; - upstreamSignList = []; - } - } - if ("development" !== 'production') { - assert(resultSourceList && upstreamSignList); - } - this._setLocalSource(resultSourceList, upstreamSignList); - }; - SourceManager.prototype._applyTransform = function (upMgrList) { - var datasetModel = this._sourceHost; - var transformOption = datasetModel.get('transform', true); - var fromTransformResult = datasetModel.get('fromTransformResult', true); - if ("development" !== 'production') { - assert(fromTransformResult != null || transformOption != null); - } - if (fromTransformResult != null) { - var errMsg = ''; - if (upMgrList.length !== 1) { - if ("development" !== 'production') { - errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset'; - } - doThrow(errMsg); - } - } - var sourceList; - var upSourceList = []; - var upstreamSignList = []; - each(upMgrList, function (upMgr) { - upMgr.prepareSource(); - var upSource = upMgr.getSource(fromTransformResult || 0); - var errMsg = ''; - if (fromTransformResult != null && !upSource) { - if ("development" !== 'production') { - errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult; - } - doThrow(errMsg); - } - upSourceList.push(upSource); - upstreamSignList.push(upMgr._getVersionSign()); - }); - if (transformOption) { - sourceList = applyDataTransform(transformOption, upSourceList, { - datasetIndex: datasetModel.componentIndex - }); - } else if (fromTransformResult != null) { - sourceList = [cloneSourceShallow(upSourceList[0])]; - } - return { - sourceList: sourceList, - upstreamSignList: upstreamSignList - }; - }; - SourceManager.prototype._isDirty = function () { - if (this._dirty) { - return true; - } - // All sourceList is from the some upstream. - var upSourceMgrList = this._getUpstreamSourceManagers(); - for (var i = 0; i < upSourceMgrList.length; i++) { - var upSrcMgr = upSourceMgrList[i]; - if ( - // Consider the case that there is ancestor diry, call it recursively. - // The performance is probably not an issue because usually the chain is not long. - upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) { - return true; - } - } - }; - /** - * @param sourceIndex By default 0, means "main source". - * In most cases there is only one source. - */ - SourceManager.prototype.getSource = function (sourceIndex) { - sourceIndex = sourceIndex || 0; - var source = this._sourceList[sourceIndex]; - if (!source) { - // Series may share source instance with dataset. - var upSourceMgrList = this._getUpstreamSourceManagers(); - return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex); - } - return source; - }; - /** - * - * Get a data store which can be shared across series. - * Only available for series. - * - * @param seriesDimRequest Dimensions that are generated in series. - * Should have been sorted by `storeDimIndex` asc. - */ - SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) { - if ("development" !== 'production') { - assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.'); - } - var schema = seriesDimRequest.makeStoreSchema(); - return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash); - }; - SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) { - // TODO Can use other sourceIndex? - var sourceIndex = 0; - var storeList = this._storeList; - var cachedStoreMap = storeList[sourceIndex]; - if (!cachedStoreMap) { - cachedStoreMap = storeList[sourceIndex] = {}; - } - var cachedStore = cachedStoreMap[sourceReadKey]; - if (!cachedStore) { - var upSourceMgr = this._getUpstreamSourceManagers()[0]; - if (isSeries(this._sourceHost) && upSourceMgr) { - cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey); - } else { - cachedStore = new DataStore(); - // Always create store from source of series. - cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims); - } - cachedStoreMap[sourceReadKey] = cachedStore; - } - return cachedStore; - }; - /** - * PENDING: Is it fast enough? - * If no upstream, return empty array. - */ - SourceManager.prototype._getUpstreamSourceManagers = function () { - // Always get the relationship from the raw option. - // Do not cache the link of the dependency graph, so that - // there is no need to update them when change happens. - var sourceHost = this._sourceHost; - if (isSeries(sourceHost)) { - var datasetModel = querySeriesUpstreamDatasetModel(sourceHost); - return !datasetModel ? [] : [datasetModel.getSourceManager()]; - } else { - return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { - return datasetModel.getSourceManager(); - }); - } - }; - SourceManager.prototype._getSourceMetaRawOption = function () { - var sourceHost = this._sourceHost; - var seriesLayoutBy; - var sourceHeader; - var dimensions; - if (isSeries(sourceHost)) { - seriesLayoutBy = sourceHost.get('seriesLayoutBy', true); - sourceHeader = sourceHost.get('sourceHeader', true); - dimensions = sourceHost.get('dimensions', true); - } - // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them. - else if (!this._getUpstreamSourceManagers().length) { - var model = sourceHost; - seriesLayoutBy = model.get('seriesLayoutBy', true); - sourceHeader = model.get('sourceHeader', true); - dimensions = model.get('dimensions', true); - } - return { - seriesLayoutBy: seriesLayoutBy, - sourceHeader: sourceHeader, - dimensions: dimensions - }; - }; - return SourceManager; - }(); - // Call this method after `super.init` and `super.mergeOption` to - // disable the transform merge, but do not disable transform clone from rawOption. - function disableTransformOptionMerge(datasetModel) { - var transformOption = datasetModel.option.transform; - transformOption && setAsPrimitive(datasetModel.option.transform); - } - function isSeries(sourceHost) { - // Avoid circular dependency with Series.ts - return sourceHost.mainType === 'series'; - } - function doThrow(errMsg) { - throw new Error(errMsg); - } - - var TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1'; - // TODO: more textStyle option - function getTooltipTextStyle(textStyle, renderMode) { - var nameFontColor = textStyle.color || '#6e7079'; - var nameFontSize = textStyle.fontSize || 12; - var nameFontWeight = textStyle.fontWeight || '400'; - var valueFontColor = textStyle.color || '#464646'; - var valueFontSize = textStyle.fontSize || 14; - var valueFontWeight = textStyle.fontWeight || '900'; - if (renderMode === 'html') { - // `textStyle` is probably from user input, should be encoded to reduce security risk. - return { - // eslint-disable-next-line max-len - nameStyle: "font-size:" + encodeHTML(nameFontSize + '') + "px;color:" + encodeHTML(nameFontColor) + ";font-weight:" + encodeHTML(nameFontWeight + ''), - // eslint-disable-next-line max-len - valueStyle: "font-size:" + encodeHTML(valueFontSize + '') + "px;color:" + encodeHTML(valueFontColor) + ";font-weight:" + encodeHTML(valueFontWeight + '') - }; - } else { - return { - nameStyle: { - fontSize: nameFontSize, - fill: nameFontColor, - fontWeight: nameFontWeight - }, - valueStyle: { - fontSize: valueFontSize, - fill: valueFontColor, - fontWeight: valueFontWeight - } - }; - } - } - // See `TooltipMarkupLayoutIntent['innerGapLevel']`. - // (value from UI design) - var HTML_GAPS = [0, 10, 20, 30]; - var RICH_TEXT_GAPS = ['', '\n', '\n\n', '\n\n\n']; - // eslint-disable-next-line max-len - function createTooltipMarkup(type, option) { - option.type = type; - return option; - } - function isSectionFragment(frag) { - return frag.type === 'section'; - } - function getBuilder(frag) { - return isSectionFragment(frag) ? buildSection : buildNameValue; - } - function getBlockGapLevel(frag) { - if (isSectionFragment(frag)) { - var gapLevel_1 = 0; - var subBlockLen = frag.blocks.length; - var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader; - each(frag.blocks, function (subBlock) { - var subGapLevel = getBlockGapLevel(subBlock); - // If the some of the sub-blocks have some gaps (like 10px) inside, this block - // should use a larger gap (like 20px) to distinguish those sub-blocks. - if (subGapLevel >= gapLevel_1) { - gapLevel_1 = subGapLevel + +(hasInnerGap_1 && ( - // 0 always can not be readable gap level. - !subGapLevel - // If no header, always keep the sub gap level. Otherwise - // look weird in case `multipleSeries`. - || isSectionFragment(subBlock) && !subBlock.noHeader)); - } - }); - return gapLevel_1; - } - return 0; - } - function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) { - var noHeader = fragment.noHeader; - var gaps = getGap(getBlockGapLevel(fragment)); - var subMarkupTextList = []; - var subBlocks = fragment.blocks || []; - assert(!subBlocks || isArray(subBlocks)); - subBlocks = subBlocks || []; - var orderMode = ctx.orderMode; - if (fragment.sortBlocks && orderMode) { - subBlocks = subBlocks.slice(); - var orderMap = { - valueAsc: 'asc', - valueDesc: 'desc' - }; - if (hasOwn(orderMap, orderMode)) { - var comparator_1 = new SortOrderComparator(orderMap[orderMode], null); - subBlocks.sort(function (a, b) { - return comparator_1.evaluate(a.sortParam, b.sortParam); - }); - } - // FIXME 'seriesDesc' necessary? - else if (orderMode === 'seriesDesc') { - subBlocks.reverse(); - } - } - each(subBlocks, function (subBlock, idx) { - var valueFormatter = fragment.valueFormatter; - var subMarkupText = getBuilder(subBlock)( - // Inherit valueFormatter - valueFormatter ? extend(extend({}, ctx), { - valueFormatter: valueFormatter - }) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle); - subMarkupText != null && subMarkupTextList.push(subMarkupText); - }); - var subMarkupText = ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(''), noHeader ? topMarginForOuterGap : gaps.html); - if (noHeader) { - return subMarkupText; - } - var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC); - var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle; - if (ctx.renderMode === 'richText') { - return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText; - } else { - return wrapBlockHTML("
" + encodeHTML(displayableHeader) + '
' + subMarkupText, topMarginForOuterGap); - } - } - function buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) { - var renderMode = ctx.renderMode; - var noName = fragment.noName; - var noValue = fragment.noValue; - var noMarker = !fragment.markerType; - var name = fragment.name; - var useUTC = ctx.useUTC; - var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function (value) { - value = isArray(value) ? value : [value]; - return map(value, function (val, idx) { - return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); - }); - }; - if (noName && noValue) { - return; - } - var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode); - var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC); - var valueTypeOption = fragment.valueType; - var readableValueList = noValue ? [] : valueFormatter(fragment.value, fragment.dataIndex); - var valueAlignRight = !noMarker || !noName; - // It little weird if only value next to marker but far from marker. - var valueCloseToMarker = !noMarker && noName; - var _a = getTooltipTextStyle(toolTipTextStyle, renderMode), - nameStyle = _a.nameStyle, - valueStyle = _a.valueStyle; - return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle)) - // Value has commas inside, so use ' ' as delimiter for multiple values. - + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap); - } - /** - * @return markupText. null/undefined means no content. - */ - function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) { - if (!fragment) { - return; - } - var builder = getBuilder(fragment); - var ctx = { - useUTC: useUTC, - renderMode: renderMode, - orderMode: orderMode, - markupStyleCreator: markupStyleCreator, - valueFormatter: fragment.valueFormatter - }; - return builder(ctx, fragment, 0, toolTipTextStyle); - } - function getGap(gapLevel) { - return { - html: HTML_GAPS[gapLevel], - richText: RICH_TEXT_GAPS[gapLevel] - }; - } - function wrapBlockHTML(encodedContent, topGap) { - var clearfix = '
'; - var marginCSS = "margin: " + topGap + "px 0 0"; - return "
" + encodedContent + clearfix + '
'; - } - function wrapInlineNameHTML(name, leftHasMarker, style) { - var marginCss = leftHasMarker ? 'margin-left:2px' : ''; - return "" + encodeHTML(name) + ''; - } - function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) { - // Do not too close to marker, considering there are multiple values separated by spaces. - var paddingStr = valueCloseToMarker ? '10px' : '20px'; - var alignCSS = alignRight ? "float:right;margin-left:" + paddingStr : ''; - valueList = isArray(valueList) ? valueList : [valueList]; - return "" - // Value has commas inside, so use ' ' as delimiter for multiple values. - + map(valueList, function (value) { - return encodeHTML(value); - }).join('  ') + ''; - } - function wrapInlineNameRichText(ctx, name, style) { - return ctx.markupStyleCreator.wrapRichTextStyle(name, style); - } - function wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) { - var styles = [style]; - var paddingLeft = valueCloseToMarker ? 10 : 20; - alignRight && styles.push({ - padding: [0, 0, 0, paddingLeft], - align: 'right' - }); - // Value has commas inside, so use ' ' as delimiter for multiple values. - return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join(' ') : values, styles); - } - function retrieveVisualColorForTooltipMarker(series, dataIndex) { - var style = series.getData().getItemVisual(dataIndex, 'style'); - var color = style[series.visualDrawType]; - return convertToColorString(color); - } - function getPaddingFromTooltipModel(model, renderMode) { - var padding = model.get('padding'); - return padding != null ? padding - // We give slightly different to look pretty. - : renderMode === 'richText' ? [8, 10] : 10; - } - /** - * The major feature is generate styles for `renderMode: 'richText'`. - * But it also serves `renderMode: 'html'` to provide - * "renderMode-independent" API. - */ - var TooltipMarkupStyleCreator = /** @class */function () { - function TooltipMarkupStyleCreator() { - this.richTextStyles = {}; - // Notice that "generate a style name" usually happens repeatedly when mouse is moving and - // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator - // rather than static shared by all creators (which will cause it increase to fast). - this._nextStyleNameId = getRandomIdBase(); - } - TooltipMarkupStyleCreator.prototype._generateStyleName = function () { - return '__EC_aUTo_' + this._nextStyleNameId++; - }; - TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) { - var markerId = renderMode === 'richText' ? this._generateStyleName() : null; - var marker = getTooltipMarker({ - color: colorStr, - type: markerType, - renderMode: renderMode, - markerId: markerId - }); - if (isString(marker)) { - return marker; - } else { - if ("development" !== 'production') { - assert(markerId); - } - this.richTextStyles[markerId] = marker.style; - return marker.content; - } - }; - /** - * @usage - * ```ts - * const styledText = markupStyleCreator.wrapRichTextStyle([ - * // The styles will be auto merged. - * { - * fontSize: 12, - * color: 'blue' - * }, - * { - * padding: 20 - * } - * ]); - * ``` - */ - TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) { - var finalStl = {}; - if (isArray(styles)) { - each(styles, function (stl) { - return extend(finalStl, stl); - }); - } else { - extend(finalStl, styles); - } - var styleName = this._generateStyleName(); - this.richTextStyles[styleName] = finalStl; - return "{" + styleName + "|" + text + "}"; - }; - return TooltipMarkupStyleCreator; - }(); - - function defaultSeriesFormatTooltip(opt) { - var series = opt.series; - var dataIndex = opt.dataIndex; - var multipleSeries = opt.multipleSeries; - var data = series.getData(); - var tooltipDims = data.mapDimensionsAll('defaultedTooltip'); - var tooltipDimLen = tooltipDims.length; - var value = series.getRawValue(dataIndex); - var isValueArr = isArray(value); - var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex); - // Complicated rule for pretty tooltip. - var inlineValue; - var inlineValueType; - var subBlocks; - var sortParam; - if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) { - var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor); - inlineValue = formatArrResult.inlineValues; - inlineValueType = formatArrResult.inlineValueTypes; - subBlocks = formatArrResult.blocks; - // Only support tooltip sort by the first inline value. It's enough in most cases. - sortParam = formatArrResult.inlineValues[0]; - } else if (tooltipDimLen) { - var dimInfo = data.getDimensionInfo(tooltipDims[0]); - sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]); - inlineValueType = dimInfo.type; - } else { - sortParam = inlineValue = isValueArr ? value[0] : value; - } - // Do not show generated series name. It might not be readable. - var seriesNameSpecified = isNameSpecified(series); - var seriesName = seriesNameSpecified && series.name || ''; - var itemName = data.getName(dataIndex); - var inlineName = multipleSeries ? seriesName : itemName; - return createTooltipMarkup('section', { - header: seriesName, - // When series name is not specified, do not show a header line with only '-'. - // This case always happens in tooltip.trigger: 'item'. - noHeader: multipleSeries || !seriesNameSpecified, - sortParam: sortParam, - blocks: [createTooltipMarkup('nameValue', { - markerType: 'item', - markerColor: markerColor, - // Do not mix display seriesName and itemName in one tooltip, - // which might confuses users. - name: inlineName, - // name dimension might be auto assigned, where the name might - // be not readable. So we check trim here. - noName: !trim(inlineName), - value: inlineValue, - valueType: inlineValueType, - dataIndex: dataIndex - })].concat(subBlocks || []) - }); - } - function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) { - // check: category-no-encode-has-axis-data in dataset.html - var data = series.getData(); - var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) { - var dimItem = data.getDimensionInfo(idx); - return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null; - }, false); - var inlineValues = []; - var inlineValueTypes = []; - var blocks = []; - tooltipDims.length ? each(tooltipDims, function (dim) { - setEachItem(retrieveRawValue(data, dataIndex, dim), dim); - }) - // By default, all dims is used on tooltip. - : each(value, setEachItem); - function setEachItem(val, dim) { - var dimInfo = data.getDimensionInfo(dim); - // If `dimInfo.tooltip` is not set, show tooltip. - if (!dimInfo || dimInfo.otherDims.tooltip === false) { - return; - } - if (isValueMultipleLine) { - blocks.push(createTooltipMarkup('nameValue', { - markerType: 'subItem', - markerColor: colorStr, - name: dimInfo.displayName, - value: val, - valueType: dimInfo.type - })); - } else { - inlineValues.push(val); - inlineValueTypes.push(dimInfo.type); - } - } - return { - inlineValues: inlineValues, - inlineValueTypes: inlineValueTypes, - blocks: blocks - }; - } - - var inner$1 = makeInner(); - function getSelectionKey(data, dataIndex) { - return data.getName(dataIndex) || data.getId(dataIndex); - } - var SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled'; - var SeriesModel = /** @class */function (_super) { - __extends(SeriesModel, _super); - function SeriesModel() { - // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`, - // the class members must not be initialized in constructor or declaration place. - // Otherwise there is bad case: - // class A {xxx = 1;} - // enableClassExtend(A); - // class B extends A {} - // var C = B.extend({xxx: 5}); - // var c = new C(); - // console.log(c.xxx); // expect 5 but always 1. - var _this = _super !== null && _super.apply(this, arguments) || this; - // --------------------------------------- - // Props about data selection - // --------------------------------------- - _this._selectedDataIndicesMap = {}; - return _this; - } - SeriesModel.prototype.init = function (option, parentModel, ecModel) { - this.seriesIndex = this.componentIndex; - this.dataTask = createTask({ - count: dataTaskCount, - reset: dataTaskReset - }); - this.dataTask.context = { - model: this - }; - this.mergeDefaultAndTheme(option, ecModel); - var sourceManager = inner$1(this).sourceManager = new SourceManager(this); - sourceManager.prepareSource(); - var data = this.getInitialData(option, ecModel); - wrapData(data, this); - this.dataTask.context.data = data; - if ("development" !== 'production') { - assert(data, 'getInitialData returned invalid data.'); - } - inner$1(this).dataBeforeProcessed = data; - // If we reverse the order (make data firstly, and then make - // dataBeforeProcessed by cloneShallow), cloneShallow will - // cause data.graph.data !== data when using - // module:echarts/data/Graph or module:echarts/data/Tree. - // See module:echarts/data/helper/linkSeriesData - // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model - // init or merge stage, because the data can be restored. So we do not `restoreData` - // and `setData` here, which forbids calling `seriesModel.getData()` in this stage. - // Call `seriesModel.getRawData()` instead. - // this.restoreData(); - autoSeriesName(this); - this._initSelectedMapFromData(data); - }; - /** - * Util for merge default and theme to option - */ - SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { - var layoutMode = fetchLayoutMode(this); - var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; - // Backward compat: using subType on theme. - // But if name duplicate between series subType - // (for example: parallel) add component mainType, - // add suffix 'Series'. - var themeSubType = this.subType; - if (ComponentModel.hasClass(themeSubType)) { - themeSubType += 'Series'; - } - merge(option, ecModel.getTheme().get(this.subType)); - merge(option, this.getDefaultOption()); - // Default label emphasis `show` - defaultEmphasis(option, 'label', ['show']); - this.fillDataTextStyle(option.data); - if (layoutMode) { - mergeLayoutParam(option, inputPositionParams, layoutMode); - } - }; - SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) { - // this.settingTask.dirty(); - newSeriesOption = merge(this.option, newSeriesOption, true); - this.fillDataTextStyle(newSeriesOption.data); - var layoutMode = fetchLayoutMode(this); - if (layoutMode) { - mergeLayoutParam(this.option, newSeriesOption, layoutMode); - } - var sourceManager = inner$1(this).sourceManager; - sourceManager.dirty(); - sourceManager.prepareSource(); - var data = this.getInitialData(newSeriesOption, ecModel); - wrapData(data, this); - this.dataTask.dirty(); - this.dataTask.context.data = data; - inner$1(this).dataBeforeProcessed = data; - autoSeriesName(this); - this._initSelectedMapFromData(data); - }; - SeriesModel.prototype.fillDataTextStyle = function (data) { - // Default data label emphasis `show` - // FIXME Tree structure data ? - // FIXME Performance ? - if (data && !isTypedArray(data)) { - var props = ['show']; - for (var i = 0; i < data.length; i++) { - if (data[i] && data[i].label) { - defaultEmphasis(data[i], 'label', props); - } - } - } - }; - /** - * Init a data structure from data related option in series - * Must be overridden. - */ - SeriesModel.prototype.getInitialData = function (option, ecModel) { - return; - }; - /** - * Append data to list - */ - SeriesModel.prototype.appendData = function (params) { - // FIXME ??? - // (1) If data from dataset, forbidden append. - // (2) support append data of dataset. - var data = this.getRawData(); - data.appendData(params.data); - }; - /** - * Consider some method like `filter`, `map` need make new data, - * We should make sure that `seriesModel.getData()` get correct - * data in the stream procedure. So we fetch data from upstream - * each time `task.perform` called. - */ - SeriesModel.prototype.getData = function (dataType) { - var task = getCurrentTask(this); - if (task) { - var data = task.context.data; - return dataType == null || !data.getLinkedData ? data : data.getLinkedData(dataType); - } else { - // When series is not alive (that may happen when click toolbox - // restore or setOption with not merge mode), series data may - // be still need to judge animation or something when graphic - // elements want to know whether fade out. - return inner$1(this).data; - } - }; - SeriesModel.prototype.getAllData = function () { - var mainData = this.getData(); - return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{ - data: mainData - }]; - }; - SeriesModel.prototype.setData = function (data) { - var task = getCurrentTask(this); - if (task) { - var context = task.context; - // Consider case: filter, data sample. - // FIXME:TS never used, so comment it - // if (context.data !== data && task.modifyOutputEnd) { - // task.setOutputEnd(data.count()); - // } - context.outputData = data; - // Caution: setData should update context.data, - // Because getData may be called multiply in a - // single stage and expect to get the data just - // set. (For example, AxisProxy, x y both call - // getData and setDate sequentially). - // So the context.data should be fetched from - // upstream each time when a stage starts to be - // performed. - if (task !== this.dataTask) { - context.data = data; - } - } - inner$1(this).data = data; - }; - SeriesModel.prototype.getEncode = function () { - var encode = this.get('encode', true); - if (encode) { - return createHashMap(encode); - } - }; - SeriesModel.prototype.getSourceManager = function () { - return inner$1(this).sourceManager; - }; - SeriesModel.prototype.getSource = function () { - return this.getSourceManager().getSource(); - }; - /** - * Get data before processed - */ - SeriesModel.prototype.getRawData = function () { - return inner$1(this).dataBeforeProcessed; - }; - SeriesModel.prototype.getColorBy = function () { - var colorBy = this.get('colorBy'); - return colorBy || 'series'; - }; - SeriesModel.prototype.isColorBySeries = function () { - return this.getColorBy() === 'series'; - }; - /** - * Get base axis if has coordinate system and has axis. - * By default use coordSys.getBaseAxis(); - * Can be overridden for some chart. - * @return {type} description - */ - SeriesModel.prototype.getBaseAxis = function () { - var coordSys = this.coordinateSystem; - // @ts-ignore - return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis(); - }; - /** - * Default tooltip formatter - * - * @param dataIndex - * @param multipleSeries - * @param dataType - * @param renderMode valid values: 'html'(by default) and 'richText'. - * 'html' is used for rendering tooltip in extra DOM form, and the result - * string is used as DOM HTML content. - * 'richText' is used for rendering tooltip in rich text form, for those where - * DOM operation is not supported. - * @return formatted tooltip with `html` and `markers` - * Notice: The override method can also return string - */ - SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - return defaultSeriesFormatTooltip({ - series: this, - dataIndex: dataIndex, - multipleSeries: multipleSeries - }); - }; - SeriesModel.prototype.isAnimationEnabled = function () { - var ecModel = this.ecModel; - // Disable animation if using echarts in node but not give ssr flag. - // In ssr mode, renderToString will generate svg with css animation. - if (env.node && !(ecModel && ecModel.ssr)) { - return false; - } - var animationEnabled = this.getShallow('animation'); - if (animationEnabled) { - if (this.getData().count() > this.getShallow('animationThreshold')) { - animationEnabled = false; - } - } - return !!animationEnabled; - }; - SeriesModel.prototype.restoreData = function () { - this.dataTask.dirty(); - }; - SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) { - var ecModel = this.ecModel; - // PENDING - var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum); - if (!color) { - color = ecModel.getColorFromPalette(name, scope, requestColorNum); - } - return color; - }; - /** - * Use `data.mapDimensionsAll(coordDim)` instead. - * @deprecated - */ - SeriesModel.prototype.coordDimToDataDim = function (coordDim) { - return this.getRawData().mapDimensionsAll(coordDim); - }; - /** - * Get progressive rendering count each step - */ - SeriesModel.prototype.getProgressive = function () { - return this.get('progressive'); - }; - /** - * Get progressive rendering count each step - */ - SeriesModel.prototype.getProgressiveThreshold = function () { - return this.get('progressiveThreshold'); - }; - // PENGING If selectedMode is null ? - SeriesModel.prototype.select = function (innerDataIndices, dataType) { - this._innerSelect(this.getData(dataType), innerDataIndices); - }; - SeriesModel.prototype.unselect = function (innerDataIndices, dataType) { - var selectedMap = this.option.selectedMap; - if (!selectedMap) { - return; - } - var selectedMode = this.option.selectedMode; - var data = this.getData(dataType); - if (selectedMode === 'series' || selectedMap === 'all') { - this.option.selectedMap = {}; - this._selectedDataIndicesMap = {}; - return; - } - for (var i = 0; i < innerDataIndices.length; i++) { - var dataIndex = innerDataIndices[i]; - var nameOrId = getSelectionKey(data, dataIndex); - selectedMap[nameOrId] = false; - this._selectedDataIndicesMap[nameOrId] = -1; - } - }; - SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) { - var tmpArr = []; - for (var i = 0; i < innerDataIndices.length; i++) { - tmpArr[0] = innerDataIndices[i]; - this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType); - } - }; - SeriesModel.prototype.getSelectedDataIndices = function () { - if (this.option.selectedMap === 'all') { - return [].slice.call(this.getData().getIndices()); - } - var selectedDataIndicesMap = this._selectedDataIndicesMap; - var nameOrIds = keys(selectedDataIndicesMap); - var dataIndices = []; - for (var i = 0; i < nameOrIds.length; i++) { - var dataIndex = selectedDataIndicesMap[nameOrIds[i]]; - if (dataIndex >= 0) { - dataIndices.push(dataIndex); - } - } - return dataIndices; - }; - SeriesModel.prototype.isSelected = function (dataIndex, dataType) { - var selectedMap = this.option.selectedMap; - if (!selectedMap) { - return false; - } - var data = this.getData(dataType); - return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(['select', 'disabled']); - }; - SeriesModel.prototype.isUniversalTransitionEnabled = function () { - if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) { - return true; - } - var universalTransitionOpt = this.option.universalTransition; - // Quick reject - if (!universalTransitionOpt) { - return false; - } - if (universalTransitionOpt === true) { - return true; - } - // Can be simply 'universalTransition: true' - return universalTransitionOpt && universalTransitionOpt.enabled; - }; - SeriesModel.prototype._innerSelect = function (data, innerDataIndices) { - var _a, _b; - var option = this.option; - var selectedMode = option.selectedMode; - var len = innerDataIndices.length; - if (!selectedMode || !len) { - return; - } - if (selectedMode === 'series') { - option.selectedMap = 'all'; - } else if (selectedMode === 'multiple') { - if (!isObject(option.selectedMap)) { - option.selectedMap = {}; - } - var selectedMap = option.selectedMap; - for (var i = 0; i < len; i++) { - var dataIndex = innerDataIndices[i]; - // TODO different types of data share same object. - var nameOrId = getSelectionKey(data, dataIndex); - selectedMap[nameOrId] = true; - this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex); - } - } else if (selectedMode === 'single' || selectedMode === true) { - var lastDataIndex = innerDataIndices[len - 1]; - var nameOrId = getSelectionKey(data, lastDataIndex); - option.selectedMap = (_a = {}, _a[nameOrId] = true, _a); - this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b); - } - }; - SeriesModel.prototype._initSelectedMapFromData = function (data) { - // Ignore select info in data if selectedMap exists. - // NOTE It's only for legacy usage. edge data is not supported. - if (this.option.selectedMap) { - return; - } - var dataIndices = []; - if (data.hasItemOption) { - data.each(function (idx) { - var rawItem = data.getRawDataItem(idx); - if (rawItem && rawItem.selected) { - dataIndices.push(idx); - } - }); - } - if (dataIndices.length > 0) { - this._innerSelect(data, dataIndices); - } - }; - // /** - // * @see {module:echarts/stream/Scheduler} - // */ - // abstract pipeTask: null - SeriesModel.registerClass = function (clz) { - return ComponentModel.registerClass(clz); - }; - SeriesModel.protoInitialize = function () { - var proto = SeriesModel.prototype; - proto.type = 'series.__base__'; - proto.seriesIndex = 0; - proto.ignoreStyleOnData = false; - proto.hasSymbolVisual = false; - proto.defaultSymbol = 'circle'; - // Make sure the values can be accessed! - proto.visualStyleAccessPath = 'itemStyle'; - proto.visualDrawType = 'fill'; - }(); - return SeriesModel; - }(ComponentModel); - mixin(SeriesModel, DataFormatMixin); - mixin(SeriesModel, PaletteMixin); - mountExtend(SeriesModel, ComponentModel); - /** - * MUST be called after `prepareSource` called - * Here we need to make auto series, especially for auto legend. But we - * do not modify series.name in option to avoid side effects. - */ - function autoSeriesName(seriesModel) { - // User specified name has higher priority, otherwise it may cause - // series can not be queried unexpectedly. - var name = seriesModel.name; - if (!isNameSpecified(seriesModel)) { - seriesModel.name = getSeriesAutoName(seriesModel) || name; - } - } - function getSeriesAutoName(seriesModel) { - var data = seriesModel.getRawData(); - var dataDims = data.mapDimensionsAll('seriesName'); - var nameArr = []; - each(dataDims, function (dataDim) { - var dimInfo = data.getDimensionInfo(dataDim); - dimInfo.displayName && nameArr.push(dimInfo.displayName); - }); - return nameArr.join(' '); - } - function dataTaskCount(context) { - return context.model.getRawData().count(); - } - function dataTaskReset(context) { - var seriesModel = context.model; - seriesModel.setData(seriesModel.getRawData().cloneShallow()); - return dataTaskProgress; - } - function dataTaskProgress(param, context) { - // Avoid repeat cloneShallow when data just created in reset. - if (context.outputData && param.end > context.outputData.count()) { - context.model.getRawData().cloneShallow(context.outputData); - } - } - // TODO refactor - function wrapData(data, seriesModel) { - each(concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) { - data.wrapMethod(methodName, curry(onDataChange, seriesModel)); - }); - } - function onDataChange(seriesModel, newList) { - var task = getCurrentTask(seriesModel); - if (task) { - // Consider case: filter, selectRange - task.setOutputEnd((newList || this).count()); - } - return newList; - } - function getCurrentTask(seriesModel) { - var scheduler = (seriesModel.ecModel || {}).scheduler; - var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid); - if (pipeline) { - // When pipline finished, the currrentTask keep the last - // task (renderTask). - var task = pipeline.currentTask; - if (task) { - var agentStubMap = task.agentStubMap; - if (agentStubMap) { - task = agentStubMap.get(seriesModel.uid); - } - } - return task; - } - } - - var ComponentView = /** @class */function () { - function ComponentView() { - this.group = new Group(); - this.uid = getUID('viewComponent'); - } - ComponentView.prototype.init = function (ecModel, api) {}; - ComponentView.prototype.render = function (model, ecModel, api, payload) {}; - ComponentView.prototype.dispose = function (ecModel, api) {}; - ComponentView.prototype.updateView = function (model, ecModel, api, payload) { - // Do nothing; - }; - ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) { - // Do nothing; - }; - ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) { - // Do nothing; - }; - /** - * Hook for toggle blur target series. - * Can be used in marker for blur or leave blur the markers - */ - ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) { - // Do nothing; - }; - /** - * Traverse the new rendered elements. - * - * It will traverse the new added element in progressive rendering. - * And traverse all in normal rendering. - */ - ComponentView.prototype.eachRendered = function (cb) { - var group = this.group; - if (group) { - group.traverse(cb); - } - }; - return ComponentView; - }(); - enableClassExtend(ComponentView); - enableClassManagement(ComponentView); - - /** - * @return {string} If large mode changed, return string 'reset'; - */ - function createRenderPlanner() { - var inner = makeInner(); - return function (seriesModel) { - var fields = inner(seriesModel); - var pipelineContext = seriesModel.pipelineContext; - var originalLarge = !!fields.large; - var originalProgressive = !!fields.progressiveRender; - // FIXME: if the planner works on a filtered series, `pipelineContext` does not - // exists. See #11611 . Probably we need to modify this structure, see the comment - // on `performRawSeries` in `Schedular.js`. - var large = fields.large = !!(pipelineContext && pipelineContext.large); - var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender); - return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset'; - }; - } - - var inner$2 = makeInner(); - var renderPlanner = createRenderPlanner(); - var ChartView = /** @class */function () { - function ChartView() { - this.group = new Group(); - this.uid = getUID('viewChart'); - this.renderTask = createTask({ - plan: renderTaskPlan, - reset: renderTaskReset - }); - this.renderTask.context = { - view: this - }; - } - ChartView.prototype.init = function (ecModel, api) {}; - ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { - if ("development" !== 'production') { - throw new Error('render method must been implemented'); - } - }; - /** - * Highlight series or specified data item. - */ - ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(payload && payload.dataType); - if (!data) { - if ("development" !== 'production') { - error("Unknown dataType " + payload.dataType); - } - return; - } - toggleHighlight(data, payload, 'emphasis'); - }; - /** - * Downplay series or specified data item. - */ - ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(payload && payload.dataType); - if (!data) { - if ("development" !== 'production') { - error("Unknown dataType " + payload.dataType); - } - return; - } - toggleHighlight(data, payload, 'normal'); - }; - /** - * Remove self. - */ - ChartView.prototype.remove = function (ecModel, api) { - this.group.removeAll(); - }; - /** - * Dispose self. - */ - ChartView.prototype.dispose = function (ecModel, api) {}; - ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) { - this.render(seriesModel, ecModel, api, payload); - }; - // FIXME never used? - ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) { - this.render(seriesModel, ecModel, api, payload); - }; - // FIXME never used? - ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) { - this.render(seriesModel, ecModel, api, payload); - }; - /** - * Traverse the new rendered elements. - * - * It will traverse the new added element in progressive rendering. - * And traverse all in normal rendering. - */ - ChartView.prototype.eachRendered = function (cb) { - traverseElements(this.group, cb); - }; - ChartView.markUpdateMethod = function (payload, methodName) { - inner$2(payload).updateMethod = methodName; - }; - ChartView.protoInitialize = function () { - var proto = ChartView.prototype; - proto.type = 'chart'; - }(); - return ChartView; - }(); - /** - * Set state of single element - */ - function elSetState(el, state, highlightDigit) { - if (el && isHighDownDispatcher(el)) { - (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit); - } - } - function toggleHighlight(data, payload, state) { - var dataIndex = queryDataIndex(data, payload); - var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null; - if (dataIndex != null) { - each(normalizeToArray(dataIndex), function (dataIdx) { - elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit); - }); - } else { - data.eachItemGraphicEl(function (el) { - elSetState(el, state, highlightDigit); - }); - } - } - enableClassExtend(ChartView, ['dispose']); - enableClassManagement(ChartView); - function renderTaskPlan(context) { - return renderPlanner(context.model); - } - function renderTaskReset(context) { - var seriesModel = context.model; - var ecModel = context.ecModel; - var api = context.api; - var payload = context.payload; - // FIXME: remove updateView updateVisual - var progressiveRender = seriesModel.pipelineContext.progressiveRender; - var view = context.view; - var updateMethod = payload && inner$2(payload).updateMethod; - var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod - // `appendData` is also supported when data amount - // is less than progressive threshold. - : 'render'; - if (methodName !== 'render') { - view[methodName](seriesModel, ecModel, api, payload); - } - return progressMethodMap[methodName]; - } - var progressMethodMap = { - incrementalPrepareRender: { - progress: function (params, context) { - context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload); - } - }, - render: { - // Put view.render in `progress` to support appendData. But in this case - // view.render should not be called in reset, otherwise it will be called - // twise. Use `forceFirstProgress` to make sure that view.render is called - // in any cases. - forceFirstProgress: true, - progress: function (params, context) { - context.view.render(context.model, context.ecModel, context.api, context.payload); - } - } - }; - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 ORIGIN_METHOD = '\0__throttleOriginMethod'; - var RATE = '\0__throttleRate'; - var THROTTLE_TYPE = '\0__throttleType'; - /** - * @public - * @param {(Function)} fn - * @param {number} [delay=0] Unit: ms. - * @param {boolean} [debounce=false] - * true: If call interval less than `delay`, only the last call works. - * false: If call interval less than `delay, call works on fixed rate. - * @return {(Function)} throttled fn. - */ - function throttle(fn, delay, debounce) { - var currCall; - var lastCall = 0; - var lastExec = 0; - var timer = null; - var diff; - var scope; - var args; - var debounceNextCall; - delay = delay || 0; - function exec() { - lastExec = new Date().getTime(); - timer = null; - fn.apply(scope, args || []); - } - var cb = function () { - var cbArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - cbArgs[_i] = arguments[_i]; - } - currCall = new Date().getTime(); - scope = this; - args = cbArgs; - var thisDelay = debounceNextCall || delay; - var thisDebounce = debounceNextCall || debounce; - debounceNextCall = null; - diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay; - clearTimeout(timer); - // Here we should make sure that: the `exec` SHOULD NOT be called later - // than a new call of `cb`, that is, preserving the command order. Consider - // calculating "scale rate" when roaming as an example. When a call of `cb` - // happens, either the `exec` is called dierectly, or the call is delayed. - // But the delayed call should never be later than next call of `cb`. Under - // this assurance, we can simply update view state each time `dispatchAction` - // triggered by user roaming, but not need to add extra code to avoid the - // state being "rolled-back". - if (thisDebounce) { - timer = setTimeout(exec, thisDelay); - } else { - if (diff >= 0) { - exec(); - } else { - timer = setTimeout(exec, -diff); - } - } - lastCall = currCall; - }; - /** - * Clear throttle. - * @public - */ - cb.clear = function () { - if (timer) { - clearTimeout(timer); - timer = null; - } - }; - /** - * Enable debounce once. - */ - cb.debounceNextCall = function (debounceDelay) { - debounceNextCall = debounceDelay; - }; - return cb; - } - /** - * Create throttle method or update throttle rate. - * - * @example - * ComponentView.prototype.render = function () { - * ... - * throttle.createOrUpdate( - * this, - * '_dispatchAction', - * this.model.get('throttle'), - * 'fixRate' - * ); - * }; - * ComponentView.prototype.remove = function () { - * throttle.clear(this, '_dispatchAction'); - * }; - * ComponentView.prototype.dispose = function () { - * throttle.clear(this, '_dispatchAction'); - * }; - * - */ - function createOrUpdate(obj, fnAttr, rate, throttleType) { - var fn = obj[fnAttr]; - if (!fn) { - return; - } - var originFn = fn[ORIGIN_METHOD] || fn; - var lastThrottleType = fn[THROTTLE_TYPE]; - var lastRate = fn[RATE]; - if (lastRate !== rate || lastThrottleType !== throttleType) { - if (rate == null || !throttleType) { - return obj[fnAttr] = originFn; - } - fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce'); - fn[ORIGIN_METHOD] = originFn; - fn[THROTTLE_TYPE] = throttleType; - fn[RATE] = rate; - } - return fn; - } - /** - * Clear throttle. Example see throttle.createOrUpdate. - */ - function clear(obj, fnAttr) { - var fn = obj[fnAttr]; - if (fn && fn[ORIGIN_METHOD]) { - // Clear throttle - fn.clear && fn.clear(); - obj[fnAttr] = fn[ORIGIN_METHOD]; - } - } - - var inner$3 = makeInner(); - var defaultStyleMappers = { - itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true), - lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true) - }; - var defaultColorKey = { - lineStyle: 'stroke', - itemStyle: 'fill' - }; - function getStyleMapper(seriesModel, stylePath) { - var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath]; - if (!styleMapper) { - console.warn("Unknown style type '" + stylePath + "'."); - return defaultStyleMappers.itemStyle; - } - return styleMapper; - } - function getDefaultColorKey(seriesModel, stylePath) { - // return defaultColorKey[stylePath] || - var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath]; - if (!colorKey) { - console.warn("Unknown style type '" + stylePath + "'."); - return 'fill'; - } - return colorKey; - } - var seriesStyleTask = { - createOnAllSeries: true, - performRawSeries: true, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; - // Set in itemStyle - var styleModel = seriesModel.getModel(stylePath); - var getStyle = getStyleMapper(seriesModel, stylePath); - var globalStyle = getStyle(styleModel); - var decalOption = styleModel.getShallow('decal'); - if (decalOption) { - data.setVisual('decal', decalOption); - decalOption.dirty = true; - } - // TODO - var colorKey = getDefaultColorKey(seriesModel, stylePath); - var color = globalStyle[colorKey]; - // TODO style callback - var colorCallback = isFunction(color) ? color : null; - var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto'; - // Get from color palette by default. - if (!globalStyle[colorKey] || colorCallback || hasAutoColor) { - // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT - // make it effect palette. Because some scenarios users need to make some series - // transparent or as background, which should better not effect the palette. - var colorPalette = seriesModel.getColorFromPalette( - // TODO series count changed. - seriesModel.name, null, ecModel.getSeriesCount()); - if (!globalStyle[colorKey]) { - globalStyle[colorKey] = colorPalette; - data.setVisual('colorFromPalette', true); - } - globalStyle.fill = globalStyle.fill === 'auto' || isFunction(globalStyle.fill) ? colorPalette : globalStyle.fill; - globalStyle.stroke = globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke) ? colorPalette : globalStyle.stroke; - } - data.setVisual('style', globalStyle); - data.setVisual('drawType', colorKey); - // Only visible series has each data be visual encoded - if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) { - data.setVisual('colorFromPalette', false); - return { - dataEach: function (data, idx) { - var dataParams = seriesModel.getDataParams(idx); - var itemStyle = extend({}, globalStyle); - itemStyle[colorKey] = colorCallback(dataParams); - data.setItemVisual(idx, 'style', itemStyle); - } - }; - } - } - }; - var sharedModel = new Model(); - var dataStyleTask = { - createOnAllSeries: true, - performRawSeries: true, - reset: function (seriesModel, ecModel) { - if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) { - return; - } - var data = seriesModel.getData(); - var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; - // Set in itemStyle - var getStyle = getStyleMapper(seriesModel, stylePath); - var colorKey = data.getVisual('drawType'); - return { - dataEach: data.hasItemOption ? function (data, idx) { - // Not use getItemModel for performance considuration - var rawItem = data.getRawDataItem(idx); - if (rawItem && rawItem[stylePath]) { - sharedModel.option = rawItem[stylePath]; - var style = getStyle(sharedModel); - var existsStyle = data.ensureUniqueItemVisual(idx, 'style'); - extend(existsStyle, style); - if (sharedModel.option.decal) { - data.setItemVisual(idx, 'decal', sharedModel.option.decal); - sharedModel.option.decal.dirty = true; - } - if (colorKey in style) { - data.setItemVisual(idx, 'colorFromPalette', false); - } - } - } : null - }; - } - }; - // Pick color from palette for the data which has not been set with color yet. - // Note: do not support stream rendering. No such cases yet. - var dataColorPaletteTask = { - performRawSeries: true, - overallReset: function (ecModel) { - // Each type of series uses one scope. - // Pie and funnel are using different scopes. - var paletteScopeGroupByType = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var colorBy = seriesModel.getColorBy(); - if (seriesModel.isColorBySeries()) { - return; - } - var key = seriesModel.type + '-' + colorBy; - var colorScope = paletteScopeGroupByType.get(key); - if (!colorScope) { - colorScope = {}; - paletteScopeGroupByType.set(key, colorScope); - } - inner$3(seriesModel).scope = colorScope; - }); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) { - return; - } - var dataAll = seriesModel.getRawData(); - var idxMap = {}; - var data = seriesModel.getData(); - var colorScope = inner$3(seriesModel).scope; - var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; - var colorKey = getDefaultColorKey(seriesModel, stylePath); - data.each(function (idx) { - var rawIdx = data.getRawIndex(idx); - idxMap[rawIdx] = idx; - }); - // Iterate on data before filtered. To make sure color from palette can be - // Consistent when toggling legend. - dataAll.each(function (rawIdx) { - var idx = idxMap[rawIdx]; - var fromPalette = data.getItemVisual(idx, 'colorFromPalette'); - // Get color from palette for each data only when the color is inherited from series color, which is - // also picked from color palette. So following situation is not in the case: - // 1. series.itemStyle.color is set - // 2. color is encoded by visualMap - if (fromPalette) { - var itemStyle = data.ensureUniqueItemVisual(idx, 'style'); - var name_1 = dataAll.getName(rawIdx) || rawIdx + ''; - var dataCount = dataAll.count(); - itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount); - } - }); - }); - } - }; - - var PI$3 = Math.PI; - /** - * @param {module:echarts/ExtensionAPI} api - * @param {Object} [opts] - * @param {string} [opts.text] - * @param {string} [opts.color] - * @param {string} [opts.textColor] - * @return {module:zrender/Element} - */ - function defaultLoading(api, opts) { - opts = opts || {}; - defaults(opts, { - text: 'loading', - textColor: '#000', - fontSize: 12, - fontWeight: 'normal', - fontStyle: 'normal', - fontFamily: 'sans-serif', - maskColor: 'rgba(255, 255, 255, 0.8)', - showSpinner: true, - color: '#5470c6', - spinnerRadius: 10, - lineWidth: 5, - zlevel: 0 - }); - var group = new Group(); - var mask = new Rect({ - style: { - fill: opts.maskColor - }, - zlevel: opts.zlevel, - z: 10000 - }); - group.add(mask); - var textContent = new ZRText({ - style: { - text: opts.text, - fill: opts.textColor, - fontSize: opts.fontSize, - fontWeight: opts.fontWeight, - fontStyle: opts.fontStyle, - fontFamily: opts.fontFamily - }, - zlevel: opts.zlevel, - z: 10001 - }); - var labelRect = new Rect({ - style: { - fill: 'none' - }, - textContent: textContent, - textConfig: { - position: 'right', - distance: 10 - }, - zlevel: opts.zlevel, - z: 10001 - }); - group.add(labelRect); - var arc; - if (opts.showSpinner) { - arc = new Arc({ - shape: { - startAngle: -PI$3 / 2, - endAngle: -PI$3 / 2 + 0.1, - r: opts.spinnerRadius - }, - style: { - stroke: opts.color, - lineCap: 'round', - lineWidth: opts.lineWidth - }, - zlevel: opts.zlevel, - z: 10001 - }); - arc.animateShape(true).when(1000, { - endAngle: PI$3 * 3 / 2 - }).start('circularInOut'); - arc.animateShape(true).when(1000, { - startAngle: PI$3 * 3 / 2 - }).delay(300).start('circularInOut'); - group.add(arc); - } - // Inject resize - group.resize = function () { - var textWidth = textContent.getBoundingRect().width; - var r = opts.showSpinner ? opts.spinnerRadius : 0; - // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2 - // textDistance needs to be calculated when both animation and text exist - var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) - // only show the text - + (opts.showSpinner ? 0 : textWidth / 2) - // only show the spinner - + (textWidth ? 0 : r); - var cy = api.getHeight() / 2; - opts.showSpinner && arc.setShape({ - cx: cx, - cy: cy - }); - labelRect.setShape({ - x: cx - r, - y: cy - r, - width: r * 2, - height: r * 2 - }); - mask.setShape({ - x: 0, - y: 0, - width: api.getWidth(), - height: api.getHeight() - }); - }; - group.resize(); - return group; - } - - var Scheduler = /** @class */function () { - function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) { - // key: handlerUID - this._stageTaskMap = createHashMap(); - this.ecInstance = ecInstance; - this.api = api; - // Fix current processors in case that in some rear cases that - // processors might be registered after echarts instance created. - // Register processors incrementally for a echarts instance is - // not supported by this stream architecture. - dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); - visualHandlers = this._visualHandlers = visualHandlers.slice(); - this._allHandlers = dataProcessorHandlers.concat(visualHandlers); - } - Scheduler.prototype.restoreData = function (ecModel, payload) { - // TODO: Only restore needed series and components, but not all components. - // Currently `restoreData` of all of the series and component will be called. - // But some independent components like `title`, `legend`, `graphic`, `toolbox`, - // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`, - // and some components like coordinate system, axes, dataZoom, visualMap only - // need their target series refresh. - // (1) If we are implementing this feature some day, we should consider these cases: - // if a data processor depends on a component (e.g., dataZoomProcessor depends - // on the settings of `dataZoom`), it should be re-performed if the component - // is modified by `setOption`. - // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`, - // it should be re-performed when the result array of `getTargetSeries` changed. - // We use `dependencies` to cover these issues. - // (3) How to update target series when coordinate system related components modified. - // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty, - // and this case all of the tasks will be set as dirty. - ecModel.restoreData(payload); - // Theoretically an overall task not only depends on each of its target series, but also - // depends on all of the series. - // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks - // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure - // that the overall task is set as dirty and to be performed, otherwise it probably cause - // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it - // probably cause state chaos (consider `dataZoomProcessor`). - this._stageTaskMap.each(function (taskRecord) { - var overallTask = taskRecord.overallTask; - overallTask && overallTask.dirty(); - }); - }; - // If seriesModel provided, incremental threshold is check by series data. - Scheduler.prototype.getPerformArgs = function (task, isBlock) { - // For overall task - if (!task.__pipeline) { - return; - } - var pipeline = this._pipelineMap.get(task.__pipeline.id); - var pCtx = pipeline.context; - var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex; - var step = incremental ? pipeline.step : null; - var modDataCount = pCtx && pCtx.modDataCount; - var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null; - return { - step: step, - modBy: modBy, - modDataCount: modDataCount - }; - }; - Scheduler.prototype.getPipeline = function (pipelineId) { - return this._pipelineMap.get(pipelineId); - }; - /** - * Current, progressive rendering starts from visual and layout. - * Always detect render mode in the same stage, avoiding that incorrect - * detection caused by data filtering. - * Caution: - * `updateStreamModes` use `seriesModel.getData()`. - */ - Scheduler.prototype.updateStreamModes = function (seriesModel, view) { - var pipeline = this._pipelineMap.get(seriesModel.uid); - var data = seriesModel.getData(); - var dataLen = data.count(); - // `progressiveRender` means that can render progressively in each - // animation frame. Note that some types of series do not provide - // `view.incrementalPrepareRender` but support `chart.appendData`. We - // use the term `incremental` but not `progressive` to describe the - // case that `chart.appendData`. - var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold; - var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); - // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint. - // see `test/candlestick-large3.html` - var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null; - seriesModel.pipelineContext = pipeline.context = { - progressiveRender: progressiveRender, - modDataCount: modDataCount, - large: large - }; - }; - Scheduler.prototype.restorePipelines = function (ecModel) { - var scheduler = this; - var pipelineMap = scheduler._pipelineMap = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var progressive = seriesModel.getProgressive(); - var pipelineId = seriesModel.uid; - pipelineMap.set(pipelineId, { - id: pipelineId, - head: null, - tail: null, - threshold: seriesModel.getProgressiveThreshold(), - progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()), - blockIndex: -1, - step: Math.round(progressive || 700), - count: 0 - }); - scheduler._pipe(seriesModel, seriesModel.dataTask); - }); - }; - Scheduler.prototype.prepareStageTasks = function () { - var stageTaskMap = this._stageTaskMap; - var ecModel = this.api.getModel(); - var api = this.api; - each(this._allHandlers, function (handler) { - var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {}); - var errMsg = ''; - if ("development" !== 'production') { - // Currently do not need to support to sepecify them both. - errMsg = '"reset" and "overallReset" must not be both specified.'; - } - assert(!(handler.reset && handler.overallReset), errMsg); - handler.reset && this._createSeriesStageTask(handler, record, ecModel, api); - handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api); - }, this); - }; - Scheduler.prototype.prepareView = function (view, model, ecModel, api) { - var renderTask = view.renderTask; - var context = renderTask.context; - context.model = model; - context.ecModel = ecModel; - context.api = api; - renderTask.__block = !view.incrementalPrepareRender; - this._pipe(model, renderTask); - }; - Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) { - // If we do not use `block` here, it should be considered when to update modes. - this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { - block: true - }); - }; - Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) { - this._performStageTasks(this._visualHandlers, ecModel, payload, opt); - }; - Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) { - opt = opt || {}; - var unfinished = false; - var scheduler = this; - each(stageHandlers, function (stageHandler, idx) { - if (opt.visualType && opt.visualType !== stageHandler.visualType) { - return; - } - var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid); - var seriesTaskMap = stageHandlerRecord.seriesTaskMap; - var overallTask = stageHandlerRecord.overallTask; - if (overallTask) { - var overallNeedDirty_1; - var agentStubMap = overallTask.agentStubMap; - agentStubMap.each(function (stub) { - if (needSetDirty(opt, stub)) { - stub.dirty(); - overallNeedDirty_1 = true; - } - }); - overallNeedDirty_1 && overallTask.dirty(); - scheduler.updatePayload(overallTask, payload); - var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block); - // Execute stubs firstly, which may set the overall task dirty, - // then execute the overall task. And stub will call seriesModel.setData, - // which ensures that in the overallTask seriesModel.getData() will not - // return incorrect data. - agentStubMap.each(function (stub) { - stub.perform(performArgs_1); - }); - if (overallTask.perform(performArgs_1)) { - unfinished = true; - } - } else if (seriesTaskMap) { - seriesTaskMap.each(function (task, pipelineId) { - if (needSetDirty(opt, task)) { - task.dirty(); - } - var performArgs = scheduler.getPerformArgs(task, opt.block); - // FIXME - // if intending to declare `performRawSeries` in handlers, only - // stream-independent (specifically, data item independent) operations can be - // performed. Because if a series is filtered, most of the tasks will not - // be performed. A stream-dependent operation probably cause wrong biz logic. - // Perhaps we should not provide a separate callback for this case instead - // of providing the config `performRawSeries`. The stream-dependent operations - // and stream-independent operations should better not be mixed. - performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model); - scheduler.updatePayload(task, payload); - if (task.perform(performArgs)) { - unfinished = true; - } - }); - } - }); - function needSetDirty(opt, task) { - return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id)); - } - this.unfinished = unfinished || this.unfinished; - }; - Scheduler.prototype.performSeriesTasks = function (ecModel) { - var unfinished; - ecModel.eachSeries(function (seriesModel) { - // Progress to the end for dataInit and dataRestore. - unfinished = seriesModel.dataTask.perform() || unfinished; - }); - this.unfinished = unfinished || this.unfinished; - }; - Scheduler.prototype.plan = function () { - // Travel pipelines, check block. - this._pipelineMap.each(function (pipeline) { - var task = pipeline.tail; - do { - if (task.__block) { - pipeline.blockIndex = task.__idxInPipeline; - break; - } - task = task.getUpstream(); - } while (task); - }); - }; - Scheduler.prototype.updatePayload = function (task, payload) { - payload !== 'remain' && (task.context.payload = payload); - }; - Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) { - var scheduler = this; - var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; - // The count of stages are totally about only several dozen, so - // do not need to reuse the map. - var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap(); - var seriesType = stageHandler.seriesType; - var getTargetSeries = stageHandler.getTargetSeries; - // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily, - // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`, - // it works but it may cause other irrelevant charts blocked. - if (stageHandler.createOnAllSeries) { - ecModel.eachRawSeries(create); - } else if (seriesType) { - ecModel.eachRawSeriesByType(seriesType, create); - } else if (getTargetSeries) { - getTargetSeries(ecModel, api).each(create); - } - function create(seriesModel) { - var pipelineId = seriesModel.uid; - // Init tasks for each seriesModel only once. - // Reuse original task instance. - var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({ - plan: seriesTaskPlan, - reset: seriesTaskReset, - count: seriesTaskCount - })); - task.context = { - model: seriesModel, - ecModel: ecModel, - api: api, - // PENDING: `useClearVisual` not used? - useClearVisual: stageHandler.isVisual && !stageHandler.isLayout, - plan: stageHandler.plan, - reset: stageHandler.reset, - scheduler: scheduler - }; - scheduler._pipe(seriesModel, task); - } - }; - Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) { - var scheduler = this; - var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask - // For overall task, the function only be called on reset stage. - || createTask({ - reset: overallTaskReset - }); - overallTask.context = { - ecModel: ecModel, - api: api, - overallReset: stageHandler.overallReset, - scheduler: scheduler - }; - var oldAgentStubMap = overallTask.agentStubMap; - // The count of stages are totally about only several dozen, so - // do not need to reuse the map. - var newAgentStubMap = overallTask.agentStubMap = createHashMap(); - var seriesType = stageHandler.seriesType; - var getTargetSeries = stageHandler.getTargetSeries; - var overallProgress = true; - var shouldOverallTaskDirty = false; - // FIXME:TS never used, so comment it - // let modifyOutputEnd = stageHandler.modifyOutputEnd; - // An overall task with seriesType detected or has `getTargetSeries`, we add - // stub in each pipelines, it will set the overall task dirty when the pipeline - // progress. Moreover, to avoid call the overall task each frame (too frequent), - // we set the pipeline block. - var errMsg = ''; - if ("development" !== 'production') { - errMsg = '"createOnAllSeries" is not supported for "overallReset", ' + 'because it will block all streams.'; - } - assert(!stageHandler.createOnAllSeries, errMsg); - if (seriesType) { - ecModel.eachRawSeriesByType(seriesType, createStub); - } else if (getTargetSeries) { - getTargetSeries(ecModel, api).each(createStub); - } - // Otherwise, (usually it is legacy case), the overall task will only be - // executed when upstream is dirty. Otherwise the progressive rendering of all - // pipelines will be disabled unexpectedly. But it still needs stubs to receive - // dirty info from upstream. - else { - overallProgress = false; - each(ecModel.getSeries(), createStub); - } - function createStub(seriesModel) { - var pipelineId = seriesModel.uid; - var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || ( - // When the result of `getTargetSeries` changed, the overallTask - // should be set as dirty and re-performed. - shouldOverallTaskDirty = true, createTask({ - reset: stubReset, - onDirty: stubOnDirty - }))); - stub.context = { - model: seriesModel, - overallProgress: overallProgress - // FIXME:TS never used, so comment it - // modifyOutputEnd: modifyOutputEnd - }; - - stub.agent = overallTask; - stub.__block = overallProgress; - scheduler._pipe(seriesModel, stub); - } - if (shouldOverallTaskDirty) { - overallTask.dirty(); - } - }; - Scheduler.prototype._pipe = function (seriesModel, task) { - var pipelineId = seriesModel.uid; - var pipeline = this._pipelineMap.get(pipelineId); - !pipeline.head && (pipeline.head = task); - pipeline.tail && pipeline.tail.pipe(task); - pipeline.tail = task; - task.__idxInPipeline = pipeline.count++; - task.__pipeline = pipeline; - }; - Scheduler.wrapStageHandler = function (stageHandler, visualType) { - if (isFunction(stageHandler)) { - stageHandler = { - overallReset: stageHandler, - seriesType: detectSeriseType(stageHandler) - }; - } - stageHandler.uid = getUID('stageHandler'); - visualType && (stageHandler.visualType = visualType); - return stageHandler; - }; - return Scheduler; - }(); - function overallTaskReset(context) { - context.overallReset(context.ecModel, context.api, context.payload); - } - function stubReset(context) { - return context.overallProgress && stubProgress; - } - function stubProgress() { - this.agent.dirty(); - this.getDownstream().dirty(); - } - function stubOnDirty() { - this.agent && this.agent.dirty(); - } - function seriesTaskPlan(context) { - return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null; - } - function seriesTaskReset(context) { - if (context.useClearVisual) { - context.data.clearAllVisual(); - } - var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload)); - return resetDefines.length > 1 ? map(resetDefines, function (v, idx) { - return makeSeriesTaskProgress(idx); - }) : singleSeriesTaskProgress; - } - var singleSeriesTaskProgress = makeSeriesTaskProgress(0); - function makeSeriesTaskProgress(resetDefineIdx) { - return function (params, context) { - var data = context.data; - var resetDefine = context.resetDefines[resetDefineIdx]; - if (resetDefine && resetDefine.dataEach) { - for (var i = params.start; i < params.end; i++) { - resetDefine.dataEach(data, i); - } - } else if (resetDefine && resetDefine.progress) { - resetDefine.progress(params, data); - } - }; - } - function seriesTaskCount(context) { - return context.data.count(); - } - /** - * Only some legacy stage handlers (usually in echarts extensions) are pure function. - * To ensure that they can work normally, they should work in block mode, that is, - * they should not be started util the previous tasks finished. So they cause the - * progressive rendering disabled. We try to detect the series type, to narrow down - * the block range to only the series type they concern, but not all series. - */ - function detectSeriseType(legacyFunc) { - seriesType = null; - try { - // Assume there is no async when calling `eachSeriesByType`. - legacyFunc(ecModelMock, apiMock); - } catch (e) {} - return seriesType; - } - var ecModelMock = {}; - var apiMock = {}; - var seriesType; - mockMethods(ecModelMock, GlobalModel); - mockMethods(apiMock, ExtensionAPI); - ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) { - seriesType = type; - }; - ecModelMock.eachComponent = function (cond) { - if (cond.mainType === 'series' && cond.subType) { - seriesType = cond.subType; - } - }; - function mockMethods(target, Clz) { - /* eslint-disable */ - for (var name_1 in Clz.prototype) { - // Do not use hasOwnProperty - target[name_1] = noop; - } - /* eslint-enable */ - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 lightTheme = { - color: colorAll, - colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll] - }; - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 = '#B9B8CE'; - var backgroundColor = '#100C2A'; - var axisCommon = function () { - return { - axisLine: { - lineStyle: { - color: contrastColor - } - }, - splitLine: { - lineStyle: { - color: '#484753' - } - }, - splitArea: { - areaStyle: { - color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)'] - } - }, - minorSplitLine: { - lineStyle: { - color: '#20203B' - } - } - }; - }; - var colorPalette = ['#4992ff', '#7cffb2', '#fddd60', '#ff6e76', '#58d9f9', '#05c091', '#ff8a45', '#8d48e3', '#dd79ff']; - var theme = { - darkMode: true, - color: colorPalette, - backgroundColor: backgroundColor, - axisPointer: { - lineStyle: { - color: '#817f91' - }, - crossStyle: { - color: '#817f91' - }, - label: { - // TODO Contrast of label backgorundColor - color: '#fff' - } - }, - legend: { - textStyle: { - color: contrastColor - } - }, - textStyle: { - color: contrastColor - }, - title: { - textStyle: { - color: '#EEF1FA' - }, - subtextStyle: { - color: '#B9B8CE' - } - }, - toolbox: { - iconStyle: { - borderColor: contrastColor - } - }, - dataZoom: { - borderColor: '#71708A', - textStyle: { - color: contrastColor - }, - brushStyle: { - color: 'rgba(135,163,206,0.3)' - }, - handleStyle: { - color: '#353450', - borderColor: '#C5CBE3' - }, - moveHandleStyle: { - color: '#B0B6C3', - opacity: 0.3 - }, - fillerColor: 'rgba(135,163,206,0.2)', - emphasis: { - handleStyle: { - borderColor: '#91B7F2', - color: '#4D587D' - }, - moveHandleStyle: { - color: '#636D9A', - opacity: 0.7 - } - }, - dataBackground: { - lineStyle: { - color: '#71708A', - width: 1 - }, - areaStyle: { - color: '#71708A' - } - }, - selectedDataBackground: { - lineStyle: { - color: '#87A3CE' - }, - areaStyle: { - color: '#87A3CE' - } - } - }, - visualMap: { - textStyle: { - color: contrastColor - } - }, - timeline: { - lineStyle: { - color: contrastColor - }, - label: { - color: contrastColor - }, - controlStyle: { - color: contrastColor, - borderColor: contrastColor - } - }, - calendar: { - itemStyle: { - color: backgroundColor - }, - dayLabel: { - color: contrastColor - }, - monthLabel: { - color: contrastColor - }, - yearLabel: { - color: contrastColor - } - }, - timeAxis: axisCommon(), - logAxis: axisCommon(), - valueAxis: axisCommon(), - categoryAxis: axisCommon(), - line: { - symbol: 'circle' - }, - graph: { - color: colorPalette - }, - gauge: { - title: { - color: contrastColor - }, - axisLine: { - lineStyle: { - color: [[1, 'rgba(207,212,219,0.2)']] - } - }, - axisLabel: { - color: contrastColor - }, - detail: { - color: '#EEF1FA' - } - }, - candlestick: { - itemStyle: { - color: '#f64e56', - color0: '#54ea92', - borderColor: '#f64e56', - borderColor0: '#54ea92' - // borderColor: '#ca2824', - // borderColor0: '#09a443' - } - } - }; - - theme.categoryAxis.splitLine.show = false; - - /** - * Usage of query: - * `chart.on('click', query, handler);` - * The `query` can be: - * + The component type query string, only `mainType` or `mainType.subType`, - * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'. - * + The component query object, like: - * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`, - * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`. - * + The data query object, like: - * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`. - * + The other query object (cmponent customized query), like: - * `{element: 'some'}` (only available in custom series). - * - * Caveat: If a prop in the `query` object is `null/undefined`, it is the - * same as there is no such prop in the `query` object. - */ - var ECEventProcessor = /** @class */function () { - function ECEventProcessor() {} - ECEventProcessor.prototype.normalizeQuery = function (query) { - var cptQuery = {}; - var dataQuery = {}; - var otherQuery = {}; - // `query` is `mainType` or `mainType.subType` of component. - if (isString(query)) { - var condCptType = parseClassType(query); - // `.main` and `.sub` may be ''. - cptQuery.mainType = condCptType.main || null; - cptQuery.subType = condCptType.sub || null; - } - // `query` is an object, convert to {mainType, index, name, id}. - else { - // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved, - // can not be used in `compomentModel.filterForExposedEvent`. - var suffixes_1 = ['Index', 'Name', 'Id']; - var dataKeys_1 = { - name: 1, - dataIndex: 1, - dataType: 1 - }; - each(query, function (val, key) { - var reserved = false; - for (var i = 0; i < suffixes_1.length; i++) { - var propSuffix = suffixes_1[i]; - var suffixPos = key.lastIndexOf(propSuffix); - if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) { - var mainType = key.slice(0, suffixPos); - // Consider `dataIndex`. - if (mainType !== 'data') { - cptQuery.mainType = mainType; - cptQuery[propSuffix.toLowerCase()] = val; - reserved = true; - } - } - } - if (dataKeys_1.hasOwnProperty(key)) { - dataQuery[key] = val; - reserved = true; - } - if (!reserved) { - otherQuery[key] = val; - } - }); - } - return { - cptQuery: cptQuery, - dataQuery: dataQuery, - otherQuery: otherQuery - }; - }; - ECEventProcessor.prototype.filter = function (eventType, query) { - // They should be assigned before each trigger call. - var eventInfo = this.eventInfo; - if (!eventInfo) { - return true; - } - var targetEl = eventInfo.targetEl; - var packedEvent = eventInfo.packedEvent; - var model = eventInfo.model; - var view = eventInfo.view; - // For event like 'globalout'. - if (!model || !view) { - return true; - } - var cptQuery = query.cptQuery; - var dataQuery = query.dataQuery; - return check(cptQuery, model, 'mainType') && check(cptQuery, model, 'subType') && check(cptQuery, model, 'index', 'componentIndex') && check(cptQuery, model, 'name') && check(cptQuery, model, 'id') && check(dataQuery, packedEvent, 'name') && check(dataQuery, packedEvent, 'dataIndex') && check(dataQuery, packedEvent, 'dataType') && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent)); - function check(query, host, prop, propOnHost) { - return query[prop] == null || host[propOnHost || prop] === query[prop]; - } - }; - ECEventProcessor.prototype.afterTrigger = function () { - // Make sure the eventInfo won't be used in next trigger. - this.eventInfo = null; - }; - return ECEventProcessor; - }(); - - var SYMBOL_PROPS_WITH_CB = ['symbol', 'symbolSize', 'symbolRotate', 'symbolOffset']; - var SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat(['symbolKeepAspect']); - // Encoding visual for all series include which is filtered for legend drawing - var seriesSymbolTask = { - createOnAllSeries: true, - // For legend. - performRawSeries: true, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - if (seriesModel.legendIcon) { - data.setVisual('legendIcon', seriesModel.legendIcon); - } - if (!seriesModel.hasSymbolVisual) { - return; - } - var symbolOptions = {}; - var symbolOptionsCb = {}; - var hasCallback = false; - for (var i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) { - var symbolPropName = SYMBOL_PROPS_WITH_CB[i]; - var val = seriesModel.get(symbolPropName); - if (isFunction(val)) { - hasCallback = true; - symbolOptionsCb[symbolPropName] = val; - } else { - symbolOptions[symbolPropName] = val; - } - } - symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol; - data.setVisual(extend({ - legendIcon: seriesModel.legendIcon || symbolOptions.symbol, - symbolKeepAspect: seriesModel.get('symbolKeepAspect') - }, symbolOptions)); - // Only visible series has each data be visual encoded - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } - var symbolPropsCb = keys(symbolOptionsCb); - function dataEach(data, idx) { - var rawValue = seriesModel.getRawValue(idx); - var params = seriesModel.getDataParams(idx); - for (var i = 0; i < symbolPropsCb.length; i++) { - var symbolPropName = symbolPropsCb[i]; - data.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params)); - } - } - return { - dataEach: hasCallback ? dataEach : null - }; - } - }; - var dataSymbolTask = { - createOnAllSeries: true, - // For legend. - performRawSeries: true, - reset: function (seriesModel, ecModel) { - if (!seriesModel.hasSymbolVisual) { - return; - } - // Only visible series has each data be visual encoded - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } - var data = seriesModel.getData(); - function dataEach(data, idx) { - var itemModel = data.getItemModel(idx); - for (var i = 0; i < SYMBOL_PROPS.length; i++) { - var symbolPropName = SYMBOL_PROPS[i]; - var val = itemModel.getShallow(symbolPropName, true); - if (val != null) { - data.setItemVisual(idx, symbolPropName, val); - } - } - } - return { - dataEach: data.hasItemOption ? dataEach : null - }; - } - }; - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 getItemVisualFromData(data, dataIndex, key) { - switch (key) { - case 'color': - var style = data.getItemVisual(dataIndex, 'style'); - return style[data.getVisual('drawType')]; - case 'opacity': - return data.getItemVisual(dataIndex, 'style').opacity; - case 'symbol': - case 'symbolSize': - case 'liftZ': - return data.getItemVisual(dataIndex, key); - default: - if ("development" !== 'production') { - console.warn("Unknown visual type " + key); - } - } - } - function getVisualFromData(data, key) { - switch (key) { - case 'color': - var style = data.getVisual('style'); - return style[data.getVisual('drawType')]; - case 'opacity': - return data.getVisual('style').opacity; - case 'symbol': - case 'symbolSize': - case 'liftZ': - return data.getVisual(key); - default: - if ("development" !== 'production') { - console.warn("Unknown visual type " + key); - } - } - } - function setItemVisualFromData(data, dataIndex, key, value) { - switch (key) { - case 'color': - // Make sure not sharing style object. - var style = data.ensureUniqueItemVisual(dataIndex, 'style'); - style[data.getVisual('drawType')] = value; - // Mark the color has been changed, not from palette anymore - data.setItemVisual(dataIndex, 'colorFromPalette', false); - break; - case 'opacity': - data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value; - break; - case 'symbol': - case 'symbolSize': - case 'liftZ': - data.setItemVisual(dataIndex, key, value); - break; - default: - if ("development" !== 'production') { - console.warn("Unknown visual type " + key); - } - } - } - - // Legacy data selection action. - // Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect - function createLegacyDataSelectAction(seriesType, ecRegisterAction) { - function getSeriesIndices(ecModel, payload) { - var seriesIndices = []; - ecModel.eachComponent({ - mainType: 'series', - subType: seriesType, - query: payload - }, function (seriesModel) { - seriesIndices.push(seriesModel.seriesIndex); - }); - return seriesIndices; - } - each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) { - ecRegisterAction(eventsMap[0], function (payload, ecModel, api) { - payload = extend({}, payload); - if ("development" !== 'production') { - deprecateReplaceLog(payload.type, eventsMap[1]); - } - api.dispatchAction(extend(payload, { - type: eventsMap[1], - seriesIndex: getSeriesIndices(ecModel, payload) - })); - }); - }); - } - function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) { - var legacyEventName = type + eventPostfix; - if (!ecIns.isSilent(legacyEventName)) { - if ("development" !== 'production') { - deprecateLog("event " + legacyEventName + " is deprecated."); - } - ecModel.eachComponent({ - mainType: 'series', - subType: 'pie' - }, function (seriesModel) { - var seriesIndex = seriesModel.seriesIndex; - var selectedMap = seriesModel.option.selectedMap; - var selected = payload.selected; - for (var i = 0; i < selected.length; i++) { - if (selected[i].seriesIndex === seriesIndex) { - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, payload.fromActionPayload); - ecIns.trigger(legacyEventName, { - type: legacyEventName, - seriesId: seriesModel.id, - name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex), - selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap) - }); - } - } - }); - } - } - function handleLegacySelectEvents(messageCenter, ecIns, api) { - messageCenter.on('selectchanged', function (params) { - var ecModel = api.getModel(); - if (params.isFromClick) { - handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params); - handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params); - } else if (params.fromAction === 'select') { - handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params); - handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params); - } else if (params.fromAction === 'unselect') { - handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params); - handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params); - } - }); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 findEventDispatcher(target, det, returnFirstMatch) { - var found; - while (target) { - if (det(target)) { - found = target; - if (returnFirstMatch) { - break; - } - } - target = target.__hostTarget || target.parent; - } - return found; - } - - var wmUniqueIndex = Math.round(Math.random() * 9); - var supportDefineProperty = typeof Object.defineProperty === 'function'; - var WeakMap = (function () { - function WeakMap() { - this._id = '__ec_inner_' + wmUniqueIndex++; - } - WeakMap.prototype.get = function (key) { - return this._guard(key)[this._id]; - }; - WeakMap.prototype.set = function (key, value) { - var target = this._guard(key); - if (supportDefineProperty) { - Object.defineProperty(target, this._id, { - value: value, - enumerable: false, - configurable: true - }); - } - else { - target[this._id] = value; - } - return this; - }; - WeakMap.prototype["delete"] = function (key) { - if (this.has(key)) { - delete this._guard(key)[this._id]; - return true; - } - return false; - }; - WeakMap.prototype.has = function (key) { - return !!this._guard(key)[this._id]; - }; - WeakMap.prototype._guard = function (key) { - if (key !== Object(key)) { - throw TypeError('Value of WeakMap is not a non-null object.'); - } - return key; - }; - return WeakMap; - }()); - - /** - * Triangle shape - * @inner - */ - var Triangle = Path.extend({ - 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 = Path.extend({ - 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 = Path.extend({ - 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 = Path.extend({ - 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 constructors - */ - // TODO Use function to build symbol path. - var symbolCtors = { - line: Line, - rect: Rect, - roundRect: Rect, - square: Rect, - circle: Circle, - diamond: Diamond, - pin: Pin, - arrow: Arrow, - triangle: Triangle - }; - var symbolShapeMakers = { - line: function (x, y, w, h, shape) { - 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 = {}; - each(symbolCtors, function (Ctor, name) { - symbolBuildProxies[name] = new Ctor(); - }); - var SymbolClz = Path.extend({ - type: 'symbol', - shape: { - symbolType: '', - x: 0, - y: 0, - width: 0, - height: 0 - }, - calculateTextPosition: function (out, config, rect) { - var res = calculateTextPosition(out, config, rect); - var shape = this.shape; - if (shape && shape.symbolType === 'pin' && config.position === '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; - if (this.__isEmptyBrush) { - symbolStyle.stroke = color; - symbolStyle.fill = innerColor || '#fff'; - // TODO Same width with lineStyle in LineView - symbolStyle.lineWidth = 2; - } else if (this.shape.symbolType === 'line') { - symbolStyle.stroke = color; - } else { - symbolStyle.fill = color; - } - this.markRedraw(); - } - } - /** - * Create a symbol element with given symbol configuration: shape, x, y, width, height, color - */ - function createSymbol(symbolType, x, y, w, h, color, - // whether to keep the ratio of w/h, - 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 = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover'); - } else if (symbolType.indexOf('path://') === 0) { - symbolPath = 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; - // TODO Should deprecate setColor - symbolPath.setColor = symbolPathSetColor; - if (color) { - symbolPath.setColor(color); - } - return symbolPath; - } - function normalizeSymbolSize(symbolSize) { - if (!isArray(symbolSize)) { - symbolSize = [+symbolSize, +symbolSize]; - } - return [symbolSize[0] || 0, symbolSize[1] || 0]; - } - function normalizeSymbolOffset(symbolOffset, symbolSize) { - if (symbolOffset == null) { - return; - } - if (!isArray(symbolOffset)) { - symbolOffset = [symbolOffset, symbolOffset]; - } - return [parsePercent$1(symbolOffset[0], symbolSize[0]) || 0, parsePercent$1(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0]; - } - - function isSafeNum(num) { - return isFinite(num); - } - function createLinearGradient(ctx, obj, rect) { - var x = obj.x == null ? 0 : obj.x; - var x2 = obj.x2 == null ? 1 : obj.x2; - var y = obj.y == null ? 0 : obj.y; - var y2 = obj.y2 == null ? 0 : obj.y2; - if (!obj.global) { - x = x * rect.width + rect.x; - x2 = x2 * rect.width + rect.x; - y = y * rect.height + rect.y; - y2 = y2 * rect.height + rect.y; - } - x = isSafeNum(x) ? x : 0; - x2 = isSafeNum(x2) ? x2 : 1; - y = isSafeNum(y) ? y : 0; - y2 = isSafeNum(y2) ? y2 : 0; - var canvasGradient = ctx.createLinearGradient(x, y, x2, y2); - return canvasGradient; - } - function createRadialGradient(ctx, obj, rect) { - var width = rect.width; - var height = rect.height; - var min = Math.min(width, height); - var x = obj.x == null ? 0.5 : obj.x; - var y = obj.y == null ? 0.5 : obj.y; - var r = obj.r == null ? 0.5 : obj.r; - if (!obj.global) { - x = x * width + rect.x; - y = y * height + rect.y; - r = r * min; - } - x = isSafeNum(x) ? x : 0.5; - y = isSafeNum(y) ? y : 0.5; - r = r >= 0 && isSafeNum(r) ? r : 0.5; - var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r); - return canvasGradient; - } - function getCanvasGradient(ctx, obj, rect) { - var canvasGradient = obj.type === 'radial' - ? createRadialGradient(ctx, obj, rect) - : createLinearGradient(ctx, obj, rect); - var colorStops = obj.colorStops; - for (var i = 0; i < colorStops.length; i++) { - canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color); - } - return canvasGradient; - } - function isClipPathChanged(clipPaths, prevClipPaths) { - if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) { - return false; - } - if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) { - return true; - } - for (var i = 0; i < clipPaths.length; i++) { - if (clipPaths[i] !== prevClipPaths[i]) { - return true; - } - } - return false; - } - function parseInt10(val) { - return parseInt(val, 10); - } - function getSize(root, whIdx, opts) { - var wh = ['width', 'height'][whIdx]; - var cwh = ['clientWidth', 'clientHeight'][whIdx]; - var plt = ['paddingLeft', 'paddingTop'][whIdx]; - var prb = ['paddingRight', 'paddingBottom'][whIdx]; - if (opts[wh] != null && opts[wh] !== 'auto') { - return parseFloat(opts[wh]); - } - var stl = document.defaultView.getComputedStyle(root); - return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh])) - - (parseInt10(stl[plt]) || 0) - - (parseInt10(stl[prb]) || 0)) | 0; - } - - function normalizeLineDash(lineType, lineWidth) { - if (!lineType || lineType === 'solid' || !(lineWidth > 0)) { - return null; - } - return lineType === 'dashed' - ? [4 * lineWidth, 2 * lineWidth] - : lineType === 'dotted' - ? [lineWidth] - : isNumber(lineType) - ? [lineType] : isArray(lineType) ? lineType : null; - } - function getLineDash(el) { - var style = el.style; - var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth); - var lineDashOffset = style.lineDashOffset; - if (lineDash) { - var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1; - if (lineScale_1 && lineScale_1 !== 1) { - lineDash = map(lineDash, function (rawVal) { - return rawVal / lineScale_1; - }); - lineDashOffset /= lineScale_1; - } - } - return [lineDash, lineDashOffset]; - } - - var pathProxyForDraw = new PathProxy(true); - function styleHasStroke(style) { - var stroke = style.stroke; - return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0)); - } - function isValidStrokeFillStyle(strokeOrFill) { - return typeof strokeOrFill === 'string' && strokeOrFill !== 'none'; - } - function styleHasFill(style) { - var fill = style.fill; - return fill != null && fill !== 'none'; - } - function doFillPath(ctx, style) { - if (style.fillOpacity != null && style.fillOpacity !== 1) { - var originalGlobalAlpha = ctx.globalAlpha; - ctx.globalAlpha = style.fillOpacity * style.opacity; - ctx.fill(); - ctx.globalAlpha = originalGlobalAlpha; - } - else { - ctx.fill(); - } - } - function doStrokePath(ctx, style) { - if (style.strokeOpacity != null && style.strokeOpacity !== 1) { - var originalGlobalAlpha = ctx.globalAlpha; - ctx.globalAlpha = style.strokeOpacity * style.opacity; - ctx.stroke(); - ctx.globalAlpha = originalGlobalAlpha; - } - else { - ctx.stroke(); - } - } - function createCanvasPattern(ctx, pattern, el) { - var image = createOrUpdateImage(pattern.image, pattern.__image, el); - if (isImageReady(image)) { - var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat'); - if (typeof DOMMatrix === 'function' - && canvasPattern - && canvasPattern.setTransform) { - var matrix = new DOMMatrix(); - matrix.translateSelf((pattern.x || 0), (pattern.y || 0)); - matrix.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE); - matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1)); - canvasPattern.setTransform(matrix); - } - return canvasPattern; - } - } - function brushPath(ctx, el, style, inBatch) { - var _a; - var hasStroke = styleHasStroke(style); - var hasFill = styleHasFill(style); - var strokePercent = style.strokePercent; - var strokePart = strokePercent < 1; - var firstDraw = !el.path; - if ((!el.silent || strokePart) && firstDraw) { - el.createPathProxy(); - } - var path = el.path || pathProxyForDraw; - var dirtyFlag = el.__dirty; - if (!inBatch) { - var fill = style.fill; - var stroke = style.stroke; - var hasFillGradient = hasFill && !!fill.colorStops; - var hasStrokeGradient = hasStroke && !!stroke.colorStops; - var hasFillPattern = hasFill && !!fill.image; - var hasStrokePattern = hasStroke && !!stroke.image; - var fillGradient = void 0; - var strokeGradient = void 0; - var fillPattern = void 0; - var strokePattern = void 0; - var rect = void 0; - if (hasFillGradient || hasStrokeGradient) { - rect = el.getBoundingRect(); - } - if (hasFillGradient) { - fillGradient = dirtyFlag - ? getCanvasGradient(ctx, fill, rect) - : el.__canvasFillGradient; - el.__canvasFillGradient = fillGradient; - } - if (hasStrokeGradient) { - strokeGradient = dirtyFlag - ? getCanvasGradient(ctx, stroke, rect) - : el.__canvasStrokeGradient; - el.__canvasStrokeGradient = strokeGradient; - } - if (hasFillPattern) { - fillPattern = (dirtyFlag || !el.__canvasFillPattern) - ? createCanvasPattern(ctx, fill, el) - : el.__canvasFillPattern; - el.__canvasFillPattern = fillPattern; - } - if (hasStrokePattern) { - strokePattern = (dirtyFlag || !el.__canvasStrokePattern) - ? createCanvasPattern(ctx, stroke, el) - : el.__canvasStrokePattern; - el.__canvasStrokePattern = fillPattern; - } - if (hasFillGradient) { - ctx.fillStyle = fillGradient; - } - else if (hasFillPattern) { - if (fillPattern) { - ctx.fillStyle = fillPattern; - } - else { - hasFill = false; - } - } - if (hasStrokeGradient) { - ctx.strokeStyle = strokeGradient; - } - else if (hasStrokePattern) { - if (strokePattern) { - ctx.strokeStyle = strokePattern; - } - else { - hasStroke = false; - } - } - } - var scale = el.getGlobalScale(); - path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold); - var lineDash; - var lineDashOffset; - if (ctx.setLineDash && style.lineDash) { - _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1]; - } - var needsRebuild = true; - if (firstDraw || (dirtyFlag & SHAPE_CHANGED_BIT)) { - path.setDPR(ctx.dpr); - if (strokePart) { - path.setContext(null); - } - else { - path.setContext(ctx); - needsRebuild = false; - } - path.reset(); - el.buildPath(path, el.shape, inBatch); - path.toStatic(); - el.pathUpdated(); - } - if (needsRebuild) { - path.rebuildPath(ctx, strokePart ? strokePercent : 1); - } - if (lineDash) { - ctx.setLineDash(lineDash); - ctx.lineDashOffset = lineDashOffset; - } - if (!inBatch) { - if (style.strokeFirst) { - if (hasStroke) { - doStrokePath(ctx, style); - } - if (hasFill) { - doFillPath(ctx, style); - } - } - else { - if (hasFill) { - doFillPath(ctx, style); - } - if (hasStroke) { - doStrokePath(ctx, style); - } - } - } - if (lineDash) { - ctx.setLineDash([]); - } - } - function brushImage(ctx, el, style) { - var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload); - if (!image || !isImageReady(image)) { - return; - } - var x = style.x || 0; - var y = style.y || 0; - var width = el.getWidth(); - var height = el.getHeight(); - var aspect = image.width / image.height; - if (width == null && height != null) { - width = height * aspect; - } - else if (height == null && width != null) { - height = width / aspect; - } - else if (width == null && height == null) { - width = image.width; - height = image.height; - } - if (style.sWidth && style.sHeight) { - var sx = style.sx || 0; - var sy = style.sy || 0; - ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height); - } - else if (style.sx && style.sy) { - var sx = style.sx; - var sy = style.sy; - var sWidth = width - sx; - var sHeight = height - sy; - ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height); - } - else { - ctx.drawImage(image, x, y, width, height); - } - } - function brushText(ctx, el, style) { - var _a; - var text = style.text; - text != null && (text += ''); - if (text) { - ctx.font = style.font || DEFAULT_FONT; - ctx.textAlign = style.textAlign; - ctx.textBaseline = style.textBaseline; - var lineDash = void 0; - var lineDashOffset = void 0; - if (ctx.setLineDash && style.lineDash) { - _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1]; - } - if (lineDash) { - ctx.setLineDash(lineDash); - ctx.lineDashOffset = lineDashOffset; - } - if (style.strokeFirst) { - if (styleHasStroke(style)) { - ctx.strokeText(text, style.x, style.y); - } - if (styleHasFill(style)) { - ctx.fillText(text, style.x, style.y); - } - } - else { - if (styleHasFill(style)) { - ctx.fillText(text, style.x, style.y); - } - if (styleHasStroke(style)) { - ctx.strokeText(text, style.x, style.y); - } - } - if (lineDash) { - ctx.setLineDash([]); - } - } - } - var SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY']; - var STROKE_PROPS = [ - ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10] - ]; - function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) { - var styleChanged = false; - if (!forceSetAll) { - prevStyle = prevStyle || {}; - if (style === prevStyle) { - return false; - } - } - if (forceSetAll || style.opacity !== prevStyle.opacity) { - flushPathDrawn(ctx, scope); - styleChanged = true; - var opacity = Math.max(Math.min(style.opacity, 1), 0); - ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity; - } - if (forceSetAll || style.blend !== prevStyle.blend) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend; - } - for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) { - var propName = SHADOW_NUMBER_PROPS[i]; - if (forceSetAll || style[propName] !== prevStyle[propName]) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - ctx[propName] = ctx.dpr * (style[propName] || 0); - } - } - if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor; - } - return styleChanged; - } - function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) { - var style = getStyle(el, scope.inHover); - var prevStyle = forceSetAll - ? null - : (prevEl && getStyle(prevEl, scope.inHover) || {}); - if (style === prevStyle) { - return false; - } - var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope); - if (forceSetAll || style.fill !== prevStyle.fill) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill); - } - if (forceSetAll || style.stroke !== prevStyle.stroke) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke); - } - if (forceSetAll || style.opacity !== prevStyle.opacity) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - ctx.globalAlpha = style.opacity == null ? 1 : style.opacity; - } - if (el.hasStroke()) { - var lineWidth = style.lineWidth; - var newLineWidth = lineWidth / ((style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1); - if (ctx.lineWidth !== newLineWidth) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - ctx.lineWidth = newLineWidth; - } - } - for (var i = 0; i < STROKE_PROPS.length; i++) { - var prop = STROKE_PROPS[i]; - var propName = prop[0]; - if (forceSetAll || style[propName] !== prevStyle[propName]) { - if (!styleChanged) { - flushPathDrawn(ctx, scope); - styleChanged = true; - } - ctx[propName] = style[propName] || prop[1]; - } - } - return styleChanged; - } - function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) { - return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope); - } - function setContextTransform(ctx, el) { - var m = el.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); - } - } - function updateClipStatus(clipPaths, ctx, scope) { - var allClipped = false; - for (var i = 0; i < clipPaths.length; i++) { - var clipPath = clipPaths[i]; - allClipped = allClipped || clipPath.isZeroArea(); - setContextTransform(ctx, clipPath); - ctx.beginPath(); - clipPath.buildPath(ctx, clipPath.shape); - ctx.clip(); - } - scope.allClipped = allClipped; - } - function isTransformChanged(m0, m1) { - if (m0 && m1) { - return m0[0] !== m1[0] - || m0[1] !== m1[1] - || m0[2] !== m1[2] - || m0[3] !== m1[3] - || m0[4] !== m1[4] - || m0[5] !== m1[5]; - } - else if (!m0 && !m1) { - return false; - } - return true; - } - var DRAW_TYPE_PATH = 1; - var DRAW_TYPE_IMAGE = 2; - var DRAW_TYPE_TEXT = 3; - var DRAW_TYPE_INCREMENTAL = 4; - function canPathBatch(style) { - var hasFill = styleHasFill(style); - var hasStroke = styleHasStroke(style); - return !(style.lineDash - || !(+hasFill ^ +hasStroke) - || (hasFill && typeof style.fill !== 'string') - || (hasStroke && typeof style.stroke !== 'string') - || style.strokePercent < 1 - || style.strokeOpacity < 1 - || style.fillOpacity < 1); - } - function flushPathDrawn(ctx, scope) { - scope.batchFill && ctx.fill(); - scope.batchStroke && ctx.stroke(); - scope.batchFill = ''; - scope.batchStroke = ''; - } - function getStyle(el, inHover) { - return inHover ? (el.__hoverStyle || el.style) : el.style; - } - function brushSingle(ctx, el) { - brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true); - } - function brush(ctx, el, scope, isLast) { - var m = el.transform; - if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) { - el.__dirty &= ~REDRAW_BIT; - el.__isRendered = false; - return; - } - var clipPaths = el.__clipPaths; - var prevElClipPaths = scope.prevElClipPaths; - var forceSetTransform = false; - var forceSetStyle = false; - if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) { - if (prevElClipPaths && prevElClipPaths.length) { - flushPathDrawn(ctx, scope); - ctx.restore(); - forceSetStyle = forceSetTransform = true; - scope.prevElClipPaths = null; - scope.allClipped = false; - scope.prevEl = null; - } - if (clipPaths && clipPaths.length) { - flushPathDrawn(ctx, scope); - ctx.save(); - updateClipStatus(clipPaths, ctx, scope); - forceSetTransform = true; - } - scope.prevElClipPaths = clipPaths; - } - if (scope.allClipped) { - el.__isRendered = false; - return; - } - el.beforeBrush && el.beforeBrush(); - el.innerBeforeBrush(); - var prevEl = scope.prevEl; - if (!prevEl) { - forceSetStyle = forceSetTransform = true; - } - var canBatchPath = el instanceof Path - && el.autoBatch - && canPathBatch(el.style); - if (forceSetTransform || isTransformChanged(m, prevEl.transform)) { - flushPathDrawn(ctx, scope); - setContextTransform(ctx, el); - } - else if (!canBatchPath) { - flushPathDrawn(ctx, scope); - } - var style = getStyle(el, scope.inHover); - if (el instanceof Path) { - if (scope.lastDrawType !== DRAW_TYPE_PATH) { - forceSetStyle = true; - scope.lastDrawType = DRAW_TYPE_PATH; - } - bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope); - if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) { - ctx.beginPath(); - } - brushPath(ctx, el, style, canBatchPath); - if (canBatchPath) { - scope.batchFill = style.fill || ''; - scope.batchStroke = style.stroke || ''; - } - } - else { - if (el instanceof TSpan) { - if (scope.lastDrawType !== DRAW_TYPE_TEXT) { - forceSetStyle = true; - scope.lastDrawType = DRAW_TYPE_TEXT; - } - bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope); - brushText(ctx, el, style); - } - else if (el instanceof ZRImage) { - if (scope.lastDrawType !== DRAW_TYPE_IMAGE) { - forceSetStyle = true; - scope.lastDrawType = DRAW_TYPE_IMAGE; - } - bindImageStyle(ctx, el, prevEl, forceSetStyle, scope); - brushImage(ctx, el, style); - } - else if (el.getTemporalDisplayables) { - if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) { - forceSetStyle = true; - scope.lastDrawType = DRAW_TYPE_INCREMENTAL; - } - brushIncremental(ctx, el, scope); - } - } - if (canBatchPath && isLast) { - flushPathDrawn(ctx, scope); - } - el.innerAfterBrush(); - el.afterBrush && el.afterBrush(); - scope.prevEl = el; - el.__dirty = 0; - el.__isRendered = true; - } - function brushIncremental(ctx, el, scope) { - var displayables = el.getDisplayables(); - var temporalDisplayables = el.getTemporalDisplayables(); - ctx.save(); - var innerScope = { - prevElClipPaths: null, - prevEl: null, - allClipped: false, - viewWidth: scope.viewWidth, - viewHeight: scope.viewHeight, - inHover: scope.inHover - }; - var i; - var len; - for (i = el.getCursor(), len = displayables.length; i < len; i++) { - var displayable = displayables[i]; - displayable.beforeBrush && displayable.beforeBrush(); - displayable.innerBeforeBrush(); - brush(ctx, displayable, innerScope, i === len - 1); - displayable.innerAfterBrush(); - displayable.afterBrush && displayable.afterBrush(); - innerScope.prevEl = displayable; - } - for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) { - var displayable = temporalDisplayables[i_1]; - displayable.beforeBrush && displayable.beforeBrush(); - displayable.innerBeforeBrush(); - brush(ctx, displayable, innerScope, i_1 === len_1 - 1); - displayable.innerAfterBrush(); - displayable.afterBrush && displayable.afterBrush(); - innerScope.prevEl = displayable; - } - el.clearTemporalDisplayables(); - el.notClear = true; - ctx.restore(); - } - - var decalMap = new WeakMap(); - var decalCache = new LRU(100); - var decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'maxTileWidth', 'maxTileHeight']; - /** - * Create or update pattern image from decal options - * - * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal - * @return {Pattern} pattern with generated image, null if no decal - */ - function createOrUpdatePatternFromDecal(decalObject, api) { - if (decalObject === 'none') { - return null; - } - var dpr = api.getDevicePixelRatio(); - var zr = api.getZr(); - var isSVG = zr.painter.type === 'svg'; - if (decalObject.dirty) { - decalMap["delete"](decalObject); - } - var oldPattern = decalMap.get(decalObject); - if (oldPattern) { - return oldPattern; - } - var decalOpt = defaults(decalObject, { - symbol: 'rect', - symbolSize: 1, - symbolKeepAspect: true, - color: 'rgba(0, 0, 0, 0.2)', - backgroundColor: null, - dashArrayX: 5, - dashArrayY: 5, - rotation: 0, - maxTileWidth: 512, - maxTileHeight: 512 - }); - if (decalOpt.backgroundColor === 'none') { - decalOpt.backgroundColor = null; - } - var pattern = { - repeat: 'repeat' - }; - setPatternnSource(pattern); - pattern.rotation = decalOpt.rotation; - pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr; - decalMap.set(decalObject, pattern); - decalObject.dirty = false; - return pattern; - function setPatternnSource(pattern) { - var keys = [dpr]; - var isValidKey = true; - for (var i = 0; i < decalKeys.length; ++i) { - var value = decalOpt[decalKeys[i]]; - if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== 'boolean') { - isValidKey = false; - break; - } - keys.push(value); - } - var cacheKey; - if (isValidKey) { - cacheKey = keys.join(',') + (isSVG ? '-svg' : ''); - var cache = decalCache.get(cacheKey); - if (cache) { - isSVG ? pattern.svgElement = cache : pattern.image = cache; - } - } - var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX); - var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY); - var symbolArray = normalizeSymbolArray(decalOpt.symbol); - var lineBlockLengthsX = getLineBlockLengthX(dashArrayX); - var lineBlockLengthY = getLineBlockLengthY(dashArrayY); - var canvas = !isSVG && platformApi.createCanvas(); - var svgRoot = isSVG && { - tag: 'g', - attrs: {}, - key: 'dcl', - children: [] - }; - var pSize = getPatternSize(); - var ctx; - if (canvas) { - canvas.width = pSize.width * dpr; - canvas.height = pSize.height * dpr; - ctx = canvas.getContext('2d'); - } - brushDecal(); - if (isValidKey) { - decalCache.put(cacheKey, canvas || svgRoot); - } - pattern.image = canvas; - pattern.svgElement = svgRoot; - pattern.svgWidth = pSize.width; - pattern.svgHeight = pSize.height; - /** - * Get minimum length that can make a repeatable pattern. - * - * @return {Object} pattern width and height - */ - function getPatternSize() { - /** - * For example, if dash is [[3, 2], [2, 1]] for X, it looks like - * |--- --- --- --- --- ... - * |-- -- -- -- -- -- -- -- ... - * |--- --- --- --- --- ... - * |-- -- -- -- -- -- -- -- ... - * So the minimum length of X is 15, - * which is the least common multiple of `3 + 2` and `2 + 1` - * |--- --- --- |--- --- ... - * |-- -- -- -- -- |-- -- -- ... - */ - var width = 1; - for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) { - width = getLeastCommonMultiple(width, lineBlockLengthsX[i]); - } - var symbolRepeats = 1; - for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) { - symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length); - } - width *= symbolRepeats; - var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length; - if ("development" !== 'production') { - var warn = function (attrName) { - /* eslint-disable-next-line */ - console.warn("Calculated decal size is greater than " + attrName + " due to decal option settings so " + attrName + " is used for the decal size. Please consider changing the decal option to make a smaller decal or set " + attrName + " to be larger to avoid incontinuity."); - }; - if (width > decalOpt.maxTileWidth) { - warn('maxTileWidth'); - } - if (height > decalOpt.maxTileHeight) { - warn('maxTileHeight'); - } - } - return { - width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)), - height: Math.max(1, Math.min(height, decalOpt.maxTileHeight)) - }; - } - function brushDecal() { - if (ctx) { - ctx.clearRect(0, 0, canvas.width, canvas.height); - if (decalOpt.backgroundColor) { - ctx.fillStyle = decalOpt.backgroundColor; - ctx.fillRect(0, 0, canvas.width, canvas.height); - } - } - var ySum = 0; - for (var i = 0; i < dashArrayY.length; ++i) { - ySum += dashArrayY[i]; - } - if (ySum <= 0) { - // dashArrayY is 0, draw nothing - return; - } - var y = -lineBlockLengthY; - var yId = 0; - var yIdTotal = 0; - var xId0 = 0; - while (y < pSize.height) { - if (yId % 2 === 0) { - var symbolYId = yIdTotal / 2 % symbolArray.length; - var x = 0; - var xId1 = 0; - var xId1Total = 0; - while (x < pSize.width * 2) { - var xSum = 0; - for (var i = 0; i < dashArrayX[xId0].length; ++i) { - xSum += dashArrayX[xId0][i]; - } - if (xSum <= 0) { - // Skip empty line - break; - } - // E.g., [15, 5, 20, 5] draws only for 15 and 20 - if (xId1 % 2 === 0) { - var size = (1 - decalOpt.symbolSize) * 0.5; - var left = x + dashArrayX[xId0][xId1] * size; - var top_1 = y + dashArrayY[yId] * size; - var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize; - var height = dashArrayY[yId] * decalOpt.symbolSize; - var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length; - brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]); - } - x += dashArrayX[xId0][xId1]; - ++xId1Total; - ++xId1; - if (xId1 === dashArrayX[xId0].length) { - xId1 = 0; - } - } - ++xId0; - if (xId0 === dashArrayX.length) { - xId0 = 0; - } - } - y += dashArrayY[yId]; - ++yIdTotal; - ++yId; - if (yId === dashArrayY.length) { - yId = 0; - } - } - function brushSymbol(x, y, width, height, symbolType) { - var scale = isSVG ? 1 : dpr; - var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect); - if (isSVG) { - var symbolVNode = zr.painter.renderOneToVNode(symbol); - if (symbolVNode) { - svgRoot.children.push(symbolVNode); - } - } else { - // Paint to canvas for all other renderers. - brushSingle(ctx, symbol); - } - } - } - } - } - /** - * Convert symbol array into normalized array - * - * @param {string | (string | string[])[]} symbol symbol input - * @return {string[][]} normolized symbol array - */ - function normalizeSymbolArray(symbol) { - if (!symbol || symbol.length === 0) { - return [['rect']]; - } - if (isString(symbol)) { - return [[symbol]]; - } - var isAllString = true; - for (var i = 0; i < symbol.length; ++i) { - if (!isString(symbol[i])) { - isAllString = false; - break; - } - } - if (isAllString) { - return normalizeSymbolArray([symbol]); - } - var result = []; - for (var i = 0; i < symbol.length; ++i) { - if (isString(symbol[i])) { - result.push([symbol[i]]); - } else { - result.push(symbol[i]); - } - } - return result; - } - /** - * Convert dash input into dashArray - * - * @param {DecalDashArrayX} dash dash input - * @return {number[][]} normolized dash array - */ - function normalizeDashArrayX(dash) { - if (!dash || dash.length === 0) { - return [[0, 0]]; - } - if (isNumber(dash)) { - var dashValue = Math.ceil(dash); - return [[dashValue, dashValue]]; - } - /** - * [20, 5] should be normalized into [[20, 5]], - * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]] - */ - var isAllNumber = true; - for (var i = 0; i < dash.length; ++i) { - if (!isNumber(dash[i])) { - isAllNumber = false; - break; - } - } - if (isAllNumber) { - return normalizeDashArrayX([dash]); - } - var result = []; - for (var i = 0; i < dash.length; ++i) { - if (isNumber(dash[i])) { - var dashValue = Math.ceil(dash[i]); - result.push([dashValue, dashValue]); - } else { - var dashValue = map(dash[i], function (n) { - return Math.ceil(n); - }); - if (dashValue.length % 2 === 1) { - // [4, 2, 1] means |---- - -- |---- - -- | - // so normalize it to be [4, 2, 1, 4, 2, 1] - result.push(dashValue.concat(dashValue)); - } else { - result.push(dashValue); - } - } - } - return result; - } - /** - * Convert dash input into dashArray - * - * @param {DecalDashArrayY} dash dash input - * @return {number[]} normolized dash array - */ - function normalizeDashArrayY(dash) { - if (!dash || typeof dash === 'object' && dash.length === 0) { - return [0, 0]; - } - if (isNumber(dash)) { - var dashValue_1 = Math.ceil(dash); - return [dashValue_1, dashValue_1]; - } - var dashValue = map(dash, function (n) { - return Math.ceil(n); - }); - return dash.length % 2 ? dashValue.concat(dashValue) : dashValue; - } - /** - * Get block length of each line. A block is the length of dash line and space. - * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after - * that, so the block length of this line is 5. - * - * @param {number[][]} dash dash array of X or Y - * @return {number[]} block length of each line - */ - function getLineBlockLengthX(dash) { - return map(dash, function (line) { - return getLineBlockLengthY(line); - }); - } - function getLineBlockLengthY(dash) { - var blockLength = 0; - for (var i = 0; i < dash.length; ++i) { - blockLength += dash[i]; - } - if (dash.length % 2 === 1) { - // [4, 2, 1] means |---- - -- |---- - -- | - // So total length is (4 + 2 + 1) * 2 - return blockLength * 2; - } - return blockLength; - } - - function decalVisual(ecModel, api) { - ecModel.eachRawSeries(function (seriesModel) { - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } - var data = seriesModel.getData(); - if (data.hasItemVisual()) { - data.each(function (idx) { - var decal = data.getItemVisual(idx, 'decal'); - if (decal) { - var itemStyle = data.ensureUniqueItemVisual(idx, 'style'); - itemStyle.decal = createOrUpdatePatternFromDecal(decal, api); - } - }); - } - var decal = data.getVisual('decal'); - if (decal) { - var style = data.getVisual('style'); - style.decal = createOrUpdatePatternFromDecal(decal, api); - } - }); - } - - var lifecycle = new Eventful(); - - // Implementation of exported APIs. For example registerMap, getMap. - // The implementations will be registered when installing the component. - // Avoid these code being bundled to the core module. - var implsStore = {}; - // TODO Type - function registerImpl(name, impl) { - if ("development" !== 'production') { - if (implsStore[name]) { - error("Already has an implementation of " + name + "."); - } - } - implsStore[name] = impl; - } - function getImpl(name) { - if ("development" !== 'production') { - if (!implsStore[name]) { - error("Implementation of " + name + " doesn't exists."); - } - } - return implsStore[name]; - } - - var version$1 = '5.5.1'; - var dependencies = { - zrender: '5.6.0' - }; - var TEST_FRAME_REMAIN_TIME = 1; - var PRIORITY_PROCESSOR_SERIES_FILTER = 800; - // Some data processors depends on the stack result dimension (to calculate data extent). - // So data stack stage should be in front of data processing stage. - var PRIORITY_PROCESSOR_DATASTACK = 900; - // "Data filter" will block the stream, so it should be - // put at the beginning of data processing. - var PRIORITY_PROCESSOR_FILTER = 1000; - var PRIORITY_PROCESSOR_DEFAULT = 2000; - var PRIORITY_PROCESSOR_STATISTIC = 5000; - var PRIORITY_VISUAL_LAYOUT = 1000; - var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100; - var PRIORITY_VISUAL_GLOBAL = 2000; - var PRIORITY_VISUAL_CHART = 3000; - var PRIORITY_VISUAL_COMPONENT = 4000; - // Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to - // overwrite the viusal result of component (like `visualMap`) - // using data item specific setting (like itemStyle.xxx on data item) - var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500; - // Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on - // visual result like `symbolSize`. - var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600; - var PRIORITY_VISUAL_BRUSH = 5000; - var PRIORITY_VISUAL_ARIA = 6000; - var PRIORITY_VISUAL_DECAL = 7000; - var PRIORITY = { - PROCESSOR: { - FILTER: PRIORITY_PROCESSOR_FILTER, - SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER, - STATISTIC: PRIORITY_PROCESSOR_STATISTIC - }, - VISUAL: { - LAYOUT: PRIORITY_VISUAL_LAYOUT, - PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT, - GLOBAL: PRIORITY_VISUAL_GLOBAL, - CHART: PRIORITY_VISUAL_CHART, - POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT, - COMPONENT: PRIORITY_VISUAL_COMPONENT, - BRUSH: PRIORITY_VISUAL_BRUSH, - CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM, - ARIA: PRIORITY_VISUAL_ARIA, - DECAL: PRIORITY_VISUAL_DECAL - } - }; - // Main process have three entries: `setOption`, `dispatchAction` and `resize`, - // where they must not be invoked nestedly, except the only case: invoke - // dispatchAction with updateMethod "none" in main process. - // This flag is used to carry out this rule. - // All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]). - var IN_MAIN_PROCESS_KEY = '__flagInMainProcess'; - var PENDING_UPDATE = '__pendingUpdate'; - var STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus'; - var ACTION_REG = /^[a-zA-Z0-9_]+$/; - var CONNECT_STATUS_KEY = '__connectUpdateStatus'; - var CONNECT_STATUS_PENDING = 0; - var CONNECT_STATUS_UPDATING = 1; - var CONNECT_STATUS_UPDATED = 2; - function createRegisterEventWithLowercaseECharts(method) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (this.isDisposed()) { - disposedWarning(this.id); - return; - } - return toLowercaseNameAndCallEventful(this, method, args); - }; - } - function createRegisterEventWithLowercaseMessageCenter(method) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return toLowercaseNameAndCallEventful(this, method, args); - }; - } - function toLowercaseNameAndCallEventful(host, method, args) { - // `args[0]` is event name. Event name is all lowercase. - args[0] = args[0] && args[0].toLowerCase(); - return Eventful.prototype[method].apply(host, args); - } - var MessageCenter = /** @class */function (_super) { - __extends(MessageCenter, _super); - function MessageCenter() { - return _super !== null && _super.apply(this, arguments) || this; - } - return MessageCenter; - }(Eventful); - var messageCenterProto = MessageCenter.prototype; - messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on'); - messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off'); - // --------------------------------------- - // Internal method names for class ECharts - // --------------------------------------- - var prepare; - var prepareView; - var updateDirectly; - var updateMethods; - var doConvertPixel; - var updateStreamModes; - var doDispatchAction; - var flushPendingActions; - var triggerUpdatedEvent; - var bindRenderedEvent; - var bindMouseEvent; - var render; - var renderComponents; - var renderSeries; - var createExtensionAPI; - var enableConnect; - var markStatusToUpdate; - var applyChangedStates; - var ECharts = /** @class */function (_super) { - __extends(ECharts, _super); - function ECharts(dom, - // Theme name or themeOption. - theme, opts) { - var _this = _super.call(this, new ECEventProcessor()) || this; - _this._chartsViews = []; - _this._chartsMap = {}; - _this._componentsViews = []; - _this._componentsMap = {}; - // Can't dispatch action during rendering procedure - _this._pendingActions = []; - opts = opts || {}; - // Get theme by name - if (isString(theme)) { - theme = themeStorage[theme]; - } - _this._dom = dom; - var defaultRenderer = 'canvas'; - var defaultCoarsePointer = 'auto'; - var defaultUseDirtyRect = false; - if ("development" !== 'production') { - var root = /* eslint-disable-next-line */ - env.hasGlobalWindow ? window : global; - if (root) { - defaultRenderer = retrieve2(root.__ECHARTS__DEFAULT__RENDERER__, defaultRenderer); - defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer); - defaultUseDirtyRect = retrieve2(root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__, defaultUseDirtyRect); - } - } - if (opts.ssr) { - registerSSRDataGetter(function (el) { - var ecData = getECData(el); - var dataIndex = ecData.dataIndex; - if (dataIndex == null) { - return; - } - var hashMap = createHashMap(); - hashMap.set('series_index', ecData.seriesIndex); - hashMap.set('data_index', dataIndex); - ecData.ssrType && hashMap.set('ssr_type', ecData.ssrType); - return hashMap; - }); - } - var zr = _this._zr = init(dom, { - renderer: opts.renderer || defaultRenderer, - devicePixelRatio: opts.devicePixelRatio, - width: opts.width, - height: opts.height, - ssr: opts.ssr, - useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect), - useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer), - pointerSize: opts.pointerSize - }); - _this._ssr = opts.ssr; - // Expect 60 fps. - _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17); - theme = clone(theme); - theme && globalBackwardCompat(theme, true); - _this._theme = theme; - _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG); - _this._coordSysMgr = new CoordinateSystemManager(); - var api = _this._api = createExtensionAPI(_this); - // Sort on demand - function prioritySortFunc(a, b) { - return a.__prio - b.__prio; - } - sort(visualFuncs, prioritySortFunc); - sort(dataProcessorFuncs, prioritySortFunc); - _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs); - _this._messageCenter = new MessageCenter(); - // Init mouse events - _this._initEvents(); - // In case some people write `window.onresize = chart.resize` - _this.resize = bind(_this.resize, _this); - zr.animation.on('frame', _this._onframe, _this); - bindRenderedEvent(zr, _this); - bindMouseEvent(zr, _this); - // ECharts instance can be used as value. - setAsPrimitive(_this); - return _this; - } - ECharts.prototype._onframe = function () { - if (this._disposed) { - return; - } - applyChangedStates(this); - var scheduler = this._scheduler; - // Lazy update - if (this[PENDING_UPDATE]) { - var silent = this[PENDING_UPDATE].silent; - this[IN_MAIN_PROCESS_KEY] = true; - try { - prepare(this); - updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams); - } catch (e) { - this[IN_MAIN_PROCESS_KEY] = false; - this[PENDING_UPDATE] = null; - throw e; - } - // At present, in each frame, zrender performs: - // (1) animation step forward. - // (2) trigger('frame') (where this `_onframe` is called) - // (3) zrender flush (render). - // If we do nothing here, since we use `setToFinal: true`, the step (3) above - // will render the final state of the elements before the real animation started. - this._zr.flush(); - this[IN_MAIN_PROCESS_KEY] = false; - this[PENDING_UPDATE] = null; - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - } - // Avoid do both lazy update and progress in one frame. - else if (scheduler.unfinished) { - // Stream progress. - var remainTime = TEST_FRAME_REMAIN_TIME; - var ecModel = this._model; - var api = this._api; - scheduler.unfinished = false; - do { - var startTime = +new Date(); - scheduler.performSeriesTasks(ecModel); - // Currently dataProcessorFuncs do not check threshold. - scheduler.performDataProcessorTasks(ecModel); - updateStreamModes(this, ecModel); - // Do not update coordinate system here. Because that coord system update in - // each frame is not a good user experience. So we follow the rule that - // the extent of the coordinate system is determined in the first frame (the - // frame is executed immediately after task reset. - // this._coordSysMgr.update(ecModel, api); - // console.log('--- ec frame visual ---', remainTime); - scheduler.performVisualTasks(ecModel); - renderSeries(this, this._model, api, 'remain', {}); - remainTime -= +new Date() - startTime; - } while (remainTime > 0 && scheduler.unfinished); - // Call flush explicitly for trigger finished event. - if (!scheduler.unfinished) { - this._zr.flush(); - } - // Else, zr flushing be ensue within the same frame, - // because zr flushing is after onframe event. - } - }; - - ECharts.prototype.getDom = function () { - return this._dom; - }; - ECharts.prototype.getId = function () { - return this.id; - }; - ECharts.prototype.getZr = function () { - return this._zr; - }; - ECharts.prototype.isSSR = function () { - return this._ssr; - }; - /* eslint-disable-next-line */ - ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) { - if (this[IN_MAIN_PROCESS_KEY]) { - if ("development" !== 'production') { - error('`setOption` should not be called during main process.'); - } - return; - } - if (this._disposed) { - disposedWarning(this.id); - return; - } - var silent; - var replaceMerge; - var transitionOpt; - if (isObject(notMerge)) { - lazyUpdate = notMerge.lazyUpdate; - silent = notMerge.silent; - replaceMerge = notMerge.replaceMerge; - transitionOpt = notMerge.transition; - notMerge = notMerge.notMerge; - } - this[IN_MAIN_PROCESS_KEY] = true; - if (!this._model || notMerge) { - var optionManager = new OptionManager(this._api); - var theme = this._theme; - var ecModel = this._model = new GlobalModel(); - ecModel.scheduler = this._scheduler; - ecModel.ssr = this._ssr; - ecModel.init(null, null, null, theme, this._locale, optionManager); - } - this._model.setOption(option, { - replaceMerge: replaceMerge - }, optionPreprocessorFuncs); - var updateParams = { - seriesTransition: transitionOpt, - optionChanged: true - }; - if (lazyUpdate) { - this[PENDING_UPDATE] = { - silent: silent, - updateParams: updateParams - }; - this[IN_MAIN_PROCESS_KEY] = false; - // `setOption(option, {lazyMode: true})` may be called when zrender has been slept. - // It should wake it up to make sure zrender start to render at the next frame. - this.getZr().wakeUp(); - } else { - try { - prepare(this); - updateMethods.update.call(this, null, updateParams); - } catch (e) { - this[PENDING_UPDATE] = null; - this[IN_MAIN_PROCESS_KEY] = false; - throw e; - } - // Ensure zr refresh sychronously, and then pixel in canvas can be - // fetched after `setOption`. - if (!this._ssr) { - // not use flush when using ssr mode. - this._zr.flush(); - } - this[PENDING_UPDATE] = null; - this[IN_MAIN_PROCESS_KEY] = false; - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - } - }; - /** - * @deprecated - */ - ECharts.prototype.setTheme = function () { - deprecateLog('ECharts#setTheme() is DEPRECATED in ECharts 3.0'); - }; - // We don't want developers to use getModel directly. - ECharts.prototype.getModel = function () { - return this._model; - }; - ECharts.prototype.getOption = function () { - return this._model && this._model.getOption(); - }; - ECharts.prototype.getWidth = function () { - return this._zr.getWidth(); - }; - ECharts.prototype.getHeight = function () { - return this._zr.getHeight(); - }; - ECharts.prototype.getDevicePixelRatio = function () { - return this._zr.painter.dpr - /* eslint-disable-next-line */ || env.hasGlobalWindow && window.devicePixelRatio || 1; - }; - /** - * Get canvas which has all thing rendered - * @deprecated Use renderToCanvas instead. - */ - ECharts.prototype.getRenderedCanvas = function (opts) { - if ("development" !== 'production') { - deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas'); - } - return this.renderToCanvas(opts); - }; - ECharts.prototype.renderToCanvas = function (opts) { - opts = opts || {}; - var painter = this._zr.painter; - if ("development" !== 'production') { - if (painter.type !== 'canvas') { - throw new Error('renderToCanvas can only be used in the canvas renderer.'); - } - } - return painter.getRenderedCanvas({ - backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'), - pixelRatio: opts.pixelRatio || this.getDevicePixelRatio() - }); - }; - ECharts.prototype.renderToSVGString = function (opts) { - opts = opts || {}; - var painter = this._zr.painter; - if ("development" !== 'production') { - if (painter.type !== 'svg') { - throw new Error('renderToSVGString can only be used in the svg renderer.'); - } - } - return painter.renderToString({ - useViewBox: opts.useViewBox - }); - }; - /** - * Get svg data url - */ - ECharts.prototype.getSvgDataURL = function () { - if (!env.svgSupported) { - return; - } - var zr = this._zr; - var list = zr.storage.getDisplayList(); - // Stop animations - each(list, function (el) { - el.stopAnimation(null, true); - }); - return zr.painter.toDataURL(); - }; - ECharts.prototype.getDataURL = function (opts) { - if (this._disposed) { - disposedWarning(this.id); - return; - } - opts = opts || {}; - var excludeComponents = opts.excludeComponents; - var ecModel = this._model; - var excludesComponentViews = []; - var self = this; - each(excludeComponents, function (componentType) { - ecModel.eachComponent({ - mainType: componentType - }, function (component) { - var view = self._componentsMap[component.__viewId]; - if (!view.group.ignore) { - excludesComponentViews.push(view); - view.group.ignore = true; - } - }); - }); - var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png')); - each(excludesComponentViews, function (view) { - view.group.ignore = false; - }); - return url; - }; - ECharts.prototype.getConnectedDataURL = function (opts) { - if (this._disposed) { - disposedWarning(this.id); - return; - } - var isSvg = opts.type === 'svg'; - var groupId = this.group; - var mathMin = Math.min; - var mathMax = Math.max; - var MAX_NUMBER = Infinity; - if (connectedGroups[groupId]) { - var left_1 = MAX_NUMBER; - var top_1 = MAX_NUMBER; - var right_1 = -MAX_NUMBER; - var bottom_1 = -MAX_NUMBER; - var canvasList_1 = []; - var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio(); - each(instances$1, function (chart, id) { - if (chart.group === groupId) { - var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts)); - var boundingRect = chart.getDom().getBoundingClientRect(); - left_1 = mathMin(boundingRect.left, left_1); - top_1 = mathMin(boundingRect.top, top_1); - right_1 = mathMax(boundingRect.right, right_1); - bottom_1 = mathMax(boundingRect.bottom, bottom_1); - canvasList_1.push({ - dom: canvas, - left: boundingRect.left, - top: boundingRect.top - }); - } - }); - left_1 *= dpr_1; - top_1 *= dpr_1; - right_1 *= dpr_1; - bottom_1 *= dpr_1; - var width = right_1 - left_1; - var height = bottom_1 - top_1; - var targetCanvas = platformApi.createCanvas(); - var zr_1 = init(targetCanvas, { - renderer: isSvg ? 'svg' : 'canvas' - }); - zr_1.resize({ - width: width, - height: height - }); - if (isSvg) { - var content_1 = ''; - each(canvasList_1, function (item) { - var x = item.left - left_1; - var y = item.top - top_1; - content_1 += '' + item.dom + ''; - }); - zr_1.painter.getSvgRoot().innerHTML = content_1; - if (opts.connectedBackgroundColor) { - zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor); - } - zr_1.refreshImmediately(); - return zr_1.painter.toDataURL(); - } else { - // Background between the charts - if (opts.connectedBackgroundColor) { - zr_1.add(new Rect({ - shape: { - x: 0, - y: 0, - width: width, - height: height - }, - style: { - fill: opts.connectedBackgroundColor - } - })); - } - each(canvasList_1, function (item) { - var img = new ZRImage({ - style: { - x: item.left * dpr_1 - left_1, - y: item.top * dpr_1 - top_1, - image: item.dom - } - }); - zr_1.add(img); - }); - zr_1.refreshImmediately(); - return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png')); - } - } else { - return this.getDataURL(opts); - } - }; - ECharts.prototype.convertToPixel = function (finder, value) { - return doConvertPixel(this, 'convertToPixel', finder, value); - }; - ECharts.prototype.convertFromPixel = function (finder, value) { - return doConvertPixel(this, 'convertFromPixel', finder, value); - }; - /** - * Is the specified coordinate systems or components contain the given pixel point. - * @param {Array|number} value - * @return {boolean} result - */ - ECharts.prototype.containPixel = function (finder, value) { - if (this._disposed) { - disposedWarning(this.id); - return; - } - var ecModel = this._model; - var result; - var findResult = parseFinder(ecModel, finder); - each(findResult, function (models, key) { - key.indexOf('Models') >= 0 && each(models, function (model) { - var coordSys = model.coordinateSystem; - if (coordSys && coordSys.containPoint) { - result = result || !!coordSys.containPoint(value); - } else if (key === 'seriesModels') { - var view = this._chartsMap[model.__viewId]; - if (view && view.containPoint) { - result = result || view.containPoint(value, model); - } else { - if ("development" !== 'production') { - warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.')); - } - } - } else { - if ("development" !== 'production') { - warn(key + ': containPoint is not supported'); - } - } - }, this); - }, this); - return !!result; - }; - /** - * Get visual from series or data. - * @param finder - * If string, e.g., 'series', means {seriesIndex: 0}. - * If Object, could contain some of these properties below: - * { - * seriesIndex / seriesId / seriesName, - * dataIndex / dataIndexInside - * } - * If dataIndex is not specified, series visual will be fetched, - * but not data item visual. - * If all of seriesIndex, seriesId, seriesName are not specified, - * visual will be fetched from first series. - * @param visualType 'color', 'symbol', 'symbolSize' - */ - ECharts.prototype.getVisual = function (finder, visualType) { - var ecModel = this._model; - var parsedFinder = parseFinder(ecModel, finder, { - defaultMainType: 'series' - }); - var seriesModel = parsedFinder.seriesModel; - if ("development" !== 'production') { - if (!seriesModel) { - warn('There is no specified series model'); - } - } - var data = seriesModel.getData(); - var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null; - return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType); - }; - /** - * Get view of corresponding component model - */ - ECharts.prototype.getViewOfComponentModel = function (componentModel) { - return this._componentsMap[componentModel.__viewId]; - }; - /** - * Get view of corresponding series model - */ - ECharts.prototype.getViewOfSeriesModel = function (seriesModel) { - return this._chartsMap[seriesModel.__viewId]; - }; - ECharts.prototype._initEvents = function () { - var _this = this; - each(MOUSE_EVENT_NAMES, function (eveName) { - var handler = function (e) { - var ecModel = _this.getModel(); - var el = e.target; - var params; - var isGlobalOut = eveName === 'globalout'; - // no e.target when 'globalout'. - if (isGlobalOut) { - params = {}; - } else { - el && findEventDispatcher(el, function (parent) { - var ecData = getECData(parent); - if (ecData && ecData.dataIndex != null) { - var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex); - params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {}; - return true; - } - // If element has custom eventData of components - else if (ecData.eventData) { - params = extend({}, ecData.eventData); - return true; - } - }, true); - } - // Contract: if params prepared in mouse event, - // these properties must be specified: - // { - // componentType: string (component main type) - // componentIndex: number - // } - // Otherwise event query can not work. - if (params) { - var componentType = params.componentType; - var componentIndex = params.componentIndex; - // Special handling for historic reason: when trigger by - // markLine/markPoint/markArea, the componentType is - // 'markLine'/'markPoint'/'markArea', but we should better - // enable them to be queried by seriesIndex, since their - // option is set in each series. - if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') { - componentType = 'series'; - componentIndex = params.seriesIndex; - } - var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex); - var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]; - if ("development" !== 'production') { - // `event.componentType` and `event[componentTpype + 'Index']` must not - // be missed, otherwise there is no way to distinguish source component. - // See `dataFormat.getDataParams`. - if (!isGlobalOut && !(model && view)) { - warn('model or view can not be found by params'); - } - } - params.event = e; - params.type = eveName; - _this._$eventProcessor.eventInfo = { - targetEl: el, - packedEvent: params, - model: model, - view: view - }; - _this.trigger(eveName, params); - } - }; - // Consider that some component (like tooltip, brush, ...) - // register zr event handler, but user event handler might - // do anything, such as call `setOption` or `dispatchAction`, - // which probably update any of the content and probably - // cause problem if it is called previous other inner handlers. - handler.zrEventfulCallAtLast = true; - _this._zr.on(eveName, handler, _this); - }); - each(eventActionMap, function (actionType, eventType) { - _this._messageCenter.on(eventType, function (event) { - this.trigger(eventType, event); - }, _this); - }); - // Extra events - // TODO register? - each(['selectchanged'], function (eventType) { - _this._messageCenter.on(eventType, function (event) { - this.trigger(eventType, event); - }, _this); - }); - handleLegacySelectEvents(this._messageCenter, this, this._api); - }; - ECharts.prototype.isDisposed = function () { - return this._disposed; - }; - ECharts.prototype.clear = function () { - if (this._disposed) { - disposedWarning(this.id); - return; - } - this.setOption({ - series: [] - }, true); - }; - ECharts.prototype.dispose = function () { - if (this._disposed) { - disposedWarning(this.id); - return; - } - this._disposed = true; - var dom = this.getDom(); - if (dom) { - setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, ''); - } - var chart = this; - var api = chart._api; - var ecModel = chart._model; - each(chart._componentsViews, function (component) { - component.dispose(ecModel, api); - }); - each(chart._chartsViews, function (chart) { - chart.dispose(ecModel, api); - }); - // Dispose after all views disposed - chart._zr.dispose(); - // Set properties to null. - // To reduce the memory cost in case the top code still holds this instance unexpectedly. - chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null; - delete instances$1[chart.id]; - }; - /** - * Resize the chart - */ - ECharts.prototype.resize = function (opts) { - if (this[IN_MAIN_PROCESS_KEY]) { - if ("development" !== 'production') { - error('`resize` should not be called during main process.'); - } - return; - } - if (this._disposed) { - disposedWarning(this.id); - return; - } - this._zr.resize(opts); - var ecModel = this._model; - // Resize loading effect - this._loadingFX && this._loadingFX.resize(); - if (!ecModel) { - return; - } - var needPrepare = ecModel.resetOption('media'); - var silent = opts && opts.silent; - // There is some real cases that: - // chart.setOption(option, { lazyUpdate: true }); - // chart.resize(); - if (this[PENDING_UPDATE]) { - if (silent == null) { - silent = this[PENDING_UPDATE].silent; - } - needPrepare = true; - this[PENDING_UPDATE] = null; - } - this[IN_MAIN_PROCESS_KEY] = true; - try { - needPrepare && prepare(this); - updateMethods.update.call(this, { - type: 'resize', - animation: extend({ - // Disable animation - duration: 0 - }, opts && opts.animation) - }); - } catch (e) { - this[IN_MAIN_PROCESS_KEY] = false; - throw e; - } - this[IN_MAIN_PROCESS_KEY] = false; - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - }; - ECharts.prototype.showLoading = function (name, cfg) { - if (this._disposed) { - disposedWarning(this.id); - return; - } - if (isObject(name)) { - cfg = name; - name = ''; - } - name = name || 'default'; - this.hideLoading(); - if (!loadingEffects[name]) { - if ("development" !== 'production') { - warn('Loading effects ' + name + ' not exists.'); - } - return; - } - var el = loadingEffects[name](this._api, cfg); - var zr = this._zr; - this._loadingFX = el; - zr.add(el); - }; - /** - * Hide loading effect - */ - ECharts.prototype.hideLoading = function () { - if (this._disposed) { - disposedWarning(this.id); - return; - } - this._loadingFX && this._zr.remove(this._loadingFX); - this._loadingFX = null; - }; - ECharts.prototype.makeActionFromEvent = function (eventObj) { - var payload = extend({}, eventObj); - payload.type = eventActionMap[eventObj.type]; - return payload; - }; - /** - * @param opt If pass boolean, means opt.silent - * @param opt.silent Default `false`. Whether trigger events. - * @param opt.flush Default `undefined`. - * true: Flush immediately, and then pixel in canvas can be fetched - * immediately. Caution: it might affect performance. - * false: Not flush. - * undefined: Auto decide whether perform flush. - */ - ECharts.prototype.dispatchAction = function (payload, opt) { - if (this._disposed) { - disposedWarning(this.id); - return; - } - if (!isObject(opt)) { - opt = { - silent: !!opt - }; - } - if (!actions[payload.type]) { - return; - } - // Avoid dispatch action before setOption. Especially in `connect`. - if (!this._model) { - return; - } - // May dispatchAction in rendering procedure - if (this[IN_MAIN_PROCESS_KEY]) { - this._pendingActions.push(payload); - return; - } - var silent = opt.silent; - doDispatchAction.call(this, payload, silent); - var flush = opt.flush; - if (flush) { - this._zr.flush(); - } else if (flush !== false && env.browser.weChat) { - // In WeChat embedded browser, `requestAnimationFrame` and `setInterval` - // hang when sliding page (on touch event), which cause that zr does not - // refresh until user interaction finished, which is not expected. - // But `dispatchAction` may be called too frequently when pan on touch - // screen, which impacts performance if do not throttle them. - this._throttledZrFlush(); - } - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - }; - ECharts.prototype.updateLabelLayout = function () { - lifecycle.trigger('series:layoutlabels', this._model, this._api, { - // Not adding series labels. - // TODO - updatedSeries: [] - }); - }; - ECharts.prototype.appendData = function (params) { - if (this._disposed) { - disposedWarning(this.id); - return; - } - var seriesIndex = params.seriesIndex; - var ecModel = this.getModel(); - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); - if ("development" !== 'production') { - assert(params.data && seriesModel); - } - seriesModel.appendData(params); - // Note: `appendData` does not support that update extent of coordinate - // system, util some scenario require that. In the expected usage of - // `appendData`, the initial extent of coordinate system should better - // be fixed by axis `min`/`max` setting or initial data, otherwise if - // the extent changed while `appendData`, the location of the painted - // graphic elements have to be changed, which make the usage of - // `appendData` meaningless. - this._scheduler.unfinished = true; - this.getZr().wakeUp(); - }; - // A work around for no `internal` modifier in ts yet but - // need to strictly hide private methods to JS users. - ECharts.internalField = function () { - prepare = function (ecIns) { - var scheduler = ecIns._scheduler; - scheduler.restorePipelines(ecIns._model); - scheduler.prepareStageTasks(); - prepareView(ecIns, true); - prepareView(ecIns, false); - scheduler.plan(); - }; - /** - * Prepare view instances of charts and components - */ - prepareView = function (ecIns, isComponent) { - var ecModel = ecIns._model; - var scheduler = ecIns._scheduler; - var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews; - var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap; - var zr = ecIns._zr; - var api = ecIns._api; - for (var i = 0; i < viewList.length; i++) { - viewList[i].__alive = false; - } - isComponent ? ecModel.eachComponent(function (componentType, model) { - componentType !== 'series' && doPrepare(model); - }) : ecModel.eachSeries(doPrepare); - function doPrepare(model) { - // By default view will be reused if possible for the case that `setOption` with "notMerge" - // mode and need to enable transition animation. (Usually, when they have the same id, or - // especially no id but have the same type & name & index. See the `model.id` generation - // rule in `makeIdAndName` and `viewId` generation rule here). - // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that - // the new model has nothing to do with the old model. - var requireNewView = model.__requireNewView; - // This command should not work twice. - model.__requireNewView = false; - // Consider: id same and type changed. - var viewId = '_ec_' + model.id + '_' + model.type; - var view = !requireNewView && viewMap[viewId]; - if (!view) { - var classType = parseClassType(model.type); - var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : - // FIXME:TS - // (ChartView as ChartViewConstructor).getClass('series', classType.sub) - // For backward compat, still support a chart type declared as only subType - // like "liquidfill", but recommend "series.liquidfill" - // But need a base class to make a type series. - ChartView.getClass(classType.sub); - if ("development" !== 'production') { - assert(Clazz, classType.sub + ' does not exist.'); - } - view = new Clazz(); - view.init(ecModel, api); - viewMap[viewId] = view; - viewList.push(view); - zr.add(view.group); - } - model.__viewId = view.__id = viewId; - view.__alive = true; - view.__model = model; - view.group.__ecComponentInfo = { - mainType: model.mainType, - index: model.componentIndex - }; - !isComponent && scheduler.prepareView(view, model, ecModel, api); - } - for (var i = 0; i < viewList.length;) { - var view = viewList[i]; - if (!view.__alive) { - !isComponent && view.renderTask.dispose(); - zr.remove(view.group); - view.dispose(ecModel, api); - viewList.splice(i, 1); - if (viewMap[view.__id] === view) { - delete viewMap[view.__id]; - } - view.__id = view.group.__ecComponentInfo = null; - } else { - i++; - } - } - }; - updateDirectly = function (ecIns, method, payload, mainType, subType) { - var ecModel = ecIns._model; - ecModel.setUpdatePayload(payload); - // broadcast - if (!mainType) { - // FIXME - // Chart will not be update directly here, except set dirty. - // But there is no such scenario now. - each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView); - return; - } - var query = {}; - query[mainType + 'Id'] = payload[mainType + 'Id']; - query[mainType + 'Index'] = payload[mainType + 'Index']; - query[mainType + 'Name'] = payload[mainType + 'Name']; - var condition = { - mainType: mainType, - query: query - }; - subType && (condition.subType = subType); // subType may be '' by parseClassType; - var excludeSeriesId = payload.excludeSeriesId; - var excludeSeriesIdMap; - if (excludeSeriesId != null) { - excludeSeriesIdMap = createHashMap(); - each(normalizeToArray(excludeSeriesId), function (id) { - var modelId = convertOptionIdName(id, null); - if (modelId != null) { - excludeSeriesIdMap.set(modelId, true); - } - }); - } - // If dispatchAction before setOption, do nothing. - ecModel && ecModel.eachComponent(condition, function (model) { - var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null; - if (isExcluded) { - return; - } - if (isHighDownPayload(payload)) { - if (model instanceof SeriesModel) { - if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(['emphasis', 'disabled'])) { - blurSeriesFromHighlightPayload(model, payload, ecIns._api); - } - } else { - var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api), - focusSelf = _a.focusSelf, - dispatchers = _a.dispatchers; - if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) { - blurComponent(model.mainType, model.componentIndex, ecIns._api); - } - // PENDING: - // Whether to put this "enter emphasis" code in `ComponentView`, - // which will be the same as `ChartView` but might be not necessary - // and will be far from this logic. - if (dispatchers) { - each(dispatchers, function (dispatcher) { - payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher); - }); - } - } - } else if (isSelectChangePayload(payload)) { - // TODO geo - if (model instanceof SeriesModel) { - toggleSelectionFromPayload(model, payload, ecIns._api); - updateSeriesElementSelection(model); - markStatusToUpdate(ecIns); - } - } - }, ecIns); - ecModel && ecModel.eachComponent(condition, function (model) { - var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null; - if (isExcluded) { - return; - } - callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]); - }, ecIns); - function callView(view) { - view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload); - } - }; - updateMethods = { - prepareAndUpdate: function (payload) { - prepare(this); - updateMethods.update.call(this, payload, { - // Needs to mark option changed if newOption is given. - // It's from MagicType. - // TODO If use a separate flag optionChanged in payload? - optionChanged: payload.newOption != null - }); - }, - update: function (payload, updateParams) { - var ecModel = this._model; - var api = this._api; - var zr = this._zr; - var coordSysMgr = this._coordSysMgr; - var scheduler = this._scheduler; - // update before setOption - if (!ecModel) { - return; - } - ecModel.setUpdatePayload(payload); - scheduler.restoreData(ecModel, payload); - scheduler.performSeriesTasks(ecModel); - // TODO - // Save total ecModel here for undo/redo (after restoring data and before processing data). - // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call. - // Create new coordinate system each update - // In LineView may save the old coordinate system and use it to get the original point. - coordSysMgr.create(ecModel, api); - scheduler.performDataProcessorTasks(ecModel, payload); - // Current stream render is not supported in data process. So we can update - // stream modes after data processing, where the filtered data is used to - // determine whether to use progressive rendering. - updateStreamModes(this, ecModel); - // We update stream modes before coordinate system updated, then the modes info - // can be fetched when coord sys updating (consider the barGrid extent fix). But - // the drawback is the full coord info can not be fetched. Fortunately this full - // coord is not required in stream mode updater currently. - coordSysMgr.update(ecModel, api); - clearColorPalette(ecModel); - scheduler.performVisualTasks(ecModel, payload); - render(this, ecModel, api, payload, updateParams); - // Set background - var backgroundColor = ecModel.get('backgroundColor') || 'transparent'; - var darkMode = ecModel.get('darkMode'); - zr.setBackgroundColor(backgroundColor); - // Force set dark mode. - if (darkMode != null && darkMode !== 'auto') { - zr.setDarkMode(darkMode); - } - lifecycle.trigger('afterupdate', ecModel, api); - }, - updateTransform: function (payload) { - var _this = this; - var ecModel = this._model; - var api = this._api; - // update before setOption - if (!ecModel) { - return; - } - ecModel.setUpdatePayload(payload); - // ChartView.markUpdateMethod(payload, 'updateTransform'); - var componentDirtyList = []; - ecModel.eachComponent(function (componentType, componentModel) { - if (componentType === 'series') { - return; - } - var componentView = _this.getViewOfComponentModel(componentModel); - if (componentView && componentView.__alive) { - if (componentView.updateTransform) { - var result = componentView.updateTransform(componentModel, ecModel, api, payload); - result && result.update && componentDirtyList.push(componentView); - } else { - componentDirtyList.push(componentView); - } - } - }); - var seriesDirtyMap = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var chartView = _this._chartsMap[seriesModel.__viewId]; - if (chartView.updateTransform) { - var result = chartView.updateTransform(seriesModel, ecModel, api, payload); - result && result.update && seriesDirtyMap.set(seriesModel.uid, 1); - } else { - seriesDirtyMap.set(seriesModel.uid, 1); - } - }); - clearColorPalette(ecModel); - // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. - // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true); - this._scheduler.performVisualTasks(ecModel, payload, { - setDirty: true, - dirtyMap: seriesDirtyMap - }); - // Currently, not call render of components. Geo render cost a lot. - // renderComponents(ecIns, ecModel, api, payload, componentDirtyList); - renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap); - lifecycle.trigger('afterupdate', ecModel, api); - }, - updateView: function (payload) { - var ecModel = this._model; - // update before setOption - if (!ecModel) { - return; - } - ecModel.setUpdatePayload(payload); - ChartView.markUpdateMethod(payload, 'updateView'); - clearColorPalette(ecModel); - // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. - this._scheduler.performVisualTasks(ecModel, payload, { - setDirty: true - }); - render(this, ecModel, this._api, payload, {}); - lifecycle.trigger('afterupdate', ecModel, this._api); - }, - updateVisual: function (payload) { - // updateMethods.update.call(this, payload); - var _this = this; - var ecModel = this._model; - // update before setOption - if (!ecModel) { - return; - } - ecModel.setUpdatePayload(payload); - // clear all visual - ecModel.eachSeries(function (seriesModel) { - seriesModel.getData().clearAllVisual(); - }); - // Perform visual - ChartView.markUpdateMethod(payload, 'updateVisual'); - clearColorPalette(ecModel); - // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. - this._scheduler.performVisualTasks(ecModel, payload, { - visualType: 'visual', - setDirty: true - }); - ecModel.eachComponent(function (componentType, componentModel) { - if (componentType !== 'series') { - var componentView = _this.getViewOfComponentModel(componentModel); - componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload); - } - }); - ecModel.eachSeries(function (seriesModel) { - var chartView = _this._chartsMap[seriesModel.__viewId]; - chartView.updateVisual(seriesModel, ecModel, _this._api, payload); - }); - lifecycle.trigger('afterupdate', ecModel, this._api); - }, - updateLayout: function (payload) { - updateMethods.update.call(this, payload); - } - }; - doConvertPixel = function (ecIns, methodName, finder, value) { - if (ecIns._disposed) { - disposedWarning(ecIns.id); - return; - } - var ecModel = ecIns._model; - var coordSysList = ecIns._coordSysMgr.getCoordinateSystems(); - var result; - var parsedFinder = parseFinder(ecModel, finder); - for (var i = 0; i < coordSysList.length; i++) { - var coordSys = coordSysList[i]; - if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) { - return result; - } - } - if ("development" !== 'production') { - warn('No coordinate system that supports ' + methodName + ' found by the given finder.'); - } - }; - updateStreamModes = function (ecIns, ecModel) { - var chartsMap = ecIns._chartsMap; - var scheduler = ecIns._scheduler; - ecModel.eachSeries(function (seriesModel) { - scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]); - }); - }; - doDispatchAction = function (payload, silent) { - var _this = this; - var ecModel = this.getModel(); - var payloadType = payload.type; - var escapeConnect = payload.escapeConnect; - var actionWrap = actions[payloadType]; - var actionInfo = actionWrap.actionInfo; - var cptTypeTmp = (actionInfo.update || 'update').split(':'); - var updateMethod = cptTypeTmp.pop(); - var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]); - this[IN_MAIN_PROCESS_KEY] = true; - var payloads = [payload]; - var batched = false; - // Batch action - if (payload.batch) { - batched = true; - payloads = map(payload.batch, function (item) { - item = defaults(extend({}, item), payload); - item.batch = null; - return item; - }); - } - var eventObjBatch = []; - var eventObj; - var isSelectChange = isSelectChangePayload(payload); - var isHighDown = isHighDownPayload(payload); - // Only leave blur once if there are multiple batches. - if (isHighDown) { - allLeaveBlur(this._api); - } - each(payloads, function (batchItem) { - // Action can specify the event by return it. - eventObj = actionWrap.action(batchItem, _this._model, _this._api); - // Emit event outside - eventObj = eventObj || extend({}, batchItem); - // Convert type to eventType - eventObj.type = actionInfo.event || eventObj.type; - eventObjBatch.push(eventObj); - // light update does not perform data process, layout and visual. - if (isHighDown) { - var _a = preParseFinder(payload), - queryOptionMap = _a.queryOptionMap, - mainTypeSpecified = _a.mainTypeSpecified; - var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series'; - updateDirectly(_this, updateMethod, batchItem, componentMainType); - markStatusToUpdate(_this); - } else if (isSelectChange) { - // At present `dispatchAction({ type: 'select', ... })` is not supported on components. - // geo still use 'geoselect'. - updateDirectly(_this, updateMethod, batchItem, 'series'); - markStatusToUpdate(_this); - } else if (cptType) { - updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub); - } - }); - if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) { - try { - // Still dirty - if (this[PENDING_UPDATE]) { - prepare(this); - updateMethods.update.call(this, payload); - this[PENDING_UPDATE] = null; - } else { - updateMethods[updateMethod].call(this, payload); - } - } catch (e) { - this[IN_MAIN_PROCESS_KEY] = false; - throw e; - } - } - // Follow the rule of action batch - if (batched) { - eventObj = { - type: actionInfo.event || payloadType, - escapeConnect: escapeConnect, - batch: eventObjBatch - }; - } else { - eventObj = eventObjBatch[0]; - } - this[IN_MAIN_PROCESS_KEY] = false; - if (!silent) { - var messageCenter = this._messageCenter; - messageCenter.trigger(eventObj.type, eventObj); - // Extra triggered 'selectchanged' event - if (isSelectChange) { - var newObj = { - type: 'selectchanged', - escapeConnect: escapeConnect, - selected: getAllSelectedIndices(ecModel), - isFromClick: payload.isFromClick || false, - fromAction: payload.type, - fromActionPayload: payload - }; - messageCenter.trigger(newObj.type, newObj); - } - } - }; - flushPendingActions = function (silent) { - var pendingActions = this._pendingActions; - while (pendingActions.length) { - var payload = pendingActions.shift(); - doDispatchAction.call(this, payload, silent); - } - }; - triggerUpdatedEvent = function (silent) { - !silent && this.trigger('updated'); - }; - /** - * Event `rendered` is triggered when zr - * rendered. It is useful for realtime - * snapshot (reflect animation). - * - * Event `finished` is triggered when: - * (1) zrender rendering finished. - * (2) initial animation finished. - * (3) progressive rendering finished. - * (4) no pending action. - * (5) no delayed setOption needs to be processed. - */ - bindRenderedEvent = function (zr, ecIns) { - zr.on('rendered', function (params) { - ecIns.trigger('rendered', params); - // The `finished` event should not be triggered repeatedly, - // so it should only be triggered when rendering indeed happens - // in zrender. (Consider the case that dipatchAction is keep - // triggering when mouse move). - if ( - // Although zr is dirty if initial animation is not finished - // and this checking is called on frame, we also check - // animation finished for robustness. - zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) { - ecIns.trigger('finished'); - } - }); - }; - bindMouseEvent = function (zr, ecIns) { - zr.on('mouseover', function (e) { - var el = e.target; - var dispatcher = findEventDispatcher(el, isHighDownDispatcher); - if (dispatcher) { - handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api); - markStatusToUpdate(ecIns); - } - }).on('mouseout', function (e) { - var el = e.target; - var dispatcher = findEventDispatcher(el, isHighDownDispatcher); - if (dispatcher) { - handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api); - markStatusToUpdate(ecIns); - } - }).on('click', function (e) { - var el = e.target; - var dispatcher = findEventDispatcher(el, function (target) { - return getECData(target).dataIndex != null; - }, true); - if (dispatcher) { - var actionType = dispatcher.selected ? 'unselect' : 'select'; - var ecData = getECData(dispatcher); - ecIns._api.dispatchAction({ - type: actionType, - dataType: ecData.dataType, - dataIndexInside: ecData.dataIndex, - seriesIndex: ecData.seriesIndex, - isFromClick: true - }); - } - }); - }; - function clearColorPalette(ecModel) { - ecModel.clearColorPalette(); - ecModel.eachSeries(function (seriesModel) { - seriesModel.clearColorPalette(); - }); - } - // Allocate zlevels for series and components - function allocateZlevels(ecModel) { - var componentZLevels = []; - var seriesZLevels = []; - var hasSeparateZLevel = false; - ecModel.eachComponent(function (componentType, componentModel) { - var zlevel = componentModel.get('zlevel') || 0; - var z = componentModel.get('z') || 0; - var zlevelKey = componentModel.getZLevelKey(); - hasSeparateZLevel = hasSeparateZLevel || !!zlevelKey; - (componentType === 'series' ? seriesZLevels : componentZLevels).push({ - zlevel: zlevel, - z: z, - idx: componentModel.componentIndex, - type: componentType, - key: zlevelKey - }); - }); - if (hasSeparateZLevel) { - // Series after component - var zLevels = componentZLevels.concat(seriesZLevels); - var lastSeriesZLevel_1; - var lastSeriesKey_1; - sort(zLevels, function (a, b) { - if (a.zlevel === b.zlevel) { - return a.z - b.z; - } - return a.zlevel - b.zlevel; - }); - each(zLevels, function (item) { - var componentModel = ecModel.getComponent(item.type, item.idx); - var zlevel = item.zlevel; - var key = item.key; - if (lastSeriesZLevel_1 != null) { - zlevel = Math.max(lastSeriesZLevel_1, zlevel); - } - if (key) { - if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) { - zlevel++; - } - lastSeriesKey_1 = key; - } else if (lastSeriesKey_1) { - if (zlevel === lastSeriesZLevel_1) { - zlevel++; - } - lastSeriesKey_1 = ''; - } - lastSeriesZLevel_1 = zlevel; - componentModel.setZLevel(zlevel); - }); - } - } - render = function (ecIns, ecModel, api, payload, updateParams) { - allocateZlevels(ecModel); - renderComponents(ecIns, ecModel, api, payload, updateParams); - each(ecIns._chartsViews, function (chart) { - chart.__alive = false; - }); - renderSeries(ecIns, ecModel, api, payload, updateParams); - // Remove groups of unrendered charts - each(ecIns._chartsViews, function (chart) { - if (!chart.__alive) { - chart.remove(ecModel, api); - } - }); - }; - renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) { - each(dirtyList || ecIns._componentsViews, function (componentView) { - var componentModel = componentView.__model; - clearStates(componentModel, componentView); - componentView.render(componentModel, ecModel, api, payload); - updateZ(componentModel, componentView); - updateStates(componentModel, componentView); - }); - }; - /** - * Render each chart and component - */ - renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) { - // Render all charts - var scheduler = ecIns._scheduler; - updateParams = extend(updateParams || {}, { - updatedSeries: ecModel.getSeries() - }); - // TODO progressive? - lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams); - var unfinished = false; - ecModel.eachSeries(function (seriesModel) { - var chartView = ecIns._chartsMap[seriesModel.__viewId]; - chartView.__alive = true; - var renderTask = chartView.renderTask; - scheduler.updatePayload(renderTask, payload); - // TODO states on marker. - clearStates(seriesModel, chartView); - if (dirtyMap && dirtyMap.get(seriesModel.uid)) { - renderTask.dirty(); - } - if (renderTask.perform(scheduler.getPerformArgs(renderTask))) { - unfinished = true; - } - chartView.group.silent = !!seriesModel.get('silent'); - // Should not call markRedraw on group, because it will disable zrender - // incremental render (always render from the __startIndex each frame) - // chartView.group.markRedraw(); - updateBlend(seriesModel, chartView); - updateSeriesElementSelection(seriesModel); - }); - scheduler.unfinished = unfinished || scheduler.unfinished; - lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams); - // transition after label is layouted. - lifecycle.trigger('series:transition', ecModel, api, updateParams); - ecModel.eachSeries(function (seriesModel) { - var chartView = ecIns._chartsMap[seriesModel.__viewId]; - // Update Z after labels updated. Before applying states. - updateZ(seriesModel, chartView); - // NOTE: Update states after label is updated. - // label should be in normal status when layouting. - updateStates(seriesModel, chartView); - }); - // If use hover layer - updateHoverLayerStatus(ecIns, ecModel); - lifecycle.trigger('series:afterupdate', ecModel, api, updateParams); - }; - markStatusToUpdate = function (ecIns) { - ecIns[STATUS_NEEDS_UPDATE_KEY] = true; - // Wake up zrender if it's sleep. Let it update states in the next frame. - ecIns.getZr().wakeUp(); - }; - applyChangedStates = function (ecIns) { - if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) { - return; - } - ecIns.getZr().storage.traverse(function (el) { - // Not applied on removed elements, it may still in fading. - if (isElementRemoved(el)) { - return; - } - applyElementStates(el); - }); - ecIns[STATUS_NEEDS_UPDATE_KEY] = false; - }; - function applyElementStates(el) { - var newStates = []; - var oldStates = el.currentStates; - // Keep other states. - for (var i = 0; i < oldStates.length; i++) { - var stateName = oldStates[i]; - if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) { - newStates.push(stateName); - } - } - // Only use states when it's exists. - if (el.selected && el.states.select) { - newStates.push('select'); - } - if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) { - newStates.push('emphasis'); - } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) { - newStates.push('blur'); - } - el.useStates(newStates); - } - function updateHoverLayerStatus(ecIns, ecModel) { - var zr = ecIns._zr; - var storage = zr.storage; - var elCount = 0; - storage.traverse(function (el) { - if (!el.isGroup) { - elCount++; - } - }); - if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) { - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.preventUsingHoverLayer) { - return; - } - var chartView = ecIns._chartsMap[seriesModel.__viewId]; - if (chartView.__alive) { - chartView.eachRendered(function (el) { - if (el.states.emphasis) { - el.states.emphasis.hoverLayer = true; - } - }); - } - }); - } - } - /** - * Update chart and blend. - */ - function updateBlend(seriesModel, chartView) { - var blendMode = seriesModel.get('blendMode') || null; - chartView.eachRendered(function (el) { - // FIXME marker and other components - if (!el.isGroup) { - // DON'T mark the element dirty. In case element is incremental and don't want to rerender. - el.style.blend = blendMode; - } - }); - } - function updateZ(model, view) { - if (model.preventAutoZ) { - return; - } - var z = model.get('z') || 0; - var zlevel = model.get('zlevel') || 0; - // Set z and zlevel - view.eachRendered(function (el) { - doUpdateZ(el, z, zlevel, -Infinity); - // Don't traverse the children because it has been traversed in _updateZ. - return true; - }); - } - function doUpdateZ(el, z, zlevel, maxZ2) { - // Group may also have textContent - var label = el.getTextContent(); - var labelLine = el.getTextGuideLine(); - var isGroup = el.isGroup; - if (isGroup) { - // set z & zlevel of children elements of Group - var children = el.childrenRef(); - for (var i = 0; i < children.length; i++) { - maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2); - } - } else { - // not Group - el.z = z; - el.zlevel = zlevel; - maxZ2 = Math.max(el.z2, maxZ2); - } - // always set z and zlevel if label/labelLine exists - if (label) { - label.z = z; - label.zlevel = zlevel; - // lift z2 of text content - // TODO if el.emphasis.z2 is spcefied, what about textContent. - isFinite(maxZ2) && (label.z2 = maxZ2 + 2); - } - if (labelLine) { - var textGuideLineConfig = el.textGuideLineConfig; - labelLine.z = z; - labelLine.zlevel = zlevel; - isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1)); - } - return maxZ2; - } - // Clear states without animation. - // TODO States on component. - function clearStates(model, view) { - view.eachRendered(function (el) { - // Not applied on removed elements, it may still in fading. - if (isElementRemoved(el)) { - return; - } - var textContent = el.getTextContent(); - var textGuide = el.getTextGuideLine(); - if (el.stateTransition) { - el.stateTransition = null; - } - if (textContent && textContent.stateTransition) { - textContent.stateTransition = null; - } - if (textGuide && textGuide.stateTransition) { - textGuide.stateTransition = null; - } - // TODO If el is incremental. - if (el.hasState()) { - el.prevStates = el.currentStates; - el.clearStates(); - } else if (el.prevStates) { - el.prevStates = null; - } - }); - } - function updateStates(model, view) { - var stateAnimationModel = model.getModel('stateAnimation'); - var enableAnimation = model.isAnimationEnabled(); - var duration = stateAnimationModel.get('duration'); - var stateTransition = duration > 0 ? { - duration: duration, - delay: stateAnimationModel.get('delay'), - easing: stateAnimationModel.get('easing') - // additive: stateAnimationModel.get('additive') - } : null; - view.eachRendered(function (el) { - if (el.states && el.states.emphasis) { - // Not applied on removed elements, it may still in fading. - if (isElementRemoved(el)) { - return; - } - if (el instanceof Path) { - savePathStates(el); - } - // Only updated on changed element. In case element is incremental and don't want to rerender. - // TODO, a more proper way? - if (el.__dirty) { - var prevStates = el.prevStates; - // Restore states without animation - if (prevStates) { - el.useStates(prevStates); - } - } - // Update state transition and enable animation again. - if (enableAnimation) { - el.stateTransition = stateTransition; - var textContent = el.getTextContent(); - var textGuide = el.getTextGuideLine(); - // TODO Is it necessary to animate label? - if (textContent) { - textContent.stateTransition = stateTransition; - } - if (textGuide) { - textGuide.stateTransition = stateTransition; - } - } - // Use highlighted and selected flag to toggle states. - if (el.__dirty) { - applyElementStates(el); - } - } - }); - } - createExtensionAPI = function (ecIns) { - return new ( /** @class */function (_super) { - __extends(class_1, _super); - function class_1() { - return _super !== null && _super.apply(this, arguments) || this; - } - class_1.prototype.getCoordinateSystems = function () { - return ecIns._coordSysMgr.getCoordinateSystems(); - }; - class_1.prototype.getComponentByElement = function (el) { - while (el) { - var modelInfo = el.__ecComponentInfo; - if (modelInfo != null) { - return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index); - } - el = el.parent; - } - }; - class_1.prototype.enterEmphasis = function (el, highlightDigit) { - enterEmphasis(el, highlightDigit); - markStatusToUpdate(ecIns); - }; - class_1.prototype.leaveEmphasis = function (el, highlightDigit) { - leaveEmphasis(el, highlightDigit); - markStatusToUpdate(ecIns); - }; - class_1.prototype.enterBlur = function (el) { - enterBlur(el); - markStatusToUpdate(ecIns); - }; - class_1.prototype.leaveBlur = function (el) { - leaveBlur(el); - markStatusToUpdate(ecIns); - }; - class_1.prototype.enterSelect = function (el) { - enterSelect(el); - markStatusToUpdate(ecIns); - }; - class_1.prototype.leaveSelect = function (el) { - leaveSelect(el); - markStatusToUpdate(ecIns); - }; - class_1.prototype.getModel = function () { - return ecIns.getModel(); - }; - class_1.prototype.getViewOfComponentModel = function (componentModel) { - return ecIns.getViewOfComponentModel(componentModel); - }; - class_1.prototype.getViewOfSeriesModel = function (seriesModel) { - return ecIns.getViewOfSeriesModel(seriesModel); - }; - return class_1; - }(ExtensionAPI))(ecIns); - }; - enableConnect = function (chart) { - function updateConnectedChartsStatus(charts, status) { - for (var i = 0; i < charts.length; i++) { - var otherChart = charts[i]; - otherChart[CONNECT_STATUS_KEY] = status; - } - } - each(eventActionMap, function (actionType, eventType) { - chart._messageCenter.on(eventType, function (event) { - if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) { - if (event && event.escapeConnect) { - return; - } - var action_1 = chart.makeActionFromEvent(event); - var otherCharts_1 = []; - each(instances$1, function (otherChart) { - if (otherChart !== chart && otherChart.group === chart.group) { - otherCharts_1.push(otherChart); - } - }); - updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING); - each(otherCharts_1, function (otherChart) { - if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) { - otherChart.dispatchAction(action_1); - } - }); - updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED); - } - }); - }); - }; - }(); - return ECharts; - }(Eventful); - var echartsProto = ECharts.prototype; - echartsProto.on = createRegisterEventWithLowercaseECharts('on'); - echartsProto.off = createRegisterEventWithLowercaseECharts('off'); - /** - * @deprecated - */ - // @ts-ignore - echartsProto.one = function (eventName, cb, ctx) { - var self = this; - deprecateLog('ECharts#one is deprecated.'); - function wrapped() { - var args2 = []; - for (var _i = 0; _i < arguments.length; _i++) { - args2[_i] = arguments[_i]; - } - cb && cb.apply && cb.apply(this, args2); - // @ts-ignore - self.off(eventName, wrapped); - } - // @ts-ignore - this.on.call(this, eventName, wrapped, ctx); - }; - var MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu']; - function disposedWarning(id) { - if ("development" !== 'production') { - warn('Instance ' + id + ' has been disposed'); - } - } - var actions = {}; - /** - * Map eventType to actionType - */ - var eventActionMap = {}; - var dataProcessorFuncs = []; - var optionPreprocessorFuncs = []; - var visualFuncs = []; - var themeStorage = {}; - var loadingEffects = {}; - var instances$1 = {}; - var connectedGroups = {}; - var idBase = +new Date() - 0; - var groupIdBase = +new Date() - 0; - var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; - /** - * @param opts.devicePixelRatio Use window.devicePixelRatio by default - * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart. - * @param opts.width Use clientWidth of the input `dom` by default. - * Can be 'auto' (the same as null/undefined) - * @param opts.height Use clientHeight of the input `dom` by default. - * Can be 'auto' (the same as null/undefined) - * @param opts.locale Specify the locale. - * @param opts.useDirtyRect Enable dirty rectangle rendering or not. - */ - function init$1(dom, theme, opts) { - var isClient = !(opts && opts.ssr); - if (isClient) { - if ("development" !== 'production') { - if (!dom) { - throw new Error('Initialize failed: invalid dom.'); - } - } - var existInstance = getInstanceByDom(dom); - if (existInstance) { - if ("development" !== 'production') { - warn('There is a chart instance already initialized on the dom.'); - } - return existInstance; - } - if ("development" !== 'production') { - if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) { - warn('Can\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.'); - } - } - } - var chart = new ECharts(dom, theme, opts); - chart.id = 'ec_' + idBase++; - instances$1[chart.id] = chart; - isClient && setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id); - enableConnect(chart); - lifecycle.trigger('afterinit', chart); - return chart; - } - /** - * @usage - * (A) - * ```js - * let chart1 = echarts.init(dom1); - * let chart2 = echarts.init(dom2); - * chart1.group = 'xxx'; - * chart2.group = 'xxx'; - * echarts.connect('xxx'); - * ``` - * (B) - * ```js - * let chart1 = echarts.init(dom1); - * let chart2 = echarts.init(dom2); - * echarts.connect('xxx', [chart1, chart2]); - * ``` - */ - function connect(groupId) { - // Is array of charts - if (isArray(groupId)) { - var charts = groupId; - groupId = null; - // If any chart has group - each(charts, function (chart) { - if (chart.group != null) { - groupId = chart.group; - } - }); - groupId = groupId || 'g_' + groupIdBase++; - each(charts, function (chart) { - chart.group = groupId; - }); - } - connectedGroups[groupId] = true; - return groupId; - } - function disconnect(groupId) { - connectedGroups[groupId] = false; - } - /** - * Alias and backward compatibility - * @deprecated - */ - var disConnect = disconnect; - /** - * Dispose a chart instance - */ - function dispose$1(chart) { - if (isString(chart)) { - chart = instances$1[chart]; - } else if (!(chart instanceof ECharts)) { - // Try to treat as dom - chart = getInstanceByDom(chart); - } - if (chart instanceof ECharts && !chart.isDisposed()) { - chart.dispose(); - } - } - function getInstanceByDom(dom) { - return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)]; - } - function getInstanceById(key) { - return instances$1[key]; - } - /** - * Register theme - */ - function registerTheme(name, theme) { - themeStorage[name] = theme; - } - /** - * Register option preprocessor - */ - function registerPreprocessor(preprocessorFunc) { - if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) { - optionPreprocessorFuncs.push(preprocessorFunc); - } - } - function registerProcessor(priority, processor) { - normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT); - } - /** - * Register postIniter - * @param {Function} postInitFunc - */ - function registerPostInit(postInitFunc) { - registerUpdateLifecycle('afterinit', postInitFunc); - } - /** - * Register postUpdater - * @param {Function} postUpdateFunc - */ - function registerPostUpdate(postUpdateFunc) { - registerUpdateLifecycle('afterupdate', postUpdateFunc); - } - function registerUpdateLifecycle(name, cb) { - lifecycle.on(name, cb); - } - function registerAction(actionInfo, eventName, action) { - if (isFunction(eventName)) { - action = eventName; - eventName = ''; - } - var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = { - event: eventName - }][0]; - // Event name is all lowercase - actionInfo.event = (actionInfo.event || actionType).toLowerCase(); - eventName = actionInfo.event; - if (eventActionMap[eventName]) { - // Already registered. - return; - } - // Validate action type and event name. - assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName)); - if (!actions[actionType]) { - actions[actionType] = { - action: action, - actionInfo: actionInfo - }; - } - eventActionMap[eventName] = actionType; - } - function registerCoordinateSystem(type, coordSysCreator) { - CoordinateSystemManager.register(type, coordSysCreator); - } - /** - * Get dimensions of specified coordinate system. - * @param {string} type - * @return {Array.} - */ - function getCoordinateSystemDimensions(type) { - var coordSysCreator = CoordinateSystemManager.get(type); - if (coordSysCreator) { - return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice(); - } - } - function registerLayout(priority, layoutTask) { - normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout'); - } - function registerVisual(priority, visualTask) { - normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual'); - } - var registeredTasks = []; - function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) { - if (isFunction(priority) || isObject(priority)) { - fn = priority; - priority = defaultPriority; - } - if ("development" !== 'production') { - if (isNaN(priority) || priority == null) { - throw new Error('Illegal priority'); - } - // Check duplicate - each(targetList, function (wrap) { - assert(wrap.__raw !== fn); - }); - } - // Already registered - if (indexOf(registeredTasks, fn) >= 0) { - return; - } - registeredTasks.push(fn); - var stageHandler = Scheduler.wrapStageHandler(fn, visualType); - stageHandler.__prio = priority; - stageHandler.__raw = fn; - targetList.push(stageHandler); - } - function registerLoading(name, loadingFx) { - loadingEffects[name] = loadingFx; - } - /** - * ZRender need a canvas context to do measureText. - * But in node environment canvas may be created by node-canvas. - * So we need to specify how to create a canvas instead of using document.createElement('canvas') - * - * - * @deprecated use setPlatformAPI({ createCanvas }) instead. - * - * @example - * let Canvas = require('canvas'); - * let echarts = require('echarts'); - * echarts.setCanvasCreator(function () { - * // Small size is enough. - * return new Canvas(32, 32); - * }); - */ - function setCanvasCreator(creator) { - if ("development" !== 'production') { - deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.'); - } - setPlatformAPI({ - createCanvas: creator - }); - } - /** - * The parameters and usage: see `geoSourceManager.registerMap`. - * Compatible with previous `echarts.registerMap`. - */ - function registerMap(mapName, geoJson, specialAreas) { - var registerMap = getImpl('registerMap'); - registerMap && registerMap(mapName, geoJson, specialAreas); - } - function getMap(mapName) { - var getMap = getImpl('getMap'); - return getMap && getMap(mapName); - } - var registerTransform = registerExternalTransform; - /** - * Globa dispatchAction to a specified chart instance. - */ - // export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters[1]) { - // if (!payload || !payload.chartId) { - // // Must have chartId to find chart - // return; - // } - // const chart = instances[payload.chartId]; - // if (chart) { - // chart.dispatchAction(payload, opt); - // } - // } - // Builtin global visual - registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask); - registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask); - registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask); - registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask); - registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask); - registerVisual(PRIORITY_VISUAL_DECAL, decalVisual); - registerPreprocessor(globalBackwardCompat); - registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack); - registerLoading('default', defaultLoading); - // Default actions - registerAction({ - type: HIGHLIGHT_ACTION_TYPE, - event: HIGHLIGHT_ACTION_TYPE, - update: HIGHLIGHT_ACTION_TYPE - }, noop); - registerAction({ - type: DOWNPLAY_ACTION_TYPE, - event: DOWNPLAY_ACTION_TYPE, - update: DOWNPLAY_ACTION_TYPE - }, noop); - registerAction({ - type: SELECT_ACTION_TYPE, - event: SELECT_ACTION_TYPE, - update: SELECT_ACTION_TYPE - }, noop); - registerAction({ - type: UNSELECT_ACTION_TYPE, - event: UNSELECT_ACTION_TYPE, - update: UNSELECT_ACTION_TYPE - }, noop); - registerAction({ - type: TOGGLE_SELECT_ACTION_TYPE, - event: TOGGLE_SELECT_ACTION_TYPE, - update: TOGGLE_SELECT_ACTION_TYPE - }, noop); - // Default theme - registerTheme('light', lightTheme); - registerTheme('dark', theme); - // For backward compatibility, where the namespace `dataTool` will - // be mounted on `echarts` is the extension `dataTool` is imported. - var dataTool = {}; - - var extensions = []; - var extensionRegisters = { - registerPreprocessor: registerPreprocessor, - registerProcessor: registerProcessor, - registerPostInit: registerPostInit, - registerPostUpdate: registerPostUpdate, - registerUpdateLifecycle: registerUpdateLifecycle, - registerAction: registerAction, - registerCoordinateSystem: registerCoordinateSystem, - registerLayout: registerLayout, - registerVisual: registerVisual, - registerTransform: registerTransform, - registerLoading: registerLoading, - registerMap: registerMap, - registerImpl: registerImpl, - PRIORITY: PRIORITY, - ComponentModel: ComponentModel, - ComponentView: ComponentView, - SeriesModel: SeriesModel, - ChartView: ChartView, - // TODO Use ComponentModel and SeriesModel instead of Constructor - registerComponentModel: function (ComponentModelClass) { - ComponentModel.registerClass(ComponentModelClass); - }, - registerComponentView: function (ComponentViewClass) { - ComponentView.registerClass(ComponentViewClass); - }, - registerSeriesModel: function (SeriesModelClass) { - SeriesModel.registerClass(SeriesModelClass); - }, - registerChartView: function (ChartViewClass) { - ChartView.registerClass(ChartViewClass); - }, - registerSubTypeDefaulter: function (componentType, defaulter) { - ComponentModel.registerSubTypeDefaulter(componentType, defaulter); - }, - registerPainter: function (painterType, PainterCtor) { - registerPainter(painterType, PainterCtor); - } - }; - function use(ext) { - if (isArray(ext)) { - // use([ChartLine, ChartBar]); - each(ext, function (singleExt) { - use(singleExt); - }); - return; - } - if (indexOf(extensions, ext) >= 0) { - return; - } - extensions.push(ext); - if (isFunction(ext)) { - ext = { - install: ext - }; - } - ext.install(extensionRegisters); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 dataIndexMapValueLength(valNumOrArrLengthMoreThan2) { - return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1; - } - function defaultKeyGetter(item) { - return item; - } - var DataDiffer = /** @class */function () { - /** - * @param context Can be visited by this.context in callback. - */ - function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, - // By default: 'oneToOne'. - diffMode) { - this._old = oldArr; - this._new = newArr; - this._oldKeyGetter = oldKeyGetter || defaultKeyGetter; - this._newKeyGetter = newKeyGetter || defaultKeyGetter; - // Visible in callback via `this.context`; - this.context = context; - this._diffModeMultiple = diffMode === 'multiple'; - } - /** - * Callback function when add a data - */ - DataDiffer.prototype.add = function (func) { - this._add = func; - return this; - }; - /** - * Callback function when update a data - */ - DataDiffer.prototype.update = function (func) { - this._update = func; - return this; - }; - /** - * Callback function when update a data and only work in `cbMode: 'byKey'`. - */ - DataDiffer.prototype.updateManyToOne = function (func) { - this._updateManyToOne = func; - return this; - }; - /** - * Callback function when update a data and only work in `cbMode: 'byKey'`. - */ - DataDiffer.prototype.updateOneToMany = function (func) { - this._updateOneToMany = func; - return this; - }; - /** - * Callback function when update a data and only work in `cbMode: 'byKey'`. - */ - DataDiffer.prototype.updateManyToMany = function (func) { - this._updateManyToMany = func; - return this; - }; - /** - * Callback function when remove a data - */ - DataDiffer.prototype.remove = function (func) { - this._remove = func; - return this; - }; - DataDiffer.prototype.execute = function () { - this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne'](); - }; - DataDiffer.prototype._executeOneToOne = function () { - var oldArr = this._old; - var newArr = this._new; - var newDataIndexMap = {}; - var oldDataKeyArr = new Array(oldArr.length); - var newDataKeyArr = new Array(newArr.length); - this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter'); - this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter'); - for (var i = 0; i < oldArr.length; i++) { - var oldKey = oldDataKeyArr[i]; - var newIdxMapVal = newDataIndexMap[oldKey]; - var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); - // idx can never be empty array here. see 'set null' logic below. - if (newIdxMapValLen > 1) { - // 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 newIdx = newIdxMapVal.shift(); - if (newIdxMapVal.length === 1) { - newDataIndexMap[oldKey] = newIdxMapVal[0]; - } - this._update && this._update(newIdx, i); - } else if (newIdxMapValLen === 1) { - newDataIndexMap[oldKey] = null; - this._update && this._update(newIdxMapVal, i); - } else { - this._remove && this._remove(i); - } - } - this._performRestAdd(newDataKeyArr, newDataIndexMap); - }; - /** - * For example, consider the case: - * oldData: [o0, o1, o2, o3, o4, o5, o6, o7], - * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8], - * Where: - * o0, o1, n0 has key 'a' (many to one) - * o5, n4, n5, n6 has key 'b' (one to many) - * o2, n1 has key 'c' (one to one) - * n2, n3 has key 'd' (add) - * o3, o4 has key 'e' (remove) - * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove) - * Then: - * (The order of the following directives are not ensured.) - * this._updateManyToOne(n0, [o0, o1]); - * this._updateOneToMany([n4, n5, n6], o5); - * this._update(n1, o2); - * this._remove(o3); - * this._remove(o4); - * this._remove(o6); - * this._remove(o7); - * this._add(n2); - * this._add(n3); - * this._add(n7); - * this._add(n8); - */ - DataDiffer.prototype._executeMultiple = function () { - var oldArr = this._old; - var newArr = this._new; - var oldDataIndexMap = {}; - var newDataIndexMap = {}; - var oldDataKeyArr = []; - var newDataKeyArr = []; - this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter'); - this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter'); - for (var i = 0; i < oldDataKeyArr.length; i++) { - var oldKey = oldDataKeyArr[i]; - var oldIdxMapVal = oldDataIndexMap[oldKey]; - var newIdxMapVal = newDataIndexMap[oldKey]; - var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal); - var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); - if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) { - this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) { - this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) { - this._update && this._update(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) { - this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen > 1) { - for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) { - this._remove && this._remove(oldIdxMapVal[i_1]); - } - } else { - this._remove && this._remove(oldIdxMapVal); - } - } - this._performRestAdd(newDataKeyArr, newDataIndexMap); - }; - DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) { - for (var i = 0; i < newDataKeyArr.length; i++) { - var newKey = newDataKeyArr[i]; - var newIdxMapVal = newDataIndexMap[newKey]; - var idxMapValLen = dataIndexMapValueLength(newIdxMapVal); - if (idxMapValLen > 1) { - for (var j = 0; j < idxMapValLen; j++) { - this._add && this._add(newIdxMapVal[j]); - } - } else if (idxMapValLen === 1) { - this._add && this._add(newIdxMapVal); - } - // Support both `newDataKeyArr` are duplication removed or not removed. - newDataIndexMap[newKey] = null; - } - }; - DataDiffer.prototype._initIndexMap = function (arr, - // Can be null. - map, - // In 'byKey', the output `keyArr` is duplication removed. - // In 'byIndex', the output `keyArr` is not duplication removed and - // its indices are accurately corresponding to `arr`. - keyArr, keyGetterName) { - var cbModeMultiple = this._diffModeMultiple; - for (var i = 0; i < arr.length; i++) { - // Add prefix to avoid conflict with Object.prototype. - var key = '_ec_' + this[keyGetterName](arr[i], i); - if (!cbModeMultiple) { - keyArr[i] = key; - } - if (!map) { - continue; - } - var idxMapVal = map[key]; - var idxMapValLen = dataIndexMapValueLength(idxMapVal); - if (idxMapValLen === 0) { - // Simple optimize: in most cases, one index has one key, - // do not need array. - map[key] = i; - if (cbModeMultiple) { - keyArr.push(key); - } - } else if (idxMapValLen === 1) { - map[key] = [idxMapVal, i]; - } else { - idxMapVal.push(i); - } - } - }; - return DataDiffer; - }(); - - var DimensionUserOuput = /** @class */function () { - function DimensionUserOuput(encode, dimRequest) { - this._encode = encode; - this._schema = dimRequest; - } - DimensionUserOuput.prototype.get = function () { - return { - // Do not generate full dimension name until fist used. - fullDimensions: this._getFullDimensionNames(), - encode: this._encode - }; - }; - /** - * Get all data store dimension names. - * Theoretically a series data store is defined both by series and used dataset (if any). - * If some dimensions are omitted for performance reason in `this.dimensions`, - * the dimension name may not be auto-generated if user does not specify a dimension name. - * In this case, the dimension name is `null`/`undefined`. - */ - DimensionUserOuput.prototype._getFullDimensionNames = function () { - if (!this._cachedDimNames) { - this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : []; - } - return this._cachedDimNames; - }; - return DimensionUserOuput; - }(); - function summarizeDimensions(data, schema) { - var summary = {}; - var encode = summary.encode = {}; - var notExtraCoordDimMap = createHashMap(); - var defaultedLabel = []; - var defaultedTooltip = []; - var userOutputEncode = {}; - each(data.dimensions, function (dimName) { - var dimItem = data.getDimensionInfo(dimName); - var coordDim = dimItem.coordDim; - if (coordDim) { - if ("development" !== 'production') { - assert(VISUAL_DIMENSIONS.get(coordDim) == null); - } - 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(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name); - } - if (dimItem.defaultTooltip) { - defaultedTooltip.push(dimName); - } - } - VISUAL_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]; - 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.dataDimIndicesOnCoord = map(dataDimsOnCoord, function (dimName) { - return data.getDimensionInfo(dimName).storeDimIndex; - }); - summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra; - var encodeLabel = encode.label; - // FIXME `encode.label` is not recommended, because formatter cannot be set - // in this way. Use label.formatter instead. Maybe 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; - summary.userOutput = new DimensionUserOuput(userOutputEncode, schema); - return summary; - } - function getOrCreateEncodeArr(encode, dim) { - if (!encode.hasOwnProperty(dim)) { - encode[dim] = []; - } - return encode[dim]; - } - // FIXME:TS should be type `AxisType` - 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 - // let dimensions = data.dimensions.slice(); - // let valueType; - // let valueDim; - // while (dimensions.length && ( - // valueDim = dimensions.pop(), - // valueType = data.getDimensionInfo(valueDim).type, - // valueType === 'ordinal' || valueType === 'time' - // )) {} // jshint ignore:line - // return valueDim; - // } - - var SeriesDimensionDefine = /** @class */function () { - /** - * @param opt All of the fields will be shallow copied. - */ - function SeriesDimensionDefine(opt) { - /** - * The format of `otherDims` is: - * ```js - * { - * tooltip?: number - * label?: number - * itemName?: number - * seriesName?: number - * } - * ``` - * - * 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.label` - * label: 1 - * }; - * ``` - * - * This prop should never be `null`/`undefined` after initialized. - */ - this.otherDims = {}; - if (opt != null) { - extend(this, opt); - } - } - return SeriesDimensionDefine; - }(); - - var inner$4 = makeInner(); - var dimTypeShort = { - float: 'f', - int: 'i', - ordinal: 'o', - number: 'n', - time: 't' - }; - /** - * Represents the dimension requirement of a series. - * - * NOTICE: - * When there are too many dimensions in dataset and many series, only the used dimensions - * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`. - * But users may query data by other unused dimension names. - * In this case, users can only query data if and only if they have defined dimension names - * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from - * `source` dimensions. - */ - var SeriesDataSchema = /** @class */function () { - function SeriesDataSchema(opt) { - this.dimensions = opt.dimensions; - this._dimOmitted = opt.dimensionOmitted; - this.source = opt.source; - this._fullDimCount = opt.fullDimensionCount; - this._updateDimOmitted(opt.dimensionOmitted); - } - SeriesDataSchema.prototype.isDimensionOmitted = function () { - return this._dimOmitted; - }; - SeriesDataSchema.prototype._updateDimOmitted = function (dimensionOmitted) { - this._dimOmitted = dimensionOmitted; - if (!dimensionOmitted) { - return; - } - if (!this._dimNameMap) { - this._dimNameMap = ensureSourceDimNameMap(this.source); - } - }; - /** - * @caution Can only be used when `dimensionOmitted: true`. - * - * Get index by user defined dimension name (i.e., not internal generate name). - * That is, get index from `dimensionsDefine`. - * If no `dimensionsDefine`, or no name get, return -1. - */ - SeriesDataSchema.prototype.getSourceDimensionIndex = function (dimName) { - return retrieve2(this._dimNameMap.get(dimName), -1); - }; - /** - * @caution Can only be used when `dimensionOmitted: true`. - * - * Notice: may return `null`/`undefined` if user not specify dimension names. - */ - SeriesDataSchema.prototype.getSourceDimension = function (dimIndex) { - var dimensionsDefine = this.source.dimensionsDefine; - if (dimensionsDefine) { - return dimensionsDefine[dimIndex]; - } - }; - SeriesDataSchema.prototype.makeStoreSchema = function () { - var dimCount = this._fullDimCount; - var willRetrieveDataByName = shouldRetrieveDataByName(this.source); - var makeHashStrict = !shouldOmitUnusedDimensions(dimCount); - // If source don't have dimensions or series don't omit unsed dimensions. - // Generate from seriesDimList directly - var dimHash = ''; - var dims = []; - for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) { - var property = void 0; - var type = void 0; - var ordinalMeta = void 0; - var seriesDimDef = this.dimensions[seriesDimIdx]; - // The list has been sorted by `storeDimIndex` asc. - if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { - property = willRetrieveDataByName ? seriesDimDef.name : null; - type = seriesDimDef.type; - ordinalMeta = seriesDimDef.ordinalMeta; - seriesDimIdx++; - } else { - var sourceDimDef = this.getSourceDimension(fullDimIdx); - if (sourceDimDef) { - property = willRetrieveDataByName ? sourceDimDef.name : null; - type = sourceDimDef.type; - } - } - dims.push({ - property: property, - type: type, - ordinalMeta: ordinalMeta - }); - // If retrieving data by index, - // use to determine whether data can be shared. - // (Because in this case there might be no dimension name defined in dataset, but indices always exists). - // (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash). - // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`), - // use in hash. - if (willRetrieveDataByName && property != null - // For data stack, we have make sure each series has its own dim on this store. - // So we do not add property to hash to make sure they can share this store. - && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) { - dimHash += makeHashStrict - // Use escape character '`' in case that property name contains '$'. - ? property.replace(/\`/g, '`1').replace(/\$/g, '`2') - // For better performance, when there are large dimensions, tolerant this defects that hardly meet. - : property; - } - dimHash += '$'; - dimHash += dimTypeShort[type] || 'f'; - if (ordinalMeta) { - dimHash += ordinalMeta.uid; - } - dimHash += '$'; - } - // Source from endpoint(usually series) will be read differently - // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different. - // So we use this three props as key. - var source = this.source; - var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join('$$'); - return { - dimensions: dims, - hash: hash - }; - }; - SeriesDataSchema.prototype.makeOutputDimensionNames = function () { - var result = []; - for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) { - var name_1 = void 0; - var seriesDimDef = this.dimensions[seriesDimIdx]; - // The list has been sorted by `storeDimIndex` asc. - if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { - if (!seriesDimDef.isCalculationCoord) { - name_1 = seriesDimDef.name; - } - seriesDimIdx++; - } else { - var sourceDimDef = this.getSourceDimension(fullDimIdx); - if (sourceDimDef) { - name_1 = sourceDimDef.name; - } - } - result.push(name_1); - } - return result; - }; - SeriesDataSchema.prototype.appendCalculationDimension = function (dimDef) { - this.dimensions.push(dimDef); - dimDef.isCalculationCoord = true; - this._fullDimCount++; - // If append dimension on a data store, consider the store - // might be shared by different series, series dimensions not - // really map to store dimensions. - this._updateDimOmitted(true); - }; - return SeriesDataSchema; - }(); - function isSeriesDataSchema(schema) { - return schema instanceof SeriesDataSchema; - } - function createDimNameMap(dimsDef) { - var dataDimNameMap = createHashMap(); - for (var i = 0; i < (dimsDef || []).length; i++) { - var dimDefItemRaw = dimsDef[i]; - var userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw; - if (userDimName != null && dataDimNameMap.get(userDimName) == null) { - dataDimNameMap.set(userDimName, i); - } - } - return dataDimNameMap; - } - function ensureSourceDimNameMap(source) { - var innerSource = inner$4(source); - return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine)); - } - function shouldOmitUnusedDimensions(dimCount) { - return dimCount > 30; - } - - var isObject$2 = isObject; - var map$1 = map; - var CtorInt32Array$1 = typeof Int32Array === 'undefined' ? Array : Int32Array; - // Use prefix to avoid index to be the same as otherIdList[idx], - // which will cause weird update animation. - var ID_PREFIX = 'e\0\0'; - var INDEX_NOT_FOUND = -1; - // type SeriesDimensionIndex = DimensionIndex; - var TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_dimSummary', 'userOutput', '_rawData', '_dimValueGetter', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount']; - var CLONE_PROPERTIES = ['_approximateExtent']; - // ----------------------------- - // Internal method declarations: - // ----------------------------- - var prepareInvertedIndex; - var getId; - var getIdNameFromStore; - var normalizeDimensions; - var transferProperties; - var cloneListForMapAndSample; - var makeIdFromName; - var SeriesData = /** @class */function () { - /** - * @param dimensionsInput.dimensions - * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...]. - * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius - */ - function SeriesData(dimensionsInput, hostModel) { - this.type = 'list'; - this._dimOmitted = false; - this._nameList = []; - this._idList = []; - // Models of data option is stored sparse for optimizing memory cost - // Never used yet (not used yet). - // private _optionModels: Model[] = []; - // Global visual properties after visual coding - this._visual = {}; - // Global layout properties. - this._layout = {}; - // Item visual properties after visual coding - this._itemVisuals = []; - // Item layout properties after layout - this._itemLayouts = []; - // Graphic elements - this._graphicEls = []; - // key: dim, value: extent - this._approximateExtent = {}; - this._calculationInfo = {}; - // Having detected that there is data item is non primitive type - // (in type `OptionDataItemObject`). - // Like `data: [ { value: xx, itemStyle: {...} }, ...]` - // At present it only happen in `SOURCE_FORMAT_ORIGINAL`. - this.hasItemOption = false; - // Methods that create a new list based on this list should be listed here. - // Notice that those method should `RETURN` the new list. - this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; - // Methods that change indices of this list should be listed here. - this.CHANGABLE_METHODS = ['filterSelf', 'selectRange']; - this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample']; - var dimensions; - var assignStoreDimIdx = false; - if (isSeriesDataSchema(dimensionsInput)) { - dimensions = dimensionsInput.dimensions; - this._dimOmitted = dimensionsInput.isDimensionOmitted(); - this._schema = dimensionsInput; - } else { - assignStoreDimIdx = true; - dimensions = dimensionsInput; - } - dimensions = dimensions || ['x', 'y']; - var dimensionInfos = {}; - var dimensionNames = []; - var invertedIndicesMap = {}; - var needsHasOwn = false; - var emptyObj = {}; - for (var i = 0; i < dimensions.length; i++) { - // Use the original dimensions[i], where other flag props may exists. - var dimInfoInput = dimensions[i]; - var dimensionInfo = isString(dimInfoInput) ? new SeriesDimensionDefine({ - name: dimInfoInput - }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput; - var dimensionName = dimensionInfo.name; - dimensionInfo.type = dimensionInfo.type || 'float'; - if (!dimensionInfo.coordDim) { - dimensionInfo.coordDim = dimensionName; - dimensionInfo.coordDimIndex = 0; - } - var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {}; - dimensionNames.push(dimensionName); - dimensionInfos[dimensionName] = dimensionInfo; - if (emptyObj[dimensionName] != null) { - needsHasOwn = true; - } - if (dimensionInfo.createInvertedIndices) { - invertedIndicesMap[dimensionName] = []; - } - if (otherDims.itemName === 0) { - this._nameDimIdx = i; - } - if (otherDims.itemId === 0) { - this._idDimIdx = i; - } - if ("development" !== 'production') { - assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0); - } - if (assignStoreDimIdx) { - dimensionInfo.storeDimIndex = i; - } - } - this.dimensions = dimensionNames; - this._dimInfos = dimensionInfos; - this._initGetDimensionInfo(needsHasOwn); - this.hostModel = hostModel; - this._invertedIndicesMap = invertedIndicesMap; - if (this._dimOmitted) { - var dimIdxToName_1 = this._dimIdxToName = createHashMap(); - each(dimensionNames, function (dimName) { - dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName); - }); - } - } - /** - * - * Get concrete dimension name by dimension name or dimension index. - * If input a dimension name, do not validate whether the dimension name exits. - * - * @caution - * @param dim Must make sure the dimension is `SeriesDimensionLoose`. - * Because only those dimensions will have auto-generated dimension names if not - * have a user-specified name, and other dimensions will get a return of null/undefined. - * - * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples: - * ```js - * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx); - * ``` - * - * @return Concrete dim name. - */ - SeriesData.prototype.getDimension = function (dim) { - var dimIdx = this._recognizeDimIndex(dim); - if (dimIdx == null) { - return dim; - } - dimIdx = dim; - if (!this._dimOmitted) { - return this.dimensions[dimIdx]; - } - // Retrieve from series dimension definition because it probably contains - // generated dimension name (like 'x', 'y'). - var dimName = this._dimIdxToName.get(dimIdx); - if (dimName != null) { - return dimName; - } - var sourceDimDef = this._schema.getSourceDimension(dimIdx); - if (sourceDimDef) { - return sourceDimDef.name; - } - }; - /** - * Get dimension index in data store. Return -1 if not found. - * Can be used to index value from getRawValue. - */ - SeriesData.prototype.getDimensionIndex = function (dim) { - var dimIdx = this._recognizeDimIndex(dim); - if (dimIdx != null) { - return dimIdx; - } - if (dim == null) { - return -1; - } - var dimInfo = this._getDimInfo(dim); - return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1; - }; - /** - * The meanings of the input parameter `dim`: - * - * + If dim is a number (e.g., `1`), it means the index of the dimension. - * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'. - * + If dim is a number-like string (e.g., `"1"`): - * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`, - * it means that concrete name. - * + If not, it will be converted to a number, which means the index of the dimension. - * (why? because of the backward compatibility. We have been tolerating number-like string in - * dimension setting, although now it seems that it is not a good idea.) - * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`, - * if no dimension name is defined as `"1"`. - * + If dim is a not-number-like string, it means the concrete dim name. - * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`, - * or customized in `dimensions` property of option like `"age"`. - * - * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`). - */ - SeriesData.prototype._recognizeDimIndex = function (dim) { - if (isNumber(dim) - // If being a number-like string but not being defined as a dimension name. - || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) { - return +dim; - } - }; - SeriesData.prototype._getStoreDimIndex = function (dim) { - var dimIdx = this.getDimensionIndex(dim); - if ("development" !== 'production') { - if (dimIdx == null) { - throw new Error('Unknown dimension ' + dim); - } - } - return dimIdx; - }; - /** - * Get type and calculation info of particular dimension - * @param dim - * Dimension can be concrete names like x, y, z, lng, lat, angle, radius - * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius' - */ - SeriesData.prototype.getDimensionInfo = function (dim) { - // Do not clone, because there may be categories in dimInfo. - return this._getDimInfo(this.getDimension(dim)); - }; - SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) { - var dimensionInfos = this._dimInfos; - this._getDimInfo = needsHasOwn ? function (dimName) { - return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined; - } : function (dimName) { - return dimensionInfos[dimName]; - }; - }; - /** - * concrete dimension name list on coord. - */ - SeriesData.prototype.getDimensionsOnCoord = function () { - return this._dimSummary.dataDimsOnCoord.slice(); - }; - SeriesData.prototype.mapDimension = function (coordDim, idx) { - var dimensionsSummary = this._dimSummary; - if (idx == null) { - return dimensionsSummary.encodeFirstDimNotExtra[coordDim]; - } - var dims = dimensionsSummary.encode[coordDim]; - return dims ? dims[idx] : null; - }; - SeriesData.prototype.mapDimensionsAll = function (coordDim) { - var dimensionsSummary = this._dimSummary; - var dims = dimensionsSummary.encode[coordDim]; - return (dims || []).slice(); - }; - SeriesData.prototype.getStore = function () { - return this._store; - }; - /** - * Initialize from data - * @param data source or data or data store. - * @param nameList The name of a datum is used on data diff and - * default label/tooltip. - * A name can be specified in encode.itemName, - * or dataItem.name (only for series option data), - * or provided in nameList from outside. - */ - SeriesData.prototype.initData = function (data, nameList, dimValueGetter) { - var _this = this; - var store; - if (data instanceof DataStore) { - store = data; - } - if (!store) { - var dimensions = this.dimensions; - var provider = isSourceInstance(data) || isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data; - store = new DataStore(); - var dimensionInfos = map$1(dimensions, function (dimName) { - return { - type: _this._dimInfos[dimName].type, - property: dimName - }; - }); - store.initData(provider, dimensionInfos, dimValueGetter); - } - this._store = store; - // Reset - this._nameList = (nameList || []).slice(); - this._idList = []; - this._nameRepeatCount = {}; - this._doInit(0, store.count()); - // Cache summary info for fast visit. See "dimensionHelper". - // Needs to be initialized after store is prepared. - this._dimSummary = summarizeDimensions(this, this._schema); - this.userOutput = this._dimSummary.userOutput; - }; - /** - * Caution: Can be only called on raw data (before `this._indices` created). - */ - SeriesData.prototype.appendData = function (data) { - var range = this._store.appendData(data); - this._doInit(range[0], range[1]); - }; - /** - * Caution: Can be only called on raw data (before `this._indices` created). - * This method does not modify `rawData` (`dataProvider`), but only - * add values to store. - * - * The final count will be increased by `Math.max(values.length, names.length)`. - * - * @param values That is the SourceType: 'arrayRows', like - * [ - * [12, 33, 44], - * [NaN, 43, 1], - * ['-', 'asdf', 0] - * ] - * Each item is exactly corresponding to a dimension. - */ - SeriesData.prototype.appendValues = function (values, names) { - var _a = this._store.appendValues(values, names.length), - start = _a.start, - end = _a.end; - var shouldMakeIdFromName = this._shouldMakeIdFromName(); - this._updateOrdinalMeta(); - if (names) { - for (var idx = start; idx < end; idx++) { - var sourceIdx = idx - start; - this._nameList[idx] = names[sourceIdx]; - if (shouldMakeIdFromName) { - makeIdFromName(this, idx); - } - } - } - }; - SeriesData.prototype._updateOrdinalMeta = function () { - var store = this._store; - var dimensions = this.dimensions; - for (var i = 0; i < dimensions.length; i++) { - var dimInfo = this._dimInfos[dimensions[i]]; - if (dimInfo.ordinalMeta) { - store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta); - } - } - }; - SeriesData.prototype._shouldMakeIdFromName = function () { - var provider = this._store.getProvider(); - return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage; - }; - SeriesData.prototype._doInit = function (start, end) { - if (start >= end) { - return; - } - var store = this._store; - var provider = store.getProvider(); - this._updateOrdinalMeta(); - var nameList = this._nameList; - var idList = this._idList; - var sourceFormat = provider.getSource().sourceFormat; - var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; - // Each data item is value - // [1, 2] - // 2 - // Bar chart, line chart which uses category axis - // only gives the 'y' value. 'x' value is the indices of category - // Use a tempValue to normalize the value to be a (x, y) value - // If dataItem is {name: ...} or {id: ...}, it has highest priority. - // This kind of ids and names are always stored `_nameList` and `_idList`. - if (isFormatOriginal && !provider.pure) { - var sharedDataItem = []; - for (var idx = start; idx < end; idx++) { - // NOTICE: Try not to write things into dataItem - var dataItem = provider.getItem(idx, sharedDataItem); - if (!this.hasItemOption && isDataItemOption(dataItem)) { - this.hasItemOption = true; - } - if (dataItem) { - var itemName = dataItem.name; - if (nameList[idx] == null && itemName != null) { - nameList[idx] = convertOptionIdName(itemName, null); - } - var itemId = dataItem.id; - if (idList[idx] == null && itemId != null) { - idList[idx] = convertOptionIdName(itemId, null); - } - } - } - } - if (this._shouldMakeIdFromName()) { - for (var idx = start; idx < end; idx++) { - makeIdFromName(this, idx); - } - } - prepareInvertedIndex(this); - }; - /** - * PENDING: In fact currently this function is only used to short-circuit - * the calling of `scale.unionExtentFromData` when data have been filtered by modules - * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on - * an axis, but if a "axis related data filter module" is used, the extent of the axis have - * been fixed and no need to calling `scale.unionExtentFromData` actually. - * But if we add "custom data filter" in future, which is not "axis related", this method may - * be still needed. - * - * Optimize for the scenario that data is filtered by a given extent. - * Consider that if data amount is more than hundreds of thousand, - * extent calculation will cost more than 10ms and the cache will - * be erased because of the filtering. - */ - SeriesData.prototype.getApproximateExtent = function (dim) { - return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim)); - }; - /** - * Calculate extent on a filtered data might be time consuming. - * Approximate extent is only used for: calculate extent of filtered data outside. - */ - SeriesData.prototype.setApproximateExtent = function (extent, dim) { - dim = this.getDimension(dim); - this._approximateExtent[dim] = extent.slice(); - }; - SeriesData.prototype.getCalculationInfo = function (key) { - return this._calculationInfo[key]; - }; - SeriesData.prototype.setCalculationInfo = function (key, value) { - isObject$2(key) ? extend(this._calculationInfo, key) : this._calculationInfo[key] = value; - }; - /** - * @return Never be null/undefined. `number` will be converted to string. Because: - * In most cases, name is used in display, where returning a string is more convenient. - * In other cases, name is used in query (see `indexOfName`), where we can keep the - * rule that name `2` equals to name `'2'`. - */ - SeriesData.prototype.getName = function (idx) { - var rawIndex = this.getRawIndex(idx); - var name = this._nameList[rawIndex]; - if (name == null && this._nameDimIdx != null) { - name = getIdNameFromStore(this, this._nameDimIdx, rawIndex); - } - if (name == null) { - name = ''; - } - return name; - }; - SeriesData.prototype._getCategory = function (dimIdx, idx) { - var ordinal = this._store.get(dimIdx, idx); - var ordinalMeta = this._store.getOrdinalMeta(dimIdx); - if (ordinalMeta) { - return ordinalMeta.categories[ordinal]; - } - return ordinal; - }; - /** - * @return Never null/undefined. `number` will be converted to string. Because: - * In all cases having encountered at present, id is used in making diff comparison, which - * are usually based on hash map. We can keep the rule that the internal id are always string - * (treat `2` is the same as `'2'`) to make the related logic simple. - */ - SeriesData.prototype.getId = function (idx) { - return getId(this, this.getRawIndex(idx)); - }; - SeriesData.prototype.count = function () { - return this._store.count(); - }; - /** - * Get value. Return NaN if idx is out of range. - * - * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead. - */ - SeriesData.prototype.get = function (dim, idx) { - var store = this._store; - var dimInfo = this._dimInfos[dim]; - if (dimInfo) { - return store.get(dimInfo.storeDimIndex, idx); - } - }; - /** - * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead. - */ - SeriesData.prototype.getByRawIndex = function (dim, rawIdx) { - var store = this._store; - var dimInfo = this._dimInfos[dim]; - if (dimInfo) { - return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx); - } - }; - SeriesData.prototype.getIndices = function () { - return this._store.getIndices(); - }; - SeriesData.prototype.getDataExtent = function (dim) { - return this._store.getDataExtent(this._getStoreDimIndex(dim)); - }; - SeriesData.prototype.getSum = function (dim) { - return this._store.getSum(this._getStoreDimIndex(dim)); - }; - SeriesData.prototype.getMedian = function (dim) { - return this._store.getMedian(this._getStoreDimIndex(dim)); - }; - SeriesData.prototype.getValues = function (dimensions, idx) { - var _this = this; - var store = this._store; - return isArray(dimensions) ? store.getValues(map$1(dimensions, function (dim) { - return _this._getStoreDimIndex(dim); - }), idx) : store.getValues(dimensions); - }; - /** - * If value is NaN. Including '-' - * Only check the coord dimensions. - */ - SeriesData.prototype.hasValue = function (idx) { - var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord; - for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) { - // Ordinal type originally can be string or number. - // But when an ordinal type is used on coord, it can - // not be string but only number. So we can also use isNaN. - if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) { - return false; - } - } - return true; - }; - /** - * Retrieve the index with given name - */ - SeriesData.prototype.indexOfName = function (name) { - for (var i = 0, len = this._store.count(); i < len; i++) { - if (this.getName(i) === name) { - return i; - } - } - return -1; - }; - SeriesData.prototype.getRawIndex = function (idx) { - return this._store.getRawIndex(idx); - }; - SeriesData.prototype.indexOfRawIndex = function (rawIndex) { - return this._store.indexOfRawIndex(rawIndex); - }; - /** - * Only support the dimension which inverted index created. - * Do not support other cases until required. - * @param dim concrete dim - * @param value ordinal index - * @return rawIndex - */ - SeriesData.prototype.rawIndexOf = function (dim, value) { - var invertedIndices = dim && this._invertedIndicesMap[dim]; - if ("development" !== 'production') { - if (!invertedIndices) { - throw new Error('Do not supported yet'); - } - } - var rawIndex = invertedIndices[value]; - if (rawIndex == null || isNaN(rawIndex)) { - return INDEX_NOT_FOUND; - } - return rawIndex; - }; - /** - * Retrieve the index of nearest value - * @param dim - * @param value - * @param [maxDistance=Infinity] - * @return If and only if multiple indices has - * the same value, they are put to the result. - */ - SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) { - return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance); - }; - SeriesData.prototype.each = function (dims, cb, ctx) { - - if (isFunction(dims)) { - ctx = cb; - cb = dims; - dims = []; - } - // ctxCompat just for compat echarts3 - var fCtx = ctx || this; - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); - this._store.each(dimIndices, fCtx ? bind(cb, fCtx) : cb); - }; - SeriesData.prototype.filterSelf = function (dims, cb, ctx) { - - if (isFunction(dims)) { - ctx = cb; - cb = dims; - dims = []; - } - // ctxCompat just for compat echarts3 - var fCtx = ctx || this; - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); - this._store = this._store.filter(dimIndices, fCtx ? bind(cb, fCtx) : cb); - return this; - }; - /** - * Select data in range. (For optimization of filter) - * (Manually inline code, support 5 million data filtering in data zoom.) - */ - SeriesData.prototype.selectRange = function (range) { - - var _this = this; - var innerRange = {}; - var dims = keys(range); - each(dims, function (dim) { - var dimIdx = _this._getStoreDimIndex(dim); - innerRange[dimIdx] = range[dim]; - }); - this._store = this._store.selectRange(innerRange); - return this; - }; - /* eslint-enable max-len */ - SeriesData.prototype.mapArray = function (dims, cb, ctx) { - - if (isFunction(dims)) { - ctx = cb; - cb = dims; - dims = []; - } - // ctxCompat just for compat echarts3 - ctx = ctx || this; - var result = []; - this.each(dims, function () { - result.push(cb && cb.apply(this, arguments)); - }, ctx); - return result; - }; - SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) { - - // ctxCompat just for compat echarts3 - var fCtx = ctx || ctxCompat || this; - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); - var list = cloneListForMapAndSample(this); - list._store = this._store.map(dimIndices, fCtx ? bind(cb, fCtx) : cb); - return list; - }; - SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) { - var _this = this; - // ctxCompat just for compat echarts3 - var fCtx = ctx || ctxCompat || this; - if ("development" !== 'production') { - each(normalizeDimensions(dims), function (dim) { - var dimInfo = _this.getDimensionInfo(dim); - if (!dimInfo.isCalculationCoord) { - console.error('Danger: only stack dimension can be modified'); - } - }); - } - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); - // If do shallow clone here, if there are too many stacked series, - // it still cost lots of memory, because `_store.dimensions` are not shared. - // We should consider there probably be shallow clone happen in each series - // in consequent filter/map. - this._store.modify(dimIndices, fCtx ? bind(cb, fCtx) : cb); - }; - /** - * Large data down sampling on given dimension - * @param sampleIndex Sample index for name and id - */ - SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) { - var list = cloneListForMapAndSample(this); - list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex); - return list; - }; - /** - * Large data down sampling using largest-triangle-three-buckets - * @param {string} valueDimension - * @param {number} targetCount - */ - SeriesData.prototype.lttbDownSample = function (valueDimension, rate) { - var list = cloneListForMapAndSample(this); - list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate); - return list; - }; - SeriesData.prototype.getRawDataItem = function (idx) { - return this._store.getRawDataItem(idx); - }; - /** - * Get model of one data item. - */ - // TODO: Type of data item - SeriesData.prototype.getItemModel = function (idx) { - var hostModel = this.hostModel; - var dataItem = this.getRawDataItem(idx); - return new Model(dataItem, hostModel, hostModel && hostModel.ecModel); - }; - /** - * Create a data differ - */ - SeriesData.prototype.diff = function (otherList) { - var thisList = this; - return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) { - return getId(otherList, idx); - }, function (idx) { - return getId(thisList, idx); - }); - }; - /** - * Get visual property. - */ - SeriesData.prototype.getVisual = function (key) { - var visual = this._visual; - return visual && visual[key]; - }; - SeriesData.prototype.setVisual = function (kvObj, val) { - this._visual = this._visual || {}; - if (isObject$2(kvObj)) { - extend(this._visual, kvObj); - } else { - this._visual[kvObj] = val; - } - }; - /** - * Get visual property of single data item - */ - // eslint-disable-next-line - SeriesData.prototype.getItemVisual = function (idx, key) { - var itemVisual = this._itemVisuals[idx]; - var val = itemVisual && itemVisual[key]; - if (val == null) { - // Use global visual property - return this.getVisual(key); - } - return val; - }; - /** - * If exists visual property of single data item - */ - SeriesData.prototype.hasItemVisual = function () { - return this._itemVisuals.length > 0; - }; - /** - * Make sure itemVisual property is unique - */ - // TODO: use key to save visual to reduce memory. - SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) { - var itemVisuals = this._itemVisuals; - var itemVisual = itemVisuals[idx]; - if (!itemVisual) { - itemVisual = itemVisuals[idx] = {}; - } - var val = itemVisual[key]; - if (val == null) { - val = this.getVisual(key); - // TODO Performance? - if (isArray(val)) { - val = val.slice(); - } else if (isObject$2(val)) { - val = extend({}, val); - } - itemVisual[key] = val; - } - return val; - }; - // eslint-disable-next-line - SeriesData.prototype.setItemVisual = function (idx, key, value) { - var itemVisual = this._itemVisuals[idx] || {}; - this._itemVisuals[idx] = itemVisual; - if (isObject$2(key)) { - extend(itemVisual, key); - } else { - itemVisual[key] = value; - } - }; - /** - * Clear itemVisuals and list visual. - */ - SeriesData.prototype.clearAllVisual = function () { - this._visual = {}; - this._itemVisuals = []; - }; - SeriesData.prototype.setLayout = function (key, val) { - isObject$2(key) ? extend(this._layout, key) : this._layout[key] = val; - }; - /** - * Get layout property. - */ - SeriesData.prototype.getLayout = function (key) { - return this._layout[key]; - }; - /** - * Get layout of single data item - */ - SeriesData.prototype.getItemLayout = function (idx) { - return this._itemLayouts[idx]; - }; - /** - * Set layout of single data item - */ - SeriesData.prototype.setItemLayout = function (idx, layout, merge) { - this._itemLayouts[idx] = merge ? extend(this._itemLayouts[idx] || {}, layout) : layout; - }; - /** - * Clear all layout of single data item - */ - SeriesData.prototype.clearItemLayouts = function () { - this._itemLayouts.length = 0; - }; - /** - * Set graphic element relative to data. It can be set as null - */ - SeriesData.prototype.setItemGraphicEl = function (idx, el) { - var seriesIndex = this.hostModel && this.hostModel.seriesIndex; - setCommonECData(seriesIndex, this.dataType, idx, el); - this._graphicEls[idx] = el; - }; - SeriesData.prototype.getItemGraphicEl = function (idx) { - return this._graphicEls[idx]; - }; - SeriesData.prototype.eachItemGraphicEl = function (cb, context) { - each(this._graphicEls, function (el, idx) { - if (el) { - cb && cb.call(context, el, idx); - } - }); - }; - /** - * Shallow clone a new list except visual and layout properties, and graph elements. - * New list only change the indices. - */ - SeriesData.prototype.cloneShallow = function (list) { - if (!list) { - list = new SeriesData(this._schema ? this._schema : map$1(this.dimensions, this._getDimInfo, this), this.hostModel); - } - transferProperties(list, this); - list._store = this._store; - return list; - }; - /** - * Wrap some method to add more feature - */ - SeriesData.prototype.wrapMethod = function (methodName, injectFunction) { - var originalMethod = this[methodName]; - if (!isFunction(originalMethod)) { - return; - } - this.__wrappedMethods = this.__wrappedMethods || []; - this.__wrappedMethods.push(methodName); - this[methodName] = function () { - var res = originalMethod.apply(this, arguments); - return injectFunction.apply(this, [res].concat(slice(arguments))); - }; - }; - // ---------------------------------------------------------- - // A work around for internal method visiting private member. - // ---------------------------------------------------------- - SeriesData.internalField = function () { - prepareInvertedIndex = function (data) { - var invertedIndicesMap = data._invertedIndicesMap; - each(invertedIndicesMap, function (invertedIndices, dim) { - var dimInfo = data._dimInfos[dim]; - // Currently, only dimensions that has ordinalMeta can create inverted indices. - var ordinalMeta = dimInfo.ordinalMeta; - var store = data._store; - if (ordinalMeta) { - invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array$1(ordinalMeta.categories.length); - // The default value of TypedArray is 0. To avoid miss - // mapping to 0, we should set it as INDEX_NOT_FOUND. - for (var i = 0; i < invertedIndices.length; i++) { - invertedIndices[i] = INDEX_NOT_FOUND; - } - for (var i = 0; i < store.count(); i++) { - // Only support the case that all values are distinct. - invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i; - } - } - }); - }; - getIdNameFromStore = function (data, dimIdx, idx) { - return convertOptionIdName(data._getCategory(dimIdx, idx), null); - }; - /** - * @see the comment of `List['getId']`. - */ - getId = function (data, rawIndex) { - var id = data._idList[rawIndex]; - if (id == null && data._idDimIdx != null) { - id = getIdNameFromStore(data, data._idDimIdx, rawIndex); - } - if (id == null) { - id = ID_PREFIX + rawIndex; - } - return id; - }; - normalizeDimensions = function (dimensions) { - if (!isArray(dimensions)) { - dimensions = dimensions != null ? [dimensions] : []; - } - return dimensions; - }; - /** - * Data in excludeDimensions is copied, otherwise transferred. - */ - cloneListForMapAndSample = function (original) { - var list = new SeriesData(original._schema ? original._schema : map$1(original.dimensions, original._getDimInfo, original), original.hostModel); - // FIXME If needs stackedOn, value may already been stacked - transferProperties(list, original); - return list; - }; - transferProperties = function (target, source) { - each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) { - if (source.hasOwnProperty(propName)) { - target[propName] = source[propName]; - } - }); - target.__wrappedMethods = source.__wrappedMethods; - each(CLONE_PROPERTIES, function (propName) { - target[propName] = clone(source[propName]); - }); - target._calculationInfo = extend({}, source._calculationInfo); - }; - makeIdFromName = function (data, idx) { - var nameList = data._nameList; - var idList = data._idList; - var nameDimIdx = data._nameDimIdx; - var idDimIdx = data._idDimIdx; - var name = nameList[idx]; - var id = idList[idx]; - if (name == null && nameDimIdx != null) { - nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx); - } - if (id == null && idDimIdx != null) { - idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx); - } - if (id == null && name != null) { - var nameRepeatCount = data._nameRepeatCount; - var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1; - id = name; - if (nmCnt > 1) { - id += '__ec__' + nmCnt; - } - idList[idx] = id; - } - }; - }(); - return SeriesData; - }(); - - /** - * For outside usage compat (like echarts-gl are using it). - */ - function createDimensions(source, opt) { - return prepareSeriesDataSchema(source, opt).dimensions; - } - /** - * This method builds the relationship between: - * + "what the coord sys or series requires (see `coordDimensions`)", - * + "what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)" - * + "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'. - * - * @return The results are always sorted by `storeDimIndex` asc. - */ - function prepareSeriesDataSchema( - // TODO: TYPE completeDimensions type - source, opt) { - if (!isSourceInstance(source)) { - source = createSourceFromSeriesDataOption(source); - } - opt = opt || {}; - var sysDims = opt.coordDimensions || []; - var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || []; - var coordDimNameMap = createHashMap(); - var resultList = []; - var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount); - // Try to ignore unused dimensions if sharing a high dimension datastore - // 30 is an experience value. - var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount); - var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine; - var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef); - var encodeDef = opt.encodeDefine; - if (!encodeDef && opt.encodeDefaulter) { - encodeDef = opt.encodeDefaulter(source, dimCount); - } - var encodeDefMap = createHashMap(encodeDef); - var indicesMap = new CtorInt32Array(dimCount); - for (var i = 0; i < indicesMap.length; i++) { - indicesMap[i] = -1; - } - function getResultItem(dimIdx) { - var idx = indicesMap[dimIdx]; - if (idx < 0) { - var dimDefItemRaw = dimsDef[dimIdx]; - var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : { - name: dimDefItemRaw - }; - var resultItem = new SeriesDimensionDefine(); - var userDimName = dimDefItem.name; - if (userDimName != null && dataDimNameMap.get(userDimName) != null) { - // Only if `series.dimensions` is defined in option - // displayName, will be set, and dimension will be displayed vertically in - // tooltip by default. - resultItem.name = resultItem.displayName = userDimName; - } - dimDefItem.type != null && (resultItem.type = dimDefItem.type); - dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); - var newIdx = resultList.length; - indicesMap[dimIdx] = newIdx; - resultItem.storeDimIndex = dimIdx; - resultList.push(resultItem); - return resultItem; - } - return resultList[idx]; - } - if (!omitUnusedDimensions) { - for (var i = 0; i < dimCount; i++) { - getResultItem(i); - } - } - // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`. - encodeDefMap.each(function (dataDimsRaw, coordDim) { - var dataDims = normalizeToArray(dataDimsRaw).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) { - encodeDefMap.set(coordDim, false); - return; - } - var validDataDims = encodeDefMap.set(coordDim, []); - each(dataDims, function (resultDimIdxOrName, idx) { - // The input resultDimIdx can be dim name or index. - var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName; - if (resultDimIdx != null && resultDimIdx < dimCount) { - validDataDims[idx] = resultDimIdx; - applyDim(getResultItem(resultDimIdx), coordDim, idx); - } - }); - }); - // Apply templates and default order from `sysDims`. - var availDimIdx = 0; - each(sysDims, function (sysDimItemRaw) { - var coordDim; - var sysDimItemDimsDef; - var sysDimItemOtherDims; - var sysDimItem; - if (isString(sysDimItemRaw)) { - coordDim = sysDimItemRaw; - sysDimItem = {}; - } else { - sysDimItem = sysDimItemRaw; - coordDim = sysDimItem.name; - var ordinalMeta = sysDimItem.ordinalMeta; - sysDimItem.ordinalMeta = null; - sysDimItem = extend({}, 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 = encodeDefMap.get(coordDim); - // negative resultDimIdx means no need to mapping. - if (dataDims === false) { - return; - } - dataDims = normalizeToArray(dataDims); - // dimensions provides default dim sequences. - if (!dataDims.length) { - for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { - while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) { - availDimIdx++; - } - availDimIdx < dimCount && dataDims.push(availDimIdx++); - } - } - // Apply templates. - each(dataDims, function (resultDimIdx, coordDimIndex) { - var resultItem = getResultItem(resultDimIdx); - // Coordinate system has a higher priority on dim type than source. - if (isUsingSourceDimensionsDef && sysDimItem.type != null) { - resultItem.type = sysDimItem.type; - } - 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 (VISUAL_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'; - function ifNoNameFillWithCoordName(resultItem) { - if (resultItem.name == null) { - // Duplication will be removed in the next step. - resultItem.name = resultItem.coordDim; - } - } - // Set dim `name` and other `coordDim` and other props. - if (!omitUnusedDimensions) { - for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { - var resultItem = getResultItem(resultDimIdx); - var coordDim = resultItem.coordDim; - if (coordDim == null) { - // TODO no need to generate coordDim for isExtraCoord? - resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero); - resultItem.coordDimIndex = 0; - // Series specified generateCoord is using out. - if (!generateCoord || generateCoordCount <= 0) { - resultItem.isExtraCoord = true; - } - generateCoordCount--; - } - ifNoNameFillWithCoordName(resultItem); - if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must - // Consider the case: - // { - // dataset: {source: [ - // ['2001', 123], - // ['2002', 456], - // ... - // ['The others', 987], - // ]}, - // series: {type: 'pie'} - // } - // The first column should better be treated as a "ordinal" although it - // might not be detected as an "ordinal" by `guessOrdinal`. - || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) { - resultItem.type = 'ordinal'; - } - } - } else { - each(resultList, function (resultItem) { - // PENDING: guessOrdinal or let user specify type: 'ordinal' manually? - ifNoNameFillWithCoordName(resultItem); - }); - // Sort dimensions: there are some rule that use the last dim as label, - // and for some latter travel process easier. - resultList.sort(function (item0, item1) { - return item0.storeDimIndex - item1.storeDimIndex; - }); - } - removeDuplication(resultList); - return new SeriesDataSchema({ - source: source, - dimensions: resultList, - fullDimensionCount: dimCount, - dimensionOmitted: omitUnusedDimensions - }); - } - function removeDuplication(result) { - var duplicationMap = createHashMap(); - for (var i = 0; i < result.length; i++) { - var dim = result[i]; - var dimOriginalName = dim.name; - var count = duplicationMap.get(dimOriginalName) || 0; - if (count > 0) { - // Starts from 0. - dim.name = dimOriginalName + (count - 1); - } - count++; - duplicationMap.set(dimOriginalName, count); - } - } - // ??? 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 calculate bubble size or use visualMap - // on other dimensions besides coordSys needed. - // So, dims that is not used by system, should be shared in data store? - 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.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0); - each(sysDims, function (sysDimItem) { - var sysDimItemDimsDef; - if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) { - dimCount = Math.max(dimCount, sysDimItemDimsDef.length); - } - }); - return dimCount; - } - function genCoordDimName(name, map, fromZero) { - if (fromZero || map.hasKey(name)) { - var i = 0; - while (map.hasKey(name + i)) { - i++; - } - name += i; - } - map.set(name, true); - return name; - } - - /** - * @class - * For example: - * { - * coordSysName: 'cartesian2d', - * coordSysDims: ['x', 'y', ...], - * axisMap: HashMap({ - * x: xAxisModel, - * y: yAxisModel - * }), - * categoryAxisMap: HashMap({ - * x: xAxisModel, - * y: undefined - * }), - * // The index of the first category axis in `coordSysDims`. - * // `null/undefined` means no category axis exists. - * firstCategoryDimIndex: 1, - * // To replace user specified encode. - * } - */ - var CoordSysInfo = /** @class */function () { - function CoordSysInfo(coordSysName) { - this.coordSysDims = []; - this.axisMap = createHashMap(); - this.categoryAxisMap = createHashMap(); - this.coordSysName = coordSysName; - } - return CoordSysInfo; - }(); - function getCoordSysInfoBySeries(seriesModel) { - var coordSysName = seriesModel.get('coordinateSystem'); - var result = new CoordSysInfo(coordSysName); - var fetch = fetchers[coordSysName]; - if (fetch) { - fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); - return result; - } - } - var fetchers = { - cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) { - var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]; - var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!xAxisModel) { - throw new Error('xAxis "' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '" not found'); - } - if (!yAxisModel) { - throw new Error('yAxis "' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '" not found'); - } - } - result.coordSysDims = ['x', 'y']; - axisMap.set('x', xAxisModel); - axisMap.set('y', yAxisModel); - if (isCategory(xAxisModel)) { - categoryAxisMap.set('x', xAxisModel); - result.firstCategoryDimIndex = 0; - } - if (isCategory(yAxisModel)) { - categoryAxisMap.set('y', yAxisModel); - result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); - } - }, - singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) { - var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!singleAxisModel) { - throw new Error('singleAxis should be specified.'); - } - } - result.coordSysDims = ['single']; - axisMap.set('single', singleAxisModel); - if (isCategory(singleAxisModel)) { - categoryAxisMap.set('single', singleAxisModel); - result.firstCategoryDimIndex = 0; - } - }, - polar: function (seriesModel, result, axisMap, categoryAxisMap) { - var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0]; - var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); - var angleAxisModel = polarModel.findAxisModel('angleAxis'); - if ("development" !== 'production') { - if (!angleAxisModel) { - throw new Error('angleAxis option not found'); - } - if (!radiusAxisModel) { - throw new Error('radiusAxis option not found'); - } - } - result.coordSysDims = ['radius', 'angle']; - axisMap.set('radius', radiusAxisModel); - axisMap.set('angle', angleAxisModel); - if (isCategory(radiusAxisModel)) { - categoryAxisMap.set('radius', radiusAxisModel); - result.firstCategoryDimIndex = 0; - } - if (isCategory(angleAxisModel)) { - categoryAxisMap.set('angle', angleAxisModel); - result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); - } - }, - geo: function (seriesModel, result, axisMap, categoryAxisMap) { - result.coordSysDims = ['lng', 'lat']; - }, - parallel: function (seriesModel, result, axisMap, categoryAxisMap) { - var ecModel = seriesModel.ecModel; - var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex')); - var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); - each(parallelModel.parallelAxisIndex, function (axisIndex, index) { - var axisModel = ecModel.getComponent('parallelAxis', axisIndex); - var axisDim = coordSysDims[index]; - axisMap.set(axisDim, axisModel); - if (isCategory(axisModel)) { - categoryAxisMap.set(axisDim, axisModel); - if (result.firstCategoryDimIndex == null) { - result.firstCategoryDimIndex = index; - } - } - }); - } - }; - function isCategory(axisModel) { - return axisModel.get('type') === 'category'; - } - - /** - * 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 seriesModel - * @param dimensionsInput The same as the input of . - * The input will be modified. - * @param opt - * @param opt.stackedCoordDimension Specify a coord dimension if needed. - * @param opt.byIndex=false - * @return calculationInfo - * { - * stackedDimension: string - * stackedByDimension: string - * isStackedByIndex: boolean - * stackedOverDimension: string - * stackResultDimension: string - * } - */ - function enableDataStack(seriesModel, dimensionsInput, opt) { - opt = opt || {}; - var byIndex = opt.byIndex; - var stackedCoordDimension = opt.stackedCoordDimension; - var dimensionDefineList; - var schema; - var store; - if (isLegacyDimensionsInput(dimensionsInput)) { - dimensionDefineList = dimensionsInput; - } else { - schema = dimensionsInput.schema; - dimensionDefineList = schema.dimensions; - store = dimensionsInput.store; - } - // Compatibal: when `stack` is set as '', do not stack. - var mayStack = !!(seriesModel && seriesModel.get('stack')); - var stackedByDimInfo; - var stackedDimInfo; - var stackResultDimension; - var stackedOverDimension; - each(dimensionDefineList, function (dimensionInfo, index) { - if (isString(dimensionInfo)) { - dimensionDefineList[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. - // Also need to use seriesModel.id as postfix because different - // series may share same data store. The stack dimension needs to be distinguished. - stackResultDimension = '__\0ecstackresult_' + seriesModel.id; - stackedOverDimension = '__\0ecstackedover_' + seriesModel.id; - // Create inverted index to fast query index by value. - if (stackedByDimInfo) { - stackedByDimInfo.createInvertedIndices = true; - } - var stackedDimCoordDim_1 = stackedDimInfo.coordDim; - var stackedDimType = stackedDimInfo.type; - var stackedDimCoordIndex_1 = 0; - each(dimensionDefineList, function (dimensionInfo) { - if (dimensionInfo.coordDim === stackedDimCoordDim_1) { - stackedDimCoordIndex_1++; - } - }); - var stackedOverDimensionDefine = { - name: stackResultDimension, - coordDim: stackedDimCoordDim_1, - coordDimIndex: stackedDimCoordIndex_1, - type: stackedDimType, - isExtraCoord: true, - isCalculationCoord: true, - storeDimIndex: dimensionDefineList.length - }; - var stackResultDimensionDefine = { - 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_1 + 1, - type: stackedDimType, - isExtraCoord: true, - isCalculationCoord: true, - storeDimIndex: dimensionDefineList.length + 1 - }; - if (schema) { - if (store) { - stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType); - stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType); - } - schema.appendCalculationDimension(stackedOverDimensionDefine); - schema.appendCalculationDimension(stackResultDimensionDefine); - } else { - dimensionDefineList.push(stackedOverDimensionDefine); - dimensionDefineList.push(stackResultDimensionDefine); - } - } - return { - stackedDimension: stackedDimInfo && stackedDimInfo.name, - stackedByDimension: stackedByDimInfo && stackedByDimInfo.name, - isStackedByIndex: byIndex, - stackedOverDimension: stackedOverDimension, - stackResultDimension: stackResultDimension - }; - } - function isLegacyDimensionsInput(dimensionsInput) { - return !isSeriesDataSchema(dimensionsInput.schema); - } - function isDimensionStacked(data, stackedDim) { - // 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'); - } - function getStackedDimension(data, targetDim) { - return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim; - } - - function getCoordSysDimDefs(seriesModel, coordSysInfo) { - var coordSysName = seriesModel.get('coordinateSystem'); - var registeredCoordSys = CoordinateSystemManager.get(coordSysName); - var coordSysDimDefs; - if (coordSysInfo && coordSysInfo.coordSysDims) { - coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) { - var dimInfo = { - name: dim - }; - var axisModel = coordSysInfo.axisMap.get(dim); - if (axisModel) { - var axisType = axisModel.get('type'); - dimInfo.type = getDimensionTypeByAxis(axisType); - } - return dimInfo; - }); - } - if (!coordSysDimDefs) { - // Get dimensions from registered coordinate system - coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y']; - } - return coordSysDimDefs; - } - function injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) { - var firstCategoryDimIndex; - var hasNameEncode; - coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) { - var coordDim = dimInfo.coordDim; - var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim); - if (categoryAxisModel) { - if (firstCategoryDimIndex == null) { - firstCategoryDimIndex = dimIndex; - } - dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta(); - if (createInvertedIndices) { - dimInfo.createInvertedIndices = true; - } - } - if (dimInfo.otherDims.itemName != null) { - hasNameEncode = true; - } - }); - if (!hasNameEncode && firstCategoryDimIndex != null) { - dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0; - } - return firstCategoryDimIndex; - } - /** - * Caution: there are side effects to `sourceManager` in this method. - * Should better only be called in `Series['getInitialData']`. - */ - function createSeriesData(sourceRaw, seriesModel, opt) { - opt = opt || {}; - var sourceManager = seriesModel.getSourceManager(); - var source; - var isOriginalSource = false; - if (sourceRaw) { - isOriginalSource = true; - source = createSourceFromSeriesDataOption(sourceRaw); - } else { - source = sourceManager.getSource(); - // Is series.data. not dataset. - isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL; - } - var coordSysInfo = getCoordSysInfoBySeries(seriesModel); - var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo); - var useEncodeDefaulter = opt.useEncodeDefaulter; - var encodeDefaulter = isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null; - var createDimensionOptions = { - coordDimensions: coordSysDimDefs, - generateCoord: opt.generateCoord, - encodeDefine: seriesModel.getEncode(), - encodeDefaulter: encodeDefaulter, - canOmitUnusedDimensions: !isOriginalSource - }; - var schema = prepareSeriesDataSchema(source, createDimensionOptions); - var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo); - var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null; - var stackCalculationInfo = enableDataStack(seriesModel, { - schema: schema, - store: store - }); - var data = new SeriesData(schema, seriesModel); - data.setCalculationInfo(stackCalculationInfo); - var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) { - // Use dataIndex as ordinal value in categoryAxis - return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex); - } : null; - data.hasItemOption = false; - data.initData( - // Try to reuse the data store in sourceManager if using dataset. - isOriginalSource ? source : store, null, dimValueGetter); - return data; - } - function isNeedCompleteOrdinalData(source) { - if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) { - var sampleItem = firstDataNotNull(source.data || []); - return !isArray(getDataItemValue(sampleItem)); - } - } - function firstDataNotNull(arr) { - var i = 0; - while (i < arr.length && arr[i] == null) { - i++; - } - return arr[i]; - } - - var Scale = /** @class */function () { - function Scale(setting) { - this._setting = setting || {}; - this._extent = [Infinity, -Infinity]; - } - Scale.prototype.getSetting = function (name) { - return this._setting[name]; - }; - /** - * Set extent from data - */ - 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 - */ - Scale.prototype.unionExtentFromData = function (data, dim) { - this.unionExtent(data.getApproximateExtent(dim)); - }; - /** - * Get extent - * - * Extent is always in increase order. - */ - Scale.prototype.getExtent = function () { - return this._extent.slice(); - }; - /** - * Set extent - */ - Scale.prototype.setExtent = function (start, end) { - var thisExtent = this._extent; - if (!isNaN(start)) { - thisExtent[0] = start; - } - if (!isNaN(end)) { - thisExtent[1] = end; - } - }; - /** - * If value is in extent range - */ - Scale.prototype.isInExtentRange = function (value) { - return this._extent[0] <= value && this._extent[1] >= value; - }; - /** - * 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; - }; - return Scale; - }(); - enableClassManagement(Scale); - - var uidBase = 0; - var OrdinalMeta = /** @class */function () { - function OrdinalMeta(opt) { - this.categories = opt.categories || []; - this._needCollect = opt.needCollect; - this._deduplication = opt.deduplication; - this.uid = ++uidBase; - } - OrdinalMeta.createByAxisModel = function (axisModel) { - var option = axisModel.option; - var data = option.data; - var categories = data && map(data, getName); - return new OrdinalMeta({ - categories: categories, - needCollect: !categories, - // deduplication is default in axis. - deduplication: option.dedplication !== false - }); - }; - OrdinalMeta.prototype.getOrdinal = function (category) { - // @ts-ignore - return this._getOrCreateMap().get(category); - }; - /** - * @return The ordinal. If not found, return NaN. - */ - OrdinalMeta.prototype.parseAndCollect = function (category) { - var index; - var needCollect = this._needCollect; - // The value of category dim can be the index of the given category set. - // This feature is only supported when !needCollect, because we should - // consider a common case: a value is 2017, which is a number but is - // expected to be tread as a category. This case usually happen in dataset, - // where it happent to be no need of the index feature. - if (!isString(category) && !needCollect) { - return category; - } - // Optimize for the scenario: - // category is ['2012-01-01', '2012-01-02', ...], where the input - // data has been ensured not duplicate and is large data. - // Notice, if a dataset dimension provide categroies, usually echarts - // should remove duplication except user tell echarts dont do that - // (set axis.deduplication = false), because echarts do not know whether - // the values in the category dimension has duplication (consider the - // parallel-aqi example) - if (needCollect && !this._deduplication) { - index = this.categories.length; - this.categories[index] = category; - return index; - } - var map = this._getOrCreateMap(); - // @ts-ignore - index = map.get(category); - if (index == null) { - if (needCollect) { - index = this.categories.length; - this.categories[index] = category; - // @ts-ignore - map.set(category, index); - } else { - index = NaN; - } - } - return index; - }; - // Consider big data, do not create map until needed. - OrdinalMeta.prototype._getOrCreateMap = function () { - return this._map || (this._map = createHashMap(this.categories)); - }; - return OrdinalMeta; - }(); - function getName(obj) { - if (isObject(obj) && obj.value != null) { - return obj.value; - } else { - return obj + ''; - } - } - - function isValueNice(val) { - var exp10 = Math.pow(10, quantityExponent(Math.abs(val))); - var f = Math.abs(val / exp10); - return f === 0 || f === 1 || f === 2 || f === 3 || f === 5; - } - function isIntervalOrLogScale(scale) { - return scale.type === 'interval' || scale.type === 'log'; - } - /** - * @param extent Both extent[0] and extent[1] should be valid number. - * Should be extent[0] < extent[1]. - * @param splitNumber splitNumber should be >= 1. - */ - function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) { - var result = {}; - var span = extent[1] - extent[0]; - var interval = result.interval = nice(span / splitNumber, true); - if (minInterval != null && interval < minInterval) { - interval = result.interval = minInterval; - } - if (maxInterval != null && interval > maxInterval) { - interval = result.interval = maxInterval; - } - // Tow more digital for tick. - var precision = result.intervalPrecision = getIntervalPrecision(interval); - // Niced extent inside original extent - var niceTickExtent = result.niceTickExtent = [round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.floor(extent[1] / interval) * interval, precision)]; - fixExtent(niceTickExtent, extent); - return result; - } - function increaseInterval(interval) { - var exp10 = Math.pow(10, quantityExponent(interval)); - // Increase interval - var f = interval / exp10; - if (!f) { - f = 1; - } else if (f === 2) { - f = 3; - } else if (f === 3) { - f = 5; - } else { - // f is 1 or 5 - f *= 2; - } - return round(f * exp10); - } - /** - * @return interval precision - */ - function getIntervalPrecision(interval) { - // Tow more digital for tick. - return getPrecision(interval) + 2; - } - function clamp(niceTickExtent, idx, extent) { - niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]); - } - // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent. - function fixExtent(niceTickExtent, extent) { - !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]); - !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]); - clamp(niceTickExtent, 0, extent); - clamp(niceTickExtent, 1, extent); - if (niceTickExtent[0] > niceTickExtent[1]) { - niceTickExtent[0] = niceTickExtent[1]; - } - } - function contain$1(val, extent) { - return val >= extent[0] && val <= extent[1]; - } - function normalize$1(val, extent) { - if (extent[1] === extent[0]) { - return 0.5; - } - return (val - extent[0]) / (extent[1] - extent[0]); - } - function scale$2(val, extent) { - return val * (extent[1] - extent[0]) + extent[0]; - } - - var OrdinalScale = /** @class */function (_super) { - __extends(OrdinalScale, _super); - function OrdinalScale(setting) { - var _this = _super.call(this, setting) || this; - _this.type = 'ordinal'; - var ordinalMeta = _this.getSetting('ordinalMeta'); - // Caution: Should not use instanceof, consider ec-extensions using - // import approach to get OrdinalMeta class. - if (!ordinalMeta) { - ordinalMeta = new OrdinalMeta({}); - } - if (isArray(ordinalMeta)) { - ordinalMeta = new OrdinalMeta({ - categories: map(ordinalMeta, function (item) { - return isObject(item) ? item.value : item; - }) - }); - } - _this._ordinalMeta = ordinalMeta; - _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1]; - return _this; - } - OrdinalScale.prototype.parse = function (val) { - // Caution: Math.round(null) will return `0` rather than `NaN` - if (val == null) { - return NaN; - } - return isString(val) ? this._ordinalMeta.getOrdinal(val) - // val might be float. - : Math.round(val); - }; - OrdinalScale.prototype.contain = function (rank) { - rank = this.parse(rank); - return contain$1(rank, this._extent) && this._ordinalMeta.categories[rank] != null; - }; - /** - * Normalize given rank or name to linear [0, 1] - * @param val raw ordinal number. - * @return normalized value in [0, 1]. - */ - OrdinalScale.prototype.normalize = function (val) { - val = this._getTickNumber(this.parse(val)); - return normalize$1(val, this._extent); - }; - /** - * @param val normalized value in [0, 1]. - * @return raw ordinal number. - */ - OrdinalScale.prototype.scale = function (val) { - val = Math.round(scale$2(val, this._extent)); - return this.getRawOrdinalNumber(val); - }; - OrdinalScale.prototype.getTicks = function () { - var ticks = []; - var extent = this._extent; - var rank = extent[0]; - while (rank <= extent[1]) { - ticks.push({ - value: rank - }); - rank++; - } - return ticks; - }; - OrdinalScale.prototype.getMinorTicks = function (splitNumber) { - // Not support. - return; - }; - /** - * @see `Ordinal['_ordinalNumbersByTick']` - */ - OrdinalScale.prototype.setSortInfo = function (info) { - if (info == null) { - this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null; - return; - } - var infoOrdinalNumbers = info.ordinalNumbers; - var ordinalsByTick = this._ordinalNumbersByTick = []; - var ticksByOrdinal = this._ticksByOrdinalNumber = []; - // Unnecessary support negative tick in `realtimeSort`. - var tickNum = 0; - var allCategoryLen = this._ordinalMeta.categories.length; - for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) { - var ordinalNumber = infoOrdinalNumbers[tickNum]; - ordinalsByTick[tickNum] = ordinalNumber; - ticksByOrdinal[ordinalNumber] = tickNum; - } - // Handle that `series.data` only covers part of the `axis.category.data`. - var unusedOrdinal = 0; - for (; tickNum < allCategoryLen; ++tickNum) { - while (ticksByOrdinal[unusedOrdinal] != null) { - unusedOrdinal++; - } - ordinalsByTick.push(unusedOrdinal); - ticksByOrdinal[unusedOrdinal] = tickNum; - } - }; - OrdinalScale.prototype._getTickNumber = function (ordinal) { - var ticksByOrdinalNumber = this._ticksByOrdinalNumber; - // also support ordinal out of range of `ordinalMeta.categories.length`, - // where ordinal numbers are used as tick value directly. - return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal; - }; - /** - * @usage - * ```js - * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal); - * - * // case0 - * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber]; - * // case1 - * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber]; - * // case2 - * const coord = axis.dataToCoord(ordinalNumber); - * ``` - * - * @param {OrdinalNumber} tickNumber index of display - */ - OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) { - var ordinalNumbersByTick = this._ordinalNumbersByTick; - // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`., - // where ordinal numbers are used as tick value directly. - return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber; - }; - /** - * Get item on tick - */ - OrdinalScale.prototype.getLabel = function (tick) { - if (!this.isBlank()) { - var ordinalNumber = this.getRawOrdinalNumber(tick.value); - var cateogry = this._ordinalMeta.categories[ordinalNumber]; - // Note that if no data, ordinalMeta.categories is an empty array. - // Return empty if it's not exist. - return cateogry == null ? '' : cateogry + ''; - } - }; - OrdinalScale.prototype.count = function () { - return this._extent[1] - this._extent[0] + 1; - }; - OrdinalScale.prototype.unionExtentFromData = function (data, dim) { - this.unionExtent(data.getApproximateExtent(dim)); - }; - /** - * @override - * If value is in extent range - */ - OrdinalScale.prototype.isInExtentRange = function (value) { - value = this._getTickNumber(value); - return this._extent[0] <= value && this._extent[1] >= value; - }; - OrdinalScale.prototype.getOrdinalMeta = function () { - return this._ordinalMeta; - }; - OrdinalScale.prototype.calcNiceTicks = function () {}; - OrdinalScale.prototype.calcNiceExtent = function () {}; - OrdinalScale.type = 'ordinal'; - return OrdinalScale; - }(Scale); - Scale.registerClass(OrdinalScale); - - var roundNumber = round; - var IntervalScale = /** @class */function (_super) { - __extends(IntervalScale, _super); - function IntervalScale() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'interval'; - // Step is calculated in adjustExtent. - _this._interval = 0; - _this._intervalPrecision = 2; - return _this; - } - IntervalScale.prototype.parse = function (val) { - return val; - }; - IntervalScale.prototype.contain = function (val) { - return contain$1(val, this._extent); - }; - IntervalScale.prototype.normalize = function (val) { - return normalize$1(val, this._extent); - }; - IntervalScale.prototype.scale = function (val) { - return scale$2(val, this._extent); - }; - IntervalScale.prototype.setExtent = function (start, end) { - var thisExtent = this._extent; - // start,end may be a Number like '25',so... - if (!isNaN(start)) { - thisExtent[0] = parseFloat(start); - } - if (!isNaN(end)) { - thisExtent[1] = parseFloat(end); - } - }; - IntervalScale.prototype.unionExtent = function (other) { - var extent = this._extent; - other[0] < extent[0] && (extent[0] = other[0]); - other[1] > extent[1] && (extent[1] = other[1]); - // unionExtent may called by it's sub classes - this.setExtent(extent[0], extent[1]); - }; - IntervalScale.prototype.getInterval = function () { - return this._interval; - }; - IntervalScale.prototype.setInterval = function (interval) { - this._interval = interval; - // Dropped auto calculated niceExtent and use user-set extent. - // We assume user wants to set both interval, min, max to get a better result. - this._niceExtent = this._extent.slice(); - this._intervalPrecision = getIntervalPrecision(interval); - }; - /** - * @param expandToNicedExtent Whether expand the ticks to niced extent. - */ - IntervalScale.prototype.getTicks = function (expandToNicedExtent) { - var interval = this._interval; - var extent = this._extent; - var niceTickExtent = this._niceExtent; - var intervalPrecision = this._intervalPrecision; - var ticks = []; - // If interval is 0, return []; - if (!interval) { - return ticks; - } - // Consider this case: using dataZoom toolbox, zoom and zoom. - var safeLimit = 10000; - if (extent[0] < niceTickExtent[0]) { - if (expandToNicedExtent) { - ticks.push({ - value: roundNumber(niceTickExtent[0] - interval, intervalPrecision) - }); - } else { - ticks.push({ - value: extent[0] - }); - } - } - var tick = niceTickExtent[0]; - while (tick <= niceTickExtent[1]) { - ticks.push({ - value: tick - }); - // Avoid rounding error - tick = roundNumber(tick + interval, intervalPrecision); - if (tick === ticks[ticks.length - 1].value) { - // Consider out of safe float point, e.g., - // -3711126.9907707 + 2e-10 === -3711126.9907707 - break; - } - if (ticks.length > safeLimit) { - return []; - } - } - // Consider this case: the last item of ticks is smaller - // than niceTickExtent[1] and niceTickExtent[1] === extent[1]. - var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1]; - if (extent[1] > lastNiceTick) { - if (expandToNicedExtent) { - ticks.push({ - value: roundNumber(lastNiceTick + interval, intervalPrecision) - }); - } else { - ticks.push({ - value: extent[1] - }); - } - } - return ticks; - }; - IntervalScale.prototype.getMinorTicks = function (splitNumber) { - var ticks = this.getTicks(true); - var minorTicks = []; - var extent = this.getExtent(); - for (var i = 1; i < ticks.length; i++) { - var nextTick = ticks[i]; - var prevTick = ticks[i - 1]; - var count = 0; - var minorTicksGroup = []; - var interval = nextTick.value - prevTick.value; - var minorInterval = interval / splitNumber; - while (count < splitNumber - 1) { - var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); - // For the first and last interval. The count may be less than splitNumber. - if (minorTick > extent[0] && minorTick < extent[1]) { - minorTicksGroup.push(minorTick); - } - count++; - } - minorTicks.push(minorTicksGroup); - } - return minorTicks; - }; - /** - * @param opt.precision If 'auto', use nice presision. - * @param opt.pad returns 1.50 but not 1.5 if precision is 2. - */ - IntervalScale.prototype.getLabel = function (data, opt) { - if (data == null) { - return ''; - } - var precision = opt && opt.precision; - if (precision == null) { - precision = getPrecision(data.value) || 0; - } else if (precision === 'auto') { - // Should be more precise then tick. - precision = this._intervalPrecision; - } - // (1) If `precision` is set, 12.005 should be display as '12.00500'. - // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'. - var dataNum = roundNumber(data.value, precision, true); - return addCommas(dataNum); - }; - /** - * @param splitNumber By default `5`. - */ - IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) { - splitNumber = splitNumber || 5; - var extent = this._extent; - var span = extent[1] - extent[0]; - if (!isFinite(span)) { - return; - } - // User may set axis min 0 and data are all negative - // FIXME If it needs to reverse ? - if (span < 0) { - span = -span; - extent.reverse(); - } - var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval); - this._intervalPrecision = result.intervalPrecision; - this._interval = result.interval; - this._niceExtent = result.niceTickExtent; - }; - IntervalScale.prototype.calcNiceExtent = function (opt) { - var extent = this._extent; - // If extent start and end are same, expand them - if (extent[0] === extent[1]) { - if (extent[0] !== 0) { - // Expand extent - // Note that extents can be both negative. See #13154 - var expandSize = Math.abs(extent[0]); - // In the fowllowing case - // Axis has been fixed max 100 - // Plus data are all 100 and axis extent are [100, 100]. - // Extend to the both side will cause expanded max is larger than fixed max. - // So only expand to the smaller side. - if (!opt.fixMax) { - extent[1] += expandSize / 2; - extent[0] -= expandSize / 2; - } else { - extent[0] -= expandSize / 2; - } - } else { - extent[1] = 1; - } - } - var span = extent[1] - extent[0]; - // If there are no data and extent are [Infinity, -Infinity] - if (!isFinite(span)) { - extent[0] = 0; - extent[1] = 1; - } - this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); - // let extent = this._extent; - var interval = this._interval; - if (!opt.fixMin) { - extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval); - } - if (!opt.fixMax) { - extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval); - } - }; - IntervalScale.prototype.setNiceExtent = function (min, max) { - this._niceExtent = [min, max]; - }; - IntervalScale.type = 'interval'; - return IntervalScale; - }(Scale); - Scale.registerClass(IntervalScale); - - /* global Float32Array */ - var supportFloat32Array = typeof Float32Array !== 'undefined'; - var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array; - function createFloat32Array(arg) { - if (isArray(arg)) { - // Return self directly if don't support TypedArray. - return supportFloat32Array ? new Float32Array(arg) : arg; - } - // Else is number - return new Float32ArrayCtor(arg); - } - - var STACK_PREFIX = '__ec_stack_'; - function getSeriesStackId(seriesModel) { - return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex; - } - function getAxisKey(axis) { - return axis.dim + axis.index; - } - /** - * @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(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)) { - 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 = {}; - 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 dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); - var store = data.getStore(); - for (var i = 0, cnt = store.count(); i < cnt; ++i) { - var value = store.get(dimIdx, i); - if (!axisValues[key]) { - // No previous data for the axis - axisValues[key] = [value]; - } else { - // No value in previous series - axisValues[key].push(value); - } - // Ignore duplicated time values in the same axis - } - }); - - var axisMinGaps = {}; - for (var key in axisValues) { - if (axisValues.hasOwnProperty(key)) { - var valuesInAxis = axisValues[key]; - if (valuesInAxis) { - // Sort axis values into ascending order to calculate gaps - valuesInAxis.sort(function (a, b) { - return a - b; - }); - var min = null; - for (var j = 1; j < valuesInAxis.length; ++j) { - var delta = valuesInAxis[j] - valuesInAxis[j - 1]; - if (delta > 0) { - // Ignore 0 delta because they are of the same axis value - min = min === null ? delta : Math.min(min, delta); - } - } - // Set to null if only have one data - axisMinGaps[key] = min; - } - } - } - return axisMinGaps; - } - function makeColumnLayout(barSeries) { - var axisMinGaps = getValueAxesMinGaps(barSeries); - var seriesInfoList = []; - each(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$1(seriesModel.get('barWidth'), bandWidth); - var barMaxWidth = parsePercent$1(seriesModel.get('barMaxWidth'), bandWidth); - var barMinWidth = parsePercent$1( - // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis, - // the auto-calculated bar width might be less than 0.5 / 1. - seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 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 = {}; - each(seriesInfoList, function (seriesInfo, idx) { - var axisKey = seriesInfo.axisKey; - var bandWidth = seriesInfo.bandWidth; - var columnsOnAxis = columnsMap[axisKey] || { - bandWidth: bandWidth, - remainedWidth: bandWidth, - autoWidthCount: 0, - categoryGap: null, - gap: '20%', - 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 = {}; - each(columnsMap, function (columnsOnAxis, coordSysName) { - result[coordSysName] = {}; - var stacks = columnsOnAxis.stacks; - var bandWidth = columnsOnAxis.bandWidth; - var categoryGapPercent = columnsOnAxis.categoryGap; - if (categoryGapPercent == null) { - var columnCount = keys(stacks).length; - // More columns in one group - // the spaces between group is smaller. Or the column will be too thin. - categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%'; - } - var categoryGap = parsePercent$1(categoryGapPercent, bandWidth); - var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); - var remainedWidth = columnsOnAxis.remainedWidth; - var autoWidthCount = columnsOnAxis.autoWidthCount; - var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); - // Find if any auto calculated bar exceeded maxBarWidth - each(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 whether 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. Because 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; - 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; - 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; - } - function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) { - if (barWidthAndOffset && axis) { - var result = barWidthAndOffset[getAxisKey(axis)]; - if (result != null && seriesModel != null) { - return result[getSeriesStackId(seriesModel)]; - } - return result; - } - } - function layout(seriesType, ecModel) { - var seriesModels = prepareLayoutBarSeries(seriesType, ecModel); - var barWidthAndOffset = makeColumnLayout(seriesModels); - 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; - data.setLayout({ - bandWidth: columnLayoutInfo.bandWidth, - offset: columnOffset, - size: columnWidth - }); - }); - } - // TODO: Do not support stack in large mode yet. - function createProgressiveLayout(seriesType) { - return { - seriesType: seriesType, - plan: createRenderPlanner(), - reset: function (seriesModel) { - if (!isOnCartesian(seriesModel)) { - return; - } - var data = seriesModel.getData(); - var cartesian = seriesModel.coordinateSystem; - var baseAxis = cartesian.getBaseAxis(); - var valueAxis = cartesian.getOtherAxis(baseAxis); - var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim)); - var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); - var drawBackground = seriesModel.get('showBackground', true); - var valueDim = data.mapDimension(valueAxis.dim); - var stackResultDim = data.getCalculationInfo('stackResultDimension'); - var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries'); - var isValueAxisH = valueAxis.isHorizontal(); - var valueAxisStart = getValueAxisStart(baseAxis, valueAxis); - var isLarge = isInLargeMode(seriesModel); - var barMinHeight = seriesModel.get('barMinHeight') || 0; - var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim); - // Layout info. - var columnWidth = data.getLayout('size'); - var columnOffset = data.getLayout('offset'); - return { - progress: function (params, data) { - var count = params.count; - var largePoints = isLarge && createFloat32Array(count * 3); - var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3); - var largeDataIndices = isLarge && createFloat32Array(count); - var coordLayout = cartesian.master.getRect(); - var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height; - var dataIndex; - var store = data.getStore(); - var idxOffset = 0; - while ((dataIndex = params.next()) != null) { - var value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex); - var baseValue = store.get(baseDimIdx, dataIndex); - var baseCoord = valueAxisStart; - var stackStartValue = void 0; - // Because of the barMinHeight, we can not use the value in - // stackResultDimension directly. - if (stacked) { - stackStartValue = +value - store.get(valueDimIdx, dataIndex); - } - var x = void 0; - var y = void 0; - var width = void 0; - var height = void 0; - if (isValueAxisH) { - var coord = cartesian.dataToPoint([value, baseValue]); - if (stacked) { - var startCoord = cartesian.dataToPoint([stackStartValue, baseValue]); - baseCoord = startCoord[0]; - } - x = baseCoord; - y = coord[1] + columnOffset; - width = coord[0] - baseCoord; - height = columnWidth; - if (Math.abs(width) < barMinHeight) { - width = (width < 0 ? -1 : 1) * barMinHeight; - } - } else { - var coord = cartesian.dataToPoint([baseValue, value]); - if (stacked) { - var startCoord = cartesian.dataToPoint([baseValue, stackStartValue]); - baseCoord = startCoord[1]; - } - x = coord[0] + columnOffset; - y = baseCoord; - width = columnWidth; - height = coord[1] - baseCoord; - if (Math.abs(height) < barMinHeight) { - // Include zero to has a positive bar - height = (height <= 0 ? -1 : 1) * barMinHeight; - } - } - if (!isLarge) { - data.setItemLayout(dataIndex, { - x: x, - y: y, - width: width, - height: height - }); - } else { - largePoints[idxOffset] = x; - largePoints[idxOffset + 1] = y; - largePoints[idxOffset + 2] = isValueAxisH ? width : height; - if (largeBackgroundPoints) { - largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x; - largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y; - largeBackgroundPoints[idxOffset + 2] = bgSize; - } - largeDataIndices[dataIndex] = dataIndex; - } - idxOffset += 3; - } - if (isLarge) { - data.setLayout({ - largePoints: largePoints, - largeDataIndices: largeDataIndices, - largeBackgroundPoints: largeBackgroundPoints, - valueAxisHorizontal: isValueAxisH - }); - } - } - }; - } - }; - } - 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) { - var startValue = valueAxis.model.get('startValue'); - if (!startValue) { - startValue = 0; - } - return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? startValue > 0 ? startValue : 1 : startValue)); - } - - // FIXME 公用? - var bisect = function (a, x, lo, hi) { - while (lo < hi) { - var mid = lo + hi >>> 1; - if (a[mid][1] < x) { - lo = mid + 1; - } else { - hi = mid; - } - } - return lo; - }; - var TimeScale = /** @class */function (_super) { - __extends(TimeScale, _super); - function TimeScale(settings) { - var _this = _super.call(this, settings) || this; - _this.type = 'time'; - return _this; - } - /** - * Get label is mainly for other components like dataZoom, tooltip. - */ - TimeScale.prototype.getLabel = function (tick) { - var useUTC = this.getSetting('useUTC'); - return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale')); - }; - TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) { - var isUTC = this.getSetting('useUTC'); - var lang = this.getSetting('locale'); - return leveledFormat(tick, idx, labelFormatter, lang, isUTC); - }; - /** - * @override - */ - TimeScale.prototype.getTicks = function () { - var interval = this._interval; - var extent = this._extent; - var ticks = []; - // If interval is 0, return []; - if (!interval) { - return ticks; - } - ticks.push({ - value: extent[0], - level: 0 - }); - var useUTC = this.getSetting('useUTC'); - var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent); - ticks = ticks.concat(innerTicks); - ticks.push({ - value: extent[1], - level: 0 - }); - return ticks; - }; - TimeScale.prototype.calcNiceExtent = function (opt) { - var extent = this._extent; - // If extent start and end are same, expand them - if (extent[0] === extent[1]) { - // Expand extent - extent[0] -= ONE_DAY; - extent[1] += ONE_DAY; - } - // If there are no data and extent are [Infinity, -Infinity] - if (extent[1] === -Infinity && extent[0] === Infinity) { - var d = new Date(); - extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate()); - extent[0] = extent[1] - ONE_DAY; - } - this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); - }; - TimeScale.prototype.calcNiceTicks = function (approxTickNum, minInterval, maxInterval) { - approxTickNum = approxTickNum || 10; - var extent = this._extent; - var span = extent[1] - extent[0]; - this._approxInterval = span / approxTickNum; - if (minInterval != null && this._approxInterval < minInterval) { - this._approxInterval = minInterval; - } - if (maxInterval != null && this._approxInterval > maxInterval) { - this._approxInterval = maxInterval; - } - var scaleIntervalsLen = scaleIntervals.length; - var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1); - // Interval that can be used to calculate ticks - this._interval = scaleIntervals[idx][1]; - // Min level used when picking ticks from top down. - // We check one more level to avoid the ticks are to sparse in some case. - this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0]; - }; - TimeScale.prototype.parse = function (val) { - // val might be float. - return isNumber(val) ? val : +parseDate(val); - }; - TimeScale.prototype.contain = function (val) { - return contain$1(this.parse(val), this._extent); - }; - TimeScale.prototype.normalize = function (val) { - return normalize$1(this.parse(val), this._extent); - }; - TimeScale.prototype.scale = function (val) { - return scale$2(val, this._extent); - }; - TimeScale.type = 'time'; - return TimeScale; - }(IntervalScale); - /** - * This implementation was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - */ - var scaleIntervals = [ - // Format interval - ['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y - ]; - - function isUnitValueSame(unit, valueA, valueB, isUTC) { - var dateA = parseDate(valueA); - var dateB = parseDate(valueB); - var isSame = function (unit) { - return getUnitValue(dateA, unit, isUTC) === getUnitValue(dateB, unit, isUTC); - }; - var isSameYear = function () { - return isSame('year'); - }; - // const isSameHalfYear = () => isSameYear() && isSame('half-year'); - // const isSameQuater = () => isSameYear() && isSame('quarter'); - var isSameMonth = function () { - return isSameYear() && isSame('month'); - }; - var isSameDay = function () { - return isSameMonth() && isSame('day'); - }; - // const isSameHalfDay = () => isSameDay() && isSame('half-day'); - var isSameHour = function () { - return isSameDay() && isSame('hour'); - }; - var isSameMinute = function () { - return isSameHour() && isSame('minute'); - }; - var isSameSecond = function () { - return isSameMinute() && isSame('second'); - }; - var isSameMilliSecond = function () { - return isSameSecond() && isSame('millisecond'); - }; - switch (unit) { - case 'year': - return isSameYear(); - case 'month': - return isSameMonth(); - case 'day': - return isSameDay(); - case 'hour': - return isSameHour(); - case 'minute': - return isSameMinute(); - case 'second': - return isSameSecond(); - case 'millisecond': - return isSameMilliSecond(); - } - } - // const primaryUnitGetters = { - // year: fullYearGetterName(), - // month: monthGetterName(), - // day: dateGetterName(), - // hour: hoursGetterName(), - // minute: minutesGetterName(), - // second: secondsGetterName(), - // millisecond: millisecondsGetterName() - // }; - // const primaryUnitUTCGetters = { - // year: fullYearGetterName(true), - // month: monthGetterName(true), - // day: dateGetterName(true), - // hour: hoursGetterName(true), - // minute: minutesGetterName(true), - // second: secondsGetterName(true), - // millisecond: millisecondsGetterName(true) - // }; - // function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) { - // step = step || 1; - // switch (getPrimaryTimeUnit(unitName)) { - // case 'year': - // date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step); - // break; - // case 'month': - // date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step); - // break; - // case 'day': - // date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step); - // break; - // case 'hour': - // date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step); - // break; - // case 'minute': - // date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step); - // break; - // case 'second': - // date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step); - // break; - // case 'millisecond': - // date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step); - // break; - // } - // return date.getTime(); - // } - // const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]]; - // const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]]; - // const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]]; - function getDateInterval(approxInterval, daysInMonth) { - approxInterval /= ONE_DAY; - return approxInterval > 16 ? 16 - // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick between two months. - : approxInterval > 7.5 ? 7 // TODO week 7 or day 8? - : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1; - } - function getMonthInterval(approxInterval) { - var APPROX_ONE_MONTH = 30 * ONE_DAY; - approxInterval /= APPROX_ONE_MONTH; - return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1; - } - function getHourInterval(approxInterval) { - approxInterval /= ONE_HOUR; - return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1; - } - function getMinutesAndSecondsInterval(approxInterval, isMinutes) { - approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND; - return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1; - } - function getMillisecondsInterval(approxInterval) { - return nice(approxInterval, true); - } - function getFirstTimestampOfUnit(date, unitName, isUTC) { - var outDate = new Date(date); - switch (getPrimaryTimeUnit(unitName)) { - case 'year': - case 'month': - outDate[monthSetterName(isUTC)](0); - case 'day': - outDate[dateSetterName(isUTC)](1); - case 'hour': - outDate[hoursSetterName(isUTC)](0); - case 'minute': - outDate[minutesSetterName(isUTC)](0); - case 'second': - outDate[secondsSetterName(isUTC)](0); - outDate[millisecondsSetterName(isUTC)](0); - } - return outDate.getTime(); - } - function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) { - var safeLimit = 10000; - var unitNames = timeUnits; - var iter = 0; - function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) { - var date = new Date(minTimestamp); - var dateTime = minTimestamp; - var d = date[getMethodName](); - // if (isDate) { - // d -= 1; // Starts with 0; PENDING - // } - while (dateTime < maxTimestamp && dateTime <= extent[1]) { - out.push({ - value: dateTime - }); - d += interval; - date[setMethodName](d); - dateTime = date.getTime(); - } - // This extra tick is for calcuating ticks of next level. Will not been added to the final result - out.push({ - value: dateTime, - notAdd: true - }); - } - function addLevelTicks(unitName, lastLevelTicks, levelTicks) { - var newAddedTicks = []; - var isFirstLevel = !lastLevelTicks.length; - if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) { - return; - } - if (isFirstLevel) { - lastLevelTicks = [{ - // TODO Optimize. Not include so may ticks. - value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC) - }, { - value: extent[1] - }]; - } - for (var i = 0; i < lastLevelTicks.length - 1; i++) { - var startTick = lastLevelTicks[i].value; - var endTick = lastLevelTicks[i + 1].value; - if (startTick === endTick) { - continue; - } - var interval = void 0; - var getterName = void 0; - var setterName = void 0; - var isDate = false; - switch (unitName) { - case 'year': - interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365)); - getterName = fullYearGetterName(isUTC); - setterName = fullYearSetterName(isUTC); - break; - case 'half-year': - case 'quarter': - case 'month': - interval = getMonthInterval(approxInterval); - getterName = monthGetterName(isUTC); - setterName = monthSetterName(isUTC); - break; - case 'week': // PENDING If week is added. Ignore day. - case 'half-week': - case 'day': - interval = getDateInterval(approxInterval); // Use 32 days and let interval been 16 - getterName = dateGetterName(isUTC); - setterName = dateSetterName(isUTC); - isDate = true; - break; - case 'half-day': - case 'quarter-day': - case 'hour': - interval = getHourInterval(approxInterval); - getterName = hoursGetterName(isUTC); - setterName = hoursSetterName(isUTC); - break; - case 'minute': - interval = getMinutesAndSecondsInterval(approxInterval, true); - getterName = minutesGetterName(isUTC); - setterName = minutesSetterName(isUTC); - break; - case 'second': - interval = getMinutesAndSecondsInterval(approxInterval, false); - getterName = secondsGetterName(isUTC); - setterName = secondsSetterName(isUTC); - break; - case 'millisecond': - interval = getMillisecondsInterval(approxInterval); - getterName = millisecondsGetterName(isUTC); - setterName = millisecondsSetterName(isUTC); - break; - } - addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks); - if (unitName === 'year' && levelTicks.length > 1 && i === 0) { - // Add nearest years to the left extent. - levelTicks.unshift({ - value: levelTicks[0].value - interval - }); - } - } - for (var i = 0; i < newAddedTicks.length; i++) { - levelTicks.push(newAddedTicks[i]); - } - // newAddedTicks.length && console.log(unitName, newAddedTicks); - return newAddedTicks; - } - var levelsTicks = []; - var currentLevelTicks = []; - var tickCount = 0; - var lastLevelTickCount = 0; - for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) { - var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]); - if (!isPrimaryTimeUnit(unitNames[i])) { - // TODO - continue; - } - addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks); - var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null; - if (primaryTimeUnit !== nextPrimaryTimeUnit) { - if (currentLevelTicks.length) { - lastLevelTickCount = tickCount; - // Remove the duplicate so the tick count can be precisely. - currentLevelTicks.sort(function (a, b) { - return a.value - b.value; - }); - var levelTicksRemoveDuplicated = []; - for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) { - var tickValue = currentLevelTicks[i_1].value; - if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) { - levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]); - if (tickValue >= extent[0] && tickValue <= extent[1]) { - tickCount++; - } - } - } - var targetTickNum = (extent[1] - extent[0]) / approxInterval; - // Added too much in this level and not too less in last level - if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) { - break; - } - // Only treat primary time unit as one level. - levelsTicks.push(levelTicksRemoveDuplicated); - if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) { - break; - } - } - // Reset if next unitName is primary - currentLevelTicks = []; - } - } - if ("development" !== 'production') { - if (iter >= safeLimit) { - warn('Exceed safe limit.'); - } - } - var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) { - return filter(levelTicks, function (tick) { - return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; - }); - }), function (levelTicks) { - return levelTicks.length > 0; - }); - var ticks = []; - var maxLevel = levelsTicksInExtent.length - 1; - for (var i = 0; i < levelsTicksInExtent.length; ++i) { - var levelTicks = levelsTicksInExtent[i]; - for (var k = 0; k < levelTicks.length; ++k) { - ticks.push({ - value: levelTicks[k].value, - level: maxLevel - i - }); - } - } - ticks.sort(function (a, b) { - return a.value - b.value; - }); - // Remove duplicates - var result = []; - for (var i = 0; i < ticks.length; ++i) { - if (i === 0 || ticks[i].value !== ticks[i - 1].value) { - result.push(ticks[i]); - } - } - return result; - } - Scale.registerClass(TimeScale); - - var scaleProto = Scale.prototype; - // FIXME:TS refactor: not good to call it directly with `this`? - var intervalScaleProto = IntervalScale.prototype; - var roundingErrorFix = round; - var mathFloor = Math.floor; - var mathCeil = Math.ceil; - var mathPow$1 = Math.pow; - var mathLog = Math.log; - var LogScale = /** @class */function (_super) { - __extends(LogScale, _super); - function LogScale() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'log'; - _this.base = 10; - _this._originalScale = new IntervalScale(); - // FIXME:TS actually used by `IntervalScale` - _this._interval = 0; - return _this; - } - /** - * @param Whether expand the ticks to niced extent. - */ - LogScale.prototype.getTicks = function (expandToNicedExtent) { - var originalScale = this._originalScale; - var extent = this._extent; - var originalExtent = originalScale.getExtent(); - var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent); - return map(ticks, function (tick) { - var val = tick.value; - var powVal = round(mathPow$1(this.base, val)); - // Fix #4158 - powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal; - powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal; - return { - value: powVal - }; - }, this); - }; - LogScale.prototype.setExtent = function (start, end) { - var base = mathLog(this.base); - // log(-Infinity) is NaN, so safe guard here - start = mathLog(Math.max(0, start)) / base; - end = mathLog(Math.max(0, end)) / base; - intervalScaleProto.setExtent.call(this, start, end); - }; - /** - * @return {number} end - */ - LogScale.prototype.getExtent = function () { - var base = this.base; - var extent = scaleProto.getExtent.call(this); - extent[0] = mathPow$1(base, extent[0]); - extent[1] = mathPow$1(base, extent[1]); - // Fix #4158 - var originalScale = this._originalScale; - var originalExtent = originalScale.getExtent(); - this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0])); - this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1])); - return extent; - }; - LogScale.prototype.unionExtent = function (extent) { - this._originalScale.unionExtent(extent); - var base = this.base; - extent[0] = mathLog(extent[0]) / mathLog(base); - extent[1] = mathLog(extent[1]) / mathLog(base); - scaleProto.unionExtent.call(this, extent); - }; - LogScale.prototype.unionExtentFromData = function (data, dim) { - // TODO - // filter value that <= 0 - this.unionExtent(data.getApproximateExtent(dim)); - }; - /** - * Update interval and extent of intervals for nice ticks - * @param approxTickNum default 10 Given approx tick number - */ - LogScale.prototype.calcNiceTicks = function (approxTickNum) { - approxTickNum = approxTickNum || 10; - var extent = this._extent; - var span = extent[1] - extent[0]; - if (span === Infinity || span <= 0) { - return; - } - var interval = quantity(span); - var err = approxTickNum / span * interval; - // Filter ticks to get closer to the desired count. - if (err <= 0.5) { - interval *= 10; - } - // Interval should be integer - while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) { - interval *= 10; - } - var niceExtent = [round(mathCeil(extent[0] / interval) * interval), round(mathFloor(extent[1] / interval) * interval)]; - this._interval = interval; - this._niceExtent = niceExtent; - }; - LogScale.prototype.calcNiceExtent = function (opt) { - intervalScaleProto.calcNiceExtent.call(this, opt); - this._fixMin = opt.fixMin; - this._fixMax = opt.fixMax; - }; - LogScale.prototype.parse = function (val) { - return val; - }; - LogScale.prototype.contain = function (val) { - val = mathLog(val) / mathLog(this.base); - return contain$1(val, this._extent); - }; - LogScale.prototype.normalize = function (val) { - val = mathLog(val) / mathLog(this.base); - return normalize$1(val, this._extent); - }; - LogScale.prototype.scale = function (val) { - val = scale$2(val, this._extent); - return mathPow$1(this.base, val); - }; - LogScale.type = 'log'; - return LogScale; - }(Scale); - var proto = LogScale.prototype; - proto.getMinorTicks = intervalScaleProto.getMinorTicks; - proto.getLabel = intervalScaleProto.getLabel; - function fixRoundingError(val, originalVal) { - return roundingErrorFix(val, getPrecision(originalVal)); - } - Scale.registerClass(LogScale); - - var ScaleRawExtentInfo = /** @class */function () { - function ScaleRawExtentInfo(scale, model, - // Usually: data extent from all series on this axis. - originalExtent) { - this._prepareParams(scale, model, originalExtent); - } - /** - * Parameters depending on outside (like model, user callback) - * are prepared and fixed here. - */ - ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, - // Usually: data extent from all series on this axis. - dataExtent) { - if (dataExtent[1] < dataExtent[0]) { - dataExtent = [NaN, NaN]; - } - this._dataMin = dataExtent[0]; - this._dataMax = dataExtent[1]; - var isOrdinal = this._isOrdinal = scale.type === 'ordinal'; - this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero(); - var axisMinValue = model.get('min', true); - if (axisMinValue == null) { - axisMinValue = model.get('startValue', true); - } - var modelMinRaw = this._modelMinRaw = axisMinValue; - if (isFunction(modelMinRaw)) { - // This callback always provides users the full data extent (before data is filtered). - this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({ - min: dataExtent[0], - max: dataExtent[1] - })); - } else if (modelMinRaw !== 'dataMin') { - this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw); - } - var modelMaxRaw = this._modelMaxRaw = model.get('max', true); - if (isFunction(modelMaxRaw)) { - // This callback always provides users the full data extent (before data is filtered). - this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({ - min: dataExtent[0], - max: dataExtent[1] - })); - } else if (modelMaxRaw !== 'dataMax') { - this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw); - } - if (isOrdinal) { - // FIXME: there is a flaw here: if there is no "block" data processor like `dataZoom`, - // and progressive rendering is using, here the category result might just only contain - // the processed chunk rather than the entire result. - this._axisDataLen = model.getCategories().length; - } else { - var boundaryGap = model.get('boundaryGap'); - var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0]; - if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') { - if ("development" !== 'production') { - console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., "20%". Currently, ' + 'boundaryGap is set to be 0.'); - } - this._boundaryGapInner = [0, 0]; - } else { - this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)]; - } - } - }; - /** - * Calculate extent by prepared parameters. - * This method has no external dependency and can be called duplicatedly, - * getting the same result. - * If parameters changed, should call this method to recalcuate. - */ - ScaleRawExtentInfo.prototype.calculate = function () { - // 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. - var isOrdinal = this._isOrdinal; - var dataMin = this._dataMin; - var dataMax = this._dataMax; - var axisDataLen = this._axisDataLen; - var boundaryGapInner = this._boundaryGapInner; - var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; - // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax', - // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`. - var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum; - var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum; - // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed. - var minFixed = min != null; - var maxFixed = max != null; - if (min == null) { - min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span; - } - if (max == null) { - max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span; - } - (min == null || !isFinite(min)) && (min = NaN); - (max == null || !isFinite(max)) && (max = NaN); - var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen; - // If data extent modified, need to recalculated to ensure cross zero. - if (this._needCrossZero) { - // Axis is over zero and min is not set - if (min > 0 && max > 0 && !minFixed) { - min = 0; - // minFixed = true; - } - // Axis is under zero and max is not set - if (min < 0 && max < 0 && !maxFixed) { - max = 0; - // maxFixed = true; - } - // PENDING: - // When `needCrossZero` and all data is positive/negative, should it be ensured - // that the results processed by boundaryGap are positive/negative? - // If so, here `minFixed`/`maxFixed` need to be set. - } - - var determinedMin = this._determinedMin; - var determinedMax = this._determinedMax; - if (determinedMin != null) { - min = determinedMin; - minFixed = true; - } - if (determinedMax != null) { - max = determinedMax; - maxFixed = true; - } - // Ensure min/max be finite number or NaN here. (not to be null/undefined) - // `NaN` means min/max axis is blank. - return { - min: min, - max: max, - minFixed: minFixed, - maxFixed: maxFixed, - isBlank: isBlank - }; - }; - ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) { - if ("development" !== 'production') { - assert(!this.frozen); - } - this[DATA_MIN_MAX_ATTR[minMaxName]] = val; - }; - ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) { - var attr = DETERMINED_MIN_MAX_ATTR[minMaxName]; - if ("development" !== 'production') { - assert(!this.frozen - // Earse them usually means logic flaw. - && this[attr] == null); - } - this[attr] = val; - }; - ScaleRawExtentInfo.prototype.freeze = function () { - // @ts-ignore - this.frozen = true; - }; - return ScaleRawExtentInfo; - }(); - var DETERMINED_MIN_MAX_ATTR = { - min: '_determinedMin', - max: '_determinedMax' - }; - var DATA_MIN_MAX_ATTR = { - min: '_dataMin', - max: '_dataMax' - }; - /** - * Get scale min max and related info only depends on model settings. - * This method can be called after coordinate system created. - * For example, in data processing stage. - * - * Scale extent info probably be required multiple times during a workflow. - * For example: - * (1) `dataZoom` depends it to get the axis extent in "100%" state. - * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified. - * (3) `coordSys.update` use it to finally decide the scale extent. - * But the callback of `min`/`max` should not be called multiple times. - * The code below should not be implemented repeatedly either. - * So we cache the result in the scale instance, which will be recreated at the beginning - * of the workflow (because `scale` instance will be recreated each round of the workflow). - */ - function ensureScaleRawExtentInfo(scale, model, - // Usually: data extent from all series on this axis. - originalExtent) { - // Do not permit to recreate. - var rawExtentInfo = scale.rawExtentInfo; - if (rawExtentInfo) { - return rawExtentInfo; - } - rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); - // @ts-ignore - scale.rawExtentInfo = rawExtentInfo; - return rawExtentInfo; - } - function parseAxisModelMinMax(scale, minMax) { - return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax); - } - - /** - * Get axis scale extent before niced. - * Item of returned array can only be number (including Infinity and NaN). - * - * Caution: - * Precondition of calling this method: - * The scale extent has been initialized using series data extent via - * `scale.setExtent` or `scale.unionExtentFromData`; - */ - function getScaleExtent(scale, model) { - var scaleType = scale.type; - var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate(); - scale.setBlank(rawExtentResult.isBlank); - var min = rawExtentResult.min; - var max = rawExtentResult.max; - // 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_1 = false; - each(barSeriesModels, function (seriesModel) { - isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis; - }); - if (isBaseAxisAndHasBarSeries_1) { - // Calculate placement of bars on axis. TODO should be decoupled - // with barLayout - 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: rawExtentResult.minFixed, - fixMax: rawExtentResult.maxFixed - }; - } - function adjustScaleForOverflow(min, max, model, - // Only support cartesian coord yet. - 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; - each(barsOnCurrentAxis, function (item) { - minOverflow = Math.min(item.offset, minOverflow); - }); - var maxOverflow = -Infinity; - each(barsOnCurrentAxis, function (item) { - maxOverflow = Math.max(item.offset + item.width, maxOverflow); - }); - minOverflow = Math.abs(minOverflow); - maxOverflow = Math.abs(maxOverflow); - var totalOverFlow = minOverflow + maxOverflow; - // Calculate 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 - }; - } - // Precondition of calling this method: - // The scale extent has been initialized using series data extent via - // `scale.setExtent` or `scale.unionExtentFromData`; - function niceScaleExtent(scale, inModel) { - var model = inModel; - var extentInfo = getScaleExtent(scale, model); - var extent = extentInfo.extent; - var splitNumber = model.get('splitNumber'); - if (scale instanceof LogScale) { - scale.base = model.get('logBase'); - } - var scaleType = scale.type; - var interval = model.get('interval'); - var isIntervalOrTime = scaleType === 'interval' || scaleType === 'time'; - scale.setExtent(extent[0], extent[1]); - scale.calcNiceExtent({ - splitNumber: splitNumber, - fixMin: extentInfo.fixMin, - fixMax: extentInfo.fixMax, - minInterval: isIntervalOrTime ? model.get('minInterval') : null, - maxInterval: isIntervalOrTime ? 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 - if (interval != null) { - scale.setInterval && scale.setInterval(interval); - } - } - /** - * @param axisType Default retrieve from model.type - */ - function createScaleByModel(model, axisType) { - axisType = axisType || model.get('type'); - if (axisType) { - switch (axisType) { - // Buildin scale - case 'category': - return new OrdinalScale({ - ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), - extent: [Infinity, -Infinity] - }); - case 'time': - return new TimeScale({ - locale: model.ecModel.getLocaleModel(), - useUTC: model.ecModel.get('useUTC') - }); - default: - // case 'value'/'interval', 'log', or others. - return new (Scale.getClass(axisType) || IntervalScale)(); - } - } - } - /** - * Check if the axis cross 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 axis - * @return Label formatter function. - * param: {number} tickValue, - * param: {number} idx, the index in all ticks. - * If category axis, this param is not required. - * return: {string} label string. - */ - function makeLabelFormatter(axis) { - var labelFormatter = axis.getLabelModel().get('formatter'); - var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null; - if (axis.scale.type === 'time') { - return function (tpl) { - return function (tick, idx) { - return axis.scale.getFormattedLabel(tick, idx, tpl); - }; - }(labelFormatter); - } else if (isString(labelFormatter)) { - return function (tpl) { - return function (tick) { - // For category axis, get raw value; for numeric axis, - // get formatted label like '1,333,444'. - var label = axis.scale.getLabel(tick); - var text = tpl.replace('{value}', label != null ? label : ''); - return text; - }; - }(labelFormatter); - } else if (isFunction(labelFormatter)) { - return function (cb) { - return function (tick, 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 = tick.value - categoryTickStart; - } - return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? { - level: tick.level - } : null); - }; - }(labelFormatter); - } else { - return function (tick) { - return axis.scale.getLabel(tick); - }; - } - } - function getAxisRawValue(axis, tick) { - // 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(tick) : tick.value; - } - /** - * @param axis - * @return 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 realNumberScaleTicks; - var tickCount; - var categoryScaleExtent = scale.getExtent(); - // Optimize for large category data, avoid call `getTicks()`. - if (scale instanceof OrdinalScale) { - 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 tick = realNumberScaleTicks ? realNumberScaleTicks[i] : { - value: categoryScaleExtent[0] + i - }; - var label = labelFormatter(tick, i); - 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 beforeWidth = textRect.width; - var beforeHeight = textRect.height; - var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians)); - var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians)); - var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight); - return rotatedRect; - } - /** - * @param 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 regardless of overlap. - * @param {Object} axis axisModel.axis - */ - function shouldShowAllLabels(axis) { - return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0; - } - function getDataDimensionsOnAxis(data, axisDim) { - // Remove duplicated dat dimensions caused by `getStackedDimension`. - var dataDimMap = {}; - // Currently `mapDimensionsAll` will contain stack result dimension ('__\0ecstackresult'). - // PENDING: is it reasonable? Do we need to remove the original dim from "coord dim" since - // there has been stacked result dim? - each(data.mapDimensionsAll(axisDim), function (dataDim) { - // For example, the extent of the original dimension - // is [0.1, 0.5], the extent of the `stackResultDimension` - // is [7, 9], the final extent should NOT include [0.1, 0.5], - // because there is no graphic corresponding to [0.1, 0.5]. - // See the case in `test/area-stack.html` `main1`, where area line - // stack needs `yAxis` not start from 0. - dataDimMap[getStackedDimension(data, dataDim)] = true; - }); - return keys(dataDimMap); - } - function unionAxisExtentFromData(dataExtent, data, axisDim) { - if (data) { - each(getDataDimensionsOnAxis(data, axisDim), function (dim) { - var seriesExtent = data.getApproximateExtent(dim); - seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); - seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); - }); - } - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars - var AxisModelCommonMixin = /** @class */function () { - function AxisModelCommonMixin() {} - AxisModelCommonMixin.prototype.getNeedCrossZero = function () { - var option = this.option; - return !option.scale; - }; - /** - * Should be implemented by each axis model if necessary. - * @return coordinate system model - */ - AxisModelCommonMixin.prototype.getCoordSysModel = function () { - return; - }; - return AxisModelCommonMixin; - }(); - - /** - * Create a multi dimension List structure from seriesModel. - */ - function createList(seriesModel) { - return createSeriesData(null, seriesModel); - } - var dataStack$1 = { - isDimensionStacked: isDimensionStacked, - enableDataStack: enableDataStack, - getStackedDimension: getStackedDimension - }; - /** - * Create scale - * @param {Array.} dataExtent - * @param {Object|module:echarts/Model} option If `optoin.type` - * is secified, it can only be `'value'` currently. - */ - function createScale(dataExtent, option) { - var axisModel = option; - if (!(option instanceof Model)) { - axisModel = new Model(option); - // FIXME - // Currently AxisModelCommonMixin has nothing to do with the - // the requirements of `axisHelper.createScaleByModel`. For - // example the methods `getCategories` and `getOrdinalMeta` - // are required for `'category'` axis, and ecModel is required - // for `'time'` axis. But occasionally echarts-gl happened - // to only use `'value'` axis. - // zrUtil.mixin(axisModel, AxisModelCommonMixin); - } - - var scale = createScaleByModel(axisModel); - scale.setExtent(dataExtent[0], dataExtent[1]); - niceScaleExtent(scale, axisModel); - return scale; - } - /** - * Mixin common methods to axis model, - * - * Include methods - * `getFormattedLabels() => Array.` - * `getCategories() => Array.` - * `getMin(origin: boolean) => number` - * `getMax(origin: boolean) => number` - * `getNeedCrossZero() => boolean` - */ - function mixinAxisModelCommonMethods(Model) { - mixin(Model, AxisModelCommonMixin); - } - function createTextStyle$1(textStyleModel, opts) { - opts = opts || {}; - return createTextStyle(textStyleModel, null, null, opts.state !== 'normal'); - } - - var helper = /*#__PURE__*/Object.freeze({ - __proto__: null, - createList: createList, - getLayoutRect: getLayoutRect, - dataStack: dataStack$1, - createScale: createScale, - mixinAxisModelCommonMethods: mixinAxisModelCommonMethods, - getECData: getECData, - createTextStyle: createTextStyle$1, - createDimensions: createDimensions, - createSymbol: createSymbol, - enableHoverEmphasis: enableHoverEmphasis - }); - - var EPSILON$4 = 1e-8; - function isAroundEqual$1(a, b) { - return Math.abs(a - b) < EPSILON$4; - } - function contain$2(points, x, y) { - var w = 0; - var p = points[0]; - if (!p) { - return false; - } - for (var i = 1; i < points.length; i++) { - var p2 = points[i]; - w += windingLine(p[0], p[1], p2[0], p2[1], x, y); - p = p2; - } - var p0 = points[0]; - if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) { - w += windingLine(p[0], p[1], p0[0], p0[1], x, y); - } - return w !== 0; - } - - var TMP_TRANSFORM = []; - function transformPoints(points, transform) { - for (var p = 0; p < points.length; p++) { - applyTransform(points[p], points[p], transform); - } - } - function updateBBoxFromPoints(points, min$1, max$1, projection) { - for (var i = 0; i < points.length; i++) { - var p = points[i]; - if (projection) { - // projection may return null point. - p = projection.project(p); - } - if (p && isFinite(p[0]) && isFinite(p[1])) { - min(min$1, min$1, p); - max(max$1, max$1, p); - } - } - } - function centroid(points) { - var signedArea = 0; - var cx = 0; - var cy = 0; - var len = points.length; - var x0 = points[len - 1][0]; - var y0 = points[len - 1][1]; - // Polygon should been closed. - for (var i = 0; i < len; i++) { - var x1 = points[i][0]; - var y1 = points[i][1]; - var a = x0 * y1 - x1 * y0; - signedArea += a; - cx += (x0 + x1) * a; - cy += (y0 + y1) * a; - x0 = x1; - y0 = y1; - } - return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points[0][0] || 0, points[0][1] || 0]; - } - var Region = /** @class */function () { - function Region(name) { - this.name = name; - } - Region.prototype.setCenter = function (center) { - this._center = center; - }; - /** - * Get center point in data unit. That is, - * for GeoJSONRegion, the unit is lat/lng, - * for GeoSVGRegion, the unit is SVG local coord. - */ - Region.prototype.getCenter = function () { - var center = this._center; - if (!center) { - // In most cases there are no need to calculate this center. - // So calculate only when called. - center = this._center = this.calcCenter(); - } - return center; - }; - return Region; - }(); - var GeoJSONPolygonGeometry = /** @class */function () { - function GeoJSONPolygonGeometry(exterior, interiors) { - this.type = 'polygon'; - this.exterior = exterior; - this.interiors = interiors; - } - return GeoJSONPolygonGeometry; - }(); - var GeoJSONLineStringGeometry = /** @class */function () { - function GeoJSONLineStringGeometry(points) { - this.type = 'linestring'; - this.points = points; - } - return GeoJSONLineStringGeometry; - }(); - var GeoJSONRegion = /** @class */function (_super) { - __extends(GeoJSONRegion, _super); - function GeoJSONRegion(name, geometries, cp) { - var _this = _super.call(this, name) || this; - _this.type = 'geoJSON'; - _this.geometries = geometries; - _this._center = cp && [cp[0], cp[1]]; - return _this; - } - GeoJSONRegion.prototype.calcCenter = function () { - var geometries = this.geometries; - var largestGeo; - var largestGeoSize = 0; - for (var i = 0; i < geometries.length; i++) { - var geo = geometries[i]; - var exterior = geo.exterior; - // Simple trick to use points count instead of polygon area as region size. - // Ignore linestring - var size = exterior && exterior.length; - if (size > largestGeoSize) { - largestGeo = geo; - largestGeoSize = size; - } - } - if (largestGeo) { - return centroid(largestGeo.exterior); - } - // from bounding rect by default. - var rect = this.getBoundingRect(); - return [rect.x + rect.width / 2, rect.y + rect.height / 2]; - }; - GeoJSONRegion.prototype.getBoundingRect = function (projection) { - var rect = this._rect; - // Always recalculate if using projection. - if (rect && !projection) { - return rect; - } - var min = [Infinity, Infinity]; - var max = [-Infinity, -Infinity]; - var geometries = this.geometries; - each(geometries, function (geo) { - if (geo.type === 'polygon') { - // Doesn't consider hole - updateBBoxFromPoints(geo.exterior, min, max, projection); - } else { - each(geo.points, function (points) { - updateBBoxFromPoints(points, min, max, projection); - }); - } - }); - // Normalie invalid bounding. - if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) { - min[0] = min[1] = max[0] = max[1] = 0; - } - rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); - if (!projection) { - this._rect = rect; - } - return rect; - }; - GeoJSONRegion.prototype.contain = function (coord) { - var rect = this.getBoundingRect(); - var geometries = this.geometries; - if (!rect.contain(coord[0], coord[1])) { - return false; - } - loopGeo: for (var i = 0, len = geometries.length; i < len; i++) { - var geo = geometries[i]; - // Only support polygon. - if (geo.type !== 'polygon') { - continue; - } - var exterior = geo.exterior; - var interiors = geo.interiors; - if (contain$2(exterior, coord[0], coord[1])) { - // Not in the region if point is in the hole. - for (var k = 0; k < (interiors ? interiors.length : 0); k++) { - if (contain$2(interiors[k], coord[0], coord[1])) { - continue loopGeo; - } - } - return true; - } - } - return false; - }; - /** - * Transform the raw coords to target bounding. - * @param x - * @param y - * @param width - * @param height - */ - GeoJSONRegion.prototype.transformTo = function (x, y, width, height) { - var rect = this.getBoundingRect(); - var aspect = rect.width / rect.height; - if (!width) { - width = aspect * height; - } else if (!height) { - height = width / aspect; - } - var target = new BoundingRect(x, y, width, height); - var transform = rect.calculateTransform(target); - var geometries = this.geometries; - for (var i = 0; i < geometries.length; i++) { - var geo = geometries[i]; - if (geo.type === 'polygon') { - transformPoints(geo.exterior, transform); - each(geo.interiors, function (interior) { - transformPoints(interior, transform); - }); - } else { - each(geo.points, function (points) { - transformPoints(points, transform); - }); - } - } - rect = this._rect; - rect.copy(target); - // Update center - this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2]; - }; - GeoJSONRegion.prototype.cloneShallow = function (name) { - name == null && (name = this.name); - var newRegion = new GeoJSONRegion(name, this.geometries, this._center); - newRegion._rect = this._rect; - newRegion.transformTo = null; // Simply avoid to be called. - return newRegion; - }; - return GeoJSONRegion; - }(Region); - var GeoSVGRegion = /** @class */function (_super) { - __extends(GeoSVGRegion, _super); - function GeoSVGRegion(name, elOnlyForCalculate) { - var _this = _super.call(this, name) || this; - _this.type = 'geoSVG'; - _this._elOnlyForCalculate = elOnlyForCalculate; - return _this; - } - GeoSVGRegion.prototype.calcCenter = function () { - var el = this._elOnlyForCalculate; - var rect = el.getBoundingRect(); - var center = [rect.x + rect.width / 2, rect.y + rect.height / 2]; - var mat = identity(TMP_TRANSFORM); - var target = el; - while (target && !target.isGeoSVGGraphicRoot) { - mul$1(mat, target.getLocalTransform(), mat); - target = target.parent; - } - invert(mat, mat); - applyTransform(center, center, mat); - return center; - }; - return GeoSVGRegion; - }(Region); - - function decode(json) { - if (!json.UTF8Encoding) { - return json; - } - var jsonCompressed = json; - var encodeScale = jsonCompressed.UTF8Scale; - if (encodeScale == null) { - encodeScale = 1024; - } - var features = jsonCompressed.features; - each(features, function (feature) { - var geometry = feature.geometry; - var encodeOffsets = geometry.encodeOffsets; - var coordinates = geometry.coordinates; - // Geometry may be appeded manually in the script after json loaded. - // In this case this geometry is usually not encoded. - if (!encodeOffsets) { - return; - } - switch (geometry.type) { - case 'LineString': - geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale); - break; - case 'Polygon': - decodeRings(coordinates, encodeOffsets, encodeScale); - break; - case 'MultiLineString': - decodeRings(coordinates, encodeOffsets, encodeScale); - break; - case 'MultiPolygon': - each(coordinates, function (rings, idx) { - return decodeRings(rings, encodeOffsets[idx], encodeScale); - }); - } - }); - // Has been decoded - jsonCompressed.UTF8Encoding = false; - return jsonCompressed; - } - function decodeRings(rings, encodeOffsets, encodeScale) { - for (var c = 0; c < rings.length; c++) { - rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale); - } - } - function decodeRing(coordinate, encodeOffsets, encodeScale) { - var result = []; - var prevX = encodeOffsets[0]; - var prevY = encodeOffsets[1]; - for (var i = 0; i < coordinate.length; i += 2) { - var x = coordinate.charCodeAt(i) - 64; - var y = coordinate.charCodeAt(i + 1) - 64; - // ZigZag decoding - x = x >> 1 ^ -(x & 1); - y = y >> 1 ^ -(y & 1); - // Delta deocding - x += prevX; - y += prevY; - prevX = x; - prevY = y; - // Dequantize - result.push([x / encodeScale, y / encodeScale]); - } - return result; - } - function parseGeoJSON(geoJson, nameProperty) { - geoJson = decode(geoJson); - return map(filter(geoJson.features, function (featureObj) { - // Output of mapshaper may have geometry null - return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0; - }), function (featureObj) { - var properties = featureObj.properties; - var geo = featureObj.geometry; - var geometries = []; - switch (geo.type) { - case 'Polygon': - var coordinates = geo.coordinates; - // According to the GeoJSON specification. - // First must be exterior, and the rest are all interior(holes). - geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1))); - break; - case 'MultiPolygon': - each(geo.coordinates, function (item) { - if (item[0]) { - geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1))); - } - }); - break; - case 'LineString': - geometries.push(new GeoJSONLineStringGeometry([geo.coordinates])); - break; - case 'MultiLineString': - geometries.push(new GeoJSONLineStringGeometry(geo.coordinates)); - } - var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp); - region.properties = properties; - return region; - }); - } - - var number = /*#__PURE__*/Object.freeze({ - __proto__: null, - linearMap: linearMap, - round: round, - asc: asc, - getPrecision: getPrecision, - getPrecisionSafe: getPrecisionSafe, - getPixelPrecision: getPixelPrecision, - getPercentWithPrecision: getPercentWithPrecision, - MAX_SAFE_INTEGER: MAX_SAFE_INTEGER, - remRadian: remRadian, - isRadianAroundZero: isRadianAroundZero, - parseDate: parseDate, - quantity: quantity, - quantityExponent: quantityExponent, - nice: nice, - quantile: quantile, - reformIntervals: reformIntervals, - isNumeric: isNumeric, - numericToNumber: numericToNumber - }); - - var time = /*#__PURE__*/Object.freeze({ - __proto__: null, - parse: parseDate, - format: format - }); - - var graphic$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - extendShape: extendShape, - extendPath: extendPath, - makePath: makePath, - makeImage: makeImage, - mergePath: mergePath$1, - resizePath: resizePath, - createIcon: createIcon, - updateProps: updateProps, - initProps: initProps, - getTransform: getTransform, - clipPointsByRect: clipPointsByRect, - clipRectByRect: clipRectByRect, - registerShape: registerShape, - getShapeClass: getShapeClass, - Group: Group, - Image: ZRImage, - Text: ZRText, - Circle: Circle, - Ellipse: Ellipse, - Sector: Sector, - Ring: Ring, - Polygon: Polygon, - Polyline: Polyline, - Rect: Rect, - Line: Line, - BezierCurve: BezierCurve, - Arc: Arc, - IncrementalDisplayable: IncrementalDisplayable, - CompoundPath: CompoundPath, - LinearGradient: LinearGradient, - RadialGradient: RadialGradient, - BoundingRect: BoundingRect - }); - - var format$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - addCommas: addCommas, - toCamelCase: toCamelCase, - normalizeCssArray: normalizeCssArray$1, - encodeHTML: encodeHTML, - formatTpl: formatTpl, - getTooltipMarker: getTooltipMarker, - formatTime: formatTime, - capitalFirst: capitalFirst, - truncateText: truncateText, - getTextRect: getTextRect - }); - - var util$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - map: map, - each: each, - indexOf: indexOf, - inherits: inherits, - reduce: reduce, - filter: filter, - bind: bind, - curry: curry, - isArray: isArray, - isString: isString, - isObject: isObject, - isFunction: isFunction, - extend: extend, - defaults: defaults, - clone: clone, - merge: merge - }); - - var inner$5 = makeInner(); - function tickValuesToNumbers(axis, values) { - var nums = map(values, function (val) { - return axis.scale.parse(val); - }); - if (axis.type === 'time' && nums.length > 0) { - // Time axis needs duplicate first/last tick (see TimeScale.getTicks()) - // The first and last tick/label don't get drawn - nums.sort(); - nums.unshift(nums[0]); - nums.push(nums[nums.length - 1]); - } - return nums; - } - function createAxisLabels(axis) { - var custom = axis.getLabelModel().get('customValues'); - if (custom) { - var labelFormatter_1 = makeLabelFormatter(axis); - return { - labels: tickValuesToNumbers(axis, custom).map(function (numval) { - var tick = { - value: numval - }; - return { - formattedLabel: labelFormatter_1(tick), - rawLabel: axis.scale.getLabel(tick), - tickValue: numval - }; - }) - }; - } - // Only ordinal scale support tick interval - return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis); - } - /** - * @param {module:echats/coord/Axis} axis - * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea. - * @return {Object} { - * ticks: Array. - * tickCategoryInterval: number - * } - */ - function createAxisTicks(axis, tickModel) { - var custom = axis.getTickModel().get('customValues'); - if (custom) { - return { - ticks: tickValuesToNumbers(axis, custom) - }; - } - // Only ordinal scale support tick interval - return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : { - ticks: map(axis.scale.getTicks(), function (tick) { - return tick.value; - }) - }; - } - function makeCategoryLabels(axis) { - var labelModel = axis.getLabelModel(); - var result = makeCategoryLabelsActually(axis, labelModel); - return !labelModel.get('show') || axis.scale.isBlank() ? { - labels: [], - labelCategoryInterval: result.labelCategoryInterval - } : result; - } - function makeCategoryLabelsActually(axis, labelModel) { - var labelsCache = getListCache(axis, 'labels'); - var optionLabelInterval = getOptionCategoryInterval(labelModel); - var result = listCacheGet(labelsCache, optionLabelInterval); - if (result) { - return result; - } - var labels; - var numericLabelInterval; - if (isFunction(optionLabelInterval)) { - labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval); - } else { - numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval; - labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval); - } - // Cache to avoid calling interval function repeatedly. - return listCacheSet(labelsCache, optionLabelInterval, { - labels: labels, - labelCategoryInterval: numericLabelInterval - }); - } - function makeCategoryTicks(axis, tickModel) { - var ticksCache = getListCache(axis, 'ticks'); - var optionTickInterval = getOptionCategoryInterval(tickModel); - var result = listCacheGet(ticksCache, optionTickInterval); - if (result) { - return result; - } - var ticks; - var tickCategoryInterval; - // Optimize for the case that large category data and no label displayed, - // we should not return all ticks. - if (!tickModel.get('show') || axis.scale.isBlank()) { - ticks = []; - } - if (isFunction(optionTickInterval)) { - ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true); - } - // Always use label interval by default despite label show. Consider this - // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows - // labels. `splitLine` and `axisTick` should be consistent in this case. - else if (optionTickInterval === 'auto') { - var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel()); - tickCategoryInterval = labelsResult.labelCategoryInterval; - ticks = map(labelsResult.labels, function (labelItem) { - return labelItem.tickValue; - }); - } else { - tickCategoryInterval = optionTickInterval; - ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true); - } - // Cache to avoid calling interval function repeatedly. - return listCacheSet(ticksCache, optionTickInterval, { - ticks: ticks, - tickCategoryInterval: tickCategoryInterval - }); - } - function makeRealNumberLabels(axis) { - var ticks = axis.scale.getTicks(); - var labelFormatter = makeLabelFormatter(axis); - return { - labels: map(ticks, function (tick, idx) { - return { - level: tick.level, - formattedLabel: labelFormatter(tick, idx), - rawLabel: axis.scale.getLabel(tick), - tickValue: tick.value - }; - }) - }; - } - function getListCache(axis, prop) { - // Because key can be a function, and cache size always is small, we use array cache. - return inner$5(axis)[prop] || (inner$5(axis)[prop] = []); - } - function listCacheGet(cache, key) { - for (var i = 0; i < cache.length; i++) { - if (cache[i].key === key) { - return cache[i].value; - } - } - } - function listCacheSet(cache, key, value) { - cache.push({ - key: key, - value: value - }); - return value; - } - function makeAutoCategoryInterval(axis) { - var result = inner$5(axis).autoInterval; - return result != null ? result : inner$5(axis).autoInterval = axis.calculateCategoryInterval(); - } - /** - * Calculate interval for category axis ticks and labels. - * To get precise result, at least one of `getRotate` and `isHorizontal` - * should be implemented in axis. - */ - function calculateCategoryInterval(axis) { - var params = fetchAutoCategoryIntervalCalculationParams(axis); - var labelFormatter = makeLabelFormatter(axis); - var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; - var ordinalScale = axis.scale; - var ordinalExtent = ordinalScale.getExtent(); - // Providing this method is for optimization: - // avoid generating a long array by `getTicks` - // in large category data case. - var tickCount = ordinalScale.count(); - if (ordinalExtent[1] - ordinalExtent[0] < 1) { - return 0; - } - var step = 1; - // Simple optimization. Empirical value: tick count should less than 40. - if (tickCount > 40) { - step = Math.max(1, Math.floor(tickCount / 40)); - } - var tickValue = ordinalExtent[0]; - var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); - var unitW = Math.abs(unitSpan * Math.cos(rotation)); - var unitH = Math.abs(unitSpan * Math.sin(rotation)); - var maxW = 0; - var maxH = 0; - // Caution: Performance sensitive for large category data. - // Consider dataZoom, we should make appropriate step to avoid O(n) loop. - for (; tickValue <= ordinalExtent[1]; tickValue += step) { - var width = 0; - var height = 0; - // Not precise, do not consider align and vertical align - // and each distance from axis line yet. - var rect = getBoundingRect(labelFormatter({ - value: tickValue - }), params.font, 'center', 'top'); - // Magic number - width = rect.width * 1.3; - height = rect.height * 1.3; - // Min size, void long loop. - maxW = Math.max(maxW, width, 7); - maxH = Math.max(maxH, height, 7); - } - var dw = maxW / unitW; - var dh = maxH / unitH; - // 0/0 is NaN, 1/0 is Infinity. - isNaN(dw) && (dw = Infinity); - isNaN(dh) && (dh = Infinity); - var interval = Math.max(0, Math.floor(Math.min(dw, dh))); - var cache = inner$5(axis.model); - var axisExtent = axis.getExtent(); - var lastAutoInterval = cache.lastAutoInterval; - var lastTickCount = cache.lastTickCount; - // Use cache to keep interval stable while moving zoom window, - // otherwise the calculated interval might jitter when the zoom - // window size is close to the interval-changing size. - // For example, if all of the axis labels are `a, b, c, d, e, f, g`. - // The jitter will cause that sometimes the displayed labels are - // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1). - if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 - // Always choose the bigger one, otherwise the critical - // point is not the same when zooming in or zooming out. - && lastAutoInterval > interval - // If the axis change is caused by chart resize, the cache should not - // be used. Otherwise some hidden labels might not be shown again. - && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) { - interval = lastAutoInterval; - } - // Only update cache if cache not used, otherwise the - // changing of interval is too insensitive. - else { - cache.lastTickCount = tickCount; - cache.lastAutoInterval = interval; - cache.axisExtent0 = axisExtent[0]; - cache.axisExtent1 = axisExtent[1]; - } - return interval; - } - function fetchAutoCategoryIntervalCalculationParams(axis) { - var labelModel = axis.getLabelModel(); - return { - axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0, - labelRotate: labelModel.get('rotate') || 0, - font: labelModel.getFont() - }; - } - function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) { - var labelFormatter = makeLabelFormatter(axis); - var ordinalScale = axis.scale; - var ordinalExtent = ordinalScale.getExtent(); - var labelModel = axis.getLabelModel(); - var result = []; - // TODO: axisType: ordinalTime, pick the tick from each month/day/year/... - var step = Math.max((categoryInterval || 0) + 1, 1); - var startTick = ordinalExtent[0]; - var tickCount = ordinalScale.count(); - // Calculate start tick based on zero if possible to keep label consistent - // while zooming and moving while interval > 0. Otherwise the selection - // of displayable ticks and symbols probably keep changing. - // 3 is empirical value. - if (startTick !== 0 && step > 1 && tickCount / step > 2) { - startTick = Math.round(Math.ceil(startTick / step) * step); - } - // (1) Only add min max label here but leave overlap checking - // to render stage, which also ensure the returned list - // suitable for splitLine and splitArea rendering. - // (2) Scales except category always contain min max label so - // do not need to perform this process. - var showAllLabel = shouldShowAllLabels(axis); - var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel; - var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel; - if (includeMinLabel && startTick !== ordinalExtent[0]) { - addItem(ordinalExtent[0]); - } - // Optimize: avoid generating large array by `ordinalScale.getTicks()`. - var tickValue = startTick; - for (; tickValue <= ordinalExtent[1]; tickValue += step) { - addItem(tickValue); - } - if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) { - addItem(ordinalExtent[1]); - } - function addItem(tickValue) { - var tickObj = { - value: tickValue - }; - result.push(onlyTick ? tickValue : { - formattedLabel: labelFormatter(tickObj), - rawLabel: ordinalScale.getLabel(tickObj), - tickValue: tickValue - }); - } - return result; - } - function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { - var ordinalScale = axis.scale; - var labelFormatter = makeLabelFormatter(axis); - var result = []; - each(ordinalScale.getTicks(), function (tick) { - var rawLabel = ordinalScale.getLabel(tick); - var tickValue = tick.value; - if (categoryInterval(tick.value, rawLabel)) { - result.push(onlyTick ? tickValue : { - formattedLabel: labelFormatter(tick), - rawLabel: rawLabel, - tickValue: tickValue - }); - } - }); - return result; - } - - var NORMALIZED_EXTENT = [0, 1]; - /** - * Base class of Axis. - */ - var Axis = /** @class */function () { - function Axis(dim, scale, extent) { - this.onBand = false; - this.inverse = false; - this.dim = dim; - this.scale = scale; - this._extent = extent || [0, 0]; - } - /** - * If axis extent contain given coord - */ - Axis.prototype.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 - */ - Axis.prototype.containData = function (data) { - return this.scale.contain(data); - }; - /** - * Get coord extent. - */ - Axis.prototype.getExtent = function () { - return this._extent.slice(); - }; - /** - * Get precision used for formatting - */ - Axis.prototype.getPixelPrecision = function (dataExtent) { - return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent); - }; - /** - * Set coord extent - */ - Axis.prototype.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 - */ - Axis.prototype.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 - */ - Axis.prototype.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 - */ - Axis.prototype.pointToData = function (point, clamp) { - // Should be implemented in derived class if necessary. - return; - }; - /** - * 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 opt.tickModel default: axis.model.getModel('axisTick') - * @param 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. - */ - Axis.prototype.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 (tickVal) { - return { - coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal), - tickValue: tickVal - }; - }, this); - var alignWithLabel = tickModel.get('alignWithLabel'); - fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp); - return ticksCoords; - }; - Axis.prototype.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; - }; - Axis.prototype.getViewLabels = function () { - return createAxisLabels(this).labels; - }; - Axis.prototype.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 overridden to: - * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` - */ - Axis.prototype.getTickModel = function () { - return this.model.getModel('axisTick'); - }; - /** - * Get width of band - */ - Axis.prototype.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; - }; - /** - * Only be called in category axis. - * Can be overridden, consider other axes like in 3D. - * @return Auto interval for cateogry axis tick and label - */ - Axis.prototype.calculateCategoryInterval = function () { - return calculateCategoryInterval(this); - }; - return Axis; - }(); - 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[1] - }; - } else { - var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue; - var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen; - each(ticksCoords, function (ticksItem) { - ticksItem.coord -= shift_1 / 2; - }); - var dataExtent = axis.scale.getExtent(); - diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue; - last = { - coord: ticksCoords[ticksLen - 1].coord + shift_1 * 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 unnecessary tick added. - a = round(a); - b = round(b); - return inverse ? a > b : a < b; - } - } - - // --------------------- Deprecated Extension Methods --------------------- - // Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class. - // Then use `registerComponentModel` in `install` parameter when `use` this extension. For example: - // class Bar3DModel extends ComponentModel {} - // export function install(registers) { registers.registerComponentModel(Bar3DModel); } - // echarts.use(install); - function extendComponentModel(proto) { - var Model = ComponentModel.extend(proto); - ComponentModel.registerClass(Model); - return Model; - } - function extendComponentView(proto) { - var View = ComponentView.extend(proto); - ComponentView.registerClass(View); - return View; - } - function extendSeriesModel(proto) { - var Model = SeriesModel.extend(proto); - SeriesModel.registerClass(Model); - return Model; - } - function extendChartView(proto) { - var View = ChartView.extend(proto); - ChartView.registerClass(View); - return View; - } - - var PI2$6 = Math.PI * 2; - var CMD$3 = PathProxy.CMD; - var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left']; - function getCandidateAnchor(pos, distance, rect, outPt, outDir) { - var width = rect.width; - var height = rect.height; - switch (pos) { - case 'top': - outPt.set(rect.x + width / 2, rect.y - distance); - outDir.set(0, -1); - break; - case 'bottom': - outPt.set(rect.x + width / 2, rect.y + height + distance); - outDir.set(0, 1); - break; - case 'left': - outPt.set(rect.x - distance, rect.y + height / 2); - outDir.set(-1, 0); - break; - case 'right': - outPt.set(rect.x + width + distance, rect.y + height / 2); - outDir.set(1, 0); - break; - } - } - function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) { - x -= cx; - y -= cy; - var d = Math.sqrt(x * x + y * y); - x /= d; - y /= d; - // Intersect point. - var ox = x * r + cx; - var oy = y * r + cy; - if (Math.abs(startAngle - endAngle) % PI2$6 < 1e-4) { - // Is a circle - out[0] = ox; - out[1] = oy; - return d - r; - } - if (anticlockwise) { - var tmp = startAngle; - startAngle = normalizeRadian(endAngle); - endAngle = normalizeRadian(tmp); - } else { - startAngle = normalizeRadian(startAngle); - endAngle = normalizeRadian(endAngle); - } - if (startAngle > endAngle) { - endAngle += PI2$6; - } - var angle = Math.atan2(y, x); - if (angle < 0) { - angle += PI2$6; - } - if (angle >= startAngle && angle <= endAngle || angle + PI2$6 >= startAngle && angle + PI2$6 <= endAngle) { - // Project point is on the arc. - out[0] = ox; - out[1] = oy; - return d - r; - } - var x1 = r * Math.cos(startAngle) + cx; - var y1 = r * Math.sin(startAngle) + cy; - var x2 = r * Math.cos(endAngle) + cx; - var y2 = r * Math.sin(endAngle) + cy; - var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y); - var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y); - if (d1 < d2) { - out[0] = x1; - out[1] = y1; - return Math.sqrt(d1); - } else { - out[0] = x2; - out[1] = y2; - return Math.sqrt(d2); - } - } - function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) { - var dx = x - x1; - var dy = y - y1; - var dx1 = x2 - x1; - var dy1 = y2 - y1; - var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1); - dx1 /= lineLen; - dy1 /= lineLen; - // dot product - var projectedLen = dx * dx1 + dy * dy1; - var t = projectedLen / lineLen; - if (limitToEnds) { - t = Math.min(Math.max(t, 0), 1); - } - t *= lineLen; - var ox = out[0] = x1 + t * dx1; - var oy = out[1] = y1 + t * dy1; - return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); - } - function projectPointToRect(x1, y1, width, height, x, y, out) { - if (width < 0) { - x1 = x1 + width; - width = -width; - } - if (height < 0) { - y1 = y1 + height; - height = -height; - } - var x2 = x1 + width; - var y2 = y1 + height; - var ox = out[0] = Math.min(Math.max(x, x1), x2); - var oy = out[1] = Math.min(Math.max(y, y1), y2); - return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); - } - var tmpPt = []; - function nearestPointOnRect(pt, rect, out) { - var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt); - out.set(tmpPt[0], tmpPt[1]); - return dist; - } - /** - * Calculate min distance corresponding point. - * This method won't evaluate if point is in the path. - */ - function nearestPointOnPath(pt, path, out) { - var xi = 0; - var yi = 0; - var x0 = 0; - var y0 = 0; - var x1; - var y1; - var minDist = Infinity; - var data = path.data; - var x = pt.x; - var y = pt.y; - for (var i = 0; i < data.length;) { - var cmd = data[i++]; - if (i === 1) { - xi = data[i]; - yi = data[i + 1]; - x0 = xi; - y0 = yi; - } - var d = minDist; - switch (cmd) { - case CMD$3.M: - // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 - // 在 closePath 的时候使用 - x0 = data[i++]; - y0 = data[i++]; - xi = x0; - yi = y0; - break; - case CMD$3.L: - d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true); - xi = data[i++]; - yi = data[i++]; - break; - case CMD$3.C: - d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); - xi = data[i++]; - yi = data[i++]; - break; - case CMD$3.Q: - d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); - xi = data[i++]; - yi = data[i++]; - break; - case CMD$3.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++]); - x1 = Math.cos(theta) * rx + cx; - y1 = Math.sin(theta) * ry + cy; - // 不是直接使用 arc 命令 - if (i <= 1) { - // 第一个命令起点还未定义 - x0 = x1; - y0 = y1; - } - // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 - var _x = (x - cx) * ry / rx + cx; - d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt); - xi = Math.cos(theta + dTheta) * rx + cx; - yi = Math.sin(theta + dTheta) * ry + cy; - break; - case CMD$3.R: - x0 = xi = data[i++]; - y0 = yi = data[i++]; - var width = data[i++]; - var height = data[i++]; - d = projectPointToRect(x0, y0, width, height, x, y, tmpPt); - break; - case CMD$3.Z: - d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true); - xi = x0; - yi = y0; - break; - } - if (d < minDist) { - minDist = d; - out.set(tmpPt[0], tmpPt[1]); - } - } - return minDist; - } - // Temporal variable for intermediate usage. - var pt0 = new Point(); - var pt1 = new Point(); - var pt2 = new Point(); - var dir = new Point(); - var dir2 = new Point(); - /** - * Calculate a proper guide line based on the label position and graphic element definition - * @param label - * @param labelRect - * @param target - * @param targetRect - */ - function updateLabelLinePoints(target, labelLineModel) { - if (!target) { - return; - } - var labelLine = target.getTextGuideLine(); - var label = target.getTextContent(); - // Needs to create text guide in each charts. - if (!(label && labelLine)) { - return; - } - var labelGuideConfig = target.textGuideLineConfig || {}; - var points = [[0, 0], [0, 0], [0, 0]]; - var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE; - var labelRect = label.getBoundingRect().clone(); - labelRect.applyTransform(label.getComputedTransform()); - var minDist = Infinity; - var anchorPoint = labelGuideConfig.anchor; - var targetTransform = target.getComputedTransform(); - var targetInversedTransform = targetTransform && invert([], targetTransform); - var len = labelLineModel.get('length2') || 0; - if (anchorPoint) { - pt2.copy(anchorPoint); - } - for (var i = 0; i < searchSpace.length; i++) { - var candidate = searchSpace[i]; - getCandidateAnchor(candidate, 0, labelRect, pt0, dir); - Point.scaleAndAdd(pt1, pt0, dir, len); - // Transform to target coord space. - pt1.transform(targetInversedTransform); - // Note: getBoundingRect will ensure the `path` being created. - var boundingRect = target.getBoundingRect(); - var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); - // TODO pt2 is in the path - if (dist < minDist) { - minDist = dist; - // Transform back to global space. - pt1.transform(targetTransform); - pt2.transform(targetTransform); - pt2.toArray(points[0]); - pt1.toArray(points[1]); - pt0.toArray(points[2]); - } - } - limitTurnAngle(points, labelLineModel.get('minTurnAngle')); - labelLine.setShape({ - points: points - }); - } - // Temporal variable for the limitTurnAngle function - var tmpArr = []; - var tmpProjPoint = new Point(); - /** - * Reduce the line segment attached to the label to limit the turn angle between two segments. - * @param linePoints - * @param minTurnAngle Radian of minimum turn angle. 0 - 180 - */ - function limitTurnAngle(linePoints, minTurnAngle) { - if (!(minTurnAngle <= 180 && minTurnAngle > 0)) { - return; - } - minTurnAngle = minTurnAngle / 180 * Math.PI; - // The line points can be - // /pt1----pt2 (label) - // / - // pt0/ - pt0.fromArray(linePoints[0]); - pt1.fromArray(linePoints[1]); - pt2.fromArray(linePoints[2]); - Point.sub(dir, pt0, pt1); - Point.sub(dir2, pt2, pt1); - var len1 = dir.len(); - var len2 = dir2.len(); - if (len1 < 1e-3 || len2 < 1e-3) { - return; - } - dir.scale(1 / len1); - dir2.scale(1 / len2); - var angleCos = dir.dot(dir2); - var minTurnAngleCos = Math.cos(minTurnAngle); - if (minTurnAngleCos < angleCos) { - // Smaller than minTurnAngle - // Calculate project point of pt0 on pt1-pt2 - var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); - tmpProjPoint.fromArray(tmpArr); - // Calculate new projected length with limited minTurnAngle and get the new connect point - tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle)); - // Limit the new calculated connect point between pt1 and pt2. - var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); - if (isNaN(t)) { - return; - } - if (t < 0) { - Point.copy(tmpProjPoint, pt1); - } else if (t > 1) { - Point.copy(tmpProjPoint, pt2); - } - tmpProjPoint.toArray(linePoints[1]); - } - } - /** - * Limit the angle of line and the surface - * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite - */ - function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) { - if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) { - return; - } - maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI; - pt0.fromArray(linePoints[0]); - pt1.fromArray(linePoints[1]); - pt2.fromArray(linePoints[2]); - Point.sub(dir, pt1, pt0); - Point.sub(dir2, pt2, pt1); - var len1 = dir.len(); - var len2 = dir2.len(); - if (len1 < 1e-3 || len2 < 1e-3) { - return; - } - dir.scale(1 / len1); - dir2.scale(1 / len2); - var angleCos = dir.dot(surfaceNormal); - var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle); - if (angleCos < maxSurfaceAngleCos) { - // Calculate project point of pt0 on pt1-pt2 - var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); - tmpProjPoint.fromArray(tmpArr); - var HALF_PI = Math.PI / 2; - var angle2 = Math.acos(dir2.dot(surfaceNormal)); - var newAngle = HALF_PI + angle2 - maxSurfaceAngle; - if (newAngle >= HALF_PI) { - // parallel - Point.copy(tmpProjPoint, pt2); - } else { - // Calculate new projected length with limited minTurnAngle and get the new connect point - tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle)); - // Limit the new calculated connect point between pt1 and pt2. - var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); - if (isNaN(t)) { - return; - } - if (t < 0) { - Point.copy(tmpProjPoint, pt1); - } else if (t > 1) { - Point.copy(tmpProjPoint, pt2); - } - } - tmpProjPoint.toArray(linePoints[1]); - } - } - function setLabelLineState(labelLine, ignore, stateName, stateModel) { - var isNormal = stateName === 'normal'; - var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); - // Make sure display. - stateObj.ignore = ignore; - // Set smooth - var smooth = stateModel.get('smooth'); - if (smooth && smooth === true) { - smooth = 0.3; - } - stateObj.shape = stateObj.shape || {}; - if (smooth > 0) { - stateObj.shape.smooth = smooth; - } - var styleObj = stateModel.getModel('lineStyle').getLineStyle(); - isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj; - } - function buildLabelLinePath(path, shape) { - var smooth = shape.smooth; - var points = shape.points; - if (!points) { - return; - } - path.moveTo(points[0][0], points[0][1]); - if (smooth > 0 && points.length >= 3) { - var len1 = dist(points[0], points[1]); - var len2 = dist(points[1], points[2]); - if (!len1 || !len2) { - path.lineTo(points[1][0], points[1][1]); - path.lineTo(points[2][0], points[2][1]); - return; - } - var moveLen = Math.min(len1, len2) * smooth; - var midPoint0 = lerp([], points[1], points[0], moveLen / len1); - var midPoint2 = lerp([], points[1], points[2], moveLen / len2); - var midPoint1 = lerp([], midPoint0, midPoint2, 0.5); - path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]); - path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]); - } else { - for (var i = 1; i < points.length; i++) { - path.lineTo(points[i][0], points[i][1]); - } - } - } - /** - * Create a label line if necessary and set it's style. - */ - function setLabelLineStyle(targetEl, statesModels, defaultStyle) { - var labelLine = targetEl.getTextGuideLine(); - var label = targetEl.getTextContent(); - if (!label) { - // Not show label line if there is no label. - if (labelLine) { - targetEl.removeTextGuideLine(); - } - return; - } - var normalModel = statesModels.normal; - var showNormal = normalModel.get('show'); - var labelIgnoreNormal = label.ignore; - for (var i = 0; i < DISPLAY_STATES.length; i++) { - var stateName = DISPLAY_STATES[i]; - var stateModel = statesModels[stateName]; - var isNormal = stateName === 'normal'; - if (stateModel) { - var stateShow = stateModel.get('show'); - var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal); - if (isLabelIgnored // Not show when label is not shown in this state. - || !retrieve2(stateShow, showNormal) // Use normal state by default if not set. - ) { - var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName]; - if (stateObj) { - stateObj.ignore = true; - } - if (!!labelLine) { - setLabelLineState(labelLine, true, stateName, stateModel); - } - continue; - } - // Create labelLine if not exists - if (!labelLine) { - labelLine = new Polyline(); - targetEl.setTextGuideLine(labelLine); - // Reset state of normal because it's new created. - // NOTE: NORMAL should always been the first! - if (!isNormal && (labelIgnoreNormal || !showNormal)) { - setLabelLineState(labelLine, true, 'normal', statesModels.normal); - } - // Use same state proxy. - if (targetEl.stateProxy) { - labelLine.stateProxy = targetEl.stateProxy; - } - } - setLabelLineState(labelLine, false, stateName, stateModel); - } - } - if (labelLine) { - defaults(labelLine.style, defaultStyle); - // Not fill. - labelLine.style.fill = null; - var showAbove = normalModel.get('showAbove'); - var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {}; - labelLineConfig.showAbove = showAbove || false; - // Custom the buildPath. - labelLine.buildPath = buildLabelLinePath; - } - } - function getLabelLineStatesModels(itemModel, labelLineName) { - labelLineName = labelLineName || 'labelLine'; - var statesModels = { - normal: itemModel.getModel(labelLineName) - }; - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - statesModels[stateName] = itemModel.getModel([stateName, labelLineName]); - } - return statesModels; - } - - function prepareLayoutList(input) { - var list = []; - for (var i = 0; i < input.length; i++) { - var rawItem = input[i]; - if (rawItem.defaultAttr.ignore) { - continue; - } - var label = rawItem.label; - var transform = label.getComputedTransform(); - // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el. - var localRect = label.getBoundingRect(); - var isAxisAligned = !transform || transform[1] < 1e-5 && transform[2] < 1e-5; - var minMargin = label.style.margin || 0; - var globalRect = localRect.clone(); - globalRect.applyTransform(transform); - globalRect.x -= minMargin / 2; - globalRect.y -= minMargin / 2; - globalRect.width += minMargin; - globalRect.height += minMargin; - var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null; - list.push({ - label: label, - labelLine: rawItem.labelLine, - rect: globalRect, - localRect: localRect, - obb: obb, - priority: rawItem.priority, - defaultAttr: rawItem.defaultAttr, - layoutOption: rawItem.computedLayoutOption, - axisAligned: isAxisAligned, - transform: transform - }); - } - return list; - } - function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) { - var len = list.length; - if (len < 2) { - return; - } - list.sort(function (a, b) { - return a.rect[xyDim] - b.rect[xyDim]; - }); - var lastPos = 0; - var delta; - var adjusted = false; - var totalShifts = 0; - for (var i = 0; i < len; i++) { - var item = list[i]; - var rect = item.rect; - delta = rect[xyDim] - lastPos; - if (delta < 0) { - // shiftForward(i, len, -delta); - rect[xyDim] -= delta; - item.label[xyDim] -= delta; - adjusted = true; - } - var shift = Math.max(-delta, 0); - totalShifts += shift; - lastPos = rect[xyDim] + rect[sizeDim]; - } - if (totalShifts > 0 && balanceShift) { - // Shift back to make the distribution more equally. - shiftList(-totalShifts / len, 0, len); - } - // TODO bleedMargin? - var first = list[0]; - var last = list[len - 1]; - var minGap; - var maxGap; - updateMinMaxGap(); - // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds. - minGap < 0 && squeezeGaps(-minGap, 0.8); - maxGap < 0 && squeezeGaps(maxGap, 0.8); - updateMinMaxGap(); - takeBoundsGap(minGap, maxGap, 1); - takeBoundsGap(maxGap, minGap, -1); - // Handle bailout when there is not enough space. - updateMinMaxGap(); - if (minGap < 0) { - squeezeWhenBailout(-minGap); - } - if (maxGap < 0) { - squeezeWhenBailout(maxGap); - } - function updateMinMaxGap() { - minGap = first.rect[xyDim] - minBound; - maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim]; - } - function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) { - if (gapThisBound < 0) { - // Move from other gap if can. - var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound); - if (moveFromMaxGap > 0) { - shiftList(moveFromMaxGap * moveDir, 0, len); - var remained = moveFromMaxGap + gapThisBound; - if (remained < 0) { - squeezeGaps(-remained * moveDir, 1); - } - } else { - squeezeGaps(-gapThisBound * moveDir, 1); - } - } - } - function shiftList(delta, start, end) { - if (delta !== 0) { - adjusted = true; - } - for (var i = start; i < end; i++) { - var item = list[i]; - var rect = item.rect; - rect[xyDim] += delta; - item.label[xyDim] += delta; - } - } - // Squeeze gaps if the labels exceed margin. - function squeezeGaps(delta, maxSqeezePercent) { - var gaps = []; - var totalGaps = 0; - for (var i = 1; i < len; i++) { - var prevItemRect = list[i - 1].rect; - var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0); - gaps.push(gap); - totalGaps += gap; - } - if (!totalGaps) { - return; - } - var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent); - if (delta > 0) { - for (var i = 0; i < len - 1; i++) { - // Distribute the shift delta to all gaps. - var movement = gaps[i] * squeezePercent; - // Forward - shiftList(movement, 0, i + 1); - } - } else { - // Backward - for (var i = len - 1; i > 0; i--) { - // Distribute the shift delta to all gaps. - var movement = gaps[i - 1] * squeezePercent; - shiftList(-movement, i, len); - } - } - } - /** - * Squeeze to allow overlap if there is no more space available. - * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds. - */ - function squeezeWhenBailout(delta) { - var dir = delta < 0 ? -1 : 1; - delta = Math.abs(delta); - var moveForEachLabel = Math.ceil(delta / (len - 1)); - for (var i = 0; i < len - 1; i++) { - if (dir > 0) { - // Forward - shiftList(moveForEachLabel, 0, i + 1); - } else { - // Backward - shiftList(-moveForEachLabel, len - i - 1, len); - } - delta -= moveForEachLabel; - if (delta <= 0) { - return; - } - } - } - return adjusted; - } - /** - * Adjust labels on x direction to avoid overlap. - */ - function shiftLayoutOnX(list, leftBound, rightBound, - // If average the shifts on all labels and add them to 0 - // TODO: Not sure if should enable it. - // Pros: The angle of lines will distribute more equally - // Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly. - balanceShift) { - return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift); - } - /** - * Adjust labels on y direction to avoid overlap. - */ - function shiftLayoutOnY(list, topBound, bottomBound, - // If average the shifts on all labels and add them to 0 - balanceShift) { - return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift); - } - function hideOverlap(labelList) { - var displayedLabels = []; - // TODO, render overflow visible first, put in the displayedLabels. - labelList.sort(function (a, b) { - return b.priority - a.priority; - }); - var globalRect = new BoundingRect(0, 0, 0, 0); - function hideEl(el) { - if (!el.ignore) { - // Show on emphasis. - var emphasisState = el.ensureState('emphasis'); - if (emphasisState.ignore == null) { - emphasisState.ignore = false; - } - } - el.ignore = true; - } - for (var i = 0; i < labelList.length; i++) { - var labelItem = labelList[i]; - var isAxisAligned = labelItem.axisAligned; - var localRect = labelItem.localRect; - var transform = labelItem.transform; - var label = labelItem.label; - var labelLine = labelItem.labelLine; - globalRect.copy(labelItem.rect); - // Add a threshold because layout may be aligned precisely. - globalRect.width -= 0.1; - globalRect.height -= 0.1; - globalRect.x += 0.05; - globalRect.y += 0.05; - var obb = labelItem.obb; - var overlapped = false; - for (var j = 0; j < displayedLabels.length; j++) { - var existsTextCfg = displayedLabels[j]; - // Fast rejection. - if (!globalRect.intersect(existsTextCfg.rect)) { - continue; - } - if (isAxisAligned && existsTextCfg.axisAligned) { - // Is overlapped - overlapped = true; - break; - } - if (!existsTextCfg.obb) { - // If self is not axis aligned. But other is. - existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform); - } - if (!obb) { - // If self is axis aligned. But other is not. - obb = new OrientedBoundingRect(localRect, transform); - } - if (obb.intersect(existsTextCfg.obb)) { - overlapped = true; - break; - } - } - // TODO Callback to determine if this overlap should be handled? - if (overlapped) { - hideEl(label); - labelLine && hideEl(labelLine); - } else { - label.attr('ignore', labelItem.defaultAttr.ignore); - labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore); - displayedLabels.push(labelItem); - } - } - } - - function cloneArr(points) { - if (points) { - var newPoints = []; - for (var i = 0; i < points.length; i++) { - newPoints.push(points[i].slice()); - } - return newPoints; - } - } - function prepareLayoutCallbackParams(labelItem, hostEl) { - var label = labelItem.label; - var labelLine = hostEl && hostEl.getTextGuideLine(); - return { - dataIndex: labelItem.dataIndex, - dataType: labelItem.dataType, - seriesIndex: labelItem.seriesModel.seriesIndex, - text: labelItem.label.style.text, - rect: labelItem.hostRect, - labelRect: labelItem.rect, - // x: labelAttr.x, - // y: labelAttr.y, - align: label.style.align, - verticalAlign: label.style.verticalAlign, - labelLinePoints: cloneArr(labelLine && labelLine.shape.points) - }; - } - var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize']; - var dummyTransformable = new Transformable(); - var labelLayoutInnerStore = makeInner(); - var labelLineAnimationStore = makeInner(); - function extendWithKeys(target, source, keys) { - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (source[key] != null) { - target[key] = source[key]; - } - } - } - var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation']; - var LabelManager = /** @class */function () { - function LabelManager() { - this._labelList = []; - this._chartViewList = []; - } - LabelManager.prototype.clearLabels = function () { - this._labelList = []; - this._chartViewList = []; - }; - /** - * Add label to manager - */ - LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) { - var labelStyle = label.style; - var hostEl = label.__hostTarget; - var textConfig = hostEl.textConfig || {}; - // TODO: If label is in other state. - var labelTransform = label.getComputedTransform(); - var labelRect = label.getBoundingRect().plain(); - BoundingRect.applyTransform(labelRect, labelRect, labelTransform); - if (labelTransform) { - dummyTransformable.setLocalTransform(labelTransform); - } else { - // Identity transform. - dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0; - dummyTransformable.scaleX = dummyTransformable.scaleY = 1; - } - dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation); - var host = label.__hostTarget; - var hostRect; - if (host) { - hostRect = host.getBoundingRect().plain(); - var transform = host.getComputedTransform(); - BoundingRect.applyTransform(hostRect, hostRect, transform); - } - var labelGuide = hostRect && host.getTextGuideLine(); - this._labelList.push({ - label: label, - labelLine: labelGuide, - seriesModel: seriesModel, - dataIndex: dataIndex, - dataType: dataType, - layoutOption: layoutOption, - computedLayoutOption: null, - rect: labelRect, - hostRect: hostRect, - // Label with lower priority will be hidden when overlapped - // Use rect size as default priority - priority: hostRect ? hostRect.width * hostRect.height : 0, - // Save default label attributes. - // For restore if developers want get back to default value in callback. - defaultAttr: { - ignore: label.ignore, - labelGuideIgnore: labelGuide && labelGuide.ignore, - x: dummyTransformable.x, - y: dummyTransformable.y, - scaleX: dummyTransformable.scaleX, - scaleY: dummyTransformable.scaleY, - rotation: dummyTransformable.rotation, - style: { - x: labelStyle.x, - y: labelStyle.y, - align: labelStyle.align, - verticalAlign: labelStyle.verticalAlign, - width: labelStyle.width, - height: labelStyle.height, - fontSize: labelStyle.fontSize - }, - cursor: label.cursor, - attachedPos: textConfig.position, - attachedRot: textConfig.rotation - } - }); - }; - LabelManager.prototype.addLabelsOfSeries = function (chartView) { - var _this = this; - this._chartViewList.push(chartView); - var seriesModel = chartView.__model; - var layoutOption = seriesModel.get('labelLayout'); - /** - * Ignore layouting if it's not specified anything. - */ - if (!(isFunction(layoutOption) || keys(layoutOption).length)) { - return; - } - chartView.group.traverse(function (child) { - if (child.ignore) { - return true; // Stop traverse descendants. - } - // Only support label being hosted on graphic elements. - var textEl = child.getTextContent(); - var ecData = getECData(child); - // Can only attach the text on the element with dataIndex - if (textEl && !textEl.disableLabelLayout) { - _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption); - } - }); - }; - LabelManager.prototype.updateLayoutConfig = function (api) { - var width = api.getWidth(); - var height = api.getHeight(); - function createDragHandler(el, labelLineModel) { - return function () { - updateLabelLinePoints(el, labelLineModel); - }; - } - for (var i = 0; i < this._labelList.length; i++) { - var labelItem = this._labelList[i]; - var label = labelItem.label; - var hostEl = label.__hostTarget; - var defaultLabelAttr = labelItem.defaultAttr; - var layoutOption = void 0; - // TODO A global layout option? - if (isFunction(labelItem.layoutOption)) { - layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl)); - } else { - layoutOption = labelItem.layoutOption; - } - layoutOption = layoutOption || {}; - labelItem.computedLayoutOption = layoutOption; - var degreeToRadian = Math.PI / 180; - // TODO hostEl should always exists. - // Or label should not have parent because the x, y is all in global space. - if (hostEl) { - hostEl.setTextConfig({ - // Force to set local false. - local: false, - // Ignore position and rotation config on the host el if x or y is changed. - position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos, - // Ignore rotation config on the host el if rotation is changed. - rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot, - offset: [layoutOption.dx || 0, layoutOption.dy || 0] - }); - } - var needsUpdateLabelLine = false; - if (layoutOption.x != null) { - // TODO width of chart view. - label.x = parsePercent$1(layoutOption.x, width); - label.setStyle('x', 0); // Ignore movement in style. TODO: origin. - needsUpdateLabelLine = true; - } else { - label.x = defaultLabelAttr.x; - label.setStyle('x', defaultLabelAttr.style.x); - } - if (layoutOption.y != null) { - // TODO height of chart view. - label.y = parsePercent$1(layoutOption.y, height); - label.setStyle('y', 0); // Ignore movement in style. - needsUpdateLabelLine = true; - } else { - label.y = defaultLabelAttr.y; - label.setStyle('y', defaultLabelAttr.style.y); - } - if (layoutOption.labelLinePoints) { - var guideLine = hostEl.getTextGuideLine(); - if (guideLine) { - guideLine.setShape({ - points: layoutOption.labelLinePoints - }); - // Not update - needsUpdateLabelLine = false; - } - } - var labelLayoutStore = labelLayoutInnerStore(label); - labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine; - label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation; - label.scaleX = defaultLabelAttr.scaleX; - label.scaleY = defaultLabelAttr.scaleY; - for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) { - var key = LABEL_OPTION_TO_STYLE_KEYS[k]; - label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]); - } - if (layoutOption.draggable) { - label.draggable = true; - label.cursor = 'move'; - if (hostEl) { - var hostModel = labelItem.seriesModel; - if (labelItem.dataIndex != null) { - var data = labelItem.seriesModel.getData(labelItem.dataType); - hostModel = data.getItemModel(labelItem.dataIndex); - } - label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine'))); - } - } else { - // TODO Other drag functions? - label.off('drag'); - label.cursor = defaultLabelAttr.cursor; - } - } - }; - LabelManager.prototype.layout = function (api) { - var width = api.getWidth(); - var height = api.getHeight(); - var labelList = prepareLayoutList(this._labelList); - var labelsNeedsAdjustOnX = filter(labelList, function (item) { - return item.layoutOption.moveOverlap === 'shiftX'; - }); - var labelsNeedsAdjustOnY = filter(labelList, function (item) { - return item.layoutOption.moveOverlap === 'shiftY'; - }); - shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width); - shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height); - var labelsNeedsHideOverlap = filter(labelList, function (item) { - return item.layoutOption.hideOverlap; - }); - hideOverlap(labelsNeedsHideOverlap); - }; - /** - * Process all labels. Not only labels with layoutOption. - */ - LabelManager.prototype.processLabelsOverall = function () { - var _this = this; - each(this._chartViewList, function (chartView) { - var seriesModel = chartView.__model; - var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate; - var animationEnabled = seriesModel.isAnimationEnabled(); - chartView.group.traverse(function (child) { - if (child.ignore && !child.forceLabelAnimation) { - return true; // Stop traverse descendants. - } - - var needsUpdateLabelLine = !ignoreLabelLineUpdate; - var label = child.getTextContent(); - if (!needsUpdateLabelLine && label) { - needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine; - } - if (needsUpdateLabelLine) { - _this._updateLabelLine(child, seriesModel); - } - if (animationEnabled) { - _this._animateLabels(child, seriesModel); - } - }); - }); - }; - LabelManager.prototype._updateLabelLine = function (el, seriesModel) { - // Only support label being hosted on graphic elements. - var textEl = el.getTextContent(); - // Update label line style. - var ecData = getECData(el); - var dataIndex = ecData.dataIndex; - // Only support labelLine on the labels represent data. - if (textEl && dataIndex != null) { - var data = seriesModel.getData(ecData.dataType); - var itemModel = data.getItemModel(dataIndex); - var defaultStyle = {}; - var visualStyle = data.getItemVisual(dataIndex, 'style'); - if (visualStyle) { - var visualType = data.getVisual('drawType'); - // Default to be same with main color - defaultStyle.stroke = visualStyle[visualType]; - } - var labelLineModel = itemModel.getModel('labelLine'); - setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle); - updateLabelLinePoints(el, labelLineModel); - } - }; - LabelManager.prototype._animateLabels = function (el, seriesModel) { - var textEl = el.getTextContent(); - var guideLine = el.getTextGuideLine(); - // Animate - if (textEl - // `forceLabelAnimation` has the highest priority - && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) { - var layoutStore = labelLayoutInnerStore(textEl); - var oldLayout = layoutStore.oldLayout; - var ecData = getECData(el); - var dataIndex = ecData.dataIndex; - var newProps = { - x: textEl.x, - y: textEl.y, - rotation: textEl.rotation - }; - var data = seriesModel.getData(ecData.dataType); - if (!oldLayout) { - textEl.attr(newProps); - // Disable fade in animation if value animation is enabled. - if (!labelInner(textEl).valueAnimation) { - var oldOpacity = retrieve2(textEl.style.opacity, 1); - // Fade in animation - textEl.style.opacity = 0; - initProps(textEl, { - style: { - opacity: oldOpacity - } - }, seriesModel, dataIndex); - } - } else { - textEl.attr(oldLayout); - // Make sure the animation from is in the right status. - var prevStates = el.prevStates; - if (prevStates) { - if (indexOf(prevStates, 'select') >= 0) { - textEl.attr(layoutStore.oldLayoutSelect); - } - if (indexOf(prevStates, 'emphasis') >= 0) { - textEl.attr(layoutStore.oldLayoutEmphasis); - } - } - updateProps(textEl, newProps, seriesModel, dataIndex); - } - layoutStore.oldLayout = newProps; - if (textEl.states.select) { - var layoutSelect = layoutStore.oldLayoutSelect = {}; - extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS); - extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS); - } - if (textEl.states.emphasis) { - var layoutEmphasis = layoutStore.oldLayoutEmphasis = {}; - extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS); - extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS); - } - animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel); - } - if (guideLine && !guideLine.ignore && !guideLine.invisible) { - var layoutStore = labelLineAnimationStore(guideLine); - var oldLayout = layoutStore.oldLayout; - var newLayout = { - points: guideLine.shape.points - }; - if (!oldLayout) { - guideLine.setShape(newLayout); - guideLine.style.strokePercent = 0; - initProps(guideLine, { - style: { - strokePercent: 1 - } - }, seriesModel); - } else { - guideLine.attr({ - shape: oldLayout - }); - updateProps(guideLine, { - shape: newLayout - }, seriesModel); - } - layoutStore.oldLayout = newLayout; - } - }; - return LabelManager; - }(); - - var getLabelManager = makeInner(); - function installLabelLayout(registers) { - registers.registerUpdateLifecycle('series:beforeupdate', function (ecModel, api, params) { - // TODO api provide an namespace that can save stuff per instance - var labelManager = getLabelManager(api).labelManager; - if (!labelManager) { - labelManager = getLabelManager(api).labelManager = new LabelManager(); - } - labelManager.clearLabels(); - }); - registers.registerUpdateLifecycle('series:layoutlabels', function (ecModel, api, params) { - var labelManager = getLabelManager(api).labelManager; - params.updatedSeries.forEach(function (series) { - labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series)); - }); - labelManager.updateLayoutConfig(api); - labelManager.layout(api); - labelManager.processLabelsOverall(); - }); - } - - var mathSin$4 = Math.sin; - var mathCos$4 = Math.cos; - var PI$4 = Math.PI; - var PI2$7 = Math.PI * 2; - var degree = 180 / PI$4; - var SVGPathRebuilder = (function () { - function SVGPathRebuilder() { - } - SVGPathRebuilder.prototype.reset = function (precision) { - this._start = true; - this._d = []; - this._str = ''; - this._p = Math.pow(10, precision || 4); - }; - SVGPathRebuilder.prototype.moveTo = function (x, y) { - this._add('M', x, y); - }; - SVGPathRebuilder.prototype.lineTo = function (x, y) { - this._add('L', x, y); - }; - SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) { - this._add('C', x, y, x2, y2, x3, y3); - }; - SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) { - this._add('Q', x, y, x2, y2); - }; - SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { - this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise); - }; - SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) { - var dTheta = endAngle - startAngle; - var clockwise = !anticlockwise; - var dThetaPositive = Math.abs(dTheta); - var isCircle = isAroundZero$1(dThetaPositive - PI2$7) - || (clockwise ? dTheta >= PI2$7 : -dTheta >= PI2$7); - var unifiedTheta = dTheta > 0 ? dTheta % PI2$7 : (dTheta % PI2$7 + PI2$7); - var large = false; - if (isCircle) { - large = true; - } - else if (isAroundZero$1(dThetaPositive)) { - large = false; - } - else { - large = (unifiedTheta >= PI$4) === !!clockwise; - } - var x0 = cx + rx * mathCos$4(startAngle); - var y0 = cy + ry * mathSin$4(startAngle); - if (this._start) { - this._add('M', x0, y0); - } - var xRot = Math.round(psi * degree); - if (isCircle) { - var p = 1 / this._p; - var dTheta_1 = (clockwise ? 1 : -1) * (PI2$7 - p); - this._add('A', rx, ry, xRot, 1, +clockwise, cx + rx * mathCos$4(startAngle + dTheta_1), cy + ry * mathSin$4(startAngle + dTheta_1)); - if (p > 1e-2) { - this._add('A', rx, ry, xRot, 0, +clockwise, x0, y0); - } - } - else { - var x = cx + rx * mathCos$4(endAngle); - var y = cy + ry * mathSin$4(endAngle); - this._add('A', rx, ry, xRot, +large, +clockwise, x, y); - } - }; - SVGPathRebuilder.prototype.rect = function (x, y, w, h) { - this._add('M', x, y); - this._add('l', w, 0); - this._add('l', 0, h); - this._add('l', -w, 0); - this._add('Z'); - }; - SVGPathRebuilder.prototype.closePath = function () { - if (this._d.length > 0) { - this._add('Z'); - } - }; - SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) { - var vals = []; - var p = this._p; - for (var i = 1; i < arguments.length; i++) { - var val = arguments[i]; - if (isNaN(val)) { - this._invalid = true; - return; - } - vals.push(Math.round(val * p) / p); - } - this._d.push(cmd + vals.join(' ')); - this._start = cmd === 'Z'; - }; - SVGPathRebuilder.prototype.generateStr = function () { - this._str = this._invalid ? '' : this._d.join(''); - this._d = []; - }; - SVGPathRebuilder.prototype.getStr = function () { - return this._str; - }; - return SVGPathRebuilder; - }()); - - var NONE = 'none'; - var mathRound$1 = Math.round; - function pathHasFill(style) { - var fill = style.fill; - return fill != null && fill !== NONE; - } - function pathHasStroke(style) { - var stroke = style.stroke; - return stroke != null && stroke !== NONE; - } - var strokeProps = ['lineCap', 'miterLimit', 'lineJoin']; - var svgStrokeProps = map(strokeProps, function (prop) { return "stroke-" + prop.toLowerCase(); }); - function mapStyleToAttrs(updateAttr, style, el, forceUpdate) { - var opacity = style.opacity == null ? 1 : style.opacity; - if (el instanceof ZRImage) { - updateAttr('opacity', opacity); - return; - } - if (pathHasFill(style)) { - var fill = normalizeColor(style.fill); - updateAttr('fill', fill.color); - var fillOpacity = style.fillOpacity != null - ? style.fillOpacity * fill.opacity * opacity - : fill.opacity * opacity; - if (forceUpdate || fillOpacity < 1) { - updateAttr('fill-opacity', fillOpacity); - } - } - else { - updateAttr('fill', NONE); - } - if (pathHasStroke(style)) { - var stroke = normalizeColor(style.stroke); - updateAttr('stroke', stroke.color); - var strokeScale = style.strokeNoScale - ? el.getLineScale() - : 1; - var strokeWidth = (strokeScale ? (style.lineWidth || 0) / strokeScale : 0); - var strokeOpacity = style.strokeOpacity != null - ? style.strokeOpacity * stroke.opacity * opacity - : stroke.opacity * opacity; - var strokeFirst = style.strokeFirst; - if (forceUpdate || strokeWidth !== 1) { - updateAttr('stroke-width', strokeWidth); - } - if (forceUpdate || strokeFirst) { - updateAttr('paint-order', strokeFirst ? 'stroke' : 'fill'); - } - if (forceUpdate || strokeOpacity < 1) { - updateAttr('stroke-opacity', strokeOpacity); - } - if (style.lineDash) { - var _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1]; - if (lineDash) { - lineDashOffset = mathRound$1(lineDashOffset || 0); - updateAttr('stroke-dasharray', lineDash.join(',')); - if (lineDashOffset || forceUpdate) { - updateAttr('stroke-dashoffset', lineDashOffset); - } - } - } - else if (forceUpdate) { - updateAttr('stroke-dasharray', NONE); - } - for (var i = 0; i < strokeProps.length; i++) { - var propName = strokeProps[i]; - if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) { - var val = style[propName] || DEFAULT_PATH_STYLE[propName]; - val && updateAttr(svgStrokeProps[i], val); - } - } - } - else if (forceUpdate) { - updateAttr('stroke', NONE); - } - } - - var SVGNS = 'http://www.w3.org/2000/svg'; - var XLINKNS = 'http://www.w3.org/1999/xlink'; - var XMLNS = 'http://www.w3.org/2000/xmlns/'; - var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'; - var META_DATA_PREFIX = 'ecmeta_'; - function createElement(name) { - return document.createElementNS(SVGNS, name); - } - function createVNode(tag, key, attrs, children, text) { - return { - tag: tag, - attrs: attrs || {}, - children: children, - text: text, - key: key - }; - } - function createElementOpen(name, attrs) { - var attrsStr = []; - if (attrs) { - for (var key in attrs) { - var val = attrs[key]; - var part = key; - if (val === false) { - continue; - } - else if (val !== true && val != null) { - part += "=\"" + val + "\""; - } - attrsStr.push(part); - } - } - return "<" + name + " " + attrsStr.join(' ') + ">"; - } - function createElementClose(name) { - return ""; - } - function vNodeToString(el, opts) { - opts = opts || {}; - var S = opts.newline ? '\n' : ''; - function convertElToString(el) { - var children = el.children, tag = el.tag, attrs = el.attrs, text = el.text; - return createElementOpen(tag, attrs) - + (tag !== 'style' ? encodeHTML(text) : text || '') - + (children ? "" + S + map(children, function (child) { return convertElToString(child); }).join(S) + S : '') - + createElementClose(tag); - } - return convertElToString(el); - } - function getCssString(selectorNodes, animationNodes, opts) { - opts = opts || {}; - var S = opts.newline ? '\n' : ''; - var bracketBegin = " {" + S; - var bracketEnd = S + "}"; - var selectors = map(keys(selectorNodes), function (className) { - return className + bracketBegin + map(keys(selectorNodes[className]), function (attrName) { - return attrName + ":" + selectorNodes[className][attrName] + ";"; - }).join(S) + bracketEnd; - }).join(S); - var animations = map(keys(animationNodes), function (animationName) { - return "@keyframes " + animationName + bracketBegin + map(keys(animationNodes[animationName]), function (percent) { - return percent + bracketBegin + map(keys(animationNodes[animationName][percent]), function (attrName) { - var val = animationNodes[animationName][percent][attrName]; - if (attrName === 'd') { - val = "path(\"" + val + "\")"; - } - return attrName + ":" + val + ";"; - }).join(S) + bracketEnd; - }).join(S) + bracketEnd; - }).join(S); - if (!selectors && !animations) { - return ''; - } - return [''].join(S); - } - function createBrushScope(zrId) { - return { - zrId: zrId, - shadowCache: {}, - patternCache: {}, - gradientCache: {}, - clipPathCache: {}, - defs: {}, - cssNodes: {}, - cssAnims: {}, - cssStyleCache: {}, - cssAnimIdx: 0, - shadowIdx: 0, - gradientIdx: 0, - patternIdx: 0, - clipPathIdx: 0 - }; - } - function createSVGVNode(width, height, children, useViewBox) { - return createVNode('svg', 'root', { - 'width': width, - 'height': height, - 'xmlns': SVGNS, - 'xmlns:xlink': XLINKNS, - 'version': '1.1', - 'baseProfile': 'full', - 'viewBox': useViewBox ? "0 0 " + width + " " + height : false - }, children); - } - - var cssClassIdx = 0; - function getClassId() { - return cssClassIdx++; - } - - var EASING_MAP = { - cubicIn: '0.32,0,0.67,0', - cubicOut: '0.33,1,0.68,1', - cubicInOut: '0.65,0,0.35,1', - quadraticIn: '0.11,0,0.5,0', - quadraticOut: '0.5,1,0.89,1', - quadraticInOut: '0.45,0,0.55,1', - quarticIn: '0.5,0,0.75,0', - quarticOut: '0.25,1,0.5,1', - quarticInOut: '0.76,0,0.24,1', - quinticIn: '0.64,0,0.78,0', - quinticOut: '0.22,1,0.36,1', - quinticInOut: '0.83,0,0.17,1', - sinusoidalIn: '0.12,0,0.39,0', - sinusoidalOut: '0.61,1,0.88,1', - sinusoidalInOut: '0.37,0,0.63,1', - exponentialIn: '0.7,0,0.84,0', - exponentialOut: '0.16,1,0.3,1', - exponentialInOut: '0.87,0,0.13,1', - circularIn: '0.55,0,1,0.45', - circularOut: '0,0.55,0.45,1', - circularInOut: '0.85,0,0.15,1' - }; - var transformOriginKey = 'transform-origin'; - function buildPathString(el, kfShape, path) { - var shape = extend({}, el.shape); - extend(shape, kfShape); - el.buildPath(path, shape); - var svgPathBuilder = new SVGPathRebuilder(); - svgPathBuilder.reset(getPathPrecision(el)); - path.rebuildPath(svgPathBuilder, 1); - svgPathBuilder.generateStr(); - return svgPathBuilder.getStr(); - } - function setTransformOrigin(target, transform) { - var originX = transform.originX, originY = transform.originY; - if (originX || originY) { - target[transformOriginKey] = originX + "px " + originY + "px"; - } - } - var ANIMATE_STYLE_MAP = { - fill: 'fill', - opacity: 'opacity', - lineWidth: 'stroke-width', - lineDashOffset: 'stroke-dashoffset' - }; - function addAnimation(cssAnim, scope) { - var animationName = scope.zrId + '-ani-' + scope.cssAnimIdx++; - scope.cssAnims[animationName] = cssAnim; - return animationName; - } - function createCompoundPathCSSAnimation(el, attrs, scope) { - var paths = el.shape.paths; - var composedAnim = {}; - var cssAnimationCfg; - var cssAnimationName; - each(paths, function (path) { - var subScope = createBrushScope(scope.zrId); - subScope.animation = true; - createCSSAnimation(path, {}, subScope, true); - var cssAnims = subScope.cssAnims; - var cssNodes = subScope.cssNodes; - var animNames = keys(cssAnims); - var len = animNames.length; - if (!len) { - return; - } - cssAnimationName = animNames[len - 1]; - var lastAnim = cssAnims[cssAnimationName]; - for (var percent in lastAnim) { - var kf = lastAnim[percent]; - composedAnim[percent] = composedAnim[percent] || { d: '' }; - composedAnim[percent].d += kf.d || ''; - } - for (var className in cssNodes) { - var val = cssNodes[className].animation; - if (val.indexOf(cssAnimationName) >= 0) { - cssAnimationCfg = val; - } - } - }); - if (!cssAnimationCfg) { - return; - } - attrs.d = false; - var animationName = addAnimation(composedAnim, scope); - return cssAnimationCfg.replace(cssAnimationName, animationName); - } - function getEasingFunc(easing) { - return isString(easing) - ? EASING_MAP[easing] - ? "cubic-bezier(" + EASING_MAP[easing] + ")" - : createCubicEasingFunc(easing) ? easing : '' - : ''; - } - function createCSSAnimation(el, attrs, scope, onlyShape) { - var animators = el.animators; - var len = animators.length; - var cssAnimations = []; - if (el instanceof CompoundPath) { - var animationCfg = createCompoundPathCSSAnimation(el, attrs, scope); - if (animationCfg) { - cssAnimations.push(animationCfg); - } - else if (!len) { - return; - } - } - else if (!len) { - return; - } - var groupAnimators = {}; - for (var i = 0; i < len; i++) { - var animator = animators[i]; - var cfgArr = [animator.getMaxTime() / 1000 + 's']; - var easing = getEasingFunc(animator.getClip().easing); - var delay = animator.getDelay(); - if (easing) { - cfgArr.push(easing); - } - else { - cfgArr.push('linear'); - } - if (delay) { - cfgArr.push(delay / 1000 + 's'); - } - if (animator.getLoop()) { - cfgArr.push('infinite'); - } - var cfg = cfgArr.join(' '); - groupAnimators[cfg] = groupAnimators[cfg] || [cfg, []]; - groupAnimators[cfg][1].push(animator); - } - function createSingleCSSAnimation(groupAnimator) { - var animators = groupAnimator[1]; - var len = animators.length; - var transformKfs = {}; - var shapeKfs = {}; - var finalKfs = {}; - var animationTimingFunctionAttrName = 'animation-timing-function'; - function saveAnimatorTrackToCssKfs(animator, cssKfs, toCssAttrName) { - var tracks = animator.getTracks(); - var maxTime = animator.getMaxTime(); - for (var k = 0; k < tracks.length; k++) { - var track = tracks[k]; - if (track.needsAnimate()) { - var kfs = track.keyframes; - var attrName = track.propName; - toCssAttrName && (attrName = toCssAttrName(attrName)); - if (attrName) { - for (var i = 0; i < kfs.length; i++) { - var kf = kfs[i]; - var percent = Math.round(kf.time / maxTime * 100) + '%'; - var kfEasing = getEasingFunc(kf.easing); - var rawValue = kf.rawValue; - if (isString(rawValue) || isNumber(rawValue)) { - cssKfs[percent] = cssKfs[percent] || {}; - cssKfs[percent][attrName] = kf.rawValue; - if (kfEasing) { - cssKfs[percent][animationTimingFunctionAttrName] = kfEasing; - } - } - } - } - } - } - } - for (var i = 0; i < len; i++) { - var animator = animators[i]; - var targetProp = animator.targetName; - if (!targetProp) { - !onlyShape && saveAnimatorTrackToCssKfs(animator, transformKfs); - } - else if (targetProp === 'shape') { - saveAnimatorTrackToCssKfs(animator, shapeKfs); - } - } - for (var percent in transformKfs) { - var transform = {}; - copyTransform(transform, el); - extend(transform, transformKfs[percent]); - var str = getSRTTransformString(transform); - var timingFunction = transformKfs[percent][animationTimingFunctionAttrName]; - finalKfs[percent] = str ? { - transform: str - } : {}; - setTransformOrigin(finalKfs[percent], transform); - if (timingFunction) { - finalKfs[percent][animationTimingFunctionAttrName] = timingFunction; - } - } - var path; - var canAnimateShape = true; - for (var percent in shapeKfs) { - finalKfs[percent] = finalKfs[percent] || {}; - var isFirst = !path; - var timingFunction = shapeKfs[percent][animationTimingFunctionAttrName]; - if (isFirst) { - path = new PathProxy(); - } - var len_1 = path.len(); - path.reset(); - finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path); - var newLen = path.len(); - if (!isFirst && len_1 !== newLen) { - canAnimateShape = false; - break; - } - if (timingFunction) { - finalKfs[percent][animationTimingFunctionAttrName] = timingFunction; - } - } - if (!canAnimateShape) { - for (var percent in finalKfs) { - delete finalKfs[percent].d; - } - } - if (!onlyShape) { - for (var i = 0; i < len; i++) { - var animator = animators[i]; - var targetProp = animator.targetName; - if (targetProp === 'style') { - saveAnimatorTrackToCssKfs(animator, finalKfs, function (propName) { return ANIMATE_STYLE_MAP[propName]; }); - } - } - } - var percents = keys(finalKfs); - var allTransformOriginSame = true; - var transformOrigin; - for (var i = 1; i < percents.length; i++) { - var p0 = percents[i - 1]; - var p1 = percents[i]; - if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) { - allTransformOriginSame = false; - break; - } - transformOrigin = finalKfs[p0][transformOriginKey]; - } - if (allTransformOriginSame && transformOrigin) { - for (var percent in finalKfs) { - if (finalKfs[percent][transformOriginKey]) { - delete finalKfs[percent][transformOriginKey]; - } - } - attrs[transformOriginKey] = transformOrigin; - } - if (filter(percents, function (percent) { return keys(finalKfs[percent]).length > 0; }).length) { - var animationName = addAnimation(finalKfs, scope); - return animationName + " " + groupAnimator[0] + " both"; - } - } - for (var key in groupAnimators) { - var animationCfg = createSingleCSSAnimation(groupAnimators[key]); - if (animationCfg) { - cssAnimations.push(animationCfg); - } - } - if (cssAnimations.length) { - var className = scope.zrId + '-cls-' + getClassId(); - scope.cssNodes['.' + className] = { - animation: cssAnimations.join(',') - }; - attrs["class"] = className; - } - } - - function createCSSEmphasis(el, attrs, scope) { - if (!el.ignore) { - if (el.isSilent()) { - var style = { - 'pointer-events': 'none' - }; - setClassAttribute(style, attrs, scope, true); - } - else { - var emphasisStyle = el.states.emphasis && el.states.emphasis.style - ? el.states.emphasis.style - : {}; - var fill = emphasisStyle.fill; - if (!fill) { - var normalFill = el.style && el.style.fill; - var selectFill = el.states.select - && el.states.select.style - && el.states.select.style.fill; - var fromFill = el.currentStates.indexOf('select') >= 0 - ? (selectFill || normalFill) - : normalFill; - if (fromFill) { - fill = liftColor(fromFill); - } - } - var lineWidth = emphasisStyle.lineWidth; - if (lineWidth) { - var scaleX = (!emphasisStyle.strokeNoScale && el.transform) - ? el.transform[0] - : 1; - lineWidth = lineWidth / scaleX; - } - var style = { - cursor: 'pointer' - }; - if (fill) { - style.fill = fill; - } - if (emphasisStyle.stroke) { - style.stroke = emphasisStyle.stroke; - } - if (lineWidth) { - style['stroke-width'] = lineWidth; - } - setClassAttribute(style, attrs, scope, true); - } - } - } - function setClassAttribute(style, attrs, scope, withHover) { - var styleKey = JSON.stringify(style); - var className = scope.cssStyleCache[styleKey]; - if (!className) { - className = scope.zrId + '-cls-' + getClassId(); - scope.cssStyleCache[styleKey] = className; - scope.cssNodes['.' + className + (withHover ? ':hover' : '')] = style; - } - attrs["class"] = attrs["class"] ? (attrs["class"] + ' ' + className) : className; - } - - var round$2 = Math.round; - function isImageLike$1(val) { - return val && isString(val.src); - } - function isCanvasLike(val) { - return val && isFunction(val.toDataURL); - } - function setStyleAttrs(attrs, style, el, scope) { - mapStyleToAttrs(function (key, val) { - var isFillStroke = key === 'fill' || key === 'stroke'; - if (isFillStroke && isGradient(val)) { - setGradient(style, attrs, key, scope); - } - else if (isFillStroke && isPattern(val)) { - setPattern(el, attrs, key, scope); - } - else if (isFillStroke && val === 'none') { - attrs[key] = 'transparent'; - } - else { - attrs[key] = val; - } - }, style, el, false); - setShadow(el, attrs, scope); - } - function setMetaData(attrs, el) { - var metaData = getElementSSRData(el); - if (metaData) { - metaData.each(function (val, key) { - val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + ''); - }); - if (el.isSilent()) { - attrs[META_DATA_PREFIX + 'silent'] = 'true'; - } - } - } - function noRotateScale(m) { - return isAroundZero$1(m[0] - 1) - && isAroundZero$1(m[1]) - && isAroundZero$1(m[2]) - && isAroundZero$1(m[3] - 1); - } - function noTranslate(m) { - return isAroundZero$1(m[4]) && isAroundZero$1(m[5]); - } - function setTransform(attrs, m, compress) { - if (m && !(noTranslate(m) && noRotateScale(m))) { - var mul = compress ? 10 : 1e4; - attrs.transform = noRotateScale(m) - ? "translate(" + round$2(m[4] * mul) / mul + " " + round$2(m[5] * mul) / mul + ")" : getMatrixStr(m); - } - } - function convertPolyShape(shape, attrs, mul) { - var points = shape.points; - var strArr = []; - for (var i = 0; i < points.length; i++) { - strArr.push(round$2(points[i][0] * mul) / mul); - strArr.push(round$2(points[i][1] * mul) / mul); - } - attrs.points = strArr.join(' '); - } - function validatePolyShape(shape) { - return !shape.smooth; - } - function createAttrsConvert(desc) { - var normalizedDesc = map(desc, function (item) { - return (typeof item === 'string' ? [item, item] : item); - }); - return function (shape, attrs, mul) { - for (var i = 0; i < normalizedDesc.length; i++) { - var item = normalizedDesc[i]; - var val = shape[item[0]]; - if (val != null) { - attrs[item[1]] = round$2(val * mul) / mul; - } - } - }; - } - var builtinShapesDef = { - circle: [createAttrsConvert(['cx', 'cy', 'r'])], - polyline: [convertPolyShape, validatePolyShape], - polygon: [convertPolyShape, validatePolyShape] - }; - function hasShapeAnimation(el) { - var animators = el.animators; - for (var i = 0; i < animators.length; i++) { - if (animators[i].targetName === 'shape') { - return true; - } - } - return false; - } - function brushSVGPath(el, scope) { - var style = el.style; - var shape = el.shape; - var builtinShpDef = builtinShapesDef[el.type]; - var attrs = {}; - var needsAnimate = scope.animation; - var svgElType = 'path'; - var strokePercent = el.style.strokePercent; - var precision = (scope.compress && getPathPrecision(el)) || 4; - if (builtinShpDef - && !scope.willUpdate - && !(builtinShpDef[1] && !builtinShpDef[1](shape)) - && !(needsAnimate && hasShapeAnimation(el)) - && !(strokePercent < 1)) { - svgElType = el.type; - var mul = Math.pow(10, precision); - builtinShpDef[0](shape, attrs, mul); - } - else { - var needBuildPath = !el.path || el.shapeChanged(); - if (!el.path) { - el.createPathProxy(); - } - var path = el.path; - if (needBuildPath) { - path.beginPath(); - el.buildPath(path, el.shape); - el.pathUpdated(); - } - var pathVersion = path.getVersion(); - var elExt = el; - var svgPathBuilder = elExt.__svgPathBuilder; - if (elExt.__svgPathVersion !== pathVersion - || !svgPathBuilder - || strokePercent !== elExt.__svgPathStrokePercent) { - if (!svgPathBuilder) { - svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder(); - } - svgPathBuilder.reset(precision); - path.rebuildPath(svgPathBuilder, strokePercent); - svgPathBuilder.generateStr(); - elExt.__svgPathVersion = pathVersion; - elExt.__svgPathStrokePercent = strokePercent; - } - attrs.d = svgPathBuilder.getStr(); - } - setTransform(attrs, el.transform); - setStyleAttrs(attrs, style, el, scope); - setMetaData(attrs, el); - scope.animation && createCSSAnimation(el, attrs, scope); - scope.emphasis && createCSSEmphasis(el, attrs, scope); - return createVNode(svgElType, el.id + '', attrs); - } - function brushSVGImage(el, scope) { - var style = el.style; - var image = style.image; - if (image && !isString(image)) { - if (isImageLike$1(image)) { - image = image.src; - } - else if (isCanvasLike(image)) { - image = image.toDataURL(); - } - } - if (!image) { - return; - } - var x = style.x || 0; - var y = style.y || 0; - var dw = style.width; - var dh = style.height; - var attrs = { - href: image, - width: dw, - height: dh - }; - if (x) { - attrs.x = x; - } - if (y) { - attrs.y = y; - } - setTransform(attrs, el.transform); - setStyleAttrs(attrs, style, el, scope); - setMetaData(attrs, el); - scope.animation && createCSSAnimation(el, attrs, scope); - return createVNode('image', el.id + '', attrs); - } - function brushSVGTSpan(el, scope) { - var style = el.style; - var text = style.text; - text != null && (text += ''); - if (!text || isNaN(style.x) || isNaN(style.y)) { - return; - } - var font = style.font || DEFAULT_FONT; - var x = style.x || 0; - var y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline); - var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign] - || style.textAlign; - var attrs = { - 'dominant-baseline': 'central', - 'text-anchor': textAlign - }; - if (hasSeparateFont(style)) { - var separatedFontStr = ''; - var fontStyle = style.fontStyle; - var fontSize = parseFontSize(style.fontSize); - if (!parseFloat(fontSize)) { - return; - } - var fontFamily = style.fontFamily || DEFAULT_FONT_FAMILY; - var fontWeight = style.fontWeight; - separatedFontStr += "font-size:" + fontSize + ";font-family:" + fontFamily + ";"; - if (fontStyle && fontStyle !== 'normal') { - separatedFontStr += "font-style:" + fontStyle + ";"; - } - if (fontWeight && fontWeight !== 'normal') { - separatedFontStr += "font-weight:" + fontWeight + ";"; - } - attrs.style = separatedFontStr; - } - else { - attrs.style = "font: " + font; - } - if (text.match(/\s/)) { - attrs['xml:space'] = 'preserve'; - } - if (x) { - attrs.x = x; - } - if (y) { - attrs.y = y; - } - setTransform(attrs, el.transform); - setStyleAttrs(attrs, style, el, scope); - setMetaData(attrs, el); - scope.animation && createCSSAnimation(el, attrs, scope); - return createVNode('text', el.id + '', attrs, undefined, text); - } - function brush$1(el, scope) { - if (el instanceof Path) { - return brushSVGPath(el, scope); - } - else if (el instanceof ZRImage) { - return brushSVGImage(el, scope); - } - else if (el instanceof TSpan) { - return brushSVGTSpan(el, scope); - } - } - function setShadow(el, attrs, scope) { - var style = el.style; - if (hasShadow(style)) { - var shadowKey = getShadowKey(el); - var shadowCache = scope.shadowCache; - var shadowId = shadowCache[shadowKey]; - if (!shadowId) { - var globalScale = el.getGlobalScale(); - var scaleX = globalScale[0]; - var scaleY = globalScale[1]; - if (!scaleX || !scaleY) { - return; - } - var offsetX = style.shadowOffsetX || 0; - var offsetY = style.shadowOffsetY || 0; - var blur_1 = style.shadowBlur; - var _a = normalizeColor(style.shadowColor), opacity = _a.opacity, color = _a.color; - var stdDx = blur_1 / 2 / scaleX; - var stdDy = blur_1 / 2 / scaleY; - var stdDeviation = stdDx + ' ' + stdDy; - shadowId = scope.zrId + '-s' + scope.shadowIdx++; - scope.defs[shadowId] = createVNode('filter', shadowId, { - 'id': shadowId, - 'x': '-100%', - 'y': '-100%', - 'width': '300%', - 'height': '300%' - }, [ - createVNode('feDropShadow', '', { - 'dx': offsetX / scaleX, - 'dy': offsetY / scaleY, - 'stdDeviation': stdDeviation, - 'flood-color': color, - 'flood-opacity': opacity - }) - ]); - shadowCache[shadowKey] = shadowId; - } - attrs.filter = getIdURL(shadowId); - } - } - function setGradient(style, attrs, target, scope) { - var val = style[target]; - var gradientTag; - var gradientAttrs = { - 'gradientUnits': val.global - ? 'userSpaceOnUse' - : 'objectBoundingBox' - }; - if (isLinearGradient(val)) { - gradientTag = 'linearGradient'; - gradientAttrs.x1 = val.x; - gradientAttrs.y1 = val.y; - gradientAttrs.x2 = val.x2; - gradientAttrs.y2 = val.y2; - } - else if (isRadialGradient(val)) { - gradientTag = 'radialGradient'; - gradientAttrs.cx = retrieve2(val.x, 0.5); - gradientAttrs.cy = retrieve2(val.y, 0.5); - gradientAttrs.r = retrieve2(val.r, 0.5); - } - else { - if ("development" !== 'production') { - logError('Illegal gradient type.'); - } - return; - } - var colors = val.colorStops; - var colorStops = []; - for (var i = 0, len = colors.length; i < len; ++i) { - var offset = round4(colors[i].offset) * 100 + '%'; - var stopColor = colors[i].color; - var _a = normalizeColor(stopColor), color = _a.color, opacity = _a.opacity; - var stopsAttrs = { - 'offset': offset - }; - stopsAttrs['stop-color'] = color; - if (opacity < 1) { - stopsAttrs['stop-opacity'] = opacity; - } - colorStops.push(createVNode('stop', i + '', stopsAttrs)); - } - var gradientVNode = createVNode(gradientTag, '', gradientAttrs, colorStops); - var gradientKey = vNodeToString(gradientVNode); - var gradientCache = scope.gradientCache; - var gradientId = gradientCache[gradientKey]; - if (!gradientId) { - gradientId = scope.zrId + '-g' + scope.gradientIdx++; - gradientCache[gradientKey] = gradientId; - gradientAttrs.id = gradientId; - scope.defs[gradientId] = createVNode(gradientTag, gradientId, gradientAttrs, colorStops); - } - attrs[target] = getIdURL(gradientId); - } - function setPattern(el, attrs, target, scope) { - var val = el.style[target]; - var boundingRect = el.getBoundingRect(); - var patternAttrs = {}; - var repeat = val.repeat; - var noRepeat = repeat === 'no-repeat'; - var repeatX = repeat === 'repeat-x'; - var repeatY = repeat === 'repeat-y'; - var child; - if (isImagePattern(val)) { - var imageWidth_1 = val.imageWidth; - var imageHeight_1 = val.imageHeight; - var imageSrc = void 0; - var patternImage = val.image; - if (isString(patternImage)) { - imageSrc = patternImage; - } - else if (isImageLike$1(patternImage)) { - imageSrc = patternImage.src; - } - else if (isCanvasLike(patternImage)) { - imageSrc = patternImage.toDataURL(); - } - if (typeof Image === 'undefined') { - var errMsg = 'Image width/height must been given explictly in svg-ssr renderer.'; - assert(imageWidth_1, errMsg); - assert(imageHeight_1, errMsg); - } - else if (imageWidth_1 == null || imageHeight_1 == null) { - var setSizeToVNode_1 = function (vNode, img) { - if (vNode) { - var svgEl = vNode.elm; - var width = imageWidth_1 || img.width; - var height = imageHeight_1 || img.height; - if (vNode.tag === 'pattern') { - if (repeatX) { - height = 1; - width /= boundingRect.width; - } - else if (repeatY) { - width = 1; - height /= boundingRect.height; - } - } - vNode.attrs.width = width; - vNode.attrs.height = height; - if (svgEl) { - svgEl.setAttribute('width', width); - svgEl.setAttribute('height', height); - } - } - }; - var createdImage = createOrUpdateImage(imageSrc, null, el, function (img) { - noRepeat || setSizeToVNode_1(patternVNode, img); - setSizeToVNode_1(child, img); - }); - if (createdImage && createdImage.width && createdImage.height) { - imageWidth_1 = imageWidth_1 || createdImage.width; - imageHeight_1 = imageHeight_1 || createdImage.height; - } - } - child = createVNode('image', 'img', { - href: imageSrc, - width: imageWidth_1, - height: imageHeight_1 - }); - patternAttrs.width = imageWidth_1; - patternAttrs.height = imageHeight_1; - } - else if (val.svgElement) { - child = clone(val.svgElement); - patternAttrs.width = val.svgWidth; - patternAttrs.height = val.svgHeight; - } - if (!child) { - return; - } - var patternWidth; - var patternHeight; - if (noRepeat) { - patternWidth = patternHeight = 1; - } - else if (repeatX) { - patternHeight = 1; - patternWidth = patternAttrs.width / boundingRect.width; - } - else if (repeatY) { - patternWidth = 1; - patternHeight = patternAttrs.height / boundingRect.height; - } - else { - patternAttrs.patternUnits = 'userSpaceOnUse'; - } - if (patternWidth != null && !isNaN(patternWidth)) { - patternAttrs.width = patternWidth; - } - if (patternHeight != null && !isNaN(patternHeight)) { - patternAttrs.height = patternHeight; - } - var patternTransform = getSRTTransformString(val); - patternTransform && (patternAttrs.patternTransform = patternTransform); - var patternVNode = createVNode('pattern', '', patternAttrs, [child]); - var patternKey = vNodeToString(patternVNode); - var patternCache = scope.patternCache; - var patternId = patternCache[patternKey]; - if (!patternId) { - patternId = scope.zrId + '-p' + scope.patternIdx++; - patternCache[patternKey] = patternId; - patternAttrs.id = patternId; - patternVNode = scope.defs[patternId] = createVNode('pattern', patternId, patternAttrs, [child]); - } - attrs[target] = getIdURL(patternId); - } - function setClipPath(clipPath, attrs, scope) { - var clipPathCache = scope.clipPathCache, defs = scope.defs; - var clipPathId = clipPathCache[clipPath.id]; - if (!clipPathId) { - clipPathId = scope.zrId + '-c' + scope.clipPathIdx++; - var clipPathAttrs = { - id: clipPathId - }; - clipPathCache[clipPath.id] = clipPathId; - defs[clipPathId] = createVNode('clipPath', clipPathId, clipPathAttrs, [brushSVGPath(clipPath, scope)]); - } - attrs['clip-path'] = getIdURL(clipPathId); - } - - function createTextNode(text) { - return document.createTextNode(text); - } - function insertBefore(parentNode, newNode, referenceNode) { - parentNode.insertBefore(newNode, referenceNode); - } - function removeChild(node, child) { - node.removeChild(child); - } - function appendChild(node, child) { - node.appendChild(child); - } - function parentNode(node) { - return node.parentNode; - } - function nextSibling(node) { - return node.nextSibling; - } - function setTextContent(node, text) { - node.textContent = text; - } - - var colonChar = 58; - var xChar = 120; - var emptyNode = createVNode('', ''); - function isUndef(s) { - return s === undefined; - } - function isDef(s) { - return s !== undefined; - } - function createKeyToOldIdx(children, beginIdx, endIdx) { - var map = {}; - for (var i = beginIdx; i <= endIdx; ++i) { - var key = children[i].key; - if (key !== undefined) { - if ("development" !== 'production') { - if (map[key] != null) { - console.error("Duplicate key " + key); - } - } - map[key] = i; - } - } - return map; - } - function sameVnode(vnode1, vnode2) { - var isSameKey = vnode1.key === vnode2.key; - var isSameTag = vnode1.tag === vnode2.tag; - return isSameTag && isSameKey; - } - function createElm(vnode) { - var i; - var children = vnode.children; - var tag = vnode.tag; - if (isDef(tag)) { - var elm = (vnode.elm = createElement(tag)); - updateAttrs(emptyNode, vnode); - if (isArray(children)) { - for (i = 0; i < children.length; ++i) { - var ch = children[i]; - if (ch != null) { - appendChild(elm, createElm(ch)); - } - } - } - else if (isDef(vnode.text) && !isObject(vnode.text)) { - appendChild(elm, createTextNode(vnode.text)); - } - } - else { - vnode.elm = createTextNode(vnode.text); - } - return vnode.elm; - } - function addVnodes(parentElm, before, vnodes, startIdx, endIdx) { - for (; startIdx <= endIdx; ++startIdx) { - var ch = vnodes[startIdx]; - if (ch != null) { - insertBefore(parentElm, createElm(ch), before); - } - } - } - function removeVnodes(parentElm, vnodes, startIdx, endIdx) { - for (; startIdx <= endIdx; ++startIdx) { - var ch = vnodes[startIdx]; - if (ch != null) { - if (isDef(ch.tag)) { - var parent_1 = parentNode(ch.elm); - removeChild(parent_1, ch.elm); - } - else { - removeChild(parentElm, ch.elm); - } - } - } - } - function updateAttrs(oldVnode, vnode) { - var key; - var elm = vnode.elm; - var oldAttrs = oldVnode && oldVnode.attrs || {}; - var attrs = vnode.attrs || {}; - if (oldAttrs === attrs) { - return; - } - for (key in attrs) { - var cur = attrs[key]; - var old = oldAttrs[key]; - if (old !== cur) { - if (cur === true) { - elm.setAttribute(key, ''); - } - else if (cur === false) { - elm.removeAttribute(key); - } - else { - if (key === 'style') { - elm.style.cssText = cur; - } - else if (key.charCodeAt(0) !== xChar) { - elm.setAttribute(key, cur); - } - else if (key === 'xmlns:xlink' || key === 'xmlns') { - elm.setAttributeNS(XMLNS, key, cur); - } - else if (key.charCodeAt(3) === colonChar) { - elm.setAttributeNS(XML_NAMESPACE, key, cur); - } - else if (key.charCodeAt(5) === colonChar) { - elm.setAttributeNS(XLINKNS, key, cur); - } - else { - elm.setAttribute(key, cur); - } - } - } - } - for (key in oldAttrs) { - if (!(key in attrs)) { - elm.removeAttribute(key); - } - } - } - function updateChildren(parentElm, oldCh, newCh) { - var oldStartIdx = 0; - var newStartIdx = 0; - var oldEndIdx = oldCh.length - 1; - var oldStartVnode = oldCh[0]; - var oldEndVnode = oldCh[oldEndIdx]; - var newEndIdx = newCh.length - 1; - var newStartVnode = newCh[0]; - var newEndVnode = newCh[newEndIdx]; - var oldKeyToIdx; - var idxInOld; - var elmToMove; - var before; - while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { - if (oldStartVnode == null) { - oldStartVnode = oldCh[++oldStartIdx]; - } - else if (oldEndVnode == null) { - oldEndVnode = oldCh[--oldEndIdx]; - } - else if (newStartVnode == null) { - newStartVnode = newCh[++newStartIdx]; - } - else if (newEndVnode == null) { - newEndVnode = newCh[--newEndIdx]; - } - else if (sameVnode(oldStartVnode, newStartVnode)) { - patchVnode(oldStartVnode, newStartVnode); - oldStartVnode = oldCh[++oldStartIdx]; - newStartVnode = newCh[++newStartIdx]; - } - else if (sameVnode(oldEndVnode, newEndVnode)) { - patchVnode(oldEndVnode, newEndVnode); - oldEndVnode = oldCh[--oldEndIdx]; - newEndVnode = newCh[--newEndIdx]; - } - else if (sameVnode(oldStartVnode, newEndVnode)) { - patchVnode(oldStartVnode, newEndVnode); - insertBefore(parentElm, oldStartVnode.elm, nextSibling(oldEndVnode.elm)); - oldStartVnode = oldCh[++oldStartIdx]; - newEndVnode = newCh[--newEndIdx]; - } - else if (sameVnode(oldEndVnode, newStartVnode)) { - patchVnode(oldEndVnode, newStartVnode); - insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); - oldEndVnode = oldCh[--oldEndIdx]; - newStartVnode = newCh[++newStartIdx]; - } - else { - if (isUndef(oldKeyToIdx)) { - oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); - } - idxInOld = oldKeyToIdx[newStartVnode.key]; - if (isUndef(idxInOld)) { - insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm); - } - else { - elmToMove = oldCh[idxInOld]; - if (elmToMove.tag !== newStartVnode.tag) { - insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm); - } - else { - patchVnode(elmToMove, newStartVnode); - oldCh[idxInOld] = undefined; - insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm); - } - } - newStartVnode = newCh[++newStartIdx]; - } - } - if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) { - if (oldStartIdx > oldEndIdx) { - before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm; - addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx); - } - else { - removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); - } - } - } - function patchVnode(oldVnode, vnode) { - var elm = (vnode.elm = oldVnode.elm); - var oldCh = oldVnode.children; - var ch = vnode.children; - if (oldVnode === vnode) { - return; - } - updateAttrs(oldVnode, vnode); - if (isUndef(vnode.text)) { - if (isDef(oldCh) && isDef(ch)) { - if (oldCh !== ch) { - updateChildren(elm, oldCh, ch); - } - } - else if (isDef(ch)) { - if (isDef(oldVnode.text)) { - setTextContent(elm, ''); - } - addVnodes(elm, null, ch, 0, ch.length - 1); - } - else if (isDef(oldCh)) { - removeVnodes(elm, oldCh, 0, oldCh.length - 1); - } - else if (isDef(oldVnode.text)) { - setTextContent(elm, ''); - } - } - else if (oldVnode.text !== vnode.text) { - if (isDef(oldCh)) { - removeVnodes(elm, oldCh, 0, oldCh.length - 1); - } - setTextContent(elm, vnode.text); - } - } - function patch(oldVnode, vnode) { - if (sameVnode(oldVnode, vnode)) { - patchVnode(oldVnode, vnode); - } - else { - var elm = oldVnode.elm; - var parent_2 = parentNode(elm); - createElm(vnode); - if (parent_2 !== null) { - insertBefore(parent_2, vnode.elm, nextSibling(elm)); - removeVnodes(parent_2, [oldVnode], 0, 0); - } - } - return vnode; - } - - var svgId = 0; - var SVGPainter = (function () { - function SVGPainter(root, storage, opts) { - this.type = 'svg'; - this.refreshHover = createMethodNotSupport('refreshHover'); - this.configLayer = createMethodNotSupport('configLayer'); - this.storage = storage; - this._opts = opts = extend({}, opts); - this.root = root; - this._id = 'zr' + svgId++; - this._oldVNode = createSVGVNode(opts.width, opts.height); - if (root && !opts.ssr) { - var viewport = this._viewport = document.createElement('div'); - viewport.style.cssText = 'position:relative;overflow:hidden'; - var svgDom = this._svgDom = this._oldVNode.elm = createElement('svg'); - updateAttrs(null, this._oldVNode); - viewport.appendChild(svgDom); - root.appendChild(viewport); - } - this.resize(opts.width, opts.height); - } - SVGPainter.prototype.getType = function () { - return this.type; - }; - SVGPainter.prototype.getViewportRoot = function () { - return this._viewport; - }; - SVGPainter.prototype.getViewportRootOffset = function () { - var viewportRoot = this.getViewportRoot(); - if (viewportRoot) { - return { - offsetLeft: viewportRoot.offsetLeft || 0, - offsetTop: viewportRoot.offsetTop || 0 - }; - } - }; - SVGPainter.prototype.getSvgDom = function () { - return this._svgDom; - }; - SVGPainter.prototype.refresh = function () { - if (this.root) { - var vnode = this.renderToVNode({ - willUpdate: true - }); - vnode.attrs.style = 'position:absolute;left:0;top:0;user-select:none'; - patch(this._oldVNode, vnode); - this._oldVNode = vnode; - } - }; - SVGPainter.prototype.renderOneToVNode = function (el) { - return brush$1(el, createBrushScope(this._id)); - }; - SVGPainter.prototype.renderToVNode = function (opts) { - opts = opts || {}; - var list = this.storage.getDisplayList(true); - var width = this._width; - var height = this._height; - var scope = createBrushScope(this._id); - scope.animation = opts.animation; - scope.willUpdate = opts.willUpdate; - scope.compress = opts.compress; - scope.emphasis = opts.emphasis; - var children = []; - var bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope); - bgVNode && children.push(bgVNode); - var mainVNode = !opts.compress - ? (this._mainVNode = createVNode('g', 'main', {}, [])) : null; - this._paintList(list, scope, mainVNode ? mainVNode.children : children); - mainVNode && children.push(mainVNode); - var defs = map(keys(scope.defs), function (id) { return scope.defs[id]; }); - if (defs.length) { - children.push(createVNode('defs', 'defs', {}, defs)); - } - if (opts.animation) { - var animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, { newline: true }); - if (animationCssStr) { - var styleNode = createVNode('style', 'stl', {}, [], animationCssStr); - children.push(styleNode); - } - } - return createSVGVNode(width, height, children, opts.useViewBox); - }; - SVGPainter.prototype.renderToString = function (opts) { - opts = opts || {}; - return vNodeToString(this.renderToVNode({ - animation: retrieve2(opts.cssAnimation, true), - emphasis: retrieve2(opts.cssEmphasis, true), - willUpdate: false, - compress: true, - useViewBox: retrieve2(opts.useViewBox, true) - }), { newline: true }); - }; - SVGPainter.prototype.setBackgroundColor = function (backgroundColor) { - this._backgroundColor = backgroundColor; - }; - SVGPainter.prototype.getSvgRoot = function () { - return this._mainVNode && this._mainVNode.elm; - }; - SVGPainter.prototype._paintList = function (list, scope, out) { - var listLen = list.length; - var clipPathsGroupsStack = []; - var clipPathsGroupsStackDepth = 0; - var currentClipPathGroup; - var prevClipPaths; - var clipGroupNodeIdx = 0; - for (var i = 0; i < listLen; i++) { - var displayable = list[i]; - if (!displayable.invisible) { - var clipPaths = displayable.__clipPaths; - var len = clipPaths && clipPaths.length || 0; - var prevLen = prevClipPaths && prevClipPaths.length || 0; - var lca = void 0; - for (lca = Math.max(len - 1, prevLen - 1); lca >= 0; lca--) { - if (clipPaths && prevClipPaths - && clipPaths[lca] === prevClipPaths[lca]) { - break; - } - } - for (var i_1 = prevLen - 1; i_1 > lca; i_1--) { - clipPathsGroupsStackDepth--; - currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1]; - } - for (var i_2 = lca + 1; i_2 < len; i_2++) { - var groupAttrs = {}; - setClipPath(clipPaths[i_2], groupAttrs, scope); - var g = createVNode('g', 'clip-g-' + clipGroupNodeIdx++, groupAttrs, []); - (currentClipPathGroup ? currentClipPathGroup.children : out).push(g); - clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g; - currentClipPathGroup = g; - } - prevClipPaths = clipPaths; - var ret = brush$1(displayable, scope); - if (ret) { - (currentClipPathGroup ? currentClipPathGroup.children : out).push(ret); - } - } - } - }; - SVGPainter.prototype.resize = function (width, height) { - var opts = this._opts; - var root = this.root; - var viewport = this._viewport; - width != null && (opts.width = width); - height != null && (opts.height = height); - if (root && viewport) { - viewport.style.display = 'none'; - width = getSize(root, 0, opts); - height = getSize(root, 1, opts); - viewport.style.display = ''; - } - if (this._width !== width || this._height !== height) { - this._width = width; - this._height = height; - if (viewport) { - var viewportStyle = viewport.style; - viewportStyle.width = width + 'px'; - viewportStyle.height = height + 'px'; - } - if (!isPattern(this._backgroundColor)) { - var svgDom = this._svgDom; - if (svgDom) { - svgDom.setAttribute('width', width); - svgDom.setAttribute('height', height); - } - var bgEl = this._bgVNode && this._bgVNode.elm; - if (bgEl) { - bgEl.setAttribute('width', width); - bgEl.setAttribute('height', height); - } - } - else { - this.refresh(); - } - } - }; - SVGPainter.prototype.getWidth = function () { - return this._width; - }; - SVGPainter.prototype.getHeight = function () { - return this._height; - }; - SVGPainter.prototype.dispose = function () { - if (this.root) { - this.root.innerHTML = ''; - } - this._svgDom = - this._viewport = - this.storage = - this._oldVNode = - this._bgVNode = - this._mainVNode = null; - }; - SVGPainter.prototype.clear = function () { - if (this._svgDom) { - this._svgDom.innerHTML = null; - } - this._oldVNode = null; - }; - SVGPainter.prototype.toDataURL = function (base64) { - var str = this.renderToString(); - var prefix = 'data:image/svg+xml;'; - if (base64) { - str = encodeBase64(str); - return str && prefix + 'base64,' + str; - } - return prefix + 'charset=UTF-8,' + encodeURIComponent(str); - }; - return SVGPainter; - }()); - function createMethodNotSupport(method) { - return function () { - if ("development" !== 'production') { - logError('In SVG mode painter not support method "' + method + '"'); - } - }; - } - function createBackgroundVNode(width, height, backgroundColor, scope) { - var bgVNode; - if (backgroundColor && backgroundColor !== 'none') { - bgVNode = createVNode('rect', 'bg', { - width: width, - height: height, - x: '0', - y: '0' - }); - if (isGradient(backgroundColor)) { - setGradient({ fill: backgroundColor }, bgVNode.attrs, 'fill', scope); - } - else if (isPattern(backgroundColor)) { - setPattern({ - style: { - fill: backgroundColor - }, - dirty: noop, - getBoundingRect: function () { return ({ width: width, height: height }); } - }, bgVNode.attrs, 'fill', scope); - } - else { - var _a = normalizeColor(backgroundColor), color = _a.color, opacity = _a.opacity; - bgVNode.attrs.fill = color; - opacity < 1 && (bgVNode.attrs['fill-opacity'] = opacity); - } - } - return bgVNode; - } - - function install(registers) { - registers.registerPainter('svg', SVGPainter); - } - - function createDom(id, painter, dpr) { - var newDom = platformApi.createCanvas(); - var width = painter.getWidth(); - var height = painter.getHeight(); - var newDomStyle = newDom.style; - if (newDomStyle) { - newDomStyle.position = 'absolute'; - newDomStyle.left = '0'; - newDomStyle.top = '0'; - newDomStyle.width = width + 'px'; - newDomStyle.height = height + 'px'; - newDom.setAttribute('data-zr-dom-id', id); - } - newDom.width = width * dpr; - newDom.height = height * dpr; - return newDom; - } - var Layer = (function (_super) { - __extends(Layer, _super); - function Layer(id, painter, dpr) { - var _this = _super.call(this) || this; - _this.motionBlur = false; - _this.lastFrameAlpha = 0.7; - _this.dpr = 1; - _this.virtual = false; - _this.config = {}; - _this.incremental = false; - _this.zlevel = 0; - _this.maxRepaintRectCount = 5; - _this.__dirty = true; - _this.__firstTimePaint = true; - _this.__used = false; - _this.__drawIndex = 0; - _this.__startIndex = 0; - _this.__endIndex = 0; - _this.__prevStartIndex = null; - _this.__prevEndIndex = null; - var dom; - dpr = dpr || devicePixelRatio; - if (typeof id === 'string') { - dom = createDom(id, painter, dpr); - } - else if (isObject(id)) { - dom = id; - id = dom.id; - } - _this.id = id; - _this.dom = dom; - var domStyle = dom.style; - if (domStyle) { - disableUserSelect(dom); - dom.onselectstart = function () { return false; }; - domStyle.padding = '0'; - domStyle.margin = '0'; - domStyle.borderWidth = '0'; - } - _this.painter = painter; - _this.dpr = dpr; - return _this; - } - Layer.prototype.getElementCount = function () { - return this.__endIndex - this.__startIndex; - }; - Layer.prototype.afterBrush = function () { - this.__prevStartIndex = this.__startIndex; - this.__prevEndIndex = this.__endIndex; - }; - Layer.prototype.initContext = function () { - this.ctx = this.dom.getContext('2d'); - this.ctx.dpr = this.dpr; - }; - Layer.prototype.setUnpainted = function () { - this.__firstTimePaint = true; - }; - Layer.prototype.createBackBuffer = function () { - var dpr = this.dpr; - this.domBack = createDom('back-' + this.id, this.painter, dpr); - this.ctxBack = this.domBack.getContext('2d'); - if (dpr !== 1) { - this.ctxBack.scale(dpr, dpr); - } - }; - Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) { - if (this.__firstTimePaint) { - this.__firstTimePaint = false; - return null; - } - var mergedRepaintRects = []; - var maxRepaintRectCount = this.maxRepaintRectCount; - var full = false; - var pendingRect = new BoundingRect(0, 0, 0, 0); - function addRectToMergePool(rect) { - if (!rect.isFinite() || rect.isZero()) { - return; - } - if (mergedRepaintRects.length === 0) { - var boundingRect = new BoundingRect(0, 0, 0, 0); - boundingRect.copy(rect); - mergedRepaintRects.push(boundingRect); - } - else { - var isMerged = false; - var minDeltaArea = Infinity; - var bestRectToMergeIdx = 0; - for (var i = 0; i < mergedRepaintRects.length; ++i) { - var mergedRect = mergedRepaintRects[i]; - if (mergedRect.intersect(rect)) { - var pendingRect_1 = new BoundingRect(0, 0, 0, 0); - pendingRect_1.copy(mergedRect); - pendingRect_1.union(rect); - mergedRepaintRects[i] = pendingRect_1; - isMerged = true; - break; - } - else if (full) { - pendingRect.copy(rect); - pendingRect.union(mergedRect); - var aArea = rect.width * rect.height; - var bArea = mergedRect.width * mergedRect.height; - var pendingArea = pendingRect.width * pendingRect.height; - var deltaArea = pendingArea - aArea - bArea; - if (deltaArea < minDeltaArea) { - minDeltaArea = deltaArea; - bestRectToMergeIdx = i; - } - } - } - if (full) { - mergedRepaintRects[bestRectToMergeIdx].union(rect); - isMerged = true; - } - if (!isMerged) { - var boundingRect = new BoundingRect(0, 0, 0, 0); - boundingRect.copy(rect); - mergedRepaintRects.push(boundingRect); - } - if (!full) { - full = mergedRepaintRects.length >= maxRepaintRectCount; - } - } - } - for (var i = this.__startIndex; i < this.__endIndex; ++i) { - var el = displayList[i]; - if (el) { - var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true); - var prevRect = el.__isRendered && ((el.__dirty & REDRAW_BIT) || !shouldPaint) - ? el.getPrevPaintRect() - : null; - if (prevRect) { - addRectToMergePool(prevRect); - } - var curRect = shouldPaint && ((el.__dirty & REDRAW_BIT) || !el.__isRendered) - ? el.getPaintRect() - : null; - if (curRect) { - addRectToMergePool(curRect); - } - } - } - for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) { - var el = prevList[i]; - var shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true); - if (el && (!shouldPaint || !el.__zr) && el.__isRendered) { - var prevRect = el.getPrevPaintRect(); - if (prevRect) { - addRectToMergePool(prevRect); - } - } - } - var hasIntersections; - do { - hasIntersections = false; - for (var i = 0; i < mergedRepaintRects.length;) { - if (mergedRepaintRects[i].isZero()) { - mergedRepaintRects.splice(i, 1); - continue; - } - for (var j = i + 1; j < mergedRepaintRects.length;) { - if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) { - hasIntersections = true; - mergedRepaintRects[i].union(mergedRepaintRects[j]); - mergedRepaintRects.splice(j, 1); - } - else { - j++; - } - } - i++; - } - } while (hasIntersections); - this._paintRects = mergedRepaintRects; - return mergedRepaintRects; - }; - Layer.prototype.debugGetPaintRects = function () { - return (this._paintRects || []).slice(); - }; - Layer.prototype.resize = function (width, height) { - var dpr = this.dpr; - var dom = this.dom; - var domStyle = dom.style; - var domBack = this.domBack; - if (domStyle) { - domStyle.width = width + 'px'; - domStyle.height = height + 'px'; - } - dom.width = width * dpr; - dom.height = height * dpr; - if (domBack) { - domBack.width = width * dpr; - domBack.height = height * dpr; - if (dpr !== 1) { - this.ctxBack.scale(dpr, dpr); - } - } - }; - Layer.prototype.clear = function (clearAll, clearColor, repaintRects) { - var dom = this.dom; - var ctx = this.ctx; - var width = dom.width; - var height = dom.height; - clearColor = clearColor || this.clearColor; - var haveMotionBLur = this.motionBlur && !clearAll; - var lastFrameAlpha = this.lastFrameAlpha; - var dpr = this.dpr; - var self = this; - if (haveMotionBLur) { - if (!this.domBack) { - this.createBackBuffer(); - } - this.ctxBack.globalCompositeOperation = 'copy'; - this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr); - } - var domBack = this.domBack; - function doClear(x, y, width, height) { - ctx.clearRect(x, y, width, height); - if (clearColor && clearColor !== 'transparent') { - var clearColorGradientOrPattern = void 0; - if (isGradientObject(clearColor)) { - var shouldCache = clearColor.global || (clearColor.__width === width - && clearColor.__height === height); - clearColorGradientOrPattern = shouldCache - && clearColor.__canvasGradient - || getCanvasGradient(ctx, clearColor, { - x: 0, - y: 0, - width: width, - height: height - }); - clearColor.__canvasGradient = clearColorGradientOrPattern; - clearColor.__width = width; - clearColor.__height = height; - } - else if (isImagePatternObject(clearColor)) { - clearColor.scaleX = clearColor.scaleX || dpr; - clearColor.scaleY = clearColor.scaleY || dpr; - clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, { - dirty: function () { - self.setUnpainted(); - self.painter.refresh(); - } - }); - } - ctx.save(); - ctx.fillStyle = clearColorGradientOrPattern || clearColor; - ctx.fillRect(x, y, width, height); - ctx.restore(); - } - if (haveMotionBLur) { - ctx.save(); - ctx.globalAlpha = lastFrameAlpha; - ctx.drawImage(domBack, x, y, width, height); - ctx.restore(); - } - } - if (!repaintRects || haveMotionBLur) { - doClear(0, 0, width, height); - } - else if (repaintRects.length) { - each(repaintRects, function (rect) { - doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr); - }); - } - }; - return Layer; - }(Eventful)); - - var HOVER_LAYER_ZLEVEL = 1e5; - var CANVAS_ZLEVEL = 314159; - var EL_AFTER_INCREMENTAL_INC = 0.01; - var INCREMENTAL_INC = 0.001; - function isLayerValid(layer) { - if (!layer) { - return false; - } - if (layer.__builtin__) { - return true; - } - if (typeof (layer.resize) !== 'function' - || typeof (layer.refresh) !== 'function') { - return false; - } - return true; - } - function createRoot(width, height) { - var domRoot = document.createElement('div'); - domRoot.style.cssText = [ - 'position:relative', - 'width:' + width + 'px', - 'height:' + height + 'px', - 'padding:0', - 'margin:0', - 'border-width:0' - ].join(';') + ';'; - return domRoot; - } - var CanvasPainter = (function () { - function CanvasPainter(root, storage, opts, id) { - this.type = 'canvas'; - this._zlevelList = []; - this._prevDisplayList = []; - this._layers = {}; - this._layerConfig = {}; - this._needsManuallyCompositing = false; - this.type = 'canvas'; - var singleCanvas = !root.nodeName - || root.nodeName.toUpperCase() === 'CANVAS'; - this._opts = opts = extend({}, opts || {}); - this.dpr = opts.devicePixelRatio || devicePixelRatio; - this._singleCanvas = singleCanvas; - this.root = root; - var rootStyle = root.style; - if (rootStyle) { - disableUserSelect(root); - root.innerHTML = ''; - } - this.storage = storage; - var zlevelList = this._zlevelList; - this._prevDisplayList = []; - var layers = this._layers; - if (!singleCanvas) { - this._width = getSize(root, 0, opts); - this._height = getSize(root, 1, opts); - var domRoot = this._domRoot = createRoot(this._width, this._height); - root.appendChild(domRoot); - } - else { - var rootCanvas = root; - var width = rootCanvas.width; - var height = rootCanvas.height; - if (opts.width != null) { - width = opts.width; - } - if (opts.height != null) { - height = opts.height; - } - this.dpr = opts.devicePixelRatio || 1; - rootCanvas.width = width * this.dpr; - rootCanvas.height = height * this.dpr; - this._width = width; - this._height = height; - var mainLayer = new Layer(rootCanvas, this, this.dpr); - mainLayer.__builtin__ = true; - mainLayer.initContext(); - layers[CANVAS_ZLEVEL] = mainLayer; - mainLayer.zlevel = CANVAS_ZLEVEL; - zlevelList.push(CANVAS_ZLEVEL); - this._domRoot = root; - } - } - CanvasPainter.prototype.getType = function () { - return 'canvas'; - }; - CanvasPainter.prototype.isSingleCanvas = function () { - return this._singleCanvas; - }; - CanvasPainter.prototype.getViewportRoot = function () { - return this._domRoot; - }; - CanvasPainter.prototype.getViewportRootOffset = function () { - var viewportRoot = this.getViewportRoot(); - if (viewportRoot) { - return { - offsetLeft: viewportRoot.offsetLeft || 0, - offsetTop: viewportRoot.offsetTop || 0 - }; - } - }; - CanvasPainter.prototype.refresh = function (paintAll) { - var list = this.storage.getDisplayList(true); - var prevList = this._prevDisplayList; - var zlevelList = this._zlevelList; - this._redrawId = Math.random(); - this._paintList(list, prevList, paintAll, this._redrawId); - for (var i = 0; i < zlevelList.length; i++) { - var z = zlevelList[i]; - var layer = this._layers[z]; - if (!layer.__builtin__ && layer.refresh) { - var clearColor = i === 0 ? this._backgroundColor : null; - layer.refresh(clearColor); - } - } - if (this._opts.useDirtyRect) { - this._prevDisplayList = list.slice(); - } - return this; - }; - CanvasPainter.prototype.refreshHover = function () { - this._paintHoverList(this.storage.getDisplayList(false)); - }; - CanvasPainter.prototype._paintHoverList = function (list) { - var len = list.length; - var hoverLayer = this._hoverlayer; - hoverLayer && hoverLayer.clear(); - if (!len) { - return; - } - var scope = { - inHover: true, - viewWidth: this._width, - viewHeight: this._height - }; - var ctx; - for (var i = 0; i < len; i++) { - var el = list[i]; - if (el.__inHover) { - if (!hoverLayer) { - hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL); - } - if (!ctx) { - ctx = hoverLayer.ctx; - ctx.save(); - } - brush(ctx, el, scope, i === len - 1); - } - } - if (ctx) { - ctx.restore(); - } - }; - CanvasPainter.prototype.getHoverLayer = function () { - return this.getLayer(HOVER_LAYER_ZLEVEL); - }; - CanvasPainter.prototype.paintOne = function (ctx, el) { - brushSingle(ctx, el); - }; - CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) { - if (this._redrawId !== redrawId) { - return; - } - paintAll = paintAll || false; - this._updateLayerStatus(list); - var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover; - if (this._needsManuallyCompositing) { - this._compositeManually(); - } - if (needsRefreshHover) { - this._paintHoverList(list); - } - if (!finished) { - var self_1 = this; - requestAnimationFrame$1(function () { - self_1._paintList(list, prevList, paintAll, redrawId); - }); - } - else { - this.eachLayer(function (layer) { - layer.afterBrush && layer.afterBrush(); - }); - } - }; - CanvasPainter.prototype._compositeManually = function () { - var ctx = this.getLayer(CANVAS_ZLEVEL).ctx; - var width = this._domRoot.width; - var height = this._domRoot.height; - ctx.clearRect(0, 0, width, height); - this.eachBuiltinLayer(function (layer) { - if (layer.virtual) { - ctx.drawImage(layer.dom, 0, 0, width, height); - } - }); - }; - CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) { - var _this = this; - var layerList = []; - var useDirtyRect = this._opts.useDirtyRect; - for (var zi = 0; zi < this._zlevelList.length; zi++) { - var zlevel = this._zlevelList[zi]; - var layer = this._layers[zlevel]; - if (layer.__builtin__ - && layer !== this._hoverlayer - && (layer.__dirty || paintAll)) { - layerList.push(layer); - } - } - var finished = true; - var needsRefreshHover = false; - var _loop_1 = function (k) { - var layer = layerList[k]; - var ctx = layer.ctx; - var repaintRects = useDirtyRect - && layer.createRepaintRects(list, prevList, this_1._width, this_1._height); - var start = paintAll ? layer.__startIndex : layer.__drawIndex; - var useTimer = !paintAll && layer.incremental && Date.now; - var startTime = useTimer && Date.now(); - var clearColor = layer.zlevel === this_1._zlevelList[0] - ? this_1._backgroundColor : null; - if (layer.__startIndex === layer.__endIndex) { - layer.clear(false, clearColor, repaintRects); - } - else if (start === layer.__startIndex) { - var firstEl = list[start]; - if (!firstEl.incremental || !firstEl.notClear || paintAll) { - layer.clear(false, clearColor, repaintRects); - } - } - if (start === -1) { - console.error('For some unknown reason. drawIndex is -1'); - start = layer.__startIndex; - } - var i; - var repaint = function (repaintRect) { - var scope = { - inHover: false, - allClipped: false, - prevEl: null, - viewWidth: _this._width, - viewHeight: _this._height - }; - for (i = start; i < layer.__endIndex; i++) { - var el = list[i]; - if (el.__inHover) { - needsRefreshHover = true; - } - _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1); - if (useTimer) { - var dTime = Date.now() - startTime; - if (dTime > 15) { - break; - } - } - } - if (scope.prevElClipPaths) { - ctx.restore(); - } - }; - if (repaintRects) { - if (repaintRects.length === 0) { - i = layer.__endIndex; - } - else { - var dpr = this_1.dpr; - for (var r = 0; r < repaintRects.length; ++r) { - var rect = repaintRects[r]; - ctx.save(); - ctx.beginPath(); - ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr); - ctx.clip(); - repaint(rect); - ctx.restore(); - } - } - } - else { - ctx.save(); - repaint(); - ctx.restore(); - } - layer.__drawIndex = i; - if (layer.__drawIndex < layer.__endIndex) { - finished = false; - } - }; - var this_1 = this; - for (var k = 0; k < layerList.length; k++) { - _loop_1(k); - } - if (env.wxa) { - each(this._layers, function (layer) { - if (layer && layer.ctx && layer.ctx.draw) { - layer.ctx.draw(); - } - }); - } - return { - finished: finished, - needsRefreshHover: needsRefreshHover - }; - }; - CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) { - var ctx = currentLayer.ctx; - if (useDirtyRect) { - var paintRect = el.getPaintRect(); - if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) { - brush(ctx, el, scope, isLast); - el.setPrevPaintRect(paintRect); - } - } - else { - brush(ctx, el, scope, isLast); - } - }; - CanvasPainter.prototype.getLayer = function (zlevel, virtual) { - if (this._singleCanvas && !this._needsManuallyCompositing) { - zlevel = CANVAS_ZLEVEL; - } - var layer = this._layers[zlevel]; - if (!layer) { - layer = new Layer('zr_' + zlevel, this, this.dpr); - layer.zlevel = zlevel; - layer.__builtin__ = true; - if (this._layerConfig[zlevel]) { - merge(layer, this._layerConfig[zlevel], true); - } - else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) { - merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true); - } - if (virtual) { - layer.virtual = virtual; - } - this.insertLayer(zlevel, layer); - layer.initContext(); - } - return layer; - }; - CanvasPainter.prototype.insertLayer = function (zlevel, layer) { - var layersMap = this._layers; - var zlevelList = this._zlevelList; - var len = zlevelList.length; - var domRoot = this._domRoot; - var prevLayer = null; - var i = -1; - if (layersMap[zlevel]) { - if ("development" !== 'production') { - logError('ZLevel ' + zlevel + ' has been used already'); - } - return; - } - if (!isLayerValid(layer)) { - if ("development" !== 'production') { - logError('Layer of zlevel ' + zlevel + ' is not valid'); - } - return; - } - if (len > 0 && zlevel > zlevelList[0]) { - for (i = 0; i < len - 1; i++) { - if (zlevelList[i] < zlevel - && zlevelList[i + 1] > zlevel) { - break; - } - } - prevLayer = layersMap[zlevelList[i]]; - } - zlevelList.splice(i + 1, 0, zlevel); - layersMap[zlevel] = layer; - if (!layer.virtual) { - if (prevLayer) { - var prevDom = prevLayer.dom; - if (prevDom.nextSibling) { - domRoot.insertBefore(layer.dom, prevDom.nextSibling); - } - else { - domRoot.appendChild(layer.dom); - } - } - else { - if (domRoot.firstChild) { - domRoot.insertBefore(layer.dom, domRoot.firstChild); - } - else { - domRoot.appendChild(layer.dom); - } - } - } - layer.painter || (layer.painter = this); - }; - CanvasPainter.prototype.eachLayer = function (cb, context) { - var zlevelList = this._zlevelList; - for (var i = 0; i < zlevelList.length; i++) { - var z = zlevelList[i]; - cb.call(context, this._layers[z], z); - } - }; - CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) { - var zlevelList = this._zlevelList; - for (var i = 0; i < zlevelList.length; i++) { - var z = zlevelList[i]; - var layer = this._layers[z]; - if (layer.__builtin__) { - cb.call(context, layer, z); - } - } - }; - CanvasPainter.prototype.eachOtherLayer = function (cb, context) { - var zlevelList = this._zlevelList; - for (var i = 0; i < zlevelList.length; i++) { - var z = zlevelList[i]; - var layer = this._layers[z]; - if (!layer.__builtin__) { - cb.call(context, layer, z); - } - } - }; - CanvasPainter.prototype.getLayers = function () { - return this._layers; - }; - CanvasPainter.prototype._updateLayerStatus = function (list) { - this.eachBuiltinLayer(function (layer, z) { - layer.__dirty = layer.__used = false; - }); - function updatePrevLayer(idx) { - if (prevLayer) { - if (prevLayer.__endIndex !== idx) { - prevLayer.__dirty = true; - } - prevLayer.__endIndex = idx; - } - } - if (this._singleCanvas) { - for (var i_1 = 1; i_1 < list.length; i_1++) { - var el = list[i_1]; - if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) { - this._needsManuallyCompositing = true; - break; - } - } - } - var prevLayer = null; - var incrementalLayerCount = 0; - var prevZlevel; - var i; - for (i = 0; i < list.length; i++) { - var el = list[i]; - var zlevel = el.zlevel; - var layer = void 0; - if (prevZlevel !== zlevel) { - prevZlevel = zlevel; - incrementalLayerCount = 0; - } - if (el.incremental) { - layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing); - layer.incremental = true; - incrementalLayerCount = 1; - } - else { - layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing); - } - if (!layer.__builtin__) { - logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id); - } - if (layer !== prevLayer) { - layer.__used = true; - if (layer.__startIndex !== i) { - layer.__dirty = true; - } - layer.__startIndex = i; - if (!layer.incremental) { - layer.__drawIndex = i; - } - else { - layer.__drawIndex = -1; - } - updatePrevLayer(i); - prevLayer = layer; - } - if ((el.__dirty & REDRAW_BIT) && !el.__inHover) { - layer.__dirty = true; - if (layer.incremental && layer.__drawIndex < 0) { - layer.__drawIndex = i; - } - } - } - updatePrevLayer(i); - this.eachBuiltinLayer(function (layer, z) { - if (!layer.__used && layer.getElementCount() > 0) { - layer.__dirty = true; - layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0; - } - if (layer.__dirty && layer.__drawIndex < 0) { - layer.__drawIndex = layer.__startIndex; - } - }); - }; - CanvasPainter.prototype.clear = function () { - this.eachBuiltinLayer(this._clearLayer); - return this; - }; - CanvasPainter.prototype._clearLayer = function (layer) { - layer.clear(); - }; - CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) { - this._backgroundColor = backgroundColor; - each(this._layers, function (layer) { - layer.setUnpainted(); - }); - }; - CanvasPainter.prototype.configLayer = function (zlevel, config) { - if (config) { - var layerConfig = this._layerConfig; - if (!layerConfig[zlevel]) { - layerConfig[zlevel] = config; - } - else { - merge(layerConfig[zlevel], config, true); - } - for (var i = 0; i < this._zlevelList.length; i++) { - var _zlevel = this._zlevelList[i]; - if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) { - var layer = this._layers[_zlevel]; - merge(layer, layerConfig[zlevel], true); - } - } - } - }; - CanvasPainter.prototype.delLayer = function (zlevel) { - var layers = this._layers; - var zlevelList = this._zlevelList; - var layer = layers[zlevel]; - if (!layer) { - return; - } - layer.dom.parentNode.removeChild(layer.dom); - delete layers[zlevel]; - zlevelList.splice(indexOf(zlevelList, zlevel), 1); - }; - CanvasPainter.prototype.resize = function (width, height) { - if (!this._domRoot.style) { - if (width == null || height == null) { - return; - } - this._width = width; - this._height = height; - this.getLayer(CANVAS_ZLEVEL).resize(width, height); - } - else { - var domRoot = this._domRoot; - domRoot.style.display = 'none'; - var opts = this._opts; - var root = this.root; - width != null && (opts.width = width); - height != null && (opts.height = height); - width = getSize(root, 0, opts); - height = getSize(root, 1, opts); - domRoot.style.display = ''; - if (this._width !== width || height !== this._height) { - domRoot.style.width = width + 'px'; - domRoot.style.height = height + 'px'; - for (var id in this._layers) { - if (this._layers.hasOwnProperty(id)) { - this._layers[id].resize(width, height); - } - } - this.refresh(true); - } - this._width = width; - this._height = height; - } - return this; - }; - CanvasPainter.prototype.clearLayer = function (zlevel) { - var layer = this._layers[zlevel]; - if (layer) { - layer.clear(); - } - }; - CanvasPainter.prototype.dispose = function () { - this.root.innerHTML = ''; - this.root = - this.storage = - this._domRoot = - this._layers = null; - }; - CanvasPainter.prototype.getRenderedCanvas = function (opts) { - opts = opts || {}; - if (this._singleCanvas && !this._compositeManually) { - return this._layers[CANVAS_ZLEVEL].dom; - } - var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr); - imageLayer.initContext(); - imageLayer.clear(false, opts.backgroundColor || this._backgroundColor); - var ctx = imageLayer.ctx; - if (opts.pixelRatio <= this.dpr) { - this.refresh(); - var width_1 = imageLayer.dom.width; - var height_1 = imageLayer.dom.height; - this.eachLayer(function (layer) { - if (layer.__builtin__) { - ctx.drawImage(layer.dom, 0, 0, width_1, height_1); - } - else if (layer.renderToCanvas) { - ctx.save(); - layer.renderToCanvas(ctx); - ctx.restore(); - } - }); - } - else { - var scope = { - inHover: false, - viewWidth: this._width, - viewHeight: this._height - }; - var displayList = this.storage.getDisplayList(true); - for (var i = 0, len = displayList.length; i < len; i++) { - var el = displayList[i]; - brush(ctx, el, scope, i === len - 1); - } - } - return imageLayer.dom; - }; - CanvasPainter.prototype.getWidth = function () { - return this._width; - }; - CanvasPainter.prototype.getHeight = function () { - return this._height; - }; - return CanvasPainter; - }()); - - function install$1(registers) { - registers.registerPainter('canvas', CanvasPainter); - } - - var LineSeriesModel = /** @class */function (_super) { - __extends(LineSeriesModel, _super); - function LineSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = LineSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } - LineSeriesModel.prototype.getInitialData = function (option) { - if ("development" !== 'production') { - var coordSys = option.coordinateSystem; - if (coordSys !== 'polar' && coordSys !== 'cartesian2d') { - throw new Error('Line not support coordinateSystem besides cartesian and polar'); - } - } - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; - LineSeriesModel.prototype.getLegendIcon = function (opt) { - var group = new Group(); - var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false); - group.add(line); - line.setStyle(opt.lineStyle); - var visualType = this.getData().getVisual('symbol'); - var visualRotate = this.getData().getVisual('symbolRotate'); - var symbolType = visualType === 'none' ? 'circle' : visualType; - // Symbol size is 80% when there is a line - var size = opt.itemHeight * 0.8; - var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill); - group.add(symbol); - symbol.setStyle(opt.itemStyle); - var symbolRotate = opt.iconRotate === 'inherit' ? visualRotate : opt.iconRotate || 0; - symbol.rotation = symbolRotate * Math.PI / 180; - symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); - if (symbolType.indexOf('empty') > -1) { - symbol.style.stroke = symbol.style.fill; - symbol.style.fill = '#fff'; - symbol.style.lineWidth = 2; - } - return group; - }; - LineSeriesModel.type = 'series.line'; - LineSeriesModel.dependencies = ['grid', 'polar']; - LineSeriesModel.defaultOption = { - // zlevel: 0, - z: 3, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - clip: true, - label: { - position: 'top' - }, - // itemStyle: { - // }, - endLabel: { - show: false, - valueAnimation: true, - distance: 8 - }, - lineStyle: { - width: 2, - type: 'solid' - }, - emphasis: { - scale: true - }, - // 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', 'lttb'. - sampling: 'none', - animationEasing: 'linear', - // Disable progressive - progressive: 0, - hoverLayerThreshold: Infinity, - universalTransition: { - divideShape: 'clone' - }, - triggerLineEvent: false - }; - return LineSeriesModel; - }(SeriesModel); - - /** - * @return label string. Not null/undefined - */ - function getDefaultLabel(data, dataIndex) { - var labelDims = data.mapDimensionsAll('defaultedLabel'); - var len = labelDims.length; - // Simple optimization (in lots of cases, label dims length is 1) - if (len === 1) { - var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]); - return rawVal != null ? rawVal + '' : null; - } else if (len) { - var vals = []; - for (var i = 0; i < labelDims.length; i++) { - vals.push(retrieveRawValue(data, dataIndex, labelDims[i])); - } - return vals.join(' '); - } - } - function getDefaultInterpolatedLabel(data, interpolatedValue) { - var labelDims = data.mapDimensionsAll('defaultedLabel'); - if (!isArray(interpolatedValue)) { - return interpolatedValue + ''; - } - var vals = []; - for (var i = 0; i < labelDims.length; i++) { - var dimIndex = data.getDimensionIndex(labelDims[i]); - if (dimIndex >= 0) { - vals.push(interpolatedValue[dimIndex]); - } - } - return vals.join(' '); - } - - var Symbol = /** @class */function (_super) { - __extends(Symbol, _super); - function Symbol(data, idx, seriesScope, opts) { - var _this = _super.call(this) || this; - _this.updateData(data, idx, seriesScope, opts); - return _this; - } - Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) { - // Remove paths created before - this.removeAll(); - // let 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, null, keepAspect); - symbolPath.attr({ - z2: 100, - culling: true, - scaleX: symbolSize[0] / 2, - scaleY: symbolSize[1] / 2 - }); - // Rewrite drift method - symbolPath.drift = driftSymbol; - this._symbolType = symbolType; - this.add(symbolPath); - }; - /** - * Stop animation - * @param {boolean} toLastFrame - */ - Symbol.prototype.stopSymbolAnimation = function (toLastFrame) { - this.childAt(0).stopAnimation(null, toLastFrame); - }; - Symbol.prototype.getSymbolType = function () { - return this._symbolType; - }; - /** - * 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. - */ - Symbol.prototype.getSymbolPath = function () { - return this.childAt(0); - }; - /** - * Highlight symbol - */ - Symbol.prototype.highlight = function () { - enterEmphasis(this.childAt(0)); - }; - /** - * Downplay symbol - */ - Symbol.prototype.downplay = function () { - leaveEmphasis(this.childAt(0)); - }; - /** - * @param {number} zlevel - * @param {number} z - */ - Symbol.prototype.setZ = function (zlevel, z) { - var symbolPath = this.childAt(0); - symbolPath.zlevel = zlevel; - symbolPath.z = z; - }; - Symbol.prototype.setDraggable = function (draggable, hasCursorOption) { - var symbolPath = this.childAt(0); - symbolPath.draggable = draggable; - symbolPath.cursor = !hasCursorOption && draggable ? 'move' : symbolPath.cursor; - }; - /** - * Update symbol properties - */ - Symbol.prototype.updateData = function (data, idx, seriesScope, opts) { - this.silent = false; - var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; - var seriesModel = data.hostModel; - var symbolSize = Symbol.getSymbolSize(data, idx); - var isInit = symbolType !== this._symbolType; - var disableAnimation = opts && opts.disableAnimation; - if (isInit) { - var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect'); - this._createSymbol(symbolType, data, idx, symbolSize, keepAspect); - } else { - var symbolPath = this.childAt(0); - symbolPath.silent = false; - var target = { - scaleX: symbolSize[0] / 2, - scaleY: symbolSize[1] / 2 - }; - disableAnimation ? symbolPath.attr(target) : updateProps(symbolPath, target, seriesModel, idx); - saveOldStyle(symbolPath); - } - this._updateCommon(data, idx, symbolSize, seriesScope, opts); - if (isInit) { - var symbolPath = this.childAt(0); - if (!disableAnimation) { - var target = { - scaleX: this._sizeX, - scaleY: this._sizeY, - style: { - // Always fadeIn. Because it has fadeOut animation when symbol is removed.. - opacity: symbolPath.style.opacity - } - }; - symbolPath.scaleX = symbolPath.scaleY = 0; - symbolPath.style.opacity = 0; - initProps(symbolPath, target, seriesModel, idx); - } - } - if (disableAnimation) { - // Must stop leave transition manually if don't call initProps or updateProps. - this.childAt(0).stopAnimation('leave'); - } - }; - Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) { - var symbolPath = this.childAt(0); - var seriesModel = data.hostModel; - var emphasisItemStyle; - var blurItemStyle; - var selectItemStyle; - var focus; - var blurScope; - var emphasisDisabled; - var labelStatesModels; - var hoverScale; - var cursorStyle; - if (seriesScope) { - emphasisItemStyle = seriesScope.emphasisItemStyle; - blurItemStyle = seriesScope.blurItemStyle; - selectItemStyle = seriesScope.selectItemStyle; - focus = seriesScope.focus; - blurScope = seriesScope.blurScope; - labelStatesModels = seriesScope.labelStatesModels; - hoverScale = seriesScope.hoverScale; - cursorStyle = seriesScope.cursorStyle; - emphasisDisabled = seriesScope.emphasisDisabled; - } - if (!seriesScope || data.hasItemOption) { - var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle(); - selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); - blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); - focus = emphasisModel.get('focus'); - blurScope = emphasisModel.get('blurScope'); - emphasisDisabled = emphasisModel.get('disabled'); - labelStatesModels = getLabelStatesModels(itemModel); - hoverScale = emphasisModel.getShallow('scale'); - cursorStyle = itemModel.getShallow('cursor'); - } - var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); - symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0); - var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize); - if (symbolOffset) { - symbolPath.x = symbolOffset[0]; - symbolPath.y = symbolOffset[1]; - } - cursorStyle && symbolPath.attr('cursor', cursorStyle); - var symbolStyle = data.getItemVisual(idx, 'style'); - var visualColor = symbolStyle.fill; - if (symbolPath instanceof ZRImage) { - var pathStyle = symbolPath.style; - symbolPath.useStyle(extend({ - // TODO other properties like x, y ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, symbolStyle)); - } else { - if (symbolPath.__isEmptyBrush) { - // fill and stroke will be swapped if it's empty. - // So we cloned a new style to avoid it affecting the original style in visual storage. - // TODO Better implementation. No empty logic! - symbolPath.useStyle(extend({}, symbolStyle)); - } else { - symbolPath.useStyle(symbolStyle); - } - // Disable decal because symbol scale will been applied on the decal. - symbolPath.style.decal = null; - symbolPath.setColor(visualColor, opts && opts.symbolInnerColor); - symbolPath.style.strokeNoScale = true; - } - var liftZ = data.getItemVisual(idx, 'liftZ'); - var z2Origin = this._z2; - if (liftZ != null) { - if (z2Origin == null) { - this._z2 = symbolPath.z2; - symbolPath.z2 += liftZ; - } - } else if (z2Origin != null) { - symbolPath.z2 = z2Origin; - this._z2 = null; - } - var useNameLabel = opts && opts.useNameLabel; - setLabelStyle(symbolPath, labelStatesModels, { - labelFetcher: seriesModel, - labelDataIndex: idx, - defaultText: getLabelDefaultText, - inheritColor: visualColor, - defaultOpacity: symbolStyle.opacity - }); - // Do not execute util needed. - function getLabelDefaultText(idx) { - return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); - } - this._sizeX = symbolSize[0] / 2; - this._sizeY = symbolSize[1] / 2; - var emphasisState = symbolPath.ensureState('emphasis'); - emphasisState.style = emphasisItemStyle; - symbolPath.ensureState('select').style = selectItemStyle; - symbolPath.ensureState('blur').style = blurItemStyle; - // null / undefined / true means to use default strategy. - // 0 / false / negative number / NaN / Infinity means no scale. - var scaleRatio = hoverScale == null || hoverScale === true ? Math.max(1.1, 3 / this._sizeY) - // PENDING: restrict hoverScale > 1? It seems unreasonable to scale down - : isFinite(hoverScale) && hoverScale > 0 ? +hoverScale : 1; - // always set scale to allow resetting - emphasisState.scaleX = this._sizeX * scaleRatio; - emphasisState.scaleY = this._sizeY * scaleRatio; - this.setSymbolScale(1); - toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); - }; - Symbol.prototype.setSymbolScale = function (scale) { - this.scaleX = this.scaleY = scale; - }; - Symbol.prototype.fadeOut = function (cb, seriesModel, opt) { - var symbolPath = this.childAt(0); - var dataIndex = getECData(this).dataIndex; - var animationOpt = opt && opt.animation; - // Avoid mistaken hover when fading out - this.silent = symbolPath.silent = true; - // Not show text when animating - if (opt && opt.fadeLabel) { - var textContent = symbolPath.getTextContent(); - if (textContent) { - removeElement(textContent, { - style: { - opacity: 0 - } - }, seriesModel, { - dataIndex: dataIndex, - removeOpt: animationOpt, - cb: function () { - symbolPath.removeTextContent(); - } - }); - } - } else { - symbolPath.removeTextContent(); - } - removeElement(symbolPath, { - style: { - opacity: 0 - }, - scaleX: 0, - scaleY: 0 - }, seriesModel, { - dataIndex: dataIndex, - cb: cb, - removeOpt: animationOpt - }); - }; - Symbol.getSymbolSize = function (data, idx) { - return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); - }; - return Symbol; - }(Group); - function driftSymbol(dx, dy) { - this.parent.drift(dx, dy); - } - - function symbolNeedsDraw(data, point, idx, opt) { - return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) - // We do not set clipShape on group, because it will cut part of - // the symbol element shape. We use the same clip shape here as - // the line clip. - && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none'; - } - function normalizeUpdateOpt(opt) { - if (opt != null && !isObject(opt)) { - opt = { - isIgnore: opt - }; - } - return opt || {}; - } - function makeSeriesScope(data) { - var seriesModel = data.hostModel; - var emphasisModel = seriesModel.getModel('emphasis'); - return { - emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(), - blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(), - selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(), - focus: emphasisModel.get('focus'), - blurScope: emphasisModel.get('blurScope'), - emphasisDisabled: emphasisModel.get('disabled'), - hoverScale: emphasisModel.get('scale'), - labelStatesModels: getLabelStatesModels(seriesModel), - cursorStyle: seriesModel.get('cursor') - }; - } - var SymbolDraw = /** @class */function () { - function SymbolDraw(SymbolCtor) { - this.group = new Group(); - this._SymbolCtor = SymbolCtor || Symbol; - } - /** - * Update symbols draw by new data - */ - SymbolDraw.prototype.updateData = function (data, opt) { - // Remove progressive els. - this._progressiveEls = null; - opt = normalizeUpdateOpt(opt); - var group = this.group; - var seriesModel = data.hostModel; - var oldData = this._data; - var SymbolCtor = this._SymbolCtor; - var disableAnimation = opt.disableAnimation; - var seriesScope = makeSeriesScope(data); - var symbolUpdateOpt = { - disableAnimation: disableAnimation - }; - var getSymbolPoint = opt.getSymbolPoint || function (idx) { - return data.getItemLayout(idx); - }; - // There is no oldLineData only when first rendering or switching from - // stream mode to normal mode, where previous elements should be removed. - if (!oldData) { - group.removeAll(); - } - data.diff(oldData).add(function (newIdx) { - var point = getSymbolPoint(newIdx); - if (symbolNeedsDraw(data, point, newIdx, opt)) { - var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); - symbolEl.setPosition(point); - data.setItemGraphicEl(newIdx, symbolEl); - group.add(symbolEl); - } - }).update(function (newIdx, oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); - var point = getSymbolPoint(newIdx); - if (!symbolNeedsDraw(data, point, newIdx, opt)) { - group.remove(symbolEl); - return; - } - var newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle'; - var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType(); - if (!symbolEl - // Create a new if symbol type changed. - || oldSymbolType && oldSymbolType !== newSymbolType) { - group.remove(symbolEl); - symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); - symbolEl.setPosition(point); - } else { - symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt); - var target = { - x: point[0], - y: point[1] - }; - disableAnimation ? symbolEl.attr(target) : updateProps(symbolEl, target, seriesModel); - } - // Add back - group.add(symbolEl); - data.setItemGraphicEl(newIdx, symbolEl); - }).remove(function (oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); - el && el.fadeOut(function () { - group.remove(el); - }, seriesModel); - }).execute(); - this._getSymbolPoint = getSymbolPoint; - this._data = data; - }; - SymbolDraw.prototype.updateLayout = function () { - var _this = this; - var data = this._data; - if (data) { - // Not use animation - data.eachItemGraphicEl(function (el, idx) { - var point = _this._getSymbolPoint(idx); - el.setPosition(point); - el.markRedraw(); - }); - } - }; - SymbolDraw.prototype.incrementalPrepareUpdate = function (data) { - this._seriesScope = makeSeriesScope(data); - this._data = null; - this.group.removeAll(); - }; - /** - * Update symbols draw by new data - */ - SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) { - // Clear - this._progressiveEls = []; - opt = normalizeUpdateOpt(opt); - function updateIncrementalAndHover(el) { - if (!el.isGroup) { - el.incremental = true; - el.ensureState('emphasis').hoverLayer = true; - } - } - for (var idx = taskParams.start; idx < taskParams.end; idx++) { - var point = data.getItemLayout(idx); - if (symbolNeedsDraw(data, point, idx, opt)) { - var el = new this._SymbolCtor(data, idx, this._seriesScope); - el.traverse(updateIncrementalAndHover); - el.setPosition(point); - this.group.add(el); - data.setItemGraphicEl(idx, el); - this._progressiveEls.push(el); - } - } - }; - SymbolDraw.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; - SymbolDraw.prototype.remove = function (enableAnimation) { - var group = this.group; - var data = this._data; - // Incremental model do not have this._data. - if (data && enableAnimation) { - data.eachItemGraphicEl(function (el) { - el.fadeOut(function () { - group.remove(el); - }, data.hostModel); - }); - } else { - group.removeAll(); - } - }; - return SymbolDraw; - }(); - - function prepareDataCoordInfo(coordSys, data, valueOrigin) { - var baseAxis = coordSys.getBaseAxis(); - var valueAxis = coordSys.getOtherAxis(baseAxis); - var valueStart = getValueStart(valueAxis, valueOrigin); - var baseAxisDim = baseAxis.dim; - var valueAxisDim = valueAxis.dim; - var valueDim = data.mapDimension(valueAxisDim); - var baseDim = data.mapDimension(baseAxisDim); - var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; - var dims = map(coordSys.dimensions, function (coordDim) { - return data.mapDimension(coordDim); - }); - var stacked = false; - var stackResultDim = data.getCalculationInfo('stackResultDimension'); - if (isDimensionStacked(data, dims[0] /* , dims[1] */)) { - // jshint ignore:line - stacked = true; - dims[0] = stackResultDim; - } - if (isDimensionStacked(data, dims[1] /* , dims[0] */)) { - // jshint ignore:line - stacked = true; - dims[1] = stackResultDim; - } - return { - dataDimsForPoint: dims, - valueStart: valueStart, - valueAxisDim: valueAxisDim, - baseAxisDim: baseAxisDim, - stacked: !!stacked, - valueDim: valueDim, - baseDim: baseDim, - baseDataOffset: baseDataOffset, - stackedOverDimension: data.getCalculationInfo('stackedOverDimension') - }; - } - function getValueStart(valueAxis, valueOrigin) { - var valueStart = 0; - var extent = valueAxis.scale.getExtent(); - if (valueOrigin === 'start') { - valueStart = extent[0]; - } else if (valueOrigin === 'end') { - valueStart = extent[1]; - } - // If origin is specified as a number, use it as - // valueStart directly - else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) { - valueStart = valueOrigin; - } - // auto - else { - // Both positive - if (extent[0] > 0) { - valueStart = extent[0]; - } - // Both negative - else if (extent[1] < 0) { - valueStart = extent[1]; - } - // If is one positive, and one negative, onZero shall be true - } - - return valueStart; - } - function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) { - var value = NaN; - if (dataCoordInfo.stacked) { - value = data.get(data.getCalculationInfo('stackedOverDimension'), idx); - } - if (isNaN(value)) { - value = dataCoordInfo.valueStart; - } - var baseDataOffset = dataCoordInfo.baseDataOffset; - var stackedData = []; - stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx); - stackedData[1 - baseDataOffset] = value; - return coordSys.dataToPoint(stackedData); - } - - function diffData(oldData, newData) { - var diffResult = []; - newData.diff(oldData).add(function (idx) { - diffResult.push({ - cmd: '+', - idx: idx - }); - }).update(function (newIdx, oldIdx) { - diffResult.push({ - cmd: '=', - idx: oldIdx, - idx1: newIdx - }); - }).remove(function (idx) { - diffResult.push({ - cmd: '-', - idx: idx - }); - }).execute(); - return diffResult; - } - function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) { - var diff = diffData(oldData, newData); - // let newIdList = newData.mapArray(newData.getId); - // let oldIdList = oldData.mapArray(oldData.getId); - // convertToIntId(newIdList, oldIdList); - // // FIXME One data ? - // diff = arrayDiff(oldIdList, newIdList); - var currPoints = []; - var nextPoints = []; - // Points for stacking base line - var currStackedPoints = []; - var nextStackedPoints = []; - var status = []; - var sortedIndices = []; - var rawIndices = []; - var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); - // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin); - var oldPoints = oldData.getLayout('points') || []; - var newPoints = newData.getLayout('points') || []; - for (var i = 0; i < diff.length; i++) { - var diffItem = diff[i]; - var pointAdded = true; - var oldIdx2 = void 0; - var newIdx2 = void 0; - // FIXME, animation is not so perfect when dataZoom window moves fast - // Which is in case remvoing or add more than one data in the tail or head - switch (diffItem.cmd) { - case '=': - oldIdx2 = diffItem.idx * 2; - newIdx2 = diffItem.idx1 * 2; - var currentX = oldPoints[oldIdx2]; - var currentY = oldPoints[oldIdx2 + 1]; - var nextX = newPoints[newIdx2]; - var nextY = newPoints[newIdx2 + 1]; - // If previous data is NaN, use next point directly - if (isNaN(currentX) || isNaN(currentY)) { - currentX = nextX; - currentY = nextY; - } - currPoints.push(currentX, currentY); - nextPoints.push(nextX, nextY); - currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]); - nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); - rawIndices.push(newData.getRawIndex(diffItem.idx1)); - break; - case '+': - var newIdx = diffItem.idx; - var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint; - var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]); - newIdx2 = newIdx * 2; - currPoints.push(oldPt[0], oldPt[1]); - nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]); - var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx); - currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]); - nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); - rawIndices.push(newData.getRawIndex(newIdx)); - break; - case '-': - pointAdded = false; - } - // Original indices - if (pointAdded) { - status.push(diffItem); - sortedIndices.push(sortedIndices.length); - } - } - // Diff result may be crossed if all items are changed - // Sort by data index - sortedIndices.sort(function (a, b) { - return rawIndices[a] - rawIndices[b]; - }); - var len = currPoints.length; - var sortedCurrPoints = createFloat32Array(len); - var sortedNextPoints = createFloat32Array(len); - var sortedCurrStackedPoints = createFloat32Array(len); - var sortedNextStackedPoints = createFloat32Array(len); - var sortedStatus = []; - for (var i = 0; i < sortedIndices.length; i++) { - var idx = sortedIndices[i]; - var i2 = i * 2; - var idx2 = idx * 2; - sortedCurrPoints[i2] = currPoints[idx2]; - sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1]; - sortedNextPoints[i2] = nextPoints[idx2]; - sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1]; - sortedCurrStackedPoints[i2] = currStackedPoints[idx2]; - sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1]; - sortedNextStackedPoints[i2] = nextStackedPoints[idx2]; - sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1]; - sortedStatus[i] = status[idx]; - } - return { - current: sortedCurrPoints, - next: sortedNextPoints, - stackedOnCurrent: sortedCurrStackedPoints, - stackedOnNext: sortedNextStackedPoints, - status: sortedStatus - }; - } - - var mathMin$5 = Math.min; - var mathMax$5 = Math.max; - function isPointNull(x, y) { - return isNaN(x) || isNaN(y); - } - /** - * Draw smoothed line in non-monotone, in may cause undesired curve in extreme - * situations. This should be used when points are non-monotone neither in x or - * y dimension. - */ - function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) { - var prevX; - var prevY; - var cpx0; - var cpy0; - var cpx1; - var cpy1; - var idx = start; - var k = 0; - for (; k < segLen; k++) { - var x = points[idx * 2]; - var y = points[idx * 2 + 1]; - if (idx >= allLen || idx < 0) { - break; - } - if (isPointNull(x, y)) { - if (connectNulls) { - idx += dir; - continue; - } - break; - } - if (idx === start) { - ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y); - cpx0 = x; - cpy0 = y; - } else { - var dx = x - prevX; - var dy = y - prevY; - // Ignore tiny segment. - if (dx * dx + dy * dy < 0.5) { - idx += dir; - continue; - } - if (smooth > 0) { - var nextIdx = idx + dir; - var nextX = points[nextIdx * 2]; - var nextY = points[nextIdx * 2 + 1]; - // Ignore duplicate point - while (nextX === x && nextY === y && k < segLen) { - k++; - nextIdx += dir; - idx += dir; - nextX = points[nextIdx * 2]; - nextY = points[nextIdx * 2 + 1]; - x = points[idx * 2]; - y = points[idx * 2 + 1]; - dx = x - prevX; - dy = y - prevY; - } - var tmpK = k + 1; - if (connectNulls) { - // Find next point not null - while (isPointNull(nextX, nextY) && tmpK < segLen) { - tmpK++; - nextIdx += dir; - nextX = points[nextIdx * 2]; - nextY = points[nextIdx * 2 + 1]; - } - } - var ratioNextSeg = 0.5; - var vx = 0; - var vy = 0; - var nextCpx0 = void 0; - var nextCpy0 = void 0; - // Is last point - if (tmpK >= segLen || isPointNull(nextX, nextY)) { - cpx1 = x; - cpy1 = y; - } else { - vx = nextX - prevX; - vy = nextY - prevY; - var dx0 = x - prevX; - var dx1 = nextX - x; - var dy0 = y - prevY; - var dy1 = nextY - y; - var lenPrevSeg = void 0; - var lenNextSeg = void 0; - if (smoothMonotone === 'x') { - lenPrevSeg = Math.abs(dx0); - lenNextSeg = Math.abs(dx1); - var dir_1 = vx > 0 ? 1 : -1; - cpx1 = x - dir_1 * lenPrevSeg * smooth; - cpy1 = y; - nextCpx0 = x + dir_1 * lenNextSeg * smooth; - nextCpy0 = y; - } else if (smoothMonotone === 'y') { - lenPrevSeg = Math.abs(dy0); - lenNextSeg = Math.abs(dy1); - var dir_2 = vy > 0 ? 1 : -1; - cpx1 = x; - cpy1 = y - dir_2 * lenPrevSeg * smooth; - nextCpx0 = x; - nextCpy0 = y + dir_2 * lenNextSeg * smooth; - } else { - lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0); - lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); - // Use ratio of seg length - ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg); - cpx1 = x - vx * smooth * (1 - ratioNextSeg); - cpy1 = y - vy * smooth * (1 - ratioNextSeg); - // cp0 of next segment - nextCpx0 = x + vx * smooth * ratioNextSeg; - nextCpy0 = y + vy * smooth * ratioNextSeg; - // Smooth constraint between point and next point. - // Avoid exceeding extreme after smoothing. - nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x)); - nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y)); - nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x)); - nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y)); - // Reclaculate cp1 based on the adjusted cp0 of next seg. - vx = nextCpx0 - x; - vy = nextCpy0 - y; - cpx1 = x - vx * lenPrevSeg / lenNextSeg; - cpy1 = y - vy * lenPrevSeg / lenNextSeg; - // Smooth constraint between point and prev point. - // Avoid exceeding extreme after smoothing. - cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x)); - cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y)); - cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x)); - cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y)); - // Adjust next cp0 again. - vx = x - cpx1; - vy = y - cpy1; - nextCpx0 = x + vx * lenNextSeg / lenPrevSeg; - nextCpy0 = y + vy * lenNextSeg / lenPrevSeg; - } - } - ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y); - cpx0 = nextCpx0; - cpy0 = nextCpy0; - } else { - ctx.lineTo(x, y); - } - } - prevX = x; - prevY = y; - idx += dir; - } - return k; - } - var ECPolylineShape = /** @class */function () { - function ECPolylineShape() { - this.smooth = 0; - this.smoothConstraint = true; - } - return ECPolylineShape; - }(); - var ECPolyline = /** @class */function (_super) { - __extends(ECPolyline, _super); - function ECPolyline(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'ec-polyline'; - return _this; - } - ECPolyline.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - ECPolyline.prototype.getDefaultShape = function () { - return new ECPolylineShape(); - }; - ECPolyline.prototype.buildPath = function (ctx, shape) { - var points = shape.points; - var i = 0; - var len = points.length / 2; - // const result = getBoundingBox(points, shape.smoothConstraint); - if (shape.connectNulls) { - // Must remove first and last null values avoid draw error in polygon - for (; len > 0; len--) { - if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) { - break; - } - } - for (; i < len; i++) { - if (!isPointNull(points[i * 2], points[i * 2 + 1])) { - break; - } - } - } - while (i < len) { - i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1; - } - }; - ECPolyline.prototype.getPointOn = function (xOrY, dim) { - if (!this.path) { - this.createPathProxy(); - this.buildPath(this.path, this.shape); - } - var path = this.path; - var data = path.data; - var CMD = PathProxy.CMD; - var x0; - var y0; - var isDimX = dim === 'x'; - var roots = []; - for (var i = 0; i < data.length;) { - var cmd = data[i++]; - var x = void 0; - var y = void 0; - var x2 = void 0; - var y2 = void 0; - var x3 = void 0; - var y3 = void 0; - var t = void 0; - switch (cmd) { - case CMD.M: - x0 = data[i++]; - y0 = data[i++]; - break; - case CMD.L: - x = data[i++]; - y = data[i++]; - t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0); - if (t <= 1 && t >= 0) { - var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0; - return isDimX ? [xOrY, val] : [val, xOrY]; - } - x0 = x; - y0 = y; - break; - case CMD.C: - x = data[i++]; - y = data[i++]; - x2 = data[i++]; - y2 = data[i++]; - x3 = data[i++]; - y3 = data[i++]; - var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots); - if (nRoot > 0) { - for (var i_1 = 0; i_1 < nRoot; i_1++) { - var t_1 = roots[i_1]; - if (t_1 <= 1 && t_1 >= 0) { - var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1); - return isDimX ? [xOrY, val] : [val, xOrY]; - } - } - } - x0 = x3; - y0 = y3; - break; - } - } - }; - return ECPolyline; - }(Path); - var ECPolygonShape = /** @class */function (_super) { - __extends(ECPolygonShape, _super); - function ECPolygonShape() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ECPolygonShape; - }(ECPolylineShape); - var ECPolygon = /** @class */function (_super) { - __extends(ECPolygon, _super); - function ECPolygon(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'ec-polygon'; - return _this; - } - ECPolygon.prototype.getDefaultShape = function () { - return new ECPolygonShape(); - }; - ECPolygon.prototype.buildPath = function (ctx, shape) { - var points = shape.points; - var stackedOnPoints = shape.stackedOnPoints; - var i = 0; - var len = points.length / 2; - var smoothMonotone = shape.smoothMonotone; - if (shape.connectNulls) { - // Must remove first and last null values avoid draw error in polygon - for (; len > 0; len--) { - if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) { - break; - } - } - for (; i < len; i++) { - if (!isPointNull(points[i * 2], points[i * 2 + 1])) { - break; - } - } - } - while (i < len) { - var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls); - drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls); - i += k + 1; - ctx.closePath(); - } - }; - return ECPolygon; - }(Path); - - function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) { - var rect = cartesian.getArea(); - var x = rect.x; - var y = rect.y; - var width = rect.width; - var height = rect.height; - var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; - // Expand the clip path a bit to avoid the border is clipped and looks thinner - x -= lineWidth / 2; - y -= lineWidth / 2; - width += lineWidth; - height += lineWidth; - // fix: https://github.com/apache/incubator-echarts/issues/11369 - width = Math.ceil(width); - if (x !== Math.floor(x)) { - x = Math.floor(x); - // if no extra 1px on `width`, it will still be clipped since `x` is floored - width++; - } - var clipPath = new Rect({ - shape: { - x: x, - y: y, - width: width, - height: height - } - }); - if (hasAnimation) { - var baseAxis = cartesian.getBaseAxis(); - var isHorizontal = baseAxis.isHorizontal(); - var isAxisInversed = baseAxis.inverse; - if (isHorizontal) { - if (isAxisInversed) { - clipPath.shape.x += width; - } - clipPath.shape.width = 0; - } else { - if (!isAxisInversed) { - clipPath.shape.y += height; - } - clipPath.shape.height = 0; - } - var duringCb = isFunction(during) ? function (percent) { - during(percent, clipPath); - } : null; - initProps(clipPath, { - shape: { - width: width, - height: height, - x: x, - y: y - } - }, seriesModel, null, done, duringCb); - } - return clipPath; - } - function createPolarClipPath(polar, hasAnimation, seriesModel) { - var sectorArea = polar.getArea(); - // Avoid float number rounding error for symbol on the edge of axis extent. - var r0 = round(sectorArea.r0, 1); - var r = round(sectorArea.r, 1); - var clipPath = new Sector({ - shape: { - cx: round(polar.cx, 1), - cy: round(polar.cy, 1), - r0: r0, - r: r, - startAngle: sectorArea.startAngle, - endAngle: sectorArea.endAngle, - clockwise: sectorArea.clockwise - } - }); - if (hasAnimation) { - var isRadial = polar.getBaseAxis().dim === 'angle'; - if (isRadial) { - clipPath.shape.endAngle = sectorArea.startAngle; - } else { - clipPath.shape.r = r0; - } - initProps(clipPath, { - shape: { - endAngle: sectorArea.endAngle, - r: r - } - }, seriesModel); - } - return clipPath; - } - function createClipPath(coordSys, hasAnimation, seriesModel, done, during) { - if (!coordSys) { - return null; - } else if (coordSys.type === 'polar') { - return createPolarClipPath(coordSys, hasAnimation, seriesModel); - } else if (coordSys.type === 'cartesian2d') { - return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during); - } - return null; - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 isCoordinateSystemType(coordSys, type) { - return coordSys.type === type; - } - - function isPointsSame(points1, points2) { - if (points1.length !== points2.length) { - return; - } - for (var i = 0; i < points1.length; i++) { - if (points1[i] !== points2[i]) { - return; - } - } - return true; - } - function bboxFromPoints(points) { - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; - for (var i = 0; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - if (!isNaN(x)) { - minX = Math.min(x, minX); - maxX = Math.max(x, maxX); - } - if (!isNaN(y)) { - minY = Math.min(y, minY); - maxY = Math.max(y, maxY); - } - } - return [[minX, minY], [maxX, maxY]]; - } - function getBoundingDiff(points1, points2) { - var _a = bboxFromPoints(points1), - min1 = _a[0], - max1 = _a[1]; - var _b = bboxFromPoints(points2), - min2 = _b[0], - max2 = _b[1]; - // Get a max value from each corner of two boundings. - return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1])); - } - function getSmooth(smooth) { - return isNumber(smooth) ? smooth : smooth ? 0.5 : 0; - } - function getStackedOnPoints(coordSys, data, dataCoordInfo) { - if (!dataCoordInfo.valueDim) { - return []; - } - var len = data.count(); - var points = createFloat32Array(len * 2); - for (var idx = 0; idx < len; idx++) { - var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx); - points[idx * 2] = pt[0]; - points[idx * 2 + 1] = pt[1]; - } - return points; - } - function turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) { - var baseAxis = coordSys.getBaseAxis(); - var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1; - var stepPoints = []; - var i = 0; - var stepPt = []; - var pt = []; - var nextPt = []; - var filteredPoints = []; - if (connectNulls) { - for (i = 0; i < points.length; i += 2) { - if (!isNaN(points[i]) && !isNaN(points[i + 1])) { - filteredPoints.push(points[i], points[i + 1]); - } - } - points = filteredPoints; - } - for (i = 0; i < points.length - 2; i += 2) { - nextPt[0] = points[i + 2]; - nextPt[1] = points[i + 3]; - pt[0] = points[i]; - pt[1] = points[i + 1]; - stepPoints.push(pt[0], pt[1]); - switch (stepTurnAt) { - case 'end': - stepPt[baseIndex] = nextPt[baseIndex]; - stepPt[1 - baseIndex] = pt[1 - baseIndex]; - stepPoints.push(stepPt[0], stepPt[1]); - break; - case 'middle': - var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2; - var stepPt2 = []; - stepPt[baseIndex] = stepPt2[baseIndex] = middle; - stepPt[1 - baseIndex] = pt[1 - baseIndex]; - stepPt2[1 - baseIndex] = nextPt[1 - baseIndex]; - stepPoints.push(stepPt[0], stepPt[1]); - stepPoints.push(stepPt2[0], stepPt2[1]); - break; - default: - // default is start - stepPt[baseIndex] = pt[baseIndex]; - stepPt[1 - baseIndex] = nextPt[1 - baseIndex]; - stepPoints.push(stepPt[0], stepPt[1]); - } - } - // Last points - stepPoints.push(points[i++], points[i++]); - return stepPoints; - } - /** - * Clip color stops to edge. Avoid creating too large gradients. - * Which may lead to blurry when GPU acceleration is enabled. See #15680 - * - * The stops has been sorted from small to large. - */ - function clipColorStops(colorStops, maxSize) { - var newColorStops = []; - var len = colorStops.length; - // coord will always < 0 in prevOutOfRangeColorStop. - var prevOutOfRangeColorStop; - var prevInRangeColorStop; - function lerpStop(stop0, stop1, clippedCoord) { - var coord0 = stop0.coord; - var p = (clippedCoord - coord0) / (stop1.coord - coord0); - var color = lerp$1(p, [stop0.color, stop1.color]); - return { - coord: clippedCoord, - color: color - }; - } - for (var i = 0; i < len; i++) { - var stop_1 = colorStops[i]; - var coord = stop_1.coord; - if (coord < 0) { - prevOutOfRangeColorStop = stop_1; - } else if (coord > maxSize) { - if (prevInRangeColorStop) { - newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize)); - } else if (prevOutOfRangeColorStop) { - // If there are two stops and coord range is between these two stops - newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize)); - } - // All following stop will be out of range. So just ignore them. - break; - } else { - if (prevOutOfRangeColorStop) { - newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0)); - // Reset - prevOutOfRangeColorStop = null; - } - newColorStops.push(stop_1); - prevInRangeColorStop = stop_1; - } - } - return newColorStops; - } - function getVisualGradient(data, coordSys, api) { - var visualMetaList = data.getVisual('visualMeta'); - if (!visualMetaList || !visualMetaList.length || !data.count()) { - // When data.count() is 0, gradient range can not be calculated. - return; - } - if (coordSys.type !== 'cartesian2d') { - if ("development" !== 'production') { - console.warn('Visual map on line style is only supported on cartesian2d.'); - } - return; - } - var coordDim; - var visualMeta; - for (var i = visualMetaList.length - 1; i >= 0; i--) { - var dimInfo = data.getDimensionInfo(visualMetaList[i].dimension); - coordDim = dimInfo && dimInfo.coordDim; - // Can only be x or y - if (coordDim === 'x' || coordDim === 'y') { - visualMeta = visualMetaList[i]; - break; - } - } - if (!visualMeta) { - if ("development" !== 'production') { - console.warn('Visual map on line style only support x or y dimension.'); - } - return; - } - // If the area to be rendered is bigger than area defined by LinearGradient, - // the canvas spec prescribes that the color of the first stop and the last - // stop should be used. But if two stops are added at offset 0, in effect - // browsers use the color of the second stop to render area outside - // LinearGradient. So we can only infinitesimally extend area defined in - // LinearGradient to render `outerColors`. - var axis = coordSys.getAxis(coordDim); - // dataToCoord mapping may not be linear, but must be monotonic. - var colorStops = map(visualMeta.stops, function (stop) { - // offset will be calculated later. - return { - coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)), - color: stop.color - }; - }); - var stopLen = colorStops.length; - var outerColors = visualMeta.outerColors.slice(); - if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) { - colorStops.reverse(); - outerColors.reverse(); - } - var colorStopsInRange = clipColorStops(colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight()); - var inRangeStopLen = colorStopsInRange.length; - if (!inRangeStopLen && stopLen) { - // All stops are out of range. All will be the same color. - return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color; - } - var tinyExtent = 10; // Arbitrary value: 10px - var minCoord = colorStopsInRange[0].coord - tinyExtent; - var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent; - var coordSpan = maxCoord - minCoord; - if (coordSpan < 1e-3) { - return 'transparent'; - } - each(colorStopsInRange, function (stop) { - stop.offset = (stop.coord - minCoord) / coordSpan; - }); - colorStopsInRange.push({ - // NOTE: inRangeStopLen may still be 0 if stoplen is zero. - offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5, - color: outerColors[1] || 'transparent' - }); - colorStopsInRange.unshift({ - offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5, - color: outerColors[0] || 'transparent' - }); - var gradient = new LinearGradient(0, 0, 0, 0, colorStopsInRange, true); - gradient[coordDim] = minCoord; - gradient[coordDim + '2'] = maxCoord; - return gradient; - } - function getIsIgnoreFunc(seriesModel, data, coordSys) { - var showAllSymbol = seriesModel.get('showAllSymbol'); - var isAuto = showAllSymbol === 'auto'; - if (showAllSymbol && !isAuto) { - return; - } - var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; - if (!categoryAxis) { - return; - } - // Note that category label interval strategy might bring some weird effect - // in some scenario: users may wonder why some of the symbols are not - // displayed. So we show all symbols as possible as we can. - if (isAuto - // Simplify the logic, do not determine label overlap here. - && canShowAllSymbolForCategory(categoryAxis, data)) { - return; - } - // Otherwise follow the label interval strategy on category axis. - var categoryDataDim = data.mapDimension(categoryAxis.dim); - var labelMap = {}; - each(categoryAxis.getViewLabels(), function (labelItem) { - var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue); - labelMap[ordinalNumber] = 1; - }); - return function (dataIndex) { - return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex)); - }; - } - function canShowAllSymbolForCategory(categoryAxis, data) { - // In most cases, line is monotonous on category axis, and the label size - // is close with each other. So we check the symbol size and some of the - // label size alone with the category axis to estimate whether all symbol - // can be shown without overlap. - var axisExtent = categoryAxis.getExtent(); - var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count(); - isNaN(availSize) && (availSize = 0); // 0/0 is NaN. - // Sampling some points, max 5. - var dataLen = data.count(); - var step = Math.max(1, Math.round(dataLen / 5)); - for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) { - if (Symbol.getSymbolSize(data, dataIndex - // Only for cartesian, where `isHorizontal` exists. - )[categoryAxis.isHorizontal() ? 1 : 0] - // Empirical number - * 1.5 > availSize) { - return false; - } - } - return true; - } - function isPointNull$1(x, y) { - return isNaN(x) || isNaN(y); - } - function getLastIndexNotNull(points) { - var len = points.length / 2; - for (; len > 0; len--) { - if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) { - break; - } - } - return len - 1; - } - function getPointAtIndex(points, idx) { - return [points[idx * 2], points[idx * 2 + 1]]; - } - function getIndexRange(points, xOrY, dim) { - var len = points.length / 2; - var dimIdx = dim === 'x' ? 0 : 1; - var a; - var b; - var prevIndex = 0; - var nextIndex = -1; - for (var i = 0; i < len; i++) { - b = points[i * 2 + dimIdx]; - if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) { - continue; - } - if (i === 0) { - a = b; - continue; - } - if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) { - nextIndex = i; - break; - } - prevIndex = i; - a = b; - } - return { - range: [prevIndex, nextIndex], - t: (xOrY - a) / (b - a) - }; - } - function anyStateShowEndLabel(seriesModel) { - if (seriesModel.get(['endLabel', 'show'])) { - return true; - } - for (var i = 0; i < SPECIAL_STATES.length; i++) { - if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) { - return true; - } - } - return false; - } - function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) { - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - var endLabelModel_1 = seriesModel.getModel('endLabel'); - var valueAnimation_1 = endLabelModel_1.get('valueAnimation'); - var data_1 = seriesModel.getData(); - var labelAnimationRecord_1 = { - lastFrameIndex: 0 - }; - var during = anyStateShowEndLabel(seriesModel) ? function (percent, clipRect) { - lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys); - } : null; - var isHorizontal = coordSys.getBaseAxis().isHorizontal(); - var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () { - var endLabel = lineView._endLabel; - if (endLabel && hasAnimation) { - if (labelAnimationRecord_1.originalX != null) { - endLabel.attr({ - x: labelAnimationRecord_1.originalX, - y: labelAnimationRecord_1.originalY - }); - } - } - }, during); - // Expand clip shape to avoid clipping when line value exceeds axis - if (!seriesModel.get('clip', true)) { - var rectShape = clipPath.shape; - var expandSize = Math.max(rectShape.width, rectShape.height); - if (isHorizontal) { - rectShape.y -= expandSize; - rectShape.height += expandSize * 2; - } else { - rectShape.x -= expandSize; - rectShape.width += expandSize * 2; - } - } - // Set to the final frame. To make sure label layout is right. - if (during) { - during(1, clipPath); - } - return clipPath; - } else { - if ("development" !== 'production') { - if (seriesModel.get(['endLabel', 'show'])) { - console.warn('endLabel is not supported for lines in polar systems.'); - } - } - return createPolarClipPath(coordSys, hasAnimation, seriesModel); - } - } - function getEndLabelStateSpecified(endLabelModel, coordSys) { - var baseAxis = coordSys.getBaseAxis(); - var isHorizontal = baseAxis.isHorizontal(); - var isBaseInversed = baseAxis.inverse; - var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center'; - var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom'; - return { - normal: { - align: endLabelModel.get('align') || align, - verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign - } - }; - } - var LineView = /** @class */function (_super) { - __extends(LineView, _super); - function LineView() { - return _super !== null && _super.apply(this, arguments) || this; - } - LineView.prototype.init = function () { - var lineGroup = new Group(); - var symbolDraw = new SymbolDraw(); - this.group.add(symbolDraw.group); - this._symbolDraw = symbolDraw; - this._lineGroup = lineGroup; - }; - LineView.prototype.render = function (seriesModel, ecModel, api) { - var _this = this; - var coordSys = seriesModel.coordinateSystem; - var group = this.group; - var data = seriesModel.getData(); - var lineStyleModel = seriesModel.getModel('lineStyle'); - var areaStyleModel = seriesModel.getModel('areaStyle'); - var points = data.getLayout('points') || []; - var isCoordSysPolar = coordSys.type === 'polar'; - var prevCoordSys = this._coordSys; - var symbolDraw = this._symbolDraw; - var polyline = this._polyline; - var polygon = this._polygon; - var lineGroup = this._lineGroup; - var hasAnimation = !ecModel.ssr && seriesModel.get('animation'); - var isAreaChart = !areaStyleModel.isEmpty(); - var valueOrigin = areaStyleModel.get('origin'); - var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin); - var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo); - var showSymbol = seriesModel.get('showSymbol'); - var connectNulls = seriesModel.get('connectNulls'); - var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); - // Remove temporary symbols - var oldData = this._data; - oldData && oldData.eachItemGraphicEl(function (el, idx) { - if (el.__temp) { - group.remove(el); - oldData.setItemGraphicEl(idx, null); - } - }); - // Remove previous created symbols if showSymbol changed to false - if (!showSymbol) { - symbolDraw.remove(); - } - group.add(lineGroup); - // FIXME step not support polar - var step = !isCoordSysPolar ? seriesModel.get('step') : false; - var clipShapeForSymbol; - if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) { - clipShapeForSymbol = coordSys.getArea(); - // Avoid float number rounding error for symbol on the edge of axis extent. - // See #7913 and `test/dataZoom-clip.html`. - if (clipShapeForSymbol.width != null) { - clipShapeForSymbol.x -= 0.1; - clipShapeForSymbol.y -= 0.1; - clipShapeForSymbol.width += 0.2; - clipShapeForSymbol.height += 0.2; - } else if (clipShapeForSymbol.r0) { - clipShapeForSymbol.r0 -= 0.5; - clipShapeForSymbol.r += 0.5; - } - } - this._clipShapeForSymbol = clipShapeForSymbol; - var visualColor = getVisualGradient(data, coordSys, api) || data.getVisual('style')[data.getVisual('drawType')]; - // Initialization animation or coordinate system changed - if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) { - showSymbol && symbolDraw.updateData(data, { - isIgnore: isIgnoreFunc, - clipShape: clipShapeForSymbol, - disableAnimation: true, - getSymbolPoint: function (idx) { - return [points[idx * 2], points[idx * 2 + 1]]; - } - }); - hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol); - if (step) { - // TODO If stacked series is not step - points = turnPointsIntoStep(points, coordSys, step, connectNulls); - if (stackedOnPoints) { - stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); - } - } - polyline = this._newPolyline(points); - if (isAreaChart) { - polygon = this._newPolygon(points, stackedOnPoints); - } // If areaStyle is removed - else if (polygon) { - lineGroup.remove(polygon); - polygon = this._polygon = null; - } - // NOTE: Must update _endLabel before setClipPath. - if (!isCoordSysPolar) { - this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); - } - lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); - } else { - if (isAreaChart && !polygon) { - // If areaStyle is added - polygon = this._newPolygon(points, stackedOnPoints); - } else if (polygon && !isAreaChart) { - // If areaStyle is removed - lineGroup.remove(polygon); - polygon = this._polygon = null; - } - // NOTE: Must update _endLabel before setClipPath. - if (!isCoordSysPolar) { - this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); - } - // Update clipPath - var oldClipPath = lineGroup.getClipPath(); - if (oldClipPath) { - var newClipPath = createLineClipPath(this, coordSys, false, seriesModel); - initProps(oldClipPath, { - shape: newClipPath.shape - }, seriesModel); - } else { - lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); - } - // Always update, or it is wrong in the case turning on legend - // because points are not changed. - showSymbol && symbolDraw.updateData(data, { - isIgnore: isIgnoreFunc, - clipShape: clipShapeForSymbol, - disableAnimation: true, - getSymbolPoint: function (idx) { - return [points[idx * 2], points[idx * 2 + 1]]; - } - }); - // In the case data zoom triggered refreshing frequently - // Data may not change if line has a category axis. So it should animate nothing. - if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) { - if (hasAnimation) { - this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls); - } else { - // Not do it in update with animation - if (step) { - // TODO If stacked series is not step - points = turnPointsIntoStep(points, coordSys, step, connectNulls); - if (stackedOnPoints) { - stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); - } - } - polyline.setShape({ - points: points - }); - polygon && polygon.setShape({ - points: points, - stackedOnPoints: stackedOnPoints - }); - } - } - } - var emphasisModel = seriesModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var emphasisDisabled = emphasisModel.get('disabled'); - polyline.useStyle(defaults( - // Use color in lineStyle first - lineStyleModel.getLineStyle(), { - fill: 'none', - stroke: visualColor, - lineJoin: 'bevel' - })); - setStatesStylesFromModel(polyline, seriesModel, 'lineStyle'); - if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') { - var emphasisLineStyle = polyline.getState('emphasis').style; - emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1; - } - // Needs seriesIndex for focus - getECData(polyline).seriesIndex = seriesModel.seriesIndex; - toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled); - var smooth = getSmooth(seriesModel.get('smooth')); - var smoothMonotone = seriesModel.get('smoothMonotone'); - polyline.setShape({ - smooth: smooth, - smoothMonotone: smoothMonotone, - connectNulls: connectNulls - }); - if (polygon) { - var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); - var stackedOnSmooth = 0; - polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { - fill: visualColor, - opacity: 0.7, - lineJoin: 'bevel', - decal: data.getVisual('style').decal - })); - if (stackedOnSeries) { - stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth')); - } - polygon.setShape({ - smooth: smooth, - stackedOnSmooth: stackedOnSmooth, - smoothMonotone: smoothMonotone, - connectNulls: connectNulls - }); - setStatesStylesFromModel(polygon, seriesModel, 'areaStyle'); - // Needs seriesIndex for focus - getECData(polygon).seriesIndex = seriesModel.seriesIndex; - toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled); - } - var changePolyState = function (toState) { - _this._changePolyState(toState); - }; - data.eachItemGraphicEl(function (el) { - // Switch polyline / polygon state if element changed its state. - el && (el.onHoverStateChange = changePolyState); - }); - this._polyline.onHoverStateChange = changePolyState; - this._data = data; - // Save the coordinate system for transition animation when data changed - this._coordSys = coordSys; - this._stackedOnPoints = stackedOnPoints; - this._points = points; - this._step = step; - this._valueOrigin = valueOrigin; - if (seriesModel.get('triggerLineEvent')) { - this.packEventData(seriesModel, polyline); - polygon && this.packEventData(seriesModel, polygon); - } - }; - LineView.prototype.packEventData = function (seriesModel, el) { - getECData(el).eventData = { - componentType: 'series', - componentSubType: 'line', - componentIndex: seriesModel.componentIndex, - seriesIndex: seriesModel.seriesIndex, - seriesName: seriesModel.name, - seriesType: 'line' - }; - }; - LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, payload); - this._changePolyState('emphasis'); - if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) { - var points = data.getLayout('points'); - var symbol = data.getItemGraphicEl(dataIndex); - if (!symbol) { - // Create a temporary symbol if it is not exists - var x = points[dataIndex * 2]; - var y = points[dataIndex * 2 + 1]; - if (isNaN(x) || isNaN(y)) { - // Null data - return; - } - // fix #11360: shouldn't draw symbol outside clipShapeForSymbol - if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) { - return; - } - var zlevel = seriesModel.get('zlevel') || 0; - var z = seriesModel.get('z') || 0; - symbol = new Symbol(data, dataIndex); - symbol.x = x; - symbol.y = y; - symbol.setZ(zlevel, z); - // ensure label text of the temporary symbol is in front of line and area polygon - var symbolLabel = symbol.getSymbolPath().getTextContent(); - if (symbolLabel) { - symbolLabel.zlevel = zlevel; - symbolLabel.z = z; - symbolLabel.z2 = this._polyline.z2 + 1; - } - symbol.__temp = true; - data.setItemGraphicEl(dataIndex, symbol); - // Stop scale animation - symbol.stopSymbolAnimation(true); - this.group.add(symbol); - } - symbol.highlight(); - } else { - // Highlight whole series - ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload); - } - }; - LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, payload); - this._changePolyState('normal'); - if (dataIndex != null && dataIndex >= 0) { - var symbol = data.getItemGraphicEl(dataIndex); - if (symbol) { - if (symbol.__temp) { - data.setItemGraphicEl(dataIndex, null); - this.group.remove(symbol); - } else { - symbol.downplay(); - } - } - } else { - // FIXME - // can not downplay completely. - // Downplay whole series - ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload); - } - }; - LineView.prototype._changePolyState = function (toState) { - var polygon = this._polygon; - setStatesFlag(this._polyline, toState); - polygon && setStatesFlag(polygon, toState); - }; - LineView.prototype._newPolyline = function (points) { - var polyline = this._polyline; - // Remove previous created polyline - if (polyline) { - this._lineGroup.remove(polyline); - } - polyline = new ECPolyline({ - shape: { - points: points - }, - segmentIgnoreThreshold: 2, - z2: 10 - }); - this._lineGroup.add(polyline); - this._polyline = polyline; - return polyline; - }; - LineView.prototype._newPolygon = function (points, stackedOnPoints) { - var polygon = this._polygon; - // Remove previous created polygon - if (polygon) { - this._lineGroup.remove(polygon); - } - polygon = new ECPolygon({ - shape: { - points: points, - stackedOnPoints: stackedOnPoints - }, - segmentIgnoreThreshold: 2 - }); - this._lineGroup.add(polygon); - this._polygon = polygon; - return polygon; - }; - LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) { - var isHorizontalOrRadial; - var isCoordSysPolar; - var baseAxis = coordSys.getBaseAxis(); - var isAxisInverse = baseAxis.inverse; - if (coordSys.type === 'cartesian2d') { - isHorizontalOrRadial = baseAxis.isHorizontal(); - isCoordSysPolar = false; - } else if (coordSys.type === 'polar') { - isHorizontalOrRadial = baseAxis.dim === 'angle'; - isCoordSysPolar = true; - } - var seriesModel = data.hostModel; - var seriesDuration = seriesModel.get('animationDuration'); - if (isFunction(seriesDuration)) { - seriesDuration = seriesDuration(null); - } - var seriesDelay = seriesModel.get('animationDelay') || 0; - var seriesDelayValue = isFunction(seriesDelay) ? seriesDelay(null) : seriesDelay; - data.eachItemGraphicEl(function (symbol, idx) { - var el = symbol; - if (el) { - var point = [symbol.x, symbol.y]; - var start = void 0; - var end = void 0; - var current = void 0; - if (clipShape) { - if (isCoordSysPolar) { - var polarClip = clipShape; - var coord = coordSys.pointToCoord(point); - if (isHorizontalOrRadial) { - start = polarClip.startAngle; - end = polarClip.endAngle; - current = -coord[1] / 180 * Math.PI; - } else { - start = polarClip.r0; - end = polarClip.r; - current = coord[0]; - } - } else { - var gridClip = clipShape; - if (isHorizontalOrRadial) { - start = gridClip.x; - end = gridClip.x + gridClip.width; - current = symbol.x; - } else { - start = gridClip.y + gridClip.height; - end = gridClip.y; - current = symbol.y; - } - } - } - var ratio = end === start ? 0 : (current - start) / (end - start); - if (isAxisInverse) { - ratio = 1 - ratio; - } - var delay = isFunction(seriesDelay) ? seriesDelay(idx) : seriesDuration * ratio + seriesDelayValue; - var symbolPath = el.getSymbolPath(); - var text = symbolPath.getTextContent(); - el.attr({ - scaleX: 0, - scaleY: 0 - }); - el.animateTo({ - scaleX: 1, - scaleY: 1 - }, { - duration: 200, - setToFinal: true, - delay: delay - }); - if (text) { - text.animateFrom({ - style: { - opacity: 0 - } - }, { - duration: 300, - delay: delay - }); - } - symbolPath.disableLabelAnimation = true; - } - }); - }; - LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) { - var endLabelModel = seriesModel.getModel('endLabel'); - if (anyStateShowEndLabel(seriesModel)) { - var data_2 = seriesModel.getData(); - var polyline = this._polyline; - // series may be filtered. - var points = data_2.getLayout('points'); - if (!points) { - polyline.removeTextContent(); - this._endLabel = null; - return; - } - var endLabel = this._endLabel; - if (!endLabel) { - endLabel = this._endLabel = new ZRText({ - z2: 200 // should be higher than item symbol - }); - - endLabel.ignoreClip = true; - polyline.setTextContent(this._endLabel); - polyline.disableLabelAnimation = true; - } - // Find last non-NaN data to display data - var dataIndex = getLastIndexNotNull(points); - if (dataIndex >= 0) { - setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), { - inheritColor: inheritColor, - labelFetcher: seriesModel, - labelDataIndex: dataIndex, - defaultText: function (dataIndex, opt, interpolatedValue) { - return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex); - }, - enableTextSetter: true - }, getEndLabelStateSpecified(endLabelModel, coordSys)); - polyline.textConfig.position = null; - } - } else if (this._endLabel) { - this._polyline.removeTextContent(); - this._endLabel = null; - } - }; - LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) { - var endLabel = this._endLabel; - var polyline = this._polyline; - if (endLabel) { - // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render. - // The label is not prepared at this time. - if (percent < 1 && animationRecord.originalX == null) { - animationRecord.originalX = endLabel.x; - animationRecord.originalY = endLabel.y; - } - var points = data.getLayout('points'); - var seriesModel = data.hostModel; - var connectNulls = seriesModel.get('connectNulls'); - var precision = endLabelModel.get('precision'); - var distance = endLabelModel.get('distance') || 0; - var baseAxis = coordSys.getBaseAxis(); - var isHorizontal = baseAxis.isHorizontal(); - var isBaseInversed = baseAxis.inverse; - var clipShape = clipRect.shape; - var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y; - var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1); - var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1); - var dim = isHorizontal ? 'x' : 'y'; - var dataIndexRange = getIndexRange(points, xOrY, dim); - var indices = dataIndexRange.range; - var diff = indices[1] - indices[0]; - var value = void 0; - if (diff >= 1) { - // diff > 1 && connectNulls, which is on the null data. - if (diff > 1 && !connectNulls) { - var pt = getPointAtIndex(points, indices[0]); - endLabel.attr({ - x: pt[0] + distanceX, - y: pt[1] + distanceY - }); - valueAnimation && (value = seriesModel.getRawValue(indices[0])); - } else { - var pt = polyline.getPointOn(xOrY, dim); - pt && endLabel.attr({ - x: pt[0] + distanceX, - y: pt[1] + distanceY - }); - var startValue = seriesModel.getRawValue(indices[0]); - var endValue = seriesModel.getRawValue(indices[1]); - valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t)); - } - animationRecord.lastFrameIndex = indices[0]; - } else { - // If diff <= 0, which is the range is not found(Include NaN) - // Choose the first point or last point. - var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0; - var pt = getPointAtIndex(points, idx); - valueAnimation && (value = seriesModel.getRawValue(idx)); - endLabel.attr({ - x: pt[0] + distanceX, - y: pt[1] + distanceY - }); - } - if (valueAnimation) { - var inner = labelInner(endLabel); - if (typeof inner.setLabelText === 'function') { - inner.setLabelText(value); - } - } - } - }; - /** - * @private - */ - // FIXME Two value axis - LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls) { - var polyline = this._polyline; - var polygon = this._polygon; - var seriesModel = data.hostModel; - var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin); - var current = diff.current; - var stackedOnCurrent = diff.stackedOnCurrent; - var next = diff.next; - var stackedOnNext = diff.stackedOnNext; - if (step) { - // TODO If stacked series is not step - current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls); - stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls); - next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls); - stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls); - } - // Don't apply animation if diff is large. - // For better result and avoid memory explosion problems like - // https://github.com/apache/incubator-echarts/issues/12229 - if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) { - polyline.stopAnimation(); - polyline.setShape({ - points: next - }); - if (polygon) { - polygon.stopAnimation(); - polygon.setShape({ - points: next, - stackedOnPoints: stackedOnNext - }); - } - return; - } - polyline.shape.__points = diff.current; - polyline.shape.points = current; - var target = { - shape: { - points: next - } - }; - // Also animate the original points. - // If points reference is changed when turning into step line. - if (diff.current !== current) { - target.shape.__points = diff.next; - } - // Stop previous animation. - polyline.stopAnimation(); - updateProps(polyline, target, seriesModel); - if (polygon) { - polygon.setShape({ - // Reuse the points with polyline. - points: current, - stackedOnPoints: stackedOnCurrent - }); - polygon.stopAnimation(); - updateProps(polygon, { - shape: { - stackedOnPoints: stackedOnNext - } - }, seriesModel); - // If use attr directly in updateProps. - if (polyline.shape.points !== polygon.shape.points) { - polygon.shape.points = polyline.shape.points; - } - } - var updatedDataInfo = []; - var diffStatus = diff.status; - for (var i = 0; i < diffStatus.length; i++) { - var cmd = diffStatus[i].cmd; - if (cmd === '=') { - var el = data.getItemGraphicEl(diffStatus[i].idx1); - if (el) { - updatedDataInfo.push({ - el: el, - ptIdx: i // Index of points - }); - } - } - } - - if (polyline.animators && polyline.animators.length) { - polyline.animators[0].during(function () { - polygon && polygon.dirtyShape(); - var points = polyline.shape.__points; - for (var i = 0; i < updatedDataInfo.length; i++) { - var el = updatedDataInfo[i].el; - var offset = updatedDataInfo[i].ptIdx * 2; - el.x = points[offset]; - el.y = points[offset + 1]; - el.markRedraw(); - } - }); - } - }; - LineView.prototype.remove = function (ecModel) { - var group = this.group; - var oldData = this._data; - this._lineGroup.removeAll(); - this._symbolDraw.remove(true); - // Remove temporary created elements when highlighting - oldData && oldData.eachItemGraphicEl(function (el, idx) { - if (el.__temp) { - group.remove(el); - oldData.setItemGraphicEl(idx, null); - } - }); - this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null; - }; - LineView.type = 'line'; - return LineView; - }(ChartView); - - function pointsLayout(seriesType, forceStoreInTypedArray) { - return { - seriesType: seriesType, - plan: createRenderPlanner(), - reset: function (seriesModel) { - var data = seriesModel.getData(); - var coordSys = seriesModel.coordinateSystem; - var pipelineContext = seriesModel.pipelineContext; - var useTypedArray = forceStoreInTypedArray || 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[0] = stackResultDim; - } - if (isDimensionStacked(data, dims[1])) { - dims[1] = stackResultDim; - } - var store = data.getStore(); - var dimIdx0 = data.getDimensionIndex(dims[0]); - var dimIdx1 = data.getDimensionIndex(dims[1]); - return dimLen && { - progress: function (params, data) { - var segCount = params.end - params.start; - var points = useTypedArray && createFloat32Array(segCount * dimLen); - var tmpIn = []; - var tmpOut = []; - for (var i = params.start, offset = 0; i < params.end; i++) { - var point = void 0; - if (dimLen === 1) { - var x = store.get(dimIdx0, i); - // NOTE: Make sure the second parameter is null to use default strategy. - point = coordSys.dataToPoint(x, null, tmpOut); - } else { - tmpIn[0] = store.get(dimIdx0, i); - tmpIn[1] = store.get(dimIdx1, i); - // Let coordinate system to handle the NaN data. - point = coordSys.dataToPoint(tmpIn, null, tmpOut); - } - if (useTypedArray) { - points[offset++] = point[0]; - points[offset++] = point[1]; - } else { - data.setItemLayout(i, point.slice()); - } - } - useTypedArray && data.setLayout('points', points); - } - }; - } - }; - } - - var samplers = { - average: function (frame) { - var sum = 0; - var count = 0; - for (var i = 0; i < frame.length; i++) { - if (!isNaN(frame[i])) { - sum += frame[i]; - count++; - } - } - // Return NaN if count is 0 - return count === 0 ? NaN : sum / count; - }, - sum: function (frame) { - var sum = 0; - for (var i = 0; i < frame.length; i++) { - // Ignore NaN - sum += frame[i] || 0; - } - return sum; - }, - max: function (frame) { - var max = -Infinity; - for (var i = 0; i < frame.length; i++) { - frame[i] > max && (max = frame[i]); - } - // NaN will cause illegal axis extent. - return isFinite(max) ? max : NaN; - }, - min: function (frame) { - var min = Infinity; - for (var i = 0; i < frame.length; i++) { - frame[i] < min && (min = frame[i]); - } - // NaN will cause illegal axis extent. - return isFinite(min) ? min : NaN; - }, - minmax: function (frame) { - var turningPointAbsoluteValue = -Infinity; - var turningPointOriginalValue = -Infinity; - for (var i = 0; i < frame.length; i++) { - var originalValue = frame[i]; - var absoluteValue = Math.abs(originalValue); - if (absoluteValue > turningPointAbsoluteValue) { - turningPointAbsoluteValue = absoluteValue; - turningPointOriginalValue = originalValue; - } - } - return isFinite(turningPointOriginalValue) ? turningPointOriginalValue : NaN; - }, - // TODO - // Median - nearest: function (frame) { - return frame[0]; - } - }; - var indexSampler = function (frame) { - return Math.round(frame.length / 2); - }; - function dataSample(seriesType) { - return { - seriesType: seriesType, - // FIXME:TS never used, so comment it - // modifyOutputEnd: true, - reset: function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var sampling = seriesModel.get('sampling'); - var coordSys = seriesModel.coordinateSystem; - var count = data.count(); - // Only cartesian2d support down sampling. Disable it when there is few data. - if (count > 10 && coordSys.type === 'cartesian2d' && sampling) { - var baseAxis = coordSys.getBaseAxis(); - var valueAxis = coordSys.getOtherAxis(baseAxis); - var extent = baseAxis.getExtent(); - var dpr = api.getDevicePixelRatio(); - // Coordinste system has been resized - var size = Math.abs(extent[1] - extent[0]) * (dpr || 1); - var rate = Math.round(count / size); - if (isFinite(rate) && rate > 1) { - if (sampling === 'lttb') { - seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate)); - } - var sampler = void 0; - if (isString(sampling)) { - sampler = samplers[sampling]; - } else if (isFunction(sampling)) { - sampler = sampling; - } - if (sampler) { - // Only support sample the first dim mapped from value axis. - seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler)); - } - } - } - } - }; - } - - function install$2(registers) { - registers.registerChartView(LineView); - registers.registerSeriesModel(LineSeriesModel); - registers.registerLayout(pointsLayout('line', true)); - registers.registerVisual({ - seriesType: 'line', - reset: function (seriesModel) { - var data = seriesModel.getData(); - // Visual coding for legend - var lineStyle = seriesModel.getModel('lineStyle').getLineStyle(); - if (lineStyle && !lineStyle.stroke) { - // Fill in visual should be palette color if - // has color callback - lineStyle.stroke = data.getVisual('style').fill; - } - data.setVisual('legendLineStyle', lineStyle); - } - }); - // Down sample after filter - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line')); - } - - var BaseBarSeriesModel = /** @class */function (_super) { - __extends(BaseBarSeriesModel, _super); - function BaseBarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BaseBarSeriesModel.type; - return _this; - } - BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; - BaseBarSeriesModel.prototype.getMarkerPosition = function (value, dims, startingAtTick) { - var coordSys = this.coordinateSystem; - if (coordSys && coordSys.clampData) { - // PENDING if clamp ? - var clampData_1 = coordSys.clampData(value); - var pt_1 = coordSys.dataToPoint(clampData_1); - if (startingAtTick) { - each(coordSys.getAxes(), function (axis, idx) { - // If axis type is category, use tick coords instead - if (axis.type === 'category' && dims != null) { - var tickCoords = axis.getTicksCoords(); - var alignTicksWithLabel = axis.getTickModel().get('alignWithLabel'); - var targetTickId = clampData_1[idx]; - // The index of rightmost tick of markArea is 1 larger than x1/y1 index - var isEnd = dims[idx] === 'x1' || dims[idx] === 'y1'; - if (isEnd && !alignTicksWithLabel) { - targetTickId += 1; - } - // The only contains one tick, tickCoords is - // like [{coord: 0, tickValue: 0}, {coord: 0}] - // to the length should always be larger than 1 - if (tickCoords.length < 2) { - return; - } else if (tickCoords.length === 2) { - // The left value and right value of the axis are - // the same. coord is 0 in both items. Use the max - // value of the axis as the coord - pt_1[idx] = axis.toGlobalCoord(axis.getExtent()[isEnd ? 1 : 0]); - return; - } - var leftCoord = void 0; - var coord = void 0; - var stepTickValue = 1; - for (var i = 0; i < tickCoords.length; i++) { - var tickCoord = tickCoords[i].coord; - // The last item of tickCoords doesn't contain - // tickValue - var tickValue = i === tickCoords.length - 1 ? tickCoords[i - 1].tickValue + stepTickValue : tickCoords[i].tickValue; - if (tickValue === targetTickId) { - coord = tickCoord; - break; - } else if (tickValue < targetTickId) { - leftCoord = tickCoord; - } else if (leftCoord != null && tickValue > targetTickId) { - coord = (tickCoord + leftCoord) / 2; - break; - } - if (i === 1) { - // Here we assume the step of category axes is - // the same - stepTickValue = tickValue - tickCoords[0].tickValue; - } - } - if (coord == null) { - if (!leftCoord) { - // targetTickId is smaller than all tick ids in the - // visible area, use the leftmost tick coord - coord = tickCoords[0].coord; - } else if (leftCoord) { - // targetTickId is larger than all tick ids in the - // visible area, use the rightmost tick coord - coord = tickCoords[tickCoords.length - 1].coord; - } - } - pt_1[idx] = axis.toGlobalCoord(coord); - } - }); - } else { - var data = this.getData(); - var offset = data.getLayout('offset'); - var size = data.getLayout('size'); - var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1; - pt_1[offsetIndex] += offset + size / 2; - } - return pt_1; - } - return [NaN, NaN]; - }; - BaseBarSeriesModel.type = 'series.__base_bar__'; - BaseBarSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - // stack: null - // Cartesian coordinate system - // xAxisIndex: 0, - // yAxisIndex: 0, - barMinHeight: 0, - barMinAngle: 0, - // cursor: null, - large: false, - largeThreshold: 400, - progressive: 3e3, - progressiveChunkMode: 'mod' - }; - return BaseBarSeriesModel; - }(SeriesModel); - SeriesModel.registerClass(BaseBarSeriesModel); - - var BarSeriesModel = /** @class */function (_super) { - __extends(BarSeriesModel, _super); - function BarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BarSeriesModel.type; - return _this; - } - BarSeriesModel.prototype.getInitialData = function () { - return createSeriesData(null, this, { - useEncodeDefaulter: true, - createInvertedIndices: !!this.get('realtimeSort', true) || null - }); - }; - /** - * @override - */ - BarSeriesModel.prototype.getProgressive = function () { - // Do not support progressive in normal mode. - return this.get('large') ? this.get('progressive') : false; - }; - /** - * @override - */ - BarSeriesModel.prototype.getProgressiveThreshold = function () { - // Do not support progressive in normal mode. - var progressiveThreshold = this.get('progressiveThreshold'); - var largeThreshold = this.get('largeThreshold'); - if (largeThreshold > progressiveThreshold) { - progressiveThreshold = largeThreshold; - } - return progressiveThreshold; - }; - BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - return selectors.rect(data.getItemLayout(dataIndex)); - }; - BarSeriesModel.type = 'series.bar'; - BarSeriesModel.dependencies = ['grid', 'polar']; - BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, { - // If clipped - // Only available on cartesian2d - clip: true, - roundCap: false, - showBackground: false, - backgroundStyle: { - color: 'rgba(180, 180, 180, 0.2)', - borderColor: null, - borderWidth: 0, - borderType: 'solid', - borderRadius: 0, - shadowBlur: 0, - shadowColor: null, - shadowOffsetX: 0, - shadowOffsetY: 0, - opacity: 1 - }, - select: { - itemStyle: { - borderColor: '#212121' - } - }, - realtimeSort: false - }); - return BarSeriesModel; - }(BaseBarSeriesModel); - - /** - * Sausage: similar to sector, but have half circle on both sides - */ - var SausageShape = /** @class */function () { - function SausageShape() { - this.cx = 0; - this.cy = 0; - this.r0 = 0; - this.r = 0; - this.startAngle = 0; - this.endAngle = Math.PI * 2; - this.clockwise = true; - } - return SausageShape; - }(); - var SausagePath = /** @class */function (_super) { - __extends(SausagePath, _super); - function SausagePath(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'sausage'; - return _this; - } - SausagePath.prototype.getDefaultShape = function () { - return new SausageShape(); - }; - SausagePath.prototype.buildPath = function (ctx, shape) { - var cx = shape.cx; - var cy = shape.cy; - var r0 = Math.max(shape.r0 || 0, 0); - var r = Math.max(shape.r, 0); - var dr = (r - r0) * 0.5; - var rCenter = r0 + dr; - var startAngle = shape.startAngle; - var endAngle = shape.endAngle; - var clockwise = shape.clockwise; - var PI2 = Math.PI * 2; - var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2; - if (!lessThanCircle) { - // Normalize angles - startAngle = endAngle - (clockwise ? PI2 : -PI2); - } - var unitStartX = Math.cos(startAngle); - var unitStartY = Math.sin(startAngle); - var unitEndX = Math.cos(endAngle); - var unitEndY = Math.sin(endAngle); - if (lessThanCircle) { - ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy); - ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise); - } else { - ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy); - } - ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise); - ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise); - if (r0 !== 0) { - ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise); - } - // ctx.closePath(); - }; - - return SausagePath; - }(Path); - - function createSectorCalculateTextPosition(positionMapping, opts) { - opts = opts || {}; - var isRoundCap = opts.isRoundCap; - return function (out, opts, boundingRect) { - var textPosition = opts.position; - if (!textPosition || textPosition instanceof Array) { - return calculateTextPosition(out, opts, boundingRect); - } - var mappedSectorPosition = positionMapping(textPosition); - var distance = opts.distance != null ? opts.distance : 5; - var sector = this.shape; - var cx = sector.cx; - var cy = sector.cy; - var r = sector.r; - var r0 = sector.r0; - var middleR = (r + r0) / 2; - var startAngle = sector.startAngle; - var endAngle = sector.endAngle; - var middleAngle = (startAngle + endAngle) / 2; - var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0; - var mathCos = Math.cos; - var mathSin = Math.sin; - // base position: top-left - var x = cx + r * mathCos(startAngle); - var y = cy + r * mathSin(startAngle); - var textAlign = 'left'; - var textVerticalAlign = 'top'; - switch (mappedSectorPosition) { - case 'startArc': - x = cx + (r0 - distance) * mathCos(middleAngle); - y = cy + (r0 - distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'top'; - break; - case 'insideStartArc': - x = cx + (r0 + distance) * mathCos(middleAngle); - y = cy + (r0 + distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'bottom'; - break; - case 'startAngle': - x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, distance + extraDist, false); - y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, distance + extraDist, false); - textAlign = 'right'; - textVerticalAlign = 'middle'; - break; - case 'insideStartAngle': - x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, -distance + extraDist, false); - y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, -distance + extraDist, false); - textAlign = 'left'; - textVerticalAlign = 'middle'; - break; - case 'middle': - x = cx + middleR * mathCos(middleAngle); - y = cy + middleR * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'middle'; - break; - case 'endArc': - x = cx + (r + distance) * mathCos(middleAngle); - y = cy + (r + distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'bottom'; - break; - case 'insideEndArc': - x = cx + (r - distance) * mathCos(middleAngle); - y = cy + (r - distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'top'; - break; - case 'endAngle': - x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, distance + extraDist, true); - y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, distance + extraDist, true); - textAlign = 'left'; - textVerticalAlign = 'middle'; - break; - case 'insideEndAngle': - x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, -distance + extraDist, true); - y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, -distance + extraDist, true); - textAlign = 'right'; - textVerticalAlign = 'middle'; - break; - default: - return calculateTextPosition(out, opts, boundingRect); - } - out = out || {}; - out.x = x; - out.y = y; - out.align = textAlign; - out.verticalAlign = textVerticalAlign; - return out; - }; - } - function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) { - if (isNumber(rotateType)) { - // user-set rotation - sector.setTextConfig({ - rotation: rotateType - }); - return; - } else if (isArray(textPosition)) { - // user-set position, use 0 as auto rotation - sector.setTextConfig({ - rotation: 0 - }); - return; - } - var shape = sector.shape; - var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle; - var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle; - var middleAngle = (startAngle + endAngle) / 2; - var anchorAngle; - var mappedSectorPosition = positionMapping(textPosition); - switch (mappedSectorPosition) { - case 'startArc': - case 'insideStartArc': - case 'middle': - case 'insideEndArc': - case 'endArc': - anchorAngle = middleAngle; - break; - case 'startAngle': - case 'insideStartAngle': - anchorAngle = startAngle; - break; - case 'endAngle': - case 'insideEndAngle': - anchorAngle = endAngle; - break; - default: - sector.setTextConfig({ - rotation: 0 - }); - return; - } - var rotate = Math.PI * 1.5 - anchorAngle; - /** - * TODO: labels with rotate > Math.PI / 2 should be rotate another - * half round flipped to increase readability. However, only middle - * position supports this for now, because in other positions, the - * anchor point is not at the center of the text, so the positions - * after rotating is not as expected. - */ - if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) { - rotate -= Math.PI; - } - sector.setTextConfig({ - rotation: rotate - }); - } - function adjustAngleDistanceX(angle, distance, isEnd) { - return distance * Math.sin(angle) * (isEnd ? -1 : 1); - } - function adjustAngleDistanceY(angle, distance, isEnd) { - return distance * Math.cos(angle) * (isEnd ? 1 : -1); - } - - function getSectorCornerRadius(model, shape, zeroIfNull) { - var cornerRadius = model.get('borderRadius'); - if (cornerRadius == null) { - return zeroIfNull ? { - cornerRadius: 0 - } : null; - } - if (!isArray(cornerRadius)) { - cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius]; - } - var dr = Math.abs(shape.r || 0 - shape.r0 || 0); - return { - cornerRadius: map(cornerRadius, function (cr) { - return parsePercent(cr, dr); - }) - }; - } - - var mathMax$6 = Math.max; - var mathMin$6 = Math.min; - function getClipArea(coord, data) { - var coordSysClipArea = coord.getArea && coord.getArea(); - if (isCoordinateSystemType(coord, 'cartesian2d')) { - var baseAxis = coord.getBaseAxis(); - // When boundaryGap is false or using time axis. bar may exceed the grid. - // We should not clip this part. - // See test/bar2.html - if (baseAxis.type !== 'category' || !baseAxis.onBand) { - var expandWidth = data.getLayout('bandWidth'); - if (baseAxis.isHorizontal()) { - coordSysClipArea.x -= expandWidth; - coordSysClipArea.width += expandWidth * 2; - } else { - coordSysClipArea.y -= expandWidth; - coordSysClipArea.height += expandWidth * 2; - } - } - } - return coordSysClipArea; - } - var BarView = /** @class */function (_super) { - __extends(BarView, _super); - function BarView() { - var _this = _super.call(this) || this; - _this.type = BarView.type; - _this._isFirstFrame = true; - return _this; - } - BarView.prototype.render = function (seriesModel, ecModel, api, payload) { - this._model = seriesModel; - this._removeOnRenderedListener(api); - this._updateDrawMode(seriesModel); - var coordinateSystemType = seriesModel.get('coordinateSystem'); - if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') { - // Clear previously rendered progressive elements. - this._progressiveEls = null; - this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload); - } else if ("development" !== 'production') { - warn('Only cartesian2d and polar supported for bar.'); - } - }; - BarView.prototype.incrementalPrepareRender = function (seriesModel) { - this._clear(); - this._updateDrawMode(seriesModel); - // incremental also need to clip, otherwise might be overlow. - // But must not set clip in each frame, otherwise all of the children will be marked redraw. - this._updateLargeClip(seriesModel); - }; - BarView.prototype.incrementalRender = function (params, seriesModel) { - // Reset - this._progressiveEls = []; - // Do not support progressive in normal mode. - this._incrementalRenderLarge(params, seriesModel); - }; - BarView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; - BarView.prototype._updateDrawMode = function (seriesModel) { - var isLargeDraw = seriesModel.pipelineContext.large; - if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { - this._isLargeDraw = isLargeDraw; - this._clear(); - } - }; - BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) { - var group = this.group; - var data = seriesModel.getData(); - var oldData = this._data; - var coord = seriesModel.coordinateSystem; - var baseAxis = coord.getBaseAxis(); - var isHorizontalOrRadial; - if (coord.type === 'cartesian2d') { - isHorizontalOrRadial = baseAxis.isHorizontal(); - } else if (coord.type === 'polar') { - isHorizontalOrRadial = baseAxis.dim === 'angle'; - } - var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null; - var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord); - if (realtimeSortCfg) { - this._enableRealtimeSort(realtimeSortCfg, data, api); - } - var needsClip = seriesModel.get('clip', true) || realtimeSortCfg; - var coordSysClipArea = getClipArea(coord, data); - // If there is clipPath created in large mode. Remove it. - group.removeClipPath(); - // We don't use clipPath in normal mode because we needs a perfect animation - // And don't want the label are clipped. - var roundCap = seriesModel.get('roundCap', true); - var drawBackground = seriesModel.get('showBackground', true); - var backgroundModel = seriesModel.getModel('backgroundStyle'); - var barBorderRadius = backgroundModel.get('borderRadius') || 0; - var bgEls = []; - var oldBgEls = this._backgroundEls; - var isInitSort = payload && payload.isInitSort; - var isChangeOrder = payload && payload.type === 'changeAxisOrder'; - function createBackground(dataIndex) { - var bgLayout = getLayout[coord.type](data, dataIndex); - var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout); - bgEl.useStyle(backgroundModel.getItemStyle()); - // Only cartesian2d support borderRadius. - if (coord.type === 'cartesian2d') { - bgEl.setShape('r', barBorderRadius); - } else { - bgEl.setShape('cornerRadius', barBorderRadius); - } - bgEls[dataIndex] = bgEl; - return bgEl; - } - data.diff(oldData).add(function (dataIndex) { - var itemModel = data.getItemModel(dataIndex); - var layout = getLayout[coord.type](data, dataIndex, itemModel); - if (drawBackground) { - createBackground(dataIndex); - } - // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy". - if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) { - return; - } - var isClipped = false; - if (needsClip) { - // Clip will modify the layout params. - // And return a boolean to determine if the shape are fully clipped. - isClipped = clip[coord.type](coordSysClipArea, layout); - } - var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap); - if (realtimeSortCfg) { - /** - * Force label animation because even if the element is - * ignored because it's clipped, it may not be clipped after - * changing order. Then, if not using forceLabelAnimation, - * the label animation was never started, in which case, - * the label will be the final value and doesn't have label - * animation. - */ - el.forceLabelAnimation = true; - } - updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar'); - if (isInitSort) { - el.attr({ - shape: layout - }); - } else if (realtimeSortCfg) { - updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false); - } else { - initProps(el, { - shape: layout - }, seriesModel, dataIndex); - } - data.setItemGraphicEl(dataIndex, el); - group.add(el); - el.ignore = isClipped; - }).update(function (newIndex, oldIndex) { - var itemModel = data.getItemModel(newIndex); - var layout = getLayout[coord.type](data, newIndex, itemModel); - if (drawBackground) { - var bgEl = void 0; - if (oldBgEls.length === 0) { - bgEl = createBackground(oldIndex); - } else { - bgEl = oldBgEls[oldIndex]; - bgEl.useStyle(backgroundModel.getItemStyle()); - // Only cartesian2d support borderRadius. - if (coord.type === 'cartesian2d') { - bgEl.setShape('r', barBorderRadius); - } else { - bgEl.setShape('cornerRadius', barBorderRadius); - } - bgEls[newIndex] = bgEl; - } - var bgLayout = getLayout[coord.type](data, newIndex); - var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord); - updateProps(bgEl, { - shape: shape - }, animationModel, newIndex); - } - var el = oldData.getItemGraphicEl(oldIndex); - if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) { - group.remove(el); - return; - } - var isClipped = false; - if (needsClip) { - isClipped = clip[coord.type](coordSysClipArea, layout); - if (isClipped) { - group.remove(el); - } - } - if (!el) { - el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap); - } else { - saveOldStyle(el); - } - if (realtimeSortCfg) { - el.forceLabelAnimation = true; - } - if (isChangeOrder) { - var textEl = el.getTextContent(); - if (textEl) { - var labelInnerStore = labelInner(textEl); - if (labelInnerStore.prevValue != null) { - /** - * Set preValue to be value so that no new label - * should be started, otherwise, it will take a full - * `animationDurationUpdate` time to finish the - * animation, which is not expected. - */ - labelInnerStore.prevValue = labelInnerStore.value; - } - } - } - // Not change anything if only order changed. - // Especially not change label. - else { - updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar'); - } - if (isInitSort) { - el.attr({ - shape: layout - }); - } else if (realtimeSortCfg) { - updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder); - } else { - updateProps(el, { - shape: layout - }, seriesModel, newIndex, null); - } - data.setItemGraphicEl(newIndex, el); - el.ignore = isClipped; - group.add(el); - }).remove(function (dataIndex) { - var el = oldData.getItemGraphicEl(dataIndex); - el && removeElementWithFadeOut(el, seriesModel, dataIndex); - }).execute(); - var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group()); - bgGroup.removeAll(); - for (var i = 0; i < bgEls.length; ++i) { - bgGroup.add(bgEls[i]); - } - group.add(bgGroup); - this._backgroundEls = bgEls; - this._data = data; - }; - BarView.prototype._renderLarge = function (seriesModel, ecModel, api) { - this._clear(); - createLarge(seriesModel, this.group); - this._updateLargeClip(seriesModel); - }; - BarView.prototype._incrementalRenderLarge = function (params, seriesModel) { - this._removeBackground(); - createLarge(seriesModel, this.group, this._progressiveEls, true); - }; - BarView.prototype._updateLargeClip = function (seriesModel) { - // Use clipPath in large mode. - var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); - var group = this.group; - if (clipPath) { - group.setClipPath(clipPath); - } else { - group.removeClipPath(); - } - }; - BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) { - var _this = this; - // If no data in the first frame, wait for data to initSort - if (!data.count()) { - return; - } - var baseAxis = realtimeSortCfg.baseAxis; - if (this._isFirstFrame) { - this._dispatchInitSort(data, realtimeSortCfg, api); - this._isFirstFrame = false; - } else { - var orderMapping_1 = function (idx) { - var el = data.getItemGraphicEl(idx); - var shape = el && el.shape; - return shape && - // The result should be consistent with the initial sort by data value. - // Do not support the case that both positive and negative exist. - Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width) - // If data is NaN, shape.xxx may be NaN, so use || 0 here in case - || 0; - }; - this._onRendered = function () { - _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api); - }; - api.getZr().on('rendered', this._onRendered); - } - }; - BarView.prototype._dataSort = function (data, baseAxis, orderMapping) { - var info = []; - data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) { - var mappedValue = orderMapping(dataIdx); - mappedValue = mappedValue == null ? NaN : mappedValue; - info.push({ - dataIndex: dataIdx, - mappedValue: mappedValue, - ordinalNumber: ordinalNumber - }); - }); - info.sort(function (a, b) { - // If NaN, it will be treated as min val. - return b.mappedValue - a.mappedValue; - }); - return { - ordinalNumbers: map(info, function (item) { - return item.ordinalNumber; - }) - }; - }; - BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) { - var scale = baseAxis.scale; - var ordinalDataDim = data.mapDimension(baseAxis.dim); - var lastValue = Number.MAX_VALUE; - for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) { - var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum)); - var value = rawIdx < 0 - // If some tick have no bar, the tick will be treated as min. - ? Number.MIN_VALUE - // PENDING: if dataZoom on baseAxis exits, is it a performance issue? - : orderMapping(data.indexOfRawIndex(rawIdx)); - if (value > lastValue) { - return true; - } - lastValue = value; - } - return false; - }; - /* - * Consider the case when A and B changed order, whose representing - * bars are both out of sight, we don't wish to trigger reorder action - * as long as the order in the view doesn't change. - */ - BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) { - var scale = baseAxis.scale; - var extent = scale.getExtent(); - var tickNum = Math.max(0, extent[0]); - var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1); - for (; tickNum <= tickMax; ++tickNum) { - if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) { - return true; - } - } - }; - BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) { - if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) { - return; - } - var sortInfo = this._dataSort(data, baseAxis, orderMapping); - if (this._isOrderDifferentInView(sortInfo, baseAxis)) { - this._removeOnRenderedListener(api); - api.dispatchAction({ - type: 'changeAxisOrder', - componentType: baseAxis.dim + 'Axis', - axisId: baseAxis.index, - sortInfo: sortInfo - }); - } - }; - BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) { - var baseAxis = realtimeSortCfg.baseAxis; - var sortResult = this._dataSort(data, baseAxis, function (dataIdx) { - return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx); - }); - api.dispatchAction({ - type: 'changeAxisOrder', - componentType: baseAxis.dim + 'Axis', - isInitSort: true, - axisId: baseAxis.index, - sortInfo: sortResult - }); - }; - BarView.prototype.remove = function (ecModel, api) { - this._clear(this._model); - this._removeOnRenderedListener(api); - }; - BarView.prototype.dispose = function (ecModel, api) { - this._removeOnRenderedListener(api); - }; - BarView.prototype._removeOnRenderedListener = function (api) { - if (this._onRendered) { - api.getZr().off('rendered', this._onRendered); - this._onRendered = null; - } - }; - BarView.prototype._clear = function (model) { - var group = this.group; - var data = this._data; - if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) { - this._removeBackground(); - this._backgroundEls = []; - data.eachItemGraphicEl(function (el) { - removeElementWithFadeOut(el, model, getECData(el).dataIndex); - }); - } else { - group.removeAll(); - } - this._data = null; - this._isFirstFrame = true; - }; - BarView.prototype._removeBackground = function () { - this.group.remove(this._backgroundGroup); - this._backgroundGroup = null; - }; - BarView.type = 'bar'; - return BarView; - }(ChartView); - var clip = { - cartesian2d: function (coordSysBoundingRect, layout) { - var signWidth = layout.width < 0 ? -1 : 1; - var signHeight = layout.height < 0 ? -1 : 1; - // Needs positive width and height - if (signWidth < 0) { - layout.x += layout.width; - layout.width = -layout.width; - } - if (signHeight < 0) { - layout.y += layout.height; - layout.height = -layout.height; - } - var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width; - var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height; - var x = mathMax$6(layout.x, coordSysBoundingRect.x); - var x2 = mathMin$6(layout.x + layout.width, coordSysX2); - var y = mathMax$6(layout.y, coordSysBoundingRect.y); - var y2 = mathMin$6(layout.y + layout.height, coordSysY2); - var xClipped = x2 < x; - var yClipped = y2 < y; - // When xClipped or yClipped, the element will be marked as `ignore`. - // But we should also place the element at the edge of the coord sys bounding rect. - // Because if data changed and the bar shows again, its transition animation - // will begin at this place. - layout.x = xClipped && x > coordSysX2 ? x2 : x; - layout.y = yClipped && y > coordSysY2 ? y2 : y; - layout.width = xClipped ? 0 : x2 - x; - layout.height = yClipped ? 0 : y2 - y; - // Reverse back - if (signWidth < 0) { - layout.x += layout.width; - layout.width = -layout.width; - } - if (signHeight < 0) { - layout.y += layout.height; - layout.height = -layout.height; - } - return xClipped || yClipped; - }, - polar: function (coordSysClipArea, layout) { - var signR = layout.r0 <= layout.r ? 1 : -1; - // Make sure r is larger than r0 - if (signR < 0) { - var tmp = layout.r; - layout.r = layout.r0; - layout.r0 = tmp; - } - var r = mathMin$6(layout.r, coordSysClipArea.r); - var r0 = mathMax$6(layout.r0, coordSysClipArea.r0); - layout.r = r; - layout.r0 = r0; - var clipped = r - r0 < 0; - // Reverse back - if (signR < 0) { - var tmp = layout.r; - layout.r = layout.r0; - layout.r0 = tmp; - } - return clipped; - } - }; - var elementCreator = { - cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) { - var rect = new Rect({ - shape: extend({}, layout), - z2: 1 - }); - rect.__dataIndex = newIndex; - rect.name = 'item'; - if (animationModel) { - var rectShape = rect.shape; - var animateProperty = isHorizontal ? 'height' : 'width'; - rectShape[animateProperty] = 0; - } - return rect; - }, - polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) { - var ShapeClass = !isRadial && roundCap ? SausagePath : Sector; - var sector = new ShapeClass({ - shape: layout, - z2: 1 - }); - sector.name = 'item'; - var positionMap = createPolarPositionMapping(isRadial); - sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, { - isRoundCap: ShapeClass === SausagePath - }); - // Animation - if (animationModel) { - var sectorShape = sector.shape; - var animateProperty = isRadial ? 'r' : 'endAngle'; - var animateTarget = {}; - sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle; - animateTarget[animateProperty] = layout[animateProperty]; - (isUpdate ? updateProps : initProps)(sector, { - shape: animateTarget - // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue - }, animationModel); - } - return sector; - } - }; - function shouldRealtimeSort(seriesModel, coordSys) { - var realtimeSortOption = seriesModel.get('realtimeSort', true); - var baseAxis = coordSys.getBaseAxis(); - if ("development" !== 'production') { - if (realtimeSortOption) { - if (baseAxis.type !== 'category') { - warn('`realtimeSort` will not work because this bar series is not based on a category axis.'); - } - if (coordSys.type !== 'cartesian2d') { - warn('`realtimeSort` will not work because this bar series is not on cartesian2d.'); - } - } - } - if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') { - return { - baseAxis: baseAxis, - otherAxis: coordSys.getOtherAxis(baseAxis) - }; - } - } - function updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) { - var seriesTarget; - var axisTarget; - if (isHorizontal) { - axisTarget = { - x: layout.x, - width: layout.width - }; - seriesTarget = { - y: layout.y, - height: layout.height - }; - } else { - axisTarget = { - y: layout.y, - height: layout.height - }; - seriesTarget = { - x: layout.x, - width: layout.width - }; - } - if (!isChangeOrder) { - // Keep the original growth animation if only axis order changed. - // Not start a new animation. - (isUpdate ? updateProps : initProps)(el, { - shape: seriesTarget - }, seriesAnimationModel, newIndex, null); - } - var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null; - (isUpdate ? updateProps : initProps)(el, { - shape: axisTarget - }, axisAnimationModel, newIndex); - } - function checkPropertiesNotValid(obj, props) { - for (var i = 0; i < props.length; i++) { - if (!isFinite(obj[props[i]])) { - return true; - } - } - return false; - } - var rectPropties = ['x', 'y', 'width', 'height']; - var polarPropties = ['cx', 'cy', 'r', 'startAngle', 'endAngle']; - var isValidLayout = { - cartesian2d: function (layout) { - return !checkPropertiesNotValid(layout, rectPropties); - }, - polar: function (layout) { - return !checkPropertiesNotValid(layout, polarPropties); - } - }; - var getLayout = { - // itemModel is only used to get borderWidth, which is not needed - // when calculating bar background layout. - cartesian2d: function (data, dataIndex, itemModel) { - var layout = data.getItemLayout(dataIndex); - var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; - // fix layout with lineWidth - var signX = layout.width > 0 ? 1 : -1; - var signY = layout.height > 0 ? 1 : -1; - return { - x: layout.x + signX * fixedLineWidth / 2, - y: layout.y + signY * fixedLineWidth / 2, - width: layout.width - signX * fixedLineWidth, - height: layout.height - signY * fixedLineWidth - }; - }, - polar: function (data, dataIndex, itemModel) { - var layout = data.getItemLayout(dataIndex); - return { - cx: layout.cx, - cy: layout.cy, - r0: layout.r0, - r: layout.r, - startAngle: layout.startAngle, - endAngle: layout.endAngle, - clockwise: layout.clockwise - }; - } - }; - function isZeroOnPolar(layout) { - return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle; - } - function createPolarPositionMapping(isRadial) { - return function (isRadial) { - var arcOrAngle = isRadial ? 'Arc' : 'Angle'; - return function (position) { - switch (position) { - case 'start': - case 'insideStart': - case 'end': - case 'insideEnd': - return position + arcOrAngle; - default: - return position; - } - }; - }(isRadial); - } - function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, isPolar) { - var style = data.getItemVisual(dataIndex, 'style'); - if (!isPolar) { - var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0; - el.setShape('r', borderRadius); - } else if (!seriesModel.get('roundCap')) { - var sectorShape = el.shape; - var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true); - extend(sectorShape, cornerRadius); - el.setShape(sectorShape); - } - el.useStyle(style); - var cursorStyle = itemModel.getShallow('cursor'); - cursorStyle && el.attr('cursor', cursorStyle); - var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout.r >= layout.r0 ? 'endArc' : 'startArc' : layout.endAngle >= layout.startAngle ? 'endAngle' : 'startAngle' : isHorizontalOrRadial ? layout.height >= 0 ? 'bottom' : 'top' : layout.width >= 0 ? 'right' : 'left'; - var labelStatesModels = getLabelStatesModels(itemModel); - setLabelStyle(el, labelStatesModels, { - labelFetcher: seriesModel, - labelDataIndex: dataIndex, - defaultText: getDefaultLabel(seriesModel.getData(), dataIndex), - inheritColor: style.fill, - defaultOpacity: style.opacity, - defaultOutsidePosition: labelPositionOutside - }); - var label = el.getTextContent(); - if (isPolar && label) { - var position = itemModel.get(['label', 'position']); - el.textConfig.inside = position === 'middle' ? true : null; - setSectorTextRotation(el, position === 'outside' ? labelPositionOutside : position, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(['label', 'rotate'])); - } - setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { - return getDefaultInterpolatedLabel(data, value); - }); - var emphasisModel = itemModel.getModel(['emphasis']); - toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - setStatesStylesFromModel(el, itemModel); - if (isZeroOnPolar(layout)) { - el.style.fill = 'none'; - el.style.stroke = 'none'; - each(el.states, function (state) { - if (state.style) { - state.style.fill = state.style.stroke = 'none'; - } - }); - } - } - // In case width or height are too small. - function getLineWidth(itemModel, rawLayout) { - // Has no border. - var borderColor = itemModel.get(['itemStyle', 'borderColor']); - if (!borderColor || borderColor === 'none') { - return 0; - } - var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0; - // width or height may be NaN for empty data - var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width); - var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height); - return Math.min(lineWidth, width, height); - } - var LagePathShape = /** @class */function () { - function LagePathShape() {} - return LagePathShape; - }(); - var LargePath = /** @class */function (_super) { - __extends(LargePath, _super); - function LargePath(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'largeBar'; - return _this; - } - LargePath.prototype.getDefaultShape = function () { - return new LagePathShape(); - }; - LargePath.prototype.buildPath = function (ctx, shape) { - // Drawing lines is more efficient than drawing - // a whole line or drawing rects. - var points = shape.points; - var baseDimIdx = this.baseDimIdx; - var valueDimIdx = 1 - this.baseDimIdx; - var startPoint = []; - var size = []; - var barWidth = this.barWidth; - for (var i = 0; i < points.length; i += 3) { - size[baseDimIdx] = barWidth; - size[valueDimIdx] = points[i + 2]; - startPoint[baseDimIdx] = points[i + baseDimIdx]; - startPoint[valueDimIdx] = points[i + valueDimIdx]; - ctx.rect(startPoint[0], startPoint[1], size[0], size[1]); - } - }; - return LargePath; - }(Path); - function createLarge(seriesModel, group, progressiveEls, incremental) { - // TODO support polar - var data = seriesModel.getData(); - var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; - var largeDataIndices = data.getLayout('largeDataIndices'); - var barWidth = data.getLayout('size'); - var backgroundModel = seriesModel.getModel('backgroundStyle'); - var bgPoints = data.getLayout('largeBackgroundPoints'); - if (bgPoints) { - var bgEl = new LargePath({ - shape: { - points: bgPoints - }, - incremental: !!incremental, - silent: true, - z2: 0 - }); - bgEl.baseDimIdx = baseDimIdx; - bgEl.largeDataIndices = largeDataIndices; - bgEl.barWidth = barWidth; - bgEl.useStyle(backgroundModel.getItemStyle()); - group.add(bgEl); - progressiveEls && progressiveEls.push(bgEl); - } - var el = new LargePath({ - shape: { - points: data.getLayout('largePoints') - }, - incremental: !!incremental, - ignoreCoarsePointer: true, - z2: 1 - }); - el.baseDimIdx = baseDimIdx; - el.largeDataIndices = largeDataIndices; - el.barWidth = barWidth; - group.add(el); - el.useStyle(data.getVisual('style')); - // Enable tooltip and user mouse/touch event handlers. - getECData(el).seriesIndex = seriesModel.seriesIndex; - if (!seriesModel.get('silent')) { - el.on('mousedown', largePathUpdateDataIndex); - el.on('mousemove', largePathUpdateDataIndex); - } - progressiveEls && progressiveEls.push(el); - } - // Use throttle to avoid frequently traverse to find dataIndex. - var largePathUpdateDataIndex = throttle(function (event) { - var largePath = this; - var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY); - getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null; - }, 30, false); - function largePathFindDataIndex(largePath, x, y) { - var baseDimIdx = largePath.baseDimIdx; - var valueDimIdx = 1 - baseDimIdx; - var points = largePath.shape.points; - var largeDataIndices = largePath.largeDataIndices; - var startPoint = []; - var size = []; - var barWidth = largePath.barWidth; - for (var i = 0, len = points.length / 3; i < len; i++) { - var ii = i * 3; - size[baseDimIdx] = barWidth; - size[valueDimIdx] = points[ii + 2]; - startPoint[baseDimIdx] = points[ii + baseDimIdx]; - startPoint[valueDimIdx] = points[ii + valueDimIdx]; - if (size[valueDimIdx] < 0) { - startPoint[valueDimIdx] += size[valueDimIdx]; - size[valueDimIdx] = -size[valueDimIdx]; - } - if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) { - return largeDataIndices[i]; - } - } - return -1; - } - function createBackgroundShape(isHorizontalOrRadial, layout, coord) { - if (isCoordinateSystemType(coord, 'cartesian2d')) { - var rectShape = layout; - var coordLayout = coord.getArea(); - return { - x: isHorizontalOrRadial ? rectShape.x : coordLayout.x, - y: isHorizontalOrRadial ? coordLayout.y : rectShape.y, - width: isHorizontalOrRadial ? rectShape.width : coordLayout.width, - height: isHorizontalOrRadial ? coordLayout.height : rectShape.height - }; - } else { - var coordLayout = coord.getArea(); - var sectorShape = layout; - return { - cx: coordLayout.cx, - cy: coordLayout.cy, - r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0, - r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r, - startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0, - endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2 - }; - } - } - function createBackgroundEl(coord, isHorizontalOrRadial, layout) { - var ElementClz = coord.type === 'polar' ? Sector : Rect; - return new ElementClz({ - shape: createBackgroundShape(isHorizontalOrRadial, layout, coord), - silent: true, - z2: 0 - }); - } - - function install$3(registers) { - registers.registerChartView(BarView); - registers.registerSeriesModel(BarSeriesModel); - registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar')); - // Do layout after other overall layout, which can prepare some information. - registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar')); - // Down sample after filter - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar')); - /** - * @payload - * @property {string} [componentType=series] - * @property {number} [dx] - * @property {number} [dy] - * @property {number} [zoom] - * @property {number} [originX] - * @property {number} [originY] - */ - registers.registerAction({ - type: 'changeAxisOrder', - event: 'changeAxisOrder', - update: 'update' - }, function (payload, ecModel) { - var componentType = payload.componentType || 'series'; - ecModel.eachComponent({ - mainType: componentType, - query: payload - }, function (componentModel) { - if (payload.sortInfo) { - componentModel.axis.setCategorySortInfo(payload.sortInfo); - } - }); - }); - } - - var PI2$8 = Math.PI * 2; - var RADIAN = Math.PI / 180; - function getViewRect(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - } - function getBasicPieLayout(seriesModel, api) { - var viewRect = getViewRect(seriesModel, api); - // center can be string or number when coordinateSystem is specified - var center = seriesModel.get('center'); - var radius = seriesModel.get('radius'); - if (!isArray(radius)) { - radius = [0, radius]; - } - var width = parsePercent$1(viewRect.width, api.getWidth()); - var height = parsePercent$1(viewRect.height, api.getHeight()); - var size = Math.min(width, height); - var r0 = parsePercent$1(radius[0], size / 2); - var r = parsePercent$1(radius[1], size / 2); - var cx; - var cy; - var coordSys = seriesModel.coordinateSystem; - if (coordSys) { - // percentage is not allowed when coordinate system is specified - var point = coordSys.dataToPoint(center); - cx = point[0] || 0; - cy = point[1] || 0; - } else { - if (!isArray(center)) { - center = [center, center]; - } - cx = parsePercent$1(center[0], width) + viewRect.x; - cy = parsePercent$1(center[1], height) + viewRect.y; - } - return { - cx: cx, - cy: cy, - r0: r0, - r: r - }; - } - function pieLayout(seriesType, ecModel, api) { - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var viewRect = getViewRect(seriesModel, api); - var _a = getBasicPieLayout(seriesModel, api), - cx = _a.cx, - cy = _a.cy, - r = _a.r, - r0 = _a.r0; - var startAngle = -seriesModel.get('startAngle') * RADIAN; - var endAngle = seriesModel.get('endAngle'); - var padAngle = seriesModel.get('padAngle') * RADIAN; - endAngle = endAngle === 'auto' ? startAngle - PI2$8 : -endAngle * RADIAN; - var minAngle = seriesModel.get('minAngle') * RADIAN; - var minAndPadAngle = minAngle + padAngle; - var validDataCount = 0; - data.each(valueDim, function (value) { - !isNaN(value) && validDataCount++; - }); - var sum = data.getSum(valueDim); - // Sum may be 0 - var unitRadian = Math.PI / (sum || validDataCount) * 2; - var clockwise = seriesModel.get('clockwise'); - var roseType = seriesModel.get('roseType'); - var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); - // [0...max] - var extent = data.getDataExtent(valueDim); - extent[0] = 0; - var dir = clockwise ? 1 : -1; - var angles = [startAngle, endAngle]; - var halfPadAngle = dir * padAngle / 2; - normalizeArcAngles(angles, !clockwise); - startAngle = angles[0], endAngle = angles[1]; - var layoutData = getSeriesLayoutData(seriesModel); - layoutData.startAngle = startAngle; - layoutData.endAngle = endAngle; - layoutData.clockwise = clockwise; - var angleRange = Math.abs(endAngle - startAngle); - // In the case some sector angle is smaller than minAngle - var restAngle = angleRange; - var valueSumLargerThanMinAngle = 0; - var currentAngle = startAngle; - data.setLayout({ - viewRect: viewRect, - r: r - }); - data.each(valueDim, function (value, idx) { - var angle; - if (isNaN(value)) { - data.setItemLayout(idx, { - angle: NaN, - startAngle: NaN, - endAngle: NaN, - clockwise: clockwise, - cx: cx, - cy: cy, - r0: r0, - r: roseType ? NaN : r - }); - return; - } - // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样? - if (roseType !== 'area') { - angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; - } else { - angle = angleRange / validDataCount; - } - if (angle < minAndPadAngle) { - angle = minAndPadAngle; - restAngle -= minAndPadAngle; - } else { - valueSumLargerThanMinAngle += value; - } - var endAngle = currentAngle + dir * angle; - // calculate display angle - var actualStartAngle = 0; - var actualEndAngle = 0; - if (padAngle > angle) { - actualStartAngle = currentAngle + dir * angle / 2; - actualEndAngle = actualStartAngle; - } else { - actualStartAngle = currentAngle + halfPadAngle; - actualEndAngle = endAngle - halfPadAngle; - } - data.setItemLayout(idx, { - angle: angle, - startAngle: actualStartAngle, - endAngle: actualEndAngle, - clockwise: clockwise, - cx: cx, - cy: cy, - r0: r0, - r: roseType ? linearMap(value, extent, [r0, r]) : r - }); - currentAngle = endAngle; - }); - // Some sector is constrained by minAngle and padAngle - // Rest sectors needs recalculate angle - if (restAngle < PI2$8 && validDataCount) { - // Average the angle if rest angle is not enough after all angles is - // Constrained by minAngle and padAngle - if (restAngle <= 1e-3) { - var angle_1 = angleRange / validDataCount; - data.each(valueDim, function (value, idx) { - if (!isNaN(value)) { - var layout_1 = data.getItemLayout(idx); - layout_1.angle = angle_1; - var actualStartAngle = 0; - var actualEndAngle = 0; - if (angle_1 < padAngle) { - actualStartAngle = startAngle + dir * (idx + 1 / 2) * angle_1; - actualEndAngle = actualStartAngle; - } else { - actualStartAngle = startAngle + dir * idx * angle_1 + halfPadAngle; - actualEndAngle = startAngle + dir * (idx + 1) * angle_1 - halfPadAngle; - } - layout_1.startAngle = actualStartAngle; - layout_1.endAngle = actualEndAngle; - } - }); - } else { - unitRadian = restAngle / valueSumLargerThanMinAngle; - currentAngle = startAngle; - data.each(valueDim, function (value, idx) { - if (!isNaN(value)) { - var layout_2 = data.getItemLayout(idx); - var angle = layout_2.angle === minAndPadAngle ? minAndPadAngle : value * unitRadian; - var actualStartAngle = 0; - var actualEndAngle = 0; - if (angle < padAngle) { - actualStartAngle = currentAngle + dir * angle / 2; - actualEndAngle = actualStartAngle; - } else { - actualStartAngle = currentAngle + halfPadAngle; - actualEndAngle = currentAngle + dir * angle - halfPadAngle; - } - layout_2.startAngle = actualStartAngle; - layout_2.endAngle = actualEndAngle; - currentAngle += dir * angle; - } - }); - } - } - }); - } - var getSeriesLayoutData = 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. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 dataFilter(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++) { - // @ts-ignore FIXME: LegendModel - if (!legendModels[i].isSelected(name)) { - return false; - } - } - return true; - }); - } - }; - } - - var RADIAN$1 = Math.PI / 180; - function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) { - if (list.length < 2) { - return; - } - function recalculateXOnSemiToAlignOnEllipseCurve(semi) { - var rB = semi.rB; - var rB2 = rB * rB; - for (var i = 0; i < semi.list.length; i++) { - var item = semi.list[i]; - var dy = Math.abs(item.label.y - cy); - // horizontal r is always same with original r because x is not changed. - var rA = r + item.len; - var rA2 = rA * rA; - // Use ellipse implicit function to calculate x - var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2); - var newX = cx + (dx + item.len2) * dir; - var deltaX = newX - item.label.x; - var newTargetWidth = item.targetTextWidth - deltaX * dir; - // text x is changed, so need to recalculate width. - constrainTextWidth(item, newTargetWidth, true); - item.label.x = newX; - } - } - // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve. - function recalculateX(items) { - // Extremes of - var topSemi = { - list: [], - maxY: 0 - }; - var bottomSemi = { - list: [], - maxY: 0 - }; - for (var i = 0; i < items.length; i++) { - if (items[i].labelAlignTo !== 'none') { - continue; - } - var item = items[i]; - var semi = item.label.y > cy ? bottomSemi : topSemi; - var dy = Math.abs(item.label.y - cy); - if (dy >= semi.maxY) { - var dx = item.label.x - cx - item.len2 * dir; - // horizontal r is always same with original r because x is not changed. - var rA = r + item.len; - // Canculate rB based on the topest / bottemest label. - var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA; - semi.rB = rB; - semi.maxY = dy; - } - semi.list.push(item); - } - recalculateXOnSemiToAlignOnEllipseCurve(topSemi); - recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi); - } - var len = list.length; - for (var i = 0; i < len; i++) { - if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') { - var dx = list[i].label.x - farthestX; - list[i].linePoints[1][0] += dx; - list[i].label.x = farthestX; - } - } - if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) { - recalculateX(list); - } - } - function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) { - var leftList = []; - var rightList = []; - var leftmostX = Number.MAX_VALUE; - var rightmostX = -Number.MAX_VALUE; - for (var i = 0; i < labelLayoutList.length; i++) { - var label = labelLayoutList[i].label; - if (isPositionCenter(labelLayoutList[i])) { - continue; - } - if (label.x < cx) { - leftmostX = Math.min(leftmostX, label.x); - leftList.push(labelLayoutList[i]); - } else { - rightmostX = Math.max(rightmostX, label.x); - rightList.push(labelLayoutList[i]); - } - } - for (var i = 0; i < labelLayoutList.length; i++) { - var layout = labelLayoutList[i]; - if (!isPositionCenter(layout) && layout.linePoints) { - if (layout.labelStyleWidth != null) { - continue; - } - var label = layout.label; - var linePoints = layout.linePoints; - var targetTextWidth = void 0; - if (layout.labelAlignTo === 'edge') { - if (label.x < cx) { - targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance; - } else { - targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance; - } - } else if (layout.labelAlignTo === 'labelLine') { - if (label.x < cx) { - targetTextWidth = leftmostX - viewLeft - layout.bleedMargin; - } else { - targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin; - } - } else { - if (label.x < cx) { - targetTextWidth = label.x - viewLeft - layout.bleedMargin; - } else { - targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin; - } - } - layout.targetTextWidth = targetTextWidth; - constrainTextWidth(layout, targetTextWidth); - } - } - adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX); - adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX); - for (var i = 0; i < labelLayoutList.length; i++) { - var layout = labelLayoutList[i]; - if (!isPositionCenter(layout) && layout.linePoints) { - var label = layout.label; - var linePoints = layout.linePoints; - var isAlignToEdge = layout.labelAlignTo === 'edge'; - var padding = label.style.padding; - var paddingH = padding ? padding[1] + padding[3] : 0; - // textRect.width already contains paddingH if bgColor is set - var extraPaddingH = label.style.backgroundColor ? 0 : paddingH; - var realTextWidth = layout.rect.width + extraPaddingH; - var dist = linePoints[1][0] - linePoints[2][0]; - if (isAlignToEdge) { - if (label.x < cx) { - linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance; - } else { - linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance; - } - } else { - if (label.x < cx) { - linePoints[2][0] = label.x + layout.labelDistance; - } else { - linePoints[2][0] = label.x - layout.labelDistance; - } - linePoints[1][0] = linePoints[2][0] + dist; - } - linePoints[1][1] = linePoints[2][1] = label.y; - } - } - } - /** - * Set max width of each label, and then wrap each label to the max width. - * - * @param layout label layout - * @param availableWidth max width for the label to display - * @param forceRecalculate recaculate the text layout even if the current width - * is smaller than `availableWidth`. This is useful when the text was previously - * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in - * which case, previous wrapping should be redo. - */ - function constrainTextWidth(layout, availableWidth, forceRecalculate) { - if (forceRecalculate === void 0) { - forceRecalculate = false; - } - if (layout.labelStyleWidth != null) { - // User-defined style.width has the highest priority. - return; - } - var label = layout.label; - var style = label.style; - var textRect = layout.rect; - var bgColor = style.backgroundColor; - var padding = style.padding; - var paddingH = padding ? padding[1] + padding[3] : 0; - var overflow = style.overflow; - // textRect.width already contains paddingH if bgColor is set - var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH); - if (availableWidth < oldOuterWidth || forceRecalculate) { - var oldHeight = textRect.height; - if (overflow && overflow.match('break')) { - // Temporarily set background to be null to calculate - // the bounding box without background. - label.setStyle('backgroundColor', null); - // Set constraining width - label.setStyle('width', availableWidth - paddingH); - // This is the real bounding box of the text without padding. - var innerRect = label.getBoundingRect(); - label.setStyle('width', Math.ceil(innerRect.width)); - label.setStyle('backgroundColor', bgColor); - } else { - var availableInnerWidth = availableWidth - paddingH; - var newWidth = availableWidth < oldOuterWidth - // Current text is too wide, use `availableWidth` as max width. - ? availableInnerWidth : - // Current available width is enough, but the text may have - // already been wrapped with a smaller available width. - forceRecalculate ? availableInnerWidth > layout.unconstrainedWidth - // Current available is larger than text width, - // so don't constrain width (otherwise it may have - // empty space in the background). - ? null - // Current available is smaller than text width, so - // use the current available width as constraining - // width. - : availableInnerWidth - // Current available width is enough, so no need to - // constrain. - : null; - label.setStyle('width', newWidth); - } - var newRect = label.getBoundingRect(); - textRect.width = newRect.width; - var margin = (label.style.margin || 0) + 2.1; - textRect.height = newRect.height + margin; - textRect.y -= (textRect.height - oldHeight) / 2; - } - } - function isPositionCenter(sectorShape) { - // Not change x for center label - return sectorShape.position === 'center'; - } - function pieLabelLayout(seriesModel) { - var data = seriesModel.getData(); - var labelLayoutList = []; - var cx; - var cy; - var hasLabelRotate = false; - var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN$1; - var viewRect = data.getLayout('viewRect'); - var r = data.getLayout('r'); - var viewWidth = viewRect.width; - var viewLeft = viewRect.x; - var viewTop = viewRect.y; - var viewHeight = viewRect.height; - function setNotShow(el) { - el.ignore = true; - } - function isLabelShown(label) { - if (!label.ignore) { - return true; - } - for (var key in label.states) { - if (label.states[key].ignore === false) { - return true; - } - } - return false; - } - data.each(function (idx) { - var sector = data.getItemGraphicEl(idx); - var sectorShape = sector.shape; - var label = sector.getTextContent(); - var labelLine = sector.getTextGuideLine(); - var itemModel = data.getItemModel(idx); - var labelModel = itemModel.getModel('label'); - // Use position in normal or emphasis - var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']); - var labelDistance = labelModel.get('distanceToLabelLine'); - var labelAlignTo = labelModel.get('alignTo'); - var edgeDistance = parsePercent$1(labelModel.get('edgeDistance'), viewWidth); - var bleedMargin = labelModel.get('bleedMargin'); - var labelLineModel = itemModel.getModel('labelLine'); - var labelLineLen = labelLineModel.get('length'); - labelLineLen = parsePercent$1(labelLineLen, viewWidth); - var labelLineLen2 = labelLineModel.get('length2'); - labelLineLen2 = parsePercent$1(labelLineLen2, viewWidth); - if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) { - each(label.states, setNotShow); - label.ignore = true; - if (labelLine) { - each(labelLine.states, setNotShow); - labelLine.ignore = true; - } - return; - } - if (!isLabelShown(label)) { - return; - } - var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2; - var nx = Math.cos(midAngle); - var ny = Math.sin(midAngle); - var textX; - var textY; - var linePoints; - var textAlign; - cx = sectorShape.cx; - cy = sectorShape.cy; - var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner'; - if (labelPosition === 'center') { - textX = sectorShape.cx; - textY = sectorShape.cy; - textAlign = 'center'; - } else { - var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx; - var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy; - textX = x1 + nx * 3; - textY = y1 + ny * 3; - if (!isLabelInside) { - // For roseType - var x2 = x1 + nx * (labelLineLen + r - sectorShape.r); - var y2 = y1 + ny * (labelLineLen + r - sectorShape.r); - var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2; - var y3 = y2; - if (labelAlignTo === 'edge') { - // Adjust textX because text align of edge is opposite - textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance; - } else { - textX = x3 + (nx < 0 ? -labelDistance : labelDistance); - } - textY = y3; - linePoints = [[x1, y1], [x2, y2], [x3, y3]]; - } - textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right'; - } - var PI = Math.PI; - var labelRotate = 0; - var rotate = labelModel.get('rotate'); - if (isNumber(rotate)) { - labelRotate = rotate * (PI / 180); - } else if (labelPosition === 'center') { - labelRotate = 0; - } else if (rotate === 'radial' || rotate === true) { - var radialAngle = nx < 0 ? -midAngle + PI : -midAngle; - labelRotate = radialAngle; - } else if (rotate === 'tangential' && labelPosition !== 'outside' && labelPosition !== 'outer') { - var rad = Math.atan2(nx, ny); - if (rad < 0) { - rad = PI * 2 + rad; - } - var isDown = ny > 0; - if (isDown) { - rad = PI + rad; - } - labelRotate = rad - PI; - } - hasLabelRotate = !!labelRotate; - label.x = textX; - label.y = textY; - label.rotation = labelRotate; - label.setStyle({ - verticalAlign: 'middle' - }); - // Not sectorShape the inside label - if (!isLabelInside) { - var textRect = label.getBoundingRect().clone(); - textRect.applyTransform(label.getComputedTransform()); - // Text has a default 1px stroke. Exclude this. - var margin = (label.style.margin || 0) + 2.1; - textRect.y -= margin / 2; - textRect.height += margin; - labelLayoutList.push({ - label: label, - labelLine: labelLine, - position: labelPosition, - len: labelLineLen, - len2: labelLineLen2, - minTurnAngle: labelLineModel.get('minTurnAngle'), - maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'), - surfaceNormal: new Point(nx, ny), - linePoints: linePoints, - textAlign: textAlign, - labelDistance: labelDistance, - labelAlignTo: labelAlignTo, - edgeDistance: edgeDistance, - bleedMargin: bleedMargin, - rect: textRect, - unconstrainedWidth: textRect.width, - labelStyleWidth: label.style.width - }); - } else { - label.setStyle({ - align: textAlign - }); - var selectState = label.states.select; - if (selectState) { - selectState.x += label.x; - selectState.y += label.y; - } - } - sector.setTextConfig({ - inside: isLabelInside - }); - }); - if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) { - avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop); - } - for (var i = 0; i < labelLayoutList.length; i++) { - var layout = labelLayoutList[i]; - var label = layout.label; - var labelLine = layout.labelLine; - var notShowLabel = isNaN(label.x) || isNaN(label.y); - if (label) { - label.setStyle({ - align: layout.textAlign - }); - if (notShowLabel) { - each(label.states, setNotShow); - label.ignore = true; - } - var selectState = label.states.select; - if (selectState) { - selectState.x += label.x; - selectState.y += label.y; - } - } - if (labelLine) { - var linePoints = layout.linePoints; - if (notShowLabel || !linePoints) { - each(labelLine.states, setNotShow); - labelLine.ignore = true; - } else { - limitTurnAngle(linePoints, layout.minTurnAngle); - limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle); - labelLine.setShape({ - points: linePoints - }); - // Set the anchor to the midpoint of sector - label.__hostTarget.textGuideLineConfig = { - anchor: new Point(linePoints[0][0], linePoints[0][1]) - }; - } - } - } - } - - /** - * Piece of pie including Sector, Label, LabelLine - */ - var PiePiece = /** @class */function (_super) { - __extends(PiePiece, _super); - function PiePiece(data, idx, startAngle) { - var _this = _super.call(this) || this; - _this.z2 = 2; - var text = new ZRText(); - _this.setTextContent(text); - _this.updateData(data, idx, startAngle, true); - return _this; - } - PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) { - var sector = this; - var seriesModel = data.hostModel; - var itemModel = data.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - var layout = data.getItemLayout(idx); - // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified. - // see `setItemLayout` in `pieLayout.ts`. - var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout); - // Ignore NaN data. - if (isNaN(sectorShape.startAngle)) { - // Use NaN shape to avoid drawing shape. - sector.setShape(sectorShape); - return; - } - if (firstCreate) { - sector.setShape(sectorShape); - var animationType = seriesModel.getShallow('animationType'); - if (seriesModel.ecModel.ssr) { - // Use scale animation in SSR mode(opacity?) - // Because CSS SVG animation doesn't support very customized shape animation. - initProps(sector, { - scaleX: 0, - scaleY: 0 - }, seriesModel, { - dataIndex: idx, - isFrom: true - }); - sector.originX = sectorShape.cx; - sector.originY = sectorShape.cy; - } else if (animationType === 'scale') { - sector.shape.r = layout.r0; - initProps(sector, { - shape: { - r: layout.r - } - }, seriesModel, idx); - } - // Expansion - else { - if (startAngle != null) { - sector.setShape({ - startAngle: startAngle, - endAngle: startAngle - }); - initProps(sector, { - shape: { - startAngle: layout.startAngle, - endAngle: layout.endAngle - } - }, seriesModel, idx); - } else { - sector.shape.endAngle = layout.startAngle; - updateProps(sector, { - shape: { - endAngle: layout.endAngle - } - }, seriesModel, idx); - } - } - } else { - saveOldStyle(sector); - // Transition animation from the old shape - updateProps(sector, { - shape: sectorShape - }, seriesModel, idx); - } - sector.useStyle(data.getItemVisual(idx, 'style')); - setStatesStylesFromModel(sector, itemModel); - var midAngle = (layout.startAngle + layout.endAngle) / 2; - var offset = seriesModel.get('selectedOffset'); - var dx = Math.cos(midAngle) * offset; - var dy = Math.sin(midAngle) * offset; - var cursorStyle = itemModel.getShallow('cursor'); - cursorStyle && sector.attr('cursor', cursorStyle); - this._updateLabel(seriesModel, data, idx); - sector.ensureState('emphasis').shape = extend({ - r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0) - }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout)); - extend(sector.ensureState('select'), { - x: dx, - y: dy, - shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout) - }); - extend(sector.ensureState('blur'), { - shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout) - }); - var labelLine = sector.getTextGuideLine(); - var labelText = sector.getTextContent(); - labelLine && extend(labelLine.ensureState('select'), { - x: dx, - y: dy - }); - // TODO: needs dx, dy in zrender? - extend(labelText.ensureState('select'), { - x: dx, - y: dy - }); - toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; - PiePiece.prototype._updateLabel = function (seriesModel, data, idx) { - var sector = this; - var itemModel = data.getItemModel(idx); - var labelLineModel = itemModel.getModel('labelLine'); - var style = data.getItemVisual(idx, 'style'); - var visualColor = style && style.fill; - var visualOpacity = style && style.opacity; - setLabelStyle(sector, getLabelStatesModels(itemModel), { - labelFetcher: data.hostModel, - labelDataIndex: idx, - inheritColor: visualColor, - defaultOpacity: visualOpacity, - defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx) - }); - var labelText = sector.getTextContent(); - // Set textConfig on sector. - sector.setTextConfig({ - // reset position, rotation - position: null, - rotation: null - }); - // Make sure update style on labelText after setLabelStyle. - // Because setLabelStyle will replace a new style on it. - labelText.attr({ - z2: 10 - }); - var labelPosition = seriesModel.get(['label', 'position']); - if (labelPosition !== 'outside' && labelPosition !== 'outer') { - sector.removeTextGuideLine(); - } else { - var polyline = this.getTextGuideLine(); - if (!polyline) { - polyline = new Polyline(); - this.setTextGuideLine(polyline); - } - // Default use item visual color - setLabelLineStyle(this, getLabelLineStatesModels(itemModel), { - stroke: visualColor, - opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1) - }); - } - }; - return PiePiece; - }(Sector); - // Pie view - var PieView = /** @class */function (_super) { - __extends(PieView, _super); - function PieView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.ignoreLabelLineUpdate = true; - return _this; - } - PieView.prototype.render = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(); - var oldData = this._data; - var group = this.group; - var startAngle; - // First render - if (!oldData && data.count() > 0) { - var shape = data.getItemLayout(0); - for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) { - shape = data.getItemLayout(s); - } - if (shape) { - startAngle = shape.startAngle; - } - } - // remove empty-circle if it exists - if (this._emptyCircleSector) { - group.remove(this._emptyCircleSector); - } - // when all data are filtered, show lightgray empty circle - if (data.count() === 0 && seriesModel.get('showEmptyCircle')) { - var layoutData = getSeriesLayoutData(seriesModel); - var sector = new Sector({ - shape: extend(getBasicPieLayout(seriesModel, api), layoutData) - }); - sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle()); - this._emptyCircleSector = sector; - group.add(sector); - } - data.diff(oldData).add(function (idx) { - var piePiece = new PiePiece(data, idx, startAngle); - data.setItemGraphicEl(idx, piePiece); - group.add(piePiece); - }).update(function (newIdx, oldIdx) { - var piePiece = oldData.getItemGraphicEl(oldIdx); - piePiece.updateData(data, newIdx, startAngle); - piePiece.off('click'); - group.add(piePiece); - data.setItemGraphicEl(newIdx, piePiece); - }).remove(function (idx) { - var piePiece = oldData.getItemGraphicEl(idx); - removeElementWithFadeOut(piePiece, seriesModel, idx); - }).execute(); - pieLabelLayout(seriesModel); - // Always use initial animation. - if (seriesModel.get('animationTypeUpdate') !== 'expansion') { - this._data = data; - } - }; - PieView.prototype.dispose = function () {}; - PieView.prototype.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; - } - }; - PieView.type = 'pie'; - return PieView; - }(ChartView); - - /** - * [Usage]: - * (1) - * createListSimply(seriesModel, ['value']); - * (2) - * createListSimply(seriesModel, { - * coordDimensions: ['value'], - * dimensionsCount: 5 - * }); - */ - function createSeriesDataSimply(seriesModel, opt, nameList) { - opt = isArray(opt) && { - coordDimensions: opt - } || extend({ - encodeDefine: seriesModel.getEncode() - }, opt); - var source = seriesModel.getSource(); - var dimensions = prepareSeriesDataSchema(source, opt).dimensions; - var list = new SeriesData(dimensions, seriesModel); - list.initData(source, nameList); - return list; - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - /** - * LegendVisualProvider is an bridge that pick encoded color from data and - * provide to the legend component. - */ - var LegendVisualProvider = /** @class */function () { - function LegendVisualProvider( - // Function to get data after filtered. It stores all the encoding info - getDataWithEncodedVisual, - // Function to get raw data before filtered. - getRawData) { - this._getDataWithEncodedVisual = getDataWithEncodedVisual; - this._getRawData = getRawData; - } - LegendVisualProvider.prototype.getAllNames = function () { - var rawData = this._getRawData(); - // We find the name from the raw data. In case it's filtered by the legend component. - // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray. - return rawData.mapArray(rawData.getName); - }; - LegendVisualProvider.prototype.containName = function (name) { - var rawData = this._getRawData(); - return rawData.indexOfName(name) >= 0; - }; - LegendVisualProvider.prototype.indexOfName = function (name) { - // Only get data when necessary. - // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet. - // Invoking Series#getData immediately will throw an error. - var dataWithEncodedVisual = this._getDataWithEncodedVisual(); - return dataWithEncodedVisual.indexOfName(name); - }; - LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) { - // Get encoded visual properties from final filtered data. - var dataWithEncodedVisual = this._getDataWithEncodedVisual(); - return dataWithEncodedVisual.getItemVisual(dataIndex, key); - }; - return LegendVisualProvider; - }(); - - var innerData = makeInner(); - var PieSeriesModel = /** @class */function (_super) { - __extends(PieSeriesModel, _super); - function PieSeriesModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @overwrite - */ - PieSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); - // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); - this._defaultLabelLine(option); - }; - /** - * @overwrite - */ - PieSeriesModel.prototype.mergeOption = function () { - _super.prototype.mergeOption.apply(this, arguments); - }; - /** - * @overwrite - */ - PieSeriesModel.prototype.getInitialData = function () { - return createSeriesDataSimply(this, { - coordDimensions: ['value'], - encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) - }); - }; - /** - * @overwrite - */ - PieSeriesModel.prototype.getDataParams = function (dataIndex) { - var data = this.getData(); - // update seats when data is changed - var dataInner = innerData(data); - var seats = dataInner.seats; - if (!seats) { - var valueList_1 = []; - data.each(data.mapDimension('value'), function (value) { - valueList_1.push(value); - }); - seats = dataInner.seats = getPercentSeats(valueList_1, data.hostModel.get('percentPrecision')); - } - var params = _super.prototype.getDataParams.call(this, dataIndex); - // seats may be empty when sum is 0 - params.percent = seats[dataIndex] || 0; - params.$vars.push('percent'); - return params; - }; - PieSeriesModel.prototype._defaultLabelLine = function (option) { - // Extend labelLine emphasis - 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; - }; - PieSeriesModel.type = 'series.pie'; - PieSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - legendHoverLink: true, - colorBy: 'data', - // 默认全局居中 - center: ['50%', '50%'], - radius: [0, '75%'], - // 默认顺时针 - clockwise: true, - startAngle: 90, - endAngle: 'auto', - padAngle: 0, - // 最小角度改为0 - minAngle: 0, - // If the angle of a sector less than `minShowLabelAngle`, - // the label will not be displayed. - minShowLabelAngle: 0, - // 选中时扇区偏移量 - selectedOffset: 10, - // 选择模式,默认关闭,可选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: { - // color: 'inherit', - // If rotate around circle - rotate: 0, - show: true, - overflow: 'truncate', - // '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'. - edgeDistance: '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, - minTurnAngle: 90, - maxSurfaceAngle: 90, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - }, - itemStyle: { - borderWidth: 1, - borderJoin: 'round' - }, - showEmptyCircle: true, - emptyCircleStyle: { - color: 'lightgray', - opacity: 1 - }, - labelLayout: { - // Hide the overlapped label. - hideOverlap: true - }, - emphasis: { - scale: true, - scaleSize: 5 - }, - // If use strategy to avoid label overlapping - avoidLabelOverlap: true, - // Animation type. Valid values: expansion, scale - animationType: 'expansion', - animationDuration: 1000, - // Animation type when update. Valid values: transition, expansion - animationTypeUpdate: 'transition', - animationEasingUpdate: 'cubicInOut', - animationDurationUpdate: 500, - animationEasing: 'cubicInOut' - }; - return PieSeriesModel; - }(SeriesModel); - - function negativeDataFilter(seriesType) { - return { - seriesType: seriesType, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - data.filterSelf(function (idx) { - // handle negative value condition - var valueDim = data.mapDimension('value'); - var curValue = data.get(valueDim, idx); - if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) { - return false; - } - return true; - }); - } - }; - } - - function install$4(registers) { - registers.registerChartView(PieView); - registers.registerSeriesModel(PieSeriesModel); - createLegacyDataSelectAction('pie', registers.registerAction); - registers.registerLayout(curry(pieLayout, 'pie')); - registers.registerProcessor(dataFilter('pie')); - registers.registerProcessor(negativeDataFilter('pie')); - } - - var ScatterSeriesModel = /** @class */function (_super) { - __extends(ScatterSeriesModel, _super); - function ScatterSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ScatterSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } - ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; - ScatterSeriesModel.prototype.getProgressive = function () { - var progressive = this.option.progressive; - if (progressive == null) { - // PENDING - return this.option.large ? 5e3 : this.get('progressive'); - } - return progressive; - }; - ScatterSeriesModel.prototype.getProgressiveThreshold = function () { - var progressiveThreshold = this.option.progressiveThreshold; - if (progressiveThreshold == null) { - // PENDING - return this.option.large ? 1e4 : this.get('progressiveThreshold'); - } - return progressiveThreshold; - }; - ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - return selectors.point(data.getItemLayout(dataIndex)); - }; - ScatterSeriesModel.prototype.getZLevelKey = function () { - // Each progressive series has individual key. - return this.getData().count() > this.getProgressiveThreshold() ? this.id : ''; - }; - ScatterSeriesModel.type = 'series.scatter'; - ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; - ScatterSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - legendHoverLink: true, - symbolSize: 10, - // symbolRotate: null, // 图形旋转控制 - large: false, - // Available when large is true - largeThreshold: 2000, - // cursor: null, - itemStyle: { - opacity: 0.8 - // color: 各异 - }, - - emphasis: { - scale: true - }, - // If clip the overflow graphics - // Works on cartesian / polar series - clip: true, - select: { - itemStyle: { - borderColor: '#212121' - } - }, - universalTransition: { - divideShape: 'clone' - } - // progressive: null - }; - - return ScatterSeriesModel; - }(SeriesModel); - - var BOOST_SIZE_THRESHOLD = 4; - var LargeSymbolPathShape = /** @class */function () { - function LargeSymbolPathShape() {} - return LargeSymbolPathShape; - }(); - var LargeSymbolPath = /** @class */function (_super) { - __extends(LargeSymbolPath, _super); - function LargeSymbolPath(opts) { - var _this = _super.call(this, opts) || this; - _this._off = 0; - _this.hoverDataIdx = -1; - return _this; - } - LargeSymbolPath.prototype.getDefaultShape = function () { - return new LargeSymbolPathShape(); - }; - LargeSymbolPath.prototype.reset = function () { - this.notClear = false; - this._off = 0; - }; - LargeSymbolPath.prototype.buildPath = function (path, shape) { - var points = shape.points; - var size = shape.size; - var symbolProxy = this.symbolProxy; - var symbolProxyShape = symbolProxy.shape; - var ctx = path.getContext ? path.getContext() : path; - var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; - var softClipShape = this.softClipShape; - var i; - // Do draw in afterBrush. - if (canBoost) { - this._ctx = ctx; - return; - } - this._ctx = null; - for (i = this._off; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - if (isNaN(x) || isNaN(y)) { - continue; - } - if (softClipShape && !softClipShape.contain(x, y)) { - continue; - } - symbolProxyShape.x = x - size[0] / 2; - symbolProxyShape.y = y - size[1] / 2; - symbolProxyShape.width = size[0]; - symbolProxyShape.height = size[1]; - symbolProxy.buildPath(path, symbolProxyShape, true); - } - if (this.incremental) { - this._off = i; - this.notClear = true; - } - }; - LargeSymbolPath.prototype.afterBrush = function () { - var shape = this.shape; - var points = shape.points; - var size = shape.size; - var ctx = this._ctx; - var softClipShape = this.softClipShape; - var i; - if (!ctx) { - return; - } - // PENDING If style or other canvas status changed? - for (i = this._off; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - if (isNaN(x) || isNaN(y)) { - continue; - } - if (softClipShape && !softClipShape.contain(x, y)) { - continue; - } - // fillRect is faster than building a rect path and draw. - // And it support light globalCompositeOperation. - ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]); - } - if (this.incremental) { - this._off = i; - this.notClear = true; - } - }; - LargeSymbolPath.prototype.findDataIndex = function (x, y) { - // TODO ??? - // Consider transform - var shape = this.shape; - var points = shape.points; - var size = shape.size; - var w = Math.max(size[0], 4); - var h = Math.max(size[1], 4); - // Not consider transform - // Treat each element as a rect - // top down traverse - for (var idx = points.length / 2 - 1; idx >= 0; idx--) { - var i = idx * 2; - var x0 = points[i] - w / 2; - var y0 = points[i + 1] - h / 2; - if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) { - return idx; - } - } - return -1; - }; - LargeSymbolPath.prototype.contain = function (x, y) { - var localPos = this.transformCoordToLocal(x, y); - var rect = this.getBoundingRect(); - x = localPos[0]; - y = localPos[1]; - if (rect.contain(x, y)) { - // Cache found data index. - var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); - return dataIdx >= 0; - } - this.hoverDataIdx = -1; - return false; - }; - LargeSymbolPath.prototype.getBoundingRect = function () { - // Ignore stroke for large symbol draw. - var rect = this._rect; - if (!rect) { - var shape = this.shape; - var points = shape.points; - var size = shape.size; - var w = size[0]; - var h = size[1]; - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; - for (var i = 0; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - minX = Math.min(x, minX); - maxX = Math.max(x, maxX); - minY = Math.min(y, minY); - maxY = Math.max(y, maxY); - } - rect = this._rect = new BoundingRect(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h); - } - return rect; - }; - return LargeSymbolPath; - }(Path); - var LargeSymbolDraw = /** @class */function () { - function LargeSymbolDraw() { - this.group = new Group(); - } - /** - * Update symbols draw by new data - */ - LargeSymbolDraw.prototype.updateData = function (data, opt) { - this._clear(); - var symbolEl = this._create(); - symbolEl.setShape({ - points: data.getLayout('points') - }); - this._setCommon(symbolEl, data, opt); - }; - LargeSymbolDraw.prototype.updateLayout = function (data) { - var points = data.getLayout('points'); - this.group.eachChild(function (child) { - if (child.startIndex != null) { - var len = (child.endIndex - child.startIndex) * 2; - var byteOffset = child.startIndex * 4 * 2; - points = new Float32Array(points.buffer, byteOffset, len); - } - child.setShape('points', points); - // Reset draw cursor. - child.reset(); - }); - }; - LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) { - this._clear(); - }; - LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) { - var lastAdded = this._newAdded[0]; - var points = data.getLayout('points'); - var oldPoints = lastAdded && lastAdded.shape.points; - // Merging the exists. Each element has 1e4 points. - // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization) - if (oldPoints && oldPoints.length < 2e4) { - var oldLen = oldPoints.length; - var newPoints = new Float32Array(oldLen + points.length); - // Concat two array - newPoints.set(oldPoints); - newPoints.set(points, oldLen); - // Update endIndex - lastAdded.endIndex = taskParams.end; - lastAdded.setShape({ - points: newPoints - }); - } else { - // Clear - this._newAdded = []; - var symbolEl = this._create(); - symbolEl.startIndex = taskParams.start; - symbolEl.endIndex = taskParams.end; - symbolEl.incremental = true; - symbolEl.setShape({ - points: points - }); - this._setCommon(symbolEl, data, opt); - } - }; - LargeSymbolDraw.prototype.eachRendered = function (cb) { - this._newAdded[0] && cb(this._newAdded[0]); - }; - LargeSymbolDraw.prototype._create = function () { - var symbolEl = new LargeSymbolPath({ - cursor: 'default' - }); - symbolEl.ignoreCoarsePointer = true; - this.group.add(symbolEl); - this._newAdded.push(symbolEl); - return symbolEl; - }; - LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, opt) { - var hostModel = data.hostModel; - opt = opt || {}; - var size = data.getVisual('symbolSize'); - symbolEl.setShape('size', size instanceof Array ? size : [size, size]); - symbolEl.softClipShape = opt.clipShape || null; - // Create symbolProxy to build path for each data - symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0); - // Use symbolProxy setColor method - symbolEl.setColor = symbolEl.symbolProxy.setColor; - var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD; - symbolEl.useStyle( - // Draw shadow when doing fillRect is extremely slow. - hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color'])); - var globalStyle = data.getVisual('style'); - var visualColor = globalStyle && globalStyle.fill; - if (visualColor) { - symbolEl.setColor(visualColor); - } - var ecData = getECData(symbolEl); - // Enable tooltip - // PENDING May have performance issue when path is extremely large - ecData.seriesIndex = hostModel.seriesIndex; - symbolEl.on('mousemove', function (e) { - ecData.dataIndex = null; - var dataIndex = symbolEl.hoverDataIdx; - if (dataIndex >= 0) { - // Provide dataIndex for tooltip - ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0); - } - }); - }; - LargeSymbolDraw.prototype.remove = function () { - this._clear(); - }; - LargeSymbolDraw.prototype._clear = function () { - this._newAdded = []; - this.group.removeAll(); - }; - return LargeSymbolDraw; - }(); - - var ScatterView = /** @class */function (_super) { - __extends(ScatterView, _super); - function ScatterView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ScatterView.type; - return _this; - } - ScatterView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var symbolDraw = this._updateSymbolDraw(data, seriesModel); - symbolDraw.updateData(data, { - // TODO - // If this parameter should be a shape or a bounding volume - // shape will be more general. - // But bounding volume like bounding rect will be much faster in the contain calculation - clipShape: this._getClipShape(seriesModel) - }); - this._finished = true; - }; - ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var symbolDraw = this._updateSymbolDraw(data, seriesModel); - symbolDraw.incrementalPrepareUpdate(data); - this._finished = false; - }; - ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { - this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), { - clipShape: this._getClipShape(seriesModel) - }); - this._finished = taskParams.end === seriesModel.getData().count(); - }; - ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - // Must mark group dirty and make sure the incremental layer will be cleared - // PENDING - this.group.dirty(); - if (!this._finished || data.count() > 1e4) { - return { - update: true - }; - } else { - var res = pointsLayout('').reset(seriesModel, ecModel, api); - if (res.progress) { - res.progress({ - start: 0, - end: data.count(), - count: data.count() - }, data); - } - this._symbolDraw.updateLayout(data); - } - }; - ScatterView.prototype.eachRendered = function (cb) { - this._symbolDraw && this._symbolDraw.eachRendered(cb); - }; - ScatterView.prototype._getClipShape = function (seriesModel) { - if (!seriesModel.get('clip', true)) { - return; - } - var coordSys = seriesModel.coordinateSystem; - // PENDING make `0.1` configurable, for example, `clipTolerance`? - return coordSys && coordSys.getArea && coordSys.getArea(.1); - }; - ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) { - var symbolDraw = this._symbolDraw; - var pipelineContext = seriesModel.pipelineContext; - var isLargeDraw = pipelineContext.large; - if (!symbolDraw || isLargeDraw !== this._isLargeDraw) { - symbolDraw && symbolDraw.remove(); - symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw(); - this._isLargeDraw = isLargeDraw; - this.group.removeAll(); - } - this.group.add(symbolDraw.group); - return symbolDraw; - }; - ScatterView.prototype.remove = function (ecModel, api) { - this._symbolDraw && this._symbolDraw.remove(true); - this._symbolDraw = null; - }; - ScatterView.prototype.dispose = function () {}; - ScatterView.type = 'scatter'; - return ScatterView; - }(ChartView); - - var GridModel = /** @class */function (_super) { - __extends(GridModel, _super); - function GridModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - GridModel.type = 'grid'; - GridModel.dependencies = ['xAxis', 'yAxis']; - GridModel.layoutMode = 'box'; - GridModel.defaultOption = { - show: false, - // zlevel: 0, - z: 0, - left: '10%', - top: 60, - right: '10%', - bottom: 70, - // If grid size contain label - containLabel: false, - // width: {totalWidth} - left - right, - // height: {totalHeight} - top - bottom, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 1, - borderColor: '#ccc' - }; - return GridModel; - }(ComponentModel); - - var CartesianAxisModel = /** @class */function (_super) { - __extends(CartesianAxisModel, _super); - function CartesianAxisModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - CartesianAxisModel.prototype.getCoordSysModel = function () { - return this.getReferringComponents('grid', SINGLE_REFERRING).models[0]; - }; - CartesianAxisModel.type = 'cartesian2dAxis'; - return CartesianAxisModel; - }(ComponentModel); - mixin(CartesianAxisModel, AxisModelCommonMixin); - - var defaultOption = { - show: true, - // zlevel: 0, - z: 0, - // Inverse the axis. - inverse: false, - // Axis name displayed. - name: '', - // 'start' | 'middle' | 'end' - nameLocation: 'end', - // By degree. By default auto rotate by nameLocation. - nameRotate: null, - nameTruncate: { - maxWidth: null, - ellipsis: '...', - placeholder: '.' - }, - // Use global text style by default. - nameTextStyle: {}, - // The gap between axisName and axisLine. - nameGap: 15, - // Default `false` to support tooltip. - silent: false, - // Default `false` to avoid legacy user event listener fail. - triggerEvent: false, - tooltip: { - show: false - }, - axisPointer: {}, - axisLine: { - show: true, - onZero: true, - onZeroAxisIndex: null, - lineStyle: { - color: '#6E7079', - width: 1, - type: 'solid' - }, - // The arrow at both ends the the axis. - symbol: ['none', 'none'], - symbolSize: [10, 15] - }, - axisTick: { - show: true, - // Whether axisTick is inside the grid or outside the grid. - inside: false, - // The length of axisTick. - length: 5, - lineStyle: { - width: 1 - } - }, - axisLabel: { - show: true, - // Whether axisLabel is inside the grid or outside the grid. - inside: false, - rotate: 0, - // true | false | null/undefined (auto) - showMinLabel: null, - // true | false | null/undefined (auto) - showMaxLabel: null, - margin: 8, - // formatter: null, - fontSize: 12 - }, - splitLine: { - show: true, - lineStyle: { - color: ['#E0E6F1'], - width: 1, - type: 'solid' - } - }, - splitArea: { - show: false, - areaStyle: { - color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'] - } - } - }; - var categoryAxis = merge({ - // The gap at both ends of the axis. For categoryAxis, boolean. - boundaryGap: true, - // Set false to faster category collection. - deduplication: null, - // splitArea: { - // show: false - // }, - splitLine: { - show: false - }, - axisTick: { - // If tick is align with label when boundaryGap is true - alignWithLabel: false, - interval: 'auto' - }, - axisLabel: { - interval: 'auto' - } - }, defaultOption); - var valueAxis = merge({ - boundaryGap: [0, 0], - axisLine: { - // Not shown when other axis is categoryAxis in cartesian - show: 'auto' - }, - axisTick: { - // Not shown when other axis is categoryAxis in cartesian - show: 'auto' - }, - // TODO - // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60] - splitNumber: 5, - minorTick: { - // Minor tick, not available for cateogry axis. - show: false, - // Split number of minor ticks. The value should be in range of (0, 100) - splitNumber: 5, - // Length of minor tick - length: 3, - // Line style - lineStyle: { - // Default to be same with axisTick - } - }, - minorSplitLine: { - show: false, - lineStyle: { - color: '#F4F7FD', - width: 1 - } - } - }, defaultOption); - var timeAxis = merge({ - splitNumber: 6, - axisLabel: { - // To eliminate labels that are not nice - showMinLabel: false, - showMaxLabel: false, - rich: { - primary: { - fontWeight: 'bold' - } - } - }, - splitLine: { - show: false - } - }, valueAxis); - var logAxis = defaults({ - logBase: 10 - }, valueAxis); - var axisDefault = { - category: categoryAxis, - value: valueAxis, - time: timeAxis, - log: logAxis - }; - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 AXIS_TYPES = { - value: 1, - category: 1, - time: 1, - log: 1 - }; - - /** - * Generate sub axis model class - * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ... - */ - function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) { - each(AXIS_TYPES, function (v, axisType) { - var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true); - var AxisModel = /** @class */function (_super) { - __extends(AxisModel, _super); - function AxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = axisName + 'Axis.' + axisType; - return _this; - } - AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { - var layoutMode = fetchLayoutMode(this); - var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; - var themeModel = ecModel.getTheme(); - merge(option, themeModel.get(axisType + 'Axis')); - merge(option, this.getDefaultOption()); - option.type = getAxisType(option); - if (layoutMode) { - mergeLayoutParam(option, inputPositionParams, layoutMode); - } - }; - AxisModel.prototype.optionUpdated = function () { - var thisOption = this.option; - if (thisOption.type === 'category') { - this.__ordinalMeta = OrdinalMeta.createByAxisModel(this); - } - }; - /** - * Should not be called before all of 'getInitailData' finished. - * Because categories are collected during initializing data. - */ - AxisModel.prototype.getCategories = function (rawData) { - var option = this.option; - // FIXME - // warning if called before all of 'getInitailData' finished. - if (option.type === 'category') { - if (rawData) { - return option.data; - } - return this.__ordinalMeta.categories; - } - }; - AxisModel.prototype.getOrdinalMeta = function () { - return this.__ordinalMeta; - }; - AxisModel.type = axisName + 'Axis.' + axisType; - AxisModel.defaultOption = defaultOption; - return AxisModel; - }(BaseAxisModelClass); - registers.registerComponentModel(AxisModel); - }); - registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType); - } - function getAxisType(option) { - // Default axis with data is category axis - return option.type || (option.data ? 'category' : 'value'); - } - - var Cartesian = /** @class */function () { - function Cartesian(name) { - this.type = 'cartesian'; - this._dimList = []; - this._axes = {}; - this.name = name || ''; - } - Cartesian.prototype.getAxis = function (dim) { - return this._axes[dim]; - }; - Cartesian.prototype.getAxes = function () { - return map(this._dimList, function (dim) { - return this._axes[dim]; - }, this); - }; - Cartesian.prototype.getAxesByScale = function (scaleType) { - scaleType = scaleType.toLowerCase(); - return filter(this.getAxes(), function (axis) { - return axis.scale.type === scaleType; - }); - }; - Cartesian.prototype.addAxis = function (axis) { - var dim = axis.dim; - this._axes[dim] = axis; - this._dimList.push(dim); - }; - return Cartesian; - }(); - - var cartesian2DDimensions = ['x', 'y']; - function canCalculateAffineTransform(scale) { - return scale.type === 'interval' || scale.type === 'time'; - } - var Cartesian2D = /** @class */function (_super) { - __extends(Cartesian2D, _super); - function Cartesian2D() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'cartesian2d'; - _this.dimensions = cartesian2DDimensions; - return _this; - } - /** - * Calculate an affine transform matrix if two axes are time or value. - * It's mainly for accelartion on the large time series data. - */ - Cartesian2D.prototype.calcAffineTransform = function () { - this._transform = this._invTransform = null; - var xAxisScale = this.getAxis('x').scale; - var yAxisScale = this.getAxis('y').scale; - if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) { - return; - } - var xScaleExtent = xAxisScale.getExtent(); - var yScaleExtent = yAxisScale.getExtent(); - var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]); - var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]); - var xScaleSpan = xScaleExtent[1] - xScaleExtent[0]; - var yScaleSpan = yScaleExtent[1] - yScaleExtent[0]; - if (!xScaleSpan || !yScaleSpan) { - return; - } - // Accelerate data to point calculation on the special large time series data. - var scaleX = (end[0] - start[0]) / xScaleSpan; - var scaleY = (end[1] - start[1]) / yScaleSpan; - var translateX = start[0] - xScaleExtent[0] * scaleX; - var translateY = start[1] - yScaleExtent[0] * scaleY; - var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY]; - this._invTransform = invert([], m); - }; - /** - * Base axis will be used on stacking. - */ - Cartesian2D.prototype.getBaseAxis = function () { - return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x'); - }; - Cartesian2D.prototype.containPoint = function (point) { - var axisX = this.getAxis('x'); - var axisY = this.getAxis('y'); - return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1])); - }; - Cartesian2D.prototype.containData = function (data) { - return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]); - }; - Cartesian2D.prototype.containZone = function (data1, data2) { - var zoneDiag1 = this.dataToPoint(data1); - var zoneDiag2 = this.dataToPoint(data2); - var area = this.getArea(); - var zone = new BoundingRect(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]); - return area.intersect(zone); - }; - Cartesian2D.prototype.dataToPoint = function (data, clamp, out) { - out = out || []; - var xVal = data[0]; - var yVal = data[1]; - // Fast path - if (this._transform - // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated. - && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) { - return applyTransform(out, data, this._transform); - } - var xAxis = this.getAxis('x'); - var yAxis = this.getAxis('y'); - out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp)); - out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp)); - return out; - }; - Cartesian2D.prototype.clampData = function (data, out) { - var xScale = this.getAxis('x').scale; - var yScale = this.getAxis('y').scale; - var xAxisExtent = xScale.getExtent(); - var yAxisExtent = yScale.getExtent(); - var x = xScale.parse(data[0]); - var y = yScale.parse(data[1]); - out = out || []; - out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1])); - out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1])); - return out; - }; - Cartesian2D.prototype.pointToData = function (point, clamp) { - var out = []; - if (this._invTransform) { - return applyTransform(out, point, this._invTransform); - } - var xAxis = this.getAxis('x'); - var yAxis = this.getAxis('y'); - out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp); - out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp); - return out; - }; - Cartesian2D.prototype.getOtherAxis = function (axis) { - return this.getAxis(axis.dim === 'x' ? 'y' : 'x'); - }; - /** - * Get rect area of cartesian. - * Area will have a contain function to determine if a point is in the coordinate system. - */ - Cartesian2D.prototype.getArea = function (tolerance) { - tolerance = tolerance || 0; - var xExtent = this.getAxis('x').getGlobalExtent(); - var yExtent = this.getAxis('y').getGlobalExtent(); - var x = Math.min(xExtent[0], xExtent[1]) - tolerance; - var y = Math.min(yExtent[0], yExtent[1]) - tolerance; - var width = Math.max(xExtent[0], xExtent[1]) - x + tolerance; - var height = Math.max(yExtent[0], yExtent[1]) - y + tolerance; - return new BoundingRect(x, y, width, height); - }; - return Cartesian2D; - }(Cartesian); - - var Axis2D = /** @class */function (_super) { - __extends(Axis2D, _super); - function Axis2D(dim, scale, coordExtent, axisType, position) { - var _this = _super.call(this, dim, scale, coordExtent) || this; - /** - * Index of axis, can be used as key - * Injected outside. - */ - _this.index = 0; - _this.type = axisType || 'value'; - _this.position = position || 'bottom'; - return _this; - } - Axis2D.prototype.isHorizontal = function () { - var position = this.position; - return position === 'top' || position === 'bottom'; - }; - /** - * Each item cooresponds to this.getExtent(), which - * means globalExtent[0] may greater than globalExtent[1], - * unless `asc` is input. - * - * @param {boolean} [asc] - * @return {Array.} - */ - Axis2D.prototype.getGlobalExtent = function (asc) { - var ret = this.getExtent(); - ret[0] = this.toGlobalCoord(ret[0]); - ret[1] = this.toGlobalCoord(ret[1]); - asc && ret[0] > ret[1] && ret.reverse(); - return ret; - }; - Axis2D.prototype.pointToData = function (point, clamp) { - return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp); - }; - /** - * Set ordinalSortInfo - * @param info new OrdinalSortInfo - */ - Axis2D.prototype.setCategorySortInfo = function (info) { - if (this.type !== 'category') { - return false; - } - this.model.option.categorySortInfo = info; - this.scale.setSortInfo(info); - }; - return Axis2D; - }(Axis); - - /** - * Can only be called after coordinate system creation stage. - * (Can be called before coordinate system update stage). - */ - function layout$1(gridModel, axisModel, opt) { - opt = opt || {}; - var grid = gridModel.coordinateSystem; - var axis = axisModel.axis; - var layout = {}; - var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0]; - var rawAxisPosition = axis.position; - var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition; - var axisDim = axis.dim; - var rect = grid.getRect(); - var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; - var idx = { - left: 0, - right: 1, - top: 0, - bottom: 1, - onZero: 2 - }; - var axisOffset = axisModel.get('offset') || 0; - var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset]; - if (otherAxisOnZeroOf) { - var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); - posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); - } - // Axis position - layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; - // Axis rotation - layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); - // Tick and label direction, x y is axisDim - var dirMap = { - top: -1, - bottom: 1, - left: -1, - right: 1 - }; - layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition]; - layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0; - if (axisModel.get(['axisTick', 'inside'])) { - layout.tickDirection = -layout.tickDirection; - } - if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) { - layout.labelDirection = -layout.labelDirection; - } - // Special label rotation - var labelRotate = axisModel.get(['axisLabel', 'rotate']); - layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; - // Over splitLine and splitArea - layout.z2 = 1; - return layout; - } - function isCartesian2DSeries(seriesModel) { - return seriesModel.get('coordinateSystem') === 'cartesian2d'; - } - function findAxisModels(seriesModel) { - var axisModelMap = { - xAxisModel: null, - yAxisModel: null - }; - each(axisModelMap, function (v, key) { - var axisType = key.replace(/Model$/, ''); - var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!axisModel) { - throw new Error(axisType + ' "' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '" not found'); - } - } - axisModelMap[key] = axisModel; - }); - return axisModelMap; - } - - var mathLog$1 = Math.log; - function alignScaleTicks(scale, axisModel, alignToScale) { - var intervalScaleProto = IntervalScale.prototype; - // NOTE: There is a precondition for log scale here: - // In log scale we store _interval and _extent of exponent value. - // So if we use the method of InternalScale to set/get these data. - // It process the exponent value, which is linear and what we want here. - var alignToTicks = intervalScaleProto.getTicks.call(alignToScale); - var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true); - var alignToSplitNumber = alignToTicks.length - 1; - var alignToInterval = intervalScaleProto.getInterval.call(alignToScale); - var scaleExtent = getScaleExtent(scale, axisModel); - var rawExtent = scaleExtent.extent; - var isMinFixed = scaleExtent.fixMin; - var isMaxFixed = scaleExtent.fixMax; - if (scale.type === 'log') { - var logBase = mathLog$1(scale.base); - rawExtent = [mathLog$1(rawExtent[0]) / logBase, mathLog$1(rawExtent[1]) / logBase]; - } - scale.setExtent(rawExtent[0], rawExtent[1]); - scale.calcNiceExtent({ - splitNumber: alignToSplitNumber, - fixMin: isMinFixed, - fixMax: isMaxFixed - }); - var extent = intervalScaleProto.getExtent.call(scale); - // Need to update the rawExtent. - // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax' - if (isMinFixed) { - rawExtent[0] = extent[0]; - } - if (isMaxFixed) { - rawExtent[1] = extent[1]; - } - var interval = intervalScaleProto.getInterval.call(scale); - var min = rawExtent[0]; - var max = rawExtent[1]; - if (isMinFixed && isMaxFixed) { - // User set min, max, divide to get new interval - interval = (max - min) / alignToSplitNumber; - } else if (isMinFixed) { - max = rawExtent[0] + interval * alignToSplitNumber; - // User set min, expand extent on the other side - while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) { - interval = increaseInterval(interval); - max = rawExtent[0] + interval * alignToSplitNumber; - } - } else if (isMaxFixed) { - // User set max, expand extent on the other side - min = rawExtent[1] - interval * alignToSplitNumber; - while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) { - interval = increaseInterval(interval); - min = rawExtent[1] - interval * alignToSplitNumber; - } - } else { - var nicedSplitNumber = scale.getTicks().length - 1; - if (nicedSplitNumber > alignToSplitNumber) { - interval = increaseInterval(interval); - } - var range = interval * alignToSplitNumber; - max = Math.ceil(rawExtent[1] / interval) * interval; - min = round(max - range); - // Not change the result that crossing zero. - if (min < 0 && rawExtent[0] >= 0) { - min = 0; - max = round(range); - } else if (max > 0 && rawExtent[1] <= 0) { - max = 0; - min = -round(range); - } - } - // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale - var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval; - var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval; - // NOTE: Must in setExtent -> setInterval -> setNiceExtent order. - intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1); - intervalScaleProto.setInterval.call(scale, interval); - if (t0 || t1) { - intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval); - } - if ("development" !== 'production') { - var ticks = intervalScaleProto.getTicks.call(scale); - if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) { - warn( - // eslint-disable-next-line - "The ticks may be not readable when set min: " + axisModel.get('min') + ", max: " + axisModel.get('max') + " and alignTicks: true"); - } - } - } - - var Grid = /** @class */function () { - function Grid(gridModel, ecModel, api) { - // FIXME:TS where used (different from registered type 'cartesian2d')? - this.type = 'grid'; - this._coordsMap = {}; - this._coordsList = []; - this._axesMap = {}; - this._axesList = []; - this.axisPointerEnabled = true; - this.dimensions = cartesian2DDimensions; - this._initCartesian(gridModel, ecModel, api); - this.model = gridModel; - } - Grid.prototype.getRect = function () { - return this._rect; - }; - Grid.prototype.update = function (ecModel, api) { - var axesMap = this._axesMap; - this._updateScale(ecModel, this.model); - function updateAxisTicks(axes) { - var alignTo; - // Axis is added in order of axisIndex. - var axesIndices = keys(axes); - var len = axesIndices.length; - if (!len) { - return; - } - var axisNeedsAlign = []; - // Process once and calculate the ticks for those don't use alignTicks. - for (var i = len - 1; i >= 0; i--) { - var idx = +axesIndices[i]; // Convert to number. - var axis = axes[idx]; - var model = axis.model; - var scale = axis.scale; - if ( - // Only value and log axis without interval support alignTicks. - isIntervalOrLogScale(scale) && model.get('alignTicks') && model.get('interval') == null) { - axisNeedsAlign.push(axis); - } else { - niceScaleExtent(scale, model); - if (isIntervalOrLogScale(scale)) { - // Can only align to interval or log axis. - alignTo = axis; - } - } - } - // All axes has set alignTicks. Pick the first one. - // PENDING. Should we find the axis that both set interval, min, max and align to this one? - if (axisNeedsAlign.length) { - if (!alignTo) { - alignTo = axisNeedsAlign.pop(); - niceScaleExtent(alignTo.scale, alignTo.model); - } - each(axisNeedsAlign, function (axis) { - alignScaleTicks(axis.scale, axis.model, alignTo.scale); - }); - } - } - updateAxisTicks(axesMap.x); - updateAxisTicks(axesMap.y); - // Key: axisDim_axisIndex, value: boolean, whether onZero target. - var onZeroRecords = {}; - each(axesMap.x, function (xAxis) { - fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords); - }); - each(axesMap.y, function (yAxis) { - fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords); - }); - // Resize again if containLabel is enabled - // FIXME It may cause getting wrong grid size in data processing stage - this.resize(this.model, api); - }; - /** - * Resize the grid - */ - Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) { - var boxLayoutParams = gridModel.getBoxLayoutParams(); - var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel'); - var gridRect = getLayoutRect(boxLayoutParams, { - width: api.getWidth(), - height: api.getHeight() - }); - this._rect = gridRect; - var axesList = this._axesList; - adjustAxes(); - // Minus label size - if (isContainLabel) { - each(axesList, function (axis) { - if (!axis.model.get(['axisLabel', 'inside'])) { - var labelUnionRect = estimateLabelUnionRect(axis); - if (labelUnionRect) { - var dim = axis.isHorizontal() ? 'height' : 'width'; - var margin = axis.model.get(['axisLabel', 'margin']); - gridRect[dim] -= labelUnionRect[dim] + margin; - if (axis.position === 'top') { - gridRect.y += labelUnionRect.height + margin; - } else if (axis.position === 'left') { - gridRect.x += labelUnionRect.width + margin; - } - } - } - }); - adjustAxes(); - } - each(this._coordsList, function (coord) { - // Calculate affine matrix to accelerate the data to point transform. - // If all the axes scales are time or value. - coord.calcAffineTransform(); - }); - function adjustAxes() { - each(axesList, function (axis) { - var isHorizontal = axis.isHorizontal(); - var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height]; - var idx = axis.inverse ? 1 : 0; - axis.setExtent(extent[idx], extent[1 - idx]); - updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y); - }); - } - }; - Grid.prototype.getAxis = function (dim, axisIndex) { - var axesMapOnDim = this._axesMap[dim]; - if (axesMapOnDim != null) { - return axesMapOnDim[axisIndex || 0]; - } - }; - Grid.prototype.getAxes = function () { - return this._axesList.slice(); - }; - Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) { - if (xAxisIndex != null && yAxisIndex != null) { - var key = 'x' + xAxisIndex + 'y' + yAxisIndex; - return this._coordsMap[key]; - } - if (isObject(xAxisIndex)) { - yAxisIndex = xAxisIndex.yAxisIndex; - xAxisIndex = xAxisIndex.xAxisIndex; - } - for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) { - if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) { - return coordList[i]; - } - } - }; - Grid.prototype.getCartesians = function () { - return this._coordsList.slice(); - }; - /** - * @implements - */ - Grid.prototype.convertToPixel = function (ecModel, finder, value) { - var target = this._findConvertTarget(finder); - return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null; - }; - /** - * @implements - */ - Grid.prototype.convertFromPixel = function (ecModel, finder, value) { - var target = this._findConvertTarget(finder); - return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null; - }; - Grid.prototype._findConvertTarget = function (finder) { - var seriesModel = finder.seriesModel; - var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]; - var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]; - var gridModel = finder.gridModel; - var coordsList = this._coordsList; - var cartesian; - var axis; - if (seriesModel) { - cartesian = seriesModel.coordinateSystem; - indexOf(coordsList, cartesian) < 0 && (cartesian = null); - } else if (xAxisModel && yAxisModel) { - cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); - } else if (xAxisModel) { - axis = this.getAxis('x', xAxisModel.componentIndex); - } else if (yAxisModel) { - axis = this.getAxis('y', yAxisModel.componentIndex); - } - // Lowest priority. - else if (gridModel) { - var grid = gridModel.coordinateSystem; - if (grid === this) { - cartesian = this._coordsList[0]; - } - } - return { - cartesian: cartesian, - axis: axis - }; - }; - /** - * @implements - */ - Grid.prototype.containPoint = function (point) { - var coord = this._coordsList[0]; - if (coord) { - return coord.containPoint(point); - } - }; - /** - * Initialize cartesian coordinate systems - */ - Grid.prototype._initCartesian = function (gridModel, ecModel, api) { - var _this = this; - var grid = this; - var axisPositionUsed = { - left: false, - right: false, - top: false, - bottom: false - }; - var axesMap = { - x: {}, - y: {} - }; - var axesCount = { - x: 0, - y: 0 - }; - // Create axis - ecModel.eachComponent('xAxis', createAxisCreator('x'), this); - ecModel.eachComponent('yAxis', createAxisCreator('y'), this); - if (!axesCount.x || !axesCount.y) { - // Roll back when there no either x or y axis - this._axesMap = {}; - this._axesList = []; - return; - } - this._axesMap = axesMap; - // Create cartesian2d - each(axesMap.x, function (xAxis, xAxisIndex) { - each(axesMap.y, function (yAxis, yAxisIndex) { - var key = 'x' + xAxisIndex + 'y' + yAxisIndex; - var cartesian = new Cartesian2D(key); - cartesian.master = _this; - cartesian.model = gridModel; - _this._coordsMap[key] = cartesian; - _this._coordsList.push(cartesian); - cartesian.addAxis(xAxis); - cartesian.addAxis(yAxis); - }); - }); - function createAxisCreator(dimName) { - return function (axisModel, idx) { - if (!isAxisUsedInTheGrid(axisModel, gridModel)) { - return; - } - var axisPosition = axisModel.get('position'); - if (dimName === 'x') { - // Fix position - if (axisPosition !== 'top' && axisPosition !== 'bottom') { - // Default bottom of X - axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom'; - } - } else { - // Fix position - if (axisPosition !== 'left' && axisPosition !== 'right') { - // Default left of Y - axisPosition = axisPositionUsed.left ? 'right' : 'left'; - } - } - axisPositionUsed[axisPosition] = true; - var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition); - var isCategory = axis.type === 'category'; - axis.onBand = isCategory && axisModel.get('boundaryGap'); - axis.inverse = axisModel.get('inverse'); - // Inject axis into axisModel - axisModel.axis = axis; - // Inject axisModel into axis - axis.model = axisModel; - // Inject grid info axis - axis.grid = grid; - // Index of axis, can be used as key - axis.index = idx; - grid._axesList.push(axis); - axesMap[dimName][idx] = axis; - axesCount[dimName]++; - }; - } - }; - /** - * Update cartesian properties from series. - */ - Grid.prototype._updateScale = function (ecModel, gridModel) { - // Reset scale - each(this._axesList, function (axis) { - axis.scale.setExtent(Infinity, -Infinity); - if (axis.type === 'category') { - var categorySortInfo = axis.model.get('categorySortInfo'); - axis.scale.setSortInfo(categorySortInfo); - } - }); - ecModel.eachSeries(function (seriesModel) { - if (isCartesian2DSeries(seriesModel)) { - var axesModelMap = findAxisModels(seriesModel); - var xAxisModel = axesModelMap.xAxisModel; - var yAxisModel = axesModelMap.yAxisModel; - if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) { - return; - } - var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); - var data = seriesModel.getData(); - var xAxis = cartesian.getAxis('x'); - var yAxis = cartesian.getAxis('y'); - unionExtent(data, xAxis); - unionExtent(data, yAxis); - } - }, this); - function unionExtent(data, axis) { - each(getDataDimensionsOnAxis(data, axis.dim), function (dim) { - axis.scale.unionExtentFromData(data, dim); - }); - } - }; - /** - * @param dim 'x' or 'y' or 'auto' or null/undefined - */ - Grid.prototype.getTooltipAxes = function (dim) { - var baseAxes = []; - var otherAxes = []; - each(this.getCartesians(), function (cartesian) { - var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis(); - var otherAxis = cartesian.getOtherAxis(baseAxis); - indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis); - indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis); - }); - return { - baseAxes: baseAxes, - otherAxes: otherAxes - }; - }; - Grid.create = function (ecModel, api) { - var grids = []; - ecModel.eachComponent('grid', function (gridModel, idx) { - var grid = new Grid(gridModel, ecModel, api); - grid.name = 'grid_' + idx; - // dataSampling requires axis extent, so resize - // should be performed in create stage. - grid.resize(gridModel, api, true); - gridModel.coordinateSystem = grid; - grids.push(grid); - }); - // Inject the coordinateSystems into seriesModel - ecModel.eachSeries(function (seriesModel) { - if (!isCartesian2DSeries(seriesModel)) { - return; - } - var axesModelMap = findAxisModels(seriesModel); - var xAxisModel = axesModelMap.xAxisModel; - var yAxisModel = axesModelMap.yAxisModel; - var gridModel = xAxisModel.getCoordSysModel(); - if ("development" !== 'production') { - if (!gridModel) { - throw new Error('Grid "' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '" not found'); - } - if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) { - throw new Error('xAxis and yAxis must use the same grid'); - } - } - var grid = gridModel.coordinateSystem; - seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); - }); - return grids; - }; - // For deciding which dimensions to use when creating list data - Grid.dimensions = cartesian2DDimensions; - return Grid; - }(); - /** - * Check if the axis is used in the specified grid. - */ - function isAxisUsedInTheGrid(axisModel, gridModel) { - return axisModel.getCoordSysModel() === gridModel; - } - function fixAxisOnZero(axesMap, otherAxisDim, axis, - // Key: see `getOnZeroRecordKey` - onZeroRecords) { - axis.getAxesOnZeroOf = function () { - // TODO: onZero of multiple axes. - return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : []; - }; - // onZero can not be enabled in these two situations: - // 1. When any other axis is a category axis. - // 2. When no axis is cross 0 point. - var otherAxes = axesMap[otherAxisDim]; - var otherAxisOnZeroOf; - var axisModel = axis.model; - var onZero = axisModel.get(['axisLine', 'onZero']); - var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']); - if (!onZero) { - return; - } - // If target axis is specified. - if (onZeroAxisIndex != null) { - if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) { - otherAxisOnZeroOf = otherAxes[onZeroAxisIndex]; - } - } else { - // Find the first available other axis. - for (var idx in otherAxes) { - if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) - // Consider that two Y axes on one value axis, - // if both onZero, the two Y axes overlap. - && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) { - otherAxisOnZeroOf = otherAxes[idx]; - break; - } - } - } - if (otherAxisOnZeroOf) { - onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true; - } - function getOnZeroRecordKey(axis) { - return axis.dim + '_' + axis.index; - } - } - function canOnZeroToAxis(axis) { - return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis); - } - function updateAxisTransform(axis, coordBase) { - var axisExtent = axis.getExtent(); - var axisExtentSum = axisExtent[0] + axisExtent[1]; - // Fast transform - axis.toGlobalCoord = axis.dim === 'x' ? function (coord) { - return coord + coordBase; - } : function (coord) { - return axisExtentSum - coord + coordBase; - }; - axis.toLocalCoord = axis.dim === 'x' ? function (coord) { - return coord - coordBase; - } : function (coord) { - return axisExtentSum - coord + coordBase; - }; - } - - var PI$5 = Math.PI; - /** - * A final axis is translated and rotated from a "standard axis". - * So opt.position and opt.rotation is required. - * - * A standard axis is and axis from [0, 0] to [0, axisExtent[1]], - * for example: (0, 0) ------------> (0, 50) - * - * nameDirection or tickDirection or labelDirection is 1 means tick - * or label is below the standard axis, whereas is -1 means above - * the standard axis. labelOffset means offset between label and axis, - * which is useful when 'onZero', where axisLabel is in the grid and - * label in outside grid. - * - * Tips: like always, - * positive rotation represents anticlockwise, and negative rotation - * represents clockwise. - * The direction of position coordinate is the same as the direction - * of screen coordinate. - * - * Do not need to consider axis 'inverse', which is auto processed by - * axis extent. - */ - var AxisBuilder = /** @class */function () { - function AxisBuilder(axisModel, opt) { - this.group = new Group(); - this.opt = opt; - this.axisModel = axisModel; - // Default value - defaults(opt, { - labelOffset: 0, - nameDirection: 1, - tickDirection: 1, - labelDirection: 1, - silent: true, - handleAutoShown: function () { - return true; - } - }); - // FIXME Not use a separate text group? - var transformGroup = new Group({ - x: opt.position[0], - y: opt.position[1], - rotation: opt.rotation - }); - // this.group.add(transformGroup); - // this._transformGroup = transformGroup; - transformGroup.updateTransform(); - this._transformGroup = transformGroup; - } - AxisBuilder.prototype.hasBuilder = function (name) { - return !!builders[name]; - }; - AxisBuilder.prototype.add = function (name) { - builders[name](this.opt, this.axisModel, this.group, this._transformGroup); - }; - AxisBuilder.prototype.getGroup = function () { - return this.group; - }; - AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) { - var rotationDiff = remRadian(textRotation - axisRotation); - var textAlign; - var textVerticalAlign; - if (isRadianAroundZero(rotationDiff)) { - // Label is parallel with axis line. - textVerticalAlign = direction > 0 ? 'top' : 'bottom'; - textAlign = 'center'; - } else if (isRadianAroundZero(rotationDiff - PI$5)) { - // Label is inverse parallel with axis line. - textVerticalAlign = direction > 0 ? 'bottom' : 'top'; - textAlign = 'center'; - } else { - textVerticalAlign = 'middle'; - if (rotationDiff > 0 && rotationDiff < PI$5) { - textAlign = direction > 0 ? 'right' : 'left'; - } else { - textAlign = direction > 0 ? 'left' : 'right'; - } - } - return { - rotation: rotationDiff, - textAlign: textAlign, - textVerticalAlign: textVerticalAlign - }; - }; - AxisBuilder.makeAxisEventDataBase = function (axisModel) { - var eventData = { - componentType: axisModel.mainType, - componentIndex: axisModel.componentIndex - }; - eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex; - return eventData; - }; - AxisBuilder.isLabelSilent = function (axisModel) { - var tooltipOpt = axisModel.get('tooltip'); - return axisModel.get('silent') - // Consider mouse cursor, add these restrictions. - || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show); - }; - return AxisBuilder; - }(); - var builders = { - axisLine: function (opt, axisModel, group, transformGroup) { - var shown = axisModel.get(['axisLine', 'show']); - if (shown === 'auto' && opt.handleAutoShown) { - shown = opt.handleAutoShown('axisLine'); - } - if (!shown) { - return; - } - var extent = axisModel.axis.getExtent(); - var matrix = transformGroup.transform; - var pt1 = [extent[0], 0]; - var pt2 = [extent[1], 0]; - var inverse = pt1[0] > pt2[0]; - if (matrix) { - applyTransform(pt1, pt1, matrix); - applyTransform(pt2, pt2, matrix); - } - var lineStyle = extend({ - lineCap: 'round' - }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle()); - var line = new Line({ - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, - style: lineStyle, - strokeContainThreshold: opt.strokeContainThreshold || 5, - silent: true, - z2: 1 - }); - subPixelOptimizeLine$1(line.shape, line.style.lineWidth); - line.anid = 'line'; - group.add(line); - var arrows = axisModel.get(['axisLine', 'symbol']); - if (arrows != null) { - var arrowSize = axisModel.get(['axisLine', 'symbolSize']); - if (isString(arrows)) { - // Use the same arrow for start and end point - arrows = [arrows, arrows]; - } - if (isString(arrowSize) || isNumber(arrowSize)) { - // Use the same size for width and height - arrowSize = [arrowSize, arrowSize]; - } - var arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize); - var symbolWidth_1 = arrowSize[0]; - var symbolHeight_1 = arrowSize[1]; - each([{ - rotate: opt.rotation + Math.PI / 2, - offset: arrowOffset[0], - r: 0 - }, { - rotate: opt.rotation - Math.PI / 2, - offset: arrowOffset[1], - r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1])) - }], function (point, index) { - if (arrows[index] !== 'none' && arrows[index] != null) { - var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true); - // Calculate arrow position with offset - var r = point.r + point.offset; - var pt = inverse ? pt2 : pt1; - symbol.attr({ - rotation: point.rotate, - x: pt[0] + r * Math.cos(opt.rotation), - y: pt[1] - r * Math.sin(opt.rotation), - silent: true, - z2: 11 - }); - group.add(symbol); - } - }); - } - }, - axisTickLabel: function (opt, axisModel, group, transformGroup) { - var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt); - var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt); - fixMinMaxLabelShow(axisModel, labelEls, ticksEls); - buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection); - // This bit fixes the label overlap issue for the time chart. - // See https://github.com/apache/echarts/issues/14266 for more. - if (axisModel.get(['axisLabel', 'hideOverlap'])) { - var labelList = prepareLayoutList(map(labelEls, function (label) { - return { - label: label, - priority: label.z2, - defaultAttr: { - ignore: label.ignore - } - }; - })); - hideOverlap(labelList); - } - }, - axisName: function (opt, axisModel, group, transformGroup) { - var name = retrieve(opt.axisName, axisModel.get('name')); - if (!name) { - return; - } - var nameLocation = axisModel.get('nameLocation'); - var nameDirection = opt.nameDirection; - var textStyleModel = axisModel.getModel('nameTextStyle'); - var gap = axisModel.get('nameGap') || 0; - var extent = axisModel.axis.getExtent(); - var gapSignal = extent[0] > extent[1] ? -1 : 1; - var pos = [nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2, - // Reuse labelOffset. - isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0]; - var labelLayout; - var nameRotation = axisModel.get('nameRotate'); - if (nameRotation != null) { - nameRotation = nameRotation * PI$5 / 180; // To radian. - } - - var axisNameAvailableWidth; - if (isNameLocationCenter(nameLocation)) { - labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, - // Adapt to axis. - nameDirection); - } else { - labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent); - axisNameAvailableWidth = opt.axisNameAvailableWidth; - if (axisNameAvailableWidth != null) { - axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation)); - !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null); - } - } - var textFont = textStyleModel.getFont(); - var truncateOpt = axisModel.get('nameTruncate', true) || {}; - var ellipsis = truncateOpt.ellipsis; - var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth); - var textEl = new ZRText({ - x: pos[0], - y: pos[1], - rotation: labelLayout.rotation, - silent: AxisBuilder.isLabelSilent(axisModel), - style: createTextStyle(textStyleModel, { - text: name, - font: textFont, - overflow: 'truncate', - width: maxWidth, - ellipsis: ellipsis, - fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']), - align: textStyleModel.get('align') || labelLayout.textAlign, - verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign - }), - z2: 1 - }); - setTooltipConfig({ - el: textEl, - componentModel: axisModel, - itemName: name - }); - textEl.__fullText = name; - // Id for animation - textEl.anid = 'name'; - if (axisModel.get('triggerEvent')) { - var eventData = AxisBuilder.makeAxisEventDataBase(axisModel); - eventData.targetType = 'axisName'; - eventData.name = name; - getECData(textEl).eventData = eventData; - } - // FIXME - transformGroup.add(textEl); - textEl.updateTransform(); - group.add(textEl); - textEl.decomposeTransform(); - } - }; - function endTextLayout(rotation, textPosition, textRotate, extent) { - var rotationDiff = remRadian(textRotate - rotation); - var textAlign; - var textVerticalAlign; - var inverse = extent[0] > extent[1]; - var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse; - if (isRadianAroundZero(rotationDiff - PI$5 / 2)) { - textVerticalAlign = onLeft ? 'bottom' : 'top'; - textAlign = 'center'; - } else if (isRadianAroundZero(rotationDiff - PI$5 * 1.5)) { - textVerticalAlign = onLeft ? 'top' : 'bottom'; - textAlign = 'center'; - } else { - textVerticalAlign = 'middle'; - if (rotationDiff < PI$5 * 1.5 && rotationDiff > PI$5 / 2) { - textAlign = onLeft ? 'left' : 'right'; - } else { - textAlign = onLeft ? 'right' : 'left'; - } - } - return { - rotation: rotationDiff, - textAlign: textAlign, - textVerticalAlign: textVerticalAlign - }; - } - function fixMinMaxLabelShow(axisModel, labelEls, tickEls) { - if (shouldShowAllLabels(axisModel.axis)) { - return; - } - // If min or max are user set, we need to check - // If the tick on min(max) are overlap on their neighbour tick - // If they are overlapped, we need to hide the min(max) tick label - var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']); - var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']); - // FIXME - // Have not consider onBand yet, where tick els is more than label els. - labelEls = labelEls || []; - tickEls = tickEls || []; - var firstLabel = labelEls[0]; - var nextLabel = labelEls[1]; - var lastLabel = labelEls[labelEls.length - 1]; - var prevLabel = labelEls[labelEls.length - 2]; - var firstTick = tickEls[0]; - var nextTick = tickEls[1]; - var lastTick = tickEls[tickEls.length - 1]; - var prevTick = tickEls[tickEls.length - 2]; - if (showMinLabel === false) { - ignoreEl(firstLabel); - ignoreEl(firstTick); - } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) { - if (showMinLabel) { - ignoreEl(nextLabel); - ignoreEl(nextTick); - } else { - ignoreEl(firstLabel); - ignoreEl(firstTick); - } - } - if (showMaxLabel === false) { - ignoreEl(lastLabel); - ignoreEl(lastTick); - } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) { - if (showMaxLabel) { - ignoreEl(prevLabel); - ignoreEl(prevTick); - } else { - ignoreEl(lastLabel); - ignoreEl(lastTick); - } - } - } - function ignoreEl(el) { - el && (el.ignore = true); - } - function isTwoLabelOverlapped(current, next) { - // current and next has the same rotation. - var firstRect = current && current.getBoundingRect().clone(); - var nextRect = next && next.getBoundingRect().clone(); - if (!firstRect || !nextRect) { - return; - } - // When checking intersect of two rotated labels, we use mRotationBack - // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`. - var mRotationBack = identity([]); - rotate(mRotationBack, mRotationBack, -current.rotation); - firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform())); - nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform())); - return firstRect.intersect(nextRect); - } - function isNameLocationCenter(nameLocation) { - return nameLocation === 'middle' || nameLocation === 'center'; - } - function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) { - var tickEls = []; - var pt1 = []; - var pt2 = []; - for (var i = 0; i < ticksCoords.length; i++) { - var tickCoord = ticksCoords[i].coord; - pt1[0] = tickCoord; - pt1[1] = 0; - pt2[0] = tickCoord; - pt2[1] = tickEndCoord; - if (tickTransform) { - applyTransform(pt1, pt1, tickTransform); - applyTransform(pt2, pt2, tickTransform); - } - // Tick line, Not use group transform to have better line draw - var tickEl = new Line({ - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, - style: tickLineStyle, - z2: 2, - autoBatch: true, - silent: true - }); - subPixelOptimizeLine$1(tickEl.shape, tickEl.style.lineWidth); - tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue; - tickEls.push(tickEl); - } - return tickEls; - } - function buildAxisMajorTicks(group, transformGroup, axisModel, opt) { - var axis = axisModel.axis; - var tickModel = axisModel.getModel('axisTick'); - var shown = tickModel.get('show'); - if (shown === 'auto' && opt.handleAutoShown) { - shown = opt.handleAutoShown('axisTick'); - } - if (!shown || axis.scale.isBlank()) { - return; - } - var lineStyleModel = tickModel.getModel('lineStyle'); - var tickEndCoord = opt.tickDirection * tickModel.get('length'); - var ticksCoords = axis.getTicksCoords(); - var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), { - stroke: axisModel.get(['axisLine', 'lineStyle', 'color']) - }), 'ticks'); - for (var i = 0; i < ticksEls.length; i++) { - group.add(ticksEls[i]); - } - return ticksEls; - } - function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) { - var axis = axisModel.axis; - var minorTickModel = axisModel.getModel('minorTick'); - if (!minorTickModel.get('show') || axis.scale.isBlank()) { - return; - } - var minorTicksCoords = axis.getMinorTicksCoords(); - if (!minorTicksCoords.length) { - return; - } - var lineStyleModel = minorTickModel.getModel('lineStyle'); - var tickEndCoord = tickDirection * minorTickModel.get('length'); - var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), { - stroke: axisModel.get(['axisLine', 'lineStyle', 'color']) - })); - for (var i = 0; i < minorTicksCoords.length; i++) { - var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i); - for (var k = 0; k < minorTicksEls.length; k++) { - group.add(minorTicksEls[k]); - } - } - } - function buildAxisLabel(group, transformGroup, axisModel, opt) { - var axis = axisModel.axis; - var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show'])); - if (!show || axis.scale.isBlank()) { - return; - } - var labelModel = axisModel.getModel('axisLabel'); - var labelMargin = labelModel.get('margin'); - var labels = axis.getViewLabels(); - // Special label rotate. - var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$5 / 180; - var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection); - var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true); - var labelEls = []; - var silent = AxisBuilder.isLabelSilent(axisModel); - var triggerEvent = axisModel.get('triggerEvent'); - each(labels, function (labelItem, index) { - var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; - var formattedLabel = labelItem.formattedLabel; - var rawLabel = labelItem.rawLabel; - var itemLabelModel = labelModel; - if (rawCategoryData && rawCategoryData[tickValue]) { - var rawCategoryItem = rawCategoryData[tickValue]; - if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { - itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel); - } - } - var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']); - var tickCoord = axis.dataToCoord(tickValue); - var align = itemLabelModel.getShallow('align', true) || labelLayout.textAlign; - var alignMin = retrieve2(itemLabelModel.getShallow('alignMinLabel', true), align); - var alignMax = retrieve2(itemLabelModel.getShallow('alignMaxLabel', true), align); - var verticalAlign = itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign; - var verticalAlignMin = retrieve2(itemLabelModel.getShallow('verticalAlignMinLabel', true), verticalAlign); - var verticalAlignMax = retrieve2(itemLabelModel.getShallow('verticalAlignMaxLabel', true), verticalAlign); - var textEl = new ZRText({ - x: tickCoord, - y: opt.labelOffset + opt.labelDirection * labelMargin, - rotation: labelLayout.rotation, - silent: silent, - z2: 10 + (labelItem.level || 0), - style: createTextStyle(itemLabelModel, { - text: formattedLabel, - align: index === 0 ? alignMin : index === labels.length - 1 ? alignMax : align, - verticalAlign: index === 0 ? verticalAlignMin : index === labels.length - 1 ? verticalAlignMax : verticalAlign, - fill: isFunction(textColor) ? textColor( - // (1) 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. - // (2) Compatible with previous version, which always use formatted label as - // input. But in interval scale the formatted label is like '223,445', which - // maked user replace ','. So we modify it to return original val but remain - // it as 'string' to avoid error in replacing. - axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor - }) - }); - textEl.anid = 'label_' + tickValue; - // Pack data for mouse event - if (triggerEvent) { - var eventData = AxisBuilder.makeAxisEventDataBase(axisModel); - eventData.targetType = 'axisLabel'; - eventData.value = rawLabel; - eventData.tickIndex = index; - if (axis.type === 'category') { - eventData.dataIndex = tickValue; - } - getECData(textEl).eventData = eventData; - } - // FIXME - transformGroup.add(textEl); - textEl.updateTransform(); - labelEls.push(textEl); - group.add(textEl); - textEl.decomposeTransform(); - }); - return labelEls; - } - - // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. - // allAxesInfo should be updated when setOption performed. - function collect(ecModel, api) { - var result = { - /** - * key: makeKey(axis.model) - * value: { - * axis, - * coordSys, - * axisPointerModel, - * triggerTooltip, - * triggerEmphasis, - * involveSeries, - * snap, - * seriesModels, - * seriesDataCount - * } - */ - axesInfo: {}, - seriesInvolved: false, - /** - * key: makeKey(coordSys.model) - * value: Object: key makeKey(axis.model), value: axisInfo - */ - coordSysAxesInfo: {}, - coordSysMap: {} - }; - collectAxesInfo(result, ecModel, api); - // Check seriesInvolved for performance, in case too many series in some chart. - result.seriesInvolved && collectSeriesInfo(result, ecModel); - return result; - } - function collectAxesInfo(result, ecModel, api) { - var globalTooltipModel = ecModel.getComponent('tooltip'); - var globalAxisPointerModel = ecModel.getComponent('axisPointer'); - // links can only be set on global. - var linksOption = globalAxisPointerModel.get('link', true) || []; - var linkGroups = []; - // Collect axes info. - each(api.getCoordinateSystems(), function (coordSys) { - // Some coordinate system do not support axes, like geo. - if (!coordSys.axisPointerEnabled) { - return; - } - var coordSysKey = makeKey(coordSys.model); - var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {}; - result.coordSysMap[coordSysKey] = coordSys; - // Set tooltip (like 'cross') is a convenient way to show axisPointer - // for user. So we enable setting tooltip on coordSys model. - var coordSysModel = coordSys.model; - var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel); - each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); - // If axis tooltip used, choose tooltip axis for each coordSys. - // Notice this case: coordSys is `grid` but not `cartesian2D` here. - if (coordSys.getTooltipAxes && globalTooltipModel - // If tooltip.showContent is set as false, tooltip will not - // show but axisPointer will show as normal. - && baseTooltipModel.get('show')) { - // Compatible with previous logic. But series.tooltip.trigger: 'axis' - // or series.data[n].tooltip.trigger: 'axis' are not support any more. - var triggerAxis = baseTooltipModel.get('trigger') === 'axis'; - var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross'; - var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis'])); - if (triggerAxis || cross) { - each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis)); - } - if (cross) { - each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false)); - } - } - // fromTooltip: true | false | 'cross' - // triggerTooltip: true | false | null - function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { - var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); - var axisPointerShow = axisPointerModel.get('show'); - if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) { - return; - } - if (triggerTooltip == null) { - triggerTooltip = axisPointerModel.get('triggerTooltip'); - } - axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel; - var snap = axisPointerModel.get('snap'); - var triggerEmphasis = axisPointerModel.get('triggerEmphasis'); - var axisKey = makeKey(axis.model); - var involveSeries = triggerTooltip || snap || axis.type === 'category'; - // If result.axesInfo[key] exist, override it (tooltip has higher priority). - var axisInfo = result.axesInfo[axisKey] = { - key: axisKey, - axis: axis, - coordSys: coordSys, - axisPointerModel: axisPointerModel, - triggerTooltip: triggerTooltip, - triggerEmphasis: triggerEmphasis, - involveSeries: involveSeries, - snap: snap, - useHandle: isHandleTrigger(axisPointerModel), - seriesModels: [], - linkGroup: null - }; - axesInfoInCoordSys[axisKey] = axisInfo; - result.seriesInvolved = result.seriesInvolved || involveSeries; - var groupIndex = getLinkGroupIndex(linksOption, axis); - if (groupIndex != null) { - var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { - axesInfo: {} - }); - linkGroup.axesInfo[axisKey] = axisInfo; - linkGroup.mapper = linksOption[groupIndex].mapper; - axisInfo.linkGroup = linkGroup; - } - } - }); - } - function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) { - var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer'); - var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z']; - var volatileOption = {}; - each(fields, function (field) { - volatileOption[field] = clone(tooltipAxisPointerModel.get(field)); - }); - // category axis do not auto snap, otherwise some tick that do not - // has value can not be hovered. value/time/log axis default snap if - // triggered from tooltip and trigger tooltip. - volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; - // Compatible with previous behavior, tooltip axis does not show label by default. - // Only these properties can be overridden from tooltip to axisPointer. - if (tooltipAxisPointerModel.get('type') === 'cross') { - volatileOption.type = 'line'; - } - var labelOption = volatileOption.label || (volatileOption.label = {}); - // Follow the convention, do not show label when triggered by tooltip by default. - labelOption.show == null && (labelOption.show = false); - if (fromTooltip === 'cross') { - // When 'cross', both axes show labels. - var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']); - labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; - // If triggerTooltip, this is a base axis, which should better not use cross style - // (cross style is dashed by default) - if (!triggerTooltip) { - var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle'); - crossStyle && defaults(labelOption, crossStyle.textStyle); - } - } - return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel)); - } - function collectSeriesInfo(result, ecModel) { - // Prepare data for axis trigger - ecModel.eachSeries(function (seriesModel) { - // Notice this case: this coordSys is `cartesian2D` but not `grid`. - var coordSys = seriesModel.coordinateSystem; - var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true); - var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true); - if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) { - return; - } - each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) { - var axis = axisInfo.axis; - if (coordSys.getAxis(axis.dim) === axis) { - axisInfo.seriesModels.push(seriesModel); - axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0); - axisInfo.seriesDataCount += seriesModel.getData().count(); - } - }); - }); - } - /** - * For example: - * { - * axisPointer: { - * links: [{ - * xAxisIndex: [2, 4], - * yAxisIndex: 'all' - * }, { - * xAxisId: ['a5', 'a7'], - * xAxisName: 'xxx' - * }] - * } - * } - */ - function getLinkGroupIndex(linksOption, axis) { - var axisModel = axis.model; - var dim = axis.dim; - for (var i = 0; i < linksOption.length; i++) { - var linkOption = linksOption[i] || {}; - if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) { - return i; - } - } - } - function checkPropInLink(linkPropValue, axisPropValue) { - return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue; - } - function fixValue(axisModel) { - var axisInfo = getAxisInfo(axisModel); - if (!axisInfo) { - return; - } - var axisPointerModel = axisInfo.axisPointerModel; - var scale = axisInfo.axis.scale; - var option = axisPointerModel.option; - var status = axisPointerModel.get('status'); - var value = axisPointerModel.get('value'); - // Parse init value for category and time axis. - if (value != null) { - value = scale.parse(value); - } - var useHandle = isHandleTrigger(axisPointerModel); - // If `handle` used, `axisPointer` will always be displayed, so value - // and status should be initialized. - if (status == null) { - option.status = useHandle ? 'show' : 'hide'; - } - var extent = scale.getExtent().slice(); - extent[0] > extent[1] && extent.reverse(); - if ( - // Pick a value on axis when initializing. - value == null - // If both `handle` and `dataZoom` are used, value may be out of axis extent, - // where we should re-pick a value to keep `handle` displaying normally. - || value > extent[1]) { - // Make handle displayed on the end of the axis when init, which looks better. - value = extent[1]; - } - if (value < extent[0]) { - value = extent[0]; - } - option.value = value; - if (useHandle) { - option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show'; - } - } - function getAxisInfo(axisModel) { - var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo; - return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)]; - } - function getAxisPointerModel(axisModel) { - var axisInfo = getAxisInfo(axisModel); - return axisInfo && axisInfo.axisPointerModel; - } - function isHandleTrigger(axisPointerModel) { - return !!axisPointerModel.get(['handle', 'show']); - } - /** - * @param {module:echarts/model/Model} model - * @return {string} unique key - */ - function makeKey(model) { - return model.type + '||' + model.id; - } - - var axisPointerClazz = {}; - /** - * Base class of AxisView. - */ - var AxisView = /** @class */function (_super) { - __extends(AxisView, _super); - function AxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AxisView.type; - return _this; - } - /** - * @override - */ - AxisView.prototype.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 && fixValue(axisModel); - _super.prototype.render.apply(this, arguments); - this._doUpdateAxisPointerClass(axisModel, api, true); - }; - /** - * Action handler. - */ - AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) { - this._doUpdateAxisPointerClass(axisModel, api, false); - }; - /** - * @override - */ - AxisView.prototype.remove = function (ecModel, api) { - var axisPointer = this._axisPointer; - axisPointer && axisPointer.remove(api); - }; - /** - * @override - */ - AxisView.prototype.dispose = function (ecModel, api) { - this._disposeAxisPointer(api); - _super.prototype.dispose.apply(this, arguments); - }; - AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) { - var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass); - if (!Clazz) { - return; - } - var axisPointerModel = getAxisPointerModel(axisModel); - axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api); - }; - AxisView.prototype._disposeAxisPointer = function (api) { - this._axisPointer && this._axisPointer.dispose(api); - this._axisPointer = null; - }; - AxisView.registerAxisPointerClass = function (type, clazz) { - if ("development" !== 'production') { - if (axisPointerClazz[type]) { - throw new Error('axisPointer ' + type + ' exists'); - } - } - axisPointerClazz[type] = clazz; - }; - AxisView.getAxisPointerClass = function (type) { - return type && axisPointerClazz[type]; - }; - AxisView.type = 'axis'; - return AxisView; - }(ComponentView); - - var inner$6 = makeInner(); - function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) { - var axis = axisModel.axis; - if (axis.scale.isBlank()) { - return; - } - // TODO: TYPE - var splitAreaModel = axisModel.getModel('splitArea'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var areaColors = areaStyleModel.get('color'); - var gridRect = gridModel.coordinateSystem.getRect(); - var ticksCoords = axis.getTicksCoords({ - tickModel: splitAreaModel, - clamp: true - }); - if (!ticksCoords.length) { - return; - } - // For Making appropriate splitArea animation, the color and anid - // should be corresponding to previous one if possible. - var areaColorsLen = areaColors.length; - var lastSplitAreaColors = inner$6(axisView).splitAreaColors; - var newSplitAreaColors = createHashMap(); - var colorIndex = 0; - if (lastSplitAreaColors) { - for (var i = 0; i < ticksCoords.length; i++) { - var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); - if (cIndex != null) { - colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; - break; - } - } - } - var prev = axis.toGlobalCoord(ticksCoords[0].coord); - var areaStyle = areaStyleModel.getAreaStyle(); - areaColors = isArray(areaColors) ? areaColors : [areaColors]; - for (var i = 1; i < ticksCoords.length; i++) { - var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); - var x = void 0; - var y = void 0; - var width = void 0; - var height = void 0; - if (axis.isHorizontal()) { - x = prev; - y = gridRect.y; - width = tickCoord - x; - height = gridRect.height; - prev = x + width; - } else { - x = gridRect.x; - y = prev; - width = gridRect.width; - height = tickCoord - y; - prev = y + height; - } - var tickValue = ticksCoords[i - 1].tickValue; - tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); - axisGroup.add(new Rect({ - anid: tickValue != null ? 'area_' + tickValue : null, - shape: { - x: x, - y: y, - width: width, - height: height - }, - style: defaults({ - fill: areaColors[colorIndex] - }, areaStyle), - autoBatch: true, - silent: true - })); - colorIndex = (colorIndex + 1) % areaColorsLen; - } - inner$6(axisView).splitAreaColors = newSplitAreaColors; - } - function rectCoordAxisHandleRemove(axisView) { - inner$6(axisView).splitAreaColors = null; - } - - var axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName']; - var selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine']; - var CartesianAxisView = /** @class */function (_super) { - __extends(CartesianAxisView, _super); - function CartesianAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CartesianAxisView.type; - _this.axisPointerClass = 'CartesianAxisPointer'; - return _this; - } - /** - * @override - */ - CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) { - this.group.removeAll(); - var oldAxisGroup = this._axisGroup; - this._axisGroup = new Group(); - this.group.add(this._axisGroup); - if (!axisModel.get('show')) { - return; - } - var gridModel = axisModel.getCoordSysModel(); - var layout = layout$1(gridModel, axisModel); - var axisBuilder = new AxisBuilder(axisModel, extend({ - handleAutoShown: function (elementType) { - var cartesians = gridModel.coordinateSystem.getCartesians(); - for (var i = 0; i < cartesians.length; i++) { - if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) { - // Still show axis tick or axisLine if other axis is value / log - return true; - } - } - // Not show axisTick or axisLine if other axis is category / time - return false; - } - }, layout)); - each(axisBuilderAttrs, axisBuilder.add, axisBuilder); - this._axisGroup.add(axisBuilder.getGroup()); - each(selfBuilderAttrs, function (name) { - if (axisModel.get([name, 'show'])) { - axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel); - } - }, this); - // THIS is a special case for bar racing chart. - // Update the axis label from the natural initial layout to - // sorted layout should has no animation. - var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort; - if (!isInitialSortFromBarRacing) { - groupTransition(oldAxisGroup, this._axisGroup, axisModel); - } - _super.prototype.render.call(this, axisModel, ecModel, api, payload); - }; - CartesianAxisView.prototype.remove = function () { - rectCoordAxisHandleRemove(this); - }; - CartesianAxisView.type = 'cartesianAxis'; - return CartesianAxisView; - }(AxisView); - var axisElementBuilders = { - splitLine: function (axisView, axisGroup, axisModel, gridModel) { - var axis = axisModel.axis; - if (axis.scale.isBlank()) { - return; - } - var splitLineModel = axisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - lineColors = isArray(lineColors) ? lineColors : [lineColors]; - var gridRect = gridModel.coordinateSystem.getRect(); - var isHorizontal = axis.isHorizontal(); - var lineCount = 0; - var ticksCoords = axis.getTicksCoords({ - tickModel: splitLineModel - }); - var p1 = []; - var p2 = []; - var lineStyle = lineStyleModel.getLineStyle(); - 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; - var tickValue = ticksCoords[i].tickValue; - var line = new Line({ - anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null, - autoBatch: true, - shape: { - x1: p1[0], - y1: p1[1], - x2: p2[0], - y2: p2[1] - }, - style: defaults({ - stroke: lineColors[colorIndex] - }, lineStyle), - silent: true - }); - subPixelOptimizeLine$1(line.shape, lineStyle.lineWidth); - axisGroup.add(line); - } - }, - minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) { - var axis = axisModel.axis; - var minorSplitLineModel = axisModel.getModel('minorSplitLine'); - var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); - var gridRect = gridModel.coordinateSystem.getRect(); - var isHorizontal = axis.isHorizontal(); - var minorTicksCoords = axis.getMinorTicksCoords(); - if (!minorTicksCoords.length) { - return; - } - var p1 = []; - var p2 = []; - var lineStyle = lineStyleModel.getLineStyle(); - for (var i = 0; i < minorTicksCoords.length; i++) { - for (var k = 0; k < minorTicksCoords[i].length; k++) { - var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord); - 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 line = new Line({ - anid: 'minor_line_' + minorTicksCoords[i][k].tickValue, - autoBatch: true, - shape: { - x1: p1[0], - y1: p1[1], - x2: p2[0], - y2: p2[1] - }, - style: lineStyle, - silent: true - }); - subPixelOptimizeLine$1(line.shape, lineStyle.lineWidth); - axisGroup.add(line); - } - } - }, - splitArea: function (axisView, axisGroup, axisModel, gridModel) { - rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel); - } - }; - var CartesianXAxisView = /** @class */function (_super) { - __extends(CartesianXAxisView, _super); - function CartesianXAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CartesianXAxisView.type; - return _this; - } - CartesianXAxisView.type = 'xAxis'; - return CartesianXAxisView; - }(CartesianAxisView); - var CartesianYAxisView = /** @class */function (_super) { - __extends(CartesianYAxisView, _super); - function CartesianYAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CartesianXAxisView.type; - return _this; - } - CartesianYAxisView.type = 'yAxis'; - return CartesianYAxisView; - }(CartesianAxisView); - - // Grid view - var GridView = /** @class */function (_super) { - __extends(GridView, _super); - function GridView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'grid'; - return _this; - } - GridView.prototype.render = function (gridModel, ecModel) { - this.group.removeAll(); - if (gridModel.get('show')) { - this.group.add(new Rect({ - shape: gridModel.coordinateSystem.getRect(), - style: defaults({ - fill: gridModel.get('backgroundColor') - }, gridModel.getItemStyle()), - silent: true, - z2: -1 - })); - } - }; - GridView.type = 'grid'; - return GridView; - }(ComponentView); - var extraOption = { - // gridIndex: 0, - // gridId: '', - offset: 0 - }; - function install$5(registers) { - registers.registerComponentView(GridView); - registers.registerComponentModel(GridModel); - registers.registerCoordinateSystem('cartesian2d', Grid); - axisModelCreator(registers, 'x', CartesianAxisModel, extraOption); - axisModelCreator(registers, 'y', CartesianAxisModel, extraOption); - registers.registerComponentView(CartesianXAxisView); - registers.registerComponentView(CartesianYAxisView); - registers.registerPreprocessor(function (option) { - // Only create grid when need - if (option.xAxis && option.yAxis && !option.grid) { - option.grid = {}; - } - }); - } - - function install$6(registers) { - // In case developer forget to include grid component - use(install$5); - registers.registerSeriesModel(ScatterSeriesModel); - registers.registerChartView(ScatterView); - registers.registerLayout(pointsLayout('scatter')); - } - - function radarLayout(ecModel) { - ecModel.eachSeriesByType('radar', function (seriesModel) { - var data = seriesModel.getData(); - var points = []; - var coordSys = seriesModel.coordinateSystem; - if (!coordSys) { - return; - } - var axes = coordSys.getIndicatorAxes(); - 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 = 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]; - } - - function radarBackwardCompat(option) { - var polarOptArr = option.polar; - if (polarOptArr) { - if (!isArray(polarOptArr)) { - polarOptArr = [polarOptArr]; - } - var polarNotRadar_1 = []; - each(polarOptArr, function (polarOpt, idx) { - if (polarOpt.indicator) { - if (polarOpt.type && !polarOpt.shape) { - polarOpt.shape = polarOpt.type; - } - option.radar = option.radar || []; - if (!isArray(option.radar)) { - option.radar = [option.radar]; - } - option.radar.push(polarOpt); - } else { - polarNotRadar_1.push(polarOpt); - } - }); - option.polar = polarNotRadar_1; - } - each(option.series, function (seriesOpt) { - if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) { - seriesOpt.radarIndex = seriesOpt.polarIndex; - } - }); - } - - var RadarView = /** @class */function (_super) { - __extends(RadarView, _super); - function RadarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadarView.type; - return _this; - } - RadarView.prototype.render = function (seriesModel, ecModel, api) { - var polar = seriesModel.coordinateSystem; - var group = this.group; - var data = seriesModel.getData(); - var oldData = this._data; - function createSymbol$1(data, idx) { - var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; - if (symbolType === 'none') { - return; - } - var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); - var symbolPath = createSymbol(symbolType, -1, -1, 2, 2); - var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0; - symbolPath.attr({ - style: { - strokeNoScale: true - }, - z2: 100, - scaleX: symbolSize[0] / 2, - scaleY: symbolSize[1] / 2, - rotation: symbolRotate * Math.PI / 180 || 0 - }); - return symbolPath; - } - function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) { - // Simply rerender all - symbolGroup.removeAll(); - for (var i = 0; i < newPoints.length - 1; i++) { - var symbolPath = createSymbol$1(data, idx); - if (symbolPath) { - symbolPath.__dimIdx = i; - if (oldPoints[i]) { - symbolPath.setPosition(oldPoints[i]); - graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, { - x: newPoints[i][0], - y: newPoints[i][1] - }, seriesModel, idx); - } else { - symbolPath.setPosition(newPoints[i]); - } - symbolGroup.add(symbolPath); - } - } - } - function getInitialPoints(points) { - return map(points, function (pt) { - return [polar.cx, polar.cy]; - }); - } - data.diff(oldData).add(function (idx) { - var points = data.getItemLayout(idx); - if (!points) { - return; - } - var polygon = new Polygon(); - var polyline = new Polyline(); - var target = { - shape: { - points: points - } - }; - polygon.shape.points = getInitialPoints(points); - polyline.shape.points = getInitialPoints(points); - initProps(polygon, target, seriesModel, idx); - initProps(polyline, target, seriesModel, idx); - var itemGroup = new Group(); - var symbolGroup = new Group(); - itemGroup.add(polyline); - itemGroup.add(polygon); - itemGroup.add(symbolGroup); - updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true); - data.setItemGraphicEl(idx, itemGroup); - }).update(function (newIdx, oldIdx) { - var itemGroup = oldData.getItemGraphicEl(oldIdx); - var polyline = itemGroup.childAt(0); - var polygon = itemGroup.childAt(1); - var symbolGroup = itemGroup.childAt(2); - var target = { - shape: { - points: data.getItemLayout(newIdx) - } - }; - if (!target.shape.points) { - return; - } - updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false); - saveOldStyle(polygon); - saveOldStyle(polyline); - updateProps(polyline, target, seriesModel); - updateProps(polygon, target, seriesModel); - data.setItemGraphicEl(newIdx, itemGroup); - }).remove(function (idx) { - group.remove(oldData.getItemGraphicEl(idx)); - }).execute(); - data.eachItemGraphicEl(function (itemGroup, idx) { - var itemModel = data.getItemModel(idx); - var polyline = itemGroup.childAt(0); - var polygon = itemGroup.childAt(1); - var symbolGroup = itemGroup.childAt(2); - // Radar uses the visual encoded from itemStyle. - var itemStyle = data.getItemVisual(idx, 'style'); - var color = itemStyle.fill; - group.add(itemGroup); - polyline.useStyle(defaults(itemModel.getModel('lineStyle').getLineStyle(), { - fill: 'none', - stroke: color - })); - setStatesStylesFromModel(polyline, itemModel, 'lineStyle'); - setStatesStylesFromModel(polygon, itemModel, 'areaStyle'); - var areaStyleModel = itemModel.getModel('areaStyle'); - var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty(); - polygon.ignore = polygonIgnore; - each(['emphasis', 'select', 'blur'], function (stateName) { - var stateModel = itemModel.getModel([stateName, 'areaStyle']); - var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); - // Won't be ignore if normal state is not ignore. - polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore; - }); - polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { - fill: color, - opacity: 0.7, - decal: itemStyle.decal - })); - var emphasisModel = itemModel.getModel('emphasis'); - var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle(); - symbolGroup.eachChild(function (symbolPath) { - if (symbolPath instanceof ZRImage) { - var pathStyle = symbolPath.style; - symbolPath.useStyle(extend({ - // TODO other properties like x, y ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, itemStyle)); - } else { - symbolPath.useStyle(itemStyle); - symbolPath.setColor(color); - symbolPath.style.strokeNoScale = true; - } - var pathEmphasisState = symbolPath.ensureState('emphasis'); - pathEmphasisState.style = clone(itemHoverStyle); - var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx); - (defaultText == null || isNaN(defaultText)) && (defaultText = ''); - setLabelStyle(symbolPath, getLabelStatesModels(itemModel), { - labelFetcher: data.hostModel, - labelDataIndex: idx, - labelDimIndex: symbolPath.__dimIdx, - defaultText: defaultText, - inheritColor: color, - defaultOpacity: itemStyle.opacity - }); - }); - toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }); - this._data = data; - }; - RadarView.prototype.remove = function () { - this.group.removeAll(); - this._data = null; - }; - RadarView.type = 'radar'; - return RadarView; - }(ChartView); - - var RadarSeriesModel = /** @class */function (_super) { - __extends(RadarSeriesModel, _super); - function RadarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadarSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } - // Overwrite - RadarSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); - // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); - }; - RadarSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesDataSimply(this, { - generateCoord: 'indicator_', - generateCoordCount: Infinity - }); - }; - RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var coordSys = this.coordinateSystem; - var indicatorAxes = coordSys.getIndicatorAxes(); - var name = this.getData().getName(dataIndex); - var nameToDisplay = name === '' ? this.name : name; - var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex); - return createTooltipMarkup('section', { - header: nameToDisplay, - sortBlocks: true, - blocks: map(indicatorAxes, function (axis) { - var val = data.get(data.mapDimension(axis.dim), dataIndex); - return createTooltipMarkup('nameValue', { - markerType: 'subItem', - markerColor: markerColor, - name: axis.name, - value: val, - sortParam: val - }); - }) - }); - }; - RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) { - if (dataIndex != null) { - var data_1 = this.getData(); - var coordSys = this.coordinateSystem; - var values = data_1.getValues(map(coordSys.dimensions, function (dim) { - return data_1.mapDimension(dim); - }), dataIndex); - for (var i = 0, len = values.length; i < len; i++) { - if (!isNaN(values[i])) { - var indicatorAxes = coordSys.getIndicatorAxes(); - return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i); - } - } - } - }; - RadarSeriesModel.type = 'series.radar'; - RadarSeriesModel.dependencies = ['radar']; - RadarSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - colorBy: 'data', - coordinateSystem: 'radar', - legendHoverLink: true, - radarIndex: 0, - lineStyle: { - width: 2, - type: 'solid', - join: 'round' - }, - label: { - position: 'top' - }, - // areaStyle: { - // }, - // itemStyle: {} - symbolSize: 8 - // symbolRotate: null - }; - - return RadarSeriesModel; - }(SeriesModel); - - var valueAxisDefault = axisDefault.value; - function defaultsShow(opt, show) { - return defaults({ - show: show - }, opt); - } - var RadarModel = /** @class */function (_super) { - __extends(RadarModel, _super); - function RadarModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadarModel.type; - return _this; - } - RadarModel.prototype.optionUpdated = function () { - var boundaryGap = this.get('boundaryGap'); - var splitNumber = this.get('splitNumber'); - var scale = this.get('scale'); - var axisLine = this.get('axisLine'); - var axisTick = this.get('axisTick'); - // let axisType = this.get('axisType'); - var axisLabel = this.get('axisLabel'); - var nameTextStyle = this.get('axisName'); - var showName = this.get(['axisName', 'show']); - var nameFormatter = this.get(['axisName', 'formatter']); - var nameGap = this.get('axisNameGap'); - var triggerEvent = this.get('triggerEvent'); - var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) { - // PENDING - if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) { - indicatorOpt.min = 0; - } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) { - indicatorOpt.max = 0; - } - var iNameTextStyle = nameTextStyle; - if (indicatorOpt.color != null) { - iNameTextStyle = defaults({ - color: indicatorOpt.color - }, nameTextStyle); - } - // Use same configuration - var innerIndicatorOpt = merge(clone(indicatorOpt), { - boundaryGap: boundaryGap, - splitNumber: splitNumber, - scale: scale, - axisLine: axisLine, - axisTick: axisTick, - // axisType: axisType, - axisLabel: axisLabel, - // Compatible with 2 and use text - name: indicatorOpt.text, - showName: showName, - nameLocation: 'end', - nameGap: nameGap, - // min: 0, - nameTextStyle: iNameTextStyle, - triggerEvent: triggerEvent - }, false); - if (isString(nameFormatter)) { - var indName = innerIndicatorOpt.name; - innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : ''); - } else if (isFunction(nameFormatter)) { - innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt); - } - var model = new Model(innerIndicatorOpt, null, this.ecModel); - mixin(model, AxisModelCommonMixin.prototype); - // For triggerEvent. - model.mainType = 'radar'; - model.componentIndex = this.componentIndex; - return model; - }, this); - this._indicatorModels = indicatorModels; - }; - RadarModel.prototype.getIndicatorModels = function () { - return this._indicatorModels; - }; - RadarModel.type = 'radar'; - RadarModel.defaultOption = { - // zlevel: 0, - z: 0, - center: ['50%', '50%'], - radius: '75%', - startAngle: 90, - axisName: { - show: true - // formatter: null - // textStyle: {} - }, - - boundaryGap: [0, 0], - splitNumber: 5, - axisNameGap: 15, - scale: false, - // Polygon or circle - shape: 'polygon', - axisLine: merge({ - lineStyle: { - color: '#bbb' - } - }, valueAxisDefault.axisLine), - axisLabel: defaultsShow(valueAxisDefault.axisLabel, false), - axisTick: defaultsShow(valueAxisDefault.axisTick, false), - // axisType: 'value', - splitLine: defaultsShow(valueAxisDefault.splitLine, true), - splitArea: defaultsShow(valueAxisDefault.splitArea, true), - // {text, min, max} - indicator: [] - }; - return RadarModel; - }(ComponentModel); - - var axisBuilderAttrs$1 = ['axisLine', 'axisTickLabel', 'axisName']; - var RadarView$1 = /** @class */function (_super) { - __extends(RadarView, _super); - function RadarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadarView.type; - return _this; - } - RadarView.prototype.render = function (radarModel, ecModel, api) { - var group = this.group; - group.removeAll(); - this._buildAxes(radarModel); - this._buildSplitLineAndArea(radarModel); - }; - RadarView.prototype._buildAxes = function (radarModel) { - var radar = radarModel.coordinateSystem; - var indicatorAxes = radar.getIndicatorAxes(); - var axisBuilders = map(indicatorAxes, function (indicatorAxis) { - var axisName = indicatorAxis.model.get('showName') ? indicatorAxis.name : ''; // hide name - var axisBuilder = new AxisBuilder(indicatorAxis.model, { - axisName: axisName, - position: [radar.cx, radar.cy], - rotation: indicatorAxis.angle, - labelDirection: -1, - tickDirection: -1, - nameDirection: 1 - }); - return axisBuilder; - }); - each(axisBuilders, function (axisBuilder) { - each(axisBuilderAttrs$1, axisBuilder.add, axisBuilder); - this.group.add(axisBuilder.getGroup()); - }, this); - }; - RadarView.prototype._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'); - var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors]; - var splitAreaColorsArr = 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, splitLineColorsArr, i); - splitLines[colorIndex].push(new Circle({ - shape: { - cx: cx, - cy: cy, - r: ticksRadius[i].coord - } - })); - } - if (showSplitArea && i < ticksRadius.length - 1) { - var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i); - splitAreas[colorIndex].push(new Ring({ - shape: { - cx: cx, - cy: cy, - r0: ticksRadius[i].coord, - r: ticksRadius[i + 1].coord - } - })); - } - } - } - // Polyyon - else { - var realSplitNumber_1; - var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) { - var ticksCoords = indicatorAxis.getTicksCoords(); - realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1); - return map(ticksCoords, function (tickCoord) { - return radar.coordToPoint(tickCoord.coord, idx); - }); - }); - var prevPoints = []; - for (var i = 0; i <= realSplitNumber_1; 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 ("development" !== 'production') { - console.error('Can\'t draw value axis ' + i); - } - } - if (showSplitLine) { - var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i); - splitLines[colorIndex].push(new Polyline({ - shape: { - points: points - } - })); - } - if (showSplitArea && prevPoints) { - var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1); - splitAreas[colorIndex].push(new Polygon({ - shape: { - points: points.concat(prevPoints) - } - })); - } - prevPoints = points.slice().reverse(); - } - } - var lineStyle = lineStyleModel.getLineStyle(); - var areaStyle = areaStyleModel.getAreaStyle(); - // Add splitArea before splitLine - each(splitAreas, function (splitAreas, idx) { - this.group.add(mergePath$1(splitAreas, { - style: defaults({ - stroke: 'none', - fill: splitAreaColorsArr[idx % splitAreaColorsArr.length] - }, areaStyle), - silent: true - })); - }, this); - each(splitLines, function (splitLines, idx) { - this.group.add(mergePath$1(splitLines, { - style: defaults({ - fill: 'none', - stroke: splitLineColorsArr[idx % splitLineColorsArr.length] - }, lineStyle), - silent: true - })); - }, this); - }; - RadarView.type = 'radar'; - return RadarView; - }(ComponentView); - - var IndicatorAxis = /** @class */function (_super) { - __extends(IndicatorAxis, _super); - function IndicatorAxis(dim, scale, radiusExtent) { - var _this = _super.call(this, dim, scale, radiusExtent) || this; - _this.type = 'value'; - _this.angle = 0; - _this.name = ''; - return _this; - } - return IndicatorAxis; - }(Axis); - - var Radar = /** @class */function () { - function Radar(radarModel, ecModel, api) { - /** - * - * Radar dimensions - */ - this.dimensions = []; - this._model = radarModel; - this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) { - var dim = 'indicator_' + idx; - var indicatorAxis = new IndicatorAxis(dim, new IntervalScale() - // (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); - } - 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); - }; - // TODO: API should be coordToPoint([coord, 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 = parsePercent$1(center[0], viewWidth); - this.cy = parsePercent$1(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 (isString(radius) || isNumber(radius)) { - radius = [0, radius]; - } - this.r0 = parsePercent$1(radius[0], viewSize); - this.r = parsePercent$1(radius[1], viewSize); - 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; - each(indicatorAxes, function (indicatorAxis) { - indicatorAxis.scale.setExtent(Infinity, -Infinity); - }); - ecModel.eachSeriesByType('radar', function (radarSeries, idx) { - if (radarSeries.get('coordinateSystem') !== 'radar' - // @ts-ignore - || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) { - return; - } - var data = radarSeries.getData(); - each(indicatorAxes, function (indicatorAxis) { - indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim)); - }); - }, this); - var splitNumber = radarModel.get('splitNumber'); - var dummyScale = new IntervalScale(); - dummyScale.setExtent(0, splitNumber); - dummyScale.setInterval(1); - // Force all the axis fixing the maxSplitNumber. - each(indicatorAxes, function (indicatorAxis, idx) { - alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale); - }); - }; - Radar.prototype.convertToPixel = function (ecModel, finder, value) { - console.warn('Not implemented.'); - return null; - }; - Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) { - console.warn('Not implemented.'); - return null; - }; - Radar.prototype.containPoint = function (point) { - console.warn('Not implemented.'); - return false; - }; - 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 - // @ts-ignore - radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0]; - } - }); - return radarList; - }; - /** - * Radar dimensions is based on the data - */ - Radar.dimensions = []; - return Radar; - }(); - - function install$7(registers) { - registers.registerCoordinateSystem('radar', Radar); - registers.registerComponentModel(RadarModel); - registers.registerComponentView(RadarView$1); - registers.registerVisual({ - seriesType: 'radar', - reset: function (seriesModel) { - var data = seriesModel.getData(); - // itemVisual symbol is for selected data - data.each(function (idx) { - data.setItemVisual(idx, 'legendIcon', 'roundRect'); - }); - // visual is for unselected data - data.setVisual('legendIcon', 'roundRect'); - } - }); - } - - function install$8(registers) { - use(install$7); - registers.registerChartView(RadarView); - registers.registerSeriesModel(RadarSeriesModel); - registers.registerLayout(radarLayout); - registers.registerProcessor(dataFilter('radar')); - registers.registerPreprocessor(radarBackwardCompat); - } - - 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. - * } - */ - // TODO: SELF REGISTERED. - registerAction({ - type: 'takeGlobalCursor', - event: 'globalCursorTaken', - update: 'update' - }, noop); - - var RoamController = /** @class */function (_super) { - __extends(RoamController, _super); - function RoamController(zr) { - var _this = _super.call(this) || this; - _this._zr = zr; - // Avoid two roamController bind the same handler - var mousedownHandler = bind(_this._mousedownHandler, _this); - var mousemoveHandler = bind(_this._mousemoveHandler, _this); - var mouseupHandler = bind(_this._mouseupHandler, _this); - var mousewheelHandler = bind(_this._mousewheelHandler, _this); - var pinchHandler = bind(_this._pinchHandler, _this); - /** - * Notice: only enable needed types. For example, if 'zoom' - * is not needed, 'zoom' should not be enabled, otherwise - * default mousewheel behaviour (scroll page) will be disabled. - */ - _this.enable = function (controlType, opt) { - // Disable previous first - this.disable(); - this._opt = defaults(clone(opt) || {}, { - zoomOnMouseWheel: true, - moveOnMouseMove: true, - // By default, wheel do not trigger move. - moveOnMouseWheel: false, - preventDefaultMouseMove: true - }); - if (controlType == null) { - controlType = true; - } - if (controlType === true || controlType === 'move' || controlType === 'pan') { - zr.on('mousedown', mousedownHandler); - zr.on('mousemove', mousemoveHandler); - zr.on('mouseup', mouseupHandler); - } - if (controlType === true || controlType === 'scale' || controlType === 'zoom') { - zr.on('mousewheel', mousewheelHandler); - zr.on('pinch', pinchHandler); - } - }; - _this.disable = function () { - zr.off('mousedown', mousedownHandler); - zr.off('mousemove', mousemoveHandler); - zr.off('mouseup', mouseupHandler); - zr.off('mousewheel', mousewheelHandler); - zr.off('pinch', pinchHandler); - }; - return _this; - } - RoamController.prototype.isDragging = function () { - return this._dragging; - }; - RoamController.prototype.isPinching = function () { - return this._pinching; - }; - RoamController.prototype.setPointerChecker = function (pointerChecker) { - this.pointerChecker = pointerChecker; - }; - RoamController.prototype.dispose = function () { - this.disable(); - }; - RoamController.prototype._mousedownHandler = function (e) { - if (isMiddleOrRightButtonOnMouseUpDown(e)) { - return; - } - var el = e.target; - while (el) { - if (el.draggable) { - return; - } - // check if host is draggable - el = el.__hostTarget || el.parent; - } - var x = e.offsetX; - var y = e.offsetY; - // Only check on mosedown, but not mousemove. - // Mouse can be out of target when mouse moving. - if (this.pointerChecker && this.pointerChecker(e, x, y)) { - this._x = x; - this._y = y; - this._dragging = true; - } - }; - RoamController.prototype._mousemoveHandler = function (e) { - if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || isTaken(this._zr, 'globalPan')) { - return; - } - var x = e.offsetX; - var y = e.offsetY; - var oldX = this._x; - var oldY = this._y; - var dx = x - oldX; - var dy = y - oldY; - this._x = x; - this._y = y; - this._opt.preventDefaultMouseMove && stop(e.event); - trigger(this, 'pan', 'moveOnMouseMove', e, { - dx: dx, - dy: dy, - oldX: oldX, - oldY: oldY, - newX: x, - newY: y, - isAvailableBehavior: null - }); - }; - RoamController.prototype._mouseupHandler = function (e) { - if (!isMiddleOrRightButtonOnMouseUpDown(e)) { - this._dragging = false; - } - }; - RoamController.prototype._mousewheelHandler = function (e) { - var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt); - var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt); - var wheelDelta = e.wheelDelta; - var absWheelDeltaDelta = Math.abs(wheelDelta); - var originX = e.offsetX; - var originY = e.offsetY; - // wheelDelta maybe -0 in chrome mac. - if (wheelDelta === 0 || !shouldZoom && !shouldMove) { - return; - } - // If both `shouldZoom` and `shouldMove` is true, trigger - // their event both, and the final behavior is determined - // by event listener themselves. - if (shouldZoom) { - // Convenience: - // Mac and VM Windows on Mac: scroll up: zoom out. - // Windows: scroll up: zoom in. - // FIXME: Should do more test in different environment. - // wheelDelta is too complicated in difference nvironment - // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel), - // although it has been normallized by zrender. - // wheelDelta of mouse wheel is bigger than touch pad. - var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1; - var scale = wheelDelta > 0 ? factor : 1 / factor; - checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, { - scale: scale, - originX: originX, - originY: originY, - isAvailableBehavior: null - }); - } - if (shouldMove) { - // FIXME: Should do more test in different environment. - var absDelta = Math.abs(wheelDelta); - // wheelDelta of mouse wheel is bigger than touch pad. - var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05); - checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, { - scrollDelta: scrollDelta, - originX: originX, - originY: originY, - isAvailableBehavior: null - }); - } - }; - RoamController.prototype._pinchHandler = function (e) { - if (isTaken(this._zr, 'globalPan')) { - return; - } - var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1; - checkPointerAndTrigger(this, 'zoom', null, e, { - scale: scale, - originX: e.pinchX, - originY: e.pinchY, - isAvailableBehavior: null - }); - }; - return RoamController; - }(Eventful); - function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) { - if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) { - // When mouse is out of roamController rect, - // default befavoius should not be be disabled, otherwise - // page sliding is disabled, contrary to expectation. - stop(e.event); - trigger(controller, eventName, behaviorToCheck, e, contollerEvent); - } - } - function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) { - // Also provide behavior checker for event listener, for some case that - // multiple components share one listener. - contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e); - // TODO should not have type issue. - controller.trigger(eventName, contollerEvent); - } - // settings: { - // zoomOnMouseWheel - // moveOnMouseMove - // moveOnMouseWheel - // } - // The value can be: true / false / 'shift' / 'ctrl' / 'alt'. - function isAvailableBehavior(behaviorToCheck, e, settings) { - var setting = settings[behaviorToCheck]; - return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - /** - * For geo and graph. - */ - function updateViewOnPan(controllerHost, dx, dy) { - var target = controllerHost.target; - target.x += dx; - target.y += dy; - target.dirty(); - } - /** - * For geo and graph. - */ - function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) { - var target = controllerHost.target; - var zoomLimit = controllerHost.zoomLimit; - var newZoom = controllerHost.zoom = controllerHost.zoom || 1; - newZoom *= zoomDelta; - if (zoomLimit) { - var zoomMin = zoomLimit.min || 0; - var zoomMax = zoomLimit.max || Infinity; - newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin); - } - var zoomScale = newZoom / controllerHost.zoom; - controllerHost.zoom = newZoom; - // Keep the mouse center when scaling - target.x -= (zoomX - target.x) * (zoomScale - 1); - target.y -= (zoomY - target.y) * (zoomScale - 1); - target.scaleX *= zoomScale; - target.scaleY *= zoomScale; - target.dirty(); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 IRRELEVANT_EXCLUDES = { - 'axisPointer': 1, - 'tooltip': 1, - 'brush': 1 - }; - /** - * Avoid that: mouse click on a elements that is over geo or graph, - * but roam is triggered. - */ - function onIrrelevantElement(e, api, targetCoordSysModel) { - var model = api.getComponentByElement(e.topTarget); - // If model is axisModel, it works only if it is injected with coordinateSystem. - var coordSys = model && model.coordinateSystem; - return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel; - } - - function parseXML(svg) { - if (isString(svg)) { - var parser = new DOMParser(); - svg = parser.parseFromString(svg, 'text/xml'); - } - var svgNode = svg; - if (svgNode.nodeType === 9) { - svgNode = svgNode.firstChild; - } - while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) { - svgNode = svgNode.nextSibling; - } - return svgNode; - } - - var nodeParsers; - var INHERITABLE_STYLE_ATTRIBUTES_MAP = { - '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-anchor': 'textAlign', - 'visibility': 'visibility', - 'display': 'display' - }; - var INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP); - var SELF_STYLE_ATTRIBUTES_MAP = { - 'alignment-baseline': 'textBaseline', - 'stop-color': 'stopColor' - }; - var SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP); - var SVGParser = (function () { - function SVGParser() { - this._defs = {}; - this._root = null; - } - SVGParser.prototype.parse = function (xml, opt) { - opt = opt || {}; - var svg = parseXML(xml); - if ("development" !== 'production') { - if (!svg) { - throw new Error('Illegal svg'); - } - } - this._defsUsePending = []; - var root = new Group(); - this._root = root; - var named = []; - var viewBox = svg.getAttribute('viewBox') || ''; - var width = parseFloat((svg.getAttribute('width') || opt.width)); - var height = parseFloat((svg.getAttribute('height') || opt.height)); - isNaN(width) && (width = null); - isNaN(height) && (height = null); - parseAttributes(svg, root, null, true, false); - var child = svg.firstChild; - while (child) { - this._parseNode(child, root, named, null, false, false); - child = child.nextSibling; - } - applyDefs(this._defs, this._defsUsePending); - this._defsUsePending = []; - var viewBoxRect; - var viewBoxTransform; - if (viewBox) { - var viewBoxArr = splitNumberSequence(viewBox); - if (viewBoxArr.length >= 4) { - viewBoxRect = { - x: parseFloat((viewBoxArr[0] || 0)), - y: parseFloat((viewBoxArr[1] || 0)), - width: parseFloat(viewBoxArr[2]), - height: parseFloat(viewBoxArr[3]) - }; - } - } - if (viewBoxRect && width != null && height != null) { - viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width: width, height: height }); - if (!opt.ignoreViewBox) { - var elRoot = root; - root = new Group(); - root.add(elRoot); - elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale; - elRoot.x = viewBoxTransform.x; - elRoot.y = viewBoxTransform.y; - } - } - if (!opt.ignoreRootClip && width != null && height != null) { - root.setClipPath(new Rect({ - shape: { x: 0, y: 0, width: width, height: height } - })); - } - return { - root: root, - width: width, - height: height, - viewBoxRect: viewBoxRect, - viewBoxTransform: viewBoxTransform, - named: named - }; - }; - SVGParser.prototype._parseNode = function (xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) { - var nodeName = xmlNode.nodeName.toLowerCase(); - var el; - var namedFromForSub = namedFrom; - if (nodeName === 'defs') { - isInDefs = true; - } - if (nodeName === 'text') { - isInText = true; - } - if (nodeName === 'defs' || nodeName === 'switch') { - el = parentGroup; - } - else { - if (!isInDefs) { - var parser_1 = nodeParsers[nodeName]; - if (parser_1 && hasOwn(nodeParsers, nodeName)) { - el = parser_1.call(this, xmlNode, parentGroup); - var nameAttr = xmlNode.getAttribute('name'); - if (nameAttr) { - var newNamed = { - name: nameAttr, - namedFrom: null, - svgNodeTagLower: nodeName, - el: el - }; - named.push(newNamed); - if (nodeName === 'g') { - namedFromForSub = newNamed; - } - } - else if (namedFrom) { - named.push({ - name: namedFrom.name, - namedFrom: namedFrom, - svgNodeTagLower: nodeName, - el: el - }); - } - parentGroup.add(el); - } - } - var parser = paintServerParsers[nodeName]; - if (parser && hasOwn(paintServerParsers, nodeName)) { - var def = parser.call(this, xmlNode); - var id = xmlNode.getAttribute('id'); - if (id) { - this._defs[id] = def; - } - } - } - if (el && el.isGroup) { - var child = xmlNode.firstChild; - while (child) { - if (child.nodeType === 1) { - this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText); - } - else if (child.nodeType === 3 && isInText) { - this._parseText(child, el); - } - child = child.nextSibling; - } - } - }; - SVGParser.prototype._parseText = function (xmlNode, parentGroup) { - var text = new TSpan({ - style: { - text: xmlNode.textContent - }, - silent: true, - x: this._textX || 0, - y: this._textY || 0 - }); - inheritStyle(parentGroup, text); - parseAttributes(xmlNode, text, this._defsUsePending, false, false); - applyTextAlignment(text, parentGroup); - var textStyle = text.style; - var fontSize = textStyle.fontSize; - if (fontSize && fontSize < 9) { - textStyle.fontSize = 9; - text.scaleX *= fontSize / 9; - text.scaleY *= fontSize / 9; - } - var font = (textStyle.fontSize || textStyle.fontFamily) && [ - textStyle.fontStyle, - textStyle.fontWeight, - (textStyle.fontSize || 12) + 'px', - textStyle.fontFamily || 'sans-serif' - ].join(' '); - textStyle.font = font; - var rect = text.getBoundingRect(); - this._textX += rect.width; - parentGroup.add(text); - return text; - }; - SVGParser.internalField = (function () { - nodeParsers = { - 'g': function (xmlNode, parentGroup) { - var g = new Group(); - inheritStyle(parentGroup, g); - parseAttributes(xmlNode, g, this._defsUsePending, false, false); - return g; - }, - 'rect': function (xmlNode, parentGroup) { - var rect = new Rect(); - inheritStyle(parentGroup, rect); - parseAttributes(xmlNode, rect, this._defsUsePending, false, false); - 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') - }); - rect.silent = true; - return rect; - }, - 'circle': function (xmlNode, parentGroup) { - var circle = new Circle(); - inheritStyle(parentGroup, circle); - parseAttributes(xmlNode, circle, this._defsUsePending, false, false); - circle.setShape({ - cx: parseFloat(xmlNode.getAttribute('cx') || '0'), - cy: parseFloat(xmlNode.getAttribute('cy') || '0'), - r: parseFloat(xmlNode.getAttribute('r') || '0') - }); - circle.silent = true; - return circle; - }, - 'line': function (xmlNode, parentGroup) { - var line = new Line(); - inheritStyle(parentGroup, line); - parseAttributes(xmlNode, line, this._defsUsePending, false, false); - 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') - }); - line.silent = true; - return line; - }, - 'ellipse': function (xmlNode, parentGroup) { - var ellipse = new Ellipse(); - inheritStyle(parentGroup, ellipse); - parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false); - 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') - }); - ellipse.silent = true; - return ellipse; - }, - 'polygon': function (xmlNode, parentGroup) { - var pointsStr = xmlNode.getAttribute('points'); - var pointsArr; - if (pointsStr) { - pointsArr = parsePoints(pointsStr); - } - var polygon = new Polygon({ - shape: { - points: pointsArr || [] - }, - silent: true - }); - inheritStyle(parentGroup, polygon); - parseAttributes(xmlNode, polygon, this._defsUsePending, false, false); - return polygon; - }, - 'polyline': function (xmlNode, parentGroup) { - var pointsStr = xmlNode.getAttribute('points'); - var pointsArr; - if (pointsStr) { - pointsArr = parsePoints(pointsStr); - } - var polyline = new Polyline({ - shape: { - points: pointsArr || [] - }, - silent: true - }); - inheritStyle(parentGroup, polyline); - parseAttributes(xmlNode, polyline, this._defsUsePending, false, false); - return polyline; - }, - 'image': function (xmlNode, parentGroup) { - var img = new ZRImage(); - inheritStyle(parentGroup, img); - parseAttributes(xmlNode, img, this._defsUsePending, false, false); - img.setStyle({ - image: xmlNode.getAttribute('xlink:href') || xmlNode.getAttribute('href'), - x: +xmlNode.getAttribute('x'), - y: +xmlNode.getAttribute('y'), - width: +xmlNode.getAttribute('width'), - height: +xmlNode.getAttribute('height') - }); - img.silent = true; - 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._defsUsePending, false, true); - return g; - }, - 'tspan': function (xmlNode, parentGroup) { - var x = xmlNode.getAttribute('x'); - var y = xmlNode.getAttribute('y'); - if (x != null) { - this._textX = parseFloat(x); - } - if (y != null) { - 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._defsUsePending, false, true); - this._textX += parseFloat(dx); - this._textY += parseFloat(dy); - return g; - }, - 'path': function (xmlNode, parentGroup) { - var d = xmlNode.getAttribute('d') || ''; - var path = createFromString(d); - inheritStyle(parentGroup, path); - parseAttributes(xmlNode, path, this._defsUsePending, false, false); - path.silent = true; - return path; - } - }; - })(); - return SVGParser; - }()); - var paintServerParsers = { - '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); - parsePaintServerUnit(xmlNode, gradient); - parseGradientColorStops(xmlNode, gradient); - return gradient; - }, - 'radialgradient': function (xmlNode) { - var cx = parseInt(xmlNode.getAttribute('cx') || '0', 10); - var cy = parseInt(xmlNode.getAttribute('cy') || '0', 10); - var r = parseInt(xmlNode.getAttribute('r') || '0', 10); - var gradient = new RadialGradient(cx, cy, r); - parsePaintServerUnit(xmlNode, gradient); - parseGradientColorStops(xmlNode, gradient); - return gradient; - } - }; - function parsePaintServerUnit(xmlNode, gradient) { - var gradientUnits = xmlNode.getAttribute('gradientUnits'); - if (gradientUnits === 'userSpaceOnUse') { - gradient.global = true; - } - } - function parseGradientColorStops(xmlNode, gradient) { - var stop = xmlNode.firstChild; - while (stop) { - if (stop.nodeType === 1 - && stop.nodeName.toLocaleLowerCase() === 'stop') { - var offsetStr = stop.getAttribute('offset'); - var offset = void 0; - if (offsetStr && offsetStr.indexOf('%') > 0) { - offset = parseInt(offsetStr, 10) / 100; - } - else if (offsetStr) { - offset = parseFloat(offsetStr); - } - else { - offset = 0; - } - var styleVals = {}; - parseInlineStyle(stop, styleVals, styleVals); - var stopColor = styleVals.stopColor - || stop.getAttribute('stop-color') - || '#000000'; - gradient.colorStops.push({ - offset: offset, - color: 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 = splitNumberSequence(pointsString); - 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; - } - function parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) { - var disp = el; - var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {}; - var selfStyle = {}; - if (xmlNode.nodeType === 1) { - parseTransformAttribute(xmlNode, el); - parseInlineStyle(xmlNode, inheritedStyle, selfStyle); - if (!onlyInlineStyle) { - parseAttributeStyle(xmlNode, inheritedStyle, selfStyle); - } - } - disp.style = disp.style || {}; - if (inheritedStyle.fill != null) { - disp.style.fill = getFillStrokeStyle(disp, 'fill', inheritedStyle.fill, defsUsePending); - } - if (inheritedStyle.stroke != null) { - disp.style.stroke = getFillStrokeStyle(disp, 'stroke', inheritedStyle.stroke, defsUsePending); - } - each([ - 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize' - ], function (propName) { - if (inheritedStyle[propName] != null) { - disp.style[propName] = parseFloat(inheritedStyle[propName]); - } - }); - each([ - 'lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign' - ], function (propName) { - if (inheritedStyle[propName] != null) { - disp.style[propName] = inheritedStyle[propName]; - } - }); - if (isTextGroup) { - disp.__selfStyle = selfStyle; - } - if (inheritedStyle.lineDash) { - disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) { - return parseFloat(str); - }); - } - if (inheritedStyle.visibility === 'hidden' || inheritedStyle.visibility === 'collapse') { - disp.invisible = true; - } - if (inheritedStyle.display === 'none') { - disp.ignore = true; - } - } - function applyTextAlignment(text, parentGroup) { - var parentSelfStyle = parentGroup.__selfStyle; - if (parentSelfStyle) { - var textBaseline = parentSelfStyle.textBaseline; - var zrTextBaseline = textBaseline; - if (!textBaseline || textBaseline === 'auto') { - zrTextBaseline = 'alphabetic'; - } - else if (textBaseline === 'baseline') { - zrTextBaseline = 'alphabetic'; - } - else if (textBaseline === 'before-edge' || textBaseline === 'text-before-edge') { - zrTextBaseline = 'top'; - } - else if (textBaseline === 'after-edge' || textBaseline === 'text-after-edge') { - zrTextBaseline = 'bottom'; - } - else if (textBaseline === 'central' || textBaseline === 'mathematical') { - zrTextBaseline = 'middle'; - } - text.style.textBaseline = zrTextBaseline; - } - var parentInheritedStyle = parentGroup.__inheritedStyle; - if (parentInheritedStyle) { - var textAlign = parentInheritedStyle.textAlign; - var zrTextAlign = textAlign; - if (textAlign) { - if (textAlign === 'middle') { - zrTextAlign = 'center'; - } - text.style.textAlign = zrTextAlign; - } - } - } - var urlRegex = /^url\(\s*#(.*?)\)/; - function getFillStrokeStyle(el, method, str, defsUsePending) { - var urlMatch = str && str.match(urlRegex); - if (urlMatch) { - var url = trim(urlMatch[1]); - defsUsePending.push([el, method, url]); - return; - } - if (str === 'none') { - str = null; - } - return str; - } - function applyDefs(defs, defsUsePending) { - for (var i = 0; i < defsUsePending.length; i++) { - var item = defsUsePending[i]; - item[0].style[item[1]] = defs[item[2]]; - } - } - var numberReg$1 = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g; - function splitNumberSequence(rawStr) { - return rawStr.match(numberReg$1) || []; - } - var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g; - var DEGREE_TO_ANGLE = Math.PI / 180; - function parseTransformAttribute(xmlNode, node) { - var transform = xmlNode.getAttribute('transform'); - if (transform) { - transform = transform.replace(/,/g, ' '); - var transformOps_1 = []; - var mt = null; - transform.replace(transformRegex, function (str, type, value) { - transformOps_1.push(type, value); - return ''; - }); - for (var i = transformOps_1.length - 1; i > 0; i -= 2) { - var value = transformOps_1[i]; - var type = transformOps_1[i - 1]; - var valueArr = splitNumberSequence(value); - mt = mt || create$1(); - switch (type) { - case 'translate': - translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]); - break; - case 'scale': - scale$1(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]); - break; - case 'rotate': - rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [ - parseFloat(valueArr[1] || '0'), - parseFloat(valueArr[2] || '0') - ]); - break; - case 'skewX': - var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE); - mul$1(mt, [1, 0, sx, 1, 0, 0], mt); - break; - case 'skewY': - var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE); - mul$1(mt, [1, sy, 0, 1, 0, 0], mt); - break; - case 'matrix': - mt[0] = parseFloat(valueArr[0]); - mt[1] = parseFloat(valueArr[1]); - mt[2] = parseFloat(valueArr[2]); - mt[3] = parseFloat(valueArr[3]); - mt[4] = parseFloat(valueArr[4]); - mt[5] = parseFloat(valueArr[5]); - break; - } - } - node.setLocalTransform(mt); - } - } - var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g; - function parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) { - var style = xmlNode.getAttribute('style'); - if (!style) { - return; - } - styleRegex.lastIndex = 0; - var styleRegResult; - while ((styleRegResult = styleRegex.exec(style)) != null) { - var svgStlAttr = styleRegResult[1]; - var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr) - ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr] - : null; - if (zrInheritableStlAttr) { - inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2]; - } - var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr) - ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr] - : null; - if (zrSelfStlAttr) { - selfStyleResult[zrSelfStlAttr] = styleRegResult[2]; - } - } - } - function parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) { - for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) { - var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i]; - var attrValue = xmlNode.getAttribute(svgAttrName); - if (attrValue != null) { - inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue; - } - } - for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) { - var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i]; - var attrValue = xmlNode.getAttribute(svgAttrName); - if (attrValue != null) { - selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue; - } - } - } - function makeViewBoxTransform(viewBoxRect, boundingRect) { - var scaleX = boundingRect.width / viewBoxRect.width; - var scaleY = boundingRect.height / viewBoxRect.height; - var scale = Math.min(scaleX, scaleY); - return { - scale: scale, - x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2), - y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2) - }; - } - function parseSVG(xml, opt) { - var parser = new SVGParser(); - return parser.parse(xml, opt); - } - - /** - * "region available" means that: enable users to set attribute `name="xxx"` on those tags - * to make it be a region. - * 1. region styles and its label styles can be defined in echarts opton: - * ```js - * geo: { - * regions: [{ - * name: 'xxx', - * itemStyle: { ... }, - * label: { ... } - * }, { - * ... - * }, - * ...] - * }; - * ``` - * 2. name can be duplicated in different SVG tag. All of the tags with the same name share - * a region option. For exampel if there are two representing two lung lobes. They have - * no common parents but both of them need to display label "lung" inside. - */ - var REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path', - // are also enabled because some SVG might paint text itself, - // but still need to trigger events or tooltip. - 'text', 'tspan', - // is also enabled because this case: if multiple tags share one name - // and need label displayed, every tags will display the name, which is not - // expected. So we can put them into a . Thereby only one label - // displayed and located based on the bounding rect of the . - 'g']); - var GeoSVGResource = /** @class */function () { - function GeoSVGResource(mapName, svg) { - this.type = 'geoSVG'; - // All used graphics. key: hostKey, value: root - this._usedGraphicMap = createHashMap(); - // All unused graphics. - this._freedGraphics = []; - this._mapName = mapName; - // 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. - this._parsedXML = parseXML(svg); - } - GeoSVGResource.prototype.load = function /* nameMap: NameMap */ - () { - // In the "load" stage, graphic need to be built to - // get boundingRect for geo coordinate system. - var firstGraphic = this._firstGraphic; - // Create the return data structure only when first graphic created. - // Because they will be used in geo coordinate system update stage, - // and `regions` will be mounted at `geo` coordinate system, - // in which there is no "view" info, so that it should better not to - // make references to graphic elements. - if (!firstGraphic) { - firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML); - this._freedGraphics.push(firstGraphic); - this._boundingRect = this._firstGraphic.boundingRect.clone(); - // PENDING: `nameMap` will not be supported until some real requirement come. - // if (nameMap) { - // named = applyNameMap(named, nameMap); - // } - var _a = createRegions(firstGraphic.named), - regions = _a.regions, - regionsMap = _a.regionsMap; - this._regions = regions; - this._regionsMap = regionsMap; - } - return { - boundingRect: this._boundingRect, - regions: this._regions, - regionsMap: this._regionsMap - }; - }; - GeoSVGResource.prototype._buildGraphic = function (svgXML) { - var result; - var rootFromParse; - try { - result = svgXML && parseSVG(svgXML, { - ignoreViewBox: true, - ignoreRootClip: true - }) || {}; - rootFromParse = result.root; - assert(rootFromParse != null); - } catch (e) { - throw new Error('Invalid svg format\n' + e.message); - } - // Note: we keep the covenant that the root has no transform. So always add an extra root. - var root = new Group(); - root.add(rootFromParse); - root.isGeoSVGGraphicRoot = true; - // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX] - // - // Consider: `` - // - the `width/height` we call it `svgWidth/svgHeight` for short. - // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say, - // "viewport boundingRect", or `boundingRect` for short. - // - `viewBox` defines the transform from the real content ot the viewport. - // `viewBox` has the same unit as the content of SVG. - // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become - // different from the content of SVG. Otherwise, they are the same. - // - // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be: - // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']). - // 1. Make a transform from `viewBox` to `boundingRect`. - // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve - // the aspect ratio. - // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect']) - // (`Geo`/`View` will do this job). - // Note: this transform might not preserve aspect radio, which depending on how users specify - // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio, - // but `geo.layoutCenter/layoutSize` will preserve aspect ratio). - // - // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG - // layout look good. - // - // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect - // of the SVG content and use them to make SVG layout look good. - var svgWidth = result.width; - var svgHeight = result.height; - var viewBoxRect = result.viewBoxRect; - var boundingRect = this._boundingRect; - if (!boundingRect) { - var bRectX = void 0; - var bRectY = void 0; - var bRectWidth = void 0; - var bRectHeight = void 0; - if (svgWidth != null) { - bRectX = 0; - bRectWidth = svgWidth; - } else if (viewBoxRect) { - bRectX = viewBoxRect.x; - bRectWidth = viewBoxRect.width; - } - if (svgHeight != null) { - bRectY = 0; - bRectHeight = svgHeight; - } else if (viewBoxRect) { - bRectY = viewBoxRect.y; - bRectHeight = viewBoxRect.height; - } - // If both viewBox and svgWidth/svgHeight not specified, - // we have to determine how to layout those element to make them look good. - if (bRectX == null || bRectY == null) { - var calculatedBoundingRect = rootFromParse.getBoundingRect(); - if (bRectX == null) { - bRectX = calculatedBoundingRect.x; - bRectWidth = calculatedBoundingRect.width; - } - if (bRectY == null) { - bRectY = calculatedBoundingRect.y; - bRectHeight = calculatedBoundingRect.height; - } - } - boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight); - } - if (viewBoxRect) { - var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); - // Only support `preserveAspectRatio 'xMidYMid'` - rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale; - rootFromParse.x = viewBoxTransform.x; - rootFromParse.y = viewBoxTransform.y; - } - // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature. - // They do not strictly confine all of the content inside a display rect, but deliberately - // use a `viewBox` to define a displayable rect. - // PENDING: - // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the - // edge might also be clipped, because region labels are put as `textContent` of the SVG path. - root.setClipPath(new Rect({ - shape: boundingRect.plain() - })); - var named = []; - each(result.named, function (namedItem) { - if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) { - named.push(namedItem); - setSilent(namedItem.el); - } - }); - return { - root: root, - boundingRect: boundingRect, - named: named - }; - }; - /** - * Consider: - * (1) One graphic element can not be shared by different `geoView` running simultaneously. - * Notice, also need to consider multiple echarts instances share a `mapRecord`. - * (2) Converting SVG to graphic elements is time consuming. - * (3) In the current architecture, `load` should be called frequently to get boundingRect, - * and it is called without view info. - * So we maintain graphic elements in this module, and enables `view` to use/return these - * graphics from/to the pool with it's uid. - */ - GeoSVGResource.prototype.useGraphic = function (hostKey /* , nameMap: NameMap */) { - var usedRootMap = this._usedGraphicMap; - var svgGraphic = usedRootMap.get(hostKey); - if (svgGraphic) { - return svgGraphic; - } - svgGraphic = this._freedGraphics.pop() - // use the first boundingRect to avoid duplicated boundingRect calculation. - || this._buildGraphic(this._parsedXML); - usedRootMap.set(hostKey, svgGraphic); - // PENDING: `nameMap` will not be supported until some real requirement come. - // `nameMap` can only be obtained from echarts option. - // The original `named` must not be modified. - // if (nameMap) { - // svgGraphic = extend({}, svgGraphic); - // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap); - // } - return svgGraphic; - }; - GeoSVGResource.prototype.freeGraphic = function (hostKey) { - var usedRootMap = this._usedGraphicMap; - var svgGraphic = usedRootMap.get(hostKey); - if (svgGraphic) { - usedRootMap.removeKey(hostKey); - this._freedGraphics.push(svgGraphic); - } - }; - return GeoSVGResource; - }(); - function setSilent(el) { - // Only named element has silent: false, other elements should - // act as background and has no user interaction. - el.silent = false; - // text|tspan will be converted to group. - if (el.isGroup) { - el.traverse(function (child) { - child.silent = false; - }); - } - } - function createRegions(named) { - var regions = []; - var regionsMap = createHashMap(); - // Create resions only for the first graphic. - each(named, function (namedItem) { - // Region has feature to calculate center for tooltip or other features. - // If there is a , the center should be the center of the - // bounding rect of the g. - if (namedItem.namedFrom != null) { - return; - } - var region = new GeoSVGRegion(namedItem.name, namedItem.el); - // PENDING: if `nameMap` supported, this region can not be mounted on - // `this`, but can only be created each time `load()` called. - regions.push(region); - // PENDING: if multiple tag named with the same name, only one will be - // found by `_regionsMap`. `_regionsMap` is used to find a coordinate - // by name. We use `region.getCenter()` as the coordinate. - regionsMap.set(namedItem.name, region); - }); - return { - regions: regions, - regionsMap: regionsMap - }; - } - // PENDING: `nameMap` will not be supported until some real requirement come. - // /** - // * Use the alias in geoNameMap. - // * The input `named` must not be modified. - // */ - // function applyNameMap( - // named: GeoSVGGraphicRecord['named'], - // nameMap: NameMap - // ): GeoSVGGraphicRecord['named'] { - // const result = [] as GeoSVGGraphicRecord['named']; - // for (let i = 0; i < named.length; i++) { - // let regionGraphic = named[i]; - // const name = regionGraphic.name; - // if (nameMap && nameMap.hasOwnProperty(name)) { - // regionGraphic = extend({}, regionGraphic); - // regionGraphic.name = name; - // } - // result.push(regionGraphic); - // } - // return result; - // } - - var geoCoord = [126, 25]; - var nanhaiName = '南海诸岛'; - var points$1 = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]]; - for (var i = 0; i < points$1.length; i++) { - for (var k = 0; k < points$1[i].length; k++) { - points$1[i][k][0] /= 10.5; - points$1[i][k][1] /= -10.5 / 0.75; - points$1[i][k][0] += geoCoord[0]; - points$1[i][k][1] += geoCoord[1]; - } - } - function fixNanhai(mapType, regions) { - if (mapType === 'china') { - for (var i = 0; i < regions.length; i++) { - // Already exists. - if (regions[i].name === nanhaiName) { - return; - } - } - regions.push(new GeoJSONRegion(nanhaiName, map(points$1, function (exterior) { - return { - type: 'polygon', - exterior: exterior - }; - }), geoCoord)); - } - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 coordsOffsetMap = { - '南海诸岛': [32, 80], - // 全国 - '广东': [0, -10], - '香港': [10, 5], - '澳门': [-10, 10], - // '北京': [-10, 0], - '天津': [5, 5] - }; - function fixTextCoords(mapType, region) { - if (mapType === 'china') { - var coordFix = coordsOffsetMap[region.name]; - if (coordFix) { - var cp = region.getCenter(); - cp[0] += coordFix[0] / 10.5; - cp[1] += -coordFix[1] / (10.5 / 0.75); - region.setCenter(cp); - } - } - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 钓鱼岛 - // let Region = require('../Region'); - // let zrUtil = require('zrender/lib/core/util'); - // let geoCoord = [126, 25]; - var points$2 = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]]; - function fixDiaoyuIsland(mapType, region) { - if (mapType === 'china' && region.name === '台湾') { - region.geometries.push({ - type: 'polygon', - exterior: points$2[0] - }); - } - } - - var DEFAULT_NAME_PROPERTY = 'name'; - var GeoJSONResource = /** @class */function () { - function GeoJSONResource(mapName, geoJSON, specialAreas) { - this.type = 'geoJSON'; - this._parsedMap = createHashMap(); - this._mapName = mapName; - this._specialAreas = specialAreas; - // PENDING: delay the parse to the first usage to rapid up the FMP? - this._geoJSON = parseInput(geoJSON); - } - /** - * @param nameMap can be null/undefined - * @param nameProperty can be null/undefined - */ - GeoJSONResource.prototype.load = function (nameMap, nameProperty) { - nameProperty = nameProperty || DEFAULT_NAME_PROPERTY; - var parsed = this._parsedMap.get(nameProperty); - if (!parsed) { - var rawRegions = this._parseToRegions(nameProperty); - parsed = this._parsedMap.set(nameProperty, { - regions: rawRegions, - boundingRect: calculateBoundingRect(rawRegions) - }); - } - var regionsMap = createHashMap(); - var finalRegions = []; - each(parsed.regions, function (region) { - var regionName = region.name; - // Try use the alias in geoNameMap - if (nameMap && hasOwn(nameMap, regionName)) { - region = region.cloneShallow(regionName = nameMap[regionName]); - } - finalRegions.push(region); - regionsMap.set(regionName, region); - }); - return { - regions: finalRegions, - boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0), - regionsMap: regionsMap - }; - }; - GeoJSONResource.prototype._parseToRegions = function (nameProperty) { - var mapName = this._mapName; - var geoJSON = this._geoJSON; - var rawRegions; - // https://jsperf.com/try-catch-performance-overhead - try { - rawRegions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : []; - } catch (e) { - throw new Error('Invalid geoJson format\n' + e.message); - } - fixNanhai(mapName, rawRegions); - each(rawRegions, function (region) { - var regionName = region.name; - fixTextCoords(mapName, region); - fixDiaoyuIsland(mapName, region); - // Some area like Alaska in USA map needs to be tansformed - // to look better - var specialArea = this._specialAreas && this._specialAreas[regionName]; - if (specialArea) { - region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height); - } - }, this); - return rawRegions; - }; - /** - * Only for exporting to users. - * **MUST NOT** used internally. - */ - GeoJSONResource.prototype.getMapForUser = function () { - return { - // For backward compatibility, use geoJson - // PENDING: it has been returning them without clone. - // do we need to avoid outsite modification? - geoJson: this._geoJSON, - geoJSON: this._geoJSON, - specialAreas: this._specialAreas - }; - }; - return GeoJSONResource; - }(); - function calculateBoundingRect(regions) { - var rect; - for (var i = 0; i < regions.length; i++) { - var regionRect = regions[i].getBoundingRect(); - rect = rect || regionRect.clone(); - rect.union(regionRect); - } - return rect; - } - function parseInput(source) { - return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')(); - } - - var storage = createHashMap(); - var geoSourceManager = { - /** - * Compatible with previous `echarts.registerMap`. - * - * @usage - * ```js - * - * echarts.registerMap('USA', geoJson, specialAreas); - * - * echarts.registerMap('USA', { - * geoJson: geoJson, - * specialAreas: {...} - * }); - * echarts.registerMap('USA', { - * geoJSON: geoJson, - * specialAreas: {...} - * }); - * - * echarts.registerMap('airport', { - * svg: svg - * } - * ``` - * - * Note: - * Do not support that register multiple geoJSON or SVG - * one map name. Because different geoJSON and SVG have - * different unit. It's not easy to make sure how those - * units are mapping/normalize. - * If intending to use multiple geoJSON or SVG, we can - * use multiple geo coordinate system. - */ - registerMap: function (mapName, rawDef, rawSpecialAreas) { - if (rawDef.svg) { - var resource = new GeoSVGResource(mapName, rawDef.svg); - storage.set(mapName, resource); - } else { - // Recommend: - // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx }); - // Backward compatibility: - // echarts.registerMap('eu', geoJSON, specialAreas); - // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx }); - var geoJSON = rawDef.geoJson || rawDef.geoJSON; - if (geoJSON && !rawDef.features) { - rawSpecialAreas = rawDef.specialAreas; - } else { - geoJSON = rawDef; - } - var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas); - storage.set(mapName, resource); - } - }, - getGeoResource: function (mapName) { - return storage.get(mapName); - }, - /** - * Only for exporting to users. - * **MUST NOT** used internally. - */ - getMapForUser: function (mapName) { - var resource = storage.get(mapName); - // Do not support return SVG until some real requirement come. - return resource && resource.type === 'geoJSON' && resource.getMapForUser(); - }, - load: function (mapName, nameMap, nameProperty) { - var resource = storage.get(mapName); - if (!resource) { - if ("development" !== 'production') { - console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.'); - } - return; - } - return resource.load(nameMap, nameProperty); - } - }; - - /** - * Only these tags enable use `itemStyle` if they are named in SVG. - * Other tags like might not suitable for `itemStyle`. - * They will not be considered to be styled until some requirements come. - */ - var OPTION_STYLE_ENABLED_TAGS = ['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path']; - var OPTION_STYLE_ENABLED_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS); - var STATE_TRIGGER_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g'])); - var LABEL_HOST_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g'])); - var mapLabelRaw = makeInner(); - function getFixedItemStyle(model) { - var itemStyle = model.getItemStyle(); - var areaColor = model.get('areaColor'); - // If user want the color not to be changed when hover, - // they should both set areaColor and color to be null. - if (areaColor != null) { - itemStyle.fill = areaColor; - } - return itemStyle; - } - // Only stroke can be used for line. - // Using fill in style if stroke not exits. - // TODO Not sure yet. Perhaps a separate `lineStyle`? - function fixLineStyle(styleHost) { - var style = styleHost.style; - if (style) { - style.stroke = style.stroke || style.fill; - style.fill = null; - } - } - var MapDraw = /** @class */function () { - function MapDraw(api) { - var group = new Group(); - this.uid = getUID('ec_map_draw'); - this._controller = new RoamController(api.getZr()); - this._controllerHost = { - target: group - }; - this.group = group; - group.add(this._regionsGroup = new Group()); - group.add(this._svgGroup = new Group()); - } - MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) { - var isGeo = mapOrGeoModel.mainType === 'geo'; - // Map series has data. GEO model that controlled by map series - // will be assigned with map data. Other GEO model has no data. - var data = mapOrGeoModel.getData && mapOrGeoModel.getData(); - isGeo && ecModel.eachComponent({ - mainType: 'series', - subType: 'map' - }, function (mapSeries) { - if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) { - data = mapSeries.getData(); - } - }); - var geo = mapOrGeoModel.coordinateSystem; - var regionsGroup = this._regionsGroup; - var group = this.group; - var transformInfo = geo.getTransformInfo(); - var transformInfoRaw = transformInfo.raw; - var transformInfoRoam = transformInfo.roam; - // No animation when first draw or in action - var isFirstDraw = !regionsGroup.childAt(0) || payload; - if (isFirstDraw) { - group.x = transformInfoRoam.x; - group.y = transformInfoRoam.y; - group.scaleX = transformInfoRoam.scaleX; - group.scaleY = transformInfoRoam.scaleY; - group.dirty(); - } else { - updateProps(group, transformInfoRoam, mapOrGeoModel); - } - var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0; - var viewBuildCtx = { - api: api, - geo: geo, - mapOrGeoModel: mapOrGeoModel, - data: data, - isVisualEncodedByVisualMap: isVisualEncodedByVisualMap, - isGeo: isGeo, - transformInfoRaw: transformInfoRaw - }; - if (geo.resourceType === 'geoJSON') { - this._buildGeoJSON(viewBuildCtx); - } else if (geo.resourceType === 'geoSVG') { - this._buildSVG(viewBuildCtx); - } - this._updateController(mapOrGeoModel, ecModel, api); - this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView); - }; - MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) { - var regionsGroupByName = this._regionsGroupByName = createHashMap(); - var regionsInfoByName = createHashMap(); - var regionsGroup = this._regionsGroup; - var transformInfoRaw = viewBuildCtx.transformInfoRaw; - var mapOrGeoModel = viewBuildCtx.mapOrGeoModel; - var data = viewBuildCtx.data; - var projection = viewBuildCtx.geo.projection; - var projectionStream = projection && projection.stream; - function transformPoint(point, project) { - if (project) { - // projection may return null point. - point = project(point); - } - return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y]; - } - function transformPolygonPoints(inPoints) { - var outPoints = []; - // If projectionStream is provided. Use it instead of single point project. - var project = !projectionStream && projection && projection.project; - for (var i = 0; i < inPoints.length; ++i) { - var newPt = transformPoint(inPoints[i], project); - newPt && outPoints.push(newPt); - } - return outPoints; - } - function getPolyShape(points) { - return { - shape: { - points: transformPolygonPoints(points) - } - }; - } - regionsGroup.removeAll(); - // Only when the resource is GeoJSON, there is `geo.regions`. - each(viewBuildCtx.geo.regions, function (region) { - var regionName = region.name; - // Consider in GeoJson properties.name may be duplicated, for example, - // there is multiple region named "United Kindom" or "France" (so many - // colonies). And it is not appropriate to merge them in geo, which - // will make them share the same label and bring trouble in label - // location calculation. - var regionGroup = regionsGroupByName.get(regionName); - var _a = regionsInfoByName.get(regionName) || {}, - dataIdx = _a.dataIdx, - regionModel = _a.regionModel; - if (!regionGroup) { - regionGroup = regionsGroupByName.set(regionName, new Group()); - regionsGroup.add(regionGroup); - dataIdx = data ? data.indexOfName(regionName) : null; - regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null; - regionsInfoByName.set(regionName, { - dataIdx: dataIdx, - regionModel: regionModel - }); - } - var polygonSubpaths = []; - var polylineSubpaths = []; - each(region.geometries, function (geometry) { - // Polygon and MultiPolygon - if (geometry.type === 'polygon') { - var polys = [geometry.exterior].concat(geometry.interiors || []); - if (projectionStream) { - polys = projectPolys(polys, projectionStream); - } - each(polys, function (poly) { - polygonSubpaths.push(new Polygon(getPolyShape(poly))); - }); - } - // LineString and MultiLineString - else { - var points = geometry.points; - if (projectionStream) { - points = projectPolys(points, projectionStream, true); - } - each(points, function (points) { - polylineSubpaths.push(new Polyline(getPolyShape(points))); - }); - } - }); - var centerPt = transformPoint(region.getCenter(), projection && projection.project); - function createCompoundPath(subpaths, isLine) { - if (!subpaths.length) { - return; - } - var compoundPath = new CompoundPath({ - culling: true, - segmentIgnoreThreshold: 1, - shape: { - paths: subpaths - } - }); - regionGroup.add(compoundPath); - applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel); - resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt); - if (isLine) { - fixLineStyle(compoundPath); - each(compoundPath.states, fixLineStyle); - } - } - createCompoundPath(polygonSubpaths); - createCompoundPath(polylineSubpaths, true); - }); - // Ensure children have been added to `regionGroup` before calling them. - regionsGroupByName.each(function (regionGroup, regionName) { - var _a = regionsInfoByName.get(regionName), - dataIdx = _a.dataIdx, - regionModel = _a.regionModel; - resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx); - resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); - resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); - }, this); - }; - MapDraw.prototype._buildSVG = function (viewBuildCtx) { - var mapName = viewBuildCtx.geo.map; - var transformInfoRaw = viewBuildCtx.transformInfoRaw; - this._svgGroup.x = transformInfoRaw.x; - this._svgGroup.y = transformInfoRaw.y; - this._svgGroup.scaleX = transformInfoRaw.scaleX; - this._svgGroup.scaleY = transformInfoRaw.scaleY; - if (this._svgResourceChanged(mapName)) { - this._freeSVG(); - this._useSVG(mapName); - } - var svgDispatcherMap = this._svgDispatcherMap = createHashMap(); - var focusSelf = false; - each(this._svgGraphicRecord.named, function (namedItem) { - // Note that we also allow different elements have the same name. - // For example, a glyph of a city and the label of the city have - // the same name and their tooltip info can be defined in a single - // region option. - var regionName = namedItem.name; - var mapOrGeoModel = viewBuildCtx.mapOrGeoModel; - var data = viewBuildCtx.data; - var svgNodeTagLower = namedItem.svgNodeTagLower; - var el = namedItem.el; - var dataIdx = data ? data.indexOfName(regionName) : null; - var regionModel = mapOrGeoModel.getRegionModel(regionName); - if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) { - applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel); - } - if (el instanceof Displayable) { - el.culling = true; - } - // We do not know how the SVG like so we'd better not to change z2. - // Otherwise it might bring some unexpected result. For example, - // an area hovered that make some inner city can not be clicked. - el.z2EmphasisLift = 0; - // If self named: - if (!namedItem.namedFrom) { - // label should batter to be displayed based on the center of - // if it is named rather than displayed on each child. - if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) { - resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null); - } - resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx); - resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); - if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) { - var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); - if (focus_1 === 'self') { - focusSelf = true; - } - var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []); - els.push(el); - } - } - }, this); - this._enableBlurEntireSVG(focusSelf, viewBuildCtx); - }; - MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) { - // It's a little complicated to support blurring the entire geoSVG in series-map. - // So do not support it until some requirements come. - // At present, in series-map, only regions can be blurred. - if (focusSelf && viewBuildCtx.isGeo) { - var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle(); - // Only support `opacity` here. Because not sure that other props are suitable for - // all of the elements generated by SVG (especially for Text/TSpan/Image/... ). - var opacity_1 = blurStyle.opacity; - this._svgGraphicRecord.root.traverse(function (el) { - if (!el.isGroup) { - // PENDING: clear those settings to SVG elements when `_freeSVG`. - // (Currently it happen not to be needed.) - setDefaultStateProxy(el); - var style = el.ensureState('blur').style || {}; - // Do not overwrite the region style that already set from region option. - if (style.opacity == null && opacity_1 != null) { - style.opacity = opacity_1; - } - // If `ensureState('blur').style = {}`, there will be default opacity. - // Enable `stateTransition` (animation). - el.ensureState('emphasis'); - } - }); - } - }; - MapDraw.prototype.remove = function () { - this._regionsGroup.removeAll(); - this._regionsGroupByName = null; - this._svgGroup.removeAll(); - this._freeSVG(); - this._controller.dispose(); - this._controllerHost = null; - }; - MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) { - if (name == null) { - return []; - } - var geo = geoModel.coordinateSystem; - if (geo.resourceType === 'geoJSON') { - var regionsGroupByName = this._regionsGroupByName; - if (regionsGroupByName) { - var regionGroup = regionsGroupByName.get(name); - return regionGroup ? [regionGroup] : []; - } - } else if (geo.resourceType === 'geoSVG') { - return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || []; - } - }; - MapDraw.prototype._svgResourceChanged = function (mapName) { - return this._svgMapName !== mapName; - }; - MapDraw.prototype._useSVG = function (mapName) { - var resource = geoSourceManager.getGeoResource(mapName); - if (resource && resource.type === 'geoSVG') { - var svgGraphic = resource.useGraphic(this.uid); - this._svgGroup.add(svgGraphic.root); - this._svgGraphicRecord = svgGraphic; - this._svgMapName = mapName; - } - }; - MapDraw.prototype._freeSVG = function () { - var mapName = this._svgMapName; - if (mapName == null) { - return; - } - var resource = geoSourceManager.getGeoResource(mapName); - if (resource && resource.type === 'geoSVG') { - resource.freeGraphic(this.uid); - } - this._svgGraphicRecord = null; - this._svgDispatcherMap = null; - this._svgGroup.removeAll(); - this._svgMapName = null; - }; - MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) { - var geo = mapOrGeoModel.coordinateSystem; - var controller = this._controller; - var controllerHost = this._controllerHost; - // @ts-ignore FIXME:TS - controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit'); - controllerHost.zoom = geo.getZoom(); - // roamType is will be set default true if it is null - // @ts-ignore FIXME:TS - controller.enable(mapOrGeoModel.get('roam') || false); - var mainType = mapOrGeoModel.mainType; - function makeActionBase() { - var action = { - type: 'geoRoam', - componentType: mainType - }; - action[mainType + 'Id'] = mapOrGeoModel.id; - return action; - } - controller.off('pan').on('pan', function (e) { - this._mouseDownFlag = false; - updateViewOnPan(controllerHost, e.dx, e.dy); - api.dispatchAction(extend(makeActionBase(), { - dx: e.dx, - dy: e.dy, - animation: { - duration: 0 - } - })); - }, this); - controller.off('zoom').on('zoom', function (e) { - this._mouseDownFlag = false; - updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); - api.dispatchAction(extend(makeActionBase(), { - totalZoom: controllerHost.zoom, - zoom: e.scale, - originX: e.originX, - originY: e.originY, - animation: { - duration: 0 - } - })); - }, this); - controller.setPointerChecker(function (e, x, y) { - return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel); - }); - }; - /** - * FIXME: this is a temporarily workaround. - * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like - * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries` - * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified - * props will have no chance to be restored. - * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in - * `renderSeries` will cache the modified `ignore` to `el._normalState`. - * TODO: - * Use clone/immutable in `LabelManager`? - */ - MapDraw.prototype.resetForLabelLayout = function () { - this.group.traverse(function (el) { - var label = el.getTextContent(); - if (label) { - label.ignore = mapLabelRaw(label).ignore; - } - }); - }; - MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) { - var mapDraw = this; - regionsGroup.off('mousedown'); - regionsGroup.off('click'); - // @ts-ignore FIXME:TS resolve type conflict - if (mapOrGeoModel.get('selectedMode')) { - regionsGroup.on('mousedown', function () { - mapDraw._mouseDownFlag = true; - }); - regionsGroup.on('click', function (e) { - if (!mapDraw._mouseDownFlag) { - return; - } - mapDraw._mouseDownFlag = false; - }); - } - }; - return MapDraw; - }(); - function applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) { - // All of the path are using `itemStyle`, because - // (1) Some SVG also use fill on polyline (The different between - // polyline and polygon is "open" or "close" but not fill or not). - // (2) For the common props like opacity, if some use itemStyle - // and some use `lineStyle`, it might confuse users. - // (3) Most SVG use , where can not detect whether to draw a "line" - // or a filled shape, so use `itemStyle` for . - var normalStyleModel = regionModel.getModel('itemStyle'); - var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']); - var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']); - var selectStyleModel = regionModel.getModel(['select', 'itemStyle']); - // NOTE: DON'T use 'style' in visual when drawing map. - // This component is used for drawing underlying map for both geo component and map series. - var normalStyle = getFixedItemStyle(normalStyleModel); - var emphasisStyle = getFixedItemStyle(emphasisStyleModel); - var selectStyle = getFixedItemStyle(selectStyleModel); - var blurStyle = getFixedItemStyle(blurStyleModel); - // Update the itemStyle if has data visual - var data = viewBuildCtx.data; - if (data) { - // Only visual color of each item will be used. It can be encoded by visualMap - // But visual color of series is used in symbol drawing - // Visual color for each series is for the symbol draw - var style = data.getItemVisual(dataIndex, 'style'); - var decal = data.getItemVisual(dataIndex, 'decal'); - if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) { - normalStyle.fill = style.fill; - } - if (decal) { - normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api); - } - } - // SVG text, tspan and image can be named but not supporeted - // to be styled by region option yet. - el.setStyle(normalStyle); - el.style.strokeNoScale = true; - el.ensureState('emphasis').style = emphasisStyle; - el.ensureState('select').style = selectStyle; - el.ensureState('blur').style = blurStyle; - // Enable blur - setDefaultStateProxy(el); - } - function resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, - // Exist only if `viewBuildCtx.data` exists. - dataIdx, - // If labelXY not provided, use `textConfig.position: 'inside'` - labelXY) { - var data = viewBuildCtx.data; - var isGeo = viewBuildCtx.isGeo; - var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx)); - var itemLayout = data && data.getItemLayout(dataIdx); - // In the following cases label will be drawn - // 1. In map series and data value is NaN - // 2. In geo component - // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout - if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) { - var query = !isGeo ? dataIdx : regionName; - var labelFetcher = void 0; - // Consider dataIdx not found. - if (!data || dataIdx >= 0) { - labelFetcher = mapOrGeoModel; - } - var specifiedTextOpt = labelXY ? { - normal: { - align: 'center', - verticalAlign: 'middle' - } - } : null; - // Caveat: must be called after `setDefaultStateProxy(el);` called. - // because textContent will be assign with `el.stateProxy` inside. - setLabelStyle(el, getLabelStatesModels(regionModel), { - labelFetcher: labelFetcher, - labelDataIndex: query, - defaultText: regionName - }, specifiedTextOpt); - var textEl = el.getTextContent(); - if (textEl) { - mapLabelRaw(textEl).ignore = textEl.ignore; - if (el.textConfig && labelXY) { - // Compute a relative offset based on the el bounding rect. - var rect = el.getBoundingRect().clone(); - // Need to make sure the percent position base on the same rect in normal and - // emphasis state. Otherwise if using boundingRect of el, but the emphasis state - // has borderWidth (even 0.5px), the text position will be changed obviously - // if the position is very big like ['1234%', '1345%']. - el.textConfig.layoutRect = rect; - el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%']; - } - } - // PENDING: - // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified. - // But el.dataIndex is also used to determine whether user event should be triggered, - // where el.seriesIndex or el.dataModel must be specified. At present for a single el - // there is not case that "only label layout enabled but user event disabled", so here - // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`. - el.disableLabelAnimation = true; - } else { - el.removeTextContent(); - el.removeTextConfig(); - el.disableLabelAnimation = null; - } - } - function resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, - // Exist only if `viewBuildCtx.data` exists. - dataIdx) { - // setItemGraphicEl, setHoverStyle after all polygons and labels - // are added to the regionGroup - if (viewBuildCtx.data) { - // FIXME: when series-map use a SVG map, and there are duplicated name specified - // on different SVG elements, after `data.setItemGraphicEl(...)`: - // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip - // can be triggered only mouse hover. That's correct. - // (2) only the last element will be kept in `data`, so that if trigger tooltip - // by `dispatchAction`, only the last one can be found and triggered. That might be - // not correct. We will fix it in future if anyone demanding that. - viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger); - } - // series-map will not trigger "geoselectchange" no matter it is - // based on a declared geo component. Because series-map will - // trigger "selectchange". If it trigger both the two events, - // If users call `chart.dispatchAction({type: 'toggleSelect'})`, - // it not easy to also fire event "geoselectchanged". - else { - // Package custom mouse event for geo component - getECData(eventTrigger).eventData = { - componentType: 'geo', - componentIndex: mapOrGeoModel.componentIndex, - geoIndex: mapOrGeoModel.componentIndex, - name: regionName, - region: regionModel && regionModel.option || {} - }; - } - } - function resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) { - if (!viewBuildCtx.data) { - setTooltipConfig({ - el: el, - componentModel: mapOrGeoModel, - itemName: regionName, - // @ts-ignore FIXME:TS fix the "compatible with each other"? - itemTooltipOption: regionModel.get('tooltip') - }); - } - } - function resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) { - // @ts-ignore FIXME:TS fix the "compatible with each other"? - el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode'); - // @ts-ignore FIXME:TS fix the "compatible with each other"? - var emphasisModel = regionModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - if (viewBuildCtx.isGeo) { - enableComponentHighDownFeatures(el, mapOrGeoModel, regionName); - } - return focus; - } - function projectPolys(rings, - // Polygons include exterior and interiors. Or polylines. - createStream, isLine) { - var polygons = []; - var curPoly; - function startPolygon() { - curPoly = []; - } - function endPolygon() { - if (curPoly.length) { - polygons.push(curPoly); - curPoly = []; - } - } - var stream = createStream({ - polygonStart: startPolygon, - polygonEnd: endPolygon, - lineStart: startPolygon, - lineEnd: endPolygon, - point: function (x, y) { - // May have NaN values from stream. - if (isFinite(x) && isFinite(y)) { - curPoly.push([x, y]); - } - }, - sphere: function () {} - }); - !isLine && stream.polygonStart(); - each(rings, function (ring) { - stream.lineStart(); - for (var i = 0; i < ring.length; i++) { - stream.point(ring[i][0], ring[i][1]); - } - stream.lineEnd(); - }); - !isLine && stream.polygonEnd(); - return polygons; - } - // @ts-ignore FIXME:TS fix the "compatible with each other"? - - var MapView = /** @class */function (_super) { - __extends(MapView, _super); - function MapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MapView.type; - return _this; - } - MapView.prototype.render = function (mapModel, ecModel, api, payload) { - // Not render if it is an toggleSelect action from self - if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) { - return; - } - var group = this.group; - group.removeAll(); - if (mapModel.getHostGeoModel()) { - return; - } - if (this._mapDraw && payload && payload.type === 'geoRoam') { - this._mapDraw.resetForLabelLayout(); - } - // Not update map if it is an roam action from self - if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) { - if (mapModel.needsDrawMap) { - var mapDraw = this._mapDraw || new MapDraw(api); - group.add(mapDraw.group); - mapDraw.draw(mapModel, ecModel, api, this, payload); - this._mapDraw = mapDraw; - } else { - // Remove drawn map - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - } - } else { - var mapDraw = this._mapDraw; - mapDraw && group.add(mapDraw.group); - } - mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api); - }; - MapView.prototype.remove = function () { - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - this.group.removeAll(); - }; - MapView.prototype.dispose = function () { - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - }; - MapView.prototype._renderSymbols = function (mapModel, ecModel, api) { - var originalData = mapModel.originalData; - var group = this.group; - originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) { - if (isNaN(value)) { - return; - } - var layout = originalData.getItemLayout(originalDataIndex); - if (!layout || !layout.point) { - // Not exists in map - return; - } - var point = layout.point; - var offset = layout.offset; - var circle = new Circle({ - style: { - // Because the special of map draw. - // Which needs statistic of multiple series and draw on one map. - // And each series also need a symbol with legend color - // - // Layout and visual are put one the different data - // TODO - fill: mapModel.getData().getVisual('style').fill - }, - shape: { - cx: point[0] + offset * 9, - cy: point[1], - r: 3 - }, - silent: true, - // Do not overlap the first series, on which labels are displayed. - z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0) - }); - // Only the series that has the first value on the same region is in charge of rendering the label. - // But consider the case: - // series: [ - // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]}, - // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]} - // ] - // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`. - // For backward compatibility, we follow the rule that render label `A` by the - // settings on series `X` but render label `C` by the settings on series `Y`. - if (!offset) { - var fullData = mapModel.mainSeries.getData(); - var name_1 = originalData.getName(originalDataIndex); - var fullIndex_1 = fullData.indexOfName(name_1); - var itemModel = originalData.getItemModel(originalDataIndex); - var labelModel = itemModel.getModel('label'); - var regionGroup = fullData.getItemGraphicEl(fullIndex_1); - // `getFormattedLabel` needs to use `getData` inside. Here - // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`. - // FIXME - // If this is not the `mainSeries`, the item model (like label formatter) - // set on original data item will never get. But it has been working - // like that from the beginning, and this scenario is rarely encountered. - // So it won't be fixed until we have to. - setLabelStyle(circle, getLabelStatesModels(itemModel), { - labelFetcher: { - getFormattedLabel: function (idx, state) { - return mapModel.getFormattedLabel(fullIndex_1, state); - } - }, - defaultText: name_1 - }); - circle.disableLabelAnimation = true; - if (!labelModel.get('position')) { - circle.setTextConfig({ - position: 'bottom' - }); - } - regionGroup.onHoverStateChange = function (toState) { - setStatesFlag(circle, toState); - }; - } - group.add(circle); - }); - }; - MapView.type = 'map'; - return MapView; - }(ChartView); - - var MapSeries = /** @class */function (_super) { - __extends(MapSeries, _super); - function MapSeries() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MapSeries.type; - // Only first map series of same mapType will drawMap. - _this.needsDrawMap = false; - // Group of all map series with same mapType - _this.seriesGroup = []; - _this.getTooltipPosition = function (dataIndex) { - if (dataIndex != null) { - var name_1 = this.getData().getName(dataIndex); - var geo = this.coordinateSystem; - var region = geo.getRegion(name_1); - return region && geo.dataToPoint(region.getCenter()); - } - }; - return _this; - } - MapSeries.prototype.getInitialData = function (option) { - var data = createSeriesDataSimply(this, { - coordDimensions: ['value'], - encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) - }); - var dataNameMap = createHashMap(); - var toAppendNames = []; - for (var i = 0, len = data.count(); i < len; i++) { - var name_2 = data.getName(i); - dataNameMap.set(name_2, true); - } - var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty); - each(geoSource.regions, function (region) { - var name = region.name; - if (!dataNameMap.get(name)) { - toAppendNames.push(name); - } - }); - // Complete data with missing regions. The consequent processes (like visual - // map and render) can not be performed without a "full data". For example, - // find `dataIndex` by name. - data.appendValues([], toAppendNames); - return data; - }; - /** - * If no host geo model, return null, which means using a - * inner exclusive geo model. - */ - MapSeries.prototype.getHostGeoModel = function () { - var geoIndex = this.option.geoIndex; - return geoIndex != null ? this.ecModel.getComponent('geo', geoIndex) : null; - }; - MapSeries.prototype.getMapType = function () { - return (this.getHostGeoModel() || this).option.map; - }; - // _fillOption(option, mapName) { - // Shallow clone - // option = zrUtil.extend({}, option); - // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap); - // return option; - // } - MapSeries.prototype.getRawValue = function (dataIndex) { - // Use value stored in data instead because it is calculated from multiple series - // FIXME Provide all value of multiple series ? - var data = this.getData(); - return data.get(data.mapDimension('value'), dataIndex); - }; - /** - * Get model of region - */ - MapSeries.prototype.getRegionModel = function (regionName) { - var data = this.getData(); - return data.getItemModel(data.indexOfName(regionName)); - }; - /** - * Map tooltip formatter - */ - MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - // FIXME orignalData and data is a bit confusing - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var name = data.getName(dataIndex); - var seriesGroup = this.seriesGroup; - var seriesNames = []; - for (var i = 0; i < seriesGroup.length; i++) { - var otherIndex = seriesGroup[i].originalData.indexOfName(name); - var valueDim = data.mapDimension('value'); - if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) { - seriesNames.push(seriesGroup[i].name); - } - } - return createTooltipMarkup('section', { - header: seriesNames.join(', '), - noHeader: !seriesNames.length, - blocks: [createTooltipMarkup('nameValue', { - name: name, - value: value - })] - }); - }; - MapSeries.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; - MapSeries.prototype.setCenter = function (center) { - this.option.center = center; - }; - MapSeries.prototype.getLegendIcon = function (opt) { - var iconType = opt.icon || 'roundRect'; - var icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill); - icon.setStyle(opt.itemStyle); - // Map do not use itemStyle.borderWidth as border width - icon.style.stroke = 'none'; - // No rotation because no series visual symbol for map - if (iconType.indexOf('empty') > -1) { - icon.style.stroke = icon.style.fill; - icon.style.fill = '#fff'; - icon.style.lineWidth = 2; - } - return icon; - }; - MapSeries.type = 'series.map'; - MapSeries.dependencies = ['geo']; - MapSeries.layoutMode = 'box'; - MapSeries.defaultOption = { - // 一级层叠 - // zlevel: 0, - // 二级层叠 - z: 2, - coordinateSystem: 'geo', - // map should be explicitly specified since ec3. - map: '', - // If `geoIndex` is not specified, a exclusive geo will be - // created. Otherwise use the specified geo component, and - // `map` and `mapType` are ignored. - // geoIndex: 0, - // 'center' | 'left' | 'right' | 'x%' | {number} - left: 'center', - // 'center' | 'top' | 'bottom' | 'x%' | {number} - top: 'center', - // right - // bottom - // width: - // height - // Aspect is width / height. Inited to be geoJson bbox aspect - // This parameter is used for scale this aspect - // Default value: - // for geoSVG source: 1, - // for geoJSON source: 0.75. - aspectScale: null, - // Layout with center and size - // If you want to put map in a fixed size box with right aspect ratio - // This two properties may be more convenient. - // layoutCenter: [50%, 50%] - // layoutSize: 100 - showLegendSymbol: true, - // Define left-top, right-bottom coords to control view - // For example, [ [180, 90], [-180, -90] ], - // higher priority than center and zoom - boundingCoords: null, - // Default on center of map - center: null, - zoom: 1, - scaleLimit: null, - selectedMode: true, - label: { - show: false, - color: '#000' - }, - // scaleLimit: null, - itemStyle: { - borderWidth: 0.5, - borderColor: '#444', - areaColor: '#eee' - }, - emphasis: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - areaColor: 'rgba(255,215,0,0.8)' - } - }, - select: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - color: 'rgba(255,215,0,0.8)' - } - }, - nameProperty: 'name' - }; - return MapSeries; - }(SeriesModel); - - // FIXME 公用? - function dataStatistics(datas, statisticType) { - var dataNameMap = {}; - each(datas, function (data) { - data.each(data.mapDimension('value'), function (value, idx) { - // Add prefix to avoid conflict with Object.prototype. - var mapKey = 'ec-' + data.getName(idx); - dataNameMap[mapKey] = dataNameMap[mapKey] || []; - if (!isNaN(value)) { - dataNameMap[mapKey].push(value); - } - }); - }); - return datas[0].map(datas[0].mapDimension('value'), function (value, idx) { - var mapKey = 'ec-' + datas[0].getName(idx); - var sum = 0; - var min = Infinity; - var max = -Infinity; - var len = dataNameMap[mapKey].length; - for (var i = 0; i < len; i++) { - min = Math.min(min, dataNameMap[mapKey][i]); - max = Math.max(max, dataNameMap[mapKey][i]); - sum += dataNameMap[mapKey][i]; - } - var result; - if (statisticType === 'min') { - result = min; - } else if (statisticType === 'max') { - result = max; - } else if (statisticType === 'average') { - result = sum / len; - } else { - result = sum; - } - return len === 0 ? NaN : result; - }); - } - function mapDataStatistic(ecModel) { - var seriesGroups = {}; - ecModel.eachSeriesByType('map', function (seriesModel) { - var hostGeoModel = seriesModel.getHostGeoModel(); - var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType(); - (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); - }); - each(seriesGroups, function (seriesList, key) { - var data = dataStatistics(map(seriesList, function (seriesModel) { - return seriesModel.getData(); - }), seriesList[0].get('mapValueCalculation')); - for (var i = 0; i < seriesList.length; i++) { - seriesList[i].originalData = seriesList[i].getData(); - } - // FIXME Put where? - for (var i = 0; i < seriesList.length; i++) { - seriesList[i].seriesGroup = seriesList; - seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); - seriesList[i].setData(data.cloneShallow()); - seriesList[i].mainSeries = seriesList[0]; - } - }); - } - - function mapSymbolLayout(ecModel) { - var processedMapType = {}; - ecModel.eachSeriesByType('map', function (mapSeries) { - var mapType = mapSeries.getMapType(); - if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { - return; - } - var mapSymbolOffsets = {}; - each(mapSeries.seriesGroup, function (subMapSeries) { - var geo = subMapSeries.coordinateSystem; - var data = subMapSeries.originalData; - if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) { - data.each(data.mapDimension('value'), function (value, idx) { - var name = data.getName(idx); - var region = geo.getRegion(name); - // If input series.data is [11, 22, '-'/null/undefined, 44], - // it will be filled with NaN: [11, 22, NaN, 44] and NaN will - // not be drawn. So here must validate if value is NaN. - if (!region || isNaN(value)) { - return; - } - var offset = mapSymbolOffsets[name] || 0; - var point = geo.dataToPoint(region.getCenter()); - mapSymbolOffsets[name] = offset + 1; - data.setItemLayout(idx, { - point: point, - offset: offset - }); - }); - } - }); - // Show label of those region not has legendIcon (which is offset 0) - var data = mapSeries.getData(); - data.each(function (idx) { - var name = data.getName(idx); - var layout = data.getItemLayout(idx) || {}; - layout.showLabel = !mapSymbolOffsets[name]; - data.setItemLayout(idx, layout); - }); - processedMapType[mapType] = true; - }); - } - - var v2ApplyTransform = applyTransform; - var View = /** @class */function (_super) { - __extends(View, _super); - function View(name) { - var _this = _super.call(this) || this; - _this.type = 'view'; - _this.dimensions = ['x', 'y']; - /** - * Represents the transform brought by roam/zoom. - * If `View['_viewRect']` applies roam transform, - * we can get the final displayed rect. - */ - _this._roamTransformable = new Transformable(); - /** - * Represents the transform from `View['_rect']` to `View['_viewRect']`. - */ - _this._rawTransformable = new Transformable(); - _this.name = name; - return _this; - } - View.prototype.setBoundingRect = function (x, y, width, height) { - this._rect = new BoundingRect(x, y, width, height); - return this._rect; - }; - /** - * @return {module:zrender/core/BoundingRect} - */ - View.prototype.getBoundingRect = function () { - return this._rect; - }; - View.prototype.setViewRect = function (x, y, width, height) { - this._transformTo(x, y, width, height); - this._viewRect = new BoundingRect(x, y, width, height); - }; - /** - * Transformed to particular position and size - */ - View.prototype._transformTo = function (x, y, width, height) { - var rect = this.getBoundingRect(); - var rawTransform = this._rawTransformable; - rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height)); - var rawParent = rawTransform.parent; - rawTransform.parent = null; - rawTransform.decomposeTransform(); - rawTransform.parent = rawParent; - this._updateTransform(); - }; - /** - * Set center of view - */ - View.prototype.setCenter = function (centerCoord, api) { - if (!centerCoord) { - return; - } - this._center = [parsePercent$1(centerCoord[0], api.getWidth()), parsePercent$1(centerCoord[1], api.getHeight())]; - this._updateCenterAndZoom(); - }; - View.prototype.setZoom = function (zoom) { - zoom = zoom || 1; - var zoomLimit = this.zoomLimit; - if (zoomLimit) { - if (zoomLimit.max != null) { - zoom = Math.min(zoomLimit.max, zoom); - } - if (zoomLimit.min != null) { - zoom = Math.max(zoomLimit.min, zoom); - } - } - this._zoom = zoom; - this._updateCenterAndZoom(); - }; - /** - * Get default center without roam - */ - View.prototype.getDefaultCenter = function () { - // Rect before any transform - var rawRect = this.getBoundingRect(); - var cx = rawRect.x + rawRect.width / 2; - var cy = rawRect.y + rawRect.height / 2; - return [cx, cy]; - }; - View.prototype.getCenter = function () { - return this._center || this.getDefaultCenter(); - }; - View.prototype.getZoom = function () { - return this._zoom || 1; - }; - View.prototype.getRoamTransform = function () { - return this._roamTransformable.getLocalTransform(); - }; - /** - * Remove roam - */ - View.prototype._updateCenterAndZoom = function () { - // Must update after view transform updated - var rawTransformMatrix = this._rawTransformable.getLocalTransform(); - var roamTransform = this._roamTransformable; - var defaultCenter = this.getDefaultCenter(); - var center = this.getCenter(); - var zoom = this.getZoom(); - center = applyTransform([], center, rawTransformMatrix); - defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix); - roamTransform.originX = center[0]; - roamTransform.originY = center[1]; - roamTransform.x = defaultCenter[0] - center[0]; - roamTransform.y = defaultCenter[1] - center[1]; - roamTransform.scaleX = roamTransform.scaleY = zoom; - this._updateTransform(); - }; - /** - * Update transform props on `this` based on the current - * `this._roamTransformable` and `this._rawTransformable`. - */ - View.prototype._updateTransform = function () { - var roamTransformable = this._roamTransformable; - var rawTransformable = this._rawTransformable; - rawTransformable.parent = roamTransformable; - roamTransformable.updateTransform(); - rawTransformable.updateTransform(); - copy$1(this.transform || (this.transform = []), rawTransformable.transform || create$1()); - this._rawTransform = rawTransformable.getLocalTransform(); - this.invTransform = this.invTransform || []; - invert(this.invTransform, this.transform); - this.decomposeTransform(); - }; - View.prototype.getTransformInfo = function () { - var rawTransformable = this._rawTransformable; - var roamTransformable = this._roamTransformable; - // Because roamTransformabel has `originX/originY` modified, - // but the caller of `getTransformInfo` can not handle `originX/originY`, - // so need to recalculate them. - var dummyTransformable = new Transformable(); - dummyTransformable.transform = roamTransformable.transform; - dummyTransformable.decomposeTransform(); - return { - roam: { - x: dummyTransformable.x, - y: dummyTransformable.y, - scaleX: dummyTransformable.scaleX, - scaleY: dummyTransformable.scaleY - }, - raw: { - x: rawTransformable.x, - y: rawTransformable.y, - scaleX: rawTransformable.scaleX, - scaleY: rawTransformable.scaleY - } - }; - }; - View.prototype.getViewRect = function () { - return this._viewRect; - }; - /** - * Get view rect after roam transform - */ - View.prototype.getViewRectAfterRoam = function () { - var rect = this.getBoundingRect().clone(); - rect.applyTransform(this.transform); - return rect; - }; - /** - * Convert a single (lon, lat) data item to (x, y) point. - */ - View.prototype.dataToPoint = function (data, noRoam, out) { - var transform = noRoam ? this._rawTransform : this.transform; - out = out || []; - return transform ? v2ApplyTransform(out, data, transform) : copy(out, data); - }; - /** - * Convert a (x, y) point to (lon, lat) data - */ - View.prototype.pointToData = function (point) { - var invTransform = this.invTransform; - return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]]; - }; - View.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys(finder); - return coordSys === this ? coordSys.dataToPoint(value) : null; - }; - View.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys(finder); - return coordSys === this ? coordSys.pointToData(pixel) : null; - }; - /** - * @implements - */ - View.prototype.containPoint = function (point) { - return this.getViewRectAfterRoam().contain(point[0], point[1]); - }; - View.dimensions = ['x', 'y']; - return View; - }(Transformable); - function getCoordSys(finder) { - var seriesModel = finder.seriesModel; - return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph. - } - - var GEO_DEFAULT_PARAMS = { - 'geoJSON': { - aspectScale: 0.75, - invertLongitute: true - }, - 'geoSVG': { - aspectScale: 1, - invertLongitute: false - } - }; - var geo2DDimensions = ['lng', 'lat']; - var Geo = /** @class */function (_super) { - __extends(Geo, _super); - function Geo(name, map, opt) { - var _this = _super.call(this, name) || this; - _this.dimensions = geo2DDimensions; - _this.type = 'geo'; - // Only store specified name coord via `addGeoCoord`. - _this._nameCoordMap = createHashMap(); - _this.map = map; - var projection = opt.projection; - var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty); - var resource = geoSourceManager.getGeoResource(map); - var resourceType = _this.resourceType = resource ? resource.type : null; - var regions = _this.regions = source.regions; - var defaultParams = GEO_DEFAULT_PARAMS[resource.type]; - _this._regionsMap = source.regionsMap; - _this.regions = source.regions; - if ("development" !== 'production' && projection) { - // Do some check - if (resourceType === 'geoSVG') { - if ("development" !== 'production') { - warn("Map " + map + " with SVG source can't use projection. Only GeoJSON source supports projection."); - } - projection = null; - } - if (!(projection.project && projection.unproject)) { - if ("development" !== 'production') { - warn('project and unproject must be both provided in the projeciton.'); - } - projection = null; - } - } - _this.projection = projection; - var boundingRect; - if (projection) { - // Can't reuse the raw bounding rect - for (var i = 0; i < regions.length; i++) { - var regionRect = regions[i].getBoundingRect(projection); - boundingRect = boundingRect || regionRect.clone(); - boundingRect.union(regionRect); - } - } else { - boundingRect = source.boundingRect; - } - _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); - // aspectScale and invertLongitute actually is the parameters default raw projection. - // So we ignore them if projection is given. - // Ignore default aspect scale if projection exits. - _this.aspectScale = projection ? 1 : retrieve2(opt.aspectScale, defaultParams.aspectScale); - // Not invert longitude if projection exits. - _this._invertLongitute = projection ? false : defaultParams.invertLongitute; - return _this; - } - Geo.prototype._transformTo = function (x, y, width, height) { - var rect = this.getBoundingRect(); - var invertLongitute = this._invertLongitute; - rect = rect.clone(); - if (invertLongitute) { - // Longitude is inverted. - rect.y = -rect.y - rect.height; - } - var rawTransformable = this._rawTransformable; - rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height)); - var rawParent = rawTransformable.parent; - rawTransformable.parent = null; - rawTransformable.decomposeTransform(); - rawTransformable.parent = rawParent; - if (invertLongitute) { - rawTransformable.scaleY = -rawTransformable.scaleY; - } - this._updateTransform(); - }; - Geo.prototype.getRegion = function (name) { - return this._regionsMap.get(name); - }; - Geo.prototype.getRegionByCoord = function (coord) { - var regions = this.regions; - for (var i = 0; i < regions.length; i++) { - var region = regions[i]; - if (region.type === 'geoJSON' && region.contain(coord)) { - return regions[i]; - } - } - }; - /** - * Add geoCoord for indexing by name - */ - Geo.prototype.addGeoCoord = function (name, geoCoord) { - this._nameCoordMap.set(name, geoCoord); - }; - /** - * Get geoCoord by name - */ - Geo.prototype.getGeoCoord = function (name) { - var region = this._regionsMap.get(name); - // Calculate center only on demand. - return this._nameCoordMap.get(name) || region && region.getCenter(); - }; - Geo.prototype.dataToPoint = function (data, noRoam, out) { - if (isString(data)) { - // Map area name to geoCoord - data = this.getGeoCoord(data); - } - if (data) { - var projection = this.projection; - if (projection) { - // projection may return null point. - data = projection.project(data); - } - return data && this.projectedToPoint(data, noRoam, out); - } - }; - Geo.prototype.pointToData = function (point) { - var projection = this.projection; - if (projection) { - // projection may return null point. - point = projection.unproject(point); - } - return point && this.pointToProjected(point); - }; - /** - * Point to projected data. Same with pointToData when projection is used. - */ - Geo.prototype.pointToProjected = function (point) { - return _super.prototype.pointToData.call(this, point); - }; - Geo.prototype.projectedToPoint = function (projected, noRoam, out) { - return _super.prototype.dataToPoint.call(this, projected, noRoam, out); - }; - Geo.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$1(finder); - return coordSys === this ? coordSys.dataToPoint(value) : null; - }; - Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$1(finder); - return coordSys === this ? coordSys.pointToData(pixel) : null; - }; - return Geo; - }(View); - mixin(Geo, View); - function getCoordSys$1(finder) { - var geoModel = finder.geoModel; - var seriesModel = finder.seriesModel; - return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series. - || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null; - } - - /** - * Resize method bound to the geo - */ - function resizeGeo(geoModel, api) { - var boundingCoords = geoModel.get('boundingCoords'); - if (boundingCoords != null) { - var leftTop_1 = boundingCoords[0]; - var rightBottom_1 = boundingCoords[1]; - if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) { - if ("development" !== 'production') { - console.error('Invalid boundingCoords'); - } - } else { - // Sample around the lng/lat rect and use projection to calculate actual bounding rect. - var projection_1 = this.projection; - if (projection_1) { - var xMin = leftTop_1[0]; - var yMin = leftTop_1[1]; - var xMax = rightBottom_1[0]; - var yMax = rightBottom_1[1]; - leftTop_1 = [Infinity, Infinity]; - rightBottom_1 = [-Infinity, -Infinity]; - // TODO better way? - var sampleLine = function (x0, y0, x1, y1) { - var dx = x1 - x0; - var dy = y1 - y0; - for (var i = 0; i <= 100; i++) { - var p = i / 100; - var pt = projection_1.project([x0 + dx * p, y0 + dy * p]); - min(leftTop_1, leftTop_1, pt); - max(rightBottom_1, rightBottom_1, pt); - } - }; - // Top - sampleLine(xMin, yMin, xMax, yMin); - // Right - sampleLine(xMax, yMin, xMax, yMax); - // Bottom - sampleLine(xMax, yMax, xMin, yMax); - // Left - sampleLine(xMin, yMax, xMax, yMin); - } - this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]); - } - } - var rect = this.getBoundingRect(); - var centerOption = geoModel.get('layoutCenter'); - var sizeOption = geoModel.get('layoutSize'); - var viewWidth = api.getWidth(); - var viewHeight = api.getHeight(); - var aspect = rect.width / rect.height * this.aspectScale; - var useCenterAndSize = false; - var center; - var size; - if (centerOption && sizeOption) { - center = [parsePercent$1(centerOption[0], viewWidth), parsePercent$1(centerOption[1], viewHeight)]; - size = parsePercent$1(sizeOption, Math.min(viewWidth, viewHeight)); - if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) { - useCenterAndSize = true; - } else { - if ("development" !== 'production') { - console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.'); - } - } - } - var viewRect; - if (useCenterAndSize) { - viewRect = {}; - if (aspect > 1) { - // Width is same with size - viewRect.width = size; - viewRect.height = size / aspect; - } else { - viewRect.height = size; - viewRect.width = size * aspect; - } - viewRect.y = center[1] - viewRect.height / 2; - viewRect.x = center[0] - viewRect.width / 2; - } else { - // Use left/top/width/height - var boxLayoutOption = geoModel.getBoxLayoutParams(); - boxLayoutOption.aspect = aspect; - viewRect = getLayoutRect(boxLayoutOption, { - width: viewWidth, - height: viewHeight - }); - } - this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height); - this.setCenter(geoModel.get('center'), api); - this.setZoom(geoModel.get('zoom')); - } - // Back compat for ECharts2, where the coord map is set on map series: - // {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}}, - function setGeoCoords(geo, model) { - each(model.get('geoCoord'), function (geoCoord, name) { - geo.addGeoCoord(name, geoCoord); - }); - } - var GeoCreator = /** @class */function () { - function GeoCreator() { - // For deciding which dimensions to use when creating list data - this.dimensions = geo2DDimensions; - } - GeoCreator.prototype.create = function (ecModel, api) { - var geoList = []; - function getCommonGeoProperties(model) { - return { - nameProperty: model.get('nameProperty'), - aspectScale: model.get('aspectScale'), - projection: model.get('projection') - }; - } - // FIXME Create each time may be slow - ecModel.eachComponent('geo', function (geoModel, idx) { - var mapName = geoModel.get('map'); - var geo = new Geo(mapName + idx, mapName, extend({ - nameMap: geoModel.get('nameMap') - }, getCommonGeoProperties(geoModel))); - geo.zoomLimit = geoModel.get('scaleLimit'); - geoList.push(geo); - // setGeoCoords(geo, geoModel); - geoModel.coordinateSystem = geo; - geo.model = geoModel; - // Inject resize method - geo.resize = resizeGeo; - geo.resize(geoModel, api); - }); - ecModel.eachSeries(function (seriesModel) { - var coordSys = seriesModel.get('coordinateSystem'); - if (coordSys === 'geo') { - var geoIndex = seriesModel.get('geoIndex') || 0; - seriesModel.coordinateSystem = geoList[geoIndex]; - } - }); - // If has map series - var mapModelGroupBySeries = {}; - ecModel.eachSeriesByType('map', function (seriesModel) { - if (!seriesModel.getHostGeoModel()) { - var mapType = seriesModel.getMapType(); - mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; - mapModelGroupBySeries[mapType].push(seriesModel); - } - }); - each(mapModelGroupBySeries, function (mapSeries, mapType) { - var nameMapList = map(mapSeries, function (singleMapSeries) { - return singleMapSeries.get('nameMap'); - }); - var geo = new Geo(mapType, mapType, extend({ - nameMap: mergeAll(nameMapList) - }, getCommonGeoProperties(mapSeries[0]))); - geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) { - return singleMapSeries.get('scaleLimit'); - })); - geoList.push(geo); - // Inject resize method - geo.resize = resizeGeo; - geo.resize(mapSeries[0], api); - each(mapSeries, function (singleMapSeries) { - singleMapSeries.coordinateSystem = geo; - setGeoCoords(geo, singleMapSeries); - }); - }); - return geoList; - }; - /** - * Fill given regions array - */ - GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) { - // Not use the original - var regionsArr = (originRegionArr || []).slice(); - var dataNameMap = createHashMap(); - for (var i = 0; i < regionsArr.length; i++) { - dataNameMap.set(regionsArr[i].name, regionsArr[i]); - } - var source = geoSourceManager.load(mapName, nameMap, nameProperty); - each(source.regions, function (region) { - var name = region.name; - !dataNameMap.get(name) && regionsArr.push({ - name: name - }); - }); - return regionsArr; - }; - return GeoCreator; - }(); - var geoCreator = new GeoCreator(); - - var GeoModel = /** @class */function (_super) { - __extends(GeoModel, _super); - function GeoModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GeoModel.type; - return _this; - } - GeoModel.prototype.init = function (option, parentModel, ecModel) { - var source = geoSourceManager.getGeoResource(option.map); - if (source && source.type === 'geoJSON') { - var itemStyle = option.itemStyle = option.itemStyle || {}; - if (!('color' in itemStyle)) { - itemStyle.color = '#eee'; - } - } - this.mergeDefaultAndTheme(option, ecModel); - // Default label emphasis `show` - defaultEmphasis(option, 'label', ['show']); - }; - GeoModel.prototype.optionUpdated = function () { - var _this = this; - var option = this.option; - option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty); - var selectedMap = {}; - this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) { - var regionName = regionOpt.name; - if (regionName) { - optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel)); - if (regionOpt.selected) { - selectedMap[regionName] = true; - } - } - return optionModelMap; - }, createHashMap()); - if (!option.selectedMap) { - option.selectedMap = selectedMap; - } - }; - /** - * Get model of region. - */ - GeoModel.prototype.getRegionModel = function (name) { - return this._optionModelMap.get(name) || new Model(null, this, this.ecModel); - }; - /** - * Format label - * @param name Region name - */ - GeoModel.prototype.getFormattedLabel = function (name, status) { - var regionModel = this.getRegionModel(name); - var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']); - var params = { - name: name - }; - if (isFunction(formatter)) { - params.status = status; - return formatter(params); - } else if (isString(formatter)) { - return formatter.replace('{a}', name != null ? name : ''); - } - }; - GeoModel.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; - GeoModel.prototype.setCenter = function (center) { - this.option.center = center; - }; - // PENGING If selectedMode is null ? - GeoModel.prototype.select = function (name) { - var option = this.option; - var selectedMode = option.selectedMode; - if (!selectedMode) { - return; - } - if (selectedMode !== 'multiple') { - option.selectedMap = null; - } - var selectedMap = option.selectedMap || (option.selectedMap = {}); - selectedMap[name] = true; - }; - GeoModel.prototype.unSelect = function (name) { - var selectedMap = this.option.selectedMap; - if (selectedMap) { - selectedMap[name] = false; - } - }; - GeoModel.prototype.toggleSelected = function (name) { - this[this.isSelected(name) ? 'unSelect' : 'select'](name); - }; - GeoModel.prototype.isSelected = function (name) { - var selectedMap = this.option.selectedMap; - return !!(selectedMap && selectedMap[name]); - }; - GeoModel.type = 'geo'; - GeoModel.layoutMode = 'box'; - GeoModel.defaultOption = { - // zlevel: 0, - z: 0, - show: true, - left: 'center', - top: 'center', - // Default value: - // for geoSVG source: 1, - // for geoJSON source: 0.75. - aspectScale: null, - // /// Layout with center and size - // If you want to put map in a fixed size box with right aspect ratio - // This two properties may be more convenient - // layoutCenter: [50%, 50%] - // layoutSize: 100 - silent: false, - // Map type - map: '', - // Define left-top, right-bottom coords to control view - // For example, [ [180, 90], [-180, -90] ] - boundingCoords: null, - // Default on center of map - center: null, - zoom: 1, - scaleLimit: null, - // selectedMode: false - label: { - show: false, - color: '#000' - }, - itemStyle: { - borderWidth: 0.5, - borderColor: '#444' - // Default color: - // + geoJSON: #eee - // + geoSVG: null (use SVG original `fill`) - // color: '#eee' - }, - - emphasis: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - color: 'rgba(255,215,0,0.8)' - } - }, - select: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - color: 'rgba(255,215,0,0.8)' - } - }, - regions: [] - // tooltip: { - // show: false - // } - }; - - return GeoModel; - }(ComponentModel); - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 getCenterCoord(view, point) { - // Use projected coord as center because it's linear. - return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point); - } - function updateCenterAndZoom(view, payload, zoomLimit, api) { - var previousZoom = view.getZoom(); - var center = view.getCenter(); - var zoom = payload.zoom; - var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center); - if (payload.dx != null && payload.dy != null) { - point[0] -= payload.dx; - point[1] -= payload.dy; - view.setCenter(getCenterCoord(view, point), api); - } - if (zoom != null) { - if (zoomLimit) { - var zoomMin = zoomLimit.min || 0; - var zoomMax = zoomLimit.max || Infinity; - zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom; - } - // Zoom on given point(originX, originY) - view.scaleX *= zoom; - view.scaleY *= zoom; - var fixX = (payload.originX - view.x) * (zoom - 1); - var fixY = (payload.originY - view.y) * (zoom - 1); - view.x -= fixX; - view.y -= fixY; - view.updateTransform(); - // Get the new center - view.setCenter(getCenterCoord(view, point), api); - view.setZoom(zoom * previousZoom); - } - return { - center: view.getCenter(), - zoom: view.getZoom() - }; - } - - var GeoView = /** @class */function (_super) { - __extends(GeoView, _super); - function GeoView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GeoView.type; - _this.focusBlurEnabled = true; - return _this; - } - GeoView.prototype.init = function (ecModel, api) { - this._api = api; - }; - GeoView.prototype.render = function (geoModel, ecModel, api, payload) { - this._model = geoModel; - if (!geoModel.get('show')) { - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - return; - } - if (!this._mapDraw) { - this._mapDraw = new MapDraw(api); - } - var mapDraw = this._mapDraw; - mapDraw.draw(geoModel, ecModel, api, this, payload); - mapDraw.group.on('click', this._handleRegionClick, this); - mapDraw.group.silent = geoModel.get('silent'); - this.group.add(mapDraw.group); - this.updateSelectStatus(geoModel, ecModel, api); - }; - GeoView.prototype._handleRegionClick = function (e) { - var eventData; - findEventDispatcher(e.target, function (current) { - return (eventData = getECData(current).eventData) != null; - }, true); - if (eventData) { - this._api.dispatchAction({ - type: 'geoToggleSelect', - geoId: this._model.id, - name: eventData.name - }); - } - }; - GeoView.prototype.updateSelectStatus = function (model, ecModel, api) { - var _this = this; - this._mapDraw.group.traverse(function (node) { - var eventData = getECData(node).eventData; - if (eventData) { - _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node); - // No need to traverse children. - return true; - } - }); - }; - GeoView.prototype.findHighDownDispatchers = function (name) { - return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model); - }; - GeoView.prototype.dispose = function () { - this._mapDraw && this._mapDraw.remove(); - }; - GeoView.type = 'geo'; - return GeoView; - }(ComponentView); - - function registerMap$1(mapName, geoJson, specialAreas) { - geoSourceManager.registerMap(mapName, geoJson, specialAreas); - } - function install$9(registers) { - registers.registerCoordinateSystem('geo', geoCreator); - registers.registerComponentModel(GeoModel); - registers.registerComponentView(GeoView); - registers.registerImpl('registerMap', registerMap$1); - registers.registerImpl('getMap', function (mapName) { - return geoSourceManager.getMapForUser(mapName); - }); - function makeAction(method, actionInfo) { - actionInfo.update = 'geo:updateSelectStatus'; - registers.registerAction(actionInfo, function (payload, ecModel) { - var selected = {}; - var allSelected = []; - ecModel.eachComponent({ - mainType: 'geo', - query: payload - }, function (geoModel) { - geoModel[method](payload.name); - var geo = geoModel.coordinateSystem; - each(geo.regions, function (region) { - selected[region.name] = geoModel.isSelected(region.name) || false; - }); - // Notice: there might be duplicated name in different regions. - var names = []; - each(selected, function (v, name) { - selected[name] && names.push(name); - }); - allSelected.push({ - geoIndex: geoModel.componentIndex, - // Use singular, the same naming convention as the event `selectchanged`. - name: names - }); - }); - return { - selected: selected, - allSelected: allSelected, - name: payload.name - }; - }); - } - makeAction('toggleSelected', { - type: 'geoToggleSelect', - event: 'geoselectchanged' - }); - makeAction('select', { - type: 'geoSelect', - event: 'geoselected' - }); - makeAction('unSelect', { - type: 'geoUnSelect', - event: 'geounselected' - }); - /** - * @payload - * @property {string} [componentType=series] - * @property {number} [dx] - * @property {number} [dy] - * @property {number} [zoom] - * @property {number} [originX] - * @property {number} [originY] - */ - registers.registerAction({ - type: 'geoRoam', - event: 'geoRoam', - update: 'updateTransform' - }, function (payload, ecModel, api) { - var componentType = payload.componentType || 'series'; - ecModel.eachComponent({ - mainType: componentType, - query: payload - }, function (componentModel) { - var geo = componentModel.coordinateSystem; - if (geo.type !== 'geo') { - return; - } - var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'), api); - componentModel.setCenter && componentModel.setCenter(res.center); - componentModel.setZoom && componentModel.setZoom(res.zoom); - // All map series with same `map` use the same geo coordinate system - // So the center and zoom must be in sync. Include the series not selected by legend - if (componentType === 'series') { - each(componentModel.seriesGroup, function (seriesModel) { - seriesModel.setCenter(res.center); - seriesModel.setZoom(res.zoom); - }); - } - }); - }); - } - - function install$a(registers) { - use(install$9); - registers.registerChartView(MapView); - registers.registerSeriesModel(MapSeries); - registers.registerLayout(mapSymbolLayout); - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); - createLegacyDataSelectAction('map', registers.registerAction); - } - - /** - * Initialize all computational message for following algorithm. - */ - function init$2(inRoot) { - var root = inRoot; - root.hierNode = { - defaultAncestor: null, - ancestor: root, - prelim: 0, - modifier: 0, - change: 0, - shift: 0, - i: 0, - thread: null - }; - var nodes = [root]; - var node; - var children; - while (node = nodes.pop()) { - // jshint ignore:line - children = node.children; - if (node.isExpand && children.length) { - var n = children.length; - for (var i = n - 1; i >= 0; i--) { - var child = children[i]; - child.hierNode = { - defaultAncestor: null, - ancestor: child, - prelim: 0, - modifier: 0, - change: 0, - shift: 0, - i: i, - thread: null - }; - nodes.push(child); - } - } - } - } - /** - * The implementation of this function was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - * - * Computes a preliminary x coordinate for node. Before that, this function is - * applied recursively to the children of node, as well as the function - * apportion(). After spacing out the children by calling executeShifts(), the - * node is placed to the midpoint of its outermost children. - */ - function firstWalk(node, separation) { - var children = node.isExpand ? node.children : []; - var siblings = node.parentNode.children; - var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null; - if (children.length) { - executeShifts(node); - var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; - if (subtreeW) { - node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); - node.hierNode.modifier = node.hierNode.prelim - midPoint; - } else { - node.hierNode.prelim = midPoint; - } - } else if (subtreeW) { - node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); - } - node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation); - } - /** - * The implementation of this function was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - * - * Computes all real x-coordinates by summing up the modifiers recursively. - */ - function secondWalk(node) { - var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; - node.setLayout({ - x: nodeX - }, true); - node.hierNode.modifier += node.parentNode.hierNode.modifier; - } - function separation(cb) { - return arguments.length ? cb : defaultSeparation; - } - /** - * Transform the common coordinate to radial coordinate. - */ - function radialCoordinate(rad, r) { - rad -= Math.PI / 2; - return { - x: r * Math.cos(rad), - y: r * Math.sin(rad) - }; - } - /** - * Get the layout position of the whole view. - */ - function getViewRect$1(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - } - /** - * All other shifts, applied to the smaller subtrees between w- and w+, are - * performed by this function. - * - * The implementation of this function was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - */ - function executeShifts(node) { - var children = node.children; - var n = children.length; - var shift = 0; - var change = 0; - while (--n >= 0) { - var child = children[n]; - child.hierNode.prelim += shift; - child.hierNode.modifier += shift; - change += child.hierNode.change; - shift += child.hierNode.shift + change; - } - } - /** - * The implementation of this function was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - * - * The core of the algorithm. Here, a new subtree is combined with the - * previous subtrees. Threads are used to traverse the inside and outside - * contours of the left and right subtree up to the highest common level. - * Whenever two nodes of the inside contours conflict, we compute the left - * one of the greatest uncommon ancestors using the function nextAncestor() - * and call moveSubtree() to shift the subtree and prepare the shifts of - * smaller subtrees. Finally, we add a new thread (if necessary). - */ - function apportion(subtreeV, subtreeW, ancestor, separation) { - if (subtreeW) { - var nodeOutRight = subtreeV; - var nodeInRight = subtreeV; - var nodeOutLeft = nodeInRight.parentNode.children[0]; - var nodeInLeft = subtreeW; - var sumOutRight = nodeOutRight.hierNode.modifier; - var sumInRight = nodeInRight.hierNode.modifier; - var sumOutLeft = nodeOutLeft.hierNode.modifier; - var sumInLeft = nodeInLeft.hierNode.modifier; - while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { - nodeOutRight = nextRight(nodeOutRight); - nodeOutLeft = nextLeft(nodeOutLeft); - nodeOutRight.hierNode.ancestor = subtreeV; - var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight); - if (shift > 0) { - moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); - sumInRight += shift; - sumOutRight += shift; - } - sumInLeft += nodeInLeft.hierNode.modifier; - sumInRight += nodeInRight.hierNode.modifier; - sumOutRight += nodeOutRight.hierNode.modifier; - sumOutLeft += nodeOutLeft.hierNode.modifier; - } - if (nodeInLeft && !nextRight(nodeOutRight)) { - nodeOutRight.hierNode.thread = nodeInLeft; - nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; - } - if (nodeInRight && !nextLeft(nodeOutLeft)) { - nodeOutLeft.hierNode.thread = nodeInRight; - nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; - ancestor = subtreeV; - } - } - return ancestor; - } - /** - * This function is used to traverse the right contour of a subtree. - * It returns the rightmost child of node or the thread of node. The function - * returns null if and only if node is on the highest depth of its subtree. - */ - function nextRight(node) { - var children = node.children; - return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; - } - /** - * This function is used to traverse the left contour of a subtree (or a subforest). - * It returns the leftmost child of node or the thread of node. The function - * returns null if and only if node is on the highest depth of its subtree. - */ - function nextLeft(node) { - var children = node.children; - return children.length && node.isExpand ? children[0] : node.hierNode.thread; - } - /** - * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor. - * Otherwise, returns the specified ancestor. - */ - function nextAncestor(nodeInLeft, node, ancestor) { - return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor; - } - /** - * The implementation of this function was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - * - * Shifts the current subtree rooted at wr. - * This is done by increasing prelim(w+) and modifier(w+) by shift. - */ - function moveSubtree(wl, wr, shift) { - var change = shift / (wr.hierNode.i - wl.hierNode.i); - wr.hierNode.change -= change; - wr.hierNode.shift += shift; - wr.hierNode.modifier += shift; - wr.hierNode.prelim += shift; - wl.hierNode.change += change; - } - /** - * The implementation of this function was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - */ - function defaultSeparation(node1, node2) { - return node1.parentNode === node2.parentNode ? 1 : 2; - } - - var TreeEdgeShape = /** @class */function () { - function TreeEdgeShape() { - this.parentPoint = []; - this.childPoints = []; - } - return TreeEdgeShape; - }(); - var TreePath = /** @class */function (_super) { - __extends(TreePath, _super); - function TreePath(opts) { - return _super.call(this, opts) || this; - } - TreePath.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - TreePath.prototype.getDefaultShape = function () { - return new TreeEdgeShape(); - }; - TreePath.prototype.buildPath = function (ctx, shape) { - var childPoints = shape.childPoints; - var childLen = childPoints.length; - var parentPoint = shape.parentPoint; - var firstChildPos = childPoints[0]; - var lastChildPos = childPoints[childLen - 1]; - if (childLen === 1) { - ctx.moveTo(parentPoint[0], parentPoint[1]); - ctx.lineTo(firstChildPos[0], firstChildPos[1]); - return; - } - var orient = shape.orient; - var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1; - var otherDim = 1 - forkDim; - var forkPosition = parsePercent$1(shape.forkPosition, 1); - var tmpPoint = []; - tmpPoint[forkDim] = parentPoint[forkDim]; - tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition; - ctx.moveTo(parentPoint[0], parentPoint[1]); - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - ctx.moveTo(firstChildPos[0], firstChildPos[1]); - tmpPoint[forkDim] = firstChildPos[forkDim]; - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - tmpPoint[forkDim] = lastChildPos[forkDim]; - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - ctx.lineTo(lastChildPos[0], lastChildPos[1]); - for (var i = 1; i < childLen - 1; i++) { - var point = childPoints[i]; - ctx.moveTo(point[0], point[1]); - tmpPoint[forkDim] = point[forkDim]; - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - } - }; - return TreePath; - }(Path); - var TreeView = /** @class */function (_super) { - __extends(TreeView, _super); - function TreeView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TreeView.type; - _this._mainGroup = new Group(); - return _this; - } - TreeView.prototype.init = function (ecModel, api) { - this._controller = new RoamController(api.getZr()); - this._controllerHost = { - target: this.group - }; - this.group.add(this._mainGroup); - }; - TreeView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var layoutInfo = seriesModel.layoutInfo; - var group = this._mainGroup; - var layout = seriesModel.get('layout'); - if (layout === 'radial') { - group.x = layoutInfo.x + layoutInfo.width / 2; - group.y = layoutInfo.y + layoutInfo.height / 2; - } else { - group.x = layoutInfo.x; - group.y = layoutInfo.y; - } - this._updateViewCoordSys(seriesModel, api); - this._updateController(seriesModel, ecModel, api); - var oldData = this._data; - data.diff(oldData).add(function (newIdx) { - if (symbolNeedsDraw$1(data, newIdx)) { - // Create node and edge - updateNode(data, newIdx, null, group, seriesModel); - } - }).update(function (newIdx, oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); - if (!symbolNeedsDraw$1(data, newIdx)) { - symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel); - return; - } - // Update node and edge - updateNode(data, newIdx, symbolEl, group, seriesModel); - }).remove(function (oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); - // When remove a collapsed node of subtree, since the collapsed - // node haven't been initialized with a symbol element, - // you can't found it's symbol element through index. - // so if we want to remove the symbol element we should insure - // that the symbol element is not null. - if (symbolEl) { - removeNode(oldData, oldIdx, symbolEl, group, seriesModel); - } - }).execute(); - this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); - this._updateNodeAndLinkScale(seriesModel); - if (seriesModel.get('expandAndCollapse') === true) { - data.eachItemGraphicEl(function (el, dataIndex) { - el.off('click').on('click', function () { - api.dispatchAction({ - type: 'treeExpandAndCollapse', - seriesId: seriesModel.id, - dataIndex: dataIndex - }); - }); - }); - } - this._data = data; - }; - TreeView.prototype._updateViewCoordSys = function (seriesModel, api) { - var data = seriesModel.getData(); - var points = []; - data.each(function (idx) { - var layout = data.getItemLayout(idx); - if (layout && !isNaN(layout.x) && !isNaN(layout.y)) { - points.push([+layout.x, +layout.y]); - } - }); - var min = []; - var max = []; - fromPoints(points, min, max); - // If don't Store min max when collapse the root node after roam, - // the root node will disappear. - var oldMin = this._min; - var oldMax = this._max; - // If width or height is 0 - if (max[0] - min[0] === 0) { - min[0] = oldMin ? oldMin[0] : min[0] - 1; - max[0] = oldMax ? oldMax[0] : max[0] + 1; - } - if (max[1] - min[1] === 0) { - min[1] = oldMin ? oldMin[1] : min[1] - 1; - max[1] = oldMax ? oldMax[1] : max[1] + 1; - } - var viewCoordSys = seriesModel.coordinateSystem = new View(); - viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); - viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); - viewCoordSys.setCenter(seriesModel.get('center'), api); - viewCoordSys.setZoom(seriesModel.get('zoom')); - // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group - this.group.attr({ - x: viewCoordSys.x, - y: viewCoordSys.y, - scaleX: viewCoordSys.scaleX, - scaleY: viewCoordSys.scaleY - }); - this._min = min; - this._max = max; - }; - TreeView.prototype._updateController = function (seriesModel, ecModel, api) { - var _this = this; - var controller = this._controller; - var controllerHost = this._controllerHost; - var group = this.group; - controller.setPointerChecker(function (e, x, y) { - var rect = group.getBoundingRect(); - rect.applyTransform(group.transform); - return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel); - }); - controller.enable(seriesModel.get('roam')); - controllerHost.zoomLimit = seriesModel.get('scaleLimit'); - controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); - controller.off('pan').off('zoom').on('pan', function (e) { - updateViewOnPan(controllerHost, e.dx, e.dy); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'treeRoam', - dx: e.dx, - dy: e.dy - }); - }).on('zoom', function (e) { - updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'treeRoam', - zoom: e.scale, - originX: e.originX, - originY: e.originY - }); - _this._updateNodeAndLinkScale(seriesModel); - // Only update label layout on zoom - api.updateLabelLayout(); - }); - }; - TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) { - var data = seriesModel.getData(); - var nodeScale = this._getNodeGlobalScale(seriesModel); - data.eachItemGraphicEl(function (el, idx) { - el.setSymbolScale(nodeScale); - }); - }; - TreeView.prototype._getNodeGlobalScale = function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys.type !== 'view') { - return 1; - } - var nodeScaleRatio = this._nodeScaleRatio; - var groupZoom = coordSys.scaleX || 1; - // Scale node when zoom changes - var roamZoom = coordSys.getZoom(); - var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; - return nodeScale / groupZoom; - }; - TreeView.prototype.dispose = function () { - this._controller && this._controller.dispose(); - this._controllerHost = null; - }; - TreeView.prototype.remove = function () { - this._mainGroup.removeAll(); - this._data = null; - }; - TreeView.type = 'tree'; - return TreeView; - }(ChartView); - function symbolNeedsDraw$1(data, dataIndex) { - var layout = data.getItemLayout(dataIndex); - return layout && !isNaN(layout.x) && !isNaN(layout.y); - } - function updateNode(data, dataIndex, symbolEl, group, seriesModel) { - var isInit = !symbolEl; - var node = data.tree.getNodeByDataIndex(dataIndex); - var itemModel = node.getModel(); - var visualColor = node.getVisual('style').fill; - var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : '#fff'; - var virtualRoot = data.tree.root; - var source = node.parentNode === virtualRoot ? node : node.parentNode || node; - var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); - var sourceLayout = source.getLayout(); - var sourceOldLayout = sourceSymbolEl ? { - x: sourceSymbolEl.__oldX, - y: sourceSymbolEl.__oldY, - rawX: sourceSymbolEl.__radialOldRawX, - rawY: sourceSymbolEl.__radialOldRawY - } : sourceLayout; - var targetLayout = node.getLayout(); - if (isInit) { - symbolEl = new Symbol(data, dataIndex, null, { - symbolInnerColor: symbolInnerColor, - useNameLabel: true - }); - symbolEl.x = sourceOldLayout.x; - symbolEl.y = sourceOldLayout.y; - } else { - symbolEl.updateData(data, dataIndex, null, { - symbolInnerColor: symbolInnerColor, - useNameLabel: true - }); - } - symbolEl.__radialOldRawX = symbolEl.__radialRawX; - symbolEl.__radialOldRawY = symbolEl.__radialRawY; - symbolEl.__radialRawX = targetLayout.rawX; - symbolEl.__radialRawY = targetLayout.rawY; - group.add(symbolEl); - data.setItemGraphicEl(dataIndex, symbolEl); - symbolEl.__oldX = symbolEl.x; - symbolEl.__oldY = symbolEl.y; - updateProps(symbolEl, { - x: targetLayout.x, - y: targetLayout.y - }, seriesModel); - var symbolPath = symbolEl.getSymbolPath(); - if (seriesModel.get('layout') === 'radial') { - var realRoot = virtualRoot.children[0]; - var rootLayout = realRoot.getLayout(); - var length_1 = realRoot.children.length; - var rad = void 0; - var isLeft = void 0; - if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) { - var center = { - x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2, - y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2 - }; - rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x); - if (rad < 0) { - rad = Math.PI * 2 + rad; - } - isLeft = center.x < rootLayout.x; - if (isLeft) { - rad = rad - Math.PI; - } - } else { - rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x); - if (rad < 0) { - rad = Math.PI * 2 + rad; - } - if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) { - isLeft = targetLayout.x < rootLayout.x; - if (isLeft) { - rad = rad - Math.PI; - } - } else { - isLeft = targetLayout.x > rootLayout.x; - if (!isLeft) { - rad = rad - Math.PI; - } - } - } - var textPosition = isLeft ? 'left' : 'right'; - var normalLabelModel = itemModel.getModel('label'); - var rotate = normalLabelModel.get('rotate'); - var labelRotateRadian = rotate * (Math.PI / 180); - var textContent = symbolPath.getTextContent(); - if (textContent) { - symbolPath.setTextConfig({ - position: normalLabelModel.get('position') || textPosition, - rotation: rotate == null ? -rad : labelRotateRadian, - origin: 'center' - }); - textContent.setStyle('verticalAlign', 'middle'); - } - } - // Handle status - var focus = itemModel.get(['emphasis', 'focus']); - var focusDataIndices = focus === 'relative' ? concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null; - if (focusDataIndices) { - // Modify the focus to data indices. - getECData(symbolEl).focus = focusDataIndices; - } - drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group); - if (symbolEl.__edge) { - symbolEl.onHoverStateChange = function (toState) { - if (toState !== 'blur') { - // NOTE: Ensure the parent elements will been blurred firstly. - // According to the return of getAncestorsIndices and getDescendantIndices - // TODO: A bit tricky. - var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex); - if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) { - setStatesFlag(symbolEl.__edge, toState); - } - } - }; - } - } - function drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) { - var itemModel = node.getModel(); - var edgeShape = seriesModel.get('edgeShape'); - var layout = seriesModel.get('layout'); - var orient = seriesModel.getOrient(); - var curvature = seriesModel.get(['lineStyle', 'curveness']); - var edgeForkPosition = seriesModel.get('edgeForkPosition'); - var lineStyle = itemModel.getModel('lineStyle').getLineStyle(); - var edge = symbolEl.__edge; - // curve edge from node -> parent - // polyline edge from node -> children - if (edgeShape === 'curve') { - if (node.parentNode && node.parentNode !== virtualRoot) { - if (!edge) { - edge = symbolEl.__edge = new BezierCurve({ - shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout) - }); - } - updateProps(edge, { - shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout) - }, seriesModel); - } - } else if (edgeShape === 'polyline') { - if (layout === 'orthogonal') { - if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) { - var children = node.children; - var childPoints = []; - for (var i = 0; i < children.length; i++) { - var childLayout = children[i].getLayout(); - childPoints.push([childLayout.x, childLayout.y]); - } - if (!edge) { - edge = symbolEl.__edge = new TreePath({ - shape: { - parentPoint: [targetLayout.x, targetLayout.y], - childPoints: [[targetLayout.x, targetLayout.y]], - orient: orient, - forkPosition: edgeForkPosition - } - }); - } - updateProps(edge, { - shape: { - parentPoint: [targetLayout.x, targetLayout.y], - childPoints: childPoints - } - }, seriesModel); - } - } else { - if ("development" !== 'production') { - throw new Error('The polyline edgeShape can only be used in orthogonal layout'); - } - } - } - // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline' - if (edge && !(edgeShape === 'polyline' && !node.isExpand)) { - edge.useStyle(defaults({ - strokeNoScale: true, - fill: null - }, lineStyle)); - setStatesStylesFromModel(edge, itemModel, 'lineStyle'); - setDefaultStateProxy(edge); - group.add(edge); - } - } - function removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) { - var virtualRoot = data.tree.root; - var _a = getSourceNode(virtualRoot, node), - source = _a.source, - sourceLayout = _a.sourceLayout; - var symbolEl = data.getItemGraphicEl(node.dataIndex); - if (!symbolEl) { - return; - } - var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); - var sourceEdge = sourceSymbolEl.__edge; - // 1. when expand the sub tree, delete the children node should delete the edge of - // the source at the same time. because the polyline edge shape is only owned by the source. - // 2.when the node is the only children of the source, delete the node should delete the edge of - // the source at the same time. the same reason as above. - var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined); - var edgeShape = seriesModel.get('edgeShape'); - var layoutOpt = seriesModel.get('layout'); - var orient = seriesModel.get('orient'); - var curvature = seriesModel.get(['lineStyle', 'curveness']); - if (edge) { - if (edgeShape === 'curve') { - removeElement(edge, { - shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout), - style: { - opacity: 0 - } - }, seriesModel, { - cb: function () { - group.remove(edge); - }, - removeOpt: removeAnimationOpt - }); - } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') { - removeElement(edge, { - shape: { - parentPoint: [sourceLayout.x, sourceLayout.y], - childPoints: [[sourceLayout.x, sourceLayout.y]] - }, - style: { - opacity: 0 - } - }, seriesModel, { - cb: function () { - group.remove(edge); - }, - removeOpt: removeAnimationOpt - }); - } - } - } - function getSourceNode(virtualRoot, node) { - var source = node.parentNode === virtualRoot ? node : node.parentNode || node; - var sourceLayout; - while (sourceLayout = source.getLayout(), sourceLayout == null) { - source = source.parentNode === virtualRoot ? source : source.parentNode || source; - } - return { - source: source, - sourceLayout: sourceLayout - }; - } - function removeNode(data, dataIndex, symbolEl, group, seriesModel) { - var node = data.tree.getNodeByDataIndex(dataIndex); - var virtualRoot = data.tree.root; - var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout; - // Use same duration and easing with update to have more consistent animation. - var removeAnimationOpt = { - duration: seriesModel.get('animationDurationUpdate'), - easing: seriesModel.get('animationEasingUpdate') - }; - removeElement(symbolEl, { - x: sourceLayout.x + 1, - y: sourceLayout.y + 1 - }, seriesModel, { - cb: function () { - group.remove(symbolEl); - data.setItemGraphicEl(dataIndex, null); - }, - removeOpt: removeAnimationOpt - }); - symbolEl.fadeOut(null, data.hostModel, { - fadeLabel: true, - animation: removeAnimationOpt - }); - // remove edge as parent node - node.children.forEach(function (childNode) { - removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt); - }); - // remove edge as child node - removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt); - } - function getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) { - var cpx1; - var cpy1; - var cpx2; - var cpy2; - var x1; - var x2; - var y1; - var y2; - if (layoutOpt === 'radial') { - x1 = sourceLayout.rawX; - y1 = sourceLayout.rawY; - x2 = targetLayout.rawX; - y2 = targetLayout.rawY; - var radialCoor1 = radialCoordinate(x1, y1); - var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature); - var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature); - var radialCoor4 = radialCoordinate(x2, y2); - return { - x1: radialCoor1.x || 0, - y1: radialCoor1.y || 0, - x2: radialCoor4.x || 0, - y2: radialCoor4.y || 0, - cpx1: radialCoor2.x || 0, - cpy1: radialCoor2.y || 0, - cpx2: radialCoor3.x || 0, - cpy2: radialCoor3.y || 0 - }; - } else { - x1 = sourceLayout.x; - y1 = sourceLayout.y; - x2 = targetLayout.x; - y2 = targetLayout.y; - if (orient === 'LR' || orient === 'RL') { - cpx1 = x1 + (x2 - x1) * curvature; - cpy1 = y1; - cpx2 = x2 + (x1 - x2) * curvature; - cpy2 = y2; - } - if (orient === 'TB' || orient === 'BT') { - cpx1 = x1; - cpy1 = y1 + (y2 - y1) * curvature; - cpx2 = x2; - cpy2 = y2 + (y1 - y2) * curvature; - } - } - return { - x1: x1, - y1: y1, - x2: x2, - y2: y2, - cpx1: cpx1, - cpy1: cpy1, - cpx2: cpx2, - cpy2: cpy2 - }; - } - - var inner$7 = makeInner(); - function linkSeriesData(opt) { - var mainData = opt.mainData; - var datas = opt.datas; - if (!datas) { - datas = { - main: mainData - }; - opt.datasAttr = { - main: 'data' - }; - } - opt.datas = opt.mainData = null; - linkAll(mainData, datas, opt); - // Porxy data original methods. - each(datas, function (data) { - each(mainData.TRANSFERABLE_METHODS, function (methodName) { - data.wrapMethod(methodName, curry(transferInjection, opt)); - }); - }); - // Beyond transfer, additional features should be added to `cloneShallow`. - mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); - // Only mainData trigger change, because struct.update may trigger - // another changable methods, which may bring about dead lock. - each(mainData.CHANGABLE_METHODS, function (methodName) { - mainData.wrapMethod(methodName, curry(changeInjection, opt)); - }); - // Make sure datas contains mainData. - assert(datas[mainData.dataType] === mainData); - } - function transferInjection(opt, res) { - if (isMainData(this)) { - // Transfer datas to new main data. - var datas = extend({}, inner$7(this).datas); - datas[this.dataType] = res; - linkAll(res, datas, opt); - } else { - // Modify the reference in main data to point newData. - linkSingle(res, this.dataType, inner$7(this).mainData, opt); - } - return res; - } - function changeInjection(opt, res) { - opt.struct && opt.struct.update(); - return res; - } - function cloneShallowInjection(opt, res) { - // cloneShallow, which brings about some fragilities, may be inappropriate - // to be exposed as an API. So for implementation simplicity we can make - // the restriction that cloneShallow of not-mainData should not be invoked - // outside, but only be invoked here. - each(inner$7(res).datas, function (data, dataType) { - data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); - }); - return res; - } - /** - * Supplement method to List. - * - * @public - * @param [dataType] If not specified, return mainData. - */ - function getLinkedData(dataType) { - var mainData = inner$7(this).mainData; - return dataType == null || mainData == null ? mainData : inner$7(mainData).datas[dataType]; - } - /** - * Get list of all linked data - */ - function getLinkedDataAll() { - var mainData = inner$7(this).mainData; - return mainData == null ? [{ - data: mainData - }] : map(keys(inner$7(mainData).datas), function (type) { - return { - type: type, - data: inner$7(mainData).datas[type] - }; - }); - } - function isMainData(data) { - return inner$7(data).mainData === data; - } - function linkAll(mainData, datas, opt) { - inner$7(mainData).datas = {}; - each(datas, function (data, dataType) { - linkSingle(data, dataType, mainData, opt); - }); - } - function linkSingle(data, dataType, mainData, opt) { - inner$7(mainData).datas[dataType] = data; - inner$7(data).mainData = mainData; - data.dataType = dataType; - if (opt.struct) { - data[opt.structAttr] = opt.struct; - opt.struct[opt.datasAttr[dataType]] = data; - } - // Supplement method. - data.getLinkedData = getLinkedData; - data.getLinkedDataAll = getLinkedDataAll; - } - - var TreeNode = /** @class */function () { - function TreeNode(name, hostTree) { - this.depth = 0; - this.height = 0; - /** - * 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. - */ - this.dataIndex = -1; - this.children = []; - this.viewChildren = []; - this.isExpand = false; - this.name = name || ''; - this.hostTree = hostTree; - } - /** - * The node is removed. - */ - TreeNode.prototype.isRemoved = function () { - return this.dataIndex < 0; - }; - TreeNode.prototype.eachNode = function (options, cb, context) { - if (isFunction(options)) { - context = cb; - cb = options; - options = null; - } - options = options || {}; - if (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. - */ - TreeNode.prototype.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; - }; - TreeNode.prototype.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; - } - } - }; - TreeNode.prototype.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 includeSelf Default false. - * @return order: [root, child, grandchild, ...] - */ - TreeNode.prototype.getAncestors = function (includeSelf) { - var ancestors = []; - var node = includeSelf ? this : this.parentNode; - while (node) { - ancestors.push(node); - node = node.parentNode; - } - ancestors.reverse(); - return ancestors; - }; - TreeNode.prototype.getAncestorsIndices = function () { - var indices = []; - var currNode = this; - while (currNode) { - indices.push(currNode.dataIndex); - currNode = currNode.parentNode; - } - indices.reverse(); - return indices; - }; - TreeNode.prototype.getDescendantIndices = function () { - var indices = []; - this.eachNode(function (childNode) { - indices.push(childNode.dataIndex); - }); - return indices; - }; - TreeNode.prototype.getValue = function (dimension) { - var data = this.hostTree.data; - return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex); - }; - TreeNode.prototype.setLayout = function (layout, merge) { - this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge); - }; - /** - * @return {Object} layout - */ - TreeNode.prototype.getLayout = function () { - return this.hostTree.data.getItemLayout(this.dataIndex); - }; - // @depcrecated - // getModel(path: S): Model - // eslint-disable-next-line @typescript-eslint/no-unused-vars - TreeNode.prototype.getModel = function (path) { - if (this.dataIndex < 0) { - return; - } - var hostTree = this.hostTree; - var itemModel = hostTree.data.getItemModel(this.dataIndex); - return itemModel.getModel(path); - }; - // TODO: TYPE More specific model - TreeNode.prototype.getLevelModel = function () { - return (this.hostTree.levelModels || [])[this.depth]; - }; - TreeNode.prototype.setVisual = function (key, value) { - this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value); - }; - /** - * Get item visual - * FIXME: make return type better - */ - TreeNode.prototype.getVisual = function (key) { - return this.hostTree.data.getItemVisual(this.dataIndex, key); - }; - TreeNode.prototype.getRawIndex = function () { - return this.hostTree.data.getRawIndex(this.dataIndex); - }; - TreeNode.prototype.getId = function () { - return this.hostTree.data.getId(this.dataIndex); - }; - /** - * index in parent's children - */ - TreeNode.prototype.getChildIndex = function () { - if (this.parentNode) { - var children = this.parentNode.children; - for (var i = 0; i < children.length; ++i) { - if (children[i] === this) { - return i; - } - } - return -1; - } - return -1; - }; - /** - * if this is an ancestor of another node - * - * @param node another node - * @return if is ancestor - */ - TreeNode.prototype.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 - * - * @param node another node - * @return if is descendant - */ - TreeNode.prototype.isDescendantOf = function (node) { - return node !== this && node.isAncestorOf(this); - }; - return TreeNode; - }(); - var Tree = /** @class */function () { - function Tree(hostModel) { - this.type = 'tree'; - this._nodes = []; - this.hostModel = hostModel; - } - Tree.prototype.eachNode = function (options, cb, context) { - this.root.eachNode(options, cb, context); - }; - Tree.prototype.getNodeByDataIndex = function (dataIndex) { - var rawIndex = this.data.getRawIndex(dataIndex); - return this._nodes[rawIndex]; - }; - Tree.prototype.getNodeById = function (name) { - return this.root.getNodeById(name); - }; - /** - * Update item available by list, - * when list has been performed options like 'filterSelf' or 'map'. - */ - Tree.prototype.update = function () { - var data = this.data; - var nodes = this._nodes; - 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; - } - }; - /** - * Clear all layouts - */ - Tree.prototype.clearLayouts = function () { - this.data.clearItemLayouts(); - }; - /** - * data node format: - * { - * name: ... - * value: ... - * children: [ - * { - * name: ... - * value: ... - * children: ... - * }, - * ... - * ] - * } - */ - Tree.createTree = function (dataRoot, hostModel, beforeLink) { - var tree = new Tree(hostModel); - var listData = []; - var dimMax = 1; - buildHierarchy(dataRoot); - function buildHierarchy(dataNode, parentNode) { - var value = dataNode.value; - dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); - listData.push(dataNode); - var node = new TreeNode(convertOptionIdName(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 dimensions = prepareSeriesDataSchema(listData, { - coordDimensions: ['value'], - dimensionsCount: dimMax - }).dimensions; - var list = new SeriesData(dimensions, hostModel); - list.initData(listData); - beforeLink && beforeLink(list); - linkSeriesData({ - mainData: list, - struct: tree, - structAttr: 'tree' - }); - tree.update(); - return tree; - }; - 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. - */ - function addChild(child, node) { - var children = node.children; - if (child.parentNode === node) { - return; - } - children.push(child); - child.parentNode = node; - } - - function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) { - if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { - var root = seriesModel.getData().tree.root; - var targetNode = payload.targetNode; - if (isString(targetNode)) { - targetNode = root.getNodeById(targetNode); - } - if (targetNode && root.contains(targetNode)) { - return { - node: targetNode - }; - } - var targetNodeId = payload.targetNodeId; - if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { - return { - node: targetNode - }; - } - } - } - // Not includes the given node at the last item. - function getPathToRoot(node) { - var path = []; - while (node) { - node = node.parentNode; - node && path.push(node); - } - return path.reverse(); - } - function aboveViewRoot(viewRoot, node) { - var viewPath = getPathToRoot(viewRoot); - return indexOf(viewPath, node) >= 0; - } - // From root to the input node (the input node will be included). - function wrapTreePathInfo(node, seriesModel) { - var treePathInfo = []; - while (node) { - var nodeDataIndex = node.dataIndex; - treePathInfo.push({ - name: node.name, - dataIndex: nodeDataIndex, - value: seriesModel.getRawValue(nodeDataIndex) - }); - node = node.parentNode; - } - treePathInfo.reverse(); - return treePathInfo; - } - - var TreeSeriesModel = /** @class */function (_super) { - __extends(TreeSeriesModel, _super); - function TreeSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.hasSymbolVisual = true; - // Do it self. - _this.ignoreStyleOnData = true; - return _this; - } - /** - * Init a tree data structure from data in option series - */ - TreeSeriesModel.prototype.getInitialData = function (option) { - // create a virtual root - var root = { - name: option.name, - children: option.data - }; - var leaves = option.leaves || {}; - var leavesModel = new Model(leaves, this, this.ecModel); - var tree = Tree.createTree(root, this, beforeLink); - function beforeLink(nodeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var node = tree.getNodeByDataIndex(idx); - if (!(node && node.children.length && node.isExpand)) { - model.parentModel = leavesModel; - } - return model; - }); - } - var treeDepth = 0; - tree.eachNode('preorder', function (node) { - if (node.depth > treeDepth) { - treeDepth = node.depth; - } - }); - var expandAndCollapse = option.expandAndCollapse; - var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth; - tree.root.eachNode('preorder', function (node) { - var item = node.hostTree.data.getRawDataItem(node.dataIndex); - // Add item.collapsed != null, because users can collapse node original in the series.data. - node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth; - }); - return tree.data; - }; - /** - * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'. - * @returns {string} orient - */ - TreeSeriesModel.prototype.getOrient = function () { - var orient = this.get('orient'); - if (orient === 'horizontal') { - orient = 'LR'; - } else if (orient === 'vertical') { - orient = 'TB'; - } - return orient; - }; - TreeSeriesModel.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; - TreeSeriesModel.prototype.setCenter = function (center) { - this.option.center = center; - }; - TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var tree = this.getData().tree; - var realRoot = tree.root.children[0]; - var node = tree.getNodeByDataIndex(dataIndex); - var value = node.getValue(); - var name = node.name; - while (node && node !== realRoot) { - name = node.parentNode.name + '.' + name; - node = node.parentNode; - } - return createTooltipMarkup('nameValue', { - name: name, - value: value, - noValue: isNaN(value) || value == null - }); - }; - // Add tree path to tooltip param - TreeSeriesModel.prototype.getDataParams = function (dataIndex) { - var params = _super.prototype.getDataParams.apply(this, arguments); - var node = this.getData().tree.getNodeByDataIndex(dataIndex); - params.treeAncestors = wrapTreePathInfo(node, this); - params.collapsed = !node.isExpand; - return params; - }; - TreeSeriesModel.type = 'series.tree'; - // can support the position parameters 'left', 'top','right','bottom', 'width', - // 'height' in the setOption() with 'merge' mode normal. - TreeSeriesModel.layoutMode = 'box'; - TreeSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'view', - // the position of the whole view - left: '12%', - top: '12%', - right: '12%', - bottom: '12%', - // the layout of the tree, two value can be selected, 'orthogonal' or 'radial' - layout: 'orthogonal', - // value can be 'polyline' - edgeShape: 'curve', - edgeForkPosition: '50%', - // true | false | 'move' | 'scale', see module:component/helper/RoamController. - roam: false, - // Symbol size scale ratio in roam - nodeScaleRatio: 0.4, - // Default on center of graph - center: null, - zoom: 1, - orient: 'LR', - symbol: 'emptyCircle', - symbolSize: 7, - expandAndCollapse: true, - initialTreeDepth: 2, - lineStyle: { - color: '#ccc', - width: 1.5, - curveness: 0.5 - }, - itemStyle: { - color: 'lightsteelblue', - // borderColor: '#c23531', - borderWidth: 1.5 - }, - label: { - show: true - }, - animationEasing: 'linear', - animationDuration: 700, - animationDurationUpdate: 500 - }; - return TreeSeriesModel; - }(SeriesModel); - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - /** - * Traverse the tree from bottom to top and do something - */ - function eachAfter(root, callback, separation) { - var nodes = [root]; - var next = []; - var node; - while (node = nodes.pop()) { - // jshint ignore:line - next.push(node); - if (node.isExpand) { - var children = node.children; - if (children.length) { - for (var i = 0; i < children.length; i++) { - nodes.push(children[i]); - } - } - } - } - while (node = next.pop()) { - // jshint ignore:line - callback(node, separation); - } - } - /** - * Traverse the tree from top to bottom and do something - */ - function eachBefore(root, callback) { - var nodes = [root]; - var node; - while (node = nodes.pop()) { - // jshint ignore:line - callback(node); - if (node.isExpand) { - var children = node.children; - if (children.length) { - for (var i = children.length - 1; i >= 0; i--) { - nodes.push(children[i]); - } - } - } - } - } - - function treeLayout(ecModel, api) { - ecModel.eachSeriesByType('tree', function (seriesModel) { - commonLayout(seriesModel, api); - }); - } - function commonLayout(seriesModel, api) { - var layoutInfo = getViewRect$1(seriesModel, api); - seriesModel.layoutInfo = layoutInfo; - var layout = seriesModel.get('layout'); - var width = 0; - var height = 0; - var separation$1 = null; - if (layout === 'radial') { - width = 2 * Math.PI; - height = Math.min(layoutInfo.height, layoutInfo.width) / 2; - separation$1 = separation(function (node1, node2) { - return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; - }); - } else { - width = layoutInfo.width; - height = layoutInfo.height; - separation$1 = separation(); - } - var virtualRoot = seriesModel.getData().tree.root; - var realRoot = virtualRoot.children[0]; - if (realRoot) { - init$2(virtualRoot); - eachAfter(realRoot, firstWalk, separation$1); - virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim; - eachBefore(realRoot, secondWalk); - var left_1 = realRoot; - var right_1 = realRoot; - var bottom_1 = realRoot; - eachBefore(realRoot, function (node) { - var x = node.getLayout().x; - if (x < left_1.getLayout().x) { - left_1 = node; - } - if (x > right_1.getLayout().x) { - right_1 = node; - } - if (node.depth > bottom_1.depth) { - bottom_1 = node; - } - }); - var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2; - var tx_1 = delta - left_1.getLayout().x; - var kx_1 = 0; - var ky_1 = 0; - var coorX_1 = 0; - var coorY_1 = 0; - if (layout === 'radial') { - kx_1 = width / (right_1.getLayout().x + delta + tx_1); - // here we use (node.depth - 1), bucause the real root's depth is 1 - ky_1 = height / (bottom_1.depth - 1 || 1); - eachBefore(realRoot, function (node) { - coorX_1 = (node.getLayout().x + tx_1) * kx_1; - coorY_1 = (node.depth - 1) * ky_1; - var finalCoor = radialCoordinate(coorX_1, coorY_1); - node.setLayout({ - x: finalCoor.x, - y: finalCoor.y, - rawX: coorX_1, - rawY: coorY_1 - }, true); - }); - } else { - var orient_1 = seriesModel.getOrient(); - if (orient_1 === 'RL' || orient_1 === 'LR') { - ky_1 = height / (right_1.getLayout().x + delta + tx_1); - kx_1 = width / (bottom_1.depth - 1 || 1); - eachBefore(realRoot, function (node) { - coorY_1 = (node.getLayout().x + tx_1) * ky_1; - coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1; - node.setLayout({ - x: coorX_1, - y: coorY_1 - }, true); - }); - } else if (orient_1 === 'TB' || orient_1 === 'BT') { - kx_1 = width / (right_1.getLayout().x + delta + tx_1); - ky_1 = height / (bottom_1.depth - 1 || 1); - eachBefore(realRoot, function (node) { - coorX_1 = (node.getLayout().x + tx_1) * kx_1; - coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1; - node.setLayout({ - x: coorX_1, - y: coorY_1 - }, true); - }); - } - } - } - } - - function treeVisual(ecModel) { - ecModel.eachSeriesByType('tree', function (seriesModel) { - var data = seriesModel.getData(); - var tree = data.tree; - tree.eachNode(function (node) { - var model = node.getModel(); - // TODO Optimize - var style = model.getModel('itemStyle').getItemStyle(); - var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); - extend(existsStyle, style); - }); - }); - } - - function installTreeAction(registers) { - registers.registerAction({ - type: 'treeExpandAndCollapse', - event: 'treeExpandAndCollapse', - update: 'update' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'tree', - query: payload - }, function (seriesModel) { - var dataIndex = payload.dataIndex; - var tree = seriesModel.getData().tree; - var node = tree.getNodeByDataIndex(dataIndex); - node.isExpand = !node.isExpand; - }); - }); - registers.registerAction({ - type: 'treeRoam', - event: 'treeRoam', - // Here we set 'none' instead of 'update', because roam action - // just need to update the transform matrix without having to recalculate - // the layout. So don't need to go through the whole update process, such - // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on. - update: 'none' - }, function (payload, ecModel, api) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'tree', - query: payload - }, function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var res = updateCenterAndZoom(coordSys, payload, undefined, api); - seriesModel.setCenter && seriesModel.setCenter(res.center); - seriesModel.setZoom && seriesModel.setZoom(res.zoom); - }); - }); - } - - function install$b(registers) { - registers.registerChartView(TreeView); - registers.registerSeriesModel(TreeSeriesModel); - registers.registerLayout(treeLayout); - registers.registerVisual(treeVisual); - installTreeAction(registers); - } - - var actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove']; - function installTreemapAction(registers) { - for (var i = 0; i < actionTypes.length; i++) { - registers.registerAction({ - type: actionTypes[i], - update: 'updateView' - }, noop); - } - registers.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 = retrieveTargetInfo(payload, types, model); - if (targetInfo) { - var originViewRoot = model.getViewRoot(); - if (originViewRoot) { - payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; - } - model.resetViewRoot(targetInfo.node); - } - } - }); - } - - function enableAriaDecalForTree(seriesModel) { - var data = seriesModel.getData(); - var tree = data.tree; - var decalPaletteScope = {}; - tree.eachNode(function (node) { - // Use decal of level 1 node - var current = node; - while (current && current.depth > 1) { - current = current.parentNode; - } - var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope); - node.setVisual('decal', decal); - }); - } - - var TreemapSeriesModel = /** @class */function (_super) { - __extends(TreemapSeriesModel, _super); - function TreemapSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TreemapSeriesModel.type; - _this.preventUsingHoverLayer = true; - return _this; - } - /** - * @override - */ - TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) { - // Create a virtual root. - var root = { - name: option.name, - children: option.data - }; - completeTreeValue(root); - var levels = option.levels || []; - // Used in "visual priority" in `treemapVisual.js`. - // This way is a little tricky, must satisfy the precondition: - // 1. There is no `treeNode.getModel('itemStyle.xxx')` used. - // 2. The `Model.prototype.getModel()` will not use any clone-like way. - var designatedVisualItemStyle = this.designatedVisualItemStyle = {}; - var designatedVisualModel = new Model({ - itemStyle: designatedVisualItemStyle - }, this, ecModel); - levels = option.levels = setDefault(levels, ecModel); - var levelModels = map(levels || [], function (levelDefine) { - return new Model(levelDefine, designatedVisualModel, ecModel); - }, this); - // Make sure always a new tree is created when setOption, - // in TreemapView, we check whether oldTree === newTree - // to choose mappings approach among old shapes and new shapes. - var tree = Tree.createTree(root, this, beforeLink); - function beforeLink(nodeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var node = tree.getNodeByDataIndex(idx); - var levelModel = node ? levelModels[node.depth] : null; - // If no levelModel, we also need `designatedVisualModel`. - model.parentModel = levelModel || designatedVisualModel; - return model; - }); - } - return tree.data; - }; - TreemapSeriesModel.prototype.optionUpdated = function () { - this.resetViewRoot(); - }; - /** - * @override - * @param {number} dataIndex - * @param {boolean} [mutipleSeries=false] - */ - TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var name = data.getName(dataIndex); - return createTooltipMarkup('nameValue', { - name: name, - value: value - }); - }; - /** - * Add tree path to tooltip param - * - * @override - * @param {number} dataIndex - * @return {Object} - */ - TreemapSeriesModel.prototype.getDataParams = function (dataIndex) { - var params = _super.prototype.getDataParams.apply(this, arguments); - var node = this.getData().tree.getNodeByDataIndex(dataIndex); - params.treeAncestors = wrapTreePathInfo(node, this); - // compatitable the previous code. - params.treePathInfo = params.treeAncestors; - return params; - }; - /** - * @public - * @param {Object} layoutInfo { - * x: containerGroup x - * y: containerGroup y - * width: containerGroup width - * height: containerGroup height - * } - */ - TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) { - /** - * @readOnly - * @type {Object} - */ - this.layoutInfo = this.layoutInfo || {}; - extend(this.layoutInfo, layoutInfo); - }; - /** - * @param {string} id - * @return {number} index - */ - TreemapSeriesModel.prototype.mapIdToIndex = function (id) { - // A feature is implemented: - // index is monotone increasing with the sequence of - // input id at the first time. - // This feature can make sure that each data item and its - // mapped color have the same index between data list and - // color list at the beginning, which is useful for user - // to adjust data-color mapping. - /** - * @private - * @type {Object} - */ - var idIndexMap = this._idIndexMap; - if (!idIndexMap) { - idIndexMap = this._idIndexMap = createHashMap(); - /** - * @private - * @type {number} - */ - this._idIndexMapCount = 0; - } - var index = idIndexMap.get(id); - if (index == null) { - idIndexMap.set(id, index = this._idIndexMapCount++); - } - return index; - }; - TreemapSeriesModel.prototype.getViewRoot = function () { - return this._viewRoot; - }; - TreemapSeriesModel.prototype.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; - } - }; - TreemapSeriesModel.prototype.enableAriaDecal = function () { - enableAriaDecalForTree(this); - }; - TreemapSeriesModel.type = 'series.treemap'; - TreemapSeriesModel.layoutMode = 'box'; - TreemapSeriesModel.defaultOption = { - // Disable progressive rendering - progressive: 0, - // size: ['80%', '80%'], // deprecated, compatible with ec2. - left: 'center', - top: 'middle', - width: '80%', - height: '80%', - sort: true, - clipWindow: 'origin', - squareRatio: 0.5 * (1 + Math.sqrt(5)), - leafDepth: null, - drillDownIcon: '▶', - // to align specialized icon. ▷▶❒❐▼✚ - zoomToNodeRatio: 0.32 * 0.32, - scaleLimit: null, - roam: true, - nodeClick: 'zoomToNode', - animation: true, - animationDurationUpdate: 900, - animationEasing: 'quinticInOut', - breadcrumb: { - show: true, - height: 22, - left: 'center', - top: 'bottom', - // right - // bottom - emptyItemWidth: 25, - itemStyle: { - color: 'rgba(0,0,0,0.7)', - textStyle: { - color: '#fff' - } - }, - emphasis: { - itemStyle: { - color: 'rgba(0,0,0,0.9)' // '#5793f3', - } - } - }, - - label: { - show: true, - // Do not use textDistance, for ellipsis rect just the same as treemap node rect. - distance: 0, - padding: 5, - position: 'inside', - // formatter: null, - color: '#fff', - overflow: 'truncate' - // align - // verticalAlign - }, - - upperLabel: { - show: false, - position: [0, '50%'], - height: 20, - // formatter: null, - // color: '#fff', - overflow: 'truncate', - // align: null, - verticalAlign: 'middle' - }, - itemStyle: { - color: null, - colorAlpha: null, - colorSaturation: null, - borderWidth: 0, - gapWidth: 0, - borderColor: '#fff', - borderColorSaturation: null // If specified, borderColor will be ineffective, and the - // border color is evaluated by color of current node and - // borderColorSaturation. - }, - - emphasis: { - upperLabel: { - show: true, - position: [0, '50%'], - overflow: 'truncate', - verticalAlign: 'middle' - } - }, - visualDimension: 0, - visualMin: null, - visualMax: null, - color: [], - // level[n].color (if necessary). - // + Specify color list of each level. level[0].color would be global - // color list if not specified. (see method `setDefault`). - // + But set as a empty array to forbid fetch color from global palette - // when using nodeModel.get('color'), otherwise nodes on deep level - // will always has color palette set and are not able to inherit color - // from parent node. - // + TreemapSeries.color can not be set as 'none', otherwise effect - // legend color fetching (see seriesColor.js). - colorAlpha: null, - colorSaturation: null, - colorMappingBy: 'index', - visibleMin: 10, - // be rendered. Only works when sort is 'asc' or 'desc'. - childrenVisibleMin: null, - // grandchildren will not show. - // Why grandchildren? If not grandchildren but children, - // some siblings show children and some not, - // the appearance may be mess and not consistent, - levels: [] // Each item: { - // visibleMin, itemStyle, visualDimension, label - // } - }; - - return TreemapSeriesModel; - }(SeriesModel); - /** - * @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; - each(dataNode.children, function (child) { - completeTreeValue(child); - var childValue = child.value; - isArray(childValue) && (childValue = childValue[0]); - sum += childValue; - }); - var thisValue = dataNode.value; - if (isArray(thisValue)) { - thisValue = thisValue[0]; - } - if (thisValue == null || isNaN(thisValue)) { - thisValue = sum; - } - // Value should not less than 0. - if (thisValue < 0) { - thisValue = 0; - } - isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; - } - /** - * set default to level configuration - */ - function setDefault(levels, ecModel) { - var globalColorList = normalizeToArray(ecModel.get('color')); - var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals'])); - if (!globalColorList) { - return; - } - levels = levels || []; - var hasColorDefine; - var hasDecalDefine; - each(levels, function (levelDefine) { - var model = new Model(levelDefine); - var modelColor = model.get('color'); - var modelDecal = model.get('decal'); - if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') { - hasColorDefine = true; - } - if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') { - hasDecalDefine = true; - } - }); - var level0 = levels[0] || (levels[0] = {}); - if (!hasColorDefine) { - level0.color = globalColorList.slice(); - } - if (!hasDecalDefine && globalDecalList) { - level0.decal = globalDecalList.slice(); - } - return levels; - } - - var TEXT_PADDING = 8; - var ITEM_GAP = 8; - var ARRAY_LENGTH = 5; - var Breadcrumb = /** @class */function () { - function Breadcrumb(containerGroup) { - this.group = new Group(); - containerGroup.add(this.group); - } - Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) { - var model = seriesModel.getModel('breadcrumb'); - var thisGroup = this.group; - thisGroup.removeAll(); - if (!model.get('show') || !targetNode) { - return; - } - var normalStyleModel = model.getModel('itemStyle'); - var emphasisModel = model.getModel('emphasis'); - var textStyleModel = normalStyleModel.getModel('textStyle'); - var emphasisTextStyleModel = emphasisModel.getModel(['itemStyle', 'textStyle']); - var layoutParam = { - pos: { - left: model.get('left'), - right: model.get('right'), - top: model.get('top'), - bottom: model.get('bottom') - }, - box: { - width: api.getWidth(), - height: api.getHeight() - }, - emptyItemWidth: model.get('emptyItemWidth'), - totalWidth: 0, - renderList: [] - }; - this._prepare(targetNode, layoutParam, textStyleModel); - this._renderContent(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect); - positionElement(thisGroup, layoutParam.pos, layoutParam.box); - }; - /** - * Prepare render list and total width - * @private - */ - Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) { - for (var node = targetNode; node; node = node.parentNode) { - var text = convertOptionIdName(node.getModel().get('name'), ''); - var textRect = textStyleModel.getTextRect(text); - var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth); - layoutParam.totalWidth += itemWidth + ITEM_GAP; - layoutParam.renderList.push({ - node: node, - text: text, - width: itemWidth - }); - } - }; - /** - * @private - */ - Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect) { - // Start rendering. - var lastX = 0; - var emptyItemWidth = layoutParam.emptyItemWidth; - var height = seriesModel.get(['breadcrumb', 'height']); - var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box); - var totalWidth = layoutParam.totalWidth; - var renderList = layoutParam.renderList; - var emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle(); - for (var i = renderList.length - 1; i >= 0; i--) { - var item = renderList[i]; - var itemNode = item.node; - var itemWidth = item.width; - var text = item.text; - // Hdie text and shorten width if necessary. - if (totalWidth > availableSize.width) { - totalWidth -= itemWidth - emptyItemWidth; - itemWidth = emptyItemWidth; - text = null; - } - var el = new Polygon({ - shape: { - points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0) - }, - style: defaults(normalStyleModel.getItemStyle(), { - lineJoin: 'bevel' - }), - textContent: new ZRText({ - style: createTextStyle(textStyleModel, { - text: text - }) - }), - textConfig: { - position: 'inside' - }, - z2: Z2_EMPHASIS_LIFT * 1e4, - onclick: curry(onSelect, itemNode) - }); - el.disableLabelAnimation = true; - el.getTextContent().ensureState('emphasis').style = createTextStyle(emphasisTextStyleModel, { - text: text - }); - el.ensureState('emphasis').style = emphasisItemStyle; - toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - this.group.add(el); - packEventData(el, seriesModel, itemNode); - lastX += itemWidth + ITEM_GAP; - } - }; - Breadcrumb.prototype.remove = function () { - this.group.removeAll(); - }; - return Breadcrumb; - }(); - function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) { - var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]]; - !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]); - !head && points.push([x, y + itemHeight / 2]); - return points; - } - // Package custom mouse event. - function packEventData(el, seriesModel, itemNode) { - getECData(el).eventData = { - componentType: 'series', - componentSubType: 'treemap', - componentIndex: seriesModel.componentIndex, - seriesIndex: seriesModel.seriesIndex, - seriesName: seriesModel.name, - seriesType: 'treemap', - selfType: 'breadcrumb', - nodeData: { - dataIndex: itemNode && itemNode.dataIndex, - name: itemNode && itemNode.name - }, - treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) - }; - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - /** - * Animate multiple elements with a single done-callback. - * - * @example - * animation - * .createWrap() - * .add(el1, {x: 10, y: 10}) - * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400) - * .done(function () { // done }) - * .start('cubicOut'); - */ - var AnimationWrap = /** @class */function () { - function AnimationWrap() { - this._storage = []; - this._elExistsMap = {}; - } - /** - * Caution: a el can only be added once, otherwise 'done' - * might not be called. This method checks this (by el.id), - * suppresses adding and returns false when existing el found. - * - * @return Whether adding succeeded. - */ - AnimationWrap.prototype.add = function (el, target, duration, delay, easing) { - if (this._elExistsMap[el.id]) { - return false; - } - this._elExistsMap[el.id] = true; - this._storage.push({ - el: el, - target: target, - duration: duration, - delay: delay, - easing: easing - }); - return true; - }; - /** - * Only execute when animation done/aborted. - */ - AnimationWrap.prototype.finished = function (callback) { - this._finishedCallback = callback; - return this; - }; - /** - * Will stop exist animation firstly. - */ - AnimationWrap.prototype.start = function () { - var _this = this; - var count = this._storage.length; - var checkTerminate = function () { - count--; - if (count <= 0) { - // Guard. - _this._storage.length = 0; - _this._elExistsMap = {}; - _this._finishedCallback && _this._finishedCallback(); - } - }; - for (var i = 0, len = this._storage.length; i < len; i++) { - var item = this._storage[i]; - item.el.animateTo(item.target, { - duration: item.duration, - delay: item.delay, - easing: item.easing, - setToFinal: true, - done: checkTerminate, - aborted: checkTerminate - }); - } - return this; - }; - return AnimationWrap; - }(); - function createWrap() { - return new AnimationWrap(); - } - - var Group$1 = Group; - var Rect$1 = Rect; - var DRAG_THRESHOLD = 3; - var PATH_LABEL_NOAMAL = 'label'; - var PATH_UPPERLABEL_NORMAL = 'upperLabel'; - // Should larger than emphasis states lift z - var Z2_BASE = Z2_EMPHASIS_LIFT * 10; // Should bigger than every z2. - var Z2_BG = Z2_EMPHASIS_LIFT * 2; - var Z2_CONTENT = Z2_EMPHASIS_LIFT * 3; - var getStateItemStyle = makeStyleMapper([['fill', 'color'], - // `borderColor` and `borderWidth` has been occupied, - // so use `stroke` to indicate the stroke of the rect. - ['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] - // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. - ]); - - var getItemStyleNormal = function (model) { - // Normal style props should include emphasis style props. - var itemStyle = getStateItemStyle(model); - // Clear styles set by emphasis. - itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; - return itemStyle; - }; - var inner$8 = makeInner(); - var TreemapView = /** @class */function (_super) { - __extends(TreemapView, _super); - function TreemapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TreemapView.type; - _this._state = 'ready'; - _this._storage = createStorage(); - return _this; - } - /** - * @override - */ - TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) { - var models = ecModel.findComponents({ - mainType: 'series', - subType: 'treemap', - query: payload - }); - if (indexOf(models, seriesModel) < 0) { - return; - } - this.seriesModel = seriesModel; - this.api = api; - this.ecModel = ecModel; - var types = ['treemapZoomToNode', 'treemapRootToNode']; - var targetInfo = retrieveTargetInfo(payload, types, seriesModel); - var payloadType = payload && payload.type; - var layoutInfo = seriesModel.layoutInfo; - var isInit = !this._oldTree; - var thisStorage = this._storage; - // Mark new root when action is treemapRootToNode. - var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? { - rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()], - direction: payload.direction - } : null; - var containerGroup = this._giveContainerGroup(layoutInfo); - var hasAnimation = seriesModel.get('animation'); - var renderResult = this._doRender(containerGroup, seriesModel, reRoot); - hasAnimation && !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally(); - this._resetController(api); - this._renderBreadcrumb(seriesModel, api, targetInfo); - }; - TreemapView.prototype._giveContainerGroup = function (layoutInfo) { - var containerGroup = this._containerGroup; - if (!containerGroup) { - // FIXME - // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。 - containerGroup = this._containerGroup = new Group$1(); - this._initEvents(containerGroup); - this.group.add(containerGroup); - } - containerGroup.x = layoutInfo.x; - containerGroup.y = layoutInfo.y; - return containerGroup; - }; - TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) { - var thisTree = seriesModel.getData().tree; - var oldTree = this._oldTree; - // Clear last shape records. - var lastsForAnimation = createStorage(); - var thisStorage = createStorage(); - var oldStorage = this._storage; - var willInvisibleEls = []; - function doRenderNode(thisNode, oldNode, parentGroup, depth) { - return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth); - } - // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow), - // the oldTree is actually losted, so we cannot find all of the old graphic - // elements from tree. So we use this strategy: make element storage, move - // from old storage to new storage, clear old storage. - dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); - // Process all removing. - var willDeleteEls = clearStorage(oldStorage); - this._oldTree = thisTree; - this._storage = thisStorage; - if (this._controllerHost) { - var _oldRootLayout = this.seriesModel.layoutInfo; - var rootLayout = thisTree.root.getLayout(); - if (rootLayout.width === _oldRootLayout.width && rootLayout.height === _oldRootLayout.height) { - this._controllerHost.zoom = 1; - } - } - return { - lastsForAnimation: lastsForAnimation, - willDeleteEls: willDeleteEls, - renderFinally: renderFinally - }; - function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) { - // When 'render' is triggered by action, - // 'this' and 'old' may be the same tree, - // we use rawIndex in that case. - if (sameTree) { - oldViewChildren = thisViewChildren; - each(thisViewChildren, function (child, index) { - !child.isRemoved() && processNode(index, index); - }); - } - // Diff hierarchically (diff only in each subtree, but not whole). - // because, consistency of view is important. - else { - new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); - } - function getKey(node) { - // Identify by name or raw index. - return node.getId(); - } - function processNode(newIndex, oldIndex) { - var thisNode = newIndex != null ? thisViewChildren[newIndex] : null; - var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null; - var group = doRenderNode(thisNode, oldNode, parentGroup, depth); - group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1); - } - } - function clearStorage(storage) { - var willDeleteEls = createStorage(); - storage && each(storage, function (store, storageName) { - var delEls = willDeleteEls[storageName]; - each(store, function (el) { - el && (delEls.push(el), inner$8(el).willDelete = true); - }); - }); - return willDeleteEls; - } - function renderFinally() { - each(willDeleteEls, function (els) { - each(els, function (el) { - el.parent && el.parent.remove(el); - }); - }); - each(willInvisibleEls, function (el) { - el.invisible = true; - // Setting invisible is for optimizing, so no need to set dirty, - // just mark as invisible. - el.dirty(); - }); - } - }; - TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) { - var durationOption = seriesModel.get('animationDurationUpdate'); - var easingOption = seriesModel.get('animationEasing'); - // TODO: do not support function until necessary. - var duration = (isFunction(durationOption) ? 0 : durationOption) || 0; - var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut'; - var animationWrap = createWrap(); - // Make delete animations. - each(renderResult.willDeleteEls, function (store, storageName) { - each(store, function (el, rawIndex) { - if (el.invisible) { - return; - } - var parent = el.parent; // Always has parent, and parent is nodeGroup. - var target; - var innerStore = inner$8(parent); - if (reRoot && reRoot.direction === 'drillDown') { - target = parent === reRoot.rootNodeGroup - // This is the content element of view root. - // Only `content` will enter this branch, because - // `background` and `nodeGroup` will not be deleted. - ? { - shape: { - x: 0, - y: 0, - width: innerStore.nodeWidth, - height: innerStore.nodeHeight - }, - style: { - opacity: 0 - } - } - // Others. - : { - style: { - opacity: 0 - } - }; - } else { - var targetX = 0; - var targetY = 0; - if (!innerStore.willDelete) { - // Let node animate to right-bottom corner, cooperating with fadeout, - // which is appropriate for user understanding. - // Divided by 2 for reRoot rolling up effect. - targetX = innerStore.nodeWidth / 2; - targetY = innerStore.nodeHeight / 2; - } - target = storageName === 'nodeGroup' ? { - x: targetX, - y: targetY, - style: { - opacity: 0 - } - } : { - shape: { - x: targetX, - y: targetY, - width: 0, - height: 0 - }, - style: { - opacity: 0 - } - }; - } - // TODO: do not support delay until necessary. - target && animationWrap.add(el, target, duration, 0, easing); - }); - }); - // Make other animations - each(this._storage, function (store, storageName) { - each(store, function (el, rawIndex) { - var last = renderResult.lastsForAnimation[storageName][rawIndex]; - var target = {}; - if (!last) { - return; - } - if (el instanceof Group) { - if (last.oldX != null) { - target.x = el.x; - target.y = el.y; - el.x = last.oldX; - el.y = last.oldY; - } - } else { - if (last.oldShape) { - target.shape = extend({}, el.shape); - el.setShape(last.oldShape); - } - if (last.fadein) { - el.setStyle('opacity', 0); - target.style = { - opacity: 1 - }; - } - // When animation is stopped for succedent animation starting, - // el.style.opacity might not be 1 - else if (el.style.opacity !== 1) { - target.style = { - opacity: 1 - }; - } - } - animationWrap.add(el, target, duration, 0, easing); - }); - }, this); - this._state = 'animating'; - animationWrap.finished(bind(function () { - this._state = 'ready'; - renderResult.renderFinally(); - }, this)).start(); - }; - TreemapView.prototype._resetController = function (api) { - var controller = this._controller; - var controllerHost = this._controllerHost; - if (!controllerHost) { - this._controllerHost = { - target: this.group - }; - controllerHost = this._controllerHost; - } - // Init controller. - if (!controller) { - controller = this._controller = new RoamController(api.getZr()); - controller.enable(this.seriesModel.get('roam')); - controllerHost.zoomLimit = this.seriesModel.get('scaleLimit'); - controllerHost.zoom = this.seriesModel.get('zoom'); - controller.on('pan', bind(this._onPan, this)); - controller.on('zoom', bind(this._onZoom, this)); - } - var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); - controller.setPointerChecker(function (e, x, y) { - return rect.contain(x, y); - }); - }; - TreemapView.prototype._clearController = function () { - var controller = this._controller; - this._controllerHost = null; - if (controller) { - controller.dispose(); - controller = null; - } - }; - TreemapView.prototype._onPan = function (e) { - if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) { - // These param must not be cached. - var root = this.seriesModel.getData().tree.root; - if (!root) { - return; - } - var rootLayout = root.getLayout(); - if (!rootLayout) { - return; - } - this.api.dispatchAction({ - type: 'treemapMove', - from: this.uid, - seriesId: this.seriesModel.id, - rootRect: { - x: rootLayout.x + e.dx, - y: rootLayout.y + e.dy, - width: rootLayout.width, - height: rootLayout.height - } - }); - } - }; - TreemapView.prototype._onZoom = function (e) { - var mouseX = e.originX; - var mouseY = e.originY; - var zoomDelta = e.scale; - if (this._state !== 'animating') { - // These param must not be cached. - var root = this.seriesModel.getData().tree.root; - if (!root) { - return; - } - var rootLayout = root.getLayout(); - if (!rootLayout) { - return; - } - var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height); - // scaleLimit - var zoomLimit = null; - var _controllerHost = this._controllerHost; - zoomLimit = _controllerHost.zoomLimit; - var newZoom = _controllerHost.zoom = _controllerHost.zoom || 1; - newZoom *= zoomDelta; - if (zoomLimit) { - var zoomMin = zoomLimit.min || 0; - var zoomMax = zoomLimit.max || Infinity; - newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin); - } - var zoomScale = newZoom / _controllerHost.zoom; - _controllerHost.zoom = newZoom; - var layoutInfo = this.seriesModel.layoutInfo; - // Transform mouse coord from global to containerGroup. - mouseX -= layoutInfo.x; - mouseY -= layoutInfo.y; - // Scale root bounding rect. - var m = create$1(); - translate(m, m, [-mouseX, -mouseY]); - scale$1(m, m, [zoomScale, zoomScale]); - translate(m, m, [mouseX, mouseY]); - rect.applyTransform(m); - this.api.dispatchAction({ - type: 'treemapRender', - from: this.uid, - seriesId: this.seriesModel.id, - rootRect: { - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - } - }); - } - }; - TreemapView.prototype._initEvents = function (containerGroup) { - var _this = this; - containerGroup.on('click', function (e) { - if (_this._state !== 'ready') { - return; - } - var nodeClick = _this.seriesModel.get('nodeClick', true); - if (!nodeClick) { - return; - } - var targetInfo = _this.findTarget(e.offsetX, e.offsetY); - if (!targetInfo) { - return; - } - var node = targetInfo.node; - if (node.getLayout().isLeafRoot) { - _this._rootToNode(targetInfo); - } else { - if (nodeClick === 'zoomToNode') { - _this._zoomToNode(targetInfo); - } else if (nodeClick === 'link') { - var itemModel = node.hostTree.data.getItemModel(node.dataIndex); - var link = itemModel.get('link', true); - var linkTarget = itemModel.get('target', true) || 'blank'; - link && windowOpen(link, linkTarget); - } - } - }, this); - }; - TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) { - var _this = this; - if (!targetInfo) { - targetInfo = seriesModel.get('leafDepth', true) != null ? { - node: seriesModel.getViewRoot() - } - // FIXME - // better way? - // Find breadcrumb tail on center of containerGroup. - : this.findTarget(api.getWidth() / 2, api.getHeight() / 2); - if (!targetInfo) { - targetInfo = { - node: seriesModel.getData().tree.root - }; - } - } - (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) { - if (_this._state !== 'animating') { - aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({ - node: node - }) : _this._zoomToNode({ - node: node - }); - } - }); - }; - /** - * @override - */ - TreemapView.prototype.remove = function () { - this._clearController(); - this._containerGroup && this._containerGroup.removeAll(); - this._storage = createStorage(); - this._state = 'ready'; - this._breadcrumb && this._breadcrumb.remove(); - }; - TreemapView.prototype.dispose = function () { - this._clearController(); - }; - TreemapView.prototype._zoomToNode = function (targetInfo) { - this.api.dispatchAction({ - type: 'treemapZoomToNode', - from: this.uid, - seriesId: this.seriesModel.id, - targetNode: targetInfo.node - }); - }; - TreemapView.prototype._rootToNode = function (targetInfo) { - this.api.dispatchAction({ - type: 'treemapRootToNode', - from: this.uid, - seriesId: this.seriesModel.id, - targetNode: targetInfo.node - }); - }; - /** - * @public - * @param {number} x Global coord x. - * @param {number} y Global coord y. - * @return {Object} info If not found, return undefined; - * @return {number} info.node Target node. - * @return {number} info.offsetX x refer to target node. - * @return {number} info.offsetY y refer to target node. - */ - TreemapView.prototype.findTarget = function (x, y) { - var targetInfo; - var viewRoot = this.seriesModel.getViewRoot(); - viewRoot.eachNode({ - attr: 'viewChildren', - order: 'preorder' - }, function (node) { - var bgEl = this._storage.background[node.getRawIndex()]; - // If invisible, there might be no element. - if (bgEl) { - var point = bgEl.transformCoordToLocal(x, y); - var shape = bgEl.shape; - // For performance consideration, don't use 'getBoundingRect'. - if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) { - targetInfo = { - node: node, - offsetX: point[0], - offsetY: point[1] - }; - } else { - return false; // Suppress visit subtree. - } - } - }, this); - return targetInfo; - }; - TreemapView.type = 'treemap'; - return TreemapView; - }(ChartView); - /** - * @inner - */ - function createStorage() { - return { - nodeGroup: [], - background: [], - content: [] - }; - } - /** - * @inner - * @return Return undefined means do not travel further. - */ - function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) { - // Whether under viewRoot. - if (!thisNode) { - // Deleting nodes will be performed finally. This method just find - // element from old storage, or create new element, set them to new - // storage, and set styles. - return; - } - // ------------------------------------------------------------------- - // Start of closure variables available in "Procedures in renderNode". - var thisLayout = thisNode.getLayout(); - var data = seriesModel.getData(); - var nodeModel = thisNode.getModel(); - // Only for enabling highlight/downplay. Clear firstly. - // Because some node will not be rendered. - data.setItemGraphicEl(thisNode.dataIndex, null); - if (!thisLayout || !thisLayout.isInView) { - return; - } - var thisWidth = thisLayout.width; - var thisHeight = thisLayout.height; - var borderWidth = thisLayout.borderWidth; - var thisInvisible = thisLayout.invisible; - var thisRawIndex = thisNode.getRawIndex(); - var oldRawIndex = oldNode && oldNode.getRawIndex(); - var thisViewChildren = thisNode.viewChildren; - var upperHeight = thisLayout.upperHeight; - var isParent = thisViewChildren && thisViewChildren.length; - var itemStyleNormalModel = nodeModel.getModel('itemStyle'); - var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']); - var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']); - var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']); - var borderRadius = itemStyleNormalModel.get('borderRadius') || 0; - // End of closure ariables available in "Procedures in renderNode". - // ----------------------------------------------------------------- - // Node group - var group = giveGraphic('nodeGroup', Group$1); - if (!group) { - return; - } - parentGroup.add(group); - // x,y are not set when el is above view root. - group.x = thisLayout.x || 0; - group.y = thisLayout.y || 0; - group.markRedraw(); - inner$8(group).nodeWidth = thisWidth; - inner$8(group).nodeHeight = thisHeight; - if (thisLayout.isAboveViewRoot) { - return group; - } - // Background - var bg = giveGraphic('background', Rect$1, depth, Z2_BG); - bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight); - var emphasisModel = nodeModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var isDisabled = emphasisModel.get('disabled'); - var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus; - // No children, render content. - if (isParent) { - // Because of the implementation about "traverse" in graphic hover style, we - // can not set hover listener on the "group" of non-leaf node. Otherwise the - // hover event from the descendents will be listenered. - if (isHighDownDispatcher(group)) { - setAsHighDownDispatcher(group, false); - } - if (bg) { - setAsHighDownDispatcher(bg, !isDisabled); - // Only for enabling highlight/downplay. - data.setItemGraphicEl(thisNode.dataIndex, bg); - enableHoverFocus(bg, focusOrIndices, blurScope); - } - } else { - var content = giveGraphic('content', Rect$1, depth, Z2_CONTENT); - content && renderContent(group, content); - bg.disableMorphing = true; - if (bg && isHighDownDispatcher(bg)) { - setAsHighDownDispatcher(bg, false); - } - setAsHighDownDispatcher(group, !isDisabled); - // Only for enabling highlight/downplay. - data.setItemGraphicEl(thisNode.dataIndex, group); - enableHoverFocus(group, focusOrIndices, blurScope); - } - return group; - // ---------------------------- - // | Procedures in renderNode | - // ---------------------------- - function renderBackground(group, bg, useUpperLabel) { - var ecData = getECData(bg); - // For tooltip. - ecData.dataIndex = thisNode.dataIndex; - ecData.seriesIndex = seriesModel.seriesIndex; - bg.setShape({ - x: 0, - y: 0, - width: thisWidth, - height: thisHeight, - r: borderRadius - }); - if (thisInvisible) { - // If invisible, do not set visual, otherwise the element will - // change immediately before animation. We think it is OK to - // remain its origin color when moving out of the view window. - processInvisible(bg); - } else { - bg.invisible = false; - var style = thisNode.getVisual('style'); - var visualBorderColor = style.stroke; - var normalStyle = getItemStyleNormal(itemStyleNormalModel); - normalStyle.fill = visualBorderColor; - var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); - emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor'); - var blurStyle = getStateItemStyle(itemStyleBlurModel); - blurStyle.fill = itemStyleBlurModel.get('borderColor'); - var selectStyle = getStateItemStyle(itemStyleSelectModel); - selectStyle.fill = itemStyleSelectModel.get('borderColor'); - if (useUpperLabel) { - var upperLabelWidth = thisWidth - 2 * borderWidth; - prepareText( - // PENDING: convert ZRColor to ColorString for text. - bg, visualBorderColor, style.opacity, { - x: borderWidth, - y: 0, - width: upperLabelWidth, - height: upperHeight - }); - } - // For old bg. - else { - bg.removeTextContent(); - } - bg.setStyle(normalStyle); - bg.ensureState('emphasis').style = emphasisStyle; - bg.ensureState('blur').style = blurStyle; - bg.ensureState('select').style = selectStyle; - setDefaultStateProxy(bg); - } - group.add(bg); - } - function renderContent(group, content) { - var ecData = getECData(content); - // For tooltip. - ecData.dataIndex = thisNode.dataIndex; - ecData.seriesIndex = seriesModel.seriesIndex; - var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0); - var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0); - content.culling = true; - content.setShape({ - x: borderWidth, - y: borderWidth, - width: contentWidth, - height: contentHeight, - r: borderRadius - }); - if (thisInvisible) { - // If invisible, do not set visual, otherwise the element will - // change immediately before animation. We think it is OK to - // remain its origin color when moving out of the view window. - processInvisible(content); - } else { - content.invisible = false; - var nodeStyle = thisNode.getVisual('style'); - var visualColor = nodeStyle.fill; - var normalStyle = getItemStyleNormal(itemStyleNormalModel); - normalStyle.fill = visualColor; - normalStyle.decal = nodeStyle.decal; - var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); - var blurStyle = getStateItemStyle(itemStyleBlurModel); - var selectStyle = getStateItemStyle(itemStyleSelectModel); - // PENDING: convert ZRColor to ColorString for text. - prepareText(content, visualColor, nodeStyle.opacity, null); - content.setStyle(normalStyle); - content.ensureState('emphasis').style = emphasisStyle; - content.ensureState('blur').style = blurStyle; - content.ensureState('select').style = selectStyle; - setDefaultStateProxy(content); - } - group.add(content); - } - function processInvisible(element) { - // Delay invisible setting utill animation finished, - // avoid element vanish suddenly before animation. - !element.invisible && willInvisibleEls.push(element); - } - function prepareText(rectEl, visualColor, visualOpacity, - // Can be null/undefined - upperLabelRect) { - var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL); - var defaultText = convertOptionIdName(nodeModel.get('name'), null); - var isShow = normalLabelModel.getShallow('show'); - setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), { - defaultText: isShow ? defaultText : null, - inheritColor: visualColor, - defaultOpacity: visualOpacity, - labelFetcher: seriesModel, - labelDataIndex: thisNode.dataIndex - }); - var textEl = rectEl.getTextContent(); - if (!textEl) { - return; - } - var textStyle = textEl.style; - var textPadding = normalizeCssArray(textStyle.padding || 0); - if (upperLabelRect) { - rectEl.setTextConfig({ - layoutRect: upperLabelRect - }); - textEl.disableLabelLayout = true; - } - textEl.beforeUpdate = function () { - var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0); - var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0); - if (textStyle.width !== width || textStyle.height !== height) { - textEl.setStyle({ - width: width, - height: height - }); - } - }; - textStyle.truncateMinChar = 2; - textStyle.lineOverflow = 'truncate'; - addDrillDownIcon(textStyle, upperLabelRect, thisLayout); - var textEmphasisState = textEl.getState('emphasis'); - addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout); - } - function addDrillDownIcon(style, upperLabelRect, thisLayout) { - var text = style ? style.text : null; - if (!upperLabelRect && thisLayout.isLeafRoot && text != null) { - var iconChar = seriesModel.get('drillDownIcon', true); - style.text = iconChar ? iconChar + ' ' + text : text; - } - } - function giveGraphic(storageName, Ctor, depth, z) { - var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex]; - var lasts = lastsForAnimation[storageName]; - if (element) { - // Remove from oldStorage - oldStorage[storageName][oldRawIndex] = null; - prepareAnimationWhenHasOld(lasts, element); - } - // If invisible and no old element, do not create new element (for optimizing). - else if (!thisInvisible) { - element = new Ctor(); - if (element instanceof Displayable) { - element.z2 = calculateZ2(depth, z); - } - prepareAnimationWhenNoOld(lasts, element); - } - // Set to thisStorage - return thisStorage[storageName][thisRawIndex] = element; - } - function prepareAnimationWhenHasOld(lasts, element) { - var lastCfg = lasts[thisRawIndex] = {}; - if (element instanceof Group$1) { - lastCfg.oldX = element.x; - lastCfg.oldY = element.y; - } else { - lastCfg.oldShape = extend({}, element.shape); - } - } - // If a element is new, we need to find the animation start point carefully, - // otherwise it will looks strange when 'zoomToNode'. - function prepareAnimationWhenNoOld(lasts, element) { - var lastCfg = lasts[thisRawIndex] = {}; - var parentNode = thisNode.parentNode; - var isGroup = element instanceof Group; - if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { - var parentOldX = 0; - var parentOldY = 0; - // New nodes appear from right-bottom corner in 'zoomToNode' animation. - // For convenience, get old bounding rect from background. - var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; - if (!reRoot && parentOldBg && parentOldBg.oldShape) { - parentOldX = parentOldBg.oldShape.width; - parentOldY = parentOldBg.oldShape.height; - } - // When no parent old shape found, its parent is new too, - // so we can just use {x:0, y:0}. - if (isGroup) { - lastCfg.oldX = 0; - lastCfg.oldY = parentOldY; - } else { - lastCfg.oldShape = { - x: parentOldX, - y: parentOldY, - width: 0, - height: 0 - }; - } - } - // Fade in, user can be aware that these nodes are new. - lastCfg.fadein = !isGroup; - } - } - // We cannot set all background with the same z, because the behaviour of - // drill down and roll up differ background creation sequence from tree - // hierarchy sequence, which cause lower background elements to overlap - // upper ones. So we calculate z based on depth. - // Moreover, we try to shrink down z interval to [0, 1] to avoid that - // treemap with large z overlaps other components. - function calculateZ2(depth, z2InLevel) { - return depth * Z2_BASE + z2InLevel; - } - - var each$3 = each; - var isObject$3 = isObject; - var CATEGORY_DEFAULT_VISUAL_INDEX = -1; - var VisualMapping = /** @class */function () { - function VisualMapping(option) { - var mappingMethod = option.mappingMethod; - var visualType = option.type; - var thisOption = this.option = clone(option); - this.type = visualType; - this.mappingMethod = mappingMethod; - this._normalizeData = normalizers[mappingMethod]; - var visualHandler = VisualMapping.visualHandlers[visualType]; - this.applyVisual = visualHandler.applyVisual; - this.getColorMapper = visualHandler.getColorMapper; - this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod]; - if (mappingMethod === 'piecewise') { - normalizeVisualRange(thisOption); - preprocessForPiecewise(thisOption); - } else if (mappingMethod === 'category') { - thisOption.categories ? preprocessForSpecifiedCategory(thisOption) - // categories is ordinal when thisOption.categories not specified, - // which need no more preprocess except normalize visual. - : normalizeVisualRange(thisOption, true); - } else { - // mappingMethod === 'linear' or 'fixed' - assert(mappingMethod !== 'linear' || thisOption.dataExtent); - normalizeVisualRange(thisOption); - } - } - VisualMapping.prototype.mapValueToVisual = function (value) { - var normalized = this._normalizeData(value); - return this._normalizedToVisual(normalized, value); - }; - VisualMapping.prototype.getNormalizer = function () { - return bind(this._normalizeData, this); - }; - /** - * List available visual types. - * - * @public - * @return {Array.} - */ - VisualMapping.listVisualTypes = function () { - return keys(VisualMapping.visualHandlers); - }; - // /** - // * @public - // */ - // static addVisualHandler(name, handler) { - // visualHandlers[name] = handler; - // } - /** - * @public - */ - VisualMapping.isValidType = function (visualType) { - return VisualMapping.visualHandlers.hasOwnProperty(visualType); - }; - /** - * Convenient method. - * Visual can be Object or Array or primary type. - */ - VisualMapping.eachVisual = function (visual, callback, context) { - if (isObject(visual)) { - each(visual, callback, context); - } else { - callback.call(context, visual); - } - }; - VisualMapping.mapVisual = function (visual, callback, context) { - var isPrimary; - var newVisual = isArray(visual) ? [] : isObject(visual) ? {} : (isPrimary = true, null); - VisualMapping.eachVisual(visual, function (v, key) { - var newVal = callback.call(context, v, key); - isPrimary ? newVisual = newVal : newVisual[key] = newVal; - }); - return newVisual; - }; - /** - * Retrieve visual properties from given object. - */ - VisualMapping.retrieveVisuals = function (obj) { - var ret = {}; - var hasVisual; - obj && each$3(VisualMapping.visualHandlers, function (h, visualType) { - if (obj.hasOwnProperty(visualType)) { - ret[visualType] = obj[visualType]; - hasVisual = true; - } - }); - return hasVisual ? ret : null; - }; - /** - * Give order to visual types, considering colorSaturation, colorAlpha depends on color. - * - * @public - * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...} - * IF Array, like: ['color', 'symbol', 'colorSaturation'] - * @return {Array.} Sorted visual types. - */ - VisualMapping.prepareVisualTypes = function (visualTypes) { - if (isArray(visualTypes)) { - visualTypes = visualTypes.slice(); - } else if (isObject$3(visualTypes)) { - var types_1 = []; - each$3(visualTypes, function (item, type) { - types_1.push(type); - }); - visualTypes = types_1; - } else { - return []; - } - visualTypes.sort(function (type1, type2) { - // color should be front of colorSaturation, colorAlpha, ... - // symbol and symbolSize do not matter. - return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1; - }); - return visualTypes; - }; - /** - * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'. - * Other visuals are only depends on themself. - */ - VisualMapping.dependsOn = function (visualType1, visualType2) { - return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2; - }; - /** - * @param value - * @param pieceList [{value: ..., interval: [min, max]}, ...] - * Always from small to big. - * @param findClosestWhenOutside Default to be false - * @return index - */ - VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) { - var possibleI; - var abs = Infinity; - // value has the higher priority. - for (var i = 0, len = pieceList.length; i < len; i++) { - var pieceValue = pieceList[i].value; - if (pieceValue != null) { - if (pieceValue === value - // FIXME - // It is supposed to compare value according to value type of dimension, - // but currently value type can exactly be string or number. - // Compromise for numeric-like string (like '12'), especially - // in the case that visualMap.categories is ['22', '33']. - || isString(pieceValue) && pieceValue === value + '') { - return i; - } - findClosestWhenOutside && updatePossible(pieceValue, i); - } - } - for (var i = 0, len = pieceList.length; i < len; i++) { - var piece = pieceList[i]; - var interval = piece.interval; - var close_1 = piece.close; - if (interval) { - if (interval[0] === -Infinity) { - if (littleThan(close_1[1], value, interval[1])) { - return i; - } - } else if (interval[1] === Infinity) { - if (littleThan(close_1[0], interval[0], value)) { - return i; - } - } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) { - return i; - } - findClosestWhenOutside && updatePossible(interval[0], i); - findClosestWhenOutside && updatePossible(interval[1], i); - } - } - if (findClosestWhenOutside) { - return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI; - } - function updatePossible(val, index) { - var newAbs = Math.abs(val - value); - if (newAbs < abs) { - abs = newAbs; - possibleI = index; - } - } - }; - VisualMapping.visualHandlers = { - color: { - applyVisual: makeApplyVisual('color'), - getColorMapper: function () { - var thisOption = this.option; - return bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) { - !isNormalized && (value = this._normalizeData(value)); - return doMapCategory.call(this, value); - } : function (value, isNormalized, out) { - // If output rgb array - // which will be much faster and useful in pixel manipulation - var returnRGBArray = !!out; - !isNormalized && (value = this._normalizeData(value)); - out = fastLerp(value, thisOption.parsedVisual, out); - return returnRGBArray ? out : stringify(out, 'rgba'); - }, this); - }, - _normalizedToVisual: { - linear: function (normalized) { - return stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba'); - }, - category: doMapCategory, - piecewise: function (normalized, value) { - var result = getSpecifiedVisual.call(this, value); - if (result == null) { - result = stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba'); - } - return result; - }, - fixed: doMapFixed - } - }, - colorHue: makePartialColorVisualHandler(function (color$1, value) { - return modifyHSL(color$1, value); - }), - colorSaturation: makePartialColorVisualHandler(function (color$1, value) { - return modifyHSL(color$1, null, value); - }), - colorLightness: makePartialColorVisualHandler(function (color$1, value) { - return modifyHSL(color$1, null, null, value); - }), - colorAlpha: makePartialColorVisualHandler(function (color$1, value) { - return modifyAlpha(color$1, value); - }), - decal: { - applyVisual: makeApplyVisual('decal'), - _normalizedToVisual: { - linear: null, - category: doMapCategory, - piecewise: null, - fixed: null - } - }, - opacity: { - applyVisual: makeApplyVisual('opacity'), - _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) - }, - liftZ: { - applyVisual: makeApplyVisual('liftZ'), - _normalizedToVisual: { - linear: doMapFixed, - category: doMapFixed, - piecewise: doMapFixed, - fixed: doMapFixed - } - }, - symbol: { - applyVisual: function (value, getter, setter) { - var symbolCfg = this.mapValueToVisual(value); - setter('symbol', symbolCfg); - }, - _normalizedToVisual: { - linear: doMapToArray, - category: doMapCategory, - piecewise: function (normalized, value) { - var result = getSpecifiedVisual.call(this, value); - if (result == null) { - result = doMapToArray.call(this, normalized); - } - return result; - }, - fixed: doMapFixed - } - }, - symbolSize: { - applyVisual: makeApplyVisual('symbolSize'), - _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) - } - }; - return VisualMapping; - }(); - function preprocessForPiecewise(thisOption) { - var pieceList = thisOption.pieceList; - thisOption.hasSpecialVisual = false; - each(pieceList, function (piece, index) { - piece.originIndex = index; - // piece.visual is "result visual value" but not - // a visual range, so it does not need to be normalized. - if (piece.visual != null) { - thisOption.hasSpecialVisual = true; - } - }); - } - function preprocessForSpecifiedCategory(thisOption) { - // Hash categories. - var categories = thisOption.categories; - var categoryMap = thisOption.categoryMap = {}; - var visual = thisOption.visual; - each$3(categories, function (cate, index) { - categoryMap[cate] = index; - }); - // Process visual map input. - if (!isArray(visual)) { - var visualArr_1 = []; - if (isObject(visual)) { - each$3(visual, function (v, cate) { - var index = categoryMap[cate]; - visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v; - }); - } else { - // Is primary type, represents default visual. - visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual; - } - visual = setVisualToOption(thisOption, visualArr_1); - } - // Remove categories that has no visual, - // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX. - for (var i = categories.length - 1; i >= 0; i--) { - if (visual[i] == null) { - delete categoryMap[categories[i]]; - categories.pop(); - } - } - } - function normalizeVisualRange(thisOption, isCategory) { - var visual = thisOption.visual; - var visualArr = []; - if (isObject(visual)) { - each$3(visual, function (v) { - visualArr.push(v); - }); - } else if (visual != null) { - visualArr.push(visual); - } - var doNotNeedPair = { - color: 1, - symbol: 1 - }; - if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) { - // Do not care visualArr.length === 0, which is illegal. - visualArr[1] = visualArr[0]; - } - setVisualToOption(thisOption, visualArr); - } - function makePartialColorVisualHandler(applyValue) { - return { - applyVisual: function (value, getter, setter) { - // Only used in HSL - var colorChannel = this.mapValueToVisual(value); - // Must not be array value - setter('color', applyValue(getter('color'), colorChannel)); - }, - _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) - }; - } - function doMapToArray(normalized) { - var visual = this.option.visual; - return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}? - } - - function makeApplyVisual(visualType) { - return function (value, getter, setter) { - setter(visualType, this.mapValueToVisual(value)); - }; - } - function doMapCategory(normalized) { - var visual = this.option.visual; - return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized]; - } - function doMapFixed() { - // visual will be convert to array. - return this.option.visual[0]; - } - /** - * Create mapped to numeric visual - */ - function createNormalizedToNumericVisual(sourceExtent) { - return { - linear: function (normalized) { - return linearMap(normalized, sourceExtent, this.option.visual, true); - }, - category: doMapCategory, - piecewise: function (normalized, value) { - var result = getSpecifiedVisual.call(this, value); - if (result == null) { - result = linearMap(normalized, sourceExtent, this.option.visual, true); - } - return result; - }, - fixed: doMapFixed - }; - } - function getSpecifiedVisual(value) { - var thisOption = this.option; - var pieceList = thisOption.pieceList; - if (thisOption.hasSpecialVisual) { - var pieceIndex = VisualMapping.findPieceIndex(value, pieceList); - var piece = pieceList[pieceIndex]; - if (piece && piece.visual) { - return piece.visual[this.type]; - } - } - } - function setVisualToOption(thisOption, visualArr) { - thisOption.visual = visualArr; - if (thisOption.type === 'color') { - thisOption.parsedVisual = map(visualArr, function (item) { - var color$1 = parse(item); - if (!color$1 && "development" !== 'production') { - warn("'" + item + "' is an illegal color, fallback to '#000000'", true); - } - return color$1 || [0, 0, 0, 1]; - }); - } - return visualArr; - } - /** - * Normalizers by mapping methods. - */ - var normalizers = { - linear: function (value) { - return linearMap(value, this.option.dataExtent, [0, 1], true); - }, - piecewise: function (value) { - var pieceList = this.option.pieceList; - var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true); - if (pieceIndex != null) { - return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true); - } - }, - category: function (value) { - var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value - return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index; - }, - fixed: noop - }; - function littleThan(close, a, b) { - return close ? a <= b : a < b; - } - - var ITEM_STYLE_NORMAL = 'itemStyle'; - var inner$9 = makeInner(); - var treemapVisual = { - seriesType: 'treemap', - reset: function (seriesModel) { - var tree = seriesModel.getData().tree; - var root = tree.root; - if (root.isRemoved()) { - return; - } - travelTree(root, - // Visual should calculate from tree root but not view root. - {}, seriesModel.getViewRoot().getAncestors(), seriesModel); - } - }; - function travelTree(node, designatedVisual, viewRootAncestors, seriesModel) { - var nodeModel = node.getModel(); - var nodeLayout = node.getLayout(); - var data = node.hostTree.data; - // Optimize - if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) { - return; - } - var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL); - var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel); - var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); - // calculate border color - var borderColor = nodeItemStyleModel.get('borderColor'); - var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation'); - var thisNodeColor; - if (borderColorSaturation != null) { - // For performance, do not always execute 'calculateColor'. - thisNodeColor = calculateColor(visuals); - borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor); - } - existsStyle.stroke = borderColor; - var viewChildren = node.viewChildren; - if (!viewChildren || !viewChildren.length) { - thisNodeColor = calculateColor(visuals); - // Apply visual to this node. - existsStyle.fill = thisNodeColor; - } else { - var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); - // Designate visual to children. - each(viewChildren, function (child, index) { - // If higher than viewRoot, only ancestors of viewRoot is needed to visit. - if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) { - var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel); - travelTree(child, childVisual, viewRootAncestors, seriesModel); - } - }); - } - } - function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) { - var visuals = extend({}, designatedVisual); - var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle; - each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) { - // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel - designatedVisualItemStyle[visualName] = designatedVisual[visualName]; - var val = nodeItemStyleModel.get(visualName); - designatedVisualItemStyle[visualName] = null; - val != null && (visuals[visualName] = val); - }); - return visuals; - } - function calculateColor(visuals) { - var color = getValueVisualDefine(visuals, 'color'); - if (color) { - var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha'); - var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation'); - if (colorSaturation) { - color = modifyHSL(color, null, null, colorSaturation); - } - if (colorAlpha) { - color = modifyAlpha(color, colorAlpha); - } - return color; - } - } - function calculateBorderColor(borderColorSaturation, thisNodeColor) { - return thisNodeColor != null - // Can only be string - ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null; - } - function getValueVisualDefine(visuals, name) { - var value = visuals[name]; - if (value != null && value !== 'none') { - return value; - } - } - function buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) { - if (!viewChildren || !viewChildren.length) { - return; - } - var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation')); - if (!rangeVisual) { - return; - } - var visualMin = nodeModel.get('visualMin'); - var visualMax = nodeModel.get('visualMax'); - var dataExtent = nodeLayout.dataExtent.slice(); - visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin); - visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax); - var colorMappingBy = nodeModel.get('colorMappingBy'); - var opt = { - type: rangeVisual.name, - dataExtent: dataExtent, - visual: rangeVisual.range - }; - if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) { - opt.mappingMethod = 'category'; - opt.loop = true; - // categories is ordinal, so do not set opt.categories. - } else { - opt.mappingMethod = 'linear'; - } - var mapping = new VisualMapping(opt); - inner$9(mapping).drColorMappingBy = colorMappingBy; - return mapping; - } - // Notice: If we don't have the attribute 'colorRange', but only use - // attribute 'color' to represent both concepts of 'colorRange' and 'color', - // (It means 'colorRange' when 'color' is Array, means 'color' when not array), - // this problem will be encountered: - // If a level-1 node doesn't have children, and its siblings have children, - // and colorRange is set on level-1, then the node cannot be colored. - // So we separate 'colorRange' and 'color' to different attributes. - function getRangeVisual(nodeModel, name) { - // 'colorRange', 'colorARange', 'colorSRange'. - // If not exists on this node, fetch from levels and series. - var range = nodeModel.get(name); - return isArray(range) && range.length ? { - name: name, - range: range - } : null; - } - function mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) { - var childVisuals = extend({}, visuals); - if (mapping) { - // Only support color, colorAlpha, colorSaturation. - var mappingType = mapping.type; - var colorMappingBy = mappingType === 'color' && inner$9(mapping).drColorMappingBy; - var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension')); - childVisuals[mappingType] = mapping.mapValueToVisual(value); - } - return childVisuals; - } - - var mathMax$7 = Math.max; - var mathMin$7 = Math.min; - var retrieveValue = retrieve; - var each$4 = each; - var PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth']; - var PATH_GAP_WIDTH = ['itemStyle', 'gapWidth']; - var PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show']; - var PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height']; - /** - * @public - */ - var treemapLayout = { - seriesType: 'treemap', - reset: function (seriesModel, ecModel, api, payload) { - // Layout result in each node: - // {x, y, width, height, area, borderWidth} - var ecWidth = api.getWidth(); - var ecHeight = api.getHeight(); - var seriesOption = seriesModel.option; - var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - var size = seriesOption.size || []; // Compatible with ec2. - var containerWidth = parsePercent$1(retrieveValue(layoutInfo.width, size[0]), ecWidth); - var containerHeight = parsePercent$1(retrieveValue(layoutInfo.height, size[1]), ecHeight); - // Fetch payload info. - var payloadType = payload && payload.type; - var types = ['treemapZoomToNode', 'treemapRootToNode']; - var targetInfo = retrieveTargetInfo(payload, types, seriesModel); - var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null; - var viewRoot = seriesModel.getViewRoot(); - var viewAbovePath = getPathToRoot(viewRoot); - if (payloadType !== 'treemapMove') { - var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight]; - var sort_1 = seriesOption.sort; - if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') { - // Default to be desc order. - sort_1 = 'desc'; - } - var options = { - squareRatio: seriesOption.squareRatio, - sort: sort_1, - leafDepth: seriesOption.leafDepth - }; - // layout should be cleared because using updateView but not update. - viewRoot.hostTree.clearLayouts(); - // TODO - // optimize: if out of view clip, do not layout. - // But take care that if do not render node out of view clip, - // how to calculate start po - var viewRootLayout_1 = { - x: 0, - y: 0, - width: rootSize[0], - height: rootSize[1], - area: rootSize[0] * rootSize[1] - }; - viewRoot.setLayout(viewRootLayout_1); - squarify(viewRoot, options, false, 0); - // Supplement layout. - viewRootLayout_1 = viewRoot.getLayout(); - each$4(viewAbovePath, function (node, index) { - var childValue = (viewAbovePath[index + 1] || viewRoot).getValue(); - node.setLayout(extend({ - dataExtent: [childValue, childValue], - borderWidth: 0, - upperHeight: 0 - }, viewRootLayout_1)); - }); - } - var treeRoot = seriesModel.getData().tree.root; - treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true); - seriesModel.setLayoutInfo(layoutInfo); - // FIXME - // 现在没有clip功能,暂时取ec高宽。 - prunning(treeRoot, - // Transform to base element coordinate system. - new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0); - } - }; - /** - * Layout treemap with squarify algorithm. - * The original presentation of this algorithm - * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk - * . - * The implementation of this algorithm was originally copied from "d3.js" - * - * with some modifications made for this program. - * See the license statement at the head of this file. - * - * @protected - * @param {module:echarts/data/Tree~TreeNode} node - * @param {Object} options - * @param {string} options.sort 'asc' or 'desc' - * @param {number} options.squareRatio - * @param {boolean} hideChildren - * @param {number} depth - */ - function squarify(node, options, hideChildren, depth) { - var width; - var height; - if (node.isRemoved()) { - return; - } - var thisLayout = node.getLayout(); - width = thisLayout.width; - height = thisLayout.height; - // Considering border and gap - var nodeModel = node.getModel(); - var borderWidth = nodeModel.get(PATH_BORDER_WIDTH); - var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2; - var upperLabelHeight = getUpperLabelHeight(nodeModel); - var upperHeight = Math.max(borderWidth, upperLabelHeight); - var layoutOffset = borderWidth - halfGapWidth; - var layoutOffsetUpper = upperHeight - halfGapWidth; - node.setLayout({ - borderWidth: borderWidth, - upperHeight: upperHeight, - upperLabelHeight: upperLabelHeight - }, true); - width = mathMax$7(width - 2 * layoutOffset, 0); - height = mathMax$7(height - layoutOffset - layoutOffsetUpper, 0); - var totalArea = width * height; - var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth); - if (!viewChildren.length) { - return; - } - var rect = { - x: layoutOffset, - y: layoutOffsetUpper, - width: width, - height: height - }; - var rowFixedLength = mathMin$7(width, height); - var best = Infinity; // the best row score so far - var row = []; - row.area = 0; - for (var i = 0, len = viewChildren.length; i < len;) { - var child = viewChildren[i]; - row.push(child); - row.area += child.getLayout().area; - var score = worst(row, rowFixedLength, options.squareRatio); - // continue with this orientation - if (score <= best) { - i++; - best = score; - } - // abort, and try a different orientation - else { - row.area -= row.pop().getLayout().area; - position(row, rowFixedLength, rect, halfGapWidth, false); - rowFixedLength = mathMin$7(rect.width, rect.height); - row.length = row.area = 0; - best = Infinity; - } - } - if (row.length) { - position(row, rowFixedLength, rect, halfGapWidth, true); - } - if (!hideChildren) { - var childrenVisibleMin = nodeModel.get('childrenVisibleMin'); - if (childrenVisibleMin != null && totalArea < childrenVisibleMin) { - hideChildren = true; - } - } - for (var i = 0, len = viewChildren.length; i < len; i++) { - squarify(viewChildren[i], options, hideChildren, depth + 1); - } - } - /** - * Set area to each child, and calculate data extent for visual coding. - */ - function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) { - var viewChildren = node.children || []; - var orderBy = options.sort; - orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null); - var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; - // leafDepth has higher priority. - if (hideChildren && !overLeafDepth) { - return node.viewChildren = []; - } - // Sort children, order by desc. - viewChildren = filter(viewChildren, function (child) { - return !child.isRemoved(); - }); - sort$1(viewChildren, orderBy); - var info = statistic(nodeModel, viewChildren, orderBy); - if (info.sum === 0) { - return node.viewChildren = []; - } - info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren); - if (info.sum === 0) { - return node.viewChildren = []; - } - // Set area to each child. - for (var i = 0, len = viewChildren.length; i < len; i++) { - var area = viewChildren[i].getValue() / info.sum * totalArea; - // Do not use setLayout({...}, true), because it is needed to clear last layout. - viewChildren[i].setLayout({ - area: area - }); - } - if (overLeafDepth) { - viewChildren.length && node.setLayout({ - isLeafRoot: true - }, true); - viewChildren.length = 0; - } - node.viewChildren = viewChildren; - node.setLayout({ - dataExtent: info.dataExtent - }, true); - return viewChildren; - } - /** - * Consider 'visibleMin'. Modify viewChildren and get new sum. - */ - function filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) { - // visibleMin is not supported yet when no option.sort. - if (!orderBy) { - return sum; - } - var visibleMin = nodeModel.get('visibleMin'); - var len = orderedChildren.length; - var deletePoint = len; - // Always travel from little value to big value. - for (var i = len - 1; i >= 0; i--) { - var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue(); - if (value / sum * totalArea < visibleMin) { - deletePoint = i; - sum -= value; - } - } - orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint); - return sum; - } - /** - * Sort - */ - function sort$1(viewChildren, orderBy) { - if (orderBy) { - viewChildren.sort(function (a, b) { - var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); - return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff; - }); - } - return viewChildren; - } - /** - * Statistic - */ - function statistic(nodeModel, children, orderBy) { - // Calculate sum. - var sum = 0; - for (var i = 0, len = children.length; i < len; i++) { - sum += children[i].getValue(); - } - // Statistic data extent for latter visual coding. - // Notice: data extent should be calculate based on raw children - // but not filtered view children, otherwise visual mapping will not - // be stable when zoom (where children is filtered by visibleMin). - var dimension = nodeModel.get('visualDimension'); - var dataExtent; - // The same as area dimension. - if (!children || !children.length) { - dataExtent = [NaN, NaN]; - } else if (dimension === 'value' && orderBy) { - dataExtent = [children[children.length - 1].getValue(), children[0].getValue()]; - orderBy === 'asc' && dataExtent.reverse(); - } - // Other dimension. - else { - dataExtent = [Infinity, -Infinity]; - each$4(children, function (child) { - var value = child.getValue(dimension); - value < dataExtent[0] && (dataExtent[0] = value); - value > dataExtent[1] && (dataExtent[1] = value); - }); - } - return { - sum: sum, - dataExtent: dataExtent - }; - } - /** - * Computes the score for the specified row, - * as the worst aspect ratio. - */ - function worst(row, rowFixedLength, ratio) { - var areaMax = 0; - var areaMin = Infinity; - for (var i = 0, area = void 0, len = row.length; i < len; i++) { - area = row[i].getLayout().area; - if (area) { - area < areaMin && (areaMin = area); - area > areaMax && (areaMax = area); - } - } - var squareArea = row.area * row.area; - var f = rowFixedLength * rowFixedLength * ratio; - return squareArea ? mathMax$7(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity; - } - /** - * Positions the specified row of nodes. Modifies `rect`. - */ - function position(row, rowFixedLength, rect, halfGapWidth, flush) { - // When rowFixedLength === rect.width, - // it is horizontal subdivision, - // rowFixedLength is the width of the subdivision, - // rowOtherLength is the height of the subdivision, - // and nodes will be positioned from left to right. - // wh[idx0WhenH] means: when horizontal, - // wh[idx0WhenH] => wh[0] => 'width'. - // xy[idx1WhenH] => xy[1] => 'y'. - var idx0WhenH = rowFixedLength === rect.width ? 0 : 1; - var idx1WhenH = 1 - idx0WhenH; - var xy = ['x', 'y']; - var wh = ['width', 'height']; - var last = rect[xy[idx0WhenH]]; - var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0; - if (flush || rowOtherLength > rect[wh[idx1WhenH]]) { - rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow - } - - for (var i = 0, rowLen = row.length; i < rowLen; i++) { - var node = row[i]; - var nodeLayout = {}; - var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0; - var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$7(rowOtherLength - 2 * halfGapWidth, 0); - // We use Math.max/min to avoid negative width/height when considering gap width. - var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last; - var modWH = i === rowLen - 1 || remain < step ? remain : step; - var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$7(modWH - 2 * halfGapWidth, 0); - nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$7(halfGapWidth, wh1 / 2); - nodeLayout[xy[idx0WhenH]] = last + mathMin$7(halfGapWidth, wh0 / 2); - last += modWH; - node.setLayout(nodeLayout, true); - } - rect[xy[idx1WhenH]] += rowOtherLength; - rect[wh[idx1WhenH]] -= rowOtherLength; - } - // Return [containerWidth, containerHeight] as default. - function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) { - // If targetInfo.node exists, we zoom to the node, - // so estimate whole width and height by target node. - var currNode = (targetInfo || {}).node; - var defaultSize = [containerWidth, containerHeight]; - if (!currNode || currNode === viewRoot) { - return defaultSize; - } - var parent; - var viewArea = containerWidth * containerHeight; - var area = viewArea * seriesModel.option.zoomToNodeRatio; - while (parent = currNode.parentNode) { - // jshint ignore:line - var sum = 0; - var siblings = parent.children; - for (var i = 0, len = siblings.length; i < len; i++) { - sum += siblings[i].getValue(); - } - var currNodeValue = currNode.getValue(); - if (currNodeValue === 0) { - return defaultSize; - } - area *= sum / currNodeValue; - // Considering border, suppose aspect ratio is 1. - var parentModel = parent.getModel(); - var borderWidth = parentModel.get(PATH_BORDER_WIDTH); - var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel)); - area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5); - area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER); - currNode = parent; - } - area < viewArea && (area = viewArea); - var scale = Math.pow(area / viewArea, 0.5); - return [containerWidth * scale, containerHeight * scale]; - } - // Root position based on coord of containerGroup - function calculateRootPosition(layoutInfo, rootRect, targetInfo) { - if (rootRect) { - return { - x: rootRect.x, - y: rootRect.y - }; - } - var defaultPosition = { - x: 0, - y: 0 - }; - if (!targetInfo) { - return defaultPosition; - } - // If targetInfo is fetched by 'retrieveTargetInfo', - // old tree and new tree are the same tree, - // so the node still exists and we can visit it. - var targetNode = targetInfo.node; - var layout = targetNode.getLayout(); - if (!layout) { - return defaultPosition; - } - // Transform coord from local to container. - var targetCenter = [layout.width / 2, layout.height / 2]; - var node = targetNode; - while (node) { - var nodeLayout = node.getLayout(); - targetCenter[0] += nodeLayout.x; - targetCenter[1] += nodeLayout.y; - node = node.parentNode; - } - return { - x: layoutInfo.width / 2 - targetCenter[0], - y: layoutInfo.height / 2 - targetCenter[1] - }; - } - // Mark nodes visible for prunning when visual coding and rendering. - // Prunning depends on layout and root position, so we have to do it after layout. - function prunning(node, clipRect, viewAbovePath, viewRoot, depth) { - var nodeLayout = node.getLayout(); - var nodeInViewAbovePath = viewAbovePath[depth]; - var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node; - if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) { - return; - } - node.setLayout({ - // isInView means: viewRoot sub tree + viewAbovePath - isInView: true, - // invisible only means: outside view clip so that the node can not - // see but still layout for animation preparation but not render. - invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout), - isAboveViewRoot: isAboveViewRoot - }, true); - // Transform to child coordinate. - var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height); - each$4(node.viewChildren || [], function (child) { - prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1); - }); - } - function getUpperLabelHeight(model) { - return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0; - } - - function install$c(registers) { - registers.registerSeriesModel(TreemapSeriesModel); - registers.registerChartView(TreemapView); - registers.registerVisual(treemapVisual); - registers.registerLayout(treemapLayout); - installTreemapAction(registers); - } - - function categoryFilter(ecModel) { - var legendModels = ecModel.findComponents({ - mainType: 'legend' - }); - if (!legendModels || !legendModels.length) { - return; - } - ecModel.eachSeriesByType('graph', function (graphSeries) { - var categoriesData = graphSeries.getCategoriesData(); - var graph = graphSeries.getGraph(); - var data = graph.data; - var categoryNames = categoriesData.mapArray(categoriesData.getName); - data.filterSelf(function (idx) { - var model = data.getItemModel(idx); - var category = model.getShallow('category'); - if (category != null) { - if (isNumber(category)) { - category = categoryNames[category]; - } - // If in any legend component the status is not selected. - for (var i = 0; i < legendModels.length; i++) { - if (!legendModels[i].isSelected(category)) { - return false; - } - } - } - return true; - }); - }); - } - - function categoryVisual(ecModel) { - var paletteScope = {}; - ecModel.eachSeriesByType('graph', function (seriesModel) { - var categoriesData = seriesModel.getCategoriesData(); - var data = seriesModel.getData(); - var categoryNameIdxMap = {}; - categoriesData.each(function (idx) { - var name = categoriesData.getName(idx); - // Add prefix to avoid conflict with Object.prototype. - categoryNameIdxMap['ec-' + name] = idx; - var itemModel = categoriesData.getItemModel(idx); - var style = itemModel.getModel('itemStyle').getItemStyle(); - if (!style.fill) { - // Get color from palette. - style.fill = seriesModel.getColorFromPalette(name, paletteScope); - } - categoriesData.setItemVisual(idx, 'style', style); - var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect']; - for (var i = 0; i < symbolVisualList.length; i++) { - var symbolVisual = itemModel.getShallow(symbolVisualList[i], true); - if (symbolVisual != null) { - categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual); - } - } - }); - // Assign category color to visual - if (categoriesData.count()) { - data.each(function (idx) { - var model = data.getItemModel(idx); - var categoryIdx = model.getShallow('category'); - if (categoryIdx != null) { - if (isString(categoryIdx)) { - categoryIdx = categoryNameIdxMap['ec-' + categoryIdx]; - } - var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style'); - var style = data.ensureUniqueItemVisual(idx, 'style'); - extend(style, categoryStyle); - var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect']; - for (var i = 0; i < visualList.length; i++) { - data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i])); - } - } - }); - } - }); - } - - function normalize$2(a) { - if (!(a instanceof Array)) { - a = [a, a]; - } - return a; - } - function graphEdgeVisual(ecModel) { - ecModel.eachSeriesByType('graph', function (seriesModel) { - var graph = seriesModel.getGraph(); - var edgeData = seriesModel.getEdgeData(); - var symbolType = normalize$2(seriesModel.get('edgeSymbol')); - var symbolSize = normalize$2(seriesModel.get('edgeSymbolSize')); - // const colorQuery = ['lineStyle', 'color'] as const; - // const opacityQuery = ['lineStyle', 'opacity'] as const; - edgeData.setVisual('fromSymbol', symbolType && symbolType[0]); - edgeData.setVisual('toSymbol', symbolType && symbolType[1]); - edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); - edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]); - edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle()); - edgeData.each(function (idx) { - var itemModel = edgeData.getItemModel(idx); - var edge = graph.getEdgeByIndex(idx); - var symbolType = normalize$2(itemModel.getShallow('symbol', true)); - var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true)); - // Edge visual must after node visual - var style = itemModel.getModel('lineStyle').getLineStyle(); - var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style'); - extend(existsStyle, style); - switch (existsStyle.stroke) { - case 'source': - { - var nodeStyle = edge.node1.getVisual('style'); - existsStyle.stroke = nodeStyle && nodeStyle.fill; - break; - } - case 'target': - { - var nodeStyle = edge.node2.getVisual('style'); - existsStyle.stroke = nodeStyle && nodeStyle.fill; - break; - } - } - symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]); - symbolType[1] && edge.setVisual('toSymbol', symbolType[1]); - symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]); - symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]); - }); - }); - } - - var KEY_DELIMITER = '-->'; - /** - * params handler - * @param {module:echarts/model/SeriesModel} seriesModel - * @returns {*} - */ - var getAutoCurvenessParams = function (seriesModel) { - return seriesModel.get('autoCurveness') || null; - }; - /** - * Generate a list of edge curvatures, 20 is the default - * @param {module:echarts/model/SeriesModel} seriesModel - * @param {number} appendLength - * @return 20 => [0, -0.2, 0.2, -0.4, 0.4, -0.6, 0.6, -0.8, 0.8, -1, 1, -1.2, 1.2, -1.4, 1.4, -1.6, 1.6, -1.8, 1.8, -2] - */ - var createCurveness = function (seriesModel, appendLength) { - var autoCurvenessParmas = getAutoCurvenessParams(seriesModel); - var length = 20; - var curvenessList = []; - // handler the function set - if (isNumber(autoCurvenessParmas)) { - length = autoCurvenessParmas; - } else if (isArray(autoCurvenessParmas)) { - seriesModel.__curvenessList = autoCurvenessParmas; - return; - } - // append length - if (appendLength > length) { - length = appendLength; - } - // make sure the length is even - var len = length % 2 ? length + 2 : length + 3; - curvenessList = []; - for (var i = 0; i < len; i++) { - curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1)); - } - seriesModel.__curvenessList = curvenessList; - }; - /** - * Create different cache key data in the positive and negative directions, in order to set the curvature later - * @param {number|string|module:echarts/data/Graph.Node} n1 - * @param {number|string|module:echarts/data/Graph.Node} n2 - * @param {module:echarts/model/SeriesModel} seriesModel - * @returns {string} key - */ - var getKeyOfEdges = function (n1, n2, seriesModel) { - var source = [n1.id, n1.dataIndex].join('.'); - var target = [n2.id, n2.dataIndex].join('.'); - return [seriesModel.uid, source, target].join(KEY_DELIMITER); - }; - /** - * get opposite key - * @param {string} key - * @returns {string} - */ - var getOppositeKey = function (key) { - var keys = key.split(KEY_DELIMITER); - return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER); - }; - /** - * get edgeMap with key - * @param edge - * @param {module:echarts/model/SeriesModel} seriesModel - */ - var getEdgeFromMap = function (edge, seriesModel) { - var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel); - return seriesModel.__edgeMap[key]; - }; - /** - * calculate all cases total length - * @param edge - * @param seriesModel - * @returns {number} - */ - var getTotalLengthBetweenNodes = function (edge, seriesModel) { - var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel); - var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel); - return len + lenV; - }; - /** - * - * @param key - */ - var getEdgeMapLengthWithKey = function (key, seriesModel) { - var edgeMap = seriesModel.__edgeMap; - return edgeMap[key] ? edgeMap[key].length : 0; - }; - /** - * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge - * @see /graph/GraphSeries.js@getInitialData - * @param {module:echarts/model/SeriesModel} seriesModel - */ - function initCurvenessList(seriesModel) { - if (!getAutoCurvenessParams(seriesModel)) { - return; - } - seriesModel.__curvenessList = []; - seriesModel.__edgeMap = {}; - // calc the array of curveness List - createCurveness(seriesModel); - } - /** - * set edgeMap with key - * @param {number|string|module:echarts/data/Graph.Node} n1 - * @param {number|string|module:echarts/data/Graph.Node} n2 - * @param {module:echarts/model/SeriesModel} seriesModel - * @param {number} index - */ - function createEdgeMapForCurveness(n1, n2, seriesModel, index) { - if (!getAutoCurvenessParams(seriesModel)) { - return; - } - var key = getKeyOfEdges(n1, n2, seriesModel); - var edgeMap = seriesModel.__edgeMap; - var oppositeEdges = edgeMap[getOppositeKey(key)]; - // set direction - if (edgeMap[key] && !oppositeEdges) { - edgeMap[key].isForward = true; - } else if (oppositeEdges && edgeMap[key]) { - oppositeEdges.isForward = true; - edgeMap[key].isForward = false; - } - edgeMap[key] = edgeMap[key] || []; - edgeMap[key].push(index); - } - /** - * get curvature for edge - * @param edge - * @param {module:echarts/model/SeriesModel} seriesModel - * @param index - */ - function getCurvenessForEdge(edge, seriesModel, index, needReverse) { - var autoCurvenessParams = getAutoCurvenessParams(seriesModel); - var isArrayParam = isArray(autoCurvenessParams); - if (!autoCurvenessParams) { - return null; - } - var edgeArray = getEdgeFromMap(edge, seriesModel); - if (!edgeArray) { - return null; - } - var edgeIndex = -1; - for (var i = 0; i < edgeArray.length; i++) { - if (edgeArray[i] === index) { - edgeIndex = i; - break; - } - } - // if totalLen is Longer createCurveness - var totalLen = getTotalLengthBetweenNodes(edge, seriesModel); - createCurveness(seriesModel, totalLen); - edge.lineStyle = edge.lineStyle || {}; - // if is opposite edge, must set curvenss to opposite number - var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel); - var curvenessList = seriesModel.__curvenessList; - // if pass array no need parity - var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1; - if (!edgeArray.isForward) { - // the opposite edge show outside - var oppositeKey = getOppositeKey(curKey); - var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel); - var resValue = curvenessList[edgeIndex + len + parityCorrection]; - // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite - if (needReverse) { - // set as array may make the parity handle with the len of opposite - if (isArrayParam) { - if (autoCurvenessParams && autoCurvenessParams[0] === 0) { - return (len + parityCorrection) % 2 ? resValue : -resValue; - } else { - return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue; - } - } else { - return (len + parityCorrection) % 2 ? resValue : -resValue; - } - } else { - return curvenessList[edgeIndex + len + parityCorrection]; - } - } else { - return curvenessList[parityCorrection + edgeIndex]; - } - } - - 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, seriesModel); - } - function simpleLayoutEdge(graph, seriesModel) { - graph.eachEdge(function (edge, index) { - var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0); - var p1 = clone$1(edge.node1.getLayout()); - var p2 = clone$1(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); - }); - } - - function graphSimpleLayout(ecModel, api) { - ecModel.eachSeriesByType('graph', function (seriesModel) { - var layout = seriesModel.get('layout'); - var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.type !== 'view') { - var data_1 = seriesModel.getData(); - var dimensions_1 = []; - each(coordSys.dimensions, function (coordDim) { - dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim)); - }); - for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) { - var value = []; - var hasValue = false; - for (var i = 0; i < dimensions_1.length; i++) { - var val = data_1.get(dimensions_1[i], dataIndex); - if (!isNaN(val)) { - hasValue = true; - } - value.push(val); - } - if (hasValue) { - data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value)); - } else { - // Also {Array.}, not undefined to avoid if...else... statement - data_1.setItemLayout(dataIndex, [NaN, NaN]); - } - } - simpleLayoutEdge(data_1.graph, seriesModel); - } else if (!layout || layout === 'none') { - simpleLayout(seriesModel); - } - }); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 getNodeGlobalScale(seriesModel) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys.type !== 'view') { - return 1; - } - var nodeScaleRatio = seriesModel.option.nodeScaleRatio; - var groupZoom = coordSys.scaleX; - // Scale node when zoom changes - var roamZoom = coordSys.getZoom(); - var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; - return nodeScale / groupZoom; - } - function getSymbolSize(node) { - var symbolSize = node.getVisual('symbolSize'); - if (symbolSize instanceof Array) { - symbolSize = (symbolSize[0] + symbolSize[1]) / 2; - } - return +symbolSize; - } - - var PI$6 = Math.PI; - var _symbolRadiansHalf = []; - /** - * `basedOn` can be: - * 'value': - * This layout is not accurate and have same bad case. For example, - * if the min value is very smaller than the max value, the nodes - * with the min value probably overlap even though there is enough - * space to layout them. So we only use this approach in the as the - * init layout of the force layout. - * FIXME - * Probably we do not need this method any more but use - * `basedOn: 'symbolSize'` in force layout if - * delay its init operations to GraphView. - * 'symbolSize': - * This approach work only if all of the symbol size calculated. - * That is, the progressive rendering is not applied to graph. - * FIXME - * If progressive rendering is applied to graph some day, - * probably we have to use `basedOn: 'value'`. - */ - function circularLayout(seriesModel, basedOn, draggingNode, pointer) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.type !== 'view') { - return; - } - var rect = coordSys.getBoundingRect(); - var nodeData = seriesModel.getData(); - var graph = nodeData.graph; - var cx = rect.width / 2 + rect.x; - var cy = rect.height / 2 + rect.y; - var r = Math.min(rect.width, rect.height) / 2; - var count = nodeData.count(); - nodeData.setLayout({ - cx: cx, - cy: cy - }); - if (!count) { - return; - } - if (draggingNode) { - var _a = coordSys.pointToData(pointer), - tempX = _a[0], - tempY = _a[1]; - var v = [tempX - cx, tempY - cy]; - normalize(v, v); - scale(v, v, r); - draggingNode.setLayout([cx + v[0], cy + v[1]], true); - var circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']); - rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy); - } - _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count); - graph.eachEdge(function (edge, index) { - var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0); - var p1 = clone$1(edge.node1.getLayout()); - var p2 = clone$1(edge.node2.getLayout()); - var cp1; - var x12 = (p1[0] + p2[0]) / 2; - var y12 = (p1[1] + p2[1]) / 2; - if (+curveness) { - curveness *= 3; - cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)]; - } - edge.setLayout([p1, p2, cp1]); - }); - } - var _layoutNodesBasedOn = { - value: function (seriesModel, graph, nodeData, r, cx, cy, count) { - var angle = 0; - var sum = nodeData.getSum('value'); - var unitAngle = Math.PI * 2 / (sum || count); - graph.eachNode(function (node) { - var value = node.getValue('value'); - var radianHalf = unitAngle * (sum ? value : 1) / 2; - angle += radianHalf; - node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]); - angle += radianHalf; - }); - }, - symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) { - var sumRadian = 0; - _symbolRadiansHalf.length = count; - var nodeScale = getNodeGlobalScale(seriesModel); - graph.eachNode(function (node) { - var symbolSize = getSymbolSize(node); - // Normally this case will not happen, but we still add - // some the defensive code (2px is an arbitrary value). - isNaN(symbolSize) && (symbolSize = 2); - symbolSize < 0 && (symbolSize = 0); - symbolSize *= nodeScale; - var symbolRadianHalf = Math.asin(symbolSize / 2 / r); - // when `symbolSize / 2` is bigger than `r`. - isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$6 / 2); - _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf; - sumRadian += symbolRadianHalf * 2; - }); - var halfRemainRadian = (2 * PI$6 - sumRadian) / count / 2; - var angle = 0; - graph.eachNode(function (node) { - var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex]; - angle += radianHalf; - // init circular layout for - // 1. layout undefined node - // 2. not fixed node - (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]); - angle += radianHalf; - }); - } - }; - function rotateNodeLabel(node, circularRotateLabel, cx, cy) { - var el = node.getGraphicEl(); - // need to check if el exists. '-' value may not create node element. - if (!el) { - return; - } - var nodeModel = node.getModel(); - var labelRotate = nodeModel.get(['label', 'rotate']) || 0; - var symbolPath = el.getSymbolPath(); - if (circularRotateLabel) { - var pos = node.getLayout(); - 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'; - symbolPath.setTextConfig({ - rotation: -rad, - position: textPosition, - origin: 'center' - }); - var emphasisState = symbolPath.ensureState('emphasis'); - extend(emphasisState.textConfig || (emphasisState.textConfig = {}), { - position: textPosition - }); - } else { - symbolPath.setTextConfig({ - rotation: labelRotate *= Math.PI / 180 - }); - } - } - - function graphCircularLayout(ecModel) { - ecModel.eachSeriesByType('graph', function (seriesModel) { - if (seriesModel.get('layout') === 'circular') { - circularLayout(seriesModel, 'symbolSize'); - } - }); - } - - var scaleAndAdd$1 = scaleAndAdd; - // function adjacentNode(n, e) { - // return e.n1 === n ? e.n2 : e.n1; - // } - function forceLayout(inNodes, inEdges, opts) { - var nodes = inNodes; - var edges = inEdges; - var rect = opts.rect; - var width = rect.width; - var height = rect.height; - var center = [rect.x + width / 2, rect.y + height / 2]; - // let scale = opts.scale || 1; - var gravity = opts.gravity == null ? 0.1 : opts.gravity; - // for (let i = 0; i < edges.length; i++) { - // let e = edges[i]; - // let n1 = e.n1; - // let n2 = e.n2; - // n1.edges = n1.edges || []; - // n2.edges = n2.edges || []; - // n1.edges.push(e); - // n2.edges.push(e); - // } - // Init position - for (var i = 0; i < nodes.length; i++) { - var n = nodes[i]; - if (!n.p) { - n.p = create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]); - } - n.pp = clone$1(n.p); - n.edges = null; - } - // Formula in 'Graph Drawing by Force-directed Placement' - // let k = scale * Math.sqrt(width * height / nodes.length); - // let k2 = k * k; - var initialFriction = opts.friction == null ? 0.6 : opts.friction; - var friction = initialFriction; - var beforeStepCallback; - var afterStepCallback; - return { - warmUp: function () { - friction = initialFriction * 0.8; - }, - setFixed: function (idx) { - nodes[idx].fixed = true; - }, - setUnfixed: function (idx) { - nodes[idx].fixed = false; - }, - /** - * Before step hook - */ - beforeStep: function (cb) { - beforeStepCallback = cb; - }, - /** - * After step hook - */ - afterStep: function (cb) { - afterStepCallback = cb; - }, - /** - * Some formulas were originally copied from "d3.js" - * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js - * with some modifications made for this project. - * See the license statement at the head of this file. - */ - step: function (cb) { - beforeStepCallback && beforeStepCallback(nodes, edges); - var v12 = []; - var nLen = nodes.length; - for (var i = 0; i < edges.length; i++) { - var e = edges[i]; - if (e.ignoreForceLayout) { - continue; - } - var n1 = e.n1; - var n2 = e.n2; - sub(v12, n2.p, n1.p); - var d = len(v12) - e.d; - var w = n2.w / (n1.w + n2.w); - if (isNaN(w)) { - w = 0; - } - normalize(v12, v12); - !n1.fixed && scaleAndAdd$1(n1.p, n1.p, v12, w * d * friction); - !n2.fixed && scaleAndAdd$1(n2.p, n2.p, v12, -(1 - w) * d * friction); - } - // Gravity - for (var i = 0; i < nLen; i++) { - var n = nodes[i]; - if (!n.fixed) { - sub(v12, center, n.p); - // let d = vec2.len(v12); - // vec2.scale(v12, v12, 1 / d); - // let gravityFactor = gravity; - scaleAndAdd$1(n.p, n.p, v12, gravity * friction); - } - } - // Repulsive - // PENDING - for (var i = 0; i < nLen; i++) { - var n1 = nodes[i]; - for (var j = i + 1; j < nLen; j++) { - var n2 = nodes[j]; - sub(v12, n2.p, n1.p); - var d = len(v12); - if (d === 0) { - // Random repulse - set(v12, Math.random() - 0.5, Math.random() - 0.5); - d = 1; - } - var repFact = (n1.rep + n2.rep) / d / d; - !n1.fixed && scaleAndAdd$1(n1.pp, n1.pp, v12, repFact); - !n2.fixed && scaleAndAdd$1(n2.pp, n2.pp, v12, -repFact); - } - } - var v = []; - for (var i = 0; i < nLen; i++) { - var n = nodes[i]; - if (!n.fixed) { - sub(v, n.p, n.pp); - scaleAndAdd$1(n.p, n.p, v, friction); - copy(n.pp, n.p); - } - } - friction = friction * 0.992; - var finished = friction < 0.01; - afterStepCallback && afterStepCallback(nodes, edges, finished); - cb && cb(finished); - } - }; - } - - function graphForceLayout(ecModel) { - ecModel.eachSeriesByType('graph', function (graphSeries) { - var coordSys = graphSeries.coordinateSystem; - if (coordSys && coordSys.type !== 'view') { - return; - } - if (graphSeries.get('layout') === 'force') { - var preservedPoints_1 = graphSeries.preservedPoints || {}; - var graph_1 = graphSeries.getGraph(); - var nodeData_1 = graph_1.data; - var edgeData = graph_1.edgeData; - var forceModel = graphSeries.getModel('force'); - var initLayout = forceModel.get('initLayout'); - if (graphSeries.preservedPoints) { - nodeData_1.each(function (idx) { - var id = nodeData_1.getId(idx); - nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]); - }); - } else if (!initLayout || initLayout === 'none') { - simpleLayout(graphSeries); - } else if (initLayout === 'circular') { - circularLayout(graphSeries, 'value'); - } - var nodeDataExtent_1 = nodeData_1.getDataExtent('value'); - var edgeDataExtent_1 = edgeData.getDataExtent('value'); - // let edgeDataExtent = edgeData.getDataExtent('value'); - var repulsion = forceModel.get('repulsion'); - var edgeLength = forceModel.get('edgeLength'); - var repulsionArr_1 = isArray(repulsion) ? repulsion : [repulsion, repulsion]; - var edgeLengthArr_1 = isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength]; - // Larger value has smaller length - edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]]; - var nodes_1 = nodeData_1.mapArray('value', function (value, idx) { - var point = nodeData_1.getItemLayout(idx); - var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1); - if (isNaN(rep)) { - rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2; - } - return { - w: rep, - rep: rep, - fixed: nodeData_1.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_1.getEdgeByIndex(idx); - var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1); - if (isNaN(d)) { - d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2; - } - var edgeModel = edge.getModel(); - var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0); - return { - n1: nodes_1[edge.node1.dataIndex], - n2: nodes_1[edge.node2.dataIndex], - d: d, - curveness: curveness, - ignoreForceLayout: edgeModel.get('ignoreForceLayout') - }; - }); - // let coordSys = graphSeries.coordinateSystem; - var rect = coordSys.getBoundingRect(); - var forceInstance = forceLayout(nodes_1, edges, { - rect: rect, - gravity: forceModel.get('gravity'), - friction: forceModel.get('friction') - }); - forceInstance.beforeStep(function (nodes, edges) { - for (var i = 0, l = nodes.length; i < l; i++) { - if (nodes[i].fixed) { - // Write back to layout instance - copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout()); - } - } - }); - forceInstance.afterStep(function (nodes, edges, stopped) { - for (var i = 0, l = nodes.length; i < l; i++) { - if (!nodes[i].fixed) { - graph_1.getNodeByIndex(i).setLayout(nodes[i].p); - } - preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p; - } - for (var i = 0, l = edges.length; i < l; i++) { - var e = edges[i]; - var edge = graph_1.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] || []; - copy(points[0], p1); - 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); - } - }); - graphSeries.forceLayout = forceInstance; - graphSeries.preservedPoints = preservedPoints_1; - // Step to get the layout - forceInstance.step(); - } else { - // Remove prev injected forceLayout instance - graphSeries.forceLayout = null; - } - }); - } - - function getViewRect$2(seriesModel, api, aspect) { - var option = extend(seriesModel.getBoxLayoutParams(), { - aspect: aspect - }); - return getLayoutRect(option, { - width: api.getWidth(), - height: api.getHeight() - }); - } - function createViewCoordSys(ecModel, api) { - var viewList = []; - ecModel.eachSeriesByType('graph', function (seriesModel) { - var coordSysType = seriesModel.get('coordinateSystem'); - if (!coordSysType || coordSysType === 'view') { - var data_1 = seriesModel.getData(); - var positions = data_1.mapArray(function (idx) { - var itemModel = data_1.getItemModel(idx); - return [+itemModel.get('x'), +itemModel.get('y')]; - }); - var min = []; - var max = []; - fromPoints(positions, min, max); - // If width or height is 0 - if (max[0] - min[0] === 0) { - max[0] += 1; - min[0] -= 1; - } - if (max[1] - min[1] === 0) { - max[1] += 1; - min[1] -= 1; - } - var aspect = (max[0] - min[0]) / (max[1] - min[1]); - // FIXME If get view rect after data processed? - var viewRect = getViewRect$2(seriesModel, api, aspect); - // Position may be NaN, use view rect instead - if (isNaN(aspect)) { - min = [viewRect.x, viewRect.y]; - max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height]; - } - var bbWidth = max[0] - min[0]; - var bbHeight = max[1] - min[1]; - var viewWidth = viewRect.width; - var viewHeight = viewRect.height; - var viewCoordSys = seriesModel.coordinateSystem = new View(); - viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); - viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight); - viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight); - // Update roam info - viewCoordSys.setCenter(seriesModel.get('center'), api); - viewCoordSys.setZoom(seriesModel.get('zoom')); - viewList.push(viewCoordSys); - } - }); - return viewList; - } - - var straightLineProto = Line.prototype; - var bezierCurveProto = BezierCurve.prototype; - var StraightLineShape = /** @class */function () { - function StraightLineShape() { - // Start point - this.x1 = 0; - this.y1 = 0; - // End point - this.x2 = 0; - this.y2 = 0; - this.percent = 1; - } - return StraightLineShape; - }(); - var CurveShape = /** @class */function (_super) { - __extends(CurveShape, _super); - function CurveShape() { - return _super !== null && _super.apply(this, arguments) || this; - } - return CurveShape; - }(StraightLineShape); - function isStraightLine(shape) { - return isNaN(+shape.cpx1) || isNaN(+shape.cpy1); - } - var ECLinePath = /** @class */function (_super) { - __extends(ECLinePath, _super); - function ECLinePath(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'ec-line'; - return _this; - } - ECLinePath.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - ECLinePath.prototype.getDefaultShape = function () { - return new StraightLineShape(); - }; - ECLinePath.prototype.buildPath = function (ctx, shape) { - if (isStraightLine(shape)) { - straightLineProto.buildPath.call(this, ctx, shape); - } else { - bezierCurveProto.buildPath.call(this, ctx, shape); - } - }; - ECLinePath.prototype.pointAt = function (t) { - if (isStraightLine(this.shape)) { - return straightLineProto.pointAt.call(this, t); - } else { - return bezierCurveProto.pointAt.call(this, t); - } - }; - ECLinePath.prototype.tangentAt = function (t) { - var shape = this.shape; - var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t); - return normalize(p, p); - }; - return ECLinePath; - }(Path); - - var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol']; - function makeSymbolTypeKey(symbolCategory) { - return '_' + symbolCategory + 'Type'; - } - function makeSymbolTypeValue(name, lineData, idx) { - var symbolType = lineData.getItemVisual(idx, name); - if (!symbolType || symbolType === 'none') { - return symbolType; - } - var symbolSize = lineData.getItemVisual(idx, name + 'Size'); - var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate'); - var symbolOffset = lineData.getItemVisual(idx, name + 'Offset'); - var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect'); - var symbolSizeArr = normalizeSymbolSize(symbolSize); - var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); - return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || '') + (symbolKeepAspect || ''); - } - /** - * @inner - */ - function createSymbol$1(name, lineData, idx) { - var symbolType = lineData.getItemVisual(idx, name); - if (!symbolType || symbolType === 'none') { - return; - } - var symbolSize = lineData.getItemVisual(idx, name + 'Size'); - var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate'); - var symbolOffset = lineData.getItemVisual(idx, name + 'Offset'); - var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect'); - var symbolSizeArr = normalizeSymbolSize(symbolSize); - var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); - var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect); - symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0; - symbolPath.name = name; - return symbolPath; - } - function createLine(points) { - var line = new ECLinePath({ - name: 'line', - subPixelOptimize: true - }); - setLinePoints(line.shape, points); - return line; - } - function setLinePoints(targetShape, points) { - targetShape.x1 = points[0][0]; - targetShape.y1 = points[0][1]; - targetShape.x2 = points[1][0]; - targetShape.y2 = points[1][1]; - targetShape.percent = 1; - var cp1 = points[2]; - if (cp1) { - targetShape.cpx1 = cp1[0]; - targetShape.cpy1 = cp1[1]; - } else { - targetShape.cpx1 = NaN; - targetShape.cpy1 = NaN; - } - } - var Line$1 = /** @class */function (_super) { - __extends(Line, _super); - function Line(lineData, idx, seriesScope) { - var _this = _super.call(this) || this; - _this._createLine(lineData, idx, seriesScope); - return _this; - } - Line.prototype._createLine = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var linePoints = lineData.getItemLayout(idx); - var line = createLine(linePoints); - line.shape.percent = 0; - initProps(line, { - shape: { - percent: 1 - } - }, seriesModel, idx); - this.add(line); - each(SYMBOL_CATEGORIES, function (symbolCategory) { - var symbol = createSymbol$1(symbolCategory, lineData, idx); - // symbols must added after line to make sure - // it will be updated after line#update. - // Or symbol position and rotation update in line#beforeUpdate will be one frame slow - this.add(symbol); - this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx); - }, this); - this._updateCommonStl(lineData, idx, seriesScope); - }; - // TODO More strict on the List type in parameters? - Line.prototype.updateData = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childOfName('line'); - var linePoints = lineData.getItemLayout(idx); - var target = { - shape: {} - }; - setLinePoints(target.shape, linePoints); - updateProps(line, target, seriesModel, idx); - each(SYMBOL_CATEGORIES, function (symbolCategory) { - var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx); - var key = makeSymbolTypeKey(symbolCategory); - // Symbol changed - if (this[key] !== symbolType) { - this.remove(this.childOfName(symbolCategory)); - var symbol = createSymbol$1(symbolCategory, lineData, idx); - this.add(symbol); - } - this[key] = symbolType; - }, this); - this._updateCommonStl(lineData, idx, seriesScope); - }; - Line.prototype.getLinePath = function () { - return this.childAt(0); - }; - Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childOfName('line'); - var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; - var blurLineStyle = seriesScope && seriesScope.blurLineStyle; - var selectLineStyle = seriesScope && seriesScope.selectLineStyle; - var labelStatesModels = seriesScope && seriesScope.labelStatesModels; - var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; - var focus = seriesScope && seriesScope.focus; - var blurScope = seriesScope && seriesScope.blurScope; - // Optimization for large dataset - if (!seriesScope || lineData.hasItemOption) { - var itemModel = lineData.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle(); - blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle(); - selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle(); - emphasisDisabled = emphasisModel.get('disabled'); - focus = emphasisModel.get('focus'); - blurScope = emphasisModel.get('blurScope'); - labelStatesModels = getLabelStatesModels(itemModel); - } - var lineStyle = lineData.getItemVisual(idx, 'style'); - var visualColor = lineStyle.stroke; - line.useStyle(lineStyle); - line.style.fill = null; - line.style.strokeNoScale = true; - line.ensureState('emphasis').style = emphasisLineStyle; - line.ensureState('blur').style = blurLineStyle; - line.ensureState('select').style = selectLineStyle; - // Update symbol - each(SYMBOL_CATEGORIES, function (symbolCategory) { - var symbol = this.childOfName(symbolCategory); - if (symbol) { - // Share opacity and color with line. - symbol.setColor(visualColor); - symbol.style.opacity = lineStyle.opacity; - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var lineState = line.getState(stateName); - if (lineState) { - var lineStateStyle = lineState.style || {}; - var state = symbol.ensureState(stateName); - var stateStyle = state.style || (state.style = {}); - if (lineStateStyle.stroke != null) { - stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke; - } - if (lineStateStyle.opacity != null) { - stateStyle.opacity = lineStateStyle.opacity; - } - } - } - symbol.markRedraw(); - } - }, this); - var rawVal = seriesModel.getRawValue(idx); - setLabelStyle(this, labelStatesModels, { - labelDataIndex: idx, - labelFetcher: { - getFormattedLabel: function (dataIndex, stateName) { - return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType); - } - }, - inheritColor: visualColor || '#000', - defaultOpacity: lineStyle.opacity, - defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + '' - }); - var label = this.getTextContent(); - // Always set `textStyle` even if `normalStyle.text` is null, because default - // values have to be set on `normalStyle`. - if (label) { - var labelNormalModel = labelStatesModels.normal; - label.__align = label.style.align; - label.__verticalAlign = label.style.verticalAlign; - // 'start', 'middle', 'end' - label.__position = labelNormalModel.get('position') || 'middle'; - var distance = labelNormalModel.get('distance'); - if (!isArray(distance)) { - distance = [distance, distance]; - } - label.__labelDistance = distance; - } - this.setTextConfig({ - position: null, - local: true, - inside: false // Can't be inside for stroke element. - }); - - toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); - }; - Line.prototype.highlight = function () { - enterEmphasis(this); - }; - Line.prototype.downplay = function () { - leaveEmphasis(this); - }; - Line.prototype.updateLayout = function (lineData, idx) { - this.setLinePoints(lineData.getItemLayout(idx)); - }; - Line.prototype.setLinePoints = function (points) { - var linePath = this.childOfName('line'); - setLinePoints(linePath.shape, points); - linePath.dirty(); - }; - Line.prototype.beforeUpdate = function () { - var lineGroup = this; - var symbolFrom = lineGroup.childOfName('fromSymbol'); - var symbolTo = lineGroup.childOfName('toSymbol'); - var label = lineGroup.getTextContent(); - // Quick reject - if (!symbolFrom && !symbolTo && (!label || label.ignore)) { - return; - } - var invScale = 1; - var parentNode = this.parent; - while (parentNode) { - if (parentNode.scaleX) { - invScale /= parentNode.scaleX; - } - parentNode = parentNode.parent; - } - var line = lineGroup.childOfName('line'); - // If line not changed - // FIXME Parent scale changed - if (!this.__dirty && !line.__dirty) { - return; - } - var percent = line.shape.percent; - var fromPos = line.pointAt(0); - var toPos = line.pointAt(percent); - var d = sub([], toPos, fromPos); - normalize(d, d); - function setSymbolRotation(symbol, percent) { - // Fix #12388 - // when symbol is set to be 'arrow' in markLine, - // symbolRotate value will be ignored, and compulsively use tangent angle. - // rotate by default if symbol rotation is not specified - var specifiedRotation = symbol.__specifiedRotation; - if (specifiedRotation == null) { - var tangent = line.tangentAt(percent); - symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0])); - } else { - symbol.attr('rotation', specifiedRotation); - } - } - if (symbolFrom) { - symbolFrom.setPosition(fromPos); - setSymbolRotation(symbolFrom, 0); - symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent; - symbolFrom.markRedraw(); - } - if (symbolTo) { - symbolTo.setPosition(toPos); - setSymbolRotation(symbolTo, 1); - symbolTo.scaleX = symbolTo.scaleY = invScale * percent; - symbolTo.markRedraw(); - } - if (label && !label.ignore) { - label.x = label.y = 0; - label.originX = label.originY = 0; - var textAlign = void 0; - var textVerticalAlign = void 0; - var distance = label.__labelDistance; - var distanceX = distance[0] * invScale; - var distanceY = distance[1] * invScale; - var halfPercent = percent / 2; - var tangent = line.tangentAt(halfPercent); - var n = [tangent[1], -tangent[0]]; - var cp = line.pointAt(halfPercent); - if (n[1] > 0) { - n[0] = -n[0]; - n[1] = -n[1]; - } - var dir = tangent[0] < 0 ? -1 : 1; - if (label.__position !== 'start' && label.__position !== 'end') { - var rotation = -Math.atan2(tangent[1], tangent[0]); - if (toPos[0] < fromPos[0]) { - rotation = Math.PI + rotation; - } - label.rotation = rotation; - } - var dy = void 0; - switch (label.__position) { - case 'insideStartTop': - case 'insideMiddleTop': - case 'insideEndTop': - case 'middle': - dy = -distanceY; - textVerticalAlign = 'bottom'; - break; - case 'insideStartBottom': - case 'insideMiddleBottom': - case 'insideEndBottom': - dy = distanceY; - textVerticalAlign = 'top'; - break; - default: - dy = 0; - textVerticalAlign = 'middle'; - } - switch (label.__position) { - case 'end': - label.x = d[0] * distanceX + toPos[0]; - label.y = d[1] * distanceY + toPos[1]; - textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center'; - textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle'; - break; - case 'start': - label.x = -d[0] * distanceX + fromPos[0]; - label.y = -d[1] * distanceY + fromPos[1]; - textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center'; - textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle'; - break; - case 'insideStartTop': - case 'insideStart': - case 'insideStartBottom': - label.x = distanceX * dir + fromPos[0]; - label.y = fromPos[1] + dy; - textAlign = tangent[0] < 0 ? 'right' : 'left'; - label.originX = -distanceX * dir; - label.originY = -dy; - break; - case 'insideMiddleTop': - case 'insideMiddle': - case 'insideMiddleBottom': - case 'middle': - label.x = cp[0]; - label.y = cp[1] + dy; - textAlign = 'center'; - label.originY = -dy; - break; - case 'insideEndTop': - case 'insideEnd': - case 'insideEndBottom': - label.x = -distanceX * dir + toPos[0]; - label.y = toPos[1] + dy; - textAlign = tangent[0] >= 0 ? 'right' : 'left'; - label.originX = distanceX * dir; - label.originY = -dy; - break; - } - label.scaleX = label.scaleY = invScale; - label.setStyle({ - // Use the user specified text align and baseline first - verticalAlign: label.__verticalAlign || textVerticalAlign, - align: label.__align || textAlign - }); - } - }; - return Line; - }(Group); - - var LineDraw = /** @class */function () { - function LineDraw(LineCtor) { - this.group = new Group(); - this._LineCtor = LineCtor || Line$1; - } - LineDraw.prototype.updateData = function (lineData) { - var _this = this; - // Remove progressive els. - this._progressiveEls = null; - var lineDraw = this; - var group = lineDraw.group; - var oldLineData = lineDraw._lineData; - lineDraw._lineData = lineData; - // There is no oldLineData only when first rendering or switching from - // stream mode to normal mode, where previous elements should be removed. - if (!oldLineData) { - group.removeAll(); - } - var seriesScope = makeSeriesScope$1(lineData); - lineData.diff(oldLineData).add(function (idx) { - _this._doAdd(lineData, idx, seriesScope); - }).update(function (newIdx, oldIdx) { - _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope); - }).remove(function (idx) { - group.remove(oldLineData.getItemGraphicEl(idx)); - }).execute(); - }; - LineDraw.prototype.updateLayout = function () { - var lineData = this._lineData; - // Do not support update layout in incremental mode. - if (!lineData) { - return; - } - lineData.eachItemGraphicEl(function (el, idx) { - el.updateLayout(lineData, idx); - }, this); - }; - LineDraw.prototype.incrementalPrepareUpdate = function (lineData) { - this._seriesScope = makeSeriesScope$1(lineData); - this._lineData = null; - this.group.removeAll(); - }; - LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) { - this._progressiveEls = []; - function updateIncrementalAndHover(el) { - if (!el.isGroup && !isEffectObject(el)) { - el.incremental = true; - el.ensureState('emphasis').hoverLayer = true; - } - } - for (var idx = taskParams.start; idx < taskParams.end; idx++) { - var itemLayout = lineData.getItemLayout(idx); - if (lineNeedsDraw(itemLayout)) { - var el = new this._LineCtor(lineData, idx, this._seriesScope); - el.traverse(updateIncrementalAndHover); - this.group.add(el); - lineData.setItemGraphicEl(idx, el); - this._progressiveEls.push(el); - } - } - }; - LineDraw.prototype.remove = function () { - this.group.removeAll(); - }; - LineDraw.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; - LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) { - var itemLayout = lineData.getItemLayout(idx); - if (!lineNeedsDraw(itemLayout)) { - return; - } - var el = new this._LineCtor(lineData, idx, seriesScope); - lineData.setItemGraphicEl(idx, el); - this.group.add(el); - }; - LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) { - var itemEl = oldLineData.getItemGraphicEl(oldIdx); - if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) { - this.group.remove(itemEl); - return; - } - if (!itemEl) { - itemEl = new this._LineCtor(newLineData, newIdx, seriesScope); - } else { - itemEl.updateData(newLineData, newIdx, seriesScope); - } - newLineData.setItemGraphicEl(newIdx, itemEl); - this.group.add(itemEl); - }; - return LineDraw; - }(); - function isEffectObject(el) { - return el.animators && el.animators.length > 0; - } - function makeSeriesScope$1(lineData) { - var hostModel = lineData.hostModel; - var emphasisModel = hostModel.getModel('emphasis'); - return { - lineStyle: hostModel.getModel('lineStyle').getLineStyle(), - emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(), - blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(), - selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(), - emphasisDisabled: emphasisModel.get('disabled'), - blurScope: emphasisModel.get('blurScope'), - focus: emphasisModel.get('focus'), - labelStatesModels: getLabelStatesModels(hostModel) - }; - } - function isPointNaN(pt) { - return isNaN(pt[0]) || isNaN(pt[1]); - } - function lineNeedsDraw(pts) { - return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]); - } - - var v1 = []; - var v2 = []; - var v3 = []; - var quadraticAt$1 = quadraticAt; - var v2DistSquare = distSquare; - var mathAbs$2 = Math.abs; - function intersectCurveCircle(curvePoints, center, radius) { - var p0 = curvePoints[0]; - var p1 = curvePoints[1]; - var p2 = curvePoints[2]; - var d = Infinity; - var t; - var radiusSquare = radius * radius; - var interval = 0.1; - for (var _t = 0.1; _t <= 0.9; _t += 0.1) { - v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t); - v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t); - var diff = mathAbs$2(v2DistSquare(v1, center) - radiusSquare); - if (diff < d) { - d = diff; - t = _t; - } - } - // Assume the segment is monotone,Find root through Bisection method - // At most 32 iteration - for (var i = 0; i < 32; i++) { - // let prev = t - interval; - var next = t + interval; - // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev); - // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev); - v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t); - v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t); - v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next); - v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next); - var diff = v2DistSquare(v2, center) - radiusSquare; - if (mathAbs$2(diff) < 1e-2) { - break; - } - // let prevDiff = v2DistSquare(v1, center) - radiusSquare; - var nextDiff = v2DistSquare(v3, center) - radiusSquare; - interval /= 2; - if (diff < 0) { - if (nextDiff >= 0) { - t = t + interval; - } else { - t = t - interval; - } - } else { - if (nextDiff >= 0) { - t = t - interval; - } else { - t = t + interval; - } - } - } - return t; - } - // Adjust edge to avoid - function adjustEdge(graph, scale) { - var tmp0 = []; - var quadraticSubdivide$1 = quadraticSubdivide; - var pts = [[], [], []]; - var pts2 = [[], []]; - var v = []; - scale /= 2; - graph.eachEdge(function (edge, idx) { - var linePoints = edge.getLayout(); - var fromSymbol = edge.getVisual('fromSymbol'); - var toSymbol = edge.getVisual('toSymbol'); - if (!linePoints.__original) { - linePoints.__original = [clone$1(linePoints[0]), clone$1(linePoints[1])]; - if (linePoints[2]) { - linePoints.__original.push(clone$1(linePoints[2])); - } - } - var originalPoints = linePoints.__original; - // Quadratic curve - if (linePoints[2] != null) { - copy(pts[0], originalPoints[0]); - copy(pts[1], originalPoints[2]); - copy(pts[2], originalPoints[1]); - if (fromSymbol && fromSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node1); - var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); - // Subdivide and get the second - quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); - pts[0][0] = tmp0[3]; - pts[1][0] = tmp0[4]; - quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); - pts[0][1] = tmp0[3]; - pts[1][1] = tmp0[4]; - } - if (toSymbol && toSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node2); - var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); - // Subdivide and get the first - quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); - pts[1][0] = tmp0[1]; - pts[2][0] = tmp0[2]; - quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); - pts[1][1] = tmp0[1]; - pts[2][1] = tmp0[2]; - } - // Copy back to layout - copy(linePoints[0], pts[0]); - copy(linePoints[1], pts[2]); - copy(linePoints[2], pts[1]); - } - // Line - else { - copy(pts2[0], originalPoints[0]); - copy(pts2[1], originalPoints[1]); - sub(v, pts2[1], pts2[0]); - normalize(v, v); - if (fromSymbol && fromSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node1); - scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale); - } - if (toSymbol && toSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node2); - scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale); - } - copy(linePoints[0], pts2[0]); - copy(linePoints[1], pts2[1]); - } - }); - } - - function isViewCoordSys(coordSys) { - return coordSys.type === 'view'; - } - var GraphView = /** @class */function (_super) { - __extends(GraphView, _super); - function GraphView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GraphView.type; - return _this; - } - GraphView.prototype.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; - }; - GraphView.prototype.render = function (seriesModel, ecModel, api) { - var _this = this; - var coordSys = seriesModel.coordinateSystem; - this._model = seriesModel; - var symbolDraw = this._symbolDraw; - var lineDraw = this._lineDraw; - var group = this.group; - if (isViewCoordSys(coordSys)) { - var groupNewProp = { - x: coordSys.x, - y: coordSys.y, - scaleX: coordSys.scaleX, - scaleY: coordSys.scaleY - }; - if (this._firstRender) { - group.attr(groupNewProp); - } else { - 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(); - // TODO: TYPE - 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); - } - var layout = seriesModel.get('layout'); - data.graph.eachNode(function (node) { - var idx = node.dataIndex; - var el = node.getGraphicEl(); - var itemModel = node.getModel(); - if (!el) { - return; - } - // Update draggable - el.off('drag').off('dragend'); - var draggable = itemModel.get('draggable'); - if (draggable) { - el.on('drag', function (e) { - switch (layout) { - case 'force': - forceLayout.warmUp(); - !_this._layouting && _this._startForceLayoutIteration(forceLayout, layoutAnimation); - forceLayout.setFixed(idx); - // Write position back to layout - data.setItemLayout(idx, [el.x, el.y]); - break; - case 'circular': - data.setItemLayout(idx, [el.x, el.y]); - // mark node fixed - node.setLayout({ - fixed: true - }, true); - // recalculate circular layout - circularLayout(seriesModel, 'symbolSize', node, [e.offsetX, e.offsetY]); - _this.updateLayout(seriesModel); - break; - case 'none': - default: - data.setItemLayout(idx, [el.x, el.y]); - // update edge - simpleLayoutEdge(seriesModel.getGraph(), seriesModel); - _this.updateLayout(seriesModel); - break; - } - }).on('dragend', function () { - if (forceLayout) { - forceLayout.setUnfixed(idx); - } - }); - } - el.setDraggable(draggable, !!itemModel.get('cursor')); - var focus = itemModel.get(['emphasis', 'focus']); - if (focus === 'adjacency') { - getECData(el).focus = node.getAdjacentDataIndices(); - } - }); - data.graph.eachEdge(function (edge) { - var el = edge.getGraphicEl(); - var focus = edge.getModel().get(['emphasis', 'focus']); - if (!el) { - return; - } - if (focus === 'adjacency') { - getECData(el).focus = { - edge: [edge.dataIndex], - node: [edge.node1.dataIndex, edge.node2.dataIndex] - }; - } - }); - var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']); - var cx = data.getLayout('cx'); - var cy = data.getLayout('cy'); - data.graph.eachNode(function (node) { - rotateNodeLabel(node, circularRotateLabel, cx, cy); - }); - this._firstRender = false; - }; - GraphView.prototype.dispose = function () { - this.remove(); - this._controller && this._controller.dispose(); - this._controllerHost = null; - }; - GraphView.prototype._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()); - }); - })(); - }; - GraphView.prototype._updateController = function (seriesModel, ecModel, api) { - var _this = this; - 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 (!isViewCoordSys(seriesModel.coordinateSystem)) { - 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) { - updateViewOnPan(controllerHost, e.dx, e.dy); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'graphRoam', - dx: e.dx, - dy: e.dy - }); - }).on('zoom', function (e) { - 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(); - // Only update label layout on zoom - api.updateLabelLayout(); - }); - }; - GraphView.prototype._updateNodeAndLinkScale = function () { - var seriesModel = this._model; - var data = seriesModel.getData(); - var nodeScale = getNodeGlobalScale(seriesModel); - data.eachItemGraphicEl(function (el, idx) { - el && el.setSymbolScale(nodeScale); - }); - }; - GraphView.prototype.updateLayout = function (seriesModel) { - adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); - this._symbolDraw.updateLayout(); - this._lineDraw.updateLayout(); - }; - GraphView.prototype.remove = function () { - clearTimeout(this._layoutTimeout); - this._layouting = false; - this._layoutTimeout = null; - this._symbolDraw && this._symbolDraw.remove(); - this._lineDraw && this._lineDraw.remove(); - }; - GraphView.type = 'graph'; - return GraphView; - }(ChartView); - - // id may be function name of Object, add a prefix to avoid this problem. - function generateNodeKey(id) { - return '_EC_' + id; - } - var Graph = /** @class */function () { - function Graph(directed) { - this.type = 'graph'; - this.nodes = []; - this.edges = []; - this._nodesMap = {}; - /** - * @type {Object.} - * @private - */ - this._edgesMap = {}; - this._directed = directed || false; - } - /** - * If is directed graph - */ - Graph.prototype.isDirected = function () { - return this._directed; - }; - /** - * Add a new node - */ - Graph.prototype.addNode = function (id, dataIndex) { - id = id == null ? '' + dataIndex : '' + id; - var nodesMap = this._nodesMap; - if (nodesMap[generateNodeKey(id)]) { - if ("development" !== 'production') { - console.error('Graph nodes have duplicate name or id'); - } - return; - } - var node = new GraphNode(id, dataIndex); - node.hostGraph = this; - this.nodes.push(node); - nodesMap[generateNodeKey(id)] = node; - return node; - }; - /** - * Get node by data index - */ - Graph.prototype.getNodeByIndex = function (dataIndex) { - var rawIdx = this.data.getRawIndex(dataIndex); - return this.nodes[rawIdx]; - }; - /** - * Get node by id - */ - Graph.prototype.getNodeById = function (id) { - return this._nodesMap[generateNodeKey(id)]; - }; - /** - * Add a new edge - */ - Graph.prototype.addEdge = function (n1, n2, dataIndex) { - var nodesMap = this._nodesMap; - var edgesMap = this._edgesMap; - // PENDING - if (isNumber(n1)) { - n1 = this.nodes[n1]; - } - if (isNumber(n2)) { - n2 = this.nodes[n2]; - } - if (!(n1 instanceof GraphNode)) { - n1 = nodesMap[generateNodeKey(n1)]; - } - if (!(n2 instanceof GraphNode)) { - n2 = nodesMap[generateNodeKey(n2)]; - } - if (!n1 || !n2) { - return; - } - var key = n1.id + '-' + n2.id; - var edge = new GraphEdge(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 - */ - Graph.prototype.getEdgeByIndex = function (dataIndex) { - var rawIdx = this.edgeData.getRawIndex(dataIndex); - return this.edges[rawIdx]; - }; - /** - * Get edge by two linked nodes - */ - Graph.prototype.getEdge = function (n1, n2) { - if (n1 instanceof GraphNode) { - n1 = n1.id; - } - if (n2 instanceof GraphNode) { - 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 - */ - Graph.prototype.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 - */ - Graph.prototype.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 - * Return true to stop traversing - */ - Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) { - if (!(startNode instanceof GraphNode)) { - 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 - // depthFirstTraverse( - // cb, startNode, direction, context - // ) { - // }; - // Filter update - Graph.prototype.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} - */ - Graph.prototype.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; - }; - return Graph; - }(); - var GraphNode = /** @class */function () { - function GraphNode(id, dataIndex) { - this.inEdges = []; - this.outEdges = []; - this.edges = []; - this.dataIndex = -1; - this.id = id == null ? '' : id; - this.dataIndex = dataIndex == null ? -1 : dataIndex; - } - /** - * @return {number} - */ - GraphNode.prototype.degree = function () { - return this.edges.length; - }; - /** - * @return {number} - */ - GraphNode.prototype.inDegree = function () { - return this.inEdges.length; - }; - /** - * @return {number} - */ - GraphNode.prototype.outDegree = function () { - return this.outEdges.length; - }; - GraphNode.prototype.getModel = function (path) { - if (this.dataIndex < 0) { - return; - } - var graph = this.hostGraph; - var itemModel = graph.data.getItemModel(this.dataIndex); - return itemModel.getModel(path); - }; - GraphNode.prototype.getAdjacentDataIndices = function () { - var dataIndices = { - edge: [], - node: [] - }; - for (var i = 0; i < this.edges.length; i++) { - var adjacentEdge = this.edges[i]; - if (adjacentEdge.dataIndex < 0) { - continue; - } - dataIndices.edge.push(adjacentEdge.dataIndex); - dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex); - } - return dataIndices; - }; - GraphNode.prototype.getTrajectoryDataIndices = function () { - var connectedEdgesMap = createHashMap(); - var connectedNodesMap = createHashMap(); - for (var i = 0; i < this.edges.length; i++) { - var adjacentEdge = this.edges[i]; - if (adjacentEdge.dataIndex < 0) { - continue; - } - connectedEdgesMap.set(adjacentEdge.dataIndex, true); - var sourceNodesQueue = [adjacentEdge.node1]; - var targetNodesQueue = [adjacentEdge.node2]; - var nodeIteratorIndex = 0; - while (nodeIteratorIndex < sourceNodesQueue.length) { - var sourceNode = sourceNodesQueue[nodeIteratorIndex]; - nodeIteratorIndex++; - connectedNodesMap.set(sourceNode.dataIndex, true); - for (var j = 0; j < sourceNode.inEdges.length; j++) { - connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true); - sourceNodesQueue.push(sourceNode.inEdges[j].node1); - } - } - nodeIteratorIndex = 0; - while (nodeIteratorIndex < targetNodesQueue.length) { - var targetNode = targetNodesQueue[nodeIteratorIndex]; - nodeIteratorIndex++; - connectedNodesMap.set(targetNode.dataIndex, true); - for (var j = 0; j < targetNode.outEdges.length; j++) { - connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true); - targetNodesQueue.push(targetNode.outEdges[j].node2); - } - } - } - return { - edge: connectedEdgesMap.keys(), - node: connectedNodesMap.keys() - }; - }; - return GraphNode; - }(); - var GraphEdge = /** @class */function () { - function GraphEdge(n1, n2, dataIndex) { - this.dataIndex = -1; - this.node1 = n1; - this.node2 = n2; - this.dataIndex = dataIndex == null ? -1 : dataIndex; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - GraphEdge.prototype.getModel = function (path) { - if (this.dataIndex < 0) { - return; - } - var graph = this.hostGraph; - var itemModel = graph.edgeData.getItemModel(this.dataIndex); - return itemModel.getModel(path); - }; - GraphEdge.prototype.getAdjacentDataIndices = function () { - return { - edge: [this.dataIndex], - node: [this.node1.dataIndex, this.node2.dataIndex] - }; - }; - GraphEdge.prototype.getTrajectoryDataIndices = function () { - var connectedEdgesMap = createHashMap(); - var connectedNodesMap = createHashMap(); - connectedEdgesMap.set(this.dataIndex, true); - var sourceNodes = [this.node1]; - var targetNodes = [this.node2]; - var nodeIteratorIndex = 0; - while (nodeIteratorIndex < sourceNodes.length) { - var sourceNode = sourceNodes[nodeIteratorIndex]; - nodeIteratorIndex++; - connectedNodesMap.set(sourceNode.dataIndex, true); - for (var j = 0; j < sourceNode.inEdges.length; j++) { - connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true); - sourceNodes.push(sourceNode.inEdges[j].node1); - } - } - nodeIteratorIndex = 0; - while (nodeIteratorIndex < targetNodes.length) { - var targetNode = targetNodes[nodeIteratorIndex]; - nodeIteratorIndex++; - connectedNodesMap.set(targetNode.dataIndex, true); - for (var j = 0; j < targetNode.outEdges.length; j++) { - connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true); - targetNodes.push(targetNode.outEdges[j].node2); - } - } - return { - edge: connectedEdgesMap.keys(), - node: connectedNodesMap.keys() - }; - }; - return GraphEdge; - }(); - function createGraphDataProxyMixin(hostName, dataName) { - return { - /** - * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'. - */ - getValue: function (dimension) { - var data = this[hostName][dataName]; - return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex); - }, - // TODO: TYPE stricter type. - setVisual: function (key, value) { - this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value); - }, - getVisual: function (key) { - return this[hostName][dataName].getItemVisual(this.dataIndex, key); - }, - setLayout: function (layout, merge) { - this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge); - }, - getLayout: function () { - return this[hostName][dataName].getItemLayout(this.dataIndex); - }, - getGraphicEl: function () { - return this[hostName][dataName].getItemGraphicEl(this.dataIndex); - }, - getRawIndex: function () { - return this[hostName][dataName].getRawIndex(this.dataIndex); - } - }; - } - mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data')); - mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData')); - - function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) { - // ??? TODO - // support dataset? - var graph = new Graph(directed); - for (var i = 0; i < nodes.length; i++) { - graph.addNode(retrieve( - // Id, name, dataIndex - nodes[i].id, nodes[i].name, i), i); - } - var linkNameList = []; - var validEdges = []; - var linkCount = 0; - for (var i = 0; i < edges.length; i++) { - var link = edges[i]; - var source = link.source; - var target = link.target; - // addEdge may fail when source or target not exists - if (graph.addEdge(source, target, linkCount)) { - validEdges.push(link); - linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + ' > ' + target)); - linkCount++; - } - } - var coordSys = seriesModel.get('coordinateSystem'); - var nodeData; - if (coordSys === 'cartesian2d' || coordSys === 'polar') { - nodeData = createSeriesData(nodes, seriesModel); - } else { - var coordSysCtor = CoordinateSystemManager.get(coordSys); - var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : []; - // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs - // `value` dimension, but graph need `value` dimension. It's better to - // uniform this behavior. - if (indexOf(coordDimensions, 'value') < 0) { - coordDimensions.concat(['value']); - } - var dimensions = prepareSeriesDataSchema(nodes, { - coordDimensions: coordDimensions, - encodeDefine: seriesModel.getEncode() - }).dimensions; - nodeData = new SeriesData(dimensions, seriesModel); - nodeData.initData(nodes); - } - var edgeData = new SeriesData(['value'], seriesModel); - edgeData.initData(validEdges, linkNameList); - beforeLink && beforeLink(nodeData, edgeData); - linkSeriesData({ - mainData: nodeData, - struct: graph, - structAttr: 'graph', - datas: { - node: nodeData, - edge: edgeData - }, - datasAttr: { - node: 'data', - edge: 'edgeData' - } - }); - // Update dataIndex of nodes and edges because invalid edge may be removed - graph.update(); - return graph; - } - - var GraphSeriesModel = /** @class */function (_super) { - __extends(GraphSeriesModel, _super); - function GraphSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GraphSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } - GraphSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); - var self = this; - function getCategoriesData() { - return self._categoriesData; - } - // Provide data for legend select - this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData); - this.fillDataTextStyle(option.edges || option.links); - this._updateCategoriesData(); - }; - GraphSeriesModel.prototype.mergeOption = function (option) { - _super.prototype.mergeOption.apply(this, arguments); - this.fillDataTextStyle(option.edges || option.links); - this._updateCategoriesData(); - }; - GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) { - _super.prototype.mergeDefaultAndTheme.apply(this, arguments); - defaultEmphasis(option, 'edgeLabel', ['show']); - }; - GraphSeriesModel.prototype.getInitialData = function (option, ecModel) { - var edges = option.edges || option.links || []; - var nodes = option.data || option.nodes || []; - var self = this; - if (nodes && edges) { - // auto curveness - initCurvenessList(this); - var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink); - each(graph.edges, function (edge) { - createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex); - }, this); - return graph.data; - } - function beforeLink(nodeData, edgeData) { - // Overwrite nodeData.getItemModel to - nodeData.wrapMethod('getItemModel', function (model) { - var categoriesModels = self._categoriesModels; - var categoryIdx = model.getShallow('category'); - var categoryModel = categoriesModels[categoryIdx]; - if (categoryModel) { - categoryModel.parentModel = model.parentModel; - model.parentModel = categoryModel; - } - return model; - }); - // TODO Inherit resolveParentPath by default in Model#getModel? - var oldGetModel = Model.prototype.getModel; - function newGetModel(path, parentModel) { - var model = oldGetModel.call(this, path, parentModel); - model.resolveParentPath = resolveParentPath; - return model; - } - edgeData.wrapMethod('getItemModel', function (model) { - model.resolveParentPath = resolveParentPath; - model.getModel = newGetModel; - return model; - }); - function resolveParentPath(pathArr) { - if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) { - var newPathArr = pathArr.slice(); - if (pathArr[0] === 'label') { - newPathArr[0] = 'edgeLabel'; - } else if (pathArr[1] === 'label') { - newPathArr[1] = 'edgeLabel'; - } - return newPathArr; - } - return pathArr; - } - } - }; - GraphSeriesModel.prototype.getGraph = function () { - return this.getData().graph; - }; - GraphSeriesModel.prototype.getEdgeData = function () { - return this.getGraph().edgeData; - }; - GraphSeriesModel.prototype.getCategoriesData = function () { - return this._categoriesData; - }; - GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - if (dataType === 'edge') { - var nodeData = this.getData(); - var params = this.getDataParams(dataIndex, dataType); - var edge = nodeData.graph.getEdgeByIndex(dataIndex); - var sourceName = nodeData.getName(edge.node1.dataIndex); - var targetName = nodeData.getName(edge.node2.dataIndex); - var nameArr = []; - sourceName != null && nameArr.push(sourceName); - targetName != null && nameArr.push(targetName); - return createTooltipMarkup('nameValue', { - name: nameArr.join(' > '), - value: params.value, - noValue: params.value == null - }); - } - // dataType === 'node' or empty - var nodeMarkup = defaultSeriesFormatTooltip({ - series: this, - dataIndex: dataIndex, - multipleSeries: multipleSeries - }); - return nodeMarkup; - }; - GraphSeriesModel.prototype._updateCategoriesData = function () { - var categories = map(this.option.categories || [], function (category) { - // Data must has value - return category.value != null ? category : extend({ - value: 0 - }, category); - }); - var categoriesData = new SeriesData(['value'], this); - categoriesData.initData(categories); - this._categoriesData = categoriesData; - this._categoriesModels = categoriesData.mapArray(function (idx) { - return categoriesData.getItemModel(idx); - }); - }; - GraphSeriesModel.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; - GraphSeriesModel.prototype.setCenter = function (center) { - this.option.center = center; - }; - GraphSeriesModel.prototype.isAnimationEnabled = function () { - return _super.prototype.isAnimationEnabled.call(this) - // Not enable animation when do force layout - && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation'])); - }; - GraphSeriesModel.type = 'series.graph'; - GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; - GraphSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'view', - // Default option for all coordinate systems - // xAxisIndex: 0, - // yAxisIndex: 0, - // polarIndex: 0, - // geoIndex: 0, - legendHoverLink: true, - layout: null, - // Configuration of circular layout - circular: { - rotateLabel: false - }, - // Configuration of force directed layout - force: { - initLayout: null, - // Node repulsion. Can be an array to represent range. - repulsion: [0, 50], - gravity: 0.1, - // Initial friction - friction: 0.6, - // Edge length. Can be an array to represent range. - edgeLength: 30, - layoutAnimation: true - }, - left: 'center', - top: 'center', - // right: null, - // bottom: null, - // width: '80%', - // height: '80%', - symbol: 'circle', - symbolSize: 10, - edgeSymbol: ['none', 'none'], - edgeSymbolSize: 10, - edgeLabel: { - position: 'middle', - distance: 5 - }, - draggable: false, - roam: false, - // Default on center of graph - center: null, - zoom: 1, - // Symbol size scale ratio in roam - nodeScaleRatio: 0.6, - // cursor: null, - // categories: [], - // data: [] - // Or - // nodes: [] - // - // links: [] - // Or - // edges: [] - label: { - show: false, - formatter: '{b}' - }, - itemStyle: {}, - lineStyle: { - color: '#aaa', - width: 1, - opacity: 0.5 - }, - emphasis: { - scale: true, - label: { - show: true - } - }, - select: { - itemStyle: { - borderColor: '#212121' - } - } - }; - return GraphSeriesModel; - }(SeriesModel); - - var actionInfo = { - type: 'graphRoam', - event: 'graphRoam', - update: 'none' - }; - function install$d(registers) { - registers.registerChartView(GraphView); - registers.registerSeriesModel(GraphSeriesModel); - registers.registerProcessor(categoryFilter); - registers.registerVisual(categoryVisual); - registers.registerVisual(graphEdgeVisual); - registers.registerLayout(graphSimpleLayout); - registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout); - registers.registerLayout(graphForceLayout); - registers.registerCoordinateSystem('graphView', { - dimensions: View.dimensions, - create: createViewCoordSys - }); - // Register legacy focus actions - registers.registerAction({ - type: 'focusNodeAdjacency', - event: 'focusNodeAdjacency', - update: 'series:focusNodeAdjacency' - }, noop); - registers.registerAction({ - type: 'unfocusNodeAdjacency', - event: 'unfocusNodeAdjacency', - update: 'series:unfocusNodeAdjacency' - }, noop); - // Register roam action. - registers.registerAction(actionInfo, function (payload, ecModel, api) { - ecModel.eachComponent({ - mainType: 'series', - query: payload - }, function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var res = updateCenterAndZoom(coordSys, payload, undefined, api); - seriesModel.setCenter && seriesModel.setCenter(res.center); - seriesModel.setZoom && seriesModel.setZoom(res.zoom); - }); - }); - } - - var PointerShape = /** @class */function () { - function PointerShape() { - this.angle = 0; - this.width = 10; - this.r = 10; - this.x = 0; - this.y = 0; - } - return PointerShape; - }(); - var PointerPath = /** @class */function (_super) { - __extends(PointerPath, _super); - function PointerPath(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'pointer'; - return _this; - } - PointerPath.prototype.getDefaultShape = function () { - return new PointerShape(); - }; - PointerPath.prototype.buildPath = function (ctx, shape) { - var mathCos = Math.cos; - var mathSin = Math.sin; - var r = shape.r; - var width = shape.width; - var angle = shape.angle; - var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2); - var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2); - angle = shape.angle - Math.PI / 2; - ctx.moveTo(x, y); - ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width); - ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r); - ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width); - ctx.lineTo(x, y); - }; - return PointerPath; - }(Path); - - function parsePosition(seriesModel, api) { - var center = seriesModel.get('center'); - var width = api.getWidth(); - var height = api.getHeight(); - var size = Math.min(width, height); - var cx = parsePercent$1(center[0], api.getWidth()); - var cy = parsePercent$1(center[1], api.getHeight()); - var r = parsePercent$1(seriesModel.get('radius'), size / 2); - return { - cx: cx, - cy: cy, - r: r - }; - } - function formatLabel(value, labelFormatter) { - var label = value == null ? '' : value + ''; - if (labelFormatter) { - if (isString(labelFormatter)) { - label = labelFormatter.replace('{value}', label); - } else if (isFunction(labelFormatter)) { - label = labelFormatter(value); - } - } - return label; - } - var GaugeView = /** @class */function (_super) { - __extends(GaugeView, _super); - function GaugeView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GaugeView.type; - return _this; - } - GaugeView.prototype.render = function (seriesModel, ecModel, api) { - this.group.removeAll(); - var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']); - var posInfo = parsePosition(seriesModel, api); - this._renderMain(seriesModel, ecModel, api, colorList, posInfo); - this._data = seriesModel.getData(); - }; - GaugeView.prototype.dispose = function () {}; - GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) { - var group = this.group; - var clockwise = seriesModel.get('clockwise'); - var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI; - var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI; - var axisLineModel = seriesModel.getModel('axisLine'); - var roundCap = axisLineModel.get('roundCap'); - var MainPath = roundCap ? SausagePath : Sector; - var showAxis = axisLineModel.get('show'); - var lineStyleModel = axisLineModel.getModel('lineStyle'); - var axisLineWidth = lineStyleModel.get('width'); - var angles = [startAngle, endAngle]; - normalizeArcAngles(angles, !clockwise); - startAngle = angles[0]; - endAngle = angles[1]; - var angleRangeSpan = endAngle - startAngle; - var prevEndAngle = startAngle; - var sectors = []; - for (var i = 0; showAxis && i < colorList.length; i++) { - // Clamp - var percent = Math.min(Math.max(colorList[i][0], 0), 1); - endAngle = startAngle + angleRangeSpan * percent; - var sector = new MainPath({ - shape: { - startAngle: prevEndAngle, - endAngle: endAngle, - cx: posInfo.cx, - cy: posInfo.cy, - clockwise: clockwise, - r0: posInfo.r - axisLineWidth, - r: posInfo.r - }, - silent: true - }); - sector.setStyle({ - fill: colorList[i][1] - }); - sector.setStyle(lineStyleModel.getLineStyle( - // Because we use sector to simulate arc - // so the properties for stroking are useless - ['color', 'width'])); - sectors.push(sector); - prevEndAngle = endAngle; - } - sectors.reverse(); - each(sectors, function (sector) { - return group.add(sector); - }); - var getColor = function (percent) { - // Less than 0 - if (percent <= 0) { - return colorList[0][1]; - } - var i; - for (i = 0; i < colorList.length; i++) { - if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) { - return colorList[i][1]; - } - } - // More than 1 - return colorList[i - 1][1]; - }; - this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth); - this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo); - this._renderAnchor(seriesModel, posInfo); - this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth); - }; - GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { - var group = this.group; - var cx = posInfo.cx; - var cy = posInfo.cy; - var r = posInfo.r; - var minVal = +seriesModel.get('min'); - var maxVal = +seriesModel.get('max'); - var splitLineModel = seriesModel.getModel('splitLine'); - var tickModel = seriesModel.getModel('axisTick'); - var labelModel = seriesModel.getModel('axisLabel'); - var splitNumber = seriesModel.get('splitNumber'); - var subSplitNumber = tickModel.get('splitNumber'); - var splitLineLen = parsePercent$1(splitLineModel.get('length'), r); - var tickLen = parsePercent$1(tickModel.get('length'), r); - var angle = startAngle; - var step = (endAngle - startAngle) / splitNumber; - var subStep = step / subSplitNumber; - var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle(); - var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle(); - var splitLineDistance = splitLineModel.get('distance'); - var unitX; - var unitY; - for (var i = 0; i <= splitNumber; i++) { - unitX = Math.cos(angle); - unitY = Math.sin(angle); - // Split line - if (splitLineModel.get('show')) { - var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth; - var splitLine = new Line({ - shape: { - x1: unitX * (r - distance) + cx, - y1: unitY * (r - distance) + cy, - x2: unitX * (r - splitLineLen - distance) + cx, - y2: unitY * (r - splitLineLen - distance) + cy - }, - style: splitLineStyle, - silent: true - }); - if (splitLineStyle.stroke === 'auto') { - splitLine.setStyle({ - stroke: getColor(i / splitNumber) - }); - } - group.add(splitLine); - } - // Label - if (labelModel.get('show')) { - var distance = labelModel.get('distance') + splitLineDistance; - var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter')); - var autoColor = getColor(i / splitNumber); - var textStyleX = unitX * (r - splitLineLen - distance) + cx; - var textStyleY = unitY * (r - splitLineLen - distance) + cy; - var rotateType = labelModel.get('rotate'); - var rotate = 0; - if (rotateType === 'radial') { - rotate = -angle + 2 * Math.PI; - if (rotate > Math.PI / 2) { - rotate += Math.PI; - } - } else if (rotateType === 'tangential') { - rotate = -angle - Math.PI / 2; - } else if (isNumber(rotateType)) { - rotate = rotateType * Math.PI / 180; - } - if (rotate === 0) { - group.add(new ZRText({ - style: createTextStyle(labelModel, { - text: label, - x: textStyleX, - y: textStyleY, - verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle', - align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center' - }, { - inheritColor: autoColor - }), - silent: true - })); - } else { - group.add(new ZRText({ - style: createTextStyle(labelModel, { - text: label, - x: textStyleX, - y: textStyleY, - verticalAlign: 'middle', - align: 'center' - }, { - inheritColor: autoColor - }), - silent: true, - originX: textStyleX, - originY: textStyleY, - rotation: rotate - })); - } - } - // Axis tick - if (tickModel.get('show') && i !== splitNumber) { - var distance = tickModel.get('distance'); - distance = distance ? distance + axisLineWidth : axisLineWidth; - for (var j = 0; j <= subSplitNumber; j++) { - unitX = Math.cos(angle); - unitY = Math.sin(angle); - var tickLine = new Line({ - shape: { - x1: unitX * (r - distance) + cx, - y1: unitY * (r - distance) + cy, - x2: unitX * (r - tickLen - distance) + cx, - y2: unitY * (r - tickLen - distance) + cy - }, - silent: true, - style: tickLineStyle - }); - if (tickLineStyle.stroke === 'auto') { - tickLine.setStyle({ - stroke: getColor((i + j / subSplitNumber) / splitNumber) - }); - } - group.add(tickLine); - angle += subStep; - } - angle -= subStep; - } else { - angle += step; - } - } - }; - GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { - var group = this.group; - var oldData = this._data; - var oldProgressData = this._progressEls; - var progressList = []; - var showPointer = seriesModel.get(['pointer', 'show']); - var progressModel = seriesModel.getModel('progress'); - var showProgress = progressModel.get('show'); - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var minVal = +seriesModel.get('min'); - var maxVal = +seriesModel.get('max'); - var valueExtent = [minVal, maxVal]; - var angleExtent = [startAngle, endAngle]; - function createPointer(idx, angle) { - var itemModel = data.getItemModel(idx); - var pointerModel = itemModel.getModel('pointer'); - var pointerWidth = parsePercent$1(pointerModel.get('width'), posInfo.r); - var pointerLength = parsePercent$1(pointerModel.get('length'), posInfo.r); - var pointerStr = seriesModel.get(['pointer', 'icon']); - var pointerOffset = pointerModel.get('offsetCenter'); - var pointerOffsetX = parsePercent$1(pointerOffset[0], posInfo.r); - var pointerOffsetY = parsePercent$1(pointerOffset[1], posInfo.r); - var pointerKeepAspect = pointerModel.get('keepAspect'); - var pointer; - // not exist icon type will be set 'rect' - if (pointerStr) { - pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect); - } else { - pointer = new PointerPath({ - shape: { - angle: -Math.PI / 2, - width: pointerWidth, - r: pointerLength, - x: pointerOffsetX, - y: pointerOffsetY - } - }); - } - pointer.rotation = -(angle + Math.PI / 2); - pointer.x = posInfo.cx; - pointer.y = posInfo.cy; - return pointer; - } - function createProgress(idx, endAngle) { - var roundCap = progressModel.get('roundCap'); - var ProgressPath = roundCap ? SausagePath : Sector; - var isOverlap = progressModel.get('overlap'); - var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count(); - var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth; - var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth; - var progress = new ProgressPath({ - shape: { - startAngle: startAngle, - endAngle: endAngle, - cx: posInfo.cx, - cy: posInfo.cy, - clockwise: clockwise, - r0: r0, - r: r - } - }); - isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal); - return progress; - } - if (showProgress || showPointer) { - data.diff(oldData).add(function (idx) { - var val = data.get(valueDim, idx); - if (showPointer) { - var pointer = createPointer(idx, startAngle); - // TODO hide pointer on NaN value? - initProps(pointer, { - rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) - }, seriesModel); - group.add(pointer); - data.setItemGraphicEl(idx, pointer); - } - if (showProgress) { - var progress = createProgress(idx, startAngle); - var isClip = progressModel.get('clip'); - initProps(progress, { - shape: { - endAngle: linearMap(val, valueExtent, angleExtent, isClip) - } - }, seriesModel); - group.add(progress); - // Add data index and series index for indexing the data by element - // Useful in tooltip - setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress); - progressList[idx] = progress; - } - }).update(function (newIdx, oldIdx) { - var val = data.get(valueDim, newIdx); - if (showPointer) { - var previousPointer = oldData.getItemGraphicEl(oldIdx); - var previousRotate = previousPointer ? previousPointer.rotation : startAngle; - var pointer = createPointer(newIdx, previousRotate); - pointer.rotation = previousRotate; - updateProps(pointer, { - rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) - }, seriesModel); - group.add(pointer); - data.setItemGraphicEl(newIdx, pointer); - } - if (showProgress) { - var previousProgress = oldProgressData[oldIdx]; - var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle; - var progress = createProgress(newIdx, previousEndAngle); - var isClip = progressModel.get('clip'); - updateProps(progress, { - shape: { - endAngle: linearMap(val, valueExtent, angleExtent, isClip) - } - }, seriesModel); - group.add(progress); - // Add data index and series index for indexing the data by element - // Useful in tooltip - setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress); - progressList[newIdx] = progress; - } - }).execute(); - data.each(function (idx) { - var itemModel = data.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var emphasisDisabled = emphasisModel.get('disabled'); - if (showPointer) { - var pointer = data.getItemGraphicEl(idx); - var symbolStyle = data.getItemVisual(idx, 'style'); - var visualColor = symbolStyle.fill; - if (pointer instanceof ZRImage) { - var pathStyle = pointer.style; - pointer.useStyle(extend({ - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, symbolStyle)); - } else { - pointer.useStyle(symbolStyle); - pointer.type !== 'pointer' && pointer.setColor(visualColor); - } - pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle()); - if (pointer.style.fill === 'auto') { - pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true))); - } - pointer.z2EmphasisLift = 0; - setStatesStylesFromModel(pointer, itemModel); - toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled); - } - if (showProgress) { - var progress = progressList[idx]; - progress.useStyle(data.getItemVisual(idx, 'style')); - progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle()); - progress.z2EmphasisLift = 0; - setStatesStylesFromModel(progress, itemModel); - toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled); - } - }); - this._progressEls = progressList; - } - }; - GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) { - var anchorModel = seriesModel.getModel('anchor'); - var showAnchor = anchorModel.get('show'); - if (showAnchor) { - var anchorSize = anchorModel.get('size'); - var anchorType = anchorModel.get('icon'); - var offsetCenter = anchorModel.get('offsetCenter'); - var anchorKeepAspect = anchorModel.get('keepAspect'); - var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent$1(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent$1(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect); - anchor.z2 = anchorModel.get('showAbove') ? 1 : 0; - anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle()); - this.group.add(anchor); - } - }; - GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) { - var _this = this; - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var minVal = +seriesModel.get('min'); - var maxVal = +seriesModel.get('max'); - var contentGroup = new Group(); - var newTitleEls = []; - var newDetailEls = []; - var hasAnimation = seriesModel.isAnimationEnabled(); - var showPointerAbove = seriesModel.get(['pointer', 'showAbove']); - data.diff(this._data).add(function (idx) { - newTitleEls[idx] = new ZRText({ - silent: true - }); - newDetailEls[idx] = new ZRText({ - silent: true - }); - }).update(function (idx, oldIdx) { - newTitleEls[idx] = _this._titleEls[oldIdx]; - newDetailEls[idx] = _this._detailEls[oldIdx]; - }).execute(); - data.each(function (idx) { - var itemModel = data.getItemModel(idx); - var value = data.get(valueDim, idx); - var itemGroup = new Group(); - var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true)); - var itemTitleModel = itemModel.getModel('title'); - if (itemTitleModel.get('show')) { - var titleOffsetCenter = itemTitleModel.get('offsetCenter'); - var titleX = posInfo.cx + parsePercent$1(titleOffsetCenter[0], posInfo.r); - var titleY = posInfo.cy + parsePercent$1(titleOffsetCenter[1], posInfo.r); - var labelEl = newTitleEls[idx]; - labelEl.attr({ - z2: showPointerAbove ? 0 : 2, - style: createTextStyle(itemTitleModel, { - x: titleX, - y: titleY, - text: data.getName(idx), - align: 'center', - verticalAlign: 'middle' - }, { - inheritColor: autoColor - }) - }); - itemGroup.add(labelEl); - } - var itemDetailModel = itemModel.getModel('detail'); - if (itemDetailModel.get('show')) { - var detailOffsetCenter = itemDetailModel.get('offsetCenter'); - var detailX = posInfo.cx + parsePercent$1(detailOffsetCenter[0], posInfo.r); - var detailY = posInfo.cy + parsePercent$1(detailOffsetCenter[1], posInfo.r); - var width = parsePercent$1(itemDetailModel.get('width'), posInfo.r); - var height = parsePercent$1(itemDetailModel.get('height'), posInfo.r); - var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor; - var labelEl = newDetailEls[idx]; - var formatter_1 = itemDetailModel.get('formatter'); - labelEl.attr({ - z2: showPointerAbove ? 0 : 2, - style: createTextStyle(itemDetailModel, { - x: detailX, - y: detailY, - text: formatLabel(value, formatter_1), - width: isNaN(width) ? null : width, - height: isNaN(height) ? null : height, - align: 'center', - verticalAlign: 'middle' - }, { - inheritColor: detailColor - }) - }); - setLabelValueAnimation(labelEl, { - normal: itemDetailModel - }, value, function (value) { - return formatLabel(value, formatter_1); - }); - hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, { - getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) { - return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1); - } - }); - itemGroup.add(labelEl); - } - contentGroup.add(itemGroup); - }); - this.group.add(contentGroup); - this._titleEls = newTitleEls; - this._detailEls = newDetailEls; - }; - GaugeView.type = 'gauge'; - return GaugeView; - }(ChartView); - - var GaugeSeriesModel = /** @class */function (_super) { - __extends(GaugeSeriesModel, _super); - function GaugeSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GaugeSeriesModel.type; - _this.visualStyleAccessPath = 'itemStyle'; - return _this; - } - GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesDataSimply(this, ['value']); - }; - GaugeSeriesModel.type = 'series.gauge'; - GaugeSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - colorBy: 'data', - // 默认全局居中 - center: ['50%', '50%'], - legendHoverLink: true, - radius: '75%', - startAngle: 225, - endAngle: -45, - clockwise: true, - // 最小值 - min: 0, - // 最大值 - max: 100, - // 分割段数,默认为10 - splitNumber: 10, - // 坐标轴线 - axisLine: { - // 默认显示,属性show控制显示与否 - show: true, - roundCap: false, - lineStyle: { - color: [[1, '#E6EBF8']], - width: 10 - } - }, - // 坐标轴线 - progress: { - // 默认显示,属性show控制显示与否 - show: false, - overlap: true, - width: 10, - roundCap: false, - clip: true - }, - // 分隔线 - splitLine: { - // 默认显示,属性show控制显示与否 - show: true, - // 属性length控制线长 - length: 10, - distance: 10, - // 属性lineStyle(详见lineStyle)控制线条样式 - lineStyle: { - color: '#63677A', - width: 3, - type: 'solid' - } - }, - // 坐标轴小标记 - axisTick: { - // 属性show控制显示与否,默认不显示 - show: true, - // 每份split细分多少段 - splitNumber: 5, - // 属性length控制线长 - length: 6, - distance: 10, - // 属性lineStyle控制线条样式 - lineStyle: { - color: '#63677A', - width: 1, - type: 'solid' - } - }, - axisLabel: { - show: true, - distance: 15, - // formatter: null, - color: '#464646', - fontSize: 12, - rotate: 0 - }, - pointer: { - icon: null, - offsetCenter: [0, 0], - show: true, - showAbove: true, - length: '60%', - width: 6, - keepAspect: false - }, - anchor: { - show: false, - showAbove: false, - size: 6, - icon: 'circle', - offsetCenter: [0, 0], - keepAspect: false, - itemStyle: { - color: '#fff', - borderWidth: 0, - borderColor: '#5470c6' - } - }, - title: { - show: true, - // x, y,单位px - offsetCenter: [0, '20%'], - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#464646', - fontSize: 16, - valueAnimation: false - }, - detail: { - show: true, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 0, - borderColor: '#ccc', - width: 100, - height: null, - padding: [5, 10], - // x, y,单位px - offsetCenter: [0, '40%'], - // formatter: null, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#464646', - fontSize: 30, - fontWeight: 'bold', - lineHeight: 30, - valueAnimation: false - } - }; - return GaugeSeriesModel; - }(SeriesModel); - - function install$e(registers) { - registers.registerChartView(GaugeView); - registers.registerSeriesModel(GaugeSeriesModel); - } - - var opacityAccessPath = ['itemStyle', 'opacity']; - /** - * Piece of pie including Sector, Label, LabelLine - */ - var FunnelPiece = /** @class */function (_super) { - __extends(FunnelPiece, _super); - function FunnelPiece(data, idx) { - var _this = _super.call(this) || this; - var polygon = _this; - var labelLine = new Polyline(); - var text = new ZRText(); - polygon.setTextContent(text); - _this.setTextGuideLine(labelLine); - _this.updateData(data, idx, true); - return _this; - } - FunnelPiece.prototype.updateData = function (data, idx, firstCreate) { - var polygon = this; - var seriesModel = data.hostModel; - var itemModel = data.getItemModel(idx); - var layout = data.getItemLayout(idx); - var emphasisModel = itemModel.getModel('emphasis'); - var opacity = itemModel.get(opacityAccessPath); - opacity = opacity == null ? 1 : opacity; - if (!firstCreate) { - saveOldStyle(polygon); - } - // Update common style - polygon.useStyle(data.getItemVisual(idx, 'style')); - polygon.style.lineJoin = 'round'; - if (firstCreate) { - polygon.setShape({ - points: layout.points - }); - polygon.style.opacity = 0; - initProps(polygon, { - style: { - opacity: opacity - } - }, seriesModel, idx); - } else { - updateProps(polygon, { - style: { - opacity: opacity - }, - shape: { - points: layout.points - } - }, seriesModel, idx); - } - setStatesStylesFromModel(polygon, itemModel); - this._updateLabel(data, idx); - toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; - FunnelPiece.prototype._updateLabel = function (data, idx) { - var polygon = this; - var labelLine = this.getTextGuideLine(); - var labelText = polygon.getTextContent(); - var seriesModel = data.hostModel; - var itemModel = data.getItemModel(idx); - var layout = data.getItemLayout(idx); - var labelLayout = layout.label; - var style = data.getItemVisual(idx, 'style'); - var visualColor = style.fill; - setLabelStyle( - // position will not be used in setLabelStyle - labelText, getLabelStatesModels(itemModel), { - labelFetcher: data.hostModel, - labelDataIndex: idx, - defaultOpacity: style.opacity, - defaultText: data.getName(idx) - }, { - normal: { - align: labelLayout.textAlign, - verticalAlign: labelLayout.verticalAlign - } - }); - polygon.setTextConfig({ - local: true, - inside: !!labelLayout.inside, - insideStroke: visualColor, - // insideFill: 'auto', - outsideFill: visualColor - }); - var linePoints = labelLayout.linePoints; - labelLine.setShape({ - points: linePoints - }); - polygon.textGuideLineConfig = { - anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null - }; - // Make sure update style on labelText after setLabelStyle. - // Because setLabelStyle will replace a new style on it. - updateProps(labelText, { - style: { - x: labelLayout.x, - y: labelLayout.y - } - }, seriesModel, idx); - labelText.attr({ - rotation: labelLayout.rotation, - originX: labelLayout.x, - originY: labelLayout.y, - z2: 10 - }); - setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), { - // Default use item visual color - stroke: visualColor - }); - }; - return FunnelPiece; - }(Polygon); - var FunnelView = /** @class */function (_super) { - __extends(FunnelView, _super); - function FunnelView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = FunnelView.type; - _this.ignoreLabelLineUpdate = true; - return _this; - } - FunnelView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var oldData = this._data; - var group = this.group; - data.diff(oldData).add(function (idx) { - var funnelPiece = new FunnelPiece(data, idx); - data.setItemGraphicEl(idx, funnelPiece); - group.add(funnelPiece); - }).update(function (newIdx, oldIdx) { - var piece = oldData.getItemGraphicEl(oldIdx); - piece.updateData(data, newIdx); - group.add(piece); - data.setItemGraphicEl(newIdx, piece); - }).remove(function (idx) { - var piece = oldData.getItemGraphicEl(idx); - removeElementWithFadeOut(piece, seriesModel, idx); - }).execute(); - this._data = data; - }; - FunnelView.prototype.remove = function () { - this.group.removeAll(); - this._data = null; - }; - FunnelView.prototype.dispose = function () {}; - FunnelView.type = 'funnel'; - return FunnelView; - }(ChartView); - - var FunnelSeriesModel = /** @class */function (_super) { - __extends(FunnelSeriesModel, _super); - function FunnelSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = FunnelSeriesModel.type; - return _this; - } - FunnelSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); - // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); - // Extend labelLine emphasis - this._defaultLabelLine(option); - }; - FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesDataSimply(this, { - coordDimensions: ['value'], - encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) - }); - }; - FunnelSeriesModel.prototype._defaultLabelLine = function (option) { - // Extend labelLine emphasis - 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; - }; - // Overwrite - FunnelSeriesModel.prototype.getDataParams = function (dataIndex) { - var data = this.getData(); - var params = _super.prototype.getDataParams.call(this, dataIndex); - var valueDim = data.mapDimension('value'); - var sum = data.getSum(valueDim); - // Percent is 0 if sum is 0 - params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2); - params.$vars.push('percent'); - return params; - }; - FunnelSeriesModel.type = 'series.funnel'; - FunnelSeriesModel.defaultOption = { - // zlevel: 0, // 一级层叠 - z: 2, - legendHoverLink: true, - colorBy: 'data', - left: 80, - top: 60, - right: 80, - bottom: 60, - // width: {totalWidth} - left - right, - // height: {totalHeight} - top - bottom, - // 默认取数据最小最大值 - // min: 0, - // max: 100, - minSize: '0%', - maxSize: '100%', - sort: 'descending', - orient: 'vertical', - gap: 0, - funnelAlign: 'center', - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 - }, - - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1 - } - }, - itemStyle: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1 - }, - emphasis: { - label: { - show: true - } - }, - select: { - itemStyle: { - borderColor: '#212121' - } - } - }; - return FunnelSeriesModel; - }(SeriesModel); - - function getViewRect$3(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - } - function getSortedIndices(data, sort) { - var valueDim = data.mapDimension('value'); - var valueArr = data.mapArray(valueDim, function (val) { - return val; - }); - var indices = []; - var isAscending = sort === 'ascending'; - for (var i = 0, len = data.count(); i < len; i++) { - indices[i] = i; - } - // Add custom sortable function & none sortable opetion by "options.sort" - if (isFunction(sort)) { - indices.sort(sort); - } else if (sort !== 'none') { - indices.sort(function (a, b) { - return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; - }); - } - return indices; - } - function labelLayout(data) { - var seriesModel = data.hostModel; - var orient = seriesModel.get('orient'); - data.each(function (idx) { - var itemModel = data.getItemModel(idx); - var labelModel = itemModel.getModel('label'); - var labelPosition = labelModel.get('position'); - var labelLineModel = itemModel.getModel('labelLine'); - var layout = data.getItemLayout(idx); - var points = layout.points; - var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight'; - var textAlign; - var textX; - var textY; - var linePoints; - if (isLabelInside) { - if (labelPosition === 'insideLeft') { - textX = (points[0][0] + points[3][0]) / 2 + 5; - textY = (points[0][1] + points[3][1]) / 2; - textAlign = 'left'; - } else if (labelPosition === 'insideRight') { - textX = (points[1][0] + points[2][0]) / 2 - 5; - textY = (points[1][1] + points[2][1]) / 2; - textAlign = 'right'; - } else { - textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; - textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; - textAlign = 'center'; - } - linePoints = [[textX, textY], [textX, textY]]; - } else { - var x1 = void 0; - var y1 = void 0; - var x2 = void 0; - var y2 = void 0; - var labelLineLen = labelLineModel.get('length'); - if ("development" !== 'production') { - if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) { - labelPosition = 'left'; - console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.'); - } - if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) { - labelPosition = 'bottom'; - console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.'); - } - } - if (labelPosition === 'left') { - // Left side - x1 = (points[3][0] + points[0][0]) / 2; - y1 = (points[3][1] + points[0][1]) / 2; - x2 = x1 - labelLineLen; - textX = x2 - 5; - textAlign = 'right'; - } else if (labelPosition === 'right') { - // Right side - x1 = (points[1][0] + points[2][0]) / 2; - y1 = (points[1][1] + points[2][1]) / 2; - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'left'; - } else if (labelPosition === 'top') { - // Top side - x1 = (points[3][0] + points[0][0]) / 2; - y1 = (points[3][1] + points[0][1]) / 2; - y2 = y1 - labelLineLen; - textY = y2 - 5; - textAlign = 'center'; - } else if (labelPosition === 'bottom') { - // Bottom side - x1 = (points[1][0] + points[2][0]) / 2; - y1 = (points[1][1] + points[2][1]) / 2; - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else if (labelPosition === 'rightTop') { - // RightTop side - x1 = orient === 'horizontal' ? points[3][0] : points[1][0]; - y1 = orient === 'horizontal' ? points[3][1] : points[1][1]; - if (orient === 'horizontal') { - y2 = y1 - labelLineLen; - textY = y2 - 5; - textAlign = 'center'; - } else { - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'top'; - } - } else if (labelPosition === 'rightBottom') { - // RightBottom side - x1 = points[2][0]; - y1 = points[2][1]; - if (orient === 'horizontal') { - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else { - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'bottom'; - } - } else if (labelPosition === 'leftTop') { - // LeftTop side - x1 = points[0][0]; - y1 = orient === 'horizontal' ? points[0][1] : points[1][1]; - if (orient === 'horizontal') { - y2 = y1 - labelLineLen; - textY = y2 - 5; - textAlign = 'center'; - } else { - x2 = x1 - labelLineLen; - textX = x2 - 5; - textAlign = 'right'; - } - } else if (labelPosition === 'leftBottom') { - // LeftBottom side - x1 = orient === 'horizontal' ? points[1][0] : points[3][0]; - y1 = orient === 'horizontal' ? points[1][1] : points[2][1]; - if (orient === 'horizontal') { - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else { - x2 = x1 - labelLineLen; - textX = x2 - 5; - textAlign = 'right'; - } - } else { - // Right side or Bottom side - x1 = (points[1][0] + points[2][0]) / 2; - y1 = (points[1][1] + points[2][1]) / 2; - if (orient === 'horizontal') { - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else { - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'left'; - } - } - if (orient === 'horizontal') { - x2 = x1; - textX = x2; - } else { - y2 = y1; - textY = y2; - } - linePoints = [[x1, y1], [x2, y2]]; - } - layout.label = { - linePoints: linePoints, - x: textX, - y: textY, - verticalAlign: 'middle', - textAlign: textAlign, - inside: isLabelInside - }; - }); - } - function funnelLayout(ecModel, api) { - ecModel.eachSeriesByType('funnel', function (seriesModel) { - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var sort = seriesModel.get('sort'); - var viewRect = getViewRect$3(seriesModel, api); - var orient = seriesModel.get('orient'); - var viewWidth = viewRect.width; - var viewHeight = viewRect.height; - var indices = getSortedIndices(data, sort); - var x = viewRect.x; - var y = viewRect.y; - var sizeExtent = orient === 'horizontal' ? [parsePercent$1(seriesModel.get('minSize'), viewHeight), parsePercent$1(seriesModel.get('maxSize'), viewHeight)] : [parsePercent$1(seriesModel.get('minSize'), viewWidth), parsePercent$1(seriesModel.get('maxSize'), viewWidth)]; - var dataExtent = data.getDataExtent(valueDim); - var min = seriesModel.get('min'); - var max = seriesModel.get('max'); - if (min == null) { - min = Math.min(dataExtent[0], 0); - } - if (max == null) { - max = dataExtent[1]; - } - var funnelAlign = seriesModel.get('funnelAlign'); - var gap = seriesModel.get('gap'); - var viewSize = orient === 'horizontal' ? viewWidth : viewHeight; - var itemSize = (viewSize - gap * (data.count() - 1)) / data.count(); - var getLinePoints = function (idx, offset) { - // End point index is data.count() and we assign it 0 - if (orient === 'horizontal') { - var val_1 = data.get(valueDim, idx) || 0; - var itemHeight = linearMap(val_1, [min, max], sizeExtent, true); - var y0 = void 0; - switch (funnelAlign) { - case 'top': - y0 = y; - break; - case 'center': - y0 = y + (viewHeight - itemHeight) / 2; - break; - case 'bottom': - y0 = y + (viewHeight - itemHeight); - break; - } - return [[offset, y0], [offset, y0 + itemHeight]]; - } - var val = data.get(valueDim, idx) || 0; - var itemWidth = linearMap(val, [min, max], sizeExtent, true); - var x0; - switch (funnelAlign) { - case 'left': - x0 = x; - break; - case 'center': - x0 = x + (viewWidth - itemWidth) / 2; - break; - case 'right': - x0 = x + viewWidth - itemWidth; - break; - } - return [[x0, offset], [x0 + itemWidth, offset]]; - }; - if (sort === 'ascending') { - // From bottom to top - itemSize = -itemSize; - gap = -gap; - if (orient === 'horizontal') { - x += viewWidth; - } else { - y += viewHeight; - } - indices = indices.reverse(); - } - for (var i = 0; i < indices.length; i++) { - var idx = indices[i]; - var nextIdx = indices[i + 1]; - var itemModel = data.getItemModel(idx); - if (orient === 'horizontal') { - var width = itemModel.get(['itemStyle', 'width']); - if (width == null) { - width = itemSize; - } else { - width = parsePercent$1(width, viewWidth); - if (sort === 'ascending') { - width = -width; - } - } - var start = getLinePoints(idx, x); - var end = getLinePoints(nextIdx, x + width); - x += width + gap; - data.setItemLayout(idx, { - points: start.concat(end.slice().reverse()) - }); - } else { - var height = itemModel.get(['itemStyle', 'height']); - if (height == null) { - height = itemSize; - } else { - height = parsePercent$1(height, viewHeight); - if (sort === 'ascending') { - height = -height; - } - } - var start = getLinePoints(idx, y); - var end = getLinePoints(nextIdx, y + height); - y += height + gap; - data.setItemLayout(idx, { - points: start.concat(end.slice().reverse()) - }); - } - } - labelLayout(data); - }); - } - - function install$f(registers) { - registers.registerChartView(FunnelView); - registers.registerSeriesModel(FunnelSeriesModel); - registers.registerLayout(funnelLayout); - registers.registerProcessor(dataFilter('funnel')); - } - - var DEFAULT_SMOOTH = 0.3; - var ParallelView = /** @class */function (_super) { - __extends(ParallelView, _super); - function ParallelView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelView.type; - _this._dataGroup = new Group(); - _this._initialized = false; - return _this; - } - ParallelView.prototype.init = function () { - this.group.add(this._dataGroup); - }; - /** - * @override - */ - ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) { - // Clear previously rendered progressive elements. - this._progressiveEls = null; - var dataGroup = this._dataGroup; - var data = seriesModel.getData(); - var oldData = this._data; - var coordSys = seriesModel.coordinateSystem; - var dimensions = coordSys.dimensions; - var seriesScope = makeSeriesScope$2(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); - updateProps(line, { - shape: { - points: points - } - }, seriesModel, newDataIndex); - saveOldStyle(line); - 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; - }; - ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - this._initialized = true; - this._data = null; - this._dataGroup.removeAll(); - }; - ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { - var data = seriesModel.getData(); - var coordSys = seriesModel.coordinateSystem; - var dimensions = coordSys.dimensions; - var seriesScope = makeSeriesScope$2(seriesModel); - var progressiveEls = this._progressiveEls = []; - 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); - progressiveEls.push(line); - } - }; - ParallelView.prototype.remove = function () { - this._dataGroup && this._dataGroup.removeAll(); - this._data = null; - }; - ParallelView.type = 'parallel'; - return ParallelView; - }(ChartView); - function createGridClipShape(coordSys, seriesModel, cb) { - var parallelModel = coordSys.model; - var rect = coordSys.getRect(); - var rectEl = new 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); - 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 Polyline({ - shape: { - points: points - }, - // silent: true, - z2: 10 - }); - dataGroup.add(line); - data.setItemGraphicEl(dataIndex, line); - return line; - } - function makeSeriesScope$2(seriesModel) { - var smooth = seriesModel.get('smooth', true); - smooth === true && (smooth = DEFAULT_SMOOTH); - smooth = numericToNumber(smooth); - eqNaN(smooth) && (smooth = 0); - return { - smooth: smooth - }; - } - function updateElCommon(el, data, dataIndex, seriesScope) { - el.useStyle(data.getItemVisual(dataIndex, 'style')); - el.style.fill = null; - el.setShape('smooth', seriesScope.smooth); - var itemModel = data.getItemModel(dataIndex); - var emphasisModel = itemModel.getModel('emphasis'); - setStatesStylesFromModel(el, itemModel, 'lineStyle'); - toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - } - // function simpleDiff(oldData, newData, dimensions) { - // let oldLen; - // if (!oldData - // || !oldData.__plProgressive - // || (oldLen = oldData.count()) !== newData.count() - // ) { - // return true; - // } - // let dimLen = dimensions.length; - // for (let i = 0; i < oldLen; i++) { - // for (let j = 0; j < dimLen; j++) { - // if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) { - // return true; - // } - // } - // } - // return false; - // } - // FIXME put in common util? - function isEmptyValue(val, axisType) { - return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value' - } - - var ParallelSeriesModel = /** @class */function (_super) { - __extends(ParallelSeriesModel, _super); - function ParallelSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelSeriesModel.type; - _this.visualStyleAccessPath = 'lineStyle'; - _this.visualDrawType = 'stroke'; - return _this; - } - ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: bind(makeDefaultEncode, null, this) - }); - }; - /** - * User can get data raw indices on 'axisAreaSelected' event received. - * - * @return Raw indices - */ - ParallelSeriesModel.prototype.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; - }; - ParallelSeriesModel.type = 'series.parallel'; - ParallelSeriesModel.dependencies = ['parallel']; - ParallelSeriesModel.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, - animationEasing: 'linear' - }; - return ParallelSeriesModel; - }(SeriesModel); - function makeDefaultEncode(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']; - var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex')); - if (!parallelModel) { - return; - } - var encodeDefine = {}; - each(parallelModel.dimensions, function (axisDim) { - var dataDimIndex = convertDimNameToNumber(axisDim); - encodeDefine[axisDim] = dataDimIndex; - }); - return encodeDefine; - } - function convertDimNameToNumber(dimName) { - return +dimName.replace('dim', ''); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 opacityAccessPath$1 = ['lineStyle', 'opacity']; - var parallelVisual = { - seriesType: 'parallel', - reset: function (seriesModel, ecModel) { - var coordSys = seriesModel.coordinateSystem; - var opacityMap = { - normal: seriesModel.get(['lineStyle', 'opacity']), - active: seriesModel.get('activeOpacity'), - inactive: seriesModel.get('inactiveOpacity') - }; - return { - progress: function (params, data) { - coordSys.eachActiveState(data, function (activeState, dataIndex) { - var opacity = opacityMap[activeState]; - if (activeState === 'normal' && data.hasItemOption) { - var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true); - itemOpacity != null && (opacity = itemOpacity); - } - var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style'); - existsStyle.opacity = opacity; - }, params.start, params.end); - } - }; - } - }; - - function parallelPreprocessor(option) { - createParallelIfNeeded(option); - mergeAxisOptionFromParallel(option); - } - /** - * Create a parallel coordinate if not exists. - * @inner - */ - function createParallelIfNeeded(option) { - if (option.parallel) { - return; - } - var hasParallelSeries = false; - each(option.series, function (seriesOpt) { - if (seriesOpt && seriesOpt.type === 'parallel') { - hasParallelSeries = true; - } - }); - if (hasParallelSeries) { - option.parallel = [{}]; - } - } - /** - * Merge aixs definition from parallel option (if exists) to axis option. - * @inner - */ - function mergeAxisOptionFromParallel(option) { - var axes = normalizeToArray(option.parallelAxis); - each(axes, function (axisOption) { - if (!isObject(axisOption)) { - return; - } - var parallelIndex = axisOption.parallelIndex || 0; - var parallelOption = normalizeToArray(option.parallel)[parallelIndex]; - if (parallelOption && parallelOption.parallelAxisDefault) { - merge(axisOption, parallelOption.parallelAxisDefault, false); - } - }); - } - - var CLICK_THRESHOLD = 5; // > 4 - var ParallelView$1 = /** @class */function (_super) { - __extends(ParallelView, _super); - function ParallelView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelView.type; - return _this; - } - ParallelView.prototype.render = function (parallelModel, ecModel, api) { - this._model = parallelModel; - this._api = api; - if (!this._handlers) { - this._handlers = {}; - each(handlers, function (handler, eventName) { - api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this)); - }, this); - } - createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate'); - }; - ParallelView.prototype.dispose = function (ecModel, api) { - clear(this, '_throttledDispatchExpand'); - each(this._handlers, function (handler, eventName) { - api.getZr().off(eventName, handler); - }); - this._handlers = null; - }; - /** - * @internal - * @param {Object} [opt] If null, cancel the last action triggering for debounce. - */ - ParallelView.prototype._throttledDispatchExpand = function (opt) { - this._dispatchExpand(opt); - }; - /** - * @internal - */ - ParallelView.prototype._dispatchExpand = function (opt) { - opt && this._api.dispatchAction(extend({ - type: 'parallelAxisExpand' - }, opt)); - }; - ParallelView.type = 'parallel'; - return ParallelView; - }(ComponentView); - var handlers = { - mousedown: function (e) { - if (checkTrigger(this, 'click')) { - this._mouseDownPoint = [e.offsetX, e.offsetY]; - } - }, - mouseup: function (e) { - var mouseDownPoint = this._mouseDownPoint; - if (checkTrigger(this, 'click') && mouseDownPoint) { - var point = [e.offsetX, e.offsetY]; - var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2); - if (dist > CLICK_THRESHOLD) { - return; - } - var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]); - result.behavior !== 'none' && this._dispatchExpand({ - axisExpandWindow: result.axisExpandWindow - }); - } - this._mouseDownPoint = null; - }, - mousemove: function (e) { - // Should do nothing when brushing. - if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) { - return; - } - var model = this._model; - var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]); - var behavior = result.behavior; - behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce')); - this._throttledDispatchExpand(behavior === 'none' ? null // Cancel the last trigger, in case that mouse slide out of the area quickly. - : { - axisExpandWindow: result.axisExpandWindow, - // Jumping uses animation, and sliding suppresses animation. - animation: behavior === 'jump' ? null : { - duration: 0 // Disable animation. - } - }); - } - }; - - function checkTrigger(view, triggerOn) { - var model = view._model; - return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn; - } - - var ParallelModel = /** @class */function (_super) { - __extends(ParallelModel, _super); - function ParallelModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelModel.type; - return _this; - } - ParallelModel.prototype.init = function () { - _super.prototype.init.apply(this, arguments); - this.mergeOption({}); - }; - ParallelModel.prototype.mergeOption = function (newOption) { - var thisOption = this.option; - newOption && merge(thisOption, newOption, true); - this._initDimensions(); - }; - /** - * Whether series or axis is in this coordinate system. - */ - ParallelModel.prototype.contains = function (model, ecModel) { - var parallelIndex = model.get('parallelIndex'); - return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this; - }; - ParallelModel.prototype.setAxisExpand = function (opt) { - each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) { - if (opt.hasOwnProperty(name)) { - // @ts-ignore FIXME: why "never" inferred in this.option[name]? - this.option[name] = opt[name]; - } - }, this); - }; - ParallelModel.prototype._initDimensions = function () { - var dimensions = this.dimensions = []; - var parallelAxisIndex = this.parallelAxisIndex = []; - var axisModels = filter(this.ecModel.queryComponents({ - mainType: 'parallelAxis' - }), function (axisModel) { - // Can not use this.contains here, because - // initialization has not been completed yet. - return (axisModel.get('parallelIndex') || 0) === this.componentIndex; - }, this); - each(axisModels, function (axisModel) { - dimensions.push('dim' + axisModel.get('dim')); - parallelAxisIndex.push(axisModel.componentIndex); - }); - }; - ParallelModel.type = 'parallel'; - ParallelModel.dependencies = ['parallelAxis']; - ParallelModel.layoutMode = 'box'; - ParallelModel.defaultOption = { - // zlevel: 0, - z: 0, - left: 80, - top: 60, - right: 80, - bottom: 60, - // width: {totalWidth} - left - right, - // height: {totalHeight} - top - bottom, - layout: 'horizontal', - // FIXME - // naming? - axisExpandable: false, - axisExpandCenter: null, - axisExpandCount: 0, - axisExpandWidth: 50, - axisExpandRate: 17, - axisExpandDebounce: 50, - // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full. - // Do not doc to user until necessary. - axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4], - axisExpandTriggerOn: 'click', - parallelAxisDefault: null - }; - return ParallelModel; - }(ComponentModel); - - var ParallelAxis = /** @class */function (_super) { - __extends(ParallelAxis, _super); - function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) { - var _this = _super.call(this, dim, scale, coordExtent) || this; - _this.type = axisType || 'value'; - _this.axisIndex = axisIndex; - return _this; - } - ParallelAxis.prototype.isHorizontal = function () { - return this.coordinateSystem.getModel().get('layout') !== 'horizontal'; - }; - return ParallelAxis; - }(Axis); - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 delta Move length. - * @param handleEnds handleEnds[0] can be bigger then handleEnds[1]. - * handleEnds will be modified in this method. - * @param extent handleEnds is restricted by extent. - * extent[0] should less or equals than extent[1]. - * @param handleIndex Can be 'all', means that both move the two handleEnds. - * @param 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 maxSpan The range of dataZoom can not be larger than that. - * @return The input handleEnds. - */ - function sliderMove(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; - 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. - 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)); - } - - var each$5 = each; - var mathMin$8 = Math.min; - var mathMax$8 = Math.max; - var mathFloor$1 = Math.floor; - var mathCeil$1 = Math.ceil; - var round$3 = round; - var PI$7 = Math.PI; - var Parallel = /** @class */function () { - function Parallel(parallelModel, ecModel, api) { - this.type = 'parallel'; - /** - * key: dimension - */ - this._axesMap = createHashMap(); - /** - * key: dimension - * value: {position: [], rotation, } - */ - this._axesLayout = {}; - this.dimensions = parallelModel.dimensions; - this._model = parallelModel; - this._init(parallelModel, ecModel, api); - } - Parallel.prototype._init = function (parallelModel, ecModel, api) { - var dimensions = parallelModel.dimensions; - var parallelAxisIndex = parallelModel.parallelAxisIndex; - each$5(dimensions, function (dim, idx) { - var axisIndex = parallelAxisIndex[idx]; - var axisModel = ecModel.getComponent('parallelAxis', axisIndex); - var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex)); - var isCategory = axis.type === 'category'; - axis.onBand = isCategory && axisModel.get('boundaryGap'); - axis.inverse = axisModel.get('inverse'); - // Injection - axisModel.axis = axis; - axis.model = axisModel; - axis.coordinateSystem = axisModel.coordinateSystem = this; - }, this); - }; - /** - * Update axis scale after data processed - */ - Parallel.prototype.update = function (ecModel, api) { - this._updateAxesFromSeries(this._model, ecModel); - }; - Parallel.prototype.containPoint = function (point) { - var layoutInfo = this._makeLayoutInfo(); - var axisBase = layoutInfo.axisBase; - var layoutBase = layoutInfo.layoutBase; - var pixelDimIndex = layoutInfo.pixelDimIndex; - var pAxis = point[1 - pixelDimIndex]; - var pLayout = point[pixelDimIndex]; - return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength; - }; - Parallel.prototype.getModel = function () { - return this._model; - }; - /** - * Update properties from series - */ - Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) { - ecModel.eachSeries(function (seriesModel) { - if (!parallelModel.contains(seriesModel, ecModel)) { - return; - } - var data = seriesModel.getData(); - each$5(this.dimensions, function (dim) { - var axis = this._axesMap.get(dim); - axis.scale.unionExtentFromData(data, data.mapDimension(dim)); - niceScaleExtent(axis.scale, axis.model); - }, this); - }, this); - }; - /** - * Resize the parallel coordinate system. - */ - Parallel.prototype.resize = function (parallelModel, api) { - this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - this._layoutAxes(); - }; - Parallel.prototype.getRect = function () { - return this._rect; - }; - Parallel.prototype._makeLayoutInfo = function () { - var parallelModel = this._model; - var rect = this._rect; - var xy = ['x', 'y']; - var wh = ['width', 'height']; - var layout = parallelModel.get('layout'); - var pixelDimIndex = layout === 'horizontal' ? 0 : 1; - var layoutLength = rect[wh[pixelDimIndex]]; - var layoutExtent = [0, layoutLength]; - var axisCount = this.dimensions.length; - var axisExpandWidth = restrict$1(parallelModel.get('axisExpandWidth'), layoutExtent); - var axisExpandCount = restrict$1(parallelModel.get('axisExpandCount') || 0, [0, axisCount]); - var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; - // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength], - // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow), - // where collapsed axes should be overlapped. - var axisExpandWindow = parallelModel.get('axisExpandWindow'); - var winSize; - if (!axisExpandWindow) { - winSize = restrict$1(axisExpandWidth * (axisExpandCount - 1), layoutExtent); - var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$1(axisCount / 2); - axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2]; - axisExpandWindow[1] = axisExpandWindow[0] + winSize; - } else { - winSize = restrict$1(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent); - axisExpandWindow[1] = axisExpandWindow[0] + winSize; - } - var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); - // Avoid axisCollapseWidth is too small. - axisCollapseWidth < 3 && (axisCollapseWidth = 0); - // Find the first and last indices > ewin[0] and < ewin[1]. - var winInnerIndices = [mathFloor$1(round$3(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil$1(round$3(axisExpandWindow[1] / axisExpandWidth, 1)) - 1]; - // Pos in ec coordinates. - var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0]; - return { - layout: layout, - pixelDimIndex: pixelDimIndex, - layoutBase: rect[xy[pixelDimIndex]], - layoutLength: layoutLength, - axisBase: rect[xy[1 - pixelDimIndex]], - axisLength: rect[wh[1 - pixelDimIndex]], - axisExpandable: axisExpandable, - axisExpandWidth: axisExpandWidth, - axisCollapseWidth: axisCollapseWidth, - axisExpandWindow: axisExpandWindow, - axisCount: axisCount, - winInnerIndices: winInnerIndices, - axisExpandWindow0Pos: axisExpandWindow0Pos - }; - }; - Parallel.prototype._layoutAxes = function () { - var rect = this._rect; - var axes = this._axesMap; - var dimensions = this.dimensions; - var layoutInfo = this._makeLayoutInfo(); - var layout = layoutInfo.layout; - axes.each(function (axis) { - var axisExtent = [0, layoutInfo.axisLength]; - var idx = axis.inverse ? 1 : 0; - axis.setExtent(axisExtent[idx], axisExtent[1 - idx]); - }); - each$5(dimensions, function (dim, idx) { - var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo); - var positionTable = { - horizontal: { - x: posInfo.position, - y: layoutInfo.axisLength - }, - vertical: { - x: 0, - y: posInfo.position - } - }; - var rotationTable = { - horizontal: PI$7 / 2, - vertical: 0 - }; - var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y]; - var rotation = rotationTable[layout]; - var transform = create$1(); - rotate(transform, transform, rotation); - translate(transform, transform, position); - // TODO - // tick layout info - // TODO - // update dimensions info based on axis order. - this._axesLayout[dim] = { - position: position, - rotation: rotation, - transform: transform, - axisNameAvailableWidth: posInfo.axisNameAvailableWidth, - axisLabelShow: posInfo.axisLabelShow, - nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth, - tickDirection: 1, - labelDirection: 1 - }; - }, this); - }; - /** - * Get axis by dim. - */ - Parallel.prototype.getAxis = function (dim) { - return this._axesMap.get(dim); - }; - /** - * Convert a dim value of a single item of series data to Point. - */ - Parallel.prototype.dataToPoint = function (value, dim) { - return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim); - }; - /** - * Travel data for one time, get activeState of each data item. - * @param start the start dataIndex that travel from. - * @param end the next dataIndex of the last dataIndex will be travel. - */ - Parallel.prototype.eachActiveState = function (data, callback, start, end) { - start == null && (start = 0); - end == null && (end = data.count()); - var axesMap = this._axesMap; - var dimensions = this.dimensions; - var dataDimensions = []; - var axisModels = []; - each(dimensions, function (axisDim) { - dataDimensions.push(data.mapDimension(axisDim)); - axisModels.push(axesMap.get(axisDim).model); - }); - var hasActiveSet = this.hasAxisBrushed(); - for (var dataIndex = start; dataIndex < end; dataIndex++) { - var activeState = void 0; - if (!hasActiveSet) { - activeState = 'normal'; - } else { - activeState = 'active'; - var values = data.getValues(dataDimensions, dataIndex); - for (var j = 0, lenj = dimensions.length; j < lenj; j++) { - var state = axisModels[j].getActiveState(values[j]); - if (state === 'inactive') { - activeState = 'inactive'; - break; - } - } - } - callback(activeState, dataIndex); - } - }; - /** - * Whether has any activeSet. - */ - Parallel.prototype.hasAxisBrushed = function () { - var dimensions = this.dimensions; - var axesMap = this._axesMap; - var hasActiveSet = false; - for (var j = 0, lenj = dimensions.length; j < lenj; j++) { - if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') { - hasActiveSet = true; - } - } - return hasActiveSet; - }; - /** - * Convert coords of each axis to Point. - * Return point. For example: [10, 20] - */ - Parallel.prototype.axisCoordToPoint = function (coord, dim) { - var axisLayout = this._axesLayout[dim]; - return applyTransform$1([coord, 0], axisLayout.transform); - }; - /** - * Get axis layout. - */ - Parallel.prototype.getAxisLayout = function (dim) { - return clone(this._axesLayout[dim]); - }; - /** - * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}. - */ - Parallel.prototype.getSlidedAxisExpandWindow = function (point) { - var layoutInfo = this._makeLayoutInfo(); - var pixelDimIndex = layoutInfo.pixelDimIndex; - var axisExpandWindow = layoutInfo.axisExpandWindow.slice(); - var winSize = axisExpandWindow[1] - axisExpandWindow[0]; - var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; - // Out of the area of coordinate system. - if (!this.containPoint(point)) { - return { - behavior: 'none', - axisExpandWindow: axisExpandWindow - }; - } - // Convert the point from global to expand coordinates. - var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; - // For dragging operation convenience, the window should not be - // slided when mouse is the center area of the window. - var delta; - var behavior = 'slide'; - var axisCollapseWidth = layoutInfo.axisCollapseWidth; - var triggerArea = this._model.get('axisExpandSlideTriggerArea'); - // But consider touch device, jump is necessary. - var useJump = triggerArea[0] != null; - if (axisCollapseWidth) { - if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) { - behavior = 'jump'; - delta = pointCoord - winSize * triggerArea[2]; - } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) { - behavior = 'jump'; - delta = pointCoord - winSize * (1 - triggerArea[2]); - } else { - (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0); - } - delta *= layoutInfo.axisExpandWidth / axisCollapseWidth; - delta ? sliderMove(delta, axisExpandWindow, extent, 'all') - // Avoid nonsense triger on mousemove. - : behavior = 'none'; - } - // When screen is too narrow, make it visible and slidable, although it is hard to interact. - else { - var winSize2 = axisExpandWindow[1] - axisExpandWindow[0]; - var pos = extent[1] * pointCoord / winSize2; - axisExpandWindow = [mathMax$8(0, pos - winSize2 / 2)]; - axisExpandWindow[1] = mathMin$8(extent[1], axisExpandWindow[0] + winSize2); - axisExpandWindow[0] = axisExpandWindow[1] - winSize2; - } - return { - axisExpandWindow: axisExpandWindow, - behavior: behavior - }; - }; - return Parallel; - }(); - function restrict$1(len, extent) { - return mathMin$8(mathMax$8(len, extent[0]), extent[1]); - } - function layoutAxisWithoutExpand(axisIndex, layoutInfo) { - var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1); - return { - position: step * axisIndex, - axisNameAvailableWidth: step, - axisLabelShow: true - }; - } - function layoutAxisWithExpand(axisIndex, layoutInfo) { - var layoutLength = layoutInfo.layoutLength; - var axisExpandWidth = layoutInfo.axisExpandWidth; - var axisCount = layoutInfo.axisCount; - var axisCollapseWidth = layoutInfo.axisCollapseWidth; - var winInnerIndices = layoutInfo.winInnerIndices; - var position; - var axisNameAvailableWidth = axisCollapseWidth; - var axisLabelShow = false; - var nameTruncateMaxWidth; - if (axisIndex < winInnerIndices[0]) { - position = axisIndex * axisCollapseWidth; - nameTruncateMaxWidth = axisCollapseWidth; - } else if (axisIndex <= winInnerIndices[1]) { - position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0]; - axisNameAvailableWidth = axisExpandWidth; - axisLabelShow = true; - } else { - position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth; - nameTruncateMaxWidth = axisCollapseWidth; - } - return { - position: position, - axisNameAvailableWidth: axisNameAvailableWidth, - axisLabelShow: axisLabelShow, - nameTruncateMaxWidth: nameTruncateMaxWidth - }; - } - - function createParallelCoordSys(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 = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0]; - seriesModel.coordinateSystem = parallelModel.coordinateSystem; - } - }); - return coordSysList; - } - var parallelCoordSysCreator = { - create: createParallelCoordSys - }; - - var ParallelAxisModel = /** @class */function (_super) { - __extends(ParallelAxisModel, _super); - function ParallelAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelAxisModel.type; - /** - * @readOnly - */ - _this.activeIntervals = []; - return _this; - } - ParallelAxisModel.prototype.getAreaSelectStyle = function () { - return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] - // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. - ])(this.getModel('areaSelectStyle')); - }; - /** - * The code of this feature is put on AxisModel but not ParallelAxis, - * because axisModel can be alive after echarts updating but instance of - * ParallelAxis having been disposed. this._activeInterval should be kept - * when action dispatched (i.e. legend click). - * - * @param intervals `interval.length === 0` means set all active. - */ - ParallelAxisModel.prototype.setActiveIntervals = function (intervals) { - var activeIntervals = this.activeIntervals = clone(intervals); - // Normalize - if (activeIntervals) { - for (var i = activeIntervals.length - 1; i >= 0; i--) { - asc(activeIntervals[i]); - } - } - }; - /** - * @param value When only attempting detect whether 'no activeIntervals set', - * `value` is not needed to be input. - */ - ParallelAxisModel.prototype.getActiveState = function (value) { - var activeIntervals = this.activeIntervals; - if (!activeIntervals.length) { - return 'normal'; - } - if (value == null || isNaN(+value)) { - return 'inactive'; - } - // Simple optimization - if (activeIntervals.length === 1) { - var interval = activeIntervals[0]; - if (interval[0] <= value && value <= interval[1]) { - return 'active'; - } - } else { - for (var i = 0, len = activeIntervals.length; i < len; i++) { - if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) { - return 'active'; - } - } - } - return 'inactive'; - }; - return ParallelAxisModel; - }(ComponentModel); - mixin(ParallelAxisModel, AxisModelCommonMixin); - - var BRUSH_PANEL_GLOBAL = true; - var mathMin$9 = Math.min; - var mathMax$9 = Math.max; - var mathPow$2 = 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(210,219,238,0.3)', - fill: '#D2DBEE' - }, - transformable: true, - brushMode: 'single', - removeOnClick: false - }; - var baseUID = 0; - /** - * params: - * areas: Array., coord relates to container group, - * If no container specified, to global. - * opt { - * isEnd: boolean, - * removeOnClick: boolean - * } - */ - var BrushController = /** @class */function (_super) { - __extends(BrushController, _super); - function BrushController(zr) { - var _this = _super.call(this) || this; - /** - * @internal - */ - _this._track = []; - /** - * @internal - */ - _this._covers = []; - _this._handlers = {}; - if ("development" !== 'production') { - assert(zr); - } - _this._zr = zr; - _this.group = new Group(); - _this._uid = 'brushController_' + baseUID++; - each(pointerHandlers, function (handler, eventName) { - this._handlers[eventName] = bind(handler, this); - }, _this); - return _this; - } - /** - * If set to `false`, select disabled. - */ - BrushController.prototype.enableBrush = function (brushOption) { - if ("development" !== 'production') { - assert(this._mounted); - } - this._brushType && this._doDisableBrush(); - brushOption.brushType && this._doEnableBrush(brushOption); - return this; - }; - BrushController.prototype._doEnableBrush = function (brushOption) { - var zr = this._zr; - // Consider roam, which takes globalPan too. - if (!this._enableGlobalPan) { - take(zr, MUTEX_RESOURCE_KEY, this._uid); - } - each(this._handlers, function (handler, eventName) { - zr.on(eventName, handler); - }); - this._brushType = brushOption.brushType; - this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); - }; - BrushController.prototype._doDisableBrush = function () { - var zr = this._zr; - release(zr, MUTEX_RESOURCE_KEY, this._uid); - each(this._handlers, function (handler, eventName) { - zr.off(eventName, handler); - }); - this._brushType = this._brushOption = null; - }; - /** - * @param panelOpts If not pass, it is global brush. - */ - BrushController.prototype.setPanels = function (panelOpts) { - if (panelOpts && panelOpts.length) { - var panels_1 = this._panels = {}; - each(panelOpts, function (panelOpts) { - panels_1[panelOpts.panelId] = clone(panelOpts); - }); - } else { - this._panels = null; - } - return this; - }; - BrushController.prototype.mount = function (opt) { - opt = opt || {}; - if ("development" !== 'production') { - this._mounted = true; // should be at first. - } - - this._enableGlobalPan = opt.enableGlobalPan; - var thisGroup = this.group; - this._zr.add(thisGroup); - thisGroup.attr({ - x: opt.x || 0, - y: opt.y || 0, - rotation: opt.rotation || 0, - scaleX: opt.scaleX || 1, - scaleY: opt.scaleY || 1 - }); - this._transform = thisGroup.getLocalTransform(); - return this; - }; - // eachCover(cb, context): void { - // each(this._covers, cb, context); - // } - /** - * Update covers. - * @param coverConfigList - * If coverConfigList is null/undefined, all covers removed. - */ - BrushController.prototype.updateCovers = function (coverConfigList) { - if ("development" !== 'production') { - assert(this._mounted); - } - coverConfigList = map(coverConfigList, function (coverConfig) { - return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true); - }); - var tmpIdPrefix = '\0-brush-index-'; - var oldCovers = this._covers; - var newCovers = this._covers = []; - var controller = this; - var creatingCover = this._creatingCover; - new DataDiffer(oldCovers, coverConfigList, 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 newBrushInternal = coverConfigList[newIndex]; - // Consider setOption in event listener of brushSelect, - // where updating cover when creating should be forbidden. - if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { - newCovers[newIndex] = oldCovers[oldIndex]; - } else { - var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal)); - updateCoverAfterCreation(controller, cover); - } - } - function remove(oldIndex) { - if (oldCovers[oldIndex] !== creatingCover) { - controller.group.remove(oldCovers[oldIndex]); - } - } - }; - BrushController.prototype.unmount = function () { - if ("development" !== 'production') { - if (!this._mounted) { - return; - } - } - this.enableBrush(false); - // container may 'removeAll' outside. - clearCovers(this); - this._zr.remove(this.group); - if ("development" !== 'production') { - this._mounted = false; // should be at last. - } - - return this; - }; - BrushController.prototype.dispose = function () { - this.unmount(); - this.off(); - }; - return BrushController; - }(Eventful); - 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 BRUSH_PANEL_GLOBAL; // 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 BRUSH_PANEL_GLOBAL; // 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] : BRUSH_PANEL_GLOBAL; - } - 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$1(controller, opt) { - var areas = map(controller._covers, function (cover) { - var brushOption = cover.__brushOption; - var range = clone(brushOption.range); - return { - brushType: brushOption.brushType, - panelId: brushOption.panelId, - range: range - }; - }); - controller.trigger('brush', { - areas: 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$2(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(rectRangeConverter, controller, brushOption, edgeNameSequences) { - var cover = new Group(); - cover.add(new Rect({ - name: 'main', - style: makeStyle(brushOption), - silent: true, - draggable: true, - cursor: 'move', - drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']), - ondragend: curry(trigger$1, controller, { - isEnd: true - }) - })); - each(edgeNameSequences, function (nameSequence) { - cover.add(new Rect({ - name: nameSequence.join(''), - style: { - opacity: 0 - }, - draggable: true, - silent: true, - invisible: true, - drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence), - ondragend: curry(trigger$1, controller, { - isEnd: true - }) - })); - }); - return cover; - } - function updateBaseRect(controller, cover, localRange, brushOption) { - var lineWidth = brushOption.brushStyle.lineWidth || 0; - var handleSize = mathMax$9(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'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) { - var el = cover.childOfName(nameSequence.join('')); - var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence); - 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 defaults({ - strokeNoScale: true - }, brushOption.brushStyle); - } - function formatRectRange(x, y, x2, y2) { - var min = [mathMin$9(x, x2), mathMin$9(y, y2)]; - var max = [mathMax$9(x, x2), mathMax$9(y, y2)]; - return [[min[0], max[0]], [min[1], max[1]] // y range - ]; - } - - function getTransform$1(controller) { - return getTransform(controller.group); - } - function getGlobalDirection1(controller, localDirName) { - var map = { - w: 'left', - e: 'right', - n: 'top', - s: 'bottom' - }; - var inverseMap = { - left: 'w', - right: 'e', - top: 'n', - bottom: 's' - }; - var dir = transformDirection(map[localDirName], getTransform$1(controller)); - return inverseMap[dir]; - } - function getGlobalDirection2(controller, localDirNameSeq) { - var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])]; - (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse(); - return globalDir.join(''); - } - function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) { - var brushOption = cover.__brushOption; - var rectRange = rectRangeConverter.toRectRange(brushOption.range); - var localDelta = toLocalDelta(controller, dx, dy); - each(dirNameSequence, function (dirName) { - var ind = DIRECTION_MAP[dirName]; - rectRange[ind[0]][ind[1]] += localDelta[ind[0]]; - }); - brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1])); - updateCoverAfterCreation(controller, cover); - trigger$1(controller, { - isEnd: false - }); - } - function driftPolygon(controller, cover, dx, dy) { - 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$1(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 !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data); - } - function pointsToRect(points) { - var xmin = mathMin$9(points[0][0], points[1][0]); - var ymin = mathMin$9(points[0][1], points[1][1]); - var xmax = mathMax$9(points[0][0], points[1][0]); - var ymax = mathMax$9(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.offsetX, e.offsetY)) { - 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 === BRUSH_PANEL_GLOBAL || 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 = clone(thisBrushOption); - brushOption.brushType = determineBrushType(brushOption.brushType, panel); - brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? 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') { - if ("development" !== 'production') { - assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is "atuo"'); - } - return panel.defaultBrushType; - } - return brushType; - } - var pointerHandlers = { - mousedown: function (e) { - if (this._dragging) { - // In case some browser do not support globalOut, - // and release mouse 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$1(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 should be at final, after procedure will be nested. - eventParams && trigger$1(controller, eventParams); - } - } - function isOutsideZrArea(controller, x, y) { - var zr = controller._zr; - return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight(); - } - /** - * key: brushType - */ - var coverRenderers = { - lineX: getLineRenderer(0), - lineY: getLineRenderer(1), - rect: { - createCover: function (controller, brushOption) { - function returnInput(range) { - return range; - } - return createBaseRectCover({ - toRectRange: returnInput, - fromRectRange: returnInput - }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]); - }, - 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 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 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 Polygon({ - name: 'main', - draggable: true, - drift: curry(driftPolygon, controller, cover), - ondragend: curry(trigger$1, 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({ - toRectRange: function (range) { - var rectRange = [range, [0, 100]]; - xyIndex && rectRange.reverse(); - return rectRange; - }, - fromRectRange: function (rectRange) { - return rectRange[xyIndex]; - } - }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]); - }, - getCreatingRange: function (localTrack) { - var ends = getTrackEnds(localTrack); - var min = mathMin$9(ends[0][xyIndex], ends[1][xyIndex]); - var max = mathMax$9(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 !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) { - otherExtent = panel.getLinearBrushOtherExtent(xyIndex); - } 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 - }; - } - - function makeRectPanelClipPath(rect) { - rect = normalizeRect(rect); - return function (localPoints) { - return clipPointsByRect(localPoints, rect); - }; - } - function makeLinearBrushOtherExtent(rect, specifiedXYIndex) { - rect = normalizeRect(rect); - return function (xyIndex) { - var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex; - var brushWidth = idx ? rect.width : rect.height; - var base = idx ? rect.x : rect.y; - return [base, base + (brushWidth || 0)]; - }; - } - function makeRectIsTargetByCursor(rect, api, targetModel) { - var boundingRect = normalizeRect(rect); - return function (e, localCursorPoint) { - return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel); - }; - } - // Consider width/height is negative. - function normalizeRect(rect) { - return BoundingRect.create(rect); - } - - var elementList = ['axisLine', 'axisTickLabel', 'axisName']; - var ParallelAxisView = /** @class */function (_super) { - __extends(ParallelAxisView, _super); - function ParallelAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelAxisView.type; - return _this; - } - ParallelAxisView.prototype.init = function (ecModel, api) { - _super.prototype.init.apply(this, arguments); - (this._brushController = new BrushController(api.getZr())).on('brush', bind(this._onBrush, this)); - }; - ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) { - if (fromAxisAreaSelect(axisModel, ecModel, payload)) { - return; - } - this.axisModel = axisModel; - this.api = api; - this.group.removeAll(); - var oldAxisGroup = this._axisGroup; - this._axisGroup = new Group(); - this.group.add(this._axisGroup); - if (!axisModel.get('show')) { - return; - } - var coordSysModel = getCoordSysModel(axisModel, ecModel); - var coordSys = coordSysModel.coordinateSystem; - var areaSelectStyle = axisModel.getAreaSelectStyle(); - var areaWidth = areaSelectStyle.width; - var dim = axisModel.axis.dim; - var axisLayout = coordSys.getAxisLayout(dim); - var builderOpt = extend({ - strokeContainThreshold: areaWidth - }, axisLayout); - var axisBuilder = new AxisBuilder(axisModel, builderOpt); - each(elementList, axisBuilder.add, axisBuilder); - this._axisGroup.add(axisBuilder.getGroup()); - this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api); - groupTransition(oldAxisGroup, this._axisGroup, axisModel); - }; - // /** - // * @override - // */ - // updateVisual(axisModel, ecModel, api, payload) { - // this._brushController && this._brushController - // .updateCovers(getCoverInfoList(axisModel)); - // } - ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) { - // After filtering, axis may change, select area needs to be update. - var extent = axisModel.axis.getExtent(); - var extentLen = extent[1] - extent[0]; - var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value. - // width/height might be negative, which will be - // normalized in BoundingRect. - var rect = BoundingRect.create({ - x: extent[0], - y: -areaWidth / 2, - width: extentLen, - height: areaWidth - }); - rect.x -= extra; - rect.width += 2 * extra; - this._brushController.mount({ - enableGlobalPan: true, - rotation: builderOpt.rotation, - x: builderOpt.position[0], - y: builderOpt.position[1] - }).setPanels([{ - panelId: 'pl', - clipPath: makeRectPanelClipPath(rect), - isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel), - getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0) - }]).enableBrush({ - brushType: 'lineX', - brushStyle: areaSelectStyle, - removeOnClick: true - }).updateCovers(getCoverInfoList(axisModel)); - }; - ParallelAxisView.prototype._onBrush = function (eventParam) { - var coverInfoList = eventParam.areas; - // Do not cache these object, because the mey be changed. - var axisModel = this.axisModel; - var axis = axisModel.axis; - var intervals = map(coverInfoList, function (coverInfo) { - return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)]; - }); - // If realtime is true, action is not dispatched on drag end, because - // the drag end emits the same params with the last drag move event, - // and may have some delay when using touch pad. - if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) { - // jshint ignore:line - this.api.dispatchAction({ - type: 'axisAreaSelect', - parallelAxisId: axisModel.id, - intervals: intervals - }); - } - }; - ParallelAxisView.prototype.dispose = function () { - this._brushController.dispose(); - }; - ParallelAxisView.type = 'parallelAxis'; - return ParallelAxisView; - }(ComponentView); - function fromAxisAreaSelect(axisModel, ecModel, payload) { - return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({ - mainType: 'parallelAxis', - query: payload - })[0] === axisModel; - } - function getCoverInfoList(axisModel) { - var axis = axisModel.axis; - return map(axisModel.activeIntervals, function (interval) { - return { - brushType: 'lineX', - panelId: 'pl', - range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)] - }; - }); - } - function getCoordSysModel(axisModel, ecModel) { - return ecModel.getComponent('parallel', axisModel.get('parallelIndex')); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - var actionInfo$1 = { - type: 'axisAreaSelect', - event: 'axisAreaSelected' - // update: 'updateVisual' - }; - - function installParallelActions(registers) { - registers.registerAction(actionInfo$1, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'parallelAxis', - query: payload - }, function (parallelAxisModel) { - parallelAxisModel.axis.model.setActiveIntervals(payload.intervals); - }); - }); - /** - * @payload - */ - registers.registerAction('parallelAxisExpand', function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'parallel', - query: payload - }, function (parallelModel) { - parallelModel.setAxisExpand(payload); - }); - }); - } - - var defaultAxisOption = { - type: 'value', - areaSelectStyle: { - width: 20, - borderWidth: 1, - borderColor: 'rgba(160,197,232)', - color: 'rgba(160,197,232)', - opacity: 0.3 - }, - realtime: true, - z: 10 - }; - function install$g(registers) { - registers.registerComponentView(ParallelView$1); - registers.registerComponentModel(ParallelModel); - registers.registerCoordinateSystem('parallel', parallelCoordSysCreator); - registers.registerPreprocessor(parallelPreprocessor); - registers.registerComponentModel(ParallelAxisModel); - registers.registerComponentView(ParallelAxisView); - axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption); - installParallelActions(registers); - } - - function install$h(registers) { - use(install$g); - registers.registerChartView(ParallelView); - registers.registerSeriesModel(ParallelSeriesModel); - registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual); - } - - var SankeyPathShape = /** @class */function () { - function SankeyPathShape() { - this.x1 = 0; - this.y1 = 0; - this.x2 = 0; - this.y2 = 0; - this.cpx1 = 0; - this.cpy1 = 0; - this.cpx2 = 0; - this.cpy2 = 0; - this.extent = 0; - } - return SankeyPathShape; - }(); - var SankeyPath = /** @class */function (_super) { - __extends(SankeyPath, _super); - function SankeyPath(opts) { - return _super.call(this, opts) || this; - } - SankeyPath.prototype.getDefaultShape = function () { - return new SankeyPathShape(); - }; - SankeyPath.prototype.buildPath = function (ctx, shape) { - var extent = shape.extent; - ctx.moveTo(shape.x1, shape.y1); - ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2); - if (shape.orient === 'vertical') { - ctx.lineTo(shape.x2 + extent, shape.y2); - ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1); - } else { - ctx.lineTo(shape.x2, shape.y2 + extent); - ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent); - } - ctx.closePath(); - }; - SankeyPath.prototype.highlight = function () { - enterEmphasis(this); - }; - SankeyPath.prototype.downplay = function () { - leaveEmphasis(this); - }; - return SankeyPath; - }(Path); - var SankeyView = /** @class */function (_super) { - __extends(SankeyView, _super); - function SankeyView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SankeyView.type; - _this._focusAdjacencyDisabled = false; - return _this; - } - SankeyView.prototype.render = function (seriesModel, ecModel, api) { - var sankeyView = this; - var graph = seriesModel.getGraph(); - var group = this.group; - var layoutInfo = seriesModel.layoutInfo; - // view width - var width = layoutInfo.width; - // view height - var height = layoutInfo.height; - var nodeData = seriesModel.getData(); - var edgeData = seriesModel.getData('edge'); - var orient = seriesModel.get('orient'); - this._model = seriesModel; - group.removeAll(); - group.x = layoutInfo.x; - group.y = layoutInfo.y; - // generate a bezire Curve for each edge - graph.eachEdge(function (edge) { - var curve = new SankeyPath(); - var ecData = getECData(curve); - ecData.dataIndex = edge.dataIndex; - ecData.seriesIndex = seriesModel.seriesIndex; - ecData.dataType = 'edge'; - var edgeModel = edge.getModel(); - var lineStyleModel = edgeModel.getModel('lineStyle'); - var curvature = lineStyleModel.get('curveness'); - var n1Layout = edge.node1.getLayout(); - var node1Model = edge.node1.getModel(); - var dragX1 = node1Model.get('localX'); - var dragY1 = node1Model.get('localY'); - var n2Layout = edge.node2.getLayout(); - var node2Model = edge.node2.getModel(); - var dragX2 = node2Model.get('localX'); - var dragY2 = node2Model.get('localY'); - var edgeLayout = edge.getLayout(); - var x1; - var y1; - var x2; - var y2; - var cpx1; - var cpy1; - var cpx2; - var cpy2; - curve.shape.extent = Math.max(1, edgeLayout.dy); - curve.shape.orient = orient; - if (orient === 'vertical') { - x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy; - y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy; - x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty; - y2 = dragY2 != null ? dragY2 * height : n2Layout.y; - cpx1 = x1; - cpy1 = y1 * (1 - curvature) + y2 * curvature; - cpx2 = x2; - cpy2 = y1 * curvature + y2 * (1 - curvature); - } else { - x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; - y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy; - x2 = dragX2 != null ? dragX2 * width : n2Layout.x; - y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty; - cpx1 = x1 * (1 - curvature) + x2 * curvature; - cpy1 = y1; - cpx2 = x1 * curvature + x2 * (1 - curvature); - cpy2 = y2; - } - curve.setShape({ - x1: x1, - y1: y1, - x2: x2, - y2: y2, - cpx1: cpx1, - cpy1: cpy1, - cpx2: cpx2, - cpy2: cpy2 - }); - curve.useStyle(lineStyleModel.getItemStyle()); - // Special color, use source node color or target node color - applyCurveStyle(curve.style, orient, edge); - var defaultEdgeLabelText = "" + edgeModel.get('value'); - var edgeLabelStateModels = getLabelStatesModels(edgeModel, 'edgeLabel'); - setLabelStyle(curve, edgeLabelStateModels, { - labelFetcher: { - getFormattedLabel: function (dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) { - return seriesModel.getFormattedLabel(dataIndex, stateName, 'edge', labelDimIndex, - // ensure edgeLabel formatter is provided - // to prevent the inheritance from `label.formatter` of the series - retrieve3(formatter, edgeLabelStateModels.normal && edgeLabelStateModels.normal.get('formatter'), defaultEdgeLabelText), extendParams); - } - }, - labelDataIndex: edge.dataIndex, - defaultText: defaultEdgeLabelText - }); - curve.setTextConfig({ - position: 'inside' - }); - var emphasisModel = edgeModel.getModel('emphasis'); - setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) { - var style = model.getItemStyle(); - applyCurveStyle(style, orient, edge); - return style; - }); - group.add(curve); - edgeData.setItemGraphicEl(edge.dataIndex, curve); - var focus = emphasisModel.get('focus'); - toggleHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus === 'trajectory' ? edge.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }); - // Generate a rect for each node - graph.eachNode(function (node) { - var layout = node.getLayout(); - var itemModel = node.getModel(); - var dragX = itemModel.get('localX'); - var dragY = itemModel.get('localY'); - var emphasisModel = itemModel.getModel('emphasis'); - var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0; - var rect = new Rect({ - shape: { - x: dragX != null ? dragX * width : layout.x, - y: dragY != null ? dragY * height : layout.y, - width: layout.dx, - height: layout.dy, - r: borderRadius - }, - style: itemModel.getModel('itemStyle').getItemStyle(), - z2: 10 - }); - setLabelStyle(rect, getLabelStatesModels(itemModel), { - labelFetcher: { - getFormattedLabel: function (dataIndex, stateName) { - return seriesModel.getFormattedLabel(dataIndex, stateName, 'node'); - } - }, - labelDataIndex: node.dataIndex, - defaultText: node.id - }); - rect.disableLabelAnimation = true; - rect.setStyle('fill', node.getVisual('color')); - rect.setStyle('decal', node.getVisual('style').decal); - setStatesStylesFromModel(rect, itemModel); - group.add(rect); - nodeData.setItemGraphicEl(node.dataIndex, rect); - getECData(rect).dataType = 'node'; - var focus = emphasisModel.get('focus'); - toggleHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus === 'trajectory' ? node.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }); - nodeData.eachItemGraphicEl(function (el, dataIndex) { - var itemModel = nodeData.getItemModel(dataIndex); - if (itemModel.get('draggable')) { - el.drift = function (dx, dy) { - sankeyView._focusAdjacencyDisabled = true; - this.shape.x += dx; - this.shape.y += dy; - this.dirty(); - api.dispatchAction({ - type: 'dragNode', - seriesId: seriesModel.id, - dataIndex: nodeData.getRawIndex(dataIndex), - localX: this.shape.x / width, - localY: this.shape.y / height - }); - }; - el.ondragend = function () { - sankeyView._focusAdjacencyDisabled = false; - }; - el.draggable = true; - el.cursor = 'move'; - } - }); - if (!this._data && seriesModel.isAnimationEnabled()) { - group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () { - group.removeClipPath(); - })); - } - this._data = seriesModel.getData(); - }; - SankeyView.prototype.dispose = function () {}; - SankeyView.type = 'sankey'; - return SankeyView; - }(ChartView); - /** - * Special color, use source node color or target node color - * @param curveProps curve's style to parse - * @param orient direction - * @param edge current curve data - */ - function applyCurveStyle(curveProps, orient, edge) { - switch (curveProps.fill) { - case 'source': - curveProps.fill = edge.node1.getVisual('color'); - curveProps.decal = edge.node1.getVisual('style').decal; - break; - case 'target': - curveProps.fill = edge.node2.getVisual('color'); - curveProps.decal = edge.node2.getVisual('style').decal; - break; - case 'gradient': - var sourceColor = edge.node1.getVisual('color'); - var targetColor = edge.node2.getVisual('color'); - if (isString(sourceColor) && isString(targetColor)) { - curveProps.fill = new LinearGradient(0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{ - color: sourceColor, - offset: 0 - }, { - color: targetColor, - offset: 1 - }]); - } - } - } - // Add animation to the view - function createGridClipShape$1(rect, seriesModel, cb) { - var rectEl = new Rect({ - shape: { - x: rect.x - 10, - y: rect.y - 10, - width: 0, - height: rect.height + 20 - } - }); - initProps(rectEl, { - shape: { - width: rect.width + 20 - } - }, seriesModel, cb); - return rectEl; - } - - var SankeySeriesModel = /** @class */function (_super) { - __extends(SankeySeriesModel, _super); - function SankeySeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SankeySeriesModel.type; - return _this; - } - /** - * Init a graph data structure from data in option series - */ - SankeySeriesModel.prototype.getInitialData = function (option, ecModel) { - var links = option.edges || option.links; - var nodes = option.data || option.nodes; - var levels = option.levels; - this.levelModels = []; - 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 ("development" !== 'production') { - throw new Error('levels[i].depth is mandatory and should be natural number'); - } - } - } - if (nodes && links) { - var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink); - return graph.data; - } - function beforeLink(nodeData, edgeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var seriesModel = model.parentModel; - var layout = seriesModel.getData().getItemLayout(idx); - if (layout) { - var nodeDepth = layout.depth; - var levelModel = seriesModel.levelModels[nodeDepth]; - if (levelModel) { - model.parentModel = levelModel; - } - } - return model; - }); - edgeData.wrapMethod('getItemModel', function (model, idx) { - var seriesModel = model.parentModel; - var edge = seriesModel.getGraph().getEdgeByIndex(idx); - var layout = edge.node1.getLayout(); - if (layout) { - var depth = layout.depth; - var levelModel = seriesModel.levelModels[depth]; - if (levelModel) { - model.parentModel = levelModel; - } - } - return model; - }); - } - }; - SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) { - var nodes = this.option.data || this.option.nodes; - var dataItem = nodes[dataIndex]; - dataItem.localX = localPosition[0]; - dataItem.localY = localPosition[1]; - }; - /** - * Return the graphic data structure - * - * @return graphic data structure - */ - SankeySeriesModel.prototype.getGraph = function () { - return this.getData().graph; - }; - /** - * Get edge data of graphic data structure - * - * @return data structure of list - */ - SankeySeriesModel.prototype.getEdgeData = function () { - return this.getGraph().edgeData; - }; - SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - function noValue(val) { - return isNaN(val) || val == null; - } - // dataType === 'node' or empty do not show tooltip by default - if (dataType === 'edge') { - var params = this.getDataParams(dataIndex, dataType); - var rawDataOpt = params.data; - var edgeValue = params.value; - var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target; - return createTooltipMarkup('nameValue', { - name: edgeName, - value: edgeValue, - noValue: noValue(edgeValue) - }); - } - // dataType === 'node' - else { - var node = this.getGraph().getNodeByIndex(dataIndex); - var value = node.getLayout().value; - var name_1 = this.getDataParams(dataIndex, dataType).data.name; - return createTooltipMarkup('nameValue', { - name: name_1 != null ? name_1 + '' : null, - value: value, - noValue: noValue(value) - }); - } - }; - SankeySeriesModel.prototype.optionUpdated = function () {}; - // Override Series.getDataParams() - SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) { - var params = _super.prototype.getDataParams.call(this, dataIndex, dataType); - if (params.value == null && dataType === 'node') { - var node = this.getGraph().getNodeByIndex(dataIndex); - var nodeValue = node.getLayout().value; - params.value = nodeValue; - } - return params; - }; - SankeySeriesModel.type = 'series.sankey'; - SankeySeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'view', - left: '5%', - top: '5%', - right: '20%', - bottom: '5%', - orient: 'horizontal', - nodeWidth: 20, - nodeGap: 8, - draggable: true, - layoutIterations: 32, - label: { - show: true, - position: 'right', - fontSize: 12 - }, - edgeLabel: { - show: false, - fontSize: 12 - }, - levels: [], - nodeAlign: 'justify', - lineStyle: { - color: '#314656', - opacity: 0.2, - curveness: 0.5 - }, - emphasis: { - label: { - show: true - }, - lineStyle: { - opacity: 0.5 - } - }, - select: { - itemStyle: { - borderColor: '#212121' - } - }, - animationEasing: 'linear', - animationDuration: 1000 - }; - return SankeySeriesModel; - }(SeriesModel); - - function sankeyLayout(ecModel, api) { - ecModel.eachSeriesByType('sankey', function (seriesModel) { - var nodeWidth = seriesModel.get('nodeWidth'); - var nodeGap = seriesModel.get('nodeGap'); - var layoutInfo = getViewRect$4(seriesModel, api); - seriesModel.layoutInfo = layoutInfo; - var width = layoutInfo.width; - var height = layoutInfo.height; - var graph = seriesModel.getGraph(); - var nodes = graph.nodes; - var edges = graph.edges; - computeNodeValues(nodes); - var filteredNodes = filter(nodes, function (node) { - return node.getLayout().value === 0; - }); - var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations'); - var orient = seriesModel.get('orient'); - var nodeAlign = seriesModel.get('nodeAlign'); - layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign); - }); - } - /** - * Get the layout position of the whole view - */ - function getViewRect$4(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - } - function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) { - computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign); - computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient); - computeEdgeDepths(nodes, orient); - } - /** - * Compute the value of each node by summing the associated edge's value - */ - function computeNodeValues(nodes) { - each(nodes, function (node) { - var value1 = sum(node.outEdges, getEdgeValue); - var value2 = sum(node.inEdges, getEdgeValue); - var nodeRawValue = node.getValue() || 0; - var value = Math.max(value1, value2, nodeRawValue); - node.setLayout({ - value: value - }, true); - }); - } - /** - * Compute the x-position for each node. - * - * Here we use Kahn algorithm to detect cycle when we traverse - * the node to computer the initial x position. - */ - function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { - // Used to mark whether the edge is deleted. if it is deleted, - // the value is 0, otherwise it is 1. - var remainEdges = []; - // Storage each node's indegree. - var indegreeArr = []; - // Used to storage the node with indegree is equal to 0. - var zeroIndegrees = []; - var nextTargetNode = []; - var x = 0; - // let kx = 0; - for (var i = 0; i < edges.length; i++) { - remainEdges[i] = 1; - } - for (var i = 0; i < nodes.length; i++) { - indegreeArr[i] = nodes[i].inEdges.length; - if (indegreeArr[i] === 0) { - zeroIndegrees.push(nodes[i]); - } - } - var maxNodeDepth = -1; - // Traversing nodes using topological sorting to calculate the - // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical') - // position of the nodes. - while (zeroIndegrees.length) { - for (var idx = 0; idx < zeroIndegrees.length; idx++) { - var node = zeroIndegrees[idx]; - var item = node.hostGraph.data.getRawDataItem(node.dataIndex); - var isItemDepth = item.depth != null && item.depth >= 0; - if (isItemDepth && item.depth > maxNodeDepth) { - maxNodeDepth = item.depth; - } - node.setLayout({ - depth: isItemDepth ? item.depth : x - }, true); - orient === 'vertical' ? node.setLayout({ - dy: nodeWidth - }, true) : node.setLayout({ - dx: nodeWidth - }, true); - for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) { - var edge = node.outEdges[edgeIdx]; - var indexEdge = edges.indexOf(edge); - remainEdges[indexEdge] = 0; - var targetNode = edge.node2; - var nodeIndex = nodes.indexOf(targetNode); - if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) { - nextTargetNode.push(targetNode); - } - } - } - ++x; - zeroIndegrees = nextTargetNode; - nextTargetNode = []; - } - for (var i = 0; i < remainEdges.length; i++) { - if (remainEdges[i] === 1) { - throw new Error('Sankey is a DAG, the original data has cycle!'); - } - } - var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; - if (nodeAlign && nodeAlign !== 'left') { - adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth); - } - var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth; - scaleNodeBreadths(nodes, kx, orient); - } - function isNodeDepth(node) { - var item = node.hostGraph.data.getRawDataItem(node.dataIndex); - return item.depth != null && item.depth >= 0; - } - function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) { - if (nodeAlign === 'right') { - var nextSourceNode = []; - var remainNodes = nodes; - var nodeHeight = 0; - while (remainNodes.length) { - for (var i = 0; i < remainNodes.length; i++) { - var node = remainNodes[i]; - node.setLayout({ - skNodeHeight: nodeHeight - }, true); - for (var j = 0; j < node.inEdges.length; j++) { - var edge = node.inEdges[j]; - if (nextSourceNode.indexOf(edge.node1) < 0) { - nextSourceNode.push(edge.node1); - } - } - } - remainNodes = nextSourceNode; - nextSourceNode = []; - ++nodeHeight; - } - each(nodes, function (node) { - if (!isNodeDepth(node)) { - node.setLayout({ - depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight) - }, true); - } - }); - } else if (nodeAlign === 'justify') { - moveSinksRight(nodes, maxDepth); - } - } - /** - * All the node without outEgdes are assigned maximum x-position and - * be aligned in the last column. - * - * @param nodes. node of sankey view. - * @param maxDepth. use to assign to node without outEdges as x-position. - */ - function moveSinksRight(nodes, maxDepth) { - each(nodes, function (node) { - if (!isNodeDepth(node) && !node.outEdges.length) { - node.setLayout({ - depth: maxDepth - }, true); - } - }); - } - /** - * Scale node x-position to the width - * - * @param nodes node of sankey view - * @param kx multiple used to scale nodes - */ - function scaleNodeBreadths(nodes, kx, orient) { - each(nodes, function (node) { - var nodeDepth = node.getLayout().depth * kx; - orient === 'vertical' ? node.setLayout({ - y: nodeDepth - }, true) : node.setLayout({ - x: nodeDepth - }, true); - }); - } - /** - * Using Gauss-Seidel iterations method to compute the node depth(y-position) - * - * @param nodes node of sankey view - * @param edges edge of sankey view - * @param height the whole height of the area to draw the view - * @param nodeGap the vertical distance between two nodes - * in the same column. - * @param iterations the number of iterations for the algorithm - */ - function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) { - var nodesByBreadth = prepareNodesByBreadth(nodes, orient); - initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient); - resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); - for (var alpha = 1; iterations > 0; iterations--) { - // 0.99 is a experience parameter, ensure that each iterations of - // changes as small as possible. - alpha *= 0.99; - relaxRightToLeft(nodesByBreadth, alpha, orient); - resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); - relaxLeftToRight(nodesByBreadth, alpha, orient); - resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); - } - } - function prepareNodesByBreadth(nodes, orient) { - var nodesByBreadth = []; - var keyAttr = orient === 'vertical' ? 'y' : 'x'; - var groupResult = groupData(nodes, function (node) { - return node.getLayout()[keyAttr]; - }); - groupResult.keys.sort(function (a, b) { - return a - b; - }); - each(groupResult.keys, function (key) { - nodesByBreadth.push(groupResult.buckets.get(key)); - }); - return nodesByBreadth; - } - /** - * Compute the original y-position for each node - */ - function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) { - var minKy = Infinity; - each(nodesByBreadth, function (nodes) { - var n = nodes.length; - var sum = 0; - each(nodes, function (node) { - sum += node.getLayout().value; - }); - var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum; - if (ky < minKy) { - minKy = ky; - } - }); - each(nodesByBreadth, function (nodes) { - each(nodes, function (node, i) { - var nodeDy = node.getLayout().value * minKy; - if (orient === 'vertical') { - node.setLayout({ - x: i - }, true); - node.setLayout({ - dx: nodeDy - }, true); - } else { - node.setLayout({ - y: i - }, true); - node.setLayout({ - dy: nodeDy - }, true); - } - }); - }); - each(edges, function (edge) { - var edgeDy = +edge.getValue() * minKy; - edge.setLayout({ - dy: edgeDy - }, true); - }); - } - /** - * Resolve the collision of initialized depth (y-position) - */ - function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { - var keyAttr = orient === 'vertical' ? 'x' : 'y'; - each(nodesByBreadth, function (nodes) { - nodes.sort(function (a, b) { - return a.getLayout()[keyAttr] - b.getLayout()[keyAttr]; - }); - var nodeX; - var node; - var dy; - var y0 = 0; - var n = nodes.length; - var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy'; - for (var i = 0; i < n; i++) { - node = nodes[i]; - dy = y0 - node.getLayout()[keyAttr]; - if (dy > 0) { - nodeX = node.getLayout()[keyAttr] + dy; - orient === 'vertical' ? node.setLayout({ - x: nodeX - }, true) : node.setLayout({ - y: nodeX - }, true); - } - y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap; - } - var viewWidth = orient === 'vertical' ? width : height; - // If the bottommost node goes outside the bounds, push it back up - dy = y0 - nodeGap - viewWidth; - if (dy > 0) { - nodeX = node.getLayout()[keyAttr] - dy; - orient === 'vertical' ? node.setLayout({ - x: nodeX - }, true) : node.setLayout({ - y: nodeX - }, true); - y0 = nodeX; - for (var i = n - 2; i >= 0; --i) { - node = nodes[i]; - dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0; - if (dy > 0) { - nodeX = node.getLayout()[keyAttr] - dy; - orient === 'vertical' ? node.setLayout({ - x: nodeX - }, true) : node.setLayout({ - y: nodeX - }, true); - } - y0 = node.getLayout()[keyAttr]; - } - } - }); - } - /** - * Change the y-position of the nodes, except most the right side nodes - * @param nodesByBreadth - * @param alpha parameter used to adjust the nodes y-position - */ - function relaxRightToLeft(nodesByBreadth, alpha, orient) { - each(nodesByBreadth.slice().reverse(), function (nodes) { - each(nodes, function (node) { - if (node.outEdges.length) { - var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue); - if (isNaN(y)) { - var len = node.outEdges.length; - y = len ? sum(node.outEdges, centerTarget, orient) / len : 0; - } - if (orient === 'vertical') { - var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; - node.setLayout({ - x: nodeX - }, true); - } else { - var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; - node.setLayout({ - y: nodeY - }, true); - } - } - }); - }); - } - function weightedTarget(edge, orient) { - return center$1(edge.node2, orient) * edge.getValue(); - } - function centerTarget(edge, orient) { - return center$1(edge.node2, orient); - } - function weightedSource(edge, orient) { - return center$1(edge.node1, orient) * edge.getValue(); - } - function centerSource(edge, orient) { - return center$1(edge.node1, orient); - } - function center$1(node, orient) { - return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2; - } - function getEdgeValue(edge) { - return edge.getValue(); - } - function sum(array, cb, orient) { - var sum = 0; - var len = array.length; - var i = -1; - while (++i < len) { - var value = +cb(array[i], orient); - if (!isNaN(value)) { - sum += value; - } - } - return sum; - } - /** - * Change the y-position of the nodes, except most the left side nodes - */ - function relaxLeftToRight(nodesByBreadth, alpha, orient) { - each(nodesByBreadth, function (nodes) { - each(nodes, function (node) { - if (node.inEdges.length) { - var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue); - if (isNaN(y)) { - var len = node.inEdges.length; - y = len ? sum(node.inEdges, centerSource, orient) / len : 0; - } - if (orient === 'vertical') { - var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; - node.setLayout({ - x: nodeX - }, true); - } else { - var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; - node.setLayout({ - y: nodeY - }, true); - } - } - }); - }); - } - /** - * Compute the depth(y-position) of each edge - */ - function computeEdgeDepths(nodes, orient) { - var keyAttr = orient === 'vertical' ? 'x' : 'y'; - each(nodes, function (node) { - node.outEdges.sort(function (a, b) { - return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr]; - }); - node.inEdges.sort(function (a, b) { - return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr]; - }); - }); - each(nodes, function (node) { - var sy = 0; - var ty = 0; - each(node.outEdges, function (edge) { - edge.setLayout({ - sy: sy - }, true); - sy += edge.getLayout().dy; - }); - each(node.inEdges, function (edge) { - edge.setLayout({ - ty: ty - }, true); - ty += edge.getLayout().dy; - }); - }); - } - - function sankeyVisual(ecModel) { - ecModel.eachSeriesByType('sankey', function (seriesModel) { - var graph = seriesModel.getGraph(); - var nodes = graph.nodes; - var edges = graph.edges; - if (nodes.length) { - var minValue_1 = Infinity; - var maxValue_1 = -Infinity; - each(nodes, function (node) { - var nodeValue = node.getLayout().value; - if (nodeValue < minValue_1) { - minValue_1 = nodeValue; - } - if (nodeValue > maxValue_1) { - maxValue_1 = nodeValue; - } - }); - each(nodes, function (node) { - var mapping = new VisualMapping({ - type: 'color', - mappingMethod: 'linear', - dataExtent: [minValue_1, maxValue_1], - visual: seriesModel.get('color') - }); - var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); - var customColor = node.getModel().get(['itemStyle', 'color']); - if (customColor != null) { - node.setVisual('color', customColor); - node.setVisual('style', { - fill: customColor - }); - } else { - node.setVisual('color', mapValueToColor); - node.setVisual('style', { - fill: mapValueToColor - }); - } - }); - } - if (edges.length) { - each(edges, function (edge) { - var edgeStyle = edge.getModel().get('lineStyle'); - edge.setVisual('style', edgeStyle); - }); - } - }); - } - - function install$i(registers) { - registers.registerChartView(SankeyView); - registers.registerSeriesModel(SankeySeriesModel); - registers.registerLayout(sankeyLayout); - registers.registerVisual(sankeyVisual); - registers.registerAction({ - type: 'dragNode', - event: 'dragnode', - // here can only use 'update' now, other value is not support in echarts. - update: 'update' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'sankey', - query: payload - }, function (seriesModel) { - seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]); - }); - }); - } - - var WhiskerBoxCommonMixin = /** @class */function () { - function WhiskerBoxCommonMixin() {} - /** - * @override - */ - WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) { - // When both types of xAxis and yAxis are 'value', layout is - // needed to be specified by user. Otherwise, layout can be - // judged by which axis is category. - var ordinalMeta; - var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex')); - var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex')); - var xAxisType = xAxisModel.get('type'); - var yAxisType = yAxisModel.get('type'); - var addOrdinal; - // FIXME - // Consider time axis. - if (xAxisType === 'category') { - option.layout = 'horizontal'; - ordinalMeta = xAxisModel.getOrdinalMeta(); - addOrdinal = true; - } else if (yAxisType === 'category') { - option.layout = 'vertical'; - ordinalMeta = yAxisModel.getOrdinalMeta(); - addOrdinal = true; - } else { - option.layout = option.layout || 'horizontal'; - } - var coordDims = ['x', 'y']; - var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1; - var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex]; - var otherAxisDim = coordDims[1 - baseAxisDimIndex]; - var axisModels = [xAxisModel, yAxisModel]; - var baseAxisType = axisModels[baseAxisDimIndex].get('type'); - var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type'); - var data = option.data; - // Clone a new data for next setOption({}) usage. - // Avoid modifying current data will affect further update. - if (data && addOrdinal) { - var newOptionData_1 = []; - each(data, function (item, index) { - var newItem; - if (isArray(item)) { - newItem = item.slice(); - // Modify current using data. - item.unshift(index); - } else if (isArray(item.value)) { - newItem = extend({}, item); - newItem.value = newItem.value.slice(); - // Modify current using data. - item.value.unshift(index); - } else { - newItem = item; - } - newOptionData_1.push(newItem); - }); - option.data = newOptionData_1; - } - var defaultValueDimensions = this.defaultValueDimensions; - var coordDimensions = [{ - name: baseAxisDim, - type: getDimensionTypeByAxis(baseAxisType), - ordinalMeta: ordinalMeta, - otherDims: { - tooltip: false, - itemName: 0 - }, - dimsDef: ['base'] - }, { - name: otherAxisDim, - type: getDimensionTypeByAxis(otherAxisType), - dimsDef: defaultValueDimensions.slice() - }]; - return createSeriesDataSimply(this, { - coordDimensions: coordDimensions, - dimensionsCount: defaultValueDimensions.length + 1, - encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this) - }); - }; - /** - * If horizontal, base axis is x, otherwise y. - * @override - */ - WhiskerBoxCommonMixin.prototype.getBaseAxis = function () { - var dim = this._baseAxisDim; - return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis; - }; - return WhiskerBoxCommonMixin; - }(); - - var BoxplotSeriesModel = /** @class */function (_super) { - __extends(BoxplotSeriesModel, _super); - function BoxplotSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BoxplotSeriesModel.type; - // TODO - // box width represents group size, so dimension should have 'size'. - /** - * @see - * The meanings of 'min' and 'max' depend on user, - * and echarts do not need to know it. - * @readOnly - */ - _this.defaultValueDimensions = [{ - name: 'min', - defaultTooltip: true - }, { - name: 'Q1', - defaultTooltip: true - }, { - name: 'median', - defaultTooltip: true - }, { - name: 'Q3', - defaultTooltip: true - }, { - name: 'max', - defaultTooltip: true - }]; - _this.visualDrawType = 'stroke'; - return _this; - } - BoxplotSeriesModel.type = 'series.boxplot'; - BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid']; - BoxplotSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - layout: null, - boxWidth: [7, 50], - itemStyle: { - color: '#fff', - borderWidth: 1 - }, - emphasis: { - scale: true, - itemStyle: { - borderWidth: 2, - shadowBlur: 5, - shadowOffsetX: 1, - shadowOffsetY: 1, - shadowColor: 'rgba(0,0,0,0.2)' - } - }, - animationDuration: 800 - }; - return BoxplotSeriesModel; - }(SeriesModel); - mixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true); - - var BoxplotView = /** @class */function (_super) { - __extends(BoxplotView, _super); - function BoxplotView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BoxplotView.type; - return _this; - } - BoxplotView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var group = this.group; - var oldData = this._data; - // 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(); - } - var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0; - data.diff(oldData).add(function (newIdx) { - if (data.hasValue(newIdx)) { - var itemLayout = data.getItemLayout(newIdx); - var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true); - data.setItemGraphicEl(newIdx, symbolEl); - group.add(symbolEl); - } - }).update(function (newIdx, oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); - // Empty data - if (!data.hasValue(newIdx)) { - group.remove(symbolEl); - return; - } - var itemLayout = data.getItemLayout(newIdx); - if (!symbolEl) { - symbolEl = createNormalBox(itemLayout, data, newIdx, constDim); - } else { - saveOldStyle(symbolEl); - updateNormalBoxData(itemLayout, symbolEl, data, newIdx); - } - group.add(symbolEl); - data.setItemGraphicEl(newIdx, symbolEl); - }).remove(function (oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); - el && group.remove(el); - }).execute(); - this._data = data; - }; - BoxplotView.prototype.remove = function (ecModel) { - var group = this.group; - var data = this._data; - this._data = null; - data && data.eachItemGraphicEl(function (el) { - el && group.remove(el); - }); - }; - BoxplotView.type = 'boxplot'; - return BoxplotView; - }(ChartView); - var BoxPathShape = /** @class */function () { - function BoxPathShape() {} - return BoxPathShape; - }(); - var BoxPath = /** @class */function (_super) { - __extends(BoxPath, _super); - function BoxPath(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'boxplotBoxPath'; - return _this; - } - BoxPath.prototype.getDefaultShape = function () { - return new BoxPathShape(); - }; - BoxPath.prototype.buildPath = function (ctx, shape) { - var ends = shape.points; - var i = 0; - ctx.moveTo(ends[i][0], ends[i][1]); - i++; - for (; i < 4; i++) { - ctx.lineTo(ends[i][0], ends[i][1]); - } - ctx.closePath(); - for (; i < ends.length; i++) { - ctx.moveTo(ends[i][0], ends[i][1]); - i++; - ctx.lineTo(ends[i][0], ends[i][1]); - } - }; - return BoxPath; - }(Path); - function createNormalBox(itemLayout, data, dataIndex, constDim, isInit) { - var ends = itemLayout.ends; - var el = new BoxPath({ - shape: { - points: isInit ? transInit(ends, constDim, itemLayout) : ends - } - }); - updateNormalBoxData(itemLayout, el, data, dataIndex, isInit); - return el; - } - function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) { - var seriesModel = data.hostModel; - var updateMethod = graphic[isInit ? 'initProps' : 'updateProps']; - updateMethod(el, { - shape: { - points: itemLayout.ends - } - }, seriesModel, dataIndex); - el.useStyle(data.getItemVisual(dataIndex, 'style')); - el.style.strokeNoScale = true; - el.z2 = 100; - var itemModel = data.getItemModel(dataIndex); - var emphasisModel = itemModel.getModel('emphasis'); - setStatesStylesFromModel(el, itemModel); - toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - } - function transInit(points, dim, itemLayout) { - return map(points, function (point) { - point = point.slice(); - point[dim] = itemLayout.initBaseline; - return point; - }); - } - - var each$6 = each; - function boxplotLayout(ecModel) { - var groupResult = groupSeriesByAxis(ecModel); - each$6(groupResult, function (groupItem) { - var seriesModels = groupItem.seriesModels; - if (!seriesModels.length) { - return; - } - calculateBase(groupItem); - each$6(seriesModels, function (seriesModel, idx) { - layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]); - }); - }); - } - /** - * Group series by axis. - */ - function groupSeriesByAxis(ecModel) { - var result = []; - var axisList = []; - ecModel.eachSeriesByType('boxplot', function (seriesModel) { - var baseAxis = seriesModel.getBaseAxis(); - var idx = indexOf(axisList, baseAxis); - if (idx < 0) { - idx = axisList.length; - axisList[idx] = baseAxis; - result[idx] = { - axis: baseAxis, - seriesModels: [] - }; - } - result[idx].seriesModels.push(seriesModel); - }); - return result; - } - /** - * Calculate offset and box width for each series. - */ - function calculateBase(groupItem) { - var baseAxis = groupItem.axis; - var seriesModels = groupItem.seriesModels; - var seriesCount = seriesModels.length; - var boxWidthList = groupItem.boxWidthList = []; - var boxOffsetList = groupItem.boxOffsetList = []; - var boundList = []; - var bandWidth; - if (baseAxis.type === 'category') { - bandWidth = baseAxis.getBandWidth(); - } else { - var maxDataCount_1 = 0; - each$6(seriesModels, function (seriesModel) { - maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count()); - }); - var extent = baseAxis.getExtent(); - bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1; - } - each$6(seriesModels, function (seriesModel) { - var boxWidthBound = seriesModel.get('boxWidth'); - if (!isArray(boxWidthBound)) { - boxWidthBound = [boxWidthBound, boxWidthBound]; - } - boundList.push([parsePercent$1(boxWidthBound[0], bandWidth) || 0, parsePercent$1(boxWidthBound[1], bandWidth) || 0]); - }); - var availableWidth = bandWidth * 0.8 - 2; - var boxGap = availableWidth / seriesCount * 0.3; - var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount; - var base = boxWidth / 2 - availableWidth / 2; - each$6(seriesModels, function (seriesModel, idx) { - boxOffsetList.push(base); - base += boxGap + boxWidth; - boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])); - }); - } - /** - * Calculate points location for each series. - */ - function layoutSingleSeries(seriesModel, offset, boxWidth) { - var coordSys = seriesModel.coordinateSystem; - var data = seriesModel.getData(); - var halfWidth = boxWidth / 2; - var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1; - var vDimIdx = 1 - cDimIdx; - var coordDims = ['x', 'y']; - var cDim = data.mapDimension(coordDims[cDimIdx]); - var vDims = data.mapDimensionsAll(coordDims[vDimIdx]); - if (cDim == null || vDims.length < 5) { - return; - } - for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { - var axisDimVal = data.get(cDim, dataIndex); - var median = getPoint(axisDimVal, vDims[2], dataIndex); - var end1 = getPoint(axisDimVal, vDims[0], dataIndex); - var end2 = getPoint(axisDimVal, vDims[1], dataIndex); - var end4 = getPoint(axisDimVal, vDims[3], dataIndex); - var end5 = getPoint(axisDimVal, vDims[4], dataIndex); - var ends = []; - addBodyEnd(ends, end2, false); - addBodyEnd(ends, end4, true); - ends.push(end1, end2, end5, end4); - layEndLine(ends, end1); - layEndLine(ends, end5); - layEndLine(ends, median); - data.setItemLayout(dataIndex, { - initBaseline: median[vDimIdx], - ends: ends - }); - } - function getPoint(axisDimVal, dim, dataIndex) { - var val = data.get(dim, dataIndex); - var p = []; - p[cDimIdx] = axisDimVal; - p[vDimIdx] = val; - var point; - if (isNaN(axisDimVal) || isNaN(val)) { - point = [NaN, NaN]; - } else { - point = coordSys.dataToPoint(p); - point[cDimIdx] += offset; - } - return point; - } - function addBodyEnd(ends, point, start) { - var point1 = point.slice(); - var point2 = point.slice(); - point1[cDimIdx] += halfWidth; - point2[cDimIdx] -= halfWidth; - start ? ends.push(point1, point2) : ends.push(point2, point1); - } - function layEndLine(ends, endCenter) { - var from = endCenter.slice(); - var to = endCenter.slice(); - from[cDimIdx] -= halfWidth; - to[cDimIdx] += halfWidth; - ends.push(from, to); - } - } - - /** - * See: - * - * - * - * Helper method for preparing data. - * - * @param rawData like - * [ - * [12,232,443], (raw data set for the first box) - * [3843,5545,1232], (raw data set for the second box) - * ... - * ] - * @param opt.boundIQR=1.5 Data less than min bound is outlier. - * default 1.5, means Q1 - 1.5 * (Q3 - Q1). - * If 'none'/0 passed, min bound will not be used. - */ - function prepareBoxplotData(rawData, opt) { - opt = opt || {}; - var boxData = []; - var outliers = []; - var boundIQR = opt.boundIQR; - var useExtreme = boundIQR === 'none' || boundIQR === 0; - for (var i = 0; i < rawData.length; i++) { - var ascList = asc(rawData[i].slice()); - var Q1 = quantile(ascList, 0.25); - var Q2 = quantile(ascList, 0.5); - var Q3 = quantile(ascList, 0.75); - var min = ascList[0]; - var max = ascList[ascList.length - 1]; - var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1); - var low = useExtreme ? min : Math.max(min, Q1 - bound); - var high = useExtreme ? max : Math.min(max, Q3 + bound); - var itemNameFormatter = opt.itemNameFormatter; - var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({ - value: i - }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + ''; - boxData.push([itemName, low, Q1, Q2, Q3, high]); - for (var j = 0; j < ascList.length; j++) { - var dataItem = ascList[j]; - if (dataItem < low || dataItem > high) { - var outlier = [itemName, dataItem]; - outliers.push(outlier); - } - } - } - return { - boxData: boxData, - outliers: outliers - }; - } - - var boxplotTransform = { - type: 'echarts:boxplot', - transform: function transform(params) { - var upstream = params.upstream; - if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) { - var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].'); - } - throwError(errMsg); - } - var result = prepareBoxplotData(upstream.getRawData(), params.config); - return [{ - dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'], - data: result.boxData - }, { - data: result.outliers - }]; - } - }; - - function install$j(registers) { - registers.registerSeriesModel(BoxplotSeriesModel); - registers.registerChartView(BoxplotView); - registers.registerLayout(boxplotLayout); - registers.registerTransform(boxplotTransform); - } - - var SKIP_PROPS = ['color', 'borderColor']; - var CandlestickView = /** @class */function (_super) { - __extends(CandlestickView, _super); - function CandlestickView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CandlestickView.type; - return _this; - } - CandlestickView.prototype.render = function (seriesModel, ecModel, api) { - // If there is clipPath created in large mode. Remove it. - this.group.removeClipPath(); - // Clear previously rendered progressive elements. - this._progressiveEls = null; - this._updateDrawMode(seriesModel); - this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel); - }; - CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - this._clear(); - this._updateDrawMode(seriesModel); - }; - CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) { - this._progressiveEls = []; - this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel); - }; - CandlestickView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; - CandlestickView.prototype._updateDrawMode = function (seriesModel) { - var isLargeDraw = seriesModel.pipelineContext.large; - if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { - this._isLargeDraw = isLargeDraw; - this._clear(); - } - }; - CandlestickView.prototype._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 itemLayout = data.getItemLayout(newIdx); - if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { - return; - } - var el = createNormalBox$1(itemLayout, newIdx, true); - initProps(el, { - shape: { - points: itemLayout.ends - } - }, seriesModel, newIdx); - setBoxCommon(el, data, newIdx, isSimpleBox); - group.add(el); - data.setItemGraphicEl(newIdx, el); - } - }).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$1(itemLayout); - } else { - updateProps(el, { - shape: { - points: itemLayout.ends - } - }, seriesModel, newIdx); - saveOldStyle(el); - } - 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; - }; - CandlestickView.prototype._renderLarge = function (seriesModel) { - this._clear(); - createLarge$1(seriesModel, this.group); - var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null; - if (clipPath) { - this.group.setClipPath(clipPath); - } else { - this.group.removeClipPath(); - } - }; - CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) { - var data = seriesModel.getData(); - var isSimpleBox = data.getLayout('isSimpleBox'); - var dataIndex; - while ((dataIndex = params.next()) != null) { - var itemLayout = data.getItemLayout(dataIndex); - var el = createNormalBox$1(itemLayout); - setBoxCommon(el, data, dataIndex, isSimpleBox); - el.incremental = true; - this.group.add(el); - this._progressiveEls.push(el); - } - }; - CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) { - createLarge$1(seriesModel, this.group, this._progressiveEls, true); - }; - CandlestickView.prototype.remove = function (ecModel) { - this._clear(); - }; - CandlestickView.prototype._clear = function () { - this.group.removeAll(); - this._data = null; - }; - CandlestickView.type = 'candlestick'; - return CandlestickView; - }(ChartView); - var NormalBoxPathShape = /** @class */function () { - function NormalBoxPathShape() {} - return NormalBoxPathShape; - }(); - var NormalBoxPath = /** @class */function (_super) { - __extends(NormalBoxPath, _super); - function NormalBoxPath(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'normalCandlestickBox'; - return _this; - } - NormalBoxPath.prototype.getDefaultShape = function () { - return new NormalBoxPathShape(); - }; - NormalBoxPath.prototype.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]); - } - }; - return NormalBoxPath; - }(Path); - function createNormalBox$1(itemLayout, dataIndex, isInit) { - var ends = itemLayout.ends; - return new NormalBoxPath({ - shape: { - points: isInit ? transInit$1(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); - el.useStyle(data.getItemVisual(dataIndex, 'style')); - el.style.strokeNoScale = true; - el.__simpleBox = isSimpleBox; - setStatesStylesFromModel(el, itemModel); - } - function transInit$1(points, itemLayout) { - return map(points, function (point) { - point = point.slice(); - point[1] = itemLayout.initBaseline; - return point; - }); - } - var LargeBoxPathShape = /** @class */function () { - function LargeBoxPathShape() {} - return LargeBoxPathShape; - }(); - var LargeBoxPath = /** @class */function (_super) { - __extends(LargeBoxPath, _super); - function LargeBoxPath(opts) { - var _this = _super.call(this, opts) || this; - _this.type = 'largeCandlestickBox'; - return _this; - } - LargeBoxPath.prototype.getDefaultShape = function () { - return new LargeBoxPathShape(); - }; - LargeBoxPath.prototype.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; - } - } - }; - return LargeBoxPath; - }(Path); - function createLarge$1(seriesModel, group, progressiveEls, incremental) { - var data = seriesModel.getData(); - var largePoints = data.getLayout('largePoints'); - var elP = new LargeBoxPath({ - shape: { - points: largePoints - }, - __sign: 1, - ignoreCoarsePointer: true - }); - group.add(elP); - var elN = new LargeBoxPath({ - shape: { - points: largePoints - }, - __sign: -1, - ignoreCoarsePointer: true - }); - group.add(elN); - var elDoji = new LargeBoxPath({ - shape: { - points: largePoints - }, - __sign: 0, - ignoreCoarsePointer: true - }); - group.add(elDoji); - setLargeStyle(1, elP, seriesModel); - setLargeStyle(-1, elN, seriesModel); - setLargeStyle(0, elDoji, seriesModel); - if (incremental) { - elP.incremental = true; - elN.incremental = true; - } - if (progressiveEls) { - progressiveEls.push(elP, elN); - } - } - function setLargeStyle(sign, el, seriesModel, data) { - // TODO put in visual? - var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0']) - // Use color for border color by default. - || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']); - if (sign === 0) { - borderColor = seriesModel.get(['itemStyle', 'borderColorDoji']); - } - // Color must be excluded. - // Because symbol provide setColor individually to set fill and stroke - var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS); - el.useStyle(itemStyle); - el.style.fill = null; - el.style.stroke = borderColor; - } - - var CandlestickSeriesModel = /** @class */function (_super) { - __extends(CandlestickSeriesModel, _super); - function CandlestickSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CandlestickSeriesModel.type; - _this.defaultValueDimensions = [{ - name: 'open', - defaultTooltip: true - }, { - name: 'close', - defaultTooltip: true - }, { - name: 'lowest', - defaultTooltip: true - }, { - name: 'highest', - defaultTooltip: true - }]; - return _this; - } - /** - * Get dimension for shadow in dataZoom - * @return dimension name - */ - CandlestickSeriesModel.prototype.getShadowDim = function () { - return 'open'; - }; - CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - var itemLayout = data.getItemLayout(dataIndex); - return itemLayout && selectors.rect(itemLayout.brushRect); - }; - CandlestickSeriesModel.type = 'series.candlestick'; - CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid']; - CandlestickSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - // xAxisIndex: 0, - // yAxisIndex: 0, - layout: null, - clip: true, - itemStyle: { - color: '#eb5454', - color0: '#47b262', - borderColor: '#eb5454', - borderColor0: '#47b262', - borderColorDoji: null, - // borderColor: '#d24040', - // borderColor0: '#398f4f', - borderWidth: 1 - }, - emphasis: { - scale: true, - itemStyle: { - borderWidth: 2 - } - }, - barMaxWidth: null, - barMinWidth: null, - barWidth: null, - large: true, - largeThreshold: 600, - progressive: 3e3, - progressiveThreshold: 1e4, - progressiveChunkMode: 'mod', - animationEasing: 'linear', - animationDuration: 300 - }; - return CandlestickSeriesModel; - }(SeriesModel); - mixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true); - - function candlestickPreprocessor(option) { - if (!option || !isArray(option.series)) { - return; - } - // Translate 'k' to 'candlestick'. - each(option.series, function (seriesItem) { - if (isObject(seriesItem) && seriesItem.type === 'k') { - seriesItem.type = 'candlestick'; - } - }); - } - - var positiveBorderColorQuery = ['itemStyle', 'borderColor']; - var negativeBorderColorQuery = ['itemStyle', 'borderColor0']; - var dojiBorderColorQuery = ['itemStyle', 'borderColorDoji']; - var positiveColorQuery = ['itemStyle', 'color']; - var negativeColorQuery = ['itemStyle', 'color0']; - var candlestickVisual = { - seriesType: 'candlestick', - plan: createRenderPlanner(), - // For legend. - performRawSeries: true, - reset: function (seriesModel, ecModel) { - function getColor(sign, model) { - return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery); - } - function getBorderColor(sign, model) { - return model.get(sign === 0 ? dojiBorderColorQuery : sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery); - } - // Only visible series has each data be visual encoded - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } - var isLargeRender = seriesModel.pipelineContext.large; - return !isLargeRender && { - progress: function (params, data) { - var dataIndex; - while ((dataIndex = params.next()) != null) { - var itemModel = data.getItemModel(dataIndex); - var sign = data.getItemLayout(dataIndex).sign; - var style = itemModel.getItemStyle(); - style.fill = getColor(sign, itemModel); - style.stroke = getBorderColor(sign, itemModel) || style.fill; - var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style'); - extend(existsStyle, style); - } - } - }; - } - }; - - var candlestickLayout = { - seriesType: 'candlestick', - plan: createRenderPlanner(), - reset: function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var data = seriesModel.getData(); - var candleWidth = calculateCandleWidth(seriesModel, data); - var cDimIdx = 0; - var vDimIdx = 1; - var coordDims = ['x', 'y']; - var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx])); - var vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data); - var openDimI = vDimsI[0]; - var closeDimI = vDimsI[1]; - var lowestDimI = vDimsI[2]; - var highestDimI = vDimsI[3]; - data.setLayout({ - candleWidth: candleWidth, - // The value is experimented visually. - isSimpleBox: candleWidth <= 1.3 - }); - if (cDimI < 0 || vDimsI.length < 4) { - return; - } - return { - progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress - }; - function normalProgress(params, data) { - var dataIndex; - var store = data.getStore(); - while ((dataIndex = params.next()) != null) { - var axisDimVal = store.get(cDimI, dataIndex); - var openVal = store.get(openDimI, dataIndex); - var closeVal = store.get(closeDimI, dataIndex); - var lowestVal = store.get(lowestDimI, dataIndex); - var highestVal = store.get(highestDimI, dataIndex); - var ocLow = Math.min(openVal, closeVal); - var ocHigh = Math.max(openVal, closeVal); - var ocLowPoint = getPoint(ocLow, axisDimVal); - var ocHighPoint = getPoint(ocHigh, axisDimVal); - var lowestPoint = getPoint(lowestVal, axisDimVal); - var highestPoint = getPoint(highestVal, axisDimVal); - var ends = []; - addBodyEnd(ends, ocHighPoint, 0); - addBodyEnd(ends, ocLowPoint, 1); - ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint)); - var itemModel = data.getItemModel(dataIndex); - var hasDojiColor = !!itemModel.get(['itemStyle', 'borderColorDoji']); - data.setItemLayout(dataIndex, { - sign: getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor), - initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx], - ends: ends, - brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal) - }); - } - function getPoint(val, axisDimVal) { - var p = []; - p[cDimIdx] = axisDimVal; - p[vDimIdx] = val; - return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p); - } - function addBodyEnd(ends, point, start) { - var point1 = point.slice(); - var point2 = point.slice(); - point1[cDimIdx] = subPixelOptimize$1(point1[cDimIdx] + candleWidth / 2, 1, false); - point2[cDimIdx] = subPixelOptimize$1(point2[cDimIdx] - candleWidth / 2, 1, true); - start ? ends.push(point1, point2) : ends.push(point2, point1); - } - function makeBrushRect(lowestVal, highestVal, axisDimVal) { - var pmin = getPoint(lowestVal, axisDimVal); - var pmax = getPoint(highestVal, axisDimVal); - pmin[cDimIdx] -= candleWidth / 2; - pmax[cDimIdx] -= candleWidth / 2; - return { - x: pmin[0], - y: pmin[1], - width: candleWidth , - height: pmax[1] - pmin[1] - }; - } - function subPixelOptimizePoint(point) { - point[cDimIdx] = subPixelOptimize$1(point[cDimIdx], 1); - return point; - } - } - function largeProgress(params, data) { - // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...] - var points = createFloat32Array(params.count * 4); - var offset = 0; - var point; - var tmpIn = []; - var tmpOut = []; - var dataIndex; - var store = data.getStore(); - var hasDojiColor = !!seriesModel.get(['itemStyle', 'borderColorDoji']); - while ((dataIndex = params.next()) != null) { - var axisDimVal = store.get(cDimI, dataIndex); - var openVal = store.get(openDimI, dataIndex); - var closeVal = store.get(closeDimI, dataIndex); - var lowestVal = store.get(lowestDimI, dataIndex); - var highestVal = store.get(highestDimI, dataIndex); - if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) { - points[offset++] = NaN; - offset += 3; - continue; + if (breakBuild) { + break lo; } - points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor); - tmpIn[cDimIdx] = axisDimVal; - tmpIn[vDimIdx] = lowestVal; - point = coordSys.dataToPoint(tmpIn, null, tmpOut); - points[offset++] = point ? point[0] : NaN; - points[offset++] = point ? point[1] : NaN; - tmpIn[vDimIdx] = highestVal; - point = coordSys.dataToPoint(tmpIn, null, tmpOut); - points[offset++] = point ? point[1] : NaN; - } - data.setLayout('largePoints', points); - } - } - }; - /** - * Get the sign of a single data. - * - * @returns 0 for doji with hasDojiColor: true, - * 1 for positive, - * -1 for negative. - */ - function getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor) { - var sign; - if (openVal > closeVal) { - sign = -1; - } else if (openVal < closeVal) { - sign = 1; - } else { - sign = hasDojiColor - // When doji color is set, use it instead of color/color0. - ? 0 : dataIndex > 0 - // If close === open, compare with close of last record - ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1 - // No record of previous, set to be positive - : 1; - } - return sign; - } - function calculateCandleWidth(seriesModel, data) { - var baseAxis = seriesModel.getBaseAxis(); - var extent; - var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count()); - var barMaxWidth = parsePercent$1(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth); - var barMinWidth = parsePercent$1(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth); - var barWidth = seriesModel.get('barWidth'); - return barWidth != null ? parsePercent$1(barWidth, bandWidth) - // Put max outer to ensure bar visible in spite of overlap. - : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth); - } - - function install$k(registers) { - registers.registerChartView(CandlestickView); - registers.registerSeriesModel(CandlestickSeriesModel); - registers.registerPreprocessor(candlestickPreprocessor); - registers.registerVisual(candlestickVisual); - registers.registerLayout(candlestickLayout); - } - - function updateRipplePath(rippleGroup, effectCfg) { - var color = effectCfg.rippleEffectColor || effectCfg.color; - rippleGroup.eachChild(function (ripplePath) { - ripplePath.attr({ - z: effectCfg.z, - zlevel: effectCfg.zlevel, - style: { - stroke: effectCfg.brushType === 'stroke' ? color : null, - fill: effectCfg.brushType === 'fill' ? color : null - } - }); - }); - } - var EffectSymbol = /** @class */function (_super) { - __extends(EffectSymbol, _super); - function EffectSymbol(data, idx) { - var _this = _super.call(this) || this; - var symbol = new Symbol(data, idx); - var rippleGroup = new Group(); - _this.add(symbol); - _this.add(rippleGroup); - _this.updateData(data, idx); - return _this; - } - EffectSymbol.prototype.stopEffectAnimation = function () { - this.childAt(1).removeAll(); - }; - EffectSymbol.prototype.startEffectAnimation = function (effectCfg) { - var symbolType = effectCfg.symbolType; - var color = effectCfg.color; - var rippleNumber = effectCfg.rippleNumber; - var rippleGroup = this.childAt(1); - for (var i = 0; i < rippleNumber; i++) { - // If width/height are set too small (e.g., set to 1) on ios10 - // and macOS Sierra, a circle stroke become a rect, no matter what - // the scale is set. So we set width/height as 2. See #4136. - var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color); - ripplePath.attr({ - style: { - strokeNoScale: true - }, - z2: 99, - silent: true, - scaleX: 0.5, - scaleY: 0.5 - }); - var delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset; - ripplePath.animate('', true).when(effectCfg.period, { - scaleX: effectCfg.rippleScale / 2, - scaleY: effectCfg.rippleScale / 2 - }).delay(delay).start(); - ripplePath.animateStyle(true).when(effectCfg.period, { - opacity: 0 - }).delay(delay).start(); - rippleGroup.add(ripplePath); - } - updateRipplePath(rippleGroup, effectCfg); - }; - /** - * Update effect symbol - */ - EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) { - var oldEffectCfg = this._effectCfg; - var rippleGroup = this.childAt(1); - // Must reinitialize effect if following configuration changed - var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber']; - for (var i = 0; i < DIFFICULT_PROPS.length; i++) { - var propName = DIFFICULT_PROPS[i]; - if (oldEffectCfg[propName] !== effectCfg[propName]) { - this.stopEffectAnimation(); - this.startEffectAnimation(effectCfg); - return; - } - } - updateRipplePath(rippleGroup, effectCfg); - }; - /** - * Highlight symbol - */ - EffectSymbol.prototype.highlight = function () { - enterEmphasis(this); - }; - /** - * Downplay symbol - */ - EffectSymbol.prototype.downplay = function () { - leaveEmphasis(this); - }; - EffectSymbol.prototype.getSymbolType = function () { - var symbol = this.childAt(0); - return symbol && symbol.getSymbolType(); - }; - /** - * Update symbol properties - */ - EffectSymbol.prototype.updateData = function (data, idx) { - var _this = this; - var seriesModel = data.hostModel; - this.childAt(0).updateData(data, idx); - var rippleGroup = this.childAt(1); - var itemModel = data.getItemModel(idx); - var symbolType = data.getItemVisual(idx, 'symbol'); - var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); - var symbolStyle = data.getItemVisual(idx, 'style'); - var color = symbolStyle && symbolStyle.fill; - var emphasisModel = itemModel.getModel('emphasis'); - rippleGroup.setScale(symbolSize); - rippleGroup.traverse(function (ripplePath) { - ripplePath.setStyle('fill', color); - }); - var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize); - if (symbolOffset) { - rippleGroup.x = symbolOffset[0]; - rippleGroup.y = symbolOffset[1]; - } - var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); - rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; - var effectCfg = {}; - effectCfg.showEffectOn = seriesModel.get('showEffectOn'); - effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']); - effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']); - effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000; - effectCfg.effectOffset = idx / data.count(); - effectCfg.z = seriesModel.getShallow('z') || 0; - effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0; - effectCfg.symbolType = symbolType; - effectCfg.color = color; - effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']); - effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']); - if (effectCfg.showEffectOn === 'render') { - this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg); - this._effectCfg = effectCfg; - } else { - // Not keep old effect config - this._effectCfg = null; - this.stopEffectAnimation(); - this.onHoverStateChange = function (toState) { - if (toState === 'emphasis') { - if (effectCfg.showEffectOn !== 'render') { - _this.startEffectAnimation(effectCfg); + if (isFirst) { + x0 = mathCos2(startAngle) * rx + cx; + y0 = mathSin2(startAngle) * ry + cy; + } + xi = mathCos2(endAngle) * rx + cx; + yi = mathSin2(endAngle) * ry + cy; + break; + case CMD.R: + x0 = xi = d[i]; + y0 = yi = d[i + 1]; + x = d[i++]; + y = d[i++]; + const width = d[i++]; + const height = d[i++]; + if (drawPart) { + const l = pathSegLen[segCount++]; + if (accumLength + l > displayedLength) { + let d2 = displayedLength - accumLength; + ctx.moveTo(x, y); + ctx.lineTo(x + mathMin3(d2, width), y); + d2 -= width; + if (d2 > 0) { + ctx.lineTo(x + width, y + mathMin3(d2, height)); + } + d2 -= height; + if (d2 > 0) { + ctx.lineTo(x + mathMax3(width - d2, 0), y + height); + } + d2 -= width; + if (d2 > 0) { + ctx.lineTo(x, y + mathMax3(height - d2, 0)); + } + break lo; } - } else if (toState === 'normal') { - if (effectCfg.showEffectOn !== 'render') { - _this.stopEffectAnimation(); + accumLength += l; + } + ctx.rect(x, y, width, height); + break; + case CMD.Z: + if (drawPart) { + const l = pathSegLen[segCount++]; + if (accumLength + l > displayedLength) { + const t = (displayedLength - accumLength) / l; + ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t); + break lo; } + accumLength += l; } - }; - } - this._effectCfg = effectCfg; - toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; - EffectSymbol.prototype.fadeOut = function (cb) { - cb && cb(); - }; - return EffectSymbol; - }(Group); - - var EffectScatterView = /** @class */function (_super) { - __extends(EffectScatterView, _super); - function EffectScatterView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = EffectScatterView.type; - return _this; - } - EffectScatterView.prototype.init = function () { - this._symbolDraw = new SymbolDraw(EffectSymbol); - }; - EffectScatterView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var effectSymbolDraw = this._symbolDraw; - effectSymbolDraw.updateData(data, { - clipShape: this._getClipShape(seriesModel) - }); - this.group.add(effectSymbolDraw.group); - }; - EffectScatterView.prototype._getClipShape = function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var clipArea = coordSys && coordSys.getArea && coordSys.getArea(); - return seriesModel.get('clip', true) ? clipArea : null; - }; - EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - this.group.dirty(); - var res = pointsLayout('').reset(seriesModel, ecModel, api); - if (res.progress) { - res.progress({ - start: 0, - end: data.count(), - count: data.count() - }, data); - } - this._symbolDraw.updateLayout(); - }; - EffectScatterView.prototype._updateGroupTransform = function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.getRoamTransform) { - this.group.transform = clone$2(coordSys.getRoamTransform()); - this.group.decomposeTransform(); + ctx.closePath(); + xi = x0; + yi = y0; } - }; - EffectScatterView.prototype.remove = function (ecModel, api) { - this._symbolDraw && this._symbolDraw.remove(true); - }; - EffectScatterView.type = 'effectScatter'; - return EffectScatterView; - }(ChartView); - - var EffectScatterSeriesModel = /** @class */function (_super) { - __extends(EffectScatterSeriesModel, _super); - function EffectScatterSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = EffectScatterSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } - EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; - EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - return selectors.point(data.getItemLayout(dataIndex)); - }; - EffectScatterSeriesModel.type = 'series.effectScatter'; - EffectScatterSeriesModel.dependencies = ['grid', 'polar']; - EffectScatterSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - legendHoverLink: true, - effectType: 'ripple', - progressive: 0, - // When to show the effect, option: 'render'|'emphasis' - showEffectOn: 'render', - clip: true, - // Ripple effect config - rippleEffect: { - period: 4, - // Scale of ripple - scale: 2.5, - // Brush type can be fill or stroke - brushType: 'fill', - // Ripple number - number: 3 - }, - universalTransition: { - divideShape: 'clone' - }, - // 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, // 图形旋转控制 - // itemStyle: { - // opacity: 1 - // } - }; - - return EffectScatterSeriesModel; - }(SeriesModel); - - function install$l(registers) { - registers.registerChartView(EffectScatterView); - registers.registerSeriesModel(EffectScatterSeriesModel); - registers.registerLayout(pointsLayout('effectScatter')); - } - - var EffectLine = /** @class */function (_super) { - __extends(EffectLine, _super); - function EffectLine(lineData, idx, seriesScope) { - var _this = _super.call(this) || this; - _this.add(_this.createLine(lineData, idx, seriesScope)); - _this._updateEffectSymbol(lineData, idx); - return _this; } - EffectLine.prototype.createLine = function (lineData, idx, seriesScope) { - return new Line$1(lineData, idx, seriesScope); - }; - EffectLine.prototype._updateEffectSymbol = function (lineData, idx) { - var itemModel = lineData.getItemModel(idx); - var effectModel = itemModel.getModel('effect'); - var size = effectModel.get('symbolSize'); - var symbolType = effectModel.get('symbol'); - if (!isArray(size)) { - size = [size, size]; - } - var lineStyle = lineData.getItemVisual(idx, 'style'); - var color = effectModel.get('color') || lineStyle && lineStyle.stroke; - var symbol = this.childAt(1); - if (this._symbolType !== symbolType) { - // Remove previous - this.remove(symbol); - symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color); - symbol.z2 = 100; - symbol.culling = true; - this.add(symbol); - } - // Symbol may be removed if loop is false - if (!symbol) { - return; - } - // Shadow color is same with color in default - symbol.setStyle('shadowColor', color); - symbol.setStyle(effectModel.getItemStyle(['color'])); - symbol.scaleX = size[0]; - symbol.scaleY = size[1]; - symbol.setColor(color); - this._symbolType = symbolType; - this._symbolScale = size; - this._updateEffectAnimation(lineData, effectModel, idx); - }; - EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) { - var symbol = this.childAt(1); - if (!symbol) { - return; - } - var points = lineData.getItemLayout(idx); - var period = effectModel.get('period') * 1000; - var loop = effectModel.get('loop'); - var roundTrip = effectModel.get('roundTrip'); - var constantSpeed = effectModel.get('constantSpeed'); - var delayExpr = retrieve(effectModel.get('delay'), function (idx) { - return idx / lineData.count() * period / 3; - }); - // Ignore when updating - symbol.ignore = true; - this._updateAnimationPoints(symbol, points); - if (constantSpeed > 0) { - period = this._getLineLength(symbol) / constantSpeed * 1000; - } - if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) { - symbol.stopAnimation(); - var delayNum = void 0; - if (isFunction(delayExpr)) { - delayNum = delayExpr(idx); - } else { - delayNum = delayExpr; - } - if (symbol.__t > 0) { - delayNum = -period * symbol.__t; - } - this._animateSymbol(symbol, period, delayNum, loop, roundTrip); - } - this._period = period; - this._loop = loop; - this._roundTrip = roundTrip; - }; - EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop, roundTrip) { - if (period > 0) { - symbol.__t = 0; - var self_1 = this; - var animator = symbol.animate('', loop).when(roundTrip ? period * 2 : period, { - __t: roundTrip ? 2 : 1 - }).delay(delayNum).during(function () { - self_1._updateSymbolPosition(symbol); - }); - if (!loop) { - animator.done(function () { - self_1.remove(symbol); - }); - } - animator.start(); - } - }; - EffectLine.prototype._getLineLength = function (symbol) { - // Not so accurate - return dist(symbol.__p1, symbol.__cp1) + dist(symbol.__cp1, symbol.__p2); - }; - EffectLine.prototype._updateAnimationPoints = function (symbol, points) { - symbol.__p1 = points[0]; - symbol.__p2 = points[1]; - symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2]; - }; - EffectLine.prototype.updateData = function (lineData, idx, seriesScope) { - this.childAt(0).updateData(lineData, idx, seriesScope); - this._updateEffectSymbol(lineData, idx); - }; - EffectLine.prototype._updateSymbolPosition = function (symbol) { - var p1 = symbol.__p1; - var p2 = symbol.__p2; - var cp1 = symbol.__cp1; - var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t; - var pos = [symbol.x, symbol.y]; - var lastPos = pos.slice(); - var quadraticAt$1 = quadraticAt; - var quadraticDerivativeAt$1 = quadraticDerivativeAt; - pos[0] = quadraticAt$1(p1[0], cp1[0], p2[0], t); - pos[1] = quadraticAt$1(p1[1], cp1[1], p2[1], t); - // Tangent - var tx = symbol.__t < 1 ? quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t) : quadraticDerivativeAt$1(p2[0], cp1[0], p1[0], 1 - t); - var ty = symbol.__t < 1 ? quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t) : quadraticDerivativeAt$1(p2[1], cp1[1], p1[1], 1 - t); - symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; - // enable continuity trail for 'line', 'rect', 'roundRect' symbolType - if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') { - if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) { - symbol.scaleY = dist(lastPos, pos) * 1.05; - // make sure the last segment render within endPoint - if (t === 1) { - pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2; - pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2; - } - } else if (symbol.__lastT === 1) { - // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly. - symbol.scaleY = 2 * dist(p1, pos); - } else { - symbol.scaleY = this._symbolScale[1]; - } - } - symbol.__lastT = symbol.__t; - symbol.ignore = false; - symbol.x = pos[0]; - symbol.y = pos[1]; - }; - EffectLine.prototype.updateLayout = function (lineData, idx) { - this.childAt(0).updateLayout(lineData, idx); - var effectModel = lineData.getItemModel(idx).getModel('effect'); - this._updateEffectAnimation(lineData, effectModel, idx); - }; - return EffectLine; - }(Group); - - var Polyline$1 = /** @class */function (_super) { - __extends(Polyline$1, _super); - function Polyline$1(lineData, idx, seriesScope) { - var _this = _super.call(this) || this; - _this._createPolyline(lineData, idx, seriesScope); - return _this; - } - Polyline$1.prototype._createPolyline = function (lineData, idx, seriesScope) { - // let seriesModel = lineData.hostModel; - var points = lineData.getItemLayout(idx); - var line = new Polyline({ - shape: { - points: points - } - }); - this.add(line); - this._updateCommonStl(lineData, idx, seriesScope); - }; - Polyline$1.prototype.updateData = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childAt(0); - var target = { - shape: { - points: lineData.getItemLayout(idx) - } - }; - updateProps(line, target, seriesModel, idx); - this._updateCommonStl(lineData, idx, seriesScope); - }; - Polyline$1.prototype._updateCommonStl = function (lineData, idx, seriesScope) { - var line = this.childAt(0); - var itemModel = lineData.getItemModel(idx); - var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; - var focus = seriesScope && seriesScope.focus; - var blurScope = seriesScope && seriesScope.blurScope; - var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; - if (!seriesScope || lineData.hasItemOption) { - var emphasisModel = itemModel.getModel('emphasis'); - emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle(); - emphasisDisabled = emphasisModel.get('disabled'); - focus = emphasisModel.get('focus'); - blurScope = emphasisModel.get('blurScope'); - } - line.useStyle(lineData.getItemVisual(idx, 'style')); - line.style.fill = null; - line.style.strokeNoScale = true; - var lineEmphasisState = line.ensureState('emphasis'); - lineEmphasisState.style = emphasisLineStyle; - toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); - }; - Polyline$1.prototype.updateLayout = function (lineData, idx) { - var polyline = this.childAt(0); - polyline.setShape('points', lineData.getItemLayout(idx)); - }; - return Polyline$1; - }(Group); - - var EffectPolyline = /** @class */function (_super) { - __extends(EffectPolyline, _super); - function EffectPolyline() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._lastFrame = 0; - _this._lastFramePercent = 0; - return _this; - } - // Override - EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) { - return new Polyline$1(lineData, idx, seriesScope); - }; - // Override - EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) { - this._points = points; - var accLenArr = [0]; - var len = 0; - for (var i = 1; i < points.length; i++) { - var p1 = points[i - 1]; - var p2 = points[i]; - len += dist(p1, p2); - accLenArr.push(len); - } - if (len === 0) { - this._length = 0; - return; + } + clone() { + const newProxy = new PathProxy2(); + const data = this.data; + newProxy.data = data.slice ? data.slice() : Array.prototype.slice.call(data); + newProxy._len = this._len; + return newProxy; + } +}; +var PathProxy = PathProxy2; +PathProxy.CMD = CMD; +PathProxy.initDefaultProps = function() { + const proto2 = PathProxy2.prototype; + proto2._saveData = true; + proto2._ux = 0; + proto2._uy = 0; + proto2._pendingPtDist = 0; + proto2._version = 0; +}(); +var PathProxy_default = PathProxy; + +// node_modules/zrender/src/contain/line.ts +function containStroke(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + const _l = lineWidth; + let _a = 0; + let _b = x0; + if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) { + return false; + } + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1); + } else { + return Math.abs(x - x0) <= _l / 2; + } + const tmp = _a * x - y + _b; + const _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; +} + +// node_modules/zrender/src/contain/cubic.ts +function containStroke2(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + const _l = lineWidth; + if (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) { + return false; + } + const d = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null); + return d <= _l / 2; +} + +// node_modules/zrender/src/contain/quadratic.ts +function containStroke3(x0, y0, x1, y1, x2, y2, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + const _l = lineWidth; + 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; + } + const d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null); + return d <= _l / 2; +} + +// node_modules/zrender/src/contain/util.ts +var PI23 = Math.PI * 2; +function normalizeRadian(angle) { + angle %= PI23; + if (angle < 0) { + angle += PI23; + } + return angle; +} + +// node_modules/zrender/src/contain/arc.ts +var PI24 = Math.PI * 2; +function containStroke4(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + const _l = lineWidth; + x -= cx; + y -= cy; + const d = Math.sqrt(x * x + y * y); + if (d - _l > r || d + _l < r) { + return false; + } + if (Math.abs(startAngle - endAngle) % PI24 < 1e-4) { + return true; + } + if (anticlockwise) { + const tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI24; + } + let angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI24; + } + return angle >= startAngle && angle <= endAngle || angle + PI24 >= startAngle && angle + PI24 <= endAngle; +} + +// node_modules/zrender/src/contain/windingLine.ts +function windingLine(x0, y0, x1, y1, x, y) { + if (y > y0 && y > y1 || y < y0 && y < y1) { + return 0; + } + if (y1 === y0) { + return 0; + } + const t = (y - y0) / (y1 - y0); + let dir3 = y1 < y0 ? 1 : -1; + if (t === 1 || t === 0) { + dir3 = y1 < y0 ? 0.5 : -0.5; + } + const x_ = t * (x1 - x0) + x0; + return x_ === x ? Infinity : x_ > x ? dir3 : 0; +} + +// node_modules/zrender/src/contain/path.ts +var CMD2 = PathProxy_default.CMD; +var PI25 = Math.PI * 2; +var EPSILON4 = 1e-4; +function isAroundEqual(a, b) { + return Math.abs(a - b) < EPSILON4; +} +var roots = [-1, -1, -1]; +var extrema = [-1, -1]; +function swapExtrema() { + const tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; +} +function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) { + return 0; + } + const nRoots = cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } else { + let w = 0; + let nExtrema = -1; + let y0_; + let y1_; + for (let i = 0; i < nRoots; i++) { + let t = roots[i]; + let unit = t === 0 || t === 1 ? 0.5 : 1; + let x_ = cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { + continue; + } + if (nExtrema < 0) { + nExtrema = cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = 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; } - for (var i = 0; i < accLenArr.length; i++) { - accLenArr[i] /= len; + } 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) { + if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) { + return 0; + } + const nRoots = quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } else { + const t = quadraticExtremum(y0, y1, y2); + if (t >= 0 && t <= 1) { + let w = 0; + let y_ = quadraticAt(y0, y1, y2, t); + for (let i = 0; i < nRoots; i++) { + let unit = roots[i] === 0 || roots[i] === 1 ? 0.5 : 1; + let x_ = quadraticAt(x0, x1, x2, roots[i]); + if (x_ < x) { + continue; } - this._offsets = accLenArr; - this._length = len; - }; - // Override - EffectPolyline.prototype._getLineLength = function () { - return this._length; - }; - // Override - EffectPolyline.prototype._updateSymbolPosition = function (symbol) { - var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t; - var points = this._points; - var offsets = this._offsets; - var len = points.length; - if (!offsets) { - // Has length 0 - return; + if (roots[i] < t) { + w += y_ < y0 ? unit : -unit; + } else { + w += y2 < y_ ? unit : -unit; } - var lastFrame = this._lastFrame; - var frame; - if (t < this._lastFramePercent) { - // Start from the next frame - // PENDING start from lastFrame ? - var start = Math.min(lastFrame + 1, len - 1); - for (frame = start; frame >= 0; frame--) { - if (offsets[frame] <= t) { - break; - } + } + return w; + } else { + const unit = roots[0] === 0 || roots[0] === 1 ? 0.5 : 1; + const x_ = quadraticAt(x0, x1, x2, roots[0]); + if (x_ < x) { + return 0; + } + return y2 < y0 ? unit : -unit; + } + } +} +function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + const tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + const dTheta = Math.abs(startAngle - endAngle); + if (dTheta < 1e-4) { + return 0; + } + if (dTheta >= PI25 - 1e-4) { + startAngle = 0; + endAngle = PI25; + const dir3 = anticlockwise ? 1 : -1; + if (x >= roots[0] + cx && x <= roots[1] + cx) { + return dir3; + } else { + return 0; + } + } + if (startAngle > endAngle) { + const tmp2 = startAngle; + startAngle = endAngle; + endAngle = tmp2; + } + if (startAngle < 0) { + startAngle += PI25; + endAngle += PI25; + } + let w = 0; + for (let i = 0; i < 2; i++) { + const x_ = roots[i]; + if (x_ + cx > x) { + let angle = Math.atan2(y, x_); + let dir3 = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI25 + angle; + } + if (angle >= startAngle && angle <= endAngle || angle + PI25 >= startAngle && angle + PI25 <= endAngle) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir3 = -dir3; + } + w += dir3; + } + } + } + return w; +} +function containPath(path, lineWidth, isStroke, x, y) { + const data = path.data; + const len2 = path.len(); + let w = 0; + let xi = 0; + let yi = 0; + let x0 = 0; + let y0 = 0; + let x1; + let y1; + for (let i = 0; i < len2; ) { + const cmd = data[i++]; + const isFirst = i === 1; + if (cmd === CMD2.M && i > 1) { + if (!isStroke) { + w += windingLine(xi, yi, x0, y0, x, y); + } + } + if (isFirst) { + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + } + switch (cmd) { + case CMD2.M: + x0 = data[i++]; + y0 = data[i++]; + xi = x0; + yi = y0; + break; + case CMD2.L: + if (isStroke) { + if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) { + return true; } - // PENDING really need to do this ? - frame = Math.min(frame, len - 2); } else { - for (frame = lastFrame; frame < len; frame++) { - if (offsets[frame] > t) { - break; - } - } - frame = Math.min(frame - 1, len - 2); - } - var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]); - var p0 = points[frame]; - var p1 = points[frame + 1]; - symbol.x = p0[0] * (1 - p) + p * p1[0]; - symbol.y = p0[1] * (1 - p) + p * p1[1]; - var tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0]; - var ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1]; - symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; - this._lastFrame = frame; - this._lastFramePercent = t; - symbol.ignore = false; - }; - return EffectPolyline; - }(EffectLine); - - var LargeLinesPathShape = /** @class */function () { - function LargeLinesPathShape() { - this.polyline = false; - this.curveness = 0; - this.segs = []; - } - return LargeLinesPathShape; - }(); - var LargeLinesPath = /** @class */function (_super) { - __extends(LargeLinesPath, _super); - function LargeLinesPath(opts) { - var _this = _super.call(this, opts) || this; - _this._off = 0; - _this.hoverDataIdx = -1; - return _this; - } - LargeLinesPath.prototype.reset = function () { - this.notClear = false; - this._off = 0; - }; - LargeLinesPath.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - LargeLinesPath.prototype.getDefaultShape = function () { - return new LargeLinesPathShape(); - }; - LargeLinesPath.prototype.buildPath = function (ctx, shape) { - var segs = shape.segs; - var curveness = shape.curveness; - var i; - if (shape.polyline) { - for (i = this._off; i < segs.length;) { - var count = segs[i++]; - if (count > 0) { - ctx.moveTo(segs[i++], segs[i++]); - for (var k = 1; k < count; k++) { - ctx.lineTo(segs[i++], segs[i++]); - } - } + w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0; + } + xi = data[i++]; + yi = data[i++]; + break; + case CMD2.C: + if (isStroke) { + if (containStroke2(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) { + return true; } } else { - for (i = this._off; i < segs.length;) { - var x0 = segs[i++]; - var y0 = segs[i++]; - var x1 = segs[i++]; - var y1 = segs[i++]; - ctx.moveTo(x0, y0); - if (curveness > 0) { - var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; - var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; - ctx.quadraticCurveTo(x2, y2, x1, y1); - } else { - ctx.lineTo(x1, y1); - } - } - } - if (this.incremental) { - this._off = i; - this.notClear = true; - } - }; - LargeLinesPath.prototype.findDataIndex = function (x, y) { - var shape = this.shape; - var segs = shape.segs; - var curveness = shape.curveness; - var lineWidth = this.style.lineWidth; - if (shape.polyline) { - var dataIndex = 0; - for (var i = 0; i < segs.length;) { - var count = segs[i++]; - if (count > 0) { - var x0 = segs[i++]; - var y0 = segs[i++]; - for (var k = 1; k < count; k++) { - var x1 = segs[i++]; - var y1 = segs[i++]; - if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { - return dataIndex; - } - } - } - dataIndex++; + 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 CMD2.Q: + if (isStroke) { + if (containStroke3(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) { + return true; } } else { - var dataIndex = 0; - for (var i = 0; i < segs.length;) { - var x0 = segs[i++]; - var y0 = segs[i++]; - var x1 = segs[i++]; - var y1 = segs[i++]; - if (curveness > 0) { - var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; - var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; - if (containStroke$2(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) { - return dataIndex; - } - } else { - if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { - return dataIndex; - } - } - dataIndex++; - } - } - return -1; - }; - LargeLinesPath.prototype.contain = function (x, y) { - var localPos = this.transformCoordToLocal(x, y); - var rect = this.getBoundingRect(); - x = localPos[0]; - y = localPos[1]; - if (rect.contain(x, y)) { - // Cache found data index. - var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); - return dataIdx >= 0; - } - this.hoverDataIdx = -1; - return false; - }; - LargeLinesPath.prototype.getBoundingRect = function () { - // Ignore stroke for large symbol draw. - var rect = this._rect; - if (!rect) { - var shape = this.shape; - var points = shape.segs; - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; - for (var i = 0; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - minX = Math.min(x, minX); - maxX = Math.max(x, maxX); - minY = Math.min(y, minY); - maxY = Math.max(y, maxY); - } - rect = this._rect = new BoundingRect(minX, minY, maxX, maxY); - } - return rect; - }; - return LargeLinesPath; - }(Path); - var LargeLineDraw = /** @class */function () { - function LargeLineDraw() { - this.group = new Group(); - } - /** - * Update symbols draw by new data - */ - LargeLineDraw.prototype.updateData = function (data) { - this._clear(); - var lineEl = this._create(); - lineEl.setShape({ - segs: data.getLayout('linesPoints') - }); - this._setCommon(lineEl, data); - }; - /** - * @override - */ - LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) { - this.group.removeAll(); - this._clear(); - }; - /** - * @override - */ - LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) { - var lastAdded = this._newAdded[0]; - var linePoints = data.getLayout('linesPoints'); - var oldSegs = lastAdded && lastAdded.shape.segs; - // Merging the exists. Each element has 1e4 points. - // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization) - if (oldSegs && oldSegs.length < 2e4) { - var oldLen = oldSegs.length; - var newSegs = new Float32Array(oldLen + linePoints.length); - // Concat two array - newSegs.set(oldSegs); - newSegs.set(linePoints, oldLen); - lastAdded.setShape({ - segs: newSegs - }); + w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0; + } + xi = data[i++]; + yi = data[i++]; + break; + case CMD2.A: + const cx = data[i++]; + const cy = data[i++]; + const rx = data[i++]; + const ry = data[i++]; + const theta = data[i++]; + const dTheta = data[i++]; + i += 1; + const anticlockwise = !!(1 - data[i++]); + x1 = Math.cos(theta) * rx + cx; + y1 = Math.sin(theta) * ry + cy; + if (!isFirst) { + w += windingLine(xi, yi, x1, y1, x, y); } else { - // Clear - this._newAdded = []; - var lineEl = this._create(); - lineEl.incremental = true; - lineEl.setShape({ - segs: linePoints - }); - this._setCommon(lineEl, data); - lineEl.__startIndex = taskParams.start; + x0 = x1; + y0 = y1; } - }; - /** - * @override - */ - LargeLineDraw.prototype.remove = function () { - this._clear(); - }; - LargeLineDraw.prototype.eachRendered = function (cb) { - this._newAdded[0] && cb(this._newAdded[0]); - }; - LargeLineDraw.prototype._create = function () { - var lineEl = new LargeLinesPath({ - cursor: 'default', - ignoreCoarsePointer: true - }); - this._newAdded.push(lineEl); - this.group.add(lineEl); - return lineEl; - }; - LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) { - var hostModel = data.hostModel; - lineEl.setShape({ - polyline: hostModel.get('polyline'), - curveness: hostModel.get(['lineStyle', 'curveness']) - }); - lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle()); - lineEl.style.strokeNoScale = true; - var style = data.getVisual('style'); - if (style && style.stroke) { - lineEl.setStyle('stroke', style.stroke); - } - lineEl.setStyle('fill', null); - var ecData = getECData(lineEl); - // Enable tooltip - // PENDING May have performance issue when path is extremely large - ecData.seriesIndex = hostModel.seriesIndex; - lineEl.on('mousemove', function (e) { - ecData.dataIndex = null; - var dataIndex = lineEl.hoverDataIdx; - if (dataIndex > 0) { - // Provide dataIndex for tooltip - ecData.dataIndex = dataIndex + lineEl.__startIndex; - } - }); - }; - LargeLineDraw.prototype._clear = function () { - this._newAdded = []; - this.group.removeAll(); - }; - return LargeLineDraw; - }(); - - var linesLayout = { - seriesType: 'lines', - plan: createRenderPlanner(), - reset: function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - if (!coordSys) { - if ("development" !== 'production') { - error('The lines series must have a coordinate system.'); + const _x = (x - cx) * ry / rx + cx; + if (isStroke) { + if (containStroke4(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) { + return true; } - return; - } - var isPolyline = seriesModel.get('polyline'); - var isLarge = seriesModel.pipelineContext.large; - return { - progress: function (params, lineData) { - var lineCoords = []; - if (isLarge) { - var points = void 0; - 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); - } - } + } 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 CMD2.R: + x0 = xi = data[i++]; + y0 = yi = data[i++]; + const width = data[i++]; + const height = data[i++]; + x1 = x0 + width; + y1 = y0 + height; + if (isStroke) { + if (containStroke(x0, y0, x1, y0, lineWidth, x, y) || containStroke(x1, y0, x1, y1, lineWidth, x, y) || containStroke(x1, y1, x0, y1, lineWidth, x, y) || containStroke(x0, y1, x0, y0, lineWidth, x, y)) { + return true; } - }; - } - }; - - var LinesView = /** @class */function (_super) { - __extends(LinesView, _super); - function LinesView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = LinesView.type; - return _this; - } - LinesView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var lineDraw = this._updateLineDraw(data, seriesModel); - var zlevel = seriesModel.get('zlevel'); - var trailLength = seriesModel.get(['effect', 'trailLength']); - var zr = api.getZr(); - // Avoid the drag cause ghost shadow - // FIXME Better way ? - // SVG doesn't support - var isSvg = zr.painter.getType() === 'svg'; - if (!isSvg) { - zr.painter.getLayer(zlevel).clear(true); - } - // Config layer with motion blur - if (this._lastZlevel != null && !isSvg) { - zr.configLayer(this._lastZlevel, { - motionBlur: false - }); + } else { + w += windingLine(x1, y0, x1, y1, x, y); + w += windingLine(x0, y1, x0, y0, x, y); } - if (this._showEffect(seriesModel) && trailLength > 0) { - if (!isSvg) { - zr.configLayer(zlevel, { - motionBlur: true, - lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) - }); - } else if ("development" !== 'production') { - console.warn('SVG render mode doesn\'t support lines with trail effect'); + break; + case CMD2.Z: + if (isStroke) { + if (containStroke(xi, yi, x0, y0, lineWidth, x, y)) { + return true; } - } - lineDraw.updateData(data); - var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); - if (clipPath) { - this.group.setClipPath(clipPath); } else { - this.group.removeClipPath(); - } - this._lastZlevel = zlevel; - this._finished = true; - }; - LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var lineDraw = this._updateLineDraw(data, seriesModel); - lineDraw.incrementalPrepareUpdate(data); - this._clearLayer(api); - this._finished = false; - }; - LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { - this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData()); - this._finished = taskParams.end === seriesModel.getData().count(); - }; - LinesView.prototype.eachRendered = function (cb) { - this._lineDraw && this._lineDraw.eachRendered(cb); - }; - LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var pipelineContext = seriesModel.pipelineContext; - if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) { - // TODO Don't have to do update in large mode. Only do it when there are millions of data. - return { - update: true - }; + w += windingLine(xi, yi, x0, y0, x, y); + } + xi = x0; + yi = y0; + break; + } + } + if (!isStroke && !isAroundEqual(yi, y0)) { + w += windingLine(xi, yi, x0, y0, x, y) || 0; + } + return w !== 0; +} +function contain(pathProxy, x, y) { + return containPath(pathProxy, 0, false, x, y); +} +function containStroke5(pathProxy, lineWidth, x, y) { + return containPath(pathProxy, lineWidth, true, x, y); +} + +// node_modules/zrender/src/graphic/Path.ts +var DEFAULT_PATH_STYLE = defaults({ + fill: "#000", + stroke: null, + strokePercent: 1, + fillOpacity: 1, + strokeOpacity: 1, + lineDashOffset: 0, + lineWidth: 1, + lineCap: "butt", + miterLimit: 10, + strokeNoScale: false, + strokeFirst: false +}, DEFAULT_COMMON_STYLE); +var DEFAULT_PATH_ANIMATION_PROPS = { + style: defaults({ + fill: true, + stroke: true, + strokePercent: true, + fillOpacity: true, + strokeOpacity: true, + lineDashOffset: true, + lineWidth: true, + miterLimit: true + }, DEFAULT_COMMON_ANIMATION_PROPS.style) +}; +var pathCopyParams = TRANSFORMABLE_PROPS.concat([ + "invisible", + "culling", + "z", + "z2", + "zlevel", + "parent" +]); +var Path2 = class extends Displayable_default { + constructor(opts) { + super(opts); + } + update() { + super.update(); + const style = this.style; + if (style.decal) { + const decalEl = this._decalEl = this._decalEl || new Path2(); + if (decalEl.buildPath === Path2.prototype.buildPath) { + decalEl.buildPath = (ctx) => { + this.buildPath(ctx, this.shape); + }; + } + decalEl.silent = true; + const decalElStyle = decalEl.style; + for (let key in style) { + if (decalElStyle[key] !== style[key]) { + decalElStyle[key] = style[key]; + } + } + decalElStyle.fill = style.fill ? style.decal : null; + decalElStyle.decal = null; + decalElStyle.shadowColor = null; + style.strokeFirst && (decalElStyle.stroke = null); + for (let i = 0; i < pathCopyParams.length; ++i) { + decalEl[pathCopyParams[i]] = this[pathCopyParams[i]]; + } + decalEl.__dirty |= REDRAW_BIT; + } else if (this._decalEl) { + this._decalEl = null; + } + } + getDecalElement() { + return this._decalEl; + } + _init(props) { + const keysArr = keys(props); + this.shape = this.getDefaultShape(); + const defaultStyle = this.getDefaultStyle(); + if (defaultStyle) { + this.useStyle(defaultStyle); + } + for (let i = 0; i < keysArr.length; i++) { + const key = keysArr[i]; + const value = props[key]; + if (key === "style") { + if (!this.style) { + this.useStyle(value); } else { - // TODO Use same logic with ScatterView. - // Manually update layout - var res = linesLayout.reset(seriesModel, ecModel, api); - if (res.progress) { - res.progress({ - start: 0, - end: data.count(), - count: data.count() - }, data); - } - // Not in large mode - this._lineDraw.updateLayout(); - this._clearLayer(api); - } - }; - LinesView.prototype._updateLineDraw = function (data, seriesModel) { - var lineDraw = this._lineDraw; - var hasEffect = this._showEffect(seriesModel); - var isPolyline = !!seriesModel.get('polyline'); - var pipelineContext = seriesModel.pipelineContext; - var isLargeDraw = pipelineContext.large; - if ("development" !== 'production') { - if (hasEffect && isLargeDraw) { - console.warn('Large lines not support effect'); - } + extend(this.style, value); } - if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) { - if (lineDraw) { - lineDraw.remove(); + } else if (key === "shape") { + extend(this.shape, value); + } else { + super.attrKV(key, value); + } + } + if (!this.style) { + this.useStyle({}); + } + } + getDefaultStyle() { + return null; + } + getDefaultShape() { + return {}; + } + canBeInsideText() { + return this.hasFill(); + } + getInsideTextFill() { + const pathFill = this.style.fill; + if (pathFill !== "none") { + if (isString(pathFill)) { + const fillLum = lum(pathFill, 0); + if (fillLum > 0.5) { + return DARK_LABEL_COLOR; + } else if (fillLum > 0.2) { + return LIGHTER_LABEL_COLOR; + } + return LIGHT_LABEL_COLOR; + } else if (pathFill) { + return LIGHT_LABEL_COLOR; + } + } + return DARK_LABEL_COLOR; + } + getInsideTextStroke(textFill) { + const pathFill = this.style.fill; + if (isString(pathFill)) { + const zr = this.__zr; + const isDarkMode2 = !!(zr && zr.isDarkMode()); + const isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD; + if (isDarkMode2 === isDarkLabel) { + return pathFill; + } + } + } + buildPath(ctx, shapeCfg, inBatch) { + } + pathUpdated() { + this.__dirty &= ~SHAPE_CHANGED_BIT; + } + getUpdatedPathProxy(inBatch) { + !this.path && this.createPathProxy(); + this.path.beginPath(); + this.buildPath(this.path, this.shape, inBatch); + return this.path; + } + createPathProxy() { + this.path = new PathProxy_default(false); + } + hasStroke() { + const style = this.style; + const stroke = style.stroke; + return !(stroke == null || stroke === "none" || !(style.lineWidth > 0)); + } + hasFill() { + const style = this.style; + const fill = style.fill; + return fill != null && fill !== "none"; + } + getBoundingRect() { + let rect = this._rect; + const style = this.style; + const needsUpdateRect = !rect; + if (needsUpdateRect) { + let firstInvoke = false; + if (!this.path) { + firstInvoke = true; + this.createPathProxy(); + } + let path = this.path; + if (firstInvoke || this.__dirty & SHAPE_CHANGED_BIT) { + path.beginPath(); + this.buildPath(path, this.shape, false); + this.pathUpdated(); + } + rect = path.getBoundingRect(); + } + this._rect = rect; + if (this.hasStroke() && this.path && this.path.len() > 0) { + const rectStroke = this._rectStroke || (this._rectStroke = rect.clone()); + if (this.__dirty || needsUpdateRect) { + rectStroke.copy(rect); + const lineScale = style.strokeNoScale ? this.getLineScale() : 1; + let w = style.lineWidth; + if (!this.hasFill()) { + const strokeContainThreshold = this.strokeContainThreshold; + w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold); + } + if (lineScale > 1e-10) { + rectStroke.width += w / lineScale; + rectStroke.height += w / lineScale; + rectStroke.x -= w / lineScale / 2; + rectStroke.y -= w / lineScale / 2; + } + } + return rectStroke; + } + return rect; + } + contain(x, y) { + const localPos = this.transformCoordToLocal(x, y); + const rect = this.getBoundingRect(); + const style = this.style; + x = localPos[0]; + y = localPos[1]; + if (rect.contain(x, y)) { + const pathProxy = this.path; + if (this.hasStroke()) { + let lineWidth = style.lineWidth; + let lineScale = style.strokeNoScale ? this.getLineScale() : 1; + if (lineScale > 1e-10) { + if (!this.hasFill()) { + lineWidth = Math.max(lineWidth, this.strokeContainThreshold); + } + if (containStroke5(pathProxy, lineWidth / lineScale, x, y)) { + return true; } - lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline$1 : hasEffect ? EffectLine : Line$1); - this._hasEffet = hasEffect; - this._isPolyline = isPolyline; - this._isLargeDraw = isLargeDraw; - } - this.group.add(lineDraw.group); - return lineDraw; - }; - LinesView.prototype._showEffect = function (seriesModel) { - return !!seriesModel.get(['effect', 'show']); - }; - LinesView.prototype._clearLayer = function (api) { - // Not use motion when dragging or zooming - var zr = api.getZr(); - var isSvg = zr.painter.getType() === 'svg'; - if (!isSvg && this._lastZlevel != null) { - zr.painter.getLayer(this._lastZlevel).clear(true); } - }; - LinesView.prototype.remove = function (ecModel, api) { - this._lineDraw && this._lineDraw.remove(); - this._lineDraw = null; - // Clear motion when lineDraw is removed - this._clearLayer(api); - }; - LinesView.prototype.dispose = function (ecModel, api) { - this.remove(ecModel, api); - }; - LinesView.type = 'lines'; - return LinesView; - }(ChartView); - - var Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array; - var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array; - function compatEc2(seriesOpt) { - var data = seriesOpt.data; - if (data && data[0] && data[0][0] && data[0][0].coord) { - if ("development" !== 'production') { - console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }'); - } - seriesOpt.data = map(data, function (itemOpt) { - var coords = [itemOpt[0].coord, itemOpt[1].coord]; - var target = { - coords: coords - }; - if (itemOpt[0].name) { - target.fromName = itemOpt[0].name; - } - if (itemOpt[1].name) { - target.toName = itemOpt[1].name; - } - return mergeAll([target, itemOpt[0], itemOpt[1]]); - }); } - } - var LinesSeriesModel = /** @class */function (_super) { - __extends(LinesSeriesModel, _super); - function LinesSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = LinesSeriesModel.type; - _this.visualStyleAccessPath = 'lineStyle'; - _this.visualDrawType = 'stroke'; - return _this; - } - LinesSeriesModel.prototype.init = function (option) { - // The input data may be null/undefined. - option.data = option.data || []; - // Not using preprocessor because mergeOption may not have series.type - compatEc2(option); - var result = this._processFlatCoordsArray(option.data); - this._flatCoords = result.flatCoords; - this._flatCoordsOffset = result.flatCoordsOffset; - if (result.flatCoords) { - option.data = new Float32Array(result.count); - } - _super.prototype.init.apply(this, arguments); - }; - LinesSeriesModel.prototype.mergeOption = function (option) { - compatEc2(option); - if (option.data) { - // Only update when have option data to merge. - var result = this._processFlatCoordsArray(option.data); - this._flatCoords = result.flatCoords; - this._flatCoordsOffset = result.flatCoordsOffset; - if (result.flatCoords) { - option.data = new Float32Array(result.count); - } + if (this.hasFill()) { + return contain(pathProxy, x, y); + } + } + return false; + } + dirtyShape() { + this.__dirty |= SHAPE_CHANGED_BIT; + if (this._rect) { + this._rect = null; + } + if (this._decalEl) { + this._decalEl.dirtyShape(); + } + this.markRedraw(); + } + dirty() { + this.dirtyStyle(); + this.dirtyShape(); + } + animateShape(loop) { + return this.animate("shape", loop); + } + updateDuringAnimation(targetKey) { + if (targetKey === "style") { + this.dirtyStyle(); + } else if (targetKey === "shape") { + this.dirtyShape(); + } else { + this.markRedraw(); + } + } + attrKV(key, value) { + if (key === "shape") { + this.setShape(value); + } else { + super.attrKV(key, value); + } + } + setShape(keyOrObj, value) { + let shape = this.shape; + if (!shape) { + shape = this.shape = {}; + } + if (typeof keyOrObj === "string") { + shape[keyOrObj] = value; + } else { + extend(shape, keyOrObj); + } + this.dirtyShape(); + return this; + } + shapeChanged() { + return !!(this.__dirty & SHAPE_CHANGED_BIT); + } + createStyle(obj) { + return createObject(DEFAULT_PATH_STYLE, obj); + } + _innerSaveToNormal(toState) { + super._innerSaveToNormal(toState); + const normalState = this._normalState; + if (toState.shape && !normalState.shape) { + normalState.shape = extend({}, this.shape); + } + } + _applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg) { + super._applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg); + const needsRestoreToNormal = !(state && keepCurrentStates); + let targetShape; + if (state && state.shape) { + if (transition) { + if (keepCurrentStates) { + targetShape = state.shape; + } else { + targetShape = extend({}, normalState.shape); + extend(targetShape, state.shape); } - _super.prototype.mergeOption.apply(this, arguments); - }; - LinesSeriesModel.prototype.appendData = function (params) { - var result = this._processFlatCoordsArray(params.data); - if (result.flatCoords) { - if (!this._flatCoords) { - this._flatCoords = result.flatCoords; - this._flatCoordsOffset = result.flatCoordsOffset; + } else { + targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape); + extend(targetShape, state.shape); + } + } else if (needsRestoreToNormal) { + targetShape = normalState.shape; + } + if (targetShape) { + if (transition) { + this.shape = extend({}, this.shape); + const targetShapePrimaryProps = {}; + const shapeKeys = keys(targetShape); + for (let i = 0; i < shapeKeys.length; i++) { + const key = shapeKeys[i]; + if (typeof targetShape[key] === "object") { + this.shape[key] = targetShape[key]; } else { - this._flatCoords = concatArray(this._flatCoords, result.flatCoords); - this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset); - } - params.data = new Float32Array(result.count); - } - this.getRawData().appendData(params.data); - }; - LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) { - var itemModel = this.getData().getItemModel(idx); - var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords'); - if ("development" !== 'production') { - if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { - throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'); + targetShapePrimaryProps[key] = targetShape[key]; } } - return coords; - }; - LinesSeriesModel.prototype.getLineCoordsCount = function (idx) { - if (this._flatCoordsOffset) { - return this._flatCoordsOffset[idx * 2 + 1]; - } else { - return this._getCoordsFromItemModel(idx).length; - } - }; - LinesSeriesModel.prototype.getLineCoords = function (idx, out) { - if (this._flatCoordsOffset) { - var offset = this._flatCoordsOffset[idx * 2]; - var len = this._flatCoordsOffset[idx * 2 + 1]; - for (var i = 0; i < len; i++) { - out[i] = out[i] || []; - out[i][0] = this._flatCoords[offset + i * 2]; - out[i][1] = this._flatCoords[offset + i * 2 + 1]; - } - return len; + this._transitionState(stateName, { + shape: targetShapePrimaryProps + }, animationCfg); + } else { + this.shape = targetShape; + this.dirtyShape(); + } + } + } + _mergeStates(states) { + const mergedState = super._mergeStates(states); + let mergedShape; + for (let i = 0; i < states.length; i++) { + const state = states[i]; + if (state.shape) { + mergedShape = mergedShape || {}; + this._mergeStyle(mergedShape, state.shape); + } + } + if (mergedShape) { + mergedState.shape = mergedShape; + } + return mergedState; + } + getAnimationStyleProps() { + return DEFAULT_PATH_ANIMATION_PROPS; + } + isZeroArea() { + return false; + } + static extend(defaultProps) { + class Sub extends Path2 { + getDefaultStyle() { + return clone(defaultProps.style); + } + getDefaultShape() { + return clone(defaultProps.shape); + } + constructor(opts) { + super(opts); + defaultProps.init && defaultProps.init.call(this, opts); + } + } + for (let key in defaultProps) { + if (typeof defaultProps[key] === "function") { + Sub.prototype[key] = defaultProps[key]; + } + } + return Sub; + } +}; +var Path = Path2; +Path.initDefaultProps = function() { + const pathProto = Path2.prototype; + pathProto.type = "path"; + pathProto.strokeContainThreshold = 5; + pathProto.segmentIgnoreThreshold = 0; + pathProto.subPixelOptimize = false; + pathProto.autoBatch = false; + pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT; +}(); +var Path_default = Path; + +// node_modules/zrender/src/graphic/TSpan.ts +var DEFAULT_TSPAN_STYLE = defaults({ + strokeFirst: true, + font: DEFAULT_FONT, + x: 0, + y: 0, + textAlign: "left", + textBaseline: "top", + miterLimit: 2 +}, DEFAULT_PATH_STYLE); +var TSpan2 = class extends Displayable_default { + hasStroke() { + const style = this.style; + const stroke = style.stroke; + return stroke != null && stroke !== "none" && style.lineWidth > 0; + } + hasFill() { + const style = this.style; + const fill = style.fill; + return fill != null && fill !== "none"; + } + createStyle(obj) { + return createObject(DEFAULT_TSPAN_STYLE, obj); + } + setBoundingRect(rect) { + this._rect = rect; + } + getBoundingRect() { + const style = this.style; + if (!this._rect) { + let text = style.text; + text != null ? text += "" : text = ""; + const rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline); + rect.x += style.x || 0; + rect.y += style.y || 0; + if (this.hasStroke()) { + const w = style.lineWidth; + rect.x -= w / 2; + rect.y -= w / 2; + rect.width += w; + rect.height += w; + } + this._rect = rect; + } + return this._rect; + } +}; +var TSpan = TSpan2; +TSpan.initDefaultProps = function() { + const tspanProto = TSpan2.prototype; + tspanProto.dirtyRectTolerance = 10; +}(); +TSpan.prototype.type = "tspan"; +var TSpan_default = TSpan; + +// node_modules/zrender/src/graphic/Image.ts +var DEFAULT_IMAGE_STYLE = defaults({ + x: 0, + y: 0 +}, DEFAULT_COMMON_STYLE); +var DEFAULT_IMAGE_ANIMATION_PROPS = { + style: defaults({ + x: true, + y: true, + width: true, + height: true, + sx: true, + sy: true, + sWidth: true, + sHeight: true + }, DEFAULT_COMMON_ANIMATION_PROPS.style) +}; +function isImageLike(source) { + return !!(source && typeof source !== "string" && source.width && source.height); +} +var ZRImage = class extends Displayable_default { + createStyle(obj) { + return createObject(DEFAULT_IMAGE_STYLE, obj); + } + _getSize(dim) { + const style = this.style; + let size = style[dim]; + if (size != null) { + return size; + } + const imageSource = isImageLike(style.image) ? style.image : this.__image; + if (!imageSource) { + return 0; + } + const otherDim = dim === "width" ? "height" : "width"; + let otherDimSize = style[otherDim]; + if (otherDimSize == null) { + return imageSource[dim]; + } else { + return imageSource[dim] / imageSource[otherDim] * otherDimSize; + } + } + getWidth() { + return this._getSize("width"); + } + getHeight() { + return this._getSize("height"); + } + getAnimationStyleProps() { + return DEFAULT_IMAGE_ANIMATION_PROPS; + } + getBoundingRect() { + const style = this.style; + if (!this._rect) { + this._rect = new BoundingRect_default(style.x || 0, style.y || 0, this.getWidth(), this.getHeight()); + } + return this._rect; + } +}; +ZRImage.prototype.type = "image"; +var Image_default = ZRImage; + +// node_modules/zrender/src/graphic/helper/roundRect.ts +function buildPath(ctx, shape) { + let x = shape.x; + let y = shape.y; + let width = shape.width; + let height = shape.height; + let r = shape.r; + let r1; + let r2; + let r3; + let r4; + if (width < 0) { + x = x + width; + width = -width; + } + if (height < 0) { + y = y + height; + height = -height; + } + if (typeof r === "number") { + r1 = r2 = r3 = r4 = r; + } else if (r instanceof Array) { + if (r.length === 1) { + r1 = r2 = r3 = r4 = r[0]; + } else if (r.length === 2) { + r1 = r3 = r[0]; + r2 = r4 = r[1]; + } else if (r.length === 3) { + r1 = r[0]; + r2 = r4 = r[1]; + r3 = r[2]; + } else { + r1 = r[0]; + r2 = r[1]; + r3 = r[2]; + r4 = r[3]; + } + } else { + r1 = r2 = r3 = r4 = 0; + } + let total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } + ctx.moveTo(x + r1, y); + ctx.lineTo(x + width - r2, y); + r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5); +} + +// node_modules/zrender/src/graphic/helper/subPixelOptimize.ts +var round2 = Math.round; +function subPixelOptimizeLine(outputShape, inputShape, style) { + if (!inputShape) { + return; + } + const x1 = inputShape.x1; + const x2 = inputShape.x2; + const y1 = inputShape.y1; + const y2 = inputShape.y2; + outputShape.x1 = x1; + outputShape.x2 = x2; + outputShape.y1 = y1; + outputShape.y2 = y2; + const lineWidth = style && style.lineWidth; + if (!lineWidth) { + return outputShape; + } + if (round2(x1 * 2) === round2(x2 * 2)) { + outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true); + } + if (round2(y1 * 2) === round2(y2 * 2)) { + outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true); + } + return outputShape; +} +function subPixelOptimizeRect(outputShape, inputShape, style) { + if (!inputShape) { + return; + } + const originX = inputShape.x; + const originY = inputShape.y; + const originWidth = inputShape.width; + const originHeight = inputShape.height; + outputShape.x = originX; + outputShape.y = originY; + outputShape.width = originWidth; + outputShape.height = originHeight; + const lineWidth = style && style.lineWidth; + if (!lineWidth) { + return outputShape; + } + outputShape.x = subPixelOptimize(originX, lineWidth, true); + outputShape.y = subPixelOptimize(originY, lineWidth, true); + outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1); + outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1); + return outputShape; +} +function subPixelOptimize(position2, lineWidth, positiveOrNegative) { + if (!lineWidth) { + return position2; + } + const doubledPosition = round2(position2 * 2); + return (doubledPosition + round2(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2; +} + +// node_modules/zrender/src/graphic/shape/Rect.ts +var RectShape = class { + constructor() { + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + } +}; +var subPixelOptimizeOutputShape = {}; +var Rect = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultShape() { + return new RectShape(); + } + buildPath(ctx, shape) { + let x; + let y; + let width; + let height; + if (this.subPixelOptimize) { + const optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style); + x = optimizedShape.x; + y = optimizedShape.y; + width = optimizedShape.width; + height = optimizedShape.height; + optimizedShape.r = shape.r; + shape = optimizedShape; + } else { + x = shape.x; + y = shape.y; + width = shape.width; + height = shape.height; + } + if (!shape.r) { + ctx.rect(x, y, width, height); + } else { + buildPath(ctx, shape); + } + } + isZeroArea() { + return !this.shape.width || !this.shape.height; + } +}; +Rect.prototype.type = "rect"; +var Rect_default = Rect; + +// node_modules/zrender/src/graphic/Text.ts +var DEFAULT_RICH_TEXT_COLOR = { + fill: "#000" +}; +var DEFAULT_STROKE_LINE_WIDTH = 2; +var DEFAULT_TEXT_ANIMATION_PROPS = { + style: defaults({ + fill: true, + stroke: true, + fillOpacity: true, + strokeOpacity: true, + lineWidth: true, + fontSize: true, + lineHeight: true, + width: true, + height: true, + textShadowColor: true, + textShadowBlur: true, + textShadowOffsetX: true, + textShadowOffsetY: true, + backgroundColor: true, + padding: true, + borderColor: true, + borderWidth: true, + borderRadius: true + }, DEFAULT_COMMON_ANIMATION_PROPS.style) +}; +var ZRText = class extends Displayable_default { + constructor(opts) { + super(); + this.type = "text"; + this._children = []; + this._defaultStyle = DEFAULT_RICH_TEXT_COLOR; + this.attr(opts); + } + childrenRef() { + return this._children; + } + update() { + super.update(); + if (this.styleChanged()) { + this._updateSubTexts(); + } + for (let i = 0; i < this._children.length; i++) { + const child = this._children[i]; + child.zlevel = this.zlevel; + child.z = this.z; + child.z2 = this.z2; + child.culling = this.culling; + child.cursor = this.cursor; + child.invisible = this.invisible; + } + } + updateTransform() { + const innerTransformable = this.innerTransformable; + if (innerTransformable) { + innerTransformable.updateTransform(); + if (innerTransformable.transform) { + this.transform = innerTransformable.transform; + } + } else { + super.updateTransform(); + } + } + getLocalTransform(m2) { + const innerTransformable = this.innerTransformable; + return innerTransformable ? innerTransformable.getLocalTransform(m2) : super.getLocalTransform(m2); + } + getComputedTransform() { + if (this.__hostTarget) { + this.__hostTarget.getComputedTransform(); + this.__hostTarget.updateInnerText(true); + } + return super.getComputedTransform(); + } + _updateSubTexts() { + this._childCursor = 0; + normalizeTextStyle(this.style); + this.style.rich ? this._updateRichTexts() : this._updatePlainTexts(); + this._children.length = this._childCursor; + this.styleUpdated(); + } + addSelfToZr(zr) { + super.addSelfToZr(zr); + for (let i = 0; i < this._children.length; i++) { + this._children[i].__zr = zr; + } + } + removeSelfFromZr(zr) { + super.removeSelfFromZr(zr); + for (let i = 0; i < this._children.length; i++) { + this._children[i].__zr = null; + } + } + getBoundingRect() { + if (this.styleChanged()) { + this._updateSubTexts(); + } + if (!this._rect) { + const tmpRect3 = new BoundingRect_default(0, 0, 0, 0); + const children = this._children; + const tmpMat = []; + let rect = null; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + const childRect = child.getBoundingRect(); + const transform2 = child.getLocalTransform(tmpMat); + if (transform2) { + tmpRect3.copy(childRect); + tmpRect3.applyTransform(transform2); + rect = rect || tmpRect3.clone(); + rect.union(tmpRect3); } else { - var coords = this._getCoordsFromItemModel(idx); - for (var i = 0; i < coords.length; i++) { - out[i] = out[i] || []; - out[i][0] = coords[i][0]; - out[i][1] = coords[i][1]; - } - return coords.length; - } - }; - LinesSeriesModel.prototype._processFlatCoordsArray = function (data) { - var startOffset = 0; - if (this._flatCoords) { - startOffset = this._flatCoords.length; - } - // Stored as a typed array. In format - // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y | - if (isNumber(data[0])) { - var len = data.length; - // Store offset and len of each segment - var coordsOffsetAndLenStorage = new Uint32Arr(len); - var coordsStorage = new Float64Arr(len); - var coordsCursor = 0; - var offsetCursor = 0; - var dataCount = 0; - for (var i = 0; i < len;) { - dataCount++; - var count = data[i++]; - // Offset - coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; - // Len - coordsOffsetAndLenStorage[offsetCursor++] = count; - for (var k = 0; k < count; k++) { - var x = data[i++]; - var y = data[i++]; - coordsStorage[coordsCursor++] = x; - coordsStorage[coordsCursor++] = y; - if (i > len) { - if ("development" !== 'production') { - throw new Error('Invalid data format.'); - } - } - } - } - return { - flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor), - flatCoords: coordsStorage, - count: dataCount - }; + rect = rect || childRect.clone(); + rect.union(childRect); + } + } + this._rect = rect || tmpRect3; + } + return this._rect; + } + setDefaultTextStyle(defaultTextStyle) { + this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR; + } + setTextContent(textContent) { + if (true) { + throw new Error("Can't attach text on another text"); + } + } + _mergeStyle(targetStyle, sourceStyle) { + if (!sourceStyle) { + return targetStyle; + } + const sourceRich = sourceStyle.rich; + const targetRich = targetStyle.rich || sourceRich && {}; + extend(targetStyle, sourceStyle); + if (sourceRich && targetRich) { + this._mergeRich(targetRich, sourceRich); + targetStyle.rich = targetRich; + } else if (targetRich) { + targetStyle.rich = targetRich; + } + return targetStyle; + } + _mergeRich(targetRich, sourceRich) { + const richNames = keys(sourceRich); + for (let i = 0; i < richNames.length; i++) { + const richName = richNames[i]; + targetRich[richName] = targetRich[richName] || {}; + extend(targetRich[richName], sourceRich[richName]); + } + } + getAnimationStyleProps() { + return DEFAULT_TEXT_ANIMATION_PROPS; + } + _getOrCreateChild(Ctor) { + let child = this._children[this._childCursor]; + if (!child || !(child instanceof Ctor)) { + child = new Ctor(); + } + this._children[this._childCursor++] = child; + child.__zr = this.__zr; + child.parent = this; + return child; + } + _updatePlainTexts() { + const style = this.style; + const textFont = style.font || DEFAULT_FONT; + const textPadding = style.padding; + const text = getStyleText(style); + const contentBlock = parsePlainText(text, style); + const needDrawBg = needDrawBackground(style); + const bgColorDrawn = !!style.backgroundColor; + const outerHeight = contentBlock.outerHeight; + const outerWidth = contentBlock.outerWidth; + const contentWidth = contentBlock.contentWidth; + const textLines = contentBlock.lines; + const lineHeight = contentBlock.lineHeight; + const defaultStyle = this._defaultStyle; + const baseX = style.x || 0; + const baseY = style.y || 0; + const textAlign = style.align || defaultStyle.align || "left"; + const verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || "top"; + let textX = baseX; + let textY = adjustTextY2(baseY, contentBlock.contentHeight, verticalAlign); + if (needDrawBg || textPadding) { + const boxX = adjustTextX(baseX, outerWidth, textAlign); + const boxY = adjustTextY2(baseY, outerHeight, verticalAlign); + needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight); + } + textY += lineHeight / 2; + if (textPadding) { + textX = getTextXForPadding(baseX, textAlign, textPadding); + if (verticalAlign === "top") { + textY += textPadding[0]; + } else if (verticalAlign === "bottom") { + textY -= textPadding[2]; + } + } + let defaultLineWidth = 0; + let useDefaultFill = false; + const textFill = getFill("fill" in style ? style.fill : (useDefaultFill = true, defaultStyle.fill)); + const textStroke = getStroke("stroke" in style ? style.stroke : !bgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) : null); + const hasShadow2 = style.textShadowBlur > 0; + const fixedBoundingRect = style.width != null && (style.overflow === "truncate" || style.overflow === "break" || style.overflow === "breakAll"); + const calculatedLineHeight = contentBlock.calculatedLineHeight; + for (let i = 0; i < textLines.length; i++) { + const el = this._getOrCreateChild(TSpan_default); + const subElStyle = el.createStyle(); + el.useStyle(subElStyle); + subElStyle.text = textLines[i]; + subElStyle.x = textX; + subElStyle.y = textY; + if (textAlign) { + subElStyle.textAlign = textAlign; + } + subElStyle.textBaseline = "middle"; + subElStyle.opacity = style.opacity; + subElStyle.strokeFirst = true; + if (hasShadow2) { + subElStyle.shadowBlur = style.textShadowBlur || 0; + subElStyle.shadowColor = style.textShadowColor || "transparent"; + subElStyle.shadowOffsetX = style.textShadowOffsetX || 0; + subElStyle.shadowOffsetY = style.textShadowOffsetY || 0; + } + subElStyle.stroke = textStroke; + subElStyle.fill = textFill; + if (textStroke) { + subElStyle.lineWidth = style.lineWidth || defaultLineWidth; + subElStyle.lineDash = style.lineDash; + subElStyle.lineDashOffset = style.lineDashOffset || 0; + } + subElStyle.font = textFont; + setSeparateFont(subElStyle, style); + textY += lineHeight; + if (fixedBoundingRect) { + el.setBoundingRect(new BoundingRect_default(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY2(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), contentWidth, calculatedLineHeight)); + } + } + } + _updateRichTexts() { + const style = this.style; + const text = getStyleText(style); + const contentBlock = parseRichText(text, style); + const contentWidth = contentBlock.width; + const outerWidth = contentBlock.outerWidth; + const outerHeight = contentBlock.outerHeight; + const textPadding = style.padding; + const baseX = style.x || 0; + const baseY = style.y || 0; + const defaultStyle = this._defaultStyle; + const textAlign = style.align || defaultStyle.align; + const verticalAlign = style.verticalAlign || defaultStyle.verticalAlign; + const boxX = adjustTextX(baseX, outerWidth, textAlign); + const boxY = adjustTextY2(baseY, outerHeight, verticalAlign); + let xLeft = boxX; + let lineTop = boxY; + if (textPadding) { + xLeft += textPadding[3]; + lineTop += textPadding[0]; + } + let xRight = xLeft + contentWidth; + if (needDrawBackground(style)) { + this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight); + } + const bgColorDrawn = !!style.backgroundColor; + for (let i = 0; i < contentBlock.lines.length; i++) { + const line2 = contentBlock.lines[i]; + const tokens = line2.tokens; + const tokenCount = tokens.length; + const lineHeight = line2.lineHeight; + let remainedWidth = line2.width; + let leftIndex = 0; + let lineXLeft = xLeft; + let lineXRight = xRight; + let rightIndex = tokenCount - 1; + let token; + while (leftIndex < tokenCount && (token = tokens[leftIndex], !token.align || token.align === "left")) { + this._placeToken(token, style, lineHeight, lineTop, lineXLeft, "left", bgColorDrawn); + remainedWidth -= token.width; + lineXLeft += token.width; + leftIndex++; + } + while (rightIndex >= 0 && (token = tokens[rightIndex], token.align === "right")) { + this._placeToken(token, style, lineHeight, lineTop, lineXRight, "right", bgColorDrawn); + remainedWidth -= token.width; + lineXRight -= token.width; + rightIndex--; + } + lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2; + while (leftIndex <= rightIndex) { + token = tokens[leftIndex]; + this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, "center", bgColorDrawn); + lineXLeft += token.width; + leftIndex++; + } + lineTop += lineHeight; + } + } + _placeToken(token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) { + const tokenStyle = style.rich[token.styleName] || {}; + tokenStyle.text = token.text; + const verticalAlign = token.verticalAlign; + let y = lineTop + lineHeight / 2; + if (verticalAlign === "top") { + y = lineTop + token.height / 2; + } else if (verticalAlign === "bottom") { + y = lineTop + lineHeight - token.height / 2; + } + const needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle); + needDrawBg && this._renderBackground(tokenStyle, style, textAlign === "right" ? x - token.width : textAlign === "center" ? x - token.width / 2 : x, y - token.height / 2, token.width, token.height); + const bgColorDrawn = !!tokenStyle.backgroundColor; + const textPadding = token.textPadding; + if (textPadding) { + x = getTextXForPadding(x, textAlign, textPadding); + y -= token.height / 2 - textPadding[0] - token.innerHeight / 2; + } + const el = this._getOrCreateChild(TSpan_default); + const subElStyle = el.createStyle(); + el.useStyle(subElStyle); + const defaultStyle = this._defaultStyle; + let useDefaultFill = false; + let defaultLineWidth = 0; + const textFill = getFill("fill" in tokenStyle ? tokenStyle.fill : "fill" in style ? style.fill : (useDefaultFill = true, defaultStyle.fill)); + const textStroke = getStroke("stroke" in tokenStyle ? tokenStyle.stroke : "stroke" in style ? style.stroke : !bgColorDrawn && !parentBgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) : null); + const hasShadow2 = tokenStyle.textShadowBlur > 0 || style.textShadowBlur > 0; + subElStyle.text = token.text; + subElStyle.x = x; + subElStyle.y = y; + if (hasShadow2) { + subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0; + subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || "transparent"; + subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0; + subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0; + } + subElStyle.textAlign = textAlign; + subElStyle.textBaseline = "middle"; + subElStyle.font = token.font || DEFAULT_FONT; + subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1); + setSeparateFont(subElStyle, tokenStyle); + if (textStroke) { + subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth); + subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash); + subElStyle.lineDashOffset = style.lineDashOffset || 0; + subElStyle.stroke = textStroke; + } + if (textFill) { + subElStyle.fill = textFill; + } + const textWidth = token.contentWidth; + const textHeight = token.contentHeight; + el.setBoundingRect(new BoundingRect_default(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY2(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight)); + } + _renderBackground(style, topStyle, x, y, width, height) { + const textBackgroundColor = style.backgroundColor; + const textBorderWidth = style.borderWidth; + const textBorderColor = style.borderColor; + const isImageBg = textBackgroundColor && textBackgroundColor.image; + const isPlainOrGradientBg = textBackgroundColor && !isImageBg; + const textBorderRadius = style.borderRadius; + const self2 = this; + let rectEl; + let imgEl; + if (isPlainOrGradientBg || style.lineHeight || textBorderWidth && textBorderColor) { + rectEl = this._getOrCreateChild(Rect_default); + rectEl.useStyle(rectEl.createStyle()); + rectEl.style.fill = null; + const rectShape = rectEl.shape; + rectShape.x = x; + rectShape.y = y; + rectShape.width = width; + rectShape.height = height; + rectShape.r = textBorderRadius; + rectEl.dirtyShape(); + } + if (isPlainOrGradientBg) { + const rectStyle = rectEl.style; + rectStyle.fill = textBackgroundColor || null; + rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1); + } else if (isImageBg) { + imgEl = this._getOrCreateChild(Image_default); + imgEl.onload = function() { + self2.dirtyStyle(); + }; + const imgStyle = imgEl.style; + imgStyle.image = textBackgroundColor.image; + imgStyle.x = x; + imgStyle.y = y; + imgStyle.width = width; + imgStyle.height = height; + } + if (textBorderWidth && textBorderColor) { + const rectStyle = rectEl.style; + rectStyle.lineWidth = textBorderWidth; + rectStyle.stroke = textBorderColor; + rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1); + rectStyle.lineDash = style.borderDash; + rectStyle.lineDashOffset = style.borderDashOffset || 0; + rectEl.strokeContainThreshold = 0; + if (rectEl.hasFill() && rectEl.hasStroke()) { + rectStyle.strokeFirst = true; + rectStyle.lineWidth *= 2; + } + } + const commonStyle = (rectEl || imgEl).style; + commonStyle.shadowBlur = style.shadowBlur || 0; + commonStyle.shadowColor = style.shadowColor || "transparent"; + commonStyle.shadowOffsetX = style.shadowOffsetX || 0; + commonStyle.shadowOffsetY = style.shadowOffsetY || 0; + commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1); + } + static makeFont(style) { + let font = ""; + if (hasSeparateFont(style)) { + font = [ + style.fontStyle, + style.fontWeight, + parseFontSize(style.fontSize), + style.fontFamily || "sans-serif" + ].join(" "); + } + return font && trim(font) || style.textFont || style.font; + } +}; +var VALID_TEXT_ALIGN = {left: true, right: 1, center: 1}; +var VALID_TEXT_VERTICAL_ALIGN = {top: 1, bottom: 1, middle: 1}; +var FONT_PARTS = ["fontStyle", "fontWeight", "fontSize", "fontFamily"]; +function parseFontSize(fontSize) { + if (typeof fontSize === "string" && (fontSize.indexOf("px") !== -1 || fontSize.indexOf("rem") !== -1 || fontSize.indexOf("em") !== -1)) { + return fontSize; + } else if (!isNaN(+fontSize)) { + return fontSize + "px"; + } else { + return DEFAULT_FONT_SIZE + "px"; + } +} +function setSeparateFont(targetStyle, sourceStyle) { + for (let i = 0; i < FONT_PARTS.length; i++) { + const fontProp = FONT_PARTS[i]; + const val = sourceStyle[fontProp]; + if (val != null) { + targetStyle[fontProp] = val; + } + } +} +function hasSeparateFont(style) { + return style.fontSize != null || style.fontFamily || style.fontWeight; +} +function normalizeTextStyle(style) { + normalizeStyle(style); + each(style.rich, normalizeStyle); + return style; +} +function normalizeStyle(style) { + if (style) { + style.font = ZRText.makeFont(style); + let textAlign = style.align; + textAlign === "middle" && (textAlign = "center"); + style.align = textAlign == null || VALID_TEXT_ALIGN[textAlign] ? textAlign : "left"; + let verticalAlign = style.verticalAlign; + verticalAlign === "center" && (verticalAlign = "middle"); + style.verticalAlign = verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign] ? verticalAlign : "top"; + const textPadding = style.padding; + if (textPadding) { + style.padding = normalizeCssArray(style.padding); + } + } +} +function getStroke(stroke, lineWidth) { + return stroke == null || lineWidth <= 0 || stroke === "transparent" || stroke === "none" ? null : stroke.image || stroke.colorStops ? "#000" : stroke; +} +function getFill(fill) { + return fill == null || fill === "none" ? null : fill.image || fill.colorStops ? "#000" : fill; +} +function getTextXForPadding(x, textAlign, textPadding) { + return textAlign === "right" ? x - textPadding[1] : textAlign === "center" ? x + textPadding[3] / 2 - textPadding[1] / 2 : x + textPadding[3]; +} +function getStyleText(style) { + let text = style.text; + text != null && (text += ""); + return text; +} +function needDrawBackground(style) { + return !!(style.backgroundColor || style.lineHeight || style.borderWidth && style.borderColor); +} +var Text_default = ZRText; + +// src/util/innerStore.ts +var getECData = makeInner(); +var setCommonECData = (seriesIndex, dataType, dataIdx, el) => { + if (el) { + const ecData = getECData(el); + ecData.dataIndex = dataIdx; + ecData.dataType = dataType; + ecData.seriesIndex = seriesIndex; + ecData.ssrType = "chart"; + if (el.type === "group") { + el.traverse(function(child) { + const childECData = getECData(child); + childECData.seriesIndex = seriesIndex; + childECData.dataIndex = dataIdx; + childECData.dataType = dataType; + childECData.ssrType = "chart"; + }); + } + } +}; + +// src/util/states.ts +var _highlightNextDigit = 1; +var _highlightKeyMap = {}; +var getSavedStates = makeInner(); +var getComponentStates = makeInner(); +var HOVER_STATE_NORMAL = 0; +var HOVER_STATE_BLUR = 1; +var HOVER_STATE_EMPHASIS = 2; +var SPECIAL_STATES = ["emphasis", "blur", "select"]; +var DISPLAY_STATES = ["normal", "emphasis", "blur", "select"]; +var Z2_EMPHASIS_LIFT = 10; +var Z2_SELECT_LIFT = 9; +var HIGHLIGHT_ACTION_TYPE = "highlight"; +var DOWNPLAY_ACTION_TYPE = "downplay"; +var SELECT_ACTION_TYPE = "select"; +var UNSELECT_ACTION_TYPE = "unselect"; +var TOGGLE_SELECT_ACTION_TYPE = "toggleSelect"; +function hasFillOrStroke(fillOrStroke) { + return fillOrStroke != null && fillOrStroke !== "none"; +} +function doChangeHoverState(el, stateName, hoverStateEnum) { + if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) { + el.onHoverStateChange(stateName); + } + el.hoverState = hoverStateEnum; +} +function singleEnterEmphasis(el) { + doChangeHoverState(el, "emphasis", HOVER_STATE_EMPHASIS); +} +function singleLeaveEmphasis(el) { + if (el.hoverState === HOVER_STATE_EMPHASIS) { + doChangeHoverState(el, "normal", HOVER_STATE_NORMAL); + } +} +function singleEnterBlur(el) { + doChangeHoverState(el, "blur", HOVER_STATE_BLUR); +} +function singleLeaveBlur(el) { + if (el.hoverState === HOVER_STATE_BLUR) { + doChangeHoverState(el, "normal", HOVER_STATE_NORMAL); + } +} +function singleEnterSelect(el) { + el.selected = true; +} +function singleLeaveSelect(el) { + el.selected = false; +} +function updateElementState(el, updater, commonParam) { + updater(el, commonParam); +} +function traverseUpdateState(el, updater, commonParam) { + updateElementState(el, updater, commonParam); + el.isGroup && el.traverse(function(child) { + updateElementState(child, updater, commonParam); + }); +} +function setStatesFlag(el, stateName) { + switch (stateName) { + case "emphasis": + el.hoverState = HOVER_STATE_EMPHASIS; + break; + case "normal": + el.hoverState = HOVER_STATE_NORMAL; + break; + case "blur": + el.hoverState = HOVER_STATE_BLUR; + break; + case "select": + el.selected = true; + } +} +function getFromStateStyle(el, props, toStateName, defaultValue) { + const style = el.style; + const fromState = {}; + for (let i = 0; i < props.length; i++) { + const propName = props[i]; + const val = style[propName]; + fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val; + } + for (let i = 0; i < el.animators.length; i++) { + const animator = el.animators[i]; + if (animator.__fromStateTransition && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === "style") { + animator.saveTo(fromState, props); + } + } + return fromState; +} +function createEmphasisDefaultState(el, stateName, targetStates, state) { + const hasSelect = targetStates && indexOf(targetStates, "select") >= 0; + let cloned = false; + if (el instanceof Path_default) { + const store = getSavedStates(el); + const fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill; + const fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke; + if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) { + state = state || {}; + let emphasisStyle = state.style || {}; + if (emphasisStyle.fill === "inherit") { + cloned = true; + state = extend({}, state); + emphasisStyle = extend({}, emphasisStyle); + emphasisStyle.fill = fromFill; + } else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) { + cloned = true; + state = extend({}, state); + emphasisStyle = extend({}, emphasisStyle); + emphasisStyle.fill = liftColor(fromFill); + } else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) { + if (!cloned) { + state = extend({}, state); + emphasisStyle = extend({}, emphasisStyle); } - return { - flatCoordsOffset: null, - flatCoords: null, - count: data.length - }; - }; - LinesSeriesModel.prototype.getInitialData = function (option, ecModel) { - if ("development" !== 'production') { - var CoordSys = CoordinateSystemManager.get(option.coordinateSystem); - if (!CoordSys) { - throw new Error('Unknown coordinate system ' + option.coordinateSystem); - } + emphasisStyle.stroke = liftColor(fromStroke); + } + state.style = emphasisStyle; + } + } + if (state) { + if (state.z2 == null) { + if (!cloned) { + state = extend({}, state); + } + const z2EmphasisLift = el.z2EmphasisLift; + state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT); + } + } + return state; +} +function createSelectDefaultState(el, stateName, state) { + if (state) { + if (state.z2 == null) { + state = extend({}, state); + const z2SelectLift = el.z2SelectLift; + state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT); + } + } + return state; +} +function createBlurDefaultState(el, stateName, state) { + const hasBlur = indexOf(el.currentStates, stateName) >= 0; + const currentOpacity = el.style.opacity; + const fromState = !hasBlur ? getFromStateStyle(el, ["opacity"], stateName, { + opacity: 1 + }) : null; + state = state || {}; + let blurStyle = state.style || {}; + if (blurStyle.opacity == null) { + state = extend({}, state); + blurStyle = extend({ + opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1 + }, blurStyle); + state.style = blurStyle; + } + return state; +} +function elementStateProxy(stateName, targetStates) { + const state = this.states[stateName]; + if (this.style) { + if (stateName === "emphasis") { + return createEmphasisDefaultState(this, stateName, targetStates, state); + } else if (stateName === "blur") { + return createBlurDefaultState(this, stateName, state); + } else if (stateName === "select") { + return createSelectDefaultState(this, stateName, state); + } + } + return state; +} +function setDefaultStateProxy(el) { + el.stateProxy = elementStateProxy; + const textContent = el.getTextContent(); + const textGuide = el.getTextGuideLine(); + if (textContent) { + textContent.stateProxy = elementStateProxy; + } + if (textGuide) { + textGuide.stateProxy = elementStateProxy; + } +} +function enterEmphasisWhenMouseOver(el, e2) { + !shouldSilent(el, e2) && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis); +} +function leaveEmphasisWhenMouseOut(el, e2) { + !shouldSilent(el, e2) && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis); +} +function enterEmphasis(el, highlightDigit) { + el.__highByOuter |= 1 << (highlightDigit || 0); + traverseUpdateState(el, singleEnterEmphasis); +} +function leaveEmphasis(el, highlightDigit) { + !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis); +} +function enterBlur(el) { + traverseUpdateState(el, singleEnterBlur); +} +function leaveBlur(el) { + traverseUpdateState(el, singleLeaveBlur); +} +function enterSelect(el) { + traverseUpdateState(el, singleEnterSelect); +} +function leaveSelect(el) { + traverseUpdateState(el, singleLeaveSelect); +} +function shouldSilent(el, e2) { + return el.__highDownSilentOnTouch && e2.zrByTouch; +} +function allLeaveBlur(api2) { + const model = api2.getModel(); + const leaveBlurredSeries = []; + const allComponentViews = []; + model.eachComponent(function(componentType, componentModel) { + const componentStates = getComponentStates(componentModel); + const isSeries2 = componentType === "series"; + const view = isSeries2 ? api2.getViewOfSeriesModel(componentModel) : api2.getViewOfComponentModel(componentModel); + !isSeries2 && allComponentViews.push(view); + if (componentStates.isBlured) { + view.group.traverse(function(child) { + singleLeaveBlur(child); + }); + isSeries2 && leaveBlurredSeries.push(componentModel); + } + componentStates.isBlured = false; + }); + each(allComponentViews, function(view) { + if (view && view.toggleBlurSeries) { + view.toggleBlurSeries(leaveBlurredSeries, false, model); + } + }); +} +function blurSeries(targetSeriesIndex, focus, blurScope, api2) { + const ecModel = api2.getModel(); + blurScope = blurScope || "coordinateSystem"; + function leaveBlurOfIndices(data, dataIndices) { + for (let i = 0; i < dataIndices.length; i++) { + const itemEl = data.getItemGraphicEl(dataIndices[i]); + itemEl && leaveBlur(itemEl); + } + } + if (targetSeriesIndex == null) { + return; + } + if (!focus || focus === "none") { + return; + } + const targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex); + let targetCoordSys = targetSeriesModel.coordinateSystem; + if (targetCoordSys && targetCoordSys.master) { + targetCoordSys = targetCoordSys.master; + } + const blurredSeries = []; + ecModel.eachSeries(function(seriesModel) { + const sameSeries = targetSeriesModel === seriesModel; + let coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.master) { + coordSys = coordSys.master; + } + const sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; + if (!(blurScope === "series" && !sameSeries || blurScope === "coordinateSystem" && !sameCoordSys || focus === "series" && sameSeries)) { + const view = api2.getViewOfSeriesModel(seriesModel); + view.group.traverse(function(child) { + if (child.__highByOuter && sameSeries && focus === "self") { + return; } - var lineData = new SeriesData(['value'], this); - lineData.hasItemOption = false; - lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) { - // dataItem is simply coords - if (dataItem instanceof Array) { - return NaN; + singleEnterBlur(child); + }); + if (isArrayLike(focus)) { + leaveBlurOfIndices(seriesModel.getData(), focus); + } else if (isObject(focus)) { + const dataTypes = keys(focus); + for (let d = 0; d < dataTypes.length; d++) { + leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]); + } + } + blurredSeries.push(seriesModel); + getComponentStates(seriesModel).isBlured = true; + } + }); + ecModel.eachComponent(function(componentType, componentModel) { + if (componentType === "series") { + return; + } + const view = api2.getViewOfComponentModel(componentModel); + if (view && view.toggleBlurSeries) { + view.toggleBlurSeries(blurredSeries, true, ecModel); + } + }); +} +function blurComponent(componentMainType, componentIndex, api2) { + if (componentMainType == null || componentIndex == null) { + return; + } + const componentModel = api2.getModel().getComponent(componentMainType, componentIndex); + if (!componentModel) { + return; + } + getComponentStates(componentModel).isBlured = true; + const view = api2.getViewOfComponentModel(componentModel); + if (!view || !view.focusBlurEnabled) { + return; + } + view.group.traverse(function(child) { + singleEnterBlur(child); + }); +} +function blurSeriesFromHighlightPayload(seriesModel, payload, api2) { + const seriesIndex = seriesModel.seriesIndex; + const data = seriesModel.getData(payload.dataType); + if (!data) { + if (true) { + error(`Unknown dataType ${payload.dataType}`); + } + return; + } + let dataIndex = queryDataIndex(data, payload); + dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0; + let el = data.getItemGraphicEl(dataIndex); + if (!el) { + const count2 = data.count(); + let current = 0; + while (!el && current < count2) { + el = data.getItemGraphicEl(current++); + } + } + if (el) { + const ecData = getECData(el); + blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api2); + } else { + const focus = seriesModel.get(["emphasis", "focus"]); + const blurScope = seriesModel.get(["emphasis", "blurScope"]); + if (focus != null) { + blurSeries(seriesIndex, focus, blurScope, api2); + } + } +} +function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api2) { + const ret = { + focusSelf: false, + dispatchers: null + }; + if (componentMainType == null || componentMainType === "series" || componentIndex == null || name == null) { + return ret; + } + const componentModel = api2.getModel().getComponent(componentMainType, componentIndex); + if (!componentModel) { + return ret; + } + const view = api2.getViewOfComponentModel(componentModel); + if (!view || !view.findHighDownDispatchers) { + return ret; + } + const dispatchers = view.findHighDownDispatchers(name); + let focusSelf; + for (let i = 0; i < dispatchers.length; i++) { + if (!isHighDownDispatcher(dispatchers[i])) { + error("param should be highDownDispatcher"); + } + if (getECData(dispatchers[i]).focus === "self") { + focusSelf = true; + break; + } + } + return {focusSelf, dispatchers}; +} +function handleGlobalMouseOverForHighDown(dispatcher, e2, api2) { + if (!isHighDownDispatcher(dispatcher)) { + error("param should be highDownDispatcher"); + } + const ecData = getECData(dispatcher); + const {dispatchers, focusSelf} = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api2); + if (dispatchers) { + if (focusSelf) { + blurComponent(ecData.componentMainType, ecData.componentIndex, api2); + } + each(dispatchers, (dispatcher2) => enterEmphasisWhenMouseOver(dispatcher2, e2)); + } else { + blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api2); + if (ecData.focus === "self") { + blurComponent(ecData.componentMainType, ecData.componentIndex, api2); + } + enterEmphasisWhenMouseOver(dispatcher, e2); + } +} +function handleGlobalMouseOutForHighDown(dispatcher, e2, api2) { + if (!isHighDownDispatcher(dispatcher)) { + error("param should be highDownDispatcher"); + } + allLeaveBlur(api2); + const ecData = getECData(dispatcher); + const {dispatchers} = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api2); + if (dispatchers) { + each(dispatchers, (dispatcher2) => leaveEmphasisWhenMouseOut(dispatcher2, e2)); + } else { + leaveEmphasisWhenMouseOut(dispatcher, e2); + } +} +function toggleSelectionFromPayload(seriesModel, payload, api2) { + if (!isSelectChangePayload(payload)) { + return; + } + const dataType = payload.dataType; + const data = seriesModel.getData(dataType); + let dataIndex = queryDataIndex(data, payload); + if (!isArray(dataIndex)) { + dataIndex = [dataIndex]; + } + seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? "toggleSelect" : payload.type === SELECT_ACTION_TYPE ? "select" : "unselect"](dataIndex, dataType); +} +function updateSeriesElementSelection(seriesModel) { + const allData = seriesModel.getAllData(); + each(allData, function({data, type}) { + data.eachItemGraphicEl(function(el, idx) { + seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el); + }); + }); +} +function getAllSelectedIndices(ecModel) { + const ret = []; + ecModel.eachSeries(function(seriesModel) { + const allData = seriesModel.getAllData(); + each(allData, function({data, type}) { + const dataIndices = seriesModel.getSelectedDataIndices(); + if (dataIndices.length > 0) { + const item = { + dataIndex: dataIndices, + seriesIndex: seriesModel.seriesIndex + }; + if (type != null) { + item.dataType = type; + } + ret.push(item); + } + }); + }); + return ret; +} +function enableHoverEmphasis(el, focus, blurScope) { + setAsHighDownDispatcher(el, true); + traverseUpdateState(el, setDefaultStateProxy); + enableHoverFocus(el, focus, blurScope); +} +function disableHoverEmphasis(el) { + setAsHighDownDispatcher(el, false); +} +function toggleHoverEmphasis(el, focus, blurScope, isDisabled) { + isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope); +} +function enableHoverFocus(el, focus, blurScope) { + const ecData = getECData(el); + if (focus != null) { + ecData.focus = focus; + ecData.blurScope = blurScope; + } else if (ecData.focus) { + ecData.focus = null; + } +} +var OTHER_STATES = ["emphasis", "blur", "select"]; +var defaultStyleGetterMap = { + itemStyle: "getItemStyle", + lineStyle: "getLineStyle", + areaStyle: "getAreaStyle" +}; +function setStatesStylesFromModel(el, itemModel, styleType, getter) { + styleType = styleType || "itemStyle"; + for (let i = 0; i < OTHER_STATES.length; i++) { + const stateName = OTHER_STATES[i]; + const model = itemModel.getModel([stateName, styleType]); + const state = el.ensureState(stateName); + state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]](); + } +} +function setAsHighDownDispatcher(el, asDispatcher) { + const disable = asDispatcher === false; + const extendedEl = el; + if (el.highDownSilentOnTouch) { + extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch; + } + if (!disable || extendedEl.__highDownDispatcher) { + extendedEl.__highByOuter = extendedEl.__highByOuter || 0; + extendedEl.__highDownDispatcher = !disable; + } +} +function isHighDownDispatcher(el) { + return !!(el && el.__highDownDispatcher); +} +function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) { + const ecData = getECData(el); + ecData.componentMainType = componentModel.mainType; + ecData.componentIndex = componentModel.componentIndex; + ecData.componentHighDownName = componentHighDownName; +} +function getHighlightDigit(highlightKey) { + let highlightDigit = _highlightKeyMap[highlightKey]; + if (highlightDigit == null && _highlightNextDigit <= 32) { + highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++; + } + return highlightDigit; +} +function isSelectChangePayload(payload) { + const payloadType = payload.type; + return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE; +} +function isHighDownPayload(payload) { + const payloadType = payload.type; + return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE; +} +function savePathStates(el) { + const store = getSavedStates(el); + store.normalFill = el.style.fill; + store.normalStroke = el.style.stroke; + const selectState = el.states.select || {}; + store.selectFill = selectState.style && selectState.style.fill || null; + store.selectStroke = selectState.style && selectState.style.stroke || null; +} + +// src/util/graphic.ts +var graphic_exports = {}; +__export(graphic_exports, { + Arc: () => Arc_default, + BezierCurve: () => BezierCurve_default, + BoundingRect: () => BoundingRect_default, + Circle: () => Circle_default, + CompoundPath: () => CompoundPath_default, + Ellipse: () => Ellipse_default, + Group: () => Group_default, + Image: () => Image_default, + IncrementalDisplayable: () => IncrementalDisplayable_default, + Line: () => Line_default, + LinearGradient: () => LinearGradient_default, + OrientedBoundingRect: () => OrientedBoundingRect_default, + Path: () => Path_default, + Point: () => Point_default, + Polygon: () => Polygon_default, + Polyline: () => Polyline_default, + RadialGradient: () => RadialGradient_default, + Rect: () => Rect_default, + Ring: () => Ring_default, + Sector: () => Sector_default, + Text: () => Text_default, + applyTransform: () => applyTransform2, + clipPointsByRect: () => clipPointsByRect, + clipRectByRect: () => clipRectByRect, + createIcon: () => createIcon, + extendPath: () => extendPath, + extendShape: () => extendShape, + getShapeClass: () => getShapeClass, + getTransform: () => getTransform, + groupTransition: () => groupTransition, + initProps: () => initProps, + isElementRemoved: () => isElementRemoved, + lineLineIntersect: () => lineLineIntersect, + linePolygonIntersect: () => linePolygonIntersect, + makeImage: () => makeImage, + makePath: () => makePath, + mergePath: () => mergePath2, + registerShape: () => registerShape, + removeElement: () => removeElement, + removeElementWithFadeOut: () => removeElementWithFadeOut, + resizePath: () => resizePath, + setTooltipConfig: () => setTooltipConfig, + subPixelOptimize: () => subPixelOptimize2, + subPixelOptimizeLine: () => subPixelOptimizeLine2, + subPixelOptimizeRect: () => subPixelOptimizeRect2, + transformDirection: () => transformDirection, + traverseElements: () => traverseElements, + updateProps: () => updateProps +}); + +// node_modules/zrender/src/tool/transformPath.ts +var CMD3 = PathProxy_default.CMD; +var points = [[], [], []]; +var mathSqrt2 = Math.sqrt; +var mathAtan2 = Math.atan2; +function transformPath(path, m2) { + if (!m2) { + return; + } + let data = path.data; + const len2 = path.len(); + let cmd; + let nPoint; + let i; + let j; + let k; + let p; + const M = CMD3.M; + const C = CMD3.C; + const L = CMD3.L; + const R = CMD3.R; + const A = CMD3.A; + const Q = CMD3.Q; + for (i = 0, j = 0; i < len2; ) { + cmd = data[i++]; + j = i; + nPoint = 0; + switch (cmd) { + case M: + nPoint = 1; + break; + case L: + nPoint = 1; + break; + case C: + nPoint = 3; + break; + case Q: + nPoint = 2; + break; + case A: + const x = m2[4]; + const y = m2[5]; + const sx = mathSqrt2(m2[0] * m2[0] + m2[1] * m2[1]); + const sy = mathSqrt2(m2[2] * m2[2] + m2[3] * m2[3]); + const angle = mathAtan2(-m2[1] / sy, m2[0] / sx); + data[i] *= sx; + data[i++] += x; + data[i] *= sy; + data[i++] += y; + data[i++] *= sx; + data[i++] *= sy; + data[i++] += angle; + data[i++] += angle; + i += 2; + j = i; + break; + case R: + p[0] = data[i++]; + p[1] = data[i++]; + applyTransform(p, p, m2); + data[j++] = p[0]; + data[j++] = p[1]; + p[0] += data[i++]; + p[1] += data[i++]; + applyTransform(p, p, m2); + data[j++] = p[0]; + data[j++] = p[1]; + } + for (k = 0; k < nPoint; k++) { + let p2 = points[k]; + p2[0] = data[i++]; + p2[1] = data[i++]; + applyTransform(p2, p2, m2); + data[j++] = p2[0]; + data[j++] = p2[1]; + } + } + path.increaseVersion(); +} + +// node_modules/zrender/src/tool/path.ts +var mathSqrt3 = Math.sqrt; +var mathSin3 = Math.sin; +var mathCos3 = Math.cos; +var PI3 = Math.PI; +function vMag(v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); +} +function vRatio(u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); +} +function vAngle(u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); +} +function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) { + const psi = psiDeg * (PI3 / 180); + const xp = mathCos3(psi) * (x1 - x2) / 2 + mathSin3(psi) * (y1 - y2) / 2; + const yp = -1 * mathSin3(psi) * (x1 - x2) / 2 + mathCos3(psi) * (y1 - y2) / 2; + const lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry); + if (lambda > 1) { + rx *= mathSqrt3(lambda); + ry *= mathSqrt3(lambda); + } + const f = (fa === fs ? -1 : 1) * mathSqrt3((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp))) || 0; + const cxp = f * rx * yp / ry; + const cyp = f * -ry * xp / rx; + const cx = (x1 + x2) / 2 + mathCos3(psi) * cxp - mathSin3(psi) * cyp; + const cy = (y1 + y2) / 2 + mathSin3(psi) * cxp + mathCos3(psi) * cyp; + const theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]); + const u = [(xp - cxp) / rx, (yp - cyp) / ry]; + const v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry]; + let dTheta = vAngle(u, v); + if (vRatio(u, v) <= -1) { + dTheta = PI3; + } + if (vRatio(u, v) >= 1) { + dTheta = 0; + } + if (dTheta < 0) { + const n = Math.round(dTheta / PI3 * 1e6) / 1e6; + dTheta = PI3 * 2 + n % 2 * PI3; + } + path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs); +} +var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; +var numberReg = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g; +function createPathProxyFromString(data) { + const path = new PathProxy_default(); + if (!data) { + return path; + } + let cpx = 0; + let cpy = 0; + let subpathX = cpx; + let subpathY = cpy; + let prevCmd; + const CMD6 = PathProxy_default.CMD; + const cmdList = data.match(commandReg); + if (!cmdList) { + return path; + } + for (let l = 0; l < cmdList.length; l++) { + const cmdText = cmdList[l]; + let cmdStr = cmdText.charAt(0); + let cmd; + const p = cmdText.match(numberReg) || []; + const pLen = p.length; + for (let i = 0; i < pLen; i++) { + p[i] = parseFloat(p[i]); + } + let off = 0; + while (off < pLen) { + let ctlPtx; + let ctlPty; + let rx; + let ry; + let psi; + let fa; + let fs; + let x1 = cpx; + let y1 = cpy; + let len2; + let pathData; + switch (cmdStr) { + case "l": + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD6.L; + path.addData(cmd, cpx, cpy); + break; + case "L": + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD6.L; + path.addData(cmd, cpx, cpy); + break; + case "m": + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD6.M; + path.addData(cmd, cpx, cpy); + subpathX = cpx; + subpathY = cpy; + cmdStr = "l"; + break; + case "M": + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD6.M; + path.addData(cmd, cpx, cpy); + subpathX = cpx; + subpathY = cpy; + cmdStr = "L"; + break; + case "h": + cpx += p[off++]; + cmd = CMD6.L; + path.addData(cmd, cpx, cpy); + break; + case "H": + cpx = p[off++]; + cmd = CMD6.L; + path.addData(cmd, cpx, cpy); + break; + case "v": + cpy += p[off++]; + cmd = CMD6.L; + path.addData(cmd, cpx, cpy); + break; + case "V": + cpy = p[off++]; + cmd = CMD6.L; + path.addData(cmd, cpx, cpy); + break; + case "C": + cmd = CMD6.C; + path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]); + cpx = p[off - 2]; + cpy = p[off - 1]; + break; + case "c": + cmd = CMD6.C; + path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy); + cpx += p[off - 2]; + cpy += p[off - 1]; + break; + case "S": + ctlPtx = cpx; + ctlPty = cpy; + len2 = path.len(); + pathData = path.data; + if (prevCmd === CMD6.C) { + ctlPtx += cpx - pathData[len2 - 4]; + ctlPty += cpy - pathData[len2 - 3]; + } + cmd = CMD6.C; + x1 = p[off++]; + y1 = p[off++]; + cpx = p[off++]; + cpy = p[off++]; + path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); + break; + case "s": + ctlPtx = cpx; + ctlPty = cpy; + len2 = path.len(); + pathData = path.data; + if (prevCmd === CMD6.C) { + ctlPtx += cpx - pathData[len2 - 4]; + ctlPty += cpy - pathData[len2 - 3]; + } + cmd = CMD6.C; + x1 = cpx + p[off++]; + y1 = cpy + p[off++]; + cpx += p[off++]; + cpy += p[off++]; + path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); + break; + case "Q": + x1 = p[off++]; + y1 = p[off++]; + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD6.Q; + path.addData(cmd, x1, y1, cpx, cpy); + break; + case "q": + x1 = p[off++] + cpx; + y1 = p[off++] + cpy; + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD6.Q; + path.addData(cmd, x1, y1, cpx, cpy); + break; + case "T": + ctlPtx = cpx; + ctlPty = cpy; + len2 = path.len(); + pathData = path.data; + if (prevCmd === CMD6.Q) { + ctlPtx += cpx - pathData[len2 - 4]; + ctlPty += cpy - pathData[len2 - 3]; + } + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD6.Q; + path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); + break; + case "t": + ctlPtx = cpx; + ctlPty = cpy; + len2 = path.len(); + pathData = path.data; + if (prevCmd === CMD6.Q) { + ctlPtx += cpx - pathData[len2 - 4]; + ctlPty += cpy - pathData[len2 - 3]; + } + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD6.Q; + path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); + break; + case "A": + rx = p[off++]; + ry = p[off++]; + psi = p[off++]; + fa = p[off++]; + fs = p[off++]; + x1 = cpx, y1 = cpy; + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD6.A; + processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path); + break; + case "a": + rx = p[off++]; + ry = p[off++]; + psi = p[off++]; + fa = p[off++]; + fs = p[off++]; + x1 = cpx, y1 = cpy; + cpx += p[off++]; + cpy += p[off++]; + cmd = CMD6.A; + processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path); + break; + } + } + if (cmdStr === "z" || cmdStr === "Z") { + cmd = CMD6.Z; + path.addData(cmd); + cpx = subpathX; + cpy = subpathY; + } + prevCmd = cmd; + } + path.toStatic(); + return path; +} +var SVGPath = class extends Path_default { + applyTransform(m2) { + } +}; +function isPathProxy(path) { + return path.setData != null; +} +function createPathOptions(str, opts) { + const pathProxy = createPathProxyFromString(str); + const innerOpts = extend({}, opts); + innerOpts.buildPath = function(path) { + if (isPathProxy(path)) { + path.appendPath(pathProxy); + const ctx = path.getContext(); + if (ctx) { + path.rebuildPath(ctx, 1); + } + } else { + const ctx = path; + pathProxy.rebuildPath(ctx, 1); + } + }; + innerOpts.applyTransform = function(m2) { + transformPath(pathProxy, m2); + this.dirtyShape(); + }; + return innerOpts; +} +function createFromString(str, opts) { + return new SVGPath(createPathOptions(str, opts)); +} +function extendFromString(str, defaultOpts) { + const innerOpts = createPathOptions(str, defaultOpts); + class Sub extends SVGPath { + constructor(opts) { + super(opts); + this.applyTransform = innerOpts.applyTransform; + this.buildPath = innerOpts.buildPath; + } + } + return Sub; +} +function mergePath(pathEls, opts) { + const pathList = []; + const len2 = pathEls.length; + for (let i = 0; i < len2; i++) { + const pathEl = pathEls[i]; + pathList.push(pathEl.getUpdatedPathProxy(true)); + } + const pathBundle = new Path_default(opts); + pathBundle.createPathProxy(); + pathBundle.buildPath = function(path) { + if (isPathProxy(path)) { + path.appendPath(pathList); + const ctx = path.getContext(); + if (ctx) { + path.rebuildPath(ctx, 1); + } + } + }; + return pathBundle; +} +function clonePath(sourcePath, opts) { + opts = opts || {}; + const path = new Path_default(); + if (sourcePath.shape) { + path.setShape(sourcePath.shape); + } + path.setStyle(sourcePath.style); + if (opts.bakeTransform) { + transformPath(path.path, sourcePath.getComputedTransform()); + } else { + if (opts.toLocal) { + path.setLocalTransform(sourcePath.getComputedTransform()); + } else { + path.copyTransform(sourcePath); + } + } + path.buildPath = sourcePath.buildPath; + path.applyTransform = path.applyTransform; + path.z = sourcePath.z; + path.z2 = sourcePath.z2; + path.zlevel = sourcePath.zlevel; + return path; +} + +// node_modules/zrender/src/graphic/shape/Circle.ts +var CircleShape = class { + constructor() { + this.cx = 0; + this.cy = 0; + this.r = 0; + } +}; +var Circle = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultShape() { + return new CircleShape(); + } + buildPath(ctx, shape) { + ctx.moveTo(shape.cx + shape.r, shape.cy); + ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2); + } +}; +Circle.prototype.type = "circle"; +var Circle_default = Circle; + +// node_modules/zrender/src/graphic/shape/Ellipse.ts +var EllipseShape = class { + constructor() { + this.cx = 0; + this.cy = 0; + this.rx = 0; + this.ry = 0; + } +}; +var Ellipse = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultShape() { + return new EllipseShape(); + } + buildPath(ctx, shape) { + const k = 0.5522848; + const x = shape.cx; + const y = shape.cy; + const a = shape.rx; + const b = shape.ry; + const ox = a * k; + const oy = b * k; + ctx.moveTo(x - a, y); + ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); + ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); + ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); + ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); + } +}; +Ellipse.prototype.type = "ellipse"; +var Ellipse_default = Ellipse; + +// node_modules/zrender/src/graphic/helper/roundSector.ts +var PI4 = Math.PI; +var PI26 = PI4 * 2; +var mathSin4 = Math.sin; +var mathCos4 = Math.cos; +var mathACos = Math.acos; +var mathATan2 = Math.atan2; +var mathAbs2 = Math.abs; +var mathSqrt4 = Math.sqrt; +var mathMax4 = Math.max; +var mathMin4 = Math.min; +var e = 1e-4; +function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { + const dx10 = x1 - x0; + const dy10 = y1 - y0; + const dx32 = x3 - x2; + const dy32 = y3 - y2; + let t = dy32 * dx10 - dx32 * dy10; + if (t * t < e) { + return; + } + t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t; + return [x0 + t * dx10, y0 + t * dy10]; +} +function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) { + const x01 = x0 - x1; + const y01 = y0 - y1; + const lo = (clockwise ? cr : -cr) / mathSqrt4(x01 * x01 + y01 * y01); + const ox = lo * y01; + const oy = -lo * x01; + const x11 = x0 + ox; + const y11 = y0 + oy; + const x10 = x1 + ox; + const y10 = y1 + oy; + const x00 = (x11 + x10) / 2; + const y00 = (y11 + y10) / 2; + const dx = x10 - x11; + const dy = y10 - y11; + const d2 = dx * dx + dy * dy; + const r = radius - cr; + const s = x11 * y10 - x10 * y11; + const d = (dy < 0 ? -1 : 1) * mathSqrt4(mathMax4(0, r * r * d2 - s * s)); + let cx0 = (s * dy - dx * d) / d2; + let cy0 = (-s * dx - dy * d) / d2; + const cx1 = (s * dy + dx * d) / d2; + const cy1 = (-s * dx + dy * d) / d2; + const dx0 = cx0 - x00; + const dy0 = cy0 - y00; + const dx1 = cx1 - x00; + const dy1 = cy1 - y00; + if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) { + cx0 = cx1; + cy0 = cy1; + } + return { + cx: cx0, + cy: cy0, + x0: -ox, + y0: -oy, + x1: cx0 * (radius / r - 1), + y1: cy0 * (radius / r - 1) + }; +} +function normalizeCornerRadius(cr) { + let arr; + if (isArray(cr)) { + const len2 = cr.length; + if (!len2) { + return cr; + } + if (len2 === 1) { + arr = [cr[0], cr[0], 0, 0]; + } else if (len2 === 2) { + arr = [cr[0], cr[0], cr[1], cr[1]]; + } else if (len2 === 3) { + arr = cr.concat(cr[2]); + } else { + arr = cr; + } + } else { + arr = [cr, cr, cr, cr]; + } + return arr; +} +function buildPath2(ctx, shape) { + let radius = mathMax4(shape.r, 0); + let innerRadius = mathMax4(shape.r0 || 0, 0); + const hasRadius = radius > 0; + const hasInnerRadius = innerRadius > 0; + if (!hasRadius && !hasInnerRadius) { + return; + } + if (!hasRadius) { + radius = innerRadius; + innerRadius = 0; + } + if (innerRadius > radius) { + const tmp = radius; + radius = innerRadius; + innerRadius = tmp; + } + const {startAngle, endAngle} = shape; + if (isNaN(startAngle) || isNaN(endAngle)) { + return; + } + const {cx, cy} = shape; + const clockwise = !!shape.clockwise; + let arc2 = mathAbs2(endAngle - startAngle); + const mod = arc2 > PI26 && arc2 % PI26; + mod > e && (arc2 = mod); + if (!(radius > e)) { + ctx.moveTo(cx, cy); + } else if (arc2 > PI26 - e) { + ctx.moveTo(cx + radius * mathCos4(startAngle), cy + radius * mathSin4(startAngle)); + ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise); + if (innerRadius > e) { + ctx.moveTo(cx + innerRadius * mathCos4(endAngle), cy + innerRadius * mathSin4(endAngle)); + ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise); + } + } else { + let icrStart; + let icrEnd; + let ocrStart; + let ocrEnd; + let ocrs; + let ocre; + let icrs; + let icre; + let ocrMax; + let icrMax; + let limitedOcrMax; + let limitedIcrMax; + let xre; + let yre; + let xirs; + let yirs; + const xrs = radius * mathCos4(startAngle); + const yrs = radius * mathSin4(startAngle); + const xire = innerRadius * mathCos4(endAngle); + const yire = innerRadius * mathSin4(endAngle); + const hasArc = arc2 > e; + if (hasArc) { + const cornerRadius = shape.cornerRadius; + if (cornerRadius) { + [icrStart, icrEnd, ocrStart, ocrEnd] = normalizeCornerRadius(cornerRadius); + } + const halfRd = mathAbs2(radius - innerRadius) / 2; + ocrs = mathMin4(halfRd, ocrStart); + ocre = mathMin4(halfRd, ocrEnd); + icrs = mathMin4(halfRd, icrStart); + icre = mathMin4(halfRd, icrEnd); + limitedOcrMax = ocrMax = mathMax4(ocrs, ocre); + limitedIcrMax = icrMax = mathMax4(icrs, icre); + if (ocrMax > e || icrMax > e) { + xre = radius * mathCos4(endAngle); + yre = radius * mathSin4(endAngle); + xirs = innerRadius * mathCos4(startAngle); + yirs = innerRadius * mathSin4(startAngle); + if (arc2 < PI4) { + const it = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire); + if (it) { + const x0 = xrs - it[0]; + const y0 = yrs - it[1]; + const x1 = xre - it[0]; + const y1 = yre - it[1]; + const a = 1 / mathSin4(mathACos((x0 * x1 + y0 * y1) / (mathSqrt4(x0 * x0 + y0 * y0) * mathSqrt4(x1 * x1 + y1 * y1))) / 2); + const b = mathSqrt4(it[0] * it[0] + it[1] * it[1]); + limitedOcrMax = mathMin4(ocrMax, (radius - b) / (a + 1)); + limitedIcrMax = mathMin4(icrMax, (innerRadius - b) / (a - 1)); + } + } + } + } + if (!hasArc) { + ctx.moveTo(cx + xrs, cy + yrs); + } else if (limitedOcrMax > e) { + const crStart = mathMin4(ocrStart, limitedOcrMax); + const crEnd = mathMin4(ocrEnd, limitedOcrMax); + const ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise); + const ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise); + ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0); + if (limitedOcrMax < ocrMax && crStart === crEnd) { + ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise); + } else { + crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise); + ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise); + crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise); + } + } else { + ctx.moveTo(cx + xrs, cy + yrs); + ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise); + } + if (!(innerRadius > e) || !hasArc) { + ctx.lineTo(cx + xire, cy + yire); + } else if (limitedIcrMax > e) { + const crStart = mathMin4(icrStart, limitedIcrMax); + const crEnd = mathMin4(icrEnd, limitedIcrMax); + const ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise); + const ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise); + ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0); + if (limitedIcrMax < icrMax && crStart === crEnd) { + ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise); + } else { + crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise); + ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise); + crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise); + } + } else { + ctx.lineTo(cx + xire, cy + yire); + ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise); + } + } + ctx.closePath(); +} + +// node_modules/zrender/src/graphic/shape/Sector.ts +var SectorShape = class { + constructor() { + this.cx = 0; + this.cy = 0; + this.r0 = 0; + this.r = 0; + this.startAngle = 0; + this.endAngle = Math.PI * 2; + this.clockwise = true; + this.cornerRadius = 0; + } +}; +var Sector = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultShape() { + return new SectorShape(); + } + buildPath(ctx, shape) { + buildPath2(ctx, shape); + } + isZeroArea() { + return this.shape.startAngle === this.shape.endAngle || this.shape.r === this.shape.r0; + } +}; +Sector.prototype.type = "sector"; +var Sector_default = Sector; + +// node_modules/zrender/src/graphic/shape/Ring.ts +var RingShape = class { + constructor() { + this.cx = 0; + this.cy = 0; + this.r = 0; + this.r0 = 0; + } +}; +var Ring = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultShape() { + return new RingShape(); + } + buildPath(ctx, shape) { + const x = shape.cx; + const y = shape.cy; + const PI210 = Math.PI * 2; + ctx.moveTo(x + shape.r, y); + ctx.arc(x, y, shape.r, 0, PI210, false); + ctx.moveTo(x + shape.r0, y); + ctx.arc(x, y, shape.r0, 0, PI210, true); + } +}; +Ring.prototype.type = "ring"; +var Ring_default = Ring; + +// node_modules/zrender/src/graphic/helper/smoothBezier.ts +function smoothBezier(points4, smooth, isLoop, constraint) { + const cps = []; + const v = []; + const v12 = []; + const v22 = []; + let prevPoint; + let nextPoint; + let min3; + let max3; + if (constraint) { + min3 = [Infinity, Infinity]; + max3 = [-Infinity, -Infinity]; + for (let i = 0, len2 = points4.length; i < len2; i++) { + min(min3, min3, points4[i]); + max(max3, max3, points4[i]); + } + min(min3, min3, constraint[0]); + max(max3, max3, constraint[1]); + } + for (let i = 0, len2 = points4.length; i < len2; i++) { + const point = points4[i]; + if (isLoop) { + prevPoint = points4[i ? i - 1 : len2 - 1]; + nextPoint = points4[(i + 1) % len2]; + } else { + if (i === 0 || i === len2 - 1) { + cps.push(clone2(points4[i])); + continue; + } else { + prevPoint = points4[i - 1]; + nextPoint = points4[i + 1]; + } + } + sub(v, nextPoint, prevPoint); + scale(v, v, smooth); + let d0 = distance(point, prevPoint); + let d1 = distance(point, nextPoint); + const sum2 = d0 + d1; + if (sum2 !== 0) { + d0 /= sum2; + d1 /= sum2; + } + scale(v12, v, -d0); + scale(v22, v, d1); + const cp0 = add([], point, v12); + const cp1 = add([], point, v22); + if (constraint) { + max(cp0, cp0, min3); + min(cp0, cp0, max3); + max(cp1, cp1, min3); + min(cp1, cp1, max3); + } + cps.push(cp0); + cps.push(cp1); + } + if (isLoop) { + cps.push(cps.shift()); + } + return cps; +} + +// node_modules/zrender/src/graphic/helper/poly.ts +function buildPath3(ctx, shape, closePath) { + const smooth = shape.smooth; + let points4 = shape.points; + if (points4 && points4.length >= 2) { + if (smooth) { + const controlPoints = smoothBezier(points4, smooth, closePath, shape.smoothConstraint); + ctx.moveTo(points4[0][0], points4[0][1]); + const len2 = points4.length; + for (let i = 0; i < (closePath ? len2 : len2 - 1); i++) { + const cp1 = controlPoints[i * 2]; + const cp2 = controlPoints[i * 2 + 1]; + const p = points4[(i + 1) % len2]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + } else { + ctx.moveTo(points4[0][0], points4[0][1]); + for (let i = 1, l = points4.length; i < l; i++) { + ctx.lineTo(points4[i][0], points4[i][1]); + } + } + closePath && ctx.closePath(); + } +} + +// node_modules/zrender/src/graphic/shape/Polygon.ts +var PolygonShape = class { + constructor() { + this.points = null; + this.smooth = 0; + this.smoothConstraint = null; + } +}; +var Polygon = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultShape() { + return new PolygonShape(); + } + buildPath(ctx, shape) { + buildPath3(ctx, shape, true); + } +}; +Polygon.prototype.type = "polygon"; +var Polygon_default = Polygon; + +// node_modules/zrender/src/graphic/shape/Polyline.ts +var PolylineShape = class { + constructor() { + this.points = null; + this.percent = 1; + this.smooth = 0; + this.smoothConstraint = null; + } +}; +var Polyline = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new PolylineShape(); + } + buildPath(ctx, shape) { + buildPath3(ctx, shape, false); + } +}; +Polyline.prototype.type = "polyline"; +var Polyline_default = Polyline; + +// node_modules/zrender/src/graphic/shape/Line.ts +var subPixelOptimizeOutputShape2 = {}; +var LineShape = class { + constructor() { + this.x1 = 0; + this.y1 = 0; + this.x2 = 0; + this.y2 = 0; + this.percent = 1; + } +}; +var Line = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new LineShape(); + } + buildPath(ctx, shape) { + let x1; + let y1; + let x2; + let y2; + if (this.subPixelOptimize) { + const optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape2, shape, this.style); + x1 = optimizedShape.x1; + y1 = optimizedShape.y1; + x2 = optimizedShape.x2; + y2 = optimizedShape.y2; + } else { + x1 = shape.x1; + y1 = shape.y1; + x2 = shape.x2; + y2 = shape.y2; + } + const percent = shape.percent; + if (percent === 0) { + return; + } + ctx.moveTo(x1, y1); + if (percent < 1) { + x2 = x1 * (1 - percent) + x2 * percent; + y2 = y1 * (1 - percent) + y2 * percent; + } + ctx.lineTo(x2, y2); + } + pointAt(p) { + const shape = this.shape; + return [ + shape.x1 * (1 - p) + shape.x2 * p, + shape.y1 * (1 - p) + shape.y2 * p + ]; + } +}; +Line.prototype.type = "line"; +var Line_default = Line; + +// node_modules/zrender/src/graphic/shape/BezierCurve.ts +var out = []; +var BezierCurveShape = class { + constructor() { + this.x1 = 0; + this.y1 = 0; + this.x2 = 0; + this.y2 = 0; + this.cpx1 = 0; + this.cpy1 = 0; + this.percent = 1; + } +}; +function someVectorAt(shape, t, isTangent) { + const cpx2 = shape.cpx2; + const cpy2 = shape.cpy2; + if (cpx2 != null || cpy2 != null) { + return [ + (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t), + (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t) + ]; + } else { + return [ + (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), + (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t) + ]; + } +} +var BezierCurve = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new BezierCurveShape(); + } + buildPath(ctx, shape) { + let x1 = shape.x1; + let y1 = shape.y1; + let x2 = shape.x2; + let y2 = shape.y2; + let cpx1 = shape.cpx1; + let cpy1 = shape.cpy1; + let cpx2 = shape.cpx2; + let cpy2 = shape.cpy2; + let percent = shape.percent; + if (percent === 0) { + return; + } + ctx.moveTo(x1, y1); + if (cpx2 == null || cpy2 == null) { + if (percent < 1) { + quadraticSubdivide(x1, cpx1, x2, percent, out); + cpx1 = out[1]; + x2 = out[2]; + quadraticSubdivide(y1, cpy1, y2, percent, out); + cpy1 = out[1]; + y2 = out[2]; + } + ctx.quadraticCurveTo(cpx1, cpy1, x2, y2); + } else { + if (percent < 1) { + cubicSubdivide(x1, cpx1, cpx2, x2, percent, out); + cpx1 = out[1]; + cpx2 = out[2]; + x2 = out[3]; + cubicSubdivide(y1, cpy1, cpy2, y2, percent, out); + cpy1 = out[1]; + cpy2 = out[2]; + y2 = out[3]; + } + ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2); + } + } + pointAt(t) { + return someVectorAt(this.shape, t, false); + } + tangentAt(t) { + const p = someVectorAt(this.shape, t, true); + return normalize(p, p); + } +}; +BezierCurve.prototype.type = "bezier-curve"; +var BezierCurve_default = BezierCurve; + +// node_modules/zrender/src/graphic/shape/Arc.ts +var ArcShape = class { + constructor() { + this.cx = 0; + this.cy = 0; + this.r = 0; + this.startAngle = 0; + this.endAngle = Math.PI * 2; + this.clockwise = true; + } +}; +var Arc = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new ArcShape(); + } + buildPath(ctx, shape) { + const x = shape.cx; + const y = shape.cy; + const r = Math.max(shape.r, 0); + const startAngle = shape.startAngle; + const endAngle = shape.endAngle; + const clockwise = shape.clockwise; + const unitX = Math.cos(startAngle); + const unitY = Math.sin(startAngle); + ctx.moveTo(unitX * r + x, unitY * r + y); + ctx.arc(x, y, r, startAngle, endAngle, !clockwise); + } +}; +Arc.prototype.type = "arc"; +var Arc_default = Arc; + +// node_modules/zrender/src/graphic/CompoundPath.ts +var CompoundPath = class extends Path_default { + constructor() { + super(...arguments); + this.type = "compound"; + } + _updatePathDirty() { + const paths = this.shape.paths; + let dirtyPath = this.shapeChanged(); + for (let i = 0; i < paths.length; i++) { + dirtyPath = dirtyPath || paths[i].shapeChanged(); + } + if (dirtyPath) { + this.dirtyShape(); + } + } + beforeBrush() { + this._updatePathDirty(); + const paths = this.shape.paths || []; + const scale4 = this.getGlobalScale(); + for (let i = 0; i < paths.length; i++) { + if (!paths[i].path) { + paths[i].createPathProxy(); + } + paths[i].path.setScale(scale4[0], scale4[1], paths[i].segmentIgnoreThreshold); + } + } + buildPath(ctx, shape) { + const paths = shape.paths || []; + for (let i = 0; i < paths.length; i++) { + paths[i].buildPath(ctx, paths[i].shape, true); + } + } + afterBrush() { + const paths = this.shape.paths || []; + for (let i = 0; i < paths.length; i++) { + paths[i].pathUpdated(); + } + } + getBoundingRect() { + this._updatePathDirty.call(this); + return Path_default.prototype.getBoundingRect.call(this); + } +}; +var CompoundPath_default = CompoundPath; + +// node_modules/zrender/src/graphic/Gradient.ts +var Gradient = class { + constructor(colorStops) { + this.colorStops = colorStops || []; + } + addColorStop(offset, color2) { + this.colorStops.push({ + offset, + color: color2 + }); + } +}; +var Gradient_default = Gradient; + +// node_modules/zrender/src/graphic/LinearGradient.ts +var LinearGradient = class extends Gradient_default { + constructor(x, y, x2, y2, colorStops, globalCoord) { + super(colorStops); + this.x = x == null ? 0 : x; + this.y = y == null ? 0 : y; + this.x2 = x2 == null ? 1 : x2; + this.y2 = y2 == null ? 0 : y2; + this.type = "linear"; + this.global = globalCoord || false; + } +}; +var LinearGradient_default = LinearGradient; + +// node_modules/zrender/src/graphic/RadialGradient.ts +var RadialGradient = class extends Gradient_default { + constructor(x, y, r, colorStops, globalCoord) { + super(colorStops); + this.x = x == null ? 0.5 : x; + this.y = y == null ? 0.5 : y; + this.r = r == null ? 0.5 : r; + this.type = "radial"; + this.global = globalCoord || false; + } +}; +var RadialGradient_default = RadialGradient; + +// node_modules/zrender/src/core/OrientedBoundingRect.ts +var extent = [0, 0]; +var extent2 = [0, 0]; +var minTv2 = new Point_default(); +var maxTv2 = new Point_default(); +var OrientedBoundingRect = class { + constructor(rect, transform2) { + this._corners = []; + this._axes = []; + this._origin = [0, 0]; + for (let i = 0; i < 4; i++) { + this._corners[i] = new Point_default(); + } + for (let i = 0; i < 2; i++) { + this._axes[i] = new Point_default(); + } + if (rect) { + this.fromBoundingRect(rect, transform2); + } + } + fromBoundingRect(rect, transform2) { + const corners = this._corners; + const axes = this._axes; + const x = rect.x; + const y = rect.y; + const x2 = x + rect.width; + const y2 = y + rect.height; + corners[0].set(x, y); + corners[1].set(x2, y); + corners[2].set(x2, y2); + corners[3].set(x, y2); + if (transform2) { + for (let i = 0; i < 4; i++) { + corners[i].transform(transform2); + } + } + Point_default.sub(axes[0], corners[1], corners[0]); + Point_default.sub(axes[1], corners[3], corners[0]); + axes[0].normalize(); + axes[1].normalize(); + for (let i = 0; i < 2; i++) { + this._origin[i] = axes[i].dot(corners[0]); + } + } + intersect(other, mtv) { + let overlapped = true; + const noMtv = !mtv; + minTv2.set(Infinity, Infinity); + maxTv2.set(0, 0); + if (!this._intersectCheckOneSide(this, other, minTv2, maxTv2, noMtv, 1)) { + overlapped = false; + if (noMtv) { + return overlapped; + } + } + if (!this._intersectCheckOneSide(other, this, minTv2, maxTv2, noMtv, -1)) { + overlapped = false; + if (noMtv) { + return overlapped; + } + } + if (!noMtv) { + Point_default.copy(mtv, overlapped ? minTv2 : maxTv2); + } + return overlapped; + } + _intersectCheckOneSide(self2, other, minTv3, maxTv3, noMtv, inverse) { + let overlapped = true; + for (let i = 0; i < 2; i++) { + const axis = this._axes[i]; + this._getProjMinMaxOnAxis(i, self2._corners, extent); + this._getProjMinMaxOnAxis(i, other._corners, extent2); + if (extent[1] < extent2[0] || extent[0] > extent2[1]) { + overlapped = false; + if (noMtv) { + return overlapped; + } + const dist0 = Math.abs(extent2[0] - extent[1]); + const dist1 = Math.abs(extent[0] - extent2[1]); + if (Math.min(dist0, dist1) > maxTv3.len()) { + if (dist0 < dist1) { + Point_default.scale(maxTv3, axis, -dist0 * inverse); } else { - lineData.hasItemOption = true; - var value = dataItem.value; - if (value != null) { - return value instanceof Array ? value[dimIndex] : value; - } + Point_default.scale(maxTv3, axis, dist1 * inverse); } - }); - return lineData; - }; - LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var itemModel = data.getItemModel(dataIndex); - var name = itemModel.get('name'); - if (name) { - return name; - } - var fromName = itemModel.get('fromName'); - var toName = itemModel.get('toName'); - var nameArr = []; - fromName != null && nameArr.push(fromName); - toName != null && nameArr.push(toName); - return createTooltipMarkup('nameValue', { - name: nameArr.join(' > ') - }); - }; - LinesSeriesModel.prototype.preventIncremental = function () { - return !!this.get(['effect', 'show']); - }; - LinesSeriesModel.prototype.getProgressive = function () { - var progressive = this.option.progressive; - if (progressive == null) { - return this.option.large ? 1e4 : this.get('progressive'); - } - return progressive; - }; - LinesSeriesModel.prototype.getProgressiveThreshold = function () { - var progressiveThreshold = this.option.progressiveThreshold; - if (progressiveThreshold == null) { - return this.option.large ? 2e4 : this.get('progressiveThreshold'); - } - return progressiveThreshold; - }; - LinesSeriesModel.prototype.getZLevelKey = function () { - var effectModel = this.getModel('effect'); - var trailLength = effectModel.get('trailLength'); - return this.getData().count() > this.getProgressiveThreshold() - // Each progressive series has individual key. - ? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : ''; - }; - LinesSeriesModel.type = 'series.lines'; - LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar']; - LinesSeriesModel.defaultOption = { - coordinateSystem: 'geo', - // zlevel: 0, - z: 2, - legendHoverLink: true, - // Cartesian coordinate system - xAxisIndex: 0, - yAxisIndex: 0, - symbol: ['none', 'none'], - symbolSize: [10, 10], - // Geo coordinate system - geoIndex: 0, - effect: { - show: false, - period: 4, - constantSpeed: 0, - symbol: 'circle', - symbolSize: 3, - loop: true, - trailLength: 0.2 - }, - large: false, - // Available when large is true - largeThreshold: 2000, - polyline: false, - clip: true, - label: { - show: false, - position: 'end' - // distance: 5, - // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 - }, - - lineStyle: { - opacity: 0.5 } - }; - return LinesSeriesModel; - }(SeriesModel); - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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$3(a) { - if (!(a instanceof Array)) { - a = [a, a]; - } - return a; - } - var linesVisual = { - seriesType: 'lines', - reset: function (seriesModel) { - var symbolType = normalize$3(seriesModel.get('symbol')); - var symbolSize = normalize$3(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]); - function dataEach(data, idx) { - var itemModel = data.getItemModel(idx); - var symbolType = normalize$3(itemModel.getShallow('symbol', true)); - var symbolSize = normalize$3(itemModel.getShallow('symbolSize', true)); - 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]); + } else if (minTv3) { + const dist0 = Math.abs(extent2[0] - extent[1]); + const dist1 = Math.abs(extent[0] - extent2[1]); + if (Math.min(dist0, dist1) < minTv3.len()) { + if (dist0 < dist1) { + Point_default.scale(minTv3, axis, dist0 * inverse); + } else { + Point_default.scale(minTv3, axis, -dist1 * inverse); + } + } + } + } + return overlapped; + } + _getProjMinMaxOnAxis(dim, corners, out2) { + const axis = this._axes[dim]; + const origin = this._origin; + const proj = corners[0].dot(axis) + origin[dim]; + let min3 = proj; + let max3 = proj; + for (let i = 1; i < corners.length; i++) { + const proj2 = corners[i].dot(axis) + origin[dim]; + min3 = Math.min(proj2, min3); + max3 = Math.max(proj2, max3); + } + out2[0] = min3; + out2[1] = max3; + } +}; +var OrientedBoundingRect_default = OrientedBoundingRect; + +// node_modules/zrender/src/graphic/IncrementalDisplayable.ts +var m = []; +var IncrementalDisplayable = class extends Displayable_default { + constructor() { + super(...arguments); + this.notClear = true; + this.incremental = true; + this._displayables = []; + this._temporaryDisplayables = []; + this._cursor = 0; + } + traverse(cb, context) { + cb.call(context, this); + } + useStyle() { + this.style = {}; + } + getCursor() { + return this._cursor; + } + innerAfterBrush() { + this._cursor = this._displayables.length; + } + clearDisplaybles() { + this._displayables = []; + this._temporaryDisplayables = []; + this._cursor = 0; + this.markRedraw(); + this.notClear = false; + } + clearTemporalDisplayables() { + this._temporaryDisplayables = []; + } + addDisplayable(displayable, notPersistent) { + if (notPersistent) { + this._temporaryDisplayables.push(displayable); + } else { + this._displayables.push(displayable); + } + this.markRedraw(); + } + addDisplayables(displayables, notPersistent) { + notPersistent = notPersistent || false; + for (let i = 0; i < displayables.length; i++) { + this.addDisplayable(displayables[i], notPersistent); + } + } + getDisplayables() { + return this._displayables; + } + getTemporalDisplayables() { + return this._temporaryDisplayables; + } + eachPendingDisplayable(cb) { + for (let i = this._cursor; i < this._displayables.length; i++) { + cb && cb(this._displayables[i]); + } + for (let i = 0; i < this._temporaryDisplayables.length; i++) { + cb && cb(this._temporaryDisplayables[i]); + } + } + update() { + this.updateTransform(); + for (let i = this._cursor; i < this._displayables.length; i++) { + const displayable = this._displayables[i]; + displayable.parent = this; + displayable.update(); + displayable.parent = null; + } + for (let i = 0; i < this._temporaryDisplayables.length; i++) { + const displayable = this._temporaryDisplayables[i]; + displayable.parent = this; + displayable.update(); + displayable.parent = null; + } + } + getBoundingRect() { + if (!this._rect) { + const rect = new BoundingRect_default(Infinity, Infinity, -Infinity, -Infinity); + for (let i = 0; i < this._displayables.length; i++) { + const displayable = this._displayables[i]; + const childRect = displayable.getBoundingRect().clone(); + if (displayable.needLocalTransform()) { + childRect.applyTransform(displayable.getLocalTransform(m)); + } + rect.union(childRect); + } + this._rect = rect; + } + return this._rect; + } + contain(x, y) { + const localPos = this.transformCoordToLocal(x, y); + const rect = this.getBoundingRect(); + if (rect.contain(localPos[0], localPos[1])) { + for (let i = 0; i < this._displayables.length; i++) { + const displayable = this._displayables[i]; + if (displayable.contain(x, y)) { + return true; } - return { - dataEach: data.hasItemOption ? dataEach : null - }; } + } + return false; + } +}; +var IncrementalDisplayable_default = IncrementalDisplayable; + +// src/animation/basicTransition.ts +var transitionStore = makeInner(); +function getAnimationConfig(animationType, animatableModel, dataIndex, extraOpts, extraDelayParams) { + let animationPayload; + if (animatableModel && animatableModel.ecModel) { + const updatePayload = animatableModel.ecModel.getUpdatePayload(); + animationPayload = updatePayload && updatePayload.animation; + } + const animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); + const isUpdate = animationType === "update"; + if (animationEnabled) { + let duration; + let easing; + let delay; + if (extraOpts) { + duration = retrieve2(extraOpts.duration, 200); + easing = retrieve2(extraOpts.easing, "cubicOut"); + delay = 0; + } else { + duration = animatableModel.getShallow(isUpdate ? "animationDurationUpdate" : "animationDuration"); + easing = animatableModel.getShallow(isUpdate ? "animationEasingUpdate" : "animationEasing"); + delay = animatableModel.getShallow(isUpdate ? "animationDelayUpdate" : "animationDelay"); + } + if (animationPayload) { + animationPayload.duration != null && (duration = animationPayload.duration); + animationPayload.easing != null && (easing = animationPayload.easing); + animationPayload.delay != null && (delay = animationPayload.delay); + } + if (isFunction(delay)) { + delay = delay(dataIndex, extraDelayParams); + } + if (isFunction(duration)) { + duration = duration(dataIndex); + } + const config = { + duration: duration || 0, + delay, + easing }; - - function install$m(registers) { - registers.registerChartView(LinesView); - registers.registerSeriesModel(LinesSeriesModel); - registers.registerLayout(linesLayout); - registers.registerVisual(linesVisual); - } - - var GRADIENT_LEVELS = 256; - var HeatmapLayer = /** @class */function () { - function HeatmapLayer() { - this.blurSize = 30; - this.pointSize = 20; - this.maxOpacity = 1; - this.minOpacity = 0; - this._gradientPixels = { - inRange: null, - outOfRange: null - }; - var canvas = platformApi.createCanvas(); - this.canvas = canvas; - } - /** - * Renders Heatmap and returns the rendered canvas - * @param data array of data, each has x, y, value - * @param width canvas width - * @param height canvas height - */ - HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) { - var brush = this._getBrush(); - var gradientInRange = this._getGradient(colorFunc, 'inRange'); - var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange'); - var r = this.pointSize + this.blurSize; - var canvas = this.canvas; - var ctx = canvas.getContext('2d'); - var len = data.length; - canvas.width = width; - canvas.height = height; - for (var i = 0; i < len; ++i) { - var p = data[i]; - var x = p[0]; - var y = p[1]; - var value = p[2]; - // calculate alpha using value - var alpha = normalize(value); - // draw with the circle brush with alpha - ctx.globalAlpha = alpha; - ctx.drawImage(brush, x - r, y - r); - } - if (!canvas.width || !canvas.height) { - // Avoid "Uncaught DOMException: Failed to execute 'getImageData' on - // 'CanvasRenderingContext2D': The source height is 0." - return canvas; - } - // colorize the canvas using alpha value and set with gradient - var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); - var pixels = imageData.data; - var offset = 0; - var pixelLen = pixels.length; - var minOpacity = this.minOpacity; - var maxOpacity = this.maxOpacity; - var diffOpacity = maxOpacity - minOpacity; - while (offset < pixelLen) { - var alpha = pixels[offset + 3] / 256; - var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; - // Simple optimize to ignore the empty data - if (alpha > 0) { - var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; - // Any alpha > 0 will be mapped to [minOpacity, maxOpacity] - alpha > 0 && (alpha = alpha * diffOpacity + minOpacity); - pixels[offset++] = gradient[gradientOffset]; - pixels[offset++] = gradient[gradientOffset + 1]; - pixels[offset++] = gradient[gradientOffset + 2]; - pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256; - } else { - offset += 4; - } + return config; + } else { + return null; + } +} +function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) { + let isFrom = false; + let removeOpt; + if (isFunction(dataIndex)) { + during = cb; + cb = dataIndex; + dataIndex = null; + } else if (isObject(dataIndex)) { + cb = dataIndex.cb; + during = dataIndex.during; + isFrom = dataIndex.isFrom; + removeOpt = dataIndex.removeOpt; + dataIndex = dataIndex.dataIndex; + } + const isRemove = animationType === "leave"; + if (!isRemove) { + el.stopAnimation("leave"); + } + const animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null); + if (animationConfig && animationConfig.duration > 0) { + const duration = animationConfig.duration; + const animationDelay = animationConfig.delay; + const animationEasing = animationConfig.easing; + const animateConfig = { + duration, + delay: animationDelay || 0, + easing: animationEasing, + done: cb, + force: !!cb || !!during, + setToFinal: !isRemove, + scope: animationType, + during + }; + isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig); + } else { + el.stopAnimation(); + !isFrom && el.attr(props); + during && during(1); + cb && cb(); + } +} +function updateProps(el, props, animatableModel, dataIndex, cb, during) { + animateOrSetProps("update", el, props, animatableModel, dataIndex, cb, during); +} +function initProps(el, props, animatableModel, dataIndex, cb, during) { + animateOrSetProps("enter", el, props, animatableModel, dataIndex, cb, during); +} +function isElementRemoved(el) { + if (!el.__zr) { + return true; + } + for (let i = 0; i < el.animators.length; i++) { + const animator = el.animators[i]; + if (animator.scope === "leave") { + return true; + } + } + return false; +} +function removeElement(el, props, animatableModel, dataIndex, cb, during) { + if (isElementRemoved(el)) { + return; + } + animateOrSetProps("leave", el, props, animatableModel, dataIndex, cb, during); +} +function fadeOutDisplayable(el, animatableModel, dataIndex, done) { + el.removeTextContent(); + el.removeTextGuideLine(); + removeElement(el, { + style: { + opacity: 0 + } + }, animatableModel, dataIndex, done); +} +function removeElementWithFadeOut(el, animatableModel, dataIndex) { + function doRemove() { + el.parent && el.parent.remove(el); + } + if (!el.isGroup) { + fadeOutDisplayable(el, animatableModel, dataIndex, doRemove); + } else { + el.traverse(function(disp) { + if (!disp.isGroup) { + fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove); + } + }); + } +} +function saveOldStyle(el) { + transitionStore(el).oldStyle = el.style; +} +function getOldStyle(el) { + return transitionStore(el).oldStyle; +} + +// src/util/graphic.ts +var mathMax5 = Math.max; +var mathMin5 = Math.min; +var _customShapeMap = {}; +function extendShape(opts) { + return Path_default.extend(opts); +} +var extendPathFromString = extendFromString; +function extendPath(pathData, opts) { + return extendPathFromString(pathData, opts); +} +function registerShape(name, ShapeClass) { + _customShapeMap[name] = ShapeClass; +} +function getShapeClass(name) { + if (_customShapeMap.hasOwnProperty(name)) { + return _customShapeMap[name]; + } +} +function makePath(pathData, opts, rect, layout18) { + const path = createFromString(pathData, opts); + if (rect) { + if (layout18 === "center") { + rect = centerGraphic(rect, path.getBoundingRect()); + } + resizePath(path, rect); + } + return path; +} +function makeImage(imageUrl, rect, layout18) { + const zrImg = new Image_default({ + style: { + image: imageUrl, + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + onload(img) { + if (layout18 === "center") { + const boundingRect = { + width: img.width, + height: img.height + }; + zrImg.setStyle(centerGraphic(rect, boundingRect)); + } + } + }); + return zrImg; +} +function centerGraphic(rect, boundingRect) { + const aspect = boundingRect.width / boundingRect.height; + let width = rect.height * aspect; + let height; + if (width <= rect.width) { + height = rect.height; + } else { + width = rect.width; + height = width / aspect; + } + const cx = rect.x + rect.width / 2; + const cy = rect.y + rect.height / 2; + return { + x: cx - width / 2, + y: cy - height / 2, + width, + height + }; +} +var mergePath2 = mergePath; +function resizePath(path, rect) { + if (!path.applyTransform) { + return; + } + const pathRect = path.getBoundingRect(); + const m2 = pathRect.calculateTransform(rect); + path.applyTransform(m2); +} +function subPixelOptimizeLine2(shape, lineWidth) { + subPixelOptimizeLine(shape, shape, {lineWidth}); + return shape; +} +function subPixelOptimizeRect2(param) { + subPixelOptimizeRect(param.shape, param.shape, param.style); + return param; +} +var subPixelOptimize2 = subPixelOptimize; +function getTransform(target, ancestor) { + const mat = identity([]); + while (target && target !== ancestor) { + mul2(mat, target.getLocalTransform(), mat); + target = target.parent; + } + return mat; +} +function applyTransform2(target, transform2, invert2) { + if (transform2 && !isArrayLike(transform2)) { + transform2 = Transformable_default.getLocalTransform(transform2); + } + if (invert2) { + transform2 = invert([], transform2); + } + return applyTransform([], target, transform2); +} +function transformDirection(direction, transform2, invert2) { + const hBase = transform2[4] === 0 || transform2[5] === 0 || transform2[0] === 0 ? 1 : Math.abs(2 * transform2[4] / transform2[0]); + const vBase = transform2[4] === 0 || transform2[5] === 0 || transform2[2] === 0 ? 1 : Math.abs(2 * transform2[4] / transform2[2]); + let vertex = [ + direction === "left" ? -hBase : direction === "right" ? hBase : 0, + direction === "top" ? -vBase : direction === "bottom" ? vBase : 0 + ]; + vertex = applyTransform2(vertex, transform2, invert2); + return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? "right" : "left" : vertex[1] > 0 ? "bottom" : "top"; +} +function isNotGroup(el) { + return !el.isGroup; +} +function isPath(el) { + return el.shape != null; +} +function groupTransition(g1, g2, animatableModel) { + if (!g1 || !g2) { + return; + } + function getElMap(g) { + const elMap = {}; + g.traverse(function(el) { + if (isNotGroup(el) && el.anid) { + elMap[el.anid] = el; + } + }); + return elMap; + } + function getAnimatableProps(el) { + const obj = { + x: el.x, + y: el.y, + rotation: el.rotation + }; + if (isPath(el)) { + obj.shape = extend({}, el.shape); + } + return obj; + } + const elMap1 = getElMap(g1); + g2.traverse(function(el) { + if (isNotGroup(el) && el.anid) { + const oldEl = elMap1[el.anid]; + if (oldEl) { + const newProp = getAnimatableProps(el); + el.attr(getAnimatableProps(oldEl)); + updateProps(el, newProp, animatableModel, getECData(el).dataIndex); + } + } + }); +} +function clipPointsByRect(points4, rect) { + return map(points4, function(point) { + let x = point[0]; + x = mathMax5(x, rect.x); + x = mathMin5(x, rect.x + rect.width); + let y = point[1]; + y = mathMax5(y, rect.y); + y = mathMin5(y, rect.y + rect.height); + return [x, y]; + }); +} +function clipRectByRect(targetRect, rect) { + const x = mathMax5(targetRect.x, rect.x); + const x2 = mathMin5(targetRect.x + targetRect.width, rect.x + rect.width); + const y = mathMax5(targetRect.y, rect.y); + const y2 = mathMin5(targetRect.y + targetRect.height, rect.y + rect.height); + if (x2 >= x && y2 >= y) { + return { + x, + y, + width: x2 - x, + height: y2 - y + }; + } +} +function createIcon(iconStr, opt, rect) { + const innerOpts = extend({rectHover: true}, opt); + const style = innerOpts.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), defaults(style, rect), new Image_default(innerOpts)) : makePath(iconStr.replace("path://", ""), innerOpts, rect, "center"); + } +} +function linePolygonIntersect(a1x, a1y, a2x, a2y, points4) { + for (let i = 0, p2 = points4[points4.length - 1]; i < points4.length; i++) { + const p = points4[i]; + if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) { + return true; + } + p2 = p; + } +} +function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { + const mx = a2x - a1x; + const my = a2y - a1y; + const nx = b2x - b1x; + const ny = b2y - b1y; + const nmCrossProduct = crossProduct2d(nx, ny, mx, my); + if (nearZero(nmCrossProduct)) { + return false; + } + const b1a1x = a1x - b1x; + const b1a1y = a1y - b1y; + const q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct; + if (q < 0 || q > 1) { + return false; + } + const p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct; + if (p < 0 || p > 1) { + return false; + } + return true; +} +function crossProduct2d(x1, y1, x2, y2) { + return x1 * y2 - x2 * y1; +} +function nearZero(val) { + return val <= 1e-6 && val >= -1e-6; +} +function setTooltipConfig(opt) { + const itemTooltipOption = opt.itemTooltipOption; + const componentModel = opt.componentModel; + const itemName = opt.itemName; + const itemTooltipOptionObj = isString(itemTooltipOption) ? {formatter: itemTooltipOption} : itemTooltipOption; + const mainType = componentModel.mainType; + const componentIndex = componentModel.componentIndex; + const formatterParams = { + componentType: mainType, + name: itemName, + $vars: ["name"] + }; + formatterParams[mainType + "Index"] = componentIndex; + const formatterParamsExtra = opt.formatterParamsExtra; + if (formatterParamsExtra) { + each(keys(formatterParamsExtra), (key) => { + if (!hasOwn(formatterParams, key)) { + formatterParams[key] = formatterParamsExtra[key]; + formatterParams.$vars.push(key); + } + }); + } + const ecData = getECData(opt.el); + ecData.componentMainType = mainType; + ecData.componentIndex = componentIndex; + ecData.tooltipConfig = { + name: itemName, + option: defaults({ + content: itemName, + encodeHTMLContent: true, + formatterParams + }, itemTooltipOptionObj) + }; +} +function traverseElement(el, cb) { + let stopped; + if (el.isGroup) { + stopped = cb(el); + } + if (!stopped) { + el.traverse(cb); + } +} +function traverseElements(els, cb) { + if (els) { + if (isArray(els)) { + for (let i = 0; i < els.length; i++) { + traverseElement(els[i], cb); + } + } else { + traverseElement(els, cb); + } + } +} +registerShape("circle", Circle_default); +registerShape("ellipse", Ellipse_default); +registerShape("sector", Sector_default); +registerShape("ring", Ring_default); +registerShape("polygon", Polygon_default); +registerShape("polyline", Polyline_default); +registerShape("rect", Rect_default); +registerShape("line", Line_default); +registerShape("bezierCurve", BezierCurve_default); +registerShape("arc", Arc_default); + +// src/label/labelStyle.ts +var EMPTY_OBJ = {}; +function setLabelText(label, labelTexts) { + for (let i = 0; i < SPECIAL_STATES.length; i++) { + const stateName = SPECIAL_STATES[i]; + const text = labelTexts[stateName]; + const state = label.ensureState(stateName); + state.style = state.style || {}; + state.style.text = text; + } + const oldStates = label.currentStates.slice(); + label.clearStates(true); + label.setStyle({text: labelTexts.normal}); + label.useStates(oldStates, true); +} +function getLabelText(opt, stateModels, interpolatedValue) { + const labelFetcher = opt.labelFetcher; + const labelDataIndex = opt.labelDataIndex; + const labelDimIndex = opt.labelDimIndex; + const normalModel = stateModels.normal; + let baseText; + if (labelFetcher) { + baseText = labelFetcher.getFormattedLabel(labelDataIndex, "normal", null, labelDimIndex, normalModel && normalModel.get("formatter"), interpolatedValue != null ? { + interpolatedValue + } : null); + } + if (baseText == null) { + baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText; + } + const statesText = { + normal: baseText + }; + for (let i = 0; i < SPECIAL_STATES.length; i++) { + const stateName = SPECIAL_STATES[i]; + const stateModel = stateModels[stateName]; + statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get("formatter")) : null, baseText); + } + return statesText; +} +function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) { + opt = opt || EMPTY_OBJ; + const isSetOnText = targetEl instanceof Text_default; + let needsCreateText = false; + for (let i = 0; i < DISPLAY_STATES.length; i++) { + const stateModel = labelStatesModels[DISPLAY_STATES[i]]; + if (stateModel && stateModel.getShallow("show")) { + needsCreateText = true; + break; + } + } + let textContent = isSetOnText ? targetEl : targetEl.getTextContent(); + if (needsCreateText) { + if (!isSetOnText) { + if (!textContent) { + textContent = new Text_default(); + targetEl.setTextContent(textContent); + } + if (targetEl.stateProxy) { + textContent.stateProxy = targetEl.stateProxy; + } + } + const labelStatesTexts = getLabelText(opt, labelStatesModels); + const normalModel = labelStatesModels.normal; + const showNormal = !!normalModel.getShallow("show"); + const normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText); + normalStyle.text = labelStatesTexts.normal; + if (!isSetOnText) { + targetEl.setTextConfig(createTextConfig(normalModel, opt, false)); + } + for (let i = 0; i < SPECIAL_STATES.length; i++) { + const stateName = SPECIAL_STATES[i]; + const stateModel = labelStatesModels[stateName]; + if (stateModel) { + const stateObj = textContent.ensureState(stateName); + const stateShow = !!retrieve2(stateModel.getShallow("show"), showNormal); + if (stateShow !== showNormal) { + stateObj.ignore = !stateShow; + } + stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText); + stateObj.style.text = labelStatesTexts[stateName]; + if (!isSetOnText) { + const targetElEmphasisState = targetEl.ensureState(stateName); + targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true); + } + } + } + textContent.silent = !!normalModel.getShallow("silent"); + if (textContent.style.x != null) { + normalStyle.x = textContent.style.x; + } + if (textContent.style.y != null) { + normalStyle.y = textContent.style.y; + } + textContent.ignore = !showNormal; + textContent.useStyle(normalStyle); + textContent.dirty(); + if (opt.enableTextSetter) { + labelInner(textContent).setLabelText = function(interpolatedValue) { + const labelStatesTexts2 = getLabelText(opt, labelStatesModels, interpolatedValue); + setLabelText(textContent, labelStatesTexts2); + }; + } + } else if (textContent) { + textContent.ignore = true; + } + targetEl.dirty(); +} +function getLabelStatesModels(itemModel, labelName) { + labelName = labelName || "label"; + const statesModels = { + normal: itemModel.getModel(labelName) + }; + for (let i = 0; i < SPECIAL_STATES.length; i++) { + const stateName = SPECIAL_STATES[i]; + statesModels[stateName] = itemModel.getModel([stateName, labelName]); + } + return statesModels; +} +function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) { + const textStyle = {}; + setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached); + specifiedTextStyle && extend(textStyle, specifiedTextStyle); + return textStyle; +} +function createTextConfig(textStyleModel, opt, isNotNormal) { + opt = opt || {}; + const textConfig = {}; + let labelPosition; + let labelRotate = textStyleModel.getShallow("rotate"); + const labelDistance = retrieve2(textStyleModel.getShallow("distance"), isNotNormal ? null : 5); + const labelOffset = textStyleModel.getShallow("offset"); + labelPosition = textStyleModel.getShallow("position") || (isNotNormal ? null : "inside"); + labelPosition === "outside" && (labelPosition = opt.defaultOutsidePosition || "top"); + if (labelPosition != null) { + textConfig.position = labelPosition; + } + if (labelOffset != null) { + textConfig.offset = labelOffset; + } + if (labelRotate != null) { + labelRotate *= Math.PI / 180; + textConfig.rotation = labelRotate; + } + if (labelDistance != null) { + textConfig.distance = labelDistance; + } + textConfig.outsideFill = textStyleModel.get("color") === "inherit" ? opt.inheritColor || null : "auto"; + return textConfig; +} +function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) { + opt = opt || EMPTY_OBJ; + const ecModel = textStyleModel.ecModel; + const globalTextStyle = ecModel && ecModel.option.textStyle; + const richItemNames = getRichItemNames(textStyleModel); + let richResult; + if (richItemNames) { + richResult = {}; + for (const name in richItemNames) { + if (richItemNames.hasOwnProperty(name)) { + const richTextStyle = textStyleModel.getModel(["rich", name]); + setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true); + } + } + } + if (richResult) { + textStyle.rich = richResult; + } + const overflow = textStyleModel.get("overflow"); + if (overflow) { + textStyle.overflow = overflow; + } + const margin = textStyleModel.get("minMargin"); + if (margin != null) { + textStyle.margin = margin; + } + setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false); +} +function getRichItemNames(textStyleModel) { + let richItemNameMap; + while (textStyleModel && textStyleModel !== textStyleModel.ecModel) { + const rich = (textStyleModel.option || EMPTY_OBJ).rich; + if (rich) { + richItemNameMap = richItemNameMap || {}; + const richKeys = keys(rich); + for (let i = 0; i < richKeys.length; i++) { + const richKey = richKeys[i]; + richItemNameMap[richKey] = 1; + } + } + textStyleModel = textStyleModel.parentModel; + } + return richItemNameMap; +} +var TEXT_PROPS_WITH_GLOBAL = [ + "fontStyle", + "fontWeight", + "fontSize", + "fontFamily", + "textShadowColor", + "textShadowBlur", + "textShadowOffsetX", + "textShadowOffsetY" +]; +var TEXT_PROPS_SELF = [ + "align", + "lineHeight", + "width", + "height", + "tag", + "verticalAlign", + "ellipsis" +]; +var TEXT_PROPS_BOX = [ + "padding", + "borderWidth", + "borderRadius", + "borderDashOffset", + "backgroundColor", + "borderColor", + "shadowColor", + "shadowBlur", + "shadowOffsetX", + "shadowOffsetY" +]; +function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) { + globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ; + const inheritColor = opt && opt.inheritColor; + let fillColor = textStyleModel.getShallow("color"); + let strokeColor = textStyleModel.getShallow("textBorderColor"); + let opacity = retrieve2(textStyleModel.getShallow("opacity"), globalTextStyle.opacity); + if (fillColor === "inherit" || fillColor === "auto") { + if (true) { + if (fillColor === "auto") { + deprecateReplaceLog("color: 'auto'", "color: 'inherit'"); + } + } + if (inheritColor) { + fillColor = inheritColor; + } else { + fillColor = null; + } + } + if (strokeColor === "inherit" || strokeColor === "auto") { + if (true) { + if (strokeColor === "auto") { + deprecateReplaceLog("color: 'auto'", "color: 'inherit'"); + } + } + if (inheritColor) { + strokeColor = inheritColor; + } else { + strokeColor = null; + } + } + if (!isAttached) { + fillColor = fillColor || globalTextStyle.color; + strokeColor = strokeColor || globalTextStyle.textBorderColor; + } + if (fillColor != null) { + textStyle.fill = fillColor; + } + if (strokeColor != null) { + textStyle.stroke = strokeColor; + } + const textBorderWidth = retrieve2(textStyleModel.getShallow("textBorderWidth"), globalTextStyle.textBorderWidth); + if (textBorderWidth != null) { + textStyle.lineWidth = textBorderWidth; + } + const textBorderType = retrieve2(textStyleModel.getShallow("textBorderType"), globalTextStyle.textBorderType); + if (textBorderType != null) { + textStyle.lineDash = textBorderType; + } + const textBorderDashOffset = retrieve2(textStyleModel.getShallow("textBorderDashOffset"), globalTextStyle.textBorderDashOffset); + if (textBorderDashOffset != null) { + textStyle.lineDashOffset = textBorderDashOffset; + } + if (!isNotNormal && opacity == null && !inRich) { + opacity = opt && opt.defaultOpacity; + } + if (opacity != null) { + textStyle.opacity = opacity; + } + if (!isNotNormal && !isAttached) { + if (textStyle.fill == null && opt.inheritColor) { + textStyle.fill = opt.inheritColor; + } + } + for (let i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) { + const key = TEXT_PROPS_WITH_GLOBAL[i]; + const val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]); + if (val != null) { + textStyle[key] = val; + } + } + for (let i = 0; i < TEXT_PROPS_SELF.length; i++) { + const key = TEXT_PROPS_SELF[i]; + const val = textStyleModel.getShallow(key); + if (val != null) { + textStyle[key] = val; + } + } + if (textStyle.verticalAlign == null) { + const baseline = textStyleModel.getShallow("baseline"); + if (baseline != null) { + textStyle.verticalAlign = baseline; + } + } + if (!isBlock || !opt.disableBox) { + for (let i = 0; i < TEXT_PROPS_BOX.length; i++) { + const key = TEXT_PROPS_BOX[i]; + const val = textStyleModel.getShallow(key); + if (val != null) { + textStyle[key] = val; + } + } + const borderType = textStyleModel.getShallow("borderType"); + if (borderType != null) { + textStyle.borderDash = borderType; + } + if ((textStyle.backgroundColor === "auto" || textStyle.backgroundColor === "inherit") && inheritColor) { + if (true) { + if (textStyle.backgroundColor === "auto") { + deprecateReplaceLog("backgroundColor: 'auto'", "backgroundColor: 'inherit'"); + } + } + textStyle.backgroundColor = inheritColor; + } + if ((textStyle.borderColor === "auto" || textStyle.borderColor === "inherit") && inheritColor) { + if (true) { + if (textStyle.borderColor === "auto") { + deprecateReplaceLog("borderColor: 'auto'", "borderColor: 'inherit'"); + } + } + textStyle.borderColor = inheritColor; + } + } +} +function getFont(opt, ecModel) { + const gTextStyleModel = ecModel && ecModel.getModel("textStyle"); + return trim([ + 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(" ")); +} +var labelInner = makeInner(); +function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) { + if (!label) { + return; + } + const obj = labelInner(label); + obj.prevValue = obj.value; + obj.value = value; + const normalLabelModel = labelStatesModels.normal; + obj.valueAnimation = normalLabelModel.get("valueAnimation"); + if (obj.valueAnimation) { + obj.precision = normalLabelModel.get("precision"); + obj.defaultInterpolatedText = getDefaultText; + obj.statesModels = labelStatesModels; + } +} +function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) { + const labelInnerStore = labelInner(textEl); + if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) { + return; + } + const defaultInterpolatedText = labelInnerStore.defaultInterpolatedText; + const currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue); + const targetValue = labelInnerStore.value; + function during(percent) { + const interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent); + labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated; + const labelText = getLabelText({ + labelDataIndex: dataIndex, + labelFetcher, + defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + "" + }, labelInnerStore.statesModels, interpolated); + setLabelText(textEl, labelText); + } + textEl.percent = 0; + (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, { + percent: 1 + }, animatableModel, dataIndex, null, during); +} + +// src/model/mixin/textStyle.ts +var PATH_COLOR = ["textStyle", "color"]; +var textStyleParams = [ + "fontStyle", + "fontWeight", + "fontSize", + "fontFamily", + "padding", + "lineHeight", + "rich", + "width", + "height", + "overflow" +]; +var tmpText = new Text_default(); +var TextStyleMixin = class { + getTextColor(isEmphasis) { + const ecModel = this.ecModel; + return this.getShallow("color") || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null); + } + getFont() { + return getFont({ + fontStyle: this.getShallow("fontStyle"), + fontWeight: this.getShallow("fontWeight"), + fontSize: this.getShallow("fontSize"), + fontFamily: this.getShallow("fontFamily") + }, this.ecModel); + } + getTextRect(text) { + const style = { + text, + verticalAlign: this.getShallow("verticalAlign") || this.getShallow("baseline") + }; + for (let i = 0; i < textStyleParams.length; i++) { + style[textStyleParams[i]] = this.getShallow(textStyleParams[i]); + } + tmpText.useStyle(style); + tmpText.update(); + return tmpText.getBoundingRect(); + } +}; +var textStyle_default = TextStyleMixin; + +// src/model/mixin/lineStyle.ts +var LINE_STYLE_KEY_MAP = [ + ["lineWidth", "width"], + ["stroke", "color"], + ["opacity"], + ["shadowBlur"], + ["shadowOffsetX"], + ["shadowOffsetY"], + ["shadowColor"], + ["lineDash", "type"], + ["lineDashOffset", "dashOffset"], + ["lineCap", "cap"], + ["lineJoin", "join"], + ["miterLimit"] +]; +var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP); +var LineStyleMixin = class { + getLineStyle(excludes) { + return getLineStyle(this, excludes); + } +}; + +// src/model/mixin/itemStyle.ts +var ITEM_STYLE_KEY_MAP = [ + ["fill", "color"], + ["stroke", "borderColor"], + ["lineWidth", "borderWidth"], + ["opacity"], + ["shadowBlur"], + ["shadowOffsetX"], + ["shadowOffsetY"], + ["shadowColor"], + ["lineDash", "borderType"], + ["lineDashOffset", "borderDashOffset"], + ["lineCap", "borderCap"], + ["lineJoin", "borderJoin"], + ["miterLimit", "borderMiterLimit"] +]; +var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP); +var ItemStyleMixin = class { + getItemStyle(excludes, includes) { + return getItemStyle(this, excludes, includes); + } +}; + +// src/model/Model.ts +var Model = class { + constructor(option, parentModel, ecModel) { + this.parentModel = parentModel; + this.ecModel = ecModel; + this.option = option; + } + init(option, parentModel, ecModel, ...rest) { + } + mergeOption(option, ecModel) { + merge(this.option, option, true); + } + get(path, ignoreParent) { + if (path == null) { + return this.option; + } + return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel); + } + getShallow(key, ignoreParent) { + const option = this.option; + let val = option == null ? option : option[key]; + if (val == null && !ignoreParent) { + const parentModel = this.parentModel; + if (parentModel) { + val = parentModel.getShallow(key); + } + } + return val; + } + getModel(path, parentModel) { + const hasPath = path != null; + const pathFinal = hasPath ? this.parsePath(path) : null; + const obj = hasPath ? this._doGet(pathFinal) : this.option; + parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal)); + return new Model(obj, parentModel, this.ecModel); + } + isEmpty() { + return this.option == null; + } + restoreData() { + } + clone() { + const Ctor = this.constructor; + return new Ctor(clone(this.option)); + } + parsePath(path) { + if (typeof path === "string") { + return path.split("."); + } + return path; + } + resolveParentPath(path) { + return path; + } + isAnimationEnabled() { + if (!env_default.node && this.option) { + if (this.option.animation != null) { + return !!this.option.animation; + } else if (this.parentModel) { + return this.parentModel.isAnimationEnabled(); + } + } + } + _doGet(pathArr, parentModel) { + let obj = this.option; + if (!pathArr) { + return obj; + } + for (let i = 0; i < pathArr.length; i++) { + if (!pathArr[i]) { + continue; + } + obj = obj && typeof obj === "object" ? obj[pathArr[i]] : null; + if (obj == null) { + break; + } + } + if (obj == null && parentModel) { + obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel); + } + return obj; + } +}; +enableClassExtend(Model); +enableClassCheck(Model); +mixin(Model, LineStyleMixin); +mixin(Model, ItemStyleMixin); +mixin(Model, AreaStyleMixin); +mixin(Model, textStyle_default); +var Model_default = Model; + +// src/util/component.ts +var base = Math.round(Math.random() * 10); +function getUID(type) { + return [type || "", base++].join("_"); +} +function enableSubTypeDefaulter(target) { + const subTypeDefaulters = {}; + target.registerSubTypeDefaulter = function(componentType, defaulter) { + const componentTypeInfo = parseClassType(componentType); + subTypeDefaulters[componentTypeInfo.main] = defaulter; + }; + target.determineSubType = function(componentType, option) { + let type = option.type; + if (!type) { + const componentTypeMain = parseClassType(componentType).main; + if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) { + type = subTypeDefaulters[componentTypeMain](option); + } + } + return type; + }; +} +function enableTopologicalTravel(entity, dependencyGetter) { + entity.topologicalTravel = function(targetNameList, fullNameList, callback, context) { + if (!targetNameList.length) { + return; + } + const result = makeDepndencyGraph(fullNameList); + const graph = result.graph; + const noEntryList = result.noEntryList; + const targetNameSet = {}; + each(targetNameList, function(name) { + targetNameSet[name] = true; + }); + while (noEntryList.length) { + const currComponentType = noEntryList.pop(); + const currVertex = graph[currComponentType]; + const isInTargetNameSet = !!targetNameSet[currComponentType]; + if (isInTargetNameSet) { + callback.call(context, currComponentType, currVertex.originalDeps.slice()); + delete targetNameSet[currComponentType]; + } + each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge); + } + each(targetNameSet, function() { + let errMsg = ""; + if (true) { + errMsg = makePrintable("Circular dependency may exists: ", targetNameSet, targetNameList, fullNameList); + } + throw new Error(errMsg); + }); + function removeEdge(succComponentType) { + graph[succComponentType].entryCount--; + if (graph[succComponentType].entryCount === 0) { + noEntryList.push(succComponentType); + } + } + function removeEdgeAndAdd(succComponentType) { + targetNameSet[succComponentType] = true; + removeEdge(succComponentType); + } + }; + function makeDepndencyGraph(fullNameList) { + const graph = {}; + const noEntryList = []; + each(fullNameList, function(name) { + const thisItem = createDependencyGraphItem(graph, name); + const originalDeps = thisItem.originalDeps = dependencyGetter(name); + const availableDeps = getAvailableDependencies(originalDeps, fullNameList); + thisItem.entryCount = availableDeps.length; + if (thisItem.entryCount === 0) { + noEntryList.push(name); + } + each(availableDeps, function(dependentName) { + if (indexOf(thisItem.predecessor, dependentName) < 0) { + thisItem.predecessor.push(dependentName); + } + const thatItem = createDependencyGraphItem(graph, dependentName); + if (indexOf(thatItem.successor, dependentName) < 0) { + thatItem.successor.push(name); } - ctx.putImageData(imageData, 0, 0); - return canvas; - }; - /** - * get canvas of a black circle brush used for canvas to draw later - */ - HeatmapLayer.prototype._getBrush = function () { - var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas()); - // set brush size - var r = this.pointSize + this.blurSize; - var d = r * 2; - brushCanvas.width = d; - brushCanvas.height = d; - var ctx = brushCanvas.getContext('2d'); - ctx.clearRect(0, 0, d, d); - // in order to render shadow without the distinct circle, - // draw the distinct circle in an invisible place, - // and use shadowOffset to draw shadow in the center of the canvas - ctx.shadowOffsetX = d; - ctx.shadowBlur = this.blurSize; - // draw the shadow in black, and use alpha and shadow blur to generate - // color in color map - ctx.shadowColor = '#000'; - // draw circle in the left to the canvas - ctx.beginPath(); - ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true); - ctx.closePath(); - ctx.fill(); - return brushCanvas; - }; - /** - * get gradient color map - * @private - */ - HeatmapLayer.prototype._getGradient = function (colorFunc, state) { - var gradientPixels = this._gradientPixels; - var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4)); - var color = [0, 0, 0, 0]; - var off = 0; - for (var i = 0; i < 256; i++) { - colorFunc[state](i / 255, true, color); - pixelsSingleState[off++] = color[0]; - pixelsSingleState[off++] = color[1]; - pixelsSingleState[off++] = color[2]; - pixelsSingleState[off++] = color[3]; - } - return pixelsSingleState; - }; - return HeatmapLayer; - }(); - - function getIsInPiecewiseRange(dataExtent, pieceList, selected) { - var dataSpan = dataExtent[1] - dataExtent[0]; - pieceList = map(pieceList, function (piece) { - return { - interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan] - }; }); - var len = pieceList.length; - var lastIndex = 0; - return function (val) { - var i; - // Try to find in the location of the last found - for (i = lastIndex; i < len; i++) { - var interval = pieceList[i].interval; - if (interval[0] <= val && val <= interval[1]) { - lastIndex = i; - break; - } - } - if (i === len) { - // Not found, back interation - for (i = lastIndex - 1; i >= 0; i--) { - var interval = pieceList[i].interval; - if (interval[0] <= val && val <= interval[1]) { - lastIndex = i; - break; - } - } + }); + return {graph, noEntryList}; + } + function createDependencyGraphItem(graph, name) { + if (!graph[name]) { + graph[name] = {predecessor: [], successor: []}; + } + return graph[name]; + } + function getAvailableDependencies(originalDeps, fullNameList) { + const availableDeps = []; + each(originalDeps, function(dep) { + indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep); + }); + return availableDeps; + } +} +function inheritDefaultOption(superOption, subOption) { + return merge(merge({}, superOption, true), subOption, true); +} + +// src/i18n/langEN.ts +var langEN_default = { + time: { + month: [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + monthAbbr: [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + dayOfWeek: [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + dayOfWeekAbbr: [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }, + legend: { + selector: { + all: "All", + inverse: "Inv" + } + }, + toolbox: { + brush: { + title: { + rect: "Box Select", + polygon: "Lasso Select", + lineX: "Horizontally Select", + lineY: "Vertically Select", + keep: "Keep Selections", + clear: "Clear Selections" + } + }, + dataView: { + title: "Data View", + lang: ["Data View", "Close", "Refresh"] + }, + dataZoom: { + title: { + zoom: "Zoom", + back: "Zoom Reset" + } + }, + magicType: { + title: { + line: "Switch to Line Chart", + bar: "Switch to Bar Chart", + stack: "Stack", + tiled: "Tile" + } + }, + restore: { + title: "Restore" + }, + saveAsImage: { + title: "Save as Image", + lang: ["Right Click to Save Image"] + } + }, + series: { + typeNames: { + pie: "Pie chart", + bar: "Bar chart", + line: "Line chart", + scatter: "Scatter plot", + effectScatter: "Ripple scatter plot", + radar: "Radar chart", + tree: "Tree", + treemap: "Treemap", + boxplot: "Boxplot", + candlestick: "Candlestick", + k: "K line chart", + heatmap: "Heat map", + map: "Map", + parallel: "Parallel coordinate map", + lines: "Line graph", + graph: "Relationship graph", + sankey: "Sankey diagram", + funnel: "Funnel chart", + gauge: "Gauge", + pictorialBar: "Pictorial bar", + themeRiver: "Theme River Map", + sunburst: "Sunburst", + custom: "Custom chart", + chart: "Chart" + } + }, + aria: { + general: { + withTitle: 'This is a chart about "{title}"', + withoutTitle: "This is a chart" + }, + series: { + single: { + prefix: "", + withName: " with type {seriesType} named {seriesName}.", + withoutName: " with type {seriesType}." + }, + multiple: { + prefix: ". It consists of {seriesCount} series count.", + withName: " The {seriesId} series is a {seriesType} representing {seriesName}.", + withoutName: " The {seriesId} series is a {seriesType}.", + separator: { + middle: "", + end: "" } - return i >= 0 && i < len && selected[i]; - }; - } - function getIsInContinuousRange(dataExtent, range) { - var dataSpan = dataExtent[1] - dataExtent[0]; - range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan]; - return function (val) { - return val >= range[0] && val <= range[1]; - }; - } - function isGeoCoordSys(coordSys) { - var dimensions = coordSys.dimensions; - // Not use coordSys.type === 'geo' because coordSys maybe extended - return dimensions[0] === 'lng' && dimensions[1] === 'lat'; - } - var HeatmapView = /** @class */function (_super) { - __extends(HeatmapView, _super); - function HeatmapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = HeatmapView.type; - return _this; - } - HeatmapView.prototype.render = function (seriesModel, ecModel, api) { - var visualMapOfThisSeries; - ecModel.eachComponent('visualMap', function (visualMap) { - visualMap.eachTargetSeries(function (targetSeries) { - if (targetSeries === seriesModel) { - visualMapOfThisSeries = visualMap; - } - }); - }); - if ("development" !== 'production') { - if (!visualMapOfThisSeries) { - throw new Error('Heatmap must use with visualMap'); - } + } + }, + data: { + allData: "The data is as follows: ", + partialData: "The first {displayCnt} items are: ", + withName: "the data for {name} is {value}", + withoutName: "{value}", + separator: { + middle: ", ", + end: ". " + } + } + } +}; + +// src/i18n/langZH.ts +var langZH_default = { + time: { + month: [ + "\u4E00\u6708", + "\u4E8C\u6708", + "\u4E09\u6708", + "\u56DB\u6708", + "\u4E94\u6708", + "\u516D\u6708", + "\u4E03\u6708", + "\u516B\u6708", + "\u4E5D\u6708", + "\u5341\u6708", + "\u5341\u4E00\u6708", + "\u5341\u4E8C\u6708" + ], + monthAbbr: [ + "1\u6708", + "2\u6708", + "3\u6708", + "4\u6708", + "5\u6708", + "6\u6708", + "7\u6708", + "8\u6708", + "9\u6708", + "10\u6708", + "11\u6708", + "12\u6708" + ], + dayOfWeek: [ + "\u661F\u671F\u65E5", + "\u661F\u671F\u4E00", + "\u661F\u671F\u4E8C", + "\u661F\u671F\u4E09", + "\u661F\u671F\u56DB", + "\u661F\u671F\u4E94", + "\u661F\u671F\u516D" + ], + dayOfWeekAbbr: [ + "\u65E5", + "\u4E00", + "\u4E8C", + "\u4E09", + "\u56DB", + "\u4E94", + "\u516D" + ] + }, + legend: { + selector: { + all: "\u5168\u9009", + inverse: "\u53CD\u9009" + } + }, + toolbox: { + brush: { + title: { + rect: "\u77E9\u5F62\u9009\u62E9", + polygon: "\u5708\u9009", + lineX: "\u6A2A\u5411\u9009\u62E9", + lineY: "\u7EB5\u5411\u9009\u62E9", + keep: "\u4FDD\u6301\u9009\u62E9", + clear: "\u6E05\u9664\u9009\u62E9" + } + }, + dataView: { + title: "\u6570\u636E\u89C6\u56FE", + lang: ["\u6570\u636E\u89C6\u56FE", "\u5173\u95ED", "\u5237\u65B0"] + }, + dataZoom: { + title: { + zoom: "\u533A\u57DF\u7F29\u653E", + back: "\u533A\u57DF\u7F29\u653E\u8FD8\u539F" + } + }, + magicType: { + title: { + line: "\u5207\u6362\u4E3A\u6298\u7EBF\u56FE", + bar: "\u5207\u6362\u4E3A\u67F1\u72B6\u56FE", + stack: "\u5207\u6362\u4E3A\u5806\u53E0", + tiled: "\u5207\u6362\u4E3A\u5E73\u94FA" + } + }, + restore: { + title: "\u8FD8\u539F" + }, + saveAsImage: { + title: "\u4FDD\u5B58\u4E3A\u56FE\u7247", + lang: ["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"] + } + }, + series: { + typeNames: { + pie: "\u997C\u56FE", + bar: "\u67F1\u72B6\u56FE", + line: "\u6298\u7EBF\u56FE", + scatter: "\u6563\u70B9\u56FE", + effectScatter: "\u6D9F\u6F2A\u6563\u70B9\u56FE", + radar: "\u96F7\u8FBE\u56FE", + tree: "\u6811\u56FE", + treemap: "\u77E9\u5F62\u6811\u56FE", + boxplot: "\u7BB1\u578B\u56FE", + candlestick: "K\u7EBF\u56FE", + k: "K\u7EBF\u56FE", + heatmap: "\u70ED\u529B\u56FE", + map: "\u5730\u56FE", + parallel: "\u5E73\u884C\u5750\u6807\u56FE", + lines: "\u7EBF\u56FE", + graph: "\u5173\u7CFB\u56FE", + sankey: "\u6851\u57FA\u56FE", + funnel: "\u6F0F\u6597\u56FE", + gauge: "\u4EEA\u8868\u76D8\u56FE", + pictorialBar: "\u8C61\u5F62\u67F1\u56FE", + themeRiver: "\u4E3B\u9898\u6CB3\u6D41\u56FE", + sunburst: "\u65ED\u65E5\u56FE", + custom: "\u81EA\u5B9A\u4E49\u56FE\u8868", + chart: "\u56FE\u8868" + } + }, + aria: { + general: { + withTitle: "\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002", + withoutTitle: "\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C" + }, + series: { + single: { + prefix: "", + withName: "\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002", + withoutName: "\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002" + }, + multiple: { + prefix: "\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002", + withName: "\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C", + withoutName: "\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C", + separator: { + middle: "\uFF1B", + end: "\u3002" } - // Clear previously rendered progressive elements. - this._progressiveEls = null; - this.group.removeAll(); - var coordSys = seriesModel.coordinateSystem; - if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') { - this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count()); - } else if (isGeoCoordSys(coordSys)) { - this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api); + } + }, + data: { + allData: "\u5176\u6570\u636E\u662F\u2014\u2014", + partialData: "\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014", + withName: "{name}\u7684\u6570\u636E\u662F{value}", + withoutName: "{value}", + separator: { + middle: "\uFF0C", + end: "" + } + } + } +}; + +// src/core/locale.ts +var LOCALE_ZH = "ZH"; +var LOCALE_EN = "EN"; +var DEFAULT_LOCALE = LOCALE_EN; +var localeStorage = {}; +var localeModels = {}; +var SYSTEM_LANG = !env_default.domSupported ? DEFAULT_LOCALE : function() { + const langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE).toUpperCase(); + return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE; +}(); +function registerLocale(locale, localeObj) { + locale = locale.toUpperCase(); + localeModels[locale] = new Model_default(localeObj); + localeStorage[locale] = localeObj; +} +function createLocaleObject(locale) { + if (isString(locale)) { + const localeObj = localeStorage[locale.toUpperCase()] || {}; + if (locale === LOCALE_ZH || locale === LOCALE_EN) { + return clone(localeObj); + } else { + return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false); + } + } else { + return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false); + } +} +function getLocaleModel(lang) { + return localeModels[lang]; +} +function getDefaultLocaleModel() { + return localeModels[DEFAULT_LOCALE]; +} +registerLocale(LOCALE_EN, langEN_default); +registerLocale(LOCALE_ZH, langZH_default); + +// src/util/time.ts +var ONE_SECOND = 1e3; +var ONE_MINUTE = ONE_SECOND * 60; +var ONE_HOUR = ONE_MINUTE * 60; +var ONE_DAY = ONE_HOUR * 24; +var ONE_YEAR = ONE_DAY * 365; +var defaultLeveledFormatter = { + year: "{yyyy}", + month: "{MMM}", + day: "{d}", + hour: "{HH}:{mm}", + minute: "{HH}:{mm}", + second: "{HH}:{mm}:{ss}", + millisecond: "{HH}:{mm}:{ss} {SSS}", + none: "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}" +}; +var fullDayFormatter = "{yyyy}-{MM}-{dd}"; +var fullLeveledFormatter = { + year: "{yyyy}", + month: "{yyyy}-{MM}", + day: fullDayFormatter, + hour: fullDayFormatter + " " + defaultLeveledFormatter.hour, + minute: fullDayFormatter + " " + defaultLeveledFormatter.minute, + second: fullDayFormatter + " " + defaultLeveledFormatter.second, + millisecond: defaultLeveledFormatter.none +}; +var primaryTimeUnits = [ + "year", + "month", + "day", + "hour", + "minute", + "second", + "millisecond" +]; +var timeUnits = [ + "year", + "half-year", + "quarter", + "month", + "week", + "half-week", + "day", + "half-day", + "quarter-day", + "hour", + "minute", + "second", + "millisecond" +]; +function pad(str, len2) { + str += ""; + return "0000".substr(0, len2 - str.length) + str; +} +function getPrimaryTimeUnit(timeUnit) { + switch (timeUnit) { + case "half-year": + case "quarter": + return "month"; + case "week": + case "half-week": + return "day"; + case "half-day": + case "quarter-day": + return "hour"; + default: + return timeUnit; + } +} +function isPrimaryTimeUnit(timeUnit) { + return timeUnit === getPrimaryTimeUnit(timeUnit); +} +function getDefaultFormatPrecisionOfInterval(timeUnit) { + switch (timeUnit) { + case "year": + case "month": + return "day"; + case "millisecond": + return "millisecond"; + default: + return "second"; + } +} +function format(time, template, isUTC, lang) { + const date = parseDate(time); + const y = date[fullYearGetterName(isUTC)](); + const M = date[monthGetterName(isUTC)]() + 1; + const q = Math.floor((M - 1) / 3) + 1; + const d = date[dateGetterName(isUTC)](); + const e2 = date["get" + (isUTC ? "UTC" : "") + "Day"](); + const H = date[hoursGetterName(isUTC)](); + const h = (H - 1) % 12 + 1; + const m2 = date[minutesGetterName(isUTC)](); + const s = date[secondsGetterName(isUTC)](); + const S = date[millisecondsGetterName(isUTC)](); + const a = H >= 12 ? "pm" : "am"; + const A = a.toUpperCase(); + const localeModel = lang instanceof Model_default ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel(); + const timeModel = localeModel.getModel("time"); + const month = timeModel.get("month"); + const monthAbbr = timeModel.get("monthAbbr"); + const dayOfWeek = timeModel.get("dayOfWeek"); + const dayOfWeekAbbr = timeModel.get("dayOfWeekAbbr"); + return (template || "").replace(/{a}/g, a + "").replace(/{A}/g, A + "").replace(/{yyyy}/g, y + "").replace(/{yy}/g, pad(y % 100 + "", 2)).replace(/{Q}/g, q + "").replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + "").replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + "").replace(/{eeee}/g, dayOfWeek[e2]).replace(/{ee}/g, dayOfWeekAbbr[e2]).replace(/{e}/g, e2 + "").replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + "").replace(/{hh}/g, pad(h + "", 2)).replace(/{h}/g, h + "").replace(/{mm}/g, pad(m2, 2)).replace(/{m}/g, m2 + "").replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + "").replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + ""); +} +function leveledFormat(tick, idx, formatter, lang, isUTC) { + let template = null; + if (isString(formatter)) { + template = formatter; + } else if (isFunction(formatter)) { + template = formatter(tick.value, idx, { + level: tick.level + }); + } else { + const defaults2 = extend({}, defaultLeveledFormatter); + if (tick.level > 0) { + for (let i = 0; i < primaryTimeUnits.length; ++i) { + defaults2[primaryTimeUnits[i]] = `{primary|${defaults2[primaryTimeUnits[i]]}}`; + } + } + const mergedFormatter = formatter ? formatter.inherit === false ? formatter : defaults(formatter, defaults2) : defaults2; + const unit = getUnitFromValue(tick.value, isUTC); + if (mergedFormatter[unit]) { + template = mergedFormatter[unit]; + } else if (mergedFormatter.inherit) { + const targetId = timeUnits.indexOf(unit); + for (let i = targetId - 1; i >= 0; --i) { + if (mergedFormatter[unit]) { + template = mergedFormatter[unit]; + break; } - }; - HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - this.group.removeAll(); - }; - HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys) { - // geo does not support incremental rendering? - if (isGeoCoordSys(coordSys)) { - this.render(seriesModel, ecModel, api); - } else { - this._progressiveEls = []; - this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true); - } + } + template = template || defaults2.none; + } + if (isArray(template)) { + let levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level; + levelId = Math.min(levelId, template.length - 1); + template = template[levelId]; + } + } + return format(new Date(tick.value), template, isUTC, lang); +} +function getUnitFromValue(value, isUTC) { + const date = parseDate(value); + const M = date[monthGetterName(isUTC)]() + 1; + const d = date[dateGetterName(isUTC)](); + const h = date[hoursGetterName(isUTC)](); + const m2 = date[minutesGetterName(isUTC)](); + const s = date[secondsGetterName(isUTC)](); + const S = date[millisecondsGetterName(isUTC)](); + const isSecond = S === 0; + const isMinute = isSecond && s === 0; + const isHour = isMinute && m2 === 0; + const isDay = isHour && h === 0; + const isMonth = isDay && d === 1; + const isYear = isMonth && M === 1; + if (isYear) { + return "year"; + } else if (isMonth) { + return "month"; + } else if (isDay) { + return "day"; + } else if (isHour) { + return "hour"; + } else if (isMinute) { + return "minute"; + } else if (isSecond) { + return "second"; + } else { + return "millisecond"; + } +} +function getUnitValue(value, unit, isUTC) { + const date = isNumber(value) ? parseDate(value) : value; + unit = unit || getUnitFromValue(value, isUTC); + switch (unit) { + case "year": + return date[fullYearGetterName(isUTC)](); + case "half-year": + return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0; + case "quarter": + return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4); + case "month": + return date[monthGetterName(isUTC)](); + case "day": + return date[dateGetterName(isUTC)](); + case "half-day": + return date[hoursGetterName(isUTC)]() / 24; + case "hour": + return date[hoursGetterName(isUTC)](); + case "minute": + return date[minutesGetterName(isUTC)](); + case "second": + return date[secondsGetterName(isUTC)](); + case "millisecond": + return date[millisecondsGetterName(isUTC)](); + } +} +function fullYearGetterName(isUTC) { + return isUTC ? "getUTCFullYear" : "getFullYear"; +} +function monthGetterName(isUTC) { + return isUTC ? "getUTCMonth" : "getMonth"; +} +function dateGetterName(isUTC) { + return isUTC ? "getUTCDate" : "getDate"; +} +function hoursGetterName(isUTC) { + return isUTC ? "getUTCHours" : "getHours"; +} +function minutesGetterName(isUTC) { + return isUTC ? "getUTCMinutes" : "getMinutes"; +} +function secondsGetterName(isUTC) { + return isUTC ? "getUTCSeconds" : "getSeconds"; +} +function millisecondsGetterName(isUTC) { + return isUTC ? "getUTCMilliseconds" : "getMilliseconds"; +} +function fullYearSetterName(isUTC) { + return isUTC ? "setUTCFullYear" : "setFullYear"; +} +function monthSetterName(isUTC) { + return isUTC ? "setUTCMonth" : "setMonth"; +} +function dateSetterName(isUTC) { + return isUTC ? "setUTCDate" : "setDate"; +} +function hoursSetterName(isUTC) { + return isUTC ? "setUTCHours" : "setHours"; +} +function minutesSetterName(isUTC) { + return isUTC ? "setUTCMinutes" : "setMinutes"; +} +function secondsSetterName(isUTC) { + return isUTC ? "setUTCSeconds" : "setSeconds"; +} +function millisecondsSetterName(isUTC) { + return isUTC ? "setUTCMilliseconds" : "setMilliseconds"; +} + +// src/legacy/getTextRect.ts +function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) { + const textEl = new Text_default({ + style: { + text, + font, + align, + verticalAlign, + padding, + rich, + overflow: truncate ? "truncate" : null, + lineHeight + } + }); + return textEl.getBoundingRect(); +} + +// src/util/format.ts +function addCommas(x) { + if (!isNumeric(x)) { + return isString(x) ? x : "-"; + } + const parts = (x + "").split("."); + return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (parts.length > 1 ? "." + parts[1] : ""); +} +function toCamelCase(str, upperCaseFirst) { + str = (str || "").toLowerCase().replace(/-(.)/g, function(match, group1) { + return group1.toUpperCase(); + }); + if (upperCaseFirst && str) { + str = str.charAt(0).toUpperCase() + str.slice(1); + } + return str; +} +var normalizeCssArray2 = normalizeCssArray; +function makeValueReadable(value, valueType, useUTC) { + const USER_READABLE_DEFUALT_TIME_PATTERN = "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}"; + function stringToUserReadable(str) { + return str && trim(str) ? str : "-"; + } + function isNumberUserReadable(num) { + return !!(num != null && !isNaN(num) && isFinite(num)); + } + const isTypeTime = valueType === "time"; + const isValueDate = value instanceof Date; + if (isTypeTime || isValueDate) { + const date = isTypeTime ? parseDate(value) : value; + if (!isNaN(+date)) { + return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC); + } else if (isValueDate) { + return "-"; + } + } + if (valueType === "ordinal") { + return isStringSafe(value) ? stringToUserReadable(value) : isNumber(value) ? isNumberUserReadable(value) ? value + "" : "-" : "-"; + } + const numericResult = numericToNumber(value); + return isNumberUserReadable(numericResult) ? addCommas(numericResult) : isStringSafe(value) ? stringToUserReadable(value) : typeof value === "boolean" ? value + "" : "-"; +} +var TPL_VAR_ALIAS = ["a", "b", "c", "d", "e", "f", "g"]; +var wrapVar = function(varName, seriesIdx) { + return "{" + varName + (seriesIdx == null ? "" : seriesIdx) + "}"; +}; +function formatTpl(tpl, paramsList, encode) { + if (!isArray(paramsList)) { + paramsList = [paramsList]; + } + const seriesLen = paramsList.length; + if (!seriesLen) { + return ""; + } + const $vars = paramsList[0].$vars || []; + for (let i = 0; i < $vars.length; i++) { + const alias = TPL_VAR_ALIAS[i]; + tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0)); + } + for (let seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) { + for (let k = 0; k < $vars.length; k++) { + const val = paramsList[seriesIdx][$vars[k]]; + tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val); + } + } + return tpl; +} +function formatTplSimple(tpl, param, encode) { + each(param, function(value, key) { + tpl = tpl.replace("{" + key + "}", encode ? encodeHTML(value) : value); + }); + return tpl; +} +function getTooltipMarker(inOpt, extraCssText) { + const opt = isString(inOpt) ? { + color: inOpt, + extraCssText + } : inOpt || {}; + const color2 = opt.color; + const type = opt.type; + extraCssText = opt.extraCssText; + const renderMode = opt.renderMode || "html"; + if (!color2) { + return ""; + } + if (renderMode === "html") { + return type === "subItem" ? '' : ''; + } else { + const markerId = opt.markerId || "markerX"; + return { + renderMode, + content: "{" + markerId + "|} ", + style: type === "subItem" ? { + width: 4, + height: 4, + borderRadius: 2, + backgroundColor: color2 + } : { + width: 10, + height: 10, + borderRadius: 5, + backgroundColor: color2 + } + }; + } +} +function formatTime(tpl, value, isUTC) { + if (true) { + deprecateReplaceLog("echarts.format.formatTime", "echarts.time.format"); + } + if (tpl === "week" || tpl === "month" || tpl === "quarter" || tpl === "half-year" || tpl === "year") { + tpl = "MM-dd\nyyyy"; + } + const date = parseDate(value); + const getUTC = isUTC ? "getUTC" : "get"; + const y = date[getUTC + "FullYear"](); + const M = date[getUTC + "Month"]() + 1; + const d = date[getUTC + "Date"](); + const h = date[getUTC + "Hours"](); + const m2 = date[getUTC + "Minutes"](); + const s = date[getUTC + "Seconds"](); + const S = date[getUTC + "Milliseconds"](); + tpl = tpl.replace("MM", pad(M, 2)).replace("M", M).replace("yyyy", y).replace("yy", pad(y % 100 + "", 2)).replace("dd", pad(d, 2)).replace("d", d).replace("hh", pad(h, 2)).replace("h", h).replace("mm", pad(m2, 2)).replace("m", m2).replace("ss", pad(s, 2)).replace("s", s).replace("SSS", pad(S, 3)); + return tpl; +} +function capitalFirst(str) { + return str ? str.charAt(0).toUpperCase() + str.substr(1) : str; +} +function convertToColorString(color2, defaultColor) { + defaultColor = defaultColor || "transparent"; + return isString(color2) ? color2 : isObject(color2) ? color2.colorStops && (color2.colorStops[0] || {}).color || defaultColor : defaultColor; +} +function windowOpen(link, target) { + if (target === "_blank" || target === "blank") { + const blank = window.open(); + blank.opener = null; + blank.location.href = link; + } else { + window.open(link, target); + } +} + +// src/util/layout.ts +var each2 = each; +var LOCATION_PARAMS = [ + "left", + "right", + "top", + "bottom", + "width", + "height" +]; +var HV_NAMES = [ + ["width", "left", "right"], + ["height", "top", "bottom"] +]; +function boxLayout(orient, group, gap, maxWidth, maxHeight) { + let x = 0; + let y = 0; + if (maxWidth == null) { + maxWidth = Infinity; + } + if (maxHeight == null) { + maxHeight = Infinity; + } + let currentLineMaxSize = 0; + group.eachChild(function(child, idx) { + const rect = child.getBoundingRect(); + const nextChild = group.childAt(idx + 1); + const nextChildRect = nextChild && nextChild.getBoundingRect(); + let nextX; + let nextY; + if (orient === "horizontal") { + const moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0); + nextX = x + moveX; + if (nextX > maxWidth || child.newline) { + x = 0; + nextX = moveX; + y += currentLineMaxSize + gap; + currentLineMaxSize = rect.height; + } else { + currentLineMaxSize = Math.max(currentLineMaxSize, rect.height); + } + } else { + const moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0); + nextY = y + moveY; + 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; + } + child.x = x; + child.y = y; + child.markRedraw(); + orient === "horizontal" ? x = nextX + gap : y = nextY + gap; + }); +} +var box = boxLayout; +var vbox = curry(boxLayout, "vertical"); +var hbox = curry(boxLayout, "horizontal"); +function getAvailableSize(positionInfo, containerRect, margin) { + const containerWidth = containerRect.width; + const containerHeight = containerRect.height; + let x = parsePercent2(positionInfo.left, containerWidth); + let y = parsePercent2(positionInfo.top, containerHeight); + let x2 = parsePercent2(positionInfo.right, containerWidth); + let y2 = parsePercent2(positionInfo.bottom, containerHeight); + (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0); + (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth); + (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0); + (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight); + margin = normalizeCssArray2(margin || 0); + return { + width: Math.max(x2 - x - margin[1] - margin[3], 0), + height: Math.max(y2 - y - margin[0] - margin[2], 0) + }; +} +function getLayoutRect(positionInfo, containerRect, margin) { + margin = normalizeCssArray2(margin || 0); + const containerWidth = containerRect.width; + const containerHeight = containerRect.height; + let left = parsePercent2(positionInfo.left, containerWidth); + let top = parsePercent2(positionInfo.top, containerHeight); + const right = parsePercent2(positionInfo.right, containerWidth); + const bottom = parsePercent2(positionInfo.bottom, containerHeight); + let width = parsePercent2(positionInfo.width, containerWidth); + let height = parsePercent2(positionInfo.height, containerHeight); + const verticalMargin = margin[2] + margin[0]; + const horizontalMargin = margin[1] + margin[3]; + const aspect = positionInfo.aspect; + if (isNaN(width)) { + width = containerWidth - right - horizontalMargin - left; + } + if (isNaN(height)) { + height = containerHeight - bottom - verticalMargin - top; + } + if (aspect != null) { + if (isNaN(width) && isNaN(height)) { + if (aspect > containerWidth / containerHeight) { + width = containerWidth * 0.8; + } else { + height = containerHeight * 0.8; + } + } + if (isNaN(width)) { + width = aspect * height; + } + if (isNaN(height)) { + height = width / aspect; + } + } + if (isNaN(left)) { + left = containerWidth - right - width - horizontalMargin; + } + if (isNaN(top)) { + top = containerHeight - bottom - height - verticalMargin; + } + 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; + } + left = left || 0; + top = top || 0; + if (isNaN(width)) { + width = containerWidth - horizontalMargin - left - (right || 0); + } + if (isNaN(height)) { + height = containerHeight - verticalMargin - top - (bottom || 0); + } + const rect = new BoundingRect_default(left + margin[3], top + margin[0], width, height); + rect.margin = margin; + return rect; +} +function positionElement(el, positionInfo, containerRect, margin, opt, out2) { + const h = !opt || !opt.hv || opt.hv[0]; + const v = !opt || !opt.hv || opt.hv[1]; + const boundingMode = opt && opt.boundingMode || "all"; + out2 = out2 || el; + out2.x = el.x; + out2.y = el.y; + if (!h && !v) { + return false; + } + let rect; + if (boundingMode === "raw") { + rect = el.type === "group" ? new BoundingRect_default(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect(); + } else { + rect = el.getBoundingRect(); + if (el.needLocalTransform()) { + const transform2 = el.getLocalTransform(); + rect = rect.clone(); + rect.applyTransform(transform2); + } + } + const layoutRect = getLayoutRect(defaults({width: rect.width, height: rect.height}, positionInfo), containerRect, margin); + const dx = h ? layoutRect.x - rect.x : 0; + const dy = v ? layoutRect.y - rect.y : 0; + if (boundingMode === "raw") { + out2.x = dx; + out2.y = dy; + } else { + out2.x += dx; + out2.y += dy; + } + if (out2 === el) { + el.markRedraw(); + } + return true; +} +function sizeCalculable(option, hvIdx) { + return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null; +} +function fetchLayoutMode(ins) { + const layoutMode = ins.layoutMode || ins.constructor.layoutMode; + return isObject(layoutMode) ? layoutMode : layoutMode ? {type: layoutMode} : null; +} +function mergeLayoutParam(targetOption, newOption, opt) { + let ignoreSize = opt && opt.ignoreSize; + !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]); + const hResult = merge2(HV_NAMES[0], 0); + const vResult = merge2(HV_NAMES[1], 1); + copy3(HV_NAMES[0], targetOption, hResult); + copy3(HV_NAMES[1], targetOption, vResult); + function merge2(names, hvIdx) { + const newParams = {}; + let newValueCount = 0; + const merged = {}; + let mergedValueCount = 0; + const enoughParamNumber = 2; + each2(names, function(name) { + merged[name] = targetOption[name]; + }); + each2(names, function(name) { + hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]); + hasValue(newParams, name) && newValueCount++; + hasValue(merged, name) && mergedValueCount++; + }); + if (ignoreSize[hvIdx]) { + if (hasValue(newOption, names[1])) { + merged[names[2]] = null; + } else if (hasValue(newOption, names[2])) { + merged[names[1]] = null; + } + return merged; + } + if (mergedValueCount === enoughParamNumber || !newValueCount) { + return merged; + } else if (newValueCount >= enoughParamNumber) { + return newParams; + } else { + for (let i = 0; i < names.length; i++) { + const name = names[i]; + if (!hasProp(newParams, name) && hasProp(targetOption, name)) { + newParams[name] = targetOption[name]; + break; } - }; - HeatmapView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; - HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) { - var coordSys = seriesModel.coordinateSystem; - var isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d'); - var width; - var height; - var xAxisExtent; - var yAxisExtent; - if (isCartesian2d) { - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - if ("development" !== 'production') { - if (!(xAxis.type === 'category' && yAxis.type === 'category')) { - throw new Error('Heatmap on cartesian must have two category axes'); - } - if (!(xAxis.onBand && yAxis.onBand)) { - throw new Error('Heatmap on cartesian must have two axes with boundaryGap true'); - } - } - // add 0.5px to avoid the gaps - width = xAxis.getBandWidth() + .5; - height = yAxis.getBandWidth() + .5; - xAxisExtent = xAxis.scale.getExtent(); - yAxisExtent = yAxis.scale.getExtent(); - } - var group = this.group; - var data = seriesModel.getData(); - var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle(); - var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(); - var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle(); - var borderRadius = seriesModel.get(['itemStyle', 'borderRadius']); - var labelStatesModels = getLabelStatesModels(seriesModel); - var emphasisModel = seriesModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var emphasisDisabled = emphasisModel.get('disabled'); - var dataDims = isCartesian2d ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')]; - for (var idx = start; idx < end; idx++) { - var rect = void 0; - var style = data.getItemVisual(idx, 'style'); - if (isCartesian2d) { - var dataDimX = data.get(dataDims[0], idx); - var dataDimY = data.get(dataDims[1], idx); - // Ignore empty data and out of extent data - if (isNaN(data.get(dataDims[2], idx)) || isNaN(dataDimX) || isNaN(dataDimY) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) { - continue; - } - var point = coordSys.dataToPoint([dataDimX, dataDimY]); - rect = new Rect({ - shape: { - x: point[0] - width / 2, - y: point[1] - height / 2, - width: width, - height: height - }, - style: style - }); - } else { - // Ignore empty data - if (isNaN(data.get(dataDims[1], idx))) { - continue; - } - rect = new Rect({ - z2: 1, - shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape, - style: style - }); - } - // Optimization for large dataset - if (data.hasItemOption) { - var itemModel = data.getItemModel(idx); - var emphasisModel_1 = itemModel.getModel('emphasis'); - emphasisStyle = emphasisModel_1.getModel('itemStyle').getItemStyle(); - blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); - selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); - // Each item value struct in the data would be firstly - // { - // itemStyle: { borderRadius: [30, 30] }, - // value: [2022, 02, 22] - // } - borderRadius = itemModel.get(['itemStyle', 'borderRadius']); - focus = emphasisModel_1.get('focus'); - blurScope = emphasisModel_1.get('blurScope'); - emphasisDisabled = emphasisModel_1.get('disabled'); - labelStatesModels = getLabelStatesModels(itemModel); - } - rect.shape.r = borderRadius; - var rawValue = seriesModel.getRawValue(idx); - var defaultText = '-'; - if (rawValue && rawValue[2] != null) { - defaultText = rawValue[2] + ''; - } - setLabelStyle(rect, labelStatesModels, { - labelFetcher: seriesModel, - labelDataIndex: idx, - defaultOpacity: style.opacity, - defaultText: defaultText - }); - rect.ensureState('emphasis').style = emphasisStyle; - rect.ensureState('blur').style = blurStyle; - rect.ensureState('select').style = selectStyle; - toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled); - rect.incremental = incremental; - // PENDING - if (incremental) { - // Rect must use hover layer if it's incremental. - rect.states.emphasis.hoverLayer = true; - } - group.add(rect); - data.setItemGraphicEl(idx, rect); - if (this._progressiveEls) { - this._progressiveEls.push(rect); - } + } + return newParams; + } + } + function hasProp(obj, name) { + return obj.hasOwnProperty(name); + } + function hasValue(obj, name) { + return obj[name] != null && obj[name] !== "auto"; + } + function copy3(names, target, source) { + each2(names, function(name) { + target[name] = source[name]; + }); + } +} +function getLayoutParams(source) { + return copyLayoutParams({}, source); +} +function copyLayoutParams(target, source) { + source && target && each2(LOCATION_PARAMS, function(name) { + source.hasOwnProperty(name) && (target[name] = source[name]); + }); + return target; +} + +// src/model/Component.ts +var inner = makeInner(); +var ComponentModel2 = class extends Model_default { + constructor(option, parentModel, ecModel) { + super(option, parentModel, ecModel); + this.uid = getUID("ec_cpt_model"); + } + init(option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + } + mergeDefaultAndTheme(option, ecModel) { + const layoutMode = fetchLayoutMode(this); + const inputPositionParams = layoutMode ? getLayoutParams(option) : {}; + const themeModel = ecModel.getTheme(); + merge(option, themeModel.get(this.mainType)); + merge(option, this.getDefaultOption()); + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + } + mergeOption(option, ecModel) { + merge(this.option, option, true); + const layoutMode = fetchLayoutMode(this); + if (layoutMode) { + mergeLayoutParam(this.option, option, layoutMode); + } + } + optionUpdated(newCptOption, isInit) { + } + getDefaultOption() { + const ctor = this.constructor; + if (!isExtendedClass(ctor)) { + return ctor.defaultOption; + } + const fields = inner(this); + if (!fields.defaultOption) { + const optList = []; + let clz = ctor; + while (clz) { + const opt = clz.prototype.defaultOption; + opt && optList.push(opt); + clz = clz.superClass; + } + let defaultOption3 = {}; + for (let i = optList.length - 1; i >= 0; i--) { + defaultOption3 = merge(defaultOption3, optList[i], true); + } + fields.defaultOption = defaultOption3; + } + return fields.defaultOption; + } + getReferringComponents(mainType, opt) { + const indexKey = mainType + "Index"; + const idKey = mainType + "Id"; + return queryReferringComponents(this.ecModel, mainType, { + index: this.get(indexKey, true), + id: this.get(idKey, true) + }, opt); + } + getBoxLayoutParams() { + const boxLayoutModel = this; + return { + left: boxLayoutModel.get("left"), + top: boxLayoutModel.get("top"), + right: boxLayoutModel.get("right"), + bottom: boxLayoutModel.get("bottom"), + width: boxLayoutModel.get("width"), + height: boxLayoutModel.get("height") + }; + } + getZLevelKey() { + return ""; + } + setZLevel(zlevel) { + this.option.zlevel = zlevel; + } +}; +var ComponentModel = ComponentModel2; +ComponentModel.protoInitialize = function() { + const proto2 = ComponentModel2.prototype; + proto2.type = "component"; + proto2.id = ""; + proto2.name = ""; + proto2.mainType = ""; + proto2.subType = ""; + proto2.componentIndex = 0; +}(); +mountExtend(ComponentModel, Model_default); +enableClassManagement(ComponentModel); +enableSubTypeDefaulter(ComponentModel); +enableTopologicalTravel(ComponentModel, getDependencies); +function getDependencies(componentType) { + let deps = []; + each(ComponentModel.getClassesByMainType(componentType), function(clz) { + deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []); + }); + deps = map(deps, function(type) { + return parseClassType(type).main; + }); + if (componentType !== "dataset" && indexOf(deps, "dataset") <= 0) { + deps.unshift("dataset"); + } + return deps; +} +var Component_default = ComponentModel; + +// src/model/globalDefault.ts +var platform = ""; +if (typeof navigator !== "undefined") { + platform = navigator.platform || ""; +} +var decalColor = "rgba(0, 0, 0, 0.2)"; +var globalDefault_default = { + darkMode: "auto", + colorBy: "series", + color: [ + "#5470c6", + "#91cc75", + "#fac858", + "#ee6666", + "#73c0de", + "#3ba272", + "#fc8452", + "#9a60b4", + "#ea7ccc" + ], + gradientColor: ["#f6efa6", "#d88273", "#bf444c"], + aria: { + decal: { + decals: [{ + color: decalColor, + dashArrayX: [1, 0], + dashArrayY: [2, 5], + symbolSize: 1, + rotation: Math.PI / 6 + }, { + color: decalColor, + symbol: "circle", + dashArrayX: [[8, 8], [0, 8, 8, 0]], + dashArrayY: [6, 0], + symbolSize: 0.8 + }, { + color: decalColor, + dashArrayX: [1, 0], + dashArrayY: [4, 3], + rotation: -Math.PI / 4 + }, { + color: decalColor, + dashArrayX: [[6, 6], [0, 6, 6, 0]], + dashArrayY: [6, 0] + }, { + color: decalColor, + dashArrayX: [[1, 0], [1, 6]], + dashArrayY: [1, 0, 6, 0], + rotation: Math.PI / 4 + }, { + color: decalColor, + symbol: "triangle", + dashArrayX: [[9, 9], [0, 9, 9, 0]], + dashArrayY: [7, 2], + symbolSize: 0.75 + }] + } + }, + textStyle: { + fontFamily: platform.match(/^Win/) ? "Microsoft YaHei" : "sans-serif", + fontSize: 12, + fontStyle: "normal", + fontWeight: "normal" + }, + blendMode: null, + stateAnimation: { + duration: 300, + easing: "cubicOut" + }, + animation: "auto", + animationDuration: 1e3, + animationDurationUpdate: 500, + animationEasing: "cubicInOut", + animationEasingUpdate: "cubicInOut", + animationThreshold: 2e3, + progressiveThreshold: 3e3, + progressive: 400, + hoverLayerThreshold: 3e3, + useUTC: false +}; + +// src/util/types.ts +var VISUAL_DIMENSIONS = createHashMap([ + "tooltip", + "label", + "itemName", + "itemId", + "itemGroupId", + "itemChildGroupId", + "seriesName" +]); +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_TYPED_ARRAY = "typedArray"; +var SOURCE_FORMAT_UNKNOWN = "unknown"; +var SERIES_LAYOUT_BY_COLUMN = "column"; +var SERIES_LAYOUT_BY_ROW = "row"; + +// src/data/helper/sourceHelper.ts +var BE_ORDINAL = { + Must: 1, + Might: 2, + Not: 3 +}; +var innerGlobalModel = makeInner(); +function resetSourceDefaulter(ecModel) { + innerGlobalModel(ecModel).datasetMap = createHashMap(); +} +function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) { + const encode = {}; + const datasetModel = querySeriesUpstreamDatasetModel(seriesModel); + if (!datasetModel || !coordDimensions) { + return encode; + } + const encodeItemName = []; + const encodeSeriesName = []; + const ecModel = seriesModel.ecModel; + const datasetMap = innerGlobalModel(ecModel).datasetMap; + const key = datasetModel.uid + "_" + source.seriesLayoutBy; + let baseCategoryDimIndex; + let categoryWayValueDimStart; + coordDimensions = coordDimensions.slice(); + each(coordDimensions, function(coordDimInfoLoose, coordDimIdx) { + const coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {name: coordDimInfoLoose}; + if (coordDimInfo.type === "ordinal" && baseCategoryDimIndex == null) { + baseCategoryDimIndex = coordDimIdx; + categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo); + } + encode[coordDimInfo.name] = []; + }); + const datasetRecord = datasetMap.get(key) || datasetMap.set(key, {categoryWayDim: categoryWayValueDimStart, valueWayDim: 0}); + each(coordDimensions, function(coordDimInfo, coordDimIdx) { + const coordDimName = coordDimInfo.name; + const count2 = getDataDimCountOnCoordDim(coordDimInfo); + if (baseCategoryDimIndex == null) { + const start2 = datasetRecord.valueWayDim; + pushDim(encode[coordDimName], start2, count2); + pushDim(encodeSeriesName, start2, count2); + datasetRecord.valueWayDim += count2; + } else if (baseCategoryDimIndex === coordDimIdx) { + pushDim(encode[coordDimName], 0, count2); + pushDim(encodeItemName, 0, count2); + } else { + const start2 = datasetRecord.categoryWayDim; + pushDim(encode[coordDimName], start2, count2); + pushDim(encodeSeriesName, start2, count2); + datasetRecord.categoryWayDim += count2; + } + }); + function pushDim(dimIdxArr, idxFrom, idxCount) { + for (let i = 0; i < idxCount; i++) { + dimIdxArr.push(idxFrom + i); + } + } + function getDataDimCountOnCoordDim(coordDimInfo) { + const dimsDef = coordDimInfo.dimsDef; + return dimsDef ? dimsDef.length : 1; + } + encodeItemName.length && (encode.itemName = encodeItemName); + encodeSeriesName.length && (encode.seriesName = encodeSeriesName); + return encode; +} +function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) { + const encode = {}; + const datasetModel = querySeriesUpstreamDatasetModel(seriesModel); + if (!datasetModel) { + return encode; + } + const sourceFormat = source.sourceFormat; + const dimensionsDefine = source.dimensionsDefine; + let 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; + } + }); + } + const idxResult = function() { + const idxRes0 = {}; + const idxRes1 = {}; + const guessRecords = []; + for (let i = 0, len2 = Math.min(5, dimCount); i < len2; i++) { + const guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i); + guessRecords.push(guessResult); + const isPureNumber = guessResult === BE_ORDINAL.Not; + 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; + } + 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(idxResult2) { + return idxResult2.v != null && idxResult2.n != null; + } + return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null; + }(); + if (idxResult) { + encode.value = [idxResult.v]; + const nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; + encode.itemName = [nameDimIndex]; + encode.seriesName = [nameDimIndex]; + } + return encode; +} +function querySeriesUpstreamDatasetModel(seriesModel) { + const thisData = seriesModel.get("data", true); + if (!thisData) { + return queryReferringComponents(seriesModel.ecModel, "dataset", { + index: seriesModel.get("datasetIndex", true), + id: seriesModel.get("datasetId", true) + }, SINGLE_REFERRING).models[0]; + } +} +function queryDatasetUpstreamDatasetModels(datasetModel) { + if (!datasetModel.get("transform", true) && !datasetModel.get("fromTransformResult", true)) { + return []; + } + return queryReferringComponents(datasetModel.ecModel, "dataset", { + index: datasetModel.get("fromDatasetIndex", true), + id: datasetModel.get("fromDatasetId", true) + }, SINGLE_REFERRING).models; +} +function guessOrdinal(source, dimIndex) { + return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex); +} +function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) { + let result; + const maxLoop = 5; + if (isTypedArray(data)) { + return BE_ORDINAL.Not; + } + let dimName; + let dimType; + if (dimensionsDefine) { + const 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) { + const dataArrayRows = data; + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + const sample = dataArrayRows[dimIndex]; + for (let i = 0; i < (sample || []).length && i < maxLoop; i++) { + if ((result = detectValue(sample[startIndex + i])) != null) { + return result; } - }; - HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) { - var inRangeVisuals = visualMapModel.targetVisuals.inRange; - var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; - // if (!visualMapping) { - // throw new Error('Data range must have color visuals'); - // } - var data = seriesModel.getData(); - var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer(); - hmLayer.blurSize = seriesModel.get('blurSize'); - hmLayer.pointSize = seriesModel.get('pointSize'); - hmLayer.minOpacity = seriesModel.get('minOpacity'); - hmLayer.maxOpacity = seriesModel.get('maxOpacity'); - var rect = geo.getViewRect().clone(); - var roamTransform = geo.getRoamTransform(); - rect.applyTransform(roamTransform); - // Clamp on viewport - var x = Math.max(rect.x, 0); - var y = Math.max(rect.y, 0); - var x2 = Math.min(rect.width + rect.x, api.getWidth()); - var y2 = Math.min(rect.height + rect.y, api.getHeight()); - var width = x2 - x; - var height = y2 - y; - var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')]; - var points = data.mapArray(dims, function (lng, lat, value) { - var pt = geo.dataToPoint([lng, lat]); - pt[0] -= x; - pt[1] -= y; - pt.push(value); - return pt; - }); - var dataExtent = visualMapModel.getExtent(); - var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected); - hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), { - inRange: inRangeVisuals.color.getColorMapper(), - outOfRange: outOfRangeVisuals.color.getColorMapper() - }, isInRange); - var img = new ZRImage({ - style: { - width: width, - height: height, - x: x, - y: y, - image: hmLayer.canvas - }, - silent: true - }); - this.group.add(img); - }; - HeatmapView.type = 'heatmap'; - return HeatmapView; - }(ChartView); - - var HeatmapSeriesModel = /** @class */function (_super) { - __extends(HeatmapSeriesModel, _super); - function HeatmapSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = HeatmapSeriesModel.type; - return _this; - } - HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - generateCoord: 'value' - }); - }; - HeatmapSeriesModel.prototype.preventIncremental = function () { - var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem')); - if (coordSysCreator && coordSysCreator.dimensions) { - return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat'; + } + } else { + for (let i = 0; i < dataArrayRows.length && i < maxLoop; i++) { + const row = dataArrayRows[startIndex + i]; + if (row && (result = detectValue(row[dimIndex])) != null) { + return result; } - }; - HeatmapSeriesModel.type = 'series.heatmap'; - HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar']; - HeatmapSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - // Cartesian coordinate system - // xAxisIndex: 0, - // yAxisIndex: 0, - // Geo coordinate system - geoIndex: 0, - blurSize: 30, - pointSize: 20, - maxOpacity: 1, - minOpacity: 0, - select: { - itemStyle: { - borderColor: '#212121' - } + } + } + } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + const dataObjectRows = data; + if (!dimName) { + return BE_ORDINAL.Not; + } + for (let i = 0; i < dataObjectRows.length && i < maxLoop; i++) { + const item = dataObjectRows[i]; + if (item && (result = detectValue(item[dimName])) != null) { + return result; + } + } + } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + const dataKeyedColumns = data; + if (!dimName) { + return BE_ORDINAL.Not; + } + const sample = dataKeyedColumns[dimName]; + if (!sample || isTypedArray(sample)) { + return BE_ORDINAL.Not; + } + for (let i = 0; i < sample.length && i < maxLoop; i++) { + if ((result = detectValue(sample[i])) != null) { + return result; + } + } + } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + const dataOriginal = data; + for (let i = 0; i < dataOriginal.length && i < maxLoop; i++) { + const item = dataOriginal[i]; + const val = getDataItemValue(item); + if (!isArray(val)) { + return BE_ORDINAL.Not; + } + if ((result = detectValue(val[dimIndex])) != null) { + return result; + } + } + } + function detectValue(val) { + const beStr = isString(val); + if (val != null && Number.isFinite(Number(val)) && val !== "") { + return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not; + } else if (beStr && val !== "-") { + return BE_ORDINAL.Must; + } + } + return BE_ORDINAL.Not; +} + +// src/model/internalComponentCreator.ts +var internalOptionCreatorMap = createHashMap(); +function registerInternalOptionCreator(mainType, creator) { + assert(internalOptionCreatorMap.get(mainType) == null && creator); + internalOptionCreatorMap.set(mainType, creator); +} +function concatInternalOptions(ecModel, mainType, newCmptOptionList) { + const internalOptionCreator = internalOptionCreatorMap.get(mainType); + if (!internalOptionCreator) { + return newCmptOptionList; + } + const internalOptions = internalOptionCreator(ecModel); + if (!internalOptions) { + return newCmptOptionList; + } + if (true) { + for (let i = 0; i < internalOptions.length; i++) { + assert(isComponentIdInternal(internalOptions[i])); + } + } + return newCmptOptionList.concat(internalOptions); +} + +// src/model/mixin/palette.ts +var innerColor = makeInner(); +var innerDecal = makeInner(); +var PaletteMixin = class { + getColorFromPalette(name, scope, requestNum) { + const defaultPalette = normalizeToArray(this.get("color", true)); + const layeredPalette = this.get("colorLayer", true); + return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum); + } + clearColorPalette() { + clearPalette(this, innerColor); + } +}; +function getDecalFromPalette(ecModel, name, scope, requestNum) { + const defaultDecals = normalizeToArray(ecModel.get(["aria", "decal", "decals"])); + return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum); +} +function getNearestPalette(palettes, requestColorNum) { + const paletteNum = palettes.length; + for (let i = 0; i < paletteNum; i++) { + if (palettes[i].length > requestColorNum) { + return palettes[i]; + } + } + return palettes[paletteNum - 1]; +} +function getFromPalette(that, inner23, defaultPalette, layeredPalette, name, scope, requestNum) { + scope = scope || that; + const scopeFields = inner23(scope); + const paletteIdx = scopeFields.paletteIdx || 0; + const paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {}; + if (paletteNameMap.hasOwnProperty(name)) { + return paletteNameMap[name]; + } + let palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum); + palette = palette || defaultPalette; + if (!palette || !palette.length) { + return; + } + const pickedPaletteItem = palette[paletteIdx]; + if (name) { + paletteNameMap[name] = pickedPaletteItem; + } + scopeFields.paletteIdx = (paletteIdx + 1) % palette.length; + return pickedPaletteItem; +} +function clearPalette(that, inner23) { + inner23(that).paletteIdx = 0; + inner23(that).paletteNameMap = {}; +} + +// src/model/Global.ts +var reCreateSeriesIndices; +var assertSeriesInitialized; +var initBase; +var OPTION_INNER_KEY = "\0_ec_inner"; +var OPTION_INNER_VALUE = 1; +var BUITIN_COMPONENTS_MAP = { + grid: "GridComponent", + polar: "PolarComponent", + geo: "GeoComponent", + singleAxis: "SingleAxisComponent", + parallel: "ParallelComponent", + calendar: "CalendarComponent", + graphic: "GraphicComponent", + toolbox: "ToolboxComponent", + tooltip: "TooltipComponent", + axisPointer: "AxisPointerComponent", + brush: "BrushComponent", + title: "TitleComponent", + timeline: "TimelineComponent", + markPoint: "MarkPointComponent", + markLine: "MarkLineComponent", + markArea: "MarkAreaComponent", + legend: "LegendComponent", + dataZoom: "DataZoomComponent", + visualMap: "VisualMapComponent", + xAxis: "GridComponent", + yAxis: "GridComponent", + angleAxis: "PolarComponent", + radiusAxis: "PolarComponent" +}; +var BUILTIN_CHARTS_MAP = { + line: "LineChart", + bar: "BarChart", + pie: "PieChart", + scatter: "ScatterChart", + radar: "RadarChart", + map: "MapChart", + tree: "TreeChart", + treemap: "TreemapChart", + graph: "GraphChart", + gauge: "GaugeChart", + funnel: "FunnelChart", + parallel: "ParallelChart", + sankey: "SankeyChart", + boxplot: "BoxplotChart", + candlestick: "CandlestickChart", + effectScatter: "EffectScatterChart", + lines: "LinesChart", + heatmap: "HeatmapChart", + pictorialBar: "PictorialBarChart", + themeRiver: "ThemeRiverChart", + sunburst: "SunburstChart", + custom: "CustomChart" +}; +var componetsMissingLogPrinted = {}; +function checkMissingComponents(option) { + each(option, function(componentOption, mainType) { + if (!Component_default.hasClass(mainType)) { + const componentImportName = BUITIN_COMPONENTS_MAP[mainType]; + if (componentImportName && !componetsMissingLogPrinted[componentImportName]) { + error(`Component ${mainType} is used but not imported. +import { ${componentImportName} } from 'echarts/components'; +echarts.use([${componentImportName}]);`); + componetsMissingLogPrinted[componentImportName] = true; + } + } + }); +} +var GlobalModel = class extends Model_default { + init(option, parentModel, ecModel, theme2, locale, optionManager) { + theme2 = theme2 || {}; + this.option = null; + this._theme = new Model_default(theme2); + this._locale = new Model_default(locale); + this._optionManager = optionManager; + } + setOption(option, opts, optionPreprocessorFuncs2) { + if (true) { + assert(option != null, "option is null/undefined"); + assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, "please use chart.getOption()"); + } + const innerOpt = normalizeSetOptionInput(opts); + this._optionManager.setOption(option, optionPreprocessorFuncs2, innerOpt); + this._resetOption(null, innerOpt); + } + resetOption(type, opt) { + return this._resetOption(type, normalizeSetOptionInput(opt)); + } + _resetOption(type, opt) { + let optionChanged = false; + const optionManager = this._optionManager; + if (!type || type === "recreate") { + const baseOption = optionManager.mountOption(type === "recreate"); + if (true) { + checkMissingComponents(baseOption); + } + if (!this.option || type === "recreate") { + initBase(this, baseOption); + } else { + this.restoreData(); + this._mergeOption(baseOption, opt); + } + optionChanged = true; + } + if (type === "timeline" || type === "media") { + this.restoreData(); + } + if (!type || type === "recreate" || type === "timeline") { + const timelineOption = optionManager.getTimelineOption(this); + if (timelineOption) { + optionChanged = true; + this._mergeOption(timelineOption, opt); + } + } + if (!type || type === "recreate" || type === "media") { + const mediaOptions = optionManager.getMediaOption(this); + if (mediaOptions.length) { + each(mediaOptions, function(mediaOption) { + optionChanged = true; + this._mergeOption(mediaOption, opt); + }, this); + } + } + return optionChanged; + } + mergeOption(option) { + this._mergeOption(option, null); + } + _mergeOption(newOption, opt) { + const option = this.option; + const componentsMap = this._componentsMap; + const componentsCount = this._componentsCount; + const newCmptTypes = []; + const newCmptTypeMap = createHashMap(); + const replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap; + resetSourceDefaulter(this); + each(newOption, function(componentOption, mainType) { + if (componentOption == null) { + return; + } + if (!Component_default.hasClass(mainType)) { + option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true); + } else if (mainType) { + newCmptTypes.push(mainType); + newCmptTypeMap.set(mainType, true); + } + }); + if (replaceMergeMainTypeMap) { + replaceMergeMainTypeMap.each(function(val, mainTypeInReplaceMerge) { + if (Component_default.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) { + newCmptTypes.push(mainTypeInReplaceMerge); + newCmptTypeMap.set(mainTypeInReplaceMerge, true); } - }; - return HeatmapSeriesModel; - }(SeriesModel); - - function install$n(registers) { - registers.registerChartView(HeatmapView); - registers.registerSeriesModel(HeatmapSeriesModel); + }); } - - 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 Circle(); - var PictorialBarView = /** @class */function (_super) { - __extends(PictorialBarView, _super); - function PictorialBarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = PictorialBarView.type; - return _this; - } - PictorialBarView.prototype.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.master.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; + Component_default.topologicalTravel(newCmptTypes, Component_default.getAllClassMainTypes(), visitComponent, this); + function visitComponent(mainType) { + const newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType])); + const oldCmptList = componentsMap.get(mainType); + const mergeMode = !oldCmptList ? "replaceAll" : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? "replaceMerge" : "normalMerge"; + const mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode); + setComponentTypeToKeyInfo(mappingResult, mainType, Component_default); + option[mainType] = null; + componentsMap.set(mainType, null); + componentsCount.set(mainType, 0); + const optionsByMainType = []; + const cmptsByMainType = []; + let cmptsCountByMainType = 0; + let tooltipExists; + let tooltipWarningLogged; + each(mappingResult, function(resultItem, index) { + let componentModel = resultItem.existing; + const newCmptOption = resultItem.newOption; + if (!newCmptOption) { + if (componentModel) { + componentModel.mergeOption({}, this); + componentModel.optionUpdated({}, false); } - 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$1(bar, opt, symbolMeta); - }).update(function (newIndex, oldIndex) { - var bar = oldData.getItemGraphicEl(oldIndex); - if (!data.hasValue(newIndex)) { - group.remove(bar); + } else { + const isSeriesType = mainType === "series"; + const ComponentModelClass = Component_default.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType); + if (!ComponentModelClass) { + if (true) { + const subType = resultItem.keyInfo.subType; + const seriesImportName = BUILTIN_CHARTS_MAP[subType]; + if (!componetsMissingLogPrinted[subType]) { + componetsMissingLogPrinted[subType] = true; + if (seriesImportName) { + error(`Series ${subType} is used but not imported. +import { ${seriesImportName} } from 'echarts/charts'; +echarts.use([${seriesImportName}]);`); + } else { + error(`Unknown series ${subType}`); + } + } + } 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 (mainType === "tooltip") { + if (tooltipExists) { + if (true) { + if (!tooltipWarningLogged) { + warn("Currently only one tooltip component is allowed."); + tooltipWarningLogged = true; + } + } + return; + } + tooltipExists = true; } - if (bar) { - updateBar(bar, opt, symbolMeta); + if (componentModel && componentModel.constructor === ComponentModelClass) { + componentModel.name = resultItem.keyInfo.name; + componentModel.mergeOption(newCmptOption, this); + componentModel.optionUpdated(newCmptOption, false); } else { - bar = createBar(data, opt, symbolMeta, true); - } - data.setItemGraphicEl(newIndex, bar); - bar.__pictorialSymbolMeta = symbolMeta; - // Add back - group.add(bar); - updateCommon$1(bar, opt, symbolMeta); - }).remove(function (dataIndex) { - var bar = oldData.getItemGraphicEl(dataIndex); - bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); - }).execute(); - // Do clipping - var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null; - if (clipPath) { - group.setClipPath(clipPath); + const extraOpt = extend({ + componentIndex: index + }, resultItem.keyInfo); + componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); + extend(componentModel, extraOpt); + if (resultItem.brandNew) { + componentModel.__requireNewView = true; + } + componentModel.init(newCmptOption, this, this); + componentModel.optionUpdated(null, true); + } + } + if (componentModel) { + optionsByMainType.push(componentModel.option); + cmptsByMainType.push(componentModel); + cmptsCountByMainType++; } else { - group.removeClipPath(); + optionsByMainType.push(void 0); + cmptsByMainType.push(void 0); } - this._data = data; - return this.group; - }; - PictorialBarView.prototype.remove = function (ecModel, api) { - var group = this.group; - var data = this._data; - if (ecModel.get('animation')) { - if (data) { - data.eachItemGraphicEl(function (bar) { - removeBar(data, getECData(bar).dataIndex, ecModel, bar); - }); - } - } else { - group.removeAll(); - } - }; - PictorialBarView.type = 'pictorialBar'; - return PictorialBarView; - }(ChartView); - // 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', - style: data.getItemVisual(dataIndex, 'style'), - symbolClip: symbolClip, - symbolRepeat: symbolRepeat, - symbolRepeatDirection: itemModel.get('symbolRepeatDirection'), - symbolPatternSize: symbolPatternSize, - rotation: rotation, - animationModel: isAnimationEnabled ? itemModel : null, - hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']), - 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 = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize); - 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, outputSymbolMeta) { - 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 (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]; - } - outputSymbolMeta.boundingLength = boundingLength; - if (symbolRepeat) { - outputSymbolMeta.repeatCutLength = layout[valueDim.wh]; - } - // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero - // and when borderWidth be settled, the actual linewidth will be NaN - outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1; - } - 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, outputSymbolMeta) { - var valueDim = opt.valueDim; - var categoryDim = opt.categoryDim; - var categorySize = Math.abs(layout[categoryDim.wh]); - var symbolSize = data.getItemVisual(dataIndex, 'symbolSize'); - var parsedSymbolSize; - if (isArray(symbolSize)) { - parsedSymbolSize = symbolSize.slice(); - } else { - if (symbolSize == null) { - // will parse to number below - parsedSymbolSize = ['100%', '100%']; - } else { - parsedSymbolSize = [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. - parsedSymbolSize[categoryDim.index] = parsePercent$1(parsedSymbolSize[categoryDim.index], categorySize); - parsedSymbolSize[valueDim.index] = parsePercent$1(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength)); - outputSymbolMeta.symbolSize = parsedSymbolSize; - // If x or y is less than zero, show reversed shape. - var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[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, outputSymbolMeta) { - // 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({ - scaleX: symbolScale[0], - scaleY: symbolScale[1], - rotation: rotation - }); - pathForLineWidth.updateTransform(); - valueLineWidth /= pathForLineWidth.getLineScale(); - valueLineWidth *= symbolScale[opt.valueDim.index]; - } - outputSymbolMeta.valueLineWidth = valueLineWidth || 0; - } - function prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) { - var categoryDim = opt.categoryDim; - var valueDim = opt.valueDim; - var pxSign = outputSymbolMeta.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 = retrieve(itemModel.get('symbolMargin'), '15%') + ''; - var hasEndGap = false; - if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) { - hasEndGap = true; - symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1); - } - var symbolMarginNumeric = parsePercent$1(symbolMargin, symbolSize[valueDim.index]); - var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 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 : symbolMarginNumeric * 2; - // Both final repeatTimes and final symbolMarginNumeric 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; - symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1)); - uLenWithMargin = unitLength + symbolMarginNumeric * 2; - endFix = hasEndGap ? 0 : symbolMarginNumeric * 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; - outputSymbolMeta.repeatTimes = repeatTimes; - outputSymbolMeta.symbolMargin = symbolMarginNumeric; - } - var sizeFix = pxSign * (pathLen / 2); - var pathPosition = outputSymbolMeta.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 = outputSymbolMeta.bundlePosition = []; - bundlePosition[categoryDim.index] = layout[categoryDim.xy]; - bundlePosition[valueDim.index] = layout[valueDim.xy]; - var barRectShape = outputSymbolMeta.barRectShape = 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 = outputSymbolMeta.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); - 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, { - scaleX: 0, - scaleY: 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, { - x: target.x, - y: target.y, - scaleX: 0, - scaleY: 0 - }, { - scaleX: target.scaleX, - scaleY: target.scaleY, - rotation: target.rotation - }, symbolMeta, isUpdate); - } - 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 { - x: position[0], - y: position[1], - scaleX: symbolMeta.symbolScale[0], - scaleY: symbolMeta.symbolScale[1], - rotation: symbolMeta.rotation - }; + }, this); + option[mainType] = optionsByMainType; + componentsMap.set(mainType, cmptsByMainType); + componentsCount.set(mainType, cmptsCountByMainType); + if (mainType === "series") { + reCreateSeriesIndices(this); } } - 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, { - x: symbolMeta.pathPosition[0], - y: symbolMeta.pathPosition[1], - scaleX: 0, - scaleY: 0, - rotation: symbolMeta.rotation - }, { - scaleX: symbolMeta.symbolScale[0], - scaleY: symbolMeta.symbolScale[1] - }, symbolMeta, isUpdate); - } else { - updateAttr(mainPath, null, { - x: symbolMeta.pathPosition[0], - y: symbolMeta.pathPosition[1], - scaleX: symbolMeta.symbolScale[0], - scaleY: symbolMeta.symbolScale[1], - rotation: symbolMeta.rotation - }, symbolMeta, isUpdate); - } - } - // bar rect is used for label. - function createOrUpdateBarRect(bar, symbolMeta, isUpdate) { - var rectShape = extend({}, symbolMeta.barRectShape); - var barRect = bar.__pictorialBarRect; - if (!barRect) { - barRect = bar.__pictorialBarRect = new Rect({ - z2: 2, - shape: rectShape, - silent: true, - style: { - stroke: 'transparent', - fill: 'transparent', - lineWidth: 0 + if (!this._seriesIndices) { + reCreateSeriesIndices(this); + } + } + getOption() { + const option = clone(this.option); + each(option, function(optInMainType, mainType) { + if (Component_default.hasClass(mainType)) { + const opts = normalizeToArray(optInMainType); + let realLen = opts.length; + let metNonInner = false; + for (let i = realLen - 1; i >= 0; i--) { + if (opts[i] && !isComponentIdInternal(opts[i])) { + metNonInner = true; + } else { + opts[i] = null; + !metNonInner && realLen--; } - }); - barRect.disableMorphing = true; - 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 = extend({}, symbolMeta.clipShape); - var valueDim = opt.valueDim; - var animationModel = symbolMeta.animationModel; - var dataIndex = symbolMeta.dataIndex; - if (clipPath) { - updateProps(clipPath, { - shape: clipShape - }, animationModel, dataIndex); - } else { - clipShape[valueDim.wh] = 0; - clipPath = new 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); } + opts.length = realLen; + option[mainType] = opts; } + }); + delete option[OPTION_INNER_KEY]; + return option; + } + getTheme() { + return this._theme; + } + getLocaleModel() { + return this._locale; + } + setUpdatePayload(payload) { + this._payload = payload; + } + getUpdatePayload() { + return this._payload; + } + getComponent(mainType, idx) { + const list = this._componentsMap.get(mainType); + if (list) { + const cmpt = list[idx || 0]; + if (cmpt) { + return cmpt; + } else if (idx == null) { + for (let i = 0; i < list.length; i++) { + if (list[i]) { + return list[i]; + } + } + } + } + } + queryComponents(condition) { + const mainType = condition.mainType; + if (!mainType) { + return []; + } + const index = condition.index; + const id = condition.id; + const name = condition.name; + const cmpts = this._componentsMap.get(mainType); + if (!cmpts || !cmpts.length) { + return []; + } + let result; + if (index != null) { + result = []; + each(normalizeToArray(index), function(idx) { + cmpts[idx] && result.push(cmpts[idx]); + }); + } else if (id != null) { + result = queryByIdOrName("id", id, cmpts); + } else if (name != null) { + result = queryByIdOrName("name", name, cmpts); + } else { + result = filter(cmpts, (cmpt) => !!cmpt); + } + return filterBySubType(result, condition); + } + findComponents(condition) { + const query = condition.query; + const mainType = condition.mainType; + const queryCond = getQueryCond(query); + const result = queryCond ? this.queryComponents(queryCond) : filter(this._componentsMap.get(mainType), (cmpt) => !!cmpt); + return doFilter(filterBySubType(result, condition)); + function getQueryCond(q) { + const indexAttr = mainType + "Index"; + const idAttr = mainType + "Id"; + const nameAttr = mainType + "Name"; + return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? { + mainType, + index: q[indexAttr], + id: q[idAttr], + name: q[nameAttr] + } : null; } - 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 doFilter(res) { + return condition.filter ? filter(res, condition.filter) : res; } - function isAnimationEnabled() { - // `animation` prop can be set on itemModel in pictorial bar chart. - return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation'); - } - function createBar(data, opt, symbolMeta, isUpdate) { - // bar is the main element for each data. - var bar = new Group(); - // bundle is used for location and clip. - var bundle = new Group(); - bar.add(bundle); - bar.__pictorialBundle = bundle; - bundle.x = symbolMeta.bundlePosition[0]; - bundle.y = symbolMeta.bundlePosition[1]; - if (symbolMeta.symbolRepeat) { - createOrUpdateRepeatSymbols(bar, opt, symbolMeta); - } else { - createOrUpdateSingleSymbol(bar, opt, symbolMeta); + } + eachComponent(mainType, cb, context) { + const componentsMap = this._componentsMap; + if (isFunction(mainType)) { + const ctxForAll = cb; + const cbForAll = mainType; + componentsMap.each(function(cmpts, componentType) { + for (let i = 0; cmpts && i < cmpts.length; i++) { + const cmpt = cmpts[i]; + cmpt && cbForAll.call(ctxForAll, componentType, cmpt, cmpt.componentIndex); + } + }); + } else { + const cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null; + for (let i = 0; cmpts && i < cmpts.length; i++) { + const cmpt = cmpts[i]; + cmpt && cb.call(context, cmpt, cmpt.componentIndex); + } + } + } + getSeriesByName(name) { + const nameStr = convertOptionIdName(name, null); + return filter(this._componentsMap.get("series"), (oneSeries) => !!oneSeries && nameStr != null && oneSeries.name === nameStr); + } + getSeriesByIndex(seriesIndex) { + return this._componentsMap.get("series")[seriesIndex]; + } + getSeriesByType(subType) { + return filter(this._componentsMap.get("series"), (oneSeries) => !!oneSeries && oneSeries.subType === subType); + } + getSeries() { + return filter(this._componentsMap.get("series"), (oneSeries) => !!oneSeries); + } + getSeriesCount() { + return this._componentsCount.get("series"); + } + eachSeries(cb, context) { + assertSeriesInitialized(this); + each(this._seriesIndices, function(rawSeriesIndex) { + const series = this._componentsMap.get("series")[rawSeriesIndex]; + cb.call(context, series, rawSeriesIndex); + }, this); + } + eachRawSeries(cb, context) { + each(this._componentsMap.get("series"), function(series) { + series && cb.call(context, series, series.componentIndex); + }); + } + eachSeriesByType(subType, cb, context) { + assertSeriesInitialized(this); + each(this._seriesIndices, function(rawSeriesIndex) { + const series = this._componentsMap.get("series")[rawSeriesIndex]; + if (series.subType === subType) { + cb.call(context, series, rawSeriesIndex); + } + }, this); + } + eachRawSeriesByType(subType, cb, context) { + return each(this.getSeriesByType(subType), cb, context); + } + isSeriesFiltered(seriesModel) { + assertSeriesInitialized(this); + return this._seriesIndicesMap.get(seriesModel.componentIndex) == null; + } + getCurrentSeriesIndices() { + return (this._seriesIndices || []).slice(); + } + filterSeries(cb, context) { + assertSeriesInitialized(this); + const newSeriesIndices = []; + each(this._seriesIndices, function(seriesRawIdx) { + const series = this._componentsMap.get("series")[seriesRawIdx]; + cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx); + }, this); + this._seriesIndices = newSeriesIndices; + this._seriesIndicesMap = createHashMap(newSeriesIndices); + } + restoreData(payload) { + reCreateSeriesIndices(this); + const componentsMap = this._componentsMap; + const componentTypes = []; + componentsMap.each(function(components, componentType) { + if (Component_default.hasClass(componentType)) { + componentTypes.push(componentType); } - 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; - updateProps(bundle, { - x: symbolMeta.bundlePosition[0], - y: symbolMeta.bundlePosition[1] - }, animationModel, dataIndex); - if (symbolMeta.symbolRepeat) { - createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true); + }); + Component_default.topologicalTravel(componentTypes, Component_default.getAllClassMainTypes(), function(componentType) { + each(componentsMap.get(componentType), function(component) { + if (component && (componentType !== "series" || !isNotTargetSeries(component, payload))) { + component.restoreData(); + } + }); + }); + } +}; +GlobalModel.internalField = function() { + reCreateSeriesIndices = function(ecModel) { + const seriesIndices = ecModel._seriesIndices = []; + each(ecModel._componentsMap.get("series"), function(series) { + series && seriesIndices.push(series.componentIndex); + }); + ecModel._seriesIndicesMap = createHashMap(seriesIndices); + }; + assertSeriesInitialized = function(ecModel) { + if (true) { + if (!ecModel._seriesIndices) { + throw new Error("Option should contains series."); + } + } + }; + initBase = function(ecModel, baseOption) { + ecModel.option = {}; + ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE; + ecModel._componentsMap = createHashMap({series: []}); + ecModel._componentsCount = createHashMap(); + const airaOption = baseOption.aria; + if (isObject(airaOption) && airaOption.enabled == null) { + airaOption.enabled = true; + } + mergeTheme(baseOption, ecModel._theme.option); + merge(baseOption, globalDefault_default, false); + ecModel._mergeOption(baseOption, null); + }; +}(); +function isNotTargetSeries(seriesModel, payload) { + if (payload) { + const index = payload.seriesIndex; + const id = payload.seriesId; + const name = payload.seriesName; + return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name != null && seriesModel.name !== name; + } +} +function mergeTheme(option, theme2) { + const notMergeColorLayer = option.color && !option.colorLayer; + each(theme2, function(themeItem, name) { + if (name === "colorLayer" && notMergeColorLayer) { + return; + } + if (!Component_default.hasClass(name)) { + if (typeof themeItem === "object") { + option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false); } 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.removeTextContent(); - var paths = []; - eachPath(bar, function (path) { - paths.push(path); + if (option[name] == null) { + option[name] = themeItem; + } + } + } + }); +} +function queryByIdOrName(attr, idOrName, cmpts) { + if (isArray(idOrName)) { + const keyMap = createHashMap(); + each(idOrName, function(idOrNameItem) { + if (idOrNameItem != null) { + const idName = convertOptionIdName(idOrNameItem, null); + idName != null && keyMap.set(idOrNameItem, true); + } + }); + return filter(cmpts, (cmpt) => cmpt && keyMap.get(cmpt[attr])); + } else { + const idName = convertOptionIdName(idOrName, null); + return filter(cmpts, (cmpt) => cmpt && idName != null && cmpt[attr] === idName); + } +} +function filterBySubType(components, condition) { + return condition.hasOwnProperty("subType") ? filter(components, (cmpt) => cmpt && cmpt.subType === condition.subType) : components; +} +function normalizeSetOptionInput(opts) { + const replaceMergeMainTypeMap = createHashMap(); + opts && each(normalizeToArray(opts.replaceMerge), function(mainType) { + if (true) { + assert(Component_default.hasClass(mainType), '"' + mainType + '" is not valid component main type in "replaceMerge"'); + } + replaceMergeMainTypeMap.set(mainType, true); + }); + return { + replaceMergeMainTypeMap + }; +} +mixin(GlobalModel, PaletteMixin); +var Global_default = GlobalModel; + +// src/core/ExtensionAPI.ts +var availableMethods = [ + "getDom", + "getZr", + "getWidth", + "getHeight", + "getDevicePixelRatio", + "dispatchAction", + "isSSR", + "isDisposed", + "on", + "off", + "getDataURL", + "getConnectedDataURL", + "getOption", + "getId", + "updateLabelLayout" +]; +var ExtensionAPI = class { + constructor(ecInstance) { + each(availableMethods, function(methodName) { + this[methodName] = bind(ecInstance[methodName], ecInstance); + }, this); + } +}; +var ExtensionAPI_default = ExtensionAPI; + +// src/core/CoordinateSystem.ts +var coordinateSystemCreators = {}; +var CoordinateSystemManager = class { + constructor() { + this._coordinateSystems = []; + } + create(ecModel, api2) { + let coordinateSystems = []; + each(coordinateSystemCreators, function(creator, type) { + const list = creator.create(ecModel, api2); + coordinateSystems = coordinateSystems.concat(list || []); + }); + this._coordinateSystems = coordinateSystems; + } + update(ecModel, api2) { + each(this._coordinateSystems, function(coordSys) { + coordSys.update && coordSys.update(ecModel, api2); + }); + } + getCoordinateSystems() { + return this._coordinateSystems.slice(); + } +}; +CoordinateSystemManager.register = function(type, creator) { + coordinateSystemCreators[type] = creator; +}; +CoordinateSystemManager.get = function(type) { + return coordinateSystemCreators[type]; +}; +var CoordinateSystem_default = CoordinateSystemManager; + +// src/model/OptionManager.ts +var QUERY_REG = /^(min|max)?(.+)$/; +var OptionManager = class { + constructor(api2) { + this._timelineOptions = []; + this._mediaList = []; + this._currentMediaIndices = []; + this._api = api2; + } + setOption(rawOption, optionPreprocessorFuncs2, opt) { + if (rawOption) { + each(normalizeToArray(rawOption.series), function(series) { + series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data); }); - bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath); - // I do not find proper remove animation for clip yet. - bar.__pictorialClipPath && (animationModel = null); - each(paths, function (path) { - removeElement(path, { - scaleX: 0, - scaleY: 0 - }, animationModel, dataIndex, function () { - bar.parent && bar.parent.remove(bar); - }); + each(normalizeToArray(rawOption.dataset), function(dataset) { + dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source); }); - data.setItemGraphicEl(dataIndex, null); } - function getShapeStr(data, symbolMeta) { - return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':'); + rawOption = clone(rawOption); + const optionBackup = this._optionBackup; + const newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs2, !optionBackup); + this._newBaseOption = newParsedOption.baseOption; + if (optionBackup) { + if (newParsedOption.timelineOptions.length) { + optionBackup.timelineOptions = newParsedOption.timelineOptions; + } + if (newParsedOption.mediaList.length) { + optionBackup.mediaList = newParsedOption.mediaList; + } + if (newParsedOption.mediaDefault) { + optionBackup.mediaDefault = newParsedOption.mediaDefault; + } + } else { + this._optionBackup = newParsedOption; + } + } + mountOption(isRecreate) { + const optionBackup = this._optionBackup; + this._timelineOptions = optionBackup.timelineOptions; + this._mediaList = optionBackup.mediaList; + this._mediaDefault = optionBackup.mediaDefault; + this._currentMediaIndices = []; + return clone(isRecreate ? optionBackup.baseOption : this._newBaseOption); + } + getTimelineOption(ecModel) { + let option; + const timelineOptions = this._timelineOptions; + if (timelineOptions.length) { + const timelineModel = ecModel.getComponent("timeline"); + if (timelineModel) { + option = clone(timelineOptions[timelineModel.getCurrentIndex()]); + } + } + return option; + } + getMediaOption(ecModel) { + const ecWidth = this._api.getWidth(); + const ecHeight = this._api.getHeight(); + const mediaList = this._mediaList; + const mediaDefault = this._mediaDefault; + let indices = []; + let result = []; + if (!mediaList.length && !mediaDefault) { + return result; + } + for (let i = 0, len2 = mediaList.length; i < len2; i++) { + if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) { + indices.push(i); + } } - function eachPath(bar, cb, context) { - // Do not use Group#eachChild, because it do not support remove. - each(bar.__pictorialBundle.children(), function (el) { - el !== bar.__pictorialBarRect && cb.call(context, el); - }); + if (!indices.length && mediaDefault) { + indices = [-1]; } - 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$1(bar, opt, symbolMeta) { - var dataIndex = symbolMeta.dataIndex; - var itemModel = symbolMeta.itemModel; - // Color must be excluded. - // Because symbol provide setColor individually to set fill and stroke - var emphasisModel = itemModel.getModel('emphasis'); - var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle(); - var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); - var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); - var cursorStyle = itemModel.getShallow('cursor'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var hoverScale = emphasisModel.get('scale'); - eachPath(bar, function (path) { - if (path instanceof ZRImage) { - var pathStyle = path.style; - path.useStyle(extend({ - // TODO other properties like dx, dy ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, symbolMeta.style)); - } else { - path.useStyle(symbolMeta.style); - } - var emphasisState = path.ensureState('emphasis'); - emphasisState.style = emphasisStyle; - if (hoverScale) { - // NOTE: Must after scale is set after updateAttr - emphasisState.scaleX = path.scaleX * 1.1; - emphasisState.scaleY = path.scaleY * 1.1; - } - path.ensureState('blur').style = blurStyle; - path.ensureState('select').style = selectStyle; - cursorStyle && (path.cursor = cursorStyle); - path.z2 = symbolMeta.z2; + if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) { + result = map(indices, function(index) { + return clone(index === -1 ? mediaDefault.option : mediaList[index].option); }); - var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)]; - var barRect = bar.__pictorialBarRect; - barRect.ignoreClip = true; - setLabelStyle(barRect, getLabelStatesModels(itemModel), { - labelFetcher: opt.seriesModel, - labelDataIndex: dataIndex, - defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex), - inheritColor: symbolMeta.style.fill, - defaultOpacity: symbolMeta.style.opacity, - defaultOutsidePosition: barPositionOutside - }); - toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled')); - } - function toIntTimes(times) { - var roundedTimes = Math.round(times); - // Escapse accurate error - return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times); - } - - var PictorialBarSeriesModel = /** @class */function (_super) { - __extends(PictorialBarSeriesModel, _super); - function PictorialBarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = PictorialBarSeriesModel.type; - _this.hasSymbolVisual = true; - _this.defaultSymbol = 'roundRect'; - return _this; - } - PictorialBarSeriesModel.prototype.getInitialData = function (option) { - // Disable stack. - option.stack = null; - return _super.prototype.getInitialData.apply(this, arguments); - }; - PictorialBarSeriesModel.type = 'series.pictorialBar'; - PictorialBarSeriesModel.dependencies = ['grid']; - PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, { - symbol: 'circle', - symbolSize: null, - symbolRotate: null, - symbolPosition: null, - symbolOffset: null, - symbolMargin: null, - symbolRepeat: false, - symbolRepeatDirection: 'end', - symbolClip: false, - symbolBoundingData: null, - symbolPatternSize: 400, - barGap: '-100%', - // Pictorial bar do not clip by default because in many cases - // xAxis and yAxis are not displayed and it's expected not to clip - clip: false, - // z can be set in data item, which is z2 actually. - // Disable progressive - progressive: 0, - emphasis: { - // By default pictorialBar do not hover scale. Hover scale is not suitable - // for the case that both has foreground and background. - scale: false - }, - select: { - itemStyle: { - borderColor: '#212121' + } + this._currentMediaIndices = indices; + return result; + } +}; +function parseRawOption(rawOption, optionPreprocessorFuncs2, isNew) { + const mediaList = []; + let mediaDefault; + let baseOption; + const declaredBaseOption = rawOption.baseOption; + const timelineOnRoot = rawOption.timeline; + const timelineOptionsOnRoot = rawOption.options; + const mediaOnRoot = rawOption.media; + const hasMedia = !!rawOption.media; + const hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline); + if (declaredBaseOption) { + baseOption = declaredBaseOption; + if (!baseOption.timeline) { + baseOption.timeline = timelineOnRoot; + } + } else { + if (hasTimeline || hasMedia) { + rawOption.options = rawOption.media = null; + } + baseOption = rawOption; + } + if (hasMedia) { + if (isArray(mediaOnRoot)) { + each(mediaOnRoot, function(singleMedia) { + if (true) { + if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) { + error("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"); + } + } + if (singleMedia && singleMedia.option) { + if (singleMedia.query) { + mediaList.push(singleMedia); + } else if (!mediaDefault) { + mediaDefault = singleMedia; } } }); - return PictorialBarSeriesModel; - }(BaseBarSeriesModel); - - function install$o(registers) { - registers.registerChartView(PictorialBarView); - registers.registerSeriesModel(PictorialBarSeriesModel); - registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar')); - // Do layout after other overall layout, which can prepare some information. - registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar')); - } - - var ThemeRiverView = /** @class */function (_super) { - __extends(ThemeRiverView, _super); - function ThemeRiverView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ThemeRiverView.type; - _this._layers = []; - return _this; - } - ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var self = this; - var group = this.group; - var layersSeries = seriesModel.getLayerSeries(); - var layoutInfo = data.getLayout('layoutInfo'); - var rect = layoutInfo.rect; - var boundaryGap = layoutInfo.boundaryGap; - group.x = 0; - group.y = rect.y + boundaryGap[0]; - function keyGetter(item) { - return item.name; - } - var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter); - var newLayersGroups = []; - dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute(); - function process(status, idx, oldIdx) { - var oldLayersGroups = self._layers; - if (status === 'remove') { - group.remove(oldLayersGroups[idx]); - return; - } - var points0 = []; - var points1 = []; - var style; - var indices = layersSeries[idx].indices; - var j = 0; - for (; j < indices.length; j++) { - var layout = data.getItemLayout(indices[j]); - var x = layout.x; - var y0 = layout.y0; - var y = layout.y; - points0.push(x, y0); - points1.push(x, y0 + y); - style = data.getItemVisual(indices[j], 'style'); - } - var polygon; - var textLayout = data.getItemLayout(indices[0]); - var labelModel = seriesModel.getModel('label'); - var margin = labelModel.get('margin'); - var emphasisModel = seriesModel.getModel('emphasis'); - if (status === 'add') { - var layerGroup = newLayersGroups[idx] = new Group(); - polygon = new ECPolygon({ - shape: { - points: points0, - stackedOnPoints: points1, - smooth: 0.4, - stackedOnSmooth: 0.4, - smoothConstraint: false - }, - z2: 0 - }); - layerGroup.add(polygon); - group.add(layerGroup); - if (seriesModel.isAnimationEnabled()) { - polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () { - polygon.removeClipPath(); - })); - } - } else { - var layerGroup = oldLayersGroups[oldIdx]; - polygon = layerGroup.childAt(0); - group.add(layerGroup); - newLayersGroups[idx] = layerGroup; - updateProps(polygon, { - shape: { - points: points0, - stackedOnPoints: points1 - } - }, seriesModel); - saveOldStyle(polygon); - } - setLabelStyle(polygon, getLabelStatesModels(seriesModel), { - labelDataIndex: indices[j - 1], - defaultText: data.getName(indices[j - 1]), - inheritColor: style.fill - }, { - normal: { - verticalAlign: 'middle' - // align: 'right' - } - }); - - polygon.setTextConfig({ - position: null, - local: true - }); - var labelEl = polygon.getTextContent(); - // TODO More label position options. - if (labelEl) { - labelEl.x = textLayout.x - margin; - labelEl.y = textLayout.y0 + textLayout.y / 2; - } - polygon.useStyle(style); - data.setItemGraphicEl(idx, polygon); - setStatesStylesFromModel(polygon, seriesModel); - toggleHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - } - this._layersSeries = layersSeries; - this._layers = newLayersGroups; - }; - ThemeRiverView.type = 'themeRiver'; - return ThemeRiverView; - }(ChartView); - // add animation to the view - function createGridClipShape$2(rect, seriesModel, cb) { - var rectEl = new Rect({ - shape: { - x: rect.x - 10, - y: rect.y - 10, - width: 0, - height: rect.height + 20 + } else { + if (true) { + error("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }"); + } + } + } + doPreprocess(baseOption); + each(timelineOptionsOnRoot, (option) => doPreprocess(option)); + each(mediaList, (media) => doPreprocess(media.option)); + function doPreprocess(option) { + each(optionPreprocessorFuncs2, function(preProcess) { + preProcess(option, isNew); + }); + } + return { + baseOption, + timelineOptions: timelineOptionsOnRoot || [], + mediaDefault, + mediaList + }; +} +function applyMediaQuery(query, ecWidth, ecHeight) { + const realMap = { + width: ecWidth, + height: ecHeight, + aspectratio: ecWidth / ecHeight + }; + let applicable = true; + each(query, function(value, attr) { + const matched = attr.match(QUERY_REG); + if (!matched || !matched[1] || !matched[2]) { + return; + } + const operator = matched[1]; + const realAttr = matched[2].toLowerCase(); + if (!compare(realMap[realAttr], value, operator)) { + applicable = false; + } + }); + return applicable; +} +function compare(real, expect, operator) { + if (operator === "min") { + return real >= expect; + } else if (operator === "max") { + return real <= expect; + } else { + return real === expect; + } +} +function indicesEquals(indices1, indices2) { + return indices1.join(",") === indices2.join(","); +} +var OptionManager_default = OptionManager; + +// src/preprocessor/helper/compatStyle.ts +var each3 = each; +var isObject2 = isObject; +var POSSIBLE_STYLES = [ + "areaStyle", + "lineStyle", + "nodeStyle", + "linkStyle", + "chordStyle", + "label", + "labelLine" +]; +function compatEC2ItemStyle(opt) { + const itemStyleOpt = opt && opt.itemStyle; + if (!itemStyleOpt) { + return; + } + for (let i = 0, len2 = POSSIBLE_STYLES.length; i < len2; i++) { + const styleName = POSSIBLE_STYLES[i]; + const normalItemStyleOpt = itemStyleOpt.normal; + const emphasisItemStyleOpt = itemStyleOpt.emphasis; + if (normalItemStyleOpt && normalItemStyleOpt[styleName]) { + if (true) { + deprecateReplaceLog(`itemStyle.normal.${styleName}`, styleName); + } + opt[styleName] = opt[styleName] || {}; + if (!opt[styleName].normal) { + opt[styleName].normal = normalItemStyleOpt[styleName]; + } else { + merge(opt[styleName].normal, normalItemStyleOpt[styleName]); + } + normalItemStyleOpt[styleName] = null; + } + if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) { + if (true) { + deprecateReplaceLog(`itemStyle.emphasis.${styleName}`, `emphasis.${styleName}`); + } + opt[styleName] = opt[styleName] || {}; + if (!opt[styleName].emphasis) { + opt[styleName].emphasis = emphasisItemStyleOpt[styleName]; + } else { + merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]); + } + emphasisItemStyleOpt[styleName] = null; + } + } +} +function convertNormalEmphasis(opt, optType, useExtend) { + if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) { + const normalOpt = opt[optType].normal; + const emphasisOpt = opt[optType].emphasis; + if (normalOpt) { + if (true) { + deprecateLog(`'normal' hierarchy in ${optType} has been removed since 4.0. All style properties are configured in ${optType} directly now.`); + } + if (useExtend) { + opt[optType].normal = opt[optType].emphasis = null; + defaults(opt[optType], normalOpt); + } else { + opt[optType] = normalOpt; + } + } + if (emphasisOpt) { + if (true) { + deprecateLog(`${optType}.emphasis has been changed to emphasis.${optType} since 4.0`); + } + opt.emphasis = opt.emphasis || {}; + opt.emphasis[optType] = emphasisOpt; + if (emphasisOpt.focus) { + opt.emphasis.focus = emphasisOpt.focus; + } + if (emphasisOpt.blurScope) { + opt.emphasis.blurScope = emphasisOpt.blurScope; + } + } + } +} +function removeEC3NormalStatus(opt) { + convertNormalEmphasis(opt, "itemStyle"); + convertNormalEmphasis(opt, "lineStyle"); + convertNormalEmphasis(opt, "areaStyle"); + convertNormalEmphasis(opt, "label"); + convertNormalEmphasis(opt, "labelLine"); + convertNormalEmphasis(opt, "upperLabel"); + convertNormalEmphasis(opt, "edgeLabel"); +} +function compatTextStyle(opt, propName) { + const labelOptSingle = isObject2(opt) && opt[propName]; + const textStyle = isObject2(labelOptSingle) && labelOptSingle.textStyle; + if (textStyle) { + if (true) { + deprecateLog(`textStyle hierarchy in ${propName} has been removed since 4.0. All textStyle properties are configured in ${propName} directly now.`); + } + for (let i = 0, len2 = TEXT_STYLE_OPTIONS.length; i < len2; i++) { + const textPropName = TEXT_STYLE_OPTIONS[i]; + if (textStyle.hasOwnProperty(textPropName)) { + labelOptSingle[textPropName] = textStyle[textPropName]; + } + } + } +} +function compatEC3CommonStyles(opt) { + if (opt) { + removeEC3NormalStatus(opt); + compatTextStyle(opt, "label"); + opt.emphasis && compatTextStyle(opt.emphasis, "label"); + } +} +function processSeries(seriesOpt) { + if (!isObject2(seriesOpt)) { + return; + } + compatEC2ItemStyle(seriesOpt); + removeEC3NormalStatus(seriesOpt); + compatTextStyle(seriesOpt, "label"); + compatTextStyle(seriesOpt, "upperLabel"); + compatTextStyle(seriesOpt, "edgeLabel"); + if (seriesOpt.emphasis) { + compatTextStyle(seriesOpt.emphasis, "label"); + compatTextStyle(seriesOpt.emphasis, "upperLabel"); + compatTextStyle(seriesOpt.emphasis, "edgeLabel"); + } + let markPoint = seriesOpt.markPoint; + if (markPoint) { + compatEC2ItemStyle(markPoint); + compatEC3CommonStyles(markPoint); + } + let markLine = seriesOpt.markLine; + if (markLine) { + compatEC2ItemStyle(markLine); + compatEC3CommonStyles(markLine); + } + const markArea = seriesOpt.markArea; + if (markArea) { + compatEC3CommonStyles(markArea); + } + let data = seriesOpt.data; + if (seriesOpt.type === "graph") { + data = data || seriesOpt.nodes; + const edgeData = seriesOpt.links || seriesOpt.edges; + if (edgeData && !isTypedArray(edgeData)) { + for (let i = 0; i < edgeData.length; i++) { + compatEC3CommonStyles(edgeData[i]); + } + } + each(seriesOpt.categories, function(opt) { + removeEC3NormalStatus(opt); + }); + } + if (data && !isTypedArray(data)) { + for (let i = 0; i < data.length; i++) { + compatEC3CommonStyles(data[i]); + } + } + markPoint = seriesOpt.markPoint; + if (markPoint && markPoint.data) { + const mpData = markPoint.data; + for (let i = 0; i < mpData.length; i++) { + compatEC3CommonStyles(mpData[i]); + } + } + markLine = seriesOpt.markLine; + if (markLine && markLine.data) { + const mlData = markLine.data; + for (let i = 0; i < mlData.length; i++) { + if (isArray(mlData[i])) { + compatEC3CommonStyles(mlData[i][0]); + compatEC3CommonStyles(mlData[i][1]); + } else { + compatEC3CommonStyles(mlData[i]); + } + } + } + if (seriesOpt.type === "gauge") { + compatTextStyle(seriesOpt, "axisLabel"); + compatTextStyle(seriesOpt, "title"); + compatTextStyle(seriesOpt, "detail"); + } else if (seriesOpt.type === "treemap") { + convertNormalEmphasis(seriesOpt.breadcrumb, "itemStyle"); + each(seriesOpt.levels, function(opt) { + removeEC3NormalStatus(opt); + }); + } else if (seriesOpt.type === "tree") { + removeEC3NormalStatus(seriesOpt.leaves); + } +} +function toArr(o) { + return isArray(o) ? o : o ? [o] : []; +} +function toObj(o) { + return (isArray(o) ? o[0] : o) || {}; +} +function globalCompatStyle(option, isTheme) { + each3(toArr(option.series), function(seriesOpt) { + isObject2(seriesOpt) && processSeries(seriesOpt); + }); + const axes = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"]; + isTheme && axes.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"); + each3(axes, function(axisName) { + each3(toArr(option[axisName]), function(axisOpt) { + if (axisOpt) { + compatTextStyle(axisOpt, "axisLabel"); + compatTextStyle(axisOpt.axisPointer, "label"); + } + }); + }); + each3(toArr(option.parallel), function(parallelOpt) { + const parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault; + compatTextStyle(parallelAxisDefault, "axisLabel"); + compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, "label"); + }); + each3(toArr(option.calendar), function(calendarOpt) { + convertNormalEmphasis(calendarOpt, "itemStyle"); + compatTextStyle(calendarOpt, "dayLabel"); + compatTextStyle(calendarOpt, "monthLabel"); + compatTextStyle(calendarOpt, "yearLabel"); + }); + each3(toArr(option.radar), function(radarOpt) { + compatTextStyle(radarOpt, "name"); + if (radarOpt.name && radarOpt.axisName == null) { + radarOpt.axisName = radarOpt.name; + delete radarOpt.name; + if (true) { + deprecateLog("name property in radar component has been changed to axisName"); + } + } + if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) { + radarOpt.axisNameGap = radarOpt.nameGap; + delete radarOpt.nameGap; + if (true) { + deprecateLog("nameGap property in radar component has been changed to axisNameGap"); + } + } + if (true) { + each3(radarOpt.indicator, function(indicatorOpt) { + if (indicatorOpt.text) { + deprecateReplaceLog("text", "name", "radar.indicator"); } }); - initProps(rectEl, { - shape: { - x: rect.x - 50, - width: rect.width + 100, - height: rect.height + 20 - } - }, seriesModel, cb); - return rectEl; - } - - var DATA_NAME_INDEX = 2; - var ThemeRiverSeriesModel = /** @class */function (_super) { - __extends(ThemeRiverSeriesModel, _super); - function ThemeRiverSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ThemeRiverSeriesModel.type; - return _this; - } - /** - * @override - */ - ThemeRiverSeriesModel.prototype.init = function (option) { - // eslint-disable-next-line - _super.prototype.init.apply(this, arguments); - // Put this function here is for the sake of consistency of code style. - // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); - }; - /** - * If there is no value of a certain point in the time for some event,set it value to 0. - * - * @param {Array} data initial data in the option - * @return {Array} - */ - ThemeRiverSeriesModel.prototype.fixData = function (data) { - var rawDataLength = data.length; - /** - * Make sure every layer data get the same keys. - * The value index tells which layer has visited. - * { - * 2014/01/01: -1 - * } - */ - var timeValueKeys = {}; - // grouped data by name - var groupResult = groupData(data, function (item) { - if (!timeValueKeys.hasOwnProperty(item[0] + '')) { - timeValueKeys[item[0] + ''] = -1; - } - return item[2]; - }); - var layerData = []; - groupResult.buckets.each(function (items, key) { - layerData.push({ - name: key, - dataList: items - }); - }); - var layerNum = layerData.length; - for (var k = 0; k < layerNum; ++k) { - var name_1 = layerData[k].name; - for (var j = 0; j < layerData[k].dataList.length; ++j) { - var timeValue = layerData[k].dataList[j][0] + ''; - timeValueKeys[timeValue] = k; - } - for (var timeValue in timeValueKeys) { - if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) { - timeValueKeys[timeValue] = k; - data[rawDataLength] = [timeValue, 0, name_1]; - rawDataLength++; - } - } + } + }); + each3(toArr(option.geo), function(geoOpt) { + if (isObject2(geoOpt)) { + compatEC3CommonStyles(geoOpt); + each3(toArr(geoOpt.regions), function(regionObj) { + compatEC3CommonStyles(regionObj); + }); + } + }); + each3(toArr(option.timeline), function(timelineOpt) { + compatEC3CommonStyles(timelineOpt); + convertNormalEmphasis(timelineOpt, "label"); + convertNormalEmphasis(timelineOpt, "itemStyle"); + convertNormalEmphasis(timelineOpt, "controlStyle", true); + const data = timelineOpt.data; + isArray(data) && each(data, function(item) { + if (isObject(item)) { + convertNormalEmphasis(item, "label"); + convertNormalEmphasis(item, "itemStyle"); + } + }); + }); + each3(toArr(option.toolbox), function(toolboxOpt) { + convertNormalEmphasis(toolboxOpt, "iconStyle"); + each3(toolboxOpt.feature, function(featureOpt) { + convertNormalEmphasis(featureOpt, "iconStyle"); + }); + }); + compatTextStyle(toObj(option.axisPointer), "label"); + compatTextStyle(toObj(option.tooltip).axisPointer, "label"); +} + +// src/preprocessor/backwardCompat.ts +function get(opt, path) { + const pathArr = path.split(","); + let obj = opt; + for (let i = 0; i < pathArr.length; i++) { + obj = obj && obj[pathArr[i]]; + if (obj == null) { + break; + } + } + return obj; +} +function set2(opt, path, val, overwrite) { + const pathArr = path.split(","); + let obj = opt; + let key; + let i = 0; + for (; i < pathArr.length - 1; i++) { + key = pathArr[i]; + if (obj[key] == null) { + obj[key] = {}; + } + obj = obj[key]; + } + if (overwrite || obj[pathArr[i]] == null) { + obj[pathArr[i]] = val; + } +} +function compatLayoutProperties(option) { + option && each(LAYOUT_PROPERTIES, function(prop) { + if (prop[0] in option && !(prop[1] in option)) { + option[prop[1]] = option[prop[0]]; + } + }); +} +var LAYOUT_PROPERTIES = [ + ["x", "left"], + ["y", "top"], + ["x2", "right"], + ["y2", "bottom"] +]; +var COMPATITABLE_COMPONENTS = [ + "grid", + "geo", + "parallel", + "legend", + "toolbox", + "title", + "visualMap", + "dataZoom", + "timeline" +]; +var BAR_ITEM_STYLE_MAP = [ + ["borderRadius", "barBorderRadius"], + ["borderColor", "barBorderColor"], + ["borderWidth", "barBorderWidth"] +]; +function compatBarItemStyle(option) { + const itemStyle = option && option.itemStyle; + if (itemStyle) { + for (let i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) { + const oldName = BAR_ITEM_STYLE_MAP[i][1]; + const newName = BAR_ITEM_STYLE_MAP[i][0]; + if (itemStyle[oldName] != null) { + itemStyle[newName] = itemStyle[oldName]; + if (true) { + deprecateReplaceLog(oldName, newName); + } + } + } + } +} +function compatPieLabel(option) { + if (!option) { + return; + } + if (option.alignTo === "edge" && option.margin != null && option.edgeDistance == null) { + if (true) { + deprecateReplaceLog("label.margin", "label.edgeDistance", "pie"); + } + option.edgeDistance = option.margin; + } +} +function compatSunburstState(option) { + if (!option) { + return; + } + if (option.downplay && !option.blur) { + option.blur = option.downplay; + if (true) { + deprecateReplaceLog("downplay", "blur", "sunburst"); + } + } +} +function compatGraphFocus(option) { + if (!option) { + return; + } + if (option.focusNodeAdjacency != null) { + option.emphasis = option.emphasis || {}; + if (option.emphasis.focus == null) { + if (true) { + deprecateReplaceLog("focusNodeAdjacency", "emphasis: { focus: 'adjacency'}", "graph/sankey"); + } + option.emphasis.focus = "adjacency"; + } + } +} +function traverseTree(data, cb) { + if (data) { + for (let i = 0; i < data.length; i++) { + cb(data[i]); + data[i] && traverseTree(data[i].children, cb); + } + } +} +function globalBackwardCompat(option, isTheme) { + globalCompatStyle(option, isTheme); + option.series = normalizeToArray(option.series); + each(option.series, function(seriesOpt) { + if (!isObject(seriesOpt)) { + return; + } + const seriesType2 = seriesOpt.type; + if (seriesType2 === "line") { + if (seriesOpt.clipOverflow != null) { + seriesOpt.clip = seriesOpt.clipOverflow; + if (true) { + deprecateReplaceLog("clipOverflow", "clip", "line"); + } + } + } else if (seriesType2 === "pie" || seriesType2 === "gauge") { + if (seriesOpt.clockWise != null) { + seriesOpt.clockwise = seriesOpt.clockWise; + if (true) { + deprecateReplaceLog("clockWise", "clockwise"); + } + } + compatPieLabel(seriesOpt.label); + const data = seriesOpt.data; + if (data && !isTypedArray(data)) { + for (let i = 0; i < data.length; i++) { + compatPieLabel(data[i]); } - return data; - }; - /** - * @override - * @param option the initial option that user gave - * @param ecModel the model object for themeRiver option - */ - ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) { - var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; - var axisType = singleAxisModel.get('type'); - // filter the data item with the value of label is undefined - var filterData = filter(option.data, function (dataItem) { - return dataItem[2] !== undefined; - }); - // ??? TODO design a stage to transfer data for themeRiver and lines? - var data = this.fixData(filterData || []); - var nameList = []; - var nameMap = this.nameMap = createHashMap(); - var count = 0; - for (var i = 0; i < data.length; ++i) { - nameList.push(data[i][DATA_NAME_INDEX]); - if (!nameMap.get(data[i][DATA_NAME_INDEX])) { - nameMap.set(data[i][DATA_NAME_INDEX], count); - count++; + } + if (seriesOpt.hoverOffset != null) { + seriesOpt.emphasis = seriesOpt.emphasis || {}; + if (seriesOpt.emphasis.scaleSize = null) { + if (true) { + deprecateReplaceLog("hoverOffset", "emphasis.scaleSize"); } + seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset; } - var dimensions = prepareSeriesDataSchema(data, { - coordDimensions: ['single'], - dimensionsDefine: [{ - name: 'time', - type: getDimensionTypeByAxis(axisType) - }, { - name: 'value', - type: 'float' - }, { - name: 'name', - type: 'ordinal' - }], - encodeDefine: { - single: 0, - value: 1, - itemName: 2 - } - }).dimensions; - var list = new SeriesData(dimensions, this); - list.initData(data); - return list; - }; - /** - * The raw data is divided into multiple layers and each layer - * has same name. - */ - ThemeRiverSeriesModel.prototype.getLayerSeries = function () { - var data = this.getData(); - var lenCount = data.count(); - var indexArr = []; - for (var i = 0; i < lenCount; ++i) { - indexArr[i] = i; - } - var timeDim = data.mapDimension('single'); - // data group by name - var groupResult = groupData(indexArr, function (index) { - return data.get('name', index); - }); - var layerSeries = []; - groupResult.buckets.each(function (items, key) { - items.sort(function (index1, index2) { - return data.get(timeDim, index1) - data.get(timeDim, index2); - }); - layerSeries.push({ - name: key, - indices: items - }); - }); - return layerSeries; - }; - /** - * Get data indices for show tooltip content - */ - ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) { - if (!isArray(dim)) { - dim = dim ? [dim] : []; - } - var data = this.getData(); - var layerSeries = this.getLayerSeries(); - var indices = []; - var layerNum = layerSeries.length; - var nestestValue; - for (var i = 0; i < layerNum; ++i) { - var minDist = Number.MAX_VALUE; - var nearestIdx = -1; - var pointNum = layerSeries[i].indices.length; - for (var j = 0; j < pointNum; ++j) { - var theValue = data.get(dim[0], layerSeries[i].indices[j]); - var dist = Math.abs(theValue - value); - if (dist <= minDist) { - nestestValue = theValue; - minDist = dist; - nearestIdx = layerSeries[i].indices[j]; - } + } + } else if (seriesType2 === "gauge") { + const pointerColor = get(seriesOpt, "pointer.color"); + pointerColor != null && set2(seriesOpt, "itemStyle.color", pointerColor); + } else if (seriesType2 === "bar") { + compatBarItemStyle(seriesOpt); + compatBarItemStyle(seriesOpt.backgroundStyle); + compatBarItemStyle(seriesOpt.emphasis); + const data = seriesOpt.data; + if (data && !isTypedArray(data)) { + for (let i = 0; i < data.length; i++) { + if (typeof data[i] === "object") { + compatBarItemStyle(data[i]); + compatBarItemStyle(data[i] && data[i].emphasis); } - indices.push(nearestIdx); } - return { - dataIndices: indices, - nestestValue: nestestValue - }; - }; - ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var name = data.getName(dataIndex); - var value = data.get(data.mapDimension('value'), dataIndex); - return createTooltipMarkup('nameValue', { - name: name, - value: value - }); - }; - ThemeRiverSeriesModel.type = 'series.themeRiver'; - ThemeRiverSeriesModel.dependencies = ['singleAxis']; - ThemeRiverSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - colorBy: 'data', - coordinateSystem: 'singleAxis', - // gap in axis's orthogonal orientation - boundaryGap: ['10%', '10%'], - // legendHoverLink: true, - singleAxisIndex: 0, - animationEasing: 'linear', - label: { - margin: 4, - show: true, - position: 'left', - fontSize: 11 - }, - emphasis: { - label: { - show: true + } + } else if (seriesType2 === "sunburst") { + const highlightPolicy = seriesOpt.highlightPolicy; + if (highlightPolicy) { + seriesOpt.emphasis = seriesOpt.emphasis || {}; + if (!seriesOpt.emphasis.focus) { + seriesOpt.emphasis.focus = highlightPolicy; + if (true) { + deprecateReplaceLog("highlightPolicy", "emphasis.focus", "sunburst"); } } - }; - return ThemeRiverSeriesModel; - }(SeriesModel); - - function themeRiverLayout(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] = parsePercent$1(boundaryGap[0], rect.height); - boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.height); - var height = rect.height - boundaryGap[0] - boundaryGap[1]; - doThemeRiverLayout(data, seriesModel, height); - } else { - boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.width); - boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.width); - var width = rect.width - boundaryGap[0] - boundaryGap[1]; - doThemeRiverLayout(data, seriesModel, width); + } + compatSunburstState(seriesOpt); + traverseTree(seriesOpt.data, compatSunburstState); + } else if (seriesType2 === "graph" || seriesType2 === "sankey") { + compatGraphFocus(seriesOpt); + } else if (seriesType2 === "map") { + if (seriesOpt.mapType && !seriesOpt.map) { + if (true) { + deprecateReplaceLog("mapType", "map", "map"); } - data.setLayout('layoutInfo', layoutInfo); - }); - } - /** - * The layout information about themeriver - * - * @param data data in the series - * @param seriesModel the model object of themeRiver series - * @param height value used to compute every series height - */ - function doThemeRiverLayout(data, seriesModel, height) { - if (!data.count()) { - return; + seriesOpt.map = seriesOpt.mapType; } - 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 = map(layerSeries, function (singleLayer) { - return 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 - }); + if (seriesOpt.mapLocation) { + if (true) { + deprecateLog("`mapLocation` is not used anymore."); } + defaults(seriesOpt, seriesOpt.mapLocation); } } - /** - * Compute the baseLine of the rawdata - * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics - * - * @param data the points in each layer - */ - function computeBaseline(data) { - var layerNum = data.length; - var pointNum = data[0].length; - var sums = []; - var y0 = []; - var max = 0; - for (var i = 0; i < pointNum; ++i) { - var temp = 0; - for (var j = 0; j < layerNum; ++j) { - temp += data[j][i][1]; - } - if (temp > max) { - max = temp; + if (seriesOpt.hoverAnimation != null) { + seriesOpt.emphasis = seriesOpt.emphasis || {}; + if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) { + if (true) { + deprecateReplaceLog("hoverAnimation", "emphasis.scale"); } - sums.push(temp); + seriesOpt.emphasis.scale = seriesOpt.hoverAnimation; } - 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; - } + } + compatLayoutProperties(seriesOpt); + }); + if (option.dataRange) { + option.visualMap = option.dataRange; + } + each(COMPATITABLE_COMPONENTS, function(componentName) { + let options = option[componentName]; + if (options) { + if (!isArray(options)) { + options = [options]; } - return { - y0: y0, - max: max - }; + each(options, function(option2) { + compatLayoutProperties(option2); + }); } - - function install$p(registers) { - registers.registerChartView(ThemeRiverView); - registers.registerSeriesModel(ThemeRiverSeriesModel); - registers.registerLayout(themeRiverLayout); - registers.registerProcessor(dataFilter('themeRiver')); - } - - var DEFAULT_SECTOR_Z = 2; - var DEFAULT_TEXT_Z = 4; - /** - * Sunburstce of Sunburst including Sector, Label, LabelLine - */ - var SunburstPiece = /** @class */function (_super) { - __extends(SunburstPiece, _super); - function SunburstPiece(node, seriesModel, ecModel, api) { - var _this = _super.call(this) || this; - _this.z2 = DEFAULT_SECTOR_Z; - _this.textConfig = { - inside: true - }; - getECData(_this).seriesIndex = seriesModel.seriesIndex; - var text = new ZRText({ - z2: DEFAULT_TEXT_Z, - silent: node.getModel().get(['label', 'silent']) - }); - _this.setTextContent(text); - _this.updateData(true, node, seriesModel, ecModel, api); - return _this; - } - SunburstPiece.prototype.updateData = function (firstCreate, node, - // state: 'emphasis' | 'normal' | 'highlight' | 'downplay', - seriesModel, ecModel, api) { - this.node = node; - node.piece = this; - seriesModel = seriesModel || this._seriesModel; - ecModel = ecModel || this._ecModel; - var sector = this; - getECData(sector).dataIndex = node.dataIndex; - var itemModel = node.getModel(); - var emphasisModel = itemModel.getModel('emphasis'); - var layout = node.getLayout(); - var sectorShape = extend({}, layout); - sectorShape.label = null; - var normalStyle = node.getVisual('style'); - normalStyle.lineJoin = 'bevel'; - var decal = node.getVisual('decal'); - if (decal) { - normalStyle.decal = createOrUpdatePatternFromDecal(decal, api); - } - var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true); - extend(sectorShape, cornerRadius); - each(SPECIAL_STATES, function (stateName) { - var state = sector.ensureState(stateName); - var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']); - state.style = itemStyleModel.getItemStyle(); - // border radius - var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape); - if (cornerRadius) { - state.shape = cornerRadius; - } - }); - if (firstCreate) { - sector.setShape(sectorShape); - sector.shape.r = layout.r0; - initProps(sector, { - shape: { - r: layout.r - } - }, seriesModel, node.dataIndex); - } else { - // Disable animation for gradient since no interpolation method - // is supported for gradient - updateProps(sector, { - shape: sectorShape - }, seriesModel); - saveOldStyle(sector); - } - sector.useStyle(normalStyle); - this._updateLabel(seriesModel); - var cursorStyle = itemModel.getShallow('cursor'); - cursorStyle && sector.attr('cursor', cursorStyle); - this._seriesModel = seriesModel || this._seriesModel; - this._ecModel = ecModel || this._ecModel; - var focus = emphasisModel.get('focus'); - var focusOrIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus; - toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; - SunburstPiece.prototype._updateLabel = function (seriesModel) { - var _this = this; - var itemModel = this.node.getModel(); - var normalLabelModel = itemModel.getModel('label'); - var layout = this.node.getLayout(); - var angle = layout.endAngle - layout.startAngle; - var midAngle = (layout.startAngle + layout.endAngle) / 2; - var dx = Math.cos(midAngle); - var dy = Math.sin(midAngle); - var sector = this; - var label = sector.getTextContent(); - var dataIndex = this.node.dataIndex; - var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI; - var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle); - label.ignore = !isNormalShown; - // TODO use setLabelStyle - each(DISPLAY_STATES, function (stateName) { - var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']); - var isNormal = stateName === 'normal'; - var state = isNormal ? label : label.ensureState(stateName); - var text = seriesModel.getFormattedLabel(dataIndex, stateName); - if (isNormal) { - text = text || _this.node.name; - } - state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true); - if (text) { - state.style.text = text; - } - // Not displaying text when angle is too small - var isShown = labelStateModel.get('show'); - if (isShown != null && !isNormal) { - state.ignore = !isShown; - } - var labelPosition = getLabelAttr(labelStateModel, 'position'); - var sectorState = isNormal ? sector : sector.states[stateName]; - var labelColor = sectorState.style.fill; - sectorState.textConfig = { - outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null, - inside: labelPosition !== 'outside' - }; - var r; - var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0; - var textAlign = getLabelAttr(labelStateModel, 'align'); - var rotateType = getLabelAttr(labelStateModel, 'rotate'); - var flipStartAngle = Math.PI * 0.5; - var flipEndAngle = Math.PI * 1.5; - var midAngleNormal = normalizeRadian(rotateType === 'tangential' ? Math.PI / 2 - midAngle : midAngle); - // For text that is up-side down, rotate 180 degrees to make sure - // it's readable - var needsFlip = midAngleNormal > flipStartAngle && !isRadianAroundZero(midAngleNormal - flipStartAngle) && midAngleNormal < flipEndAngle; - if (labelPosition === 'outside') { - r = layout.r + labelPadding; - textAlign = needsFlip ? 'right' : 'left'; - } else { - if (!textAlign || textAlign === 'center') { - // Put label in the center if it's a circle - if (angle === 2 * Math.PI && layout.r0 === 0) { - r = 0; - } else { - r = (layout.r + layout.r0) / 2; - } - textAlign = 'center'; - } else if (textAlign === 'left') { - r = layout.r0 + labelPadding; - textAlign = needsFlip ? 'right' : 'left'; - } else if (textAlign === 'right') { - r = layout.r - labelPadding; - textAlign = needsFlip ? 'left' : 'right'; - } - } - state.style.align = textAlign; - state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle'; - state.x = r * dx + layout.cx; - state.y = r * dy + layout.cy; - var rotate = 0; - if (rotateType === 'radial') { - rotate = normalizeRadian(-midAngle) + (needsFlip ? Math.PI : 0); - } else if (rotateType === 'tangential') { - rotate = normalizeRadian(Math.PI / 2 - midAngle) + (needsFlip ? Math.PI : 0); - } else if (isNumber(rotateType)) { - rotate = rotateType * Math.PI / 180; - } - state.rotation = normalizeRadian(rotate); - }); - function getLabelAttr(model, name) { - var stateAttr = model.get(name); - if (stateAttr == null) { - return normalLabelModel.get(name); + }); +} + +// src/processor/dataStack.ts +function dataStack(ecModel) { + const stackInfoMap = createHashMap(); + ecModel.eachSeries(function(seriesModel) { + const stack = seriesModel.get("stack"); + if (stack) { + const stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []); + const data = seriesModel.getData(); + const stackInfo = { + stackResultDimension: data.getCalculationInfo("stackResultDimension"), + stackedOverDimension: data.getCalculationInfo("stackedOverDimension"), + stackedDimension: data.getCalculationInfo("stackedDimension"), + stackedByDimension: data.getCalculationInfo("stackedByDimension"), + isStackedByIndex: data.getCalculationInfo("isStackedByIndex"), + data, + seriesModel + }; + if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) { + return; + } + stackInfoList.length && data.setCalculationInfo("stackedOnSeries", stackInfoList[stackInfoList.length - 1].seriesModel); + stackInfoList.push(stackInfo); + } + }); + stackInfoMap.each(calculateStack); +} +function calculateStack(stackInfoList) { + each(stackInfoList, function(targetStackInfo, idxInStack) { + const resultVal = []; + const resultNaN = [NaN, NaN]; + const dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension]; + const targetData = targetStackInfo.data; + const isStackedByIndex = targetStackInfo.isStackedByIndex; + const stackStrategy = targetStackInfo.seriesModel.get("stackStrategy") || "samesign"; + targetData.modify(dims, function(v0, v12, dataIndex) { + let sum2 = targetData.get(targetStackInfo.stackedDimension, dataIndex); + if (isNaN(sum2)) { + return resultNaN; + } + let byValue; + let stackedDataRawIndex; + if (isStackedByIndex) { + stackedDataRawIndex = targetData.getRawIndex(dataIndex); + } else { + byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex); + } + let stackedOver = NaN; + for (let j = idxInStack - 1; j >= 0; j--) { + const stackInfo = stackInfoList[j]; + if (!isStackedByIndex) { + stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue); + } + if (stackedDataRawIndex >= 0) { + const val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); + if (stackStrategy === "all" || stackStrategy === "positive" && val > 0 || stackStrategy === "negative" && val < 0 || stackStrategy === "samesign" && sum2 >= 0 && val > 0 || stackStrategy === "samesign" && sum2 <= 0 && val < 0) { + sum2 = addSafe(sum2, val); + stackedOver = val; + break; } - return stateAttr; } - label.dirtyStyle(); - }; - return SunburstPiece; - }(Sector); - - var ROOT_TO_NODE_ACTION = 'sunburstRootToNode'; - var HIGHLIGHT_ACTION = 'sunburstHighlight'; - var UNHIGHLIGHT_ACTION = 'sunburstUnhighlight'; - function installSunburstAction(registers) { - registers.registerAction({ - type: ROOT_TO_NODE_ACTION, - update: 'updateView' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'sunburst', - query: payload - }, handleRootToNode); - function handleRootToNode(model, index) { - var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model); - if (targetInfo) { - var originViewRoot = model.getViewRoot(); - if (originViewRoot) { - payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; - } - model.resetViewRoot(targetInfo.node); + } + resultVal[0] = sum2; + resultVal[1] = stackedOver; + return resultVal; + }); + }); +} + +// src/data/Source.ts +var SourceImpl = class { + constructor(fields) { + this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []); + this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; + this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN; + this.startIndex = fields.startIndex || 0; + this.dimensionsDetectedCount = fields.dimensionsDetectedCount; + this.metaRawOption = fields.metaRawOption; + const dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine; + if (dimensionsDefine) { + for (let i = 0; i < dimensionsDefine.length; i++) { + const dim = dimensionsDefine[i]; + if (dim.type == null) { + if (guessOrdinal(this, i) === BE_ORDINAL.Must) { + dim.type = "ordinal"; + } + } + } + } + } +}; +function isSourceInstance(val) { + return val instanceof SourceImpl; +} +function createSource(sourceData, thisMetaRawOption, sourceFormat) { + sourceFormat = sourceFormat || detectSourceFormat(sourceData); + const seriesLayoutBy = thisMetaRawOption.seriesLayoutBy; + const determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions); + const source = new SourceImpl({ + data: sourceData, + sourceFormat, + seriesLayoutBy, + dimensionsDefine: determined.dimensionsDefine, + startIndex: determined.startIndex, + dimensionsDetectedCount: determined.dimensionsDetectedCount, + metaRawOption: clone(thisMetaRawOption) + }); + return source; +} +function createSourceFromSeriesDataOption(data) { + return new SourceImpl({ + data, + sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL + }); +} +function cloneSourceShallow(source) { + return new SourceImpl({ + data: source.data, + sourceFormat: source.sourceFormat, + seriesLayoutBy: source.seriesLayoutBy, + dimensionsDefine: clone(source.dimensionsDefine), + startIndex: source.startIndex, + dimensionsDetectedCount: source.dimensionsDetectedCount + }); +} +function detectSourceFormat(data) { + let sourceFormat = SOURCE_FORMAT_UNKNOWN; + if (isTypedArray(data)) { + sourceFormat = SOURCE_FORMAT_TYPED_ARRAY; + } else if (isArray(data)) { + if (data.length === 0) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + } + for (let i = 0, len2 = data.length; i < len2; i++) { + const item = data[i]; + if (item == null) { + continue; + } else if (isArray(item) || isTypedArray(item)) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + break; + } else if (isObject(item)) { + sourceFormat = SOURCE_FORMAT_OBJECT_ROWS; + break; + } + } + } else if (isObject(data)) { + for (const key in data) { + if (hasOwn(data, key) && isArrayLike(data[key])) { + sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS; + break; + } + } + } + return sourceFormat; +} +function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) { + let dimensionsDetectedCount; + let startIndex; + if (!data) { + return { + dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), + startIndex, + dimensionsDetectedCount + }; + } + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + const dataArrayRows = data; + if (sourceHeader === "auto" || sourceHeader == null) { + arrayRowsTravelFirst(function(val) { + if (val != null && val !== "-") { + if (isString(val)) { + startIndex == null && (startIndex = 1); + } else { + startIndex = 0; } } + }, seriesLayoutBy, dataArrayRows, 10); + } else { + startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0; + } + if (!dimensionsDefine && startIndex === 1) { + dimensionsDefine = []; + arrayRowsTravelFirst(function(val, index) { + dimensionsDefine[index] = val != null ? val + "" : ""; + }, seriesLayoutBy, dataArrayRows, Infinity); + } + dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[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); }); - registers.registerAction({ - type: HIGHLIGHT_ACTION, - update: 'none' - }, function (payload, ecModel, api) { - // Clone - payload = extend({}, payload); - ecModel.eachComponent({ - mainType: 'series', - subType: 'sunburst', - query: payload - }, handleHighlight); - function handleHighlight(model) { - var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model); - if (targetInfo) { - payload.dataIndex = targetInfo.node.dataIndex; + } + } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + const value0 = getDataItemValue(data[0]); + dimensionsDetectedCount = isArray(value0) && value0.length || 1; + } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + if (true) { + assert(!!dimensionsDefine, "dimensions must be given if data is TypedArray."); + } + } + return { + startIndex, + dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), + dimensionsDetectedCount + }; +} +function objectRowsCollectDimensions(data) { + let firstIndex = 0; + let obj; + while (firstIndex < data.length && !(obj = data[firstIndex++])) { + } + if (obj) { + return keys(obj); + } +} +function normalizeDimensionsOption(dimensionsDefine) { + if (!dimensionsDefine) { + return; + } + const nameMap = createHashMap(); + return map(dimensionsDefine, function(rawItem, index) { + rawItem = isObject(rawItem) ? rawItem : {name: rawItem}; + const item = { + name: rawItem.name, + displayName: rawItem.displayName, + type: rawItem.type + }; + if (item.name == null) { + return item; + } + item.name += ""; + if (item.displayName == null) { + item.displayName = item.name; + } + const 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) { + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + for (let i = 0; i < data.length && i < maxLoop; i++) { + cb(data[i] ? data[i][0] : null, i); + } + } else { + const value0 = data[0] || []; + for (let i = 0; i < value0.length && i < maxLoop; i++) { + cb(value0[i], i); + } + } +} +function shouldRetrieveDataByName(source) { + const sourceFormat = source.sourceFormat; + return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS; +} + +// src/data/helper/dataProvider.ts +var providerMethods; +var mountMethods; +var DefaultDataProvider2 = class { + constructor(sourceParam, dimSize) { + const source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; + this._source = source; + const data = this._data = source.data; + if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + if (true) { + if (dimSize == null) { + throw new Error("Typed array data must specify dimension size"); + } + } + this._offset = 0; + this._dimSize = dimSize; + this._data = data; + } + mountMethods(this, data, source); + } + getSource() { + return this._source; + } + count() { + return 0; + } + getItem(idx, out2) { + return; + } + appendData(newData) { + } + clean() { + } +}; +var DefaultDataProvider = DefaultDataProvider2; +DefaultDataProvider.protoInitialize = function() { + const proto2 = DefaultDataProvider2.prototype; + proto2.pure = false; + proto2.persistent = true; +}(); +DefaultDataProvider.internalField = function() { + mountMethods = function(provider, data, source) { + const sourceFormat = source.sourceFormat; + const seriesLayoutBy = source.seriesLayoutBy; + const startIndex = source.startIndex; + const dimsDef = source.dimensionsDefine; + const methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)]; + if (true) { + assert(methods, "Invalide sourceFormat: " + sourceFormat); + } + extend(provider, methods); + if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + provider.getItem = getItemForTypedArray; + provider.count = countForTypedArray; + provider.fillStorage = fillStorageForTypedArray; + } else { + const rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy); + provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef); + const rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy); + provider.count = bind(rawCounter, null, data, startIndex, dimsDef); + } + }; + const getItemForTypedArray = function(idx, out2) { + idx = idx - this._offset; + out2 = out2 || []; + const data = this._data; + const dimSize = this._dimSize; + const offset = dimSize * idx; + for (let i = 0; i < dimSize; i++) { + out2[i] = data[offset + i]; + } + return out2; + }; + const fillStorageForTypedArray = function(start2, end2, storage2, extent3) { + const data = this._data; + const dimSize = this._dimSize; + for (let dim = 0; dim < dimSize; dim++) { + const dimExtent = extent3[dim]; + let min3 = dimExtent[0] == null ? Infinity : dimExtent[0]; + let max3 = dimExtent[1] == null ? -Infinity : dimExtent[1]; + const count2 = end2 - start2; + const arr = storage2[dim]; + for (let i = 0; i < count2; i++) { + const val = data[i * dimSize + dim]; + arr[start2 + i] = val; + val < min3 && (min3 = val); + val > max3 && (max3 = val); + } + dimExtent[0] = min3; + dimExtent[1] = max3; + } + }; + const countForTypedArray = function() { + return this._data ? this._data.length / this._dimSize : 0; + }; + providerMethods = { + [SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_COLUMN]: { + pure: true, + appendData: appendDataSimply + }, + [SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_ROW]: { + pure: true, + appendData: function() { + throw new Error('Do not support appendData when set seriesLayoutBy: "row".'); + } + }, + [SOURCE_FORMAT_OBJECT_ROWS]: { + pure: true, + appendData: appendDataSimply + }, + [SOURCE_FORMAT_KEYED_COLUMNS]: { + pure: true, + appendData: function(newData) { + const data = this._data; + each(newData, function(newCol, key) { + const oldCol = data[key] || (data[key] = []); + for (let i = 0; i < (newCol || []).length; i++) { + oldCol.push(newCol[i]); } + }); + } + }, + [SOURCE_FORMAT_ORIGINAL]: { + appendData: appendDataSimply + }, + [SOURCE_FORMAT_TYPED_ARRAY]: { + persistent: false, + pure: true, + appendData: function(newData) { + if (true) { + assert(isTypedArray(newData), "Added data must be TypedArray if data in initialization is TypedArray"); + } + this._data = newData; + }, + clean: function() { + this._offset += this.count(); + this._data = null; + } + } + }; + function appendDataSimply(newData) { + for (let i = 0; i < newData.length; i++) { + this._data.push(newData[i]); + } + } +}(); +var getItemSimply = function(rawData, startIndex, dimsDef, idx) { + return rawData[idx]; +}; +var rawSourceItemGetterMap = { + [SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_COLUMN]: function(rawData, startIndex, dimsDef, idx) { + return rawData[idx + startIndex]; + }, + [SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_ROW]: function(rawData, startIndex, dimsDef, idx, out2) { + idx += startIndex; + const item = out2 || []; + const data = rawData; + for (let i = 0; i < data.length; i++) { + const row = data[i]; + item[i] = row ? row[idx] : null; + } + return item; + }, + [SOURCE_FORMAT_OBJECT_ROWS]: getItemSimply, + [SOURCE_FORMAT_KEYED_COLUMNS]: function(rawData, startIndex, dimsDef, idx, out2) { + const item = out2 || []; + for (let i = 0; i < dimsDef.length; i++) { + const dimName = dimsDef[i].name; + if (true) { + if (dimName == null) { + throw new Error(); } - if ("development" !== 'production') { - deprecateReplaceLog('sunburstHighlight', 'highlight'); - } - // Fast forward action - api.dispatchAction(extend(payload, { - type: 'highlight' - })); - }); - registers.registerAction({ - type: UNHIGHLIGHT_ACTION, - update: 'updateView' - }, function (payload, ecModel, api) { - payload = extend({}, payload); - if ("development" !== 'production') { - deprecateReplaceLog('sunburstUnhighlight', 'downplay'); - } - api.dispatchAction(extend(payload, { - type: 'downplay' - })); + } + const col = rawData[dimName]; + item[i] = col ? col[idx] : null; + } + return item; + }, + [SOURCE_FORMAT_ORIGINAL]: getItemSimply +}; +function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) { + const method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; + if (true) { + assert(method, 'Do not support get item on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); + } + return method; +} +var countSimply = function(rawData, startIndex, dimsDef) { + return rawData.length; +}; +var rawSourceDataCounterMap = { + [SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_COLUMN]: function(rawData, startIndex, dimsDef) { + return Math.max(0, rawData.length - startIndex); + }, + [SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_ROW]: function(rawData, startIndex, dimsDef) { + const row = rawData[0]; + return row ? Math.max(0, row.length - startIndex) : 0; + }, + [SOURCE_FORMAT_OBJECT_ROWS]: countSimply, + [SOURCE_FORMAT_KEYED_COLUMNS]: function(rawData, startIndex, dimsDef) { + const dimName = dimsDef[0].name; + if (true) { + if (dimName == null) { + throw new Error(); + } + } + const col = rawData[dimName]; + return col ? col.length : 0; + }, + [SOURCE_FORMAT_ORIGINAL]: countSimply +}; +function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) { + const method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; + if (true) { + assert(method, 'Do not support count on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); + } + return method; +} +var getRawValueSimply = function(dataItem, dimIndex, property) { + return dataItem[dimIndex]; +}; +var rawSourceValueGetterMap = { + [SOURCE_FORMAT_ARRAY_ROWS]: getRawValueSimply, + [SOURCE_FORMAT_OBJECT_ROWS]: function(dataItem, dimIndex, property) { + return dataItem[property]; + }, + [SOURCE_FORMAT_KEYED_COLUMNS]: getRawValueSimply, + [SOURCE_FORMAT_ORIGINAL]: function(dataItem, dimIndex, property) { + const value = getDataItemValue(dataItem); + return !(value instanceof Array) ? value : value[dimIndex]; + }, + [SOURCE_FORMAT_TYPED_ARRAY]: getRawValueSimply +}; +function getRawSourceValueGetter(sourceFormat) { + const method = rawSourceValueGetterMap[sourceFormat]; + if (true) { + assert(method, 'Do not support get value on "' + sourceFormat + '".'); + } + return method; +} +function getMethodMapKey(sourceFormat, seriesLayoutBy) { + return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + "_" + seriesLayoutBy : sourceFormat; +} +function retrieveRawValue(data, dataIndex, dim) { + if (!data) { + return; + } + const dataItem = data.getRawDataItem(dataIndex); + if (dataItem == null) { + return; + } + const store = data.getStore(); + const sourceFormat = store.getSource().sourceFormat; + if (dim != null) { + const dimIndex = data.getDimensionIndex(dim); + const property = store.getDimensionProperty(dimIndex); + return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property); + } else { + let result = dataItem; + if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + result = getDataItemValue(dataItem); + } + return result; + } +} + +// src/model/mixin/dataFormat.ts +var DIMENSION_LABEL_REG = /\{@(.+?)\}/g; +var DataFormatMixin = class { + getDataParams(dataIndex, dataType) { + const data = this.getData(dataType); + const rawValue = this.getRawValue(dataIndex, dataType); + const rawDataIndex = data.getRawIndex(dataIndex); + const name = data.getName(dataIndex); + const itemOpt = data.getRawDataItem(dataIndex); + const style = data.getItemVisual(dataIndex, "style"); + const color2 = style && style[data.getItemVisual(dataIndex, "drawType") || "fill"]; + const borderColor = style && style.stroke; + const mainType = this.mainType; + const isSeries2 = mainType === "series"; + const userOutput = data.userOutput && data.userOutput.get(); + return { + componentType: mainType, + componentSubType: this.subType, + componentIndex: this.componentIndex, + seriesType: isSeries2 ? this.subType : null, + seriesIndex: this.seriesIndex, + seriesId: isSeries2 ? this.id : null, + seriesName: isSeries2 ? this.name : null, + name, + dataIndex: rawDataIndex, + data: itemOpt, + dataType, + value: rawValue, + color: color2, + borderColor, + dimensionNames: userOutput ? userOutput.fullDimensions : null, + encode: userOutput ? userOutput.encode : null, + $vars: ["seriesName", "name", "value"] + }; + } + getFormattedLabel(dataIndex, status, dataType, labelDimIndex, formatter, extendParams) { + status = status || "normal"; + const data = this.getData(dataType); + const params = this.getDataParams(dataIndex, dataType); + if (extendParams) { + params.value = extendParams.interpolatedValue; + } + if (labelDimIndex != null && isArray(params.value)) { + params.value = params.value[labelDimIndex]; + } + if (!formatter) { + const itemModel = data.getItemModel(dataIndex); + formatter = itemModel.get(status === "normal" ? ["label", "formatter"] : [status, "label", "formatter"]); + } + if (isFunction(formatter)) { + params.status = status; + params.dimensionIndex = labelDimIndex; + return formatter(params); + } else if (isString(formatter)) { + const str = formatTpl(formatter, params); + return str.replace(DIMENSION_LABEL_REG, function(origin, dimStr) { + const len2 = dimStr.length; + let dimLoose = dimStr; + if (dimLoose.charAt(0) === "[" && dimLoose.charAt(len2 - 1) === "]") { + dimLoose = +dimLoose.slice(1, len2 - 1); + if (true) { + if (isNaN(dimLoose)) { + error(`Invalide label formatter: @${dimStr}, only support @[0], @[1], @[2], ...`); + } + } + } + let val = retrieveRawValue(data, dataIndex, dimLoose); + if (extendParams && isArray(extendParams.interpolatedValue)) { + const dimIndex = data.getDimensionIndex(dimLoose); + if (dimIndex >= 0) { + val = extendParams.interpolatedValue[dimIndex]; + } + } + return val != null ? val + "" : ""; }); } - - var SunburstView = /** @class */function (_super) { - __extends(SunburstView, _super); - function SunburstView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SunburstView.type; - return _this; - } - SunburstView.prototype.render = function (seriesModel, ecModel, api, - // @ts-ignore - payload) { - var self = this; - this.seriesModel = seriesModel; - this.api = api; - this.ecModel = ecModel; - var data = seriesModel.getData(); - var virtualRoot = data.tree.root; - var newRoot = seriesModel.getViewRoot(); - var group = this.group; - var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData'); - var newChildren = []; - newRoot.eachNode(function (node) { - newChildren.push(node); - }); - var oldChildren = this._oldChildren || []; - dualTravel(newChildren, oldChildren); - renderRollUp(virtualRoot, newRoot); - this._initEvents(); - this._oldChildren = newChildren; - function dualTravel(newChildren, oldChildren) { - if (newChildren.length === 0 && oldChildren.length === 0) { - return; - } - new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); - function getKey(node) { - return node.getId(); - } - function processNode(newIdx, oldIdx) { - var newNode = newIdx == null ? null : newChildren[newIdx]; - var oldNode = oldIdx == null ? null : oldChildren[oldIdx]; - doRenderNode(newNode, oldNode); - } - } - function doRenderNode(newNode, oldNode) { - if (!renderLabelForZeroData && newNode && !newNode.getValue()) { - // Not render data with value 0 - newNode = null; - } - if (newNode !== virtualRoot && oldNode !== virtualRoot) { - if (oldNode && oldNode.piece) { - if (newNode) { - // Update - oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api); - // For tooltip - data.setItemGraphicEl(newNode.dataIndex, oldNode.piece); - } else { - // Remove - removeNode(oldNode); - } - } else if (newNode) { - // Add - var piece = new SunburstPiece(newNode, seriesModel, ecModel, api); - group.add(piece); - // For tooltip - data.setItemGraphicEl(newNode.dataIndex, piece); - } - } - } - function removeNode(node) { - if (!node) { - return; - } - if (node.piece) { - group.remove(node.piece); - node.piece = null; - } - } - function renderRollUp(virtualRoot, viewRoot) { - if (viewRoot.depth > 0) { - // Render - if (self.virtualPiece) { - // Update - self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api); - } else { - // Add - self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api); - group.add(self.virtualPiece); - } - // TODO event scope - viewRoot.piece.off('click'); - self.virtualPiece.on('click', function (e) { - self._rootToNode(viewRoot.parentNode); - }); - } else if (self.virtualPiece) { - // Remove - group.remove(self.virtualPiece); - self.virtualPiece = null; + } + getRawValue(idx, dataType) { + return retrieveRawValue(this.getData(dataType), idx); + } + formatTooltip(dataIndex, multipleSeries, dataType) { + return; + } +}; +function normalizeTooltipFormatResult(result) { + let markupText; + let markupFragment; + if (isObject(result)) { + if (result.type) { + markupFragment = result; + } else { + if (true) { + console.warn("The return type of `formatTooltip` is not supported: " + makePrintable(result)); + } + } + } else { + markupText = result; + } + return { + text: markupText, + frag: markupFragment + }; +} + +// src/core/task.ts +function createTask(define) { + return new Task(define); +} +var Task = class { + constructor(define) { + define = define || {}; + this._reset = define.reset; + this._plan = define.plan; + this._count = define.count; + this._onDirty = define.onDirty; + this._dirty = true; + } + perform(performArgs) { + const upTask = this._upstream; + const skip = performArgs && performArgs.skip; + if (this._dirty && upTask) { + const context = this.context; + context.data = context.outputData = upTask.context.outputData; + } + if (this.__pipeline) { + this.__pipeline.currentTask = this; + } + let planResult; + if (this._plan && !skip) { + planResult = this._plan(this.context); + } + const lastModBy = normalizeModBy(this._modBy); + const lastModDataCount = this._modDataCount || 0; + const modBy = normalizeModBy(performArgs && performArgs.modBy); + const modDataCount = performArgs && performArgs.modDataCount || 0; + if (lastModBy !== modBy || lastModDataCount !== modDataCount) { + planResult = "reset"; + } + function normalizeModBy(val) { + !(val >= 1) && (val = 1); + return val; + } + let forceFirstProgress; + if (this._dirty || planResult === "reset") { + this._dirty = false; + forceFirstProgress = this._doReset(skip); + } + this._modBy = modBy; + this._modDataCount = modDataCount; + const step = performArgs && performArgs.step; + if (upTask) { + if (true) { + assert(upTask._outputDueEnd != null); + } + this._dueEnd = upTask._outputDueEnd; + } else { + if (true) { + assert(!this._progress || this._count); + } + this._dueEnd = this._count ? this._count(this.context) : Infinity; + } + if (this._progress) { + const start2 = this._dueIndex; + const end2 = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd); + if (!skip && (forceFirstProgress || start2 < end2)) { + const progress = this._progress; + if (isArray(progress)) { + for (let i = 0; i < progress.length; i++) { + this._doProgress(progress[i], start2, end2, modBy, modDataCount); } + } else { + this._doProgress(progress, start2, end2, modBy, modDataCount); + } + } + this._dueIndex = end2; + const outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end2; + if (true) { + assert(outputDueEnd >= this._outputDueEnd); + } + this._outputDueEnd = outputDueEnd; + } else { + this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd; + } + return this.unfinished(); + } + dirty() { + this._dirty = true; + this._onDirty && this._onDirty(this.context); + } + _doProgress(progress, start2, end2, modBy, modDataCount) { + iterator.reset(start2, end2, modBy, modDataCount); + this._callingProgress = progress; + this._callingProgress({ + start: start2, + end: end2, + count: end2 - start2, + next: iterator.next + }, this.context); + } + _doReset(skip) { + this._dueIndex = this._outputDueEnd = this._dueEnd = 0; + this._settedOutputEnd = null; + let progress; + let forceFirstProgress; + if (!skip && this._reset) { + progress = this._reset(this.context); + if (progress && progress.progress) { + forceFirstProgress = progress.forceFirstProgress; + progress = progress.progress; + } + if (isArray(progress) && !progress.length) { + progress = null; + } + } + this._progress = progress; + this._modBy = this._modDataCount = null; + const downstream = this._downstream; + downstream && downstream.dirty(); + return forceFirstProgress; + } + unfinished() { + return this._progress && this._dueIndex < this._dueEnd; + } + pipe(downTask) { + if (true) { + assert(downTask && !downTask._disposed && downTask !== this); + } + if (this._downstream !== downTask || this._dirty) { + this._downstream = downTask; + downTask._upstream = this; + downTask.dirty(); + } + } + dispose() { + if (this._disposed) { + return; + } + this._upstream && (this._upstream._downstream = null); + this._downstream && (this._downstream._upstream = null); + this._dirty = false; + this._disposed = true; + } + getUpstream() { + return this._upstream; + } + getDownstream() { + return this._downstream; + } + setOutputEnd(end2) { + this._outputDueEnd = this._settedOutputEnd = end2; + } +}; +var iterator = function() { + let end2; + let current; + let modBy; + let modDataCount; + let winCount; + const it = { + reset: function(s, e2, sStep, sCount) { + current = s; + end2 = e2; + modBy = sStep; + modDataCount = sCount; + winCount = Math.ceil(modDataCount / modBy); + it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext; + } + }; + return it; + function sequentialNext() { + return current < end2 ? current++ : null; + } + function modNext() { + const dataIndex = current % winCount * modBy + Math.ceil(current / winCount); + const result = current >= end2 ? null : dataIndex < modDataCount ? dataIndex : current; + current++; + return result; + } +}(); + +// src/data/helper/dataValueHelper.ts +function parseDataValue(value, opt) { + const dimType = opt && opt.type; + if (dimType === "ordinal") { + return value; + } + if (dimType === "time" && !isNumber(value) && value != null && value !== "-") { + value = +parseDate(value); + } + return value == null || value === "" ? NaN : Number(value); +} +var valueParserMap = createHashMap({ + number: function(val) { + return parseFloat(val); + }, + time: function(val) { + return +parseDate(val); + }, + trim: function(val) { + return isString(val) ? trim(val) : val; + } +}); +function getRawValueParser(type) { + return valueParserMap.get(type); +} +var ORDER_COMPARISON_OP_MAP = { + lt: (lval, rval) => lval < rval, + lte: (lval, rval) => lval <= rval, + gt: (lval, rval) => lval > rval, + gte: (lval, rval) => lval >= rval +}; +var FilterOrderComparator = class { + constructor(op, rval) { + if (!isNumber(rval)) { + let errMsg = ""; + if (true) { + errMsg = 'rvalue of "<", ">", "<=", ">=" can only be number in filter.'; + } + throwError(errMsg); + } + this._opFn = ORDER_COMPARISON_OP_MAP[op]; + this._rvalFloat = numericToNumber(rval); + } + evaluate(lval) { + return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat); + } +}; +var SortOrderComparator = class { + constructor(order, incomparable) { + const isDesc = order === "desc"; + this._resultLT = isDesc ? 1 : -1; + if (incomparable == null) { + incomparable = isDesc ? "min" : "max"; + } + this._incomparable = incomparable === "min" ? -Infinity : Infinity; + } + evaluate(lval, rval) { + let lvalFloat = isNumber(lval) ? lval : numericToNumber(lval); + let rvalFloat = isNumber(rval) ? rval : numericToNumber(rval); + const lvalNotNumeric = isNaN(lvalFloat); + const rvalNotNumeric = isNaN(rvalFloat); + if (lvalNotNumeric) { + lvalFloat = this._incomparable; + } + if (rvalNotNumeric) { + rvalFloat = this._incomparable; + } + if (lvalNotNumeric && rvalNotNumeric) { + const lvalIsStr = isString(lval); + const rvalIsStr = isString(rval); + if (lvalIsStr) { + lvalFloat = rvalIsStr ? lval : 0; + } + if (rvalIsStr) { + rvalFloat = lvalIsStr ? rval : 0; + } + } + return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0; + } +}; +var FilterEqualityComparator = class { + constructor(isEq, rval) { + this._rval = rval; + this._isEQ = isEq; + this._rvalTypeof = typeof rval; + this._rvalFloat = numericToNumber(rval); + } + evaluate(lval) { + let eqResult = lval === this._rval; + if (!eqResult) { + const lvalTypeof = typeof lval; + if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === "number" || this._rvalTypeof === "number")) { + eqResult = numericToNumber(lval) === this._rvalFloat; + } + } + return this._isEQ ? eqResult : !eqResult; + } +}; +function createFilterComparator(op, rval) { + return op === "eq" || op === "ne" ? new FilterEqualityComparator(op === "eq", rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null; +} + +// src/data/helper/transform.ts +var ExternalSource = class { + getRawData() { + throw new Error("not supported"); + } + getRawDataItem(dataIndex) { + throw new Error("not supported"); + } + cloneRawData() { + return; + } + getDimensionInfo(dim) { + return; + } + cloneAllDimensionInfo() { + return; + } + count() { + return; + } + retrieveValue(dataIndex, dimIndex) { + return; + } + retrieveValueFromItem(dataItem, dimIndex) { + return; + } + convertValue(rawVal, dimInfo) { + return parseDataValue(rawVal, dimInfo); + } +}; +function createExternalSource(internalSource, externalTransform) { + const extSource = new ExternalSource(); + const data = internalSource.data; + const sourceFormat = extSource.sourceFormat = internalSource.sourceFormat; + const sourceHeaderCount = internalSource.startIndex; + let errMsg = ""; + if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) { + if (true) { + errMsg = '`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'; + } + throwError(errMsg); + } + const dimensions = []; + const dimsByName = {}; + const dimsDef = internalSource.dimensionsDefine; + if (dimsDef) { + each(dimsDef, function(dimDef, idx) { + const name = dimDef.name; + const dimDefExt = { + index: idx, + name, + displayName: dimDef.displayName + }; + dimensions.push(dimDefExt); + if (name != null) { + let errMsg2 = ""; + if (hasOwn(dimsByName, name)) { + if (true) { + errMsg2 = 'dimension name "' + name + '" duplicated.'; + } + throwError(errMsg2); + } + dimsByName[name] = dimDefExt; + } + }); + } else { + for (let i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) { + dimensions.push({index: i}); + } + } + const rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); + if (externalTransform.__isBuiltIn) { + extSource.getRawDataItem = function(dataIndex) { + return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); + }; + extSource.getRawData = bind(getRawData, null, internalSource); + } + extSource.cloneRawData = bind(cloneRawData, null, internalSource); + const rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); + extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions); + const rawValueGetter = getRawSourceValueGetter(sourceFormat); + extSource.retrieveValue = function(dataIndex, dimIndex) { + const rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); + return retrieveValueFromItem(rawItem, dimIndex); + }; + const retrieveValueFromItem = extSource.retrieveValueFromItem = function(dataItem, dimIndex) { + if (dataItem == null) { + return; + } + const dimDef = dimensions[dimIndex]; + if (dimDef) { + return rawValueGetter(dataItem, dimIndex, dimDef.name); + } + }; + extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName); + extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions); + return extSource; +} +function getRawData(upstream) { + const sourceFormat = upstream.sourceFormat; + if (!isSupportedSourceFormat(sourceFormat)) { + let errMsg = ""; + if (true) { + errMsg = "`getRawData` is not supported in source format " + sourceFormat; + } + throwError(errMsg); + } + return upstream.data; +} +function cloneRawData(upstream) { + const sourceFormat = upstream.sourceFormat; + const data = upstream.data; + if (!isSupportedSourceFormat(sourceFormat)) { + let errMsg = ""; + if (true) { + errMsg = "`cloneRawData` is not supported in source format " + sourceFormat; + } + throwError(errMsg); + } + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + const result = []; + for (let i = 0, len2 = data.length; i < len2; i++) { + result.push(data[i].slice()); + } + return result; + } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + const result = []; + for (let i = 0, len2 = data.length; i < len2; i++) { + result.push(extend({}, data[i])); + } + return result; + } +} +function getDimensionInfo(dimensions, dimsByName, dim) { + if (dim == null) { + return; + } + if (isNumber(dim) || !isNaN(dim) && !hasOwn(dimsByName, dim)) { + return dimensions[dim]; + } else if (hasOwn(dimsByName, dim)) { + return dimsByName[dim]; + } +} +function cloneAllDimensionInfo(dimensions) { + return clone(dimensions); +} +var externalTransformMap = createHashMap(); +function registerExternalTransform(externalTransform) { + externalTransform = clone(externalTransform); + let type = externalTransform.type; + let errMsg = ""; + if (!type) { + if (true) { + errMsg = "Must have a `type` when `registerTransform`."; + } + throwError(errMsg); + } + const typeParsed = type.split(":"); + if (typeParsed.length !== 2) { + if (true) { + errMsg = 'Name must include namespace like "ns:regression".'; + } + throwError(errMsg); + } + let isBuiltIn = false; + if (typeParsed[0] === "echarts") { + type = typeParsed[1]; + isBuiltIn = true; + } + externalTransform.__isBuiltIn = isBuiltIn; + externalTransformMap.set(type, externalTransform); +} +function applyDataTransform(rawTransOption, sourceList, infoForPrint) { + const pipedTransOption = normalizeToArray(rawTransOption); + const pipeLen = pipedTransOption.length; + let errMsg = ""; + if (!pipeLen) { + if (true) { + errMsg = "If `transform` declared, it should at least contain one transform."; + } + throwError(errMsg); + } + for (let i = 0, len2 = pipeLen; i < len2; i++) { + const transOption = pipedTransOption[i]; + sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); + if (i !== len2 - 1) { + sourceList.length = Math.max(sourceList.length, 1); + } + } + return sourceList; +} +function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) { + let errMsg = ""; + if (!upSourceList.length) { + if (true) { + errMsg = "Must have at least one upstream dataset."; + } + throwError(errMsg); + } + if (!isObject(transOption)) { + if (true) { + errMsg = "transform declaration must be an object rather than " + typeof transOption + "."; + } + throwError(errMsg); + } + const transType = transOption.type; + const externalTransform = externalTransformMap.get(transType); + if (!externalTransform) { + if (true) { + errMsg = 'Can not find transform on type "' + transType + '".'; + } + throwError(errMsg); + } + const extUpSourceList = map(upSourceList, (upSource) => createExternalSource(upSource, externalTransform)); + const resultList = normalizeToArray(externalTransform.transform({ + upstream: extUpSourceList[0], + upstreamList: extUpSourceList, + config: clone(transOption.config) + })); + if (true) { + if (transOption.print) { + const printStrArr = map(resultList, (extSource) => { + const pipeIndexStr = pipeIndex != null ? " === pipe index: " + pipeIndex : ""; + return [ + "=== dataset index: " + infoForPrint.datasetIndex + pipeIndexStr + " ===", + "- transform result data:", + makePrintable(extSource.data), + "- transform result dimensions:", + makePrintable(extSource.dimensions) + ].join("\n"); + }).join("\n"); + log(printStrArr); + } + } + return map(resultList, function(result, resultIndex) { + let errMsg2 = ""; + if (!isObject(result)) { + if (true) { + errMsg2 = "A transform should not return some empty results."; + } + throwError(errMsg2); + } + if (!result.data) { + if (true) { + errMsg2 = "Transform result data should be not be null or undefined"; + } + throwError(errMsg2); + } + const sourceFormat = detectSourceFormat(result.data); + if (!isSupportedSourceFormat(sourceFormat)) { + if (true) { + errMsg2 = "Transform result data should be array rows or object rows."; + } + throwError(errMsg2); + } + let resultMetaRawOption; + const firstUpSource = upSourceList[0]; + if (firstUpSource && resultIndex === 0 && !result.dimensions) { + const startIndex = firstUpSource.startIndex; + if (startIndex) { + result.data = firstUpSource.data.slice(0, startIndex).concat(result.data); + } + resultMetaRawOption = { + seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, + sourceHeader: startIndex, + dimensions: firstUpSource.metaRawOption.dimensions + }; + } else { + resultMetaRawOption = { + seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, + sourceHeader: 0, + dimensions: result.dimensions + }; + } + return createSource(result.data, resultMetaRawOption, null); + }); +} +function isSupportedSourceFormat(sourceFormat) { + return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS; +} + +// src/data/DataStore.ts +var UNDEFINED = "undefined"; +var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array; +var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array; +var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array; +var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array; +var dataCtors = { + float: CtorFloat64Array, + int: CtorInt32Array, + ordinal: Array, + number: Array, + time: CtorFloat64Array +}; +var defaultDimValueGetters; +function getIndicesCtor(rawCount) { + return rawCount > 65535 ? CtorUint32Array : CtorUint16Array; +} +function getInitialExtent() { + return [Infinity, -Infinity]; +} +function cloneChunk(originalChunk) { + const Ctor = originalChunk.constructor; + return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk); +} +function prepareStore(store, dimIdx, dimType, end2, append) { + const DataCtor = dataCtors[dimType || "float"]; + if (append) { + const oldStore = store[dimIdx]; + const oldLen = oldStore && oldStore.length; + if (!(oldLen === end2)) { + const newStore = new DataCtor(end2); + for (let j = 0; j < oldLen; j++) { + newStore[j] = oldStore[j]; + } + store[dimIdx] = newStore; + } + } else { + store[dimIdx] = new DataCtor(end2); + } +} +var DataStore2 = class { + constructor() { + this._chunks = []; + this._rawExtent = []; + this._extent = []; + this._count = 0; + this._rawCount = 0; + this._calcDimNameToIdx = createHashMap(); + } + initData(provider, inputDimensions, dimValueGetter) { + if (true) { + assert(isFunction(provider.getItem) && isFunction(provider.count), "Invalid data provider."); + } + this._provider = provider; + this._chunks = []; + this._indices = null; + this.getRawIndex = this._getRawIdxIdentity; + const source = provider.getSource(); + const defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat]; + this._dimValueGetter = dimValueGetter || defaultGetter; + this._rawExtent = []; + const willRetrieveDataByName = shouldRetrieveDataByName(source); + this._dimensions = map(inputDimensions, (dim) => { + if (true) { + if (willRetrieveDataByName) { + assert(dim.property != null); } + } + return { + type: dim.type, + property: dim.property }; - /** - * @private - */ - SunburstView.prototype._initEvents = function () { - var _this = this; - this.group.off('click'); - this.group.on('click', function (e) { - var targetFound = false; - var viewRoot = _this.seriesModel.getViewRoot(); - viewRoot.eachNode(function (node) { - if (!targetFound && node.piece && node.piece === e.target) { - var nodeClick = node.getModel().get('nodeClick'); - if (nodeClick === 'rootToNode') { - _this._rootToNode(node); - } else if (nodeClick === 'link') { - var itemModel = node.getModel(); - var link = itemModel.get('link'); - if (link) { - var linkTarget = itemModel.get('target', true) || '_blank'; - windowOpen(link, linkTarget); - } - } - targetFound = true; - } - }); - }); - }; - /** - * @private - */ - SunburstView.prototype._rootToNode = function (node) { - if (node !== this.seriesModel.getViewRoot()) { - this.api.dispatchAction({ - type: ROOT_TO_NODE_ACTION, - from: this.uid, - seriesId: this.seriesModel.id, - targetNode: node - }); - } - }; - /** - * @implement - */ - SunburstView.prototype.containPoint = function (point, seriesModel) { - var treeRoot = seriesModel.getData(); - var itemLayout = treeRoot.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; - } - }; - SunburstView.type = 'sunburst'; - return SunburstView; - }(ChartView); - - var SunburstSeriesModel = /** @class */function (_super) { - __extends(SunburstSeriesModel, _super); - function SunburstSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SunburstSeriesModel.type; - _this.ignoreStyleOnData = true; - return _this; - } - SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) { - // Create a virtual root. - var root = { - name: option.name, - children: option.data - }; - completeTreeValue$1(root); - var levelModels = this._levelModels = map(option.levels || [], function (levelDefine) { - return new Model(levelDefine, this, ecModel); - }, this); - // Make sure always a new tree is created when setOption, - // in TreemapView, we check whether oldTree === newTree - // to choose mappings approach among old shapes and new shapes. - var tree = Tree.createTree(root, this, beforeLink); - function beforeLink(nodeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var node = tree.getNodeByDataIndex(idx); - var levelModel = levelModels[node.depth]; - levelModel && (model.parentModel = levelModel); - return model; - }); - } - return tree.data; - }; - SunburstSeriesModel.prototype.optionUpdated = function () { - this.resetViewRoot(); - }; - /* - * @override - */ - SunburstSeriesModel.prototype.getDataParams = function (dataIndex) { - var params = _super.prototype.getDataParams.apply(this, arguments); - var node = this.getData().tree.getNodeByDataIndex(dataIndex); - params.treePathInfo = wrapTreePathInfo(node, this); - return params; - }; - SunburstSeriesModel.prototype.getLevelModel = function (node) { - return this._levelModels && this._levelModels[node.depth]; - }; - SunburstSeriesModel.prototype.getViewRoot = function () { - return this._viewRoot; - }; - SunburstSeriesModel.prototype.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; - } - }; - SunburstSeriesModel.prototype.enableAriaDecal = function () { - enableAriaDecalForTree(this); - }; - SunburstSeriesModel.type = 'series.sunburst'; - SunburstSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - // 默认全局居中 - center: ['50%', '50%'], - radius: [0, '75%'], - // 默认顺时针 - clockwise: true, - startAngle: 90, - // 最小角度改为0 - minAngle: 0, - // If still show when all data zero. - stillShowZeroSum: true, - // '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 outer - // 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 - }, - emphasis: { - focus: 'descendant' - }, - blur: { - itemStyle: { - opacity: 0.2 - }, - label: { - opacity: 0.1 - } - }, - // Animation type can be expansion, scale. - animationType: 'expansion', - animationDuration: 1000, - animationDurationUpdate: 500, - data: [], - /** - * 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' - }; - return SunburstSeriesModel; - }(SeriesModel); - function completeTreeValue$1(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; - each(dataNode.children, function (child) { - completeTreeValue$1(child); - var childValue = child.value; - // TODO First value of array must be a number - isArray(childValue) && (childValue = childValue[0]); - sum += childValue; - }); - var thisValue = dataNode.value; - if (isArray(thisValue)) { - thisValue = thisValue[0]; - } - if (thisValue == null || isNaN(thisValue)) { - thisValue = sum; - } - // Value should not less than 0. - if (thisValue < 0) { - thisValue = 0; - } - isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; - } - - // let PI2 = Math.PI * 2; - var RADIAN$2 = Math.PI / 180; - function sunburstLayout(seriesType, ecModel, api) { - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - var center = seriesModel.get('center'); - var radius = seriesModel.get('radius'); - if (!isArray(radius)) { - radius = [0, radius]; - } - if (!isArray(center)) { - center = [center, center]; - } - var width = api.getWidth(); - var height = api.getHeight(); - var size = Math.min(width, height); - var cx = parsePercent$1(center[0], width); - var cy = parsePercent$1(center[1], height); - var r0 = parsePercent$1(radius[0], size / 2); - var r = parsePercent$1(radius[1], size / 2); - var startAngle = -seriesModel.get('startAngle') * RADIAN$2; - var minAngle = seriesModel.get('minAngle') * RADIAN$2; - var virtualRoot = seriesModel.getData().tree.root; - var treeRoot = seriesModel.getViewRoot(); - var rootDepth = treeRoot.depth; - var sort = seriesModel.get('sort'); - if (sort != null) { - initChildren$1(treeRoot, sort); - } - var validDataCount = 0; - 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 - // let restAngle = PI2; - // let valueSumLargerThanMinAngle = 0; - var dir = clockwise ? 1 : -1; - /** - * Render a tree - * @return increased angle - */ - var renderNode = function (node, startAngle) { - if (!node) { - return; + }); + this._initDataFromProvider(0, provider.count()); + } + getProvider() { + return this._provider; + } + getSource() { + return this._provider.getSource(); + } + ensureCalculationDimension(dimName, type) { + const calcDimNameToIdx = this._calcDimNameToIdx; + const dimensions = this._dimensions; + let calcDimIdx = calcDimNameToIdx.get(dimName); + if (calcDimIdx != null) { + if (dimensions[calcDimIdx].type === type) { + return calcDimIdx; + } + } else { + calcDimIdx = dimensions.length; + } + dimensions[calcDimIdx] = {type}; + calcDimNameToIdx.set(dimName, calcDimIdx); + this._chunks[calcDimIdx] = new dataCtors[type || "float"](this._rawCount); + this._rawExtent[calcDimIdx] = getInitialExtent(); + return calcDimIdx; + } + collectOrdinalMeta(dimIdx, ordinalMeta) { + const chunk = this._chunks[dimIdx]; + const dim = this._dimensions[dimIdx]; + const rawExtents = this._rawExtent; + const offset = dim.ordinalOffset || 0; + const len2 = chunk.length; + if (offset === 0) { + rawExtents[dimIdx] = getInitialExtent(); + } + const dimRawExtent = rawExtents[dimIdx]; + for (let i = offset; i < len2; i++) { + const val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]); + if (!isNaN(val)) { + dimRawExtent[0] = Math.min(val, dimRawExtent[0]); + dimRawExtent[1] = Math.max(val, dimRawExtent[1]); + } + } + dim.ordinalMeta = ordinalMeta; + dim.ordinalOffset = len2; + dim.type = "ordinal"; + } + getOrdinalMeta(dimIdx) { + const dimInfo = this._dimensions[dimIdx]; + const ordinalMeta = dimInfo.ordinalMeta; + return ordinalMeta; + } + getDimensionProperty(dimIndex) { + const item = this._dimensions[dimIndex]; + return item && item.property; + } + appendData(data) { + if (true) { + assert(!this._indices, "appendData can only be called on raw data."); + } + const provider = this._provider; + const start2 = this.count(); + provider.appendData(data); + let end2 = provider.count(); + if (!provider.persistent) { + end2 += start2; + } + if (start2 < end2) { + this._initDataFromProvider(start2, end2, true); + } + return [start2, end2]; + } + appendValues(values, minFillLen) { + const chunks = this._chunks; + const dimensions = this._dimensions; + const dimLen = dimensions.length; + const rawExtent = this._rawExtent; + const start2 = this.count(); + const end2 = start2 + Math.max(values.length, minFillLen || 0); + for (let i = 0; i < dimLen; i++) { + const dim = dimensions[i]; + prepareStore(chunks, i, dim.type, end2, true); + } + const emptyDataItem = []; + for (let idx = start2; idx < end2; idx++) { + const sourceIdx = idx - start2; + for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) { + const dim = dimensions[dimIdx]; + const val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx); + chunks[dimIdx][idx] = val; + const dimRawExtent = rawExtent[dimIdx]; + val < dimRawExtent[0] && (dimRawExtent[0] = val); + val > dimRawExtent[1] && (dimRawExtent[1] = val); + } + } + this._rawCount = this._count = end2; + return {start: start2, end: end2}; + } + _initDataFromProvider(start2, end2, append) { + const provider = this._provider; + const chunks = this._chunks; + const dimensions = this._dimensions; + const dimLen = dimensions.length; + const rawExtent = this._rawExtent; + const dimNames = map(dimensions, (dim) => dim.property); + for (let i = 0; i < dimLen; i++) { + const dim = dimensions[i]; + if (!rawExtent[i]) { + rawExtent[i] = getInitialExtent(); + } + prepareStore(chunks, i, dim.type, end2, append); + } + if (provider.fillStorage) { + provider.fillStorage(start2, end2, chunks, rawExtent); + } else { + let dataItem = []; + for (let idx = start2; idx < end2; idx++) { + dataItem = provider.getItem(idx, dataItem); + for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) { + const dimStorage = chunks[dimIdx]; + const val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx); + dimStorage[idx] = val; + const dimRawExtent = rawExtent[dimIdx]; + val < dimRawExtent[0] && (dimRawExtent[0] = val); + val > dimRawExtent[1] && (dimRawExtent[1] = val); + } + } + } + if (!provider.persistent && provider.clean) { + provider.clean(); + } + this._rawCount = this._count = end2; + this._extent = []; + } + count() { + return this._count; + } + get(dim, idx) { + if (!(idx >= 0 && idx < this._count)) { + return NaN; + } + const dimStore = this._chunks[dim]; + return dimStore ? dimStore[this.getRawIndex(idx)] : NaN; + } + getValues(dimensions, idx) { + const values = []; + let dimArr = []; + if (idx == null) { + idx = dimensions; + dimensions = []; + for (let i = 0; i < this._dimensions.length; i++) { + dimArr.push(i); + } + } else { + dimArr = dimensions; + } + for (let i = 0, len2 = dimArr.length; i < len2; i++) { + values.push(this.get(dimArr[i], idx)); + } + return values; + } + getByRawIndex(dim, rawIdx) { + if (!(rawIdx >= 0 && rawIdx < this._rawCount)) { + return NaN; + } + const dimStore = this._chunks[dim]; + return dimStore ? dimStore[rawIdx] : NaN; + } + getSum(dim) { + const dimData = this._chunks[dim]; + let sum2 = 0; + if (dimData) { + for (let i = 0, len2 = this.count(); i < len2; i++) { + const value = this.get(dim, i); + if (!isNaN(value)) { + sum2 += value; + } + } + } + return sum2; + } + getMedian(dim) { + const dimDataArray = []; + this.each([dim], function(val) { + if (!isNaN(val)) { + dimDataArray.push(val); + } + }); + const sortedDimDataArray = dimDataArray.sort(function(a, b) { + return a - b; + }); + const len2 = this.count(); + return len2 === 0 ? 0 : len2 % 2 === 1 ? sortedDimDataArray[(len2 - 1) / 2] : (sortedDimDataArray[len2 / 2] + sortedDimDataArray[len2 / 2 - 1]) / 2; + } + indexOfRawIndex(rawIndex) { + if (rawIndex >= this._rawCount || rawIndex < 0) { + return -1; + } + if (!this._indices) { + return rawIndex; + } + const indices = this._indices; + const rawDataIndex = indices[rawIndex]; + if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) { + return rawIndex; + } + let left = 0; + let right = this._count - 1; + while (left <= right) { + const mid = (left + right) / 2 | 0; + if (indices[mid] < rawIndex) { + left = mid + 1; + } else if (indices[mid] > rawIndex) { + right = mid - 1; + } else { + return mid; + } + } + return -1; + } + indicesOfNearest(dim, value, maxDistance) { + const chunks = this._chunks; + const dimData = chunks[dim]; + const nearestIndices = []; + if (!dimData) { + return nearestIndices; + } + if (maxDistance == null) { + maxDistance = Infinity; + } + let minDist = Infinity; + let minDiff = -1; + let nearestIndicesLen = 0; + for (let i = 0, len2 = this.count(); i < len2; i++) { + const dataIndex = this.getRawIndex(i); + const diff = value - dimData[dataIndex]; + const dist3 = Math.abs(diff); + if (dist3 <= maxDistance) { + if (dist3 < minDist || dist3 === minDist && diff >= 0 && minDiff < 0) { + minDist = dist3; + minDiff = diff; + nearestIndicesLen = 0; + } + if (diff === minDiff) { + nearestIndices[nearestIndicesLen++] = i; + } + } + } + nearestIndices.length = nearestIndicesLen; + return nearestIndices; + } + getIndices() { + let newIndices; + const indices = this._indices; + if (indices) { + const Ctor = indices.constructor; + const thisCount = this._count; + if (Ctor === Array) { + newIndices = new Ctor(thisCount); + for (let i = 0; i < thisCount; i++) { + newIndices[i] = indices[i]; + } + } else { + newIndices = new Ctor(indices.buffer, 0, thisCount); + } + } else { + const Ctor = getIndicesCtor(this._rawCount); + newIndices = new Ctor(this.count()); + for (let i = 0; i < newIndices.length; i++) { + newIndices[i] = i; + } + } + return newIndices; + } + filter(dims, cb) { + if (!this._count) { + return this; + } + const newStore = this.clone(); + const count2 = newStore.count(); + const Ctor = getIndicesCtor(newStore._rawCount); + const newIndices = new Ctor(count2); + const value = []; + const dimSize = dims.length; + let offset = 0; + const dim0 = dims[0]; + const chunks = newStore._chunks; + for (let i = 0; i < count2; i++) { + let keep; + const rawIdx = newStore.getRawIndex(i); + if (dimSize === 0) { + keep = cb(i); + } else if (dimSize === 1) { + const val = chunks[dim0][rawIdx]; + keep = cb(val, i); + } else { + let k = 0; + for (; k < dimSize; k++) { + value[k] = chunks[dims[k]][rawIdx]; + } + value[k] = i; + keep = cb.apply(null, value); + } + if (keep) { + newIndices[offset++] = rawIdx; + } + } + if (offset < count2) { + newStore._indices = newIndices; + } + newStore._count = offset; + newStore._extent = []; + newStore._updateGetRawIdx(); + return newStore; + } + selectRange(range) { + const newStore = this.clone(); + const len2 = newStore._count; + if (!len2) { + return this; + } + const dims = keys(range); + const dimSize = dims.length; + if (!dimSize) { + return this; + } + const originalCount = newStore.count(); + const Ctor = getIndicesCtor(newStore._rawCount); + const newIndices = new Ctor(originalCount); + let offset = 0; + const dim0 = dims[0]; + const min3 = range[dim0][0]; + const max3 = range[dim0][1]; + const storeArr = newStore._chunks; + let quickFinished = false; + if (!newStore._indices) { + let idx = 0; + if (dimSize === 1) { + const dimStorage = storeArr[dims[0]]; + for (let i = 0; i < len2; i++) { + const val = dimStorage[i]; + if (val >= min3 && val <= max3 || isNaN(val)) { + newIndices[offset++] = idx; + } + idx++; + } + quickFinished = true; + } else if (dimSize === 2) { + const dimStorage = storeArr[dims[0]]; + const dimStorage2 = storeArr[dims[1]]; + const min23 = range[dims[1]][0]; + const max23 = range[dims[1]][1]; + for (let i = 0; i < len2; i++) { + const val = dimStorage[i]; + const val2 = dimStorage2[i]; + if ((val >= min3 && val <= max3 || isNaN(val)) && (val2 >= min23 && val2 <= max23 || isNaN(val2))) { + newIndices[offset++] = idx; + } + idx++; + } + quickFinished = true; + } + } + if (!quickFinished) { + if (dimSize === 1) { + for (let i = 0; i < originalCount; i++) { + const rawIndex = newStore.getRawIndex(i); + const val = storeArr[dims[0]][rawIndex]; + if (val >= min3 && val <= max3 || isNaN(val)) { + newIndices[offset++] = rawIndex; } - 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 levelModel = seriesModel.getLevelModel(node); - if (levelModel) { - var r0_1 = levelModel.get('r0', true); - var r_1 = levelModel.get('r', true); - var radius_1 = levelModel.get('radius', true); - if (radius_1 != null) { - r0_1 = radius_1[0]; - r_1 = radius_1[1]; - } - r0_1 != null && (rStart = parsePercent$1(r0_1, size / 2)); - r_1 != null && (rEnd = parsePercent$1(r_1, size / 2)); + } + } else { + for (let i = 0; i < originalCount; i++) { + let keep = true; + const rawIndex = newStore.getRawIndex(i); + for (let k = 0; k < dimSize; k++) { + const dimk = dims[k]; + const val = storeArr[dimk][rawIndex]; + if (val < range[dimk][0] || val > range[dimk][1]) { + keep = false; } - 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_1 = 0; - each(node.children, function (node) { - siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1); - }); + if (keep) { + newIndices[offset++] = newStore.getRawIndex(i); + } + } + } + } + if (offset < originalCount) { + newStore._indices = newIndices; + } + newStore._count = offset; + newStore._extent = []; + newStore._updateGetRawIdx(); + return newStore; + } + map(dims, cb) { + const target = this.clone(dims); + this._updateDims(target, dims, cb); + return target; + } + modify(dims, cb) { + this._updateDims(this, dims, cb); + } + _updateDims(target, dims, cb) { + const targetChunks = target._chunks; + const tmpRetValue = []; + const dimSize = dims.length; + const dataCount = target.count(); + const values = []; + const rawExtent = target._rawExtent; + for (let i = 0; i < dims.length; i++) { + rawExtent[dims[i]] = getInitialExtent(); + } + for (let dataIndex = 0; dataIndex < dataCount; dataIndex++) { + const rawIndex = target.getRawIndex(dataIndex); + for (let k = 0; k < dimSize; k++) { + values[k] = targetChunks[dims[k]][rawIndex]; + } + values[dimSize] = dataIndex; + let retValue = cb && cb.apply(null, values); + if (retValue != null) { + if (typeof retValue !== "object") { + tmpRetValue[0] = retValue; + retValue = tmpRetValue; + } + for (let i = 0; i < retValue.length; i++) { + const dim = dims[i]; + const val = retValue[i]; + const rawExtentOnDim = rawExtent[dim]; + const dimStore = targetChunks[dim]; + if (dimStore) { + dimStore[rawIndex] = val; + } + if (val < rawExtentOnDim[0]) { + rawExtentOnDim[0] = val; + } + if (val > rawExtentOnDim[1]) { + rawExtentOnDim[1] = val; + } + } + } + } + } + lttbDownSample(valueDimension, rate) { + const target = this.clone([valueDimension], true); + const targetStorage = target._chunks; + const dimStore = targetStorage[valueDimension]; + const len2 = this.count(); + let sampledIndex = 0; + const frameSize = Math.floor(1 / rate); + let currentRawIndex = this.getRawIndex(0); + let maxArea; + let area; + let nextRawIndex; + const newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len2 / frameSize) + 2) * 2, len2)); + newIndices[sampledIndex++] = currentRawIndex; + for (let i = 1; i < len2 - 1; i += frameSize) { + const nextFrameStart = Math.min(i + frameSize, len2 - 1); + const nextFrameEnd = Math.min(i + frameSize * 2, len2); + const avgX = (nextFrameEnd + nextFrameStart) / 2; + let avgY = 0; + for (let idx = nextFrameStart; idx < nextFrameEnd; idx++) { + const rawIndex = this.getRawIndex(idx); + const y = dimStore[rawIndex]; + if (isNaN(y)) { + continue; + } + avgY += y; + } + avgY /= nextFrameEnd - nextFrameStart; + const frameStart = i; + const frameEnd = Math.min(i + frameSize, len2); + const pointAX = i - 1; + const pointAY = dimStore[currentRawIndex]; + maxArea = -1; + nextRawIndex = frameStart; + let firstNaNIndex = -1; + let countNaN = 0; + for (let idx = frameStart; idx < frameEnd; idx++) { + const rawIndex = this.getRawIndex(idx); + const y = dimStore[rawIndex]; + if (isNaN(y)) { + countNaN++; + if (firstNaNIndex < 0) { + firstNaNIndex = rawIndex; } - 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 - }); + continue; } - renderNode(treeRoot, startAngle); - }); + area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY)); + if (area > maxArea) { + maxArea = area; + nextRawIndex = rawIndex; + } + } + if (countNaN > 0 && countNaN < frameEnd - frameStart) { + newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex); + nextRawIndex = Math.max(firstNaNIndex, nextRawIndex); + } + newIndices[sampledIndex++] = nextRawIndex; + currentRawIndex = nextRawIndex; + } + newIndices[sampledIndex++] = this.getRawIndex(len2 - 1); + target._count = sampledIndex; + target._indices = newIndices; + target.getRawIndex = this._getRawIdx; + return target; + } + downSample(dimension, rate, sampleValue, sampleIndex) { + const target = this.clone([dimension], true); + const targetStorage = target._chunks; + const frameValues = []; + let frameSize = Math.floor(1 / rate); + const dimStore = targetStorage[dimension]; + const len2 = this.count(); + const rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent(); + const newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len2 / frameSize)); + let offset = 0; + for (let i = 0; i < len2; i += frameSize) { + if (frameSize > len2 - i) { + frameSize = len2 - i; + frameValues.length = frameSize; + } + for (let k = 0; k < frameSize; k++) { + const dataIdx = this.getRawIndex(i + k); + frameValues[k] = dimStore[dataIdx]; + } + const value = sampleValue(frameValues); + const sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len2 - 1)); + dimStore[sampleFrameIdx] = value; + if (value < rawExtentOnDim[0]) { + rawExtentOnDim[0] = value; + } + if (value > rawExtentOnDim[1]) { + rawExtentOnDim[1] = value; + } + newIndices[offset++] = sampleFrameIdx; + } + target._count = offset; + target._indices = newIndices; + target._updateGetRawIdx(); + return target; + } + each(dims, cb) { + if (!this._count) { + return; + } + const dimSize = dims.length; + const chunks = this._chunks; + for (let i = 0, len2 = this.count(); i < len2; i++) { + const rawIdx = this.getRawIndex(i); + switch (dimSize) { + case 0: + cb(i); + break; + case 1: + cb(chunks[dims[0]][rawIdx], i); + break; + case 2: + cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i); + break; + default: + let k = 0; + const value = []; + for (; k < dimSize; k++) { + value[k] = chunks[dims[k]][rawIdx]; + } + value[k] = i; + cb.apply(null, value); + } + } + } + getDataExtent(dim) { + const dimData = this._chunks[dim]; + const initialExtent = getInitialExtent(); + if (!dimData) { + return initialExtent; + } + const currEnd = this.count(); + const useRaw = !this._indices; + let dimExtent; + if (useRaw) { + return this._rawExtent[dim].slice(); + } + dimExtent = this._extent[dim]; + if (dimExtent) { + return dimExtent.slice(); + } + dimExtent = initialExtent; + let min3 = dimExtent[0]; + let max3 = dimExtent[1]; + for (let i = 0; i < currEnd; i++) { + const rawIdx = this.getRawIndex(i); + const value = dimData[rawIdx]; + value < min3 && (min3 = value); + value > max3 && (max3 = value); + } + dimExtent = [min3, max3]; + this._extent[dim] = dimExtent; + return dimExtent; + } + getRawDataItem(idx) { + const rawIdx = this.getRawIndex(idx); + if (!this._provider.persistent) { + const val = []; + const chunks = this._chunks; + for (let i = 0; i < chunks.length; i++) { + val.push(chunks[i][rawIdx]); + } + return val; + } else { + return this._provider.getItem(rawIdx); + } + } + clone(clonedDims, ignoreIndices) { + const target = new DataStore2(); + const chunks = this._chunks; + const clonedDimsMap = clonedDims && reduce(clonedDims, (obj, dimIdx) => { + obj[dimIdx] = true; + return obj; + }, {}); + if (clonedDimsMap) { + for (let i = 0; i < chunks.length; i++) { + target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]); + } + } else { + target._chunks = chunks; + } + this._copyCommonProps(target); + if (!ignoreIndices) { + target._indices = this._cloneIndices(); + } + target._updateGetRawIdx(); + return target; + } + _copyCommonProps(target) { + target._count = this._count; + target._rawCount = this._rawCount; + target._provider = this._provider; + target._dimensions = this._dimensions; + target._extent = clone(this._extent); + target._rawExtent = clone(this._rawExtent); + } + _cloneIndices() { + if (this._indices) { + const Ctor = this._indices.constructor; + let indices; + if (Ctor === Array) { + const thisCount = this._indices.length; + indices = new Ctor(thisCount); + for (let i = 0; i < thisCount; i++) { + indices[i] = this._indices[i]; + } + } else { + indices = new Ctor(this._indices); + } + return indices; } - /** - * Init node children by order and update visual - */ - function initChildren$1(node, sortOrder) { - var children = node.children || []; - node.children = sort$2(children, sortOrder); - // Init children recursively - if (children.length) { - each(node.children, function (child) { - initChildren$1(child, sortOrder); - }); + return null; + } + _getRawIdxIdentity(idx) { + return idx; + } + _getRawIdx(idx) { + if (idx < this._count && idx >= 0) { + return this._indices[idx]; + } + return -1; + } + _updateGetRawIdx() { + this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity; + } +}; +var DataStore = DataStore2; +DataStore.internalField = function() { + function getDimValueSimply(dataItem, property, dataIndex, dimIndex) { + return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]); + } + defaultDimValueGetters = { + arrayRows: getDimValueSimply, + objectRows(dataItem, property, dataIndex, dimIndex) { + return parseDataValue(dataItem[property], this._dimensions[dimIndex]); + }, + keyedColumns: getDimValueSimply, + original(dataItem, property, dataIndex, dimIndex) { + const value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); + return parseDataValue(value instanceof Array ? value[dimIndex] : value, this._dimensions[dimIndex]); + }, + typedArray: function(dataItem, property, dataIndex, dimIndex) { + return dataItem[dimIndex]; + } + }; +}(); +var DataStore_default = DataStore; + +// src/data/helper/sourceManager.ts +var SourceManager = class { + constructor(sourceHost) { + this._sourceList = []; + this._storeList = []; + this._upstreamSignList = []; + this._versionSignBase = 0; + this._dirty = true; + this._sourceHost = sourceHost; + } + dirty() { + this._setLocalSource([], []); + this._storeList = []; + this._dirty = true; + } + _setLocalSource(sourceList, upstreamSignList) { + this._sourceList = sourceList; + this._upstreamSignList = upstreamSignList; + this._versionSignBase++; + if (this._versionSignBase > 9e10) { + this._versionSignBase = 0; + } + } + _getVersionSign() { + return this._sourceHost.uid + "_" + this._versionSignBase; + } + prepareSource() { + if (this._isDirty()) { + this._createSource(); + this._dirty = false; + } + } + _createSource() { + this._setLocalSource([], []); + const sourceHost = this._sourceHost; + const upSourceMgrList = this._getUpstreamSourceManagers(); + const hasUpstream = !!upSourceMgrList.length; + let resultSourceList; + let upstreamSignList; + if (isSeries(sourceHost)) { + const seriesModel = sourceHost; + let data; + let sourceFormat; + let upSource; + if (hasUpstream) { + const upSourceMgr = upSourceMgrList[0]; + upSourceMgr.prepareSource(); + upSource = upSourceMgr.getSource(); + data = upSource.data; + sourceFormat = upSource.sourceFormat; + upstreamSignList = [upSourceMgr._getVersionSign()]; + } else { + data = seriesModel.get("data", true); + sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL; + upstreamSignList = []; + } + const newMetaRawOption = this._getSourceMetaRawOption() || {}; + const upMetaRawOption = upSource && upSource.metaRawOption || {}; + const seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null; + const sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader); + const dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions); + const needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions; + resultSourceList = needsCreateSource ? [createSource(data, {seriesLayoutBy, sourceHeader, dimensions}, sourceFormat)] : []; + } else { + const datasetModel = sourceHost; + if (hasUpstream) { + const result = this._applyTransform(upSourceMgrList); + resultSourceList = result.sourceList; + upstreamSignList = result.upstreamSignList; + } else { + const sourceData = datasetModel.get("source", true); + resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)]; + upstreamSignList = []; + } + } + if (true) { + assert(resultSourceList && upstreamSignList); + } + this._setLocalSource(resultSourceList, upstreamSignList); + } + _applyTransform(upMgrList) { + const datasetModel = this._sourceHost; + const transformOption = datasetModel.get("transform", true); + const fromTransformResult = datasetModel.get("fromTransformResult", true); + if (true) { + assert(fromTransformResult != null || transformOption != null); + } + if (fromTransformResult != null) { + let errMsg = ""; + if (upMgrList.length !== 1) { + if (true) { + errMsg = "When using `fromTransformResult`, there should be only one upstream dataset"; + } + doThrow(errMsg); + } + } + let sourceList; + const upSourceList = []; + const upstreamSignList = []; + each(upMgrList, (upMgr) => { + upMgr.prepareSource(); + const upSource = upMgr.getSource(fromTransformResult || 0); + let errMsg = ""; + if (fromTransformResult != null && !upSource) { + if (true) { + errMsg = "Can not retrieve result by `fromTransformResult`: " + fromTransformResult; + } + doThrow(errMsg); + } + upSourceList.push(upSource); + upstreamSignList.push(upMgr._getVersionSign()); + }); + if (transformOption) { + sourceList = applyDataTransform(transformOption, upSourceList, {datasetIndex: datasetModel.componentIndex}); + } else if (fromTransformResult != null) { + sourceList = [cloneSourceShallow(upSourceList[0])]; + } + return {sourceList, upstreamSignList}; + } + _isDirty() { + if (this._dirty) { + return true; + } + const upSourceMgrList = this._getUpstreamSourceManagers(); + for (let i = 0; i < upSourceMgrList.length; i++) { + const upSrcMgr = upSourceMgrList[i]; + if (upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) { + return true; } } - /** - * 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$2(children, sortOrder) { - if (isFunction(sortOrder)) { - var sortTargets = map(children, function (child, idx) { - var value = child.getValue(); - return { - params: { - depth: child.depth, - height: child.height, - dataIndex: child.dataIndex, - getValue: function () { - return value; - } - }, - index: idx - }; - }); - sortTargets.sort(function (a, b) { - return sortOrder(a.params, b.params); - }); - return map(sortTargets, function (target) { - return children[target.index]; - }); + } + getSource(sourceIndex) { + sourceIndex = sourceIndex || 0; + const source = this._sourceList[sourceIndex]; + if (!source) { + const upSourceMgrList = this._getUpstreamSourceManagers(); + return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex); + } + return source; + } + getSharedDataStore(seriesDimRequest) { + if (true) { + assert(isSeries(this._sourceHost), "Can only call getDataStore on series source manager."); + } + const schema = seriesDimRequest.makeStoreSchema(); + return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash); + } + _innerGetDataStore(storeDims, seriesSource, sourceReadKey) { + const sourceIndex = 0; + const storeList = this._storeList; + let cachedStoreMap = storeList[sourceIndex]; + if (!cachedStoreMap) { + cachedStoreMap = storeList[sourceIndex] = {}; + } + let cachedStore = cachedStoreMap[sourceReadKey]; + if (!cachedStore) { + const upSourceMgr = this._getUpstreamSourceManagers()[0]; + if (isSeries(this._sourceHost) && upSourceMgr) { + cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey); } else { - var isAsc_1 = sortOrder === 'asc'; - return children.sort(function (a, b) { - var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1); - return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff; - }); + cachedStore = new DataStore_default(); + cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims); + } + cachedStoreMap[sourceReadKey] = cachedStore; + } + return cachedStore; + } + _getUpstreamSourceManagers() { + const sourceHost = this._sourceHost; + if (isSeries(sourceHost)) { + const datasetModel = querySeriesUpstreamDatasetModel(sourceHost); + return !datasetModel ? [] : [datasetModel.getSourceManager()]; + } else { + return map(queryDatasetUpstreamDatasetModels(sourceHost), (datasetModel) => datasetModel.getSourceManager()); + } + } + _getSourceMetaRawOption() { + const sourceHost = this._sourceHost; + let seriesLayoutBy; + let sourceHeader; + let dimensions; + if (isSeries(sourceHost)) { + seriesLayoutBy = sourceHost.get("seriesLayoutBy", true); + sourceHeader = sourceHost.get("sourceHeader", true); + dimensions = sourceHost.get("dimensions", true); + } else if (!this._getUpstreamSourceManagers().length) { + const model = sourceHost; + seriesLayoutBy = model.get("seriesLayoutBy", true); + sourceHeader = model.get("sourceHeader", true); + dimensions = model.get("dimensions", true); + } + return {seriesLayoutBy, sourceHeader, dimensions}; + } +}; +function disableTransformOptionMerge(datasetModel) { + const transformOption = datasetModel.option.transform; + transformOption && setAsPrimitive(datasetModel.option.transform); +} +function isSeries(sourceHost) { + return sourceHost.mainType === "series"; +} +function doThrow(errMsg) { + throw new Error(errMsg); +} + +// src/component/tooltip/tooltipMarkup.ts +var TOOLTIP_LINE_HEIGHT_CSS = "line-height:1"; +function getTooltipTextStyle(textStyle, renderMode) { + const nameFontColor = textStyle.color || "#6e7079"; + const nameFontSize = textStyle.fontSize || 12; + const nameFontWeight = textStyle.fontWeight || "400"; + const valueFontColor = textStyle.color || "#464646"; + const valueFontSize = textStyle.fontSize || 14; + const valueFontWeight = textStyle.fontWeight || "900"; + if (renderMode === "html") { + return { + nameStyle: `font-size:${encodeHTML(nameFontSize + "")}px;color:${encodeHTML(nameFontColor)};font-weight:${encodeHTML(nameFontWeight + "")}`, + valueStyle: `font-size:${encodeHTML(valueFontSize + "")}px;color:${encodeHTML(valueFontColor)};font-weight:${encodeHTML(valueFontWeight + "")}` + }; + } else { + return { + nameStyle: { + fontSize: nameFontSize, + fill: nameFontColor, + fontWeight: nameFontWeight + }, + valueStyle: { + fontSize: valueFontSize, + fill: valueFontColor, + fontWeight: valueFontWeight + } + }; + } +} +var HTML_GAPS = [0, 10, 20, 30]; +var RICH_TEXT_GAPS = ["", "\n", "\n\n", "\n\n\n"]; +function createTooltipMarkup(type, option) { + option.type = type; + return option; +} +function isSectionFragment(frag) { + return frag.type === "section"; +} +function getBuilder(frag) { + return isSectionFragment(frag) ? buildSection : buildNameValue; +} +function getBlockGapLevel(frag) { + if (isSectionFragment(frag)) { + let gapLevel = 0; + const subBlockLen = frag.blocks.length; + const hasInnerGap = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader; + each(frag.blocks, function(subBlock) { + const subGapLevel = getBlockGapLevel(subBlock); + if (subGapLevel >= gapLevel) { + gapLevel = subGapLevel + +(hasInnerGap && (!subGapLevel || isSectionFragment(subBlock) && !subBlock.noHeader)); } + }); + return gapLevel; + } + return 0; +} +function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) { + const noHeader = fragment.noHeader; + const gaps = getGap(getBlockGapLevel(fragment)); + const subMarkupTextList = []; + let subBlocks = fragment.blocks || []; + assert(!subBlocks || isArray(subBlocks)); + subBlocks = subBlocks || []; + const orderMode = ctx.orderMode; + if (fragment.sortBlocks && orderMode) { + subBlocks = subBlocks.slice(); + const orderMap = {valueAsc: "asc", valueDesc: "desc"}; + if (hasOwn(orderMap, orderMode)) { + const comparator = new SortOrderComparator(orderMap[orderMode], null); + subBlocks.sort((a, b) => comparator.evaluate(a.sortParam, b.sortParam)); + } else if (orderMode === "seriesDesc") { + subBlocks.reverse(); + } + } + each(subBlocks, function(subBlock, idx) { + const valueFormatter = fragment.valueFormatter; + const subMarkupText2 = getBuilder(subBlock)(valueFormatter ? extend(extend({}, ctx), {valueFormatter}) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle); + subMarkupText2 != null && subMarkupTextList.push(subMarkupText2); + }); + const subMarkupText = ctx.renderMode === "richText" ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(""), noHeader ? topMarginForOuterGap : gaps.html); + if (noHeader) { + return subMarkupText; + } + const displayableHeader = makeValueReadable(fragment.header, "ordinal", ctx.useUTC); + const {nameStyle} = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode); + if (ctx.renderMode === "richText") { + return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText; + } else { + return wrapBlockHTML(`
` + encodeHTML(displayableHeader) + "
" + subMarkupText, topMarginForOuterGap); + } +} +function buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) { + const renderMode = ctx.renderMode; + const noName = fragment.noName; + const noValue = fragment.noValue; + const noMarker = !fragment.markerType; + const name = fragment.name; + const useUTC = ctx.useUTC; + const valueFormatter = fragment.valueFormatter || ctx.valueFormatter || ((value) => { + value = isArray(value) ? value : [value]; + return map(value, (val, idx) => makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC)); + }); + if (noName && noValue) { + return; + } + const markerStr = noMarker ? "" : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || "#333", renderMode); + const readableName = noName ? "" : makeValueReadable(name, "ordinal", useUTC); + const valueTypeOption = fragment.valueType; + const readableValueList = noValue ? [] : valueFormatter(fragment.value, fragment.dataIndex); + const valueAlignRight = !noMarker || !noName; + const valueCloseToMarker = !noMarker && noName; + const {nameStyle, valueStyle} = getTooltipTextStyle(toolTipTextStyle, renderMode); + return renderMode === "richText" ? (noMarker ? "" : markerStr) + (noName ? "" : wrapInlineNameRichText(ctx, readableName, nameStyle)) + (noValue ? "" : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? "" : markerStr) + (noName ? "" : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? "" : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap); +} +function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) { + if (!fragment) { + return; + } + const builder = getBuilder(fragment); + const ctx = { + useUTC, + renderMode, + orderMode, + markupStyleCreator, + valueFormatter: fragment.valueFormatter + }; + return builder(ctx, fragment, 0, toolTipTextStyle); +} +function getGap(gapLevel) { + return { + html: HTML_GAPS[gapLevel], + richText: RICH_TEXT_GAPS[gapLevel] + }; +} +function wrapBlockHTML(encodedContent, topGap) { + const clearfix = '
'; + const marginCSS = `margin: ${topGap}px 0 0`; + return `
` + encodedContent + clearfix + "
"; +} +function wrapInlineNameHTML(name, leftHasMarker, style) { + const marginCss = leftHasMarker ? "margin-left:2px" : ""; + return `` + encodeHTML(name) + ""; +} +function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) { + const paddingStr = valueCloseToMarker ? "10px" : "20px"; + const alignCSS = alignRight ? `float:right;margin-left:${paddingStr}` : ""; + valueList = isArray(valueList) ? valueList : [valueList]; + return `` + map(valueList, (value) => encodeHTML(value)).join("  ") + ""; +} +function wrapInlineNameRichText(ctx, name, style) { + return ctx.markupStyleCreator.wrapRichTextStyle(name, style); +} +function wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) { + const styles = [style]; + const paddingLeft = valueCloseToMarker ? 10 : 20; + alignRight && styles.push({padding: [0, 0, 0, paddingLeft], align: "right"}); + return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join(" ") : values, styles); +} +function retrieveVisualColorForTooltipMarker(series, dataIndex) { + const style = series.getData().getItemVisual(dataIndex, "style"); + const color2 = style[series.visualDrawType]; + return convertToColorString(color2); +} +function getPaddingFromTooltipModel(model, renderMode) { + const padding = model.get("padding"); + return padding != null ? padding : renderMode === "richText" ? [8, 10] : 10; +} +var TooltipMarkupStyleCreator = class { + constructor() { + this.richTextStyles = {}; + this._nextStyleNameId = getRandomIdBase(); + } + _generateStyleName() { + return "__EC_aUTo_" + this._nextStyleNameId++; + } + makeTooltipMarker(markerType, colorStr, renderMode) { + const markerId = renderMode === "richText" ? this._generateStyleName() : null; + const marker = getTooltipMarker({ + color: colorStr, + type: markerType, + renderMode, + markerId + }); + if (isString(marker)) { + return marker; + } else { + if (true) { + assert(markerId); + } + this.richTextStyles[markerId] = marker.style; + return marker.content; + } + } + wrapRichTextStyle(text, styles) { + const finalStl = {}; + if (isArray(styles)) { + each(styles, (stl) => extend(finalStl, stl)); + } else { + extend(finalStl, styles); + } + const styleName = this._generateStyleName(); + this.richTextStyles[styleName] = finalStl; + return `{${styleName}|${text}}`; + } +}; + +// src/component/tooltip/seriesFormatTooltip.ts +function defaultSeriesFormatTooltip(opt) { + const series = opt.series; + const dataIndex = opt.dataIndex; + const multipleSeries = opt.multipleSeries; + const data = series.getData(); + const tooltipDims = data.mapDimensionsAll("defaultedTooltip"); + const tooltipDimLen = tooltipDims.length; + const value = series.getRawValue(dataIndex); + const isValueArr = isArray(value); + const markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex); + let inlineValue; + let inlineValueType; + let subBlocks; + let sortParam; + if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) { + const formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor); + inlineValue = formatArrResult.inlineValues; + inlineValueType = formatArrResult.inlineValueTypes; + subBlocks = formatArrResult.blocks; + sortParam = formatArrResult.inlineValues[0]; + } else if (tooltipDimLen) { + const dimInfo = data.getDimensionInfo(tooltipDims[0]); + sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]); + inlineValueType = dimInfo.type; + } else { + sortParam = inlineValue = isValueArr ? value[0] : value; + } + const seriesNameSpecified = isNameSpecified(series); + const seriesName = seriesNameSpecified && series.name || ""; + const itemName = data.getName(dataIndex); + const inlineName = multipleSeries ? seriesName : itemName; + return createTooltipMarkup("section", { + header: seriesName, + noHeader: multipleSeries || !seriesNameSpecified, + sortParam, + blocks: [ + createTooltipMarkup("nameValue", { + markerType: "item", + markerColor, + name: inlineName, + noName: !trim(inlineName), + value: inlineValue, + valueType: inlineValueType, + dataIndex + }) + ].concat(subBlocks || []) + }); +} +function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) { + const data = series.getData(); + const isValueMultipleLine = reduce(value, function(isValueMultipleLine2, val, idx) { + const dimItem = data.getDimensionInfo(idx); + return isValueMultipleLine2 = isValueMultipleLine2 || dimItem && dimItem.tooltip !== false && dimItem.displayName != null; + }, false); + const inlineValues = []; + const inlineValueTypes = []; + const blocks = []; + tooltipDims.length ? each(tooltipDims, function(dim) { + setEachItem(retrieveRawValue(data, dataIndex, dim), dim); + }) : each(value, setEachItem); + function setEachItem(val, dim) { + const dimInfo = data.getDimensionInfo(dim); + if (!dimInfo || dimInfo.otherDims.tooltip === false) { + return; + } + if (isValueMultipleLine) { + blocks.push(createTooltipMarkup("nameValue", { + markerType: "subItem", + markerColor: colorStr, + name: dimInfo.displayName, + value: val, + valueType: dimInfo.type + })); + } else { + inlineValues.push(val); + inlineValueTypes.push(dimInfo.type); + } + } + return {inlineValues, inlineValueTypes, blocks}; +} + +// src/model/Series.ts +var inner2 = makeInner(); +function getSelectionKey(data, dataIndex) { + return data.getName(dataIndex) || data.getId(dataIndex); +} +var SERIES_UNIVERSAL_TRANSITION_PROP = "__universalTransitionEnabled"; +var SeriesModel2 = class extends Component_default { + constructor() { + super(...arguments); + this._selectedDataIndicesMap = {}; + } + init(option, parentModel, ecModel) { + this.seriesIndex = this.componentIndex; + this.dataTask = createTask({ + count: dataTaskCount, + reset: dataTaskReset + }); + this.dataTask.context = {model: this}; + this.mergeDefaultAndTheme(option, ecModel); + const sourceManager = inner2(this).sourceManager = new SourceManager(this); + sourceManager.prepareSource(); + const data = this.getInitialData(option, ecModel); + wrapData(data, this); + this.dataTask.context.data = data; + if (true) { + assert(data, "getInitialData returned invalid data."); + } + inner2(this).dataBeforeProcessed = data; + autoSeriesName(this); + this._initSelectedMapFromData(data); + } + mergeDefaultAndTheme(option, ecModel) { + const layoutMode = fetchLayoutMode(this); + const inputPositionParams = layoutMode ? getLayoutParams(option) : {}; + let themeSubType = this.subType; + if (Component_default.hasClass(themeSubType)) { + themeSubType += "Series"; + } + merge(option, ecModel.getTheme().get(this.subType)); + merge(option, this.getDefaultOption()); + defaultEmphasis(option, "label", ["show"]); + this.fillDataTextStyle(option.data); + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + } + mergeOption(newSeriesOption, ecModel) { + newSeriesOption = merge(this.option, newSeriesOption, true); + this.fillDataTextStyle(newSeriesOption.data); + const layoutMode = fetchLayoutMode(this); + if (layoutMode) { + mergeLayoutParam(this.option, newSeriesOption, layoutMode); + } + const sourceManager = inner2(this).sourceManager; + sourceManager.dirty(); + sourceManager.prepareSource(); + const data = this.getInitialData(newSeriesOption, ecModel); + wrapData(data, this); + this.dataTask.dirty(); + this.dataTask.context.data = data; + inner2(this).dataBeforeProcessed = data; + autoSeriesName(this); + this._initSelectedMapFromData(data); + } + fillDataTextStyle(data) { + if (data && !isTypedArray(data)) { + const props = ["show"]; + for (let i = 0; i < data.length; i++) { + if (data[i] && data[i].label) { + defaultEmphasis(data[i], "label", props); + } + } + } + } + getInitialData(option, ecModel) { + return; + } + appendData(params) { + const data = this.getRawData(); + data.appendData(params.data); + } + getData(dataType) { + const task = getCurrentTask(this); + if (task) { + const data = task.context.data; + return dataType == null || !data.getLinkedData ? data : data.getLinkedData(dataType); + } else { + return inner2(this).data; + } + } + getAllData() { + const mainData = this.getData(); + return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{data: mainData}]; + } + setData(data) { + const task = getCurrentTask(this); + if (task) { + const context = task.context; + context.outputData = data; + if (task !== this.dataTask) { + context.data = data; + } + } + inner2(this).data = data; + } + getEncode() { + const encode = this.get("encode", true); + if (encode) { + return createHashMap(encode); + } + } + getSourceManager() { + return inner2(this).sourceManager; + } + getSource() { + return this.getSourceManager().getSource(); + } + getRawData() { + return inner2(this).dataBeforeProcessed; + } + getColorBy() { + const colorBy = this.get("colorBy"); + return colorBy || "series"; + } + isColorBySeries() { + return this.getColorBy() === "series"; + } + getBaseAxis() { + const coordSys = this.coordinateSystem; + return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis(); + } + formatTooltip(dataIndex, multipleSeries, dataType) { + return defaultSeriesFormatTooltip({ + series: this, + dataIndex, + multipleSeries + }); + } + isAnimationEnabled() { + const ecModel = this.ecModel; + if (env_default.node && !(ecModel && ecModel.ssr)) { + return false; } - - function sunburstVisual(ecModel) { - var paletteScope = {}; - // Default color strategy - function pickColor(node, seriesModel, treeHeight) { - // Choose color from palette based on the first level. - var current = node; - while (current && current.depth > 1) { - current = current.parentNode; + let animationEnabled = this.getShallow("animation"); + if (animationEnabled) { + if (this.getData().count() > this.getShallow("animationThreshold")) { + animationEnabled = false; + } + } + return !!animationEnabled; + } + restoreData() { + this.dataTask.dirty(); + } + getColorFromPalette(name, scope, requestColorNum) { + const ecModel = this.ecModel; + let color2 = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum); + if (!color2) { + color2 = ecModel.getColorFromPalette(name, scope, requestColorNum); + } + return color2; + } + coordDimToDataDim(coordDim) { + return this.getRawData().mapDimensionsAll(coordDim); + } + getProgressive() { + return this.get("progressive"); + } + getProgressiveThreshold() { + return this.get("progressiveThreshold"); + } + select(innerDataIndices, dataType) { + this._innerSelect(this.getData(dataType), innerDataIndices); + } + unselect(innerDataIndices, dataType) { + const selectedMap = this.option.selectedMap; + if (!selectedMap) { + return; + } + const selectedMode = this.option.selectedMode; + const data = this.getData(dataType); + if (selectedMode === "series" || selectedMap === "all") { + this.option.selectedMap = {}; + this._selectedDataIndicesMap = {}; + return; + } + for (let i = 0; i < innerDataIndices.length; i++) { + const dataIndex = innerDataIndices[i]; + const nameOrId = getSelectionKey(data, dataIndex); + selectedMap[nameOrId] = false; + this._selectedDataIndicesMap[nameOrId] = -1; + } + } + toggleSelect(innerDataIndices, dataType) { + const tmpArr2 = []; + for (let i = 0; i < innerDataIndices.length; i++) { + tmpArr2[0] = innerDataIndices[i]; + this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr2, dataType) : this.select(tmpArr2, dataType); + } + } + getSelectedDataIndices() { + if (this.option.selectedMap === "all") { + return [].slice.call(this.getData().getIndices()); + } + const selectedDataIndicesMap = this._selectedDataIndicesMap; + const nameOrIds = keys(selectedDataIndicesMap); + const dataIndices = []; + for (let i = 0; i < nameOrIds.length; i++) { + const dataIndex = selectedDataIndicesMap[nameOrIds[i]]; + if (dataIndex >= 0) { + dataIndices.push(dataIndex); + } + } + return dataIndices; + } + isSelected(dataIndex, dataType) { + const selectedMap = this.option.selectedMap; + if (!selectedMap) { + return false; + } + const data = this.getData(dataType); + return (selectedMap === "all" || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(["select", "disabled"]); + } + isUniversalTransitionEnabled() { + if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) { + return true; + } + const universalTransitionOpt = this.option.universalTransition; + if (!universalTransitionOpt) { + return false; + } + if (universalTransitionOpt === true) { + return true; + } + return universalTransitionOpt && universalTransitionOpt.enabled; + } + _innerSelect(data, innerDataIndices) { + const option = this.option; + const selectedMode = option.selectedMode; + const len2 = innerDataIndices.length; + if (!selectedMode || !len2) { + return; + } + if (selectedMode === "series") { + option.selectedMap = "all"; + } else if (selectedMode === "multiple") { + if (!isObject(option.selectedMap)) { + option.selectedMap = {}; + } + const selectedMap = option.selectedMap; + for (let i = 0; i < len2; i++) { + const dataIndex = innerDataIndices[i]; + const nameOrId = getSelectionKey(data, dataIndex); + selectedMap[nameOrId] = true; + this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex); + } + } else if (selectedMode === "single" || selectedMode === true) { + const lastDataIndex = innerDataIndices[len2 - 1]; + const nameOrId = getSelectionKey(data, lastDataIndex); + option.selectedMap = { + [nameOrId]: true + }; + this._selectedDataIndicesMap = { + [nameOrId]: data.getRawIndex(lastDataIndex) + }; + } + } + _initSelectedMapFromData(data) { + if (this.option.selectedMap) { + return; + } + const dataIndices = []; + if (data.hasItemOption) { + data.each(function(idx) { + const rawItem = data.getRawDataItem(idx); + if (rawItem && rawItem.selected) { + dataIndices.push(idx); } - var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope); - if (node.depth > 1 && isString(color)) { - // Lighter on the deeper level. - color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5); + }); + } + if (dataIndices.length > 0) { + this._innerSelect(data, dataIndices); + } + } + static registerClass(clz) { + return Component_default.registerClass(clz); + } +}; +var SeriesModel = SeriesModel2; +SERIES_UNIVERSAL_TRANSITION_PROP; +SeriesModel.protoInitialize = function() { + const proto2 = SeriesModel2.prototype; + proto2.type = "series.__base__"; + proto2.seriesIndex = 0; + proto2.ignoreStyleOnData = false; + proto2.hasSymbolVisual = false; + proto2.defaultSymbol = "circle"; + proto2.visualStyleAccessPath = "itemStyle"; + proto2.visualDrawType = "fill"; +}(); +mixin(SeriesModel, DataFormatMixin); +mixin(SeriesModel, PaletteMixin); +mountExtend(SeriesModel, Component_default); +function autoSeriesName(seriesModel) { + const name = seriesModel.name; + if (!isNameSpecified(seriesModel)) { + seriesModel.name = getSeriesAutoName(seriesModel) || name; + } +} +function getSeriesAutoName(seriesModel) { + const data = seriesModel.getRawData(); + const dataDims = data.mapDimensionsAll("seriesName"); + const nameArr = []; + each(dataDims, function(dataDim) { + const dimInfo = data.getDimensionInfo(dataDim); + dimInfo.displayName && nameArr.push(dimInfo.displayName); + }); + return nameArr.join(" "); +} +function dataTaskCount(context) { + return context.model.getRawData().count(); +} +function dataTaskReset(context) { + const seriesModel = context.model; + seriesModel.setData(seriesModel.getRawData().cloneShallow()); + return dataTaskProgress; +} +function dataTaskProgress(param, context) { + if (context.outputData && param.end > context.outputData.count()) { + context.model.getRawData().cloneShallow(context.outputData); + } +} +function wrapData(data, seriesModel) { + each(concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function(methodName) { + data.wrapMethod(methodName, curry(onDataChange, seriesModel)); + }); +} +function onDataChange(seriesModel, newList) { + const task = getCurrentTask(seriesModel); + if (task) { + task.setOutputEnd((newList || this).count()); + } + return newList; +} +function getCurrentTask(seriesModel) { + const scheduler = (seriesModel.ecModel || {}).scheduler; + const pipeline = scheduler && scheduler.getPipeline(seriesModel.uid); + if (pipeline) { + let task = pipeline.currentTask; + if (task) { + const agentStubMap = task.agentStubMap; + if (agentStubMap) { + task = agentStubMap.get(seriesModel.uid); + } + } + return task; + } +} +var Series_default = SeriesModel; + +// src/view/Component.ts +var ComponentView = class { + constructor() { + this.group = new Group_default(); + this.uid = getUID("viewComponent"); + } + init(ecModel, api2) { + } + render(model, ecModel, api2, payload) { + } + dispose(ecModel, api2) { + } + updateView(model, ecModel, api2, payload) { + } + updateLayout(model, ecModel, api2, payload) { + } + updateVisual(model, ecModel, api2, payload) { + } + toggleBlurSeries(seriesModels, isBlur, ecModel) { + } + eachRendered(cb) { + const group = this.group; + if (group) { + group.traverse(cb); + } + } +}; +enableClassExtend(ComponentView); +enableClassManagement(ComponentView); +var Component_default2 = ComponentView; + +// src/chart/helper/createRenderPlanner.ts +function createRenderPlanner() { + const inner23 = makeInner(); + return function(seriesModel) { + const fields = inner23(seriesModel); + const pipelineContext = seriesModel.pipelineContext; + const originalLarge = !!fields.large; + const originalProgressive = !!fields.progressiveRender; + const large = fields.large = !!(pipelineContext && pipelineContext.large); + const progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender); + return !!(originalLarge !== large || originalProgressive !== progressive) && "reset"; + }; +} + +// src/view/Chart.ts +var inner3 = makeInner(); +var renderPlanner = createRenderPlanner(); +var ChartView2 = class { + constructor() { + this.group = new Group_default(); + this.uid = getUID("viewChart"); + this.renderTask = createTask({ + plan: renderTaskPlan, + reset: renderTaskReset + }); + this.renderTask.context = {view: this}; + } + init(ecModel, api2) { + } + render(seriesModel, ecModel, api2, payload) { + if (true) { + throw new Error("render method must been implemented"); + } + } + highlight(seriesModel, ecModel, api2, payload) { + const data = seriesModel.getData(payload && payload.dataType); + if (!data) { + if (true) { + error(`Unknown dataType ${payload.dataType}`); + } + return; + } + toggleHighlight(data, payload, "emphasis"); + } + downplay(seriesModel, ecModel, api2, payload) { + const data = seriesModel.getData(payload && payload.dataType); + if (!data) { + if (true) { + error(`Unknown dataType ${payload.dataType}`); + } + return; + } + toggleHighlight(data, payload, "normal"); + } + remove(ecModel, api2) { + this.group.removeAll(); + } + dispose(ecModel, api2) { + } + updateView(seriesModel, ecModel, api2, payload) { + this.render(seriesModel, ecModel, api2, payload); + } + updateLayout(seriesModel, ecModel, api2, payload) { + this.render(seriesModel, ecModel, api2, payload); + } + updateVisual(seriesModel, ecModel, api2, payload) { + this.render(seriesModel, ecModel, api2, payload); + } + eachRendered(cb) { + traverseElements(this.group, cb); + } + static markUpdateMethod(payload, methodName) { + inner3(payload).updateMethod = methodName; + } +}; +var ChartView = ChartView2; +ChartView.protoInitialize = function() { + const proto2 = ChartView2.prototype; + proto2.type = "chart"; +}(); +function elSetState(el, state, highlightDigit) { + if (el && isHighDownDispatcher(el)) { + (state === "emphasis" ? enterEmphasis : leaveEmphasis)(el, highlightDigit); + } +} +function toggleHighlight(data, payload, state) { + const dataIndex = queryDataIndex(data, payload); + const highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null; + if (dataIndex != null) { + each(normalizeToArray(dataIndex), function(dataIdx) { + elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit); + }); + } else { + data.eachItemGraphicEl(function(el) { + elSetState(el, state, highlightDigit); + }); + } +} +enableClassExtend(ChartView, ["dispose"]); +enableClassManagement(ChartView); +function renderTaskPlan(context) { + return renderPlanner(context.model); +} +function renderTaskReset(context) { + const seriesModel = context.model; + const ecModel = context.ecModel; + const api2 = context.api; + const payload = context.payload; + const progressiveRender = seriesModel.pipelineContext.progressiveRender; + const view = context.view; + const updateMethod = payload && inner3(payload).updateMethod; + const methodName = progressiveRender ? "incrementalPrepareRender" : updateMethod && view[updateMethod] ? updateMethod : "render"; + if (methodName !== "render") { + view[methodName](seriesModel, ecModel, api2, payload); + } + return progressMethodMap[methodName]; +} +var progressMethodMap = { + incrementalPrepareRender: { + progress: function(params, context) { + context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload); + } + }, + render: { + forceFirstProgress: true, + progress: function(params, context) { + context.view.render(context.model, context.ecModel, context.api, context.payload); + } + } +}; +var Chart_default = ChartView; + +// src/util/throttle.ts +var ORIGIN_METHOD = "\0__throttleOriginMethod"; +var RATE = "\0__throttleRate"; +var THROTTLE_TYPE = "\0__throttleType"; +function throttle(fn, delay, debounce) { + let currCall; + let lastCall = 0; + let lastExec = 0; + let timer = null; + let diff; + let scope; + let args; + let debounceNextCall; + delay = delay || 0; + function exec() { + lastExec = new Date().getTime(); + timer = null; + fn.apply(scope, args || []); + } + const cb = function(...cbArgs) { + currCall = new Date().getTime(); + scope = this; + args = cbArgs; + const thisDelay = debounceNextCall || delay; + const thisDebounce = debounceNextCall || debounce; + debounceNextCall = null; + diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay; + clearTimeout(timer); + if (thisDebounce) { + timer = setTimeout(exec, thisDelay); + } else { + if (diff >= 0) { + exec(); + } else { + timer = setTimeout(exec, -diff); + } + } + lastCall = currCall; + }; + cb.clear = function() { + if (timer) { + clearTimeout(timer); + timer = null; + } + }; + cb.debounceNextCall = function(debounceDelay) { + debounceNextCall = debounceDelay; + }; + return cb; +} +function createOrUpdate(obj, fnAttr, rate, throttleType) { + let fn = obj[fnAttr]; + if (!fn) { + return; + } + const originFn = fn[ORIGIN_METHOD] || fn; + const lastThrottleType = fn[THROTTLE_TYPE]; + const lastRate = fn[RATE]; + if (lastRate !== rate || lastThrottleType !== throttleType) { + if (rate == null || !throttleType) { + return obj[fnAttr] = originFn; + } + fn = obj[fnAttr] = throttle(originFn, rate, throttleType === "debounce"); + fn[ORIGIN_METHOD] = originFn; + fn[THROTTLE_TYPE] = throttleType; + fn[RATE] = rate; + } + return fn; +} +function clear(obj, fnAttr) { + const fn = obj[fnAttr]; + if (fn && fn[ORIGIN_METHOD]) { + fn.clear && fn.clear(); + obj[fnAttr] = fn[ORIGIN_METHOD]; + } +} + +// src/visual/style.ts +var inner4 = makeInner(); +var defaultStyleMappers = { + itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true), + lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true) +}; +var defaultColorKey = { + lineStyle: "stroke", + itemStyle: "fill" +}; +function getStyleMapper(seriesModel, stylePath) { + const styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath]; + if (!styleMapper) { + console.warn(`Unknown style type '${stylePath}'.`); + return defaultStyleMappers.itemStyle; + } + return styleMapper; +} +function getDefaultColorKey(seriesModel, stylePath) { + const colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath]; + if (!colorKey) { + console.warn(`Unknown style type '${stylePath}'.`); + return "fill"; + } + return colorKey; +} +var seriesStyleTask = { + createOnAllSeries: true, + performRawSeries: true, + reset(seriesModel, ecModel) { + const data = seriesModel.getData(); + const stylePath = seriesModel.visualStyleAccessPath || "itemStyle"; + const styleModel = seriesModel.getModel(stylePath); + const getStyle2 = getStyleMapper(seriesModel, stylePath); + const globalStyle = getStyle2(styleModel); + const decalOption = styleModel.getShallow("decal"); + if (decalOption) { + data.setVisual("decal", decalOption); + decalOption.dirty = true; + } + const colorKey = getDefaultColorKey(seriesModel, stylePath); + const color2 = globalStyle[colorKey]; + const colorCallback = isFunction(color2) ? color2 : null; + const hasAutoColor = globalStyle.fill === "auto" || globalStyle.stroke === "auto"; + if (!globalStyle[colorKey] || colorCallback || hasAutoColor) { + const colorPalette2 = seriesModel.getColorFromPalette(seriesModel.name, null, ecModel.getSeriesCount()); + if (!globalStyle[colorKey]) { + globalStyle[colorKey] = colorPalette2; + data.setVisual("colorFromPalette", true); + } + globalStyle.fill = globalStyle.fill === "auto" || isFunction(globalStyle.fill) ? colorPalette2 : globalStyle.fill; + globalStyle.stroke = globalStyle.stroke === "auto" || isFunction(globalStyle.stroke) ? colorPalette2 : globalStyle.stroke; + } + data.setVisual("style", globalStyle); + data.setVisual("drawType", colorKey); + if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) { + data.setVisual("colorFromPalette", false); + return { + dataEach(data2, idx) { + const dataParams = seriesModel.getDataParams(idx); + const itemStyle = extend({}, globalStyle); + itemStyle[colorKey] = colorCallback(dataParams); + data2.setItemVisual(idx, "style", itemStyle); + } + }; + } + } +}; +var sharedModel = new Model_default(); +var dataStyleTask = { + createOnAllSeries: true, + performRawSeries: true, + reset(seriesModel, ecModel) { + if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) { + return; + } + const data = seriesModel.getData(); + const stylePath = seriesModel.visualStyleAccessPath || "itemStyle"; + const getStyle2 = getStyleMapper(seriesModel, stylePath); + const colorKey = data.getVisual("drawType"); + return { + dataEach: data.hasItemOption ? function(data2, idx) { + const rawItem = data2.getRawDataItem(idx); + if (rawItem && rawItem[stylePath]) { + sharedModel.option = rawItem[stylePath]; + const style = getStyle2(sharedModel); + const existsStyle = data2.ensureUniqueItemVisual(idx, "style"); + extend(existsStyle, style); + if (sharedModel.option.decal) { + data2.setItemVisual(idx, "decal", sharedModel.option.decal); + sharedModel.option.decal.dirty = true; + } + if (colorKey in style) { + data2.setItemVisual(idx, "colorFromPalette", false); + } } - return color; + } : null + }; + } +}; +var dataColorPaletteTask = { + performRawSeries: true, + overallReset(ecModel) { + const paletteScopeGroupByType = createHashMap(); + ecModel.eachSeries((seriesModel) => { + const colorBy = seriesModel.getColorBy(); + if (seriesModel.isColorBySeries()) { + return; } - ecModel.eachSeriesByType('sunburst', function (seriesModel) { - var data = seriesModel.getData(); - var tree = data.tree; - tree.eachNode(function (node) { - var model = node.getModel(); - var style = model.getModel('itemStyle').getItemStyle(); - if (!style.fill) { - style.fill = pickColor(node, seriesModel, tree.root.height); - } - var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); - extend(existsStyle, style); - }); + const key = seriesModel.type + "-" + colorBy; + let colorScope = paletteScopeGroupByType.get(key); + if (!colorScope) { + colorScope = {}; + paletteScopeGroupByType.set(key, colorScope); + } + inner4(seriesModel).scope = colorScope; + }); + ecModel.eachSeries((seriesModel) => { + if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) { + return; + } + const dataAll = seriesModel.getRawData(); + const idxMap = {}; + const data = seriesModel.getData(); + const colorScope = inner4(seriesModel).scope; + const stylePath = seriesModel.visualStyleAccessPath || "itemStyle"; + const colorKey = getDefaultColorKey(seriesModel, stylePath); + data.each(function(idx) { + const rawIdx = data.getRawIndex(idx); + idxMap[rawIdx] = idx; }); - } - - function install$q(registers) { - registers.registerChartView(SunburstView); - registers.registerSeriesModel(SunburstSeriesModel); - registers.registerLayout(curry(sunburstLayout, 'sunburst')); - registers.registerProcessor(curry(dataFilter, 'sunburst')); - registers.registerVisual(sunburstVisual); - installSunburstAction(registers); - } - - // Also compat with ec4, where - // `visual('color') visual('borderColor')` is supported. - var STYLE_VISUAL_TYPE = { - color: 'fill', - borderColor: 'stroke' + dataAll.each(function(rawIdx) { + const idx = idxMap[rawIdx]; + const fromPalette = data.getItemVisual(idx, "colorFromPalette"); + if (fromPalette) { + const itemStyle = data.ensureUniqueItemVisual(idx, "style"); + const name = dataAll.getName(rawIdx) || rawIdx + ""; + const dataCount = dataAll.count(); + itemStyle[colorKey] = seriesModel.getColorFromPalette(name, colorScope, dataCount); + } + }); + }); + } +}; + +// src/loading/default.ts +var PI5 = Math.PI; +function defaultLoading(api2, opts) { + opts = opts || {}; + defaults(opts, { + text: "loading", + textColor: "#000", + fontSize: 12, + fontWeight: "normal", + fontStyle: "normal", + fontFamily: "sans-serif", + maskColor: "rgba(255, 255, 255, 0.8)", + showSpinner: true, + color: "#5470c6", + spinnerRadius: 10, + lineWidth: 5, + zlevel: 0 + }); + const group = new Group_default(); + const mask = new Rect_default({ + style: { + fill: opts.maskColor + }, + zlevel: opts.zlevel, + z: 1e4 + }); + group.add(mask); + const textContent = new Text_default({ + style: { + text: opts.text, + fill: opts.textColor, + fontSize: opts.fontSize, + fontWeight: opts.fontWeight, + fontStyle: opts.fontStyle, + fontFamily: opts.fontFamily + }, + zlevel: opts.zlevel, + z: 10001 + }); + const labelRect = new Rect_default({ + style: { + fill: "none" + }, + textContent, + textConfig: { + position: "right", + distance: 10 + }, + zlevel: opts.zlevel, + z: 10001 + }); + group.add(labelRect); + let arc2; + if (opts.showSpinner) { + arc2 = new Arc_default({ + shape: { + startAngle: -PI5 / 2, + endAngle: -PI5 / 2 + 0.1, + r: opts.spinnerRadius + }, + style: { + stroke: opts.color, + lineCap: "round", + lineWidth: opts.lineWidth + }, + zlevel: opts.zlevel, + z: 10001 + }); + arc2.animateShape(true).when(1e3, { + endAngle: PI5 * 3 / 2 + }).start("circularInOut"); + arc2.animateShape(true).when(1e3, { + startAngle: PI5 * 3 / 2 + }).delay(300).start("circularInOut"); + group.add(arc2); + } + group.resize = function() { + const textWidth = textContent.getBoundingRect().width; + const r = opts.showSpinner ? opts.spinnerRadius : 0; + const cx = (api2.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) + (opts.showSpinner ? 0 : textWidth / 2) + (textWidth ? 0 : r); + const cy = api2.getHeight() / 2; + opts.showSpinner && arc2.setShape({ + cx, + cy + }); + labelRect.setShape({ + x: cx - r, + y: cy - r, + width: r * 2, + height: r * 2 + }); + mask.setShape({ + x: 0, + y: 0, + width: api2.getWidth(), + height: api2.getHeight() + }); + }; + group.resize(); + return group; +} + +// src/core/Scheduler.ts +var Scheduler = class { + constructor(ecInstance, api2, dataProcessorHandlers, visualHandlers) { + this._stageTaskMap = createHashMap(); + this.ecInstance = ecInstance; + this.api = api2; + dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); + visualHandlers = this._visualHandlers = visualHandlers.slice(); + this._allHandlers = dataProcessorHandlers.concat(visualHandlers); + } + restoreData(ecModel, payload) { + ecModel.restoreData(payload); + this._stageTaskMap.each(function(taskRecord) { + const overallTask = taskRecord.overallTask; + overallTask && overallTask.dirty(); + }); + } + getPerformArgs(task, isBlock) { + if (!task.__pipeline) { + return; + } + const pipeline = this._pipelineMap.get(task.__pipeline.id); + const pCtx = pipeline.context; + const incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex; + const step = incremental ? pipeline.step : null; + const modDataCount = pCtx && pCtx.modDataCount; + const modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null; + return {step, modBy, modDataCount}; + } + getPipeline(pipelineId) { + return this._pipelineMap.get(pipelineId); + } + updateStreamModes(seriesModel, view) { + const pipeline = this._pipelineMap.get(seriesModel.uid); + const data = seriesModel.getData(); + const dataLen = data.count(); + const progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold; + const large = seriesModel.get("large") && dataLen >= seriesModel.get("largeThreshold"); + const modDataCount = seriesModel.get("progressiveChunkMode") === "mod" ? dataLen : null; + seriesModel.pipelineContext = pipeline.context = { + progressiveRender, + modDataCount, + large }; - var NON_STYLE_VISUAL_PROPS = { - symbol: 1, - symbolSize: 1, - symbolKeepAspect: 1, - legendIcon: 1, - visualMeta: 1, - liftZ: 1, - decal: 1 + } + restorePipelines(ecModel) { + const scheduler = this; + const pipelineMap = scheduler._pipelineMap = createHashMap(); + ecModel.eachSeries(function(seriesModel) { + const progressive = seriesModel.getProgressive(); + const pipelineId = seriesModel.uid; + pipelineMap.set(pipelineId, { + id: pipelineId, + head: null, + tail: null, + threshold: seriesModel.getProgressiveThreshold(), + progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()), + blockIndex: -1, + step: Math.round(progressive || 700), + count: 0 + }); + scheduler._pipe(seriesModel, seriesModel.dataTask); + }); + } + prepareStageTasks() { + const stageTaskMap = this._stageTaskMap; + const ecModel = this.api.getModel(); + const api2 = this.api; + each(this._allHandlers, function(handler) { + const record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {}); + let errMsg = ""; + if (true) { + errMsg = '"reset" and "overallReset" must not be both specified.'; + } + assert(!(handler.reset && handler.overallReset), errMsg); + handler.reset && this._createSeriesStageTask(handler, record, ecModel, api2); + handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api2); + }, this); + } + prepareView(view, model, ecModel, api2) { + const renderTask = view.renderTask; + const context = renderTask.context; + context.model = model; + context.ecModel = ecModel; + context.api = api2; + renderTask.__block = !view.incrementalPrepareRender; + this._pipe(model, renderTask); + } + performDataProcessorTasks(ecModel, payload) { + this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {block: true}); + } + performVisualTasks(ecModel, payload, opt) { + this._performStageTasks(this._visualHandlers, ecModel, payload, opt); + } + _performStageTasks(stageHandlers, ecModel, payload, opt) { + opt = opt || {}; + let unfinished = false; + const scheduler = this; + each(stageHandlers, function(stageHandler, idx) { + if (opt.visualType && opt.visualType !== stageHandler.visualType) { + return; + } + const stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid); + const seriesTaskMap = stageHandlerRecord.seriesTaskMap; + const overallTask = stageHandlerRecord.overallTask; + if (overallTask) { + let overallNeedDirty; + const agentStubMap = overallTask.agentStubMap; + agentStubMap.each(function(stub) { + if (needSetDirty(opt, stub)) { + stub.dirty(); + overallNeedDirty = true; + } + }); + overallNeedDirty && overallTask.dirty(); + scheduler.updatePayload(overallTask, payload); + const performArgs = scheduler.getPerformArgs(overallTask, opt.block); + agentStubMap.each(function(stub) { + stub.perform(performArgs); + }); + if (overallTask.perform(performArgs)) { + unfinished = true; + } + } else if (seriesTaskMap) { + seriesTaskMap.each(function(task, pipelineId) { + if (needSetDirty(opt, task)) { + task.dirty(); + } + const performArgs = scheduler.getPerformArgs(task, opt.block); + performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model); + scheduler.updatePayload(task, payload); + if (task.perform(performArgs)) { + unfinished = true; + } + }); + } + }); + function needSetDirty(opt2, task) { + return opt2.setDirty && (!opt2.dirtyMap || opt2.dirtyMap.get(task.__pipeline.id)); + } + this.unfinished = unfinished || this.unfinished; + } + performSeriesTasks(ecModel) { + let unfinished; + ecModel.eachSeries(function(seriesModel) { + unfinished = seriesModel.dataTask.perform() || unfinished; + }); + this.unfinished = unfinished || this.unfinished; + } + plan() { + this._pipelineMap.each(function(pipeline) { + let task = pipeline.tail; + do { + if (task.__block) { + pipeline.blockIndex = task.__idxInPipeline; + break; + } + task = task.getUpstream(); + } while (task); + }); + } + updatePayload(task, payload) { + payload !== "remain" && (task.context.payload = payload); + } + _createSeriesStageTask(stageHandler, stageHandlerRecord, ecModel, api2) { + const scheduler = this; + const oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; + const newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap(); + const seriesType2 = stageHandler.seriesType; + const getTargetSeries = stageHandler.getTargetSeries; + if (stageHandler.createOnAllSeries) { + ecModel.eachRawSeries(create4); + } else if (seriesType2) { + ecModel.eachRawSeriesByType(seriesType2, create4); + } else if (getTargetSeries) { + getTargetSeries(ecModel, api2).each(create4); + } + function create4(seriesModel) { + const pipelineId = seriesModel.uid; + const task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({ + plan: seriesTaskPlan, + reset: seriesTaskReset, + count: seriesTaskCount + })); + task.context = { + model: seriesModel, + ecModel, + api: api2, + useClearVisual: stageHandler.isVisual && !stageHandler.isLayout, + plan: stageHandler.plan, + reset: stageHandler.reset, + scheduler + }; + scheduler._pipe(seriesModel, task); + } + } + _createOverallStageTask(stageHandler, stageHandlerRecord, ecModel, api2) { + const scheduler = this; + const overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask || createTask({reset: overallTaskReset}); + overallTask.context = { + ecModel, + api: api2, + overallReset: stageHandler.overallReset, + scheduler }; - var customInnerStore = makeInner(); - var CustomSeriesModel = /** @class */function (_super) { - __extends(CustomSeriesModel, _super); - function CustomSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CustomSeriesModel.type; - return _this; - } - CustomSeriesModel.prototype.optionUpdated = function () { - this.currentZLevel = this.get('zlevel', true); - this.currentZ = this.get('z', true); - }; - CustomSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this); - }; - CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) { - var params = _super.prototype.getDataParams.call(this, dataIndex, dataType); - el && (params.info = customInnerStore(el).info); - return params; - }; - CustomSeriesModel.type = 'series.custom'; - CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; - CustomSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - legendHoverLink: true, - // Custom series will not clip by default. - // Some case will use custom series to draw label - // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight - clip: false - // Cartesian coordinate system - // xAxisIndex: 0, - // yAxisIndex: 0, - // Polar coordinate system - // polarIndex: 0, - // Geo coordinate system - // geoIndex: 0, - }; - - return CustomSeriesModel; - }(SeriesModel); - - function dataToCoordSize(dataSize, dataItem) { - // dataItem is necessary in log axis. - dataItem = dataItem || [0, 0]; - return 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); + const oldAgentStubMap = overallTask.agentStubMap; + const newAgentStubMap = overallTask.agentStubMap = createHashMap(); + const seriesType2 = stageHandler.seriesType; + const getTargetSeries = stageHandler.getTargetSeries; + let overallProgress = true; + let shouldOverallTaskDirty = false; + let errMsg = ""; + if (true) { + errMsg = '"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'; + } + assert(!stageHandler.createOnAllSeries, errMsg); + if (seriesType2) { + ecModel.eachRawSeriesByType(seriesType2, createStub); + } else if (getTargetSeries) { + getTargetSeries(ecModel, api2).each(createStub); + } else { + overallProgress = false; + each(ecModel.getSeries(), createStub); + } + function createStub(seriesModel) { + const pipelineId = seriesModel.uid; + const stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || (shouldOverallTaskDirty = true, createTask({reset: stubReset, onDirty: stubOnDirty}))); + stub.context = { + model: seriesModel, + overallProgress + }; + stub.agent = overallTask; + stub.__block = overallProgress; + scheduler._pipe(seriesModel, stub); + } + if (shouldOverallTaskDirty) { + overallTask.dirty(); + } + } + _pipe(seriesModel, task) { + const pipelineId = seriesModel.uid; + const pipeline = this._pipelineMap.get(pipelineId); + !pipeline.head && (pipeline.head = task); + pipeline.tail && pipeline.tail.pipe(task); + pipeline.tail = task; + task.__idxInPipeline = pipeline.count++; + task.__pipeline = pipeline; + } + static wrapStageHandler(stageHandler, visualType) { + if (isFunction(stageHandler)) { + stageHandler = { + overallReset: stageHandler, + seriesType: detectSeriseType(stageHandler) + }; + } + stageHandler.uid = getUID("stageHandler"); + visualType && (stageHandler.visualType = visualType); + return stageHandler; + } +}; +function overallTaskReset(context) { + context.overallReset(context.ecModel, context.api, context.payload); +} +function stubReset(context) { + return context.overallProgress && stubProgress; +} +function stubProgress() { + this.agent.dirty(); + this.getDownstream().dirty(); +} +function stubOnDirty() { + this.agent && this.agent.dirty(); +} +function seriesTaskPlan(context) { + return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null; +} +function seriesTaskReset(context) { + if (context.useClearVisual) { + context.data.clearAllVisual(); + } + const resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload)); + return resetDefines.length > 1 ? map(resetDefines, function(v, idx) { + return makeSeriesTaskProgress(idx); + }) : singleSeriesTaskProgress; +} +var singleSeriesTaskProgress = makeSeriesTaskProgress(0); +function makeSeriesTaskProgress(resetDefineIdx) { + return function(params, context) { + const data = context.data; + const resetDefine = context.resetDefines[resetDefineIdx]; + if (resetDefine && resetDefine.dataEach) { + for (let i = params.start; i < params.end; i++) { + resetDefine.dataEach(data, i); + } + } else if (resetDefine && resetDefine.progress) { + resetDefine.progress(params, data); + } + }; +} +function seriesTaskCount(context) { + return context.data.count(); +} +function detectSeriseType(legacyFunc) { + seriesType = null; + try { + legacyFunc(ecModelMock, apiMock); + } catch (e2) { + } + return seriesType; +} +var ecModelMock = {}; +var apiMock = {}; +var seriesType; +mockMethods(ecModelMock, Global_default); +mockMethods(apiMock, ExtensionAPI_default); +ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function(type) { + seriesType = type; +}; +ecModelMock.eachComponent = function(cond) { + if (cond.mainType === "series" && cond.subType) { + seriesType = cond.subType; + } +}; +function mockMethods(target, Clz) { + for (let name in Clz.prototype) { + target[name] = noop; + } +} +var Scheduler_default = Scheduler; + +// src/theme/light.ts +var colorAll = [ + "#37A2DA", + "#32C5E9", + "#67E0E3", + "#9FE6B8", + "#FFDB5C", + "#ff9f7f", + "#fb7293", + "#E062AE", + "#E690D1", + "#e7bcf3", + "#9d96f5", + "#8378EA", + "#96BFFF" +]; +var light_default = { + color: colorAll, + colorLayer: [ + ["#37A2DA", "#ffd85c", "#fd7b5f"], + ["#37A2DA", "#67E0E3", "#FFDB5C", "#ff9f7f", "#E062AE", "#9d96f5"], + ["#37A2DA", "#32C5E9", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#e7bcf3", "#8378EA", "#96BFFF"], + colorAll + ] +}; + +// src/theme/dark.ts +var contrastColor = "#B9B8CE"; +var backgroundColor = "#100C2A"; +var axisCommon = function() { + return { + axisLine: { + lineStyle: { + color: contrastColor + } + }, + splitLine: { + lineStyle: { + color: "#484753" + } + }, + splitArea: { + areaStyle: { + color: ["rgba(255,255,255,0.02)", "rgba(255,255,255,0.05)"] + } + }, + minorSplitLine: { + lineStyle: { + color: "#20203B" + } + } + }; +}; +var colorPalette = [ + "#4992ff", + "#7cffb2", + "#fddd60", + "#ff6e76", + "#58d9f9", + "#05c091", + "#ff8a45", + "#8d48e3", + "#dd79ff" +]; +var theme = { + darkMode: true, + color: colorPalette, + backgroundColor, + axisPointer: { + lineStyle: { + color: "#817f91" + }, + crossStyle: { + color: "#817f91" + }, + label: { + color: "#fff" } - function cartesianPrepareCustom(coordSys) { - var rect = coordSys.master.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: bind(dataToCoordSize, coordSys) - } - }; + }, + legend: { + textStyle: { + color: contrastColor + }, + pageTextStyle: { + color: contrastColor + } + }, + textStyle: { + color: contrastColor + }, + title: { + textStyle: { + color: "#EEF1FA" + }, + subtextStyle: { + color: "#B9B8CE" + } + }, + toolbox: { + iconStyle: { + borderColor: contrastColor + } + }, + dataZoom: { + borderColor: "#71708A", + textStyle: { + color: contrastColor + }, + brushStyle: { + color: "rgba(135,163,206,0.3)" + }, + handleStyle: { + color: "#353450", + borderColor: "#C5CBE3" + }, + moveHandleStyle: { + color: "#B0B6C3", + opacity: 0.3 + }, + fillerColor: "rgba(135,163,206,0.2)", + emphasis: { + handleStyle: { + borderColor: "#91B7F2", + color: "#4D587D" + }, + moveHandleStyle: { + color: "#636D9A", + opacity: 0.7 + } + }, + dataBackground: { + lineStyle: { + color: "#71708A", + width: 1 + }, + areaStyle: { + color: "#71708A" + } + }, + selectedDataBackground: { + lineStyle: { + color: "#87A3CE" + }, + areaStyle: { + color: "#87A3CE" + } } - - function dataToCoordSize$1(dataSize, dataItem) { - dataItem = dataItem || [0, 0]; - return map([0, 1], function (dimIdx) { - var val = dataItem[dimIdx]; - var halfSize = dataSize[dimIdx] / 2; - var p1 = []; - var p2 = []; - p1[dimIdx] = val - halfSize; - p2[dimIdx] = val + halfSize; - p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; - return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); - }, this); + }, + visualMap: { + textStyle: { + color: contrastColor } - function geoPrepareCustom(coordSys) { - var rect = coordSys.getBoundingRect(); - return { - coordSys: { - type: 'geo', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height, - zoom: coordSys.getZoom() - }, - api: { - coord: function (data) { - // do not provide "out" and noRoam param, - // Compatible with this usage: - // echarts.util.map(item.points, api.coord) - return coordSys.dataToPoint(data); - }, - size: bind(dataToCoordSize$1, coordSys) + }, + timeline: { + lineStyle: { + color: contrastColor + }, + label: { + color: contrastColor + }, + controlStyle: { + color: contrastColor, + borderColor: contrastColor + } + }, + calendar: { + itemStyle: { + color: backgroundColor + }, + dayLabel: { + color: contrastColor + }, + monthLabel: { + color: contrastColor + }, + yearLabel: { + color: contrastColor + } + }, + timeAxis: axisCommon(), + logAxis: axisCommon(), + valueAxis: axisCommon(), + categoryAxis: axisCommon(), + line: { + symbol: "circle" + }, + graph: { + color: colorPalette + }, + gauge: { + title: { + color: contrastColor + }, + axisLine: { + lineStyle: { + color: [[1, "rgba(207,212,219,0.2)"]] + } + }, + axisLabel: { + color: contrastColor + }, + detail: { + color: "#EEF1FA" + } + }, + candlestick: { + itemStyle: { + color: "#f64e56", + color0: "#54ea92", + borderColor: "#f64e56", + borderColor0: "#54ea92" + } + } +}; +theme.categoryAxis.splitLine.show = false; +var dark_default = theme; + +// src/util/ECEventProcessor.ts +var ECEventProcessor = class { + normalizeQuery(query) { + const cptQuery = {}; + const dataQuery = {}; + const otherQuery = {}; + if (isString(query)) { + const condCptType = parseClassType(query); + cptQuery.mainType = condCptType.main || null; + cptQuery.subType = condCptType.sub || null; + } else { + const suffixes = ["Index", "Name", "Id"]; + const dataKeys = {name: 1, dataIndex: 1, dataType: 1}; + each(query, function(val, key) { + let reserved = false; + for (let i = 0; i < suffixes.length; i++) { + const propSuffix = suffixes[i]; + const suffixPos = key.lastIndexOf(propSuffix); + if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) { + const mainType = key.slice(0, suffixPos); + if (mainType !== "data") { + cptQuery.mainType = mainType; + cptQuery[propSuffix.toLowerCase()] = val; + reserved = true; + } + } } - }; + if (dataKeys.hasOwnProperty(key)) { + dataQuery[key] = val; + reserved = true; + } + if (!reserved) { + otherQuery[key] = val; + } + }); } - - function dataToCoordSize$2(dataSize, dataItem) { - // dataItem is necessary in log axis. - var axis = this.getAxis(); - var val = dataItem instanceof Array ? dataItem[0] : dataItem; - var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2; - return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); + return { + cptQuery, + dataQuery, + otherQuery + }; + } + filter(eventType, query) { + const eventInfo = this.eventInfo; + if (!eventInfo) { + return true; } - function singlePrepareCustom(coordSys) { - var rect = coordSys.getRect(); - return { - coordSys: { - type: 'singleAxis', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - }, - api: { - coord: function (val) { - // do not provide "out" param - return coordSys.dataToPoint(val); - }, - size: bind(dataToCoordSize$2, coordSys) - } - }; + const targetEl = eventInfo.targetEl; + const packedEvent = eventInfo.packedEvent; + const model = eventInfo.model; + const view = eventInfo.view; + if (!model || !view) { + return true; } - - // import AngleAxis from './AngleAxis.js'; - function dataToCoordSize$3(dataSize, dataItem) { - // dataItem is necessary in log axis. - dataItem = dataItem || [0, 0]; - return map(['Radius', 'Angle'], function (dim, dimIdx) { - var getterName = 'get' + dim + 'Axis'; - // TODO: TYPE Check Angle Axis - var axis = this[getterName](); - var val = dataItem[dimIdx]; - var halfSize = dataSize[dimIdx] / 2; - var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); - if (dim === 'Angle') { - result = result * Math.PI / 180; + const cptQuery = query.cptQuery; + const dataQuery = query.dataQuery; + return check(cptQuery, model, "mainType") && check(cptQuery, model, "subType") && check(cptQuery, model, "index", "componentIndex") && check(cptQuery, model, "name") && check(cptQuery, model, "id") && check(dataQuery, packedEvent, "name") && check(dataQuery, packedEvent, "dataIndex") && check(dataQuery, packedEvent, "dataType") && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent)); + function check(query2, host, prop, propOnHost) { + return query2[prop] == null || host[propOnHost || prop] === query2[prop]; + } + } + afterTrigger() { + this.eventInfo = null; + } +}; + +// src/visual/symbol.ts +var SYMBOL_PROPS_WITH_CB = [ + "symbol", + "symbolSize", + "symbolRotate", + "symbolOffset" +]; +var SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat([ + "symbolKeepAspect" +]); +var seriesSymbolTask = { + createOnAllSeries: true, + performRawSeries: true, + reset: function(seriesModel, ecModel) { + const data = seriesModel.getData(); + if (seriesModel.legendIcon) { + data.setVisual("legendIcon", seriesModel.legendIcon); + } + if (!seriesModel.hasSymbolVisual) { + return; + } + const symbolOptions = {}; + const symbolOptionsCb = {}; + let hasCallback = false; + for (let i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) { + const symbolPropName = SYMBOL_PROPS_WITH_CB[i]; + const val = seriesModel.get(symbolPropName); + if (isFunction(val)) { + hasCallback = true; + symbolOptionsCb[symbolPropName] = val; + } else { + symbolOptions[symbolPropName] = val; + } + } + symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol; + data.setVisual(extend({ + legendIcon: seriesModel.legendIcon || symbolOptions.symbol, + symbolKeepAspect: seriesModel.get("symbolKeepAspect") + }, symbolOptions)); + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } + const symbolPropsCb = keys(symbolOptionsCb); + function dataEach(data2, idx) { + const rawValue = seriesModel.getRawValue(idx); + const params = seriesModel.getDataParams(idx); + for (let i = 0; i < symbolPropsCb.length; i++) { + const symbolPropName = symbolPropsCb[i]; + data2.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params)); + } + } + return {dataEach: hasCallback ? dataEach : null}; + } +}; +var dataSymbolTask = { + createOnAllSeries: true, + performRawSeries: true, + reset: function(seriesModel, ecModel) { + if (!seriesModel.hasSymbolVisual) { + return; + } + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } + const data = seriesModel.getData(); + function dataEach(data2, idx) { + const itemModel = data2.getItemModel(idx); + for (let i = 0; i < SYMBOL_PROPS.length; i++) { + const symbolPropName = SYMBOL_PROPS[i]; + const val = itemModel.getShallow(symbolPropName, true); + if (val != null) { + data2.setItemVisual(idx, symbolPropName, val); + } + } + } + return {dataEach: data.hasItemOption ? dataEach : null}; + } +}; + +// src/visual/helper.ts +function getItemVisualFromData(data, dataIndex, key) { + switch (key) { + case "color": + const style = data.getItemVisual(dataIndex, "style"); + return style[data.getVisual("drawType")]; + case "opacity": + return data.getItemVisual(dataIndex, "style").opacity; + case "symbol": + case "symbolSize": + case "liftZ": + return data.getItemVisual(dataIndex, key); + default: + if (true) { + console.warn(`Unknown visual type ${key}`); + } + } +} +function getVisualFromData(data, key) { + switch (key) { + case "color": + const style = data.getVisual("style"); + return style[data.getVisual("drawType")]; + case "opacity": + return data.getVisual("style").opacity; + case "symbol": + case "symbolSize": + case "liftZ": + return data.getVisual(key); + default: + if (true) { + console.warn(`Unknown visual type ${key}`); + } + } +} +function setItemVisualFromData(data, dataIndex, key, value) { + switch (key) { + case "color": + const style = data.ensureUniqueItemVisual(dataIndex, "style"); + style[data.getVisual("drawType")] = value; + data.setItemVisual(dataIndex, "colorFromPalette", false); + break; + case "opacity": + data.ensureUniqueItemVisual(dataIndex, "style").opacity = value; + break; + case "symbol": + case "symbolSize": + case "liftZ": + data.setItemVisual(dataIndex, key, value); + break; + default: + if (true) { + console.warn(`Unknown visual type ${key}`); + } + } +} + +// src/legacy/dataSelectAction.ts +function createLegacyDataSelectAction(seriesType2, ecRegisterAction) { + function getSeriesIndices(ecModel, payload) { + const seriesIndices = []; + ecModel.eachComponent({ + mainType: "series", + subType: seriesType2, + query: payload + }, function(seriesModel) { + seriesIndices.push(seriesModel.seriesIndex); + }); + return seriesIndices; + } + each([ + [seriesType2 + "ToggleSelect", "toggleSelect"], + [seriesType2 + "Select", "select"], + [seriesType2 + "UnSelect", "unselect"] + ], function(eventsMap) { + ecRegisterAction(eventsMap[0], function(payload, ecModel, api2) { + payload = extend({}, payload); + if (true) { + deprecateReplaceLog(payload.type, eventsMap[1]); + } + api2.dispatchAction(extend(payload, { + type: eventsMap[1], + seriesIndex: getSeriesIndices(ecModel, payload) + })); + }); + }); +} +function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) { + const legacyEventName = type + eventPostfix; + if (!ecIns.isSilent(legacyEventName)) { + if (true) { + deprecateLog(`event ${legacyEventName} is deprecated.`); + } + ecModel.eachComponent({ + mainType: "series", + subType: "pie" + }, function(seriesModel) { + const seriesIndex = seriesModel.seriesIndex; + const selectedMap = seriesModel.option.selectedMap; + const selected = payload.selected; + for (let i = 0; i < selected.length; i++) { + if (selected[i].seriesIndex === seriesIndex) { + const data = seriesModel.getData(); + const dataIndex = queryDataIndex(data, payload.fromActionPayload); + ecIns.trigger(legacyEventName, { + type: legacyEventName, + seriesId: seriesModel.id, + name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex), + selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap) + }); } - return result; - }, this); + } + }); + } +} +function handleLegacySelectEvents(messageCenter, ecIns, api2) { + messageCenter.on("selectchanged", function(params) { + const ecModel = api2.getModel(); + if (params.isFromClick) { + handleSeriesLegacySelectEvents("map", "selectchanged", ecIns, ecModel, params); + handleSeriesLegacySelectEvents("pie", "selectchanged", ecIns, ecModel, params); + } else if (params.fromAction === "select") { + handleSeriesLegacySelectEvents("map", "selected", ecIns, ecModel, params); + handleSeriesLegacySelectEvents("pie", "selected", ecIns, ecModel, params); + } else if (params.fromAction === "unselect") { + handleSeriesLegacySelectEvents("map", "unselected", ecIns, ecModel, params); + handleSeriesLegacySelectEvents("pie", "unselected", ecIns, ecModel, params); + } + }); +} + +// src/util/event.ts +function findEventDispatcher(target, det, returnFirstMatch) { + let found; + while (target) { + if (det(target)) { + found = target; + if (returnFirstMatch) { + break; + } + } + target = target.__hostTarget || target.parent; + } + return found; +} + +// node_modules/zrender/src/core/WeakMap.ts +var wmUniqueIndex = Math.round(Math.random() * 9); +var supportDefineProperty = typeof Object.defineProperty === "function"; +var WeakMap = class { + constructor() { + this._id = "__ec_inner_" + wmUniqueIndex++; + } + get(key) { + return this._guard(key)[this._id]; + } + set(key, value) { + const target = this._guard(key); + if (supportDefineProperty) { + Object.defineProperty(target, this._id, { + value, + enumerable: false, + configurable: true + }); + } else { + target[this._id] = value; + } + return this; + } + delete(key) { + if (this.has(key)) { + delete this._guard(key)[this._id]; + return true; } - function polarPrepareCustom(coordSys) { - var radiusAxis = coordSys.getRadiusAxis(); - var angleAxis = coordSys.getAngleAxis(); - var radius = radiusAxis.getExtent(); - radius[0] > radius[1] && radius.reverse(); - return { - coordSys: { - type: 'polar', - cx: coordSys.cx, - cy: coordSys.cy, - r: radius[1], - r0: radius[0] - }, - api: { - coord: function (data) { - var radius = radiusAxis.dataToRadius(data[0]); - var angle = angleAxis.dataToAngle(data[1]); - var coord = coordSys.coordToPoint([radius, angle]); - coord.push(radius, angle * Math.PI / 180); - return coord; - }, - size: bind(dataToCoordSize$3, coordSys) - } - }; + return false; + } + has(key) { + return !!this._guard(key)[this._id]; + } + _guard(key) { + if (key !== Object(key)) { + throw TypeError("Value of WeakMap is not a non-null object."); + } + return key; + } +}; +var WeakMap_default = WeakMap; + +// src/util/symbol.ts +var Triangle = Path_default.extend({ + type: "triangle", + shape: { + cx: 0, + cy: 0, + width: 0, + height: 0 + }, + buildPath: function(path, shape) { + const cx = shape.cx; + const cy = shape.cy; + const width = shape.width / 2; + const height = shape.height / 2; + path.moveTo(cx, cy - height); + path.lineTo(cx + width, cy + height); + path.lineTo(cx - width, cy + height); + path.closePath(); + } +}); +var Diamond = Path_default.extend({ + type: "diamond", + shape: { + cx: 0, + cy: 0, + width: 0, + height: 0 + }, + buildPath: function(path, shape) { + const cx = shape.cx; + const cy = shape.cy; + const width = shape.width / 2; + const 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(); + } +}); +var Pin = Path_default.extend({ + type: "pin", + shape: { + x: 0, + y: 0, + width: 0, + height: 0 + }, + buildPath: function(path, shape) { + const x = shape.x; + const y = shape.y; + const w = shape.width / 5 * 3; + const h = Math.max(w, shape.height); + const r = w / 2; + const dy = r * r / (h - r); + const cy = y - h + r + dy; + const angle = Math.asin(dy / r); + const dx = Math.cos(angle) * r; + const tanX = Math.sin(angle); + const tanY = Math.cos(angle); + const cpLen = r * 0.6; + const 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(); + } +}); +var Arrow = Path_default.extend({ + type: "arrow", + shape: { + x: 0, + y: 0, + width: 0, + height: 0 + }, + buildPath: function(ctx, shape) { + const height = shape.height; + const width = shape.width; + const x = shape.x; + const y = shape.y; + const 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(); + } +}); +var symbolCtors = { + line: Line_default, + rect: Rect_default, + roundRect: Rect_default, + square: Rect_default, + circle: Circle_default, + diamond: Diamond, + pin: Pin, + arrow: Arrow, + triangle: Triangle +}; +var symbolShapeMakers = { + line: function(x, y, w, h, shape) { + 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) { + const size = Math.min(w, h); + shape.x = x; + shape.y = y; + shape.width = size; + shape.height = size; + }, + circle: function(x, y, w, h, shape) { + 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 = {}; +each(symbolCtors, function(Ctor, name) { + symbolBuildProxies[name] = new Ctor(); +}); +var SymbolClz = Path_default.extend({ + type: "symbol", + shape: { + symbolType: "", + x: 0, + y: 0, + width: 0, + height: 0 + }, + calculateTextPosition(out2, config, rect) { + const res = calculateTextPosition(out2, config, rect); + const shape = this.shape; + if (shape && shape.symbolType === "pin" && config.position === "inside") { + res.y = rect.y + rect.height * 0.4; + } + return res; + }, + buildPath(ctx, shape, inBundle) { + let symbolType = shape.symbolType; + if (symbolType !== "none") { + let proxySymbol = symbolBuildProxies[symbolType]; + if (!proxySymbol) { + symbolType = "rect"; + proxySymbol = symbolBuildProxies[symbolType]; + } + symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape); + proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle); + } + } +}); +function symbolPathSetColor(color2, innerColor2) { + if (this.type !== "image") { + const symbolStyle = this.style; + if (this.__isEmptyBrush) { + symbolStyle.stroke = color2; + symbolStyle.fill = innerColor2 || "#fff"; + symbolStyle.lineWidth = 2; + } else if (this.shape.symbolType === "line") { + symbolStyle.stroke = color2; + } else { + symbolStyle.fill = color2; + } + this.markRedraw(); + } +} +function createSymbol(symbolType, x, y, w, h, color2, keepAspect) { + const isEmpty = symbolType.indexOf("empty") === 0; + if (isEmpty) { + symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6); + } + let symbolPath; + if (symbolType.indexOf("image://") === 0) { + symbolPath = makeImage(symbolType.slice(8), new BoundingRect_default(x, y, w, h), keepAspect ? "center" : "cover"); + } else if (symbolType.indexOf("path://") === 0) { + symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect_default(x, y, w, h), keepAspect ? "center" : "cover"); + } else { + symbolPath = new SymbolClz({ + shape: { + symbolType, + x, + y, + width: w, + height: h + } + }); + } + symbolPath.__isEmptyBrush = isEmpty; + symbolPath.setColor = symbolPathSetColor; + if (color2) { + symbolPath.setColor(color2); + } + return symbolPath; +} +function normalizeSymbolSize(symbolSize) { + if (!isArray(symbolSize)) { + symbolSize = [+symbolSize, +symbolSize]; + } + return [symbolSize[0] || 0, symbolSize[1] || 0]; +} +function normalizeSymbolOffset(symbolOffset, symbolSize) { + if (symbolOffset == null) { + return; + } + if (!isArray(symbolOffset)) { + symbolOffset = [symbolOffset, symbolOffset]; + } + return [ + parsePercent2(symbolOffset[0], symbolSize[0]) || 0, + parsePercent2(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0 + ]; +} + +// node_modules/zrender/src/canvas/helper.ts +function isSafeNum(num) { + return isFinite(num); +} +function createLinearGradient(ctx, obj, rect) { + let x = obj.x == null ? 0 : obj.x; + let x2 = obj.x2 == null ? 1 : obj.x2; + let y = obj.y == null ? 0 : obj.y; + let y2 = obj.y2 == null ? 0 : obj.y2; + if (!obj.global) { + x = x * rect.width + rect.x; + x2 = x2 * rect.width + rect.x; + y = y * rect.height + rect.y; + y2 = y2 * rect.height + rect.y; + } + x = isSafeNum(x) ? x : 0; + x2 = isSafeNum(x2) ? x2 : 1; + y = isSafeNum(y) ? y : 0; + y2 = isSafeNum(y2) ? y2 : 0; + const canvasGradient = ctx.createLinearGradient(x, y, x2, y2); + return canvasGradient; +} +function createRadialGradient(ctx, obj, rect) { + const width = rect.width; + const height = rect.height; + const min3 = Math.min(width, height); + let x = obj.x == null ? 0.5 : obj.x; + let y = obj.y == null ? 0.5 : obj.y; + let r = obj.r == null ? 0.5 : obj.r; + if (!obj.global) { + x = x * width + rect.x; + y = y * height + rect.y; + r = r * min3; + } + x = isSafeNum(x) ? x : 0.5; + y = isSafeNum(y) ? y : 0.5; + r = r >= 0 && isSafeNum(r) ? r : 0.5; + const canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r); + return canvasGradient; +} +function getCanvasGradient(ctx, obj, rect) { + const canvasGradient = obj.type === "radial" ? createRadialGradient(ctx, obj, rect) : createLinearGradient(ctx, obj, rect); + const colorStops = obj.colorStops; + for (let i = 0; i < colorStops.length; i++) { + canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color); + } + return canvasGradient; +} +function isClipPathChanged(clipPaths, prevClipPaths) { + if (clipPaths === prevClipPaths || !clipPaths && !prevClipPaths) { + return false; + } + if (!clipPaths || !prevClipPaths || clipPaths.length !== prevClipPaths.length) { + return true; + } + for (let i = 0; i < clipPaths.length; i++) { + if (clipPaths[i] !== prevClipPaths[i]) { + return true; } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 calendarPrepareCustom(coordSys) { - var rect = coordSys.getRect(); - var rangeInfo = coordSys.getRangeInfo(); - return { - coordSys: { - type: 'calendar', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height, - cellWidth: coordSys.getCellWidth(), - cellHeight: coordSys.getCellHeight(), - rangeInfo: { - start: rangeInfo.start, - end: rangeInfo.end, - weeks: rangeInfo.weeks, - dayCount: rangeInfo.allDay - } - }, - api: { - coord: function (data, clamp) { - return coordSys.dataToPoint(data, clamp); - } - } - }; + } + return false; +} +function parseInt10(val) { + return parseInt(val, 10); +} +function getSize(root, whIdx, opts) { + const wh = ["width", "height"][whIdx]; + const cwh = ["clientWidth", "clientHeight"][whIdx]; + const plt = ["paddingLeft", "paddingTop"][whIdx]; + const prb = ["paddingRight", "paddingBottom"][whIdx]; + if (opts[wh] != null && opts[wh] !== "auto") { + return parseFloat(opts[wh]); + } + const stl = document.defaultView.getComputedStyle(root); + return (root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh])) - (parseInt10(stl[plt]) || 0) - (parseInt10(stl[prb]) || 0) | 0; +} + +// node_modules/zrender/src/canvas/dashStyle.ts +function normalizeLineDash(lineType, lineWidth) { + if (!lineType || lineType === "solid" || !(lineWidth > 0)) { + return null; + } + return lineType === "dashed" ? [4 * lineWidth, 2 * lineWidth] : lineType === "dotted" ? [lineWidth] : isNumber(lineType) ? [lineType] : isArray(lineType) ? lineType : null; +} +function getLineDash(el) { + const style = el.style; + let lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth); + let lineDashOffset = style.lineDashOffset; + if (lineDash) { + const lineScale = style.strokeNoScale && el.getLineScale ? el.getLineScale() : 1; + if (lineScale && lineScale !== 1) { + lineDash = map(lineDash, function(rawVal) { + return rawVal / lineScale; + }); + lineDashOffset /= lineScale; + } + } + return [lineDash, lineDashOffset]; +} + +// node_modules/zrender/src/canvas/graphic.ts +var pathProxyForDraw = new PathProxy_default(true); +function styleHasStroke(style) { + const stroke = style.stroke; + return !(stroke == null || stroke === "none" || !(style.lineWidth > 0)); +} +function isValidStrokeFillStyle(strokeOrFill) { + return typeof strokeOrFill === "string" && strokeOrFill !== "none"; +} +function styleHasFill(style) { + const fill = style.fill; + return fill != null && fill !== "none"; +} +function doFillPath(ctx, style) { + if (style.fillOpacity != null && style.fillOpacity !== 1) { + const originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.fillOpacity * style.opacity; + ctx.fill(); + ctx.globalAlpha = originalGlobalAlpha; + } else { + ctx.fill(); + } +} +function doStrokePath(ctx, style) { + if (style.strokeOpacity != null && style.strokeOpacity !== 1) { + const originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.strokeOpacity * style.opacity; + ctx.stroke(); + ctx.globalAlpha = originalGlobalAlpha; + } else { + ctx.stroke(); + } +} +function createCanvasPattern(ctx, pattern, el) { + const image = createOrUpdateImage(pattern.image, pattern.__image, el); + if (isImageReady(image)) { + const canvasPattern = ctx.createPattern(image, pattern.repeat || "repeat"); + if (typeof DOMMatrix === "function" && canvasPattern && canvasPattern.setTransform) { + const matrix13 = new DOMMatrix(); + matrix13.translateSelf(pattern.x || 0, pattern.y || 0); + matrix13.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE); + matrix13.scaleSelf(pattern.scaleX || 1, pattern.scaleY || 1); + canvasPattern.setTransform(matrix13); + } + return canvasPattern; + } +} +function brushPath(ctx, el, style, inBatch) { + let hasStroke = styleHasStroke(style); + let hasFill = styleHasFill(style); + const strokePercent = style.strokePercent; + const strokePart = strokePercent < 1; + const firstDraw = !el.path; + if ((!el.silent || strokePart) && firstDraw) { + el.createPathProxy(); + } + const path = el.path || pathProxyForDraw; + const dirtyFlag = el.__dirty; + if (!inBatch) { + const fill = style.fill; + const stroke = style.stroke; + const hasFillGradient = hasFill && !!fill.colorStops; + const hasStrokeGradient = hasStroke && !!stroke.colorStops; + const hasFillPattern = hasFill && !!fill.image; + const hasStrokePattern = hasStroke && !!stroke.image; + let fillGradient; + let strokeGradient; + let fillPattern; + let strokePattern; + let rect; + if (hasFillGradient || hasStrokeGradient) { + rect = el.getBoundingRect(); + } + if (hasFillGradient) { + fillGradient = dirtyFlag ? getCanvasGradient(ctx, fill, rect) : el.__canvasFillGradient; + el.__canvasFillGradient = fillGradient; + } + if (hasStrokeGradient) { + strokeGradient = dirtyFlag ? getCanvasGradient(ctx, stroke, rect) : el.__canvasStrokeGradient; + el.__canvasStrokeGradient = strokeGradient; + } + if (hasFillPattern) { + fillPattern = dirtyFlag || !el.__canvasFillPattern ? createCanvasPattern(ctx, fill, el) : el.__canvasFillPattern; + el.__canvasFillPattern = fillPattern; + } + if (hasStrokePattern) { + strokePattern = dirtyFlag || !el.__canvasStrokePattern ? createCanvasPattern(ctx, stroke, el) : el.__canvasStrokePattern; + el.__canvasStrokePattern = fillPattern; + } + if (hasFillGradient) { + ctx.fillStyle = fillGradient; + } else if (hasFillPattern) { + if (fillPattern) { + ctx.fillStyle = fillPattern; + } else { + hasFill = false; + } } - - var deprecatedLogs = {}; - /** - * Whether need to call `convertEC4CompatibleStyle`. - */ - function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) { - // Since echarts5, `RectText` is separated from its host element and style.text - // does not exist any more. The compat work brings some extra burden on performance. - // So we provide: - // `legacy: true` force make compat. - // `legacy: false`, force do not compat. - // `legacy` not set: auto detect whether legacy. - // But in this case we do not compat (difficult to detect and rare case): - // Becuse custom series and graphic component support "merge", users may firstly - // only set `textStrokeWidth` style or secondly only set `text`. - return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan' - // Difficult to detect whether legacy for a "text" el. - && (elType === 'text' || hasOwn(style, 'text'))); - } - /** - * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format. - * @param hostStyle The properties might be modified. - * @return If be text el, `textContentStyle` and `textConfig` will not be returned. - * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area - * retried from the `hostStyle`. - */ - function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) { - var srcStyle = hostStyle; - var textConfig; - var textContent; - var textContentStyle; - if (elType === 'text') { - textContentStyle = srcStyle; + if (hasStrokeGradient) { + ctx.strokeStyle = strokeGradient; + } else if (hasStrokePattern) { + if (strokePattern) { + ctx.strokeStyle = strokePattern; } else { - textContentStyle = {}; - hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text); - hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich); - hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill); - hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke); - hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily); - hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize); - hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle); - hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight); - textContent = { - type: 'text', - style: textContentStyle, - // ec4 does not support rectText trigger. - // And when text position is different in normal and emphasis - // => hover text trigger emphasis; - // => text position changed, leave mouse pointer immediately; - // That might cause incorrect state. - silent: true - }; - textConfig = {}; - var hasOwnPos = hasOwn(srcStyle, 'textPosition'); - if (isNormal) { - textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside'; - } else { - hasOwnPos && (textConfig.position = srcStyle.textPosition); + hasStroke = false; + } + } + } + const scale4 = el.getGlobalScale(); + path.setScale(scale4[0], scale4[1], el.segmentIgnoreThreshold); + let lineDash; + let lineDashOffset; + if (ctx.setLineDash && style.lineDash) { + [lineDash, lineDashOffset] = getLineDash(el); + } + let needsRebuild = true; + if (firstDraw || dirtyFlag & SHAPE_CHANGED_BIT) { + path.setDPR(ctx.dpr); + if (strokePart) { + path.setContext(null); + } else { + path.setContext(ctx); + needsRebuild = false; + } + path.reset(); + el.buildPath(path, el.shape, inBatch); + path.toStatic(); + el.pathUpdated(); + } + if (needsRebuild) { + path.rebuildPath(ctx, strokePart ? strokePercent : 1); + } + if (lineDash) { + ctx.setLineDash(lineDash); + ctx.lineDashOffset = lineDashOffset; + } + if (!inBatch) { + if (style.strokeFirst) { + if (hasStroke) { + doStrokePath(ctx, style); + } + if (hasFill) { + doFillPath(ctx, style); + } + } else { + if (hasFill) { + doFillPath(ctx, style); + } + if (hasStroke) { + doStrokePath(ctx, style); + } + } + } + if (lineDash) { + ctx.setLineDash([]); + } +} +function brushImage(ctx, el, style) { + const image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload); + if (!image || !isImageReady(image)) { + return; + } + const x = style.x || 0; + const y = style.y || 0; + let width = el.getWidth(); + let height = el.getHeight(); + const aspect = image.width / image.height; + if (width == null && height != null) { + width = height * aspect; + } else if (height == null && width != null) { + height = width / aspect; + } else if (width == null && height == null) { + width = image.width; + height = image.height; + } + if (style.sWidth && style.sHeight) { + const sx = style.sx || 0; + const sy = style.sy || 0; + ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height); + } else if (style.sx && style.sy) { + const sx = style.sx; + const sy = style.sy; + const sWidth = width - sx; + const sHeight = height - sy; + ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height); + } else { + ctx.drawImage(image, x, y, width, height); + } +} +function brushText(ctx, el, style) { + let text = style.text; + text != null && (text += ""); + if (text) { + ctx.font = style.font || DEFAULT_FONT; + ctx.textAlign = style.textAlign; + ctx.textBaseline = style.textBaseline; + let lineDash; + let lineDashOffset; + if (ctx.setLineDash && style.lineDash) { + [lineDash, lineDashOffset] = getLineDash(el); + } + if (lineDash) { + ctx.setLineDash(lineDash); + ctx.lineDashOffset = lineDashOffset; + } + if (style.strokeFirst) { + if (styleHasStroke(style)) { + ctx.strokeText(text, style.x, style.y); + } + if (styleHasFill(style)) { + ctx.fillText(text, style.x, style.y); + } + } else { + if (styleHasFill(style)) { + ctx.fillText(text, style.x, style.y); + } + if (styleHasStroke(style)) { + ctx.strokeText(text, style.x, style.y); + } + } + if (lineDash) { + ctx.setLineDash([]); + } + } +} +var SHADOW_NUMBER_PROPS = ["shadowBlur", "shadowOffsetX", "shadowOffsetY"]; +var STROKE_PROPS = [ + ["lineCap", "butt"], + ["lineJoin", "miter"], + ["miterLimit", 10] +]; +function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) { + let styleChanged = false; + if (!forceSetAll) { + prevStyle = prevStyle || {}; + if (style === prevStyle) { + return false; + } + } + if (forceSetAll || style.opacity !== prevStyle.opacity) { + flushPathDrawn(ctx, scope); + styleChanged = true; + const opacity = Math.max(Math.min(style.opacity, 1), 0); + ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity; + } + if (forceSetAll || style.blend !== prevStyle.blend) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend; + } + for (let i = 0; i < SHADOW_NUMBER_PROPS.length; i++) { + const propName = SHADOW_NUMBER_PROPS[i]; + if (forceSetAll || style[propName] !== prevStyle[propName]) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + ctx[propName] = ctx.dpr * (style[propName] || 0); + } + } + if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor; + } + return styleChanged; +} +function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) { + const style = getStyle(el, scope.inHover); + const prevStyle = forceSetAll ? null : prevEl && getStyle(prevEl, scope.inHover) || {}; + if (style === prevStyle) { + return false; + } + let styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope); + if (forceSetAll || style.fill !== prevStyle.fill) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill); + } + if (forceSetAll || style.stroke !== prevStyle.stroke) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke); + } + if (forceSetAll || style.opacity !== prevStyle.opacity) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + ctx.globalAlpha = style.opacity == null ? 1 : style.opacity; + } + if (el.hasStroke()) { + const lineWidth = style.lineWidth; + const newLineWidth = lineWidth / (style.strokeNoScale && el.getLineScale ? el.getLineScale() : 1); + if (ctx.lineWidth !== newLineWidth) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + ctx.lineWidth = newLineWidth; + } + } + for (let i = 0; i < STROKE_PROPS.length; i++) { + const prop = STROKE_PROPS[i]; + const propName = prop[0]; + if (forceSetAll || style[propName] !== prevStyle[propName]) { + if (!styleChanged) { + flushPathDrawn(ctx, scope); + styleChanged = true; + } + ctx[propName] = style[propName] || prop[1]; + } + } + return styleChanged; +} +function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) { + return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope); +} +function setContextTransform(ctx, el) { + const m2 = el.transform; + const dpr2 = ctx.dpr || 1; + if (m2) { + ctx.setTransform(dpr2 * m2[0], dpr2 * m2[1], dpr2 * m2[2], dpr2 * m2[3], dpr2 * m2[4], dpr2 * m2[5]); + } else { + ctx.setTransform(dpr2, 0, 0, dpr2, 0, 0); + } +} +function updateClipStatus(clipPaths, ctx, scope) { + let allClipped = false; + for (let i = 0; i < clipPaths.length; i++) { + const clipPath = clipPaths[i]; + allClipped = allClipped || clipPath.isZeroArea(); + setContextTransform(ctx, clipPath); + ctx.beginPath(); + clipPath.buildPath(ctx, clipPath.shape); + ctx.clip(); + } + scope.allClipped = allClipped; +} +function isTransformChanged(m0, m1) { + if (m0 && m1) { + return m0[0] !== m1[0] || m0[1] !== m1[1] || m0[2] !== m1[2] || m0[3] !== m1[3] || m0[4] !== m1[4] || m0[5] !== m1[5]; + } else if (!m0 && !m1) { + return false; + } + return true; +} +var DRAW_TYPE_PATH = 1; +var DRAW_TYPE_IMAGE = 2; +var DRAW_TYPE_TEXT = 3; +var DRAW_TYPE_INCREMENTAL = 4; +function canPathBatch(style) { + const hasFill = styleHasFill(style); + const hasStroke = styleHasStroke(style); + return !(style.lineDash || !(+hasFill ^ +hasStroke) || hasFill && typeof style.fill !== "string" || hasStroke && typeof style.stroke !== "string" || style.strokePercent < 1 || style.strokeOpacity < 1 || style.fillOpacity < 1); +} +function flushPathDrawn(ctx, scope) { + scope.batchFill && ctx.fill(); + scope.batchStroke && ctx.stroke(); + scope.batchFill = ""; + scope.batchStroke = ""; +} +function getStyle(el, inHover) { + return inHover ? el.__hoverStyle || el.style : el.style; +} +function brushSingle(ctx, el) { + brush(ctx, el, {inHover: false, viewWidth: 0, viewHeight: 0}, true); +} +function brush(ctx, el, scope, isLast) { + const m2 = el.transform; + if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) { + el.__dirty &= ~REDRAW_BIT; + el.__isRendered = false; + return; + } + const clipPaths = el.__clipPaths; + const prevElClipPaths = scope.prevElClipPaths; + let forceSetTransform = false; + let forceSetStyle = false; + if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) { + if (prevElClipPaths && prevElClipPaths.length) { + flushPathDrawn(ctx, scope); + ctx.restore(); + forceSetStyle = forceSetTransform = true; + scope.prevElClipPaths = null; + scope.allClipped = false; + scope.prevEl = null; + } + if (clipPaths && clipPaths.length) { + flushPathDrawn(ctx, scope); + ctx.save(); + updateClipStatus(clipPaths, ctx, scope); + forceSetTransform = true; + } + scope.prevElClipPaths = clipPaths; + } + if (scope.allClipped) { + el.__isRendered = false; + return; + } + el.beforeBrush && el.beforeBrush(); + el.innerBeforeBrush(); + const prevEl = scope.prevEl; + if (!prevEl) { + forceSetStyle = forceSetTransform = true; + } + let canBatchPath = el instanceof Path_default && el.autoBatch && canPathBatch(el.style); + if (forceSetTransform || isTransformChanged(m2, prevEl.transform)) { + flushPathDrawn(ctx, scope); + setContextTransform(ctx, el); + } else if (!canBatchPath) { + flushPathDrawn(ctx, scope); + } + const style = getStyle(el, scope.inHover); + if (el instanceof Path_default) { + if (scope.lastDrawType !== DRAW_TYPE_PATH) { + forceSetStyle = true; + scope.lastDrawType = DRAW_TYPE_PATH; + } + bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope); + if (!canBatchPath || !scope.batchFill && !scope.batchStroke) { + ctx.beginPath(); + } + brushPath(ctx, el, style, canBatchPath); + if (canBatchPath) { + scope.batchFill = style.fill || ""; + scope.batchStroke = style.stroke || ""; + } + } else { + if (el instanceof TSpan_default) { + if (scope.lastDrawType !== DRAW_TYPE_TEXT) { + forceSetStyle = true; + scope.lastDrawType = DRAW_TYPE_TEXT; + } + bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope); + brushText(ctx, el, style); + } else if (el instanceof Image_default) { + if (scope.lastDrawType !== DRAW_TYPE_IMAGE) { + forceSetStyle = true; + scope.lastDrawType = DRAW_TYPE_IMAGE; + } + bindImageStyle(ctx, el, prevEl, forceSetStyle, scope); + brushImage(ctx, el, style); + } else if (el.getTemporalDisplayables) { + if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) { + forceSetStyle = true; + scope.lastDrawType = DRAW_TYPE_INCREMENTAL; + } + brushIncremental(ctx, el, scope); + } + } + if (canBatchPath && isLast) { + flushPathDrawn(ctx, scope); + } + el.innerAfterBrush(); + el.afterBrush && el.afterBrush(); + scope.prevEl = el; + el.__dirty = 0; + el.__isRendered = true; +} +function brushIncremental(ctx, el, scope) { + let displayables = el.getDisplayables(); + let temporalDisplayables = el.getTemporalDisplayables(); + ctx.save(); + let innerScope = { + prevElClipPaths: null, + prevEl: null, + allClipped: false, + viewWidth: scope.viewWidth, + viewHeight: scope.viewHeight, + inHover: scope.inHover + }; + let i; + let len2; + for (i = el.getCursor(), len2 = displayables.length; i < len2; i++) { + const displayable = displayables[i]; + displayable.beforeBrush && displayable.beforeBrush(); + displayable.innerBeforeBrush(); + brush(ctx, displayable, innerScope, i === len2 - 1); + displayable.innerAfterBrush(); + displayable.afterBrush && displayable.afterBrush(); + innerScope.prevEl = displayable; + } + for (let i2 = 0, len3 = temporalDisplayables.length; i2 < len3; i2++) { + const displayable = temporalDisplayables[i2]; + displayable.beforeBrush && displayable.beforeBrush(); + displayable.innerBeforeBrush(); + brush(ctx, displayable, innerScope, i2 === len3 - 1); + displayable.innerAfterBrush(); + displayable.afterBrush && displayable.afterBrush(); + innerScope.prevEl = displayable; + } + el.clearTemporalDisplayables(); + el.notClear = true; + ctx.restore(); +} + +// src/util/decal.ts +var decalMap = new WeakMap_default(); +var decalCache = new LRU_default(100); +var decalKeys = [ + "symbol", + "symbolSize", + "symbolKeepAspect", + "color", + "backgroundColor", + "dashArrayX", + "dashArrayY", + "maxTileWidth", + "maxTileHeight" +]; +function createOrUpdatePatternFromDecal(decalObject, api2) { + if (decalObject === "none") { + return null; + } + const dpr2 = api2.getDevicePixelRatio(); + const zr = api2.getZr(); + const isSVG = zr.painter.type === "svg"; + if (decalObject.dirty) { + decalMap.delete(decalObject); + } + const oldPattern = decalMap.get(decalObject); + if (oldPattern) { + return oldPattern; + } + const decalOpt = defaults(decalObject, { + symbol: "rect", + symbolSize: 1, + symbolKeepAspect: true, + color: "rgba(0, 0, 0, 0.2)", + backgroundColor: null, + dashArrayX: 5, + dashArrayY: 5, + rotation: 0, + maxTileWidth: 512, + maxTileHeight: 512 + }); + if (decalOpt.backgroundColor === "none") { + decalOpt.backgroundColor = null; + } + const pattern = {repeat: "repeat"}; + setPatternnSource(pattern); + pattern.rotation = decalOpt.rotation; + pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr2; + decalMap.set(decalObject, pattern); + decalObject.dirty = false; + return pattern; + function setPatternnSource(pattern2) { + const keys2 = [dpr2]; + let isValidKey = true; + for (let i = 0; i < decalKeys.length; ++i) { + const value = decalOpt[decalKeys[i]]; + if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== "boolean") { + isValidKey = false; + break; + } + keys2.push(value); + } + let cacheKey; + if (isValidKey) { + cacheKey = keys2.join(",") + (isSVG ? "-svg" : ""); + const cache = decalCache.get(cacheKey); + if (cache) { + isSVG ? pattern2.svgElement = cache : pattern2.image = cache; + } + } + const dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX); + const dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY); + const symbolArray = normalizeSymbolArray(decalOpt.symbol); + const lineBlockLengthsX = getLineBlockLengthX(dashArrayX); + const lineBlockLengthY = getLineBlockLengthY(dashArrayY); + const canvas = !isSVG && platformApi.createCanvas(); + const svgRoot = isSVG && { + tag: "g", + attrs: {}, + key: "dcl", + children: [] + }; + const pSize = getPatternSize(); + let ctx; + if (canvas) { + canvas.width = pSize.width * dpr2; + canvas.height = pSize.height * dpr2; + ctx = canvas.getContext("2d"); + } + brushDecal(); + if (isValidKey) { + decalCache.put(cacheKey, canvas || svgRoot); + } + pattern2.image = canvas; + pattern2.svgElement = svgRoot; + pattern2.svgWidth = pSize.width; + pattern2.svgHeight = pSize.height; + function getPatternSize() { + let width = 1; + for (let i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) { + width = getLeastCommonMultiple(width, lineBlockLengthsX[i]); + } + let symbolRepeats = 1; + for (let i = 0, xlen = symbolArray.length; i < xlen; ++i) { + symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length); + } + width *= symbolRepeats; + const height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length; + if (true) { + const warn2 = (attrName) => { + console.warn(`Calculated decal size is greater than ${attrName} due to decal option settings so ${attrName} is used for the decal size. Please consider changing the decal option to make a smaller decal or set ${attrName} to be larger to avoid incontinuity.`); + }; + if (width > decalOpt.maxTileWidth) { + warn2("maxTileWidth"); + } + if (height > decalOpt.maxTileHeight) { + warn2("maxTileHeight"); } - hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition); - hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset); - hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation); - hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance); } - convertEC4CompatibleRichItem(textContentStyle, hostStyle); - each(textContentStyle.rich, function (richItem) { - convertEC4CompatibleRichItem(richItem, richItem); - }); return { - textConfig: textConfig, - textContent: textContent + width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)), + height: Math.max(1, Math.min(height, decalOpt.maxTileHeight)) }; } - /** - * The result will be set to `out`. - */ - function convertEC4CompatibleRichItem(out, richItem) { - if (!richItem) { - return; - } - // (1) For simplicity, make textXXX properties (deprecated since ec5) has - // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10` - // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached - // richText in ec5. - // (2) `out === richItem` if and only if `out` is text el or rich item. - // So we can overwrite existing props in `out` since textXXX has higher priority. - richItem.font = richItem.textFont || richItem.font; - hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth); - hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign); - hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign); - hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight); - hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth); - hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight); - hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor); - hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding); - hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor); - hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth); - hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius); - hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor); - hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur); - hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX); - hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY); - } - /** - * Convert to pure echarts4 format style. - * `itemStyle` will be modified, added with ec4 style properties from - * `textStyle` and `textConfig`. - * - * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where - * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke. - */ - function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) { - var out = itemStl; - // See `custom.ts`, a trick to set extra `textPosition` firstly. - out.textPosition = out.textPosition || txCfg.position || 'inside'; - txCfg.offset != null && (out.textOffset = txCfg.offset); - txCfg.rotation != null && (out.textRotation = txCfg.rotation); - txCfg.distance != null && (out.textDistance = txCfg.distance); - var isInside = out.textPosition.indexOf('inside') >= 0; - var hostFill = itemStl.fill || '#000'; - convertToEC4RichItem(out, txStl); - var textFillNotSet = out.textFill == null; - if (isInside) { - if (textFillNotSet) { - out.textFill = txCfg.insideFill || '#fff'; - !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke); - !out.textStroke && (out.textStroke = hostFill); - out.textStrokeWidth == null && (out.textStrokeWidth = 2); - } - } else { - if (textFillNotSet) { - out.textFill = itemStl.fill || txCfg.outsideFill || '#000'; + function brushDecal() { + if (ctx) { + ctx.clearRect(0, 0, canvas.width, canvas.height); + if (decalOpt.backgroundColor) { + ctx.fillStyle = decalOpt.backgroundColor; + ctx.fillRect(0, 0, canvas.width, canvas.height); } - !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke); } - out.text = txStl.text; - out.rich = txStl.rich; - each(txStl.rich, function (richItem) { - convertToEC4RichItem(richItem, richItem); - }); - return out; - } - function convertToEC4RichItem(out, richItem) { - if (!richItem) { + let ySum = 0; + for (let i = 0; i < dashArrayY.length; ++i) { + ySum += dashArrayY[i]; + } + if (ySum <= 0) { return; } - hasOwn(richItem, 'fill') && (out.textFill = richItem.fill); - hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill); - hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth); - hasOwn(richItem, 'font') && (out.font = richItem.font); - hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle); - hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight); - hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize); - hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily); - hasOwn(richItem, 'align') && (out.textAlign = richItem.align); - hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign); - hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight); - hasOwn(richItem, 'width') && (out.textWidth = richItem.width); - hasOwn(richItem, 'height') && (out.textHeight = richItem.height); - hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor); - hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding); - hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor); - hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth); - hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius); - hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor); - hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur); - hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX); - hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY); - hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor); - hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur); - hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX); - hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY); - } - function warnDeprecated(deprecated, insteadApproach) { - if ("development" !== 'production') { - var key = deprecated + '^_^' + insteadApproach; - if (!deprecatedLogs[key]) { - console.warn("[ECharts] DEPRECATED: \"" + deprecated + "\" has been deprecated. " + insteadApproach); - deprecatedLogs[key] = true; - } - } - } - - var LEGACY_TRANSFORM_PROPS_MAP = { - position: ['x', 'y'], - scale: ['scaleX', 'scaleY'], - origin: ['originX', 'originY'] - }; - var LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP); - var TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) { - obj[key] = 1; - return obj; - }, {}); - var transformPropNamesStr = TRANSFORMABLE_PROPS.join(', '); - // '' means root - var ELEMENT_ANIMATABLE_PROPS = ['', 'style', 'shape', 'extra']; - var transitionInnerStore = makeInner(); - function getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) { - var animationProp = animationType + "Animation"; - var config = getAnimationConfig(animationType, parentModel, dataIndex) || {}; - var userDuring = transitionInnerStore(el).userDuring; - // Only set when duration is > 0 and it's need to be animated. - if (config.duration > 0) { - // For simplicity, if during not specified, the previous during will not work any more. - config.during = userDuring ? bind(duringCall, { - el: el, - userDuring: userDuring - }) : null; - config.setToFinal = true; - config.scope = animationType; - } - extend(config, elOption[animationProp]); - return config; - } - function applyUpdateTransition(el, elOption, animatableModel, opts) { - opts = opts || {}; - var dataIndex = opts.dataIndex, - isInit = opts.isInit, - clearStyle = opts.clearStyle; - var hasAnimation = animatableModel.isAnimationEnabled(); - // Save the meta info for further morphing. Like apply on the sub morphing elements. - var store = transitionInnerStore(el); - var styleOpt = elOption.style; - store.userDuring = elOption.during; - var transFromProps = {}; - var propsToSet = {}; - prepareTransformAllPropsFinal(el, elOption, propsToSet); - prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet); - prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet); - if (!isInit && hasAnimation) { - prepareTransformTransitionFrom(el, elOption, transFromProps); - prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps); - prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps); - prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps); - } - propsToSet.style = styleOpt; - applyPropsDirectly(el, propsToSet, clearStyle); - applyMiscProps(el, elOption); - if (hasAnimation) { - if (isInit) { - var enterFromProps_1 = {}; - each(ELEMENT_ANIMATABLE_PROPS, function (propName) { - var prop = propName ? elOption[propName] : elOption; - if (prop && prop.enterFrom) { - if (propName) { - enterFromProps_1[propName] = enterFromProps_1[propName] || {}; - } - extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom); + let y = -lineBlockLengthY; + let yId = 0; + let yIdTotal = 0; + let xId0 = 0; + while (y < pSize.height) { + if (yId % 2 === 0) { + const symbolYId = yIdTotal / 2 % symbolArray.length; + let x = 0; + let xId1 = 0; + let xId1Total = 0; + while (x < pSize.width * 2) { + let xSum = 0; + for (let i = 0; i < dashArrayX[xId0].length; ++i) { + xSum += dashArrayX[xId0][i]; + } + if (xSum <= 0) { + break; + } + if (xId1 % 2 === 0) { + const size = (1 - decalOpt.symbolSize) * 0.5; + const left = x + dashArrayX[xId0][xId1] * size; + const top = y + dashArrayY[yId] * size; + const width = dashArrayX[xId0][xId1] * decalOpt.symbolSize; + const height = dashArrayY[yId] * decalOpt.symbolSize; + const symbolXId = xId1Total / 2 % symbolArray[symbolYId].length; + brushSymbol(left, top, width, height, symbolArray[symbolYId][symbolXId]); + } + x += dashArrayX[xId0][xId1]; + ++xId1Total; + ++xId1; + if (xId1 === dashArrayX[xId0].length) { + xId1 = 0; } - }); - var config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex); - if (config.duration > 0) { - el.animateFrom(enterFromProps_1, config); - } - } else { - applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps); - } - } - // Store leave to be used in leave transition. - updateLeaveTo(el, elOption); - styleOpt ? el.dirty() : el.markRedraw(); - } - function updateLeaveTo(el, elOption) { - // Try merge to previous set leaveTo - var leaveToProps = transitionInnerStore(el).leaveToProps; - for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) { - var propName = ELEMENT_ANIMATABLE_PROPS[i]; - var prop = propName ? elOption[propName] : elOption; - if (prop && prop.leaveTo) { - if (!leaveToProps) { - leaveToProps = transitionInnerStore(el).leaveToProps = {}; } - if (propName) { - leaveToProps[propName] = leaveToProps[propName] || {}; + ++xId0; + if (xId0 === dashArrayX.length) { + xId0 = 0; } - extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo); + } + y += dashArrayY[yId]; + ++yIdTotal; + ++yId; + if (yId === dashArrayY.length) { + yId = 0; } } - } - function applyLeaveTransition(el, elOption, animatableModel, onRemove) { - if (el) { - var parent_1 = el.parent; - var leaveToProps = transitionInnerStore(el).leaveToProps; - if (leaveToProps) { - // TODO TODO use leave after leaveAnimation in series is introduced - // TODO Data index? - var config = getElementAnimationConfig('update', el, elOption, animatableModel, 0); - config.done = function () { - parent_1.remove(el); - onRemove && onRemove(); - }; - el.animateTo(leaveToProps, config); - } else { - parent_1.remove(el); - onRemove && onRemove(); - } - } - } - function isTransitionAll(transition) { - return transition === 'all'; - } - function applyPropsDirectly(el, - // Can be null/undefined - allPropsFinal, clearStyle) { - var styleOpt = allPropsFinal.style; - if (!el.isGroup && styleOpt) { - if (clearStyle) { - el.useStyle({}); - // When style object changed, how to trade the existing animation? - // It is probably complicated and not needed to cover all the cases. - // But still need consider the case: - // (1) When using init animation on `style.opacity`, and before the animation - // ended users triggers an update by mousewhel. At that time the init - // animation should better be continued rather than terminated. - // So after `useStyle` called, we should change the animation target manually - // to continue the effect of the init animation. - // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need - // to update the value to `val2` and no animation declared, should be terminate - // the previous animation or just modify the target of the animation? - // Therotically That will happen not only on `style` but also on `shape` and - // `transfrom` props. But we haven't handle this case at present yet. - // (3) PENDING: Is it proper to visit `animators` and `targetName`? - var animators = el.animators; - for (var i = 0; i < animators.length; i++) { - var animator = animators[i]; - // targetName is the "topKey". - if (animator.targetName === 'style') { - animator.changeTarget(el.style); - } + function brushSymbol(x, y2, width, height, symbolType) { + const scale4 = isSVG ? 1 : dpr2; + const symbol = createSymbol(symbolType, x * scale4, y2 * scale4, width * scale4, height * scale4, decalOpt.color, decalOpt.symbolKeepAspect); + if (isSVG) { + const symbolVNode = zr.painter.renderOneToVNode(symbol); + if (symbolVNode) { + svgRoot.children.push(symbolVNode); } + } else { + brushSingle(ctx, symbol); + } + } + } + } +} +function normalizeSymbolArray(symbol) { + if (!symbol || symbol.length === 0) { + return [["rect"]]; + } + if (isString(symbol)) { + return [[symbol]]; + } + let isAllString = true; + for (let i = 0; i < symbol.length; ++i) { + if (!isString(symbol[i])) { + isAllString = false; + break; + } + } + if (isAllString) { + return normalizeSymbolArray([symbol]); + } + const result = []; + for (let i = 0; i < symbol.length; ++i) { + if (isString(symbol[i])) { + result.push([symbol[i]]); + } else { + result.push(symbol[i]); + } + } + return result; +} +function normalizeDashArrayX(dash) { + if (!dash || dash.length === 0) { + return [[0, 0]]; + } + if (isNumber(dash)) { + const dashValue = Math.ceil(dash); + return [[dashValue, dashValue]]; + } + let isAllNumber = true; + for (let i = 0; i < dash.length; ++i) { + if (!isNumber(dash[i])) { + isAllNumber = false; + break; + } + } + if (isAllNumber) { + return normalizeDashArrayX([dash]); + } + const result = []; + for (let i = 0; i < dash.length; ++i) { + if (isNumber(dash[i])) { + const dashValue = Math.ceil(dash[i]); + result.push([dashValue, dashValue]); + } else { + const dashValue = map(dash[i], (n) => Math.ceil(n)); + if (dashValue.length % 2 === 1) { + result.push(dashValue.concat(dashValue)); + } else { + result.push(dashValue); + } + } + } + return result; +} +function normalizeDashArrayY(dash) { + if (!dash || typeof dash === "object" && dash.length === 0) { + return [0, 0]; + } + if (isNumber(dash)) { + const dashValue2 = Math.ceil(dash); + return [dashValue2, dashValue2]; + } + const dashValue = map(dash, (n) => Math.ceil(n)); + return dash.length % 2 ? dashValue.concat(dashValue) : dashValue; +} +function getLineBlockLengthX(dash) { + return map(dash, function(line2) { + return getLineBlockLengthY(line2); + }); +} +function getLineBlockLengthY(dash) { + let blockLength = 0; + for (let i = 0; i < dash.length; ++i) { + blockLength += dash[i]; + } + if (dash.length % 2 === 1) { + return blockLength * 2; + } + return blockLength; +} + +// src/visual/decal.ts +function decalVisual(ecModel, api2) { + ecModel.eachRawSeries((seriesModel) => { + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } + const data = seriesModel.getData(); + if (data.hasItemVisual()) { + data.each((idx) => { + const decal2 = data.getItemVisual(idx, "decal"); + if (decal2) { + const itemStyle = data.ensureUniqueItemVisual(idx, "style"); + itemStyle.decal = createOrUpdatePatternFromDecal(decal2, api2); } - el.setStyle(styleOpt); - } - if (allPropsFinal) { - // Not set style here. - allPropsFinal.style = null; - // Set el to the final state firstly. - allPropsFinal && el.attr(allPropsFinal); - allPropsFinal.style = styleOpt; - } + }); } - function applyPropsTransition(el, elOption, dataIndex, model, - // Can be null/undefined - transFromProps) { - if (transFromProps) { - var config = getElementAnimationConfig('update', el, elOption, model, dataIndex); - if (config.duration > 0) { - el.animateFrom(transFromProps, config); + const decal = data.getVisual("decal"); + if (decal) { + const style = data.getVisual("style"); + style.decal = createOrUpdatePatternFromDecal(decal, api2); + } + }); +} + +// src/core/lifecycle.ts +var lifecycle = new Eventful_default(); +var lifecycle_default = lifecycle; + +// src/core/impl.ts +var implsStore = {}; +function registerImpl(name, impl) { + if (true) { + if (implsStore[name]) { + error(`Already has an implementation of ${name}.`); + } + } + implsStore[name] = impl; +} +function getImpl(name) { + if (true) { + if (!implsStore[name]) { + error(`Implementation of ${name} doesn't exists.`); + } + } + return implsStore[name]; +} + +// src/core/echarts.ts +var version2 = "5.5.1"; +var dependencies = { + zrender: "5.6.0" +}; +var TEST_FRAME_REMAIN_TIME = 1; +var PRIORITY_PROCESSOR_SERIES_FILTER = 800; +var PRIORITY_PROCESSOR_DATASTACK = 900; +var PRIORITY_PROCESSOR_FILTER = 1e3; +var PRIORITY_PROCESSOR_DEFAULT = 2e3; +var PRIORITY_PROCESSOR_STATISTIC = 5e3; +var PRIORITY_VISUAL_LAYOUT = 1e3; +var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100; +var PRIORITY_VISUAL_GLOBAL = 2e3; +var PRIORITY_VISUAL_CHART = 3e3; +var PRIORITY_VISUAL_COMPONENT = 4e3; +var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500; +var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600; +var PRIORITY_VISUAL_BRUSH = 5e3; +var PRIORITY_VISUAL_ARIA = 6e3; +var PRIORITY_VISUAL_DECAL = 7e3; +var PRIORITY = { + PROCESSOR: { + FILTER: PRIORITY_PROCESSOR_FILTER, + SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER, + STATISTIC: PRIORITY_PROCESSOR_STATISTIC + }, + VISUAL: { + LAYOUT: PRIORITY_VISUAL_LAYOUT, + PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT, + GLOBAL: PRIORITY_VISUAL_GLOBAL, + CHART: PRIORITY_VISUAL_CHART, + POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT, + COMPONENT: PRIORITY_VISUAL_COMPONENT, + BRUSH: PRIORITY_VISUAL_BRUSH, + CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM, + ARIA: PRIORITY_VISUAL_ARIA, + DECAL: PRIORITY_VISUAL_DECAL + } +}; +var IN_MAIN_PROCESS_KEY = "__flagInMainProcess"; +var PENDING_UPDATE = "__pendingUpdate"; +var STATUS_NEEDS_UPDATE_KEY = "__needsUpdateStatus"; +var ACTION_REG = /^[a-zA-Z0-9_]+$/; +var CONNECT_STATUS_KEY = "__connectUpdateStatus"; +var CONNECT_STATUS_PENDING = 0; +var CONNECT_STATUS_UPDATING = 1; +var CONNECT_STATUS_UPDATED = 2; +function createRegisterEventWithLowercaseECharts(method) { + return function(...args) { + if (this.isDisposed()) { + disposedWarning(this.id); + return; + } + return toLowercaseNameAndCallEventful(this, method, args); + }; +} +function createRegisterEventWithLowercaseMessageCenter(method) { + return function(...args) { + return toLowercaseNameAndCallEventful(this, method, args); + }; +} +function toLowercaseNameAndCallEventful(host, method, args) { + args[0] = args[0] && args[0].toLowerCase(); + return Eventful_default.prototype[method].apply(host, args); +} +var MessageCenter = class extends Eventful_default { +}; +var messageCenterProto = MessageCenter.prototype; +messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter("on"); +messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter("off"); +var prepare; +var prepareView; +var updateDirectly; +var updateMethods; +var doConvertPixel; +var updateStreamModes; +var doDispatchAction; +var flushPendingActions; +var triggerUpdatedEvent; +var bindRenderedEvent; +var bindMouseEvent; +var render; +var renderComponents; +var renderSeries; +var createExtensionAPI; +var enableConnect; +var markStatusToUpdate; +var applyChangedStates; +var ECharts = class extends Eventful_default { + constructor(dom, theme2, opts) { + super(new ECEventProcessor()); + this._chartsViews = []; + this._chartsMap = {}; + this._componentsViews = []; + this._componentsMap = {}; + this._pendingActions = []; + opts = opts || {}; + if (isString(theme2)) { + theme2 = themeStorage[theme2]; + } + this._dom = dom; + let defaultRenderer = "canvas"; + let defaultCoarsePointer = "auto"; + let defaultUseDirtyRect = false; + if (true) { + const root = env_default.hasGlobalWindow ? window : global; + if (root) { + defaultRenderer = retrieve2(root.__ECHARTS__DEFAULT__RENDERER__, defaultRenderer); + defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer); + defaultUseDirtyRect = retrieve2(root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__, defaultUseDirtyRect); + } + } + if (opts.ssr) { + registerSSRDataGetter((el) => { + const ecData = getECData(el); + const dataIndex = ecData.dataIndex; + if (dataIndex == null) { + return; } - } + const hashMap = createHashMap(); + hashMap.set("series_index", ecData.seriesIndex); + hashMap.set("data_index", dataIndex); + ecData.ssrType && hashMap.set("ssr_type", ecData.ssrType); + return hashMap; + }); } - function applyMiscProps(el, elOption) { - // Merge by default. - hasOwn(elOption, 'silent') && (el.silent = elOption.silent); - hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore); - if (el instanceof Displayable) { - hasOwn(elOption, 'invisible') && (el.invisible = elOption.invisible); - } - if (el instanceof Path) { - hasOwn(elOption, 'autoBatch') && (el.autoBatch = elOption.autoBatch); + const zr = this._zr = init(dom, { + renderer: opts.renderer || defaultRenderer, + devicePixelRatio: opts.devicePixelRatio, + width: opts.width, + height: opts.height, + ssr: opts.ssr, + useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect), + useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer), + pointerSize: opts.pointerSize + }); + this._ssr = opts.ssr; + this._throttledZrFlush = throttle(bind(zr.flush, zr), 17); + theme2 = clone(theme2); + theme2 && globalBackwardCompat(theme2, true); + this._theme = theme2; + this._locale = createLocaleObject(opts.locale || SYSTEM_LANG); + this._coordSysMgr = new CoordinateSystem_default(); + const api2 = this._api = createExtensionAPI(this); + function prioritySortFunc(a, b) { + return a.__prio - b.__prio; + } + sort(visualFuncs, prioritySortFunc); + sort(dataProcessorFuncs, prioritySortFunc); + this._scheduler = new Scheduler_default(this, api2, dataProcessorFuncs, visualFuncs); + this._messageCenter = new MessageCenter(); + this._initEvents(); + this.resize = bind(this.resize, this); + zr.animation.on("frame", this._onframe, this); + bindRenderedEvent(zr, this); + bindMouseEvent(zr, this); + setAsPrimitive(this); + } + _onframe() { + if (this._disposed) { + return; + } + applyChangedStates(this); + const scheduler = this._scheduler; + if (this[PENDING_UPDATE]) { + const silent = this[PENDING_UPDATE].silent; + this[IN_MAIN_PROCESS_KEY] = true; + try { + prepare(this); + updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams); + } catch (e2) { + this[IN_MAIN_PROCESS_KEY] = false; + this[PENDING_UPDATE] = null; + throw e2; + } + this._zr.flush(); + this[IN_MAIN_PROCESS_KEY] = false; + this[PENDING_UPDATE] = null; + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + } else if (scheduler.unfinished) { + let remainTime = TEST_FRAME_REMAIN_TIME; + const ecModel = this._model; + const api2 = this._api; + scheduler.unfinished = false; + do { + const startTime = +new Date(); + scheduler.performSeriesTasks(ecModel); + scheduler.performDataProcessorTasks(ecModel); + updateStreamModes(this, ecModel); + scheduler.performVisualTasks(ecModel); + renderSeries(this, this._model, api2, "remain", {}); + remainTime -= +new Date() - startTime; + } while (remainTime > 0 && scheduler.unfinished); + if (!scheduler.unfinished) { + this._zr.flush(); + } + } + } + getDom() { + return this._dom; + } + getId() { + return this.id; + } + getZr() { + return this._zr; + } + isSSR() { + return this._ssr; + } + setOption(option, notMerge, lazyUpdate) { + if (this[IN_MAIN_PROCESS_KEY]) { + if (true) { + error("`setOption` should not be called during main process."); + } + return; + } + if (this._disposed) { + disposedWarning(this.id); + return; + } + let silent; + let replaceMerge; + let transitionOpt; + if (isObject(notMerge)) { + lazyUpdate = notMerge.lazyUpdate; + silent = notMerge.silent; + replaceMerge = notMerge.replaceMerge; + transitionOpt = notMerge.transition; + notMerge = notMerge.notMerge; + } + this[IN_MAIN_PROCESS_KEY] = true; + if (!this._model || notMerge) { + const optionManager = new OptionManager_default(this._api); + const theme2 = this._theme; + const ecModel = this._model = new Global_default(); + ecModel.scheduler = this._scheduler; + ecModel.ssr = this._ssr; + ecModel.init(null, null, null, theme2, this._locale, optionManager); + } + this._model.setOption(option, {replaceMerge}, optionPreprocessorFuncs); + const updateParams = { + seriesTransition: transitionOpt, + optionChanged: true + }; + if (lazyUpdate) { + this[PENDING_UPDATE] = { + silent, + updateParams + }; + this[IN_MAIN_PROCESS_KEY] = false; + this.getZr().wakeUp(); + } else { + try { + prepare(this); + updateMethods.update.call(this, null, updateParams); + } catch (e2) { + this[PENDING_UPDATE] = null; + this[IN_MAIN_PROCESS_KEY] = false; + throw e2; + } + if (!this._ssr) { + this._zr.flush(); + } + this[PENDING_UPDATE] = null; + this[IN_MAIN_PROCESS_KEY] = false; + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + } + } + setTheme() { + deprecateLog("ECharts#setTheme() is DEPRECATED in ECharts 3.0"); + } + getModel() { + return this._model; + } + getOption() { + return this._model && this._model.getOption(); + } + getWidth() { + return this._zr.getWidth(); + } + getHeight() { + return this._zr.getHeight(); + } + getDevicePixelRatio() { + return this._zr.painter.dpr || env_default.hasGlobalWindow && window.devicePixelRatio || 1; + } + getRenderedCanvas(opts) { + if (true) { + deprecateReplaceLog("getRenderedCanvas", "renderToCanvas"); + } + return this.renderToCanvas(opts); + } + renderToCanvas(opts) { + opts = opts || {}; + const painter = this._zr.painter; + if (true) { + if (painter.type !== "canvas") { + throw new Error("renderToCanvas can only be used in the canvas renderer."); + } + } + return painter.getRenderedCanvas({ + backgroundColor: opts.backgroundColor || this._model.get("backgroundColor"), + pixelRatio: opts.pixelRatio || this.getDevicePixelRatio() + }); + } + renderToSVGString(opts) { + opts = opts || {}; + const painter = this._zr.painter; + if (true) { + if (painter.type !== "svg") { + throw new Error("renderToSVGString can only be used in the svg renderer."); } } - // Use it to avoid it be exposed to user. - var tmpDuringScope = {}; - var transitionDuringAPI = { - // Usually other props do not need to be changed in animation during. - setTransform: function (key, val) { - if ("development" !== 'production') { - assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.'); - } - tmpDuringScope.el[key] = val; - return this; - }, - getTransform: function (key) { - if ("development" !== 'production') { - assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.'); - } - return tmpDuringScope.el[key]; - }, - setShape: function (key, val) { - if ("development" !== 'production') { - assertNotReserved(key); - } - var el = tmpDuringScope.el; - var shape = el.shape || (el.shape = {}); - shape[key] = val; - el.dirtyShape && el.dirtyShape(); - return this; - }, - getShape: function (key) { - if ("development" !== 'production') { - assertNotReserved(key); + return painter.renderToString({ + useViewBox: opts.useViewBox + }); + } + getSvgDataURL() { + if (!env_default.svgSupported) { + return; + } + const zr = this._zr; + const list = zr.storage.getDisplayList(); + each(list, function(el) { + el.stopAnimation(null, true); + }); + return zr.painter.toDataURL(); + } + getDataURL(opts) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + opts = opts || {}; + const excludeComponents = opts.excludeComponents; + const ecModel = this._model; + const excludesComponentViews = []; + const self2 = this; + each(excludeComponents, function(componentType) { + ecModel.eachComponent({ + mainType: componentType + }, function(component) { + const view = self2._componentsMap[component.__viewId]; + if (!view.group.ignore) { + excludesComponentViews.push(view); + view.group.ignore = true; } - var shape = tmpDuringScope.el.shape; - if (shape) { - return shape[key]; + }); + }); + const url = this._zr.painter.getType() === "svg" ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL("image/" + (opts && opts.type || "png")); + each(excludesComponentViews, function(view) { + view.group.ignore = false; + }); + return url; + } + getConnectedDataURL(opts) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + const isSvg = opts.type === "svg"; + const groupId = this.group; + const mathMin12 = Math.min; + const mathMax12 = Math.max; + const MAX_NUMBER = Infinity; + if (connectedGroups[groupId]) { + let left = MAX_NUMBER; + let top = MAX_NUMBER; + let right = -MAX_NUMBER; + let bottom = -MAX_NUMBER; + const canvasList = []; + const dpr2 = opts && opts.pixelRatio || this.getDevicePixelRatio(); + each(instances2, function(chart, id) { + if (chart.group === groupId) { + const canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts)); + const boundingRect = chart.getDom().getBoundingClientRect(); + left = mathMin12(boundingRect.left, left); + top = mathMin12(boundingRect.top, top); + right = mathMax12(boundingRect.right, right); + bottom = mathMax12(boundingRect.bottom, bottom); + canvasList.push({ + dom: canvas, + left: boundingRect.left, + top: boundingRect.top + }); } - }, - setStyle: function (key, val) { - if ("development" !== 'production') { - assertNotReserved(key); - } - var el = tmpDuringScope.el; - var style = el.style; - if (style) { - if ("development" !== 'production') { - if (eqNaN(val)) { - warn('style.' + key + ' must not be assigned with NaN.'); + }); + left *= dpr2; + top *= dpr2; + right *= dpr2; + bottom *= dpr2; + const width = right - left; + const height = bottom - top; + const targetCanvas = platformApi.createCanvas(); + const zr = init(targetCanvas, { + renderer: isSvg ? "svg" : "canvas" + }); + zr.resize({ + width, + height + }); + if (isSvg) { + let content = ""; + each(canvasList, function(item) { + const x = item.left - left; + const y = item.top - top; + content += '' + item.dom + ""; + }); + zr.painter.getSvgRoot().innerHTML = content; + if (opts.connectedBackgroundColor) { + zr.painter.setBackgroundColor(opts.connectedBackgroundColor); + } + zr.refreshImmediately(); + return zr.painter.toDataURL(); + } else { + if (opts.connectedBackgroundColor) { + zr.add(new Rect_default({ + shape: { + x: 0, + y: 0, + width, + height + }, + style: { + fill: opts.connectedBackgroundColor } - } - style[key] = val; - el.dirtyStyle && el.dirtyStyle(); - } - return this; - }, - getStyle: function (key) { - if ("development" !== 'production') { - assertNotReserved(key); - } - var style = tmpDuringScope.el.style; - if (style) { - return style[key]; - } - }, - setExtra: function (key, val) { - if ("development" !== 'production') { - assertNotReserved(key); - } - var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {}); - extra[key] = val; - return this; - }, - getExtra: function (key) { - if ("development" !== 'production') { - assertNotReserved(key); - } - var extra = tmpDuringScope.el.extra; - if (extra) { - return extra[key]; - } - } - }; - function assertNotReserved(key) { - if ("development" !== 'production') { - if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') { - throw new Error('key must not be "' + key + '"'); + })); } - } - } - function duringCall() { - // Do not provide "percent" until some requirements come. - // Because consider thies case: - // enterFrom: {x: 100, y: 30}, transition: 'x'. - // And enter duration is different from update duration. - // Thus it might be confused about the meaning of "percent" in during callback. - var scope = this; - var el = scope.el; - if (!el) { - return; - } - // If el is remove from zr by reason like legend, during still need to called, - // because el will be added back to zr and the prop value should not be incorrect. - var latestUserDuring = transitionInnerStore(el).userDuring; - var scopeUserDuring = scope.userDuring; - // Ensured a during is only called once in each animation frame. - // If a during is called multiple times in one frame, maybe some users' calculation logic - // might be wrong (not sure whether this usage exists). - // The case of a during might be called twice can be: by default there is a animator for - // 'x', 'y' when init. Before the init animation finished, call `setOption` to start - // another animators for 'style'/'shape'/'extra'. - if (latestUserDuring !== scopeUserDuring) { - // release - scope.el = scope.userDuring = null; - return; - } - tmpDuringScope.el = el; - // Give no `this` to user in "during" calling. - scopeUserDuring(transitionDuringAPI); - // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`, - // consider the issue that the prop might be incorrect when return to "normal" state. - } - - function prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) { - var attrOpt = elOption[mainAttr]; - if (!attrOpt) { - return; - } - var elPropsInAttr = fromEl[mainAttr]; - var transFromPropsInAttr; - if (elPropsInAttr) { - var transition = elOption.transition; - var attrTransition = attrOpt.transition; - if (attrTransition) { - !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); - if (isTransitionAll(attrTransition)) { - extend(transFromPropsInAttr, elPropsInAttr); + each(canvasList, function(item) { + const img = new Image_default({ + style: { + x: item.left * dpr2 - left, + y: item.top * dpr2 - top, + image: item.dom + } + }); + zr.add(img); + }); + zr.refreshImmediately(); + return targetCanvas.toDataURL("image/" + (opts && opts.type || "png")); + } + } else { + return this.getDataURL(opts); + } + } + convertToPixel(finder, value) { + return doConvertPixel(this, "convertToPixel", finder, value); + } + convertFromPixel(finder, value) { + return doConvertPixel(this, "convertFromPixel", finder, value); + } + containPixel(finder, value) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + const ecModel = this._model; + let result; + const findResult = parseFinder(ecModel, finder); + each(findResult, function(models, key) { + key.indexOf("Models") >= 0 && each(models, function(model) { + const coordSys = model.coordinateSystem; + if (coordSys && coordSys.containPoint) { + result = result || !!coordSys.containPoint(value); + } else if (key === "seriesModels") { + const view = this._chartsMap[model.__viewId]; + if (view && view.containPoint) { + result = result || view.containPoint(value, model); } else { - var transitionKeys = normalizeToArray(attrTransition); - for (var i = 0; i < transitionKeys.length; i++) { - var key = transitionKeys[i]; - var elVal = elPropsInAttr[key]; - transFromPropsInAttr[key] = elVal; + if (true) { + warn(key + ": " + (view ? "The found component do not support containPoint." : "No view mapping to the found component.")); } } - } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) { - !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); - var elPropsInAttrKeys = keys(elPropsInAttr); - for (var i = 0; i < elPropsInAttrKeys.length; i++) { - var key = elPropsInAttrKeys[i]; - var elVal = elPropsInAttr[key]; - if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) { - transFromPropsInAttr[key] = elVal; - } + } else { + if (true) { + warn(key + ": containPoint is not supported"); } } - } - } - function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) { - var attrOpt = elOption[mainAttr]; - if (!attrOpt) { - return; - } - var allPropsInAttr = allProps[mainAttr] = {}; - var keysInAttr = keys(attrOpt); - for (var i = 0; i < keysInAttr.length; i++) { - var key = keysInAttr[i]; - // To avoid share one object with different element, and - // to avoid user modify the object inexpectedly, have to clone. - allPropsInAttr[key] = cloneValue(attrOpt[key]); - } - } - function prepareTransformTransitionFrom(el, elOption, transFromProps) { - var transition = elOption.transition; - var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []); - for (var i = 0; i < transitionKeys.length; i++) { - var key = transitionKeys[i]; - if (key === 'style' || key === 'shape' || key === 'extra') { - continue; + }, this); + }, this); + return !!result; + } + getVisual(finder, visualType) { + const ecModel = this._model; + const parsedFinder = parseFinder(ecModel, finder, { + defaultMainType: "series" + }); + const seriesModel = parsedFinder.seriesModel; + if (true) { + if (!seriesModel) { + warn("There is no specified series model"); + } + } + const data = seriesModel.getData(); + const dataIndexInside = parsedFinder.hasOwnProperty("dataIndexInside") ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty("dataIndex") ? data.indexOfRawIndex(parsedFinder.dataIndex) : null; + return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType); + } + getViewOfComponentModel(componentModel) { + return this._componentsMap[componentModel.__viewId]; + } + getViewOfSeriesModel(seriesModel) { + return this._chartsMap[seriesModel.__viewId]; + } + _initEvents() { + each(MOUSE_EVENT_NAMES, (eveName) => { + const handler = (e2) => { + const ecModel = this.getModel(); + const el = e2.target; + let params; + const isGlobalOut = eveName === "globalout"; + if (isGlobalOut) { + params = {}; + } else { + el && findEventDispatcher(el, (parent) => { + const ecData = getECData(parent); + if (ecData && ecData.dataIndex != null) { + const dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex); + params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {}; + return true; + } else if (ecData.eventData) { + params = extend({}, ecData.eventData); + return true; + } + }, true); } - var elVal = el[key]; - if ("development" !== 'production') { - checkTransformPropRefer(key, 'el.transition'); + if (params) { + let componentType = params.componentType; + let componentIndex = params.componentIndex; + if (componentType === "markLine" || componentType === "markPoint" || componentType === "markArea") { + componentType = "series"; + componentIndex = params.seriesIndex; + } + const model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex); + const view = model && this[model.mainType === "series" ? "_chartsMap" : "_componentsMap"][model.__viewId]; + if (true) { + if (!isGlobalOut && !(model && view)) { + warn("model or view can not be found by params"); + } + } + params.event = e2; + params.type = eveName; + this._$eventProcessor.eventInfo = { + targetEl: el, + packedEvent: params, + model, + view + }; + this.trigger(eveName, params); } - // Do not clone, animator will perform that clone. - transFromProps[key] = elVal; + }; + handler.zrEventfulCallAtLast = true; + this._zr.on(eveName, handler, this); + }); + each(eventActionMap, (actionType, eventType) => { + this._messageCenter.on(eventType, function(event) { + this.trigger(eventType, event); + }, this); + }); + each(["selectchanged"], (eventType) => { + this._messageCenter.on(eventType, function(event) { + this.trigger(eventType, event); + }, this); + }); + handleLegacySelectEvents(this._messageCenter, this, this._api); + } + isDisposed() { + return this._disposed; + } + clear() { + if (this._disposed) { + disposedWarning(this.id); + return; + } + this.setOption({series: []}, true); + } + dispose() { + if (this._disposed) { + disposedWarning(this.id); + return; + } + this._disposed = true; + const dom = this.getDom(); + if (dom) { + setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, ""); + } + const chart = this; + const api2 = chart._api; + const ecModel = chart._model; + each(chart._componentsViews, function(component) { + component.dispose(ecModel, api2); + }); + each(chart._chartsViews, function(chart2) { + chart2.dispose(ecModel, api2); + }); + chart._zr.dispose(); + chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null; + delete instances2[chart.id]; + } + resize(opts) { + if (this[IN_MAIN_PROCESS_KEY]) { + if (true) { + error("`resize` should not be called during main process."); + } + return; + } + if (this._disposed) { + disposedWarning(this.id); + return; + } + this._zr.resize(opts); + const ecModel = this._model; + this._loadingFX && this._loadingFX.resize(); + if (!ecModel) { + return; + } + let needPrepare = ecModel.resetOption("media"); + let silent = opts && opts.silent; + if (this[PENDING_UPDATE]) { + if (silent == null) { + silent = this[PENDING_UPDATE].silent; + } + needPrepare = true; + this[PENDING_UPDATE] = null; + } + this[IN_MAIN_PROCESS_KEY] = true; + try { + needPrepare && prepare(this); + updateMethods.update.call(this, { + type: "resize", + animation: extend({ + duration: 0 + }, opts && opts.animation) + }); + } catch (e2) { + this[IN_MAIN_PROCESS_KEY] = false; + throw e2; + } + this[IN_MAIN_PROCESS_KEY] = false; + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + } + showLoading(name, cfg) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + if (isObject(name)) { + cfg = name; + name = ""; + } + name = name || "default"; + this.hideLoading(); + if (!loadingEffects[name]) { + if (true) { + warn("Loading effects " + name + " not exists."); + } + return; + } + const el = loadingEffects[name](this._api, cfg); + const zr = this._zr; + this._loadingFX = el; + zr.add(el); + } + hideLoading() { + if (this._disposed) { + disposedWarning(this.id); + return; + } + this._loadingFX && this._zr.remove(this._loadingFX); + this._loadingFX = null; + } + makeActionFromEvent(eventObj) { + const payload = extend({}, eventObj); + payload.type = eventActionMap[eventObj.type]; + return payload; + } + dispatchAction(payload, opt) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + if (!isObject(opt)) { + opt = {silent: !!opt}; + } + if (!actions[payload.type]) { + return; + } + if (!this._model) { + return; + } + if (this[IN_MAIN_PROCESS_KEY]) { + this._pendingActions.push(payload); + return; + } + const silent = opt.silent; + doDispatchAction.call(this, payload, silent); + const flush = opt.flush; + if (flush) { + this._zr.flush(); + } else if (flush !== false && env_default.browser.weChat) { + this._throttledZrFlush(); + } + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + } + updateLabelLayout() { + lifecycle_default.trigger("series:layoutlabels", this._model, this._api, { + updatedSeries: [] + }); + } + appendData(params) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + const seriesIndex = params.seriesIndex; + const ecModel = this.getModel(); + const seriesModel = ecModel.getSeriesByIndex(seriesIndex); + if (true) { + assert(params.data && seriesModel); + } + seriesModel.appendData(params); + this._scheduler.unfinished = true; + this.getZr().wakeUp(); + } +}; +PENDING_UPDATE, IN_MAIN_PROCESS_KEY, CONNECT_STATUS_KEY, STATUS_NEEDS_UPDATE_KEY; +ECharts.internalField = function() { + prepare = function(ecIns) { + const scheduler = ecIns._scheduler; + scheduler.restorePipelines(ecIns._model); + scheduler.prepareStageTasks(); + prepareView(ecIns, true); + prepareView(ecIns, false); + scheduler.plan(); + }; + prepareView = function(ecIns, isComponent) { + const ecModel = ecIns._model; + const scheduler = ecIns._scheduler; + const viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews; + const viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap; + const zr = ecIns._zr; + const api2 = ecIns._api; + for (let i = 0; i < viewList.length; i++) { + viewList[i].__alive = false; + } + isComponent ? ecModel.eachComponent(function(componentType, model) { + componentType !== "series" && doPrepare(model); + }) : ecModel.eachSeries(doPrepare); + function doPrepare(model) { + const requireNewView = model.__requireNewView; + model.__requireNewView = false; + const viewId = "_ec_" + model.id + "_" + model.type; + let view = !requireNewView && viewMap[viewId]; + if (!view) { + const classType = parseClassType(model.type); + const Clazz = isComponent ? Component_default2.getClass(classType.main, classType.sub) : Chart_default.getClass(classType.sub); + if (true) { + assert(Clazz, classType.sub + " does not exist."); + } + view = new Clazz(); + view.init(ecModel, api2); + viewMap[viewId] = view; + viewList.push(view); + zr.add(view.group); + } + model.__viewId = view.__id = viewId; + view.__alive = true; + view.__model = model; + view.group.__ecComponentInfo = { + mainType: model.mainType, + index: model.componentIndex + }; + !isComponent && scheduler.prepareView(view, model, ecModel, api2); + } + for (let i = 0; i < viewList.length; ) { + const view = viewList[i]; + if (!view.__alive) { + !isComponent && view.renderTask.dispose(); + zr.remove(view.group); + view.dispose(ecModel, api2); + viewList.splice(i, 1); + if (viewMap[view.__id] === view) { + delete viewMap[view.__id]; + } + view.__id = view.group.__ecComponentInfo = null; + } else { + i++; } } - function prepareTransformAllPropsFinal(el, elOption, allProps) { - for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) { - var legacyName = LEGACY_TRANSFORM_PROPS[i]; - var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName]; - var legacyArr = elOption[legacyName]; - if (legacyArr) { - allProps[xyName[0]] = legacyArr[0]; - allProps[xyName[1]] = legacyArr[1]; - } - } - for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) { - var key = TRANSFORMABLE_PROPS[i]; - if (elOption[key] != null) { - allProps[key] = elOption[key]; + }; + updateDirectly = function(ecIns, method, payload, mainType, subType) { + const ecModel = ecIns._model; + ecModel.setUpdatePayload(payload); + if (!mainType) { + each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView); + return; + } + const query = {}; + query[mainType + "Id"] = payload[mainType + "Id"]; + query[mainType + "Index"] = payload[mainType + "Index"]; + query[mainType + "Name"] = payload[mainType + "Name"]; + const condition = {mainType, query}; + subType && (condition.subType = subType); + const excludeSeriesId = payload.excludeSeriesId; + let excludeSeriesIdMap; + if (excludeSeriesId != null) { + excludeSeriesIdMap = createHashMap(); + each(normalizeToArray(excludeSeriesId), (id) => { + const modelId = convertOptionIdName(id, null); + if (modelId != null) { + excludeSeriesIdMap.set(modelId, true); } - } + }); } - function prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) { - if (!styleOpt) { + ecModel && ecModel.eachComponent(condition, function(model) { + const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null; + if (isExcluded) { return; } - var fromElStyle = fromEl.style; - var transFromStyleProps; - if (fromElStyle) { - var styleTransition = styleOpt.transition; - var elTransition = elOption.transition; - if (styleTransition && !isTransitionAll(styleTransition)) { - var transitionKeys = normalizeToArray(styleTransition); - !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); - for (var i = 0; i < transitionKeys.length; i++) { - var key = transitionKeys[i]; - var elVal = fromElStyle[key]; - // Do not clone, see `checkNonStyleTansitionRefer`. - transFromStyleProps[key] = elVal; + ; + if (isHighDownPayload(payload)) { + if (model instanceof Series_default) { + if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(["emphasis", "disabled"])) { + blurSeriesFromHighlightPayload(model, payload, ecIns._api); } - } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, 'style') >= 0)) { - var animationProps = fromEl.getAnimationStyleProps(); - var animationStyleProps = animationProps ? animationProps.style : null; - if (animationStyleProps) { - !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); - var styleKeys = keys(styleOpt); - for (var i = 0; i < styleKeys.length; i++) { - var key = styleKeys[i]; - if (animationStyleProps[key]) { - var elVal = fromElStyle[key]; - transFromStyleProps[key] = elVal; - } - } + } else { + const {focusSelf, dispatchers} = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api); + if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) { + blurComponent(model.mainType, model.componentIndex, ecIns._api); + } + if (dispatchers) { + each(dispatchers, (dispatcher) => { + payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher); + }); } } - } - } - function isNonStyleTransitionEnabled(optVal, elVal) { - // The same as `checkNonStyleTansitionRefer`. - return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal; - } - var checkTransformPropRefer; - if ("development" !== 'production') { - checkTransformPropRefer = function (key, usedIn) { - if (!hasOwn(TRANSFORM_PROPS_MAP, key)) { - warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.'); + } else if (isSelectChangePayload(payload)) { + if (model instanceof Series_default) { + toggleSelectionFromPayload(model, payload, ecIns._api); + updateSeriesElementSelection(model); + markStatusToUpdate(ecIns); } - }; - } - - var getStateToRestore = makeInner(); - var KEYFRAME_EXCLUDE_KEYS = ['percent', 'easing', 'shape', 'style', 'extra']; - /** - * Stop previous keyframe animation and restore the attributes. - * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set. - */ - function stopPreviousKeyframeAnimationAndRestore(el) { - // Stop previous keyframe animation. - el.stopAnimation('keyframe'); - // Restore - el.attr(getStateToRestore(el)); - } - function applyKeyframeAnimation(el, animationOpts, animatableModel) { - if (!animatableModel.isAnimationEnabled() || !animationOpts) { - return; } - if (isArray(animationOpts)) { - each(animationOpts, function (singleAnimationOpts) { - applyKeyframeAnimation(el, singleAnimationOpts, animatableModel); - }); + }, ecIns); + ecModel && ecModel.eachComponent(condition, function(model) { + const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null; + if (isExcluded) { return; } - var keyframes = animationOpts.keyframes; - var duration = animationOpts.duration; - if (animatableModel && duration == null) { - // Default to use duration of config. - // NOTE: animation config from payload will be ignored because they are mainly for transitions. - var config = getAnimationConfig('enter', animatableModel, 0); - duration = config && config.duration; + ; + callView(ecIns[mainType === "series" ? "_chartsMap" : "_componentsMap"][model.__viewId]); + }, ecIns); + function callView(view) { + view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload); + } + }; + updateMethods = { + prepareAndUpdate(payload) { + prepare(this); + updateMethods.update.call(this, payload, { + optionChanged: payload.newOption != null + }); + }, + update(payload, updateParams) { + const ecModel = this._model; + const api2 = this._api; + const zr = this._zr; + const coordSysMgr = this._coordSysMgr; + const scheduler = this._scheduler; + if (!ecModel) { + return; } - if (!keyframes || !duration) { + ecModel.setUpdatePayload(payload); + scheduler.restoreData(ecModel, payload); + scheduler.performSeriesTasks(ecModel); + coordSysMgr.create(ecModel, api2); + scheduler.performDataProcessorTasks(ecModel, payload); + updateStreamModes(this, ecModel); + coordSysMgr.update(ecModel, api2); + clearColorPalette(ecModel); + scheduler.performVisualTasks(ecModel, payload); + render(this, ecModel, api2, payload, updateParams); + const backgroundColor2 = ecModel.get("backgroundColor") || "transparent"; + const darkMode = ecModel.get("darkMode"); + zr.setBackgroundColor(backgroundColor2); + if (darkMode != null && darkMode !== "auto") { + zr.setDarkMode(darkMode); + } + lifecycle_default.trigger("afterupdate", ecModel, api2); + }, + updateTransform(payload) { + const ecModel = this._model; + const api2 = this._api; + if (!ecModel) { return; } - var stateToRestore = getStateToRestore(el); - each(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) { - if (targetPropName && !el[targetPropName]) { - return; - } - var animator; - var endFrameIsSet = false; - // Sort keyframes by percent. - keyframes.sort(function (a, b) { - return a.percent - b.percent; - }); - each(keyframes, function (kf) { - // Stop current animation. - var animators = el.animators; - var kfValues = targetPropName ? kf[targetPropName] : kf; - if ("development" !== 'production') { - if (kf.percent >= 1) { - endFrameIsSet = true; - } - } - if (!kfValues) { - return; - } - var propKeys = keys(kfValues); - if (!targetPropName) { - // PENDING performance? - propKeys = filter(propKeys, function (key) { - return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0; - }); - } - if (!propKeys.length) { - return; - } - if (!animator) { - animator = el.animate(targetPropName, animationOpts.loop, true); - animator.scope = 'keyframe'; - } - for (var i = 0; i < animators.length; i++) { - // Stop all other animation that is not keyframe. - if (animators[i] !== animator && animators[i].targetName === animator.targetName) { - animators[i].stopTracks(propKeys); - } - } - targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {}); - var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore; - each(propKeys, function (key) { - // Save original value. - savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key]; - }); - animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing); - }); - if (!animator) { + ecModel.setUpdatePayload(payload); + const componentDirtyList = []; + ecModel.eachComponent((componentType, componentModel) => { + if (componentType === "series") { return; } - if ("development" !== 'production') { - if (!endFrameIsSet) { - warn('End frame with percent: 1 is missing in the keyframeAnimation.', true); + const componentView = this.getViewOfComponentModel(componentModel); + if (componentView && componentView.__alive) { + if (componentView.updateTransform) { + const result = componentView.updateTransform(componentModel, ecModel, api2, payload); + result && result.update && componentDirtyList.push(componentView); + } else { + componentDirtyList.push(componentView); } } - animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing); }); - } - - var EMPHASIS = 'emphasis'; - var NORMAL = 'normal'; - var BLUR = 'blur'; - var SELECT = 'select'; - var STATES = [NORMAL, EMPHASIS, BLUR, SELECT]; - var PATH_ITEM_STYLE = { - normal: ['itemStyle'], - emphasis: [EMPHASIS, 'itemStyle'], - blur: [BLUR, 'itemStyle'], - select: [SELECT, 'itemStyle'] - }; - var PATH_LABEL = { - normal: ['label'], - emphasis: [EMPHASIS, 'label'], - blur: [BLUR, 'label'], - select: [SELECT, 'label'] - }; - var DEFAULT_TRANSITION = ['x', 'y']; - // Use prefix to avoid index to be the same as el.name, - // which will cause weird update animation. - var GROUP_DIFF_PREFIX = 'e\0\0'; - var attachedTxInfoTmp = { - normal: {}, - emphasis: {}, - blur: {}, - select: {} - }; - /** - * To reduce total package size of each coordinate systems, the modules `prepareCustom` - * of each coordinate systems are not required by each coordinate systems directly, but - * required by the module `custom`. - * - * prepareInfoForCustomSeries {Function}: optional - * @return {Object} {coordSys: {...}, api: { - * coord: function (data, clamp) {}, // return point in global. - * size: function (dataSize, dataItem) {} // return size of each axis in coordSys. - * }} - */ - var prepareCustoms = { - cartesian2d: cartesianPrepareCustom, - geo: geoPrepareCustom, - single: singlePrepareCustom, - polar: polarPrepareCustom, - calendar: calendarPrepareCustom - }; - function isPath$1(el) { - return el instanceof Path; - } - function isDisplayable(el) { - return el instanceof Displayable; - } - function copyElement(sourceEl, targetEl) { - targetEl.copyTransform(sourceEl); - if (isDisplayable(targetEl) && isDisplayable(sourceEl)) { - targetEl.setStyle(sourceEl.style); - targetEl.z = sourceEl.z; - targetEl.z2 = sourceEl.z2; - targetEl.zlevel = sourceEl.zlevel; - targetEl.invisible = sourceEl.invisible; - targetEl.ignore = sourceEl.ignore; - if (isPath$1(targetEl) && isPath$1(sourceEl)) { - targetEl.setShape(sourceEl.shape); - } - } - } - var CustomChartView = /** @class */function (_super) { - __extends(CustomChartView, _super); - function CustomChartView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CustomChartView.type; - return _this; - } - CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) { - // Clear previously rendered progressive elements. - this._progressiveEls = null; - var oldData = this._data; - var data = customSeries.getData(); - var group = this.group; - var renderItem = makeRenderItem(customSeries, data, ecModel, api); - if (!oldData) { - // Previous render is incremental render or first render. - // Needs remove the incremental rendered elements. - group.removeAll(); - } - data.diff(oldData).add(function (newIdx) { - createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data); - }).remove(function (oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); - el && applyLeaveTransition(el, customInnerStore(el).option, customSeries); - }).update(function (newIdx, oldIdx) { - var oldEl = oldData.getItemGraphicEl(oldIdx); - createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data); - }).execute(); - // Do clipping - var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null; - if (clipPath) { - group.setClipPath(clipPath); + const seriesDirtyMap = createHashMap(); + ecModel.eachSeries((seriesModel) => { + const chartView = this._chartsMap[seriesModel.__viewId]; + if (chartView.updateTransform) { + const result = chartView.updateTransform(seriesModel, ecModel, api2, payload); + result && result.update && seriesDirtyMap.set(seriesModel.uid, 1); } else { - group.removeClipPath(); - } - this._data = data; - }; - CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) { - this.group.removeAll(); - this._data = null; - }; - CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) { - var data = customSeries.getData(); - var renderItem = makeRenderItem(customSeries, data, ecModel, api); - var progressiveEls = this._progressiveEls = []; - function setIncrementalAndHoverLayer(el) { - if (!el.isGroup) { - el.incremental = true; - el.ensureState('emphasis').hoverLayer = true; - } - } - for (var idx = params.start; idx < params.end; idx++) { - var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data); - if (el) { - el.traverse(setIncrementalAndHoverLayer); - progressiveEls.push(el); - } - } - }; - CustomChartView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; - CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) { - var elementName = query.element; - if (elementName == null || targetEl.name === elementName) { - return true; + seriesDirtyMap.set(seriesModel.uid, 1); } - // Enable to give a name on a group made by `renderItem`, and listen - // events that are triggered by its descendents. - while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) { - if (targetEl.name === elementName) { - return true; - } - } - return false; - }; - CustomChartView.type = 'custom'; - return CustomChartView; - }(ChartView); - function createEl(elOption) { - var graphicType = elOption.type; - var el; - // Those graphic elements are not shapes. They should not be - // overwritten by users, so do them first. - if (graphicType === 'path') { - var shape = elOption.shape; - // Using pathRect brings convenience to users sacle svg path. - var pathRect = shape.width != null && shape.height != null ? { - x: shape.x || 0, - y: shape.y || 0, - width: shape.width, - height: shape.height - } : null; - var pathData = getPathData(shape); - // Path is also used for icon, so layout 'center' by default. - el = makePath(pathData, null, pathRect, shape.layout || 'center'); - customInnerStore(el).customPathData = pathData; - } else if (graphicType === 'image') { - el = new ZRImage({}); - customInnerStore(el).customImagePath = elOption.style.image; - } else if (graphicType === 'text') { - el = new ZRText({}); - // customInnerStore(el).customText = (elOption.style as TextStyleProps).text; - } else if (graphicType === 'group') { - el = new Group(); - } else if (graphicType === 'compoundPath') { - throw new Error('"compoundPath" is not supported yet.'); - } else { - var Clz = getShapeClass(graphicType); - if (!Clz) { - var errMsg = ''; - if ("development" !== 'production') { - errMsg = 'graphic type "' + graphicType + '" can not be found.'; - } - throwError(errMsg); - } - el = new Clz(); - } - customInnerStore(el).customGraphicType = graphicType; - el.name = elOption.name; - // Compat ec4: the default z2 lift is 1. If changing the number, - // some cases probably be broken: hierarchy layout along z, like circle packing, - // where emphasis only intending to modify color/border rather than lift z2. - el.z2EmphasisLift = 1; - el.z2SelectLift = 1; - return el; - } - function updateElNormal( - // Can be null/undefined - api, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) { - // Stop and restore before update any other attributes. - stopPreviousKeyframeAnimationAndRestore(el); - var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg; - if (txCfgOpt) { - // PENDING: whether use user object directly rather than clone? - // TODO:5.0 textConfig transition animation? - el.setTextConfig(txCfgOpt); - } - // Default transition ['x', 'y'] - if (elOption && elOption.transition == null) { - elOption.transition = DEFAULT_TRANSITION; - } - // Do some normalization on style. - var styleOpt = elOption && elOption.style; - if (styleOpt) { - if (el.type === 'text') { - var textOptionStyle = styleOpt; - // Compatible with ec4: if `textFill` or `textStroke` exists use them. - hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill); - hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke); - } - var decalPattern = void 0; - var decalObj = isPath$1(el) ? styleOpt.decal : null; - if (api && decalObj) { - decalObj.dirty = true; - decalPattern = createOrUpdatePatternFromDecal(decalObj, api); - } - // Always overwrite in case user specify this prop. - styleOpt.__decalPattern = decalPattern; - } - if (isDisplayable(el)) { - if (styleOpt) { - var decalPattern = styleOpt.__decalPattern; - if (decalPattern) { - styleOpt.decal = decalPattern; - } - } - } - applyUpdateTransition(el, elOption, seriesModel, { - dataIndex: dataIndex, - isInit: isInit, - clearStyle: true }); - applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel); - } - function updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) { - var elDisplayable = el.isGroup ? null : el; - var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; - // PENDING:5.0 support customize scale change and transition animation? - if (elDisplayable) { - // By default support auto lift color when hover whether `emphasis` specified. - var stateObj = elDisplayable.ensureState(state); - if (styleOpt === false) { - var existingEmphasisState = elDisplayable.getState(state); - if (existingEmphasisState) { - existingEmphasisState.style = null; - } - } else { - // style is needed to enable default emphasis. - stateObj.style = styleOpt || null; - } - // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`, - // remove hover style. - // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not - // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined. - if (txCfgOpt) { - stateObj.textConfig = txCfgOpt; - } - setDefaultStateProxy(elDisplayable); + clearColorPalette(ecModel); + this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true, dirtyMap: seriesDirtyMap}); + renderSeries(this, ecModel, api2, payload, {}, seriesDirtyMap); + lifecycle_default.trigger("afterupdate", ecModel, api2); + }, + updateView(payload) { + const ecModel = this._model; + if (!ecModel) { + return; } - } - function updateZ$1(el, elOption, seriesModel) { - // Group not support textContent and not support z yet. - if (el.isGroup) { + ecModel.setUpdatePayload(payload); + Chart_default.markUpdateMethod(payload, "updateView"); + clearColorPalette(ecModel); + this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true}); + render(this, ecModel, this._api, payload, {}); + lifecycle_default.trigger("afterupdate", ecModel, this._api); + }, + updateVisual(payload) { + const ecModel = this._model; + if (!ecModel) { return; } - var elDisplayable = el; - var currentZ = seriesModel.currentZ; - var currentZLevel = seriesModel.currentZLevel; - // Always erase. - elDisplayable.z = currentZ; - elDisplayable.zlevel = currentZLevel; - // z2 must not be null/undefined, otherwise sort error may occur. - var optZ2 = elOption.z2; - optZ2 != null && (elDisplayable.z2 = optZ2 || 0); - for (var i = 0; i < STATES.length; i++) { - updateZForEachState(elDisplayable, elOption, STATES[i]); - } - } - function updateZForEachState(elDisplayable, elOption, state) { - var isNormal = state === NORMAL; - var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state); - var optZ2 = elStateOpt ? elStateOpt.z2 : null; - var stateObj; - if (optZ2 != null) { - // Do not `ensureState` until required. - stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state); - stateObj.z2 = optZ2 || 0; - } - } - function makeRenderItem(customSeries, data, ecModel, api) { - var renderItem = customSeries.get('renderItem'); - var coordSys = customSeries.coordinateSystem; - var prepareResult = {}; - if (coordSys) { - if ("development" !== 'production') { - assert(renderItem, 'series.render is required.'); - assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.'); - } - // `coordSys.prepareCustoms` is used for external coord sys like bmap. - prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys); - } - var userAPI = defaults({ - getWidth: api.getWidth, - getHeight: api.getHeight, - getZr: api.getZr, - getDevicePixelRatio: api.getDevicePixelRatio, - value: value, - style: style, - ordinalRawValue: ordinalRawValue, - styleEmphasis: styleEmphasis, - visual: visual, - barLayout: barLayout, - currentSeriesIndices: currentSeriesIndices, - font: font - }, prepareResult.api || {}); - var userParams = { - // The life cycle of context: current round of rendering. - // The global life cycle is probably not necessary, because - // user can store global status by themselves. - context: {}, - seriesId: customSeries.id, - seriesName: customSeries.name, - seriesIndex: customSeries.seriesIndex, - coordSys: prepareResult.coordSys, - dataInsideLength: data.count(), - encode: wrapEncodeDef(customSeries.getData()) - }; - // If someday intending to refactor them to a class, should consider do not - // break change: currently these attribute member are encapsulated in a closure - // so that do not need to force user to call these method with a scope. - // Do not support call `api` asynchronously without dataIndexInside input. - var currDataIndexInside; - var currItemModel; - var currItemStyleModels = {}; - var currLabelModels = {}; - var seriesItemStyleModels = {}; - var seriesLabelModels = {}; - for (var i = 0; i < STATES.length; i++) { - var stateName = STATES[i]; - seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]); - seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]); - } - function getItemModel(dataIndexInside) { - return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside); - } - function getItemStyleModel(dataIndexInside, state) { - return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]); - } - function getLabelModel(dataIndexInside, state) { - return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]); - } - return function (dataIndexInside, payload) { - currDataIndexInside = dataIndexInside; - currItemModel = null; - currItemStyleModels = {}; - currLabelModels = {}; - return renderItem && renderItem(defaults({ - dataIndexInside: dataIndexInside, - dataIndex: data.getRawIndex(dataIndexInside), - // Can be used for optimization when zoom or roam. - actionType: payload ? payload.type : null - }, userParams), userAPI); - }; - /** - * @public - * @param dim by default 0. - * @param dataIndexInside by default `currDataIndexInside`. - */ - function value(dim, dataIndexInside) { - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside); - } - /** - * @public - * @param dim by default 0. - * @param dataIndexInside by default `currDataIndexInside`. - */ - function ordinalRawValue(dim, dataIndexInside) { - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - dim = dim || 0; - var dimInfo = data.getDimensionInfo(dim); - if (!dimInfo) { - var dimIndex = data.getDimensionIndex(dim); - return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined; - } - var val = data.get(dimInfo.name, dataIndexInside); - var ordinalMeta = dimInfo && dimInfo.ordinalMeta; - return ordinalMeta ? ordinalMeta.categories[val] : val; - } - /** - * @deprecated The original intention of `api.style` is enable to set itemStyle - * like other series. But it is not necessary and not easy to give a strict definition - * of what it returns. And since echarts5 it needs to be make compat work. So - * deprecates it since echarts5. - * - * By default, `visual` is applied to style (to support visualMap). - * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`, - * it can be implemented as: - * `api.style({stroke: api.visual('color'), fill: null})`; - * - * [Compat]: since ec5, RectText has been separated from its hosts el. - * so `api.style()` will only return the style from `itemStyle` but not handle `label` - * any more. But `series.label` config is never published in doc. - * We still compat it in `api.style()`. But not encourage to use it and will still not - * to pulish it to doc. - * @public - * @param dataIndexInside by default `currDataIndexInside`. - */ - function style(userProps, dataIndexInside) { - if ("development" !== 'production') { - warnDeprecated('api.style', 'Please write literal style directly instead.'); - } - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - var style = data.getItemVisual(dataIndexInside, 'style'); - var visualColor = style && style.fill; - var opacity = style && style.opacity; - var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle(); - visualColor != null && (itemStyle.fill = visualColor); - opacity != null && (itemStyle.opacity = opacity); - var opt = { - inheritColor: isString(visualColor) ? visualColor : '#000' - }; - var labelModel = getLabelModel(dataIndexInside, NORMAL); - // Now that the feature of "auto adjust text fill/stroke" has been migrated to zrender - // since ec5, we should set `isAttached` as `false` here and make compat in - // `convertToEC4StyleForCustomSerise`. - var textStyle = createTextStyle(labelModel, null, opt, false, true); - textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; - var textConfig = createTextConfig(labelModel, opt, false); - preFetchFromExtra(userProps, itemStyle); - itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); - userProps && applyUserPropsAfter(itemStyle, userProps); - itemStyle.legacy = true; - return itemStyle; - } - /** - * @deprecated The reason see `api.style()` - * @public - * @param dataIndexInside by default `currDataIndexInside`. - */ - function styleEmphasis(userProps, dataIndexInside) { - if ("development" !== 'production') { - warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.'); - } - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle(); - var labelModel = getLabelModel(dataIndexInside, EMPHASIS); - var textStyle = createTextStyle(labelModel, null, null, true, true); - textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; - var textConfig = createTextConfig(labelModel, null, true); - preFetchFromExtra(userProps, itemStyle); - itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); - userProps && applyUserPropsAfter(itemStyle, userProps); - itemStyle.legacy = true; - return itemStyle; - } - function applyUserPropsAfter(itemStyle, extra) { - for (var key in extra) { - if (hasOwn(extra, key)) { - itemStyle[key] = extra[key]; - } + ecModel.setUpdatePayload(payload); + ecModel.eachSeries(function(seriesModel) { + seriesModel.getData().clearAllVisual(); + }); + Chart_default.markUpdateMethod(payload, "updateVisual"); + clearColorPalette(ecModel); + this._scheduler.performVisualTasks(ecModel, payload, {visualType: "visual", setDirty: true}); + ecModel.eachComponent((componentType, componentModel) => { + if (componentType !== "series") { + const componentView = this.getViewOfComponentModel(componentModel); + componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, this._api, payload); } + }); + ecModel.eachSeries((seriesModel) => { + const chartView = this._chartsMap[seriesModel.__viewId]; + chartView.updateVisual(seriesModel, ecModel, this._api, payload); + }); + lifecycle_default.trigger("afterupdate", ecModel, this._api); + }, + updateLayout(payload) { + updateMethods.update.call(this, payload); + } + }; + doConvertPixel = function(ecIns, methodName, finder, value) { + if (ecIns._disposed) { + disposedWarning(ecIns.id); + return; + } + const ecModel = ecIns._model; + const coordSysList = ecIns._coordSysMgr.getCoordinateSystems(); + let result; + const parsedFinder = parseFinder(ecModel, finder); + for (let i = 0; i < coordSysList.length; i++) { + const coordSys = coordSysList[i]; + if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) { + return result; } - function preFetchFromExtra(extra, itemStyle) { - // A trick to retrieve those props firstly, which are used to - // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`. - // (It's not reasonable but only for a degree of compat) - if (extra) { - extra.textFill && (itemStyle.textFill = extra.textFill); - extra.textPosition && (itemStyle.textPosition = extra.textPosition); - } - } - /** - * @public - * @param dataIndexInside by default `currDataIndexInside`. - */ - function visual(visualType, dataIndexInside) { - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - if (hasOwn(STYLE_VISUAL_TYPE, visualType)) { - var style_1 = data.getItemVisual(dataIndexInside, 'style'); - return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null; - } - // Only support these visuals. Other visual might be inner tricky - // for performance (like `style`), do not expose to users. - if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) { - return data.getItemVisual(dataIndexInside, visualType); - } - } - /** - * @public - * @return If not support, return undefined. - */ - function barLayout(opt) { - if (coordSys.type === 'cartesian2d') { - var baseAxis = coordSys.getBaseAxis(); - return getLayoutOnAxis(defaults({ - axis: baseAxis - }, opt)); - } - } - /** - * @public - */ - function currentSeriesIndices() { - return ecModel.getCurrentSeriesIndices(); - } - /** - * @public - * @return font string - */ - function font(opt) { - return getFont(opt, ecModel); - } - } - function wrapEncodeDef(data) { - var encodeDef = {}; - each(data.dimensions, function (dimName) { - var dimInfo = data.getDimensionInfo(dimName); - if (!dimInfo.isExtraCoord) { - var coordDim = dimInfo.coordDim; - var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || []; - dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName); - } + } + if (true) { + warn("No coordinate system that supports " + methodName + " found by the given finder."); + } + }; + updateStreamModes = function(ecIns, ecModel) { + const chartsMap = ecIns._chartsMap; + const scheduler = ecIns._scheduler; + ecModel.eachSeries(function(seriesModel) { + scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]); + }); + }; + doDispatchAction = function(payload, silent) { + const ecModel = this.getModel(); + const payloadType = payload.type; + const escapeConnect = payload.escapeConnect; + const actionWrap = actions[payloadType]; + const actionInfo3 = actionWrap.actionInfo; + const cptTypeTmp = (actionInfo3.update || "update").split(":"); + const updateMethod = cptTypeTmp.pop(); + const cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]); + this[IN_MAIN_PROCESS_KEY] = true; + let payloads = [payload]; + let batched = false; + if (payload.batch) { + batched = true; + payloads = map(payload.batch, function(item) { + item = defaults(extend({}, item), payload); + item.batch = null; + return item; }); - return encodeDef; - } - function createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) { - // [Rule] - // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing. - // (It seems that violate the "merge" principle, but most of users probably intuitively - // regard "return;" as "show nothing element whatever", so make a exception to meet the - // most cases.) - // The rule or "merge" see [STRATEGY_MERGE]. - // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing). - if (!elOption) { - group.remove(existsEl); - return; + } + const eventObjBatch = []; + let eventObj; + const isSelectChange = isSelectChangePayload(payload); + const isHighDown = isHighDownPayload(payload); + if (isHighDown) { + allLeaveBlur(this._api); + } + each(payloads, (batchItem) => { + eventObj = actionWrap.action(batchItem, this._model, this._api); + eventObj = eventObj || extend({}, batchItem); + eventObj.type = actionInfo3.event || eventObj.type; + eventObjBatch.push(eventObj); + if (isHighDown) { + const {queryOptionMap, mainTypeSpecified} = preParseFinder(payload); + const componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : "series"; + updateDirectly(this, updateMethod, batchItem, componentMainType); + markStatusToUpdate(this); + } else if (isSelectChange) { + updateDirectly(this, updateMethod, batchItem, "series"); + markStatusToUpdate(this); + } else if (cptType) { + updateDirectly(this, updateMethod, batchItem, cptType.main, cptType.sub); } - var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group); - el && data.setItemGraphicEl(dataIndex, el); - el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled); - return el; - } - function doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) { - if ("development" !== 'production') { - assert(elOption, 'should not have an null/undefined element setting'); - } - var toBeReplacedIdx = -1; - var oldEl = existsEl; - if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel) - // || ( - // // PENDING: even in one-to-one mapping case, if el is marked as morph, - // // do not sure whether the el will be mapped to another el with different - // // hierarchy in Group tree. So always recreate el rather than reuse the el. - // morphHelper && morphHelper.isOneToOneFrom(el) - // ) - ) { - // Should keep at the original index, otherwise "merge by index" will be incorrect. - toBeReplacedIdx = indexOf(group.childrenRef(), existsEl); - existsEl = null; - } - var isInit = !existsEl; - var el = existsEl; - if (!el) { - el = createEl(elOption); - if (oldEl) { - copyElement(oldEl, el); + }); + if (updateMethod !== "none" && !isHighDown && !isSelectChange && !cptType) { + try { + if (this[PENDING_UPDATE]) { + prepare(this); + updateMethods.update.call(this, payload); + this[PENDING_UPDATE] = null; + } else { + updateMethods[updateMethod].call(this, payload); } - } else { - // FIMXE:NEXT unified clearState? - // If in some case the performance issue arised, consider - // do not clearState but update cached normal state directly. - el.clearStates(); + } catch (e2) { + this[IN_MAIN_PROCESS_KEY] = false; + throw e2; + } + } + if (batched) { + eventObj = { + type: actionInfo3.event || payloadType, + escapeConnect, + batch: eventObjBatch + }; + } else { + eventObj = eventObjBatch[0]; + } + this[IN_MAIN_PROCESS_KEY] = false; + if (!silent) { + const messageCenter = this._messageCenter; + messageCenter.trigger(eventObj.type, eventObj); + if (isSelectChange) { + const newObj = { + type: "selectchanged", + escapeConnect, + selected: getAllSelectedIndices(ecModel), + isFromClick: payload.isFromClick || false, + fromAction: payload.type, + fromActionPayload: payload + }; + messageCenter.trigger(newObj.type, newObj); + } + } + }; + flushPendingActions = function(silent) { + const pendingActions = this._pendingActions; + while (pendingActions.length) { + const payload = pendingActions.shift(); + doDispatchAction.call(this, payload, silent); + } + }; + triggerUpdatedEvent = function(silent) { + !silent && this.trigger("updated"); + }; + bindRenderedEvent = function(zr, ecIns) { + zr.on("rendered", function(params) { + ecIns.trigger("rendered", params); + if (zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) { + ecIns.trigger("finished"); } - // Need to set morph: false explictly to disable automatically morphing. - if (elOption.morph === false) { - el.disableMorphing = true; - } else if (el.disableMorphing) { - el.disableMorphing = false; - } - attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null; - attachedTxInfoTmp.isLegacy = false; - doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp); - doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit); - updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); - // `elOption.info` enables user to mount some info on - // elements and use them in event handlers. - // Update them only when user specified, otherwise, remain. - hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info); - for (var i = 0; i < STATES.length; i++) { - var stateName = STATES[i]; - if (stateName !== NORMAL) { - var otherStateOpt = retrieveStateOption(elOption, stateName); - var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName); - updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp); + }); + }; + bindMouseEvent = function(zr, ecIns) { + zr.on("mouseover", function(e2) { + const el = e2.target; + const dispatcher = findEventDispatcher(el, isHighDownDispatcher); + if (dispatcher) { + handleGlobalMouseOverForHighDown(dispatcher, e2, ecIns._api); + markStatusToUpdate(ecIns); + } + }).on("mouseout", function(e2) { + const el = e2.target; + const dispatcher = findEventDispatcher(el, isHighDownDispatcher); + if (dispatcher) { + handleGlobalMouseOutForHighDown(dispatcher, e2, ecIns._api); + markStatusToUpdate(ecIns); + } + }).on("click", function(e2) { + const el = e2.target; + const dispatcher = findEventDispatcher(el, (target) => getECData(target).dataIndex != null, true); + if (dispatcher) { + const actionType = dispatcher.selected ? "unselect" : "select"; + const ecData = getECData(dispatcher); + ecIns._api.dispatchAction({ + type: actionType, + dataType: ecData.dataType, + dataIndexInside: ecData.dataIndex, + seriesIndex: ecData.seriesIndex, + isFromClick: true + }); + } + }); + }; + function clearColorPalette(ecModel) { + ecModel.clearColorPalette(); + ecModel.eachSeries(function(seriesModel) { + seriesModel.clearColorPalette(); + }); + } + ; + function allocateZlevels(ecModel) { + ; + const componentZLevels = []; + const seriesZLevels = []; + let hasSeparateZLevel = false; + ecModel.eachComponent(function(componentType, componentModel) { + const zlevel = componentModel.get("zlevel") || 0; + const z = componentModel.get("z") || 0; + const zlevelKey = componentModel.getZLevelKey(); + hasSeparateZLevel = hasSeparateZLevel || !!zlevelKey; + (componentType === "series" ? seriesZLevels : componentZLevels).push({ + zlevel, + z, + idx: componentModel.componentIndex, + type: componentType, + key: zlevelKey + }); + }); + if (hasSeparateZLevel) { + const zLevels = componentZLevels.concat(seriesZLevels); + let lastSeriesZLevel; + let lastSeriesKey; + sort(zLevels, (a, b) => { + if (a.zlevel === b.zlevel) { + return a.z - b.z; } + return a.zlevel - b.zlevel; + }); + each(zLevels, (item) => { + const componentModel = ecModel.getComponent(item.type, item.idx); + let zlevel = item.zlevel; + const key = item.key; + if (lastSeriesZLevel != null) { + zlevel = Math.max(lastSeriesZLevel, zlevel); + } + if (key) { + if (zlevel === lastSeriesZLevel && key !== lastSeriesKey) { + zlevel++; + } + lastSeriesKey = key; + } else if (lastSeriesKey) { + if (zlevel === lastSeriesZLevel) { + zlevel++; + } + lastSeriesKey = ""; + } + lastSeriesZLevel = zlevel; + componentModel.setZLevel(zlevel); + }); + } + } + render = (ecIns, ecModel, api2, payload, updateParams) => { + allocateZlevels(ecModel); + renderComponents(ecIns, ecModel, api2, payload, updateParams); + each(ecIns._chartsViews, function(chart) { + chart.__alive = false; + }); + renderSeries(ecIns, ecModel, api2, payload, updateParams); + each(ecIns._chartsViews, function(chart) { + if (!chart.__alive) { + chart.remove(ecModel, api2); } - updateZ$1(el, elOption, seriesModel); - if (elOption.type === 'group') { - mergeChildren(api, el, dataIndex, elOption, seriesModel); + }); + }; + renderComponents = (ecIns, ecModel, api2, payload, updateParams, dirtyList) => { + each(dirtyList || ecIns._componentsViews, function(componentView) { + const componentModel = componentView.__model; + clearStates(componentModel, componentView); + componentView.render(componentModel, ecModel, api2, payload); + updateZ3(componentModel, componentView); + updateStates(componentModel, componentView); + }); + }; + renderSeries = (ecIns, ecModel, api2, payload, updateParams, dirtyMap) => { + const scheduler = ecIns._scheduler; + updateParams = extend(updateParams || {}, { + updatedSeries: ecModel.getSeries() + }); + lifecycle_default.trigger("series:beforeupdate", ecModel, api2, updateParams); + let unfinished = false; + ecModel.eachSeries(function(seriesModel) { + const chartView = ecIns._chartsMap[seriesModel.__viewId]; + chartView.__alive = true; + const renderTask = chartView.renderTask; + scheduler.updatePayload(renderTask, payload); + clearStates(seriesModel, chartView); + if (dirtyMap && dirtyMap.get(seriesModel.uid)) { + renderTask.dirty(); + } + if (renderTask.perform(scheduler.getPerformArgs(renderTask))) { + unfinished = true; + } + chartView.group.silent = !!seriesModel.get("silent"); + updateBlend(seriesModel, chartView); + updateSeriesElementSelection(seriesModel); + }); + scheduler.unfinished = unfinished || scheduler.unfinished; + lifecycle_default.trigger("series:layoutlabels", ecModel, api2, updateParams); + lifecycle_default.trigger("series:transition", ecModel, api2, updateParams); + ecModel.eachSeries(function(seriesModel) { + const chartView = ecIns._chartsMap[seriesModel.__viewId]; + updateZ3(seriesModel, chartView); + updateStates(seriesModel, chartView); + }); + updateHoverLayerStatus(ecIns, ecModel); + lifecycle_default.trigger("series:afterupdate", ecModel, api2, updateParams); + }; + markStatusToUpdate = function(ecIns) { + ecIns[STATUS_NEEDS_UPDATE_KEY] = true; + ecIns.getZr().wakeUp(); + }; + applyChangedStates = function(ecIns) { + if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) { + return; + } + ecIns.getZr().storage.traverse(function(el) { + if (isElementRemoved(el)) { + return; } - if (toBeReplacedIdx >= 0) { - group.replaceAt(el, toBeReplacedIdx); - } else { - group.add(el); + applyElementStates(el); + }); + ecIns[STATUS_NEEDS_UPDATE_KEY] = false; + }; + function applyElementStates(el) { + const newStates = []; + const oldStates = el.currentStates; + for (let i = 0; i < oldStates.length; i++) { + const stateName = oldStates[i]; + if (!(stateName === "emphasis" || stateName === "blur" || stateName === "select")) { + newStates.push(stateName); + } + } + if (el.selected && el.states.select) { + newStates.push("select"); + } + if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) { + newStates.push("emphasis"); + } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) { + newStates.push("blur"); + } + el.useStates(newStates); + } + function updateHoverLayerStatus(ecIns, ecModel) { + const zr = ecIns._zr; + const storage2 = zr.storage; + let elCount = 0; + storage2.traverse(function(el) { + if (!el.isGroup) { + elCount++; } - return el; - } - // `el` must not be null/undefined. - function doesElNeedRecreate(el, elOption, seriesModel) { - var elInner = customInnerStore(el); - var elOptionType = elOption.type; - var elOptionShape = elOption.shape; - var elOptionStyle = elOption.style; - return ( - // Always create new if universal transition is enabled. - // Because we do transition after render. It needs to know what old element is. Replacement will loose it. - seriesModel.isUniversalTransitionEnabled() - // If `elOptionType` is `null`, follow the merge principle. - || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath - // // FIXME test and remove this restriction? - // || (elOptionType === 'text' - // && hasOwn(elOptionStyle, 'text') - // && (elOptionStyle as TextStyleProps).text !== elInner.customText - // ) - ); - } - - function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) { - // Based on the "merge" principle, if no clipPath provided, - // do nothing. The exists clip will be totally removed only if - // `el.clipPath` is `false`. Otherwise it will be merged/replaced. - var clipPathOpt = elOption.clipPath; - if (clipPathOpt === false) { - if (el && el.getClipPath()) { - el.removeClipPath(); - } - } else if (clipPathOpt) { - var clipPath = el.getClipPath(); - if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) { - clipPath = null; - } - if (!clipPath) { - clipPath = createEl(clipPathOpt); - if ("development" !== 'production') { - assert(isPath$1(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.'); - } - el.setClipPath(clipPath); + }); + if (elCount > ecModel.get("hoverLayerThreshold") && !env_default.node && !env_default.worker) { + ecModel.eachSeries(function(seriesModel) { + if (seriesModel.preventUsingHoverLayer) { + return; } - updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit); - } - // If not define `clipPath` in option, do nothing unnecessary. + const chartView = ecIns._chartsMap[seriesModel.__viewId]; + if (chartView.__alive) { + chartView.eachRendered((el) => { + if (el.states.emphasis) { + el.states.emphasis.hoverLayer = true; + } + }); + } + }); } - - function doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) { - // Group does not support textContent temporarily until necessary. - if (el.isGroup) { - return; + } + ; + function updateBlend(seriesModel, chartView) { + const blendMode = seriesModel.get("blendMode") || null; + chartView.eachRendered((el) => { + if (!el.isGroup) { + el.style.blend = blendMode; } - // Normal must be called before emphasis, for `isLegacy` detection. - processTxInfo(elOption, null, attachedTxInfo); - processTxInfo(elOption, EMPHASIS, attachedTxInfo); - // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense. - // So for simplicity, if "elOption hasOwnProperty of them but be null/undefined", we do not - // trade them as set to null to el. - // Especially: - // `elOption.textContent: false` means remove textContent. - // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state. - var txConOptNormal = attachedTxInfo.normal.conOpt; - var txConOptEmphasis = attachedTxInfo.emphasis.conOpt; - var txConOptBlur = attachedTxInfo.blur.conOpt; - var txConOptSelect = attachedTxInfo.select.conOpt; - if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) { - var textContent = el.getTextContent(); - if (txConOptNormal === false) { - textContent && el.removeTextContent(); - } else { - txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || { - type: 'text' - }; - if (!textContent) { - textContent = createEl(txConOptNormal); - el.setTextContent(textContent); - } else { - // If in some case the performance issue arised, consider - // do not clearState but update cached normal state directly. - textContent.clearStates(); - } - updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit); - var txConStlOptNormal = txConOptNormal && txConOptNormal.style; - for (var i = 0; i < STATES.length; i++) { - var stateName = STATES[i]; - if (stateName !== NORMAL) { - var txConOptOtherState = attachedTxInfo[stateName].conOpt; - updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null); - } - } - txConStlOptNormal ? textContent.dirty() : textContent.markRedraw(); - } - } - } - function processTxInfo(elOption, state, attachedTxInfo) { - var stateOpt = !state ? elOption : retrieveStateOption(elOption, state); - var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS); - var elType = elOption.type; - var txCfg = stateOpt ? stateOpt.textConfig : null; - var txConOptNormal = elOption.textContent; - var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state); - if (styleOpt && ( - // Because emphasis style has little info to detect legacy, - // if normal is legacy, emphasis is trade as legacy. - attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) { - attachedTxInfo.isLegacy = true; - var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); - // Explicitly specified `textConfig` and `textContent` has higher priority than - // the ones generated by legacy style. Otherwise if users use them and `api.style` - // at the same time, they not both work and hardly to known why. - if (!txCfg && convertResult.textConfig) { - txCfg = convertResult.textConfig; - } - if (!txConOpt && convertResult.textContent) { - txConOpt = convertResult.textContent; - } - } - if (!state && txConOpt) { - var txConOptNormal_1 = txConOpt; - // `textContent: {type: 'text'}`, the "type" is easy to be missing. So we tolerate it. - !txConOptNormal_1.type && (txConOptNormal_1.type = 'text'); - if ("development" !== 'production') { - // Do not tolerate incorrcet type for forward compat. - assert(txConOptNormal_1.type === 'text', 'textContent.type must be "text"'); - } - } - var info = !state ? attachedTxInfo.normal : attachedTxInfo[state]; - info.cfg = txCfg; - info.conOpt = txConOpt; - } - function retrieveStateOption(elOption, state) { - return !state ? elOption : elOption ? elOption[state] : null; - } - function retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) { - var style = stateOption && stateOption.style; - if (style == null && state === EMPHASIS && stateOptionNormal) { - style = stateOptionNormal.styleEmphasis; - } - return style; - } - // Usage: - // (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates - // that the existing children will not be removed, and enables the feature - // that update some of the props of some of the children simply by construct - // the returned children of `renderItem` like: - // `var children = group.children = []; children[3] = {opacity: 0.5};` - // (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children - // by child.name. But that might be lower performance. - // (3) If `elOption.$mergeChildren` is `false`, the existing children will be - // replaced totally. - // (4) If `!elOption.children`, following the "merge" principle, nothing will - // happen. - // (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the - // `el` is a group, and if any of the new child is null, it means to remove - // the element at the same index, if exists. On the other hand, if the new - // child is and empty object `{}`, it means to keep the element not changed. - // - // For implementation simpleness, do not provide a direct way to remove single - // child (otherwise the total indices of the children array have to be modified). - // User can remove a single child by setting its `ignore` to `true`. - function mergeChildren(api, el, dataIndex, elOption, seriesModel) { - var newChildren = elOption.children; - var newLen = newChildren ? newChildren.length : 0; - var mergeChildren = elOption.$mergeChildren; - // `diffChildrenByName` has been deprecated. - var byName = mergeChildren === 'byName' || elOption.diffChildrenByName; - var notMerge = mergeChildren === false; - // For better performance on roam update, only enter if necessary. - if (!newLen && !byName && !notMerge) { + }); + } + ; + function updateZ3(model, view) { + if (model.preventAutoZ) { + return; + } + const z = model.get("z") || 0; + const zlevel = model.get("zlevel") || 0; + view.eachRendered((el) => { + doUpdateZ(el, z, zlevel, -Infinity); + return true; + }); + } + ; + function doUpdateZ(el, z, zlevel, maxZ2) { + const label = el.getTextContent(); + const labelLine = el.getTextGuideLine(); + const isGroup = el.isGroup; + if (isGroup) { + const children = el.childrenRef(); + for (let i = 0; i < children.length; i++) { + maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2); + } + } else { + el.z = z; + el.zlevel = zlevel; + maxZ2 = Math.max(el.z2, maxZ2); + } + if (label) { + label.z = z; + label.zlevel = zlevel; + isFinite(maxZ2) && (label.z2 = maxZ2 + 2); + } + if (labelLine) { + const textGuideLineConfig = el.textGuideLineConfig; + labelLine.z = z; + labelLine.zlevel = zlevel; + isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1)); + } + return maxZ2; + } + function clearStates(model, view) { + view.eachRendered(function(el) { + if (isElementRemoved(el)) { return; } - if (byName) { - diffGroupChildren({ - api: api, - oldChildren: el.children() || [], - newChildren: newChildren || [], - dataIndex: dataIndex, - seriesModel: seriesModel, - group: el - }); - return; + const textContent = el.getTextContent(); + const textGuide = el.getTextGuideLine(); + if (el.stateTransition) { + el.stateTransition = null; } - notMerge && el.removeAll(); - // Mapping children of a group simply by index, which - // might be better performance. - var index = 0; - for (; index < newLen; index++) { - var newChild = newChildren[index]; - var oldChild = el.childAt(index); - if (newChild) { - if (newChild.ignore == null) { - // The old child is set to be ignored if null (see comments - // below). So we need to set ignore to be false back. - newChild.ignore = false; - } - doCreateOrUpdateEl(api, oldChild, dataIndex, newChild, seriesModel, el); - } else { - if ("development" !== 'production') { - assert(oldChild, 'renderItem should not return a group containing elements' + ' as null/undefined/{} if they do not exist before.'); - } - // If the new element option is null, it means to remove the old - // element. But we cannot really remove the element from the group - // directly, because the element order may not be stable when this - // element is added back. So we set the element to be ignored. - oldChild.ignore = true; - } - } - for (var i = el.childCount() - 1; i >= index; i--) { - var child = el.childAt(i); - removeChildFromGroup(el, child, seriesModel); - } - } - function removeChildFromGroup(group, child, seriesModel) { - // Do not support leave elements that are not mentioned in the latest - // `renderItem` return. Otherwise users may not have a clear and simple - // concept that how to control all of the elements. - child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel); - } - function diffGroupChildren(context) { - new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute(); - } - function getKey(item, idx) { - var name = item && item.name; - return name != null ? name : GROUP_DIFF_PREFIX + idx; - } - function processAddUpdate(newIndex, oldIndex) { - var context = this.context; - var childOption = newIndex != null ? context.newChildren[newIndex] : null; - var child = oldIndex != null ? context.oldChildren[oldIndex] : null; - doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group); - } - function processRemove(oldIndex) { - var context = this.context; - var child = context.oldChildren[oldIndex]; - child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel); - } - /** - * @return SVG Path data. - */ - function getPathData(shape) { - // "d" follows the SVG convention. - return shape && (shape.pathData || shape.d); - } - function hasOwnPathData(shape) { - return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd')); - } - - function install$r(registers) { - registers.registerChartView(CustomChartView); - registers.registerSeriesModel(CustomSeriesModel); - } - - var inner$a = makeInner(); - var clone$3 = clone; - var bind$1 = bind; - /** - * Base axis pointer class in 2D. - */ - var BaseAxisPointer = /** @class */function () { - function BaseAxisPointer() { - this._dragging = false; - /** - * In px, arbitrary value. Do not set too small, - * no animation is ok for most cases. - */ - this.animationThreshold = 15; - } - /** - * @implement - */ - BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) { - var value = axisPointerModel.get('value'); - var status = axisPointerModel.get('status'); - // Bind them to `this`, not in closure, otherwise they will not - // be replaced when user calling setOption in not merge mode. - this._axisModel = axisModel; - this._axisPointerModel = axisPointerModel; - this._api = api; - // Optimize: `render` will be called repeatedly during mouse move. - // So it is power consuming if performing `render` each time, - // especially on mobile device. - if (!forceRender && this._lastValue === value && this._lastStatus === status) { - return; - } - this._lastValue = value; - this._lastStatus = status; - var group = this._group; - var handle = this._handle; - if (!status || status === 'hide') { - // Do not clear here, for animation better. - group && group.hide(); - handle && handle.hide(); + if (textContent && textContent.stateTransition) { + textContent.stateTransition = null; + } + if (textGuide && textGuide.stateTransition) { + textGuide.stateTransition = null; + } + if (el.hasState()) { + el.prevStates = el.currentStates; + el.clearStates(); + } else if (el.prevStates) { + el.prevStates = null; + } + }); + } + function updateStates(model, view) { + const stateAnimationModel = model.getModel("stateAnimation"); + const enableAnimation = model.isAnimationEnabled(); + const duration = stateAnimationModel.get("duration"); + const stateTransition = duration > 0 ? { + duration, + delay: stateAnimationModel.get("delay"), + easing: stateAnimationModel.get("easing") + } : null; + view.eachRendered(function(el) { + if (el.states && el.states.emphasis) { + if (isElementRemoved(el)) { return; } - group && group.show(); - handle && handle.show(); - // Otherwise status is 'show' - var elOption = {}; - this.makeElOption(elOption, value, axisModel, axisPointerModel, api); - // Enable change axis pointer type. - var graphicKey = elOption.graphicKey; - if (graphicKey !== this._lastGraphicKey) { - this.clear(api); - } - this._lastGraphicKey = graphicKey; - var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel); - if (!group) { - group = this._group = new Group(); - this.createPointerEl(group, elOption, axisModel, axisPointerModel); - this.createLabelEl(group, elOption, axisModel, axisPointerModel); - api.getZr().add(group); - } else { - var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation); - this.updatePointerEl(group, elOption, doUpdateProps); - this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel); + if (el instanceof Path_default) { + savePathStates(el); } - updateMandatoryProps(group, axisPointerModel, true); - this._renderHandle(value); - }; - /** - * @implement - */ - BaseAxisPointer.prototype.remove = function (api) { - this.clear(api); - }; - /** - * @implement - */ - BaseAxisPointer.prototype.dispose = function (api) { - this.clear(api); - }; - /** - * @protected - */ - BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) { - var animation = axisPointerModel.get('animation'); - var axis = axisModel.axis; - var isCategoryAxis = axis.type === 'category'; - var useSnap = axisPointerModel.get('snap'); - // Value axis without snap always do not snap. - if (!useSnap && !isCategoryAxis) { - return false; + if (el.__dirty) { + const prevStates = el.prevStates; + if (prevStates) { + el.useStates(prevStates); + } } - if (animation === 'auto' || animation == null) { - var animationThreshold = this.animationThreshold; - if (isCategoryAxis && axis.getBandWidth() > animationThreshold) { - return true; + if (enableAnimation) { + el.stateTransition = stateTransition; + const textContent = el.getTextContent(); + const textGuide = el.getTextGuideLine(); + if (textContent) { + textContent.stateTransition = stateTransition; } - // It is important to auto animation when snap used. Consider if there is - // a dataZoom, animation will be disabled when too many points exist, while - // it will be enabled for better visual effect when little points exist. - if (useSnap) { - var seriesDataCount = getAxisInfo(axisModel).seriesDataCount; - var axisExtent = axis.getExtent(); - // Approximate band width - return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold; + if (textGuide) { + textGuide.stateTransition = stateTransition; } - return false; - } - return animation === true; - }; - /** - * add {pointer, label, graphicKey} to elOption - * @protected - */ - BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { - // Should be implemenented by sub-class. - }; - /** - * @protected - */ - BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) { - var pointerOption = elOption.pointer; - if (pointerOption) { - var pointerEl = inner$a(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer)); - group.add(pointerEl); } - }; - /** - * @protected - */ - BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) { - if (elOption.label) { - var labelEl = inner$a(group).labelEl = new ZRText(clone$3(elOption.label)); - group.add(labelEl); - updateLabelShowHide(labelEl, axisPointerModel); + if (el.__dirty) { + applyElementStates(el); } - }; - /** - * @protected - */ - BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) { - var pointerEl = inner$a(group).pointerEl; - if (pointerEl && elOption.pointer) { - pointerEl.setStyle(elOption.pointer.style); - updateProps(pointerEl, { - shape: elOption.pointer.shape - }); + } + }); + } + ; + createExtensionAPI = function(ecIns) { + return new class extends ExtensionAPI_default { + getCoordinateSystems() { + return ecIns._coordSysMgr.getCoordinateSystems(); + } + getComponentByElement(el) { + while (el) { + const modelInfo = el.__ecComponentInfo; + if (modelInfo != null) { + return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index); + } + el = el.parent; } - }; - /** - * @protected - */ - BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) { - var labelEl = inner$a(group).labelEl; - if (labelEl) { - labelEl.setStyle(elOption.label.style); - updateProps(labelEl, { - // Consider text length change in vertical axis, animation should - // be used on shape, otherwise the effect will be weird. - // TODOTODO - // shape: elOption.label.shape, - x: elOption.label.x, - y: elOption.label.y + } + enterEmphasis(el, highlightDigit) { + enterEmphasis(el, highlightDigit); + markStatusToUpdate(ecIns); + } + leaveEmphasis(el, highlightDigit) { + leaveEmphasis(el, highlightDigit); + markStatusToUpdate(ecIns); + } + enterBlur(el) { + enterBlur(el); + markStatusToUpdate(ecIns); + } + leaveBlur(el) { + leaveBlur(el); + markStatusToUpdate(ecIns); + } + enterSelect(el) { + enterSelect(el); + markStatusToUpdate(ecIns); + } + leaveSelect(el) { + leaveSelect(el); + markStatusToUpdate(ecIns); + } + getModel() { + return ecIns.getModel(); + } + getViewOfComponentModel(componentModel) { + return ecIns.getViewOfComponentModel(componentModel); + } + getViewOfSeriesModel(seriesModel) { + return ecIns.getViewOfSeriesModel(seriesModel); + } + }(ecIns); + }; + enableConnect = function(chart) { + function updateConnectedChartsStatus(charts, status) { + for (let i = 0; i < charts.length; i++) { + const otherChart = charts[i]; + otherChart[CONNECT_STATUS_KEY] = status; + } + } + each(eventActionMap, function(actionType, eventType) { + chart._messageCenter.on(eventType, function(event) { + if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) { + if (event && event.escapeConnect) { + return; + } + const action = chart.makeActionFromEvent(event); + const otherCharts = []; + each(instances2, function(otherChart) { + if (otherChart !== chart && otherChart.group === chart.group) { + otherCharts.push(otherChart); + } }); - updateLabelShowHide(labelEl, axisPointerModel); - } - }; - /** - * @private - */ - BaseAxisPointer.prototype._renderHandle = function (value) { - if (this._dragging || !this.updateHandleTransform) { - return; - } - var axisPointerModel = this._axisPointerModel; - var zr = this._api.getZr(); - var handle = this._handle; - var handleModel = axisPointerModel.getModel('handle'); - var status = axisPointerModel.get('status'); - if (!handleModel.get('show') || !status || status === 'hide') { - handle && zr.remove(handle); - this._handle = null; - return; - } - var isInit; - if (!this._handle) { - isInit = true; - handle = this._handle = createIcon(handleModel.get('icon'), { - cursor: 'move', - draggable: true, - onmousemove: function (e) { - // For mobile device, prevent screen slider on the button. - stop(e.event); - }, - onmousedown: bind$1(this._onHandleDragMove, this, 0, 0), - drift: bind$1(this._onHandleDragMove, this), - ondragend: bind$1(this._onHandleDragEnd, this) + updateConnectedChartsStatus(otherCharts, CONNECT_STATUS_PENDING); + each(otherCharts, function(otherChart) { + if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) { + otherChart.dispatchAction(action); + } }); - zr.add(handle); - } - updateMandatoryProps(handle, axisPointerModel, false); - // update style - handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); - // update position - var handleSize = handleModel.get('size'); - if (!isArray(handleSize)) { - handleSize = [handleSize, handleSize]; - } - handle.scaleX = handleSize[0] / 2; - handle.scaleY = handleSize[1] / 2; - createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate'); - this._moveHandleToValue(value, isInit); - }; - BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) { - updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel))); - }; - BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) { - var handle = this._handle; - if (!handle) { - return; - } - this._dragging = true; - // Persistent for throttle. - var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel); - this._payloadInfo = trans; - handle.stopAnimation(); - handle.attr(getHandleTransProps(trans)); - inner$a(handle).lastProp = null; - this._doDispatchAxisPointer(); - }; - /** - * Throttled method. - */ - BaseAxisPointer.prototype._doDispatchAxisPointer = function () { - var handle = this._handle; - if (!handle) { - return; + updateConnectedChartsStatus(otherCharts, CONNECT_STATUS_UPDATED); } - var payloadInfo = this._payloadInfo; - var axisModel = this._axisModel; - this._api.dispatchAction({ - type: 'updateAxisPointer', - x: payloadInfo.cursorPoint[0], - y: payloadInfo.cursorPoint[1], - tooltipOption: payloadInfo.tooltipOption, - axesInfo: [{ - axisDim: axisModel.axis.dim, - axisIndex: axisModel.componentIndex - }] - }); - }; - BaseAxisPointer.prototype._onHandleDragEnd = function () { - this._dragging = false; - var handle = this._handle; - if (!handle) { - return; + }); + }); + }; +}(); +var echartsProto = ECharts.prototype; +echartsProto.on = createRegisterEventWithLowercaseECharts("on"); +echartsProto.off = createRegisterEventWithLowercaseECharts("off"); +echartsProto.one = function(eventName, cb, ctx) { + const self2 = this; + deprecateLog("ECharts#one is deprecated."); + function wrapped(...args2) { + cb && cb.apply && cb.apply(this, args2); + self2.off(eventName, wrapped); + } + ; + this.on.call(this, eventName, wrapped, ctx); +}; +var MOUSE_EVENT_NAMES = [ + "click", + "dblclick", + "mouseover", + "mouseout", + "mousemove", + "mousedown", + "mouseup", + "globalout", + "contextmenu" +]; +function disposedWarning(id) { + if (true) { + warn("Instance " + id + " has been disposed"); + } +} +var actions = {}; +var eventActionMap = {}; +var dataProcessorFuncs = []; +var optionPreprocessorFuncs = []; +var visualFuncs = []; +var themeStorage = {}; +var loadingEffects = {}; +var instances2 = {}; +var connectedGroups = {}; +var idBase = +new Date() - 0; +var groupIdBase = +new Date() - 0; +var DOM_ATTRIBUTE_KEY = "_echarts_instance_"; +function init2(dom, theme2, opts) { + const isClient = !(opts && opts.ssr); + if (isClient) { + if (true) { + if (!dom) { + throw new Error("Initialize failed: invalid dom."); + } + } + const existInstance = getInstanceByDom(dom); + if (existInstance) { + if (true) { + warn("There is a chart instance already initialized on the dom."); + } + return existInstance; + } + if (true) { + if (isDom(dom) && dom.nodeName.toUpperCase() !== "CANVAS" && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) { + warn("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload."); + } + } + } + const chart = new ECharts(dom, theme2, opts); + chart.id = "ec_" + idBase++; + instances2[chart.id] = chart; + isClient && setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id); + enableConnect(chart); + lifecycle_default.trigger("afterinit", chart); + return chart; +} +function connect(groupId) { + if (isArray(groupId)) { + const charts = groupId; + groupId = null; + each(charts, function(chart) { + if (chart.group != null) { + groupId = chart.group; + } + }); + groupId = groupId || "g_" + groupIdBase++; + each(charts, function(chart) { + chart.group = groupId; + }); + } + connectedGroups[groupId] = true; + return groupId; +} +function disconnect(groupId) { + connectedGroups[groupId] = false; +} +var disConnect = disconnect; +function dispose2(chart) { + if (isString(chart)) { + chart = instances2[chart]; + } else if (!(chart instanceof ECharts)) { + chart = getInstanceByDom(chart); + } + if (chart instanceof ECharts && !chart.isDisposed()) { + chart.dispose(); + } +} +function getInstanceByDom(dom) { + return instances2[getAttribute(dom, DOM_ATTRIBUTE_KEY)]; +} +function getInstanceById(key) { + return instances2[key]; +} +function registerTheme(name, theme2) { + themeStorage[name] = theme2; +} +function registerPreprocessor(preprocessorFunc) { + if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) { + optionPreprocessorFuncs.push(preprocessorFunc); + } +} +function registerProcessor(priority, processor) { + normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT); +} +function registerPostInit(postInitFunc) { + registerUpdateLifecycle("afterinit", postInitFunc); +} +function registerPostUpdate(postUpdateFunc) { + registerUpdateLifecycle("afterupdate", postUpdateFunc); +} +function registerUpdateLifecycle(name, cb) { + lifecycle_default.on(name, cb); +} +function registerAction(actionInfo3, eventName, action) { + if (isFunction(eventName)) { + action = eventName; + eventName = ""; + } + const actionType = isObject(actionInfo3) ? actionInfo3.type : [actionInfo3, actionInfo3 = { + event: eventName + }][0]; + actionInfo3.event = (actionInfo3.event || actionType).toLowerCase(); + eventName = actionInfo3.event; + if (eventActionMap[eventName]) { + return; + } + assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName)); + if (!actions[actionType]) { + actions[actionType] = {action, actionInfo: actionInfo3}; + } + eventActionMap[eventName] = actionType; +} +function registerCoordinateSystem(type, coordSysCreator) { + CoordinateSystem_default.register(type, coordSysCreator); +} +function getCoordinateSystemDimensions(type) { + const coordSysCreator = CoordinateSystem_default.get(type); + if (coordSysCreator) { + return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice(); + } +} +function registerLayout(priority, layoutTask) { + normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, "layout"); +} +function registerVisual(priority, visualTask) { + normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, "visual"); +} +var registeredTasks = []; +function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) { + if (isFunction(priority) || isObject(priority)) { + fn = priority; + priority = defaultPriority; + } + if (true) { + if (isNaN(priority) || priority == null) { + throw new Error("Illegal priority"); + } + each(targetList, function(wrap) { + assert(wrap.__raw !== fn); + }); + } + if (indexOf(registeredTasks, fn) >= 0) { + return; + } + registeredTasks.push(fn); + const stageHandler = Scheduler_default.wrapStageHandler(fn, visualType); + stageHandler.__prio = priority; + stageHandler.__raw = fn; + targetList.push(stageHandler); +} +function registerLoading(name, loadingFx) { + loadingEffects[name] = loadingFx; +} +function setCanvasCreator(creator) { + if (true) { + deprecateLog("setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead."); + } + setPlatformAPI({ + createCanvas: creator + }); +} +function registerMap(mapName, geoJson, specialAreas) { + const registerMap3 = getImpl("registerMap"); + registerMap3 && registerMap3(mapName, geoJson, specialAreas); +} +function getMap(mapName) { + const getMap2 = getImpl("getMap"); + return getMap2 && getMap2(mapName); +} +var registerTransform = registerExternalTransform; +registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask); +registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask); +registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask); +registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask); +registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask); +registerVisual(PRIORITY_VISUAL_DECAL, decalVisual); +registerPreprocessor(globalBackwardCompat); +registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack); +registerLoading("default", defaultLoading); +registerAction({ + type: HIGHLIGHT_ACTION_TYPE, + event: HIGHLIGHT_ACTION_TYPE, + update: HIGHLIGHT_ACTION_TYPE +}, noop); +registerAction({ + type: DOWNPLAY_ACTION_TYPE, + event: DOWNPLAY_ACTION_TYPE, + update: DOWNPLAY_ACTION_TYPE +}, noop); +registerAction({ + type: SELECT_ACTION_TYPE, + event: SELECT_ACTION_TYPE, + update: SELECT_ACTION_TYPE +}, noop); +registerAction({ + type: UNSELECT_ACTION_TYPE, + event: UNSELECT_ACTION_TYPE, + update: UNSELECT_ACTION_TYPE +}, noop); +registerAction({ + type: TOGGLE_SELECT_ACTION_TYPE, + event: TOGGLE_SELECT_ACTION_TYPE, + update: TOGGLE_SELECT_ACTION_TYPE +}, noop); +registerTheme("light", light_default); +registerTheme("dark", dark_default); +var dataTool = {}; + +// src/extension.ts +var extensions = []; +var extensionRegisters = { + registerPreprocessor, + registerProcessor, + registerPostInit, + registerPostUpdate, + registerUpdateLifecycle, + registerAction, + registerCoordinateSystem, + registerLayout, + registerVisual, + registerTransform, + registerLoading, + registerMap, + registerImpl, + PRIORITY, + ComponentModel: Component_default, + ComponentView: Component_default2, + SeriesModel: Series_default, + ChartView: Chart_default, + registerComponentModel(ComponentModelClass) { + Component_default.registerClass(ComponentModelClass); + }, + registerComponentView(ComponentViewClass) { + Component_default2.registerClass(ComponentViewClass); + }, + registerSeriesModel(SeriesModelClass) { + Series_default.registerClass(SeriesModelClass); + }, + registerChartView(ChartViewClass) { + Chart_default.registerClass(ChartViewClass); + }, + registerSubTypeDefaulter(componentType, defaulter) { + Component_default.registerSubTypeDefaulter(componentType, defaulter); + }, + registerPainter(painterType, PainterCtor) { + registerPainter(painterType, PainterCtor); + } +}; +function use(ext) { + if (isArray(ext)) { + each(ext, (singleExt) => { + use(singleExt); + }); + return; + } + if (indexOf(extensions, ext) >= 0) { + return; + } + extensions.push(ext); + if (isFunction(ext)) { + ext = { + install: ext + }; + } + ext.install(extensionRegisters); +} + +// src/data/DataDiffer.ts +function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) { + return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1; +} +function defaultKeyGetter(item) { + return item; +} +var DataDiffer = class { + constructor(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) { + this._old = oldArr; + this._new = newArr; + this._oldKeyGetter = oldKeyGetter || defaultKeyGetter; + this._newKeyGetter = newKeyGetter || defaultKeyGetter; + this.context = context; + this._diffModeMultiple = diffMode === "multiple"; + } + add(func) { + this._add = func; + return this; + } + update(func) { + this._update = func; + return this; + } + updateManyToOne(func) { + this._updateManyToOne = func; + return this; + } + updateOneToMany(func) { + this._updateOneToMany = func; + return this; + } + updateManyToMany(func) { + this._updateManyToMany = func; + return this; + } + remove(func) { + this._remove = func; + return this; + } + execute() { + this[this._diffModeMultiple ? "_executeMultiple" : "_executeOneToOne"](); + } + _executeOneToOne() { + const oldArr = this._old; + const newArr = this._new; + const newDataIndexMap = {}; + const oldDataKeyArr = new Array(oldArr.length); + const newDataKeyArr = new Array(newArr.length); + this._initIndexMap(oldArr, null, oldDataKeyArr, "_oldKeyGetter"); + this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, "_newKeyGetter"); + for (let i = 0; i < oldArr.length; i++) { + const oldKey = oldDataKeyArr[i]; + const newIdxMapVal = newDataIndexMap[oldKey]; + const newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); + if (newIdxMapValLen > 1) { + const newIdx = newIdxMapVal.shift(); + if (newIdxMapVal.length === 1) { + newDataIndexMap[oldKey] = newIdxMapVal[0]; + } + this._update && this._update(newIdx, i); + } else if (newIdxMapValLen === 1) { + newDataIndexMap[oldKey] = null; + this._update && this._update(newIdxMapVal, i); + } else { + this._remove && this._remove(i); + } + } + this._performRestAdd(newDataKeyArr, newDataIndexMap); + } + _executeMultiple() { + const oldArr = this._old; + const newArr = this._new; + const oldDataIndexMap = {}; + const newDataIndexMap = {}; + const oldDataKeyArr = []; + const newDataKeyArr = []; + this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, "_oldKeyGetter"); + this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, "_newKeyGetter"); + for (let i = 0; i < oldDataKeyArr.length; i++) { + const oldKey = oldDataKeyArr[i]; + const oldIdxMapVal = oldDataIndexMap[oldKey]; + const newIdxMapVal = newDataIndexMap[oldKey]; + const oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal); + const newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); + if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) { + this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) { + this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) { + this._update && this._update(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) { + this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen > 1) { + for (let i2 = 0; i2 < oldIdxMapValLen; i2++) { + this._remove && this._remove(oldIdxMapVal[i2]); } - var value = this._axisPointerModel.get('value'); - // Consider snap or categroy axis, handle may be not consistent with - // axisPointer. So move handle to align the exact value position when - // drag ended. - this._moveHandleToValue(value); - // For the effect: tooltip will be shown when finger holding on handle - // button, and will be hidden after finger left handle button. - this._api.dispatchAction({ - type: 'hideTip' - }); - }; - /** - * @private - */ - BaseAxisPointer.prototype.clear = function (api) { - this._lastValue = null; - this._lastStatus = null; - var zr = api.getZr(); - var group = this._group; - var handle = this._handle; - if (zr && group) { - this._lastGraphicKey = null; - group && zr.remove(group); - handle && zr.remove(handle); - this._group = null; - this._handle = null; - this._payloadInfo = null; - } - clear(this, '_doDispatchAxisPointer'); - }; - /** - * @protected - */ - BaseAxisPointer.prototype.doClear = function () { - // Implemented by sub-class if necessary. - }; - BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) { - xDimIndex = xDimIndex || 0; - return { - x: xy[xDimIndex], - y: xy[1 - xDimIndex], - width: wh[xDimIndex], - height: wh[1 - xDimIndex] - }; - }; - return BaseAxisPointer; - }(); - function updateProps$1(animationModel, moveAnimation, el, props) { - // Animation optimize. - if (!propsEqual(inner$a(el).lastProp, props)) { - inner$a(el).lastProp = props; - moveAnimation ? updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props)); - } - } - function propsEqual(lastProps, newProps) { - if (isObject(lastProps) && isObject(newProps)) { - var equals_1 = true; - each(newProps, function (item, key) { - equals_1 = equals_1 && propsEqual(lastProps[key], item); - }); - return !!equals_1; } else { - return lastProps === newProps; + this._remove && this._remove(oldIdxMapVal); + } + } + this._performRestAdd(newDataKeyArr, newDataIndexMap); + } + _performRestAdd(newDataKeyArr, newDataIndexMap) { + for (let i = 0; i < newDataKeyArr.length; i++) { + const newKey = newDataKeyArr[i]; + const newIdxMapVal = newDataIndexMap[newKey]; + const idxMapValLen = dataIndexMapValueLength(newIdxMapVal); + if (idxMapValLen > 1) { + for (let j = 0; j < idxMapValLen; j++) { + this._add && this._add(newIdxMapVal[j]); + } + } else if (idxMapValLen === 1) { + this._add && this._add(newIdxMapVal); + } + newDataIndexMap[newKey] = null; + } + } + _initIndexMap(arr, map3, keyArr, keyGetterName) { + const cbModeMultiple = this._diffModeMultiple; + for (let i = 0; i < arr.length; i++) { + const key = "_ec_" + this[keyGetterName](arr[i], i); + if (!cbModeMultiple) { + keyArr[i] = key; + } + if (!map3) { + continue; + } + const idxMapVal = map3[key]; + const idxMapValLen = dataIndexMapValueLength(idxMapVal); + if (idxMapValLen === 0) { + map3[key] = i; + if (cbModeMultiple) { + keyArr.push(key); + } + } else if (idxMapValLen === 1) { + map3[key] = [idxMapVal, i]; + } else { + idxMapVal.push(i); + } + } + } +}; +var DataDiffer_default = DataDiffer; + +// src/data/helper/dimensionHelper.ts +var DimensionUserOuput = class { + constructor(encode, dimRequest) { + this._encode = encode; + this._schema = dimRequest; + } + get() { + return { + fullDimensions: this._getFullDimensionNames(), + encode: this._encode + }; + } + _getFullDimensionNames() { + if (!this._cachedDimNames) { + this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : []; + } + return this._cachedDimNames; + } +}; +function summarizeDimensions(data, schema) { + const summary = {}; + const encode = summary.encode = {}; + const notExtraCoordDimMap = createHashMap(); + let defaultedLabel = []; + let defaultedTooltip = []; + const userOutputEncode = {}; + each(data.dimensions, function(dimName) { + const dimItem = data.getDimensionInfo(dimName); + const coordDim = dimItem.coordDim; + if (coordDim) { + if (true) { + assert(VISUAL_DIMENSIONS.get(coordDim) == null); + } + const coordDimIndex = dimItem.coordDimIndex; + getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName; + if (!dimItem.isExtraCoord) { + notExtraCoordDimMap.set(coordDim, 1); + if (mayLabelDimType(dimItem.type)) { + defaultedLabel[0] = dimName; + } + getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name); + } + if (dimItem.defaultTooltip) { + defaultedTooltip.push(dimName); + } + } + VISUAL_DIMENSIONS.each(function(v, otherDim) { + const encodeArr = getOrCreateEncodeArr(encode, otherDim); + const dimIndex = dimItem.otherDims[otherDim]; + if (dimIndex != null && dimIndex !== false) { + encodeArr[dimIndex] = dimItem.name; } + }); + }); + let dataDimsOnCoord = []; + const encodeFirstDimNotExtra = {}; + notExtraCoordDimMap.each(function(v, coordDim) { + const dimArr = encode[coordDim]; + encodeFirstDimNotExtra[coordDim] = dimArr[0]; + dataDimsOnCoord = dataDimsOnCoord.concat(dimArr); + }); + summary.dataDimsOnCoord = dataDimsOnCoord; + summary.dataDimIndicesOnCoord = map(dataDimsOnCoord, (dimName) => data.getDimensionInfo(dimName).storeDimIndex); + summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra; + const encodeLabel = encode.label; + if (encodeLabel && encodeLabel.length) { + defaultedLabel = encodeLabel.slice(); + } + const encodeTooltip = encode.tooltip; + if (encodeTooltip && encodeTooltip.length) { + defaultedTooltip = encodeTooltip.slice(); + } else if (!defaultedTooltip.length) { + defaultedTooltip = defaultedLabel.slice(); + } + encode.defaultedLabel = defaultedLabel; + encode.defaultedTooltip = defaultedTooltip; + summary.userOutput = new DimensionUserOuput(userOutputEncode, schema); + 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) { + return !(dimType === "ordinal" || dimType === "time"); +} + +// src/data/SeriesDimensionDefine.ts +var SeriesDimensionDefine = class { + constructor(opt) { + this.otherDims = {}; + if (opt != null) { + extend(this, opt); + } + } +}; +var SeriesDimensionDefine_default = SeriesDimensionDefine; + +// src/data/helper/SeriesDataSchema.ts +var inner5 = makeInner(); +var dimTypeShort = { + float: "f", + int: "i", + ordinal: "o", + number: "n", + time: "t" +}; +var SeriesDataSchema = class { + constructor(opt) { + this.dimensions = opt.dimensions; + this._dimOmitted = opt.dimensionOmitted; + this.source = opt.source; + this._fullDimCount = opt.fullDimensionCount; + this._updateDimOmitted(opt.dimensionOmitted); + } + isDimensionOmitted() { + return this._dimOmitted; + } + _updateDimOmitted(dimensionOmitted) { + this._dimOmitted = dimensionOmitted; + if (!dimensionOmitted) { + return; + } + if (!this._dimNameMap) { + this._dimNameMap = ensureSourceDimNameMap(this.source); + } + } + getSourceDimensionIndex(dimName) { + return retrieve2(this._dimNameMap.get(dimName), -1); + } + getSourceDimension(dimIndex) { + const dimensionsDefine = this.source.dimensionsDefine; + if (dimensionsDefine) { + return dimensionsDefine[dimIndex]; + } + } + makeStoreSchema() { + const dimCount = this._fullDimCount; + const willRetrieveDataByName = shouldRetrieveDataByName(this.source); + const makeHashStrict = !shouldOmitUnusedDimensions(dimCount); + let dimHash = ""; + const dims = []; + for (let fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) { + let property; + let type; + let ordinalMeta; + const seriesDimDef = this.dimensions[seriesDimIdx]; + if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { + property = willRetrieveDataByName ? seriesDimDef.name : null; + type = seriesDimDef.type; + ordinalMeta = seriesDimDef.ordinalMeta; + seriesDimIdx++; + } else { + const sourceDimDef = this.getSourceDimension(fullDimIdx); + if (sourceDimDef) { + property = willRetrieveDataByName ? sourceDimDef.name : null; + type = sourceDimDef.type; + } + } + dims.push({property, type, ordinalMeta}); + if (willRetrieveDataByName && property != null && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) { + dimHash += makeHashStrict ? property.replace(/\`/g, "`1").replace(/\$/g, "`2") : property; + } + dimHash += "$"; + dimHash += dimTypeShort[type] || "f"; + if (ordinalMeta) { + dimHash += ordinalMeta.uid; + } + dimHash += "$"; + } + const source = this.source; + const hash = [ + source.seriesLayoutBy, + source.startIndex, + dimHash + ].join("$$"); + return { + dimensions: dims, + hash + }; + } + makeOutputDimensionNames() { + const result = []; + for (let fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) { + let name; + const seriesDimDef = this.dimensions[seriesDimIdx]; + if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { + if (!seriesDimDef.isCalculationCoord) { + name = seriesDimDef.name; + } + seriesDimIdx++; + } else { + const sourceDimDef = this.getSourceDimension(fullDimIdx); + if (sourceDimDef) { + name = sourceDimDef.name; + } + } + result.push(name); + } + return result; + } + appendCalculationDimension(dimDef) { + this.dimensions.push(dimDef); + dimDef.isCalculationCoord = true; + this._fullDimCount++; + this._updateDimOmitted(true); + } +}; +function isSeriesDataSchema(schema) { + return schema instanceof SeriesDataSchema; +} +function createDimNameMap(dimsDef) { + const dataDimNameMap = createHashMap(); + for (let i = 0; i < (dimsDef || []).length; i++) { + const dimDefItemRaw = dimsDef[i]; + const userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw; + if (userDimName != null && dataDimNameMap.get(userDimName) == null) { + dataDimNameMap.set(userDimName, i); + } + } + return dataDimNameMap; +} +function ensureSourceDimNameMap(source) { + const innerSource = inner5(source); + return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine)); +} +function shouldOmitUnusedDimensions(dimCount) { + return dimCount > 30; +} + +// src/data/SeriesData.ts +var isObject3 = isObject; +var map2 = map; +var CtorInt32Array2 = typeof Int32Array === "undefined" ? Array : Int32Array; +var ID_PREFIX = "e\0\0"; +var INDEX_NOT_FOUND = -1; +var TRANSFERABLE_PROPERTIES = [ + "hasItemOption", + "_nameList", + "_idList", + "_invertedIndicesMap", + "_dimSummary", + "userOutput", + "_rawData", + "_dimValueGetter", + "_nameDimIdx", + "_idDimIdx", + "_nameRepeatCount" +]; +var CLONE_PROPERTIES = [ + "_approximateExtent" +]; +var prepareInvertedIndex; +var getId; +var getIdNameFromStore; +var normalizeDimensions; +var transferProperties; +var cloneListForMapAndSample; +var makeIdFromName; +var SeriesData2 = class { + constructor(dimensionsInput, hostModel) { + this.type = "list"; + this._dimOmitted = false; + this._nameList = []; + this._idList = []; + this._visual = {}; + this._layout = {}; + this._itemVisuals = []; + this._itemLayouts = []; + this._graphicEls = []; + this._approximateExtent = {}; + this._calculationInfo = {}; + this.hasItemOption = false; + this.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "lttbDownSample", "map"]; + this.CHANGABLE_METHODS = ["filterSelf", "selectRange"]; + this.DOWNSAMPLE_METHODS = ["downSample", "lttbDownSample"]; + let dimensions; + let assignStoreDimIdx = false; + if (isSeriesDataSchema(dimensionsInput)) { + dimensions = dimensionsInput.dimensions; + this._dimOmitted = dimensionsInput.isDimensionOmitted(); + this._schema = dimensionsInput; + } else { + assignStoreDimIdx = true; + dimensions = dimensionsInput; + } + dimensions = dimensions || ["x", "y"]; + const dimensionInfos = {}; + const dimensionNames = []; + const invertedIndicesMap = {}; + let needsHasOwn = false; + const emptyObj = {}; + for (let i = 0; i < dimensions.length; i++) { + const dimInfoInput = dimensions[i]; + const dimensionInfo = isString(dimInfoInput) ? new SeriesDimensionDefine_default({name: dimInfoInput}) : !(dimInfoInput instanceof SeriesDimensionDefine_default) ? new SeriesDimensionDefine_default(dimInfoInput) : dimInfoInput; + const dimensionName = dimensionInfo.name; + dimensionInfo.type = dimensionInfo.type || "float"; + if (!dimensionInfo.coordDim) { + dimensionInfo.coordDim = dimensionName; + dimensionInfo.coordDimIndex = 0; + } + const otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {}; + dimensionNames.push(dimensionName); + dimensionInfos[dimensionName] = dimensionInfo; + if (emptyObj[dimensionName] != null) { + needsHasOwn = true; + } + if (dimensionInfo.createInvertedIndices) { + invertedIndicesMap[dimensionName] = []; + } + if (otherDims.itemName === 0) { + this._nameDimIdx = i; + } + if (otherDims.itemId === 0) { + this._idDimIdx = i; + } + if (true) { + assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0); + } + if (assignStoreDimIdx) { + dimensionInfo.storeDimIndex = i; + } + } + this.dimensions = dimensionNames; + this._dimInfos = dimensionInfos; + this._initGetDimensionInfo(needsHasOwn); + this.hostModel = hostModel; + this._invertedIndicesMap = invertedIndicesMap; + if (this._dimOmitted) { + const dimIdxToName = this._dimIdxToName = createHashMap(); + each(dimensionNames, (dimName) => { + dimIdxToName.set(dimensionInfos[dimName].storeDimIndex, dimName); + }); } - function updateLabelShowHide(labelEl, axisPointerModel) { - labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide'](); + } + getDimension(dim) { + let dimIdx = this._recognizeDimIndex(dim); + if (dimIdx == null) { + return dim; } - function getHandleTransProps(trans) { - return { - x: trans.x || 0, - y: trans.y || 0, - rotation: trans.rotation || 0 - }; + dimIdx = dim; + if (!this._dimOmitted) { + return this.dimensions[dimIdx]; + } + const dimName = this._dimIdxToName.get(dimIdx); + if (dimName != null) { + return dimName; + } + const sourceDimDef = this._schema.getSourceDimension(dimIdx); + if (sourceDimDef) { + return sourceDimDef.name; + } + } + getDimensionIndex(dim) { + const dimIdx = this._recognizeDimIndex(dim); + if (dimIdx != null) { + return dimIdx; + } + if (dim == null) { + return -1; } - function updateMandatoryProps(group, axisPointerModel, silent) { - var z = axisPointerModel.get('z'); - var zlevel = axisPointerModel.get('zlevel'); - group && group.traverse(function (el) { - if (el.type !== 'group') { - z != null && (el.z = z); - zlevel != null && (el.zlevel = zlevel); - el.silent = silent; + const dimInfo = this._getDimInfo(dim); + return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1; + } + _recognizeDimIndex(dim) { + if (isNumber(dim) || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) { + return +dim; + } + } + _getStoreDimIndex(dim) { + const dimIdx = this.getDimensionIndex(dim); + if (true) { + if (dimIdx == null) { + throw new Error("Unknown dimension " + dim); + } + } + return dimIdx; + } + getDimensionInfo(dim) { + return this._getDimInfo(this.getDimension(dim)); + } + _initGetDimensionInfo(needsHasOwn) { + const dimensionInfos = this._dimInfos; + this._getDimInfo = needsHasOwn ? (dimName) => dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : void 0 : (dimName) => dimensionInfos[dimName]; + } + getDimensionsOnCoord() { + return this._dimSummary.dataDimsOnCoord.slice(); + } + mapDimension(coordDim, idx) { + const dimensionsSummary = this._dimSummary; + if (idx == null) { + return dimensionsSummary.encodeFirstDimNotExtra[coordDim]; + } + const dims = dimensionsSummary.encode[coordDim]; + return dims ? dims[idx] : null; + } + mapDimensionsAll(coordDim) { + const dimensionsSummary = this._dimSummary; + const dims = dimensionsSummary.encode[coordDim]; + return (dims || []).slice(); + } + getStore() { + return this._store; + } + initData(data, nameList, dimValueGetter) { + let store; + if (data instanceof DataStore_default) { + store = data; + } + if (!store) { + const dimensions = this.dimensions; + const provider = isSourceInstance(data) || isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data; + store = new DataStore_default(); + const dimensionInfos = map2(dimensions, (dimName) => ({ + type: this._dimInfos[dimName].type, + property: dimName + })); + store.initData(provider, dimensionInfos, dimValueGetter); + } + this._store = store; + this._nameList = (nameList || []).slice(); + this._idList = []; + this._nameRepeatCount = {}; + this._doInit(0, store.count()); + this._dimSummary = summarizeDimensions(this, this._schema); + this.userOutput = this._dimSummary.userOutput; + } + appendData(data) { + const range = this._store.appendData(data); + this._doInit(range[0], range[1]); + } + appendValues(values, names) { + const {start: start2, end: end2} = this._store.appendValues(values, names.length); + const shouldMakeIdFromName = this._shouldMakeIdFromName(); + this._updateOrdinalMeta(); + if (names) { + for (let idx = start2; idx < end2; idx++) { + const sourceIdx = idx - start2; + this._nameList[idx] = names[sourceIdx]; + if (shouldMakeIdFromName) { + makeIdFromName(this, idx); + } + } + } + } + _updateOrdinalMeta() { + const store = this._store; + const dimensions = this.dimensions; + for (let i = 0; i < dimensions.length; i++) { + const dimInfo = this._dimInfos[dimensions[i]]; + if (dimInfo.ordinalMeta) { + store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta); + } + } + } + _shouldMakeIdFromName() { + const provider = this._store.getProvider(); + return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage; + } + _doInit(start2, end2) { + if (start2 >= end2) { + return; + } + const store = this._store; + const provider = store.getProvider(); + this._updateOrdinalMeta(); + const nameList = this._nameList; + const idList = this._idList; + const sourceFormat = provider.getSource().sourceFormat; + const isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; + if (isFormatOriginal && !provider.pure) { + const sharedDataItem = []; + for (let idx = start2; idx < end2; idx++) { + const dataItem = provider.getItem(idx, sharedDataItem); + if (!this.hasItemOption && isDataItemOption(dataItem)) { + this.hasItemOption = true; + } + if (dataItem) { + const itemName = dataItem.name; + if (nameList[idx] == null && itemName != null) { + nameList[idx] = convertOptionIdName(itemName, null); + } + const itemId = dataItem.id; + if (idList[idx] == null && itemId != null) { + idList[idx] = convertOptionIdName(itemId, null); + } + } + } + } + if (this._shouldMakeIdFromName()) { + for (let idx = start2; idx < end2; idx++) { + makeIdFromName(this, idx); + } + } + prepareInvertedIndex(this); + } + getApproximateExtent(dim) { + return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim)); + } + setApproximateExtent(extent3, dim) { + dim = this.getDimension(dim); + this._approximateExtent[dim] = extent3.slice(); + } + getCalculationInfo(key) { + return this._calculationInfo[key]; + } + setCalculationInfo(key, value) { + isObject3(key) ? extend(this._calculationInfo, key) : this._calculationInfo[key] = value; + } + getName(idx) { + const rawIndex = this.getRawIndex(idx); + let name = this._nameList[rawIndex]; + if (name == null && this._nameDimIdx != null) { + name = getIdNameFromStore(this, this._nameDimIdx, rawIndex); + } + if (name == null) { + name = ""; + } + return name; + } + _getCategory(dimIdx, idx) { + const ordinal = this._store.get(dimIdx, idx); + const ordinalMeta = this._store.getOrdinalMeta(dimIdx); + if (ordinalMeta) { + return ordinalMeta.categories[ordinal]; + } + return ordinal; + } + getId(idx) { + return getId(this, this.getRawIndex(idx)); + } + count() { + return this._store.count(); + } + get(dim, idx) { + const store = this._store; + const dimInfo = this._dimInfos[dim]; + if (dimInfo) { + return store.get(dimInfo.storeDimIndex, idx); + } + } + getByRawIndex(dim, rawIdx) { + const store = this._store; + const dimInfo = this._dimInfos[dim]; + if (dimInfo) { + return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx); + } + } + getIndices() { + return this._store.getIndices(); + } + getDataExtent(dim) { + return this._store.getDataExtent(this._getStoreDimIndex(dim)); + } + getSum(dim) { + return this._store.getSum(this._getStoreDimIndex(dim)); + } + getMedian(dim) { + return this._store.getMedian(this._getStoreDimIndex(dim)); + } + getValues(dimensions, idx) { + const store = this._store; + return isArray(dimensions) ? store.getValues(map2(dimensions, (dim) => this._getStoreDimIndex(dim)), idx) : store.getValues(dimensions); + } + hasValue(idx) { + const dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord; + for (let i = 0, len2 = dataDimIndicesOnCoord.length; i < len2; i++) { + if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) { + return false; + } + } + return true; + } + indexOfName(name) { + for (let i = 0, len2 = this._store.count(); i < len2; i++) { + if (this.getName(i) === name) { + return i; + } + } + return -1; + } + getRawIndex(idx) { + return this._store.getRawIndex(idx); + } + indexOfRawIndex(rawIndex) { + return this._store.indexOfRawIndex(rawIndex); + } + rawIndexOf(dim, value) { + const invertedIndices = dim && this._invertedIndicesMap[dim]; + if (true) { + if (!invertedIndices) { + throw new Error("Do not supported yet"); + } + } + const rawIndex = invertedIndices[value]; + if (rawIndex == null || isNaN(rawIndex)) { + return INDEX_NOT_FOUND; + } + return rawIndex; + } + indicesOfNearest(dim, value, maxDistance) { + return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance); + } + each(dims, cb, ctx) { + "use strict"; + if (isFunction(dims)) { + ctx = cb; + cb = dims; + dims = []; + } + const fCtx = ctx || this; + const dimIndices = map2(normalizeDimensions(dims), this._getStoreDimIndex, this); + this._store.each(dimIndices, fCtx ? bind(cb, fCtx) : cb); + } + filterSelf(dims, cb, ctx) { + "use strict"; + if (isFunction(dims)) { + ctx = cb; + cb = dims; + dims = []; + } + const fCtx = ctx || this; + const dimIndices = map2(normalizeDimensions(dims), this._getStoreDimIndex, this); + this._store = this._store.filter(dimIndices, fCtx ? bind(cb, fCtx) : cb); + return this; + } + selectRange(range) { + "use strict"; + const innerRange = {}; + const dims = keys(range); + const dimIndices = []; + each(dims, (dim) => { + const dimIdx = this._getStoreDimIndex(dim); + innerRange[dimIdx] = range[dim]; + dimIndices.push(dimIdx); + }); + this._store = this._store.selectRange(innerRange); + return this; + } + mapArray(dims, cb, ctx) { + "use strict"; + if (isFunction(dims)) { + ctx = cb; + cb = dims; + dims = []; + } + ctx = ctx || this; + const result = []; + this.each(dims, function() { + result.push(cb && cb.apply(this, arguments)); + }, ctx); + return result; + } + map(dims, cb, ctx, ctxCompat) { + "use strict"; + const fCtx = ctx || ctxCompat || this; + const dimIndices = map2(normalizeDimensions(dims), this._getStoreDimIndex, this); + const list = cloneListForMapAndSample(this); + list._store = this._store.map(dimIndices, fCtx ? bind(cb, fCtx) : cb); + return list; + } + modify(dims, cb, ctx, ctxCompat) { + const fCtx = ctx || ctxCompat || this; + if (true) { + each(normalizeDimensions(dims), (dim) => { + const dimInfo = this.getDimensionInfo(dim); + if (!dimInfo.isCalculationCoord) { + console.error("Danger: only stack dimension can be modified"); } }); } - - function buildElStyle(axisPointerModel) { - var axisPointerType = axisPointerModel.get('type'); - var styleModel = axisPointerModel.getModel(axisPointerType + 'Style'); - var style; - if (axisPointerType === 'line') { - style = styleModel.getLineStyle(); - style.fill = null; - } else if (axisPointerType === 'shadow') { - style = styleModel.getAreaStyle(); - style.stroke = null; - } - return style; - } - /** - * @param {Function} labelPos {align, verticalAlign, position} - */ - function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) { - var value = axisPointerModel.get('value'); - var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), { - precision: axisPointerModel.get(['label', 'precision']), - formatter: axisPointerModel.get(['label', 'formatter']) + const dimIndices = map2(normalizeDimensions(dims), this._getStoreDimIndex, this); + this._store.modify(dimIndices, fCtx ? bind(cb, fCtx) : cb); + } + downSample(dimension, rate, sampleValue, sampleIndex) { + const list = cloneListForMapAndSample(this); + list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex); + return list; + } + lttbDownSample(valueDimension, rate) { + const list = cloneListForMapAndSample(this); + list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate); + return list; + } + getRawDataItem(idx) { + return this._store.getRawDataItem(idx); + } + getItemModel(idx) { + const hostModel = this.hostModel; + const dataItem = this.getRawDataItem(idx); + return new Model_default(dataItem, hostModel, hostModel && hostModel.ecModel); + } + diff(otherList) { + const thisList = this; + return new DataDiffer_default(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function(idx) { + return getId(otherList, idx); + }, function(idx) { + return getId(thisList, idx); + }); + } + getVisual(key) { + const visual = this._visual; + return visual && visual[key]; + } + setVisual(kvObj, val) { + this._visual = this._visual || {}; + if (isObject3(kvObj)) { + extend(this._visual, kvObj); + } else { + this._visual[kvObj] = val; + } + } + getItemVisual(idx, key) { + const itemVisual = this._itemVisuals[idx]; + const val = itemVisual && itemVisual[key]; + if (val == null) { + return this.getVisual(key); + } + return val; + } + hasItemVisual() { + return this._itemVisuals.length > 0; + } + ensureUniqueItemVisual(idx, key) { + const itemVisuals = this._itemVisuals; + let itemVisual = itemVisuals[idx]; + if (!itemVisual) { + itemVisual = itemVisuals[idx] = {}; + } + let val = itemVisual[key]; + if (val == null) { + val = this.getVisual(key); + if (isArray(val)) { + val = val.slice(); + } else if (isObject3(val)) { + val = extend({}, val); + } + itemVisual[key] = val; + } + return val; + } + setItemVisual(idx, key, value) { + const itemVisual = this._itemVisuals[idx] || {}; + this._itemVisuals[idx] = itemVisual; + if (isObject3(key)) { + extend(itemVisual, key); + } else { + itemVisual[key] = value; + } + } + clearAllVisual() { + this._visual = {}; + this._itemVisuals = []; + } + setLayout(key, val) { + isObject3(key) ? extend(this._layout, key) : this._layout[key] = val; + } + getLayout(key) { + return this._layout[key]; + } + getItemLayout(idx) { + return this._itemLayouts[idx]; + } + setItemLayout(idx, layout18, merge2) { + this._itemLayouts[idx] = merge2 ? extend(this._itemLayouts[idx] || {}, layout18) : layout18; + } + clearItemLayouts() { + this._itemLayouts.length = 0; + } + setItemGraphicEl(idx, el) { + const seriesIndex = this.hostModel && this.hostModel.seriesIndex; + setCommonECData(seriesIndex, this.dataType, idx, el); + this._graphicEls[idx] = el; + } + getItemGraphicEl(idx) { + return this._graphicEls[idx]; + } + eachItemGraphicEl(cb, context) { + each(this._graphicEls, function(el, idx) { + if (el) { + cb && cb.call(context, el, idx); + } + }); + } + cloneShallow(list) { + if (!list) { + list = new SeriesData2(this._schema ? this._schema : map2(this.dimensions, this._getDimInfo, this), this.hostModel); + } + transferProperties(list, this); + list._store = this._store; + return list; + } + wrapMethod(methodName, injectFunction) { + const originalMethod = this[methodName]; + if (!isFunction(originalMethod)) { + return; + } + this.__wrappedMethods = this.__wrappedMethods || []; + this.__wrappedMethods.push(methodName); + this[methodName] = function() { + const res = originalMethod.apply(this, arguments); + return injectFunction.apply(this, [res].concat(slice(arguments))); + }; + } +}; +var SeriesData = SeriesData2; +SeriesData.internalField = function() { + prepareInvertedIndex = function(data) { + const invertedIndicesMap = data._invertedIndicesMap; + each(invertedIndicesMap, function(invertedIndices, dim) { + const dimInfo = data._dimInfos[dim]; + const ordinalMeta = dimInfo.ordinalMeta; + const store = data._store; + if (ordinalMeta) { + invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array2(ordinalMeta.categories.length); + for (let i = 0; i < invertedIndices.length; i++) { + invertedIndices[i] = INDEX_NOT_FOUND; + } + for (let i = 0; i < store.count(); i++) { + invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i; + } + } + }); + }; + getIdNameFromStore = function(data, dimIdx, idx) { + return convertOptionIdName(data._getCategory(dimIdx, idx), null); + }; + getId = function(data, rawIndex) { + let id = data._idList[rawIndex]; + if (id == null && data._idDimIdx != null) { + id = getIdNameFromStore(data, data._idDimIdx, rawIndex); + } + if (id == null) { + id = ID_PREFIX + rawIndex; + } + return id; + }; + normalizeDimensions = function(dimensions) { + if (!isArray(dimensions)) { + dimensions = dimensions != null ? [dimensions] : []; + } + return dimensions; + }; + cloneListForMapAndSample = function(original) { + const list = new SeriesData2(original._schema ? original._schema : map2(original.dimensions, original._getDimInfo, original), original.hostModel); + transferProperties(list, original); + return list; + }; + transferProperties = function(target, source) { + each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function(propName) { + if (source.hasOwnProperty(propName)) { + target[propName] = source[propName]; + } + }); + target.__wrappedMethods = source.__wrappedMethods; + each(CLONE_PROPERTIES, function(propName) { + target[propName] = clone(source[propName]); + }); + target._calculationInfo = extend({}, source._calculationInfo); + }; + makeIdFromName = function(data, idx) { + const nameList = data._nameList; + const idList = data._idList; + const nameDimIdx = data._nameDimIdx; + const idDimIdx = data._idDimIdx; + let name = nameList[idx]; + let id = idList[idx]; + if (name == null && nameDimIdx != null) { + nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx); + } + if (id == null && idDimIdx != null) { + idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx); + } + if (id == null && name != null) { + const nameRepeatCount = data._nameRepeatCount; + const nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1; + id = name; + if (nmCnt > 1) { + id += "__ec__" + nmCnt; + } + idList[idx] = id; + } + }; +}(); +var SeriesData_default = SeriesData; + +// src/export/api/helper.ts +var helper_exports = {}; +__export(helper_exports, { + createDimensions: () => createDimensions, + createList: () => createList, + createScale: () => createScale, + createSymbol: () => createSymbol, + createTextStyle: () => createTextStyle2, + dataStack: () => dataStack2, + enableHoverEmphasis: () => enableHoverEmphasis, + getECData: () => getECData, + getLayoutRect: () => getLayoutRect, + mixinAxisModelCommonMethods: () => mixinAxisModelCommonMethods +}); + +// src/data/helper/createDimensions.ts +function createDimensions(source, opt) { + return prepareSeriesDataSchema(source, opt).dimensions; +} +function prepareSeriesDataSchema(source, opt) { + if (!isSourceInstance(source)) { + source = createSourceFromSeriesDataOption(source); + } + opt = opt || {}; + const sysDims = opt.coordDimensions || []; + const dimsDef = opt.dimensionsDefine || source.dimensionsDefine || []; + const coordDimNameMap = createHashMap(); + const resultList = []; + const dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount); + const omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount); + const isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine; + const dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef); + let encodeDef = opt.encodeDefine; + if (!encodeDef && opt.encodeDefaulter) { + encodeDef = opt.encodeDefaulter(source, dimCount); + } + const encodeDefMap = createHashMap(encodeDef); + const indicesMap = new CtorInt32Array(dimCount); + for (let i = 0; i < indicesMap.length; i++) { + indicesMap[i] = -1; + } + function getResultItem(dimIdx) { + const idx = indicesMap[dimIdx]; + if (idx < 0) { + const dimDefItemRaw = dimsDef[dimIdx]; + const dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : {name: dimDefItemRaw}; + const resultItem = new SeriesDimensionDefine_default(); + const userDimName = dimDefItem.name; + if (userDimName != null && dataDimNameMap.get(userDimName) != null) { + resultItem.name = resultItem.displayName = userDimName; + } + dimDefItem.type != null && (resultItem.type = dimDefItem.type); + dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); + const newIdx = resultList.length; + indicesMap[dimIdx] = newIdx; + resultItem.storeDimIndex = dimIdx; + resultList.push(resultItem); + return resultItem; + } + return resultList[idx]; + } + if (!omitUnusedDimensions) { + for (let i = 0; i < dimCount; i++) { + getResultItem(i); + } + } + encodeDefMap.each(function(dataDimsRaw, coordDim) { + const dataDims = normalizeToArray(dataDimsRaw).slice(); + if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) { + encodeDefMap.set(coordDim, false); + return; + } + const validDataDims = encodeDefMap.set(coordDim, []); + each(dataDims, function(resultDimIdxOrName, idx) { + const resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName; + if (resultDimIdx != null && resultDimIdx < dimCount) { + validDataDims[idx] = resultDimIdx; + applyDim(getResultItem(resultDimIdx), coordDim, idx); + } + }); + }); + let availDimIdx = 0; + each(sysDims, function(sysDimItemRaw) { + let coordDim; + let sysDimItemDimsDef; + let sysDimItemOtherDims; + let sysDimItem; + if (isString(sysDimItemRaw)) { + coordDim = sysDimItemRaw; + sysDimItem = {}; + } else { + sysDimItem = sysDimItemRaw; + coordDim = sysDimItem.name; + const ordinalMeta = sysDimItem.ordinalMeta; + sysDimItem.ordinalMeta = null; + sysDimItem = extend({}, sysDimItem); + sysDimItem.ordinalMeta = ordinalMeta; + sysDimItemDimsDef = sysDimItem.dimsDef; + sysDimItemOtherDims = sysDimItem.otherDims; + sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null; + } + let dataDims = encodeDefMap.get(coordDim); + if (dataDims === false) { + return; + } + dataDims = normalizeToArray(dataDims); + if (!dataDims.length) { + for (let i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { + while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) { + availDimIdx++; + } + availDimIdx < dimCount && dataDims.push(availDimIdx++); + } + } + each(dataDims, function(resultDimIdx, coordDimIndex) { + const resultItem = getResultItem(resultDimIdx); + if (isUsingSourceDimensionsDef && sysDimItem.type != null) { + resultItem.type = sysDimItem.type; + } + applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex); + if (resultItem.name == null && sysDimItemDimsDef) { + let sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex]; + !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { + name: sysDimItemDimsDefItem + }); + resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name; + resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip; + } + sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims); + }); + }); + function applyDim(resultItem, coordDim, coordDimIndex) { + if (VISUAL_DIMENSIONS.get(coordDim) != null) { + resultItem.otherDims[coordDim] = coordDimIndex; + } else { + resultItem.coordDim = coordDim; + resultItem.coordDimIndex = coordDimIndex; + coordDimNameMap.set(coordDim, true); + } + } + const generateCoord = opt.generateCoord; + let generateCoordCount = opt.generateCoordCount; + const fromZero = generateCoordCount != null; + generateCoordCount = generateCoord ? generateCoordCount || 1 : 0; + const extra = generateCoord || "value"; + function ifNoNameFillWithCoordName(resultItem) { + if (resultItem.name == null) { + resultItem.name = resultItem.coordDim; + } + } + if (!omitUnusedDimensions) { + for (let resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { + const resultItem = getResultItem(resultDimIdx); + const coordDim = resultItem.coordDim; + if (coordDim == null) { + resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero); + resultItem.coordDimIndex = 0; + if (!generateCoord || generateCoordCount <= 0) { + resultItem.isExtraCoord = true; + } + generateCoordCount--; + } + ifNoNameFillWithCoordName(resultItem); + if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) { + resultItem.type = "ordinal"; + } + } + } else { + each(resultList, (resultItem) => { + ifNoNameFillWithCoordName(resultItem); + }); + resultList.sort((item0, item1) => item0.storeDimIndex - item1.storeDimIndex); + } + removeDuplication(resultList); + return new SeriesDataSchema({ + source, + dimensions: resultList, + fullDimensionCount: dimCount, + dimensionOmitted: omitUnusedDimensions + }); +} +function removeDuplication(result) { + const duplicationMap = createHashMap(); + for (let i = 0; i < result.length; i++) { + const dim = result[i]; + const dimOriginalName = dim.name; + let count2 = duplicationMap.get(dimOriginalName) || 0; + if (count2 > 0) { + dim.name = dimOriginalName + (count2 - 1); + } + count2++; + duplicationMap.set(dimOriginalName, count2); + } +} +function getDimCount(source, sysDims, dimsDef, optDimCount) { + let dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0); + each(sysDims, function(sysDimItem) { + let sysDimItemDimsDef; + if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) { + dimCount = Math.max(dimCount, sysDimItemDimsDef.length); + } + }); + return dimCount; +} +function genCoordDimName(name, map3, fromZero) { + if (fromZero || map3.hasKey(name)) { + let i = 0; + while (map3.hasKey(name + i)) { + i++; + } + name += i; + } + map3.set(name, true); + return name; +} + +// src/model/referHelper.ts +var CoordSysInfo = class { + constructor(coordSysName) { + this.coordSysDims = []; + this.axisMap = createHashMap(); + this.categoryAxisMap = createHashMap(); + this.coordSysName = coordSysName; + } +}; +function getCoordSysInfoBySeries(seriesModel) { + const coordSysName = seriesModel.get("coordinateSystem"); + const result = new CoordSysInfo(coordSysName); + const fetch = fetchers[coordSysName]; + if (fetch) { + fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); + return result; + } +} +var fetchers = { + cartesian2d: function(seriesModel, result, axisMap, categoryAxisMap) { + const xAxisModel = seriesModel.getReferringComponents("xAxis", SINGLE_REFERRING).models[0]; + const yAxisModel = seriesModel.getReferringComponents("yAxis", SINGLE_REFERRING).models[0]; + if (true) { + if (!xAxisModel) { + throw new Error('xAxis "' + retrieve(seriesModel.get("xAxisIndex"), seriesModel.get("xAxisId"), 0) + '" not found'); + } + if (!yAxisModel) { + throw new Error('yAxis "' + retrieve(seriesModel.get("xAxisIndex"), seriesModel.get("yAxisId"), 0) + '" not found'); + } + } + result.coordSysDims = ["x", "y"]; + axisMap.set("x", xAxisModel); + axisMap.set("y", yAxisModel); + if (isCategory(xAxisModel)) { + categoryAxisMap.set("x", xAxisModel); + result.firstCategoryDimIndex = 0; + } + if (isCategory(yAxisModel)) { + categoryAxisMap.set("y", yAxisModel); + result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); + } + }, + singleAxis: function(seriesModel, result, axisMap, categoryAxisMap) { + const singleAxisModel = seriesModel.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0]; + if (true) { + if (!singleAxisModel) { + throw new Error("singleAxis should be specified."); + } + } + result.coordSysDims = ["single"]; + axisMap.set("single", singleAxisModel); + if (isCategory(singleAxisModel)) { + categoryAxisMap.set("single", singleAxisModel); + result.firstCategoryDimIndex = 0; + } + }, + polar: function(seriesModel, result, axisMap, categoryAxisMap) { + const polarModel = seriesModel.getReferringComponents("polar", SINGLE_REFERRING).models[0]; + const radiusAxisModel = polarModel.findAxisModel("radiusAxis"); + const angleAxisModel = polarModel.findAxisModel("angleAxis"); + if (true) { + if (!angleAxisModel) { + throw new Error("angleAxis option not found"); + } + if (!radiusAxisModel) { + throw new Error("radiusAxis option not found"); + } + } + result.coordSysDims = ["radius", "angle"]; + axisMap.set("radius", radiusAxisModel); + axisMap.set("angle", angleAxisModel); + if (isCategory(radiusAxisModel)) { + categoryAxisMap.set("radius", radiusAxisModel); + result.firstCategoryDimIndex = 0; + } + if (isCategory(angleAxisModel)) { + categoryAxisMap.set("angle", angleAxisModel); + result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); + } + }, + geo: function(seriesModel, result, axisMap, categoryAxisMap) { + result.coordSysDims = ["lng", "lat"]; + }, + parallel: function(seriesModel, result, axisMap, categoryAxisMap) { + const ecModel = seriesModel.ecModel; + const parallelModel = ecModel.getComponent("parallel", seriesModel.get("parallelIndex")); + const coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); + each(parallelModel.parallelAxisIndex, function(axisIndex, index) { + const axisModel = ecModel.getComponent("parallelAxis", axisIndex); + const axisDim = coordSysDims[index]; + axisMap.set(axisDim, axisModel); + if (isCategory(axisModel)) { + categoryAxisMap.set(axisDim, axisModel); + if (result.firstCategoryDimIndex == null) { + result.firstCategoryDimIndex = index; + } + } + }); + } +}; +function isCategory(axisModel) { + return axisModel.get("type") === "category"; +} + +// src/data/helper/dataStackHelper.ts +function enableDataStack(seriesModel, dimensionsInput, opt) { + opt = opt || {}; + let byIndex = opt.byIndex; + const stackedCoordDimension = opt.stackedCoordDimension; + let dimensionDefineList; + let schema; + let store; + if (isLegacyDimensionsInput(dimensionsInput)) { + dimensionDefineList = dimensionsInput; + } else { + schema = dimensionsInput.schema; + dimensionDefineList = schema.dimensions; + store = dimensionsInput.store; + } + const mayStack = !!(seriesModel && seriesModel.get("stack")); + let stackedByDimInfo; + let stackedDimInfo; + let stackResultDimension; + let stackedOverDimension; + each(dimensionDefineList, function(dimensionInfo, index) { + if (isString(dimensionInfo)) { + dimensionDefineList[index] = dimensionInfo = { + name: dimensionInfo + }; + } + if (mayStack && !dimensionInfo.isExtraCoord) { + if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) { + stackedByDimInfo = dimensionInfo; + } + if (!stackedDimInfo && dimensionInfo.type !== "ordinal" && dimensionInfo.type !== "time" && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) { + stackedDimInfo = dimensionInfo; + } + } + }); + if (stackedDimInfo && !byIndex && !stackedByDimInfo) { + byIndex = true; + } + if (stackedDimInfo) { + stackResultDimension = "__\0ecstackresult_" + seriesModel.id; + stackedOverDimension = "__\0ecstackedover_" + seriesModel.id; + if (stackedByDimInfo) { + stackedByDimInfo.createInvertedIndices = true; + } + const stackedDimCoordDim = stackedDimInfo.coordDim; + const stackedDimType = stackedDimInfo.type; + let stackedDimCoordIndex = 0; + each(dimensionDefineList, function(dimensionInfo) { + if (dimensionInfo.coordDim === stackedDimCoordDim) { + stackedDimCoordIndex++; + } + }); + const stackedOverDimensionDefine = { + name: stackResultDimension, + coordDim: stackedDimCoordDim, + coordDimIndex: stackedDimCoordIndex, + type: stackedDimType, + isExtraCoord: true, + isCalculationCoord: true, + storeDimIndex: dimensionDefineList.length + }; + const stackResultDimensionDefine = { + name: stackedOverDimension, + coordDim: stackedOverDimension, + coordDimIndex: stackedDimCoordIndex + 1, + type: stackedDimType, + isExtraCoord: true, + isCalculationCoord: true, + storeDimIndex: dimensionDefineList.length + 1 + }; + if (schema) { + if (store) { + stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType); + stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType); + } + schema.appendCalculationDimension(stackedOverDimensionDefine); + schema.appendCalculationDimension(stackResultDimensionDefine); + } else { + dimensionDefineList.push(stackedOverDimensionDefine); + dimensionDefineList.push(stackResultDimensionDefine); + } + } + return { + stackedDimension: stackedDimInfo && stackedDimInfo.name, + stackedByDimension: stackedByDimInfo && stackedByDimInfo.name, + isStackedByIndex: byIndex, + stackedOverDimension, + stackResultDimension + }; +} +function isLegacyDimensionsInput(dimensionsInput) { + return !isSeriesDataSchema(dimensionsInput.schema); +} +function isDimensionStacked(data, stackedDim) { + return !!stackedDim && stackedDim === data.getCalculationInfo("stackedDimension"); +} +function getStackedDimension(data, targetDim) { + return isDimensionStacked(data, targetDim) ? data.getCalculationInfo("stackResultDimension") : targetDim; +} + +// src/chart/helper/createSeriesData.ts +function getCoordSysDimDefs(seriesModel, coordSysInfo) { + const coordSysName = seriesModel.get("coordinateSystem"); + const registeredCoordSys = CoordinateSystem_default.get(coordSysName); + let coordSysDimDefs; + if (coordSysInfo && coordSysInfo.coordSysDims) { + coordSysDimDefs = map(coordSysInfo.coordSysDims, function(dim) { + const dimInfo = { + name: dim + }; + const axisModel = coordSysInfo.axisMap.get(dim); + if (axisModel) { + const axisType = axisModel.get("type"); + dimInfo.type = getDimensionTypeByAxis(axisType); + } + return dimInfo; + }); + } + if (!coordSysDimDefs) { + coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ["x", "y"]; + } + return coordSysDimDefs; +} +function injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) { + let firstCategoryDimIndex; + let hasNameEncode; + coordSysInfo && each(dimInfoList, function(dimInfo, dimIndex) { + const coordDim = dimInfo.coordDim; + const categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim); + if (categoryAxisModel) { + if (firstCategoryDimIndex == null) { + firstCategoryDimIndex = dimIndex; + } + dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta(); + if (createInvertedIndices) { + dimInfo.createInvertedIndices = true; + } + } + if (dimInfo.otherDims.itemName != null) { + hasNameEncode = true; + } + }); + if (!hasNameEncode && firstCategoryDimIndex != null) { + dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0; + } + return firstCategoryDimIndex; +} +function createSeriesData(sourceRaw, seriesModel, opt) { + opt = opt || {}; + const sourceManager = seriesModel.getSourceManager(); + let source; + let isOriginalSource = false; + if (sourceRaw) { + isOriginalSource = true; + source = createSourceFromSeriesDataOption(sourceRaw); + } else { + source = sourceManager.getSource(); + isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL; + } + const coordSysInfo = getCoordSysInfoBySeries(seriesModel); + const coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo); + const useEncodeDefaulter = opt.useEncodeDefaulter; + const encodeDefaulter = isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null; + const createDimensionOptions = { + coordDimensions: coordSysDimDefs, + generateCoord: opt.generateCoord, + encodeDefine: seriesModel.getEncode(), + encodeDefaulter, + canOmitUnusedDimensions: !isOriginalSource + }; + const schema = prepareSeriesDataSchema(source, createDimensionOptions); + const firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo); + const store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null; + const stackCalculationInfo = enableDataStack(seriesModel, {schema, store}); + const data = new SeriesData_default(schema, seriesModel); + data.setCalculationInfo(stackCalculationInfo); + const dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function(itemOpt, dimName, dataIndex, dimIndex) { + return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex); + } : null; + data.hasItemOption = false; + data.initData(isOriginalSource ? source : store, null, dimValueGetter); + return data; +} +function isNeedCompleteOrdinalData(source) { + if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) { + const sampleItem = firstDataNotNull(source.data || []); + return !isArray(getDataItemValue(sampleItem)); + } +} +function firstDataNotNull(arr) { + let i = 0; + while (i < arr.length && arr[i] == null) { + i++; + } + return arr[i]; +} +var createSeriesData_default = createSeriesData; + +// src/scale/Scale.ts +var Scale = class { + constructor(setting) { + this._setting = setting || {}; + this._extent = [Infinity, -Infinity]; + } + getSetting(name) { + return this._setting[name]; + } + unionExtent(other) { + const extent3 = this._extent; + other[0] < extent3[0] && (extent3[0] = other[0]); + other[1] > extent3[1] && (extent3[1] = other[1]); + } + unionExtentFromData(data, dim) { + this.unionExtent(data.getApproximateExtent(dim)); + } + getExtent() { + return this._extent.slice(); + } + setExtent(start2, end2) { + const thisExtent = this._extent; + if (!isNaN(start2)) { + thisExtent[0] = start2; + } + if (!isNaN(end2)) { + thisExtent[1] = end2; + } + } + isInExtentRange(value) { + return this._extent[0] <= value && this._extent[1] >= value; + } + isBlank() { + return this._isBlank; + } + setBlank(isBlank) { + this._isBlank = isBlank; + } +}; +enableClassManagement(Scale); +var Scale_default = Scale; + +// src/data/OrdinalMeta.ts +var uidBase = 0; +var OrdinalMeta = class { + constructor(opt) { + this.categories = opt.categories || []; + this._needCollect = opt.needCollect; + this._deduplication = opt.deduplication; + this.uid = ++uidBase; + } + static createByAxisModel(axisModel) { + const option = axisModel.option; + const data = option.data; + const categories = data && map(data, getName); + return new OrdinalMeta({ + categories, + needCollect: !categories, + deduplication: option.dedplication !== false + }); + } + getOrdinal(category) { + return this._getOrCreateMap().get(category); + } + parseAndCollect(category) { + let index; + const needCollect = this._needCollect; + if (!isString(category) && !needCollect) { + return category; + } + if (needCollect && !this._deduplication) { + index = this.categories.length; + this.categories[index] = category; + return index; + } + const map3 = this._getOrCreateMap(); + index = map3.get(category); + if (index == null) { + if (needCollect) { + index = this.categories.length; + this.categories[index] = category; + map3.set(category, index); + } else { + index = NaN; + } + } + return index; + } + _getOrCreateMap() { + return this._map || (this._map = createHashMap(this.categories)); + } +}; +function getName(obj) { + if (isObject(obj) && obj.value != null) { + return obj.value; + } else { + return obj + ""; + } +} +var OrdinalMeta_default = OrdinalMeta; + +// src/scale/helper.ts +function isValueNice(val) { + const exp10 = Math.pow(10, quantityExponent(Math.abs(val))); + const f = Math.abs(val / exp10); + return f === 0 || f === 1 || f === 2 || f === 3 || f === 5; +} +function isIntervalOrLogScale(scale4) { + return scale4.type === "interval" || scale4.type === "log"; +} +function intervalScaleNiceTicks(extent3, splitNumber, minInterval, maxInterval) { + const result = {}; + const span = extent3[1] - extent3[0]; + let interval = result.interval = nice(span / splitNumber, true); + if (minInterval != null && interval < minInterval) { + interval = result.interval = minInterval; + } + if (maxInterval != null && interval > maxInterval) { + interval = result.interval = maxInterval; + } + const precision = result.intervalPrecision = getIntervalPrecision(interval); + const niceTickExtent = result.niceTickExtent = [ + round(Math.ceil(extent3[0] / interval) * interval, precision), + round(Math.floor(extent3[1] / interval) * interval, precision) + ]; + fixExtent(niceTickExtent, extent3); + return result; +} +function increaseInterval(interval) { + const exp10 = Math.pow(10, quantityExponent(interval)); + let f = interval / exp10; + if (!f) { + f = 1; + } else if (f === 2) { + f = 3; + } else if (f === 3) { + f = 5; + } else { + f *= 2; + } + return round(f * exp10); +} +function getIntervalPrecision(interval) { + return getPrecision(interval) + 2; +} +function clamp(niceTickExtent, idx, extent3) { + niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent3[1]), extent3[0]); +} +function fixExtent(niceTickExtent, extent3) { + !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent3[0]); + !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent3[1]); + clamp(niceTickExtent, 0, extent3); + clamp(niceTickExtent, 1, extent3); + if (niceTickExtent[0] > niceTickExtent[1]) { + niceTickExtent[0] = niceTickExtent[1]; + } +} +function contain2(val, extent3) { + return val >= extent3[0] && val <= extent3[1]; +} +function normalize2(val, extent3) { + if (extent3[1] === extent3[0]) { + return 0.5; + } + return (val - extent3[0]) / (extent3[1] - extent3[0]); +} +function scale3(val, extent3) { + return val * (extent3[1] - extent3[0]) + extent3[0]; +} + +// src/scale/Ordinal.ts +var OrdinalScale = class extends Scale_default { + constructor(setting) { + super(setting); + this.type = "ordinal"; + let ordinalMeta = this.getSetting("ordinalMeta"); + if (!ordinalMeta) { + ordinalMeta = new OrdinalMeta_default({}); + } + if (isArray(ordinalMeta)) { + ordinalMeta = new OrdinalMeta_default({ + categories: map(ordinalMeta, (item) => isObject(item) ? item.value : item) }); - var labelModel = axisPointerModel.getModel('label'); - var paddings = normalizeCssArray$1(labelModel.get('padding') || 0); - var font = labelModel.getFont(); - var textRect = getBoundingRect(text, font); - var position = labelPos.position; - var width = textRect.width + paddings[1] + paddings[3]; - var height = textRect.height + paddings[0] + paddings[2]; - // Adjust by align. - var align = labelPos.align; - align === 'right' && (position[0] -= width); - align === 'center' && (position[0] -= width / 2); - var verticalAlign = labelPos.verticalAlign; - verticalAlign === 'bottom' && (position[1] -= height); - verticalAlign === 'middle' && (position[1] -= height / 2); - // Not overflow ec container - confineInContainer(position, width, height, api); - var bgColor = labelModel.get('backgroundColor'); - if (!bgColor || bgColor === 'auto') { - bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']); - } - elOption.label = { - // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')}, - x: position[0], - y: position[1], - style: createTextStyle(labelModel, { - text: text, - font: font, - fill: labelModel.getTextColor(), - padding: paddings, - backgroundColor: bgColor - }), - // Label should be over axisPointer. - z2: 10 - }; } - // Do not overflow ec container - function confineInContainer(position, width, height, api) { - var viewWidth = api.getWidth(); - var viewHeight = api.getHeight(); - position[0] = Math.min(position[0] + width, viewWidth) - width; - position[1] = Math.min(position[1] + height, viewHeight) - height; - position[0] = Math.max(position[0], 0); - position[1] = Math.max(position[1], 0); - } - function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { - value = axis.scale.parse(value); - var text = axis.scale.getLabel({ - value: value - }, { - // If `precision` is set, width can be fixed (like '12.00500'), which - // helps to debounce when when moving label. - precision: opt.precision + this._ordinalMeta = ordinalMeta; + this._extent = this.getSetting("extent") || [0, ordinalMeta.categories.length - 1]; + } + parse(val) { + if (val == null) { + return NaN; + } + return isString(val) ? this._ordinalMeta.getOrdinal(val) : Math.round(val); + } + contain(rank) { + rank = this.parse(rank); + return contain2(rank, this._extent) && this._ordinalMeta.categories[rank] != null; + } + normalize(val) { + val = this._getTickNumber(this.parse(val)); + return normalize2(val, this._extent); + } + scale(val) { + val = Math.round(scale3(val, this._extent)); + return this.getRawOrdinalNumber(val); + } + getTicks() { + const ticks = []; + const extent3 = this._extent; + let rank = extent3[0]; + while (rank <= extent3[1]) { + ticks.push({ + value: rank }); - var formatter = opt.formatter; - if (formatter) { - var params_1 = { - value: getAxisRawValue(axis, { - value: value - }), - axisDimension: axis.dim, - axisIndex: axis.index, - seriesData: [] - }; - each(seriesDataIndices, function (idxItem) { - var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); - var dataIndex = idxItem.dataIndexInside; - var dataParams = series && series.getDataParams(dataIndex); - dataParams && params_1.seriesData.push(dataParams); + rank++; + } + return ticks; + } + getMinorTicks(splitNumber) { + return; + } + setSortInfo(info) { + if (info == null) { + this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null; + return; + } + const infoOrdinalNumbers = info.ordinalNumbers; + const ordinalsByTick = this._ordinalNumbersByTick = []; + const ticksByOrdinal = this._ticksByOrdinalNumber = []; + let tickNum = 0; + const allCategoryLen = this._ordinalMeta.categories.length; + for (const len2 = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len2; ++tickNum) { + const ordinalNumber = infoOrdinalNumbers[tickNum]; + ordinalsByTick[tickNum] = ordinalNumber; + ticksByOrdinal[ordinalNumber] = tickNum; + } + let unusedOrdinal = 0; + for (; tickNum < allCategoryLen; ++tickNum) { + while (ticksByOrdinal[unusedOrdinal] != null) { + unusedOrdinal++; + } + ; + ordinalsByTick.push(unusedOrdinal); + ticksByOrdinal[unusedOrdinal] = tickNum; + } + } + _getTickNumber(ordinal) { + const ticksByOrdinalNumber = this._ticksByOrdinalNumber; + return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal; + } + getRawOrdinalNumber(tickNumber) { + const ordinalNumbersByTick = this._ordinalNumbersByTick; + return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber; + } + getLabel(tick) { + if (!this.isBlank()) { + const ordinalNumber = this.getRawOrdinalNumber(tick.value); + const cateogry = this._ordinalMeta.categories[ordinalNumber]; + return cateogry == null ? "" : cateogry + ""; + } + } + count() { + return this._extent[1] - this._extent[0] + 1; + } + unionExtentFromData(data, dim) { + this.unionExtent(data.getApproximateExtent(dim)); + } + isInExtentRange(value) { + value = this._getTickNumber(value); + return this._extent[0] <= value && this._extent[1] >= value; + } + getOrdinalMeta() { + return this._ordinalMeta; + } + calcNiceTicks() { + } + calcNiceExtent() { + } +}; +OrdinalScale.type = "ordinal"; +Scale_default.registerClass(OrdinalScale); +var Ordinal_default = OrdinalScale; + +// src/scale/Interval.ts +var roundNumber = round; +var IntervalScale = class extends Scale_default { + constructor() { + super(...arguments); + this.type = "interval"; + this._interval = 0; + this._intervalPrecision = 2; + } + parse(val) { + return val; + } + contain(val) { + return contain2(val, this._extent); + } + normalize(val) { + return normalize2(val, this._extent); + } + scale(val) { + return scale3(val, this._extent); + } + setExtent(start2, end2) { + const thisExtent = this._extent; + if (!isNaN(start2)) { + thisExtent[0] = parseFloat(start2); + } + if (!isNaN(end2)) { + thisExtent[1] = parseFloat(end2); + } + } + unionExtent(other) { + const extent3 = this._extent; + other[0] < extent3[0] && (extent3[0] = other[0]); + other[1] > extent3[1] && (extent3[1] = other[1]); + this.setExtent(extent3[0], extent3[1]); + } + getInterval() { + return this._interval; + } + setInterval(interval) { + this._interval = interval; + this._niceExtent = this._extent.slice(); + this._intervalPrecision = getIntervalPrecision(interval); + } + getTicks(expandToNicedExtent) { + const interval = this._interval; + const extent3 = this._extent; + const niceTickExtent = this._niceExtent; + const intervalPrecision = this._intervalPrecision; + const ticks = []; + if (!interval) { + return ticks; + } + const safeLimit = 1e4; + if (extent3[0] < niceTickExtent[0]) { + if (expandToNicedExtent) { + ticks.push({ + value: roundNumber(niceTickExtent[0] - interval, intervalPrecision) }); - if (isString(formatter)) { - text = formatter.replace('{value}', text); - } else if (isFunction(formatter)) { - text = formatter(params_1); - } - } - return text; - } - function getTransformedPosition(axis, value, layoutInfo) { - var transform = create$1(); - rotate(transform, transform, layoutInfo.rotation); - translate(transform, transform, layoutInfo.position); - return applyTransform$1([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform); - } - function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) { - // @ts-ignore - var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection); - layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']); - buildLabelElOption(elOption, axisModel, axisPointerModel, api, { - position: getTransformedPosition(axisModel.axis, value, layoutInfo), - align: textLayout.textAlign, - verticalAlign: textLayout.textVerticalAlign - }); - } - function makeLineShape(p1, p2, xDimIndex) { - xDimIndex = xDimIndex || 0; - return { - x1: p1[xDimIndex], - y1: p1[1 - xDimIndex], - x2: p2[xDimIndex], - y2: p2[1 - xDimIndex] - }; - } - function makeRectShape(xy, wh, xDimIndex) { - xDimIndex = xDimIndex || 0; - return { - x: xy[xDimIndex], - y: xy[1 - xDimIndex], - width: wh[xDimIndex], - height: wh[1 - xDimIndex] - }; + } else { + ticks.push({ + value: extent3[0] + }); + } } - function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) { - return { - cx: cx, - cy: cy, - r0: r0, - r: r, - startAngle: startAngle, - endAngle: endAngle, - clockwise: true - }; + let tick = niceTickExtent[0]; + while (tick <= niceTickExtent[1]) { + ticks.push({ + value: tick + }); + tick = roundNumber(tick + interval, intervalPrecision); + if (tick === ticks[ticks.length - 1].value) { + break; + } + if (ticks.length > safeLimit) { + return []; + } } - - var CartesianAxisPointer = /** @class */function (_super) { - __extends(CartesianAxisPointer, _super); - function CartesianAxisPointer() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @override - */ - CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { - var axis = axisModel.axis; - var grid = axis.grid; - var axisPointerType = axisPointerModel.get('type'); - var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); - var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true)); - if (axisPointerType && axisPointerType !== 'none') { - var elStyle = buildElStyle(axisPointerModel); - var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent); - pointerOption.style = elStyle; - elOption.graphicKey = pointerOption.type; - elOption.pointer = pointerOption; - } - var layoutInfo = layout$1(grid.model, axisModel); - buildCartesianSingleLabelElOption( - // @ts-ignore - value, elOption, layoutInfo, axisModel, axisPointerModel, api); - }; - /** - * @override - */ - CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) { - var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, { - labelInside: false + const lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1]; + if (extent3[1] > lastNiceTick) { + if (expandToNicedExtent) { + ticks.push({ + value: roundNumber(lastNiceTick + interval, intervalPrecision) }); - // @ts-ignore - layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']); - var pos = getTransformedPosition(axisModel.axis, value, layoutInfo); - return { - x: pos[0], - y: pos[1], - rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) - }; - }; - /** - * @override - */ - CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) { - var axis = axisModel.axis; - var grid = axis.grid; - var axisExtent = axis.getGlobalExtent(true); - var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); - var dimIndex = axis.dim === 'x' ? 0 : 1; - var currPosition = [transform.x, transform.y]; - currPosition[dimIndex] += delta[dimIndex]; - currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); - currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); - var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; - var cursorPoint = [cursorOtherValue, cursorOtherValue]; - cursorPoint[dimIndex] = currPosition[dimIndex]; - // Make tooltip do not overlap axisPointer and in the middle of the grid. - var tooltipOptions = [{ - verticalAlign: 'middle' - }, { - align: 'center' - }]; - return { - x: currPosition[0], - y: currPosition[1], - rotation: transform.rotation, - cursorPoint: cursorPoint, - tooltipOption: tooltipOptions[dimIndex] - }; - }; - return CartesianAxisPointer; - }(BaseAxisPointer); - function getCartesian(grid, axis) { - var opt = {}; - opt[axis.dim + 'AxisIndex'] = axis.index; - return grid.getCartesian(opt); - } - var pointerShapeBuilder = { - line: function (axis, pixelValue, otherExtent) { - var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis)); - return { - type: 'Line', - subPixelOptimize: true, - shape: targetShape - }; - }, - shadow: function (axis, pixelValue, otherExtent) { - var bandWidth = Math.max(1, axis.getBandWidth()); - var span = otherExtent[1] - otherExtent[0]; - return { - type: 'Rect', - shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis)) - }; + } else { + ticks.push({ + value: extent3[1] + }); + } + } + return ticks; + } + getMinorTicks(splitNumber) { + const ticks = this.getTicks(true); + const minorTicks = []; + const extent3 = this.getExtent(); + for (let i = 1; i < ticks.length; i++) { + const nextTick = ticks[i]; + const prevTick = ticks[i - 1]; + let count2 = 0; + const minorTicksGroup = []; + const interval = nextTick.value - prevTick.value; + const minorInterval = interval / splitNumber; + while (count2 < splitNumber - 1) { + const minorTick = roundNumber(prevTick.value + (count2 + 1) * minorInterval); + if (minorTick > extent3[0] && minorTick < extent3[1]) { + minorTicksGroup.push(minorTick); + } + count2++; + } + minorTicks.push(minorTicksGroup); + } + return minorTicks; + } + getLabel(data, opt) { + if (data == null) { + return ""; + } + let precision = opt && opt.precision; + if (precision == null) { + precision = getPrecision(data.value) || 0; + } else if (precision === "auto") { + precision = this._intervalPrecision; + } + const dataNum = roundNumber(data.value, precision, true); + return addCommas(dataNum); + } + calcNiceTicks(splitNumber, minInterval, maxInterval) { + splitNumber = splitNumber || 5; + const extent3 = this._extent; + let span = extent3[1] - extent3[0]; + if (!isFinite(span)) { + return; + } + if (span < 0) { + span = -span; + extent3.reverse(); + } + const result = intervalScaleNiceTicks(extent3, splitNumber, minInterval, maxInterval); + this._intervalPrecision = result.intervalPrecision; + this._interval = result.interval; + this._niceExtent = result.niceTickExtent; + } + calcNiceExtent(opt) { + const extent3 = this._extent; + if (extent3[0] === extent3[1]) { + if (extent3[0] !== 0) { + const expandSize = Math.abs(extent3[0]); + if (!opt.fixMax) { + extent3[1] += expandSize / 2; + extent3[0] -= expandSize / 2; + } else { + extent3[0] -= expandSize / 2; + } + } else { + extent3[1] = 1; + } + } + const span = extent3[1] - extent3[0]; + if (!isFinite(span)) { + extent3[0] = 0; + extent3[1] = 1; + } + this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); + const interval = this._interval; + if (!opt.fixMin) { + extent3[0] = roundNumber(Math.floor(extent3[0] / interval) * interval); + } + if (!opt.fixMax) { + extent3[1] = roundNumber(Math.ceil(extent3[1] / interval) * interval); + } + } + setNiceExtent(min3, max3) { + this._niceExtent = [min3, max3]; + } +}; +IntervalScale.type = "interval"; +Scale_default.registerClass(IntervalScale); +var Interval_default = IntervalScale; + +// src/util/vendor.ts +var supportFloat32Array = typeof Float32Array !== "undefined"; +var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array; +function createFloat32Array(arg) { + if (isArray(arg)) { + return supportFloat32Array ? new Float32Array(arg) : arg; + } + return new Float32ArrayCtor(arg); +} + +// src/layout/barGrid.ts +var STACK_PREFIX = "__ec_stack_"; +function getSeriesStackId(seriesModel) { + return seriesModel.get("stack") || STACK_PREFIX + seriesModel.seriesIndex; +} +function getAxisKey(axis) { + return axis.dim + axis.index; +} +function getLayoutOnAxis(opt) { + const params = []; + const baseAxis = opt.axis; + const axisKey = "axis0"; + if (baseAxis.type !== "category") { + return; + } + const bandWidth = baseAxis.getBandWidth(); + for (let i = 0; i < opt.count || 0; i++) { + params.push(defaults({ + bandWidth, + axisKey, + stackId: STACK_PREFIX + i + }, opt)); + } + const widthAndOffsets = doCalBarWidthAndOffset(params); + const result = []; + for (let i = 0; i < opt.count; i++) { + const item = widthAndOffsets[axisKey][STACK_PREFIX + i]; + item.offsetCenter = item.offset + item.width / 2; + result.push(item); + } + return result; +} +function prepareLayoutBarSeries(seriesType2, ecModel) { + const seriesModels = []; + ecModel.eachSeriesByType(seriesType2, function(seriesModel) { + if (isOnCartesian(seriesModel)) { + seriesModels.push(seriesModel); + } + }); + return seriesModels; +} +function getValueAxesMinGaps(barSeries) { + const axisValues = {}; + each(barSeries, function(seriesModel) { + const cartesian = seriesModel.coordinateSystem; + const baseAxis = cartesian.getBaseAxis(); + if (baseAxis.type !== "time" && baseAxis.type !== "value") { + return; + } + const data = seriesModel.getData(); + const key = baseAxis.dim + "_" + baseAxis.index; + const dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); + const store = data.getStore(); + for (let i = 0, cnt = store.count(); i < cnt; ++i) { + const value = store.get(dimIdx, i); + if (!axisValues[key]) { + axisValues[key] = [value]; + } else { + axisValues[key].push(value); } + } + }); + const axisMinGaps = {}; + for (const key in axisValues) { + if (axisValues.hasOwnProperty(key)) { + const valuesInAxis = axisValues[key]; + if (valuesInAxis) { + valuesInAxis.sort(function(a, b) { + return a - b; + }); + let min3 = null; + for (let j = 1; j < valuesInAxis.length; ++j) { + const delta = valuesInAxis[j] - valuesInAxis[j - 1]; + if (delta > 0) { + min3 = min3 === null ? delta : Math.min(min3, delta); + } + } + axisMinGaps[key] = min3; + } + } + } + return axisMinGaps; +} +function makeColumnLayout(barSeries) { + const axisMinGaps = getValueAxesMinGaps(barSeries); + const seriesInfoList = []; + each(barSeries, function(seriesModel) { + const cartesian = seriesModel.coordinateSystem; + const baseAxis = cartesian.getBaseAxis(); + const axisExtent = baseAxis.getExtent(); + let bandWidth; + if (baseAxis.type === "category") { + bandWidth = baseAxis.getBandWidth(); + } else if (baseAxis.type === "value" || baseAxis.type === "time") { + const key = baseAxis.dim + "_" + baseAxis.index; + const minGap = axisMinGaps[key]; + const extentSpan = Math.abs(axisExtent[1] - axisExtent[0]); + const scale4 = baseAxis.scale.getExtent(); + const scaleSpan = Math.abs(scale4[1] - scale4[0]); + bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; + } else { + const data = seriesModel.getData(); + bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); + } + const barWidth = parsePercent2(seriesModel.get("barWidth"), bandWidth); + const barMaxWidth = parsePercent2(seriesModel.get("barMaxWidth"), bandWidth); + const barMinWidth = parsePercent2(seriesModel.get("barMinWidth") || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth); + const barGap = seriesModel.get("barGap"); + const barCategoryGap = seriesModel.get("barCategoryGap"); + seriesInfoList.push({ + bandWidth, + barWidth, + barMaxWidth, + barMinWidth, + barGap, + barCategoryGap, + axisKey: getAxisKey(baseAxis), + stackId: getSeriesStackId(seriesModel) + }); + }); + return doCalBarWidthAndOffset(seriesInfoList); +} +function doCalBarWidthAndOffset(seriesInfoList) { + const columnsMap = {}; + each(seriesInfoList, function(seriesInfo, idx) { + const axisKey = seriesInfo.axisKey; + const bandWidth = seriesInfo.bandWidth; + const columnsOnAxis = columnsMap[axisKey] || { + bandWidth, + remainedWidth: bandWidth, + autoWidthCount: 0, + categoryGap: null, + gap: "20%", + stacks: {} }; - function getAxisDimIndex(axis) { - return axis.dim === 'x' ? 0 : 1; - } - - var AxisPointerModel = /** @class */function (_super) { - __extends(AxisPointerModel, _super); - function AxisPointerModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AxisPointerModel.type; - return _this; - } - AxisPointerModel.type = 'axisPointer'; - AxisPointerModel.defaultOption = { - // 'auto' means that show when triggered by tooltip or handle. - show: 'auto', - // zlevel: 0, - z: 50, - type: 'line', - // axispointer triggered by tootip determine snap automatically, - // see `modelHelper`. - snap: false, - triggerTooltip: true, - triggerEmphasis: true, - value: null, - status: null, - link: [], - // Do not set 'auto' here, otherwise global animation: false - // will not effect at this axispointer. - animation: null, - animationDurationUpdate: 200, - lineStyle: { - color: '#B9BEC9', - width: 1, - type: 'dashed' - }, - shadowStyle: { - color: 'rgba(210,219,238,0.2)' - }, - label: { - show: true, - formatter: null, - precision: 'auto', - margin: 3, - color: '#fff', - padding: [5, 7, 5, 7], - backgroundColor: 'auto', - borderColor: null, - borderWidth: 0, - borderRadius: 3 - }, - handle: { - show: false, - // eslint-disable-next-line - icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', - size: 45, - // handle margin is from symbol center to axis, which is stable when circular move. - margin: 50, - // color: '#1b8bbd' - // color: '#2f4554' - color: '#333', - shadowBlur: 3, - shadowColor: '#aaa', - shadowOffsetX: 0, - shadowOffsetY: 2, - // For mobile performance - throttle: 40 + const stacks = columnsOnAxis.stacks; + columnsMap[axisKey] = columnsOnAxis; + const stackId = seriesInfo.stackId; + if (!stacks[stackId]) { + columnsOnAxis.autoWidthCount++; + } + stacks[stackId] = stacks[stackId] || { + width: 0, + maxWidth: 0 + }; + let barWidth = seriesInfo.barWidth; + if (barWidth && !stacks[stackId].width) { + stacks[stackId].width = barWidth; + barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); + columnsOnAxis.remainedWidth -= barWidth; + } + const barMaxWidth = seriesInfo.barMaxWidth; + barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); + const barMinWidth = seriesInfo.barMinWidth; + barMinWidth && (stacks[stackId].minWidth = barMinWidth); + const barGap = seriesInfo.barGap; + barGap != null && (columnsOnAxis.gap = barGap); + const barCategoryGap = seriesInfo.barCategoryGap; + barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); + }); + const result = {}; + each(columnsMap, function(columnsOnAxis, coordSysName) { + result[coordSysName] = {}; + const stacks = columnsOnAxis.stacks; + const bandWidth = columnsOnAxis.bandWidth; + let categoryGapPercent = columnsOnAxis.categoryGap; + if (categoryGapPercent == null) { + const columnCount = keys(stacks).length; + categoryGapPercent = Math.max(35 - columnCount * 4, 15) + "%"; + } + const categoryGap = parsePercent2(categoryGapPercent, bandWidth); + const barGapPercent = parsePercent2(columnsOnAxis.gap, 1); + let remainedWidth = columnsOnAxis.remainedWidth; + let autoWidthCount = columnsOnAxis.autoWidthCount; + let autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); + each(stacks, function(column) { + const maxWidth = column.maxWidth; + const minWidth = column.minWidth; + if (!column.width) { + let finalWidth = autoWidth; + if (maxWidth && maxWidth < finalWidth) { + finalWidth = Math.min(maxWidth, remainedWidth); + } + if (minWidth && minWidth > finalWidth) { + finalWidth = minWidth; + } + if (finalWidth !== autoWidth) { + column.width = finalWidth; + remainedWidth -= finalWidth + barGapPercent * finalWidth; + autoWidthCount--; } - }; - return AxisPointerModel; - }(ComponentModel); - - var inner$b = makeInner(); - var each$7 = each; - /** - * @param {string} key - * @param {module:echarts/ExtensionAPI} api - * @param {Function} handler - * param: {string} currTrigger - * param: {Array.} point - */ - function register(key, api, handler) { - if (env.node) { - return; + } else { + let finalWidth = column.width; + if (maxWidth) { + finalWidth = Math.min(finalWidth, maxWidth); + } + if (minWidth) { + finalWidth = Math.max(finalWidth, minWidth); + } + column.width = finalWidth; + remainedWidth -= finalWidth + barGapPercent * finalWidth; + autoWidthCount--; } - var zr = api.getZr(); - inner$b(zr).records || (inner$b(zr).records = {}); - initGlobalListeners(zr, api); - var record = inner$b(zr).records[key] || (inner$b(zr).records[key] = {}); - record.handler = handler; + }); + autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); + let widthSum = 0; + let lastColumn; + each(stacks, function(column, idx) { + if (!column.width) { + column.width = autoWidth; + } + lastColumn = column; + widthSum += column.width * (1 + barGapPercent); + }); + if (lastColumn) { + widthSum -= lastColumn.width * barGapPercent; } - function initGlobalListeners(zr, api) { - if (inner$b(zr).initialized) { + let offset = -widthSum / 2; + each(stacks, function(column, stackId) { + result[coordSysName][stackId] = result[coordSysName][stackId] || { + bandWidth, + offset, + width: column.width + }; + offset += column.width * (1 + barGapPercent); + }); + }); + return result; +} +function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) { + if (barWidthAndOffset && axis) { + const result = barWidthAndOffset[getAxisKey(axis)]; + if (result != null && seriesModel != null) { + return result[getSeriesStackId(seriesModel)]; + } + return result; + } +} +function layout2(seriesType2, ecModel) { + const seriesModels = prepareLayoutBarSeries(seriesType2, ecModel); + const barWidthAndOffset = makeColumnLayout(seriesModels); + each(seriesModels, function(seriesModel) { + const data = seriesModel.getData(); + const cartesian = seriesModel.coordinateSystem; + const baseAxis = cartesian.getBaseAxis(); + const stackId = getSeriesStackId(seriesModel); + const columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId]; + const columnOffset = columnLayoutInfo.offset; + const columnWidth = columnLayoutInfo.width; + data.setLayout({ + bandWidth: columnLayoutInfo.bandWidth, + offset: columnOffset, + size: columnWidth + }); + }); +} +function createProgressiveLayout(seriesType2) { + return { + seriesType: seriesType2, + plan: createRenderPlanner(), + reset: function(seriesModel) { + if (!isOnCartesian(seriesModel)) { return; } - inner$b(zr).initialized = true; - useHandler('click', curry(doEnter, 'click')); - useHandler('mousemove', curry(doEnter, 'mousemove')); - // useHandler('mouseout', onLeave); - useHandler('globalout', onLeave); - function useHandler(eventType, cb) { - zr.on(eventType, function (e) { - var dis = makeDispatchAction(api); - each$7(inner$b(zr).records, function (record) { - record && cb(record, e, dis.dispatchAction); - }); - dispatchTooltipFinally(dis.pendings, api); - }); - } + const data = seriesModel.getData(); + const cartesian = seriesModel.coordinateSystem; + const baseAxis = cartesian.getBaseAxis(); + const valueAxis2 = cartesian.getOtherAxis(baseAxis); + const valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis2.dim)); + const baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); + const drawBackground = seriesModel.get("showBackground", true); + const valueDim = data.mapDimension(valueAxis2.dim); + const stackResultDim = data.getCalculationInfo("stackResultDimension"); + const stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo("stackedOnSeries"); + const isValueAxisH = valueAxis2.isHorizontal(); + const valueAxisStart = getValueAxisStart(baseAxis, valueAxis2); + const isLarge = isInLargeMode(seriesModel); + const barMinHeight = seriesModel.get("barMinHeight") || 0; + const stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim); + const columnWidth = data.getLayout("size"); + const columnOffset = data.getLayout("offset"); + return { + progress: function(params, data2) { + const count2 = params.count; + const largePoints = isLarge && createFloat32Array(count2 * 3); + const largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count2 * 3); + const largeDataIndices = isLarge && createFloat32Array(count2); + const coordLayout = cartesian.master.getRect(); + const bgSize = isValueAxisH ? coordLayout.width : coordLayout.height; + let dataIndex; + const store = data2.getStore(); + let idxOffset = 0; + while ((dataIndex = params.next()) != null) { + const value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex); + const baseValue = store.get(baseDimIdx, dataIndex); + let baseCoord = valueAxisStart; + let stackStartValue; + if (stacked) { + stackStartValue = +value - store.get(valueDimIdx, dataIndex); + } + let x; + let y; + let width; + let height; + if (isValueAxisH) { + const coord = cartesian.dataToPoint([value, baseValue]); + if (stacked) { + const startCoord = cartesian.dataToPoint([stackStartValue, baseValue]); + baseCoord = startCoord[0]; + } + x = baseCoord; + y = coord[1] + columnOffset; + width = coord[0] - baseCoord; + height = columnWidth; + if (Math.abs(width) < barMinHeight) { + width = (width < 0 ? -1 : 1) * barMinHeight; + } + } else { + const coord = cartesian.dataToPoint([baseValue, value]); + if (stacked) { + const startCoord = cartesian.dataToPoint([baseValue, stackStartValue]); + baseCoord = startCoord[1]; + } + x = coord[0] + columnOffset; + y = baseCoord; + width = columnWidth; + height = coord[1] - baseCoord; + if (Math.abs(height) < barMinHeight) { + height = (height <= 0 ? -1 : 1) * barMinHeight; + } + } + if (!isLarge) { + data2.setItemLayout(dataIndex, {x, y, width, height}); + } else { + largePoints[idxOffset] = x; + largePoints[idxOffset + 1] = y; + largePoints[idxOffset + 2] = isValueAxisH ? width : height; + if (largeBackgroundPoints) { + largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x; + largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y; + largeBackgroundPoints[idxOffset + 2] = bgSize; + } + largeDataIndices[dataIndex] = dataIndex; + } + idxOffset += 3; + } + if (isLarge) { + data2.setLayout({ + largePoints, + largeDataIndices, + largeBackgroundPoints, + valueAxisHorizontal: isValueAxisH + }); + } + } + }; + } + }; +} +function isOnCartesian(seriesModel) { + return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === "cartesian2d"; +} +function isInLargeMode(seriesModel) { + return seriesModel.pipelineContext && seriesModel.pipelineContext.large; +} +function getValueAxisStart(baseAxis, valueAxis2) { + let startValue = valueAxis2.model.get("startValue"); + if (!startValue) { + startValue = 0; + } + return valueAxis2.toGlobalCoord(valueAxis2.dataToCoord(valueAxis2.type === "log" ? startValue > 0 ? startValue : 1 : startValue)); +} + +// src/scale/Time.ts +var bisect = function(a, x, lo, hi) { + while (lo < hi) { + const mid = lo + hi >>> 1; + if (a[mid][1] < x) { + lo = mid + 1; + } else { + hi = mid; + } + } + return lo; +}; +var TimeScale = class extends Interval_default { + constructor(settings) { + super(settings); + this.type = "time"; + } + getLabel(tick) { + const useUTC = this.getSetting("useUTC"); + return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting("locale")); + } + getFormattedLabel(tick, idx, labelFormatter) { + const isUTC = this.getSetting("useUTC"); + const lang = this.getSetting("locale"); + return leveledFormat(tick, idx, labelFormatter, lang, isUTC); + } + getTicks() { + const interval = this._interval; + const extent3 = this._extent; + let ticks = []; + if (!interval) { + return ticks; + } + ticks.push({ + value: extent3[0], + level: 0 + }); + const useUTC = this.getSetting("useUTC"); + const innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent3); + ticks = ticks.concat(innerTicks); + ticks.push({ + value: extent3[1], + level: 0 + }); + return ticks; + } + calcNiceExtent(opt) { + const extent3 = this._extent; + if (extent3[0] === extent3[1]) { + extent3[0] -= ONE_DAY; + extent3[1] += ONE_DAY; + } + if (extent3[1] === -Infinity && extent3[0] === Infinity) { + const d = new Date(); + extent3[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate()); + extent3[0] = extent3[1] - ONE_DAY; + } + this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); + } + calcNiceTicks(approxTickNum, minInterval, maxInterval) { + approxTickNum = approxTickNum || 10; + const extent3 = this._extent; + const span = extent3[1] - extent3[0]; + this._approxInterval = span / approxTickNum; + if (minInterval != null && this._approxInterval < minInterval) { + this._approxInterval = minInterval; + } + if (maxInterval != null && this._approxInterval > maxInterval) { + this._approxInterval = maxInterval; + } + const scaleIntervalsLen = scaleIntervals.length; + const idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1); + this._interval = scaleIntervals[idx][1]; + this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0]; + } + parse(val) { + return isNumber(val) ? val : +parseDate(val); + } + contain(val) { + return contain2(this.parse(val), this._extent); + } + normalize(val) { + return normalize2(this.parse(val), this._extent); + } + scale(val) { + return scale3(val, this._extent); + } +}; +TimeScale.type = "time"; +var scaleIntervals = [ + ["second", ONE_SECOND], + ["minute", ONE_MINUTE], + ["hour", ONE_HOUR], + ["quarter-day", ONE_HOUR * 6], + ["half-day", ONE_HOUR * 12], + ["day", ONE_DAY * 1.2], + ["half-week", ONE_DAY * 3.5], + ["week", ONE_DAY * 7], + ["month", ONE_DAY * 31], + ["quarter", ONE_DAY * 95], + ["half-year", ONE_YEAR / 2], + ["year", ONE_YEAR] +]; +function isUnitValueSame(unit, valueA, valueB, isUTC) { + const dateA = parseDate(valueA); + const dateB = parseDate(valueB); + const isSame = (unit2) => { + return getUnitValue(dateA, unit2, isUTC) === getUnitValue(dateB, unit2, isUTC); + }; + const isSameYear = () => isSame("year"); + const isSameMonth = () => isSameYear() && isSame("month"); + const isSameDay = () => isSameMonth() && isSame("day"); + const isSameHour = () => isSameDay() && isSame("hour"); + const isSameMinute = () => isSameHour() && isSame("minute"); + const isSameSecond = () => isSameMinute() && isSame("second"); + const isSameMilliSecond = () => isSameSecond() && isSame("millisecond"); + switch (unit) { + case "year": + return isSameYear(); + case "month": + return isSameMonth(); + case "day": + return isSameDay(); + case "hour": + return isSameHour(); + case "minute": + return isSameMinute(); + case "second": + return isSameSecond(); + case "millisecond": + return isSameMilliSecond(); + } +} +function getDateInterval(approxInterval, daysInMonth) { + approxInterval /= ONE_DAY; + return approxInterval > 16 ? 16 : approxInterval > 7.5 ? 7 : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1; +} +function getMonthInterval(approxInterval) { + const APPROX_ONE_MONTH = 30 * ONE_DAY; + approxInterval /= APPROX_ONE_MONTH; + return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1; +} +function getHourInterval(approxInterval) { + approxInterval /= ONE_HOUR; + return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1; +} +function getMinutesAndSecondsInterval(approxInterval, isMinutes) { + approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND; + return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1; +} +function getMillisecondsInterval(approxInterval) { + return nice(approxInterval, true); +} +function getFirstTimestampOfUnit(date, unitName, isUTC) { + const outDate = new Date(date); + switch (getPrimaryTimeUnit(unitName)) { + case "year": + case "month": + outDate[monthSetterName(isUTC)](0); + case "day": + outDate[dateSetterName(isUTC)](1); + case "hour": + outDate[hoursSetterName(isUTC)](0); + case "minute": + outDate[minutesSetterName(isUTC)](0); + case "second": + outDate[secondsSetterName(isUTC)](0); + outDate[millisecondsSetterName(isUTC)](0); + } + return outDate.getTime(); +} +function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent3) { + const safeLimit = 1e4; + const unitNames = timeUnits; + let iter = 0; + function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out2) { + const date = new Date(minTimestamp); + let dateTime = minTimestamp; + let d = date[getMethodName](); + while (dateTime < maxTimestamp && dateTime <= extent3[1]) { + out2.push({ + value: dateTime + }); + d += interval; + date[setMethodName](d); + dateTime = date.getTime(); } - function dispatchTooltipFinally(pendings, api) { - var showLen = pendings.showTip.length; - var hideLen = pendings.hideTip.length; - var actuallyPayload; - if (showLen) { - actuallyPayload = pendings.showTip[showLen - 1]; - } else if (hideLen) { - actuallyPayload = pendings.hideTip[hideLen - 1]; + out2.push({ + value: dateTime, + notAdd: true + }); + } + function addLevelTicks(unitName, lastLevelTicks, levelTicks) { + const newAddedTicks = []; + const isFirstLevel = !lastLevelTicks.length; + if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent3[0], extent3[1], isUTC)) { + return; + } + if (isFirstLevel) { + lastLevelTicks = [{ + value: getFirstTimestampOfUnit(new Date(extent3[0]), unitName, isUTC) + }, { + value: extent3[1] + }]; + } + for (let i = 0; i < lastLevelTicks.length - 1; i++) { + const startTick = lastLevelTicks[i].value; + const endTick = lastLevelTicks[i + 1].value; + if (startTick === endTick) { + continue; + } + let interval; + let getterName; + let setterName; + let isDate = false; + switch (unitName) { + case "year": + interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365)); + getterName = fullYearGetterName(isUTC); + setterName = fullYearSetterName(isUTC); + break; + case "half-year": + case "quarter": + case "month": + interval = getMonthInterval(approxInterval); + getterName = monthGetterName(isUTC); + setterName = monthSetterName(isUTC); + break; + case "week": + case "half-week": + case "day": + interval = getDateInterval(approxInterval, 31); + getterName = dateGetterName(isUTC); + setterName = dateSetterName(isUTC); + isDate = true; + break; + case "half-day": + case "quarter-day": + case "hour": + interval = getHourInterval(approxInterval); + getterName = hoursGetterName(isUTC); + setterName = hoursSetterName(isUTC); + break; + case "minute": + interval = getMinutesAndSecondsInterval(approxInterval, true); + getterName = minutesGetterName(isUTC); + setterName = minutesSetterName(isUTC); + break; + case "second": + interval = getMinutesAndSecondsInterval(approxInterval, false); + getterName = secondsGetterName(isUTC); + setterName = secondsSetterName(isUTC); + break; + case "millisecond": + interval = getMillisecondsInterval(approxInterval); + getterName = millisecondsGetterName(isUTC); + setterName = millisecondsSetterName(isUTC); + break; } - if (actuallyPayload) { - actuallyPayload.dispatchAction = null; - api.dispatchAction(actuallyPayload); + addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks); + if (unitName === "year" && levelTicks.length > 1 && i === 0) { + levelTicks.unshift({ + value: levelTicks[0].value - interval + }); + } + } + for (let i = 0; i < newAddedTicks.length; i++) { + levelTicks.push(newAddedTicks[i]); + } + return newAddedTicks; + } + const levelsTicks = []; + let currentLevelTicks = []; + let tickCount = 0; + let lastLevelTickCount = 0; + for (let i = 0; i < unitNames.length && iter++ < safeLimit; ++i) { + const primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]); + if (!isPrimaryTimeUnit(unitNames[i])) { + continue; + } + addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks); + const nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null; + if (primaryTimeUnit !== nextPrimaryTimeUnit) { + if (currentLevelTicks.length) { + lastLevelTickCount = tickCount; + currentLevelTicks.sort((a, b) => a.value - b.value); + const levelTicksRemoveDuplicated = []; + for (let i2 = 0; i2 < currentLevelTicks.length; ++i2) { + const tickValue = currentLevelTicks[i2].value; + if (i2 === 0 || currentLevelTicks[i2 - 1].value !== tickValue) { + levelTicksRemoveDuplicated.push(currentLevelTicks[i2]); + if (tickValue >= extent3[0] && tickValue <= extent3[1]) { + tickCount++; + } + } + } + const targetTickNum = (extent3[1] - extent3[0]) / approxInterval; + if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) { + break; + } + levelsTicks.push(levelTicksRemoveDuplicated); + if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) { + break; + } } + currentLevelTicks = []; + } + } + if (true) { + if (iter >= safeLimit) { + warn("Exceed safe limit."); + } + } + const levelsTicksInExtent = filter(map(levelsTicks, (levelTicks) => { + return filter(levelTicks, (tick) => tick.value >= extent3[0] && tick.value <= extent3[1] && !tick.notAdd); + }), (levelTicks) => levelTicks.length > 0); + const ticks = []; + const maxLevel = levelsTicksInExtent.length - 1; + for (let i = 0; i < levelsTicksInExtent.length; ++i) { + const levelTicks = levelsTicksInExtent[i]; + for (let k = 0; k < levelTicks.length; ++k) { + ticks.push({ + value: levelTicks[k].value, + level: maxLevel - i + }); } - function onLeave(record, e, dispatchAction) { - record.handler('leave', null, dispatchAction); - } - function doEnter(currTrigger, record, e, dispatchAction) { - record.handler(currTrigger, e, dispatchAction); + } + ticks.sort((a, b) => a.value - b.value); + const result = []; + for (let i = 0; i < ticks.length; ++i) { + if (i === 0 || ticks[i].value !== ticks[i - 1].value) { + result.push(ticks[i]); + } + } + return result; +} +Scale_default.registerClass(TimeScale); +var Time_default = TimeScale; + +// src/scale/Log.ts +var scaleProto = Scale_default.prototype; +var intervalScaleProto = Interval_default.prototype; +var roundingErrorFix = round; +var mathFloor = Math.floor; +var mathCeil = Math.ceil; +var mathPow2 = Math.pow; +var mathLog = Math.log; +var LogScale = class extends Scale_default { + constructor() { + super(...arguments); + this.type = "log"; + this.base = 10; + this._originalScale = new Interval_default(); + this._interval = 0; + } + getTicks(expandToNicedExtent) { + const originalScale = this._originalScale; + const extent3 = this._extent; + const originalExtent = originalScale.getExtent(); + const ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent); + return map(ticks, function(tick) { + const val = tick.value; + let powVal = round(mathPow2(this.base, val)); + powVal = val === extent3[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal; + powVal = val === extent3[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal; + return { + value: powVal + }; + }, this); + } + setExtent(start2, end2) { + const base2 = mathLog(this.base); + start2 = mathLog(Math.max(0, start2)) / base2; + end2 = mathLog(Math.max(0, end2)) / base2; + intervalScaleProto.setExtent.call(this, start2, end2); + } + getExtent() { + const base2 = this.base; + const extent3 = scaleProto.getExtent.call(this); + extent3[0] = mathPow2(base2, extent3[0]); + extent3[1] = mathPow2(base2, extent3[1]); + const originalScale = this._originalScale; + const originalExtent = originalScale.getExtent(); + this._fixMin && (extent3[0] = fixRoundingError(extent3[0], originalExtent[0])); + this._fixMax && (extent3[1] = fixRoundingError(extent3[1], originalExtent[1])); + return extent3; + } + unionExtent(extent3) { + this._originalScale.unionExtent(extent3); + const base2 = this.base; + extent3[0] = mathLog(extent3[0]) / mathLog(base2); + extent3[1] = mathLog(extent3[1]) / mathLog(base2); + scaleProto.unionExtent.call(this, extent3); + } + unionExtentFromData(data, dim) { + this.unionExtent(data.getApproximateExtent(dim)); + } + calcNiceTicks(approxTickNum) { + approxTickNum = approxTickNum || 10; + const extent3 = this._extent; + const span = extent3[1] - extent3[0]; + if (span === Infinity || span <= 0) { + return; + } + let interval = quantity(span); + const err = approxTickNum / span * interval; + if (err <= 0.5) { + interval *= 10; + } + while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) { + interval *= 10; + } + const niceExtent = [ + round(mathCeil(extent3[0] / interval) * interval), + round(mathFloor(extent3[1] / interval) * interval) + ]; + this._interval = interval; + this._niceExtent = niceExtent; + } + calcNiceExtent(opt) { + intervalScaleProto.calcNiceExtent.call(this, opt); + this._fixMin = opt.fixMin; + this._fixMax = opt.fixMax; + } + parse(val) { + return val; + } + contain(val) { + val = mathLog(val) / mathLog(this.base); + return contain2(val, this._extent); + } + normalize(val) { + val = mathLog(val) / mathLog(this.base); + return normalize2(val, this._extent); + } + scale(val) { + val = scale3(val, this._extent); + return mathPow2(this.base, val); + } +}; +LogScale.type = "log"; +var proto = LogScale.prototype; +proto.getMinorTicks = intervalScaleProto.getMinorTicks; +proto.getLabel = intervalScaleProto.getLabel; +function fixRoundingError(val, originalVal) { + return roundingErrorFix(val, getPrecision(originalVal)); +} +Scale_default.registerClass(LogScale); +var Log_default = LogScale; + +// src/coord/scaleRawExtentInfo.ts +var ScaleRawExtentInfo = class { + constructor(scale4, model, originalExtent) { + this._prepareParams(scale4, model, originalExtent); + } + _prepareParams(scale4, model, dataExtent) { + if (dataExtent[1] < dataExtent[0]) { + dataExtent = [NaN, NaN]; + } + this._dataMin = dataExtent[0]; + this._dataMax = dataExtent[1]; + const isOrdinal = this._isOrdinal = scale4.type === "ordinal"; + this._needCrossZero = scale4.type === "interval" && model.getNeedCrossZero && model.getNeedCrossZero(); + let axisMinValue = model.get("min", true); + if (axisMinValue == null) { + axisMinValue = model.get("startValue", true); + } + const modelMinRaw = this._modelMinRaw = axisMinValue; + if (isFunction(modelMinRaw)) { + this._modelMinNum = parseAxisModelMinMax(scale4, modelMinRaw({ + min: dataExtent[0], + max: dataExtent[1] + })); + } else if (modelMinRaw !== "dataMin") { + this._modelMinNum = parseAxisModelMinMax(scale4, modelMinRaw); + } + const modelMaxRaw = this._modelMaxRaw = model.get("max", true); + if (isFunction(modelMaxRaw)) { + this._modelMaxNum = parseAxisModelMinMax(scale4, modelMaxRaw({ + min: dataExtent[0], + max: dataExtent[1] + })); + } else if (modelMaxRaw !== "dataMax") { + this._modelMaxNum = parseAxisModelMinMax(scale4, modelMaxRaw); + } + if (isOrdinal) { + this._axisDataLen = model.getCategories().length; + } else { + const boundaryGap = model.get("boundaryGap"); + const boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0]; + if (typeof boundaryGapArr[0] === "boolean" || typeof boundaryGapArr[1] === "boolean") { + if (true) { + console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'); + } + this._boundaryGapInner = [0, 0]; + } else { + this._boundaryGapInner = [ + parsePercent(boundaryGapArr[0], 1), + parsePercent(boundaryGapArr[1], 1) + ]; + } } - function makeDispatchAction(api) { - var pendings = { - showTip: [], - hideTip: [] + } + calculate() { + const isOrdinal = this._isOrdinal; + const dataMin = this._dataMin; + const dataMax = this._dataMax; + const axisDataLen = this._axisDataLen; + const boundaryGapInner = this._boundaryGapInner; + const span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; + let min3 = this._modelMinRaw === "dataMin" ? dataMin : this._modelMinNum; + let max3 = this._modelMaxRaw === "dataMax" ? dataMax : this._modelMaxNum; + let minFixed = min3 != null; + let maxFixed = max3 != null; + if (min3 == null) { + min3 = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span; + } + if (max3 == null) { + max3 = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span; + } + (min3 == null || !isFinite(min3)) && (min3 = NaN); + (max3 == null || !isFinite(max3)) && (max3 = NaN); + const isBlank = eqNaN(min3) || eqNaN(max3) || isOrdinal && !axisDataLen; + if (this._needCrossZero) { + if (min3 > 0 && max3 > 0 && !minFixed) { + min3 = 0; + } + if (min3 < 0 && max3 < 0 && !maxFixed) { + max3 = 0; + } + } + const determinedMin = this._determinedMin; + const determinedMax = this._determinedMax; + if (determinedMin != null) { + min3 = determinedMin; + minFixed = true; + } + if (determinedMax != null) { + max3 = determinedMax; + maxFixed = true; + } + return { + min: min3, + max: max3, + minFixed, + maxFixed, + isBlank + }; + } + modifyDataMinMax(minMaxName, val) { + if (true) { + assert(!this.frozen); + } + this[DATA_MIN_MAX_ATTR[minMaxName]] = val; + } + setDeterminedMinMax(minMaxName, val) { + const attr = DETERMINED_MIN_MAX_ATTR[minMaxName]; + if (true) { + assert(!this.frozen && this[attr] == null); + } + this[attr] = val; + } + freeze() { + this.frozen = true; + } +}; +var DETERMINED_MIN_MAX_ATTR = {min: "_determinedMin", max: "_determinedMax"}; +var DATA_MIN_MAX_ATTR = {min: "_dataMin", max: "_dataMax"}; +function ensureScaleRawExtentInfo(scale4, model, originalExtent) { + let rawExtentInfo = scale4.rawExtentInfo; + if (rawExtentInfo) { + return rawExtentInfo; + } + rawExtentInfo = new ScaleRawExtentInfo(scale4, model, originalExtent); + scale4.rawExtentInfo = rawExtentInfo; + return rawExtentInfo; +} +function parseAxisModelMinMax(scale4, minMax) { + return minMax == null ? null : eqNaN(minMax) ? NaN : scale4.parse(minMax); +} + +// src/coord/axisHelper.ts +function getScaleExtent(scale4, model) { + const scaleType = scale4.type; + const rawExtentResult = ensureScaleRawExtentInfo(scale4, model, scale4.getExtent()).calculate(); + scale4.setBlank(rawExtentResult.isBlank); + let min3 = rawExtentResult.min; + let max3 = rawExtentResult.max; + const ecModel = model.ecModel; + if (ecModel && scaleType === "time") { + const barSeriesModels = prepareLayoutBarSeries("bar", ecModel); + let isBaseAxisAndHasBarSeries = false; + each(barSeriesModels, function(seriesModel) { + isBaseAxisAndHasBarSeries = isBaseAxisAndHasBarSeries || seriesModel.getBaseAxis() === model.axis; + }); + if (isBaseAxisAndHasBarSeries) { + const barWidthAndOffset = makeColumnLayout(barSeriesModels); + const adjustedScale = adjustScaleForOverflow(min3, max3, model, barWidthAndOffset); + min3 = adjustedScale.min; + max3 = adjustedScale.max; + } + } + return { + extent: [min3, max3], + fixMin: rawExtentResult.minFixed, + fixMax: rawExtentResult.maxFixed + }; +} +function adjustScaleForOverflow(min3, max3, model, barWidthAndOffset) { + const axisExtent = model.axis.getExtent(); + const axisLength = Math.abs(axisExtent[1] - axisExtent[0]); + const barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis); + if (barsOnCurrentAxis === void 0) { + return {min: min3, max: max3}; + } + let minOverflow = Infinity; + each(barsOnCurrentAxis, function(item) { + minOverflow = Math.min(item.offset, minOverflow); + }); + let maxOverflow = -Infinity; + each(barsOnCurrentAxis, function(item) { + maxOverflow = Math.max(item.offset + item.width, maxOverflow); + }); + minOverflow = Math.abs(minOverflow); + maxOverflow = Math.abs(maxOverflow); + const totalOverFlow = minOverflow + maxOverflow; + const oldRange = max3 - min3; + const oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength; + const overflowBuffer = oldRange / oldRangePercentOfNew - oldRange; + max3 += overflowBuffer * (maxOverflow / totalOverFlow); + min3 -= overflowBuffer * (minOverflow / totalOverFlow); + return {min: min3, max: max3}; +} +function niceScaleExtent(scale4, inModel) { + const model = inModel; + const extentInfo = getScaleExtent(scale4, model); + const extent3 = extentInfo.extent; + const splitNumber = model.get("splitNumber"); + if (scale4 instanceof Log_default) { + scale4.base = model.get("logBase"); + } + const scaleType = scale4.type; + const interval = model.get("interval"); + const isIntervalOrTime = scaleType === "interval" || scaleType === "time"; + scale4.setExtent(extent3[0], extent3[1]); + scale4.calcNiceExtent({ + splitNumber, + fixMin: extentInfo.fixMin, + fixMax: extentInfo.fixMax, + minInterval: isIntervalOrTime ? model.get("minInterval") : null, + maxInterval: isIntervalOrTime ? model.get("maxInterval") : null + }); + if (interval != null) { + scale4.setInterval && scale4.setInterval(interval); + } +} +function createScaleByModel(model, axisType) { + axisType = axisType || model.get("type"); + if (axisType) { + switch (axisType) { + case "category": + return new Ordinal_default({ + ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), + extent: [Infinity, -Infinity] + }); + case "time": + return new Time_default({ + locale: model.ecModel.getLocaleModel(), + useUTC: model.ecModel.get("useUTC") + }); + default: + return new (Scale_default.getClass(axisType) || Interval_default)(); + } + } +} +function ifAxisCrossZero(axis) { + const dataExtent = axis.scale.getExtent(); + const min3 = dataExtent[0]; + const max3 = dataExtent[1]; + return !(min3 > 0 && max3 > 0 || min3 < 0 && max3 < 0); +} +function makeLabelFormatter(axis) { + const labelFormatter = axis.getLabelModel().get("formatter"); + const categoryTickStart = axis.type === "category" ? axis.scale.getExtent()[0] : null; + if (axis.scale.type === "time") { + return function(tpl) { + return function(tick, idx) { + return axis.scale.getFormattedLabel(tick, idx, tpl); + }; + }(labelFormatter); + } else if (isString(labelFormatter)) { + return function(tpl) { + return function(tick) { + const label = axis.scale.getLabel(tick); + const text = tpl.replace("{value}", label != null ? label : ""); + return text; }; - // FIXME - // better approach? - // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip, - // which may be conflict, (axisPointer call showTip but tooltip call hideTip); - // So we have to add "final stage" to merge those dispatched actions. - var dispatchAction = function (payload) { - var pendingList = pendings[payload.type]; - if (pendingList) { - pendingList.push(payload); - } else { - payload.dispatchAction = dispatchAction; - api.dispatchAction(payload); + }(labelFormatter); + } else if (isFunction(labelFormatter)) { + return function(cb) { + return function(tick, idx) { + if (categoryTickStart != null) { + idx = tick.value - categoryTickStart; } + return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? { + level: tick.level + } : null); }; - return { - dispatchAction: dispatchAction, - pendings: pendings - }; + }(labelFormatter); + } else { + return function(tick) { + return axis.scale.getLabel(tick); + }; + } +} +function getAxisRawValue(axis, tick) { + return axis.type === "category" ? axis.scale.getLabel(tick) : tick.value; +} +function estimateLabelUnionRect(axis) { + const axisModel = axis.model; + const scale4 = axis.scale; + if (!axisModel.get(["axisLabel", "show"]) || scale4.isBlank()) { + return; + } + let realNumberScaleTicks; + let tickCount; + const categoryScaleExtent = scale4.getExtent(); + if (scale4 instanceof Ordinal_default) { + tickCount = scale4.count(); + } else { + realNumberScaleTicks = scale4.getTicks(); + tickCount = realNumberScaleTicks.length; + } + const axisLabelModel = axis.getLabelModel(); + const labelFormatter = makeLabelFormatter(axis); + let rect; + let step = 1; + if (tickCount > 40) { + step = Math.ceil(tickCount / 40); + } + for (let i = 0; i < tickCount; i += step) { + const tick = realNumberScaleTicks ? realNumberScaleTicks[i] : { + value: categoryScaleExtent[0] + i + }; + const label = labelFormatter(tick, i); + const unrotatedSingleRect = axisLabelModel.getTextRect(label); + const singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get("rotate") || 0); + rect ? rect.union(singleRect) : rect = singleRect; + } + return rect; +} +function rotateTextRect(textRect, rotate2) { + const rotateRadians = rotate2 * Math.PI / 180; + const beforeWidth = textRect.width; + const beforeHeight = textRect.height; + const afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians)); + const afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians)); + const rotatedRect = new BoundingRect_default(textRect.x, textRect.y, afterWidth, afterHeight); + return rotatedRect; +} +function getOptionCategoryInterval(model) { + const interval = model.get("interval"); + return interval == null ? "auto" : interval; +} +function shouldShowAllLabels(axis) { + return axis.type === "category" && getOptionCategoryInterval(axis.getLabelModel()) === 0; +} +function getDataDimensionsOnAxis(data, axisDim) { + const dataDimMap = {}; + each(data.mapDimensionsAll(axisDim), function(dataDim) { + dataDimMap[getStackedDimension(data, dataDim)] = true; + }); + return keys(dataDimMap); +} +function unionAxisExtentFromData(dataExtent, data, axisDim) { + if (data) { + each(getDataDimensionsOnAxis(data, axisDim), function(dim) { + const seriesExtent = data.getApproximateExtent(dim); + seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); + seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); + }); + } +} + +// src/coord/axisModelCommonMixin.ts +var AxisModelCommonMixin = class { + getNeedCrossZero() { + const option = this.option; + return !option.scale; + } + getCoordSysModel() { + return; + } +}; + +// src/export/api/helper.ts +function createList(seriesModel) { + return createSeriesData_default(null, seriesModel); +} +var dataStack2 = { + isDimensionStacked, + enableDataStack, + getStackedDimension +}; +function createScale(dataExtent, option) { + let axisModel = option; + if (!(option instanceof Model_default)) { + axisModel = new Model_default(option); + } + const scale4 = createScaleByModel(axisModel); + scale4.setExtent(dataExtent[0], dataExtent[1]); + niceScaleExtent(scale4, axisModel); + return scale4; +} +function mixinAxisModelCommonMethods(Model2) { + mixin(Model2, AxisModelCommonMixin); +} +function createTextStyle2(textStyleModel, opts) { + opts = opts || {}; + return createTextStyle(textStyleModel, null, null, opts.state !== "normal"); +} + +// node_modules/zrender/src/contain/polygon.ts +var EPSILON5 = 1e-8; +function isAroundEqual2(a, b) { + return Math.abs(a - b) < EPSILON5; +} +function contain3(points4, x, y) { + let w = 0; + let p = points4[0]; + if (!p) { + return false; + } + for (let i = 1; i < points4.length; i++) { + const p2 = points4[i]; + w += windingLine(p[0], p[1], p2[0], p2[1], x, y); + p = p2; + } + const p0 = points4[0]; + if (!isAroundEqual2(p[0], p0[0]) || !isAroundEqual2(p[1], p0[1])) { + w += windingLine(p[0], p[1], p0[0], p0[1], x, y); + } + return w !== 0; +} + +// src/coord/geo/Region.ts +var TMP_TRANSFORM = []; +function transformPoints(points4, transform2) { + for (let p = 0; p < points4.length; p++) { + applyTransform(points4[p], points4[p], transform2); + } +} +function updateBBoxFromPoints(points4, min3, max3, projection) { + for (let i = 0; i < points4.length; i++) { + let p = points4[i]; + if (projection) { + p = projection.project(p); + } + if (p && isFinite(p[0]) && isFinite(p[1])) { + min(min3, min3, p); + max(max3, max3, p); + } + } +} +function centroid(points4) { + let signedArea = 0; + let cx = 0; + let cy = 0; + const len2 = points4.length; + let x0 = points4[len2 - 1][0]; + let y0 = points4[len2 - 1][1]; + for (let i = 0; i < len2; i++) { + const x1 = points4[i][0]; + const y1 = points4[i][1]; + const a = x0 * y1 - x1 * y0; + signedArea += a; + cx += (x0 + x1) * a; + cy += (y0 + y1) * a; + x0 = x1; + y0 = y1; + } + return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points4[0][0] || 0, points4[0][1] || 0]; +} +var Region = class { + constructor(name) { + this.name = name; + } + setCenter(center3) { + this._center = center3; + } + getCenter() { + let center3 = this._center; + if (!center3) { + center3 = this._center = this.calcCenter(); + } + return center3; + } +}; +var GeoJSONPolygonGeometry = class { + constructor(exterior, interiors) { + this.type = "polygon"; + this.exterior = exterior; + this.interiors = interiors; + } +}; +var GeoJSONLineStringGeometry = class { + constructor(points4) { + this.type = "linestring"; + this.points = points4; + } +}; +var GeoJSONRegion = class extends Region { + constructor(name, geometries, cp) { + super(name); + this.type = "geoJSON"; + this.geometries = geometries; + this._center = cp && [cp[0], cp[1]]; + } + calcCenter() { + const geometries = this.geometries; + let largestGeo; + let largestGeoSize = 0; + for (let i = 0; i < geometries.length; i++) { + const geo = geometries[i]; + const exterior = geo.exterior; + const size = exterior && exterior.length; + if (size > largestGeoSize) { + largestGeo = geo; + largestGeoSize = size; + } + } + if (largestGeo) { + return centroid(largestGeo.exterior); + } + const rect = this.getBoundingRect(); + return [ + rect.x + rect.width / 2, + rect.y + rect.height / 2 + ]; + } + getBoundingRect(projection) { + let rect = this._rect; + if (rect && !projection) { + return rect; } - function unregister(key, api) { - if (env.node) { - return; + const min3 = [Infinity, Infinity]; + const max3 = [-Infinity, -Infinity]; + const geometries = this.geometries; + each(geometries, (geo) => { + if (geo.type === "polygon") { + updateBBoxFromPoints(geo.exterior, min3, max3, projection); + } else { + each(geo.points, (points4) => { + updateBBoxFromPoints(points4, min3, max3, projection); + }); } - var zr = api.getZr(); - var record = (inner$b(zr).records || {})[key]; - if (record) { - inner$b(zr).records[key] = null; - } - } - - var AxisPointerView = /** @class */function (_super) { - __extends(AxisPointerView, _super); - function AxisPointerView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AxisPointerView.type; - return _this; - } - AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) { - var globalTooltipModel = ecModel.getComponent('tooltip'); - var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'; - // Register global listener in AxisPointerView to enable - // AxisPointerView to be independent to Tooltip. - register('axisPointer', api, function (currTrigger, e, dispatchAction) { - // If 'none', it is not controlled by mouse totally. - if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) { - dispatchAction({ - type: 'updateAxisPointer', - currTrigger: currTrigger, - x: e && e.offsetX, - y: e && e.offsetY - }); + }); + if (!(isFinite(min3[0]) && isFinite(min3[1]) && isFinite(max3[0]) && isFinite(max3[1]))) { + min3[0] = min3[1] = max3[0] = max3[1] = 0; + } + rect = new BoundingRect_default(min3[0], min3[1], max3[0] - min3[0], max3[1] - min3[1]); + if (!projection) { + this._rect = rect; + } + return rect; + } + contain(coord) { + const rect = this.getBoundingRect(); + const geometries = this.geometries; + if (!rect.contain(coord[0], coord[1])) { + return false; + } + loopGeo: + for (let i = 0, len2 = geometries.length; i < len2; i++) { + const geo = geometries[i]; + if (geo.type !== "polygon") { + continue; + } + const exterior = geo.exterior; + const interiors = geo.interiors; + if (contain3(exterior, coord[0], coord[1])) { + for (let k = 0; k < (interiors ? interiors.length : 0); k++) { + if (contain3(interiors[k], coord[0], coord[1])) { + continue loopGeo; + } } + return true; + } + } + return false; + } + transformTo(x, y, width, height) { + let rect = this.getBoundingRect(); + const aspect = rect.width / rect.height; + if (!width) { + width = aspect * height; + } else if (!height) { + height = width / aspect; + } + const target = new BoundingRect_default(x, y, width, height); + const transform2 = rect.calculateTransform(target); + const geometries = this.geometries; + for (let i = 0; i < geometries.length; i++) { + const geo = geometries[i]; + if (geo.type === "polygon") { + transformPoints(geo.exterior, transform2); + each(geo.interiors, (interior) => { + transformPoints(interior, transform2); + }); + } else { + each(geo.points, (points4) => { + transformPoints(points4, transform2); }); - }; - AxisPointerView.prototype.remove = function (ecModel, api) { - unregister('axisPointer', api); - }; - AxisPointerView.prototype.dispose = function (ecModel, api) { - unregister('axisPointer', api); - }; - AxisPointerView.type = 'axisPointer'; - return AxisPointerView; - }(ComponentView); - - /** - * @param finder contains {seriesIndex, dataIndex, dataIndexInside} - * @param ecModel - * @return {point: [x, y], el: ...} point Will not be null. - */ - function findPointFromSeries(finder, ecModel) { - var point = []; - var seriesIndex = finder.seriesIndex; - var seriesModel; - if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) { - return { - point: [] - }; } - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, finder); - if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) { + } + rect = this._rect; + rect.copy(target); + this._center = [ + rect.x + rect.width / 2, + rect.y + rect.height / 2 + ]; + } + cloneShallow(name) { + name == null && (name = this.name); + const newRegion = new GeoJSONRegion(name, this.geometries, this._center); + newRegion._rect = this._rect; + newRegion.transformTo = null; + return newRegion; + } +}; +var GeoSVGRegion = class extends Region { + constructor(name, elOnlyForCalculate) { + super(name); + this.type = "geoSVG"; + this._elOnlyForCalculate = elOnlyForCalculate; + } + calcCenter() { + const el = this._elOnlyForCalculate; + const rect = el.getBoundingRect(); + const center3 = [ + rect.x + rect.width / 2, + rect.y + rect.height / 2 + ]; + const mat = identity(TMP_TRANSFORM); + let target = el; + while (target && !target.isGeoSVGGraphicRoot) { + mul2(mat, target.getLocalTransform(), mat); + target = target.parent; + } + invert(mat, mat); + applyTransform(center3, center3, mat); + return center3; + } +}; + +// src/coord/geo/parseGeoJson.ts +function decode(json) { + if (!json.UTF8Encoding) { + return json; + } + const jsonCompressed = json; + let encodeScale = jsonCompressed.UTF8Scale; + if (encodeScale == null) { + encodeScale = 1024; + } + const features2 = jsonCompressed.features; + each(features2, (feature) => { + const geometry = feature.geometry; + const encodeOffsets = geometry.encodeOffsets; + const coordinates = geometry.coordinates; + if (!encodeOffsets) { + return; + } + switch (geometry.type) { + case "LineString": + geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale); + break; + case "Polygon": + decodeRings(coordinates, encodeOffsets, encodeScale); + break; + case "MultiLineString": + decodeRings(coordinates, encodeOffsets, encodeScale); + break; + case "MultiPolygon": + each(coordinates, (rings, idx) => decodeRings(rings, encodeOffsets[idx], encodeScale)); + } + }); + jsonCompressed.UTF8Encoding = false; + return jsonCompressed; +} +function decodeRings(rings, encodeOffsets, encodeScale) { + for (let c = 0; c < rings.length; c++) { + rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale); + } +} +function decodeRing(coordinate, encodeOffsets, encodeScale) { + const result = []; + let prevX = encodeOffsets[0]; + let prevY = encodeOffsets[1]; + for (let i = 0; i < coordinate.length; i += 2) { + let x = coordinate.charCodeAt(i) - 64; + let y = coordinate.charCodeAt(i + 1) - 64; + x = x >> 1 ^ -(x & 1); + y = y >> 1 ^ -(y & 1); + x += prevX; + y += prevY; + prevX = x; + prevY = y; + result.push([x / encodeScale, y / encodeScale]); + } + return result; +} +function parseGeoJSON(geoJson, nameProperty) { + geoJson = decode(geoJson); + return map(filter(geoJson.features, function(featureObj) { + return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0; + }), function(featureObj) { + const properties = featureObj.properties; + const geo = featureObj.geometry; + const geometries = []; + switch (geo.type) { + case "Polygon": + const coordinates = geo.coordinates; + geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1))); + break; + case "MultiPolygon": + each(geo.coordinates, function(item) { + if (item[0]) { + geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1))); + } + }); + break; + case "LineString": + geometries.push(new GeoJSONLineStringGeometry([geo.coordinates])); + break; + case "MultiLineString": + geometries.push(new GeoJSONLineStringGeometry(geo.coordinates)); + } + const region = new GeoJSONRegion(properties[nameProperty || "name"], geometries, properties.cp); + region.properties = properties; + return region; + }); +} + +// src/export/api/number.ts +var number_exports = {}; +__export(number_exports, { + MAX_SAFE_INTEGER: () => MAX_SAFE_INTEGER, + asc: () => asc, + getPercentWithPrecision: () => getPercentWithPrecision, + getPixelPrecision: () => getPixelPrecision, + getPrecision: () => getPrecision, + getPrecisionSafe: () => getPrecisionSafe, + isNumeric: () => isNumeric, + isRadianAroundZero: () => isRadianAroundZero, + linearMap: () => linearMap, + nice: () => nice, + numericToNumber: () => numericToNumber, + parseDate: () => parseDate, + quantile: () => quantile, + quantity: () => quantity, + quantityExponent: () => quantityExponent, + reformIntervals: () => reformIntervals, + remRadian: () => remRadian, + round: () => round +}); + +// src/export/api/time.ts +var time_exports = {}; +__export(time_exports, { + format: () => format, + parse: () => parseDate +}); + +// src/export/api/graphic.ts +var graphic_exports2 = {}; +__export(graphic_exports2, { + Arc: () => Arc_default, + BezierCurve: () => BezierCurve_default, + BoundingRect: () => BoundingRect_default, + Circle: () => Circle_default, + CompoundPath: () => CompoundPath_default, + Ellipse: () => Ellipse_default, + Group: () => Group_default, + Image: () => Image_default, + IncrementalDisplayable: () => IncrementalDisplayable_default, + Line: () => Line_default, + LinearGradient: () => LinearGradient_default, + Polygon: () => Polygon_default, + Polyline: () => Polyline_default, + RadialGradient: () => RadialGradient_default, + Rect: () => Rect_default, + Ring: () => Ring_default, + Sector: () => Sector_default, + Text: () => Text_default, + clipPointsByRect: () => clipPointsByRect, + clipRectByRect: () => clipRectByRect, + createIcon: () => createIcon, + extendPath: () => extendPath, + extendShape: () => extendShape, + getShapeClass: () => getShapeClass, + getTransform: () => getTransform, + initProps: () => initProps, + makeImage: () => makeImage, + makePath: () => makePath, + mergePath: () => mergePath2, + registerShape: () => registerShape, + resizePath: () => resizePath, + updateProps: () => updateProps +}); + +// src/export/api/format.ts +var format_exports = {}; +__export(format_exports, { + addCommas: () => addCommas, + capitalFirst: () => capitalFirst, + encodeHTML: () => encodeHTML, + formatTime: () => formatTime, + formatTpl: () => formatTpl, + getTextRect: () => getTextRect, + getTooltipMarker: () => getTooltipMarker, + normalizeCssArray: () => normalizeCssArray2, + toCamelCase: () => toCamelCase, + truncateText: () => truncateText +}); + +// src/export/api/util.ts +var util_exports2 = {}; +__export(util_exports2, { + bind: () => bind, + clone: () => clone, + curry: () => curry, + defaults: () => defaults, + each: () => each, + extend: () => extend, + filter: () => filter, + indexOf: () => indexOf, + inherits: () => inherits, + isArray: () => isArray, + isFunction: () => isFunction, + isObject: () => isObject, + isString: () => isString, + map: () => map, + merge: () => merge, + reduce: () => reduce +}); + +// src/coord/axisTickLabelBuilder.ts +var inner6 = makeInner(); +function tickValuesToNumbers(axis, values) { + const nums = map(values, (val) => axis.scale.parse(val)); + if (axis.type === "time" && nums.length > 0) { + nums.sort(); + nums.unshift(nums[0]); + nums.push(nums[nums.length - 1]); + } + return nums; +} +function createAxisLabels(axis) { + const custom = axis.getLabelModel().get("customValues"); + if (custom) { + const labelFormatter = makeLabelFormatter(axis); + const extent3 = axis.scale.getExtent(); + const tickNumbers = tickValuesToNumbers(axis, custom); + const ticks = filter(tickNumbers, (val) => val >= extent3[0] && val <= extent3[1]); + return { + labels: map(ticks, (numval) => { + const tick = {value: numval}; return { - point: [] + formattedLabel: labelFormatter(tick), + rawLabel: axis.scale.getLabel(tick), + tickValue: numval }; - } - var el = data.getItemGraphicEl(dataIndex); - var coordSys = seriesModel.coordinateSystem; - if (seriesModel.getTooltipPosition) { - point = seriesModel.getTooltipPosition(dataIndex) || []; - } else if (coordSys && coordSys.dataToPoint) { - if (finder.isStacked) { - var baseAxis = coordSys.getBaseAxis(); - var valueAxis = coordSys.getOtherAxis(baseAxis); - var valueAxisDim = valueAxis.dim; - var baseAxisDim = baseAxis.dim; - var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; - var baseDim = data.mapDimension(baseAxisDim); - var stackedData = []; - stackedData[baseDataOffset] = data.get(baseDim, dataIndex); - stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex); - point = coordSys.dataToPoint(stackedData) || []; - } else { - point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) { - return data.mapDimension(dim); - }), dataIndex)) || []; - } - } else if (el) { - // Use graphic bounding rect - var rect = el.getBoundingRect().clone(); - rect.applyTransform(el.transform); - point = [rect.x + rect.width / 2, rect.y + rect.height / 2]; - } + }) + }; + } + return axis.type === "category" ? makeCategoryLabels(axis) : makeRealNumberLabels(axis); +} +function createAxisTicks(axis, tickModel) { + const custom = axis.getTickModel().get("customValues"); + if (custom) { + const extent3 = axis.scale.getExtent(); + const tickNumbers = tickValuesToNumbers(axis, custom); + return { + ticks: filter(tickNumbers, (val) => val >= extent3[0] && val <= extent3[1]) + }; + } + return axis.type === "category" ? makeCategoryTicks(axis, tickModel) : {ticks: map(axis.scale.getTicks(), (tick) => tick.value)}; +} +function makeCategoryLabels(axis) { + const labelModel = axis.getLabelModel(); + const result = makeCategoryLabelsActually(axis, labelModel); + return !labelModel.get("show") || axis.scale.isBlank() ? {labels: [], labelCategoryInterval: result.labelCategoryInterval} : result; +} +function makeCategoryLabelsActually(axis, labelModel) { + const labelsCache = getListCache(axis, "labels"); + const optionLabelInterval = getOptionCategoryInterval(labelModel); + const result = listCacheGet(labelsCache, optionLabelInterval); + if (result) { + return result; + } + let labels; + let numericLabelInterval; + if (isFunction(optionLabelInterval)) { + labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval); + } else { + numericLabelInterval = optionLabelInterval === "auto" ? makeAutoCategoryInterval(axis) : optionLabelInterval; + labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval); + } + return listCacheSet(labelsCache, optionLabelInterval, { + labels, + labelCategoryInterval: numericLabelInterval + }); +} +function makeCategoryTicks(axis, tickModel) { + const ticksCache = getListCache(axis, "ticks"); + const optionTickInterval = getOptionCategoryInterval(tickModel); + const result = listCacheGet(ticksCache, optionTickInterval); + if (result) { + return result; + } + let ticks; + let tickCategoryInterval; + if (!tickModel.get("show") || axis.scale.isBlank()) { + ticks = []; + } + if (isFunction(optionTickInterval)) { + ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true); + } else if (optionTickInterval === "auto") { + const labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel()); + tickCategoryInterval = labelsResult.labelCategoryInterval; + ticks = map(labelsResult.labels, function(labelItem) { + return labelItem.tickValue; + }); + } else { + tickCategoryInterval = optionTickInterval; + ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true); + } + return listCacheSet(ticksCache, optionTickInterval, { + ticks, + tickCategoryInterval + }); +} +function makeRealNumberLabels(axis) { + const ticks = axis.scale.getTicks(); + const labelFormatter = makeLabelFormatter(axis); + return { + labels: map(ticks, function(tick, idx) { return { - point: point, - el: el - }; + level: tick.level, + formattedLabel: labelFormatter(tick, idx), + rawLabel: axis.scale.getLabel(tick), + tickValue: tick.value + }; + }) + }; +} +function getListCache(axis, prop) { + return inner6(axis)[prop] || (inner6(axis)[prop] = []); +} +function listCacheGet(cache, key) { + for (let i = 0; i < cache.length; i++) { + if (cache[i].key === key) { + return cache[i].value; + } + } +} +function listCacheSet(cache, key, value) { + cache.push({key, value}); + return value; +} +function makeAutoCategoryInterval(axis) { + const result = inner6(axis).autoInterval; + return result != null ? result : inner6(axis).autoInterval = axis.calculateCategoryInterval(); +} +function calculateCategoryInterval(axis) { + const params = fetchAutoCategoryIntervalCalculationParams(axis); + const labelFormatter = makeLabelFormatter(axis); + const rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; + const ordinalScale = axis.scale; + const ordinalExtent = ordinalScale.getExtent(); + const tickCount = ordinalScale.count(); + if (ordinalExtent[1] - ordinalExtent[0] < 1) { + return 0; + } + let step = 1; + if (tickCount > 40) { + step = Math.max(1, Math.floor(tickCount / 40)); + } + let tickValue = ordinalExtent[0]; + const unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); + const unitW = Math.abs(unitSpan * Math.cos(rotation)); + const unitH = Math.abs(unitSpan * Math.sin(rotation)); + let maxW = 0; + let maxH = 0; + for (; tickValue <= ordinalExtent[1]; tickValue += step) { + let width = 0; + let height = 0; + const rect = getBoundingRect(labelFormatter({value: tickValue}), params.font, "center", "top"); + width = rect.width * 1.3; + height = rect.height * 1.3; + maxW = Math.max(maxW, width, 7); + maxH = Math.max(maxH, height, 7); + } + let dw = maxW / unitW; + let dh = maxH / unitH; + isNaN(dw) && (dw = Infinity); + isNaN(dh) && (dh = Infinity); + let interval = Math.max(0, Math.floor(Math.min(dw, dh))); + const cache = inner6(axis.model); + const axisExtent = axis.getExtent(); + const lastAutoInterval = cache.lastAutoInterval; + const lastTickCount = cache.lastTickCount; + if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 && lastAutoInterval > interval && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) { + interval = lastAutoInterval; + } else { + cache.lastTickCount = tickCount; + cache.lastAutoInterval = interval; + cache.axisExtent0 = axisExtent[0]; + cache.axisExtent1 = axisExtent[1]; + } + return interval; +} +function fetchAutoCategoryIntervalCalculationParams(axis) { + const labelModel = axis.getLabelModel(); + return { + axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0, + labelRotate: labelModel.get("rotate") || 0, + font: labelModel.getFont() + }; +} +function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) { + const labelFormatter = makeLabelFormatter(axis); + const ordinalScale = axis.scale; + const ordinalExtent = ordinalScale.getExtent(); + const labelModel = axis.getLabelModel(); + const result = []; + const step = Math.max((categoryInterval || 0) + 1, 1); + let startTick = ordinalExtent[0]; + const tickCount = ordinalScale.count(); + if (startTick !== 0 && step > 1 && tickCount / step > 2) { + startTick = Math.round(Math.ceil(startTick / step) * step); + } + const showAllLabel = shouldShowAllLabels(axis); + const includeMinLabel = labelModel.get("showMinLabel") || showAllLabel; + const includeMaxLabel = labelModel.get("showMaxLabel") || showAllLabel; + if (includeMinLabel && startTick !== ordinalExtent[0]) { + addItem(ordinalExtent[0]); + } + let tickValue = startTick; + for (; tickValue <= ordinalExtent[1]; tickValue += step) { + addItem(tickValue); + } + if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) { + addItem(ordinalExtent[1]); + } + function addItem(tickValue2) { + const tickObj = {value: tickValue2}; + result.push(onlyTick ? tickValue2 : { + formattedLabel: labelFormatter(tickObj), + rawLabel: ordinalScale.getLabel(tickObj), + tickValue: tickValue2 + }); + } + return result; +} +function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { + const ordinalScale = axis.scale; + const labelFormatter = makeLabelFormatter(axis); + const result = []; + each(ordinalScale.getTicks(), function(tick) { + const rawLabel = ordinalScale.getLabel(tick); + const tickValue = tick.value; + if (categoryInterval(tick.value, rawLabel)) { + result.push(onlyTick ? tickValue : { + formattedLabel: labelFormatter(tick), + rawLabel, + tickValue + }); } - - var inner$c = makeInner(); - /** - * Basic logic: check all axis, if they do not demand show/highlight, - * then hide/downplay them. - * - * @return content of event obj for echarts.connect. - */ - function axisTrigger(payload, ecModel, api) { - var currTrigger = payload.currTrigger; - var point = [payload.x, payload.y]; - var finder = payload; - var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api); - var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; - // Pending - // See #6121. But we are not able to reproduce it yet. - if (!coordSysAxesInfo) { + }); + return result; +} + +// src/coord/Axis.ts +var NORMALIZED_EXTENT = [0, 1]; +var Axis = class { + constructor(dim, scale4, extent3) { + this.onBand = false; + this.inverse = false; + this.dim = dim; + this.scale = scale4; + this._extent = extent3 || [0, 0]; + } + contain(coord) { + const extent3 = this._extent; + const min3 = Math.min(extent3[0], extent3[1]); + const max3 = Math.max(extent3[0], extent3[1]); + return coord >= min3 && coord <= max3; + } + containData(data) { + return this.scale.contain(data); + } + getExtent() { + return this._extent.slice(); + } + getPixelPrecision(dataExtent) { + return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent); + } + setExtent(start2, end2) { + const extent3 = this._extent; + extent3[0] = start2; + extent3[1] = end2; + } + dataToCoord(data, clamp2) { + let extent3 = this._extent; + const scale4 = this.scale; + data = scale4.normalize(data); + if (this.onBand && scale4.type === "ordinal") { + extent3 = extent3.slice(); + fixExtentWithBands(extent3, scale4.count()); + } + return linearMap(data, NORMALIZED_EXTENT, extent3, clamp2); + } + coordToData(coord, clamp2) { + let extent3 = this._extent; + const scale4 = this.scale; + if (this.onBand && scale4.type === "ordinal") { + extent3 = extent3.slice(); + fixExtentWithBands(extent3, scale4.count()); + } + const t = linearMap(coord, extent3, NORMALIZED_EXTENT, clamp2); + return this.scale.scale(t); + } + pointToData(point, clamp2) { + return; + } + getTicksCoords(opt) { + opt = opt || {}; + const tickModel = opt.tickModel || this.getTickModel(); + const result = createAxisTicks(this, tickModel); + const ticks = result.ticks; + const ticksCoords = map(ticks, function(tickVal) { + return { + coord: this.dataToCoord(this.scale.type === "ordinal" ? this.scale.getRawOrdinalNumber(tickVal) : tickVal), + tickValue: tickVal + }; + }, this); + const alignWithLabel = tickModel.get("alignWithLabel"); + fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp); + return ticksCoords; + } + getMinorTicksCoords() { + if (this.scale.type === "ordinal") { + return []; + } + const minorTickModel = this.model.getModel("minorTick"); + let splitNumber = minorTickModel.get("splitNumber"); + if (!(splitNumber > 0 && splitNumber < 100)) { + splitNumber = 5; + } + const minorTicks = this.scale.getMinorTicks(splitNumber); + const minorTicksCoords = map(minorTicks, function(minorTicksGroup) { + return map(minorTicksGroup, function(minorTick) { + return { + coord: this.dataToCoord(minorTick), + tickValue: minorTick + }; + }, this); + }, this); + return minorTicksCoords; + } + getViewLabels() { + return createAxisLabels(this).labels; + } + getLabelModel() { + return this.model.getModel("axisLabel"); + } + getTickModel() { + return this.model.getModel("axisTick"); + } + getBandWidth() { + const axisExtent = this._extent; + const dataExtent = this.scale.getExtent(); + let len2 = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); + len2 === 0 && (len2 = 1); + const size = Math.abs(axisExtent[1] - axisExtent[0]); + return Math.abs(size) / len2; + } + calculateCategoryInterval() { + return calculateCategoryInterval(this); + } +}; +function fixExtentWithBands(extent3, nTick) { + const size = extent3[1] - extent3[0]; + const len2 = nTick; + const margin = size / len2 / 2; + extent3[0] += margin; + extent3[1] -= margin; +} +function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp2) { + const ticksLen = ticksCoords.length; + if (!axis.onBand || alignWithLabel || !ticksLen) { + return; + } + const axisExtent = axis.getExtent(); + let last; + let diffSize; + if (ticksLen === 1) { + ticksCoords[0].coord = axisExtent[0]; + last = ticksCoords[1] = {coord: axisExtent[1], tickValue: ticksCoords[0].tickValue}; + } else { + const crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue; + const shift = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen; + each(ticksCoords, function(ticksItem) { + ticksItem.coord -= shift / 2; + }); + const dataExtent = axis.scale.getExtent(); + diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue; + last = {coord: ticksCoords[ticksLen - 1].coord + shift * diffSize, tickValue: dataExtent[1] + 1}; + ticksCoords.push(last); + } + const inverse = axisExtent[0] > axisExtent[1]; + if (littleThan2(ticksCoords[0].coord, axisExtent[0])) { + clamp2 ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift(); + } + if (clamp2 && littleThan2(axisExtent[0], ticksCoords[0].coord)) { + ticksCoords.unshift({coord: axisExtent[0]}); + } + if (littleThan2(axisExtent[1], last.coord)) { + clamp2 ? last.coord = axisExtent[1] : ticksCoords.pop(); + } + if (clamp2 && littleThan2(last.coord, axisExtent[1])) { + ticksCoords.push({coord: axisExtent[1]}); + } + function littleThan2(a, b) { + a = round(a); + b = round(b); + return inverse ? a > b : a < b; + } +} +var Axis_default = Axis; + +// src/export/api.ts +function extendComponentModel(proto2) { + const Model2 = Component_default.extend(proto2); + Component_default.registerClass(Model2); + return Model2; +} +function extendComponentView(proto2) { + const View2 = Component_default2.extend(proto2); + Component_default2.registerClass(View2); + return View2; +} +function extendSeriesModel(proto2) { + const Model2 = Series_default.extend(proto2); + Series_default.registerClass(Model2); + return Model2; +} +function extendChartView(proto2) { + const View2 = Chart_default.extend(proto2); + Chart_default.registerClass(View2); + return View2; +} + +// src/label/labelGuideHelper.ts +var PI27 = Math.PI * 2; +var CMD4 = PathProxy_default.CMD; +var DEFAULT_SEARCH_SPACE = ["top", "right", "bottom", "left"]; +function getCandidateAnchor(pos, distance2, rect, outPt, outDir) { + const width = rect.width; + const height = rect.height; + switch (pos) { + case "top": + outPt.set(rect.x + width / 2, rect.y - distance2); + outDir.set(0, -1); + break; + case "bottom": + outPt.set(rect.x + width / 2, rect.y + height + distance2); + outDir.set(0, 1); + break; + case "left": + outPt.set(rect.x - distance2, rect.y + height / 2); + outDir.set(-1, 0); + break; + case "right": + outPt.set(rect.x + width + distance2, rect.y + height / 2); + outDir.set(1, 0); + break; + } +} +function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out2) { + x -= cx; + y -= cy; + const d = Math.sqrt(x * x + y * y); + x /= d; + y /= d; + const ox = x * r + cx; + const oy = y * r + cy; + if (Math.abs(startAngle - endAngle) % PI27 < 1e-4) { + out2[0] = ox; + out2[1] = oy; + return d - r; + } + if (anticlockwise) { + const tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI27; + } + let angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI27; + } + if (angle >= startAngle && angle <= endAngle || angle + PI27 >= startAngle && angle + PI27 <= endAngle) { + out2[0] = ox; + out2[1] = oy; + return d - r; + } + const x1 = r * Math.cos(startAngle) + cx; + const y1 = r * Math.sin(startAngle) + cy; + const x2 = r * Math.cos(endAngle) + cx; + const y2 = r * Math.sin(endAngle) + cy; + const d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y); + const d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y); + if (d1 < d2) { + out2[0] = x1; + out2[1] = y1; + return Math.sqrt(d1); + } else { + out2[0] = x2; + out2[1] = y2; + return Math.sqrt(d2); + } +} +function projectPointToLine(x1, y1, x2, y2, x, y, out2, limitToEnds) { + const dx = x - x1; + const dy = y - y1; + let dx1 = x2 - x1; + let dy1 = y2 - y1; + const lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1); + dx1 /= lineLen; + dy1 /= lineLen; + const projectedLen = dx * dx1 + dy * dy1; + let t = projectedLen / lineLen; + if (limitToEnds) { + t = Math.min(Math.max(t, 0), 1); + } + t *= lineLen; + const ox = out2[0] = x1 + t * dx1; + const oy = out2[1] = y1 + t * dy1; + return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); +} +function projectPointToRect(x1, y1, width, height, x, y, out2) { + if (width < 0) { + x1 = x1 + width; + width = -width; + } + if (height < 0) { + y1 = y1 + height; + height = -height; + } + const x2 = x1 + width; + const y2 = y1 + height; + const ox = out2[0] = Math.min(Math.max(x, x1), x2); + const oy = out2[1] = Math.min(Math.max(y, y1), y2); + return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); +} +var tmpPt = []; +function nearestPointOnRect(pt, rect, out2) { + const dist3 = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt); + out2.set(tmpPt[0], tmpPt[1]); + return dist3; +} +function nearestPointOnPath(pt, path, out2) { + let xi = 0; + let yi = 0; + let x0 = 0; + let y0 = 0; + let x1; + let y1; + let minDist = Infinity; + const data = path.data; + const x = pt.x; + const y = pt.y; + for (let i = 0; i < data.length; ) { + const cmd = data[i++]; + if (i === 1) { + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + } + let d = minDist; + switch (cmd) { + case CMD4.M: + x0 = data[i++]; + y0 = data[i++]; + xi = x0; + yi = y0; + break; + case CMD4.L: + d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true); + xi = data[i++]; + yi = data[i++]; + break; + case CMD4.C: + d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); + xi = data[i++]; + yi = data[i++]; + break; + case CMD4.Q: + d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); + xi = data[i++]; + yi = data[i++]; + break; + case CMD4.A: + const cx = data[i++]; + const cy = data[i++]; + const rx = data[i++]; + const ry = data[i++]; + const theta = data[i++]; + const dTheta = data[i++]; + i += 1; + const anticlockwise = !!(1 - data[i++]); + x1 = Math.cos(theta) * rx + cx; + y1 = Math.sin(theta) * ry + cy; + if (i <= 1) { + x0 = x1; + y0 = y1; + } + const _x = (x - cx) * ry / rx + cx; + d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt); + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case CMD4.R: + x0 = xi = data[i++]; + y0 = yi = data[i++]; + const width = data[i++]; + const height = data[i++]; + d = projectPointToRect(x0, y0, width, height, x, y, tmpPt); + break; + case CMD4.Z: + d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true); + xi = x0; + yi = y0; + break; + } + if (d < minDist) { + minDist = d; + out2.set(tmpPt[0], tmpPt[1]); + } + } + return minDist; +} +var pt0 = new Point_default(); +var pt1 = new Point_default(); +var pt2 = new Point_default(); +var dir = new Point_default(); +var dir2 = new Point_default(); +function updateLabelLinePoints(target, labelLineModel) { + if (!target) { + return; + } + const labelLine = target.getTextGuideLine(); + const label = target.getTextContent(); + if (!(label && labelLine)) { + return; + } + const labelGuideConfig = target.textGuideLineConfig || {}; + const points4 = [[0, 0], [0, 0], [0, 0]]; + const searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE; + const labelRect = label.getBoundingRect().clone(); + labelRect.applyTransform(label.getComputedTransform()); + let minDist = Infinity; + const anchorPoint = labelGuideConfig.anchor; + const targetTransform = target.getComputedTransform(); + const targetInversedTransform = targetTransform && invert([], targetTransform); + const len2 = labelLineModel.get("length2") || 0; + if (anchorPoint) { + pt2.copy(anchorPoint); + } + for (let i = 0; i < searchSpace.length; i++) { + const candidate = searchSpace[i]; + getCandidateAnchor(candidate, 0, labelRect, pt0, dir); + Point_default.scaleAndAdd(pt1, pt0, dir, len2); + pt1.transform(targetInversedTransform); + const boundingRect = target.getBoundingRect(); + const dist3 = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path_default ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); + if (dist3 < minDist) { + minDist = dist3; + pt1.transform(targetTransform); + pt2.transform(targetTransform); + pt2.toArray(points4[0]); + pt1.toArray(points4[1]); + pt0.toArray(points4[2]); + } + } + limitTurnAngle(points4, labelLineModel.get("minTurnAngle")); + labelLine.setShape({points: points4}); +} +var tmpArr = []; +var tmpProjPoint = new Point_default(); +function limitTurnAngle(linePoints, minTurnAngle) { + if (!(minTurnAngle <= 180 && minTurnAngle > 0)) { + return; + } + minTurnAngle = minTurnAngle / 180 * Math.PI; + pt0.fromArray(linePoints[0]); + pt1.fromArray(linePoints[1]); + pt2.fromArray(linePoints[2]); + Point_default.sub(dir, pt0, pt1); + Point_default.sub(dir2, pt2, pt1); + const len1 = dir.len(); + const len2 = dir2.len(); + if (len1 < 1e-3 || len2 < 1e-3) { + return; + } + dir.scale(1 / len1); + dir2.scale(1 / len2); + const angleCos = dir.dot(dir2); + const minTurnAngleCos = Math.cos(minTurnAngle); + if (minTurnAngleCos < angleCos) { + const d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); + tmpProjPoint.fromArray(tmpArr); + tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle)); + const t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); + if (isNaN(t)) { + return; + } + if (t < 0) { + Point_default.copy(tmpProjPoint, pt1); + } else if (t > 1) { + Point_default.copy(tmpProjPoint, pt2); + } + tmpProjPoint.toArray(linePoints[1]); + } +} +function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) { + if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) { + return; + } + maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI; + pt0.fromArray(linePoints[0]); + pt1.fromArray(linePoints[1]); + pt2.fromArray(linePoints[2]); + Point_default.sub(dir, pt1, pt0); + Point_default.sub(dir2, pt2, pt1); + const len1 = dir.len(); + const len2 = dir2.len(); + if (len1 < 1e-3 || len2 < 1e-3) { + return; + } + dir.scale(1 / len1); + dir2.scale(1 / len2); + const angleCos = dir.dot(surfaceNormal); + const maxSurfaceAngleCos = Math.cos(maxSurfaceAngle); + if (angleCos < maxSurfaceAngleCos) { + const d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); + tmpProjPoint.fromArray(tmpArr); + const HALF_PI = Math.PI / 2; + const angle2 = Math.acos(dir2.dot(surfaceNormal)); + const newAngle = HALF_PI + angle2 - maxSurfaceAngle; + if (newAngle >= HALF_PI) { + Point_default.copy(tmpProjPoint, pt2); + } else { + tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle)); + const t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); + if (isNaN(t)) { return; } - if (illegalPoint(point)) { - // Used in the default behavior of `connection`: use the sample seriesIndex - // and dataIndex. And also used in the tooltipView trigger. - point = findPointFromSeries({ - seriesIndex: finder.seriesIndex, - // Do not use dataIndexInside from other ec instance. - // FIXME: auto detect it? - dataIndex: finder.dataIndex - }, ecModel).point; - } - var isIllegalPoint = illegalPoint(point); - // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}). - // Notice: In this case, it is difficult to get the `point` (which is necessary to show - // tooltip, so if point is not given, we just use the point found by sample seriesIndex - // and dataIndex. - var inputAxesInfo = finder.axesInfo; - var axesInfo = coordSysAxesInfo.axesInfo; - var shouldHide = currTrigger === 'leave' || illegalPoint(point); - var outputPayload = {}; - var showValueMap = {}; - var dataByCoordSys = { - list: [], - map: {} - }; - var updaters = { - showPointer: curry(showPointer, showValueMap), - showTooltip: curry(showTooltip, dataByCoordSys) - }; - // Process for triggered axes. - each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) { - // If a point given, it must be contained by the coordinate system. - var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point); - each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) { - var axis = axisInfo.axis; - var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); - // If no inputAxesInfo, no axis is restricted. - if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) { - var val = inputAxisInfo && inputAxisInfo.value; - if (val == null && !isIllegalPoint) { - val = axis.pointToData(point); - } - val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload); - } - }); - }); - // Process for linked axes. - var linkTriggers = {}; - each(axesInfo, function (tarAxisInfo, tarKey) { - var linkGroup = tarAxisInfo.linkGroup; - // If axis has been triggered in the previous stage, it should not be triggered by link. - if (linkGroup && !showValueMap[tarKey]) { - each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) { - var srcValItem = showValueMap[srcKey]; - // If srcValItem exist, source axis is triggered, so link to target axis. - if (srcAxisInfo !== tarAxisInfo && srcValItem) { - var val = srcValItem.value; - linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo)))); - linkTriggers[tarAxisInfo.key] = val; - } - }); + if (t < 0) { + Point_default.copy(tmpProjPoint, pt1); + } else if (t > 1) { + Point_default.copy(tmpProjPoint, pt2); + } + } + tmpProjPoint.toArray(linePoints[1]); + } +} +function setLabelLineState(labelLine, ignore, stateName, stateModel) { + const isNormal = stateName === "normal"; + const stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); + stateObj.ignore = ignore; + let smooth = stateModel.get("smooth"); + if (smooth && smooth === true) { + smooth = 0.3; + } + stateObj.shape = stateObj.shape || {}; + if (smooth > 0) { + stateObj.shape.smooth = smooth; + } + const styleObj = stateModel.getModel("lineStyle").getLineStyle(); + isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj; +} +function buildLabelLinePath(path, shape) { + const smooth = shape.smooth; + const points4 = shape.points; + if (!points4) { + return; + } + path.moveTo(points4[0][0], points4[0][1]); + if (smooth > 0 && points4.length >= 3) { + const len1 = dist(points4[0], points4[1]); + const len2 = dist(points4[1], points4[2]); + if (!len1 || !len2) { + path.lineTo(points4[1][0], points4[1][1]); + path.lineTo(points4[2][0], points4[2][1]); + return; + } + const moveLen = Math.min(len1, len2) * smooth; + const midPoint0 = lerp([], points4[1], points4[0], moveLen / len1); + const midPoint2 = lerp([], points4[1], points4[2], moveLen / len2); + const midPoint1 = lerp([], midPoint0, midPoint2, 0.5); + path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]); + path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points4[2][0], points4[2][1]); + } else { + for (let i = 1; i < points4.length; i++) { + path.lineTo(points4[i][0], points4[i][1]); + } + } +} +function setLabelLineStyle(targetEl, statesModels, defaultStyle) { + let labelLine = targetEl.getTextGuideLine(); + const label = targetEl.getTextContent(); + if (!label) { + if (labelLine) { + targetEl.removeTextGuideLine(); + } + return; + } + const normalModel = statesModels.normal; + const showNormal = normalModel.get("show"); + const labelIgnoreNormal = label.ignore; + for (let i = 0; i < DISPLAY_STATES.length; i++) { + const stateName = DISPLAY_STATES[i]; + const stateModel = statesModels[stateName]; + const isNormal = stateName === "normal"; + if (stateModel) { + const stateShow = stateModel.get("show"); + const isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal); + if (isLabelIgnored || !retrieve2(stateShow, showNormal)) { + const stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName]; + if (stateObj) { + stateObj.ignore = true; + } + if (!!labelLine) { + setLabelLineState(labelLine, true, stateName, stateModel); + } + continue; + } + if (!labelLine) { + labelLine = new Polyline_default(); + targetEl.setTextGuideLine(labelLine); + if (!isNormal && (labelIgnoreNormal || !showNormal)) { + setLabelLineState(labelLine, true, "normal", statesModels.normal); + } + if (targetEl.stateProxy) { + labelLine.stateProxy = targetEl.stateProxy; + } + } + setLabelLineState(labelLine, false, stateName, stateModel); + } + } + if (labelLine) { + defaults(labelLine.style, defaultStyle); + labelLine.style.fill = null; + const showAbove = normalModel.get("showAbove"); + const labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {}; + labelLineConfig.showAbove = showAbove || false; + labelLine.buildPath = buildLabelLinePath; + } +} +function getLabelLineStatesModels(itemModel, labelLineName) { + labelLineName = labelLineName || "labelLine"; + const statesModels = { + normal: itemModel.getModel(labelLineName) + }; + for (let i = 0; i < SPECIAL_STATES.length; i++) { + const stateName = SPECIAL_STATES[i]; + statesModels[stateName] = itemModel.getModel([stateName, labelLineName]); + } + return statesModels; +} + +// src/label/labelLayoutHelper.ts +function prepareLayoutList(input) { + const list = []; + for (let i = 0; i < input.length; i++) { + const rawItem = input[i]; + if (rawItem.defaultAttr.ignore) { + continue; + } + const label = rawItem.label; + const transform2 = label.getComputedTransform(); + const localRect = label.getBoundingRect(); + const isAxisAligned = !transform2 || transform2[1] < 1e-5 && transform2[2] < 1e-5; + const minMargin = label.style.margin || 0; + const globalRect = localRect.clone(); + globalRect.applyTransform(transform2); + globalRect.x -= minMargin / 2; + globalRect.y -= minMargin / 2; + globalRect.width += minMargin; + globalRect.height += minMargin; + const obb = isAxisAligned ? new OrientedBoundingRect_default(localRect, transform2) : null; + list.push({ + label, + labelLine: rawItem.labelLine, + rect: globalRect, + localRect, + obb, + priority: rawItem.priority, + defaultAttr: rawItem.defaultAttr, + layoutOption: rawItem.computedLayoutOption, + axisAligned: isAxisAligned, + transform: transform2 + }); + } + return list; +} +function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) { + const len2 = list.length; + if (len2 < 2) { + return; + } + list.sort(function(a, b) { + return a.rect[xyDim] - b.rect[xyDim]; + }); + let lastPos = 0; + let delta; + let adjusted = false; + const shifts = []; + let totalShifts = 0; + for (let i = 0; i < len2; i++) { + const item = list[i]; + const rect = item.rect; + delta = rect[xyDim] - lastPos; + if (delta < 0) { + rect[xyDim] -= delta; + item.label[xyDim] -= delta; + adjusted = true; + } + const shift = Math.max(-delta, 0); + shifts.push(shift); + totalShifts += shift; + lastPos = rect[xyDim] + rect[sizeDim]; + } + if (totalShifts > 0 && balanceShift) { + shiftList(-totalShifts / len2, 0, len2); + } + const first = list[0]; + const last = list[len2 - 1]; + let minGap; + let maxGap; + updateMinMaxGap(); + minGap < 0 && squeezeGaps(-minGap, 0.8); + maxGap < 0 && squeezeGaps(maxGap, 0.8); + updateMinMaxGap(); + takeBoundsGap(minGap, maxGap, 1); + takeBoundsGap(maxGap, minGap, -1); + updateMinMaxGap(); + if (minGap < 0) { + squeezeWhenBailout(-minGap); + } + if (maxGap < 0) { + squeezeWhenBailout(maxGap); + } + function updateMinMaxGap() { + minGap = first.rect[xyDim] - minBound; + maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim]; + } + function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) { + if (gapThisBound < 0) { + const moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound); + if (moveFromMaxGap > 0) { + shiftList(moveFromMaxGap * moveDir, 0, len2); + const remained = moveFromMaxGap + gapThisBound; + if (remained < 0) { + squeezeGaps(-remained * moveDir, 1); } - }); - each(linkTriggers, function (val, tarKey) { - processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload); - }); - updateModelActually(showValueMap, axesInfo, outputPayload); - dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction); - dispatchHighDownActually(axesInfo, dispatchAction, api); - return outputPayload; - } - function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) { - var axis = axisInfo.axis; - if (axis.scale.isBlank() || !axis.containData(newValue)) { - return; + } else { + squeezeGaps(-gapThisBound * moveDir, 1); + } + } + } + function shiftList(delta2, start2, end2) { + if (delta2 !== 0) { + adjusted = true; + } + for (let i = start2; i < end2; i++) { + const item = list[i]; + const rect = item.rect; + rect[xyDim] += delta2; + item.label[xyDim] += delta2; + } + } + function squeezeGaps(delta2, maxSqeezePercent) { + const gaps = []; + let totalGaps = 0; + for (let i = 1; i < len2; i++) { + const prevItemRect = list[i - 1].rect; + const gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0); + gaps.push(gap); + totalGaps += gap; + } + if (!totalGaps) { + return; + } + const squeezePercent = Math.min(Math.abs(delta2) / totalGaps, maxSqeezePercent); + if (delta2 > 0) { + for (let i = 0; i < len2 - 1; i++) { + const movement = gaps[i] * squeezePercent; + shiftList(movement, 0, i + 1); + } + } else { + for (let i = len2 - 1; i > 0; i--) { + const movement = gaps[i - 1] * squeezePercent; + shiftList(-movement, i, len2); + } + } + } + function squeezeWhenBailout(delta2) { + const dir3 = delta2 < 0 ? -1 : 1; + delta2 = Math.abs(delta2); + const moveForEachLabel = Math.ceil(delta2 / (len2 - 1)); + for (let i = 0; i < len2 - 1; i++) { + if (dir3 > 0) { + shiftList(moveForEachLabel, 0, i + 1); + } else { + shiftList(-moveForEachLabel, len2 - i - 1, len2); } - if (!axisInfo.involveSeries) { - updaters.showPointer(axisInfo, newValue); + delta2 -= moveForEachLabel; + if (delta2 <= 0) { return; } - // Heavy calculation. So put it after axis.containData checking. - var payloadInfo = buildPayloadsBySeries(newValue, axisInfo); - var payloadBatch = payloadInfo.payloadBatch; - var snapToValue = payloadInfo.snapToValue; - // Fill content of event obj for echarts.connect. - // By default use the first involved series data as a sample to connect. - if (payloadBatch[0] && outputFinder.seriesIndex == null) { - extend(outputFinder, payloadBatch[0]); - } - // If no linkSource input, this process is for collecting link - // target, where snap should not be accepted. - if (!noSnap && axisInfo.snap) { - if (axis.containData(snapToValue) && snapToValue != null) { - newValue = snapToValue; - } - } - updaters.showPointer(axisInfo, newValue, payloadBatch); - // Tooltip should always be snapToValue, otherwise there will be - // incorrect "axis value ~ series value" mapping displayed in tooltip. - updaters.showTooltip(axisInfo, payloadInfo, snapToValue); - } - function buildPayloadsBySeries(value, axisInfo) { - var axis = axisInfo.axis; - var dim = axis.dim; - var snapToValue = value; - var payloadBatch = []; - var minDist = Number.MAX_VALUE; - var minDiff = -1; - each(axisInfo.seriesModels, function (series, idx) { - var dataDim = series.getData().mapDimensionsAll(dim); - var seriesNestestValue; - var dataIndices; - if (series.getAxisTooltipData) { - var result = series.getAxisTooltipData(dataDim, value, axis); - dataIndices = result.dataIndices; - seriesNestestValue = result.nestestValue; - } else { - dataIndices = series.getData().indicesOfNearest(dataDim[0], value, - // Add a threshold to avoid find the wrong dataIndex - // when data length is not same. - // false, - axis.type === 'category' ? 0.5 : null); - if (!dataIndices.length) { - return; - } - seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]); + } + } + return adjusted; +} +function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) { + return shiftLayout(list, "x", "width", leftBound, rightBound, balanceShift); +} +function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) { + return shiftLayout(list, "y", "height", topBound, bottomBound, balanceShift); +} +function hideOverlap(labelList) { + const displayedLabels = []; + labelList.sort(function(a, b) { + return b.priority - a.priority; + }); + const globalRect = new BoundingRect_default(0, 0, 0, 0); + function hideEl(el) { + if (!el.ignore) { + const emphasisState = el.ensureState("emphasis"); + if (emphasisState.ignore == null) { + emphasisState.ignore = false; + } + } + el.ignore = true; + } + for (let i = 0; i < labelList.length; i++) { + const labelItem = labelList[i]; + const isAxisAligned = labelItem.axisAligned; + const localRect = labelItem.localRect; + const transform2 = labelItem.transform; + const label = labelItem.label; + const labelLine = labelItem.labelLine; + globalRect.copy(labelItem.rect); + globalRect.width -= 0.1; + globalRect.height -= 0.1; + globalRect.x += 0.05; + globalRect.y += 0.05; + let obb = labelItem.obb; + let overlapped = false; + for (let j = 0; j < displayedLabels.length; j++) { + const existsTextCfg = displayedLabels[j]; + if (!globalRect.intersect(existsTextCfg.rect)) { + continue; + } + if (isAxisAligned && existsTextCfg.axisAligned) { + overlapped = true; + break; + } + if (!existsTextCfg.obb) { + existsTextCfg.obb = new OrientedBoundingRect_default(existsTextCfg.localRect, existsTextCfg.transform); + } + if (!obb) { + obb = new OrientedBoundingRect_default(localRect, transform2); + } + if (obb.intersect(existsTextCfg.obb)) { + overlapped = true; + break; + } + } + if (overlapped) { + hideEl(label); + labelLine && hideEl(labelLine); + } else { + label.attr("ignore", labelItem.defaultAttr.ignore); + labelLine && labelLine.attr("ignore", labelItem.defaultAttr.labelGuideIgnore); + displayedLabels.push(labelItem); + } + } +} + +// src/label/LabelManager.ts +function cloneArr(points4) { + if (points4) { + const newPoints = []; + for (let i = 0; i < points4.length; i++) { + newPoints.push(points4[i].slice()); + } + return newPoints; + } +} +function prepareLayoutCallbackParams(labelItem, hostEl) { + const label = labelItem.label; + const labelLine = hostEl && hostEl.getTextGuideLine(); + return { + dataIndex: labelItem.dataIndex, + dataType: labelItem.dataType, + seriesIndex: labelItem.seriesModel.seriesIndex, + text: labelItem.label.style.text, + rect: labelItem.hostRect, + labelRect: labelItem.rect, + align: label.style.align, + verticalAlign: label.style.verticalAlign, + labelLinePoints: cloneArr(labelLine && labelLine.shape.points) + }; +} +var LABEL_OPTION_TO_STYLE_KEYS = ["align", "verticalAlign", "width", "height", "fontSize"]; +var dummyTransformable = new Transformable_default(); +var labelLayoutInnerStore = makeInner(); +var labelLineAnimationStore = makeInner(); +function extendWithKeys(target, source, keys2) { + for (let i = 0; i < keys2.length; i++) { + const key = keys2[i]; + if (source[key] != null) { + target[key] = source[key]; + } + } +} +var LABEL_LAYOUT_PROPS = ["x", "y", "rotation"]; +var LabelManager = class { + constructor() { + this._labelList = []; + this._chartViewList = []; + } + clearLabels() { + this._labelList = []; + this._chartViewList = []; + } + _addLabel(dataIndex, dataType, seriesModel, label, layoutOption) { + const labelStyle = label.style; + const hostEl = label.__hostTarget; + const textConfig = hostEl.textConfig || {}; + const labelTransform = label.getComputedTransform(); + const labelRect = label.getBoundingRect().plain(); + BoundingRect_default.applyTransform(labelRect, labelRect, labelTransform); + if (labelTransform) { + dummyTransformable.setLocalTransform(labelTransform); + } else { + dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0; + dummyTransformable.scaleX = dummyTransformable.scaleY = 1; + } + dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation); + const host = label.__hostTarget; + let hostRect; + if (host) { + hostRect = host.getBoundingRect().plain(); + const transform2 = host.getComputedTransform(); + BoundingRect_default.applyTransform(hostRect, hostRect, transform2); + } + const labelGuide = hostRect && host.getTextGuideLine(); + this._labelList.push({ + label, + labelLine: labelGuide, + seriesModel, + dataIndex, + dataType, + layoutOption, + computedLayoutOption: null, + rect: labelRect, + hostRect, + priority: hostRect ? hostRect.width * hostRect.height : 0, + defaultAttr: { + ignore: label.ignore, + labelGuideIgnore: labelGuide && labelGuide.ignore, + x: dummyTransformable.x, + y: dummyTransformable.y, + scaleX: dummyTransformable.scaleX, + scaleY: dummyTransformable.scaleY, + rotation: dummyTransformable.rotation, + style: { + x: labelStyle.x, + y: labelStyle.y, + align: labelStyle.align, + verticalAlign: labelStyle.verticalAlign, + width: labelStyle.width, + height: labelStyle.height, + fontSize: labelStyle.fontSize + }, + cursor: label.cursor, + attachedPos: textConfig.position, + attachedRot: textConfig.rotation + } + }); + } + addLabelsOfSeries(chartView) { + this._chartViewList.push(chartView); + const seriesModel = chartView.__model; + const layoutOption = seriesModel.get("labelLayout"); + if (!(isFunction(layoutOption) || keys(layoutOption).length)) { + return; + } + chartView.group.traverse((child) => { + if (child.ignore) { + return true; + } + const textEl = child.getTextContent(); + const ecData = getECData(child); + if (textEl && !textEl.disableLabelLayout) { + this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption); + } + }); + } + updateLayoutConfig(api2) { + const width = api2.getWidth(); + const height = api2.getHeight(); + function createDragHandler(el, labelLineModel) { + return function() { + updateLabelLinePoints(el, labelLineModel); + }; + } + for (let i = 0; i < this._labelList.length; i++) { + const labelItem = this._labelList[i]; + const label = labelItem.label; + const hostEl = label.__hostTarget; + const defaultLabelAttr = labelItem.defaultAttr; + let layoutOption; + if (isFunction(labelItem.layoutOption)) { + layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl)); + } else { + layoutOption = labelItem.layoutOption; + } + layoutOption = layoutOption || {}; + labelItem.computedLayoutOption = layoutOption; + const degreeToRadian = Math.PI / 180; + if (hostEl) { + hostEl.setTextConfig({ + local: false, + position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos, + rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot, + offset: [layoutOption.dx || 0, layoutOption.dy || 0] + }); + } + let needsUpdateLabelLine = false; + if (layoutOption.x != null) { + label.x = parsePercent2(layoutOption.x, width); + label.setStyle("x", 0); + needsUpdateLabelLine = true; + } else { + label.x = defaultLabelAttr.x; + label.setStyle("x", defaultLabelAttr.style.x); + } + if (layoutOption.y != null) { + label.y = parsePercent2(layoutOption.y, height); + label.setStyle("y", 0); + needsUpdateLabelLine = true; + } else { + label.y = defaultLabelAttr.y; + label.setStyle("y", defaultLabelAttr.style.y); + } + if (layoutOption.labelLinePoints) { + const guideLine = hostEl.getTextGuideLine(); + if (guideLine) { + guideLine.setShape({points: layoutOption.labelLinePoints}); + needsUpdateLabelLine = false; + } + } + const labelLayoutStore = labelLayoutInnerStore(label); + labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine; + label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation; + label.scaleX = defaultLabelAttr.scaleX; + label.scaleY = defaultLabelAttr.scaleY; + for (let k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) { + const key = LABEL_OPTION_TO_STYLE_KEYS[k]; + label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]); + } + if (layoutOption.draggable) { + label.draggable = true; + label.cursor = "move"; + if (hostEl) { + let hostModel = labelItem.seriesModel; + if (labelItem.dataIndex != null) { + const data = labelItem.seriesModel.getData(labelItem.dataType); + hostModel = data.getItemModel(labelItem.dataIndex); + } + label.on("drag", createDragHandler(hostEl, hostModel.getModel("labelLine"))); } - if (seriesNestestValue == null || !isFinite(seriesNestestValue)) { - return; + } else { + label.off("drag"); + label.cursor = defaultLabelAttr.cursor; + } + } + } + layout(api2) { + const width = api2.getWidth(); + const height = api2.getHeight(); + const labelList = prepareLayoutList(this._labelList); + const labelsNeedsAdjustOnX = filter(labelList, function(item) { + return item.layoutOption.moveOverlap === "shiftX"; + }); + const labelsNeedsAdjustOnY = filter(labelList, function(item) { + return item.layoutOption.moveOverlap === "shiftY"; + }); + shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width); + shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height); + const labelsNeedsHideOverlap = filter(labelList, function(item) { + return item.layoutOption.hideOverlap; + }); + hideOverlap(labelsNeedsHideOverlap); + } + processLabelsOverall() { + each(this._chartViewList, (chartView) => { + const seriesModel = chartView.__model; + const ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate; + const animationEnabled = seriesModel.isAnimationEnabled(); + chartView.group.traverse((child) => { + if (child.ignore && !child.forceLabelAnimation) { + return true; } - var diff = value - seriesNestestValue; - var dist = Math.abs(diff); - // Consider category case - if (dist <= minDist) { - if (dist < minDist || diff >= 0 && minDiff < 0) { - minDist = dist; - minDiff = diff; - snapToValue = seriesNestestValue; - payloadBatch.length = 0; - } - each(dataIndices, function (dataIndex) { - payloadBatch.push({ - seriesIndex: series.seriesIndex, - dataIndexInside: dataIndex, - dataIndex: series.getData().getRawIndex(dataIndex) - }); - }); + let needsUpdateLabelLine = !ignoreLabelLineUpdate; + const label = child.getTextContent(); + if (!needsUpdateLabelLine && label) { + needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine; + } + if (needsUpdateLabelLine) { + this._updateLabelLine(child, seriesModel); + } + if (animationEnabled) { + this._animateLabels(child, seriesModel); } }); - return { - payloadBatch: payloadBatch, - snapToValue: snapToValue - }; - } - function showPointer(showValueMap, axisInfo, value, payloadBatch) { - showValueMap[axisInfo.key] = { - value: value, - payloadBatch: payloadBatch - }; - } - function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) { - var payloadBatch = payloadInfo.payloadBatch; - var axis = axisInfo.axis; - var axisModel = axis.model; - var axisPointerModel = axisInfo.axisPointerModel; - // If no data, do not create anything in dataByCoordSys, - // whose length will be used to judge whether dispatch action. - if (!axisInfo.triggerTooltip || !payloadBatch.length) { - return; + }); + } + _updateLabelLine(el, seriesModel) { + const textEl = el.getTextContent(); + const ecData = getECData(el); + const dataIndex = ecData.dataIndex; + if (textEl && dataIndex != null) { + const data = seriesModel.getData(ecData.dataType); + const itemModel = data.getItemModel(dataIndex); + const defaultStyle = {}; + const visualStyle = data.getItemVisual(dataIndex, "style"); + if (visualStyle) { + const visualType = data.getVisual("drawType"); + defaultStyle.stroke = visualStyle[visualType]; + } + const labelLineModel = itemModel.getModel("labelLine"); + setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle); + updateLabelLinePoints(el, labelLineModel); + } + } + _animateLabels(el, seriesModel) { + const textEl = el.getTextContent(); + const guideLine = el.getTextGuideLine(); + if (textEl && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) { + const layoutStore = labelLayoutInnerStore(textEl); + const oldLayout = layoutStore.oldLayout; + const ecData = getECData(el); + const dataIndex = ecData.dataIndex; + const newProps = { + x: textEl.x, + y: textEl.y, + rotation: textEl.rotation + }; + const data = seriesModel.getData(ecData.dataType); + if (!oldLayout) { + textEl.attr(newProps); + if (!labelInner(textEl).valueAnimation) { + const oldOpacity = retrieve2(textEl.style.opacity, 1); + textEl.style.opacity = 0; + initProps(textEl, { + style: {opacity: oldOpacity} + }, seriesModel, dataIndex); + } + } else { + textEl.attr(oldLayout); + const prevStates = el.prevStates; + if (prevStates) { + if (indexOf(prevStates, "select") >= 0) { + textEl.attr(layoutStore.oldLayoutSelect); + } + if (indexOf(prevStates, "emphasis") >= 0) { + textEl.attr(layoutStore.oldLayoutEmphasis); + } + } + updateProps(textEl, newProps, seriesModel, dataIndex); + } + layoutStore.oldLayout = newProps; + if (textEl.states.select) { + const layoutSelect = layoutStore.oldLayoutSelect = {}; + extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS); + extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS); + } + if (textEl.states.emphasis) { + const layoutEmphasis = layoutStore.oldLayoutEmphasis = {}; + extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS); + extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS); + } + animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel); + } + if (guideLine && !guideLine.ignore && !guideLine.invisible) { + const layoutStore = labelLineAnimationStore(guideLine); + const oldLayout = layoutStore.oldLayout; + const newLayout = {points: guideLine.shape.points}; + if (!oldLayout) { + guideLine.setShape(newLayout); + guideLine.style.strokePercent = 0; + initProps(guideLine, { + style: {strokePercent: 1} + }, seriesModel); + } else { + guideLine.attr({shape: oldLayout}); + updateProps(guideLine, { + shape: newLayout + }, seriesModel); } - var coordSysModel = axisInfo.coordSys.model; - var coordSysKey = makeKey(coordSysModel); - var coordSysItem = dataByCoordSys.map[coordSysKey]; - if (!coordSysItem) { - coordSysItem = dataByCoordSys.map[coordSysKey] = { - coordSysId: coordSysModel.id, - coordSysIndex: coordSysModel.componentIndex, - coordSysType: coordSysModel.type, - coordSysMainType: coordSysModel.mainType, - dataByAxis: [] - }; - dataByCoordSys.list.push(coordSysItem); - } - coordSysItem.dataByAxis.push({ - axisDim: axis.dim, - axisIndex: axisModel.componentIndex, - axisType: axisModel.type, - axisId: axisModel.id, - value: value, - // Caustion: viewHelper.getValueLabel is actually on "view stage", which - // depends that all models have been updated. So it should not be performed - // here. Considering axisPointerModel used here is volatile, which is hard - // to be retrieve in TooltipView, we prepare parameters here. - valueLabelOpt: { - precision: axisPointerModel.get(['label', 'precision']), - formatter: axisPointerModel.get(['label', 'formatter']) - }, - seriesDataIndices: payloadBatch.slice() - }); - } - function updateModelActually(showValueMap, axesInfo, outputPayload) { - var outputAxesInfo = outputPayload.axesInfo = []; - // Basic logic: If no 'show' required, 'hide' this axisPointer. - each(axesInfo, function (axisInfo, key) { - var option = axisInfo.axisPointerModel.option; - var valItem = showValueMap[key]; - if (valItem) { - !axisInfo.useHandle && (option.status = 'show'); - option.value = valItem.value; - // For label formatter param and highlight. - option.seriesDataIndices = (valItem.payloadBatch || []).slice(); - } - // When always show (e.g., handle used), remain - // original value and status. - else { - // If hide, value still need to be set, consider - // click legend to toggle axis blank. - !axisInfo.useHandle && (option.status = 'hide'); - } - // If status is 'hide', should be no info in payload. - option.status === 'show' && outputAxesInfo.push({ - axisDim: axisInfo.axis.dim, - axisIndex: axisInfo.axis.model.componentIndex, - value: option.value - }); - }); - } - function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) { - // Basic logic: If no showTip required, hideTip will be dispatched. - if (illegalPoint(point) || !dataByCoordSys.list.length) { - dispatchAction({ - type: 'hideTip' - }); + layoutStore.oldLayout = newLayout; + } + } +}; +var LabelManager_default = LabelManager; + +// src/label/installLabelLayout.ts +var getLabelManager = makeInner(); +function installLabelLayout(registers) { + registers.registerUpdateLifecycle("series:beforeupdate", (ecModel, api2, params) => { + let labelManager = getLabelManager(api2).labelManager; + if (!labelManager) { + labelManager = getLabelManager(api2).labelManager = new LabelManager_default(); + } + labelManager.clearLabels(); + }); + registers.registerUpdateLifecycle("series:layoutlabels", (ecModel, api2, params) => { + const labelManager = getLabelManager(api2).labelManager; + params.updatedSeries.forEach((series) => { + labelManager.addLabelsOfSeries(api2.getViewOfSeriesModel(series)); + }); + labelManager.updateLayoutConfig(api2); + labelManager.layout(api2); + labelManager.processLabelsOverall(); + }); +} + +// node_modules/zrender/src/svg/SVGPathRebuilder.ts +var mathSin5 = Math.sin; +var mathCos5 = Math.cos; +var PI6 = Math.PI; +var PI28 = Math.PI * 2; +var degree = 180 / PI6; +var SVGPathRebuilder = class { + reset(precision) { + this._start = true; + this._d = []; + this._str = ""; + this._p = Math.pow(10, precision || 4); + } + moveTo(x, y) { + this._add("M", x, y); + } + lineTo(x, y) { + this._add("L", x, y); + } + bezierCurveTo(x, y, x2, y2, x3, y3) { + this._add("C", x, y, x2, y2, x3, y3); + } + quadraticCurveTo(x, y, x2, y2) { + this._add("Q", x, y, x2, y2); + } + arc(cx, cy, r, startAngle, endAngle, anticlockwise) { + this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise); + } + ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) { + let dTheta = endAngle - startAngle; + const clockwise = !anticlockwise; + const dThetaPositive = Math.abs(dTheta); + const isCircle = isAroundZero2(dThetaPositive - PI28) || (clockwise ? dTheta >= PI28 : -dTheta >= PI28); + const unifiedTheta = dTheta > 0 ? dTheta % PI28 : dTheta % PI28 + PI28; + let large = false; + if (isCircle) { + large = true; + } else if (isAroundZero2(dThetaPositive)) { + large = false; + } else { + large = unifiedTheta >= PI6 === !!clockwise; + } + const x0 = cx + rx * mathCos5(startAngle); + const y0 = cy + ry * mathSin5(startAngle); + if (this._start) { + this._add("M", x0, y0); + } + const xRot = Math.round(psi * degree); + if (isCircle) { + const p = 1 / this._p; + const dTheta2 = (clockwise ? 1 : -1) * (PI28 - p); + this._add("A", rx, ry, xRot, 1, +clockwise, cx + rx * mathCos5(startAngle + dTheta2), cy + ry * mathSin5(startAngle + dTheta2)); + if (p > 0.01) { + this._add("A", rx, ry, xRot, 0, +clockwise, x0, y0); + } + } else { + const x = cx + rx * mathCos5(endAngle); + const y = cy + ry * mathSin5(endAngle); + this._add("A", rx, ry, xRot, +large, +clockwise, x, y); + } + } + rect(x, y, w, h) { + this._add("M", x, y); + this._add("l", w, 0); + this._add("l", 0, h); + this._add("l", -w, 0); + this._add("Z"); + } + closePath() { + if (this._d.length > 0) { + this._add("Z"); + } + } + _add(cmd, a, b, c, d, e2, f, g, h) { + const vals = []; + const p = this._p; + for (let i = 1; i < arguments.length; i++) { + const val = arguments[i]; + if (isNaN(val)) { + this._invalid = true; return; } - // In most case only one axis (or event one series is used). It is - // convenient to fetch payload.seriesIndex and payload.dataIndex - // directly. So put the first seriesIndex and dataIndex of the first - // axis on the payload. - var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {}; - dispatchAction({ - type: 'showTip', - escapeConnect: true, - x: point[0], - y: point[1], - tooltipOption: payload.tooltipOption, - position: payload.position, - dataIndexInside: sampleItem.dataIndexInside, - dataIndex: sampleItem.dataIndex, - seriesIndex: sampleItem.seriesIndex, - dataByCoordSys: dataByCoordSys.list - }); - } - function dispatchHighDownActually(axesInfo, dispatchAction, api) { - // FIXME - // highlight status modification should be a stage of main process? - // (Consider confilct (e.g., legend and axisPointer) and setOption) - var zr = api.getZr(); - var highDownKey = 'axisPointerLastHighlights'; - var lastHighlights = inner$c(zr)[highDownKey] || {}; - var newHighlights = inner$c(zr)[highDownKey] = {}; - // Update highlight/downplay status according to axisPointer model. - // Build hash map and remove duplicate incidentally. - each(axesInfo, function (axisInfo, key) { - var option = axisInfo.axisPointerModel.option; - option.status === 'show' && axisInfo.triggerEmphasis && each(option.seriesDataIndices, function (batchItem) { - var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex; - newHighlights[key] = batchItem; - }); - }); - // Diff. - var toHighlight = []; - var toDownplay = []; - each(lastHighlights, function (batchItem, key) { - !newHighlights[key] && toDownplay.push(batchItem); - }); - each(newHighlights, function (batchItem, key) { - !lastHighlights[key] && toHighlight.push(batchItem); - }); - toDownplay.length && api.dispatchAction({ - type: 'downplay', - escapeConnect: true, - // Not blur others when highlight in axisPointer. - notBlur: true, - batch: toDownplay - }); - toHighlight.length && api.dispatchAction({ - type: 'highlight', - escapeConnect: true, - // Not blur others when highlight in axisPointer. - notBlur: true, - batch: toHighlight - }); - } - function findInputAxisInfo(inputAxesInfo, axisInfo) { - for (var i = 0; i < (inputAxesInfo || []).length; i++) { - var inputAxisInfo = inputAxesInfo[i]; - if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) { - return inputAxisInfo; + vals.push(Math.round(val * p) / p); + } + this._d.push(cmd + vals.join(" ")); + this._start = cmd === "Z"; + } + generateStr() { + this._str = this._invalid ? "" : this._d.join(""); + this._d = []; + } + getStr() { + return this._str; + } +}; +var SVGPathRebuilder_default = SVGPathRebuilder; + +// node_modules/zrender/src/svg/mapStyleToAttrs.ts +var NONE = "none"; +var mathRound2 = Math.round; +function pathHasFill(style) { + const fill = style.fill; + return fill != null && fill !== NONE; +} +function pathHasStroke(style) { + const stroke = style.stroke; + return stroke != null && stroke !== NONE; +} +var strokeProps = ["lineCap", "miterLimit", "lineJoin"]; +var svgStrokeProps = map(strokeProps, (prop) => `stroke-${prop.toLowerCase()}`); +function mapStyleToAttrs(updateAttr2, style, el, forceUpdate) { + const opacity = style.opacity == null ? 1 : style.opacity; + if (el instanceof Image_default) { + updateAttr2("opacity", opacity); + return; + } + if (pathHasFill(style)) { + const fill = normalizeColor(style.fill); + updateAttr2("fill", fill.color); + const fillOpacity = style.fillOpacity != null ? style.fillOpacity * fill.opacity * opacity : fill.opacity * opacity; + if (forceUpdate || fillOpacity < 1) { + updateAttr2("fill-opacity", fillOpacity); + } + } else { + updateAttr2("fill", NONE); + } + if (pathHasStroke(style)) { + const stroke = normalizeColor(style.stroke); + updateAttr2("stroke", stroke.color); + const strokeScale = style.strokeNoScale ? el.getLineScale() : 1; + const strokeWidth = strokeScale ? (style.lineWidth || 0) / strokeScale : 0; + const strokeOpacity = style.strokeOpacity != null ? style.strokeOpacity * stroke.opacity * opacity : stroke.opacity * opacity; + const strokeFirst = style.strokeFirst; + if (forceUpdate || strokeWidth !== 1) { + updateAttr2("stroke-width", strokeWidth); + } + if (forceUpdate || strokeFirst) { + updateAttr2("paint-order", strokeFirst ? "stroke" : "fill"); + } + if (forceUpdate || strokeOpacity < 1) { + updateAttr2("stroke-opacity", strokeOpacity); + } + if (style.lineDash) { + let [lineDash, lineDashOffset] = getLineDash(el); + if (lineDash) { + lineDashOffset = mathRound2(lineDashOffset || 0); + updateAttr2("stroke-dasharray", lineDash.join(",")); + if (lineDashOffset || forceUpdate) { + updateAttr2("stroke-dashoffset", lineDashOffset); + } + } + } else if (forceUpdate) { + updateAttr2("stroke-dasharray", NONE); + } + for (let i = 0; i < strokeProps.length; i++) { + const propName = strokeProps[i]; + if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) { + const val = style[propName] || DEFAULT_PATH_STYLE[propName]; + val && updateAttr2(svgStrokeProps[i], val); + } + } + } else if (forceUpdate) { + updateAttr2("stroke", NONE); + } +} + +// node_modules/zrender/src/svg/core.ts +var SVGNS = "http://www.w3.org/2000/svg"; +var XLINKNS = "http://www.w3.org/1999/xlink"; +var XMLNS = "http://www.w3.org/2000/xmlns/"; +var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"; +var META_DATA_PREFIX = "ecmeta_"; +function createElement(name) { + return document.createElementNS(SVGNS, name); +} +function createVNode(tag, key, attrs, children, text) { + return { + tag, + attrs: attrs || {}, + children, + text, + key + }; +} +function createElementOpen(name, attrs) { + const attrsStr = []; + if (attrs) { + for (let key in attrs) { + const val = attrs[key]; + let part = key; + if (val === false) { + continue; + } else if (val !== true && val != null) { + part += `="${val}"`; + } + attrsStr.push(part); + } + } + return `<${name} ${attrsStr.join(" ")}>`; +} +function createElementClose(name) { + return ``; +} +function vNodeToString(el, opts) { + opts = opts || {}; + const S = opts.newline ? "\n" : ""; + function convertElToString(el2) { + const {children, tag, attrs, text} = el2; + return createElementOpen(tag, attrs) + (tag !== "style" ? encodeHTML(text) : text || "") + (children ? `${S}${map(children, (child) => convertElToString(child)).join(S)}${S}` : "") + createElementClose(tag); + } + return convertElToString(el); +} +function getCssString(selectorNodes, animationNodes, opts) { + opts = opts || {}; + const S = opts.newline ? "\n" : ""; + const bracketBegin = ` {${S}`; + const bracketEnd = `${S}}`; + const selectors = map(keys(selectorNodes), (className) => { + return className + bracketBegin + map(keys(selectorNodes[className]), (attrName) => { + return `${attrName}:${selectorNodes[className][attrName]};`; + }).join(S) + bracketEnd; + }).join(S); + const animations = map(keys(animationNodes), (animationName) => { + return `@keyframes ${animationName}${bracketBegin}` + map(keys(animationNodes[animationName]), (percent) => { + return percent + bracketBegin + map(keys(animationNodes[animationName][percent]), (attrName) => { + let val = animationNodes[animationName][percent][attrName]; + if (attrName === "d") { + val = `path("${val}")`; + } + return `${attrName}:${val};`; + }).join(S) + bracketEnd; + }).join(S) + bracketEnd; + }).join(S); + if (!selectors && !animations) { + return ""; + } + return [""].join(S); +} +function createBrushScope(zrId) { + return { + zrId, + shadowCache: {}, + patternCache: {}, + gradientCache: {}, + clipPathCache: {}, + defs: {}, + cssNodes: {}, + cssAnims: {}, + cssStyleCache: {}, + cssAnimIdx: 0, + shadowIdx: 0, + gradientIdx: 0, + patternIdx: 0, + clipPathIdx: 0 + }; +} +function createSVGVNode(width, height, children, useViewBox) { + return createVNode("svg", "root", { + width, + height, + xmlns: SVGNS, + "xmlns:xlink": XLINKNS, + version: "1.1", + baseProfile: "full", + viewBox: useViewBox ? `0 0 ${width} ${height}` : false + }, children); +} + +// node_modules/zrender/src/svg/cssClassId.ts +var cssClassIdx = 0; +function getClassId() { + return cssClassIdx++; +} + +// node_modules/zrender/src/svg/cssAnimation.ts +var EASING_MAP = { + cubicIn: "0.32,0,0.67,0", + cubicOut: "0.33,1,0.68,1", + cubicInOut: "0.65,0,0.35,1", + quadraticIn: "0.11,0,0.5,0", + quadraticOut: "0.5,1,0.89,1", + quadraticInOut: "0.45,0,0.55,1", + quarticIn: "0.5,0,0.75,0", + quarticOut: "0.25,1,0.5,1", + quarticInOut: "0.76,0,0.24,1", + quinticIn: "0.64,0,0.78,0", + quinticOut: "0.22,1,0.36,1", + quinticInOut: "0.83,0,0.17,1", + sinusoidalIn: "0.12,0,0.39,0", + sinusoidalOut: "0.61,1,0.88,1", + sinusoidalInOut: "0.37,0,0.63,1", + exponentialIn: "0.7,0,0.84,0", + exponentialOut: "0.16,1,0.3,1", + exponentialInOut: "0.87,0,0.13,1", + circularIn: "0.55,0,1,0.45", + circularOut: "0,0.55,0.45,1", + circularInOut: "0.85,0,0.15,1" +}; +var transformOriginKey = "transform-origin"; +function buildPathString(el, kfShape, path) { + const shape = extend({}, el.shape); + extend(shape, kfShape); + el.buildPath(path, shape); + const svgPathBuilder = new SVGPathRebuilder_default(); + svgPathBuilder.reset(getPathPrecision(el)); + path.rebuildPath(svgPathBuilder, 1); + svgPathBuilder.generateStr(); + return svgPathBuilder.getStr(); +} +function setTransformOrigin(target, transform2) { + const {originX, originY} = transform2; + if (originX || originY) { + target[transformOriginKey] = `${originX}px ${originY}px`; + } +} +var ANIMATE_STYLE_MAP = { + fill: "fill", + opacity: "opacity", + lineWidth: "stroke-width", + lineDashOffset: "stroke-dashoffset" +}; +function addAnimation(cssAnim, scope) { + const animationName = scope.zrId + "-ani-" + scope.cssAnimIdx++; + scope.cssAnims[animationName] = cssAnim; + return animationName; +} +function createCompoundPathCSSAnimation(el, attrs, scope) { + const paths = el.shape.paths; + const composedAnim = {}; + let cssAnimationCfg; + let cssAnimationName; + each(paths, (path) => { + const subScope = createBrushScope(scope.zrId); + subScope.animation = true; + createCSSAnimation(path, {}, subScope, true); + const cssAnims = subScope.cssAnims; + const cssNodes = subScope.cssNodes; + const animNames = keys(cssAnims); + const len2 = animNames.length; + if (!len2) { + return; + } + cssAnimationName = animNames[len2 - 1]; + const lastAnim = cssAnims[cssAnimationName]; + for (let percent in lastAnim) { + const kf = lastAnim[percent]; + composedAnim[percent] = composedAnim[percent] || {d: ""}; + composedAnim[percent].d += kf.d || ""; + } + for (let className in cssNodes) { + const val = cssNodes[className].animation; + if (val.indexOf(cssAnimationName) >= 0) { + cssAnimationCfg = val; + } + } + }); + if (!cssAnimationCfg) { + return; + } + attrs.d = false; + const animationName = addAnimation(composedAnim, scope); + return cssAnimationCfg.replace(cssAnimationName, animationName); +} +function getEasingFunc(easing) { + return isString(easing) ? EASING_MAP[easing] ? `cubic-bezier(${EASING_MAP[easing]})` : createCubicEasingFunc(easing) ? easing : "" : ""; +} +function createCSSAnimation(el, attrs, scope, onlyShape) { + const animators = el.animators; + const len2 = animators.length; + const cssAnimations = []; + if (el instanceof CompoundPath_default) { + const animationCfg = createCompoundPathCSSAnimation(el, attrs, scope); + if (animationCfg) { + cssAnimations.push(animationCfg); + } else if (!len2) { + return; + } + } else if (!len2) { + return; + } + const groupAnimators = {}; + for (let i = 0; i < len2; i++) { + const animator = animators[i]; + const cfgArr = [animator.getMaxTime() / 1e3 + "s"]; + const easing = getEasingFunc(animator.getClip().easing); + const delay = animator.getDelay(); + if (easing) { + cfgArr.push(easing); + } else { + cfgArr.push("linear"); + } + if (delay) { + cfgArr.push(delay / 1e3 + "s"); + } + if (animator.getLoop()) { + cfgArr.push("infinite"); + } + const cfg = cfgArr.join(" "); + groupAnimators[cfg] = groupAnimators[cfg] || [cfg, []]; + groupAnimators[cfg][1].push(animator); + } + function createSingleCSSAnimation(groupAnimator) { + const animators2 = groupAnimator[1]; + const len3 = animators2.length; + const transformKfs = {}; + const shapeKfs = {}; + const finalKfs = {}; + const animationTimingFunctionAttrName = "animation-timing-function"; + function saveAnimatorTrackToCssKfs(animator, cssKfs, toCssAttrName) { + const tracks = animator.getTracks(); + const maxTime = animator.getMaxTime(); + for (let k = 0; k < tracks.length; k++) { + const track = tracks[k]; + if (track.needsAnimate()) { + const kfs = track.keyframes; + let attrName = track.propName; + toCssAttrName && (attrName = toCssAttrName(attrName)); + if (attrName) { + for (let i = 0; i < kfs.length; i++) { + const kf = kfs[i]; + const percent = Math.round(kf.time / maxTime * 100) + "%"; + const kfEasing = getEasingFunc(kf.easing); + const rawValue = kf.rawValue; + if (isString(rawValue) || isNumber(rawValue)) { + cssKfs[percent] = cssKfs[percent] || {}; + cssKfs[percent][attrName] = kf.rawValue; + if (kfEasing) { + cssKfs[percent][animationTimingFunctionAttrName] = kfEasing; + } + } + } + } } } } - function makeMapperParam(axisInfo) { - var axisModel = axisInfo.axis.model; - var item = {}; - var dim = item.axisDim = axisInfo.axis.dim; - item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex; - item.axisName = item[dim + 'AxisName'] = axisModel.name; - item.axisId = item[dim + 'AxisId'] = axisModel.id; - return item; + for (let i = 0; i < len3; i++) { + const animator = animators2[i]; + const targetProp = animator.targetName; + if (!targetProp) { + !onlyShape && saveAnimatorTrackToCssKfs(animator, transformKfs); + } else if (targetProp === "shape") { + saveAnimatorTrackToCssKfs(animator, shapeKfs); + } } - function illegalPoint(point) { - return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]); - } - - function install$s(registers) { - // CartesianAxisPointer is not supposed to be required here. But consider - // echarts.simple.js and online build tooltip, which only require gridSimple, - // CartesianAxisPointer should be able to required somewhere. - AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer); - registers.registerComponentModel(AxisPointerModel); - registers.registerComponentView(AxisPointerView); - registers.registerPreprocessor(function (option) { - // Always has a global axisPointerModel for default setting. - if (option) { - (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {}); - var link = option.axisPointer.link; - // Normalize to array to avoid object mergin. But if link - // is not set, remain null/undefined, otherwise it will - // override existent link setting. - if (link && !isArray(link)) { - option.axisPointer.link = [link]; - } - } - }); - // This process should proformed after coordinate systems created - // and series data processed. So put it on statistic processing stage. - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) { - // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. - // allAxesInfo should be updated when setOption performed. - ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api); - }); - // Broadcast to all views. - registers.registerAction({ - type: 'updateAxisPointer', - event: 'updateAxisPointer', - update: ':updateAxisPointer' - }, axisTrigger); - } - - function install$t(registers) { - use(install$5); - use(install$s); - } - - var PolarAxisPointer = /** @class */function (_super) { - __extends(PolarAxisPointer, _super); - function PolarAxisPointer() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @override - */ - PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { - var axis = axisModel.axis; - if (axis.dim === 'angle') { - this.animationThreshold = Math.PI / 18; - } - var polar = axis.polar; - var otherAxis = polar.getOtherAxis(axis); - var otherExtent = otherAxis.getExtent(); - var coordValue = axis.dataToCoord(value); - var axisPointerType = axisPointerModel.get('type'); - if (axisPointerType && axisPointerType !== 'none') { - var elStyle = buildElStyle(axisPointerModel); - var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, polar, coordValue, otherExtent); - pointerOption.style = elStyle; - elOption.graphicKey = pointerOption.type; - elOption.pointer = pointerOption; - } - var labelMargin = axisPointerModel.get(['label', 'margin']); - var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); - buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos); - }; - return PolarAxisPointer; - }(BaseAxisPointer); - function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) { - var axis = axisModel.axis; - var coord = axis.dataToCoord(value); - var axisAngle = polar.getAngleAxis().getExtent()[0]; - axisAngle = axisAngle / 180 * Math.PI; - var radiusExtent = polar.getRadiusAxis().getExtent(); - var position; - var align; - var verticalAlign; - if (axis.dim === 'radius') { - var transform = create$1(); - rotate(transform, transform, axisAngle); - translate(transform, transform, [polar.cx, polar.cy]); - position = applyTransform$1([coord, -labelMargin], transform); - var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; - // @ts-ignore - var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1); - align = labelLayout.textAlign; - verticalAlign = labelLayout.textVerticalAlign; - } else { - // angle axis - var r = radiusExtent[1]; - position = polar.coordToPoint([r + labelMargin, coord]); - var cx = polar.cx; - var cy = polar.cy; - align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right'; - verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom'; + for (let percent in transformKfs) { + const transform2 = {}; + copyTransform(transform2, el); + extend(transform2, transformKfs[percent]); + const str = getSRTTransformString(transform2); + const timingFunction = transformKfs[percent][animationTimingFunctionAttrName]; + finalKfs[percent] = str ? { + transform: str + } : {}; + setTransformOrigin(finalKfs[percent], transform2); + if (timingFunction) { + finalKfs[percent][animationTimingFunctionAttrName] = timingFunction; } - return { - position: position, - align: align, - verticalAlign: verticalAlign - }; } - var pointerShapeBuilder$1 = { - line: function (axis, polar, coordValue, otherExtent) { - return axis.dim === 'angle' ? { - type: 'Line', - shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue])) - } : { - type: 'Circle', - shape: { - cx: polar.cx, - cy: polar.cy, - r: coordValue - } - }; - }, - shadow: function (axis, polar, coordValue, otherExtent) { - var bandWidth = Math.max(1, axis.getBandWidth()); - var radian = Math.PI / 180; - return axis.dim === 'angle' ? { - type: 'Sector', - shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], - // In ECharts y is negative if angle is positive - (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian) - } : { - type: 'Sector', - shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2) - }; + ; + let path; + let canAnimateShape = true; + for (let percent in shapeKfs) { + finalKfs[percent] = finalKfs[percent] || {}; + const isFirst = !path; + const timingFunction = shapeKfs[percent][animationTimingFunctionAttrName]; + if (isFirst) { + path = new PathProxy_default(); } - }; - - var PolarModel = /** @class */function (_super) { - __extends(PolarModel, _super); - function PolarModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = PolarModel.type; - return _this; - } - PolarModel.prototype.findAxisModel = function (axisType) { - var foundAxisModel; - var ecModel = this.ecModel; - ecModel.eachComponent(axisType, function (axisModel) { - if (axisModel.getCoordSysModel() === this) { - foundAxisModel = axisModel; - } - }, this); - return foundAxisModel; - }; - PolarModel.type = 'polar'; - PolarModel.dependencies = ['radiusAxis', 'angleAxis']; - PolarModel.defaultOption = { - // zlevel: 0, - z: 0, - center: ['50%', '50%'], - radius: '80%' - }; - return PolarModel; - }(ComponentModel); - - var PolarAxisModel = /** @class */function (_super) { - __extends(PolarAxisModel, _super); - function PolarAxisModel() { - return _super !== null && _super.apply(this, arguments) || this; + let len4 = path.len(); + path.reset(); + finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path); + let newLen = path.len(); + if (!isFirst && len4 !== newLen) { + canAnimateShape = false; + break; + } + if (timingFunction) { + finalKfs[percent][animationTimingFunctionAttrName] = timingFunction; } - PolarAxisModel.prototype.getCoordSysModel = function () { - return this.getReferringComponents('polar', SINGLE_REFERRING).models[0]; - }; - PolarAxisModel.type = 'polarAxis'; - return PolarAxisModel; - }(ComponentModel); - mixin(PolarAxisModel, AxisModelCommonMixin); - var AngleAxisModel = /** @class */function (_super) { - __extends(AngleAxisModel, _super); - function AngleAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AngleAxisModel.type; - return _this; - } - AngleAxisModel.type = 'angleAxis'; - return AngleAxisModel; - }(PolarAxisModel); - var RadiusAxisModel = /** @class */function (_super) { - __extends(RadiusAxisModel, _super); - function RadiusAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadiusAxisModel.type; - return _this; - } - RadiusAxisModel.type = 'radiusAxis'; - return RadiusAxisModel; - }(PolarAxisModel); - - var RadiusAxis = /** @class */function (_super) { - __extends(RadiusAxis, _super); - function RadiusAxis(scale, radiusExtent) { - return _super.call(this, 'radius', scale, radiusExtent) || this; - } - RadiusAxis.prototype.pointToData = function (point, clamp) { - return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; - }; - return RadiusAxis; - }(Axis); - RadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord; - RadiusAxis.prototype.radiusToData = Axis.prototype.coordToData; - - var inner$d = makeInner(); - var AngleAxis = /** @class */function (_super) { - __extends(AngleAxis, _super); - function AngleAxis(scale, angleExtent) { - return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this; - } - AngleAxis.prototype.pointToData = function (point, clamp) { - return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; - }; - /** - * Only be called in category axis. - * Angle axis uses text height to decide interval - * - * @override - * @return {number} Auto interval for cateogry axis tick and label - */ - AngleAxis.prototype.calculateCategoryInterval = function () { - var axis = this; - var labelModel = axis.getLabelModel(); - var ordinalScale = axis.scale; - var ordinalExtent = ordinalScale.getExtent(); - // Providing this method is for optimization: - // avoid generating a long array by `getTicks` - // in large category data case. - var tickCount = ordinalScale.count(); - if (ordinalExtent[1] - ordinalExtent[0] < 1) { - return 0; - } - var tickValue = ordinalExtent[0]; - var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); - var unitH = Math.abs(unitSpan); - // Not precise, just use height as text width - // and each distance from axis line yet. - var rect = getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top'); - var maxH = Math.max(rect.height, 7); - var dh = maxH / unitH; - // 0/0 is NaN, 1/0 is Infinity. - isNaN(dh) && (dh = Infinity); - var interval = Math.max(0, Math.floor(dh)); - var cache = inner$d(axis.model); - var lastAutoInterval = cache.lastAutoInterval; - var lastTickCount = cache.lastTickCount; - // Use cache to keep interval stable while moving zoom window, - // otherwise the calculated interval might jitter when the zoom - // window size is close to the interval-changing size. - if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 - // Always choose the bigger one, otherwise the critical - // point is not the same when zooming in or zooming out. - && lastAutoInterval > interval) { - interval = lastAutoInterval; - } - // Only update cache if cache not used, otherwise the - // changing of interval is too insensitive. - else { - cache.lastTickCount = tickCount; - cache.lastAutoInterval = interval; - } - return interval; - }; - return AngleAxis; - }(Axis); - AngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord; - AngleAxis.prototype.angleToData = Axis.prototype.coordToData; - - var polarDimensions = ['radius', 'angle']; - var Polar = /** @class */function () { - function Polar(name) { - this.dimensions = polarDimensions; - this.type = 'polar'; - /** - * x of polar center - */ - this.cx = 0; - /** - * y of polar center - */ - this.cy = 0; - this._radiusAxis = new RadiusAxis(); - this._angleAxis = new AngleAxis(); - this.axisPointerEnabled = true; - this.name = name || ''; - this._radiusAxis.polar = this._angleAxis.polar = this; - } - /** - * If contain coord - */ - Polar.prototype.containPoint = function (point) { - var coord = this.pointToCoord(point); - return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]); - }; - /** - * If contain data - */ - Polar.prototype.containData = function (data) { - return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]); - }; - Polar.prototype.getAxis = function (dim) { - var key = '_' + dim + 'Axis'; - return this[key]; - }; - Polar.prototype.getAxes = function () { - return [this._radiusAxis, this._angleAxis]; - }; - /** - * Get axes by type of scale - */ - Polar.prototype.getAxesByScale = function (scaleType) { - var axes = []; - var angleAxis = this._angleAxis; - var radiusAxis = this._radiusAxis; - angleAxis.scale.type === scaleType && axes.push(angleAxis); - radiusAxis.scale.type === scaleType && axes.push(radiusAxis); - return axes; - }; - Polar.prototype.getAngleAxis = function () { - return this._angleAxis; - }; - Polar.prototype.getRadiusAxis = function () { - return this._radiusAxis; - }; - Polar.prototype.getOtherAxis = function (axis) { - var angleAxis = this._angleAxis; - return axis === angleAxis ? this._radiusAxis : angleAxis; - }; - /** - * Base axis will be used on stacking. - * - */ - Polar.prototype.getBaseAxis = function () { - return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis(); - }; - Polar.prototype.getTooltipAxes = function (dim) { - var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis(); - return { - baseAxes: [baseAxis], - otherAxes: [this.getOtherAxis(baseAxis)] - }; - }; - /** - * Convert a single data item to (x, y) point. - * Parameter data is an array which the first element is radius and the second is angle - */ - Polar.prototype.dataToPoint = function (data, clamp) { - return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]); - }; - /** - * Convert a (x, y) point to data - */ - Polar.prototype.pointToData = function (point, clamp) { - var coord = this.pointToCoord(point); - return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)]; - }; - /** - * Convert a (x, y) point to (radius, angle) coord - */ - Polar.prototype.pointToCoord = function (point) { - var dx = point[0] - this.cx; - var dy = point[1] - this.cy; - var angleAxis = this.getAngleAxis(); - var extent = angleAxis.getExtent(); - var minAngle = Math.min(extent[0], extent[1]); - var maxAngle = Math.max(extent[0], extent[1]); - // Fix fixed extent in polarCreator - // FIXME - angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360; - var radius = Math.sqrt(dx * dx + dy * dy); - dx /= radius; - dy /= radius; - var radian = Math.atan2(-dy, dx) / Math.PI * 180; - // move to angleExtent - var dir = radian < minAngle ? 1 : -1; - while (radian < minAngle || radian > maxAngle) { - radian += dir * 360; - } - return [radius, radian]; - }; - /** - * Convert a (radius, angle) coord to (x, y) point - */ - Polar.prototype.coordToPoint = function (coord) { - var radius = coord[0]; - var radian = coord[1] / 180 * Math.PI; - var x = Math.cos(radian) * radius + this.cx; - // Inverse the y - var y = -Math.sin(radian) * radius + this.cy; - return [x, y]; - }; - /** - * Get ring area of cartesian. - * Area will have a contain function to determine if a point is in the coordinate system. - */ - Polar.prototype.getArea = function () { - var angleAxis = this.getAngleAxis(); - var radiusAxis = this.getRadiusAxis(); - var radiusExtent = radiusAxis.getExtent().slice(); - radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); - var angleExtent = angleAxis.getExtent(); - var RADIAN = Math.PI / 180; - return { - cx: this.cx, - cy: this.cy, - r0: radiusExtent[0], - r: radiusExtent[1], - startAngle: -angleExtent[0] * RADIAN, - endAngle: -angleExtent[1] * RADIAN, - clockwise: angleAxis.inverse, - contain: function (x, y) { - // It's a ring shape. - // Start angle and end angle don't matter - var dx = x - this.cx; - var dy = y - this.cy; - // minus a tiny value 1e-4 to avoid being clipped unexpectedly - var d2 = dx * dx + dy * dy - 1e-4; - var r = this.r; - var r0 = this.r0; - return d2 <= r * r && d2 >= r0 * r0; - } - }; - }; - Polar.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$2(finder); - return coordSys === this ? this.dataToPoint(value) : null; - }; - Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$2(finder); - return coordSys === this ? this.pointToData(pixel) : null; - }; - return Polar; - }(); - function getCoordSys$2(finder) { - var seriesModel = finder.seriesModel; - var polarModel = finder.polarModel; - return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; - } - - /** - * Resize method bound to the polar - */ - function resizePolar(polar, polarModel, api) { - var center = polarModel.get('center'); - var width = api.getWidth(); - var height = api.getHeight(); - polar.cx = parsePercent$1(center[0], width); - polar.cy = parsePercent$1(center[1], height); - var radiusAxis = polar.getRadiusAxis(); - var size = Math.min(width, height) / 2; - var radius = polarModel.get('radius'); - if (radius == null) { - radius = [0, '100%']; - } else if (!isArray(radius)) { - // r0 = 0 - radius = [0, radius]; - } - var parsedRadius = [parsePercent$1(radius[0], size), parsePercent$1(radius[1], size)]; - radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]); - } - /** - * Update polar - */ - function updatePolarScale(ecModel, api) { - var polar = this; - var angleAxis = polar.getAngleAxis(); - var radiusAxis = polar.getRadiusAxis(); - // Reset scale - angleAxis.scale.setExtent(Infinity, -Infinity); - radiusAxis.scale.setExtent(Infinity, -Infinity); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.coordinateSystem === polar) { - var data_1 = seriesModel.getData(); - each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) { - radiusAxis.scale.unionExtentFromData(data_1, dim); - }); - each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) { - angleAxis.scale.unionExtentFromData(data_1, dim); - }); - } - }); - niceScaleExtent(angleAxis.scale, angleAxis.model); - niceScaleExtent(radiusAxis.scale, radiusAxis.model); - // Fix extent of category angle axis - if (angleAxis.type === 'category' && !angleAxis.onBand) { - var extent = angleAxis.getExtent(); - var diff = 360 / angleAxis.scale.count(); - angleAxis.inverse ? extent[1] += diff : extent[1] -= diff; - angleAxis.setExtent(extent[0], extent[1]); - } - } - function isAngleAxisModel(axisModel) { - return axisModel.mainType === 'angleAxis'; - } - /** - * Set common axis properties - */ - function setAxis(axis, axisModel) { - var _a; - axis.type = axisModel.get('type'); - axis.scale = createScaleByModel(axisModel); - axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category'; - axis.inverse = axisModel.get('inverse'); - if (isAngleAxisModel(axisModel)) { - axis.inverse = axis.inverse !== axisModel.get('clockwise'); - var startAngle = axisModel.get('startAngle'); - var endAngle = (_a = axisModel.get('endAngle')) !== null && _a !== void 0 ? _a : startAngle + (axis.inverse ? -360 : 360); - axis.setExtent(startAngle, endAngle); - } - // Inject axis instance - axisModel.axis = axis; - axis.model = axisModel; } - var polarCreator = { - dimensions: polarDimensions, - create: function (ecModel, api) { - var polarList = []; - ecModel.eachComponent('polar', function (polarModel, idx) { - var polar = new Polar(idx + ''); - // Inject resize and update method - polar.update = updatePolarScale; - var radiusAxis = polar.getRadiusAxis(); - var angleAxis = polar.getAngleAxis(); - var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); - var angleAxisModel = polarModel.findAxisModel('angleAxis'); - setAxis(radiusAxis, radiusAxisModel); - setAxis(angleAxis, angleAxisModel); - resizePolar(polar, polarModel, api); - polarList.push(polar); - polarModel.coordinateSystem = polar; - polar.model = polarModel; - }); - // Inject coordinateSystem to series - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'polar') { - var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!polarModel) { - throw new Error('Polar "' + retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '" not found'); - } - } - seriesModel.coordinateSystem = polarModel.coordinateSystem; - } - }); - return polarList; + ; + if (!canAnimateShape) { + for (let percent in finalKfs) { + delete finalKfs[percent].d; } - }; - - var elementList$1 = ['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 AngleAxisView = /** @class */function (_super) { - __extends(AngleAxisView, _super); - function AngleAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AngleAxisView.type; - _this.axisPointerClass = 'PolarAxisPointer'; - return _this; - } - AngleAxisView.prototype.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 = map(angleAxis.getViewLabels(), function (labelItem) { - labelItem = clone(labelItem); - var scale = angleAxis.scale; - var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; - labelItem.coord = angleAxis.dataToCoord(tickValue); - return labelItem; - }); - fixAngleOverlap(labels); - fixAngleOverlap(ticksAngles); - each(elementList$1, function (name) { - if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) { - angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels); - } - }, this); - }; - AngleAxisView.type = 'angleAxis'; - return AngleAxisView; - }(AxisView); - var angelAxisElementsBuilders = { - axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { - var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']); - var angleAxis = polar.getAngleAxis(); - var RADIAN = Math.PI / 180; - var angleExtent = angleAxis.getExtent(); - // extent id of the axis radius (r0 and r) - var rId = getRadiusIdx(polar); - var r0Id = rId ? 0 : 1; - var shape; - var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc'; - if (radiusExtent[r0Id] === 0) { - shape = new graphic[shapeType]({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: radiusExtent[rId], - startAngle: -angleExtent[0] * RADIAN, - endAngle: -angleExtent[1] * RADIAN, - clockwise: angleAxis.inverse - }, - style: lineStyleModel.getLineStyle(), - z2: 1, - silent: true - }); - } else { - shape = new Ring({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: radiusExtent[rId], - r0: radiusExtent[r0Id] - }, - style: lineStyleModel.getLineStyle(), - z2: 1, - silent: true - }); - } - shape.style.fill = null; - group.add(shape); - }, - axisTick: function (group, 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 = map(ticksAngles, function (tickAngleItem) { - return new Line({ - shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) - }); - }); - group.add(mergePath$1(lines, { - style: defaults(tickModel.getModel('lineStyle').getLineStyle(), { - stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color']) - }) - })); - }, - minorTick: function (group, 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 Line({ - shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord) - })); - } + if (!onlyShape) { + for (let i = 0; i < len3; i++) { + const animator = animators2[i]; + const targetProp = animator.targetName; + if (targetProp === "style") { + saveAnimatorTrackToCssKfs(animator, finalKfs, (propName) => ANIMATE_STYLE_MAP[propName]); } - group.add(mergePath$1(lines, { - style: defaults(minorTickModel.getModel('lineStyle').getLineStyle(), defaults(tickModel.getLineStyle(), { - stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color']) - })) - })); - }, - axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) { - var rawCategoryData = angleAxisModel.getCategories(true); - var commonLabelModel = angleAxisModel.getModel('axisLabel'); - var labelMargin = commonLabelModel.get('margin'); - var triggerEvent = angleAxisModel.get('triggerEvent'); - // Use length of ticksAngles because it may remove the last tick to avoid overlapping - each(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]) { - var rawCategoryItem = rawCategoryData[tickValue]; - if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { - labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel); - } - } - var textEl = new ZRText({ - silent: AxisBuilder.isLabelSilent(angleAxisModel), - style: createTextStyle(labelModel, { - x: p[0], - y: p[1], - fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']), - text: labelItem.formattedLabel, - align: labelTextAlign, - verticalAlign: labelTextVerticalAlign - }) - }); - group.add(textEl); - // Pack data for mouse event - if (triggerEvent) { - var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel); - eventData.targetType = 'axisLabel'; - eventData.value = labelItem.rawLabel; - getECData(textEl).eventData = eventData; - } - }, this); - }, - splitLine: function (group, 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 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++) { - group.add(mergePath$1(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length] - }, lineStyleModel.getLineStyle()), - silent: true, - z: angleAxisModel.get('z') - })); - } - }, - minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { - if (!minorTickAngles.length) { - return; - } - var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine'); - var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); - var lines = []; - for (var i = 0; i < minorTickAngles.length; i++) { - for (var k = 0; k < minorTickAngles[i].length; k++) { - lines.push(new Line({ - shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord) - })); - } - } - group.add(mergePath$1(lines, { - style: lineStyleModel.getLineStyle(), - silent: true, - z: angleAxisModel.get('z') - })); - }, - splitArea: function (group, 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, len = ticksAngles.length; i <= len; i++) { - var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord; - var colorIndex = lineCount++ % areaColors.length; - splitAreas[colorIndex] = splitAreas[colorIndex] || []; - splitAreas[colorIndex].push(new Sector({ - shape: { - cx: polar.cx, - cy: polar.cy, - r0: r0, - r: r1, - startAngle: prevAngle, - endAngle: -coord * RADIAN, - clockwise: clockwise - }, - silent: true - })); - prevAngle = -coord * RADIAN; - } - // Simple optimization - // Batching the lines if color are the same - for (var i = 0; i < splitAreas.length; i++) { - group.add(mergePath$1(splitAreas[i], { - style: defaults({ - fill: areaColors[i % areaColors.length] - }, areaStyleModel.getAreaStyle()), - silent: true - })); + } + } + const percents = keys(finalKfs); + let allTransformOriginSame = true; + let transformOrigin; + for (let i = 1; i < percents.length; i++) { + const p0 = percents[i - 1]; + const p1 = percents[i]; + if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) { + allTransformOriginSame = false; + break; + } + transformOrigin = finalKfs[p0][transformOriginKey]; + } + if (allTransformOriginSame && transformOrigin) { + for (const percent in finalKfs) { + if (finalKfs[percent][transformOriginKey]) { + delete finalKfs[percent][transformOriginKey]; } } + attrs[transformOriginKey] = transformOrigin; + } + if (filter(percents, (percent) => keys(finalKfs[percent]).length > 0).length) { + const animationName = addAnimation(finalKfs, scope); + return `${animationName} ${groupAnimator[0]} both`; + } + } + for (let key in groupAnimators) { + const animationCfg = createSingleCSSAnimation(groupAnimators[key]); + if (animationCfg) { + cssAnimations.push(animationCfg); + } + } + if (cssAnimations.length) { + const className = scope.zrId + "-cls-" + getClassId(); + scope.cssNodes["." + className] = { + animation: cssAnimations.join(",") }; - - var axisBuilderAttrs$2 = ['axisLine', 'axisTickLabel', 'axisName']; - var selfBuilderAttrs$1 = ['splitLine', 'splitArea', 'minorSplitLine']; - var RadiusAxisView = /** @class */function (_super) { - __extends(RadiusAxisView, _super); - function RadiusAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadiusAxisView.type; - _this.axisPointerClass = 'PolarAxisPointer'; - return _this; - } - RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) { - this.group.removeAll(); - if (!radiusAxisModel.get('show')) { - return; - } - var oldAxisGroup = this._axisGroup; - var newAxisGroup = this._axisGroup = new Group(); - this.group.add(newAxisGroup); - 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); - each(axisBuilderAttrs$2, axisBuilder.add, axisBuilder); - newAxisGroup.add(axisBuilder.getGroup()); - groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel); - each(selfBuilderAttrs$1, function (name) { - if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) { - axisElementBuilders$1[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords); + attrs.class = className; + } +} + +// node_modules/zrender/src/svg/cssEmphasis.ts +function createCSSEmphasis(el, attrs, scope) { + if (!el.ignore) { + if (el.isSilent()) { + const style = { + "pointer-events": "none" + }; + setClassAttribute(style, attrs, scope, true); + } else { + const emphasisStyle = el.states.emphasis && el.states.emphasis.style ? el.states.emphasis.style : {}; + let fill = emphasisStyle.fill; + if (!fill) { + const normalFill = el.style && el.style.fill; + const selectFill = el.states.select && el.states.select.style && el.states.select.style.fill; + const fromFill = el.currentStates.indexOf("select") >= 0 ? selectFill || normalFill : normalFill; + if (fromFill) { + fill = liftColor(fromFill); + } + } + let lineWidth = emphasisStyle.lineWidth; + if (lineWidth) { + const scaleX = !emphasisStyle.strokeNoScale && el.transform ? el.transform[0] : 1; + lineWidth = lineWidth / scaleX; + } + const style = { + cursor: "pointer" + }; + if (fill) { + style.fill = fill; + } + if (emphasisStyle.stroke) { + style.stroke = emphasisStyle.stroke; + } + if (lineWidth) { + style["stroke-width"] = lineWidth; + } + setClassAttribute(style, attrs, scope, true); + } + } +} +function setClassAttribute(style, attrs, scope, withHover) { + const styleKey = JSON.stringify(style); + let className = scope.cssStyleCache[styleKey]; + if (!className) { + className = scope.zrId + "-cls-" + getClassId(); + scope.cssStyleCache[styleKey] = className; + scope.cssNodes["." + className + (withHover ? ":hover" : "")] = style; + } + attrs.class = attrs.class ? attrs.class + " " + className : className; +} + +// node_modules/zrender/src/svg/graphic.ts +var round5 = Math.round; +function isImageLike2(val) { + return val && isString(val.src); +} +function isCanvasLike(val) { + return val && isFunction(val.toDataURL); +} +function setStyleAttrs(attrs, style, el, scope) { + mapStyleToAttrs((key, val) => { + const isFillStroke = key === "fill" || key === "stroke"; + if (isFillStroke && isGradient(val)) { + setGradient(style, attrs, key, scope); + } else if (isFillStroke && isPattern(val)) { + setPattern(el, attrs, key, scope); + } else { + attrs[key] = val; + } + if (isFillStroke && scope.ssr && val === "none") { + attrs["pointer-events"] = "visible"; + } + }, style, el, false); + setShadow(el, attrs, scope); +} +function setMetaData(attrs, el) { + const metaData = getElementSSRData(el); + if (metaData) { + metaData.each((val, key) => { + val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + ""); + }); + if (el.isSilent()) { + attrs[META_DATA_PREFIX + "silent"] = "true"; + } + } +} +function noRotateScale(m2) { + return isAroundZero2(m2[0] - 1) && isAroundZero2(m2[1]) && isAroundZero2(m2[2]) && isAroundZero2(m2[3] - 1); +} +function noTranslate(m2) { + return isAroundZero2(m2[4]) && isAroundZero2(m2[5]); +} +function setTransform(attrs, m2, compress) { + if (m2 && !(noTranslate(m2) && noRotateScale(m2))) { + const mul3 = compress ? 10 : 1e4; + attrs.transform = noRotateScale(m2) ? `translate(${round5(m2[4] * mul3) / mul3} ${round5(m2[5] * mul3) / mul3})` : getMatrixStr(m2); + } +} +function convertPolyShape(shape, attrs, mul3) { + const points4 = shape.points; + const strArr = []; + for (let i = 0; i < points4.length; i++) { + strArr.push(round5(points4[i][0] * mul3) / mul3); + strArr.push(round5(points4[i][1] * mul3) / mul3); + } + attrs.points = strArr.join(" "); +} +function validatePolyShape(shape) { + return !shape.smooth; +} +function createAttrsConvert(desc) { + const normalizedDesc = map(desc, (item) => typeof item === "string" ? [item, item] : item); + return function(shape, attrs, mul3) { + for (let i = 0; i < normalizedDesc.length; i++) { + const item = normalizedDesc[i]; + const val = shape[item[0]]; + if (val != null) { + attrs[item[1]] = round5(val * mul3) / mul3; + } + } + }; +} +var builtinShapesDef = { + circle: [createAttrsConvert(["cx", "cy", "r"])], + polyline: [convertPolyShape, validatePolyShape], + polygon: [convertPolyShape, validatePolyShape] +}; +function hasShapeAnimation(el) { + const animators = el.animators; + for (let i = 0; i < animators.length; i++) { + if (animators[i].targetName === "shape") { + return true; + } + } + return false; +} +function brushSVGPath(el, scope) { + const style = el.style; + const shape = el.shape; + const builtinShpDef = builtinShapesDef[el.type]; + const attrs = {}; + const needsAnimate = scope.animation; + let svgElType = "path"; + const strokePercent = el.style.strokePercent; + const precision = scope.compress && getPathPrecision(el) || 4; + if (builtinShpDef && !scope.willUpdate && !(builtinShpDef[1] && !builtinShpDef[1](shape)) && !(needsAnimate && hasShapeAnimation(el)) && !(strokePercent < 1)) { + svgElType = el.type; + const mul3 = Math.pow(10, precision); + builtinShpDef[0](shape, attrs, mul3); + } else { + const needBuildPath = !el.path || el.shapeChanged(); + if (!el.path) { + el.createPathProxy(); + } + const path = el.path; + if (needBuildPath) { + path.beginPath(); + el.buildPath(path, el.shape); + el.pathUpdated(); + } + const pathVersion = path.getVersion(); + const elExt = el; + let svgPathBuilder = elExt.__svgPathBuilder; + if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || strokePercent !== elExt.__svgPathStrokePercent) { + if (!svgPathBuilder) { + svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder_default(); + } + svgPathBuilder.reset(precision); + path.rebuildPath(svgPathBuilder, strokePercent); + svgPathBuilder.generateStr(); + elExt.__svgPathVersion = pathVersion; + elExt.__svgPathStrokePercent = strokePercent; + } + attrs.d = svgPathBuilder.getStr(); + } + setTransform(attrs, el.transform); + setStyleAttrs(attrs, style, el, scope); + setMetaData(attrs, el); + scope.animation && createCSSAnimation(el, attrs, scope); + scope.emphasis && createCSSEmphasis(el, attrs, scope); + return createVNode(svgElType, el.id + "", attrs); +} +function brushSVGImage(el, scope) { + const style = el.style; + let image = style.image; + if (image && !isString(image)) { + if (isImageLike2(image)) { + image = image.src; + } else if (isCanvasLike(image)) { + image = image.toDataURL(); + } + } + if (!image) { + return; + } + const x = style.x || 0; + const y = style.y || 0; + const dw = style.width; + const dh = style.height; + const attrs = { + href: image, + width: dw, + height: dh + }; + if (x) { + attrs.x = x; + } + if (y) { + attrs.y = y; + } + setTransform(attrs, el.transform); + setStyleAttrs(attrs, style, el, scope); + setMetaData(attrs, el); + scope.animation && createCSSAnimation(el, attrs, scope); + return createVNode("image", el.id + "", attrs); +} +function brushSVGTSpan(el, scope) { + const style = el.style; + let text = style.text; + text != null && (text += ""); + if (!text || isNaN(style.x) || isNaN(style.y)) { + return; + } + const font = style.font || DEFAULT_FONT; + const x = style.x || 0; + const y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline); + const textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign] || style.textAlign; + const attrs = { + "dominant-baseline": "central", + "text-anchor": textAlign + }; + if (hasSeparateFont(style)) { + let separatedFontStr = ""; + const fontStyle = style.fontStyle; + const fontSize = parseFontSize(style.fontSize); + if (!parseFloat(fontSize)) { + return; + } + const fontFamily = style.fontFamily || DEFAULT_FONT_FAMILY; + const fontWeight = style.fontWeight; + separatedFontStr += `font-size:${fontSize};font-family:${fontFamily};`; + if (fontStyle && fontStyle !== "normal") { + separatedFontStr += `font-style:${fontStyle};`; + } + if (fontWeight && fontWeight !== "normal") { + separatedFontStr += `font-weight:${fontWeight};`; + } + attrs.style = separatedFontStr; + } else { + attrs.style = `font: ${font}`; + } + if (text.match(/\s/)) { + attrs["xml:space"] = "preserve"; + } + if (x) { + attrs.x = x; + } + if (y) { + attrs.y = y; + } + setTransform(attrs, el.transform); + setStyleAttrs(attrs, style, el, scope); + setMetaData(attrs, el); + scope.animation && createCSSAnimation(el, attrs, scope); + return createVNode("text", el.id + "", attrs, void 0, text); +} +function brush2(el, scope) { + if (el instanceof Path_default) { + return brushSVGPath(el, scope); + } else if (el instanceof Image_default) { + return brushSVGImage(el, scope); + } else if (el instanceof TSpan_default) { + return brushSVGTSpan(el, scope); + } +} +function setShadow(el, attrs, scope) { + const style = el.style; + if (hasShadow(style)) { + const shadowKey = getShadowKey(el); + const shadowCache = scope.shadowCache; + let shadowId = shadowCache[shadowKey]; + if (!shadowId) { + const globalScale = el.getGlobalScale(); + const scaleX = globalScale[0]; + const scaleY = globalScale[1]; + if (!scaleX || !scaleY) { + return; + } + const offsetX = style.shadowOffsetX || 0; + const offsetY = style.shadowOffsetY || 0; + const blur = style.shadowBlur; + const {opacity, color: color2} = normalizeColor(style.shadowColor); + const stdDx = blur / 2 / scaleX; + const stdDy = blur / 2 / scaleY; + const stdDeviation = stdDx + " " + stdDy; + shadowId = scope.zrId + "-s" + scope.shadowIdx++; + scope.defs[shadowId] = createVNode("filter", shadowId, { + id: shadowId, + x: "-100%", + y: "-100%", + width: "300%", + height: "300%" + }, [ + createVNode("feDropShadow", "", { + dx: offsetX / scaleX, + dy: offsetY / scaleY, + stdDeviation, + "flood-color": color2, + "flood-opacity": opacity + }) + ]); + shadowCache[shadowKey] = shadowId; + } + attrs.filter = getIdURL(shadowId); + } +} +function setGradient(style, attrs, target, scope) { + const val = style[target]; + let gradientTag; + let gradientAttrs = { + gradientUnits: val.global ? "userSpaceOnUse" : "objectBoundingBox" + }; + if (isLinearGradient(val)) { + gradientTag = "linearGradient"; + gradientAttrs.x1 = val.x; + gradientAttrs.y1 = val.y; + gradientAttrs.x2 = val.x2; + gradientAttrs.y2 = val.y2; + } else if (isRadialGradient(val)) { + gradientTag = "radialGradient"; + gradientAttrs.cx = retrieve2(val.x, 0.5); + gradientAttrs.cy = retrieve2(val.y, 0.5); + gradientAttrs.r = retrieve2(val.r, 0.5); + } else { + if (true) { + logError("Illegal gradient type."); + } + return; + } + const colors = val.colorStops; + const colorStops = []; + for (let i = 0, len2 = colors.length; i < len2; ++i) { + const offset = round4(colors[i].offset) * 100 + "%"; + const stopColor = colors[i].color; + const {color: color2, opacity} = normalizeColor(stopColor); + const stopsAttrs = { + offset + }; + stopsAttrs["stop-color"] = color2; + if (opacity < 1) { + stopsAttrs["stop-opacity"] = opacity; + } + colorStops.push(createVNode("stop", i + "", stopsAttrs)); + } + const gradientVNode = createVNode(gradientTag, "", gradientAttrs, colorStops); + const gradientKey = vNodeToString(gradientVNode); + const gradientCache = scope.gradientCache; + let gradientId = gradientCache[gradientKey]; + if (!gradientId) { + gradientId = scope.zrId + "-g" + scope.gradientIdx++; + gradientCache[gradientKey] = gradientId; + gradientAttrs.id = gradientId; + scope.defs[gradientId] = createVNode(gradientTag, gradientId, gradientAttrs, colorStops); + } + attrs[target] = getIdURL(gradientId); +} +function setPattern(el, attrs, target, scope) { + const val = el.style[target]; + const boundingRect = el.getBoundingRect(); + const patternAttrs = {}; + const repeat = val.repeat; + const noRepeat = repeat === "no-repeat"; + const repeatX = repeat === "repeat-x"; + const repeatY = repeat === "repeat-y"; + let child; + if (isImagePattern(val)) { + let imageWidth = val.imageWidth; + let imageHeight = val.imageHeight; + let imageSrc; + const patternImage = val.image; + if (isString(patternImage)) { + imageSrc = patternImage; + } else if (isImageLike2(patternImage)) { + imageSrc = patternImage.src; + } else if (isCanvasLike(patternImage)) { + imageSrc = patternImage.toDataURL(); + } + if (typeof Image === "undefined") { + const errMsg = "Image width/height must been given explictly in svg-ssr renderer."; + assert(imageWidth, errMsg); + assert(imageHeight, errMsg); + } else if (imageWidth == null || imageHeight == null) { + const setSizeToVNode = (vNode, img) => { + if (vNode) { + const svgEl = vNode.elm; + let width = imageWidth || img.width; + let height = imageHeight || img.height; + if (vNode.tag === "pattern") { + if (repeatX) { + height = 1; + width /= boundingRect.width; + } else if (repeatY) { + width = 1; + height /= boundingRect.height; + } + } + vNode.attrs.width = width; + vNode.attrs.height = height; + if (svgEl) { + svgEl.setAttribute("width", width); + svgEl.setAttribute("height", height); + } + } + }; + const createdImage = createOrUpdateImage(imageSrc, null, el, (img) => { + noRepeat || setSizeToVNode(patternVNode, img); + setSizeToVNode(child, img); + }); + if (createdImage && createdImage.width && createdImage.height) { + imageWidth = imageWidth || createdImage.width; + imageHeight = imageHeight || createdImage.height; + } + } + child = createVNode("image", "img", { + href: imageSrc, + width: imageWidth, + height: imageHeight + }); + patternAttrs.width = imageWidth; + patternAttrs.height = imageHeight; + } else if (val.svgElement) { + child = clone(val.svgElement); + patternAttrs.width = val.svgWidth; + patternAttrs.height = val.svgHeight; + } + if (!child) { + return; + } + let patternWidth; + let patternHeight; + if (noRepeat) { + patternWidth = patternHeight = 1; + } else if (repeatX) { + patternHeight = 1; + patternWidth = patternAttrs.width / boundingRect.width; + } else if (repeatY) { + patternWidth = 1; + patternHeight = patternAttrs.height / boundingRect.height; + } else { + patternAttrs.patternUnits = "userSpaceOnUse"; + } + if (patternWidth != null && !isNaN(patternWidth)) { + patternAttrs.width = patternWidth; + } + if (patternHeight != null && !isNaN(patternHeight)) { + patternAttrs.height = patternHeight; + } + const patternTransform = getSRTTransformString(val); + patternTransform && (patternAttrs.patternTransform = patternTransform); + let patternVNode = createVNode("pattern", "", patternAttrs, [child]); + const patternKey = vNodeToString(patternVNode); + const patternCache = scope.patternCache; + let patternId = patternCache[patternKey]; + if (!patternId) { + patternId = scope.zrId + "-p" + scope.patternIdx++; + patternCache[patternKey] = patternId; + patternAttrs.id = patternId; + patternVNode = scope.defs[patternId] = createVNode("pattern", patternId, patternAttrs, [child]); + } + attrs[target] = getIdURL(patternId); +} +function setClipPath(clipPath, attrs, scope) { + const {clipPathCache, defs} = scope; + let clipPathId = clipPathCache[clipPath.id]; + if (!clipPathId) { + clipPathId = scope.zrId + "-c" + scope.clipPathIdx++; + const clipPathAttrs = { + id: clipPathId + }; + clipPathCache[clipPath.id] = clipPathId; + defs[clipPathId] = createVNode("clipPath", clipPathId, clipPathAttrs, [brushSVGPath(clipPath, scope)]); + } + attrs["clip-path"] = getIdURL(clipPathId); +} + +// node_modules/zrender/src/svg/domapi.ts +function createTextNode(text) { + return document.createTextNode(text); +} +function insertBefore(parentNode2, newNode, referenceNode) { + parentNode2.insertBefore(newNode, referenceNode); +} +function removeChild(node, child) { + node.removeChild(child); +} +function appendChild(node, child) { + node.appendChild(child); +} +function parentNode(node) { + return node.parentNode; +} +function nextSibling(node) { + return node.nextSibling; +} +function setTextContent(node, text) { + node.textContent = text; +} + +// node_modules/zrender/src/svg/patch.ts +var colonChar = 58; +var xChar = 120; +var emptyNode = createVNode("", ""); +function isUndef(s) { + return s === void 0; +} +function isDef(s) { + return s !== void 0; +} +function createKeyToOldIdx(children, beginIdx, endIdx) { + const map3 = {}; + for (let i = beginIdx; i <= endIdx; ++i) { + const key = children[i].key; + if (key !== void 0) { + if (true) { + if (map3[key] != null) { + console.error(`Duplicate key ${key}`); + } + } + map3[key] = i; + } + } + return map3; +} +function sameVnode(vnode1, vnode2) { + const isSameKey = vnode1.key === vnode2.key; + const isSameTag = vnode1.tag === vnode2.tag; + return isSameTag && isSameKey; +} +function createElm(vnode) { + let i; + const children = vnode.children; + const tag = vnode.tag; + if (isDef(tag)) { + const elm = vnode.elm = createElement(tag); + updateAttrs(emptyNode, vnode); + if (isArray(children)) { + for (i = 0; i < children.length; ++i) { + const ch = children[i]; + if (ch != null) { + appendChild(elm, createElm(ch)); + } + } + } else if (isDef(vnode.text) && !isObject(vnode.text)) { + appendChild(elm, createTextNode(vnode.text)); + } + } else { + vnode.elm = createTextNode(vnode.text); + } + return vnode.elm; +} +function addVnodes(parentElm, before, vnodes, startIdx, endIdx) { + for (; startIdx <= endIdx; ++startIdx) { + const ch = vnodes[startIdx]; + if (ch != null) { + insertBefore(parentElm, createElm(ch), before); + } + } +} +function removeVnodes(parentElm, vnodes, startIdx, endIdx) { + for (; startIdx <= endIdx; ++startIdx) { + const ch = vnodes[startIdx]; + if (ch != null) { + if (isDef(ch.tag)) { + const parent = parentNode(ch.elm); + removeChild(parent, ch.elm); + } else { + removeChild(parentElm, ch.elm); + } + } + } +} +function updateAttrs(oldVnode, vnode) { + let key; + const elm = vnode.elm; + const oldAttrs = oldVnode && oldVnode.attrs || {}; + const attrs = vnode.attrs || {}; + if (oldAttrs === attrs) { + return; + } + for (key in attrs) { + const cur = attrs[key]; + const old = oldAttrs[key]; + if (old !== cur) { + if (cur === true) { + elm.setAttribute(key, ""); + } else if (cur === false) { + elm.removeAttribute(key); + } else { + if (key === "style") { + elm.style.cssText = cur; + } else if (key.charCodeAt(0) !== xChar) { + elm.setAttribute(key, cur); + } else if (key === "xmlns:xlink" || key === "xmlns") { + elm.setAttributeNS(XMLNS, key, cur); + } else if (key.charCodeAt(3) === colonChar) { + elm.setAttributeNS(XML_NAMESPACE, key, cur); + } else if (key.charCodeAt(5) === colonChar) { + elm.setAttributeNS(XLINKNS, key, cur); + } else { + elm.setAttribute(key, cur); + } + } + } + } + for (key in oldAttrs) { + if (!(key in attrs)) { + elm.removeAttribute(key); + } + } +} +function updateChildren(parentElm, oldCh, newCh) { + let oldStartIdx = 0; + let newStartIdx = 0; + let oldEndIdx = oldCh.length - 1; + let oldStartVnode = oldCh[0]; + let oldEndVnode = oldCh[oldEndIdx]; + let newEndIdx = newCh.length - 1; + let newStartVnode = newCh[0]; + let newEndVnode = newCh[newEndIdx]; + let oldKeyToIdx; + let idxInOld; + let elmToMove; + let before; + while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { + if (oldStartVnode == null) { + oldStartVnode = oldCh[++oldStartIdx]; + } else if (oldEndVnode == null) { + oldEndVnode = oldCh[--oldEndIdx]; + } else if (newStartVnode == null) { + newStartVnode = newCh[++newStartIdx]; + } else if (newEndVnode == null) { + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldStartVnode, newStartVnode)) { + patchVnode(oldStartVnode, newStartVnode); + oldStartVnode = oldCh[++oldStartIdx]; + newStartVnode = newCh[++newStartIdx]; + } else if (sameVnode(oldEndVnode, newEndVnode)) { + patchVnode(oldEndVnode, newEndVnode); + oldEndVnode = oldCh[--oldEndIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldStartVnode, newEndVnode)) { + patchVnode(oldStartVnode, newEndVnode); + insertBefore(parentElm, oldStartVnode.elm, nextSibling(oldEndVnode.elm)); + oldStartVnode = oldCh[++oldStartIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldEndVnode, newStartVnode)) { + patchVnode(oldEndVnode, newStartVnode); + insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); + oldEndVnode = oldCh[--oldEndIdx]; + newStartVnode = newCh[++newStartIdx]; + } else { + if (isUndef(oldKeyToIdx)) { + oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); + } + idxInOld = oldKeyToIdx[newStartVnode.key]; + if (isUndef(idxInOld)) { + insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm); + } else { + elmToMove = oldCh[idxInOld]; + if (elmToMove.tag !== newStartVnode.tag) { + insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm); + } else { + patchVnode(elmToMove, newStartVnode); + oldCh[idxInOld] = void 0; + insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm); + } + } + newStartVnode = newCh[++newStartIdx]; + } + } + if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) { + if (oldStartIdx > oldEndIdx) { + before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm; + addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx); + } else { + removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + } + } +} +function patchVnode(oldVnode, vnode) { + const elm = vnode.elm = oldVnode.elm; + const oldCh = oldVnode.children; + const ch = vnode.children; + if (oldVnode === vnode) { + return; + } + updateAttrs(oldVnode, vnode); + if (isUndef(vnode.text)) { + if (isDef(oldCh) && isDef(ch)) { + if (oldCh !== ch) { + updateChildren(elm, oldCh, ch); + } + } else if (isDef(ch)) { + if (isDef(oldVnode.text)) { + setTextContent(elm, ""); + } + addVnodes(elm, null, ch, 0, ch.length - 1); + } else if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } else if (isDef(oldVnode.text)) { + setTextContent(elm, ""); + } + } else if (oldVnode.text !== vnode.text) { + if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } + setTextContent(elm, vnode.text); + } +} +function patch(oldVnode, vnode) { + if (sameVnode(oldVnode, vnode)) { + patchVnode(oldVnode, vnode); + } else { + const elm = oldVnode.elm; + const parent = parentNode(elm); + createElm(vnode); + if (parent !== null) { + insertBefore(parent, vnode.elm, nextSibling(elm)); + removeVnodes(parent, [oldVnode], 0, 0); + } + } + return vnode; +} + +// node_modules/zrender/src/svg/Painter.ts +var svgId = 0; +var SVGPainter = class { + constructor(root, storage2, opts) { + this.type = "svg"; + this.refreshHover = createMethodNotSupport("refreshHover"); + this.configLayer = createMethodNotSupport("configLayer"); + this.storage = storage2; + this._opts = opts = extend({}, opts); + this.root = root; + this._id = "zr" + svgId++; + this._oldVNode = createSVGVNode(opts.width, opts.height); + if (root && !opts.ssr) { + const viewport = this._viewport = document.createElement("div"); + viewport.style.cssText = "position:relative;overflow:hidden"; + const svgDom = this._svgDom = this._oldVNode.elm = createElement("svg"); + updateAttrs(null, this._oldVNode); + viewport.appendChild(svgDom); + root.appendChild(viewport); + } + this.resize(opts.width, opts.height); + } + getType() { + return this.type; + } + getViewportRoot() { + return this._viewport; + } + getViewportRootOffset() { + const viewportRoot = this.getViewportRoot(); + if (viewportRoot) { + return { + offsetLeft: viewportRoot.offsetLeft || 0, + offsetTop: viewportRoot.offsetTop || 0 + }; + } + } + getSvgDom() { + return this._svgDom; + } + refresh() { + if (this.root) { + const vnode = this.renderToVNode({ + willUpdate: true + }); + vnode.attrs.style = "position:absolute;left:0;top:0;user-select:none"; + patch(this._oldVNode, vnode); + this._oldVNode = vnode; + } + } + renderOneToVNode(el) { + return brush2(el, createBrushScope(this._id)); + } + renderToVNode(opts) { + opts = opts || {}; + const list = this.storage.getDisplayList(true); + const width = this._width; + const height = this._height; + const scope = createBrushScope(this._id); + scope.animation = opts.animation; + scope.willUpdate = opts.willUpdate; + scope.compress = opts.compress; + scope.emphasis = opts.emphasis; + scope.ssr = this._opts.ssr; + const children = []; + const bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope); + bgVNode && children.push(bgVNode); + const mainVNode = !opts.compress ? this._mainVNode = createVNode("g", "main", {}, []) : null; + this._paintList(list, scope, mainVNode ? mainVNode.children : children); + mainVNode && children.push(mainVNode); + const defs = map(keys(scope.defs), (id) => scope.defs[id]); + if (defs.length) { + children.push(createVNode("defs", "defs", {}, defs)); + } + if (opts.animation) { + const animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, {newline: true}); + if (animationCssStr) { + const styleNode = createVNode("style", "stl", {}, [], animationCssStr); + children.push(styleNode); + } + } + return createSVGVNode(width, height, children, opts.useViewBox); + } + renderToString(opts) { + opts = opts || {}; + return vNodeToString(this.renderToVNode({ + animation: retrieve2(opts.cssAnimation, true), + emphasis: retrieve2(opts.cssEmphasis, true), + willUpdate: false, + compress: true, + useViewBox: retrieve2(opts.useViewBox, true) + }), {newline: true}); + } + setBackgroundColor(backgroundColor2) { + this._backgroundColor = backgroundColor2; + } + getSvgRoot() { + return this._mainVNode && this._mainVNode.elm; + } + _paintList(list, scope, out2) { + const listLen = list.length; + const clipPathsGroupsStack = []; + let clipPathsGroupsStackDepth = 0; + let currentClipPathGroup; + let prevClipPaths; + let clipGroupNodeIdx = 0; + for (let i = 0; i < listLen; i++) { + const displayable = list[i]; + if (!displayable.invisible) { + const clipPaths = displayable.__clipPaths; + const len2 = clipPaths && clipPaths.length || 0; + const prevLen = prevClipPaths && prevClipPaths.length || 0; + let lca; + for (lca = Math.max(len2 - 1, prevLen - 1); lca >= 0; lca--) { + if (clipPaths && prevClipPaths && clipPaths[lca] === prevClipPaths[lca]) { + break; } - }, this); - }; - RadiusAxisView.type = 'radiusAxis'; - return RadiusAxisView; - }(AxisView); - var axisElementBuilders$1 = { - splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { - var splitLineModel = radiusAxisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - var lineCount = 0; - var angleAxis = polar.getAngleAxis(); - var RADIAN = Math.PI / 180; - var angleExtent = angleAxis.getExtent(); - var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc'; - 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[shapeType]({ - shape: { - cx: polar.cx, - cy: polar.cy, - // ensure circle radius >= 0 - r: Math.max(ticksCoords[i].coord, 0), - startAngle: -angleExtent[0] * RADIAN, - endAngle: -angleExtent[1] * RADIAN, - clockwise: angleAxis.inverse - } - })); - } - // Simple optimization - // Batching the lines if color are the same - for (var i = 0; i < splitLines.length; i++) { - group.add(mergePath$1(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length], - fill: null - }, lineStyleModel.getLineStyle()), - silent: true - })); } - }, - minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) { - if (!minorTicksCoords.length) { - return; + for (let i2 = prevLen - 1; i2 > lca; i2--) { + clipPathsGroupsStackDepth--; + currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1]; + } + for (let i2 = lca + 1; i2 < len2; i2++) { + const groupAttrs = {}; + setClipPath(clipPaths[i2], groupAttrs, scope); + const g = createVNode("g", "clip-g-" + clipGroupNodeIdx++, groupAttrs, []); + (currentClipPathGroup ? currentClipPathGroup.children : out2).push(g); + clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g; + currentClipPathGroup = g; + } + prevClipPaths = clipPaths; + const ret = brush2(displayable, scope); + if (ret) { + (currentClipPathGroup ? currentClipPathGroup.children : out2).push(ret); + } + } + } + } + resize(width, height) { + const opts = this._opts; + const root = this.root; + const viewport = this._viewport; + width != null && (opts.width = width); + height != null && (opts.height = height); + if (root && viewport) { + viewport.style.display = "none"; + width = getSize(root, 0, opts); + height = getSize(root, 1, opts); + viewport.style.display = ""; + } + if (this._width !== width || this._height !== height) { + this._width = width; + this._height = height; + if (viewport) { + const viewportStyle = viewport.style; + viewportStyle.width = width + "px"; + viewportStyle.height = height + "px"; + } + if (!isPattern(this._backgroundColor)) { + const svgDom = this._svgDom; + if (svgDom) { + svgDom.setAttribute("width", width); + svgDom.setAttribute("height", height); + } + const bgEl = this._bgVNode && this._bgVNode.elm; + if (bgEl) { + bgEl.setAttribute("width", width); + bgEl.setAttribute("height", height); } - 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 Circle({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: minorTicksCoords[i][k].coord - } - })); + } else { + this.refresh(); + } + } + } + getWidth() { + return this._width; + } + getHeight() { + return this._height; + } + dispose() { + if (this.root) { + this.root.innerHTML = ""; + } + this._svgDom = this._viewport = this.storage = this._oldVNode = this._bgVNode = this._mainVNode = null; + } + clear() { + if (this._svgDom) { + this._svgDom.innerHTML = null; + } + this._oldVNode = null; + } + toDataURL(base64) { + let str = this.renderToString(); + const prefix = "data:image/svg+xml;"; + if (base64) { + str = encodeBase64(str); + return str && prefix + "base64," + str; + } + return prefix + "charset=UTF-8," + encodeURIComponent(str); + } +}; +function createMethodNotSupport(method) { + return function() { + if (true) { + logError('In SVG mode painter not support method "' + method + '"'); + } + }; +} +function createBackgroundVNode(width, height, backgroundColor2, scope) { + let bgVNode; + if (backgroundColor2 && backgroundColor2 !== "none") { + bgVNode = createVNode("rect", "bg", { + width, + height, + x: "0", + y: "0" + }); + if (isGradient(backgroundColor2)) { + setGradient({fill: backgroundColor2}, bgVNode.attrs, "fill", scope); + } else if (isPattern(backgroundColor2)) { + setPattern({ + style: { + fill: backgroundColor2 + }, + dirty: noop, + getBoundingRect: () => ({width, height}) + }, bgVNode.attrs, "fill", scope); + } else { + const {color: color2, opacity} = normalizeColor(backgroundColor2); + bgVNode.attrs.fill = color2; + opacity < 1 && (bgVNode.attrs["fill-opacity"] = opacity); + } + } + return bgVNode; +} +var Painter_default = SVGPainter; + +// src/renderer/installSVGRenderer.ts +function install(registers) { + registers.registerPainter("svg", Painter_default); +} + +// node_modules/zrender/src/canvas/Layer.ts +function createDom(id, painter, dpr2) { + const newDom = platformApi.createCanvas(); + const width = painter.getWidth(); + const height = painter.getHeight(); + const newDomStyle = newDom.style; + if (newDomStyle) { + newDomStyle.position = "absolute"; + newDomStyle.left = "0"; + newDomStyle.top = "0"; + newDomStyle.width = width + "px"; + newDomStyle.height = height + "px"; + newDom.setAttribute("data-zr-dom-id", id); + } + newDom.width = width * dpr2; + newDom.height = height * dpr2; + return newDom; +} +var Layer = class extends Eventful_default { + constructor(id, painter, dpr2) { + super(); + this.motionBlur = false; + this.lastFrameAlpha = 0.7; + this.dpr = 1; + this.virtual = false; + this.config = {}; + this.incremental = false; + this.zlevel = 0; + this.maxRepaintRectCount = 5; + this.__dirty = true; + this.__firstTimePaint = true; + this.__used = false; + this.__drawIndex = 0; + this.__startIndex = 0; + this.__endIndex = 0; + this.__prevStartIndex = null; + this.__prevEndIndex = null; + let dom; + dpr2 = dpr2 || devicePixelRatio; + if (typeof id === "string") { + dom = createDom(id, painter, dpr2); + } else if (isObject(id)) { + dom = id; + id = dom.id; + } + this.id = id; + this.dom = dom; + const domStyle = dom.style; + if (domStyle) { + disableUserSelect(dom); + dom.onselectstart = () => false; + domStyle.padding = "0"; + domStyle.margin = "0"; + domStyle.borderWidth = "0"; + } + this.painter = painter; + this.dpr = dpr2; + } + getElementCount() { + return this.__endIndex - this.__startIndex; + } + afterBrush() { + this.__prevStartIndex = this.__startIndex; + this.__prevEndIndex = this.__endIndex; + } + initContext() { + this.ctx = this.dom.getContext("2d"); + this.ctx.dpr = this.dpr; + } + setUnpainted() { + this.__firstTimePaint = true; + } + createBackBuffer() { + const dpr2 = this.dpr; + this.domBack = createDom("back-" + this.id, this.painter, dpr2); + this.ctxBack = this.domBack.getContext("2d"); + if (dpr2 !== 1) { + this.ctxBack.scale(dpr2, dpr2); + } + } + createRepaintRects(displayList, prevList, viewWidth, viewHeight) { + if (this.__firstTimePaint) { + this.__firstTimePaint = false; + return null; + } + const mergedRepaintRects = []; + const maxRepaintRectCount = this.maxRepaintRectCount; + let full = false; + const pendingRect = new BoundingRect_default(0, 0, 0, 0); + function addRectToMergePool(rect) { + if (!rect.isFinite() || rect.isZero()) { + return; + } + if (mergedRepaintRects.length === 0) { + const boundingRect = new BoundingRect_default(0, 0, 0, 0); + boundingRect.copy(rect); + mergedRepaintRects.push(boundingRect); + } else { + let isMerged = false; + let minDeltaArea = Infinity; + let bestRectToMergeIdx = 0; + for (let i = 0; i < mergedRepaintRects.length; ++i) { + const mergedRect = mergedRepaintRects[i]; + if (mergedRect.intersect(rect)) { + const pendingRect2 = new BoundingRect_default(0, 0, 0, 0); + pendingRect2.copy(mergedRect); + pendingRect2.union(rect); + mergedRepaintRects[i] = pendingRect2; + isMerged = true; + break; + } else if (full) { + pendingRect.copy(rect); + pendingRect.union(mergedRect); + const aArea = rect.width * rect.height; + const bArea = mergedRect.width * mergedRect.height; + const pendingArea = pendingRect.width * pendingRect.height; + const deltaArea = pendingArea - aArea - bArea; + if (deltaArea < minDeltaArea) { + minDeltaArea = deltaArea; + bestRectToMergeIdx = i; + } } } - group.add(mergePath$1(lines, { - style: defaults({ - fill: null - }, lineStyleModel.getLineStyle()), - silent: true - })); - }, - splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { - if (!ticksCoords.length) { - return; + if (full) { + mergedRepaintRects[bestRectToMergeIdx].union(rect); + isMerged = true; } - 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 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++) { - group.add(mergePath$1(splitAreas[i], { - style: defaults({ - fill: areaColors[i % areaColors.length] - }, areaStyleModel.getAreaStyle()), - silent: true - })); + if (!isMerged) { + const boundingRect = new BoundingRect_default(0, 0, 0, 0); + boundingRect.copy(rect); + mergedRepaintRects.push(boundingRect); + } + if (!full) { + full = mergedRepaintRects.length >= maxRepaintRectCount; } } - }; - /** - * @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 - }; } - - function getSeriesStackId$1(seriesModel) { - return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex; + for (let i = this.__startIndex; i < this.__endIndex; ++i) { + const el = displayList[i]; + if (el) { + const shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true); + const prevRect = el.__isRendered && (el.__dirty & REDRAW_BIT || !shouldPaint) ? el.getPrevPaintRect() : null; + if (prevRect) { + addRectToMergePool(prevRect); + } + const curRect = shouldPaint && (el.__dirty & REDRAW_BIT || !el.__isRendered) ? el.getPaintRect() : null; + if (curRect) { + addRectToMergePool(curRect); + } + } } - function getAxisKey$1(polar, axis) { - return axis.dim + polar.model.componentIndex; + for (let i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) { + const el = prevList[i]; + const shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true); + if (el && (!shouldPaint || !el.__zr) && el.__isRendered) { + const prevRect = el.getPrevPaintRect(); + if (prevRect) { + addRectToMergePool(prevRect); + } + } } - function barLayoutPolar(seriesType, ecModel, api) { - var lastStackCoords = {}; - var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function (seriesModel) { - return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar'; - })); - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - // Check series coordinate, do layout for polar only - if (seriesModel.coordinateSystem.type !== 'polar') { - return; + let hasIntersections; + do { + hasIntersections = false; + for (let i = 0; i < mergedRepaintRects.length; ) { + if (mergedRepaintRects[i].isZero()) { + mergedRepaintRects.splice(i, 1); + continue; } - var data = seriesModel.getData(); - var polar = seriesModel.coordinateSystem; - var baseAxis = polar.getBaseAxis(); - var axisKey = getAxisKey$1(polar, baseAxis); - var stackId = getSeriesStackId$1(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 valueAxisModel = valueAxis.model; - var startValue = valueAxisModel.get('startValue'); - var valueAxisStart = valueAxis.dataToCoord(startValue || 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, - n: valueAxisStart // Negative stack - }; - } - // Should also consider #4243 - baseCoord = lastStackCoords[stackId][baseValue][sign]; - } - var r0 = void 0; - var r = void 0; - var startAngle = void 0; - var endAngle = void 0; - // radial sector - if (valueAxis.dim === 'radius') { - var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart; - var angle = baseAxis.dataToCoord(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); + for (let j = i + 1; j < mergedRepaintRects.length; ) { + if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) { + hasIntersections = true; + mergedRepaintRects[i].union(mergedRepaintRects[j]); + mergedRepaintRects.splice(j, 1); + } else { + j++; } - // tangential sector - else { - var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart; - var radius = baseAxis.dataToCoord(baseValue); - if (Math.abs(angleSpan) < barMinAngle) { - angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; + } + i++; + } + } while (hasIntersections); + this._paintRects = mergedRepaintRects; + return mergedRepaintRects; + } + debugGetPaintRects() { + return (this._paintRects || []).slice(); + } + resize(width, height) { + const dpr2 = this.dpr; + const dom = this.dom; + const domStyle = dom.style; + const domBack = this.domBack; + if (domStyle) { + domStyle.width = width + "px"; + domStyle.height = height + "px"; + } + dom.width = width * dpr2; + dom.height = height * dpr2; + if (domBack) { + domBack.width = width * dpr2; + domBack.height = height * dpr2; + if (dpr2 !== 1) { + this.ctxBack.scale(dpr2, dpr2); + } + } + } + clear(clearAll, clearColor, repaintRects) { + const dom = this.dom; + const ctx = this.ctx; + const width = dom.width; + const height = dom.height; + clearColor = clearColor || this.clearColor; + const haveMotionBLur = this.motionBlur && !clearAll; + const lastFrameAlpha = this.lastFrameAlpha; + const dpr2 = this.dpr; + const self2 = this; + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } + this.ctxBack.globalCompositeOperation = "copy"; + this.ctxBack.drawImage(dom, 0, 0, width / dpr2, height / dpr2); + } + const domBack = this.domBack; + function doClear(x, y, width2, height2) { + ctx.clearRect(x, y, width2, height2); + if (clearColor && clearColor !== "transparent") { + let clearColorGradientOrPattern; + if (isGradientObject(clearColor)) { + const shouldCache = clearColor.global || clearColor.__width === width2 && clearColor.__height === height2; + clearColorGradientOrPattern = shouldCache && clearColor.__canvasGradient || getCanvasGradient(ctx, clearColor, { + x: 0, + y: 0, + width: width2, + height: height2 + }); + clearColor.__canvasGradient = clearColorGradientOrPattern; + clearColor.__width = width2; + clearColor.__height = height2; + } else if (isImagePatternObject(clearColor)) { + clearColor.scaleX = clearColor.scaleX || dpr2; + clearColor.scaleY = clearColor.scaleY || dpr2; + clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, { + dirty() { + self2.setUnpainted(); + self2.painter.refresh(); } - 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 - // let extent = angleAxis.getExtent(); - // let 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, - /** - * Keep the same logic with bar in catesion: use end value to - * control direction. Notice that if clockwise is true (by - * default), the sector will always draw clockwisely, no matter - * whether endAngle is greater or less than startAngle. - */ - clockwise: startAngle >= endAngle }); } + ctx.save(); + ctx.fillStyle = clearColorGradientOrPattern || clearColor; + ctx.fillRect(x, y, width2, height2); + ctx.restore(); + } + if (haveMotionBLur) { + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage(domBack, x, y, width2, height2); + ctx.restore(); + } + } + ; + if (!repaintRects || haveMotionBLur) { + doClear(0, 0, width, height); + } else if (repaintRects.length) { + each(repaintRects, (rect) => { + doClear(rect.x * dpr2, rect.y * dpr2, rect.width * dpr2, rect.height * dpr2); }); } - /** - * Calculate bar width and offset for radial bar charts - */ - function calRadialBar(barSeries) { - // Columns info on each category axis. Key is polar name - var columnsMap = {}; - each(barSeries, function (seriesModel, idx) { - var data = seriesModel.getData(); - var polar = seriesModel.coordinateSystem; - var baseAxis = polar.getBaseAxis(); - var axisKey = getAxisKey$1(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$1(seriesModel); - if (!stacks[stackId]) { - columnsOnAxis.autoWidthCount++; - } - stacks[stackId] = stacks[stackId] || { - width: 0, - maxWidth: 0 - }; - var barWidth = parsePercent$1(seriesModel.get('barWidth'), bandWidth); - var barMaxWidth = parsePercent$1(seriesModel.get('barMaxWidth'), bandWidth); - var barGap = seriesModel.get('barGap'); - var barCategoryGap = seriesModel.get('barCategoryGap'); - if (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 Layer_default = Layer; + +// node_modules/zrender/src/canvas/Painter.ts +var HOVER_LAYER_ZLEVEL = 1e5; +var CANVAS_ZLEVEL = 314159; +var EL_AFTER_INCREMENTAL_INC = 0.01; +var INCREMENTAL_INC = 1e-3; +function isLayerValid(layer) { + if (!layer) { + return false; + } + if (layer.__builtin__) { + return true; + } + if (typeof layer.resize !== "function" || typeof layer.refresh !== "function") { + return false; + } + return true; +} +function createRoot(width, height) { + const domRoot = document.createElement("div"); + domRoot.style.cssText = [ + "position:relative", + "width:" + width + "px", + "height:" + height + "px", + "padding:0", + "margin:0", + "border-width:0" + ].join(";") + ";"; + return domRoot; +} +var CanvasPainter = class { + constructor(root, storage2, opts, id) { + this.type = "canvas"; + this._zlevelList = []; + this._prevDisplayList = []; + this._layers = {}; + this._layerConfig = {}; + this._needsManuallyCompositing = false; + this.type = "canvas"; + const singleCanvas = !root.nodeName || root.nodeName.toUpperCase() === "CANVAS"; + this._opts = opts = extend({}, opts || {}); + this.dpr = opts.devicePixelRatio || devicePixelRatio; + this._singleCanvas = singleCanvas; + this.root = root; + const rootStyle = root.style; + if (rootStyle) { + disableUserSelect(root); + root.innerHTML = ""; + } + this.storage = storage2; + const zlevelList = this._zlevelList; + this._prevDisplayList = []; + const layers = this._layers; + if (!singleCanvas) { + this._width = getSize(root, 0, opts); + this._height = getSize(root, 1, opts); + const domRoot = this._domRoot = createRoot(this._width, this._height); + root.appendChild(domRoot); + } else { + const rootCanvas = root; + let width = rootCanvas.width; + let height = rootCanvas.height; + if (opts.width != null) { + width = opts.width; + } + if (opts.height != null) { + height = opts.height; + } + this.dpr = opts.devicePixelRatio || 1; + rootCanvas.width = width * this.dpr; + rootCanvas.height = height * this.dpr; + this._width = width; + this._height = height; + const mainLayer = new Layer_default(rootCanvas, this, this.dpr); + mainLayer.__builtin__ = true; + mainLayer.initContext(); + layers[CANVAS_ZLEVEL] = mainLayer; + mainLayer.zlevel = CANVAS_ZLEVEL; + zlevelList.push(CANVAS_ZLEVEL); + this._domRoot = root; + } + } + getType() { + return "canvas"; + } + isSingleCanvas() { + return this._singleCanvas; + } + getViewportRoot() { + return this._domRoot; + } + getViewportRootOffset() { + const viewportRoot = this.getViewportRoot(); + if (viewportRoot) { + return { + offsetLeft: viewportRoot.offsetLeft || 0, + offsetTop: viewportRoot.offsetTop || 0 + }; + } + } + refresh(paintAll) { + const list = this.storage.getDisplayList(true); + const prevList = this._prevDisplayList; + const zlevelList = this._zlevelList; + this._redrawId = Math.random(); + this._paintList(list, prevList, paintAll, this._redrawId); + for (let i = 0; i < zlevelList.length; i++) { + const z = zlevelList[i]; + const layer = this._layers[z]; + if (!layer.__builtin__ && layer.refresh) { + const clearColor = i === 0 ? this._backgroundColor : null; + layer.refresh(clearColor); + } + } + if (this._opts.useDirtyRect) { + this._prevDisplayList = list.slice(); + } + return this; + } + refreshHover() { + this._paintHoverList(this.storage.getDisplayList(false)); + } + _paintHoverList(list) { + let len2 = list.length; + let hoverLayer = this._hoverlayer; + hoverLayer && hoverLayer.clear(); + if (!len2) { + return; + } + const scope = { + inHover: true, + viewWidth: this._width, + viewHeight: this._height + }; + let ctx; + for (let i = 0; i < len2; i++) { + const el = list[i]; + if (el.__inHover) { + if (!hoverLayer) { + hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL); + } + if (!ctx) { + ctx = hoverLayer.ctx; + ctx.save(); + } + brush(ctx, el, scope, i === len2 - 1); + } + } + if (ctx) { + ctx.restore(); + } + } + getHoverLayer() { + return this.getLayer(HOVER_LAYER_ZLEVEL); + } + paintOne(ctx, el) { + brushSingle(ctx, el); + } + _paintList(list, prevList, paintAll, redrawId) { + if (this._redrawId !== redrawId) { + return; + } + paintAll = paintAll || false; + this._updateLayerStatus(list); + const {finished, needsRefreshHover} = this._doPaintList(list, prevList, paintAll); + if (this._needsManuallyCompositing) { + this._compositeManually(); + } + if (needsRefreshHover) { + this._paintHoverList(list); + } + if (!finished) { + const self2 = this; + requestAnimationFrame_default(function() { + self2._paintList(list, prevList, paintAll, redrawId); }); - var result = {}; - each(columnsMap, function (columnsOnAxis, coordSysName) { - result[coordSysName] = {}; - var stacks = columnsOnAxis.stacks; - var bandWidth = columnsOnAxis.bandWidth; - var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); - var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); - var remainedWidth = columnsOnAxis.remainedWidth; - var autoWidthCount = columnsOnAxis.autoWidthCount; - var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); - // Find if any auto calculated bar exceeded maxBarWidth - each(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); + } else { + this.eachLayer((layer) => { + layer.afterBrush && layer.afterBrush(); + }); + } + } + _compositeManually() { + const ctx = this.getLayer(CANVAS_ZLEVEL).ctx; + const width = this._domRoot.width; + const height = this._domRoot.height; + ctx.clearRect(0, 0, width, height); + this.eachBuiltinLayer(function(layer) { + if (layer.virtual) { + ctx.drawImage(layer.dom, 0, 0, width, height); + } + }); + } + _doPaintList(list, prevList, paintAll) { + const layerList = []; + const useDirtyRect = this._opts.useDirtyRect; + for (let zi = 0; zi < this._zlevelList.length; zi++) { + const zlevel = this._zlevelList[zi]; + const layer = this._layers[zlevel]; + if (layer.__builtin__ && layer !== this._hoverlayer && (layer.__dirty || paintAll)) { + layerList.push(layer); + } + } + let finished = true; + let needsRefreshHover = false; + for (let k = 0; k < layerList.length; k++) { + const layer = layerList[k]; + const ctx = layer.ctx; + const repaintRects = useDirtyRect && layer.createRepaintRects(list, prevList, this._width, this._height); + let start2 = paintAll ? layer.__startIndex : layer.__drawIndex; + const useTimer = !paintAll && layer.incremental && Date.now; + const startTime = useTimer && Date.now(); + const clearColor = layer.zlevel === this._zlevelList[0] ? this._backgroundColor : null; + if (layer.__startIndex === layer.__endIndex) { + layer.clear(false, clearColor, repaintRects); + } else if (start2 === layer.__startIndex) { + const firstEl = list[start2]; + if (!firstEl.incremental || !firstEl.notClear || paintAll) { + layer.clear(false, clearColor, repaintRects); + } + } + if (start2 === -1) { + console.error("For some unknown reason. drawIndex is -1"); + start2 = layer.__startIndex; + } + let i; + const repaint = (repaintRect) => { + const scope = { + inHover: false, + allClipped: false, + prevEl: null, + viewWidth: this._width, + viewHeight: this._height + }; + for (i = start2; i < layer.__endIndex; i++) { + const el = list[i]; + if (el.__inHover) { + needsRefreshHover = true; + } + this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1); + if (useTimer) { + const dTime = Date.now() - startTime; + if (dTime > 15) { + break; } - remainedWidth -= maxWidth; - column.width = maxWidth; - autoWidthCount--; } - }); - // Recalculate width again - autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); - var widthSum = 0; - var lastColumn; - each(stacks, function (column, idx) { - if (!column.width) { - column.width = autoWidth; + } + if (scope.prevElClipPaths) { + ctx.restore(); + } + }; + if (repaintRects) { + if (repaintRects.length === 0) { + i = layer.__endIndex; + } else { + const dpr2 = this.dpr; + for (var r = 0; r < repaintRects.length; ++r) { + const rect = repaintRects[r]; + ctx.save(); + ctx.beginPath(); + ctx.rect(rect.x * dpr2, rect.y * dpr2, rect.width * dpr2, rect.height * dpr2); + ctx.clip(); + repaint(rect); + ctx.restore(); } - lastColumn = column; - widthSum += column.width * (1 + barGapPercent); - }); - if (lastColumn) { - widthSum -= lastColumn.width * barGapPercent; - } - var offset = -widthSum / 2; - each(stacks, function (column, stackId) { - result[coordSysName][stackId] = result[coordSysName][stackId] || { - offset: offset, - width: column.width - }; - offset += column.width * (1 + barGapPercent); - }); + } + } else { + ctx.save(); + repaint(); + ctx.restore(); + } + layer.__drawIndex = i; + if (layer.__drawIndex < layer.__endIndex) { + finished = false; + } + } + if (env_default.wxa) { + each(this._layers, function(layer) { + if (layer && layer.ctx && layer.ctx.draw) { + layer.ctx.draw(); + } }); - return result; } - - var angleAxisExtraOption = { - startAngle: 90, - clockwise: true, - splitNumber: 12, - axisLabel: { - rotate: 0 - } + return { + finished, + needsRefreshHover }; - var radiusAxisExtraOption = { - splitNumber: 5 - }; - var PolarView = /** @class */function (_super) { - __extends(PolarView, _super); - function PolarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = PolarView.type; - return _this; - } - PolarView.type = 'polar'; - return PolarView; - }(ComponentView); - function install$u(registers) { - use(install$s); - AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer); - registers.registerCoordinateSystem('polar', polarCreator); - registers.registerComponentModel(PolarModel); - registers.registerComponentView(PolarView); - // Model and view for angleAxis and radiusAxis - axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption); - axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption); - registers.registerComponentView(AngleAxisView); - registers.registerComponentView(RadiusAxisView); - registers.registerLayout(curry(barLayoutPolar, 'bar')); - } - - function layout$2(axisModel, opt) { - opt = opt || {}; - var single = axisModel.coordinateSystem; - var axis = axisModel.axis; - var layout = {}; - var axisPosition = axis.position; - var orient = axis.orient; - var rect = single.getRect(); - var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; - var positionMap = { - horizontal: { - top: rectBound[2], - bottom: rectBound[3] - }, - vertical: { - left: rectBound[0], - right: rectBound[1] + } + _doPaintEl(el, currentLayer, useDirtyRect, repaintRect, scope, isLast) { + const ctx = currentLayer.ctx; + if (useDirtyRect) { + const paintRect = el.getPaintRect(); + if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) { + brush(ctx, el, scope, isLast); + el.setPrevPaintRect(paintRect); + } + } else { + brush(ctx, el, scope, isLast); + } + } + getLayer(zlevel, virtual) { + if (this._singleCanvas && !this._needsManuallyCompositing) { + zlevel = CANVAS_ZLEVEL; + } + let layer = this._layers[zlevel]; + if (!layer) { + layer = new Layer_default("zr_" + zlevel, this, this.dpr); + layer.zlevel = zlevel; + layer.__builtin__ = true; + if (this._layerConfig[zlevel]) { + merge(layer, this._layerConfig[zlevel], true); + } else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) { + merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true); + } + if (virtual) { + layer.virtual = virtual; + } + this.insertLayer(zlevel, layer); + layer.initContext(); + } + return layer; + } + insertLayer(zlevel, layer) { + const layersMap = this._layers; + const zlevelList = this._zlevelList; + const len2 = zlevelList.length; + const domRoot = this._domRoot; + let prevLayer = null; + let i = -1; + if (layersMap[zlevel]) { + if (true) { + logError("ZLevel " + zlevel + " has been used already"); + } + return; + } + if (!isLayerValid(layer)) { + if (true) { + logError("Layer of zlevel " + zlevel + " is not valid"); + } + return; + } + if (len2 > 0 && zlevel > zlevelList[0]) { + for (i = 0; i < len2 - 1; i++) { + if (zlevelList[i] < zlevel && zlevelList[i + 1] > zlevel) { + break; } - }; - layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]]; - var r = { - horizontal: 0, - vertical: 1 - }; - layout.rotation = Math.PI / 2 * r[orient]; - var directionMap = { - top: -1, - bottom: 1, - right: 1, - left: -1 - }; - layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition]; - if (axisModel.get(['axisTick', 'inside'])) { - layout.tickDirection = -layout.tickDirection; - } - if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) { - layout.labelDirection = -layout.labelDirection; - } - var labelRotation = opt.rotate; - labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate'])); - layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation; - layout.z2 = 1; - return layout; - } - - var axisBuilderAttrs$3 = ['axisLine', 'axisTickLabel', 'axisName']; - var selfBuilderAttrs$2 = ['splitArea', 'splitLine']; - var SingleAxisView = /** @class */function (_super) { - __extends(SingleAxisView, _super); - function SingleAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SingleAxisView.type; - _this.axisPointerClass = 'SingleAxisPointer'; - return _this; - } - SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) { - var group = this.group; - group.removeAll(); - var oldAxisGroup = this._axisGroup; - this._axisGroup = new Group(); - var layout = layout$2(axisModel); - var axisBuilder = new AxisBuilder(axisModel, layout); - each(axisBuilderAttrs$3, axisBuilder.add, axisBuilder); - group.add(this._axisGroup); - group.add(axisBuilder.getGroup()); - each(selfBuilderAttrs$2, function (name) { - if (axisModel.get([name, 'show'])) { - axisElementBuilders$2[name](this, this.group, this._axisGroup, axisModel); - } - }, this); - groupTransition(oldAxisGroup, this._axisGroup, axisModel); - _super.prototype.render.call(this, axisModel, ecModel, api, payload); - }; - SingleAxisView.prototype.remove = function () { - rectCoordAxisHandleRemove(this); - }; - SingleAxisView.type = 'singleAxis'; - return SingleAxisView; - }(AxisView); - var axisElementBuilders$2 = { - splitLine: function (axisView, group, axisGroup, axisModel) { - var axis = axisModel.axis; - if (axis.scale.isBlank()) { - return; + } + prevLayer = layersMap[zlevelList[i]]; + } + zlevelList.splice(i + 1, 0, zlevel); + layersMap[zlevel] = layer; + if (!layer.virtual) { + if (prevLayer) { + const prevDom = prevLayer.dom; + if (prevDom.nextSibling) { + domRoot.insertBefore(layer.dom, prevDom.nextSibling); + } else { + domRoot.appendChild(layer.dom); } - var splitLineModel = axisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - lineColors = lineColors instanceof Array ? lineColors : [lineColors]; - var lineWidth = lineStyleModel.get('width'); - 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 line = new Line({ - shape: { - x1: p1[0], - y1: p1[1], - x2: p2[0], - y2: p2[1] - }, - silent: true - }); - subPixelOptimizeLine$1(line.shape, lineWidth); - var colorIndex = lineCount++ % lineColors.length; - splitLines[colorIndex] = splitLines[colorIndex] || []; - splitLines[colorIndex].push(line); - } - var lineStyle = lineStyleModel.getLineStyle(['color']); - for (var i = 0; i < splitLines.length; ++i) { - group.add(mergePath$1(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length] - }, lineStyle), - silent: true - })); + } else { + if (domRoot.firstChild) { + domRoot.insertBefore(layer.dom, domRoot.firstChild); + } else { + domRoot.appendChild(layer.dom); + } + } + } + layer.painter || (layer.painter = this); + } + eachLayer(cb, context) { + const zlevelList = this._zlevelList; + for (let i = 0; i < zlevelList.length; i++) { + const z = zlevelList[i]; + cb.call(context, this._layers[z], z); + } + } + eachBuiltinLayer(cb, context) { + const zlevelList = this._zlevelList; + for (let i = 0; i < zlevelList.length; i++) { + const z = zlevelList[i]; + const layer = this._layers[z]; + if (layer.__builtin__) { + cb.call(context, layer, z); + } + } + } + eachOtherLayer(cb, context) { + const zlevelList = this._zlevelList; + for (let i = 0; i < zlevelList.length; i++) { + const z = zlevelList[i]; + const layer = this._layers[z]; + if (!layer.__builtin__) { + cb.call(context, layer, z); + } + } + } + getLayers() { + return this._layers; + } + _updateLayerStatus(list) { + this.eachBuiltinLayer(function(layer, z) { + layer.__dirty = layer.__used = false; + }); + function updatePrevLayer(idx) { + if (prevLayer) { + if (prevLayer.__endIndex !== idx) { + prevLayer.__dirty = true; } - }, - splitArea: function (axisView, group, axisGroup, axisModel) { - rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel); + prevLayer.__endIndex = idx; } - }; - - var SingleAxisModel = /** @class */function (_super) { - __extends(SingleAxisModel, _super); - function SingleAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SingleAxisModel.type; - return _this; + } + if (this._singleCanvas) { + for (let i2 = 1; i2 < list.length; i2++) { + const el = list[i2]; + if (el.zlevel !== list[i2 - 1].zlevel || el.incremental) { + this._needsManuallyCompositing = true; + break; + } } - SingleAxisModel.prototype.getCoordSysModel = function () { - return this; - }; - SingleAxisModel.type = 'singleAxis'; - SingleAxisModel.layoutMode = 'box'; - SingleAxisModel.defaultOption = { - left: '5%', - top: '5%', - right: '5%', - bottom: '5%', - type: 'value', - position: 'bottom', - orient: 'horizontal', - axisLine: { - show: true, - lineStyle: { - width: 1, - type: 'solid' - } - }, - // Single coordinate system and single axis is the, - // which is used as the parent tooltip model. - // same model, so we set default tooltip show as true. - tooltip: { - show: true - }, - axisTick: { - show: true, - length: 6, - lineStyle: { - width: 1 - } - }, - axisLabel: { - show: true, - interval: 'auto' - }, - splitLine: { - show: true, - lineStyle: { - type: 'dashed', - opacity: 0.2 - } + } + let prevLayer = null; + let incrementalLayerCount = 0; + let prevZlevel; + let i; + for (i = 0; i < list.length; i++) { + const el = list[i]; + const zlevel = el.zlevel; + let layer; + if (prevZlevel !== zlevel) { + prevZlevel = zlevel; + incrementalLayerCount = 0; + } + if (el.incremental) { + layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing); + layer.incremental = true; + incrementalLayerCount = 1; + } else { + layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing); + } + if (!layer.__builtin__) { + logError("ZLevel " + zlevel + " has been used by unkown layer " + layer.id); + } + if (layer !== prevLayer) { + layer.__used = true; + if (layer.__startIndex !== i) { + layer.__dirty = true; } - }; - return SingleAxisModel; - }(ComponentModel); - mixin(SingleAxisModel, AxisModelCommonMixin.prototype); - - var SingleAxis = /** @class */function (_super) { - __extends(SingleAxis, _super); - function SingleAxis(dim, scale, coordExtent, axisType, position) { - var _this = _super.call(this, dim, scale, coordExtent) || this; - _this.type = axisType || 'value'; - _this.position = position || 'bottom'; - return _this; - } - /** - * Judge the orient of the axis. - */ - SingleAxis.prototype.isHorizontal = function () { - var position = this.position; - return position === 'top' || position === 'bottom'; - }; - SingleAxis.prototype.pointToData = function (point, clamp) { - return this.coordinateSystem.pointToData(point)[0]; - }; - return SingleAxis; - }(Axis); - - var singleDimensions = ['single']; - /** - * Create a single coordinates system. - */ - var Single = /** @class */function () { - function Single(axisModel, ecModel, api) { - this.type = 'single'; - this.dimension = 'single'; - /** - * Add it just for draw tooltip. - */ - this.dimensions = singleDimensions; - this.axisPointerEnabled = true; - this.model = axisModel; - this._init(axisModel, ecModel, api); - } - /** - * Initialize single coordinate system. - */ - Single.prototype._init = function (axisModel, ecModel, api) { - var dim = this.dimension; - var axis = new SingleAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position')); - var isCategory = axis.type === 'category'; - axis.onBand = isCategory && axisModel.get('boundaryGap'); - axis.inverse = axisModel.get('inverse'); - axis.orient = axisModel.get('orient'); - axisModel.axis = axis; - axis.model = axisModel; - axis.coordinateSystem = this; - this._axis = axis; - }; - /** - * Update axis scale after data processed - */ - Single.prototype.update = function (ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.coordinateSystem === this) { - var data_1 = seriesModel.getData(); - each(data_1.mapDimensionsAll(this.dimension), function (dim) { - this._axis.scale.unionExtentFromData(data_1, dim); - }, this); - niceScaleExtent(this._axis.scale, this._axis.model); - } - }, this); - }; - /** - * Resize the single coordinate system. - */ - Single.prototype.resize = function (axisModel, api) { - this._rect = getLayoutRect({ - left: axisModel.get('left'), - top: axisModel.get('top'), - right: axisModel.get('right'), - bottom: axisModel.get('bottom'), - width: axisModel.get('width'), - height: axisModel.get('height') - }, { - width: api.getWidth(), - height: api.getHeight() - }); - this._adjustAxis(); - }; - Single.prototype.getRect = function () { - return this._rect; - }; - Single.prototype._adjustAxis = function () { - var rect = this._rect; - var axis = this._axis; - var isHorizontal = axis.isHorizontal(); - var extent = isHorizontal ? [0, rect.width] : [0, rect.height]; - var idx = axis.inverse ? 1 : 0; - axis.setExtent(extent[idx], extent[1 - idx]); - this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y); - }; - Single.prototype._updateAxisTransform = function (axis, coordBase) { - var axisExtent = axis.getExtent(); - var extentSum = axisExtent[0] + axisExtent[1]; - var isHorizontal = axis.isHorizontal(); - axis.toGlobalCoord = isHorizontal ? function (coord) { - return coord + coordBase; - } : function (coord) { - return extentSum - coord + coordBase; - }; - axis.toLocalCoord = isHorizontal ? function (coord) { - return coord - coordBase; - } : function (coord) { - return extentSum - coord + coordBase; - }; - }; - /** - * Get axis. - */ - Single.prototype.getAxis = function () { - return this._axis; - }; - /** - * Get axis, add it just for draw tooltip. - */ - Single.prototype.getBaseAxis = function () { - return this._axis; - }; - Single.prototype.getAxes = function () { - return [this._axis]; - }; - Single.prototype.getTooltipAxes = function () { - return { - baseAxes: [this.getAxis()], - // Empty otherAxes - otherAxes: [] - }; - }; - /** - * If contain point. - */ - Single.prototype.containPoint = function (point) { - var rect = this.getRect(); - var axis = this.getAxis(); - var orient = axis.orient; - if (orient === 'horizontal') { - return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height; + layer.__startIndex = i; + if (!layer.incremental) { + layer.__drawIndex = i; } else { - return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height; + layer.__drawIndex = -1; } - }; - Single.prototype.pointToData = function (point) { - var axis = this.getAxis(); - return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))]; - }; - /** - * Convert the series data to concrete point. - * Can be [val] | val - */ - Single.prototype.dataToPoint = function (val) { - var axis = this.getAxis(); - var rect = this.getRect(); - var pt = []; - var idx = axis.orient === 'horizontal' ? 0 : 1; - if (val instanceof Array) { - val = val[0]; - } - pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val)); - pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2; - return pt; - }; - Single.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$3(finder); - return coordSys === this ? this.dataToPoint(value) : null; - }; - Single.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$3(finder); - return coordSys === this ? this.pointToData(pixel) : null; - }; - return Single; - }(); - function getCoordSys$3(finder) { - var seriesModel = finder.seriesModel; - var singleModel = finder.singleAxisModel; - return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; - } - - /** - * Create single coordinate system and inject it into seriesModel. - */ - function create$2(ecModel, api) { - var singles = []; - ecModel.eachComponent('singleAxis', function (axisModel, idx) { - var single = new Single(axisModel, ecModel, api); - single.name = 'single_' + idx; - single.resize(axisModel, api); - axisModel.coordinateSystem = single; - singles.push(single); - }); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'singleAxis') { - var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; - seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem; + updatePrevLayer(i); + prevLayer = layer; + } + if (el.__dirty & REDRAW_BIT && !el.__inHover) { + layer.__dirty = true; + if (layer.incremental && layer.__drawIndex < 0) { + layer.__drawIndex = i; } - }); - return singles; + } } - var singleCreator = { - create: create$2, - dimensions: singleDimensions - }; - - var XY = ['x', 'y']; - var WH = ['width', 'height']; - var SingleAxisPointer = /** @class */function (_super) { - __extends(SingleAxisPointer, _super); - function SingleAxisPointer() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @override - */ - SingleAxisPointer.prototype.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 = buildElStyle(axisPointerModel); - var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, pixelValue, otherExtent); - pointerOption.style = elStyle; - elOption.graphicKey = pointerOption.type; - elOption.pointer = pointerOption; - } - var layoutInfo = layout$2(axisModel); - buildCartesianSingleLabelElOption( - // @ts-ignore - value, elOption, layoutInfo, axisModel, axisPointerModel, api); - }; - /** - * @override - */ - SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) { - var layoutInfo = layout$2(axisModel, { - labelInside: false - }); - // @ts-ignore - layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']); - var position = getTransformedPosition(axisModel.axis, value, layoutInfo); - return { - x: position[0], - y: position[1], - rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) - }; - }; - /** - * @override - */ - SingleAxisPointer.prototype.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.x, transform.y]; - 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 { - x: currPosition[0], - y: currPosition[1], - rotation: transform.rotation, - cursorPoint: cursorPoint, - tooltipOption: { - verticalAlign: 'middle' - } - }; - }; - return SingleAxisPointer; - }(BaseAxisPointer); - var pointerShapeBuilder$2 = { - line: function (axis, pixelValue, otherExtent) { - var targetShape = 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: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis)) - }; + updatePrevLayer(i); + this.eachBuiltinLayer(function(layer, z) { + if (!layer.__used && layer.getElementCount() > 0) { + layer.__dirty = true; + layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0; } - }; - 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]]]; - } - - var SingleView = /** @class */function (_super) { - __extends(SingleView, _super); - function SingleView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SingleView.type; - return _this; - } - SingleView.type = 'single'; - return SingleView; - }(ComponentView); - function install$v(registers) { - use(install$s); - AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer); - registers.registerComponentView(SingleView); - // Axis - registers.registerComponentView(SingleAxisView); - registers.registerComponentModel(SingleAxisModel); - axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption); - registers.registerCoordinateSystem('single', singleCreator); - } - - var CalendarModel = /** @class */function (_super) { - __extends(CalendarModel, _super); - function CalendarModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CalendarModel.type; - return _this; - } - /** - * @override - */ - CalendarModel.prototype.init = function (option, parentModel, ecModel) { - var inputPositionParams = getLayoutParams(option); - _super.prototype.init.apply(this, arguments); - mergeAndNormalizeLayoutParams(option, inputPositionParams); - }; - /** - * @override - */ - CalendarModel.prototype.mergeOption = function (option) { - _super.prototype.mergeOption.apply(this, arguments); - mergeAndNormalizeLayoutParams(this.option, option); - }; - CalendarModel.prototype.getCellSize = function () { - // Has been normalized - return this.option.cellSize; - }; - CalendarModel.type = 'calendar'; - CalendarModel.defaultOption = { - // zlevel: 0, - z: 2, - left: 80, - top: 60, - cellSize: 20, - // horizontal vertical - orient: 'horizontal', - // month separate line style - splitLine: { - show: true, - lineStyle: { - color: '#000', - width: 1, - type: 'solid' - } - }, - // rect style temporarily unused emphasis - itemStyle: { - color: '#fff', - borderWidth: 1, - borderColor: '#ccc' - }, - // week text style - dayLabel: { - show: true, - firstDay: 0, - // start end - position: 'start', - margin: '50%', - color: '#000' - }, - // month text style - monthLabel: { - show: true, - // start end - position: 'start', - margin: 5, - // center or left - align: 'center', - formatter: null, - color: '#000' - }, - // year text style - yearLabel: { - show: true, - // top bottom left right - position: null, - margin: 30, - formatter: null, - color: '#ccc', - fontFamily: 'sans-serif', - fontWeight: 'bolder', - fontSize: 20 + if (layer.__dirty && layer.__drawIndex < 0) { + layer.__drawIndex = layer.__startIndex; + } + }); + } + clear() { + this.eachBuiltinLayer(this._clearLayer); + return this; + } + _clearLayer(layer) { + layer.clear(); + } + setBackgroundColor(backgroundColor2) { + this._backgroundColor = backgroundColor2; + each(this._layers, (layer) => { + layer.setUnpainted(); + }); + } + configLayer(zlevel, config) { + if (config) { + const layerConfig = this._layerConfig; + if (!layerConfig[zlevel]) { + layerConfig[zlevel] = config; + } else { + merge(layerConfig[zlevel], config, true); + } + for (let i = 0; i < this._zlevelList.length; i++) { + const _zlevel = this._zlevelList[i]; + if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) { + const layer = this._layers[_zlevel]; + merge(layer, layerConfig[zlevel], true); + } + } + } + } + delLayer(zlevel) { + const layers = this._layers; + const zlevelList = this._zlevelList; + const layer = layers[zlevel]; + if (!layer) { + return; + } + layer.dom.parentNode.removeChild(layer.dom); + delete layers[zlevel]; + zlevelList.splice(indexOf(zlevelList, zlevel), 1); + } + resize(width, height) { + if (!this._domRoot.style) { + if (width == null || height == null) { + return; + } + this._width = width; + this._height = height; + this.getLayer(CANVAS_ZLEVEL).resize(width, height); + } else { + const domRoot = this._domRoot; + domRoot.style.display = "none"; + const opts = this._opts; + const root = this.root; + width != null && (opts.width = width); + height != null && (opts.height = height); + width = getSize(root, 0, opts); + height = getSize(root, 1, opts); + domRoot.style.display = ""; + if (this._width !== width || height !== this._height) { + domRoot.style.width = width + "px"; + domRoot.style.height = height + "px"; + for (let id in this._layers) { + if (this._layers.hasOwnProperty(id)) { + this._layers[id].resize(width, height); + } + } + this.refresh(true); + } + this._width = width; + this._height = height; + } + return this; + } + clearLayer(zlevel) { + const layer = this._layers[zlevel]; + if (layer) { + layer.clear(); + } + } + dispose() { + this.root.innerHTML = ""; + this.root = this.storage = this._domRoot = this._layers = null; + } + getRenderedCanvas(opts) { + opts = opts || {}; + if (this._singleCanvas && !this._compositeManually) { + return this._layers[CANVAS_ZLEVEL].dom; + } + const imageLayer = new Layer_default("image", this, opts.pixelRatio || this.dpr); + imageLayer.initContext(); + imageLayer.clear(false, opts.backgroundColor || this._backgroundColor); + const ctx = imageLayer.ctx; + if (opts.pixelRatio <= this.dpr) { + this.refresh(); + const width = imageLayer.dom.width; + const height = imageLayer.dom.height; + this.eachLayer(function(layer) { + if (layer.__builtin__) { + ctx.drawImage(layer.dom, 0, 0, width, height); + } else if (layer.renderToCanvas) { + ctx.save(); + layer.renderToCanvas(ctx); + ctx.restore(); } - }; - return CalendarModel; - }(ComponentModel); - function mergeAndNormalizeLayoutParams(target, raw) { - // Normalize cellSize - var cellSize = target.cellSize; - var cellSizeArr; - if (!isArray(cellSize)) { - cellSizeArr = target.cellSize = [cellSize, cellSize]; + }); + } else { + const scope = { + inHover: false, + viewWidth: this._width, + viewHeight: this._height + }; + const displayList = this.storage.getDisplayList(true); + for (let i = 0, len2 = displayList.length; i < len2; i++) { + const el = displayList[i]; + brush(ctx, el, scope, i === len2 - 1); + } + } + return imageLayer.dom; + } + getWidth() { + return this._width; + } + getHeight() { + return this._height; + } +}; +var Painter_default2 = CanvasPainter; + +// src/renderer/installCanvasRenderer.ts +function install2(registers) { + registers.registerPainter("canvas", Painter_default2); +} + +// src/chart/line/LineSeries.ts +var LineSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = LineSeriesModel2.type; + this.hasSymbolVisual = true; + } + getInitialData(option) { + if (true) { + const coordSys = option.coordinateSystem; + if (coordSys !== "polar" && coordSys !== "cartesian2d") { + throw new Error("Line not support coordinateSystem besides cartesian and polar"); + } + } + return createSeriesData_default(null, this, { + useEncodeDefaulter: true + }); + } + getLegendIcon(opt) { + const group = new Group_default(); + const line2 = createSymbol("line", 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false); + group.add(line2); + line2.setStyle(opt.lineStyle); + const visualType = this.getData().getVisual("symbol"); + const visualRotate = this.getData().getVisual("symbolRotate"); + const symbolType = visualType === "none" ? "circle" : visualType; + const size = opt.itemHeight * 0.8; + const symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill); + group.add(symbol); + symbol.setStyle(opt.itemStyle); + const symbolRotate = opt.iconRotate === "inherit" ? visualRotate : opt.iconRotate || 0; + symbol.rotation = symbolRotate * Math.PI / 180; + symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); + if (symbolType.indexOf("empty") > -1) { + symbol.style.stroke = symbol.style.fill; + symbol.style.fill = "#fff"; + symbol.style.lineWidth = 2; + } + return group; + } +}; +var LineSeriesModel = LineSeriesModel2; +LineSeriesModel.type = "series.line"; +LineSeriesModel.dependencies = ["grid", "polar"]; +LineSeriesModel.defaultOption = { + z: 3, + coordinateSystem: "cartesian2d", + legendHoverLink: true, + clip: true, + label: { + position: "top" + }, + endLabel: { + show: false, + valueAnimation: true, + distance: 8 + }, + lineStyle: { + width: 2, + type: "solid" + }, + emphasis: { + scale: true + }, + step: false, + smooth: false, + smoothMonotone: null, + symbol: "emptyCircle", + symbolSize: 4, + symbolRotate: null, + showSymbol: true, + showAllSymbol: "auto", + connectNulls: false, + sampling: "none", + animationEasing: "linear", + progressive: 0, + hoverLayerThreshold: Infinity, + universalTransition: { + divideShape: "clone" + }, + triggerLineEvent: false +}; +var LineSeries_default = LineSeriesModel; + +// src/chart/helper/labelHelper.ts +function getDefaultLabel(data, dataIndex) { + const labelDims = data.mapDimensionsAll("defaultedLabel"); + const len2 = labelDims.length; + if (len2 === 1) { + const rawVal = retrieveRawValue(data, dataIndex, labelDims[0]); + return rawVal != null ? rawVal + "" : null; + } else if (len2) { + const vals = []; + for (let i = 0; i < labelDims.length; i++) { + vals.push(retrieveRawValue(data, dataIndex, labelDims[i])); + } + return vals.join(" "); + } +} +function getDefaultInterpolatedLabel(data, interpolatedValue) { + const labelDims = data.mapDimensionsAll("defaultedLabel"); + if (!isArray(interpolatedValue)) { + return interpolatedValue + ""; + } + const vals = []; + for (let i = 0; i < labelDims.length; i++) { + const dimIndex = data.getDimensionIndex(labelDims[i]); + if (dimIndex >= 0) { + vals.push(interpolatedValue[dimIndex]); + } + } + return vals.join(" "); +} + +// src/chart/helper/Symbol.ts +var Symbol = class extends Group_default { + constructor(data, idx, seriesScope, opts) { + super(); + this.updateData(data, idx, seriesScope, opts); + } + _createSymbol(symbolType, data, idx, symbolSize, keepAspect) { + this.removeAll(); + const symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect); + symbolPath.attr({ + z2: 100, + culling: true, + scaleX: symbolSize[0] / 2, + scaleY: symbolSize[1] / 2 + }); + symbolPath.drift = driftSymbol; + this._symbolType = symbolType; + this.add(symbolPath); + } + stopSymbolAnimation(toLastFrame) { + this.childAt(0).stopAnimation(null, toLastFrame); + } + getSymbolType() { + return this._symbolType; + } + getSymbolPath() { + return this.childAt(0); + } + highlight() { + enterEmphasis(this.childAt(0)); + } + downplay() { + leaveEmphasis(this.childAt(0)); + } + setZ(zlevel, z) { + const symbolPath = this.childAt(0); + symbolPath.zlevel = zlevel; + symbolPath.z = z; + } + setDraggable(draggable, hasCursorOption) { + const symbolPath = this.childAt(0); + symbolPath.draggable = draggable; + symbolPath.cursor = !hasCursorOption && draggable ? "move" : symbolPath.cursor; + } + updateData(data, idx, seriesScope, opts) { + this.silent = false; + const symbolType = data.getItemVisual(idx, "symbol") || "circle"; + const seriesModel = data.hostModel; + const symbolSize = Symbol.getSymbolSize(data, idx); + const isInit = symbolType !== this._symbolType; + const disableAnimation = opts && opts.disableAnimation; + if (isInit) { + const keepAspect = data.getItemVisual(idx, "symbolKeepAspect"); + this._createSymbol(symbolType, data, idx, symbolSize, keepAspect); + } else { + const symbolPath = this.childAt(0); + symbolPath.silent = false; + const target = { + scaleX: symbolSize[0] / 2, + scaleY: symbolSize[1] / 2 + }; + disableAnimation ? symbolPath.attr(target) : updateProps(symbolPath, target, seriesModel, idx); + saveOldStyle(symbolPath); + } + this._updateCommon(data, idx, symbolSize, seriesScope, opts); + if (isInit) { + const symbolPath = this.childAt(0); + if (!disableAnimation) { + const target = { + scaleX: this._sizeX, + scaleY: this._sizeY, + style: { + opacity: symbolPath.style.opacity + } + }; + symbolPath.scaleX = symbolPath.scaleY = 0; + symbolPath.style.opacity = 0; + initProps(symbolPath, target, seriesModel, idx); + } + } + if (disableAnimation) { + this.childAt(0).stopAnimation("leave"); + } + } + _updateCommon(data, idx, symbolSize, seriesScope, opts) { + const symbolPath = this.childAt(0); + const seriesModel = data.hostModel; + let emphasisItemStyle; + let blurItemStyle; + let selectItemStyle; + let focus; + let blurScope; + let emphasisDisabled; + let labelStatesModels; + let hoverScale; + let cursorStyle; + if (seriesScope) { + emphasisItemStyle = seriesScope.emphasisItemStyle; + blurItemStyle = seriesScope.blurItemStyle; + selectItemStyle = seriesScope.selectItemStyle; + focus = seriesScope.focus; + blurScope = seriesScope.blurScope; + labelStatesModels = seriesScope.labelStatesModels; + hoverScale = seriesScope.hoverScale; + cursorStyle = seriesScope.cursorStyle; + emphasisDisabled = seriesScope.emphasisDisabled; + } + if (!seriesScope || data.hasItemOption) { + const itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx); + const emphasisModel = itemModel.getModel("emphasis"); + emphasisItemStyle = emphasisModel.getModel("itemStyle").getItemStyle(); + selectItemStyle = itemModel.getModel(["select", "itemStyle"]).getItemStyle(); + blurItemStyle = itemModel.getModel(["blur", "itemStyle"]).getItemStyle(); + focus = emphasisModel.get("focus"); + blurScope = emphasisModel.get("blurScope"); + emphasisDisabled = emphasisModel.get("disabled"); + labelStatesModels = getLabelStatesModels(itemModel); + hoverScale = emphasisModel.getShallow("scale"); + cursorStyle = itemModel.getShallow("cursor"); + } + const symbolRotate = data.getItemVisual(idx, "symbolRotate"); + symbolPath.attr("rotation", (symbolRotate || 0) * Math.PI / 180 || 0); + const symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, "symbolOffset"), symbolSize); + if (symbolOffset) { + symbolPath.x = symbolOffset[0]; + symbolPath.y = symbolOffset[1]; + } + cursorStyle && symbolPath.attr("cursor", cursorStyle); + const symbolStyle = data.getItemVisual(idx, "style"); + const visualColor = symbolStyle.fill; + if (symbolPath instanceof Image_default) { + const pathStyle = symbolPath.style; + symbolPath.useStyle(extend({ + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, symbolStyle)); + } else { + if (symbolPath.__isEmptyBrush) { + symbolPath.useStyle(extend({}, symbolStyle)); } else { - cellSizeArr = cellSize; + symbolPath.useStyle(symbolStyle); + } + symbolPath.style.decal = null; + symbolPath.setColor(visualColor, opts && opts.symbolInnerColor); + symbolPath.style.strokeNoScale = true; + } + const liftZ = data.getItemVisual(idx, "liftZ"); + const z2Origin = this._z2; + if (liftZ != null) { + if (z2Origin == null) { + this._z2 = symbolPath.z2; + symbolPath.z2 += liftZ; + } + } else if (z2Origin != null) { + symbolPath.z2 = z2Origin; + this._z2 = null; + } + const useNameLabel = opts && opts.useNameLabel; + setLabelStyle(symbolPath, labelStatesModels, { + labelFetcher: seriesModel, + labelDataIndex: idx, + defaultText: getLabelDefaultText, + inheritColor: visualColor, + defaultOpacity: symbolStyle.opacity + }); + function getLabelDefaultText(idx2) { + return useNameLabel ? data.getName(idx2) : getDefaultLabel(data, idx2); + } + this._sizeX = symbolSize[0] / 2; + this._sizeY = symbolSize[1] / 2; + const emphasisState = symbolPath.ensureState("emphasis"); + emphasisState.style = emphasisItemStyle; + symbolPath.ensureState("select").style = selectItemStyle; + symbolPath.ensureState("blur").style = blurItemStyle; + const scaleRatio = hoverScale == null || hoverScale === true ? Math.max(1.1, 3 / this._sizeY) : isFinite(hoverScale) && hoverScale > 0 ? +hoverScale : 1; + emphasisState.scaleX = this._sizeX * scaleRatio; + emphasisState.scaleY = this._sizeY * scaleRatio; + this.setSymbolScale(1); + toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); + } + setSymbolScale(scale4) { + this.scaleX = this.scaleY = scale4; + } + fadeOut(cb, seriesModel, opt) { + const symbolPath = this.childAt(0); + const dataIndex = getECData(this).dataIndex; + const animationOpt = opt && opt.animation; + this.silent = symbolPath.silent = true; + if (opt && opt.fadeLabel) { + const textContent = symbolPath.getTextContent(); + if (textContent) { + removeElement(textContent, { + style: { + opacity: 0 + } + }, seriesModel, { + dataIndex, + removeOpt: animationOpt, + cb() { + symbolPath.removeTextContent(); + } + }); + } + } else { + symbolPath.removeTextContent(); + } + removeElement(symbolPath, { + style: { + opacity: 0 + }, + scaleX: 0, + scaleY: 0 + }, seriesModel, {dataIndex, cb, removeOpt: animationOpt}); + } + static getSymbolSize(data, idx) { + return normalizeSymbolSize(data.getItemVisual(idx, "symbolSize")); + } +}; +function driftSymbol(dx, dy) { + this.parent.drift(dx, dy); +} +var Symbol_default = Symbol; + +// src/chart/helper/SymbolDraw.ts +function symbolNeedsDraw(data, point, idx, opt) { + return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, "symbol") !== "none"; +} +function normalizeUpdateOpt(opt) { + if (opt != null && !isObject(opt)) { + opt = {isIgnore: opt}; + } + return opt || {}; +} +function makeSeriesScope(data) { + const seriesModel = data.hostModel; + const emphasisModel = seriesModel.getModel("emphasis"); + return { + emphasisItemStyle: emphasisModel.getModel("itemStyle").getItemStyle(), + blurItemStyle: seriesModel.getModel(["blur", "itemStyle"]).getItemStyle(), + selectItemStyle: seriesModel.getModel(["select", "itemStyle"]).getItemStyle(), + focus: emphasisModel.get("focus"), + blurScope: emphasisModel.get("blurScope"), + emphasisDisabled: emphasisModel.get("disabled"), + hoverScale: emphasisModel.get("scale"), + labelStatesModels: getLabelStatesModels(seriesModel), + cursorStyle: seriesModel.get("cursor") + }; +} +var SymbolDraw = class { + constructor(SymbolCtor) { + this.group = new Group_default(); + this._SymbolCtor = SymbolCtor || Symbol_default; + } + updateData(data, opt) { + this._progressiveEls = null; + opt = normalizeUpdateOpt(opt); + const group = this.group; + const seriesModel = data.hostModel; + const oldData = this._data; + const SymbolCtor = this._SymbolCtor; + const disableAnimation = opt.disableAnimation; + const seriesScope = makeSeriesScope(data); + const symbolUpdateOpt = {disableAnimation}; + const getSymbolPoint = opt.getSymbolPoint || function(idx) { + return data.getItemLayout(idx); + }; + if (!oldData) { + group.removeAll(); + } + data.diff(oldData).add(function(newIdx) { + const point = getSymbolPoint(newIdx); + if (symbolNeedsDraw(data, point, newIdx, opt)) { + const symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); + symbolEl.setPosition(point); + data.setItemGraphicEl(newIdx, symbolEl); + group.add(symbolEl); + } + }).update(function(newIdx, oldIdx) { + let symbolEl = oldData.getItemGraphicEl(oldIdx); + const point = getSymbolPoint(newIdx); + if (!symbolNeedsDraw(data, point, newIdx, opt)) { + group.remove(symbolEl); + return; } - if (cellSizeArr.length === 1) { - cellSizeArr[1] = cellSizeArr[0]; + const newSymbolType = data.getItemVisual(newIdx, "symbol") || "circle"; + const oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType(); + if (!symbolEl || oldSymbolType && oldSymbolType !== newSymbolType) { + group.remove(symbolEl); + symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); + symbolEl.setPosition(point); + } else { + symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt); + const target = { + x: point[0], + y: point[1] + }; + disableAnimation ? symbolEl.attr(target) : updateProps(symbolEl, target, seriesModel); } - var ignoreSize = map([0, 1], function (hvIdx) { - // If user have set `width` or both `left` and `right`, cellSizeArr - // will be automatically set to 'auto', otherwise the default - // setting of cellSizeArr will make `width` setting not work. - if (sizeCalculable(raw, hvIdx)) { - cellSizeArr[hvIdx] = 'auto'; - } - return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto'; + group.add(symbolEl); + data.setItemGraphicEl(newIdx, symbolEl); + }).remove(function(oldIdx) { + const el = oldData.getItemGraphicEl(oldIdx); + el && el.fadeOut(function() { + group.remove(el); + }, seriesModel); + }).execute(); + this._getSymbolPoint = getSymbolPoint; + this._data = data; + } + updateLayout() { + const data = this._data; + if (data) { + data.eachItemGraphicEl((el, idx) => { + const point = this._getSymbolPoint(idx); + el.setPosition(point); + el.markRedraw(); }); - mergeLayoutParam(target, raw, { - type: 'box', - ignoreSize: ignoreSize + } + } + incrementalPrepareUpdate(data) { + this._seriesScope = makeSeriesScope(data); + this._data = null; + this.group.removeAll(); + } + incrementalUpdate(taskParams, data, opt) { + this._progressiveEls = []; + opt = normalizeUpdateOpt(opt); + function updateIncrementalAndHover(el) { + if (!el.isGroup) { + el.incremental = true; + el.ensureState("emphasis").hoverLayer = true; + } + } + for (let idx = taskParams.start; idx < taskParams.end; idx++) { + const point = data.getItemLayout(idx); + if (symbolNeedsDraw(data, point, idx, opt)) { + const el = new this._SymbolCtor(data, idx, this._seriesScope); + el.traverse(updateIncrementalAndHover); + el.setPosition(point); + this.group.add(el); + data.setItemGraphicEl(idx, el); + this._progressiveEls.push(el); + } + } + } + eachRendered(cb) { + traverseElements(this._progressiveEls || this.group, cb); + } + remove(enableAnimation) { + const group = this.group; + const data = this._data; + if (data && enableAnimation) { + data.eachItemGraphicEl(function(el) { + el.fadeOut(function() { + group.remove(el); + }, data.hostModel); }); + } else { + group.removeAll(); + } + } +}; +var SymbolDraw_default = SymbolDraw; + +// src/chart/line/helper.ts +function prepareDataCoordInfo(coordSys, data, valueOrigin) { + const baseAxis = coordSys.getBaseAxis(); + const valueAxis2 = coordSys.getOtherAxis(baseAxis); + const valueStart = getValueStart(valueAxis2, valueOrigin); + const baseAxisDim = baseAxis.dim; + const valueAxisDim = valueAxis2.dim; + const valueDim = data.mapDimension(valueAxisDim); + const baseDim = data.mapDimension(baseAxisDim); + const baseDataOffset = valueAxisDim === "x" || valueAxisDim === "radius" ? 1 : 0; + const dims = map(coordSys.dimensions, function(coordDim) { + return data.mapDimension(coordDim); + }); + let stacked = false; + const stackResultDim = data.getCalculationInfo("stackResultDimension"); + if (isDimensionStacked(data, dims[0])) { + stacked = true; + dims[0] = stackResultDim; + } + if (isDimensionStacked(data, dims[1])) { + stacked = true; + dims[1] = stackResultDim; + } + return { + dataDimsForPoint: dims, + valueStart, + valueAxisDim, + baseAxisDim, + stacked: !!stacked, + valueDim, + baseDim, + baseDataOffset, + stackedOverDimension: data.getCalculationInfo("stackedOverDimension") + }; +} +function getValueStart(valueAxis2, valueOrigin) { + let valueStart = 0; + const extent3 = valueAxis2.scale.getExtent(); + if (valueOrigin === "start") { + valueStart = extent3[0]; + } else if (valueOrigin === "end") { + valueStart = extent3[1]; + } else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) { + valueStart = valueOrigin; + } else { + if (extent3[0] > 0) { + valueStart = extent3[0]; + } else if (extent3[1] < 0) { + valueStart = extent3[1]; + } + } + return valueStart; +} +function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) { + let value = NaN; + if (dataCoordInfo.stacked) { + value = data.get(data.getCalculationInfo("stackedOverDimension"), idx); + } + if (isNaN(value)) { + value = dataCoordInfo.valueStart; + } + const baseDataOffset = dataCoordInfo.baseDataOffset; + const stackedData = []; + stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx); + stackedData[1 - baseDataOffset] = value; + return coordSys.dataToPoint(stackedData); +} + +// src/chart/line/lineAnimationDiff.ts +function diffData(oldData, newData) { + const diffResult = []; + newData.diff(oldData).add(function(idx) { + diffResult.push({cmd: "+", idx}); + }).update(function(newIdx, oldIdx) { + diffResult.push({cmd: "=", idx: oldIdx, idx1: newIdx}); + }).remove(function(idx) { + diffResult.push({cmd: "-", idx}); + }).execute(); + return diffResult; +} +function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) { + const diff = diffData(oldData, newData); + const currPoints = []; + const nextPoints = []; + const currStackedPoints = []; + const nextStackedPoints = []; + const status = []; + const sortedIndices = []; + const rawIndices = []; + const newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); + const oldPoints = oldData.getLayout("points") || []; + const newPoints = newData.getLayout("points") || []; + for (let i = 0; i < diff.length; i++) { + const diffItem = diff[i]; + let pointAdded = true; + let oldIdx2; + let newIdx2; + switch (diffItem.cmd) { + case "=": + oldIdx2 = diffItem.idx * 2; + newIdx2 = diffItem.idx1 * 2; + let currentX = oldPoints[oldIdx2]; + let currentY = oldPoints[oldIdx2 + 1]; + const nextX = newPoints[newIdx2]; + const nextY = newPoints[newIdx2 + 1]; + if (isNaN(currentX) || isNaN(currentY)) { + currentX = nextX; + currentY = nextY; + } + currPoints.push(currentX, currentY); + nextPoints.push(nextX, nextY); + currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]); + nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); + rawIndices.push(newData.getRawIndex(diffItem.idx1)); + break; + case "+": + const newIdx = diffItem.idx; + const newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint; + const oldPt = oldCoordSys.dataToPoint([ + newData.get(newDataDimsForPoint[0], newIdx), + newData.get(newDataDimsForPoint[1], newIdx) + ]); + newIdx2 = newIdx * 2; + currPoints.push(oldPt[0], oldPt[1]); + nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]); + const stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx); + currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]); + nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); + rawIndices.push(newData.getRawIndex(newIdx)); + break; + case "-": + pointAdded = false; + } + if (pointAdded) { + status.push(diffItem); + sortedIndices.push(sortedIndices.length); + } + } + sortedIndices.sort(function(a, b) { + return rawIndices[a] - rawIndices[b]; + }); + const len2 = currPoints.length; + const sortedCurrPoints = createFloat32Array(len2); + const sortedNextPoints = createFloat32Array(len2); + const sortedCurrStackedPoints = createFloat32Array(len2); + const sortedNextStackedPoints = createFloat32Array(len2); + const sortedStatus = []; + for (let i = 0; i < sortedIndices.length; i++) { + const idx = sortedIndices[i]; + const i2 = i * 2; + const idx2 = idx * 2; + sortedCurrPoints[i2] = currPoints[idx2]; + sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1]; + sortedNextPoints[i2] = nextPoints[idx2]; + sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1]; + sortedCurrStackedPoints[i2] = currStackedPoints[idx2]; + sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1]; + sortedNextStackedPoints[i2] = nextStackedPoints[idx2]; + sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1]; + sortedStatus[i] = status[idx]; + } + return { + current: sortedCurrPoints, + next: sortedNextPoints, + stackedOnCurrent: sortedCurrStackedPoints, + stackedOnNext: sortedNextStackedPoints, + status: sortedStatus + }; +} + +// src/chart/line/poly.ts +var mathMin6 = Math.min; +var mathMax6 = Math.max; +function isPointNull(x, y) { + return isNaN(x) || isNaN(y); +} +function drawSegment(ctx, points4, start2, segLen, allLen, dir3, smooth, smoothMonotone, connectNulls) { + let prevX; + let prevY; + let cpx0; + let cpy0; + let cpx1; + let cpy1; + let idx = start2; + let k = 0; + for (; k < segLen; k++) { + let x = points4[idx * 2]; + let y = points4[idx * 2 + 1]; + if (idx >= allLen || idx < 0) { + break; + } + if (isPointNull(x, y)) { + if (connectNulls) { + idx += dir3; + continue; + } + break; + } + if (idx === start2) { + ctx[dir3 > 0 ? "moveTo" : "lineTo"](x, y); + cpx0 = x; + cpy0 = y; + } else { + let dx = x - prevX; + let dy = y - prevY; + if (dx * dx + dy * dy < 0.5) { + idx += dir3; + continue; + } + if (smooth > 0) { + let nextIdx = idx + dir3; + let nextX = points4[nextIdx * 2]; + let nextY = points4[nextIdx * 2 + 1]; + while (nextX === x && nextY === y && k < segLen) { + k++; + nextIdx += dir3; + idx += dir3; + nextX = points4[nextIdx * 2]; + nextY = points4[nextIdx * 2 + 1]; + x = points4[idx * 2]; + y = points4[idx * 2 + 1]; + dx = x - prevX; + dy = y - prevY; + } + let tmpK = k + 1; + if (connectNulls) { + while (isPointNull(nextX, nextY) && tmpK < segLen) { + tmpK++; + nextIdx += dir3; + nextX = points4[nextIdx * 2]; + nextY = points4[nextIdx * 2 + 1]; + } + } + let ratioNextSeg = 0.5; + let vx = 0; + let vy = 0; + let nextCpx0; + let nextCpy0; + if (tmpK >= segLen || isPointNull(nextX, nextY)) { + cpx1 = x; + cpy1 = y; + } else { + vx = nextX - prevX; + vy = nextY - prevY; + const dx0 = x - prevX; + const dx1 = nextX - x; + const dy0 = y - prevY; + const dy1 = nextY - y; + let lenPrevSeg; + let lenNextSeg; + if (smoothMonotone === "x") { + lenPrevSeg = Math.abs(dx0); + lenNextSeg = Math.abs(dx1); + const dir4 = vx > 0 ? 1 : -1; + cpx1 = x - dir4 * lenPrevSeg * smooth; + cpy1 = y; + nextCpx0 = x + dir4 * lenNextSeg * smooth; + nextCpy0 = y; + } else if (smoothMonotone === "y") { + lenPrevSeg = Math.abs(dy0); + lenNextSeg = Math.abs(dy1); + const dir4 = vy > 0 ? 1 : -1; + cpx1 = x; + cpy1 = y - dir4 * lenPrevSeg * smooth; + nextCpx0 = x; + nextCpy0 = y + dir4 * lenNextSeg * smooth; + } else { + lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0); + lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); + ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg); + cpx1 = x - vx * smooth * (1 - ratioNextSeg); + cpy1 = y - vy * smooth * (1 - ratioNextSeg); + nextCpx0 = x + vx * smooth * ratioNextSeg; + nextCpy0 = y + vy * smooth * ratioNextSeg; + nextCpx0 = mathMin6(nextCpx0, mathMax6(nextX, x)); + nextCpy0 = mathMin6(nextCpy0, mathMax6(nextY, y)); + nextCpx0 = mathMax6(nextCpx0, mathMin6(nextX, x)); + nextCpy0 = mathMax6(nextCpy0, mathMin6(nextY, y)); + vx = nextCpx0 - x; + vy = nextCpy0 - y; + cpx1 = x - vx * lenPrevSeg / lenNextSeg; + cpy1 = y - vy * lenPrevSeg / lenNextSeg; + cpx1 = mathMin6(cpx1, mathMax6(prevX, x)); + cpy1 = mathMin6(cpy1, mathMax6(prevY, y)); + cpx1 = mathMax6(cpx1, mathMin6(prevX, x)); + cpy1 = mathMax6(cpy1, mathMin6(prevY, y)); + vx = x - cpx1; + vy = y - cpy1; + nextCpx0 = x + vx * lenNextSeg / lenPrevSeg; + nextCpy0 = y + vy * lenNextSeg / lenPrevSeg; + } + } + ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y); + cpx0 = nextCpx0; + cpy0 = nextCpy0; + } else { + ctx.lineTo(x, y); + } } - - var CalendarView = /** @class */function (_super) { - __extends(CalendarView, _super); - function CalendarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CalendarView.type; - return _this; - } - CalendarView.prototype.render = function (calendarModel, ecModel, api) { - var group = this.group; - group.removeAll(); - var coordSys = calendarModel.coordinateSystem; - // range info - var rangeData = coordSys.getRangeInfo(); - var orient = coordSys.getOrient(); - // locale - var localeModel = ecModel.getLocaleModel(); - this._renderDayRect(calendarModel, rangeData, group); - // _renderLines must be called prior to following function - this._renderLines(calendarModel, rangeData, orient, group); - this._renderYearText(calendarModel, rangeData, orient, group); - this._renderMonthText(calendarModel, localeModel, orient, group); - this._renderWeekText(calendarModel, localeModel, rangeData, orient, group); - }; - // render day rect - CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) { - var coordSys = calendarModel.coordinateSystem; - var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle(); - var sw = coordSys.getCellWidth(); - var sh = coordSys.getCellHeight(); - for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) { - var point = coordSys.dataToRect([i], false).tl; - // every rect - var rect = new Rect({ - shape: { - x: point[0], - y: point[1], - width: sw, - height: sh - }, - cursor: 'default', - style: itemRectStyleModel - }); - group.add(rect); + prevX = x; + prevY = y; + idx += dir3; + } + return k; +} +var ECPolylineShape = class { + constructor() { + this.smooth = 0; + this.smoothConstraint = true; + } +}; +var ECPolyline = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "ec-polyline"; + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new ECPolylineShape(); + } + buildPath(ctx, shape) { + const points4 = shape.points; + let i = 0; + let len2 = points4.length / 2; + if (shape.connectNulls) { + for (; len2 > 0; len2--) { + if (!isPointNull(points4[len2 * 2 - 2], points4[len2 * 2 - 1])) { + break; } - }; - // render separate line - CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) { - var self = this; - var coordSys = calendarModel.coordinateSystem; - var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle(); - var show = calendarModel.get(['splitLine', 'show']); - var lineWidth = lineStyleModel.lineWidth; - this._tlpoints = []; - this._blpoints = []; - this._firstDayOfMonth = []; - this._firstDayPoints = []; - var firstDay = rangeData.start; - for (var i = 0; firstDay.time <= rangeData.end.time; i++) { - addPoints(firstDay.formatedDate); - if (i === 0) { - firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m); + } + for (; i < len2; i++) { + if (!isPointNull(points4[i * 2], points4[i * 2 + 1])) { + break; + } + } + } + while (i < len2) { + i += drawSegment(ctx, points4, i, len2, len2, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1; + } + } + getPointOn(xOrY, dim) { + if (!this.path) { + this.createPathProxy(); + this.buildPath(this.path, this.shape); + } + const path = this.path; + const data = path.data; + const CMD6 = PathProxy_default.CMD; + let x0; + let y0; + const isDimX = dim === "x"; + const roots2 = []; + for (let i = 0; i < data.length; ) { + const cmd = data[i++]; + let x; + let y; + let x2; + let y2; + let x3; + let y3; + let t; + switch (cmd) { + case CMD6.M: + x0 = data[i++]; + y0 = data[i++]; + break; + case CMD6.L: + x = data[i++]; + y = data[i++]; + t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0); + if (t <= 1 && t >= 0) { + const val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0; + return isDimX ? [xOrY, val] : [val, xOrY]; + } + x0 = x; + y0 = y; + break; + case CMD6.C: + x = data[i++]; + y = data[i++]; + x2 = data[i++]; + y2 = data[i++]; + x3 = data[i++]; + y3 = data[i++]; + const nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots2) : cubicRootAt(y0, y, y2, y3, xOrY, roots2); + if (nRoot > 0) { + for (let i2 = 0; i2 < nRoot; i2++) { + const t2 = roots2[i2]; + if (t2 <= 1 && t2 >= 0) { + const val = isDimX ? cubicAt(y0, y, y2, y3, t2) : cubicAt(x0, x, x2, x3, t2); + return isDimX ? [xOrY, val] : [val, xOrY]; + } + } } - var date = firstDay.date; - date.setMonth(date.getMonth() + 1); - firstDay = coordSys.getDateInfo(date); - } - addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); - function addPoints(date) { - self._firstDayOfMonth.push(coordSys.getDateInfo(date)); - self._firstDayPoints.push(coordSys.dataToRect([date], false).tl); - var points = self._getLinePointsOfOneWeek(calendarModel, date, orient); - self._tlpoints.push(points[0]); - self._blpoints.push(points[points.length - 1]); - show && self._drawSplitline(points, lineStyleModel, group); - } - // render top/left line - show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); - // render bottom/right line - show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group); - }; - // get points at both ends - CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) { - var rs = [points[0].slice(), points[points.length - 1].slice()]; - var idx = orient === 'horizontal' ? 0 : 1; - // both ends of the line are extend half lineWidth - rs[0][idx] = rs[0][idx] - lineWidth / 2; - rs[1][idx] = rs[1][idx] + lineWidth / 2; - return rs; - }; - // render split line - CalendarView.prototype._drawSplitline = function (points, lineStyle, group) { - var poyline = new Polyline({ - z2: 20, - shape: { - points: points - }, - style: lineStyle - }); - group.add(poyline); - }; - // render month line of one week points - CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) { - var coordSys = calendarModel.coordinateSystem; - var parsedDate = coordSys.getDateInfo(date); - var points = []; - for (var i = 0; i < 7; i++) { - var tmpD = coordSys.getNextNDay(parsedDate.time, i); - var point = coordSys.dataToRect([tmpD.time], false); - points[2 * tmpD.day] = point.tl; - points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr']; - } - return points; - }; - CalendarView.prototype._formatterLabel = function (formatter, params) { - if (isString(formatter) && formatter) { - return formatTplSimple(formatter, params); + x0 = x3; + y0 = y3; + break; + } + } + } +}; +var ECPolygonShape = class extends ECPolylineShape { +}; +var ECPolygon = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "ec-polygon"; + } + getDefaultShape() { + return new ECPolygonShape(); + } + buildPath(ctx, shape) { + const points4 = shape.points; + const stackedOnPoints = shape.stackedOnPoints; + let i = 0; + let len2 = points4.length / 2; + const smoothMonotone = shape.smoothMonotone; + if (shape.connectNulls) { + for (; len2 > 0; len2--) { + if (!isPointNull(points4[len2 * 2 - 2], points4[len2 * 2 - 1])) { + break; } - if (isFunction(formatter)) { - return formatter(params); + } + for (; i < len2; i++) { + if (!isPointNull(points4[i * 2], points4[i * 2 + 1])) { + break; } - return params.nameMap; - }; - CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) { - var x = point[0]; - var y = point[1]; - var aligns = ['center', 'bottom']; - if (position === 'bottom') { - y += margin; - aligns = ['center', 'top']; - } else if (position === 'left') { - x -= margin; - } else if (position === 'right') { - x += margin; - aligns = ['center', 'top']; - } else { - // top - y -= margin; + } + } + while (i < len2) { + const k = drawSegment(ctx, points4, i, len2, len2, 1, shape.smooth, smoothMonotone, shape.connectNulls); + drawSegment(ctx, stackedOnPoints, i + k - 1, k, len2, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls); + i += k + 1; + ctx.closePath(); + } + } +}; + +// src/chart/helper/createClipPathFromCoordSys.ts +function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) { + const rect = cartesian.getArea(); + let x = rect.x; + let y = rect.y; + let width = rect.width; + let height = rect.height; + const lineWidth = seriesModel.get(["lineStyle", "width"]) || 0; + x -= lineWidth / 2; + y -= lineWidth / 2; + width += lineWidth; + height += lineWidth; + width = Math.ceil(width); + if (x !== Math.floor(x)) { + x = Math.floor(x); + width++; + } + const clipPath = new Rect_default({ + shape: { + x, + y, + width, + height + } + }); + if (hasAnimation) { + const baseAxis = cartesian.getBaseAxis(); + const isHorizontal = baseAxis.isHorizontal(); + const isAxisInversed = baseAxis.inverse; + if (isHorizontal) { + if (isAxisInversed) { + clipPath.shape.x += width; + } + clipPath.shape.width = 0; + } else { + if (!isAxisInversed) { + clipPath.shape.y += height; + } + clipPath.shape.height = 0; + } + const duringCb = isFunction(during) ? (percent) => { + during(percent, clipPath); + } : null; + initProps(clipPath, { + shape: { + width, + height, + x, + y + } + }, seriesModel, null, done, duringCb); + } + return clipPath; +} +function createPolarClipPath(polar, hasAnimation, seriesModel) { + const sectorArea = polar.getArea(); + const r0 = round(sectorArea.r0, 1); + const r = round(sectorArea.r, 1); + const clipPath = new Sector_default({ + shape: { + cx: round(polar.cx, 1), + cy: round(polar.cy, 1), + r0, + r, + startAngle: sectorArea.startAngle, + endAngle: sectorArea.endAngle, + clockwise: sectorArea.clockwise + } + }); + if (hasAnimation) { + const isRadial = polar.getBaseAxis().dim === "angle"; + if (isRadial) { + clipPath.shape.endAngle = sectorArea.startAngle; + } else { + clipPath.shape.r = r0; + } + initProps(clipPath, { + shape: { + endAngle: sectorArea.endAngle, + r + } + }, seriesModel); + } + return clipPath; +} +function createClipPath(coordSys, hasAnimation, seriesModel, done, during) { + if (!coordSys) { + return null; + } else if (coordSys.type === "polar") { + return createPolarClipPath(coordSys, hasAnimation, seriesModel); + } else if (coordSys.type === "cartesian2d") { + return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during); + } + return null; +} + +// src/coord/CoordinateSystem.ts +function isCoordinateSystemType(coordSys, type) { + return coordSys.type === type; +} + +// src/chart/line/LineView.ts +function isPointsSame(points1, points22) { + if (points1.length !== points22.length) { + return; + } + for (let i = 0; i < points1.length; i++) { + if (points1[i] !== points22[i]) { + return; + } + } + return true; +} +function bboxFromPoints(points4) { + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + for (let i = 0; i < points4.length; ) { + const x = points4[i++]; + const y = points4[i++]; + if (!isNaN(x)) { + minX = Math.min(x, minX); + maxX = Math.max(x, maxX); + } + if (!isNaN(y)) { + minY = Math.min(y, minY); + maxY = Math.max(y, maxY); + } + } + return [ + [minX, minY], + [maxX, maxY] + ]; +} +function getBoundingDiff(points1, points22) { + const [min1, max1] = bboxFromPoints(points1); + const [min23, max23] = bboxFromPoints(points22); + return Math.max(Math.abs(min1[0] - min23[0]), Math.abs(min1[1] - min23[1]), Math.abs(max1[0] - max23[0]), Math.abs(max1[1] - max23[1])); +} +function getSmooth(smooth) { + return isNumber(smooth) ? smooth : smooth ? 0.5 : 0; +} +function getStackedOnPoints(coordSys, data, dataCoordInfo) { + if (!dataCoordInfo.valueDim) { + return []; + } + const len2 = data.count(); + const points4 = createFloat32Array(len2 * 2); + for (let idx = 0; idx < len2; idx++) { + const pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx); + points4[idx * 2] = pt[0]; + points4[idx * 2 + 1] = pt[1]; + } + return points4; +} +function turnPointsIntoStep(points4, coordSys, stepTurnAt, connectNulls) { + const baseAxis = coordSys.getBaseAxis(); + const baseIndex = baseAxis.dim === "x" || baseAxis.dim === "radius" ? 0 : 1; + const stepPoints = []; + let i = 0; + const stepPt = []; + const pt = []; + const nextPt = []; + const filteredPoints = []; + if (connectNulls) { + for (i = 0; i < points4.length; i += 2) { + if (!isNaN(points4[i]) && !isNaN(points4[i + 1])) { + filteredPoints.push(points4[i], points4[i + 1]); + } + } + points4 = filteredPoints; + } + for (i = 0; i < points4.length - 2; i += 2) { + nextPt[0] = points4[i + 2]; + nextPt[1] = points4[i + 3]; + pt[0] = points4[i]; + pt[1] = points4[i + 1]; + stepPoints.push(pt[0], pt[1]); + switch (stepTurnAt) { + case "end": + stepPt[baseIndex] = nextPt[baseIndex]; + stepPt[1 - baseIndex] = pt[1 - baseIndex]; + stepPoints.push(stepPt[0], stepPt[1]); + break; + case "middle": + const middle = (pt[baseIndex] + nextPt[baseIndex]) / 2; + const stepPt2 = []; + stepPt[baseIndex] = stepPt2[baseIndex] = middle; + stepPt[1 - baseIndex] = pt[1 - baseIndex]; + stepPt2[1 - baseIndex] = nextPt[1 - baseIndex]; + stepPoints.push(stepPt[0], stepPt[1]); + stepPoints.push(stepPt2[0], stepPt2[1]); + break; + default: + stepPt[baseIndex] = pt[baseIndex]; + stepPt[1 - baseIndex] = nextPt[1 - baseIndex]; + stepPoints.push(stepPt[0], stepPt[1]); + } + } + stepPoints.push(points4[i++], points4[i++]); + return stepPoints; +} +function clipColorStops(colorStops, maxSize) { + const newColorStops = []; + const len2 = colorStops.length; + let prevOutOfRangeColorStop; + let prevInRangeColorStop; + function lerpStop(stop0, stop1, clippedCoord) { + const coord0 = stop0.coord; + const p = (clippedCoord - coord0) / (stop1.coord - coord0); + const color2 = lerp2(p, [stop0.color, stop1.color]); + return {coord: clippedCoord, color: color2}; + } + for (let i = 0; i < len2; i++) { + const stop2 = colorStops[i]; + const coord = stop2.coord; + if (coord < 0) { + prevOutOfRangeColorStop = stop2; + } else if (coord > maxSize) { + if (prevInRangeColorStop) { + newColorStops.push(lerpStop(prevInRangeColorStop, stop2, maxSize)); + } else if (prevOutOfRangeColorStop) { + newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop2, 0), lerpStop(prevOutOfRangeColorStop, stop2, maxSize)); + } + break; + } else { + if (prevOutOfRangeColorStop) { + newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop2, 0)); + prevOutOfRangeColorStop = null; + } + newColorStops.push(stop2); + prevInRangeColorStop = stop2; + } + } + return newColorStops; +} +function getVisualGradient(data, coordSys, api2) { + const visualMetaList = data.getVisual("visualMeta"); + if (!visualMetaList || !visualMetaList.length || !data.count()) { + return; + } + if (coordSys.type !== "cartesian2d") { + if (true) { + console.warn("Visual map on line style is only supported on cartesian2d."); + } + return; + } + let coordDim; + let visualMeta; + for (let i = visualMetaList.length - 1; i >= 0; i--) { + const dimInfo = data.getDimensionInfo(visualMetaList[i].dimension); + coordDim = dimInfo && dimInfo.coordDim; + if (coordDim === "x" || coordDim === "y") { + visualMeta = visualMetaList[i]; + break; + } + } + if (!visualMeta) { + if (true) { + console.warn("Visual map on line style only support x or y dimension."); + } + return; + } + const axis = coordSys.getAxis(coordDim); + const colorStops = map(visualMeta.stops, function(stop2) { + return { + coord: axis.toGlobalCoord(axis.dataToCoord(stop2.value)), + color: stop2.color + }; + }); + const stopLen = colorStops.length; + const outerColors = visualMeta.outerColors.slice(); + if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) { + colorStops.reverse(); + outerColors.reverse(); + } + const colorStopsInRange = clipColorStops(colorStops, coordDim === "x" ? api2.getWidth() : api2.getHeight()); + const inRangeStopLen = colorStopsInRange.length; + if (!inRangeStopLen && stopLen) { + return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color; + } + const tinyExtent = 10; + const minCoord = colorStopsInRange[0].coord - tinyExtent; + const maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent; + const coordSpan = maxCoord - minCoord; + if (coordSpan < 1e-3) { + return "transparent"; + } + each(colorStopsInRange, function(stop2) { + stop2.offset = (stop2.coord - minCoord) / coordSpan; + }); + colorStopsInRange.push({ + offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5, + color: outerColors[1] || "transparent" + }); + colorStopsInRange.unshift({ + offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5, + color: outerColors[0] || "transparent" + }); + const gradient = new LinearGradient_default(0, 0, 0, 0, colorStopsInRange, true); + gradient[coordDim] = minCoord; + gradient[coordDim + "2"] = maxCoord; + return gradient; +} +function getIsIgnoreFunc(seriesModel, data, coordSys) { + const showAllSymbol = seriesModel.get("showAllSymbol"); + const isAuto = showAllSymbol === "auto"; + if (showAllSymbol && !isAuto) { + return; + } + const categoryAxis2 = coordSys.getAxesByScale("ordinal")[0]; + if (!categoryAxis2) { + return; + } + if (isAuto && canShowAllSymbolForCategory(categoryAxis2, data)) { + return; + } + const categoryDataDim = data.mapDimension(categoryAxis2.dim); + const labelMap = {}; + each(categoryAxis2.getViewLabels(), function(labelItem) { + const ordinalNumber = categoryAxis2.scale.getRawOrdinalNumber(labelItem.tickValue); + labelMap[ordinalNumber] = 1; + }); + return function(dataIndex) { + return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex)); + }; +} +function canShowAllSymbolForCategory(categoryAxis2, data) { + const axisExtent = categoryAxis2.getExtent(); + let availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis2.scale.count(); + isNaN(availSize) && (availSize = 0); + const dataLen = data.count(); + const step = Math.max(1, Math.round(dataLen / 5)); + for (let dataIndex = 0; dataIndex < dataLen; dataIndex += step) { + if (Symbol_default.getSymbolSize(data, dataIndex)[categoryAxis2.isHorizontal() ? 1 : 0] * 1.5 > availSize) { + return false; + } + } + return true; +} +function isPointNull2(x, y) { + return isNaN(x) || isNaN(y); +} +function getLastIndexNotNull(points4) { + let len2 = points4.length / 2; + for (; len2 > 0; len2--) { + if (!isPointNull2(points4[len2 * 2 - 2], points4[len2 * 2 - 1])) { + break; + } + } + return len2 - 1; +} +function getPointAtIndex(points4, idx) { + return [points4[idx * 2], points4[idx * 2 + 1]]; +} +function getIndexRange(points4, xOrY, dim) { + const len2 = points4.length / 2; + const dimIdx = dim === "x" ? 0 : 1; + let a; + let b; + let prevIndex = 0; + let nextIndex = -1; + for (let i = 0; i < len2; i++) { + b = points4[i * 2 + dimIdx]; + if (isNaN(b) || isNaN(points4[i * 2 + 1 - dimIdx])) { + continue; + } + if (i === 0) { + a = b; + continue; + } + if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) { + nextIndex = i; + break; + } + prevIndex = i; + a = b; + } + return { + range: [prevIndex, nextIndex], + t: (xOrY - a) / (b - a) + }; +} +function anyStateShowEndLabel(seriesModel) { + if (seriesModel.get(["endLabel", "show"])) { + return true; + } + for (let i = 0; i < SPECIAL_STATES.length; i++) { + if (seriesModel.get([SPECIAL_STATES[i], "endLabel", "show"])) { + return true; + } + } + return false; +} +function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) { + if (isCoordinateSystemType(coordSys, "cartesian2d")) { + const endLabelModel = seriesModel.getModel("endLabel"); + const valueAnimation = endLabelModel.get("valueAnimation"); + const data = seriesModel.getData(); + const labelAnimationRecord = {lastFrameIndex: 0}; + const during = anyStateShowEndLabel(seriesModel) ? (percent, clipRect) => { + lineView._endLabelOnDuring(percent, clipRect, data, labelAnimationRecord, valueAnimation, endLabelModel, coordSys); + } : null; + const isHorizontal = coordSys.getBaseAxis().isHorizontal(); + const clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, () => { + const endLabel = lineView._endLabel; + if (endLabel && hasAnimation) { + if (labelAnimationRecord.originalX != null) { + endLabel.attr({ + x: labelAnimationRecord.originalX, + y: labelAnimationRecord.originalY + }); } - var rotate = 0; - if (position === 'left' || position === 'right') { - rotate = Math.PI / 2; + } + }, during); + if (!seriesModel.get("clip", true)) { + const rectShape = clipPath.shape; + const expandSize = Math.max(rectShape.width, rectShape.height); + if (isHorizontal) { + rectShape.y -= expandSize; + rectShape.height += expandSize * 2; + } else { + rectShape.x -= expandSize; + rectShape.width += expandSize * 2; + } + } + if (during) { + during(1, clipPath); + } + return clipPath; + } else { + if (true) { + if (seriesModel.get(["endLabel", "show"])) { + console.warn("endLabel is not supported for lines in polar systems."); + } + } + return createPolarClipPath(coordSys, hasAnimation, seriesModel); + } +} +function getEndLabelStateSpecified(endLabelModel, coordSys) { + const baseAxis = coordSys.getBaseAxis(); + const isHorizontal = baseAxis.isHorizontal(); + const isBaseInversed = baseAxis.inverse; + const align = isHorizontal ? isBaseInversed ? "right" : "left" : "center"; + const verticalAlign = isHorizontal ? "middle" : isBaseInversed ? "top" : "bottom"; + return { + normal: { + align: endLabelModel.get("align") || align, + verticalAlign: endLabelModel.get("verticalAlign") || verticalAlign + } + }; +} +var LineView = class extends Chart_default { + init() { + const lineGroup = new Group_default(); + const symbolDraw = new SymbolDraw_default(); + this.group.add(symbolDraw.group); + this._symbolDraw = symbolDraw; + this._lineGroup = lineGroup; + this._changePolyState = bind(this._changePolyState, this); + } + render(seriesModel, ecModel, api2) { + const coordSys = seriesModel.coordinateSystem; + const group = this.group; + const data = seriesModel.getData(); + const lineStyleModel = seriesModel.getModel("lineStyle"); + const areaStyleModel = seriesModel.getModel("areaStyle"); + let points4 = data.getLayout("points") || []; + const isCoordSysPolar = coordSys.type === "polar"; + const prevCoordSys = this._coordSys; + const symbolDraw = this._symbolDraw; + let polyline = this._polyline; + let polygon = this._polygon; + const lineGroup = this._lineGroup; + const hasAnimation = !ecModel.ssr && seriesModel.get("animation"); + const isAreaChart = !areaStyleModel.isEmpty(); + const valueOrigin = areaStyleModel.get("origin"); + const dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin); + let stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo); + const showSymbol = seriesModel.get("showSymbol"); + const connectNulls = seriesModel.get("connectNulls"); + const isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); + const oldData = this._data; + oldData && oldData.eachItemGraphicEl(function(el, idx) { + if (el.__temp) { + group.remove(el); + oldData.setItemGraphicEl(idx, null); + } + }); + if (!showSymbol) { + symbolDraw.remove(); + } + group.add(lineGroup); + const step = !isCoordSysPolar ? seriesModel.get("step") : false; + let clipShapeForSymbol; + if (coordSys && coordSys.getArea && seriesModel.get("clip", true)) { + clipShapeForSymbol = coordSys.getArea(); + if (clipShapeForSymbol.width != null) { + clipShapeForSymbol.x -= 0.1; + clipShapeForSymbol.y -= 0.1; + clipShapeForSymbol.width += 0.2; + clipShapeForSymbol.height += 0.2; + } else if (clipShapeForSymbol.r0) { + clipShapeForSymbol.r0 -= 0.5; + clipShapeForSymbol.r += 0.5; + } + } + this._clipShapeForSymbol = clipShapeForSymbol; + const visualColor = getVisualGradient(data, coordSys, api2) || data.getVisual("style")[data.getVisual("drawType")]; + if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) { + showSymbol && symbolDraw.updateData(data, { + isIgnore: isIgnoreFunc, + clipShape: clipShapeForSymbol, + disableAnimation: true, + getSymbolPoint(idx) { + return [points4[idx * 2], points4[idx * 2 + 1]]; } - return { - rotation: rotate, - x: x, - y: y, - style: { - align: aligns[0], - verticalAlign: aligns[1] - } - }; - }; - // render year - CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) { - var yearLabel = calendarModel.getModel('yearLabel'); - if (!yearLabel.get('show')) { - return; + }); + hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol); + if (step) { + points4 = turnPointsIntoStep(points4, coordSys, step, connectNulls); + if (stackedOnPoints) { + stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); + } + } + polyline = this._newPolyline(points4); + if (isAreaChart) { + polygon = this._newPolygon(points4, stackedOnPoints); + } else if (polygon) { + lineGroup.remove(polygon); + polygon = this._polygon = null; + } + if (!isCoordSysPolar) { + this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); + } + lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); + } else { + if (isAreaChart && !polygon) { + polygon = this._newPolygon(points4, stackedOnPoints); + } else if (polygon && !isAreaChart) { + lineGroup.remove(polygon); + polygon = this._polygon = null; + } + if (!isCoordSysPolar) { + this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); + } + const oldClipPath = lineGroup.getClipPath(); + if (oldClipPath) { + const newClipPath = createLineClipPath(this, coordSys, false, seriesModel); + initProps(oldClipPath, { + shape: newClipPath.shape + }, seriesModel); + } else { + lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); + } + showSymbol && symbolDraw.updateData(data, { + isIgnore: isIgnoreFunc, + clipShape: clipShapeForSymbol, + disableAnimation: true, + getSymbolPoint(idx) { + return [points4[idx * 2], points4[idx * 2 + 1]]; } - var margin = yearLabel.get('margin'); - var pos = yearLabel.get('position'); - if (!pos) { - pos = orient !== 'horizontal' ? 'top' : 'left'; - } - var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; - var xc = (points[0][0] + points[1][0]) / 2; - var yc = (points[0][1] + points[1][1]) / 2; - var idx = orient === 'horizontal' ? 0 : 1; - var posPoints = { - top: [xc, points[idx][1]], - bottom: [xc, points[1 - idx][1]], - left: [points[1 - idx][0], yc], - right: [points[idx][0], yc] - }; - var name = rangeData.start.y; - if (+rangeData.end.y > +rangeData.start.y) { - name = name + '-' + rangeData.end.y; - } - var formatter = yearLabel.get('formatter'); - var params = { - start: rangeData.start.y, - end: rangeData.end.y, - nameMap: name - }; - var content = this._formatterLabel(formatter, params); - var yearText = new ZRText({ - z2: 30, - style: createTextStyle(yearLabel, { - text: content - }) - }); - yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); - group.add(yearText); - }; - CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) { - var align = 'left'; - var vAlign = 'top'; - var x = point[0]; - var y = point[1]; - if (orient === 'horizontal') { - y = y + margin; - if (isCenter) { - align = 'center'; - } - if (position === 'start') { - vAlign = 'bottom'; - } + }); + if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points4)) { + if (hasAnimation) { + this._doUpdateAnimation(data, stackedOnPoints, coordSys, api2, step, valueOrigin, connectNulls); } else { - x = x + margin; - if (isCenter) { - vAlign = 'middle'; - } - if (position === 'start') { - align = 'right'; + if (step) { + points4 = turnPointsIntoStep(points4, coordSys, step, connectNulls); + if (stackedOnPoints) { + stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); + } } + polyline.setShape({ + points: points4 + }); + polygon && polygon.setShape({ + points: points4, + stackedOnPoints + }); } - return { - x: x, - y: y, - align: align, - verticalAlign: vAlign - }; - }; - // render month and year text - CalendarView.prototype._renderMonthText = function (calendarModel, localeModel, orient, group) { - var monthLabel = calendarModel.getModel('monthLabel'); - if (!monthLabel.get('show')) { + } + } + const emphasisModel = seriesModel.getModel("emphasis"); + const focus = emphasisModel.get("focus"); + const blurScope = emphasisModel.get("blurScope"); + const emphasisDisabled = emphasisModel.get("disabled"); + polyline.useStyle(defaults(lineStyleModel.getLineStyle(), { + fill: "none", + stroke: visualColor, + lineJoin: "bevel" + })); + setStatesStylesFromModel(polyline, seriesModel, "lineStyle"); + if (polyline.style.lineWidth > 0 && seriesModel.get(["emphasis", "lineStyle", "width"]) === "bolder") { + const emphasisLineStyle = polyline.getState("emphasis").style; + emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1; + } + getECData(polyline).seriesIndex = seriesModel.seriesIndex; + toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled); + const smooth = getSmooth(seriesModel.get("smooth")); + const smoothMonotone = seriesModel.get("smoothMonotone"); + polyline.setShape({ + smooth, + smoothMonotone, + connectNulls + }); + if (polygon) { + const stackedOnSeries = data.getCalculationInfo("stackedOnSeries"); + let stackedOnSmooth = 0; + polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { + fill: visualColor, + opacity: 0.7, + lineJoin: "bevel", + decal: data.getVisual("style").decal + })); + if (stackedOnSeries) { + stackedOnSmooth = getSmooth(stackedOnSeries.get("smooth")); + } + polygon.setShape({ + smooth, + stackedOnSmooth, + smoothMonotone, + connectNulls + }); + setStatesStylesFromModel(polygon, seriesModel, "areaStyle"); + getECData(polygon).seriesIndex = seriesModel.seriesIndex; + toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled); + } + const changePolyState = this._changePolyState; + data.eachItemGraphicEl(function(el) { + el && (el.onHoverStateChange = changePolyState); + }); + this._polyline.onHoverStateChange = changePolyState; + this._data = data; + this._coordSys = coordSys; + this._stackedOnPoints = stackedOnPoints; + this._points = points4; + this._step = step; + this._valueOrigin = valueOrigin; + if (seriesModel.get("triggerLineEvent")) { + this.packEventData(seriesModel, polyline); + polygon && this.packEventData(seriesModel, polygon); + } + } + packEventData(seriesModel, el) { + getECData(el).eventData = { + componentType: "series", + componentSubType: "line", + componentIndex: seriesModel.componentIndex, + seriesIndex: seriesModel.seriesIndex, + seriesName: seriesModel.name, + seriesType: "line" + }; + } + highlight(seriesModel, ecModel, api2, payload) { + const data = seriesModel.getData(); + const dataIndex = queryDataIndex(data, payload); + this._changePolyState("emphasis"); + if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) { + const points4 = data.getLayout("points"); + let symbol = data.getItemGraphicEl(dataIndex); + if (!symbol) { + const x = points4[dataIndex * 2]; + const y = points4[dataIndex * 2 + 1]; + if (isNaN(x) || isNaN(y)) { return; } - var nameMap = monthLabel.get('nameMap'); - var margin = monthLabel.get('margin'); - var pos = monthLabel.get('position'); - var align = monthLabel.get('align'); - var termPoints = [this._tlpoints, this._blpoints]; - if (!nameMap || isString(nameMap)) { - if (nameMap) { - // case-sensitive - localeModel = getLocaleModel(nameMap) || localeModel; - } - // PENDING - // for ZH locale, original form is `一月` but current form is `1月` - nameMap = localeModel.get(['time', 'monthAbbr']) || []; - } - var idx = pos === 'start' ? 0 : 1; - var axis = orient === 'horizontal' ? 0 : 1; - margin = pos === 'start' ? -margin : margin; - var isCenter = align === 'center'; - for (var i = 0; i < termPoints[idx].length - 1; i++) { - var tmp = termPoints[idx][i].slice(); - var firstDay = this._firstDayOfMonth[i]; - if (isCenter) { - var firstDayPoints = this._firstDayPoints[i]; - tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; - } - var formatter = monthLabel.get('formatter'); - var name_1 = nameMap[+firstDay.m - 1]; - var params = { - yyyy: firstDay.y, - yy: (firstDay.y + '').slice(2), - MM: firstDay.m, - M: +firstDay.m, - nameMap: name_1 - }; - var content = this._formatterLabel(formatter, params); - var monthText = new ZRText({ - z2: 30, - style: extend(createTextStyle(monthLabel, { - text: content - }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)) - }); - group.add(monthText); + if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) { + return; } - }; - CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) { - var align = 'center'; - var vAlign = 'middle'; - var x = point[0]; - var y = point[1]; - var isStart = position === 'start'; - if (orient === 'horizontal') { - x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; - align = isStart ? 'right' : 'left'; + const zlevel = seriesModel.get("zlevel") || 0; + const z = seriesModel.get("z") || 0; + symbol = new Symbol_default(data, dataIndex); + symbol.x = x; + symbol.y = y; + symbol.setZ(zlevel, z); + const symbolLabel = symbol.getSymbolPath().getTextContent(); + if (symbolLabel) { + symbolLabel.zlevel = zlevel; + symbolLabel.z = z; + symbolLabel.z2 = this._polyline.z2 + 1; + } + symbol.__temp = true; + data.setItemGraphicEl(dataIndex, symbol); + symbol.stopSymbolAnimation(true); + this.group.add(symbol); + } + symbol.highlight(); + } else { + Chart_default.prototype.highlight.call(this, seriesModel, ecModel, api2, payload); + } + } + downplay(seriesModel, ecModel, api2, payload) { + const data = seriesModel.getData(); + const dataIndex = queryDataIndex(data, payload); + this._changePolyState("normal"); + if (dataIndex != null && dataIndex >= 0) { + const symbol = data.getItemGraphicEl(dataIndex); + if (symbol) { + if (symbol.__temp) { + data.setItemGraphicEl(dataIndex, null); + this.group.remove(symbol); } else { - y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; - vAlign = isStart ? 'bottom' : 'top'; - } - return { - x: x, - y: y, - align: align, - verticalAlign: vAlign - }; - }; - // render weeks - CalendarView.prototype._renderWeekText = function (calendarModel, localeModel, rangeData, orient, group) { - var dayLabel = calendarModel.getModel('dayLabel'); - if (!dayLabel.get('show')) { - return; + symbol.downplay(); } - var coordSys = calendarModel.coordinateSystem; - var pos = dayLabel.get('position'); - var nameMap = dayLabel.get('nameMap'); - var margin = dayLabel.get('margin'); - var firstDayOfWeek = coordSys.getFirstDayOfWeek(); - if (!nameMap || isString(nameMap)) { - if (nameMap) { - // case-sensitive - localeModel = getLocaleModel(nameMap) || localeModel; + } + } else { + Chart_default.prototype.downplay.call(this, seriesModel, ecModel, api2, payload); + } + } + _changePolyState(toState) { + const polygon = this._polygon; + setStatesFlag(this._polyline, toState); + polygon && setStatesFlag(polygon, toState); + } + _newPolyline(points4) { + let polyline = this._polyline; + if (polyline) { + this._lineGroup.remove(polyline); + } + polyline = new ECPolyline({ + shape: { + points: points4 + }, + segmentIgnoreThreshold: 2, + z2: 10 + }); + this._lineGroup.add(polyline); + this._polyline = polyline; + return polyline; + } + _newPolygon(points4, stackedOnPoints) { + let polygon = this._polygon; + if (polygon) { + this._lineGroup.remove(polygon); + } + polygon = new ECPolygon({ + shape: { + points: points4, + stackedOnPoints + }, + segmentIgnoreThreshold: 2 + }); + this._lineGroup.add(polygon); + this._polygon = polygon; + return polygon; + } + _initSymbolLabelAnimation(data, coordSys, clipShape) { + let isHorizontalOrRadial; + let isCoordSysPolar; + const baseAxis = coordSys.getBaseAxis(); + const isAxisInverse = baseAxis.inverse; + if (coordSys.type === "cartesian2d") { + isHorizontalOrRadial = baseAxis.isHorizontal(); + isCoordSysPolar = false; + } else if (coordSys.type === "polar") { + isHorizontalOrRadial = baseAxis.dim === "angle"; + isCoordSysPolar = true; + } + const seriesModel = data.hostModel; + let seriesDuration = seriesModel.get("animationDuration"); + if (isFunction(seriesDuration)) { + seriesDuration = seriesDuration(null); + } + const seriesDelay = seriesModel.get("animationDelay") || 0; + const seriesDelayValue = isFunction(seriesDelay) ? seriesDelay(null) : seriesDelay; + data.eachItemGraphicEl(function(symbol, idx) { + const el = symbol; + if (el) { + const point = [symbol.x, symbol.y]; + let start2; + let end2; + let current; + if (clipShape) { + if (isCoordSysPolar) { + const polarClip = clipShape; + const coord = coordSys.pointToCoord(point); + if (isHorizontalOrRadial) { + start2 = polarClip.startAngle; + end2 = polarClip.endAngle; + current = -coord[1] / 180 * Math.PI; + } else { + start2 = polarClip.r0; + end2 = polarClip.r; + current = coord[0]; + } + } else { + const gridClip = clipShape; + if (isHorizontalOrRadial) { + start2 = gridClip.x; + end2 = gridClip.x + gridClip.width; + current = symbol.x; + } else { + start2 = gridClip.y + gridClip.height; + end2 = gridClip.y; + current = symbol.y; + } } - // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file - var dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort']); - nameMap = dayOfWeekShort || map(localeModel.get(['time', 'dayOfWeekAbbr']), function (val) { - return val[0]; - }); } - var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time; - var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; - margin = parsePercent$1(margin, Math.min(cellSize[1], cellSize[0])); - if (pos === 'start') { - start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time; - margin = -margin; - } - for (var i = 0; i < 7; i++) { - var tmpD = coordSys.getNextNDay(start, i); - var point = coordSys.dataToRect([tmpD.time], false).center; - var day = i; - day = Math.abs((i + firstDayOfWeek) % 7); - var weekText = new ZRText({ - z2: 30, - style: extend(createTextStyle(dayLabel, { - text: nameMap[day] - }), this._weekTextPositionControl(point, orient, pos, margin, cellSize)) - }); - group.add(weekText); + let ratio = end2 === start2 ? 0 : (current - start2) / (end2 - start2); + if (isAxisInverse) { + ratio = 1 - ratio; } - }; - CalendarView.type = 'calendar'; - return CalendarView; - }(ComponentView); - - // (24*60*60*1000) - var PROXIMATE_ONE_DAY = 86400000; - var Calendar = /** @class */function () { - function Calendar(calendarModel, ecModel, api) { - this.type = 'calendar'; - this.dimensions = Calendar.dimensions; - // Required in createListFromData - this.getDimensionsInfo = Calendar.getDimensionsInfo; - this._model = calendarModel; - } - Calendar.getDimensionsInfo = function () { - return [{ - name: 'time', - type: 'time' - }, 'value']; - }; - Calendar.prototype.getRangeInfo = function () { - return this._rangeInfo; - }; - Calendar.prototype.getModel = function () { - return this._model; - }; - Calendar.prototype.getRect = function () { - return this._rect; - }; - Calendar.prototype.getCellWidth = function () { - return this._sw; - }; - Calendar.prototype.getCellHeight = function () { - return this._sh; - }; - Calendar.prototype.getOrient = function () { - return this._orient; - }; - /** - * getFirstDayOfWeek - * - * @example - * 0 : start at Sunday - * 1 : start at Monday - * - * @return {number} - */ - Calendar.prototype.getFirstDayOfWeek = function () { - return this._firstDayOfWeek; - }; - /** - * get date info - * } - */ - Calendar.prototype.getDateInfo = function (date) { - date = parseDate(date); - var y = date.getFullYear(); - var m = date.getMonth() + 1; - var mStr = m < 10 ? '0' + m : '' + m; - var d = date.getDate(); - var dStr = d < 10 ? '0' + d : '' + d; - var day = date.getDay(); - day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); - return { - y: y + '', - m: mStr, - d: dStr, - day: day, - time: date.getTime(), - formatedDate: y + '-' + mStr + '-' + dStr, - date: date - }; - }; - Calendar.prototype.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); - }; - Calendar.prototype.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.getCellSize().slice(); - var layoutParams = this._model.getBoxLayoutParams(); - var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks]; - 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 = getLayoutRect(layoutParams, whGlobal); - each([0, 1], function (idx) { - if (!cellSizeSpecified(cellSize, idx)) { - cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; - } + const delay = isFunction(seriesDelay) ? seriesDelay(idx) : seriesDuration * ratio + seriesDelayValue; + const symbolPath = el.getSymbolPath(); + const text = symbolPath.getTextContent(); + el.attr({scaleX: 0, scaleY: 0}); + el.animateTo({ + scaleX: 1, + scaleY: 1 + }, { + duration: 200, + setToFinal: true, + delay }); - function cellSizeSpecified(cellSize, idx) { - return cellSize[idx] != null && cellSize[idx] !== 'auto'; + if (text) { + text.animateFrom({ + style: { + opacity: 0 + } + }, { + duration: 300, + delay + }); } - // Has been calculated out number. - this._sw = cellSize[0]; - this._sh = cellSize[1]; - }; - /** - * Convert a time data(time, value) item to (x, y) point. - */ - // TODO Clamp of calendar is not same with cartesian coordinate systems. - // It will return NaN if data exceeds. - Calendar.prototype.dataToPoint = function (data, clamp) { - 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 - */ - Calendar.prototype.pointToData = function (point) { - var date = this.pointToDate(point); - return date && date.time; - }; - /** - * Convert a time date item to (x, y) four point. - */ - Calendar.prototype.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 + symbolPath.disableLabelAnimation = true; + } + }); + } + _initOrUpdateEndLabel(seriesModel, coordSys, inheritColor) { + const endLabelModel = seriesModel.getModel("endLabel"); + if (anyStateShowEndLabel(seriesModel)) { + const data = seriesModel.getData(); + const polyline = this._polyline; + const points4 = data.getLayout("points"); + if (!points4) { + polyline.removeTextContent(); + this._endLabel = null; + return; + } + let endLabel = this._endLabel; + if (!endLabel) { + endLabel = this._endLabel = new Text_default({ + z2: 200 + }); + endLabel.ignoreClip = true; + polyline.setTextContent(this._endLabel); + polyline.disableLabelAnimation = true; + } + const dataIndex = getLastIndexNotNull(points4); + if (dataIndex >= 0) { + setLabelStyle(polyline, getLabelStatesModels(seriesModel, "endLabel"), { + inheritColor, + labelFetcher: seriesModel, + labelDataIndex: dataIndex, + defaultText(dataIndex2, opt, interpolatedValue) { + return interpolatedValue != null ? getDefaultInterpolatedLabel(data, interpolatedValue) : getDefaultLabel(data, dataIndex2); }, - 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 - */ - Calendar.prototype.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); - }; - Calendar.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$4(finder); - return coordSys === this ? coordSys.dataToPoint(value) : null; - }; - Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$4(finder); - return coordSys === this ? coordSys.pointToData(pixel) : null; - }; - Calendar.prototype.containPoint = function (point) { - console.warn('Not implemented.'); - return false; - }; - /** - * initRange - * Normalize to an [start, end] array - */ - Calendar.prototype._initRangeOption = function () { - var range = this._model.get('range'); - var normalizedRange; - // Convert [1990] to 1990 - if (isArray(range) && range.length === 1) { - range = range[0]; - } - if (!isArray(range)) { - var rangeStr = range.toString(); - // One year. - if (/^\d{4}$/.test(rangeStr)) { - normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31']; - } - // One month - if (/^\d{4}[\/|-]\d{1,2}$/.test(rangeStr)) { - var start = this.getDateInfo(rangeStr); - var firstDay = start.date; - firstDay.setMonth(firstDay.getMonth() + 1); - var end = this.getNextNDay(firstDay, -1); - normalizedRange = [start.formatedDate, end.formatedDate]; - } - // One day - if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rangeStr)) { - normalizedRange = [rangeStr, rangeStr]; - } + enableTextSetter: true + }, getEndLabelStateSpecified(endLabelModel, coordSys)); + polyline.textConfig.position = null; + } + } else if (this._endLabel) { + this._polyline.removeTextContent(); + this._endLabel = null; + } + } + _endLabelOnDuring(percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) { + const endLabel = this._endLabel; + const polyline = this._polyline; + if (endLabel) { + if (percent < 1 && animationRecord.originalX == null) { + animationRecord.originalX = endLabel.x; + animationRecord.originalY = endLabel.y; + } + const points4 = data.getLayout("points"); + const seriesModel = data.hostModel; + const connectNulls = seriesModel.get("connectNulls"); + const precision = endLabelModel.get("precision"); + const distance2 = endLabelModel.get("distance") || 0; + const baseAxis = coordSys.getBaseAxis(); + const isHorizontal = baseAxis.isHorizontal(); + const isBaseInversed = baseAxis.inverse; + const clipShape = clipRect.shape; + const xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y; + const distanceX = (isHorizontal ? distance2 : 0) * (isBaseInversed ? -1 : 1); + const distanceY = (isHorizontal ? 0 : -distance2) * (isBaseInversed ? -1 : 1); + const dim = isHorizontal ? "x" : "y"; + const dataIndexRange = getIndexRange(points4, xOrY, dim); + const indices = dataIndexRange.range; + const diff = indices[1] - indices[0]; + let value; + if (diff >= 1) { + if (diff > 1 && !connectNulls) { + const pt = getPointAtIndex(points4, indices[0]); + endLabel.attr({ + x: pt[0] + distanceX, + y: pt[1] + distanceY + }); + valueAnimation && (value = seriesModel.getRawValue(indices[0])); } else { - normalizedRange = range; + const pt = polyline.getPointOn(xOrY, dim); + pt && endLabel.attr({ + x: pt[0] + distanceX, + y: pt[1] + distanceY + }); + const startValue = seriesModel.getRawValue(indices[0]); + const endValue = seriesModel.getRawValue(indices[1]); + valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t)); } - if (!normalizedRange) { - if ("development" !== 'production') { - logError('Invalid date range.'); - } - // Not handling it. - return range; + animationRecord.lastFrameIndex = indices[0]; + } else { + const idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0; + const pt = getPointAtIndex(points4, idx); + valueAnimation && (value = seriesModel.getRawValue(idx)); + endLabel.attr({ + x: pt[0] + distanceX, + y: pt[1] + distanceY + }); + } + if (valueAnimation) { + const inner23 = labelInner(endLabel); + if (typeof inner23.setLabelText === "function") { + inner23.setLabelText(value); + } + } + } + } + _doUpdateAnimation(data, stackedOnPoints, coordSys, api2, step, valueOrigin, connectNulls) { + const polyline = this._polyline; + const polygon = this._polygon; + const seriesModel = data.hostModel; + const diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin); + let current = diff.current; + let stackedOnCurrent = diff.stackedOnCurrent; + let next = diff.next; + let stackedOnNext = diff.stackedOnNext; + if (step) { + current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls); + stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls); + next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls); + stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls); + } + if (getBoundingDiff(current, next) > 3e3 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3e3) { + polyline.stopAnimation(); + polyline.setShape({ + points: next + }); + if (polygon) { + polygon.stopAnimation(); + polygon.setShape({ + points: next, + stackedOnPoints: stackedOnNext + }); + } + return; + } + polyline.shape.__points = diff.current; + polyline.shape.points = current; + const target = { + shape: { + points: next + } + }; + if (diff.current !== current) { + target.shape.__points = diff.next; + } + polyline.stopAnimation(); + updateProps(polyline, target, seriesModel); + if (polygon) { + polygon.setShape({ + points: current, + stackedOnPoints: stackedOnCurrent + }); + polygon.stopAnimation(); + updateProps(polygon, { + shape: { + stackedOnPoints: stackedOnNext } - var tmp = this._getRangeInfo(normalizedRange); - if (tmp.start.time > tmp.end.time) { - normalizedRange.reverse(); + }, seriesModel); + if (polyline.shape.points !== polygon.shape.points) { + polygon.shape.points = polyline.shape.points; + } + } + const updatedDataInfo = []; + const diffStatus = diff.status; + for (let i = 0; i < diffStatus.length; i++) { + const cmd = diffStatus[i].cmd; + if (cmd === "=") { + const el = data.getItemGraphicEl(diffStatus[i].idx1); + if (el) { + updatedDataInfo.push({ + el, + ptIdx: i + }); } - return normalizedRange; - }; - /** - * 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 - */ - Calendar.prototype._getRangeInfo = function (range) { - var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])]; - var reversed; - if (parsedRange[0].time > parsedRange[1].time) { - reversed = true; - parsedRange.reverse(); - } - var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[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", - // ``` - // let first = new Date(1478412000000 - 3600 * 1000 * 2.5); - // let second = new Date(1478412000000); - // let 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(parsedRange[0].time); - var startDateNum = date.getDate(); - var endDateNum = parsedRange[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() - parsedRange[1].time > 0 ? 1 : -1; - while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) { - allDay -= sign; - date.setDate(dateNum - sign); - } + } + } + if (polyline.animators && polyline.animators.length) { + polyline.animators[0].during(function() { + polygon && polygon.dirtyShape(); + const points4 = polyline.shape.__points; + for (let i = 0; i < updatedDataInfo.length; i++) { + const el = updatedDataInfo[i].el; + const offset = updatedDataInfo[i].ptIdx * 2; + el.x = points4[offset]; + el.y = points4[offset + 1]; + el.markRedraw(); } - var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7); - var nthWeek = reversed ? -weeks + 1 : weeks - 1; - reversed && parsedRange.reverse(); - return { - range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate], - start: parsedRange[0], - end: parsedRange[1], - allDay: allDay, - weeks: weeks, - // From 0. - nthWeek: nthWeek, - fweek: parsedRange[0].day, - lweek: parsedRange[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} - */ - Calendar.prototype._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 null; - } - 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.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]; + }); + } + } + remove(ecModel) { + const group = this.group; + const oldData = this._data; + this._lineGroup.removeAll(); + this._symbolDraw.remove(true); + oldData && oldData.eachItemGraphicEl(function(el, idx) { + if (el.__temp) { + group.remove(el); + oldData.setItemGraphicEl(idx, null); + } + }); + this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null; + } +}; +LineView.type = "line"; +var LineView_default = LineView; + +// src/layout/points.ts +function pointsLayout(seriesType2, forceStoreInTypedArray) { + return { + seriesType: seriesType2, + plan: createRenderPlanner(), + reset: function(seriesModel) { + const data = seriesModel.getData(); + const coordSys = seriesModel.coordinateSystem; + const pipelineContext = seriesModel.pipelineContext; + const useTypedArray = forceStoreInTypedArray || pipelineContext.large; + if (!coordSys) { + return; + } + const dims = map(coordSys.dimensions, function(dim) { + return data.mapDimension(dim); + }).slice(0, 2); + const dimLen = dims.length; + const stackResultDim = data.getCalculationInfo("stackResultDimension"); + if (isDimensionStacked(data, dims[0])) { + dims[0] = stackResultDim; + } + if (isDimensionStacked(data, dims[1])) { + dims[1] = stackResultDim; + } + const store = data.getStore(); + const dimIdx0 = data.getDimensionIndex(dims[0]); + const dimIdx1 = data.getDimensionIndex(dims[1]); + return dimLen && { + progress(params, data2) { + const segCount = params.end - params.start; + const points4 = useTypedArray && createFloat32Array(segCount * dimLen); + const tmpIn = []; + const tmpOut = []; + for (let i = params.start, offset = 0; i < params.end; i++) { + let point; + if (dimLen === 1) { + const x = store.get(dimIdx0, i); + point = coordSys.dataToPoint(x, null, tmpOut); + } else { + tmpIn[0] = store.get(dimIdx0, i); + tmpIn[1] = store.get(dimIdx1, i); + point = coordSys.dataToPoint(tmpIn, null, tmpOut); + } + if (useTypedArray) { + points4[offset++] = point[0]; + points4[offset++] = point[1]; + } else { + data2.setItemLayout(i, point.slice()); + } + } + useTypedArray && data2.setLayout("points", points4); + } + }; + } + }; +} + +// src/processor/dataSample.ts +var samplers = { + average: function(frame) { + let sum2 = 0; + let count2 = 0; + for (let i = 0; i < frame.length; i++) { + if (!isNaN(frame[i])) { + sum2 += frame[i]; + count2++; + } + } + return count2 === 0 ? NaN : sum2 / count2; + }, + sum: function(frame) { + let sum2 = 0; + for (let i = 0; i < frame.length; i++) { + sum2 += frame[i] || 0; + } + return sum2; + }, + max: function(frame) { + let max3 = -Infinity; + for (let i = 0; i < frame.length; i++) { + frame[i] > max3 && (max3 = frame[i]); + } + return isFinite(max3) ? max3 : NaN; + }, + min: function(frame) { + let min3 = Infinity; + for (let i = 0; i < frame.length; i++) { + frame[i] < min3 && (min3 = frame[i]); + } + return isFinite(min3) ? min3 : NaN; + }, + minmax: function(frame) { + let turningPointAbsoluteValue = -Infinity; + let turningPointOriginalValue = -Infinity; + for (let i = 0; i < frame.length; i++) { + const originalValue = frame[i]; + const absoluteValue = Math.abs(originalValue); + if (absoluteValue > turningPointAbsoluteValue) { + turningPointAbsoluteValue = absoluteValue; + turningPointOriginalValue = originalValue; + } + } + return isFinite(turningPointOriginalValue) ? turningPointOriginalValue : NaN; + }, + nearest: function(frame) { + return frame[0]; + } +}; +var indexSampler = function(frame) { + return Math.round(frame.length / 2); +}; +function dataSample(seriesType2) { + return { + seriesType: seriesType2, + reset: function(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const sampling = seriesModel.get("sampling"); + const coordSys = seriesModel.coordinateSystem; + const count2 = data.count(); + if (count2 > 10 && coordSys.type === "cartesian2d" && sampling) { + const baseAxis = coordSys.getBaseAxis(); + const valueAxis2 = coordSys.getOtherAxis(baseAxis); + const extent3 = baseAxis.getExtent(); + const dpr2 = api2.getDevicePixelRatio(); + const size = Math.abs(extent3[1] - extent3[0]) * (dpr2 || 1); + const rate = Math.round(count2 / size); + if (isFinite(rate) && rate > 1) { + if (sampling === "lttb") { + seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis2.dim), 1 / rate)); + } + let sampler; + if (isString(sampling)) { + sampler = samplers[sampling]; + } else if (isFunction(sampling)) { + sampler = sampling; + } + if (sampler) { + seriesModel.setData(data.downSample(data.mapDimension(valueAxis2.dim), 1 / rate, sampler, indexSampler)); + } + } + } + } + }; +} + +// src/chart/line/install.ts +function install3(registers) { + registers.registerChartView(LineView_default); + registers.registerSeriesModel(LineSeries_default); + registers.registerLayout(pointsLayout("line", true)); + registers.registerVisual({ + seriesType: "line", + reset: function(seriesModel) { + const data = seriesModel.getData(); + const lineStyle = seriesModel.getModel("lineStyle").getLineStyle(); + if (lineStyle && !lineStyle.stroke) { + lineStyle.stroke = data.getVisual("style").fill; + } + data.setVisual("legendLineStyle", lineStyle); + } + }); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample("line")); +} + +// src/chart/bar/BaseBarSeries.ts +var BaseBarSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = BaseBarSeriesModel2.type; + } + getInitialData(option, ecModel) { + return createSeriesData_default(null, this, {useEncodeDefaulter: true}); + } + getMarkerPosition(value, dims, startingAtTick) { + const coordSys = this.coordinateSystem; + if (coordSys && coordSys.clampData) { + const clampData = coordSys.clampData(value); + const pt = coordSys.dataToPoint(clampData); + if (startingAtTick) { + each(coordSys.getAxes(), function(axis, idx) { + if (axis.type === "category" && dims != null) { + const tickCoords = axis.getTicksCoords(); + const alignTicksWithLabel = axis.getTickModel().get("alignWithLabel"); + let targetTickId = clampData[idx]; + const isEnd = dims[idx] === "x1" || dims[idx] === "y1"; + if (isEnd && !alignTicksWithLabel) { + targetTickId += 1; + } + if (tickCoords.length < 2) { + return; + } else if (tickCoords.length === 2) { + pt[idx] = axis.toGlobalCoord(axis.getExtent()[isEnd ? 1 : 0]); + return; + } + let leftCoord; + let coord; + let stepTickValue = 1; + for (let i = 0; i < tickCoords.length; i++) { + const tickCoord = tickCoords[i].coord; + const tickValue = i === tickCoords.length - 1 ? tickCoords[i - 1].tickValue + stepTickValue : tickCoords[i].tickValue; + if (tickValue === targetTickId) { + coord = tickCoord; + break; + } else if (tickValue < targetTickId) { + leftCoord = tickCoord; + } else if (leftCoord != null && tickValue > targetTickId) { + coord = (tickCoord + leftCoord) / 2; + break; + } + if (i === 1) { + stepTickValue = tickValue - tickCoords[0].tickValue; + } + } + if (coord == null) { + if (!leftCoord) { + coord = tickCoords[0].coord; + } else if (leftCoord) { + coord = tickCoords[tickCoords.length - 1].coord; + } + } + pt[idx] = axis.toGlobalCoord(coord); } }); - return calendarList; - }; - Calendar.dimensions = ['time', 'value']; - return Calendar; - }(); - function getCoordSys$4(finder) { - var calendarModel = finder.calendarModel; - var seriesModel = finder.seriesModel; - var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null; - return coordSys; - } - - function install$w(registers) { - registers.registerComponentModel(CalendarModel); - registers.registerComponentView(CalendarView); - registers.registerCoordinateSystem('calendar', Calendar); - } - - function setKeyInfoToNewElOption(resultItem, newElOption) { - var existElOption = resultItem.existing; - // Set id and type after id assigned. - newElOption.id = resultItem.keyInfo.id; - !newElOption.type && existElOption && (newElOption.type = existElOption.type); - // Set parent id if not specified - if (newElOption.parentId == null) { - var newElParentOption = newElOption.parentOption; - if (newElParentOption) { - newElOption.parentId = newElParentOption.id; - } else if (existElOption) { - newElOption.parentId = existElOption.parentId; - } - } - // Clear - newElOption.parentOption = null; - } - function isSetLoc(obj, props) { - var isSet; - each(props, function (prop) { - obj[prop] != null && obj[prop] !== 'auto' && (isSet = true); + } else { + const data = this.getData(); + const offset = data.getLayout("offset"); + const size = data.getLayout("size"); + const offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1; + pt[offsetIndex] += offset + size / 2; + } + return pt; + } + return [NaN, NaN]; + } +}; +var BaseBarSeriesModel = BaseBarSeriesModel2; +BaseBarSeriesModel.type = "series.__base_bar__"; +BaseBarSeriesModel.defaultOption = { + z: 2, + coordinateSystem: "cartesian2d", + legendHoverLink: true, + barMinHeight: 0, + barMinAngle: 0, + large: false, + largeThreshold: 400, + progressive: 3e3, + progressiveChunkMode: "mod" +}; +Series_default.registerClass(BaseBarSeriesModel); +var BaseBarSeries_default = BaseBarSeriesModel; + +// src/chart/bar/BarSeries.ts +var BarSeriesModel2 = class extends BaseBarSeries_default { + constructor() { + super(...arguments); + this.type = BarSeriesModel2.type; + } + getInitialData() { + return createSeriesData_default(null, this, { + useEncodeDefaulter: true, + createInvertedIndices: !!this.get("realtimeSort", true) || null + }); + } + getProgressive() { + return this.get("large") ? this.get("progressive") : false; + } + getProgressiveThreshold() { + let progressiveThreshold = this.get("progressiveThreshold"); + const largeThreshold = this.get("largeThreshold"); + if (largeThreshold > progressiveThreshold) { + progressiveThreshold = largeThreshold; + } + return progressiveThreshold; + } + brushSelector(dataIndex, data, selectors) { + return selectors.rect(data.getItemLayout(dataIndex)); + } +}; +var BarSeriesModel = BarSeriesModel2; +BarSeriesModel.type = "series.bar"; +BarSeriesModel.dependencies = ["grid", "polar"]; +BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeries_default.defaultOption, { + clip: true, + roundCap: false, + showBackground: false, + backgroundStyle: { + color: "rgba(180, 180, 180, 0.2)", + borderColor: null, + borderWidth: 0, + borderType: "solid", + borderRadius: 0, + shadowBlur: 0, + shadowColor: null, + shadowOffsetX: 0, + shadowOffsetY: 0, + opacity: 1 + }, + select: { + itemStyle: { + borderColor: "#212121" + } + }, + realtimeSort: false +}); +var BarSeries_default = BarSeriesModel; + +// src/util/shape/sausage.ts +var SausageShape = class { + constructor() { + this.cx = 0; + this.cy = 0; + this.r0 = 0; + this.r = 0; + this.startAngle = 0; + this.endAngle = Math.PI * 2; + this.clockwise = true; + } +}; +var SausagePath = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "sausage"; + } + getDefaultShape() { + return new SausageShape(); + } + buildPath(ctx, shape) { + const cx = shape.cx; + const cy = shape.cy; + const r0 = Math.max(shape.r0 || 0, 0); + const r = Math.max(shape.r, 0); + const dr = (r - r0) * 0.5; + const rCenter = r0 + dr; + let startAngle = shape.startAngle; + const endAngle = shape.endAngle; + const clockwise = shape.clockwise; + const PI210 = Math.PI * 2; + const lessThanCircle = clockwise ? endAngle - startAngle < PI210 : startAngle - endAngle < PI210; + if (!lessThanCircle) { + startAngle = endAngle - (clockwise ? PI210 : -PI210); + } + const unitStartX = Math.cos(startAngle); + const unitStartY = Math.sin(startAngle); + const unitEndX = Math.cos(endAngle); + const unitEndY = Math.sin(endAngle); + if (lessThanCircle) { + ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy); + ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise); + } else { + ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy); + } + ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise); + ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise); + if (r0 !== 0) { + ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise); + } + } +}; +var sausage_default = SausagePath; + +// src/label/sectorLabel.ts +function createSectorCalculateTextPosition(positionMapping, opts) { + opts = opts || {}; + const isRoundCap = opts.isRoundCap; + return function(out2, opts2, boundingRect) { + const textPosition = opts2.position; + if (!textPosition || textPosition instanceof Array) { + return calculateTextPosition(out2, opts2, boundingRect); + } + const mappedSectorPosition = positionMapping(textPosition); + const distance2 = opts2.distance != null ? opts2.distance : 5; + const sector = this.shape; + const cx = sector.cx; + const cy = sector.cy; + const r = sector.r; + const r0 = sector.r0; + const middleR = (r + r0) / 2; + const startAngle = sector.startAngle; + const endAngle = sector.endAngle; + const middleAngle = (startAngle + endAngle) / 2; + const extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0; + const mathCos6 = Math.cos; + const mathSin6 = Math.sin; + let x = cx + r * mathCos6(startAngle); + let y = cy + r * mathSin6(startAngle); + let textAlign = "left"; + let textVerticalAlign = "top"; + switch (mappedSectorPosition) { + case "startArc": + x = cx + (r0 - distance2) * mathCos6(middleAngle); + y = cy + (r0 - distance2) * mathSin6(middleAngle); + textAlign = "center"; + textVerticalAlign = "top"; + break; + case "insideStartArc": + x = cx + (r0 + distance2) * mathCos6(middleAngle); + y = cy + (r0 + distance2) * mathSin6(middleAngle); + textAlign = "center"; + textVerticalAlign = "bottom"; + break; + case "startAngle": + x = cx + middleR * mathCos6(startAngle) + adjustAngleDistanceX(startAngle, distance2 + extraDist, false); + y = cy + middleR * mathSin6(startAngle) + adjustAngleDistanceY(startAngle, distance2 + extraDist, false); + textAlign = "right"; + textVerticalAlign = "middle"; + break; + case "insideStartAngle": + x = cx + middleR * mathCos6(startAngle) + adjustAngleDistanceX(startAngle, -distance2 + extraDist, false); + y = cy + middleR * mathSin6(startAngle) + adjustAngleDistanceY(startAngle, -distance2 + extraDist, false); + textAlign = "left"; + textVerticalAlign = "middle"; + break; + case "middle": + x = cx + middleR * mathCos6(middleAngle); + y = cy + middleR * mathSin6(middleAngle); + textAlign = "center"; + textVerticalAlign = "middle"; + break; + case "endArc": + x = cx + (r + distance2) * mathCos6(middleAngle); + y = cy + (r + distance2) * mathSin6(middleAngle); + textAlign = "center"; + textVerticalAlign = "bottom"; + break; + case "insideEndArc": + x = cx + (r - distance2) * mathCos6(middleAngle); + y = cy + (r - distance2) * mathSin6(middleAngle); + textAlign = "center"; + textVerticalAlign = "top"; + break; + case "endAngle": + x = cx + middleR * mathCos6(endAngle) + adjustAngleDistanceX(endAngle, distance2 + extraDist, true); + y = cy + middleR * mathSin6(endAngle) + adjustAngleDistanceY(endAngle, distance2 + extraDist, true); + textAlign = "left"; + textVerticalAlign = "middle"; + break; + case "insideEndAngle": + x = cx + middleR * mathCos6(endAngle) + adjustAngleDistanceX(endAngle, -distance2 + extraDist, true); + y = cy + middleR * mathSin6(endAngle) + adjustAngleDistanceY(endAngle, -distance2 + extraDist, true); + textAlign = "right"; + textVerticalAlign = "middle"; + break; + default: + return calculateTextPosition(out2, opts2, boundingRect); + } + out2 = out2 || {}; + out2.x = x; + out2.y = y; + out2.align = textAlign; + out2.verticalAlign = textVerticalAlign; + return out2; + }; +} +function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) { + if (isNumber(rotateType)) { + sector.setTextConfig({ + rotation: rotateType + }); + return; + } else if (isArray(textPosition)) { + sector.setTextConfig({ + rotation: 0 + }); + return; + } + const shape = sector.shape; + const startAngle = shape.clockwise ? shape.startAngle : shape.endAngle; + const endAngle = shape.clockwise ? shape.endAngle : shape.startAngle; + const middleAngle = (startAngle + endAngle) / 2; + let anchorAngle; + const mappedSectorPosition = positionMapping(textPosition); + switch (mappedSectorPosition) { + case "startArc": + case "insideStartArc": + case "middle": + case "insideEndArc": + case "endArc": + anchorAngle = middleAngle; + break; + case "startAngle": + case "insideStartAngle": + anchorAngle = startAngle; + break; + case "endAngle": + case "insideEndAngle": + anchorAngle = endAngle; + break; + default: + sector.setTextConfig({ + rotation: 0 }); - return isSet; - } - function mergeNewElOptionToExist(existList, index, newElOption) { - // Update existing options, for `getOption` feature. - var newElOptCopy = extend({}, newElOption); - var existElOption = existList[index]; - var $action = newElOption.$action || 'merge'; - if ($action === 'merge') { - if (existElOption) { - if ("development" !== 'production') { - var newType = newElOption.type; - assert(!newType || existElOption.type === newType, 'Please set $action: "replace" to change `type`'); + return; + } + let rotate2 = Math.PI * 1.5 - anchorAngle; + if (mappedSectorPosition === "middle" && rotate2 > Math.PI / 2 && rotate2 < Math.PI * 1.5) { + rotate2 -= Math.PI; + } + sector.setTextConfig({ + rotation: rotate2 + }); +} +function adjustAngleDistanceX(angle, distance2, isEnd) { + return distance2 * Math.sin(angle) * (isEnd ? -1 : 1); +} +function adjustAngleDistanceY(angle, distance2, isEnd) { + return distance2 * Math.cos(angle) * (isEnd ? 1 : -1); +} + +// src/chart/helper/sectorHelper.ts +function getSectorCornerRadius(model, shape, zeroIfNull) { + let cornerRadius = model.get("borderRadius"); + if (cornerRadius == null) { + return zeroIfNull ? {cornerRadius: 0} : null; + } + if (!isArray(cornerRadius)) { + cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius]; + } + const dr = Math.abs(shape.r || 0 - shape.r0 || 0); + return { + cornerRadius: map(cornerRadius, (cr) => parsePercent(cr, dr)) + }; +} + +// src/chart/bar/BarView.ts +var mathMax7 = Math.max; +var mathMin7 = Math.min; +function getClipArea(coord, data) { + const coordSysClipArea = coord.getArea && coord.getArea(); + if (isCoordinateSystemType(coord, "cartesian2d")) { + const baseAxis = coord.getBaseAxis(); + if (baseAxis.type !== "category" || !baseAxis.onBand) { + const expandWidth = data.getLayout("bandWidth"); + if (baseAxis.isHorizontal()) { + coordSysClipArea.x -= expandWidth; + coordSysClipArea.width += expandWidth * 2; + } else { + coordSysClipArea.y -= expandWidth; + coordSysClipArea.height += expandWidth * 2; + } + } + } + return coordSysClipArea; +} +var BarView2 = class extends Chart_default { + constructor() { + super(); + this.type = BarView2.type; + this._isFirstFrame = true; + } + render(seriesModel, ecModel, api2, payload) { + this._model = seriesModel; + this._removeOnRenderedListener(api2); + this._updateDrawMode(seriesModel); + const coordinateSystemType = seriesModel.get("coordinateSystem"); + if (coordinateSystemType === "cartesian2d" || coordinateSystemType === "polar") { + this._progressiveEls = null; + this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api2) : this._renderNormal(seriesModel, ecModel, api2, payload); + } else if (true) { + warn("Only cartesian2d and polar supported for bar."); + } + } + incrementalPrepareRender(seriesModel) { + this._clear(); + this._updateDrawMode(seriesModel); + this._updateLargeClip(seriesModel); + } + incrementalRender(params, seriesModel) { + this._progressiveEls = []; + this._incrementalRenderLarge(params, seriesModel); + } + eachRendered(cb) { + traverseElements(this._progressiveEls || this.group, cb); + } + _updateDrawMode(seriesModel) { + const isLargeDraw = seriesModel.pipelineContext.large; + if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { + this._isLargeDraw = isLargeDraw; + this._clear(); + } + } + _renderNormal(seriesModel, ecModel, api2, payload) { + const group = this.group; + const data = seriesModel.getData(); + const oldData = this._data; + const coord = seriesModel.coordinateSystem; + const baseAxis = coord.getBaseAxis(); + let isHorizontalOrRadial; + if (coord.type === "cartesian2d") { + isHorizontalOrRadial = baseAxis.isHorizontal(); + } else if (coord.type === "polar") { + isHorizontalOrRadial = baseAxis.dim === "angle"; + } + const animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null; + const realtimeSortCfg = shouldRealtimeSort(seriesModel, coord); + if (realtimeSortCfg) { + this._enableRealtimeSort(realtimeSortCfg, data, api2); + } + const needsClip = seriesModel.get("clip", true) || realtimeSortCfg; + const coordSysClipArea = getClipArea(coord, data); + group.removeClipPath(); + const roundCap = seriesModel.get("roundCap", true); + const drawBackground = seriesModel.get("showBackground", true); + const backgroundModel = seriesModel.getModel("backgroundStyle"); + const barBorderRadius = backgroundModel.get("borderRadius") || 0; + const bgEls = []; + const oldBgEls = this._backgroundEls; + const isInitSort = payload && payload.isInitSort; + const isChangeOrder = payload && payload.type === "changeAxisOrder"; + function createBackground(dataIndex) { + const bgLayout = getLayout[coord.type](data, dataIndex); + const bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout); + bgEl.useStyle(backgroundModel.getItemStyle()); + if (coord.type === "cartesian2d") { + bgEl.setShape("r", barBorderRadius); + } else { + bgEl.setShape("cornerRadius", barBorderRadius); + } + bgEls[dataIndex] = bgEl; + return bgEl; + } + ; + data.diff(oldData).add(function(dataIndex) { + const itemModel = data.getItemModel(dataIndex); + const layout18 = getLayout[coord.type](data, dataIndex, itemModel); + if (drawBackground) { + createBackground(dataIndex); + } + if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout18)) { + return; + } + let isClipped = false; + if (needsClip) { + isClipped = clip[coord.type](coordSysClipArea, layout18); + } + const el = elementCreator[coord.type](seriesModel, data, dataIndex, layout18, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap); + if (realtimeSortCfg) { + el.forceLabelAnimation = true; + } + updateStyle(el, data, dataIndex, itemModel, layout18, seriesModel, isHorizontalOrRadial, coord.type === "polar"); + if (isInitSort) { + el.attr({shape: layout18}); + } else if (realtimeSortCfg) { + updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout18, dataIndex, isHorizontalOrRadial, false, false); + } else { + initProps(el, {shape: layout18}, seriesModel, dataIndex); + } + data.setItemGraphicEl(dataIndex, el); + group.add(el); + el.ignore = isClipped; + }).update(function(newIndex, oldIndex) { + const itemModel = data.getItemModel(newIndex); + const layout18 = getLayout[coord.type](data, newIndex, itemModel); + if (drawBackground) { + let bgEl; + if (oldBgEls.length === 0) { + bgEl = createBackground(oldIndex); + } else { + bgEl = oldBgEls[oldIndex]; + bgEl.useStyle(backgroundModel.getItemStyle()); + if (coord.type === "cartesian2d") { + bgEl.setShape("r", barBorderRadius); + } else { + bgEl.setShape("cornerRadius", barBorderRadius); } - // We can ensure that newElOptCopy and existElOption are not - // the same object, so `merge` will not change newElOptCopy. - merge(existElOption, newElOptCopy, true); - // Rigid body, use ignoreSize. - mergeLayoutParam(existElOption, newElOptCopy, { - ignoreSize: true - }); - // Will be used in render. - copyLayoutParams(newElOption, existElOption); - // Copy transition info to new option so it can be used in the transition. - // DO IT AFTER merge - copyTransitionInfo(newElOption, existElOption); - copyTransitionInfo(newElOption, existElOption, 'shape'); - copyTransitionInfo(newElOption, existElOption, 'style'); - copyTransitionInfo(newElOption, existElOption, 'extra'); - // Copy clipPath - newElOption.clipPath = existElOption.clipPath; - } else { - existList[index] = newElOptCopy; + bgEls[newIndex] = bgEl; } - } else if ($action === 'replace') { - existList[index] = newElOptCopy; - } else if ($action === 'remove') { - // null will be cleaned later. - existElOption && (existList[index] = null); + const bgLayout = getLayout[coord.type](data, newIndex); + const shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord); + updateProps(bgEl, {shape}, animationModel, newIndex); } - } - var TRANSITION_PROPS_TO_COPY = ['transition', 'enterFrom', 'leaveTo']; - var ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(['enterAnimation', 'updateAnimation', 'leaveAnimation']); - function copyTransitionInfo(target, source, targetProp) { - if (targetProp) { - if (!target[targetProp] && source[targetProp]) { - // TODO avoid creating this empty object when there is no transition configuration. - target[targetProp] = {}; + let el = oldData.getItemGraphicEl(oldIndex); + if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout18)) { + group.remove(el); + return; + } + let isClipped = false; + if (needsClip) { + isClipped = clip[coord.type](coordSysClipArea, layout18); + if (isClipped) { + group.remove(el); } - target = target[targetProp]; - source = source[targetProp]; } - if (!target || !source) { - return; + if (!el) { + el = elementCreator[coord.type](seriesModel, data, newIndex, layout18, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap); + } else { + saveOldStyle(el); } - var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (target[prop] == null && source[prop] != null) { - target[prop] = source[prop]; + if (realtimeSortCfg) { + el.forceLabelAnimation = true; + } + if (isChangeOrder) { + const textEl = el.getTextContent(); + if (textEl) { + const labelInnerStore = labelInner(textEl); + if (labelInnerStore.prevValue != null) { + labelInnerStore.prevValue = labelInnerStore.value; + } } + } else { + updateStyle(el, data, newIndex, itemModel, layout18, seriesModel, isHorizontalOrRadial, coord.type === "polar"); + } + if (isInitSort) { + el.attr({shape: layout18}); + } else if (realtimeSortCfg) { + updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout18, newIndex, isHorizontalOrRadial, true, isChangeOrder); + } else { + updateProps(el, { + shape: layout18 + }, seriesModel, newIndex, null); + } + data.setItemGraphicEl(newIndex, el); + el.ignore = isClipped; + group.add(el); + }).remove(function(dataIndex) { + const el = oldData.getItemGraphicEl(dataIndex); + el && removeElementWithFadeOut(el, seriesModel, dataIndex); + }).execute(); + const bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group_default()); + bgGroup.removeAll(); + for (let i = 0; i < bgEls.length; ++i) { + bgGroup.add(bgEls[i]); + } + group.add(bgGroup); + this._backgroundEls = bgEls; + this._data = data; + } + _renderLarge(seriesModel, ecModel, api2) { + this._clear(); + createLarge(seriesModel, this.group); + this._updateLargeClip(seriesModel); + } + _incrementalRenderLarge(params, seriesModel) { + this._removeBackground(); + createLarge(seriesModel, this.group, this._progressiveEls, true); + } + _updateLargeClip(seriesModel) { + const clipPath = seriesModel.get("clip", true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); + const group = this.group; + if (clipPath) { + group.setClipPath(clipPath); + } else { + group.removeClipPath(); + } + } + _enableRealtimeSort(realtimeSortCfg, data, api2) { + if (!data.count()) { + return; + } + const baseAxis = realtimeSortCfg.baseAxis; + if (this._isFirstFrame) { + this._dispatchInitSort(data, realtimeSortCfg, api2); + this._isFirstFrame = false; + } else { + const orderMapping = (idx) => { + const el = data.getItemGraphicEl(idx); + const shape = el && el.shape; + return shape && Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width) || 0; + }; + this._onRendered = () => { + this._updateSortWithinSameData(data, orderMapping, baseAxis, api2); + }; + api2.getZr().on("rendered", this._onRendered); + } + } + _dataSort(data, baseAxis, orderMapping) { + const info = []; + data.each(data.mapDimension(baseAxis.dim), (ordinalNumber, dataIdx) => { + let mappedValue = orderMapping(dataIdx); + mappedValue = mappedValue == null ? NaN : mappedValue; + info.push({ + dataIndex: dataIdx, + mappedValue, + ordinalNumber + }); + }); + info.sort((a, b) => { + return b.mappedValue - a.mappedValue; + }); + return { + ordinalNumbers: map(info, (item) => item.ordinalNumber) + }; + } + _isOrderChangedWithinSameData(data, orderMapping, baseAxis) { + const scale4 = baseAxis.scale; + const ordinalDataDim = data.mapDimension(baseAxis.dim); + let lastValue = Number.MAX_VALUE; + for (let tickNum = 0, len2 = scale4.getOrdinalMeta().categories.length; tickNum < len2; ++tickNum) { + const rawIdx = data.rawIndexOf(ordinalDataDim, scale4.getRawOrdinalNumber(tickNum)); + const value = rawIdx < 0 ? Number.MIN_VALUE : orderMapping(data.indexOfRawIndex(rawIdx)); + if (value > lastValue) { + return true; + } + lastValue = value; + } + return false; + } + _isOrderDifferentInView(orderInfo, baseAxis) { + const scale4 = baseAxis.scale; + const extent3 = scale4.getExtent(); + let tickNum = Math.max(0, extent3[0]); + const tickMax = Math.min(extent3[1], scale4.getOrdinalMeta().categories.length - 1); + for (; tickNum <= tickMax; ++tickNum) { + if (orderInfo.ordinalNumbers[tickNum] !== scale4.getRawOrdinalNumber(tickNum)) { + return true; } } - function setLayoutInfoToExist(existItem, newElOption) { - if (!existItem) { - return; + } + _updateSortWithinSameData(data, orderMapping, baseAxis, api2) { + if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) { + return; + } + const sortInfo = this._dataSort(data, baseAxis, orderMapping); + if (this._isOrderDifferentInView(sortInfo, baseAxis)) { + this._removeOnRenderedListener(api2); + api2.dispatchAction({ + type: "changeAxisOrder", + componentType: baseAxis.dim + "Axis", + axisId: baseAxis.index, + sortInfo + }); + } + } + _dispatchInitSort(data, realtimeSortCfg, api2) { + const baseAxis = realtimeSortCfg.baseAxis; + const sortResult = this._dataSort(data, baseAxis, (dataIdx) => data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx)); + api2.dispatchAction({ + type: "changeAxisOrder", + componentType: baseAxis.dim + "Axis", + isInitSort: true, + axisId: baseAxis.index, + sortInfo: sortResult + }); + } + remove(ecModel, api2) { + this._clear(this._model); + this._removeOnRenderedListener(api2); + } + dispose(ecModel, api2) { + this._removeOnRenderedListener(api2); + } + _removeOnRenderedListener(api2) { + if (this._onRendered) { + api2.getZr().off("rendered", this._onRendered); + this._onRendered = null; + } + } + _clear(model) { + const group = this.group; + const data = this._data; + if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) { + this._removeBackground(); + this._backgroundEls = []; + data.eachItemGraphicEl(function(el) { + removeElementWithFadeOut(el, model, getECData(el).dataIndex); + }); + } else { + group.removeAll(); + } + this._data = null; + this._isFirstFrame = true; + } + _removeBackground() { + this.group.remove(this._backgroundGroup); + this._backgroundGroup = null; + } +}; +var BarView = BarView2; +BarView.type = "bar"; +var clip = { + cartesian2d(coordSysBoundingRect, layout18) { + const signWidth = layout18.width < 0 ? -1 : 1; + const signHeight = layout18.height < 0 ? -1 : 1; + if (signWidth < 0) { + layout18.x += layout18.width; + layout18.width = -layout18.width; + } + if (signHeight < 0) { + layout18.y += layout18.height; + layout18.height = -layout18.height; + } + const coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width; + const coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height; + const x = mathMax7(layout18.x, coordSysBoundingRect.x); + const x2 = mathMin7(layout18.x + layout18.width, coordSysX2); + const y = mathMax7(layout18.y, coordSysBoundingRect.y); + const y2 = mathMin7(layout18.y + layout18.height, coordSysY2); + const xClipped = x2 < x; + const yClipped = y2 < y; + layout18.x = xClipped && x > coordSysX2 ? x2 : x; + layout18.y = yClipped && y > coordSysY2 ? y2 : y; + layout18.width = xClipped ? 0 : x2 - x; + layout18.height = yClipped ? 0 : y2 - y; + if (signWidth < 0) { + layout18.x += layout18.width; + layout18.width = -layout18.width; + } + if (signHeight < 0) { + layout18.y += layout18.height; + layout18.height = -layout18.height; + } + return xClipped || yClipped; + }, + polar(coordSysClipArea, layout18) { + const signR = layout18.r0 <= layout18.r ? 1 : -1; + if (signR < 0) { + const tmp = layout18.r; + layout18.r = layout18.r0; + layout18.r0 = tmp; + } + const r = mathMin7(layout18.r, coordSysClipArea.r); + const r0 = mathMax7(layout18.r0, coordSysClipArea.r0); + layout18.r = r; + layout18.r0 = r0; + const clipped = r - r0 < 0; + if (signR < 0) { + const tmp = layout18.r; + layout18.r = layout18.r0; + layout18.r0 = tmp; + } + return clipped; + } +}; +var elementCreator = { + cartesian2d(seriesModel, data, newIndex, layout18, isHorizontal, animationModel, axisModel, isUpdate, roundCap) { + const rect = new Rect_default({ + shape: extend({}, layout18), + z2: 1 + }); + rect.__dataIndex = newIndex; + rect.name = "item"; + if (animationModel) { + const rectShape = rect.shape; + const animateProperty = isHorizontal ? "height" : "width"; + rectShape[animateProperty] = 0; + } + return rect; + }, + polar(seriesModel, data, newIndex, layout18, isRadial, animationModel, axisModel, isUpdate, roundCap) { + const ShapeClass = !isRadial && roundCap ? sausage_default : Sector_default; + const sector = new ShapeClass({ + shape: layout18, + z2: 1 + }); + sector.name = "item"; + const positionMap = createPolarPositionMapping(isRadial); + sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, { + isRoundCap: ShapeClass === sausage_default + }); + if (animationModel) { + const sectorShape = sector.shape; + const animateProperty = isRadial ? "r" : "endAngle"; + const animateTarget = {}; + sectorShape[animateProperty] = isRadial ? layout18.r0 : layout18.startAngle; + animateTarget[animateProperty] = layout18[animateProperty]; + (isUpdate ? updateProps : initProps)(sector, { + shape: animateTarget + }, animationModel); + } + return sector; + } +}; +function shouldRealtimeSort(seriesModel, coordSys) { + const realtimeSortOption = seriesModel.get("realtimeSort", true); + const baseAxis = coordSys.getBaseAxis(); + if (true) { + if (realtimeSortOption) { + if (baseAxis.type !== "category") { + warn("`realtimeSort` will not work because this bar series is not based on a category axis."); + } + if (coordSys.type !== "cartesian2d") { + warn("`realtimeSort` will not work because this bar series is not on cartesian2d."); + } + } + } + if (realtimeSortOption && baseAxis.type === "category" && coordSys.type === "cartesian2d") { + return { + baseAxis, + otherAxis: coordSys.getOtherAxis(baseAxis) + }; + } +} +function updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout18, newIndex, isHorizontal, isUpdate, isChangeOrder) { + let seriesTarget; + let axisTarget; + if (isHorizontal) { + axisTarget = { + x: layout18.x, + width: layout18.width + }; + seriesTarget = { + y: layout18.y, + height: layout18.height + }; + } else { + axisTarget = { + y: layout18.y, + height: layout18.height + }; + seriesTarget = { + x: layout18.x, + width: layout18.width + }; + } + if (!isChangeOrder) { + (isUpdate ? updateProps : initProps)(el, { + shape: seriesTarget + }, seriesAnimationModel, newIndex, null); + } + const axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null; + (isUpdate ? updateProps : initProps)(el, { + shape: axisTarget + }, axisAnimationModel, newIndex); +} +function checkPropertiesNotValid(obj, props) { + for (let i = 0; i < props.length; i++) { + if (!isFinite(obj[props[i]])) { + return true; + } + } + return false; +} +var rectPropties = ["x", "y", "width", "height"]; +var polarPropties = ["cx", "cy", "r", "startAngle", "endAngle"]; +var isValidLayout = { + cartesian2d(layout18) { + return !checkPropertiesNotValid(layout18, rectPropties); + }, + polar(layout18) { + return !checkPropertiesNotValid(layout18, polarPropties); + } +}; +var getLayout = { + cartesian2d(data, dataIndex, itemModel) { + const layout18 = data.getItemLayout(dataIndex); + const fixedLineWidth = itemModel ? getLineWidth(itemModel, layout18) : 0; + const signX = layout18.width > 0 ? 1 : -1; + const signY = layout18.height > 0 ? 1 : -1; + return { + x: layout18.x + signX * fixedLineWidth / 2, + y: layout18.y + signY * fixedLineWidth / 2, + width: layout18.width - signX * fixedLineWidth, + height: layout18.height - signY * fixedLineWidth + }; + }, + polar(data, dataIndex, itemModel) { + const layout18 = data.getItemLayout(dataIndex); + return { + cx: layout18.cx, + cy: layout18.cy, + r0: layout18.r0, + r: layout18.r, + startAngle: layout18.startAngle, + endAngle: layout18.endAngle, + clockwise: layout18.clockwise + }; + } +}; +function isZeroOnPolar(layout18) { + return layout18.startAngle != null && layout18.endAngle != null && layout18.startAngle === layout18.endAngle; +} +function createPolarPositionMapping(isRadial) { + return ((isRadial2) => { + const arcOrAngle = isRadial2 ? "Arc" : "Angle"; + return (position2) => { + switch (position2) { + case "start": + case "insideStart": + case "end": + case "insideEnd": + return position2 + arcOrAngle; + default: + return position2; } - existItem.hv = newElOption.hv = [ - // Rigid body, don't care about `width`. - isSetLoc(newElOption, ['left', 'right']), - // Rigid body, don't care about `height`. - isSetLoc(newElOption, ['top', 'bottom'])]; - // Give default group size. Otherwise layout error may occur. - if (existItem.type === 'group') { - var existingGroupOpt = existItem; - var newGroupOpt = newElOption; - existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0); - existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0); - } - } - var GraphicComponentModel = /** @class */function (_super) { - __extends(GraphicComponentModel, _super); - function GraphicComponentModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GraphicComponentModel.type; - _this.preventAutoZ = true; - return _this; - } - GraphicComponentModel.prototype.mergeOption = function (option, ecModel) { - // Prevent default merge to elements - var elements = this.option.elements; - this.option.elements = null; - _super.prototype.mergeOption.call(this, option, ecModel); - this.option.elements = elements; - }; - GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) { - var thisOption = this.option; - var newList = (isInit ? thisOption : newOption).elements; - var existList = thisOption.elements = isInit ? [] : thisOption.elements; - var flattenedList = []; - this._flatten(newList, flattenedList, null); - var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge'); - // Clear elOptionsToUpdate - var elOptionsToUpdate = this._elOptionsToUpdate = []; - each(mappingResult, function (resultItem, index) { - var newElOption = resultItem.newOption; - if ("development" !== 'production') { - assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition'); - } - if (!newElOption) { - return; - } - elOptionsToUpdate.push(newElOption); - setKeyInfoToNewElOption(resultItem, newElOption); - mergeNewElOptionToExist(existList, index, newElOption); - setLayoutInfoToExist(existList[index], newElOption); - }, this); - // Clean - thisOption.elements = filter(existList, function (item) { - // $action should be volatile, otherwise option gotten from - // `getOption` will contain unexpected $action. - item && delete item.$action; - return item != null; - }); - }; - /** - * Convert - * [{ - * type: 'group', - * id: 'xx', - * children: [{type: 'circle'}, {type: 'polygon'}] - * }] - * to - * [ - * {type: 'group', id: 'xx'}, - * {type: 'circle', parentId: 'xx'}, - * {type: 'polygon', parentId: 'xx'} - * ] - */ - GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) { - each(optionList, function (option) { - if (!option) { - return; - } - if (parentOption) { - option.parentOption = parentOption; - } - result.push(option); - var children = option.children; - // here we don't judge if option.type is `group` - // when new option doesn't provide `type`, it will cause that the children can't be updated. - if (children && children.length) { - this._flatten(children, result, option); - } - // Deleting for JSON output, and for not affecting group creation. - delete option.children; - }, this); - }; - // FIXME - // Pass to view using payload? setOption has a payload? - GraphicComponentModel.prototype.useElOptionsToUpdate = function () { - var els = this._elOptionsToUpdate; - // Clear to avoid render duplicately when zooming. - this._elOptionsToUpdate = null; - return els; - }; - GraphicComponentModel.type = 'graphic'; - GraphicComponentModel.defaultOption = { - elements: [] - // parentId: null - }; - - return GraphicComponentModel; - }(ComponentModel); - - var nonShapeGraphicElements = { - // Reserved but not supported in graphic component. - path: null, - compoundPath: null, - // Supported in graphic component. - group: Group, - image: ZRImage, - text: ZRText }; - var inner$e = makeInner(); - // ------------------------ - // View - // ------------------------ - var GraphicComponentView = /** @class */function (_super) { - __extends(GraphicComponentView, _super); - function GraphicComponentView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GraphicComponentView.type; - return _this; - } - GraphicComponentView.prototype.init = function () { - this._elMap = createHashMap(); - }; - GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) { - // Having leveraged between use cases and algorithm complexity, a very - // simple layout mechanism is used: - // The size(width/height) can be determined by itself or its parent (not - // implemented yet), but can not by its children. (Top-down travel) - // The location(x/y) can be determined by the bounding rect of itself - // (can including its descendants or not) and the size of its parent. - // (Bottom-up travel) - // When `chart.clear()` or `chart.setOption({...}, true)` with the same id, - // view will be reused. - if (graphicModel !== this._lastGraphicModel) { - this._clear(); - } - this._lastGraphicModel = graphicModel; - this._updateElements(graphicModel); - this._relocate(graphicModel, api); - }; - /** - * Update graphic elements. - */ - GraphicComponentView.prototype._updateElements = function (graphicModel) { - var elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); - if (!elOptionsToUpdate) { - return; - } - var elMap = this._elMap; - var rootGroup = this.group; - var globalZ = graphicModel.get('z'); - var globalZLevel = graphicModel.get('zlevel'); - // Top-down tranverse to assign graphic settings to each elements. - each(elOptionsToUpdate, function (elOption) { - var id = convertOptionIdName(elOption.id, null); - var elExisting = id != null ? elMap.get(id) : null; - var parentId = convertOptionIdName(elOption.parentId, null); - var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; - var elType = elOption.type; - var elOptionStyle = elOption.style; - if (elType === 'text' && elOptionStyle) { - // In top/bottom mode, textVerticalAlign should not be used, which cause - // inaccurately locating. - if (elOption.hv && elOption.hv[1]) { - elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null; - } - } - var textContentOption = elOption.textContent; - var textConfig = elOption.textConfig; - if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) { - var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true); - if (!textConfig && convertResult.textConfig) { - textConfig = elOption.textConfig = convertResult.textConfig; - } - if (!textContentOption && convertResult.textContent) { - textContentOption = convertResult.textContent; - } - } - // Remove unnecessary props to avoid potential problems. - var elOptionCleaned = getCleanedElOption(elOption); - // For simple, do not support parent change, otherwise reorder is needed. - if ("development" !== 'production') { - elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.'); - } - var $action = elOption.$action || 'merge'; - var isMerge = $action === 'merge'; - var isReplace = $action === 'replace'; - if (isMerge) { - var isInit = !elExisting; - var el_1 = elExisting; - if (isInit) { - el_1 = createEl$1(id, targetElParent, elOption.type, elMap); + })(isRadial); +} +function updateStyle(el, data, dataIndex, itemModel, layout18, seriesModel, isHorizontalOrRadial, isPolar) { + const style = data.getItemVisual(dataIndex, "style"); + if (!isPolar) { + const borderRadius = itemModel.get(["itemStyle", "borderRadius"]) || 0; + el.setShape("r", borderRadius); + } else if (!seriesModel.get("roundCap")) { + const sectorShape = el.shape; + const cornerRadius = getSectorCornerRadius(itemModel.getModel("itemStyle"), sectorShape, true); + extend(sectorShape, cornerRadius); + el.setShape(sectorShape); + } + el.useStyle(style); + const cursorStyle = itemModel.getShallow("cursor"); + cursorStyle && el.attr("cursor", cursorStyle); + const labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout18.r >= layout18.r0 ? "endArc" : "startArc" : layout18.endAngle >= layout18.startAngle ? "endAngle" : "startAngle" : isHorizontalOrRadial ? layout18.height >= 0 ? "bottom" : "top" : layout18.width >= 0 ? "right" : "left"; + const labelStatesModels = getLabelStatesModels(itemModel); + setLabelStyle(el, labelStatesModels, { + labelFetcher: seriesModel, + labelDataIndex: dataIndex, + defaultText: getDefaultLabel(seriesModel.getData(), dataIndex), + inheritColor: style.fill, + defaultOpacity: style.opacity, + defaultOutsidePosition: labelPositionOutside + }); + const label = el.getTextContent(); + if (isPolar && label) { + const position2 = itemModel.get(["label", "position"]); + el.textConfig.inside = position2 === "middle" ? true : null; + setSectorTextRotation(el, position2 === "outside" ? labelPositionOutside : position2, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(["label", "rotate"])); + } + setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), (value) => getDefaultInterpolatedLabel(data, value)); + const emphasisModel = itemModel.getModel(["emphasis"]); + toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + setStatesStylesFromModel(el, itemModel); + if (isZeroOnPolar(layout18)) { + el.style.fill = "none"; + el.style.stroke = "none"; + each(el.states, (state) => { + if (state.style) { + state.style.fill = state.style.stroke = "none"; + } + }); + } +} +function getLineWidth(itemModel, rawLayout) { + const borderColor = itemModel.get(["itemStyle", "borderColor"]); + if (!borderColor || borderColor === "none") { + return 0; + } + const lineWidth = itemModel.get(["itemStyle", "borderWidth"]) || 0; + const width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width); + const height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height); + return Math.min(lineWidth, width, height); +} +var LagePathShape = class { +}; +var LargePath = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "largeBar"; + } + getDefaultShape() { + return new LagePathShape(); + } + buildPath(ctx, shape) { + const points4 = shape.points; + const baseDimIdx = this.baseDimIdx; + const valueDimIdx = 1 - this.baseDimIdx; + const startPoint = []; + const size = []; + const barWidth = this.barWidth; + for (let i = 0; i < points4.length; i += 3) { + size[baseDimIdx] = barWidth; + size[valueDimIdx] = points4[i + 2]; + startPoint[baseDimIdx] = points4[i + baseDimIdx]; + startPoint[valueDimIdx] = points4[i + valueDimIdx]; + ctx.rect(startPoint[0], startPoint[1], size[0], size[1]); + } + } +}; +function createLarge(seriesModel, group, progressiveEls, incremental) { + const data = seriesModel.getData(); + const baseDimIdx = data.getLayout("valueAxisHorizontal") ? 1 : 0; + const largeDataIndices = data.getLayout("largeDataIndices"); + const barWidth = data.getLayout("size"); + const backgroundModel = seriesModel.getModel("backgroundStyle"); + const bgPoints = data.getLayout("largeBackgroundPoints"); + if (bgPoints) { + const bgEl = new LargePath({ + shape: { + points: bgPoints + }, + incremental: !!incremental, + silent: true, + z2: 0 + }); + bgEl.baseDimIdx = baseDimIdx; + bgEl.largeDataIndices = largeDataIndices; + bgEl.barWidth = barWidth; + bgEl.useStyle(backgroundModel.getItemStyle()); + group.add(bgEl); + progressiveEls && progressiveEls.push(bgEl); + } + const el = new LargePath({ + shape: {points: data.getLayout("largePoints")}, + incremental: !!incremental, + ignoreCoarsePointer: true, + z2: 1 + }); + el.baseDimIdx = baseDimIdx; + el.largeDataIndices = largeDataIndices; + el.barWidth = barWidth; + group.add(el); + el.useStyle(data.getVisual("style")); + getECData(el).seriesIndex = seriesModel.seriesIndex; + if (!seriesModel.get("silent")) { + el.on("mousedown", largePathUpdateDataIndex); + el.on("mousemove", largePathUpdateDataIndex); + } + progressiveEls && progressiveEls.push(el); +} +var largePathUpdateDataIndex = throttle(function(event) { + const largePath = this; + const dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY); + getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null; +}, 30, false); +function largePathFindDataIndex(largePath, x, y) { + const baseDimIdx = largePath.baseDimIdx; + const valueDimIdx = 1 - baseDimIdx; + const points4 = largePath.shape.points; + const largeDataIndices = largePath.largeDataIndices; + const startPoint = []; + const size = []; + const barWidth = largePath.barWidth; + for (let i = 0, len2 = points4.length / 3; i < len2; i++) { + const ii = i * 3; + size[baseDimIdx] = barWidth; + size[valueDimIdx] = points4[ii + 2]; + startPoint[baseDimIdx] = points4[ii + baseDimIdx]; + startPoint[valueDimIdx] = points4[ii + valueDimIdx]; + if (size[valueDimIdx] < 0) { + startPoint[valueDimIdx] += size[valueDimIdx]; + size[valueDimIdx] = -size[valueDimIdx]; + } + if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) { + return largeDataIndices[i]; + } + } + return -1; +} +function createBackgroundShape(isHorizontalOrRadial, layout18, coord) { + if (isCoordinateSystemType(coord, "cartesian2d")) { + const rectShape = layout18; + const coordLayout = coord.getArea(); + return { + x: isHorizontalOrRadial ? rectShape.x : coordLayout.x, + y: isHorizontalOrRadial ? coordLayout.y : rectShape.y, + width: isHorizontalOrRadial ? rectShape.width : coordLayout.width, + height: isHorizontalOrRadial ? coordLayout.height : rectShape.height + }; + } else { + const coordLayout = coord.getArea(); + const sectorShape = layout18; + return { + cx: coordLayout.cx, + cy: coordLayout.cy, + r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0, + r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r, + startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0, + endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2 + }; + } +} +function createBackgroundEl(coord, isHorizontalOrRadial, layout18) { + const ElementClz = coord.type === "polar" ? Sector_default : Rect_default; + return new ElementClz({ + shape: createBackgroundShape(isHorizontalOrRadial, layout18, coord), + silent: true, + z2: 0 + }); +} +var BarView_default = BarView; + +// src/chart/bar/install.ts +function install4(registers) { + registers.registerChartView(BarView_default); + registers.registerSeriesModel(BarSeries_default); + registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout2, "bar")); + registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout("bar")); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample("bar")); + registers.registerAction({ + type: "changeAxisOrder", + event: "changeAxisOrder", + update: "update" + }, function(payload, ecModel) { + const componentType = payload.componentType || "series"; + ecModel.eachComponent({mainType: componentType, query: payload}, function(componentModel) { + if (payload.sortInfo) { + componentModel.axis.setCategorySortInfo(payload.sortInfo); + } + }); + }); +} + +// src/chart/pie/pieLayout.ts +var PI29 = Math.PI * 2; +var RADIAN = Math.PI / 180; +function getViewRect(seriesModel, api2) { + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api2.getWidth(), + height: api2.getHeight() + }); +} +function getBasicPieLayout(seriesModel, api2) { + const viewRect2 = getViewRect(seriesModel, api2); + let center3 = seriesModel.get("center"); + let radius = seriesModel.get("radius"); + if (!isArray(radius)) { + radius = [0, radius]; + } + const width = parsePercent2(viewRect2.width, api2.getWidth()); + const height = parsePercent2(viewRect2.height, api2.getHeight()); + const size = Math.min(width, height); + const r0 = parsePercent2(radius[0], size / 2); + const r = parsePercent2(radius[1], size / 2); + let cx; + let cy; + const coordSys = seriesModel.coordinateSystem; + if (coordSys) { + const point = coordSys.dataToPoint(center3); + cx = point[0] || 0; + cy = point[1] || 0; + } else { + if (!isArray(center3)) { + center3 = [center3, center3]; + } + cx = parsePercent2(center3[0], width) + viewRect2.x; + cy = parsePercent2(center3[1], height) + viewRect2.y; + } + return { + cx, + cy, + r0, + r + }; +} +function pieLayout(seriesType2, ecModel, api2) { + ecModel.eachSeriesByType(seriesType2, function(seriesModel) { + const data = seriesModel.getData(); + const valueDim = data.mapDimension("value"); + const viewRect2 = getViewRect(seriesModel, api2); + const {cx, cy, r, r0} = getBasicPieLayout(seriesModel, api2); + let startAngle = -seriesModel.get("startAngle") * RADIAN; + let endAngle = seriesModel.get("endAngle"); + const padAngle = seriesModel.get("padAngle") * RADIAN; + endAngle = endAngle === "auto" ? startAngle - PI29 : -endAngle * RADIAN; + const minAngle = seriesModel.get("minAngle") * RADIAN; + const minAndPadAngle = minAngle + padAngle; + let validDataCount = 0; + data.each(valueDim, function(value) { + !isNaN(value) && validDataCount++; + }); + const sum2 = data.getSum(valueDim); + let unitRadian = Math.PI / (sum2 || validDataCount) * 2; + const clockwise = seriesModel.get("clockwise"); + const roseType = seriesModel.get("roseType"); + const stillShowZeroSum = seriesModel.get("stillShowZeroSum"); + const extent3 = data.getDataExtent(valueDim); + extent3[0] = 0; + const dir3 = clockwise ? 1 : -1; + const angles = [startAngle, endAngle]; + const halfPadAngle = dir3 * padAngle / 2; + normalizeArcAngles(angles, !clockwise); + [startAngle, endAngle] = angles; + const layoutData = getSeriesLayoutData(seriesModel); + layoutData.startAngle = startAngle; + layoutData.endAngle = endAngle; + layoutData.clockwise = clockwise; + const angleRange = Math.abs(endAngle - startAngle); + let restAngle = angleRange; + let valueSumLargerThanMinAngle = 0; + let currentAngle = startAngle; + data.setLayout({viewRect: viewRect2, r}); + data.each(valueDim, function(value, idx) { + let angle; + if (isNaN(value)) { + data.setItemLayout(idx, { + angle: NaN, + startAngle: NaN, + endAngle: NaN, + clockwise, + cx, + cy, + r0, + r: roseType ? NaN : r + }); + return; + } + if (roseType !== "area") { + angle = sum2 === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; + } else { + angle = angleRange / validDataCount; + } + if (angle < minAndPadAngle) { + angle = minAndPadAngle; + restAngle -= minAndPadAngle; + } else { + valueSumLargerThanMinAngle += value; + } + const endAngle2 = currentAngle + dir3 * angle; + let actualStartAngle = 0; + let actualEndAngle = 0; + if (padAngle > angle) { + actualStartAngle = currentAngle + dir3 * angle / 2; + actualEndAngle = actualStartAngle; + } else { + actualStartAngle = currentAngle + halfPadAngle; + actualEndAngle = endAngle2 - halfPadAngle; + } + data.setItemLayout(idx, { + angle, + startAngle: actualStartAngle, + endAngle: actualEndAngle, + clockwise, + cx, + cy, + r0, + r: roseType ? linearMap(value, extent3, [r0, r]) : r + }); + currentAngle = endAngle2; + }); + if (restAngle < PI29 && validDataCount) { + if (restAngle <= 1e-3) { + const angle = angleRange / validDataCount; + data.each(valueDim, function(value, idx) { + if (!isNaN(value)) { + const layout18 = data.getItemLayout(idx); + layout18.angle = angle; + let actualStartAngle = 0; + let actualEndAngle = 0; + if (angle < padAngle) { + actualStartAngle = startAngle + dir3 * (idx + 1 / 2) * angle; + actualEndAngle = actualStartAngle; } else { - el_1 && (inner$e(el_1).isNew = false); - // Stop and restore before update any other attributes. - stopPreviousKeyframeAnimationAndRestore(el_1); - } - if (el_1) { - applyUpdateTransition(el_1, elOptionCleaned, graphicModel, { - isInit: isInit - }); - updateCommonAttrs(el_1, elOption, globalZ, globalZLevel); - } - } else if (isReplace) { - removeEl(elExisting, elOption, elMap, graphicModel); - var el_2 = createEl$1(id, targetElParent, elOption.type, elMap); - if (el_2) { - applyUpdateTransition(el_2, elOptionCleaned, graphicModel, { - isInit: true - }); - updateCommonAttrs(el_2, elOption, globalZ, globalZLevel); - } - } else if ($action === 'remove') { - updateLeaveTo(elExisting, elOption); - removeEl(elExisting, elOption, elMap, graphicModel); - } - var el = elMap.get(id); - if (el && textContentOption) { - if (isMerge) { - var textContentExisting = el.getTextContent(); - textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new ZRText(textContentOption)); - } else if (isReplace) { - el.setTextContent(new ZRText(textContentOption)); - } - } - if (el) { - var clipPathOption = elOption.clipPath; - if (clipPathOption) { - var clipPathType = clipPathOption.type; - var clipPath = void 0; - var isInit = false; - if (isMerge) { - var oldClipPath = el.getClipPath(); - isInit = !oldClipPath || inner$e(oldClipPath).type !== clipPathType; - clipPath = isInit ? newEl(clipPathType) : oldClipPath; - } else if (isReplace) { - isInit = true; - clipPath = newEl(clipPathType); - } - el.setClipPath(clipPath); - applyUpdateTransition(clipPath, clipPathOption, graphicModel, { - isInit: isInit - }); - applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel); + actualStartAngle = startAngle + dir3 * idx * angle + halfPadAngle; + actualEndAngle = startAngle + dir3 * (idx + 1) * angle - halfPadAngle; } - var elInner = inner$e(el); - el.setTextConfig(textConfig); - elInner.option = elOption; - setEventData(el, graphicModel, elOption); - setTooltipConfig({ - el: el, - componentModel: graphicModel, - itemName: el.name, - itemTooltipOption: elOption.tooltip - }); - applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel); + layout18.startAngle = actualStartAngle; + layout18.endAngle = actualEndAngle; } }); - }; - /** - * Locate graphic elements. - */ - GraphicComponentView.prototype._relocate = function (graphicModel, api) { - var elOptions = graphicModel.option.elements; - var rootGroup = this.group; - var elMap = this._elMap; - var apiWidth = api.getWidth(); - var apiHeight = api.getHeight(); - var xy = ['x', 'y']; - // Top-down to calculate percentage width/height of group - for (var i = 0; i < elOptions.length; i++) { - var elOption = elOptions[i]; - var id = convertOptionIdName(elOption.id, null); - var el = id != null ? elMap.get(id) : null; - if (!el || !el.isGroup) { - continue; - } - var parentEl = el.parent; - var isParentRoot = parentEl === rootGroup; - // Like 'position:absolut' in css, default 0. - var elInner = inner$e(el); - var parentElInner = inner$e(parentEl); - elInner.width = parsePercent$1(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0; - elInner.height = parsePercent$1(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0; - } - // Bottom-up tranvese all elements (consider ec resize) to locate elements. - for (var i = elOptions.length - 1; i >= 0; i--) { - var elOption = elOptions[i]; - var id = convertOptionIdName(elOption.id, null); - var el = id != null ? elMap.get(id) : null; - if (!el) { - continue; - } - var parentEl = el.parent; - var parentElInner = inner$e(parentEl); - var containerInfo = parentEl === rootGroup ? { - width: apiWidth, - height: apiHeight - } : { - width: parentElInner.width, - height: parentElInner.height - }; - // PENDING - // Currently, when `bounding: 'all'`, the union bounding rect of the group - // does not include the rect of [0, 0, group.width, group.height], which - // is probably weird for users. Should we make a break change for it? - var layoutPos = {}; - var layouted = positionElement(el, elOption, containerInfo, null, { - hv: elOption.hv, - boundingMode: elOption.bounding - }, layoutPos); - if (!inner$e(el).isNew && layouted) { - var transition = elOption.transition; - var animatePos = {}; - for (var k = 0; k < xy.length; k++) { - var key = xy[k]; - var val = layoutPos[key]; - if (transition && (isTransitionAll(transition) || indexOf(transition, key) >= 0)) { - animatePos[key] = val; - } else { - el[key] = val; - } + } else { + unitRadian = restAngle / valueSumLargerThanMinAngle; + currentAngle = startAngle; + data.each(valueDim, function(value, idx) { + if (!isNaN(value)) { + const layout18 = data.getItemLayout(idx); + const angle = layout18.angle === minAndPadAngle ? minAndPadAngle : value * unitRadian; + let actualStartAngle = 0; + let actualEndAngle = 0; + if (angle < padAngle) { + actualStartAngle = currentAngle + dir3 * angle / 2; + actualEndAngle = actualStartAngle; + } else { + actualStartAngle = currentAngle + halfPadAngle; + actualEndAngle = currentAngle + dir3 * angle - halfPadAngle; } - updateProps(el, animatePos, graphicModel, 0); - } else { - el.attr(layoutPos); + layout18.startAngle = actualStartAngle; + layout18.endAngle = actualEndAngle; + currentAngle += dir3 * angle; } - } - }; - /** - * Clear all elements. - */ - GraphicComponentView.prototype._clear = function () { - var _this = this; - var elMap = this._elMap; - elMap.each(function (el) { - removeEl(el, inner$e(el).option, elMap, _this._lastGraphicModel); }); - this._elMap = createHashMap(); - }; - GraphicComponentView.prototype.dispose = function () { - this._clear(); - }; - GraphicComponentView.type = 'graphic'; - return GraphicComponentView; - }(ComponentView); - function newEl(graphicType) { - if ("development" !== 'production') { - assert(graphicType, 'graphic type MUST be set'); - } - var Clz = hasOwn(nonShapeGraphicElements, graphicType) - // Those graphic elements are not shapes. They should not be - // overwritten by users, so do them first. - ? nonShapeGraphicElements[graphicType] : getShapeClass(graphicType); - if ("development" !== 'production') { - assert(Clz, "graphic type " + graphicType + " can not be found"); - } - var el = new Clz({}); - inner$e(el).type = graphicType; - return el; - } - function createEl$1(id, targetElParent, graphicType, elMap) { - var el = newEl(graphicType); - targetElParent.add(el); - elMap.set(id, el); - inner$e(el).id = id; - inner$e(el).isNew = true; - return el; - } - function removeEl(elExisting, elOption, elMap, graphicModel) { - var existElParent = elExisting && elExisting.parent; - if (existElParent) { - elExisting.type === 'group' && elExisting.traverse(function (el) { - removeEl(el, elOption, elMap, graphicModel); - }); - applyLeaveTransition(elExisting, elOption, graphicModel); - elMap.removeKey(inner$e(elExisting).id); } } - function updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) { - if (!el.isGroup) { - each([['cursor', Displayable.prototype.cursor], - // We should not support configure z and zlevel in the element level. - // But seems we didn't limit it previously. So here still use it to avoid breaking. - ['zlevel', defaultZlevel || 0], ['z', defaultZ || 0], - // z2 must not be null/undefined, otherwise sort error may occur. - ['z2', 0]], function (item) { - var prop = item[0]; - if (hasOwn(elOption, prop)) { - el[prop] = retrieve2(elOption[prop], item[1]); - } else if (el[prop] == null) { - el[prop] = item[1]; - } - }); - } - each(keys(elOption), function (key) { - // Assign event handlers. - // PENDING: should enumerate all event names or use pattern matching? - if (key.indexOf('on') === 0) { - var val = elOption[key]; - el[key] = isFunction(val) ? val : null; - } - }); - if (hasOwn(elOption, 'draggable')) { - el.draggable = elOption.draggable; - } - // Other attributes - elOption.name != null && (el.name = elOption.name); - elOption.id != null && (el.id = elOption.id); - } - // Remove unnecessary props to avoid potential problems. - function getCleanedElOption(elOption) { - elOption = extend({}, elOption); - each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(LOCATION_PARAMS), function (name) { - delete elOption[name]; + }); +} +var getSeriesLayoutData = makeInner(); + +// src/processor/dataFilter.ts +function dataFilter(seriesType2) { + return { + seriesType: seriesType2, + reset: function(seriesModel, ecModel) { + const legendModels = ecModel.findComponents({ + mainType: "legend" }); - return elOption; - } - function setEventData(el, graphicModel, elOption) { - var eventData = getECData(el).eventData; - // Simple optimize for large amount of elements that no need event. - if (!el.silent && !el.ignore && !eventData) { - eventData = getECData(el).eventData = { - componentType: 'graphic', - componentIndex: graphicModel.componentIndex, - name: el.name - }; + if (!legendModels || !legendModels.length) { + return; } - // `elOption.info` enables user to mount some info on - // elements and use them in event handlers. - if (eventData) { - eventData.info = elOption.info; - } - } - - function install$x(registers) { - registers.registerComponentModel(GraphicComponentModel); - registers.registerComponentView(GraphicComponentView); - registers.registerPreprocessor(function (option) { - var graphicOption = option.graphic; - // Convert - // {graphic: [{left: 10, type: 'circle'}, ...]} - // or - // {graphic: {left: 10, type: 'circle'}} - // to - // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]} - if (isArray(graphicOption)) { - if (!graphicOption[0] || !graphicOption[0].elements) { - option.graphic = [{ - elements: graphicOption - }]; - } else { - // Only one graphic instance can be instantiated. (We don't - // want that too many views are created in echarts._viewMap.) - option.graphic = [option.graphic[0]]; + const data = seriesModel.getData(); + data.filterSelf(function(idx) { + const name = data.getName(idx); + for (let i = 0; i < legendModels.length; i++) { + if (!legendModels[i].isSelected(name)) { + return false; } - } else if (graphicOption && !graphicOption.elements) { - option.graphic = [{ - elements: [graphicOption] - }]; } + return true; }); } - - var DATA_ZOOM_AXIS_DIMENSIONS = ['x', 'y', 'radius', 'angle', 'single']; - // Supported coords. - // FIXME: polar has been broken (but rarely used). - var SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis']; - function isCoordSupported(seriesModel) { - var coordType = seriesModel.get('coordinateSystem'); - return indexOf(SERIES_COORDS, coordType) >= 0; - } - function getAxisMainType(axisDim) { - if ("development" !== 'production') { - assert(axisDim); - } - return axisDim + 'Axis'; - } - /** - * If two dataZoomModels has the same axis controlled, we say that they are 'linked'. - * This function finds all linked dataZoomModels start from the given payload. - */ - function findEffectedDataZooms(ecModel, payload) { - // Key: `DataZoomAxisDimension` - var axisRecords = createHashMap(); - var effectedModels = []; - // Key: uid of dataZoomModel - var effectedModelMap = createHashMap(); - // Find the dataZooms specified by payload. - ecModel.eachComponent({ - mainType: 'dataZoom', - query: payload - }, function (dataZoomModel) { - if (!effectedModelMap.get(dataZoomModel.uid)) { - addToEffected(dataZoomModel); - } - }); - // Start from the given dataZoomModels, travel the graph to find - // all of the linked dataZoom models. - var foundNewLink; - do { - foundNewLink = false; - ecModel.eachComponent('dataZoom', processSingle); - } while (foundNewLink); - function processSingle(dataZoomModel) { - if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) { - addToEffected(dataZoomModel); - foundNewLink = true; - } - } - function addToEffected(dataZoom) { - effectedModelMap.set(dataZoom.uid, true); - effectedModels.push(dataZoom); - markAxisControlled(dataZoom); - } - function isLinked(dataZoomModel) { - var isLink = false; - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var axisIdxArr = axisRecords.get(axisDim); - if (axisIdxArr && axisIdxArr[axisIndex]) { - isLink = true; - } - }); - return isLink; - } - function markAxisControlled(dataZoomModel) { - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true; - }); - } - return effectedModels; - } - /** - * Find the first target coordinate system. - * Available after model built. - * - * @return Like { - * grid: [ - * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1}, - * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0}, - * ... - * ], // cartesians must not be null/undefined. - * polar: [ - * {model: coord0, axisModels: [axis4], coordIndex: 0}, - * ... - * ], // polars must not be null/undefined. - * singleAxis: [ - * {model: coord0, axisModels: [], coordIndex: 0} - * ] - * } - */ - function collectReferCoordSysModelInfo(dataZoomModel) { - var ecModel = dataZoomModel.ecModel; - var coordSysInfoWrap = { - infoList: [], - infoMap: createHashMap() - }; - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); - if (!axisModel) { - return; + }; +} + +// src/chart/pie/labelLayout.ts +var RADIAN2 = Math.PI / 180; +function adjustSingleSide(list, cx, cy, r, dir3, viewWidth, viewHeight, viewLeft, viewTop, farthestX) { + if (list.length < 2) { + return; + } + ; + function recalculateXOnSemiToAlignOnEllipseCurve(semi) { + const rB = semi.rB; + const rB2 = rB * rB; + for (let i = 0; i < semi.list.length; i++) { + const item = semi.list[i]; + const dy = Math.abs(item.label.y - cy); + const rA = r + item.len; + const rA2 = rA * rA; + const dx = Math.sqrt(Math.abs((1 - dy * dy / rB2) * rA2)); + const newX = cx + (dx + item.len2) * dir3; + const deltaX = newX - item.label.x; + const newTargetWidth = item.targetTextWidth - deltaX * dir3; + constrainTextWidth(item, newTargetWidth, true); + item.label.x = newX; + } + } + function recalculateX(items) { + const topSemi = {list: [], maxY: 0}; + const bottomSemi = {list: [], maxY: 0}; + for (let i = 0; i < items.length; i++) { + if (items[i].labelAlignTo !== "none") { + continue; + } + const item = items[i]; + const semi = item.label.y > cy ? bottomSemi : topSemi; + const dy = Math.abs(item.label.y - cy); + if (dy >= semi.maxY) { + const dx = item.label.x - cx - item.len2 * dir3; + const rA = r + item.len; + const rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA; + semi.rB = rB; + semi.maxY = dy; + } + semi.list.push(item); + } + recalculateXOnSemiToAlignOnEllipseCurve(topSemi); + recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi); + } + const len2 = list.length; + for (let i = 0; i < len2; i++) { + if (list[i].position === "outer" && list[i].labelAlignTo === "labelLine") { + const dx = list[i].label.x - farthestX; + list[i].linePoints[1][0] += dx; + list[i].label.x = farthestX; + } + } + if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) { + recalculateX(list); + } +} +function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) { + const leftList = []; + const rightList = []; + let leftmostX = Number.MAX_VALUE; + let rightmostX = -Number.MAX_VALUE; + for (let i = 0; i < labelLayoutList.length; i++) { + const label = labelLayoutList[i].label; + if (isPositionCenter(labelLayoutList[i])) { + continue; + } + if (label.x < cx) { + leftmostX = Math.min(leftmostX, label.x); + leftList.push(labelLayoutList[i]); + } else { + rightmostX = Math.max(rightmostX, label.x); + rightList.push(labelLayoutList[i]); + } + } + for (let i = 0; i < labelLayoutList.length; i++) { + const layout18 = labelLayoutList[i]; + if (!isPositionCenter(layout18) && layout18.linePoints) { + if (layout18.labelStyleWidth != null) { + continue; + } + const label = layout18.label; + const linePoints = layout18.linePoints; + let targetTextWidth; + if (layout18.labelAlignTo === "edge") { + if (label.x < cx) { + targetTextWidth = linePoints[2][0] - layout18.labelDistance - viewLeft - layout18.edgeDistance; + } else { + targetTextWidth = viewLeft + viewWidth - layout18.edgeDistance - linePoints[2][0] - layout18.labelDistance; } - var coordSysModel = axisModel.getCoordSysModel(); - if (!coordSysModel) { - return; + } else if (layout18.labelAlignTo === "labelLine") { + if (label.x < cx) { + targetTextWidth = leftmostX - viewLeft - layout18.bleedMargin; + } else { + targetTextWidth = viewLeft + viewWidth - rightmostX - layout18.bleedMargin; } - var coordSysUid = coordSysModel.uid; - var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid); - if (!coordSysInfo) { - coordSysInfo = { - model: coordSysModel, - axisModels: [] - }; - coordSysInfoWrap.infoList.push(coordSysInfo); - coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo); + } else { + if (label.x < cx) { + targetTextWidth = label.x - viewLeft - layout18.bleedMargin; + } else { + targetTextWidth = viewLeft + viewWidth - label.x - layout18.bleedMargin; + } + } + layout18.targetTextWidth = targetTextWidth; + constrainTextWidth(layout18, targetTextWidth); + } + } + adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX); + adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX); + for (let i = 0; i < labelLayoutList.length; i++) { + const layout18 = labelLayoutList[i]; + if (!isPositionCenter(layout18) && layout18.linePoints) { + const label = layout18.label; + const linePoints = layout18.linePoints; + const isAlignToEdge = layout18.labelAlignTo === "edge"; + const padding = label.style.padding; + const paddingH = padding ? padding[1] + padding[3] : 0; + const extraPaddingH = label.style.backgroundColor ? 0 : paddingH; + const realTextWidth = layout18.rect.width + extraPaddingH; + const dist3 = linePoints[1][0] - linePoints[2][0]; + if (isAlignToEdge) { + if (label.x < cx) { + linePoints[2][0] = viewLeft + layout18.edgeDistance + realTextWidth + layout18.labelDistance; + } else { + linePoints[2][0] = viewLeft + viewWidth - layout18.edgeDistance - realTextWidth - layout18.labelDistance; } - coordSysInfo.axisModels.push(axisModel); - }); - return coordSysInfoWrap; + } else { + if (label.x < cx) { + linePoints[2][0] = label.x + layout18.labelDistance; + } else { + linePoints[2][0] = label.x - layout18.labelDistance; + } + linePoints[1][0] = linePoints[2][0] + dist3; + } + linePoints[1][1] = linePoints[2][1] = label.y; + } + } +} +function constrainTextWidth(layout18, availableWidth, forceRecalculate = false) { + if (layout18.labelStyleWidth != null) { + return; + } + const label = layout18.label; + const style = label.style; + const textRect = layout18.rect; + const bgColor = style.backgroundColor; + const padding = style.padding; + const paddingH = padding ? padding[1] + padding[3] : 0; + const overflow = style.overflow; + const oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH); + if (availableWidth < oldOuterWidth || forceRecalculate) { + const oldHeight = textRect.height; + if (overflow && overflow.match("break")) { + label.setStyle("backgroundColor", null); + label.setStyle("width", availableWidth - paddingH); + const innerRect = label.getBoundingRect(); + label.setStyle("width", Math.ceil(innerRect.width)); + label.setStyle("backgroundColor", bgColor); + } else { + const availableInnerWidth = availableWidth - paddingH; + const newWidth = availableWidth < oldOuterWidth ? availableInnerWidth : forceRecalculate ? availableInnerWidth > layout18.unconstrainedWidth ? null : availableInnerWidth : null; + label.setStyle("width", newWidth); + } + const newRect = label.getBoundingRect(); + textRect.width = newRect.width; + const margin = (label.style.margin || 0) + 2.1; + textRect.height = newRect.height + margin; + textRect.y -= (textRect.height - oldHeight) / 2; + } +} +function isPositionCenter(sectorShape) { + return sectorShape.position === "center"; +} +function pieLabelLayout(seriesModel) { + const data = seriesModel.getData(); + const labelLayoutList = []; + let cx; + let cy; + let hasLabelRotate = false; + const minShowLabelRadian = (seriesModel.get("minShowLabelAngle") || 0) * RADIAN2; + const viewRect2 = data.getLayout("viewRect"); + const r = data.getLayout("r"); + const viewWidth = viewRect2.width; + const viewLeft = viewRect2.x; + const viewTop = viewRect2.y; + const viewHeight = viewRect2.height; + function setNotShow(el) { + el.ignore = true; + } + function isLabelShown(label) { + if (!label.ignore) { + return true; } - - var DataZoomAxisInfo = /** @class */function () { - function DataZoomAxisInfo() { - this.indexList = []; - this.indexMap = []; + for (const key in label.states) { + if (label.states[key].ignore === false) { + return true; } - DataZoomAxisInfo.prototype.add = function (axisCmptIdx) { - // Remove duplication. - if (!this.indexMap[axisCmptIdx]) { - this.indexList.push(axisCmptIdx); - this.indexMap[axisCmptIdx] = true; - } - }; - return DataZoomAxisInfo; - }(); - var DataZoomModel = /** @class */function (_super) { - __extends(DataZoomModel, _super); - function DataZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = DataZoomModel.type; - _this._autoThrottle = true; - _this._noTarget = true; - /** - * It is `[rangeModeForMin, rangeModeForMax]`. - * The optional values for `rangeMode`: - * + `'value'` mode: the axis extent will always be determined by - * `dataZoom.startValue` and `dataZoom.endValue`, despite - * how data like and how `axis.min` and `axis.max` are. - * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`, - * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`, - * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`. - * Axis extent will be determined by the result of the percent of `[dMin, dMax]`. - * - * For example, when users are using dynamic data (update data periodically via `setOption`), - * if in `'value`' mode, the window will be kept in a fixed value range despite how - * data are appended, while if in `'percent'` mode, whe window range will be changed alone with - * the appended data (suppose `axis.min` and `axis.max` are not specified). - */ - _this._rangePropMode = ['percent', 'percent']; - return _this; - } - DataZoomModel.prototype.init = function (option, parentModel, ecModel) { - var inputRawOption = retrieveRawOption(option); - /** - * Suppose a "main process" start at the point that model prepared (that is, - * model initialized or merged or method called in `action`). - * We should keep the `main process` idempotent, that is, given a set of values - * on `option`, we get the same result. - * - * But sometimes, values on `option` will be updated for providing users - * a "final calculated value" (`dataZoomProcessor` will do that). Those value - * should not be the base/input of the `main process`. - * - * So in that case we should save and keep the input of the `main process` - * separately, called `settledOption`. - * - * For example, consider the case: - * (Step_1) brush zoom the grid by `toolbox.dataZoom`, - * where the original input `option.startValue`, `option.endValue` are earsed by - * calculated value. - * (Step)2) click the legend to hide and show a series, - * where the new range is calculated by the earsed `startValue` and `endValue`, - * which brings incorrect result. - */ - this.settledOption = inputRawOption; - this.mergeDefaultAndTheme(option, ecModel); - this._doInit(inputRawOption); - }; - DataZoomModel.prototype.mergeOption = function (newOption) { - var inputRawOption = retrieveRawOption(newOption); - // FIX #2591 - merge(this.option, newOption, true); - merge(this.settledOption, inputRawOption, true); - this._doInit(inputRawOption); - }; - DataZoomModel.prototype._doInit = function (inputRawOption) { - var thisOption = this.option; - this._setDefaultThrottle(inputRawOption); - this._updateRangeUse(inputRawOption); - var settledOption = this.settledOption; - each([['start', 'startValue'], ['end', 'endValue']], function (names, index) { - // start/end has higher priority over startValue/endValue if they - // both set, but we should make chart.setOption({endValue: 1000}) - // effective, rather than chart.setOption({endValue: 1000, end: null}). - if (this._rangePropMode[index] === 'value') { - thisOption[names[0]] = settledOption[names[0]] = null; - } - // Otherwise do nothing and use the merge result. - }, this); - this._resetTarget(); - }; - DataZoomModel.prototype._resetTarget = function () { - var optionOrient = this.get('orient', true); - var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap(); - var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap); - if (hasAxisSpecified) { - this._orient = optionOrient || this._makeAutoOrientByTargetAxis(); + } + return false; + } + data.each(function(idx) { + const sector = data.getItemGraphicEl(idx); + const sectorShape = sector.shape; + const label = sector.getTextContent(); + const labelLine = sector.getTextGuideLine(); + const itemModel = data.getItemModel(idx); + const labelModel = itemModel.getModel("label"); + const labelPosition = labelModel.get("position") || itemModel.get(["emphasis", "label", "position"]); + const labelDistance = labelModel.get("distanceToLabelLine"); + const labelAlignTo = labelModel.get("alignTo"); + const edgeDistance = parsePercent2(labelModel.get("edgeDistance"), viewWidth); + const bleedMargin = labelModel.get("bleedMargin"); + const labelLineModel = itemModel.getModel("labelLine"); + let labelLineLen = labelLineModel.get("length"); + labelLineLen = parsePercent2(labelLineLen, viewWidth); + let labelLineLen2 = labelLineModel.get("length2"); + labelLineLen2 = parsePercent2(labelLineLen2, viewWidth); + if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) { + each(label.states, setNotShow); + label.ignore = true; + if (labelLine) { + each(labelLine.states, setNotShow); + labelLine.ignore = true; + } + return; + } + if (!isLabelShown(label)) { + return; + } + const midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2; + const nx = Math.cos(midAngle); + const ny = Math.sin(midAngle); + let textX; + let textY; + let linePoints; + let textAlign; + cx = sectorShape.cx; + cy = sectorShape.cy; + const isLabelInside = labelPosition === "inside" || labelPosition === "inner"; + if (labelPosition === "center") { + textX = sectorShape.cx; + textY = sectorShape.cy; + textAlign = "center"; + } else { + const x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx; + const y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy; + textX = x1 + nx * 3; + textY = y1 + ny * 3; + if (!isLabelInside) { + const x2 = x1 + nx * (labelLineLen + r - sectorShape.r); + const y2 = y1 + ny * (labelLineLen + r - sectorShape.r); + const x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2; + const y3 = y2; + if (labelAlignTo === "edge") { + textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance; } else { - this._orient = optionOrient || 'horizontal'; - this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient); - } - this._noTarget = true; - targetAxisIndexMap.each(function (axisInfo) { - if (axisInfo.indexList.length) { - this._noTarget = false; - } - }, this); - }; - DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) { - var hasAxisSpecified = false; - each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) { - var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING); - // When user set axisIndex as a empty array, we think that user specify axisIndex - // but do not want use auto mode. Because empty array may be encountered when - // some error occurred. - if (!refering.specified) { - return; - } - hasAxisSpecified = true; - var axisInfo = new DataZoomAxisInfo(); - each(refering.models, function (axisModel) { - axisInfo.add(axisModel.componentIndex); - }); - targetAxisIndexMap.set(axisDim, axisInfo); - }, this); - return hasAxisSpecified; - }; - DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) { - var ecModel = this.ecModel; - var needAuto = true; - // Find axis that parallel to dataZoom as default. - if (needAuto) { - var axisDim = orient === 'vertical' ? 'y' : 'x'; - var axisModels = ecModel.findComponents({ - mainType: axisDim + 'Axis' - }); - setParallelAxis(axisModels, axisDim); - } - // Find axis that parallel to dataZoom as default. - if (needAuto) { - var axisModels = ecModel.findComponents({ - mainType: 'singleAxis', - filter: function (axisModel) { - return axisModel.get('orient', true) === orient; - } - }); - setParallelAxis(axisModels, 'single'); - } - function setParallelAxis(axisModels, axisDim) { - // At least use the first parallel axis as the target axis. - var axisModel = axisModels[0]; - if (!axisModel) { - return; - } - var axisInfo = new DataZoomAxisInfo(); - axisInfo.add(axisModel.componentIndex); - targetAxisIndexMap.set(axisDim, axisInfo); - needAuto = false; - // Find parallel axes in the same grid. - if (axisDim === 'x' || axisDim === 'y') { - var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]; - gridModel_1 && each(axisModels, function (axModel) { - if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) { - axisInfo.add(axModel.componentIndex); - } - }); + textX = x3 + (nx < 0 ? -labelDistance : labelDistance); + } + textY = y3; + linePoints = [[x1, y1], [x2, y2], [x3, y3]]; + } + textAlign = isLabelInside ? "center" : labelAlignTo === "edge" ? nx > 0 ? "right" : "left" : nx > 0 ? "left" : "right"; + } + const PI11 = Math.PI; + let labelRotate = 0; + const rotate2 = labelModel.get("rotate"); + if (isNumber(rotate2)) { + labelRotate = rotate2 * (PI11 / 180); + } else if (labelPosition === "center") { + labelRotate = 0; + } else if (rotate2 === "radial" || rotate2 === true) { + const radialAngle = nx < 0 ? -midAngle + PI11 : -midAngle; + labelRotate = radialAngle; + } else if (rotate2 === "tangential" && labelPosition !== "outside" && labelPosition !== "outer") { + let rad = Math.atan2(nx, ny); + if (rad < 0) { + rad = PI11 * 2 + rad; + } + const isDown = ny > 0; + if (isDown) { + rad = PI11 + rad; + } + labelRotate = rad - PI11; + } + hasLabelRotate = !!labelRotate; + label.x = textX; + label.y = textY; + label.rotation = labelRotate; + label.setStyle({ + verticalAlign: "middle" + }); + if (!isLabelInside) { + const textRect = label.getBoundingRect().clone(); + textRect.applyTransform(label.getComputedTransform()); + const margin = (label.style.margin || 0) + 2.1; + textRect.y -= margin / 2; + textRect.height += margin; + labelLayoutList.push({ + label, + labelLine, + position: labelPosition, + len: labelLineLen, + len2: labelLineLen2, + minTurnAngle: labelLineModel.get("minTurnAngle"), + maxSurfaceAngle: labelLineModel.get("maxSurfaceAngle"), + surfaceNormal: new Point_default(nx, ny), + linePoints, + textAlign, + labelDistance, + labelAlignTo, + edgeDistance, + bleedMargin, + rect: textRect, + unconstrainedWidth: textRect.width, + labelStyleWidth: label.style.width + }); + } else { + label.setStyle({ + align: textAlign + }); + const selectState = label.states.select; + if (selectState) { + selectState.x += label.x; + selectState.y += label.y; + } + } + sector.setTextConfig({ + inside: isLabelInside + }); + }); + if (!hasLabelRotate && seriesModel.get("avoidLabelOverlap")) { + avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop); + } + for (let i = 0; i < labelLayoutList.length; i++) { + const layout18 = labelLayoutList[i]; + const label = layout18.label; + const labelLine = layout18.labelLine; + const notShowLabel = isNaN(label.x) || isNaN(label.y); + if (label) { + label.setStyle({ + align: layout18.textAlign + }); + if (notShowLabel) { + each(label.states, setNotShow); + label.ignore = true; + } + const selectState = label.states.select; + if (selectState) { + selectState.x += label.x; + selectState.y += label.y; + } + } + if (labelLine) { + const linePoints = layout18.linePoints; + if (notShowLabel || !linePoints) { + each(labelLine.states, setNotShow); + labelLine.ignore = true; + } else { + limitTurnAngle(linePoints, layout18.minTurnAngle); + limitSurfaceAngle(linePoints, layout18.surfaceNormal, layout18.maxSurfaceAngle); + labelLine.setShape({points: linePoints}); + label.__hostTarget.textGuideLineConfig = { + anchor: new Point_default(linePoints[0][0], linePoints[0][1]) + }; + } + } + } +} + +// src/chart/pie/PieView.ts +var PiePiece = class extends Sector_default { + constructor(data, idx, startAngle) { + super(); + this.z2 = 2; + const text = new Text_default(); + this.setTextContent(text); + this.updateData(data, idx, startAngle, true); + } + updateData(data, idx, startAngle, firstCreate) { + const sector = this; + const seriesModel = data.hostModel; + const itemModel = data.getItemModel(idx); + const emphasisModel = itemModel.getModel("emphasis"); + const layout18 = data.getItemLayout(idx); + const sectorShape = extend(getSectorCornerRadius(itemModel.getModel("itemStyle"), layout18, true), layout18); + if (isNaN(sectorShape.startAngle)) { + sector.setShape(sectorShape); + return; + } + if (firstCreate) { + sector.setShape(sectorShape); + const animationType = seriesModel.getShallow("animationType"); + if (seriesModel.ecModel.ssr) { + initProps(sector, { + scaleX: 0, + scaleY: 0 + }, seriesModel, {dataIndex: idx, isFrom: true}); + sector.originX = sectorShape.cx; + sector.originY = sectorShape.cy; + } else if (animationType === "scale") { + sector.shape.r = layout18.r0; + initProps(sector, { + shape: { + r: layout18.r } - } - if (needAuto) { - // If no parallel axis, find the first category axis as default. (Also consider polar). - each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) { - if (!needAuto) { - return; + }, seriesModel, idx); + } else { + if (startAngle != null) { + sector.setShape({startAngle, endAngle: startAngle}); + initProps(sector, { + shape: { + startAngle: layout18.startAngle, + endAngle: layout18.endAngle } - var axisModels = ecModel.findComponents({ - mainType: getAxisMainType(axisDim), - filter: function (axisModel) { - return axisModel.get('type', true) === 'category'; - } - }); - if (axisModels[0]) { - var axisInfo = new DataZoomAxisInfo(); - axisInfo.add(axisModels[0].componentIndex); - targetAxisIndexMap.set(axisDim, axisInfo); - needAuto = false; + }, seriesModel, idx); + } else { + sector.shape.endAngle = layout18.startAngle; + updateProps(sector, { + shape: { + endAngle: layout18.endAngle } - }, this); + }, seriesModel, idx); } - }; - DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () { - var dim; - // Find the first axis - this.eachTargetAxis(function (axisDim) { - !dim && (dim = axisDim); - }, this); - return dim === 'y' ? 'vertical' : 'horizontal'; - }; - DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) { - // When first time user set throttle, auto throttle ends. - if (inputRawOption.hasOwnProperty('throttle')) { - this._autoThrottle = false; + } + } else { + saveOldStyle(sector); + updateProps(sector, { + shape: sectorShape + }, seriesModel, idx); + } + sector.useStyle(data.getItemVisual(idx, "style")); + setStatesStylesFromModel(sector, itemModel); + const midAngle = (layout18.startAngle + layout18.endAngle) / 2; + const offset = seriesModel.get("selectedOffset"); + const dx = Math.cos(midAngle) * offset; + const dy = Math.sin(midAngle) * offset; + const cursorStyle = itemModel.getShallow("cursor"); + cursorStyle && sector.attr("cursor", cursorStyle); + this._updateLabel(seriesModel, data, idx); + sector.ensureState("emphasis").shape = extend({ + r: layout18.r + (emphasisModel.get("scale") ? emphasisModel.get("scaleSize") || 0 : 0) + }, getSectorCornerRadius(emphasisModel.getModel("itemStyle"), layout18)); + extend(sector.ensureState("select"), { + x: dx, + y: dy, + shape: getSectorCornerRadius(itemModel.getModel(["select", "itemStyle"]), layout18) + }); + extend(sector.ensureState("blur"), { + shape: getSectorCornerRadius(itemModel.getModel(["blur", "itemStyle"]), layout18) + }); + const labelLine = sector.getTextGuideLine(); + const labelText = sector.getTextContent(); + labelLine && extend(labelLine.ensureState("select"), { + x: dx, + y: dy + }); + extend(labelText.ensureState("select"), { + x: dx, + y: dy + }); + toggleHoverEmphasis(this, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + } + _updateLabel(seriesModel, data, idx) { + const sector = this; + const itemModel = data.getItemModel(idx); + const labelLineModel = itemModel.getModel("labelLine"); + const style = data.getItemVisual(idx, "style"); + const visualColor = style && style.fill; + const visualOpacity = style && style.opacity; + setLabelStyle(sector, getLabelStatesModels(itemModel), { + labelFetcher: data.hostModel, + labelDataIndex: idx, + inheritColor: visualColor, + defaultOpacity: visualOpacity, + defaultText: seriesModel.getFormattedLabel(idx, "normal") || data.getName(idx) + }); + const labelText = sector.getTextContent(); + sector.setTextConfig({ + position: null, + rotation: null + }); + labelText.attr({ + z2: 10 + }); + const labelPosition = seriesModel.get(["label", "position"]); + if (labelPosition !== "outside" && labelPosition !== "outer") { + sector.removeTextGuideLine(); + } else { + let polyline = this.getTextGuideLine(); + if (!polyline) { + polyline = new Polyline_default(); + this.setTextGuideLine(polyline); + } + setLabelLineStyle(this, getLabelLineStatesModels(itemModel), { + stroke: visualColor, + opacity: retrieve3(labelLineModel.get(["lineStyle", "opacity"]), visualOpacity, 1) + }); + } + } +}; +var PieView = class extends Chart_default { + constructor() { + super(...arguments); + this.ignoreLabelLineUpdate = true; + } + render(seriesModel, ecModel, api2, payload) { + const data = seriesModel.getData(); + const oldData = this._data; + const group = this.group; + let startAngle; + if (!oldData && data.count() > 0) { + let shape = data.getItemLayout(0); + for (let s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) { + shape = data.getItemLayout(s); + } + if (shape) { + startAngle = shape.startAngle; + } + } + if (this._emptyCircleSector) { + group.remove(this._emptyCircleSector); + } + if (data.count() === 0 && seriesModel.get("showEmptyCircle")) { + const layoutData = getSeriesLayoutData(seriesModel); + const sector = new Sector_default({ + shape: extend(getBasicPieLayout(seriesModel, api2), layoutData) + }); + sector.useStyle(seriesModel.getModel("emptyCircleStyle").getItemStyle()); + this._emptyCircleSector = sector; + group.add(sector); + } + data.diff(oldData).add(function(idx) { + const piePiece = new PiePiece(data, idx, startAngle); + data.setItemGraphicEl(idx, piePiece); + group.add(piePiece); + }).update(function(newIdx, oldIdx) { + const piePiece = oldData.getItemGraphicEl(oldIdx); + piePiece.updateData(data, newIdx, startAngle); + piePiece.off("click"); + group.add(piePiece); + data.setItemGraphicEl(newIdx, piePiece); + }).remove(function(idx) { + const piePiece = oldData.getItemGraphicEl(idx); + removeElementWithFadeOut(piePiece, seriesModel, idx); + }).execute(); + pieLabelLayout(seriesModel); + if (seriesModel.get("animationTypeUpdate") !== "expansion") { + this._data = data; + } + } + dispose() { + } + containPoint(point, seriesModel) { + const data = seriesModel.getData(); + const itemLayout = data.getItemLayout(0); + if (itemLayout) { + const dx = point[0] - itemLayout.cx; + const dy = point[1] - itemLayout.cy; + const radius = Math.sqrt(dx * dx + dy * dy); + return radius <= itemLayout.r && radius >= itemLayout.r0; + } + } +}; +PieView.type = "pie"; +var PieView_default = PieView; + +// src/chart/helper/createSeriesDataSimply.ts +function createSeriesDataSimply(seriesModel, opt, nameList) { + opt = isArray(opt) && { + coordDimensions: opt + } || extend({ + encodeDefine: seriesModel.getEncode() + }, opt); + const source = seriesModel.getSource(); + const {dimensions} = prepareSeriesDataSchema(source, opt); + const list = new SeriesData_default(dimensions, seriesModel); + list.initData(source, nameList); + return list; +} + +// src/visual/LegendVisualProvider.ts +var LegendVisualProvider = class { + constructor(getDataWithEncodedVisual, getRawData2) { + this._getDataWithEncodedVisual = getDataWithEncodedVisual; + this._getRawData = getRawData2; + } + getAllNames() { + const rawData = this._getRawData(); + return rawData.mapArray(rawData.getName); + } + containName(name) { + const rawData = this._getRawData(); + return rawData.indexOfName(name) >= 0; + } + indexOfName(name) { + const dataWithEncodedVisual = this._getDataWithEncodedVisual(); + return dataWithEncodedVisual.indexOfName(name); + } + getItemVisual(dataIndex, key) { + const dataWithEncodedVisual = this._getDataWithEncodedVisual(); + return dataWithEncodedVisual.getItemVisual(dataIndex, key); + } +}; +var LegendVisualProvider_default = LegendVisualProvider; + +// src/chart/pie/PieSeries.ts +var innerData = makeInner(); +var PieSeriesModel = class extends Series_default { + init(option) { + super.init.apply(this, arguments); + this.legendVisualProvider = new LegendVisualProvider_default(bind(this.getData, this), bind(this.getRawData, this)); + this._defaultLabelLine(option); + } + mergeOption() { + super.mergeOption.apply(this, arguments); + } + getInitialData() { + return createSeriesDataSimply(this, { + coordDimensions: ["value"], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); + } + getDataParams(dataIndex) { + const data = this.getData(); + const dataInner = innerData(data); + let seats = dataInner.seats; + if (!seats) { + const valueList = []; + data.each(data.mapDimension("value"), function(value) { + valueList.push(value); + }); + seats = dataInner.seats = getPercentSeats(valueList, data.hostModel.get("percentPrecision")); + } + const params = super.getDataParams(dataIndex); + params.percent = seats[dataIndex] || 0; + params.$vars.push("percent"); + return params; + } + _defaultLabelLine(option) { + defaultEmphasis(option, "labelLine", ["show"]); + const labelLineNormalOpt = option.labelLine; + const labelLineEmphasisOpt = option.emphasis.labelLine; + labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; + labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; + } +}; +PieSeriesModel.type = "series.pie"; +PieSeriesModel.defaultOption = { + z: 2, + legendHoverLink: true, + colorBy: "data", + center: ["50%", "50%"], + radius: [0, "75%"], + clockwise: true, + startAngle: 90, + endAngle: "auto", + padAngle: 0, + minAngle: 0, + minShowLabelAngle: 0, + selectedOffset: 10, + percentPrecision: 2, + stillShowZeroSum: true, + left: 0, + top: 0, + right: 0, + bottom: 0, + width: null, + height: null, + label: { + rotate: 0, + show: true, + overflow: "truncate", + position: "outer", + alignTo: "none", + edgeDistance: "25%", + bleedMargin: 10, + distanceToLabelLine: 5 + }, + labelLine: { + show: true, + length: 15, + length2: 15, + smooth: false, + minTurnAngle: 90, + maxSurfaceAngle: 90, + lineStyle: { + width: 1, + type: "solid" + } + }, + itemStyle: { + borderWidth: 1, + borderJoin: "round" + }, + showEmptyCircle: true, + emptyCircleStyle: { + color: "lightgray", + opacity: 1 + }, + labelLayout: { + hideOverlap: true + }, + emphasis: { + scale: true, + scaleSize: 5 + }, + avoidLabelOverlap: true, + animationType: "expansion", + animationDuration: 1e3, + animationTypeUpdate: "transition", + animationEasingUpdate: "cubicInOut", + animationDurationUpdate: 500, + animationEasing: "cubicInOut" +}; +var PieSeries_default = PieSeriesModel; + +// src/processor/negativeDataFilter.ts +function negativeDataFilter(seriesType2) { + return { + seriesType: seriesType2, + reset: function(seriesModel, ecModel) { + const data = seriesModel.getData(); + data.filterSelf(function(idx) { + const valueDim = data.mapDimension("value"); + const curValue = data.get(valueDim, idx); + if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) { + return false; } - if (this._autoThrottle) { - var globalOption = this.ecModel.option; - this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20; + return true; + }); + } + }; +} + +// src/chart/pie/install.ts +function install5(registers) { + registers.registerChartView(PieView_default); + registers.registerSeriesModel(PieSeries_default); + createLegacyDataSelectAction("pie", registers.registerAction); + registers.registerLayout(curry(pieLayout, "pie")); + registers.registerProcessor(dataFilter("pie")); + registers.registerProcessor(negativeDataFilter("pie")); +} + +// src/chart/scatter/ScatterSeries.ts +var ScatterSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = ScatterSeriesModel2.type; + this.hasSymbolVisual = true; + } + getInitialData(option, ecModel) { + return createSeriesData_default(null, this, { + useEncodeDefaulter: true + }); + } + getProgressive() { + const progressive = this.option.progressive; + if (progressive == null) { + return this.option.large ? 5e3 : this.get("progressive"); + } + return progressive; + } + getProgressiveThreshold() { + const progressiveThreshold = this.option.progressiveThreshold; + if (progressiveThreshold == null) { + return this.option.large ? 1e4 : this.get("progressiveThreshold"); + } + return progressiveThreshold; + } + brushSelector(dataIndex, data, selectors) { + return selectors.point(data.getItemLayout(dataIndex)); + } + getZLevelKey() { + return this.getData().count() > this.getProgressiveThreshold() ? this.id : ""; + } +}; +var ScatterSeriesModel = ScatterSeriesModel2; +ScatterSeriesModel.type = "series.scatter"; +ScatterSeriesModel.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"]; +ScatterSeriesModel.defaultOption = { + coordinateSystem: "cartesian2d", + z: 2, + legendHoverLink: true, + symbolSize: 10, + large: false, + largeThreshold: 2e3, + itemStyle: { + opacity: 0.8 + }, + emphasis: { + scale: true + }, + clip: true, + select: { + itemStyle: { + borderColor: "#212121" + } + }, + universalTransition: { + divideShape: "clone" + } +}; +var ScatterSeries_default = ScatterSeriesModel; + +// src/chart/helper/LargeSymbolDraw.ts +var BOOST_SIZE_THRESHOLD = 4; +var LargeSymbolPathShape = class { +}; +var LargeSymbolPath = class extends Path_default { + constructor(opts) { + super(opts); + this._off = 0; + this.hoverDataIdx = -1; + } + getDefaultShape() { + return new LargeSymbolPathShape(); + } + reset() { + this.notClear = false; + this._off = 0; + } + buildPath(path, shape) { + const points4 = shape.points; + const size = shape.size; + const symbolProxy = this.symbolProxy; + const symbolProxyShape = symbolProxy.shape; + const ctx = path.getContext ? path.getContext() : path; + const canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; + const softClipShape = this.softClipShape; + let i; + if (canBoost) { + this._ctx = ctx; + return; + } + this._ctx = null; + for (i = this._off; i < points4.length; ) { + const x = points4[i++]; + const y = points4[i++]; + if (isNaN(x) || isNaN(y)) { + continue; + } + if (softClipShape && !softClipShape.contain(x, y)) { + continue; + } + symbolProxyShape.x = x - size[0] / 2; + symbolProxyShape.y = y - size[1] / 2; + symbolProxyShape.width = size[0]; + symbolProxyShape.height = size[1]; + symbolProxy.buildPath(path, symbolProxyShape, true); + } + if (this.incremental) { + this._off = i; + this.notClear = true; + } + } + afterBrush() { + const shape = this.shape; + const points4 = shape.points; + const size = shape.size; + const ctx = this._ctx; + const softClipShape = this.softClipShape; + let i; + if (!ctx) { + return; + } + for (i = this._off; i < points4.length; ) { + const x = points4[i++]; + const y = points4[i++]; + if (isNaN(x) || isNaN(y)) { + continue; + } + if (softClipShape && !softClipShape.contain(x, y)) { + continue; + } + ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]); + } + if (this.incremental) { + this._off = i; + this.notClear = true; + } + } + findDataIndex(x, y) { + const shape = this.shape; + const points4 = shape.points; + const size = shape.size; + const w = Math.max(size[0], 4); + const h = Math.max(size[1], 4); + for (let idx = points4.length / 2 - 1; idx >= 0; idx--) { + const i = idx * 2; + const x0 = points4[i] - w / 2; + const y0 = points4[i + 1] - h / 2; + if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) { + return idx; + } + } + return -1; + } + contain(x, y) { + const localPos = this.transformCoordToLocal(x, y); + const rect = this.getBoundingRect(); + x = localPos[0]; + y = localPos[1]; + if (rect.contain(x, y)) { + const dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); + return dataIdx >= 0; + } + this.hoverDataIdx = -1; + return false; + } + getBoundingRect() { + let rect = this._rect; + if (!rect) { + const shape = this.shape; + const points4 = shape.points; + const size = shape.size; + const w = size[0]; + const h = size[1]; + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + for (let i = 0; i < points4.length; ) { + const x = points4[i++]; + const y = points4[i++]; + minX = Math.min(x, minX); + maxX = Math.max(x, maxX); + minY = Math.min(y, minY); + maxY = Math.max(y, maxY); + } + rect = this._rect = new BoundingRect_default(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h); + } + return rect; + } +}; +var LargeSymbolDraw = class { + constructor() { + this.group = new Group_default(); + } + updateData(data, opt) { + this._clear(); + const symbolEl = this._create(); + symbolEl.setShape({ + points: data.getLayout("points") + }); + this._setCommon(symbolEl, data, opt); + } + updateLayout(data) { + let points4 = data.getLayout("points"); + this.group.eachChild(function(child) { + if (child.startIndex != null) { + const len2 = (child.endIndex - child.startIndex) * 2; + const byteOffset = child.startIndex * 4 * 2; + points4 = new Float32Array(points4.buffer, byteOffset, len2); + } + child.setShape("points", points4); + child.reset(); + }); + } + incrementalPrepareUpdate(data) { + this._clear(); + } + incrementalUpdate(taskParams, data, opt) { + const lastAdded = this._newAdded[0]; + const points4 = data.getLayout("points"); + const oldPoints = lastAdded && lastAdded.shape.points; + if (oldPoints && oldPoints.length < 2e4) { + const oldLen = oldPoints.length; + const newPoints = new Float32Array(oldLen + points4.length); + newPoints.set(oldPoints); + newPoints.set(points4, oldLen); + lastAdded.endIndex = taskParams.end; + lastAdded.setShape({points: newPoints}); + } else { + this._newAdded = []; + const symbolEl = this._create(); + symbolEl.startIndex = taskParams.start; + symbolEl.endIndex = taskParams.end; + symbolEl.incremental = true; + symbolEl.setShape({ + points: points4 + }); + this._setCommon(symbolEl, data, opt); + } + } + eachRendered(cb) { + this._newAdded[0] && cb(this._newAdded[0]); + } + _create() { + const symbolEl = new LargeSymbolPath({ + cursor: "default" + }); + symbolEl.ignoreCoarsePointer = true; + this.group.add(symbolEl); + this._newAdded.push(symbolEl); + return symbolEl; + } + _setCommon(symbolEl, data, opt) { + const hostModel = data.hostModel; + opt = opt || {}; + const size = data.getVisual("symbolSize"); + symbolEl.setShape("size", size instanceof Array ? size : [size, size]); + symbolEl.softClipShape = opt.clipShape || null; + symbolEl.symbolProxy = createSymbol(data.getVisual("symbol"), 0, 0, 0, 0); + symbolEl.setColor = symbolEl.symbolProxy.setColor; + const extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD; + symbolEl.useStyle(hostModel.getModel("itemStyle").getItemStyle(extrudeShadow ? ["color", "shadowBlur", "shadowColor"] : ["color"])); + const globalStyle = data.getVisual("style"); + const visualColor = globalStyle && globalStyle.fill; + if (visualColor) { + symbolEl.setColor(visualColor); + } + const ecData = getECData(symbolEl); + ecData.seriesIndex = hostModel.seriesIndex; + symbolEl.on("mousemove", function(e2) { + ecData.dataIndex = null; + const dataIndex = symbolEl.hoverDataIdx; + if (dataIndex >= 0) { + ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0); + } + }); + } + remove() { + this._clear(); + } + _clear() { + this._newAdded = []; + this.group.removeAll(); + } +}; +var LargeSymbolDraw_default = LargeSymbolDraw; + +// src/chart/scatter/ScatterView.ts +var ScatterView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = ScatterView2.type; + } + render(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const symbolDraw = this._updateSymbolDraw(data, seriesModel); + symbolDraw.updateData(data, { + clipShape: this._getClipShape(seriesModel) + }); + this._finished = true; + } + incrementalPrepareRender(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const symbolDraw = this._updateSymbolDraw(data, seriesModel); + symbolDraw.incrementalPrepareUpdate(data); + this._finished = false; + } + incrementalRender(taskParams, seriesModel, ecModel) { + this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), { + clipShape: this._getClipShape(seriesModel) + }); + this._finished = taskParams.end === seriesModel.getData().count(); + } + updateTransform(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + this.group.dirty(); + if (!this._finished || data.count() > 1e4) { + return { + update: true + }; + } else { + const res = pointsLayout("").reset(seriesModel, ecModel, api2); + if (res.progress) { + res.progress({start: 0, end: data.count(), count: data.count()}, data); + } + this._symbolDraw.updateLayout(data); + } + } + eachRendered(cb) { + this._symbolDraw && this._symbolDraw.eachRendered(cb); + } + _getClipShape(seriesModel) { + if (!seriesModel.get("clip", true)) { + return; + } + const coordSys = seriesModel.coordinateSystem; + return coordSys && coordSys.getArea && coordSys.getArea(0.1); + } + _updateSymbolDraw(data, seriesModel) { + let symbolDraw = this._symbolDraw; + const pipelineContext = seriesModel.pipelineContext; + const isLargeDraw = pipelineContext.large; + if (!symbolDraw || isLargeDraw !== this._isLargeDraw) { + symbolDraw && symbolDraw.remove(); + symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw_default() : new SymbolDraw_default(); + this._isLargeDraw = isLargeDraw; + this.group.removeAll(); + } + this.group.add(symbolDraw.group); + return symbolDraw; + } + remove(ecModel, api2) { + this._symbolDraw && this._symbolDraw.remove(true); + this._symbolDraw = null; + } + dispose() { + } +}; +var ScatterView = ScatterView2; +ScatterView.type = "scatter"; +var ScatterView_default = ScatterView; + +// src/coord/cartesian/GridModel.ts +var GridModel = class extends Component_default { +}; +GridModel.type = "grid"; +GridModel.dependencies = ["xAxis", "yAxis"]; +GridModel.layoutMode = "box"; +GridModel.defaultOption = { + show: false, + z: 0, + left: "10%", + top: 60, + right: "10%", + bottom: 70, + containLabel: false, + backgroundColor: "rgba(0,0,0,0)", + borderWidth: 1, + borderColor: "#ccc" +}; +var GridModel_default = GridModel; + +// src/coord/cartesian/AxisModel.ts +var CartesianAxisModel = class extends Component_default { + getCoordSysModel() { + return this.getReferringComponents("grid", SINGLE_REFERRING).models[0]; + } +}; +CartesianAxisModel.type = "cartesian2dAxis"; +mixin(CartesianAxisModel, AxisModelCommonMixin); + +// src/coord/axisDefault.ts +var defaultOption = { + show: true, + z: 0, + inverse: false, + name: "", + nameLocation: "end", + nameRotate: null, + nameTruncate: { + maxWidth: null, + ellipsis: "...", + placeholder: "." + }, + nameTextStyle: {}, + nameGap: 15, + silent: false, + triggerEvent: false, + tooltip: { + show: false + }, + axisPointer: {}, + axisLine: { + show: true, + onZero: true, + onZeroAxisIndex: null, + lineStyle: { + color: "#6E7079", + width: 1, + type: "solid" + }, + symbol: ["none", "none"], + symbolSize: [10, 15] + }, + axisTick: { + show: true, + inside: false, + length: 5, + lineStyle: { + width: 1 + } + }, + axisLabel: { + show: true, + inside: false, + rotate: 0, + showMinLabel: null, + showMaxLabel: null, + margin: 8, + fontSize: 12 + }, + splitLine: { + show: true, + showMinLine: true, + showMaxLine: true, + lineStyle: { + color: ["#E0E6F1"], + width: 1, + type: "solid" + } + }, + splitArea: { + show: false, + areaStyle: { + color: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"] + } + } +}; +var categoryAxis = merge({ + boundaryGap: true, + deduplication: null, + splitLine: { + show: false + }, + axisTick: { + alignWithLabel: false, + interval: "auto" + }, + axisLabel: { + interval: "auto" + } +}, defaultOption); +var valueAxis = merge({ + boundaryGap: [0, 0], + axisLine: { + show: "auto" + }, + axisTick: { + show: "auto" + }, + splitNumber: 5, + minorTick: { + show: false, + splitNumber: 5, + length: 3, + lineStyle: {} + }, + minorSplitLine: { + show: false, + lineStyle: { + color: "#F4F7FD", + width: 1 + } + } +}, defaultOption); +var timeAxis = merge({ + splitNumber: 6, + axisLabel: { + showMinLabel: false, + showMaxLabel: false, + rich: { + primary: { + fontWeight: "bold" + } + } + }, + splitLine: { + show: false + } +}, valueAxis); +var logAxis = defaults({ + logBase: 10 +}, valueAxis); +var axisDefault_default = { + category: categoryAxis, + value: valueAxis, + time: timeAxis, + log: logAxis +}; + +// src/coord/axisCommonTypes.ts +var AXIS_TYPES = {value: 1, category: 1, time: 1, log: 1}; + +// src/coord/axisModelCreator.ts +function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) { + each(AXIS_TYPES, function(v, axisType) { + const defaultOption3 = merge(merge({}, axisDefault_default[axisType], true), extraDefaultOption, true); + class AxisModel extends BaseAxisModelClass { + constructor() { + super(...arguments); + this.type = axisName + "Axis." + axisType; + } + mergeDefaultAndTheme(option, ecModel) { + const layoutMode = fetchLayoutMode(this); + const inputPositionParams = layoutMode ? getLayoutParams(option) : {}; + const themeModel = ecModel.getTheme(); + merge(option, themeModel.get(axisType + "Axis")); + merge(option, this.getDefaultOption()); + option.type = getAxisType(option); + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); } - }; - DataZoomModel.prototype._updateRangeUse = function (inputRawOption) { - var rangePropMode = this._rangePropMode; - var rangeModeInOption = this.get('rangeMode'); - each([['start', 'startValue'], ['end', 'endValue']], function (names, index) { - var percentSpecified = inputRawOption[names[0]] != null; - var valueSpecified = inputRawOption[names[1]] != null; - if (percentSpecified && !valueSpecified) { - rangePropMode[index] = 'percent'; - } else if (!percentSpecified && valueSpecified) { - rangePropMode[index] = 'value'; - } else if (rangeModeInOption) { - rangePropMode[index] = rangeModeInOption[index]; - } else if (percentSpecified) { - // percentSpecified && valueSpecified - rangePropMode[index] = 'percent'; - } - // else remain its original setting. - }); - }; - - DataZoomModel.prototype.noTarget = function () { - return this._noTarget; - }; - DataZoomModel.prototype.getFirstTargetAxisModel = function () { - var firstAxisModel; - this.eachTargetAxis(function (axisDim, axisIndex) { - if (firstAxisModel == null) { - firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + } + optionUpdated() { + const thisOption = this.option; + if (thisOption.type === "category") { + this.__ordinalMeta = OrdinalMeta_default.createByAxisModel(this); + } + } + getCategories(rawData) { + const option = this.option; + if (option.type === "category") { + if (rawData) { + return option.data; + } + return this.__ordinalMeta.categories; + } + } + getOrdinalMeta() { + return this.__ordinalMeta; + } + } + AxisModel.type = axisName + "Axis." + axisType; + AxisModel.defaultOption = defaultOption3; + registers.registerComponentModel(AxisModel); + }); + registers.registerSubTypeDefaulter(axisName + "Axis", getAxisType); +} +function getAxisType(option) { + return option.type || (option.data ? "category" : "value"); +} + +// src/coord/cartesian/Cartesian.ts +var Cartesian = class { + constructor(name) { + this.type = "cartesian"; + this._dimList = []; + this._axes = {}; + this.name = name || ""; + } + getAxis(dim) { + return this._axes[dim]; + } + getAxes() { + return map(this._dimList, function(dim) { + return this._axes[dim]; + }, this); + } + getAxesByScale(scaleType) { + scaleType = scaleType.toLowerCase(); + return filter(this.getAxes(), function(axis) { + return axis.scale.type === scaleType; + }); + } + addAxis(axis) { + const dim = axis.dim; + this._axes[dim] = axis; + this._dimList.push(dim); + } +}; +var Cartesian_default = Cartesian; + +// src/coord/cartesian/Cartesian2D.ts +var cartesian2DDimensions = ["x", "y"]; +function canCalculateAffineTransform(scale4) { + return scale4.type === "interval" || scale4.type === "time"; +} +var Cartesian2D = class extends Cartesian_default { + constructor() { + super(...arguments); + this.type = "cartesian2d"; + this.dimensions = cartesian2DDimensions; + } + calcAffineTransform() { + this._transform = this._invTransform = null; + const xAxisScale = this.getAxis("x").scale; + const yAxisScale = this.getAxis("y").scale; + if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) { + return; + } + const xScaleExtent = xAxisScale.getExtent(); + const yScaleExtent = yAxisScale.getExtent(); + const start2 = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]); + const end2 = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]); + const xScaleSpan = xScaleExtent[1] - xScaleExtent[0]; + const yScaleSpan = yScaleExtent[1] - yScaleExtent[0]; + if (!xScaleSpan || !yScaleSpan) { + return; + } + const scaleX = (end2[0] - start2[0]) / xScaleSpan; + const scaleY = (end2[1] - start2[1]) / yScaleSpan; + const translateX = start2[0] - xScaleExtent[0] * scaleX; + const translateY = start2[1] - yScaleExtent[0] * scaleY; + const m2 = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY]; + this._invTransform = invert([], m2); + } + getBaseAxis() { + return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x"); + } + containPoint(point) { + const axisX = this.getAxis("x"); + const axisY = this.getAxis("y"); + return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1])); + } + containData(data) { + return this.getAxis("x").containData(data[0]) && this.getAxis("y").containData(data[1]); + } + containZone(data1, data2) { + const zoneDiag1 = this.dataToPoint(data1); + const zoneDiag2 = this.dataToPoint(data2); + const area = this.getArea(); + const zone = new BoundingRect_default(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]); + return area.intersect(zone); + } + dataToPoint(data, clamp2, out2) { + out2 = out2 || []; + const xVal = data[0]; + const yVal = data[1]; + if (this._transform && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) { + return applyTransform(out2, data, this._transform); + } + const xAxis = this.getAxis("x"); + const yAxis = this.getAxis("y"); + out2[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp2)); + out2[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp2)); + return out2; + } + clampData(data, out2) { + const xScale = this.getAxis("x").scale; + const yScale = this.getAxis("y").scale; + const xAxisExtent = xScale.getExtent(); + const yAxisExtent = yScale.getExtent(); + const x = xScale.parse(data[0]); + const y = yScale.parse(data[1]); + out2 = out2 || []; + out2[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1])); + out2[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1])); + return out2; + } + pointToData(point, clamp2) { + const out2 = []; + if (this._invTransform) { + return applyTransform(out2, point, this._invTransform); + } + const xAxis = this.getAxis("x"); + const yAxis = this.getAxis("y"); + out2[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp2); + out2[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp2); + return out2; + } + getOtherAxis(axis) { + return this.getAxis(axis.dim === "x" ? "y" : "x"); + } + getArea(tolerance) { + tolerance = tolerance || 0; + const xExtent = this.getAxis("x").getGlobalExtent(); + const yExtent = this.getAxis("y").getGlobalExtent(); + const x = Math.min(xExtent[0], xExtent[1]) - tolerance; + const y = Math.min(yExtent[0], yExtent[1]) - tolerance; + const width = Math.max(xExtent[0], xExtent[1]) - x + tolerance; + const height = Math.max(yExtent[0], yExtent[1]) - y + tolerance; + return new BoundingRect_default(x, y, width, height); + } +}; +var Cartesian2D_default = Cartesian2D; + +// src/coord/cartesian/Axis2D.ts +var Axis2D = class extends Axis_default { + constructor(dim, scale4, coordExtent, axisType, position2) { + super(dim, scale4, coordExtent); + this.index = 0; + this.type = axisType || "value"; + this.position = position2 || "bottom"; + } + isHorizontal() { + const position2 = this.position; + return position2 === "top" || position2 === "bottom"; + } + getGlobalExtent(asc4) { + const ret = this.getExtent(); + ret[0] = this.toGlobalCoord(ret[0]); + ret[1] = this.toGlobalCoord(ret[1]); + asc4 && ret[0] > ret[1] && ret.reverse(); + return ret; + } + pointToData(point, clamp2) { + return this.coordToData(this.toLocalCoord(point[this.dim === "x" ? 0 : 1]), clamp2); + } + setCategorySortInfo(info) { + if (this.type !== "category") { + return false; + } + this.model.option.categorySortInfo = info; + this.scale.setSortInfo(info); + } +}; +var Axis2D_default = Axis2D; + +// src/coord/cartesian/cartesianAxisHelper.ts +function layout4(gridModel, axisModel, opt) { + opt = opt || {}; + const grid = gridModel.coordinateSystem; + const axis = axisModel.axis; + const layout18 = {}; + const otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0]; + const rawAxisPosition = axis.position; + const axisPosition = otherAxisOnZeroOf ? "onZero" : rawAxisPosition; + const axisDim = axis.dim; + const rect = grid.getRect(); + const rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; + const idx = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2}; + const axisOffset = axisModel.get("offset") || 0; + const posBound = axisDim === "x" ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset]; + if (otherAxisOnZeroOf) { + const onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); + posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); + } + layout18.position = [ + axisDim === "y" ? posBound[idx[axisPosition]] : rectBound[0], + axisDim === "x" ? posBound[idx[axisPosition]] : rectBound[3] + ]; + layout18.rotation = Math.PI / 2 * (axisDim === "x" ? 0 : 1); + const dirMap = {top: -1, bottom: 1, left: -1, right: 1}; + layout18.labelDirection = layout18.tickDirection = layout18.nameDirection = dirMap[rawAxisPosition]; + layout18.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0; + if (axisModel.get(["axisTick", "inside"])) { + layout18.tickDirection = -layout18.tickDirection; + } + if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) { + layout18.labelDirection = -layout18.labelDirection; + } + const labelRotate = axisModel.get(["axisLabel", "rotate"]); + layout18.labelRotate = axisPosition === "top" ? -labelRotate : labelRotate; + layout18.z2 = 1; + return layout18; +} +function isCartesian2DSeries(seriesModel) { + return seriesModel.get("coordinateSystem") === "cartesian2d"; +} +function findAxisModels(seriesModel) { + const axisModelMap = { + xAxisModel: null, + yAxisModel: null + }; + each(axisModelMap, function(v, key) { + const axisType = key.replace(/Model$/, ""); + const axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; + if (true) { + if (!axisModel) { + throw new Error(axisType + ' "' + retrieve3(seriesModel.get(axisType + "Index"), seriesModel.get(axisType + "Id"), 0) + '" not found'); + } + } + axisModelMap[key] = axisModel; + }); + return axisModelMap; +} + +// src/coord/axisAlignTicks.ts +var mathLog2 = Math.log; +function alignScaleTicks(scale4, axisModel, alignToScale) { + const intervalScaleProto2 = Interval_default.prototype; + const alignToTicks = intervalScaleProto2.getTicks.call(alignToScale); + const alignToNicedTicks = intervalScaleProto2.getTicks.call(alignToScale, true); + const alignToSplitNumber = alignToTicks.length - 1; + const alignToInterval = intervalScaleProto2.getInterval.call(alignToScale); + const scaleExtent = getScaleExtent(scale4, axisModel); + let rawExtent = scaleExtent.extent; + const isMinFixed = scaleExtent.fixMin; + const isMaxFixed = scaleExtent.fixMax; + if (scale4.type === "log") { + const logBase = mathLog2(scale4.base); + rawExtent = [mathLog2(rawExtent[0]) / logBase, mathLog2(rawExtent[1]) / logBase]; + } + scale4.setExtent(rawExtent[0], rawExtent[1]); + scale4.calcNiceExtent({ + splitNumber: alignToSplitNumber, + fixMin: isMinFixed, + fixMax: isMaxFixed + }); + const extent3 = intervalScaleProto2.getExtent.call(scale4); + if (isMinFixed) { + rawExtent[0] = extent3[0]; + } + if (isMaxFixed) { + rawExtent[1] = extent3[1]; + } + let interval = intervalScaleProto2.getInterval.call(scale4); + let min3 = rawExtent[0]; + let max3 = rawExtent[1]; + if (isMinFixed && isMaxFixed) { + interval = (max3 - min3) / alignToSplitNumber; + } else if (isMinFixed) { + max3 = rawExtent[0] + interval * alignToSplitNumber; + while (max3 < rawExtent[1] && isFinite(max3) && isFinite(rawExtent[1])) { + interval = increaseInterval(interval); + max3 = rawExtent[0] + interval * alignToSplitNumber; + } + } else if (isMaxFixed) { + min3 = rawExtent[1] - interval * alignToSplitNumber; + while (min3 > rawExtent[0] && isFinite(min3) && isFinite(rawExtent[0])) { + interval = increaseInterval(interval); + min3 = rawExtent[1] - interval * alignToSplitNumber; + } + } else { + const nicedSplitNumber = scale4.getTicks().length - 1; + if (nicedSplitNumber > alignToSplitNumber) { + interval = increaseInterval(interval); + } + const range = interval * alignToSplitNumber; + max3 = Math.ceil(rawExtent[1] / interval) * interval; + min3 = round(max3 - range); + if (min3 < 0 && rawExtent[0] >= 0) { + min3 = 0; + max3 = round(range); + } else if (max3 > 0 && rawExtent[1] <= 0) { + max3 = 0; + min3 = -round(range); + } + } + const t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval; + const t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval; + intervalScaleProto2.setExtent.call(scale4, min3 + interval * t0, max3 + interval * t1); + intervalScaleProto2.setInterval.call(scale4, interval); + if (t0 || t1) { + intervalScaleProto2.setNiceExtent.call(scale4, min3 + interval, max3 - interval); + } + if (true) { + const ticks = intervalScaleProto2.getTicks.call(scale4); + if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) { + warn(`The ticks may be not readable when set min: ${axisModel.get("min")}, max: ${axisModel.get("max")} and alignTicks: true`); + } + } +} + +// src/coord/cartesian/Grid.ts +var Grid2 = class { + constructor(gridModel, ecModel, api2) { + this.type = "grid"; + this._coordsMap = {}; + this._coordsList = []; + this._axesMap = {}; + this._axesList = []; + this.axisPointerEnabled = true; + this.dimensions = cartesian2DDimensions; + this._initCartesian(gridModel, ecModel, api2); + this.model = gridModel; + } + getRect() { + return this._rect; + } + update(ecModel, api2) { + const axesMap = this._axesMap; + this._updateScale(ecModel, this.model); + function updateAxisTicks(axes) { + let alignTo; + const axesIndices = keys(axes); + const len2 = axesIndices.length; + if (!len2) { + return; + } + const axisNeedsAlign = []; + for (let i = len2 - 1; i >= 0; i--) { + const idx = +axesIndices[i]; + const axis = axes[idx]; + const model = axis.model; + const scale4 = axis.scale; + if (isIntervalOrLogScale(scale4) && model.get("alignTicks") && model.get("interval") == null) { + axisNeedsAlign.push(axis); + } else { + niceScaleExtent(scale4, model); + if (isIntervalOrLogScale(scale4)) { + alignTo = axis; } - }, this); - return firstAxisModel; - }; - /** - * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel - */ - DataZoomModel.prototype.eachTargetAxis = function (callback, context) { - this._targetAxisInfoMap.each(function (axisInfo, axisDim) { - each(axisInfo.indexList, function (axisIndex) { - callback.call(context, axisDim, axisIndex); - }); - }); - }; - /** - * @return If not found, return null/undefined. - */ - DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) { - var axisModel = this.getAxisModel(axisDim, axisIndex); - if (axisModel) { - return axisModel.__dzAxisProxy; } - }; - /** - * @return If not found, return null/undefined. - */ - DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) { - if ("development" !== 'production') { - assert(axisDim && axisIndex != null); - } - var axisInfo = this._targetAxisInfoMap.get(axisDim); - if (axisInfo && axisInfo.indexMap[axisIndex]) { - return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + } + ; + if (axisNeedsAlign.length) { + if (!alignTo) { + alignTo = axisNeedsAlign.pop(); + niceScaleExtent(alignTo.scale, alignTo.model); } - }; - /** - * If not specified, set to undefined. - */ - DataZoomModel.prototype.setRawRange = function (opt) { - var thisOption = this.option; - var settledOption = this.settledOption; - each([['start', 'startValue'], ['end', 'endValue']], function (names) { - // Consider the pair : - // If one has value and the other one is `null/undefined`, we both set them - // to `settledOption`. This strategy enables the feature to clear the original - // value in `settledOption` to `null/undefined`. - // But if both of them are `null/undefined`, we do not set them to `settledOption` - // and keep `settledOption` with the original value. This strategy enables users to - // only set but not set when calling - // `dispatchAction`. - // The pair is treated in the same way. - if (opt[names[0]] != null || opt[names[1]] != null) { - thisOption[names[0]] = settledOption[names[0]] = opt[names[0]]; - thisOption[names[1]] = settledOption[names[1]] = opt[names[1]]; - } - }, this); - this._updateRangeUse(opt); - }; - DataZoomModel.prototype.setCalculatedRange = function (opt) { - var option = this.option; - each(['start', 'startValue', 'end', 'endValue'], function (name) { - option[name] = opt[name]; + each(axisNeedsAlign, (axis) => { + alignScaleTicks(axis.scale, axis.model, alignTo.scale); }); - }; - DataZoomModel.prototype.getPercentRange = function () { - var axisProxy = this.findRepresentativeAxisProxy(); - if (axisProxy) { - return axisProxy.getDataPercentWindow(); - } - }; - /** - * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0); - * - * @return [startValue, endValue] value can only be '-' or finite number. - */ - DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) { - if (axisDim == null && axisIndex == null) { - var axisProxy = this.findRepresentativeAxisProxy(); - if (axisProxy) { - return axisProxy.getDataValueWindow(); - } - } else { - return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow(); - } - }; - /** - * @param axisModel If axisModel given, find axisProxy - * corresponding to the axisModel - */ - DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) { - if (axisModel) { - return axisModel.__dzAxisProxy; - } - // Find the first hosted axisProxy - var firstProxy; - var axisDimList = this._targetAxisInfoMap.keys(); - for (var i = 0; i < axisDimList.length; i++) { - var axisDim = axisDimList[i]; - var axisInfo = this._targetAxisInfoMap.get(axisDim); - for (var j = 0; j < axisInfo.indexList.length; j++) { - var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]); - if (proxy.hostedBy(this)) { - return proxy; - } - if (!firstProxy) { - firstProxy = proxy; + } + } + updateAxisTicks(axesMap.x); + updateAxisTicks(axesMap.y); + const onZeroRecords = {}; + each(axesMap.x, function(xAxis) { + fixAxisOnZero(axesMap, "y", xAxis, onZeroRecords); + }); + each(axesMap.y, function(yAxis) { + fixAxisOnZero(axesMap, "x", yAxis, onZeroRecords); + }); + this.resize(this.model, api2); + } + resize(gridModel, api2, ignoreContainLabel) { + const boxLayoutParams = gridModel.getBoxLayoutParams(); + const isContainLabel = !ignoreContainLabel && gridModel.get("containLabel"); + const gridRect = getLayoutRect(boxLayoutParams, { + width: api2.getWidth(), + height: api2.getHeight() + }); + this._rect = gridRect; + const axesList = this._axesList; + adjustAxes(); + if (isContainLabel) { + each(axesList, function(axis) { + if (!axis.model.get(["axisLabel", "inside"])) { + const labelUnionRect = estimateLabelUnionRect(axis); + if (labelUnionRect) { + const dim = axis.isHorizontal() ? "height" : "width"; + const margin = axis.model.get(["axisLabel", "margin"]); + gridRect[dim] -= labelUnionRect[dim] + margin; + if (axis.position === "top") { + gridRect.y += labelUnionRect.height + margin; + } else if (axis.position === "left") { + gridRect.x += labelUnionRect.width + margin; } } } - // If no hosted proxy found, still need to return a proxy. - // This case always happens in toolbox dataZoom, where axes are all hosted by - // other dataZooms. - return firstProxy; - }; - DataZoomModel.prototype.getRangePropMode = function () { - return this._rangePropMode.slice(); - }; - DataZoomModel.prototype.getOrient = function () { - if ("development" !== 'production') { - // Should not be called before initialized. - assert(this._orient); - } - return this._orient; - }; - DataZoomModel.type = 'dataZoom'; - DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox']; - DataZoomModel.defaultOption = { - // zlevel: 0, - z: 4, - filterMode: 'filter', - start: 0, - end: 100 - }; - return DataZoomModel; - }(ComponentModel); - /** - * Retrieve those raw params from option, which will be cached separately, - * because they will be overwritten by normalized/calculated values in the main - * process. - */ - function retrieveRawOption(option) { - var ret = {}; - each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) { - option.hasOwnProperty(name) && (ret[name] = option[name]); }); - return ret; + adjustAxes(); } - - var SelectDataZoomModel = /** @class */function (_super) { - __extends(SelectDataZoomModel, _super); - function SelectDataZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SelectDataZoomModel.type; - return _this; - } - SelectDataZoomModel.type = 'dataZoom.select'; - return SelectDataZoomModel; - }(DataZoomModel); - - var DataZoomView = /** @class */function (_super) { - __extends(DataZoomView, _super); - function DataZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = DataZoomView.type; - return _this; - } - DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) { - this.dataZoomModel = dataZoomModel; - this.ecModel = ecModel; - this.api = api; - }; - DataZoomView.type = 'dataZoom'; - return DataZoomView; - }(ComponentView); - - var SelectDataZoomView = /** @class */function (_super) { - __extends(SelectDataZoomView, _super); - function SelectDataZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SelectDataZoomView.type; - return _this; - } - SelectDataZoomView.type = 'dataZoom.select'; - return SelectDataZoomView; - }(DataZoomView); - - var each$8 = each; - var asc$1 = asc; - /** - * Operate single axis. - * One axis can only operated by one axis operator. - * Different dataZoomModels may be defined to operate the same axis. - * (i.e. 'inside' data zoom and 'slider' data zoom components) - * So dataZoomModels share one axisProxy in that case. - */ - var AxisProxy = /** @class */function () { - function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) { - this._dimName = dimName; - this._axisIndex = axisIndex; - this.ecModel = ecModel; - this._dataZoomModel = dataZoomModel; - // /** - // * @readOnly - // * @private - // */ - // this.hasSeriesStacked; - } - /** - * Whether the axisProxy is hosted by dataZoomModel. - */ - AxisProxy.prototype.hostedBy = function (dataZoomModel) { - return this._dataZoomModel === dataZoomModel; - }; - /** - * @return Value can only be NaN or finite value. - */ - AxisProxy.prototype.getDataValueWindow = function () { - return this._valueWindow.slice(); - }; - /** - * @return {Array.} - */ - AxisProxy.prototype.getDataPercentWindow = function () { - return this._percentWindow.slice(); - }; - AxisProxy.prototype.getTargetSeriesModels = function () { - var seriesModels = []; - this.ecModel.eachSeries(function (seriesModel) { - if (isCoordSupported(seriesModel)) { - var axisMainType = getAxisMainType(this._dimName); - var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0]; - if (axisModel && this._axisIndex === axisModel.componentIndex) { - seriesModels.push(seriesModel); - } - } - }, this); - return seriesModels; - }; - AxisProxy.prototype.getAxisModel = function () { - return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex); - }; - AxisProxy.prototype.getMinMaxSpan = function () { - return clone(this._minMaxSpan); - }; - /** - * Only calculate by given range and this._dataExtent, do not change anything. - */ - AxisProxy.prototype.calculateDataWindow = function (opt) { - var dataExtent = this._dataExtent; - var axisModel = this.getAxisModel(); - var scale = axisModel.axis.scale; - var rangePropMode = this._dataZoomModel.getRangePropMode(); - var percentExtent = [0, 100]; - var percentWindow = []; - var valueWindow = []; - var hasPropModeValue; - each$8(['start', 'end'], function (prop, idx) { - var boundPercent = opt[prop]; - var boundValue = opt[prop + 'Value']; - // Notice: dataZoom is based either on `percentProp` ('start', 'end') or - // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent - // but not min/max of axis, which will be calculated by data window then). - // The former one is suitable for cases that a dataZoom component controls multiple - // axes with different unit or extent, and the latter one is suitable for accurate - // zoom by pixel (e.g., in dataZoomSelect). - // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated - // only when setOption or dispatchAction, otherwise it remains its original value. - // (Why not only record `percentProp` and always map to `valueProp`? Because - // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original - // `valueProp`. consider two axes constrolled by one dataZoom. They have different - // data extent. All of values that are overflow the `dataExtent` will be calculated - // to percent '100%'). - if (rangePropMode[idx] === 'percent') { - boundPercent == null && (boundPercent = percentExtent[idx]); - // Use scale.parse to math round for category or time axis. - boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent)); - } else { - hasPropModeValue = true; - boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); - // Calculating `percent` from `value` may be not accurate, because - // This calculation can not be inversed, because all of values that - // are overflow the `dataExtent` will be calculated to percent '100%' - boundPercent = linearMap(boundValue, dataExtent, percentExtent); - } - // valueWindow[idx] = round(boundValue); - // percentWindow[idx] = round(boundPercent); - // fallback to extent start/end when parsed value or percent is invalid - valueWindow[idx] = boundValue == null || isNaN(boundValue) ? dataExtent[idx] : boundValue; - percentWindow[idx] = boundPercent == null || isNaN(boundPercent) ? percentExtent[idx] : boundPercent; - }); - asc$1(valueWindow); - asc$1(percentWindow); - // The windows from user calling of `dispatchAction` might be out of the extent, - // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window - // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint, - // where API is able to initialize/modify the window size even though `zoomLock` - // specified. - var spans = this._minMaxSpan; - hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true); - function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) { - var suffix = toValue ? 'Span' : 'ValueSpan'; - sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]); - for (var i = 0; i < 2; i++) { - toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true); - toValue && (toWindow[i] = scale.parse(toWindow[i])); - } - } - return { - valueWindow: valueWindow, - percentWindow: percentWindow - }; - }; - /** - * Notice: reset should not be called before series.restoreData() is called, - * so it is recommended to be called in "process stage" but not "model init - * stage". - */ - AxisProxy.prototype.reset = function (dataZoomModel) { - if (dataZoomModel !== this._dataZoomModel) { - return; - } - var targetSeries = this.getTargetSeriesModels(); - // Culculate data window and data extent, and record them. - this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); - // `calculateDataWindow` uses min/maxSpan. - this._updateMinMaxSpan(); - var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption); - this._valueWindow = dataWindow.valueWindow; - this._percentWindow = dataWindow.percentWindow; - // Update axis setting then. - this._setAxisModel(); - }; - AxisProxy.prototype.filterData = function (dataZoomModel, api) { - if (dataZoomModel !== this._dataZoomModel) { - return; - } - var axisDim = this._dimName; - var seriesModels = this.getTargetSeriesModels(); - var filterMode = dataZoomModel.get('filterMode'); - var valueWindow = this._valueWindow; - if (filterMode === 'none') { + each(this._coordsList, function(coord) { + coord.calcAffineTransform(); + }); + function adjustAxes() { + each(axesList, function(axis) { + const isHorizontal = axis.isHorizontal(); + const extent3 = isHorizontal ? [0, gridRect.width] : [0, gridRect.height]; + const idx = axis.inverse ? 1 : 0; + axis.setExtent(extent3[idx], extent3[1 - idx]); + updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y); + }); + } + } + getAxis(dim, axisIndex) { + const axesMapOnDim = this._axesMap[dim]; + if (axesMapOnDim != null) { + return axesMapOnDim[axisIndex || 0]; + } + } + getAxes() { + return this._axesList.slice(); + } + getCartesian(xAxisIndex, yAxisIndex) { + if (xAxisIndex != null && yAxisIndex != null) { + const key = "x" + xAxisIndex + "y" + yAxisIndex; + return this._coordsMap[key]; + } + if (isObject(xAxisIndex)) { + yAxisIndex = xAxisIndex.yAxisIndex; + xAxisIndex = xAxisIndex.xAxisIndex; + } + for (let i = 0, coordList = this._coordsList; i < coordList.length; i++) { + if (coordList[i].getAxis("x").index === xAxisIndex || coordList[i].getAxis("y").index === yAxisIndex) { + return coordList[i]; + } + } + } + getCartesians() { + return this._coordsList.slice(); + } + convertToPixel(ecModel, finder, value) { + const target = this._findConvertTarget(finder); + return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null; + } + convertFromPixel(ecModel, finder, value) { + const target = this._findConvertTarget(finder); + return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null; + } + _findConvertTarget(finder) { + const seriesModel = finder.seriesModel; + const xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents("xAxis", SINGLE_REFERRING).models[0]; + const yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents("yAxis", SINGLE_REFERRING).models[0]; + const gridModel = finder.gridModel; + const coordsList = this._coordsList; + let cartesian; + let axis; + if (seriesModel) { + cartesian = seriesModel.coordinateSystem; + indexOf(coordsList, cartesian) < 0 && (cartesian = null); + } else if (xAxisModel && yAxisModel) { + cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); + } else if (xAxisModel) { + axis = this.getAxis("x", xAxisModel.componentIndex); + } else if (yAxisModel) { + axis = this.getAxis("y", yAxisModel.componentIndex); + } else if (gridModel) { + const grid = gridModel.coordinateSystem; + if (grid === this) { + cartesian = this._coordsList[0]; + } + } + return {cartesian, axis}; + } + containPoint(point) { + const coord = this._coordsList[0]; + if (coord) { + return coord.containPoint(point); + } + } + _initCartesian(gridModel, ecModel, api2) { + const grid = this; + const axisPositionUsed = { + left: false, + right: false, + top: false, + bottom: false + }; + const axesMap = { + x: {}, + y: {} + }; + const axesCount = { + x: 0, + y: 0 + }; + ecModel.eachComponent("xAxis", createAxisCreator("x"), this); + ecModel.eachComponent("yAxis", createAxisCreator("y"), this); + if (!axesCount.x || !axesCount.y) { + this._axesMap = {}; + this._axesList = []; + return; + } + this._axesMap = axesMap; + each(axesMap.x, (xAxis, xAxisIndex) => { + each(axesMap.y, (yAxis, yAxisIndex) => { + const key = "x" + xAxisIndex + "y" + yAxisIndex; + const cartesian = new Cartesian2D_default(key); + cartesian.master = this; + cartesian.model = gridModel; + this._coordsMap[key] = cartesian; + this._coordsList.push(cartesian); + cartesian.addAxis(xAxis); + cartesian.addAxis(yAxis); + }); + }); + function createAxisCreator(dimName) { + return function(axisModel, idx) { + if (!isAxisUsedInTheGrid(axisModel, gridModel)) { return; } - // FIXME - // Toolbox may has dataZoom injected. And if there are stacked bar chart - // with NaN data, NaN will be filtered and stack will be wrong. - // So we need to force the mode to be set empty. - // In fect, it is not a big deal that do not support filterMode-'filter' - // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis - // selection" some day, which might need "adapt to data extent on the - // otherAxis", which is disabled by filterMode-'empty'. - // But currently, stack has been fixed to based on value but not index, - // so this is not an issue any more. - // let otherAxisModel = this.getOtherAxisModel(); - // if (dataZoomModel.get('$fromToolbox') - // && otherAxisModel - // && otherAxisModel.hasSeriesStacked - // ) { - // filterMode = 'empty'; - // } - // TODO - // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet. - each$8(seriesModels, function (seriesModel) { - var seriesData = seriesModel.getData(); - var dataDims = seriesData.mapDimensionsAll(axisDim); - if (!dataDims.length) { - return; + let axisPosition = axisModel.get("position"); + if (dimName === "x") { + if (axisPosition !== "top" && axisPosition !== "bottom") { + axisPosition = axisPositionUsed.bottom ? "top" : "bottom"; } - if (filterMode === 'weakFilter') { - var store_1 = seriesData.getStore(); - var dataDimIndices_1 = map(dataDims, function (dim) { - return seriesData.getDimensionIndex(dim); - }, seriesData); - seriesData.filterSelf(function (dataIndex) { - var leftOut; - var rightOut; - var hasValue; - for (var i = 0; i < dataDims.length; i++) { - var value = store_1.get(dataDimIndices_1[i], dataIndex); - var thisHasValue = !isNaN(value); - var thisLeftOut = value < valueWindow[0]; - var thisRightOut = value > valueWindow[1]; - if (thisHasValue && !thisLeftOut && !thisRightOut) { - return true; - } - thisHasValue && (hasValue = true); - thisLeftOut && (leftOut = true); - thisRightOut && (rightOut = true); - } - // If both left out and right out, do not filter. - return hasValue && leftOut && rightOut; - }); - } else { - each$8(dataDims, function (dim) { - if (filterMode === 'empty') { - seriesModel.setData(seriesData = seriesData.map(dim, function (value) { - return !isInWindow(value) ? NaN : value; - })); - } else { - var range = {}; - range[dim] = valueWindow; - // console.time('select'); - seriesData.selectRange(range); - // console.timeEnd('select'); - } - }); + } else { + if (axisPosition !== "left" && axisPosition !== "right") { + axisPosition = axisPositionUsed.left ? "right" : "left"; } - - each$8(dataDims, function (dim) { - seriesData.setApproximateExtent(valueWindow, dim); - }); - }); - function isInWindow(value) { - return value >= valueWindow[0] && value <= valueWindow[1]; } + axisPositionUsed[axisPosition] = true; + const axis = new Axis2D_default(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get("type"), axisPosition); + const isCategory2 = axis.type === "category"; + axis.onBand = isCategory2 && axisModel.get("boundaryGap"); + axis.inverse = axisModel.get("inverse"); + axisModel.axis = axis; + axis.model = axisModel; + axis.grid = grid; + axis.index = idx; + grid._axesList.push(axis); + axesMap[dimName][idx] = axis; + axesCount[dimName]++; }; - AxisProxy.prototype._updateMinMaxSpan = function () { - var minMaxSpan = this._minMaxSpan = {}; - var dataZoomModel = this._dataZoomModel; - var dataExtent = this._dataExtent; - each$8(['min', 'max'], function (minMax) { - var percentSpan = dataZoomModel.get(minMax + 'Span'); - var valueSpan = dataZoomModel.get(minMax + 'ValueSpan'); - valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan)); - // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan - if (valueSpan != null) { - percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true); - } else if (percentSpan != null) { - valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0]; - } - minMaxSpan[minMax + 'Span'] = percentSpan; - minMaxSpan[minMax + 'ValueSpan'] = valueSpan; - }, this); - }; - AxisProxy.prototype._setAxisModel = function () { - var axisModel = this.getAxisModel(); - var percentWindow = this._percentWindow; - var valueWindow = this._valueWindow; - if (!percentWindow) { + } + } + _updateScale(ecModel, gridModel) { + each(this._axesList, function(axis) { + axis.scale.setExtent(Infinity, -Infinity); + if (axis.type === "category") { + const categorySortInfo = axis.model.get("categorySortInfo"); + axis.scale.setSortInfo(categorySortInfo); + } + }); + ecModel.eachSeries(function(seriesModel) { + if (isCartesian2DSeries(seriesModel)) { + const axesModelMap = findAxisModels(seriesModel); + const xAxisModel = axesModelMap.xAxisModel; + const yAxisModel = axesModelMap.yAxisModel; + if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) { return; } - // [0, 500]: arbitrary value, guess axis extent. - var precision = getPixelPrecision(valueWindow, [0, 500]); - precision = Math.min(precision, 20); - // For value axis, if min/max/scale are not set, we just use the extent obtained - // by series data, which may be a little different from the extent calculated by - // `axisHelper.getScaleExtent`. But the different just affects the experience a - // little when zooming. So it will not be fixed until some users require it strongly. - var rawExtentInfo = axisModel.axis.scale.rawExtentInfo; - if (percentWindow[0] !== 0) { - rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision)); - } - if (percentWindow[1] !== 100) { - rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision)); - } - rawExtentInfo.freeze(); - }; - return AxisProxy; - }(); - function calculateDataExtent(axisProxy, axisDim, seriesModels) { - var dataExtent = [Infinity, -Infinity]; - each$8(seriesModels, function (seriesModel) { - unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim); + const cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); + const data = seriesModel.getData(); + const xAxis = cartesian.getAxis("x"); + const yAxis = cartesian.getAxis("y"); + unionExtent(data, xAxis); + unionExtent(data, yAxis); + } + }, this); + function unionExtent(data, axis) { + each(getDataDimensionsOnAxis(data, axis.dim), function(dim) { + axis.scale.unionExtentFromData(data, dim); }); - // It is important to get "consistent" extent when more then one axes is - // controlled by a `dataZoom`, otherwise those axes will not be synchronized - // when zooming. But it is difficult to know what is "consistent", considering - // axes have different type or even different meanings (For example, two - // time axes are used to compare data of the same date in different years). - // So basically dataZoom just obtains extent by series.data (in category axis - // extent can be obtained from axis.data). - // Nevertheless, user can set min/max/scale on axes to make extent of axes - // consistent. - var axisModel = axisProxy.getAxisModel(); - var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate(); - return [rawExtentResult.min, rawExtentResult.max]; - } - - var dataZoomProcessor = { - // `dataZoomProcessor` will only be performed in needed series. Consider if - // there is a line series and a pie series, it is better not to update the - // line series if only pie series is needed to be updated. - getTargetSeries: function (ecModel) { - function eachAxisModel(cb) { - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); - cb(axisDim, axisIndex, axisModel, dataZoomModel); - }); - }); + } + } + getTooltipAxes(dim) { + const baseAxes = []; + const otherAxes = []; + each(this.getCartesians(), function(cartesian) { + const baseAxis = dim != null && dim !== "auto" ? cartesian.getAxis(dim) : cartesian.getBaseAxis(); + const otherAxis = cartesian.getOtherAxis(baseAxis); + indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis); + indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis); + }); + return {baseAxes, otherAxes}; + } + static create(ecModel, api2) { + const grids = []; + ecModel.eachComponent("grid", function(gridModel, idx) { + const grid = new Grid2(gridModel, ecModel, api2); + grid.name = "grid_" + idx; + grid.resize(gridModel, api2, true); + gridModel.coordinateSystem = grid; + grids.push(grid); + }); + ecModel.eachSeries(function(seriesModel) { + if (!isCartesian2DSeries(seriesModel)) { + return; + } + const axesModelMap = findAxisModels(seriesModel); + const xAxisModel = axesModelMap.xAxisModel; + const yAxisModel = axesModelMap.yAxisModel; + const gridModel = xAxisModel.getCoordSysModel(); + if (true) { + if (!gridModel) { + throw new Error('Grid "' + retrieve3(xAxisModel.get("gridIndex"), xAxisModel.get("gridId"), 0) + '" not found'); } - // FIXME: it brings side-effect to `getTargetSeries`. - // Prepare axis proxies. - eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) { - // dispose all last axis proxy, in case that some axis are deleted. - axisModel.__dzAxisProxy = null; - }); - var proxyList = []; - eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) { - // Different dataZooms may constrol the same axis. In that case, - // an axisProxy serves both of them. - if (!axisModel.__dzAxisProxy) { - // Use the first dataZoomModel as the main model of axisProxy. - axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel); - proxyList.push(axisModel.__dzAxisProxy); - } - }); - var seriesModelMap = createHashMap(); - each(proxyList, function (axisProxy) { - each(axisProxy.getTargetSeriesModels(), function (seriesModel) { - seriesModelMap.set(seriesModel.uid, seriesModel); - }); - }); - return seriesModelMap; - }, - // Consider appendData, where filter should be performed. Because data process is - // in block mode currently, it is not need to worry about that the overallProgress - // execute every frame. - overallReset: function (ecModel, api) { - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - // We calculate window and reset axis here but not in model - // init stage and not after action dispatch handler, because - // reset should be called after seriesData.restoreData. - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel); - }); - // Caution: data zoom filtering is order sensitive when using - // percent range and no min/max/scale set on axis. - // For example, we have dataZoom definition: - // [ - // {xAxisIndex: 0, start: 30, end: 70}, - // {yAxisIndex: 0, start: 20, end: 80} - // ] - // In this case, [20, 80] of y-dataZoom should be based on data - // that have filtered by x-dataZoom using range of [30, 70], - // but should not be based on full raw data. Thus sliding - // x-dataZoom will change both ranges of xAxis and yAxis, - // while sliding y-dataZoom will only change the range of yAxis. - // So we should filter x-axis after reset x-axis immediately, - // and then reset y-axis and filter y-axis. - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api); - }); - }); - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - // Fullfill all of the range props so that user - // is able to get them from chart.getOption(). - var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); - if (axisProxy) { - var percentRange = axisProxy.getDataPercentWindow(); - var valueRange = axisProxy.getDataValueWindow(); - dataZoomModel.setCalculatedRange({ - start: percentRange[0], - end: percentRange[1], - startValue: valueRange[0], - endValue: valueRange[1] - }); - } - }); + if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) { + throw new Error("xAxis and yAxis must use the same grid"); + } + } + const grid = gridModel.coordinateSystem; + seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); + }); + return grids; + } +}; +var Grid = Grid2; +Grid.dimensions = cartesian2DDimensions; +function isAxisUsedInTheGrid(axisModel, gridModel) { + return axisModel.getCoordSysModel() === gridModel; +} +function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) { + axis.getAxesOnZeroOf = function() { + return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : []; + }; + const otherAxes = axesMap[otherAxisDim]; + let otherAxisOnZeroOf; + const axisModel = axis.model; + const onZero = axisModel.get(["axisLine", "onZero"]); + const onZeroAxisIndex = axisModel.get(["axisLine", "onZeroAxisIndex"]); + if (!onZero) { + return; + } + if (onZeroAxisIndex != null) { + if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) { + otherAxisOnZeroOf = otherAxes[onZeroAxisIndex]; + } + } else { + for (const idx in otherAxes) { + if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) { + otherAxisOnZeroOf = otherAxes[idx]; + break; + } + } + } + if (otherAxisOnZeroOf) { + onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true; + } + function getOnZeroRecordKey(axis2) { + return axis2.dim + "_" + axis2.index; + } +} +function canOnZeroToAxis(axis) { + return axis && axis.type !== "category" && axis.type !== "time" && ifAxisCrossZero(axis); +} +function updateAxisTransform(axis, coordBase) { + const axisExtent = axis.getExtent(); + const axisExtentSum = axisExtent[0] + axisExtent[1]; + axis.toGlobalCoord = axis.dim === "x" ? function(coord) { + return coord + coordBase; + } : function(coord) { + return axisExtentSum - coord + coordBase; + }; + axis.toLocalCoord = axis.dim === "x" ? function(coord) { + return coord - coordBase; + } : function(coord) { + return axisExtentSum - coord + coordBase; + }; +} +var Grid_default = Grid; + +// src/component/axis/AxisBuilder.ts +var PI7 = Math.PI; +var AxisBuilder = class { + constructor(axisModel, opt) { + this.group = new Group_default(); + this.opt = opt; + this.axisModel = axisModel; + defaults(opt, { + labelOffset: 0, + nameDirection: 1, + tickDirection: 1, + labelDirection: 1, + silent: true, + handleAutoShown: () => true + }); + const transformGroup = new Group_default({ + x: opt.position[0], + y: opt.position[1], + rotation: opt.rotation + }); + transformGroup.updateTransform(); + this._transformGroup = transformGroup; + } + hasBuilder(name) { + return !!builders[name]; + } + add(name) { + builders[name](this.opt, this.axisModel, this.group, this._transformGroup); + } + getGroup() { + return this.group; + } + static innerTextLayout(axisRotation, textRotation, direction) { + const rotationDiff = remRadian(textRotation - axisRotation); + let textAlign; + let textVerticalAlign; + if (isRadianAroundZero(rotationDiff)) { + textVerticalAlign = direction > 0 ? "top" : "bottom"; + textAlign = "center"; + } else if (isRadianAroundZero(rotationDiff - PI7)) { + textVerticalAlign = direction > 0 ? "bottom" : "top"; + textAlign = "center"; + } else { + textVerticalAlign = "middle"; + if (rotationDiff > 0 && rotationDiff < PI7) { + textAlign = direction > 0 ? "right" : "left"; + } else { + textAlign = direction > 0 ? "left" : "right"; } + } + return { + rotation: rotationDiff, + textAlign, + textVerticalAlign }; - - function installDataZoomAction(registers) { - registers.registerAction('dataZoom', function (payload, ecModel) { - var effectedModels = findEffectedDataZooms(ecModel, payload); - each(effectedModels, function (dataZoomModel) { - dataZoomModel.setRawRange({ - start: payload.start, - end: payload.end, - startValue: payload.startValue, - endValue: payload.endValue + } + static makeAxisEventDataBase(axisModel) { + const eventData = { + componentType: axisModel.mainType, + componentIndex: axisModel.componentIndex + }; + eventData[axisModel.mainType + "Index"] = axisModel.componentIndex; + return eventData; + } + static isLabelSilent(axisModel) { + const tooltipOpt = axisModel.get("tooltip"); + return axisModel.get("silent") || !(axisModel.get("triggerEvent") || tooltipOpt && tooltipOpt.show); + } +}; +var builders = { + axisLine(opt, axisModel, group, transformGroup) { + let shown = axisModel.get(["axisLine", "show"]); + if (shown === "auto" && opt.handleAutoShown) { + shown = opt.handleAutoShown("axisLine"); + } + if (!shown) { + return; + } + const extent3 = axisModel.axis.getExtent(); + const matrix13 = transformGroup.transform; + const pt12 = [extent3[0], 0]; + const pt22 = [extent3[1], 0]; + const inverse = pt12[0] > pt22[0]; + if (matrix13) { + applyTransform(pt12, pt12, matrix13); + applyTransform(pt22, pt22, matrix13); + } + const lineStyle = extend({ + lineCap: "round" + }, axisModel.getModel(["axisLine", "lineStyle"]).getLineStyle()); + const line2 = new Line_default({ + shape: { + x1: pt12[0], + y1: pt12[1], + x2: pt22[0], + y2: pt22[1] + }, + style: lineStyle, + strokeContainThreshold: opt.strokeContainThreshold || 5, + silent: true, + z2: 1 + }); + subPixelOptimizeLine2(line2.shape, line2.style.lineWidth); + line2.anid = "line"; + group.add(line2); + let arrows = axisModel.get(["axisLine", "symbol"]); + if (arrows != null) { + let arrowSize = axisModel.get(["axisLine", "symbolSize"]); + if (isString(arrows)) { + arrows = [arrows, arrows]; + } + if (isString(arrowSize) || isNumber(arrowSize)) { + arrowSize = [arrowSize, arrowSize]; + } + const arrowOffset = normalizeSymbolOffset(axisModel.get(["axisLine", "symbolOffset"]) || 0, arrowSize); + const symbolWidth = arrowSize[0]; + const symbolHeight = arrowSize[1]; + each([{ + rotate: opt.rotation + Math.PI / 2, + offset: arrowOffset[0], + r: 0 + }, { + rotate: opt.rotation - Math.PI / 2, + offset: arrowOffset[1], + r: Math.sqrt((pt12[0] - pt22[0]) * (pt12[0] - pt22[0]) + (pt12[1] - pt22[1]) * (pt12[1] - pt22[1])) + }], function(point, index) { + if (arrows[index] !== "none" && arrows[index] != null) { + const symbol = createSymbol(arrows[index], -symbolWidth / 2, -symbolHeight / 2, symbolWidth, symbolHeight, lineStyle.stroke, true); + const r = point.r + point.offset; + const pt = inverse ? pt22 : pt12; + symbol.attr({ + rotation: point.rotate, + x: pt[0] + r * Math.cos(opt.rotation), + y: pt[1] - r * Math.sin(opt.rotation), + silent: true, + z2: 11 }); - }); + group.add(symbol); + } }); } - - var installed = false; - function installCommon(registers) { - if (installed) { + }, + axisTickLabel(opt, axisModel, group, transformGroup) { + const ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt); + const labelEls = buildAxisLabel(group, transformGroup, axisModel, opt); + fixMinMaxLabelShow(axisModel, labelEls, ticksEls); + buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection); + if (axisModel.get(["axisLabel", "hideOverlap"])) { + const labelList = prepareLayoutList(map(labelEls, (label) => ({ + label, + priority: label.z2, + defaultAttr: { + ignore: label.ignore + } + }))); + hideOverlap(labelList); + } + }, + axisName(opt, axisModel, group, transformGroup) { + const name = retrieve(opt.axisName, axisModel.get("name")); + if (!name) { + return; + } + const nameLocation = axisModel.get("nameLocation"); + const nameDirection = opt.nameDirection; + const textStyleModel = axisModel.getModel("nameTextStyle"); + const gap = axisModel.get("nameGap") || 0; + const extent3 = axisModel.axis.getExtent(); + const gapSignal = extent3[0] > extent3[1] ? -1 : 1; + const pos = [ + nameLocation === "start" ? extent3[0] - gapSignal * gap : nameLocation === "end" ? extent3[1] + gapSignal * gap : (extent3[0] + extent3[1]) / 2, + isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0 + ]; + let labelLayout2; + let nameRotation = axisModel.get("nameRotate"); + if (nameRotation != null) { + nameRotation = nameRotation * PI7 / 180; + } + let axisNameAvailableWidth; + if (isNameLocationCenter(nameLocation)) { + labelLayout2 = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, nameDirection); + } else { + labelLayout2 = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent3); + axisNameAvailableWidth = opt.axisNameAvailableWidth; + if (axisNameAvailableWidth != null) { + axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout2.rotation)); + !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null); + } + } + const textFont = textStyleModel.getFont(); + const truncateOpt = axisModel.get("nameTruncate", true) || {}; + const ellipsis = truncateOpt.ellipsis; + const maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth); + const textEl = new Text_default({ + x: pos[0], + y: pos[1], + rotation: labelLayout2.rotation, + silent: AxisBuilder.isLabelSilent(axisModel), + style: createTextStyle(textStyleModel, { + text: name, + font: textFont, + overflow: "truncate", + width: maxWidth, + ellipsis, + fill: textStyleModel.getTextColor() || axisModel.get(["axisLine", "lineStyle", "color"]), + align: textStyleModel.get("align") || labelLayout2.textAlign, + verticalAlign: textStyleModel.get("verticalAlign") || labelLayout2.textVerticalAlign + }), + z2: 1 + }); + setTooltipConfig({ + el: textEl, + componentModel: axisModel, + itemName: name + }); + textEl.__fullText = name; + textEl.anid = "name"; + if (axisModel.get("triggerEvent")) { + const eventData = AxisBuilder.makeAxisEventDataBase(axisModel); + eventData.targetType = "axisName"; + eventData.name = name; + getECData(textEl).eventData = eventData; + } + transformGroup.add(textEl); + textEl.updateTransform(); + group.add(textEl); + textEl.decomposeTransform(); + } +}; +function endTextLayout(rotation, textPosition, textRotate, extent3) { + const rotationDiff = remRadian(textRotate - rotation); + let textAlign; + let textVerticalAlign; + const inverse = extent3[0] > extent3[1]; + const onLeft = textPosition === "start" && !inverse || textPosition !== "start" && inverse; + if (isRadianAroundZero(rotationDiff - PI7 / 2)) { + textVerticalAlign = onLeft ? "bottom" : "top"; + textAlign = "center"; + } else if (isRadianAroundZero(rotationDiff - PI7 * 1.5)) { + textVerticalAlign = onLeft ? "top" : "bottom"; + textAlign = "center"; + } else { + textVerticalAlign = "middle"; + if (rotationDiff < PI7 * 1.5 && rotationDiff > PI7 / 2) { + textAlign = onLeft ? "left" : "right"; + } else { + textAlign = onLeft ? "right" : "left"; + } + } + return { + rotation: rotationDiff, + textAlign, + textVerticalAlign + }; +} +function fixMinMaxLabelShow(axisModel, labelEls, tickEls) { + if (shouldShowAllLabels(axisModel.axis)) { + return; + } + const showMinLabel = axisModel.get(["axisLabel", "showMinLabel"]); + const showMaxLabel = axisModel.get(["axisLabel", "showMaxLabel"]); + labelEls = labelEls || []; + tickEls = tickEls || []; + const firstLabel = labelEls[0]; + const nextLabel = labelEls[1]; + const lastLabel = labelEls[labelEls.length - 1]; + const prevLabel = labelEls[labelEls.length - 2]; + const firstTick = tickEls[0]; + const nextTick = tickEls[1]; + const lastTick = tickEls[tickEls.length - 1]; + const prevTick = tickEls[tickEls.length - 2]; + if (showMinLabel === false) { + ignoreEl(firstLabel); + ignoreEl(firstTick); + } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) { + if (showMinLabel) { + ignoreEl(nextLabel); + ignoreEl(nextTick); + } else { + ignoreEl(firstLabel); + ignoreEl(firstTick); + } + } + if (showMaxLabel === false) { + ignoreEl(lastLabel); + ignoreEl(lastTick); + } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) { + if (showMaxLabel) { + ignoreEl(prevLabel); + ignoreEl(prevTick); + } else { + ignoreEl(lastLabel); + ignoreEl(lastTick); + } + } +} +function ignoreEl(el) { + el && (el.ignore = true); +} +function isTwoLabelOverlapped(current, next) { + const firstRect = current && current.getBoundingRect().clone(); + const nextRect = next && next.getBoundingRect().clone(); + if (!firstRect || !nextRect) { + return; + } + const mRotationBack = identity([]); + rotate(mRotationBack, mRotationBack, -current.rotation); + firstRect.applyTransform(mul2([], mRotationBack, current.getLocalTransform())); + nextRect.applyTransform(mul2([], mRotationBack, next.getLocalTransform())); + return firstRect.intersect(nextRect); +} +function isNameLocationCenter(nameLocation) { + return nameLocation === "middle" || nameLocation === "center"; +} +function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) { + const tickEls = []; + const pt12 = []; + const pt22 = []; + for (let i = 0; i < ticksCoords.length; i++) { + const tickCoord = ticksCoords[i].coord; + pt12[0] = tickCoord; + pt12[1] = 0; + pt22[0] = tickCoord; + pt22[1] = tickEndCoord; + if (tickTransform) { + applyTransform(pt12, pt12, tickTransform); + applyTransform(pt22, pt22, tickTransform); + } + const tickEl = new Line_default({ + shape: { + x1: pt12[0], + y1: pt12[1], + x2: pt22[0], + y2: pt22[1] + }, + style: tickLineStyle, + z2: 2, + autoBatch: true, + silent: true + }); + subPixelOptimizeLine2(tickEl.shape, tickEl.style.lineWidth); + tickEl.anid = anidPrefix + "_" + ticksCoords[i].tickValue; + tickEls.push(tickEl); + } + return tickEls; +} +function buildAxisMajorTicks(group, transformGroup, axisModel, opt) { + const axis = axisModel.axis; + const tickModel = axisModel.getModel("axisTick"); + let shown = tickModel.get("show"); + if (shown === "auto" && opt.handleAutoShown) { + shown = opt.handleAutoShown("axisTick"); + } + if (!shown || axis.scale.isBlank()) { + return; + } + const lineStyleModel = tickModel.getModel("lineStyle"); + const tickEndCoord = opt.tickDirection * tickModel.get("length"); + const ticksCoords = axis.getTicksCoords(); + const ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), { + stroke: axisModel.get(["axisLine", "lineStyle", "color"]) + }), "ticks"); + for (let i = 0; i < ticksEls.length; i++) { + group.add(ticksEls[i]); + } + return ticksEls; +} +function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) { + const axis = axisModel.axis; + const minorTickModel = axisModel.getModel("minorTick"); + if (!minorTickModel.get("show") || axis.scale.isBlank()) { + return; + } + const minorTicksCoords = axis.getMinorTicksCoords(); + if (!minorTicksCoords.length) { + return; + } + const lineStyleModel = minorTickModel.getModel("lineStyle"); + const tickEndCoord = tickDirection * minorTickModel.get("length"); + const minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel("axisTick").getLineStyle(), { + stroke: axisModel.get(["axisLine", "lineStyle", "color"]) + })); + for (let i = 0; i < minorTicksCoords.length; i++) { + const minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, "minorticks_" + i); + for (let k = 0; k < minorTicksEls.length; k++) { + group.add(minorTicksEls[k]); + } + } +} +function buildAxisLabel(group, transformGroup, axisModel, opt) { + const axis = axisModel.axis; + const show = retrieve(opt.axisLabelShow, axisModel.get(["axisLabel", "show"])); + if (!show || axis.scale.isBlank()) { + return; + } + const labelModel = axisModel.getModel("axisLabel"); + const labelMargin = labelModel.get("margin"); + const labels = axis.getViewLabels(); + const labelRotation = (retrieve(opt.labelRotate, labelModel.get("rotate")) || 0) * PI7 / 180; + const labelLayout2 = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection); + const rawCategoryData = axisModel.getCategories && axisModel.getCategories(true); + const labelEls = []; + const silent = AxisBuilder.isLabelSilent(axisModel); + const triggerEvent = axisModel.get("triggerEvent"); + each(labels, function(labelItem, index) { + const tickValue = axis.scale.type === "ordinal" ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; + const formattedLabel = labelItem.formattedLabel; + const rawLabel = labelItem.rawLabel; + let itemLabelModel = labelModel; + if (rawCategoryData && rawCategoryData[tickValue]) { + const rawCategoryItem = rawCategoryData[tickValue]; + if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { + itemLabelModel = new Model_default(rawCategoryItem.textStyle, labelModel, axisModel.ecModel); + } + } + const textColor = itemLabelModel.getTextColor() || axisModel.get(["axisLine", "lineStyle", "color"]); + const tickCoord = axis.dataToCoord(tickValue); + const align = itemLabelModel.getShallow("align", true) || labelLayout2.textAlign; + const alignMin = retrieve2(itemLabelModel.getShallow("alignMinLabel", true), align); + const alignMax = retrieve2(itemLabelModel.getShallow("alignMaxLabel", true), align); + const verticalAlign = itemLabelModel.getShallow("verticalAlign", true) || itemLabelModel.getShallow("baseline", true) || labelLayout2.textVerticalAlign; + const verticalAlignMin = retrieve2(itemLabelModel.getShallow("verticalAlignMinLabel", true), verticalAlign); + const verticalAlignMax = retrieve2(itemLabelModel.getShallow("verticalAlignMaxLabel", true), verticalAlign); + const textEl = new Text_default({ + x: tickCoord, + y: opt.labelOffset + opt.labelDirection * labelMargin, + rotation: labelLayout2.rotation, + silent, + z2: 10 + (labelItem.level || 0), + style: createTextStyle(itemLabelModel, { + text: formattedLabel, + align: index === 0 ? alignMin : index === labels.length - 1 ? alignMax : align, + verticalAlign: index === 0 ? verticalAlignMin : index === labels.length - 1 ? verticalAlignMax : verticalAlign, + fill: isFunction(textColor) ? textColor(axis.type === "category" ? rawLabel : axis.type === "value" ? tickValue + "" : tickValue, index) : textColor + }) + }); + textEl.anid = "label_" + tickValue; + if (triggerEvent) { + const eventData = AxisBuilder.makeAxisEventDataBase(axisModel); + eventData.targetType = "axisLabel"; + eventData.value = rawLabel; + eventData.tickIndex = index; + if (axis.type === "category") { + eventData.dataIndex = tickValue; + } + getECData(textEl).eventData = eventData; + } + transformGroup.add(textEl); + textEl.updateTransform(); + labelEls.push(textEl); + group.add(textEl); + textEl.decomposeTransform(); + }); + return labelEls; +} +var AxisBuilder_default = AxisBuilder; + +// src/component/axisPointer/modelHelper.ts +function collect(ecModel, api2) { + const result = { + axesInfo: {}, + seriesInvolved: false, + coordSysAxesInfo: {}, + coordSysMap: {} + }; + collectAxesInfo(result, ecModel, api2); + result.seriesInvolved && collectSeriesInfo(result, ecModel); + return result; +} +function collectAxesInfo(result, ecModel, api2) { + const globalTooltipModel = ecModel.getComponent("tooltip"); + const globalAxisPointerModel = ecModel.getComponent("axisPointer"); + const linksOption = globalAxisPointerModel.get("link", true) || []; + const linkGroups = []; + each(api2.getCoordinateSystems(), function(coordSys) { + if (!coordSys.axisPointerEnabled) { + return; + } + const coordSysKey = makeKey(coordSys.model); + const axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {}; + result.coordSysMap[coordSysKey] = coordSys; + const coordSysModel = coordSys.model; + const baseTooltipModel = coordSysModel.getModel("tooltip", globalTooltipModel); + each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); + if (coordSys.getTooltipAxes && globalTooltipModel && baseTooltipModel.get("show")) { + const triggerAxis = baseTooltipModel.get("trigger") === "axis"; + const cross = baseTooltipModel.get(["axisPointer", "type"]) === "cross"; + const tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(["axisPointer", "axis"])); + if (triggerAxis || cross) { + each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? "cross" : true, triggerAxis)); + } + if (cross) { + each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, "cross", false)); + } + } + function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { + let axisPointerModel = axis.model.getModel("axisPointer", globalAxisPointerModel); + const axisPointerShow = axisPointerModel.get("show"); + if (!axisPointerShow || axisPointerShow === "auto" && !fromTooltip && !isHandleTrigger(axisPointerModel)) { return; } - installed = true; - registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor); - installDataZoomAction(registers); - registers.registerSubTypeDefaulter('dataZoom', function () { - // Default 'slider' when no type specified. - return 'slider'; - }); - } - - function install$y(registers) { - registers.registerComponentModel(SelectDataZoomModel); - registers.registerComponentView(SelectDataZoomView); - installCommon(registers); - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - var ToolboxFeature = /** @class */function () { - function ToolboxFeature() {} - return ToolboxFeature; - }(); - var features = {}; - function registerFeature(name, ctor) { - features[name] = ctor; - } - function getFeature(name) { - return features[name]; - } - - var ToolboxModel = /** @class */function (_super) { - __extends(ToolboxModel, _super); - function ToolboxModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ToolboxModel.type; - return _this; - } - ToolboxModel.prototype.optionUpdated = function () { - _super.prototype.optionUpdated.apply(this, arguments); - var ecModel = this.ecModel; - each(this.option.feature, function (featureOpt, featureName) { - var Feature = getFeature(featureName); - if (Feature) { - if (Feature.getDefaultOption) { - Feature.defaultOption = Feature.getDefaultOption(ecModel); - } - merge(featureOpt, Feature.defaultOption); - } - }); - }; - ToolboxModel.type = 'toolbox'; - ToolboxModel.layoutMode = { - type: 'box', - ignoreSize: true - }; - ToolboxModel.defaultOption = { - show: true, - z: 6, - // zlevel: 0, - orient: 'horizontal', - left: 'right', - top: 'top', - // right - // bottom - backgroundColor: 'transparent', - borderColor: '#ccc', - borderRadius: 0, - borderWidth: 0, - padding: 5, - itemSize: 15, - itemGap: 8, - showTitle: true, - iconStyle: { - borderColor: '#666', - color: 'none' - }, - emphasis: { - iconStyle: { - borderColor: '#3E98C5' + if (triggerTooltip == null) { + triggerTooltip = axisPointerModel.get("triggerTooltip"); + } + axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel; + const snap = axisPointerModel.get("snap"); + const triggerEmphasis = axisPointerModel.get("triggerEmphasis"); + const axisKey = makeKey(axis.model); + const involveSeries = triggerTooltip || snap || axis.type === "category"; + const axisInfo = result.axesInfo[axisKey] = { + key: axisKey, + axis, + coordSys, + axisPointerModel, + triggerTooltip, + triggerEmphasis, + involveSeries, + snap, + useHandle: isHandleTrigger(axisPointerModel), + seriesModels: [], + linkGroup: null + }; + axesInfoInCoordSys[axisKey] = axisInfo; + result.seriesInvolved = result.seriesInvolved || involveSeries; + const groupIndex = getLinkGroupIndex(linksOption, axis); + if (groupIndex != null) { + const linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {axesInfo: {}}); + linkGroup.axesInfo[axisKey] = axisInfo; + linkGroup.mapper = linksOption[groupIndex].mapper; + axisInfo.linkGroup = linkGroup; + } + } + }); +} +function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) { + const tooltipAxisPointerModel = baseTooltipModel.getModel("axisPointer"); + const fields = [ + "type", + "snap", + "lineStyle", + "shadowStyle", + "label", + "animation", + "animationDurationUpdate", + "animationEasingUpdate", + "z" + ]; + const volatileOption = {}; + each(fields, function(field) { + volatileOption[field] = clone(tooltipAxisPointerModel.get(field)); + }); + volatileOption.snap = axis.type !== "category" && !!triggerTooltip; + if (tooltipAxisPointerModel.get("type") === "cross") { + volatileOption.type = "line"; + } + const labelOption = volatileOption.label || (volatileOption.label = {}); + labelOption.show == null && (labelOption.show = false); + if (fromTooltip === "cross") { + const tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(["label", "show"]); + labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; + if (!triggerTooltip) { + const crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get("crossStyle"); + crossStyle && defaults(labelOption, crossStyle.textStyle); + } + } + return axis.model.getModel("axisPointer", new Model_default(volatileOption, globalAxisPointerModel, ecModel)); +} +function collectSeriesInfo(result, ecModel) { + ecModel.eachSeries(function(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + const seriesTooltipTrigger = seriesModel.get(["tooltip", "trigger"], true); + const seriesTooltipShow = seriesModel.get(["tooltip", "show"], true); + if (!coordSys || seriesTooltipTrigger === "none" || seriesTooltipTrigger === false || seriesTooltipTrigger === "item" || seriesTooltipShow === false || seriesModel.get(["axisPointer", "show"], true) === false) { + return; + } + each(result.coordSysAxesInfo[makeKey(coordSys.model)], function(axisInfo) { + const axis = axisInfo.axis; + if (coordSys.getAxis(axis.dim) === axis) { + axisInfo.seriesModels.push(seriesModel); + axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0); + axisInfo.seriesDataCount += seriesModel.getData().count(); + } + }); + }); +} +function getLinkGroupIndex(linksOption, axis) { + const axisModel = axis.model; + const dim = axis.dim; + for (let i = 0; i < linksOption.length; i++) { + const linkOption = linksOption[i] || {}; + if (checkPropInLink(linkOption[dim + "AxisId"], axisModel.id) || checkPropInLink(linkOption[dim + "AxisIndex"], axisModel.componentIndex) || checkPropInLink(linkOption[dim + "AxisName"], axisModel.name)) { + return i; + } + } +} +function checkPropInLink(linkPropValue, axisPropValue) { + return linkPropValue === "all" || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue; +} +function fixValue(axisModel) { + const axisInfo = getAxisInfo(axisModel); + if (!axisInfo) { + return; + } + const axisPointerModel = axisInfo.axisPointerModel; + const scale4 = axisInfo.axis.scale; + const option = axisPointerModel.option; + const status = axisPointerModel.get("status"); + let value = axisPointerModel.get("value"); + if (value != null) { + value = scale4.parse(value); + } + const useHandle = isHandleTrigger(axisPointerModel); + if (status == null) { + option.status = useHandle ? "show" : "hide"; + } + const extent3 = scale4.getExtent().slice(); + extent3[0] > extent3[1] && extent3.reverse(); + if (value == null || value > extent3[1]) { + value = extent3[1]; + } + if (value < extent3[0]) { + value = extent3[0]; + } + option.value = value; + if (useHandle) { + option.status = axisInfo.axis.scale.isBlank() ? "hide" : "show"; + } +} +function getAxisInfo(axisModel) { + const coordSysAxesInfo = (axisModel.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo; + return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)]; +} +function getAxisPointerModel(axisModel) { + const axisInfo = getAxisInfo(axisModel); + return axisInfo && axisInfo.axisPointerModel; +} +function isHandleTrigger(axisPointerModel) { + return !!axisPointerModel.get(["handle", "show"]); +} +function makeKey(model) { + return model.type + "||" + model.id; +} + +// src/component/axis/AxisView.ts +var axisPointerClazz = {}; +var AxisView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = AxisView2.type; + } + render(axisModel, ecModel, api2, payload) { + this.axisPointerClass && fixValue(axisModel); + super.render.apply(this, arguments); + this._doUpdateAxisPointerClass(axisModel, api2, true); + } + updateAxisPointer(axisModel, ecModel, api2, payload) { + this._doUpdateAxisPointerClass(axisModel, api2, false); + } + remove(ecModel, api2) { + const axisPointer = this._axisPointer; + axisPointer && axisPointer.remove(api2); + } + dispose(ecModel, api2) { + this._disposeAxisPointer(api2); + super.dispose.apply(this, arguments); + } + _doUpdateAxisPointerClass(axisModel, api2, forceRender) { + const Clazz = AxisView2.getAxisPointerClass(this.axisPointerClass); + if (!Clazz) { + return; + } + const axisPointerModel = getAxisPointerModel(axisModel); + axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api2, forceRender) : this._disposeAxisPointer(api2); + } + _disposeAxisPointer(api2) { + this._axisPointer && this._axisPointer.dispose(api2); + this._axisPointer = null; + } + static registerAxisPointerClass(type, clazz) { + if (true) { + if (axisPointerClazz[type]) { + throw new Error("axisPointer " + type + " exists"); + } + } + axisPointerClazz[type] = clazz; + } + static getAxisPointerClass(type) { + return type && axisPointerClazz[type]; + } +}; +var AxisView = AxisView2; +AxisView.type = "axis"; +var AxisView_default = AxisView; + +// src/component/axis/axisSplitHelper.ts +var inner7 = makeInner(); +function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) { + const axis = axisModel.axis; + if (axis.scale.isBlank()) { + return; + } + const splitAreaModel = axisModel.getModel("splitArea"); + const areaStyleModel = splitAreaModel.getModel("areaStyle"); + let areaColors = areaStyleModel.get("color"); + const gridRect = gridModel.coordinateSystem.getRect(); + const ticksCoords = axis.getTicksCoords({ + tickModel: splitAreaModel, + clamp: true + }); + if (!ticksCoords.length) { + return; + } + const areaColorsLen = areaColors.length; + const lastSplitAreaColors = inner7(axisView).splitAreaColors; + const newSplitAreaColors = createHashMap(); + let colorIndex = 0; + if (lastSplitAreaColors) { + for (let i = 0; i < ticksCoords.length; i++) { + const cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); + if (cIndex != null) { + colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; + break; + } + } + } + let prev = axis.toGlobalCoord(ticksCoords[0].coord); + const areaStyle = areaStyleModel.getAreaStyle(); + areaColors = isArray(areaColors) ? areaColors : [areaColors]; + for (let i = 1; i < ticksCoords.length; i++) { + const tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + let x; + let y; + let width; + let height; + if (axis.isHorizontal()) { + x = prev; + y = gridRect.y; + width = tickCoord - x; + height = gridRect.height; + prev = x + width; + } else { + x = gridRect.x; + y = prev; + width = gridRect.width; + height = tickCoord - y; + prev = y + height; + } + const tickValue = ticksCoords[i - 1].tickValue; + tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); + axisGroup.add(new Rect_default({ + anid: tickValue != null ? "area_" + tickValue : null, + shape: { + x, + y, + width, + height + }, + style: defaults({ + fill: areaColors[colorIndex] + }, areaStyle), + autoBatch: true, + silent: true + })); + colorIndex = (colorIndex + 1) % areaColorsLen; + } + inner7(axisView).splitAreaColors = newSplitAreaColors; +} +function rectCoordAxisHandleRemove(axisView) { + inner7(axisView).splitAreaColors = null; +} + +// src/component/axis/CartesianAxisView.ts +var axisBuilderAttrs = [ + "axisLine", + "axisTickLabel", + "axisName" +]; +var selfBuilderAttrs = [ + "splitArea", + "splitLine", + "minorSplitLine" +]; +var CartesianAxisView2 = class extends AxisView_default { + constructor() { + super(...arguments); + this.type = CartesianAxisView2.type; + this.axisPointerClass = "CartesianAxisPointer"; + } + render(axisModel, ecModel, api2, payload) { + this.group.removeAll(); + const oldAxisGroup = this._axisGroup; + this._axisGroup = new Group_default(); + this.group.add(this._axisGroup); + if (!axisModel.get("show")) { + return; + } + const gridModel = axisModel.getCoordSysModel(); + const layout18 = layout4(gridModel, axisModel); + const axisBuilder = new AxisBuilder_default(axisModel, extend({ + handleAutoShown(elementType) { + const cartesians = gridModel.coordinateSystem.getCartesians(); + for (let i = 0; i < cartesians.length; i++) { + if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) { + return true; } - }, - // textStyle: {}, - // feature - tooltip: { - show: false, - position: 'bottom' } - }; - return ToolboxModel; - }(ComponentModel); - - /** - * Layout list like component. - * It will box layout each items in group of component and then position the whole group in the viewport - * @param {module:zrender/group/Group} group - * @param {module:echarts/model/Component} componentModel - * @param {module:echarts/ExtensionAPI} - */ - function layout$3(group, componentModel, api) { - var boxLayoutParams = componentModel.getBoxLayoutParams(); - var padding = componentModel.get('padding'); - var viewportSize = { - width: api.getWidth(), - height: api.getHeight() - }; - var rect = getLayoutRect(boxLayoutParams, viewportSize, padding); - box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height); - positionElement(group, boxLayoutParams, viewportSize, padding); - } - function makeBackground(rect, componentModel) { - var padding = normalizeCssArray$1(componentModel.get('padding')); - var style = componentModel.getItemStyle(['color', 'opacity']); - style.fill = componentModel.get('backgroundColor'); - rect = new Rect({ + return false; + } + }, layout18)); + each(axisBuilderAttrs, axisBuilder.add, axisBuilder); + this._axisGroup.add(axisBuilder.getGroup()); + each(selfBuilderAttrs, function(name) { + if (axisModel.get([name, "show"])) { + axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel); + } + }, this); + const isInitialSortFromBarRacing = payload && payload.type === "changeAxisOrder" && payload.isInitSort; + if (!isInitialSortFromBarRacing) { + groupTransition(oldAxisGroup, this._axisGroup, axisModel); + } + super.render(axisModel, ecModel, api2, payload); + } + remove() { + rectCoordAxisHandleRemove(this); + } +}; +var CartesianAxisView = CartesianAxisView2; +CartesianAxisView.type = "cartesianAxis"; +var axisElementBuilders = { + splitLine(axisView, axisGroup, axisModel, gridModel) { + const axis = axisModel.axis; + if (axis.scale.isBlank()) { + return; + } + const splitLineModel = axisModel.getModel("splitLine"); + const lineStyleModel = splitLineModel.getModel("lineStyle"); + let lineColors = lineStyleModel.get("color"); + const showMinLine = splitLineModel.get("showMinLine") !== false; + const showMaxLine = splitLineModel.get("showMaxLine") !== false; + lineColors = isArray(lineColors) ? lineColors : [lineColors]; + const gridRect = gridModel.coordinateSystem.getRect(); + const isHorizontal = axis.isHorizontal(); + let lineCount = 0; + const ticksCoords = axis.getTicksCoords({ + tickModel: splitLineModel + }); + const p1 = []; + const p2 = []; + const lineStyle = lineStyleModel.getLineStyle(); + for (let i = 0; i < ticksCoords.length; i++) { + const tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + if (i === 0 && !showMinLine || i === ticksCoords.length - 1 && !showMaxLine) { + continue; + } + const tickValue = ticksCoords[i].tickValue; + 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; + } + const colorIndex = lineCount++ % lineColors.length; + const line2 = new Line_default({ + anid: tickValue != null ? "line_" + tickValue : null, + autoBatch: true, shape: { - x: rect.x - padding[3], - y: rect.y - padding[0], - width: rect.width + padding[1] + padding[3], - height: rect.height + padding[0] + padding[2], - r: componentModel.get('borderRadius') + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] }, - style: style, + style: defaults({ + stroke: lineColors[colorIndex] + }, lineStyle), + silent: true + }); + subPixelOptimizeLine2(line2.shape, lineStyle.lineWidth); + axisGroup.add(line2); + } + }, + minorSplitLine(axisView, axisGroup, axisModel, gridModel) { + const axis = axisModel.axis; + const minorSplitLineModel = axisModel.getModel("minorSplitLine"); + const lineStyleModel = minorSplitLineModel.getModel("lineStyle"); + const gridRect = gridModel.coordinateSystem.getRect(); + const isHorizontal = axis.isHorizontal(); + const minorTicksCoords = axis.getMinorTicksCoords(); + if (!minorTicksCoords.length) { + return; + } + const p1 = []; + const p2 = []; + const lineStyle = lineStyleModel.getLineStyle(); + for (let i = 0; i < minorTicksCoords.length; i++) { + for (let k = 0; k < minorTicksCoords[i].length; k++) { + const tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].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; + } + const line2 = new Line_default({ + anid: "minor_line_" + minorTicksCoords[i][k].tickValue, + autoBatch: true, + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + style: lineStyle, + silent: true + }); + subPixelOptimizeLine2(line2.shape, lineStyle.lineWidth); + axisGroup.add(line2); + } + } + }, + splitArea(axisView, axisGroup, axisModel, gridModel) { + rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel); + } +}; +var CartesianXAxisView2 = class extends CartesianAxisView { + constructor() { + super(...arguments); + this.type = CartesianXAxisView2.type; + } +}; +var CartesianXAxisView = CartesianXAxisView2; +CartesianXAxisView.type = "xAxis"; +var CartesianYAxisView = class extends CartesianAxisView { + constructor() { + super(...arguments); + this.type = CartesianXAxisView.type; + } +}; +CartesianYAxisView.type = "yAxis"; + +// src/component/grid/installSimple.ts +var GridView = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = "grid"; + } + render(gridModel, ecModel) { + this.group.removeAll(); + if (gridModel.get("show")) { + this.group.add(new Rect_default({ + shape: gridModel.coordinateSystem.getRect(), + style: defaults({ + fill: gridModel.get("backgroundColor") + }, gridModel.getItemStyle()), silent: true, z2: -1 - }); - // FIXME - // `subPixelOptimizeRect` may bring some gap between edge of viewpart - // and background rect when setting like `left: 0`, `top: 0`. - // graphic.subPixelOptimizeRect(rect); - return rect; + })); } - - var ToolboxView = /** @class */function (_super) { - __extends(ToolboxView, _super); - function ToolboxView() { - return _super !== null && _super.apply(this, arguments) || this; + } +}; +GridView.type = "grid"; +var extraOption = { + offset: 0 +}; +function install6(registers) { + registers.registerComponentView(GridView); + registers.registerComponentModel(GridModel_default); + registers.registerCoordinateSystem("cartesian2d", Grid_default); + axisModelCreator(registers, "x", CartesianAxisModel, extraOption); + axisModelCreator(registers, "y", CartesianAxisModel, extraOption); + registers.registerComponentView(CartesianXAxisView); + registers.registerComponentView(CartesianYAxisView); + registers.registerPreprocessor(function(option) { + if (option.xAxis && option.yAxis && !option.grid) { + option.grid = {}; + } + }); +} + +// src/chart/scatter/install.ts +function install7(registers) { + use(install6); + registers.registerSeriesModel(ScatterSeries_default); + registers.registerChartView(ScatterView_default); + registers.registerLayout(pointsLayout("scatter")); +} + +// src/chart/radar/radarLayout.ts +function radarLayout(ecModel) { + ecModel.eachSeriesByType("radar", function(seriesModel) { + const data = seriesModel.getData(); + const points4 = []; + const coordSys = seriesModel.coordinateSystem; + if (!coordSys) { + return; + } + const axes = coordSys.getIndicatorAxes(); + each(axes, function(axis, axisIndex) { + data.each(data.mapDimension(axes[axisIndex].dim), function(val, dataIndex) { + points4[dataIndex] = points4[dataIndex] || []; + const point = coordSys.dataToPoint(val, axisIndex); + points4[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys); + }); + }); + data.each(function(idx) { + const firstPoint = find(points4[idx], function(point) { + return isValidPoint(point); + }) || getValueMissingPoint(coordSys); + points4[idx].push(firstPoint.slice()); + data.setItemLayout(idx, points4[idx]); + }); + }); +} +function isValidPoint(point) { + return !isNaN(point[0]) && !isNaN(point[1]); +} +function getValueMissingPoint(coordSys) { + return [coordSys.cx, coordSys.cy]; +} + +// src/chart/radar/backwardCompat.ts +function radarBackwardCompat(option) { + let polarOptArr = option.polar; + if (polarOptArr) { + if (!isArray(polarOptArr)) { + polarOptArr = [polarOptArr]; + } + const polarNotRadar = []; + each(polarOptArr, function(polarOpt, idx) { + if (polarOpt.indicator) { + if (polarOpt.type && !polarOpt.shape) { + polarOpt.shape = polarOpt.type; + } + option.radar = option.radar || []; + if (!isArray(option.radar)) { + option.radar = [option.radar]; + } + option.radar.push(polarOpt); + } else { + polarNotRadar.push(polarOpt); } - ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) { - var group = this.group; - group.removeAll(); - if (!toolboxModel.get('show')) { - return; - } - var itemSize = +toolboxModel.get('itemSize'); - var isVertical = toolboxModel.get('orient') === 'vertical'; - var featureOpts = toolboxModel.get('feature') || {}; - var features = this._features || (this._features = {}); - var featureNames = []; - each(featureOpts, function (opt, name) { - featureNames.push(name); - }); - new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(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 = { - onclick: featureModel.option.onclick, - featureName: featureName - }; - } else { - var Feature = getFeature(featureName); - if (!Feature) { - return; - } - feature = new Feature(); - } - features[featureName] = feature; + }); + option.polar = polarNotRadar; + } + each(option.series, function(seriesOpt) { + if (seriesOpt && seriesOpt.type === "radar" && seriesOpt.polarIndex) { + seriesOpt.radarIndex = seriesOpt.polarIndex; + } + }); +} + +// src/chart/radar/RadarView.ts +var RadarView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = RadarView2.type; + } + render(seriesModel, ecModel, api2) { + const polar = seriesModel.coordinateSystem; + const group = this.group; + const data = seriesModel.getData(); + const oldData = this._data; + function createSymbol3(data2, idx) { + const symbolType = data2.getItemVisual(idx, "symbol") || "circle"; + if (symbolType === "none") { + return; + } + const symbolSize = normalizeSymbolSize(data2.getItemVisual(idx, "symbolSize")); + const symbolPath = createSymbol(symbolType, -1, -1, 2, 2); + const symbolRotate = data2.getItemVisual(idx, "symbolRotate") || 0; + symbolPath.attr({ + style: { + strokeNoScale: true + }, + z2: 100, + scaleX: symbolSize[0] / 2, + scaleY: symbolSize[1] / 2, + rotation: symbolRotate * Math.PI / 180 || 0 + }); + return symbolPath; + } + function updateSymbols(oldPoints, newPoints, symbolGroup, data2, idx, isInit) { + symbolGroup.removeAll(); + for (let i = 0; i < newPoints.length - 1; i++) { + const symbolPath = createSymbol3(data2, idx); + if (symbolPath) { + symbolPath.__dimIdx = i; + if (oldPoints[i]) { + symbolPath.setPosition(oldPoints[i]); + graphic_exports[isInit ? "initProps" : "updateProps"](symbolPath, { + x: newPoints[i][0], + y: newPoints[i][1] + }, seriesModel, idx); } else { - feature = features[oldName]; - // If feature does not exist. - if (!feature) { - return; - } - } - feature.uid = getUID('toolbox-feature'); - feature.model = featureModel; - feature.ecModel = ecModel; - feature.api = api; - var isToolboxFeature = feature instanceof ToolboxFeature; - if (!featureName && oldName) { - isToolboxFeature && feature.dispose && feature.dispose(ecModel, api); - return; - } - if (!featureModel.get('show') || isToolboxFeature && feature.unusable) { - isToolboxFeature && 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; - if (iconPaths[iconName]) { - (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]); - } - }; - if (feature instanceof ToolboxFeature) { - if (feature.render) { - feature.render(featureModel, ecModel, api, payload); - } + symbolPath.setPosition(newPoints[i]); } + symbolGroup.add(symbolPath); } - function createIconPaths(featureModel, feature, featureName) { - var iconStyleModel = featureModel.getModel('iconStyle'); - var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']); - // If one feature has multiple icons, they are organized as - // { - // icon: { - // foo: '', - // bar: '' - // }, - // title: { - // foo: '', - // bar: '' - // } - // } - var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon'); - var titles = featureModel.get('title') || {}; - var iconsMap; - var titlesMap; - if (isString(icons)) { - iconsMap = {}; - iconsMap[featureName] = icons; - } else { - iconsMap = icons; - } - if (isString(titles)) { - titlesMap = {}; - titlesMap[featureName] = titles; - } else { - titlesMap = titles; - } - var iconPaths = featureModel.iconPaths = {}; - each(iconsMap, function (iconStr, iconName) { - var path = createIcon(iconStr, {}, { - x: -itemSize / 2, - y: -itemSize / 2, - width: itemSize, - height: itemSize - }); // TODO handling image - path.setStyle(iconStyleModel.getItemStyle()); - var pathEmphasisState = path.ensureState('emphasis'); - pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle(); - // Text position calculation - // TODO: extract `textStyle` from `iconStyle` and use `createTextStyle` - var textContent = new ZRText({ - style: { - text: titlesMap[iconName], - align: iconStyleEmphasisModel.get('textAlign'), - borderRadius: iconStyleEmphasisModel.get('textBorderRadius'), - padding: iconStyleEmphasisModel.get('textPadding'), - fill: null, - font: getFont({ - fontStyle: iconStyleEmphasisModel.get('textFontStyle'), - fontFamily: iconStyleEmphasisModel.get('textFontFamily'), - fontSize: iconStyleEmphasisModel.get('textFontSize'), - fontWeight: iconStyleEmphasisModel.get('textFontWeight') - }, ecModel) - }, - ignore: true - }); - path.setTextContent(textContent); - setTooltipConfig({ - el: path, - componentModel: toolboxModel, - itemName: iconName, - formatterParamsExtra: { - title: titlesMap[iconName] - } - }); - path.__title = titlesMap[iconName]; - path.on('mouseover', function () { - // Should not reuse above hoverStyle, which might be modified. - var hoverStyle = iconStyleEmphasisModel.getItemStyle(); - var defaultTextPosition = isVertical ? toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' ? 'right' : 'left' : toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' ? 'bottom' : 'top'; - textContent.setStyle({ - fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000', - backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor') - }); - path.setTextConfig({ - position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition - }); - textContent.ignore = !toolboxModel.get('showTitle'); - // Use enterEmphasis and leaveEmphasis provide by ec. - // There are flags managed by the echarts. - api.enterEmphasis(this); - }).on('mouseout', function () { - if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') { - api.leaveEmphasis(this); - } - textContent.hide(); - }); - (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path); - group.add(path); - path.on('click', bind(feature.onclick, feature, ecModel, api, iconName)); - iconPaths[iconName] = path; - }); + } + } + function getInitialPoints(points4) { + return map(points4, function(pt) { + return [polar.cx, polar.cy]; + }); + } + data.diff(oldData).add(function(idx) { + const points4 = data.getItemLayout(idx); + if (!points4) { + return; + } + const polygon = new Polygon_default(); + const polyline = new Polyline_default(); + const target = { + shape: { + points: points4 + } + }; + polygon.shape.points = getInitialPoints(points4); + polyline.shape.points = getInitialPoints(points4); + initProps(polygon, target, seriesModel, idx); + initProps(polyline, target, seriesModel, idx); + const itemGroup = new Group_default(); + const symbolGroup = new Group_default(); + itemGroup.add(polyline); + itemGroup.add(polygon); + itemGroup.add(symbolGroup); + updateSymbols(polyline.shape.points, points4, symbolGroup, data, idx, true); + data.setItemGraphicEl(idx, itemGroup); + }).update(function(newIdx, oldIdx) { + const itemGroup = oldData.getItemGraphicEl(oldIdx); + const polyline = itemGroup.childAt(0); + const polygon = itemGroup.childAt(1); + const symbolGroup = itemGroup.childAt(2); + const target = { + shape: { + points: data.getItemLayout(newIdx) } - layout$3(group, toolboxModel, api); - // Render background after group is layout - // FIXME - group.add(makeBackground(group.getBoundingRect(), toolboxModel)); - // Adjust icon title positions to avoid them out of screen - isVertical || group.eachChild(function (icon) { - var titleText = icon.__title; - // const hoverStyle = icon.hoverStyle; - // TODO simplify code? - var emphasisState = icon.ensureState('emphasis'); - var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {}); - var textContent = icon.getTextContent(); - var emphasisTextState = textContent && textContent.ensureState('emphasis'); - // May be background element - if (emphasisTextState && !isFunction(emphasisTextState) && titleText) { - var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {}); - var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle)); - var offsetX = icon.x + group.x; - var offsetY = icon.y + group.y + itemSize; - var needPutOnTop = false; - if (offsetY + rect.height > api.getHeight()) { - emphasisTextConfig.position = 'top'; - needPutOnTop = true; - } - var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10; - if (offsetX + rect.width / 2 > api.getWidth()) { - emphasisTextConfig.position = ['100%', topOffset]; - emphasisTextStyle.align = 'right'; - } else if (offsetX - rect.width / 2 < 0) { - emphasisTextConfig.position = [0, topOffset]; - emphasisTextStyle.align = 'left'; - } - } - }); - }; - ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) { - each(this._features, function (feature) { - feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload); - }); - }; - // updateLayout(toolboxModel, ecModel, api, payload) { - // zrUtil.each(this._features, function (feature) { - // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); - // }); - // }, - ToolboxView.prototype.remove = function (ecModel, api) { - each(this._features, function (feature) { - feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api); - }); - this.group.removeAll(); }; - ToolboxView.prototype.dispose = function (ecModel, api) { - each(this._features, function (feature) { - feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api); + if (!target.shape.points) { + return; + } + updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false); + saveOldStyle(polygon); + saveOldStyle(polyline); + updateProps(polyline, target, seriesModel); + updateProps(polygon, target, seriesModel); + data.setItemGraphicEl(newIdx, itemGroup); + }).remove(function(idx) { + group.remove(oldData.getItemGraphicEl(idx)); + }).execute(); + data.eachItemGraphicEl(function(itemGroup, idx) { + const itemModel = data.getItemModel(idx); + const polyline = itemGroup.childAt(0); + const polygon = itemGroup.childAt(1); + const symbolGroup = itemGroup.childAt(2); + const itemStyle = data.getItemVisual(idx, "style"); + const color2 = itemStyle.fill; + group.add(itemGroup); + polyline.useStyle(defaults(itemModel.getModel("lineStyle").getLineStyle(), { + fill: "none", + stroke: color2 + })); + setStatesStylesFromModel(polyline, itemModel, "lineStyle"); + setStatesStylesFromModel(polygon, itemModel, "areaStyle"); + const areaStyleModel = itemModel.getModel("areaStyle"); + const polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty(); + polygon.ignore = polygonIgnore; + each(["emphasis", "select", "blur"], function(stateName) { + const stateModel = itemModel.getModel([stateName, "areaStyle"]); + const stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); + polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore; + }); + polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { + fill: color2, + opacity: 0.7, + decal: itemStyle.decal + })); + const emphasisModel = itemModel.getModel("emphasis"); + const itemHoverStyle = emphasisModel.getModel("itemStyle").getItemStyle(); + symbolGroup.eachChild(function(symbolPath) { + if (symbolPath instanceof Image_default) { + const pathStyle = symbolPath.style; + symbolPath.useStyle(extend({ + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, itemStyle)); + } else { + symbolPath.useStyle(itemStyle); + symbolPath.setColor(color2); + symbolPath.style.strokeNoScale = true; + } + const pathEmphasisState = symbolPath.ensureState("emphasis"); + pathEmphasisState.style = clone(itemHoverStyle); + let defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx); + (defaultText == null || isNaN(defaultText)) && (defaultText = ""); + setLabelStyle(symbolPath, getLabelStatesModels(itemModel), { + labelFetcher: data.hostModel, + labelDataIndex: idx, + labelDimIndex: symbolPath.__dimIdx, + defaultText, + inheritColor: color2, + defaultOpacity: itemStyle.opacity }); - }; - ToolboxView.type = 'toolbox'; - return ToolboxView; - }(ComponentView); - function isUserFeatureName(featureName) { - return featureName.indexOf('my') === 0; - } - - var SaveAsImage = /** @class */function (_super) { - __extends(SaveAsImage, _super); - function SaveAsImage() { - return _super !== null && _super.apply(this, arguments) || this; - } - SaveAsImage.prototype.onclick = function (ecModel, api) { - var model = this.model; - var title = model.get('name') || ecModel.get('title.0.text') || 'echarts'; - var isSvg = api.getZr().painter.getType() === 'svg'; - var type = isSvg ? 'svg' : model.get('type', true) || 'png'; - var url = api.getConnectedDataURL({ - type: type, - backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff', - connectedBackgroundColor: model.get('connectedBackgroundColor'), - excludeComponents: model.get('excludeComponents'), - pixelRatio: model.get('pixelRatio') + }); + toggleHoverEmphasis(itemGroup, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + }); + this._data = data; + } + remove() { + this.group.removeAll(); + this._data = null; + } +}; +var RadarView = RadarView2; +RadarView.type = "radar"; +var RadarView_default = RadarView; + +// src/chart/radar/RadarSeries.ts +var RadarSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = RadarSeriesModel2.type; + this.hasSymbolVisual = true; + } + init(option) { + super.init.apply(this, arguments); + this.legendVisualProvider = new LegendVisualProvider_default(bind(this.getData, this), bind(this.getRawData, this)); + } + getInitialData(option, ecModel) { + return createSeriesDataSimply(this, { + generateCoord: "indicator_", + generateCoordCount: Infinity + }); + } + formatTooltip(dataIndex, multipleSeries, dataType) { + const data = this.getData(); + const coordSys = this.coordinateSystem; + const indicatorAxes = coordSys.getIndicatorAxes(); + const name = this.getData().getName(dataIndex); + const nameToDisplay = name === "" ? this.name : name; + const markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex); + return createTooltipMarkup("section", { + header: nameToDisplay, + sortBlocks: true, + blocks: map(indicatorAxes, (axis) => { + const val = data.get(data.mapDimension(axis.dim), dataIndex); + return createTooltipMarkup("nameValue", { + markerType: "subItem", + markerColor, + name: axis.name, + value: val, + sortParam: val }); - var browser = env.browser; - // Chrome, Firefox, New Edge - if (typeof MouseEvent === 'function' && (browser.newEdge || !browser.ie && !browser.edge)) { - var $a = document.createElement('a'); - $a.download = title + '.' + type; - $a.target = '_blank'; - $a.href = url; - var evt = new MouseEvent('click', { - // some micro front-end framework, window maybe is a Proxy - view: document.defaultView, - bubbles: true, - cancelable: false - }); - $a.dispatchEvent(evt); - } - // IE or old Edge - else { - // @ts-ignore - if (window.navigator.msSaveOrOpenBlob || isSvg) { - var parts = url.split(','); - // data:[][;charset=][;base64], - var base64Encoded = parts[0].indexOf('base64') > -1; - var bstr = isSvg - // should decode the svg data uri first - ? decodeURIComponent(parts[1]) : parts[1]; - // only `atob` when the data uri is encoded with base64 - // otherwise, like `svg` data uri exported by zrender, - // there will be an error, for it's not encoded with base64. - // (just a url-encoded string through `encodeURIComponent`) - base64Encoded && (bstr = window.atob(bstr)); - var filename = title + '.' + type; - // @ts-ignore - if (window.navigator.msSaveOrOpenBlob) { - var n = bstr.length; - var u8arr = new Uint8Array(n); - while (n--) { - u8arr[n] = bstr.charCodeAt(n); - } - var blob = new Blob([u8arr]); // @ts-ignore - window.navigator.msSaveOrOpenBlob(blob, filename); - } else { - var frame = document.createElement('iframe'); - document.body.appendChild(frame); - var cw = frame.contentWindow; - var doc = cw.document; - doc.open('image/svg+xml', 'replace'); - doc.write(bstr); - doc.close(); - cw.focus(); - doc.execCommand('SaveAs', true, filename); - document.body.removeChild(frame); + }) + }); + } + getTooltipPosition(dataIndex) { + if (dataIndex != null) { + const data = this.getData(); + const coordSys = this.coordinateSystem; + const values = data.getValues(map(coordSys.dimensions, function(dim) { + return data.mapDimension(dim); + }), dataIndex); + for (let i = 0, len2 = values.length; i < len2; i++) { + if (!isNaN(values[i])) { + const indicatorAxes = coordSys.getIndicatorAxes(); + return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i); + } + } + } + } +}; +var RadarSeriesModel = RadarSeriesModel2; +RadarSeriesModel.type = "series.radar"; +RadarSeriesModel.dependencies = ["radar"]; +RadarSeriesModel.defaultOption = { + z: 2, + colorBy: "data", + coordinateSystem: "radar", + legendHoverLink: true, + radarIndex: 0, + lineStyle: { + width: 2, + type: "solid", + join: "round" + }, + label: { + position: "top" + }, + symbolSize: 8 +}; +var RadarSeries_default = RadarSeriesModel; + +// src/coord/radar/RadarModel.ts +var valueAxisDefault = axisDefault_default.value; +function defaultsShow(opt, show) { + return defaults({ + show + }, opt); +} +var RadarModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = RadarModel2.type; + } + optionUpdated() { + const boundaryGap = this.get("boundaryGap"); + const splitNumber = this.get("splitNumber"); + const scale4 = this.get("scale"); + const axisLine = this.get("axisLine"); + const axisTick = this.get("axisTick"); + const axisLabel = this.get("axisLabel"); + const nameTextStyle = this.get("axisName"); + const showName = this.get(["axisName", "show"]); + const nameFormatter = this.get(["axisName", "formatter"]); + const nameGap = this.get("axisNameGap"); + const triggerEvent = this.get("triggerEvent"); + const indicatorModels = map(this.get("indicator") || [], function(indicatorOpt) { + if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) { + indicatorOpt.min = 0; + } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) { + indicatorOpt.max = 0; + } + let iNameTextStyle = nameTextStyle; + if (indicatorOpt.color != null) { + iNameTextStyle = defaults({ + color: indicatorOpt.color + }, nameTextStyle); + } + const innerIndicatorOpt = merge(clone(indicatorOpt), { + boundaryGap, + splitNumber, + scale: scale4, + axisLine, + axisTick, + axisLabel, + name: indicatorOpt.text, + showName, + nameLocation: "end", + nameGap, + nameTextStyle: iNameTextStyle, + triggerEvent + }, false); + if (isString(nameFormatter)) { + const indName = innerIndicatorOpt.name; + innerIndicatorOpt.name = nameFormatter.replace("{value}", indName != null ? indName : ""); + } else if (isFunction(nameFormatter)) { + innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt); + } + const model = new Model_default(innerIndicatorOpt, null, this.ecModel); + mixin(model, AxisModelCommonMixin.prototype); + model.mainType = "radar"; + model.componentIndex = this.componentIndex; + return model; + }, this); + this._indicatorModels = indicatorModels; + } + getIndicatorModels() { + return this._indicatorModels; + } +}; +var RadarModel = RadarModel2; +RadarModel.type = "radar"; +RadarModel.defaultOption = { + z: 0, + center: ["50%", "50%"], + radius: "75%", + startAngle: 90, + axisName: { + show: true + }, + boundaryGap: [0, 0], + splitNumber: 5, + axisNameGap: 15, + scale: false, + shape: "polygon", + axisLine: merge({ + lineStyle: { + color: "#bbb" + } + }, valueAxisDefault.axisLine), + axisLabel: defaultsShow(valueAxisDefault.axisLabel, false), + axisTick: defaultsShow(valueAxisDefault.axisTick, false), + splitLine: defaultsShow(valueAxisDefault.splitLine, true), + splitArea: defaultsShow(valueAxisDefault.splitArea, true), + indicator: [] +}; +var RadarModel_default = RadarModel; + +// src/component/radar/RadarView.ts +var axisBuilderAttrs2 = [ + "axisLine", + "axisTickLabel", + "axisName" +]; +var RadarView4 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = RadarView4.type; + } + render(radarModel, ecModel, api2) { + const group = this.group; + group.removeAll(); + this._buildAxes(radarModel); + this._buildSplitLineAndArea(radarModel); + } + _buildAxes(radarModel) { + const radar = radarModel.coordinateSystem; + const indicatorAxes = radar.getIndicatorAxes(); + const axisBuilders = map(indicatorAxes, function(indicatorAxis) { + const axisName = indicatorAxis.model.get("showName") ? indicatorAxis.name : ""; + const axisBuilder = new AxisBuilder_default(indicatorAxis.model, { + axisName, + position: [radar.cx, radar.cy], + rotation: indicatorAxis.angle, + labelDirection: -1, + tickDirection: -1, + nameDirection: 1 + }); + return axisBuilder; + }); + each(axisBuilders, function(axisBuilder) { + each(axisBuilderAttrs2, axisBuilder.add, axisBuilder); + this.group.add(axisBuilder.getGroup()); + }, this); + } + _buildSplitLineAndArea(radarModel) { + const radar = radarModel.coordinateSystem; + const indicatorAxes = radar.getIndicatorAxes(); + if (!indicatorAxes.length) { + return; + } + const shape = radarModel.get("shape"); + const splitLineModel = radarModel.getModel("splitLine"); + const splitAreaModel = radarModel.getModel("splitArea"); + const lineStyleModel = splitLineModel.getModel("lineStyle"); + const areaStyleModel = splitAreaModel.getModel("areaStyle"); + const showSplitLine = splitLineModel.get("show"); + const showSplitArea = splitAreaModel.get("show"); + const splitLineColors = lineStyleModel.get("color"); + const splitAreaColors = areaStyleModel.get("color"); + const splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors]; + const splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors]; + const splitLines = []; + const splitAreas = []; + function getColorIndex(areaOrLine, areaOrLineColorList, idx) { + const colorIndex = idx % areaOrLineColorList.length; + areaOrLine[colorIndex] = areaOrLine[colorIndex] || []; + return colorIndex; + } + if (shape === "circle") { + const ticksRadius = indicatorAxes[0].getTicksCoords(); + const cx = radar.cx; + const cy = radar.cy; + for (let i = 0; i < ticksRadius.length; i++) { + if (showSplitLine) { + const colorIndex = getColorIndex(splitLines, splitLineColorsArr, i); + splitLines[colorIndex].push(new Circle_default({ + shape: { + cx, + cy, + r: ticksRadius[i].coord } - } else { - var lang = model.get('lang'); - var html = '' + '' + '' + ''; - var tab = window.open(); - tab.document.write(html); - tab.document.title = title; - } - } - }; - SaveAsImage.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0', - title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']), - type: 'png', - // Default use option.backgroundColor - // backgroundColor: '#fff', - connectedBackgroundColor: '#fff', - name: '', - excludeComponents: ['toolbox'], - // use current pixel ratio of device by default - // pixelRatio: 1, - lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang']) - }; - return defaultOption; - }; - return SaveAsImage; - }(ToolboxFeature); - - var INNER_STACK_KEYWORD = '__ec_magicType_stack__'; - var radioTypes = [['line', 'bar'], ['stack']]; - var MagicType = /** @class */function (_super) { - __extends(MagicType, _super); - function MagicType() { - return _super !== null && _super.apply(this, arguments) || this; - } - MagicType.prototype.getIcons = function () { - var model = this.model; - var availableIcons = model.get('icon'); - var icons = {}; - each(model.get('type'), function (type) { - if (availableIcons[type]) { - icons[type] = availableIcons[type]; - } - }); - return icons; - }; - MagicType.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - type: [], - // Icon group - icon: { - line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4', - bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7', - // eslint-disable-next-line - stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z' // jshint ignore:line - }, - - // `line`, `bar`, `stack`, `tiled` - title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']), - option: {}, - seriesIndex: {} - }; - return defaultOption; - }; - MagicType.prototype.onclick = function (ecModel, api, type) { - var model = this.model; - var seriesIndex = model.get(['seriesIndex', type]); - // Not supported magicType - if (!seriesOptGenreator[type]) { - return; + })); } - var newOption = { - series: [] - }; - var generateNewSeriesTypes = function (seriesModel) { - var seriesType = seriesModel.subType; - var seriesId = seriesModel.id; - var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model); - if (newSeriesOpt) { - // PENDING If merge original option? - defaults(newSeriesOpt, seriesModel.option); - newOption.series.push(newSeriesOpt); - } - // Modify boundaryGap - var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { - var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; - if (categoryAxis) { - var axisDim = categoryAxis.dim; - var axisType = axisDim + 'Axis'; - var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; - var axisIndex = axisModel.componentIndex; - newOption[axisType] = newOption[axisType] || []; - for (var i = 0; i <= axisIndex; i++) { - newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; - } - newOption[axisType][axisIndex].boundaryGap = type === 'bar'; + if (showSplitArea && i < ticksRadius.length - 1) { + const colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i); + splitAreas[colorIndex].push(new Ring_default({ + shape: { + cx, + cy, + r0: ticksRadius[i].coord, + r: ticksRadius[i + 1].coord } - } - }; - each(radioTypes, function (radio) { - if (indexOf(radio, type) >= 0) { - each(radio, function (item) { - model.setIconStatus(item, 'normal'); - }); - } - }); - model.setIconStatus(type, 'emphasis'); - ecModel.eachComponent({ - mainType: 'series', - query: seriesIndex == null ? null : { - seriesIndex: seriesIndex - } - }, generateNewSeriesTypes); - var newTitle; - var currentType = type; - // Change title of stack - if (type === 'stack') { - // use titles in model instead of ecModel - // as stack and tiled appears in pair, just flip them - // no need of checking stack state - newTitle = merge({ - stack: model.option.title.tiled, - tiled: model.option.title.stack - }, model.option.title); - if (model.get(['iconStatus', type]) !== 'emphasis') { - currentType = 'tiled'; - } + })); } - api.dispatchAction({ - type: 'changeMagicType', - currentType: currentType, - newOption: newOption, - newTitle: newTitle, - featureName: 'magicType' + } + } else { + let realSplitNumber; + const axesTicksPoints = map(indicatorAxes, function(indicatorAxis, idx) { + const ticksCoords = indicatorAxis.getTicksCoords(); + realSplitNumber = realSplitNumber == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber); + return map(ticksCoords, function(tickCoord) { + return radar.coordToPoint(tickCoord.coord, idx); }); - }; - return MagicType; - }(ToolboxFeature); - var seriesOptGenreator = { - 'line': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'bar') { - return merge({ - id: seriesId, - type: 'line', - // Preserve data related option - data: seriesModel.get('data'), - stack: seriesModel.get('stack'), - markPoint: seriesModel.get('markPoint'), - markLine: seriesModel.get('markLine') - }, model.get(['option', 'line']) || {}, true); + }); + let prevPoints = []; + for (let i = 0; i <= realSplitNumber; i++) { + const points4 = []; + for (let j = 0; j < indicatorAxes.length; j++) { + points4.push(axesTicksPoints[j][i]); + } + if (points4[0]) { + points4.push(points4[0].slice()); + } else { + if (true) { + console.error("Can't draw value axis " + i); + } } - }, - 'bar': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'line') { - return merge({ - id: seriesId, - type: 'bar', - // Preserve data related option - data: seriesModel.get('data'), - stack: seriesModel.get('stack'), - markPoint: seriesModel.get('markPoint'), - markLine: seriesModel.get('markLine') - }, model.get(['option', 'bar']) || {}, true); + if (showSplitLine) { + const colorIndex = getColorIndex(splitLines, splitLineColorsArr, i); + splitLines[colorIndex].push(new Polyline_default({ + shape: { + points: points4 + } + })); } - }, - 'stack': function (seriesType, seriesId, seriesModel, model) { - var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD; - if (seriesType === 'line' || seriesType === 'bar') { - model.setIconStatus('stack', isStack ? 'normal' : 'emphasis'); - return merge({ - id: seriesId, - stack: isStack ? '' : INNER_STACK_KEYWORD - }, model.get(['option', 'stack']) || {}, true); + if (showSplitArea && prevPoints) { + const colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1); + splitAreas[colorIndex].push(new Polygon_default({ + shape: { + points: points4.concat(prevPoints) + } + })); } + prevPoints = points4.slice().reverse(); + } + } + const lineStyle = lineStyleModel.getLineStyle(); + const areaStyle = areaStyleModel.getAreaStyle(); + each(splitAreas, function(splitAreas2, idx) { + this.group.add(mergePath2(splitAreas2, { + style: defaults({ + stroke: "none", + fill: splitAreaColorsArr[idx % splitAreaColorsArr.length] + }, areaStyle), + silent: true + })); + }, this); + each(splitLines, function(splitLines2, idx) { + this.group.add(mergePath2(splitLines2, { + style: defaults({ + fill: "none", + stroke: splitLineColorsArr[idx % splitLineColorsArr.length] + }, lineStyle), + silent: true + })); + }, this); + } +}; +var RadarView3 = RadarView4; +RadarView3.type = "radar"; +var RadarView_default2 = RadarView3; + +// src/coord/radar/IndicatorAxis.ts +var IndicatorAxis = class extends Axis_default { + constructor(dim, scale4, radiusExtent) { + super(dim, scale4, radiusExtent); + this.type = "value"; + this.angle = 0; + this.name = ""; + } +}; +var IndicatorAxis_default = IndicatorAxis; + +// src/coord/radar/Radar.ts +var Radar2 = class { + constructor(radarModel, ecModel, api2) { + this.dimensions = []; + this._model = radarModel; + this._indicatorAxes = map(radarModel.getIndicatorModels(), function(indicatorModel, idx) { + const dim = "indicator_" + idx; + const indicatorAxis = new IndicatorAxis_default(dim, new Interval_default()); + indicatorAxis.name = indicatorModel.get("name"); + indicatorAxis.model = indicatorModel; + indicatorModel.axis = indicatorAxis; + this.dimensions.push(dim); + return indicatorAxis; + }, this); + this.resize(radarModel, api2); + } + getIndicatorAxes() { + return this._indicatorAxes; + } + dataToPoint(value, indicatorIndex) { + const indicatorAxis = this._indicatorAxes[indicatorIndex]; + return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex); + } + coordToPoint(coord, indicatorIndex) { + const indicatorAxis = this._indicatorAxes[indicatorIndex]; + const angle = indicatorAxis.angle; + const x = this.cx + coord * Math.cos(angle); + const y = this.cy - coord * Math.sin(angle); + return [x, y]; + } + pointToData(pt) { + let dx = pt[0] - this.cx; + let dy = pt[1] - this.cy; + const radius = Math.sqrt(dx * dx + dy * dy); + dx /= radius; + dy /= radius; + const radian = Math.atan2(-dy, dx); + let minRadianDiff = Infinity; + let closestAxis; + let closestAxisIdx = -1; + for (let i = 0; i < this._indicatorAxes.length; i++) { + const indicatorAxis = this._indicatorAxes[i]; + const diff = Math.abs(radian - indicatorAxis.angle); + if (diff < minRadianDiff) { + closestAxis = indicatorAxis; + closestAxisIdx = i; + minRadianDiff = diff; + } + } + return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))]; + } + resize(radarModel, api2) { + const center3 = radarModel.get("center"); + const viewWidth = api2.getWidth(); + const viewHeight = api2.getHeight(); + const viewSize = Math.min(viewWidth, viewHeight) / 2; + this.cx = parsePercent2(center3[0], viewWidth); + this.cy = parsePercent2(center3[1], viewHeight); + this.startAngle = radarModel.get("startAngle") * Math.PI / 180; + let radius = radarModel.get("radius"); + if (isString(radius) || isNumber(radius)) { + radius = [0, radius]; + } + this.r0 = parsePercent2(radius[0], viewSize); + this.r = parsePercent2(radius[1], viewSize); + each(this._indicatorAxes, function(indicatorAxis, idx) { + indicatorAxis.setExtent(this.r0, this.r); + let angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; + angle = Math.atan2(Math.sin(angle), Math.cos(angle)); + indicatorAxis.angle = angle; + }, this); + } + update(ecModel, api2) { + const indicatorAxes = this._indicatorAxes; + const radarModel = this._model; + 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; + } + const data = radarSeries.getData(); + each(indicatorAxes, function(indicatorAxis) { + indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim)); + }); + }, this); + const splitNumber = radarModel.get("splitNumber"); + const dummyScale = new Interval_default(); + dummyScale.setExtent(0, splitNumber); + dummyScale.setInterval(1); + each(indicatorAxes, function(indicatorAxis, idx) { + alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale); + }); + } + convertToPixel(ecModel, finder, value) { + console.warn("Not implemented."); + return null; + } + convertFromPixel(ecModel, finder, pixel) { + console.warn("Not implemented."); + return null; + } + containPoint(point) { + console.warn("Not implemented."); + return false; + } + static create(ecModel, api2) { + const radarList = []; + ecModel.eachComponent("radar", function(radarModel) { + const radar = new Radar2(radarModel, ecModel, api2); + radarList.push(radar); + radarModel.coordinateSystem = radar; + }); + ecModel.eachSeriesByType("radar", function(radarSeries) { + if (radarSeries.get("coordinateSystem") === "radar") { + radarSeries.coordinateSystem = radarList[radarSeries.get("radarIndex") || 0]; + } + }); + return radarList; + } +}; +var Radar = Radar2; +Radar.dimensions = []; +var Radar_default = Radar; + +// src/component/radar/install.ts +function install8(registers) { + registers.registerCoordinateSystem("radar", Radar_default); + registers.registerComponentModel(RadarModel_default); + registers.registerComponentView(RadarView_default2); + registers.registerVisual({ + seriesType: "radar", + reset: function(seriesModel) { + const data = seriesModel.getData(); + data.each(function(idx) { + data.setItemVisual(idx, "legendIcon", "roundRect"); + }); + data.setVisual("legendIcon", "roundRect"); + } + }); +} + +// src/chart/radar/install.ts +function install9(registers) { + use(install8); + registers.registerChartView(RadarView_default); + registers.registerSeriesModel(RadarSeries_default); + registers.registerLayout(radarLayout); + registers.registerProcessor(dataFilter("radar")); + registers.registerPreprocessor(radarBackwardCompat); +} + +// src/component/helper/interactionMutex.ts +var ATTR = "\0_ec_interaction_mutex"; +function take(zr, resourceKey, userKey) { + const store = getStore(zr); + store[resourceKey] = userKey; +} +function release(zr, resourceKey, userKey) { + const store = getStore(zr); + const 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] = {}); +} +registerAction({type: "takeGlobalCursor", event: "globalCursorTaken", update: "update"}, noop); + +// src/component/helper/RoamController.ts +var RoamController = class extends Eventful_default { + constructor(zr) { + super(); + this._zr = zr; + const mousedownHandler = bind(this._mousedownHandler, this); + const mousemoveHandler = bind(this._mousemoveHandler, this); + const mouseupHandler = bind(this._mouseupHandler, this); + const mousewheelHandler = bind(this._mousewheelHandler, this); + const pinchHandler = bind(this._pinchHandler, this); + this.enable = function(controlType, opt) { + this.disable(); + this._opt = defaults(clone(opt) || {}, { + zoomOnMouseWheel: true, + moveOnMouseMove: true, + moveOnMouseWheel: false, + preventDefaultMouseMove: true + }); + if (controlType == null) { + controlType = true; + } + if (controlType === true || (controlType === "move" || controlType === "pan")) { + zr.on("mousedown", mousedownHandler); + zr.on("mousemove", mousemoveHandler); + zr.on("mouseup", mouseupHandler); + } + if (controlType === true || (controlType === "scale" || controlType === "zoom")) { + zr.on("mousewheel", mousewheelHandler); + zr.on("pinch", pinchHandler); } }; - // TODO: SELF REGISTERED. - registerAction({ - type: 'changeMagicType', - event: 'magicTypeChanged', - update: 'prepareAndUpdate' - }, function (payload, ecModel) { - ecModel.mergeOption(payload.newOption); - }); - - /* global document */ - var BLOCK_SPLITER = new Array(60).join('-'); - var ITEM_SPLITER = '\t'; - /** - * Group series into two types - * 1. on category axis, like line, bar - * 2. others, like scatter, pie - */ - function groupSeries(ecModel) { - var seriesGroupByCategoryAxis = {}; - var otherSeries = []; - var meta = []; - ecModel.eachRawSeries(function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) { - // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size. - var baseAxis = coordSys.getBaseAxis(); - if (baseAxis.type === 'category') { - var key = baseAxis.dim + '_' + baseAxis.index; - if (!seriesGroupByCategoryAxis[key]) { - seriesGroupByCategoryAxis[key] = { - categoryAxis: baseAxis, - valueAxis: coordSys.getOtherAxis(baseAxis), - series: [] - }; - meta.push({ - axisDim: baseAxis.dim, - axisIndex: baseAxis.index - }); - } - seriesGroupByCategoryAxis[key].series.push(seriesModel); - } else { - otherSeries.push(seriesModel); - } - } else { - otherSeries.push(seriesModel); - } + this.disable = function() { + zr.off("mousedown", mousedownHandler); + zr.off("mousemove", mousemoveHandler); + zr.off("mouseup", mouseupHandler); + zr.off("mousewheel", mousewheelHandler); + zr.off("pinch", pinchHandler); + }; + } + isDragging() { + return this._dragging; + } + isPinching() { + return this._pinching; + } + setPointerChecker(pointerChecker) { + this.pointerChecker = pointerChecker; + } + dispose() { + this.disable(); + } + _mousedownHandler(e2) { + if (isMiddleOrRightButtonOnMouseUpDown(e2)) { + return; + } + let el = e2.target; + while (el) { + if (el.draggable) { + return; + } + el = el.__hostTarget || el.parent; + } + const x = e2.offsetX; + const y = e2.offsetY; + if (this.pointerChecker && this.pointerChecker(e2, x, y)) { + this._x = x; + this._y = y; + this._dragging = true; + } + } + _mousemoveHandler(e2) { + if (!this._dragging || !isAvailableBehavior("moveOnMouseMove", e2, this._opt) || e2.gestureEvent === "pinch" || isTaken(this._zr, "globalPan")) { + return; + } + const x = e2.offsetX; + const y = e2.offsetY; + const oldX = this._x; + const oldY = this._y; + const dx = x - oldX; + const dy = y - oldY; + this._x = x; + this._y = y; + this._opt.preventDefaultMouseMove && stop(e2.event); + trigger(this, "pan", "moveOnMouseMove", e2, { + dx, + dy, + oldX, + oldY, + newX: x, + newY: y, + isAvailableBehavior: null + }); + } + _mouseupHandler(e2) { + if (!isMiddleOrRightButtonOnMouseUpDown(e2)) { + this._dragging = false; + } + } + _mousewheelHandler(e2) { + const shouldZoom = isAvailableBehavior("zoomOnMouseWheel", e2, this._opt); + const shouldMove = isAvailableBehavior("moveOnMouseWheel", e2, this._opt); + const wheelDelta = e2.wheelDelta; + const absWheelDeltaDelta = Math.abs(wheelDelta); + const originX = e2.offsetX; + const originY = e2.offsetY; + if (wheelDelta === 0 || !shouldZoom && !shouldMove) { + return; + } + if (shouldZoom) { + const factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1; + const scale4 = wheelDelta > 0 ? factor : 1 / factor; + checkPointerAndTrigger(this, "zoom", "zoomOnMouseWheel", e2, { + scale: scale4, + originX, + originY, + isAvailableBehavior: null }); - return { - seriesGroupByCategoryAxis: seriesGroupByCategoryAxis, - other: otherSeries, - meta: meta - }; } - /** - * Assemble content of series on cateogory axis - * @inner - */ - function assembleSeriesWithCategoryAxis(groups) { - var tables = []; - each(groups, function (group, key) { - var categoryAxis = group.categoryAxis; - var valueAxis = group.valueAxis; - var valueAxisDim = valueAxis.dim; - var headers = [' '].concat(map(group.series, function (series) { - return series.name; - })); - // @ts-ignore TODO Polar - var columns = [categoryAxis.model.getCategories()]; - each(group.series, function (series) { - var rawData = series.getRawData(); - columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) { - return val; - })); - }); - // Assemble table content - var lines = [headers.join(ITEM_SPLITER)]; - for (var i = 0; i < columns[0].length; i++) { - var items = []; - for (var j = 0; j < columns.length; j++) { - items.push(columns[j][i]); - } - lines.push(items.join(ITEM_SPLITER)); - } - tables.push(lines.join('\n')); + if (shouldMove) { + const absDelta = Math.abs(wheelDelta); + const scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05); + checkPointerAndTrigger(this, "scrollMove", "moveOnMouseWheel", e2, { + scrollDelta, + originX, + originY, + isAvailableBehavior: null }); - return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); - } - /** - * Assemble content of other series - */ - function assembleOtherSeries(series) { - return map(series, function (series) { - var data = series.getRawData(); - var lines = [series.name]; - var vals = []; - data.each(data.dimensions, function () { - var argLen = arguments.length; - var dataIndex = arguments[argLen - 1]; - var name = data.getName(dataIndex); - for (var i = 0; i < argLen - 1; i++) { - vals[i] = arguments[i]; - } - lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER)); - }); - return lines.join('\n'); - }).join('\n\n' + BLOCK_SPLITER + '\n\n'); } - function getContentFromModel(ecModel) { - var result = groupSeries(ecModel); - return { - value: filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) { - return !!str.replace(/[\n\t\s]/g, ''); - }).join('\n\n' + BLOCK_SPLITER + '\n\n'), - meta: result.meta - }; - } - function trim$1(str) { - return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + _pinchHandler(e2) { + if (isTaken(this._zr, "globalPan")) { + return; + } + const scale4 = e2.pinchScale > 1 ? 1.1 : 1 / 1.1; + checkPointerAndTrigger(this, "zoom", null, e2, { + scale: scale4, + originX: e2.pinchX, + originY: e2.pinchY, + isAvailableBehavior: null + }); + } +}; +function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e2, contollerEvent) { + if (controller.pointerChecker && controller.pointerChecker(e2, contollerEvent.originX, contollerEvent.originY)) { + stop(e2.event); + trigger(controller, eventName, behaviorToCheck, e2, contollerEvent); + } +} +function trigger(controller, eventName, behaviorToCheck, e2, contollerEvent) { + contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e2); + controller.trigger(eventName, contollerEvent); +} +function isAvailableBehavior(behaviorToCheck, e2, settings) { + const setting = settings[behaviorToCheck]; + return !behaviorToCheck || setting && (!isString(setting) || e2.event[setting + "Key"]); +} +var RoamController_default = RoamController; + +// src/component/helper/roamHelper.ts +function updateViewOnPan(controllerHost, dx, dy) { + const target = controllerHost.target; + target.x += dx; + target.y += dy; + target.dirty(); +} +function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) { + const target = controllerHost.target; + const zoomLimit = controllerHost.zoomLimit; + let newZoom = controllerHost.zoom = controllerHost.zoom || 1; + newZoom *= zoomDelta; + if (zoomLimit) { + const zoomMin = zoomLimit.min || 0; + const zoomMax = zoomLimit.max || Infinity; + newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin); + } + const zoomScale = newZoom / controllerHost.zoom; + controllerHost.zoom = newZoom; + target.x -= (zoomX - target.x) * (zoomScale - 1); + target.y -= (zoomY - target.y) * (zoomScale - 1); + target.scaleX *= zoomScale; + target.scaleY *= zoomScale; + target.dirty(); +} + +// src/component/helper/cursorHelper.ts +var IRRELEVANT_EXCLUDES = {axisPointer: 1, tooltip: 1, brush: 1}; +function onIrrelevantElement(e2, api2, targetCoordSysModel) { + const model = api2.getComponentByElement(e2.topTarget); + const coordSys = model && model.coordinateSystem; + return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && (coordSys && coordSys.model !== targetCoordSysModel); +} + +// node_modules/zrender/src/tool/parseXML.ts +function parseXML(svg) { + if (isString(svg)) { + const parser = new DOMParser(); + svg = parser.parseFromString(svg, "text/xml"); + } + let svgNode = svg; + if (svgNode.nodeType === 9) { + svgNode = svgNode.firstChild; + } + while (svgNode.nodeName.toLowerCase() !== "svg" || svgNode.nodeType !== 1) { + svgNode = svgNode.nextSibling; + } + return svgNode; +} + +// node_modules/zrender/src/tool/parseSVG.ts +var nodeParsers; +var INHERITABLE_STYLE_ATTRIBUTES_MAP = { + 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-anchor": "textAlign", + visibility: "visibility", + display: "display" +}; +var INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP); +var SELF_STYLE_ATTRIBUTES_MAP = { + "alignment-baseline": "textBaseline", + "stop-color": "stopColor" +}; +var SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP); +var SVGParser = class { + constructor() { + this._defs = {}; + this._root = null; + } + parse(xml, opt) { + opt = opt || {}; + const svg = parseXML(xml); + if (true) { + if (!svg) { + throw new Error("Illegal svg"); + } + } + this._defsUsePending = []; + let root = new Group_default(); + this._root = root; + const named = []; + const viewBox = svg.getAttribute("viewBox") || ""; + let width = parseFloat(svg.getAttribute("width") || opt.width); + let height = parseFloat(svg.getAttribute("height") || opt.height); + isNaN(width) && (width = null); + isNaN(height) && (height = null); + parseAttributes(svg, root, null, true, false); + let child = svg.firstChild; + while (child) { + this._parseNode(child, root, named, null, false, false); + child = child.nextSibling; + } + applyDefs(this._defs, this._defsUsePending); + this._defsUsePending = []; + let viewBoxRect; + let viewBoxTransform; + if (viewBox) { + const viewBoxArr = splitNumberSequence(viewBox); + if (viewBoxArr.length >= 4) { + viewBoxRect = { + x: parseFloat(viewBoxArr[0] || 0), + y: parseFloat(viewBoxArr[1] || 0), + width: parseFloat(viewBoxArr[2]), + height: parseFloat(viewBoxArr[3]) + }; + } + } + if (viewBoxRect && width != null && height != null) { + viewBoxTransform = makeViewBoxTransform(viewBoxRect, {x: 0, y: 0, width, height}); + if (!opt.ignoreViewBox) { + const elRoot = root; + root = new Group_default(); + root.add(elRoot); + elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale; + elRoot.x = viewBoxTransform.x; + elRoot.y = viewBoxTransform.y; + } + } + if (!opt.ignoreRootClip && width != null && height != null) { + root.setClipPath(new Rect_default({ + shape: {x: 0, y: 0, width, height} + })); } - /** - * If a block is tsv format - */ - function isTSVFormat(block) { - // Simple method to find out if a block is tsv format - var firstLine = block.slice(0, block.indexOf('\n')); - if (firstLine.indexOf(ITEM_SPLITER) >= 0) { - return true; + return { + root, + width, + height, + viewBoxRect, + viewBoxTransform, + named + }; + } + _parseNode(xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) { + const nodeName = xmlNode.nodeName.toLowerCase(); + let el; + let namedFromForSub = namedFrom; + if (nodeName === "defs") { + isInDefs = true; + } + if (nodeName === "text") { + isInText = true; + } + if (nodeName === "defs" || nodeName === "switch") { + el = parentGroup; + } else { + if (!isInDefs) { + const parser2 = nodeParsers[nodeName]; + if (parser2 && hasOwn(nodeParsers, nodeName)) { + el = parser2.call(this, xmlNode, parentGroup); + const nameAttr = xmlNode.getAttribute("name"); + if (nameAttr) { + const newNamed = { + name: nameAttr, + namedFrom: null, + svgNodeTagLower: nodeName, + el + }; + named.push(newNamed); + if (nodeName === "g") { + namedFromForSub = newNamed; + } + } else if (namedFrom) { + named.push({ + name: namedFrom.name, + namedFrom, + svgNodeTagLower: nodeName, + el + }); + } + parentGroup.add(el); + } } - } - var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g'); - /** - * @param {string} tsv - * @return {Object} - */ - function parseTSVContents(tsv) { - var tsvLines = tsv.split(/\n+/g); - var headers = trim$1(tsvLines.shift()).split(itemSplitRegex); - var categories = []; - var series = map(headers, function (header) { - return { - name: header, - data: [] - }; - }); - for (var i = 0; i < tsvLines.length; i++) { - var items = trim$1(tsvLines[i]).split(itemSplitRegex); - categories.push(items.shift()); - for (var j = 0; j < items.length; j++) { - series[j] && (series[j].data[i] = items[j]); + const parser = paintServerParsers[nodeName]; + if (parser && hasOwn(paintServerParsers, nodeName)) { + const def = parser.call(this, xmlNode); + const id = xmlNode.getAttribute("id"); + if (id) { + this._defs[id] = def; } } - return { - series: series, - categories: categories - }; } - function parseListContents(str) { - var lines = str.split(/\n+/g); - var seriesName = trim$1(lines.shift()); - var data = []; - for (var i = 0; i < lines.length; i++) { - // if line is empty, ignore it. - // there is a case that a user forgot to delete `\n`. - var line = trim$1(lines[i]); - if (!line) { - continue; - } - var items = line.split(itemSplitRegex); - var name_1 = ''; - var value = void 0; - var hasName = false; - if (isNaN(items[0])) { - // First item is name - hasName = true; - name_1 = items[0]; - items = items.slice(1); - data[i] = { - name: name_1, - value: [] - }; - value = data[i].value; - } else { - value = data[i] = []; - } - for (var j = 0; j < items.length; j++) { - value.push(+items[j]); - } - if (value.length === 1) { - hasName ? data[i].value = value[0] : data[i] = value[0]; + if (el && el.isGroup) { + let child = xmlNode.firstChild; + while (child) { + if (child.nodeType === 1) { + this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText); + } else if (child.nodeType === 3 && isInText) { + this._parseText(child, el); } + child = child.nextSibling; } - return { - name: seriesName, - data: data - }; } - function parseContents(str, blockMetaList) { - var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g')); - var newOption = { - series: [] - }; - each(blocks, function (block, idx) { - if (isTSVFormat(block)) { - var result = parseTSVContents(block); - var blockMeta = blockMetaList[idx]; - var axisKey = blockMeta.axisDim + 'Axis'; - if (blockMeta) { - newOption[axisKey] = newOption[axisKey] || []; - newOption[axisKey][blockMeta.axisIndex] = { - data: result.categories - }; - newOption.series = newOption.series.concat(result.series); - } - } else { - var result = parseListContents(block); - newOption.series.push(result); - } + } + _parseText(xmlNode, parentGroup) { + const text = new TSpan_default({ + style: { + text: xmlNode.textContent + }, + silent: true, + x: this._textX || 0, + y: this._textY || 0 + }); + inheritStyle(parentGroup, text); + parseAttributes(xmlNode, text, this._defsUsePending, false, false); + applyTextAlignment(text, parentGroup); + const textStyle = text.style; + const fontSize = textStyle.fontSize; + if (fontSize && fontSize < 9) { + textStyle.fontSize = 9; + text.scaleX *= fontSize / 9; + text.scaleY *= fontSize / 9; + } + const font = (textStyle.fontSize || textStyle.fontFamily) && [ + textStyle.fontStyle, + textStyle.fontWeight, + (textStyle.fontSize || 12) + "px", + textStyle.fontFamily || "sans-serif" + ].join(" "); + textStyle.font = font; + const rect = text.getBoundingRect(); + this._textX += rect.width; + parentGroup.add(text); + return text; + } +}; +SVGParser.internalField = function() { + nodeParsers = { + g: function(xmlNode, parentGroup) { + const g = new Group_default(); + inheritStyle(parentGroup, g); + parseAttributes(xmlNode, g, this._defsUsePending, false, false); + return g; + }, + rect: function(xmlNode, parentGroup) { + const rect = new Rect_default(); + inheritStyle(parentGroup, rect); + parseAttributes(xmlNode, rect, this._defsUsePending, false, false); + 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") }); - return newOption; - } - var DataView = /** @class */function (_super) { - __extends(DataView, _super); - function DataView() { - return _super !== null && _super.apply(this, arguments) || this; - } - DataView.prototype.onclick = function (ecModel, api) { - // FIXME: better way? - setTimeout(function () { - api.dispatchAction({ - type: 'hideTip' - }); - }); - var container = api.getDom(); - var model = this.model; - if (this._dom) { - container.removeChild(this._dom); - } - var root = document.createElement('div'); - // use padding to avoid 5px whitespace - root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px'; - root.style.backgroundColor = model.get('backgroundColor') || '#fff'; - // Create elements - var header = document.createElement('h4'); - var lang = model.get('lang') || []; - header.innerHTML = lang[0] || model.get('title'); - header.style.cssText = 'margin:10px 20px'; - header.style.color = model.get('textColor'); - var viewMain = document.createElement('div'); - var textarea = document.createElement('textarea'); - viewMain.style.cssText = 'overflow:auto'; - var optionToContent = model.get('optionToContent'); - var contentToOption = model.get('contentToOption'); - var result = getContentFromModel(ecModel); - if (isFunction(optionToContent)) { - var htmlOrDom = optionToContent(api.getOption()); - if (isString(htmlOrDom)) { - viewMain.innerHTML = htmlOrDom; - } else if (isDom(htmlOrDom)) { - viewMain.appendChild(htmlOrDom); - } - } else { - // Use default textarea - textarea.readOnly = model.get('readOnly'); - var style = textarea.style; - // eslint-disable-next-line max-len - style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none'; - style.color = model.get('textColor'); - style.borderColor = model.get('textareaBorderColor'); - style.backgroundColor = model.get('textareaColor'); - textarea.value = result.value; - viewMain.appendChild(textarea); - } - var blockMetaList = result.meta; - var buttonContainer = document.createElement('div'); - buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0'; - // eslint-disable-next-line max-len - var buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px'; - var closeButton = document.createElement('div'); - var refreshButton = document.createElement('div'); - buttonStyle += ';background-color:' + model.get('buttonColor'); - buttonStyle += ';color:' + model.get('buttonTextColor'); - var self = this; - function close() { - container.removeChild(root); - self._dom = null; - } - addEventListener(closeButton, 'click', close); - addEventListener(refreshButton, 'click', function () { - if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) { - if ("development" !== 'production') { - // eslint-disable-next-line - warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.'); - } - close(); - return; - } - var newOption; - try { - if (isFunction(contentToOption)) { - newOption = contentToOption(viewMain, api.getOption()); - } else { - newOption = parseContents(textarea.value, blockMetaList); - } - } catch (e) { - close(); - throw new Error('Data view format error ' + e); - } - if (newOption) { - api.dispatchAction({ - type: 'changeDataView', - newOption: newOption - }); - } - close(); - }); - closeButton.innerHTML = lang[1]; - refreshButton.innerHTML = lang[2]; - refreshButton.style.cssText = closeButton.style.cssText = buttonStyle; - !model.get('readOnly') && buttonContainer.appendChild(refreshButton); - buttonContainer.appendChild(closeButton); - root.appendChild(header); - root.appendChild(viewMain); - root.appendChild(buttonContainer); - viewMain.style.height = container.clientHeight - 80 + 'px'; - container.appendChild(root); - this._dom = root; - }; - DataView.prototype.remove = function (ecModel, api) { - this._dom && api.getDom().removeChild(this._dom); - }; - DataView.prototype.dispose = function (ecModel, api) { - this.remove(ecModel, api); - }; - DataView.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - readOnly: false, - optionToContent: null, - contentToOption: null, - // eslint-disable-next-line - icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28', - title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']), - lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']), - backgroundColor: '#fff', - textColor: '#000', - textareaColor: '#fff', - textareaBorderColor: '#333', - buttonColor: '#c23531', - buttonTextColor: '#fff' - }; - return defaultOption; - }; - return DataView; - }(ToolboxFeature); - /** - * @inner - */ - function tryMergeDataOption(newData, originalData) { - return map(newData, function (newVal, idx) { - var original = originalData && originalData[idx]; - if (isObject(original) && !isArray(original)) { - var newValIsObject = isObject(newVal) && !isArray(newVal); - if (!newValIsObject) { - newVal = { - value: newVal - }; - } - // original data has name but new data has no name - var shouldDeleteName = original.name != null && newVal.name == null; - // Original data has option - newVal = defaults(newVal, original); - shouldDeleteName && delete newVal.name; - return newVal; - } else { - return newVal; - } + rect.silent = true; + return rect; + }, + circle: function(xmlNode, parentGroup) { + const circle = new Circle_default(); + inheritStyle(parentGroup, circle); + parseAttributes(xmlNode, circle, this._defsUsePending, false, false); + circle.setShape({ + cx: parseFloat(xmlNode.getAttribute("cx") || "0"), + cy: parseFloat(xmlNode.getAttribute("cy") || "0"), + r: parseFloat(xmlNode.getAttribute("r") || "0") }); - } - // TODO: SELF REGISTERED. - registerAction({ - type: 'changeDataView', - event: 'dataViewChanged', - update: 'prepareAndUpdate' - }, function (payload, ecModel) { - var newSeriesOptList = []; - each(payload.newOption.series, function (seriesOpt) { - var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; - if (!seriesModel) { - // New created series - // Geuss the series type - newSeriesOptList.push(extend({ - // Default is scatter - type: 'scatter' - }, seriesOpt)); - } else { - var originalData = seriesModel.get('data'); - newSeriesOptList.push({ - name: seriesOpt.name, - data: tryMergeDataOption(seriesOpt.data, originalData) - }); - } + circle.silent = true; + return circle; + }, + line: function(xmlNode, parentGroup) { + const line2 = new Line_default(); + inheritStyle(parentGroup, line2); + parseAttributes(xmlNode, line2, this._defsUsePending, false, false); + line2.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") }); - ecModel.mergeOption(defaults({ - series: newSeriesOptList - }, payload.newOption)); - }); - - var each$9 = each; - var inner$f = makeInner(); - /** - * @param ecModel - * @param newSnapshot key is dataZoomId - */ - function push(ecModel, newSnapshot) { - var storedSnapshots = getStoreSnapshots(ecModel); - // If previous dataZoom can not be found, - // complete an range with current range. - each$9(newSnapshot, function (batchItem, dataZoomId) { - var i = storedSnapshots.length - 1; - for (; i >= 0; i--) { - var snapshot = storedSnapshots[i]; - if (snapshot[dataZoomId]) { - break; - } - } - if (i < 0) { - // No origin range set, create one by current range. - var dataZoomModel = ecModel.queryComponents({ - mainType: 'dataZoom', - subType: 'select', - id: dataZoomId - })[0]; - if (dataZoomModel) { - var percentRange = dataZoomModel.getPercentRange(); - storedSnapshots[0][dataZoomId] = { - dataZoomId: dataZoomId, - start: percentRange[0], - end: percentRange[1] - }; - } - } + line2.silent = true; + return line2; + }, + ellipse: function(xmlNode, parentGroup) { + const ellipse = new Ellipse_default(); + inheritStyle(parentGroup, ellipse); + parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false); + 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") }); - storedSnapshots.push(newSnapshot); - } - function pop(ecModel) { - var storedSnapshots = getStoreSnapshots(ecModel); - var head = storedSnapshots[storedSnapshots.length - 1]; - storedSnapshots.length > 1 && storedSnapshots.pop(); - // Find top for all dataZoom. - var snapshot = {}; - each$9(head, function (batchItem, dataZoomId) { - for (var i = storedSnapshots.length - 1; i >= 0; i--) { - batchItem = storedSnapshots[i][dataZoomId]; - if (batchItem) { - snapshot[dataZoomId] = batchItem; - break; - } - } + ellipse.silent = true; + return ellipse; + }, + polygon: function(xmlNode, parentGroup) { + const pointsStr = xmlNode.getAttribute("points"); + let pointsArr; + if (pointsStr) { + pointsArr = parsePoints(pointsStr); + } + const polygon = new Polygon_default({ + shape: { + points: pointsArr || [] + }, + silent: true + }); + inheritStyle(parentGroup, polygon); + parseAttributes(xmlNode, polygon, this._defsUsePending, false, false); + return polygon; + }, + polyline: function(xmlNode, parentGroup) { + const pointsStr = xmlNode.getAttribute("points"); + let pointsArr; + if (pointsStr) { + pointsArr = parsePoints(pointsStr); + } + const polyline = new Polyline_default({ + shape: { + points: pointsArr || [] + }, + silent: true + }); + inheritStyle(parentGroup, polyline); + parseAttributes(xmlNode, polyline, this._defsUsePending, false, false); + return polyline; + }, + image: function(xmlNode, parentGroup) { + const img = new Image_default(); + inheritStyle(parentGroup, img); + parseAttributes(xmlNode, img, this._defsUsePending, false, false); + img.setStyle({ + image: xmlNode.getAttribute("xlink:href") || xmlNode.getAttribute("href"), + x: +xmlNode.getAttribute("x"), + y: +xmlNode.getAttribute("y"), + width: +xmlNode.getAttribute("width"), + height: +xmlNode.getAttribute("height") }); - return snapshot; + img.silent = true; + return img; + }, + text: function(xmlNode, parentGroup) { + const x = xmlNode.getAttribute("x") || "0"; + const y = xmlNode.getAttribute("y") || "0"; + const dx = xmlNode.getAttribute("dx") || "0"; + const dy = xmlNode.getAttribute("dy") || "0"; + this._textX = parseFloat(x) + parseFloat(dx); + this._textY = parseFloat(y) + parseFloat(dy); + const g = new Group_default(); + inheritStyle(parentGroup, g); + parseAttributes(xmlNode, g, this._defsUsePending, false, true); + return g; + }, + tspan: function(xmlNode, parentGroup) { + const x = xmlNode.getAttribute("x"); + const y = xmlNode.getAttribute("y"); + if (x != null) { + this._textX = parseFloat(x); + } + if (y != null) { + this._textY = parseFloat(y); + } + const dx = xmlNode.getAttribute("dx") || "0"; + const dy = xmlNode.getAttribute("dy") || "0"; + const g = new Group_default(); + inheritStyle(parentGroup, g); + parseAttributes(xmlNode, g, this._defsUsePending, false, true); + this._textX += parseFloat(dx); + this._textY += parseFloat(dy); + return g; + }, + path: function(xmlNode, parentGroup) { + const d = xmlNode.getAttribute("d") || ""; + const path = createFromString(d); + inheritStyle(parentGroup, path); + parseAttributes(xmlNode, path, this._defsUsePending, false, false); + path.silent = true; + return path; } - function clear$1(ecModel) { - inner$f(ecModel).snapshots = null; + }; +}(); +var paintServerParsers = { + lineargradient: function(xmlNode) { + const x1 = parseInt(xmlNode.getAttribute("x1") || "0", 10); + const y1 = parseInt(xmlNode.getAttribute("y1") || "0", 10); + const x2 = parseInt(xmlNode.getAttribute("x2") || "10", 10); + const y2 = parseInt(xmlNode.getAttribute("y2") || "0", 10); + const gradient = new LinearGradient_default(x1, y1, x2, y2); + parsePaintServerUnit(xmlNode, gradient); + parseGradientColorStops(xmlNode, gradient); + return gradient; + }, + radialgradient: function(xmlNode) { + const cx = parseInt(xmlNode.getAttribute("cx") || "0", 10); + const cy = parseInt(xmlNode.getAttribute("cy") || "0", 10); + const r = parseInt(xmlNode.getAttribute("r") || "0", 10); + const gradient = new RadialGradient_default(cx, cy, r); + parsePaintServerUnit(xmlNode, gradient); + parseGradientColorStops(xmlNode, gradient); + return gradient; + } +}; +function parsePaintServerUnit(xmlNode, gradient) { + const gradientUnits = xmlNode.getAttribute("gradientUnits"); + if (gradientUnits === "userSpaceOnUse") { + gradient.global = true; + } +} +function parseGradientColorStops(xmlNode, gradient) { + let stop2 = xmlNode.firstChild; + while (stop2) { + if (stop2.nodeType === 1 && stop2.nodeName.toLocaleLowerCase() === "stop") { + const offsetStr = stop2.getAttribute("offset"); + let offset; + if (offsetStr && offsetStr.indexOf("%") > 0) { + offset = parseInt(offsetStr, 10) / 100; + } else if (offsetStr) { + offset = parseFloat(offsetStr); + } else { + offset = 0; + } + const styleVals = {}; + parseInlineStyle(stop2, styleVals, styleVals); + const stopColor = styleVals.stopColor || stop2.getAttribute("stop-color") || "#000000"; + gradient.colorStops.push({ + offset, + color: stopColor + }); } - function count(ecModel) { - return getStoreSnapshots(ecModel).length; + stop2 = stop2.nextSibling; + } +} +function inheritStyle(parent, child) { + if (parent && parent.__inheritedStyle) { + if (!child.__inheritedStyle) { + child.__inheritedStyle = {}; + } + defaults(child.__inheritedStyle, parent.__inheritedStyle); + } +} +function parsePoints(pointsString) { + const list = splitNumberSequence(pointsString); + const points4 = []; + for (let i = 0; i < list.length; i += 2) { + const x = parseFloat(list[i]); + const y = parseFloat(list[i + 1]); + points4.push([x, y]); + } + return points4; +} +function parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) { + const disp = el; + const inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {}; + const selfStyle = {}; + if (xmlNode.nodeType === 1) { + parseTransformAttribute(xmlNode, el); + parseInlineStyle(xmlNode, inheritedStyle, selfStyle); + if (!onlyInlineStyle) { + parseAttributeStyle(xmlNode, inheritedStyle, selfStyle); + } + } + disp.style = disp.style || {}; + if (inheritedStyle.fill != null) { + disp.style.fill = getFillStrokeStyle(disp, "fill", inheritedStyle.fill, defsUsePending); + } + if (inheritedStyle.stroke != null) { + disp.style.stroke = getFillStrokeStyle(disp, "stroke", inheritedStyle.stroke, defsUsePending); + } + each([ + "lineWidth", + "opacity", + "fillOpacity", + "strokeOpacity", + "miterLimit", + "fontSize" + ], function(propName) { + if (inheritedStyle[propName] != null) { + disp.style[propName] = parseFloat(inheritedStyle[propName]); + } + }); + each([ + "lineDashOffset", + "lineCap", + "lineJoin", + "fontWeight", + "fontFamily", + "fontStyle", + "textAlign" + ], function(propName) { + if (inheritedStyle[propName] != null) { + disp.style[propName] = inheritedStyle[propName]; + } + }); + if (isTextGroup) { + disp.__selfStyle = selfStyle; + } + if (inheritedStyle.lineDash) { + disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function(str) { + return parseFloat(str); + }); + } + if (inheritedStyle.visibility === "hidden" || inheritedStyle.visibility === "collapse") { + disp.invisible = true; + } + if (inheritedStyle.display === "none") { + disp.ignore = true; + } +} +function applyTextAlignment(text, parentGroup) { + const parentSelfStyle = parentGroup.__selfStyle; + if (parentSelfStyle) { + const textBaseline = parentSelfStyle.textBaseline; + let zrTextBaseline = textBaseline; + if (!textBaseline || textBaseline === "auto") { + zrTextBaseline = "alphabetic"; + } else if (textBaseline === "baseline") { + zrTextBaseline = "alphabetic"; + } else if (textBaseline === "before-edge" || textBaseline === "text-before-edge") { + zrTextBaseline = "top"; + } else if (textBaseline === "after-edge" || textBaseline === "text-after-edge") { + zrTextBaseline = "bottom"; + } else if (textBaseline === "central" || textBaseline === "mathematical") { + zrTextBaseline = "middle"; + } + text.style.textBaseline = zrTextBaseline; + } + const parentInheritedStyle = parentGroup.__inheritedStyle; + if (parentInheritedStyle) { + const textAlign = parentInheritedStyle.textAlign; + let zrTextAlign = textAlign; + if (textAlign) { + if (textAlign === "middle") { + zrTextAlign = "center"; + } + text.style.textAlign = zrTextAlign; + } + } +} +var urlRegex = /^url\(\s*#(.*?)\)/; +function getFillStrokeStyle(el, method, str, defsUsePending) { + const urlMatch = str && str.match(urlRegex); + if (urlMatch) { + const url = trim(urlMatch[1]); + defsUsePending.push([el, method, url]); + return; + } + if (str === "none") { + str = null; + } + return str; +} +function applyDefs(defs, defsUsePending) { + for (let i = 0; i < defsUsePending.length; i++) { + const item = defsUsePending[i]; + item[0].style[item[1]] = defs[item[2]]; + } +} +var numberReg2 = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g; +function splitNumberSequence(rawStr) { + return rawStr.match(numberReg2) || []; +} +var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g; +var DEGREE_TO_ANGLE = Math.PI / 180; +function parseTransformAttribute(xmlNode, node) { + let transform2 = xmlNode.getAttribute("transform"); + if (transform2) { + transform2 = transform2.replace(/,/g, " "); + const transformOps = []; + let mt = null; + transform2.replace(transformRegex, function(str, type, value) { + transformOps.push(type, value); + return ""; + }); + for (let i = transformOps.length - 1; i > 0; i -= 2) { + const value = transformOps[i]; + const type = transformOps[i - 1]; + const valueArr = splitNumberSequence(value); + mt = mt || create2(); + switch (type) { + case "translate": + translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || "0")]); + break; + case "scale": + scale2(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]); + break; + case "rotate": + rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [ + parseFloat(valueArr[1] || "0"), + parseFloat(valueArr[2] || "0") + ]); + break; + case "skewX": + const sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE); + mul2(mt, [1, 0, sx, 1, 0, 0], mt); + break; + case "skewY": + const sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE); + mul2(mt, [1, sy, 0, 1, 0, 0], mt); + break; + case "matrix": + mt[0] = parseFloat(valueArr[0]); + mt[1] = parseFloat(valueArr[1]); + mt[2] = parseFloat(valueArr[2]); + mt[3] = parseFloat(valueArr[3]); + mt[4] = parseFloat(valueArr[4]); + mt[5] = parseFloat(valueArr[5]); + break; + } } - /** - * History length of each dataZoom may be different. - * this._history[0] is used to store origin range. - */ - function getStoreSnapshots(ecModel) { - var store = inner$f(ecModel); - if (!store.snapshots) { - store.snapshots = [{}]; + node.setLocalTransform(mt); + } +} +var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g; +function parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) { + const style = xmlNode.getAttribute("style"); + if (!style) { + return; + } + styleRegex.lastIndex = 0; + let styleRegResult; + while ((styleRegResult = styleRegex.exec(style)) != null) { + const svgStlAttr = styleRegResult[1]; + const zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null; + if (zrInheritableStlAttr) { + inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2]; + } + const zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null; + if (zrSelfStlAttr) { + selfStyleResult[zrSelfStlAttr] = styleRegResult[2]; + } + } +} +function parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) { + for (let i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) { + const svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i]; + const attrValue = xmlNode.getAttribute(svgAttrName); + if (attrValue != null) { + inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue; + } + } + for (let i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) { + const svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i]; + const attrValue = xmlNode.getAttribute(svgAttrName); + if (attrValue != null) { + selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue; + } + } +} +function makeViewBoxTransform(viewBoxRect, boundingRect) { + const scaleX = boundingRect.width / viewBoxRect.width; + const scaleY = boundingRect.height / viewBoxRect.height; + const scale4 = Math.min(scaleX, scaleY); + return { + scale: scale4, + x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale4 + (boundingRect.x + boundingRect.width / 2), + y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale4 + (boundingRect.y + boundingRect.height / 2) + }; +} +function parseSVG(xml, opt) { + const parser = new SVGParser(); + return parser.parse(xml, opt); +} + +// src/coord/geo/GeoSVGResource.ts +var REGION_AVAILABLE_SVG_TAG_MAP = createHashMap([ + "rect", + "circle", + "line", + "ellipse", + "polygon", + "polyline", + "path", + "text", + "tspan", + "g" +]); +var GeoSVGResource = class { + constructor(mapName, svg) { + this.type = "geoSVG"; + this._usedGraphicMap = createHashMap(); + this._freedGraphics = []; + this._mapName = mapName; + this._parsedXML = parseXML(svg); + } + load() { + let firstGraphic = this._firstGraphic; + if (!firstGraphic) { + firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML); + this._freedGraphics.push(firstGraphic); + this._boundingRect = this._firstGraphic.boundingRect.clone(); + const {regions, regionsMap} = createRegions(firstGraphic.named); + this._regions = regions; + this._regionsMap = regionsMap; + } + return { + boundingRect: this._boundingRect, + regions: this._regions, + regionsMap: this._regionsMap + }; + } + _buildGraphic(svgXML) { + let result; + let rootFromParse; + try { + result = svgXML && parseSVG(svgXML, { + ignoreViewBox: true, + ignoreRootClip: true + }) || {}; + rootFromParse = result.root; + assert(rootFromParse != null); + } catch (e2) { + throw new Error("Invalid svg format\n" + e2.message); + } + const root = new Group_default(); + root.add(rootFromParse); + root.isGeoSVGGraphicRoot = true; + const svgWidth = result.width; + const svgHeight = result.height; + const viewBoxRect = result.viewBoxRect; + let boundingRect = this._boundingRect; + if (!boundingRect) { + let bRectX; + let bRectY; + let bRectWidth; + let bRectHeight; + if (svgWidth != null) { + bRectX = 0; + bRectWidth = svgWidth; + } else if (viewBoxRect) { + bRectX = viewBoxRect.x; + bRectWidth = viewBoxRect.width; + } + if (svgHeight != null) { + bRectY = 0; + bRectHeight = svgHeight; + } else if (viewBoxRect) { + bRectY = viewBoxRect.y; + bRectHeight = viewBoxRect.height; + } + if (bRectX == null || bRectY == null) { + const calculatedBoundingRect = rootFromParse.getBoundingRect(); + if (bRectX == null) { + bRectX = calculatedBoundingRect.x; + bRectWidth = calculatedBoundingRect.width; + } + if (bRectY == null) { + bRectY = calculatedBoundingRect.y; + bRectHeight = calculatedBoundingRect.height; + } + } + boundingRect = this._boundingRect = new BoundingRect_default(bRectX, bRectY, bRectWidth, bRectHeight); + } + if (viewBoxRect) { + const viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); + rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale; + rootFromParse.x = viewBoxTransform.x; + rootFromParse.y = viewBoxTransform.y; + } + root.setClipPath(new Rect_default({ + shape: boundingRect.plain() + })); + const named = []; + each(result.named, (namedItem) => { + if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) { + named.push(namedItem); + setSilent(namedItem.el); + } + }); + return {root, boundingRect, named}; + } + useGraphic(hostKey) { + const usedRootMap = this._usedGraphicMap; + let svgGraphic = usedRootMap.get(hostKey); + if (svgGraphic) { + return svgGraphic; + } + svgGraphic = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML); + usedRootMap.set(hostKey, svgGraphic); + return svgGraphic; + } + freeGraphic(hostKey) { + const usedRootMap = this._usedGraphicMap; + const svgGraphic = usedRootMap.get(hostKey); + if (svgGraphic) { + usedRootMap.removeKey(hostKey); + this._freedGraphics.push(svgGraphic); + } + } +}; +function setSilent(el) { + el.silent = false; + if (el.isGroup) { + el.traverse((child) => { + child.silent = false; + }); + } +} +function createRegions(named) { + const regions = []; + const regionsMap = createHashMap(); + each(named, (namedItem) => { + if (namedItem.namedFrom != null) { + return; + } + const region = new GeoSVGRegion(namedItem.name, namedItem.el); + regions.push(region); + regionsMap.set(namedItem.name, region); + }); + return {regions, regionsMap}; +} + +// src/coord/geo/fix/nanhai.ts +var geoCoord = [126, 25]; +var nanhaiName = "\u5357\u6D77\u8BF8\u5C9B"; +var points2 = [ + [ + [0, 3.5], + [7, 11.2], + [15, 11.9], + [30, 7], + [42, 0.7], + [52, 0.7], + [56, 7.7], + [59, 0.7], + [64, 0.7], + [64, 0], + [5, 0], + [0, 3.5] + ], + [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], + [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], + [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], + [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], + [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], + [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], + [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], + [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], + [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], + [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], + [ + [0, 3.5], + [0, 93.1], + [64, 93.1], + [64, 0], + [63, 0], + [63, 92.4], + [1, 92.4], + [1, 3.5], + [0, 3.5] + ] +]; +for (let i = 0; i < points2.length; i++) { + for (let k = 0; k < points2[i].length; k++) { + points2[i][k][0] /= 10.5; + points2[i][k][1] /= -10.5 / 0.75; + points2[i][k][0] += geoCoord[0]; + points2[i][k][1] += geoCoord[1]; + } +} +function fixNanhai(mapType, regions) { + if (mapType === "china") { + for (let i = 0; i < regions.length; i++) { + if (regions[i].name === nanhaiName) { + return; } - return store.snapshots; } - - var RestoreOption = /** @class */function (_super) { - __extends(RestoreOption, _super); - function RestoreOption() { - return _super !== null && _super.apply(this, arguments) || this; + regions.push(new GeoJSONRegion(nanhaiName, map(points2, function(exterior) { + return { + type: "polygon", + exterior + }; + }), geoCoord)); + } +} + +// src/coord/geo/fix/textCoord.ts +var coordsOffsetMap = { + \u5357\u6D77\u8BF8\u5C9B: [32, 80], + \u5E7F\u4E1C: [0, -10], + \u9999\u6E2F: [10, 5], + \u6FB3\u95E8: [-10, 10], + \u5929\u6D25: [5, 5] +}; +function fixTextCoords(mapType, region) { + if (mapType === "china") { + const coordFix = coordsOffsetMap[region.name]; + if (coordFix) { + const cp = region.getCenter(); + cp[0] += coordFix[0] / 10.5; + cp[1] += -coordFix[1] / (10.5 / 0.75); + region.setCenter(cp); + } + } +} + +// src/coord/geo/fix/diaoyuIsland.ts +var points3 = [ + [ + [123.45165252685547, 25.73527164402261], + [123.49731445312499, 25.73527164402261], + [123.49731445312499, 25.750734064600884], + [123.45165252685547, 25.750734064600884], + [123.45165252685547, 25.73527164402261] + ] +]; +function fixDiaoyuIsland(mapType, region) { + if (mapType === "china" && region.name === "\u53F0\u6E7E") { + region.geometries.push({ + type: "polygon", + exterior: points3[0] + }); + } +} + +// src/coord/geo/GeoJSONResource.ts +var DEFAULT_NAME_PROPERTY = "name"; +var GeoJSONResource = class { + constructor(mapName, geoJSON, specialAreas) { + this.type = "geoJSON"; + this._parsedMap = createHashMap(); + this._mapName = mapName; + this._specialAreas = specialAreas; + this._geoJSON = parseInput(geoJSON); + } + load(nameMap, nameProperty) { + nameProperty = nameProperty || DEFAULT_NAME_PROPERTY; + let parsed = this._parsedMap.get(nameProperty); + if (!parsed) { + const rawRegions = this._parseToRegions(nameProperty); + parsed = this._parsedMap.set(nameProperty, { + regions: rawRegions, + boundingRect: calculateBoundingRect(rawRegions) + }); + } + const regionsMap = createHashMap(); + const finalRegions = []; + each(parsed.regions, function(region) { + let regionName = region.name; + if (nameMap && hasOwn(nameMap, regionName)) { + region = region.cloneShallow(regionName = nameMap[regionName]); } - RestoreOption.prototype.onclick = function (ecModel, api) { - clear$1(ecModel); - api.dispatchAction({ - type: 'restore', - from: this.uid - }); - }; - RestoreOption.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - // eslint-disable-next-line - icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5', - title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title']) - }; - return defaultOption; - }; - return RestoreOption; - }(ToolboxFeature); - // TODO: SELF REGISTERED. - registerAction({ - type: 'restore', - event: 'restore', - update: 'prepareAndUpdate' - }, function (payload, ecModel) { - ecModel.resetOption('recreate'); - }); - - // FIXME - // how to genarialize to more coordinate systems. - var INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap']; - var BrushTargetManager = /** @class */function () { - /** - * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid - * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]} - * @param opt.include include coordinate system types. - */ - function BrushTargetManager(finder, ecModel, opt) { - var _this = this; - this._targetInfoList = []; - var foundCpts = parseFinder$1(ecModel, finder); - each(targetInfoBuilders, function (builder, type) { - if (!opt || !opt.include || indexOf(opt.include, type) >= 0) { - builder(foundCpts, _this._targetInfoList); - } - }); + finalRegions.push(region); + regionsMap.set(regionName, region); + }); + return { + regions: finalRegions, + boundingRect: parsed.boundingRect || new BoundingRect_default(0, 0, 0, 0), + regionsMap + }; + } + _parseToRegions(nameProperty) { + const mapName = this._mapName; + const geoJSON = this._geoJSON; + let rawRegions; + try { + rawRegions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : []; + } catch (e2) { + throw new Error("Invalid geoJson format\n" + e2.message); + } + fixNanhai(mapName, rawRegions); + each(rawRegions, function(region) { + const regionName = region.name; + fixTextCoords(mapName, region); + fixDiaoyuIsland(mapName, region); + const specialArea = this._specialAreas && this._specialAreas[regionName]; + if (specialArea) { + region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height); + } + }, this); + return rawRegions; + } + getMapForUser() { + return { + geoJson: this._geoJSON, + geoJSON: this._geoJSON, + specialAreas: this._specialAreas + }; + } +}; +function calculateBoundingRect(regions) { + let rect; + for (let i = 0; i < regions.length; i++) { + const regionRect = regions[i].getBoundingRect(); + rect = rect || regionRect.clone(); + rect.union(regionRect); + } + return rect; +} +function parseInput(source) { + return !isString(source) ? source : typeof JSON !== "undefined" && JSON.parse ? JSON.parse(source) : new Function("return (" + source + ");")(); +} + +// src/coord/geo/geoSourceManager.ts +var storage = createHashMap(); +var geoSourceManager_default = { + registerMap: function(mapName, rawDef, rawSpecialAreas) { + if (rawDef.svg) { + const resource = new GeoSVGResource(mapName, rawDef.svg); + storage.set(mapName, resource); + } else { + let geoJSON = rawDef.geoJson || rawDef.geoJSON; + if (geoJSON && !rawDef.features) { + rawSpecialAreas = rawDef.specialAreas; + } else { + geoJSON = rawDef; + } + const resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas); + storage.set(mapName, resource); + } + }, + getGeoResource(mapName) { + return storage.get(mapName); + }, + getMapForUser: function(mapName) { + const resource = storage.get(mapName); + return resource && resource.type === "geoJSON" && resource.getMapForUser(); + }, + load: function(mapName, nameMap, nameProperty) { + const resource = storage.get(mapName); + if (!resource) { + if (true) { + console.error("Map " + mapName + " not exists. The GeoJSON of the map must be provided."); + } + return; + } + return resource.load(nameMap, nameProperty); + } +}; + +// src/component/helper/MapDraw.ts +var OPTION_STYLE_ENABLED_TAGS = [ + "rect", + "circle", + "line", + "ellipse", + "polygon", + "polyline", + "path" +]; +var OPTION_STYLE_ENABLED_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS); +var STATE_TRIGGER_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(["g"])); +var LABEL_HOST_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(["g"])); +var mapLabelRaw = makeInner(); +function getFixedItemStyle(model) { + const itemStyle = model.getItemStyle(); + const areaColor = model.get("areaColor"); + if (areaColor != null) { + itemStyle.fill = areaColor; + } + return itemStyle; +} +function fixLineStyle(styleHost) { + const style = styleHost.style; + if (style) { + style.stroke = style.stroke || style.fill; + style.fill = null; + } +} +var MapDraw = class { + constructor(api2) { + const group = new Group_default(); + this.uid = getUID("ec_map_draw"); + this._controller = new RoamController_default(api2.getZr()); + this._controllerHost = {target: group}; + this.group = group; + group.add(this._regionsGroup = new Group_default()); + group.add(this._svgGroup = new Group_default()); + } + draw(mapOrGeoModel, ecModel, api2, fromView, payload) { + const isGeo = mapOrGeoModel.mainType === "geo"; + let data = mapOrGeoModel.getData && mapOrGeoModel.getData(); + isGeo && ecModel.eachComponent({mainType: "series", subType: "map"}, function(mapSeries) { + if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) { + data = mapSeries.getData(); } - BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) { - this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { - (area.coordRanges || (area.coordRanges = [])).push(coordRange); - // area.coordRange is the first of area.coordRanges - if (!area.coordRange) { - area.coordRange = coordRange; - // In 'category' axis, coord to pixel is not reversible, so we can not - // rebuild range by coordRange accrately, which may bring trouble when - // brushing only one item. So we use __rangeOffset to rebuilding range - // by coordRange. And this it only used in brush component so it is no - // need to be adapted to coordRanges. - var result = coordConvert[area.brushType](0, coordSys, coordRange); - area.__rangeOffset = { - offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]), - xyMinMax: result.xyMinMax - }; - } - }); - return areas; - }; - BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) { - each(areas, function (area) { - var targetInfo = this.findTargetInfo(area, ecModel); - if (targetInfo && targetInfo !== true) { - each(targetInfo.coordSyses, function (coordSys) { - var result = coordConvert[area.brushType](1, coordSys, area.range, true); - cb(area, result.values, coordSys, ecModel); - }); - } - }, this); - }; - /** - * the `areas` is `BrushModel.areas`. - * Called in layout stage. - * convert `area.coordRange` to global range and set panelId to `area.range`. - */ - BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) { - each(areas, function (area) { - var targetInfo = this.findTargetInfo(area, ecModel); - if ("development" !== 'production') { - assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.'); - assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.'); - } - area.range = area.range || []; - // convert coordRange to global range and set panelId. - if (targetInfo && targetInfo !== true) { - area.panelId = targetInfo.panelId; - // (1) area.range should always be calculate from coordRange but does - // not keep its original value, for the sake of the dataZoom scenario, - // where area.coordRange remains unchanged but area.range may be changed. - // (2) Only support converting one coordRange to pixel range in brush - // component. So do not consider `coordRanges`. - // (3) About __rangeOffset, see comment above. - var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange); - var rangeOffset = area.__rangeOffset; - area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values; + }); + const geo = mapOrGeoModel.coordinateSystem; + const regionsGroup = this._regionsGroup; + const group = this.group; + const transformInfo = geo.getTransformInfo(); + const transformInfoRaw = transformInfo.raw; + const transformInfoRoam = transformInfo.roam; + const isFirstDraw = !regionsGroup.childAt(0) || payload; + if (isFirstDraw) { + group.x = transformInfoRoam.x; + group.y = transformInfoRoam.y; + group.scaleX = transformInfoRoam.scaleX; + group.scaleY = transformInfoRoam.scaleY; + group.dirty(); + } else { + updateProps(group, transformInfoRoam, mapOrGeoModel); + } + const isVisualEncodedByVisualMap = data && data.getVisual("visualMeta") && data.getVisual("visualMeta").length > 0; + const viewBuildCtx = { + api: api2, + geo, + mapOrGeoModel, + data, + isVisualEncodedByVisualMap, + isGeo, + transformInfoRaw + }; + if (geo.resourceType === "geoJSON") { + this._buildGeoJSON(viewBuildCtx); + } else if (geo.resourceType === "geoSVG") { + this._buildSVG(viewBuildCtx); + } + this._updateController(mapOrGeoModel, ecModel, api2); + this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api2, fromView); + } + _buildGeoJSON(viewBuildCtx) { + const regionsGroupByName = this._regionsGroupByName = createHashMap(); + const regionsInfoByName = createHashMap(); + const regionsGroup = this._regionsGroup; + const transformInfoRaw = viewBuildCtx.transformInfoRaw; + const mapOrGeoModel = viewBuildCtx.mapOrGeoModel; + const data = viewBuildCtx.data; + const projection = viewBuildCtx.geo.projection; + const projectionStream = projection && projection.stream; + function transformPoint(point, project) { + if (project) { + point = project(point); + } + return point && [ + point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, + point[1] * transformInfoRaw.scaleY + transformInfoRaw.y + ]; + } + ; + function transformPolygonPoints(inPoints) { + const outPoints = []; + const project = !projectionStream && projection && projection.project; + for (let i = 0; i < inPoints.length; ++i) { + const newPt = transformPoint(inPoints[i], project); + newPt && outPoints.push(newPt); + } + return outPoints; + } + function getPolyShape(points4) { + return { + shape: { + points: transformPolygonPoints(points4) + } + }; + } + regionsGroup.removeAll(); + each(viewBuildCtx.geo.regions, function(region) { + const regionName = region.name; + let regionGroup = regionsGroupByName.get(regionName); + let {dataIdx, regionModel} = regionsInfoByName.get(regionName) || {}; + if (!regionGroup) { + regionGroup = regionsGroupByName.set(regionName, new Group_default()); + regionsGroup.add(regionGroup); + dataIdx = data ? data.indexOfName(regionName) : null; + regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null; + regionsInfoByName.set(regionName, {dataIdx, regionModel}); + } + const polygonSubpaths = []; + const polylineSubpaths = []; + each(region.geometries, function(geometry) { + if (geometry.type === "polygon") { + let polys = [geometry.exterior].concat(geometry.interiors || []); + if (projectionStream) { + polys = projectPolys(polys, projectionStream); + } + each(polys, (poly) => { + polygonSubpaths.push(new Polygon_default(getPolyShape(poly))); + }); + } else { + let points4 = geometry.points; + if (projectionStream) { + points4 = projectPolys(points4, projectionStream, true); } - }, this); - }; - BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) { - return map(this._targetInfoList, function (targetInfo) { - var rect = targetInfo.getPanelRect(); - return { - panelId: targetInfo.panelId, - defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null, - clipPath: makeRectPanelClipPath(rect), - isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel), - getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect) - }; - }); - }; - BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) { - // Check whether area is bound in coord, and series do not belong to that coord. - // If do not do this check, some brush (like lineX) will controll all axes. - var targetInfo = this.findTargetInfo(area, ecModel); - return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0; - }; - /** - * If return Object, a coord found. - * If return true, global found. - * Otherwise nothing found. - */ - BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) { - var targetInfoList = this._targetInfoList; - var foundCpts = parseFinder$1(ecModel, area); - for (var i = 0; i < targetInfoList.length; i++) { - var targetInfo = targetInfoList[i]; - var areaPanelId = area.panelId; - if (areaPanelId) { - if (targetInfo.panelId === areaPanelId) { - return targetInfo; - } - } else { - for (var j = 0; j < targetInfoMatchers.length; j++) { - if (targetInfoMatchers[j](foundCpts, targetInfo)) { - return targetInfo; - } - } + each(points4, (points5) => { + polylineSubpaths.push(new Polyline_default(getPolyShape(points5))); + }); + } + }); + const centerPt = transformPoint(region.getCenter(), projection && projection.project); + function createCompoundPath(subpaths, isLine) { + if (!subpaths.length) { + return; + } + const compoundPath = new CompoundPath_default({ + culling: true, + segmentIgnoreThreshold: 1, + shape: { + paths: subpaths } + }); + regionGroup.add(compoundPath); + applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel); + resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt); + if (isLine) { + fixLineStyle(compoundPath); + each(compoundPath.states, fixLineStyle); + } + } + createCompoundPath(polygonSubpaths); + createCompoundPath(polylineSubpaths, true); + }); + regionsGroupByName.each(function(regionGroup, regionName) { + const {dataIdx, regionModel} = regionsInfoByName.get(regionName); + resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx); + resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); + resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); + }, this); + } + _buildSVG(viewBuildCtx) { + const mapName = viewBuildCtx.geo.map; + const transformInfoRaw = viewBuildCtx.transformInfoRaw; + this._svgGroup.x = transformInfoRaw.x; + this._svgGroup.y = transformInfoRaw.y; + this._svgGroup.scaleX = transformInfoRaw.scaleX; + this._svgGroup.scaleY = transformInfoRaw.scaleY; + if (this._svgResourceChanged(mapName)) { + this._freeSVG(); + this._useSVG(mapName); + } + const svgDispatcherMap = this._svgDispatcherMap = createHashMap(); + let focusSelf = false; + each(this._svgGraphicRecord.named, function(namedItem) { + const regionName = namedItem.name; + const mapOrGeoModel = viewBuildCtx.mapOrGeoModel; + const data = viewBuildCtx.data; + const svgNodeTagLower = namedItem.svgNodeTagLower; + const el = namedItem.el; + const dataIdx = data ? data.indexOfName(regionName) : null; + const regionModel = mapOrGeoModel.getRegionModel(regionName); + if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable_default) { + applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel); + } + if (el instanceof Displayable_default) { + el.culling = true; + } + el.z2EmphasisLift = 0; + if (!namedItem.namedFrom) { + if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) { + resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null); + } + resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx); + resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); + if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) { + const focus = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); + if (focus === "self") { + focusSelf = true; + } + const els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []); + els.push(el); + } + } + }, this); + this._enableBlurEntireSVG(focusSelf, viewBuildCtx); + } + _enableBlurEntireSVG(focusSelf, viewBuildCtx) { + if (focusSelf && viewBuildCtx.isGeo) { + const blurStyle = viewBuildCtx.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle(); + const opacity = blurStyle.opacity; + this._svgGraphicRecord.root.traverse((el) => { + if (!el.isGroup) { + setDefaultStateProxy(el); + const style = el.ensureState("blur").style || {}; + if (style.opacity == null && opacity != null) { + style.opacity = opacity; + } + el.ensureState("emphasis"); } - return true; - }; - return BrushTargetManager; - }(); - function formatMinMax(minMax) { - minMax[0] > minMax[1] && minMax.reverse(); - return minMax; - } - function parseFinder$1(ecModel, finder) { - return parseFinder(ecModel, finder, { - includeMainTypes: INCLUDE_FINDER_MAIN_TYPES }); } - var targetInfoBuilders = { - grid: function (foundCpts, targetInfoList) { - var xAxisModels = foundCpts.xAxisModels; - var yAxisModels = foundCpts.yAxisModels; - var gridModels = foundCpts.gridModels; - // Remove duplicated. - var gridModelMap = createHashMap(); - var xAxesHas = {}; - var yAxesHas = {}; - if (!xAxisModels && !yAxisModels && !gridModels) { + } + remove() { + this._regionsGroup.removeAll(); + this._regionsGroupByName = null; + this._svgGroup.removeAll(); + this._freeSVG(); + this._controller.dispose(); + this._controllerHost = null; + } + findHighDownDispatchers(name, geoModel) { + if (name == null) { + return []; + } + const geo = geoModel.coordinateSystem; + if (geo.resourceType === "geoJSON") { + const regionsGroupByName = this._regionsGroupByName; + if (regionsGroupByName) { + const regionGroup = regionsGroupByName.get(name); + return regionGroup ? [regionGroup] : []; + } + } else if (geo.resourceType === "geoSVG") { + return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || []; + } + } + _svgResourceChanged(mapName) { + return this._svgMapName !== mapName; + } + _useSVG(mapName) { + const resource = geoSourceManager_default.getGeoResource(mapName); + if (resource && resource.type === "geoSVG") { + const svgGraphic = resource.useGraphic(this.uid); + this._svgGroup.add(svgGraphic.root); + this._svgGraphicRecord = svgGraphic; + this._svgMapName = mapName; + } + } + _freeSVG() { + const mapName = this._svgMapName; + if (mapName == null) { + return; + } + const resource = geoSourceManager_default.getGeoResource(mapName); + if (resource && resource.type === "geoSVG") { + resource.freeGraphic(this.uid); + } + this._svgGraphicRecord = null; + this._svgDispatcherMap = null; + this._svgGroup.removeAll(); + this._svgMapName = null; + } + _updateController(mapOrGeoModel, ecModel, api2) { + const geo = mapOrGeoModel.coordinateSystem; + const controller = this._controller; + const controllerHost = this._controllerHost; + controllerHost.zoomLimit = mapOrGeoModel.get("scaleLimit"); + controllerHost.zoom = geo.getZoom(); + controller.enable(mapOrGeoModel.get("roam") || false); + const mainType = mapOrGeoModel.mainType; + function makeActionBase() { + const action = { + type: "geoRoam", + componentType: mainType + }; + action[mainType + "Id"] = mapOrGeoModel.id; + return action; + } + controller.off("pan").on("pan", function(e2) { + this._mouseDownFlag = false; + updateViewOnPan(controllerHost, e2.dx, e2.dy); + api2.dispatchAction(extend(makeActionBase(), { + dx: e2.dx, + dy: e2.dy, + animation: { + duration: 0 + } + })); + }, this); + controller.off("zoom").on("zoom", function(e2) { + this._mouseDownFlag = false; + updateViewOnZoom(controllerHost, e2.scale, e2.originX, e2.originY); + api2.dispatchAction(extend(makeActionBase(), { + totalZoom: controllerHost.zoom, + zoom: e2.scale, + originX: e2.originX, + originY: e2.originY, + animation: { + duration: 0 + } + })); + }, this); + controller.setPointerChecker(function(e2, x, y) { + return geo.containPoint([x, y]) && !onIrrelevantElement(e2, api2, mapOrGeoModel); + }); + } + resetForLabelLayout() { + this.group.traverse((el) => { + const label = el.getTextContent(); + if (label) { + label.ignore = mapLabelRaw(label).ignore; + } + }); + } + _updateMapSelectHandler(mapOrGeoModel, regionsGroup, api2, fromView) { + const mapDraw = this; + regionsGroup.off("mousedown"); + regionsGroup.off("click"); + if (mapOrGeoModel.get("selectedMode")) { + regionsGroup.on("mousedown", function() { + mapDraw._mouseDownFlag = true; + }); + regionsGroup.on("click", function(e2) { + if (!mapDraw._mouseDownFlag) { return; } - each(xAxisModels, function (axisModel) { - var gridModel = axisModel.axis.grid.model; - gridModelMap.set(gridModel.id, gridModel); - xAxesHas[gridModel.id] = true; - }); - each(yAxisModels, function (axisModel) { - var gridModel = axisModel.axis.grid.model; - gridModelMap.set(gridModel.id, gridModel); - yAxesHas[gridModel.id] = true; - }); - each(gridModels, function (gridModel) { - gridModelMap.set(gridModel.id, gridModel); - xAxesHas[gridModel.id] = true; - yAxesHas[gridModel.id] = true; - }); - gridModelMap.each(function (gridModel) { - var grid = gridModel.coordinateSystem; - var cartesians = []; - each(grid.getCartesians(), function (cartesian, index) { - if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) { - cartesians.push(cartesian); - } - }); - targetInfoList.push({ - panelId: 'grid--' + gridModel.id, - gridModel: gridModel, - coordSysModel: gridModel, - // Use the first one as the representitive coordSys. - coordSys: cartesians[0], - coordSyses: cartesians, - getPanelRect: panelRectBuilders.grid, - xAxisDeclared: xAxesHas[gridModel.id], - yAxisDeclared: yAxesHas[gridModel.id] - }); - }); - }, - geo: function (foundCpts, targetInfoList) { - each(foundCpts.geoModels, function (geoModel) { - var coordSys = geoModel.coordinateSystem; - targetInfoList.push({ - panelId: 'geo--' + geoModel.id, - geoModel: geoModel, - coordSysModel: geoModel, - coordSys: coordSys, - coordSyses: [coordSys], - getPanelRect: panelRectBuilders.geo - }); - }); + mapDraw._mouseDownFlag = false; + }); + } + } +}; +function applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) { + const normalStyleModel = regionModel.getModel("itemStyle"); + const emphasisStyleModel = regionModel.getModel(["emphasis", "itemStyle"]); + const blurStyleModel = regionModel.getModel(["blur", "itemStyle"]); + const selectStyleModel = regionModel.getModel(["select", "itemStyle"]); + const normalStyle = getFixedItemStyle(normalStyleModel); + const emphasisStyle = getFixedItemStyle(emphasisStyleModel); + const selectStyle = getFixedItemStyle(selectStyleModel); + const blurStyle = getFixedItemStyle(blurStyleModel); + const data = viewBuildCtx.data; + if (data) { + const style = data.getItemVisual(dataIndex, "style"); + const decal = data.getItemVisual(dataIndex, "decal"); + if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) { + normalStyle.fill = style.fill; + } + if (decal) { + normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api); + } + } + el.setStyle(normalStyle); + el.style.strokeNoScale = true; + el.ensureState("emphasis").style = emphasisStyle; + el.ensureState("select").style = selectStyle; + el.ensureState("blur").style = blurStyle; + setDefaultStateProxy(el); +} +function resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, labelXY) { + const data = viewBuildCtx.data; + const isGeo = viewBuildCtx.isGeo; + const isDataNaN = data && isNaN(data.get(data.mapDimension("value"), dataIdx)); + const itemLayout = data && data.getItemLayout(dataIdx); + if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) { + const query = !isGeo ? dataIdx : regionName; + let labelFetcher; + if (!data || dataIdx >= 0) { + labelFetcher = mapOrGeoModel; + } + const specifiedTextOpt = labelXY ? { + normal: { + align: "center", + verticalAlign: "middle" + } + } : null; + setLabelStyle(el, getLabelStatesModels(regionModel), { + labelFetcher, + labelDataIndex: query, + defaultText: regionName + }, specifiedTextOpt); + const textEl = el.getTextContent(); + if (textEl) { + mapLabelRaw(textEl).ignore = textEl.ignore; + if (el.textConfig && labelXY) { + const rect = el.getBoundingRect().clone(); + el.textConfig.layoutRect = rect; + el.textConfig.position = [ + (labelXY[0] - rect.x) / rect.width * 100 + "%", + (labelXY[1] - rect.y) / rect.height * 100 + "%" + ]; } + } + el.disableLabelAnimation = true; + } else { + el.removeTextContent(); + el.removeTextConfig(); + el.disableLabelAnimation = null; + } +} +function resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, dataIdx) { + if (viewBuildCtx.data) { + viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger); + } else { + getECData(eventTrigger).eventData = { + componentType: "geo", + componentIndex: mapOrGeoModel.componentIndex, + geoIndex: mapOrGeoModel.componentIndex, + name: regionName, + region: regionModel && regionModel.option || {} }; - var targetInfoMatchers = [ - // grid - function (foundCpts, targetInfo) { - var xAxisModel = foundCpts.xAxisModel; - var yAxisModel = foundCpts.yAxisModel; - var gridModel = foundCpts.gridModel; - !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model); - !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model); - return gridModel && gridModel === targetInfo.gridModel; + } +} +function resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) { + if (!viewBuildCtx.data) { + setTooltipConfig({ + el, + componentModel: mapOrGeoModel, + itemName: regionName, + itemTooltipOption: regionModel.get("tooltip") + }); + } +} +function resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) { + el.highDownSilentOnTouch = !!mapOrGeoModel.get("selectedMode"); + const emphasisModel = regionModel.getModel("emphasis"); + const focus = emphasisModel.get("focus"); + toggleHoverEmphasis(el, focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + if (viewBuildCtx.isGeo) { + enableComponentHighDownFeatures(el, mapOrGeoModel, regionName); + } + return focus; +} +function projectPolys(rings, createStream, isLine) { + const polygons = []; + let curPoly; + function startPolygon() { + curPoly = []; + } + function endPolygon() { + if (curPoly.length) { + polygons.push(curPoly); + curPoly = []; + } + } + const stream = createStream({ + polygonStart: startPolygon, + polygonEnd: endPolygon, + lineStart: startPolygon, + lineEnd: endPolygon, + point(x, y) { + if (isFinite(x) && isFinite(y)) { + curPoly.push([x, y]); + } }, - // geo - function (foundCpts, targetInfo) { - var geoModel = foundCpts.geoModel; - return geoModel && geoModel === targetInfo.geoModel; - }]; - var panelRectBuilders = { - grid: function () { - // grid is not Transformable. - return this.coordSys.master.getRect().clone(); - }, - geo: function () { - var coordSys = this.coordSys; - var rect = coordSys.getBoundingRect().clone(); - // geo roam and zoom transform - rect.applyTransform(getTransform(coordSys)); - return rect; + sphere() { + } + }); + !isLine && stream.polygonStart(); + each(rings, (ring) => { + stream.lineStart(); + for (let i = 0; i < ring.length; i++) { + stream.point(ring[i][0], ring[i][1]); + } + stream.lineEnd(); + }); + !isLine && stream.polygonEnd(); + return polygons; +} +var MapDraw_default = MapDraw; + +// src/chart/map/MapView.ts +var MapView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = MapView2.type; + } + render(mapModel, ecModel, api2, payload) { + if (payload && payload.type === "mapToggleSelect" && payload.from === this.uid) { + return; + } + const group = this.group; + group.removeAll(); + if (mapModel.getHostGeoModel()) { + return; + } + if (this._mapDraw && payload && payload.type === "geoRoam") { + this._mapDraw.resetForLabelLayout(); + } + if (!(payload && payload.type === "geoRoam" && payload.componentType === "series" && payload.seriesId === mapModel.id)) { + if (mapModel.needsDrawMap) { + const mapDraw = this._mapDraw || new MapDraw_default(api2); + group.add(mapDraw.group); + mapDraw.draw(mapModel, ecModel, api2, this, payload); + this._mapDraw = mapDraw; + } else { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; } - }; - var coordConvert = { - lineX: curry(axisConvert, 0), - lineY: curry(axisConvert, 1), - rect: function (to, coordSys, rangeOrCoordRange, clamp) { - var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp); - var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp); - var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])]; - return { - values: values, - xyMinMax: values - }; - }, - polygon: function (to, coordSys, rangeOrCoordRange, clamp) { - var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]]; - var values = map(rangeOrCoordRange, function (item) { - var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp); - xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]); - xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]); - xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]); - xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]); - return p; + } else { + const mapDraw = this._mapDraw; + mapDraw && group.add(mapDraw.group); + } + mapModel.get("showLegendSymbol") && ecModel.getComponent("legend") && this._renderSymbols(mapModel, ecModel, api2); + } + remove() { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + this.group.removeAll(); + } + dispose() { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + } + _renderSymbols(mapModel, ecModel, api2) { + const originalData = mapModel.originalData; + const group = this.group; + originalData.each(originalData.mapDimension("value"), function(value, originalDataIndex) { + if (isNaN(value)) { + return; + } + const layout18 = originalData.getItemLayout(originalDataIndex); + if (!layout18 || !layout18.point) { + return; + } + const point = layout18.point; + const offset = layout18.offset; + const circle = new Circle_default({ + style: { + fill: mapModel.getData().getVisual("style").fill + }, + shape: { + cx: point[0] + offset * 9, + cy: point[1], + r: 3 + }, + silent: true, + z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0) + }); + if (!offset) { + const fullData = mapModel.mainSeries.getData(); + const name = originalData.getName(originalDataIndex); + const fullIndex = fullData.indexOfName(name); + const itemModel = originalData.getItemModel(originalDataIndex); + const labelModel = itemModel.getModel("label"); + const regionGroup = fullData.getItemGraphicEl(fullIndex); + setLabelStyle(circle, getLabelStatesModels(itemModel), { + labelFetcher: { + getFormattedLabel(idx, state) { + return mapModel.getFormattedLabel(fullIndex, state); + } + }, + defaultText: name }); - return { - values: values, - xyMinMax: xyMinMax + circle.disableLabelAnimation = true; + if (!labelModel.get("position")) { + circle.setTextConfig({ + position: "bottom" + }); + } + regionGroup.onHoverStateChange = function(toState) { + setStatesFlag(circle, toState); }; } + group.add(circle); + }); + } +}; +var MapView = MapView2; +MapView.type = "map"; +var MapView_default = MapView; + +// src/chart/map/MapSeries.ts +var MapSeries2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = MapSeries2.type; + this.needsDrawMap = false; + this.seriesGroup = []; + this.getTooltipPosition = function(dataIndex) { + if (dataIndex != null) { + const name = this.getData().getName(dataIndex); + const geo = this.coordinateSystem; + const region = geo.getRegion(name); + return region && geo.dataToPoint(region.getCenter()); + } }; - function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) { - if ("development" !== 'production') { - assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.'); + } + getInitialData(option) { + const data = createSeriesDataSimply(this, { + coordDimensions: ["value"], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); + const dataNameMap = createHashMap(); + const toAppendNames = []; + for (let i = 0, len2 = data.count(); i < len2; i++) { + const name = data.getName(i); + dataNameMap.set(name, true); + } + const geoSource = geoSourceManager_default.load(this.getMapType(), this.option.nameMap, this.option.nameProperty); + each(geoSource.regions, function(region) { + const name = region.name; + if (!dataNameMap.get(name)) { + toAppendNames.push(name); } - var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]); - var values = formatMinMax(map([0, 1], function (i) { - return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i])); - })); - var xyMinMax = []; - xyMinMax[axisNameIndex] = values; - xyMinMax[1 - axisNameIndex] = [NaN, NaN]; - return { - values: values, - xyMinMax: xyMinMax - }; + }); + data.appendValues([], toAppendNames); + return data; + } + getHostGeoModel() { + const geoIndex = this.option.geoIndex; + return geoIndex != null ? this.ecModel.getComponent("geo", geoIndex) : null; + } + getMapType() { + return (this.getHostGeoModel() || this).option.map; + } + getRawValue(dataIndex) { + const data = this.getData(); + return data.get(data.mapDimension("value"), dataIndex); + } + getRegionModel(regionName) { + const data = this.getData(); + return data.getItemModel(data.indexOfName(regionName)); + } + formatTooltip(dataIndex, multipleSeries, dataType) { + const data = this.getData(); + const value = this.getRawValue(dataIndex); + const name = data.getName(dataIndex); + const seriesGroup = this.seriesGroup; + const seriesNames = []; + for (let i = 0; i < seriesGroup.length; i++) { + const otherIndex = seriesGroup[i].originalData.indexOfName(name); + const valueDim = data.mapDimension("value"); + if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) { + seriesNames.push(seriesGroup[i].name); + } + } + return createTooltipMarkup("section", { + header: seriesNames.join(", "), + noHeader: !seriesNames.length, + blocks: [createTooltipMarkup("nameValue", { + name, + value + })] + }); + } + setZoom(zoom) { + this.option.zoom = zoom; + } + setCenter(center3) { + this.option.center = center3; + } + getLegendIcon(opt) { + const iconType = opt.icon || "roundRect"; + const icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill); + icon.setStyle(opt.itemStyle); + icon.style.stroke = "none"; + if (iconType.indexOf("empty") > -1) { + icon.style.stroke = icon.style.fill; + icon.style.fill = "#fff"; + icon.style.lineWidth = 2; + } + return icon; + } +}; +var MapSeries = MapSeries2; +MapSeries.type = "series.map"; +MapSeries.dependencies = ["geo"]; +MapSeries.layoutMode = "box"; +MapSeries.defaultOption = { + z: 2, + coordinateSystem: "geo", + map: "", + left: "center", + top: "center", + aspectScale: null, + showLegendSymbol: true, + boundingCoords: null, + center: null, + zoom: 1, + scaleLimit: null, + selectedMode: true, + label: { + show: false, + color: "#000" + }, + itemStyle: { + borderWidth: 0.5, + borderColor: "#444", + areaColor: "#eee" + }, + emphasis: { + label: { + show: true, + color: "rgb(100,0,0)" + }, + itemStyle: { + areaColor: "rgba(255,215,0,0.8)" } - var diffProcessor = { - lineX: curry(axisDiffProcessor, 0), - lineY: curry(axisDiffProcessor, 1), - rect: function (values, refer, scales) { - return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]]; - }, - polygon: function (values, refer, scales) { - return map(values, function (item, idx) { - return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]]; - }); + }, + select: { + label: { + show: true, + color: "rgb(100,0,0)" + }, + itemStyle: { + color: "rgba(255,215,0,0.8)" + } + }, + nameProperty: "name" +}; +var MapSeries_default = MapSeries; + +// src/chart/map/mapDataStatistic.ts +function dataStatistics(datas, statisticType) { + const dataNameMap = {}; + each(datas, function(data) { + data.each(data.mapDimension("value"), function(value, idx) { + const mapKey = "ec-" + data.getName(idx); + dataNameMap[mapKey] = dataNameMap[mapKey] || []; + if (!isNaN(value)) { + dataNameMap[mapKey].push(value); } - }; - function axisDiffProcessor(axisNameIndex, values, refer, scales) { - return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]]; - } - // We have to process scale caused by dataZoom manually, - // although it might be not accurate. - // Return [0~1, 0~1] - function getScales(xyMinMaxCurr, xyMinMaxOrigin) { - var sizeCurr = getSize$1(xyMinMaxCurr); - var sizeOrigin = getSize$1(xyMinMaxOrigin); - var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; - isNaN(scales[0]) && (scales[0] = 1); - isNaN(scales[1]) && (scales[1] = 1); - return scales; - } - function getSize$1(xyMinMax) { - return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN]; - } - - var each$a = each; - var DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_'); - var DataZoomFeature = /** @class */function (_super) { - __extends(DataZoomFeature, _super); - function DataZoomFeature() { - return _super !== null && _super.apply(this, arguments) || this; - } - DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) { - if (!this._brushController) { - this._brushController = new BrushController(api.getZr()); - this._brushController.on('brush', bind(this._onBrush, this)).mount(); - } - updateZoomBtnStatus(featureModel, ecModel, this, payload, api); - updateBackBtnStatus(featureModel, ecModel); - }; - DataZoomFeature.prototype.onclick = function (ecModel, api, type) { - handlers$1[type].call(this); - }; - DataZoomFeature.prototype.remove = function (ecModel, api) { - this._brushController && this._brushController.unmount(); - }; - DataZoomFeature.prototype.dispose = function (ecModel, api) { - this._brushController && this._brushController.dispose(); - }; - DataZoomFeature.prototype._onBrush = function (eventParam) { - var areas = eventParam.areas; - if (!eventParam.isEnd || !areas.length) { - return; - } - var snapshot = {}; - var ecModel = this.ecModel; - this._brushController.updateCovers([]); // remove cover - var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { - include: ['grid'] - }); - brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { - if (coordSys.type !== 'cartesian2d') { + }); + }); + return datas[0].map(datas[0].mapDimension("value"), function(value, idx) { + const mapKey = "ec-" + datas[0].getName(idx); + let sum2 = 0; + let min3 = Infinity; + let max3 = -Infinity; + const len2 = dataNameMap[mapKey].length; + for (let i = 0; i < len2; i++) { + min3 = Math.min(min3, dataNameMap[mapKey][i]); + max3 = Math.max(max3, dataNameMap[mapKey][i]); + sum2 += dataNameMap[mapKey][i]; + } + let result; + if (statisticType === "min") { + result = min3; + } else if (statisticType === "max") { + result = max3; + } else if (statisticType === "average") { + result = sum2 / len2; + } else { + result = sum2; + } + return len2 === 0 ? NaN : result; + }); +} +function mapDataStatistic(ecModel) { + const seriesGroups = {}; + ecModel.eachSeriesByType("map", function(seriesModel) { + const hostGeoModel = seriesModel.getHostGeoModel(); + const key = hostGeoModel ? "o" + hostGeoModel.id : "i" + seriesModel.getMapType(); + (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); + }); + each(seriesGroups, function(seriesList, key) { + const data = dataStatistics(map(seriesList, function(seriesModel) { + return seriesModel.getData(); + }), seriesList[0].get("mapValueCalculation")); + for (let i = 0; i < seriesList.length; i++) { + seriesList[i].originalData = seriesList[i].getData(); + } + for (let i = 0; i < seriesList.length; i++) { + seriesList[i].seriesGroup = seriesList; + seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); + seriesList[i].setData(data.cloneShallow()); + seriesList[i].mainSeries = seriesList[0]; + } + }); +} + +// src/chart/map/mapSymbolLayout.ts +function mapSymbolLayout(ecModel) { + const processedMapType = {}; + ecModel.eachSeriesByType("map", function(mapSeries) { + const mapType = mapSeries.getMapType(); + if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { + return; + } + const mapSymbolOffsets = {}; + each(mapSeries.seriesGroup, function(subMapSeries) { + const geo = subMapSeries.coordinateSystem; + const data2 = subMapSeries.originalData; + if (subMapSeries.get("showLegendSymbol") && ecModel.getComponent("legend")) { + data2.each(data2.mapDimension("value"), function(value, idx) { + const name = data2.getName(idx); + const region = geo.getRegion(name); + if (!region || isNaN(value)) { return; } - var brushType = area.brushType; - if (brushType === 'rect') { - setBatch('x', coordSys, coordRange[0]); - setBatch('y', coordSys, coordRange[1]); - } else { - setBatch({ - lineX: 'x', - lineY: 'y' - }[brushType], coordSys, coordRange); - } - }); - push(ecModel, snapshot); - this._dispatchZoomAction(snapshot); - function setBatch(dimName, coordSys, minMax) { - var axis = coordSys.getAxis(dimName); - var axisModel = axis.model; - var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); - // Restrict range. - var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); - if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { - minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan); - } - dataZoomModel && (snapshot[dataZoomModel.id] = { - dataZoomId: dataZoomModel.id, - startValue: minMax[0], - endValue: minMax[1] + const offset = mapSymbolOffsets[name] || 0; + const point = geo.dataToPoint(region.getCenter()); + mapSymbolOffsets[name] = offset + 1; + data2.setItemLayout(idx, { + point, + offset }); - } - function findDataZoom(dimName, axisModel, ecModel) { - var found; - ecModel.eachComponent({ - mainType: 'dataZoom', - subType: 'select' - }, function (dzModel) { - var has = dzModel.getAxisModel(dimName, axisModel.componentIndex); - has && (found = dzModel); - }); - return found; - } - }; - DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) { - var batch = []; - // Convert from hash map to array. - each$a(snapshot, function (batchItem, dataZoomId) { - batch.push(clone(batchItem)); - }); - batch.length && this.api.dispatchAction({ - type: 'dataZoom', - from: this.uid, - batch: batch - }); - }; - DataZoomFeature.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - filterMode: 'filter', - // Icon group - icon: { - zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1', - back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26' - }, - // `zoom`, `back` - title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']), - brushStyle: { - borderWidth: 0, - color: 'rgba(210,219,238,0.2)' - } - }; - return defaultOption; - }; - return DataZoomFeature; - }(ToolboxFeature); - var handlers$1 = { - zoom: function () { - var nextActive = !this._isZoomActive; - this.api.dispatchAction({ - type: 'takeGlobalCursor', - key: 'dataZoomSelect', - dataZoomSelectActive: nextActive }); + } + }); + const data = mapSeries.getData(); + data.each(function(idx) { + const name = data.getName(idx); + const layout18 = data.getItemLayout(idx) || {}; + layout18.showLabel = !mapSymbolOffsets[name]; + data.setItemLayout(idx, layout18); + }); + processedMapType[mapType] = true; + }); +} + +// src/coord/View.ts +var v2ApplyTransform = applyTransform; +var View = class extends Transformable_default { + constructor(name) { + super(); + this.type = "view"; + this.dimensions = ["x", "y"]; + this._roamTransformable = new Transformable_default(); + this._rawTransformable = new Transformable_default(); + this.name = name; + } + setBoundingRect(x, y, width, height) { + this._rect = new BoundingRect_default(x, y, width, height); + return this._rect; + } + getBoundingRect() { + return this._rect; + } + setViewRect(x, y, width, height) { + this._transformTo(x, y, width, height); + this._viewRect = new BoundingRect_default(x, y, width, height); + } + _transformTo(x, y, width, height) { + const rect = this.getBoundingRect(); + const rawTransform = this._rawTransformable; + rawTransform.transform = rect.calculateTransform(new BoundingRect_default(x, y, width, height)); + const rawParent = rawTransform.parent; + rawTransform.parent = null; + rawTransform.decomposeTransform(); + rawTransform.parent = rawParent; + this._updateTransform(); + } + setCenter(centerCoord, api2) { + if (!centerCoord) { + return; + } + this._center = [ + parsePercent2(centerCoord[0], api2.getWidth()), + parsePercent2(centerCoord[1], api2.getHeight()) + ]; + this._updateCenterAndZoom(); + } + setZoom(zoom) { + zoom = zoom || 1; + const zoomLimit = this.zoomLimit; + if (zoomLimit) { + if (zoomLimit.max != null) { + zoom = Math.min(zoomLimit.max, zoom); + } + if (zoomLimit.min != null) { + zoom = Math.max(zoomLimit.min, zoom); + } + } + this._zoom = zoom; + this._updateCenterAndZoom(); + } + getDefaultCenter() { + const rawRect = this.getBoundingRect(); + const cx = rawRect.x + rawRect.width / 2; + const cy = rawRect.y + rawRect.height / 2; + return [cx, cy]; + } + getCenter() { + return this._center || this.getDefaultCenter(); + } + getZoom() { + return this._zoom || 1; + } + getRoamTransform() { + return this._roamTransformable.getLocalTransform(); + } + _updateCenterAndZoom() { + const rawTransformMatrix = this._rawTransformable.getLocalTransform(); + const roamTransform = this._roamTransformable; + let defaultCenter = this.getDefaultCenter(); + let center3 = this.getCenter(); + const zoom = this.getZoom(); + center3 = applyTransform([], center3, rawTransformMatrix); + defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix); + roamTransform.originX = center3[0]; + roamTransform.originY = center3[1]; + roamTransform.x = defaultCenter[0] - center3[0]; + roamTransform.y = defaultCenter[1] - center3[1]; + roamTransform.scaleX = roamTransform.scaleY = zoom; + this._updateTransform(); + } + _updateTransform() { + const roamTransformable = this._roamTransformable; + const rawTransformable = this._rawTransformable; + rawTransformable.parent = roamTransformable; + roamTransformable.updateTransform(); + rawTransformable.updateTransform(); + copy2(this.transform || (this.transform = []), rawTransformable.transform || create2()); + this._rawTransform = rawTransformable.getLocalTransform(); + this.invTransform = this.invTransform || []; + invert(this.invTransform, this.transform); + this.decomposeTransform(); + } + getTransformInfo() { + const rawTransformable = this._rawTransformable; + const roamTransformable = this._roamTransformable; + const dummyTransformable2 = new Transformable_default(); + dummyTransformable2.transform = roamTransformable.transform; + dummyTransformable2.decomposeTransform(); + return { + roam: { + x: dummyTransformable2.x, + y: dummyTransformable2.y, + scaleX: dummyTransformable2.scaleX, + scaleY: dummyTransformable2.scaleY }, - back: function () { - this._dispatchZoomAction(pop(this.ecModel)); + raw: { + x: rawTransformable.x, + y: rawTransformable.y, + scaleX: rawTransformable.scaleX, + scaleY: rawTransformable.scaleY } }; - function makeAxisFinder(dzFeatureModel) { - var setting = { - xAxisIndex: dzFeatureModel.get('xAxisIndex', true), - yAxisIndex: dzFeatureModel.get('yAxisIndex', true), - xAxisId: dzFeatureModel.get('xAxisId', true), - yAxisId: dzFeatureModel.get('yAxisId', true) - }; - // If both `xAxisIndex` `xAxisId` not set, it means 'all'. - // If both `yAxisIndex` `yAxisId` not set, it means 'all'. - // Some old cases set like this below to close yAxis control but leave xAxis control: - // `{ feature: { dataZoom: { yAxisIndex: false } }`. - if (setting.xAxisIndex == null && setting.xAxisId == null) { - setting.xAxisIndex = 'all'; - } - if (setting.yAxisIndex == null && setting.yAxisId == null) { - setting.yAxisIndex = 'all'; - } - return setting; - } - function updateBackBtnStatus(featureModel, ecModel) { - featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal'); - } - function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) { - var zoomActive = view._isZoomActive; - if (payload && payload.type === 'takeGlobalCursor') { - zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false; - } - view._isZoomActive = zoomActive; - featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal'); - var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { - include: ['grid'] + } + getViewRect() { + return this._viewRect; + } + getViewRectAfterRoam() { + const rect = this.getBoundingRect().clone(); + rect.applyTransform(this.transform); + return rect; + } + dataToPoint(data, noRoam, out2) { + const transform2 = noRoam ? this._rawTransform : this.transform; + out2 = out2 || []; + return transform2 ? v2ApplyTransform(out2, data, transform2) : copy(out2, data); + } + pointToData(point) { + const invTransform = this.invTransform; + return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]]; + } + convertToPixel(ecModel, finder, value) { + const coordSys = getCoordSys(finder); + return coordSys === this ? coordSys.dataToPoint(value) : null; + } + convertFromPixel(ecModel, finder, pixel) { + const coordSys = getCoordSys(finder); + return coordSys === this ? coordSys.pointToData(pixel) : null; + } + containPoint(point) { + return this.getViewRectAfterRoam().contain(point[0], point[1]); + } +}; +View.dimensions = ["x", "y"]; +function getCoordSys(finder) { + const seriesModel = finder.seriesModel; + return seriesModel ? seriesModel.coordinateSystem : null; +} +var View_default = View; + +// src/coord/geo/Geo.ts +var GEO_DEFAULT_PARAMS = { + geoJSON: { + aspectScale: 0.75, + invertLongitute: true + }, + geoSVG: { + aspectScale: 1, + invertLongitute: false + } +}; +var geo2DDimensions = ["lng", "lat"]; +var Geo = class extends View_default { + constructor(name, map3, opt) { + super(name); + this.dimensions = geo2DDimensions; + this.type = "geo"; + this._nameCoordMap = createHashMap(); + this.map = map3; + let projection = opt.projection; + const source = geoSourceManager_default.load(map3, opt.nameMap, opt.nameProperty); + const resource = geoSourceManager_default.getGeoResource(map3); + const resourceType = this.resourceType = resource ? resource.type : null; + const regions = this.regions = source.regions; + const defaultParams = GEO_DEFAULT_PARAMS[resource.type]; + this._regionsMap = source.regionsMap; + this.regions = source.regions; + if (projection) { + if (resourceType === "geoSVG") { + if (true) { + warn(`Map ${map3} with SVG source can't use projection. Only GeoJSON source supports projection.`); + } + projection = null; + } + if (!(projection.project && projection.unproject)) { + if (true) { + warn("project and unproject must be both provided in the projeciton."); + } + projection = null; + } + } + this.projection = projection; + let boundingRect; + if (projection) { + for (let i = 0; i < regions.length; i++) { + const regionRect = regions[i].getBoundingRect(projection); + boundingRect = boundingRect || regionRect.clone(); + boundingRect.union(regionRect); + } + } else { + boundingRect = source.boundingRect; + } + this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); + this.aspectScale = projection ? 1 : retrieve2(opt.aspectScale, defaultParams.aspectScale); + this._invertLongitute = projection ? false : defaultParams.invertLongitute; + } + _transformTo(x, y, width, height) { + let rect = this.getBoundingRect(); + const invertLongitute = this._invertLongitute; + rect = rect.clone(); + if (invertLongitute) { + rect.y = -rect.y - rect.height; + } + const rawTransformable = this._rawTransformable; + rawTransformable.transform = rect.calculateTransform(new BoundingRect_default(x, y, width, height)); + const rawParent = rawTransformable.parent; + rawTransformable.parent = null; + rawTransformable.decomposeTransform(); + rawTransformable.parent = rawParent; + if (invertLongitute) { + rawTransformable.scaleY = -rawTransformable.scaleY; + } + this._updateTransform(); + } + getRegion(name) { + return this._regionsMap.get(name); + } + getRegionByCoord(coord) { + const regions = this.regions; + for (let i = 0; i < regions.length; i++) { + const region = regions[i]; + if (region.type === "geoJSON" && region.contain(coord)) { + return regions[i]; + } + } + } + addGeoCoord(name, geoCoord2) { + this._nameCoordMap.set(name, geoCoord2); + } + getGeoCoord(name) { + const region = this._regionsMap.get(name); + return this._nameCoordMap.get(name) || region && region.getCenter(); + } + dataToPoint(data, noRoam, out2) { + if (isString(data)) { + data = this.getGeoCoord(data); + } + if (data) { + const projection = this.projection; + if (projection) { + data = projection.project(data); + } + return data && this.projectedToPoint(data, noRoam, out2); + } + } + pointToData(point) { + const projection = this.projection; + if (projection) { + point = projection.unproject(point); + } + return point && this.pointToProjected(point); + } + pointToProjected(point) { + return super.pointToData(point); + } + projectedToPoint(projected, noRoam, out2) { + return super.dataToPoint(projected, noRoam, out2); + } + convertToPixel(ecModel, finder, value) { + const coordSys = getCoordSys2(finder); + return coordSys === this ? coordSys.dataToPoint(value) : null; + } + convertFromPixel(ecModel, finder, pixel) { + const coordSys = getCoordSys2(finder); + return coordSys === this ? coordSys.pointToData(pixel) : null; + } +}; +mixin(Geo, View_default); +function getCoordSys2(finder) { + const geoModel = finder.geoModel; + const seriesModel = finder.seriesModel; + return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem || (seriesModel.getReferringComponents("geo", SINGLE_REFERRING).models[0] || {}).coordinateSystem : null; +} +var Geo_default = Geo; + +// src/coord/geo/geoCreator.ts +function resizeGeo(geoModel, api2) { + const boundingCoords = geoModel.get("boundingCoords"); + if (boundingCoords != null) { + let leftTop = boundingCoords[0]; + let rightBottom = boundingCoords[1]; + if (!(isFinite(leftTop[0]) && isFinite(leftTop[1]) && isFinite(rightBottom[0]) && isFinite(rightBottom[1]))) { + if (true) { + console.error("Invalid boundingCoords"); + } + } else { + const projection = this.projection; + if (projection) { + const xMin = leftTop[0]; + const yMin = leftTop[1]; + const xMax = rightBottom[0]; + const yMax = rightBottom[1]; + leftTop = [Infinity, Infinity]; + rightBottom = [-Infinity, -Infinity]; + const sampleLine = (x0, y0, x1, y1) => { + const dx = x1 - x0; + const dy = y1 - y0; + for (let i = 0; i <= 100; i++) { + const p = i / 100; + const pt = projection.project([x0 + dx * p, y0 + dy * p]); + min(leftTop, leftTop, pt); + max(rightBottom, rightBottom, pt); + } + }; + sampleLine(xMin, yMin, xMax, yMin); + sampleLine(xMax, yMin, xMax, yMax); + sampleLine(xMax, yMax, xMin, yMax); + sampleLine(xMin, yMax, xMax, yMin); + } + this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]); + } + } + const rect = this.getBoundingRect(); + const centerOption = geoModel.get("layoutCenter"); + const sizeOption = geoModel.get("layoutSize"); + const viewWidth = api2.getWidth(); + const viewHeight = api2.getHeight(); + const aspect = rect.width / rect.height * this.aspectScale; + let useCenterAndSize = false; + let center3; + let size; + if (centerOption && sizeOption) { + center3 = [ + parsePercent2(centerOption[0], viewWidth), + parsePercent2(centerOption[1], viewHeight) + ]; + size = parsePercent2(sizeOption, Math.min(viewWidth, viewHeight)); + if (!isNaN(center3[0]) && !isNaN(center3[1]) && !isNaN(size)) { + useCenterAndSize = true; + } else { + if (true) { + console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."); + } + } + } + let viewRect2; + if (useCenterAndSize) { + viewRect2 = {}; + if (aspect > 1) { + viewRect2.width = size; + viewRect2.height = size / aspect; + } else { + viewRect2.height = size; + viewRect2.width = size * aspect; + } + viewRect2.y = center3[1] - viewRect2.height / 2; + viewRect2.x = center3[0] - viewRect2.width / 2; + } else { + const boxLayoutOption = geoModel.getBoxLayoutParams(); + boxLayoutOption.aspect = aspect; + viewRect2 = getLayoutRect(boxLayoutOption, { + width: viewWidth, + height: viewHeight + }); + } + this.setViewRect(viewRect2.x, viewRect2.y, viewRect2.width, viewRect2.height); + this.setCenter(geoModel.get("center"), api2); + this.setZoom(geoModel.get("zoom")); +} +function setGeoCoords(geo, model) { + each(model.get("geoCoord"), function(geoCoord2, name) { + geo.addGeoCoord(name, geoCoord2); + }); +} +var GeoCreator = class { + constructor() { + this.dimensions = geo2DDimensions; + } + create(ecModel, api2) { + const geoList = []; + function getCommonGeoProperties(model) { + return { + nameProperty: model.get("nameProperty"), + aspectScale: model.get("aspectScale"), + projection: model.get("projection") + }; + } + ecModel.eachComponent("geo", function(geoModel, idx) { + const mapName = geoModel.get("map"); + const geo = new Geo_default(mapName + idx, mapName, extend({ + nameMap: geoModel.get("nameMap") + }, getCommonGeoProperties(geoModel))); + geo.zoomLimit = geoModel.get("scaleLimit"); + geoList.push(geo); + geoModel.coordinateSystem = geo; + geo.model = geoModel; + geo.resize = resizeGeo; + geo.resize(geoModel, api2); + }); + ecModel.eachSeries(function(seriesModel) { + const coordSys = seriesModel.get("coordinateSystem"); + if (coordSys === "geo") { + const geoIndex = seriesModel.get("geoIndex") || 0; + seriesModel.coordinateSystem = geoList[geoIndex]; + } + }); + const mapModelGroupBySeries = {}; + ecModel.eachSeriesByType("map", function(seriesModel) { + if (!seriesModel.getHostGeoModel()) { + const mapType = seriesModel.getMapType(); + mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; + mapModelGroupBySeries[mapType].push(seriesModel); + } + }); + each(mapModelGroupBySeries, function(mapSeries, mapType) { + const nameMapList = map(mapSeries, function(singleMapSeries) { + return singleMapSeries.get("nameMap"); }); - var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) { - return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect'; + const geo = new Geo_default(mapType, mapType, extend({ + nameMap: mergeAll(nameMapList) + }, getCommonGeoProperties(mapSeries[0]))); + geo.zoomLimit = retrieve.apply(null, map(mapSeries, function(singleMapSeries) { + return singleMapSeries.get("scaleLimit"); + })); + geoList.push(geo); + geo.resize = resizeGeo; + geo.resize(mapSeries[0], api2); + each(mapSeries, function(singleMapSeries) { + singleMapSeries.coordinateSystem = geo; + setGeoCoords(geo, singleMapSeries); }); - view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? { - brushType: 'auto', - brushStyle: featureModel.getModel('brushStyle').getItemStyle() - } : false); - } - registerInternalOptionCreator('dataZoom', function (ecModel) { - var toolboxModel = ecModel.getComponent('toolbox', 0); - var featureDataZoomPath = ['feature', 'dataZoom']; - if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) { - return; - } - var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath); - var dzOptions = []; - var finder = makeAxisFinder(dzFeatureModel); - var finderResult = parseFinder(ecModel, finder); - each$a(finderResult.xAxisModels, function (axisModel) { - return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); + }); + return geoList; + } + getFilledRegions(originRegionArr, mapName, nameMap, nameProperty) { + const regionsArr = (originRegionArr || []).slice(); + const dataNameMap = createHashMap(); + for (let i = 0; i < regionsArr.length; i++) { + dataNameMap.set(regionsArr[i].name, regionsArr[i]); + } + const source = geoSourceManager_default.load(mapName, nameMap, nameProperty); + each(source.regions, function(region) { + const name = region.name; + !dataNameMap.get(name) && regionsArr.push({name}); + }); + return regionsArr; + } +}; +var geoCreator = new GeoCreator(); +var geoCreator_default = geoCreator; + +// src/coord/geo/GeoModel.ts +var GeoModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = GeoModel2.type; + } + init(option, parentModel, ecModel) { + const source = geoSourceManager_default.getGeoResource(option.map); + if (source && source.type === "geoJSON") { + const itemStyle = option.itemStyle = option.itemStyle || {}; + if (!("color" in itemStyle)) { + itemStyle.color = "#eee"; + } + } + this.mergeDefaultAndTheme(option, ecModel); + defaultEmphasis(option, "label", ["show"]); + } + optionUpdated() { + const option = this.option; + option.regions = geoCreator_default.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty); + const selectedMap = {}; + this._optionModelMap = reduce(option.regions || [], (optionModelMap, regionOpt) => { + const regionName = regionOpt.name; + if (regionName) { + optionModelMap.set(regionName, new Model_default(regionOpt, this, this.ecModel)); + if (regionOpt.selected) { + selectedMap[regionName] = true; + } + } + return optionModelMap; + }, createHashMap()); + if (!option.selectedMap) { + option.selectedMap = selectedMap; + } + } + getRegionModel(name) { + return this._optionModelMap.get(name) || new Model_default(null, this, this.ecModel); + } + getFormattedLabel(name, status) { + const regionModel = this.getRegionModel(name); + const formatter = status === "normal" ? regionModel.get(["label", "formatter"]) : regionModel.get(["emphasis", "label", "formatter"]); + const params = { + name + }; + if (isFunction(formatter)) { + params.status = status; + return formatter(params); + } else if (isString(formatter)) { + return formatter.replace("{a}", name != null ? name : ""); + } + } + setZoom(zoom) { + this.option.zoom = zoom; + } + setCenter(center3) { + this.option.center = center3; + } + select(name) { + const option = this.option; + const selectedMode = option.selectedMode; + if (!selectedMode) { + return; + } + if (selectedMode !== "multiple") { + option.selectedMap = null; + } + const selectedMap = option.selectedMap || (option.selectedMap = {}); + selectedMap[name] = true; + } + unSelect(name) { + const selectedMap = this.option.selectedMap; + if (selectedMap) { + selectedMap[name] = false; + } + } + toggleSelected(name) { + this[this.isSelected(name) ? "unSelect" : "select"](name); + } + isSelected(name) { + const selectedMap = this.option.selectedMap; + return !!(selectedMap && selectedMap[name]); + } +}; +var GeoModel = GeoModel2; +GeoModel.type = "geo"; +GeoModel.layoutMode = "box"; +GeoModel.defaultOption = { + z: 0, + show: true, + left: "center", + top: "center", + aspectScale: null, + silent: false, + map: "", + boundingCoords: null, + center: null, + zoom: 1, + scaleLimit: null, + label: { + show: false, + color: "#000" + }, + itemStyle: { + borderWidth: 0.5, + borderColor: "#444" + }, + emphasis: { + label: { + show: true, + color: "rgb(100,0,0)" + }, + itemStyle: { + color: "rgba(255,215,0,0.8)" + } + }, + select: { + label: { + show: true, + color: "rgb(100,0,0)" + }, + itemStyle: { + color: "rgba(255,215,0,0.8)" + } + }, + regions: [] +}; +var GeoModel_default = GeoModel; + +// src/action/roamHelper.ts +function getCenterCoord(view, point) { + return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point); +} +function updateCenterAndZoom(view, payload, zoomLimit, api2) { + const previousZoom = view.getZoom(); + const center3 = view.getCenter(); + let zoom = payload.zoom; + const point = view.projectedToPoint ? view.projectedToPoint(center3) : view.dataToPoint(center3); + if (payload.dx != null && payload.dy != null) { + point[0] -= payload.dx; + point[1] -= payload.dy; + view.setCenter(getCenterCoord(view, point), api2); + } + if (zoom != null) { + if (zoomLimit) { + const zoomMin = zoomLimit.min || 0; + const zoomMax = zoomLimit.max || Infinity; + zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom; + } + view.scaleX *= zoom; + view.scaleY *= zoom; + const fixX = (payload.originX - view.x) * (zoom - 1); + const fixY = (payload.originY - view.y) * (zoom - 1); + view.x -= fixX; + view.y -= fixY; + view.updateTransform(); + view.setCenter(getCenterCoord(view, point), api2); + view.setZoom(zoom * previousZoom); + } + return { + center: view.getCenter(), + zoom: view.getZoom() + }; +} + +// src/component/geo/GeoView.ts +var GeoView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = GeoView2.type; + this.focusBlurEnabled = true; + } + init(ecModel, api2) { + this._api = api2; + } + render(geoModel, ecModel, api2, payload) { + this._model = geoModel; + if (!geoModel.get("show")) { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + return; + } + if (!this._mapDraw) { + this._mapDraw = new MapDraw_default(api2); + } + const mapDraw = this._mapDraw; + mapDraw.draw(geoModel, ecModel, api2, this, payload); + mapDraw.group.on("click", this._handleRegionClick, this); + mapDraw.group.silent = geoModel.get("silent"); + this.group.add(mapDraw.group); + this.updateSelectStatus(geoModel, ecModel, api2); + } + _handleRegionClick(e2) { + let eventData; + findEventDispatcher(e2.target, (current) => { + return (eventData = getECData(current).eventData) != null; + }, true); + if (eventData) { + this._api.dispatchAction({ + type: "geoToggleSelect", + geoId: this._model.id, + name: eventData.name }); - each$a(finderResult.yAxisModels, function (axisModel) { - return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); + } + } + updateSelectStatus(model, ecModel, api2) { + this._mapDraw.group.traverse((node) => { + const eventData = getECData(node).eventData; + if (eventData) { + this._model.isSelected(eventData.name) ? api2.enterSelect(node) : api2.leaveSelect(node); + return true; + } + }); + } + findHighDownDispatchers(name) { + return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model); + } + dispose() { + this._mapDraw && this._mapDraw.remove(); + } +}; +var GeoView = GeoView2; +GeoView.type = "geo"; +var GeoView_default = GeoView; + +// src/component/geo/install.ts +function registerMap2(mapName, geoJson, specialAreas) { + geoSourceManager_default.registerMap(mapName, geoJson, specialAreas); +} +function install10(registers) { + registers.registerCoordinateSystem("geo", geoCreator_default); + registers.registerComponentModel(GeoModel_default); + registers.registerComponentView(GeoView_default); + registers.registerImpl("registerMap", registerMap2); + registers.registerImpl("getMap", (mapName) => geoSourceManager_default.getMapForUser(mapName)); + function makeAction(method, actionInfo3) { + actionInfo3.update = "geo:updateSelectStatus"; + registers.registerAction(actionInfo3, function(payload, ecModel) { + const selected = {}; + const allSelected = []; + ecModel.eachComponent({mainType: "geo", query: payload}, function(geoModel) { + geoModel[method](payload.name); + const geo = geoModel.coordinateSystem; + each(geo.regions, function(region) { + selected[region.name] = geoModel.isSelected(region.name) || false; + }); + const names = []; + each(selected, function(v, name) { + selected[name] && names.push(name); + }); + allSelected.push({ + geoIndex: geoModel.componentIndex, + name: names + }); }); - function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) { - var axisIndex = axisModel.componentIndex; - var newOpt = { - type: 'select', - $fromToolbox: true, - // Default to be filter - filterMode: dzFeatureModel.get('filterMode', true) || 'filter', - // Id for merge mapping. - id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex - }; - newOpt[axisIndexPropName] = axisIndex; - dzOptions.push(newOpt); - } - return dzOptions; - }); - - function install$z(registers) { - registers.registerComponentModel(ToolboxModel); - registers.registerComponentView(ToolboxView); - registerFeature('saveAsImage', SaveAsImage); - registerFeature('magicType', MagicType); - registerFeature('dataView', DataView); - registerFeature('dataZoom', DataZoomFeature); - registerFeature('restore', RestoreOption); - use(install$y); - } - - var TooltipModel = /** @class */function (_super) { - __extends(TooltipModel, _super); - function TooltipModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TooltipModel.type; - return _this; - } - TooltipModel.type = 'tooltip'; - TooltipModel.dependencies = ['axisPointer']; - TooltipModel.defaultOption = { - // zlevel: 0, - z: 60, - show: true, - // tooltip main content - showContent: true, - // 'trigger' only works on coordinate system. - // 'item' | 'axis' | 'none' - trigger: 'item', - // 'click' | 'mousemove' | 'none' - triggerOn: 'mousemove|click', - alwaysShowContent: false, - displayMode: 'single', - renderMode: 'auto', - // whether restraint content inside viewRect. - // If renderMode: 'richText', default true. - // If renderMode: 'html', defaut false (for backward compat). - confine: null, - showDelay: 0, - hideDelay: 100, - // Animation transition time, unit is second - transitionDuration: 0.4, - enterable: false, - backgroundColor: '#fff', - // box shadow - shadowBlur: 10, - shadowColor: 'rgba(0, 0, 0, .2)', - shadowOffsetX: 1, - shadowOffsetY: 2, - // tooltip border radius, unit is px, default is 4 - borderRadius: 4, - // tooltip border width, unit is px, default is 0 (no border) - borderWidth: 1, - // Tooltip inside padding, default is 5 for all direction - // Array is allowed to set up, right, bottom, left, same with css - // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`. - padding: null, - // Extra css text - extraCssText: '', - // axis indicator, trigger by axis - axisPointer: { - // default is line - // legal values: 'line' | 'shadow' | 'cross' - type: 'line', - // Valid when type is line, appoint tooltip line locate on which line. Optional - // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto' - // default is 'auto', chose the axis which type is category. - // for multiply y axis, cartesian coord chose x axis, polar chose angle axis - axis: 'auto', - animation: 'auto', - animationDurationUpdate: 200, - animationEasingUpdate: 'exponentialOut', - crossStyle: { - color: '#999', - width: 1, - type: 'dashed', - // TODO formatter - textStyle: {} - } - // lineStyle and shadowStyle should not be specified here, - // otherwise it will always override those styles on option.axisPointer. - }, - - textStyle: { - color: '#666', - fontSize: 14 - } + return { + selected, + allSelected, + name: payload.name }; - return TooltipModel; - }(ComponentModel); - - /* global document */ - function shouldTooltipConfine(tooltipModel) { - var confineOption = tooltipModel.get('confine'); - return confineOption != null ? !!confineOption - // In richText mode, the outside part can not be visible. - : tooltipModel.get('renderMode') === 'richText'; - } - function testStyle(styleProps) { - if (!env.domSupported) { + }); + } + makeAction("toggleSelected", { + type: "geoToggleSelect", + event: "geoselectchanged" + }); + makeAction("select", { + type: "geoSelect", + event: "geoselected" + }); + makeAction("unSelect", { + type: "geoUnSelect", + event: "geounselected" + }); + registers.registerAction({ + type: "geoRoam", + event: "geoRoam", + update: "updateTransform" + }, function(payload, ecModel, api2) { + const componentType = payload.componentType || "series"; + ecModel.eachComponent({mainType: componentType, query: payload}, function(componentModel) { + const geo = componentModel.coordinateSystem; + if (geo.type !== "geo") { return; } - var style = document.documentElement.style; - for (var i = 0, len = styleProps.length; i < len; i++) { - if (styleProps[i] in style) { - return styleProps[i]; - } - } - } - var TRANSFORM_VENDOR = testStyle(['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']); - var TRANSITION_VENDOR = testStyle(['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']); - function toCSSVendorPrefix(styleVendor, styleProp) { - if (!styleVendor) { - return styleProp; - } - styleProp = toCamelCase(styleProp, true); - var idx = styleVendor.indexOf(styleProp); - styleVendor = idx === -1 ? styleProp : "-" + styleVendor.slice(0, idx) + "-" + styleProp; - return styleVendor.toLowerCase(); - } - function getComputedStyle(el, style) { - var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el); - return stl ? style ? stl[style] : stl : null; - } - - /* global document, window */ - var CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition'); - var CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform'); - // eslint-disable-next-line - var gCssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (env.transform3dSupported ? 'will-change:transform;' : ''); - function mirrorPos(pos) { - pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top'; - return pos; - } - function assembleArrow(tooltipModel, borderColor, arrowPosition) { - if (!isString(arrowPosition) || arrowPosition === 'inside') { - return ''; - } - var backgroundColor = tooltipModel.get('backgroundColor'); - var borderWidth = tooltipModel.get('borderWidth'); - borderColor = convertToColorString(borderColor); - var arrowPos = mirrorPos(arrowPosition); - var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6); - var positionStyle = ''; - var transformStyle = CSS_TRANSFORM_VENDOR + ':'; - var rotateDeg; - if (indexOf(['left', 'right'], arrowPos) > -1) { - positionStyle += 'top:50%'; - transformStyle += "translateY(-50%) rotate(" + (rotateDeg = arrowPos === 'left' ? -225 : -45) + "deg)"; - } else { - positionStyle += 'left:50%'; - transformStyle += "translateX(-50%) rotate(" + (rotateDeg = arrowPos === 'top' ? 225 : 45) + "deg)"; - } - var rotateRadian = rotateDeg * Math.PI / 180; - var arrowWH = arrowSize + borderWidth; - var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian)); - var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100; - positionStyle += ";" + arrowPos + ":-" + arrowOffset + "px"; - var borderStyle = borderColor + " solid " + borderWidth + "px;"; - var styleCss = ["position:absolute;width:" + arrowSize + "px;height:" + arrowSize + "px;z-index:-1;", positionStyle + ";" + transformStyle + ";", "border-bottom:" + borderStyle, "border-right:" + borderStyle, "background-color:" + backgroundColor + ";"]; - return "
"; - } - function assembleTransition(duration, onlyFade) { - var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)'; - var transitionOption = " " + duration / 2 + "s " + transitionCurve; - var transitionText = "opacity" + transitionOption + ",visibility" + transitionOption; - if (!onlyFade) { - transitionOption = " " + duration + "s " + transitionCurve; - transitionText += env.transformSupported ? "," + CSS_TRANSFORM_VENDOR + transitionOption : ",left" + transitionOption + ",top" + transitionOption; - } - return CSS_TRANSITION_VENDOR + ':' + transitionText; - } - function assembleTransform(x, y, toString) { - // If using float on style, the final width of the dom might - // keep changing slightly while mouse move. So `toFixed(0)` them. - var x0 = x.toFixed(0) + 'px'; - var y0 = y.toFixed(0) + 'px'; - // not support transform, use `left` and `top` instead. - if (!env.transformSupported) { - return toString ? "top:" + y0 + ";left:" + x0 + ";" : [['top', y0], ['left', x0]]; - } - // support transform - var is3d = env.transform3dSupported; - var translate = "translate" + (is3d ? '3d' : '') + "(" + x0 + "," + y0 + (is3d ? ',0' : '') + ")"; - return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]]; - } - /** - * @param {Object} textStyle - * @return {string} - * @inner - */ - function assembleFont(textStyleModel) { - var cssText = []; - var fontSize = textStyleModel.get('fontSize'); - var color = textStyleModel.getTextColor(); - color && cssText.push('color:' + color); - cssText.push('font:' + textStyleModel.getFont()); - fontSize - // @ts-ignore, leave it to the tooltip refactor. - && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px'); - var shadowColor = textStyleModel.get('textShadowColor'); - var shadowBlur = textStyleModel.get('textShadowBlur') || 0; - var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0; - var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0; - shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor); - each(['decoration', 'align'], function (name) { - var val = textStyleModel.get(name); - val && cssText.push('text-' + name + ':' + val); - }); - return cssText.join(';'); - } - function assembleCssText(tooltipModel, enableTransition, onlyFade) { - var cssText = []; - var transitionDuration = tooltipModel.get('transitionDuration'); - var backgroundColor = tooltipModel.get('backgroundColor'); - var shadowBlur = tooltipModel.get('shadowBlur'); - var shadowColor = tooltipModel.get('shadowColor'); - var shadowOffsetX = tooltipModel.get('shadowOffsetX'); - var shadowOffsetY = tooltipModel.get('shadowOffsetY'); - var textStyleModel = tooltipModel.getModel('textStyle'); - var padding = getPaddingFromTooltipModel(tooltipModel, 'html'); - var boxShadow = shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor; - cssText.push('box-shadow:' + boxShadow); - // Animation transition. Do not animate when transitionDuration is 0. - enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade)); - if (backgroundColor) { - cssText.push('background-color:' + backgroundColor); - } - // Border style - each(['width', 'color', 'radius'], function (name) { - var borderName = 'border-' + name; - var camelCase = toCamelCase(borderName); - var val = tooltipModel.get(camelCase); - val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px')); - }); - // Text style - cssText.push(assembleFont(textStyleModel)); - // Padding - if (padding != null) { - cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px'); - } - return cssText.join(';') + ';'; - } - // If not able to make, do not modify the input `out`. - function makeStyleCoord(out, zr, container, zrX, zrY) { - var zrPainter = zr && zr.painter; - if (container) { - var zrViewportRoot = zrPainter && zrPainter.getViewportRoot(); - if (zrViewportRoot) { - // Some APPs might use scale on body, so we support CSS transform here. - transformLocalCoord(out, zrViewportRoot, container, zrX, zrY); - } - } else { - out[0] = zrX; - out[1] = zrY; - // xy should be based on canvas root. But tooltipContent is - // the sibling of canvas root. So padding of ec container - // should be considered here. - var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset(); - if (viewportRootOffset) { - out[0] += viewportRootOffset.offsetLeft; - out[1] += viewportRootOffset.offsetTop; - } - } - out[2] = out[0] / zr.getWidth(); - out[3] = out[1] / zr.getHeight(); - } - var TooltipHTMLContent = /** @class */function () { - function TooltipHTMLContent(api, opt) { - this._show = false; - this._styleCoord = [0, 0, 0, 0]; - this._enterable = true; - this._alwaysShowContent = false; - this._firstShow = true; - this._longHide = true; - if (env.wxa) { - return null; - } - var el = document.createElement('div'); - // TODO: TYPE - el.domBelongToZr = true; - this.el = el; - var zr = this._zr = api.getZr(); - var appendTo = opt.appendTo; - var container = appendTo && (isString(appendTo) ? document.querySelector(appendTo) : isDom(appendTo) ? appendTo : isFunction(appendTo) && appendTo(api.getDom())); - makeStyleCoord(this._styleCoord, zr, container, api.getWidth() / 2, api.getHeight() / 2); - (container || api.getDom()).appendChild(el); - this._api = api; - this._container = container; - // FIXME - // Is it needed to trigger zr event manually if - // the browser do not support `pointer-events: none`. - var self = this; - el.onmouseenter = function () { - // clear the timeout in hideLater and keep showing tooltip - if (self._enterable) { - clearTimeout(self._hideTimeout); - self._show = true; - } - self._inContent = true; - }; - el.onmousemove = function (e) { - e = e || window.event; - if (!self._enterable) { - // `pointer-events: none` is set to tooltip content div - // if `enterable` is set as `false`, and `el.onmousemove` - // can not be triggered. But in browser that do not - // support `pointer-events`, we need to do this: - // Try trigger zrender event to avoid mouse - // in and out shape too frequently - var handler = zr.handler; - var zrViewportRoot = zr.painter.getViewportRoot(); - normalizeEvent(zrViewportRoot, e, true); - handler.dispatch('mousemove', e); - } - }; - el.onmouseleave = function () { - // set `_inContent` to `false` before `hideLater` - self._inContent = false; - if (self._enterable) { - if (self._show) { - self.hideLater(self._hideDelay); - } - } - }; + const res = updateCenterAndZoom(geo, payload, componentModel.get("scaleLimit"), api2); + componentModel.setCenter && componentModel.setCenter(res.center); + componentModel.setZoom && componentModel.setZoom(res.zoom); + if (componentType === "series") { + each(componentModel.seriesGroup, function(seriesModel) { + seriesModel.setCenter(res.center); + seriesModel.setZoom(res.zoom); + }); } - /** - * Update when tooltip is rendered - */ - TooltipHTMLContent.prototype.update = function (tooltipModel) { - // FIXME - // Move this logic to ec main? - if (!this._container) { - var container = this._api.getDom(); - var position = getComputedStyle(container, 'position'); - var domStyle = container.style; - if (domStyle.position !== 'absolute' && position !== 'absolute') { - domStyle.position = 'relative'; - } - } - // move tooltip if chart resized - var alwaysShowContent = tooltipModel.get('alwaysShowContent'); - alwaysShowContent && this._moveIfResized(); - // update alwaysShowContent - this._alwaysShowContent = alwaysShowContent; - // update className - this.el.className = tooltipModel.get('className') || ''; - // Hide the tooltip - // PENDING - // this.hide(); - }; - - TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) { - clearTimeout(this._hideTimeout); - clearTimeout(this._longHideTimeout); - var el = this.el; - var style = el.style; - var styleCoord = this._styleCoord; - if (!el.innerHTML) { - style.display = 'none'; - } else { - style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) - // initial transform - + assembleTransform(styleCoord[0], styleCoord[1], true) + ("border-color:" + convertToColorString(nearPointColor) + ";") + (tooltipModel.get('extraCssText') || '') - // If mouse occasionally move over the tooltip, a mouseout event will be - // triggered by canvas, and cause some unexpectable result like dragging - // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve - // it. Although it is not supported by IE8~IE10, fortunately it is a rare - // scenario. - + (";pointer-events:" + (this._enterable ? 'auto' : 'none')); - } - this._show = true; - this._firstShow = false; - this._longHide = false; - }; - TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) { - var el = this.el; - if (content == null) { - el.innerHTML = ''; - return; - } - var arrow = ''; - if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) { - arrow = assembleArrow(tooltipModel, borderColor, arrowPosition); - } - if (isString(content)) { - el.innerHTML = content + arrow; - } else if (content) { - // Clear previous - el.innerHTML = ''; - if (!isArray(content)) { - content = [content]; - } - for (var i = 0; i < content.length; i++) { - if (isDom(content[i]) && content[i].parentNode !== el) { - el.appendChild(content[i]); - } - } - // no arrow if empty - if (arrow && el.childNodes.length) { - // no need to create a new parent element, but it's not supported by IE 10 and older. - // const arrowEl = document.createRange().createContextualFragment(arrow); - var arrowEl = document.createElement('div'); - arrowEl.innerHTML = arrow; - el.appendChild(arrowEl); - } - } - }; - TooltipHTMLContent.prototype.setEnterable = function (enterable) { - this._enterable = enterable; - }; - TooltipHTMLContent.prototype.getSize = function () { - var el = this.el; - return [el.offsetWidth, el.offsetHeight]; - }; - TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) { - var styleCoord = this._styleCoord; - makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY); - if (styleCoord[0] != null && styleCoord[1] != null) { - var style_1 = this.el.style; - var transforms = assembleTransform(styleCoord[0], styleCoord[1]); - each(transforms, function (transform) { - style_1[transform[0]] = transform[1]; + }); + }); +} + +// src/chart/map/install.ts +function install11(registers) { + use(install10); + registers.registerChartView(MapView_default); + registers.registerSeriesModel(MapSeries_default); + registers.registerLayout(mapSymbolLayout); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); + createLegacyDataSelectAction("map", registers.registerAction); +} + +// src/chart/tree/layoutHelper.ts +function init3(inRoot) { + const root = inRoot; + root.hierNode = { + defaultAncestor: null, + ancestor: root, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i: 0, + thread: null + }; + const nodes = [root]; + let node; + let children; + while (node = nodes.pop()) { + children = node.children; + if (node.isExpand && children.length) { + const n = children.length; + for (let i = n - 1; i >= 0; i--) { + const child = children[i]; + child.hierNode = { + defaultAncestor: null, + ancestor: child, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i, + thread: null + }; + nodes.push(child); + } + } + } +} +function firstWalk(node, separation2) { + const children = node.isExpand ? node.children : []; + const siblings = node.parentNode.children; + const subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null; + if (children.length) { + executeShifts(node); + const midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; + if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation2(node, subtreeW); + node.hierNode.modifier = node.hierNode.prelim - midPoint; + } else { + node.hierNode.prelim = midPoint; + } + } else if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation2(node, subtreeW); + } + node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation2); +} +function secondWalk(node) { + const nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; + node.setLayout({x: nodeX}, true); + node.hierNode.modifier += node.parentNode.hierNode.modifier; +} +function separation(cb) { + return arguments.length ? cb : defaultSeparation; +} +function radialCoordinate(rad, r) { + rad -= Math.PI / 2; + return { + x: r * Math.cos(rad), + y: r * Math.sin(rad) + }; +} +function getViewRect2(seriesModel, api2) { + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api2.getWidth(), + height: api2.getHeight() + }); +} +function executeShifts(node) { + const children = node.children; + let n = children.length; + let shift = 0; + let change = 0; + while (--n >= 0) { + const child = children[n]; + child.hierNode.prelim += shift; + child.hierNode.modifier += shift; + change += child.hierNode.change; + shift += child.hierNode.shift + change; + } +} +function apportion(subtreeV, subtreeW, ancestor, separation2) { + if (subtreeW) { + let nodeOutRight = subtreeV; + let nodeInRight = subtreeV; + let nodeOutLeft = nodeInRight.parentNode.children[0]; + let nodeInLeft = subtreeW; + let sumOutRight = nodeOutRight.hierNode.modifier; + let sumInRight = nodeInRight.hierNode.modifier; + let sumOutLeft = nodeOutLeft.hierNode.modifier; + let sumInLeft = nodeInLeft.hierNode.modifier; + while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { + nodeOutRight = nextRight(nodeOutRight); + nodeOutLeft = nextLeft(nodeOutLeft); + nodeOutRight.hierNode.ancestor = subtreeV; + const shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation2(nodeInLeft, nodeInRight); + if (shift > 0) { + moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); + sumInRight += shift; + sumOutRight += shift; + } + sumInLeft += nodeInLeft.hierNode.modifier; + sumInRight += nodeInRight.hierNode.modifier; + sumOutRight += nodeOutRight.hierNode.modifier; + sumOutLeft += nodeOutLeft.hierNode.modifier; + } + if (nodeInLeft && !nextRight(nodeOutRight)) { + nodeOutRight.hierNode.thread = nodeInLeft; + nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; + } + if (nodeInRight && !nextLeft(nodeOutLeft)) { + nodeOutLeft.hierNode.thread = nodeInRight; + nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; + ancestor = subtreeV; + } + } + return ancestor; +} +function nextRight(node) { + const children = node.children; + return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; +} +function nextLeft(node) { + const children = node.children; + return children.length && node.isExpand ? children[0] : node.hierNode.thread; +} +function nextAncestor(nodeInLeft, node, ancestor) { + return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor; +} +function moveSubtree(wl, wr, shift) { + const change = shift / (wr.hierNode.i - wl.hierNode.i); + wr.hierNode.change -= change; + wr.hierNode.shift += shift; + wr.hierNode.modifier += shift; + wr.hierNode.prelim += shift; + wl.hierNode.change += change; +} +function defaultSeparation(node1, node2) { + return node1.parentNode === node2.parentNode ? 1 : 2; +} + +// src/chart/tree/TreeView.ts +var TreeEdgeShape = class { + constructor() { + this.parentPoint = []; + this.childPoints = []; + } +}; +var TreePath = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new TreeEdgeShape(); + } + buildPath(ctx, shape) { + const childPoints = shape.childPoints; + const childLen = childPoints.length; + const parentPoint = shape.parentPoint; + const firstChildPos = childPoints[0]; + const lastChildPos = childPoints[childLen - 1]; + if (childLen === 1) { + ctx.moveTo(parentPoint[0], parentPoint[1]); + ctx.lineTo(firstChildPos[0], firstChildPos[1]); + return; + } + const orient = shape.orient; + const forkDim = orient === "TB" || orient === "BT" ? 0 : 1; + const otherDim = 1 - forkDim; + const forkPosition = parsePercent2(shape.forkPosition, 1); + const tmpPoint = []; + tmpPoint[forkDim] = parentPoint[forkDim]; + tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition; + ctx.moveTo(parentPoint[0], parentPoint[1]); + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + ctx.moveTo(firstChildPos[0], firstChildPos[1]); + tmpPoint[forkDim] = firstChildPos[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + tmpPoint[forkDim] = lastChildPos[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + ctx.lineTo(lastChildPos[0], lastChildPos[1]); + for (let i = 1; i < childLen - 1; i++) { + const point = childPoints[i]; + ctx.moveTo(point[0], point[1]); + tmpPoint[forkDim] = point[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + } + } +}; +var TreeView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = TreeView2.type; + this._mainGroup = new Group_default(); + } + init(ecModel, api2) { + this._controller = new RoamController_default(api2.getZr()); + this._controllerHost = { + target: this.group + }; + this.group.add(this._mainGroup); + } + render(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const layoutInfo = seriesModel.layoutInfo; + const group = this._mainGroup; + const layout18 = seriesModel.get("layout"); + if (layout18 === "radial") { + group.x = layoutInfo.x + layoutInfo.width / 2; + group.y = layoutInfo.y + layoutInfo.height / 2; + } else { + group.x = layoutInfo.x; + group.y = layoutInfo.y; + } + this._updateViewCoordSys(seriesModel, api2); + this._updateController(seriesModel, ecModel, api2); + const oldData = this._data; + data.diff(oldData).add(function(newIdx) { + if (symbolNeedsDraw2(data, newIdx)) { + updateNode(data, newIdx, null, group, seriesModel); + } + }).update(function(newIdx, oldIdx) { + const symbolEl = oldData.getItemGraphicEl(oldIdx); + if (!symbolNeedsDraw2(data, newIdx)) { + symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel); + return; + } + updateNode(data, newIdx, symbolEl, group, seriesModel); + }).remove(function(oldIdx) { + const symbolEl = oldData.getItemGraphicEl(oldIdx); + if (symbolEl) { + removeNode(oldData, oldIdx, symbolEl, group, seriesModel); + } + }).execute(); + this._nodeScaleRatio = seriesModel.get("nodeScaleRatio"); + this._updateNodeAndLinkScale(seriesModel); + if (seriesModel.get("expandAndCollapse") === true) { + data.eachItemGraphicEl(function(el, dataIndex) { + el.off("click").on("click", function() { + api2.dispatchAction({ + type: "treeExpandAndCollapse", + seriesId: seriesModel.id, + dataIndex }); - } - }; - /** - * when `alwaysShowContent` is true, - * move the tooltip after chart resized - */ - TooltipHTMLContent.prototype._moveIfResized = function () { - // The ratio of left to width - var ratioX = this._styleCoord[2]; - // The ratio of top to height - var ratioY = this._styleCoord[3]; - this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); - }; - TooltipHTMLContent.prototype.hide = function () { - var _this = this; - var style = this.el.style; - style.visibility = 'hidden'; - style.opacity = '0'; - env.transform3dSupported && (style.willChange = ''); - this._show = false; - this._longHideTimeout = setTimeout(function () { - return _this._longHide = true; - }, 500); - }; - TooltipHTMLContent.prototype.hideLater = function (time) { - if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) { - if (time) { - this._hideDelay = time; - // Set show false to avoid invoke hideLater multiple times - this._show = false; - this._hideTimeout = setTimeout(bind(this.hide, this), time); - } else { - this.hide(); - } - } - }; - TooltipHTMLContent.prototype.isShow = function () { - return this._show; - }; - TooltipHTMLContent.prototype.dispose = function () { - clearTimeout(this._hideTimeout); - clearTimeout(this._longHideTimeout); - var parentNode = this.el.parentNode; - parentNode && parentNode.removeChild(this.el); - this.el = this._container = null; - }; - return TooltipHTMLContent; - }(); - - var TooltipRichContent = /** @class */function () { - function TooltipRichContent(api) { - this._show = false; - this._styleCoord = [0, 0, 0, 0]; - this._alwaysShowContent = false; - this._enterable = true; - this._zr = api.getZr(); - makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2); - } - /** - * Update when tooltip is rendered - */ - TooltipRichContent.prototype.update = function (tooltipModel) { - var alwaysShowContent = tooltipModel.get('alwaysShowContent'); - alwaysShowContent && this._moveIfResized(); - // update alwaysShowContent - this._alwaysShowContent = alwaysShowContent; - }; - TooltipRichContent.prototype.show = function () { - if (this._hideTimeout) { - clearTimeout(this._hideTimeout); - } - this.el.show(); - this._show = true; - }; - /** - * Set tooltip content - */ - TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) { - var _this = this; - if (isObject(content)) { - throwError("development" !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : ''); - } - if (this.el) { - this._zr.remove(this.el); - } - var textStyleModel = tooltipModel.getModel('textStyle'); - this.el = new ZRText({ - style: { - rich: markupStyleCreator.richTextStyles, - text: content, - lineHeight: 22, - borderWidth: 1, - borderColor: borderColor, - textShadowColor: textStyleModel.get('textShadowColor'), - fill: tooltipModel.get(['textStyle', 'color']), - padding: getPaddingFromTooltipModel(tooltipModel, 'richText'), - verticalAlign: 'top', - align: 'left' - }, - z: tooltipModel.get('z') - }); - each(['backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'], function (propName) { - _this.el.style[propName] = tooltipModel.get(propName); - }); - each(['textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'], function (propName) { - _this.el.style[propName] = textStyleModel.get(propName) || 0; - }); - 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; }); - }; - TooltipRichContent.prototype.setEnterable = function (enterable) { - this._enterable = enterable; - }; - TooltipRichContent.prototype.getSize = function () { - var el = this.el; - var bounding = this.el.getBoundingRect(); - // bounding rect does not include shadow. For renderMode richText, - // if overflow, it will be cut. So calculate them accurately. - var shadowOuterSize = calcShadowOuterSize(el.style); - return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom]; - }; - TooltipRichContent.prototype.moveTo = function (x, y) { - var el = this.el; - if (el) { - var styleCoord = this._styleCoord; - makeStyleCoord$1(styleCoord, this._zr, x, y); - x = styleCoord[0]; - y = styleCoord[1]; - var style = el.style; - var borderWidth = mathMaxWith0(style.borderWidth || 0); - var shadowOuterSize = calcShadowOuterSize(style); - // rich text x, y do not include border. - el.x = x + borderWidth + shadowOuterSize.left; - el.y = y + borderWidth + shadowOuterSize.top; - el.markRedraw(); - } - }; - /** - * when `alwaysShowContent` is true, - * move the tooltip after chart resized - */ - TooltipRichContent.prototype._moveIfResized = function () { - // The ratio of left to width - var ratioX = this._styleCoord[2]; - // The ratio of top to height - var ratioY = this._styleCoord[3]; - this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); - }; - TooltipRichContent.prototype.hide = function () { - if (this.el) { - this.el.hide(); - } - this._show = false; - }; - TooltipRichContent.prototype.hideLater = function (time) { - if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) { - if (time) { - this._hideDelay = time; - // Set show false to avoid invoke hideLater multiple times - this._show = false; - this._hideTimeout = setTimeout(bind(this.hide, this), time); - } else { - this.hide(); - } - } - }; - TooltipRichContent.prototype.isShow = function () { - return this._show; - }; - TooltipRichContent.prototype.dispose = function () { - this._zr.remove(this.el); - }; - return TooltipRichContent; - }(); - function mathMaxWith0(val) { - return Math.max(0, val); - } - function calcShadowOuterSize(style) { - var shadowBlur = mathMaxWith0(style.shadowBlur || 0); - var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0); - var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0); - return { - left: mathMaxWith0(shadowBlur - shadowOffsetX), - right: mathMaxWith0(shadowBlur + shadowOffsetX), - top: mathMaxWith0(shadowBlur - shadowOffsetY), - bottom: mathMaxWith0(shadowBlur + shadowOffsetY) - }; - } - function makeStyleCoord$1(out, zr, zrX, zrY) { - out[0] = zrX; - out[1] = zrY; - out[2] = out[0] / zr.getWidth(); - out[3] = out[1] / zr.getHeight(); + }); } - - var proxyRect = new Rect({ - shape: { - x: -1, - y: -1, - width: 2, - height: 2 + this._data = data; + } + _updateViewCoordSys(seriesModel, api2) { + const data = seriesModel.getData(); + const points4 = []; + data.each(function(idx) { + const layout18 = data.getItemLayout(idx); + if (layout18 && !isNaN(layout18.x) && !isNaN(layout18.y)) { + points4.push([+layout18.x, +layout18.y]); } }); - var TooltipView = /** @class */function (_super) { - __extends(TooltipView, _super); - function TooltipView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TooltipView.type; - return _this; - } - TooltipView.prototype.init = function (ecModel, api) { - if (env.node || !api.getDom()) { - return; - } - var tooltipModel = ecModel.getComponent('tooltip'); - var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode')); - this._tooltipContent = renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api, { - appendTo: tooltipModel.get('appendToBody', true) ? 'body' : tooltipModel.get('appendTo', true) - }); - }; - TooltipView.prototype.render = function (tooltipModel, ecModel, api) { - if (env.node || !api.getDom()) { - return; - } - // Reset - this.group.removeAll(); - this._tooltipModel = tooltipModel; - this._ecModel = ecModel; - this._api = api; - var tooltipContent = this._tooltipContent; - tooltipContent.update(tooltipModel); - tooltipContent.setEnterable(tooltipModel.get('enterable')); - this._initGlobalListener(); - this._keepShow(); - // PENDING - // `mousemove` event will be triggered very frequently when the mouse moves fast, - // which causes that the `updatePosition` function was also called frequently. - // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101 - // To avoid frequent triggering, - // consider throttling it in 50ms when transition is enabled - if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) { - createOrUpdate(this, '_updatePosition', 50, 'fixRate'); - } else { - clear(this, '_updatePosition'); - } - }; - TooltipView.prototype._initGlobalListener = function () { - var tooltipModel = this._tooltipModel; - var triggerOn = tooltipModel.get('triggerOn'); - register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) { - // If 'none', it is not controlled by mouse totally. - if (triggerOn !== 'none') { - if (triggerOn.indexOf(currTrigger) >= 0) { - this._tryShow(e, dispatchAction); - } else if (currTrigger === 'leave') { - this._hide(dispatchAction); - } - } - }, this)); - }; - TooltipView.prototype._keepShow = function () { - var tooltipModel = this._tooltipModel; - var ecModel = this._ecModel; - var api = this._api; - var triggerOn = tooltipModel.get('triggerOn'); - // Try to keep the tooltip show when refreshing - if (this._lastX != null && this._lastY != null - // When user is willing to control tooltip totally using API, - // self.manuallyShowTip({x, y}) might cause tooltip hide, - // which is not expected. - && triggerOn !== 'none' && triggerOn !== 'click') { - var self_1 = this; - clearTimeout(this._refreshUpdateTimeout); - this._refreshUpdateTimeout = setTimeout(function () { - // Show tip next tick after other charts are rendered - // In case highlight action has wrong result - // FIXME - !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, { - x: self_1._lastX, - y: self_1._lastY, - dataByCoordSys: self_1._lastDataByCoordSys - }); - }); - } - }; - /** - * Show tip manually by - * dispatchAction({ - * type: 'showTip', - * x: 10, - * y: 10 - * }); - * Or - * dispatchAction({ - * type: 'showTip', - * seriesIndex: 0, - * dataIndex or dataIndexInside or name - * }); - * - * TODO Batch - */ - TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) { - if (payload.from === this.uid || env.node || !api.getDom()) { - return; - } - var dispatchAction = makeDispatchAction$1(payload, api); - // Reset ticket - this._ticket = ''; - // When triggered from axisPointer. - var dataByCoordSys = payload.dataByCoordSys; - var cmptRef = findComponentReference(payload, ecModel, api); - if (cmptRef) { - var rect = cmptRef.el.getBoundingRect().clone(); - rect.applyTransform(cmptRef.el.transform); - this._tryShow({ - offsetX: rect.x + rect.width / 2, - offsetY: rect.y + rect.height / 2, - target: cmptRef.el, - position: payload.position, - // When manully trigger, the mouse is not on the el, so we'd better to - // position tooltip on the bottom of the el and display arrow is possible. - positionDefault: 'bottom' - }, dispatchAction); - } else if (payload.tooltip && payload.x != null && payload.y != null) { - var el = proxyRect; - el.x = payload.x; - el.y = payload.y; - el.update(); - getECData(el).tooltipConfig = { - name: null, - option: payload.tooltip - }; - // Manually show tooltip while view is not using zrender elements. - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - target: el - }, dispatchAction); - } else if (dataByCoordSys) { - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - position: payload.position, - dataByCoordSys: dataByCoordSys, - tooltipOption: payload.tooltipOption - }, dispatchAction); - } else if (payload.seriesIndex != null) { - if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) { - return; - } - var pointInfo = findPointFromSeries(payload, ecModel); - var cx = pointInfo.point[0]; - var cy = pointInfo.point[1]; - if (cx != null && cy != null) { - this._tryShow({ - offsetX: cx, - offsetY: cy, - target: pointInfo.el, - position: payload.position, - // When manully trigger, the mouse is not on the el, so we'd better to - // position tooltip on the bottom of the el and display arrow is possible. - positionDefault: 'bottom' - }, dispatchAction); - } - } else if (payload.x != null && payload.y != null) { - // FIXME - // should wrap dispatchAction like `axisPointer/globalListener` ? - api.dispatchAction({ - type: 'updateAxisPointer', - x: payload.x, - y: payload.y - }); - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - position: payload.position, - target: api.getZr().findHover(payload.x, payload.y).target - }, dispatchAction); - } - }; - TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) { - var tooltipContent = this._tooltipContent; - if (this._tooltipModel) { - tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); - } - this._lastX = this._lastY = this._lastDataByCoordSys = null; - if (payload.from !== this.uid) { - this._hide(makeDispatchAction$1(payload, api)); - } - }; - // Be compatible with previous design, that is, when tooltip.type is 'axis' and - // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer - // and tooltip. - TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) { - var seriesIndex = payload.seriesIndex; - var dataIndex = payload.dataIndex; - // @ts-ignore - var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; - if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { - return; - } - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); - if (!seriesModel) { - return; - } - var data = seriesModel.getData(); - var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel); - if (tooltipCascadedModel.get('trigger') !== 'axis') { - return; + const min3 = []; + const max3 = []; + fromPoints(points4, min3, max3); + const oldMin = this._min; + const oldMax = this._max; + if (max3[0] - min3[0] === 0) { + min3[0] = oldMin ? oldMin[0] : min3[0] - 1; + max3[0] = oldMax ? oldMax[0] : max3[0] + 1; + } + if (max3[1] - min3[1] === 0) { + min3[1] = oldMin ? oldMin[1] : min3[1] - 1; + max3[1] = oldMax ? oldMax[1] : max3[1] + 1; + } + const viewCoordSys = seriesModel.coordinateSystem = new View_default(); + viewCoordSys.zoomLimit = seriesModel.get("scaleLimit"); + viewCoordSys.setBoundingRect(min3[0], min3[1], max3[0] - min3[0], max3[1] - min3[1]); + viewCoordSys.setCenter(seriesModel.get("center"), api2); + viewCoordSys.setZoom(seriesModel.get("zoom")); + this.group.attr({ + x: viewCoordSys.x, + y: viewCoordSys.y, + scaleX: viewCoordSys.scaleX, + scaleY: viewCoordSys.scaleY + }); + this._min = min3; + this._max = max3; + } + _updateController(seriesModel, ecModel, api2) { + const controller = this._controller; + const controllerHost = this._controllerHost; + const group = this.group; + controller.setPointerChecker(function(e2, x, y) { + const rect = group.getBoundingRect(); + rect.applyTransform(group.transform); + return rect.contain(x, y) && !onIrrelevantElement(e2, api2, seriesModel); + }); + controller.enable(seriesModel.get("roam")); + controllerHost.zoomLimit = seriesModel.get("scaleLimit"); + controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); + controller.off("pan").off("zoom").on("pan", (e2) => { + updateViewOnPan(controllerHost, e2.dx, e2.dy); + api2.dispatchAction({ + seriesId: seriesModel.id, + type: "treeRoam", + dx: e2.dx, + dy: e2.dy + }); + }).on("zoom", (e2) => { + updateViewOnZoom(controllerHost, e2.scale, e2.originX, e2.originY); + api2.dispatchAction({ + seriesId: seriesModel.id, + type: "treeRoam", + zoom: e2.scale, + originX: e2.originX, + originY: e2.originY + }); + this._updateNodeAndLinkScale(seriesModel); + api2.updateLabelLayout(); + }); + } + _updateNodeAndLinkScale(seriesModel) { + const data = seriesModel.getData(); + const nodeScale = this._getNodeGlobalScale(seriesModel); + data.eachItemGraphicEl(function(el, idx) { + el.setSymbolScale(nodeScale); + }); + } + _getNodeGlobalScale(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + if (coordSys.type !== "view") { + return 1; + } + const nodeScaleRatio = this._nodeScaleRatio; + const groupZoom = coordSys.scaleX || 1; + const roamZoom = coordSys.getZoom(); + const nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + return nodeScale / groupZoom; + } + dispose() { + this._controller && this._controller.dispose(); + this._controllerHost = null; + } + remove() { + this._mainGroup.removeAll(); + this._data = null; + } +}; +var TreeView = TreeView2; +TreeView.type = "tree"; +function symbolNeedsDraw2(data, dataIndex) { + const layout18 = data.getItemLayout(dataIndex); + return layout18 && !isNaN(layout18.x) && !isNaN(layout18.y); +} +function updateNode(data, dataIndex, symbolEl, group, seriesModel) { + const isInit = !symbolEl; + const node = data.tree.getNodeByDataIndex(dataIndex); + const itemModel = node.getModel(); + const visualColor = node.getVisual("style").fill; + const symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : "#fff"; + const virtualRoot = data.tree.root; + const source = node.parentNode === virtualRoot ? node : node.parentNode || node; + const sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); + const sourceLayout = source.getLayout(); + const sourceOldLayout = sourceSymbolEl ? { + x: sourceSymbolEl.__oldX, + y: sourceSymbolEl.__oldY, + rawX: sourceSymbolEl.__radialOldRawX, + rawY: sourceSymbolEl.__radialOldRawY + } : sourceLayout; + const targetLayout = node.getLayout(); + if (isInit) { + symbolEl = new Symbol_default(data, dataIndex, null, { + symbolInnerColor, + useNameLabel: true + }); + symbolEl.x = sourceOldLayout.x; + symbolEl.y = sourceOldLayout.y; + } else { + symbolEl.updateData(data, dataIndex, null, { + symbolInnerColor, + useNameLabel: true + }); + } + symbolEl.__radialOldRawX = symbolEl.__radialRawX; + symbolEl.__radialOldRawY = symbolEl.__radialRawY; + symbolEl.__radialRawX = targetLayout.rawX; + symbolEl.__radialRawY = targetLayout.rawY; + group.add(symbolEl); + data.setItemGraphicEl(dataIndex, symbolEl); + symbolEl.__oldX = symbolEl.x; + symbolEl.__oldY = symbolEl.y; + updateProps(symbolEl, { + x: targetLayout.x, + y: targetLayout.y + }, seriesModel); + const symbolPath = symbolEl.getSymbolPath(); + if (seriesModel.get("layout") === "radial") { + const realRoot = virtualRoot.children[0]; + const rootLayout = realRoot.getLayout(); + const length2 = realRoot.children.length; + let rad; + let isLeft; + if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) { + const center3 = { + x: (realRoot.children[0].getLayout().x + realRoot.children[length2 - 1].getLayout().x) / 2, + y: (realRoot.children[0].getLayout().y + realRoot.children[length2 - 1].getLayout().y) / 2 + }; + rad = Math.atan2(center3.y - rootLayout.y, center3.x - rootLayout.x); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + isLeft = center3.x < rootLayout.x; + if (isLeft) { + rad = rad - Math.PI; + } + } else { + rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) { + isLeft = targetLayout.x < rootLayout.x; + if (isLeft) { + rad = rad - Math.PI; } - api.dispatchAction({ - type: 'updateAxisPointer', - seriesIndex: seriesIndex, - dataIndex: dataIndex, - position: payload.position - }); - return true; - }; - TooltipView.prototype._tryShow = function (e, dispatchAction) { - var el = e.target; - var tooltipModel = this._tooltipModel; - if (!tooltipModel) { - return; + } else { + isLeft = targetLayout.x > rootLayout.x; + if (!isLeft) { + rad = rad - Math.PI; } - // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed - this._lastX = e.offsetX; - this._lastY = e.offsetY; - var dataByCoordSys = e.dataByCoordSys; - if (dataByCoordSys && dataByCoordSys.length) { - this._showAxisTooltip(dataByCoordSys, e); - } else if (el) { - var ecData = getECData(el); - if (ecData.ssrType === 'legend') { - // Don't trigger tooltip for legend tooltip item - return; - } - this._lastDataByCoordSys = null; - var seriesDispatcher_1; - var cmptDispatcher_1; - findEventDispatcher(el, function (target) { - // Always show item tooltip if mouse is on the element with dataIndex - if (getECData(target).dataIndex != null) { - seriesDispatcher_1 = target; - return true; - } - // Tooltip provided directly. Like legend. - if (getECData(target).tooltipConfig != null) { - cmptDispatcher_1 = target; - return true; - } - }, true); - if (seriesDispatcher_1) { - this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction); - } else if (cmptDispatcher_1) { - this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction); - } else { - this._hide(dispatchAction); - } - } else { - this._lastDataByCoordSys = null; - this._hide(dispatchAction); + } + } + const textPosition = isLeft ? "left" : "right"; + const normalLabelModel = itemModel.getModel("label"); + const rotate2 = normalLabelModel.get("rotate"); + const labelRotateRadian = rotate2 * (Math.PI / 180); + const textContent = symbolPath.getTextContent(); + if (textContent) { + symbolPath.setTextConfig({ + position: normalLabelModel.get("position") || textPosition, + rotation: rotate2 == null ? -rad : labelRotateRadian, + origin: "center" + }); + textContent.setStyle("verticalAlign", "middle"); + } + } + const focus = itemModel.get(["emphasis", "focus"]); + const focusDataIndices = focus === "relative" ? concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === "ancestor" ? node.getAncestorsIndices() : focus === "descendant" ? node.getDescendantIndices() : null; + if (focusDataIndices) { + getECData(symbolEl).focus = focusDataIndices; + } + drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group); + if (symbolEl.__edge) { + symbolEl.onHoverStateChange = function(toState) { + if (toState !== "blur") { + const parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex); + if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) { + setStatesFlag(symbolEl.__edge, toState); } - }; - TooltipView.prototype._showOrMove = function (tooltipModel, cb) { - // showDelay is used in this case: tooltip.enterable is set - // as true. User intent to move mouse into tooltip and click - // something. `showDelay` makes it easier to enter the content - // but tooltip do not move immediately. - var delay = tooltipModel.get('showDelay'); - cb = bind(cb, this); - clearTimeout(this._showTimout); - delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb(); - }; - TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) { - var ecModel = this._ecModel; - var globalTooltipModel = this._tooltipModel; - var point = [e.offsetX, e.offsetY]; - var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel); - var renderMode = this._renderMode; - var cbParamsList = []; - var articleMarkup = createTooltipMarkup('section', { - blocks: [], - noHeader: true - }); - // Only for legacy: `Serise['formatTooltip']` returns a string. - var markupTextArrLegacy = []; - var markupStyleCreator = new TooltipMarkupStyleCreator(); - each(dataByCoordSys, function (itemCoordSys) { - each(itemCoordSys.dataByAxis, function (axisItem) { - var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex); - var axisValue = axisItem.value; - if (!axisModel || axisValue == null) { - return; + } + }; + } +} +function drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) { + const itemModel = node.getModel(); + const edgeShape = seriesModel.get("edgeShape"); + const layout18 = seriesModel.get("layout"); + const orient = seriesModel.getOrient(); + const curvature = seriesModel.get(["lineStyle", "curveness"]); + const edgeForkPosition = seriesModel.get("edgeForkPosition"); + const lineStyle = itemModel.getModel("lineStyle").getLineStyle(); + let edge = symbolEl.__edge; + if (edgeShape === "curve") { + if (node.parentNode && node.parentNode !== virtualRoot) { + if (!edge) { + edge = symbolEl.__edge = new BezierCurve_default({ + shape: getEdgeShape(layout18, orient, curvature, sourceOldLayout, sourceOldLayout) + }); + } + updateProps(edge, { + shape: getEdgeShape(layout18, orient, curvature, sourceLayout, targetLayout) + }, seriesModel); + } + } else if (edgeShape === "polyline") { + if (layout18 === "orthogonal") { + if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) { + const children = node.children; + const childPoints = []; + for (let i = 0; i < children.length; i++) { + const childLayout = children[i].getLayout(); + childPoints.push([childLayout.x, childLayout.y]); + } + if (!edge) { + edge = symbolEl.__edge = new TreePath({ + shape: { + parentPoint: [targetLayout.x, targetLayout.y], + childPoints: [[targetLayout.x, targetLayout.y]], + orient, + forkPosition: edgeForkPosition } - var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt); - var axisSectionMarkup = createTooltipMarkup('section', { - header: axisValueLabel, - noHeader: !trim(axisValueLabel), - sortBlocks: true, - blocks: [] - }); - articleMarkup.blocks.push(axisSectionMarkup); - each(axisItem.seriesDataIndices, function (idxItem) { - var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); - var dataIndex = idxItem.dataIndexInside; - var cbParams = series.getDataParams(dataIndex); - // Can't find data. - if (cbParams.dataIndex < 0) { - return; - } - cbParams.axisDim = axisItem.axisDim; - cbParams.axisIndex = axisItem.axisIndex; - cbParams.axisType = axisItem.axisType; - cbParams.axisId = axisItem.axisId; - cbParams.axisValue = getAxisRawValue(axisModel.axis, { - value: axisValue - }); - cbParams.axisValueLabel = axisValueLabel; - // Pre-create marker style for makers. Users can assemble richText - // text in `formatter` callback and use those markers style. - cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode); - var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null)); - var frag = seriesTooltipResult.frag; - if (frag) { - var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter'); - axisSectionMarkup.blocks.push(valueFormatter ? extend({ - valueFormatter: valueFormatter - }, frag) : frag); - } - if (seriesTooltipResult.text) { - markupTextArrLegacy.push(seriesTooltipResult.text); - } - cbParamsList.push(cbParams); - }); }); - }); - // In most cases, the second axis is displays upper on the first one. - // So we reverse it to look better. - articleMarkup.blocks.reverse(); - markupTextArrLegacy.reverse(); - var positionExpr = e.position; - var orderMode = singleTooltipModel.get('order'); - var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle')); - builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText); - var blockBreak = renderMode === 'richText' ? '\n\n' : '
'; - var allMarkupText = markupTextArrLegacy.join(blockBreak); - this._showOrMove(singleTooltipModel, function () { - if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) { - this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList); - } else { - this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator); + } + updateProps(edge, { + shape: { + parentPoint: [targetLayout.x, targetLayout.y], + childPoints } - }); - // Do not trigger events here, because this branch only be entered - // from dispatchAction. - }; - - TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) { - var ecModel = this._ecModel; - var ecData = getECData(dispatcher); - // Use dataModel in element if possible - // Used when mouseover on a element like markPoint or edge - // In which case, the data is not main data in series. - var seriesIndex = ecData.seriesIndex; - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); - // For example, graph link. - var dataModel = ecData.dataModel || seriesModel; - var dataIndex = ecData.dataIndex; - var dataType = ecData.dataType; - var data = dataModel.getData(dataType); - var renderMode = this._renderMode; - var positionDefault = e.positionDefault; - var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? { - position: positionDefault - } : null); - var tooltipTrigger = tooltipModel.get('trigger'); - if (tooltipTrigger != null && tooltipTrigger !== 'item') { - return; + }, seriesModel); + } + } else { + if (true) { + throw new Error("The polyline edgeShape can only be used in orthogonal layout"); + } + } + } + if (edge && !(edgeShape === "polyline" && !node.isExpand)) { + edge.useStyle(defaults({ + strokeNoScale: true, + fill: null + }, lineStyle)); + setStatesStylesFromModel(edge, itemModel, "lineStyle"); + setDefaultStateProxy(edge); + group.add(edge); + } +} +function removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) { + const virtualRoot = data.tree.root; + const {source, sourceLayout} = getSourceNode(virtualRoot, node); + const symbolEl = data.getItemGraphicEl(node.dataIndex); + if (!symbolEl) { + return; + } + const sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); + const sourceEdge = sourceSymbolEl.__edge; + const edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : void 0); + const edgeShape = seriesModel.get("edgeShape"); + const layoutOpt = seriesModel.get("layout"); + const orient = seriesModel.get("orient"); + const curvature = seriesModel.get(["lineStyle", "curveness"]); + if (edge) { + if (edgeShape === "curve") { + removeElement(edge, { + shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout), + style: { + opacity: 0 } - var params = dataModel.getDataParams(dataIndex, dataType); - var markupStyleCreator = new TooltipMarkupStyleCreator(); - // Pre-create marker style for makers. Users can assemble richText - // text in `formatter` callback and use those markers style. - params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode); - var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType)); - var orderMode = tooltipModel.get('order'); - var valueFormatter = tooltipModel.get('valueFormatter'); - var frag = seriesTooltipResult.frag; - var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({ - valueFormatter: valueFormatter - }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text; - var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex; - this._showOrMove(tooltipModel, function () { - this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator); - }); - // FIXME - // duplicated showtip if manuallyShowTip is called from dispatchAction. - dispatchAction({ - type: 'showTip', - dataIndexInside: dataIndex, - dataIndex: data.getRawIndex(dataIndex), - seriesIndex: seriesIndex, - from: this.uid - }); + }, seriesModel, { + cb() { + group.remove(edge); + }, + removeOpt: removeAnimationOpt + }); + } else if (edgeShape === "polyline" && seriesModel.get("layout") === "orthogonal") { + removeElement(edge, { + shape: { + parentPoint: [sourceLayout.x, sourceLayout.y], + childPoints: [[sourceLayout.x, sourceLayout.y]] + }, + style: { + opacity: 0 + } + }, seriesModel, { + cb() { + group.remove(edge); + }, + removeOpt: removeAnimationOpt + }); + } + } +} +function getSourceNode(virtualRoot, node) { + let source = node.parentNode === virtualRoot ? node : node.parentNode || node; + let sourceLayout; + while (sourceLayout = source.getLayout(), sourceLayout == null) { + source = source.parentNode === virtualRoot ? source : source.parentNode || source; + } + return { + source, + sourceLayout + }; +} +function removeNode(data, dataIndex, symbolEl, group, seriesModel) { + const node = data.tree.getNodeByDataIndex(dataIndex); + const virtualRoot = data.tree.root; + const {sourceLayout} = getSourceNode(virtualRoot, node); + const removeAnimationOpt = { + duration: seriesModel.get("animationDurationUpdate"), + easing: seriesModel.get("animationEasingUpdate") + }; + removeElement(symbolEl, { + x: sourceLayout.x + 1, + y: sourceLayout.y + 1 + }, seriesModel, { + cb() { + group.remove(symbolEl); + data.setItemGraphicEl(dataIndex, null); + }, + removeOpt: removeAnimationOpt + }); + symbolEl.fadeOut(null, data.hostModel, { + fadeLabel: true, + animation: removeAnimationOpt + }); + node.children.forEach((childNode) => { + removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt); + }); + removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt); +} +function getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) { + let cpx1; + let cpy1; + let cpx2; + let cpy2; + let x1; + let x2; + let y1; + let y2; + if (layoutOpt === "radial") { + x1 = sourceLayout.rawX; + y1 = sourceLayout.rawY; + x2 = targetLayout.rawX; + y2 = targetLayout.rawY; + const radialCoor1 = radialCoordinate(x1, y1); + const radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature); + const radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature); + const radialCoor4 = radialCoordinate(x2, y2); + return { + x1: radialCoor1.x || 0, + y1: radialCoor1.y || 0, + x2: radialCoor4.x || 0, + y2: radialCoor4.y || 0, + cpx1: radialCoor2.x || 0, + cpy1: radialCoor2.y || 0, + cpx2: radialCoor3.x || 0, + cpy2: radialCoor3.y || 0 + }; + } else { + x1 = sourceLayout.x; + y1 = sourceLayout.y; + x2 = targetLayout.x; + y2 = targetLayout.y; + if (orient === "LR" || orient === "RL") { + cpx1 = x1 + (x2 - x1) * curvature; + cpy1 = y1; + cpx2 = x2 + (x1 - x2) * curvature; + cpy2 = y2; + } + if (orient === "TB" || orient === "BT") { + cpx1 = x1; + cpy1 = y1 + (y2 - y1) * curvature; + cpx2 = x2; + cpy2 = y2 + (y1 - y2) * curvature; + } + } + return { + x1, + y1, + x2, + y2, + cpx1, + cpy1, + cpx2, + cpy2 + }; +} +var TreeView_default = TreeView; + +// src/data/helper/linkSeriesData.ts +var inner8 = makeInner(); +function linkSeriesData(opt) { + const mainData = opt.mainData; + let datas = opt.datas; + if (!datas) { + datas = {main: mainData}; + opt.datasAttr = {main: "data"}; + } + opt.datas = opt.mainData = null; + linkAll(mainData, datas, opt); + each(datas, function(data) { + each(mainData.TRANSFERABLE_METHODS, function(methodName) { + data.wrapMethod(methodName, curry(transferInjection, opt)); + }); + }); + mainData.wrapMethod("cloneShallow", curry(cloneShallowInjection, opt)); + each(mainData.CHANGABLE_METHODS, function(methodName) { + mainData.wrapMethod(methodName, curry(changeInjection, opt)); + }); + assert(datas[mainData.dataType] === mainData); +} +function transferInjection(opt, res) { + if (isMainData(this)) { + const datas = extend({}, inner8(this).datas); + datas[this.dataType] = res; + linkAll(res, datas, opt); + } else { + linkSingle(res, this.dataType, inner8(this).mainData, opt); + } + return res; +} +function changeInjection(opt, res) { + opt.struct && opt.struct.update(); + return res; +} +function cloneShallowInjection(opt, res) { + each(inner8(res).datas, function(data, dataType) { + data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); + }); + return res; +} +function getLinkedData(dataType) { + const mainData = inner8(this).mainData; + return dataType == null || mainData == null ? mainData : inner8(mainData).datas[dataType]; +} +function getLinkedDataAll() { + const mainData = inner8(this).mainData; + return mainData == null ? [{data: mainData}] : map(keys(inner8(mainData).datas), function(type) { + return { + type, + data: inner8(mainData).datas[type] + }; + }); +} +function isMainData(data) { + return inner8(data).mainData === data; +} +function linkAll(mainData, datas, opt) { + inner8(mainData).datas = {}; + each(datas, function(data, dataType) { + linkSingle(data, dataType, mainData, opt); + }); +} +function linkSingle(data, dataType, mainData, opt) { + inner8(mainData).datas[dataType] = data; + inner8(data).mainData = mainData; + data.dataType = dataType; + if (opt.struct) { + data[opt.structAttr] = opt.struct; + opt.struct[opt.datasAttr[dataType]] = data; + } + data.getLinkedData = getLinkedData; + data.getLinkedDataAll = getLinkedDataAll; +} +var linkSeriesData_default = linkSeriesData; + +// src/data/Tree.ts +var TreeNode = class { + constructor(name, hostTree) { + this.depth = 0; + this.height = 0; + this.dataIndex = -1; + this.children = []; + this.viewChildren = []; + this.isExpand = false; + this.name = name || ""; + this.hostTree = hostTree; + } + isRemoved() { + return this.dataIndex < 0; + } + eachNode(options, cb, context) { + if (isFunction(options)) { + context = cb; + cb = options; + options = null; + } + options = options || {}; + if (isString(options)) { + options = {order: options}; + } + const order = options.order || "preorder"; + const children = this[options.attr || "children"]; + let suppressVisitSub; + order === "preorder" && (suppressVisitSub = cb.call(context, this)); + for (let i = 0; !suppressVisitSub && i < children.length; i++) { + children[i].eachNode(options, cb, context); + } + order === "postorder" && cb.call(context, this); + } + updateDepthAndHeight(depth) { + let height = 0; + this.depth = depth; + for (let i = 0; i < this.children.length; i++) { + const child = this.children[i]; + child.updateDepthAndHeight(depth + 1); + if (child.height > height) { + height = child.height; + } + } + this.height = height + 1; + } + getNodeById(id) { + if (this.getId() === id) { + return this; + } + for (let i = 0, children = this.children, len2 = children.length; i < len2; i++) { + const res = children[i].getNodeById(id); + if (res) { + return res; + } + } + } + contains(node) { + if (node === this) { + return true; + } + for (let i = 0, children = this.children, len2 = children.length; i < len2; i++) { + const res = children[i].contains(node); + if (res) { + return res; + } + } + } + getAncestors(includeSelf) { + const ancestors = []; + let node = includeSelf ? this : this.parentNode; + while (node) { + ancestors.push(node); + node = node.parentNode; + } + ancestors.reverse(); + return ancestors; + } + getAncestorsIndices() { + const indices = []; + let currNode = this; + while (currNode) { + indices.push(currNode.dataIndex); + currNode = currNode.parentNode; + } + indices.reverse(); + return indices; + } + getDescendantIndices() { + const indices = []; + this.eachNode((childNode) => { + indices.push(childNode.dataIndex); + }); + return indices; + } + getValue(dimension) { + const data = this.hostTree.data; + return data.getStore().get(data.getDimensionIndex(dimension || "value"), this.dataIndex); + } + setLayout(layout18, merge2) { + this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout18, merge2); + } + getLayout() { + return this.hostTree.data.getItemLayout(this.dataIndex); + } + getModel(path) { + if (this.dataIndex < 0) { + return; + } + const hostTree = this.hostTree; + const itemModel = hostTree.data.getItemModel(this.dataIndex); + return itemModel.getModel(path); + } + getLevelModel() { + return (this.hostTree.levelModels || [])[this.depth]; + } + setVisual(key, value) { + this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value); + } + getVisual(key) { + return this.hostTree.data.getItemVisual(this.dataIndex, key); + } + getRawIndex() { + return this.hostTree.data.getRawIndex(this.dataIndex); + } + getId() { + return this.hostTree.data.getId(this.dataIndex); + } + getChildIndex() { + if (this.parentNode) { + const children = this.parentNode.children; + for (let i = 0; i < children.length; ++i) { + if (children[i] === this) { + return i; + } + } + return -1; + } + return -1; + } + isAncestorOf(node) { + let parent = node.parentNode; + while (parent) { + if (parent === this) { + return true; + } + parent = parent.parentNode; + } + return false; + } + isDescendantOf(node) { + return node !== this && node.isAncestorOf(this); + } +}; +var Tree = class { + constructor(hostModel) { + this.type = "tree"; + this._nodes = []; + this.hostModel = hostModel; + } + eachNode(options, cb, context) { + this.root.eachNode(options, cb, context); + } + getNodeByDataIndex(dataIndex) { + const rawIndex = this.data.getRawIndex(dataIndex); + return this._nodes[rawIndex]; + } + getNodeById(name) { + return this.root.getNodeById(name); + } + update() { + const data = this.data; + const nodes = this._nodes; + for (let i = 0, len2 = nodes.length; i < len2; i++) { + nodes[i].dataIndex = -1; + } + for (let i = 0, len2 = data.count(); i < len2; i++) { + nodes[data.getRawIndex(i)].dataIndex = i; + } + } + clearLayouts() { + this.data.clearItemLayouts(); + } + static createTree(dataRoot, hostModel, beforeLink) { + const tree = new Tree(hostModel); + const listData = []; + let dimMax = 1; + buildHierarchy(dataRoot); + function buildHierarchy(dataNode, parentNode2) { + const value = dataNode.value; + dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); + listData.push(dataNode); + const node = new TreeNode(convertOptionIdName(dataNode.name, ""), tree); + parentNode2 ? addChild(node, parentNode2) : tree.root = node; + tree._nodes.push(node); + const children = dataNode.children; + if (children) { + for (let i = 0; i < children.length; i++) { + buildHierarchy(children[i], node); + } + } + } + tree.root.updateDepthAndHeight(0); + const {dimensions} = prepareSeriesDataSchema(listData, { + coordDimensions: ["value"], + dimensionsCount: dimMax + }); + const list = new SeriesData_default(dimensions, hostModel); + list.initData(listData); + beforeLink && beforeLink(list); + linkSeriesData_default({ + mainData: list, + struct: tree, + structAttr: "tree" + }); + tree.update(); + return tree; + } +}; +function addChild(child, node) { + const children = node.children; + if (child.parentNode === node) { + return; + } + children.push(child); + child.parentNode = node; +} +var Tree_default = Tree; + +// src/chart/helper/treeHelper.ts +function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) { + if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { + const root = seriesModel.getData().tree.root; + let targetNode = payload.targetNode; + if (isString(targetNode)) { + targetNode = root.getNodeById(targetNode); + } + if (targetNode && root.contains(targetNode)) { + return { + node: targetNode }; - TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) { - var isHTMLRenderMode = this._renderMode === 'html'; - var ecData = getECData(el); - var tooltipConfig = ecData.tooltipConfig; - var tooltipOpt = tooltipConfig.option || {}; - var encodeHTMLContent = tooltipOpt.encodeHTMLContent; - if (isString(tooltipOpt)) { - var content = tooltipOpt; - tooltipOpt = { - content: content, - // Fixed formatter - formatter: content - }; - // when `tooltipConfig.option` is a string rather than an object, - // we can't know if the content needs to be encoded - // for the sake of security, encode it by default. - encodeHTMLContent = true; - } - if (encodeHTMLContent && isHTMLRenderMode && tooltipOpt.content) { - // clone might be unnecessary? - tooltipOpt = clone(tooltipOpt); - tooltipOpt.content = encodeHTML(tooltipOpt.content); - } - var tooltipModelCascade = [tooltipOpt]; - var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex); - if (cmpt) { - tooltipModelCascade.push(cmpt); - } - // In most cases, component tooltip formatter has different params with series tooltip formatter, - // so that they cannot share the same formatter. Since the global tooltip formatter is used for series - // by convention, we do not use it as the default formatter for component. - tooltipModelCascade.push({ - formatter: tooltipOpt.content + } + const targetNodeId = payload.targetNodeId; + if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { + return { + node: targetNode + }; + } + } +} +function getPathToRoot(node) { + const path = []; + while (node) { + node = node.parentNode; + node && path.push(node); + } + return path.reverse(); +} +function aboveViewRoot(viewRoot, node) { + const viewPath = getPathToRoot(viewRoot); + return indexOf(viewPath, node) >= 0; +} +function wrapTreePathInfo(node, seriesModel) { + const treePathInfo = []; + while (node) { + const nodeDataIndex = node.dataIndex; + treePathInfo.push({ + name: node.name, + dataIndex: nodeDataIndex, + value: seriesModel.getRawValue(nodeDataIndex) + }); + node = node.parentNode; + } + treePathInfo.reverse(); + return treePathInfo; +} + +// src/chart/tree/TreeSeries.ts +var TreeSeriesModel = class extends Series_default { + constructor() { + super(...arguments); + this.hasSymbolVisual = true; + this.ignoreStyleOnData = true; + } + getInitialData(option) { + const root = { + name: option.name, + children: option.data + }; + const leaves = option.leaves || {}; + const leavesModel = new Model_default(leaves, this, this.ecModel); + const tree = Tree_default.createTree(root, this, beforeLink); + function beforeLink(nodeData) { + nodeData.wrapMethod("getItemModel", function(model, idx) { + const node = tree.getNodeByDataIndex(idx); + if (!(node && node.children.length && node.isExpand)) { + model.parentModel = leavesModel; + } + return model; + }); + } + let treeDepth = 0; + tree.eachNode("preorder", function(node) { + if (node.depth > treeDepth) { + treeDepth = node.depth; + } + }); + const expandAndCollapse = option.expandAndCollapse; + const expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth; + tree.root.eachNode("preorder", function(node) { + const item = node.hostTree.data.getRawDataItem(node.dataIndex); + node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth; + }); + return tree.data; + } + getOrient() { + let orient = this.get("orient"); + if (orient === "horizontal") { + orient = "LR"; + } else if (orient === "vertical") { + orient = "TB"; + } + return orient; + } + setZoom(zoom) { + this.option.zoom = zoom; + } + setCenter(center3) { + this.option.center = center3; + } + formatTooltip(dataIndex, multipleSeries, dataType) { + const tree = this.getData().tree; + const realRoot = tree.root.children[0]; + let node = tree.getNodeByDataIndex(dataIndex); + const value = node.getValue(); + let name = node.name; + while (node && node !== realRoot) { + name = node.parentNode.name + "." + name; + node = node.parentNode; + } + return createTooltipMarkup("nameValue", { + name, + value, + noValue: isNaN(value) || value == null + }); + } + getDataParams(dataIndex) { + const params = super.getDataParams.apply(this, arguments); + const node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treeAncestors = wrapTreePathInfo(node, this); + params.collapsed = !node.isExpand; + return params; + } +}; +TreeSeriesModel.type = "series.tree"; +TreeSeriesModel.layoutMode = "box"; +TreeSeriesModel.defaultOption = { + z: 2, + coordinateSystem: "view", + left: "12%", + top: "12%", + right: "12%", + bottom: "12%", + layout: "orthogonal", + edgeShape: "curve", + edgeForkPosition: "50%", + roam: false, + nodeScaleRatio: 0.4, + center: null, + zoom: 1, + orient: "LR", + symbol: "emptyCircle", + symbolSize: 7, + expandAndCollapse: true, + initialTreeDepth: 2, + lineStyle: { + color: "#ccc", + width: 1.5, + curveness: 0.5 + }, + itemStyle: { + color: "lightsteelblue", + borderWidth: 1.5 + }, + label: { + show: true + }, + animationEasing: "linear", + animationDuration: 700, + animationDurationUpdate: 500 +}; +var TreeSeries_default = TreeSeriesModel; + +// src/chart/tree/traversalHelper.ts +function eachAfter(root, callback, separation2) { + const nodes = [root]; + const next = []; + let node; + while (node = nodes.pop()) { + next.push(node); + if (node.isExpand) { + const children = node.children; + if (children.length) { + for (let i = 0; i < children.length; i++) { + nodes.push(children[i]); + } + } + } + } + while (node = next.pop()) { + callback(node, separation2); + } +} +function eachBefore(root, callback) { + const nodes = [root]; + let node; + while (node = nodes.pop()) { + callback(node); + if (node.isExpand) { + const children = node.children; + if (children.length) { + for (let i = children.length - 1; i >= 0; i--) { + nodes.push(children[i]); + } + } + } + } +} + +// src/chart/tree/treeLayout.ts +function treeLayout(ecModel, api2) { + ecModel.eachSeriesByType("tree", function(seriesModel) { + commonLayout(seriesModel, api2); + }); +} +function commonLayout(seriesModel, api2) { + const layoutInfo = getViewRect2(seriesModel, api2); + seriesModel.layoutInfo = layoutInfo; + const layout18 = seriesModel.get("layout"); + let width = 0; + let height = 0; + let separation2 = null; + if (layout18 === "radial") { + width = 2 * Math.PI; + height = Math.min(layoutInfo.height, layoutInfo.width) / 2; + separation2 = separation(function(node1, node2) { + return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; + }); + } else { + width = layoutInfo.width; + height = layoutInfo.height; + separation2 = separation(); + } + const virtualRoot = seriesModel.getData().tree.root; + const realRoot = virtualRoot.children[0]; + if (realRoot) { + init3(virtualRoot); + eachAfter(realRoot, firstWalk, separation2); + virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim; + eachBefore(realRoot, secondWalk); + let left = realRoot; + let right = realRoot; + let bottom = realRoot; + eachBefore(realRoot, function(node) { + const x = node.getLayout().x; + if (x < left.getLayout().x) { + left = node; + } + if (x > right.getLayout().x) { + right = node; + } + if (node.depth > bottom.depth) { + bottom = node; + } + }); + const delta = left === right ? 1 : separation2(left, right) / 2; + const tx = delta - left.getLayout().x; + let kx = 0; + let ky = 0; + let coorX = 0; + let coorY = 0; + if (layout18 === "radial") { + kx = width / (right.getLayout().x + delta + tx); + ky = height / (bottom.depth - 1 || 1); + eachBefore(realRoot, function(node) { + coorX = (node.getLayout().x + tx) * kx; + coorY = (node.depth - 1) * ky; + const finalCoor = radialCoordinate(coorX, coorY); + node.setLayout({x: finalCoor.x, y: finalCoor.y, rawX: coorX, rawY: coorY}, true); + }); + } else { + const orient = seriesModel.getOrient(); + if (orient === "RL" || orient === "LR") { + ky = height / (right.getLayout().x + delta + tx); + kx = width / (bottom.depth - 1 || 1); + eachBefore(realRoot, function(node) { + coorY = (node.getLayout().x + tx) * ky; + coorX = orient === "LR" ? (node.depth - 1) * kx : width - (node.depth - 1) * kx; + node.setLayout({x: coorX, y: coorY}, true); + }); + } else if (orient === "TB" || orient === "BT") { + kx = width / (right.getLayout().x + delta + tx); + ky = height / (bottom.depth - 1 || 1); + eachBefore(realRoot, function(node) { + coorX = (node.getLayout().x + tx) * kx; + coorY = orient === "TB" ? (node.depth - 1) * ky : height - (node.depth - 1) * ky; + node.setLayout({x: coorX, y: coorY}, true); + }); + } + } + } +} + +// src/chart/tree/treeVisual.ts +function treeVisual(ecModel) { + ecModel.eachSeriesByType("tree", function(seriesModel) { + const data = seriesModel.getData(); + const tree = data.tree; + tree.eachNode(function(node) { + const model = node.getModel(); + const style = model.getModel("itemStyle").getItemStyle(); + const existsStyle = data.ensureUniqueItemVisual(node.dataIndex, "style"); + extend(existsStyle, style); + }); + }); +} + +// src/chart/tree/treeAction.ts +function installTreeAction(registers) { + registers.registerAction({ + type: "treeExpandAndCollapse", + event: "treeExpandAndCollapse", + update: "update" + }, function(payload, ecModel) { + ecModel.eachComponent({ + mainType: "series", + subType: "tree", + query: payload + }, function(seriesModel) { + const dataIndex = payload.dataIndex; + const tree = seriesModel.getData().tree; + const node = tree.getNodeByDataIndex(dataIndex); + node.isExpand = !node.isExpand; + }); + }); + registers.registerAction({ + type: "treeRoam", + event: "treeRoam", + update: "none" + }, function(payload, ecModel, api2) { + ecModel.eachComponent({ + mainType: "series", + subType: "tree", + query: payload + }, function(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + const res = updateCenterAndZoom(coordSys, payload, void 0, api2); + seriesModel.setCenter && seriesModel.setCenter(res.center); + seriesModel.setZoom && seriesModel.setZoom(res.zoom); + }); + }); +} + +// src/chart/tree/install.ts +function install12(registers) { + registers.registerChartView(TreeView_default); + registers.registerSeriesModel(TreeSeries_default); + registers.registerLayout(treeLayout); + registers.registerVisual(treeVisual); + installTreeAction(registers); +} + +// src/chart/treemap/treemapAction.ts +var actionTypes = [ + "treemapZoomToNode", + "treemapRender", + "treemapMove" +]; +function installTreemapAction(registers) { + for (let i = 0; i < actionTypes.length; i++) { + registers.registerAction({ + type: actionTypes[i], + update: "updateView" + }, noop); + } + registers.registerAction({type: "treemapRootToNode", update: "updateView"}, function(payload, ecModel) { + ecModel.eachComponent({mainType: "series", subType: "treemap", query: payload}, handleRootToNode); + function handleRootToNode(model, index) { + const types = ["treemapZoomToNode", "treemapRootToNode"]; + const targetInfo = retrieveTargetInfo(payload, types, model); + if (targetInfo) { + const originViewRoot = model.getViewRoot(); + if (originViewRoot) { + payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? "rollUp" : "drillDown"; + } + model.resetViewRoot(targetInfo.node); + } + } + }); +} + +// src/chart/helper/enableAriaDecalForTree.ts +function enableAriaDecalForTree(seriesModel) { + const data = seriesModel.getData(); + const tree = data.tree; + const decalPaletteScope2 = {}; + tree.eachNode((node) => { + let current = node; + while (current && current.depth > 1) { + current = current.parentNode; + } + const decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + "", decalPaletteScope2); + node.setVisual("decal", decal); + }); +} + +// src/chart/treemap/TreemapSeries.ts +var TreemapSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = TreemapSeriesModel2.type; + this.preventUsingHoverLayer = true; + } + getInitialData(option, ecModel) { + const root = { + name: option.name, + children: option.data + }; + completeTreeValue(root); + let levels = option.levels || []; + const designatedVisualItemStyle = this.designatedVisualItemStyle = {}; + const designatedVisualModel = new Model_default({itemStyle: designatedVisualItemStyle}, this, ecModel); + levels = option.levels = setDefault(levels, ecModel); + const levelModels = map(levels || [], function(levelDefine) { + return new Model_default(levelDefine, designatedVisualModel, ecModel); + }, this); + const tree = Tree_default.createTree(root, this, beforeLink); + function beforeLink(nodeData) { + nodeData.wrapMethod("getItemModel", function(model, idx) { + const node = tree.getNodeByDataIndex(idx); + const levelModel = node ? levelModels[node.depth] : null; + model.parentModel = levelModel || designatedVisualModel; + return model; + }); + } + return tree.data; + } + optionUpdated() { + this.resetViewRoot(); + } + formatTooltip(dataIndex, multipleSeries, dataType) { + const data = this.getData(); + const value = this.getRawValue(dataIndex); + const name = data.getName(dataIndex); + return createTooltipMarkup("nameValue", {name, value}); + } + getDataParams(dataIndex) { + const params = super.getDataParams.apply(this, arguments); + const node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treeAncestors = wrapTreePathInfo(node, this); + params.treePathInfo = params.treeAncestors; + return params; + } + setLayoutInfo(layoutInfo) { + this.layoutInfo = this.layoutInfo || {}; + extend(this.layoutInfo, layoutInfo); + } + mapIdToIndex(id) { + let idIndexMap = this._idIndexMap; + if (!idIndexMap) { + idIndexMap = this._idIndexMap = createHashMap(); + this._idIndexMapCount = 0; + } + let index = idIndexMap.get(id); + if (index == null) { + idIndexMap.set(id, index = this._idIndexMapCount++); + } + return index; + } + getViewRoot() { + return this._viewRoot; + } + resetViewRoot(viewRoot) { + viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot; + const root = this.getRawData().tree.root; + if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) { + this._viewRoot = root; + } + } + enableAriaDecal() { + enableAriaDecalForTree(this); + } +}; +var TreemapSeriesModel = TreemapSeriesModel2; +TreemapSeriesModel.type = "series.treemap"; +TreemapSeriesModel.layoutMode = "box"; +TreemapSeriesModel.defaultOption = { + progressive: 0, + left: "center", + top: "middle", + width: "80%", + height: "80%", + sort: true, + clipWindow: "origin", + squareRatio: 0.5 * (1 + Math.sqrt(5)), + leafDepth: null, + drillDownIcon: "\u25B6", + zoomToNodeRatio: 0.32 * 0.32, + scaleLimit: null, + roam: true, + nodeClick: "zoomToNode", + animation: true, + animationDurationUpdate: 900, + animationEasing: "quinticInOut", + breadcrumb: { + show: true, + height: 22, + left: "center", + top: "bottom", + emptyItemWidth: 25, + itemStyle: { + color: "rgba(0,0,0,0.7)", + textStyle: { + color: "#fff" + } + }, + emphasis: { + itemStyle: { + color: "rgba(0,0,0,0.9)" + } + } + }, + label: { + show: true, + distance: 0, + padding: 5, + position: "inside", + color: "#fff", + overflow: "truncate" + }, + upperLabel: { + show: false, + position: [0, "50%"], + height: 20, + overflow: "truncate", + verticalAlign: "middle" + }, + itemStyle: { + color: null, + colorAlpha: null, + colorSaturation: null, + borderWidth: 0, + gapWidth: 0, + borderColor: "#fff", + borderColorSaturation: null + }, + emphasis: { + upperLabel: { + show: true, + position: [0, "50%"], + overflow: "truncate", + verticalAlign: "middle" + } + }, + visualDimension: 0, + visualMin: null, + visualMax: null, + color: [], + colorAlpha: null, + colorSaturation: null, + colorMappingBy: "index", + visibleMin: 10, + childrenVisibleMin: null, + levels: [] +}; +function completeTreeValue(dataNode) { + let sum2 = 0; + each(dataNode.children, function(child) { + completeTreeValue(child); + let childValue = child.value; + isArray(childValue) && (childValue = childValue[0]); + sum2 += childValue; + }); + let thisValue = dataNode.value; + if (isArray(thisValue)) { + thisValue = thisValue[0]; + } + if (thisValue == null || isNaN(thisValue)) { + thisValue = sum2; + } + if (thisValue < 0) { + thisValue = 0; + } + isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; +} +function setDefault(levels, ecModel) { + const globalColorList = normalizeToArray(ecModel.get("color")); + const globalDecalList = normalizeToArray(ecModel.get(["aria", "decal", "decals"])); + if (!globalColorList) { + return; + } + levels = levels || []; + let hasColorDefine; + let hasDecalDefine; + each(levels, function(levelDefine) { + const model = new Model_default(levelDefine); + const modelColor = model.get("color"); + const modelDecal = model.get("decal"); + if (model.get(["itemStyle", "color"]) || modelColor && modelColor !== "none") { + hasColorDefine = true; + } + if (model.get(["itemStyle", "decal"]) || modelDecal && modelDecal !== "none") { + hasDecalDefine = true; + } + }); + const level0 = levels[0] || (levels[0] = {}); + if (!hasColorDefine) { + level0.color = globalColorList.slice(); + } + if (!hasDecalDefine && globalDecalList) { + level0.decal = globalDecalList.slice(); + } + return levels; +} +var TreemapSeries_default = TreemapSeriesModel; + +// src/chart/treemap/Breadcrumb.ts +var TEXT_PADDING = 8; +var ITEM_GAP = 8; +var ARRAY_LENGTH = 5; +var Breadcrumb = class { + constructor(containerGroup) { + this.group = new Group_default(); + containerGroup.add(this.group); + } + render(seriesModel, api2, targetNode, onSelect) { + const model = seriesModel.getModel("breadcrumb"); + const thisGroup = this.group; + thisGroup.removeAll(); + if (!model.get("show") || !targetNode) { + return; + } + const normalStyleModel = model.getModel("itemStyle"); + const emphasisModel = model.getModel("emphasis"); + const textStyleModel = normalStyleModel.getModel("textStyle"); + const emphasisTextStyleModel = emphasisModel.getModel(["itemStyle", "textStyle"]); + const layoutParam = { + pos: { + left: model.get("left"), + right: model.get("right"), + top: model.get("top"), + bottom: model.get("bottom") + }, + box: { + width: api2.getWidth(), + height: api2.getHeight() + }, + emptyItemWidth: model.get("emptyItemWidth"), + totalWidth: 0, + renderList: [] + }; + this._prepare(targetNode, layoutParam, textStyleModel); + this._renderContent(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect); + positionElement(thisGroup, layoutParam.pos, layoutParam.box); + } + _prepare(targetNode, layoutParam, textStyleModel) { + for (let node = targetNode; node; node = node.parentNode) { + const text = convertOptionIdName(node.getModel().get("name"), ""); + const textRect = textStyleModel.getTextRect(text); + const itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth); + layoutParam.totalWidth += itemWidth + ITEM_GAP; + layoutParam.renderList.push({ + node, + text, + width: itemWidth + }); + } + } + _renderContent(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect) { + let lastX = 0; + const emptyItemWidth = layoutParam.emptyItemWidth; + const height = seriesModel.get(["breadcrumb", "height"]); + const availableSize = getAvailableSize(layoutParam.pos, layoutParam.box); + let totalWidth = layoutParam.totalWidth; + const renderList = layoutParam.renderList; + const emphasisItemStyle = emphasisModel.getModel("itemStyle").getItemStyle(); + for (let i = renderList.length - 1; i >= 0; i--) { + const item = renderList[i]; + const itemNode = item.node; + let itemWidth = item.width; + let text = item.text; + if (totalWidth > availableSize.width) { + totalWidth -= itemWidth - emptyItemWidth; + itemWidth = emptyItemWidth; + text = null; + } + const el = new Polygon_default({ + shape: { + points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0) + }, + style: defaults(normalStyleModel.getItemStyle(), { + lineJoin: "bevel" + }), + textContent: new Text_default({ + style: createTextStyle(textStyleModel, {text}) + }), + textConfig: { + position: "inside" + }, + z2: Z2_EMPHASIS_LIFT * 1e4, + onclick: curry(onSelect, itemNode) + }); + el.disableLabelAnimation = true; + el.getTextContent().ensureState("emphasis").style = createTextStyle(emphasisTextStyleModel, {text}); + el.ensureState("emphasis").style = emphasisItemStyle; + toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + this.group.add(el); + packEventData(el, seriesModel, itemNode); + lastX += itemWidth + ITEM_GAP; + } + } + remove() { + this.group.removeAll(); + } +}; +function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) { + const points4 = [ + [head ? x : x - ARRAY_LENGTH, y], + [x + itemWidth, y], + [x + itemWidth, y + itemHeight], + [head ? x : x - ARRAY_LENGTH, y + itemHeight] + ]; + !tail && points4.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]); + !head && points4.push([x, y + itemHeight / 2]); + return points4; +} +function packEventData(el, seriesModel, itemNode) { + getECData(el).eventData = { + componentType: "series", + componentSubType: "treemap", + componentIndex: seriesModel.componentIndex, + seriesIndex: seriesModel.seriesIndex, + seriesName: seriesModel.name, + seriesType: "treemap", + selfType: "breadcrumb", + nodeData: { + dataIndex: itemNode && itemNode.dataIndex, + name: itemNode && itemNode.name + }, + treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) + }; +} +var Breadcrumb_default = Breadcrumb; + +// src/util/animation.ts +var AnimationWrap = class { + constructor() { + this._storage = []; + this._elExistsMap = {}; + } + add(el, target, duration, delay, easing) { + if (this._elExistsMap[el.id]) { + return false; + } + this._elExistsMap[el.id] = true; + this._storage.push({ + el, + target, + duration, + delay, + easing + }); + return true; + } + finished(callback) { + this._finishedCallback = callback; + return this; + } + start() { + let count2 = this._storage.length; + const checkTerminate = () => { + count2--; + if (count2 <= 0) { + this._storage.length = 0; + this._elExistsMap = {}; + this._finishedCallback && this._finishedCallback(); + } + }; + for (let i = 0, len2 = this._storage.length; i < len2; i++) { + const item = this._storage[i]; + item.el.animateTo(item.target, { + duration: item.duration, + delay: item.delay, + easing: item.easing, + setToFinal: true, + done: checkTerminate, + aborted: checkTerminate + }); + } + return this; + } +}; +function createWrap() { + return new AnimationWrap(); +} + +// src/chart/treemap/TreemapView.ts +var Group2 = Group_default; +var Rect2 = Rect_default; +var DRAG_THRESHOLD = 3; +var PATH_LABEL_NOAMAL = "label"; +var PATH_UPPERLABEL_NORMAL = "upperLabel"; +var Z2_BASE = Z2_EMPHASIS_LIFT * 10; +var Z2_BG = Z2_EMPHASIS_LIFT * 2; +var Z2_CONTENT = Z2_EMPHASIS_LIFT * 3; +var getStateItemStyle = makeStyleMapper([ + ["fill", "color"], + ["stroke", "strokeColor"], + ["lineWidth", "strokeWidth"], + ["shadowBlur"], + ["shadowOffsetX"], + ["shadowOffsetY"], + ["shadowColor"] +]); +var getItemStyleNormal = function(model) { + const itemStyle = getStateItemStyle(model); + itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; + return itemStyle; +}; +var inner9 = makeInner(); +var TreemapView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = TreemapView2.type; + this._state = "ready"; + this._storage = createStorage(); + } + render(seriesModel, ecModel, api2, payload) { + const models = ecModel.findComponents({ + mainType: "series", + subType: "treemap", + query: payload + }); + if (indexOf(models, seriesModel) < 0) { + return; + } + this.seriesModel = seriesModel; + this.api = api2; + this.ecModel = ecModel; + const types = ["treemapZoomToNode", "treemapRootToNode"]; + const targetInfo = retrieveTargetInfo(payload, types, seriesModel); + const payloadType = payload && payload.type; + const layoutInfo = seriesModel.layoutInfo; + const isInit = !this._oldTree; + const thisStorage = this._storage; + const reRoot = payloadType === "treemapRootToNode" && targetInfo && thisStorage ? { + rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()], + direction: payload.direction + } : null; + const containerGroup = this._giveContainerGroup(layoutInfo); + const hasAnimation = seriesModel.get("animation"); + const renderResult = this._doRender(containerGroup, seriesModel, reRoot); + hasAnimation && !isInit && (!payloadType || payloadType === "treemapZoomToNode" || payloadType === "treemapRootToNode") ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally(); + this._resetController(api2); + this._renderBreadcrumb(seriesModel, api2, targetInfo); + } + _giveContainerGroup(layoutInfo) { + let containerGroup = this._containerGroup; + if (!containerGroup) { + containerGroup = this._containerGroup = new Group2(); + this._initEvents(containerGroup); + this.group.add(containerGroup); + } + containerGroup.x = layoutInfo.x; + containerGroup.y = layoutInfo.y; + return containerGroup; + } + _doRender(containerGroup, seriesModel, reRoot) { + const thisTree = seriesModel.getData().tree; + const oldTree = this._oldTree; + const lastsForAnimation = createStorage(); + const thisStorage = createStorage(); + const oldStorage = this._storage; + const willInvisibleEls = []; + function doRenderNode(thisNode, oldNode, parentGroup, depth) { + return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth); + } + dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); + const willDeleteEls = clearStorage(oldStorage); + this._oldTree = thisTree; + this._storage = thisStorage; + if (this._controllerHost) { + const _oldRootLayout = this.seriesModel.layoutInfo; + const rootLayout = thisTree.root.getLayout(); + if (rootLayout.width === _oldRootLayout.width && rootLayout.height === _oldRootLayout.height) { + this._controllerHost.zoom = 1; + } + } + return { + lastsForAnimation, + willDeleteEls, + renderFinally + }; + function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) { + if (sameTree) { + oldViewChildren = thisViewChildren; + each(thisViewChildren, function(child, index) { + !child.isRemoved() && processNode(index, index); }); - var positionDefault = e.positionDefault; - var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? { - position: positionDefault - } : null); - var defaultHtml = subTooltipModel.get('content'); - var asyncTicket = Math.random() + ''; - // PENDING: this case do not support richText style yet. - var markupStyleCreator = new TooltipMarkupStyleCreator(); - // Do not check whether `trigger` is 'none' here, because `trigger` - // only works on coordinate system. In fact, we have not found case - // that requires setting `trigger` nothing on component yet. - this._showOrMove(subTooltipModel, function () { - // Use formatterParams from element defined in component - // Avoid users modify it. - var formatterParams = clone(subTooltipModel.get('formatterParams') || {}); - this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator); + } else { + new DataDiffer_default(oldViewChildren, thisViewChildren, getKey2, getKey2).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); + } + function getKey2(node) { + return node.getId(); + } + function processNode(newIndex, oldIndex) { + const thisNode = newIndex != null ? thisViewChildren[newIndex] : null; + const oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null; + const group = doRenderNode(thisNode, oldNode, parentGroup, depth); + group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1); + } + } + function clearStorage(storage2) { + const willDeleteEls2 = createStorage(); + storage2 && each(storage2, function(store, storageName) { + const delEls = willDeleteEls2[storageName]; + each(store, function(el) { + el && (delEls.push(el), inner9(el).willDelete = true); }); - // If not dispatch showTip, tip may be hide triggered by axis. - dispatchAction({ - type: 'showTip', - from: this.uid + }); + return willDeleteEls2; + } + function renderFinally() { + each(willDeleteEls, function(els) { + each(els, function(el) { + el.parent && el.parent.remove(el); }); - }; - TooltipView.prototype._showTooltipContent = function ( - // Use Model insteadof TooltipModel because this model may be from series or other options. - // Instead of top level tooltip. - tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) { - // Reset ticket - this._ticket = ''; - if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) { + }); + each(willInvisibleEls, function(el) { + el.invisible = true; + el.dirty(); + }); + } + } + _doAnimation(containerGroup, renderResult, seriesModel, reRoot) { + const durationOption = seriesModel.get("animationDurationUpdate"); + const easingOption = seriesModel.get("animationEasing"); + const duration = (isFunction(durationOption) ? 0 : durationOption) || 0; + const easing = (isFunction(easingOption) ? null : easingOption) || "cubicOut"; + const animationWrap = createWrap(); + each(renderResult.willDeleteEls, function(store, storageName) { + each(store, function(el, rawIndex) { + if (el.invisible) { return; } - var tooltipContent = this._tooltipContent; - tooltipContent.setEnterable(tooltipModel.get('enterable')); - var formatter = tooltipModel.get('formatter'); - positionExpr = positionExpr || tooltipModel.get('position'); - var html = defaultHtml; - var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor')); - var nearPointColor = nearPoint.color; - if (formatter) { - if (isString(formatter)) { - var useUTC = tooltipModel.ecModel.get('useUTC'); - var params0 = isArray(params) ? params[0] : params; - var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0; - html = formatter; - if (isTimeAxis) { - html = format(params0.axisValue, html, useUTC); + const parent = el.parent; + let target; + const innerStore = inner9(parent); + if (reRoot && reRoot.direction === "drillDown") { + target = parent === reRoot.rootNodeGroup ? { + shape: { + x: 0, + y: 0, + width: innerStore.nodeWidth, + height: innerStore.nodeHeight + }, + style: { + opacity: 0 } - html = formatTpl(html, params, true); - } else if (isFunction(formatter)) { - var callback = bind(function (cbTicket, html) { - if (cbTicket === this._ticket) { - tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr); - this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el); - } - }, this); - this._ticket = asyncTicket; - html = formatter(params, asyncTicket, callback); - } else { - html = formatter; - } - } - tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr); - tooltipContent.show(tooltipModel, nearPointColor); - this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el); - }; - TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor) { - if (trigger === 'axis' || isArray(tooltipDataParams)) { - return { - color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none') - }; - } - if (!isArray(tooltipDataParams)) { - return { - color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor + } : {style: {opacity: 0}}; + } else { + let targetX = 0; + let targetY = 0; + if (!innerStore.willDelete) { + targetX = innerStore.nodeWidth / 2; + targetY = innerStore.nodeHeight / 2; + } + target = storageName === "nodeGroup" ? {x: targetX, y: targetY, style: {opacity: 0}} : { + shape: {x: targetX, y: targetY, width: 0, height: 0}, + style: {opacity: 0} }; } - }; - TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, - // Mouse x - y, - // Mouse y - content, params, el) { - var viewWidth = this._api.getWidth(); - var viewHeight = this._api.getHeight(); - positionExpr = positionExpr || tooltipModel.get('position'); - var contentSize = content.getSize(); - var align = tooltipModel.get('align'); - var vAlign = tooltipModel.get('verticalAlign'); - var rect = el && el.getBoundingRect().clone(); - el && rect.applyTransform(el.transform); - if (isFunction(positionExpr)) { - // Callback of position can be an array or a string specify the position - positionExpr = positionExpr([x, y], params, content.el, rect, { - viewSize: [viewWidth, viewHeight], - contentSize: contentSize.slice() - }); - } - if (isArray(positionExpr)) { - x = parsePercent$1(positionExpr[0], viewWidth); - y = parsePercent$1(positionExpr[1], viewHeight); - } else if (isObject(positionExpr)) { - var boxLayoutPosition = positionExpr; - boxLayoutPosition.width = contentSize[0]; - boxLayoutPosition.height = contentSize[1]; - var layoutRect = getLayoutRect(boxLayoutPosition, { - width: viewWidth, - height: viewHeight - }); - x = layoutRect.x; - y = layoutRect.y; - align = null; - // When positionExpr is left/top/right/bottom, - // align and verticalAlign will not work. - vAlign = null; - } - // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element - else if (isString(positionExpr) && el) { - var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get('borderWidth')); - x = pos[0]; - y = pos[1]; - } else { - var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20); - x = pos[0]; - y = pos[1]; - } - align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0); - vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0); - if (shouldTooltipConfine(tooltipModel)) { - var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight); - x = pos[0]; - y = pos[1]; - } - content.moveTo(x, y); - }; - // FIXME - // Should we remove this but leave this to user? - TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys, cbParamsList) { - var lastCoordSys = this._lastDataByCoordSys; - var lastCbParamsList = this._cbParamsList; - var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length; - contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) { - var lastDataByAxis = lastItemCoordSys.dataByAxis || []; - var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; - var thisDataByAxis = thisItemCoordSys.dataByAxis || []; - contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length; - contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) { - var thisItem = thisDataByAxis[indexAxis] || {}; - var lastIndices = lastItem.seriesDataIndices || []; - var newIndices = thisItem.seriesDataIndices || []; - contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length; - contentNotChanged && each(lastIndices, function (lastIdxItem, j) { - var newIdxItem = newIndices[j]; - contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex; - }); - // check is cbParams data value changed - lastCbParamsList && each(lastItem.seriesDataIndices, function (idxItem) { - var seriesIdx = idxItem.seriesIndex; - var cbParams = cbParamsList[seriesIdx]; - var lastCbParams = lastCbParamsList[seriesIdx]; - if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) { - contentNotChanged = false; - } - }); - }); - }); - this._lastDataByCoordSys = dataByCoordSys; - this._cbParamsList = cbParamsList; - return !!contentNotChanged; - }; - TooltipView.prototype._hide = function (dispatchAction) { - // Do not directly hideLater here, because this behavior may be prevented - // in dispatchAction when showTip is dispatched. - // FIXME - // duplicated hideTip if manuallyHideTip is called from dispatchAction. - this._lastDataByCoordSys = null; - dispatchAction({ - type: 'hideTip', - from: this.uid - }); - }; - TooltipView.prototype.dispose = function (ecModel, api) { - if (env.node || !api.getDom()) { + target && animationWrap.add(el, target, duration, 0, easing); + }); + }); + each(this._storage, function(store, storageName) { + each(store, function(el, rawIndex) { + const last = renderResult.lastsForAnimation[storageName][rawIndex]; + const target = {}; + if (!last) { return; } - clear(this, '_updatePosition'); - this._tooltipContent.dispose(); - unregister('itemTooltip', api); - }; - TooltipView.type = 'tooltip'; - return TooltipView; - }(ComponentView); - /** - * From top to bottom. (the last one should be globalTooltipModel); - */ - function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) { - // Last is always tooltip model. - var ecModel = globalTooltipModel.ecModel; - var resultModel; - if (defaultTooltipOption) { - resultModel = new Model(defaultTooltipOption, ecModel, ecModel); - resultModel = new Model(globalTooltipModel.option, resultModel, ecModel); - } else { - resultModel = globalTooltipModel; - } - for (var i = modelCascade.length - 1; i >= 0; i--) { - var tooltipOpt = modelCascade[i]; - if (tooltipOpt) { - if (tooltipOpt instanceof Model) { - tooltipOpt = tooltipOpt.get('tooltip', true); + if (el instanceof Group_default) { + if (last.oldX != null) { + target.x = el.x; + target.y = el.y; + el.x = last.oldX; + el.y = last.oldY; } - // In each data item tooltip can be simply write: - // { - // value: 10, - // tooltip: 'Something you need to know' - // } - if (isString(tooltipOpt)) { - tooltipOpt = { - formatter: tooltipOpt - }; + } else { + if (last.oldShape) { + target.shape = extend({}, el.shape); + el.setShape(last.oldShape); } - if (tooltipOpt) { - resultModel = new Model(tooltipOpt, resultModel, ecModel); + if (last.fadein) { + el.setStyle("opacity", 0); + target.style = {opacity: 1}; + } else if (el.style.opacity !== 1) { + target.style = {opacity: 1}; } } + animationWrap.add(el, target, duration, 0, easing); + }); + }, this); + this._state = "animating"; + animationWrap.finished(bind(function() { + this._state = "ready"; + renderResult.renderFinally(); + }, this)).start(); + } + _resetController(api2) { + let controller = this._controller; + let controllerHost = this._controllerHost; + if (!controllerHost) { + this._controllerHost = { + target: this.group + }; + controllerHost = this._controllerHost; + } + if (!controller) { + controller = this._controller = new RoamController_default(api2.getZr()); + controller.enable(this.seriesModel.get("roam")); + controllerHost.zoomLimit = this.seriesModel.get("scaleLimit"); + controllerHost.zoom = this.seriesModel.get("zoom"); + controller.on("pan", bind(this._onPan, this)); + controller.on("zoom", bind(this._onZoom, this)); + } + const rect = new BoundingRect_default(0, 0, api2.getWidth(), api2.getHeight()); + controller.setPointerChecker(function(e2, x, y) { + return rect.contain(x, y); + }); + } + _clearController() { + let controller = this._controller; + this._controllerHost = null; + if (controller) { + controller.dispose(); + controller = null; + } + } + _onPan(e2) { + if (this._state !== "animating" && (Math.abs(e2.dx) > DRAG_THRESHOLD || Math.abs(e2.dy) > DRAG_THRESHOLD)) { + const root = this.seriesModel.getData().tree.root; + if (!root) { + return; } - return resultModel; - } - function makeDispatchAction$1(payload, api) { - return payload.dispatchAction || bind(api.dispatchAction, api); - } - function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) { - var size = content.getSize(); - var width = size[0]; - var height = size[1]; - if (gapH != null) { - // Add extra 2 pixels for this case: - // At present the "values" in default tooltip are using CSS `float: right`. - // When the right edge of the tooltip box is on the right side of the - // viewport, the `float` layout might push the "values" to the second line. - if (x + width + gapH + 2 > viewWidth) { - x -= width + gapH; - } else { - x += gapH; + const rootLayout = root.getLayout(); + if (!rootLayout) { + return; + } + this.api.dispatchAction({ + type: "treemapMove", + from: this.uid, + seriesId: this.seriesModel.id, + rootRect: { + x: rootLayout.x + e2.dx, + y: rootLayout.y + e2.dy, + width: rootLayout.width, + height: rootLayout.height } + }); + } + } + _onZoom(e2) { + let mouseX = e2.originX; + let mouseY = e2.originY; + const zoomDelta = e2.scale; + if (this._state !== "animating") { + const root = this.seriesModel.getData().tree.root; + if (!root) { + return; } - if (gapV != null) { - if (y + height + gapV > viewHeight) { - y -= height + gapV; - } else { - y += gapV; - } - } - return [x, y]; - } - function confineTooltipPosition(x, y, content, viewWidth, viewHeight) { - var size = content.getSize(); - var width = size[0]; - var height = size[1]; - x = Math.min(x + width, viewWidth) - width; - y = Math.min(y + height, viewHeight) - height; - x = Math.max(x, 0); - y = Math.max(y, 0); - return [x, y]; - } - function calcTooltipPosition(position, rect, contentSize, borderWidth) { - var domWidth = contentSize[0]; - var domHeight = contentSize[1]; - var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8; - var x = 0; - var y = 0; - var rectWidth = rect.width; - var rectHeight = rect.height; - switch (position) { - case 'inside': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y + rectHeight / 2 - domHeight / 2; - break; - case 'top': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y - domHeight - offset; - break; - case 'bottom': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y + rectHeight + offset; - break; - case 'left': - x = rect.x - domWidth - offset; - y = rect.y + rectHeight / 2 - domHeight / 2; - break; - case 'right': - x = rect.x + rectWidth + offset; - y = rect.y + rectHeight / 2 - domHeight / 2; - } - return [x, y]; - } - function isCenterAlign(align) { - return align === 'center' || align === 'middle'; - } - /** - * Find target component by payload like: - * ```js - * { legendId: 'some_id', name: 'xxx' } - * { toolboxIndex: 1, name: 'xxx' } - * { geoName: 'some_name', name: 'xxx' } - * ``` - * PENDING: at present only - * - * If not found, return null/undefined. - */ - function findComponentReference(payload, ecModel, api) { - var queryOptionMap = preParseFinder(payload).queryOptionMap; - var componentMainType = queryOptionMap.keys()[0]; - if (!componentMainType || componentMainType === 'series') { + const rootLayout = root.getLayout(); + if (!rootLayout) { return; } - var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), { - useDefault: false, - enableAll: false, - enableNone: false + const rect = new BoundingRect_default(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height); + let zoomLimit = null; + const _controllerHost = this._controllerHost; + zoomLimit = _controllerHost.zoomLimit; + let newZoom = _controllerHost.zoom = _controllerHost.zoom || 1; + newZoom *= zoomDelta; + if (zoomLimit) { + const zoomMin = zoomLimit.min || 0; + const zoomMax = zoomLimit.max || Infinity; + newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin); + } + const zoomScale = newZoom / _controllerHost.zoom; + _controllerHost.zoom = newZoom; + const layoutInfo = this.seriesModel.layoutInfo; + mouseX -= layoutInfo.x; + mouseY -= layoutInfo.y; + const m2 = create2(); + translate(m2, m2, [-mouseX, -mouseY]); + scale2(m2, m2, [zoomScale, zoomScale]); + translate(m2, m2, [mouseX, mouseY]); + rect.applyTransform(m2); + this.api.dispatchAction({ + type: "treemapRender", + from: this.uid, + seriesId: this.seriesModel.id, + rootRect: { + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + } }); - var model = queryResult.models[0]; - if (!model) { + } + } + _initEvents(containerGroup) { + containerGroup.on("click", (e2) => { + if (this._state !== "ready") { + return; + } + const nodeClick = this.seriesModel.get("nodeClick", true); + if (!nodeClick) { + return; + } + const targetInfo = this.findTarget(e2.offsetX, e2.offsetY); + if (!targetInfo) { return; } - var view = api.getViewOfComponentModel(model); - var el; - view.group.traverse(function (subEl) { - var tooltipConfig = getECData(subEl).tooltipConfig; - if (tooltipConfig && tooltipConfig.name === payload.name) { - el = subEl; - return true; // stop + const node = targetInfo.node; + if (node.getLayout().isLeafRoot) { + this._rootToNode(targetInfo); + } else { + if (nodeClick === "zoomToNode") { + this._zoomToNode(targetInfo); + } else if (nodeClick === "link") { + const itemModel = node.hostTree.data.getItemModel(node.dataIndex); + const link = itemModel.get("link", true); + const linkTarget = itemModel.get("target", true) || "blank"; + link && windowOpen(link, linkTarget); + } + } + }, this); + } + _renderBreadcrumb(seriesModel, api2, targetInfo) { + if (!targetInfo) { + targetInfo = seriesModel.get("leafDepth", true) != null ? {node: seriesModel.getViewRoot()} : this.findTarget(api2.getWidth() / 2, api2.getHeight() / 2); + if (!targetInfo) { + targetInfo = {node: seriesModel.getData().tree.root}; + } + } + (this._breadcrumb || (this._breadcrumb = new Breadcrumb_default(this.group))).render(seriesModel, api2, targetInfo.node, (node) => { + if (this._state !== "animating") { + aboveViewRoot(seriesModel.getViewRoot(), node) ? this._rootToNode({node}) : this._zoomToNode({node}); + } + }); + } + remove() { + this._clearController(); + this._containerGroup && this._containerGroup.removeAll(); + this._storage = createStorage(); + this._state = "ready"; + this._breadcrumb && this._breadcrumb.remove(); + } + dispose() { + this._clearController(); + } + _zoomToNode(targetInfo) { + this.api.dispatchAction({ + type: "treemapZoomToNode", + from: this.uid, + seriesId: this.seriesModel.id, + targetNode: targetInfo.node + }); + } + _rootToNode(targetInfo) { + this.api.dispatchAction({ + type: "treemapRootToNode", + from: this.uid, + seriesId: this.seriesModel.id, + targetNode: targetInfo.node + }); + } + findTarget(x, y) { + let targetInfo; + const viewRoot = this.seriesModel.getViewRoot(); + viewRoot.eachNode({attr: "viewChildren", order: "preorder"}, function(node) { + const bgEl = this._storage.background[node.getRawIndex()]; + if (bgEl) { + const point = bgEl.transformCoordToLocal(x, y); + const shape = bgEl.shape; + if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) { + targetInfo = { + node, + offsetX: point[0], + offsetY: point[1] + }; + } else { + return false; } + } + }, this); + return targetInfo; + } +}; +var TreemapView = TreemapView2; +TreemapView.type = "treemap"; +function createStorage() { + return { + nodeGroup: [], + background: [], + content: [] + }; +} +function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) { + if (!thisNode) { + return; + } + const thisLayout = thisNode.getLayout(); + const data = seriesModel.getData(); + const nodeModel = thisNode.getModel(); + data.setItemGraphicEl(thisNode.dataIndex, null); + if (!thisLayout || !thisLayout.isInView) { + return; + } + const thisWidth = thisLayout.width; + const thisHeight = thisLayout.height; + const borderWidth = thisLayout.borderWidth; + const thisInvisible = thisLayout.invisible; + const thisRawIndex = thisNode.getRawIndex(); + const oldRawIndex = oldNode && oldNode.getRawIndex(); + const thisViewChildren = thisNode.viewChildren; + const upperHeight = thisLayout.upperHeight; + const isParent = thisViewChildren && thisViewChildren.length; + const itemStyleNormalModel = nodeModel.getModel("itemStyle"); + const itemStyleEmphasisModel = nodeModel.getModel(["emphasis", "itemStyle"]); + const itemStyleBlurModel = nodeModel.getModel(["blur", "itemStyle"]); + const itemStyleSelectModel = nodeModel.getModel(["select", "itemStyle"]); + const borderRadius = itemStyleNormalModel.get("borderRadius") || 0; + const group = giveGraphic("nodeGroup", Group2); + if (!group) { + return; + } + parentGroup.add(group); + group.x = thisLayout.x || 0; + group.y = thisLayout.y || 0; + group.markRedraw(); + inner9(group).nodeWidth = thisWidth; + inner9(group).nodeHeight = thisHeight; + if (thisLayout.isAboveViewRoot) { + return group; + } + const bg = giveGraphic("background", Rect2, depth, Z2_BG); + bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight); + const emphasisModel = nodeModel.getModel("emphasis"); + const focus = emphasisModel.get("focus"); + const blurScope = emphasisModel.get("blurScope"); + const isDisabled = emphasisModel.get("disabled"); + const focusOrIndices = focus === "ancestor" ? thisNode.getAncestorsIndices() : focus === "descendant" ? thisNode.getDescendantIndices() : focus; + if (isParent) { + if (isHighDownDispatcher(group)) { + setAsHighDownDispatcher(group, false); + } + if (bg) { + setAsHighDownDispatcher(bg, !isDisabled); + data.setItemGraphicEl(thisNode.dataIndex, bg); + enableHoverFocus(bg, focusOrIndices, blurScope); + } + } else { + const content = giveGraphic("content", Rect2, depth, Z2_CONTENT); + content && renderContent(group, content); + bg.disableMorphing = true; + if (bg && isHighDownDispatcher(bg)) { + setAsHighDownDispatcher(bg, false); + } + setAsHighDownDispatcher(group, !isDisabled); + data.setItemGraphicEl(thisNode.dataIndex, group); + const cursorStyle = nodeModel.getShallow("cursor"); + cursorStyle && content.attr("cursor", cursorStyle); + enableHoverFocus(group, focusOrIndices, blurScope); + } + return group; + function renderBackground(group2, bg2, useUpperLabel) { + const ecData = getECData(bg2); + ecData.dataIndex = thisNode.dataIndex; + ecData.seriesIndex = seriesModel.seriesIndex; + bg2.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight, r: borderRadius}); + if (thisInvisible) { + processInvisible(bg2); + } else { + bg2.invisible = false; + const style = thisNode.getVisual("style"); + const visualBorderColor = style.stroke; + const normalStyle = getItemStyleNormal(itemStyleNormalModel); + normalStyle.fill = visualBorderColor; + const emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); + emphasisStyle.fill = itemStyleEmphasisModel.get("borderColor"); + const blurStyle = getStateItemStyle(itemStyleBlurModel); + blurStyle.fill = itemStyleBlurModel.get("borderColor"); + const selectStyle = getStateItemStyle(itemStyleSelectModel); + selectStyle.fill = itemStyleSelectModel.get("borderColor"); + if (useUpperLabel) { + const upperLabelWidth = thisWidth - 2 * borderWidth; + prepareText(bg2, visualBorderColor, style.opacity, {x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight}); + } else { + bg2.removeTextContent(); + } + bg2.setStyle(normalStyle); + bg2.ensureState("emphasis").style = emphasisStyle; + bg2.ensureState("blur").style = blurStyle; + bg2.ensureState("select").style = selectStyle; + setDefaultStateProxy(bg2); + } + group2.add(bg2); + } + function renderContent(group2, content) { + const ecData = getECData(content); + ecData.dataIndex = thisNode.dataIndex; + ecData.seriesIndex = seriesModel.seriesIndex; + const contentWidth = Math.max(thisWidth - 2 * borderWidth, 0); + const contentHeight = Math.max(thisHeight - 2 * borderWidth, 0); + content.culling = true; + content.setShape({ + x: borderWidth, + y: borderWidth, + width: contentWidth, + height: contentHeight, + r: borderRadius + }); + if (thisInvisible) { + processInvisible(content); + } else { + content.invisible = false; + const nodeStyle = thisNode.getVisual("style"); + const visualColor = nodeStyle.fill; + const normalStyle = getItemStyleNormal(itemStyleNormalModel); + normalStyle.fill = visualColor; + normalStyle.decal = nodeStyle.decal; + const emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); + const blurStyle = getStateItemStyle(itemStyleBlurModel); + const selectStyle = getStateItemStyle(itemStyleSelectModel); + prepareText(content, visualColor, nodeStyle.opacity, null); + content.setStyle(normalStyle); + content.ensureState("emphasis").style = emphasisStyle; + content.ensureState("blur").style = blurStyle; + content.ensureState("select").style = selectStyle; + setDefaultStateProxy(content); + } + group2.add(content); + } + function processInvisible(element) { + !element.invisible && willInvisibleEls.push(element); + } + function prepareText(rectEl, visualColor, visualOpacity, upperLabelRect) { + const normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL); + const defaultText = convertOptionIdName(nodeModel.get("name"), null); + const isShow = normalLabelModel.getShallow("show"); + setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), { + defaultText: isShow ? defaultText : null, + inheritColor: visualColor, + defaultOpacity: visualOpacity, + labelFetcher: seriesModel, + labelDataIndex: thisNode.dataIndex + }); + const textEl = rectEl.getTextContent(); + if (!textEl) { + return; + } + const textStyle = textEl.style; + const textPadding = normalizeCssArray(textStyle.padding || 0); + if (upperLabelRect) { + rectEl.setTextConfig({ + layoutRect: upperLabelRect }); - - if (el) { - return { - componentMainType: componentMainType, - componentIndex: model.componentIndex, - el: el - }; + textEl.disableLabelLayout = true; + } + textEl.beforeUpdate = function() { + const width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0); + const height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0); + if (textStyle.width !== width || textStyle.height !== height) { + textEl.setStyle({ + width, + height + }); + } + }; + textStyle.truncateMinChar = 2; + textStyle.lineOverflow = "truncate"; + addDrillDownIcon(textStyle, upperLabelRect, thisLayout); + const textEmphasisState = textEl.getState("emphasis"); + addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout); + } + function addDrillDownIcon(style, upperLabelRect, thisLayout2) { + const text = style ? style.text : null; + if (!upperLabelRect && thisLayout2.isLeafRoot && text != null) { + const iconChar = seriesModel.get("drillDownIcon", true); + style.text = iconChar ? iconChar + " " + text : text; + } + } + function giveGraphic(storageName, Ctor, depth2, z) { + let element = oldRawIndex != null && oldStorage[storageName][oldRawIndex]; + const lasts = lastsForAnimation[storageName]; + if (element) { + oldStorage[storageName][oldRawIndex] = null; + prepareAnimationWhenHasOld(lasts, element); + } else if (!thisInvisible) { + element = new Ctor(); + if (element instanceof Displayable_default) { + element.z2 = calculateZ2(depth2, z); + } + prepareAnimationWhenNoOld(lasts, element); + } + return thisStorage[storageName][thisRawIndex] = element; + } + function prepareAnimationWhenHasOld(lasts, element) { + const lastCfg = lasts[thisRawIndex] = {}; + if (element instanceof Group2) { + lastCfg.oldX = element.x; + lastCfg.oldY = element.y; + } else { + lastCfg.oldShape = extend({}, element.shape); + } + } + function prepareAnimationWhenNoOld(lasts, element) { + const lastCfg = lasts[thisRawIndex] = {}; + const parentNode2 = thisNode.parentNode; + const isGroup = element instanceof Group_default; + if (parentNode2 && (!reRoot || reRoot.direction === "drillDown")) { + let parentOldX = 0; + let parentOldY = 0; + const parentOldBg = lastsForAnimation.background[parentNode2.getRawIndex()]; + if (!reRoot && parentOldBg && parentOldBg.oldShape) { + parentOldX = parentOldBg.oldShape.width; + parentOldY = parentOldBg.oldShape.height; + } + if (isGroup) { + lastCfg.oldX = 0; + lastCfg.oldY = parentOldY; + } else { + lastCfg.oldShape = {x: parentOldX, y: parentOldY, width: 0, height: 0}; + } + } + lastCfg.fadein = !isGroup; + } +} +function calculateZ2(depth, z2InLevel) { + return depth * Z2_BASE + z2InLevel; +} +var TreemapView_default = TreemapView; + +// src/visual/VisualMapping.ts +var each4 = each; +var isObject4 = isObject; +var CATEGORY_DEFAULT_VISUAL_INDEX = -1; +var VisualMapping2 = class { + constructor(option) { + const mappingMethod = option.mappingMethod; + const visualType = option.type; + const thisOption = this.option = clone(option); + this.type = visualType; + this.mappingMethod = mappingMethod; + this._normalizeData = normalizers[mappingMethod]; + const visualHandler = VisualMapping2.visualHandlers[visualType]; + this.applyVisual = visualHandler.applyVisual; + this.getColorMapper = visualHandler.getColorMapper; + this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod]; + if (mappingMethod === "piecewise") { + normalizeVisualRange(thisOption); + preprocessForPiecewise(thisOption); + } else if (mappingMethod === "category") { + thisOption.categories ? preprocessForSpecifiedCategory(thisOption) : normalizeVisualRange(thisOption, true); + } else { + assert(mappingMethod !== "linear" || thisOption.dataExtent); + normalizeVisualRange(thisOption); + } + } + mapValueToVisual(value) { + const normalized = this._normalizeData(value); + return this._normalizedToVisual(normalized, value); + } + getNormalizer() { + return bind(this._normalizeData, this); + } + static listVisualTypes() { + return keys(VisualMapping2.visualHandlers); + } + static isValidType(visualType) { + return VisualMapping2.visualHandlers.hasOwnProperty(visualType); + } + static eachVisual(visual, callback, context) { + if (isObject(visual)) { + each(visual, callback, context); + } else { + callback.call(context, visual); + } + } + static mapVisual(visual, callback, context) { + let isPrimary; + let newVisual = isArray(visual) ? [] : isObject(visual) ? {} : (isPrimary = true, null); + VisualMapping2.eachVisual(visual, function(v, key) { + const newVal = callback.call(context, v, key); + isPrimary ? newVisual = newVal : newVisual[key] = newVal; + }); + return newVisual; + } + static retrieveVisuals(obj) { + const ret = {}; + let hasVisual; + obj && each4(VisualMapping2.visualHandlers, function(h, visualType) { + if (obj.hasOwnProperty(visualType)) { + ret[visualType] = obj[visualType]; + hasVisual = true; + } + }); + return hasVisual ? ret : null; + } + static prepareVisualTypes(visualTypes) { + if (isArray(visualTypes)) { + visualTypes = visualTypes.slice(); + } else if (isObject4(visualTypes)) { + const types = []; + each4(visualTypes, function(item, type) { + types.push(type); + }); + visualTypes = types; + } else { + return []; + } + visualTypes.sort(function(type1, type2) { + return type2 === "color" && type1 !== "color" && type1.indexOf("color") === 0 ? 1 : -1; + }); + return visualTypes; + } + static dependsOn(visualType1, visualType2) { + return visualType2 === "color" ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2; + } + static findPieceIndex(value, pieceList, findClosestWhenOutside) { + let possibleI; + let abs2 = Infinity; + for (let i = 0, len2 = pieceList.length; i < len2; i++) { + const pieceValue = pieceList[i].value; + if (pieceValue != null) { + if (pieceValue === value || isString(pieceValue) && pieceValue === value + "") { + return i; + } + findClosestWhenOutside && updatePossible(pieceValue, i); } } - - function install$A(registers) { - use(install$s); - registers.registerComponentModel(TooltipModel); - registers.registerComponentView(TooltipView); - /** - * @action - * @property {string} type - * @property {number} seriesIndex - * @property {number} dataIndex - * @property {number} [x] - * @property {number} [y] - */ - registers.registerAction({ - type: 'showTip', - event: 'showTip', - update: 'tooltip:manuallyShowTip' - }, noop); - registers.registerAction({ - type: 'hideTip', - event: 'hideTip', - update: 'tooltip:manuallyHideTip' - }, noop); - } - - var DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear']; - function brushPreprocessor(option, isNew) { - var brushComponents = normalizeToArray(option ? option.brush : []); - if (!brushComponents.length) { - return; - } - var brushComponentSpecifiedBtns = []; - each(brushComponents, function (brushOpt) { - var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : []; - if (tbs instanceof Array) { - brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); + for (let i = 0, len2 = pieceList.length; i < len2; i++) { + const piece = pieceList[i]; + const interval = piece.interval; + const close = piece.close; + if (interval) { + if (interval[0] === -Infinity) { + if (littleThan(close[1], value, interval[1])) { + return i; + } + } else if (interval[1] === Infinity) { + if (littleThan(close[0], interval[0], value)) { + return i; + } + } else if (littleThan(close[0], interval[0], value) && littleThan(close[1], value, interval[1])) { + return i; + } + findClosestWhenOutside && updatePossible(interval[0], i); + findClosestWhenOutside && updatePossible(interval[1], i); + } + } + if (findClosestWhenOutside) { + return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI; + } + function updatePossible(val, index) { + const newAbs = Math.abs(val - value); + if (newAbs < abs2) { + abs2 = newAbs; + possibleI = index; + } + } + } +}; +var VisualMapping = VisualMapping2; +VisualMapping.visualHandlers = { + color: { + applyVisual: makeApplyVisual("color"), + getColorMapper: function() { + const thisOption = this.option; + return bind(thisOption.mappingMethod === "category" ? function(value, isNormalized) { + !isNormalized && (value = this._normalizeData(value)); + return doMapCategory.call(this, value); + } : function(value, isNormalized, out2) { + const returnRGBArray = !!out2; + !isNormalized && (value = this._normalizeData(value)); + out2 = fastLerp(value, thisOption.parsedVisual, out2); + return returnRGBArray ? out2 : stringify(out2, "rgba"); + }, this); + }, + _normalizedToVisual: { + linear: function(normalized) { + return stringify(fastLerp(normalized, this.option.parsedVisual), "rgba"); + }, + category: doMapCategory, + piecewise: function(normalized, value) { + let result = getSpecifiedVisual.call(this, value); + if (result == null) { + result = stringify(fastLerp(normalized, this.option.parsedVisual), "rgba"); + } + return result; + }, + fixed: doMapFixed + } + }, + colorHue: makePartialColorVisualHandler(function(color2, value) { + return modifyHSL(color2, value); + }), + colorSaturation: makePartialColorVisualHandler(function(color2, value) { + return modifyHSL(color2, null, value); + }), + colorLightness: makePartialColorVisualHandler(function(color2, value) { + return modifyHSL(color2, null, null, value); + }), + colorAlpha: makePartialColorVisualHandler(function(color2, value) { + return modifyAlpha(color2, value); + }), + decal: { + applyVisual: makeApplyVisual("decal"), + _normalizedToVisual: { + linear: null, + category: doMapCategory, + piecewise: null, + fixed: null + } + }, + opacity: { + applyVisual: makeApplyVisual("opacity"), + _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) + }, + liftZ: { + applyVisual: makeApplyVisual("liftZ"), + _normalizedToVisual: { + linear: doMapFixed, + category: doMapFixed, + piecewise: doMapFixed, + fixed: doMapFixed + } + }, + symbol: { + applyVisual: function(value, getter, setter) { + const symbolCfg = this.mapValueToVisual(value); + setter("symbol", symbolCfg); + }, + _normalizedToVisual: { + linear: doMapToArray, + category: doMapCategory, + piecewise: function(normalized, value) { + let result = getSpecifiedVisual.call(this, value); + if (result == null) { + result = doMapToArray.call(this, normalized); } + return result; + }, + fixed: doMapFixed + } + }, + symbolSize: { + applyVisual: makeApplyVisual("symbolSize"), + _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) + } +}; +function preprocessForPiecewise(thisOption) { + const pieceList = thisOption.pieceList; + thisOption.hasSpecialVisual = false; + each(pieceList, function(piece, index) { + piece.originIndex = index; + if (piece.visual != null) { + thisOption.hasSpecialVisual = true; + } + }); +} +function preprocessForSpecifiedCategory(thisOption) { + const categories = thisOption.categories; + const categoryMap = thisOption.categoryMap = {}; + let visual = thisOption.visual; + each4(categories, function(cate, index) { + categoryMap[cate] = index; + }); + if (!isArray(visual)) { + const visualArr = []; + if (isObject(visual)) { + each4(visual, function(v, cate) { + const index = categoryMap[cate]; + visualArr[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v; }); - var toolbox = option && option.toolbox; - if (isArray(toolbox)) { - toolbox = toolbox[0]; - } - if (!toolbox) { - toolbox = { - feature: {} - }; - option.toolbox = [toolbox]; + } else { + visualArr[CATEGORY_DEFAULT_VISUAL_INDEX] = visual; + } + visual = setVisualToOption(thisOption, visualArr); + } + for (let i = categories.length - 1; i >= 0; i--) { + if (visual[i] == null) { + delete categoryMap[categories[i]]; + categories.pop(); + } + } +} +function normalizeVisualRange(thisOption, isCategory2) { + const visual = thisOption.visual; + const visualArr = []; + if (isObject(visual)) { + each4(visual, function(v) { + visualArr.push(v); + }); + } else if (visual != null) { + visualArr.push(visual); + } + const doNotNeedPair = {color: 1, symbol: 1}; + if (!isCategory2 && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) { + visualArr[1] = visualArr[0]; + } + setVisualToOption(thisOption, visualArr); +} +function makePartialColorVisualHandler(applyValue) { + return { + applyVisual: function(value, getter, setter) { + const colorChannel = this.mapValueToVisual(value); + setter("color", applyValue(getter("color"), colorChannel)); + }, + _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) + }; +} +function doMapToArray(normalized) { + const visual = this.option.visual; + return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; +} +function makeApplyVisual(visualType) { + return function(value, getter, setter) { + setter(visualType, this.mapValueToVisual(value)); + }; +} +function doMapCategory(normalized) { + const visual = this.option.visual; + return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized]; +} +function doMapFixed() { + return this.option.visual[0]; +} +function createNormalizedToNumericVisual(sourceExtent) { + return { + linear: function(normalized) { + return linearMap(normalized, sourceExtent, this.option.visual, true); + }, + category: doMapCategory, + piecewise: function(normalized, value) { + let result = getSpecifiedVisual.call(this, value); + if (result == null) { + result = linearMap(normalized, sourceExtent, this.option.visual, true); } - var toolboxFeature = toolbox.feature || (toolbox.feature = {}); - var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); - var brushTypes = toolboxBrush.type || (toolboxBrush.type = []); - brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); - removeDuplicate(brushTypes); - if (isNew && !brushTypes.length) { - brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); + return result; + }, + fixed: doMapFixed + }; +} +function getSpecifiedVisual(value) { + const thisOption = this.option; + const pieceList = thisOption.pieceList; + if (thisOption.hasSpecialVisual) { + const pieceIndex = VisualMapping.findPieceIndex(value, pieceList); + const piece = pieceList[pieceIndex]; + if (piece && piece.visual) { + return piece.visual[this.type]; + } + } +} +function setVisualToOption(thisOption, visualArr) { + thisOption.visual = visualArr; + if (thisOption.type === "color") { + thisOption.parsedVisual = map(visualArr, function(item) { + const color2 = parse(item); + if (!color2 && true) { + warn(`'${item}' is an illegal color, fallback to '#000000'`, true); + } + return color2 || [0, 0, 0, 1]; + }); + } + return visualArr; +} +var normalizers = { + linear: function(value) { + return linearMap(value, this.option.dataExtent, [0, 1], true); + }, + piecewise: function(value) { + const pieceList = this.option.pieceList; + const pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true); + if (pieceIndex != null) { + return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true); + } + }, + category: function(value) { + const index = this.option.categories ? this.option.categoryMap[value] : value; + return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index; + }, + fixed: noop +}; +function littleThan(close, a, b) { + return close ? a <= b : a < b; +} +var VisualMapping_default = VisualMapping; + +// src/chart/treemap/treemapVisual.ts +var ITEM_STYLE_NORMAL = "itemStyle"; +var inner10 = makeInner(); +var treemapVisual_default = { + seriesType: "treemap", + reset(seriesModel) { + const tree = seriesModel.getData().tree; + const root = tree.root; + if (root.isRemoved()) { + return; + } + travelTree(root, {}, seriesModel.getViewRoot().getAncestors(), seriesModel); + } +}; +function travelTree(node, designatedVisual, viewRootAncestors, seriesModel) { + const nodeModel = node.getModel(); + const nodeLayout = node.getLayout(); + const data = node.hostTree.data; + if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) { + return; + } + const nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL); + const visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel); + const existsStyle = data.ensureUniqueItemVisual(node.dataIndex, "style"); + let borderColor = nodeItemStyleModel.get("borderColor"); + const borderColorSaturation = nodeItemStyleModel.get("borderColorSaturation"); + let thisNodeColor; + if (borderColorSaturation != null) { + thisNodeColor = calculateColor(visuals); + borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor); + } + existsStyle.stroke = borderColor; + const viewChildren = node.viewChildren; + if (!viewChildren || !viewChildren.length) { + thisNodeColor = calculateColor(visuals); + existsStyle.fill = thisNodeColor; + } else { + const mapping = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); + each(viewChildren, function(child, index) { + if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) { + const childVisual = mapVisual(nodeModel, visuals, child, index, mapping, seriesModel); + travelTree(child, childVisual, viewRootAncestors, seriesModel); } - } - function removeDuplicate(arr) { - var map = {}; - each(arr, function (val) { - map[val] = 1; - }); - arr.length = 0; - each(map, function (flag, val) { - arr.push(val); + }); + } +} +function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) { + const visuals = extend({}, designatedVisual); + const designatedVisualItemStyle = seriesModel.designatedVisualItemStyle; + each(["color", "colorAlpha", "colorSaturation"], function(visualName) { + designatedVisualItemStyle[visualName] = designatedVisual[visualName]; + const val = nodeItemStyleModel.get(visualName); + designatedVisualItemStyle[visualName] = null; + val != null && (visuals[visualName] = val); + }); + return visuals; +} +function calculateColor(visuals) { + let color2 = getValueVisualDefine(visuals, "color"); + if (color2) { + const colorAlpha = getValueVisualDefine(visuals, "colorAlpha"); + const colorSaturation = getValueVisualDefine(visuals, "colorSaturation"); + if (colorSaturation) { + color2 = modifyHSL(color2, null, null, colorSaturation); + } + if (colorAlpha) { + color2 = modifyAlpha(color2, colorAlpha); + } + return color2; + } +} +function calculateBorderColor(borderColorSaturation, thisNodeColor) { + return thisNodeColor != null ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null; +} +function getValueVisualDefine(visuals, name) { + const value = visuals[name]; + if (value != null && value !== "none") { + return value; + } +} +function buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) { + if (!viewChildren || !viewChildren.length) { + return; + } + const rangeVisual = getRangeVisual(nodeModel, "color") || visuals.color != null && visuals.color !== "none" && (getRangeVisual(nodeModel, "colorAlpha") || getRangeVisual(nodeModel, "colorSaturation")); + if (!rangeVisual) { + return; + } + const visualMin = nodeModel.get("visualMin"); + const visualMax = nodeModel.get("visualMax"); + const dataExtent = nodeLayout.dataExtent.slice(); + visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin); + visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax); + const colorMappingBy = nodeModel.get("colorMappingBy"); + const opt = { + type: rangeVisual.name, + dataExtent, + visual: rangeVisual.range + }; + if (opt.type === "color" && (colorMappingBy === "index" || colorMappingBy === "id")) { + opt.mappingMethod = "category"; + opt.loop = true; + } else { + opt.mappingMethod = "linear"; + } + const mapping = new VisualMapping_default(opt); + inner10(mapping).drColorMappingBy = colorMappingBy; + return mapping; +} +function getRangeVisual(nodeModel, name) { + const range = nodeModel.get(name); + return isArray(range) && range.length ? { + name, + range + } : null; +} +function mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) { + const childVisuals = extend({}, visuals); + if (mapping) { + const mappingType = mapping.type; + const colorMappingBy = mappingType === "color" && inner10(mapping).drColorMappingBy; + const value = colorMappingBy === "index" ? index : colorMappingBy === "id" ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get("visualDimension")); + childVisuals[mappingType] = mapping.mapValueToVisual(value); + } + return childVisuals; +} + +// src/chart/treemap/treemapLayout.ts +var mathMax8 = Math.max; +var mathMin8 = Math.min; +var retrieveValue = retrieve; +var each5 = each; +var PATH_BORDER_WIDTH = ["itemStyle", "borderWidth"]; +var PATH_GAP_WIDTH = ["itemStyle", "gapWidth"]; +var PATH_UPPER_LABEL_SHOW = ["upperLabel", "show"]; +var PATH_UPPER_LABEL_HEIGHT = ["upperLabel", "height"]; +var treemapLayout_default = { + seriesType: "treemap", + reset: function(seriesModel, ecModel, api2, payload) { + const ecWidth = api2.getWidth(); + const ecHeight = api2.getHeight(); + const seriesOption = seriesModel.option; + const layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api2.getWidth(), + height: api2.getHeight() + }); + const size = seriesOption.size || []; + const containerWidth = parsePercent2(retrieveValue(layoutInfo.width, size[0]), ecWidth); + const containerHeight = parsePercent2(retrieveValue(layoutInfo.height, size[1]), ecHeight); + const payloadType = payload && payload.type; + const types = ["treemapZoomToNode", "treemapRootToNode"]; + const targetInfo = retrieveTargetInfo(payload, types, seriesModel); + const rootRect = payloadType === "treemapRender" || payloadType === "treemapMove" ? payload.rootRect : null; + const viewRoot = seriesModel.getViewRoot(); + const viewAbovePath = getPathToRoot(viewRoot); + if (payloadType !== "treemapMove") { + const rootSize = payloadType === "treemapZoomToNode" ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight]; + let sort4 = seriesOption.sort; + if (sort4 && sort4 !== "asc" && sort4 !== "desc") { + sort4 = "desc"; + } + const options = { + squareRatio: seriesOption.squareRatio, + sort: sort4, + leafDepth: seriesOption.leafDepth + }; + viewRoot.hostTree.clearLayouts(); + let viewRootLayout = { + x: 0, + y: 0, + width: rootSize[0], + height: rootSize[1], + area: rootSize[0] * rootSize[1] + }; + viewRoot.setLayout(viewRootLayout); + squarify(viewRoot, options, false, 0); + viewRootLayout = viewRoot.getLayout(); + each5(viewAbovePath, function(node, index) { + const childValue = (viewAbovePath[index + 1] || viewRoot).getValue(); + node.setLayout(extend({ + dataExtent: [childValue, childValue], + borderWidth: 0, + upperHeight: 0 + }, viewRootLayout)); }); } - - var each$b = each; - function hasKeys(obj) { - if (obj) { - for (var name_1 in obj) { - if (obj.hasOwnProperty(name_1)) { - return true; + const treeRoot = seriesModel.getData().tree.root; + treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true); + seriesModel.setLayoutInfo(layoutInfo); + prunning(treeRoot, new BoundingRect_default(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0); + } +}; +function squarify(node, options, hideChildren, depth) { + let width; + let height; + if (node.isRemoved()) { + return; + } + const thisLayout = node.getLayout(); + width = thisLayout.width; + height = thisLayout.height; + const nodeModel = node.getModel(); + const borderWidth = nodeModel.get(PATH_BORDER_WIDTH); + const halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2; + const upperLabelHeight = getUpperLabelHeight(nodeModel); + const upperHeight = Math.max(borderWidth, upperLabelHeight); + const layoutOffset = borderWidth - halfGapWidth; + const layoutOffsetUpper = upperHeight - halfGapWidth; + node.setLayout({ + borderWidth, + upperHeight, + upperLabelHeight + }, true); + width = mathMax8(width - 2 * layoutOffset, 0); + height = mathMax8(height - layoutOffset - layoutOffsetUpper, 0); + const totalArea = width * height; + const viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth); + if (!viewChildren.length) { + return; + } + const rect = {x: layoutOffset, y: layoutOffsetUpper, width, height}; + let rowFixedLength = mathMin8(width, height); + let best = Infinity; + const row = []; + row.area = 0; + for (let i = 0, len2 = viewChildren.length; i < len2; ) { + const child = viewChildren[i]; + row.push(child); + row.area += child.getLayout().area; + const score = worst(row, rowFixedLength, options.squareRatio); + if (score <= best) { + i++; + best = score; + } else { + row.area -= row.pop().getLayout().area; + position(row, rowFixedLength, rect, halfGapWidth, false); + rowFixedLength = mathMin8(rect.width, rect.height); + row.length = row.area = 0; + best = Infinity; + } + } + if (row.length) { + position(row, rowFixedLength, rect, halfGapWidth, true); + } + if (!hideChildren) { + const childrenVisibleMin = nodeModel.get("childrenVisibleMin"); + if (childrenVisibleMin != null && totalArea < childrenVisibleMin) { + hideChildren = true; + } + } + for (let i = 0, len2 = viewChildren.length; i < len2; i++) { + squarify(viewChildren[i], options, hideChildren, depth + 1); + } +} +function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) { + let viewChildren = node.children || []; + let orderBy = options.sort; + orderBy !== "asc" && orderBy !== "desc" && (orderBy = null); + const overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; + if (hideChildren && !overLeafDepth) { + return node.viewChildren = []; + } + viewChildren = filter(viewChildren, function(child) { + return !child.isRemoved(); + }); + sort2(viewChildren, orderBy); + const info = statistic(nodeModel, viewChildren, orderBy); + if (info.sum === 0) { + return node.viewChildren = []; + } + info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren); + if (info.sum === 0) { + return node.viewChildren = []; + } + for (let i = 0, len2 = viewChildren.length; i < len2; i++) { + const area = viewChildren[i].getValue() / info.sum * totalArea; + viewChildren[i].setLayout({ + area + }); + } + if (overLeafDepth) { + viewChildren.length && node.setLayout({ + isLeafRoot: true + }, true); + viewChildren.length = 0; + } + node.viewChildren = viewChildren; + node.setLayout({ + dataExtent: info.dataExtent + }, true); + return viewChildren; +} +function filterByThreshold(nodeModel, totalArea, sum2, orderBy, orderedChildren) { + if (!orderBy) { + return sum2; + } + const visibleMin = nodeModel.get("visibleMin"); + const len2 = orderedChildren.length; + let deletePoint = len2; + for (let i = len2 - 1; i >= 0; i--) { + const value = orderedChildren[orderBy === "asc" ? len2 - i - 1 : i].getValue(); + if (value / sum2 * totalArea < visibleMin) { + deletePoint = i; + sum2 -= value; + } + } + orderBy === "asc" ? orderedChildren.splice(0, len2 - deletePoint) : orderedChildren.splice(deletePoint, len2 - deletePoint); + return sum2; +} +function sort2(viewChildren, orderBy) { + if (orderBy) { + viewChildren.sort(function(a, b) { + const diff = orderBy === "asc" ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); + return diff === 0 ? orderBy === "asc" ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff; + }); + } + return viewChildren; +} +function statistic(nodeModel, children, orderBy) { + let sum2 = 0; + for (let i = 0, len2 = children.length; i < len2; i++) { + sum2 += children[i].getValue(); + } + const dimension = nodeModel.get("visualDimension"); + let dataExtent; + if (!children || !children.length) { + dataExtent = [NaN, NaN]; + } else if (dimension === "value" && orderBy) { + dataExtent = [ + children[children.length - 1].getValue(), + children[0].getValue() + ]; + orderBy === "asc" && dataExtent.reverse(); + } else { + dataExtent = [Infinity, -Infinity]; + each5(children, function(child) { + const value = child.getValue(dimension); + value < dataExtent[0] && (dataExtent[0] = value); + value > dataExtent[1] && (dataExtent[1] = value); + }); + } + return {sum: sum2, dataExtent}; +} +function worst(row, rowFixedLength, ratio) { + let areaMax = 0; + let areaMin = Infinity; + for (let i = 0, area, len2 = row.length; i < len2; i++) { + area = row[i].getLayout().area; + if (area) { + area < areaMin && (areaMin = area); + area > areaMax && (areaMax = area); + } + } + const squareArea = row.area * row.area; + const f = rowFixedLength * rowFixedLength * ratio; + return squareArea ? mathMax8(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity; +} +function position(row, rowFixedLength, rect, halfGapWidth, flush) { + const idx0WhenH = rowFixedLength === rect.width ? 0 : 1; + const idx1WhenH = 1 - idx0WhenH; + const xy = ["x", "y"]; + const wh = ["width", "height"]; + let last = rect[xy[idx0WhenH]]; + let rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0; + if (flush || rowOtherLength > rect[wh[idx1WhenH]]) { + rowOtherLength = rect[wh[idx1WhenH]]; + } + for (let i = 0, rowLen = row.length; i < rowLen; i++) { + const node = row[i]; + const nodeLayout = {}; + const step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0; + const wh1 = nodeLayout[wh[idx1WhenH]] = mathMax8(rowOtherLength - 2 * halfGapWidth, 0); + const remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last; + const modWH = i === rowLen - 1 || remain < step ? remain : step; + const wh0 = nodeLayout[wh[idx0WhenH]] = mathMax8(modWH - 2 * halfGapWidth, 0); + nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin8(halfGapWidth, wh1 / 2); + nodeLayout[xy[idx0WhenH]] = last + mathMin8(halfGapWidth, wh0 / 2); + last += modWH; + node.setLayout(nodeLayout, true); + } + rect[xy[idx1WhenH]] += rowOtherLength; + rect[wh[idx1WhenH]] -= rowOtherLength; +} +function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) { + let currNode = (targetInfo || {}).node; + const defaultSize = [containerWidth, containerHeight]; + if (!currNode || currNode === viewRoot) { + return defaultSize; + } + let parent; + const viewArea = containerWidth * containerHeight; + let area = viewArea * seriesModel.option.zoomToNodeRatio; + while (parent = currNode.parentNode) { + let sum2 = 0; + const siblings = parent.children; + for (let i = 0, len2 = siblings.length; i < len2; i++) { + sum2 += siblings[i].getValue(); + } + const currNodeValue = currNode.getValue(); + if (currNodeValue === 0) { + return defaultSize; + } + area *= sum2 / currNodeValue; + const parentModel = parent.getModel(); + const borderWidth = parentModel.get(PATH_BORDER_WIDTH); + const upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel)); + area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5); + area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER); + currNode = parent; + } + area < viewArea && (area = viewArea); + const scale4 = Math.pow(area / viewArea, 0.5); + return [containerWidth * scale4, containerHeight * scale4]; +} +function calculateRootPosition(layoutInfo, rootRect, targetInfo) { + if (rootRect) { + return {x: rootRect.x, y: rootRect.y}; + } + const defaultPosition = {x: 0, y: 0}; + if (!targetInfo) { + return defaultPosition; + } + const targetNode = targetInfo.node; + const layout18 = targetNode.getLayout(); + if (!layout18) { + return defaultPosition; + } + const targetCenter = [layout18.width / 2, layout18.height / 2]; + let node = targetNode; + while (node) { + const nodeLayout = node.getLayout(); + targetCenter[0] += nodeLayout.x; + targetCenter[1] += nodeLayout.y; + node = node.parentNode; + } + return { + x: layoutInfo.width / 2 - targetCenter[0], + y: layoutInfo.height / 2 - targetCenter[1] + }; +} +function prunning(node, clipRect, viewAbovePath, viewRoot, depth) { + const nodeLayout = node.getLayout(); + const nodeInViewAbovePath = viewAbovePath[depth]; + const isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node; + if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) { + return; + } + node.setLayout({ + isInView: true, + invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout), + isAboveViewRoot + }, true); + const childClipRect = new BoundingRect_default(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height); + each5(node.viewChildren || [], function(child) { + prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1); + }); +} +function getUpperLabelHeight(model) { + return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0; +} + +// src/chart/treemap/install.ts +function install13(registers) { + registers.registerSeriesModel(TreemapSeries_default); + registers.registerChartView(TreemapView_default); + registers.registerVisual(treemapVisual_default); + registers.registerLayout(treemapLayout_default); + installTreemapAction(registers); +} + +// src/chart/graph/categoryFilter.ts +function categoryFilter(ecModel) { + const legendModels = ecModel.findComponents({ + mainType: "legend" + }); + if (!legendModels || !legendModels.length) { + return; + } + ecModel.eachSeriesByType("graph", function(graphSeries) { + const categoriesData = graphSeries.getCategoriesData(); + const graph = graphSeries.getGraph(); + const data = graph.data; + const categoryNames = categoriesData.mapArray(categoriesData.getName); + data.filterSelf(function(idx) { + const model = data.getItemModel(idx); + let category = model.getShallow("category"); + if (category != null) { + if (isNumber(category)) { + category = categoryNames[category]; + } + for (let i = 0; i < legendModels.length; i++) { + if (!legendModels[i].isSelected(category)) { + return false; } } } - } - function createVisualMappings(option, stateList, supplementVisualOption) { - var visualMappings = {}; - each$b(stateList, function (state) { - var mappings = visualMappings[state] = createMappings(); - each$b(option[state], function (visualData, visualType) { - if (!VisualMapping.isValidType(visualType)) { - return; - } - var mappingOption = { - type: visualType, - visual: visualData - }; - supplementVisualOption && supplementVisualOption(mappingOption, state); - mappings[visualType] = new VisualMapping(mappingOption); - // Prepare a alpha for opacity, for some case that opacity - // is not supported, such as rendering using gradient color. - if (visualType === 'opacity') { - mappingOption = clone(mappingOption); - mappingOption.type = 'colorAlpha'; - mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption); - } - }); - }); - return visualMappings; - function createMappings() { - var Creater = function () {}; - // Make sure hidden fields will not be visited by - // object iteration (with hasOwnProperty checking). - Creater.prototype.__hidden = Creater.prototype; - var obj = new Creater(); - return obj; - } - } - function replaceVisualOption(thisOption, newOption, keys) { - // Visual attributes merge is not supported, otherwise it - // brings overcomplicated merge logic. See #2853. So if - // newOption has anyone of these keys, all of these keys - // will be reset. Otherwise, all keys remain. - var has; - each(keys, function (key) { - if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { - has = true; + return true; + }); + }); +} + +// src/chart/graph/categoryVisual.ts +function categoryVisual(ecModel) { + const paletteScope = {}; + ecModel.eachSeriesByType("graph", function(seriesModel) { + const categoriesData = seriesModel.getCategoriesData(); + const data = seriesModel.getData(); + const categoryNameIdxMap = {}; + categoriesData.each(function(idx) { + const name = categoriesData.getName(idx); + categoryNameIdxMap["ec-" + name] = idx; + const itemModel = categoriesData.getItemModel(idx); + const style = itemModel.getModel("itemStyle").getItemStyle(); + if (!style.fill) { + style.fill = seriesModel.getColorFromPalette(name, paletteScope); + } + categoriesData.setItemVisual(idx, "style", style); + const symbolVisualList = ["symbol", "symbolSize", "symbolKeepAspect"]; + for (let i = 0; i < symbolVisualList.length; i++) { + const symbolVisual = itemModel.getShallow(symbolVisualList[i], true); + if (symbolVisual != null) { + categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual); } - }); - has && each(keys, function (key) { - if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { - thisOption[key] = clone(newOption[key]); - } else { - delete thisOption[key]; + } + }); + if (categoriesData.count()) { + data.each(function(idx) { + const model = data.getItemModel(idx); + let categoryIdx = model.getShallow("category"); + if (categoryIdx != null) { + if (isString(categoryIdx)) { + categoryIdx = categoryNameIdxMap["ec-" + categoryIdx]; + } + const categoryStyle = categoriesData.getItemVisual(categoryIdx, "style"); + const style = data.ensureUniqueItemVisual(idx, "style"); + extend(style, categoryStyle); + const visualList = ["symbol", "symbolSize", "symbolKeepAspect"]; + for (let i = 0; i < visualList.length; i++) { + data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i])); + } } }); } - /** - * @param stateList - * @param visualMappings - * @param list - * @param getValueState param: valueOrIndex, return: state. - * @param scope Scope for getValueState - * @param dimension Concrete dimension, if used. - */ - // ???! handle brush? - function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) { - var visualTypesMap = {}; - each(stateList, function (state) { - var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); - visualTypesMap[state] = visualTypes; - }); - var dataIndex; - function getVisual(key) { - return getItemVisualFromData(data, dataIndex, key); - } - function setVisual(key, value) { - setItemVisualFromData(data, dataIndex, key, value); + }); +} + +// src/chart/graph/edgeVisual.ts +function normalize3(a) { + if (!(a instanceof Array)) { + a = [a, a]; + } + return a; +} +function graphEdgeVisual(ecModel) { + ecModel.eachSeriesByType("graph", function(seriesModel) { + const graph = seriesModel.getGraph(); + const edgeData = seriesModel.getEdgeData(); + const symbolType = normalize3(seriesModel.get("edgeSymbol")); + const symbolSize = normalize3(seriesModel.get("edgeSymbolSize")); + edgeData.setVisual("fromSymbol", symbolType && symbolType[0]); + edgeData.setVisual("toSymbol", symbolType && symbolType[1]); + edgeData.setVisual("fromSymbolSize", symbolSize && symbolSize[0]); + edgeData.setVisual("toSymbolSize", symbolSize && symbolSize[1]); + edgeData.setVisual("style", seriesModel.getModel("lineStyle").getLineStyle()); + edgeData.each(function(idx) { + const itemModel = edgeData.getItemModel(idx); + const edge = graph.getEdgeByIndex(idx); + const symbolType2 = normalize3(itemModel.getShallow("symbol", true)); + const symbolSize2 = normalize3(itemModel.getShallow("symbolSize", true)); + const style = itemModel.getModel("lineStyle").getLineStyle(); + const existsStyle = edgeData.ensureUniqueItemVisual(idx, "style"); + extend(existsStyle, style); + switch (existsStyle.stroke) { + case "source": { + const nodeStyle = edge.node1.getVisual("style"); + existsStyle.stroke = nodeStyle && nodeStyle.fill; + break; + } + case "target": { + const nodeStyle = edge.node2.getVisual("style"); + existsStyle.stroke = nodeStyle && nodeStyle.fill; + break; + } } - if (dimension == null) { - data.each(eachItem); - } else { - data.each([dimension], eachItem); - } - function eachItem(valueOrIndex, index) { - dataIndex = dimension == null ? valueOrIndex // First argument is index - : index; - var rawDataItem = data.getRawDataItem(dataIndex); - // Consider performance - // @ts-ignore - if (rawDataItem && rawDataItem.visualMap === false) { - return; + symbolType2[0] && edge.setVisual("fromSymbol", symbolType2[0]); + symbolType2[1] && edge.setVisual("toSymbol", symbolType2[1]); + symbolSize2[0] && edge.setVisual("fromSymbolSize", symbolSize2[0]); + symbolSize2[1] && edge.setVisual("toSymbolSize", symbolSize2[1]); + }); + }); +} + +// src/chart/helper/multipleGraphEdgeHelper.ts +var KEY_DELIMITER = "-->"; +var getAutoCurvenessParams = function(seriesModel) { + return seriesModel.get("autoCurveness") || null; +}; +var createCurveness = function(seriesModel, appendLength) { + const autoCurvenessParmas = getAutoCurvenessParams(seriesModel); + let length2 = 20; + let curvenessList = []; + if (isNumber(autoCurvenessParmas)) { + length2 = autoCurvenessParmas; + } else if (isArray(autoCurvenessParmas)) { + seriesModel.__curvenessList = autoCurvenessParmas; + return; + } + if (appendLength > length2) { + length2 = appendLength; + } + const len2 = length2 % 2 ? length2 + 2 : length2 + 3; + curvenessList = []; + for (let i = 0; i < len2; i++) { + curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1)); + } + seriesModel.__curvenessList = curvenessList; +}; +var getKeyOfEdges = function(n1, n2, seriesModel) { + const source = [n1.id, n1.dataIndex].join("."); + const target = [n2.id, n2.dataIndex].join("."); + return [seriesModel.uid, source, target].join(KEY_DELIMITER); +}; +var getOppositeKey = function(key) { + const keys2 = key.split(KEY_DELIMITER); + return [keys2[0], keys2[2], keys2[1]].join(KEY_DELIMITER); +}; +var getEdgeFromMap = function(edge, seriesModel) { + const key = getKeyOfEdges(edge.node1, edge.node2, seriesModel); + return seriesModel.__edgeMap[key]; +}; +var getTotalLengthBetweenNodes = function(edge, seriesModel) { + const len2 = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel); + const lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel); + return len2 + lenV; +}; +var getEdgeMapLengthWithKey = function(key, seriesModel) { + const edgeMap = seriesModel.__edgeMap; + return edgeMap[key] ? edgeMap[key].length : 0; +}; +function initCurvenessList(seriesModel) { + if (!getAutoCurvenessParams(seriesModel)) { + return; + } + seriesModel.__curvenessList = []; + seriesModel.__edgeMap = {}; + createCurveness(seriesModel); +} +function createEdgeMapForCurveness(n1, n2, seriesModel, index) { + if (!getAutoCurvenessParams(seriesModel)) { + return; + } + const key = getKeyOfEdges(n1, n2, seriesModel); + const edgeMap = seriesModel.__edgeMap; + const oppositeEdges = edgeMap[getOppositeKey(key)]; + if (edgeMap[key] && !oppositeEdges) { + edgeMap[key].isForward = true; + } else if (oppositeEdges && edgeMap[key]) { + oppositeEdges.isForward = true; + edgeMap[key].isForward = false; + } + edgeMap[key] = edgeMap[key] || []; + edgeMap[key].push(index); +} +function getCurvenessForEdge(edge, seriesModel, index, needReverse) { + const autoCurvenessParams = getAutoCurvenessParams(seriesModel); + const isArrayParam = isArray(autoCurvenessParams); + if (!autoCurvenessParams) { + return null; + } + const edgeArray = getEdgeFromMap(edge, seriesModel); + if (!edgeArray) { + return null; + } + let edgeIndex = -1; + for (let i = 0; i < edgeArray.length; i++) { + if (edgeArray[i] === index) { + edgeIndex = i; + break; + } + } + const totalLen = getTotalLengthBetweenNodes(edge, seriesModel); + createCurveness(seriesModel, totalLen); + edge.lineStyle = edge.lineStyle || {}; + const curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel); + const curvenessList = seriesModel.__curvenessList; + const parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1; + if (!edgeArray.isForward) { + const oppositeKey = getOppositeKey(curKey); + const len2 = getEdgeMapLengthWithKey(oppositeKey, seriesModel); + const resValue = curvenessList[edgeIndex + len2 + parityCorrection]; + if (needReverse) { + if (isArrayParam) { + if (autoCurvenessParams && autoCurvenessParams[0] === 0) { + return (len2 + parityCorrection) % 2 ? resValue : -resValue; + } else { + return ((len2 % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue; } - var valueState = getValueState.call(scope, valueOrIndex); - var mappings = visualMappings[valueState]; - var visualTypes = visualTypesMap[valueState]; - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual); - } - } - } - /** - * @param data - * @param stateList - * @param visualMappings > - * @param getValueState param: valueOrIndex, return: state. - * @param dim dimension or dimension index. - */ - function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) { - var visualTypesMap = {}; - each(stateList, function (state) { - var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); - visualTypesMap[state] = visualTypes; + } else { + return (len2 + parityCorrection) % 2 ? resValue : -resValue; + } + } else { + return curvenessList[edgeIndex + len2 + parityCorrection]; + } + } else { + return curvenessList[parityCorrection + edgeIndex]; + } +} + +// src/chart/graph/simpleLayoutHelper.ts +function simpleLayout(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.type !== "view") { + return; + } + const graph = seriesModel.getGraph(); + graph.eachNode(function(node) { + const model = node.getModel(); + node.setLayout([+model.get("x"), +model.get("y")]); + }); + simpleLayoutEdge(graph, seriesModel); +} +function simpleLayoutEdge(graph, seriesModel) { + graph.eachEdge(function(edge, index) { + const curveness = retrieve3(edge.getModel().get(["lineStyle", "curveness"]), -getCurvenessForEdge(edge, seriesModel, index, true), 0); + const p1 = clone2(edge.node1.getLayout()); + const p2 = clone2(edge.node2.getLayout()); + const points4 = [p1, p2]; + if (+curveness) { + points4.push([ + (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, + (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness + ]); + } + edge.setLayout(points4); + }); +} + +// src/chart/graph/simpleLayout.ts +function graphSimpleLayout(ecModel, api2) { + ecModel.eachSeriesByType("graph", function(seriesModel) { + const layout18 = seriesModel.get("layout"); + const coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.type !== "view") { + const data = seriesModel.getData(); + let dimensions = []; + each(coordSys.dimensions, function(coordDim) { + dimensions = dimensions.concat(data.mapDimensionsAll(coordDim)); }); - return { - progress: function progress(params, data) { - var dimIndex; - if (dim != null) { - dimIndex = data.getDimensionIndex(dim); - } - function getVisual(key) { - return getItemVisualFromData(data, dataIndex, key); - } - function setVisual(key, value) { - setItemVisualFromData(data, dataIndex, key, value); - } - var dataIndex; - var store = data.getStore(); - while ((dataIndex = params.next()) != null) { - var rawDataItem = data.getRawDataItem(dataIndex); - // Consider performance - // @ts-ignore - if (rawDataItem && rawDataItem.visualMap === false) { - continue; - } - var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex; - var valueState = getValueState(value); - var mappings = visualMappings[valueState]; - var visualTypes = visualTypesMap[valueState]; - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual); - } + for (let dataIndex = 0; dataIndex < data.count(); dataIndex++) { + const value = []; + let hasValue = false; + for (let i = 0; i < dimensions.length; i++) { + const val = data.get(dimensions[i], dataIndex); + if (!isNaN(val)) { + hasValue = true; } + value.push(val); } - }; + if (hasValue) { + data.setItemLayout(dataIndex, coordSys.dataToPoint(value)); + } else { + data.setItemLayout(dataIndex, [NaN, NaN]); + } + } + simpleLayoutEdge(data.graph, seriesModel); + } else if (!layout18 || layout18 === "none") { + simpleLayout(seriesModel); + } + }); +} + +// src/chart/graph/graphHelper.ts +function getNodeGlobalScale(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + if (coordSys.type !== "view") { + return 1; + } + const nodeScaleRatio = seriesModel.option.nodeScaleRatio; + const groupZoom = coordSys.scaleX; + const roamZoom = coordSys.getZoom(); + const nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + return nodeScale / groupZoom; +} +function getSymbolSize(node) { + let symbolSize = node.getVisual("symbolSize"); + if (symbolSize instanceof Array) { + symbolSize = (symbolSize[0] + symbolSize[1]) / 2; + } + return +symbolSize; +} + +// src/chart/graph/circularLayoutHelper.ts +var PI8 = Math.PI; +var _symbolRadiansHalf = []; +function circularLayout(seriesModel, basedOn, draggingNode, pointer) { + const coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.type !== "view") { + return; + } + const rect = coordSys.getBoundingRect(); + const nodeData = seriesModel.getData(); + const graph = nodeData.graph; + const cx = rect.width / 2 + rect.x; + const cy = rect.height / 2 + rect.y; + const r = Math.min(rect.width, rect.height) / 2; + const count2 = nodeData.count(); + nodeData.setLayout({ + cx, + cy + }); + if (!count2) { + return; + } + if (draggingNode) { + const [tempX, tempY] = coordSys.pointToData(pointer); + const v = [tempX - cx, tempY - cy]; + normalize(v, v); + scale(v, v, r); + draggingNode.setLayout([cx + v[0], cy + v[1]], true); + const circularRotateLabel = seriesModel.get(["circular", "rotateLabel"]); + rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy); + } + _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count2); + graph.eachEdge(function(edge, index) { + let curveness = retrieve3(edge.getModel().get(["lineStyle", "curveness"]), getCurvenessForEdge(edge, seriesModel, index), 0); + const p1 = clone2(edge.node1.getLayout()); + const p2 = clone2(edge.node2.getLayout()); + let cp1; + const x12 = (p1[0] + p2[0]) / 2; + const y12 = (p1[1] + p2[1]) / 2; + if (+curveness) { + curveness *= 3; + cp1 = [ + cx * curveness + x12 * (1 - curveness), + cy * curveness + y12 * (1 - curveness) + ]; } - - function makeBrushCommonSelectorForSeries(area) { - var brushType = area.brushType; - // Do not use function binding or curry for performance. - var selectors = { - point: function (itemLayout) { - return selector[brushType].point(itemLayout, selectors, area); - }, - rect: function (itemLayout) { - return selector[brushType].rect(itemLayout, selectors, area); + edge.setLayout([p1, p2, cp1]); + }); +} +var _layoutNodesBasedOn = { + value(seriesModel, graph, nodeData, r, cx, cy, count2) { + let angle = 0; + const sum2 = nodeData.getSum("value"); + const unitAngle = Math.PI * 2 / (sum2 || count2); + graph.eachNode(function(node) { + const value = node.getValue("value"); + const radianHalf = unitAngle * (sum2 ? value : 1) / 2; + angle += radianHalf; + node.setLayout([ + r * Math.cos(angle) + cx, + r * Math.sin(angle) + cy + ]); + angle += radianHalf; + }); + }, + symbolSize(seriesModel, graph, nodeData, r, cx, cy, count2) { + let sumRadian = 0; + _symbolRadiansHalf.length = count2; + const nodeScale = getNodeGlobalScale(seriesModel); + graph.eachNode(function(node) { + let symbolSize = getSymbolSize(node); + isNaN(symbolSize) && (symbolSize = 2); + symbolSize < 0 && (symbolSize = 0); + symbolSize *= nodeScale; + let symbolRadianHalf = Math.asin(symbolSize / 2 / r); + isNaN(symbolRadianHalf) && (symbolRadianHalf = PI8 / 2); + _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf; + sumRadian += symbolRadianHalf * 2; + }); + const halfRemainRadian = (2 * PI8 - sumRadian) / count2 / 2; + let angle = 0; + graph.eachNode(function(node) { + const radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex]; + angle += radianHalf; + (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([ + r * Math.cos(angle) + cx, + r * Math.sin(angle) + cy + ]); + angle += radianHalf; + }); + } +}; +function rotateNodeLabel(node, circularRotateLabel, cx, cy) { + const el = node.getGraphicEl(); + if (!el) { + return; + } + const nodeModel = node.getModel(); + let labelRotate = nodeModel.get(["label", "rotate"]) || 0; + const symbolPath = el.getSymbolPath(); + if (circularRotateLabel) { + const pos = node.getLayout(); + let rad = Math.atan2(pos[1] - cy, pos[0] - cx); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + const isLeft = pos[0] < cx; + if (isLeft) { + rad = rad - Math.PI; + } + const textPosition = isLeft ? "left" : "right"; + symbolPath.setTextConfig({ + rotation: -rad, + position: textPosition, + origin: "center" + }); + const emphasisState = symbolPath.ensureState("emphasis"); + extend(emphasisState.textConfig || (emphasisState.textConfig = {}), { + position: textPosition + }); + } else { + symbolPath.setTextConfig({ + rotation: labelRotate *= Math.PI / 180 + }); + } +} + +// src/chart/graph/circularLayout.ts +function graphCircularLayout(ecModel) { + ecModel.eachSeriesByType("graph", function(seriesModel) { + if (seriesModel.get("layout") === "circular") { + circularLayout(seriesModel, "symbolSize"); + } + }); +} + +// src/chart/graph/forceHelper.ts +var scaleAndAdd2 = scaleAndAdd; +function forceLayout(inNodes, inEdges, opts) { + const nodes = inNodes; + const edges = inEdges; + const rect = opts.rect; + const width = rect.width; + const height = rect.height; + const center3 = [rect.x + width / 2, rect.y + height / 2]; + const gravity = opts.gravity == null ? 0.1 : opts.gravity; + for (let i = 0; i < nodes.length; i++) { + const n = nodes[i]; + if (!n.p) { + n.p = create(width * (Math.random() - 0.5) + center3[0], height * (Math.random() - 0.5) + center3[1]); + } + n.pp = clone2(n.p); + n.edges = null; + } + const initialFriction = opts.friction == null ? 0.6 : opts.friction; + let friction = initialFriction; + let beforeStepCallback; + let afterStepCallback; + return { + warmUp: function() { + friction = initialFriction * 0.8; + }, + setFixed: function(idx) { + nodes[idx].fixed = true; + }, + setUnfixed: function(idx) { + nodes[idx].fixed = false; + }, + beforeStep: function(cb) { + beforeStepCallback = cb; + }, + afterStep: function(cb) { + afterStepCallback = cb; + }, + step: function(cb) { + beforeStepCallback && beforeStepCallback(nodes, edges); + const v12 = []; + const nLen = nodes.length; + for (let i = 0; i < edges.length; i++) { + const e2 = edges[i]; + if (e2.ignoreForceLayout) { + continue; } - }; - return selectors; - } - var selector = { - lineX: getLineSelectors(0), - lineY: getLineSelectors(1), - rect: { - point: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); - }, - rect: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.intersect(itemLayout); + const n1 = e2.n1; + const n2 = e2.n2; + sub(v12, n2.p, n1.p); + const d = len(v12) - e2.d; + let w = n2.w / (n1.w + n2.w); + if (isNaN(w)) { + w = 0; + } + normalize(v12, v12); + !n1.fixed && scaleAndAdd2(n1.p, n1.p, v12, w * d * friction); + !n2.fixed && scaleAndAdd2(n2.p, n2.p, v12, -(1 - w) * d * friction); + } + for (let i = 0; i < nLen; i++) { + const n = nodes[i]; + if (!n.fixed) { + sub(v12, center3, n.p); + scaleAndAdd2(n.p, n.p, v12, gravity * friction); + } + } + for (let i = 0; i < nLen; i++) { + const n1 = nodes[i]; + for (let j = i + 1; j < nLen; j++) { + const n2 = nodes[j]; + sub(v12, n2.p, n1.p); + let d = len(v12); + if (d === 0) { + set(v12, Math.random() - 0.5, Math.random() - 0.5); + d = 1; + } + const repFact = (n1.rep + n2.rep) / d / d; + !n1.fixed && scaleAndAdd2(n1.pp, n1.pp, v12, repFact); + !n2.fixed && scaleAndAdd2(n2.pp, n2.pp, v12, -repFact); + } + } + const v = []; + for (let i = 0; i < nLen; i++) { + const n = nodes[i]; + if (!n.fixed) { + sub(v, n.p, n.pp); + scaleAndAdd2(n.p, n.p, v, friction); + copy(n.pp, n.p); + } + } + friction = friction * 0.992; + const finished = friction < 0.01; + afterStepCallback && afterStepCallback(nodes, edges, finished); + cb && cb(finished); + } + }; +} + +// src/chart/graph/forceLayout.ts +function graphForceLayout(ecModel) { + ecModel.eachSeriesByType("graph", function(graphSeries) { + const coordSys = graphSeries.coordinateSystem; + if (coordSys && coordSys.type !== "view") { + return; + } + if (graphSeries.get("layout") === "force") { + const preservedPoints = graphSeries.preservedPoints || {}; + const graph = graphSeries.getGraph(); + const nodeData = graph.data; + const edgeData = graph.edgeData; + const forceModel = graphSeries.getModel("force"); + const initLayout = forceModel.get("initLayout"); + if (graphSeries.preservedPoints) { + nodeData.each(function(idx) { + const 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"); + } + const nodeDataExtent = nodeData.getDataExtent("value"); + const edgeDataExtent = edgeData.getDataExtent("value"); + const repulsion = forceModel.get("repulsion"); + const edgeLength = forceModel.get("edgeLength"); + const repulsionArr = isArray(repulsion) ? repulsion : [repulsion, repulsion]; + let edgeLengthArr = isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength]; + edgeLengthArr = [edgeLengthArr[1], edgeLengthArr[0]]; + const nodes = nodeData.mapArray("value", function(value, idx) { + const point = nodeData.getItemLayout(idx); + let rep = linearMap(value, nodeDataExtent, repulsionArr); + if (isNaN(rep)) { + rep = (repulsionArr[0] + repulsionArr[1]) / 2; } - }, - polygon: { - point: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain$2(area.range, itemLayout[0], itemLayout[1]); - }, - rect: function (itemLayout, selectors, area) { - var points = area.range; - if (!itemLayout || points.length <= 1) { - return false; + return { + w: rep, + rep, + fixed: nodeData.getItemModel(idx).get("fixed"), + p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point + }; + }); + const edges = edgeData.mapArray("value", function(value, idx) { + const edge = graph.getEdgeByIndex(idx); + let d = linearMap(value, edgeDataExtent, edgeLengthArr); + if (isNaN(d)) { + d = (edgeLengthArr[0] + edgeLengthArr[1]) / 2; + } + const edgeModel = edge.getModel(); + const curveness = retrieve3(edge.getModel().get(["lineStyle", "curveness"]), -getCurvenessForEdge(edge, graphSeries, idx, true), 0); + return { + n1: nodes[edge.node1.dataIndex], + n2: nodes[edge.node2.dataIndex], + d, + curveness, + ignoreForceLayout: edgeModel.get("ignoreForceLayout") + }; + }); + const rect = coordSys.getBoundingRect(); + const forceInstance = forceLayout(nodes, edges, { + rect, + gravity: forceModel.get("gravity"), + friction: forceModel.get("friction") + }); + forceInstance.beforeStep(function(nodes2, edges2) { + for (let i = 0, l = nodes2.length; i < l; i++) { + if (nodes2[i].fixed) { + copy(nodes2[i].p, graph.getNodeByIndex(i).getLayout()); } - var x = itemLayout.x; - var y = itemLayout.y; - var width = itemLayout.width; - var height = itemLayout.height; - var p = points[0]; - if (contain$2(points, x, y) || contain$2(points, x + width, y) || contain$2(points, x, y + height) || contain$2(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) { - return true; + } + }); + forceInstance.afterStep(function(nodes2, edges2, stopped) { + for (let i = 0, l = nodes2.length; i < l; i++) { + if (!nodes2[i].fixed) { + graph.getNodeByIndex(i).setLayout(nodes2[i].p); + } + preservedPoints[nodeData.getId(i)] = nodes2[i].p; + } + for (let i = 0, l = edges2.length; i < l; i++) { + const e2 = edges2[i]; + const edge = graph.getEdgeByIndex(i); + const p1 = e2.n1.p; + const p2 = e2.n2.p; + let points4 = edge.getLayout(); + points4 = points4 ? points4.slice() : []; + points4[0] = points4[0] || []; + points4[1] = points4[1] || []; + copy(points4[0], p1); + copy(points4[1], p2); + if (+e2.curveness) { + points4[2] = [ + (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e2.curveness, + (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e2.curveness + ]; } + edge.setLayout(points4); } + }); + graphSeries.forceLayout = forceInstance; + graphSeries.preservedPoints = preservedPoints; + forceInstance.step(); + } else { + graphSeries.forceLayout = null; + } + }); +} + +// src/chart/graph/createView.ts +function getViewRect3(seriesModel, api2, aspect) { + const option = extend(seriesModel.getBoxLayoutParams(), { + aspect + }); + return getLayoutRect(option, { + width: api2.getWidth(), + height: api2.getHeight() + }); +} +function createViewCoordSys(ecModel, api2) { + const viewList = []; + ecModel.eachSeriesByType("graph", function(seriesModel) { + const coordSysType = seriesModel.get("coordinateSystem"); + if (!coordSysType || coordSysType === "view") { + const data = seriesModel.getData(); + const positions = data.mapArray(function(idx) { + const itemModel = data.getItemModel(idx); + return [+itemModel.get("x"), +itemModel.get("y")]; + }); + let min3 = []; + let max3 = []; + fromPoints(positions, min3, max3); + if (max3[0] - min3[0] === 0) { + max3[0] += 1; + min3[0] -= 1; + } + if (max3[1] - min3[1] === 0) { + max3[1] += 1; + min3[1] -= 1; + } + const aspect = (max3[0] - min3[0]) / (max3[1] - min3[1]); + const viewRect2 = getViewRect3(seriesModel, api2, aspect); + if (isNaN(aspect)) { + min3 = [viewRect2.x, viewRect2.y]; + max3 = [viewRect2.x + viewRect2.width, viewRect2.y + viewRect2.height]; + } + const bbWidth = max3[0] - min3[0]; + const bbHeight = max3[1] - min3[1]; + const viewWidth = viewRect2.width; + const viewHeight = viewRect2.height; + const viewCoordSys = seriesModel.coordinateSystem = new View_default(); + viewCoordSys.zoomLimit = seriesModel.get("scaleLimit"); + viewCoordSys.setBoundingRect(min3[0], min3[1], bbWidth, bbHeight); + viewCoordSys.setViewRect(viewRect2.x, viewRect2.y, viewWidth, viewHeight); + viewCoordSys.setCenter(seriesModel.get("center"), api2); + viewCoordSys.setZoom(seriesModel.get("zoom")); + viewList.push(viewCoordSys); + } + }); + return viewList; +} + +// src/chart/helper/LinePath.ts +var straightLineProto = Line_default.prototype; +var bezierCurveProto = BezierCurve_default.prototype; +var StraightLineShape = class { + constructor() { + this.x1 = 0; + this.y1 = 0; + this.x2 = 0; + this.y2 = 0; + this.percent = 1; + } +}; +function isStraightLine(shape) { + return isNaN(+shape.cpx1) || isNaN(+shape.cpy1); +} +var ECLinePath = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "ec-line"; + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new StraightLineShape(); + } + buildPath(ctx, shape) { + if (isStraightLine(shape)) { + straightLineProto.buildPath.call(this, ctx, shape); + } else { + bezierCurveProto.buildPath.call(this, ctx, shape); + } + } + pointAt(t) { + if (isStraightLine(this.shape)) { + return straightLineProto.pointAt.call(this, t); + } else { + return bezierCurveProto.pointAt.call(this, t); + } + } + tangentAt(t) { + const shape = this.shape; + const p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t); + return normalize(p, p); + } +}; +var LinePath_default = ECLinePath; + +// src/chart/helper/Line.ts +var SYMBOL_CATEGORIES = ["fromSymbol", "toSymbol"]; +function makeSymbolTypeKey(symbolCategory) { + return "_" + symbolCategory + "Type"; +} +function makeSymbolTypeValue(name, lineData, idx) { + const symbolType = lineData.getItemVisual(idx, name); + if (!symbolType || symbolType === "none") { + return symbolType; + } + const symbolSize = lineData.getItemVisual(idx, name + "Size"); + const symbolRotate = lineData.getItemVisual(idx, name + "Rotate"); + const symbolOffset = lineData.getItemVisual(idx, name + "Offset"); + const symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect"); + const symbolSizeArr = normalizeSymbolSize(symbolSize); + const symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); + return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || "") + (symbolKeepAspect || ""); +} +function createSymbol2(name, lineData, idx) { + const symbolType = lineData.getItemVisual(idx, name); + if (!symbolType || symbolType === "none") { + return; + } + const symbolSize = lineData.getItemVisual(idx, name + "Size"); + const symbolRotate = lineData.getItemVisual(idx, name + "Rotate"); + const symbolOffset = lineData.getItemVisual(idx, name + "Offset"); + const symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect"); + const symbolSizeArr = normalizeSymbolSize(symbolSize); + const symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); + const symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect); + symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0; + symbolPath.name = name; + return symbolPath; +} +function createLine(points4) { + const line2 = new LinePath_default({ + name: "line", + subPixelOptimize: true + }); + setLinePoints(line2.shape, points4); + return line2; +} +function setLinePoints(targetShape, points4) { + targetShape.x1 = points4[0][0]; + targetShape.y1 = points4[0][1]; + targetShape.x2 = points4[1][0]; + targetShape.y2 = points4[1][1]; + targetShape.percent = 1; + const cp1 = points4[2]; + if (cp1) { + targetShape.cpx1 = cp1[0]; + targetShape.cpy1 = cp1[1]; + } else { + targetShape.cpx1 = NaN; + targetShape.cpy1 = NaN; + } +} +var Line2 = class extends Group_default { + constructor(lineData, idx, seriesScope) { + super(); + this._createLine(lineData, idx, seriesScope); + } + _createLine(lineData, idx, seriesScope) { + const seriesModel = lineData.hostModel; + const linePoints = lineData.getItemLayout(idx); + const line2 = createLine(linePoints); + line2.shape.percent = 0; + initProps(line2, { + shape: { + percent: 1 } + }, seriesModel, idx); + this.add(line2); + each(SYMBOL_CATEGORIES, function(symbolCategory) { + const symbol = createSymbol2(symbolCategory, lineData, idx); + this.add(symbol); + this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx); + }, this); + this._updateCommonStl(lineData, idx, seriesScope); + } + updateData(lineData, idx, seriesScope) { + const seriesModel = lineData.hostModel; + const line2 = this.childOfName("line"); + const linePoints = lineData.getItemLayout(idx); + const target = { + shape: {} }; - function getLineSelectors(xyIndex) { - var xy = ['x', 'y']; - var wh = ['width', 'height']; - return { - point: function (itemLayout, selectors, area) { - if (itemLayout) { - var range = area.range; - var p = itemLayout[xyIndex]; - return inLineRange(p, range); - } - }, - rect: function (itemLayout, selectors, area) { - if (itemLayout) { - var range = area.range; - var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]]; - layoutRange[1] < layoutRange[0] && layoutRange.reverse(); - return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange); - } + setLinePoints(target.shape, linePoints); + updateProps(line2, target, seriesModel, idx); + each(SYMBOL_CATEGORIES, function(symbolCategory) { + const symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx); + const key = makeSymbolTypeKey(symbolCategory); + if (this[key] !== symbolType) { + this.remove(this.childOfName(symbolCategory)); + const symbol = createSymbol2(symbolCategory, lineData, idx); + this.add(symbol); + } + this[key] = symbolType; + }, this); + this._updateCommonStl(lineData, idx, seriesScope); + } + getLinePath() { + return this.childAt(0); + } + _updateCommonStl(lineData, idx, seriesScope) { + const seriesModel = lineData.hostModel; + const line2 = this.childOfName("line"); + let emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; + let blurLineStyle = seriesScope && seriesScope.blurLineStyle; + let selectLineStyle = seriesScope && seriesScope.selectLineStyle; + let labelStatesModels = seriesScope && seriesScope.labelStatesModels; + let emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; + let focus = seriesScope && seriesScope.focus; + let blurScope = seriesScope && seriesScope.blurScope; + if (!seriesScope || lineData.hasItemOption) { + const itemModel = lineData.getItemModel(idx); + const emphasisModel = itemModel.getModel("emphasis"); + emphasisLineStyle = emphasisModel.getModel("lineStyle").getLineStyle(); + blurLineStyle = itemModel.getModel(["blur", "lineStyle"]).getLineStyle(); + selectLineStyle = itemModel.getModel(["select", "lineStyle"]).getLineStyle(); + emphasisDisabled = emphasisModel.get("disabled"); + focus = emphasisModel.get("focus"); + blurScope = emphasisModel.get("blurScope"); + labelStatesModels = getLabelStatesModels(itemModel); + } + const lineStyle = lineData.getItemVisual(idx, "style"); + const visualColor = lineStyle.stroke; + line2.useStyle(lineStyle); + line2.style.fill = null; + line2.style.strokeNoScale = true; + line2.ensureState("emphasis").style = emphasisLineStyle; + line2.ensureState("blur").style = blurLineStyle; + line2.ensureState("select").style = selectLineStyle; + each(SYMBOL_CATEGORIES, function(symbolCategory) { + const symbol = this.childOfName(symbolCategory); + if (symbol) { + symbol.setColor(visualColor); + symbol.style.opacity = lineStyle.opacity; + for (let i = 0; i < SPECIAL_STATES.length; i++) { + const stateName = SPECIAL_STATES[i]; + const lineState = line2.getState(stateName); + if (lineState) { + const lineStateStyle = lineState.style || {}; + const state = symbol.ensureState(stateName); + const stateStyle = state.style || (state.style = {}); + if (lineStateStyle.stroke != null) { + stateStyle[symbol.__isEmptyBrush ? "stroke" : "fill"] = lineStateStyle.stroke; + } + if (lineStateStyle.opacity != null) { + stateStyle.opacity = lineStateStyle.opacity; + } + } + } + symbol.markRedraw(); + } + }, this); + const rawVal = seriesModel.getRawValue(idx); + setLabelStyle(this, labelStatesModels, { + labelDataIndex: idx, + labelFetcher: { + getFormattedLabel(dataIndex, stateName) { + return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType); } - }; - } - function inLineRange(p, range) { - return range[0] <= p && p <= range[1]; - } - - var STATE_LIST = ['inBrush', 'outOfBrush']; - var DISPATCH_METHOD = '__ecBrushSelect'; - var DISPATCH_FLAG = '__ecInBrushSelectEvent'; - function layoutCovers(ecModel) { - ecModel.eachComponent({ - mainType: 'brush' - }, function (brushModel) { - var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); - brushTargetManager.setInputRanges(brushModel.areas, ecModel); + }, + inheritColor: visualColor || "#000", + defaultOpacity: lineStyle.opacity, + defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + "" + }); + const label = this.getTextContent(); + if (label) { + const labelNormalModel = labelStatesModels.normal; + label.__align = label.style.align; + label.__verticalAlign = label.style.verticalAlign; + label.__position = labelNormalModel.get("position") || "middle"; + let distance2 = labelNormalModel.get("distance"); + if (!isArray(distance2)) { + distance2 = [distance2, distance2]; + } + label.__labelDistance = distance2; + } + this.setTextConfig({ + position: null, + local: true, + inside: false + }); + toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); + } + highlight() { + enterEmphasis(this); + } + downplay() { + leaveEmphasis(this); + } + updateLayout(lineData, idx) { + this.setLinePoints(lineData.getItemLayout(idx)); + } + setLinePoints(points4) { + const linePath = this.childOfName("line"); + setLinePoints(linePath.shape, points4); + linePath.dirty(); + } + beforeUpdate() { + const lineGroup = this; + const symbolFrom = lineGroup.childOfName("fromSymbol"); + const symbolTo = lineGroup.childOfName("toSymbol"); + const label = lineGroup.getTextContent(); + if (!symbolFrom && !symbolTo && (!label || label.ignore)) { + return; + } + let invScale = 1; + let parentNode2 = this.parent; + while (parentNode2) { + if (parentNode2.scaleX) { + invScale /= parentNode2.scaleX; + } + parentNode2 = parentNode2.parent; + } + const line2 = lineGroup.childOfName("line"); + if (!this.__dirty && !line2.__dirty) { + return; + } + const percent = line2.shape.percent; + const fromPos = line2.pointAt(0); + const toPos = line2.pointAt(percent); + const d = sub([], toPos, fromPos); + normalize(d, d); + function setSymbolRotation(symbol, percent2) { + const specifiedRotation = symbol.__specifiedRotation; + if (specifiedRotation == null) { + const tangent = line2.tangentAt(percent2); + symbol.attr("rotation", (percent2 === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0])); + } else { + symbol.attr("rotation", specifiedRotation); + } + } + if (symbolFrom) { + symbolFrom.setPosition(fromPos); + setSymbolRotation(symbolFrom, 0); + symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent; + symbolFrom.markRedraw(); + } + if (symbolTo) { + symbolTo.setPosition(toPos); + setSymbolRotation(symbolTo, 1); + symbolTo.scaleX = symbolTo.scaleY = invScale * percent; + symbolTo.markRedraw(); + } + if (label && !label.ignore) { + label.x = label.y = 0; + label.originX = label.originY = 0; + let textAlign; + let textVerticalAlign; + const distance2 = label.__labelDistance; + const distanceX = distance2[0] * invScale; + const distanceY = distance2[1] * invScale; + const halfPercent = percent / 2; + const tangent = line2.tangentAt(halfPercent); + const n = [tangent[1], -tangent[0]]; + const cp = line2.pointAt(halfPercent); + if (n[1] > 0) { + n[0] = -n[0]; + n[1] = -n[1]; + } + const dir3 = tangent[0] < 0 ? -1 : 1; + if (label.__position !== "start" && label.__position !== "end") { + let rotation = -Math.atan2(tangent[1], tangent[0]); + if (toPos[0] < fromPos[0]) { + rotation = Math.PI + rotation; + } + label.rotation = rotation; + } + let dy; + switch (label.__position) { + case "insideStartTop": + case "insideMiddleTop": + case "insideEndTop": + case "middle": + dy = -distanceY; + textVerticalAlign = "bottom"; + break; + case "insideStartBottom": + case "insideMiddleBottom": + case "insideEndBottom": + dy = distanceY; + textVerticalAlign = "top"; + break; + default: + dy = 0; + textVerticalAlign = "middle"; + } + switch (label.__position) { + case "end": + label.x = d[0] * distanceX + toPos[0]; + label.y = d[1] * distanceY + toPos[1]; + textAlign = d[0] > 0.8 ? "left" : d[0] < -0.8 ? "right" : "center"; + textVerticalAlign = d[1] > 0.8 ? "top" : d[1] < -0.8 ? "bottom" : "middle"; + break; + case "start": + label.x = -d[0] * distanceX + fromPos[0]; + label.y = -d[1] * distanceY + fromPos[1]; + textAlign = d[0] > 0.8 ? "right" : d[0] < -0.8 ? "left" : "center"; + textVerticalAlign = d[1] > 0.8 ? "bottom" : d[1] < -0.8 ? "top" : "middle"; + break; + case "insideStartTop": + case "insideStart": + case "insideStartBottom": + label.x = distanceX * dir3 + fromPos[0]; + label.y = fromPos[1] + dy; + textAlign = tangent[0] < 0 ? "right" : "left"; + label.originX = -distanceX * dir3; + label.originY = -dy; + break; + case "insideMiddleTop": + case "insideMiddle": + case "insideMiddleBottom": + case "middle": + label.x = cp[0]; + label.y = cp[1] + dy; + textAlign = "center"; + label.originY = -dy; + break; + case "insideEndTop": + case "insideEnd": + case "insideEndBottom": + label.x = -distanceX * dir3 + toPos[0]; + label.y = toPos[1] + dy; + textAlign = tangent[0] >= 0 ? "right" : "left"; + label.originX = distanceX * dir3; + label.originY = -dy; + break; + } + label.scaleX = label.scaleY = invScale; + label.setStyle({ + verticalAlign: label.__verticalAlign || textVerticalAlign, + align: label.__align || textAlign }); } - /** - * Register the visual encoding if this modules required. - */ - function brushVisual(ecModel, api, payload) { - var brushSelected = []; - var throttleType; - var throttleDelay; - ecModel.eachComponent({ - mainType: 'brush' - }, function (brushModel) { - payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : { - brushType: false - }); - }); - layoutCovers(ecModel); - ecModel.eachComponent({ - mainType: 'brush' - }, function (brushModel, brushIndex) { - var thisBrushSelected = { - brushId: brushModel.id, - brushIndex: brushIndex, - brushName: brushModel.name, - areas: clone(brushModel.areas), - selected: [] - }; - // Every brush component exists in event params, convenient - // for user to find by index. - brushSelected.push(thisBrushSelected); - var brushOption = brushModel.option; - var brushLink = brushOption.brushLink; - var linkedSeriesMap = []; - var selectedDataIndexForLink = []; - var rangeInfoBySeries = []; - var hasBrushExists = false; - if (!brushIndex) { - // Only the first throttle setting works. - throttleType = brushOption.throttleType; - throttleDelay = brushOption.throttleDelay; - } - // Add boundingRect and selectors to range. - var areas = map(brushModel.areas, function (area) { - var builder = boundingRectBuilders[area.brushType]; - var selectableArea = defaults({ - boundingRect: builder ? builder(area) : void 0 - }, area); - selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea); - return selectableArea; - }); - var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) { - mappingOption.mappingMethod = 'fixed'; - }); - isArray(brushLink) && 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) : stepAOthers(seriesModel, seriesIndex, rangeInfoList); - }); - function stepAParallel(seriesModel, seriesIndex) { - var coordSys = seriesModel.coordinateSystem; - hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed(); - linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) { - activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); - }); - } - function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { - if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) { - return; + } +}; +var Line_default2 = Line2; + +// src/chart/helper/LineDraw.ts +var LineDraw = class { + constructor(LineCtor) { + this.group = new Group_default(); + this._LineCtor = LineCtor || Line_default2; + } + updateData(lineData) { + this._progressiveEls = null; + const lineDraw = this; + const group = lineDraw.group; + const oldLineData = lineDraw._lineData; + lineDraw._lineData = lineData; + if (!oldLineData) { + group.removeAll(); + } + const seriesScope = makeSeriesScope2(lineData); + lineData.diff(oldLineData).add((idx) => { + this._doAdd(lineData, idx, seriesScope); + }).update((newIdx, oldIdx) => { + this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope); + }).remove((idx) => { + group.remove(oldLineData.getItemGraphicEl(idx)); + }).execute(); + } + updateLayout() { + const lineData = this._lineData; + if (!lineData) { + return; + } + lineData.eachItemGraphicEl(function(el, idx) { + el.updateLayout(lineData, idx); + }, this); + } + incrementalPrepareUpdate(lineData) { + this._seriesScope = makeSeriesScope2(lineData); + this._lineData = null; + this.group.removeAll(); + } + incrementalUpdate(taskParams, lineData) { + this._progressiveEls = []; + function updateIncrementalAndHover(el) { + if (!el.isGroup && !isEffectObject(el)) { + el.incremental = true; + el.ensureState("emphasis").hoverLayer = true; + } + } + for (let idx = taskParams.start; idx < taskParams.end; idx++) { + const itemLayout = lineData.getItemLayout(idx); + if (lineNeedsDraw(itemLayout)) { + const el = new this._LineCtor(lineData, idx, this._seriesScope); + el.traverse(updateIncrementalAndHover); + this.group.add(el); + lineData.setItemGraphicEl(idx, el); + this._progressiveEls.push(el); + } + } + } + remove() { + this.group.removeAll(); + } + eachRendered(cb) { + traverseElements(this._progressiveEls || this.group, cb); + } + _doAdd(lineData, idx, seriesScope) { + const itemLayout = lineData.getItemLayout(idx); + if (!lineNeedsDraw(itemLayout)) { + return; + } + const el = new this._LineCtor(lineData, idx, seriesScope); + lineData.setItemGraphicEl(idx, el); + this.group.add(el); + } + _doUpdate(oldLineData, newLineData, oldIdx, newIdx, seriesScope) { + let itemEl = oldLineData.getItemGraphicEl(oldIdx); + if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) { + this.group.remove(itemEl); + return; + } + if (!itemEl) { + itemEl = new this._LineCtor(newLineData, newIdx, seriesScope); + } else { + itemEl.updateData(newLineData, newIdx, seriesScope); + } + newLineData.setItemGraphicEl(newIdx, itemEl); + this.group.add(itemEl); + } +}; +function isEffectObject(el) { + return el.animators && el.animators.length > 0; +} +function makeSeriesScope2(lineData) { + const hostModel = lineData.hostModel; + const emphasisModel = hostModel.getModel("emphasis"); + return { + lineStyle: hostModel.getModel("lineStyle").getLineStyle(), + emphasisLineStyle: emphasisModel.getModel(["lineStyle"]).getLineStyle(), + blurLineStyle: hostModel.getModel(["blur", "lineStyle"]).getLineStyle(), + selectLineStyle: hostModel.getModel(["select", "lineStyle"]).getLineStyle(), + emphasisDisabled: emphasisModel.get("disabled"), + blurScope: emphasisModel.get("blurScope"), + focus: emphasisModel.get("focus"), + labelStatesModels: getLabelStatesModels(hostModel) + }; +} +function isPointNaN(pt) { + return isNaN(pt[0]) || isNaN(pt[1]); +} +function lineNeedsDraw(pts) { + return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]); +} +var LineDraw_default = LineDraw; + +// src/chart/graph/adjustEdge.ts +var v1 = []; +var v2 = []; +var v3 = []; +var quadraticAt2 = quadraticAt; +var v2DistSquare = distSquare; +var mathAbs3 = Math.abs; +function intersectCurveCircle(curvePoints, center3, radius) { + const p0 = curvePoints[0]; + const p1 = curvePoints[1]; + const p2 = curvePoints[2]; + let d = Infinity; + let t; + const radiusSquare = radius * radius; + let interval = 0.1; + for (let _t = 0.1; _t <= 0.9; _t += 0.1) { + v1[0] = quadraticAt2(p0[0], p1[0], p2[0], _t); + v1[1] = quadraticAt2(p0[1], p1[1], p2[1], _t); + const diff = mathAbs3(v2DistSquare(v1, center3) - radiusSquare); + if (diff < d) { + d = diff; + t = _t; + } + } + for (let i = 0; i < 32; i++) { + const next = t + interval; + v2[0] = quadraticAt2(p0[0], p1[0], p2[0], t); + v2[1] = quadraticAt2(p0[1], p1[1], p2[1], t); + v3[0] = quadraticAt2(p0[0], p1[0], p2[0], next); + v3[1] = quadraticAt2(p0[1], p1[1], p2[1], next); + const diff = v2DistSquare(v2, center3) - radiusSquare; + if (mathAbs3(diff) < 0.01) { + break; + } + const nextDiff = v2DistSquare(v3, center3) - radiusSquare; + interval /= 2; + if (diff < 0) { + if (nextDiff >= 0) { + t = t + interval; + } else { + t = t - interval; + } + } else { + if (nextDiff >= 0) { + t = t - interval; + } else { + t = t + interval; + } + } + } + return t; +} +function adjustEdge(graph, scale4) { + const tmp0 = []; + const quadraticSubdivide2 = quadraticSubdivide; + const pts = [[], [], []]; + const pts2 = [[], []]; + const v = []; + scale4 /= 2; + graph.eachEdge(function(edge, idx) { + const linePoints = edge.getLayout(); + const fromSymbol = edge.getVisual("fromSymbol"); + const toSymbol = edge.getVisual("toSymbol"); + if (!linePoints.__original) { + linePoints.__original = [ + clone2(linePoints[0]), + clone2(linePoints[1]) + ]; + if (linePoints[2]) { + linePoints.__original.push(clone2(linePoints[2])); + } + } + const originalPoints = linePoints.__original; + if (linePoints[2] != null) { + copy(pts[0], originalPoints[0]); + copy(pts[1], originalPoints[2]); + copy(pts[2], originalPoints[1]); + if (fromSymbol && fromSymbol !== "none") { + const symbolSize = getSymbolSize(edge.node1); + const t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale4); + quadraticSubdivide2(pts[0][0], pts[1][0], pts[2][0], t, tmp0); + pts[0][0] = tmp0[3]; + pts[1][0] = tmp0[4]; + quadraticSubdivide2(pts[0][1], pts[1][1], pts[2][1], t, tmp0); + pts[0][1] = tmp0[3]; + pts[1][1] = tmp0[4]; + } + if (toSymbol && toSymbol !== "none") { + const symbolSize = getSymbolSize(edge.node2); + const t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale4); + quadraticSubdivide2(pts[0][0], pts[1][0], pts[2][0], t, tmp0); + pts[1][0] = tmp0[1]; + pts[2][0] = tmp0[2]; + quadraticSubdivide2(pts[0][1], pts[1][1], pts[2][1], t, tmp0); + pts[1][1] = tmp0[1]; + pts[2][1] = tmp0[2]; + } + copy(linePoints[0], pts[0]); + copy(linePoints[1], pts[2]); + copy(linePoints[2], pts[1]); + } else { + copy(pts2[0], originalPoints[0]); + copy(pts2[1], originalPoints[1]); + sub(v, pts2[1], pts2[0]); + normalize(v, v); + if (fromSymbol && fromSymbol !== "none") { + const symbolSize = getSymbolSize(edge.node1); + scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale4); + } + if (toSymbol && toSymbol !== "none") { + const symbolSize = getSymbolSize(edge.node2); + scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale4); + } + copy(linePoints[0], pts2[0]); + copy(linePoints[1], pts2[1]); + } + }); +} + +// src/chart/graph/GraphView.ts +function isViewCoordSys(coordSys) { + return coordSys.type === "view"; +} +var GraphView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = GraphView2.type; + } + init(ecModel, api2) { + const symbolDraw = new SymbolDraw_default(); + const lineDraw = new LineDraw_default(); + const group = this.group; + this._controller = new RoamController_default(api2.getZr()); + this._controllerHost = { + target: group + }; + group.add(symbolDraw.group); + group.add(lineDraw.group); + this._symbolDraw = symbolDraw; + this._lineDraw = lineDraw; + this._firstRender = true; + } + render(seriesModel, ecModel, api2) { + const coordSys = seriesModel.coordinateSystem; + this._model = seriesModel; + const symbolDraw = this._symbolDraw; + const lineDraw = this._lineDraw; + const group = this.group; + if (isViewCoordSys(coordSys)) { + const groupNewProp = { + x: coordSys.x, + y: coordSys.y, + scaleX: coordSys.scaleX, + scaleY: coordSys.scaleY + }; + if (this._firstRender) { + group.attr(groupNewProp); + } else { + updateProps(group, groupNewProp, seriesModel); + } + } + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); + const data = seriesModel.getData(); + symbolDraw.updateData(data); + const edgeData = seriesModel.getEdgeData(); + lineDraw.updateData(edgeData); + this._updateNodeAndLinkScale(); + this._updateController(seriesModel, ecModel, api2); + clearTimeout(this._layoutTimeout); + const forceLayout2 = seriesModel.forceLayout; + const layoutAnimation = seriesModel.get(["force", "layoutAnimation"]); + if (forceLayout2) { + this._startForceLayoutIteration(forceLayout2, layoutAnimation); + } + const layout18 = seriesModel.get("layout"); + data.graph.eachNode((node) => { + const idx = node.dataIndex; + const el = node.getGraphicEl(); + const itemModel = node.getModel(); + if (!el) { + return; + } + el.off("drag").off("dragend"); + const draggable = itemModel.get("draggable"); + if (draggable) { + el.on("drag", (e2) => { + switch (layout18) { + case "force": + forceLayout2.warmUp(); + !this._layouting && this._startForceLayoutIteration(forceLayout2, layoutAnimation); + forceLayout2.setFixed(idx); + data.setItemLayout(idx, [el.x, el.y]); + break; + case "circular": + data.setItemLayout(idx, [el.x, el.y]); + node.setLayout({fixed: true}, true); + circularLayout(seriesModel, "symbolSize", node, [e2.offsetX, e2.offsetY]); + this.updateLayout(seriesModel); + break; + case "none": + default: + data.setItemLayout(idx, [el.x, el.y]); + simpleLayoutEdge(seriesModel.getGraph(), seriesModel); + this.updateLayout(seriesModel); + break; } - each(areas, function (area) { - if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) { - rangeInfoList.push(area); - } - hasBrushExists = hasBrushExists || brushed(rangeInfoList); - }); - if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { - var data_1 = seriesModel.getData(); - data_1.each(function (dataIndex) { - if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) { - selectedDataIndexForLink[dataIndex] = 1; - } - }); + }).on("dragend", () => { + if (forceLayout2) { + forceLayout2.setUnfixed(idx); } - } - // 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 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(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush'; - }; - // If no supported brush or no brush, all visuals are in original state. - (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual(STATE_LIST, visualMappings, data, getValueState); }); - }); - 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; + el.setDraggable(draggable, !!itemModel.get("cursor")); + const focus = itemModel.get(["emphasis", "focus"]); + if (focus === "adjacency") { + getECData(el).focus = node.getAdjacentDataIndices(); } - if (!zr[DISPATCH_METHOD]) { - zr[DISPATCH_METHOD] = doDispatch; + }); + data.graph.eachEdge(function(edge) { + const el = edge.getGraphicEl(); + const focus = edge.getModel().get(["emphasis", "focus"]); + if (!el) { + return; } - var fn = 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; + if (focus === "adjacency") { + getECData(el).focus = { + edge: [edge.dataIndex], + node: [edge.node1.dataIndex, edge.node2.dataIndex] + }; } - } - function checkInRange(seriesModel, rangeInfoList, data, dataIndex) { - for (var i = 0, len = rangeInfoList.length; i < len; i++) { - var area = rangeInfoList[i]; - if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) { - return true; + }); + const circularRotateLabel = seriesModel.get("layout") === "circular" && seriesModel.get(["circular", "rotateLabel"]); + const cx = data.getLayout("cx"); + const cy = data.getLayout("cy"); + data.graph.eachNode((node) => { + rotateNodeLabel(node, circularRotateLabel, cx, cy); + }); + this._firstRender = false; + } + dispose() { + this.remove(); + this._controller && this._controller.dispose(); + this._controllerHost = null; + } + _startForceLayoutIteration(forceLayout2, layoutAnimation) { + const self2 = this; + (function step() { + forceLayout2.step(function(stopped) { + self2.updateLayout(self2._model); + (self2._layouting = !stopped) && (layoutAnimation ? self2._layoutTimeout = setTimeout(step, 16) : step()); + }); + })(); + } + _updateController(seriesModel, ecModel, api2) { + const controller = this._controller; + const controllerHost = this._controllerHost; + const group = this.group; + controller.setPointerChecker(function(e2, x, y) { + const rect = group.getBoundingRect(); + rect.applyTransform(group.transform); + return rect.contain(x, y) && !onIrrelevantElement(e2, api2, seriesModel); + }); + if (!isViewCoordSys(seriesModel.coordinateSystem)) { + 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", (e2) => { + updateViewOnPan(controllerHost, e2.dx, e2.dy); + api2.dispatchAction({ + seriesId: seriesModel.id, + type: "graphRoam", + dx: e2.dx, + dy: e2.dy + }); + }).on("zoom", (e2) => { + updateViewOnZoom(controllerHost, e2.scale, e2.originX, e2.originY); + api2.dispatchAction({ + seriesId: seriesModel.id, + type: "graphRoam", + zoom: e2.scale, + originX: e2.originX, + originY: e2.originY + }); + this._updateNodeAndLinkScale(); + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); + this._lineDraw.updateLayout(); + api2.updateLabelLayout(); + }); + } + _updateNodeAndLinkScale() { + const seriesModel = this._model; + const data = seriesModel.getData(); + const nodeScale = getNodeGlobalScale(seriesModel); + data.eachItemGraphicEl(function(el, idx) { + el && el.setSymbolScale(nodeScale); + }); + } + updateLayout(seriesModel) { + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); + this._symbolDraw.updateLayout(); + this._lineDraw.updateLayout(); + } + remove() { + clearTimeout(this._layoutTimeout); + this._layouting = false; + this._layoutTimeout = null; + this._symbolDraw && this._symbolDraw.remove(); + this._lineDraw && this._lineDraw.remove(); + } +}; +var GraphView = GraphView2; +GraphView.type = "graph"; +var GraphView_default = GraphView; + +// src/data/Graph.ts +function generateNodeKey(id) { + return "_EC_" + id; +} +var Graph = class { + constructor(directed) { + this.type = "graph"; + this.nodes = []; + this.edges = []; + this._nodesMap = {}; + this._edgesMap = {}; + this._directed = directed || false; + } + isDirected() { + return this._directed; + } + addNode(id, dataIndex) { + id = id == null ? "" + dataIndex : "" + id; + const nodesMap = this._nodesMap; + if (nodesMap[generateNodeKey(id)]) { + if (true) { + console.error("Graph nodes have duplicate name or id"); + } + return; + } + const node = new GraphNode(id, dataIndex); + node.hostGraph = this; + this.nodes.push(node); + nodesMap[generateNodeKey(id)] = node; + return node; + } + getNodeByIndex(dataIndex) { + const rawIdx = this.data.getRawIndex(dataIndex); + return this.nodes[rawIdx]; + } + getNodeById(id) { + return this._nodesMap[generateNodeKey(id)]; + } + addEdge(n1, n2, dataIndex) { + const nodesMap = this._nodesMap; + const edgesMap = this._edgesMap; + if (isNumber(n1)) { + n1 = this.nodes[n1]; + } + if (isNumber(n2)) { + n2 = this.nodes[n2]; + } + if (!(n1 instanceof GraphNode)) { + n1 = nodesMap[generateNodeKey(n1)]; + } + if (!(n2 instanceof GraphNode)) { + n2 = nodesMap[generateNodeKey(n2)]; + } + if (!n1 || !n2) { + return; + } + const key = n1.id + "-" + n2.id; + const edge = new GraphEdge(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; + } + getEdgeByIndex(dataIndex) { + const rawIdx = this.edgeData.getRawIndex(dataIndex); + return this.edges[rawIdx]; + } + getEdge(n1, n2) { + if (n1 instanceof GraphNode) { + n1 = n1.id; + } + if (n2 instanceof GraphNode) { + n2 = n2.id; + } + const edgesMap = this._edgesMap; + if (this._directed) { + return edgesMap[n1 + "-" + n2]; + } else { + return edgesMap[n1 + "-" + n2] || edgesMap[n2 + "-" + n1]; + } + } + eachNode(cb, context) { + const nodes = this.nodes; + const len2 = nodes.length; + for (let i = 0; i < len2; i++) { + if (nodes[i].dataIndex >= 0) { + cb.call(context, nodes[i], i); + } + } + } + eachEdge(cb, context) { + const edges = this.edges; + const len2 = edges.length; + for (let i = 0; i < len2; i++) { + if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) { + cb.call(context, edges[i], i); + } + } + } + breadthFirstTraverse(cb, startNode, direction, context) { + if (!(startNode instanceof GraphNode)) { + startNode = this._nodesMap[generateNodeKey(startNode)]; + } + if (!startNode) { + return; + } + const edgeType = direction === "out" ? "outEdges" : direction === "in" ? "inEdges" : "edges"; + for (let i = 0; i < this.nodes.length; i++) { + this.nodes[i].__visited = false; + } + if (cb.call(context, startNode, null)) { + return; + } + const queue = [startNode]; + while (queue.length) { + const currentNode = queue.shift(); + const edges = currentNode[edgeType]; + for (let i = 0; i < edges.length; i++) { + const e2 = edges[i]; + const otherNode = e2.node1 === currentNode ? e2.node2 : e2.node1; + if (!otherNode.__visited) { + if (cb.call(context, otherNode, currentNode)) { + return; + } + queue.push(otherNode); + otherNode.__visited = true; } } } - function brushModelNotControll(brushModel, seriesIndex) { - var seriesIndices = brushModel.option.seriesIndex; - return seriesIndices != null && seriesIndices !== 'all' && (isArray(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices); + } + update() { + const data = this.data; + const edgeData = this.edgeData; + const nodes = this.nodes; + const edges = this.edges; + for (let i = 0, len2 = nodes.length; i < len2; i++) { + nodes[i].dataIndex = -1; } - var boundingRectBuilders = { - 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); - } + for (let i = 0, len2 = data.count(); i < len2; i++) { + nodes[data.getRawIndex(i)].dataIndex = i; + } + edgeData.filterSelf(function(idx) { + const edge = edges[edgeData.getRawIndex(idx)]; + return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0; + }); + for (let i = 0, len2 = edges.length; i < len2; i++) { + edges[i].dataIndex = -1; + } + for (let i = 0, len2 = edgeData.count(); i < len2; i++) { + edges[edgeData.getRawIndex(i)].dataIndex = i; + } + } + clone() { + const graph = new Graph(this._directed); + const nodes = this.nodes; + const edges = this.edges; + for (let i = 0; i < nodes.length; i++) { + graph.addNode(nodes[i].id, nodes[i].dataIndex); + } + for (let i = 0; i < edges.length; i++) { + const e2 = edges[i]; + graph.addEdge(e2.node1.id, e2.node2.id, e2.dataIndex); + } + return graph; + } +}; +var GraphNode = class { + constructor(id, dataIndex) { + this.inEdges = []; + this.outEdges = []; + this.edges = []; + this.dataIndex = -1; + this.id = id == null ? "" : id; + this.dataIndex = dataIndex == null ? -1 : dataIndex; + } + degree() { + return this.edges.length; + } + inDegree() { + return this.inEdges.length; + } + outDegree() { + return this.outEdges.length; + } + getModel(path) { + if (this.dataIndex < 0) { + return; + } + const graph = this.hostGraph; + const itemModel = graph.data.getItemModel(this.dataIndex); + return itemModel.getModel(path); + } + getAdjacentDataIndices() { + const dataIndices = { + edge: [], + node: [] }; - function getBoundingRectFromMinMax(minMax) { - return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]); - } - - var BrushView = /** @class */function (_super) { - __extends(BrushView, _super); - function BrushView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BrushView.type; - return _this; - } - BrushView.prototype.init = function (ecModel, api) { - this.ecModel = ecModel; - this.api = api; - this.model; - (this._brushController = new BrushController(api.getZr())).on('brush', bind(this._onBrush, this)).mount(); - }; - BrushView.prototype.render = function (brushModel, ecModel, api, payload) { - this.model = brushModel; - this._updateController(brushModel, ecModel, api, payload); - }; - BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) { - // PENDING: `updateTransform` is a little tricky, whose layout need - // to be calculate mandatorily and other stages will not be performed. - // Take care the correctness of the logic. See #11754 . - layoutCovers(ecModel); - this._updateController(brushModel, ecModel, api, payload); - }; - BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) { - this.updateTransform(brushModel, ecModel, api, payload); - }; - BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) { - this._updateController(brushModel, ecModel, api, payload); - }; - BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) { - // Do not update controller when drawing. - (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice()); - }; - // updateLayout: updateController, - // updateVisual: updateController, - BrushView.prototype.dispose = function () { - this._brushController.dispose(); - }; - BrushView.prototype._onBrush = function (eventParam) { - var modelId = this.model.id; - var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel); - // Action is not dispatched on drag end, because the drag end - // emits the same params with the last drag move event, and - // may have some delay when using touch pad, which makes - // animation not smooth (when using debounce). - (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({ - type: 'brush', - brushId: modelId, - areas: clone(areas), - $from: modelId - }); - eventParam.isEnd && this.api.dispatchAction({ - type: 'brushEnd', - brushId: modelId, - areas: clone(areas), - $from: modelId - }); - }; - BrushView.type = 'brush'; - return BrushView; - }(ComponentView); - - var DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd'; - var BrushModel = /** @class */function (_super) { - __extends(BrushModel, _super); - function BrushModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BrushModel.type; - /** - * @readOnly - */ - _this.areas = []; - /** - * Current brush painting area settings. - * @readOnly - */ - _this.brushOption = {}; - return _this; - } - BrushModel.prototype.optionUpdated = function (newOption, isInit) { - var thisOption = this.option; - !isInit && replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']); - var inBrush = thisOption.inBrush = thisOption.inBrush || {}; - // Always give default visual, consider setOption at the second time. - thisOption.outOfBrush = thisOption.outOfBrush || { - color: DEFAULT_OUT_OF_BRUSH_COLOR - }; - if (!inBrush.hasOwnProperty('liftZ')) { - // Bigger than the highlight z lift, otherwise it will - // be effected by the highlight z when brush. - inBrush.liftZ = 5; - } - }; - /** - * If `areas` is null/undefined, range state remain. - */ - BrushModel.prototype.setAreas = function (areas) { - if ("development" !== 'production') { - assert(isArray(areas)); - each(areas, function (area) { - assert(area.brushType, 'Illegal areas'); - }); - } - // If areas is null/undefined, range state remain. - // This helps user to dispatchAction({type: 'brush'}) with no areas - // set but just want to get the current brush select info from a `brush` event. - if (!areas) { - return; - } - this.areas = map(areas, function (area) { - return generateBrushOption(this.option, area); - }, this); - }; - /** - * Set the current painting brush option. - */ - BrushModel.prototype.setBrushOption = function (brushOption) { - this.brushOption = generateBrushOption(this.option, brushOption); - this.brushType = this.brushOption.brushType; - }; - BrushModel.type = 'brush'; - BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series']; - BrushModel.defaultOption = { - seriesIndex: 'all', - brushType: 'rect', - brushMode: 'single', - transformable: true, - brushStyle: { - borderWidth: 1, - color: 'rgba(210,219,238,0.3)', - borderColor: '#D2DBEE' - }, - throttleType: 'fixRate', - throttleDelay: 0, - removeOnClick: true, - z: 10000 - }; - return BrushModel; - }(ComponentModel); - function generateBrushOption(option, brushOption) { - return merge({ - brushType: option.brushType, - brushMode: option.brushMode, - transformable: option.transformable, - brushStyle: new Model(option.brushStyle).getItemStyle(), - removeOnClick: option.removeOnClick, - z: option.z - }, brushOption, true); - } - - var ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear']; - var BrushFeature = /** @class */function (_super) { - __extends(BrushFeature, _super); - function BrushFeature() { - return _super !== null && _super.apply(this, arguments) || this; - } - BrushFeature.prototype.render = 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 = isBrushed || !!brushModel.areas.length; - }); - this._brushType = brushType; - this._brushMode = brushMode; - each(featureModel.get('type', true), function (type) { - featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal'); - }); - }; - BrushFeature.prototype.updateView = function (featureModel, ecModel, api) { - this.render(featureModel, ecModel, api); - }; - BrushFeature.prototype.getIcons = function () { - var model = this.model; - var availableIcons = model.get('icon', true); - var icons = {}; - each(model.get('type', true), function (type) { - if (availableIcons[type]) { - icons[type] = availableIcons[type]; - } - }); - return icons; - }; - BrushFeature.prototype.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 - } - }); - } - }; - BrushFeature.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - type: ICON_TYPES.slice(), - 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', - 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', - 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', - 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', - 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', - 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: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title']) - }; - return defaultOption; - }; - return BrushFeature; - }(ToolboxFeature); - - function install$B(registers) { - registers.registerComponentView(BrushView); - registers.registerComponentModel(BrushModel); - registers.registerPreprocessor(brushPreprocessor); - registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual); - registers.registerAction({ - type: 'brush', - event: 'brush', - update: 'updateVisual' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'brush', - query: payload - }, function (brushModel) { - brushModel.setAreas(payload.areas); - }); + for (let i = 0; i < this.edges.length; i++) { + const adjacentEdge = this.edges[i]; + if (adjacentEdge.dataIndex < 0) { + continue; + } + dataIndices.edge.push(adjacentEdge.dataIndex); + dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex); + } + return dataIndices; + } + getTrajectoryDataIndices() { + const connectedEdgesMap = createHashMap(); + const connectedNodesMap = createHashMap(); + for (let i = 0; i < this.edges.length; i++) { + const adjacentEdge = this.edges[i]; + if (adjacentEdge.dataIndex < 0) { + continue; + } + connectedEdgesMap.set(adjacentEdge.dataIndex, true); + const sourceNodesQueue = [adjacentEdge.node1]; + const targetNodesQueue = [adjacentEdge.node2]; + let nodeIteratorIndex = 0; + while (nodeIteratorIndex < sourceNodesQueue.length) { + const sourceNode = sourceNodesQueue[nodeIteratorIndex]; + nodeIteratorIndex++; + connectedNodesMap.set(sourceNode.dataIndex, true); + for (let j = 0; j < sourceNode.inEdges.length; j++) { + connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true); + sourceNodesQueue.push(sourceNode.inEdges[j].node1); + } + } + nodeIteratorIndex = 0; + while (nodeIteratorIndex < targetNodesQueue.length) { + const targetNode = targetNodesQueue[nodeIteratorIndex]; + nodeIteratorIndex++; + connectedNodesMap.set(targetNode.dataIndex, true); + for (let j = 0; j < targetNode.outEdges.length; j++) { + connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true); + targetNodesQueue.push(targetNode.outEdges[j].node2); + } + } + } + return { + edge: connectedEdgesMap.keys(), + node: connectedNodesMap.keys() + }; + } +}; +var GraphEdge = class { + constructor(n1, n2, dataIndex) { + this.dataIndex = -1; + this.node1 = n1; + this.node2 = n2; + this.dataIndex = dataIndex == null ? -1 : dataIndex; + } + getModel(path) { + if (this.dataIndex < 0) { + return; + } + const graph = this.hostGraph; + const itemModel = graph.edgeData.getItemModel(this.dataIndex); + return itemModel.getModel(path); + } + getAdjacentDataIndices() { + return { + edge: [this.dataIndex], + node: [this.node1.dataIndex, this.node2.dataIndex] + }; + } + getTrajectoryDataIndices() { + const connectedEdgesMap = createHashMap(); + const connectedNodesMap = createHashMap(); + connectedEdgesMap.set(this.dataIndex, true); + const sourceNodes = [this.node1]; + const targetNodes = [this.node2]; + let nodeIteratorIndex = 0; + while (nodeIteratorIndex < sourceNodes.length) { + const sourceNode = sourceNodes[nodeIteratorIndex]; + nodeIteratorIndex++; + connectedNodesMap.set(sourceNode.dataIndex, true); + for (let j = 0; j < sourceNode.inEdges.length; j++) { + connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true); + sourceNodes.push(sourceNode.inEdges[j].node1); + } + } + nodeIteratorIndex = 0; + while (nodeIteratorIndex < targetNodes.length) { + const targetNode = targetNodes[nodeIteratorIndex]; + nodeIteratorIndex++; + connectedNodesMap.set(targetNode.dataIndex, true); + for (let j = 0; j < targetNode.outEdges.length; j++) { + connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true); + targetNodes.push(targetNode.outEdges[j].node2); + } + } + return { + edge: connectedEdgesMap.keys(), + node: connectedNodesMap.keys() + }; + } +}; +function createGraphDataProxyMixin(hostName, dataName) { + return { + getValue(dimension) { + const data = this[hostName][dataName]; + return data.getStore().get(data.getDimensionIndex(dimension || "value"), this.dataIndex); + }, + setVisual(key, value) { + this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value); + }, + getVisual(key) { + return this[hostName][dataName].getItemVisual(this.dataIndex, key); + }, + setLayout(layout18, merge2) { + this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout18, merge2); + }, + getLayout() { + return this[hostName][dataName].getItemLayout(this.dataIndex); + }, + getGraphicEl() { + return this[hostName][dataName].getItemGraphicEl(this.dataIndex); + }, + getRawIndex() { + return this[hostName][dataName].getRawIndex(this.dataIndex); + } + }; +} +mixin(GraphNode, createGraphDataProxyMixin("hostGraph", "data")); +mixin(GraphEdge, createGraphDataProxyMixin("hostGraph", "edgeData")); +var Graph_default = Graph; + +// src/chart/helper/createGraphFromNodeEdge.ts +function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) { + const graph = new Graph_default(directed); + for (let i = 0; i < nodes.length; i++) { + graph.addNode(retrieve(nodes[i].id, nodes[i].name, i), i); + } + const linkNameList = []; + const validEdges = []; + let linkCount = 0; + for (let i = 0; i < edges.length; i++) { + const link = edges[i]; + const source = link.source; + const target = link.target; + if (graph.addEdge(source, target, linkCount)) { + validEdges.push(link); + linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + " > " + target)); + linkCount++; + } + } + const coordSys = seriesModel.get("coordinateSystem"); + let nodeData; + if (coordSys === "cartesian2d" || coordSys === "polar") { + nodeData = createSeriesData_default(nodes, seriesModel); + } else { + const coordSysCtor = CoordinateSystem_default.get(coordSys); + const coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : []; + if (indexOf(coordDimensions, "value") < 0) { + coordDimensions.concat(["value"]); + } + const {dimensions} = prepareSeriesDataSchema(nodes, { + coordDimensions, + encodeDefine: seriesModel.getEncode() + }); + nodeData = new SeriesData_default(dimensions, seriesModel); + nodeData.initData(nodes); + } + const edgeData = new SeriesData_default(["value"], seriesModel); + edgeData.initData(validEdges, linkNameList); + beforeLink && beforeLink(nodeData, edgeData); + linkSeriesData_default({ + mainData: nodeData, + struct: graph, + structAttr: "graph", + datas: {node: nodeData, edge: edgeData}, + datasAttr: {node: "data", edge: "edgeData"} + }); + graph.update(); + return graph; +} + +// src/chart/graph/GraphSeries.ts +var GraphSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = GraphSeriesModel2.type; + this.hasSymbolVisual = true; + } + init(option) { + super.init.apply(this, arguments); + const self2 = this; + function getCategoriesData() { + return self2._categoriesData; + } + this.legendVisualProvider = new LegendVisualProvider_default(getCategoriesData, getCategoriesData); + this.fillDataTextStyle(option.edges || option.links); + this._updateCategoriesData(); + } + mergeOption(option) { + super.mergeOption.apply(this, arguments); + this.fillDataTextStyle(option.edges || option.links); + this._updateCategoriesData(); + } + mergeDefaultAndTheme(option) { + super.mergeDefaultAndTheme.apply(this, arguments); + defaultEmphasis(option, "edgeLabel", ["show"]); + } + getInitialData(option, ecModel) { + const edges = option.edges || option.links || []; + const nodes = option.data || option.nodes || []; + const self2 = this; + if (nodes && edges) { + initCurvenessList(this); + const graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink); + each(graph.edges, function(edge) { + createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex); + }, this); + return graph.data; + } + function beforeLink(nodeData, edgeData) { + nodeData.wrapMethod("getItemModel", function(model) { + const categoriesModels = self2._categoriesModels; + const categoryIdx = model.getShallow("category"); + const categoryModel = categoriesModels[categoryIdx]; + if (categoryModel) { + categoryModel.parentModel = model.parentModel; + model.parentModel = categoryModel; + } + return model; + }); + const oldGetModel = Model_default.prototype.getModel; + function newGetModel(path, parentModel) { + const model = oldGetModel.call(this, path, parentModel); + model.resolveParentPath = resolveParentPath; + return model; + } + edgeData.wrapMethod("getItemModel", function(model) { + model.resolveParentPath = resolveParentPath; + model.getModel = newGetModel; + return model; + }); + function resolveParentPath(pathArr) { + if (pathArr && (pathArr[0] === "label" || pathArr[1] === "label")) { + const newPathArr = pathArr.slice(); + if (pathArr[0] === "label") { + newPathArr[0] = "edgeLabel"; + } else if (pathArr[1] === "label") { + newPathArr[1] = "edgeLabel"; + } + return newPathArr; + } + return pathArr; + } + } + } + getGraph() { + return this.getData().graph; + } + getEdgeData() { + return this.getGraph().edgeData; + } + getCategoriesData() { + return this._categoriesData; + } + formatTooltip(dataIndex, multipleSeries, dataType) { + if (dataType === "edge") { + const nodeData = this.getData(); + const params = this.getDataParams(dataIndex, dataType); + const edge = nodeData.graph.getEdgeByIndex(dataIndex); + const sourceName = nodeData.getName(edge.node1.dataIndex); + const targetName = nodeData.getName(edge.node2.dataIndex); + const nameArr = []; + sourceName != null && nameArr.push(sourceName); + targetName != null && nameArr.push(targetName); + return createTooltipMarkup("nameValue", { + name: nameArr.join(" > "), + value: params.value, + noValue: params.value == null }); - /** - * payload: { - * brushComponents: [ - * { - * brushId, - * brushIndex, - * brushName, - * series: [ - * { - * seriesId, - * seriesIndex, - * seriesName, - * rawIndices: [21, 34, ...] - * }, - * ... - * ] - * }, - * ... - * ] - * } - */ - registers.registerAction({ - type: 'brushSelect', - event: 'brushSelected', - update: 'none' - }, noop); - registers.registerAction({ - type: 'brushEnd', - event: 'brushEnd', - update: 'none' - }, noop); - registerFeature('brush', BrushFeature); - } - - var TitleModel = /** @class */function (_super) { - __extends(TitleModel, _super); - function TitleModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TitleModel.type; - _this.layoutMode = { - type: 'box', - ignoreSize: true - }; - return _this; - } - TitleModel.type = 'title'; - TitleModel.defaultOption = { - // zlevel: 0, - z: 6, - show: true, - text: '', - target: 'blank', - subtext: '', - subtarget: 'blank', - left: 0, - top: 0, - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - borderWidth: 0, - padding: 5, - itemGap: 10, - textStyle: { - fontSize: 18, - fontWeight: 'bold', - color: '#464646' + } + const nodeMarkup = defaultSeriesFormatTooltip({ + series: this, + dataIndex, + multipleSeries + }); + return nodeMarkup; + } + _updateCategoriesData() { + const categories = map(this.option.categories || [], function(category) { + return category.value != null ? category : extend({ + value: 0 + }, category); + }); + const categoriesData = new SeriesData_default(["value"], this); + categoriesData.initData(categories); + this._categoriesData = categoriesData; + this._categoriesModels = categoriesData.mapArray(function(idx) { + return categoriesData.getItemModel(idx); + }); + } + setZoom(zoom) { + this.option.zoom = zoom; + } + setCenter(center3) { + this.option.center = center3; + } + isAnimationEnabled() { + return super.isAnimationEnabled() && !(this.get("layout") === "force" && this.get(["force", "layoutAnimation"])); + } +}; +var GraphSeriesModel = GraphSeriesModel2; +GraphSeriesModel.type = "series.graph"; +GraphSeriesModel.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"]; +GraphSeriesModel.defaultOption = { + z: 2, + coordinateSystem: "view", + legendHoverLink: true, + layout: null, + circular: { + rotateLabel: false + }, + force: { + initLayout: null, + repulsion: [0, 50], + gravity: 0.1, + friction: 0.6, + edgeLength: 30, + layoutAnimation: true + }, + left: "center", + top: "center", + symbol: "circle", + symbolSize: 10, + edgeSymbol: ["none", "none"], + edgeSymbolSize: 10, + edgeLabel: { + position: "middle", + distance: 5 + }, + draggable: false, + roam: false, + center: null, + zoom: 1, + nodeScaleRatio: 0.6, + label: { + show: false, + formatter: "{b}" + }, + itemStyle: {}, + lineStyle: { + color: "#aaa", + width: 1, + opacity: 0.5 + }, + emphasis: { + scale: true, + label: { + show: true + } + }, + select: { + itemStyle: { + borderColor: "#212121" + } + } +}; +var GraphSeries_default = GraphSeriesModel; + +// src/chart/graph/install.ts +var actionInfo = { + type: "graphRoam", + event: "graphRoam", + update: "none" +}; +function install14(registers) { + registers.registerChartView(GraphView_default); + registers.registerSeriesModel(GraphSeries_default); + registers.registerProcessor(categoryFilter); + registers.registerVisual(categoryVisual); + registers.registerVisual(graphEdgeVisual); + registers.registerLayout(graphSimpleLayout); + registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout); + registers.registerLayout(graphForceLayout); + registers.registerCoordinateSystem("graphView", { + dimensions: View_default.dimensions, + create: createViewCoordSys + }); + registers.registerAction({ + type: "focusNodeAdjacency", + event: "focusNodeAdjacency", + update: "series:focusNodeAdjacency" + }, noop); + registers.registerAction({ + type: "unfocusNodeAdjacency", + event: "unfocusNodeAdjacency", + update: "series:unfocusNodeAdjacency" + }, noop); + registers.registerAction(actionInfo, function(payload, ecModel, api2) { + ecModel.eachComponent({ + mainType: "series", + query: payload + }, function(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + const res = updateCenterAndZoom(coordSys, payload, void 0, api2); + seriesModel.setCenter && seriesModel.setCenter(res.center); + seriesModel.setZoom && seriesModel.setZoom(res.zoom); + }); + }); +} + +// src/chart/gauge/PointerPath.ts +var PointerShape = class { + constructor() { + this.angle = 0; + this.width = 10; + this.r = 10; + this.x = 0; + this.y = 0; + } +}; +var PointerPath = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "pointer"; + } + getDefaultShape() { + return new PointerShape(); + } + buildPath(ctx, shape) { + const mathCos6 = Math.cos; + const mathSin6 = Math.sin; + const r = shape.r; + const width = shape.width; + let angle = shape.angle; + const x = shape.x - mathCos6(angle) * width * (width >= r / 3 ? 1 : 2); + const y = shape.y - mathSin6(angle) * width * (width >= r / 3 ? 1 : 2); + angle = shape.angle - Math.PI / 2; + ctx.moveTo(x, y); + ctx.lineTo(shape.x + mathCos6(angle) * width, shape.y + mathSin6(angle) * width); + ctx.lineTo(shape.x + mathCos6(shape.angle) * r, shape.y + mathSin6(shape.angle) * r); + ctx.lineTo(shape.x - mathCos6(angle) * width, shape.y - mathSin6(angle) * width); + ctx.lineTo(x, y); + } +}; +var PointerPath_default = PointerPath; + +// src/chart/gauge/GaugeView.ts +function parsePosition(seriesModel, api2) { + const center3 = seriesModel.get("center"); + const width = api2.getWidth(); + const height = api2.getHeight(); + const size = Math.min(width, height); + const cx = parsePercent2(center3[0], api2.getWidth()); + const cy = parsePercent2(center3[1], api2.getHeight()); + const r = parsePercent2(seriesModel.get("radius"), size / 2); + return { + cx, + cy, + r + }; +} +function formatLabel(value, labelFormatter) { + let label = value == null ? "" : value + ""; + if (labelFormatter) { + if (isString(labelFormatter)) { + label = labelFormatter.replace("{value}", label); + } else if (isFunction(labelFormatter)) { + label = labelFormatter(value); + } + } + return label; +} +var GaugeView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = GaugeView2.type; + } + render(seriesModel, ecModel, api2) { + this.group.removeAll(); + const colorList = seriesModel.get(["axisLine", "lineStyle", "color"]); + const posInfo = parsePosition(seriesModel, api2); + this._renderMain(seriesModel, ecModel, api2, colorList, posInfo); + this._data = seriesModel.getData(); + } + dispose() { + } + _renderMain(seriesModel, ecModel, api2, colorList, posInfo) { + const group = this.group; + const clockwise = seriesModel.get("clockwise"); + let startAngle = -seriesModel.get("startAngle") / 180 * Math.PI; + let endAngle = -seriesModel.get("endAngle") / 180 * Math.PI; + const axisLineModel = seriesModel.getModel("axisLine"); + const roundCap = axisLineModel.get("roundCap"); + const MainPath = roundCap ? sausage_default : Sector_default; + const showAxis = axisLineModel.get("show"); + const lineStyleModel = axisLineModel.getModel("lineStyle"); + const axisLineWidth = lineStyleModel.get("width"); + const angles = [startAngle, endAngle]; + normalizeArcAngles(angles, !clockwise); + startAngle = angles[0]; + endAngle = angles[1]; + const angleRangeSpan = endAngle - startAngle; + let prevEndAngle = startAngle; + const sectors = []; + for (let i = 0; showAxis && i < colorList.length; i++) { + const percent = Math.min(Math.max(colorList[i][0], 0), 1); + endAngle = startAngle + angleRangeSpan * percent; + const sector = new MainPath({ + shape: { + startAngle: prevEndAngle, + endAngle, + cx: posInfo.cx, + cy: posInfo.cy, + clockwise, + r0: posInfo.r - axisLineWidth, + r: posInfo.r }, - subtextStyle: { - fontSize: 12, - color: '#6E7079' - } - }; - return TitleModel; - }(ComponentModel); - // View - var TitleView = /** @class */function (_super) { - __extends(TitleView, _super); - function TitleView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TitleView.type; - return _this; - } - TitleView.prototype.render = function (titleModel, ecModel, api) { - this.group.removeAll(); - if (!titleModel.get('show')) { - return; + silent: true + }); + sector.setStyle({ + fill: colorList[i][1] + }); + sector.setStyle(lineStyleModel.getLineStyle(["color", "width"])); + sectors.push(sector); + prevEndAngle = endAngle; + } + sectors.reverse(); + each(sectors, (sector) => group.add(sector)); + const getColor2 = function(percent) { + if (percent <= 0) { + return colorList[0][1]; + } + let i; + for (i = 0; i < colorList.length; i++) { + if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) { + return colorList[i][1]; } - var group = this.group; - var textStyleModel = titleModel.getModel('textStyle'); - var subtextStyleModel = titleModel.getModel('subtextStyle'); - var textAlign = titleModel.get('textAlign'); - var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign')); - var textEl = new ZRText({ - style: createTextStyle(textStyleModel, { - text: titleModel.get('text'), - fill: textStyleModel.getTextColor() - }, { - disableBox: true - }), - z2: 10 - }); - var textRect = textEl.getBoundingRect(); - var subText = titleModel.get('subtext'); - var subTextEl = new ZRText({ - style: createTextStyle(subtextStyleModel, { - text: subText, - fill: subtextStyleModel.getTextColor(), - y: textRect.height + titleModel.get('itemGap'), - verticalAlign: 'top' - }, { - disableBox: true - }), - z2: 10 + } + return colorList[i - 1][1]; + }; + this._renderTicks(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth); + this._renderTitleAndDetail(seriesModel, ecModel, api2, getColor2, posInfo); + this._renderAnchor(seriesModel, posInfo); + this._renderPointer(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth); + } + _renderTicks(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { + const group = this.group; + const cx = posInfo.cx; + const cy = posInfo.cy; + const r = posInfo.r; + const minVal = +seriesModel.get("min"); + const maxVal = +seriesModel.get("max"); + const splitLineModel = seriesModel.getModel("splitLine"); + const tickModel = seriesModel.getModel("axisTick"); + const labelModel = seriesModel.getModel("axisLabel"); + const splitNumber = seriesModel.get("splitNumber"); + const subSplitNumber = tickModel.get("splitNumber"); + const splitLineLen = parsePercent2(splitLineModel.get("length"), r); + const tickLen = parsePercent2(tickModel.get("length"), r); + let angle = startAngle; + const step = (endAngle - startAngle) / splitNumber; + const subStep = step / subSplitNumber; + const splitLineStyle = splitLineModel.getModel("lineStyle").getLineStyle(); + const tickLineStyle = tickModel.getModel("lineStyle").getLineStyle(); + const splitLineDistance = splitLineModel.get("distance"); + let unitX; + let unitY; + for (let i = 0; i <= splitNumber; i++) { + unitX = Math.cos(angle); + unitY = Math.sin(angle); + if (splitLineModel.get("show")) { + const distance2 = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth; + const splitLine = new Line_default({ + shape: { + x1: unitX * (r - distance2) + cx, + y1: unitY * (r - distance2) + cy, + x2: unitX * (r - splitLineLen - distance2) + cx, + y2: unitY * (r - splitLineLen - distance2) + cy + }, + style: splitLineStyle, + silent: true }); - 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 (splitLineStyle.stroke === "auto") { + splitLine.setStyle({ + stroke: getColor2(i / splitNumber) }); } - if (sublink) { - subTextEl.on('click', function () { - windowOpen(sublink, '_' + titleModel.get('subtarget')); - }); + group.add(splitLine); + } + if (labelModel.get("show")) { + const distance2 = labelModel.get("distance") + splitLineDistance; + const label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get("formatter")); + const autoColor = getColor2(i / splitNumber); + const textStyleX = unitX * (r - splitLineLen - distance2) + cx; + const textStyleY = unitY * (r - splitLineLen - distance2) + cy; + const rotateType = labelModel.get("rotate"); + let rotate2 = 0; + if (rotateType === "radial") { + rotate2 = -angle + 2 * Math.PI; + if (rotate2 > Math.PI / 2) { + rotate2 += Math.PI; + } + } else if (rotateType === "tangential") { + rotate2 = -angle - Math.PI / 2; + } else if (isNumber(rotateType)) { + rotate2 = rotateType * Math.PI / 180; + } + if (rotate2 === 0) { + group.add(new Text_default({ + style: createTextStyle(labelModel, { + text: label, + x: textStyleX, + y: textStyleY, + verticalAlign: unitY < -0.8 ? "top" : unitY > 0.8 ? "bottom" : "middle", + align: unitX < -0.4 ? "left" : unitX > 0.4 ? "right" : "center" + }, { + inheritColor: autoColor + }), + silent: true + })); + } else { + group.add(new Text_default({ + style: createTextStyle(labelModel, { + text: label, + x: textStyleX, + y: textStyleY, + verticalAlign: "middle", + align: "center" + }, { + inheritColor: autoColor + }), + silent: true, + originX: textStyleX, + originY: textStyleY, + rotation: rotate2 + })); } - getECData(textEl).eventData = getECData(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'); - // @ts-ignore - 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 (tickModel.get("show") && i !== splitNumber) { + let distance2 = tickModel.get("distance"); + distance2 = distance2 ? distance2 + axisLineWidth : axisLineWidth; + for (let j = 0; j <= subSplitNumber; j++) { + unitX = Math.cos(angle); + unitY = Math.sin(angle); + const tickLine = new Line_default({ + shape: { + x1: unitX * (r - distance2) + cx, + y1: unitY * (r - distance2) + cy, + x2: unitX * (r - tickLen - distance2) + cx, + y2: unitY * (r - tickLen - distance2) + cy + }, + silent: true, + style: tickLineStyle + }); + if (tickLineStyle.stroke === "auto") { + tickLine.setStyle({ + stroke: getColor2((i + j / subSplitNumber) / splitNumber) + }); } + group.add(tickLine); + angle += subStep; } - if (!textVerticalAlign) { - textVerticalAlign = titleModel.get('top') || titleModel.get('bottom'); - // @ts-ignore - 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.x = layoutRect.x; - group.y = layoutRect.y; - group.markRedraw(); - var alignStyle = { - align: textAlign, - verticalAlign: 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 Rect({ + angle -= subStep; + } else { + angle += step; + } + } + } + _renderPointer(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { + const group = this.group; + const oldData = this._data; + const oldProgressData = this._progressEls; + const progressList = []; + const showPointer2 = seriesModel.get(["pointer", "show"]); + const progressModel = seriesModel.getModel("progress"); + const showProgress = progressModel.get("show"); + const data = seriesModel.getData(); + const valueDim = data.mapDimension("value"); + const minVal = +seriesModel.get("min"); + const maxVal = +seriesModel.get("max"); + const valueExtent = [minVal, maxVal]; + const angleExtent = [startAngle, endAngle]; + function createPointer(idx, angle) { + const itemModel = data.getItemModel(idx); + const pointerModel = itemModel.getModel("pointer"); + const pointerWidth = parsePercent2(pointerModel.get("width"), posInfo.r); + const pointerLength = parsePercent2(pointerModel.get("length"), posInfo.r); + const pointerStr = seriesModel.get(["pointer", "icon"]); + const pointerOffset = pointerModel.get("offsetCenter"); + const pointerOffsetX = parsePercent2(pointerOffset[0], posInfo.r); + const pointerOffsetY = parsePercent2(pointerOffset[1], posInfo.r); + const pointerKeepAspect = pointerModel.get("keepAspect"); + let pointer; + if (pointerStr) { + pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect); + } else { + pointer = new PointerPath_default({ 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); - }; - TitleView.type = 'title'; - return TitleView; - }(ComponentView); - function install$C(registers) { - registers.registerComponentModel(TitleModel); - registers.registerComponentView(TitleView); - } - - var TimelineModel = /** @class */function (_super) { - __extends(TimelineModel, _super); - function TimelineModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TimelineModel.type; - _this.layoutMode = 'box'; - return _this; - } - /** - * @override - */ - TimelineModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - this._initData(); - }; - /** - * @override - */ - TimelineModel.prototype.mergeOption = function (option) { - _super.prototype.mergeOption.apply(this, arguments); - this._initData(); - }; - TimelineModel.prototype.setCurrentIndex = function (currentIndex) { - if (currentIndex == null) { - currentIndex = this.option.currentIndex; + angle: -Math.PI / 2, + width: pointerWidth, + r: pointerLength, + x: pointerOffsetX, + y: pointerOffsetY + } + }); + } + pointer.rotation = -(angle + Math.PI / 2); + pointer.x = posInfo.cx; + pointer.y = posInfo.cy; + return pointer; + } + function createProgress(idx, endAngle2) { + const roundCap = progressModel.get("roundCap"); + const ProgressPath = roundCap ? sausage_default : Sector_default; + const isOverlap = progressModel.get("overlap"); + const progressWidth = isOverlap ? progressModel.get("width") : axisLineWidth / data.count(); + const r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth; + const r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth; + const progress = new ProgressPath({ + shape: { + startAngle, + endAngle: endAngle2, + cx: posInfo.cx, + cy: posInfo.cy, + clockwise, + r0, + r } - var count = this._data.count(); - if (this.option.loop) { - currentIndex = (currentIndex % count + count) % count; - } else { - currentIndex >= count && (currentIndex = count - 1); - currentIndex < 0 && (currentIndex = 0); + }); + isOverlap && (progress.z2 = linearMap(data.get(valueDim, idx), [minVal, maxVal], [100, 0], true)); + return progress; + } + if (showProgress || showPointer2) { + data.diff(oldData).add(function(idx) { + const val = data.get(valueDim, idx); + if (showPointer2) { + const pointer = createPointer(idx, startAngle); + initProps(pointer, { + rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) + }, seriesModel); + group.add(pointer); + data.setItemGraphicEl(idx, pointer); } - this.option.currentIndex = currentIndex; - }; - /** - * @return {number} currentIndex - */ - TimelineModel.prototype.getCurrentIndex = function () { - return this.option.currentIndex; - }; - /** - * @return {boolean} - */ - TimelineModel.prototype.isIndexMax = function () { - return this.getCurrentIndex() >= this._data.count() - 1; - }; - /** - * @param {boolean} state true: play, false: stop - */ - TimelineModel.prototype.setPlayState = function (state) { - this.option.autoPlay = !!state; - }; - /** - * @return {boolean} true: play, false: stop - */ - TimelineModel.prototype.getPlayState = function () { - return !!this.option.autoPlay; - }; - /** - * @private - */ - TimelineModel.prototype._initData = function () { - var thisOption = this.option; - var dataArr = thisOption.data || []; - var axisType = thisOption.axisType; - var names = this._names = []; - var processedDataArr; - if (axisType === 'category') { - processedDataArr = []; - each(dataArr, function (item, index) { - var value = convertOptionIdName(getDataItemValue(item), ''); - var newItem; - if (isObject(item)) { - newItem = clone(item); - newItem.value = index; - } else { - newItem = index; + if (showProgress) { + const progress = createProgress(idx, startAngle); + const isClip = progressModel.get("clip"); + initProps(progress, { + shape: { + endAngle: linearMap(val, valueExtent, angleExtent, isClip) } - processedDataArr.push(newItem); - names.push(value); - }); - } else { - processedDataArr = dataArr; - } - var dimType = { - category: 'ordinal', - time: 'time', - value: 'number' - }[axisType] || 'number'; - var data = this._data = new SeriesData([{ - name: 'value', - type: dimType - }], this); - data.initData(processedDataArr, names); - }; - TimelineModel.prototype.getData = function () { - return this._data; - }; - /** - * @public - * @return {Array.} categoreis - */ - TimelineModel.prototype.getCategories = function () { - if (this.get('axisType') === 'category') { - return this._names.slice(); + }, seriesModel); + group.add(progress); + setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress); + progressList[idx] = progress; + } + }).update(function(newIdx, oldIdx) { + const val = data.get(valueDim, newIdx); + if (showPointer2) { + const previousPointer = oldData.getItemGraphicEl(oldIdx); + const previousRotate = previousPointer ? previousPointer.rotation : startAngle; + const pointer = createPointer(newIdx, previousRotate); + pointer.rotation = previousRotate; + updateProps(pointer, { + rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) + }, seriesModel); + group.add(pointer); + data.setItemGraphicEl(newIdx, pointer); + } + if (showProgress) { + const previousProgress = oldProgressData[oldIdx]; + const previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle; + const progress = createProgress(newIdx, previousEndAngle); + const isClip = progressModel.get("clip"); + updateProps(progress, { + shape: { + endAngle: linearMap(val, valueExtent, angleExtent, isClip) + } + }, seriesModel); + group.add(progress); + setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress); + progressList[newIdx] = progress; } - }; - TimelineModel.type = 'timeline'; - /** - * @protected - */ - TimelineModel.defaultOption = { - // zlevel: 0, // 一级层叠 - z: 4, - show: true, - axisType: 'time', - realtime: true, - left: '20%', - top: null, - right: '20%', - bottom: 0, - width: null, - height: 40, - padding: 5, - controlPosition: 'left', - autoPlay: false, - rewind: false, - loop: true, - playInterval: 2000, - currentIndex: 0, - itemStyle: {}, - label: { - color: '#000' - }, - data: [] - }; - return TimelineModel; - }(ComponentModel); - - var SliderTimelineModel = /** @class */function (_super) { - __extends(SliderTimelineModel, _super); - function SliderTimelineModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SliderTimelineModel.type; - return _this; - } - SliderTimelineModel.type = 'timeline.slider'; - /** - * @protected - */ - SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, { - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - borderWidth: 0, - orient: 'horizontal', - inverse: false, - tooltip: { - trigger: 'item' // data item may also have tootip attr. - }, - - symbol: 'circle', - symbolSize: 12, - lineStyle: { - show: true, - width: 2, - color: '#DAE1F5' - }, - label: { - position: 'auto', - // When using number, label position is not - // restricted by viewRect. - // positive: right/bottom, negative: left/top - show: true, - interval: 'auto', - rotate: 0, - // formatter: null, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#A4B1D7' - }, - itemStyle: { - color: '#A4B1D7', - borderWidth: 1 - }, - checkpointStyle: { - symbol: 'circle', - symbolSize: 15, - color: '#316bf3', - borderColor: '#fff', - borderWidth: 2, - shadowBlur: 2, - shadowOffsetX: 1, - shadowOffsetY: 1, - shadowColor: 'rgba(0, 0, 0, 0.3)', - // borderColor: 'rgba(194,53,49, 0.5)', - animation: true, - animationDuration: 300, - animationEasing: 'quinticInOut' - }, - controlStyle: { - show: true, - showPlayBtn: true, - showPrevBtn: true, - showNextBtn: true, - itemSize: 24, - itemGap: 12, - position: 'left', - playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', - stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', - // eslint-disable-next-line max-len - nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z', - // eslint-disable-next-line max-len - prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z', - prevBtnSize: 18, - nextBtnSize: 18, - color: '#A4B1D7', - borderColor: '#A4B1D7', - borderWidth: 1 - }, - emphasis: { - label: { - show: true, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#6f778d' - }, - itemStyle: { - color: '#316BF3' - }, - controlStyle: { - color: '#316BF3', - borderColor: '#316BF3', - borderWidth: 2 + }).execute(); + data.each(function(idx) { + const itemModel = data.getItemModel(idx); + const emphasisModel = itemModel.getModel("emphasis"); + const focus = emphasisModel.get("focus"); + const blurScope = emphasisModel.get("blurScope"); + const emphasisDisabled = emphasisModel.get("disabled"); + if (showPointer2) { + const pointer = data.getItemGraphicEl(idx); + const symbolStyle = data.getItemVisual(idx, "style"); + const visualColor = symbolStyle.fill; + if (pointer instanceof Image_default) { + const pathStyle = pointer.style; + pointer.useStyle(extend({ + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, symbolStyle)); + } else { + pointer.useStyle(symbolStyle); + pointer.type !== "pointer" && pointer.setColor(visualColor); } - }, - progress: { - lineStyle: { - color: '#316BF3' - }, - itemStyle: { - color: '#316BF3' - }, - label: { - color: '#6f778d' + pointer.setStyle(itemModel.getModel(["pointer", "itemStyle"]).getItemStyle()); + if (pointer.style.fill === "auto") { + pointer.setStyle("fill", getColor2(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true))); } - }, - data: [] + pointer.z2EmphasisLift = 0; + setStatesStylesFromModel(pointer, itemModel); + toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled); + } + if (showProgress) { + const progress = progressList[idx]; + progress.useStyle(data.getItemVisual(idx, "style")); + progress.setStyle(itemModel.getModel(["progress", "itemStyle"]).getItemStyle()); + progress.z2EmphasisLift = 0; + setStatesStylesFromModel(progress, itemModel); + toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled); + } }); - return SliderTimelineModel; - }(TimelineModel); - mixin(SliderTimelineModel, DataFormatMixin.prototype); - - var TimelineView = /** @class */function (_super) { - __extends(TimelineView, _super); - function TimelineView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TimelineView.type; - return _this; - } - TimelineView.type = 'timeline'; - return TimelineView; - }(ComponentView); - - /** - * Extend axis 2d - */ - var TimelineAxis = /** @class */function (_super) { - __extends(TimelineAxis, _super); - function TimelineAxis(dim, scale, coordExtent, axisType) { - var _this = _super.call(this, dim, scale, coordExtent) || this; - _this.type = axisType || 'value'; - return _this; - } - /** - * @override - */ - TimelineAxis.prototype.getLabelModel = function () { - // Force override - return this.model.getModel('label'); - }; - /** - * @override - */ - TimelineAxis.prototype.isHorizontal = function () { - return this.model.get('orient') === 'horizontal'; - }; - return TimelineAxis; - }(Axis); - - var PI$8 = Math.PI; - var labelDataIndexStore = makeInner(); - var SliderTimelineView = /** @class */function (_super) { - __extends(SliderTimelineView, _super); - function SliderTimelineView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SliderTimelineView.type; - return _this; - } - SliderTimelineView.prototype.init = function (ecModel, api) { - this.api = api; - }; - /** - * @override - */ - SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) { - this.model = timelineModel; - this.api = api; - this.ecModel = ecModel; - this.group.removeAll(); - if (timelineModel.get('show', true)) { - var layoutInfo_1 = this._layout(timelineModel, api); - var mainGroup_1 = this._createGroup('_mainGroup'); - var labelGroup = this._createGroup('_labelGroup'); - var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel); - timelineModel.formatTooltip = function (dataIndex) { - var name = axis_1.scale.getLabel({ - value: dataIndex - }); - return createTooltipMarkup('nameValue', { - noName: true, - value: name - }); - }; - each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) { - this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel); - }, this); - this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel); - this._position(layoutInfo_1, timelineModel); - } - this._doPlayStop(); - this._updateTicksStatus(); - }; - /** - * @override - */ - SliderTimelineView.prototype.remove = function () { - this._clearTimer(); - this.group.removeAll(); - }; - /** - * @override - */ - SliderTimelineView.prototype.dispose = function () { - this._clearTimer(); - }; - SliderTimelineView.prototype._layout = function (timelineModel, api) { - var labelPosOpt = timelineModel.get(['label', 'position']); - var orient = timelineModel.get('orient'); - var viewRect = getViewRect$5(timelineModel, api); - var parsedLabelPos; - // Auto label offset. - if (labelPosOpt == null || labelPosOpt === 'auto') { - parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-'; - } else if (isString(labelPosOpt)) { - parsedLabelPos = { - horizontal: { - top: '-', - bottom: '+' - }, - vertical: { - left: '-', - right: '+' - } - }[orient][labelPosOpt]; - } else { - // is number - parsedLabelPos = labelPosOpt; + this._progressEls = progressList; + } + } + _renderAnchor(seriesModel, posInfo) { + const anchorModel = seriesModel.getModel("anchor"); + const showAnchor = anchorModel.get("show"); + if (showAnchor) { + const anchorSize = anchorModel.get("size"); + const anchorType = anchorModel.get("icon"); + const offsetCenter = anchorModel.get("offsetCenter"); + const anchorKeepAspect = anchorModel.get("keepAspect"); + const anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent2(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent2(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect); + anchor.z2 = anchorModel.get("showAbove") ? 1 : 0; + anchor.setStyle(anchorModel.getModel("itemStyle").getItemStyle()); + this.group.add(anchor); + } + } + _renderTitleAndDetail(seriesModel, ecModel, api2, getColor2, posInfo) { + const data = seriesModel.getData(); + const valueDim = data.mapDimension("value"); + const minVal = +seriesModel.get("min"); + const maxVal = +seriesModel.get("max"); + const contentGroup = new Group_default(); + const newTitleEls = []; + const newDetailEls = []; + const hasAnimation = seriesModel.isAnimationEnabled(); + const showPointerAbove = seriesModel.get(["pointer", "showAbove"]); + data.diff(this._data).add((idx) => { + newTitleEls[idx] = new Text_default({ + silent: true + }); + newDetailEls[idx] = new Text_default({ + silent: true + }); + }).update((idx, oldIdx) => { + newTitleEls[idx] = this._titleEls[oldIdx]; + newDetailEls[idx] = this._detailEls[oldIdx]; + }).execute(); + data.each(function(idx) { + const itemModel = data.getItemModel(idx); + const value = data.get(valueDim, idx); + const itemGroup = new Group_default(); + const autoColor = getColor2(linearMap(value, [minVal, maxVal], [0, 1], true)); + const itemTitleModel = itemModel.getModel("title"); + if (itemTitleModel.get("show")) { + const titleOffsetCenter = itemTitleModel.get("offsetCenter"); + const titleX = posInfo.cx + parsePercent2(titleOffsetCenter[0], posInfo.r); + const titleY = posInfo.cy + parsePercent2(titleOffsetCenter[1], posInfo.r); + const labelEl = newTitleEls[idx]; + labelEl.attr({ + z2: showPointerAbove ? 0 : 2, + style: createTextStyle(itemTitleModel, { + x: titleX, + y: titleY, + text: data.getName(idx), + align: "center", + verticalAlign: "middle" + }, {inheritColor: autoColor}) + }); + itemGroup.add(labelEl); + } + const itemDetailModel = itemModel.getModel("detail"); + if (itemDetailModel.get("show")) { + const detailOffsetCenter = itemDetailModel.get("offsetCenter"); + const detailX = posInfo.cx + parsePercent2(detailOffsetCenter[0], posInfo.r); + const detailY = posInfo.cy + parsePercent2(detailOffsetCenter[1], posInfo.r); + const width = parsePercent2(itemDetailModel.get("width"), posInfo.r); + const height = parsePercent2(itemDetailModel.get("height"), posInfo.r); + const detailColor = seriesModel.get(["progress", "show"]) ? data.getItemVisual(idx, "style").fill : autoColor; + const labelEl = newDetailEls[idx]; + const formatter = itemDetailModel.get("formatter"); + labelEl.attr({ + z2: showPointerAbove ? 0 : 2, + style: createTextStyle(itemDetailModel, { + x: detailX, + y: detailY, + text: formatLabel(value, formatter), + width: isNaN(width) ? null : width, + height: isNaN(height) ? null : height, + align: "center", + verticalAlign: "middle" + }, {inheritColor: detailColor}) + }); + setLabelValueAnimation(labelEl, {normal: itemDetailModel}, value, (value2) => formatLabel(value2, formatter)); + hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, { + getFormattedLabel(labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) { + return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter); + } + }); + itemGroup.add(labelEl); + } + contentGroup.add(itemGroup); + }); + this.group.add(contentGroup); + this._titleEls = newTitleEls; + this._detailEls = newDetailEls; + } +}; +var GaugeView = GaugeView2; +GaugeView.type = "gauge"; +var GaugeView_default = GaugeView; + +// src/chart/gauge/GaugeSeries.ts +var GaugeSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = GaugeSeriesModel2.type; + this.visualStyleAccessPath = "itemStyle"; + } + getInitialData(option, ecModel) { + return createSeriesDataSimply(this, ["value"]); + } +}; +var GaugeSeriesModel = GaugeSeriesModel2; +GaugeSeriesModel.type = "series.gauge"; +GaugeSeriesModel.defaultOption = { + z: 2, + colorBy: "data", + center: ["50%", "50%"], + legendHoverLink: true, + radius: "75%", + startAngle: 225, + endAngle: -45, + clockwise: true, + min: 0, + max: 100, + splitNumber: 10, + axisLine: { + show: true, + roundCap: false, + lineStyle: { + color: [[1, "#E6EBF8"]], + width: 10 + } + }, + progress: { + show: false, + overlap: true, + width: 10, + roundCap: false, + clip: true + }, + splitLine: { + show: true, + length: 10, + distance: 10, + lineStyle: { + color: "#63677A", + width: 3, + type: "solid" + } + }, + axisTick: { + show: true, + splitNumber: 5, + length: 6, + distance: 10, + lineStyle: { + color: "#63677A", + width: 1, + type: "solid" + } + }, + axisLabel: { + show: true, + distance: 15, + color: "#464646", + fontSize: 12, + rotate: 0 + }, + pointer: { + icon: null, + offsetCenter: [0, 0], + show: true, + showAbove: true, + length: "60%", + width: 6, + keepAspect: false + }, + anchor: { + show: false, + showAbove: false, + size: 6, + icon: "circle", + offsetCenter: [0, 0], + keepAspect: false, + itemStyle: { + color: "#fff", + borderWidth: 0, + borderColor: "#5470c6" + } + }, + title: { + show: true, + offsetCenter: [0, "20%"], + color: "#464646", + fontSize: 16, + valueAnimation: false + }, + detail: { + show: true, + backgroundColor: "rgba(0,0,0,0)", + borderWidth: 0, + borderColor: "#ccc", + width: 100, + height: null, + padding: [5, 10], + offsetCenter: [0, "40%"], + color: "#464646", + fontSize: 30, + fontWeight: "bold", + lineHeight: 30, + valueAnimation: false + } +}; +var GaugeSeries_default = GaugeSeriesModel; + +// src/chart/gauge/install.ts +function install15(registers) { + registers.registerChartView(GaugeView_default); + registers.registerSeriesModel(GaugeSeries_default); +} + +// src/chart/funnel/FunnelView.ts +var opacityAccessPath = ["itemStyle", "opacity"]; +var FunnelPiece = class extends Polygon_default { + constructor(data, idx) { + super(); + const polygon = this; + const labelLine = new Polyline_default(); + const text = new Text_default(); + polygon.setTextContent(text); + this.setTextGuideLine(labelLine); + this.updateData(data, idx, true); + } + updateData(data, idx, firstCreate) { + const polygon = this; + const seriesModel = data.hostModel; + const itemModel = data.getItemModel(idx); + const layout18 = data.getItemLayout(idx); + const emphasisModel = itemModel.getModel("emphasis"); + let opacity = itemModel.get(opacityAccessPath); + opacity = opacity == null ? 1 : opacity; + if (!firstCreate) { + saveOldStyle(polygon); + } + polygon.useStyle(data.getItemVisual(idx, "style")); + polygon.style.lineJoin = "round"; + if (firstCreate) { + polygon.setShape({ + points: layout18.points + }); + polygon.style.opacity = 0; + initProps(polygon, { + style: { + opacity } - var labelAlignMap = { - horizontal: 'center', - vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right' - }; - var labelBaselineMap = { - horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom', - vertical: 'middle' - }; - var rotationMap = { - horizontal: 0, - vertical: PI$8 / 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$8 / 180; // To radian. - var playPosition; - var prevBtnPosition; - var nextBtnPosition; - 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); + }, seriesModel, idx); + } else { + updateProps(polygon, { + style: { + opacity + }, + shape: { + points: layout18.points + } + }, seriesModel, idx); + } + setStatesStylesFromModel(polygon, itemModel); + this._updateLabel(data, idx); + toggleHoverEmphasis(this, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + } + _updateLabel(data, idx) { + const polygon = this; + const labelLine = this.getTextGuideLine(); + const labelText = polygon.getTextContent(); + const seriesModel = data.hostModel; + const itemModel = data.getItemModel(idx); + const layout18 = data.getItemLayout(idx); + const labelLayout2 = layout18.label; + const style = data.getItemVisual(idx, "style"); + const visualColor = style.fill; + setLabelStyle(labelText, getLabelStatesModels(itemModel), { + labelFetcher: data.hostModel, + labelDataIndex: idx, + defaultOpacity: style.opacity, + defaultText: data.getName(idx) + }, {normal: { + align: labelLayout2.textAlign, + verticalAlign: labelLayout2.verticalAlign + }}); + polygon.setTextConfig({ + local: true, + inside: !!labelLayout2.inside, + insideStroke: visualColor, + outsideFill: visualColor + }); + const linePoints = labelLayout2.linePoints; + labelLine.setShape({ + points: linePoints + }); + polygon.textGuideLineConfig = { + anchor: linePoints ? new Point_default(linePoints[0][0], linePoints[0][1]) : null + }; + updateProps(labelText, { + style: { + x: labelLayout2.x, + y: labelLayout2.y + } + }, seriesModel, idx); + labelText.attr({ + rotation: labelLayout2.rotation, + originX: labelLayout2.x, + originY: labelLayout2.y, + z2: 10 + }); + setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), { + stroke: visualColor + }); + } +}; +var FunnelView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = FunnelView2.type; + this.ignoreLabelLineUpdate = true; + } + render(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const oldData = this._data; + const group = this.group; + data.diff(oldData).add(function(idx) { + const funnelPiece = new FunnelPiece(data, idx); + data.setItemGraphicEl(idx, funnelPiece); + group.add(funnelPiece); + }).update(function(newIdx, oldIdx) { + const piece = oldData.getItemGraphicEl(oldIdx); + piece.updateData(data, newIdx); + group.add(piece); + data.setItemGraphicEl(newIdx, piece); + }).remove(function(idx) { + const piece = oldData.getItemGraphicEl(idx); + removeElementWithFadeOut(piece, seriesModel, idx); + }).execute(); + this._data = data; + } + remove() { + this.group.removeAll(); + this._data = null; + } + dispose() { + } +}; +var FunnelView = FunnelView2; +FunnelView.type = "funnel"; +var FunnelView_default = FunnelView; + +// src/chart/funnel/FunnelSeries.ts +var FunnelSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = FunnelSeriesModel2.type; + } + init(option) { + super.init.apply(this, arguments); + this.legendVisualProvider = new LegendVisualProvider_default(bind(this.getData, this), bind(this.getRawData, this)); + this._defaultLabelLine(option); + } + getInitialData(option, ecModel) { + return createSeriesDataSimply(this, { + coordDimensions: ["value"], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); + } + _defaultLabelLine(option) { + defaultEmphasis(option, "labelLine", ["show"]); + const labelLineNormalOpt = option.labelLine; + const labelLineEmphasisOpt = option.emphasis.labelLine; + labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; + labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; + } + getDataParams(dataIndex) { + const data = this.getData(); + const params = super.getDataParams(dataIndex); + const valueDim = data.mapDimension("value"); + const sum2 = data.getSum(valueDim); + params.percent = !sum2 ? 0 : +(data.get(valueDim, dataIndex) / sum2 * 100).toFixed(2); + params.$vars.push("percent"); + return params; + } +}; +var FunnelSeriesModel = FunnelSeriesModel2; +FunnelSeriesModel.type = "series.funnel"; +FunnelSeriesModel.defaultOption = { + z: 2, + legendHoverLink: true, + colorBy: "data", + left: 80, + top: 60, + right: 80, + bottom: 60, + minSize: "0%", + maxSize: "100%", + sort: "descending", + orient: "vertical", + gap: 0, + funnelAlign: "center", + label: { + show: true, + position: "outer" + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + width: 1 + } + }, + itemStyle: { + borderColor: "#fff", + borderWidth: 1 + }, + emphasis: { + label: { + show: true + } + }, + select: { + itemStyle: { + borderColor: "#212121" + } + } +}; +var FunnelSeries_default = FunnelSeriesModel; + +// src/chart/funnel/funnelLayout.ts +function getViewRect4(seriesModel, api2) { + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api2.getWidth(), + height: api2.getHeight() + }); +} +function getSortedIndices(data, sort4) { + const valueDim = data.mapDimension("value"); + const valueArr = data.mapArray(valueDim, function(val) { + return val; + }); + const indices = []; + const isAscending = sort4 === "ascending"; + for (let i = 0, len2 = data.count(); i < len2; i++) { + indices[i] = i; + } + if (isFunction(sort4)) { + indices.sort(sort4); + } else if (sort4 !== "none") { + indices.sort(function(a, b) { + return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; + }); + } + return indices; +} +function labelLayout(data) { + const seriesModel = data.hostModel; + const orient = seriesModel.get("orient"); + data.each(function(idx) { + const itemModel = data.getItemModel(idx); + const labelModel = itemModel.getModel("label"); + let labelPosition = labelModel.get("position"); + const labelLineModel = itemModel.getModel("labelLine"); + const layout18 = data.getItemLayout(idx); + const points4 = layout18.points; + const isLabelInside = labelPosition === "inner" || labelPosition === "inside" || labelPosition === "center" || labelPosition === "insideLeft" || labelPosition === "insideRight"; + let textAlign; + let textX; + let textY; + let linePoints; + if (isLabelInside) { + if (labelPosition === "insideLeft") { + textX = (points4[0][0] + points4[3][0]) / 2 + 5; + textY = (points4[0][1] + points4[3][1]) / 2; + textAlign = "left"; + } else if (labelPosition === "insideRight") { + textX = (points4[1][0] + points4[2][0]) / 2 - 5; + textY = (points4[1][1] + points4[2][1]) / 2; + textAlign = "right"; + } else { + textX = (points4[0][0] + points4[1][0] + points4[2][0] + points4[3][0]) / 4; + textY = (points4[0][1] + points4[1][1] + points4[2][1] + points4[3][1]) / 4; + textAlign = "center"; + } + linePoints = [ + [textX, textY], + [textX, textY] + ]; + } else { + let x1; + let y1; + let x2; + let y2; + const labelLineLen = labelLineModel.get("length"); + if (true) { + if (orient === "vertical" && ["top", "bottom"].indexOf(labelPosition) > -1) { + labelPosition = "left"; + console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom."); + } + if (orient === "horizontal" && ["left", "right"].indexOf(labelPosition) > -1) { + labelPosition = "bottom"; + console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."); + } + } + if (labelPosition === "left") { + x1 = (points4[3][0] + points4[0][0]) / 2; + y1 = (points4[3][1] + points4[0][1]) / 2; + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = "right"; + } else if (labelPosition === "right") { + x1 = (points4[1][0] + points4[2][0]) / 2; + y1 = (points4[1][1] + points4[2][1]) / 2; + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = "left"; + } else if (labelPosition === "top") { + x1 = (points4[3][0] + points4[0][0]) / 2; + y1 = (points4[3][1] + points4[0][1]) / 2; + y2 = y1 - labelLineLen; + textY = y2 - 5; + textAlign = "center"; + } else if (labelPosition === "bottom") { + x1 = (points4[1][0] + points4[2][0]) / 2; + y1 = (points4[1][1] + points4[2][1]) / 2; + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = "center"; + } else if (labelPosition === "rightTop") { + x1 = orient === "horizontal" ? points4[3][0] : points4[1][0]; + y1 = orient === "horizontal" ? points4[3][1] : points4[1][1]; + if (orient === "horizontal") { + y2 = y1 - labelLineLen; + textY = y2 - 5; + textAlign = "center"; } else { - // 'top' 'right' - showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap); - showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - } - var axisExtent = [xLeft, xRight]; - if (timelineModel.get('inverse')) { - axisExtent.reverse(); + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = "top"; + } + } else if (labelPosition === "rightBottom") { + x1 = points4[2][0]; + y1 = points4[2][1]; + if (orient === "horizontal") { + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = "center"; + } else { + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = "bottom"; + } + } else if (labelPosition === "leftTop") { + x1 = points4[0][0]; + y1 = orient === "horizontal" ? points4[0][1] : points4[1][1]; + if (orient === "horizontal") { + y2 = y1 - labelLineLen; + textY = y2 - 5; + textAlign = "center"; + } else { + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = "right"; + } + } else if (labelPosition === "leftBottom") { + x1 = orient === "horizontal" ? points4[1][0] : points4[3][0]; + y1 = orient === "horizontal" ? points4[1][1] : points4[2][1]; + if (orient === "horizontal") { + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = "center"; + } else { + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = "right"; } - return { - viewRect: viewRect, - mainLength: mainLength, - orient: orient, - rotation: rotationMap[orient], - labelRotation: labelRotation, - labelPosOpt: parsedLabelPos, - 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 - }; - }; - SliderTimelineView.prototype._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 = create$1(); - var rotateOriginX = viewRect.x; - var rotateOriginY = viewRect.y + viewRect.height; - translate(m, m, [-rotateOriginX, -rotateOriginY]); - rotate(m, m, -PI$8 / 2); - 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.x, mainGroup.y]; - var labelsPosition = [labelGroup.x, labelGroup.y]; - labelsPosition[0] = mainPosition[0] = viewBound[0][0]; - var labelPosOpt = layoutInfo.labelPosOpt; - if (labelPosOpt == null || isString(labelPosOpt)) { - // '+' or '-' - var mainBoundIdx = labelPosOpt === '+' ? 0 : 1; - toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); - toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx); + } else { + x1 = (points4[1][0] + points4[2][0]) / 2; + y1 = (points4[1][1] + points4[2][1]) / 2; + if (orient === "horizontal") { + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = "center"; } else { - var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1; - toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); - labelsPosition[1] = mainPosition[1] + labelPosOpt; - } - mainGroup.setPosition(mainPosition); - labelGroup.setPosition(labelsPosition); - mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; - setOrigin(mainGroup); - setOrigin(labelGroup); - function setOrigin(targetGroup) { - targetGroup.originX = viewBound[0][0] - targetGroup.x; - targetGroup.originY = viewBound[1][0] - targetGroup.y; - } - 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]; + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = "left"; } - }; - SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) { - var data = timelineModel.getData(); - var axisType = timelineModel.get('axisType'); - var scale = createScaleByModel$1(timelineModel, axisType); - // Customize scale. The `tickValue` is `dataIndex`. - scale.getTicks = function () { - return data.mapArray(['value'], function (value) { - return { - value: value - }; - }); - }; - var dataExtent = data.getDataExtent('value'); - scale.setExtent(dataExtent[0], dataExtent[1]); - scale.calcNiceTicks(); - var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); - axis.model = timelineModel; - return axis; - }; - SliderTimelineView.prototype._createGroup = function (key) { - var newGroup = this[key] = new Group(); - this.group.add(newGroup); - return newGroup; - }; - SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) { - var axisExtent = axis.getExtent(); - if (!timelineModel.get(['lineStyle', 'show'])) { - return; + } + if (orient === "horizontal") { + x2 = x1; + textX = x2; + } else { + y2 = y1; + textY = y2; + } + linePoints = [[x1, y1], [x2, y2]]; + } + layout18.label = { + linePoints, + x: textX, + y: textY, + verticalAlign: "middle", + textAlign, + inside: isLabelInside + }; + }); +} +function funnelLayout(ecModel, api2) { + ecModel.eachSeriesByType("funnel", function(seriesModel) { + const data = seriesModel.getData(); + const valueDim = data.mapDimension("value"); + const sort4 = seriesModel.get("sort"); + const viewRect2 = getViewRect4(seriesModel, api2); + const orient = seriesModel.get("orient"); + const viewWidth = viewRect2.width; + const viewHeight = viewRect2.height; + let indices = getSortedIndices(data, sort4); + let x = viewRect2.x; + let y = viewRect2.y; + const sizeExtent = orient === "horizontal" ? [ + parsePercent2(seriesModel.get("minSize"), viewHeight), + parsePercent2(seriesModel.get("maxSize"), viewHeight) + ] : [ + parsePercent2(seriesModel.get("minSize"), viewWidth), + parsePercent2(seriesModel.get("maxSize"), viewWidth) + ]; + const dataExtent = data.getDataExtent(valueDim); + let min3 = seriesModel.get("min"); + let max3 = seriesModel.get("max"); + if (min3 == null) { + min3 = Math.min(dataExtent[0], 0); + } + if (max3 == null) { + max3 = dataExtent[1]; + } + const funnelAlign = seriesModel.get("funnelAlign"); + let gap = seriesModel.get("gap"); + const viewSize = orient === "horizontal" ? viewWidth : viewHeight; + let itemSize = (viewSize - gap * (data.count() - 1)) / data.count(); + const getLinePoints = function(idx, offset) { + if (orient === "horizontal") { + const val2 = data.get(valueDim, idx) || 0; + const itemHeight = linearMap(val2, [min3, max3], sizeExtent, true); + let y0; + switch (funnelAlign) { + case "top": + y0 = y; + break; + case "center": + y0 = y + (viewHeight - itemHeight) / 2; + break; + case "bottom": + y0 = y + (viewHeight - itemHeight); + break; } - var line = new Line({ - shape: { - x1: axisExtent[0], - y1: 0, - x2: axisExtent[1], - y2: 0 - }, - style: extend({ - lineCap: 'round' - }, timelineModel.getModel('lineStyle').getLineStyle()), - silent: true, - z2: 1 - }); - group.add(line); - var progressLine = this._progressLine = new Line({ - shape: { - x1: axisExtent[0], - x2: this._currentPointer ? this._currentPointer.x : axisExtent[0], - y1: 0, - y2: 0 - }, - style: defaults({ - lineCap: 'round', - lineWidth: line.style.lineWidth - }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()), - silent: true, - z2: 1 - }); - group.add(progressLine); - }; - SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) { - var _this = this; - var data = timelineModel.getData(); - // Show all ticks, despite ignoring strategy. - var ticks = axis.scale.getTicks(); - this._tickSymbols = []; - // The value is dataIndex, see the customized scale. - each(ticks, function (tick) { - var tickCoord = axis.dataToCoord(tick.value); - var itemModel = data.getItemModel(tick.value); - var itemStyleModel = itemModel.getModel('itemStyle'); - var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']); - var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']); - var symbolOpt = { - x: tickCoord, - y: 0, - onclick: bind(_this._changeTimeline, _this, tick.value) - }; - var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); - el.ensureState('emphasis').style = hoverStyleModel.getItemStyle(); - el.ensureState('progress').style = progressStyleModel.getItemStyle(); - enableHoverEmphasis(el); - var ecData = getECData(el); - if (itemModel.get('tooltip')) { - ecData.dataIndex = tick.value; - ecData.dataModel = timelineModel; - } else { - ecData.dataIndex = ecData.dataModel = null; + return [ + [offset, y0], + [offset, y0 + itemHeight] + ]; + } + const val = data.get(valueDim, idx) || 0; + const itemWidth = linearMap(val, [min3, max3], sizeExtent, true); + let x0; + switch (funnelAlign) { + case "left": + x0 = x; + break; + case "center": + x0 = x + (viewWidth - itemWidth) / 2; + break; + case "right": + x0 = x + viewWidth - itemWidth; + break; + } + return [ + [x0, offset], + [x0 + itemWidth, offset] + ]; + }; + if (sort4 === "ascending") { + itemSize = -itemSize; + gap = -gap; + if (orient === "horizontal") { + x += viewWidth; + } else { + y += viewHeight; + } + indices = indices.reverse(); + } + for (let i = 0; i < indices.length; i++) { + const idx = indices[i]; + const nextIdx = indices[i + 1]; + const itemModel = data.getItemModel(idx); + if (orient === "horizontal") { + let width = itemModel.get(["itemStyle", "width"]); + if (width == null) { + width = itemSize; + } else { + width = parsePercent2(width, viewWidth); + if (sort4 === "ascending") { + width = -width; } - _this._tickSymbols.push(el); - }); - }; - SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) { - var _this = this; - var labelModel = axis.getLabelModel(); - if (!labelModel.get('show')) { - return; } - var data = timelineModel.getData(); - var labels = axis.getViewLabels(); - this._tickLabels = []; - each(labels, function (labelItem) { - // The tickValue is dataIndex, see the customized scale. - var dataIndex = labelItem.tickValue; - var itemModel = data.getItemModel(dataIndex); - var normalLabelModel = itemModel.getModel('label'); - var hoverLabelModel = itemModel.getModel(['emphasis', 'label']); - var progressLabelModel = itemModel.getModel(['progress', 'label']); - var tickCoord = axis.dataToCoord(labelItem.tickValue); - var textEl = new ZRText({ - x: tickCoord, - y: 0, - rotation: layoutInfo.labelRotation - layoutInfo.rotation, - onclick: bind(_this._changeTimeline, _this, dataIndex), - silent: false, - style: createTextStyle(normalLabelModel, { - text: labelItem.formattedLabel, - align: layoutInfo.labelAlign, - verticalAlign: layoutInfo.labelBaseline - }) - }); - textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel); - textEl.ensureState('progress').style = createTextStyle(progressLabelModel); - group.add(textEl); - enableHoverEmphasis(textEl); - labelDataIndexStore(textEl).dataIndex = dataIndex; - _this._tickLabels.push(textEl); + const start2 = getLinePoints(idx, x); + const end2 = getLinePoints(nextIdx, x + width); + x += width + gap; + data.setItemLayout(idx, { + points: start2.concat(end2.slice().reverse()) }); - }; - SliderTimelineView.prototype._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 playState = timelineModel.getPlayState(); - var inverse = timelineModel.get('inverse', true); - makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+')); - makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-')); - makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true); - function makeBtn(position, iconName, onclick, willRotate) { - if (!position) { - return; - } - var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize); - var rect = [0, -iconSize / 2, iconSize, iconSize]; - var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, { - x: position[0], - y: position[1], - originX: controlSize / 2, - originY: 0, - rotation: willRotate ? -rotation : 0, - rectHover: true, - style: itemStyle, - onclick: onclick - }); - btn.ensureState('emphasis').style = hoverStyle; - group.add(btn); - enableHoverEmphasis(btn); - } - }; - SliderTimelineView.prototype._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, me._progressLine, currentIndex, axis, timelineModel, true); - }, - onUpdate: function (pointer) { - pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel); + } else { + let height = itemModel.get(["itemStyle", "height"]); + if (height == null) { + height = itemSize; + } else { + height = parsePercent2(height, viewHeight); + if (sort4 === "ascending") { + height = -height; } - }; - // Reuse when exists, for animation and drag. - this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback); - }; - SliderTimelineView.prototype._handlePlayClick = function (nextState) { - this._clearTimer(); - this.api.dispatchAction({ - type: 'timelinePlayChange', - playState: nextState, - from: this.uid - }); - }; - SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) { - this._clearTimer(); - this._pointerChangeTimeline([e.offsetX, e.offsetY]); - }; - SliderTimelineView.prototype._handlePointerDragend = function (e) { - this._pointerChangeTimeline([e.offsetX, e.offsetY], true); - }; - SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) { - var toCoord = this._toAxisCoord(mousePos)[0]; - var axis = this._axis; - var axisExtent = asc(axis.getExtent().slice()); - toCoord > axisExtent[1] && (toCoord = axisExtent[1]); - toCoord < axisExtent[0] && (toCoord = axisExtent[0]); - this._currentPointer.x = toCoord; - this._currentPointer.markRedraw(); - var progressLine = this._progressLine; - if (progressLine) { - progressLine.shape.x2 = toCoord; - progressLine.dirty(); - } - var targetDataIndex = this._findNearestTick(toCoord); - var timelineModel = this.model; - if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) { - this._changeTimeline(targetDataIndex); - } - }; - SliderTimelineView.prototype._doPlayStop = function () { - var _this = this; - this._clearTimer(); - if (this.model.getPlayState()) { - this._timer = setTimeout(function () { - // Do not cache - var timelineModel = _this.model; - _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1)); - }, this.model.get('playInterval')); } - }; - SliderTimelineView.prototype._toAxisCoord = function (vertex) { - var trans = this._mainGroup.getLocalTransform(); - return applyTransform$1(vertex, trans, true); - }; - SliderTimelineView.prototype._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; - } + const start2 = getLinePoints(idx, y); + const end2 = getLinePoints(nextIdx, y + height); + y += height + gap; + data.setItemLayout(idx, { + points: start2.concat(end2.slice().reverse()) + }); + } + } + labelLayout(data); + }); +} + +// src/chart/funnel/install.ts +function install16(registers) { + registers.registerChartView(FunnelView_default); + registers.registerSeriesModel(FunnelSeries_default); + registers.registerLayout(funnelLayout); + registers.registerProcessor(dataFilter("funnel")); +} + +// src/chart/parallel/ParallelView.ts +var DEFAULT_SMOOTH = 0.3; +var ParallelView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = ParallelView2.type; + this._dataGroup = new Group_default(); + this._initialized = false; + } + init() { + this.group.add(this._dataGroup); + } + render(seriesModel, ecModel, api2, payload) { + this._progressiveEls = null; + const dataGroup = this._dataGroup; + const data = seriesModel.getData(); + const oldData = this._data; + const coordSys = seriesModel.coordinateSystem; + const dimensions = coordSys.dimensions; + const seriesScope = makeSeriesScope3(seriesModel); + data.diff(oldData).add(add2).update(update).remove(remove).execute(); + function add2(newDataIndex) { + const line2 = addEl(data, dataGroup, newDataIndex, dimensions, coordSys); + updateElCommon(line2, data, newDataIndex, seriesScope); + } + function update(newDataIndex, oldDataIndex) { + const line2 = oldData.getItemGraphicEl(oldDataIndex); + const points4 = createLinePoints(data, newDataIndex, dimensions, coordSys); + data.setItemGraphicEl(newDataIndex, line2); + updateProps(line2, {shape: {points: points4}}, seriesModel, newDataIndex); + saveOldStyle(line2); + updateElCommon(line2, data, newDataIndex, seriesScope); + } + function remove(oldDataIndex) { + const line2 = oldData.getItemGraphicEl(oldDataIndex); + dataGroup.remove(line2); + } + if (!this._initialized) { + this._initialized = true; + const clipPath = createGridClipShape(coordSys, seriesModel, function() { + setTimeout(function() { + dataGroup.removeClipPath(); }); - return targetDataIndex; - }; - SliderTimelineView.prototype._clearTimer = function () { - if (this._timer) { - clearTimeout(this._timer); - this._timer = null; + }); + dataGroup.setClipPath(clipPath); + } + this._data = data; + } + incrementalPrepareRender(seriesModel, ecModel, api2) { + this._initialized = true; + this._data = null; + this._dataGroup.removeAll(); + } + incrementalRender(taskParams, seriesModel, ecModel) { + const data = seriesModel.getData(); + const coordSys = seriesModel.coordinateSystem; + const dimensions = coordSys.dimensions; + const seriesScope = makeSeriesScope3(seriesModel); + const progressiveEls = this._progressiveEls = []; + for (let dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) { + const line2 = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys); + line2.incremental = true; + updateElCommon(line2, data, dataIndex, seriesScope); + progressiveEls.push(line2); + } + } + remove() { + this._dataGroup && this._dataGroup.removeAll(); + this._data = null; + } +}; +var ParallelView = ParallelView2; +ParallelView.type = "parallel"; +function createGridClipShape(coordSys, seriesModel, cb) { + const parallelModel = coordSys.model; + const rect = coordSys.getRect(); + const rectEl = new Rect_default({ + shape: { + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + } + }); + const dim = parallelModel.get("layout") === "horizontal" ? "width" : "height"; + rectEl.setShape(dim, 0); + initProps(rectEl, { + shape: { + width: rect.width, + height: rect.height + } + }, seriesModel, cb); + return rectEl; +} +function createLinePoints(data, dataIndex, dimensions, coordSys) { + const points4 = []; + for (let i = 0; i < dimensions.length; i++) { + const dimName = dimensions[i]; + const value = data.get(data.mapDimension(dimName), dataIndex); + if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) { + points4.push(coordSys.dataToPoint(value, dimName)); + } + } + return points4; +} +function addEl(data, dataGroup, dataIndex, dimensions, coordSys) { + const points4 = createLinePoints(data, dataIndex, dimensions, coordSys); + const line2 = new Polyline_default({ + shape: {points: points4}, + z2: 10 + }); + dataGroup.add(line2); + data.setItemGraphicEl(dataIndex, line2); + return line2; +} +function makeSeriesScope3(seriesModel) { + let smooth = seriesModel.get("smooth", true); + smooth === true && (smooth = DEFAULT_SMOOTH); + smooth = numericToNumber(smooth); + eqNaN(smooth) && (smooth = 0); + return {smooth}; +} +function updateElCommon(el, data, dataIndex, seriesScope) { + el.useStyle(data.getItemVisual(dataIndex, "style")); + el.style.fill = null; + el.setShape("smooth", seriesScope.smooth); + const itemModel = data.getItemModel(dataIndex); + const emphasisModel = itemModel.getModel("emphasis"); + setStatesStylesFromModel(el, itemModel, "lineStyle"); + toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); +} +function isEmptyValue(val, axisType) { + return axisType === "category" ? val == null : val == null || isNaN(val); +} +var ParallelView_default = ParallelView; + +// src/chart/parallel/ParallelSeries.ts +var ParallelSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = ParallelSeriesModel2.type; + this.visualStyleAccessPath = "lineStyle"; + this.visualDrawType = "stroke"; + } + getInitialData(option, ecModel) { + return createSeriesData_default(null, this, { + useEncodeDefaulter: bind(makeDefaultEncode, null, this) + }); + } + getRawIndicesByActiveState(activeState) { + const coordSys = this.coordinateSystem; + const data = this.getData(); + const indices = []; + coordSys.eachActiveState(data, function(theActiveState, dataIndex) { + if (activeState === theActiveState) { + indices.push(data.getRawIndex(dataIndex)); + } + }); + return indices; + } +}; +var ParallelSeriesModel = ParallelSeriesModel2; +ParallelSeriesModel.type = "series.parallel"; +ParallelSeriesModel.dependencies = ["parallel"]; +ParallelSeriesModel.defaultOption = { + 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, + animationEasing: "linear" +}; +function makeDefaultEncode(seriesModel) { + const parallelModel = seriesModel.ecModel.getComponent("parallel", seriesModel.get("parallelIndex")); + if (!parallelModel) { + return; + } + const encodeDefine = {}; + each(parallelModel.dimensions, function(axisDim) { + const dataDimIndex = convertDimNameToNumber(axisDim); + encodeDefine[axisDim] = dataDimIndex; + }); + return encodeDefine; +} +function convertDimNameToNumber(dimName) { + return +dimName.replace("dim", ""); +} +var ParallelSeries_default = ParallelSeriesModel; + +// src/chart/parallel/parallelVisual.ts +var opacityAccessPath2 = ["lineStyle", "opacity"]; +var parallelVisual = { + seriesType: "parallel", + reset: function(seriesModel, ecModel) { + const coordSys = seriesModel.coordinateSystem; + const opacityMap = { + normal: seriesModel.get(["lineStyle", "opacity"]), + active: seriesModel.get("activeOpacity"), + inactive: seriesModel.get("inactiveOpacity") + }; + return { + progress(params, data) { + coordSys.eachActiveState(data, function(activeState, dataIndex) { + let opacity = opacityMap[activeState]; + if (activeState === "normal" && data.hasItemOption) { + const itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath2, true); + itemOpacity != null && (opacity = itemOpacity); + } + const existsStyle = data.ensureUniqueItemVisual(dataIndex, "style"); + existsStyle.opacity = opacity; + }, params.start, params.end); + } + }; + } +}; +var parallelVisual_default = parallelVisual; + +// src/coord/parallel/parallelPreprocessor.ts +function parallelPreprocessor(option) { + createParallelIfNeeded(option); + mergeAxisOptionFromParallel(option); +} +function createParallelIfNeeded(option) { + if (option.parallel) { + return; + } + let hasParallelSeries = false; + each(option.series, function(seriesOpt) { + if (seriesOpt && seriesOpt.type === "parallel") { + hasParallelSeries = true; + } + }); + if (hasParallelSeries) { + option.parallel = [{}]; + } +} +function mergeAxisOptionFromParallel(option) { + const axes = normalizeToArray(option.parallelAxis); + each(axes, function(axisOption) { + if (!isObject(axisOption)) { + return; + } + const parallelIndex = axisOption.parallelIndex || 0; + const parallelOption = normalizeToArray(option.parallel)[parallelIndex]; + if (parallelOption && parallelOption.parallelAxisDefault) { + merge(axisOption, parallelOption.parallelAxisDefault, false); + } + }); +} + +// src/component/parallel/ParallelView.ts +var CLICK_THRESHOLD = 5; +var ParallelView4 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = ParallelView4.type; + } + render(parallelModel, ecModel, api2) { + this._model = parallelModel; + this._api = api2; + if (!this._handlers) { + this._handlers = {}; + each(handlers, function(handler, eventName) { + api2.getZr().on(eventName, this._handlers[eventName] = bind(handler, this)); + }, this); + } + createOrUpdate(this, "_throttledDispatchExpand", parallelModel.get("axisExpandRate"), "fixRate"); + } + dispose(ecModel, api2) { + clear(this, "_throttledDispatchExpand"); + each(this._handlers, function(handler, eventName) { + api2.getZr().off(eventName, handler); + }); + this._handlers = null; + } + _throttledDispatchExpand(opt) { + this._dispatchExpand(opt); + } + _dispatchExpand(opt) { + opt && this._api.dispatchAction(extend({type: "parallelAxisExpand"}, opt)); + } +}; +var ParallelView3 = ParallelView4; +ParallelView3.type = "parallel"; +var handlers = { + mousedown: function(e2) { + if (checkTrigger(this, "click")) { + this._mouseDownPoint = [e2.offsetX, e2.offsetY]; + } + }, + mouseup: function(e2) { + const mouseDownPoint = this._mouseDownPoint; + if (checkTrigger(this, "click") && mouseDownPoint) { + const point = [e2.offsetX, e2.offsetY]; + const dist3 = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2); + if (dist3 > CLICK_THRESHOLD) { + return; + } + const result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e2.offsetX, e2.offsetY]); + result.behavior !== "none" && this._dispatchExpand({ + axisExpandWindow: result.axisExpandWindow + }); + } + this._mouseDownPoint = null; + }, + mousemove: function(e2) { + if (this._mouseDownPoint || !checkTrigger(this, "mousemove")) { + return; + } + const model = this._model; + const result = model.coordinateSystem.getSlidedAxisExpandWindow([e2.offsetX, e2.offsetY]); + const behavior = result.behavior; + behavior === "jump" && this._throttledDispatchExpand.debounceNextCall(model.get("axisExpandDebounce")); + this._throttledDispatchExpand(behavior === "none" ? null : { + axisExpandWindow: result.axisExpandWindow, + animation: behavior === "jump" ? null : { + duration: 0 + } + }); + } +}; +function checkTrigger(view, triggerOn) { + const model = view._model; + return model.get("axisExpandable") && model.get("axisExpandTriggerOn") === triggerOn; +} +var ParallelView_default2 = ParallelView3; + +// src/coord/parallel/ParallelModel.ts +var ParallelModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = ParallelModel2.type; + } + init() { + super.init.apply(this, arguments); + this.mergeOption({}); + } + mergeOption(newOption) { + const thisOption = this.option; + newOption && merge(thisOption, newOption, true); + this._initDimensions(); + } + contains(model, ecModel) { + const parallelIndex = model.get("parallelIndex"); + return parallelIndex != null && ecModel.getComponent("parallel", parallelIndex) === this; + } + setAxisExpand(opt) { + each([ + "axisExpandable", + "axisExpandCenter", + "axisExpandCount", + "axisExpandWidth", + "axisExpandWindow" + ], function(name) { + if (opt.hasOwnProperty(name)) { + this.option[name] = opt[name]; + } + }, this); + } + _initDimensions() { + const dimensions = this.dimensions = []; + const parallelAxisIndex = this.parallelAxisIndex = []; + const axisModels = filter(this.ecModel.queryComponents({mainType: "parallelAxis"}), function(axisModel) { + return (axisModel.get("parallelIndex") || 0) === this.componentIndex; + }, this); + each(axisModels, function(axisModel) { + dimensions.push("dim" + axisModel.get("dim")); + parallelAxisIndex.push(axisModel.componentIndex); + }); + } +}; +var ParallelModel = ParallelModel2; +ParallelModel.type = "parallel"; +ParallelModel.dependencies = ["parallelAxis"]; +ParallelModel.layoutMode = "box"; +ParallelModel.defaultOption = { + z: 0, + left: 80, + top: 60, + right: 80, + bottom: 60, + layout: "horizontal", + axisExpandable: false, + axisExpandCenter: null, + axisExpandCount: 0, + axisExpandWidth: 50, + axisExpandRate: 17, + axisExpandDebounce: 50, + axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4], + axisExpandTriggerOn: "click", + parallelAxisDefault: null +}; +var ParallelModel_default = ParallelModel; + +// src/coord/parallel/ParallelAxis.ts +var ParallelAxis = class extends Axis_default { + constructor(dim, scale4, coordExtent, axisType, axisIndex) { + super(dim, scale4, coordExtent); + this.type = axisType || "value"; + this.axisIndex = axisIndex; + } + isHorizontal() { + return this.coordinateSystem.getModel().get("layout") !== "horizontal"; + } +}; +var ParallelAxis_default = ParallelAxis; + +// src/component/helper/sliderMove.ts +function sliderMove(delta, handleEnds, extent3, handleIndex, minSpan, maxSpan) { + delta = delta || 0; + const extentSpan = extent3[1] - extent3[0]; + if (minSpan != null) { + minSpan = restrict(minSpan, [0, extentSpan]); + } + if (maxSpan != null) { + maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0); + } + if (handleIndex === "all") { + let 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], extent3); + handleEnds[1] = restrict(handleEnds[1], extent3); + const originalDistSign = getSpanSign(handleEnds, handleIndex); + handleEnds[handleIndex] += delta; + const extentMinSpan = minSpan || 0; + const realExtent = extent3.slice(); + originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan; + handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent); + let currDistSign; + currDistSign = getSpanSign(handleEnds, handleIndex); + if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) { + handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan; + } + currDistSign = getSpanSign(handleEnds, handleIndex); + if (maxSpan != null && currDistSign.span > maxSpan) { + handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan; + } + return handleEnds; +} +function getSpanSign(handleEnds, handleIndex) { + const dist3 = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; + return {span: Math.abs(dist3), sign: dist3 > 0 ? -1 : dist3 < 0 ? 1 : handleIndex ? -1 : 1}; +} +function restrict(value, extend2) { + return Math.min(extend2[1] != null ? extend2[1] : Infinity, Math.max(extend2[0] != null ? extend2[0] : -Infinity, value)); +} + +// src/coord/parallel/Parallel.ts +var each6 = each; +var mathMin9 = Math.min; +var mathMax9 = Math.max; +var mathFloor2 = Math.floor; +var mathCeil2 = Math.ceil; +var round6 = round; +var PI9 = Math.PI; +var Parallel = class { + constructor(parallelModel, ecModel, api2) { + this.type = "parallel"; + this._axesMap = createHashMap(); + this._axesLayout = {}; + this.dimensions = parallelModel.dimensions; + this._model = parallelModel; + this._init(parallelModel, ecModel, api2); + } + _init(parallelModel, ecModel, api2) { + const dimensions = parallelModel.dimensions; + const parallelAxisIndex = parallelModel.parallelAxisIndex; + each6(dimensions, function(dim, idx) { + const axisIndex = parallelAxisIndex[idx]; + const axisModel = ecModel.getComponent("parallelAxis", axisIndex); + const axis = this._axesMap.set(dim, new ParallelAxis_default(dim, createScaleByModel(axisModel), [0, 0], axisModel.get("type"), axisIndex)); + const isCategory2 = axis.type === "category"; + axis.onBand = isCategory2 && axisModel.get("boundaryGap"); + axis.inverse = axisModel.get("inverse"); + axisModel.axis = axis; + axis.model = axisModel; + axis.coordinateSystem = axisModel.coordinateSystem = this; + }, this); + } + update(ecModel, api2) { + this._updateAxesFromSeries(this._model, ecModel); + } + containPoint(point) { + const layoutInfo = this._makeLayoutInfo(); + const axisBase = layoutInfo.axisBase; + const layoutBase = layoutInfo.layoutBase; + const pixelDimIndex = layoutInfo.pixelDimIndex; + const pAxis = point[1 - pixelDimIndex]; + const pLayout = point[pixelDimIndex]; + return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength; + } + getModel() { + return this._model; + } + _updateAxesFromSeries(parallelModel, ecModel) { + ecModel.eachSeries(function(seriesModel) { + if (!parallelModel.contains(seriesModel, ecModel)) { + return; + } + const data = seriesModel.getData(); + each6(this.dimensions, function(dim) { + const axis = this._axesMap.get(dim); + axis.scale.unionExtentFromData(data, data.mapDimension(dim)); + niceScaleExtent(axis.scale, axis.model); + }, this); + }, this); + } + resize(parallelModel, api2) { + this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), { + width: api2.getWidth(), + height: api2.getHeight() + }); + this._layoutAxes(); + } + getRect() { + return this._rect; + } + _makeLayoutInfo() { + const parallelModel = this._model; + const rect = this._rect; + const xy = ["x", "y"]; + const wh = ["width", "height"]; + const layout18 = parallelModel.get("layout"); + const pixelDimIndex = layout18 === "horizontal" ? 0 : 1; + const layoutLength = rect[wh[pixelDimIndex]]; + const layoutExtent = [0, layoutLength]; + const axisCount = this.dimensions.length; + const axisExpandWidth = restrict2(parallelModel.get("axisExpandWidth"), layoutExtent); + const axisExpandCount = restrict2(parallelModel.get("axisExpandCount") || 0, [0, axisCount]); + const axisExpandable = parallelModel.get("axisExpandable") && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; + let axisExpandWindow = parallelModel.get("axisExpandWindow"); + let winSize; + if (!axisExpandWindow) { + winSize = restrict2(axisExpandWidth * (axisExpandCount - 1), layoutExtent); + const axisExpandCenter = parallelModel.get("axisExpandCenter") || mathFloor2(axisCount / 2); + axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2]; + axisExpandWindow[1] = axisExpandWindow[0] + winSize; + } else { + winSize = restrict2(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent); + axisExpandWindow[1] = axisExpandWindow[0] + winSize; + } + let axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); + axisCollapseWidth < 3 && (axisCollapseWidth = 0); + const winInnerIndices = [ + mathFloor2(round6(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, + mathCeil2(round6(axisExpandWindow[1] / axisExpandWidth, 1)) - 1 + ]; + const axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0]; + return { + layout: layout18, + pixelDimIndex, + layoutBase: rect[xy[pixelDimIndex]], + layoutLength, + axisBase: rect[xy[1 - pixelDimIndex]], + axisLength: rect[wh[1 - pixelDimIndex]], + axisExpandable, + axisExpandWidth, + axisCollapseWidth, + axisExpandWindow, + axisCount, + winInnerIndices, + axisExpandWindow0Pos + }; + } + _layoutAxes() { + const rect = this._rect; + const axes = this._axesMap; + const dimensions = this.dimensions; + const layoutInfo = this._makeLayoutInfo(); + const layout18 = layoutInfo.layout; + axes.each(function(axis) { + const axisExtent = [0, layoutInfo.axisLength]; + const idx = axis.inverse ? 1 : 0; + axis.setExtent(axisExtent[idx], axisExtent[1 - idx]); + }); + each6(dimensions, function(dim, idx) { + const posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo); + const positionTable = { + horizontal: { + x: posInfo.position, + y: layoutInfo.axisLength + }, + vertical: { + x: 0, + y: posInfo.position } }; - SliderTimelineView.prototype._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 - }); + const rotationTable = { + horizontal: PI9 / 2, + vertical: 0 }; - SliderTimelineView.prototype._updateTicksStatus = function () { - var currentIndex = this.model.getCurrentIndex(); - var tickSymbols = this._tickSymbols; - var tickLabels = this._tickLabels; - if (tickSymbols) { - for (var i = 0; i < tickSymbols.length; i++) { - tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex); - } - } - if (tickLabels) { - for (var i = 0; i < tickLabels.length; i++) { - tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex); + const position2 = [ + positionTable[layout18].x + rect.x, + positionTable[layout18].y + rect.y + ]; + const rotation = rotationTable[layout18]; + const transform2 = create2(); + rotate(transform2, transform2, rotation); + translate(transform2, transform2, position2); + this._axesLayout[dim] = { + position: position2, + rotation, + transform: transform2, + axisNameAvailableWidth: posInfo.axisNameAvailableWidth, + axisLabelShow: posInfo.axisLabelShow, + nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth, + tickDirection: 1, + labelDirection: 1 + }; + }, this); + } + getAxis(dim) { + return this._axesMap.get(dim); + } + dataToPoint(value, dim) { + return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim); + } + eachActiveState(data, callback, start2, end2) { + start2 == null && (start2 = 0); + end2 == null && (end2 = data.count()); + const axesMap = this._axesMap; + const dimensions = this.dimensions; + const dataDimensions = []; + const axisModels = []; + each(dimensions, function(axisDim) { + dataDimensions.push(data.mapDimension(axisDim)); + axisModels.push(axesMap.get(axisDim).model); + }); + const hasActiveSet = this.hasAxisBrushed(); + for (let dataIndex = start2; dataIndex < end2; dataIndex++) { + let activeState; + if (!hasActiveSet) { + activeState = "normal"; + } else { + activeState = "active"; + const values = data.getValues(dataDimensions, dataIndex); + for (let j = 0, lenj = dimensions.length; j < lenj; j++) { + const state = axisModels[j].getActiveState(values[j]); + if (state === "inactive") { + activeState = "inactive"; + break; } } - }; - SliderTimelineView.type = 'timeline.slider'; - return SliderTimelineView; - }(TimelineView); - function createScaleByModel$1(model, axisType) { - axisType = axisType || model.get('type'); - if (axisType) { - switch (axisType) { - // Buildin scale - case 'category': - return new OrdinalScale({ - ordinalMeta: model.getCategories(), - extent: [Infinity, -Infinity] - }); - case 'time': - return new TimeScale({ - locale: model.ecModel.getLocaleModel(), - useUTC: model.ecModel.get('useUTC') - }); - default: - // default to be value - return new IntervalScale(); - } + } + callback(activeState, dataIndex); + } + } + hasAxisBrushed() { + const dimensions = this.dimensions; + const axesMap = this._axesMap; + let hasActiveSet = false; + for (let j = 0, lenj = dimensions.length; j < lenj; j++) { + if (axesMap.get(dimensions[j]).model.getActiveState() !== "normal") { + hasActiveSet = true; + } + } + return hasActiveSet; + } + axisCoordToPoint(coord, dim) { + const axisLayout = this._axesLayout[dim]; + return applyTransform2([coord, 0], axisLayout.transform); + } + getAxisLayout(dim) { + return clone(this._axesLayout[dim]); + } + getSlidedAxisExpandWindow(point) { + const layoutInfo = this._makeLayoutInfo(); + const pixelDimIndex = layoutInfo.pixelDimIndex; + let axisExpandWindow = layoutInfo.axisExpandWindow.slice(); + const winSize = axisExpandWindow[1] - axisExpandWindow[0]; + const extent3 = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; + if (!this.containPoint(point)) { + return {behavior: "none", axisExpandWindow}; + } + const pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; + let delta; + let behavior = "slide"; + const axisCollapseWidth = layoutInfo.axisCollapseWidth; + const triggerArea = this._model.get("axisExpandSlideTriggerArea"); + const useJump = triggerArea[0] != null; + if (axisCollapseWidth) { + if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) { + behavior = "jump"; + delta = pointCoord - winSize * triggerArea[2]; + } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) { + behavior = "jump"; + delta = pointCoord - winSize * (1 - triggerArea[2]); + } else { + (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0); + } + delta *= layoutInfo.axisExpandWidth / axisCollapseWidth; + delta ? sliderMove(delta, axisExpandWindow, extent3, "all") : behavior = "none"; + } else { + const winSize2 = axisExpandWindow[1] - axisExpandWindow[0]; + const pos = extent3[1] * pointCoord / winSize2; + axisExpandWindow = [mathMax9(0, pos - winSize2 / 2)]; + axisExpandWindow[1] = mathMin9(extent3[1], axisExpandWindow[0] + winSize2); + axisExpandWindow[0] = axisExpandWindow[1] - winSize2; + } + return { + axisExpandWindow, + behavior + }; + } +}; +function restrict2(len2, extent3) { + return mathMin9(mathMax9(len2, extent3[0]), extent3[1]); +} +function layoutAxisWithoutExpand(axisIndex, layoutInfo) { + const step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1); + return { + position: step * axisIndex, + axisNameAvailableWidth: step, + axisLabelShow: true + }; +} +function layoutAxisWithExpand(axisIndex, layoutInfo) { + const layoutLength = layoutInfo.layoutLength; + const axisExpandWidth = layoutInfo.axisExpandWidth; + const axisCount = layoutInfo.axisCount; + const axisCollapseWidth = layoutInfo.axisCollapseWidth; + const winInnerIndices = layoutInfo.winInnerIndices; + let position2; + let axisNameAvailableWidth = axisCollapseWidth; + let axisLabelShow = false; + let nameTruncateMaxWidth; + if (axisIndex < winInnerIndices[0]) { + position2 = axisIndex * axisCollapseWidth; + nameTruncateMaxWidth = axisCollapseWidth; + } else if (axisIndex <= winInnerIndices[1]) { + position2 = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0]; + axisNameAvailableWidth = axisExpandWidth; + axisLabelShow = true; + } else { + position2 = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth; + nameTruncateMaxWidth = axisCollapseWidth; + } + return { + position: position2, + axisNameAvailableWidth, + axisLabelShow, + nameTruncateMaxWidth + }; +} +var Parallel_default = Parallel; + +// src/coord/parallel/parallelCreator.ts +function createParallelCoordSys(ecModel, api2) { + const coordSysList = []; + ecModel.eachComponent("parallel", function(parallelModel, idx) { + const coordSys = new Parallel_default(parallelModel, ecModel, api2); + coordSys.name = "parallel_" + idx; + coordSys.resize(parallelModel, api2); + parallelModel.coordinateSystem = coordSys; + coordSys.model = parallelModel; + coordSysList.push(coordSys); + }); + ecModel.eachSeries(function(seriesModel) { + if (seriesModel.get("coordinateSystem") === "parallel") { + const parallelModel = seriesModel.getReferringComponents("parallel", SINGLE_REFERRING).models[0]; + seriesModel.coordinateSystem = parallelModel.coordinateSystem; + } + }); + return coordSysList; +} +var parallelCoordSysCreator = { + create: createParallelCoordSys +}; +var parallelCreator_default = parallelCoordSysCreator; + +// src/coord/parallel/AxisModel.ts +var ParallelAxisModel = class extends Component_default { + constructor() { + super(...arguments); + this.type = ParallelAxisModel.type; + this.activeIntervals = []; + } + getAreaSelectStyle() { + return makeStyleMapper([ + ["fill", "color"], + ["lineWidth", "borderWidth"], + ["stroke", "borderColor"], + ["width", "width"], + ["opacity", "opacity"] + ])(this.getModel("areaSelectStyle")); + } + setActiveIntervals(intervals) { + const activeIntervals = this.activeIntervals = clone(intervals); + if (activeIntervals) { + for (let i = activeIntervals.length - 1; i >= 0; i--) { + asc(activeIntervals[i]); + } + } + } + getActiveState(value) { + const activeIntervals = this.activeIntervals; + if (!activeIntervals.length) { + return "normal"; + } + if (value == null || isNaN(+value)) { + return "inactive"; + } + if (activeIntervals.length === 1) { + const interval = activeIntervals[0]; + if (interval[0] <= value && value <= interval[1]) { + return "active"; + } + } else { + for (let i = 0, len2 = activeIntervals.length; i < len2; i++) { + if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) { + return "active"; + } + } + } + return "inactive"; + } +}; +mixin(ParallelAxisModel, AxisModelCommonMixin); +var AxisModel_default = ParallelAxisModel; + +// src/component/helper/BrushController.ts +var BRUSH_PANEL_GLOBAL = true; +var mathMin10 = Math.min; +var mathMax10 = Math.max; +var mathPow3 = Math.pow; +var COVER_Z = 1e4; +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(210,219,238,0.3)", + fill: "#D2DBEE" + }, + transformable: true, + brushMode: "single", + removeOnClick: false +}; +var baseUID = 0; +var BrushController = class extends Eventful_default { + constructor(zr) { + super(); + this._track = []; + this._covers = []; + this._handlers = {}; + if (true) { + assert(zr); + } + this._zr = zr; + this.group = new Group_default(); + this._uid = "brushController_" + baseUID++; + each(pointerHandlers, function(handler, eventName) { + this._handlers[eventName] = bind(handler, this); + }, this); + } + enableBrush(brushOption) { + if (true) { + assert(this._mounted); + } + this._brushType && this._doDisableBrush(); + brushOption.brushType && this._doEnableBrush(brushOption); + return this; + } + _doEnableBrush(brushOption) { + const zr = this._zr; + if (!this._enableGlobalPan) { + take(zr, MUTEX_RESOURCE_KEY, this._uid); + } + each(this._handlers, function(handler, eventName) { + zr.on(eventName, handler); + }); + this._brushType = brushOption.brushType; + this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); + } + _doDisableBrush() { + const zr = this._zr; + release(zr, MUTEX_RESOURCE_KEY, this._uid); + each(this._handlers, function(handler, eventName) { + zr.off(eventName, handler); + }); + this._brushType = this._brushOption = null; + } + setPanels(panelOpts) { + if (panelOpts && panelOpts.length) { + const panels = this._panels = {}; + each(panelOpts, function(panelOpts2) { + panels[panelOpts2.panelId] = clone(panelOpts2); + }); + } else { + this._panels = null; + } + return this; + } + mount(opt) { + opt = opt || {}; + if (true) { + this._mounted = true; + } + this._enableGlobalPan = opt.enableGlobalPan; + const thisGroup = this.group; + this._zr.add(thisGroup); + thisGroup.attr({ + x: opt.x || 0, + y: opt.y || 0, + rotation: opt.rotation || 0, + scaleX: opt.scaleX || 1, + scaleY: opt.scaleY || 1 + }); + this._transform = thisGroup.getLocalTransform(); + return this; + } + updateCovers(coverConfigList) { + if (true) { + assert(this._mounted); + } + coverConfigList = map(coverConfigList, function(coverConfig) { + return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true); + }); + const tmpIdPrefix = "\0-brush-index-"; + const oldCovers = this._covers; + const newCovers = this._covers = []; + const controller = this; + const creatingCover = this._creatingCover; + new DataDiffer_default(oldCovers, coverConfigList, oldGetKey, getKey2).add(addOrUpdate).update(addOrUpdate).remove(remove).execute(); + return this; + function getKey2(brushOption, index) { + return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + "-" + brushOption.brushType; + } + function oldGetKey(cover, index) { + return getKey2(cover.__brushOption, index); + } + function addOrUpdate(newIndex, oldIndex) { + const newBrushInternal = coverConfigList[newIndex]; + if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { + newCovers[newIndex] = oldCovers[oldIndex]; + } else { + const cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal)); + updateCoverAfterCreation(controller, cover); } } - function getViewRect$5(model, api) { - return getLayoutRect(model.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }, model.get('padding')); + function remove(oldIndex) { + if (oldCovers[oldIndex] !== creatingCover) { + controller.group.remove(oldCovers[oldIndex]); + } } - function makeControlIcon(timelineModel, objPath, rect, opts) { - var style = opts.style; - var icon = createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3])); - // TODO createIcon won't use style in opt. - if (style) { - icon.setStyle(style); + } + unmount() { + if (true) { + if (!this._mounted) { + return; } - 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.setStyle(itemStyle); - // Transform and events. - opt = merge({ - rectHover: true, - z2: 100 - }, opt, true); - var symbolSize = normalizeSymbolSize(hostModel.get('symbolSize')); - opt.scaleX = symbolSize[0] / 2; - opt.scaleY = symbolSize[1] / 2; - var symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize); - if (symbolOffset) { - opt.x = (opt.x || 0) + symbolOffset[0]; - opt.y = (opt.y || 0) + symbolOffset[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, progressLine, dataIndex, axis, timelineModel, noAnimation) { - if (pointer.dragging) { + this.enableBrush(false); + clearCovers(this); + this._zr.remove(this.group); + if (true) { + this._mounted = false; + } + return this; + } + dispose() { + this.unmount(); + this.off(); + } +}; +function createCover(controller, brushOption) { + const cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption); + cover.__brushOption = brushOption; + updateZ(cover, brushOption); + controller.group.add(cover); + return cover; +} +function endCreating(controller, creatingCover) { + const coverRenderer = getCoverRenderer(creatingCover); + if (coverRenderer.endCreating) { + coverRenderer.endCreating(controller, creatingCover); + updateZ(creatingCover, creatingCover.__brushOption); + } + return creatingCover; +} +function updateCoverShape(controller, cover) { + const brushOption = cover.__brushOption; + getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption); +} +function updateZ(cover, brushOption) { + let z = brushOption.z; + z == null && (z = COVER_Z); + cover.traverse(function(el) { + el.z = z; + el.z2 = z; + }); +} +function updateCoverAfterCreation(controller, cover) { + getCoverRenderer(cover).updateCommon(controller, cover); + updateCoverShape(controller, cover); +} +function getCoverRenderer(cover) { + return coverRenderers[cover.__brushOption.brushType]; +} +function getPanelByPoint(controller, e2, localCursorPoint) { + const panels = controller._panels; + if (!panels) { + return BRUSH_PANEL_GLOBAL; + } + let panel; + const transform2 = controller._transform; + each(panels, function(pn) { + pn.isTargetByCursor(e2, localCursorPoint, transform2) && (panel = pn); + }); + return panel; +} +function getPanelByCover(controller, cover) { + const panels = controller._panels; + if (!panels) { + return BRUSH_PANEL_GLOBAL; + } + const panelId = cover.__brushOption.panelId; + return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL; +} +function clearCovers(controller) { + const covers = controller._covers; + const originalLength = covers.length; + each(covers, function(cover) { + controller.group.remove(cover); + }, controller); + covers.length = 0; + return !!originalLength; +} +function trigger2(controller, opt) { + const areas = map(controller._covers, function(cover) { + const brushOption = cover.__brushOption; + const range = clone(brushOption.range); + return { + brushType: brushOption.brushType, + panelId: brushOption.panelId, + range + }; + }); + controller.trigger("brush", { + areas, + isEnd: !!opt.isEnd, + removeOnClick: !!opt.removeOnClick + }); +} +function shouldShowCover(controller) { + const track = controller._track; + if (!track.length) { + return false; + } + const p2 = track[track.length - 1]; + const p1 = track[0]; + const dx = p2[0] - p1[0]; + const dy = p2[1] - p1[1]; + const dist3 = mathPow3(dx * dx + dy * dy, 0.5); + return dist3 > UNSELECT_THRESHOLD; +} +function getTrackEnds(track) { + let tail = track.length - 1; + tail < 0 && (tail = 0); + return [track[0], track[tail]]; +} +function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) { + const cover = new Group_default(); + cover.add(new Rect_default({ + name: "main", + style: makeStyle(brushOption), + silent: true, + draggable: true, + cursor: "move", + drift: curry(driftRect, rectRangeConverter, controller, cover, ["n", "s", "w", "e"]), + ondragend: curry(trigger2, controller, {isEnd: true}) + })); + each(edgeNameSequences, function(nameSequence) { + cover.add(new Rect_default({ + name: nameSequence.join(""), + style: {opacity: 0}, + draggable: true, + silent: true, + invisible: true, + drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence), + ondragend: curry(trigger2, controller, {isEnd: true}) + })); + }); + return cover; +} +function updateBaseRect(controller, cover, localRange, brushOption) { + const lineWidth = brushOption.brushStyle.lineWidth || 0; + const handleSize = mathMax10(lineWidth, MIN_RESIZE_LINE_WIDTH); + const x = localRange[0][0]; + const y = localRange[1][0]; + const xa = x - lineWidth / 2; + const ya = y - lineWidth / 2; + const x2 = localRange[0][1]; + const y2 = localRange[1][1]; + const x2a = x2 - handleSize + lineWidth / 2; + const y2a = y2 - handleSize + lineWidth / 2; + const width = x2 - x; + const height = y2 - y; + const widtha = width + lineWidth; + const 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) { + const brushOption = cover.__brushOption; + const transformable = brushOption.transformable; + const mainEl = cover.childAt(0); + mainEl.useStyle(makeStyle(brushOption)); + mainEl.attr({ + silent: !transformable, + cursor: transformable ? "move" : "default" + }); + each([["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]], function(nameSequence) { + const el = cover.childOfName(nameSequence.join("")); + const globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence); + el && el.attr({ + silent: !transformable, + invisible: !transformable, + cursor: transformable ? CURSOR_MAP[globalDir] + "-resize" : null + }); + }); +} +function updateRectShape(controller, cover, name, x, y, w, h) { + const el = cover.childOfName(name); + el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]]))); +} +function makeStyle(brushOption) { + return defaults({strokeNoScale: true}, brushOption.brushStyle); +} +function formatRectRange(x, y, x2, y2) { + const min3 = [mathMin10(x, x2), mathMin10(y, y2)]; + const max3 = [mathMax10(x, x2), mathMax10(y, y2)]; + return [ + [min3[0], max3[0]], + [min3[1], max3[1]] + ]; +} +function getTransform2(controller) { + return getTransform(controller.group); +} +function getGlobalDirection1(controller, localDirName) { + const map3 = {w: "left", e: "right", n: "top", s: "bottom"}; + const inverseMap = {left: "w", right: "e", top: "n", bottom: "s"}; + const dir3 = transformDirection(map3[localDirName], getTransform2(controller)); + return inverseMap[dir3]; +} +function getGlobalDirection2(controller, localDirNameSeq) { + const globalDir = [ + getGlobalDirection1(controller, localDirNameSeq[0]), + getGlobalDirection1(controller, localDirNameSeq[1]) + ]; + (globalDir[0] === "e" || globalDir[0] === "w") && globalDir.reverse(); + return globalDir.join(""); +} +function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) { + const brushOption = cover.__brushOption; + const rectRange = rectRangeConverter.toRectRange(brushOption.range); + const localDelta = toLocalDelta(controller, dx, dy); + each(dirNameSequence, function(dirName) { + const ind = DIRECTION_MAP[dirName]; + rectRange[ind[0]][ind[1]] += localDelta[ind[0]]; + }); + brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1])); + updateCoverAfterCreation(controller, cover); + trigger2(controller, {isEnd: false}); +} +function driftPolygon(controller, cover, dx, dy) { + const range = cover.__brushOption.range; + const localDelta = toLocalDelta(controller, dx, dy); + each(range, function(point) { + point[0] += localDelta[0]; + point[1] += localDelta[1]; + }); + updateCoverAfterCreation(controller, cover); + trigger2(controller, {isEnd: false}); +} +function toLocalDelta(controller, dx, dy) { + const thisGroup = controller.group; + const localD = thisGroup.transformCoordToLocal(dx, dy); + const localZero = thisGroup.transformCoordToLocal(0, 0); + return [localD[0] - localZero[0], localD[1] - localZero[1]]; +} +function clipByPanel(controller, cover, data) { + const panel = getPanelByCover(controller, cover); + return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data); +} +function pointsToRect(points4) { + const xmin = mathMin10(points4[0][0], points4[1][0]); + const ymin = mathMin10(points4[0][1], points4[1][1]); + const xmax = mathMax10(points4[0][0], points4[1][0]); + const ymax = mathMax10(points4[0][1], points4[1][1]); + return { + x: xmin, + y: ymin, + width: xmax - xmin, + height: ymax - ymin + }; +} +function resetCursor(controller, e2, localCursorPoint) { + if (!controller._brushType || isOutsideZrArea(controller, e2.offsetX, e2.offsetY)) { + return; + } + const zr = controller._zr; + const covers = controller._covers; + const currPanel = getPanelByPoint(controller, e2, localCursorPoint); + if (!controller._dragging) { + for (let i = 0; i < covers.length; i++) { + const brushOption = covers[i].__brushOption; + if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) { return; } - var pointerModel = timelineModel.getModel('checkpointStyle'); - var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex)); - if (noAnimation || !pointerModel.get('animation', true)) { - pointer.attr({ - x: toCoord, - y: 0 - }); - progressLine && progressLine.attr({ - shape: { - x2: toCoord - } - }); + } + } + currPanel && zr.setCursorStyle("crosshair"); +} +function preventDefault(e2) { + const rawE = e2.event; + rawE.preventDefault && rawE.preventDefault(); +} +function mainShapeContain(cover, x, y) { + return cover.childOfName("main").contain(x, y); +} +function updateCoverByMouse(controller, e2, localCursorPoint, isEnd) { + let creatingCover = controller._creatingCover; + const panel = controller._creatingPanel; + const thisBrushOption = controller._brushOption; + let eventParams; + controller._track.push(localCursorPoint.slice()); + if (shouldShowCover(controller) || creatingCover) { + if (panel && !creatingCover) { + thisBrushOption.brushMode === "single" && clearCovers(controller); + const brushOption = clone(thisBrushOption); + brushOption.brushType = determineBrushType(brushOption.brushType, panel); + brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId; + creatingCover = controller._creatingCover = createCover(controller, brushOption); + controller._covers.push(creatingCover); + } + if (creatingCover) { + const coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)]; + const 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}; + } + } else if (isEnd && thisBrushOption.brushMode === "single" && thisBrushOption.removeOnClick) { + if (getPanelByPoint(controller, e2, localCursorPoint) && clearCovers(controller)) { + eventParams = {isEnd, removeOnClick: true}; + } + } + return eventParams; +} +function determineBrushType(brushType, panel) { + if (brushType === "auto") { + if (true) { + assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is "atuo"'); + } + return panel.defaultBrushType; + } + return brushType; +} +var pointerHandlers = { + mousedown: function(e2) { + if (this._dragging) { + handleDragEnd(this, e2); + } else if (!e2.target || !e2.target.draggable) { + preventDefault(e2); + const localCursorPoint = this.group.transformCoordToLocal(e2.offsetX, e2.offsetY); + this._creatingCover = null; + const panel = this._creatingPanel = getPanelByPoint(this, e2, localCursorPoint); + if (panel) { + this._dragging = true; + this._track = [localCursorPoint.slice()]; + } + } + }, + mousemove: function(e2) { + const x = e2.offsetX; + const y = e2.offsetY; + const localCursorPoint = this.group.transformCoordToLocal(x, y); + resetCursor(this, e2, localCursorPoint); + if (this._dragging) { + preventDefault(e2); + const eventParams = updateCoverByMouse(this, e2, localCursorPoint, false); + eventParams && trigger2(this, eventParams); + } + }, + mouseup: function(e2) { + handleDragEnd(this, e2); + } +}; +function handleDragEnd(controller, e2) { + if (controller._dragging) { + preventDefault(e2); + const x = e2.offsetX; + const y = e2.offsetY; + const localCursorPoint = controller.group.transformCoordToLocal(x, y); + const eventParams = updateCoverByMouse(controller, e2, localCursorPoint, true); + controller._dragging = false; + controller._track = []; + controller._creatingCover = null; + eventParams && trigger2(controller, eventParams); + } +} +function isOutsideZrArea(controller, x, y) { + const zr = controller._zr; + return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight(); +} +var coverRenderers = { + lineX: getLineRenderer(0), + lineY: getLineRenderer(1), + rect: { + createCover: function(controller, brushOption) { + function returnInput(range) { + return range; + } + return createBaseRectCover({ + toRectRange: returnInput, + fromRectRange: returnInput + }, controller, brushOption, [["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]]); + }, + getCreatingRange: function(localTrack) { + const 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, + contain: mainShapeContain + }, + polygon: { + createCover: function(controller, brushOption) { + const cover = new Group_default(); + cover.add(new Polyline_default({ + name: "main", + style: makeStyle(brushOption), + silent: true + })); + return cover; + }, + getCreatingRange: function(localTrack) { + return localTrack; + }, + endCreating: function(controller, cover) { + cover.remove(cover.childAt(0)); + cover.add(new Polygon_default({ + name: "main", + draggable: true, + drift: curry(driftPolygon, controller, cover), + ondragend: curry(trigger2, controller, {isEnd: true}) + })); + }, + updateCoverShape: function(controller, cover, localRange, brushOption) { + cover.childAt(0).setShape({ + points: clipByPanel(controller, cover, localRange) + }); + }, + updateCommon, + contain: mainShapeContain + } +}; +function getLineRenderer(xyIndex) { + return { + createCover: function(controller, brushOption) { + return createBaseRectCover({ + toRectRange: function(range) { + const rectRange = [range, [0, 100]]; + xyIndex && rectRange.reverse(); + return rectRange; + }, + fromRectRange: function(rectRange) { + return rectRange[xyIndex]; + } + }, controller, brushOption, [[["w"], ["e"]], [["n"], ["s"]]][xyIndex]); + }, + getCreatingRange: function(localTrack) { + const ends = getTrackEnds(localTrack); + const min3 = mathMin10(ends[0][xyIndex], ends[1][xyIndex]); + const max3 = mathMax10(ends[0][xyIndex], ends[1][xyIndex]); + return [min3, max3]; + }, + updateCoverShape: function(controller, cover, localRange, brushOption) { + let otherExtent; + const panel = getPanelByCover(controller, cover); + if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) { + otherExtent = panel.getLinearBrushOtherExtent(xyIndex); } else { - var animationCfg = { - duration: pointerModel.get('animationDuration', true), - easing: pointerModel.get('animationEasing', true) - }; - pointer.stopAnimation(null, true); - pointer.animateTo({ - x: toCoord, - y: 0 - }, animationCfg); - progressLine && progressLine.animateTo({ - shape: { - x2: toCoord - } - }, animationCfg); + const zr = controller._zr; + otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]]; } + const rectRange = [localRange, otherExtent]; + xyIndex && rectRange.reverse(); + updateBaseRect(controller, cover, rectRange, brushOption); + }, + updateCommon, + contain: mainShapeContain + }; +} +var BrushController_default = BrushController; + +// src/component/helper/brushHelper.ts +function makeRectPanelClipPath(rect) { + rect = normalizeRect(rect); + return function(localPoints) { + return clipPointsByRect(localPoints, rect); + }; +} +function makeLinearBrushOtherExtent(rect, specifiedXYIndex) { + rect = normalizeRect(rect); + return function(xyIndex) { + const idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex; + const brushWidth = idx ? rect.width : rect.height; + const base2 = idx ? rect.x : rect.y; + return [base2, base2 + (brushWidth || 0)]; + }; +} +function makeRectIsTargetByCursor(rect, api2, targetModel) { + const boundingRect = normalizeRect(rect); + return function(e2, localCursorPoint) { + return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e2, api2, targetModel); + }; +} +function normalizeRect(rect) { + return BoundingRect_default.create(rect); +} + +// src/component/axis/ParallelAxisView.ts +var elementList = ["axisLine", "axisTickLabel", "axisName"]; +var ParallelAxisView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = ParallelAxisView2.type; + } + init(ecModel, api2) { + super.init.apply(this, arguments); + (this._brushController = new BrushController_default(api2.getZr())).on("brush", bind(this._onBrush, this)); + } + render(axisModel, ecModel, api2, payload) { + if (fromAxisAreaSelect(axisModel, ecModel, payload)) { + return; + } + this.axisModel = axisModel; + this.api = api2; + this.group.removeAll(); + const oldAxisGroup = this._axisGroup; + this._axisGroup = new Group_default(); + this.group.add(this._axisGroup); + if (!axisModel.get("show")) { + return; + } + const coordSysModel = getCoordSysModel(axisModel, ecModel); + const coordSys = coordSysModel.coordinateSystem; + const areaSelectStyle = axisModel.getAreaSelectStyle(); + const areaWidth = areaSelectStyle.width; + const dim = axisModel.axis.dim; + const axisLayout = coordSys.getAxisLayout(dim); + const builderOpt = extend({strokeContainThreshold: areaWidth}, axisLayout); + const axisBuilder = new AxisBuilder_default(axisModel, builderOpt); + each(elementList, axisBuilder.add, axisBuilder); + this._axisGroup.add(axisBuilder.getGroup()); + this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api2); + groupTransition(oldAxisGroup, this._axisGroup, axisModel); + } + _refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api2) { + const extent3 = axisModel.axis.getExtent(); + const extentLen = extent3[1] - extent3[0]; + const extra = Math.min(30, Math.abs(extentLen) * 0.1); + const rect = BoundingRect_default.create({ + x: extent3[0], + y: -areaWidth / 2, + width: extentLen, + height: areaWidth + }); + rect.x -= extra; + rect.width += 2 * extra; + this._brushController.mount({ + enableGlobalPan: true, + rotation: builderOpt.rotation, + x: builderOpt.position[0], + y: builderOpt.position[1] + }).setPanels([{ + panelId: "pl", + clipPath: makeRectPanelClipPath(rect), + isTargetByCursor: makeRectIsTargetByCursor(rect, api2, coordSysModel), + getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0) + }]).enableBrush({ + brushType: "lineX", + brushStyle: areaSelectStyle, + removeOnClick: true + }).updateCovers(getCoverInfoList(axisModel)); + } + _onBrush(eventParam) { + const coverInfoList = eventParam.areas; + const axisModel = this.axisModel; + const axis = axisModel.axis; + const intervals = map(coverInfoList, function(coverInfo) { + return [ + axis.coordToData(coverInfo.range[0], true), + axis.coordToData(coverInfo.range[1], true) + ]; + }); + if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) { + this.api.dispatchAction({ + type: "axisAreaSelect", + parallelAxisId: axisModel.id, + intervals + }); } - - function installTimelineAction(registers) { - registers.registerAction({ - type: 'timelineChange', - event: 'timelineChanged', - update: 'prepareAndUpdate' - }, function (payload, ecModel, api) { - var timelineModel = ecModel.getComponent('timeline'); - if (timelineModel && payload.currentIndex != null) { - timelineModel.setCurrentIndex(payload.currentIndex); - if (!timelineModel.get('loop', true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) { - timelineModel.setPlayState(false); - // The timeline has played to the end, trigger event - api.dispatchAction({ - type: 'timelinePlayChange', - playState: false, - from: payload.from - }); + } + dispose() { + this._brushController.dispose(); + } +}; +var ParallelAxisView = ParallelAxisView2; +ParallelAxisView.type = "parallelAxis"; +function fromAxisAreaSelect(axisModel, ecModel, payload) { + return payload && payload.type === "axisAreaSelect" && ecModel.findComponents({mainType: "parallelAxis", query: payload})[0] === axisModel; +} +function getCoverInfoList(axisModel) { + const axis = axisModel.axis; + return map(axisModel.activeIntervals, function(interval) { + return { + brushType: "lineX", + panelId: "pl", + range: [ + axis.dataToCoord(interval[0], true), + axis.dataToCoord(interval[1], true) + ] + }; + }); +} +function getCoordSysModel(axisModel, ecModel) { + return ecModel.getComponent("parallel", axisModel.get("parallelIndex")); +} +var ParallelAxisView_default = ParallelAxisView; + +// src/component/axis/parallelAxisAction.ts +var actionInfo2 = { + type: "axisAreaSelect", + event: "axisAreaSelected" +}; +function installParallelActions(registers) { + registers.registerAction(actionInfo2, function(payload, ecModel) { + ecModel.eachComponent({mainType: "parallelAxis", query: payload}, function(parallelAxisModel) { + parallelAxisModel.axis.model.setActiveIntervals(payload.intervals); + }); + }); + registers.registerAction("parallelAxisExpand", function(payload, ecModel) { + ecModel.eachComponent({mainType: "parallel", query: payload}, function(parallelModel) { + parallelModel.setAxisExpand(payload); + }); + }); +} + +// src/component/parallel/install.ts +var defaultAxisOption = { + type: "value", + areaSelectStyle: { + width: 20, + borderWidth: 1, + borderColor: "rgba(160,197,232)", + color: "rgba(160,197,232)", + opacity: 0.3 + }, + realtime: true, + z: 10 +}; +function install17(registers) { + registers.registerComponentView(ParallelView_default2); + registers.registerComponentModel(ParallelModel_default); + registers.registerCoordinateSystem("parallel", parallelCreator_default); + registers.registerPreprocessor(parallelPreprocessor); + registers.registerComponentModel(AxisModel_default); + registers.registerComponentView(ParallelAxisView_default); + axisModelCreator(registers, "parallel", AxisModel_default, defaultAxisOption); + installParallelActions(registers); +} + +// src/chart/parallel/install.ts +function install18(registers) { + use(install17); + registers.registerChartView(ParallelView_default); + registers.registerSeriesModel(ParallelSeries_default); + registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual_default); +} + +// src/chart/sankey/SankeyView.ts +var SankeyPathShape = class { + constructor() { + this.x1 = 0; + this.y1 = 0; + this.x2 = 0; + this.y2 = 0; + this.cpx1 = 0; + this.cpy1 = 0; + this.cpx2 = 0; + this.cpy2 = 0; + this.extent = 0; + } +}; +var SankeyPath = class extends Path_default { + constructor(opts) { + super(opts); + } + getDefaultShape() { + return new SankeyPathShape(); + } + buildPath(ctx, shape) { + const extent3 = shape.extent; + ctx.moveTo(shape.x1, shape.y1); + ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2); + if (shape.orient === "vertical") { + ctx.lineTo(shape.x2 + extent3, shape.y2); + ctx.bezierCurveTo(shape.cpx2 + extent3, shape.cpy2, shape.cpx1 + extent3, shape.cpy1, shape.x1 + extent3, shape.y1); + } else { + ctx.lineTo(shape.x2, shape.y2 + extent3); + ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent3, shape.cpx1, shape.cpy1 + extent3, shape.x1, shape.y1 + extent3); + } + ctx.closePath(); + } + highlight() { + enterEmphasis(this); + } + downplay() { + leaveEmphasis(this); + } +}; +var SankeyView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = SankeyView2.type; + this._focusAdjacencyDisabled = false; + } + render(seriesModel, ecModel, api2) { + const sankeyView = this; + const graph = seriesModel.getGraph(); + const group = this.group; + const layoutInfo = seriesModel.layoutInfo; + const width = layoutInfo.width; + const height = layoutInfo.height; + const nodeData = seriesModel.getData(); + const edgeData = seriesModel.getData("edge"); + const orient = seriesModel.get("orient"); + this._model = seriesModel; + group.removeAll(); + group.x = layoutInfo.x; + group.y = layoutInfo.y; + graph.eachEdge(function(edge) { + const curve4 = new SankeyPath(); + const ecData = getECData(curve4); + ecData.dataIndex = edge.dataIndex; + ecData.seriesIndex = seriesModel.seriesIndex; + ecData.dataType = "edge"; + const edgeModel = edge.getModel(); + const lineStyleModel = edgeModel.getModel("lineStyle"); + const curvature = lineStyleModel.get("curveness"); + const n1Layout = edge.node1.getLayout(); + const node1Model = edge.node1.getModel(); + const dragX1 = node1Model.get("localX"); + const dragY1 = node1Model.get("localY"); + const n2Layout = edge.node2.getLayout(); + const node2Model = edge.node2.getModel(); + const dragX2 = node2Model.get("localX"); + const dragY2 = node2Model.get("localY"); + const edgeLayout = edge.getLayout(); + let x1; + let y1; + let x2; + let y2; + let cpx1; + let cpy1; + let cpx2; + let cpy2; + curve4.shape.extent = Math.max(1, edgeLayout.dy); + curve4.shape.orient = orient; + if (orient === "vertical") { + x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy; + y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy; + x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty; + y2 = dragY2 != null ? dragY2 * height : n2Layout.y; + cpx1 = x1; + cpy1 = y1 * (1 - curvature) + y2 * curvature; + cpx2 = x2; + cpy2 = y1 * curvature + y2 * (1 - curvature); + } else { + x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; + y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy; + x2 = dragX2 != null ? dragX2 * width : n2Layout.x; + y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty; + cpx1 = x1 * (1 - curvature) + x2 * curvature; + cpy1 = y1; + cpx2 = x1 * curvature + x2 * (1 - curvature); + cpy2 = y2; + } + curve4.setShape({ + x1, + y1, + x2, + y2, + cpx1, + cpy1, + cpx2, + cpy2 + }); + curve4.useStyle(lineStyleModel.getItemStyle()); + applyCurveStyle(curve4.style, orient, edge); + const defaultEdgeLabelText = `${edgeModel.get("value")}`; + const edgeLabelStateModels = getLabelStatesModels(edgeModel, "edgeLabel"); + setLabelStyle(curve4, edgeLabelStateModels, { + labelFetcher: { + getFormattedLabel(dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) { + return seriesModel.getFormattedLabel(dataIndex, stateName, "edge", labelDimIndex, retrieve3(formatter, edgeLabelStateModels.normal && edgeLabelStateModels.normal.get("formatter"), defaultEdgeLabelText), extendParams); } - } - // Set normalized currentIndex to payload. - ecModel.resetOption('timeline', { - replaceMerge: timelineModel.get('replaceMerge', true) - }); - return defaults({ - currentIndex: timelineModel.option.currentIndex - }, payload); + }, + labelDataIndex: edge.dataIndex, + defaultText: defaultEdgeLabelText }); - registers.registerAction({ - type: 'timelinePlayChange', - event: 'timelinePlayChanged', - update: 'update' - }, function (payload, ecModel) { - var timelineModel = ecModel.getComponent('timeline'); - if (timelineModel && payload.playState != null) { - timelineModel.setPlayState(payload.playState); - } + curve4.setTextConfig({position: "inside"}); + const emphasisModel = edgeModel.getModel("emphasis"); + setStatesStylesFromModel(curve4, edgeModel, "lineStyle", (model) => { + const style = model.getItemStyle(); + applyCurveStyle(style, orient, edge); + return style; }); - } - - function timelinePreprocessor(option) { - var timelineOpt = option && option.timeline; - if (!isArray(timelineOpt)) { - timelineOpt = timelineOpt ? [timelineOpt] : []; - } - each(timelineOpt, function (opt) { - if (!opt) { - return; - } - compatibleEC2(opt); + group.add(curve4); + edgeData.setItemGraphicEl(edge.dataIndex, curve4); + const focus = emphasisModel.get("focus"); + toggleHoverEmphasis(curve4, focus === "adjacency" ? edge.getAdjacentDataIndices() : focus === "trajectory" ? edge.getTrajectoryDataIndices() : focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + }); + graph.eachNode(function(node) { + const layout18 = node.getLayout(); + const itemModel = node.getModel(); + const dragX = itemModel.get("localX"); + const dragY = itemModel.get("localY"); + const emphasisModel = itemModel.getModel("emphasis"); + const borderRadius = itemModel.get(["itemStyle", "borderRadius"]) || 0; + const rect = new Rect_default({ + shape: { + x: dragX != null ? dragX * width : layout18.x, + y: dragY != null ? dragY * height : layout18.y, + width: layout18.dx, + height: layout18.dy, + r: borderRadius + }, + style: itemModel.getModel("itemStyle").getItemStyle(), + z2: 10 }); - } - function compatibleEC2(opt) { - var type = opt.type; - var ec2Types = { - 'number': 'value', - 'time': 'time' - }; - // Compatible with ec2 - if (ec2Types[type]) { - opt.axisType = ec2Types[type]; - delete opt.type; - } - transferItem(opt); - if (has(opt, 'controlPosition')) { - var controlStyle = opt.controlStyle || (opt.controlStyle = {}); - if (!has(controlStyle, 'position')) { - controlStyle.position = opt.controlPosition; - } - if (controlStyle.position === 'none' && !has(controlStyle, 'show')) { - controlStyle.show = false; - delete controlStyle.position; - } - delete opt.controlPosition; - } - each(opt.data || [], function (dataItem) { - if (isObject(dataItem) && !isArray(dataItem)) { - if (!has(dataItem, 'value') && has(dataItem, 'name')) { - // In ec2, using name as value. - dataItem.value = dataItem.name; + setLabelStyle(rect, getLabelStatesModels(itemModel), { + labelFetcher: { + getFormattedLabel(dataIndex, stateName) { + return seriesModel.getFormattedLabel(dataIndex, stateName, "node"); } - transferItem(dataItem); - } + }, + labelDataIndex: node.dataIndex, + defaultText: node.id }); + rect.disableLabelAnimation = true; + rect.setStyle("fill", node.getVisual("color")); + rect.setStyle("decal", node.getVisual("style").decal); + setStatesStylesFromModel(rect, itemModel); + group.add(rect); + nodeData.setItemGraphicEl(node.dataIndex, rect); + getECData(rect).dataType = "node"; + const focus = emphasisModel.get("focus"); + toggleHoverEmphasis(rect, focus === "adjacency" ? node.getAdjacentDataIndices() : focus === "trajectory" ? node.getTrajectoryDataIndices() : focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + }); + nodeData.eachItemGraphicEl(function(el, dataIndex) { + const itemModel = nodeData.getItemModel(dataIndex); + if (itemModel.get("draggable")) { + el.drift = function(dx, dy) { + sankeyView._focusAdjacencyDisabled = true; + this.shape.x += dx; + this.shape.y += dy; + this.dirty(); + api2.dispatchAction({ + type: "dragNode", + seriesId: seriesModel.id, + dataIndex: nodeData.getRawIndex(dataIndex), + localX: this.shape.x / width, + localY: this.shape.y / height + }); + }; + el.ondragend = function() { + sankeyView._focusAdjacencyDisabled = false; + }; + el.draggable = true; + el.cursor = "move"; + } + }); + if (!this._data && seriesModel.isAnimationEnabled()) { + group.setClipPath(createGridClipShape2(group.getBoundingRect(), seriesModel, function() { + group.removeClipPath(); + })); } - function transferItem(opt) { - var itemStyle = opt.itemStyle || (opt.itemStyle = {}); - var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); - // Transfer label out - var label = opt.label || opt.label || {}; - var labelNormal = label.normal || (label.normal = {}); - var excludeLabelAttr = { - normal: 1, - emphasis: 1 - }; - each(label, function (value, name) { - if (!excludeLabelAttr[name] && !has(labelNormal, name)) { - labelNormal[name] = value; + this._data = seriesModel.getData(); + } + dispose() { + } +}; +var SankeyView = SankeyView2; +SankeyView.type = "sankey"; +function applyCurveStyle(curveProps, orient, edge) { + switch (curveProps.fill) { + case "source": + curveProps.fill = edge.node1.getVisual("color"); + curveProps.decal = edge.node1.getVisual("style").decal; + break; + case "target": + curveProps.fill = edge.node2.getVisual("color"); + curveProps.decal = edge.node2.getVisual("style").decal; + break; + case "gradient": + const sourceColor = edge.node1.getVisual("color"); + const targetColor = edge.node2.getVisual("color"); + if (isString(sourceColor) && isString(targetColor)) { + curveProps.fill = new LinearGradient_default(0, 0, +(orient === "horizontal"), +(orient === "vertical"), [{ + color: sourceColor, + offset: 0 + }, { + color: targetColor, + offset: 1 + }]); + } + } +} +function createGridClipShape2(rect, seriesModel, cb) { + const rectEl = new Rect_default({ + shape: { + x: rect.x - 10, + y: rect.y - 10, + width: 0, + height: rect.height + 20 + } + }); + initProps(rectEl, { + shape: { + width: rect.width + 20 + } + }, seriesModel, cb); + return rectEl; +} +var SankeyView_default = SankeyView; + +// src/chart/sankey/SankeySeries.ts +var SankeySeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = SankeySeriesModel2.type; + } + getInitialData(option, ecModel) { + const links = option.edges || option.links || []; + const nodes = option.data || option.nodes || []; + const levels = option.levels || []; + this.levelModels = []; + const levelModels = this.levelModels; + for (let i = 0; i < levels.length; i++) { + if (levels[i].depth != null && levels[i].depth >= 0) { + levelModels[levels[i].depth] = new Model_default(levels[i], this, ecModel); + } else { + if (true) { + throw new Error("levels[i].depth is mandatory and should be natural number"); } - }); - if (itemStyleEmphasis.label && !has(label, 'emphasis')) { - label.emphasis = itemStyleEmphasis.label; - delete itemStyleEmphasis.label; } } - function has(obj, attr) { - return obj.hasOwnProperty(attr); + const graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink); + return graph.data; + function beforeLink(nodeData, edgeData) { + nodeData.wrapMethod("getItemModel", function(model, idx) { + const seriesModel = model.parentModel; + const layout18 = seriesModel.getData().getItemLayout(idx); + if (layout18) { + const nodeDepth = layout18.depth; + const levelModel = seriesModel.levelModels[nodeDepth]; + if (levelModel) { + model.parentModel = levelModel; + } + } + return model; + }); + edgeData.wrapMethod("getItemModel", function(model, idx) { + const seriesModel = model.parentModel; + const edge = seriesModel.getGraph().getEdgeByIndex(idx); + const layout18 = edge.node1.getLayout(); + if (layout18) { + const depth = layout18.depth; + const levelModel = seriesModel.levelModels[depth]; + if (levelModel) { + model.parentModel = levelModel; + } + } + return model; + }); } - - function install$D(registers) { - registers.registerComponentModel(SliderTimelineModel); - registers.registerComponentView(SliderTimelineView); - registers.registerSubTypeDefaulter('timeline', function () { - // Only slider now. - return 'slider'; + } + setNodePosition(dataIndex, localPosition) { + const nodes = this.option.data || this.option.nodes; + const dataItem = nodes[dataIndex]; + dataItem.localX = localPosition[0]; + dataItem.localY = localPosition[1]; + } + getGraph() { + return this.getData().graph; + } + getEdgeData() { + return this.getGraph().edgeData; + } + formatTooltip(dataIndex, multipleSeries, dataType) { + function noValue(val) { + return isNaN(val) || val == null; + } + if (dataType === "edge") { + const params = this.getDataParams(dataIndex, dataType); + const rawDataOpt = params.data; + const edgeValue = params.value; + const edgeName = rawDataOpt.source + " -- " + rawDataOpt.target; + return createTooltipMarkup("nameValue", { + name: edgeName, + value: edgeValue, + noValue: noValue(edgeValue) + }); + } else { + const node = this.getGraph().getNodeByIndex(dataIndex); + const value = node.getLayout().value; + const name = this.getDataParams(dataIndex, dataType).data.name; + return createTooltipMarkup("nameValue", { + name: name != null ? name + "" : null, + value, + noValue: noValue(value) }); - installTimelineAction(registers); - registers.registerPreprocessor(timelinePreprocessor); } - - function checkMarkerInSeries(seriesOpts, markerType) { - if (!seriesOpts) { - return false; + } + optionUpdated() { + } + getDataParams(dataIndex, dataType) { + const params = super.getDataParams(dataIndex, dataType); + if (params.value == null && dataType === "node") { + const node = this.getGraph().getNodeByIndex(dataIndex); + const nodeValue = node.getLayout().value; + params.value = nodeValue; + } + return params; + } +}; +var SankeySeriesModel = SankeySeriesModel2; +SankeySeriesModel.type = "series.sankey"; +SankeySeriesModel.defaultOption = { + z: 2, + coordinateSystem: "view", + left: "5%", + top: "5%", + right: "20%", + bottom: "5%", + orient: "horizontal", + nodeWidth: 20, + nodeGap: 8, + draggable: true, + layoutIterations: 32, + label: { + show: true, + position: "right", + fontSize: 12 + }, + edgeLabel: { + show: false, + fontSize: 12 + }, + levels: [], + nodeAlign: "justify", + lineStyle: { + color: "#314656", + opacity: 0.2, + curveness: 0.5 + }, + emphasis: { + label: { + show: true + }, + lineStyle: { + opacity: 0.5 + } + }, + select: { + itemStyle: { + borderColor: "#212121" + } + }, + animationEasing: "linear", + animationDuration: 1e3 +}; +var SankeySeries_default = SankeySeriesModel; + +// src/chart/sankey/sankeyLayout.ts +function sankeyLayout(ecModel, api2) { + ecModel.eachSeriesByType("sankey", function(seriesModel) { + const nodeWidth = seriesModel.get("nodeWidth"); + const nodeGap = seriesModel.get("nodeGap"); + const layoutInfo = getViewRect5(seriesModel, api2); + seriesModel.layoutInfo = layoutInfo; + const width = layoutInfo.width; + const height = layoutInfo.height; + const graph = seriesModel.getGraph(); + const nodes = graph.nodes; + const edges = graph.edges; + computeNodeValues(nodes); + const filteredNodes = filter(nodes, function(node) { + return node.getLayout().value === 0; + }); + const iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get("layoutIterations"); + const orient = seriesModel.get("orient"); + const nodeAlign = seriesModel.get("nodeAlign"); + layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign); + }); +} +function getViewRect5(seriesModel, api2) { + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api2.getWidth(), + height: api2.getHeight() + }); +} +function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) { + computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign); + computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient); + computeEdgeDepths(nodes, orient); +} +function computeNodeValues(nodes) { + each(nodes, function(node) { + const value1 = sum(node.outEdges, getEdgeValue); + const value2 = sum(node.inEdges, getEdgeValue); + const nodeRawValue = node.getValue() || 0; + const value = Math.max(value1, value2, nodeRawValue); + node.setLayout({value}, true); + }); +} +function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { + const remainEdges = []; + const indegreeArr = []; + let zeroIndegrees = []; + let nextTargetNode = []; + let x = 0; + for (let i = 0; i < edges.length; i++) { + remainEdges[i] = 1; + } + for (let i = 0; i < nodes.length; i++) { + indegreeArr[i] = nodes[i].inEdges.length; + if (indegreeArr[i] === 0) { + zeroIndegrees.push(nodes[i]); + } + } + let maxNodeDepth = -1; + while (zeroIndegrees.length) { + for (let idx = 0; idx < zeroIndegrees.length; idx++) { + const node = zeroIndegrees[idx]; + const item = node.hostGraph.data.getRawDataItem(node.dataIndex); + const isItemDepth = item.depth != null && item.depth >= 0; + if (isItemDepth && item.depth > maxNodeDepth) { + maxNodeDepth = item.depth; + } + node.setLayout({depth: isItemDepth ? item.depth : x}, true); + orient === "vertical" ? node.setLayout({dy: nodeWidth}, true) : node.setLayout({dx: nodeWidth}, true); + for (let edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) { + const edge = node.outEdges[edgeIdx]; + const indexEdge = edges.indexOf(edge); + remainEdges[indexEdge] = 0; + const targetNode = edge.node2; + const nodeIndex = nodes.indexOf(targetNode); + if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) { + nextTargetNode.push(targetNode); + } + } + } + ++x; + zeroIndegrees = nextTargetNode; + nextTargetNode = []; + } + for (let i = 0; i < remainEdges.length; i++) { + if (remainEdges[i] === 1) { + throw new Error("Sankey is a DAG, the original data has cycle!"); + } + } + const maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; + if (nodeAlign && nodeAlign !== "left") { + adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth); + } + const kx = orient === "vertical" ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth; + scaleNodeBreadths(nodes, kx, orient); +} +function isNodeDepth(node) { + const item = node.hostGraph.data.getRawDataItem(node.dataIndex); + return item.depth != null && item.depth >= 0; +} +function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) { + if (nodeAlign === "right") { + let nextSourceNode = []; + let remainNodes = nodes; + let nodeHeight = 0; + while (remainNodes.length) { + for (let i = 0; i < remainNodes.length; i++) { + const node = remainNodes[i]; + node.setLayout({skNodeHeight: nodeHeight}, true); + for (let j = 0; j < node.inEdges.length; j++) { + const edge = node.inEdges[j]; + if (nextSourceNode.indexOf(edge.node1) < 0) { + nextSourceNode.push(edge.node1); + } + } + } + remainNodes = nextSourceNode; + nextSourceNode = []; + ++nodeHeight; + } + each(nodes, function(node) { + if (!isNodeDepth(node)) { + node.setLayout({depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)}, true); } - var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts]; - for (var idx = 0; idx < seriesOptArr.length; idx++) { - if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) { - return true; + }); + } else if (nodeAlign === "justify") { + moveSinksRight(nodes, maxDepth); + } +} +function moveSinksRight(nodes, maxDepth) { + each(nodes, function(node) { + if (!isNodeDepth(node) && !node.outEdges.length) { + node.setLayout({depth: maxDepth}, true); + } + }); +} +function scaleNodeBreadths(nodes, kx, orient) { + each(nodes, function(node) { + const nodeDepth = node.getLayout().depth * kx; + orient === "vertical" ? node.setLayout({y: nodeDepth}, true) : node.setLayout({x: nodeDepth}, true); + }); +} +function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) { + const nodesByBreadth = prepareNodesByBreadth(nodes, orient); + initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); + for (let alpha = 1; iterations > 0; iterations--) { + alpha *= 0.99; + relaxRightToLeft(nodesByBreadth, alpha, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); + relaxLeftToRight(nodesByBreadth, alpha, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); + } +} +function prepareNodesByBreadth(nodes, orient) { + const nodesByBreadth = []; + const keyAttr = orient === "vertical" ? "y" : "x"; + const groupResult = groupData(nodes, function(node) { + return node.getLayout()[keyAttr]; + }); + groupResult.keys.sort(function(a, b) { + return a - b; + }); + each(groupResult.keys, function(key) { + nodesByBreadth.push(groupResult.buckets.get(key)); + }); + return nodesByBreadth; +} +function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) { + let minKy = Infinity; + each(nodesByBreadth, function(nodes) { + const n = nodes.length; + let sum2 = 0; + each(nodes, function(node) { + sum2 += node.getLayout().value; + }); + const ky = orient === "vertical" ? (width - (n - 1) * nodeGap) / sum2 : (height - (n - 1) * nodeGap) / sum2; + if (ky < minKy) { + minKy = ky; + } + }); + each(nodesByBreadth, function(nodes) { + each(nodes, function(node, i) { + const nodeDy = node.getLayout().value * minKy; + if (orient === "vertical") { + node.setLayout({x: i}, true); + node.setLayout({dx: nodeDy}, true); + } else { + node.setLayout({y: i}, true); + node.setLayout({dy: nodeDy}, true); + } + }); + }); + each(edges, function(edge) { + const edgeDy = +edge.getValue() * minKy; + edge.setLayout({dy: edgeDy}, true); + }); +} +function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { + const keyAttr = orient === "vertical" ? "x" : "y"; + each(nodesByBreadth, function(nodes) { + nodes.sort(function(a, b) { + return a.getLayout()[keyAttr] - b.getLayout()[keyAttr]; + }); + let nodeX; + let node; + let dy; + let y0 = 0; + const n = nodes.length; + const nodeDyAttr = orient === "vertical" ? "dx" : "dy"; + for (let i = 0; i < n; i++) { + node = nodes[i]; + dy = y0 - node.getLayout()[keyAttr]; + if (dy > 0) { + nodeX = node.getLayout()[keyAttr] + dy; + orient === "vertical" ? node.setLayout({x: nodeX}, true) : node.setLayout({y: nodeX}, true); + } + y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap; + } + const viewWidth = orient === "vertical" ? width : height; + dy = y0 - nodeGap - viewWidth; + if (dy > 0) { + nodeX = node.getLayout()[keyAttr] - dy; + orient === "vertical" ? node.setLayout({x: nodeX}, true) : node.setLayout({y: nodeX}, true); + y0 = nodeX; + for (let i = n - 2; i >= 0; --i) { + node = nodes[i]; + dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0; + if (dy > 0) { + nodeX = node.getLayout()[keyAttr] - dy; + orient === "vertical" ? node.setLayout({x: nodeX}, true) : node.setLayout({y: nodeX}, true); } + y0 = node.getLayout()[keyAttr]; } - return false; } - - function fillLabel(opt) { - defaultEmphasis(opt, 'label', ['show']); - } - // { [componentType]: MarkerModel } - var inner$g = makeInner(); - var MarkerModel = /** @class */function (_super) { - __extends(MarkerModel, _super); - function MarkerModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkerModel.type; - /** - * If marker model is created by self from series - */ - _this.createdBySelf = false; - return _this; - } - /** - * @overrite - */ - MarkerModel.prototype.init = function (option, parentModel, ecModel) { - if ("development" !== 'production') { - if (this.type === 'marker') { - throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.'); - } - } - this.mergeDefaultAndTheme(option, ecModel); - this._mergeOption(option, ecModel, false, true); - }; - MarkerModel.prototype.isAnimationEnabled = function () { - if (env.node) { - return false; - } - var hostSeries = this.__hostSeries; - return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled(); - }; - /** - * @overrite - */ - MarkerModel.prototype.mergeOption = function (newOpt, ecModel) { - this._mergeOption(newOpt, ecModel, false, false); - }; - MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) { - var componentType = this.mainType; - if (!createdBySelf) { - ecModel.eachSeries(function (seriesModel) { - // mainType can be markPoint, markLine, markArea - var markerOpt = seriesModel.get(this.mainType, true); - var markerModel = inner$g(seriesModel)[componentType]; - if (!markerOpt || !markerOpt.data) { - inner$g(seriesModel)[componentType] = null; - return; - } - if (!markerModel) { - if (isInit) { - // Default label emphasis `position` and `show` - fillLabel(markerOpt); - } - each(markerOpt.data, function (item) { - // FIXME Overwrite fillLabel method ? - if (item instanceof Array) { - fillLabel(item[0]); - fillLabel(item[1]); - } else { - fillLabel(item); - } - }); - markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel); - // markerModel = new ImplementedMarkerModel( - // markerOpt, this, ecModel - // ); - extend(markerModel, { - mainType: this.mainType, - // Use the same series index and name - seriesIndex: seriesModel.seriesIndex, - name: seriesModel.name, - createdBySelf: true - }); - markerModel.__hostSeries = seriesModel; - } else { - markerModel._mergeOption(markerOpt, ecModel, true); - } - inner$g(seriesModel)[componentType] = markerModel; - }, this); + }); +} +function relaxRightToLeft(nodesByBreadth, alpha, orient) { + each(nodesByBreadth.slice().reverse(), function(nodes) { + each(nodes, function(node) { + if (node.outEdges.length) { + let y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue); + if (isNaN(y)) { + const len2 = node.outEdges.length; + y = len2 ? sum(node.outEdges, centerTarget, orient) / len2 : 0; } - }; - MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var itemName = data.getName(dataIndex); - return createTooltipMarkup('section', { - header: this.name, - blocks: [createTooltipMarkup('nameValue', { - name: itemName, - value: value, - noName: !itemName, - noValue: value == null - })] - }); - }; - MarkerModel.prototype.getData = function () { - return this._data; - }; - MarkerModel.prototype.setData = function (data) { - this._data = data; - }; - MarkerModel.prototype.getDataParams = function (dataIndex, dataType) { - var params = DataFormatMixin.prototype.getDataParams.call(this, dataIndex, dataType); - var hostSeries = this.__hostSeries; - if (hostSeries) { - params.seriesId = hostSeries.id; - params.seriesName = hostSeries.name; - params.seriesType = hostSeries.subType; - } - return params; - }; - MarkerModel.getMarkerModelFromSeries = function (seriesModel, - // Support three types of markers. Strict check. - componentType) { - return inner$g(seriesModel)[componentType]; - }; - MarkerModel.type = 'marker'; - MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo']; - return MarkerModel; - }(ComponentModel); - mixin(MarkerModel, DataFormatMixin.prototype); - - var MarkPointModel = /** @class */function (_super) { - __extends(MarkPointModel, _super); - function MarkPointModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkPointModel.type; - return _this; - } - MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { - return new MarkPointModel(markerOpt, masterMarkerModel, ecModel); - }; - MarkPointModel.type = 'markPoint'; - MarkPointModel.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 - } + if (orient === "vertical") { + const nodeX = node.getLayout().x + (y - center2(node, orient)) * alpha; + node.setLayout({x: nodeX}, true); + } else { + const nodeY = node.getLayout().y + (y - center2(node, orient)) * alpha; + node.setLayout({y: nodeY}, true); } - }; - return MarkPointModel; - }(MarkerModel); - - function hasXOrY(item) { - return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); - } - function hasXAndY(item) { - return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); - } - function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) { - var coordArr = []; - var stacked = isDimensionStacked(data, targetDataDim /* , otherDataDim */); - var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim; - var value = numCalculate(data, calcDataDim, markerType); - var dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; - coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); - coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex); - var coordArrValue = data.get(targetDataDim, dataIndex); - // Make it simple, do not visit all stacked value to count precision. - var precision = getPrecision(data.get(targetDataDim, dataIndex)); - precision = Math.min(precision, 20); - if (precision >= 0) { - coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); - } - return [coordArr, coordArrValue]; - } - // TODO Specified percent - var markerTypeCalculator = { - min: curry(markerTypeCalculatorWithExtent, 'min'), - max: curry(markerTypeCalculatorWithExtent, 'max'), - average: curry(markerTypeCalculatorWithExtent, 'average'), - median: curry(markerTypeCalculatorWithExtent, 'median') - }; - /** - * Transform markPoint data item to format used in List by do the following - * 1. Calculate statistic like `max`, `min`, `average` - * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array - */ - function dataTransform(seriesModel, item) { - if (!item) { - return; } - var data = seriesModel.getData(); - var coordSys = seriesModel.coordinateSystem; - var dims = coordSys && coordSys.dimensions; - // 1. If not specify the position with pixel directly - // 2. If `coord` is not a data array. Which uses `xAxis`, - // `yAxis` to specify the coord on each dimension - // parseFloat first because item.x and item.y can be percent string like '20%' - if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) { - var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); - // Clone the option - // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value - item = clone(item); - if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) { - var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim); - var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim); - var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex); - item.coord = coordInfo[0]; - // Force to use the value of calculated value. - // let item use the value without stack. - item.value = coordInfo[1]; + }); + }); +} +function weightedTarget(edge, orient) { + return center2(edge.node2, orient) * edge.getValue(); +} +function centerTarget(edge, orient) { + return center2(edge.node2, orient); +} +function weightedSource(edge, orient) { + return center2(edge.node1, orient) * edge.getValue(); +} +function centerSource(edge, orient) { + return center2(edge.node1, orient); +} +function center2(node, orient) { + return orient === "vertical" ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2; +} +function getEdgeValue(edge) { + return edge.getValue(); +} +function sum(array, cb, orient) { + let sum2 = 0; + const len2 = array.length; + let i = -1; + while (++i < len2) { + const value = +cb(array[i], orient); + if (!isNaN(value)) { + sum2 += value; + } + } + return sum2; +} +function relaxLeftToRight(nodesByBreadth, alpha, orient) { + each(nodesByBreadth, function(nodes) { + each(nodes, function(node) { + if (node.inEdges.length) { + let y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue); + if (isNaN(y)) { + const len2 = node.inEdges.length; + y = len2 ? sum(node.inEdges, centerSource, orient) / len2 : 0; + } + if (orient === "vertical") { + const nodeX = node.getLayout().x + (y - center2(node, orient)) * alpha; + node.setLayout({x: nodeX}, true); } else { - // FIXME Only has one of xAxis and yAxis. - item.coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis]; + const nodeY = node.getLayout().y + (y - center2(node, orient)) * alpha; + node.setLayout({y: nodeY}, true); } } - // x y is provided - if (item.coord == null || !isArray(dims)) { - item.coord = []; - } else { - // Each coord support max, min, average - var coord = item.coord; - for (var i = 0; i < 2; i++) { - if (markerTypeCalculator[coord[i]]) { - coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); - } + }); + }); +} +function computeEdgeDepths(nodes, orient) { + const keyAttr = orient === "vertical" ? "x" : "y"; + each(nodes, function(node) { + node.outEdges.sort(function(a, b) { + return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr]; + }); + node.inEdges.sort(function(a, b) { + return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr]; + }); + }); + each(nodes, function(node) { + let sy = 0; + let ty = 0; + each(node.outEdges, function(edge) { + edge.setLayout({sy}, true); + sy += edge.getLayout().dy; + }); + each(node.inEdges, function(edge) { + edge.setLayout({ty}, true); + ty += edge.getLayout().dy; + }); + }); +} + +// src/chart/sankey/sankeyVisual.ts +function sankeyVisual(ecModel) { + ecModel.eachSeriesByType("sankey", function(seriesModel) { + const graph = seriesModel.getGraph(); + const nodes = graph.nodes; + const edges = graph.edges; + if (nodes.length) { + let minValue = Infinity; + let maxValue = -Infinity; + each(nodes, function(node) { + const nodeValue = node.getLayout().value; + if (nodeValue < minValue) { + minValue = nodeValue; + } + if (nodeValue > maxValue) { + maxValue = nodeValue; } - } - return item; - } - function getAxisInfo$1(item, data, coordSys, seriesModel) { - var ret = {}; - if (item.valueIndex != null || item.valueDim != null) { - ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim; - ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim)); - ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); - ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); - } else { - ret.baseAxis = seriesModel.getBaseAxis(); - ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); - ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); - ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); - } - return ret; - } - function dataDimToCoordDim(seriesModel, dataDim) { - var dimItem = seriesModel.getData().getDimensionInfo(dataDim); - return dimItem && dimItem.coordDim; - } - /** - * Filter data which is out of coordinateSystem range - * [dataFilter description] - */ - function dataFilter$1( - // Currently only polar and cartesian has containData. - coordSys, item) { - // Always return true if there is no coordSys - return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true; - } - function zoneFilter( - // Currently only polar and cartesian has containData. - coordSys, item1, item2) { - // Always return true if there is no coordSys - return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true; - } - function createMarkerDimValueGetter(inCoordSys, dims) { - return inCoordSys ? function (item, dimName, dataIndex, dimIndex) { - var rawVal = dimIndex < 2 - // x, y, radius, angle - ? item.coord && item.coord[dimIndex] : item.value; - return parseDataValue(rawVal, dims[dimIndex]); - } : function (item, dimName, dataIndex, dimIndex) { - return parseDataValue(item.value, dims[dimIndex]); - }; - } - function numCalculate(data, valueDataDim, type) { - if (type === 'average') { - var sum_1 = 0; - var count_1 = 0; - data.each(valueDataDim, function (val, idx) { - if (!isNaN(val)) { - sum_1 += val; - count_1++; - } - }); - return sum_1 / count_1; - } else if (type === 'median') { - return data.getMedian(valueDataDim); - } else { - // max & min - return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0]; - } + }); + each(nodes, function(node) { + const mapping = new VisualMapping_default({ + type: "color", + mappingMethod: "linear", + dataExtent: [minValue, maxValue], + visual: seriesModel.get("color") + }); + const mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); + const customColor = node.getModel().get(["itemStyle", "color"]); + if (customColor != null) { + node.setVisual("color", customColor); + node.setVisual("style", {fill: customColor}); + } else { + node.setVisual("color", mapValueToColor); + node.setVisual("style", {fill: mapValueToColor}); + } + }); } - - var inner$h = makeInner(); - var MarkerView = /** @class */function (_super) { - __extends(MarkerView, _super); - function MarkerView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkerView.type; - return _this; - } - MarkerView.prototype.init = function () { - this.markerGroupMap = createHashMap(); - }; - MarkerView.prototype.render = function (markerModel, ecModel, api) { - var _this = this; - var markerGroupMap = this.markerGroupMap; - markerGroupMap.each(function (item) { - inner$h(item).keep = false; - }); - ecModel.eachSeries(function (seriesModel) { - var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type); - markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api); - }); - markerGroupMap.each(function (item) { - !inner$h(item).keep && _this.group.remove(item.group); - }); - }; - MarkerView.prototype.markKeep = function (drawGroup) { - inner$h(drawGroup).keep = true; - }; - MarkerView.prototype.toggleBlurSeries = function (seriesModelList, isBlur) { - var _this = this; - each(seriesModelList, function (seriesModel) { - var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type); - if (markerModel) { - var data = markerModel.getData(); - data.eachItemGraphicEl(function (el) { - if (el) { - isBlur ? enterBlur(el) : leaveBlur(el); - } - }); - } - }); - }; - MarkerView.type = 'marker'; - return MarkerView; - }(ComponentView); - - function updateMarkerLayout(mpData, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - mpData.each(function (idx) { - var itemModel = mpData.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); - var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } - // Chart like bar may have there own marker positioning logic - else if (seriesModel.getMarkerPosition) { - // Use the getMarkerPosition - point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx)); - } else if (coordSys) { - var x = mpData.get(coordSys.dimensions[0], idx); - var y = mpData.get(coordSys.dimensions[1], idx); - point = coordSys.dataToPoint([x, y]); - } - // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; - } - if (!isNaN(yPx)) { - point[1] = yPx; - } - mpData.setItemLayout(idx, point); + if (edges.length) { + each(edges, function(edge) { + const edgeStyle = edge.getModel().get("lineStyle"); + edge.setVisual("style", edgeStyle); }); } - var MarkPointView = /** @class */function (_super) { - __extends(MarkPointView, _super); - function MarkPointView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkPointView.type; - return _this; - } - MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint'); - if (mpModel) { - updateMarkerLayout(mpModel.getData(), seriesModel, api); - this.markerGroupMap.get(seriesModel.id).updateLayout(); - } - }, this); - }; - MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); - var symbolDrawMap = this.markerGroupMap; - var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw()); - var mpData = createData(coordSys, seriesModel, mpModel); - // FIXME - mpModel.setData(mpData); - updateMarkerLayout(mpModel.getData(), seriesModel, api); - mpData.each(function (idx) { - var itemModel = mpData.getItemModel(idx); - var symbol = itemModel.getShallow('symbol'); - var symbolSize = itemModel.getShallow('symbolSize'); - var symbolRotate = itemModel.getShallow('symbolRotate'); - var symbolOffset = itemModel.getShallow('symbolOffset'); - var symbolKeepAspect = itemModel.getShallow('symbolKeepAspect'); - // TODO: refactor needed: single data item should not support callback function - if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) { - var rawIdx = mpModel.getRawValue(idx); - var dataParams = mpModel.getDataParams(idx); - if (isFunction(symbol)) { - symbol = symbol(rawIdx, dataParams); - } - if (isFunction(symbolSize)) { - // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据? - symbolSize = symbolSize(rawIdx, dataParams); - } - if (isFunction(symbolRotate)) { - symbolRotate = symbolRotate(rawIdx, dataParams); - } - if (isFunction(symbolOffset)) { - symbolOffset = symbolOffset(rawIdx, dataParams); - } - } - var style = itemModel.getModel('itemStyle').getItemStyle(); - var color = getVisualFromData(seriesData, 'color'); - if (!style.fill) { - style.fill = color; - } - mpData.setItemVisual(idx, { - symbol: symbol, - symbolSize: symbolSize, - symbolRotate: symbolRotate, - symbolOffset: symbolOffset, - symbolKeepAspect: symbolKeepAspect, - style: style - }); - }); - // TODO Text are wrong - symbolDraw.updateData(mpData); - this.group.add(symbolDraw.group); - // Set host model for tooltip - // FIXME - mpData.eachItemGraphicEl(function (el) { - el.traverse(function (child) { - getECData(child).dataModel = mpModel; - }); - }); - this.markKeep(symbolDraw); - symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent'); - }; - MarkPointView.type = 'markPoint'; - return MarkPointView; - }(MarkerView); - function createData(coordSys, seriesModel, mpModel) { - var coordDimsInfos; - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { - var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; - // In map series data don't have lng and lat dimension. Fallback to same with coordSys - return extend(extend({}, info), { - name: coordDim, - // DON'T use ordinalMeta to parse and collect ordinal. - ordinalMeta: null - }); - }); + }); +} + +// src/chart/sankey/install.ts +function install19(registers) { + registers.registerChartView(SankeyView_default); + registers.registerSeriesModel(SankeySeries_default); + registers.registerLayout(sankeyLayout); + registers.registerVisual(sankeyVisual); + registers.registerAction({ + type: "dragNode", + event: "dragnode", + update: "update" + }, function(payload, ecModel) { + ecModel.eachComponent({ + mainType: "series", + subType: "sankey", + query: payload + }, function(seriesModel) { + seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]); + }); + }); +} + +// src/chart/helper/whiskerBoxCommon.ts +var WhiskerBoxCommonMixin = class { + _hasEncodeRule(key) { + const encodeRules = this.getEncode(); + if (encodeRules && encodeRules.data && encodeRules.data.has(key)) { + return encodeRules.data.get(key) != null; + } + return false; + } + getInitialData(option, ecModel) { + let ordinalMeta; + const xAxisModel = ecModel.getComponent("xAxis", this.get("xAxisIndex")); + const yAxisModel = ecModel.getComponent("yAxis", this.get("yAxisIndex")); + const xAxisType = xAxisModel.get("type"); + const yAxisType = yAxisModel.get("type"); + let addOrdinal; + if (xAxisType === "category") { + option.layout = "horizontal"; + ordinalMeta = xAxisModel.getOrdinalMeta(); + addOrdinal = !this._hasEncodeRule("x"); + } else if (yAxisType === "category") { + option.layout = "vertical"; + ordinalMeta = yAxisModel.getOrdinalMeta(); + addOrdinal = !this._hasEncodeRule("y"); + } else { + option.layout = option.layout || "horizontal"; + } + const coordDims = ["x", "y"]; + const baseAxisDimIndex = option.layout === "horizontal" ? 0 : 1; + const baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex]; + const otherAxisDim = coordDims[1 - baseAxisDimIndex]; + const axisModels = [xAxisModel, yAxisModel]; + const baseAxisType = axisModels[baseAxisDimIndex].get("type"); + const otherAxisType = axisModels[1 - baseAxisDimIndex].get("type"); + const data = option.data; + if (data && addOrdinal) { + const newOptionData = []; + each(data, function(item, index) { + let newItem; + if (isArray(item)) { + newItem = item.slice(); + item.unshift(index); + } else if (isArray(item.value)) { + newItem = extend({}, item); + newItem.value = newItem.value.slice(); + item.value.unshift(index); + } else { + newItem = item; + } + newOptionData.push(newItem); + }); + option.data = newOptionData; + } + const defaultValueDimensions = this.defaultValueDimensions; + const coordDimensions = [{ + name: baseAxisDim, + type: getDimensionTypeByAxis(baseAxisType), + ordinalMeta, + otherDims: { + tooltip: false, + itemName: 0 + }, + dimsDef: ["base"] + }, { + name: otherAxisDim, + type: getDimensionTypeByAxis(otherAxisType), + dimsDef: defaultValueDimensions.slice() + }]; + return createSeriesDataSimply(this, { + coordDimensions, + dimensionsCount: defaultValueDimensions.length + 1, + encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this) + }); + } + getBaseAxis() { + const dim = this._baseAxisDim; + return this.ecModel.getComponent(dim + "Axis", this.get(dim + "AxisIndex")).axis; + } +}; + +// src/chart/boxplot/BoxplotSeries.ts +var BoxplotSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = BoxplotSeriesModel2.type; + this.defaultValueDimensions = [ + {name: "min", defaultTooltip: true}, + {name: "Q1", defaultTooltip: true}, + {name: "median", defaultTooltip: true}, + {name: "Q3", defaultTooltip: true}, + {name: "max", defaultTooltip: true} + ]; + this.visualDrawType = "stroke"; + } +}; +var BoxplotSeriesModel = BoxplotSeriesModel2; +BoxplotSeriesModel.type = "series.boxplot"; +BoxplotSeriesModel.dependencies = ["xAxis", "yAxis", "grid"]; +BoxplotSeriesModel.defaultOption = { + z: 2, + coordinateSystem: "cartesian2d", + legendHoverLink: true, + layout: null, + boxWidth: [7, 50], + itemStyle: { + color: "#fff", + borderWidth: 1 + }, + emphasis: { + scale: true, + itemStyle: { + borderWidth: 2, + shadowBlur: 5, + shadowOffsetX: 1, + shadowOffsetY: 1, + shadowColor: "rgba(0,0,0,0.2)" + } + }, + animationDuration: 800 +}; +mixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true); +var BoxplotSeries_default = BoxplotSeriesModel; + +// src/chart/boxplot/BoxplotView.ts +var BoxplotView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = BoxplotView2.type; + } + render(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const group = this.group; + const oldData = this._data; + if (!this._data) { + group.removeAll(); + } + const constDim = seriesModel.get("layout") === "horizontal" ? 1 : 0; + data.diff(oldData).add(function(newIdx) { + if (data.hasValue(newIdx)) { + const itemLayout = data.getItemLayout(newIdx); + const symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true); + data.setItemGraphicEl(newIdx, symbolEl); + group.add(symbolEl); + } + }).update(function(newIdx, oldIdx) { + let symbolEl = oldData.getItemGraphicEl(oldIdx); + if (!data.hasValue(newIdx)) { + group.remove(symbolEl); + return; + } + const itemLayout = data.getItemLayout(newIdx); + if (!symbolEl) { + symbolEl = createNormalBox(itemLayout, data, newIdx, constDim); } else { - coordDimsInfos = [{ - name: 'value', - type: 'float' - }]; + saveOldStyle(symbolEl); + updateNormalBoxData(itemLayout, symbolEl, data, newIdx); } - var mpData = new SeriesData(coordDimsInfos, mpModel); - var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel)); - if (coordSys) { - dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys)); + group.add(symbolEl); + data.setItemGraphicEl(newIdx, symbolEl); + }).remove(function(oldIdx) { + const el = oldData.getItemGraphicEl(oldIdx); + el && group.remove(el); + }).execute(); + this._data = data; + } + remove(ecModel) { + const group = this.group; + const data = this._data; + this._data = null; + data && data.eachItemGraphicEl(function(el) { + el && group.remove(el); + }); + } +}; +var BoxplotView = BoxplotView2; +BoxplotView.type = "boxplot"; +var BoxPathShape = class { +}; +var BoxPath = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "boxplotBoxPath"; + } + getDefaultShape() { + return new BoxPathShape(); + } + buildPath(ctx, shape) { + const ends = shape.points; + let i = 0; + ctx.moveTo(ends[i][0], ends[i][1]); + i++; + for (; i < 4; i++) { + ctx.lineTo(ends[i][0], ends[i][1]); + } + ctx.closePath(); + for (; i < ends.length; i++) { + ctx.moveTo(ends[i][0], ends[i][1]); + i++; + ctx.lineTo(ends[i][0], ends[i][1]); + } + } +}; +function createNormalBox(itemLayout, data, dataIndex, constDim, isInit) { + const ends = itemLayout.ends; + const el = new BoxPath({ + shape: { + points: isInit ? transInit(ends, constDim, itemLayout) : ends + } + }); + updateNormalBoxData(itemLayout, el, data, dataIndex, isInit); + return el; +} +function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) { + const seriesModel = data.hostModel; + const updateMethod = graphic_exports[isInit ? "initProps" : "updateProps"]; + updateMethod(el, {shape: {points: itemLayout.ends}}, seriesModel, dataIndex); + el.useStyle(data.getItemVisual(dataIndex, "style")); + el.style.strokeNoScale = true; + el.z2 = 100; + const itemModel = data.getItemModel(dataIndex); + const emphasisModel = itemModel.getModel("emphasis"); + setStatesStylesFromModel(el, itemModel); + toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); +} +function transInit(points4, dim, itemLayout) { + return map(points4, function(point) { + point = point.slice(); + point[dim] = itemLayout.initBaseline; + return point; + }); +} +var BoxplotView_default = BoxplotView; + +// src/chart/boxplot/boxplotLayout.ts +var each7 = each; +function boxplotLayout(ecModel) { + const groupResult = groupSeriesByAxis(ecModel); + each7(groupResult, function(groupItem) { + const seriesModels = groupItem.seriesModels; + if (!seriesModels.length) { + return; + } + calculateBase(groupItem); + each7(seriesModels, function(seriesModel, idx) { + layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]); + }); + }); +} +function groupSeriesByAxis(ecModel) { + const result = []; + const axisList = []; + ecModel.eachSeriesByType("boxplot", function(seriesModel) { + const baseAxis = seriesModel.getBaseAxis(); + let idx = indexOf(axisList, baseAxis); + if (idx < 0) { + idx = axisList.length; + axisList[idx] = baseAxis; + result[idx] = { + axis: baseAxis, + seriesModels: [] + }; + } + result[idx].seriesModels.push(seriesModel); + }); + return result; +} +function calculateBase(groupItem) { + const baseAxis = groupItem.axis; + const seriesModels = groupItem.seriesModels; + const seriesCount = seriesModels.length; + const boxWidthList = groupItem.boxWidthList = []; + const boxOffsetList = groupItem.boxOffsetList = []; + const boundList = []; + let bandWidth; + if (baseAxis.type === "category") { + bandWidth = baseAxis.getBandWidth(); + } else { + let maxDataCount = 0; + each7(seriesModels, function(seriesModel) { + maxDataCount = Math.max(maxDataCount, seriesModel.getData().count()); + }); + const extent3 = baseAxis.getExtent(); + bandWidth = Math.abs(extent3[1] - extent3[0]) / maxDataCount; + } + each7(seriesModels, function(seriesModel) { + let boxWidthBound = seriesModel.get("boxWidth"); + if (!isArray(boxWidthBound)) { + boxWidthBound = [boxWidthBound, boxWidthBound]; + } + boundList.push([ + parsePercent2(boxWidthBound[0], bandWidth) || 0, + parsePercent2(boxWidthBound[1], bandWidth) || 0 + ]); + }); + const availableWidth = bandWidth * 0.8 - 2; + const boxGap = availableWidth / seriesCount * 0.3; + const boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount; + let base2 = boxWidth / 2 - availableWidth / 2; + each7(seriesModels, function(seriesModel, idx) { + boxOffsetList.push(base2); + base2 += boxGap + boxWidth; + boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])); + }); +} +function layoutSingleSeries(seriesModel, offset, boxWidth) { + const coordSys = seriesModel.coordinateSystem; + const data = seriesModel.getData(); + const halfWidth = boxWidth / 2; + const cDimIdx = seriesModel.get("layout") === "horizontal" ? 0 : 1; + const vDimIdx = 1 - cDimIdx; + const coordDims = ["x", "y"]; + const cDim = data.mapDimension(coordDims[cDimIdx]); + const vDims = data.mapDimensionsAll(coordDims[vDimIdx]); + if (cDim == null || vDims.length < 5) { + return; + } + for (let dataIndex = 0; dataIndex < data.count(); dataIndex++) { + const axisDimVal = data.get(cDim, dataIndex); + const median = getPoint(axisDimVal, vDims[2], dataIndex); + const end1 = getPoint(axisDimVal, vDims[0], dataIndex); + const end2 = getPoint(axisDimVal, vDims[1], dataIndex); + const end4 = getPoint(axisDimVal, vDims[3], dataIndex); + const end5 = getPoint(axisDimVal, vDims[4], dataIndex); + const ends = []; + addBodyEnd(ends, end2, false); + addBodyEnd(ends, end4, true); + ends.push(end1, end2, end5, end4); + layEndLine(ends, end1); + layEndLine(ends, end5); + layEndLine(ends, median); + data.setItemLayout(dataIndex, { + initBaseline: median[vDimIdx], + ends + }); + } + function getPoint(axisDimVal, dim, dataIndex) { + const val = data.get(dim, dataIndex); + const p = []; + p[cDimIdx] = axisDimVal; + p[vDimIdx] = val; + let point; + if (isNaN(axisDimVal) || isNaN(val)) { + point = [NaN, NaN]; + } else { + point = coordSys.dataToPoint(p); + point[cDimIdx] += offset; + } + return point; + } + function addBodyEnd(ends, point, start2) { + const point1 = point.slice(); + const point2 = point.slice(); + point1[cDimIdx] += halfWidth; + point2[cDimIdx] -= halfWidth; + start2 ? ends.push(point1, point2) : ends.push(point2, point1); + } + function layEndLine(ends, endCenter) { + const from = endCenter.slice(); + const to = endCenter.slice(); + from[cDimIdx] -= halfWidth; + to[cDimIdx] += halfWidth; + ends.push(from, to); + } +} + +// src/chart/boxplot/prepareBoxplotData.ts +function prepareBoxplotData(rawData, opt) { + opt = opt || {}; + const boxData = []; + const outliers = []; + const boundIQR = opt.boundIQR; + const useExtreme = boundIQR === "none" || boundIQR === 0; + for (let i = 0; i < rawData.length; i++) { + const ascList = asc(rawData[i].slice()); + const Q1 = quantile(ascList, 0.25); + const Q2 = quantile(ascList, 0.5); + const Q3 = quantile(ascList, 0.75); + const min3 = ascList[0]; + const max3 = ascList[ascList.length - 1]; + const bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1); + const low = useExtreme ? min3 : Math.max(min3, Q1 - bound); + const high = useExtreme ? max3 : Math.min(max3, Q3 + bound); + const itemNameFormatter = opt.itemNameFormatter; + const itemName = isFunction(itemNameFormatter) ? itemNameFormatter({value: i}) : isString(itemNameFormatter) ? itemNameFormatter.replace("{value}", i + "") : i + ""; + boxData.push([itemName, low, Q1, Q2, Q3, high]); + for (let j = 0; j < ascList.length; j++) { + const dataItem = ascList[j]; + if (dataItem < low || dataItem > high) { + const outlier = [itemName, dataItem]; + outliers.push(outlier); + } + } + } + return { + boxData, + outliers + }; +} + +// src/chart/boxplot/boxplotTransform.ts +var boxplotTransform = { + type: "echarts:boxplot", + transform: function transform(params) { + const upstream = params.upstream; + if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) { + let errMsg = ""; + if (true) { + errMsg = makePrintable("source data is not applicable for this boxplot transform. Expect number[][]."); + } + throwError(errMsg); + } + const result = prepareBoxplotData(upstream.getRawData(), params.config); + return [{ + dimensions: ["ItemName", "Low", "Q1", "Q2", "Q3", "High"], + data: result.boxData + }, { + data: result.outliers + }]; + } +}; + +// src/chart/boxplot/install.ts +function install20(registers) { + registers.registerSeriesModel(BoxplotSeries_default); + registers.registerChartView(BoxplotView_default); + registers.registerLayout(boxplotLayout); + registers.registerTransform(boxplotTransform); +} + +// src/chart/candlestick/candlestickVisual.ts +var positiveBorderColorQuery = ["itemStyle", "borderColor"]; +var negativeBorderColorQuery = ["itemStyle", "borderColor0"]; +var dojiBorderColorQuery = ["itemStyle", "borderColorDoji"]; +var positiveColorQuery = ["itemStyle", "color"]; +var negativeColorQuery = ["itemStyle", "color0"]; +function getColor(sign, model) { + return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery); +} +function getBorderColor(sign, model) { + return model.get(sign === 0 ? dojiBorderColorQuery : sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery); +} +var candlestickVisual = { + seriesType: "candlestick", + plan: createRenderPlanner(), + performRawSeries: true, + reset: function(seriesModel, ecModel) { + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } + const isLargeRender = seriesModel.pipelineContext.large; + return !isLargeRender && { + progress(params, data) { + let dataIndex; + while ((dataIndex = params.next()) != null) { + const itemModel = data.getItemModel(dataIndex); + const sign = data.getItemLayout(dataIndex).sign; + const style = itemModel.getItemStyle(); + style.fill = getColor(sign, itemModel); + style.stroke = getBorderColor(sign, itemModel) || style.fill; + const existsStyle = data.ensureUniqueItemVisual(dataIndex, "style"); + extend(existsStyle, style); + } } - var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); - mpData.initData(dataOpt, null, dimValueGetter); - return mpData; - } - - function install$E(registers) { - registers.registerComponentModel(MarkPointModel); - registers.registerComponentView(MarkPointView); - registers.registerPreprocessor(function (opt) { - if (checkMarkerInSeries(opt.series, 'markPoint')) { - // Make sure markPoint component is enabled - opt.markPoint = opt.markPoint || {}; + }; + } +}; +var candlestickVisual_default = candlestickVisual; + +// src/chart/candlestick/CandlestickView.ts +var SKIP_PROPS = ["color", "borderColor"]; +var CandlestickView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = CandlestickView2.type; + } + render(seriesModel, ecModel, api2) { + this.group.removeClipPath(); + this._progressiveEls = null; + this._updateDrawMode(seriesModel); + this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel); + } + incrementalPrepareRender(seriesModel, ecModel, api2) { + this._clear(); + this._updateDrawMode(seriesModel); + } + incrementalRender(params, seriesModel, ecModel, api2) { + this._progressiveEls = []; + this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel); + } + eachRendered(cb) { + traverseElements(this._progressiveEls || this.group, cb); + } + _updateDrawMode(seriesModel) { + const isLargeDraw = seriesModel.pipelineContext.large; + if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { + this._isLargeDraw = isLargeDraw; + this._clear(); + } + } + _renderNormal(seriesModel) { + const data = seriesModel.getData(); + const oldData = this._data; + const group = this.group; + const isSimpleBox = data.getLayout("isSimpleBox"); + const needsClip = seriesModel.get("clip", true); + const coord = seriesModel.coordinateSystem; + const clipArea = coord.getArea && coord.getArea(); + if (!this._data) { + group.removeAll(); + } + data.diff(oldData).add(function(newIdx) { + if (data.hasValue(newIdx)) { + const itemLayout = data.getItemLayout(newIdx); + if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { + return; } - }); - } - - var MarkLineModel = /** @class */function (_super) { - __extends(MarkLineModel, _super); - function MarkLineModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkLineModel.type; - return _this; + const el = createNormalBox2(itemLayout, newIdx, true); + initProps(el, {shape: {points: itemLayout.ends}}, seriesModel, newIdx); + setBoxCommon(el, data, newIdx, isSimpleBox); + group.add(el); + data.setItemGraphicEl(newIdx, el); } - MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { - return new MarkLineModel(markerOpt, masterMarkerModel, ecModel); - }; - MarkLineModel.type = 'markLine'; - MarkLineModel.defaultOption = { - // zlevel: 0, - z: 5, - symbol: ['circle', 'arrow'], - symbolSize: [8, 16], - // symbolRotate: 0, - symbolOffset: 0, - precision: 2, - tooltip: { - trigger: 'item' - }, - label: { - show: true, - position: 'end', - distance: 5 - }, - lineStyle: { - type: 'dashed' - }, - emphasis: { - label: { - show: true - }, - lineStyle: { - width: 3 - } - }, - animationEasing: 'linear' - }; - return MarkLineModel; - }(MarkerModel); - - var inner$i = makeInner(); - var markLineTransform = function (seriesModel, coordSys, mlModel, item) { - var data = seriesModel.getData(); - var itemArray; - if (!isArray(item)) { - // Special type markLine like 'min', 'max', 'average', 'median' - var mlType = item.type; - if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' - // In case - // data: [{ - // yAxis: 10 - // }] - || item.xAxis != null || item.yAxis != null) { - var valueAxis = void 0; - var value = void 0; - if (item.yAxis != null || item.xAxis != null) { - valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x'); - value = retrieve(item.yAxis, item.xAxis); - } else { - var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); - valueAxis = axisInfo.valueAxis; - var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim); - value = numCalculate(data, valueDataDim, mlType); - } - var valueIndex = valueAxis.dim === 'x' ? 0 : 1; - var baseIndex = 1 - valueIndex; - // Normized to 2d data with start and end point - var mlFrom = clone(item); - var mlTo = { - coord: [] - }; - mlFrom.type = null; - mlFrom.coord = []; - mlFrom.coord[baseIndex] = -Infinity; - mlTo.coord[baseIndex] = Infinity; - var precision = mlModel.get('precision'); - if (precision >= 0 && isNumber(value)) { - value = +value.toFixed(Math.min(precision, 20)); - } - mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; - itemArray = [mlFrom, mlTo, { - type: mlType, - valueIndex: item.valueIndex, - // Force to use the value of calculated value. - value: value - }]; - } else { - // Invalid data - if ("development" !== 'production') { - logError('Invalid markLine data.'); + }).update(function(newIdx, oldIdx) { + let el = oldData.getItemGraphicEl(oldIdx); + if (!data.hasValue(newIdx)) { + group.remove(el); + return; + } + const itemLayout = data.getItemLayout(newIdx); + if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { + group.remove(el); + return; + } + if (!el) { + el = createNormalBox2(itemLayout, newIdx); + } else { + updateProps(el, { + shape: { + points: itemLayout.ends } - itemArray = []; - } + }, seriesModel, newIdx); + saveOldStyle(el); + } + setBoxCommon(el, data, newIdx, isSimpleBox); + group.add(el); + data.setItemGraphicEl(newIdx, el); + }).remove(function(oldIdx) { + const el = oldData.getItemGraphicEl(oldIdx); + el && group.remove(el); + }).execute(); + this._data = data; + } + _renderLarge(seriesModel) { + this._clear(); + createLarge2(seriesModel, this.group); + const clipPath = seriesModel.get("clip", true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null; + if (clipPath) { + this.group.setClipPath(clipPath); + } else { + this.group.removeClipPath(); + } + } + _incrementalRenderNormal(params, seriesModel) { + const data = seriesModel.getData(); + const isSimpleBox = data.getLayout("isSimpleBox"); + let dataIndex; + while ((dataIndex = params.next()) != null) { + const itemLayout = data.getItemLayout(dataIndex); + const el = createNormalBox2(itemLayout, dataIndex); + setBoxCommon(el, data, dataIndex, isSimpleBox); + el.incremental = true; + this.group.add(el); + this._progressiveEls.push(el); + } + } + _incrementalRenderLarge(params, seriesModel) { + createLarge2(seriesModel, this.group, this._progressiveEls, true); + } + remove(ecModel) { + this._clear(); + } + _clear() { + this.group.removeAll(); + this._data = null; + } +}; +var CandlestickView = CandlestickView2; +CandlestickView.type = "candlestick"; +var NormalBoxPathShape = class { +}; +var NormalBoxPath = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "normalCandlestickBox"; + } + getDefaultShape() { + return new NormalBoxPathShape(); + } + buildPath(ctx, shape) { + const 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 createNormalBox2(itemLayout, dataIndex, isInit) { + const ends = itemLayout.ends; + return new NormalBoxPath({ + shape: { + points: isInit ? transInit2(ends, itemLayout) : ends + }, + z2: 100 + }); +} +function isNormalBoxClipped(clipArea, itemLayout) { + let clipped = true; + for (let i = 0; i < itemLayout.ends.length; i++) { + if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) { + clipped = false; + break; + } + } + return clipped; +} +function setBoxCommon(el, data, dataIndex, isSimpleBox) { + const itemModel = data.getItemModel(dataIndex); + el.useStyle(data.getItemVisual(dataIndex, "style")); + el.style.strokeNoScale = true; + el.__simpleBox = isSimpleBox; + setStatesStylesFromModel(el, itemModel); + const sign = data.getItemLayout(dataIndex).sign; + each(el.states, (state, stateName) => { + const stateModel = itemModel.getModel(stateName); + const color2 = getColor(sign, stateModel); + const borderColor = getBorderColor(sign, stateModel) || color2; + const stateStyle = state.style || (state.style = {}); + color2 && (stateStyle.fill = color2); + borderColor && (stateStyle.stroke = borderColor); + }); + const emphasisModel = itemModel.getModel("emphasis"); + toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); +} +function transInit2(points4, itemLayout) { + return map(points4, function(point) { + point = point.slice(); + point[1] = itemLayout.initBaseline; + return point; + }); +} +var LargeBoxPathShape = class { +}; +var LargeBoxPath = class extends Path_default { + constructor(opts) { + super(opts); + this.type = "largeCandlestickBox"; + } + getDefaultShape() { + return new LargeBoxPathShape(); + } + buildPath(ctx, shape) { + const points4 = shape.points; + for (let i = 0; i < points4.length; ) { + if (this.__sign === points4[i++]) { + const x = points4[i++]; + ctx.moveTo(x, points4[i++]); + ctx.lineTo(x, points4[i++]); } else { - itemArray = item; - } - var normalizedItem = [dataTransform(seriesModel, itemArray[0]), dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])]; - // Avoid line data type is extended by from(to) data type - normalizedItem[2].type = normalizedItem[2].type || null; - // Merge from option and to option into line option - merge(normalizedItem[2], normalizedItem[0]); - merge(normalizedItem[2], normalizedItem[1]); - return normalizedItem; + i += 3; + } + } + } +}; +function createLarge2(seriesModel, group, progressiveEls, incremental) { + const data = seriesModel.getData(); + const largePoints = data.getLayout("largePoints"); + const elP = new LargeBoxPath({ + shape: {points: largePoints}, + __sign: 1, + ignoreCoarsePointer: true + }); + group.add(elP); + const elN = new LargeBoxPath({ + shape: {points: largePoints}, + __sign: -1, + ignoreCoarsePointer: true + }); + group.add(elN); + const elDoji = new LargeBoxPath({ + shape: {points: largePoints}, + __sign: 0, + ignoreCoarsePointer: true + }); + group.add(elDoji); + setLargeStyle(1, elP, seriesModel, data); + setLargeStyle(-1, elN, seriesModel, data); + setLargeStyle(0, elDoji, seriesModel, data); + if (incremental) { + elP.incremental = true; + elN.incremental = true; + } + if (progressiveEls) { + progressiveEls.push(elP, elN); + } +} +function setLargeStyle(sign, el, seriesModel, data) { + const borderColor = getBorderColor(sign, seriesModel) || getColor(sign, seriesModel); + const itemStyle = seriesModel.getModel("itemStyle").getItemStyle(SKIP_PROPS); + el.useStyle(itemStyle); + el.style.fill = null; + el.style.stroke = borderColor; +} +var CandlestickView_default = CandlestickView; + +// src/chart/candlestick/CandlestickSeries.ts +var CandlestickSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = CandlestickSeriesModel2.type; + this.defaultValueDimensions = [ + {name: "open", defaultTooltip: true}, + {name: "close", defaultTooltip: true}, + {name: "lowest", defaultTooltip: true}, + {name: "highest", defaultTooltip: true} + ]; + } + getShadowDim() { + return "open"; + } + brushSelector(dataIndex, data, selectors) { + const itemLayout = data.getItemLayout(dataIndex); + return itemLayout && selectors.rect(itemLayout.brushRect); + } +}; +var CandlestickSeriesModel = CandlestickSeriesModel2; +CandlestickSeriesModel.type = "series.candlestick"; +CandlestickSeriesModel.dependencies = ["xAxis", "yAxis", "grid"]; +CandlestickSeriesModel.defaultOption = { + z: 2, + coordinateSystem: "cartesian2d", + legendHoverLink: true, + layout: null, + clip: true, + itemStyle: { + color: "#eb5454", + color0: "#47b262", + borderColor: "#eb5454", + borderColor0: "#47b262", + borderColorDoji: null, + borderWidth: 1 + }, + emphasis: { + itemStyle: { + borderWidth: 2 + } + }, + barMaxWidth: null, + barMinWidth: null, + barWidth: null, + large: true, + largeThreshold: 600, + progressive: 3e3, + progressiveThreshold: 1e4, + progressiveChunkMode: "mod", + animationEasing: "linear", + animationDuration: 300 +}; +mixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true); +var CandlestickSeries_default = CandlestickSeriesModel; + +// src/chart/candlestick/preprocessor.ts +function candlestickPreprocessor(option) { + if (!option || !isArray(option.series)) { + return; + } + each(option.series, function(seriesItem) { + if (isObject(seriesItem) && seriesItem.type === "k") { + seriesItem.type = "candlestick"; + } + }); +} + +// src/chart/candlestick/candlestickLayout.ts +var candlestickLayout = { + seriesType: "candlestick", + plan: createRenderPlanner(), + reset: function(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + const data = seriesModel.getData(); + const candleWidth = calculateCandleWidth(seriesModel, data); + const cDimIdx = 0; + const vDimIdx = 1; + const coordDims = ["x", "y"]; + const cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx])); + const vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data); + const openDimI = vDimsI[0]; + const closeDimI = vDimsI[1]; + const lowestDimI = vDimsI[2]; + const highestDimI = vDimsI[3]; + data.setLayout({ + candleWidth, + isSimpleBox: candleWidth <= 1.3 + }); + if (cDimI < 0 || vDimsI.length < 4) { + return; + } + return { + progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress }; - function isInfinity(val) { - return !isNaN(val) && !isFinite(val); - } - // If a markLine has one dim - function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { - var otherDimIndex = 1 - dimIndex; - var dimName = coordSys.dimensions[dimIndex]; - return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); - } - function markLineFilter(coordSys, item) { - if (coordSys.type === 'cartesian2d') { - var fromCoord = item[0].coord; - var toCoord = item[1].coord; - // In case - // { - // markLine: { - // data: [{ yAxis: 2 }] - // } - // } - if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) { - return true; + function normalProgress(params, data2) { + let dataIndex; + const store = data2.getStore(); + while ((dataIndex = params.next()) != null) { + const axisDimVal = store.get(cDimI, dataIndex); + const openVal = store.get(openDimI, dataIndex); + const closeVal = store.get(closeDimI, dataIndex); + const lowestVal = store.get(lowestDimI, dataIndex); + const highestVal = store.get(highestDimI, dataIndex); + const ocLow = Math.min(openVal, closeVal); + const ocHigh = Math.max(openVal, closeVal); + const ocLowPoint = getPoint(ocLow, axisDimVal); + const ocHighPoint = getPoint(ocHigh, axisDimVal); + const lowestPoint = getPoint(lowestVal, axisDimVal); + const highestPoint = getPoint(highestVal, axisDimVal); + const ends = []; + addBodyEnd(ends, ocHighPoint, 0); + addBodyEnd(ends, ocLowPoint, 1); + ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint)); + const itemModel = data2.getItemModel(dataIndex); + const hasDojiColor = !!itemModel.get(["itemStyle", "borderColorDoji"]); + data2.setItemLayout(dataIndex, { + sign: getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor), + initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx], + ends, + brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal) + }); + } + function getPoint(val, axisDimVal) { + const p = []; + p[cDimIdx] = axisDimVal; + p[vDimIdx] = val; + return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p); + } + function addBodyEnd(ends, point, start2) { + const point1 = point.slice(); + const point2 = point.slice(); + point1[cDimIdx] = subPixelOptimize2(point1[cDimIdx] + candleWidth / 2, 1, false); + point2[cDimIdx] = subPixelOptimize2(point2[cDimIdx] - candleWidth / 2, 1, true); + start2 ? ends.push(point1, point2) : ends.push(point2, point1); + } + function makeBrushRect(lowestVal, highestVal, axisDimVal) { + const pmin = getPoint(lowestVal, axisDimVal); + const pmax = getPoint(highestVal, axisDimVal); + pmin[cDimIdx] -= candleWidth / 2; + pmax[cDimIdx] -= candleWidth / 2; + return { + x: pmin[0], + y: pmin[1], + width: vDimIdx ? candleWidth : pmax[0] - pmin[0], + height: vDimIdx ? pmax[1] - pmin[1] : candleWidth + }; + } + function subPixelOptimizePoint(point) { + point[cDimIdx] = subPixelOptimize2(point[cDimIdx], 1); + return point; + } + } + function largeProgress(params, data2) { + const points4 = createFloat32Array(params.count * 4); + let offset = 0; + let point; + const tmpIn = []; + const tmpOut = []; + let dataIndex; + const store = data2.getStore(); + const hasDojiColor = !!seriesModel.get(["itemStyle", "borderColorDoji"]); + while ((dataIndex = params.next()) != null) { + const axisDimVal = store.get(cDimI, dataIndex); + const openVal = store.get(openDimI, dataIndex); + const closeVal = store.get(closeDimI, dataIndex); + const lowestVal = store.get(lowestDimI, dataIndex); + const highestVal = store.get(highestDimI, dataIndex); + if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) { + points4[offset++] = NaN; + offset += 3; + continue; } + points4[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor); + tmpIn[cDimIdx] = axisDimVal; + tmpIn[vDimIdx] = lowestVal; + point = coordSys.dataToPoint(tmpIn, null, tmpOut); + points4[offset++] = point ? point[0] : NaN; + points4[offset++] = point ? point[1] : NaN; + tmpIn[vDimIdx] = highestVal; + point = coordSys.dataToPoint(tmpIn, null, tmpOut); + points4[offset++] = point ? point[1] : NaN; + } + data2.setLayout("largePoints", points4); + } + } +}; +function getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor) { + let sign; + if (openVal > closeVal) { + sign = -1; + } else if (openVal < closeVal) { + sign = 1; + } else { + sign = hasDojiColor ? 0 : dataIndex > 0 ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1 : 1; + } + return sign; +} +function calculateCandleWidth(seriesModel, data) { + const baseAxis = seriesModel.getBaseAxis(); + let extent3; + const bandWidth = baseAxis.type === "category" ? baseAxis.getBandWidth() : (extent3 = baseAxis.getExtent(), Math.abs(extent3[1] - extent3[0]) / data.count()); + const barMaxWidth = parsePercent2(retrieve2(seriesModel.get("barMaxWidth"), bandWidth), bandWidth); + const barMinWidth = parsePercent2(retrieve2(seriesModel.get("barMinWidth"), 1), bandWidth); + const barWidth = seriesModel.get("barWidth"); + return barWidth != null ? parsePercent2(barWidth, bandWidth) : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth); +} +var candlestickLayout_default = candlestickLayout; + +// src/chart/candlestick/install.ts +function install21(registers) { + registers.registerChartView(CandlestickView_default); + registers.registerSeriesModel(CandlestickSeries_default); + registers.registerPreprocessor(candlestickPreprocessor); + registers.registerVisual(candlestickVisual_default); + registers.registerLayout(candlestickLayout_default); +} + +// src/chart/helper/EffectSymbol.ts +function updateRipplePath(rippleGroup, effectCfg) { + const color2 = effectCfg.rippleEffectColor || effectCfg.color; + rippleGroup.eachChild(function(ripplePath) { + ripplePath.attr({ + z: effectCfg.z, + zlevel: effectCfg.zlevel, + style: { + stroke: effectCfg.brushType === "stroke" ? color2 : null, + fill: effectCfg.brushType === "fill" ? color2 : null + } + }); + }); +} +var EffectSymbol = class extends Group_default { + constructor(data, idx) { + super(); + const symbol = new Symbol_default(data, idx); + const rippleGroup = new Group_default(); + this.add(symbol); + this.add(rippleGroup); + this.updateData(data, idx); + } + stopEffectAnimation() { + this.childAt(1).removeAll(); + } + startEffectAnimation(effectCfg) { + const symbolType = effectCfg.symbolType; + const color2 = effectCfg.color; + const rippleNumber = effectCfg.rippleNumber; + const rippleGroup = this.childAt(1); + for (let i = 0; i < rippleNumber; i++) { + const ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color2); + ripplePath.attr({ + style: { + strokeNoScale: true + }, + z2: 99, + silent: true, + scaleX: 0.5, + scaleY: 0.5 + }); + const delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset; + ripplePath.animate("", true).when(effectCfg.period, { + scaleX: effectCfg.rippleScale / 2, + scaleY: effectCfg.rippleScale / 2 + }).delay(delay).start(); + ripplePath.animateStyle(true).when(effectCfg.period, { + opacity: 0 + }).delay(delay).start(); + rippleGroup.add(ripplePath); + } + updateRipplePath(rippleGroup, effectCfg); + } + updateEffectAnimation(effectCfg) { + const oldEffectCfg = this._effectCfg; + const rippleGroup = this.childAt(1); + const DIFFICULT_PROPS = ["symbolType", "period", "rippleScale", "rippleNumber"]; + for (let i = 0; i < DIFFICULT_PROPS.length; i++) { + const propName = DIFFICULT_PROPS[i]; + if (oldEffectCfg[propName] !== effectCfg[propName]) { + this.stopEffectAnimation(); + this.startEffectAnimation(effectCfg); + return; } - return dataFilter$1(coordSys, item[0]) && dataFilter$1(coordSys, item[1]); } - function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - var itemModel = data.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); - var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } else { - // Chart like bar may have there own marker positioning logic - if (seriesModel.getMarkerPosition) { - // Use the getMarkerPosition - point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx)); - } else { - var dims = coordSys.dimensions; - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - point = coordSys.dataToPoint([x, y]); - } - // Expand line to the edge of grid if value on one axis is Inifnity - // In case - // markLine: { - // data: [{ - // yAxis: 2 - // // or - // type: 'average' - // }] - // } - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - var dims = coordSys.dimensions; - if (isInfinity(data.get(dims[0], idx))) { - point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); - } else if (isInfinity(data.get(dims[1], idx))) { - point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); - } - } - // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; - } - if (!isNaN(yPx)) { - point[1] = yPx; - } - } - data.setItemLayout(idx, point); - } - var MarkLineView = /** @class */function (_super) { - __extends(MarkLineView, _super); - function MarkLineView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkLineView.type; - return _this; - } - MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine'); - if (mlModel) { - var mlData_1 = mlModel.getData(); - var fromData_1 = inner$i(mlModel).from; - var toData_1 = inner$i(mlModel).to; - // Update visual and layout of from symbol and to symbol - fromData_1.each(function (idx) { - updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api); - updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api); - }); - // Update layout of line - mlData_1.each(function (idx) { - mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]); - }); - this.markerGroupMap.get(seriesModel.id).updateLayout(); - } - }, this); - }; - MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); - var lineDrawMap = this.markerGroupMap; - var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw()); - this.group.add(lineDraw.group); - var mlData = createList$1(coordSys, seriesModel, mlModel); - var fromData = mlData.from; - var toData = mlData.to; - var lineData = mlData.line; - inner$i(mlModel).from = fromData; - inner$i(mlModel).to = toData; - // Line data for tooltip and formatter - mlModel.setData(lineData); - // TODO - // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now. - // But the related logic and type definition are not finished yet. - // Finish it if required - var symbolType = mlModel.get('symbol'); - var symbolSize = mlModel.get('symbolSize'); - var symbolRotate = mlModel.get('symbolRotate'); - var symbolOffset = mlModel.get('symbolOffset'); - // TODO: support callback function like markPoint - if (!isArray(symbolType)) { - symbolType = [symbolType, symbolType]; - } - if (!isArray(symbolSize)) { - symbolSize = [symbolSize, symbolSize]; - } - if (!isArray(symbolRotate)) { - symbolRotate = [symbolRotate, symbolRotate]; - } - if (!isArray(symbolOffset)) { - symbolOffset = [symbolOffset, symbolOffset]; - } - // Update visual and layout of from symbol and to symbol - mlData.from.each(function (idx) { - updateDataVisualAndLayout(fromData, idx, true); - updateDataVisualAndLayout(toData, idx, false); - }); - // Update visual and layout of line - lineData.each(function (idx) { - var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle(); - // lineData.setItemVisual(idx, { - // color: lineColor || fromData.getItemVisual(idx, 'color') - // }); - lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]); - if (lineStyle.stroke == null) { - lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill; + updateRipplePath(rippleGroup, effectCfg); + } + highlight() { + enterEmphasis(this); + } + downplay() { + leaveEmphasis(this); + } + getSymbolType() { + const symbol = this.childAt(0); + return symbol && symbol.getSymbolType(); + } + updateData(data, idx) { + const seriesModel = data.hostModel; + this.childAt(0).updateData(data, idx); + const rippleGroup = this.childAt(1); + const itemModel = data.getItemModel(idx); + const symbolType = data.getItemVisual(idx, "symbol"); + const symbolSize = normalizeSymbolSize(data.getItemVisual(idx, "symbolSize")); + const symbolStyle = data.getItemVisual(idx, "style"); + const color2 = symbolStyle && symbolStyle.fill; + const emphasisModel = itemModel.getModel("emphasis"); + rippleGroup.setScale(symbolSize); + rippleGroup.traverse(function(ripplePath) { + ripplePath.setStyle("fill", color2); + }); + const symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, "symbolOffset"), symbolSize); + if (symbolOffset) { + rippleGroup.x = symbolOffset[0]; + rippleGroup.y = symbolOffset[1]; + } + const symbolRotate = data.getItemVisual(idx, "symbolRotate"); + rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + const effectCfg = {}; + effectCfg.showEffectOn = seriesModel.get("showEffectOn"); + effectCfg.rippleScale = itemModel.get(["rippleEffect", "scale"]); + effectCfg.brushType = itemModel.get(["rippleEffect", "brushType"]); + effectCfg.period = itemModel.get(["rippleEffect", "period"]) * 1e3; + effectCfg.effectOffset = idx / data.count(); + effectCfg.z = seriesModel.getShallow("z") || 0; + effectCfg.zlevel = seriesModel.getShallow("zlevel") || 0; + effectCfg.symbolType = symbolType; + effectCfg.color = color2; + effectCfg.rippleEffectColor = itemModel.get(["rippleEffect", "color"]); + effectCfg.rippleNumber = itemModel.get(["rippleEffect", "number"]); + if (effectCfg.showEffectOn === "render") { + this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg); + this._effectCfg = effectCfg; + } else { + this._effectCfg = null; + this.stopEffectAnimation(); + this.onHoverStateChange = (toState) => { + if (toState === "emphasis") { + if (effectCfg.showEffectOn !== "render") { + this.startEffectAnimation(effectCfg); } - lineData.setItemVisual(idx, { - fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'), - fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'), - fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'), - fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'), - fromSymbol: fromData.getItemVisual(idx, 'symbol'), - toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'), - toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'), - toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'), - toSymbolSize: toData.getItemVisual(idx, 'symbolSize'), - toSymbol: toData.getItemVisual(idx, 'symbol'), - style: lineStyle - }); - }); - lineDraw.updateData(lineData); - // Set host model for tooltip - // FIXME - mlData.line.eachItemGraphicEl(function (el) { - getECData(el).dataModel = mlModel; - el.traverse(function (child) { - getECData(child).dataModel = mlModel; - }); - }); - function updateDataVisualAndLayout(data, idx, isFrom) { - var itemModel = data.getItemModel(idx); - updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api); - var style = itemModel.getModel('itemStyle').getItemStyle(); - if (style.fill == null) { - style.fill = getVisualFromData(seriesData, 'color'); + } else if (toState === "normal") { + if (effectCfg.showEffectOn !== "render") { + this.stopEffectAnimation(); } - data.setItemVisual(idx, { - symbolKeepAspect: itemModel.get('symbolKeepAspect'), - // `0` should be considered as a valid value, so use `retrieve2` instead of `||` - symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]), - symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]), - // TODO: when 2d array is supported, it should ignore parent - symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]), - symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]), - style: style - }); } - this.markKeep(lineDraw); - lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent'); - }; - MarkLineView.type = 'markLine'; - return MarkLineView; - }(MarkerView); - function createList$1(coordSys, seriesModel, mlModel) { - var coordDimsInfos; - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { - var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; - // In map series data don't have lng and lat dimension. Fallback to same with coordSys - return extend(extend({}, info), { - name: coordDim, - // DON'T use ordinalMeta to parse and collect ordinal. - ordinalMeta: null - }); - }); - } else { - coordDimsInfos = [{ - name: 'value', - type: 'float' - }]; - } - var fromData = new SeriesData(coordDimsInfos, mlModel); - var toData = new SeriesData(coordDimsInfos, mlModel); - // No dimensions - var lineData = new SeriesData([], mlModel); - var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel)); - if (coordSys) { - optData = filter(optData, curry(markLineFilter, coordSys)); - } - var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); - fromData.initData(map(optData, function (item) { - return item[0]; - }), null, dimValueGetter); - toData.initData(map(optData, function (item) { - return item[1]; - }), null, dimValueGetter); - lineData.initData(map(optData, function (item) { - return item[2]; - })); - lineData.hasItemOption = true; - return { - from: fromData, - to: toData, - line: lineData }; } - - function install$F(registers) { - registers.registerComponentModel(MarkLineModel); - registers.registerComponentView(MarkLineView); - registers.registerPreprocessor(function (opt) { - if (checkMarkerInSeries(opt.series, 'markLine')) { - // Make sure markLine component is enabled - opt.markLine = opt.markLine || {}; - } + this._effectCfg = effectCfg; + toggleHoverEmphasis(this, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + } + fadeOut(cb) { + cb && cb(); + } +}; +var EffectSymbol_default = EffectSymbol; + +// src/chart/effectScatter/EffectScatterView.ts +var EffectScatterView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = EffectScatterView2.type; + } + init() { + this._symbolDraw = new SymbolDraw_default(EffectSymbol_default); + } + render(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const effectSymbolDraw = this._symbolDraw; + effectSymbolDraw.updateData(data, {clipShape: this._getClipShape(seriesModel)}); + this.group.add(effectSymbolDraw.group); + } + _getClipShape(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + const clipArea = coordSys && coordSys.getArea && coordSys.getArea(); + return seriesModel.get("clip", true) ? clipArea : null; + } + updateTransform(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + this.group.dirty(); + const res = pointsLayout("").reset(seriesModel, ecModel, api2); + if (res.progress) { + res.progress({ + start: 0, + end: data.count(), + count: data.count() + }, data); + } + this._symbolDraw.updateLayout(); + } + _updateGroupTransform(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.getRoamTransform) { + this.group.transform = clone3(coordSys.getRoamTransform()); + this.group.decomposeTransform(); + } + } + remove(ecModel, api2) { + this._symbolDraw && this._symbolDraw.remove(true); + } +}; +var EffectScatterView = EffectScatterView2; +EffectScatterView.type = "effectScatter"; +var EffectScatterView_default = EffectScatterView; + +// src/chart/effectScatter/EffectScatterSeries.ts +var EffectScatterSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = EffectScatterSeriesModel2.type; + this.hasSymbolVisual = true; + } + getInitialData(option, ecModel) { + return createSeriesData_default(null, this, {useEncodeDefaulter: true}); + } + brushSelector(dataIndex, data, selectors) { + return selectors.point(data.getItemLayout(dataIndex)); + } +}; +var EffectScatterSeriesModel = EffectScatterSeriesModel2; +EffectScatterSeriesModel.type = "series.effectScatter"; +EffectScatterSeriesModel.dependencies = ["grid", "polar"]; +EffectScatterSeriesModel.defaultOption = { + coordinateSystem: "cartesian2d", + z: 2, + legendHoverLink: true, + effectType: "ripple", + progressive: 0, + showEffectOn: "render", + clip: true, + rippleEffect: { + period: 4, + scale: 2.5, + brushType: "fill", + number: 3 + }, + universalTransition: { + divideShape: "clone" + }, + symbolSize: 10 +}; +var EffectScatterSeries_default = EffectScatterSeriesModel; + +// src/chart/effectScatter/install.ts +function install22(registers) { + registers.registerChartView(EffectScatterView_default); + registers.registerSeriesModel(EffectScatterSeries_default); + registers.registerLayout(pointsLayout("effectScatter")); +} + +// src/chart/helper/EffectLine.ts +var EffectLine = class extends Group_default { + constructor(lineData, idx, seriesScope) { + super(); + this.add(this.createLine(lineData, idx, seriesScope)); + this._updateEffectSymbol(lineData, idx); + } + createLine(lineData, idx, seriesScope) { + return new Line_default2(lineData, idx, seriesScope); + } + _updateEffectSymbol(lineData, idx) { + const itemModel = lineData.getItemModel(idx); + const effectModel = itemModel.getModel("effect"); + let size = effectModel.get("symbolSize"); + const symbolType = effectModel.get("symbol"); + if (!isArray(size)) { + size = [size, size]; + } + const lineStyle = lineData.getItemVisual(idx, "style"); + const color2 = effectModel.get("color") || lineStyle && lineStyle.stroke; + let symbol = this.childAt(1); + if (this._symbolType !== symbolType) { + this.remove(symbol); + symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color2); + symbol.z2 = 100; + symbol.culling = true; + this.add(symbol); + } + if (!symbol) { + return; + } + symbol.setStyle("shadowColor", color2); + symbol.setStyle(effectModel.getItemStyle(["color"])); + symbol.scaleX = size[0]; + symbol.scaleY = size[1]; + symbol.setColor(color2); + this._symbolType = symbolType; + this._symbolScale = size; + this._updateEffectAnimation(lineData, effectModel, idx); + } + _updateEffectAnimation(lineData, effectModel, idx) { + const symbol = this.childAt(1); + if (!symbol) { + return; + } + const points4 = lineData.getItemLayout(idx); + let period = effectModel.get("period") * 1e3; + const loop = effectModel.get("loop"); + const roundTrip = effectModel.get("roundTrip"); + const constantSpeed = effectModel.get("constantSpeed"); + const delayExpr = retrieve(effectModel.get("delay"), function(idx2) { + return idx2 / lineData.count() * period / 3; + }); + symbol.ignore = true; + this._updateAnimationPoints(symbol, points4); + if (constantSpeed > 0) { + period = this._getLineLength(symbol) / constantSpeed * 1e3; + } + if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) { + symbol.stopAnimation(); + let delayNum; + if (isFunction(delayExpr)) { + delayNum = delayExpr(idx); + } else { + delayNum = delayExpr; + } + if (symbol.__t > 0) { + delayNum = -period * symbol.__t; + } + this._animateSymbol(symbol, period, delayNum, loop, roundTrip); + } + this._period = period; + this._loop = loop; + this._roundTrip = roundTrip; + } + _animateSymbol(symbol, period, delayNum, loop, roundTrip) { + if (period > 0) { + symbol.__t = 0; + const self2 = this; + const animator = symbol.animate("", loop).when(roundTrip ? period * 2 : period, { + __t: roundTrip ? 2 : 1 + }).delay(delayNum).during(function() { + self2._updateSymbolPosition(symbol); }); - } - - var MarkAreaModel = /** @class */function (_super) { - __extends(MarkAreaModel, _super); - function MarkAreaModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkAreaModel.type; - return _this; + if (!loop) { + animator.done(function() { + self2.remove(symbol); + }); + } + animator.start(); + } + } + _getLineLength(symbol) { + return dist(symbol.__p1, symbol.__cp1) + dist(symbol.__cp1, symbol.__p2); + } + _updateAnimationPoints(symbol, points4) { + symbol.__p1 = points4[0]; + symbol.__p2 = points4[1]; + symbol.__cp1 = points4[2] || [ + (points4[0][0] + points4[1][0]) / 2, + (points4[0][1] + points4[1][1]) / 2 + ]; + } + updateData(lineData, idx, seriesScope) { + this.childAt(0).updateData(lineData, idx, seriesScope); + this._updateEffectSymbol(lineData, idx); + } + _updateSymbolPosition(symbol) { + const p1 = symbol.__p1; + const p2 = symbol.__p2; + const cp1 = symbol.__cp1; + const t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t; + const pos = [symbol.x, symbol.y]; + const lastPos = pos.slice(); + const quadraticAt3 = quadraticAt; + const quadraticDerivativeAt2 = quadraticDerivativeAt; + pos[0] = quadraticAt3(p1[0], cp1[0], p2[0], t); + pos[1] = quadraticAt3(p1[1], cp1[1], p2[1], t); + const tx = symbol.__t < 1 ? quadraticDerivativeAt2(p1[0], cp1[0], p2[0], t) : quadraticDerivativeAt2(p2[0], cp1[0], p1[0], 1 - t); + const ty = symbol.__t < 1 ? quadraticDerivativeAt2(p1[1], cp1[1], p2[1], t) : quadraticDerivativeAt2(p2[1], cp1[1], p1[1], 1 - t); + symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; + if (this._symbolType === "line" || this._symbolType === "rect" || this._symbolType === "roundRect") { + if (symbol.__lastT !== void 0 && symbol.__lastT < symbol.__t) { + symbol.scaleY = dist(lastPos, pos) * 1.05; + if (t === 1) { + pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2; + pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2; + } + } else if (symbol.__lastT === 1) { + symbol.scaleY = 2 * dist(p1, pos); + } else { + symbol.scaleY = this._symbolScale[1]; + } + } + symbol.__lastT = symbol.__t; + symbol.ignore = false; + symbol.x = pos[0]; + symbol.y = pos[1]; + } + updateLayout(lineData, idx) { + this.childAt(0).updateLayout(lineData, idx); + const effectModel = lineData.getItemModel(idx).getModel("effect"); + this._updateEffectAnimation(lineData, effectModel, idx); + } +}; +var EffectLine_default = EffectLine; + +// src/chart/helper/Polyline.ts +var Polyline5 = class extends Group_default { + constructor(lineData, idx, seriesScope) { + super(); + this._createPolyline(lineData, idx, seriesScope); + } + _createPolyline(lineData, idx, seriesScope) { + const points4 = lineData.getItemLayout(idx); + const line2 = new Polyline_default({ + shape: { + points: points4 } - MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { - return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel); - }; - MarkAreaModel.type = 'markArea'; - MarkAreaModel.defaultOption = { - // zlevel: 0, - // PENDING - z: 1, - tooltip: { - trigger: 'item' - }, - // markArea should fixed on the coordinate system - animation: false, - label: { - show: true, - position: 'top' - }, - itemStyle: { - // color and borderColor default to use color from series - // color: 'auto' - // borderColor: 'auto' - borderWidth: 0 - }, - emphasis: { - label: { - show: true, - position: 'top' - } - } - }; - return MarkAreaModel; - }(MarkerModel); - - var inner$j = makeInner(); - var markAreaTransform = function (seriesModel, coordSys, maModel, item) { - // item may be null - var item0 = item[0]; - var item1 = item[1]; - if (!item0 || !item1) { - return; + }); + this.add(line2); + this._updateCommonStl(lineData, idx, seriesScope); + } + updateData(lineData, idx, seriesScope) { + const seriesModel = lineData.hostModel; + const line2 = this.childAt(0); + const target = { + shape: { + points: lineData.getItemLayout(idx) } - var lt = dataTransform(seriesModel, item0); - var rb = dataTransform(seriesModel, item1); - // FIXME make sure lt is less than rb - var ltCoord = lt.coord; - var rbCoord = rb.coord; - ltCoord[0] = retrieve(ltCoord[0], -Infinity); - ltCoord[1] = retrieve(ltCoord[1], -Infinity); - rbCoord[0] = retrieve(rbCoord[0], Infinity); - rbCoord[1] = retrieve(rbCoord[1], Infinity); - // Merge option into one - var result = mergeAll([{}, lt, rb]); - result.coord = [lt.coord, rb.coord]; - result.x0 = lt.x; - result.y0 = lt.y; - result.x1 = rb.x; - result.y1 = rb.y; - return result; }; - function isInfinity$1(val) { - return !isNaN(val) && !isFinite(val); - } - // If a markArea has one dim - function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { - var otherDimIndex = 1 - dimIndex; - return isInfinity$1(fromCoord[otherDimIndex]) && isInfinity$1(toCoord[otherDimIndex]); - } - function markAreaFilter(coordSys, item) { - var fromCoord = item.coord[0]; - var toCoord = item.coord[1]; - var item0 = { - coord: fromCoord, - x: item.x0, - y: item.y0 - }; - var item1 = { - coord: toCoord, - x: item.x1, - y: item.y1 - }; - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - // In case - // { - // markArea: { - // data: [{ yAxis: 2 }] - // } - // } - if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) { - return true; - } - // Directly returning true may also do the work, - // because markArea will not be shown automatically - // when it's not included in coordinate system. - // But filtering ahead can avoid keeping rendering markArea - // when there are too many of them. - return zoneFilter(coordSys, item0, item1); - } - return dataFilter$1(coordSys, item0) || dataFilter$1(coordSys, item1); - } - // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0'] - function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - var itemModel = data.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get(dims[0]), api.getWidth()); - var yPx = parsePercent$1(itemModel.get(dims[1]), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } else { - // Chart like bar may have there own marker positioning logic - if (seriesModel.getMarkerPosition) { - // Consider the case that user input the right-bottom point first - // Pick the larger x and y as 'x1' and 'y1' - var pointValue0 = data.getValues(['x0', 'y0'], idx); - var pointValue1 = data.getValues(['x1', 'y1'], idx); - var clampPointValue0 = coordSys.clampData(pointValue0); - var clampPointValue1 = coordSys.clampData(pointValue1); - var pointValue = []; - if (dims[0] === 'x0') { - pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue1[0] : pointValue0[0]; - } else { - pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue0[0] : pointValue1[0]; - } - if (dims[1] === 'y0') { - pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue1[1] : pointValue0[1]; - } else { - pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue0[1] : pointValue1[1]; - } - // Use the getMarkerPosition - point = seriesModel.getMarkerPosition(pointValue, dims, true); - } else { - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - var pt = [x, y]; - coordSys.clampData && coordSys.clampData(pt, pt); - point = coordSys.dataToPoint(pt, true); - } - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - if (isInfinity$1(x)) { - point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); - } else if (isInfinity$1(y)) { - point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); - } - } - // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; + updateProps(line2, target, seriesModel, idx); + this._updateCommonStl(lineData, idx, seriesScope); + } + _updateCommonStl(lineData, idx, seriesScope) { + const line2 = this.childAt(0); + const itemModel = lineData.getItemModel(idx); + let emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; + let focus = seriesScope && seriesScope.focus; + let blurScope = seriesScope && seriesScope.blurScope; + let emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; + if (!seriesScope || lineData.hasItemOption) { + const emphasisModel = itemModel.getModel("emphasis"); + emphasisLineStyle = emphasisModel.getModel("lineStyle").getLineStyle(); + emphasisDisabled = emphasisModel.get("disabled"); + focus = emphasisModel.get("focus"); + blurScope = emphasisModel.get("blurScope"); + } + line2.useStyle(lineData.getItemVisual(idx, "style")); + line2.style.fill = null; + line2.style.strokeNoScale = true; + const lineEmphasisState = line2.ensureState("emphasis"); + lineEmphasisState.style = emphasisLineStyle; + toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); + } + updateLayout(lineData, idx) { + const polyline = this.childAt(0); + polyline.setShape("points", lineData.getItemLayout(idx)); + } +}; +var Polyline_default2 = Polyline5; + +// src/chart/helper/EffectPolyline.ts +var EffectPolyline = class extends EffectLine_default { + constructor() { + super(...arguments); + this._lastFrame = 0; + this._lastFramePercent = 0; + } + createLine(lineData, idx, seriesScope) { + return new Polyline_default2(lineData, idx, seriesScope); + } + _updateAnimationPoints(symbol, points4) { + this._points = points4; + const accLenArr = [0]; + let len2 = 0; + for (let i = 1; i < points4.length; i++) { + const p1 = points4[i - 1]; + const p2 = points4[i]; + len2 += dist(p1, p2); + accLenArr.push(len2); + } + if (len2 === 0) { + this._length = 0; + return; + } + for (let i = 0; i < accLenArr.length; i++) { + accLenArr[i] /= len2; + } + this._offsets = accLenArr; + this._length = len2; + } + _getLineLength() { + return this._length; + } + _updateSymbolPosition(symbol) { + const t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t; + const points4 = this._points; + const offsets = this._offsets; + const len2 = points4.length; + if (!offsets) { + return; + } + const lastFrame = this._lastFrame; + let frame; + if (t < this._lastFramePercent) { + const start2 = Math.min(lastFrame + 1, len2 - 1); + for (frame = start2; frame >= 0; frame--) { + if (offsets[frame] <= t) { + break; } - if (!isNaN(yPx)) { - point[1] = yPx; + } + frame = Math.min(frame, len2 - 2); + } else { + for (frame = lastFrame; frame < len2; frame++) { + if (offsets[frame] > t) { + break; } } - return point; - } - var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']]; - var MarkAreaView = /** @class */function (_super) { - __extends(MarkAreaView, _super); - function MarkAreaView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkAreaView.type; - return _this; + frame = Math.min(frame - 1, len2 - 2); + } + const p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]); + const p0 = points4[frame]; + const p1 = points4[frame + 1]; + symbol.x = p0[0] * (1 - p) + p * p1[0]; + symbol.y = p0[1] * (1 - p) + p * p1[1]; + const tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0]; + const ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1]; + symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; + this._lastFrame = frame; + this._lastFramePercent = t; + symbol.ignore = false; + } +}; +var EffectPolyline_default = EffectPolyline; + +// src/chart/helper/LargeLineDraw.ts +var LargeLinesPathShape = class { + constructor() { + this.polyline = false; + this.curveness = 0; + this.segs = []; + } +}; +var LargeLinesPath = class extends Path_default { + constructor(opts) { + super(opts); + this._off = 0; + this.hoverDataIdx = -1; + } + reset() { + this.notClear = false; + this._off = 0; + } + getDefaultStyle() { + return { + stroke: "#000", + fill: null + }; + } + getDefaultShape() { + return new LargeLinesPathShape(); + } + buildPath(ctx, shape) { + const segs = shape.segs; + const curveness = shape.curveness; + let i; + if (shape.polyline) { + for (i = this._off; i < segs.length; ) { + const count2 = segs[i++]; + if (count2 > 0) { + ctx.moveTo(segs[i++], segs[i++]); + for (let k = 1; k < count2; k++) { + ctx.lineTo(segs[i++], segs[i++]); + } + } + } + } else { + for (i = this._off; i < segs.length; ) { + const x0 = segs[i++]; + const y0 = segs[i++]; + const x1 = segs[i++]; + const y1 = segs[i++]; + ctx.moveTo(x0, y0); + if (curveness > 0) { + const x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; + const y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; + ctx.quadraticCurveTo(x2, y2, x1, y1); + } else { + ctx.lineTo(x1, y1); + } + } + } + if (this.incremental) { + this._off = i; + this.notClear = true; + } + } + findDataIndex(x, y) { + const shape = this.shape; + const segs = shape.segs; + const curveness = shape.curveness; + const lineWidth = this.style.lineWidth; + if (shape.polyline) { + let dataIndex = 0; + for (let i = 0; i < segs.length; ) { + const count2 = segs[i++]; + if (count2 > 0) { + const x0 = segs[i++]; + const y0 = segs[i++]; + for (let k = 1; k < count2; k++) { + const x1 = segs[i++]; + const y1 = segs[i++]; + if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { + return dataIndex; + } + } + } + dataIndex++; + } + } else { + let dataIndex = 0; + for (let i = 0; i < segs.length; ) { + const x0 = segs[i++]; + const y0 = segs[i++]; + const x1 = segs[i++]; + const y1 = segs[i++]; + if (curveness > 0) { + const x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; + const y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; + if (containStroke3(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) { + return dataIndex; + } + } else { + if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { + return dataIndex; + } + } + dataIndex++; + } + } + return -1; + } + contain(x, y) { + const localPos = this.transformCoordToLocal(x, y); + const rect = this.getBoundingRect(); + x = localPos[0]; + y = localPos[1]; + if (rect.contain(x, y)) { + const dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); + return dataIdx >= 0; + } + this.hoverDataIdx = -1; + return false; + } + getBoundingRect() { + let rect = this._rect; + if (!rect) { + const shape = this.shape; + const points4 = shape.segs; + let minX = Infinity; + let minY = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + for (let i = 0; i < points4.length; ) { + const x = points4[i++]; + const y = points4[i++]; + minX = Math.min(x, minX); + maxX = Math.max(x, maxX); + minY = Math.min(y, minY); + maxY = Math.max(y, maxY); + } + rect = this._rect = new BoundingRect_default(minX, minY, maxX, maxY); + } + return rect; + } +}; +var LargeLineDraw = class { + constructor() { + this.group = new Group_default(); + } + updateData(data) { + this._clear(); + const lineEl = this._create(); + lineEl.setShape({ + segs: data.getLayout("linesPoints") + }); + this._setCommon(lineEl, data); + } + incrementalPrepareUpdate(data) { + this.group.removeAll(); + this._clear(); + } + incrementalUpdate(taskParams, data) { + const lastAdded = this._newAdded[0]; + const linePoints = data.getLayout("linesPoints"); + const oldSegs = lastAdded && lastAdded.shape.segs; + if (oldSegs && oldSegs.length < 2e4) { + const oldLen = oldSegs.length; + const newSegs = new Float32Array(oldLen + linePoints.length); + newSegs.set(oldSegs); + newSegs.set(linePoints, oldLen); + lastAdded.setShape({ + segs: newSegs + }); + } else { + this._newAdded = []; + const lineEl = this._create(); + lineEl.incremental = true; + lineEl.setShape({ + segs: linePoints + }); + this._setCommon(lineEl, data); + lineEl.__startIndex = taskParams.start; + } + } + remove() { + this._clear(); + } + eachRendered(cb) { + this._newAdded[0] && cb(this._newAdded[0]); + } + _create() { + const lineEl = new LargeLinesPath({ + cursor: "default", + ignoreCoarsePointer: true + }); + this._newAdded.push(lineEl); + this.group.add(lineEl); + return lineEl; + } + _setCommon(lineEl, data, isIncremental) { + const hostModel = data.hostModel; + lineEl.setShape({ + polyline: hostModel.get("polyline"), + curveness: hostModel.get(["lineStyle", "curveness"]) + }); + lineEl.useStyle(hostModel.getModel("lineStyle").getLineStyle()); + lineEl.style.strokeNoScale = true; + const style = data.getVisual("style"); + if (style && style.stroke) { + lineEl.setStyle("stroke", style.stroke); + } + lineEl.setStyle("fill", null); + const ecData = getECData(lineEl); + ecData.seriesIndex = hostModel.seriesIndex; + lineEl.on("mousemove", function(e2) { + ecData.dataIndex = null; + const dataIndex = lineEl.hoverDataIdx; + if (dataIndex > 0) { + ecData.dataIndex = dataIndex + lineEl.__startIndex; } - MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea'); - if (maModel) { - var areaData_1 = maModel.getData(); - areaData_1.each(function (idx) { - var points = map(dimPermutations, function (dim) { - return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api); - }); - // Layout - areaData_1.setItemLayout(idx, points); - var el = areaData_1.getItemGraphicEl(idx); - el.setShape('points', points); - }); + }); + } + _clear() { + this._newAdded = []; + this.group.removeAll(); + } +}; +var LargeLineDraw_default = LargeLineDraw; + +// src/chart/lines/linesLayout.ts +var linesLayout = { + seriesType: "lines", + plan: createRenderPlanner(), + reset: function(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + if (!coordSys) { + if (true) { + error("The lines series must have a coordinate system."); + } + return; + } + const isPolyline = seriesModel.get("polyline"); + const isLarge = seriesModel.pipelineContext.large; + return { + progress(params, lineData) { + const lineCoords = []; + if (isLarge) { + let points4; + const segCount = params.end - params.start; + if (isPolyline) { + let totalCoordsCount = 0; + for (let i = params.start; i < params.end; i++) { + totalCoordsCount += seriesModel.getLineCoordsCount(i); + } + points4 = new Float32Array(segCount + totalCoordsCount * 2); + } else { + points4 = new Float32Array(segCount * 4); } - }, this); - }; - MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); - var areaGroupMap = this.markerGroupMap; - var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, { - group: new Group() - }); - this.group.add(polygonGroup.group); - this.markKeep(polygonGroup); - var areaData = createList$2(coordSys, seriesModel, maModel); - // Line data for tooltip and formatter - maModel.setData(areaData); - // Update visual and layout of line - areaData.each(function (idx) { - // Layout - var points = map(dimPermutations, function (dim) { - return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); - }); - var xAxisScale = coordSys.getAxis('x').scale; - var yAxisScale = coordSys.getAxis('y').scale; - var xAxisExtent = xAxisScale.getExtent(); - var yAxisExtent = yAxisScale.getExtent(); - var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))]; - var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))]; - asc(xPointExtent); - asc(yPointExtent); - var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]); - // If none of the area is inside coordSys, allClipped is set to be true - // in layout so that label will not be displayed. See #12591 - var allClipped = !overlapped; - areaData.setItemLayout(idx, { - points: points, - allClipped: allClipped - }); - var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle(); - var color$1 = getVisualFromData(seriesData, 'color'); - if (!style.fill) { - style.fill = color$1; - if (isString(style.fill)) { - style.fill = modifyAlpha(style.fill, 0.4); + let offset = 0; + let pt = []; + for (let i = params.start; i < params.end; i++) { + const len2 = seriesModel.getLineCoords(i, lineCoords); + if (isPolyline) { + points4[offset++] = len2; + } + for (let k = 0; k < len2; k++) { + pt = coordSys.dataToPoint(lineCoords[k], false, pt); + points4[offset++] = pt[0]; + points4[offset++] = pt[1]; } } - if (!style.stroke) { - style.stroke = color$1; - } - // Visual - areaData.setItemVisual(idx, 'style', style); - }); - areaData.diff(inner$j(polygonGroup).data).add(function (idx) { - var layout = areaData.getItemLayout(idx); - if (!layout.allClipped) { - var polygon = new Polygon({ - shape: { - points: layout.points + lineData.setLayout("linesPoints", points4); + } else { + for (let i = params.start; i < params.end; i++) { + const itemModel = lineData.getItemModel(i); + const len2 = seriesModel.getLineCoords(i, lineCoords); + const pts = []; + if (isPolyline) { + for (let j = 0; j < len2; j++) { + pts.push(coordSys.dataToPoint(lineCoords[j])); } - }); - areaData.setItemGraphicEl(idx, polygon); - polygonGroup.group.add(polygon); - } - }).update(function (newIdx, oldIdx) { - var polygon = inner$j(polygonGroup).data.getItemGraphicEl(oldIdx); - var layout = areaData.getItemLayout(newIdx); - if (!layout.allClipped) { - if (polygon) { - updateProps(polygon, { - shape: { - points: layout.points - } - }, maModel, newIdx); } else { - polygon = new Polygon({ - shape: { - points: layout.points - } - }); + pts[0] = coordSys.dataToPoint(lineCoords[0]); + pts[1] = coordSys.dataToPoint(lineCoords[1]); + const 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 + ]; + } } - areaData.setItemGraphicEl(newIdx, polygon); - polygonGroup.group.add(polygon); - } else if (polygon) { - polygonGroup.group.remove(polygon); + lineData.setItemLayout(i, pts); } - }).remove(function (idx) { - var polygon = inner$j(polygonGroup).data.getItemGraphicEl(idx); - polygonGroup.group.remove(polygon); - }).execute(); - areaData.eachItemGraphicEl(function (polygon, idx) { - var itemModel = areaData.getItemModel(idx); - var style = areaData.getItemVisual(idx, 'style'); - polygon.useStyle(areaData.getItemVisual(idx, 'style')); - setLabelStyle(polygon, getLabelStatesModels(itemModel), { - labelFetcher: maModel, - labelDataIndex: idx, - defaultText: areaData.getName(idx) || '', - inheritColor: isString(style.fill) ? modifyAlpha(style.fill, 1) : '#000' - }); - setStatesStylesFromModel(polygon, itemModel); - toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled'])); - getECData(polygon).dataModel = maModel; - }); - inner$j(polygonGroup).data = areaData; - polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent'); - }; - MarkAreaView.type = 'markArea'; - return MarkAreaView; - }(MarkerView); - function createList$2(coordSys, seriesModel, maModel) { - var areaData; - var dataDims; - var dims = ['x0', 'y0', 'x1', 'y1']; - if (coordSys) { - var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function (coordDim) { - var data = seriesModel.getData(); - var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {}; - // In map series data don't have lng and lat dimension. Fallback to same with coordSys - return extend(extend({}, info), { - name: coordDim, - // DON'T use ordinalMeta to parse and collect ordinal. - ordinalMeta: null - }); - }); - dataDims = map(dims, function (dim, idx) { - return { - name: dim, - type: coordDimsInfos_1[idx % 2].type - }; - }); - areaData = new SeriesData(dataDims, maModel); - } else { - dataDims = [{ - name: 'value', - type: 'float' - }]; - areaData = new SeriesData(dataDims, maModel); - } - var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel)); - if (coordSys) { - optData = filter(optData, curry(markAreaFilter, coordSys)); - } - var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) { - // TODO should convert to ParsedValue? - var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; - return parseDataValue(rawVal, dataDims[dimIndex]); - } : function (item, dimName, dataIndex, dimIndex) { - return parseDataValue(item.value, dataDims[dimIndex]); - }; - areaData.initData(optData, null, dimValueGetter); - areaData.hasItemOption = true; - return areaData; - } - - function install$G(registers) { - registers.registerComponentModel(MarkAreaModel); - registers.registerComponentView(MarkAreaView); - registers.registerPreprocessor(function (opt) { - if (checkMarkerInSeries(opt.series, 'markArea')) { - // Make sure markArea component is enabled - opt.markArea = opt.markArea || {}; } + } + }; + } +}; +var linesLayout_default = linesLayout; + +// src/chart/lines/LinesView.ts +var LinesView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = LinesView2.type; + } + render(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const lineDraw = this._updateLineDraw(data, seriesModel); + const zlevel = seriesModel.get("zlevel"); + const trailLength = seriesModel.get(["effect", "trailLength"]); + const zr = api2.getZr(); + const isSvg = zr.painter.getType() === "svg"; + if (!isSvg) { + zr.painter.getLayer(zlevel).clear(true); + } + if (this._lastZlevel != null && !isSvg) { + zr.configLayer(this._lastZlevel, { + motionBlur: false }); } - - var getDefaultSelectorOptions = function (ecModel, type) { - if (type === 'all') { - return { - type: 'all', - title: ecModel.getLocaleModel().get(['legend', 'selector', 'all']) - }; - } else if (type === 'inverse') { - return { - type: 'inverse', - title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse']) - }; + if (this._showEffect(seriesModel) && trailLength > 0) { + if (!isSvg) { + zr.configLayer(zlevel, { + motionBlur: true, + lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) + }); + } else if (true) { + console.warn("SVG render mode doesn't support lines with trail effect"); + } + } + lineDraw.updateData(data); + const clipPath = seriesModel.get("clip", true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); + if (clipPath) { + this.group.setClipPath(clipPath); + } else { + this.group.removeClipPath(); + } + this._lastZlevel = zlevel; + this._finished = true; + } + incrementalPrepareRender(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const lineDraw = this._updateLineDraw(data, seriesModel); + lineDraw.incrementalPrepareUpdate(data); + this._clearLayer(api2); + this._finished = false; + } + incrementalRender(taskParams, seriesModel, ecModel) { + this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData()); + this._finished = taskParams.end === seriesModel.getData().count(); + } + eachRendered(cb) { + this._lineDraw && this._lineDraw.eachRendered(cb); + } + updateTransform(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const pipelineContext = seriesModel.pipelineContext; + if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) { + return { + update: true + }; + } else { + const res = linesLayout_default.reset(seriesModel, ecModel, api2); + if (res.progress) { + res.progress({ + start: 0, + end: data.count(), + count: data.count() + }, data); + } + this._lineDraw.updateLayout(); + this._clearLayer(api2); + } + } + _updateLineDraw(data, seriesModel) { + let lineDraw = this._lineDraw; + const hasEffect = this._showEffect(seriesModel); + const isPolyline = !!seriesModel.get("polyline"); + const pipelineContext = seriesModel.pipelineContext; + const isLargeDraw = pipelineContext.large; + if (true) { + if (hasEffect && isLargeDraw) { + console.warn("Large lines not support effect"); + } + } + if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) { + if (lineDraw) { + lineDraw.remove(); + } + lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw_default() : new LineDraw_default(isPolyline ? hasEffect ? EffectPolyline_default : Polyline_default2 : hasEffect ? EffectLine_default : Line_default2); + this._hasEffet = hasEffect; + this._isPolyline = isPolyline; + this._isLargeDraw = isLargeDraw; + } + this.group.add(lineDraw.group); + return lineDraw; + } + _showEffect(seriesModel) { + return !!seriesModel.get(["effect", "show"]); + } + _clearLayer(api2) { + const zr = api2.getZr(); + const isSvg = zr.painter.getType() === "svg"; + if (!isSvg && this._lastZlevel != null) { + zr.painter.getLayer(this._lastZlevel).clear(true); + } + } + remove(ecModel, api2) { + this._lineDraw && this._lineDraw.remove(); + this._lineDraw = null; + this._clearLayer(api2); + } + dispose(ecModel, api2) { + this.remove(ecModel, api2); + } +}; +var LinesView = LinesView2; +LinesView.type = "lines"; +var LinesView_default = LinesView; + +// src/chart/lines/LinesSeries.ts +var Uint32Arr = typeof Uint32Array === "undefined" ? Array : Uint32Array; +var Float64Arr = typeof Float64Array === "undefined" ? Array : Float64Array; +function compatEc2(seriesOpt) { + const data = seriesOpt.data; + if (data && data[0] && data[0][0] && data[0][0].coord) { + if (true) { + console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"); + } + seriesOpt.data = map(data, function(itemOpt) { + const coords = [ + itemOpt[0].coord, + itemOpt[1].coord + ]; + const target = { + coords + }; + if (itemOpt[0].name) { + target.fromName = itemOpt[0].name; } - }; - var LegendModel = /** @class */function (_super) { - __extends(LegendModel, _super); - function LegendModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = LegendModel.type; - _this.layoutMode = { - type: 'box', - // legend.width/height are maxWidth/maxHeight actually, - // whereas real width/height is calculated by its content. - // (Setting {left: 10, right: 10} does not make sense). - // So consider the case: - // `setOption({legend: {left: 10});` - // then `setOption({legend: {right: 10});` - // The previous `left` should be cleared by setting `ignoreSize`. - ignoreSize: true - }; - return _this; + if (itemOpt[1].name) { + target.toName = itemOpt[1].name; } - LegendModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - option.selected = option.selected || {}; - this._updateSelector(option); - }; - LegendModel.prototype.mergeOption = function (option, ecModel) { - _super.prototype.mergeOption.call(this, option, ecModel); - this._updateSelector(option); - }; - LegendModel.prototype._updateSelector = function (option) { - var selector = option.selector; - var ecModel = this.ecModel; - if (selector === true) { - selector = option.selector = ['all', 'inverse']; - } - if (isArray(selector)) { - each(selector, function (item, index) { - isString(item) && (item = { - type: item - }); - selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type)); - }); - } - }; - LegendModel.prototype.optionUpdated = function () { - this._updateData(this.ecModel); - var legendData = this._data; - // If selectedMode is single, try to select one - if (legendData[0] && this.get('selectedMode') === 'single') { - var hasSelected = false; - // If has any selected in option.selected - for (var i = 0; i < legendData.length; i++) { - var name_1 = legendData[i].get('name'); - if (this.isSelected(name_1)) { - // Force to unselect others - this.select(name_1); - hasSelected = true; - break; - } - } - // Try select the first if selectedMode is single - !hasSelected && this.select(legendData[0].get('name')); - } - }; - LegendModel.prototype._updateData = function (ecModel) { - var potentialData = []; - var availableNames = []; - ecModel.eachRawSeries(function (seriesModel) { - var seriesName = seriesModel.name; - availableNames.push(seriesName); - var isPotential; - if (seriesModel.legendVisualProvider) { - var provider = seriesModel.legendVisualProvider; - var names = provider.getAllNames(); - if (!ecModel.isSeriesFiltered(seriesModel)) { - availableNames = availableNames.concat(names); - } - if (names.length) { - potentialData = potentialData.concat(names); - } else { - isPotential = true; + return mergeAll([target, itemOpt[0], itemOpt[1]]); + }); + } +} +var LinesSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = LinesSeriesModel2.type; + this.visualStyleAccessPath = "lineStyle"; + this.visualDrawType = "stroke"; + } + init(option) { + option.data = option.data || []; + compatEc2(option); + const result = this._processFlatCoordsArray(option.data); + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; + if (result.flatCoords) { + option.data = new Float32Array(result.count); + } + super.init.apply(this, arguments); + } + mergeOption(option) { + compatEc2(option); + if (option.data) { + const result = this._processFlatCoordsArray(option.data); + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; + if (result.flatCoords) { + option.data = new Float32Array(result.count); + } + } + super.mergeOption.apply(this, arguments); + } + appendData(params) { + const result = this._processFlatCoordsArray(params.data); + if (result.flatCoords) { + if (!this._flatCoords) { + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; + } else { + this._flatCoords = concatArray(this._flatCoords, result.flatCoords); + this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset); + } + params.data = new Float32Array(result.count); + } + this.getRawData().appendData(params.data); + } + _getCoordsFromItemModel(idx) { + const itemModel = this.getData().getItemModel(idx); + const coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow("coords"); + if (true) { + if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { + throw new Error("Invalid coords " + JSON.stringify(coords) + ". Lines must have 2d coords array in data item."); + } + } + return coords; + } + getLineCoordsCount(idx) { + if (this._flatCoordsOffset) { + return this._flatCoordsOffset[idx * 2 + 1]; + } else { + return this._getCoordsFromItemModel(idx).length; + } + } + getLineCoords(idx, out2) { + if (this._flatCoordsOffset) { + const offset = this._flatCoordsOffset[idx * 2]; + const len2 = this._flatCoordsOffset[idx * 2 + 1]; + for (let i = 0; i < len2; i++) { + out2[i] = out2[i] || []; + out2[i][0] = this._flatCoords[offset + i * 2]; + out2[i][1] = this._flatCoords[offset + i * 2 + 1]; + } + return len2; + } else { + const coords = this._getCoordsFromItemModel(idx); + for (let i = 0; i < coords.length; i++) { + out2[i] = out2[i] || []; + out2[i][0] = coords[i][0]; + out2[i][1] = coords[i][1]; + } + return coords.length; + } + } + _processFlatCoordsArray(data) { + let startOffset = 0; + if (this._flatCoords) { + startOffset = this._flatCoords.length; + } + if (isNumber(data[0])) { + const len2 = data.length; + const coordsOffsetAndLenStorage = new Uint32Arr(len2); + const coordsStorage = new Float64Arr(len2); + let coordsCursor = 0; + let offsetCursor = 0; + let dataCount = 0; + for (let i = 0; i < len2; ) { + dataCount++; + const count2 = data[i++]; + coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; + coordsOffsetAndLenStorage[offsetCursor++] = count2; + for (let k = 0; k < count2; k++) { + const x = data[i++]; + const y = data[i++]; + coordsStorage[coordsCursor++] = x; + coordsStorage[coordsCursor++] = y; + if (i > len2) { + if (true) { + throw new Error("Invalid data format."); } - } else { - isPotential = true; - } - if (isPotential && isNameSpecified(seriesModel)) { - potentialData.push(seriesModel.name); - } - }); - /** - * @type {Array.} - * @private - */ - this._availableNames = availableNames; - // If legend.data is not specified in option, use availableNames as data, - // which is convenient for user preparing option. - var rawData = this.get('data') || potentialData; - var legendNameMap = createHashMap(); - var legendData = map(rawData, function (dataItem) { - // Can be string or number - if (isString(dataItem) || isNumber(dataItem)) { - dataItem = { - name: dataItem - }; } - if (legendNameMap.get(dataItem.name)) { - // remove legend name duplicate - return null; - } - legendNameMap.set(dataItem.name, true); - return new Model(dataItem, this, this.ecModel); - }, this); - /** - * @type {Array.} - * @private - */ - this._data = filter(legendData, function (item) { - return !!item; - }); - }; - LegendModel.prototype.getData = function () { - return this._data; - }; - LegendModel.prototype.select = function (name) { - var selected = this.option.selected; - var selectedMode = this.get('selectedMode'); - if (selectedMode === 'single') { - var data = this._data; - each(data, function (dataItem) { - selected[dataItem.get('name')] = false; - }); } - selected[name] = true; + } + return { + flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor), + flatCoords: coordsStorage, + count: dataCount }; - LegendModel.prototype.unSelect = function (name) { - if (this.get('selectedMode') !== 'single') { - this.option.selected[name] = false; + } + return { + flatCoordsOffset: null, + flatCoords: null, + count: data.length + }; + } + getInitialData(option, ecModel) { + if (true) { + const CoordSys = CoordinateSystem_default.get(option.coordinateSystem); + if (!CoordSys) { + throw new Error("Unknown coordinate system " + option.coordinateSystem); + } + } + const lineData = new SeriesData_default(["value"], this); + lineData.hasItemOption = false; + lineData.initData(option.data, [], function(dataItem, dimName, dataIndex, dimIndex) { + if (dataItem instanceof Array) { + return NaN; + } else { + lineData.hasItemOption = true; + const value = dataItem.value; + if (value != null) { + return value instanceof Array ? value[dimIndex] : value; } - }; - LegendModel.prototype.toggleSelected = function (name) { - var selected = this.option.selected; - // Default is true - if (!selected.hasOwnProperty(name)) { - selected[name] = true; + } + }); + return lineData; + } + formatTooltip(dataIndex, multipleSeries, dataType) { + const data = this.getData(); + const itemModel = data.getItemModel(dataIndex); + const name = itemModel.get("name"); + if (name) { + return name; + } + const fromName = itemModel.get("fromName"); + const toName = itemModel.get("toName"); + const nameArr = []; + fromName != null && nameArr.push(fromName); + toName != null && nameArr.push(toName); + return createTooltipMarkup("nameValue", { + name: nameArr.join(" > ") + }); + } + preventIncremental() { + return !!this.get(["effect", "show"]); + } + getProgressive() { + const progressive = this.option.progressive; + if (progressive == null) { + return this.option.large ? 1e4 : this.get("progressive"); + } + return progressive; + } + getProgressiveThreshold() { + const progressiveThreshold = this.option.progressiveThreshold; + if (progressiveThreshold == null) { + return this.option.large ? 2e4 : this.get("progressiveThreshold"); + } + return progressiveThreshold; + } + getZLevelKey() { + const effectModel = this.getModel("effect"); + const trailLength = effectModel.get("trailLength"); + return this.getData().count() > this.getProgressiveThreshold() ? this.id : effectModel.get("show") && trailLength > 0 ? trailLength + "" : ""; + } +}; +var LinesSeriesModel = LinesSeriesModel2; +LinesSeriesModel.type = "series.lines"; +LinesSeriesModel.dependencies = ["grid", "polar", "geo", "calendar"]; +LinesSeriesModel.defaultOption = { + coordinateSystem: "geo", + z: 2, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + symbol: ["none", "none"], + symbolSize: [10, 10], + geoIndex: 0, + effect: { + show: false, + period: 4, + constantSpeed: 0, + symbol: "circle", + symbolSize: 3, + loop: true, + trailLength: 0.2 + }, + large: false, + largeThreshold: 2e3, + polyline: false, + clip: true, + label: { + show: false, + position: "end" + }, + lineStyle: { + opacity: 0.5 + } +}; +var LinesSeries_default = LinesSeriesModel; + +// src/chart/lines/linesVisual.ts +function normalize4(a) { + if (!(a instanceof Array)) { + a = [a, a]; + } + return a; +} +var linesVisual = { + seriesType: "lines", + reset(seriesModel) { + const symbolType = normalize4(seriesModel.get("symbol")); + const symbolSize = normalize4(seriesModel.get("symbolSize")); + const 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]); + function dataEach(data2, idx) { + const itemModel = data2.getItemModel(idx); + const symbolType2 = normalize4(itemModel.getShallow("symbol", true)); + const symbolSize2 = normalize4(itemModel.getShallow("symbolSize", true)); + symbolType2[0] && data2.setItemVisual(idx, "fromSymbol", symbolType2[0]); + symbolType2[1] && data2.setItemVisual(idx, "toSymbol", symbolType2[1]); + symbolSize2[0] && data2.setItemVisual(idx, "fromSymbolSize", symbolSize2[0]); + symbolSize2[1] && data2.setItemVisual(idx, "toSymbolSize", symbolSize2[1]); + } + return { + dataEach: data.hasItemOption ? dataEach : null + }; + } +}; +var linesVisual_default = linesVisual; + +// src/chart/lines/install.ts +function install23(registers) { + registers.registerChartView(LinesView_default); + registers.registerSeriesModel(LinesSeries_default); + registers.registerLayout(linesLayout_default); + registers.registerVisual(linesVisual_default); +} + +// src/chart/heatmap/HeatmapLayer.ts +var GRADIENT_LEVELS = 256; +var HeatmapLayer = class { + constructor() { + this.blurSize = 30; + this.pointSize = 20; + this.maxOpacity = 1; + this.minOpacity = 0; + this._gradientPixels = { + inRange: null, + outOfRange: null + }; + const canvas = platformApi.createCanvas(); + this.canvas = canvas; + } + update(data, width, height, normalize5, colorFunc, isInRange) { + const brush3 = this._getBrush(); + const gradientInRange = this._getGradient(colorFunc, "inRange"); + const gradientOutOfRange = this._getGradient(colorFunc, "outOfRange"); + const r = this.pointSize + this.blurSize; + const canvas = this.canvas; + const ctx = canvas.getContext("2d"); + const len2 = data.length; + canvas.width = width; + canvas.height = height; + for (let i = 0; i < len2; ++i) { + const p = data[i]; + const x = p[0]; + const y = p[1]; + const value = p[2]; + const alpha = normalize5(value); + ctx.globalAlpha = alpha; + ctx.drawImage(brush3, x - r, y - r); + } + if (!canvas.width || !canvas.height) { + return canvas; + } + const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); + const pixels = imageData.data; + let offset = 0; + const pixelLen = pixels.length; + const minOpacity = this.minOpacity; + const maxOpacity = this.maxOpacity; + const diffOpacity = maxOpacity - minOpacity; + while (offset < pixelLen) { + let alpha = pixels[offset + 3] / 256; + const gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; + if (alpha > 0) { + const gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; + alpha > 0 && (alpha = alpha * diffOpacity + minOpacity); + pixels[offset++] = gradient[gradientOffset]; + pixels[offset++] = gradient[gradientOffset + 1]; + pixels[offset++] = gradient[gradientOffset + 2]; + pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256; + } else { + offset += 4; + } + } + ctx.putImageData(imageData, 0, 0); + return canvas; + } + _getBrush() { + const brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas()); + const r = this.pointSize + this.blurSize; + const d = r * 2; + brushCanvas.width = d; + brushCanvas.height = d; + const ctx = brushCanvas.getContext("2d"); + ctx.clearRect(0, 0, d, d); + ctx.shadowOffsetX = d; + ctx.shadowBlur = this.blurSize; + ctx.shadowColor = "#000"; + ctx.beginPath(); + ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true); + ctx.closePath(); + ctx.fill(); + return brushCanvas; + } + _getGradient(colorFunc, state) { + const gradientPixels = this._gradientPixels; + const pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4)); + const color2 = [0, 0, 0, 0]; + let off = 0; + for (let i = 0; i < 256; i++) { + colorFunc[state](i / 255, true, color2); + pixelsSingleState[off++] = color2[0]; + pixelsSingleState[off++] = color2[1]; + pixelsSingleState[off++] = color2[2]; + pixelsSingleState[off++] = color2[3]; + } + return pixelsSingleState; + } +}; +var HeatmapLayer_default = HeatmapLayer; + +// src/chart/heatmap/HeatmapView.ts +function getIsInPiecewiseRange(dataExtent, pieceList, selected) { + const dataSpan = dataExtent[1] - dataExtent[0]; + pieceList = map(pieceList, function(piece) { + return { + interval: [ + (piece.interval[0] - dataExtent[0]) / dataSpan, + (piece.interval[1] - dataExtent[0]) / dataSpan + ] + }; + }); + const len2 = pieceList.length; + let lastIndex = 0; + return function(val) { + let i; + for (i = lastIndex; i < len2; i++) { + const interval = pieceList[i].interval; + if (interval[0] <= val && val <= interval[1]) { + lastIndex = i; + break; + } + } + if (i === len2) { + for (i = lastIndex - 1; i >= 0; i--) { + const interval = pieceList[i].interval; + if (interval[0] <= val && val <= interval[1]) { + lastIndex = i; + break; } - this[selected[name] ? 'unSelect' : 'select'](name); - }; - LegendModel.prototype.allSelect = function () { - var data = this._data; - var selected = this.option.selected; - each(data, function (dataItem) { - selected[dataItem.get('name', true)] = true; - }); - }; - LegendModel.prototype.inverseSelect = function () { - var data = this._data; - var selected = this.option.selected; - each(data, function (dataItem) { - var name = dataItem.get('name', true); - // Initially, default value is true - if (!selected.hasOwnProperty(name)) { - selected[name] = true; - } - selected[name] = !selected[name]; - }); - }; - LegendModel.prototype.isSelected = function (name) { - var selected = this.option.selected; - return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0; - }; - LegendModel.prototype.getOrient = function () { - return this.get('orient') === 'vertical' ? { - index: 1, - name: 'vertical' - } : { - index: 0, - name: 'horizontal' - }; - }; - LegendModel.type = 'legend.plain'; - LegendModel.dependencies = ['series']; - LegendModel.defaultOption = { - // zlevel: 0, - z: 4, - show: true, - orient: 'horizontal', - left: 'center', - // right: 'center', - top: 0, - // bottom: null, - align: 'auto', - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - borderRadius: 0, - borderWidth: 0, - padding: 5, - itemGap: 10, - itemWidth: 25, - itemHeight: 14, - symbolRotate: 'inherit', - symbolKeepAspect: true, - inactiveColor: '#ccc', - inactiveBorderColor: '#ccc', - inactiveBorderWidth: 'auto', - itemStyle: { - color: 'inherit', - opacity: 'inherit', - borderColor: 'inherit', - borderWidth: 'auto', - borderCap: 'inherit', - borderJoin: 'inherit', - borderDashOffset: 'inherit', - borderMiterLimit: 'inherit' - }, - lineStyle: { - width: 'auto', - color: 'inherit', - inactiveColor: '#ccc', - inactiveWidth: 2, - opacity: 'inherit', - type: 'inherit', - cap: 'inherit', - join: 'inherit', - dashOffset: 'inherit', - miterLimit: 'inherit' - }, - textStyle: { - color: '#333' - }, - selectedMode: true, - selector: false, - selectorLabel: { - show: true, - borderRadius: 10, - padding: [3, 5, 3, 5], - fontSize: 12, - fontFamily: 'sans-serif', - color: '#666', - borderWidth: 1, - borderColor: '#666' - }, - emphasis: { - selectorLabel: { - show: true, - color: '#eee', - backgroundColor: '#666' - } - }, - selectorPosition: 'auto', - selectorItemGap: 7, - selectorButtonGap: 10, - tooltip: { - show: false + } + } + return i >= 0 && i < len2 && selected[i]; + }; +} +function getIsInContinuousRange(dataExtent, range) { + const dataSpan = dataExtent[1] - dataExtent[0]; + range = [ + (range[0] - dataExtent[0]) / dataSpan, + (range[1] - dataExtent[0]) / dataSpan + ]; + return function(val) { + return val >= range[0] && val <= range[1]; + }; +} +function isGeoCoordSys(coordSys) { + const dimensions = coordSys.dimensions; + return dimensions[0] === "lng" && dimensions[1] === "lat"; +} +var HeatmapView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = HeatmapView2.type; + } + render(seriesModel, ecModel, api2) { + let visualMapOfThisSeries; + ecModel.eachComponent("visualMap", function(visualMap) { + visualMap.eachTargetSeries(function(targetSeries) { + if (targetSeries === seriesModel) { + visualMapOfThisSeries = visualMap; } - }; - return LegendModel; - }(ComponentModel); - - var curry$1 = curry; - var each$c = each; - var Group$2 = Group; - var LegendView = /** @class */function (_super) { - __extends(LegendView, _super); - function LegendView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = LegendView.type; - _this.newlineDisabled = false; - return _this; - } - LegendView.prototype.init = function () { - this.group.add(this._contentGroup = new Group$2()); - this.group.add(this._selectorGroup = new Group$2()); - this._isFirstRender = true; - }; - /** - * @protected - */ - LegendView.prototype.getContentGroup = function () { - return this._contentGroup; - }; - /** - * @protected - */ - LegendView.prototype.getSelectorGroup = function () { - return this._selectorGroup; - }; - /** - * @override - */ - LegendView.prototype.render = function (legendModel, ecModel, api) { - var isFirstRender = this._isFirstRender; - this._isFirstRender = false; - this.resetInner(); - if (!legendModel.get('show', true)) { - return; + }); + }); + if (true) { + if (!visualMapOfThisSeries) { + throw new Error("Heatmap must use with visualMap"); + } + } + this._progressiveEls = null; + this.group.removeAll(); + const coordSys = seriesModel.coordinateSystem; + if (coordSys.type === "cartesian2d" || coordSys.type === "calendar") { + this._renderOnCartesianAndCalendar(seriesModel, api2, 0, seriesModel.getData().count()); + } else if (isGeoCoordSys(coordSys)) { + this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api2); + } + } + incrementalPrepareRender(seriesModel, ecModel, api2) { + this.group.removeAll(); + } + incrementalRender(params, seriesModel, ecModel, api2) { + const coordSys = seriesModel.coordinateSystem; + if (coordSys) { + if (isGeoCoordSys(coordSys)) { + this.render(seriesModel, ecModel, api2); + } else { + this._progressiveEls = []; + this._renderOnCartesianAndCalendar(seriesModel, api2, params.start, params.end, true); + } + } + } + eachRendered(cb) { + traverseElements(this._progressiveEls || this.group, cb); + } + _renderOnCartesianAndCalendar(seriesModel, api2, start2, end2, incremental) { + const coordSys = seriesModel.coordinateSystem; + const isCartesian2d = isCoordinateSystemType(coordSys, "cartesian2d"); + let width; + let height; + let xAxisExtent; + let yAxisExtent; + if (isCartesian2d) { + const xAxis = coordSys.getAxis("x"); + const yAxis = coordSys.getAxis("y"); + if (true) { + if (!(xAxis.type === "category" && yAxis.type === "category")) { + throw new Error("Heatmap on cartesian must have two category axes"); + } + if (!(xAxis.onBand && yAxis.onBand)) { + throw new Error("Heatmap on cartesian must have two axes with boundaryGap true"); + } + } + width = xAxis.getBandWidth() + 0.5; + height = yAxis.getBandWidth() + 0.5; + xAxisExtent = xAxis.scale.getExtent(); + yAxisExtent = yAxis.scale.getExtent(); + } + const group = this.group; + const data = seriesModel.getData(); + let emphasisStyle = seriesModel.getModel(["emphasis", "itemStyle"]).getItemStyle(); + let blurStyle = seriesModel.getModel(["blur", "itemStyle"]).getItemStyle(); + let selectStyle = seriesModel.getModel(["select", "itemStyle"]).getItemStyle(); + let borderRadius = seriesModel.get(["itemStyle", "borderRadius"]); + let labelStatesModels = getLabelStatesModels(seriesModel); + const emphasisModel = seriesModel.getModel("emphasis"); + let focus = emphasisModel.get("focus"); + let blurScope = emphasisModel.get("blurScope"); + let emphasisDisabled = emphasisModel.get("disabled"); + const dataDims = isCartesian2d ? [ + data.mapDimension("x"), + data.mapDimension("y"), + data.mapDimension("value") + ] : [ + data.mapDimension("time"), + data.mapDimension("value") + ]; + for (let idx = start2; idx < end2; idx++) { + let rect; + const style = data.getItemVisual(idx, "style"); + if (isCartesian2d) { + const dataDimX = data.get(dataDims[0], idx); + const dataDimY = data.get(dataDims[1], idx); + if (isNaN(data.get(dataDims[2], idx)) || isNaN(dataDimX) || isNaN(dataDimY) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) { + continue; } - var itemAlign = legendModel.get('align'); - var orient = legendModel.get('orient'); - if (!itemAlign || itemAlign === 'auto') { - itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left'; - } - // selector has been normalized to an array in model - var selector = legendModel.get('selector', true); - var selectorPosition = legendModel.get('selectorPosition', true); - if (selector && (!selectorPosition || selectorPosition === 'auto')) { - selectorPosition = orient === 'horizontal' ? 'end' : 'start'; - } - this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); - // Perform layout. - var positionInfo = legendModel.getBoxLayoutParams(); - var viewportSize = { - width: api.getWidth(), - height: api.getHeight() - }; - var padding = legendModel.get('padding'); - var maxSize = getLayoutRect(positionInfo, viewportSize, padding); - var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); - // Place mainGroup, based on the calculated `mainRect`. - var layoutRect = getLayoutRect(defaults({ - width: mainRect.width, - height: mainRect.height - }, positionInfo), viewportSize, padding); - this.group.x = layoutRect.x - mainRect.x; - this.group.y = layoutRect.y - mainRect.y; - this.group.markRedraw(); - // Render background after group is layout. - this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel)); - }; - LegendView.prototype.resetInner = function () { - this.getContentGroup().removeAll(); - this._backgroundEl && this.group.remove(this._backgroundEl); - this.getSelectorGroup().removeAll(); - }; - LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { - var contentGroup = this.getContentGroup(); - var legendDrawnMap = createHashMap(); - var selectMode = legendModel.get('selectedMode'); - var excludeSeriesId = []; - ecModel.eachRawSeries(function (seriesModel) { - !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); + const point = coordSys.dataToPoint([ + dataDimX, + dataDimY + ]); + rect = new Rect_default({ + shape: { + x: point[0] - width / 2, + y: point[1] - height / 2, + width, + height + }, + style }); - each$c(legendModel.getData(), function (legendItemModel, dataIndex) { - var name = legendItemModel.get('name'); - // Use empty string or \n as a newline string - if (!this.newlineDisabled && (name === '' || name === '\n')) { - var g = new Group$2(); - // @ts-ignore - g.newline = true; - contentGroup.add(g); - return; - } - // Representitive series. - var seriesModel = ecModel.getSeriesByName(name)[0]; - if (legendDrawnMap.get(name)) { - // Have been drawn - return; - } - // Legend to control series. - if (seriesModel) { - var data = seriesModel.getData(); - var lineVisualStyle = data.getVisual('legendLineStyle') || {}; - var legendIcon = data.getVisual('legendIcon'); - /** - * `data.getVisual('style')` may be the color from the register - * in series. For example, for line series, - */ - var style = data.getVisual('style'); - var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api); - itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId)); - if (ecModel.ssr) { - itemGroup.eachChild(function (child) { - var ecData = getECData(child); - ecData.seriesIndex = seriesModel.seriesIndex; - ecData.dataIndex = dataIndex; - ecData.ssrType = 'legend'; - }); - } - legendDrawnMap.set(name, true); - } else { - // Legend to control data. In pie and funnel. - ecModel.eachRawSeries(function (seriesModel) { - // In case multiple series has same data name - if (legendDrawnMap.get(name)) { - return; - } - if (seriesModel.legendVisualProvider) { - var provider = seriesModel.legendVisualProvider; - if (!provider.containName(name)) { - return; - } - var idx = provider.indexOfName(name); - var style = provider.getItemVisual(idx, 'style'); - var legendIcon = provider.getItemVisual(idx, 'legendIcon'); - var colorArr = parse(style.fill); - // Color may be set to transparent in visualMap when data is out of range. - // Do not show nothing. - if (colorArr && colorArr[3] === 0) { - colorArr[3] = 0.2; - // TODO color is set to 0, 0, 0, 0. Should show correct RGBA - style = extend(extend({}, style), { - fill: stringify(colorArr, 'rgba') - }); - } - var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode, api); - // FIXME: consider different series has items with the same name. - itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId)) - // Should not specify the series name, consider legend controls - // more than one pie series. - .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId)); - if (ecModel.ssr) { - itemGroup.eachChild(function (child) { - var ecData = getECData(child); - ecData.seriesIndex = seriesModel.seriesIndex; - ecData.dataIndex = dataIndex; - ecData.ssrType = 'legend'; - }); - } - legendDrawnMap.set(name, true); - } - }, this); - } - if ("development" !== 'production') { - if (!legendDrawnMap.get(name)) { - console.warn(name + ' series not exists. Legend data should be same with series name or data name.'); - } - } - }, this); - if (selector) { - this._createSelector(selector, legendModel, api, orient, selectorPosition); + } else { + if (isNaN(data.get(dataDims[1], idx))) { + continue; } - }; - LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) { - var selectorGroup = this.getSelectorGroup(); - each$c(selector, function createSelectorButton(selectorItem) { - var type = selectorItem.type; - var labelText = new ZRText({ - style: { - x: 0, - y: 0, - align: 'center', - verticalAlign: 'middle' - }, - onclick: function () { - api.dispatchAction({ - type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect' - }); - } - }); - selectorGroup.add(labelText); - var labelModel = legendModel.getModel('selectorLabel'); - var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']); - setLabelStyle(labelText, { - normal: labelModel, - emphasis: emphasisLabelModel - }, { - defaultText: selectorItem.title - }); - enableHoverEmphasis(labelText); + rect = new Rect_default({ + z2: 1, + shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape, + style + }); + } + if (data.hasItemOption) { + const itemModel = data.getItemModel(idx); + const emphasisModel2 = itemModel.getModel("emphasis"); + emphasisStyle = emphasisModel2.getModel("itemStyle").getItemStyle(); + blurStyle = itemModel.getModel(["blur", "itemStyle"]).getItemStyle(); + selectStyle = itemModel.getModel(["select", "itemStyle"]).getItemStyle(); + borderRadius = itemModel.get(["itemStyle", "borderRadius"]); + focus = emphasisModel2.get("focus"); + blurScope = emphasisModel2.get("blurScope"); + emphasisDisabled = emphasisModel2.get("disabled"); + labelStatesModels = getLabelStatesModels(itemModel); + } + rect.shape.r = borderRadius; + const rawValue = seriesModel.getRawValue(idx); + let defaultText = "-"; + if (rawValue && rawValue[2] != null) { + defaultText = rawValue[2] + ""; + } + setLabelStyle(rect, labelStatesModels, { + labelFetcher: seriesModel, + labelDataIndex: idx, + defaultOpacity: style.opacity, + defaultText + }); + rect.ensureState("emphasis").style = emphasisStyle; + rect.ensureState("blur").style = blurStyle; + rect.ensureState("select").style = selectStyle; + toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled); + rect.incremental = incremental; + if (incremental) { + rect.states.emphasis.hoverLayer = true; + } + group.add(rect); + data.setItemGraphicEl(idx, rect); + if (this._progressiveEls) { + this._progressiveEls.push(rect); + } + } + } + _renderOnGeo(geo, seriesModel, visualMapModel, api2) { + const inRangeVisuals = visualMapModel.targetVisuals.inRange; + const outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; + const data = seriesModel.getData(); + const hmLayer = this._hmLayer || (this._hmLayer || new HeatmapLayer_default()); + hmLayer.blurSize = seriesModel.get("blurSize"); + hmLayer.pointSize = seriesModel.get("pointSize"); + hmLayer.minOpacity = seriesModel.get("minOpacity"); + hmLayer.maxOpacity = seriesModel.get("maxOpacity"); + const rect = geo.getViewRect().clone(); + const roamTransform = geo.getRoamTransform(); + rect.applyTransform(roamTransform); + const x = Math.max(rect.x, 0); + const y = Math.max(rect.y, 0); + const x2 = Math.min(rect.width + rect.x, api2.getWidth()); + const y2 = Math.min(rect.height + rect.y, api2.getHeight()); + const width = x2 - x; + const height = y2 - y; + const dims = [ + data.mapDimension("lng"), + data.mapDimension("lat"), + data.mapDimension("value") + ]; + const points4 = data.mapArray(dims, function(lng, lat, value) { + const pt = geo.dataToPoint([lng, lat]); + pt[0] -= x; + pt[1] -= y; + pt.push(value); + return pt; + }); + const dataExtent = visualMapModel.getExtent(); + const isInRange = visualMapModel.type === "visualMap.continuous" ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected); + hmLayer.update(points4, width, height, inRangeVisuals.color.getNormalizer(), { + inRange: inRangeVisuals.color.getColorMapper(), + outOfRange: outOfRangeVisuals.color.getColorMapper() + }, isInRange); + const img = new Image_default({ + style: { + width, + height, + x, + y, + image: hmLayer.canvas + }, + silent: true + }); + this.group.add(img); + } +}; +var HeatmapView = HeatmapView2; +HeatmapView.type = "heatmap"; +var HeatmapView_default = HeatmapView; + +// src/chart/heatmap/HeatmapSeries.ts +var HeatmapSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = HeatmapSeriesModel2.type; + } + getInitialData(option, ecModel) { + return createSeriesData_default(null, this, { + generateCoord: "value" + }); + } + preventIncremental() { + const coordSysCreator = CoordinateSystem_default.get(this.get("coordinateSystem")); + if (coordSysCreator && coordSysCreator.dimensions) { + return coordSysCreator.dimensions[0] === "lng" && coordSysCreator.dimensions[1] === "lat"; + } + } +}; +var HeatmapSeriesModel = HeatmapSeriesModel2; +HeatmapSeriesModel.type = "series.heatmap"; +HeatmapSeriesModel.dependencies = ["grid", "geo", "calendar"]; +HeatmapSeriesModel.defaultOption = { + coordinateSystem: "cartesian2d", + z: 2, + geoIndex: 0, + blurSize: 30, + pointSize: 20, + maxOpacity: 1, + minOpacity: 0, + select: { + itemStyle: { + borderColor: "#212121" + } + } +}; +var HeatmapSeries_default = HeatmapSeriesModel; + +// src/chart/heatmap/install.ts +function install24(registers) { + registers.registerChartView(HeatmapView_default); + registers.registerSeriesModel(HeatmapSeries_default); +} + +// src/chart/bar/PictorialBarView.ts +var BAR_BORDER_WIDTH_QUERY = ["itemStyle", "borderWidth"]; +var LAYOUT_ATTRS = [ + {xy: "x", wh: "width", index: 0, posDesc: ["left", "right"]}, + {xy: "y", wh: "height", index: 1, posDesc: ["top", "bottom"]} +]; +var pathForLineWidth = new Circle_default(); +var PictorialBarView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = PictorialBarView2.type; + } + render(seriesModel, ecModel, api2) { + const group = this.group; + const data = seriesModel.getData(); + const oldData = this._data; + const cartesian = seriesModel.coordinateSystem; + const baseAxis = cartesian.getBaseAxis(); + const isHorizontal = baseAxis.isHorizontal(); + const coordSysRect = cartesian.master.getRect(); + const opt = { + ecSize: {width: api2.getWidth(), height: api2.getHeight()}, + seriesModel, + coordSys: cartesian, + coordSysExtent: [ + [coordSysRect.x, coordSysRect.x + coordSysRect.width], + [coordSysRect.y, coordSysRect.y + coordSysRect.height] + ], + isHorizontal, + valueDim: LAYOUT_ATTRS[+isHorizontal], + categoryDim: LAYOUT_ATTRS[1 - +isHorizontal] + }; + data.diff(oldData).add(function(dataIndex) { + if (!data.hasValue(dataIndex)) { + return; + } + const itemModel = getItemModel(data, dataIndex); + const symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt); + const bar = createBar(data, opt, symbolMeta); + data.setItemGraphicEl(dataIndex, bar); + group.add(bar); + updateCommon2(bar, opt, symbolMeta); + }).update(function(newIndex, oldIndex) { + let bar = oldData.getItemGraphicEl(oldIndex); + if (!data.hasValue(newIndex)) { + group.remove(bar); + return; + } + const itemModel = getItemModel(data, newIndex); + const symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt); + const 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; + group.add(bar); + updateCommon2(bar, opt, symbolMeta); + }).remove(function(dataIndex) { + const bar = oldData.getItemGraphicEl(dataIndex); + bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); + }).execute(); + const clipPath = seriesModel.get("clip", true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null; + if (clipPath) { + group.setClipPath(clipPath); + } else { + group.removeClipPath(); + } + this._data = data; + return this.group; + } + remove(ecModel, api2) { + const group = this.group; + const data = this._data; + if (ecModel.get("animation")) { + if (data) { + data.eachItemGraphicEl(function(bar) { + removeBar(data, getECData(bar).dataIndex, ecModel, bar); + }); + } + } else { + group.removeAll(); + } + } +}; +var PictorialBarView = PictorialBarView2; +PictorialBarView.type = "pictorialBar"; +function getSymbolMeta(data, dataIndex, itemModel, opt) { + const layout18 = data.getItemLayout(dataIndex); + const symbolRepeat = itemModel.get("symbolRepeat"); + const symbolClip = itemModel.get("symbolClip"); + const symbolPosition = itemModel.get("symbolPosition") || "start"; + const symbolRotate = itemModel.get("symbolRotate"); + const rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + const symbolPatternSize = itemModel.get("symbolPatternSize") || 2; + const isAnimationEnabled2 = itemModel.isAnimationEnabled(); + const symbolMeta = { + dataIndex, + layout: layout18, + itemModel, + symbolType: data.getItemVisual(dataIndex, "symbol") || "circle", + style: data.getItemVisual(dataIndex, "style"), + symbolClip, + symbolRepeat, + symbolRepeatDirection: itemModel.get("symbolRepeatDirection"), + symbolPatternSize, + rotation, + animationModel: isAnimationEnabled2 ? itemModel : null, + hoverScale: isAnimationEnabled2 && itemModel.get(["emphasis", "scale"]), + z2: itemModel.getShallow("z", true) || 0 + }; + prepareBarLength(itemModel, symbolRepeat, layout18, opt, symbolMeta); + prepareSymbolSize(data, dataIndex, layout18, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta); + prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta); + const symbolSize = symbolMeta.symbolSize; + const symbolOffset = normalizeSymbolOffset(itemModel.get("symbolOffset"), symbolSize); + prepareLayoutInfo(itemModel, symbolSize, layout18, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta); + return symbolMeta; +} +function prepareBarLength(itemModel, symbolRepeat, layout18, opt, outputSymbolMeta) { + const valueDim = opt.valueDim; + const symbolBoundingData = itemModel.get("symbolBoundingData"); + const valueAxis2 = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis()); + const zeroPx = valueAxis2.toGlobalCoord(valueAxis2.dataToCoord(0)); + const pxSignIdx = 1 - +(layout18[valueDim.wh] <= 0); + let boundingLength; + if (isArray(symbolBoundingData)) { + const symbolBoundingExtent = [ + convertToCoordOnAxis(valueAxis2, symbolBoundingData[0]) - zeroPx, + convertToCoordOnAxis(valueAxis2, symbolBoundingData[1]) - zeroPx + ]; + symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse(); + boundingLength = symbolBoundingExtent[pxSignIdx]; + } else if (symbolBoundingData != null) { + boundingLength = convertToCoordOnAxis(valueAxis2, symbolBoundingData) - zeroPx; + } else if (symbolRepeat) { + boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx; + } else { + boundingLength = layout18[valueDim.wh]; + } + outputSymbolMeta.boundingLength = boundingLength; + if (symbolRepeat) { + outputSymbolMeta.repeatCutLength = layout18[valueDim.wh]; + } + outputSymbolMeta.pxSign = boundingLength >= 0 ? 1 : -1; +} +function convertToCoordOnAxis(axis, value) { + return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value))); +} +function prepareSymbolSize(data, dataIndex, layout18, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) { + const valueDim = opt.valueDim; + const categoryDim = opt.categoryDim; + const categorySize = Math.abs(layout18[categoryDim.wh]); + const symbolSize = data.getItemVisual(dataIndex, "symbolSize"); + let parsedSymbolSize; + if (isArray(symbolSize)) { + parsedSymbolSize = symbolSize.slice(); + } else { + if (symbolSize == null) { + parsedSymbolSize = ["100%", "100%"]; + } else { + parsedSymbolSize = [symbolSize, symbolSize]; + } + } + parsedSymbolSize[categoryDim.index] = parsePercent2(parsedSymbolSize[categoryDim.index], categorySize); + parsedSymbolSize[valueDim.index] = parsePercent2(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength)); + outputSymbolMeta.symbolSize = parsedSymbolSize; + const symbolScale = outputSymbolMeta.symbolScale = [ + parsedSymbolSize[0] / symbolPatternSize, + parsedSymbolSize[1] / symbolPatternSize + ]; + symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign; +} +function prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) { + let valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; + if (valueLineWidth) { + pathForLineWidth.attr({ + scaleX: symbolScale[0], + scaleY: symbolScale[1], + rotation + }); + pathForLineWidth.updateTransform(); + valueLineWidth /= pathForLineWidth.getLineScale(); + valueLineWidth *= symbolScale[opt.valueDim.index]; + } + outputSymbolMeta.valueLineWidth = valueLineWidth || 0; +} +function prepareLayoutInfo(itemModel, symbolSize, layout18, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) { + const categoryDim = opt.categoryDim; + const valueDim = opt.valueDim; + const pxSign = outputSymbolMeta.pxSign; + const unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0); + let pathLen = unitLength; + if (symbolRepeat) { + const absBoundingLength = Math.abs(boundingLength); + let symbolMargin = retrieve(itemModel.get("symbolMargin"), "15%") + ""; + let hasEndGap = false; + if (symbolMargin.lastIndexOf("!") === symbolMargin.length - 1) { + hasEndGap = true; + symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1); + } + let symbolMarginNumeric = parsePercent2(symbolMargin, symbolSize[valueDim.index]); + let uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0); + let endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; + const repeatSpecified = isNumeric(symbolRepeat); + let repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); + const mDiff = absBoundingLength - repeatTimes * unitLength; + symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1)); + uLenWithMargin = unitLength + symbolMarginNumeric * 2; + endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; + if (!repeatSpecified && symbolRepeat !== "fixed") { + repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0; + } + pathLen = repeatTimes * uLenWithMargin - endFix; + outputSymbolMeta.repeatTimes = repeatTimes; + outputSymbolMeta.symbolMargin = symbolMarginNumeric; + } + const sizeFix = pxSign * (pathLen / 2); + const pathPosition = outputSymbolMeta.pathPosition = []; + pathPosition[categoryDim.index] = layout18[categoryDim.wh] / 2; + pathPosition[valueDim.index] = symbolPosition === "start" ? sizeFix : symbolPosition === "end" ? boundingLength - sizeFix : boundingLength / 2; + if (symbolOffset) { + pathPosition[0] += symbolOffset[0]; + pathPosition[1] += symbolOffset[1]; + } + const bundlePosition = outputSymbolMeta.bundlePosition = []; + bundlePosition[categoryDim.index] = layout18[categoryDim.xy]; + bundlePosition[valueDim.index] = layout18[valueDim.xy]; + const barRectShape = outputSymbolMeta.barRectShape = extend({}, layout18); + barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout18[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix)); + barRectShape[categoryDim.wh] = layout18[categoryDim.wh]; + const clipShape = outputSymbolMeta.clipShape = {}; + clipShape[categoryDim.xy] = -layout18[categoryDim.xy]; + clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh]; + clipShape[valueDim.xy] = 0; + clipShape[valueDim.wh] = layout18[valueDim.wh]; +} +function createPath(symbolMeta) { + const symbolPatternSize = symbolMeta.symbolPatternSize; + const path = createSymbol(symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize); + path.attr({ + culling: true + }); + path.type !== "image" && path.setStyle({ + strokeNoScale: true + }); + return path; +} +function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) { + const bundle = bar.__pictorialBundle; + const symbolSize = symbolMeta.symbolSize; + const valueLineWidth = symbolMeta.valueLineWidth; + const pathPosition = symbolMeta.pathPosition; + const valueDim = opt.valueDim; + const repeatTimes = symbolMeta.repeatTimes || 0; + let index = 0; + const 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, {scaleX: 0, scaleY: 0}, symbolMeta, isUpdate, function() { + bundle.remove(path); + }); + } + index++; + }); + for (; index < repeatTimes; index++) { + const path = createPath(symbolMeta); + path.__pictorialAnimationIndex = index; + path.__pictorialRepeatTimes = repeatTimes; + bundle.add(path); + const target = makeTarget(index); + updateAttr(path, { + x: target.x, + y: target.y, + scaleX: 0, + scaleY: 0 + }, { + scaleX: target.scaleX, + scaleY: target.scaleY, + rotation: target.rotation + }, symbolMeta, isUpdate); + } + function makeTarget(index2) { + const position2 = pathPosition.slice(); + const pxSign = symbolMeta.pxSign; + let i = index2; + if (symbolMeta.symbolRepeatDirection === "start" ? pxSign > 0 : pxSign < 0) { + i = repeatTimes - 1 - index2; + } + position2[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index]; + return { + x: position2[0], + y: position2[1], + scaleX: symbolMeta.symbolScale[0], + scaleY: symbolMeta.symbolScale[1], + rotation: symbolMeta.rotation + }; + } +} +function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) { + const bundle = bar.__pictorialBundle; + let mainPath = bar.__pictorialMainPath; + if (!mainPath) { + mainPath = bar.__pictorialMainPath = createPath(symbolMeta); + bundle.add(mainPath); + updateAttr(mainPath, { + x: symbolMeta.pathPosition[0], + y: symbolMeta.pathPosition[1], + scaleX: 0, + scaleY: 0, + rotation: symbolMeta.rotation + }, { + scaleX: symbolMeta.symbolScale[0], + scaleY: symbolMeta.symbolScale[1] + }, symbolMeta, isUpdate); + } else { + updateAttr(mainPath, null, { + x: symbolMeta.pathPosition[0], + y: symbolMeta.pathPosition[1], + scaleX: symbolMeta.symbolScale[0], + scaleY: symbolMeta.symbolScale[1], + rotation: symbolMeta.rotation + }, symbolMeta, isUpdate); + } +} +function createOrUpdateBarRect(bar, symbolMeta, isUpdate) { + const rectShape = extend({}, symbolMeta.barRectShape); + let barRect = bar.__pictorialBarRect; + if (!barRect) { + barRect = bar.__pictorialBarRect = new Rect_default({ + z2: 2, + shape: rectShape, + silent: true, + style: { + stroke: "transparent", + fill: "transparent", + lineWidth: 0 + } + }); + barRect.disableMorphing = true; + bar.add(barRect); + } else { + updateAttr(barRect, null, {shape: rectShape}, symbolMeta, isUpdate); + } +} +function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) { + if (symbolMeta.symbolClip) { + let clipPath = bar.__pictorialClipPath; + const clipShape = extend({}, symbolMeta.clipShape); + const valueDim = opt.valueDim; + const animationModel = symbolMeta.animationModel; + const dataIndex = symbolMeta.dataIndex; + if (clipPath) { + updateProps(clipPath, {shape: clipShape}, animationModel, dataIndex); + } else { + clipShape[valueDim.wh] = 0; + clipPath = new Rect_default({shape: clipShape}); + bar.__pictorialBundle.setClipPath(clipPath); + bar.__pictorialClipPath = clipPath; + const target = {}; + target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh]; + graphic_exports[isUpdate ? "updateProps" : "initProps"](clipPath, {shape: target}, animationModel, dataIndex); + } + } +} +function getItemModel(data, dataIndex) { + const itemModel = data.getItemModel(dataIndex); + itemModel.getAnimationDelayParams = getAnimationDelayParams; + itemModel.isAnimationEnabled = isAnimationEnabled; + return itemModel; +} +function getAnimationDelayParams(path) { + return { + index: path.__pictorialAnimationIndex, + count: path.__pictorialRepeatTimes + }; +} +function isAnimationEnabled() { + return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation"); +} +function createBar(data, opt, symbolMeta, isUpdate) { + const bar = new Group_default(); + const bundle = new Group_default(); + bar.add(bundle); + bar.__pictorialBundle = bundle; + bundle.x = symbolMeta.bundlePosition[0]; + bundle.y = symbolMeta.bundlePosition[1]; + 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) { + const animationModel = symbolMeta.animationModel; + const dataIndex = symbolMeta.dataIndex; + const bundle = bar.__pictorialBundle; + updateProps(bundle, { + x: symbolMeta.bundlePosition[0], + y: symbolMeta.bundlePosition[1] + }, 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) { + const labelRect = bar.__pictorialBarRect; + labelRect && labelRect.removeTextContent(); + const paths = []; + eachPath(bar, function(path) { + paths.push(path); + }); + bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath); + bar.__pictorialClipPath && (animationModel = null); + each(paths, function(path) { + removeElement(path, {scaleX: 0, scaleY: 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) { + 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); + if (symbolMeta.symbolClip && !isUpdate) { + animationAttrs && el.attr(animationAttrs); + } else { + animationAttrs && graphic_exports[isUpdate ? "updateProps" : "initProps"](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb); + } +} +function updateCommon2(bar, opt, symbolMeta) { + const dataIndex = symbolMeta.dataIndex; + const itemModel = symbolMeta.itemModel; + const emphasisModel = itemModel.getModel("emphasis"); + const emphasisStyle = emphasisModel.getModel("itemStyle").getItemStyle(); + const blurStyle = itemModel.getModel(["blur", "itemStyle"]).getItemStyle(); + const selectStyle = itemModel.getModel(["select", "itemStyle"]).getItemStyle(); + const cursorStyle = itemModel.getShallow("cursor"); + const focus = emphasisModel.get("focus"); + const blurScope = emphasisModel.get("blurScope"); + const hoverScale = emphasisModel.get("scale"); + eachPath(bar, function(path) { + if (path instanceof Image_default) { + const pathStyle = path.style; + path.useStyle(extend({ + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, symbolMeta.style)); + } else { + path.useStyle(symbolMeta.style); + } + const emphasisState = path.ensureState("emphasis"); + emphasisState.style = emphasisStyle; + if (hoverScale) { + emphasisState.scaleX = path.scaleX * 1.1; + emphasisState.scaleY = path.scaleY * 1.1; + } + path.ensureState("blur").style = blurStyle; + path.ensureState("select").style = selectStyle; + cursorStyle && (path.cursor = cursorStyle); + path.z2 = symbolMeta.z2; + }); + const barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)]; + const barRect = bar.__pictorialBarRect; + barRect.ignoreClip = true; + setLabelStyle(barRect, getLabelStatesModels(itemModel), { + labelFetcher: opt.seriesModel, + labelDataIndex: dataIndex, + defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex), + inheritColor: symbolMeta.style.fill, + defaultOpacity: symbolMeta.style.opacity, + defaultOutsidePosition: barPositionOutside + }); + toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get("disabled")); +} +function toIntTimes(times) { + const roundedTimes = Math.round(times); + return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times); +} +var PictorialBarView_default = PictorialBarView; + +// src/chart/bar/PictorialBarSeries.ts +var PictorialBarSeriesModel2 = class extends BaseBarSeries_default { + constructor() { + super(...arguments); + this.type = PictorialBarSeriesModel2.type; + this.hasSymbolVisual = true; + this.defaultSymbol = "roundRect"; + } + getInitialData(option) { + option.stack = null; + return super.getInitialData.apply(this, arguments); + } +}; +var PictorialBarSeriesModel = PictorialBarSeriesModel2; +PictorialBarSeriesModel.type = "series.pictorialBar"; +PictorialBarSeriesModel.dependencies = ["grid"]; +PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeries_default.defaultOption, { + symbol: "circle", + symbolSize: null, + symbolRotate: null, + symbolPosition: null, + symbolOffset: null, + symbolMargin: null, + symbolRepeat: false, + symbolRepeatDirection: "end", + symbolClip: false, + symbolBoundingData: null, + symbolPatternSize: 400, + barGap: "-100%", + clip: false, + progressive: 0, + emphasis: { + scale: false + }, + select: { + itemStyle: { + borderColor: "#212121" + } + } +}); +var PictorialBarSeries_default = PictorialBarSeriesModel; + +// src/chart/bar/installPictorialBar.ts +function install25(registers) { + registers.registerChartView(PictorialBarView_default); + registers.registerSeriesModel(PictorialBarSeries_default); + registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout2, "pictorialBar")); + registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout("pictorialBar")); +} + +// src/chart/themeRiver/ThemeRiverView.ts +var ThemeRiverView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = ThemeRiverView2.type; + this._layers = []; + } + render(seriesModel, ecModel, api2) { + const data = seriesModel.getData(); + const self2 = this; + const group = this.group; + const layersSeries = seriesModel.getLayerSeries(); + const layoutInfo = data.getLayout("layoutInfo"); + const rect = layoutInfo.rect; + const boundaryGap = layoutInfo.boundaryGap; + group.x = 0; + group.y = rect.y + boundaryGap[0]; + function keyGetter(item) { + return item.name; + } + const dataDiffer = new DataDiffer_default(this._layersSeries || [], layersSeries, keyGetter, keyGetter); + const newLayersGroups = []; + dataDiffer.add(bind(process2, this, "add")).update(bind(process2, this, "update")).remove(bind(process2, this, "remove")).execute(); + function process2(status, idx, oldIdx) { + const oldLayersGroups = self2._layers; + if (status === "remove") { + group.remove(oldLayersGroups[idx]); + return; + } + const points0 = []; + const points1 = []; + let style; + const indices = layersSeries[idx].indices; + let j = 0; + for (; j < indices.length; j++) { + const layout18 = data.getItemLayout(indices[j]); + const x = layout18.x; + const y0 = layout18.y0; + const y = layout18.y; + points0.push(x, y0); + points1.push(x, y0 + y); + style = data.getItemVisual(indices[j], "style"); + } + let polygon; + const textLayout = data.getItemLayout(indices[0]); + const labelModel = seriesModel.getModel("label"); + const margin = labelModel.get("margin"); + const emphasisModel = seriesModel.getModel("emphasis"); + if (status === "add") { + const layerGroup = newLayersGroups[idx] = new Group_default(); + polygon = new ECPolygon({ + shape: { + points: points0, + stackedOnPoints: points1, + smooth: 0.4, + stackedOnSmooth: 0.4, + smoothConstraint: false + }, + z2: 0 }); - }; - LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api) { - var drawType = seriesModel.visualDrawType; - var itemWidth = legendModel.get('itemWidth'); - var itemHeight = legendModel.get('itemHeight'); - var isSelected = legendModel.isSelected(name); - var iconRotate = legendItemModel.get('symbolRotate'); - var symbolKeepAspect = legendItemModel.get('symbolKeepAspect'); - var legendIconType = legendItemModel.get('icon'); - legendIcon = legendIconType || legendIcon || 'roundRect'; - var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api); - var itemGroup = new Group$2(); - var textStyleModel = legendItemModel.getModel('textStyle'); - if (isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) { - // Series has specific way to define legend icon - itemGroup.add(seriesModel.getLegendIcon({ - itemWidth: itemWidth, - itemHeight: itemHeight, - icon: legendIcon, - iconRotate: iconRotate, - itemStyle: style.itemStyle, - lineStyle: style.lineStyle, - symbolKeepAspect: symbolKeepAspect - })); - } else { - // Use default legend icon policy for most series - var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon - itemGroup.add(getDefaultLegendIcon({ - itemWidth: itemWidth, - itemHeight: itemHeight, - icon: legendIcon, - iconRotate: rotate, - itemStyle: style.itemStyle, - lineStyle: style.lineStyle, - symbolKeepAspect: symbolKeepAspect + layerGroup.add(polygon); + group.add(layerGroup); + if (seriesModel.isAnimationEnabled()) { + polygon.setClipPath(createGridClipShape3(polygon.getBoundingRect(), seriesModel, function() { + polygon.removeClipPath(); })); } - var textX = itemAlign === 'left' ? itemWidth + 5 : -5; - var textAlign = itemAlign; - var formatter = legendModel.get('formatter'); - var content = name; - if (isString(formatter) && formatter) { - content = formatter.replace('{name}', name != null ? name : ''); - } else if (isFunction(formatter)) { - content = formatter(name); - } - var textColor = isSelected ? textStyleModel.getTextColor() : legendItemModel.get('inactiveColor'); - itemGroup.add(new ZRText({ - style: createTextStyle(textStyleModel, { - text: content, - x: textX, - y: itemHeight / 2, - fill: textColor, - align: textAlign, - verticalAlign: 'middle' - }, { - inheritColor: textColor - }) - })); - // Add a invisible rect to increase the area of mouse hover - var hitRect = new Rect({ - shape: itemGroup.getBoundingRect(), - style: { - // Cannot use 'invisible' because SVG SSR will miss the node - fill: 'transparent' + } else { + const layerGroup = oldLayersGroups[oldIdx]; + polygon = layerGroup.childAt(0); + group.add(layerGroup); + newLayersGroups[idx] = layerGroup; + updateProps(polygon, { + shape: { + points: points0, + stackedOnPoints: points1 } - }); - var tooltipModel = legendItemModel.getModel('tooltip'); - if (tooltipModel.get('show')) { - setTooltipConfig({ - el: hitRect, - componentModel: legendModel, - itemName: name, - itemTooltipOption: tooltipModel.option - }); + }, seriesModel); + saveOldStyle(polygon); + } + setLabelStyle(polygon, getLabelStatesModels(seriesModel), { + labelDataIndex: indices[j - 1], + defaultText: data.getName(indices[j - 1]), + inheritColor: style.fill + }, { + normal: { + verticalAlign: "middle" } - itemGroup.add(hitRect); - itemGroup.eachChild(function (child) { - child.silent = true; - }); - hitRect.silent = !selectMode; - this.getContentGroup().add(itemGroup); - enableHoverEmphasis(itemGroup); - // @ts-ignore - itemGroup.__legendDataIndex = dataIndex; - return itemGroup; - }; - LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { - var contentGroup = this.getContentGroup(); - var selectorGroup = this.getSelectorGroup(); - // Place items in contentGroup. - box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height); - var contentRect = contentGroup.getBoundingRect(); - var contentPos = [-contentRect.x, -contentRect.y]; - selectorGroup.markRedraw(); - contentGroup.markRedraw(); - if (selector) { - // Place buttons in selectorGroup - box( - // Buttons in selectorGroup always layout horizontally - 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true)); - var selectorRect = selectorGroup.getBoundingRect(); - var selectorPos = [-selectorRect.x, -selectorRect.y]; - var selectorButtonGap = legendModel.get('selectorButtonGap', true); - var orientIdx = legendModel.getOrient().index; - var wh = orientIdx === 0 ? 'width' : 'height'; - var hw = orientIdx === 0 ? 'height' : 'width'; - var yx = orientIdx === 0 ? 'y' : 'x'; - if (selectorPosition === 'end') { - selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap; - } else { - contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap; - } - // Always align selector to content as 'middle' - selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2; - selectorGroup.x = selectorPos[0]; - selectorGroup.y = selectorPos[1]; - contentGroup.x = contentPos[0]; - contentGroup.y = contentPos[1]; - var mainRect = { - x: 0, - y: 0 - }; - mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh]; - mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]); - mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]); - return mainRect; - } else { - contentGroup.x = contentPos[0]; - contentGroup.y = contentPos[1]; - return this.group.getBoundingRect(); + }); + polygon.setTextConfig({ + position: null, + local: true + }); + const labelEl = polygon.getTextContent(); + if (labelEl) { + labelEl.x = textLayout.x - margin; + labelEl.y = textLayout.y0 + textLayout.y / 2; + } + polygon.useStyle(style); + data.setItemGraphicEl(idx, polygon); + setStatesStylesFromModel(polygon, seriesModel); + toggleHoverEmphasis(polygon, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + } + this._layersSeries = layersSeries; + this._layers = newLayersGroups; + } +}; +var ThemeRiverView = ThemeRiverView2; +ThemeRiverView.type = "themeRiver"; +function createGridClipShape3(rect, seriesModel, cb) { + const rectEl = new Rect_default({ + shape: { + x: rect.x - 10, + y: rect.y - 10, + width: 0, + height: rect.height + 20 + } + }); + initProps(rectEl, { + shape: { + x: rect.x - 50, + width: rect.width + 100, + height: rect.height + 20 + } + }, seriesModel, cb); + return rectEl; +} +var ThemeRiverView_default = ThemeRiverView; + +// src/chart/themeRiver/ThemeRiverSeries.ts +var DATA_NAME_INDEX = 2; +var ThemeRiverSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = ThemeRiverSeriesModel2.type; + } + init(option) { + super.init.apply(this, arguments); + this.legendVisualProvider = new LegendVisualProvider_default(bind(this.getData, this), bind(this.getRawData, this)); + } + fixData(data) { + let rawDataLength = data.length; + const timeValueKeys = {}; + const groupResult = groupData(data, (item) => { + if (!timeValueKeys.hasOwnProperty(item[0] + "")) { + timeValueKeys[item[0] + ""] = -1; + } + return item[2]; + }); + const layerData = []; + groupResult.buckets.each(function(items, key) { + layerData.push({ + name: key, + dataList: items + }); + }); + const layerNum = layerData.length; + for (let k = 0; k < layerNum; ++k) { + const name = layerData[k].name; + for (let j = 0; j < layerData[k].dataList.length; ++j) { + const timeValue = layerData[k].dataList[j][0] + ""; + timeValueKeys[timeValue] = k; + } + for (const timeValue in timeValueKeys) { + if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) { + timeValueKeys[timeValue] = k; + data[rawDataLength] = [timeValue, 0, name]; + rawDataLength++; + } + } + } + return data; + } + getInitialData(option, ecModel) { + const singleAxisModel = this.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0]; + const axisType = singleAxisModel.get("type"); + const filterData = filter(option.data, function(dataItem) { + return dataItem[2] !== void 0; + }); + const data = this.fixData(filterData || []); + const nameList = []; + const nameMap = this.nameMap = createHashMap(); + let count2 = 0; + for (let i = 0; i < data.length; ++i) { + nameList.push(data[i][DATA_NAME_INDEX]); + if (!nameMap.get(data[i][DATA_NAME_INDEX])) { + nameMap.set(data[i][DATA_NAME_INDEX], count2); + count2++; + } + } + const {dimensions} = prepareSeriesDataSchema(data, { + coordDimensions: ["single"], + dimensionsDefine: [ + { + name: "time", + type: getDimensionTypeByAxis(axisType) + }, + { + name: "value", + type: "float" + }, + { + name: "name", + type: "ordinal" } - }; - /** - * @protected - */ - LegendView.prototype.remove = function () { - this.getContentGroup().removeAll(); - this._isFirstRender = true; - }; - LegendView.type = 'legend.plain'; - return LegendView; - }(ComponentView); - function getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api) { - /** - * Use series style if is inherit; - * elsewise, use legend style - */ - function handleCommonProps(style, visualStyle) { - // If lineStyle.width is 'auto', it is set to be 2 if series has border - if (style.lineWidth === 'auto') { - style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0; - } - each$c(style, function (propVal, propName) { - style[propName] === 'inherit' && (style[propName] = visualStyle[propName]); - }); + ], + encodeDefine: { + single: 0, + value: 1, + itemName: 2 } - // itemStyle - var itemStyleModel = legendItemModel.getModel('itemStyle'); - var itemStyle = itemStyleModel.getItemStyle(); - var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke'; - var decalStyle = itemStyleModel.getShallow('decal'); - itemStyle.decal = !decalStyle || decalStyle === 'inherit' ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api); - if (itemStyle.fill === 'inherit') { - /** - * Series with visualDrawType as 'stroke' should have - * series stroke as legend fill - */ - itemStyle.fill = itemVisualStyle[drawType]; - } - if (itemStyle.stroke === 'inherit') { - /** - * icon type with "emptyXXX" should use fill color - * in visual style - */ - itemStyle.stroke = itemVisualStyle[iconBrushType]; - } - if (itemStyle.opacity === 'inherit') { - /** - * Use lineStyle.opacity if drawType is stroke - */ - itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity; - } - handleCommonProps(itemStyle, itemVisualStyle); - // lineStyle - var legendLineModel = legendItemModel.getModel('lineStyle'); - var lineStyle = legendLineModel.getLineStyle(); - handleCommonProps(lineStyle, lineVisualStyle); - // Fix auto color to real color - itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill); - itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill); - lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill); - if (!isSelected) { - var borderWidth = legendItemModel.get('inactiveBorderWidth'); - /** - * Since stroke is set to be inactiveBorderColor, it may occur that - * there is no border in series but border in legend, so we need to - * use border only when series has border if is set to be auto - */ - var visualHasBorder = itemStyle[iconBrushType]; - itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth; - itemStyle.fill = legendItemModel.get('inactiveColor'); - itemStyle.stroke = legendItemModel.get('inactiveBorderColor'); - lineStyle.stroke = legendLineModel.get('inactiveColor'); - lineStyle.lineWidth = legendLineModel.get('inactiveWidth'); - } - return { - itemStyle: itemStyle, - lineStyle: lineStyle - }; - } - function getDefaultLegendIcon(opt) { - var symboType = opt.icon || 'roundRect'; - var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect); - icon.setStyle(opt.itemStyle); - icon.rotation = (opt.iconRotate || 0) * Math.PI / 180; - icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); - if (symboType.indexOf('empty') > -1) { - icon.style.stroke = icon.style.fill; - icon.style.fill = '#fff'; - icon.style.lineWidth = 2; - } - return icon; - } - function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) { - // downplay before unselect - dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId); - api.dispatchAction({ - type: 'legendToggleSelect', - name: seriesName != null ? seriesName : dataName + }); + const list = new SeriesData_default(dimensions, this); + list.initData(data); + return list; + } + getLayerSeries() { + const data = this.getData(); + const lenCount = data.count(); + const indexArr = []; + for (let i = 0; i < lenCount; ++i) { + indexArr[i] = i; + } + const timeDim = data.mapDimension("single"); + const groupResult = groupData(indexArr, function(index) { + return data.get("name", index); + }); + const layerSeries = []; + groupResult.buckets.each(function(items, key) { + items.sort(function(index1, index2) { + return data.get(timeDim, index1) - data.get(timeDim, index2); + }); + layerSeries.push({ + name: key, + indices: items + }); + }); + return layerSeries; + } + getAxisTooltipData(dim, value, baseAxis) { + if (!isArray(dim)) { + dim = dim ? [dim] : []; + } + const data = this.getData(); + const layerSeries = this.getLayerSeries(); + const indices = []; + const layerNum = layerSeries.length; + let nestestValue; + for (let i = 0; i < layerNum; ++i) { + let minDist = Number.MAX_VALUE; + let nearestIdx = -1; + const pointNum = layerSeries[i].indices.length; + for (let j = 0; j < pointNum; ++j) { + const theValue = data.get(dim[0], layerSeries[i].indices[j]); + const dist3 = Math.abs(theValue - value); + if (dist3 <= minDist) { + nestestValue = theValue; + minDist = dist3; + nearestIdx = layerSeries[i].indices[j]; + } + } + indices.push(nearestIdx); + } + return {dataIndices: indices, nestestValue}; + } + formatTooltip(dataIndex, multipleSeries, dataType) { + const data = this.getData(); + const name = data.getName(dataIndex); + const value = data.get(data.mapDimension("value"), dataIndex); + return createTooltipMarkup("nameValue", {name, value}); + } +}; +var ThemeRiverSeriesModel = ThemeRiverSeriesModel2; +ThemeRiverSeriesModel.type = "series.themeRiver"; +ThemeRiverSeriesModel.dependencies = ["singleAxis"]; +ThemeRiverSeriesModel.defaultOption = { + z: 2, + colorBy: "data", + coordinateSystem: "singleAxis", + boundaryGap: ["10%", "10%"], + singleAxisIndex: 0, + animationEasing: "linear", + label: { + margin: 4, + show: true, + position: "left", + fontSize: 11 + }, + emphasis: { + label: { + show: true + } + } +}; +var ThemeRiverSeries_default = ThemeRiverSeriesModel; + +// src/chart/themeRiver/themeRiverLayout.ts +function themeRiverLayout(ecModel, api2) { + ecModel.eachSeriesByType("themeRiver", function(seriesModel) { + const data = seriesModel.getData(); + const single = seriesModel.coordinateSystem; + const layoutInfo = {}; + const rect = single.getRect(); + layoutInfo.rect = rect; + const boundaryGap = seriesModel.get("boundaryGap"); + const axis = single.getAxis(); + layoutInfo.boundaryGap = boundaryGap; + if (axis.orient === "horizontal") { + boundaryGap[0] = parsePercent2(boundaryGap[0], rect.height); + boundaryGap[1] = parsePercent2(boundaryGap[1], rect.height); + const height = rect.height - boundaryGap[0] - boundaryGap[1]; + doThemeRiverLayout(data, seriesModel, height); + } else { + boundaryGap[0] = parsePercent2(boundaryGap[0], rect.width); + boundaryGap[1] = parsePercent2(boundaryGap[1], rect.width); + const width = rect.width - boundaryGap[0] - boundaryGap[1]; + doThemeRiverLayout(data, seriesModel, width); + } + data.setLayout("layoutInfo", layoutInfo); + }); +} +function doThemeRiverLayout(data, seriesModel, height) { + if (!data.count()) { + return; + } + const coordSys = seriesModel.coordinateSystem; + const layerSeries = seriesModel.getLayerSeries(); + const timeDim = data.mapDimension("single"); + const valueDim = data.mapDimension("value"); + const layerPoints = map(layerSeries, function(singleLayer) { + return map(singleLayer.indices, function(idx) { + const pt = coordSys.dataToPoint(data.get(timeDim, idx)); + pt[1] = data.get(valueDim, idx); + return pt; + }); + }); + const base2 = computeBaseline(layerPoints); + const baseLine = base2.y0; + const ky = height / base2.max; + const n = layerSeries.length; + const m2 = layerSeries[0].indices.length; + let baseY0; + for (let j = 0; j < m2; ++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 (let 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 }); - // highlight after select - // TODO highlight immediately may cause animation loss. - dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId); - } - function isUseHoverLayer(api) { - var list = api.getZr().storage.getDisplayList(); - var emphasisState; - var i = 0; - var len = list.length; - while (i < len && !(emphasisState = list[i].states.emphasis)) { - i++; - } - return emphasisState && emphasisState.hoverLayer; } - function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) { - // If element hover will move to a hoverLayer. - if (!isUseHoverLayer(api)) { - api.dispatchAction({ - type: 'highlight', - seriesName: seriesName, - name: dataName, - excludeSeriesId: excludeSeriesId - }); + } +} +function computeBaseline(data) { + const layerNum = data.length; + const pointNum = data[0].length; + const sums = []; + const y0 = []; + let max3 = 0; + for (let i = 0; i < pointNum; ++i) { + let temp = 0; + for (let j = 0; j < layerNum; ++j) { + temp += data[j][i][1]; + } + if (temp > max3) { + max3 = temp; + } + sums.push(temp); + } + for (let k = 0; k < pointNum; ++k) { + y0[k] = (max3 - sums[k]) / 2; + } + max3 = 0; + for (let l = 0; l < pointNum; ++l) { + const sum2 = sums[l] + y0[l]; + if (sum2 > max3) { + max3 = sum2; + } + } + return { + y0, + max: max3 + }; +} + +// src/chart/themeRiver/install.ts +function install26(registers) { + registers.registerChartView(ThemeRiverView_default); + registers.registerSeriesModel(ThemeRiverSeries_default); + registers.registerLayout(themeRiverLayout); + registers.registerProcessor(dataFilter("themeRiver")); +} + +// src/chart/sunburst/SunburstPiece.ts +var DEFAULT_SECTOR_Z = 2; +var DEFAULT_TEXT_Z = 4; +var SunburstPiece = class extends Sector_default { + constructor(node, seriesModel, ecModel, api2) { + super(); + this.z2 = DEFAULT_SECTOR_Z; + this.textConfig = { + inside: true + }; + getECData(this).seriesIndex = seriesModel.seriesIndex; + const text = new Text_default({ + z2: DEFAULT_TEXT_Z, + silent: node.getModel().get(["label", "silent"]) + }); + this.setTextContent(text); + this.updateData(true, node, seriesModel, ecModel, api2); + } + updateData(firstCreate, node, seriesModel, ecModel, api2) { + this.node = node; + node.piece = this; + seriesModel = seriesModel || this._seriesModel; + ecModel = ecModel || this._ecModel; + const sector = this; + getECData(sector).dataIndex = node.dataIndex; + const itemModel = node.getModel(); + const emphasisModel = itemModel.getModel("emphasis"); + const layout18 = node.getLayout(); + const sectorShape = extend({}, layout18); + sectorShape.label = null; + const normalStyle = node.getVisual("style"); + normalStyle.lineJoin = "bevel"; + const decal = node.getVisual("decal"); + if (decal) { + normalStyle.decal = createOrUpdatePatternFromDecal(decal, api2); + } + const cornerRadius = getSectorCornerRadius(itemModel.getModel("itemStyle"), sectorShape, true); + extend(sectorShape, cornerRadius); + each(SPECIAL_STATES, function(stateName) { + const state = sector.ensureState(stateName); + const itemStyleModel = itemModel.getModel([stateName, "itemStyle"]); + state.style = itemStyleModel.getItemStyle(); + const cornerRadius2 = getSectorCornerRadius(itemStyleModel, sectorShape); + if (cornerRadius2) { + state.shape = cornerRadius2; } - } - function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) { - // If element hover will move to a hoverLayer. - if (!isUseHoverLayer(api)) { - api.dispatchAction({ - type: 'downplay', - seriesName: seriesName, - name: dataName, - excludeSeriesId: excludeSeriesId - }); + }); + if (firstCreate) { + sector.setShape(sectorShape); + sector.shape.r = layout18.r0; + initProps(sector, { + shape: { + r: layout18.r + } + }, seriesModel, node.dataIndex); + } else { + updateProps(sector, { + shape: sectorShape + }, seriesModel); + saveOldStyle(sector); + } + sector.useStyle(normalStyle); + this._updateLabel(seriesModel); + const cursorStyle = itemModel.getShallow("cursor"); + cursorStyle && sector.attr("cursor", cursorStyle); + this._seriesModel = seriesModel || this._seriesModel; + this._ecModel = ecModel || this._ecModel; + const focus = emphasisModel.get("focus"); + const focusOrIndices = focus === "relative" ? concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === "ancestor" ? node.getAncestorsIndices() : focus === "descendant" ? node.getDescendantIndices() : focus; + toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get("blurScope"), emphasisModel.get("disabled")); + } + _updateLabel(seriesModel) { + const itemModel = this.node.getModel(); + const normalLabelModel = itemModel.getModel("label"); + const layout18 = this.node.getLayout(); + const angle = layout18.endAngle - layout18.startAngle; + const midAngle = (layout18.startAngle + layout18.endAngle) / 2; + const dx = Math.cos(midAngle); + const dy = Math.sin(midAngle); + const sector = this; + const label = sector.getTextContent(); + const dataIndex = this.node.dataIndex; + const labelMinAngle = normalLabelModel.get("minAngle") / 180 * Math.PI; + const isNormalShown = normalLabelModel.get("show") && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle); + label.ignore = !isNormalShown; + each(DISPLAY_STATES, (stateName) => { + const labelStateModel = stateName === "normal" ? itemModel.getModel("label") : itemModel.getModel([stateName, "label"]); + const isNormal = stateName === "normal"; + const state = isNormal ? label : label.ensureState(stateName); + let text = seriesModel.getFormattedLabel(dataIndex, stateName); + if (isNormal) { + text = text || this.node.name; + } + state.style = createTextStyle(labelStateModel, {}, null, stateName !== "normal", true); + if (text) { + state.style.text = text; + } + const isShown = labelStateModel.get("show"); + if (isShown != null && !isNormal) { + state.ignore = !isShown; + } + const labelPosition = getLabelAttr(labelStateModel, "position"); + const sectorState = isNormal ? sector : sector.states[stateName]; + const labelColor = sectorState.style.fill; + sectorState.textConfig = { + outsideFill: labelStateModel.get("color") === "inherit" ? labelColor : null, + inside: labelPosition !== "outside" + }; + let r; + const labelPadding = getLabelAttr(labelStateModel, "distance") || 0; + let textAlign = getLabelAttr(labelStateModel, "align"); + const rotateType = getLabelAttr(labelStateModel, "rotate"); + const flipStartAngle = Math.PI * 0.5; + const flipEndAngle = Math.PI * 1.5; + const midAngleNormal = normalizeRadian(rotateType === "tangential" ? Math.PI / 2 - midAngle : midAngle); + const needsFlip = midAngleNormal > flipStartAngle && !isRadianAroundZero(midAngleNormal - flipStartAngle) && midAngleNormal < flipEndAngle; + if (labelPosition === "outside") { + r = layout18.r + labelPadding; + textAlign = needsFlip ? "right" : "left"; + } else { + if (!textAlign || textAlign === "center") { + if (angle === 2 * Math.PI && layout18.r0 === 0) { + r = 0; + } else { + r = (layout18.r + layout18.r0) / 2; + } + textAlign = "center"; + } else if (textAlign === "left") { + r = layout18.r0 + labelPadding; + textAlign = needsFlip ? "right" : "left"; + } else if (textAlign === "right") { + r = layout18.r - labelPadding; + textAlign = needsFlip ? "left" : "right"; + } + } + state.style.align = textAlign; + state.style.verticalAlign = getLabelAttr(labelStateModel, "verticalAlign") || "middle"; + state.x = r * dx + layout18.cx; + state.y = r * dy + layout18.cy; + let rotate2 = 0; + if (rotateType === "radial") { + rotate2 = normalizeRadian(-midAngle) + (needsFlip ? Math.PI : 0); + } else if (rotateType === "tangential") { + rotate2 = normalizeRadian(Math.PI / 2 - midAngle) + (needsFlip ? Math.PI : 0); + } else if (isNumber(rotateType)) { + rotate2 = rotateType * Math.PI / 180; + } + state.rotation = normalizeRadian(rotate2); + }); + function getLabelAttr(model, name) { + const stateAttr = model.get(name); + if (stateAttr == null) { + return normalLabelModel.get(name); + } + return stateAttr; + } + label.dirtyStyle(); + } +}; +var SunburstPiece_default = SunburstPiece; + +// src/chart/sunburst/sunburstAction.ts +var ROOT_TO_NODE_ACTION = "sunburstRootToNode"; +var HIGHLIGHT_ACTION = "sunburstHighlight"; +var UNHIGHLIGHT_ACTION = "sunburstUnhighlight"; +function installSunburstAction(registers) { + registers.registerAction({type: ROOT_TO_NODE_ACTION, update: "updateView"}, function(payload, ecModel) { + ecModel.eachComponent({mainType: "series", subType: "sunburst", query: payload}, handleRootToNode); + function handleRootToNode(model, index) { + const targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model); + if (targetInfo) { + const originViewRoot = model.getViewRoot(); + if (originViewRoot) { + payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? "rollUp" : "drillDown"; + } + model.resetViewRoot(targetInfo.node); + } + } + }); + registers.registerAction({type: HIGHLIGHT_ACTION, update: "none"}, function(payload, ecModel, api2) { + payload = extend({}, payload); + ecModel.eachComponent({mainType: "series", subType: "sunburst", query: payload}, handleHighlight); + function handleHighlight(model) { + const targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model); + if (targetInfo) { + payload.dataIndex = targetInfo.node.dataIndex; + } + } + if (true) { + deprecateReplaceLog("sunburstHighlight", "highlight"); + } + api2.dispatchAction(extend(payload, { + type: "highlight" + })); + }); + registers.registerAction({type: UNHIGHLIGHT_ACTION, update: "updateView"}, function(payload, ecModel, api2) { + payload = extend({}, payload); + if (true) { + deprecateReplaceLog("sunburstUnhighlight", "downplay"); + } + api2.dispatchAction(extend(payload, { + type: "downplay" + })); + }); +} + +// src/chart/sunburst/SunburstView.ts +var SunburstView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = SunburstView2.type; + } + render(seriesModel, ecModel, api2, payload) { + const self2 = this; + this.seriesModel = seriesModel; + this.api = api2; + this.ecModel = ecModel; + const data = seriesModel.getData(); + const virtualRoot = data.tree.root; + const newRoot = seriesModel.getViewRoot(); + const group = this.group; + const renderLabelForZeroData = seriesModel.get("renderLabelForZeroData"); + const newChildren = []; + newRoot.eachNode(function(node) { + newChildren.push(node); + }); + const oldChildren = this._oldChildren || []; + dualTravel(newChildren, oldChildren); + renderRollUp(virtualRoot, newRoot); + this._initEvents(); + this._oldChildren = newChildren; + function dualTravel(newChildren2, oldChildren2) { + if (newChildren2.length === 0 && oldChildren2.length === 0) { + return; + } + new DataDiffer_default(oldChildren2, newChildren2, getKey2, getKey2).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); + function getKey2(node) { + return node.getId(); + } + function processNode(newIdx, oldIdx) { + const newNode = newIdx == null ? null : newChildren2[newIdx]; + const oldNode = oldIdx == null ? null : oldChildren2[oldIdx]; + doRenderNode(newNode, oldNode); } } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 legendFilter(ecModel) { - var legendModels = ecModel.findComponents({ - mainType: 'legend' - }); - if (legendModels && legendModels.length) { - ecModel.filterSeries(function (series) { - // If in any legend component the status is not selected. - // Because in legend series is assumed selected when it is not in the legend data. - for (var i = 0; i < legendModels.length; i++) { - if (!legendModels[i].isSelected(series.name)) { - return false; - } + function doRenderNode(newNode, oldNode) { + if (!renderLabelForZeroData && newNode && !newNode.getValue()) { + newNode = null; + } + if (newNode !== virtualRoot && oldNode !== virtualRoot) { + if (oldNode && oldNode.piece) { + if (newNode) { + oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api2); + data.setItemGraphicEl(newNode.dataIndex, oldNode.piece); + } else { + removeNode2(oldNode); } - return true; - }); + } else if (newNode) { + const piece = new SunburstPiece_default(newNode, seriesModel, ecModel, api2); + group.add(piece); + data.setItemGraphicEl(newNode.dataIndex, piece); + } } } - - function legendSelectActionHandler(methodName, payload, ecModel) { - var selectedMap = {}; - var isToggleSelect = methodName === 'toggleSelected'; - var isSelected; - // Update all legend components - ecModel.eachComponent('legend', function (legendModel) { - if (isToggleSelect && isSelected != null) { - // Force other legend has same selected status - // Or the first is toggled to true and other are toggled to false - // In the case one legend has some item unSelected in option. And if other legend - // doesn't has the item, they will assume it is selected. - legendModel[isSelected ? 'select' : 'unSelect'](payload.name); - } else if (methodName === 'allSelect' || methodName === 'inverseSelect') { - legendModel[methodName](); + function removeNode2(node) { + if (!node) { + return; + } + if (node.piece) { + group.remove(node.piece); + node.piece = null; + } + } + function renderRollUp(virtualRoot2, viewRoot) { + if (viewRoot.depth > 0) { + if (self2.virtualPiece) { + self2.virtualPiece.updateData(false, virtualRoot2, seriesModel, ecModel, api2); } else { - legendModel[methodName](payload.name); - isSelected = legendModel.isSelected(payload.name); - } - var legendData = legendModel.getData(); - each(legendData, function (model) { - var name = model.get('name'); - // Wrap element - if (name === '\n' || name === '') { - return; - } - var isItemSelected = legendModel.isSelected(name); - if (selectedMap.hasOwnProperty(name)) { - // Unselected if any legend is unselected - selectedMap[name] = selectedMap[name] && isItemSelected; - } else { - selectedMap[name] = isItemSelected; - } - }); + self2.virtualPiece = new SunburstPiece_default(virtualRoot2, seriesModel, ecModel, api2); + group.add(self2.virtualPiece); + } + viewRoot.piece.off("click"); + self2.virtualPiece.on("click", function(e2) { + self2._rootToNode(viewRoot.parentNode); + }); + } else if (self2.virtualPiece) { + group.remove(self2.virtualPiece); + self2.virtualPiece = null; + } + } + } + _initEvents() { + this.group.off("click"); + this.group.on("click", (e2) => { + let targetFound = false; + const viewRoot = this.seriesModel.getViewRoot(); + viewRoot.eachNode((node) => { + if (!targetFound && node.piece && node.piece === e2.target) { + const nodeClick = node.getModel().get("nodeClick"); + if (nodeClick === "rootToNode") { + this._rootToNode(node); + } else if (nodeClick === "link") { + const itemModel = node.getModel(); + const link = itemModel.get("link"); + if (link) { + const linkTarget = itemModel.get("target", true) || "_blank"; + windowOpen(link, linkTarget); + } + } + targetFound = true; + } }); - // Return the event explicitly - return methodName === 'allSelect' || methodName === 'inverseSelect' ? { - selected: selectedMap - } : { - name: payload.name, - selected: selectedMap - }; - } - function installLegendAction(registers) { - /** - * @event legendToggleSelect - * @type {Object} - * @property {string} type 'legendToggleSelect' - * @property {string} [from] - * @property {string} name Series name or data item name - */ - registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected')); - registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect')); - registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect')); - /** - * @event legendSelect - * @type {Object} - * @property {string} type 'legendSelect' - * @property {string} name Series name or data item name - */ - registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select')); - /** - * @event legendUnSelect - * @type {Object} - * @property {string} type 'legendUnSelect' - * @property {string} name Series name or data item name - */ - registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect')); - } - - function install$H(registers) { - registers.registerComponentModel(LegendModel); - registers.registerComponentView(LegendView); - registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter); - registers.registerSubTypeDefaulter('legend', function () { - return 'plain'; + }); + } + _rootToNode(node) { + if (node !== this.seriesModel.getViewRoot()) { + this.api.dispatchAction({ + type: ROOT_TO_NODE_ACTION, + from: this.uid, + seriesId: this.seriesModel.id, + targetNode: node }); - installLegendAction(registers); } - - var ScrollableLegendModel = /** @class */function (_super) { - __extends(ScrollableLegendModel, _super); - function ScrollableLegendModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ScrollableLegendModel.type; - return _this; - } - /** - * @param {number} scrollDataIndex - */ - ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) { - this.option.scrollDataIndex = scrollDataIndex; - }; - ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) { - var inputPositionParams = getLayoutParams(option); - _super.prototype.init.call(this, option, parentModel, ecModel); - mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams); - }; - /** - * @override - */ - ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) { - _super.prototype.mergeOption.call(this, option, ecModel); - mergeAndNormalizeLayoutParams$1(this, this.option, option); - }; - ScrollableLegendModel.type = 'legend.scroll'; - ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, { - scrollDataIndex: 0, - pageButtonItemGap: 5, - pageButtonGap: null, - pageButtonPosition: 'end', - pageFormatter: '{current}/{total}', - pageIcons: { - horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'], - vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z'] - }, - pageIconColor: '#2f4554', - pageIconInactiveColor: '#aaa', - pageIconSize: 15, - pageTextStyle: { - color: '#333' - }, - animationDurationUpdate: 800 - }); - return ScrollableLegendModel; - }(LegendModel); - // Do not `ignoreSize` to enable setting {left: 10, right: 10}. - function mergeAndNormalizeLayoutParams$1(legendModel, target, raw) { - var orient = legendModel.getOrient(); - var ignoreSize = [1, 1]; - ignoreSize[orient.index] = 0; - mergeLayoutParam(target, raw, { - type: 'box', - ignoreSize: !!ignoreSize + } + containPoint(point, seriesModel) { + const treeRoot = seriesModel.getData(); + const itemLayout = treeRoot.getItemLayout(0); + if (itemLayout) { + const dx = point[0] - itemLayout.cx; + const dy = point[1] - itemLayout.cy; + const radius = Math.sqrt(dx * dx + dy * dy); + return radius <= itemLayout.r && radius >= itemLayout.r0; + } + } +}; +var SunburstView = SunburstView2; +SunburstView.type = "sunburst"; +var SunburstView_default = SunburstView; + +// src/chart/sunburst/SunburstSeries.ts +var SunburstSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = SunburstSeriesModel2.type; + this.ignoreStyleOnData = true; + } + getInitialData(option, ecModel) { + const root = {name: option.name, children: option.data}; + completeTreeValue2(root); + const levelModels = this._levelModels = map(option.levels || [], function(levelDefine) { + return new Model_default(levelDefine, this, ecModel); + }, this); + const tree = Tree_default.createTree(root, this, beforeLink); + function beforeLink(nodeData) { + nodeData.wrapMethod("getItemModel", function(model, idx) { + const node = tree.getNodeByDataIndex(idx); + const levelModel = levelModels[node.depth]; + levelModel && (model.parentModel = levelModel); + return model; }); } - - var Group$3 = Group; - var WH$1 = ['width', 'height']; - var XY$1 = ['x', 'y']; - var ScrollableLegendView = /** @class */function (_super) { - __extends(ScrollableLegendView, _super); - function ScrollableLegendView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ScrollableLegendView.type; - _this.newlineDisabled = true; - _this._currentIndex = 0; - return _this; - } - ScrollableLegendView.prototype.init = function () { - _super.prototype.init.call(this); - this.group.add(this._containerGroup = new Group$3()); - this._containerGroup.add(this.getContentGroup()); - this.group.add(this._controllerGroup = new Group$3()); - }; - /** - * @override - */ - ScrollableLegendView.prototype.resetInner = function () { - _super.prototype.resetInner.call(this); - this._controllerGroup.removeAll(); - this._containerGroup.removeClipPath(); - this._containerGroup.__rectSize = null; - }; - /** - * @override - */ - ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { - var self = this; - // Render content items. - _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); - var controllerGroup = this._controllerGroup; - // FIXME: support be 'auto' adapt to size number text length, - // e.g., '3/12345' should not overlap with the control arrow button. - var pageIconSize = legendModel.get('pageIconSize', true); - var pageIconSizeArr = isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize]; - createPageButton('pagePrev', 0); - var pageTextStyleModel = legendModel.getModel('pageTextStyle'); - controllerGroup.add(new ZRText({ - name: 'pageText', - style: { - // Placeholder to calculate a proper layout. - text: 'xx/xx', - fill: pageTextStyleModel.getTextColor(), - font: pageTextStyleModel.getFont(), - verticalAlign: 'middle', - align: 'center' - }, - silent: true - })); - createPageButton('pageNext', 1); - function createPageButton(name, iconIdx) { - var pageDataIndexName = name + 'DataIndex'; - var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], { - // Buttons will be created in each render, so we do not need - // to worry about avoiding using legendModel kept in scope. - onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api) - }, { - x: -pageIconSizeArr[0] / 2, - y: -pageIconSizeArr[1] / 2, - width: pageIconSizeArr[0], - height: pageIconSizeArr[1] - }); - icon.name = name; - controllerGroup.add(icon); - } - }; - /** - * @override - */ - ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { - var selectorGroup = this.getSelectorGroup(); - var orientIdx = legendModel.getOrient().index; - var wh = WH$1[orientIdx]; - var xy = XY$1[orientIdx]; - var hw = WH$1[1 - orientIdx]; - var yx = XY$1[1 - orientIdx]; - selector && box( - // Buttons in selectorGroup always layout horizontally - 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true)); - var selectorButtonGap = legendModel.get('selectorButtonGap', true); - var selectorRect = selectorGroup.getBoundingRect(); - var selectorPos = [-selectorRect.x, -selectorRect.y]; - var processMaxSize = clone(maxSize); - selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap); - var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy); - if (selector) { - if (selectorPosition === 'end') { - selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap; - } else { - var offset = selectorRect[wh] + selectorButtonGap; - selectorPos[orientIdx] -= offset; - mainRect[xy] -= offset; - } - mainRect[wh] += selectorRect[wh] + selectorButtonGap; - selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2; - mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]); - mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]); - selectorGroup.x = selectorPos[0]; - selectorGroup.y = selectorPos[1]; - selectorGroup.markRedraw(); - } - return mainRect; - }; - ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) { - var contentGroup = this.getContentGroup(); - var containerGroup = this._containerGroup; - var controllerGroup = this._controllerGroup; - // Place items in contentGroup. - box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height); - box( - // Buttons in controller are layout always horizontally. - 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true)); - var contentRect = contentGroup.getBoundingRect(); - var controllerRect = controllerGroup.getBoundingRect(); - var showController = this._showController = contentRect[wh] > maxSize[wh]; - // In case that the inner elements of contentGroup layout do not based on [0, 0] - var contentPos = [-contentRect.x, -contentRect.y]; - // Remain contentPos when scroll animation perfroming. - // If first rendering, `contentGroup.position` is [0, 0], which - // does not make sense and may cause unexepcted animation if adopted. - if (!isFirstRender) { - contentPos[orientIdx] = contentGroup[xy]; - } - // Layout container group based on 0. - var containerPos = [0, 0]; - var controllerPos = [-controllerRect.x, -controllerRect.y]; - var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true)); - // Place containerGroup and controllerGroup and contentGroup. - if (showController) { - var pageButtonPosition = legendModel.get('pageButtonPosition', true); - // controller is on the right / bottom. - if (pageButtonPosition === 'end') { - controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; - } - // controller is on the left / top. - else { - containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; - } - } - // Always align controller to content as 'middle'. - controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; - contentGroup.setPosition(contentPos); - containerGroup.setPosition(containerPos); - controllerGroup.setPosition(controllerPos); - // Calculate `mainRect` and set `clipPath`. - // mainRect should not be calculated by `this.group.getBoundingRect()` - // for sake of the overflow. - var mainRect = { - x: 0, - y: 0 - }; - // Consider content may be overflow (should be clipped). - mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; - mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); - // `containerRect[yx] + containerPos[1 - orientIdx]` is 0. - mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); - containerGroup.__rectSize = maxSize[wh]; - if (showController) { - var clipShape = { - x: 0, - y: 0 - }; - clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); - clipShape[hw] = mainRect[hw]; - containerGroup.setClipPath(new Rect({ - shape: clipShape - })); - // Consider content may be larger than container, container rect - // can not be obtained from `containerGroup.getBoundingRect()`. - containerGroup.__rectSize = clipShape[wh]; - } else { - // Do not remove or ignore controller. Keep them set as placeholders. - controllerGroup.eachChild(function (child) { - child.attr({ - invisible: true, - silent: true - }); - }); + return tree.data; + } + optionUpdated() { + this.resetViewRoot(); + } + getDataParams(dataIndex) { + const params = super.getDataParams.apply(this, arguments); + const node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treePathInfo = wrapTreePathInfo(node, this); + return params; + } + getLevelModel(node) { + return this._levelModels && this._levelModels[node.depth]; + } + getViewRoot() { + return this._viewRoot; + } + resetViewRoot(viewRoot) { + viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot; + const root = this.getRawData().tree.root; + if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) { + this._viewRoot = root; + } + } + enableAriaDecal() { + enableAriaDecalForTree(this); + } +}; +var SunburstSeriesModel = SunburstSeriesModel2; +SunburstSeriesModel.type = "series.sunburst"; +SunburstSeriesModel.defaultOption = { + z: 2, + center: ["50%", "50%"], + radius: [0, "75%"], + clockwise: true, + startAngle: 90, + minAngle: 0, + stillShowZeroSum: true, + nodeClick: "rootToNode", + renderLabelForZeroData: false, + label: { + rotate: "radial", + show: true, + opacity: 1, + 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 + }, + emphasis: { + focus: "descendant" + }, + blur: { + itemStyle: { + opacity: 0.2 + }, + label: { + opacity: 0.1 + } + }, + animationType: "expansion", + animationDuration: 1e3, + animationDurationUpdate: 500, + data: [], + sort: "desc" +}; +function completeTreeValue2(dataNode) { + let sum2 = 0; + each(dataNode.children, function(child) { + completeTreeValue2(child); + let childValue = child.value; + isArray(childValue) && (childValue = childValue[0]); + sum2 += childValue; + }); + let thisValue = dataNode.value; + if (isArray(thisValue)) { + thisValue = thisValue[0]; + } + if (thisValue == null || isNaN(thisValue)) { + thisValue = sum2; + } + if (thisValue < 0) { + thisValue = 0; + } + isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; +} +var SunburstSeries_default = SunburstSeriesModel; + +// src/chart/sunburst/sunburstLayout.ts +var RADIAN3 = Math.PI / 180; +function sunburstLayout(seriesType2, ecModel, api2) { + ecModel.eachSeriesByType(seriesType2, function(seriesModel) { + let center3 = seriesModel.get("center"); + let radius = seriesModel.get("radius"); + if (!isArray(radius)) { + radius = [0, radius]; + } + if (!isArray(center3)) { + center3 = [center3, center3]; + } + const width = api2.getWidth(); + const height = api2.getHeight(); + const size = Math.min(width, height); + const cx = parsePercent2(center3[0], width); + const cy = parsePercent2(center3[1], height); + const r0 = parsePercent2(radius[0], size / 2); + const r = parsePercent2(radius[1], size / 2); + const startAngle = -seriesModel.get("startAngle") * RADIAN3; + const minAngle = seriesModel.get("minAngle") * RADIAN3; + const virtualRoot = seriesModel.getData().tree.root; + const treeRoot = seriesModel.getViewRoot(); + const rootDepth = treeRoot.depth; + const sort4 = seriesModel.get("sort"); + if (sort4 != null) { + initChildren2(treeRoot, sort4); + } + let validDataCount = 0; + each(treeRoot.children, function(child) { + !isNaN(child.getValue()) && validDataCount++; + }); + const sum2 = treeRoot.getValue(); + const unitRadian = Math.PI / (sum2 || validDataCount) * 2; + const renderRollupNode = treeRoot.depth > 0; + const levels = treeRoot.height - (renderRollupNode ? -1 : 1); + const rPerLevel = (r - r0) / (levels || 1); + const clockwise = seriesModel.get("clockwise"); + const stillShowZeroSum = seriesModel.get("stillShowZeroSum"); + const dir3 = clockwise ? 1 : -1; + const renderNode2 = function(node, startAngle2) { + if (!node) { + return; + } + let endAngle = startAngle2; + if (node !== virtualRoot) { + const value = node.getValue(); + let angle = sum2 === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; + if (angle < minAngle) { + angle = minAngle; + } + endAngle = startAngle2 + dir3 * angle; + const depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1); + let rStart = r0 + rPerLevel * depth; + let rEnd = r0 + rPerLevel * (depth + 1); + const levelModel = seriesModel.getLevelModel(node); + if (levelModel) { + let r02 = levelModel.get("r0", true); + let r2 = levelModel.get("r", true); + const radius2 = levelModel.get("radius", true); + if (radius2 != null) { + r02 = radius2[0]; + r2 = radius2[1]; + } + r02 != null && (rStart = parsePercent2(r02, size / 2)); + r2 != null && (rEnd = parsePercent2(r2, size / 2)); } - // Content translate animation. - var pageInfo = this._getPageInfo(legendModel); - pageInfo.pageIndex != null && updateProps(contentGroup, { - x: pageInfo.contentPosition[0], - y: pageInfo.contentPosition[1] - }, - // When switch from "show controller" to "not show controller", view should be - // updated immediately without animation, otherwise causes weird effect. - showController ? legendModel : null); - this._updatePageInfoView(legendModel, pageInfo); - return mainRect; - }; - ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) { - var scrollDataIndex = this._getPageInfo(legendModel)[to]; - scrollDataIndex != null && api.dispatchAction({ - type: 'legendScroll', - scrollDataIndex: scrollDataIndex, - legendId: legendModel.id + node.setLayout({ + angle, + startAngle: startAngle2, + endAngle, + clockwise, + cx, + cy, + r0: rStart, + r: rEnd }); - }; - ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) { - var controllerGroup = this._controllerGroup; - each(['pagePrev', 'pageNext'], function (name) { - var key = name + 'DataIndex'; - var canJump = pageInfo[key] != null; - var icon = controllerGroup.childOfName(name); - if (icon) { - icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true)); - icon.cursor = canJump ? 'pointer' : 'default'; - } + } + if (node.children && node.children.length) { + let siblingAngle = 0; + each(node.children, function(node2) { + siblingAngle += renderNode2(node2, startAngle2 + siblingAngle); }); - var pageText = controllerGroup.childOfName('pageText'); - var pageFormatter = legendModel.get('pageFormatter'); - var pageIndex = pageInfo.pageIndex; - var current = pageIndex != null ? pageIndex + 1 : 0; - var total = pageInfo.pageCount; - pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({ - current: current, - total: total - })); + } + return endAngle - startAngle2; + }; + if (renderRollupNode) { + const rStart = r0; + const rEnd = r0 + rPerLevel; + const angle = Math.PI * 2; + virtualRoot.setLayout({ + angle, + startAngle, + endAngle: startAngle + angle, + clockwise, + cx, + cy, + r0: rStart, + r: rEnd + }); + } + renderNode2(treeRoot, startAngle); + }); +} +function initChildren2(node, sortOrder) { + const children = node.children || []; + node.children = sort3(children, sortOrder); + if (children.length) { + each(node.children, function(child) { + initChildren2(child, sortOrder); + }); + } +} +function sort3(children, sortOrder) { + if (isFunction(sortOrder)) { + const sortTargets = map(children, (child, idx) => { + const value = child.getValue(); + return { + params: { + depth: child.depth, + height: child.height, + dataIndex: child.dataIndex, + getValue: () => value + }, + index: idx }; - /** - * contentPosition: Array., null when data item not found. - * pageIndex: number, null when data item not found. - * pageCount: number, always be a number, can be 0. - * pagePrevDataIndex: number, null when no previous page. - * pageNextDataIndex: number, null when no next page. - * } - */ - ScrollableLegendView.prototype._getPageInfo = function (legendModel) { - var scrollDataIndex = legendModel.get('scrollDataIndex', true); - var contentGroup = this.getContentGroup(); - var containerRectSize = this._containerGroup.__rectSize; - var orientIdx = legendModel.getOrient().index; - var wh = WH$1[orientIdx]; - var xy = XY$1[orientIdx]; - var targetItemIndex = this._findTargetItemIndex(scrollDataIndex); - var children = contentGroup.children(); - var targetItem = children[targetItemIndex]; - var itemCount = children.length; - var pCount = !itemCount ? 0 : 1; - var result = { - contentPosition: [contentGroup.x, contentGroup.y], - pageCount: pCount, - pageIndex: pCount - 1, - pagePrevDataIndex: null, - pageNextDataIndex: null - }; - if (!targetItem) { - return result; - } - var targetItemInfo = getItemInfo(targetItem); - result.contentPosition[orientIdx] = -targetItemInfo.s; - // Strategy: - // (1) Always align based on the left/top most item. - // (2) It is user-friendly that the last item shown in the - // current window is shown at the begining of next window. - // Otherwise if half of the last item is cut by the window, - // it will have no chance to display entirely. - // (3) Consider that item size probably be different, we - // have calculate pageIndex by size rather than item index, - // and we can not get page index directly by division. - // (4) The window is to narrow to contain more than - // one item, we should make sure that the page can be fliped. - for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) { - currItemInfo = getItemInfo(children[i]); - if ( - // Half of the last item is out of the window. - !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize - // If the current item does not intersect with the window, the new page - // can be started at the current item or the last item. - || currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) { - if (winEndItemInfo.i > winStartItemInfo.i) { - winStartItemInfo = winEndItemInfo; - } else { - // e.g., when page size is smaller than item size. - winStartItemInfo = currItemInfo; - } - if (winStartItemInfo) { - if (result.pageNextDataIndex == null) { - result.pageNextDataIndex = winStartItemInfo.i; - } - ++result.pageCount; - } - } - winEndItemInfo = currItemInfo; - } - for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) { - currItemInfo = getItemInfo(children[i]); - if ( - // If the the end item does not intersect with the window started - // from the current item, a page can be settled. - (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s) - // e.g., when page size is smaller than item size. - ) && winStartItemInfo.i < winEndItemInfo.i) { - winEndItemInfo = winStartItemInfo; - if (result.pagePrevDataIndex == null) { - result.pagePrevDataIndex = winStartItemInfo.i; - } - ++result.pageCount; - ++result.pageIndex; + }); + sortTargets.sort((a, b) => { + return sortOrder(a.params, b.params); + }); + return map(sortTargets, (target) => { + return children[target.index]; + }); + } else { + const isAsc = sortOrder === "asc"; + return children.sort(function(a, b) { + const diff = (a.getValue() - b.getValue()) * (isAsc ? 1 : -1); + return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc ? -1 : 1) : diff; + }); + } +} + +// src/chart/sunburst/sunburstVisual.ts +function sunburstVisual(ecModel) { + const paletteScope = {}; + function pickColor(node, seriesModel, treeHeight) { + let current = node; + while (current && current.depth > 1) { + current = current.parentNode; + } + let color2 = seriesModel.getColorFromPalette(current.name || current.dataIndex + "", paletteScope); + if (node.depth > 1 && isString(color2)) { + color2 = lift(color2, (node.depth - 1) / (treeHeight - 1) * 0.5); + } + return color2; + } + ecModel.eachSeriesByType("sunburst", function(seriesModel) { + const data = seriesModel.getData(); + const tree = data.tree; + tree.eachNode(function(node) { + const model = node.getModel(); + const style = model.getModel("itemStyle").getItemStyle(); + if (!style.fill) { + style.fill = pickColor(node, seriesModel, tree.root.height); + } + const existsStyle = data.ensureUniqueItemVisual(node.dataIndex, "style"); + extend(existsStyle, style); + }); + }); +} + +// src/chart/sunburst/install.ts +function install27(registers) { + registers.registerChartView(SunburstView_default); + registers.registerSeriesModel(SunburstSeries_default); + registers.registerLayout(curry(sunburstLayout, "sunburst")); + registers.registerProcessor(curry(dataFilter, "sunburst")); + registers.registerVisual(sunburstVisual); + installSunburstAction(registers); +} + +// src/chart/custom/CustomSeries.ts +var STYLE_VISUAL_TYPE = { + color: "fill", + borderColor: "stroke" +}; +var NON_STYLE_VISUAL_PROPS = { + symbol: 1, + symbolSize: 1, + symbolKeepAspect: 1, + legendIcon: 1, + visualMeta: 1, + liftZ: 1, + decal: 1 +}; +var customInnerStore = makeInner(); +var CustomSeriesModel2 = class extends Series_default { + constructor() { + super(...arguments); + this.type = CustomSeriesModel2.type; + } + optionUpdated() { + this.currentZLevel = this.get("zlevel", true); + this.currentZ = this.get("z", true); + } + getInitialData(option, ecModel) { + return createSeriesData_default(null, this); + } + getDataParams(dataIndex, dataType, el) { + const params = super.getDataParams(dataIndex, dataType); + el && (params.info = customInnerStore(el).info); + return params; + } +}; +var CustomSeriesModel = CustomSeriesModel2; +CustomSeriesModel.type = "series.custom"; +CustomSeriesModel.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"]; +CustomSeriesModel.defaultOption = { + coordinateSystem: "cartesian2d", + z: 2, + legendHoverLink: true, + clip: false +}; +var CustomSeries_default = CustomSeriesModel; + +// src/coord/cartesian/prepareCustom.ts +function dataToCoordSize(dataSize, dataItem) { + dataItem = dataItem || [0, 0]; + return map(["x", "y"], function(dim, dimIdx) { + const axis = this.getAxis(dim); + const val = dataItem[dimIdx]; + const halfSize = dataSize[dimIdx] / 2; + return axis.type === "category" ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); + }, this); +} +function cartesianPrepareCustom(coordSys) { + const rect = coordSys.master.getRect(); + return { + coordSys: { + type: "cartesian2d", + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + api: { + coord: function(data) { + return coordSys.dataToPoint(data); + }, + size: bind(dataToCoordSize, coordSys) + } + }; +} + +// src/coord/geo/prepareCustom.ts +function dataToCoordSize2(dataSize, dataItem) { + dataItem = dataItem || [0, 0]; + return map([0, 1], function(dimIdx) { + const val = dataItem[dimIdx]; + const halfSize = dataSize[dimIdx] / 2; + const p1 = []; + const p2 = []; + p1[dimIdx] = val - halfSize; + p2[dimIdx] = val + halfSize; + p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; + return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); + }, this); +} +function geoPrepareCustom(coordSys) { + const rect = coordSys.getBoundingRect(); + return { + coordSys: { + type: "geo", + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + zoom: coordSys.getZoom() + }, + api: { + coord: function(data) { + return coordSys.dataToPoint(data); + }, + size: bind(dataToCoordSize2, coordSys) + } + }; +} + +// src/coord/single/prepareCustom.ts +function dataToCoordSize3(dataSize, dataItem) { + const axis = this.getAxis(); + const val = dataItem instanceof Array ? dataItem[0] : dataItem; + const halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2; + return axis.type === "category" ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); +} +function singlePrepareCustom(coordSys) { + const rect = coordSys.getRect(); + return { + coordSys: { + type: "singleAxis", + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + api: { + coord: function(val) { + return coordSys.dataToPoint(val); + }, + size: bind(dataToCoordSize3, coordSys) + } + }; +} + +// src/coord/polar/prepareCustom.ts +function dataToCoordSize4(dataSize, dataItem) { + dataItem = dataItem || [0, 0]; + return map(["Radius", "Angle"], function(dim, dimIdx) { + const getterName = "get" + dim + "Axis"; + const axis = this[getterName](); + const val = dataItem[dimIdx]; + const halfSize = dataSize[dimIdx] / 2; + let result = axis.type === "category" ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); + if (dim === "Angle") { + result = result * Math.PI / 180; + } + return result; + }, this); +} +function polarPrepareCustom(coordSys) { + const radiusAxis = coordSys.getRadiusAxis(); + const angleAxis = coordSys.getAngleAxis(); + const radius = radiusAxis.getExtent(); + radius[0] > radius[1] && radius.reverse(); + return { + coordSys: { + type: "polar", + cx: coordSys.cx, + cy: coordSys.cy, + r: radius[1], + r0: radius[0] + }, + api: { + coord: function(data) { + const radius2 = radiusAxis.dataToRadius(data[0]); + const angle = angleAxis.dataToAngle(data[1]); + const coord = coordSys.coordToPoint([radius2, angle]); + coord.push(radius2, angle * Math.PI / 180); + return coord; + }, + size: bind(dataToCoordSize4, coordSys) + } + }; +} + +// src/coord/calendar/prepareCustom.ts +function calendarPrepareCustom(coordSys) { + const rect = coordSys.getRect(); + const rangeInfo = coordSys.getRangeInfo(); + return { + coordSys: { + type: "calendar", + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + cellWidth: coordSys.getCellWidth(), + cellHeight: coordSys.getCellHeight(), + rangeInfo: { + start: rangeInfo.start, + end: rangeInfo.end, + weeks: rangeInfo.weeks, + dayCount: rangeInfo.allDay + } + }, + api: { + coord: function(data, clamp2) { + return coordSys.dataToPoint(data, clamp2); + } + } + }; +} + +// src/util/styleCompat.ts +var deprecatedLogs = {}; +function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) { + return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== "tspan" && (elType === "text" || hasOwn(style, "text"))); +} +function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) { + const srcStyle = hostStyle; + let textConfig; + let textContent; + let textContentStyle; + if (elType === "text") { + textContentStyle = srcStyle; + } else { + textContentStyle = {}; + hasOwn(srcStyle, "text") && (textContentStyle.text = srcStyle.text); + hasOwn(srcStyle, "rich") && (textContentStyle.rich = srcStyle.rich); + hasOwn(srcStyle, "textFill") && (textContentStyle.fill = srcStyle.textFill); + hasOwn(srcStyle, "textStroke") && (textContentStyle.stroke = srcStyle.textStroke); + hasOwn(srcStyle, "fontFamily") && (textContentStyle.fontFamily = srcStyle.fontFamily); + hasOwn(srcStyle, "fontSize") && (textContentStyle.fontSize = srcStyle.fontSize); + hasOwn(srcStyle, "fontStyle") && (textContentStyle.fontStyle = srcStyle.fontStyle); + hasOwn(srcStyle, "fontWeight") && (textContentStyle.fontWeight = srcStyle.fontWeight); + textContent = { + type: "text", + style: textContentStyle, + silent: true + }; + textConfig = {}; + const hasOwnPos = hasOwn(srcStyle, "textPosition"); + if (isNormal) { + textConfig.position = hasOwnPos ? srcStyle.textPosition : "inside"; + } else { + hasOwnPos && (textConfig.position = srcStyle.textPosition); + } + hasOwn(srcStyle, "textPosition") && (textConfig.position = srcStyle.textPosition); + hasOwn(srcStyle, "textOffset") && (textConfig.offset = srcStyle.textOffset); + hasOwn(srcStyle, "textRotation") && (textConfig.rotation = srcStyle.textRotation); + hasOwn(srcStyle, "textDistance") && (textConfig.distance = srcStyle.textDistance); + } + convertEC4CompatibleRichItem(textContentStyle, hostStyle); + each(textContentStyle.rich, function(richItem) { + convertEC4CompatibleRichItem(richItem, richItem); + }); + return { + textConfig, + textContent + }; +} +function convertEC4CompatibleRichItem(out2, richItem) { + if (!richItem) { + return; + } + richItem.font = richItem.textFont || richItem.font; + hasOwn(richItem, "textStrokeWidth") && (out2.lineWidth = richItem.textStrokeWidth); + hasOwn(richItem, "textAlign") && (out2.align = richItem.textAlign); + hasOwn(richItem, "textVerticalAlign") && (out2.verticalAlign = richItem.textVerticalAlign); + hasOwn(richItem, "textLineHeight") && (out2.lineHeight = richItem.textLineHeight); + hasOwn(richItem, "textWidth") && (out2.width = richItem.textWidth); + hasOwn(richItem, "textHeight") && (out2.height = richItem.textHeight); + hasOwn(richItem, "textBackgroundColor") && (out2.backgroundColor = richItem.textBackgroundColor); + hasOwn(richItem, "textPadding") && (out2.padding = richItem.textPadding); + hasOwn(richItem, "textBorderColor") && (out2.borderColor = richItem.textBorderColor); + hasOwn(richItem, "textBorderWidth") && (out2.borderWidth = richItem.textBorderWidth); + hasOwn(richItem, "textBorderRadius") && (out2.borderRadius = richItem.textBorderRadius); + hasOwn(richItem, "textBoxShadowColor") && (out2.shadowColor = richItem.textBoxShadowColor); + hasOwn(richItem, "textBoxShadowBlur") && (out2.shadowBlur = richItem.textBoxShadowBlur); + hasOwn(richItem, "textBoxShadowOffsetX") && (out2.shadowOffsetX = richItem.textBoxShadowOffsetX); + hasOwn(richItem, "textBoxShadowOffsetY") && (out2.shadowOffsetY = richItem.textBoxShadowOffsetY); +} +function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) { + const out2 = itemStl; + out2.textPosition = out2.textPosition || txCfg.position || "inside"; + txCfg.offset != null && (out2.textOffset = txCfg.offset); + txCfg.rotation != null && (out2.textRotation = txCfg.rotation); + txCfg.distance != null && (out2.textDistance = txCfg.distance); + const isInside = out2.textPosition.indexOf("inside") >= 0; + const hostFill = itemStl.fill || "#000"; + convertToEC4RichItem(out2, txStl); + const textFillNotSet = out2.textFill == null; + if (isInside) { + if (textFillNotSet) { + out2.textFill = txCfg.insideFill || "#fff"; + !out2.textStroke && txCfg.insideStroke && (out2.textStroke = txCfg.insideStroke); + !out2.textStroke && (out2.textStroke = hostFill); + out2.textStrokeWidth == null && (out2.textStrokeWidth = 2); + } + } else { + if (textFillNotSet) { + out2.textFill = itemStl.fill || txCfg.outsideFill || "#000"; + } + !out2.textStroke && txCfg.outsideStroke && (out2.textStroke = txCfg.outsideStroke); + } + out2.text = txStl.text; + out2.rich = txStl.rich; + each(txStl.rich, function(richItem) { + convertToEC4RichItem(richItem, richItem); + }); + return out2; +} +function convertToEC4RichItem(out2, richItem) { + if (!richItem) { + return; + } + hasOwn(richItem, "fill") && (out2.textFill = richItem.fill); + hasOwn(richItem, "stroke") && (out2.textStroke = richItem.fill); + hasOwn(richItem, "lineWidth") && (out2.textStrokeWidth = richItem.lineWidth); + hasOwn(richItem, "font") && (out2.font = richItem.font); + hasOwn(richItem, "fontStyle") && (out2.fontStyle = richItem.fontStyle); + hasOwn(richItem, "fontWeight") && (out2.fontWeight = richItem.fontWeight); + hasOwn(richItem, "fontSize") && (out2.fontSize = richItem.fontSize); + hasOwn(richItem, "fontFamily") && (out2.fontFamily = richItem.fontFamily); + hasOwn(richItem, "align") && (out2.textAlign = richItem.align); + hasOwn(richItem, "verticalAlign") && (out2.textVerticalAlign = richItem.verticalAlign); + hasOwn(richItem, "lineHeight") && (out2.textLineHeight = richItem.lineHeight); + hasOwn(richItem, "width") && (out2.textWidth = richItem.width); + hasOwn(richItem, "height") && (out2.textHeight = richItem.height); + hasOwn(richItem, "backgroundColor") && (out2.textBackgroundColor = richItem.backgroundColor); + hasOwn(richItem, "padding") && (out2.textPadding = richItem.padding); + hasOwn(richItem, "borderColor") && (out2.textBorderColor = richItem.borderColor); + hasOwn(richItem, "borderWidth") && (out2.textBorderWidth = richItem.borderWidth); + hasOwn(richItem, "borderRadius") && (out2.textBorderRadius = richItem.borderRadius); + hasOwn(richItem, "shadowColor") && (out2.textBoxShadowColor = richItem.shadowColor); + hasOwn(richItem, "shadowBlur") && (out2.textBoxShadowBlur = richItem.shadowBlur); + hasOwn(richItem, "shadowOffsetX") && (out2.textBoxShadowOffsetX = richItem.shadowOffsetX); + hasOwn(richItem, "shadowOffsetY") && (out2.textBoxShadowOffsetY = richItem.shadowOffsetY); + hasOwn(richItem, "textShadowColor") && (out2.textShadowColor = richItem.textShadowColor); + hasOwn(richItem, "textShadowBlur") && (out2.textShadowBlur = richItem.textShadowBlur); + hasOwn(richItem, "textShadowOffsetX") && (out2.textShadowOffsetX = richItem.textShadowOffsetX); + hasOwn(richItem, "textShadowOffsetY") && (out2.textShadowOffsetY = richItem.textShadowOffsetY); +} +function warnDeprecated(deprecated, insteadApproach) { + if (true) { + const key = deprecated + "^_^" + insteadApproach; + if (!deprecatedLogs[key]) { + console.warn(`[ECharts] DEPRECATED: "${deprecated}" has been deprecated. ${insteadApproach}`); + deprecatedLogs[key] = true; + } + } +} + +// src/animation/customGraphicTransition.ts +var LEGACY_TRANSFORM_PROPS_MAP = { + position: ["x", "y"], + scale: ["scaleX", "scaleY"], + origin: ["originX", "originY"] +}; +var LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP); +var TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, (obj, key) => { + obj[key] = 1; + return obj; +}, {}); +var transformPropNamesStr = TRANSFORMABLE_PROPS.join(", "); +var ELEMENT_ANIMATABLE_PROPS = ["", "style", "shape", "extra"]; +var transitionInnerStore = makeInner(); +function getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) { + const animationProp = `${animationType}Animation`; + const config = getAnimationConfig(animationType, parentModel, dataIndex) || {}; + const userDuring = transitionInnerStore(el).userDuring; + if (config.duration > 0) { + config.during = userDuring ? bind(duringCall, {el, userDuring}) : null; + config.setToFinal = true; + config.scope = animationType; + } + extend(config, elOption[animationProp]); + return config; +} +function applyUpdateTransition(el, elOption, animatableModel, opts) { + opts = opts || {}; + const {dataIndex, isInit, clearStyle} = opts; + const hasAnimation = animatableModel.isAnimationEnabled(); + const store = transitionInnerStore(el); + const styleOpt = elOption.style; + store.userDuring = elOption.during; + const transFromProps = {}; + const propsToSet = {}; + prepareTransformAllPropsFinal(el, elOption, propsToSet); + prepareShapeOrExtraAllPropsFinal("shape", elOption, propsToSet); + prepareShapeOrExtraAllPropsFinal("extra", elOption, propsToSet); + if (!isInit && hasAnimation) { + prepareTransformTransitionFrom(el, elOption, transFromProps); + prepareShapeOrExtraTransitionFrom("shape", el, elOption, transFromProps); + prepareShapeOrExtraTransitionFrom("extra", el, elOption, transFromProps); + prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps); + } + propsToSet.style = styleOpt; + applyPropsDirectly(el, propsToSet, clearStyle); + applyMiscProps(el, elOption); + if (hasAnimation) { + if (isInit) { + const enterFromProps = {}; + each(ELEMENT_ANIMATABLE_PROPS, (propName) => { + const prop = propName ? elOption[propName] : elOption; + if (prop && prop.enterFrom) { + if (propName) { + enterFromProps[propName] = enterFromProps[propName] || {}; } - winStartItemInfo = currItemInfo; + extend(propName ? enterFromProps[propName] : enterFromProps, prop.enterFrom); } - return result; - function getItemInfo(el) { - if (el) { - var itemRect = el.getBoundingRect(); - var start = itemRect[xy] + el[xy]; - return { - s: start, - e: start + itemRect[wh], - i: el.__legendDataIndex - }; + }); + const config = getElementAnimationConfig("enter", el, elOption, animatableModel, dataIndex); + if (config.duration > 0) { + el.animateFrom(enterFromProps, config); + } + } else { + applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps); + } + } + updateLeaveTo(el, elOption); + styleOpt ? el.dirty() : el.markRedraw(); +} +function updateLeaveTo(el, elOption) { + let leaveToProps = transitionInnerStore(el).leaveToProps; + for (let i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) { + const propName = ELEMENT_ANIMATABLE_PROPS[i]; + const prop = propName ? elOption[propName] : elOption; + if (prop && prop.leaveTo) { + if (!leaveToProps) { + leaveToProps = transitionInnerStore(el).leaveToProps = {}; + } + if (propName) { + leaveToProps[propName] = leaveToProps[propName] || {}; + } + extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo); + } + } +} +function applyLeaveTransition(el, elOption, animatableModel, onRemove) { + if (el) { + const parent = el.parent; + const leaveToProps = transitionInnerStore(el).leaveToProps; + if (leaveToProps) { + const config = getElementAnimationConfig("update", el, elOption, animatableModel, 0); + config.done = () => { + parent.remove(el); + onRemove && onRemove(); + }; + el.animateTo(leaveToProps, config); + } else { + parent.remove(el); + onRemove && onRemove(); + } + } +} +function isTransitionAll(transition) { + return transition === "all"; +} +function applyPropsDirectly(el, allPropsFinal, clearStyle) { + const styleOpt = allPropsFinal.style; + if (!el.isGroup && styleOpt) { + if (clearStyle) { + el.useStyle({}); + const animators = el.animators; + for (let i = 0; i < animators.length; i++) { + const animator = animators[i]; + if (animator.targetName === "style") { + animator.changeTarget(el.style); + } + } + } + el.setStyle(styleOpt); + } + if (allPropsFinal) { + allPropsFinal.style = null; + allPropsFinal && el.attr(allPropsFinal); + allPropsFinal.style = styleOpt; + } +} +function applyPropsTransition(el, elOption, dataIndex, model, transFromProps) { + if (transFromProps) { + const config = getElementAnimationConfig("update", el, elOption, model, dataIndex); + if (config.duration > 0) { + el.animateFrom(transFromProps, config); + } + } +} +function applyMiscProps(el, elOption) { + hasOwn(elOption, "silent") && (el.silent = elOption.silent); + hasOwn(elOption, "ignore") && (el.ignore = elOption.ignore); + if (el instanceof Displayable_default) { + hasOwn(elOption, "invisible") && (el.invisible = elOption.invisible); + } + if (el instanceof Path_default) { + hasOwn(elOption, "autoBatch") && (el.autoBatch = elOption.autoBatch); + } +} +var tmpDuringScope = {}; +var transitionDuringAPI = { + setTransform(key, val) { + if (true) { + assert(hasOwn(TRANSFORM_PROPS_MAP, key), "Only " + transformPropNamesStr + " available in `setTransform`."); + } + tmpDuringScope.el[key] = val; + return this; + }, + getTransform(key) { + if (true) { + assert(hasOwn(TRANSFORM_PROPS_MAP, key), "Only " + transformPropNamesStr + " available in `getTransform`."); + } + return tmpDuringScope.el[key]; + }, + setShape(key, val) { + if (true) { + assertNotReserved(key); + } + const el = tmpDuringScope.el; + const shape = el.shape || (el.shape = {}); + shape[key] = val; + el.dirtyShape && el.dirtyShape(); + return this; + }, + getShape(key) { + if (true) { + assertNotReserved(key); + } + const shape = tmpDuringScope.el.shape; + if (shape) { + return shape[key]; + } + }, + setStyle(key, val) { + if (true) { + assertNotReserved(key); + } + const el = tmpDuringScope.el; + const style = el.style; + if (style) { + if (true) { + if (eqNaN(val)) { + warn("style." + key + " must not be assigned with NaN."); + } + } + style[key] = val; + el.dirtyStyle && el.dirtyStyle(); + } + return this; + }, + getStyle(key) { + if (true) { + assertNotReserved(key); + } + const style = tmpDuringScope.el.style; + if (style) { + return style[key]; + } + }, + setExtra(key, val) { + if (true) { + assertNotReserved(key); + } + const extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {}); + extra[key] = val; + return this; + }, + getExtra(key) { + if (true) { + assertNotReserved(key); + } + const extra = tmpDuringScope.el.extra; + if (extra) { + return extra[key]; + } + } +}; +function assertNotReserved(key) { + if (true) { + if (key === "transition" || key === "enterFrom" || key === "leaveTo") { + throw new Error('key must not be "' + key + '"'); + } + } +} +function duringCall() { + const scope = this; + const el = scope.el; + if (!el) { + return; + } + const latestUserDuring = transitionInnerStore(el).userDuring; + const scopeUserDuring = scope.userDuring; + if (latestUserDuring !== scopeUserDuring) { + scope.el = scope.userDuring = null; + return; + } + tmpDuringScope.el = el; + scopeUserDuring(transitionDuringAPI); +} +function prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) { + const attrOpt = elOption[mainAttr]; + if (!attrOpt) { + return; + } + const elPropsInAttr = fromEl[mainAttr]; + let transFromPropsInAttr; + if (elPropsInAttr) { + const transition = elOption.transition; + const attrTransition = attrOpt.transition; + if (attrTransition) { + !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); + if (isTransitionAll(attrTransition)) { + extend(transFromPropsInAttr, elPropsInAttr); + } else { + const transitionKeys = normalizeToArray(attrTransition); + for (let i = 0; i < transitionKeys.length; i++) { + const key = transitionKeys[i]; + const elVal = elPropsInAttr[key]; + transFromPropsInAttr[key] = elVal; + } + } + } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) { + !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); + const elPropsInAttrKeys = keys(elPropsInAttr); + for (let i = 0; i < elPropsInAttrKeys.length; i++) { + const key = elPropsInAttrKeys[i]; + const elVal = elPropsInAttr[key]; + if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) { + transFromPropsInAttr[key] = elVal; + } + } + } + } +} +function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) { + const attrOpt = elOption[mainAttr]; + if (!attrOpt) { + return; + } + const allPropsInAttr = allProps[mainAttr] = {}; + const keysInAttr = keys(attrOpt); + for (let i = 0; i < keysInAttr.length; i++) { + const key = keysInAttr[i]; + allPropsInAttr[key] = cloneValue(attrOpt[key]); + } +} +function prepareTransformTransitionFrom(el, elOption, transFromProps) { + const transition = elOption.transition; + const transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []); + for (let i = 0; i < transitionKeys.length; i++) { + const key = transitionKeys[i]; + if (key === "style" || key === "shape" || key === "extra") { + continue; + } + const elVal = el[key]; + if (true) { + checkTransformPropRefer(key, "el.transition"); + } + transFromProps[key] = elVal; + } +} +function prepareTransformAllPropsFinal(el, elOption, allProps) { + for (let i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) { + const legacyName = LEGACY_TRANSFORM_PROPS[i]; + const xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName]; + const legacyArr = elOption[legacyName]; + if (legacyArr) { + allProps[xyName[0]] = legacyArr[0]; + allProps[xyName[1]] = legacyArr[1]; + } + } + for (let i = 0; i < TRANSFORMABLE_PROPS.length; i++) { + const key = TRANSFORMABLE_PROPS[i]; + if (elOption[key] != null) { + allProps[key] = elOption[key]; + } + } +} +function prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) { + if (!styleOpt) { + return; + } + const fromElStyle = fromEl.style; + let transFromStyleProps; + if (fromElStyle) { + const styleTransition = styleOpt.transition; + const elTransition = elOption.transition; + if (styleTransition && !isTransitionAll(styleTransition)) { + const transitionKeys = normalizeToArray(styleTransition); + !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); + for (let i = 0; i < transitionKeys.length; i++) { + const key = transitionKeys[i]; + const elVal = fromElStyle[key]; + transFromStyleProps[key] = elVal; + } + } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, "style") >= 0)) { + const animationProps = fromEl.getAnimationStyleProps(); + const animationStyleProps = animationProps ? animationProps.style : null; + if (animationStyleProps) { + !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); + const styleKeys = keys(styleOpt); + for (let i = 0; i < styleKeys.length; i++) { + const key = styleKeys[i]; + if (animationStyleProps[key]) { + const elVal = fromElStyle[key]; + transFromStyleProps[key] = elVal; } } - function intersect(itemInfo, winStart) { - return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize; + } + } + } +} +function isNonStyleTransitionEnabled(optVal, elVal) { + return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal; +} +var checkTransformPropRefer; +if (true) { + checkTransformPropRefer = function(key, usedIn) { + if (!hasOwn(TRANSFORM_PROPS_MAP, key)) { + warn("Prop `" + key + "` is not a permitted in `" + usedIn + "`. Only `" + keys(TRANSFORM_PROPS_MAP).join("`, `") + "` are permitted."); + } + }; +} + +// src/animation/customGraphicKeyframeAnimation.ts +var getStateToRestore = makeInner(); +var KEYFRAME_EXCLUDE_KEYS = ["percent", "easing", "shape", "style", "extra"]; +function stopPreviousKeyframeAnimationAndRestore(el) { + el.stopAnimation("keyframe"); + el.attr(getStateToRestore(el)); +} +function applyKeyframeAnimation(el, animationOpts, animatableModel) { + if (!animatableModel.isAnimationEnabled() || !animationOpts) { + return; + } + if (isArray(animationOpts)) { + each(animationOpts, (singleAnimationOpts) => { + applyKeyframeAnimation(el, singleAnimationOpts, animatableModel); + }); + return; + } + const keyframes = animationOpts.keyframes; + let duration = animationOpts.duration; + if (animatableModel && duration == null) { + const config = getAnimationConfig("enter", animatableModel, 0); + duration = config && config.duration; + } + if (!keyframes || !duration) { + return; + } + const stateToRestore = getStateToRestore(el); + each(ELEMENT_ANIMATABLE_PROPS, (targetPropName) => { + if (targetPropName && !el[targetPropName]) { + return; + } + let animator; + let endFrameIsSet = false; + keyframes.sort((a, b) => a.percent - b.percent); + each(keyframes, (kf) => { + const animators = el.animators; + const kfValues = targetPropName ? kf[targetPropName] : kf; + if (true) { + if (kf.percent >= 1) { + endFrameIsSet = true; + } + } + if (!kfValues) { + return; + } + let propKeys = keys(kfValues); + if (!targetPropName) { + propKeys = filter(propKeys, (key) => indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0); + } + if (!propKeys.length) { + return; + } + if (!animator) { + animator = el.animate(targetPropName, animationOpts.loop, true); + animator.scope = "keyframe"; + } + for (let i = 0; i < animators.length; i++) { + if (animators[i] !== animator && animators[i].targetName === animator.targetName) { + animators[i].stopTracks(propKeys); } - }; - ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) { - if (!this._showController) { - return 0; - } - var index; - var contentGroup = this.getContentGroup(); - var defaultIndex; - contentGroup.eachChild(function (child, idx) { - var legendDataIdx = child.__legendDataIndex; - // FIXME - // If the given targetDataIndex (from model) is illegal, - // we use defaultIndex. But the index on the legend model and - // action payload is still illegal. That case will not be - // changed until some scenario requires. - if (defaultIndex == null && legendDataIdx != null) { - defaultIndex = idx; - } - if (legendDataIdx === targetDataIndex) { - index = idx; - } - }); - return index != null ? index : defaultIndex; - }; - ScrollableLegendView.type = 'legend.scroll'; - return ScrollableLegendView; - }(LegendView); - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 installScrollableLegendAction(registers) { - /** - * @event legendScroll - * @type {Object} - * @property {string} type 'legendScroll' - * @property {string} scrollDataIndex - */ - registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) { - var scrollDataIndex = payload.scrollDataIndex; - scrollDataIndex != null && ecModel.eachComponent({ - mainType: 'legend', - subType: 'scroll', - query: payload - }, function (legendModel) { - legendModel.setScrollDataIndex(scrollDataIndex); - }); + } + targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {}); + const savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore; + each(propKeys, (key) => { + savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key]; }); + animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing); + }); + if (!animator) { + return; + } + if (true) { + if (!endFrameIsSet) { + warn("End frame with percent: 1 is missing in the keyframeAnimation.", true); + } + } + animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing); + }); +} + +// src/chart/custom/CustomView.ts +var EMPHASIS = "emphasis"; +var NORMAL = "normal"; +var BLUR = "blur"; +var SELECT = "select"; +var STATES = [NORMAL, EMPHASIS, BLUR, SELECT]; +var PATH_ITEM_STYLE = { + normal: ["itemStyle"], + emphasis: [EMPHASIS, "itemStyle"], + blur: [BLUR, "itemStyle"], + select: [SELECT, "itemStyle"] +}; +var PATH_LABEL = { + normal: ["label"], + emphasis: [EMPHASIS, "label"], + blur: [BLUR, "label"], + select: [SELECT, "label"] +}; +var DEFAULT_TRANSITION = ["x", "y"]; +var GROUP_DIFF_PREFIX = "e\0\0"; +var attachedTxInfoTmp = { + normal: {}, + emphasis: {}, + blur: {}, + select: {} +}; +var prepareCustoms = { + cartesian2d: cartesianPrepareCustom, + geo: geoPrepareCustom, + single: singlePrepareCustom, + polar: polarPrepareCustom, + calendar: calendarPrepareCustom +}; +function isPath2(el) { + return el instanceof Path_default; +} +function isDisplayable(el) { + return el instanceof Displayable_default; +} +function copyElement(sourceEl, targetEl) { + targetEl.copyTransform(sourceEl); + if (isDisplayable(targetEl) && isDisplayable(sourceEl)) { + targetEl.setStyle(sourceEl.style); + targetEl.z = sourceEl.z; + targetEl.z2 = sourceEl.z2; + targetEl.zlevel = sourceEl.zlevel; + targetEl.invisible = sourceEl.invisible; + targetEl.ignore = sourceEl.ignore; + if (isPath2(targetEl) && isPath2(sourceEl)) { + targetEl.setShape(sourceEl.shape); + } + } +} +var CustomChartView2 = class extends Chart_default { + constructor() { + super(...arguments); + this.type = CustomChartView2.type; + } + render(customSeries, ecModel, api2, payload) { + this._progressiveEls = null; + const oldData = this._data; + const data = customSeries.getData(); + const group = this.group; + const renderItem = makeRenderItem(customSeries, data, ecModel, api2); + if (!oldData) { + group.removeAll(); + } + data.diff(oldData).add(function(newIdx) { + createOrUpdateItem(api2, null, newIdx, renderItem(newIdx, payload), customSeries, group, data); + }).remove(function(oldIdx) { + const el = oldData.getItemGraphicEl(oldIdx); + el && applyLeaveTransition(el, customInnerStore(el).option, customSeries); + }).update(function(newIdx, oldIdx) { + const oldEl = oldData.getItemGraphicEl(oldIdx); + createOrUpdateItem(api2, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data); + }).execute(); + const clipPath = customSeries.get("clip", true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null; + if (clipPath) { + group.setClipPath(clipPath); + } else { + group.removeClipPath(); + } + this._data = data; + } + incrementalPrepareRender(customSeries, ecModel, api2) { + this.group.removeAll(); + this._data = null; + } + incrementalRender(params, customSeries, ecModel, api2, payload) { + const data = customSeries.getData(); + const renderItem = makeRenderItem(customSeries, data, ecModel, api2); + const progressiveEls = this._progressiveEls = []; + function setIncrementalAndHoverLayer(el) { + if (!el.isGroup) { + el.incremental = true; + el.ensureState("emphasis").hoverLayer = true; + } } - - function install$I(registers) { - use(install$H); - registers.registerComponentModel(ScrollableLegendModel); - registers.registerComponentView(ScrollableLegendView); - installScrollableLegendAction(registers); + for (let idx = params.start; idx < params.end; idx++) { + const el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data); + if (el) { + el.traverse(setIncrementalAndHoverLayer); + progressiveEls.push(el); + } } - - function install$J(registers) { - use(install$H); - use(install$I); + } + eachRendered(cb) { + traverseElements(this._progressiveEls || this.group, cb); + } + filterForExposedEvent(eventType, query, targetEl, packedEvent) { + const elementName = query.element; + if (elementName == null || targetEl.name === elementName) { + return true; } - - var InsideZoomModel = /** @class */function (_super) { - __extends(InsideZoomModel, _super); - function InsideZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = InsideZoomModel.type; - return _this; + while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) { + if (targetEl.name === elementName) { + return true; } - InsideZoomModel.type = 'dataZoom.inside'; - InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, { - disabled: false, - zoomLock: false, - zoomOnMouseWheel: true, - moveOnMouseMove: true, - moveOnMouseWheel: false, - preventDefaultMouseMove: true - }); - return InsideZoomModel; - }(DataZoomModel); - - var inner$k = makeInner(); - function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) { - inner$k(api).coordSysRecordMap.each(function (coordSysRecord) { - var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid); - if (dzInfo) { - dzInfo.getRange = getRange; - } - }); } - function disposeCoordSysRecordIfNeeded(api, dataZoomModel) { - var coordSysRecordMap = inner$k(api).coordSysRecordMap; - var coordSysKeyArr = coordSysRecordMap.keys(); - for (var i = 0; i < coordSysKeyArr.length; i++) { - var coordSysKey = coordSysKeyArr[i]; - var coordSysRecord = coordSysRecordMap.get(coordSysKey); - var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; - if (dataZoomInfoMap) { - var dzUid = dataZoomModel.uid; - var dzInfo = dataZoomInfoMap.get(dzUid); - if (dzInfo) { - dataZoomInfoMap.removeKey(dzUid); - if (!dataZoomInfoMap.keys().length) { - disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); - } - } - } + return false; + } +}; +var CustomChartView = CustomChartView2; +CustomChartView.type = "custom"; +var CustomView_default = CustomChartView; +function createEl(elOption) { + const graphicType = elOption.type; + let el; + if (graphicType === "path") { + const shape = elOption.shape; + const pathRect = shape.width != null && shape.height != null ? { + x: shape.x || 0, + y: shape.y || 0, + width: shape.width, + height: shape.height + } : null; + const pathData = getPathData(shape); + el = makePath(pathData, null, pathRect, shape.layout || "center"); + customInnerStore(el).customPathData = pathData; + } else if (graphicType === "image") { + el = new Image_default({}); + customInnerStore(el).customImagePath = elOption.style.image; + } else if (graphicType === "text") { + el = new Text_default({}); + } else if (graphicType === "group") { + el = new Group_default(); + } else if (graphicType === "compoundPath") { + throw new Error('"compoundPath" is not supported yet.'); + } else { + const Clz = getShapeClass(graphicType); + if (!Clz) { + let errMsg = ""; + if (true) { + errMsg = 'graphic type "' + graphicType + '" can not be found.'; + } + throwError(errMsg); + } + el = new Clz(); + } + customInnerStore(el).customGraphicType = graphicType; + el.name = elOption.name; + el.z2EmphasisLift = 1; + el.z2SelectLift = 1; + return el; +} +function updateElNormal(api2, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) { + stopPreviousKeyframeAnimationAndRestore(el); + const txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg; + if (txCfgOpt) { + el.setTextConfig(txCfgOpt); + } + if (elOption && elOption.transition == null) { + elOption.transition = DEFAULT_TRANSITION; + } + const styleOpt = elOption && elOption.style; + if (styleOpt) { + if (el.type === "text") { + const textOptionStyle = styleOpt; + hasOwn(textOptionStyle, "textFill") && (textOptionStyle.fill = textOptionStyle.textFill); + hasOwn(textOptionStyle, "textStroke") && (textOptionStyle.stroke = textOptionStyle.textStroke); + } + let decalPattern; + const decalObj = isPath2(el) ? styleOpt.decal : null; + if (api2 && decalObj) { + decalObj.dirty = true; + decalPattern = createOrUpdatePatternFromDecal(decalObj, api2); + } + styleOpt.__decalPattern = decalPattern; + } + if (isDisplayable(el)) { + if (styleOpt) { + const decalPattern = styleOpt.__decalPattern; + if (decalPattern) { + styleOpt.decal = decalPattern; + } + } + } + applyUpdateTransition(el, elOption, seriesModel, { + dataIndex, + isInit, + clearStyle: true + }); + applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel); +} +function updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) { + const elDisplayable = el.isGroup ? null : el; + const txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; + if (elDisplayable) { + const stateObj = elDisplayable.ensureState(state); + if (styleOpt === false) { + const existingEmphasisState = elDisplayable.getState(state); + if (existingEmphasisState) { + existingEmphasisState.style = null; + } + } else { + stateObj.style = styleOpt || null; + } + if (txCfgOpt) { + stateObj.textConfig = txCfgOpt; + } + setDefaultStateProxy(elDisplayable); + } +} +function updateZ2(el, elOption, seriesModel) { + if (el.isGroup) { + return; + } + const elDisplayable = el; + const currentZ = seriesModel.currentZ; + const currentZLevel = seriesModel.currentZLevel; + elDisplayable.z = currentZ; + elDisplayable.zlevel = currentZLevel; + const optZ2 = elOption.z2; + optZ2 != null && (elDisplayable.z2 = optZ2 || 0); + for (let i = 0; i < STATES.length; i++) { + updateZForEachState(elDisplayable, elOption, STATES[i]); + } +} +function updateZForEachState(elDisplayable, elOption, state) { + const isNormal = state === NORMAL; + const elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state); + const optZ2 = elStateOpt ? elStateOpt.z2 : null; + let stateObj; + if (optZ2 != null) { + stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state); + stateObj.z2 = optZ2 || 0; + } +} +function makeRenderItem(customSeries, data, ecModel, api2) { + const renderItem = customSeries.get("renderItem"); + const coordSys = customSeries.coordinateSystem; + let prepareResult2 = {}; + if (coordSys) { + if (true) { + assert(renderItem, "series.render is required."); + assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], "This coordSys does not support custom series."); + } + prepareResult2 = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys); + } + const userAPI = defaults({ + getWidth: api2.getWidth, + getHeight: api2.getHeight, + getZr: api2.getZr, + getDevicePixelRatio: api2.getDevicePixelRatio, + value, + style, + ordinalRawValue, + styleEmphasis, + visual, + barLayout, + currentSeriesIndices, + font + }, prepareResult2.api || {}); + const userParams = { + context: {}, + seriesId: customSeries.id, + seriesName: customSeries.name, + seriesIndex: customSeries.seriesIndex, + coordSys: prepareResult2.coordSys, + dataInsideLength: data.count(), + encode: wrapEncodeDef(customSeries.getData()) + }; + let currDataIndexInside; + let currItemModel; + let currItemStyleModels = {}; + let currLabelModels = {}; + const seriesItemStyleModels = {}; + const seriesLabelModels = {}; + for (let i = 0; i < STATES.length; i++) { + const stateName = STATES[i]; + seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]); + seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]); + } + function getItemModel2(dataIndexInside) { + return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside); + } + function getItemStyleModel(dataIndexInside, state) { + return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel2(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel2(dataIndexInside).getModel(PATH_ITEM_STYLE[state]); + } + function getLabelModel(dataIndexInside, state) { + return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel2(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel2(dataIndexInside).getModel(PATH_LABEL[state]); + } + return function(dataIndexInside, payload) { + currDataIndexInside = dataIndexInside; + currItemModel = null; + currItemStyleModels = {}; + currLabelModels = {}; + return renderItem && renderItem(defaults({ + dataIndexInside, + dataIndex: data.getRawIndex(dataIndexInside), + actionType: payload ? payload.type : null + }, userParams), userAPI); + }; + function value(dim, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside); + } + function ordinalRawValue(dim, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + dim = dim || 0; + const dimInfo = data.getDimensionInfo(dim); + if (!dimInfo) { + const dimIndex = data.getDimensionIndex(dim); + return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : void 0; + } + const val = data.get(dimInfo.name, dataIndexInside); + const ordinalMeta = dimInfo && dimInfo.ordinalMeta; + return ordinalMeta ? ordinalMeta.categories[val] : val; + } + function style(userProps, dataIndexInside) { + if (true) { + warnDeprecated("api.style", "Please write literal style directly instead."); + } + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + const style2 = data.getItemVisual(dataIndexInside, "style"); + const visualColor = style2 && style2.fill; + const opacity = style2 && style2.opacity; + let itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle(); + visualColor != null && (itemStyle.fill = visualColor); + opacity != null && (itemStyle.opacity = opacity); + const opt = {inheritColor: isString(visualColor) ? visualColor : "#000"}; + const labelModel = getLabelModel(dataIndexInside, NORMAL); + const textStyle = createTextStyle(labelModel, null, opt, false, true); + textStyle.text = labelModel.getShallow("show") ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; + const textConfig = createTextConfig(labelModel, opt, false); + preFetchFromExtra(userProps, itemStyle); + itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); + userProps && applyUserPropsAfter(itemStyle, userProps); + itemStyle.legacy = true; + return itemStyle; + } + function styleEmphasis(userProps, dataIndexInside) { + if (true) { + warnDeprecated("api.styleEmphasis", "Please write literal style directly instead."); + } + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + let itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle(); + const labelModel = getLabelModel(dataIndexInside, EMPHASIS); + const textStyle = createTextStyle(labelModel, null, null, true, true); + textStyle.text = labelModel.getShallow("show") ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; + const textConfig = createTextConfig(labelModel, null, true); + preFetchFromExtra(userProps, itemStyle); + itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); + userProps && applyUserPropsAfter(itemStyle, userProps); + itemStyle.legacy = true; + return itemStyle; + } + function applyUserPropsAfter(itemStyle, extra) { + for (const key in extra) { + if (hasOwn(extra, key)) { + itemStyle[key] = extra[key]; + } + } + } + function preFetchFromExtra(extra, itemStyle) { + if (extra) { + extra.textFill && (itemStyle.textFill = extra.textFill); + extra.textPosition && (itemStyle.textPosition = extra.textPosition); + } + } + function visual(visualType, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + if (hasOwn(STYLE_VISUAL_TYPE, visualType)) { + const style2 = data.getItemVisual(dataIndexInside, "style"); + return style2 ? style2[STYLE_VISUAL_TYPE[visualType]] : null; + } + if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) { + return data.getItemVisual(dataIndexInside, visualType); + } + } + function barLayout(opt) { + if (coordSys.type === "cartesian2d") { + const baseAxis = coordSys.getBaseAxis(); + return getLayoutOnAxis(defaults({axis: baseAxis}, opt)); + } + } + function currentSeriesIndices() { + return ecModel.getCurrentSeriesIndices(); + } + function font(opt) { + return getFont(opt, ecModel); + } +} +function wrapEncodeDef(data) { + const encodeDef = {}; + each(data.dimensions, function(dimName) { + const dimInfo = data.getDimensionInfo(dimName); + if (!dimInfo.isExtraCoord) { + const coordDim = dimInfo.coordDim; + const dataDims = encodeDef[coordDim] = encodeDef[coordDim] || []; + dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName); + } + }); + return encodeDef; +} +function createOrUpdateItem(api2, existsEl, dataIndex, elOption, seriesModel, group, data) { + if (!elOption) { + group.remove(existsEl); + return; + } + const el = doCreateOrUpdateEl(api2, existsEl, dataIndex, elOption, seriesModel, group); + el && data.setItemGraphicEl(dataIndex, el); + el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled); + return el; +} +function doCreateOrUpdateEl(api2, existsEl, dataIndex, elOption, seriesModel, group) { + if (true) { + assert(elOption, "should not have an null/undefined element setting"); + } + let toBeReplacedIdx = -1; + const oldEl = existsEl; + if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel)) { + toBeReplacedIdx = indexOf(group.childrenRef(), existsEl); + existsEl = null; + } + const isInit = !existsEl; + let el = existsEl; + if (!el) { + el = createEl(elOption); + if (oldEl) { + copyElement(oldEl, el); + } + } else { + el.clearStates(); + } + if (elOption.morph === false) { + el.disableMorphing = true; + } else if (el.disableMorphing) { + el.disableMorphing = false; + } + attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null; + attachedTxInfoTmp.isLegacy = false; + doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp); + doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit); + updateElNormal(api2, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); + hasOwn(elOption, "info") && (customInnerStore(el).info = elOption.info); + for (let i = 0; i < STATES.length; i++) { + const stateName = STATES[i]; + if (stateName !== NORMAL) { + const otherStateOpt = retrieveStateOption(elOption, stateName); + const otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName); + updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp); + } + } + updateZ2(el, elOption, seriesModel); + if (elOption.type === "group") { + mergeChildren(api2, el, dataIndex, elOption, seriesModel); + } + if (toBeReplacedIdx >= 0) { + group.replaceAt(el, toBeReplacedIdx); + } else { + group.add(el); + } + return el; +} +function doesElNeedRecreate(el, elOption, seriesModel) { + const elInner = customInnerStore(el); + const elOptionType = elOption.type; + const elOptionShape = elOption.shape; + const elOptionStyle = elOption.style; + return seriesModel.isUniversalTransitionEnabled() || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === "path" && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === "image" && hasOwn(elOptionStyle, "image") && elOptionStyle.image !== elInner.customImagePath; +} +function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) { + const clipPathOpt = elOption.clipPath; + if (clipPathOpt === false) { + if (el && el.getClipPath()) { + el.removeClipPath(); + } + } else if (clipPathOpt) { + let clipPath = el.getClipPath(); + if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) { + clipPath = null; + } + if (!clipPath) { + clipPath = createEl(clipPathOpt); + if (true) { + assert(isPath2(clipPath), "Only any type of `path` can be used in `clipPath`, rather than " + clipPath.type + "."); + } + el.setClipPath(clipPath); + } + updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit); + } +} +function doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) { + if (el.isGroup) { + return; + } + processTxInfo(elOption, null, attachedTxInfo); + processTxInfo(elOption, EMPHASIS, attachedTxInfo); + let txConOptNormal = attachedTxInfo.normal.conOpt; + const txConOptEmphasis = attachedTxInfo.emphasis.conOpt; + const txConOptBlur = attachedTxInfo.blur.conOpt; + const txConOptSelect = attachedTxInfo.select.conOpt; + if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) { + let textContent = el.getTextContent(); + if (txConOptNormal === false) { + textContent && el.removeTextContent(); + } else { + txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {type: "text"}; + if (!textContent) { + textContent = createEl(txConOptNormal); + el.setTextContent(textContent); + } else { + textContent.clearStates(); + } + updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit); + const txConStlOptNormal = txConOptNormal && txConOptNormal.style; + for (let i = 0; i < STATES.length; i++) { + const stateName = STATES[i]; + if (stateName !== NORMAL) { + const txConOptOtherState = attachedTxInfo[stateName].conOpt; + updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null); + } + } + txConStlOptNormal ? textContent.dirty() : textContent.markRedraw(); + } + } +} +function processTxInfo(elOption, state, attachedTxInfo) { + const stateOpt = !state ? elOption : retrieveStateOption(elOption, state); + const styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS); + const elType = elOption.type; + let txCfg = stateOpt ? stateOpt.textConfig : null; + const txConOptNormal = elOption.textContent; + let txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state); + if (styleOpt && (attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) { + attachedTxInfo.isLegacy = true; + const convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); + if (!txCfg && convertResult.textConfig) { + txCfg = convertResult.textConfig; + } + if (!txConOpt && convertResult.textContent) { + txConOpt = convertResult.textContent; + } + } + if (!state && txConOpt) { + const txConOptNormal2 = txConOpt; + !txConOptNormal2.type && (txConOptNormal2.type = "text"); + if (true) { + assert(txConOptNormal2.type === "text", 'textContent.type must be "text"'); + } + } + const info = !state ? attachedTxInfo.normal : attachedTxInfo[state]; + info.cfg = txCfg; + info.conOpt = txConOpt; +} +function retrieveStateOption(elOption, state) { + return !state ? elOption : elOption ? elOption[state] : null; +} +function retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) { + let style = stateOption && stateOption.style; + if (style == null && state === EMPHASIS && stateOptionNormal) { + style = stateOptionNormal.styleEmphasis; + } + return style; +} +function mergeChildren(api2, el, dataIndex, elOption, seriesModel) { + const newChildren = elOption.children; + const newLen = newChildren ? newChildren.length : 0; + const mergeChildren2 = elOption.$mergeChildren; + const byName = mergeChildren2 === "byName" || elOption.diffChildrenByName; + const notMerge = mergeChildren2 === false; + if (!newLen && !byName && !notMerge) { + return; + } + if (byName) { + diffGroupChildren({ + api: api2, + oldChildren: el.children() || [], + newChildren: newChildren || [], + dataIndex, + seriesModel, + group: el + }); + return; + } + notMerge && el.removeAll(); + let index = 0; + for (; index < newLen; index++) { + const newChild = newChildren[index]; + const oldChild = el.childAt(index); + if (newChild) { + if (newChild.ignore == null) { + newChild.ignore = false; + } + doCreateOrUpdateEl(api2, oldChild, dataIndex, newChild, seriesModel, el); + } else { + if (true) { + assert(oldChild, "renderItem should not return a group containing elements as null/undefined/{} if they do not exist before."); + } + oldChild.ignore = true; + } + } + for (let i = el.childCount() - 1; i >= index; i--) { + const child = el.childAt(i); + removeChildFromGroup(el, child, seriesModel); + } +} +function removeChildFromGroup(group, child, seriesModel) { + child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel); +} +function diffGroupChildren(context) { + new DataDiffer_default(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute(); +} +function getKey(item, idx) { + const name = item && item.name; + return name != null ? name : GROUP_DIFF_PREFIX + idx; +} +function processAddUpdate(newIndex, oldIndex) { + const context = this.context; + const childOption = newIndex != null ? context.newChildren[newIndex] : null; + const child = oldIndex != null ? context.oldChildren[oldIndex] : null; + doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group); +} +function processRemove(oldIndex) { + const context = this.context; + const child = context.oldChildren[oldIndex]; + child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel); +} +function getPathData(shape) { + return shape && (shape.pathData || shape.d); +} +function hasOwnPathData(shape) { + return shape && (hasOwn(shape, "pathData") || hasOwn(shape, "d")); +} + +// src/chart/custom/install.ts +function install28(registers) { + registers.registerChartView(CustomView_default); + registers.registerSeriesModel(CustomSeries_default); +} + +// src/component/graphic/GraphicModel.ts +function setKeyInfoToNewElOption(resultItem, newElOption) { + const existElOption = resultItem.existing; + newElOption.id = resultItem.keyInfo.id; + !newElOption.type && existElOption && (newElOption.type = existElOption.type); + if (newElOption.parentId == null) { + const newElParentOption = newElOption.parentOption; + if (newElParentOption) { + newElOption.parentId = newElParentOption.id; + } else if (existElOption) { + newElOption.parentId = existElOption.parentId; + } + } + newElOption.parentOption = null; +} +function isSetLoc(obj, props) { + let isSet; + each(props, function(prop) { + obj[prop] != null && obj[prop] !== "auto" && (isSet = true); + }); + return isSet; +} +function mergeNewElOptionToExist(existList, index, newElOption) { + const newElOptCopy = extend({}, newElOption); + const existElOption = existList[index]; + const $action = newElOption.$action || "merge"; + if ($action === "merge") { + if (existElOption) { + if (true) { + const newType = newElOption.type; + assert(!newType || existElOption.type === newType, 'Please set $action: "replace" to change `type`'); + } + merge(existElOption, newElOptCopy, true); + mergeLayoutParam(existElOption, newElOptCopy, {ignoreSize: true}); + copyLayoutParams(newElOption, existElOption); + copyTransitionInfo(newElOption, existElOption); + copyTransitionInfo(newElOption, existElOption, "shape"); + copyTransitionInfo(newElOption, existElOption, "style"); + copyTransitionInfo(newElOption, existElOption, "extra"); + newElOption.clipPath = existElOption.clipPath; + } else { + existList[index] = newElOptCopy; + } + } else if ($action === "replace") { + existList[index] = newElOptCopy; + } else if ($action === "remove") { + existElOption && (existList[index] = null); + } +} +var TRANSITION_PROPS_TO_COPY = ["transition", "enterFrom", "leaveTo"]; +var ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(["enterAnimation", "updateAnimation", "leaveAnimation"]); +function copyTransitionInfo(target, source, targetProp) { + if (targetProp) { + if (!target[targetProp] && source[targetProp]) { + target[targetProp] = {}; + } + target = target[targetProp]; + source = source[targetProp]; + } + if (!target || !source) { + return; + } + const props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY; + for (let i = 0; i < props.length; i++) { + const prop = props[i]; + if (target[prop] == null && source[prop] != null) { + target[prop] = source[prop]; + } + } +} +function setLayoutInfoToExist(existItem, newElOption) { + if (!existItem) { + return; + } + existItem.hv = newElOption.hv = [ + isSetLoc(newElOption, ["left", "right"]), + isSetLoc(newElOption, ["top", "bottom"]) + ]; + if (existItem.type === "group") { + const existingGroupOpt = existItem; + const newGroupOpt = newElOption; + existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0); + existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0); + } +} +var GraphicComponentModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = GraphicComponentModel2.type; + this.preventAutoZ = true; + } + mergeOption(option, ecModel) { + const elements = this.option.elements; + this.option.elements = null; + super.mergeOption(option, ecModel); + this.option.elements = elements; + } + optionUpdated(newOption, isInit) { + const thisOption = this.option; + const newList = (isInit ? thisOption : newOption).elements; + const existList = thisOption.elements = isInit ? [] : thisOption.elements; + const flattenedList = []; + this._flatten(newList, flattenedList, null); + const mappingResult = mappingToExists(existList, flattenedList, "normalMerge"); + const elOptionsToUpdate = this._elOptionsToUpdate = []; + each(mappingResult, function(resultItem, index) { + const newElOption = resultItem.newOption; + if (true) { + assert(isObject(newElOption) || resultItem.existing, "Empty graphic option definition"); + } + if (!newElOption) { + return; + } + elOptionsToUpdate.push(newElOption); + setKeyInfoToNewElOption(resultItem, newElOption); + mergeNewElOptionToExist(existList, index, newElOption); + setLayoutInfoToExist(existList[index], newElOption); + }, this); + thisOption.elements = filter(existList, (item) => { + item && delete item.$action; + return item != null; + }); + } + _flatten(optionList, result, parentOption) { + each(optionList, function(option) { + if (!option) { + return; } + if (parentOption) { + option.parentOption = parentOption; + } + result.push(option); + const children = option.children; + if (children && children.length) { + this._flatten(children, result, option); + } + delete option.children; + }, this); + } + useElOptionsToUpdate() { + const els = this._elOptionsToUpdate; + this._elOptionsToUpdate = null; + return els; + } +}; +var GraphicComponentModel = GraphicComponentModel2; +GraphicComponentModel.type = "graphic"; +GraphicComponentModel.defaultOption = { + elements: [] +}; + +// src/component/axisPointer/BaseAxisPointer.ts +var inner11 = makeInner(); +var clone4 = clone; +var bind2 = bind; +var BaseAxisPointer = class { + constructor() { + this._dragging = false; + this.animationThreshold = 15; + } + render(axisModel, axisPointerModel, api2, forceRender) { + const value = axisPointerModel.get("value"); + const status = axisPointerModel.get("status"); + this._axisModel = axisModel; + this._axisPointerModel = axisPointerModel; + this._api = api2; + if (!forceRender && this._lastValue === value && this._lastStatus === status) { + return; + } + this._lastValue = value; + this._lastStatus = status; + let group = this._group; + const handle = this._handle; + if (!status || status === "hide") { + group && group.hide(); + handle && handle.hide(); + return; + } + group && group.show(); + handle && handle.show(); + const elOption = {}; + this.makeElOption(elOption, value, axisModel, axisPointerModel, api2); + const graphicKey = elOption.graphicKey; + if (graphicKey !== this._lastGraphicKey) { + this.clear(api2); + } + this._lastGraphicKey = graphicKey; + const moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel); + if (!group) { + group = this._group = new Group_default(); + this.createPointerEl(group, elOption, axisModel, axisPointerModel); + this.createLabelEl(group, elOption, axisModel, axisPointerModel); + api2.getZr().add(group); + } else { + const doUpdateProps = curry(updateProps2, axisPointerModel, moveAnimation); + this.updatePointerEl(group, elOption, doUpdateProps); + this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel); + } + updateMandatoryProps(group, axisPointerModel, true); + this._renderHandle(value); + } + remove(api2) { + this.clear(api2); + } + dispose(api2) { + this.clear(api2); + } + determineAnimation(axisModel, axisPointerModel) { + const animation = axisPointerModel.get("animation"); + const axis = axisModel.axis; + const isCategoryAxis = axis.type === "category"; + const useSnap = axisPointerModel.get("snap"); + if (!useSnap && !isCategoryAxis) { + return false; } - function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) { - if (coordSysRecord) { - coordSysRecordMap.removeKey(coordSysRecord.model.uid); - var controller = coordSysRecord.controller; - controller && controller.dispose(); + if (animation === "auto" || animation == null) { + const animationThreshold = this.animationThreshold; + if (isCategoryAxis && axis.getBandWidth() > animationThreshold) { + return true; + } + if (useSnap) { + const seriesDataCount = getAxisInfo(axisModel).seriesDataCount; + const axisExtent = axis.getExtent(); + return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold; } + return false; } - function createCoordSysRecord(api, coordSysModel) { - // These init props will never change after record created. - var coordSysRecord = { - model: coordSysModel, - containsPoint: curry(containsPoint, coordSysModel), - dispatchAction: curry(dispatchAction$1, api), - dataZoomInfoMap: null, - controller: null - }; - // Must not do anything depends on coordSysRecord outside the event handler here, - // because coordSysRecord not completed yet. - var controller = coordSysRecord.controller = new RoamController(api.getZr()); - each(['pan', 'zoom', 'scrollMove'], function (eventName) { - controller.on(eventName, function (event) { - var batch = []; - coordSysRecord.dataZoomInfoMap.each(function (dzInfo) { - // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove, - // moveOnMouseWheel, ...) enabled. - if (!event.isAvailableBehavior(dzInfo.model.option)) { - return; - } - var method = (dzInfo.getRange || {})[eventName]; - var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event); - !dzInfo.model.get('disabled', true) && range && batch.push({ - dataZoomId: dzInfo.model.id, - start: range[0], - end: range[1] - }); - }); - batch.length && coordSysRecord.dispatchAction(batch); + return animation === true; + } + makeElOption(elOption, value, axisModel, axisPointerModel, api2) { + } + createPointerEl(group, elOption, axisModel, axisPointerModel) { + const pointerOption = elOption.pointer; + if (pointerOption) { + const pointerEl = inner11(group).pointerEl = new graphic_exports[pointerOption.type](clone4(elOption.pointer)); + group.add(pointerEl); + } + } + createLabelEl(group, elOption, axisModel, axisPointerModel) { + if (elOption.label) { + const labelEl = inner11(group).labelEl = new Text_default(clone4(elOption.label)); + group.add(labelEl); + updateLabelShowHide(labelEl, axisPointerModel); + } + } + updatePointerEl(group, elOption, updateProps3) { + const pointerEl = inner11(group).pointerEl; + if (pointerEl && elOption.pointer) { + pointerEl.setStyle(elOption.pointer.style); + updateProps3(pointerEl, {shape: elOption.pointer.shape}); + } + } + updateLabelEl(group, elOption, updateProps3, axisPointerModel) { + const labelEl = inner11(group).labelEl; + if (labelEl) { + labelEl.setStyle(elOption.label.style); + updateProps3(labelEl, { + x: elOption.label.x, + y: elOption.label.y + }); + updateLabelShowHide(labelEl, axisPointerModel); + } + } + _renderHandle(value) { + if (this._dragging || !this.updateHandleTransform) { + return; + } + const axisPointerModel = this._axisPointerModel; + const zr = this._api.getZr(); + let handle = this._handle; + const handleModel = axisPointerModel.getModel("handle"); + const status = axisPointerModel.get("status"); + if (!handleModel.get("show") || !status || status === "hide") { + handle && zr.remove(handle); + this._handle = null; + return; + } + let isInit; + if (!this._handle) { + isInit = true; + handle = this._handle = createIcon(handleModel.get("icon"), { + cursor: "move", + draggable: true, + onmousemove(e2) { + stop(e2.event); + }, + onmousedown: bind2(this._onHandleDragMove, this, 0, 0), + drift: bind2(this._onHandleDragMove, this), + ondragend: bind2(this._onHandleDragEnd, this) + }); + zr.add(handle); + } + updateMandatoryProps(handle, axisPointerModel, false); + handle.setStyle(handleModel.getItemStyle(null, [ + "color", + "borderColor", + "borderWidth", + "opacity", + "shadowColor", + "shadowBlur", + "shadowOffsetX", + "shadowOffsetY" + ])); + let handleSize = handleModel.get("size"); + if (!isArray(handleSize)) { + handleSize = [handleSize, handleSize]; + } + handle.scaleX = handleSize[0] / 2; + handle.scaleY = handleSize[1] / 2; + createOrUpdate(this, "_doDispatchAxisPointer", handleModel.get("throttle") || 0, "fixRate"); + this._moveHandleToValue(value, isInit); + } + _moveHandleToValue(value, isInit) { + updateProps2(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel))); + } + _onHandleDragMove(dx, dy) { + const handle = this._handle; + if (!handle) { + return; + } + this._dragging = true; + const trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel); + this._payloadInfo = trans; + handle.stopAnimation(); + handle.attr(getHandleTransProps(trans)); + inner11(handle).lastProp = null; + this._doDispatchAxisPointer(); + } + _doDispatchAxisPointer() { + const handle = this._handle; + if (!handle) { + return; + } + const payloadInfo = this._payloadInfo; + const axisModel = this._axisModel; + this._api.dispatchAction({ + type: "updateAxisPointer", + x: payloadInfo.cursorPoint[0], + y: payloadInfo.cursorPoint[1], + tooltipOption: payloadInfo.tooltipOption, + axesInfo: [{ + axisDim: axisModel.axis.dim, + axisIndex: axisModel.componentIndex + }] + }); + } + _onHandleDragEnd() { + this._dragging = false; + const handle = this._handle; + if (!handle) { + return; + } + const value = this._axisPointerModel.get("value"); + this._moveHandleToValue(value); + this._api.dispatchAction({ + type: "hideTip" + }); + } + clear(api2) { + this._lastValue = null; + this._lastStatus = null; + const zr = api2.getZr(); + const group = this._group; + const handle = this._handle; + if (zr && group) { + this._lastGraphicKey = null; + group && zr.remove(group); + handle && zr.remove(handle); + this._group = null; + this._handle = null; + this._payloadInfo = null; + } + clear(this, "_doDispatchAxisPointer"); + } + doClear() { + } + buildLabel(xy, wh, xDimIndex) { + xDimIndex = xDimIndex || 0; + return { + x: xy[xDimIndex], + y: xy[1 - xDimIndex], + width: wh[xDimIndex], + height: wh[1 - xDimIndex] + }; + } +}; +function updateProps2(animationModel, moveAnimation, el, props) { + if (!propsEqual(inner11(el).lastProp, props)) { + inner11(el).lastProp = props; + moveAnimation ? updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props)); + } +} +function propsEqual(lastProps, newProps) { + if (isObject(lastProps) && isObject(newProps)) { + let equals = true; + each(newProps, function(item, key) { + equals = equals && propsEqual(lastProps[key], item); + }); + return !!equals; + } else { + return lastProps === newProps; + } +} +function updateLabelShowHide(labelEl, axisPointerModel) { + labelEl[axisPointerModel.get(["label", "show"]) ? "show" : "hide"](); +} +function getHandleTransProps(trans) { + return { + x: trans.x || 0, + y: trans.y || 0, + rotation: trans.rotation || 0 + }; +} +function updateMandatoryProps(group, axisPointerModel, silent) { + const z = axisPointerModel.get("z"); + const zlevel = axisPointerModel.get("zlevel"); + group && group.traverse(function(el) { + if (el.type !== "group") { + z != null && (el.z = z); + zlevel != null && (el.zlevel = zlevel); + el.silent = silent; + } + }); +} +var BaseAxisPointer_default = BaseAxisPointer; + +// src/component/axisPointer/viewHelper.ts +function buildElStyle(axisPointerModel) { + const axisPointerType = axisPointerModel.get("type"); + const styleModel = axisPointerModel.getModel(axisPointerType + "Style"); + let style; + if (axisPointerType === "line") { + style = styleModel.getLineStyle(); + style.fill = null; + } else if (axisPointerType === "shadow") { + style = styleModel.getAreaStyle(); + style.stroke = null; + } + return style; +} +function buildLabelElOption(elOption, axisModel, axisPointerModel, api2, labelPos) { + const value = axisPointerModel.get("value"); + const text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get("seriesDataIndices"), { + precision: axisPointerModel.get(["label", "precision"]), + formatter: axisPointerModel.get(["label", "formatter"]) + }); + const labelModel = axisPointerModel.getModel("label"); + const paddings = normalizeCssArray2(labelModel.get("padding") || 0); + const font = labelModel.getFont(); + const textRect = getBoundingRect(text, font); + const position2 = labelPos.position; + const width = textRect.width + paddings[1] + paddings[3]; + const height = textRect.height + paddings[0] + paddings[2]; + const align = labelPos.align; + align === "right" && (position2[0] -= width); + align === "center" && (position2[0] -= width / 2); + const verticalAlign = labelPos.verticalAlign; + verticalAlign === "bottom" && (position2[1] -= height); + verticalAlign === "middle" && (position2[1] -= height / 2); + confineInContainer(position2, width, height, api2); + let bgColor = labelModel.get("backgroundColor"); + if (!bgColor || bgColor === "auto") { + bgColor = axisModel.get(["axisLine", "lineStyle", "color"]); + } + elOption.label = { + x: position2[0], + y: position2[1], + style: createTextStyle(labelModel, { + text, + font, + fill: labelModel.getTextColor(), + padding: paddings, + backgroundColor: bgColor + }), + z2: 10 + }; +} +function confineInContainer(position2, width, height, api2) { + const viewWidth = api2.getWidth(); + const viewHeight = api2.getHeight(); + position2[0] = Math.min(position2[0] + width, viewWidth) - width; + position2[1] = Math.min(position2[1] + height, viewHeight) - height; + position2[0] = Math.max(position2[0], 0); + position2[1] = Math.max(position2[1], 0); +} +function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { + value = axis.scale.parse(value); + let text = axis.scale.getLabel({ + value + }, { + precision: opt.precision + }); + const formatter = opt.formatter; + if (formatter) { + const params = { + value: getAxisRawValue(axis, {value}), + axisDimension: axis.dim, + axisIndex: axis.index, + seriesData: [] + }; + each(seriesDataIndices, function(idxItem) { + const series = ecModel.getSeriesByIndex(idxItem.seriesIndex); + const dataIndex = idxItem.dataIndexInside; + const dataParams = series && series.getDataParams(dataIndex); + dataParams && params.seriesData.push(dataParams); + }); + if (isString(formatter)) { + text = formatter.replace("{value}", text); + } else if (isFunction(formatter)) { + text = formatter(params); + } + } + return text; +} +function getTransformedPosition(axis, value, layoutInfo) { + const transform2 = create2(); + rotate(transform2, transform2, layoutInfo.rotation); + translate(transform2, transform2, layoutInfo.position); + return applyTransform2([ + axis.dataToCoord(value), + (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0) + ], transform2); +} +function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api2) { + const textLayout = AxisBuilder_default.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection); + layoutInfo.labelMargin = axisPointerModel.get(["label", "margin"]); + buildLabelElOption(elOption, axisModel, axisPointerModel, api2, { + position: getTransformedPosition(axisModel.axis, value, layoutInfo), + align: textLayout.textAlign, + verticalAlign: textLayout.textVerticalAlign + }); +} +function makeLineShape(p1, p2, xDimIndex) { + xDimIndex = xDimIndex || 0; + return { + x1: p1[xDimIndex], + y1: p1[1 - xDimIndex], + x2: p2[xDimIndex], + y2: p2[1 - xDimIndex] + }; +} +function makeRectShape(xy, wh, xDimIndex) { + xDimIndex = xDimIndex || 0; + return { + x: xy[xDimIndex], + y: xy[1 - xDimIndex], + width: wh[xDimIndex], + height: wh[1 - xDimIndex] + }; +} +function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) { + return { + cx, + cy, + r0, + r, + startAngle, + endAngle, + clockwise: true + }; +} + +// src/component/axisPointer/CartesianAxisPointer.ts +var CartesianAxisPointer = class extends BaseAxisPointer_default { + makeElOption(elOption, value, axisModel, axisPointerModel, api2) { + const axis = axisModel.axis; + const grid = axis.grid; + const axisPointerType = axisPointerModel.get("type"); + const otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); + const pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true)); + if (axisPointerType && axisPointerType !== "none") { + const elStyle = buildElStyle(axisPointerModel); + const pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } + const layoutInfo = layout4(grid.model, axisModel); + buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api2); + } + getHandleTransform(value, axisModel, axisPointerModel) { + const layoutInfo = layout4(axisModel.axis.grid.model, axisModel, { + labelInside: false + }); + layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]); + const pos = getTransformedPosition(axisModel.axis, value, layoutInfo); + return { + x: pos[0], + y: pos[1], + rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) + }; + } + updateHandleTransform(transform2, delta, axisModel, axisPointerModel) { + const axis = axisModel.axis; + const grid = axis.grid; + const axisExtent = axis.getGlobalExtent(true); + const otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); + const dimIndex = axis.dim === "x" ? 0 : 1; + const currPosition = [transform2.x, transform2.y]; + currPosition[dimIndex] += delta[dimIndex]; + currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); + currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); + const cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; + const cursorPoint = [cursorOtherValue, cursorOtherValue]; + cursorPoint[dimIndex] = currPosition[dimIndex]; + const tooltipOptions = [ + {verticalAlign: "middle"}, + {align: "center"} + ]; + return { + x: currPosition[0], + y: currPosition[1], + rotation: transform2.rotation, + cursorPoint, + tooltipOption: tooltipOptions[dimIndex] + }; + } +}; +function getCartesian(grid, axis) { + const opt = {}; + opt[axis.dim + "AxisIndex"] = axis.index; + return grid.getCartesian(opt); +} +var pointerShapeBuilder = { + line: function(axis, pixelValue, otherExtent) { + const targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis)); + return { + type: "Line", + subPixelOptimize: true, + shape: targetShape + }; + }, + shadow: function(axis, pixelValue, otherExtent) { + const bandWidth = Math.max(1, axis.getBandWidth()); + const span = otherExtent[1] - otherExtent[0]; + return { + type: "Rect", + shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis)) + }; + } +}; +function getAxisDimIndex(axis) { + return axis.dim === "x" ? 0 : 1; +} +var CartesianAxisPointer_default = CartesianAxisPointer; + +// src/component/axisPointer/AxisPointerModel.ts +var AxisPointerModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = AxisPointerModel2.type; + } +}; +var AxisPointerModel = AxisPointerModel2; +AxisPointerModel.type = "axisPointer"; +AxisPointerModel.defaultOption = { + show: "auto", + z: 50, + type: "line", + snap: false, + triggerTooltip: true, + triggerEmphasis: true, + value: null, + status: null, + link: [], + animation: null, + animationDurationUpdate: 200, + lineStyle: { + color: "#B9BEC9", + width: 1, + type: "dashed" + }, + shadowStyle: { + color: "rgba(210,219,238,0.2)" + }, + label: { + show: true, + formatter: null, + precision: "auto", + margin: 3, + color: "#fff", + padding: [5, 7, 5, 7], + backgroundColor: "auto", + borderColor: null, + borderWidth: 0, + borderRadius: 3 + }, + handle: { + show: false, + icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z", + size: 45, + margin: 50, + color: "#333", + shadowBlur: 3, + shadowColor: "#aaa", + shadowOffsetX: 0, + shadowOffsetY: 2, + throttle: 40 + } +}; +var AxisPointerModel_default = AxisPointerModel; + +// src/component/axisPointer/globalListener.ts +var inner12 = makeInner(); +var each8 = each; +function register(key, api2, handler) { + if (env_default.node) { + return; + } + const zr = api2.getZr(); + inner12(zr).records || (inner12(zr).records = {}); + initGlobalListeners(zr, api2); + const record = inner12(zr).records[key] || (inner12(zr).records[key] = {}); + record.handler = handler; +} +function initGlobalListeners(zr, api2) { + if (inner12(zr).initialized) { + return; + } + inner12(zr).initialized = true; + useHandler("click", curry(doEnter, "click")); + useHandler("mousemove", curry(doEnter, "mousemove")); + useHandler("globalout", onLeave); + function useHandler(eventType, cb) { + zr.on(eventType, function(e2) { + const dis = makeDispatchAction(api2); + each8(inner12(zr).records, function(record) { + record && cb(record, e2, dis.dispatchAction); + }); + dispatchTooltipFinally(dis.pendings, api2); + }); + } +} +function dispatchTooltipFinally(pendings, api2) { + const showLen = pendings.showTip.length; + const hideLen = pendings.hideTip.length; + let actuallyPayload; + if (showLen) { + actuallyPayload = pendings.showTip[showLen - 1]; + } else if (hideLen) { + actuallyPayload = pendings.hideTip[hideLen - 1]; + } + if (actuallyPayload) { + actuallyPayload.dispatchAction = null; + api2.dispatchAction(actuallyPayload); + } +} +function onLeave(record, e2, dispatchAction3) { + record.handler("leave", null, dispatchAction3); +} +function doEnter(currTrigger, record, e2, dispatchAction3) { + record.handler(currTrigger, e2, dispatchAction3); +} +function makeDispatchAction(api2) { + const pendings = { + showTip: [], + hideTip: [] + }; + const dispatchAction3 = function(payload) { + const pendingList = pendings[payload.type]; + if (pendingList) { + pendingList.push(payload); + } else { + payload.dispatchAction = dispatchAction3; + api2.dispatchAction(payload); + } + }; + return { + dispatchAction: dispatchAction3, + pendings + }; +} +function unregister(key, api2) { + if (env_default.node) { + return; + } + const zr = api2.getZr(); + const record = (inner12(zr).records || {})[key]; + if (record) { + inner12(zr).records[key] = null; + } +} + +// src/component/axisPointer/AxisPointerView.ts +var AxisPointerView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = AxisPointerView2.type; + } + render(globalAxisPointerModel, ecModel, api2) { + const globalTooltipModel = ecModel.getComponent("tooltip"); + const triggerOn = globalAxisPointerModel.get("triggerOn") || (globalTooltipModel && globalTooltipModel.get("triggerOn") || "mousemove|click"); + register("axisPointer", api2, function(currTrigger, e2, dispatchAction3) { + if (triggerOn !== "none" && (currTrigger === "leave" || triggerOn.indexOf(currTrigger) >= 0)) { + dispatchAction3({ + type: "updateAxisPointer", + currTrigger, + x: e2 && e2.offsetX, + y: e2 && e2.offsetY }); + } + }); + } + remove(ecModel, api2) { + unregister("axisPointer", api2); + } + dispose(ecModel, api2) { + unregister("axisPointer", api2); + } +}; +var AxisPointerView = AxisPointerView2; +AxisPointerView.type = "axisPointer"; +var AxisPointerView_default = AxisPointerView; + +// src/component/axisPointer/findPointFromSeries.ts +function findPointFromSeries(finder, ecModel) { + let point = []; + const seriesIndex = finder.seriesIndex; + let seriesModel; + if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) { + return { + point: [] + }; + } + const data = seriesModel.getData(); + const dataIndex = queryDataIndex(data, finder); + if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) { + return {point: []}; + } + const el = data.getItemGraphicEl(dataIndex); + const coordSys = seriesModel.coordinateSystem; + if (seriesModel.getTooltipPosition) { + point = seriesModel.getTooltipPosition(dataIndex) || []; + } else if (coordSys && coordSys.dataToPoint) { + if (finder.isStacked) { + const baseAxis = coordSys.getBaseAxis(); + const valueAxis2 = coordSys.getOtherAxis(baseAxis); + const valueAxisDim = valueAxis2.dim; + const baseAxisDim = baseAxis.dim; + const baseDataOffset = valueAxisDim === "x" || valueAxisDim === "radius" ? 1 : 0; + const baseDim = data.mapDimension(baseAxisDim); + const stackedData = []; + stackedData[baseDataOffset] = data.get(baseDim, dataIndex); + stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo("stackResultDimension"), dataIndex); + point = coordSys.dataToPoint(stackedData) || []; + } else { + point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function(dim) { + return data.mapDimension(dim); + }), dataIndex)) || []; + } + } else if (el) { + const rect = el.getBoundingRect().clone(); + rect.applyTransform(el.transform); + point = [ + rect.x + rect.width / 2, + rect.y + rect.height / 2 + ]; + } + return {point, el}; +} + +// src/component/axisPointer/axisTrigger.ts +var inner13 = makeInner(); +function axisTrigger(payload, ecModel, api2) { + const currTrigger = payload.currTrigger; + let point = [payload.x, payload.y]; + const finder = payload; + const dispatchAction3 = payload.dispatchAction || bind(api2.dispatchAction, api2); + const coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo; + if (!coordSysAxesInfo) { + return; + } + if (illegalPoint(point)) { + point = findPointFromSeries({ + seriesIndex: finder.seriesIndex, + dataIndex: finder.dataIndex + }, ecModel).point; + } + const isIllegalPoint = illegalPoint(point); + const inputAxesInfo = finder.axesInfo; + const axesInfo = coordSysAxesInfo.axesInfo; + const shouldHide = currTrigger === "leave" || illegalPoint(point); + const outputPayload = {}; + const showValueMap = {}; + const dataByCoordSys = { + list: [], + map: {} + }; + const updaters = { + showPointer: curry(showPointer, showValueMap), + showTooltip: curry(showTooltip, dataByCoordSys) + }; + each(coordSysAxesInfo.coordSysMap, function(coordSys, coordSysKey) { + const coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point); + each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function(axisInfo, key) { + const axis = axisInfo.axis; + const inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); + if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) { + let val = inputAxisInfo && inputAxisInfo.value; + if (val == null && !isIllegalPoint) { + val = axis.pointToData(point); + } + val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload); + } + }); + }); + const linkTriggers = {}; + each(axesInfo, function(tarAxisInfo, tarKey) { + const linkGroup = tarAxisInfo.linkGroup; + if (linkGroup && !showValueMap[tarKey]) { + each(linkGroup.axesInfo, function(srcAxisInfo, srcKey) { + const srcValItem = showValueMap[srcKey]; + if (srcAxisInfo !== tarAxisInfo && srcValItem) { + let val = srcValItem.value; + linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo)))); + linkTriggers[tarAxisInfo.key] = val; + } }); - return coordSysRecord; - } - /** - * This action will be throttled. - */ - function dispatchAction$1(api, batch) { - if (!api.isDisposed()) { - api.dispatchAction({ - type: 'dataZoom', - animation: { - easing: 'cubicOut', - duration: 100 - }, - batch: batch - }); + } + }); + each(linkTriggers, function(val, tarKey) { + processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload); + }); + updateModelActually(showValueMap, axesInfo, outputPayload); + dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3); + dispatchHighDownActually(axesInfo, dispatchAction3, api2); + return outputPayload; +} +function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) { + const axis = axisInfo.axis; + if (axis.scale.isBlank() || !axis.containData(newValue)) { + return; + } + if (!axisInfo.involveSeries) { + updaters.showPointer(axisInfo, newValue); + return; + } + const payloadInfo = buildPayloadsBySeries(newValue, axisInfo); + const payloadBatch = payloadInfo.payloadBatch; + const snapToValue = payloadInfo.snapToValue; + if (payloadBatch[0] && outputFinder.seriesIndex == null) { + extend(outputFinder, payloadBatch[0]); + } + if (!noSnap && axisInfo.snap) { + if (axis.containData(snapToValue) && snapToValue != null) { + newValue = snapToValue; + } + } + updaters.showPointer(axisInfo, newValue, payloadBatch); + updaters.showTooltip(axisInfo, payloadInfo, snapToValue); +} +function buildPayloadsBySeries(value, axisInfo) { + const axis = axisInfo.axis; + const dim = axis.dim; + let snapToValue = value; + const payloadBatch = []; + let minDist = Number.MAX_VALUE; + let minDiff = -1; + each(axisInfo.seriesModels, function(series, idx) { + const dataDim = series.getData().mapDimensionsAll(dim); + let seriesNestestValue; + let dataIndices; + if (series.getAxisTooltipData) { + const result = series.getAxisTooltipData(dataDim, value, axis); + dataIndices = result.dataIndices; + seriesNestestValue = result.nestestValue; + } else { + dataIndices = series.getData().indicesOfNearest(dataDim[0], value, axis.type === "category" ? 0.5 : null); + if (!dataIndices.length) { + return; } + seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]); } - function containsPoint(coordSysModel, e, x, y) { - return coordSysModel.coordinateSystem.containPoint([x, y]); - } - /** - * Merge roamController settings when multiple dataZooms share one roamController. - */ - function mergeControllerParams(dataZoomInfoMap) { - var controlType; - // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated - // as string, it is probably revert to reserved word by compress tool. See #7411. - var prefix = 'type_'; - var typePriority = { - 'type_true': 2, - 'type_move': 1, - 'type_false': 0, - 'type_undefined': -1 - }; - var preventDefaultMouseMove = true; - dataZoomInfoMap.each(function (dataZoomInfo) { - var dataZoomModel = dataZoomInfo.model; - var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true; - if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { - controlType = oneType; - } - // Prevent default move event by default. If one false, do not prevent. Otherwise - // users may be confused why it does not work when multiple insideZooms exist. - preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true); - }); - return { - controlType: controlType, - opt: { - // RoamController will enable all of these functionalities, - // and the final behavior is determined by its event listener - // provided by each inside zoom. - zoomOnMouseWheel: true, - moveOnMouseMove: true, - moveOnMouseWheel: true, - preventDefaultMouseMove: !!preventDefaultMouseMove - } - }; + if (seriesNestestValue == null || !isFinite(seriesNestestValue)) { + return; } - function installDataZoomRoamProcessor(registers) { - registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) { - var apiInner = inner$k(api); - var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap()); - coordSysRecordMap.each(function (coordSysRecord) { - // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should - // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow. - coordSysRecord.dataZoomInfoMap = null; - }); - ecModel.eachComponent({ - mainType: 'dataZoom', - subType: 'inside' - }, function (dataZoomModel) { - var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel); - each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) { - var coordSysUid = dzCoordSysInfo.model.uid; - var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model)); - var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap()); - // Notice these props might be changed each time for a single dataZoomModel. - dataZoomInfoMap.set(dataZoomModel.uid, { - dzReferCoordSysInfo: dzCoordSysInfo, - model: dataZoomModel, - getRange: null - }); - }); - }); - // (1) Merge dataZoom settings for each coord sys and set to the roam controller. - // (2) Clear coord sys if not refered by any dataZoom. - coordSysRecordMap.each(function (coordSysRecord) { - var controller = coordSysRecord.controller; - var firstDzInfo; - var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; - if (dataZoomInfoMap) { - var firstDzKey = dataZoomInfoMap.keys()[0]; - if (firstDzKey != null) { - firstDzInfo = dataZoomInfoMap.get(firstDzKey); - } - } - if (!firstDzInfo) { - disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); - return; - } - var controllerParams = mergeControllerParams(dataZoomInfoMap); - controller.enable(controllerParams.controlType, controllerParams.opt); - controller.setPointerChecker(coordSysRecord.containsPoint); - createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate'); + const diff = value - seriesNestestValue; + const dist3 = Math.abs(diff); + if (dist3 <= minDist) { + if (dist3 < minDist || diff >= 0 && minDiff < 0) { + minDist = dist3; + minDiff = diff; + snapToValue = seriesNestestValue; + payloadBatch.length = 0; + } + each(dataIndices, function(dataIndex) { + payloadBatch.push({ + seriesIndex: series.seriesIndex, + dataIndexInside: dataIndex, + dataIndex: series.getData().getRawIndex(dataIndex) }); }); } - - var InsideZoomView = /** @class */function (_super) { - __extends(InsideZoomView, _super); - function InsideZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'dataZoom.inside'; - return _this; + }); + return { + payloadBatch, + snapToValue + }; +} +function showPointer(showValueMap, axisInfo, value, payloadBatch) { + showValueMap[axisInfo.key] = { + value, + payloadBatch + }; +} +function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) { + const payloadBatch = payloadInfo.payloadBatch; + const axis = axisInfo.axis; + const axisModel = axis.model; + const axisPointerModel = axisInfo.axisPointerModel; + if (!axisInfo.triggerTooltip || !payloadBatch.length) { + return; + } + const coordSysModel = axisInfo.coordSys.model; + const coordSysKey = makeKey(coordSysModel); + let coordSysItem = dataByCoordSys.map[coordSysKey]; + if (!coordSysItem) { + coordSysItem = dataByCoordSys.map[coordSysKey] = { + coordSysId: coordSysModel.id, + coordSysIndex: coordSysModel.componentIndex, + coordSysType: coordSysModel.type, + coordSysMainType: coordSysModel.mainType, + dataByAxis: [] + }; + dataByCoordSys.list.push(coordSysItem); + } + coordSysItem.dataByAxis.push({ + axisDim: axis.dim, + axisIndex: axisModel.componentIndex, + axisType: axisModel.type, + axisId: axisModel.id, + value, + valueLabelOpt: { + precision: axisPointerModel.get(["label", "precision"]), + formatter: axisPointerModel.get(["label", "formatter"]) + }, + seriesDataIndices: payloadBatch.slice() + }); +} +function updateModelActually(showValueMap, axesInfo, outputPayload) { + const outputAxesInfo = outputPayload.axesInfo = []; + each(axesInfo, function(axisInfo, key) { + const option = axisInfo.axisPointerModel.option; + const valItem = showValueMap[key]; + if (valItem) { + !axisInfo.useHandle && (option.status = "show"); + option.value = valItem.value; + option.seriesDataIndices = (valItem.payloadBatch || []).slice(); + } else { + !axisInfo.useHandle && (option.status = "hide"); + } + option.status === "show" && outputAxesInfo.push({ + axisDim: axisInfo.axis.dim, + axisIndex: axisInfo.axis.model.componentIndex, + value: option.value + }); + }); +} +function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3) { + if (illegalPoint(point) || !dataByCoordSys.list.length) { + dispatchAction3({type: "hideTip"}); + return; + } + const sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {}; + dispatchAction3({ + type: "showTip", + escapeConnect: true, + x: point[0], + y: point[1], + tooltipOption: payload.tooltipOption, + position: payload.position, + dataIndexInside: sampleItem.dataIndexInside, + dataIndex: sampleItem.dataIndex, + seriesIndex: sampleItem.seriesIndex, + dataByCoordSys: dataByCoordSys.list + }); +} +function dispatchHighDownActually(axesInfo, dispatchAction3, api2) { + const zr = api2.getZr(); + const highDownKey = "axisPointerLastHighlights"; + const lastHighlights = inner13(zr)[highDownKey] || {}; + const newHighlights = inner13(zr)[highDownKey] = {}; + each(axesInfo, function(axisInfo, key) { + const option = axisInfo.axisPointerModel.option; + option.status === "show" && axisInfo.triggerEmphasis && each(option.seriesDataIndices, function(batchItem) { + const key2 = batchItem.seriesIndex + " | " + batchItem.dataIndex; + newHighlights[key2] = batchItem; + }); + }); + const toHighlight = []; + const toDownplay = []; + each(lastHighlights, function(batchItem, key) { + !newHighlights[key] && toDownplay.push(batchItem); + }); + each(newHighlights, function(batchItem, key) { + !lastHighlights[key] && toHighlight.push(batchItem); + }); + toDownplay.length && api2.dispatchAction({ + type: "downplay", + escapeConnect: true, + notBlur: true, + batch: toDownplay + }); + toHighlight.length && api2.dispatchAction({ + type: "highlight", + escapeConnect: true, + notBlur: true, + batch: toHighlight + }); +} +function findInputAxisInfo(inputAxesInfo, axisInfo) { + for (let i = 0; i < (inputAxesInfo || []).length; i++) { + const inputAxisInfo = inputAxesInfo[i]; + if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) { + return inputAxisInfo; + } + } +} +function makeMapperParam(axisInfo) { + const axisModel = axisInfo.axis.model; + const item = {}; + const dim = item.axisDim = axisInfo.axis.dim; + item.axisIndex = item[dim + "AxisIndex"] = axisModel.componentIndex; + item.axisName = item[dim + "AxisName"] = axisModel.name; + item.axisId = item[dim + "AxisId"] = axisModel.id; + return item; +} +function illegalPoint(point) { + return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]); +} + +// src/component/axisPointer/install.ts +function install29(registers) { + AxisView_default.registerAxisPointerClass("CartesianAxisPointer", CartesianAxisPointer_default); + registers.registerComponentModel(AxisPointerModel_default); + registers.registerComponentView(AxisPointerView_default); + registers.registerPreprocessor(function(option) { + if (option) { + (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {}); + const link = option.axisPointer.link; + if (link && !isArray(link)) { + option.axisPointer.link = [link]; + } + } + }); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function(ecModel, api2) { + ecModel.getComponent("axisPointer").coordSysAxesInfo = collect(ecModel, api2); + }); + registers.registerAction({ + type: "updateAxisPointer", + event: "updateAxisPointer", + update: ":updateAxisPointer" + }, axisTrigger); +} + +// src/component/grid/install.ts +function install30(registers) { + use(install6); + use(install29); +} + +// src/component/axisPointer/PolarAxisPointer.ts +var PolarAxisPointer = class extends BaseAxisPointer_default { + makeElOption(elOption, value, axisModel, axisPointerModel, api2) { + const axis = axisModel.axis; + if (axis.dim === "angle") { + this.animationThreshold = Math.PI / 18; + } + const polar = axis.polar; + const otherAxis = polar.getOtherAxis(axis); + const otherExtent = otherAxis.getExtent(); + const coordValue = axis.dataToCoord(value); + const axisPointerType = axisPointerModel.get("type"); + if (axisPointerType && axisPointerType !== "none") { + const elStyle = buildElStyle(axisPointerModel); + const pointerOption = pointerShapeBuilder2[axisPointerType](axis, polar, coordValue, otherExtent); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } + const labelMargin = axisPointerModel.get(["label", "margin"]); + const labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); + buildLabelElOption(elOption, axisModel, axisPointerModel, api2, labelPos); + } +}; +function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) { + const axis = axisModel.axis; + const coord = axis.dataToCoord(value); + let axisAngle = polar.getAngleAxis().getExtent()[0]; + axisAngle = axisAngle / 180 * Math.PI; + const radiusExtent = polar.getRadiusAxis().getExtent(); + let position2; + let align; + let verticalAlign; + if (axis.dim === "radius") { + const transform2 = create2(); + rotate(transform2, transform2, axisAngle); + translate(transform2, transform2, [polar.cx, polar.cy]); + position2 = applyTransform2([coord, -labelMargin], transform2); + const labelRotation = axisModel.getModel("axisLabel").get("rotate") || 0; + const labelLayout2 = AxisBuilder_default.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1); + align = labelLayout2.textAlign; + verticalAlign = labelLayout2.textVerticalAlign; + } else { + const r = radiusExtent[1]; + position2 = polar.coordToPoint([r + labelMargin, coord]); + const cx = polar.cx; + const cy = polar.cy; + align = Math.abs(position2[0] - cx) / r < 0.3 ? "center" : position2[0] > cx ? "left" : "right"; + verticalAlign = Math.abs(position2[1] - cy) / r < 0.3 ? "middle" : position2[1] > cy ? "top" : "bottom"; + } + return { + position: position2, + align, + verticalAlign + }; +} +var pointerShapeBuilder2 = { + line: function(axis, polar, coordValue, otherExtent) { + return axis.dim === "angle" ? { + type: "Line", + shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue])) + } : { + type: "Circle", + shape: { + cx: polar.cx, + cy: polar.cy, + r: coordValue } - InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) { - _super.prototype.render.apply(this, arguments); - if (dataZoomModel.noTarget()) { - this._clear(); - return; - } - // Hence the `throttle` util ensures to preserve command order, - // here simply updating range all the time will not cause missing - // any of the the roam change. - this.range = dataZoomModel.getPercentRange(); - // Reset controllers. - setViewInfoToCoordSysRecord(api, dataZoomModel, { - pan: bind(getRangeHandlers.pan, this), - zoom: bind(getRangeHandlers.zoom, this), - scrollMove: bind(getRangeHandlers.scrollMove, this) - }); - }; - InsideZoomView.prototype.dispose = function () { - this._clear(); - _super.prototype.dispose.apply(this, arguments); - }; - InsideZoomView.prototype._clear = function () { - disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel); - this.range = null; - }; - InsideZoomView.type = 'dataZoom.inside'; - return InsideZoomView; - }(DataZoomView); - var getRangeHandlers = { - zoom: function (coordSysInfo, coordSysMainType, controller, e) { - var lastRange = this.range; - var range = lastRange.slice(); - // Calculate transform by the first axis. - var axisModel = coordSysInfo.axisModels[0]; - if (!axisModel) { - return; - } - var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo); - var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; - var scale = Math.max(1 / e.scale, 0); - range[0] = (range[0] - percentPoint) * scale + percentPoint; - range[1] = (range[1] - percentPoint) * scale + percentPoint; - // Restrict range. - var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); - sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); - this.range = range; - if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { - return range; - } - }, - pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) { - var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo); - return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength; - }), - scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) { - var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo); - return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta; - }) }; - function makeMover(getPercentDelta) { - return function (coordSysInfo, coordSysMainType, controller, e) { - var lastRange = this.range; - var range = lastRange.slice(); - // Calculate transform by the first axis. - var axisModel = coordSysInfo.axisModels[0]; - if (!axisModel) { - return; - } - var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e); - sliderMove(percentDelta, range, [0, 100], 'all'); - this.range = range; - if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { - return range; - } - }; + }, + shadow: function(axis, polar, coordValue, otherExtent) { + const bandWidth = Math.max(1, axis.getBandWidth()); + const radian = Math.PI / 180; + return axis.dim === "angle" ? { + type: "Sector", + shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian) + } : { + type: "Sector", + shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2) + }; + } +}; +var PolarAxisPointer_default = PolarAxisPointer; + +// src/coord/polar/PolarModel.ts +var PolarModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = PolarModel2.type; + } + findAxisModel(axisType) { + let foundAxisModel; + const ecModel = this.ecModel; + ecModel.eachComponent(axisType, function(axisModel) { + if (axisModel.getCoordSysModel() === this) { + foundAxisModel = axisModel; + } + }, this); + return foundAxisModel; + } +}; +var PolarModel = PolarModel2; +PolarModel.type = "polar"; +PolarModel.dependencies = ["radiusAxis", "angleAxis"]; +PolarModel.defaultOption = { + z: 0, + center: ["50%", "50%"], + radius: "80%" +}; +var PolarModel_default = PolarModel; + +// src/coord/polar/AxisModel.ts +var PolarAxisModel = class extends Component_default { + getCoordSysModel() { + return this.getReferringComponents("polar", SINGLE_REFERRING).models[0]; + } +}; +PolarAxisModel.type = "polarAxis"; +mixin(PolarAxisModel, AxisModelCommonMixin); +var AngleAxisModel2 = class extends PolarAxisModel { + constructor() { + super(...arguments); + this.type = AngleAxisModel2.type; + } +}; +var AngleAxisModel = AngleAxisModel2; +AngleAxisModel.type = "angleAxis"; +var RadiusAxisModel2 = class extends PolarAxisModel { + constructor() { + super(...arguments); + this.type = RadiusAxisModel2.type; + } +}; +var RadiusAxisModel = RadiusAxisModel2; +RadiusAxisModel.type = "radiusAxis"; + +// src/coord/polar/RadiusAxis.ts +var RadiusAxis = class extends Axis_default { + constructor(scale4, radiusExtent) { + super("radius", scale4, radiusExtent); + } + pointToData(point, clamp2) { + return this.polar.pointToData(point, clamp2)[this.dim === "radius" ? 0 : 1]; + } +}; +RadiusAxis.prototype.dataToRadius = Axis_default.prototype.dataToCoord; +RadiusAxis.prototype.radiusToData = Axis_default.prototype.coordToData; +var RadiusAxis_default = RadiusAxis; + +// src/coord/polar/AngleAxis.ts +var inner14 = makeInner(); +var AngleAxis = class extends Axis_default { + constructor(scale4, angleExtent) { + super("angle", scale4, angleExtent || [0, 360]); + } + pointToData(point, clamp2) { + return this.polar.pointToData(point, clamp2)[this.dim === "radius" ? 0 : 1]; + } + calculateCategoryInterval() { + const axis = this; + const labelModel = axis.getLabelModel(); + const ordinalScale = axis.scale; + const ordinalExtent = ordinalScale.getExtent(); + const tickCount = ordinalScale.count(); + if (ordinalExtent[1] - ordinalExtent[0] < 1) { + return 0; } - var getDirectionInfo = { - grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { - var axis = axisModel.axis; - var ret = {}; - var rect = coordSysInfo.model.coordinateSystem.getRect(); - oldPoint = oldPoint || [0, 0]; - if (axis.dim === 'x') { - ret.pixel = newPoint[0] - oldPoint[0]; - ret.pixelLength = rect.width; - ret.pixelStart = rect.x; - ret.signal = axis.inverse ? 1 : -1; - } else { - // axis.dim === 'y' - ret.pixel = newPoint[1] - oldPoint[1]; - ret.pixelLength = rect.height; - ret.pixelStart = rect.y; - ret.signal = axis.inverse ? -1 : 1; - } - return ret; - }, - polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { - var axis = axisModel.axis; - var ret = {}; - var polar = coordSysInfo.model.coordinateSystem; - var radiusExtent = polar.getRadiusAxis().getExtent(); - var angleExtent = polar.getAngleAxis().getExtent(); - oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; - newPoint = polar.pointToCoord(newPoint); - if (axisModel.mainType === 'radiusAxis') { - ret.pixel = newPoint[0] - oldPoint[0]; - // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]); - // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]); - ret.pixelLength = radiusExtent[1] - radiusExtent[0]; - ret.pixelStart = radiusExtent[0]; - ret.signal = axis.inverse ? 1 : -1; - } else { - // 'angleAxis' - ret.pixel = newPoint[1] - oldPoint[1]; - // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]); - // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]); - ret.pixelLength = angleExtent[1] - angleExtent[0]; - ret.pixelStart = angleExtent[0]; - ret.signal = axis.inverse ? -1 : 1; - } - return ret; - }, - singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { - var axis = axisModel.axis; - var rect = coordSysInfo.model.coordinateSystem.getRect(); - var ret = {}; - oldPoint = oldPoint || [0, 0]; - if (axis.orient === 'horizontal') { - ret.pixel = newPoint[0] - oldPoint[0]; - ret.pixelLength = rect.width; - ret.pixelStart = rect.x; - ret.signal = axis.inverse ? 1 : -1; - } else { - // 'vertical' - ret.pixel = newPoint[1] - oldPoint[1]; - ret.pixelLength = rect.height; - ret.pixelStart = rect.y; - ret.signal = axis.inverse ? -1 : 1; - } - return ret; + const tickValue = ordinalExtent[0]; + const unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); + const unitH = Math.abs(unitSpan); + const rect = getBoundingRect(tickValue == null ? "" : tickValue + "", labelModel.getFont(), "center", "top"); + const maxH = Math.max(rect.height, 7); + let dh = maxH / unitH; + isNaN(dh) && (dh = Infinity); + let interval = Math.max(0, Math.floor(dh)); + const cache = inner14(axis.model); + const lastAutoInterval = cache.lastAutoInterval; + const lastTickCount = cache.lastTickCount; + if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 && lastAutoInterval > interval) { + interval = lastAutoInterval; + } else { + cache.lastTickCount = tickCount; + cache.lastAutoInterval = interval; + } + return interval; + } +}; +AngleAxis.prototype.dataToAngle = Axis_default.prototype.dataToCoord; +AngleAxis.prototype.angleToData = Axis_default.prototype.coordToData; +var AngleAxis_default = AngleAxis; + +// src/coord/polar/Polar.ts +var polarDimensions = ["radius", "angle"]; +var Polar = class { + constructor(name) { + this.dimensions = polarDimensions; + this.type = "polar"; + this.cx = 0; + this.cy = 0; + this._radiusAxis = new RadiusAxis_default(); + this._angleAxis = new AngleAxis_default(); + this.axisPointerEnabled = true; + this.name = name || ""; + this._radiusAxis.polar = this._angleAxis.polar = this; + } + containPoint(point) { + const coord = this.pointToCoord(point); + return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]); + } + containData(data) { + return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]); + } + getAxis(dim) { + const key = "_" + dim + "Axis"; + return this[key]; + } + getAxes() { + return [this._radiusAxis, this._angleAxis]; + } + getAxesByScale(scaleType) { + const axes = []; + const angleAxis = this._angleAxis; + const radiusAxis = this._radiusAxis; + angleAxis.scale.type === scaleType && axes.push(angleAxis); + radiusAxis.scale.type === scaleType && axes.push(radiusAxis); + return axes; + } + getAngleAxis() { + return this._angleAxis; + } + getRadiusAxis() { + return this._radiusAxis; + } + getOtherAxis(axis) { + const angleAxis = this._angleAxis; + return axis === angleAxis ? this._radiusAxis : angleAxis; + } + getBaseAxis() { + return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis(); + } + getTooltipAxes(dim) { + const baseAxis = dim != null && dim !== "auto" ? this.getAxis(dim) : this.getBaseAxis(); + return { + baseAxes: [baseAxis], + otherAxes: [this.getOtherAxis(baseAxis)] + }; + } + dataToPoint(data, clamp2) { + return this.coordToPoint([ + this._radiusAxis.dataToRadius(data[0], clamp2), + this._angleAxis.dataToAngle(data[1], clamp2) + ]); + } + pointToData(point, clamp2) { + const coord = this.pointToCoord(point); + return [ + this._radiusAxis.radiusToData(coord[0], clamp2), + this._angleAxis.angleToData(coord[1], clamp2) + ]; + } + pointToCoord(point) { + let dx = point[0] - this.cx; + let dy = point[1] - this.cy; + const angleAxis = this.getAngleAxis(); + const extent3 = angleAxis.getExtent(); + let minAngle = Math.min(extent3[0], extent3[1]); + let maxAngle = Math.max(extent3[0], extent3[1]); + angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360; + const radius = Math.sqrt(dx * dx + dy * dy); + dx /= radius; + dy /= radius; + let radian = Math.atan2(-dy, dx) / Math.PI * 180; + const dir3 = radian < minAngle ? 1 : -1; + while (radian < minAngle || radian > maxAngle) { + radian += dir3 * 360; + } + return [radius, radian]; + } + coordToPoint(coord) { + const radius = coord[0]; + const radian = coord[1] / 180 * Math.PI; + const x = Math.cos(radian) * radius + this.cx; + const y = -Math.sin(radian) * radius + this.cy; + return [x, y]; + } + getArea() { + const angleAxis = this.getAngleAxis(); + const radiusAxis = this.getRadiusAxis(); + const radiusExtent = radiusAxis.getExtent().slice(); + radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); + const angleExtent = angleAxis.getExtent(); + const RADIAN4 = Math.PI / 180; + const EPSILON6 = 1e-4; + return { + cx: this.cx, + cy: this.cy, + r0: radiusExtent[0], + r: radiusExtent[1], + startAngle: -angleExtent[0] * RADIAN4, + endAngle: -angleExtent[1] * RADIAN4, + clockwise: angleAxis.inverse, + contain(x, y) { + const dx = x - this.cx; + const dy = y - this.cy; + const d2 = dx * dx + dy * dy; + const r = this.r; + const r0 = this.r0; + return r !== r0 && d2 - EPSILON6 <= r * r && d2 + EPSILON6 >= r0 * r0; } }; - - function install$K(registers) { - installCommon(registers); - registers.registerComponentModel(InsideZoomModel); - registers.registerComponentView(InsideZoomView); - installDataZoomRoamProcessor(registers); - } - - var SliderZoomModel = /** @class */function (_super) { - __extends(SliderZoomModel, _super); - function SliderZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SliderZoomModel.type; - return _this; - } - SliderZoomModel.type = 'dataZoom.slider'; - SliderZoomModel.layoutMode = 'box'; - SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, { - show: true, - // deault value can only be drived in view stage. - right: 'ph', - top: 'ph', - width: 'ph', - height: 'ph', - left: null, - bottom: null, - borderColor: '#d2dbee', - borderRadius: 3, - backgroundColor: 'rgba(47,69,84,0)', - // dataBackgroundColor: '#ddd', - dataBackground: { - lineStyle: { - color: '#d2dbee', - width: 0.5 - }, - areaStyle: { - color: '#d2dbee', - opacity: 0.2 - } - }, - selectedDataBackground: { - lineStyle: { - color: '#8fb0f7', - width: 0.5 - }, - areaStyle: { - color: '#8fb0f7', - opacity: 0.2 + } + convertToPixel(ecModel, finder, value) { + const coordSys = getCoordSys3(finder); + return coordSys === this ? this.dataToPoint(value) : null; + } + convertFromPixel(ecModel, finder, pixel) { + const coordSys = getCoordSys3(finder); + return coordSys === this ? this.pointToData(pixel) : null; + } +}; +function getCoordSys3(finder) { + const seriesModel = finder.seriesModel; + const polarModel = finder.polarModel; + return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; +} +var Polar_default = Polar; + +// src/coord/polar/polarCreator.ts +function resizePolar(polar, polarModel, api2) { + const center3 = polarModel.get("center"); + const width = api2.getWidth(); + const height = api2.getHeight(); + polar.cx = parsePercent2(center3[0], width); + polar.cy = parsePercent2(center3[1], height); + const radiusAxis = polar.getRadiusAxis(); + const size = Math.min(width, height) / 2; + let radius = polarModel.get("radius"); + if (radius == null) { + radius = [0, "100%"]; + } else if (!isArray(radius)) { + radius = [0, radius]; + } + const parsedRadius = [ + parsePercent2(radius[0], size), + parsePercent2(radius[1], size) + ]; + radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]); +} +function updatePolarScale(ecModel, api2) { + const polar = this; + const angleAxis = polar.getAngleAxis(); + const radiusAxis = polar.getRadiusAxis(); + angleAxis.scale.setExtent(Infinity, -Infinity); + radiusAxis.scale.setExtent(Infinity, -Infinity); + ecModel.eachSeries(function(seriesModel) { + if (seriesModel.coordinateSystem === polar) { + const data = seriesModel.getData(); + each(getDataDimensionsOnAxis(data, "radius"), function(dim) { + radiusAxis.scale.unionExtentFromData(data, dim); + }); + each(getDataDimensionsOnAxis(data, "angle"), function(dim) { + angleAxis.scale.unionExtentFromData(data, dim); + }); + } + }); + niceScaleExtent(angleAxis.scale, angleAxis.model); + niceScaleExtent(radiusAxis.scale, radiusAxis.model); + if (angleAxis.type === "category" && !angleAxis.onBand) { + const extent3 = angleAxis.getExtent(); + const diff = 360 / angleAxis.scale.count(); + angleAxis.inverse ? extent3[1] += diff : extent3[1] -= diff; + angleAxis.setExtent(extent3[0], extent3[1]); + } +} +function isAngleAxisModel(axisModel) { + return axisModel.mainType === "angleAxis"; +} +function setAxis(axis, axisModel) { + axis.type = axisModel.get("type"); + axis.scale = createScaleByModel(axisModel); + axis.onBand = axisModel.get("boundaryGap") && axis.type === "category"; + axis.inverse = axisModel.get("inverse"); + if (isAngleAxisModel(axisModel)) { + axis.inverse = axis.inverse !== axisModel.get("clockwise"); + const startAngle = axisModel.get("startAngle"); + const endAngle = axisModel.get("endAngle") ?? startAngle + (axis.inverse ? -360 : 360); + axis.setExtent(startAngle, endAngle); + } + axisModel.axis = axis; + axis.model = axisModel; +} +var polarCreator = { + dimensions: polarDimensions, + create: function(ecModel, api2) { + const polarList = []; + ecModel.eachComponent("polar", function(polarModel, idx) { + const polar = new Polar_default(idx + ""); + polar.update = updatePolarScale; + const radiusAxis = polar.getRadiusAxis(); + const angleAxis = polar.getAngleAxis(); + const radiusAxisModel = polarModel.findAxisModel("radiusAxis"); + const angleAxisModel = polarModel.findAxisModel("angleAxis"); + setAxis(radiusAxis, radiusAxisModel); + setAxis(angleAxis, angleAxisModel); + resizePolar(polar, polarModel, api2); + polarList.push(polar); + polarModel.coordinateSystem = polar; + polar.model = polarModel; + }); + ecModel.eachSeries(function(seriesModel) { + if (seriesModel.get("coordinateSystem") === "polar") { + const polarModel = seriesModel.getReferringComponents("polar", SINGLE_REFERRING).models[0]; + if (true) { + if (!polarModel) { + throw new Error('Polar "' + retrieve(seriesModel.get("polarIndex"), seriesModel.get("polarId"), 0) + '" not found'); } + } + seriesModel.coordinateSystem = polarModel.coordinateSystem; + } + }); + return polarList; + } +}; +var polarCreator_default = polarCreator; + +// src/component/axis/AngleAxisView.ts +var elementList2 = [ + "axisLine", + "axisLabel", + "axisTick", + "minorTick", + "splitLine", + "minorSplitLine", + "splitArea" +]; +function getAxisLineShape(polar, rExtent, angle) { + rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse()); + const start2 = polar.coordToPoint([rExtent[0], angle]); + const end2 = polar.coordToPoint([rExtent[1], angle]); + return { + x1: start2[0], + y1: start2[1], + x2: end2[0], + y2: end2[1] + }; +} +function getRadiusIdx(polar) { + const radiusAxis = polar.getRadiusAxis(); + return radiusAxis.inverse ? 0 : 1; +} +function fixAngleOverlap(list) { + const firstItem = list[0]; + const lastItem = list[list.length - 1]; + if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) { + list.pop(); + } +} +var AngleAxisView2 = class extends AxisView_default { + constructor() { + super(...arguments); + this.type = AngleAxisView2.type; + this.axisPointerClass = "PolarAxisPointer"; + } + render(angleAxisModel, ecModel) { + this.group.removeAll(); + if (!angleAxisModel.get("show")) { + return; + } + const angleAxis = angleAxisModel.axis; + const polar = angleAxis.polar; + const radiusExtent = polar.getRadiusAxis().getExtent(); + const ticksAngles = angleAxis.getTicksCoords(); + const minorTickAngles = angleAxis.getMinorTicksCoords(); + const labels = map(angleAxis.getViewLabels(), function(labelItem) { + labelItem = clone(labelItem); + const scale4 = angleAxis.scale; + const tickValue = scale4.type === "ordinal" ? scale4.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; + labelItem.coord = angleAxis.dataToCoord(tickValue); + return labelItem; + }); + fixAngleOverlap(labels); + fixAngleOverlap(ticksAngles); + each(elementList2, function(name) { + if (angleAxisModel.get([name, "show"]) && (!angleAxis.scale.isBlank() || name === "axisLine")) { + angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels); + } + }, this); + } +}; +var AngleAxisView = AngleAxisView2; +AngleAxisView.type = "angleAxis"; +var angelAxisElementsBuilders = { + axisLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + const lineStyleModel = angleAxisModel.getModel(["axisLine", "lineStyle"]); + const angleAxis = polar.getAngleAxis(); + const RADIAN4 = Math.PI / 180; + const angleExtent = angleAxis.getExtent(); + const rId = getRadiusIdx(polar); + const r0Id = rId ? 0 : 1; + let shape; + const shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? "Circle" : "Arc"; + if (radiusExtent[r0Id] === 0) { + shape = new graphic_exports[shapeType]({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: radiusExtent[rId], + startAngle: -angleExtent[0] * RADIAN4, + endAngle: -angleExtent[1] * RADIAN4, + clockwise: angleAxis.inverse }, - // Color of selected window. - fillerColor: 'rgba(135,175,274,0.2)', - handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z', - // Percent of the slider height - handleSize: '100%', - handleStyle: { - color: '#fff', - borderColor: '#ACB8D1' - }, - moveHandleSize: 7, - moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z', - moveHandleStyle: { - color: '#D2DBEE', - opacity: 0.7 - }, - showDetail: true, - showDataShadow: 'auto', - realtime: true, - zoomLock: false, - textStyle: { - color: '#6E7079' - }, - brushSelect: true, - brushStyle: { - color: 'rgba(135,175,274,0.15)' + style: lineStyleModel.getLineStyle(), + z2: 1, + silent: true + }); + } else { + shape = new Ring_default({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: radiusExtent[rId], + r0: radiusExtent[r0Id] }, - emphasis: { - handleStyle: { - borderColor: '#8FB0F7' - }, - moveHandleStyle: { - color: '#8FB0F7' - } - } + style: lineStyleModel.getLineStyle(), + z2: 1, + silent: true }); - return SliderZoomModel; - }(DataZoomModel); - - var Rect$2 = Rect; - // Constants - var DEFAULT_LOCATION_EDGE_GAP = 7; - var DEFAULT_FRAME_BORDER_WIDTH = 1; - var DEFAULT_FILLER_SIZE = 30; - var DEFAULT_MOVE_HANDLE_SIZE = 7; - var HORIZONTAL = 'horizontal'; - var VERTICAL = 'vertical'; - var LABEL_GAP = 5; - var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter']; - var REALTIME_ANIMATION_CONFIG = { - easing: 'cubicOut', - duration: 100, - delay: 0 - }; - var SliderZoomView = /** @class */function (_super) { - __extends(SliderZoomView, _super); - function SliderZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SliderZoomView.type; - _this._displayables = {}; - return _this; - } - SliderZoomView.prototype.init = function (ecModel, api) { - this.api = api; - // A unique handler for each dataZoom component - this._onBrush = bind(this._onBrush, this); - this._onBrushEnd = bind(this._onBrushEnd, this); - }; - SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) { - _super.prototype.render.apply(this, arguments); - createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate'); - this._orient = dataZoomModel.getOrient(); - if (dataZoomModel.get('show') === false) { - this.group.removeAll(); - return; - } - if (dataZoomModel.noTarget()) { - this._clear(); - this.group.removeAll(); - return; - } - // Notice: this._resetInterval() should not be executed when payload.type - // is 'dataZoom', origin this._range should be maintained, otherwise 'pan' - // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction, - if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) { - this._buildView(); - } - this._updateView(); - }; - SliderZoomView.prototype.dispose = function () { - this._clear(); - _super.prototype.dispose.apply(this, arguments); - }; - SliderZoomView.prototype._clear = function () { - clear(this, '_dispatchZoomAction'); - var zr = this.api.getZr(); - zr.off('mousemove', this._onBrush); - zr.off('mouseup', this._onBrushEnd); - }; - SliderZoomView.prototype._buildView = function () { - var thisGroup = this.group; - thisGroup.removeAll(); - this._brushing = false; - this._displayables.brushRect = null; - this._resetLocation(); - this._resetInterval(); - var barGroup = this._displayables.sliderGroup = new Group(); - this._renderBackground(); - this._renderHandle(); - this._renderDataShadow(); - thisGroup.add(barGroup); - this._positionGroup(); - }; - SliderZoomView.prototype._resetLocation = function () { - var dataZoomModel = this.dataZoomModel; - var api = this.api; - var showMoveHandle = dataZoomModel.get('brushSelect'); - var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0; - // If some of x/y/width/height are not specified, - // auto-adapt according to target grid. - var coordRect = this._findCoordRect(); - var ecSize = { - width: api.getWidth(), - height: api.getHeight() - }; - // Default align by coordinate system rect. - var positionInfo = this._orient === HORIZONTAL ? { - // Why using 'right', because right should be used in vertical, - // and it is better to be consistent for dealing with position param merge. - right: ecSize.width - coordRect.x - coordRect.width, - top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize, - width: coordRect.width, - height: DEFAULT_FILLER_SIZE - } : { - right: DEFAULT_LOCATION_EDGE_GAP, - top: coordRect.y, - width: DEFAULT_FILLER_SIZE, - height: coordRect.height - }; - // Do not write back to option and replace value 'ph', because - // the 'ph' value should be recalculated when resize. - var layoutParams = getLayoutParams(dataZoomModel.option); - // Replace the placeholder value. - each(['right', 'top', 'width', 'height'], function (name) { - if (layoutParams[name] === 'ph') { - layoutParams[name] = positionInfo[name]; - } - }); - var layoutRect = getLayoutRect(layoutParams, ecSize); - this._location = { - x: layoutRect.x, - y: layoutRect.y - }; - this._size = [layoutRect.width, layoutRect.height]; - this._orient === VERTICAL && this._size.reverse(); - }; - SliderZoomView.prototype._positionGroup = function () { - var thisGroup = this.group; - var location = this._location; - var orient = this._orient; - // Just use the first axis to determine mapping. - var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel(); - var inverse = targetAxisModel && targetAxisModel.get('inverse'); - var sliderGroup = this._displayables.sliderGroup; - var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; - // Transform barGroup. - sliderGroup.attr(orient === HORIZONTAL && !inverse ? { - scaleY: otherAxisInverse ? 1 : -1, - scaleX: 1 - } : orient === HORIZONTAL && inverse ? { - scaleY: otherAxisInverse ? 1 : -1, - scaleX: -1 - } : orient === VERTICAL && !inverse ? { - scaleY: otherAxisInverse ? -1 : 1, - scaleX: 1, - rotation: Math.PI / 2 - } - // Don't use Math.PI, considering shadow direction. - : { - scaleY: otherAxisInverse ? -1 : 1, - scaleX: -1, - rotation: Math.PI / 2 - }); - // Position barGroup - var rect = thisGroup.getBoundingRect([sliderGroup]); - thisGroup.x = location.x - rect.x; - thisGroup.y = location.y - rect.y; - thisGroup.markRedraw(); - }; - SliderZoomView.prototype._getViewExtent = function () { - return [0, this._size[0]]; - }; - SliderZoomView.prototype._renderBackground = function () { - var dataZoomModel = this.dataZoomModel; - var size = this._size; - var barGroup = this._displayables.sliderGroup; - var brushSelect = dataZoomModel.get('brushSelect'); - barGroup.add(new Rect$2({ - silent: true, - shape: { - x: 0, - y: 0, - width: size[0], - height: size[1] - }, - style: { - fill: dataZoomModel.get('backgroundColor') - }, - z2: -40 - })); - // Click panel, over shadow, below handles. - var clickPanel = new Rect$2({ - shape: { - x: 0, - y: 0, - width: size[0], - height: size[1] - }, - style: { - fill: 'transparent' - }, - z2: 0, - onclick: bind(this._onClickPanel, this) - }); - var zr = this.api.getZr(); - if (brushSelect) { - clickPanel.on('mousedown', this._onBrushStart, this); - clickPanel.cursor = 'crosshair'; - zr.on('mousemove', this._onBrush); - zr.on('mouseup', this._onBrushEnd); - } else { - zr.off('mousemove', this._onBrush); - zr.off('mouseup', this._onBrushEnd); - } - barGroup.add(clickPanel); - }; - SliderZoomView.prototype._renderDataShadow = function () { - var info = this._dataShadowInfo = this._prepareDataShadowInfo(); - this._displayables.dataShadowSegs = []; - if (!info) { - return; - } - var size = this._size; - var oldSize = this._shadowSize || []; - var seriesModel = info.series; - var data = seriesModel.getRawData(); - var candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim(); - var otherDim = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() // @see candlestick - : info.otherDim; - if (otherDim == null) { - return; - } - var polygonPts = this._shadowPolygonPts; - var polylinePts = this._shadowPolylinePts; - // Not re-render if data doesn't change. - if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) { - var otherDataExtent_1 = data.getDataExtent(otherDim); - // Nice extent. - var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3; - otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset]; - var otherShadowExtent_1 = [0, size[1]]; - var thisShadowExtent = [0, size[0]]; - var areaPoints_1 = [[size[0], 0], [0, 0]]; - var linePoints_1 = []; - var step_1 = thisShadowExtent[1] / (data.count() - 1); - var thisCoord_1 = 0; - // Optimize for large data shadow - var stride_1 = Math.round(data.count() / size[0]); - var lastIsEmpty_1; - data.each([otherDim], function (value, index) { - if (stride_1 > 0 && index % stride_1) { - thisCoord_1 += step_1; - return; - } - // FIXME - // Should consider axis.min/axis.max when drawing dataShadow. - // FIXME - // 应该使用统一的空判断?还是在list里进行空判断? - var isEmpty = value == null || isNaN(value) || value === ''; - // See #4235. - var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true); - // Attempt to draw data shadow precisely when there are empty value. - if (isEmpty && !lastIsEmpty_1 && index) { - areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]); - linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]); - } else if (!isEmpty && lastIsEmpty_1) { - areaPoints_1.push([thisCoord_1, 0]); - linePoints_1.push([thisCoord_1, 0]); - } - areaPoints_1.push([thisCoord_1, otherCoord]); - linePoints_1.push([thisCoord_1, otherCoord]); - thisCoord_1 += step_1; - lastIsEmpty_1 = isEmpty; - }); - polygonPts = this._shadowPolygonPts = areaPoints_1; - polylinePts = this._shadowPolylinePts = linePoints_1; - } - this._shadowData = data; - this._shadowDim = otherDim; - this._shadowSize = [size[0], size[1]]; - var dataZoomModel = this.dataZoomModel; - function createDataShadowGroup(isSelectedArea) { - var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground'); - var group = new Group(); - var polygon = new Polygon({ - shape: { - points: polygonPts - }, - segmentIgnoreThreshold: 1, - style: model.getModel('areaStyle').getAreaStyle(), - silent: true, - z2: -20 - }); - var polyline = new Polyline({ - shape: { - points: polylinePts - }, - segmentIgnoreThreshold: 1, - style: model.getModel('lineStyle').getLineStyle(), - silent: true, - z2: -19 - }); - group.add(polygon); - group.add(polyline); - return group; - } - // let dataBackgroundModel = dataZoomModel.getModel('dataBackground'); - for (var i = 0; i < 3; i++) { - var group = createDataShadowGroup(i === 1); - this._displayables.sliderGroup.add(group); - this._displayables.dataShadowSegs.push(group); - } - }; - SliderZoomView.prototype._prepareDataShadowInfo = function () { - var dataZoomModel = this.dataZoomModel; - var showDataShadow = dataZoomModel.get('showDataShadow'); - if (showDataShadow === false) { - return; - } - // Find a representative series. - var result; - var ecModel = this.ecModel; - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels(); - each(seriesModels, function (seriesModel) { - if (result) { - return; - } - if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) { - return; - } - var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis; - var otherDim = getOtherDim(axisDim); - var otherAxisInverse; - var coordSys = seriesModel.coordinateSystem; - if (otherDim != null && coordSys.getOtherAxis) { - otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; - } - otherDim = seriesModel.getData().mapDimension(otherDim); - result = { - thisAxis: thisAxis, - series: seriesModel, - thisDim: axisDim, - otherDim: otherDim, - otherAxisInverse: otherAxisInverse - }; - }, this); - }, this); - return result; - }; - SliderZoomView.prototype._renderHandle = function () { - var thisGroup = this.group; - var displayables = this._displayables; - var handles = displayables.handles = [null, null]; - var handleLabels = displayables.handleLabels = [null, null]; - var sliderGroup = this._displayables.sliderGroup; - var size = this._size; - var dataZoomModel = this.dataZoomModel; - var api = this.api; - var borderRadius = dataZoomModel.get('borderRadius') || 0; - var brushSelect = dataZoomModel.get('brushSelect'); - var filler = displayables.filler = new Rect$2({ - silent: brushSelect, - style: { - fill: dataZoomModel.get('fillerColor') - }, - textConfig: { - position: 'inside' - } - }); - sliderGroup.add(filler); - // Frame border. - sliderGroup.add(new Rect$2({ - silent: true, - subPixelOptimize: true, - shape: { - x: 0, - y: 0, - width: size[0], - height: size[1], - r: borderRadius - }, - style: { - // deprecated option - stroke: dataZoomModel.get('dataBackgroundColor') || dataZoomModel.get('borderColor'), - lineWidth: DEFAULT_FRAME_BORDER_WIDTH, - fill: 'rgba(0,0,0,0)' - } + } + shape.style.fill = null; + group.add(shape); + }, + axisTick(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + const tickModel = angleAxisModel.getModel("axisTick"); + const tickLen = (tickModel.get("inside") ? -1 : 1) * tickModel.get("length"); + const radius = radiusExtent[getRadiusIdx(polar)]; + const lines = map(ticksAngles, function(tickAngleItem) { + return new Line_default({ + shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) + }); + }); + group.add(mergePath2(lines, { + style: defaults(tickModel.getModel("lineStyle").getLineStyle(), { + stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"]) + }) + })); + }, + minorTick(group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) { + if (!minorTickAngles.length) { + return; + } + const tickModel = angleAxisModel.getModel("axisTick"); + const minorTickModel = angleAxisModel.getModel("minorTick"); + const tickLen = (tickModel.get("inside") ? -1 : 1) * minorTickModel.get("length"); + const radius = radiusExtent[getRadiusIdx(polar)]; + const lines = []; + for (let i = 0; i < minorTickAngles.length; i++) { + for (let k = 0; k < minorTickAngles[i].length; k++) { + lines.push(new Line_default({ + shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord) })); - // Left and right handle to resize - each([0, 1], function (handleIndex) { - var iconStr = dataZoomModel.get('handleIcon'); - if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) { - // Compatitable with the old icon parsers. Which can use a path string without path:// - iconStr = 'path://' + iconStr; - if ("development" !== 'production') { - deprecateLog('handleIcon now needs \'path://\' prefix when using a path string'); - } - } - var path = createSymbol(iconStr, -1, 0, 2, 2, null, true); - path.attr({ - cursor: getCursor(this._orient), - draggable: true, - drift: bind(this._onDragMove, this, handleIndex), - ondragend: bind(this._onDragEnd, this), - onmouseover: bind(this._showDataInfo, this, true), - onmouseout: bind(this._showDataInfo, this, false), - z2: 5 - }); - var bRect = path.getBoundingRect(); - var handleSize = dataZoomModel.get('handleSize'); - this._handleHeight = parsePercent$1(handleSize, this._size[1]); - this._handleWidth = bRect.width / bRect.height * this._handleHeight; - path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle()); - path.style.strokeNoScale = true; - path.rectHover = true; - path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle(); - enableHoverEmphasis(path); - var handleColor = dataZoomModel.get('handleColor'); // deprecated option - // Compatitable with previous version - if (handleColor != null) { - path.style.fill = handleColor; - } - sliderGroup.add(handles[handleIndex] = path); - var textStyleModel = dataZoomModel.getModel('textStyle'); - thisGroup.add(handleLabels[handleIndex] = new ZRText({ - silent: true, - invisible: true, - style: createTextStyle(textStyleModel, { - x: 0, - y: 0, - text: '', - verticalAlign: 'middle', - align: 'center', - fill: textStyleModel.getTextColor(), - font: textStyleModel.getFont() - }), - z2: 10 - })); - }, this); - // Handle to move. Only visible when brushSelect is set true. - var actualMoveZone = filler; - if (brushSelect) { - var moveHandleHeight = parsePercent$1(dataZoomModel.get('moveHandleSize'), size[1]); - var moveHandle_1 = displayables.moveHandle = new Rect({ - style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(), - silent: true, - shape: { - r: [0, 0, 2, 2], - y: size[1] - 0.5, - height: moveHandleHeight - } - }); - var iconSize = moveHandleHeight * 0.8; - var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true); - moveHandleIcon.silent = true; - moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5; - moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle(); - var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10)); - actualMoveZone = displayables.moveZone = new Rect({ - invisible: true, - shape: { - y: size[1] - moveZoneExpandSize, - height: moveHandleHeight + moveZoneExpandSize - } - }); - actualMoveZone.on('mouseover', function () { - api.enterEmphasis(moveHandle_1); - }).on('mouseout', function () { - api.leaveEmphasis(moveHandle_1); - }); - sliderGroup.add(moveHandle_1); - sliderGroup.add(moveHandleIcon); - sliderGroup.add(actualMoveZone); - } - actualMoveZone.attr({ - draggable: true, - cursor: getCursor(this._orient), - drift: bind(this._onDragMove, this, 'all'), - ondragstart: bind(this._showDataInfo, this, true), - ondragend: bind(this._onDragEnd, this), - onmouseover: bind(this._showDataInfo, this, true), - onmouseout: bind(this._showDataInfo, this, false) - }); - }; - SliderZoomView.prototype._resetInterval = function () { - var range = this._range = this.dataZoomModel.getPercentRange(); - var viewExtent = this._getViewExtent(); - this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)]; - }; - SliderZoomView.prototype._updateInterval = function (handleIndex, delta) { - var dataZoomModel = this.dataZoomModel; - var handleEnds = this._handleEnds; - var viewExtend = this._getViewExtent(); - var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); - var percentExtent = [0, 100]; - sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null); - var lastRange = this._range; - var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]); - return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; - }; - SliderZoomView.prototype._updateView = function (nonRealtime) { - var displaybles = this._displayables; - var handleEnds = this._handleEnds; - var handleInterval = asc(handleEnds.slice()); - var size = this._size; - each([0, 1], function (handleIndex) { - // Handles - var handle = displaybles.handles[handleIndex]; - var handleHeight = this._handleHeight; - handle.attr({ - scaleX: handleHeight / 2, - scaleY: handleHeight / 2, - // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window. - // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default. - x: handleEnds[handleIndex] + (handleIndex ? -1 : 1), - y: size[1] / 2 - handleHeight / 2 - }); - }, this); - // Filler - displaybles.filler.setShape({ - x: handleInterval[0], - y: 0, - width: handleInterval[1] - handleInterval[0], - height: size[1] - }); - var viewExtent = { - x: handleInterval[0], - width: handleInterval[1] - handleInterval[0] - }; - // Move handle - if (displaybles.moveHandle) { - displaybles.moveHandle.setShape(viewExtent); - displaybles.moveZone.setShape(viewExtent); - // Force update path on the invisible object - displaybles.moveZone.getBoundingRect(); - displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2); - } - // update clip path of shadow. - var dataShadowSegs = displaybles.dataShadowSegs; - var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]]; - for (var i = 0; i < dataShadowSegs.length; i++) { - var segGroup = dataShadowSegs[i]; - var clipPath = segGroup.getClipPath(); - if (!clipPath) { - clipPath = new Rect(); - segGroup.setClipPath(clipPath); - } - clipPath.setShape({ - x: segIntervals[i], - y: 0, - width: segIntervals[i + 1] - segIntervals[i], - height: size[1] - }); - } - this._updateDataInfo(nonRealtime); - }; - SliderZoomView.prototype._updateDataInfo = function (nonRealtime) { - var dataZoomModel = this.dataZoomModel; - var displaybles = this._displayables; - var handleLabels = displaybles.handleLabels; - var orient = this._orient; - var labelTexts = ['', '']; - // FIXME - // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter) - if (dataZoomModel.get('showDetail')) { - var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); - if (axisProxy) { - var axis = axisProxy.getAxisModel().axis; - var range = this._range; - var dataInterval = nonRealtime - // See #4434, data and axis are not processed and reset yet in non-realtime mode. - ? axisProxy.calculateDataWindow({ - start: range[0], - end: range[1] - }).valueWindow : axisProxy.getDataValueWindow(); - labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)]; - } - } - var orderedHandleEnds = asc(this._handleEnds.slice()); - setLabel.call(this, 0); - setLabel.call(this, 1); - function setLabel(handleIndex) { - // Label - // Text should not transform by barGroup. - // Ignore handlers transform - var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group); - var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform); - var offset = this._handleWidth / 2 + LABEL_GAP; - var textPoint = applyTransform$1([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform); - handleLabels[handleIndex].setStyle({ - x: textPoint[0], - y: textPoint[1], - verticalAlign: orient === HORIZONTAL ? 'middle' : direction, - align: orient === HORIZONTAL ? direction : 'center', - text: labelTexts[handleIndex] - }); - } - }; - SliderZoomView.prototype._formatLabel = function (value, axis) { - var dataZoomModel = this.dataZoomModel; - var labelFormatter = dataZoomModel.get('labelFormatter'); - var labelPrecision = dataZoomModel.get('labelPrecision'); - if (labelPrecision == null || labelPrecision === 'auto') { - labelPrecision = axis.getPixelPrecision(); - } - var valueStr = value == null || isNaN(value) ? '' - // FIXME Glue code - : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({ - value: Math.round(value) + } + } + group.add(mergePath2(lines, { + style: defaults(minorTickModel.getModel("lineStyle").getLineStyle(), defaults(tickModel.getLineStyle(), { + stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"]) + })) + })); + }, + axisLabel(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) { + const rawCategoryData = angleAxisModel.getCategories(true); + const commonLabelModel = angleAxisModel.getModel("axisLabel"); + const labelMargin = commonLabelModel.get("margin"); + const triggerEvent = angleAxisModel.get("triggerEvent"); + each(labels, function(labelItem, idx) { + let labelModel = commonLabelModel; + const tickValue = labelItem.tickValue; + const r = radiusExtent[getRadiusIdx(polar)]; + const p = polar.coordToPoint([r + labelMargin, labelItem.coord]); + const cx = polar.cx; + const cy = polar.cy; + const labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? "center" : p[0] > cx ? "left" : "right"; + const labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? "middle" : p[1] > cy ? "top" : "bottom"; + if (rawCategoryData && rawCategoryData[tickValue]) { + const rawCategoryItem = rawCategoryData[tickValue]; + if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { + labelModel = new Model_default(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel); + } + } + const textEl = new Text_default({ + silent: AxisBuilder_default.isLabelSilent(angleAxisModel), + style: createTextStyle(labelModel, { + x: p[0], + y: p[1], + fill: labelModel.getTextColor() || angleAxisModel.get(["axisLine", "lineStyle", "color"]), + text: labelItem.formattedLabel, + align: labelTextAlign, + verticalAlign: labelTextVerticalAlign }) - // param of toFixed should less then 20. - : value.toFixed(Math.min(labelPrecision, 20)); - return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr; - }; - /** - * @param showOrHide true: show, false: hide - */ - SliderZoomView.prototype._showDataInfo = function (showOrHide) { - // Always show when drgging. - showOrHide = this._dragging || showOrHide; - var displayables = this._displayables; - var handleLabels = displayables.handleLabels; - handleLabels[0].attr('invisible', !showOrHide); - handleLabels[1].attr('invisible', !showOrHide); - // Highlight move handle - displayables.moveHandle && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1); - }; - SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) { - this._dragging = true; - // For mobile device, prevent screen slider on the button. - stop(event.event); - // Transform dx, dy to bar coordination. - var barTransform = this._displayables.sliderGroup.getLocalTransform(); - var vertex = applyTransform$1([dx, dy], barTransform, true); - var changed = this._updateInterval(handleIndex, vertex[0]); - var realtime = this.dataZoomModel.get('realtime'); - this._updateView(!realtime); - // Avoid dispatch dataZoom repeatly but range not changed, - // which cause bad visual effect when progressive enabled. - changed && realtime && this._dispatchZoomAction(true); - }; - SliderZoomView.prototype._onDragEnd = function () { - this._dragging = false; - this._showDataInfo(false); - // While in realtime mode and stream mode, dispatch action when - // drag end will cause the whole view rerender, which is unnecessary. - var realtime = this.dataZoomModel.get('realtime'); - !realtime && this._dispatchZoomAction(false); - }; - SliderZoomView.prototype._onClickPanel = function (e) { - var size = this._size; - var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY); - if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) { - return; - } - var handleEnds = this._handleEnds; - var center = (handleEnds[0] + handleEnds[1]) / 2; - var changed = this._updateInterval('all', localPoint[0] - center); - this._updateView(); - changed && this._dispatchZoomAction(false); - }; - SliderZoomView.prototype._onBrushStart = function (e) { - var x = e.offsetX; - var y = e.offsetY; - this._brushStart = new Point(x, y); - this._brushing = true; - this._brushStartTime = +new Date(); - // this._updateBrushRect(x, y); - }; - - SliderZoomView.prototype._onBrushEnd = function (e) { - if (!this._brushing) { - return; - } - var brushRect = this._displayables.brushRect; - this._brushing = false; - if (!brushRect) { - return; - } - brushRect.attr('ignore', true); - var brushShape = brushRect.shape; - var brushEndTime = +new Date(); - // console.log(brushEndTime - this._brushStartTime); - if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) { - // Will treat it as a click - return; - } - var viewExtend = this._getViewExtent(); - var percentExtent = [0, 100]; - this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]); - this._handleEnds = [brushShape.x, brushShape.x + brushShape.width]; - this._updateView(); - this._dispatchZoomAction(false); - }; - SliderZoomView.prototype._onBrush = function (e) { - if (this._brushing) { - // For mobile device, prevent screen slider on the button. - stop(e.event); - this._updateBrushRect(e.offsetX, e.offsetY); + }); + group.add(textEl); + if (triggerEvent) { + const eventData = AxisBuilder_default.makeAxisEventDataBase(angleAxisModel); + eventData.targetType = "axisLabel"; + eventData.value = labelItem.rawLabel; + getECData(textEl).eventData = eventData; + } + }, this); + }, + splitLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + const splitLineModel = angleAxisModel.getModel("splitLine"); + const lineStyleModel = splitLineModel.getModel("lineStyle"); + let lineColors = lineStyleModel.get("color"); + let lineCount = 0; + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + const splitLines = []; + for (let i = 0; i < ticksAngles.length; i++) { + const colorIndex = lineCount++ % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(new Line_default({ + shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord) + })); + } + for (let i = 0; i < splitLines.length; i++) { + group.add(mergePath2(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length] + }, lineStyleModel.getLineStyle()), + silent: true, + z: angleAxisModel.get("z") + })); + } + }, + minorSplitLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + if (!minorTickAngles.length) { + return; + } + const minorSplitLineModel = angleAxisModel.getModel("minorSplitLine"); + const lineStyleModel = minorSplitLineModel.getModel("lineStyle"); + const lines = []; + for (let i = 0; i < minorTickAngles.length; i++) { + for (let k = 0; k < minorTickAngles[i].length; k++) { + lines.push(new Line_default({ + shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord) + })); + } + } + group.add(mergePath2(lines, { + style: lineStyleModel.getLineStyle(), + silent: true, + z: angleAxisModel.get("z") + })); + }, + splitArea(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + if (!ticksAngles.length) { + return; + } + const splitAreaModel = angleAxisModel.getModel("splitArea"); + const areaStyleModel = splitAreaModel.getModel("areaStyle"); + let areaColors = areaStyleModel.get("color"); + let lineCount = 0; + areaColors = areaColors instanceof Array ? areaColors : [areaColors]; + const splitAreas = []; + const RADIAN4 = Math.PI / 180; + let prevAngle = -ticksAngles[0].coord * RADIAN4; + const r0 = Math.min(radiusExtent[0], radiusExtent[1]); + const r1 = Math.max(radiusExtent[0], radiusExtent[1]); + const clockwise = angleAxisModel.get("clockwise"); + for (let i = 1, len2 = ticksAngles.length; i <= len2; i++) { + const coord = i === len2 ? ticksAngles[0].coord : ticksAngles[i].coord; + const colorIndex = lineCount++ % areaColors.length; + splitAreas[colorIndex] = splitAreas[colorIndex] || []; + splitAreas[colorIndex].push(new Sector_default({ + shape: { + cx: polar.cx, + cy: polar.cy, + r0, + r: r1, + startAngle: prevAngle, + endAngle: -coord * RADIAN4, + clockwise + }, + silent: true + })); + prevAngle = -coord * RADIAN4; + } + for (let i = 0; i < splitAreas.length; i++) { + group.add(mergePath2(splitAreas[i], { + style: defaults({ + fill: areaColors[i % areaColors.length] + }, areaStyleModel.getAreaStyle()), + silent: true + })); + } + } +}; +var AngleAxisView_default = AngleAxisView; + +// src/component/axis/RadiusAxisView.ts +var axisBuilderAttrs3 = [ + "axisLine", + "axisTickLabel", + "axisName" +]; +var selfBuilderAttrs2 = [ + "splitLine", + "splitArea", + "minorSplitLine" +]; +var RadiusAxisView2 = class extends AxisView_default { + constructor() { + super(...arguments); + this.type = RadiusAxisView2.type; + this.axisPointerClass = "PolarAxisPointer"; + } + render(radiusAxisModel, ecModel) { + this.group.removeAll(); + if (!radiusAxisModel.get("show")) { + return; + } + const oldAxisGroup = this._axisGroup; + const newAxisGroup = this._axisGroup = new Group_default(); + this.group.add(newAxisGroup); + const radiusAxis = radiusAxisModel.axis; + const polar = radiusAxis.polar; + const angleAxis = polar.getAngleAxis(); + const ticksCoords = radiusAxis.getTicksCoords(); + const minorTicksCoords = radiusAxis.getMinorTicksCoords(); + const axisAngle = angleAxis.getExtent()[0]; + const radiusExtent = radiusAxis.getExtent(); + const layout18 = layoutAxis(polar, radiusAxisModel, axisAngle); + const axisBuilder = new AxisBuilder_default(radiusAxisModel, layout18); + each(axisBuilderAttrs3, axisBuilder.add, axisBuilder); + newAxisGroup.add(axisBuilder.getGroup()); + groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel); + each(selfBuilderAttrs2, function(name) { + if (radiusAxisModel.get([name, "show"]) && !radiusAxis.scale.isBlank()) { + axisElementBuilders2[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords); + } + }, this); + } +}; +var RadiusAxisView = RadiusAxisView2; +RadiusAxisView.type = "radiusAxis"; +var axisElementBuilders2 = { + splitLine(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { + const splitLineModel = radiusAxisModel.getModel("splitLine"); + const lineStyleModel = splitLineModel.getModel("lineStyle"); + let lineColors = lineStyleModel.get("color"); + let lineCount = 0; + const angleAxis = polar.getAngleAxis(); + const RADIAN4 = Math.PI / 180; + const angleExtent = angleAxis.getExtent(); + const shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? "Circle" : "Arc"; + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + const splitLines = []; + for (let i = 0; i < ticksCoords.length; i++) { + const colorIndex = lineCount++ % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(new graphic_exports[shapeType]({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: Math.max(ticksCoords[i].coord, 0), + startAngle: -angleExtent[0] * RADIAN4, + endAngle: -angleExtent[1] * RADIAN4, + clockwise: angleAxis.inverse } - }; - SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) { - var displayables = this._displayables; - var dataZoomModel = this.dataZoomModel; - var brushRect = displayables.brushRect; - if (!brushRect) { - brushRect = displayables.brushRect = new Rect$2({ - silent: true, - style: dataZoomModel.getModel('brushStyle').getItemStyle() - }); - displayables.sliderGroup.add(brushRect); - } - brushRect.attr('ignore', false); - var brushStart = this._brushStart; - var sliderGroup = this._displayables.sliderGroup; - var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY); - var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y); - var size = this._size; - endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0); - brushRect.setShape({ - x: startPoint[0], - y: 0, - width: endPoint[0] - startPoint[0], - height: size[1] - }); - }; - /** - * This action will be throttled. - */ - SliderZoomView.prototype._dispatchZoomAction = function (realtime) { - var range = this._range; - this.api.dispatchAction({ - type: 'dataZoom', - from: this.uid, - dataZoomId: this.dataZoomModel.id, - animation: realtime ? REALTIME_ANIMATION_CONFIG : null, - start: range[0], - end: range[1] - }); - }; - SliderZoomView.prototype._findCoordRect = function () { - // Find the grid corresponding to the first axis referred by dataZoom. - var rect; - var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList; - if (!rect && coordSysInfoList.length) { - var coordSys = coordSysInfoList[0].model.coordinateSystem; - rect = coordSys.getRect && coordSys.getRect(); - } - if (!rect) { - var width = this.api.getWidth(); - var height = this.api.getHeight(); - rect = { - x: width * 0.2, - y: height * 0.2, - width: width * 0.6, - height: height * 0.6 + })); + } + for (let i = 0; i < splitLines.length; i++) { + group.add(mergePath2(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length], + fill: null + }, lineStyleModel.getLineStyle()), + silent: true + })); + } + }, + minorSplitLine(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) { + if (!minorTicksCoords.length) { + return; + } + const minorSplitLineModel = radiusAxisModel.getModel("minorSplitLine"); + const lineStyleModel = minorSplitLineModel.getModel("lineStyle"); + const lines = []; + for (let i = 0; i < minorTicksCoords.length; i++) { + for (let k = 0; k < minorTicksCoords[i].length; k++) { + lines.push(new Circle_default({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: minorTicksCoords[i][k].coord + } + })); + } + } + group.add(mergePath2(lines, { + style: defaults({ + fill: null + }, lineStyleModel.getLineStyle()), + silent: true + })); + }, + splitArea(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { + if (!ticksCoords.length) { + return; + } + const splitAreaModel = radiusAxisModel.getModel("splitArea"); + const areaStyleModel = splitAreaModel.getModel("areaStyle"); + let areaColors = areaStyleModel.get("color"); + let lineCount = 0; + areaColors = areaColors instanceof Array ? areaColors : [areaColors]; + const splitAreas = []; + let prevRadius = ticksCoords[0].coord; + for (let i = 1; i < ticksCoords.length; i++) { + const colorIndex = lineCount++ % areaColors.length; + splitAreas[colorIndex] = splitAreas[colorIndex] || []; + splitAreas[colorIndex].push(new Sector_default({ + 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; + } + for (let i = 0; i < splitAreas.length; i++) { + group.add(mergePath2(splitAreas[i], { + style: defaults({ + fill: areaColors[i % areaColors.length] + }, areaStyleModel.getAreaStyle()), + silent: true + })); + } + } +}; +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"), + z2: 1 + }; +} +var RadiusAxisView_default = RadiusAxisView; + +// src/layout/barPolar.ts +function getSeriesStackId2(seriesModel) { + return seriesModel.get("stack") || "__ec_stack_" + seriesModel.seriesIndex; +} +function getAxisKey2(polar, axis) { + return axis.dim + polar.model.componentIndex; +} +function barLayoutPolar(seriesType2, ecModel, api2) { + const lastStackCoords = {}; + const barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType2), function(seriesModel) { + return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === "polar"; + })); + ecModel.eachSeriesByType(seriesType2, function(seriesModel) { + if (seriesModel.coordinateSystem.type !== "polar") { + return; + } + const data = seriesModel.getData(); + const polar = seriesModel.coordinateSystem; + const baseAxis = polar.getBaseAxis(); + const axisKey = getAxisKey2(polar, baseAxis); + const stackId = getSeriesStackId2(seriesModel); + const columnLayoutInfo = barWidthAndOffset[axisKey][stackId]; + const columnOffset = columnLayoutInfo.offset; + const columnWidth = columnLayoutInfo.width; + const valueAxis2 = polar.getOtherAxis(baseAxis); + const cx = seriesModel.coordinateSystem.cx; + const cy = seriesModel.coordinateSystem.cy; + const barMinHeight = seriesModel.get("barMinHeight") || 0; + const barMinAngle = seriesModel.get("barMinAngle") || 0; + lastStackCoords[stackId] = lastStackCoords[stackId] || []; + const valueDim = data.mapDimension(valueAxis2.dim); + const baseDim = data.mapDimension(baseAxis.dim); + const stacked = isDimensionStacked(data, valueDim); + const clampLayout = baseAxis.dim !== "radius" || !seriesModel.get("roundCap", true); + const valueAxisModel = valueAxis2.model; + const startValue = valueAxisModel.get("startValue"); + const valueAxisStart = valueAxis2.dataToCoord(startValue || 0); + for (let idx = 0, len2 = data.count(); idx < len2; idx++) { + const value = data.get(valueDim, idx); + const baseValue = data.get(baseDim, idx); + const sign = value >= 0 ? "p" : "n"; + let baseCoord = valueAxisStart; + if (stacked) { + if (!lastStackCoords[stackId][baseValue]) { + lastStackCoords[stackId][baseValue] = { + p: valueAxisStart, + n: valueAxisStart }; } - return rect; - }; - SliderZoomView.type = 'dataZoom.slider'; - return SliderZoomView; - }(DataZoomView); - function getOtherDim(thisDim) { - // FIXME - // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好 - var map = { - x: 'y', - y: 'x', - radius: 'angle', - angle: 'radius' - }; - return map[thisDim]; - } - function getCursor(orient) { - return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; + baseCoord = lastStackCoords[stackId][baseValue][sign]; + } + let r0; + let r; + let startAngle; + let endAngle; + if (valueAxis2.dim === "radius") { + let radiusSpan = valueAxis2.dataToCoord(value) - valueAxisStart; + const angle = baseAxis.dataToCoord(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); + } else { + let angleSpan = valueAxis2.dataToCoord(value, clampLayout) - valueAxisStart; + const radius = baseAxis.dataToCoord(baseValue); + if (Math.abs(angleSpan) < barMinAngle) { + angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; + } + r0 = radius + columnOffset; + r = r0 + columnWidth; + startAngle = baseCoord; + endAngle = baseCoord + angleSpan; + stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle); + } + data.setItemLayout(idx, { + cx, + cy, + r0, + r, + startAngle: -startAngle * Math.PI / 180, + endAngle: -endAngle * Math.PI / 180, + clockwise: startAngle >= endAngle + }); } - - function install$L(registers) { - registers.registerComponentModel(SliderZoomModel); - registers.registerComponentView(SliderZoomView); - installCommon(registers); + }); +} +function calRadialBar(barSeries) { + const columnsMap = {}; + each(barSeries, function(seriesModel, idx) { + const data = seriesModel.getData(); + const polar = seriesModel.coordinateSystem; + const baseAxis = polar.getBaseAxis(); + const axisKey = getAxisKey2(polar, baseAxis); + const axisExtent = baseAxis.getExtent(); + const bandWidth = baseAxis.type === "category" ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); + const columnsOnAxis = columnsMap[axisKey] || { + bandWidth, + remainedWidth: bandWidth, + autoWidthCount: 0, + categoryGap: "20%", + gap: "30%", + stacks: {} + }; + const stacks = columnsOnAxis.stacks; + columnsMap[axisKey] = columnsOnAxis; + const stackId = getSeriesStackId2(seriesModel); + if (!stacks[stackId]) { + columnsOnAxis.autoWidthCount++; + } + stacks[stackId] = stacks[stackId] || { + width: 0, + maxWidth: 0 + }; + let barWidth = parsePercent2(seriesModel.get("barWidth"), bandWidth); + const barMaxWidth = parsePercent2(seriesModel.get("barMaxWidth"), bandWidth); + const barGap = seriesModel.get("barGap"); + const 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); + }); + const result = {}; + each(columnsMap, function(columnsOnAxis, coordSysName) { + result[coordSysName] = {}; + const stacks = columnsOnAxis.stacks; + const bandWidth = columnsOnAxis.bandWidth; + const categoryGap = parsePercent2(columnsOnAxis.categoryGap, bandWidth); + const barGapPercent = parsePercent2(columnsOnAxis.gap, 1); + let remainedWidth = columnsOnAxis.remainedWidth; + let autoWidthCount = columnsOnAxis.autoWidthCount; + let autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); + each(stacks, function(column, stack) { + let 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--; + } + }); + autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); + let widthSum = 0; + let lastColumn; + each(stacks, function(column, idx) { + if (!column.width) { + column.width = autoWidth; + } + lastColumn = column; + widthSum += column.width * (1 + barGapPercent); + }); + if (lastColumn) { + widthSum -= lastColumn.width * barGapPercent; } - - function install$M(registers) { - use(install$K); - use(install$L); - // Do not install './dataZoomSelect', - // since it only work for toolbox dataZoom. + let offset = -widthSum / 2; + each(stacks, function(column, stackId) { + result[coordSysName][stackId] = result[coordSysName][stackId] || { + offset, + width: column.width + }; + offset += column.width * (1 + barGapPercent); + }); + }); + return result; +} +var barPolar_default = barLayoutPolar; + +// src/component/polar/install.ts +var angleAxisExtraOption = { + startAngle: 90, + clockwise: true, + splitNumber: 12, + axisLabel: { + rotate: 0 + } +}; +var radiusAxisExtraOption = { + splitNumber: 5 +}; +var PolarView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = PolarView2.type; + } +}; +var PolarView = PolarView2; +PolarView.type = "polar"; +function install31(registers) { + use(install29); + AxisView_default.registerAxisPointerClass("PolarAxisPointer", PolarAxisPointer_default); + registers.registerCoordinateSystem("polar", polarCreator_default); + registers.registerComponentModel(PolarModel_default); + registers.registerComponentView(PolarView); + axisModelCreator(registers, "angle", AngleAxisModel, angleAxisExtraOption); + axisModelCreator(registers, "radius", RadiusAxisModel, radiusAxisExtraOption); + registers.registerComponentView(AngleAxisView_default); + registers.registerComponentView(RadiusAxisView_default); + registers.registerLayout(curry(barPolar_default, "bar")); +} + +// src/coord/single/singleAxisHelper.ts +function layout11(axisModel, opt) { + opt = opt || {}; + const single = axisModel.coordinateSystem; + const axis = axisModel.axis; + const layout18 = {}; + const axisPosition = axis.position; + const orient = axis.orient; + const rect = single.getRect(); + const rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; + const positionMap = { + horizontal: {top: rectBound[2], bottom: rectBound[3]}, + vertical: {left: rectBound[0], right: rectBound[1]} + }; + layout18.position = [ + orient === "vertical" ? positionMap.vertical[axisPosition] : rectBound[0], + orient === "horizontal" ? positionMap.horizontal[axisPosition] : rectBound[3] + ]; + const r = {horizontal: 0, vertical: 1}; + layout18.rotation = Math.PI / 2 * r[orient]; + const directionMap = {top: -1, bottom: 1, right: 1, left: -1}; + layout18.labelDirection = layout18.tickDirection = layout18.nameDirection = directionMap[axisPosition]; + if (axisModel.get(["axisTick", "inside"])) { + layout18.tickDirection = -layout18.tickDirection; + } + if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) { + layout18.labelDirection = -layout18.labelDirection; + } + let labelRotation = opt.rotate; + labelRotation == null && (labelRotation = axisModel.get(["axisLabel", "rotate"])); + layout18.labelRotation = axisPosition === "top" ? -labelRotation : labelRotation; + layout18.z2 = 1; + return layout18; +} + +// src/component/axis/SingleAxisView.ts +var axisBuilderAttrs4 = [ + "axisLine", + "axisTickLabel", + "axisName" +]; +var selfBuilderAttrs3 = ["splitArea", "splitLine"]; +var SingleAxisView2 = class extends AxisView_default { + constructor() { + super(...arguments); + this.type = SingleAxisView2.type; + this.axisPointerClass = "SingleAxisPointer"; + } + render(axisModel, ecModel, api2, payload) { + const group = this.group; + group.removeAll(); + const oldAxisGroup = this._axisGroup; + this._axisGroup = new Group_default(); + const layout18 = layout11(axisModel); + const axisBuilder = new AxisBuilder_default(axisModel, layout18); + each(axisBuilderAttrs4, axisBuilder.add, axisBuilder); + group.add(this._axisGroup); + group.add(axisBuilder.getGroup()); + each(selfBuilderAttrs3, function(name) { + if (axisModel.get([name, "show"])) { + axisElementBuilders3[name](this, this.group, this._axisGroup, axisModel); + } + }, this); + groupTransition(oldAxisGroup, this._axisGroup, axisModel); + super.render(axisModel, ecModel, api2, payload); + } + remove() { + rectCoordAxisHandleRemove(this); + } +}; +var SingleAxisView = SingleAxisView2; +SingleAxisView.type = "singleAxis"; +var axisElementBuilders3 = { + splitLine(axisView, group, axisGroup, axisModel) { + const axis = axisModel.axis; + if (axis.scale.isBlank()) { + return; + } + const splitLineModel = axisModel.getModel("splitLine"); + const lineStyleModel = splitLineModel.getModel("lineStyle"); + let lineColors = lineStyleModel.get("color"); + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + const lineWidth = lineStyleModel.get("width"); + const gridRect = axisModel.coordinateSystem.getRect(); + const isHorizontal = axis.isHorizontal(); + const splitLines = []; + let lineCount = 0; + const ticksCoords = axis.getTicksCoords({ + tickModel: splitLineModel + }); + const p1 = []; + const p2 = []; + for (let i = 0; i < ticksCoords.length; ++i) { + const 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; + } + const line2 = new Line_default({ + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + silent: true + }); + subPixelOptimizeLine2(line2.shape, lineWidth); + const colorIndex = lineCount++ % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(line2); + } + const lineStyle = lineStyleModel.getLineStyle(["color"]); + for (let i = 0; i < splitLines.length; ++i) { + group.add(mergePath2(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length] + }, lineStyle), + silent: true + })); } - - var visualDefault = { - /** - * @public - */ - get: function (visualType, key, isCategory) { - var value = clone((defaultOption$1[visualType] || {})[key]); - return isCategory ? isArray(value) ? value[value.length - 1] : value : value; + }, + splitArea(axisView, group, axisGroup, axisModel) { + rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel); + } +}; +var SingleAxisView_default = SingleAxisView; + +// src/coord/single/AxisModel.ts +var SingleAxisModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = SingleAxisModel2.type; + } + getCoordSysModel() { + return this; + } +}; +var SingleAxisModel = SingleAxisModel2; +SingleAxisModel.type = "singleAxis"; +SingleAxisModel.layoutMode = "box"; +SingleAxisModel.defaultOption = { + left: "5%", + top: "5%", + right: "5%", + bottom: "5%", + type: "value", + position: "bottom", + orient: "horizontal", + axisLine: { + show: true, + lineStyle: { + width: 1, + type: "solid" + } + }, + tooltip: { + show: true + }, + axisTick: { + show: true, + length: 6, + lineStyle: { + width: 1 + } + }, + axisLabel: { + show: true, + interval: "auto" + }, + splitLine: { + show: true, + lineStyle: { + type: "dashed", + opacity: 0.2 + } + } +}; +mixin(SingleAxisModel, AxisModelCommonMixin.prototype); +var AxisModel_default2 = SingleAxisModel; + +// src/coord/single/SingleAxis.ts +var SingleAxis = class extends Axis_default { + constructor(dim, scale4, coordExtent, axisType, position2) { + super(dim, scale4, coordExtent); + this.type = axisType || "value"; + this.position = position2 || "bottom"; + } + isHorizontal() { + const position2 = this.position; + return position2 === "top" || position2 === "bottom"; + } + pointToData(point, clamp2) { + return this.coordinateSystem.pointToData(point)[0]; + } +}; +var SingleAxis_default = SingleAxis; + +// src/coord/single/Single.ts +var singleDimensions = ["single"]; +var Single = class { + constructor(axisModel, ecModel, api2) { + this.type = "single"; + this.dimension = "single"; + this.dimensions = singleDimensions; + this.axisPointerEnabled = true; + this.model = axisModel; + this._init(axisModel, ecModel, api2); + } + _init(axisModel, ecModel, api2) { + const dim = this.dimension; + const axis = new SingleAxis_default(dim, createScaleByModel(axisModel), [0, 0], axisModel.get("type"), axisModel.get("position")); + const isCategory2 = axis.type === "category"; + axis.onBand = isCategory2 && axisModel.get("boundaryGap"); + axis.inverse = axisModel.get("inverse"); + axis.orient = axisModel.get("orient"); + axisModel.axis = axis; + axis.model = axisModel; + axis.coordinateSystem = this; + this._axis = axis; + } + update(ecModel, api2) { + ecModel.eachSeries(function(seriesModel) { + if (seriesModel.coordinateSystem === this) { + const data = seriesModel.getData(); + each(data.mapDimensionsAll(this.dimension), function(dim) { + this._axis.scale.unionExtentFromData(data, dim); + }, this); + niceScaleExtent(this._axis.scale, this._axis.model); + } + }, this); + } + resize(axisModel, api2) { + this._rect = getLayoutRect({ + left: axisModel.get("left"), + top: axisModel.get("top"), + right: axisModel.get("right"), + bottom: axisModel.get("bottom"), + width: axisModel.get("width"), + height: axisModel.get("height") + }, { + width: api2.getWidth(), + height: api2.getHeight() + }); + this._adjustAxis(); + } + getRect() { + return this._rect; + } + _adjustAxis() { + const rect = this._rect; + const axis = this._axis; + const isHorizontal = axis.isHorizontal(); + const extent3 = isHorizontal ? [0, rect.width] : [0, rect.height]; + const idx = axis.inverse ? 1 : 0; + axis.setExtent(extent3[idx], extent3[1 - idx]); + this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y); + } + _updateAxisTransform(axis, coordBase) { + const axisExtent = axis.getExtent(); + const extentSum = axisExtent[0] + axisExtent[1]; + const isHorizontal = axis.isHorizontal(); + axis.toGlobalCoord = isHorizontal ? function(coord) { + return coord + coordBase; + } : function(coord) { + return extentSum - coord + coordBase; + }; + axis.toLocalCoord = isHorizontal ? function(coord) { + return coord - coordBase; + } : function(coord) { + return extentSum - coord + coordBase; + }; + } + getAxis() { + return this._axis; + } + getBaseAxis() { + return this._axis; + } + getAxes() { + return [this._axis]; + } + getTooltipAxes() { + return { + baseAxes: [this.getAxis()], + otherAxes: [] + }; + } + containPoint(point) { + const rect = this.getRect(); + const axis = this.getAxis(); + const orient = axis.orient; + if (orient === "horizontal") { + return axis.contain(axis.toLocalCoord(point[0])) && (point[1] >= rect.y && point[1] <= rect.y + rect.height); + } else { + return axis.contain(axis.toLocalCoord(point[1])) && (point[0] >= rect.y && point[0] <= rect.y + rect.height); + } + } + pointToData(point) { + const axis = this.getAxis(); + return [axis.coordToData(axis.toLocalCoord(point[axis.orient === "horizontal" ? 0 : 1]))]; + } + dataToPoint(val) { + const axis = this.getAxis(); + const rect = this.getRect(); + const pt = []; + const idx = axis.orient === "horizontal" ? 0 : 1; + if (val instanceof Array) { + val = val[0]; + } + pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val)); + pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2; + return pt; + } + convertToPixel(ecModel, finder, value) { + const coordSys = getCoordSys4(finder); + return coordSys === this ? this.dataToPoint(value) : null; + } + convertFromPixel(ecModel, finder, pixel) { + const coordSys = getCoordSys4(finder); + return coordSys === this ? this.pointToData(pixel) : null; + } +}; +function getCoordSys4(finder) { + const seriesModel = finder.seriesModel; + const singleModel = finder.singleAxisModel; + return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; +} +var Single_default = Single; + +// src/coord/single/singleCreator.ts +function create3(ecModel, api2) { + const singles = []; + ecModel.eachComponent("singleAxis", function(axisModel, idx) { + const single = new Single_default(axisModel, ecModel, api2); + single.name = "single_" + idx; + single.resize(axisModel, api2); + axisModel.coordinateSystem = single; + singles.push(single); + }); + ecModel.eachSeries(function(seriesModel) { + if (seriesModel.get("coordinateSystem") === "singleAxis") { + const singleAxisModel = seriesModel.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0]; + seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem; + } + }); + return singles; +} +var singleCreator = { + create: create3, + dimensions: singleDimensions +}; +var singleCreator_default = singleCreator; + +// src/component/axisPointer/SingleAxisPointer.ts +var XY = ["x", "y"]; +var WH = ["width", "height"]; +var SingleAxisPointer = class extends BaseAxisPointer_default { + makeElOption(elOption, value, axisModel, axisPointerModel, api2) { + const axis = axisModel.axis; + const coordSys = axis.coordinateSystem; + const otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis)); + const pixelValue = coordSys.dataToPoint(value)[0]; + const axisPointerType = axisPointerModel.get("type"); + if (axisPointerType && axisPointerType !== "none") { + const elStyle = buildElStyle(axisPointerModel); + const pointerOption = pointerShapeBuilder3[axisPointerType](axis, pixelValue, otherExtent); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } + const layoutInfo = layout11(axisModel); + buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api2); + } + getHandleTransform(value, axisModel, axisPointerModel) { + const layoutInfo = layout11(axisModel, {labelInside: false}); + layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]); + const position2 = getTransformedPosition(axisModel.axis, value, layoutInfo); + return { + x: position2[0], + y: position2[1], + rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) + }; + } + updateHandleTransform(transform2, delta, axisModel, axisPointerModel) { + const axis = axisModel.axis; + const coordSys = axis.coordinateSystem; + const dimIndex = getPointDimIndex(axis); + const axisExtent = getGlobalExtent(coordSys, dimIndex); + const currPosition = [transform2.x, transform2.y]; + currPosition[dimIndex] += delta[dimIndex]; + currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); + currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); + const otherExtent = getGlobalExtent(coordSys, 1 - dimIndex); + const cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; + const cursorPoint = [cursorOtherValue, cursorOtherValue]; + cursorPoint[dimIndex] = currPosition[dimIndex]; + return { + x: currPosition[0], + y: currPosition[1], + rotation: transform2.rotation, + cursorPoint, + tooltipOption: { + verticalAlign: "middle" } }; - var defaultOption$1 = { - color: { - active: ['#006edd', '#e0ffff'], - inactive: ['rgba(0,0,0,0)'] - }, - colorHue: { - active: [0, 360], - inactive: [0, 0] - }, - colorSaturation: { - active: [0.3, 1], - inactive: [0, 0] - }, - colorLightness: { - active: [0.9, 0.5], - inactive: [0, 0] - }, - colorAlpha: { - active: [0.3, 1], - inactive: [0, 0] - }, - opacity: { - active: [0.3, 1], - inactive: [0, 0] - }, - symbol: { - active: ['circle', 'roundRect', 'diamond'], - inactive: ['none'] + } +}; +var pointerShapeBuilder3 = { + line: function(axis, pixelValue, otherExtent) { + const targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis)); + return { + type: "Line", + subPixelOptimize: true, + shape: targetShape + }; + }, + shadow: function(axis, pixelValue, otherExtent) { + const bandWidth = axis.getBandWidth(); + const span = otherExtent[1] - otherExtent[0]; + return { + type: "Rect", + shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis)) + }; + } +}; +function getPointDimIndex(axis) { + return axis.isHorizontal() ? 0 : 1; +} +function getGlobalExtent(coordSys, dimIndex) { + const rect = coordSys.getRect(); + return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]]; +} +var SingleAxisPointer_default = SingleAxisPointer; + +// src/component/singleAxis/install.ts +var SingleView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = SingleView2.type; + } +}; +var SingleView = SingleView2; +SingleView.type = "single"; +function install32(registers) { + use(install29); + AxisView_default.registerAxisPointerClass("SingleAxisPointer", SingleAxisPointer_default); + registers.registerComponentView(SingleView); + registers.registerComponentView(SingleAxisView_default); + registers.registerComponentModel(AxisModel_default2); + axisModelCreator(registers, "single", AxisModel_default2, AxisModel_default2.defaultOption); + registers.registerCoordinateSystem("single", singleCreator_default); +} + +// src/coord/calendar/CalendarModel.ts +var CalendarModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = CalendarModel2.type; + } + init(option, parentModel, ecModel) { + const inputPositionParams = getLayoutParams(option); + super.init.apply(this, arguments); + mergeAndNormalizeLayoutParams(option, inputPositionParams); + } + mergeOption(option) { + super.mergeOption.apply(this, arguments); + mergeAndNormalizeLayoutParams(this.option, option); + } + getCellSize() { + return this.option.cellSize; + } +}; +var CalendarModel = CalendarModel2; +CalendarModel.type = "calendar"; +CalendarModel.defaultOption = { + z: 2, + left: 80, + top: 60, + cellSize: 20, + orient: "horizontal", + splitLine: { + show: true, + lineStyle: { + color: "#000", + width: 1, + type: "solid" + } + }, + itemStyle: { + color: "#fff", + borderWidth: 1, + borderColor: "#ccc" + }, + dayLabel: { + show: true, + firstDay: 0, + position: "start", + margin: "50%", + color: "#000" + }, + monthLabel: { + show: true, + position: "start", + margin: 5, + align: "center", + formatter: null, + color: "#000" + }, + yearLabel: { + show: true, + position: null, + margin: 30, + formatter: null, + color: "#ccc", + fontFamily: "sans-serif", + fontWeight: "bolder", + fontSize: 20 + } +}; +function mergeAndNormalizeLayoutParams(target, raw) { + const cellSize = target.cellSize; + let cellSizeArr; + if (!isArray(cellSize)) { + cellSizeArr = target.cellSize = [cellSize, cellSize]; + } else { + cellSizeArr = cellSize; + } + if (cellSizeArr.length === 1) { + cellSizeArr[1] = cellSizeArr[0]; + } + const ignoreSize = map([0, 1], function(hvIdx) { + if (sizeCalculable(raw, hvIdx)) { + cellSizeArr[hvIdx] = "auto"; + } + return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== "auto"; + }); + mergeLayoutParam(target, raw, { + type: "box", + ignoreSize + }); +} +var CalendarModel_default = CalendarModel; + +// src/component/calendar/CalendarView.ts +var CalendarView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = CalendarView2.type; + } + render(calendarModel, ecModel, api2) { + const group = this.group; + group.removeAll(); + const coordSys = calendarModel.coordinateSystem; + const rangeData = coordSys.getRangeInfo(); + const orient = coordSys.getOrient(); + const localeModel = ecModel.getLocaleModel(); + this._renderDayRect(calendarModel, rangeData, group); + this._renderLines(calendarModel, rangeData, orient, group); + this._renderYearText(calendarModel, rangeData, orient, group); + this._renderMonthText(calendarModel, localeModel, orient, group); + this._renderWeekText(calendarModel, localeModel, rangeData, orient, group); + } + _renderDayRect(calendarModel, rangeData, group) { + const coordSys = calendarModel.coordinateSystem; + const itemRectStyleModel = calendarModel.getModel("itemStyle").getItemStyle(); + const sw = coordSys.getCellWidth(); + const sh = coordSys.getCellHeight(); + for (let i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) { + const point = coordSys.dataToRect([i], false).tl; + const rect = new Rect_default({ + shape: { + x: point[0], + y: point[1], + width: sw, + height: sh + }, + cursor: "default", + style: itemRectStyleModel + }); + group.add(rect); + } + } + _renderLines(calendarModel, rangeData, orient, group) { + const self2 = this; + const coordSys = calendarModel.coordinateSystem; + const lineStyleModel = calendarModel.getModel(["splitLine", "lineStyle"]).getLineStyle(); + const show = calendarModel.get(["splitLine", "show"]); + const lineWidth = lineStyleModel.lineWidth; + this._tlpoints = []; + this._blpoints = []; + this._firstDayOfMonth = []; + this._firstDayPoints = []; + let firstDay = rangeData.start; + for (let i = 0; firstDay.time <= rangeData.end.time; i++) { + addPoints(firstDay.formatedDate); + if (i === 0) { + firstDay = coordSys.getDateInfo(rangeData.start.y + "-" + rangeData.start.m); + } + const date = firstDay.date; + date.setMonth(date.getMonth() + 1); + firstDay = coordSys.getDateInfo(date); + } + addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); + function addPoints(date) { + self2._firstDayOfMonth.push(coordSys.getDateInfo(date)); + self2._firstDayPoints.push(coordSys.dataToRect([date], false).tl); + const points4 = self2._getLinePointsOfOneWeek(calendarModel, date, orient); + self2._tlpoints.push(points4[0]); + self2._blpoints.push(points4[points4.length - 1]); + show && self2._drawSplitline(points4, lineStyleModel, group); + } + show && this._drawSplitline(self2._getEdgesPoints(self2._tlpoints, lineWidth, orient), lineStyleModel, group); + show && this._drawSplitline(self2._getEdgesPoints(self2._blpoints, lineWidth, orient), lineStyleModel, group); + } + _getEdgesPoints(points4, lineWidth, orient) { + const rs = [points4[0].slice(), points4[points4.length - 1].slice()]; + const idx = orient === "horizontal" ? 0 : 1; + rs[0][idx] = rs[0][idx] - lineWidth / 2; + rs[1][idx] = rs[1][idx] + lineWidth / 2; + return rs; + } + _drawSplitline(points4, lineStyle, group) { + const poyline = new Polyline_default({ + z2: 20, + shape: { + points: points4 }, - symbolSize: { - active: [10, 50], - inactive: [0, 0] + style: lineStyle + }); + group.add(poyline); + } + _getLinePointsOfOneWeek(calendarModel, date, orient) { + const coordSys = calendarModel.coordinateSystem; + const parsedDate = coordSys.getDateInfo(date); + const points4 = []; + for (let i = 0; i < 7; i++) { + const tmpD = coordSys.getNextNDay(parsedDate.time, i); + const point = coordSys.dataToRect([tmpD.time], false); + points4[2 * tmpD.day] = point.tl; + points4[2 * tmpD.day + 1] = point[orient === "horizontal" ? "bl" : "tr"]; + } + return points4; + } + _formatterLabel(formatter, params) { + if (isString(formatter) && formatter) { + return formatTplSimple(formatter, params); + } + if (isFunction(formatter)) { + return formatter(params); + } + return params.nameMap; + } + _yearTextPositionControl(textEl, point, orient, position2, margin) { + let x = point[0]; + let y = point[1]; + let aligns = ["center", "bottom"]; + if (position2 === "bottom") { + y += margin; + aligns = ["center", "top"]; + } else if (position2 === "left") { + x -= margin; + } else if (position2 === "right") { + x += margin; + aligns = ["center", "top"]; + } else { + y -= margin; + } + let rotate2 = 0; + if (position2 === "left" || position2 === "right") { + rotate2 = Math.PI / 2; + } + return { + rotation: rotate2, + x, + y, + style: { + align: aligns[0], + verticalAlign: aligns[1] } }; - - var mapVisual$1 = VisualMapping.mapVisual; - var eachVisual = VisualMapping.eachVisual; - var isArray$1 = isArray; - var each$d = each; - var asc$2 = asc; - var linearMap$1 = linearMap; - var VisualMapModel = /** @class */function (_super) { - __extends(VisualMapModel, _super); - function VisualMapModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = VisualMapModel.type; - _this.stateList = ['inRange', 'outOfRange']; - _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color']; - _this.layoutMode = { - type: 'box', - ignoreSize: true - }; - /** - * [lowerBound, upperBound] - */ - _this.dataBound = [-Infinity, Infinity]; - _this.targetVisuals = {}; - _this.controllerVisuals = {}; - return _this; - } - VisualMapModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - }; - /** - * @protected - */ - VisualMapModel.prototype.optionUpdated = function (newOption, isInit) { - var thisOption = this.option; - !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys); - this.textStyleModel = this.getModel('textStyle'); - this.resetItemSize(); - this.completeVisualOption(); - }; - /** - * @protected - */ - VisualMapModel.prototype.resetVisual = function (supplementVisualOption) { - var stateList = this.stateList; - supplementVisualOption = bind(supplementVisualOption, this); - this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption); - this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption); - }; - /** - * @public - */ - VisualMapModel.prototype.getItemSymbol = function () { - return null; - }; - /** - * @protected - * @return {Array.} An array of series indices. - */ - VisualMapModel.prototype.getTargetSeriesIndices = function () { - var optionSeriesIndex = this.option.seriesIndex; - var seriesIndices = []; - if (optionSeriesIndex == null || optionSeriesIndex === 'all') { - this.ecModel.eachSeries(function (seriesModel, index) { - seriesIndices.push(index); - }); - } else { - seriesIndices = normalizeToArray(optionSeriesIndex); - } - return seriesIndices; - }; - /** - * @public - */ - VisualMapModel.prototype.eachTargetSeries = function (callback, context) { - each(this.getTargetSeriesIndices(), function (seriesIndex) { - var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex); - if (seriesModel) { - callback.call(context, seriesModel); - } - }, this); - }; - /** - * @pubilc - */ - VisualMapModel.prototype.isTargetSeries = function (seriesModel) { - var is = false; - this.eachTargetSeries(function (model) { - model === seriesModel && (is = true); - }); - return is; - }; - /** - * @example - * this.formatValueText(someVal); // format single numeric value to text. - * this.formatValueText(someVal, true); // format single category value to text. - * this.formatValueText([min, max]); // format numeric min-max to text. - * this.formatValueText([this.dataBound[0], max]); // using data lower bound. - * this.formatValueText([min, this.dataBound[1]]); // using data upper bound. - * - * @param value Real value, or this.dataBound[0 or 1]. - * @param isCategory Only available when value is number. - * @param edgeSymbols Open-close symbol when value is interval. - * @protected - */ - VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) { - var option = this.option; - var precision = option.precision; - var dataBound = this.dataBound; - var formatter = option.formatter; - var isMinMax; - edgeSymbols = edgeSymbols || ['<', '>']; - if (isArray(value)) { - value = value.slice(); - isMinMax = true; - } - var textValue = isCategory ? value // Value is string when isCategory - : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value); - if (isString(formatter)) { - return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue); - } else if (isFunction(formatter)) { - return isMinMax ? formatter(value[0], value[1]) : formatter(value); - } - if (isMinMax) { - if (value[0] === dataBound[0]) { - return edgeSymbols[0] + ' ' + textValue[1]; - } else if (value[1] === dataBound[1]) { - return edgeSymbols[1] + ' ' + textValue[0]; - } else { - return textValue[0] + ' - ' + textValue[1]; - } + } + _renderYearText(calendarModel, rangeData, orient, group) { + const yearLabel = calendarModel.getModel("yearLabel"); + if (!yearLabel.get("show")) { + return; + } + const margin = yearLabel.get("margin"); + let pos = yearLabel.get("position"); + if (!pos) { + pos = orient !== "horizontal" ? "top" : "left"; + } + const points4 = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; + const xc = (points4[0][0] + points4[1][0]) / 2; + const yc = (points4[0][1] + points4[1][1]) / 2; + const idx = orient === "horizontal" ? 0 : 1; + const posPoints = { + top: [xc, points4[idx][1]], + bottom: [xc, points4[1 - idx][1]], + left: [points4[1 - idx][0], yc], + right: [points4[idx][0], yc] + }; + let name = rangeData.start.y; + if (+rangeData.end.y > +rangeData.start.y) { + name = name + "-" + rangeData.end.y; + } + const formatter = yearLabel.get("formatter"); + const params = { + start: rangeData.start.y, + end: rangeData.end.y, + nameMap: name + }; + const content = this._formatterLabel(formatter, params); + const yearText = new Text_default({ + z2: 30, + style: createTextStyle(yearLabel, { + text: content + }) + }); + yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); + group.add(yearText); + } + _monthTextPositionControl(point, isCenter, orient, position2, margin) { + let align = "left"; + let vAlign = "top"; + let x = point[0]; + let y = point[1]; + if (orient === "horizontal") { + y = y + margin; + if (isCenter) { + align = "center"; + } + if (position2 === "start") { + vAlign = "bottom"; + } + } else { + x = x + margin; + if (isCenter) { + vAlign = "middle"; + } + if (position2 === "start") { + align = "right"; + } + } + return { + x, + y, + align, + verticalAlign: vAlign + }; + } + _renderMonthText(calendarModel, localeModel, orient, group) { + const monthLabel = calendarModel.getModel("monthLabel"); + if (!monthLabel.get("show")) { + return; + } + let nameMap = monthLabel.get("nameMap"); + let margin = monthLabel.get("margin"); + const pos = monthLabel.get("position"); + const align = monthLabel.get("align"); + const termPoints = [this._tlpoints, this._blpoints]; + if (!nameMap || isString(nameMap)) { + if (nameMap) { + localeModel = getLocaleModel(nameMap) || localeModel; + } + nameMap = localeModel.get(["time", "monthAbbr"]) || []; + } + const idx = pos === "start" ? 0 : 1; + const axis = orient === "horizontal" ? 0 : 1; + margin = pos === "start" ? -margin : margin; + const isCenter = align === "center"; + for (let i = 0; i < termPoints[idx].length - 1; i++) { + const tmp = termPoints[idx][i].slice(); + const firstDay = this._firstDayOfMonth[i]; + if (isCenter) { + const firstDayPoints = this._firstDayPoints[i]; + tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; + } + const formatter = monthLabel.get("formatter"); + const name = nameMap[+firstDay.m - 1]; + const params = { + yyyy: firstDay.y, + yy: (firstDay.y + "").slice(2), + MM: firstDay.m, + M: +firstDay.m, + nameMap: name + }; + const content = this._formatterLabel(formatter, params); + const monthText = new Text_default({ + z2: 30, + style: extend(createTextStyle(monthLabel, {text: content}), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)) + }); + group.add(monthText); + } + } + _weekTextPositionControl(point, orient, position2, margin, cellSize) { + let align = "center"; + let vAlign = "middle"; + let x = point[0]; + let y = point[1]; + const isStart = position2 === "start"; + if (orient === "horizontal") { + x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; + align = isStart ? "right" : "left"; + } else { + y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; + vAlign = isStart ? "bottom" : "top"; + } + return { + x, + y, + align, + verticalAlign: vAlign + }; + } + _renderWeekText(calendarModel, localeModel, rangeData, orient, group) { + const dayLabel = calendarModel.getModel("dayLabel"); + if (!dayLabel.get("show")) { + return; + } + const coordSys = calendarModel.coordinateSystem; + const pos = dayLabel.get("position"); + let nameMap = dayLabel.get("nameMap"); + let margin = dayLabel.get("margin"); + const firstDayOfWeek = coordSys.getFirstDayOfWeek(); + if (!nameMap || isString(nameMap)) { + if (nameMap) { + localeModel = getLocaleModel(nameMap) || localeModel; + } + const dayOfWeekShort = localeModel.get(["time", "dayOfWeekShort"]); + nameMap = dayOfWeekShort || map(localeModel.get(["time", "dayOfWeekAbbr"]), (val) => val[0]); + } + let start2 = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time; + const cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; + margin = parsePercent2(margin, Math.min(cellSize[1], cellSize[0])); + if (pos === "start") { + start2 = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time; + margin = -margin; + } + for (let i = 0; i < 7; i++) { + const tmpD = coordSys.getNextNDay(start2, i); + const point = coordSys.dataToRect([tmpD.time], false).center; + let day = i; + day = Math.abs((i + firstDayOfWeek) % 7); + const weekText = new Text_default({ + z2: 30, + style: extend(createTextStyle(dayLabel, {text: nameMap[day]}), this._weekTextPositionControl(point, orient, pos, margin, cellSize)) + }); + group.add(weekText); + } + } +}; +var CalendarView = CalendarView2; +CalendarView.type = "calendar"; +var CalendarView_default = CalendarView; + +// src/coord/calendar/Calendar.ts +var PROXIMATE_ONE_DAY = 864e5; +var Calendar2 = class { + constructor(calendarModel, ecModel, api2) { + this.type = "calendar"; + this.dimensions = Calendar2.dimensions; + this.getDimensionsInfo = Calendar2.getDimensionsInfo; + this._model = calendarModel; + } + static getDimensionsInfo() { + return [{ + name: "time", + type: "time" + }, "value"]; + } + getRangeInfo() { + return this._rangeInfo; + } + getModel() { + return this._model; + } + getRect() { + return this._rect; + } + getCellWidth() { + return this._sw; + } + getCellHeight() { + return this._sh; + } + getOrient() { + return this._orient; + } + getFirstDayOfWeek() { + return this._firstDayOfWeek; + } + getDateInfo(date) { + date = parseDate(date); + const y = date.getFullYear(); + const m2 = date.getMonth() + 1; + const mStr = m2 < 10 ? "0" + m2 : "" + m2; + const d = date.getDate(); + const dStr = d < 10 ? "0" + d : "" + d; + let day = date.getDay(); + day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); + return { + y: y + "", + m: mStr, + d: dStr, + day, + time: date.getTime(), + formatedDate: y + "-" + mStr + "-" + dStr, + date + }; + } + getNextNDay(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(ecModel, api2) { + 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()); + const weeks = this._rangeInfo.weeks || 1; + const whNames = ["width", "height"]; + const cellSize = this._model.getCellSize().slice(); + const layoutParams = this._model.getBoxLayoutParams(); + const cellNumbers = this._orient === "horizontal" ? [weeks, 7] : [7, weeks]; + each([0, 1], function(idx) { + if (cellSizeSpecified(cellSize, idx)) { + layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; + } + }); + const whGlobal = { + width: api2.getWidth(), + height: api2.getHeight() + }; + const calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal); + each([0, 1], function(idx) { + if (!cellSizeSpecified(cellSize, idx)) { + cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; + } + }); + function cellSizeSpecified(cellSize2, idx) { + return cellSize2[idx] != null && cellSize2[idx] !== "auto"; + } + this._sw = cellSize[0]; + this._sh = cellSize[1]; + } + dataToPoint(data, clamp2) { + isArray(data) && (data = data[0]); + clamp2 == null && (clamp2 = true); + const dayInfo = this.getDateInfo(data); + const range = this._rangeInfo; + const date = dayInfo.formatedDate; + if (clamp2 && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) { + return [NaN, NaN]; + } + const week = dayInfo.day; + const 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 + ]; + } + pointToData(point) { + const date = this.pointToDate(point); + return date && date.time; + } + dataToRect(data, clamp2) { + const point = this.dataToPoint(data, clamp2); + 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 + ] + }; + } + pointToDate(point) { + const nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1; + const nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1; + const range = this._rangeInfo.range; + if (this._orient === "vertical") { + return this._getDateByWeeksAndDay(nthY, nthX - 1, range); + } + return this._getDateByWeeksAndDay(nthX, nthY - 1, range); + } + convertToPixel(ecModel, finder, value) { + const coordSys = getCoordSys5(finder); + return coordSys === this ? coordSys.dataToPoint(value) : null; + } + convertFromPixel(ecModel, finder, pixel) { + const coordSys = getCoordSys5(finder); + return coordSys === this ? coordSys.pointToData(pixel) : null; + } + containPoint(point) { + console.warn("Not implemented."); + return false; + } + _initRangeOption() { + let range = this._model.get("range"); + let normalizedRange; + if (isArray(range) && range.length === 1) { + range = range[0]; + } + if (!isArray(range)) { + const rangeStr = range.toString(); + if (/^\d{4}$/.test(rangeStr)) { + normalizedRange = [rangeStr + "-01-01", rangeStr + "-12-31"]; + } + if (/^\d{4}[\/|-]\d{1,2}$/.test(rangeStr)) { + const start2 = this.getDateInfo(rangeStr); + const firstDay = start2.date; + firstDay.setMonth(firstDay.getMonth() + 1); + const end2 = this.getNextNDay(firstDay, -1); + normalizedRange = [start2.formatedDate, end2.formatedDate]; + } + if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rangeStr)) { + normalizedRange = [rangeStr, rangeStr]; + } + } else { + normalizedRange = range; + } + if (!normalizedRange) { + if (true) { + logError("Invalid date range."); + } + return range; + } + const tmp = this._getRangeInfo(normalizedRange); + if (tmp.start.time > tmp.end.time) { + normalizedRange.reverse(); + } + return normalizedRange; + } + _getRangeInfo(range) { + const parsedRange = [ + this.getDateInfo(range[0]), + this.getDateInfo(range[1]) + ]; + let reversed; + if (parsedRange[0].time > parsedRange[1].time) { + reversed = true; + parsedRange.reverse(); + } + let allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1; + const date = new Date(parsedRange[0].time); + const startDateNum = date.getDate(); + const endDateNum = parsedRange[1].date.getDate(); + date.setDate(startDateNum + allDay - 1); + let dateNum = date.getDate(); + if (dateNum !== endDateNum) { + const sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1; + while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) { + allDay -= sign; + date.setDate(dateNum - sign); + } + } + const weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7); + const nthWeek = reversed ? -weeks + 1 : weeks - 1; + reversed && parsedRange.reverse(); + return { + range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate], + start: parsedRange[0], + end: parsedRange[1], + allDay, + weeks, + nthWeek, + fweek: parsedRange[0].day, + lweek: parsedRange[1].day + }; + } + _getDateByWeeksAndDay(nthWeek, day, range) { + const rangeInfo = this._getRangeInfo(range); + if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) { + return null; + } + const nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day; + const date = new Date(rangeInfo.start.time); + date.setDate(+rangeInfo.start.d + nthDay); + return this.getDateInfo(date); + } + static create(ecModel, api2) { + const calendarList = []; + ecModel.eachComponent("calendar", function(calendarModel) { + const calendar = new Calendar2(calendarModel, ecModel, api2); + calendarList.push(calendar); + calendarModel.coordinateSystem = calendar; + }); + ecModel.eachSeries(function(calendarSeries) { + if (calendarSeries.get("coordinateSystem") === "calendar") { + calendarSeries.coordinateSystem = calendarList[calendarSeries.get("calendarIndex") || 0]; + } + }); + return calendarList; + } +}; +var Calendar = Calendar2; +Calendar.dimensions = ["time", "value"]; +function getCoordSys5(finder) { + const calendarModel = finder.calendarModel; + const seriesModel = finder.seriesModel; + const coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null; + return coordSys; +} +var Calendar_default = Calendar; + +// src/component/calendar/install.ts +function install33(registers) { + registers.registerComponentModel(CalendarModel_default); + registers.registerComponentView(CalendarView_default); + registers.registerCoordinateSystem("calendar", Calendar_default); +} + +// src/component/graphic/GraphicView.ts +var nonShapeGraphicElements = { + path: null, + compoundPath: null, + group: Group_default, + image: Image_default, + text: Text_default +}; +var inner15 = makeInner(); +var GraphicComponentView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = GraphicComponentView2.type; + } + init() { + this._elMap = createHashMap(); + } + render(graphicModel, ecModel, api2) { + if (graphicModel !== this._lastGraphicModel) { + this._clear(); + } + this._lastGraphicModel = graphicModel; + this._updateElements(graphicModel); + this._relocate(graphicModel, api2); + } + _updateElements(graphicModel) { + const elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); + if (!elOptionsToUpdate) { + return; + } + const elMap = this._elMap; + const rootGroup = this.group; + const globalZ = graphicModel.get("z"); + const globalZLevel = graphicModel.get("zlevel"); + each(elOptionsToUpdate, function(elOption) { + const id = convertOptionIdName(elOption.id, null); + const elExisting = id != null ? elMap.get(id) : null; + const parentId = convertOptionIdName(elOption.parentId, null); + const targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; + const elType = elOption.type; + const elOptionStyle = elOption.style; + if (elType === "text" && elOptionStyle) { + if (elOption.hv && elOption.hv[1]) { + elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null; + } + } + let textContentOption = elOption.textContent; + let textConfig = elOption.textConfig; + if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) { + const convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true); + if (!textConfig && convertResult.textConfig) { + textConfig = elOption.textConfig = convertResult.textConfig; + } + if (!textContentOption && convertResult.textContent) { + textContentOption = convertResult.textContent; + } + } + const elOptionCleaned = getCleanedElOption(elOption); + if (true) { + elExisting && assert(targetElParent === elExisting.parent, "Changing parent is not supported."); + } + const $action = elOption.$action || "merge"; + const isMerge = $action === "merge"; + const isReplace = $action === "replace"; + if (isMerge) { + const isInit = !elExisting; + let el2 = elExisting; + if (isInit) { + el2 = createEl2(id, targetElParent, elOption.type, elMap); } else { - // Format single value (includes category case). - return textValue; + el2 && (inner15(el2).isNew = false); + stopPreviousKeyframeAnimationAndRestore(el2); } - function toFixed(val) { - return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20)); + if (el2) { + applyUpdateTransition(el2, elOptionCleaned, graphicModel, {isInit}); + updateCommonAttrs(el2, elOption, globalZ, globalZLevel); } - }; - /** - * @protected - */ - VisualMapModel.prototype.resetExtent = function () { - var thisOption = this.option; - // Can not calculate data extent by data here. - // Because series and data may be modified in processing stage. - // So we do not support the feature "auto min/max". - var extent = asc$2([thisOption.min, thisOption.max]); - this._dataExtent = extent; - }; - /** - * PENDING: - * delete this method if no outer usage. - * - * Return Concrete dimension. If null/undefined is returned, no dimension is used. - */ - // getDataDimension(data: SeriesData) { - // const optDim = this.option.dimension; - // if (optDim != null) { - // return data.getDimension(optDim); - // } - // const dimNames = data.dimensions; - // for (let i = dimNames.length - 1; i >= 0; i--) { - // const dimName = dimNames[i]; - // const dimInfo = data.getDimensionInfo(dimName); - // if (!dimInfo.isCalculationCoord) { - // return dimName; - // } - // } - // } - VisualMapModel.prototype.getDataDimensionIndex = function (data) { - var optDim = this.option.dimension; - if (optDim != null) { - return data.getDimensionIndex(optDim); - } - var dimNames = data.dimensions; - for (var i = dimNames.length - 1; i >= 0; i--) { - var dimName = dimNames[i]; - var dimInfo = data.getDimensionInfo(dimName); - if (!dimInfo.isCalculationCoord) { - return dimInfo.storeDimIndex; - } + } else if (isReplace) { + removeEl(elExisting, elOption, elMap, graphicModel); + const el2 = createEl2(id, targetElParent, elOption.type, elMap); + if (el2) { + applyUpdateTransition(el2, elOptionCleaned, graphicModel, {isInit: true}); + updateCommonAttrs(el2, elOption, globalZ, globalZLevel); } - }; - VisualMapModel.prototype.getExtent = function () { - return this._dataExtent.slice(); - }; - VisualMapModel.prototype.completeVisualOption = function () { - var ecModel = this.ecModel; - var thisOption = this.option; - var base = { - inRange: thisOption.inRange, - outOfRange: thisOption.outOfRange - }; - var target = thisOption.target || (thisOption.target = {}); - var controller = thisOption.controller || (thisOption.controller = {}); - merge(target, base); // Do not override - merge(controller, base); // Do not override - var isCategory = this.isCategory(); - completeSingle.call(this, target); - completeSingle.call(this, controller); - completeInactive.call(this, target, 'inRange', 'outOfRange'); - // completeInactive.call(this, target, 'outOfRange', 'inRange'); - completeController.call(this, controller); - function completeSingle(base) { - // Compatible with ec2 dataRange.color. - // The mapping order of dataRange.color is: [high value, ..., low value] - // whereas inRange.color and outOfRange.color is [low value, ..., high value] - // Notice: ec2 has no inverse. - if (isArray$1(thisOption.color) - // If there has been inRange: {symbol: ...}, adding color is a mistake. - // So adding color only when no inRange defined. - && !base.inRange) { - base.inRange = { - color: thisOption.color.slice().reverse() - }; - } - // Compatible with previous logic, always give a default color, otherwise - // simple config with no inRange and outOfRange will not work. - // Originally we use visualMap.color as the default color, but setOption at - // the second time the default color will be erased. So we change to use - // constant DEFAULT_COLOR. - // If user do not want the default color, set inRange: {color: null}. - base.inRange = base.inRange || { - color: ecModel.get('gradientColor') - }; + } else if ($action === "remove") { + updateLeaveTo(elExisting, elOption); + removeEl(elExisting, elOption, elMap, graphicModel); + } + const el = elMap.get(id); + if (el && textContentOption) { + if (isMerge) { + const textContentExisting = el.getTextContent(); + textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new Text_default(textContentOption)); + } else if (isReplace) { + el.setTextContent(new Text_default(textContentOption)); } - function completeInactive(base, stateExist, stateAbsent) { - var optExist = base[stateExist]; - var optAbsent = base[stateAbsent]; - if (optExist && !optAbsent) { - optAbsent = base[stateAbsent] = {}; - each$d(optExist, function (visualData, visualType) { - if (!VisualMapping.isValidType(visualType)) { - return; - } - var defa = visualDefault.get(visualType, 'inactive', isCategory); - if (defa != null) { - optAbsent[visualType] = defa; - // Compatibable with ec2: - // Only inactive color to rgba(0,0,0,0) can not - // make label transparent, so use opacity also. - if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) { - optAbsent.opacity = [0, 0]; - } - } - }); + } + if (el) { + const clipPathOption = elOption.clipPath; + if (clipPathOption) { + const clipPathType = clipPathOption.type; + let clipPath; + let isInit = false; + if (isMerge) { + const oldClipPath = el.getClipPath(); + isInit = !oldClipPath || inner15(oldClipPath).type !== clipPathType; + clipPath = isInit ? newEl(clipPathType) : oldClipPath; + } else if (isReplace) { + isInit = true; + clipPath = newEl(clipPathType); } + el.setClipPath(clipPath); + applyUpdateTransition(clipPath, clipPathOption, graphicModel, {isInit}); + applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel); } - function completeController(controller) { - var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol; - var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize; - var inactiveColor = this.get('inactiveColor'); - var itemSymbol = this.getItemSymbol(); - var defaultSymbol = itemSymbol || 'roundRect'; - each$d(this.stateList, function (state) { - var itemSize = this.itemSize; - var visuals = controller[state]; - // Set inactive color for controller if no other color - // attr (like colorAlpha) specified. - if (!visuals) { - visuals = controller[state] = { - color: isCategory ? inactiveColor : [inactiveColor] - }; - } - // Consistent symbol and symbolSize if not specified. - if (visuals.symbol == null) { - visuals.symbol = symbolExists && clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]); - } - if (visuals.symbolSize == null) { - visuals.symbolSize = symbolSizeExists && clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); - } - // Filter none - visuals.symbol = mapVisual$1(visuals.symbol, function (symbol) { - return symbol === 'none' ? defaultSymbol : symbol; - }); - // Normalize symbolSize - var symbolSize = visuals.symbolSize; - if (symbolSize != null) { - var max_1 = -Infinity; - // symbolSize can be object when categories defined. - eachVisual(symbolSize, function (value) { - value > max_1 && (max_1 = value); - }); - visuals.symbolSize = mapVisual$1(symbolSize, function (value) { - return linearMap$1(value, [0, max_1], [0, itemSize[0]], true); - }); - } - }, this); - } - }; - VisualMapModel.prototype.resetItemSize = function () { - this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))]; - }; - VisualMapModel.prototype.isCategory = function () { - return !!this.option.categories; - }; - /** - * @public - * @abstract - */ - VisualMapModel.prototype.setSelected = function (selected) {}; - VisualMapModel.prototype.getSelected = function () { - return null; - }; - /** - * @public - * @abstract - */ - VisualMapModel.prototype.getValueState = function (value) { - return null; - }; - /** - * FIXME - * Do not publish to thirt-part-dev temporarily - * util the interface is stable. (Should it return - * a function but not visual meta?) - * - * @pubilc - * @abstract - * @param getColorVisual - * params: value, valueState - * return: color - * @return {Object} visualMeta - * should includes {stops, outerColors} - * outerColor means [colorBeyondMinValue, colorBeyondMaxValue] - */ - VisualMapModel.prototype.getVisualMeta = function (getColorVisual) { - return null; - }; - VisualMapModel.type = 'visualMap'; - VisualMapModel.dependencies = ['series']; - VisualMapModel.defaultOption = { - show: true, - // zlevel: 0, - z: 4, - seriesIndex: 'all', - min: 0, - max: 200, - left: 0, - right: null, - top: null, - bottom: 0, - itemWidth: null, - itemHeight: null, - inverse: false, - orient: 'vertical', - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - contentColor: '#5793f3', - inactiveColor: '#aaa', - borderWidth: 0, - padding: 5, - // 接受数组分别设定上右下左边距,同css - textGap: 10, - precision: 0, - textStyle: { - color: '#333' // 值域文字颜色 - } - }; - - return VisualMapModel; - }(ComponentModel); - - // Constant - var DEFAULT_BAR_BOUND = [20, 140]; - var ContinuousModel = /** @class */function (_super) { - __extends(ContinuousModel, _super); - function ContinuousModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ContinuousModel.type; - return _this; - } - /** - * @override - */ - ContinuousModel.prototype.optionUpdated = function (newOption, isInit) { - _super.prototype.optionUpdated.apply(this, arguments); - this.resetExtent(); - this.resetVisual(function (mappingOption) { - mappingOption.mappingMethod = 'linear'; - mappingOption.dataExtent = this.getExtent(); + const elInner = inner15(el); + el.setTextConfig(textConfig); + elInner.option = elOption; + setEventData(el, graphicModel, elOption); + setTooltipConfig({ + el, + componentModel: graphicModel, + itemName: el.name, + itemTooltipOption: elOption.tooltip }); - this._resetRange(); - }; - /** - * @protected - * @override - */ - ContinuousModel.prototype.resetItemSize = function () { - _super.prototype.resetItemSize.apply(this, arguments); - var itemSize = this.itemSize; - (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]); - (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]); - }; - /** - * @private - */ - ContinuousModel.prototype._resetRange = function () { - var dataExtent = this.getExtent(); - var range = this.option.range; - if (!range || range.auto) { - // `range` should always be array (so we don't use other - // value like 'auto') for user-friend. (consider getOption). - dataExtent.auto = 1; - this.option.range = dataExtent; - } else if (isArray(range)) { - if (range[0] > range[1]) { - range.reverse(); - } - range[0] = Math.max(range[0], dataExtent[0]); - range[1] = Math.min(range[1], dataExtent[1]); - } - }; - /** - * @protected - * @override - */ - ContinuousModel.prototype.completeVisualOption = function () { - _super.prototype.completeVisualOption.apply(this, arguments); - each(this.stateList, function (state) { - var symbolSize = this.option.controller[state].symbolSize; - if (symbolSize && symbolSize[0] !== symbolSize[1]) { - symbolSize[0] = symbolSize[1] / 3; // For good looking. - } - }, this); - }; - /** - * @override - */ - ContinuousModel.prototype.setSelected = function (selected) { - this.option.range = selected.slice(); - this._resetRange(); - }; - /** - * @public - */ - ContinuousModel.prototype.getSelected = function () { - var dataExtent = this.getExtent(); - var dataInterval = asc((this.get('range') || []).slice()); - // Clamp - dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]); - dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]); - dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]); - dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]); - return dataInterval; - }; - /** - * @override - */ - ContinuousModel.prototype.getValueState = function (value) { - var range = this.option.range; - var dataExtent = this.getExtent(); - // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'. - // range[1] is processed likewise. - return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange'; - }; - ContinuousModel.prototype.findTargetDataIndices = function (range) { - var result = []; - this.eachTargetSeries(function (seriesModel) { - var dataIndices = []; - var data = seriesModel.getData(); - data.each(this.getDataDimensionIndex(data), function (value, dataIndex) { - range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); - }, this); - result.push({ - seriesId: seriesModel.id, - dataIndex: dataIndices - }); - }, this); - return result; - }; - /** - * @implement - */ - ContinuousModel.prototype.getVisualMeta = function (getColorVisual) { - var oVals = getColorStopValues(this, 'outOfRange', this.getExtent()); - var iVals = getColorStopValues(this, 'inRange', this.option.range.slice()); - var stops = []; - function setStop(value, valueState) { - stops.push({ - value: value, - color: getColorVisual(value, valueState) - }); - } - // Format to: outOfRange -- inRange -- outOfRange. - var iIdx = 0; - var oIdx = 0; - var iLen = iVals.length; - var oLen = oVals.length; - for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { - // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored. - if (oVals[oIdx] < iVals[iIdx]) { - setStop(oVals[oIdx], 'outOfRange'); - } - } - for (var first = 1; iIdx < iLen; iIdx++, first = 0) { - // If range is full, value beyond min, max will be clamped. - // make a singularity - first && stops.length && setStop(iVals[iIdx], 'outOfRange'); - setStop(iVals[iIdx], 'inRange'); - } - for (var first = 1; oIdx < oLen; oIdx++) { - if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { - // make a singularity - if (first) { - stops.length && setStop(stops[stops.length - 1].value, 'outOfRange'); - first = 0; - } - setStop(oVals[oIdx], 'outOfRange'); + applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel); + } + }); + } + _relocate(graphicModel, api2) { + const elOptions = graphicModel.option.elements; + const rootGroup = this.group; + const elMap = this._elMap; + const apiWidth = api2.getWidth(); + const apiHeight = api2.getHeight(); + const xy = ["x", "y"]; + for (let i = 0; i < elOptions.length; i++) { + const elOption = elOptions[i]; + const id = convertOptionIdName(elOption.id, null); + const el = id != null ? elMap.get(id) : null; + if (!el || !el.isGroup) { + continue; + } + const parentEl = el.parent; + const isParentRoot = parentEl === rootGroup; + const elInner = inner15(el); + const parentElInner = inner15(parentEl); + elInner.width = parsePercent2(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0; + elInner.height = parsePercent2(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0; + } + for (let i = elOptions.length - 1; i >= 0; i--) { + const elOption = elOptions[i]; + const id = convertOptionIdName(elOption.id, null); + const el = id != null ? elMap.get(id) : null; + if (!el) { + continue; + } + const parentEl = el.parent; + const parentElInner = inner15(parentEl); + const containerInfo = parentEl === rootGroup ? { + width: apiWidth, + height: apiHeight + } : { + width: parentElInner.width, + height: parentElInner.height + }; + const layoutPos = {}; + const layouted = positionElement(el, elOption, containerInfo, null, {hv: elOption.hv, boundingMode: elOption.bounding}, layoutPos); + if (!inner15(el).isNew && layouted) { + const transition = elOption.transition; + const animatePos = {}; + for (let k = 0; k < xy.length; k++) { + const key = xy[k]; + const val = layoutPos[key]; + if (transition && (isTransitionAll(transition) || indexOf(transition, key) >= 0)) { + animatePos[key] = val; + } else { + el[key] = val; } } - var stopsLen = stops.length; - return { - stops: stops, - outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent'] - }; - }; - ContinuousModel.type = 'visualMap.continuous'; - ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, { - align: 'auto', - calculable: false, - hoverLink: true, - realtime: true, - handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z', - handleSize: '120%', - handleStyle: { - borderColor: '#fff', - borderWidth: 1 - }, - indicatorIcon: 'circle', - indicatorSize: '50%', - indicatorStyle: { - borderColor: '#fff', - borderWidth: 2, - shadowBlur: 2, - shadowOffsetX: 1, - shadowOffsetY: 1, - shadowColor: 'rgba(0,0,0,0.2)' - } - // emphasis: { - // handleStyle: { - // shadowBlur: 3, - // shadowOffsetX: 1, - // shadowOffsetY: 1, - // shadowColor: 'rgba(0,0,0,0.2)' - // } - // } + updateProps(el, animatePos, graphicModel, 0); + } else { + el.attr(layoutPos); + } + } + } + _clear() { + const elMap = this._elMap; + elMap.each((el) => { + removeEl(el, inner15(el).option, elMap, this._lastGraphicModel); + }); + this._elMap = createHashMap(); + } + dispose() { + this._clear(); + } +}; +var GraphicComponentView = GraphicComponentView2; +GraphicComponentView.type = "graphic"; +function newEl(graphicType) { + if (true) { + assert(graphicType, "graphic type MUST be set"); + } + const Clz = hasOwn(nonShapeGraphicElements, graphicType) ? nonShapeGraphicElements[graphicType] : getShapeClass(graphicType); + if (true) { + assert(Clz, `graphic type ${graphicType} can not be found`); + } + const el = new Clz({}); + inner15(el).type = graphicType; + return el; +} +function createEl2(id, targetElParent, graphicType, elMap) { + const el = newEl(graphicType); + targetElParent.add(el); + elMap.set(id, el); + inner15(el).id = id; + inner15(el).isNew = true; + return el; +} +function removeEl(elExisting, elOption, elMap, graphicModel) { + const existElParent = elExisting && elExisting.parent; + if (existElParent) { + elExisting.type === "group" && elExisting.traverse(function(el) { + removeEl(el, elOption, elMap, graphicModel); + }); + applyLeaveTransition(elExisting, elOption, graphicModel); + elMap.removeKey(inner15(elExisting).id); + } +} +function updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) { + if (!el.isGroup) { + each([ + ["cursor", Displayable_default.prototype.cursor], + ["zlevel", defaultZlevel || 0], + ["z", defaultZ || 0], + ["z2", 0] + ], (item) => { + const prop = item[0]; + if (hasOwn(elOption, prop)) { + el[prop] = retrieve2(elOption[prop], item[1]); + } else if (el[prop] == null) { + el[prop] = item[1]; + } + }); + } + each(keys(elOption), (key) => { + if (key.indexOf("on") === 0) { + const val = elOption[key]; + el[key] = isFunction(val) ? val : null; + } + }); + if (hasOwn(elOption, "draggable")) { + el.draggable = elOption.draggable; + } + elOption.name != null && (el.name = elOption.name); + elOption.id != null && (el.id = elOption.id); +} +function getCleanedElOption(elOption) { + elOption = extend({}, elOption); + each(["id", "parentId", "$action", "hv", "bounding", "textContent", "clipPath"].concat(LOCATION_PARAMS), function(name) { + delete elOption[name]; + }); + return elOption; +} +function setEventData(el, graphicModel, elOption) { + let eventData = getECData(el).eventData; + if (!el.silent && !el.ignore && !eventData) { + eventData = getECData(el).eventData = { + componentType: "graphic", + componentIndex: graphicModel.componentIndex, + name: el.name + }; + } + if (eventData) { + eventData.info = elOption.info; + } +} + +// src/component/graphic/install.ts +function install34(registers) { + registers.registerComponentModel(GraphicComponentModel); + registers.registerComponentView(GraphicComponentView); + registers.registerPreprocessor(function(option) { + const graphicOption = option.graphic; + if (isArray(graphicOption)) { + if (!graphicOption[0] || !graphicOption[0].elements) { + option.graphic = [{elements: graphicOption}]; + } else { + option.graphic = [option.graphic[0]]; + } + } else if (graphicOption && !graphicOption.elements) { + option.graphic = [{elements: [graphicOption]}]; + } + }); +} + +// src/component/dataZoom/helper.ts +var DATA_ZOOM_AXIS_DIMENSIONS = [ + "x", + "y", + "radius", + "angle", + "single" +]; +var SERIES_COORDS = ["cartesian2d", "polar", "singleAxis"]; +function isCoordSupported(seriesModel) { + const coordType = seriesModel.get("coordinateSystem"); + return indexOf(SERIES_COORDS, coordType) >= 0; +} +function getAxisMainType(axisDim) { + if (true) { + assert(axisDim); + } + return axisDim + "Axis"; +} +function findEffectedDataZooms(ecModel, payload) { + const axisRecords = createHashMap(); + const effectedModels = []; + const effectedModelMap = createHashMap(); + ecModel.eachComponent({mainType: "dataZoom", query: payload}, function(dataZoomModel) { + if (!effectedModelMap.get(dataZoomModel.uid)) { + addToEffected(dataZoomModel); + } + }); + let foundNewLink; + do { + foundNewLink = false; + ecModel.eachComponent("dataZoom", processSingle); + } while (foundNewLink); + function processSingle(dataZoomModel) { + if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) { + addToEffected(dataZoomModel); + foundNewLink = true; + } + } + function addToEffected(dataZoom) { + effectedModelMap.set(dataZoom.uid, true); + effectedModels.push(dataZoom); + markAxisControlled(dataZoom); + } + function isLinked(dataZoomModel) { + let isLink = false; + dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) { + const axisIdxArr = axisRecords.get(axisDim); + if (axisIdxArr && axisIdxArr[axisIndex]) { + isLink = true; + } + }); + return isLink; + } + function markAxisControlled(dataZoomModel) { + dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) { + (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true; + }); + } + return effectedModels; +} +function collectReferCoordSysModelInfo(dataZoomModel) { + const ecModel = dataZoomModel.ecModel; + const coordSysInfoWrap = { + infoList: [], + infoMap: createHashMap() + }; + dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) { + const axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + if (!axisModel) { + return; + } + const coordSysModel = axisModel.getCoordSysModel(); + if (!coordSysModel) { + return; + } + const coordSysUid = coordSysModel.uid; + let coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid); + if (!coordSysInfo) { + coordSysInfo = {model: coordSysModel, axisModels: []}; + coordSysInfoWrap.infoList.push(coordSysInfo); + coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo); + } + coordSysInfo.axisModels.push(axisModel); + }); + return coordSysInfoWrap; +} + +// src/component/dataZoom/DataZoomModel.ts +var DataZoomAxisInfo = class { + constructor() { + this.indexList = []; + this.indexMap = []; + } + add(axisCmptIdx) { + if (!this.indexMap[axisCmptIdx]) { + this.indexList.push(axisCmptIdx); + this.indexMap[axisCmptIdx] = true; + } + } +}; +var DataZoomModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = DataZoomModel2.type; + this._autoThrottle = true; + this._noTarget = true; + this._rangePropMode = ["percent", "percent"]; + } + init(option, parentModel, ecModel) { + const inputRawOption = retrieveRawOption(option); + this.settledOption = inputRawOption; + this.mergeDefaultAndTheme(option, ecModel); + this._doInit(inputRawOption); + } + mergeOption(newOption) { + const inputRawOption = retrieveRawOption(newOption); + merge(this.option, newOption, true); + merge(this.settledOption, inputRawOption, true); + this._doInit(inputRawOption); + } + _doInit(inputRawOption) { + const thisOption = this.option; + this._setDefaultThrottle(inputRawOption); + this._updateRangeUse(inputRawOption); + const settledOption = this.settledOption; + each([["start", "startValue"], ["end", "endValue"]], function(names, index) { + if (this._rangePropMode[index] === "value") { + thisOption[names[0]] = settledOption[names[0]] = null; + } + }, this); + this._resetTarget(); + } + _resetTarget() { + const optionOrient = this.get("orient", true); + const targetAxisIndexMap = this._targetAxisInfoMap = createHashMap(); + const hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap); + if (hasAxisSpecified) { + this._orient = optionOrient || this._makeAutoOrientByTargetAxis(); + } else { + this._orient = optionOrient || "horizontal"; + this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient); + } + this._noTarget = true; + targetAxisIndexMap.each(function(axisInfo) { + if (axisInfo.indexList.length) { + this._noTarget = false; + } + }, this); + } + _fillSpecifiedTargetAxis(targetAxisIndexMap) { + let hasAxisSpecified = false; + each(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim) { + const refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING); + if (!refering.specified) { + return; + } + hasAxisSpecified = true; + const axisInfo = new DataZoomAxisInfo(); + each(refering.models, function(axisModel) { + axisInfo.add(axisModel.componentIndex); }); - - return ContinuousModel; - }(VisualMapModel); - function getColorStopValues(visualMapModel, valueState, dataExtent) { - if (dataExtent[0] === dataExtent[1]) { - return dataExtent.slice(); - } - // When using colorHue mapping, it is not linear color any more. - // Moreover, canvas gradient seems not to be accurate linear. - // FIXME - // Should be arbitrary value 100? or based on pixel size? - var count = 200; - var step = (dataExtent[1] - dataExtent[0]) / count; - var value = dataExtent[0]; - var stopValues = []; - for (var i = 0; i <= count && value < dataExtent[1]; i++) { - stopValues.push(value); - value += step; - } - stopValues.push(dataExtent[1]); - return stopValues; - } - - var VisualMapView = /** @class */function (_super) { - __extends(VisualMapView, _super); - function VisualMapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = VisualMapView.type; - _this.autoPositionValues = { - left: 1, - right: 1, - top: 1, - bottom: 1 - }; - return _this; + targetAxisIndexMap.set(axisDim, axisInfo); + }, this); + return hasAxisSpecified; + } + _fillAutoTargetAxisByOrient(targetAxisIndexMap, orient) { + const ecModel = this.ecModel; + let needAuto = true; + if (needAuto) { + const axisDim = orient === "vertical" ? "y" : "x"; + const axisModels = ecModel.findComponents({mainType: axisDim + "Axis"}); + setParallelAxis(axisModels, axisDim); + } + if (needAuto) { + const axisModels = ecModel.findComponents({ + mainType: "singleAxis", + filter: (axisModel) => axisModel.get("orient", true) === orient + }); + setParallelAxis(axisModels, "single"); + } + function setParallelAxis(axisModels, axisDim) { + const axisModel = axisModels[0]; + if (!axisModel) { + return; } - VisualMapView.prototype.init = function (ecModel, api) { - this.ecModel = ecModel; - this.api = api; - }; - /** - * @protected - */ - VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE - ) { - this.visualMapModel = visualMapModel; - if (visualMapModel.get('show') === false) { - this.group.removeAll(); - return; - } - this.doRender(visualMapModel, ecModel, api, payload); - }; - /** - * @protected - */ - VisualMapView.prototype.renderBackground = function (group) { - var visualMapModel = this.visualMapModel; - var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0); - var rect = group.getBoundingRect(); - group.add(new Rect({ - z2: -1, - silent: true, - shape: { - x: rect.x - padding[3], - y: rect.y - padding[0], - width: rect.width + padding[3] + padding[1], - height: rect.height + padding[0] + padding[2] - }, - style: { - fill: visualMapModel.get('backgroundColor'), - stroke: visualMapModel.get('borderColor'), - lineWidth: visualMapModel.get('borderWidth') - } - })); - }; - /** - * @protected - * @param targetValue can be Infinity or -Infinity - * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize' - * @param opts - * @param opts.forceState Specify state, instead of using getValueState method. - * @param opts.convertOpacityToAlpha For color gradient in controller widget. - * @return {*} Visual value. - */ - VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) { - opts = opts || {}; - var forceState = opts.forceState; - var visualMapModel = this.visualMapModel; - var visualObj = {}; - // Default values. - if (visualCluster === 'color') { - var defaultColor = visualMapModel.get('contentColor'); - visualObj.color = defaultColor; - } - function getter(key) { - return visualObj[key]; - } - function setter(key, value) { - visualObj[key] = value; - } - var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)]; - var visualTypes = VisualMapping.prepareVisualTypes(mappings); - each(visualTypes, function (type) { - var visualMapping = mappings[type]; - if (opts.convertOpacityToAlpha && type === 'opacity') { - type = 'colorAlpha'; - visualMapping = mappings.__alphaForOpacity; - } - if (VisualMapping.dependsOn(type, visualCluster)) { - visualMapping && visualMapping.applyVisual(targetValue, getter, setter); + const axisInfo = new DataZoomAxisInfo(); + axisInfo.add(axisModel.componentIndex); + targetAxisIndexMap.set(axisDim, axisInfo); + needAuto = false; + if (axisDim === "x" || axisDim === "y") { + const gridModel = axisModel.getReferringComponents("grid", SINGLE_REFERRING).models[0]; + gridModel && each(axisModels, function(axModel) { + if (axisModel.componentIndex !== axModel.componentIndex && gridModel === axModel.getReferringComponents("grid", SINGLE_REFERRING).models[0]) { + axisInfo.add(axModel.componentIndex); } }); - return visualObj[visualCluster]; - }; - VisualMapView.prototype.positionGroup = function (group) { - var model = this.visualMapModel; - var api = this.api; - positionElement(group, model.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() + } + } + if (needAuto) { + each(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim) { + if (!needAuto) { + return; + } + const axisModels = ecModel.findComponents({ + mainType: getAxisMainType(axisDim), + filter: (axisModel) => axisModel.get("type", true) === "category" }); - }; - VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {}; - VisualMapView.type = 'visualMap'; - return VisualMapView; - }(ComponentView); - - var paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']]; - /** - * @param visualMapModel - * @param api - * @param itemSize always [short, long] - * @return {string} 'left' or 'right' or 'top' or 'bottom' - */ - function getItemAlign(visualMapModel, api, itemSize) { - var modelOption = visualMapModel.option; - var itemAlign = modelOption.align; - if (itemAlign != null && itemAlign !== 'auto') { - return itemAlign; - } - // Auto decision align. - var ecSize = { - width: api.getWidth(), - height: api.getHeight() - }; - var realIndex = modelOption.orient === 'horizontal' ? 1 : 0; - var reals = paramsSet[realIndex]; - var fakeValue = [0, null, 10]; - var layoutInput = {}; - for (var i = 0; i < 3; i++) { - layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i]; - layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]]; - } - var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex]; - var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding); - return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1]; - } - /** - * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and - * dataIndexInside means filtered index. - */ - // TODO: TYPE more specified payload types. - function makeHighDownBatch(batch, visualMapModel) { - each(batch || [], function (batchItem) { - if (batchItem.dataIndex != null) { - batchItem.dataIndexInside = batchItem.dataIndex; - batchItem.dataIndex = null; - } - batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : ''); - }); - return batch; - } - - var linearMap$2 = linearMap; - var each$e = each; - var mathMin$a = Math.min; - var mathMax$a = Math.max; - // Arbitrary value - var HOVER_LINK_SIZE = 12; - var HOVER_LINK_OUT = 6; - // Notice: - // Any "interval" should be by the order of [low, high]. - // "handle0" (handleIndex === 0) maps to - // low data value: this._dataInterval[0] and has low coord. - // "handle1" (handleIndex === 1) maps to - // high data value: this._dataInterval[1] and has high coord. - // The logic of transform is implemented in this._createBarGroup. - var ContinuousView = /** @class */function (_super) { - __extends(ContinuousView, _super); - function ContinuousView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ContinuousView.type; - _this._shapes = {}; - _this._dataInterval = []; - _this._handleEnds = []; - _this._hoverLinkDataIndices = []; - return _this; - } - ContinuousView.prototype.init = function (ecModel, api) { - _super.prototype.init.call(this, ecModel, api); - this._hoverLinkFromSeriesMouseOver = bind(this._hoverLinkFromSeriesMouseOver, this); - this._hideIndicator = bind(this._hideIndicator, this); - }; - ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) { - if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) { - this._buildView(); + if (axisModels[0]) { + const axisInfo = new DataZoomAxisInfo(); + axisInfo.add(axisModels[0].componentIndex); + targetAxisIndexMap.set(axisDim, axisInfo); + needAuto = false; } - }; - ContinuousView.prototype._buildView = function () { - this.group.removeAll(); - var visualMapModel = this.visualMapModel; - var thisGroup = this.group; - this._orient = visualMapModel.get('orient'); - this._useHandle = visualMapModel.get('calculable'); - this._resetInterval(); - this._renderBar(thisGroup); - var dataRangeText = visualMapModel.get('text'); - this._renderEndsText(thisGroup, dataRangeText, 0); - this._renderEndsText(thisGroup, dataRangeText, 1); - // Do this for background size calculation. - this._updateView(true); - // After updating view, inner shapes is built completely, - // and then background can be rendered. - this.renderBackground(thisGroup); - // Real update view - this._updateView(); - this._enableHoverLinkToSeries(); - this._enableHoverLinkFromSeries(); - this.positionGroup(thisGroup); - }; - ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) { - if (!dataRangeText) { - return; + }, this); + } + } + _makeAutoOrientByTargetAxis() { + let dim; + this.eachTargetAxis(function(axisDim) { + !dim && (dim = axisDim); + }, this); + return dim === "y" ? "vertical" : "horizontal"; + } + _setDefaultThrottle(inputRawOption) { + if (inputRawOption.hasOwnProperty("throttle")) { + this._autoThrottle = false; + } + if (this._autoThrottle) { + const globalOption = this.ecModel.option; + this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20; + } + } + _updateRangeUse(inputRawOption) { + const rangePropMode = this._rangePropMode; + const rangeModeInOption = this.get("rangeMode"); + each([["start", "startValue"], ["end", "endValue"]], function(names, index) { + const percentSpecified = inputRawOption[names[0]] != null; + const valueSpecified = inputRawOption[names[1]] != null; + if (percentSpecified && !valueSpecified) { + rangePropMode[index] = "percent"; + } else if (!percentSpecified && valueSpecified) { + rangePropMode[index] = "value"; + } else if (rangeModeInOption) { + rangePropMode[index] = rangeModeInOption[index]; + } else if (percentSpecified) { + rangePropMode[index] = "percent"; + } + }); + } + noTarget() { + return this._noTarget; + } + getFirstTargetAxisModel() { + let firstAxisModel; + this.eachTargetAxis(function(axisDim, axisIndex) { + if (firstAxisModel == null) { + firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + } + }, this); + return firstAxisModel; + } + eachTargetAxis(callback, context) { + this._targetAxisInfoMap.each(function(axisInfo, axisDim) { + each(axisInfo.indexList, function(axisIndex) { + callback.call(context, axisDim, axisIndex); + }); + }); + } + getAxisProxy(axisDim, axisIndex) { + const axisModel = this.getAxisModel(axisDim, axisIndex); + if (axisModel) { + return axisModel.__dzAxisProxy; + } + } + getAxisModel(axisDim, axisIndex) { + if (true) { + assert(axisDim && axisIndex != null); + } + const axisInfo = this._targetAxisInfoMap.get(axisDim); + if (axisInfo && axisInfo.indexMap[axisIndex]) { + return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + } + } + setRawRange(opt) { + const thisOption = this.option; + const settledOption = this.settledOption; + each([["start", "startValue"], ["end", "endValue"]], function(names) { + if (opt[names[0]] != null || opt[names[1]] != null) { + thisOption[names[0]] = settledOption[names[0]] = opt[names[0]]; + thisOption[names[1]] = settledOption[names[1]] = opt[names[1]]; + } + }, this); + this._updateRangeUse(opt); + } + setCalculatedRange(opt) { + const option = this.option; + each(["start", "startValue", "end", "endValue"], function(name) { + option[name] = opt[name]; + }); + } + getPercentRange() { + const axisProxy = this.findRepresentativeAxisProxy(); + if (axisProxy) { + return axisProxy.getDataPercentWindow(); + } + } + getValueRange(axisDim, axisIndex) { + if (axisDim == null && axisIndex == null) { + const axisProxy = this.findRepresentativeAxisProxy(); + if (axisProxy) { + return axisProxy.getDataValueWindow(); + } + } else { + return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow(); + } + } + findRepresentativeAxisProxy(axisModel) { + if (axisModel) { + return axisModel.__dzAxisProxy; + } + let firstProxy; + const axisDimList = this._targetAxisInfoMap.keys(); + for (let i = 0; i < axisDimList.length; i++) { + const axisDim = axisDimList[i]; + const axisInfo = this._targetAxisInfoMap.get(axisDim); + for (let j = 0; j < axisInfo.indexList.length; j++) { + const proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]); + if (proxy.hostedBy(this)) { + return proxy; + } + if (!firstProxy) { + firstProxy = proxy; + } + } + } + return firstProxy; + } + getRangePropMode() { + return this._rangePropMode.slice(); + } + getOrient() { + if (true) { + assert(this._orient); + } + return this._orient; + } +}; +var DataZoomModel = DataZoomModel2; +DataZoomModel.type = "dataZoom"; +DataZoomModel.dependencies = [ + "xAxis", + "yAxis", + "radiusAxis", + "angleAxis", + "singleAxis", + "series", + "toolbox" +]; +DataZoomModel.defaultOption = { + z: 4, + filterMode: "filter", + start: 0, + end: 100 +}; +function retrieveRawOption(option) { + const ret = {}; + each(["start", "end", "startValue", "endValue", "throttle"], function(name) { + option.hasOwnProperty(name) && (ret[name] = option[name]); + }); + return ret; +} +var DataZoomModel_default = DataZoomModel; + +// src/component/dataZoom/SelectZoomModel.ts +var SelectDataZoomModel2 = class extends DataZoomModel_default { + constructor() { + super(...arguments); + this.type = SelectDataZoomModel2.type; + } +}; +var SelectDataZoomModel = SelectDataZoomModel2; +SelectDataZoomModel.type = "dataZoom.select"; +var SelectZoomModel_default = SelectDataZoomModel; + +// src/component/dataZoom/DataZoomView.ts +var DataZoomView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = DataZoomView2.type; + } + render(dataZoomModel, ecModel, api2, payload) { + this.dataZoomModel = dataZoomModel; + this.ecModel = ecModel; + this.api = api2; + } +}; +var DataZoomView = DataZoomView2; +DataZoomView.type = "dataZoom"; +var DataZoomView_default = DataZoomView; + +// src/component/dataZoom/SelectZoomView.ts +var SelectDataZoomView2 = class extends DataZoomView_default { + constructor() { + super(...arguments); + this.type = SelectDataZoomView2.type; + } +}; +var SelectDataZoomView = SelectDataZoomView2; +SelectDataZoomView.type = "dataZoom.select"; +var SelectZoomView_default = SelectDataZoomView; + +// src/component/dataZoom/AxisProxy.ts +var each9 = each; +var asc2 = asc; +var AxisProxy = class { + constructor(dimName, axisIndex, dataZoomModel, ecModel) { + this._dimName = dimName; + this._axisIndex = axisIndex; + this.ecModel = ecModel; + this._dataZoomModel = dataZoomModel; + } + hostedBy(dataZoomModel) { + return this._dataZoomModel === dataZoomModel; + } + getDataValueWindow() { + return this._valueWindow.slice(); + } + getDataPercentWindow() { + return this._percentWindow.slice(); + } + getTargetSeriesModels() { + const seriesModels = []; + this.ecModel.eachSeries(function(seriesModel) { + if (isCoordSupported(seriesModel)) { + const axisMainType = getAxisMainType(this._dimName); + const axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0]; + if (axisModel && this._axisIndex === axisModel.componentIndex) { + seriesModels.push(seriesModel); } - // Compatible with ec2, text[0] map to high value, text[1] map low value. - var text = dataRangeText[1 - endsIndex]; - text = text != null ? text + '' : ''; - var visualMapModel = this.visualMapModel; - var textGap = visualMapModel.get('textGap'); - var itemSize = visualMapModel.itemSize; - var barGroup = this._shapes.mainGroup; - var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup); - var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup); - var orient = this._orient; - var textStyleModel = this.visualMapModel.textStyleModel; - this.group.add(new ZRText({ - style: createTextStyle(textStyleModel, { - x: position[0], - y: position[1], - verticalAlign: orient === 'horizontal' ? 'middle' : align, - align: orient === 'horizontal' ? align : 'center', - text: text - }) - })); - }; - ContinuousView.prototype._renderBar = function (targetGroup) { - var visualMapModel = this.visualMapModel; - var shapes = this._shapes; - var itemSize = visualMapModel.itemSize; - var orient = this._orient; - var useHandle = this._useHandle; - var itemAlign = getItemAlign(visualMapModel, this.api, itemSize); - var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign); - var gradientBarGroup = new Group(); - mainGroup.add(gradientBarGroup); - // Bar - gradientBarGroup.add(shapes.outOfRange = createPolygon()); - gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true))); - // A border radius clip. - gradientBarGroup.setClipPath(new Rect({ - shape: { - x: 0, - y: 0, - width: itemSize[0], - height: itemSize[1], - r: 3 - } - })); - var textRect = visualMapModel.textStyleModel.getTextRect('国'); - var textSize = mathMax$a(textRect.width, textRect.height); - // Handle - if (useHandle) { - shapes.handleThumbs = []; - shapes.handleLabels = []; - shapes.handleLabelPoints = []; - this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient); - this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient); - } - this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient); - targetGroup.add(mainGroup); - }; - ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) { - var onDrift = bind(this._dragHandle, this, handleIndex, false); - var onDragEnd = bind(this._dragHandle, this, handleIndex, true); - var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]); - var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true); - var cursor = getCursor$1(this._orient); - handleThumb.attr({ - cursor: cursor, - draggable: true, - drift: onDrift, - ondragend: onDragEnd, - onmousemove: function (e) { - stop(e.event); + } + }, this); + return seriesModels; + } + getAxisModel() { + return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex); + } + getMinMaxSpan() { + return clone(this._minMaxSpan); + } + calculateDataWindow(opt) { + const dataExtent = this._dataExtent; + const axisModel = this.getAxisModel(); + const scale4 = axisModel.axis.scale; + const rangePropMode = this._dataZoomModel.getRangePropMode(); + const percentExtent = [0, 100]; + const percentWindow = []; + const valueWindow = []; + let hasPropModeValue; + each9(["start", "end"], function(prop, idx) { + let boundPercent = opt[prop]; + let boundValue = opt[prop + "Value"]; + if (rangePropMode[idx] === "percent") { + boundPercent == null && (boundPercent = percentExtent[idx]); + boundValue = scale4.parse(linearMap(boundPercent, percentExtent, dataExtent)); + } else { + hasPropModeValue = true; + boundValue = boundValue == null ? dataExtent[idx] : scale4.parse(boundValue); + boundPercent = linearMap(boundValue, dataExtent, percentExtent); + } + valueWindow[idx] = boundValue == null || isNaN(boundValue) ? dataExtent[idx] : boundValue; + percentWindow[idx] = boundPercent == null || isNaN(boundPercent) ? percentExtent[idx] : boundPercent; + }); + asc2(valueWindow); + asc2(percentWindow); + const spans = this._minMaxSpan; + hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true); + function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) { + const suffix = toValue ? "Span" : "ValueSpan"; + sliderMove(0, fromWindow, fromExtent, "all", spans["min" + suffix], spans["max" + suffix]); + for (let i = 0; i < 2; i++) { + toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true); + toValue && (toWindow[i] = scale4.parse(toWindow[i])); + } + } + return { + valueWindow, + percentWindow + }; + } + reset(dataZoomModel) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } + const targetSeries = this.getTargetSeriesModels(); + this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); + this._updateMinMaxSpan(); + const dataWindow = this.calculateDataWindow(dataZoomModel.settledOption); + this._valueWindow = dataWindow.valueWindow; + this._percentWindow = dataWindow.percentWindow; + this._setAxisModel(); + } + filterData(dataZoomModel, api2) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } + const axisDim = this._dimName; + const seriesModels = this.getTargetSeriesModels(); + const filterMode = dataZoomModel.get("filterMode"); + const valueWindow = this._valueWindow; + if (filterMode === "none") { + return; + } + each9(seriesModels, function(seriesModel) { + let seriesData = seriesModel.getData(); + const dataDims = seriesData.mapDimensionsAll(axisDim); + if (!dataDims.length) { + return; + } + if (filterMode === "weakFilter") { + const store = seriesData.getStore(); + const dataDimIndices = map(dataDims, (dim) => seriesData.getDimensionIndex(dim), seriesData); + seriesData.filterSelf(function(dataIndex) { + let leftOut; + let rightOut; + let hasValue; + for (let i = 0; i < dataDims.length; i++) { + const value = store.get(dataDimIndices[i], dataIndex); + const thisHasValue = !isNaN(value); + const thisLeftOut = value < valueWindow[0]; + const thisRightOut = value > valueWindow[1]; + if (thisHasValue && !thisLeftOut && !thisRightOut) { + return true; + } + thisHasValue && (hasValue = true); + thisLeftOut && (leftOut = true); + thisRightOut && (rightOut = true); } + return hasValue && leftOut && rightOut; }); - handleThumb.x = itemSize[0] / 2; - handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle()); - handleThumb.setStyle({ - strokeNoScale: true, - strokeFirst: true + } else { + each9(dataDims, function(dim) { + if (filterMode === "empty") { + seriesModel.setData(seriesData = seriesData.map(dim, function(value) { + return !isInWindow(value) ? NaN : value; + })); + } else { + const range = {}; + range[dim] = valueWindow; + seriesData.selectRange(range); + } }); - handleThumb.style.lineWidth *= 2; - handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle(); - setAsHighDownDispatcher(handleThumb, true); - mainGroup.add(handleThumb); - // Text is always horizontal layout but should not be effected by - // transform (orient/inverse). So label is built separately but not - // use zrender/graphic/helper/RectText, and is located based on view - // group (according to handleLabelPoint) but not barGroup. - var textStyleModel = this.visualMapModel.textStyleModel; - var handleLabel = new ZRText({ - cursor: cursor, - draggable: true, - drift: onDrift, - onmousemove: function (e) { - // For mobile device, prevent screen slider on the button. - stop(e.event); - }, - ondragend: onDragEnd, - style: createTextStyle(textStyleModel, { - x: 0, - y: 0, - text: '' - }) + } + each9(dataDims, function(dim) { + seriesData.setApproximateExtent(valueWindow, dim); + }); + }); + function isInWindow(value) { + return value >= valueWindow[0] && value <= valueWindow[1]; + } + } + _updateMinMaxSpan() { + const minMaxSpan = this._minMaxSpan = {}; + const dataZoomModel = this._dataZoomModel; + const dataExtent = this._dataExtent; + each9(["min", "max"], function(minMax) { + let percentSpan = dataZoomModel.get(minMax + "Span"); + let valueSpan = dataZoomModel.get(minMax + "ValueSpan"); + valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan)); + if (valueSpan != null) { + percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true); + } else if (percentSpan != null) { + valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0]; + } + minMaxSpan[minMax + "Span"] = percentSpan; + minMaxSpan[minMax + "ValueSpan"] = valueSpan; + }, this); + } + _setAxisModel() { + const axisModel = this.getAxisModel(); + const percentWindow = this._percentWindow; + const valueWindow = this._valueWindow; + if (!percentWindow) { + return; + } + let precision = getPixelPrecision(valueWindow, [0, 500]); + precision = Math.min(precision, 20); + const rawExtentInfo = axisModel.axis.scale.rawExtentInfo; + if (percentWindow[0] !== 0) { + rawExtentInfo.setDeterminedMinMax("min", +valueWindow[0].toFixed(precision)); + } + if (percentWindow[1] !== 100) { + rawExtentInfo.setDeterminedMinMax("max", +valueWindow[1].toFixed(precision)); + } + rawExtentInfo.freeze(); + } +}; +function calculateDataExtent(axisProxy, axisDim, seriesModels) { + const dataExtent = [Infinity, -Infinity]; + each9(seriesModels, function(seriesModel) { + unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim); + }); + const axisModel = axisProxy.getAxisModel(); + const rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate(); + return [rawExtentResult.min, rawExtentResult.max]; +} +var AxisProxy_default = AxisProxy; + +// src/component/dataZoom/dataZoomProcessor.ts +var dataZoomProcessor = { + getTargetSeries(ecModel) { + function eachAxisModel(cb) { + ecModel.eachComponent("dataZoom", function(dataZoomModel) { + dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) { + const axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + cb(axisDim, axisIndex, axisModel, dataZoomModel); }); - handleLabel.ensureState('blur').style = { - opacity: 0.1 - }; - handleLabel.stateTransition = { - duration: 200 - }; - this.group.add(handleLabel); - var handleLabelPoint = [handleSize, 0]; - var shapes = this._shapes; - shapes.handleThumbs[handleIndex] = handleThumb; - shapes.handleLabelPoints[handleIndex] = handleLabelPoint; - shapes.handleLabels[handleIndex] = handleLabel; - }; - ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) { - var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]); - var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true); - indicator.attr({ - cursor: 'move', - invisible: true, - silent: true, - x: itemSize[0] / 2 + }); + } + eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) { + axisModel.__dzAxisProxy = null; + }); + const proxyList = []; + eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) { + if (!axisModel.__dzAxisProxy) { + axisModel.__dzAxisProxy = new AxisProxy_default(axisDim, axisIndex, dataZoomModel, ecModel); + proxyList.push(axisModel.__dzAxisProxy); + } + }); + const seriesModelMap = createHashMap(); + each(proxyList, function(axisProxy) { + each(axisProxy.getTargetSeriesModels(), function(seriesModel) { + seriesModelMap.set(seriesModel.uid, seriesModel); + }); + }); + return seriesModelMap; + }, + overallReset(ecModel, api2) { + ecModel.eachComponent("dataZoom", function(dataZoomModel) { + dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) { + dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel); + }); + dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) { + dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api2); + }); + }); + ecModel.eachComponent("dataZoom", function(dataZoomModel) { + const axisProxy = dataZoomModel.findRepresentativeAxisProxy(); + if (axisProxy) { + const percentRange = axisProxy.getDataPercentWindow(); + const valueRange = axisProxy.getDataValueWindow(); + dataZoomModel.setCalculatedRange({ + start: percentRange[0], + end: percentRange[1], + startValue: valueRange[0], + endValue: valueRange[1] }); - var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle(); - if (indicator instanceof ZRImage) { - var pathStyle = indicator.style; - indicator.useStyle(extend({ - // TODO other properties like x, y ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, indicatorStyle)); + } + }); + } +}; +var dataZoomProcessor_default = dataZoomProcessor; + +// src/component/dataZoom/dataZoomAction.ts +function installDataZoomAction(registers) { + registers.registerAction("dataZoom", function(payload, ecModel) { + const effectedModels = findEffectedDataZooms(ecModel, payload); + each(effectedModels, function(dataZoomModel) { + dataZoomModel.setRawRange({ + start: payload.start, + end: payload.end, + startValue: payload.startValue, + endValue: payload.endValue + }); + }); + }); +} + +// src/component/dataZoom/installCommon.ts +var installed = false; +function installCommon(registers) { + if (installed) { + return; + } + installed = true; + registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor_default); + installDataZoomAction(registers); + registers.registerSubTypeDefaulter("dataZoom", function() { + return "slider"; + }); +} + +// src/component/dataZoom/installDataZoomSelect.ts +function install35(registers) { + registers.registerComponentModel(SelectZoomModel_default); + registers.registerComponentView(SelectZoomView_default); + installCommon(registers); +} + +// src/component/toolbox/featureManager.ts +var ToolboxFeature = class { +}; +var features = {}; +function registerFeature(name, ctor) { + features[name] = ctor; +} +function getFeature(name) { + return features[name]; +} + +// src/component/toolbox/ToolboxModel.ts +var ToolboxModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = ToolboxModel2.type; + } + optionUpdated() { + super.optionUpdated.apply(this, arguments); + const {ecModel} = this; + each(this.option.feature, function(featureOpt, featureName) { + const Feature = getFeature(featureName); + if (Feature) { + if (Feature.getDefaultOption) { + Feature.defaultOption = Feature.getDefaultOption(ecModel); + } + merge(featureOpt, Feature.defaultOption); + } + }); + } +}; +var ToolboxModel = ToolboxModel2; +ToolboxModel.type = "toolbox"; +ToolboxModel.layoutMode = { + type: "box", + ignoreSize: true +}; +ToolboxModel.defaultOption = { + show: true, + z: 6, + orient: "horizontal", + left: "right", + top: "top", + backgroundColor: "transparent", + borderColor: "#ccc", + borderRadius: 0, + borderWidth: 0, + padding: 5, + itemSize: 15, + itemGap: 8, + showTitle: true, + iconStyle: { + borderColor: "#666", + color: "none" + }, + emphasis: { + iconStyle: { + borderColor: "#3E98C5" + } + }, + tooltip: { + show: false, + position: "bottom" + } +}; +var ToolboxModel_default = ToolboxModel; + +// src/component/helper/listComponent.ts +function layout13(group, componentModel, api2) { + const boxLayoutParams = componentModel.getBoxLayoutParams(); + const padding = componentModel.get("padding"); + const viewportSize = {width: api2.getWidth(), height: api2.getHeight()}; + const rect = getLayoutRect(boxLayoutParams, viewportSize, padding); + box(componentModel.get("orient"), group, componentModel.get("itemGap"), rect.width, rect.height); + positionElement(group, boxLayoutParams, viewportSize, padding); +} +function makeBackground(rect, componentModel) { + const padding = normalizeCssArray2(componentModel.get("padding")); + const style = componentModel.getItemStyle(["color", "opacity"]); + style.fill = componentModel.get("backgroundColor"); + rect = new Rect_default({ + shape: { + x: rect.x - padding[3], + y: rect.y - padding[0], + width: rect.width + padding[1] + padding[3], + height: rect.height + padding[0] + padding[2], + r: componentModel.get("borderRadius") + }, + style, + silent: true, + z2: -1 + }); + return rect; +} + +// src/component/toolbox/ToolboxView.ts +var ToolboxView = class extends Component_default2 { + render(toolboxModel, ecModel, api2, payload) { + const group = this.group; + group.removeAll(); + if (!toolboxModel.get("show")) { + return; + } + const itemSize = +toolboxModel.get("itemSize"); + const isVertical = toolboxModel.get("orient") === "vertical"; + const featureOpts = toolboxModel.get("feature") || {}; + const features2 = this._features || (this._features = {}); + const featureNames = []; + each(featureOpts, function(opt, name) { + featureNames.push(name); + }); + new DataDiffer_default(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(curry(processFeature, null)).execute(); + this._featureNames = featureNames; + function processFeature(newIndex, oldIndex) { + const featureName = featureNames[newIndex]; + const oldName = featureNames[oldIndex]; + const featureOpt = featureOpts[featureName]; + const featureModel = new Model_default(featureOpt, toolboxModel, toolboxModel.ecModel); + let feature; + if (payload && payload.newTitle != null && payload.featureName === featureName) { + featureOpt.title = payload.newTitle; + } + if (featureName && !oldName) { + if (isUserFeatureName(featureName)) { + feature = { + onclick: featureModel.option.onclick, + featureName + }; } else { - indicator.useStyle(indicatorStyle); + const Feature = getFeature(featureName); + if (!Feature) { + return; + } + feature = new Feature(); } - mainGroup.add(indicator); - var textStyleModel = this.visualMapModel.textStyleModel; - var indicatorLabel = new ZRText({ - silent: true, - invisible: true, - style: createTextStyle(textStyleModel, { - x: 0, - y: 0, - text: '' - }) - }); - this.group.add(indicatorLabel); - var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0]; - var shapes = this._shapes; - shapes.indicator = indicator; - shapes.indicatorLabel = indicatorLabel; - shapes.indicatorLabelPoint = indicatorLabelPoint; - this._firstShowIndicator = true; - }; - ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, - // dx is event from ondragend if isEnd is true. It's not used - dx, dy) { - if (!this._useHandle) { + features2[featureName] = feature; + } else { + feature = features2[oldName]; + if (!feature) { return; } - this._dragging = !isEnd; - if (!isEnd) { - // Transform dx, dy to bar coordination. - var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true); - this._updateInterval(handleIndex, vertex[1]); - this._hideIndicator(); - // Considering realtime, update view should be executed - // before dispatch action. - this._updateView(); - } - // dragEnd do not dispatch action when realtime. - if (isEnd === !this.visualMapModel.get('realtime')) { - // jshint ignore:line - this.api.dispatchAction({ - type: 'selectDataRange', - from: this.uid, - visualMapId: this.visualMapModel.id, - selected: this._dataInterval.slice() - }); - } - if (isEnd) { - !this._hovering && this._clearHoverLinkToSeries(); - } else if (useHoverLinkOnHandle(this.visualMapModel)) { - this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); + } + feature.uid = getUID("toolbox-feature"); + feature.model = featureModel; + feature.ecModel = ecModel; + feature.api = api2; + const isToolboxFeature = feature instanceof ToolboxFeature; + if (!featureName && oldName) { + isToolboxFeature && feature.dispose && feature.dispose(ecModel, api2); + return; + } + if (!featureModel.get("show") || isToolboxFeature && feature.unusable) { + isToolboxFeature && feature.remove && feature.remove(ecModel, api2); + return; + } + createIconPaths(featureModel, feature, featureName); + featureModel.setIconStatus = function(iconName, status) { + const option = this.option; + const iconPaths = this.iconPaths; + option.iconStatus = option.iconStatus || {}; + option.iconStatus[iconName] = status; + if (iconPaths[iconName]) { + (status === "emphasis" ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]); } }; - ContinuousView.prototype._resetInterval = function () { - var visualMapModel = this.visualMapModel; - var dataInterval = this._dataInterval = visualMapModel.getSelected(); - var dataExtent = visualMapModel.getExtent(); - var sizeExtent = [0, visualMapModel.itemSize[1]]; - this._handleEnds = [linearMap$2(dataInterval[0], dataExtent, sizeExtent, true), linearMap$2(dataInterval[1], dataExtent, sizeExtent, true)]; - }; - /** - * @private - * @param {(number|string)} handleIndex 0 or 1 or 'all' - * @param {number} dx - * @param {number} dy - */ - ContinuousView.prototype._updateInterval = function (handleIndex, delta) { - delta = delta || 0; - var visualMapModel = this.visualMapModel; - var handleEnds = this._handleEnds; - var sizeExtent = [0, visualMapModel.itemSize[1]]; - sliderMove(delta, handleEnds, sizeExtent, handleIndex, - // cross is forbidden - 0); - var dataExtent = visualMapModel.getExtent(); - // Update data interval. - this._dataInterval = [linearMap$2(handleEnds[0], sizeExtent, dataExtent, true), linearMap$2(handleEnds[1], sizeExtent, dataExtent, true)]; - }; - ContinuousView.prototype._updateView = function (forSketch) { - var visualMapModel = this.visualMapModel; - var dataExtent = visualMapModel.getExtent(); - var shapes = this._shapes; - var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; - var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; - var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange'); - var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange'); - shapes.inRange.setStyle({ - fill: visualInRange.barColor - // opacity: visualInRange.opacity - }).setShape('points', visualInRange.barPoints); - shapes.outOfRange.setStyle({ - fill: visualOutOfRange.barColor - // opacity: visualOutOfRange.opacity - }).setShape('points', visualOutOfRange.barPoints); - this._updateHandle(inRangeHandleEnds, visualInRange); - }; - ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) { - var opts = { - forceState: forceState, - convertOpacityToAlpha: true - }; - var colorStops = this._makeColorGradient(dataInterval, opts); - var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)]; - var barPoints = this._createBarPoints(handleEnds, symbolSizes); - return { - barColor: new LinearGradient(0, 0, 0, 1, colorStops), - barPoints: barPoints, - handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color] - }; - }; - ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) { - // Considering colorHue, which is not linear, so we have to sample - // to calculate gradient color stops, but not only calculate head - // and tail. - var sampleNumber = 100; // Arbitrary value. - var colorStops = []; - var step = (dataInterval[1] - dataInterval[0]) / sampleNumber; - colorStops.push({ - color: this.getControllerVisual(dataInterval[0], 'color', opts), - offset: 0 + if (feature instanceof ToolboxFeature) { + if (feature.render) { + feature.render(featureModel, ecModel, api2, payload); + } + } + } + function createIconPaths(featureModel, feature, featureName) { + const iconStyleModel = featureModel.getModel("iconStyle"); + const iconStyleEmphasisModel = featureModel.getModel(["emphasis", "iconStyle"]); + const icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get("icon"); + const titles = featureModel.get("title") || {}; + let iconsMap; + let titlesMap; + if (isString(icons)) { + iconsMap = {}; + iconsMap[featureName] = icons; + } else { + iconsMap = icons; + } + if (isString(titles)) { + titlesMap = {}; + titlesMap[featureName] = titles; + } else { + titlesMap = titles; + } + const iconPaths = featureModel.iconPaths = {}; + each(iconsMap, function(iconStr, iconName) { + const path = createIcon(iconStr, {}, { + x: -itemSize / 2, + y: -itemSize / 2, + width: itemSize, + height: itemSize + }); + path.setStyle(iconStyleModel.getItemStyle()); + const pathEmphasisState = path.ensureState("emphasis"); + pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle(); + const textContent = new Text_default({ + style: { + text: titlesMap[iconName], + align: iconStyleEmphasisModel.get("textAlign"), + borderRadius: iconStyleEmphasisModel.get("textBorderRadius"), + padding: iconStyleEmphasisModel.get("textPadding"), + fill: null, + font: getFont({ + fontStyle: iconStyleEmphasisModel.get("textFontStyle"), + fontFamily: iconStyleEmphasisModel.get("textFontFamily"), + fontSize: iconStyleEmphasisModel.get("textFontSize"), + fontWeight: iconStyleEmphasisModel.get("textFontWeight") + }, ecModel) + }, + ignore: true }); - for (var i = 1; i < sampleNumber; i++) { - var currValue = dataInterval[0] + step * i; - if (currValue > dataInterval[1]) { - break; - } - colorStops.push({ - color: this.getControllerVisual(currValue, 'color', opts), - offset: i / sampleNumber + path.setTextContent(textContent); + setTooltipConfig({ + el: path, + componentModel: toolboxModel, + itemName: iconName, + formatterParamsExtra: { + title: titlesMap[iconName] + } + }); + path.__title = titlesMap[iconName]; + path.on("mouseover", function() { + const hoverStyle = iconStyleEmphasisModel.getItemStyle(); + const defaultTextPosition = isVertical ? toolboxModel.get("right") == null && toolboxModel.get("left") !== "right" ? "right" : "left" : toolboxModel.get("bottom") == null && toolboxModel.get("top") !== "bottom" ? "bottom" : "top"; + textContent.setStyle({ + fill: iconStyleEmphasisModel.get("textFill") || hoverStyle.fill || hoverStyle.stroke || "#000", + backgroundColor: iconStyleEmphasisModel.get("textBackgroundColor") }); + path.setTextConfig({ + position: iconStyleEmphasisModel.get("textPosition") || defaultTextPosition + }); + textContent.ignore = !toolboxModel.get("showTitle"); + api2.enterEmphasis(this); + }).on("mouseout", function() { + if (featureModel.get(["iconStatus", iconName]) !== "emphasis") { + api2.leaveEmphasis(this); + } + textContent.hide(); + }); + (featureModel.get(["iconStatus", iconName]) === "emphasis" ? enterEmphasis : leaveEmphasis)(path); + group.add(path); + path.on("click", bind(feature.onclick, feature, ecModel, api2, iconName)); + iconPaths[iconName] = path; + }); + } + layout13(group, toolboxModel, api2); + group.add(makeBackground(group.getBoundingRect(), toolboxModel)); + isVertical || group.eachChild(function(icon) { + const titleText = icon.__title; + const emphasisState = icon.ensureState("emphasis"); + const emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {}); + const textContent = icon.getTextContent(); + const emphasisTextState = textContent && textContent.ensureState("emphasis"); + if (emphasisTextState && !isFunction(emphasisTextState) && titleText) { + const emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {}); + const rect = getBoundingRect(titleText, Text_default.makeFont(emphasisTextStyle)); + const offsetX = icon.x + group.x; + const offsetY = icon.y + group.y + itemSize; + let needPutOnTop = false; + if (offsetY + rect.height > api2.getHeight()) { + emphasisTextConfig.position = "top"; + needPutOnTop = true; + } + const topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10; + if (offsetX + rect.width / 2 > api2.getWidth()) { + emphasisTextConfig.position = ["100%", topOffset]; + emphasisTextStyle.align = "right"; + } else if (offsetX - rect.width / 2 < 0) { + emphasisTextConfig.position = [0, topOffset]; + emphasisTextStyle.align = "left"; } - colorStops.push({ - color: this.getControllerVisual(dataInterval[1], 'color', opts), - offset: 1 - }); - return colorStops; - }; - ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) { - var itemSize = this.visualMapModel.itemSize; - return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]]; - }; - ContinuousView.prototype._createBarGroup = function (itemAlign) { - var orient = this._orient; - var inverse = this.visualMapModel.get('inverse'); - return new Group(orient === 'horizontal' && !inverse ? { - scaleX: itemAlign === 'bottom' ? 1 : -1, - rotation: Math.PI / 2 - } : orient === 'horizontal' && inverse ? { - scaleX: itemAlign === 'bottom' ? -1 : 1, - rotation: -Math.PI / 2 - } : orient === 'vertical' && !inverse ? { - scaleX: itemAlign === 'left' ? 1 : -1, - scaleY: -1 - } : { - scaleX: itemAlign === 'left' ? 1 : -1 - }); - }; - ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) { - if (!this._useHandle) { - return; + } + }); + } + updateView(toolboxModel, ecModel, api2, payload) { + each(this._features, function(feature) { + feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api2, payload); + }); + } + remove(ecModel, api2) { + each(this._features, function(feature) { + feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api2); + }); + this.group.removeAll(); + } + dispose(ecModel, api2) { + each(this._features, function(feature) { + feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api2); + }); + } +}; +ToolboxView.type = "toolbox"; +function isUserFeatureName(featureName) { + return featureName.indexOf("my") === 0; +} +var ToolboxView_default = ToolboxView; + +// src/component/toolbox/feature/SaveAsImage.ts +var SaveAsImage = class extends ToolboxFeature { + onclick(ecModel, api2) { + const model = this.model; + const title = model.get("name") || ecModel.get("title.0.text") || "echarts"; + const isSvg = api2.getZr().painter.getType() === "svg"; + const type = isSvg ? "svg" : model.get("type", true) || "png"; + const url = api2.getConnectedDataURL({ + type, + backgroundColor: model.get("backgroundColor", true) || ecModel.get("backgroundColor") || "#fff", + connectedBackgroundColor: model.get("connectedBackgroundColor"), + excludeComponents: model.get("excludeComponents"), + pixelRatio: model.get("pixelRatio") + }); + const browser = env_default.browser; + if (typeof MouseEvent === "function" && (browser.newEdge || !browser.ie && !browser.edge)) { + const $a = document.createElement("a"); + $a.download = title + "." + type; + $a.target = "_blank"; + $a.href = url; + const evt = new MouseEvent("click", { + view: document.defaultView, + bubbles: true, + cancelable: false + }); + $a.dispatchEvent(evt); + } else { + if (window.navigator.msSaveOrOpenBlob || isSvg) { + const parts = url.split(","); + const base64Encoded = parts[0].indexOf("base64") > -1; + let bstr = isSvg ? decodeURIComponent(parts[1]) : parts[1]; + base64Encoded && (bstr = window.atob(bstr)); + const filename = title + "." + type; + if (window.navigator.msSaveOrOpenBlob) { + let n = bstr.length; + const u8arr = new Uint8Array(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + const blob = new Blob([u8arr]); + window.navigator.msSaveOrOpenBlob(blob, filename); + } else { + const frame = document.createElement("iframe"); + document.body.appendChild(frame); + const cw = frame.contentWindow; + const doc = cw.document; + doc.open("image/svg+xml", "replace"); + doc.write(bstr); + doc.close(); + cw.focus(); + doc.execCommand("SaveAs", true, filename); + document.body.removeChild(frame); } - var shapes = this._shapes; - var visualMapModel = this.visualMapModel; - var handleThumbs = shapes.handleThumbs; - var handleLabels = shapes.handleLabels; - var itemSize = visualMapModel.itemSize; - var dataExtent = visualMapModel.getExtent(); - each$e([0, 1], function (handleIndex) { - var handleThumb = handleThumbs[handleIndex]; - handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]); - handleThumb.y = handleEnds[handleIndex]; - var val = linearMap$2(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true); - var symbolSize = this.getControllerVisual(val, 'symbolSize'); - handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0]; - handleThumb.x = itemSize[0] - symbolSize / 2; - // Update handle label position. - var textPoint = applyTransform$1(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group)); - handleLabels[handleIndex].setStyle({ - x: textPoint[0], - y: textPoint[1], - text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), - verticalAlign: 'middle', - align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center' - }); - }, this); - }; - ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { - var visualMapModel = this.visualMapModel; - var dataExtent = visualMapModel.getExtent(); - var itemSize = visualMapModel.itemSize; - var sizeExtent = [0, itemSize[1]]; - var shapes = this._shapes; - var indicator = shapes.indicator; - if (!indicator) { - return; + } else { + const lang = model.get("lang"); + const html = ''; + const tab = window.open(); + tab.document.write(html); + tab.document.title = title; + } + } + } + static getDefaultOption(ecModel) { + const defaultOption3 = { + show: true, + icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0", + title: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "title"]), + type: "png", + connectedBackgroundColor: "#fff", + name: "", + excludeComponents: ["toolbox"], + lang: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "lang"]) + }; + return defaultOption3; + } +}; +var SaveAsImage_default = SaveAsImage; + +// src/component/toolbox/feature/MagicType.ts +var INNER_STACK_KEYWORD = "__ec_magicType_stack__"; +var radioTypes = [ + ["line", "bar"], + ["stack"] +]; +var MagicType = class extends ToolboxFeature { + getIcons() { + const model = this.model; + const availableIcons = model.get("icon"); + const icons = {}; + each(model.get("type"), function(type) { + if (availableIcons[type]) { + icons[type] = availableIcons[type]; + } + }); + return icons; + } + static getDefaultOption(ecModel) { + const defaultOption3 = { + show: true, + type: [], + icon: { + line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4", + bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7", + stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z" + }, + title: ecModel.getLocaleModel().get(["toolbox", "magicType", "title"]), + option: {}, + seriesIndex: {} + }; + return defaultOption3; + } + onclick(ecModel, api2, type) { + const model = this.model; + const seriesIndex = model.get(["seriesIndex", type]); + if (!seriesOptGenreator[type]) { + return; + } + const newOption = { + series: [] + }; + const generateNewSeriesTypes = function(seriesModel) { + const seriesType2 = seriesModel.subType; + const seriesId = seriesModel.id; + const newSeriesOpt = seriesOptGenreator[type](seriesType2, seriesId, seriesModel, model); + if (newSeriesOpt) { + defaults(newSeriesOpt, seriesModel.option); + newOption.series.push(newSeriesOpt); + } + const coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.type === "cartesian2d" && (type === "line" || type === "bar")) { + const categoryAxis2 = coordSys.getAxesByScale("ordinal")[0]; + if (categoryAxis2) { + const axisDim = categoryAxis2.dim; + const axisType = axisDim + "Axis"; + const axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; + const axisIndex = axisModel.componentIndex; + newOption[axisType] = newOption[axisType] || []; + for (let i = 0; i <= axisIndex; i++) { + newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; + } + newOption[axisType][axisIndex].boundaryGap = type === "bar"; } - indicator.attr('invisible', false); - var opts = { - convertOpacityToAlpha: true - }; - var color = this.getControllerVisual(cursorValue, 'color', opts); - var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize'); - var y = linearMap$2(cursorValue, dataExtent, sizeExtent, true); - var x = itemSize[0] - symbolSize / 2; - var oldIndicatorPos = { - x: indicator.x, - y: indicator.y - }; - // Update handle label position. - indicator.y = y; - indicator.x = x; - var textPoint = applyTransform$1(shapes.indicatorLabelPoint, getTransform(indicator, this.group)); - var indicatorLabel = shapes.indicatorLabel; - indicatorLabel.attr('invisible', false); - var align = this._applyTransform('left', shapes.mainGroup); - var orient = this._orient; - var isHorizontal = orient === 'horizontal'; - indicatorLabel.setStyle({ - text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue), - verticalAlign: isHorizontal ? align : 'middle', - align: isHorizontal ? 'center' : align + } + }; + each(radioTypes, function(radio) { + if (indexOf(radio, type) >= 0) { + each(radio, function(item) { + model.setIconStatus(item, "normal"); }); - var indicatorNewProps = { - x: x, - y: y, - style: { - fill: color - } - }; - var labelNewProps = { - style: { - x: textPoint[0], - y: textPoint[1] - } - }; - if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) { - var animationCfg = { - duration: 100, - easing: 'cubicInOut', - additive: true + } + }); + model.setIconStatus(type, "emphasis"); + ecModel.eachComponent({ + mainType: "series", + query: seriesIndex == null ? null : { + seriesIndex + } + }, generateNewSeriesTypes); + let newTitle; + let currentType = type; + if (type === "stack") { + newTitle = merge({ + stack: model.option.title.tiled, + tiled: model.option.title.stack + }, model.option.title); + if (model.get(["iconStatus", type]) !== "emphasis") { + currentType = "tiled"; + } + } + api2.dispatchAction({ + type: "changeMagicType", + currentType, + newOption, + newTitle, + featureName: "magicType" + }); + } +}; +var seriesOptGenreator = { + line: function(seriesType2, seriesId, seriesModel, model) { + if (seriesType2 === "bar") { + return merge({ + id: seriesId, + type: "line", + data: seriesModel.get("data"), + stack: seriesModel.get("stack"), + markPoint: seriesModel.get("markPoint"), + markLine: seriesModel.get("markLine") + }, model.get(["option", "line"]) || {}, true); + } + }, + bar: function(seriesType2, seriesId, seriesModel, model) { + if (seriesType2 === "line") { + return merge({ + id: seriesId, + type: "bar", + data: seriesModel.get("data"), + stack: seriesModel.get("stack"), + markPoint: seriesModel.get("markPoint"), + markLine: seriesModel.get("markLine") + }, model.get(["option", "bar"]) || {}, true); + } + }, + stack: function(seriesType2, seriesId, seriesModel, model) { + const isStack = seriesModel.get("stack") === INNER_STACK_KEYWORD; + if (seriesType2 === "line" || seriesType2 === "bar") { + model.setIconStatus("stack", isStack ? "normal" : "emphasis"); + return merge({ + id: seriesId, + stack: isStack ? "" : INNER_STACK_KEYWORD + }, model.get(["option", "stack"]) || {}, true); + } + } +}; +registerAction({ + type: "changeMagicType", + event: "magicTypeChanged", + update: "prepareAndUpdate" +}, function(payload, ecModel) { + ecModel.mergeOption(payload.newOption); +}); +var MagicType_default = MagicType; + +// src/component/toolbox/feature/DataView.ts +var BLOCK_SPLITER = new Array(60).join("-"); +var ITEM_SPLITER = " "; +function groupSeries(ecModel) { + const seriesGroupByCategoryAxis = {}; + const otherSeries = []; + const meta = []; + ecModel.eachRawSeries(function(seriesModel) { + const coordSys = seriesModel.coordinateSystem; + if (coordSys && (coordSys.type === "cartesian2d" || coordSys.type === "polar")) { + const baseAxis = coordSys.getBaseAxis(); + if (baseAxis.type === "category") { + const key = baseAxis.dim + "_" + baseAxis.index; + if (!seriesGroupByCategoryAxis[key]) { + seriesGroupByCategoryAxis[key] = { + categoryAxis: baseAxis, + valueAxis: coordSys.getOtherAxis(baseAxis), + series: [] }; - indicator.x = oldIndicatorPos.x; - indicator.y = oldIndicatorPos.y; - indicator.animateTo(indicatorNewProps, animationCfg); - indicatorLabel.animateTo(labelNewProps, animationCfg); + meta.push({ + axisDim: baseAxis.dim, + axisIndex: baseAxis.index + }); + } + seriesGroupByCategoryAxis[key].series.push(seriesModel); + } else { + otherSeries.push(seriesModel); + } + } else { + otherSeries.push(seriesModel); + } + }); + return { + seriesGroupByCategoryAxis, + other: otherSeries, + meta + }; +} +function assembleSeriesWithCategoryAxis(groups) { + const tables = []; + each(groups, function(group, key) { + const categoryAxis2 = group.categoryAxis; + const valueAxis2 = group.valueAxis; + const valueAxisDim = valueAxis2.dim; + const headers = [" "].concat(map(group.series, function(series) { + return series.name; + })); + const columns = [categoryAxis2.model.getCategories()]; + each(group.series, function(series) { + const rawData = series.getRawData(); + columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function(val) { + return val; + })); + }); + const lines = [headers.join(ITEM_SPLITER)]; + for (let i = 0; i < columns[0].length; i++) { + const items = []; + for (let j = 0; j < columns.length; j++) { + items.push(columns[j][i]); + } + lines.push(items.join(ITEM_SPLITER)); + } + tables.push(lines.join("\n")); + }); + return tables.join("\n\n" + BLOCK_SPLITER + "\n\n"); +} +function assembleOtherSeries(series) { + return map(series, function(series2) { + const data = series2.getRawData(); + const lines = [series2.name]; + const vals = []; + data.each(data.dimensions, function() { + const argLen = arguments.length; + const dataIndex = arguments[argLen - 1]; + const name = data.getName(dataIndex); + for (let i = 0; i < argLen - 1; i++) { + vals[i] = arguments[i]; + } + lines.push((name ? name + ITEM_SPLITER : "") + vals.join(ITEM_SPLITER)); + }); + return lines.join("\n"); + }).join("\n\n" + BLOCK_SPLITER + "\n\n"); +} +function getContentFromModel(ecModel) { + const result = groupSeries(ecModel); + return { + value: filter([ + assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), + assembleOtherSeries(result.other) + ], function(str) { + return !!str.replace(/[\n\t\s]/g, ""); + }).join("\n\n" + BLOCK_SPLITER + "\n\n"), + meta: result.meta + }; +} +function trim2(str) { + return str.replace(/^\s\s*/, "").replace(/\s\s*$/, ""); +} +function isTSVFormat(block) { + const firstLine = block.slice(0, block.indexOf("\n")); + if (firstLine.indexOf(ITEM_SPLITER) >= 0) { + return true; + } +} +var itemSplitRegex = new RegExp("[" + ITEM_SPLITER + "]+", "g"); +function parseTSVContents(tsv) { + const tsvLines = tsv.split(/\n+/g); + const headers = trim2(tsvLines.shift()).split(itemSplitRegex); + const categories = []; + const series = map(headers, function(header) { + return { + name: header, + data: [] + }; + }); + for (let i = 0; i < tsvLines.length; i++) { + const items = trim2(tsvLines[i]).split(itemSplitRegex); + categories.push(items.shift()); + for (let j = 0; j < items.length; j++) { + series[j] && (series[j].data[i] = items[j]); + } + } + return { + series, + categories + }; +} +function parseListContents(str) { + const lines = str.split(/\n+/g); + const seriesName = trim2(lines.shift()); + const data = []; + for (let i = 0; i < lines.length; i++) { + const line2 = trim2(lines[i]); + if (!line2) { + continue; + } + let items = line2.split(itemSplitRegex); + let name = ""; + let value; + let hasName = false; + if (isNaN(items[0])) { + hasName = true; + name = items[0]; + items = items.slice(1); + data[i] = { + name, + value: [] + }; + value = data[i].value; + } else { + value = data[i] = []; + } + for (let j = 0; j < items.length; j++) { + value.push(+items[j]); + } + if (value.length === 1) { + hasName ? data[i].value = value[0] : data[i] = value[0]; + } + } + return { + name: seriesName, + data + }; +} +function parseContents(str, blockMetaList) { + const blocks = str.split(new RegExp("\n*" + BLOCK_SPLITER + "\n*", "g")); + const newOption = { + series: [] + }; + each(blocks, function(block, idx) { + if (isTSVFormat(block)) { + const result = parseTSVContents(block); + const blockMeta = blockMetaList[idx]; + const axisKey = blockMeta.axisDim + "Axis"; + if (blockMeta) { + newOption[axisKey] = newOption[axisKey] || []; + newOption[axisKey][blockMeta.axisIndex] = { + data: result.categories + }; + newOption.series = newOption.series.concat(result.series); + } + } else { + const result = parseListContents(block); + newOption.series.push(result); + } + }); + return newOption; +} +var DataView = class extends ToolboxFeature { + onclick(ecModel, api2) { + setTimeout(() => { + api2.dispatchAction({ + type: "hideTip" + }); + }); + const container = api2.getDom(); + const model = this.model; + if (this._dom) { + container.removeChild(this._dom); + } + const root = document.createElement("div"); + root.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;padding:5px"; + root.style.backgroundColor = model.get("backgroundColor") || "#fff"; + const header = document.createElement("h4"); + const lang = model.get("lang") || []; + header.innerHTML = lang[0] || model.get("title"); + header.style.cssText = "margin:10px 20px"; + header.style.color = model.get("textColor"); + const viewMain = document.createElement("div"); + const textarea = document.createElement("textarea"); + viewMain.style.cssText = "overflow:auto"; + const optionToContent = model.get("optionToContent"); + const contentToOption = model.get("contentToOption"); + const result = getContentFromModel(ecModel); + if (isFunction(optionToContent)) { + const htmlOrDom = optionToContent(api2.getOption()); + if (isString(htmlOrDom)) { + viewMain.innerHTML = htmlOrDom; + } else if (isDom(htmlOrDom)) { + viewMain.appendChild(htmlOrDom); + } + } else { + textarea.readOnly = model.get("readOnly"); + const style = textarea.style; + style.cssText = "display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none"; + style.color = model.get("textColor"); + style.borderColor = model.get("textareaBorderColor"); + style.backgroundColor = model.get("textareaColor"); + textarea.value = result.value; + viewMain.appendChild(textarea); + } + const blockMetaList = result.meta; + const buttonContainer = document.createElement("div"); + buttonContainer.style.cssText = "position:absolute;bottom:5px;left:0;right:0"; + let buttonStyle = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px"; + const closeButton = document.createElement("div"); + const refreshButton = document.createElement("div"); + buttonStyle += ";background-color:" + model.get("buttonColor"); + buttonStyle += ";color:" + model.get("buttonTextColor"); + const self2 = this; + function close() { + container.removeChild(root); + self2._dom = null; + } + addEventListener(closeButton, "click", close); + addEventListener(refreshButton, "click", function() { + if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) { + if (true) { + warn("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."); + } + close(); + return; + } + let newOption; + try { + if (isFunction(contentToOption)) { + newOption = contentToOption(viewMain, api2.getOption()); } else { - indicator.attr(indicatorNewProps); - indicatorLabel.attr(labelNewProps); - } - this._firstShowIndicator = false; - var handleLabels = this._shapes.handleLabels; - if (handleLabels) { - for (var i = 0; i < handleLabels.length; i++) { - // Fade out handle labels. - // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it. - this.api.enterBlur(handleLabels[i]); - } + newOption = parseContents(textarea.value, blockMetaList); } - }; - ContinuousView.prototype._enableHoverLinkToSeries = function () { - var self = this; - this._shapes.mainGroup.on('mousemove', function (e) { - self._hovering = true; - if (!self._dragging) { - var itemSize = self.visualMapModel.itemSize; - var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true); - // For hover link show when hover handle, which might be - // below or upper than sizeExtent. - pos[1] = mathMin$a(mathMax$a(0, pos[1]), itemSize[1]); - self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]); - } - }).on('mouseout', function () { - // When mouse is out of handle, hoverLink still need - // to be displayed when realtime is set as false. - self._hovering = false; - !self._dragging && self._clearHoverLinkToSeries(); + } catch (e2) { + close(); + throw new Error("Data view format error " + e2); + } + if (newOption) { + api2.dispatchAction({ + type: "changeDataView", + newOption }); + } + close(); + }); + closeButton.innerHTML = lang[1]; + refreshButton.innerHTML = lang[2]; + refreshButton.style.cssText = closeButton.style.cssText = buttonStyle; + !model.get("readOnly") && buttonContainer.appendChild(refreshButton); + buttonContainer.appendChild(closeButton); + root.appendChild(header); + root.appendChild(viewMain); + root.appendChild(buttonContainer); + viewMain.style.height = container.clientHeight - 80 + "px"; + container.appendChild(root); + this._dom = root; + } + remove(ecModel, api2) { + this._dom && api2.getDom().removeChild(this._dom); + } + dispose(ecModel, api2) { + this.remove(ecModel, api2); + } + static getDefaultOption(ecModel) { + const defaultOption3 = { + show: true, + readOnly: false, + optionToContent: null, + contentToOption: null, + icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28", + title: ecModel.getLocaleModel().get(["toolbox", "dataView", "title"]), + lang: ecModel.getLocaleModel().get(["toolbox", "dataView", "lang"]), + backgroundColor: "#fff", + textColor: "#000", + textareaColor: "#fff", + textareaBorderColor: "#333", + buttonColor: "#c23531", + buttonTextColor: "#fff" + }; + return defaultOption3; + } +}; +function tryMergeDataOption(newData, originalData) { + return map(newData, function(newVal, idx) { + const original = originalData && originalData[idx]; + if (isObject(original) && !isArray(original)) { + const newValIsObject = isObject(newVal) && !isArray(newVal); + if (!newValIsObject) { + newVal = { + value: newVal + }; + } + const shouldDeleteName = original.name != null && newVal.name == null; + newVal = defaults(newVal, original); + shouldDeleteName && delete newVal.name; + return newVal; + } else { + return newVal; + } + }); +} +registerAction({ + type: "changeDataView", + event: "dataViewChanged", + update: "prepareAndUpdate" +}, function(payload, ecModel) { + const newSeriesOptList = []; + each(payload.newOption.series, function(seriesOpt) { + const seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; + if (!seriesModel) { + newSeriesOptList.push(extend({ + type: "scatter" + }, seriesOpt)); + } else { + const originalData = seriesModel.get("data"); + newSeriesOptList.push({ + name: seriesOpt.name, + data: tryMergeDataOption(seriesOpt.data, originalData) + }); + } + }); + ecModel.mergeOption(defaults({ + series: newSeriesOptList + }, payload.newOption)); +}); +var DataView_default = DataView; + +// src/component/dataZoom/history.ts +var each10 = each; +var inner16 = makeInner(); +function push(ecModel, newSnapshot) { + const storedSnapshots = getStoreSnapshots(ecModel); + each10(newSnapshot, function(batchItem, dataZoomId) { + let i = storedSnapshots.length - 1; + for (; i >= 0; i--) { + const snapshot = storedSnapshots[i]; + if (snapshot[dataZoomId]) { + break; + } + } + if (i < 0) { + const dataZoomModel = ecModel.queryComponents({mainType: "dataZoom", subType: "select", id: dataZoomId})[0]; + if (dataZoomModel) { + const percentRange = dataZoomModel.getPercentRange(); + storedSnapshots[0][dataZoomId] = { + dataZoomId, + start: percentRange[0], + end: percentRange[1] + }; + } + } + }); + storedSnapshots.push(newSnapshot); +} +function pop(ecModel) { + const storedSnapshots = getStoreSnapshots(ecModel); + const head = storedSnapshots[storedSnapshots.length - 1]; + storedSnapshots.length > 1 && storedSnapshots.pop(); + const snapshot = {}; + each10(head, function(batchItem, dataZoomId) { + for (let i = storedSnapshots.length - 1; i >= 0; i--) { + batchItem = storedSnapshots[i][dataZoomId]; + if (batchItem) { + snapshot[dataZoomId] = batchItem; + break; + } + } + }); + return snapshot; +} +function clear2(ecModel) { + inner16(ecModel).snapshots = null; +} +function count(ecModel) { + return getStoreSnapshots(ecModel).length; +} +function getStoreSnapshots(ecModel) { + const store = inner16(ecModel); + if (!store.snapshots) { + store.snapshots = [{}]; + } + return store.snapshots; +} + +// src/component/toolbox/feature/Restore.ts +var RestoreOption = class extends ToolboxFeature { + onclick(ecModel, api2) { + clear2(ecModel); + api2.dispatchAction({ + type: "restore", + from: this.uid + }); + } + static getDefaultOption(ecModel) { + const defaultOption3 = { + show: true, + icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5", + title: ecModel.getLocaleModel().get(["toolbox", "restore", "title"]) + }; + return defaultOption3; + } +}; +registerAction({type: "restore", event: "restore", update: "prepareAndUpdate"}, function(payload, ecModel) { + ecModel.resetOption("recreate"); +}); +var Restore_default = RestoreOption; + +// src/component/helper/BrushTargetManager.ts +var INCLUDE_FINDER_MAIN_TYPES = [ + "grid", + "xAxis", + "yAxis", + "geo", + "graph", + "polar", + "radiusAxis", + "angleAxis", + "bmap" +]; +var BrushTargetManager = class { + constructor(finder, ecModel, opt) { + this._targetInfoList = []; + const foundCpts = parseFinder2(ecModel, finder); + each(targetInfoBuilders, (builder, type) => { + if (!opt || !opt.include || indexOf(opt.include, type) >= 0) { + builder(foundCpts, this._targetInfoList); + } + }); + } + setOutputRanges(areas, ecModel) { + this.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) { + (area.coordRanges || (area.coordRanges = [])).push(coordRange); + if (!area.coordRange) { + area.coordRange = coordRange; + const result = coordConvert[area.brushType](0, coordSys, coordRange); + area.__rangeOffset = { + offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]), + xyMinMax: result.xyMinMax + }; + } + }); + return areas; + } + matchOutputRanges(areas, ecModel, cb) { + each(areas, function(area) { + const targetInfo = this.findTargetInfo(area, ecModel); + if (targetInfo && targetInfo !== true) { + each(targetInfo.coordSyses, function(coordSys) { + const result = coordConvert[area.brushType](1, coordSys, area.range, true); + cb(area, result.values, coordSys, ecModel); + }); + } + }, this); + } + setInputRanges(areas, ecModel) { + each(areas, function(area) { + const targetInfo = this.findTargetInfo(area, ecModel); + if (true) { + assert(!targetInfo || targetInfo === true || area.coordRange, "coordRange must be specified when coord index specified."); + assert(!targetInfo || targetInfo !== true || area.range, "range must be specified in global brush."); + } + area.range = area.range || []; + if (targetInfo && targetInfo !== true) { + area.panelId = targetInfo.panelId; + const result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange); + const rangeOffset = area.__rangeOffset; + area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values; + } + }, this); + } + makePanelOpts(api2, getDefaultBrushType) { + return map(this._targetInfoList, function(targetInfo) { + const rect = targetInfo.getPanelRect(); + return { + panelId: targetInfo.panelId, + defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null, + clipPath: makeRectPanelClipPath(rect), + isTargetByCursor: makeRectIsTargetByCursor(rect, api2, targetInfo.coordSysModel), + getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect) }; - ContinuousView.prototype._enableHoverLinkFromSeries = function () { - var zr = this.api.getZr(); - if (this.visualMapModel.option.hoverLink) { - zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this); - zr.on('mouseout', this._hideIndicator, this); - } else { - this._clearHoverLinkFromSeries(); + }); + } + controlSeries(area, seriesModel, ecModel) { + const targetInfo = this.findTargetInfo(area, ecModel); + return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0; + } + findTargetInfo(area, ecModel) { + const targetInfoList = this._targetInfoList; + const foundCpts = parseFinder2(ecModel, area); + for (let i = 0; i < targetInfoList.length; i++) { + const targetInfo = targetInfoList[i]; + const areaPanelId = area.panelId; + if (areaPanelId) { + if (targetInfo.panelId === areaPanelId) { + return targetInfo; } - }; - ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) { - var visualMapModel = this.visualMapModel; - var itemSize = visualMapModel.itemSize; - if (!visualMapModel.option.hoverLink) { - return; + } else { + for (let j = 0; j < targetInfoMatchers.length; j++) { + if (targetInfoMatchers[j](foundCpts, targetInfo)) { + return targetInfo; + } + } + } + } + return true; + } +}; +function formatMinMax(minMax) { + minMax[0] > minMax[1] && minMax.reverse(); + return minMax; +} +function parseFinder2(ecModel, finder) { + return parseFinder(ecModel, finder, {includeMainTypes: INCLUDE_FINDER_MAIN_TYPES}); +} +var targetInfoBuilders = { + grid: function(foundCpts, targetInfoList) { + const xAxisModels = foundCpts.xAxisModels; + const yAxisModels = foundCpts.yAxisModels; + const gridModels = foundCpts.gridModels; + const gridModelMap = createHashMap(); + const xAxesHas = {}; + const yAxesHas = {}; + if (!xAxisModels && !yAxisModels && !gridModels) { + return; + } + each(xAxisModels, function(axisModel) { + const gridModel = axisModel.axis.grid.model; + gridModelMap.set(gridModel.id, gridModel); + xAxesHas[gridModel.id] = true; + }); + each(yAxisModels, function(axisModel) { + const gridModel = axisModel.axis.grid.model; + gridModelMap.set(gridModel.id, gridModel); + yAxesHas[gridModel.id] = true; + }); + each(gridModels, function(gridModel) { + gridModelMap.set(gridModel.id, gridModel); + xAxesHas[gridModel.id] = true; + yAxesHas[gridModel.id] = true; + }); + gridModelMap.each(function(gridModel) { + const grid = gridModel.coordinateSystem; + const cartesians = []; + each(grid.getCartesians(), function(cartesian, index) { + if (indexOf(xAxisModels, cartesian.getAxis("x").model) >= 0 || indexOf(yAxisModels, cartesian.getAxis("y").model) >= 0) { + cartesians.push(cartesian); } - var sizeExtent = [0, itemSize[1]]; - var dataExtent = visualMapModel.getExtent(); - // For hover link show when hover handle, which might be below or upper than sizeExtent. - cursorPos = mathMin$a(mathMax$a(sizeExtent[0], cursorPos), sizeExtent[1]); - var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); - var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; - var cursorValue = linearMap$2(cursorPos, sizeExtent, dataExtent, true); - var valueRange = [linearMap$2(hoverRange[0], sizeExtent, dataExtent, true), linearMap$2(hoverRange[1], sizeExtent, dataExtent, true)]; - // Consider data range is out of visualMap range, see test/visualMap-continuous.html, - // where china and india has very large population. - hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); - hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); - // Do not show indicator when mouse is over handle, - // otherwise labels overlap, especially when dragging. - if (hoverOnBar) { - if (valueRange[0] === -Infinity) { - this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize); - } else if (valueRange[1] === Infinity) { - this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize); - } else { - this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize); - } + }); + targetInfoList.push({ + panelId: "grid--" + gridModel.id, + gridModel, + coordSysModel: gridModel, + coordSys: cartesians[0], + coordSyses: cartesians, + getPanelRect: panelRectBuilders.grid, + xAxisDeclared: xAxesHas[gridModel.id], + yAxisDeclared: yAxesHas[gridModel.id] + }); + }); + }, + geo: function(foundCpts, targetInfoList) { + each(foundCpts.geoModels, function(geoModel) { + const coordSys = geoModel.coordinateSystem; + targetInfoList.push({ + panelId: "geo--" + geoModel.id, + geoModel, + coordSysModel: geoModel, + coordSys, + coordSyses: [coordSys], + getPanelRect: panelRectBuilders.geo + }); + }); + } +}; +var targetInfoMatchers = [ + function(foundCpts, targetInfo) { + const xAxisModel = foundCpts.xAxisModel; + const yAxisModel = foundCpts.yAxisModel; + let gridModel = foundCpts.gridModel; + !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model); + !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model); + return gridModel && gridModel === targetInfo.gridModel; + }, + function(foundCpts, targetInfo) { + const geoModel = foundCpts.geoModel; + return geoModel && geoModel === targetInfo.geoModel; + } +]; +var panelRectBuilders = { + grid: function() { + return this.coordSys.master.getRect().clone(); + }, + geo: function() { + const coordSys = this.coordSys; + const rect = coordSys.getBoundingRect().clone(); + rect.applyTransform(getTransform(coordSys)); + return rect; + } +}; +var coordConvert = { + lineX: curry(axisConvert, 0), + lineY: curry(axisConvert, 1), + rect: function(to, coordSys, rangeOrCoordRange, clamp2) { + const xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp2) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp2); + const xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp2) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp2); + const values = [ + formatMinMax([xminymin[0], xmaxymax[0]]), + formatMinMax([xminymin[1], xmaxymax[1]]) + ]; + return {values, xyMinMax: values}; + }, + polygon: function(to, coordSys, rangeOrCoordRange, clamp2) { + const xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]]; + const values = map(rangeOrCoordRange, function(item) { + const p = to ? coordSys.pointToData(item, clamp2) : coordSys.dataToPoint(item, clamp2); + xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]); + xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]); + xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]); + xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]); + return p; + }); + return {values, xyMinMax}; + } +}; +function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) { + if (true) { + assert(coordSys.type === "cartesian2d", "lineX/lineY brush is available only in cartesian2d."); + } + const axis = coordSys.getAxis(["x", "y"][axisNameIndex]); + const values = formatMinMax(map([0, 1], function(i) { + return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i])); + })); + const xyMinMax = []; + xyMinMax[axisNameIndex] = values; + xyMinMax[1 - axisNameIndex] = [NaN, NaN]; + return {values, xyMinMax}; +} +var diffProcessor = { + lineX: curry(axisDiffProcessor, 0), + lineY: curry(axisDiffProcessor, 1), + rect: function(values, refer, scales) { + return [ + [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], + [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]] + ]; + }, + polygon: function(values, refer, scales) { + return map(values, function(item, idx) { + return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]]; + }); + } +}; +function axisDiffProcessor(axisNameIndex, values, refer, scales) { + return [ + values[0] - scales[axisNameIndex] * refer[0], + values[1] - scales[axisNameIndex] * refer[1] + ]; +} +function getScales(xyMinMaxCurr, xyMinMaxOrigin) { + const sizeCurr = getSize2(xyMinMaxCurr); + const sizeOrigin = getSize2(xyMinMaxOrigin); + const scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; + isNaN(scales[0]) && (scales[0] = 1); + isNaN(scales[1]) && (scales[1] = 1); + return scales; +} +function getSize2(xyMinMax) { + return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN]; +} +var BrushTargetManager_default = BrushTargetManager; + +// src/component/toolbox/feature/DataZoom.ts +var each11 = each; +var DATA_ZOOM_ID_BASE = makeInternalComponentId("toolbox-dataZoom_"); +var DataZoomFeature = class extends ToolboxFeature { + render(featureModel, ecModel, api2, payload) { + if (!this._brushController) { + this._brushController = new BrushController_default(api2.getZr()); + this._brushController.on("brush", bind(this._onBrush, this)).mount(); + } + updateZoomBtnStatus(featureModel, ecModel, this, payload, api2); + updateBackBtnStatus(featureModel, ecModel); + } + onclick(ecModel, api2, type) { + handlers2[type].call(this); + } + remove(ecModel, api2) { + this._brushController && this._brushController.unmount(); + } + dispose(ecModel, api2) { + this._brushController && this._brushController.dispose(); + } + _onBrush(eventParam) { + const areas = eventParam.areas; + if (!eventParam.isEnd || !areas.length) { + return; + } + const snapshot = {}; + const ecModel = this.ecModel; + this._brushController.updateCovers([]); + const brushTargetManager = new BrushTargetManager_default(makeAxisFinder(this.model), ecModel, {include: ["grid"]}); + brushTargetManager.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) { + if (coordSys.type !== "cartesian2d") { + return; + } + const brushType = area.brushType; + if (brushType === "rect") { + setBatch("x", coordSys, coordRange[0]); + setBatch("y", coordSys, coordRange[1]); + } else { + setBatch({lineX: "x", lineY: "y"}[brushType], coordSys, coordRange); + } + }); + push(ecModel, snapshot); + this._dispatchZoomAction(snapshot); + function setBatch(dimName, coordSys, minMax) { + const axis = coordSys.getAxis(dimName); + const axisModel = axis.model; + const dataZoomModel = findDataZoom(dimName, axisModel, ecModel); + const minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); + if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { + minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan); + } + dataZoomModel && (snapshot[dataZoomModel.id] = { + dataZoomId: dataZoomModel.id, + startValue: minMax[0], + endValue: minMax[1] + }); + } + function findDataZoom(dimName, axisModel, ecModel2) { + let found; + ecModel2.eachComponent({mainType: "dataZoom", subType: "select"}, function(dzModel) { + const has3 = dzModel.getAxisModel(dimName, axisModel.componentIndex); + has3 && (found = dzModel); + }); + return found; + } + } + _dispatchZoomAction(snapshot) { + const batch = []; + each11(snapshot, function(batchItem, dataZoomId) { + batch.push(clone(batchItem)); + }); + batch.length && this.api.dispatchAction({ + type: "dataZoom", + from: this.uid, + batch + }); + } + static getDefaultOption(ecModel) { + const defaultOption3 = { + show: true, + filterMode: "filter", + icon: { + zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1", + back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26" + }, + title: ecModel.getLocaleModel().get(["toolbox", "dataZoom", "title"]), + brushStyle: { + borderWidth: 0, + color: "rgba(210,219,238,0.2)" + } + }; + return defaultOption3; + } +}; +var handlers2 = { + zoom: function() { + const nextActive = !this._isZoomActive; + this.api.dispatchAction({ + type: "takeGlobalCursor", + key: "dataZoomSelect", + dataZoomSelectActive: nextActive + }); + }, + back: function() { + this._dispatchZoomAction(pop(this.ecModel)); + } +}; +function makeAxisFinder(dzFeatureModel) { + const setting = { + xAxisIndex: dzFeatureModel.get("xAxisIndex", true), + yAxisIndex: dzFeatureModel.get("yAxisIndex", true), + xAxisId: dzFeatureModel.get("xAxisId", true), + yAxisId: dzFeatureModel.get("yAxisId", true) + }; + if (setting.xAxisIndex == null && setting.xAxisId == null) { + setting.xAxisIndex = "all"; + } + if (setting.yAxisIndex == null && setting.yAxisId == null) { + setting.yAxisIndex = "all"; + } + return setting; +} +function updateBackBtnStatus(featureModel, ecModel) { + featureModel.setIconStatus("back", count(ecModel) > 1 ? "emphasis" : "normal"); +} +function updateZoomBtnStatus(featureModel, ecModel, view, payload, api2) { + let zoomActive = view._isZoomActive; + if (payload && payload.type === "takeGlobalCursor") { + zoomActive = payload.key === "dataZoomSelect" ? payload.dataZoomSelectActive : false; + } + view._isZoomActive = zoomActive; + featureModel.setIconStatus("zoom", zoomActive ? "emphasis" : "normal"); + const brushTargetManager = new BrushTargetManager_default(makeAxisFinder(featureModel), ecModel, {include: ["grid"]}); + const panels = brushTargetManager.makePanelOpts(api2, function(targetInfo) { + return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? "lineX" : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? "lineY" : "rect"; + }); + view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? { + brushType: "auto", + brushStyle: featureModel.getModel("brushStyle").getItemStyle() + } : false); +} +registerInternalOptionCreator("dataZoom", function(ecModel) { + const toolboxModel = ecModel.getComponent("toolbox", 0); + const featureDataZoomPath = ["feature", "dataZoom"]; + if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) { + return; + } + const dzFeatureModel = toolboxModel.getModel(featureDataZoomPath); + const dzOptions = []; + const finder = makeAxisFinder(dzFeatureModel); + const finderResult = parseFinder(ecModel, finder); + each11(finderResult.xAxisModels, (axisModel) => buildInternalOptions(axisModel, "xAxis", "xAxisIndex")); + each11(finderResult.yAxisModels, (axisModel) => buildInternalOptions(axisModel, "yAxis", "yAxisIndex")); + function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) { + const axisIndex = axisModel.componentIndex; + const newOpt = { + type: "select", + $fromToolbox: true, + filterMode: dzFeatureModel.get("filterMode", true) || "filter", + id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex + }; + newOpt[axisIndexPropName] = axisIndex; + dzOptions.push(newOpt); + } + return dzOptions; +}); +var DataZoom_default = DataZoomFeature; + +// src/component/toolbox/install.ts +function install36(registers) { + registers.registerComponentModel(ToolboxModel_default); + registers.registerComponentView(ToolboxView_default); + registerFeature("saveAsImage", SaveAsImage_default); + registerFeature("magicType", MagicType_default); + registerFeature("dataView", DataView_default); + registerFeature("dataZoom", DataZoom_default); + registerFeature("restore", Restore_default); + use(install35); +} + +// src/component/tooltip/TooltipModel.ts +var TooltipModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = TooltipModel2.type; + } +}; +var TooltipModel = TooltipModel2; +TooltipModel.type = "tooltip"; +TooltipModel.dependencies = ["axisPointer"]; +TooltipModel.defaultOption = { + z: 60, + show: true, + showContent: true, + trigger: "item", + triggerOn: "mousemove|click", + alwaysShowContent: false, + displayMode: "single", + renderMode: "auto", + confine: null, + showDelay: 0, + hideDelay: 100, + transitionDuration: 0.4, + enterable: false, + backgroundColor: "#fff", + shadowBlur: 10, + shadowColor: "rgba(0, 0, 0, .2)", + shadowOffsetX: 1, + shadowOffsetY: 2, + borderRadius: 4, + borderWidth: 1, + padding: null, + extraCssText: "", + axisPointer: { + type: "line", + axis: "auto", + animation: "auto", + animationDurationUpdate: 200, + animationEasingUpdate: "exponentialOut", + crossStyle: { + color: "#999", + width: 1, + type: "dashed", + textStyle: {} + } + }, + textStyle: { + color: "#666", + fontSize: 14 + } +}; +var TooltipModel_default = TooltipModel; + +// src/component/tooltip/helper.ts +function shouldTooltipConfine(tooltipModel) { + const confineOption = tooltipModel.get("confine"); + return confineOption != null ? !!confineOption : tooltipModel.get("renderMode") === "richText"; +} +function testStyle(styleProps) { + if (!env_default.domSupported) { + return; + } + const style = document.documentElement.style; + for (let i = 0, len2 = styleProps.length; i < len2; i++) { + if (styleProps[i] in style) { + return styleProps[i]; + } + } +} +var TRANSFORM_VENDOR = testStyle(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]); +var TRANSITION_VENDOR = testStyle(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]); +function toCSSVendorPrefix(styleVendor, styleProp) { + if (!styleVendor) { + return styleProp; + } + styleProp = toCamelCase(styleProp, true); + const idx = styleVendor.indexOf(styleProp); + styleVendor = idx === -1 ? styleProp : `-${styleVendor.slice(0, idx)}-${styleProp}`; + return styleVendor.toLowerCase(); +} +function getComputedStyle(el, style) { + const stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el); + return stl ? style ? stl[style] : stl : null; +} + +// src/component/tooltip/TooltipHTMLContent.ts +var CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, "transition"); +var CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, "transform"); +var gCssText = `position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;${env_default.transform3dSupported ? "will-change:transform;" : ""}`; +function mirrorPos(pos) { + pos = pos === "left" ? "right" : pos === "right" ? "left" : pos === "top" ? "bottom" : "top"; + return pos; +} +function assembleArrow(tooltipModel, borderColor, arrowPosition) { + if (!isString(arrowPosition) || arrowPosition === "inside") { + return ""; + } + const backgroundColor2 = tooltipModel.get("backgroundColor"); + const borderWidth = tooltipModel.get("borderWidth"); + borderColor = convertToColorString(borderColor); + const arrowPos = mirrorPos(arrowPosition); + const arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6); + let positionStyle = ""; + let transformStyle = CSS_TRANSFORM_VENDOR + ":"; + let rotateDeg; + if (indexOf(["left", "right"], arrowPos) > -1) { + positionStyle += "top:50%"; + transformStyle += `translateY(-50%) rotate(${rotateDeg = arrowPos === "left" ? -225 : -45}deg)`; + } else { + positionStyle += "left:50%"; + transformStyle += `translateX(-50%) rotate(${rotateDeg = arrowPos === "top" ? 225 : 45}deg)`; + } + const rotateRadian = rotateDeg * Math.PI / 180; + const arrowWH = arrowSize + borderWidth; + const rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian)); + const arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100; + positionStyle += `;${arrowPos}:-${arrowOffset}px`; + const borderStyle = `${borderColor} solid ${borderWidth}px;`; + const styleCss = [ + `position:absolute;width:${arrowSize}px;height:${arrowSize}px;z-index:-1;`, + `${positionStyle};${transformStyle};`, + `border-bottom:${borderStyle}`, + `border-right:${borderStyle}`, + `background-color:${backgroundColor2};` + ]; + return `
`; +} +function assembleTransition(duration, onlyFade) { + const transitionCurve = "cubic-bezier(0.23,1,0.32,1)"; + let transitionOption = ` ${duration / 2}s ${transitionCurve}`; + let transitionText = `opacity${transitionOption},visibility${transitionOption}`; + if (!onlyFade) { + transitionOption = ` ${duration}s ${transitionCurve}`; + transitionText += env_default.transformSupported ? `,${CSS_TRANSFORM_VENDOR}${transitionOption}` : `,left${transitionOption},top${transitionOption}`; + } + return CSS_TRANSITION_VENDOR + ":" + transitionText; +} +function assembleTransform(x, y, toString) { + const x0 = x.toFixed(0) + "px"; + const y0 = y.toFixed(0) + "px"; + if (!env_default.transformSupported) { + return toString ? `top:${y0};left:${x0};` : [["top", y0], ["left", x0]]; + } + const is3d = env_default.transform3dSupported; + const translate2 = `translate${is3d ? "3d" : ""}(${x0},${y0}${is3d ? ",0" : ""})`; + return toString ? "top:0;left:0;" + CSS_TRANSFORM_VENDOR + ":" + translate2 + ";" : [["top", 0], ["left", 0], [TRANSFORM_VENDOR, translate2]]; +} +function assembleFont(textStyleModel) { + const cssText = []; + const fontSize = textStyleModel.get("fontSize"); + const color2 = textStyleModel.getTextColor(); + color2 && cssText.push("color:" + color2); + cssText.push("font:" + textStyleModel.getFont()); + fontSize && cssText.push("line-height:" + Math.round(fontSize * 3 / 2) + "px"); + const shadowColor = textStyleModel.get("textShadowColor"); + const shadowBlur = textStyleModel.get("textShadowBlur") || 0; + const shadowOffsetX = textStyleModel.get("textShadowOffsetX") || 0; + const shadowOffsetY = textStyleModel.get("textShadowOffsetY") || 0; + shadowColor && shadowBlur && cssText.push("text-shadow:" + shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor); + each(["decoration", "align"], function(name) { + const val = textStyleModel.get(name); + val && cssText.push("text-" + name + ":" + val); + }); + return cssText.join(";"); +} +function assembleCssText(tooltipModel, enableTransition, onlyFade) { + const cssText = []; + const transitionDuration = tooltipModel.get("transitionDuration"); + const backgroundColor2 = tooltipModel.get("backgroundColor"); + const shadowBlur = tooltipModel.get("shadowBlur"); + const shadowColor = tooltipModel.get("shadowColor"); + const shadowOffsetX = tooltipModel.get("shadowOffsetX"); + const shadowOffsetY = tooltipModel.get("shadowOffsetY"); + const textStyleModel = tooltipModel.getModel("textStyle"); + const padding = getPaddingFromTooltipModel(tooltipModel, "html"); + const boxShadow = `${shadowOffsetX}px ${shadowOffsetY}px ${shadowBlur}px ${shadowColor}`; + cssText.push("box-shadow:" + boxShadow); + enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade)); + if (backgroundColor2) { + cssText.push("background-color:" + backgroundColor2); + } + each(["width", "color", "radius"], function(name) { + const borderName = "border-" + name; + const camelCase = toCamelCase(borderName); + const val = tooltipModel.get(camelCase); + val != null && cssText.push(borderName + ":" + val + (name === "color" ? "" : "px")); + }); + cssText.push(assembleFont(textStyleModel)); + if (padding != null) { + cssText.push("padding:" + normalizeCssArray2(padding).join("px ") + "px"); + } + return cssText.join(";") + ";"; +} +function makeStyleCoord(out2, zr, container, zrX, zrY) { + const zrPainter = zr && zr.painter; + if (container) { + const zrViewportRoot = zrPainter && zrPainter.getViewportRoot(); + if (zrViewportRoot) { + transformLocalCoord(out2, zrViewportRoot, container, zrX, zrY); + } + } else { + out2[0] = zrX; + out2[1] = zrY; + const viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset(); + if (viewportRootOffset) { + out2[0] += viewportRootOffset.offsetLeft; + out2[1] += viewportRootOffset.offsetTop; + } + } + out2[2] = out2[0] / zr.getWidth(); + out2[3] = out2[1] / zr.getHeight(); +} +var TooltipHTMLContent = class { + constructor(api2, opt) { + this._show = false; + this._styleCoord = [0, 0, 0, 0]; + this._enterable = true; + this._alwaysShowContent = false; + this._firstShow = true; + this._longHide = true; + if (env_default.wxa) { + return null; + } + const el = document.createElement("div"); + el.domBelongToZr = true; + this.el = el; + const zr = this._zr = api2.getZr(); + const appendTo = opt.appendTo; + const container = appendTo && (isString(appendTo) ? document.querySelector(appendTo) : isDom(appendTo) ? appendTo : isFunction(appendTo) && appendTo(api2.getDom())); + makeStyleCoord(this._styleCoord, zr, container, api2.getWidth() / 2, api2.getHeight() / 2); + (container || api2.getDom()).appendChild(el); + this._api = api2; + this._container = container; + const self2 = this; + el.onmouseenter = function() { + if (self2._enterable) { + clearTimeout(self2._hideTimeout); + self2._show = true; + } + self2._inContent = true; + }; + el.onmousemove = function(e2) { + e2 = e2 || window.event; + if (!self2._enterable) { + const handler = zr.handler; + const zrViewportRoot = zr.painter.getViewportRoot(); + normalizeEvent(zrViewportRoot, e2, true); + handler.dispatch("mousemove", e2); + } + }; + el.onmouseleave = function() { + self2._inContent = false; + if (self2._enterable) { + if (self2._show) { + self2.hideLater(self2._hideDelay); } - // When realtime is set as false, handles, which are in barGroup, - // also trigger hoverLink, which help user to realize where they - // focus on when dragging. (see test/heatmap-large.html) - // When realtime is set as true, highlight will not show when hover - // handle, because the label on handle, which displays a exact value - // but not range, might mislead users. - var oldBatch = this._hoverLinkDataIndices; - var newBatch = []; - if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { - newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); - } - var resultBatches = compressBatches(oldBatch, newBatch); - this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel)); - this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel)); - }; - ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) { - var ecData; - findEventDispatcher(e.target, function (target) { - var currECData = getECData(target); - if (currECData.dataIndex != null) { - ecData = currECData; - return true; - } - }, true); - if (!ecData) { - return; + } + }; + } + update(tooltipModel) { + if (!this._container) { + const container = this._api.getDom(); + const position2 = getComputedStyle(container, "position"); + const domStyle = container.style; + if (domStyle.position !== "absolute" && position2 !== "absolute") { + domStyle.position = "relative"; + } + } + const alwaysShowContent = tooltipModel.get("alwaysShowContent"); + alwaysShowContent && this._moveIfResized(); + this._alwaysShowContent = alwaysShowContent; + this.el.className = tooltipModel.get("className") || ""; + } + show(tooltipModel, nearPointColor) { + clearTimeout(this._hideTimeout); + clearTimeout(this._longHideTimeout); + const el = this.el; + const style = el.style; + const styleCoord = this._styleCoord; + if (!el.innerHTML) { + style.display = "none"; + } else { + style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) + assembleTransform(styleCoord[0], styleCoord[1], true) + `border-color:${convertToColorString(nearPointColor)};` + (tooltipModel.get("extraCssText") || "") + `;pointer-events:${this._enterable ? "auto" : "none"}`; + } + this._show = true; + this._firstShow = false; + this._longHide = false; + } + setContent(content, markers, tooltipModel, borderColor, arrowPosition) { + const el = this.el; + if (content == null) { + el.innerHTML = ""; + return; + } + let arrow = ""; + if (isString(arrowPosition) && tooltipModel.get("trigger") === "item" && !shouldTooltipConfine(tooltipModel)) { + arrow = assembleArrow(tooltipModel, borderColor, arrowPosition); + } + if (isString(content)) { + el.innerHTML = content + arrow; + } else if (content) { + el.innerHTML = ""; + if (!isArray(content)) { + content = [content]; + } + for (let i = 0; i < content.length; i++) { + if (isDom(content[i]) && content[i].parentNode !== el) { + el.appendChild(content[i]); + } + } + if (arrow && el.childNodes.length) { + const arrowEl = document.createElement("div"); + arrowEl.innerHTML = arrow; + el.appendChild(arrowEl); + } + } + } + setEnterable(enterable) { + this._enterable = enterable; + } + getSize() { + const el = this.el; + return el ? [el.offsetWidth, el.offsetHeight] : [0, 0]; + } + moveTo(zrX, zrY) { + if (!this.el) { + return; + } + const styleCoord = this._styleCoord; + makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY); + if (styleCoord[0] != null && styleCoord[1] != null) { + const style = this.el.style; + const transforms = assembleTransform(styleCoord[0], styleCoord[1]); + each(transforms, (transform2) => { + style[transform2[0]] = transform2[1]; + }); + } + } + _moveIfResized() { + const ratioX = this._styleCoord[2]; + const ratioY = this._styleCoord[3]; + this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); + } + hide() { + const style = this.el.style; + style.visibility = "hidden"; + style.opacity = "0"; + env_default.transform3dSupported && (style.willChange = ""); + this._show = false; + this._longHideTimeout = setTimeout(() => this._longHide = true, 500); + } + hideLater(time) { + if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) { + if (time) { + this._hideDelay = time; + this._show = false; + this._hideTimeout = setTimeout(bind(this.hide, this), time); + } else { + this.hide(); + } + } + } + isShow() { + return this._show; + } + dispose() { + clearTimeout(this._hideTimeout); + clearTimeout(this._longHideTimeout); + const parentNode2 = this.el.parentNode; + parentNode2 && parentNode2.removeChild(this.el); + this.el = this._container = null; + } +}; +var TooltipHTMLContent_default = TooltipHTMLContent; + +// src/component/tooltip/TooltipRichContent.ts +var TooltipRichContent = class { + constructor(api2) { + this._show = false; + this._styleCoord = [0, 0, 0, 0]; + this._alwaysShowContent = false; + this._enterable = true; + this._zr = api2.getZr(); + makeStyleCoord2(this._styleCoord, this._zr, api2.getWidth() / 2, api2.getHeight() / 2); + } + update(tooltipModel) { + const alwaysShowContent = tooltipModel.get("alwaysShowContent"); + alwaysShowContent && this._moveIfResized(); + this._alwaysShowContent = alwaysShowContent; + } + show() { + if (this._hideTimeout) { + clearTimeout(this._hideTimeout); + } + this.el.show(); + this._show = true; + } + setContent(content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) { + if (isObject(content)) { + throwError(true ? "Passing DOM nodes as content is not supported in richText tooltip!" : ""); + } + if (this.el) { + this._zr.remove(this.el); + } + const textStyleModel = tooltipModel.getModel("textStyle"); + this.el = new Text_default({ + style: { + rich: markupStyleCreator.richTextStyles, + text: content, + lineHeight: 22, + borderWidth: 1, + borderColor, + textShadowColor: textStyleModel.get("textShadowColor"), + fill: tooltipModel.get(["textStyle", "color"]), + padding: getPaddingFromTooltipModel(tooltipModel, "richText"), + verticalAlign: "top", + align: "left" + }, + z: tooltipModel.get("z") + }); + each([ + "backgroundColor", + "borderRadius", + "shadowColor", + "shadowBlur", + "shadowOffsetX", + "shadowOffsetY" + ], (propName) => { + this.el.style[propName] = tooltipModel.get(propName); + }); + each([ + "textShadowBlur", + "textShadowOffsetX", + "textShadowOffsetY" + ], (propName) => { + this.el.style[propName] = textStyleModel.get(propName) || 0; + }); + this._zr.add(this.el); + const self2 = this; + this.el.on("mouseover", function() { + if (self2._enterable) { + clearTimeout(self2._hideTimeout); + self2._show = true; + } + self2._inContent = true; + }); + this.el.on("mouseout", function() { + if (self2._enterable) { + if (self2._show) { + self2.hideLater(self2._hideDelay); } - var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex); - var visualMapModel = this.visualMapModel; - if (!visualMapModel.isTargetSeries(dataModel)) { - return; + } + self2._inContent = false; + }); + } + setEnterable(enterable) { + this._enterable = enterable; + } + getSize() { + const el = this.el; + const bounding = this.el.getBoundingRect(); + const shadowOuterSize = calcShadowOuterSize(el.style); + return [ + bounding.width + shadowOuterSize.left + shadowOuterSize.right, + bounding.height + shadowOuterSize.top + shadowOuterSize.bottom + ]; + } + moveTo(x, y) { + const el = this.el; + if (el) { + const styleCoord = this._styleCoord; + makeStyleCoord2(styleCoord, this._zr, x, y); + x = styleCoord[0]; + y = styleCoord[1]; + const style = el.style; + const borderWidth = mathMaxWith0(style.borderWidth || 0); + const shadowOuterSize = calcShadowOuterSize(style); + el.x = x + borderWidth + shadowOuterSize.left; + el.y = y + borderWidth + shadowOuterSize.top; + el.markRedraw(); + } + } + _moveIfResized() { + const ratioX = this._styleCoord[2]; + const ratioY = this._styleCoord[3]; + this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); + } + hide() { + if (this.el) { + this.el.hide(); + } + this._show = false; + } + hideLater(time) { + if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) { + if (time) { + this._hideDelay = time; + this._show = false; + this._hideTimeout = setTimeout(bind(this.hide, this), time); + } else { + this.hide(); + } + } + } + isShow() { + return this._show; + } + dispose() { + this._zr.remove(this.el); + } +}; +function mathMaxWith0(val) { + return Math.max(0, val); +} +function calcShadowOuterSize(style) { + const shadowBlur = mathMaxWith0(style.shadowBlur || 0); + const shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0); + const shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0); + return { + left: mathMaxWith0(shadowBlur - shadowOffsetX), + right: mathMaxWith0(shadowBlur + shadowOffsetX), + top: mathMaxWith0(shadowBlur - shadowOffsetY), + bottom: mathMaxWith0(shadowBlur + shadowOffsetY) + }; +} +function makeStyleCoord2(out2, zr, zrX, zrY) { + out2[0] = zrX; + out2[1] = zrY; + out2[2] = out2[0] / zr.getWidth(); + out2[3] = out2[1] / zr.getHeight(); +} +var TooltipRichContent_default = TooltipRichContent; + +// src/component/tooltip/TooltipView.ts +var proxyRect = new Rect_default({ + shape: {x: -1, y: -1, width: 2, height: 2} +}); +var TooltipView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = TooltipView2.type; + } + init(ecModel, api2) { + if (env_default.node || !api2.getDom()) { + return; + } + const tooltipModel = ecModel.getComponent("tooltip"); + const renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get("renderMode")); + this._tooltipContent = renderMode === "richText" ? new TooltipRichContent_default(api2) : new TooltipHTMLContent_default(api2, { + appendTo: tooltipModel.get("appendToBody", true) ? "body" : tooltipModel.get("appendTo", true) + }); + } + render(tooltipModel, ecModel, api2) { + if (env_default.node || !api2.getDom()) { + return; + } + this.group.removeAll(); + this._tooltipModel = tooltipModel; + this._ecModel = ecModel; + this._api = api2; + const tooltipContent = this._tooltipContent; + tooltipContent.update(tooltipModel); + tooltipContent.setEnterable(tooltipModel.get("enterable")); + this._initGlobalListener(); + this._keepShow(); + if (this._renderMode !== "richText" && tooltipModel.get("transitionDuration")) { + createOrUpdate(this, "_updatePosition", 50, "fixRate"); + } else { + clear(this, "_updatePosition"); + } + } + _initGlobalListener() { + const tooltipModel = this._tooltipModel; + const triggerOn = tooltipModel.get("triggerOn"); + register("itemTooltip", this._api, bind(function(currTrigger, e2, dispatchAction3) { + if (triggerOn !== "none") { + if (triggerOn.indexOf(currTrigger) >= 0) { + this._tryShow(e2, dispatchAction3); + } else if (currTrigger === "leave") { + this._hide(dispatchAction3); + } + } + }, this)); + } + _keepShow() { + const tooltipModel = this._tooltipModel; + const ecModel = this._ecModel; + const api2 = this._api; + const triggerOn = tooltipModel.get("triggerOn"); + if (this._lastX != null && this._lastY != null && triggerOn !== "none" && triggerOn !== "click") { + const self2 = this; + clearTimeout(this._refreshUpdateTimeout); + this._refreshUpdateTimeout = setTimeout(function() { + !api2.isDisposed() && self2.manuallyShowTip(tooltipModel, ecModel, api2, { + x: self2._lastX, + y: self2._lastY, + dataByCoordSys: self2._lastDataByCoordSys + }); + }); + } + } + manuallyShowTip(tooltipModel, ecModel, api2, payload) { + if (payload.from === this.uid || env_default.node || !api2.getDom()) { + return; + } + const dispatchAction3 = makeDispatchAction2(payload, api2); + this._ticket = ""; + const dataByCoordSys = payload.dataByCoordSys; + const cmptRef = findComponentReference(payload, ecModel, api2); + if (cmptRef) { + const rect = cmptRef.el.getBoundingRect().clone(); + rect.applyTransform(cmptRef.el.transform); + this._tryShow({ + offsetX: rect.x + rect.width / 2, + offsetY: rect.y + rect.height / 2, + target: cmptRef.el, + position: payload.position, + positionDefault: "bottom" + }, dispatchAction3); + } else if (payload.tooltip && payload.x != null && payload.y != null) { + const el = proxyRect; + el.x = payload.x; + el.y = payload.y; + el.update(); + getECData(el).tooltipConfig = { + name: null, + option: payload.tooltip + }; + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + target: el + }, dispatchAction3); + } else if (dataByCoordSys) { + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + dataByCoordSys, + tooltipOption: payload.tooltipOption + }, dispatchAction3); + } else if (payload.seriesIndex != null) { + if (this._manuallyAxisShowTip(tooltipModel, ecModel, api2, payload)) { + return; + } + const pointInfo = findPointFromSeries(payload, ecModel); + const cx = pointInfo.point[0]; + const cy = pointInfo.point[1]; + if (cx != null && cy != null) { + this._tryShow({ + offsetX: cx, + offsetY: cy, + target: pointInfo.el, + position: payload.position, + positionDefault: "bottom" + }, dispatchAction3); + } + } else if (payload.x != null && payload.y != null) { + api2.dispatchAction({ + type: "updateAxisPointer", + x: payload.x, + y: payload.y + }); + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + target: api2.getZr().findHover(payload.x, payload.y).target + }, dispatchAction3); + } + } + manuallyHideTip(tooltipModel, ecModel, api2, payload) { + const tooltipContent = this._tooltipContent; + if (this._tooltipModel) { + tooltipContent.hideLater(this._tooltipModel.get("hideDelay")); + } + this._lastX = this._lastY = this._lastDataByCoordSys = null; + if (payload.from !== this.uid) { + this._hide(makeDispatchAction2(payload, api2)); + } + } + _manuallyAxisShowTip(tooltipModel, ecModel, api2, payload) { + const seriesIndex = payload.seriesIndex; + const dataIndex = payload.dataIndex; + const coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo; + if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { + return; + } + const seriesModel = ecModel.getSeriesByIndex(seriesIndex); + if (!seriesModel) { + return; + } + const data = seriesModel.getData(); + const tooltipCascadedModel = buildTooltipModel([ + data.getItemModel(dataIndex), + seriesModel, + (seriesModel.coordinateSystem || {}).model + ], this._tooltipModel); + if (tooltipCascadedModel.get("trigger") !== "axis") { + return; + } + api2.dispatchAction({ + type: "updateAxisPointer", + seriesIndex, + dataIndex, + position: payload.position + }); + return true; + } + _tryShow(e2, dispatchAction3) { + const el = e2.target; + const tooltipModel = this._tooltipModel; + if (!tooltipModel) { + return; + } + this._lastX = e2.offsetX; + this._lastY = e2.offsetY; + const dataByCoordSys = e2.dataByCoordSys; + if (dataByCoordSys && dataByCoordSys.length) { + this._showAxisTooltip(dataByCoordSys, e2); + } else if (el) { + const ecData = getECData(el); + if (ecData.ssrType === "legend") { + return; + } + this._lastDataByCoordSys = null; + let seriesDispatcher; + let cmptDispatcher; + findEventDispatcher(el, (target) => { + if (getECData(target).dataIndex != null) { + seriesDispatcher = target; + return true; } - var data = dataModel.getData(ecData.dataType); - var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex); - if (!isNaN(value)) { - this._showIndicator(value, value); + if (getECData(target).tooltipConfig != null) { + cmptDispatcher = target; + return true; } - }; - ContinuousView.prototype._hideIndicator = function () { - var shapes = this._shapes; - shapes.indicator && shapes.indicator.attr('invisible', true); - shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true); - var handleLabels = this._shapes.handleLabels; - if (handleLabels) { - for (var i = 0; i < handleLabels.length; i++) { - // Fade out handle labels. - // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it. - this.api.leaveBlur(handleLabels[i]); - } + }, true); + if (seriesDispatcher) { + this._showSeriesItemTooltip(e2, seriesDispatcher, dispatchAction3); + } else if (cmptDispatcher) { + this._showComponentItemTooltip(e2, cmptDispatcher, dispatchAction3); + } else { + this._hide(dispatchAction3); + } + } else { + this._lastDataByCoordSys = null; + this._hide(dispatchAction3); + } + } + _showOrMove(tooltipModel, cb) { + const delay = tooltipModel.get("showDelay"); + cb = bind(cb, this); + clearTimeout(this._showTimout); + delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb(); + } + _showAxisTooltip(dataByCoordSys, e2) { + const ecModel = this._ecModel; + const globalTooltipModel = this._tooltipModel; + const point = [e2.offsetX, e2.offsetY]; + const singleTooltipModel = buildTooltipModel([e2.tooltipOption], globalTooltipModel); + const renderMode = this._renderMode; + const cbParamsList = []; + const articleMarkup = createTooltipMarkup("section", { + blocks: [], + noHeader: true + }); + const markupTextArrLegacy = []; + const markupStyleCreator = new TooltipMarkupStyleCreator(); + each(dataByCoordSys, function(itemCoordSys) { + each(itemCoordSys.dataByAxis, function(axisItem) { + const axisModel = ecModel.getComponent(axisItem.axisDim + "Axis", axisItem.axisIndex); + const axisValue = axisItem.value; + if (!axisModel || axisValue == null) { + return; } - }; - ContinuousView.prototype._clearHoverLinkToSeries = function () { - this._hideIndicator(); - var indices = this._hoverLinkDataIndices; - this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel)); - indices.length = 0; - }; - ContinuousView.prototype._clearHoverLinkFromSeries = function () { - this._hideIndicator(); - var zr = this.api.getZr(); - zr.off('mouseover', this._hoverLinkFromSeriesMouseOver); - zr.off('mouseout', this._hideIndicator); - }; - ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) { - var transform = getTransform(element, global ? null : this.group); - return isArray(vertex) ? applyTransform$1(vertex, transform, inverse) : transformDirection(vertex, transform, inverse); - }; - // TODO: TYPE more specified payload types. - ContinuousView.prototype._dispatchHighDown = function (type, batch) { - batch && batch.length && this.api.dispatchAction({ - type: type, - batch: batch + const axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt); + const axisSectionMarkup = createTooltipMarkup("section", { + header: axisValueLabel, + noHeader: !trim(axisValueLabel), + sortBlocks: true, + blocks: [] + }); + articleMarkup.blocks.push(axisSectionMarkup); + each(axisItem.seriesDataIndices, function(idxItem) { + const series = ecModel.getSeriesByIndex(idxItem.seriesIndex); + const dataIndex = idxItem.dataIndexInside; + const cbParams = series.getDataParams(dataIndex); + if (cbParams.dataIndex < 0) { + return; + } + cbParams.axisDim = axisItem.axisDim; + cbParams.axisIndex = axisItem.axisIndex; + cbParams.axisType = axisItem.axisType; + cbParams.axisId = axisItem.axisId; + cbParams.axisValue = getAxisRawValue(axisModel.axis, {value: axisValue}); + cbParams.axisValueLabel = axisValueLabel; + cbParams.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(cbParams.color), renderMode); + const seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null)); + const frag = seriesTooltipResult.frag; + if (frag) { + const valueFormatter = buildTooltipModel([series], globalTooltipModel).get("valueFormatter"); + axisSectionMarkup.blocks.push(valueFormatter ? extend({valueFormatter}, frag) : frag); + } + if (seriesTooltipResult.text) { + markupTextArrLegacy.push(seriesTooltipResult.text); + } + cbParamsList.push(cbParams); }); + }); + }); + articleMarkup.blocks.reverse(); + markupTextArrLegacy.reverse(); + const positionExpr = e2.position; + const orderMode = singleTooltipModel.get("order"); + const builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), singleTooltipModel.get("textStyle")); + builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText); + const blockBreak = renderMode === "richText" ? "\n\n" : "
"; + const allMarkupText = markupTextArrLegacy.join(blockBreak); + this._showOrMove(singleTooltipModel, function() { + if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) { + this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList); + } else { + this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + "", point[0], point[1], positionExpr, null, markupStyleCreator); + } + }); + } + _showSeriesItemTooltip(e2, dispatcher, dispatchAction3) { + const ecModel = this._ecModel; + const ecData = getECData(dispatcher); + const seriesIndex = ecData.seriesIndex; + const seriesModel = ecModel.getSeriesByIndex(seriesIndex); + const dataModel = ecData.dataModel || seriesModel; + const dataIndex = ecData.dataIndex; + const dataType = ecData.dataType; + const data = dataModel.getData(dataType); + const renderMode = this._renderMode; + const positionDefault = e2.positionDefault; + const tooltipModel = buildTooltipModel([ + data.getItemModel(dataIndex), + dataModel, + seriesModel && (seriesModel.coordinateSystem || {}).model + ], this._tooltipModel, positionDefault ? {position: positionDefault} : null); + const tooltipTrigger = tooltipModel.get("trigger"); + if (tooltipTrigger != null && tooltipTrigger !== "item") { + return; + } + const params = dataModel.getDataParams(dataIndex, dataType); + const markupStyleCreator = new TooltipMarkupStyleCreator(); + params.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(params.color), renderMode); + const seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType)); + const orderMode = tooltipModel.get("order"); + const valueFormatter = tooltipModel.get("valueFormatter"); + const frag = seriesTooltipResult.frag; + const markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({valueFormatter}, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), tooltipModel.get("textStyle")) : seriesTooltipResult.text; + const asyncTicket = "item_" + dataModel.name + "_" + dataIndex; + this._showOrMove(tooltipModel, function() { + this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e2.offsetX, e2.offsetY, e2.position, e2.target, markupStyleCreator); + }); + dispatchAction3({ + type: "showTip", + dataIndexInside: dataIndex, + dataIndex: data.getRawIndex(dataIndex), + seriesIndex, + from: this.uid + }); + } + _showComponentItemTooltip(e2, el, dispatchAction3) { + const isHTMLRenderMode = this._renderMode === "html"; + const ecData = getECData(el); + const tooltipConfig = ecData.tooltipConfig; + let tooltipOpt = tooltipConfig.option || {}; + let encodeHTMLContent = tooltipOpt.encodeHTMLContent; + if (isString(tooltipOpt)) { + const content = tooltipOpt; + tooltipOpt = { + content, + formatter: content + }; + encodeHTMLContent = true; + } + if (encodeHTMLContent && isHTMLRenderMode && tooltipOpt.content) { + tooltipOpt = clone(tooltipOpt); + tooltipOpt.content = encodeHTML(tooltipOpt.content); + } + const tooltipModelCascade = [tooltipOpt]; + const cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex); + if (cmpt) { + tooltipModelCascade.push(cmpt); + } + tooltipModelCascade.push({formatter: tooltipOpt.content}); + const positionDefault = e2.positionDefault; + const subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {position: positionDefault} : null); + const defaultHtml = subTooltipModel.get("content"); + const asyncTicket = Math.random() + ""; + const markupStyleCreator = new TooltipMarkupStyleCreator(); + this._showOrMove(subTooltipModel, function() { + const formatterParams = clone(subTooltipModel.get("formatterParams") || {}); + this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e2.offsetX, e2.offsetY, e2.position, el, markupStyleCreator); + }); + dispatchAction3({ + type: "showTip", + from: this.uid + }); + } + _showTooltipContent(tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) { + this._ticket = ""; + if (!tooltipModel.get("showContent") || !tooltipModel.get("show")) { + return; + } + const tooltipContent = this._tooltipContent; + tooltipContent.setEnterable(tooltipModel.get("enterable")); + const formatter = tooltipModel.get("formatter"); + positionExpr = positionExpr || tooltipModel.get("position"); + let html = defaultHtml; + const nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get("trigger"), tooltipModel.get("borderColor")); + const nearPointColor = nearPoint.color; + if (formatter) { + if (isString(formatter)) { + const useUTC = tooltipModel.ecModel.get("useUTC"); + const params0 = isArray(params) ? params[0] : params; + const isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf("time") >= 0; + html = formatter; + if (isTimeAxis) { + html = format(params0.axisValue, html, useUTC); + } + html = formatTpl(html, params, true); + } else if (isFunction(formatter)) { + const callback = bind(function(cbTicket, html2) { + if (cbTicket === this._ticket) { + tooltipContent.setContent(html2, markupStyleCreator, tooltipModel, nearPointColor, positionExpr); + this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el); + } + }, this); + this._ticket = asyncTicket; + html = formatter(params, asyncTicket, callback); + } else { + html = formatter; + } + } + tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr); + tooltipContent.show(tooltipModel, nearPointColor); + this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el); + } + _getNearestPoint(point, tooltipDataParams, trigger3, borderColor) { + if (trigger3 === "axis" || isArray(tooltipDataParams)) { + return { + color: borderColor || (this._renderMode === "html" ? "#fff" : "none") }; - /** - * @override - */ - ContinuousView.prototype.dispose = function () { - this._clearHoverLinkFromSeries(); - this._clearHoverLinkToSeries(); - }; - ContinuousView.type = 'visualMap.continuous'; - return ContinuousView; - }(VisualMapView); - function createPolygon(points, cursor, onDrift, onDragEnd) { - return new Polygon({ - shape: { - points: points - }, - draggable: !!onDrift, - cursor: cursor, - drift: onDrift, - onmousemove: function (e) { - // For mobile device, prevent screen slider on the button. - stop(e.event); - }, - ondragend: onDragEnd - }); } - function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) { - var halfHoverLinkSize = HOVER_LINK_SIZE / 2; - var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize'); - if (hoverLinkDataSize) { - halfHoverLinkSize = linearMap$2(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; - } - return halfHoverLinkSize; - } - function useHoverLinkOnHandle(visualMapModel) { - var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle'); - return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle); - } - function getCursor$1(orient) { - return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; - } - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 visualMapActionInfo = { - type: 'selectDataRange', - event: 'dataRangeSelected', - // FIXME use updateView appears wrong - update: 'update' - }; - var visualMapActionHander = function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'visualMap', - query: payload - }, function (model) { - model.setSelected(payload.selected); + if (!isArray(tooltipDataParams)) { + return { + color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor + }; + } + } + _updatePosition(tooltipModel, positionExpr, x, y, content, params, el) { + const viewWidth = this._api.getWidth(); + const viewHeight = this._api.getHeight(); + positionExpr = positionExpr || tooltipModel.get("position"); + const contentSize = content.getSize(); + let align = tooltipModel.get("align"); + let vAlign = tooltipModel.get("verticalAlign"); + const rect = el && el.getBoundingRect().clone(); + el && rect.applyTransform(el.transform); + if (isFunction(positionExpr)) { + positionExpr = positionExpr([x, y], params, content.el, rect, { + viewSize: [viewWidth, viewHeight], + contentSize: contentSize.slice() }); - }; - - var visualMapEncodingHandlers = [{ - createOnAllSeries: true, - reset: function (seriesModel, ecModel) { - var resetDefines = []; - ecModel.eachComponent('visualMap', function (visualMapModel) { - var pipelineContext = seriesModel.pipelineContext; - if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) { - return; + } + if (isArray(positionExpr)) { + x = parsePercent2(positionExpr[0], viewWidth); + y = parsePercent2(positionExpr[1], viewHeight); + } else if (isObject(positionExpr)) { + const boxLayoutPosition = positionExpr; + boxLayoutPosition.width = contentSize[0]; + boxLayoutPosition.height = contentSize[1]; + const layoutRect = getLayoutRect(boxLayoutPosition, {width: viewWidth, height: viewHeight}); + x = layoutRect.x; + y = layoutRect.y; + align = null; + vAlign = null; + } else if (isString(positionExpr) && el) { + const pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get("borderWidth")); + x = pos[0]; + y = pos[1]; + } else { + const pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20); + x = pos[0]; + y = pos[1]; + } + align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === "right" ? contentSize[0] : 0); + vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === "bottom" ? contentSize[1] : 0); + if (shouldTooltipConfine(tooltipModel)) { + const pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight); + x = pos[0]; + y = pos[1]; + } + content.moveTo(x, y); + } + _updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList) { + const lastCoordSys = this._lastDataByCoordSys; + const lastCbParamsList = this._cbParamsList; + let contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length; + contentNotChanged && each(lastCoordSys, (lastItemCoordSys, indexCoordSys) => { + const lastDataByAxis = lastItemCoordSys.dataByAxis || []; + const thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; + const thisDataByAxis = thisItemCoordSys.dataByAxis || []; + contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length; + contentNotChanged && each(lastDataByAxis, (lastItem, indexAxis) => { + const thisItem = thisDataByAxis[indexAxis] || {}; + const lastIndices = lastItem.seriesDataIndices || []; + const newIndices = thisItem.seriesDataIndices || []; + contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length; + contentNotChanged && each(lastIndices, (lastIdxItem, j) => { + const newIdxItem = newIndices[j]; + contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex; + }); + lastCbParamsList && each(lastItem.seriesDataIndices, (idxItem) => { + const seriesIdx = idxItem.seriesIndex; + const cbParams = cbParamsList[seriesIdx]; + const lastCbParams = lastCbParamsList[seriesIdx]; + if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) { + contentNotChanged = false; } - resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData()))); }); - return resetDefines; + }); + }); + this._lastDataByCoordSys = dataByCoordSys; + this._cbParamsList = cbParamsList; + return !!contentNotChanged; + } + _hide(dispatchAction3) { + this._lastDataByCoordSys = null; + dispatchAction3({ + type: "hideTip", + from: this.uid + }); + } + dispose(ecModel, api2) { + if (env_default.node || !api2.getDom()) { + return; + } + clear(this, "_updatePosition"); + this._tooltipContent.dispose(); + unregister("itemTooltip", api2); + } +}; +var TooltipView = TooltipView2; +TooltipView.type = "tooltip"; +function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) { + const ecModel = globalTooltipModel.ecModel; + let resultModel; + if (defaultTooltipOption) { + resultModel = new Model_default(defaultTooltipOption, ecModel, ecModel); + resultModel = new Model_default(globalTooltipModel.option, resultModel, ecModel); + } else { + resultModel = globalTooltipModel; + } + for (let i = modelCascade.length - 1; i >= 0; i--) { + let tooltipOpt = modelCascade[i]; + if (tooltipOpt) { + if (tooltipOpt instanceof Model_default) { + tooltipOpt = tooltipOpt.get("tooltip", true); + } + if (isString(tooltipOpt)) { + tooltipOpt = { + formatter: tooltipOpt + }; + } + if (tooltipOpt) { + resultModel = new Model_default(tooltipOpt, resultModel, ecModel); + } + } + } + return resultModel; +} +function makeDispatchAction2(payload, api2) { + return payload.dispatchAction || bind(api2.dispatchAction, api2); +} +function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) { + const size = content.getSize(); + const width = size[0]; + const height = size[1]; + if (gapH != null) { + if (x + width + gapH + 2 > viewWidth) { + x -= width + gapH; + } else { + x += gapH; + } + } + if (gapV != null) { + if (y + height + gapV > viewHeight) { + y -= height + gapV; + } else { + y += gapV; + } + } + return [x, y]; +} +function confineTooltipPosition(x, y, content, viewWidth, viewHeight) { + const size = content.getSize(); + const width = size[0]; + const height = size[1]; + x = Math.min(x + width, viewWidth) - width; + y = Math.min(y + height, viewHeight) - height; + x = Math.max(x, 0); + y = Math.max(y, 0); + return [x, y]; +} +function calcTooltipPosition(position2, rect, contentSize, borderWidth) { + const domWidth = contentSize[0]; + const domHeight = contentSize[1]; + const offset = Math.ceil(Math.SQRT2 * borderWidth) + 8; + let x = 0; + let y = 0; + const rectWidth = rect.width; + const rectHeight = rect.height; + switch (position2) { + case "inside": + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y + rectHeight / 2 - domHeight / 2; + break; + case "top": + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y - domHeight - offset; + break; + case "bottom": + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y + rectHeight + offset; + break; + case "left": + x = rect.x - domWidth - offset; + y = rect.y + rectHeight / 2 - domHeight / 2; + break; + case "right": + x = rect.x + rectWidth + offset; + y = rect.y + rectHeight / 2 - domHeight / 2; + } + return [x, y]; +} +function isCenterAlign(align) { + return align === "center" || align === "middle"; +} +function findComponentReference(payload, ecModel, api2) { + const {queryOptionMap} = preParseFinder(payload); + const componentMainType = queryOptionMap.keys()[0]; + if (!componentMainType || componentMainType === "series") { + return; + } + const queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {useDefault: false, enableAll: false, enableNone: false}); + const model = queryResult.models[0]; + if (!model) { + return; + } + const view = api2.getViewOfComponentModel(model); + let el; + view.group.traverse((subEl) => { + const tooltipConfig = getECData(subEl).tooltipConfig; + if (tooltipConfig && tooltipConfig.name === payload.name) { + el = subEl; + return true; + } + }); + if (el) { + return { + componentMainType, + componentIndex: model.componentIndex, + el + }; + } +} +var TooltipView_default = TooltipView; + +// src/component/tooltip/install.ts +function install37(registers) { + use(install29); + registers.registerComponentModel(TooltipModel_default); + registers.registerComponentView(TooltipView_default); + registers.registerAction({ + type: "showTip", + event: "showTip", + update: "tooltip:manuallyShowTip" + }, noop); + registers.registerAction({ + type: "hideTip", + event: "hideTip", + update: "tooltip:manuallyHideTip" + }, noop); +} + +// src/component/brush/preprocessor.ts +var DEFAULT_TOOLBOX_BTNS = ["rect", "polygon", "keep", "clear"]; +function brushPreprocessor(option, isNew) { + const brushComponents = normalizeToArray(option ? option.brush : []); + if (!brushComponents.length) { + return; + } + let brushComponentSpecifiedBtns = []; + each(brushComponents, function(brushOpt) { + const tbs = brushOpt.hasOwnProperty("toolbox") ? brushOpt.toolbox : []; + if (tbs instanceof Array) { + brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); + } + }); + let toolbox = option && option.toolbox; + if (isArray(toolbox)) { + toolbox = toolbox[0]; + } + if (!toolbox) { + toolbox = {feature: {}}; + option.toolbox = [toolbox]; + } + const toolboxFeature = toolbox.feature || (toolbox.feature = {}); + const toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); + const brushTypes = toolboxBrush.type || (toolboxBrush.type = []); + brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); + removeDuplicate(brushTypes); + if (isNew && !brushTypes.length) { + brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); + } +} +function removeDuplicate(arr) { + const map3 = {}; + each(arr, function(val) { + map3[val] = 1; + }); + arr.length = 0; + each(map3, function(flag, val) { + arr.push(val); + }); +} + +// src/visual/visualSolution.ts +var each12 = each; +function hasKeys(obj) { + if (obj) { + for (const name in obj) { + if (obj.hasOwnProperty(name)) { + return true; } - }, - // Only support color. - { - createOnAllSeries: true, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - var visualMetaList = []; - ecModel.eachComponent('visualMap', function (visualMapModel) { - if (visualMapModel.isTargetSeries(seriesModel)) { - var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || { - stops: [], - outerColors: [] - }; - var dimIdx = visualMapModel.getDataDimensionIndex(data); - if (dimIdx >= 0) { - // visualMeta.dimension should be dimension index, but not concrete dimension. - visualMeta.dimension = dimIdx; - visualMetaList.push(visualMeta); - } - } - }); - // console.log(JSON.stringify(visualMetaList.map(a => a.stops))); - seriesModel.getData().setVisual('visualMeta', visualMetaList); + } + } +} +function createVisualMappings(option, stateList, supplementVisualOption) { + const visualMappings = {}; + each12(stateList, function(state) { + const mappings = visualMappings[state] = createMappings(); + each12(option[state], function(visualData, visualType) { + if (!VisualMapping_default.isValidType(visualType)) { + return; } - }]; - // FIXME - // performance and export for heatmap? - // value can be Infinity or -Infinity - function getColorVisual(seriesModel, visualMapModel, value, valueState) { - var mappings = visualMapModel.targetVisuals[valueState]; - var visualTypes = VisualMapping.prepareVisualTypes(mappings); - var resultVisual = { - color: getVisualFromData(seriesModel.getData(), 'color') // default color. + let mappingOption = { + type: visualType, + visual: visualData }; - - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type]; - mapping && mapping.applyVisual(value, getVisual, setVisual); + supplementVisualOption && supplementVisualOption(mappingOption, state); + mappings[visualType] = new VisualMapping_default(mappingOption); + if (visualType === "opacity") { + mappingOption = clone(mappingOption); + mappingOption.type = "colorAlpha"; + mappings.__hidden.__alphaForOpacity = new VisualMapping_default(mappingOption); + } + }); + }); + return visualMappings; + function createMappings() { + const Creater = function() { + }; + Creater.prototype.__hidden = Creater.prototype; + const obj = new Creater(); + return obj; + } +} +function replaceVisualOption(thisOption, newOption, keys2) { + let has3; + each(keys2, function(key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + has3 = true; + } + }); + has3 && each(keys2, function(key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + thisOption[key] = clone(newOption[key]); + } else { + delete thisOption[key]; + } + }); +} +function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) { + const visualTypesMap = {}; + each(stateList, function(state) { + const visualTypes = VisualMapping_default.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); + let dataIndex; + function getVisual(key) { + return getItemVisualFromData(data, dataIndex, key); + } + function setVisual(key, value) { + setItemVisualFromData(data, dataIndex, key, value); + } + if (dimension == null) { + data.each(eachItem); + } else { + data.each([dimension], eachItem); + } + function eachItem(valueOrIndex, index) { + dataIndex = dimension == null ? valueOrIndex : index; + const rawDataItem = data.getRawDataItem(dataIndex); + if (rawDataItem && rawDataItem.visualMap === false) { + return; + } + const valueState = getValueState.call(scope, valueOrIndex); + const mappings = visualMappings[valueState]; + const visualTypes = visualTypesMap[valueState]; + for (let i = 0, len2 = visualTypes.length; i < len2; i++) { + const type = visualTypes[i]; + mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual); + } + } +} +function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) { + const visualTypesMap = {}; + each(stateList, function(state) { + const visualTypes = VisualMapping_default.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); + return { + progress: function progress(params, data) { + let dimIndex; + if (dim != null) { + dimIndex = data.getDimensionIndex(dim); } - return resultVisual.color; function getVisual(key) { - return resultVisual[key]; + return getItemVisualFromData(data, dataIndex, key); } function setVisual(key, value) { - resultVisual[key] = value; + setItemVisualFromData(data, dataIndex, key, value); + } + let dataIndex; + const store = data.getStore(); + while ((dataIndex = params.next()) != null) { + const rawDataItem = data.getRawDataItem(dataIndex); + if (rawDataItem && rawDataItem.visualMap === false) { + continue; + } + const value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex; + const valueState = getValueState(value); + const mappings = visualMappings[valueState]; + const visualTypes = visualTypesMap[valueState]; + for (let i = 0, len2 = visualTypes.length; i < len2; i++) { + const type = visualTypes[i]; + mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual); + } } } + }; +} - var each$f = each; - function visualMapPreprocessor(option) { - var visualMap = option && option.visualMap; - if (!isArray(visualMap)) { - visualMap = visualMap ? [visualMap] : []; +// src/component/brush/selector.ts +function makeBrushCommonSelectorForSeries(area) { + const brushType = area.brushType; + const selectors = { + point(itemLayout) { + return selector[brushType].point(itemLayout, selectors, area); + }, + rect(itemLayout) { + return selector[brushType].rect(itemLayout, selectors, area); + } + }; + return selectors; +} +var selector = { + lineX: getLineSelectors(0), + lineY: getLineSelectors(1), + rect: { + point: function(itemLayout, selectors, area) { + return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); + }, + rect: function(itemLayout, selectors, area) { + return itemLayout && area.boundingRect.intersect(itemLayout); + } + }, + polygon: { + point: function(itemLayout, selectors, area) { + return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain3(area.range, itemLayout[0], itemLayout[1]); + }, + rect: function(itemLayout, selectors, area) { + const points4 = area.range; + if (!itemLayout || points4.length <= 1) { + return false; } - each$f(visualMap, function (opt) { - if (!opt) { - return; - } - // rename splitList to pieces - if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) { - opt.pieces = opt.splitList; - delete opt.splitList; - } - var pieces = opt.pieces; - if (pieces && isArray(pieces)) { - each$f(pieces, function (piece) { - if (isObject(piece)) { - if (has$1(piece, 'start') && !has$1(piece, 'min')) { - piece.min = piece.start; - } - if (has$1(piece, 'end') && !has$1(piece, 'max')) { - piece.max = piece.end; - } - } - }); - } - }); + const x = itemLayout.x; + const y = itemLayout.y; + const width = itemLayout.width; + const height = itemLayout.height; + const p = points4[0]; + if (contain3(points4, x, y) || contain3(points4, x + width, y) || contain3(points4, x, y + height) || contain3(points4, x + width, y + height) || BoundingRect_default.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points4) || linePolygonIntersect(x, y, x, y + height, points4) || linePolygonIntersect(x + width, y, x + width, y + height, points4) || linePolygonIntersect(x, y + height, x + width, y + height, points4)) { + return true; + } + } + } +}; +function getLineSelectors(xyIndex) { + const xy = ["x", "y"]; + const wh = ["width", "height"]; + return { + point: function(itemLayout, selectors, area) { + if (itemLayout) { + const range = area.range; + const p = itemLayout[xyIndex]; + return inLineRange(p, range); + } + }, + rect: function(itemLayout, selectors, area) { + if (itemLayout) { + const range = area.range; + const layoutRange = [ + itemLayout[xy[xyIndex]], + itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]] + ]; + layoutRange[1] < layoutRange[0] && layoutRange.reverse(); + return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange); + } + } + }; +} +function inLineRange(p, range) { + return range[0] <= p && p <= range[1]; +} + +// src/component/brush/visualEncoding.ts +var STATE_LIST = ["inBrush", "outOfBrush"]; +var DISPATCH_METHOD = "__ecBrushSelect"; +var DISPATCH_FLAG = "__ecInBrushSelectEvent"; +function layoutCovers(ecModel) { + ecModel.eachComponent({mainType: "brush"}, function(brushModel) { + const brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager_default(brushModel.option, ecModel); + brushTargetManager.setInputRanges(brushModel.areas, ecModel); + }); +} +function brushVisual(ecModel, api2, payload) { + const brushSelected = []; + let throttleType; + let throttleDelay; + ecModel.eachComponent({mainType: "brush"}, function(brushModel) { + payload && payload.type === "takeGlobalCursor" && brushModel.setBrushOption(payload.key === "brush" ? payload.brushOption : {brushType: false}); + }); + layoutCovers(ecModel); + ecModel.eachComponent({mainType: "brush"}, function(brushModel, brushIndex) { + const thisBrushSelected = { + brushId: brushModel.id, + brushIndex, + brushName: brushModel.name, + areas: clone(brushModel.areas), + selected: [] + }; + brushSelected.push(thisBrushSelected); + const brushOption = brushModel.option; + const brushLink = brushOption.brushLink; + const linkedSeriesMap = []; + const selectedDataIndexForLink = []; + const rangeInfoBySeries = []; + let hasBrushExists = false; + if (!brushIndex) { + throttleType = brushOption.throttleType; + throttleDelay = brushOption.throttleDelay; + } + const areas = map(brushModel.areas, function(area) { + const builder = boundingRectBuilders[area.brushType]; + const selectableArea = defaults({boundingRect: builder ? builder(area) : void 0}, area); + selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea); + return selectableArea; + }); + const visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function(mappingOption) { + mappingOption.mappingMethod = "fixed"; + }); + isArray(brushLink) && each(brushLink, function(seriesIndex) { + linkedSeriesMap[seriesIndex] = 1; + }); + function linkOthers(seriesIndex) { + return brushLink === "all" || !!linkedSeriesMap[seriesIndex]; } - function has$1(obj, name) { - return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); + function brushed(rangeInfoList) { + return !!rangeInfoList.length; } - - var installed$1 = false; - function installCommon$1(registers) { - if (installed$1) { + ecModel.eachSeries(function(seriesModel, seriesIndex) { + const rangeInfoList = rangeInfoBySeries[seriesIndex] = []; + seriesModel.subType === "parallel" ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList); + }); + function stepAParallel(seriesModel, seriesIndex) { + const coordSys = seriesModel.coordinateSystem; + hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed(); + linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function(activeState, dataIndex) { + activeState === "active" && (selectedDataIndexForLink[dataIndex] = 1); + }); + } + function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { + if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) { return; } - installed$1 = true; - registers.registerSubTypeDefaulter('visualMap', function (option) { - // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used. - return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise'; - }); - registers.registerAction(visualMapActionInfo, visualMapActionHander); - each(visualMapEncodingHandlers, function (handler) { - registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler); + each(areas, function(area) { + if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) { + rangeInfoList.push(area); + } + hasBrushExists = hasBrushExists || brushed(rangeInfoList); }); - registers.registerPreprocessor(visualMapPreprocessor); - } - - function install$N(registers) { - registers.registerComponentModel(ContinuousModel); - registers.registerComponentView(ContinuousView); - installCommon$1(registers); - } - - var PiecewiseModel = /** @class */function (_super) { - __extends(PiecewiseModel, _super); - function PiecewiseModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = PiecewiseModel.type; - /** - * The order is always [low, ..., high]. - * [{text: string, interval: Array.}, ...] - */ - _this._pieceList = []; - return _this; - } - PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) { - _super.prototype.optionUpdated.apply(this, arguments); - this.resetExtent(); - var mode = this._mode = this._determineMode(); - this._pieceList = []; - resetMethods[this._mode].call(this, this._pieceList); - this._resetSelected(newOption, isInit); - var categories = this.option.categories; - this.resetVisual(function (mappingOption, state) { - if (mode === 'categories') { - mappingOption.mappingMethod = 'category'; - mappingOption.categories = clone(categories); - } else { - mappingOption.dataExtent = this.getExtent(); - mappingOption.mappingMethod = 'piecewise'; - mappingOption.pieceList = map(this._pieceList, function (piece) { - piece = clone(piece); - if (state !== 'inRange') { - // FIXME - // outOfRange do not support special visual in pieces. - piece.visual = null; - } - return piece; - }); + if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { + const data = seriesModel.getData(); + data.each(function(dataIndex) { + if (checkInRange(seriesModel, rangeInfoList, data, dataIndex)) { + selectedDataIndexForLink[dataIndex] = 1; } }); + } + } + ecModel.eachSeries(function(seriesModel, seriesIndex) { + const seriesBrushSelected = { + seriesId: seriesModel.id, + seriesIndex, + seriesName: seriesModel.name, + dataIndex: [] }; - /** - * @protected - * @override - */ - PiecewiseModel.prototype.completeVisualOption = function () { - // Consider this case: - // visualMap: { - // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}] - // } - // where no inRange/outOfRange set but only pieces. So we should make - // default inRange/outOfRange for this case, otherwise visuals that only - // appear in `pieces` will not be taken into account in visual encoding. - var option = this.option; - var visualTypesInPieces = {}; - var visualTypes = VisualMapping.listVisualTypes(); - var isCategory = this.isCategory(); - each(option.pieces, function (piece) { - each(visualTypes, function (visualType) { - if (piece.hasOwnProperty(visualType)) { - visualTypesInPieces[visualType] = 1; - } - }); - }); - each(visualTypesInPieces, function (v, visualType) { - var exists = false; - each(this.stateList, function (state) { - exists = exists || has(option, state, visualType) || has(option.target, state, visualType); - }, this); - !exists && 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] && obj[state].hasOwnProperty(visualType); - } - _super.prototype.completeVisualOption.apply(this, arguments); - }; - PiecewiseModel.prototype._resetSelected = function (newOption, isInit) { - var thisOption = this.option; - var pieceList = this._pieceList; - // Selected do not merge but all override. - var selected = (isInit ? thisOption : newOption).selected || {}; - thisOption.selected = selected; - // Consider 'not specified' means true. - each(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_1 = false; - each(pieceList, function (piece, index) { - var key = this.getSelectedMapKey(piece); - if (selected[key]) { - hasSel_1 ? selected[key] = false : hasSel_1 = true; - } - }, this); - } - // thisOption.selectedMode === 'multiple', default: all selected. - }; - /** - * @public - */ - PiecewiseModel.prototype.getItemSymbol = function () { - return this.get('itemSymbol'); - }; - /** - * @public - */ - PiecewiseModel.prototype.getSelectedMapKey = function (piece) { - return this._mode === 'categories' ? piece.value + '' : piece.index + ''; - }; - /** - * @public - */ - PiecewiseModel.prototype.getPieceList = function () { - return this._pieceList; - }; - /** - * @return {string} - */ - PiecewiseModel.prototype._determineMode = function () { - var option = this.option; - return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber'; - }; - /** - * @override - */ - PiecewiseModel.prototype.setSelected = function (selected) { - this.option.selected = clone(selected); - }; - /** - * @override - */ - PiecewiseModel.prototype.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 - * @param pieceIndex piece index in visualMapModel.getPieceList() - */ - PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) { - var result = []; - var pieceList = this._pieceList; - this.eachTargetSeries(function (seriesModel) { - var dataIndices = []; - var data = seriesModel.getData(); - data.each(this.getDataDimensionIndex(data), function (value, dataIndex) { - // Should always base on model pieceList, because it is order sensitive. - var pIdx = VisualMapping.findPieceIndex(value, pieceList); - pIdx === pieceIndex && dataIndices.push(dataIndex); - }, this); - result.push({ - seriesId: seriesModel.id, - dataIndex: dataIndices - }); - }, this); - return result; - }; - /** - * @private - * @param piece piece.value or piece.interval is required. - * @return Can be Infinity or -Infinity - */ - PiecewiseModel.prototype.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; - }; - PiecewiseModel.prototype.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 - }); // Not category - if (!valueState) { - valueState = visualMapModel.getValueState(representValue); - } - var color = getColorVisual(representValue, valueState); - if (interval[0] === -Infinity) { - outerColors[0] = color; - } else if (interval[1] === Infinity) { - outerColors[1] = color; - } else { - stops.push({ - value: interval[0], - color: color - }, { - value: interval[1], - color: color - }); - } - } - // Suplement - var pieceList = this._pieceList.slice(); - if (!pieceList.length) { - pieceList.push({ - interval: [-Infinity, Infinity] - }); - } else { - var edge = pieceList[0].interval[0]; - edge !== -Infinity && pieceList.unshift({ - interval: [-Infinity, edge] - }); - edge = pieceList[pieceList.length - 1].interval[1]; - edge !== Infinity && pieceList.push({ - interval: [edge, Infinity] - }); - } - var curr = -Infinity; - each(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 - }; + thisBrushSelected.selected.push(seriesBrushSelected); + const rangeInfoList = rangeInfoBySeries[seriesIndex]; + const data = seriesModel.getData(); + const getValueState = linkOthers(seriesIndex) ? function(dataIndex) { + return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush"; + } : function(dataIndex) { + return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush"; }; - PiecewiseModel.type = 'visualMap.piecewise'; - PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, { - selected: null, - minOpen: false, - maxOpen: false, - align: 'auto', - itemWidth: 20, - itemHeight: 14, - itemSymbol: 'roundRect', - pieces: null, - categories: null, - splitNumber: 5, - selectedMode: 'multiple', - itemGap: 10, - hoverLink: true // Enable hover highlight. + (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual(STATE_LIST, visualMappings, data, getValueState); + }); + }); + dispatchAction(api2, throttleType, throttleDelay, brushSelected, payload); +} +function dispatchAction(api2, throttleType, throttleDelay, brushSelected, payload) { + if (!payload) { + return; + } + const zr = api2.getZr(); + if (zr[DISPATCH_FLAG]) { + return; + } + if (!zr[DISPATCH_METHOD]) { + zr[DISPATCH_METHOD] = doDispatch; + } + const fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); + fn(api2, brushSelected); +} +function doDispatch(api2, brushSelected) { + if (!api2.isDisposed()) { + const zr = api2.getZr(); + zr[DISPATCH_FLAG] = true; + api2.dispatchAction({ + type: "brushSelect", + batch: brushSelected + }); + zr[DISPATCH_FLAG] = false; + } +} +function checkInRange(seriesModel, rangeInfoList, data, dataIndex) { + for (let i = 0, len2 = rangeInfoList.length; i < len2; i++) { + const area = rangeInfoList[i]; + if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) { + return true; + } + } +} +function brushModelNotControll(brushModel, seriesIndex) { + const seriesIndices = brushModel.option.seriesIndex; + return seriesIndices != null && seriesIndices !== "all" && (isArray(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices); +} +var boundingRectBuilders = { + rect: function(area) { + return getBoundingRectFromMinMax(area.range); + }, + polygon: function(area) { + let minMax; + const range = area.range; + for (let i = 0, len2 = range.length; i < len2; i++) { + minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]]; + const 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_default(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]); +} + +// src/component/brush/BrushView.ts +var BrushView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = BrushView2.type; + } + init(ecModel, api2) { + this.ecModel = ecModel; + this.api = api2; + this.model; + (this._brushController = new BrushController_default(api2.getZr())).on("brush", bind(this._onBrush, this)).mount(); + } + render(brushModel, ecModel, api2, payload) { + this.model = brushModel; + this._updateController(brushModel, ecModel, api2, payload); + } + updateTransform(brushModel, ecModel, api2, payload) { + layoutCovers(ecModel); + this._updateController(brushModel, ecModel, api2, payload); + } + updateVisual(brushModel, ecModel, api2, payload) { + this.updateTransform(brushModel, ecModel, api2, payload); + } + updateView(brushModel, ecModel, api2, payload) { + this._updateController(brushModel, ecModel, api2, payload); + } + _updateController(brushModel, ecModel, api2, payload) { + (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api2)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice()); + } + dispose() { + this._brushController.dispose(); + } + _onBrush(eventParam) { + const modelId = this.model.id; + const areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel); + (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({ + type: "brush", + brushId: modelId, + areas: clone(areas), + $from: modelId + }); + eventParam.isEnd && this.api.dispatchAction({ + type: "brushEnd", + brushId: modelId, + areas: clone(areas), + $from: modelId + }); + } +}; +var BrushView = BrushView2; +BrushView.type = "brush"; +var BrushView_default = BrushView; + +// src/component/brush/BrushModel.ts +var DEFAULT_OUT_OF_BRUSH_COLOR = "#ddd"; +var BrushModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = BrushModel2.type; + this.areas = []; + this.brushOption = {}; + } + optionUpdated(newOption, isInit) { + const thisOption = this.option; + !isInit && replaceVisualOption(thisOption, newOption, ["inBrush", "outOfBrush"]); + const inBrush = thisOption.inBrush = thisOption.inBrush || {}; + thisOption.outOfBrush = thisOption.outOfBrush || {color: DEFAULT_OUT_OF_BRUSH_COLOR}; + if (!inBrush.hasOwnProperty("liftZ")) { + inBrush.liftZ = 5; + } + } + setAreas(areas) { + if (true) { + assert(isArray(areas)); + each(areas, function(area) { + assert(area.brushType, "Illegal areas"); }); - - return PiecewiseModel; - }(VisualMapModel); - /** - * Key is this._mode - * @type {Object} - * @this {module:echarts/component/viusalMap/PiecewiseMode} - */ - var resetMethods = { - splitNumber: function (outPieceList) { - var thisOption = this.option; - 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) { - outPieceList.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; - outPieceList.push({ - interval: [curr, max], - close: [1, 1] - }); - } - if (thisOption.maxOpen) { - outPieceList.push({ - interval: [dataExtent[1], Infinity], - close: [0, 0] - }); + } + if (!areas) { + return; + } + this.areas = map(areas, function(area) { + return generateBrushOption(this.option, area); + }, this); + } + setBrushOption(brushOption) { + this.brushOption = generateBrushOption(this.option, brushOption); + this.brushType = this.brushOption.brushType; + } +}; +var BrushModel = BrushModel2; +BrushModel.type = "brush"; +BrushModel.dependencies = ["geo", "grid", "xAxis", "yAxis", "parallel", "series"]; +BrushModel.defaultOption = { + seriesIndex: "all", + brushType: "rect", + brushMode: "single", + transformable: true, + brushStyle: { + borderWidth: 1, + color: "rgba(210,219,238,0.3)", + borderColor: "#D2DBEE" + }, + throttleType: "fixRate", + throttleDelay: 0, + removeOnClick: true, + z: 1e4 +}; +function generateBrushOption(option, brushOption) { + return merge({ + brushType: option.brushType, + brushMode: option.brushMode, + transformable: option.transformable, + brushStyle: new Model_default(option.brushStyle).getItemStyle(), + removeOnClick: option.removeOnClick, + z: option.z + }, brushOption, true); +} +var BrushModel_default = BrushModel; + +// src/component/toolbox/feature/Brush.ts +var ICON_TYPES = ["rect", "polygon", "lineX", "lineY", "keep", "clear"]; +var BrushFeature = class extends ToolboxFeature { + render(featureModel, ecModel, api2) { + let brushType; + let brushMode; + let isBrushed; + ecModel.eachComponent({mainType: "brush"}, function(brushModel) { + brushType = brushModel.brushType; + brushMode = brushModel.brushOption.brushMode || "single"; + isBrushed = isBrushed || !!brushModel.areas.length; + }); + this._brushType = brushType; + this._brushMode = brushMode; + each(featureModel.get("type", true), function(type) { + featureModel.setIconStatus(type, (type === "keep" ? brushMode === "multiple" : type === "clear" ? isBrushed : type === brushType) ? "emphasis" : "normal"); + }); + } + updateView(featureModel, ecModel, api2) { + this.render(featureModel, ecModel, api2); + } + getIcons() { + const model = this.model; + const availableIcons = model.get("icon", true); + const icons = {}; + each(model.get("type", true), function(type) { + if (availableIcons[type]) { + icons[type] = availableIcons[type]; + } + }); + return icons; + } + onclick(ecModel, api2, type) { + const brushType = this._brushType; + const brushMode = this._brushMode; + if (type === "clear") { + api2.dispatchAction({ + type: "axisAreaSelect", + intervals: [] + }); + api2.dispatchAction({ + type: "brush", + command: "clear", + areas: [] + }); + } else { + api2.dispatchAction({ + type: "takeGlobalCursor", + key: "brush", + brushOption: { + brushType: type === "keep" ? brushType : brushType === type ? false : type, + brushMode: type === "keep" ? brushMode === "multiple" ? "single" : "multiple" : brushMode } - reformIntervals(outPieceList); - each(outPieceList, function (piece, index) { - piece.index = index; - piece.text = this.formatValueText(piece.interval); - }, this); - }, - categories: function (outPieceList) { - var thisOption = this.option; - each(thisOption.categories, function (cate) { - // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。 - // 是否改一致。 - outPieceList.push({ - text: this.formatValueText(cate, true), - value: cate - }); - }, this); - // See "Order Rule". - normalizeReverse(thisOption, outPieceList); + }); + } + } + static getDefaultOption(ecModel) { + const defaultOption3 = { + show: true, + type: ICON_TYPES.slice(), + icon: { + rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13", + 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", + 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", + 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", + 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", + 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" }, - pieces: function (outPieceList) { - var thisOption = this.option; - each(thisOption.pieces, function (pieceListItem, index) { - if (!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 recommended. - var interval = item.interval = []; - var close_1 = 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_1[lg] = closeList[i]; - useMinMax[lg] = i === 2; - } - interval[lg] == null && (interval[lg] = infinityList[lg]); - } - useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0); - useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0); - if ("development" !== 'production') { - if (interval[0] > interval[1]) { - console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.'); - } - } - if (interval[0] === interval[1] && close_1[0] && close_1[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); - outPieceList.push(item); - }, this); - // See "Order Rule". - normalizeReverse(thisOption, outPieceList); - // Only pieces - reformIntervals(outPieceList); - each(outPieceList, 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); - } + title: ecModel.getLocaleModel().get(["toolbox", "brush", "title"]) }; - function normalizeReverse(thisOption, pieceList) { - var inverse = thisOption.inverse; - if (thisOption.orient === 'vertical' ? !inverse : inverse) { - pieceList.reverse(); - } - } - - var PiecewiseVisualMapView = /** @class */function (_super) { - __extends(PiecewiseVisualMapView, _super); - function PiecewiseVisualMapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = PiecewiseVisualMapView.type; - return _this; - } - PiecewiseVisualMapView.prototype.doRender = function () { - var thisGroup = this.group; - thisGroup.removeAll(); - var visualMapModel = this.visualMapModel; - var textGap = visualMapModel.get('textGap'); - var textStyleModel = visualMapModel.textStyleModel; - var textFont = textStyleModel.getFont(); - var textFill = textStyleModel.getTextColor(); - var itemAlign = this._getItemAlign(); - var itemSize = visualMapModel.itemSize; - var viewData = this._getViewData(); - var endsText = viewData.endsText; - var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText); - endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign); - each(viewData.viewPieceList, function (item) { - var piece = item.piece; - var itemGroup = new Group(); - itemGroup.onclick = bind(this._onItemClick, this, piece); - this._enableHoverLink(itemGroup, item.indexInModelPieceList); - // TODO Category - var representValue = visualMapModel.getRepresentValue(piece); - this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]); - if (showLabel) { - var visualState = this.visualMapModel.getValueState(representValue); - itemGroup.add(new ZRText({ - style: { - x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap, - y: itemSize[1] / 2, - text: piece.text, - verticalAlign: 'middle', - align: itemAlign, - font: textFont, - fill: textFill, - opacity: visualState === 'outOfRange' ? 0.5 : 1 - } - })); - } - thisGroup.add(itemGroup); - }, this); - endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign); - box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap')); - this.renderBackground(thisGroup); - this.positionGroup(thisGroup); - }; - PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) { - var _this = this; - itemGroup.on('mouseover', function () { - return onHoverLink('highlight'); - }).on('mouseout', function () { - return onHoverLink('downplay'); - }); - var onHoverLink = function (method) { - var visualMapModel = _this.visualMapModel; - // TODO: TYPE More detailed action types - visualMapModel.option.hoverLink && _this.api.dispatchAction({ - type: method, - batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel) - }); - }; - }; - PiecewiseVisualMapView.prototype._getItemAlign = function () { - var visualMapModel = this.visualMapModel; - var modelOption = visualMapModel.option; - if (modelOption.orient === 'vertical') { - return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize); - } else { - // horizontal, most case left unless specifying right. - var align = modelOption.align; - if (!align || align === 'auto') { - align = 'left'; - } - return align; - } - }; - PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) { - if (!text) { - return; - } - var itemGroup = new Group(); - var textStyleModel = this.visualMapModel.textStyleModel; - itemGroup.add(new ZRText({ - style: createTextStyle(textStyleModel, { - x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2, - y: itemSize[1] / 2, - verticalAlign: 'middle', - align: showLabel ? itemAlign : 'center', - text: text - }) - })); - group.add(itemGroup); - }; - /** - * @private - * @return {Object} {peiceList, endsText} The order is the same as screen pixel order. - */ - PiecewiseVisualMapView.prototype._getViewData = function () { - var visualMapModel = this.visualMapModel; - var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) { - return { - piece: piece, - indexInModelPieceList: index - }; - }); - var endsText = visualMapModel.get('text'); - // Consider orient and inverse. - var orient = visualMapModel.get('orient'); - var inverse = visualMapModel.get('inverse'); - // Order of model pieceList is always [low, ..., high] - if (orient === 'horizontal' ? inverse : !inverse) { - viewPieceList.reverse(); - } - // Origin order of endsText is [high, low] - else if (endsText) { - endsText = endsText.slice().reverse(); - } - return { - viewPieceList: viewPieceList, - endsText: endsText - }; - }; - PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) { - group.add(createSymbol( - // symbol will be string - this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], - // color will be string - this.getControllerVisual(representValue, 'color'))); - }; - PiecewiseVisualMapView.prototype._onItemClick = function (piece) { - var visualMapModel = this.visualMapModel; - var option = visualMapModel.option; - var selectedMode = option.selectedMode; - if (!selectedMode) { - return; - } - var selected = clone(option.selected); - var newKey = visualMapModel.getSelectedMapKey(piece); - if (selectedMode === 'single' || selectedMode === true) { - selected[newKey] = true; - each(selected, function (o, key) { - selected[key] = key === newKey; - }); + return defaultOption3; + } +}; +var Brush_default = BrushFeature; + +// src/component/brush/install.ts +function install38(registers) { + registers.registerComponentView(BrushView_default); + registers.registerComponentModel(BrushModel_default); + registers.registerPreprocessor(brushPreprocessor); + registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual); + registers.registerAction({type: "brush", event: "brush", update: "updateVisual"}, function(payload, ecModel) { + ecModel.eachComponent({mainType: "brush", query: payload}, function(brushModel) { + brushModel.setAreas(payload.areas); + }); + }); + registers.registerAction({type: "brushSelect", event: "brushSelected", update: "none"}, noop); + registers.registerAction({type: "brushEnd", event: "brushEnd", update: "none"}, noop); + registerFeature("brush", Brush_default); +} + +// src/component/title/install.ts +var TitleModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = TitleModel2.type; + this.layoutMode = {type: "box", ignoreSize: true}; + } +}; +var TitleModel = TitleModel2; +TitleModel.type = "title"; +TitleModel.defaultOption = { + z: 6, + show: true, + text: "", + target: "blank", + subtext: "", + subtarget: "blank", + left: 0, + top: 0, + backgroundColor: "rgba(0,0,0,0)", + borderColor: "#ccc", + borderWidth: 0, + padding: 5, + itemGap: 10, + textStyle: { + fontSize: 18, + fontWeight: "bold", + color: "#464646" + }, + subtextStyle: { + fontSize: 12, + color: "#6E7079" + } +}; +var TitleView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = TitleView2.type; + } + render(titleModel, ecModel, api2) { + this.group.removeAll(); + if (!titleModel.get("show")) { + return; + } + const group = this.group; + const textStyleModel = titleModel.getModel("textStyle"); + const subtextStyleModel = titleModel.getModel("subtextStyle"); + let textAlign = titleModel.get("textAlign"); + let textVerticalAlign = retrieve2(titleModel.get("textBaseline"), titleModel.get("textVerticalAlign")); + const textEl = new Text_default({ + style: createTextStyle(textStyleModel, { + text: titleModel.get("text"), + fill: textStyleModel.getTextColor() + }, {disableBox: true}), + z2: 10 + }); + const textRect = textEl.getBoundingRect(); + const subText = titleModel.get("subtext"); + const subTextEl = new Text_default({ + style: createTextStyle(subtextStyleModel, { + text: subText, + fill: subtextStyleModel.getTextColor(), + y: textRect.height + titleModel.get("itemGap"), + verticalAlign: "top" + }, {disableBox: true}), + z2: 10 + }); + const link = titleModel.get("link"); + const sublink = titleModel.get("sublink"); + const 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(sublink, "_" + titleModel.get("subtarget")); + }); + } + getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? { + componentType: "title", + componentIndex: titleModel.componentIndex + } : null; + group.add(textEl); + subText && group.add(subTextEl); + let groupRect = group.getBoundingRect(); + const layoutOption = titleModel.getBoxLayoutParams(); + layoutOption.width = groupRect.width; + layoutOption.height = groupRect.height; + const layoutRect = getLayoutRect(layoutOption, { + width: api2.getWidth(), + height: api2.getHeight() + }, titleModel.get("padding")); + if (!textAlign) { + textAlign = titleModel.get("left") || titleModel.get("right"); + if (textAlign === "middle") { + textAlign = "center"; + } + 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.x = layoutRect.x; + group.y = layoutRect.y; + group.markRedraw(); + const alignStyle = { + align: textAlign, + verticalAlign: textVerticalAlign + }; + textEl.setStyle(alignStyle); + subTextEl.setStyle(alignStyle); + groupRect = group.getBoundingRect(); + const padding = layoutRect.margin; + const style = titleModel.getItemStyle(["color", "opacity"]); + style.fill = titleModel.get("backgroundColor"); + const rect = new Rect_default({ + 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, + subPixelOptimize: true, + silent: true + }); + group.add(rect); + } +}; +var TitleView = TitleView2; +TitleView.type = "title"; +function install39(registers) { + registers.registerComponentModel(TitleModel); + registers.registerComponentView(TitleView); +} + +// src/component/timeline/TimelineModel.ts +var TimelineModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = TimelineModel2.type; + this.layoutMode = "box"; + } + init(option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + this._initData(); + } + mergeOption(option) { + super.mergeOption.apply(this, arguments); + this._initData(); + } + setCurrentIndex(currentIndex) { + if (currentIndex == null) { + currentIndex = this.option.currentIndex; + } + const count2 = this._data.count(); + if (this.option.loop) { + currentIndex = (currentIndex % count2 + count2) % count2; + } else { + currentIndex >= count2 && (currentIndex = count2 - 1); + currentIndex < 0 && (currentIndex = 0); + } + this.option.currentIndex = currentIndex; + } + getCurrentIndex() { + return this.option.currentIndex; + } + isIndexMax() { + return this.getCurrentIndex() >= this._data.count() - 1; + } + setPlayState(state) { + this.option.autoPlay = !!state; + } + getPlayState() { + return !!this.option.autoPlay; + } + _initData() { + const thisOption = this.option; + const dataArr = thisOption.data || []; + const axisType = thisOption.axisType; + const names = this._names = []; + let processedDataArr; + if (axisType === "category") { + processedDataArr = []; + each(dataArr, function(item, index) { + const value = convertOptionIdName(getDataItemValue(item), ""); + let newItem; + if (isObject(item)) { + newItem = clone(item); + newItem.value = index; } else { - selected[newKey] = !selected[newKey]; + newItem = index; } - this.api.dispatchAction({ - type: 'selectDataRange', - from: this.uid, - visualMapId: this.visualMapModel.id, - selected: selected - }); - }; - PiecewiseVisualMapView.type = 'visualMap.piecewise'; - return PiecewiseVisualMapView; - }(VisualMapView); - - function install$O(registers) { - registers.registerComponentModel(PiecewiseModel); - registers.registerComponentView(PiecewiseVisualMapView); - installCommon$1(registers); - } - - function install$P(registers) { - use(install$N); - use(install$O); - // Do not install './dataZoomSelect', - // since it only work for toolbox dataZoom. + processedDataArr.push(newItem); + names.push(value); + }); + } else { + processedDataArr = dataArr; + } + const dimType = { + category: "ordinal", + time: "time", + value: "number" + }[axisType] || "number"; + const data = this._data = new SeriesData_default([{ + name: "value", + type: dimType + }], this); + data.initData(processedDataArr, names); + } + getData() { + return this._data; + } + getCategories() { + if (this.get("axisType") === "category") { + return this._names.slice(); + } + } +}; +var TimelineModel = TimelineModel2; +TimelineModel.type = "timeline"; +TimelineModel.defaultOption = { + z: 4, + show: true, + axisType: "time", + realtime: true, + left: "20%", + top: null, + right: "20%", + bottom: 0, + width: null, + height: 40, + padding: 5, + controlPosition: "left", + autoPlay: false, + rewind: false, + loop: true, + playInterval: 2e3, + currentIndex: 0, + itemStyle: {}, + label: { + color: "#000" + }, + data: [] +}; +var TimelineModel_default = TimelineModel; + +// src/component/timeline/SliderTimelineModel.ts +var SliderTimelineModel2 = class extends TimelineModel_default { + constructor() { + super(...arguments); + this.type = SliderTimelineModel2.type; + } +}; +var SliderTimelineModel = SliderTimelineModel2; +SliderTimelineModel.type = "timeline.slider"; +SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel_default.defaultOption, { + backgroundColor: "rgba(0,0,0,0)", + borderColor: "#ccc", + borderWidth: 0, + orient: "horizontal", + inverse: false, + tooltip: { + trigger: "item" + }, + symbol: "circle", + symbolSize: 12, + lineStyle: { + show: true, + width: 2, + color: "#DAE1F5" + }, + label: { + position: "auto", + show: true, + interval: "auto", + rotate: 0, + color: "#A4B1D7" + }, + itemStyle: { + color: "#A4B1D7", + borderWidth: 1 + }, + checkpointStyle: { + symbol: "circle", + symbolSize: 15, + color: "#316bf3", + borderColor: "#fff", + borderWidth: 2, + shadowBlur: 2, + shadowOffsetX: 1, + shadowOffsetY: 1, + shadowColor: "rgba(0, 0, 0, 0.3)", + animation: true, + animationDuration: 300, + animationEasing: "quinticInOut" + }, + controlStyle: { + show: true, + showPlayBtn: true, + showPrevBtn: true, + showNextBtn: true, + itemSize: 24, + itemGap: 12, + position: "left", + playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z", + stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z", + nextIcon: "M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z", + prevIcon: "M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z", + prevBtnSize: 18, + nextBtnSize: 18, + color: "#A4B1D7", + borderColor: "#A4B1D7", + borderWidth: 1 + }, + emphasis: { + label: { + show: true, + color: "#6f778d" + }, + itemStyle: { + color: "#316BF3" + }, + controlStyle: { + color: "#316BF3", + borderColor: "#316BF3", + borderWidth: 2 + } + }, + progress: { + lineStyle: { + color: "#316BF3" + }, + itemStyle: { + color: "#316BF3" + }, + label: { + color: "#6f778d" + } + }, + data: [] +}); +mixin(SliderTimelineModel, DataFormatMixin.prototype); +var SliderTimelineModel_default = SliderTimelineModel; + +// src/component/timeline/TimelineView.ts +var TimelineView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = TimelineView2.type; + } +}; +var TimelineView = TimelineView2; +TimelineView.type = "timeline"; +var TimelineView_default = TimelineView; + +// src/component/timeline/TimelineAxis.ts +var TimelineAxis = class extends Axis_default { + constructor(dim, scale4, coordExtent, axisType) { + super(dim, scale4, coordExtent); + this.type = axisType || "value"; + } + getLabelModel() { + return this.model.getModel("label"); + } + isHorizontal() { + return this.model.get("orient") === "horizontal"; + } +}; +var TimelineAxis_default = TimelineAxis; + +// src/component/timeline/SliderTimelineView.ts +var PI10 = Math.PI; +var labelDataIndexStore = makeInner(); +var SliderTimelineView2 = class extends TimelineView_default { + constructor() { + super(...arguments); + this.type = SliderTimelineView2.type; + } + init(ecModel, api2) { + this.api = api2; + } + render(timelineModel, ecModel, api2) { + this.model = timelineModel; + this.api = api2; + this.ecModel = ecModel; + this.group.removeAll(); + if (timelineModel.get("show", true)) { + const layoutInfo = this._layout(timelineModel, api2); + const mainGroup = this._createGroup("_mainGroup"); + const labelGroup = this._createGroup("_labelGroup"); + const axis = this._axis = this._createAxis(layoutInfo, timelineModel); + timelineModel.formatTooltip = function(dataIndex) { + const name = axis.scale.getLabel({value: dataIndex}); + return createTooltipMarkup("nameValue", {noName: true, value: name}); + }; + 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(); + this._updateTicksStatus(); + } + remove() { + this._clearTimer(); + this.group.removeAll(); + } + dispose() { + this._clearTimer(); + } + _layout(timelineModel, api2) { + const labelPosOpt = timelineModel.get(["label", "position"]); + const orient = timelineModel.get("orient"); + const viewRect2 = getViewRect6(timelineModel, api2); + let parsedLabelPos; + if (labelPosOpt == null || labelPosOpt === "auto") { + parsedLabelPos = orient === "horizontal" ? viewRect2.y + viewRect2.height / 2 < api2.getHeight() / 2 ? "-" : "+" : viewRect2.x + viewRect2.width / 2 < api2.getWidth() / 2 ? "+" : "-"; + } else if (isString(labelPosOpt)) { + parsedLabelPos = { + horizontal: {top: "-", bottom: "+"}, + vertical: {left: "-", right: "+"} + }[orient][labelPosOpt]; + } else { + parsedLabelPos = labelPosOpt; + } + const labelAlignMap = { + horizontal: "center", + vertical: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "left" : "right" + }; + const labelBaselineMap = { + horizontal: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "top" : "bottom", + vertical: "middle" + }; + const rotationMap = { + horizontal: 0, + vertical: PI10 / 2 + }; + const mainLength = orient === "vertical" ? viewRect2.height : viewRect2.width; + const controlModel = timelineModel.getModel("controlStyle"); + const showControl = controlModel.get("show", true); + const controlSize = showControl ? controlModel.get("itemSize") : 0; + const controlGap = showControl ? controlModel.get("itemGap") : 0; + const sizePlusGap = controlSize + controlGap; + let labelRotation = timelineModel.get(["label", "rotate"]) || 0; + labelRotation = labelRotation * PI10 / 180; + let playPosition; + let prevBtnPosition; + let nextBtnPosition; + const controlPosition = controlModel.get("position", true); + const showPlayBtn = showControl && controlModel.get("showPlayBtn", true); + const showPrevBtn = showControl && controlModel.get("showPrevBtn", true); + const showNextBtn = showControl && controlModel.get("showNextBtn", true); + let xLeft = 0; + let xRight = mainLength; + 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 { + showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); + showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap); + showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); + } + const axisExtent = [xLeft, xRight]; + if (timelineModel.get("inverse")) { + axisExtent.reverse(); + } + return { + viewRect: viewRect2, + mainLength, + orient, + rotation: rotationMap[orient], + labelRotation, + labelPosOpt: parsedLabelPos, + labelAlign: timelineModel.get(["label", "align"]) || labelAlignMap[orient], + labelBaseline: timelineModel.get(["label", "verticalAlign"]) || timelineModel.get(["label", "baseline"]) || labelBaselineMap[orient], + playPosition, + prevBtnPosition, + nextBtnPosition, + axisExtent, + controlSize, + controlGap + }; + } + _position(layoutInfo, timelineModel) { + const mainGroup = this._mainGroup; + const labelGroup = this._labelGroup; + let viewRect2 = layoutInfo.viewRect; + if (layoutInfo.orient === "vertical") { + const m2 = create2(); + const rotateOriginX = viewRect2.x; + const rotateOriginY = viewRect2.y + viewRect2.height; + translate(m2, m2, [-rotateOriginX, -rotateOriginY]); + rotate(m2, m2, -PI10 / 2); + translate(m2, m2, [rotateOriginX, rotateOriginY]); + viewRect2 = viewRect2.clone(); + viewRect2.applyTransform(m2); + } + const viewBound = getBound(viewRect2); + const mainBound = getBound(mainGroup.getBoundingRect()); + const labelBound = getBound(labelGroup.getBoundingRect()); + const mainPosition = [mainGroup.x, mainGroup.y]; + const labelsPosition = [labelGroup.x, labelGroup.y]; + labelsPosition[0] = mainPosition[0] = viewBound[0][0]; + const labelPosOpt = layoutInfo.labelPosOpt; + if (labelPosOpt == null || isString(labelPosOpt)) { + const mainBoundIdx = labelPosOpt === "+" ? 0 : 1; + toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); + toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx); + } else { + const mainBoundIdx = labelPosOpt >= 0 ? 0 : 1; + toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); + labelsPosition[1] = mainPosition[1] + labelPosOpt; + } + mainGroup.setPosition(mainPosition); + labelGroup.setPosition(labelsPosition); + mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; + setOrigin(mainGroup); + setOrigin(labelGroup); + function setOrigin(targetGroup) { + targetGroup.originX = viewBound[0][0] - targetGroup.x; + targetGroup.originY = viewBound[1][0] - targetGroup.y; + } + function getBound(rect) { + return [ + [rect.x, rect.x + rect.width], + [rect.y, rect.y + rect.height] + ]; } - - var DEFAULT_OPTION = { - label: { - enabled: true + function toBound(fromPos, from, to, dimIdx, boundIdx) { + fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx]; + } + } + _createAxis(layoutInfo, timelineModel) { + const data = timelineModel.getData(); + const axisType = timelineModel.get("axisType"); + const scale4 = createScaleByModel2(timelineModel, axisType); + scale4.getTicks = function() { + return data.mapArray(["value"], function(value) { + return {value}; + }); + }; + const dataExtent = data.getDataExtent("value"); + scale4.setExtent(dataExtent[0], dataExtent[1]); + scale4.calcNiceTicks(); + const axis = new TimelineAxis_default("value", scale4, layoutInfo.axisExtent, axisType); + axis.model = timelineModel; + return axis; + } + _createGroup(key) { + const newGroup = this[key] = new Group_default(); + this.group.add(newGroup); + return newGroup; + } + _renderAxisLine(layoutInfo, group, axis, timelineModel) { + const axisExtent = axis.getExtent(); + if (!timelineModel.get(["lineStyle", "show"])) { + return; + } + const line2 = new Line_default({ + shape: { + x1: axisExtent[0], + y1: 0, + x2: axisExtent[1], + y2: 0 + }, + style: extend({lineCap: "round"}, timelineModel.getModel("lineStyle").getLineStyle()), + silent: true, + z2: 1 + }); + group.add(line2); + const progressLine = this._progressLine = new Line_default({ + shape: { + x1: axisExtent[0], + x2: this._currentPointer ? this._currentPointer.x : axisExtent[0], + y1: 0, + y2: 0 }, - decal: { - show: false + style: defaults({lineCap: "round", lineWidth: line2.style.lineWidth}, timelineModel.getModel(["progress", "lineStyle"]).getLineStyle()), + silent: true, + z2: 1 + }); + group.add(progressLine); + } + _renderAxisTick(layoutInfo, group, axis, timelineModel) { + const data = timelineModel.getData(); + const ticks = axis.scale.getTicks(); + this._tickSymbols = []; + each(ticks, (tick) => { + const tickCoord = axis.dataToCoord(tick.value); + const itemModel = data.getItemModel(tick.value); + const itemStyleModel = itemModel.getModel("itemStyle"); + const hoverStyleModel = itemModel.getModel(["emphasis", "itemStyle"]); + const progressStyleModel = itemModel.getModel(["progress", "itemStyle"]); + const symbolOpt = { + x: tickCoord, + y: 0, + onclick: bind(this._changeTimeline, this, tick.value) + }; + const el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); + el.ensureState("emphasis").style = hoverStyleModel.getItemStyle(); + el.ensureState("progress").style = progressStyleModel.getItemStyle(); + enableHoverEmphasis(el); + const ecData = getECData(el); + if (itemModel.get("tooltip")) { + ecData.dataIndex = tick.value; + ecData.dataModel = timelineModel; + } else { + ecData.dataIndex = ecData.dataModel = null; } - }; - var inner$l = makeInner(); - var decalPaletteScope = {}; - function ariaVisual(ecModel, api) { - var ariaModel = ecModel.getModel('aria'); - // See "area enabled" detection code in `GlobalModel.ts`. - if (!ariaModel.get('enabled')) { + this._tickSymbols.push(el); + }); + } + _renderAxisLabel(layoutInfo, group, axis, timelineModel) { + const labelModel = axis.getLabelModel(); + if (!labelModel.get("show")) { + return; + } + const data = timelineModel.getData(); + const labels = axis.getViewLabels(); + this._tickLabels = []; + each(labels, (labelItem) => { + const dataIndex = labelItem.tickValue; + const itemModel = data.getItemModel(dataIndex); + const normalLabelModel = itemModel.getModel("label"); + const hoverLabelModel = itemModel.getModel(["emphasis", "label"]); + const progressLabelModel = itemModel.getModel(["progress", "label"]); + const tickCoord = axis.dataToCoord(labelItem.tickValue); + const textEl = new Text_default({ + x: tickCoord, + y: 0, + rotation: layoutInfo.labelRotation - layoutInfo.rotation, + onclick: bind(this._changeTimeline, this, dataIndex), + silent: false, + style: createTextStyle(normalLabelModel, { + text: labelItem.formattedLabel, + align: layoutInfo.labelAlign, + verticalAlign: layoutInfo.labelBaseline + }) + }); + textEl.ensureState("emphasis").style = createTextStyle(hoverLabelModel); + textEl.ensureState("progress").style = createTextStyle(progressLabelModel); + group.add(textEl); + enableHoverEmphasis(textEl); + labelDataIndexStore(textEl).dataIndex = dataIndex; + this._tickLabels.push(textEl); + }); + } + _renderControl(layoutInfo, group, axis, timelineModel) { + const controlSize = layoutInfo.controlSize; + const rotation = layoutInfo.rotation; + const itemStyle = timelineModel.getModel("controlStyle").getItemStyle(); + const hoverStyle = timelineModel.getModel(["emphasis", "controlStyle"]).getItemStyle(); + const playState = timelineModel.getPlayState(); + const inverse = timelineModel.get("inverse", true); + makeBtn(layoutInfo.nextBtnPosition, "next", bind(this._changeTimeline, this, inverse ? "-" : "+")); + makeBtn(layoutInfo.prevBtnPosition, "prev", bind(this._changeTimeline, this, inverse ? "+" : "-")); + makeBtn(layoutInfo.playPosition, playState ? "stop" : "play", bind(this._handlePlayClick, this, !playState), true); + function makeBtn(position2, iconName, onclick, willRotate) { + if (!position2) { return; } - var defaultOption = clone(DEFAULT_OPTION); - merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false); - merge(ariaModel.option, defaultOption, false); - setDecal(); - setLabel(); - function setDecal() { - var decalModel = ariaModel.getModel('decal'); - var useDecal = decalModel.get('show'); - if (useDecal) { - // Each type of series use one scope. - // Pie and funnel are using different scopes. - var paletteScopeGroupByType_1 = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.isColorBySeries()) { - return; - } - var decalScope = paletteScopeGroupByType_1.get(seriesModel.type); - if (!decalScope) { - decalScope = {}; - paletteScopeGroupByType_1.set(seriesModel.type, decalScope); - } - inner$l(seriesModel).scope = decalScope; - }); - ecModel.eachRawSeries(function (seriesModel) { - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } - if (isFunction(seriesModel.enableAriaDecal)) { - // Let series define how to use decal palette on data - seriesModel.enableAriaDecal(); - return; - } - var data = seriesModel.getData(); - if (!seriesModel.isColorBySeries()) { - var dataAll_1 = seriesModel.getRawData(); - var idxMap_1 = {}; - var decalScope_1 = inner$l(seriesModel).scope; - data.each(function (idx) { - var rawIdx = data.getRawIndex(idx); - idxMap_1[rawIdx] = idx; - }); - var dataCount_1 = dataAll_1.count(); - dataAll_1.each(function (rawIdx) { - var idx = idxMap_1[rawIdx]; - var name = dataAll_1.getName(rawIdx) || rawIdx + ''; - var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1); - var specifiedDecal = data.getItemVisual(idx, 'decal'); - data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal)); - }); - } else { - var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount()); - var specifiedDecal = data.getVisual('decal'); - data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal)); - } - function mergeDecal(specifiedDecal, paletteDecal) { - // Merge decal from palette to decal from itemStyle. - // User do not need to specify all of the decal props. - var resultDecal = specifiedDecal ? extend(extend({}, paletteDecal), specifiedDecal) : paletteDecal; - resultDecal.dirty = true; - return resultDecal; - } - }); - } + const iconSize = parsePercent(retrieve2(timelineModel.get(["controlStyle", iconName + "BtnSize"]), controlSize), controlSize); + const rect = [0, -iconSize / 2, iconSize, iconSize]; + const btn = makeControlIcon(timelineModel, iconName + "Icon", rect, { + x: position2[0], + y: position2[1], + originX: controlSize / 2, + originY: 0, + rotation: willRotate ? -rotation : 0, + rectHover: true, + style: itemStyle, + onclick + }); + btn.ensureState("emphasis").style = hoverStyle; + group.add(btn); + enableHoverEmphasis(btn); + } + } + _renderCurrentPointer(layoutInfo, group, axis, timelineModel) { + const data = timelineModel.getData(); + const currentIndex = timelineModel.getCurrentIndex(); + const pointerModel = data.getItemModel(currentIndex).getModel("checkpointStyle"); + const me = this; + const callback = { + onCreate(pointer) { + pointer.draggable = true; + pointer.drift = bind(me._handlePointerDrag, me); + pointer.ondragend = bind(me._handlePointerDragend, me); + pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true); + }, + onUpdate(pointer) { + pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel); } - function setLabel() { - var dom = api.getZr().dom; - // TODO: support for SSR - if (!dom) { - return; - } - var labelLocale = ecModel.getLocaleModel().get('aria'); - var labelModel = ariaModel.getModel('label'); - labelModel.option = defaults(labelModel.option, labelLocale); - if (!labelModel.get('enabled')) { - return; - } - if (labelModel.get('description')) { - dom.setAttribute('aria-label', labelModel.get('description')); + }; + this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback); + } + _handlePlayClick(nextState) { + this._clearTimer(); + this.api.dispatchAction({ + type: "timelinePlayChange", + playState: nextState, + from: this.uid + }); + } + _handlePointerDrag(dx, dy, e2) { + this._clearTimer(); + this._pointerChangeTimeline([e2.offsetX, e2.offsetY]); + } + _handlePointerDragend(e2) { + this._pointerChangeTimeline([e2.offsetX, e2.offsetY], true); + } + _pointerChangeTimeline(mousePos, trigger3) { + let toCoord = this._toAxisCoord(mousePos)[0]; + const axis = this._axis; + const axisExtent = asc(axis.getExtent().slice()); + toCoord > axisExtent[1] && (toCoord = axisExtent[1]); + toCoord < axisExtent[0] && (toCoord = axisExtent[0]); + this._currentPointer.x = toCoord; + this._currentPointer.markRedraw(); + const progressLine = this._progressLine; + if (progressLine) { + progressLine.shape.x2 = toCoord; + progressLine.dirty(); + } + const targetDataIndex = this._findNearestTick(toCoord); + const timelineModel = this.model; + if (trigger3 || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get("realtime")) { + this._changeTimeline(targetDataIndex); + } + } + _doPlayStop() { + this._clearTimer(); + if (this.model.getPlayState()) { + this._timer = setTimeout(() => { + const timelineModel = this.model; + this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get("rewind", true) ? -1 : 1)); + }, this.model.get("playInterval")); + } + } + _toAxisCoord(vertex) { + const trans = this._mainGroup.getLocalTransform(); + return applyTransform2(vertex, trans, true); + } + _findNearestTick(axisCoord) { + const data = this.model.getData(); + let dist3 = Infinity; + let targetDataIndex; + const axis = this._axis; + data.each(["value"], function(value, dataIndex) { + const coord = axis.dataToCoord(value); + const d = Math.abs(coord - axisCoord); + if (d < dist3) { + dist3 = d; + targetDataIndex = dataIndex; + } + }); + return targetDataIndex; + } + _clearTimer() { + if (this._timer) { + clearTimeout(this._timer); + this._timer = null; + } + } + _changeTimeline(nextIndex) { + const 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 + }); + } + _updateTicksStatus() { + const currentIndex = this.model.getCurrentIndex(); + const tickSymbols = this._tickSymbols; + const tickLabels = this._tickLabels; + if (tickSymbols) { + for (let i = 0; i < tickSymbols.length; i++) { + tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState("progress", i < currentIndex); + } + } + if (tickLabels) { + for (let i = 0; i < tickLabels.length; i++) { + tickLabels && tickLabels[i] && tickLabels[i].toggleState("progress", labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex); + } + } + } +}; +var SliderTimelineView = SliderTimelineView2; +SliderTimelineView.type = "timeline.slider"; +function createScaleByModel2(model, axisType) { + axisType = axisType || model.get("type"); + if (axisType) { + switch (axisType) { + case "category": + return new Ordinal_default({ + ordinalMeta: model.getCategories(), + extent: [Infinity, -Infinity] + }); + case "time": + return new Time_default({ + locale: model.ecModel.getLocaleModel(), + useUTC: model.ecModel.get("useUTC") + }); + default: + return new Interval_default(); + } + } +} +function getViewRect6(model, api2) { + return getLayoutRect(model.getBoxLayoutParams(), { + width: api2.getWidth(), + height: api2.getHeight() + }, model.get("padding")); +} +function makeControlIcon(timelineModel, objPath, rect, opts) { + const style = opts.style; + const icon = createIcon(timelineModel.get(["controlStyle", objPath]), opts || {}, new BoundingRect_default(rect[0], rect[1], rect[2], rect[3])); + if (style) { + icon.setStyle(style); + } + return icon; +} +function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) { + const color2 = itemStyleModel.get("color"); + if (!symbol) { + const symbolType = hostModel.get("symbol"); + symbol = createSymbol(symbolType, -1, -1, 2, 2, color2); + symbol.setStyle("strokeNoScale", true); + group.add(symbol); + callback && callback.onCreate(symbol); + } else { + symbol.setColor(color2); + group.add(symbol); + callback && callback.onUpdate(symbol); + } + const itemStyle = itemStyleModel.getItemStyle(["color"]); + symbol.setStyle(itemStyle); + opt = merge({ + rectHover: true, + z2: 100 + }, opt, true); + const symbolSize = normalizeSymbolSize(hostModel.get("symbolSize")); + opt.scaleX = symbolSize[0] / 2; + opt.scaleY = symbolSize[1] / 2; + const symbolOffset = normalizeSymbolOffset(hostModel.get("symbolOffset"), symbolSize); + if (symbolOffset) { + opt.x = (opt.x || 0) + symbolOffset[0]; + opt.y = (opt.y || 0) + symbolOffset[1]; + } + const symbolRotate = hostModel.get("symbolRotate"); + opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + symbol.attr(opt); + symbol.updateTransform(); + return symbol; +} +function pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) { + if (pointer.dragging) { + return; + } + const pointerModel = timelineModel.getModel("checkpointStyle"); + const toCoord = axis.dataToCoord(timelineModel.getData().get("value", dataIndex)); + if (noAnimation || !pointerModel.get("animation", true)) { + pointer.attr({ + x: toCoord, + y: 0 + }); + progressLine && progressLine.attr({ + shape: {x2: toCoord} + }); + } else { + const animationCfg = { + duration: pointerModel.get("animationDuration", true), + easing: pointerModel.get("animationEasing", true) + }; + pointer.stopAnimation(null, true); + pointer.animateTo({ + x: toCoord, + y: 0 + }, animationCfg); + progressLine && progressLine.animateTo({ + shape: {x2: toCoord} + }, animationCfg); + } +} +var SliderTimelineView_default = SliderTimelineView; + +// src/component/timeline/timelineAction.ts +function installTimelineAction(registers) { + registers.registerAction({type: "timelineChange", event: "timelineChanged", update: "prepareAndUpdate"}, function(payload, ecModel, api2) { + const timelineModel = ecModel.getComponent("timeline"); + if (timelineModel && payload.currentIndex != null) { + timelineModel.setCurrentIndex(payload.currentIndex); + if (!timelineModel.get("loop", true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) { + timelineModel.setPlayState(false); + api2.dispatchAction({ + type: "timelinePlayChange", + playState: false, + from: payload.from + }); + } + } + ecModel.resetOption("timeline", {replaceMerge: timelineModel.get("replaceMerge", true)}); + return defaults({ + currentIndex: timelineModel.option.currentIndex + }, payload); + }); + registers.registerAction({type: "timelinePlayChange", event: "timelinePlayChanged", update: "update"}, function(payload, ecModel) { + const timelineModel = ecModel.getComponent("timeline"); + if (timelineModel && payload.playState != null) { + timelineModel.setPlayState(payload.playState); + } + }); +} + +// src/component/timeline/preprocessor.ts +function timelinePreprocessor(option) { + let timelineOpt = option && option.timeline; + if (!isArray(timelineOpt)) { + timelineOpt = timelineOpt ? [timelineOpt] : []; + } + each(timelineOpt, function(opt) { + if (!opt) { + return; + } + compatibleEC2(opt); + }); +} +function compatibleEC2(opt) { + const type = opt.type; + const ec2Types = {number: "value", time: "time"}; + if (ec2Types[type]) { + opt.axisType = ec2Types[type]; + delete opt.type; + } + transferItem(opt); + if (has(opt, "controlPosition")) { + const controlStyle = opt.controlStyle || (opt.controlStyle = {}); + if (!has(controlStyle, "position")) { + controlStyle.position = opt.controlPosition; + } + if (controlStyle.position === "none" && !has(controlStyle, "show")) { + controlStyle.show = false; + delete controlStyle.position; + } + delete opt.controlPosition; + } + each(opt.data || [], function(dataItem) { + if (isObject(dataItem) && !isArray(dataItem)) { + if (!has(dataItem, "value") && has(dataItem, "name")) { + dataItem.value = dataItem.name; + } + transferItem(dataItem); + } + }); +} +function transferItem(opt) { + const itemStyle = opt.itemStyle || (opt.itemStyle = {}); + const itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); + const label = opt.label || (opt.label || {}); + const labelNormal = label.normal || (label.normal = {}); + const excludeLabelAttr = {normal: 1, emphasis: 1}; + each(label, function(value, name) { + if (!excludeLabelAttr[name] && !has(labelNormal, name)) { + labelNormal[name] = value; + } + }); + if (itemStyleEmphasis.label && !has(label, "emphasis")) { + label.emphasis = itemStyleEmphasis.label; + delete itemStyleEmphasis.label; + } +} +function has(obj, attr) { + return obj.hasOwnProperty(attr); +} + +// src/component/timeline/install.ts +function install40(registers) { + registers.registerComponentModel(SliderTimelineModel_default); + registers.registerComponentView(SliderTimelineView_default); + registers.registerSubTypeDefaulter("timeline", function() { + return "slider"; + }); + installTimelineAction(registers); + registers.registerPreprocessor(timelinePreprocessor); +} + +// src/component/marker/checkMarkerInSeries.ts +function checkMarkerInSeries(seriesOpts, markerType) { + if (!seriesOpts) { + return false; + } + const seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts]; + for (let idx = 0; idx < seriesOptArr.length; idx++) { + if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) { + return true; + } + } + return false; +} + +// src/component/marker/MarkerModel.ts +function fillLabel(opt) { + defaultEmphasis(opt, "label", ["show"]); +} +var inner17 = makeInner(); +var MarkerModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = MarkerModel2.type; + this.createdBySelf = false; + } + init(option, parentModel, ecModel) { + if (true) { + if (this.type === "marker") { + throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead."); + } + } + this.mergeDefaultAndTheme(option, ecModel); + this._mergeOption(option, ecModel, false, true); + } + isAnimationEnabled() { + if (env_default.node) { + return false; + } + const hostSeries = this.__hostSeries; + return this.getShallow("animation") && hostSeries && hostSeries.isAnimationEnabled(); + } + mergeOption(newOpt, ecModel) { + this._mergeOption(newOpt, ecModel, false, false); + } + _mergeOption(newOpt, ecModel, createdBySelf, isInit) { + const componentType = this.mainType; + if (!createdBySelf) { + ecModel.eachSeries(function(seriesModel) { + const markerOpt = seriesModel.get(this.mainType, true); + let markerModel = inner17(seriesModel)[componentType]; + if (!markerOpt || !markerOpt.data) { + inner17(seriesModel)[componentType] = null; return; } - var seriesCnt = ecModel.getSeriesCount(); - var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10; - var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10; - var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt); - var ariaLabel; - if (seriesCnt < 1) { - // No series, no aria label - return; - } else { - var title = getTitle(); - if (title) { - var withTitle = labelModel.get(['general', 'withTitle']); - ariaLabel = replace(withTitle, { - title: title - }); - } else { - ariaLabel = labelModel.get(['general', 'withoutTitle']); + if (!markerModel) { + if (isInit) { + fillLabel(markerOpt); } - var seriesLabels_1 = []; - var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']); - ariaLabel += replace(prefix, { - seriesCount: seriesCnt - }); - ecModel.eachSeries(function (seriesModel, idx) { - if (idx < displaySeriesCnt) { - var seriesLabel = void 0; - var seriesName = seriesModel.get('name'); - var withName = seriesName ? 'withName' : 'withoutName'; - seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]); - seriesLabel = replace(seriesLabel, { - seriesId: seriesModel.seriesIndex, - seriesName: seriesModel.get('name'), - seriesType: getSeriesTypeName(seriesModel.subType) - }); - var data = seriesModel.getData(); - if (data.count() > maxDataCnt) { - // Show part of data - var partialLabel = labelModel.get(['data', 'partialData']); - seriesLabel += replace(partialLabel, { - displayCnt: maxDataCnt - }); - } else { - seriesLabel += labelModel.get(['data', 'allData']); - } - var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']); - var endSeparator_1 = labelModel.get(['data', 'separator', 'end']); - var dataLabels = []; - for (var i = 0; i < data.count(); i++) { - if (i < maxDataCnt) { - var name_1 = data.getName(i); - var value = data.getValues(i); - var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']); - dataLabels.push(replace(dataLabel, { - name: name_1, - value: value.join(middleSeparator_1) - })); - } - } - seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1; - seriesLabels_1.push(seriesLabel); + each(markerOpt.data, function(item) { + if (item instanceof Array) { + fillLabel(item[0]); + fillLabel(item[1]); + } else { + fillLabel(item); } }); - var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']); - var middleSeparator = separatorModel.get('middle'); - var endSeparator = separatorModel.get('end'); - ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator; - dom.setAttribute('aria-label', ariaLabel); - } - } - function replace(str, keyValues) { - if (!isString(str)) { - return str; - } - var result = str; - each(keyValues, function (value, key) { - result = result.replace(new RegExp('\\{\\s*' + key + '\\s*\\}', 'g'), value); - }); - return result; - } - function getTitle() { - var title = ecModel.get('title'); - if (title && title.length) { - title = title[0]; + markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel); + extend(markerModel, { + mainType: this.mainType, + seriesIndex: seriesModel.seriesIndex, + name: seriesModel.name, + createdBySelf: true + }); + markerModel.__hostSeries = seriesModel; + } else { + markerModel._mergeOption(markerOpt, ecModel, true); } - return title && title.text; - } - function getSeriesTypeName(type) { - var typeNames = ecModel.getLocaleModel().get(['series', 'typeNames']); - return typeNames[type] || typeNames.chart; - } + inner17(seriesModel)[componentType] = markerModel; + }, this); } - - function ariaPreprocessor(option) { - if (!option || !option.aria) { - return; - } - var aria = option.aria; - // aria.show is deprecated and should use aria.enabled instead - if (aria.show != null) { - aria.enabled = aria.show; - } - aria.label = aria.label || {}; - // move description, general, series, data to be under aria.label - each(['description', 'general', 'series', 'data'], function (name) { - if (aria[name] != null) { - aria.label[name] = aria[name]; - } - }); + } + formatTooltip(dataIndex, multipleSeries, dataType) { + const data = this.getData(); + const value = this.getRawValue(dataIndex); + const itemName = data.getName(dataIndex); + return createTooltipMarkup("section", { + header: this.name, + blocks: [createTooltipMarkup("nameValue", { + name: itemName, + value, + noName: !itemName, + noValue: value == null + })] + }); + } + getData() { + return this._data; + } + setData(data) { + this._data = data; + } + getDataParams(dataIndex, dataType) { + const params = DataFormatMixin.prototype.getDataParams.call(this, dataIndex, dataType); + const hostSeries = this.__hostSeries; + if (hostSeries) { + params.seriesId = hostSeries.id; + params.seriesName = hostSeries.name; + params.seriesType = hostSeries.subType; + } + return params; + } + static getMarkerModelFromSeries(seriesModel, componentType) { + return inner17(seriesModel)[componentType]; + } +}; +var MarkerModel = MarkerModel2; +MarkerModel.type = "marker"; +MarkerModel.dependencies = ["series", "grid", "polar", "geo"]; +mixin(MarkerModel, DataFormatMixin.prototype); +var MarkerModel_default = MarkerModel; + +// src/component/marker/MarkPointModel.ts +var MarkPointModel2 = class extends MarkerModel_default { + constructor() { + super(...arguments); + this.type = MarkPointModel2.type; + } + createMarkerModelFromSeries(markerOpt, masterMarkerModel, ecModel) { + return new MarkPointModel2(markerOpt, masterMarkerModel, ecModel); + } +}; +var MarkPointModel = MarkPointModel2; +MarkPointModel.type = "markPoint"; +MarkPointModel.defaultOption = { + z: 5, + symbol: "pin", + symbolSize: 50, + tooltip: { + trigger: "item" + }, + label: { + show: true, + position: "inside" + }, + itemStyle: { + borderWidth: 2 + }, + emphasis: { + label: { + show: true + } + } +}; +var MarkPointModel_default = MarkPointModel; + +// src/component/marker/markerHelper.ts +function hasXOrY(item) { + return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); +} +function hasXAndY(item) { + return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); +} +function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) { + const coordArr = []; + const stacked = isDimensionStacked(data, targetDataDim); + const calcDataDim = stacked ? data.getCalculationInfo("stackResultDimension") : targetDataDim; + const value = numCalculate(data, calcDataDim, markerType); + const dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; + coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); + coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex); + const coordArrValue = data.get(targetDataDim, dataIndex); + let precision = getPrecision(data.get(targetDataDim, dataIndex)); + precision = Math.min(precision, 20); + if (precision >= 0) { + coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); + } + return [coordArr, coordArrValue]; +} +var markerTypeCalculator = { + min: curry(markerTypeCalculatorWithExtent, "min"), + max: curry(markerTypeCalculatorWithExtent, "max"), + average: curry(markerTypeCalculatorWithExtent, "average"), + median: curry(markerTypeCalculatorWithExtent, "median") +}; +function dataTransform(seriesModel, item) { + if (!item) { + return; + } + const data = seriesModel.getData(); + const coordSys = seriesModel.coordinateSystem; + const dims = coordSys && coordSys.dimensions; + if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) { + const axisInfo = getAxisInfo2(item, data, coordSys, seriesModel); + item = clone(item); + if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) { + const otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim); + const targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim); + const coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex); + item.coord = coordInfo[0]; + item.value = coordInfo[1]; + } else { + item.coord = [ + item.xAxis != null ? item.xAxis : item.radiusAxis, + item.yAxis != null ? item.yAxis : item.angleAxis + ]; } - - function install$Q(registers) { - registers.registerPreprocessor(ariaPreprocessor); - registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual); - } - - var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = { - value: 'eq', - // PENDING: not good for literal semantic? - '<': 'lt', - '<=': 'lte', - '>': 'gt', - '>=': 'gte', - '=': 'eq', - '!=': 'ne', - '<>': 'ne' - // Might be misleading for sake of the difference between '==' and '===', - // so don't support them. - // '==': 'eq', - // '===': 'seq', - // '!==': 'sne' - // PENDING: Whether support some common alias "ge", "le", "neq"? - // ge: 'gte', - // le: 'lte', - // neq: 'ne', - }; - // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean; - var RegExpEvaluator = /** @class */function () { - function RegExpEvaluator(rVal) { - // Support condVal: RegExp | string - var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null; - if (condValue == null) { - var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('Illegal regexp', rVal, 'in'); - } - throwError(errMsg); - } + } + if (item.coord == null || !isArray(dims)) { + item.coord = []; + } else { + const coord = item.coord; + for (let i = 0; i < 2; i++) { + if (markerTypeCalculator[coord[i]]) { + coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); + } + } + } + return item; +} +function getAxisInfo2(item, data, coordSys, seriesModel) { + const ret = {}; + if (item.valueIndex != null || item.valueDim != null) { + ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim; + ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim)); + ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + } else { + ret.baseAxis = seriesModel.getBaseAxis(); + ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); + } + return ret; +} +function dataDimToCoordDim(seriesModel, dataDim) { + const dimItem = seriesModel.getData().getDimensionInfo(dataDim); + return dimItem && dimItem.coordDim; +} +function dataFilter2(coordSys, item) { + return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true; +} +function zoneFilter(coordSys, item1, item2) { + return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true; +} +function createMarkerDimValueGetter(inCoordSys, dims) { + return inCoordSys ? function(item, dimName, dataIndex, dimIndex) { + const rawVal = dimIndex < 2 ? item.coord && item.coord[dimIndex] : item.value; + return parseDataValue(rawVal, dims[dimIndex]); + } : function(item, dimName, dataIndex, dimIndex) { + return parseDataValue(item.value, dims[dimIndex]); + }; +} +function numCalculate(data, valueDataDim, type) { + if (type === "average") { + let sum2 = 0; + let count2 = 0; + data.each(valueDataDim, function(val, idx) { + if (!isNaN(val)) { + sum2 += val; + count2++; } - RegExpEvaluator.prototype.evaluate = function (lVal) { - var type = typeof lVal; - return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false; - }; - return RegExpEvaluator; - }(); - var ConstConditionInternal = /** @class */function () { - function ConstConditionInternal() {} - ConstConditionInternal.prototype.evaluate = function () { - return this.value; - }; - return ConstConditionInternal; - }(); - var AndConditionInternal = /** @class */function () { - function AndConditionInternal() {} - AndConditionInternal.prototype.evaluate = function () { - var children = this.children; - for (var i = 0; i < children.length; i++) { - if (!children[i].evaluate()) { - return false; - } - } - return true; - }; - return AndConditionInternal; - }(); - var OrConditionInternal = /** @class */function () { - function OrConditionInternal() {} - OrConditionInternal.prototype.evaluate = function () { - var children = this.children; - for (var i = 0; i < children.length; i++) { - if (children[i].evaluate()) { - return true; - } - } - return false; - }; - return OrConditionInternal; - }(); - var NotConditionInternal = /** @class */function () { - function NotConditionInternal() {} - NotConditionInternal.prototype.evaluate = function () { - return !this.child.evaluate(); - }; - return NotConditionInternal; - }(); - var RelationalConditionInternal = /** @class */function () { - function RelationalConditionInternal() {} - RelationalConditionInternal.prototype.evaluate = function () { - var needParse = !!this.valueParser; - // Call getValue with no `this`. - var getValue = this.getValue; - var tarValRaw = getValue(this.valueGetterParam); - var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; - // Relational cond follow "and" logic internally. - for (var i = 0; i < this.subCondList.length; i++) { - if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) { - return false; + }); + return sum2 / count2; + } else if (type === "median") { + return data.getMedian(valueDataDim); + } else { + return data.getDataExtent(valueDataDim)[type === "max" ? 1 : 0]; + } +} + +// src/component/marker/MarkerView.ts +var inner18 = makeInner(); +var MarkerView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = MarkerView2.type; + } + init() { + this.markerGroupMap = createHashMap(); + } + render(markerModel, ecModel, api2) { + const markerGroupMap = this.markerGroupMap; + markerGroupMap.each(function(item) { + inner18(item).keep = false; + }); + ecModel.eachSeries((seriesModel) => { + const markerModel2 = MarkerModel_default.getMarkerModelFromSeries(seriesModel, this.type); + markerModel2 && this.renderSeries(seriesModel, markerModel2, ecModel, api2); + }); + markerGroupMap.each((item) => { + !inner18(item).keep && this.group.remove(item.group); + }); + } + markKeep(drawGroup) { + inner18(drawGroup).keep = true; + } + toggleBlurSeries(seriesModelList, isBlur) { + each(seriesModelList, (seriesModel) => { + const markerModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, this.type); + if (markerModel) { + const data = markerModel.getData(); + data.eachItemGraphicEl(function(el) { + if (el) { + isBlur ? enterBlur(el) : leaveBlur(el); } - } - return true; - }; - return RelationalConditionInternal; - }(); - function parseOption(exprOption, getters) { - if (exprOption === true || exprOption === false) { - var cond = new ConstConditionInternal(); - cond.value = exprOption; - return cond; - } - var errMsg = ''; - if (!isObjectNotArray(exprOption)) { - if ("development" !== 'production') { - errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption); - } - throwError(errMsg); - } - if (exprOption.and) { - return parseAndOrOption('and', exprOption, getters); - } else if (exprOption.or) { - return parseAndOrOption('or', exprOption, getters); - } else if (exprOption.not) { - return parseNotOption(exprOption, getters); + }); } - return parseRelationalOption(exprOption, getters); + }); + } +}; +var MarkerView = MarkerView2; +MarkerView.type = "marker"; +var MarkerView_default = MarkerView; + +// src/component/marker/MarkPointView.ts +function updateMarkerLayout(mpData, seriesModel, api2) { + const coordSys = seriesModel.coordinateSystem; + mpData.each(function(idx) { + const itemModel = mpData.getItemModel(idx); + let point; + const xPx = parsePercent2(itemModel.get("x"), api2.getWidth()); + const yPx = parsePercent2(itemModel.get("y"), api2.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } else if (seriesModel.getMarkerPosition) { + point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx)); + } else if (coordSys) { + const x = mpData.get(coordSys.dimensions[0], idx); + const y = mpData.get(coordSys.dimensions[1], idx); + point = coordSys.dataToPoint([x, y]); + } + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } + mpData.setItemLayout(idx, point); + }); +} +var MarkPointView2 = class extends MarkerView_default { + constructor() { + super(...arguments); + this.type = MarkPointView2.type; + } + updateTransform(markPointModel, ecModel, api2) { + ecModel.eachSeries(function(seriesModel) { + const mpModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markPoint"); + if (mpModel) { + updateMarkerLayout(mpModel.getData(), seriesModel, api2); + this.markerGroupMap.get(seriesModel.id).updateLayout(); + } + }, this); + } + renderSeries(seriesModel, mpModel, ecModel, api2) { + const coordSys = seriesModel.coordinateSystem; + const seriesId = seriesModel.id; + const seriesData = seriesModel.getData(); + const symbolDrawMap = this.markerGroupMap; + const symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw_default()); + const mpData = createData(coordSys, seriesModel, mpModel); + mpModel.setData(mpData); + updateMarkerLayout(mpModel.getData(), seriesModel, api2); + mpData.each(function(idx) { + const itemModel = mpData.getItemModel(idx); + let symbol = itemModel.getShallow("symbol"); + let symbolSize = itemModel.getShallow("symbolSize"); + let symbolRotate = itemModel.getShallow("symbolRotate"); + let symbolOffset = itemModel.getShallow("symbolOffset"); + const symbolKeepAspect = itemModel.getShallow("symbolKeepAspect"); + if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) { + const rawIdx = mpModel.getRawValue(idx); + const dataParams = mpModel.getDataParams(idx); + if (isFunction(symbol)) { + symbol = symbol(rawIdx, dataParams); + } + if (isFunction(symbolSize)) { + symbolSize = symbolSize(rawIdx, dataParams); + } + if (isFunction(symbolRotate)) { + symbolRotate = symbolRotate(rawIdx, dataParams); + } + if (isFunction(symbolOffset)) { + symbolOffset = symbolOffset(rawIdx, dataParams); + } + } + const style = itemModel.getModel("itemStyle").getItemStyle(); + const color2 = getVisualFromData(seriesData, "color"); + if (!style.fill) { + style.fill = color2; + } + mpData.setItemVisual(idx, { + symbol, + symbolSize, + symbolRotate, + symbolOffset, + symbolKeepAspect, + style + }); + }); + symbolDraw.updateData(mpData); + this.group.add(symbolDraw.group); + mpData.eachItemGraphicEl(function(el) { + el.traverse(function(child) { + getECData(child).dataModel = mpModel; + }); + }); + this.markKeep(symbolDraw); + symbolDraw.group.silent = mpModel.get("silent") || seriesModel.get("silent"); + } +}; +var MarkPointView = MarkPointView2; +MarkPointView.type = "markPoint"; +function createData(coordSys, seriesModel, mpModel) { + let coordDimsInfos; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) { + const info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; + return extend(extend({}, info), { + name: coordDim, + ordinalMeta: null + }); + }); + } else { + coordDimsInfos = [{ + name: "value", + type: "float" + }]; + } + const mpData = new SeriesData_default(coordDimsInfos, mpModel); + let dataOpt = map(mpModel.get("data"), curry(dataTransform, seriesModel)); + if (coordSys) { + dataOpt = filter(dataOpt, curry(dataFilter2, coordSys)); + } + const dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); + mpData.initData(dataOpt, null, dimValueGetter); + return mpData; +} +var MarkPointView_default = MarkPointView; + +// src/component/marker/installMarkPoint.ts +function install41(registers) { + registers.registerComponentModel(MarkPointModel_default); + registers.registerComponentView(MarkPointView_default); + registers.registerPreprocessor(function(opt) { + if (checkMarkerInSeries(opt.series, "markPoint")) { + opt.markPoint = opt.markPoint || {}; + } + }); +} + +// src/component/marker/MarkLineModel.ts +var MarkLineModel2 = class extends MarkerModel_default { + constructor() { + super(...arguments); + this.type = MarkLineModel2.type; + } + createMarkerModelFromSeries(markerOpt, masterMarkerModel, ecModel) { + return new MarkLineModel2(markerOpt, masterMarkerModel, ecModel); + } +}; +var MarkLineModel = MarkLineModel2; +MarkLineModel.type = "markLine"; +MarkLineModel.defaultOption = { + z: 5, + symbol: ["circle", "arrow"], + symbolSize: [8, 16], + symbolOffset: 0, + precision: 2, + tooltip: { + trigger: "item" + }, + label: { + show: true, + position: "end", + distance: 5 + }, + lineStyle: { + type: "dashed" + }, + emphasis: { + label: { + show: true + }, + lineStyle: { + width: 3 + } + }, + animationEasing: "linear" +}; +var MarkLineModel_default = MarkLineModel; + +// src/component/marker/MarkLineView.ts +var inner19 = makeInner(); +var markLineTransform = function(seriesModel, coordSys, mlModel, item) { + const data = seriesModel.getData(); + let itemArray; + if (!isArray(item)) { + const mlType = item.type; + if (mlType === "min" || mlType === "max" || mlType === "average" || mlType === "median" || (item.xAxis != null || item.yAxis != null)) { + let valueAxis2; + let value; + if (item.yAxis != null || item.xAxis != null) { + valueAxis2 = coordSys.getAxis(item.yAxis != null ? "y" : "x"); + value = retrieve(item.yAxis, item.xAxis); + } else { + const axisInfo = getAxisInfo2(item, data, coordSys, seriesModel); + valueAxis2 = axisInfo.valueAxis; + const valueDataDim = getStackedDimension(data, axisInfo.valueDataDim); + value = numCalculate(data, valueDataDim, mlType); + } + const valueIndex = valueAxis2.dim === "x" ? 0 : 1; + const baseIndex = 1 - valueIndex; + const mlFrom = clone(item); + const mlTo = { + coord: [] + }; + mlFrom.type = null; + mlFrom.coord = []; + mlFrom.coord[baseIndex] = -Infinity; + mlTo.coord[baseIndex] = Infinity; + const precision = mlModel.get("precision"); + if (precision >= 0 && isNumber(value)) { + value = +value.toFixed(Math.min(precision, 20)); + } + mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; + itemArray = [mlFrom, mlTo, { + type: mlType, + valueIndex: item.valueIndex, + value + }]; + } else { + if (true) { + logError("Invalid markLine data."); + } + itemArray = []; + } + } else { + itemArray = item; + } + const normalizedItem = [ + dataTransform(seriesModel, itemArray[0]), + dataTransform(seriesModel, itemArray[1]), + extend({}, itemArray[2]) + ]; + normalizedItem[2].type = normalizedItem[2].type || null; + merge(normalizedItem[2], normalizedItem[0]); + merge(normalizedItem[2], normalizedItem[1]); + return normalizedItem; +}; +function isInfinity(val) { + return !isNaN(val) && !isFinite(val); +} +function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { + const otherDimIndex = 1 - dimIndex; + const dimName = coordSys.dimensions[dimIndex]; + return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); +} +function markLineFilter(coordSys, item) { + if (coordSys.type === "cartesian2d") { + const fromCoord = item[0].coord; + const toCoord = item[1].coord; + if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) { + return true; } - function parseAndOrOption(op, exprOption, getters) { - var subOptionArr = exprOption[op]; - var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('"and"/"or" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption); - } - if (!isArray(subOptionArr)) { - throwError(errMsg); - } - if (!subOptionArr.length) { - throwError(errMsg); - } - var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal(); - cond.children = map(subOptionArr, function (subOption) { - return parseOption(subOption, getters); + } + return dataFilter2(coordSys, item[0]) && dataFilter2(coordSys, item[1]); +} +function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api2) { + const coordSys = seriesModel.coordinateSystem; + const itemModel = data.getItemModel(idx); + let point; + const xPx = parsePercent2(itemModel.get("x"), api2.getWidth()); + const yPx = parsePercent2(itemModel.get("y"), api2.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } else { + if (seriesModel.getMarkerPosition) { + point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx)); + } else { + const dims = coordSys.dimensions; + const x = data.get(dims[0], idx); + const y = data.get(dims[1], idx); + point = coordSys.dataToPoint([x, y]); + } + if (isCoordinateSystemType(coordSys, "cartesian2d")) { + const xAxis = coordSys.getAxis("x"); + const yAxis = coordSys.getAxis("y"); + const dims = coordSys.dimensions; + if (isInfinity(data.get(dims[0], idx))) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); + } else if (isInfinity(data.get(dims[1], idx))) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); + } + } + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } + } + data.setItemLayout(idx, point); +} +var MarkLineView2 = class extends MarkerView_default { + constructor() { + super(...arguments); + this.type = MarkLineView2.type; + } + updateTransform(markLineModel, ecModel, api2) { + ecModel.eachSeries(function(seriesModel) { + const mlModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markLine"); + if (mlModel) { + const mlData = mlModel.getData(); + const fromData = inner19(mlModel).from; + const toData = inner19(mlModel).to; + fromData.each(function(idx) { + updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api2); + updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api2); + }); + mlData.each(function(idx) { + mlData.setItemLayout(idx, [ + fromData.getItemLayout(idx), + toData.getItemLayout(idx) + ]); + }); + this.markerGroupMap.get(seriesModel.id).updateLayout(); + } + }, this); + } + renderSeries(seriesModel, mlModel, ecModel, api2) { + const coordSys = seriesModel.coordinateSystem; + const seriesId = seriesModel.id; + const seriesData = seriesModel.getData(); + const lineDrawMap = this.markerGroupMap; + const lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw_default()); + this.group.add(lineDraw.group); + const mlData = createList2(coordSys, seriesModel, mlModel); + const fromData = mlData.from; + const toData = mlData.to; + const lineData = mlData.line; + inner19(mlModel).from = fromData; + inner19(mlModel).to = toData; + mlModel.setData(lineData); + let symbolType = mlModel.get("symbol"); + let symbolSize = mlModel.get("symbolSize"); + let symbolRotate = mlModel.get("symbolRotate"); + let symbolOffset = mlModel.get("symbolOffset"); + if (!isArray(symbolType)) { + symbolType = [symbolType, symbolType]; + } + if (!isArray(symbolSize)) { + symbolSize = [symbolSize, symbolSize]; + } + if (!isArray(symbolRotate)) { + symbolRotate = [symbolRotate, symbolRotate]; + } + if (!isArray(symbolOffset)) { + symbolOffset = [symbolOffset, symbolOffset]; + } + mlData.from.each(function(idx) { + updateDataVisualAndLayout(fromData, idx, true); + updateDataVisualAndLayout(toData, idx, false); + }); + lineData.each(function(idx) { + const lineStyle = lineData.getItemModel(idx).getModel("lineStyle").getLineStyle(); + lineData.setItemLayout(idx, [ + fromData.getItemLayout(idx), + toData.getItemLayout(idx) + ]); + if (lineStyle.stroke == null) { + lineStyle.stroke = fromData.getItemVisual(idx, "style").fill; + } + lineData.setItemVisual(idx, { + fromSymbolKeepAspect: fromData.getItemVisual(idx, "symbolKeepAspect"), + fromSymbolOffset: fromData.getItemVisual(idx, "symbolOffset"), + fromSymbolRotate: fromData.getItemVisual(idx, "symbolRotate"), + fromSymbolSize: fromData.getItemVisual(idx, "symbolSize"), + fromSymbol: fromData.getItemVisual(idx, "symbol"), + toSymbolKeepAspect: toData.getItemVisual(idx, "symbolKeepAspect"), + toSymbolOffset: toData.getItemVisual(idx, "symbolOffset"), + toSymbolRotate: toData.getItemVisual(idx, "symbolRotate"), + toSymbolSize: toData.getItemVisual(idx, "symbolSize"), + toSymbol: toData.getItemVisual(idx, "symbol"), + style: lineStyle + }); + }); + lineDraw.updateData(lineData); + mlData.line.eachItemGraphicEl(function(el) { + getECData(el).dataModel = mlModel; + el.traverse(function(child) { + getECData(child).dataModel = mlModel; + }); + }); + function updateDataVisualAndLayout(data, idx, isFrom) { + const itemModel = data.getItemModel(idx); + updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api2); + const style = itemModel.getModel("itemStyle").getItemStyle(); + if (style.fill == null) { + style.fill = getVisualFromData(seriesData, "color"); + } + data.setItemVisual(idx, { + symbolKeepAspect: itemModel.get("symbolKeepAspect"), + symbolOffset: retrieve2(itemModel.get("symbolOffset", true), symbolOffset[isFrom ? 0 : 1]), + symbolRotate: retrieve2(itemModel.get("symbolRotate", true), symbolRotate[isFrom ? 0 : 1]), + symbolSize: retrieve2(itemModel.get("symbolSize"), symbolSize[isFrom ? 0 : 1]), + symbol: retrieve2(itemModel.get("symbol", true), symbolType[isFrom ? 0 : 1]), + style }); - if (!cond.children.length) { - throwError(errMsg); - } - return cond; } - function parseNotOption(exprOption, getters) { - var subOption = exprOption.not; - var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('"not" condition should only be `not: {}`.', 'Illegal condition:', exprOption); - } - if (!isObjectNotArray(subOption)) { - throwError(errMsg); - } - var cond = new NotConditionInternal(); - cond.child = parseOption(subOption, getters); - if (!cond.child) { - throwError(errMsg); - } - return cond; - } - function parseRelationalOption(exprOption, getters) { - var errMsg = ''; - var valueGetterParam = getters.prepareGetValue(exprOption); - var subCondList = []; - var exprKeys = keys(exprOption); - var parserName = exprOption.parser; - var valueParser = parserName ? getRawValueParser(parserName) : null; - for (var i = 0; i < exprKeys.length; i++) { - var keyRaw = exprKeys[i]; - if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) { - continue; - } - var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw; - var condValueRaw = exprOption[keyRaw]; - var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw; - var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed); - if (!evaluator) { - if ("development" !== 'production') { - errMsg = makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption); - } - throwError(errMsg); - } - subCondList.push(evaluator); + this.markKeep(lineDraw); + lineDraw.group.silent = mlModel.get("silent") || seriesModel.get("silent"); + } +}; +var MarkLineView = MarkLineView2; +MarkLineView.type = "markLine"; +function createList2(coordSys, seriesModel, mlModel) { + let coordDimsInfos; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) { + const info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; + return extend(extend({}, info), { + name: coordDim, + ordinalMeta: null + }); + }); + } else { + coordDimsInfos = [{ + name: "value", + type: "float" + }]; + } + const fromData = new SeriesData_default(coordDimsInfos, mlModel); + const toData = new SeriesData_default(coordDimsInfos, mlModel); + const lineData = new SeriesData_default([], mlModel); + let optData = map(mlModel.get("data"), curry(markLineTransform, seriesModel, coordSys, mlModel)); + if (coordSys) { + optData = filter(optData, curry(markLineFilter, coordSys)); + } + const dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); + fromData.initData(map(optData, function(item) { + return item[0]; + }), null, dimValueGetter); + toData.initData(map(optData, function(item) { + return item[1]; + }), null, dimValueGetter); + lineData.initData(map(optData, function(item) { + return item[2]; + })); + lineData.hasItemOption = true; + return { + from: fromData, + to: toData, + line: lineData + }; +} +var MarkLineView_default = MarkLineView; + +// src/component/marker/installMarkLine.ts +function install42(registers) { + registers.registerComponentModel(MarkLineModel_default); + registers.registerComponentView(MarkLineView_default); + registers.registerPreprocessor(function(opt) { + if (checkMarkerInSeries(opt.series, "markLine")) { + opt.markLine = opt.markLine || {}; + } + }); +} + +// src/component/marker/MarkAreaModel.ts +var MarkAreaModel2 = class extends MarkerModel_default { + constructor() { + super(...arguments); + this.type = MarkAreaModel2.type; + } + createMarkerModelFromSeries(markerOpt, masterMarkerModel, ecModel) { + return new MarkAreaModel2(markerOpt, masterMarkerModel, ecModel); + } +}; +var MarkAreaModel = MarkAreaModel2; +MarkAreaModel.type = "markArea"; +MarkAreaModel.defaultOption = { + z: 1, + tooltip: { + trigger: "item" + }, + animation: false, + label: { + show: true, + position: "top" + }, + itemStyle: { + borderWidth: 0 + }, + emphasis: { + label: { + show: true, + position: "top" + } + } +}; +var MarkAreaModel_default = MarkAreaModel; + +// src/component/marker/MarkAreaView.ts +var inner20 = makeInner(); +var markAreaTransform = function(seriesModel, coordSys, maModel, item) { + const item0 = item[0]; + const item1 = item[1]; + if (!item0 || !item1) { + return; + } + const lt2 = dataTransform(seriesModel, item0); + const rb2 = dataTransform(seriesModel, item1); + const ltCoord = lt2.coord; + const rbCoord = rb2.coord; + ltCoord[0] = retrieve(ltCoord[0], -Infinity); + ltCoord[1] = retrieve(ltCoord[1], -Infinity); + rbCoord[0] = retrieve(rbCoord[0], Infinity); + rbCoord[1] = retrieve(rbCoord[1], Infinity); + const result = mergeAll([{}, lt2, rb2]); + result.coord = [ + lt2.coord, + rb2.coord + ]; + result.x0 = lt2.x; + result.y0 = lt2.y; + result.x1 = rb2.x; + result.y1 = rb2.y; + return result; +}; +function isInfinity2(val) { + return !isNaN(val) && !isFinite(val); +} +function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { + const otherDimIndex = 1 - dimIndex; + return isInfinity2(fromCoord[otherDimIndex]) && isInfinity2(toCoord[otherDimIndex]); +} +function markAreaFilter(coordSys, item) { + const fromCoord = item.coord[0]; + const toCoord = item.coord[1]; + const item0 = { + coord: fromCoord, + x: item.x0, + y: item.y0 + }; + const item1 = { + coord: toCoord, + x: item.x1, + y: item.y1 + }; + if (isCoordinateSystemType(coordSys, "cartesian2d")) { + if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) { + return true; + } + return zoneFilter(coordSys, item0, item1); + } + return dataFilter2(coordSys, item0) || dataFilter2(coordSys, item1); +} +function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api2) { + const coordSys = seriesModel.coordinateSystem; + const itemModel = data.getItemModel(idx); + let point; + const xPx = parsePercent2(itemModel.get(dims[0]), api2.getWidth()); + const yPx = parsePercent2(itemModel.get(dims[1]), api2.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } else { + if (seriesModel.getMarkerPosition) { + const pointValue0 = data.getValues(["x0", "y0"], idx); + const pointValue1 = data.getValues(["x1", "y1"], idx); + const clampPointValue0 = coordSys.clampData(pointValue0); + const clampPointValue1 = coordSys.clampData(pointValue1); + const pointValue = []; + if (dims[0] === "x0") { + pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue1[0] : pointValue0[0]; + } else { + pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue0[0] : pointValue1[0]; } - if (!subCondList.length) { - if ("development" !== 'production') { - errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption); + if (dims[1] === "y0") { + pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue1[1] : pointValue0[1]; + } else { + pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue0[1] : pointValue1[1]; + } + point = seriesModel.getMarkerPosition(pointValue, dims, true); + } else { + const x = data.get(dims[0], idx); + const y = data.get(dims[1], idx); + const pt = [x, y]; + coordSys.clampData && coordSys.clampData(pt, pt); + point = coordSys.dataToPoint(pt, true); + } + if (isCoordinateSystemType(coordSys, "cartesian2d")) { + const xAxis = coordSys.getAxis("x"); + const yAxis = coordSys.getAxis("y"); + const x = data.get(dims[0], idx); + const y = data.get(dims[1], idx); + if (isInfinity2(x)) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === "x0" ? 0 : 1]); + } else if (isInfinity2(y)) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === "y0" ? 0 : 1]); + } + } + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } + } + return point; +} +var dimPermutations = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]]; +var MarkAreaView2 = class extends MarkerView_default { + constructor() { + super(...arguments); + this.type = MarkAreaView2.type; + } + updateTransform(markAreaModel, ecModel, api2) { + ecModel.eachSeries(function(seriesModel) { + const maModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markArea"); + if (maModel) { + const areaData = maModel.getData(); + areaData.each(function(idx) { + const points4 = map(dimPermutations, function(dim) { + return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api2); + }); + areaData.setItemLayout(idx, points4); + const el = areaData.getItemGraphicEl(idx); + el.setShape("points", points4); + }); + } + }, this); + } + renderSeries(seriesModel, maModel, ecModel, api2) { + const coordSys = seriesModel.coordinateSystem; + const seriesId = seriesModel.id; + const seriesData = seriesModel.getData(); + const areaGroupMap = this.markerGroupMap; + const polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {group: new Group_default()}); + this.group.add(polygonGroup.group); + this.markKeep(polygonGroup); + const areaData = createList3(coordSys, seriesModel, maModel); + maModel.setData(areaData); + areaData.each(function(idx) { + const points4 = map(dimPermutations, function(dim) { + return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api2); + }); + const xAxisScale = coordSys.getAxis("x").scale; + const yAxisScale = coordSys.getAxis("y").scale; + const xAxisExtent = xAxisScale.getExtent(); + const yAxisExtent = yAxisScale.getExtent(); + const xPointExtent = [xAxisScale.parse(areaData.get("x0", idx)), xAxisScale.parse(areaData.get("x1", idx))]; + const yPointExtent = [yAxisScale.parse(areaData.get("y0", idx)), yAxisScale.parse(areaData.get("y1", idx))]; + asc(xPointExtent); + asc(yPointExtent); + const overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]); + const allClipped = !overlapped; + areaData.setItemLayout(idx, { + points: points4, + allClipped + }); + const style = areaData.getItemModel(idx).getModel("itemStyle").getItemStyle(); + const color2 = getVisualFromData(seriesData, "color"); + if (!style.fill) { + style.fill = color2; + if (isString(style.fill)) { + style.fill = modifyAlpha(style.fill, 0.4); } - // No relational operator always disabled in case of dangers result. - throwError(errMsg); } - var cond = new RelationalConditionInternal(); - cond.valueGetterParam = valueGetterParam; - cond.valueParser = valueParser; - cond.getValue = getters.getValue; - cond.subCondList = subCondList; - return cond; - } - function isObjectNotArray(val) { - return isObject(val) && !isArrayLike(val); - } - var ConditionalExpressionParsed = /** @class */function () { - function ConditionalExpressionParsed(exprOption, getters) { - this._cond = parseOption(exprOption, getters); + if (!style.stroke) { + style.stroke = color2; } - ConditionalExpressionParsed.prototype.evaluate = function () { - return this._cond.evaluate(); - }; - return ConditionalExpressionParsed; - }(); - function parseConditionalExpression(exprOption, getters) { - return new ConditionalExpressionParsed(exprOption, getters); - } - - var filterTransform = { - type: 'echarts:filter', - // PENDING: enhance to filter by index rather than create new data - transform: function (params) { - // [Caveat] Fail-Fast: - // Do not return the whole dataset unless user config indicates it explicitly. - // For example, if no condition is specified by mistake, returning an empty result - // is better than returning the entire raw source for the user to find the mistake. - var upstream = params.upstream; - var rawItem; - var condition = parseConditionalExpression(params.config, { - valueGetterAttrMap: createHashMap({ - dimension: true - }), - prepareGetValue: function (exprOption) { - var errMsg = ''; - var dimLoose = exprOption.dimension; - if (!hasOwn(exprOption, 'dimension')) { - if ("development" !== 'production') { - errMsg = makePrintable('Relation condition must has prop "dimension" specified.', 'Illegal condition:', exprOption); - } - throwError(errMsg); - } - var dimInfo = upstream.getDimensionInfo(dimLoose); - if (!dimInfo) { - if ("development" !== 'production') { - errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal condition:', exprOption, '.\n'); - } - throwError(errMsg); - } - return { - dimIdx: dimInfo.index - }; - }, - getValue: function (param) { - return upstream.retrieveValueFromItem(rawItem, param.dimIdx); + areaData.setItemVisual(idx, "style", style); + }); + areaData.diff(inner20(polygonGroup).data).add(function(idx) { + const layout18 = areaData.getItemLayout(idx); + if (!layout18.allClipped) { + const polygon = new Polygon_default({ + shape: { + points: layout18.points } }); - var resultData = []; - for (var i = 0, len = upstream.count(); i < len; i++) { - rawItem = upstream.getRawDataItem(i); - if (condition.evaluate()) { - resultData.push(rawItem); - } - } - return { - data: resultData - }; + areaData.setItemGraphicEl(idx, polygon); + polygonGroup.group.add(polygon); } - }; - - var sampleLog = ''; - if ("development" !== 'production') { - sampleLog = ['Valid config is like:', '{ dimension: "age", order: "asc" }', 'or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(' '); - } - var sortTransform = { - type: 'echarts:sort', - transform: function (params) { - var upstream = params.upstream; - var config = params.config; - var errMsg = ''; - // Normalize - // const orderExprList: OrderExpression[] = isArray(config[0]) - // ? config as OrderExpression[] - // : [config as OrderExpression]; - var orderExprList = normalizeToArray(config); - if (!orderExprList.length) { - if ("development" !== 'production') { - errMsg = 'Empty `config` in sort transform.'; - } - throwError(errMsg); - } - var orderDefList = []; - each(orderExprList, function (orderExpr) { - var dimLoose = orderExpr.dimension; - var order = orderExpr.order; - var parserName = orderExpr.parser; - var incomparable = orderExpr.incomparable; - if (dimLoose == null) { - if ("development" !== 'production') { - errMsg = 'Sort transform config must has "dimension" specified.' + sampleLog; - } - throwError(errMsg); - } - if (order !== 'asc' && order !== 'desc') { - if ("development" !== 'production') { - errMsg = 'Sort transform config must has "order" specified.' + sampleLog; - } - throwError(errMsg); - } - if (incomparable && incomparable !== 'min' && incomparable !== 'max') { - var errMsg_1 = ''; - if ("development" !== 'production') { - errMsg_1 = 'incomparable must be "min" or "max" rather than "' + incomparable + '".'; - } - throwError(errMsg_1); - } - if (order !== 'asc' && order !== 'desc') { - var errMsg_2 = ''; - if ("development" !== 'production') { - errMsg_2 = 'order must be "asc" or "desc" rather than "' + order + '".'; - } - throwError(errMsg_2); - } - var dimInfo = upstream.getDimensionInfo(dimLoose); - if (!dimInfo) { - if ("development" !== 'production') { - errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal config:', orderExpr, '.\n'); + }).update(function(newIdx, oldIdx) { + let polygon = inner20(polygonGroup).data.getItemGraphicEl(oldIdx); + const layout18 = areaData.getItemLayout(newIdx); + if (!layout18.allClipped) { + if (polygon) { + updateProps(polygon, { + shape: { + points: layout18.points } - throwError(errMsg); - } - var parser = parserName ? getRawValueParser(parserName) : null; - if (parserName && !parser) { - if ("development" !== 'production') { - errMsg = makePrintable('Invalid parser name ' + parserName + '.\n', 'Illegal config:', orderExpr, '.\n'); + }, maModel, newIdx); + } else { + polygon = new Polygon_default({ + shape: { + points: layout18.points } - throwError(errMsg); - } - orderDefList.push({ - dimIdx: dimInfo.index, - parser: parser, - comparator: new SortOrderComparator(order, incomparable) }); - }); - // TODO: support it? - var sourceFormat = upstream.sourceFormat; - if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) { - if ("development" !== 'production') { - errMsg = 'sourceFormat "' + sourceFormat + '" is not supported yet'; - } - throwError(errMsg); } - // Other upstream format are all array. - var resultData = []; - for (var i = 0, len = upstream.count(); i < len; i++) { - resultData.push(upstream.getRawDataItem(i)); - } - resultData.sort(function (item0, item1) { - for (var i = 0; i < orderDefList.length; i++) { - var orderDef = orderDefList[i]; - var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx); - var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx); - if (orderDef.parser) { - val0 = orderDef.parser(val0); - val1 = orderDef.parser(val1); - } - var result = orderDef.comparator.evaluate(val0, val1); - if (result !== 0) { - return result; - } - } - return 0; - }); - return { - data: resultData - }; - } + areaData.setItemGraphicEl(newIdx, polygon); + polygonGroup.group.add(polygon); + } else if (polygon) { + polygonGroup.group.remove(polygon); + } + }).remove(function(idx) { + const polygon = inner20(polygonGroup).data.getItemGraphicEl(idx); + polygonGroup.group.remove(polygon); + }).execute(); + areaData.eachItemGraphicEl(function(polygon, idx) { + const itemModel = areaData.getItemModel(idx); + const style = areaData.getItemVisual(idx, "style"); + polygon.useStyle(areaData.getItemVisual(idx, "style")); + setLabelStyle(polygon, getLabelStatesModels(itemModel), { + labelFetcher: maModel, + labelDataIndex: idx, + defaultText: areaData.getName(idx) || "", + inheritColor: isString(style.fill) ? modifyAlpha(style.fill, 1) : "#000" + }); + setStatesStylesFromModel(polygon, itemModel); + toggleHoverEmphasis(polygon, null, null, itemModel.get(["emphasis", "disabled"])); + getECData(polygon).dataModel = maModel; + }); + inner20(polygonGroup).data = areaData; + polygonGroup.group.silent = maModel.get("silent") || seriesModel.get("silent"); + } +}; +var MarkAreaView = MarkAreaView2; +MarkAreaView.type = "markArea"; +function createList3(coordSys, seriesModel, maModel) { + let areaData; + let dataDims; + const dims = ["x0", "y0", "x1", "y1"]; + if (coordSys) { + const coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) { + const data = seriesModel.getData(); + const info = data.getDimensionInfo(data.mapDimension(coordDim)) || {}; + return extend(extend({}, info), { + name: coordDim, + ordinalMeta: null + }); + }); + dataDims = map(dims, (dim, idx) => ({ + name: dim, + type: coordDimsInfos[idx % 2].type + })); + areaData = new SeriesData_default(dataDims, maModel); + } else { + dataDims = [{ + name: "value", + type: "float" + }]; + areaData = new SeriesData_default(dataDims, maModel); + } + let optData = map(maModel.get("data"), curry(markAreaTransform, seriesModel, coordSys, maModel)); + if (coordSys) { + optData = filter(optData, curry(markAreaFilter, coordSys)); + } + const dimValueGetter = coordSys ? function(item, dimName, dataIndex, dimIndex) { + const rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; + return parseDataValue(rawVal, dataDims[dimIndex]); + } : function(item, dimName, dataIndex, dimIndex) { + return parseDataValue(item.value, dataDims[dimIndex]); + }; + areaData.initData(optData, null, dimValueGetter); + areaData.hasItemOption = true; + return areaData; +} +var MarkAreaView_default = MarkAreaView; + +// src/component/marker/installMarkArea.ts +function install43(registers) { + registers.registerComponentModel(MarkAreaModel_default); + registers.registerComponentView(MarkAreaView_default); + registers.registerPreprocessor(function(opt) { + if (checkMarkerInSeries(opt.series, "markArea")) { + opt.markArea = opt.markArea || {}; + } + }); +} + +// src/component/legend/LegendModel.ts +var getDefaultSelectorOptions = function(ecModel, type) { + if (type === "all") { + return { + type: "all", + title: ecModel.getLocaleModel().get(["legend", "selector", "all"]) }; - - function install$R(registers) { - registers.registerTransform(filterTransform); - registers.registerTransform(sortTransform); - } - - var DatasetModel = /** @class */function (_super) { - __extends(DatasetModel, _super); - function DatasetModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'dataset'; - return _this; - } - DatasetModel.prototype.init = function (option, parentModel, ecModel) { - _super.prototype.init.call(this, option, parentModel, ecModel); - this._sourceManager = new SourceManager(this); - disableTransformOptionMerge(this); - }; - DatasetModel.prototype.mergeOption = function (newOption, ecModel) { - _super.prototype.mergeOption.call(this, newOption, ecModel); - disableTransformOptionMerge(this); - }; - DatasetModel.prototype.optionUpdated = function () { - this._sourceManager.dirty(); - }; - DatasetModel.prototype.getSourceManager = function () { - return this._sourceManager; - }; - DatasetModel.type = 'dataset'; - DatasetModel.defaultOption = { - seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN - }; - return DatasetModel; - }(ComponentModel); - var DatasetView = /** @class */function (_super) { - __extends(DatasetView, _super); - function DatasetView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'dataset'; - return _this; - } - DatasetView.type = 'dataset'; - return DatasetView; - }(ComponentView); - function install$S(registers) { - registers.registerComponentModel(DatasetModel); - registers.registerComponentView(DatasetView); - } - - var CMD$4 = PathProxy.CMD; - function aroundEqual(a, b) { - return Math.abs(a - b) < 1e-5; - } - function pathToBezierCurves(path) { - var data = path.data; - var len = path.len(); - var bezierArrayGroups = []; - var currentSubpath; - var xi = 0; - var yi = 0; - var x0 = 0; - var y0 = 0; - function createNewSubpath(x, y) { - if (currentSubpath && currentSubpath.length > 2) { - bezierArrayGroups.push(currentSubpath); - } - currentSubpath = [x, y]; - } - function addLine(x0, y0, x1, y1) { - if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) { - currentSubpath.push(x0, y0, x1, y1, x1, y1); - } - } - function addArc(startAngle, endAngle, cx, cy, rx, ry) { - var delta = Math.abs(endAngle - startAngle); - var len = Math.tan(delta / 4) * 4 / 3; - var dir = endAngle < startAngle ? -1 : 1; - var c1 = Math.cos(startAngle); - var s1 = Math.sin(startAngle); - var c2 = Math.cos(endAngle); - var s2 = Math.sin(endAngle); - var x1 = c1 * rx + cx; - var y1 = s1 * ry + cy; - var x4 = c2 * rx + cx; - var y4 = s2 * ry + cy; - var hx = rx * len * dir; - var hy = ry * len * dir; - currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4); - } - var x1; - var y1; - var x2; - var y2; - for (var i = 0; i < len;) { - var cmd = data[i++]; - var isFirst = i === 1; - if (isFirst) { - xi = data[i]; - yi = data[i + 1]; - x0 = xi; - y0 = yi; - if (cmd === CMD$4.L || cmd === CMD$4.C || cmd === CMD$4.Q) { - currentSubpath = [x0, y0]; - } - } - switch (cmd) { - case CMD$4.M: - xi = x0 = data[i++]; - yi = y0 = data[i++]; - createNewSubpath(x0, y0); - break; - case CMD$4.L: - x1 = data[i++]; - y1 = data[i++]; - addLine(xi, yi, x1, y1); - xi = x1; - yi = y1; - break; - case CMD$4.C: - currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]); - break; - case CMD$4.Q: - x1 = data[i++]; - y1 = data[i++]; - x2 = data[i++]; - y2 = data[i++]; - currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2); - xi = x2; - yi = y2; - break; - case CMD$4.A: - 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; - i += 1; - var anticlockwise = !data[i++]; - x1 = Math.cos(startAngle) * rx + cx; - y1 = Math.sin(startAngle) * ry + cy; - if (isFirst) { - x0 = x1; - y0 = y1; - createNewSubpath(x0, y0); - } - else { - addLine(xi, yi, x1, y1); - } - xi = Math.cos(endAngle) * rx + cx; - yi = Math.sin(endAngle) * ry + cy; - var step = (anticlockwise ? -1 : 1) * Math.PI / 2; - for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) { - var nextAngle = anticlockwise ? Math.max(angle + step, endAngle) - : Math.min(angle + step, endAngle); - addArc(angle, nextAngle, cx, cy, rx, ry); - } - break; - case CMD$4.R: - x0 = xi = data[i++]; - y0 = yi = data[i++]; - x1 = x0 + data[i++]; - y1 = y0 + data[i++]; - createNewSubpath(x1, y0); - addLine(x1, y0, x1, y1); - addLine(x1, y1, x0, y1); - addLine(x0, y1, x0, y0); - addLine(x0, y0, x1, y0); - break; - case CMD$4.Z: - currentSubpath && addLine(xi, yi, x0, y0); - xi = x0; - yi = y0; - break; - } - } - if (currentSubpath && currentSubpath.length > 2) { - bezierArrayGroups.push(currentSubpath); - } - return bezierArrayGroups; + } else if (type === "inverse") { + return { + type: "inverse", + title: ecModel.getLocaleModel().get(["legend", "selector", "inverse"]) + }; + } +}; +var LegendModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = LegendModel2.type; + this.layoutMode = { + type: "box", + ignoreSize: true + }; + } + init(option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + option.selected = option.selected || {}; + this._updateSelector(option); + } + mergeOption(option, ecModel) { + super.mergeOption(option, ecModel); + this._updateSelector(option); + } + _updateSelector(option) { + let selector2 = option.selector; + const {ecModel} = this; + if (selector2 === true) { + selector2 = option.selector = ["all", "inverse"]; + } + if (isArray(selector2)) { + each(selector2, function(item, index) { + isString(item) && (item = {type: item}); + selector2[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type)); + }); } - function adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out, scale) { - if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) { - out.push(x3, y3); - return; - } - var PIXEL_DISTANCE = 2 / scale; - var PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE; - var dx = x3 - x0; - var dy = y3 - y0; - var d = Math.sqrt(dx * dx + dy * dy); - dx /= d; - dy /= d; - var dx1 = x1 - x0; - var dy1 = y1 - y0; - var dx2 = x2 - x3; - var dy2 = y2 - y3; - var cp1LenSqr = dx1 * dx1 + dy1 * dy1; - var cp2LenSqr = dx2 * dx2 + dy2 * dy2; - if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) { - out.push(x3, y3); - return; - } - var projLen1 = dx * dx1 + dy * dy1; - var projLen2 = -dx * dx2 - dy * dy2; - var d1Sqr = cp1LenSqr - projLen1 * projLen1; - var d2Sqr = cp2LenSqr - projLen2 * projLen2; - if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0 - && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0) { - out.push(x3, y3); - return; - } - var tmpSegX = []; - var tmpSegY = []; - cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX); - cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY); - adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out, scale); - adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out, scale); - } - function pathToPolygons(path, scale) { - var bezierArrayGroups = pathToBezierCurves(path); - var polygons = []; - scale = scale || 1; - for (var i = 0; i < bezierArrayGroups.length; i++) { - var beziers = bezierArrayGroups[i]; - var polygon = []; - var x0 = beziers[0]; - var y0 = beziers[1]; - polygon.push(x0, y0); - for (var k = 2; k < beziers.length;) { - var x1 = beziers[k++]; - var y1 = beziers[k++]; - var x2 = beziers[k++]; - var y2 = beziers[k++]; - var x3 = beziers[k++]; - var y3 = beziers[k++]; - adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale); - x0 = x3; - y0 = y3; - } - polygons.push(polygon); - } - return polygons; - } - - function getDividingGrids(dimSize, rowDim, count) { - var rowSize = dimSize[rowDim]; - var columnSize = dimSize[1 - rowDim]; - var ratio = Math.abs(rowSize / columnSize); - var rowCount = Math.ceil(Math.sqrt(ratio * count)); - var columnCount = Math.floor(count / rowCount); - if (columnCount === 0) { - columnCount = 1; - rowCount = count; - } - var grids = []; - for (var i = 0; i < rowCount; i++) { - grids.push(columnCount); - } - var currentCount = rowCount * columnCount; - var remained = count - currentCount; - if (remained > 0) { - for (var i = 0; i < remained; i++) { - grids[i % rowCount] += 1; - } - } - return grids; - } - function divideSector(sectorShape, count, outShapes) { - var r0 = sectorShape.r0; - var r = sectorShape.r; - var startAngle = sectorShape.startAngle; - var endAngle = sectorShape.endAngle; - var angle = Math.abs(endAngle - startAngle); - var arcLen = angle * r; - var deltaR = r - r0; - var isAngleRow = arcLen > Math.abs(deltaR); - var grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count); - var rowSize = (isAngleRow ? angle : deltaR) / grids.length; - for (var row = 0; row < grids.length; row++) { - var columnSize = (isAngleRow ? deltaR : angle) / grids[row]; - for (var column = 0; column < grids[row]; column++) { - var newShape = {}; - if (isAngleRow) { - newShape.startAngle = startAngle + rowSize * row; - newShape.endAngle = startAngle + rowSize * (row + 1); - newShape.r0 = r0 + columnSize * column; - newShape.r = r0 + columnSize * (column + 1); - } - else { - newShape.startAngle = startAngle + columnSize * column; - newShape.endAngle = startAngle + columnSize * (column + 1); - newShape.r0 = r0 + rowSize * row; - newShape.r = r0 + rowSize * (row + 1); - } - newShape.clockwise = sectorShape.clockwise; - newShape.cx = sectorShape.cx; - newShape.cy = sectorShape.cy; - outShapes.push(newShape); - } + } + optionUpdated() { + this._updateData(this.ecModel); + const legendData = this._data; + if (legendData[0] && this.get("selectedMode") === "single") { + let hasSelected = false; + for (let i = 0; i < legendData.length; i++) { + const name = legendData[i].get("name"); + if (this.isSelected(name)) { + this.select(name); + hasSelected = true; + break; } - } - function divideRect(rectShape, count, outShapes) { - var width = rectShape.width; - var height = rectShape.height; - var isHorizontalRow = width > height; - var grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count); - var rowSizeDim = isHorizontalRow ? 'width' : 'height'; - var columnSizeDim = isHorizontalRow ? 'height' : 'width'; - var rowDim = isHorizontalRow ? 'x' : 'y'; - var columnDim = isHorizontalRow ? 'y' : 'x'; - var rowSize = rectShape[rowSizeDim] / grids.length; - for (var row = 0; row < grids.length; row++) { - var columnSize = rectShape[columnSizeDim] / grids[row]; - for (var column = 0; column < grids[row]; column++) { - var newShape = {}; - newShape[rowDim] = row * rowSize; - newShape[columnDim] = column * columnSize; - newShape[rowSizeDim] = rowSize; - newShape[columnSizeDim] = columnSize; - newShape.x += rectShape.x; - newShape.y += rectShape.y; - outShapes.push(newShape); - } + } + !hasSelected && this.select(legendData[0].get("name")); + } + } + _updateData(ecModel) { + let potentialData = []; + let availableNames = []; + ecModel.eachRawSeries(function(seriesModel) { + const seriesName = seriesModel.name; + availableNames.push(seriesName); + let isPotential; + if (seriesModel.legendVisualProvider) { + const provider = seriesModel.legendVisualProvider; + const names = provider.getAllNames(); + if (!ecModel.isSeriesFiltered(seriesModel)) { + availableNames = availableNames.concat(names); + } + if (names.length) { + potentialData = potentialData.concat(names); + } else { + isPotential = true; } + } else { + isPotential = true; + } + if (isPotential && isNameSpecified(seriesModel)) { + potentialData.push(seriesModel.name); + } + }); + this._availableNames = availableNames; + const rawData = this.get("data") || potentialData; + const legendNameMap = createHashMap(); + const legendData = map(rawData, function(dataItem) { + if (isString(dataItem) || isNumber(dataItem)) { + dataItem = { + name: dataItem + }; + } + if (legendNameMap.get(dataItem.name)) { + return null; + } + legendNameMap.set(dataItem.name, true); + return new Model_default(dataItem, this, this.ecModel); + }, this); + this._data = filter(legendData, (item) => !!item); + } + getData() { + return this._data; + } + select(name) { + const selected = this.option.selected; + const selectedMode = this.get("selectedMode"); + if (selectedMode === "single") { + const data = this._data; + each(data, function(dataItem) { + selected[dataItem.get("name")] = false; + }); } - function crossProduct2d$1(x1, y1, x2, y2) { - return x1 * y2 - x2 * y1; - } - function lineLineIntersect$1(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { - var mx = a2x - a1x; - var my = a2y - a1y; - var nx = b2x - b1x; - var ny = b2y - b1y; - var nmCrossProduct = crossProduct2d$1(nx, ny, mx, my); - if (Math.abs(nmCrossProduct) < 1e-6) { - return null; - } - var b1a1x = a1x - b1x; - var b1a1y = a1y - b1y; - var p = crossProduct2d$1(b1a1x, b1a1y, nx, ny) / nmCrossProduct; - if (p < 0 || p > 1) { - return null; - } - return new Point(p * mx + a1x, p * my + a1y); - } - function projPtOnLine(pt, lineA, lineB) { - var dir = new Point(); - Point.sub(dir, lineB, lineA); - dir.normalize(); - var dir2 = new Point(); - Point.sub(dir2, pt, lineA); - var len = dir2.dot(dir); - return len; - } - function addToPoly(poly, pt) { - var last = poly[poly.length - 1]; - if (last && last[0] === pt[0] && last[1] === pt[1]) { - return; - } - poly.push(pt); - } - function splitPolygonByLine(points, lineA, lineB) { - var len = points.length; - var intersections = []; - for (var i = 0; i < len; i++) { - var p0 = points[i]; - var p1 = points[(i + 1) % len]; - var intersectionPt = lineLineIntersect$1(p0[0], p0[1], p1[0], p1[1], lineA.x, lineA.y, lineB.x, lineB.y); - if (intersectionPt) { - intersections.push({ - projPt: projPtOnLine(intersectionPt, lineA, lineB), - pt: intersectionPt, - idx: i - }); - } - } - if (intersections.length < 2) { - return [{ points: points }, { points: points }]; - } - intersections.sort(function (a, b) { - return a.projPt - b.projPt; - }); - var splitPt0 = intersections[0]; - var splitPt1 = intersections[intersections.length - 1]; - if (splitPt1.idx < splitPt0.idx) { - var tmp = splitPt0; - splitPt0 = splitPt1; - splitPt1 = tmp; - } - var splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y]; - var splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y]; - var newPolyA = [splitPt0Arr]; - var newPolyB = [splitPt1Arr]; - for (var i = splitPt0.idx + 1; i <= splitPt1.idx; i++) { - addToPoly(newPolyA, points[i].slice()); - } - addToPoly(newPolyA, splitPt1Arr); - addToPoly(newPolyA, splitPt0Arr); - for (var i = splitPt1.idx + 1; i <= splitPt0.idx + len; i++) { - addToPoly(newPolyB, points[i % len].slice()); - } - addToPoly(newPolyB, splitPt0Arr); - addToPoly(newPolyB, splitPt1Arr); - return [{ - points: newPolyA - }, { - points: newPolyB - }]; - } - function binaryDividePolygon(polygonShape) { - var points = polygonShape.points; - var min = []; - var max = []; - fromPoints(points, min, max); - var boundingRect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); - var width = boundingRect.width; - var height = boundingRect.height; - var x = boundingRect.x; - var y = boundingRect.y; - var pt0 = new Point(); - var pt1 = new Point(); - if (width > height) { - pt0.x = pt1.x = x + width / 2; - pt0.y = y; - pt1.y = y + height; - } - else { - pt0.y = pt1.y = y + height / 2; - pt0.x = x; - pt1.x = x + width; - } - return splitPolygonByLine(points, pt0, pt1); - } - function binaryDivideRecursive(divider, shape, count, out) { - if (count === 1) { - out.push(shape); - } - else { - var mid = Math.floor(count / 2); - var sub = divider(shape); - binaryDivideRecursive(divider, sub[0], mid, out); - binaryDivideRecursive(divider, sub[1], count - mid, out); - } - return out; - } - function clone$4(path, count) { - var paths = []; - for (var i = 0; i < count; i++) { - paths.push(clonePath(path)); - } - return paths; - } - function copyPathProps(source, target) { - target.setStyle(source.style); - target.z = source.z; - target.z2 = source.z2; - target.zlevel = source.zlevel; - } - function polygonConvert(points) { - var out = []; - for (var i = 0; i < points.length;) { - out.push([points[i++], points[i++]]); - } - return out; - } - function split(path, count) { - var outShapes = []; - var shape = path.shape; - var OutShapeCtor; - switch (path.type) { - case 'rect': - divideRect(shape, count, outShapes); - OutShapeCtor = Rect; - break; - case 'sector': - divideSector(shape, count, outShapes); - OutShapeCtor = Sector; - break; - case 'circle': - divideSector({ - r0: 0, r: shape.r, startAngle: 0, endAngle: Math.PI * 2, - cx: shape.cx, cy: shape.cy - }, count, outShapes); - OutShapeCtor = Sector; - break; - default: - var m = path.getComputedTransform(); - var scale = m ? Math.sqrt(Math.max(m[0] * m[0] + m[1] * m[1], m[2] * m[2] + m[3] * m[3])) : 1; - var polygons = map(pathToPolygons(path.getUpdatedPathProxy(), scale), function (poly) { return polygonConvert(poly); }); - var polygonCount = polygons.length; - if (polygonCount === 0) { - binaryDivideRecursive(binaryDividePolygon, { - points: polygons[0] - }, count, outShapes); - } - else if (polygonCount === count) { - for (var i = 0; i < polygonCount; i++) { - outShapes.push({ - points: polygons[i] - }); - } - } - else { - var totalArea_1 = 0; - var items = map(polygons, function (poly) { - var min = []; - var max = []; - fromPoints(poly, min, max); - var area = (max[1] - min[1]) * (max[0] - min[0]); - totalArea_1 += area; - return { poly: poly, area: area }; - }); - items.sort(function (a, b) { return b.area - a.area; }); - var left = count; - for (var i = 0; i < polygonCount; i++) { - var item = items[i]; - if (left <= 0) { - break; - } - var selfCount = i === polygonCount - 1 - ? left - : Math.ceil(item.area / totalArea_1 * count); - if (selfCount < 0) { - continue; - } - binaryDivideRecursive(binaryDividePolygon, { - points: item.poly - }, selfCount, outShapes); - left -= selfCount; - } - } - OutShapeCtor = Polygon; - break; - } - if (!OutShapeCtor) { - return clone$4(path, count); - } - var out = []; - for (var i = 0; i < outShapes.length; i++) { - var subPath = new OutShapeCtor(); - subPath.setShape(outShapes[i]); - copyPathProps(path, subPath); - out.push(subPath); - } - return out; - } - - function alignSubpath(subpath1, subpath2) { - var len1 = subpath1.length; - var len2 = subpath2.length; - if (len1 === len2) { - return [subpath1, subpath2]; - } - var tmpSegX = []; - var tmpSegY = []; - var shorterPath = len1 < len2 ? subpath1 : subpath2; - var shorterLen = Math.min(len1, len2); - var diff = Math.abs(len2 - len1) / 6; - var shorterBezierCount = (shorterLen - 2) / 6; - var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1; - var newSubpath = [shorterPath[0], shorterPath[1]]; - var remained = diff; - for (var i = 2; i < shorterLen;) { - var x0 = shorterPath[i - 2]; - var y0 = shorterPath[i - 1]; - var x1 = shorterPath[i++]; - var y1 = shorterPath[i++]; - var x2 = shorterPath[i++]; - var y2 = shorterPath[i++]; - var x3 = shorterPath[i++]; - var y3 = shorterPath[i++]; - if (remained <= 0) { - newSubpath.push(x1, y1, x2, y2, x3, y3); - continue; - } - var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1; - for (var k = 1; k <= actualSubDivCount; k++) { - var p = k / actualSubDivCount; - cubicSubdivide(x0, x1, x2, x3, p, tmpSegX); - cubicSubdivide(y0, y1, y2, y3, p, tmpSegY); - x0 = tmpSegX[3]; - y0 = tmpSegY[3]; - newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0); - x1 = tmpSegX[5]; - y1 = tmpSegY[5]; - x2 = tmpSegX[6]; - y2 = tmpSegY[6]; - } - remained -= actualSubDivCount - 1; - } - return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath]; - } - function createSubpath(lastSubpathSubpath, otherSubpath) { - var len = lastSubpathSubpath.length; - var lastX = lastSubpathSubpath[len - 2]; - var lastY = lastSubpathSubpath[len - 1]; - var newSubpath = []; - for (var i = 0; i < otherSubpath.length;) { - newSubpath[i++] = lastX; - newSubpath[i++] = lastY; - } - return newSubpath; - } - function alignBezierCurves(array1, array2) { - var _a; - var lastSubpath1; - var lastSubpath2; - var newArray1 = []; - var newArray2 = []; - for (var i = 0; i < Math.max(array1.length, array2.length); i++) { - var subpath1 = array1[i]; - var subpath2 = array2[i]; - var newSubpath1 = void 0; - var newSubpath2 = void 0; - if (!subpath1) { - newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2); - newSubpath2 = subpath2; - } - else if (!subpath2) { - newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1); - newSubpath1 = subpath1; - } - else { - _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1]; - lastSubpath1 = newSubpath1; - lastSubpath2 = newSubpath2; - } - newArray1.push(newSubpath1); - newArray2.push(newSubpath2); - } - return [newArray1, newArray2]; - } - function centroid$1(array) { - var signedArea = 0; - var cx = 0; - var cy = 0; - var len = array.length; - for (var i = 0, j = len - 2; i < len; j = i, i += 2) { - var x0 = array[j]; - var y0 = array[j + 1]; - var x1 = array[i]; - var y1 = array[i + 1]; - var a = x0 * y1 - x1 * y0; - signedArea += a; - cx += (x0 + x1) * a; - cy += (y0 + y1) * a; - } - if (signedArea === 0) { - return [array[0] || 0, array[1] || 0]; - } - return [cx / signedArea / 3, cy / signedArea / 3, signedArea]; - } - function findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) { - var bezierCount = (fromSubBeziers.length - 2) / 6; - var bestScore = Infinity; - var bestOffset = 0; - var len = fromSubBeziers.length; - var len2 = len - 2; - for (var offset = 0; offset < bezierCount; offset++) { - var cursorOffset = offset * 6; - var score = 0; - for (var k = 0; k < len; k += 2) { - var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2); - var x0 = fromSubBeziers[idx] - fromCp[0]; - var y0 = fromSubBeziers[idx + 1] - fromCp[1]; - var x1 = toSubBeziers[k] - toCp[0]; - var y1 = toSubBeziers[k + 1] - toCp[1]; - var dx = x1 - x0; - var dy = y1 - y0; - score += dx * dx + dy * dy; - } - if (score < bestScore) { - bestScore = score; - bestOffset = offset; - } + selected[name] = true; + } + unSelect(name) { + if (this.get("selectedMode") !== "single") { + this.option.selected[name] = false; + } + } + toggleSelected(name) { + const selected = this.option.selected; + if (!selected.hasOwnProperty(name)) { + selected[name] = true; + } + this[selected[name] ? "unSelect" : "select"](name); + } + allSelect() { + const data = this._data; + const selected = this.option.selected; + each(data, function(dataItem) { + selected[dataItem.get("name", true)] = true; + }); + } + inverseSelect() { + const data = this._data; + const selected = this.option.selected; + each(data, function(dataItem) { + const name = dataItem.get("name", true); + if (!selected.hasOwnProperty(name)) { + selected[name] = true; + } + selected[name] = !selected[name]; + }); + } + isSelected(name) { + const selected = this.option.selected; + return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0; + } + getOrient() { + return this.get("orient") === "vertical" ? {index: 1, name: "vertical"} : {index: 0, name: "horizontal"}; + } +}; +var LegendModel = LegendModel2; +LegendModel.type = "legend.plain"; +LegendModel.dependencies = ["series"]; +LegendModel.defaultOption = { + z: 4, + show: true, + orient: "horizontal", + left: "center", + top: 0, + align: "auto", + backgroundColor: "rgba(0,0,0,0)", + borderColor: "#ccc", + borderRadius: 0, + borderWidth: 0, + padding: 5, + itemGap: 10, + itemWidth: 25, + itemHeight: 14, + symbolRotate: "inherit", + symbolKeepAspect: true, + inactiveColor: "#ccc", + inactiveBorderColor: "#ccc", + inactiveBorderWidth: "auto", + itemStyle: { + color: "inherit", + opacity: "inherit", + borderColor: "inherit", + borderWidth: "auto", + borderCap: "inherit", + borderJoin: "inherit", + borderDashOffset: "inherit", + borderMiterLimit: "inherit" + }, + lineStyle: { + width: "auto", + color: "inherit", + inactiveColor: "#ccc", + inactiveWidth: 2, + opacity: "inherit", + type: "inherit", + cap: "inherit", + join: "inherit", + dashOffset: "inherit", + miterLimit: "inherit" + }, + textStyle: { + color: "#333" + }, + selectedMode: true, + selector: false, + selectorLabel: { + show: true, + borderRadius: 10, + padding: [3, 5, 3, 5], + fontSize: 12, + fontFamily: "sans-serif", + color: "#666", + borderWidth: 1, + borderColor: "#666" + }, + emphasis: { + selectorLabel: { + show: true, + color: "#eee", + backgroundColor: "#666" + } + }, + selectorPosition: "auto", + selectorItemGap: 7, + selectorButtonGap: 10, + tooltip: { + show: false + } +}; +var LegendModel_default = LegendModel; + +// src/component/legend/LegendView.ts +var curry2 = curry; +var each13 = each; +var Group3 = Group_default; +var LegendView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = LegendView2.type; + this.newlineDisabled = false; + } + init() { + this.group.add(this._contentGroup = new Group3()); + this.group.add(this._selectorGroup = new Group3()); + this._isFirstRender = true; + } + getContentGroup() { + return this._contentGroup; + } + getSelectorGroup() { + return this._selectorGroup; + } + render(legendModel, ecModel, api2) { + const isFirstRender = this._isFirstRender; + this._isFirstRender = false; + this.resetInner(); + if (!legendModel.get("show", true)) { + return; + } + let itemAlign = legendModel.get("align"); + const orient = legendModel.get("orient"); + if (!itemAlign || itemAlign === "auto") { + itemAlign = legendModel.get("left") === "right" && orient === "vertical" ? "right" : "left"; + } + const selector2 = legendModel.get("selector", true); + let selectorPosition = legendModel.get("selectorPosition", true); + if (selector2 && (!selectorPosition || selectorPosition === "auto")) { + selectorPosition = orient === "horizontal" ? "end" : "start"; + } + this.renderInner(itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition); + const positionInfo = legendModel.getBoxLayoutParams(); + const viewportSize = {width: api2.getWidth(), height: api2.getHeight()}; + const padding = legendModel.get("padding"); + const maxSize = getLayoutRect(positionInfo, viewportSize, padding); + const mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition); + const layoutRect = getLayoutRect(defaults({ + width: mainRect.width, + height: mainRect.height + }, positionInfo), viewportSize, padding); + this.group.x = layoutRect.x - mainRect.x; + this.group.y = layoutRect.y - mainRect.y; + this.group.markRedraw(); + this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel)); + } + resetInner() { + this.getContentGroup().removeAll(); + this._backgroundEl && this.group.remove(this._backgroundEl); + this.getSelectorGroup().removeAll(); + } + renderInner(itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition) { + const contentGroup = this.getContentGroup(); + const legendDrawnMap = createHashMap(); + const selectMode = legendModel.get("selectedMode"); + const excludeSeriesId = []; + ecModel.eachRawSeries(function(seriesModel) { + !seriesModel.get("legendHoverLink") && excludeSeriesId.push(seriesModel.id); + }); + each13(legendModel.getData(), function(legendItemModel, dataIndex) { + const name = legendItemModel.get("name"); + if (!this.newlineDisabled && (name === "" || name === "\n")) { + const g = new Group3(); + g.newline = true; + contentGroup.add(g); + return; + } + const seriesModel = ecModel.getSeriesByName(name)[0]; + if (legendDrawnMap.get(name)) { + return; + } + if (seriesModel) { + const data = seriesModel.getData(); + const lineVisualStyle = data.getVisual("legendLineStyle") || {}; + const legendIcon = data.getVisual("legendIcon"); + const style = data.getVisual("style"); + const itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api2); + itemGroup.on("click", curry2(dispatchSelectAction, name, null, api2, excludeSeriesId)).on("legendmouseover", curry2(dispatchHighlightAction, seriesModel.name, null, api2, excludeSeriesId)).on("mouseout", curry2(dispatchDownplayAction, seriesModel.name, null, api2, excludeSeriesId)); + if (ecModel.ssr) { + itemGroup.eachChild((child) => { + const ecData = getECData(child); + ecData.seriesIndex = seriesModel.seriesIndex; + ecData.dataIndex = dataIndex; + ecData.ssrType = "legend"; + }); } - return bestOffset; - } - function reverse(array) { - var newArr = []; - var len = array.length; - for (var i = 0; i < len; i += 2) { - newArr[i] = array[len - i - 2]; - newArr[i + 1] = array[len - i - 1]; - } - return newArr; - } - function findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) { - var result = []; - var fromNeedsReverse; - for (var i = 0; i < fromArr.length; i++) { - var fromSubpathBezier = fromArr[i]; - var toSubpathBezier = toArr[i]; - var fromCp = centroid$1(fromSubpathBezier); - var toCp = centroid$1(toSubpathBezier); - if (fromNeedsReverse == null) { - fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0; - } - var newFromSubpathBezier = []; - var newToSubpathBezier = []; - var bestAngle = 0; - var bestScore = Infinity; - var tmpArr = []; - var len = fromSubpathBezier.length; - if (fromNeedsReverse) { - fromSubpathBezier = reverse(fromSubpathBezier); - } - var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6; - var len2 = len - 2; - for (var k = 0; k < len2; k += 2) { - var idx = (offset + k) % len2 + 2; - newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0]; - newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1]; + legendDrawnMap.set(name, true); + } else { + ecModel.eachRawSeries(function(seriesModel2) { + if (legendDrawnMap.get(name)) { + return; + } + if (seriesModel2.legendVisualProvider) { + const provider = seriesModel2.legendVisualProvider; + if (!provider.containName(name)) { + return; } - newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0]; - newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1]; - if (searchAngleIteration > 0) { - var step = searchAngleRange / searchAngleIteration; - for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) { - var sa = Math.sin(angle); - var ca = Math.cos(angle); - var score = 0; - for (var k = 0; k < fromSubpathBezier.length; k += 2) { - var x0 = newFromSubpathBezier[k]; - var y0 = newFromSubpathBezier[k + 1]; - var x1 = toSubpathBezier[k] - toCp[0]; - var y1 = toSubpathBezier[k + 1] - toCp[1]; - var newX1 = x1 * ca - y1 * sa; - var newY1 = x1 * sa + y1 * ca; - tmpArr[k] = newX1; - tmpArr[k + 1] = newY1; - var dx = newX1 - x0; - var dy = newY1 - y0; - score += dx * dx + dy * dy; - } - if (score < bestScore) { - bestScore = score; - bestAngle = angle; - for (var m = 0; m < tmpArr.length; m++) { - newToSubpathBezier[m] = tmpArr[m]; - } - } - } + const idx = provider.indexOfName(name); + let style = provider.getItemVisual(idx, "style"); + const legendIcon = provider.getItemVisual(idx, "legendIcon"); + const colorArr = parse(style.fill); + if (colorArr && colorArr[3] === 0) { + colorArr[3] = 0.2; + style = extend(extend({}, style), {fill: stringify(colorArr, "rgba")}); } - else { - for (var i_1 = 0; i_1 < len; i_1 += 2) { - newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0]; - newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1]; - } + const itemGroup = this._createItem(seriesModel2, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode, api2); + itemGroup.on("click", curry2(dispatchSelectAction, null, name, api2, excludeSeriesId)).on("legendmouseover", curry2(dispatchHighlightAction, null, name, api2, excludeSeriesId)).on("mouseout", curry2(dispatchDownplayAction, null, name, api2, excludeSeriesId)); + if (ecModel.ssr) { + itemGroup.eachChild((child) => { + const ecData = getECData(child); + ecData.seriesIndex = seriesModel2.seriesIndex; + ecData.dataIndex = dataIndex; + ecData.ssrType = "legend"; + }); } - result.push({ - from: newFromSubpathBezier, - to: newToSubpathBezier, - fromCp: fromCp, - toCp: toCp, - rotation: -bestAngle - }); + legendDrawnMap.set(name, true); + } + }, this); + } + if (true) { + if (!legendDrawnMap.get(name)) { + console.warn(name + " series not exists. Legend data should be same with series name or data name."); } - return result; - } - function isCombineMorphing(path) { - return path.__isCombineMorphing; - } - var SAVED_METHOD_PREFIX = '__mOriginal_'; - function saveAndModifyMethod(obj, methodName, modifiers) { - var savedMethodName = SAVED_METHOD_PREFIX + methodName; - var originalMethod = obj[savedMethodName] || obj[methodName]; - if (!obj[savedMethodName]) { - obj[savedMethodName] = obj[methodName]; - } - var replace = modifiers.replace; - var after = modifiers.after; - var before = modifiers.before; - obj[methodName] = function () { - var args = arguments; - var res; - before && before.apply(this, args); - if (replace) { - res = replace.apply(this, args); - } - else { - res = originalMethod.apply(this, args); - } - after && after.apply(this, args); - return res; - }; + } + }, this); + if (selector2) { + this._createSelector(selector2, legendModel, api2, orient, selectorPosition); } - function restoreMethod(obj, methodName) { - var savedMethodName = SAVED_METHOD_PREFIX + methodName; - if (obj[savedMethodName]) { - obj[methodName] = obj[savedMethodName]; - obj[savedMethodName] = null; - } - } - function applyTransformOnBeziers(bezierCurves, mm) { - for (var i = 0; i < bezierCurves.length; i++) { - var subBeziers = bezierCurves[i]; - for (var k = 0; k < subBeziers.length;) { - var x = subBeziers[k]; - var y = subBeziers[k + 1]; - subBeziers[k++] = mm[0] * x + mm[2] * y + mm[4]; - subBeziers[k++] = mm[1] * x + mm[3] * y + mm[5]; - } + } + _createSelector(selector2, legendModel, api2, orient, selectorPosition) { + const selectorGroup = this.getSelectorGroup(); + each13(selector2, function createSelectorButton(selectorItem) { + const type = selectorItem.type; + const labelText = new Text_default({ + style: { + x: 0, + y: 0, + align: "center", + verticalAlign: "middle" + }, + onclick() { + api2.dispatchAction({ + type: type === "all" ? "legendAllSelect" : "legendInverseSelect", + legendId: legendModel.id + }); } + }); + selectorGroup.add(labelText); + const labelModel = legendModel.getModel("selectorLabel"); + const emphasisLabelModel = legendModel.getModel(["emphasis", "selectorLabel"]); + setLabelStyle(labelText, {normal: labelModel, emphasis: emphasisLabelModel}, { + defaultText: selectorItem.title + }); + enableHoverEmphasis(labelText); + }); + } + _createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api2) { + const drawType = seriesModel.visualDrawType; + const itemWidth = legendModel.get("itemWidth"); + const itemHeight = legendModel.get("itemHeight"); + const isSelected = legendModel.isSelected(name); + const iconRotate = legendItemModel.get("symbolRotate"); + const symbolKeepAspect = legendItemModel.get("symbolKeepAspect"); + const legendIconType = legendItemModel.get("icon"); + legendIcon = legendIconType || legendIcon || "roundRect"; + const style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api2); + const itemGroup = new Group3(); + const textStyleModel = legendItemModel.getModel("textStyle"); + if (isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === "inherit")) { + itemGroup.add(seriesModel.getLegendIcon({ + itemWidth, + itemHeight, + icon: legendIcon, + iconRotate, + itemStyle: style.itemStyle, + lineStyle: style.lineStyle, + symbolKeepAspect + })); + } else { + const rotate2 = legendIconType === "inherit" && seriesModel.getData().getVisual("symbol") ? iconRotate === "inherit" ? seriesModel.getData().getVisual("symbolRotate") : iconRotate : 0; + itemGroup.add(getDefaultLegendIcon({ + itemWidth, + itemHeight, + icon: legendIcon, + iconRotate: rotate2, + itemStyle: style.itemStyle, + lineStyle: style.lineStyle, + symbolKeepAspect + })); } - function prepareMorphPath(fromPath, toPath) { - var fromPathProxy = fromPath.getUpdatedPathProxy(); - var toPathProxy = toPath.getUpdatedPathProxy(); - var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1]; - var fromPathTransform = fromPath.getComputedTransform(); - var toPathTransform = toPath.getComputedTransform(); - function updateIdentityTransform() { - this.transform = null; - } - fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform); - toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform); - saveAndModifyMethod(toPath, 'updateTransform', { replace: updateIdentityTransform }); - toPath.transform = null; - var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI); - var tmpArr = []; - saveAndModifyMethod(toPath, 'buildPath', { replace: function (path) { - var t = toPath.__morphT; - var onet = 1 - t; - var newCp = []; - for (var i = 0; i < morphingData.length; i++) { - var item = morphingData[i]; - var from = item.from; - var to = item.to; - var angle = item.rotation * t; - var fromCp = item.fromCp; - var toCp = item.toCp; - var sa = Math.sin(angle); - var ca = Math.cos(angle); - lerp(newCp, fromCp, toCp, t); - for (var m = 0; m < from.length; m += 2) { - var x0_1 = from[m]; - var y0_1 = from[m + 1]; - var x1 = to[m]; - var y1 = to[m + 1]; - var x = x0_1 * onet + x1 * t; - var y = y0_1 * onet + y1 * t; - tmpArr[m] = (x * ca - y * sa) + newCp[0]; - tmpArr[m + 1] = (x * sa + y * ca) + newCp[1]; - } - var x0 = tmpArr[0]; - var y0 = tmpArr[1]; - path.moveTo(x0, y0); - for (var m = 2; m < from.length;) { - var x1 = tmpArr[m++]; - var y1 = tmpArr[m++]; - var x2 = tmpArr[m++]; - var y2 = tmpArr[m++]; - var x3 = tmpArr[m++]; - var y3 = tmpArr[m++]; - if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) { - path.lineTo(x3, y3); - } - else { - path.bezierCurveTo(x1, y1, x2, y2, x3, y3); - } - x0 = x3; - y0 = y3; - } - } - } }); - } - function morphPath(fromPath, toPath, animationOpts) { - if (!fromPath || !toPath) { - return toPath; - } - var oldDone = animationOpts.done; - var oldDuring = animationOpts.during; - prepareMorphPath(fromPath, toPath); - toPath.__morphT = 0; - function restoreToPath() { - restoreMethod(toPath, 'buildPath'); - restoreMethod(toPath, 'updateTransform'); - toPath.__morphT = -1; - toPath.createPathProxy(); - toPath.dirtyShape(); - } - toPath.animateTo({ - __morphT: 1 - }, defaults({ - during: function (p) { - toPath.dirtyShape(); - oldDuring && oldDuring(p); - }, - done: function () { - restoreToPath(); - oldDone && oldDone(); - } - }, animationOpts)); - return toPath; - } - function hilbert(x, y, minX, minY, maxX, maxY) { - var bits = 16; - x = (maxX === minX) ? 0 : Math.round(32767 * (x - minX) / (maxX - minX)); - y = (maxY === minY) ? 0 : Math.round(32767 * (y - minY) / (maxY - minY)); - var d = 0; - var tmp; - for (var s = (1 << bits) / 2; s > 0; s /= 2) { - var rx = 0; - var ry = 0; - if ((x & s) > 0) { - rx = 1; - } - if ((y & s) > 0) { - ry = 1; - } - d += s * s * ((3 * rx) ^ ry); - if (ry === 0) { - if (rx === 1) { - x = s - 1 - x; - y = s - 1 - y; - } - tmp = x; - x = y; - y = tmp; - } + const textX = itemAlign === "left" ? itemWidth + 5 : -5; + const textAlign = itemAlign; + const formatter = legendModel.get("formatter"); + let content = name; + if (isString(formatter) && formatter) { + content = formatter.replace("{name}", name != null ? name : ""); + } else if (isFunction(formatter)) { + content = formatter(name); + } + const textColor = isSelected ? textStyleModel.getTextColor() : legendItemModel.get("inactiveColor"); + itemGroup.add(new Text_default({ + style: createTextStyle(textStyleModel, { + text: content, + x: textX, + y: itemHeight / 2, + fill: textColor, + align: textAlign, + verticalAlign: "middle" + }, {inheritColor: textColor}) + })); + const hitRect = new Rect_default({ + shape: itemGroup.getBoundingRect(), + style: { + fill: "transparent" + } + }); + const tooltipModel = legendItemModel.getModel("tooltip"); + if (tooltipModel.get("show")) { + setTooltipConfig({ + el: hitRect, + componentModel: legendModel, + itemName: name, + itemTooltipOption: tooltipModel.option + }); + } + itemGroup.add(hitRect); + itemGroup.eachChild(function(child) { + child.silent = true; + }); + hitRect.silent = !selectMode; + this.getContentGroup().add(itemGroup); + enableHoverEmphasis(itemGroup); + itemGroup.__legendDataIndex = dataIndex; + return itemGroup; + } + layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) { + const contentGroup = this.getContentGroup(); + const selectorGroup = this.getSelectorGroup(); + box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), maxSize.width, maxSize.height); + const contentRect = contentGroup.getBoundingRect(); + const contentPos = [-contentRect.x, -contentRect.y]; + selectorGroup.markRedraw(); + contentGroup.markRedraw(); + if (selector2) { + box("horizontal", selectorGroup, legendModel.get("selectorItemGap", true)); + const selectorRect = selectorGroup.getBoundingRect(); + const selectorPos = [-selectorRect.x, -selectorRect.y]; + const selectorButtonGap = legendModel.get("selectorButtonGap", true); + const orientIdx = legendModel.getOrient().index; + const wh = orientIdx === 0 ? "width" : "height"; + const hw = orientIdx === 0 ? "height" : "width"; + const yx = orientIdx === 0 ? "y" : "x"; + if (selectorPosition === "end") { + selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap; + } else { + contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap; + } + selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2; + selectorGroup.x = selectorPos[0]; + selectorGroup.y = selectorPos[1]; + contentGroup.x = contentPos[0]; + contentGroup.y = contentPos[1]; + const mainRect = {x: 0, y: 0}; + mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh]; + mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]); + mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]); + return mainRect; + } else { + contentGroup.x = contentPos[0]; + contentGroup.y = contentPos[1]; + return this.group.getBoundingRect(); + } + } + remove() { + this.getContentGroup().removeAll(); + this._isFirstRender = true; + } +}; +var LegendView = LegendView2; +LegendView.type = "legend.plain"; +function getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api2) { + function handleCommonProps(style, visualStyle) { + if (style.lineWidth === "auto") { + style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0; + } + each13(style, (propVal, propName) => { + style[propName] === "inherit" && (style[propName] = visualStyle[propName]); + }); + } + const itemStyleModel = legendItemModel.getModel("itemStyle"); + const itemStyle = itemStyleModel.getItemStyle(); + const iconBrushType = iconType.lastIndexOf("empty", 0) === 0 ? "fill" : "stroke"; + const decalStyle = itemStyleModel.getShallow("decal"); + itemStyle.decal = !decalStyle || decalStyle === "inherit" ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api2); + if (itemStyle.fill === "inherit") { + itemStyle.fill = itemVisualStyle[drawType]; + } + if (itemStyle.stroke === "inherit") { + itemStyle.stroke = itemVisualStyle[iconBrushType]; + } + if (itemStyle.opacity === "inherit") { + itemStyle.opacity = (drawType === "fill" ? itemVisualStyle : lineVisualStyle).opacity; + } + handleCommonProps(itemStyle, itemVisualStyle); + const legendLineModel = legendItemModel.getModel("lineStyle"); + const lineStyle = legendLineModel.getLineStyle(); + handleCommonProps(lineStyle, lineVisualStyle); + itemStyle.fill === "auto" && (itemStyle.fill = itemVisualStyle.fill); + itemStyle.stroke === "auto" && (itemStyle.stroke = itemVisualStyle.fill); + lineStyle.stroke === "auto" && (lineStyle.stroke = itemVisualStyle.fill); + if (!isSelected) { + const borderWidth = legendItemModel.get("inactiveBorderWidth"); + const visualHasBorder = itemStyle[iconBrushType]; + itemStyle.lineWidth = borderWidth === "auto" ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth; + itemStyle.fill = legendItemModel.get("inactiveColor"); + itemStyle.stroke = legendItemModel.get("inactiveBorderColor"); + lineStyle.stroke = legendLineModel.get("inactiveColor"); + lineStyle.lineWidth = legendLineModel.get("inactiveWidth"); + } + return {itemStyle, lineStyle}; +} +function getDefaultLegendIcon(opt) { + const symboType = opt.icon || "roundRect"; + const icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect); + icon.setStyle(opt.itemStyle); + icon.rotation = (opt.iconRotate || 0) * Math.PI / 180; + icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); + if (symboType.indexOf("empty") > -1) { + icon.style.stroke = icon.style.fill; + icon.style.fill = "#fff"; + icon.style.lineWidth = 2; + } + return icon; +} +function dispatchSelectAction(seriesName, dataName, api2, excludeSeriesId) { + dispatchDownplayAction(seriesName, dataName, api2, excludeSeriesId); + api2.dispatchAction({ + type: "legendToggleSelect", + name: seriesName != null ? seriesName : dataName + }); + dispatchHighlightAction(seriesName, dataName, api2, excludeSeriesId); +} +function isUseHoverLayer(api2) { + const list = api2.getZr().storage.getDisplayList(); + let emphasisState; + let i = 0; + const len2 = list.length; + while (i < len2 && !(emphasisState = list[i].states.emphasis)) { + i++; + } + return emphasisState && emphasisState.hoverLayer; +} +function dispatchHighlightAction(seriesName, dataName, api2, excludeSeriesId) { + if (!isUseHoverLayer(api2)) { + api2.dispatchAction({ + type: "highlight", + seriesName, + name: dataName, + excludeSeriesId + }); + } +} +function dispatchDownplayAction(seriesName, dataName, api2, excludeSeriesId) { + if (!isUseHoverLayer(api2)) { + api2.dispatchAction({ + type: "downplay", + seriesName, + name: dataName, + excludeSeriesId + }); + } +} +var LegendView_default = LegendView; + +// src/component/legend/legendFilter.ts +function legendFilter(ecModel) { + const legendModels = ecModel.findComponents({ + mainType: "legend" + }); + if (legendModels && legendModels.length) { + ecModel.filterSeries(function(series) { + for (let i = 0; i < legendModels.length; i++) { + if (!legendModels[i].isSelected(series.name)) { + return false; } - return d; - } - function sortPaths(pathList) { - var xMin = Infinity; - var yMin = Infinity; - var xMax = -Infinity; - var yMax = -Infinity; - var cps = map(pathList, function (path) { - var rect = path.getBoundingRect(); - var m = path.getComputedTransform(); - var x = rect.x + rect.width / 2 + (m ? m[4] : 0); - var y = rect.y + rect.height / 2 + (m ? m[5] : 0); - xMin = Math.min(x, xMin); - yMin = Math.min(y, yMin); - xMax = Math.max(x, xMax); - yMax = Math.max(y, yMax); - return [x, y]; - }); - var items = map(cps, function (cp, idx) { - return { - cp: cp, - z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax), - path: pathList[idx] - }; + } + return true; + }); + } +} + +// src/component/legend/legendAction.ts +function legendSelectActionHandler(methodName, payload, ecModel) { + const isAllSelect = methodName === "allSelect" || methodName === "inverseSelect"; + const selectedMap = {}; + const actionLegendIndices = []; + ecModel.eachComponent({mainType: "legend", query: payload}, function(legendModel) { + if (isAllSelect) { + legendModel[methodName](); + } else { + legendModel[methodName](payload.name); + } + makeSelectedMap(legendModel, selectedMap); + actionLegendIndices.push(legendModel.componentIndex); + }); + const allSelectedMap = {}; + ecModel.eachComponent("legend", function(legendModel) { + each(selectedMap, function(isSelected, name) { + legendModel[isSelected ? "select" : "unSelect"](name); + }); + makeSelectedMap(legendModel, allSelectedMap); + }); + return isAllSelect ? { + selected: allSelectedMap, + legendIndex: actionLegendIndices + } : { + name: payload.name, + selected: allSelectedMap + }; +} +function makeSelectedMap(legendModel, out2) { + const selectedMap = out2 || {}; + each(legendModel.getData(), function(model) { + const name = model.get("name"); + if (name === "\n" || name === "") { + return; + } + const isItemSelected = legendModel.isSelected(name); + if (hasOwn(selectedMap, name)) { + selectedMap[name] = selectedMap[name] && isItemSelected; + } else { + selectedMap[name] = isItemSelected; + } + }); + return selectedMap; +} +function installLegendAction(registers) { + registers.registerAction("legendToggleSelect", "legendselectchanged", curry(legendSelectActionHandler, "toggleSelected")); + registers.registerAction("legendAllSelect", "legendselectall", curry(legendSelectActionHandler, "allSelect")); + registers.registerAction("legendInverseSelect", "legendinverseselect", curry(legendSelectActionHandler, "inverseSelect")); + registers.registerAction("legendSelect", "legendselected", curry(legendSelectActionHandler, "select")); + registers.registerAction("legendUnSelect", "legendunselected", curry(legendSelectActionHandler, "unSelect")); +} + +// src/component/legend/installLegendPlain.ts +function install44(registers) { + registers.registerComponentModel(LegendModel_default); + registers.registerComponentView(LegendView_default); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter); + registers.registerSubTypeDefaulter("legend", function() { + return "plain"; + }); + installLegendAction(registers); +} + +// src/component/legend/ScrollableLegendModel.ts +var ScrollableLegendModel2 = class extends LegendModel_default { + constructor() { + super(...arguments); + this.type = ScrollableLegendModel2.type; + } + setScrollDataIndex(scrollDataIndex) { + this.option.scrollDataIndex = scrollDataIndex; + } + init(option, parentModel, ecModel) { + const inputPositionParams = getLayoutParams(option); + super.init(option, parentModel, ecModel); + mergeAndNormalizeLayoutParams2(this, option, inputPositionParams); + } + mergeOption(option, ecModel) { + super.mergeOption(option, ecModel); + mergeAndNormalizeLayoutParams2(this, this.option, option); + } +}; +var ScrollableLegendModel = ScrollableLegendModel2; +ScrollableLegendModel.type = "legend.scroll"; +ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel_default.defaultOption, { + scrollDataIndex: 0, + pageButtonItemGap: 5, + pageButtonGap: null, + pageButtonPosition: "end", + pageFormatter: "{current}/{total}", + pageIcons: { + horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"], + vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"] + }, + pageIconColor: "#2f4554", + pageIconInactiveColor: "#aaa", + pageIconSize: 15, + pageTextStyle: { + color: "#333" + }, + animationDurationUpdate: 800 +}); +function mergeAndNormalizeLayoutParams2(legendModel, target, raw) { + const orient = legendModel.getOrient(); + const ignoreSize = [1, 1]; + ignoreSize[orient.index] = 0; + mergeLayoutParam(target, raw, { + type: "box", + ignoreSize: !!ignoreSize + }); +} +var ScrollableLegendModel_default = ScrollableLegendModel; + +// src/component/legend/ScrollableLegendView.ts +var Group4 = Group_default; +var WH2 = ["width", "height"]; +var XY2 = ["x", "y"]; +var ScrollableLegendView2 = class extends LegendView_default { + constructor() { + super(...arguments); + this.type = ScrollableLegendView2.type; + this.newlineDisabled = true; + this._currentIndex = 0; + } + init() { + super.init(); + this.group.add(this._containerGroup = new Group4()); + this._containerGroup.add(this.getContentGroup()); + this.group.add(this._controllerGroup = new Group4()); + } + resetInner() { + super.resetInner(); + this._controllerGroup.removeAll(); + this._containerGroup.removeClipPath(); + this._containerGroup.__rectSize = null; + } + renderInner(itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition) { + const self2 = this; + super.renderInner(itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition); + const controllerGroup = this._controllerGroup; + const pageIconSize = legendModel.get("pageIconSize", true); + const pageIconSizeArr = isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize]; + createPageButton("pagePrev", 0); + const pageTextStyleModel = legendModel.getModel("pageTextStyle"); + controllerGroup.add(new Text_default({ + name: "pageText", + style: { + text: "xx/xx", + fill: pageTextStyleModel.getTextColor(), + font: pageTextStyleModel.getFont(), + verticalAlign: "middle", + align: "center" + }, + silent: true + })); + createPageButton("pageNext", 1); + function createPageButton(name, iconIdx) { + const pageDataIndexName = name + "DataIndex"; + const icon = createIcon(legendModel.get("pageIcons", true)[legendModel.getOrient().name][iconIdx], { + onclick: bind(self2._pageGo, self2, pageDataIndexName, legendModel, api2) + }, { + x: -pageIconSizeArr[0] / 2, + y: -pageIconSizeArr[1] / 2, + width: pageIconSizeArr[0], + height: pageIconSizeArr[1] + }); + icon.name = name; + controllerGroup.add(icon); + } + } + layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) { + const selectorGroup = this.getSelectorGroup(); + const orientIdx = legendModel.getOrient().index; + const wh = WH2[orientIdx]; + const xy = XY2[orientIdx]; + const hw = WH2[1 - orientIdx]; + const yx = XY2[1 - orientIdx]; + selector2 && box("horizontal", selectorGroup, legendModel.get("selectorItemGap", true)); + const selectorButtonGap = legendModel.get("selectorButtonGap", true); + const selectorRect = selectorGroup.getBoundingRect(); + const selectorPos = [-selectorRect.x, -selectorRect.y]; + const processMaxSize = clone(maxSize); + selector2 && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap); + const mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy); + if (selector2) { + if (selectorPosition === "end") { + selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap; + } else { + const offset = selectorRect[wh] + selectorButtonGap; + selectorPos[orientIdx] -= offset; + mainRect[xy] -= offset; + } + mainRect[wh] += selectorRect[wh] + selectorButtonGap; + selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2; + mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]); + mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]); + selectorGroup.x = selectorPos[0]; + selectorGroup.y = selectorPos[1]; + selectorGroup.markRedraw(); + } + return mainRect; + } + _layoutContentAndController(legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) { + const contentGroup = this.getContentGroup(); + const containerGroup = this._containerGroup; + const controllerGroup = this._controllerGroup; + box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height); + box("horizontal", controllerGroup, legendModel.get("pageButtonItemGap", true)); + const contentRect = contentGroup.getBoundingRect(); + const controllerRect = controllerGroup.getBoundingRect(); + const showController = this._showController = contentRect[wh] > maxSize[wh]; + const contentPos = [-contentRect.x, -contentRect.y]; + if (!isFirstRender) { + contentPos[orientIdx] = contentGroup[xy]; + } + const containerPos = [0, 0]; + const controllerPos = [-controllerRect.x, -controllerRect.y]; + const pageButtonGap = retrieve2(legendModel.get("pageButtonGap", true), legendModel.get("itemGap", true)); + if (showController) { + const pageButtonPosition = legendModel.get("pageButtonPosition", true); + if (pageButtonPosition === "end") { + controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; + } else { + containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; + } + } + controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; + contentGroup.setPosition(contentPos); + containerGroup.setPosition(containerPos); + controllerGroup.setPosition(controllerPos); + const mainRect = {x: 0, y: 0}; + mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; + mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); + mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); + containerGroup.__rectSize = maxSize[wh]; + if (showController) { + const clipShape = {x: 0, y: 0}; + clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); + clipShape[hw] = mainRect[hw]; + containerGroup.setClipPath(new Rect_default({shape: clipShape})); + containerGroup.__rectSize = clipShape[wh]; + } else { + controllerGroup.eachChild(function(child) { + child.attr({ + invisible: true, + silent: true }); - return items.sort(function (a, b) { return a.z - b.z; }).map(function (item) { return item.path; }); - } - function defaultDividePath(param) { - return split(param.path, param.count); + }); } - function createEmptyReturn() { - return { - fromIndividuals: [], - toIndividuals: [], - count: 0 - }; + const pageInfo = this._getPageInfo(legendModel); + pageInfo.pageIndex != null && updateProps(contentGroup, {x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1]}, showController ? legendModel : null); + this._updatePageInfoView(legendModel, pageInfo); + return mainRect; + } + _pageGo(to, legendModel, api2) { + const scrollDataIndex = this._getPageInfo(legendModel)[to]; + scrollDataIndex != null && api2.dispatchAction({ + type: "legendScroll", + scrollDataIndex, + legendId: legendModel.id + }); + } + _updatePageInfoView(legendModel, pageInfo) { + const controllerGroup = this._controllerGroup; + each(["pagePrev", "pageNext"], function(name) { + const key = name + "DataIndex"; + const canJump = pageInfo[key] != null; + const icon = controllerGroup.childOfName(name); + if (icon) { + icon.setStyle("fill", canJump ? legendModel.get("pageIconColor", true) : legendModel.get("pageIconInactiveColor", true)); + icon.cursor = canJump ? "pointer" : "default"; + } + }); + const pageText = controllerGroup.childOfName("pageText"); + const pageFormatter = legendModel.get("pageFormatter"); + const pageIndex = pageInfo.pageIndex; + const current = pageIndex != null ? pageIndex + 1 : 0; + const total = pageInfo.pageCount; + pageText && pageFormatter && pageText.setStyle("text", isString(pageFormatter) ? pageFormatter.replace("{current}", current == null ? "" : current + "").replace("{total}", total == null ? "" : total + "") : pageFormatter({current, total})); + } + _getPageInfo(legendModel) { + const scrollDataIndex = legendModel.get("scrollDataIndex", true); + const contentGroup = this.getContentGroup(); + const containerRectSize = this._containerGroup.__rectSize; + const orientIdx = legendModel.getOrient().index; + const wh = WH2[orientIdx]; + const xy = XY2[orientIdx]; + const targetItemIndex = this._findTargetItemIndex(scrollDataIndex); + const children = contentGroup.children(); + const targetItem = children[targetItemIndex]; + const itemCount = children.length; + const pCount = !itemCount ? 0 : 1; + const result = { + contentPosition: [contentGroup.x, contentGroup.y], + pageCount: pCount, + pageIndex: pCount - 1, + pagePrevDataIndex: null, + pageNextDataIndex: null + }; + if (!targetItem) { + return result; } - function combineMorph(fromList, toPath, animationOpts) { - var fromPathList = []; - function addFromPath(fromList) { - for (var i = 0; i < fromList.length; i++) { - var from = fromList[i]; - if (isCombineMorphing(from)) { - addFromPath(from.childrenRef()); - } - else if (from instanceof Path) { - fromPathList.push(from); - } - } + const targetItemInfo = getItemInfo(targetItem); + result.contentPosition[orientIdx] = -targetItemInfo.s; + for (let i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) { + currItemInfo = getItemInfo(children[i]); + if (!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || currItemInfo && !intersect2(currItemInfo, winStartItemInfo.s)) { + if (winEndItemInfo.i > winStartItemInfo.i) { + winStartItemInfo = winEndItemInfo; + } else { + winStartItemInfo = currItemInfo; } - addFromPath(fromList); - var separateCount = fromPathList.length; - if (!separateCount) { - return createEmptyReturn(); + if (winStartItemInfo) { + if (result.pageNextDataIndex == null) { + result.pageNextDataIndex = winStartItemInfo.i; + } + ++result.pageCount; } - var dividePath = animationOpts.dividePath || defaultDividePath; - var toSubPathList = dividePath({ - path: toPath, count: separateCount - }); - if (toSubPathList.length !== separateCount) { - console.error('Invalid morphing: unmatched splitted path'); - return createEmptyReturn(); - } - fromPathList = sortPaths(fromPathList); - toSubPathList = sortPaths(toSubPathList); - var oldDone = animationOpts.done; - var oldDuring = animationOpts.during; - var individualDelay = animationOpts.individualDelay; - var identityTransform = new Transformable(); - for (var i = 0; i < separateCount; i++) { - var from = fromPathList[i]; - var to = toSubPathList[i]; - to.parent = toPath; - to.copyTransform(identityTransform); - if (!individualDelay) { - prepareMorphPath(from, to); - } + } + winEndItemInfo = currItemInfo; + } + for (let i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) { + currItemInfo = getItemInfo(children[i]); + if ((!currItemInfo || !intersect2(winEndItemInfo, currItemInfo.s)) && winStartItemInfo.i < winEndItemInfo.i) { + winEndItemInfo = winStartItemInfo; + if (result.pagePrevDataIndex == null) { + result.pagePrevDataIndex = winStartItemInfo.i; } - toPath.__isCombineMorphing = true; - toPath.childrenRef = function () { - return toSubPathList; + ++result.pageCount; + ++result.pageIndex; + } + winStartItemInfo = currItemInfo; + } + return result; + function getItemInfo(el) { + if (el) { + const itemRect = el.getBoundingRect(); + const start2 = itemRect[xy] + el[xy]; + return { + s: start2, + e: start2 + itemRect[wh], + i: el.__legendDataIndex }; - function addToSubPathListToZr(zr) { - for (var i = 0; i < toSubPathList.length; i++) { - toSubPathList[i].addSelfToZr(zr); - } + } + } + function intersect2(itemInfo, winStart) { + return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize; + } + } + _findTargetItemIndex(targetDataIndex) { + if (!this._showController) { + return 0; + } + let index; + const contentGroup = this.getContentGroup(); + let defaultIndex; + contentGroup.eachChild(function(child, idx) { + const legendDataIdx = child.__legendDataIndex; + if (defaultIndex == null && legendDataIdx != null) { + defaultIndex = idx; + } + if (legendDataIdx === targetDataIndex) { + index = idx; + } + }); + return index != null ? index : defaultIndex; + } +}; +var ScrollableLegendView = ScrollableLegendView2; +ScrollableLegendView.type = "legend.scroll"; +var ScrollableLegendView_default = ScrollableLegendView; + +// src/component/legend/scrollableLegendAction.ts +function installScrollableLegendAction(registers) { + registers.registerAction("legendScroll", "legendscroll", function(payload, ecModel) { + const scrollDataIndex = payload.scrollDataIndex; + scrollDataIndex != null && ecModel.eachComponent({mainType: "legend", subType: "scroll", query: payload}, function(legendModel) { + legendModel.setScrollDataIndex(scrollDataIndex); + }); + }); +} + +// src/component/legend/installLegendScroll.ts +function install45(registers) { + use(install44); + registers.registerComponentModel(ScrollableLegendModel_default); + registers.registerComponentView(ScrollableLegendView_default); + installScrollableLegendAction(registers); +} + +// src/component/legend/install.ts +function install46(registers) { + use(install44); + use(install45); +} + +// src/component/dataZoom/InsideZoomModel.ts +var InsideZoomModel2 = class extends DataZoomModel_default { + constructor() { + super(...arguments); + this.type = InsideZoomModel2.type; + } +}; +var InsideZoomModel = InsideZoomModel2; +InsideZoomModel.type = "dataZoom.inside"; +InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel_default.defaultOption, { + disabled: false, + zoomLock: false, + zoomOnMouseWheel: true, + moveOnMouseMove: true, + moveOnMouseWheel: false, + preventDefaultMouseMove: true +}); +var InsideZoomModel_default = InsideZoomModel; + +// src/component/dataZoom/roams.ts +var inner21 = makeInner(); +function setViewInfoToCoordSysRecord(api2, dataZoomModel, getRange) { + inner21(api2).coordSysRecordMap.each(function(coordSysRecord) { + const dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid); + if (dzInfo) { + dzInfo.getRange = getRange; + } + }); +} +function disposeCoordSysRecordIfNeeded(api2, dataZoomModel) { + const coordSysRecordMap = inner21(api2).coordSysRecordMap; + const coordSysKeyArr = coordSysRecordMap.keys(); + for (let i = 0; i < coordSysKeyArr.length; i++) { + const coordSysKey = coordSysKeyArr[i]; + const coordSysRecord = coordSysRecordMap.get(coordSysKey); + const dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; + if (dataZoomInfoMap) { + const dzUid = dataZoomModel.uid; + const dzInfo = dataZoomInfoMap.get(dzUid); + if (dzInfo) { + dataZoomInfoMap.removeKey(dzUid); + if (!dataZoomInfoMap.keys().length) { + disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); + } + } + } + } +} +function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) { + if (coordSysRecord) { + coordSysRecordMap.removeKey(coordSysRecord.model.uid); + const controller = coordSysRecord.controller; + controller && controller.dispose(); + } +} +function createCoordSysRecord(api2, coordSysModel) { + const coordSysRecord = { + model: coordSysModel, + containsPoint: curry(containsPoint, coordSysModel), + dispatchAction: curry(dispatchAction2, api2), + dataZoomInfoMap: null, + controller: null + }; + const controller = coordSysRecord.controller = new RoamController_default(api2.getZr()); + each(["pan", "zoom", "scrollMove"], function(eventName) { + controller.on(eventName, function(event) { + const batch = []; + coordSysRecord.dataZoomInfoMap.each(function(dzInfo) { + if (!event.isAvailableBehavior(dzInfo.model.option)) { + return; } - saveAndModifyMethod(toPath, 'addSelfToZr', { - after: function (zr) { - addToSubPathListToZr(zr); - } + const method = (dzInfo.getRange || {})[eventName]; + const range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event); + !dzInfo.model.get("disabled", true) && range && batch.push({ + dataZoomId: dzInfo.model.id, + start: range[0], + end: range[1] }); - saveAndModifyMethod(toPath, 'removeSelfFromZr', { - after: function (zr) { - for (var i = 0; i < toSubPathList.length; i++) { - toSubPathList[i].removeSelfFromZr(zr); - } - } + }); + batch.length && coordSysRecord.dispatchAction(batch); + }); + }); + return coordSysRecord; +} +function dispatchAction2(api2, batch) { + if (!api2.isDisposed()) { + api2.dispatchAction({ + type: "dataZoom", + animation: { + easing: "cubicOut", + duration: 100 + }, + batch + }); + } +} +function containsPoint(coordSysModel, e2, x, y) { + return coordSysModel.coordinateSystem.containPoint([x, y]); +} +function mergeControllerParams(dataZoomInfoMap) { + let controlType; + const prefix = "type_"; + const typePriority = { + type_true: 2, + type_move: 1, + type_false: 0, + type_undefined: -1 + }; + let preventDefaultMouseMove = true; + dataZoomInfoMap.each(function(dataZoomInfo) { + const dataZoomModel = dataZoomInfo.model; + const oneType = dataZoomModel.get("disabled", true) ? false : dataZoomModel.get("zoomLock", true) ? "move" : true; + if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { + controlType = oneType; + } + preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get("preventDefaultMouseMove", true); + }); + return { + controlType, + opt: { + zoomOnMouseWheel: true, + moveOnMouseMove: true, + moveOnMouseWheel: true, + preventDefaultMouseMove: !!preventDefaultMouseMove + } + }; +} +function installDataZoomRoamProcessor(registers) { + registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function(ecModel, api2) { + const apiInner = inner21(api2); + const coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap()); + coordSysRecordMap.each(function(coordSysRecord) { + coordSysRecord.dataZoomInfoMap = null; + }); + ecModel.eachComponent({mainType: "dataZoom", subType: "inside"}, function(dataZoomModel) { + const dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel); + each(dzReferCoordSysWrap.infoList, function(dzCoordSysInfo) { + const coordSysUid = dzCoordSysInfo.model.uid; + const coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api2, dzCoordSysInfo.model)); + const dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap()); + dataZoomInfoMap.set(dataZoomModel.uid, { + dzReferCoordSysInfo: dzCoordSysInfo, + model: dataZoomModel, + getRange: null }); - function restoreToPath() { - toPath.__isCombineMorphing = false; - toPath.__morphT = -1; - toPath.childrenRef = null; - restoreMethod(toPath, 'addSelfToZr'); - restoreMethod(toPath, 'removeSelfFromZr'); - } - var toLen = toSubPathList.length; - if (individualDelay) { - var animating_1 = toLen; - var eachDone = function () { - animating_1--; - if (animating_1 === 0) { - restoreToPath(); - oldDone && oldDone(); - } - }; - for (var i = 0; i < toLen; i++) { - var indivdualAnimationOpts = individualDelay ? defaults({ - delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toSubPathList[i]), - done: eachDone - }, animationOpts) : animationOpts; - morphPath(fromPathList[i], toSubPathList[i], indivdualAnimationOpts); - } + }); + }); + coordSysRecordMap.each(function(coordSysRecord) { + const controller = coordSysRecord.controller; + let firstDzInfo; + const dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; + if (dataZoomInfoMap) { + const firstDzKey = dataZoomInfoMap.keys()[0]; + if (firstDzKey != null) { + firstDzInfo = dataZoomInfoMap.get(firstDzKey); + } + } + if (!firstDzInfo) { + disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); + return; + } + const controllerParams = mergeControllerParams(dataZoomInfoMap); + controller.enable(controllerParams.controlType, controllerParams.opt); + controller.setPointerChecker(coordSysRecord.containsPoint); + createOrUpdate(coordSysRecord, "dispatchAction", firstDzInfo.model.get("throttle", true), "fixRate"); + }); + }); +} + +// src/component/dataZoom/InsideZoomView.ts +var InsideZoomView = class extends DataZoomView_default { + constructor() { + super(...arguments); + this.type = "dataZoom.inside"; + } + render(dataZoomModel, ecModel, api2) { + super.render.apply(this, arguments); + if (dataZoomModel.noTarget()) { + this._clear(); + return; + } + this.range = dataZoomModel.getPercentRange(); + setViewInfoToCoordSysRecord(api2, dataZoomModel, { + pan: bind(getRangeHandlers.pan, this), + zoom: bind(getRangeHandlers.zoom, this), + scrollMove: bind(getRangeHandlers.scrollMove, this) + }); + } + dispose() { + this._clear(); + super.dispose.apply(this, arguments); + } + _clear() { + disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel); + this.range = null; + } +}; +InsideZoomView.type = "dataZoom.inside"; +var getRangeHandlers = { + zoom(coordSysInfo, coordSysMainType, controller, e2) { + const lastRange = this.range; + const range = lastRange.slice(); + const axisModel = coordSysInfo.axisModels[0]; + if (!axisModel) { + return; + } + const directionInfo = getDirectionInfo[coordSysMainType](null, [e2.originX, e2.originY], axisModel, controller, coordSysInfo); + const percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; + const scale4 = Math.max(1 / e2.scale, 0); + range[0] = (range[0] - percentPoint) * scale4 + percentPoint; + range[1] = (range[1] - percentPoint) * scale4 + percentPoint; + const minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); + this.range = range; + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }, + pan: makeMover(function(range, axisModel, coordSysInfo, coordSysMainType, controller, e2) { + const directionInfo = getDirectionInfo[coordSysMainType]([e2.oldX, e2.oldY], [e2.newX, e2.newY], axisModel, controller, coordSysInfo); + return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength; + }), + scrollMove: makeMover(function(range, axisModel, coordSysInfo, coordSysMainType, controller, e2) { + const directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e2.scrollDelta, e2.scrollDelta], axisModel, controller, coordSysInfo); + return directionInfo.signal * (range[1] - range[0]) * e2.scrollDelta; + }) +}; +function makeMover(getPercentDelta) { + return function(coordSysInfo, coordSysMainType, controller, e2) { + const lastRange = this.range; + const range = lastRange.slice(); + const axisModel = coordSysInfo.axisModels[0]; + if (!axisModel) { + return; + } + const percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e2); + sliderMove(percentDelta, range, [0, 100], "all"); + this.range = range; + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }; +} +var getDirectionInfo = { + grid(oldPoint, newPoint, axisModel, controller, coordSysInfo) { + const axis = axisModel.axis; + const ret = {}; + const rect = coordSysInfo.model.coordinateSystem.getRect(); + oldPoint = oldPoint || [0, 0]; + if (axis.dim === "x") { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; + } else { + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; + } + return ret; + }, + polar(oldPoint, newPoint, axisModel, controller, coordSysInfo) { + const axis = axisModel.axis; + const ret = {}; + const polar = coordSysInfo.model.coordinateSystem; + const radiusExtent = polar.getRadiusAxis().getExtent(); + const angleExtent = polar.getAngleAxis().getExtent(); + oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; + newPoint = polar.pointToCoord(newPoint); + if (axisModel.mainType === "radiusAxis") { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = radiusExtent[1] - radiusExtent[0]; + ret.pixelStart = radiusExtent[0]; + ret.signal = axis.inverse ? 1 : -1; + } else { + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = angleExtent[1] - angleExtent[0]; + ret.pixelStart = angleExtent[0]; + ret.signal = axis.inverse ? -1 : 1; + } + return ret; + }, + singleAxis(oldPoint, newPoint, axisModel, controller, coordSysInfo) { + const axis = axisModel.axis; + const rect = coordSysInfo.model.coordinateSystem.getRect(); + const ret = {}; + oldPoint = oldPoint || [0, 0]; + if (axis.orient === "horizontal") { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; + } else { + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; + } + return ret; + } +}; +var InsideZoomView_default = InsideZoomView; + +// src/component/dataZoom/installDataZoomInside.ts +function install47(registers) { + installCommon(registers); + registers.registerComponentModel(InsideZoomModel_default); + registers.registerComponentView(InsideZoomView_default); + installDataZoomRoamProcessor(registers); +} + +// src/component/dataZoom/SliderZoomModel.ts +var SliderZoomModel2 = class extends DataZoomModel_default { + constructor() { + super(...arguments); + this.type = SliderZoomModel2.type; + } +}; +var SliderZoomModel = SliderZoomModel2; +SliderZoomModel.type = "dataZoom.slider"; +SliderZoomModel.layoutMode = "box"; +SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel_default.defaultOption, { + show: true, + right: "ph", + top: "ph", + width: "ph", + height: "ph", + left: null, + bottom: null, + borderColor: "#d2dbee", + borderRadius: 3, + backgroundColor: "rgba(47,69,84,0)", + dataBackground: { + lineStyle: { + color: "#d2dbee", + width: 0.5 + }, + areaStyle: { + color: "#d2dbee", + opacity: 0.2 + } + }, + selectedDataBackground: { + lineStyle: { + color: "#8fb0f7", + width: 0.5 + }, + areaStyle: { + color: "#8fb0f7", + opacity: 0.2 + } + }, + fillerColor: "rgba(135,175,274,0.2)", + handleIcon: "path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z", + handleSize: "100%", + handleStyle: { + color: "#fff", + borderColor: "#ACB8D1" + }, + moveHandleSize: 7, + moveHandleIcon: "path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z", + moveHandleStyle: { + color: "#D2DBEE", + opacity: 0.7 + }, + showDetail: true, + showDataShadow: "auto", + realtime: true, + zoomLock: false, + textStyle: { + color: "#6E7079" + }, + brushSelect: true, + brushStyle: { + color: "rgba(135,175,274,0.15)" + }, + emphasis: { + handleStyle: { + borderColor: "#8FB0F7" + }, + moveHandleStyle: { + color: "#8FB0F7" + } + } +}); +var SliderZoomModel_default = SliderZoomModel; + +// src/component/dataZoom/SliderZoomView.ts +var Rect3 = Rect_default; +var DEFAULT_LOCATION_EDGE_GAP = 7; +var DEFAULT_FRAME_BORDER_WIDTH = 1; +var DEFAULT_FILLER_SIZE = 30; +var DEFAULT_MOVE_HANDLE_SIZE = 7; +var HORIZONTAL = "horizontal"; +var VERTICAL = "vertical"; +var LABEL_GAP = 5; +var SHOW_DATA_SHADOW_SERIES_TYPE = ["line", "bar", "candlestick", "scatter"]; +var REALTIME_ANIMATION_CONFIG = { + easing: "cubicOut", + duration: 100, + delay: 0 +}; +var SliderZoomView2 = class extends DataZoomView_default { + constructor() { + super(...arguments); + this.type = SliderZoomView2.type; + this._displayables = {}; + } + init(ecModel, api2) { + this.api = api2; + this._onBrush = bind(this._onBrush, this); + this._onBrushEnd = bind(this._onBrushEnd, this); + } + render(dataZoomModel, ecModel, api2, payload) { + super.render.apply(this, arguments); + createOrUpdate(this, "_dispatchZoomAction", dataZoomModel.get("throttle"), "fixRate"); + this._orient = dataZoomModel.getOrient(); + if (dataZoomModel.get("show") === false) { + this.group.removeAll(); + return; + } + if (dataZoomModel.noTarget()) { + this._clear(); + this.group.removeAll(); + return; + } + if (!payload || payload.type !== "dataZoom" || payload.from !== this.uid) { + this._buildView(); + } + this._updateView(); + } + dispose() { + this._clear(); + super.dispose.apply(this, arguments); + } + _clear() { + clear(this, "_dispatchZoomAction"); + const zr = this.api.getZr(); + zr.off("mousemove", this._onBrush); + zr.off("mouseup", this._onBrushEnd); + } + _buildView() { + const thisGroup = this.group; + thisGroup.removeAll(); + this._brushing = false; + this._displayables.brushRect = null; + this._resetLocation(); + this._resetInterval(); + const barGroup = this._displayables.sliderGroup = new Group_default(); + this._renderBackground(); + this._renderHandle(); + this._renderDataShadow(); + thisGroup.add(barGroup); + this._positionGroup(); + } + _resetLocation() { + const dataZoomModel = this.dataZoomModel; + const api2 = this.api; + const showMoveHandle = dataZoomModel.get("brushSelect"); + const moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0; + const coordRect = this._findCoordRect(); + const ecSize = {width: api2.getWidth(), height: api2.getHeight()}; + const positionInfo = this._orient === HORIZONTAL ? { + right: ecSize.width - coordRect.x - coordRect.width, + top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize, + width: coordRect.width, + height: DEFAULT_FILLER_SIZE + } : { + right: DEFAULT_LOCATION_EDGE_GAP, + top: coordRect.y, + width: DEFAULT_FILLER_SIZE, + height: coordRect.height + }; + const layoutParams = getLayoutParams(dataZoomModel.option); + each(["right", "top", "width", "height"], function(name) { + if (layoutParams[name] === "ph") { + layoutParams[name] = positionInfo[name]; + } + }); + const layoutRect = getLayoutRect(layoutParams, ecSize); + this._location = {x: layoutRect.x, y: layoutRect.y}; + this._size = [layoutRect.width, layoutRect.height]; + this._orient === VERTICAL && this._size.reverse(); + } + _positionGroup() { + const thisGroup = this.group; + const location = this._location; + const orient = this._orient; + const targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel(); + const inverse = targetAxisModel && targetAxisModel.get("inverse"); + const sliderGroup = this._displayables.sliderGroup; + const otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; + sliderGroup.attr(orient === HORIZONTAL && !inverse ? {scaleY: otherAxisInverse ? 1 : -1, scaleX: 1} : orient === HORIZONTAL && inverse ? {scaleY: otherAxisInverse ? 1 : -1, scaleX: -1} : orient === VERTICAL && !inverse ? {scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2} : {scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2}); + const rect = thisGroup.getBoundingRect([sliderGroup]); + thisGroup.x = location.x - rect.x; + thisGroup.y = location.y - rect.y; + thisGroup.markRedraw(); + } + _getViewExtent() { + return [0, this._size[0]]; + } + _renderBackground() { + const dataZoomModel = this.dataZoomModel; + const size = this._size; + const barGroup = this._displayables.sliderGroup; + const brushSelect = dataZoomModel.get("brushSelect"); + barGroup.add(new Rect3({ + silent: true, + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1] + }, + style: { + fill: dataZoomModel.get("backgroundColor") + }, + z2: -40 + })); + const clickPanel = new Rect3({ + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1] + }, + style: { + fill: "transparent" + }, + z2: 0, + onclick: bind(this._onClickPanel, this) + }); + const zr = this.api.getZr(); + if (brushSelect) { + clickPanel.on("mousedown", this._onBrushStart, this); + clickPanel.cursor = "crosshair"; + zr.on("mousemove", this._onBrush); + zr.on("mouseup", this._onBrushEnd); + } else { + zr.off("mousemove", this._onBrush); + zr.off("mouseup", this._onBrushEnd); + } + barGroup.add(clickPanel); + } + _renderDataShadow() { + const info = this._dataShadowInfo = this._prepareDataShadowInfo(); + this._displayables.dataShadowSegs = []; + if (!info) { + return; + } + const size = this._size; + const oldSize = this._shadowSize || []; + const seriesModel = info.series; + const data = seriesModel.getRawData(); + const candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim(); + const otherDim = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() : info.otherDim; + if (otherDim == null) { + return; + } + let polygonPts = this._shadowPolygonPts; + let polylinePts = this._shadowPolylinePts; + if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) { + let otherDataExtent = data.getDataExtent(otherDim); + const otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3; + otherDataExtent = [ + otherDataExtent[0] - otherOffset, + otherDataExtent[1] + otherOffset + ]; + const otherShadowExtent = [0, size[1]]; + const thisShadowExtent = [0, size[0]]; + const areaPoints = [[size[0], 0], [0, 0]]; + const linePoints = []; + const step = thisShadowExtent[1] / (data.count() - 1); + let thisCoord = 0; + const stride = Math.round(data.count() / size[0]); + let lastIsEmpty; + data.each([otherDim], function(value, index) { + if (stride > 0 && index % stride) { + thisCoord += step; + return; } - else { - toPath.__morphT = 0; - toPath.animateTo({ - __morphT: 1 - }, defaults({ - during: function (p) { - for (var i = 0; i < toLen; i++) { - var child = toSubPathList[i]; - child.__morphT = toPath.__morphT; - child.dirtyShape(); - } - oldDuring && oldDuring(p); - }, - done: function () { - restoreToPath(); - for (var i = 0; i < fromList.length; i++) { - restoreMethod(fromList[i], 'updateTransform'); - } - oldDone && oldDone(); - } - }, animationOpts)); + const isEmpty = value == null || isNaN(value) || value === ""; + const otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent, otherShadowExtent, true); + if (isEmpty && !lastIsEmpty && index) { + areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]); + linePoints.push([linePoints[linePoints.length - 1][0], 0]); + } else if (!isEmpty && lastIsEmpty) { + areaPoints.push([thisCoord, 0]); + linePoints.push([thisCoord, 0]); + } + areaPoints.push([thisCoord, otherCoord]); + linePoints.push([thisCoord, otherCoord]); + thisCoord += step; + lastIsEmpty = isEmpty; + }); + polygonPts = this._shadowPolygonPts = areaPoints; + polylinePts = this._shadowPolylinePts = linePoints; + } + this._shadowData = data; + this._shadowDim = otherDim; + this._shadowSize = [size[0], size[1]]; + const dataZoomModel = this.dataZoomModel; + function createDataShadowGroup(isSelectedArea) { + const model = dataZoomModel.getModel(isSelectedArea ? "selectedDataBackground" : "dataBackground"); + const group = new Group_default(); + const polygon = new Polygon_default({ + shape: {points: polygonPts}, + segmentIgnoreThreshold: 1, + style: model.getModel("areaStyle").getAreaStyle(), + silent: true, + z2: -20 + }); + const polyline = new Polyline_default({ + shape: {points: polylinePts}, + segmentIgnoreThreshold: 1, + style: model.getModel("lineStyle").getLineStyle(), + silent: true, + z2: -19 + }); + group.add(polygon); + group.add(polyline); + return group; + } + for (let i = 0; i < 3; i++) { + const group = createDataShadowGroup(i === 1); + this._displayables.sliderGroup.add(group); + this._displayables.dataShadowSegs.push(group); + } + } + _prepareDataShadowInfo() { + const dataZoomModel = this.dataZoomModel; + const showDataShadow = dataZoomModel.get("showDataShadow"); + if (showDataShadow === false) { + return; + } + let result; + const ecModel = this.ecModel; + dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) { + const seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels(); + each(seriesModels, function(seriesModel) { + if (result) { + return; } - if (toPath.__zr) { - addToSubPathListToZr(toPath.__zr); + if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get("type")) < 0) { + return; } - return { - fromIndividuals: fromPathList, - toIndividuals: toSubPathList, - count: toLen + const thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis; + let otherDim = getOtherDim(axisDim); + let otherAxisInverse; + const coordSys = seriesModel.coordinateSystem; + if (otherDim != null && coordSys.getOtherAxis) { + otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; + } + otherDim = seriesModel.getData().mapDimension(otherDim); + result = { + thisAxis, + series: seriesModel, + thisDim: axisDim, + otherDim, + otherAxisInverse }; + }, this); + }, this); + return result; + } + _renderHandle() { + const thisGroup = this.group; + const displayables = this._displayables; + const handles = displayables.handles = [null, null]; + const handleLabels = displayables.handleLabels = [null, null]; + const sliderGroup = this._displayables.sliderGroup; + const size = this._size; + const dataZoomModel = this.dataZoomModel; + const api2 = this.api; + const borderRadius = dataZoomModel.get("borderRadius") || 0; + const brushSelect = dataZoomModel.get("brushSelect"); + const filler = displayables.filler = new Rect3({ + silent: brushSelect, + style: { + fill: dataZoomModel.get("fillerColor") + }, + textConfig: { + position: "inside" + } + }); + sliderGroup.add(filler); + sliderGroup.add(new Rect3({ + silent: true, + subPixelOptimize: true, + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1], + r: borderRadius + }, + style: { + stroke: dataZoomModel.get("dataBackgroundColor") || dataZoomModel.get("borderColor"), + lineWidth: DEFAULT_FRAME_BORDER_WIDTH, + fill: "rgba(0,0,0,0)" + } + })); + each([0, 1], function(handleIndex) { + let iconStr = dataZoomModel.get("handleIcon"); + if (!symbolBuildProxies[iconStr] && iconStr.indexOf("path://") < 0 && iconStr.indexOf("image://") < 0) { + iconStr = "path://" + iconStr; + if (true) { + deprecateLog("handleIcon now needs 'path://' prefix when using a path string"); + } + } + const path = createSymbol(iconStr, -1, 0, 2, 2, null, true); + path.attr({ + cursor: getCursor(this._orient), + draggable: true, + drift: bind(this._onDragMove, this, handleIndex), + ondragend: bind(this._onDragEnd, this), + onmouseover: bind(this._showDataInfo, this, true), + onmouseout: bind(this._showDataInfo, this, false), + z2: 5 + }); + const bRect = path.getBoundingRect(); + const handleSize = dataZoomModel.get("handleSize"); + this._handleHeight = parsePercent2(handleSize, this._size[1]); + this._handleWidth = bRect.width / bRect.height * this._handleHeight; + path.setStyle(dataZoomModel.getModel("handleStyle").getItemStyle()); + path.style.strokeNoScale = true; + path.rectHover = true; + path.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "handleStyle"]).getItemStyle(); + enableHoverEmphasis(path); + const handleColor = dataZoomModel.get("handleColor"); + if (handleColor != null) { + path.style.fill = handleColor; + } + sliderGroup.add(handles[handleIndex] = path); + const textStyleModel = dataZoomModel.getModel("textStyle"); + thisGroup.add(handleLabels[handleIndex] = new Text_default({ + silent: true, + invisible: true, + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: "", + verticalAlign: "middle", + align: "center", + fill: textStyleModel.getTextColor(), + font: textStyleModel.getFont() + }), + z2: 10 + })); + }, this); + let actualMoveZone = filler; + if (brushSelect) { + const moveHandleHeight = parsePercent2(dataZoomModel.get("moveHandleSize"), size[1]); + const moveHandle = displayables.moveHandle = new Rect_default({ + style: dataZoomModel.getModel("moveHandleStyle").getItemStyle(), + silent: true, + shape: { + r: [0, 0, 2, 2], + y: size[1] - 0.5, + height: moveHandleHeight + } + }); + const iconSize = moveHandleHeight * 0.8; + const moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get("moveHandleIcon"), -iconSize / 2, -iconSize / 2, iconSize, iconSize, "#fff", true); + moveHandleIcon.silent = true; + moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5; + moveHandle.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "moveHandleStyle"]).getItemStyle(); + const moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10)); + actualMoveZone = displayables.moveZone = new Rect_default({ + invisible: true, + shape: { + y: size[1] - moveZoneExpandSize, + height: moveHandleHeight + moveZoneExpandSize + } + }); + actualMoveZone.on("mouseover", () => { + api2.enterEmphasis(moveHandle); + }).on("mouseout", () => { + api2.leaveEmphasis(moveHandle); + }); + sliderGroup.add(moveHandle); + sliderGroup.add(moveHandleIcon); + sliderGroup.add(actualMoveZone); + } + actualMoveZone.attr({ + draggable: true, + cursor: getCursor(this._orient), + drift: bind(this._onDragMove, this, "all"), + ondragstart: bind(this._showDataInfo, this, true), + ondragend: bind(this._onDragEnd, this), + onmouseover: bind(this._showDataInfo, this, true), + onmouseout: bind(this._showDataInfo, this, false) + }); + } + _resetInterval() { + const range = this._range = this.dataZoomModel.getPercentRange(); + const viewExtent = this._getViewExtent(); + this._handleEnds = [ + linearMap(range[0], [0, 100], viewExtent, true), + linearMap(range[1], [0, 100], viewExtent, true) + ]; + } + _updateInterval(handleIndex, delta) { + const dataZoomModel = this.dataZoomModel; + const handleEnds = this._handleEnds; + const viewExtend = this._getViewExtent(); + const minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + const percentExtent = [0, 100]; + sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get("zoomLock") ? "all" : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null); + const lastRange = this._range; + const range = this._range = asc([ + linearMap(handleEnds[0], viewExtend, percentExtent, true), + linearMap(handleEnds[1], viewExtend, percentExtent, true) + ]); + return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; + } + _updateView(nonRealtime) { + const displaybles = this._displayables; + const handleEnds = this._handleEnds; + const handleInterval = asc(handleEnds.slice()); + const size = this._size; + each([0, 1], function(handleIndex) { + const handle = displaybles.handles[handleIndex]; + const handleHeight = this._handleHeight; + handle.attr({ + scaleX: handleHeight / 2, + scaleY: handleHeight / 2, + x: handleEnds[handleIndex] + (handleIndex ? -1 : 1), + y: size[1] / 2 - handleHeight / 2 + }); + }, this); + displaybles.filler.setShape({ + x: handleInterval[0], + y: 0, + width: handleInterval[1] - handleInterval[0], + height: size[1] + }); + const viewExtent = { + x: handleInterval[0], + width: handleInterval[1] - handleInterval[0] + }; + if (displaybles.moveHandle) { + displaybles.moveHandle.setShape(viewExtent); + displaybles.moveZone.setShape(viewExtent); + displaybles.moveZone.getBoundingRect(); + displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr("x", viewExtent.x + viewExtent.width / 2); + } + const dataShadowSegs = displaybles.dataShadowSegs; + const segIntervals = [0, handleInterval[0], handleInterval[1], size[0]]; + for (let i = 0; i < dataShadowSegs.length; i++) { + const segGroup = dataShadowSegs[i]; + let clipPath = segGroup.getClipPath(); + if (!clipPath) { + clipPath = new Rect_default(); + segGroup.setClipPath(clipPath); + } + clipPath.setShape({ + x: segIntervals[i], + y: 0, + width: segIntervals[i + 1] - segIntervals[i], + height: size[1] + }); } - function separateMorph(fromPath, toPathList, animationOpts) { - var toLen = toPathList.length; - var fromPathList = []; - var dividePath = animationOpts.dividePath || defaultDividePath; - function addFromPath(fromList) { - for (var i = 0; i < fromList.length; i++) { - var from = fromList[i]; - if (isCombineMorphing(from)) { - addFromPath(from.childrenRef()); - } - else if (from instanceof Path) { - fromPathList.push(from); - } + this._updateDataInfo(nonRealtime); + } + _updateDataInfo(nonRealtime) { + const dataZoomModel = this.dataZoomModel; + const displaybles = this._displayables; + const handleLabels = displaybles.handleLabels; + const orient = this._orient; + let labelTexts = ["", ""]; + if (dataZoomModel.get("showDetail")) { + const axisProxy = dataZoomModel.findRepresentativeAxisProxy(); + if (axisProxy) { + const axis = axisProxy.getAxisModel().axis; + const range = this._range; + const dataInterval = nonRealtime ? axisProxy.calculateDataWindow({ + start: range[0], + end: range[1] + }).valueWindow : axisProxy.getDataValueWindow(); + labelTexts = [ + this._formatLabel(dataInterval[0], axis), + this._formatLabel(dataInterval[1], axis) + ]; + } + } + const orderedHandleEnds = asc(this._handleEnds.slice()); + setLabel.call(this, 0); + setLabel.call(this, 1); + function setLabel(handleIndex) { + const barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group); + const direction = transformDirection(handleIndex === 0 ? "right" : "left", barTransform); + const offset = this._handleWidth / 2 + LABEL_GAP; + const textPoint = applyTransform2([ + orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), + this._size[1] / 2 + ], barTransform); + handleLabels[handleIndex].setStyle({ + x: textPoint[0], + y: textPoint[1], + verticalAlign: orient === HORIZONTAL ? "middle" : direction, + align: orient === HORIZONTAL ? direction : "center", + text: labelTexts[handleIndex] + }); + } + } + _formatLabel(value, axis) { + const dataZoomModel = this.dataZoomModel; + const labelFormatter = dataZoomModel.get("labelFormatter"); + let labelPrecision = dataZoomModel.get("labelPrecision"); + if (labelPrecision == null || labelPrecision === "auto") { + labelPrecision = axis.getPixelPrecision(); + } + const valueStr = value == null || isNaN(value) ? "" : axis.type === "category" || axis.type === "time" ? axis.scale.getLabel({ + value: Math.round(value) + }) : value.toFixed(Math.min(labelPrecision, 20)); + return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace("{value}", valueStr) : valueStr; + } + _showDataInfo(showOrHide) { + showOrHide = this._dragging || showOrHide; + const displayables = this._displayables; + const handleLabels = displayables.handleLabels; + handleLabels[0].attr("invisible", !showOrHide); + handleLabels[1].attr("invisible", !showOrHide); + displayables.moveHandle && this.api[showOrHide ? "enterEmphasis" : "leaveEmphasis"](displayables.moveHandle, 1); + } + _onDragMove(handleIndex, dx, dy, event) { + this._dragging = true; + stop(event.event); + const barTransform = this._displayables.sliderGroup.getLocalTransform(); + const vertex = applyTransform2([dx, dy], barTransform, true); + const changed = this._updateInterval(handleIndex, vertex[0]); + const realtime = this.dataZoomModel.get("realtime"); + this._updateView(!realtime); + changed && realtime && this._dispatchZoomAction(true); + } + _onDragEnd() { + this._dragging = false; + this._showDataInfo(false); + const realtime = this.dataZoomModel.get("realtime"); + !realtime && this._dispatchZoomAction(false); + } + _onClickPanel(e2) { + const size = this._size; + const localPoint = this._displayables.sliderGroup.transformCoordToLocal(e2.offsetX, e2.offsetY); + if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) { + return; + } + const handleEnds = this._handleEnds; + const center3 = (handleEnds[0] + handleEnds[1]) / 2; + const changed = this._updateInterval("all", localPoint[0] - center3); + this._updateView(); + changed && this._dispatchZoomAction(false); + } + _onBrushStart(e2) { + const x = e2.offsetX; + const y = e2.offsetY; + this._brushStart = new Point_default(x, y); + this._brushing = true; + this._brushStartTime = +new Date(); + } + _onBrushEnd(e2) { + if (!this._brushing) { + return; + } + const brushRect = this._displayables.brushRect; + this._brushing = false; + if (!brushRect) { + return; + } + brushRect.attr("ignore", true); + const brushShape = brushRect.shape; + const brushEndTime = +new Date(); + if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) { + return; + } + const viewExtend = this._getViewExtent(); + const percentExtent = [0, 100]; + this._range = asc([ + linearMap(brushShape.x, viewExtend, percentExtent, true), + linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true) + ]); + this._handleEnds = [brushShape.x, brushShape.x + brushShape.width]; + this._updateView(); + this._dispatchZoomAction(false); + } + _onBrush(e2) { + if (this._brushing) { + stop(e2.event); + this._updateBrushRect(e2.offsetX, e2.offsetY); + } + } + _updateBrushRect(mouseX, mouseY) { + const displayables = this._displayables; + const dataZoomModel = this.dataZoomModel; + let brushRect = displayables.brushRect; + if (!brushRect) { + brushRect = displayables.brushRect = new Rect3({ + silent: true, + style: dataZoomModel.getModel("brushStyle").getItemStyle() + }); + displayables.sliderGroup.add(brushRect); + } + brushRect.attr("ignore", false); + const brushStart = this._brushStart; + const sliderGroup = this._displayables.sliderGroup; + const endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY); + const startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y); + const size = this._size; + endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0); + brushRect.setShape({ + x: startPoint[0], + y: 0, + width: endPoint[0] - startPoint[0], + height: size[1] + }); + } + _dispatchZoomAction(realtime) { + const range = this._range; + this.api.dispatchAction({ + type: "dataZoom", + from: this.uid, + dataZoomId: this.dataZoomModel.id, + animation: realtime ? REALTIME_ANIMATION_CONFIG : null, + start: range[0], + end: range[1] + }); + } + _findCoordRect() { + let rect; + const coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList; + if (!rect && coordSysInfoList.length) { + const coordSys = coordSysInfoList[0].model.coordinateSystem; + rect = coordSys.getRect && coordSys.getRect(); + } + if (!rect) { + const width = this.api.getWidth(); + const height = this.api.getHeight(); + rect = { + x: width * 0.2, + y: height * 0.2, + width: width * 0.6, + height: height * 0.6 + }; + } + return rect; + } +}; +var SliderZoomView = SliderZoomView2; +SliderZoomView.type = "dataZoom.slider"; +function getOtherDim(thisDim) { + const map3 = {x: "y", y: "x", radius: "angle", angle: "radius"}; + return map3[thisDim]; +} +function getCursor(orient) { + return orient === "vertical" ? "ns-resize" : "ew-resize"; +} +var SliderZoomView_default = SliderZoomView; + +// src/component/dataZoom/installDataZoomSlider.ts +function install48(registers) { + registers.registerComponentModel(SliderZoomModel_default); + registers.registerComponentView(SliderZoomView_default); + installCommon(registers); +} + +// src/component/dataZoom/install.ts +function install49(registers) { + use(install47); + use(install48); +} + +// src/visual/visualDefault.ts +var visualDefault = { + get: function(visualType, key, isCategory2) { + const value = clone((defaultOption2[visualType] || {})[key]); + return isCategory2 ? isArray(value) ? value[value.length - 1] : value : value; + } +}; +var defaultOption2 = { + color: { + active: ["#006edd", "#e0ffff"], + inactive: ["rgba(0,0,0,0)"] + }, + colorHue: { + active: [0, 360], + inactive: [0, 0] + }, + colorSaturation: { + active: [0.3, 1], + inactive: [0, 0] + }, + colorLightness: { + active: [0.9, 0.5], + inactive: [0, 0] + }, + colorAlpha: { + active: [0.3, 1], + inactive: [0, 0] + }, + opacity: { + active: [0.3, 1], + inactive: [0, 0] + }, + symbol: { + active: ["circle", "roundRect", "diamond"], + inactive: ["none"] + }, + symbolSize: { + active: [10, 50], + inactive: [0, 0] + } +}; +var visualDefault_default = visualDefault; + +// src/component/visualMap/VisualMapModel.ts +var mapVisual2 = VisualMapping_default.mapVisual; +var eachVisual = VisualMapping_default.eachVisual; +var isArray2 = isArray; +var each14 = each; +var asc3 = asc; +var linearMap2 = linearMap; +var VisualMapModel2 = class extends Component_default { + constructor() { + super(...arguments); + this.type = VisualMapModel2.type; + this.stateList = ["inRange", "outOfRange"]; + this.replacableOptionKeys = [ + "inRange", + "outOfRange", + "target", + "controller", + "color" + ]; + this.layoutMode = { + type: "box", + ignoreSize: true + }; + this.dataBound = [-Infinity, Infinity]; + this.targetVisuals = {}; + this.controllerVisuals = {}; + } + init(option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + } + optionUpdated(newOption, isInit) { + const thisOption = this.option; + !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys); + this.textStyleModel = this.getModel("textStyle"); + this.resetItemSize(); + this.completeVisualOption(); + } + resetVisual(supplementVisualOption) { + const stateList = this.stateList; + supplementVisualOption = bind(supplementVisualOption, this); + this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption); + this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption); + } + getItemSymbol() { + return null; + } + getTargetSeriesIndices() { + const optionSeriesIndex = this.option.seriesIndex; + let seriesIndices = []; + if (optionSeriesIndex == null || optionSeriesIndex === "all") { + this.ecModel.eachSeries(function(seriesModel, index) { + seriesIndices.push(index); + }); + } else { + seriesIndices = normalizeToArray(optionSeriesIndex); + } + return seriesIndices; + } + eachTargetSeries(callback, context) { + each(this.getTargetSeriesIndices(), function(seriesIndex) { + const seriesModel = this.ecModel.getSeriesByIndex(seriesIndex); + if (seriesModel) { + callback.call(context, seriesModel); + } + }, this); + } + isTargetSeries(seriesModel) { + let is = false; + this.eachTargetSeries(function(model) { + model === seriesModel && (is = true); + }); + return is; + } + formatValueText(value, isCategory2, edgeSymbols) { + const option = this.option; + const precision = option.precision; + const dataBound = this.dataBound; + const formatter = option.formatter; + let isMinMax; + edgeSymbols = edgeSymbols || ["<", ">"]; + if (isArray(value)) { + value = value.slice(); + isMinMax = true; + } + const textValue = isCategory2 ? value : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value); + if (isString(formatter)) { + return formatter.replace("{value}", isMinMax ? textValue[0] : textValue).replace("{value2}", isMinMax ? textValue[1] : textValue); + } else if (isFunction(formatter)) { + return isMinMax ? formatter(value[0], value[1]) : formatter(value); + } + if (isMinMax) { + if (value[0] === dataBound[0]) { + return edgeSymbols[0] + " " + textValue[1]; + } else if (value[1] === dataBound[1]) { + return edgeSymbols[1] + " " + textValue[0]; + } else { + return textValue[0] + " - " + textValue[1]; + } + } else { + return textValue; + } + function toFixed(val) { + return val === dataBound[0] ? "min" : val === dataBound[1] ? "max" : (+val).toFixed(Math.min(precision, 20)); + } + } + resetExtent() { + const thisOption = this.option; + const extent3 = asc3([thisOption.min, thisOption.max]); + this._dataExtent = extent3; + } + getDataDimensionIndex(data) { + const optDim = this.option.dimension; + if (optDim != null) { + return data.getDimensionIndex(optDim); + } + const dimNames = data.dimensions; + for (let i = dimNames.length - 1; i >= 0; i--) { + const dimName = dimNames[i]; + const dimInfo = data.getDimensionInfo(dimName); + if (!dimInfo.isCalculationCoord) { + return dimInfo.storeDimIndex; + } + } + } + getExtent() { + return this._dataExtent.slice(); + } + completeVisualOption() { + const ecModel = this.ecModel; + const thisOption = this.option; + const base2 = { + inRange: thisOption.inRange, + outOfRange: thisOption.outOfRange + }; + const target = thisOption.target || (thisOption.target = {}); + const controller = thisOption.controller || (thisOption.controller = {}); + merge(target, base2); + merge(controller, base2); + const isCategory2 = this.isCategory(); + completeSingle.call(this, target); + completeSingle.call(this, controller); + completeInactive.call(this, target, "inRange", "outOfRange"); + completeController.call(this, controller); + function completeSingle(base3) { + if (isArray2(thisOption.color) && !base3.inRange) { + base3.inRange = {color: thisOption.color.slice().reverse()}; + } + base3.inRange = base3.inRange || {color: ecModel.get("gradientColor")}; + } + function completeInactive(base3, stateExist, stateAbsent) { + const optExist = base3[stateExist]; + let optAbsent = base3[stateAbsent]; + if (optExist && !optAbsent) { + optAbsent = base3[stateAbsent] = {}; + each14(optExist, function(visualData, visualType) { + if (!VisualMapping_default.isValidType(visualType)) { + return; + } + const defa = visualDefault_default.get(visualType, "inactive", isCategory2); + if (defa != null) { + optAbsent[visualType] = defa; + if (visualType === "color" && !optAbsent.hasOwnProperty("opacity") && !optAbsent.hasOwnProperty("colorAlpha")) { + optAbsent.opacity = [0, 0]; } + } + }); + } + } + function completeController(controller2) { + const symbolExists = (controller2.inRange || {}).symbol || (controller2.outOfRange || {}).symbol; + const symbolSizeExists = (controller2.inRange || {}).symbolSize || (controller2.outOfRange || {}).symbolSize; + const inactiveColor = this.get("inactiveColor"); + const itemSymbol = this.getItemSymbol(); + const defaultSymbol = itemSymbol || "roundRect"; + each14(this.stateList, function(state) { + const itemSize = this.itemSize; + let visuals = controller2[state]; + if (!visuals) { + visuals = controller2[state] = { + color: isCategory2 ? inactiveColor : [inactiveColor] + }; } - if (isCombineMorphing(fromPath)) { - addFromPath(fromPath.childrenRef()); - var fromLen = fromPathList.length; - if (fromLen < toLen) { - var k = 0; - for (var i = fromLen; i < toLen; i++) { - fromPathList.push(clonePath(fromPathList[k++ % fromLen])); - } - } - fromPathList.length = toLen; + if (visuals.symbol == null) { + visuals.symbol = symbolExists && clone(symbolExists) || (isCategory2 ? defaultSymbol : [defaultSymbol]); } - else { - fromPathList = dividePath({ path: fromPath, count: toLen }); - var fromPathTransform = fromPath.getComputedTransform(); - for (var i = 0; i < fromPathList.length; i++) { - fromPathList[i].setLocalTransform(fromPathTransform); - } - if (fromPathList.length !== toLen) { - console.error('Invalid morphing: unmatched splitted path'); - return createEmptyReturn(); - } + if (visuals.symbolSize == null) { + visuals.symbolSize = symbolSizeExists && clone(symbolSizeExists) || (isCategory2 ? itemSize[0] : [itemSize[0], itemSize[0]]); } - fromPathList = sortPaths(fromPathList); - toPathList = sortPaths(toPathList); - var individualDelay = animationOpts.individualDelay; - for (var i = 0; i < toLen; i++) { - var indivdualAnimationOpts = individualDelay ? defaults({ - delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toPathList[i]) - }, animationOpts) : animationOpts; - morphPath(fromPathList[i], toPathList[i], indivdualAnimationOpts); + visuals.symbol = mapVisual2(visuals.symbol, function(symbol) { + return symbol === "none" ? defaultSymbol : symbol; + }); + const symbolSize = visuals.symbolSize; + if (symbolSize != null) { + let max3 = -Infinity; + eachVisual(symbolSize, function(value) { + value > max3 && (max3 = value); + }); + visuals.symbolSize = mapVisual2(symbolSize, function(value) { + return linearMap2(value, [0, max3], [0, itemSize[0]], true); + }); } - return { - fromIndividuals: fromPathList, - toIndividuals: toPathList, - count: toPathList.length - }; + }, this); + } + } + resetItemSize() { + this.itemSize = [ + parseFloat(this.get("itemWidth")), + parseFloat(this.get("itemHeight")) + ]; + } + isCategory() { + return !!this.option.categories; + } + setSelected(selected) { + } + getSelected() { + return null; + } + getValueState(value) { + return null; + } + getVisualMeta(getColorVisual2) { + return null; + } +}; +var VisualMapModel = VisualMapModel2; +VisualMapModel.type = "visualMap"; +VisualMapModel.dependencies = ["series"]; +VisualMapModel.defaultOption = { + show: true, + z: 4, + seriesIndex: "all", + min: 0, + max: 200, + left: 0, + right: null, + top: null, + bottom: 0, + itemWidth: null, + itemHeight: null, + inverse: false, + orient: "vertical", + backgroundColor: "rgba(0,0,0,0)", + borderColor: "#ccc", + contentColor: "#5793f3", + inactiveColor: "#aaa", + borderWidth: 0, + padding: 5, + textGap: 10, + precision: 0, + textStyle: { + color: "#333" + } +}; +var VisualMapModel_default = VisualMapModel; + +// src/component/visualMap/ContinuousModel.ts +var DEFAULT_BAR_BOUND = [20, 140]; +var ContinuousModel2 = class extends VisualMapModel_default { + constructor() { + super(...arguments); + this.type = ContinuousModel2.type; + } + optionUpdated(newOption, isInit) { + super.optionUpdated.apply(this, arguments); + this.resetExtent(); + this.resetVisual(function(mappingOption) { + mappingOption.mappingMethod = "linear"; + mappingOption.dataExtent = this.getExtent(); + }); + this._resetRange(); + } + resetItemSize() { + super.resetItemSize.apply(this, arguments); + const itemSize = this.itemSize; + (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]); + (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]); + } + _resetRange() { + const dataExtent = this.getExtent(); + const range = this.option.range; + if (!range || range.auto) { + dataExtent.auto = 1; + this.option.range = dataExtent; + } else if (isArray(range)) { + if (range[0] > range[1]) { + range.reverse(); + } + range[0] = Math.max(range[0], dataExtent[0]); + range[1] = Math.min(range[1], dataExtent[1]); + } + } + completeVisualOption() { + super.completeVisualOption.apply(this, arguments); + each(this.stateList, function(state) { + const symbolSize = this.option.controller[state].symbolSize; + if (symbolSize && symbolSize[0] !== symbolSize[1]) { + symbolSize[0] = symbolSize[1] / 3; + } + }, this); + } + setSelected(selected) { + this.option.range = selected.slice(); + this._resetRange(); + } + getSelected() { + const dataExtent = this.getExtent(); + const dataInterval = asc((this.get("range") || []).slice()); + dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]); + dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]); + dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]); + dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]); + return dataInterval; + } + getValueState(value) { + const range = this.option.range; + const dataExtent = this.getExtent(); + return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? "inRange" : "outOfRange"; + } + findTargetDataIndices(range) { + const result = []; + this.eachTargetSeries(function(seriesModel) { + const dataIndices = []; + const data = seriesModel.getData(); + data.each(this.getDataDimensionIndex(data), function(value, dataIndex) { + range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); + }, this); + result.push({ + seriesId: seriesModel.id, + dataIndex: dataIndices + }); + }, this); + return result; + } + getVisualMeta(getColorVisual2) { + const oVals = getColorStopValues(this, "outOfRange", this.getExtent()); + const iVals = getColorStopValues(this, "inRange", this.option.range.slice()); + const stops = []; + function setStop(value, valueState) { + stops.push({ + value, + color: getColorVisual2(value, valueState) + }); + } + let iIdx = 0; + let oIdx = 0; + const iLen = iVals.length; + const oLen = oVals.length; + for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { + if (oVals[oIdx] < iVals[iIdx]) { + setStop(oVals[oIdx], "outOfRange"); + } + } + for (let first = 1; iIdx < iLen; iIdx++, first = 0) { + first && stops.length && setStop(iVals[iIdx], "outOfRange"); + setStop(iVals[iIdx], "inRange"); + } + for (let first = 1; oIdx < oLen; oIdx++) { + if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { + if (first) { + stops.length && setStop(stops[stops.length - 1].value, "outOfRange"); + first = 0; + } + setStop(oVals[oIdx], "outOfRange"); + } + } + const stopsLen = stops.length; + return { + stops, + outerColors: [ + stopsLen ? stops[0].color : "transparent", + stopsLen ? stops[stopsLen - 1].color : "transparent" + ] + }; + } +}; +var ContinuousModel = ContinuousModel2; +ContinuousModel.type = "visualMap.continuous"; +ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel_default.defaultOption, { + align: "auto", + calculable: false, + hoverLink: true, + realtime: true, + handleIcon: "path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z", + handleSize: "120%", + handleStyle: { + borderColor: "#fff", + borderWidth: 1 + }, + indicatorIcon: "circle", + indicatorSize: "50%", + indicatorStyle: { + borderColor: "#fff", + borderWidth: 2, + shadowBlur: 2, + shadowOffsetX: 1, + shadowOffsetY: 1, + shadowColor: "rgba(0,0,0,0.2)" + } +}); +function getColorStopValues(visualMapModel, valueState, dataExtent) { + if (dataExtent[0] === dataExtent[1]) { + return dataExtent.slice(); + } + const count2 = 200; + const step = (dataExtent[1] - dataExtent[0]) / count2; + let value = dataExtent[0]; + const stopValues = []; + for (let i = 0; i <= count2 && value < dataExtent[1]; i++) { + stopValues.push(value); + value += step; + } + stopValues.push(dataExtent[1]); + return stopValues; +} +var ContinuousModel_default = ContinuousModel; + +// src/component/visualMap/VisualMapView.ts +var VisualMapView2 = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = VisualMapView2.type; + this.autoPositionValues = {left: 1, right: 1, top: 1, bottom: 1}; + } + init(ecModel, api2) { + this.ecModel = ecModel; + this.api = api2; + } + render(visualMapModel, ecModel, api2, payload) { + this.visualMapModel = visualMapModel; + if (visualMapModel.get("show") === false) { + this.group.removeAll(); + return; + } + this.doRender(visualMapModel, ecModel, api2, payload); + } + renderBackground(group) { + const visualMapModel = this.visualMapModel; + const padding = normalizeCssArray2(visualMapModel.get("padding") || 0); + const rect = group.getBoundingRect(); + group.add(new Rect_default({ + z2: -1, + silent: true, + shape: { + x: rect.x - padding[3], + y: rect.y - padding[0], + width: rect.width + padding[3] + padding[1], + height: rect.height + padding[0] + padding[2] + }, + style: { + fill: visualMapModel.get("backgroundColor"), + stroke: visualMapModel.get("borderColor"), + lineWidth: visualMapModel.get("borderWidth") + } + })); + } + getControllerVisual(targetValue, visualCluster, opts) { + opts = opts || {}; + const forceState = opts.forceState; + const visualMapModel = this.visualMapModel; + const visualObj = {}; + if (visualCluster === "color") { + const defaultColor = visualMapModel.get("contentColor"); + visualObj.color = defaultColor; + } + function getter(key) { + return visualObj[key]; + } + function setter(key, value) { + visualObj[key] = value; + } + const mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)]; + const visualTypes = VisualMapping_default.prepareVisualTypes(mappings); + each(visualTypes, function(type) { + let visualMapping = mappings[type]; + if (opts.convertOpacityToAlpha && type === "opacity") { + type = "colorAlpha"; + visualMapping = mappings.__alphaForOpacity; + } + if (VisualMapping_default.dependsOn(type, visualCluster)) { + visualMapping && visualMapping.applyVisual(targetValue, getter, setter); + } + }); + return visualObj[visualCluster]; + } + positionGroup(group) { + const model = this.visualMapModel; + const api2 = this.api; + positionElement(group, model.getBoxLayoutParams(), {width: api2.getWidth(), height: api2.getHeight()}); + } + doRender(visualMapModel, ecModel, api2, payload) { + } +}; +var VisualMapView = VisualMapView2; +VisualMapView.type = "visualMap"; +var VisualMapView_default = VisualMapView; + +// src/component/visualMap/helper.ts +var paramsSet = [ + ["left", "right", "width"], + ["top", "bottom", "height"] +]; +function getItemAlign(visualMapModel, api2, itemSize) { + const modelOption = visualMapModel.option; + const itemAlign = modelOption.align; + if (itemAlign != null && itemAlign !== "auto") { + return itemAlign; + } + const ecSize = {width: api2.getWidth(), height: api2.getHeight()}; + const realIndex = modelOption.orient === "horizontal" ? 1 : 0; + const reals = paramsSet[realIndex]; + const fakeValue = [0, null, 10]; + const layoutInput = {}; + for (let i = 0; i < 3; i++) { + layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i]; + layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]]; + } + const rParam = [["x", "width", 3], ["y", "height", 0]][realIndex]; + const rect = getLayoutRect(layoutInput, ecSize, modelOption.padding); + return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1]; +} +function makeHighDownBatch(batch, visualMapModel) { + each(batch || [], function(batchItem) { + if (batchItem.dataIndex != null) { + batchItem.dataIndexInside = batchItem.dataIndex; + batchItem.dataIndex = null; + } + batchItem.highlightKey = "visualMap" + (visualMapModel ? visualMapModel.componentIndex : ""); + }); + return batch; +} + +// src/component/visualMap/ContinuousView.ts +var linearMap3 = linearMap; +var each15 = each; +var mathMin11 = Math.min; +var mathMax11 = Math.max; +var HOVER_LINK_SIZE = 12; +var HOVER_LINK_OUT = 6; +var ContinuousView2 = class extends VisualMapView_default { + constructor() { + super(...arguments); + this.type = ContinuousView2.type; + this._shapes = {}; + this._dataInterval = []; + this._handleEnds = []; + this._hoverLinkDataIndices = []; + } + init(ecModel, api2) { + super.init(ecModel, api2); + this._hoverLinkFromSeriesMouseOver = bind(this._hoverLinkFromSeriesMouseOver, this); + this._hideIndicator = bind(this._hideIndicator, this); + } + doRender(visualMapModel, ecModel, api2, payload) { + if (!payload || payload.type !== "selectDataRange" || payload.from !== this.uid) { + this._buildView(); + } + } + _buildView() { + this.group.removeAll(); + const visualMapModel = this.visualMapModel; + const thisGroup = this.group; + this._orient = visualMapModel.get("orient"); + this._useHandle = visualMapModel.get("calculable"); + this._resetInterval(); + this._renderBar(thisGroup); + const dataRangeText = visualMapModel.get("text"); + this._renderEndsText(thisGroup, dataRangeText, 0); + this._renderEndsText(thisGroup, dataRangeText, 1); + this._updateView(true); + this.renderBackground(thisGroup); + this._updateView(); + this._enableHoverLinkToSeries(); + this._enableHoverLinkFromSeries(); + this.positionGroup(thisGroup); + } + _renderEndsText(group, dataRangeText, endsIndex) { + if (!dataRangeText) { + return; + } + let text = dataRangeText[1 - endsIndex]; + text = text != null ? text + "" : ""; + const visualMapModel = this.visualMapModel; + const textGap = visualMapModel.get("textGap"); + const itemSize = visualMapModel.itemSize; + const barGroup = this._shapes.mainGroup; + const position2 = this._applyTransform([ + itemSize[0] / 2, + endsIndex === 0 ? -textGap : itemSize[1] + textGap + ], barGroup); + const align = this._applyTransform(endsIndex === 0 ? "bottom" : "top", barGroup); + const orient = this._orient; + const textStyleModel = this.visualMapModel.textStyleModel; + this.group.add(new Text_default({ + style: createTextStyle(textStyleModel, { + x: position2[0], + y: position2[1], + verticalAlign: orient === "horizontal" ? "middle" : align, + align: orient === "horizontal" ? align : "center", + text + }) + })); + } + _renderBar(targetGroup) { + const visualMapModel = this.visualMapModel; + const shapes = this._shapes; + const itemSize = visualMapModel.itemSize; + const orient = this._orient; + const useHandle = this._useHandle; + const itemAlign = getItemAlign(visualMapModel, this.api, itemSize); + const mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign); + const gradientBarGroup = new Group_default(); + mainGroup.add(gradientBarGroup); + gradientBarGroup.add(shapes.outOfRange = createPolygon()); + gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor2(this._orient) : null, bind(this._dragHandle, this, "all", false), bind(this._dragHandle, this, "all", true))); + gradientBarGroup.setClipPath(new Rect_default({ + shape: { + x: 0, + y: 0, + width: itemSize[0], + height: itemSize[1], + r: 3 + } + })); + const textRect = visualMapModel.textStyleModel.getTextRect("\u56FD"); + const textSize = mathMax11(textRect.width, textRect.height); + if (useHandle) { + shapes.handleThumbs = []; + shapes.handleLabels = []; + shapes.handleLabelPoints = []; + this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient); + this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient); + } + this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient); + targetGroup.add(mainGroup); + } + _createHandle(visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) { + const onDrift = bind(this._dragHandle, this, handleIndex, false); + const onDragEnd = bind(this._dragHandle, this, handleIndex, true); + const handleSize = parsePercent(visualMapModel.get("handleSize"), itemSize[0]); + const handleThumb = createSymbol(visualMapModel.get("handleIcon"), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true); + const cursor = getCursor2(this._orient); + handleThumb.attr({ + cursor, + draggable: true, + drift: onDrift, + ondragend: onDragEnd, + onmousemove(e2) { + stop(e2.event); + } + }); + handleThumb.x = itemSize[0] / 2; + handleThumb.useStyle(visualMapModel.getModel("handleStyle").getItemStyle()); + handleThumb.setStyle({ + strokeNoScale: true, + strokeFirst: true + }); + handleThumb.style.lineWidth *= 2; + handleThumb.ensureState("emphasis").style = visualMapModel.getModel(["emphasis", "handleStyle"]).getItemStyle(); + setAsHighDownDispatcher(handleThumb, true); + mainGroup.add(handleThumb); + const textStyleModel = this.visualMapModel.textStyleModel; + const handleLabel = new Text_default({ + cursor, + draggable: true, + drift: onDrift, + onmousemove(e2) { + stop(e2.event); + }, + ondragend: onDragEnd, + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: "" + }) + }); + handleLabel.ensureState("blur").style = { + opacity: 0.1 + }; + handleLabel.stateTransition = {duration: 200}; + this.group.add(handleLabel); + const handleLabelPoint = [handleSize, 0]; + const shapes = this._shapes; + shapes.handleThumbs[handleIndex] = handleThumb; + shapes.handleLabelPoints[handleIndex] = handleLabelPoint; + shapes.handleLabels[handleIndex] = handleLabel; + } + _createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient) { + const scale4 = parsePercent(visualMapModel.get("indicatorSize"), itemSize[0]); + const indicator = createSymbol(visualMapModel.get("indicatorIcon"), -scale4 / 2, -scale4 / 2, scale4, scale4, null, true); + indicator.attr({ + cursor: "move", + invisible: true, + silent: true, + x: itemSize[0] / 2 + }); + const indicatorStyle = visualMapModel.getModel("indicatorStyle").getItemStyle(); + if (indicator instanceof Image_default) { + const pathStyle = indicator.style; + indicator.useStyle(extend({ + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, indicatorStyle)); + } else { + indicator.useStyle(indicatorStyle); + } + mainGroup.add(indicator); + const textStyleModel = this.visualMapModel.textStyleModel; + const indicatorLabel = new Text_default({ + silent: true, + invisible: true, + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: "" + }) + }); + this.group.add(indicatorLabel); + const indicatorLabelPoint = [ + (orient === "horizontal" ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, + 0 + ]; + const shapes = this._shapes; + shapes.indicator = indicator; + shapes.indicatorLabel = indicatorLabel; + shapes.indicatorLabelPoint = indicatorLabelPoint; + this._firstShowIndicator = true; + } + _dragHandle(handleIndex, isEnd, dx, dy) { + if (!this._useHandle) { + return; + } + this._dragging = !isEnd; + if (!isEnd) { + const vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true); + this._updateInterval(handleIndex, vertex[1]); + this._hideIndicator(); + this._updateView(); + } + if (isEnd === !this.visualMapModel.get("realtime")) { + this.api.dispatchAction({ + type: "selectDataRange", + from: this.uid, + visualMapId: this.visualMapModel.id, + selected: this._dataInterval.slice() + }); } - - function isMultiple(elements) { - return isArray(elements[0]); + if (isEnd) { + !this._hovering && this._clearHoverLinkToSeries(); + } else if (useHoverLinkOnHandle(this.visualMapModel)) { + this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); + } + } + _resetInterval() { + const visualMapModel = this.visualMapModel; + const dataInterval = this._dataInterval = visualMapModel.getSelected(); + const dataExtent = visualMapModel.getExtent(); + const sizeExtent = [0, visualMapModel.itemSize[1]]; + this._handleEnds = [ + linearMap3(dataInterval[0], dataExtent, sizeExtent, true), + linearMap3(dataInterval[1], dataExtent, sizeExtent, true) + ]; + } + _updateInterval(handleIndex, delta) { + delta = delta || 0; + const visualMapModel = this.visualMapModel; + const handleEnds = this._handleEnds; + const sizeExtent = [0, visualMapModel.itemSize[1]]; + sliderMove(delta, handleEnds, sizeExtent, handleIndex, 0); + const dataExtent = visualMapModel.getExtent(); + this._dataInterval = [ + linearMap3(handleEnds[0], sizeExtent, dataExtent, true), + linearMap3(handleEnds[1], sizeExtent, dataExtent, true) + ]; + } + _updateView(forSketch) { + const visualMapModel = this.visualMapModel; + const dataExtent = visualMapModel.getExtent(); + const shapes = this._shapes; + const outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; + const inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; + const visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, "inRange"); + const visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, "outOfRange"); + shapes.inRange.setStyle({ + fill: visualInRange.barColor + }).setShape("points", visualInRange.barPoints); + shapes.outOfRange.setStyle({ + fill: visualOutOfRange.barColor + }).setShape("points", visualOutOfRange.barPoints); + this._updateHandle(inRangeHandleEnds, visualInRange); + } + _createBarVisual(dataInterval, dataExtent, handleEnds, forceState) { + const opts = { + forceState, + convertOpacityToAlpha: true + }; + const colorStops = this._makeColorGradient(dataInterval, opts); + const symbolSizes = [ + this.getControllerVisual(dataInterval[0], "symbolSize", opts), + this.getControllerVisual(dataInterval[1], "symbolSize", opts) + ]; + const barPoints = this._createBarPoints(handleEnds, symbolSizes); + return { + barColor: new LinearGradient_default(0, 0, 0, 1, colorStops), + barPoints, + handlesColor: [ + colorStops[0].color, + colorStops[colorStops.length - 1].color + ] + }; + } + _makeColorGradient(dataInterval, opts) { + const sampleNumber = 100; + const colorStops = []; + const step = (dataInterval[1] - dataInterval[0]) / sampleNumber; + colorStops.push({ + color: this.getControllerVisual(dataInterval[0], "color", opts), + offset: 0 + }); + for (let i = 1; i < sampleNumber; i++) { + const currValue = dataInterval[0] + step * i; + if (currValue > dataInterval[1]) { + break; + } + colorStops.push({ + color: this.getControllerVisual(currValue, "color", opts), + offset: i / sampleNumber + }); } - function prepareMorphBatches(one, many) { - var batches = []; - var batchCount = one.length; - for (var i = 0; i < batchCount; i++) { - batches.push({ - one: one[i], - many: [] - }); + colorStops.push({ + color: this.getControllerVisual(dataInterval[1], "color", opts), + offset: 1 + }); + return colorStops; + } + _createBarPoints(handleEnds, symbolSizes) { + const itemSize = this.visualMapModel.itemSize; + return [ + [itemSize[0] - symbolSizes[0], handleEnds[0]], + [itemSize[0], handleEnds[0]], + [itemSize[0], handleEnds[1]], + [itemSize[0] - symbolSizes[1], handleEnds[1]] + ]; + } + _createBarGroup(itemAlign) { + const orient = this._orient; + const inverse = this.visualMapModel.get("inverse"); + return new Group_default(orient === "horizontal" && !inverse ? {scaleX: itemAlign === "bottom" ? 1 : -1, rotation: Math.PI / 2} : orient === "horizontal" && inverse ? {scaleX: itemAlign === "bottom" ? -1 : 1, rotation: -Math.PI / 2} : orient === "vertical" && !inverse ? {scaleX: itemAlign === "left" ? 1 : -1, scaleY: -1} : {scaleX: itemAlign === "left" ? 1 : -1}); + } + _updateHandle(handleEnds, visualInRange) { + if (!this._useHandle) { + return; + } + const shapes = this._shapes; + const visualMapModel = this.visualMapModel; + const handleThumbs = shapes.handleThumbs; + const handleLabels = shapes.handleLabels; + const itemSize = visualMapModel.itemSize; + const dataExtent = visualMapModel.getExtent(); + const align = this._applyTransform("left", shapes.mainGroup); + each15([0, 1], function(handleIndex) { + const handleThumb = handleThumbs[handleIndex]; + handleThumb.setStyle("fill", visualInRange.handlesColor[handleIndex]); + handleThumb.y = handleEnds[handleIndex]; + const val = linearMap3(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true); + const symbolSize = this.getControllerVisual(val, "symbolSize"); + handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0]; + handleThumb.x = itemSize[0] - symbolSize / 2; + const textPoint = applyTransform2(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group)); + if (this._orient === "horizontal") { + const minimumOffset = align === "left" || align === "top" ? (itemSize[0] - symbolSize) / 2 : (itemSize[0] - symbolSize) / -2; + textPoint[1] += minimumOffset; + } + handleLabels[handleIndex].setStyle({ + x: textPoint[0], + y: textPoint[1], + text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), + verticalAlign: "middle", + align: this._orient === "vertical" ? this._applyTransform("left", shapes.mainGroup) : "center" + }); + }, this); + } + _showIndicator(cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { + const visualMapModel = this.visualMapModel; + const dataExtent = visualMapModel.getExtent(); + const itemSize = visualMapModel.itemSize; + const sizeExtent = [0, itemSize[1]]; + const shapes = this._shapes; + const indicator = shapes.indicator; + if (!indicator) { + return; + } + indicator.attr("invisible", false); + const opts = {convertOpacityToAlpha: true}; + const color2 = this.getControllerVisual(cursorValue, "color", opts); + const symbolSize = this.getControllerVisual(cursorValue, "symbolSize"); + const y = linearMap3(cursorValue, dataExtent, sizeExtent, true); + const x = itemSize[0] - symbolSize / 2; + const oldIndicatorPos = {x: indicator.x, y: indicator.y}; + indicator.y = y; + indicator.x = x; + const textPoint = applyTransform2(shapes.indicatorLabelPoint, getTransform(indicator, this.group)); + const indicatorLabel = shapes.indicatorLabel; + indicatorLabel.attr("invisible", false); + const align = this._applyTransform("left", shapes.mainGroup); + const orient = this._orient; + const isHorizontal = orient === "horizontal"; + indicatorLabel.setStyle({ + text: (rangeSymbol ? rangeSymbol : "") + visualMapModel.formatValueText(textValue), + verticalAlign: isHorizontal ? align : "middle", + align: isHorizontal ? "center" : align + }); + const indicatorNewProps = { + x, + y, + style: { + fill: color2 } - for (var i = 0; i < many.length; i++) { - var len = many[i].length; - var k = void 0; - for (k = 0; k < len; k++) { - batches[k % batchCount].many.push(many[i][k]); - } - } - var off = 0; - // If one has more paths than each one of many. average them. - for (var i = batchCount - 1; i >= 0; i--) { - if (!batches[i].many.length) { - var moveFrom = batches[off].many; - if (moveFrom.length <= 1) { - // Not enough - // Start from the first one. - if (off) { - off = 0; - } else { - return batches; - } - } - var len = moveFrom.length; - var mid = Math.ceil(len / 2); - batches[i].many = moveFrom.slice(mid, len); - batches[off].many = moveFrom.slice(0, mid); - off++; - } - } - return batches; - } - var pathDividers = { - clone: function (params) { - var ret = []; - // Fitting the alpha - var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count); - for (var i = 0; i < params.count; i++) { - var cloned = clonePath(params.path); - cloned.setStyle('opacity', approxOpacity); - ret.push(cloned); - } - return ret; - }, - // Use the default divider - split: null }; - function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) { - if (!from.length || !to.length) { - return; + const labelNewProps = { + style: { + x: textPoint[0], + y: textPoint[1] } - var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex); - if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) { - return; + }; + if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) { + const animationCfg = { + duration: 100, + easing: "cubicInOut", + additive: true + }; + indicator.x = oldIndicatorPos.x; + indicator.y = oldIndicatorPos.y; + indicator.animateTo(indicatorNewProps, animationCfg); + indicatorLabel.animateTo(labelNewProps, animationCfg); + } else { + indicator.attr(indicatorNewProps); + indicatorLabel.attr(labelNewProps); + } + this._firstShowIndicator = false; + const handleLabels = this._shapes.handleLabels; + if (handleLabels) { + for (let i = 0; i < handleLabels.length; i++) { + this.api.enterBlur(handleLabels[i]); + } + } + } + _enableHoverLinkToSeries() { + const self2 = this; + this._shapes.mainGroup.on("mousemove", function(e2) { + self2._hovering = true; + if (!self2._dragging) { + const itemSize = self2.visualMapModel.itemSize; + const pos = self2._applyTransform([e2.offsetX, e2.offsetY], self2._shapes.mainGroup, true, true); + pos[1] = mathMin11(mathMax11(0, pos[1]), itemSize[1]); + self2._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]); + } + }).on("mouseout", function() { + self2._hovering = false; + !self2._dragging && self2._clearHoverLinkToSeries(); + }); + } + _enableHoverLinkFromSeries() { + const zr = this.api.getZr(); + if (this.visualMapModel.option.hoverLink) { + zr.on("mouseover", this._hoverLinkFromSeriesMouseOver, this); + zr.on("mouseout", this._hideIndicator, this); + } else { + this._clearHoverLinkFromSeries(); + } + } + _doHoverLinkToSeries(cursorPos, hoverOnBar) { + const visualMapModel = this.visualMapModel; + const itemSize = visualMapModel.itemSize; + if (!visualMapModel.option.hoverLink) { + return; + } + const sizeExtent = [0, itemSize[1]]; + const dataExtent = visualMapModel.getExtent(); + cursorPos = mathMin11(mathMax11(sizeExtent[0], cursorPos), sizeExtent[1]); + const halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); + const hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; + const cursorValue = linearMap3(cursorPos, sizeExtent, dataExtent, true); + const valueRange = [ + linearMap3(hoverRange[0], sizeExtent, dataExtent, true), + linearMap3(hoverRange[1], sizeExtent, dataExtent, true) + ]; + hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); + hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); + if (hoverOnBar) { + if (valueRange[0] === -Infinity) { + this._showIndicator(cursorValue, valueRange[1], "< ", halfHoverLinkSize); + } else if (valueRange[1] === Infinity) { + this._showIndicator(cursorValue, valueRange[0], "> ", halfHoverLinkSize); + } else { + this._showIndicator(cursorValue, cursorValue, "\u2248 ", halfHoverLinkSize); + } + } + const oldBatch = this._hoverLinkDataIndices; + let newBatch = []; + if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { + newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); + } + const resultBatches = compressBatches(oldBatch, newBatch); + this._dispatchHighDown("downplay", makeHighDownBatch(resultBatches[0], visualMapModel)); + this._dispatchHighDown("highlight", makeHighDownBatch(resultBatches[1], visualMapModel)); + } + _hoverLinkFromSeriesMouseOver(e2) { + let ecData; + findEventDispatcher(e2.target, (target) => { + const currECData = getECData(target); + if (currECData.dataIndex != null) { + ecData = currECData; + return true; } - var animationDelay = seriesModel.getModel('universalTransition').get('delay'); - var animationCfg = Object.assign({ - // Need to setToFinal so the further calculation based on the style can be correct. - // Like emphasis color. - setToFinal: true - }, updateAnimationCfg); - var many; - var one; - if (isMultiple(from)) { - // manyToOne - many = from; - one = to; - } - if (isMultiple(to)) { - // oneToMany - many = to; - one = from; - } - function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) { - var batchMany = batch.many; - var batchOne = batch.one; - if (batchMany.length === 1 && !forceManyOne) { - // Is one to one - var batchFrom = fromIsMany ? batchMany[0] : batchOne; - var batchTo = fromIsMany ? batchOne : batchMany[0]; - if (isCombineMorphing(batchFrom)) { - // Keep doing combine animation. - morphOneBatch({ - many: [batchFrom], - one: batchTo - }, true, animateIndex, animateCount, true); - } else { - var individualAnimationCfg = animationDelay ? defaults({ - delay: animationDelay(animateIndex, animateCount) - }, animationCfg) : animationCfg; - morphPath(batchFrom, batchTo, individualAnimationCfg); - animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg); + }, true); + if (!ecData) { + return; + } + const dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex); + const visualMapModel = this.visualMapModel; + if (!visualMapModel.isTargetSeries(dataModel)) { + return; + } + const data = dataModel.getData(ecData.dataType); + const value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex); + if (!isNaN(value)) { + this._showIndicator(value, value); + } + } + _hideIndicator() { + const shapes = this._shapes; + shapes.indicator && shapes.indicator.attr("invisible", true); + shapes.indicatorLabel && shapes.indicatorLabel.attr("invisible", true); + const handleLabels = this._shapes.handleLabels; + if (handleLabels) { + for (let i = 0; i < handleLabels.length; i++) { + this.api.leaveBlur(handleLabels[i]); + } + } + } + _clearHoverLinkToSeries() { + this._hideIndicator(); + const indices = this._hoverLinkDataIndices; + this._dispatchHighDown("downplay", makeHighDownBatch(indices, this.visualMapModel)); + indices.length = 0; + } + _clearHoverLinkFromSeries() { + this._hideIndicator(); + const zr = this.api.getZr(); + zr.off("mouseover", this._hoverLinkFromSeriesMouseOver); + zr.off("mouseout", this._hideIndicator); + } + _applyTransform(vertex, element, inverse, global2) { + const transform2 = getTransform(element, global2 ? null : this.group); + return isArray(vertex) ? applyTransform2(vertex, transform2, inverse) : transformDirection(vertex, transform2, inverse); + } + _dispatchHighDown(type, batch) { + batch && batch.length && this.api.dispatchAction({ + type, + batch + }); + } + dispose() { + this._clearHoverLinkFromSeries(); + this._clearHoverLinkToSeries(); + } +}; +var ContinuousView = ContinuousView2; +ContinuousView.type = "visualMap.continuous"; +function createPolygon(points4, cursor, onDrift, onDragEnd) { + return new Polygon_default({ + shape: {points: points4}, + draggable: !!onDrift, + cursor, + drift: onDrift, + onmousemove(e2) { + stop(e2.event); + }, + ondragend: onDragEnd + }); +} +function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) { + let halfHoverLinkSize = HOVER_LINK_SIZE / 2; + const hoverLinkDataSize = visualMapModel.get("hoverLinkDataSize"); + if (hoverLinkDataSize) { + halfHoverLinkSize = linearMap3(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; + } + return halfHoverLinkSize; +} +function useHoverLinkOnHandle(visualMapModel) { + const hoverLinkOnHandle = visualMapModel.get("hoverLinkOnHandle"); + return !!(hoverLinkOnHandle == null ? visualMapModel.get("realtime") : hoverLinkOnHandle); +} +function getCursor2(orient) { + return orient === "vertical" ? "ns-resize" : "ew-resize"; +} +var ContinuousView_default = ContinuousView; + +// src/component/visualMap/visualMapAction.ts +var visualMapActionInfo = { + type: "selectDataRange", + event: "dataRangeSelected", + update: "update" +}; +var visualMapActionHander = function(payload, ecModel) { + ecModel.eachComponent({mainType: "visualMap", query: payload}, function(model) { + model.setSelected(payload.selected); + }); +}; + +// src/component/visualMap/visualEncoding.ts +var visualMapEncodingHandlers = [ + { + createOnAllSeries: true, + reset: function(seriesModel, ecModel) { + const resetDefines = []; + ecModel.eachComponent("visualMap", function(visualMapModel) { + const pipelineContext = seriesModel.pipelineContext; + if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) { + return; + } + resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData()))); + }); + return resetDefines; + } + }, + { + createOnAllSeries: true, + reset: function(seriesModel, ecModel) { + const data = seriesModel.getData(); + const visualMetaList = []; + ecModel.eachComponent("visualMap", function(visualMapModel) { + if (visualMapModel.isTargetSeries(seriesModel)) { + const visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || { + stops: [], + outerColors: [] + }; + const dimIdx = visualMapModel.getDataDimensionIndex(data); + if (dimIdx >= 0) { + visualMeta.dimension = dimIdx; + visualMetaList.push(visualMeta); } - } else { - var separateAnimationCfg = defaults({ - dividePath: pathDividers[divideShape], - individualDelay: animationDelay && function (idx, count, fromPath, toPath) { - return animationDelay(idx + animateIndex, animateCount); - } - }, animationCfg); - var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg), - fromIndividuals = _a.fromIndividuals, - toIndividuals = _a.toIndividuals; - var count = fromIndividuals.length; - for (var k = 0; k < count; k++) { - var individualAnimationCfg = animationDelay ? defaults({ - delay: animationDelay(k, count) - }, animationCfg) : animationCfg; - animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg); + } + }); + seriesModel.getData().setVisual("visualMeta", visualMetaList); + } + } +]; +function getColorVisual(seriesModel, visualMapModel, value, valueState) { + const mappings = visualMapModel.targetVisuals[valueState]; + const visualTypes = VisualMapping_default.prepareVisualTypes(mappings); + const resultVisual = { + color: getVisualFromData(seriesModel.getData(), "color") + }; + for (let i = 0, len2 = visualTypes.length; i < len2; i++) { + const type = visualTypes[i]; + const mapping = mappings[type === "opacity" ? "__alphaForOpacity" : type]; + mapping && mapping.applyVisual(value, getVisual, setVisual); + } + return resultVisual.color; + function getVisual(key) { + return resultVisual[key]; + } + function setVisual(key, value2) { + resultVisual[key] = value2; + } +} + +// src/component/visualMap/preprocessor.ts +var each16 = each; +function visualMapPreprocessor(option) { + let visualMap = option && option.visualMap; + if (!isArray(visualMap)) { + visualMap = visualMap ? [visualMap] : []; + } + each16(visualMap, function(opt) { + if (!opt) { + return; + } + if (has2(opt, "splitList") && !has2(opt, "pieces")) { + opt.pieces = opt.splitList; + delete opt.splitList; + } + const pieces = opt.pieces; + if (pieces && isArray(pieces)) { + each16(pieces, function(piece) { + if (isObject(piece)) { + if (has2(piece, "start") && !has2(piece, "min")) { + piece.min = piece.start; + } + if (has2(piece, "end") && !has2(piece, "max")) { + piece.max = piece.end; } } - } - var fromIsMany = many ? many === from - // Is one to one. If the path number not match. also needs do merge and separate morphing. - : from.length > to.length; - var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]); - var animateCount = 0; - for (var i = 0; i < morphBatches.length; i++) { - animateCount += morphBatches[i].many.length; - } - var animateIndex = 0; - for (var i = 0; i < morphBatches.length; i++) { - morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount); - animateIndex += morphBatches[i].many.length; - } + }); } - function getPathList(elements) { - if (!elements) { - return []; + }); +} +function has2(obj, name) { + return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); +} + +// src/component/visualMap/installCommon.ts +var installed2 = false; +function installCommon2(registers) { + if (installed2) { + return; + } + installed2 = true; + registers.registerSubTypeDefaulter("visualMap", function(option) { + return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? "continuous" : "piecewise"; + }); + registers.registerAction(visualMapActionInfo, visualMapActionHander); + each(visualMapEncodingHandlers, (handler) => { + registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler); + }); + registers.registerPreprocessor(visualMapPreprocessor); +} + +// src/component/visualMap/installVisualMapContinuous.ts +function install50(registers) { + registers.registerComponentModel(ContinuousModel_default); + registers.registerComponentView(ContinuousView_default); + installCommon2(registers); +} + +// src/component/visualMap/PiecewiseModel.ts +var PiecewiseModel2 = class extends VisualMapModel_default { + constructor() { + super(...arguments); + this.type = PiecewiseModel2.type; + this._pieceList = []; + } + optionUpdated(newOption, isInit) { + super.optionUpdated.apply(this, arguments); + this.resetExtent(); + const mode = this._mode = this._determineMode(); + this._pieceList = []; + resetMethods[this._mode].call(this, this._pieceList); + this._resetSelected(newOption, isInit); + const categories = this.option.categories; + this.resetVisual(function(mappingOption, state) { + if (mode === "categories") { + mappingOption.mappingMethod = "category"; + mappingOption.categories = clone(categories); + } else { + mappingOption.dataExtent = this.getExtent(); + mappingOption.mappingMethod = "piecewise"; + mappingOption.pieceList = map(this._pieceList, function(piece) { + piece = clone(piece); + if (state !== "inRange") { + piece.visual = null; + } + return piece; + }); } - if (isArray(elements)) { - var pathList_1 = []; - for (var i = 0; i < elements.length; i++) { - pathList_1.push(getPathList(elements[i])); + }); + } + completeVisualOption() { + const option = this.option; + const visualTypesInPieces = {}; + const visualTypes = VisualMapping_default.listVisualTypes(); + const isCategory2 = this.isCategory(); + each(option.pieces, function(piece) { + each(visualTypes, function(visualType) { + if (piece.hasOwnProperty(visualType)) { + visualTypesInPieces[visualType] = 1; } - return pathList_1; - } - var pathList = []; - elements.traverse(function (el) { - if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) { - pathList.push(el); + }); + }); + each(visualTypesInPieces, function(v, visualType) { + let exists = false; + each(this.stateList, function(state) { + exists = exists || has3(option, state, visualType) || has3(option.target, state, visualType); + }, this); + !exists && each(this.stateList, function(state) { + (option[state] || (option[state] = {}))[visualType] = visualDefault_default.get(visualType, state === "inRange" ? "active" : "inactive", isCategory2); + }); + }, this); + function has3(obj, state, visualType) { + return obj && obj[state] && obj[state].hasOwnProperty(visualType); + } + super.completeVisualOption.apply(this, arguments); + } + _resetSelected(newOption, isInit) { + const thisOption = this.option; + const pieceList = this._pieceList; + const selected = (isInit ? thisOption : newOption).selected || {}; + thisOption.selected = selected; + each(pieceList, function(piece, index) { + const key = this.getSelectedMapKey(piece); + if (!selected.hasOwnProperty(key)) { + selected[key] = true; + } + }, this); + if (thisOption.selectedMode === "single") { + let hasSel = false; + each(pieceList, function(piece, index) { + const key = this.getSelectedMapKey(piece); + if (selected[key]) { + hasSel ? selected[key] = false : hasSel = true; } + }, this); + } + } + getItemSymbol() { + return this.get("itemSymbol"); + } + getSelectedMapKey(piece) { + return this._mode === "categories" ? piece.value + "" : piece.index + ""; + } + getPieceList() { + return this._pieceList; + } + _determineMode() { + const option = this.option; + return option.pieces && option.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber"; + } + setSelected(selected) { + this.option.selected = clone(selected); + } + getValueState(value) { + const index = VisualMapping_default.findPieceIndex(value, this._pieceList); + return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? "inRange" : "outOfRange" : "outOfRange"; + } + findTargetDataIndices(pieceIndex) { + const result = []; + const pieceList = this._pieceList; + this.eachTargetSeries(function(seriesModel) { + const dataIndices = []; + const data = seriesModel.getData(); + data.each(this.getDataDimensionIndex(data), function(value, dataIndex) { + const pIdx = VisualMapping_default.findPieceIndex(value, pieceList); + pIdx === pieceIndex && dataIndices.push(dataIndex); + }, this); + result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); + }, this); + return result; + } + getRepresentValue(piece) { + let representValue; + if (this.isCategory()) { + representValue = piece.value; + } else { + if (piece.value != null) { + representValue = piece.value; + } else { + const pieceInterval = piece.interval || []; + representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2; + } + } + return representValue; + } + getVisualMeta(getColorVisual2) { + if (this.isCategory()) { + return; + } + const stops = []; + const outerColors = ["", ""]; + const visualMapModel = this; + function setStop(interval, valueState) { + const representValue = visualMapModel.getRepresentValue({ + interval }); - return pathList; - } - - var DATA_COUNT_THRESHOLD = 1e4; - var TRANSITION_NONE = 0; - var TRANSITION_P2C = 1; - var TRANSITION_C2P = 2; - var getUniversalTransitionGlobalStore = makeInner(); - function getDimension(data, visualDimension) { - var dimensions = data.dimensions; - for (var i = 0; i < dimensions.length; i++) { - var dimInfo = data.getDimensionInfo(dimensions[i]); - if (dimInfo && dimInfo.otherDims[visualDimension] === 0) { - return dimensions[i]; - } - } - } - // get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string) - function getValueByDimension(data, dataIndex, dimension) { - var dimInfo = data.getDimensionInfo(dimension); - var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta; - if (dimInfo) { - var value = data.get(dimInfo.name, dataIndex); - if (dimOrdinalMeta) { - return dimOrdinalMeta.categories[value] || value + ''; - } - return value + ''; - } - } - function getGroupId(data, dataIndex, dataGroupId, isChild) { - // try to get groupId from encode - var visualDimension = isChild ? 'itemChildGroupId' : 'itemGroupId'; - var groupIdDim = getDimension(data, visualDimension); - if (groupIdDim) { - var groupId = getValueByDimension(data, dataIndex, groupIdDim); - return groupId; - } - // try to get groupId from raw data item - var rawDataItem = data.getRawDataItem(dataIndex); - var property = isChild ? 'childGroupId' : 'groupId'; - if (rawDataItem && rawDataItem[property]) { - return rawDataItem[property] + ''; - } - // fallback - if (isChild) { - return; - } - // try to use series.dataGroupId as groupId, otherwise use dataItem's id as groupId - return dataGroupId || data.getId(dataIndex); - } - // flatten all data items from different serieses into one arrary - function flattenDataDiffItems(list) { - var items = []; - each(list, function (seriesInfo) { - var data = seriesInfo.data; - var dataGroupId = seriesInfo.dataGroupId; - if (data.count() > DATA_COUNT_THRESHOLD) { - if ("development" !== 'production') { - warn('Universal transition is disabled on large data > 10k.'); + if (!valueState) { + valueState = visualMapModel.getValueState(representValue); + } + const color2 = getColorVisual2(representValue, valueState); + if (interval[0] === -Infinity) { + outerColors[0] = color2; + } else if (interval[1] === Infinity) { + outerColors[1] = color2; + } else { + stops.push({value: interval[0], color: color2}, {value: interval[1], color: color2}); + } + } + const pieceList = this._pieceList.slice(); + if (!pieceList.length) { + pieceList.push({interval: [-Infinity, Infinity]}); + } else { + let 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]}); + } + let curr = -Infinity; + each(pieceList, function(piece) { + const interval = piece.interval; + if (interval) { + interval[0] > curr && setStop([curr, interval[0]], "outOfRange"); + setStop(interval.slice()); + curr = interval[1]; + } + }, this); + return {stops, outerColors}; + } +}; +var PiecewiseModel = PiecewiseModel2; +PiecewiseModel.type = "visualMap.piecewise"; +PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel_default.defaultOption, { + selected: null, + minOpen: false, + maxOpen: false, + align: "auto", + itemWidth: 20, + itemHeight: 14, + itemSymbol: "roundRect", + pieces: null, + categories: null, + splitNumber: 5, + selectedMode: "multiple", + itemGap: 10, + hoverLink: true +}); +var resetMethods = { + splitNumber(outPieceList) { + const thisOption = this.option; + let precision = Math.min(thisOption.precision, 20); + const dataExtent = this.getExtent(); + let splitNumber = thisOption.splitNumber; + splitNumber = Math.max(parseInt(splitNumber, 10), 1); + thisOption.splitNumber = splitNumber; + let splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; + while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { + precision++; + } + thisOption.precision = precision; + splitStep = +splitStep.toFixed(precision); + if (thisOption.minOpen) { + outPieceList.push({ + interval: [-Infinity, dataExtent[0]], + close: [0, 0] + }); + } + for (let index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) { + const max3 = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep; + outPieceList.push({ + interval: [curr, max3], + close: [1, 1] + }); + } + if (thisOption.maxOpen) { + outPieceList.push({ + interval: [dataExtent[1], Infinity], + close: [0, 0] + }); + } + reformIntervals(outPieceList); + each(outPieceList, function(piece, index) { + piece.index = index; + piece.text = this.formatValueText(piece.interval); + }, this); + }, + categories(outPieceList) { + const thisOption = this.option; + each(thisOption.categories, function(cate) { + outPieceList.push({ + text: this.formatValueText(cate, true), + value: cate + }); + }, this); + normalizeReverse(thisOption, outPieceList); + }, + pieces(outPieceList) { + const thisOption = this.option; + each(thisOption.pieces, function(pieceListItem, index) { + if (!isObject(pieceListItem)) { + pieceListItem = {value: pieceListItem}; + } + const item = {text: "", index}; + if (pieceListItem.label != null) { + item.text = pieceListItem.label; + } + if (pieceListItem.hasOwnProperty("value")) { + const value = item.value = pieceListItem.value; + item.interval = [value, value]; + item.close = [1, 1]; + } else { + const interval = item.interval = []; + const close = item.close = [0, 0]; + const closeList = [1, 0, 1]; + const infinityList = [-Infinity, Infinity]; + const useMinMax = []; + for (let lg = 0; lg < 2; lg++) { + const names = [["gte", "gt", "min"], ["lte", "lt", "max"]][lg]; + for (let 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 (true) { + if (interval[0] > interval[1]) { + console.warn("Piece " + index + "is illegal: " + interval + " lower bound should not greater then uppper bound."); + } + } + if (interval[0] === interval[1] && close[0] && close[1]) { + item.value = interval[0]; + } + } + item.visual = VisualMapping_default.retrieveVisuals(pieceListItem); + outPieceList.push(item); + }, this); + normalizeReverse(thisOption, outPieceList); + reformIntervals(outPieceList); + each(outPieceList, function(piece) { + const close = piece.close; + const edgeSymbols = [["<", "\u2264"][close[1]], [">", "\u2265"][close[0]]]; + piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols); + }, this); + } +}; +function normalizeReverse(thisOption, pieceList) { + const inverse = thisOption.inverse; + if (thisOption.orient === "vertical" ? !inverse : inverse) { + pieceList.reverse(); + } +} +var PiecewiseModel_default = PiecewiseModel; + +// src/component/visualMap/PiecewiseView.ts +var PiecewiseVisualMapView2 = class extends VisualMapView_default { + constructor() { + super(...arguments); + this.type = PiecewiseVisualMapView2.type; + } + doRender() { + const thisGroup = this.group; + thisGroup.removeAll(); + const visualMapModel = this.visualMapModel; + const textGap = visualMapModel.get("textGap"); + const textStyleModel = visualMapModel.textStyleModel; + const textFont = textStyleModel.getFont(); + const textFill = textStyleModel.getTextColor(); + const itemAlign = this._getItemAlign(); + const itemSize = visualMapModel.itemSize; + const viewData = this._getViewData(); + const endsText = viewData.endsText; + const showLabel = retrieve(visualMapModel.get("showLabel", true), !endsText); + endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign); + each(viewData.viewPieceList, function(item) { + const piece = item.piece; + const itemGroup = new Group_default(); + itemGroup.onclick = bind(this._onItemClick, this, piece); + this._enableHoverLink(itemGroup, item.indexInModelPieceList); + const representValue = visualMapModel.getRepresentValue(piece); + this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]); + if (showLabel) { + const visualState = this.visualMapModel.getValueState(representValue); + itemGroup.add(new Text_default({ + style: { + x: itemAlign === "right" ? -textGap : itemSize[0] + textGap, + y: itemSize[1] / 2, + text: piece.text, + verticalAlign: "middle", + align: itemAlign, + font: textFont, + fill: textFill, + opacity: visualState === "outOfRange" ? 0.5 : 1 } + })); + } + thisGroup.add(itemGroup); + }, this); + endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign); + box(visualMapModel.get("orient"), thisGroup, visualMapModel.get("itemGap")); + this.renderBackground(thisGroup); + this.positionGroup(thisGroup); + } + _enableHoverLink(itemGroup, pieceIndex) { + itemGroup.on("mouseover", () => onHoverLink("highlight")).on("mouseout", () => onHoverLink("downplay")); + const onHoverLink = (method) => { + const visualMapModel = this.visualMapModel; + visualMapModel.option.hoverLink && this.api.dispatchAction({ + type: method, + batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel) + }); + }; + } + _getItemAlign() { + const visualMapModel = this.visualMapModel; + const modelOption = visualMapModel.option; + if (modelOption.orient === "vertical") { + return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize); + } else { + let align = modelOption.align; + if (!align || align === "auto") { + align = "left"; + } + return align; + } + } + _renderEndsText(group, text, itemSize, showLabel, itemAlign) { + if (!text) { + return; + } + const itemGroup = new Group_default(); + const textStyleModel = this.visualMapModel.textStyleModel; + itemGroup.add(new Text_default({ + style: createTextStyle(textStyleModel, { + x: showLabel ? itemAlign === "right" ? itemSize[0] : 0 : itemSize[0] / 2, + y: itemSize[1] / 2, + verticalAlign: "middle", + align: showLabel ? itemAlign : "center", + text + }) + })); + group.add(itemGroup); + } + _getViewData() { + const visualMapModel = this.visualMapModel; + const viewPieceList = map(visualMapModel.getPieceList(), function(piece, index) { + return {piece, indexInModelPieceList: index}; + }); + let endsText = visualMapModel.get("text"); + const orient = visualMapModel.get("orient"); + const inverse = visualMapModel.get("inverse"); + if (orient === "horizontal" ? inverse : !inverse) { + viewPieceList.reverse(); + } else if (endsText) { + endsText = endsText.slice().reverse(); + } + return {viewPieceList, endsText}; + } + _createItemSymbol(group, representValue, shapeParam) { + group.add(createSymbol(this.getControllerVisual(representValue, "symbol"), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], this.getControllerVisual(representValue, "color"))); + } + _onItemClick(piece) { + const visualMapModel = this.visualMapModel; + const option = visualMapModel.option; + const selectedMode = option.selectedMode; + if (!selectedMode) { + return; + } + const selected = clone(option.selected); + const newKey = visualMapModel.getSelectedMapKey(piece); + if (selectedMode === "single" || selectedMode === true) { + selected[newKey] = true; + each(selected, function(o, key) { + selected[key] = key === newKey; + }); + } else { + selected[newKey] = !selected[newKey]; + } + this.api.dispatchAction({ + type: "selectDataRange", + from: this.uid, + visualMapId: this.visualMapModel.id, + selected + }); + } +}; +var PiecewiseVisualMapView = PiecewiseVisualMapView2; +PiecewiseVisualMapView.type = "visualMap.piecewise"; +var PiecewiseView_default = PiecewiseVisualMapView; + +// src/component/visualMap/installVisualMapPiecewise.ts +function install51(registers) { + registers.registerComponentModel(PiecewiseModel_default); + registers.registerComponentView(PiecewiseView_default); + installCommon2(registers); +} + +// src/component/visualMap/install.ts +function install52(registers) { + use(install50); + use(install51); +} + +// src/visual/aria.ts +var DEFAULT_OPTION = { + label: { + enabled: true + }, + decal: { + show: false + } +}; +var inner22 = makeInner(); +var decalPaletteScope = {}; +function ariaVisual(ecModel, api2) { + const ariaModel = ecModel.getModel("aria"); + if (!ariaModel.get("enabled")) { + return; + } + const defaultOption3 = clone(DEFAULT_OPTION); + merge(defaultOption3.label, ecModel.getLocaleModel().get("aria"), false); + merge(ariaModel.option, defaultOption3, false); + setDecal(); + setLabel(); + function setDecal() { + const decalModel = ariaModel.getModel("decal"); + const useDecal = decalModel.get("show"); + if (useDecal) { + const paletteScopeGroupByType = createHashMap(); + ecModel.eachSeries((seriesModel) => { + if (seriesModel.isColorBySeries()) { return; } - var indices = data.getIndices(); - for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) { - items.push({ - data: data, - groupId: getGroupId(data, dataIndex, dataGroupId, false), - childGroupId: getGroupId(data, dataIndex, dataGroupId, true), - divide: seriesInfo.divide, - dataIndex: dataIndex - }); + let decalScope = paletteScopeGroupByType.get(seriesModel.type); + if (!decalScope) { + decalScope = {}; + paletteScopeGroupByType.set(seriesModel.type, decalScope); } + inner22(seriesModel).scope = decalScope; }); - return items; - } - function fadeInElement(newEl, newSeries, newIndex) { - newEl.traverse(function (el) { - if (el instanceof Path) { - // TODO use fade in animation for target element. - initProps(el, { - style: { - opacity: 0 - } - }, newSeries, { - dataIndex: newIndex, - isFrom: true + ecModel.eachRawSeries((seriesModel) => { + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } + if (isFunction(seriesModel.enableAriaDecal)) { + seriesModel.enableAriaDecal(); + return; + } + const data = seriesModel.getData(); + if (!seriesModel.isColorBySeries()) { + const dataAll = seriesModel.getRawData(); + const idxMap = {}; + const decalScope = inner22(seriesModel).scope; + data.each(function(idx) { + const rawIdx = data.getRawIndex(idx); + idxMap[rawIdx] = idx; }); + const dataCount = dataAll.count(); + dataAll.each((rawIdx) => { + const idx = idxMap[rawIdx]; + const name = dataAll.getName(rawIdx) || rawIdx + ""; + const paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope, dataCount); + const specifiedDecal = data.getItemVisual(idx, "decal"); + data.setItemVisual(idx, "decal", mergeDecal(specifiedDecal, paletteDecal)); + }); + } else { + const paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount()); + const specifiedDecal = data.getVisual("decal"); + data.setVisual("decal", mergeDecal(specifiedDecal, paletteDecal)); + } + function mergeDecal(specifiedDecal, paletteDecal) { + const resultDecal = specifiedDecal ? extend(extend({}, paletteDecal), specifiedDecal) : paletteDecal; + resultDecal.dirty = true; + return resultDecal; } }); } - function removeEl$1(el) { - if (el.parent) { - // Bake parent transform to element. - // So it can still have proper transform to transition after it's removed. - var computedTransform = el.getComputedTransform(); - el.setLocalTransform(computedTransform); - el.parent.remove(el); - } - } - function stopAnimation(el) { - el.stopAnimation(); - if (el.isGroup) { - el.traverse(function (child) { - child.stopAnimation(); + } + function setLabel() { + const dom = api2.getZr().dom; + if (!dom) { + return; + } + const labelLocale = ecModel.getLocaleModel().get("aria"); + const labelModel = ariaModel.getModel("label"); + labelModel.option = defaults(labelModel.option, labelLocale); + if (!labelModel.get("enabled")) { + return; + } + dom.setAttribute("role", "img"); + if (labelModel.get("description")) { + dom.setAttribute("aria-label", labelModel.get("description")); + return; + } + const seriesCnt = ecModel.getSeriesCount(); + const maxDataCnt = labelModel.get(["data", "maxCount"]) || 10; + const maxSeriesCnt = labelModel.get(["series", "maxCount"]) || 10; + const displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt); + let ariaLabel; + if (seriesCnt < 1) { + return; + } else { + const title = getTitle(); + if (title) { + const withTitle = labelModel.get(["general", "withTitle"]); + ariaLabel = replace(withTitle, { + title }); - } - } - function animateElementStyles(el, dataIndex, seriesModel) { - var animationConfig = getAnimationConfig('update', seriesModel, dataIndex); - animationConfig && el.traverse(function (child) { - if (child instanceof Displayable) { - var oldStyle = getOldStyle(child); - if (oldStyle) { - child.animateFrom({ - style: oldStyle - }, animationConfig); + } else { + ariaLabel = labelModel.get(["general", "withoutTitle"]); + } + const seriesLabels = []; + const prefix = seriesCnt > 1 ? labelModel.get(["series", "multiple", "prefix"]) : labelModel.get(["series", "single", "prefix"]); + ariaLabel += replace(prefix, {seriesCount: seriesCnt}); + ecModel.eachSeries(function(seriesModel, idx) { + if (idx < displaySeriesCnt) { + let seriesLabel; + const seriesName = seriesModel.get("name"); + const withName = seriesName ? "withName" : "withoutName"; + seriesLabel = seriesCnt > 1 ? labelModel.get(["series", "multiple", withName]) : labelModel.get(["series", "single", withName]); + seriesLabel = replace(seriesLabel, { + seriesId: seriesModel.seriesIndex, + seriesName: seriesModel.get("name"), + seriesType: getSeriesTypeName(seriesModel.subType) + }); + const data = seriesModel.getData(); + if (data.count() > maxDataCnt) { + const partialLabel = labelModel.get(["data", "partialData"]); + seriesLabel += replace(partialLabel, { + displayCnt: maxDataCnt + }); + } else { + seriesLabel += labelModel.get(["data", "allData"]); + } + const middleSeparator2 = labelModel.get(["data", "separator", "middle"]); + const endSeparator2 = labelModel.get(["data", "separator", "end"]); + const excludeDimensionId = labelModel.get(["data", "excludeDimensionId"]); + const dataLabels = []; + for (let i = 0; i < data.count(); i++) { + if (i < maxDataCnt) { + const name = data.getName(i); + const value = !excludeDimensionId ? data.getValues(i) : filter(data.getValues(i), (v, j) => indexOf(excludeDimensionId, j) === -1); + const dataLabel = labelModel.get(["data", name ? "withName" : "withoutName"]); + dataLabels.push(replace(dataLabel, { + name, + value: value.join(middleSeparator2) + })); + } } + seriesLabel += dataLabels.join(middleSeparator2) + endSeparator2; + seriesLabels.push(seriesLabel); } }); + const separatorModel = labelModel.getModel(["series", "multiple", "separator"]); + const middleSeparator = separatorModel.get("middle"); + const endSeparator = separatorModel.get("end"); + ariaLabel += seriesLabels.join(middleSeparator) + endSeparator; + dom.setAttribute("aria-label", ariaLabel); + } + } + function replace(str, keyValues) { + if (!isString(str)) { + return str; } - function isAllIdSame(oldDiffItems, newDiffItems) { - var len = oldDiffItems.length; - if (len !== newDiffItems.length) { + let result = str; + each(keyValues, function(value, key) { + result = result.replace(new RegExp("\\{\\s*" + key + "\\s*\\}", "g"), value); + }); + return result; + } + function getTitle() { + let title = ecModel.get("title"); + if (title && title.length) { + title = title[0]; + } + return title && title.text; + } + function getSeriesTypeName(type) { + const typeNames = ecModel.getLocaleModel().get(["series", "typeNames"]); + return typeNames[type] || typeNames.chart; + } +} + +// src/component/aria/preprocessor.ts +function ariaPreprocessor(option) { + if (!option || !option.aria) { + return; + } + const aria = option.aria; + if (aria.show != null) { + aria.enabled = aria.show; + } + aria.label = aria.label || {}; + each(["description", "general", "series", "data"], (name) => { + if (aria[name] != null) { + aria.label[name] = aria[name]; + } + }); +} + +// src/component/aria/install.ts +function install53(registers) { + registers.registerPreprocessor(ariaPreprocessor); + registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual); +} + +// src/util/conditionalExpression.ts +var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = { + value: "eq", + "<": "lt", + "<=": "lte", + ">": "gt", + ">=": "gte", + "=": "eq", + "!=": "ne", + "<>": "ne" +}; +var RegExpEvaluator = class { + constructor(rVal) { + const condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null; + if (condValue == null) { + let errMsg = ""; + if (true) { + errMsg = makePrintable("Illegal regexp", rVal, "in"); + } + throwError(errMsg); + } + } + evaluate(lVal) { + const type = typeof lVal; + return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + "") : false; + } +}; +var ConstConditionInternal = class { + evaluate() { + return this.value; + } +}; +var AndConditionInternal = class { + evaluate() { + const children = this.children; + for (let i = 0; i < children.length; i++) { + if (!children[i].evaluate()) { return false; } - for (var i = 0; i < len; i++) { - var oldItem = oldDiffItems[i]; - var newItem = newDiffItems[i]; - if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) { - return false; - } + } + return true; + } +}; +var OrConditionInternal = class { + evaluate() { + const children = this.children; + for (let i = 0; i < children.length; i++) { + if (children[i].evaluate()) { + return true; } - return true; } - function transitionBetween(oldList, newList, api) { - var oldDiffItems = flattenDataDiffItems(oldList); - var newDiffItems = flattenDataDiffItems(newList); - function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) { - if (rawFrom || from) { - to.animateFrom({ - style: rawFrom && rawFrom !== from - // dividingMethod like clone may override the style(opacity) - // So extend it to raw style. - ? extend(extend({}, rawFrom.style), from.style) : from.style - }, animationCfg); - } - } - var hasMorphAnimation = false; - /** - * With groupId and childGroupId, we can build parent-child relationships between dataItems. - * However, we should mind the parent-child "direction" between old and new options. - * - * For example, suppose we have two dataItems from two series.data: - * - * dataA: [ dataB: [ - * { { - * value: 5, value: 3, - * groupId: 'creatures', groupId: 'animals', - * childGroupId: 'animals' childGroupId: 'dogs' - * }, }, - * ... ... - * ] ] - * - * where dataA is belong to optionA and dataB is belong to optionB. - * - * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of - * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition - * will work. This derection is "parent -> child". - * - * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId - * of dataItemA as keys and universalTransition will work. This derection is "child -> parent". - * - * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no - * parent-child relationship exists. This direction is "none". - * - * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter - * functions. Thus, we need to decide the direction first. - * - * The rule is: - * - * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) { - * direction = 'parent -> child'; - * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) { - * direction = 'child -> parent'; - * } else { - * direction = 'none'; - * } - */ - var direction = TRANSITION_NONE; - // find all groupIds and childGroupIds from oldDiffItems - var oldGroupIds = createHashMap(); - var oldChildGroupIds = createHashMap(); - oldDiffItems.forEach(function (item) { - item.groupId && oldGroupIds.set(item.groupId, true); - item.childGroupId && oldChildGroupIds.set(item.childGroupId, true); - }); - // traverse newDiffItems and decide the direction according to the rule - for (var i = 0; i < newDiffItems.length; i++) { - var newGroupId = newDiffItems[i].groupId; - if (oldChildGroupIds.get(newGroupId)) { - direction = TRANSITION_P2C; - break; - } - var newChildGroupId = newDiffItems[i].childGroupId; - if (newChildGroupId && oldGroupIds.get(newChildGroupId)) { - direction = TRANSITION_C2P; - break; - } + return false; + } +}; +var NotConditionInternal = class { + evaluate() { + return !this.child.evaluate(); + } +}; +var RelationalConditionInternal = class { + evaluate() { + const needParse = !!this.valueParser; + const getValue = this.getValue; + const tarValRaw = getValue(this.valueGetterParam); + const tarValParsed = needParse ? this.valueParser(tarValRaw) : null; + for (let i = 0; i < this.subCondList.length; i++) { + if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) { + return false; } - function createKeyGetter(isOld, onlyGetId) { - return function (diffItem) { - var data = diffItem.data; - var dataIndex = diffItem.dataIndex; - // TODO if specified dim - if (onlyGetId) { - return data.getId(dataIndex); + } + return true; + } +}; +function parseOption(exprOption, getters) { + if (exprOption === true || exprOption === false) { + const cond = new ConstConditionInternal(); + cond.value = exprOption; + return cond; + } + let errMsg = ""; + if (!isObjectNotArray(exprOption)) { + if (true) { + errMsg = makePrintable("Illegal config. Expect a plain object but actually", exprOption); + } + throwError(errMsg); + } + if (exprOption.and) { + return parseAndOrOption("and", exprOption, getters); + } else if (exprOption.or) { + return parseAndOrOption("or", exprOption, getters); + } else if (exprOption.not) { + return parseNotOption(exprOption, getters); + } + return parseRelationalOption(exprOption, getters); +} +function parseAndOrOption(op, exprOption, getters) { + const subOptionArr = exprOption[op]; + let errMsg = ""; + if (true) { + errMsg = makePrintable('"and"/"or" condition should only be `' + op + ": [...]` and must not be empty array.", "Illegal condition:", exprOption); + } + if (!isArray(subOptionArr)) { + throwError(errMsg); + } + if (!subOptionArr.length) { + throwError(errMsg); + } + const cond = op === "and" ? new AndConditionInternal() : new OrConditionInternal(); + cond.children = map(subOptionArr, (subOption) => parseOption(subOption, getters)); + if (!cond.children.length) { + throwError(errMsg); + } + return cond; +} +function parseNotOption(exprOption, getters) { + const subOption = exprOption.not; + let errMsg = ""; + if (true) { + errMsg = makePrintable('"not" condition should only be `not: {}`.', "Illegal condition:", exprOption); + } + if (!isObjectNotArray(subOption)) { + throwError(errMsg); + } + const cond = new NotConditionInternal(); + cond.child = parseOption(subOption, getters); + if (!cond.child) { + throwError(errMsg); + } + return cond; +} +function parseRelationalOption(exprOption, getters) { + let errMsg = ""; + const valueGetterParam = getters.prepareGetValue(exprOption); + const subCondList = []; + const exprKeys = keys(exprOption); + const parserName = exprOption.parser; + const valueParser = parserName ? getRawValueParser(parserName) : null; + for (let i = 0; i < exprKeys.length; i++) { + const keyRaw = exprKeys[i]; + if (keyRaw === "parser" || getters.valueGetterAttrMap.get(keyRaw)) { + continue; + } + const op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw; + const condValueRaw = exprOption[keyRaw]; + const condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw; + const evaluator = createFilterComparator(op, condValueParsed) || op === "reg" && new RegExpEvaluator(condValueParsed); + if (!evaluator) { + if (true) { + errMsg = makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption); + } + throwError(errMsg); + } + subCondList.push(evaluator); + } + if (!subCondList.length) { + if (true) { + errMsg = makePrintable("Relational condition must have at least one operator.", "Illegal condition:", exprOption); + } + throwError(errMsg); + } + const cond = new RelationalConditionInternal(); + cond.valueGetterParam = valueGetterParam; + cond.valueParser = valueParser; + cond.getValue = getters.getValue; + cond.subCondList = subCondList; + return cond; +} +function isObjectNotArray(val) { + return isObject(val) && !isArrayLike(val); +} +var ConditionalExpressionParsed = class { + constructor(exprOption, getters) { + this._cond = parseOption(exprOption, getters); + } + evaluate() { + return this._cond.evaluate(); + } +}; +function parseConditionalExpression(exprOption, getters) { + return new ConditionalExpressionParsed(exprOption, getters); +} + +// src/component/transform/filterTransform.ts +var filterTransform = { + type: "echarts:filter", + transform: function(params) { + const upstream = params.upstream; + let rawItem; + const condition = parseConditionalExpression(params.config, { + valueGetterAttrMap: createHashMap({dimension: true}), + prepareGetValue: function(exprOption) { + let errMsg = ""; + const dimLoose = exprOption.dimension; + if (!hasOwn(exprOption, "dimension")) { + if (true) { + errMsg = makePrintable('Relation condition must has prop "dimension" specified.', "Illegal condition:", exprOption); } - if (isOld) { - return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId; - } else { - return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId; + throwError(errMsg); + } + const dimInfo = upstream.getDimensionInfo(dimLoose); + if (!dimInfo) { + if (true) { + errMsg = makePrintable("Can not find dimension info via: " + dimLoose + ".\n", "Existing dimensions: ", upstream.cloneAllDimensionInfo(), ".\n", "Illegal condition:", exprOption, ".\n"); } - }; + throwError(errMsg); + } + return {dimIdx: dimInfo.index}; + }, + getValue: function(param) { + return upstream.retrieveValueFromItem(rawItem, param.dimIdx); } - // Use id if it's very likely to be an one to one animation - // It's more robust than groupId - // TODO Check if key dimension is specified. - var useId = isAllIdSame(oldDiffItems, newDiffItems); - var isElementStillInChart = {}; - if (!useId) { - // We may have different diff strategy with basicTransition if we use other dimension as key. - // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart. - // We can't use the elements that already being morphed. Let it keep it's original basic transition. - for (var i = 0; i < newDiffItems.length; i++) { - var newItem = newDiffItems[i]; - var el = newItem.data.getItemGraphicEl(newItem.dataIndex); - if (el) { - isElementStillInChart[el.id] = true; - } + }); + const resultData = []; + for (let i = 0, len2 = upstream.count(); i < len2; i++) { + rawItem = upstream.getRawDataItem(i); + if (condition.evaluate()) { + resultData.push(rawItem); + } + } + return { + data: resultData + }; + } +}; + +// src/component/transform/sortTransform.ts +var sampleLog = ""; +if (true) { + sampleLog = [ + "Valid config is like:", + '{ dimension: "age", order: "asc" }', + 'or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]' + ].join(" "); +} +var sortTransform = { + type: "echarts:sort", + transform: function(params) { + const upstream = params.upstream; + const config = params.config; + let errMsg = ""; + const orderExprList = normalizeToArray(config); + if (!orderExprList.length) { + if (true) { + errMsg = "Empty `config` in sort transform."; + } + throwError(errMsg); + } + const orderDefList = []; + each(orderExprList, function(orderExpr) { + const dimLoose = orderExpr.dimension; + const order = orderExpr.order; + const parserName = orderExpr.parser; + const incomparable = orderExpr.incomparable; + if (dimLoose == null) { + if (true) { + errMsg = 'Sort transform config must has "dimension" specified.' + sampleLog; } + throwError(errMsg); } - function updateOneToOne(newIndex, oldIndex) { - var oldItem = oldDiffItems[oldIndex]; - var newItem = newDiffItems[newIndex]; - var newSeries = newItem.data.hostModel; - // TODO Mark this elements is morphed and don't morph them anymore - var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); - var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex); - // Can't handle same elements. - if (oldEl === newEl) { - newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries); - return; + if (order !== "asc" && order !== "desc") { + if (true) { + errMsg = 'Sort transform config must has "order" specified.' + sampleLog; } - if ( - // We can't use the elements that already being morphed - oldEl && isElementStillInChart[oldEl.id]) { - return; + throwError(errMsg); + } + if (incomparable && (incomparable !== "min" && incomparable !== "max")) { + let errMsg2 = ""; + if (true) { + errMsg2 = 'incomparable must be "min" or "max" rather than "' + incomparable + '".'; } - if (newEl) { - // TODO: If keep animating the group in case - // some of the elements don't want to be morphed. - // TODO Label? - stopAnimation(newEl); - if (oldEl) { - stopAnimation(oldEl); - // If old element is doing leaving animation. stop it and remove it immediately. - removeEl$1(oldEl); - hasMorphAnimation = true; - applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps); - } else { - fadeInElement(newEl, newSeries, newIndex); - } + throwError(errMsg2); + } + if (order !== "asc" && order !== "desc") { + let errMsg2 = ""; + if (true) { + errMsg2 = 'order must be "asc" or "desc" rather than "' + order + '".'; } - // else keep oldEl leaving animation. + throwError(errMsg2); } - - new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) { - var newItem = newDiffItems[newIndex]; - var newData = newItem.data; - var newSeries = newData.hostModel; - var newEl = newData.getItemGraphicEl(newItem.dataIndex); - var oldElsList = filter(map(oldIndices, function (idx) { - return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex); - }), function (oldEl) { - return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id]; - }); - if (newEl) { - stopAnimation(newEl); - if (oldElsList.length) { - // If old element is doing leaving animation. stop it and remove it immediately. - each(oldElsList, function (oldEl) { - stopAnimation(oldEl); - removeEl$1(oldEl); - }); - hasMorphAnimation = true; - applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps); - } else { - fadeInElement(newEl, newSeries, newItem.dataIndex); - } + const dimInfo = upstream.getDimensionInfo(dimLoose); + if (!dimInfo) { + if (true) { + errMsg = makePrintable("Can not find dimension info via: " + dimLoose + ".\n", "Existing dimensions: ", upstream.cloneAllDimensionInfo(), ".\n", "Illegal config:", orderExpr, ".\n"); } - // else keep oldEl leaving animation. - }).updateOneToMany(function (newIndices, oldIndex) { - var oldItem = oldDiffItems[oldIndex]; - var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); - // We can't use the elements that already being morphed - if (oldEl && isElementStillInChart[oldEl.id]) { - return; + throwError(errMsg); + } + const parser = parserName ? getRawValueParser(parserName) : null; + if (parserName && !parser) { + if (true) { + errMsg = makePrintable("Invalid parser name " + parserName + ".\n", "Illegal config:", orderExpr, ".\n"); } - var newElsList = filter(map(newIndices, function (idx) { - return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex); - }), function (el) { - return el && el !== oldEl; - }); - var newSeris = newDiffItems[newIndices[0]].data.hostModel; - if (newElsList.length) { - each(newElsList, function (newEl) { - return stopAnimation(newEl); + throwError(errMsg); + } + orderDefList.push({ + dimIdx: dimInfo.index, + parser, + comparator: new SortOrderComparator(order, incomparable) + }); + }); + const sourceFormat = upstream.sourceFormat; + if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) { + if (true) { + errMsg = 'sourceFormat "' + sourceFormat + '" is not supported yet'; + } + throwError(errMsg); + } + const resultData = []; + for (let i = 0, len2 = upstream.count(); i < len2; i++) { + resultData.push(upstream.getRawDataItem(i)); + } + resultData.sort(function(item0, item1) { + for (let i = 0; i < orderDefList.length; i++) { + const orderDef = orderDefList[i]; + let val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx); + let val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx); + if (orderDef.parser) { + val0 = orderDef.parser(val0); + val1 = orderDef.parser(val1); + } + const result = orderDef.comparator.evaluate(val0, val1); + if (result !== 0) { + return result; + } + } + return 0; + }); + return { + data: resultData + }; + } +}; + +// src/component/transform/install.ts +function install54(registers) { + registers.registerTransform(filterTransform); + registers.registerTransform(sortTransform); +} + +// src/component/dataset/install.ts +var DatasetModel = class extends Component_default { + constructor() { + super(...arguments); + this.type = "dataset"; + } + init(option, parentModel, ecModel) { + super.init(option, parentModel, ecModel); + this._sourceManager = new SourceManager(this); + disableTransformOptionMerge(this); + } + mergeOption(newOption, ecModel) { + super.mergeOption(newOption, ecModel); + disableTransformOptionMerge(this); + } + optionUpdated() { + this._sourceManager.dirty(); + } + getSourceManager() { + return this._sourceManager; + } +}; +DatasetModel.type = "dataset"; +DatasetModel.defaultOption = { + seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN +}; +var DatasetView = class extends Component_default2 { + constructor() { + super(...arguments); + this.type = "dataset"; + } +}; +DatasetView.type = "dataset"; +function install55(registers) { + registers.registerComponentModel(DatasetModel); + registers.registerComponentView(DatasetView); +} + +// node_modules/zrender/src/tool/convertPath.ts +var CMD5 = PathProxy_default.CMD; +function aroundEqual(a, b) { + return Math.abs(a - b) < 1e-5; +} +function pathToBezierCurves(path) { + const data = path.data; + const len2 = path.len(); + const bezierArrayGroups = []; + let currentSubpath; + let xi = 0; + let yi = 0; + let x0 = 0; + let y0 = 0; + function createNewSubpath(x, y) { + if (currentSubpath && currentSubpath.length > 2) { + bezierArrayGroups.push(currentSubpath); + } + currentSubpath = [x, y]; + } + function addLine(x02, y02, x12, y12) { + if (!(aroundEqual(x02, x12) && aroundEqual(y02, y12))) { + currentSubpath.push(x02, y02, x12, y12, x12, y12); + } + } + function addArc(startAngle, endAngle, cx, cy, rx, ry) { + const delta = Math.abs(endAngle - startAngle); + const len3 = Math.tan(delta / 4) * 4 / 3; + const dir3 = endAngle < startAngle ? -1 : 1; + const c1 = Math.cos(startAngle); + const s1 = Math.sin(startAngle); + const c2 = Math.cos(endAngle); + const s2 = Math.sin(endAngle); + const x12 = c1 * rx + cx; + const y12 = s1 * ry + cy; + const x4 = c2 * rx + cx; + const y4 = s2 * ry + cy; + const hx = rx * len3 * dir3; + const hy = ry * len3 * dir3; + currentSubpath.push(x12 - hx * s1, y12 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4); + } + let x1; + let y1; + let x2; + let y2; + for (let i = 0; i < len2; ) { + const cmd = data[i++]; + const isFirst = i === 1; + if (isFirst) { + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + if (cmd === CMD5.L || cmd === CMD5.C || cmd === CMD5.Q) { + currentSubpath = [x0, y0]; + } + } + switch (cmd) { + case CMD5.M: + xi = x0 = data[i++]; + yi = y0 = data[i++]; + createNewSubpath(x0, y0); + break; + case CMD5.L: + x1 = data[i++]; + y1 = data[i++]; + addLine(xi, yi, x1, y1); + xi = x1; + yi = y1; + break; + case CMD5.C: + currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]); + break; + case CMD5.Q: + x1 = data[i++]; + y1 = data[i++]; + x2 = data[i++]; + y2 = data[i++]; + currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2); + xi = x2; + yi = y2; + break; + case CMD5.A: + const cx = data[i++]; + const cy = data[i++]; + const rx = data[i++]; + const ry = data[i++]; + const startAngle = data[i++]; + const endAngle = data[i++] + startAngle; + i += 1; + const anticlockwise = !data[i++]; + x1 = Math.cos(startAngle) * rx + cx; + y1 = Math.sin(startAngle) * ry + cy; + if (isFirst) { + x0 = x1; + y0 = y1; + createNewSubpath(x0, y0); + } else { + addLine(xi, yi, x1, y1); + } + xi = Math.cos(endAngle) * rx + cx; + yi = Math.sin(endAngle) * ry + cy; + const step = (anticlockwise ? -1 : 1) * Math.PI / 2; + for (let angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) { + const nextAngle = anticlockwise ? Math.max(angle + step, endAngle) : Math.min(angle + step, endAngle); + addArc(angle, nextAngle, cx, cy, rx, ry); + } + break; + case CMD5.R: + x0 = xi = data[i++]; + y0 = yi = data[i++]; + x1 = x0 + data[i++]; + y1 = y0 + data[i++]; + createNewSubpath(x1, y0); + addLine(x1, y0, x1, y1); + addLine(x1, y1, x0, y1); + addLine(x0, y1, x0, y0); + addLine(x0, y0, x1, y0); + break; + case CMD5.Z: + currentSubpath && addLine(xi, yi, x0, y0); + xi = x0; + yi = y0; + break; + } + } + if (currentSubpath && currentSubpath.length > 2) { + bezierArrayGroups.push(currentSubpath); + } + return bezierArrayGroups; +} +function adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out2, scale4) { + if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) { + out2.push(x3, y3); + return; + } + const PIXEL_DISTANCE = 2 / scale4; + const PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE; + let dx = x3 - x0; + let dy = y3 - y0; + const d = Math.sqrt(dx * dx + dy * dy); + dx /= d; + dy /= d; + const dx1 = x1 - x0; + const dy1 = y1 - y0; + const dx2 = x2 - x3; + const dy2 = y2 - y3; + const cp1LenSqr = dx1 * dx1 + dy1 * dy1; + const cp2LenSqr = dx2 * dx2 + dy2 * dy2; + if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) { + out2.push(x3, y3); + return; + } + const projLen1 = dx * dx1 + dy * dy1; + const projLen2 = -dx * dx2 - dy * dy2; + const d1Sqr = cp1LenSqr - projLen1 * projLen1; + const d2Sqr = cp2LenSqr - projLen2 * projLen2; + if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0 && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0) { + out2.push(x3, y3); + return; + } + const tmpSegX = []; + const tmpSegY = []; + cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX); + cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY); + adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out2, scale4); + adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out2, scale4); +} +function pathToPolygons(path, scale4) { + const bezierArrayGroups = pathToBezierCurves(path); + const polygons = []; + scale4 = scale4 || 1; + for (let i = 0; i < bezierArrayGroups.length; i++) { + const beziers = bezierArrayGroups[i]; + const polygon = []; + let x0 = beziers[0]; + let y0 = beziers[1]; + polygon.push(x0, y0); + for (let k = 2; k < beziers.length; ) { + const x1 = beziers[k++]; + const y1 = beziers[k++]; + const x2 = beziers[k++]; + const y2 = beziers[k++]; + const x3 = beziers[k++]; + const y3 = beziers[k++]; + adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale4); + x0 = x3; + y0 = y3; + } + polygons.push(polygon); + } + return polygons; +} + +// node_modules/zrender/src/tool/dividePath.ts +function getDividingGrids(dimSize, rowDim, count2) { + const rowSize = dimSize[rowDim]; + const columnSize = dimSize[1 - rowDim]; + const ratio = Math.abs(rowSize / columnSize); + let rowCount = Math.ceil(Math.sqrt(ratio * count2)); + let columnCount = Math.floor(count2 / rowCount); + if (columnCount === 0) { + columnCount = 1; + rowCount = count2; + } + const grids = []; + for (let i = 0; i < rowCount; i++) { + grids.push(columnCount); + } + const currentCount = rowCount * columnCount; + const remained = count2 - currentCount; + if (remained > 0) { + for (let i = 0; i < remained; i++) { + grids[i % rowCount] += 1; + } + } + return grids; +} +function divideSector(sectorShape, count2, outShapes) { + const r0 = sectorShape.r0; + const r = sectorShape.r; + const startAngle = sectorShape.startAngle; + const endAngle = sectorShape.endAngle; + const angle = Math.abs(endAngle - startAngle); + const arcLen = angle * r; + const deltaR = r - r0; + const isAngleRow = arcLen > Math.abs(deltaR); + const grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count2); + const rowSize = (isAngleRow ? angle : deltaR) / grids.length; + for (let row = 0; row < grids.length; row++) { + const columnSize = (isAngleRow ? deltaR : angle) / grids[row]; + for (let column = 0; column < grids[row]; column++) { + const newShape = {}; + if (isAngleRow) { + newShape.startAngle = startAngle + rowSize * row; + newShape.endAngle = startAngle + rowSize * (row + 1); + newShape.r0 = r0 + columnSize * column; + newShape.r = r0 + columnSize * (column + 1); + } else { + newShape.startAngle = startAngle + columnSize * column; + newShape.endAngle = startAngle + columnSize * (column + 1); + newShape.r0 = r0 + rowSize * row; + newShape.r = r0 + rowSize * (row + 1); + } + newShape.clockwise = sectorShape.clockwise; + newShape.cx = sectorShape.cx; + newShape.cy = sectorShape.cy; + outShapes.push(newShape); + } + } +} +function divideRect(rectShape, count2, outShapes) { + const width = rectShape.width; + const height = rectShape.height; + const isHorizontalRow = width > height; + const grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count2); + const rowSizeDim = isHorizontalRow ? "width" : "height"; + const columnSizeDim = isHorizontalRow ? "height" : "width"; + const rowDim = isHorizontalRow ? "x" : "y"; + const columnDim = isHorizontalRow ? "y" : "x"; + const rowSize = rectShape[rowSizeDim] / grids.length; + for (let row = 0; row < grids.length; row++) { + const columnSize = rectShape[columnSizeDim] / grids[row]; + for (let column = 0; column < grids[row]; column++) { + const newShape = {}; + newShape[rowDim] = row * rowSize; + newShape[columnDim] = column * columnSize; + newShape[rowSizeDim] = rowSize; + newShape[columnSizeDim] = columnSize; + newShape.x += rectShape.x; + newShape.y += rectShape.y; + outShapes.push(newShape); + } + } +} +function crossProduct2d2(x1, y1, x2, y2) { + return x1 * y2 - x2 * y1; +} +function lineLineIntersect2(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { + const mx = a2x - a1x; + const my = a2y - a1y; + const nx = b2x - b1x; + const ny = b2y - b1y; + const nmCrossProduct = crossProduct2d2(nx, ny, mx, my); + if (Math.abs(nmCrossProduct) < 1e-6) { + return null; + } + const b1a1x = a1x - b1x; + const b1a1y = a1y - b1y; + const p = crossProduct2d2(b1a1x, b1a1y, nx, ny) / nmCrossProduct; + if (p < 0 || p > 1) { + return null; + } + return new Point_default(p * mx + a1x, p * my + a1y); +} +function projPtOnLine(pt, lineA, lineB) { + const dir3 = new Point_default(); + Point_default.sub(dir3, lineB, lineA); + dir3.normalize(); + const dir22 = new Point_default(); + Point_default.sub(dir22, pt, lineA); + const len2 = dir22.dot(dir3); + return len2; +} +function addToPoly(poly, pt) { + const last = poly[poly.length - 1]; + if (last && last[0] === pt[0] && last[1] === pt[1]) { + return; + } + poly.push(pt); +} +function splitPolygonByLine(points4, lineA, lineB) { + const len2 = points4.length; + const intersections = []; + for (let i = 0; i < len2; i++) { + const p0 = points4[i]; + const p1 = points4[(i + 1) % len2]; + const intersectionPt = lineLineIntersect2(p0[0], p0[1], p1[0], p1[1], lineA.x, lineA.y, lineB.x, lineB.y); + if (intersectionPt) { + intersections.push({ + projPt: projPtOnLine(intersectionPt, lineA, lineB), + pt: intersectionPt, + idx: i + }); + } + } + if (intersections.length < 2) { + return [{points: points4}, {points: points4}]; + } + intersections.sort((a, b) => { + return a.projPt - b.projPt; + }); + let splitPt0 = intersections[0]; + let splitPt1 = intersections[intersections.length - 1]; + if (splitPt1.idx < splitPt0.idx) { + const tmp = splitPt0; + splitPt0 = splitPt1; + splitPt1 = tmp; + } + const splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y]; + const splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y]; + const newPolyA = [splitPt0Arr]; + const newPolyB = [splitPt1Arr]; + for (let i = splitPt0.idx + 1; i <= splitPt1.idx; i++) { + addToPoly(newPolyA, points4[i].slice()); + } + addToPoly(newPolyA, splitPt1Arr); + addToPoly(newPolyA, splitPt0Arr); + for (let i = splitPt1.idx + 1; i <= splitPt0.idx + len2; i++) { + addToPoly(newPolyB, points4[i % len2].slice()); + } + addToPoly(newPolyB, splitPt0Arr); + addToPoly(newPolyB, splitPt1Arr); + return [{ + points: newPolyA + }, { + points: newPolyB + }]; +} +function binaryDividePolygon(polygonShape) { + const points4 = polygonShape.points; + const min3 = []; + const max3 = []; + fromPoints(points4, min3, max3); + const boundingRect = new BoundingRect_default(min3[0], min3[1], max3[0] - min3[0], max3[1] - min3[1]); + const width = boundingRect.width; + const height = boundingRect.height; + const x = boundingRect.x; + const y = boundingRect.y; + const pt02 = new Point_default(); + const pt12 = new Point_default(); + if (width > height) { + pt02.x = pt12.x = x + width / 2; + pt02.y = y; + pt12.y = y + height; + } else { + pt02.y = pt12.y = y + height / 2; + pt02.x = x; + pt12.x = x + width; + } + return splitPolygonByLine(points4, pt02, pt12); +} +function binaryDivideRecursive(divider, shape, count2, out2) { + if (count2 === 1) { + out2.push(shape); + } else { + const mid = Math.floor(count2 / 2); + const sub2 = divider(shape); + binaryDivideRecursive(divider, sub2[0], mid, out2); + binaryDivideRecursive(divider, sub2[1], count2 - mid, out2); + } + return out2; +} +function clone5(path, count2) { + const paths = []; + for (let i = 0; i < count2; i++) { + paths.push(clonePath(path)); + } + return paths; +} +function copyPathProps(source, target) { + target.setStyle(source.style); + target.z = source.z; + target.z2 = source.z2; + target.zlevel = source.zlevel; +} +function polygonConvert(points4) { + const out2 = []; + for (let i = 0; i < points4.length; ) { + out2.push([points4[i++], points4[i++]]); + } + return out2; +} +function split(path, count2) { + const outShapes = []; + const shape = path.shape; + let OutShapeCtor; + switch (path.type) { + case "rect": + divideRect(shape, count2, outShapes); + OutShapeCtor = Rect_default; + break; + case "sector": + divideSector(shape, count2, outShapes); + OutShapeCtor = Sector_default; + break; + case "circle": + divideSector({ + r0: 0, + r: shape.r, + startAngle: 0, + endAngle: Math.PI * 2, + cx: shape.cx, + cy: shape.cy + }, count2, outShapes); + OutShapeCtor = Sector_default; + break; + default: + const m2 = path.getComputedTransform(); + const scale4 = m2 ? Math.sqrt(Math.max(m2[0] * m2[0] + m2[1] * m2[1], m2[2] * m2[2] + m2[3] * m2[3])) : 1; + const polygons = map(pathToPolygons(path.getUpdatedPathProxy(), scale4), (poly) => polygonConvert(poly)); + const polygonCount = polygons.length; + if (polygonCount === 0) { + binaryDivideRecursive(binaryDividePolygon, { + points: polygons[0] + }, count2, outShapes); + } else if (polygonCount === count2) { + for (let i = 0; i < polygonCount; i++) { + outShapes.push({ + points: polygons[i] }); - if (oldEl) { - stopAnimation(oldEl); - // If old element is doing leaving animation. stop it and remove it immediately. - removeEl$1(oldEl); - hasMorphAnimation = true; - applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, - // Use divide on old. - newSeris, newIndices[0], updateMorphingPathProps); - } else { - each(newElsList, function (newEl) { - return fadeInElement(newEl, newSeris, newIndices[0]); - }); - } } - // else keep oldEl leaving animation. - }).updateManyToMany(function (newIndices, oldIndices) { - // If two data are same and both have groupId. - // Normally they should be diff by id. - new DataDiffer(oldIndices, newIndices, function (rawIdx) { - return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex); - }, function (rawIdx) { - return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex); - }).update(function (newIndex, oldIndex) { - // Use the original index - updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]); - }).execute(); - }).execute(); - if (hasMorphAnimation) { - each(newList, function (_a) { - var data = _a.data; - var seriesModel = data.hostModel; - var view = seriesModel && api.getViewOfSeriesModel(seriesModel); - var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index. - if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) { - view.group.traverse(function (el) { - if (el instanceof Path && !el.animators.length) { - // We can't accept there still exists element that has no animation - // if universalTransition is enabled - el.animateFrom({ - style: { - opacity: 0 - } - }, animationCfg); - } - }); + } else { + let totalArea = 0; + const items = map(polygons, (poly) => { + const min3 = []; + const max3 = []; + fromPoints(poly, min3, max3); + const area = (max3[1] - min3[1]) * (max3[0] - min3[0]); + totalArea += area; + return {poly, area}; + }); + items.sort((a, b) => b.area - a.area); + let left = count2; + for (let i = 0; i < polygonCount; i++) { + const item = items[i]; + if (left <= 0) { + break; } - }); + const selfCount = i === polygonCount - 1 ? left : Math.ceil(item.area / totalArea * count2); + if (selfCount < 0) { + continue; + } + binaryDivideRecursive(binaryDividePolygon, { + points: item.poly + }, selfCount, outShapes); + left -= selfCount; + } + ; + } + OutShapeCtor = Polygon_default; + break; + } + if (!OutShapeCtor) { + return clone5(path, count2); + } + const out2 = []; + for (let i = 0; i < outShapes.length; i++) { + const subPath = new OutShapeCtor(); + subPath.setShape(outShapes[i]); + copyPathProps(path, subPath); + out2.push(subPath); + } + return out2; +} + +// node_modules/zrender/src/tool/morphPath.ts +function alignSubpath(subpath1, subpath2) { + const len1 = subpath1.length; + const len2 = subpath2.length; + if (len1 === len2) { + return [subpath1, subpath2]; + } + const tmpSegX = []; + const tmpSegY = []; + const shorterPath = len1 < len2 ? subpath1 : subpath2; + const shorterLen = Math.min(len1, len2); + const diff = Math.abs(len2 - len1) / 6; + const shorterBezierCount = (shorterLen - 2) / 6; + const eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1; + const newSubpath = [shorterPath[0], shorterPath[1]]; + let remained = diff; + for (let i = 2; i < shorterLen; ) { + let x0 = shorterPath[i - 2]; + let y0 = shorterPath[i - 1]; + let x1 = shorterPath[i++]; + let y1 = shorterPath[i++]; + let x2 = shorterPath[i++]; + let y2 = shorterPath[i++]; + let x3 = shorterPath[i++]; + let y3 = shorterPath[i++]; + if (remained <= 0) { + newSubpath.push(x1, y1, x2, y2, x3, y3); + continue; + } + let actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1; + for (let k = 1; k <= actualSubDivCount; k++) { + const p = k / actualSubDivCount; + cubicSubdivide(x0, x1, x2, x3, p, tmpSegX); + cubicSubdivide(y0, y1, y2, y3, p, tmpSegY); + x0 = tmpSegX[3]; + y0 = tmpSegY[3]; + newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0); + x1 = tmpSegX[5]; + y1 = tmpSegY[5]; + x2 = tmpSegX[6]; + y2 = tmpSegY[6]; + } + remained -= actualSubDivCount - 1; + } + return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath]; +} +function createSubpath(lastSubpathSubpath, otherSubpath) { + const len2 = lastSubpathSubpath.length; + const lastX = lastSubpathSubpath[len2 - 2]; + const lastY = lastSubpathSubpath[len2 - 1]; + const newSubpath = []; + for (let i = 0; i < otherSubpath.length; ) { + newSubpath[i++] = lastX; + newSubpath[i++] = lastY; + } + return newSubpath; +} +function alignBezierCurves(array1, array2) { + let lastSubpath1; + let lastSubpath2; + let newArray1 = []; + let newArray2 = []; + for (let i = 0; i < Math.max(array1.length, array2.length); i++) { + const subpath1 = array1[i]; + const subpath2 = array2[i]; + let newSubpath1; + let newSubpath2; + if (!subpath1) { + newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2); + newSubpath2 = subpath2; + } else if (!subpath2) { + newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1); + newSubpath1 = subpath1; + } else { + [newSubpath1, newSubpath2] = alignSubpath(subpath1, subpath2); + lastSubpath1 = newSubpath1; + lastSubpath2 = newSubpath2; + } + newArray1.push(newSubpath1); + newArray2.push(newSubpath2); + } + return [newArray1, newArray2]; +} +function centroid2(array) { + let signedArea = 0; + let cx = 0; + let cy = 0; + const len2 = array.length; + for (let i = 0, j = len2 - 2; i < len2; j = i, i += 2) { + const x0 = array[j]; + const y0 = array[j + 1]; + const x1 = array[i]; + const y1 = array[i + 1]; + const a = x0 * y1 - x1 * y0; + signedArea += a; + cx += (x0 + x1) * a; + cy += (y0 + y1) * a; + } + if (signedArea === 0) { + return [array[0] || 0, array[1] || 0]; + } + return [cx / signedArea / 3, cy / signedArea / 3, signedArea]; +} +function findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) { + const bezierCount = (fromSubBeziers.length - 2) / 6; + let bestScore = Infinity; + let bestOffset = 0; + const len2 = fromSubBeziers.length; + const len22 = len2 - 2; + for (let offset = 0; offset < bezierCount; offset++) { + const cursorOffset = offset * 6; + let score = 0; + for (let k = 0; k < len2; k += 2) { + let idx = k === 0 ? cursorOffset : (cursorOffset + k - 2) % len22 + 2; + const x0 = fromSubBeziers[idx] - fromCp[0]; + const y0 = fromSubBeziers[idx + 1] - fromCp[1]; + const x1 = toSubBeziers[k] - toCp[0]; + const y1 = toSubBeziers[k + 1] - toCp[1]; + const dx = x1 - x0; + const dy = y1 - y0; + score += dx * dx + dy * dy; + } + if (score < bestScore) { + bestScore = score; + bestOffset = offset; + } + } + return bestOffset; +} +function reverse(array) { + const newArr = []; + const len2 = array.length; + for (let i = 0; i < len2; i += 2) { + newArr[i] = array[len2 - i - 2]; + newArr[i + 1] = array[len2 - i - 1]; + } + return newArr; +} +function findBestMorphingRotation(fromArr, toArr2, searchAngleIteration, searchAngleRange) { + const result = []; + let fromNeedsReverse; + for (let i = 0; i < fromArr.length; i++) { + let fromSubpathBezier = fromArr[i]; + const toSubpathBezier = toArr2[i]; + const fromCp = centroid2(fromSubpathBezier); + const toCp = centroid2(toSubpathBezier); + if (fromNeedsReverse == null) { + fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0; + } + const newFromSubpathBezier = []; + const newToSubpathBezier = []; + let bestAngle = 0; + let bestScore = Infinity; + let tmpArr2 = []; + const len2 = fromSubpathBezier.length; + if (fromNeedsReverse) { + fromSubpathBezier = reverse(fromSubpathBezier); + } + const offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6; + const len22 = len2 - 2; + for (let k = 0; k < len22; k += 2) { + const idx = (offset + k) % len22 + 2; + newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0]; + newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1]; + } + newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0]; + newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1]; + if (searchAngleIteration > 0) { + const step = searchAngleRange / searchAngleIteration; + for (let angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) { + const sa = Math.sin(angle); + const ca = Math.cos(angle); + let score = 0; + for (let k = 0; k < fromSubpathBezier.length; k += 2) { + const x0 = newFromSubpathBezier[k]; + const y0 = newFromSubpathBezier[k + 1]; + const x1 = toSubpathBezier[k] - toCp[0]; + const y1 = toSubpathBezier[k + 1] - toCp[1]; + const newX1 = x1 * ca - y1 * sa; + const newY1 = x1 * sa + y1 * ca; + tmpArr2[k] = newX1; + tmpArr2[k + 1] = newY1; + const dx = newX1 - x0; + const dy = newY1 - y0; + score += dx * dx + dy * dy; + } + if (score < bestScore) { + bestScore = score; + bestAngle = angle; + for (let m2 = 0; m2 < tmpArr2.length; m2++) { + newToSubpathBezier[m2] = tmpArr2[m2]; + } + } + } + } else { + for (let i2 = 0; i2 < len2; i2 += 2) { + newToSubpathBezier[i2] = toSubpathBezier[i2] - toCp[0]; + newToSubpathBezier[i2 + 1] = toSubpathBezier[i2 + 1] - toCp[1]; + } + } + result.push({ + from: newFromSubpathBezier, + to: newToSubpathBezier, + fromCp, + toCp, + rotation: -bestAngle + }); + } + return result; +} +function isCombineMorphing(path) { + return path.__isCombineMorphing; +} +var SAVED_METHOD_PREFIX = "__mOriginal_"; +function saveAndModifyMethod(obj, methodName, modifiers) { + const savedMethodName = SAVED_METHOD_PREFIX + methodName; + const originalMethod = obj[savedMethodName] || obj[methodName]; + if (!obj[savedMethodName]) { + obj[savedMethodName] = obj[methodName]; + } + const replace = modifiers.replace; + const after = modifiers.after; + const before = modifiers.before; + obj[methodName] = function() { + const args = arguments; + let res; + before && before.apply(this, args); + if (replace) { + res = replace.apply(this, args); + } else { + res = originalMethod.apply(this, args); + } + after && after.apply(this, args); + return res; + }; +} +function restoreMethod(obj, methodName) { + const savedMethodName = SAVED_METHOD_PREFIX + methodName; + if (obj[savedMethodName]) { + obj[methodName] = obj[savedMethodName]; + obj[savedMethodName] = null; + } +} +function applyTransformOnBeziers(bezierCurves, mm) { + for (let i = 0; i < bezierCurves.length; i++) { + const subBeziers = bezierCurves[i]; + for (let k = 0; k < subBeziers.length; ) { + const x = subBeziers[k]; + const y = subBeziers[k + 1]; + subBeziers[k++] = mm[0] * x + mm[2] * y + mm[4]; + subBeziers[k++] = mm[1] * x + mm[3] * y + mm[5]; + } + } +} +function prepareMorphPath(fromPath, toPath) { + const fromPathProxy = fromPath.getUpdatedPathProxy(); + const toPathProxy = toPath.getUpdatedPathProxy(); + const [fromBezierCurves, toBezierCurves] = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)); + const fromPathTransform = fromPath.getComputedTransform(); + const toPathTransform = toPath.getComputedTransform(); + function updateIdentityTransform() { + this.transform = null; + } + fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform); + toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform); + saveAndModifyMethod(toPath, "updateTransform", {replace: updateIdentityTransform}); + toPath.transform = null; + const morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI); + const tmpArr2 = []; + saveAndModifyMethod(toPath, "buildPath", {replace(path) { + const t = toPath.__morphT; + const onet = 1 - t; + const newCp = []; + for (let i = 0; i < morphingData.length; i++) { + const item = morphingData[i]; + const from = item.from; + const to = item.to; + const angle = item.rotation * t; + const fromCp = item.fromCp; + const toCp = item.toCp; + const sa = Math.sin(angle); + const ca = Math.cos(angle); + lerp(newCp, fromCp, toCp, t); + for (let m2 = 0; m2 < from.length; m2 += 2) { + const x02 = from[m2]; + const y02 = from[m2 + 1]; + const x1 = to[m2]; + const y1 = to[m2 + 1]; + const x = x02 * onet + x1 * t; + const y = y02 * onet + y1 * t; + tmpArr2[m2] = x * ca - y * sa + newCp[0]; + tmpArr2[m2 + 1] = x * sa + y * ca + newCp[1]; + } + let x0 = tmpArr2[0]; + let y0 = tmpArr2[1]; + path.moveTo(x0, y0); + for (let m2 = 2; m2 < from.length; ) { + const x1 = tmpArr2[m2++]; + const y1 = tmpArr2[m2++]; + const x2 = tmpArr2[m2++]; + const y2 = tmpArr2[m2++]; + const x3 = tmpArr2[m2++]; + const y3 = tmpArr2[m2++]; + if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) { + path.lineTo(x3, y3); + } else { + path.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + x0 = x3; + y0 = y3; + } + } + }}); +} +function morphPath(fromPath, toPath, animationOpts) { + if (!fromPath || !toPath) { + return toPath; + } + const oldDone = animationOpts.done; + const oldDuring = animationOpts.during; + prepareMorphPath(fromPath, toPath); + toPath.__morphT = 0; + function restoreToPath() { + restoreMethod(toPath, "buildPath"); + restoreMethod(toPath, "updateTransform"); + toPath.__morphT = -1; + toPath.createPathProxy(); + toPath.dirtyShape(); + } + toPath.animateTo({ + __morphT: 1 + }, defaults({ + during(p) { + toPath.dirtyShape(); + oldDuring && oldDuring(p); + }, + done() { + restoreToPath(); + oldDone && oldDone(); + } + }, animationOpts)); + return toPath; +} +function hilbert(x, y, minX, minY, maxX, maxY) { + const bits = 16; + x = maxX === minX ? 0 : Math.round(32767 * (x - minX) / (maxX - minX)); + y = maxY === minY ? 0 : Math.round(32767 * (y - minY) / (maxY - minY)); + let d = 0; + let tmp; + for (let s = (1 << bits) / 2; s > 0; s /= 2) { + let rx = 0; + let ry = 0; + if ((x & s) > 0) { + rx = 1; + } + if ((y & s) > 0) { + ry = 1; + } + d += s * s * (3 * rx ^ ry); + if (ry === 0) { + if (rx === 1) { + x = s - 1 - x; + y = s - 1 - y; + } + tmp = x; + x = y; + y = tmp; + } + } + return d; +} +function sortPaths(pathList) { + let xMin = Infinity; + let yMin = Infinity; + let xMax = -Infinity; + let yMax = -Infinity; + const cps = map(pathList, (path) => { + const rect = path.getBoundingRect(); + const m2 = path.getComputedTransform(); + const x = rect.x + rect.width / 2 + (m2 ? m2[4] : 0); + const y = rect.y + rect.height / 2 + (m2 ? m2[5] : 0); + xMin = Math.min(x, xMin); + yMin = Math.min(y, yMin); + xMax = Math.max(x, xMax); + yMax = Math.max(y, yMax); + return [x, y]; + }); + const items = map(cps, (cp, idx) => { + return { + cp, + z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax), + path: pathList[idx] + }; + }); + return items.sort((a, b) => a.z - b.z).map((item) => item.path); +} +function defaultDividePath(param) { + return split(param.path, param.count); +} +function createEmptyReturn() { + return { + fromIndividuals: [], + toIndividuals: [], + count: 0 + }; +} +function combineMorph(fromList, toPath, animationOpts) { + let fromPathList = []; + function addFromPath(fromList2) { + for (let i = 0; i < fromList2.length; i++) { + const from = fromList2[i]; + if (isCombineMorphing(from)) { + addFromPath(from.childrenRef()); + } else if (from instanceof Path_default) { + fromPathList.push(from); + } + } + } + addFromPath(fromList); + const separateCount = fromPathList.length; + if (!separateCount) { + return createEmptyReturn(); + } + const dividePath = animationOpts.dividePath || defaultDividePath; + let toSubPathList = dividePath({ + path: toPath, + count: separateCount + }); + if (toSubPathList.length !== separateCount) { + console.error("Invalid morphing: unmatched splitted path"); + return createEmptyReturn(); + } + fromPathList = sortPaths(fromPathList); + toSubPathList = sortPaths(toSubPathList); + const oldDone = animationOpts.done; + const oldDuring = animationOpts.during; + const individualDelay = animationOpts.individualDelay; + const identityTransform = new Transformable_default(); + for (let i = 0; i < separateCount; i++) { + const from = fromPathList[i]; + const to = toSubPathList[i]; + to.parent = toPath; + to.copyTransform(identityTransform); + if (!individualDelay) { + prepareMorphPath(from, to); + } + } + toPath.__isCombineMorphing = true; + toPath.childrenRef = function() { + return toSubPathList; + }; + function addToSubPathListToZr(zr) { + for (let i = 0; i < toSubPathList.length; i++) { + toSubPathList[i].addSelfToZr(zr); + } + } + saveAndModifyMethod(toPath, "addSelfToZr", { + after(zr) { + addToSubPathListToZr(zr); + } + }); + saveAndModifyMethod(toPath, "removeSelfFromZr", { + after(zr) { + for (let i = 0; i < toSubPathList.length; i++) { + toSubPathList[i].removeSelfFromZr(zr); + } + } + }); + function restoreToPath() { + toPath.__isCombineMorphing = false; + toPath.__morphT = -1; + toPath.childrenRef = null; + restoreMethod(toPath, "addSelfToZr"); + restoreMethod(toPath, "removeSelfFromZr"); + } + const toLen = toSubPathList.length; + if (individualDelay) { + let animating = toLen; + const eachDone = () => { + animating--; + if (animating === 0) { + restoreToPath(); + oldDone && oldDone(); } + }; + for (let i = 0; i < toLen; i++) { + const indivdualAnimationOpts = individualDelay ? defaults({ + delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toSubPathList[i]), + done: eachDone + }, animationOpts) : animationOpts; + morphPath(fromPathList[i], toSubPathList[i], indivdualAnimationOpts); + } + } else { + toPath.__morphT = 0; + toPath.animateTo({ + __morphT: 1 + }, defaults({ + during(p) { + for (let i = 0; i < toLen; i++) { + const child = toSubPathList[i]; + child.__morphT = toPath.__morphT; + child.dirtyShape(); + } + oldDuring && oldDuring(p); + }, + done() { + restoreToPath(); + for (let i = 0; i < fromList.length; i++) { + restoreMethod(fromList[i], "updateTransform"); + } + oldDone && oldDone(); + } + }, animationOpts)); + } + if (toPath.__zr) { + addToSubPathListToZr(toPath.__zr); + } + return { + fromIndividuals: fromPathList, + toIndividuals: toSubPathList, + count: toLen + }; +} +function separateMorph(fromPath, toPathList, animationOpts) { + const toLen = toPathList.length; + let fromPathList = []; + const dividePath = animationOpts.dividePath || defaultDividePath; + function addFromPath(fromList) { + for (let i = 0; i < fromList.length; i++) { + const from = fromList[i]; + if (isCombineMorphing(from)) { + addFromPath(from.childrenRef()); + } else if (from instanceof Path_default) { + fromPathList.push(from); + } + } + } + if (isCombineMorphing(fromPath)) { + addFromPath(fromPath.childrenRef()); + const fromLen = fromPathList.length; + if (fromLen < toLen) { + let k = 0; + for (let i = fromLen; i < toLen; i++) { + fromPathList.push(clonePath(fromPathList[k++ % fromLen])); + } + } + fromPathList.length = toLen; + } else { + fromPathList = dividePath({path: fromPath, count: toLen}); + const fromPathTransform = fromPath.getComputedTransform(); + for (let i = 0; i < fromPathList.length; i++) { + fromPathList[i].setLocalTransform(fromPathTransform); + } + if (fromPathList.length !== toLen) { + console.error("Invalid morphing: unmatched splitted path"); + return createEmptyReturn(); + } + } + fromPathList = sortPaths(fromPathList); + toPathList = sortPaths(toPathList); + const individualDelay = animationOpts.individualDelay; + for (let i = 0; i < toLen; i++) { + const indivdualAnimationOpts = individualDelay ? defaults({ + delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toPathList[i]) + }, animationOpts) : animationOpts; + morphPath(fromPathList[i], toPathList[i], indivdualAnimationOpts); + } + return { + fromIndividuals: fromPathList, + toIndividuals: toPathList, + count: toPathList.length + }; +} + +// src/animation/morphTransitionHelper.ts +function isMultiple(elements) { + return isArray(elements[0]); +} +function prepareMorphBatches(one, many) { + const batches = []; + const batchCount = one.length; + for (let i = 0; i < batchCount; i++) { + batches.push({ + one: one[i], + many: [] + }); + } + for (let i = 0; i < many.length; i++) { + const len2 = many[i].length; + let k; + for (k = 0; k < len2; k++) { + batches[k % batchCount].many.push(many[i][k]); + } + } + let off = 0; + for (let i = batchCount - 1; i >= 0; i--) { + if (!batches[i].many.length) { + const moveFrom = batches[off].many; + if (moveFrom.length <= 1) { + if (off) { + off = 0; + } else { + return batches; + } + } + const len2 = moveFrom.length; + const mid = Math.ceil(len2 / 2); + batches[i].many = moveFrom.slice(mid, len2); + batches[off].many = moveFrom.slice(0, mid); + off++; + } + } + return batches; +} +var pathDividers = { + clone(params) { + const ret = []; + const approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count); + for (let i = 0; i < params.count; i++) { + const cloned = clonePath(params.path); + cloned.setStyle("opacity", approxOpacity); + ret.push(cloned); + } + return ret; + }, + split: null +}; +function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) { + if (!from.length || !to.length) { + return; + } + const updateAnimationCfg = getAnimationConfig("update", seriesModel, dataIndex); + if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) { + return; + } + const animationDelay = seriesModel.getModel("universalTransition").get("delay"); + const animationCfg = Object.assign({ + setToFinal: true + }, updateAnimationCfg); + let many; + let one; + if (isMultiple(from)) { + many = from; + one = to; + } + if (isMultiple(to)) { + many = to; + one = from; + } + function morphOneBatch(batch, fromIsMany2, animateIndex2, animateCount2, forceManyOne) { + const batchMany = batch.many; + const batchOne = batch.one; + if (batchMany.length === 1 && !forceManyOne) { + const batchFrom = fromIsMany2 ? batchMany[0] : batchOne; + const batchTo = fromIsMany2 ? batchOne : batchMany[0]; + if (isCombineMorphing(batchFrom)) { + morphOneBatch({ + many: [batchFrom], + one: batchTo + }, true, animateIndex2, animateCount2, true); + } else { + const individualAnimationCfg = animationDelay ? defaults({ + delay: animationDelay(animateIndex2, animateCount2) + }, animationCfg) : animationCfg; + morphPath(batchFrom, batchTo, individualAnimationCfg); + animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg); + } + } else { + const separateAnimationCfg = defaults({ + dividePath: pathDividers[divideShape], + individualDelay: animationDelay && function(idx, count3, fromPath, toPath) { + return animationDelay(idx + animateIndex2, animateCount2); + } + }, animationCfg); + const { + fromIndividuals, + toIndividuals + } = fromIsMany2 ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg); + const count2 = fromIndividuals.length; + for (let k = 0; k < count2; k++) { + const individualAnimationCfg = animationDelay ? defaults({ + delay: animationDelay(k, count2) + }, animationCfg) : animationCfg; + animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany2 ? batchMany[k] : batch.one, fromIsMany2 ? batch.one : batchMany[k], individualAnimationCfg); + } + } + } + const fromIsMany = many ? many === from : from.length > to.length; + const morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]); + let animateCount = 0; + for (let i = 0; i < morphBatches.length; i++) { + animateCount += morphBatches[i].many.length; + } + let animateIndex = 0; + for (let i = 0; i < morphBatches.length; i++) { + morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount); + animateIndex += morphBatches[i].many.length; + } +} +function getPathList(elements) { + if (!elements) { + return []; + } + if (isArray(elements)) { + const pathList2 = []; + for (let i = 0; i < elements.length; i++) { + pathList2.push(getPathList(elements[i])); + } + return pathList2; + } + const pathList = []; + elements.traverse((el) => { + if (el instanceof Path_default && !el.disableMorphing && !el.invisible && !el.ignore) { + pathList.push(el); + } + }); + return pathList; +} + +// src/animation/universalTransition.ts +var DATA_COUNT_THRESHOLD = 1e4; +var TRANSITION_NONE = 0; +var TRANSITION_P2C = 1; +var TRANSITION_C2P = 2; +var getUniversalTransitionGlobalStore = makeInner(); +function getDimension(data, visualDimension) { + const dimensions = data.dimensions; + for (let i = 0; i < dimensions.length; i++) { + const dimInfo = data.getDimensionInfo(dimensions[i]); + if (dimInfo && dimInfo.otherDims[visualDimension] === 0) { + return dimensions[i]; + } + } +} +function getValueByDimension(data, dataIndex, dimension) { + const dimInfo = data.getDimensionInfo(dimension); + const dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta; + if (dimInfo) { + const value = data.get(dimInfo.name, dataIndex); + if (dimOrdinalMeta) { + return dimOrdinalMeta.categories[value] || value + ""; + } + return value + ""; + } +} +function getGroupId(data, dataIndex, dataGroupId, isChild) { + const visualDimension = isChild ? "itemChildGroupId" : "itemGroupId"; + const groupIdDim = getDimension(data, visualDimension); + if (groupIdDim) { + const groupId = getValueByDimension(data, dataIndex, groupIdDim); + return groupId; + } + const rawDataItem = data.getRawDataItem(dataIndex); + const property = isChild ? "childGroupId" : "groupId"; + if (rawDataItem && rawDataItem[property]) { + return rawDataItem[property] + ""; + } + if (isChild) { + return; + } + return dataGroupId || data.getId(dataIndex); +} +function flattenDataDiffItems(list) { + const items = []; + each(list, (seriesInfo) => { + const data = seriesInfo.data; + const dataGroupId = seriesInfo.dataGroupId; + if (data.count() > DATA_COUNT_THRESHOLD) { + if (true) { + warn("Universal transition is disabled on large data > 10k."); + } + return; + } + const indices = data.getIndices(); + for (let dataIndex = 0; dataIndex < indices.length; dataIndex++) { + items.push({ + data, + groupId: getGroupId(data, dataIndex, dataGroupId, false), + childGroupId: getGroupId(data, dataIndex, dataGroupId, true), + divide: seriesInfo.divide, + dataIndex + }); } - function getSeriesTransitionKey(series) { - var seriesKey = series.getModel('universalTransition').get('seriesKey'); - if (!seriesKey) { - // Use series id by default. - return series.id; - } - return seriesKey; + }); + return items; +} +function fadeInElement(newEl2, newSeries, newIndex) { + newEl2.traverse((el) => { + if (el instanceof Path_default) { + initProps(el, { + style: { + opacity: 0 + } + }, newSeries, { + dataIndex: newIndex, + isFrom: true + }); } - function convertArraySeriesKeyToString(seriesKey) { - if (isArray(seriesKey)) { - // Order independent. - return seriesKey.sort().join(','); - } - return seriesKey; + }); +} +function removeEl2(el) { + if (el.parent) { + const computedTransform = el.getComputedTransform(); + el.setLocalTransform(computedTransform); + el.parent.remove(el); + } +} +function stopAnimation(el) { + el.stopAnimation(); + if (el.isGroup) { + el.traverse((child) => { + child.stopAnimation(); + }); + } +} +function animateElementStyles(el, dataIndex, seriesModel) { + const animationConfig = getAnimationConfig("update", seriesModel, dataIndex); + animationConfig && el.traverse((child) => { + if (child instanceof Displayable_default) { + const oldStyle = getOldStyle(child); + if (oldStyle) { + child.animateFrom({ + style: oldStyle + }, animationConfig); + } + } + }); +} +function isAllIdSame(oldDiffItems, newDiffItems) { + const len2 = oldDiffItems.length; + if (len2 !== newDiffItems.length) { + return false; + } + for (let i = 0; i < len2; i++) { + const oldItem = oldDiffItems[i]; + const newItem = newDiffItems[i]; + if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) { + return false; } - function getDivideShapeFromData(data) { - if (data.hostModel) { - return data.hostModel.getModel('universalTransition').get('divideShape'); + } + return true; +} +function transitionBetween(oldList, newList, api2) { + const oldDiffItems = flattenDataDiffItems(oldList); + const newDiffItems = flattenDataDiffItems(newList); + function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) { + if (rawFrom || from) { + to.animateFrom({ + style: rawFrom && rawFrom !== from ? extend(extend({}, rawFrom.style), from.style) : from.style + }, animationCfg); + } + } + let hasMorphAnimation = false; + let direction = TRANSITION_NONE; + const oldGroupIds = createHashMap(); + const oldChildGroupIds = createHashMap(); + oldDiffItems.forEach((item) => { + item.groupId && oldGroupIds.set(item.groupId, true); + item.childGroupId && oldChildGroupIds.set(item.childGroupId, true); + }); + for (let i = 0; i < newDiffItems.length; i++) { + const newGroupId = newDiffItems[i].groupId; + if (oldChildGroupIds.get(newGroupId)) { + direction = TRANSITION_P2C; + break; + } + const newChildGroupId = newDiffItems[i].childGroupId; + if (newChildGroupId && oldGroupIds.get(newChildGroupId)) { + direction = TRANSITION_C2P; + break; + } + } + function createKeyGetter(isOld, onlyGetId) { + return function(diffItem) { + const data = diffItem.data; + const dataIndex = diffItem.dataIndex; + if (onlyGetId) { + return data.getId(dataIndex); + } + if (isOld) { + return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId; + } else { + return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId; } - } - function findTransitionSeriesBatches(globalStore, params) { - var updateBatches = createHashMap(); - var oldDataMap = createHashMap(); - // Map that only store key in array seriesKey. - // Which is used to query the old data when transition from one to multiple series. - var oldDataMapForSplit = createHashMap(); - each(globalStore.oldSeries, function (series, idx) { - var oldDataGroupId = globalStore.oldDataGroupIds[idx]; - var oldData = globalStore.oldData[idx]; - var transitionKey = getSeriesTransitionKey(series); - var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); - oldDataMap.set(transitionKeyStr, { + }; + } + const useId = isAllIdSame(oldDiffItems, newDiffItems); + const isElementStillInChart = {}; + if (!useId) { + for (let i = 0; i < newDiffItems.length; i++) { + const newItem = newDiffItems[i]; + const el = newItem.data.getItemGraphicEl(newItem.dataIndex); + if (el) { + isElementStillInChart[el.id] = true; + } + } + } + function updateOneToOne(newIndex, oldIndex) { + const oldItem = oldDiffItems[oldIndex]; + const newItem = newDiffItems[newIndex]; + const newSeries = newItem.data.hostModel; + const oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); + const newEl2 = newItem.data.getItemGraphicEl(newItem.dataIndex); + if (oldEl === newEl2) { + newEl2 && animateElementStyles(newEl2, newItem.dataIndex, newSeries); + return; + } + if (oldEl && isElementStillInChart[oldEl.id]) { + return; + } + if (newEl2) { + stopAnimation(newEl2); + if (oldEl) { + stopAnimation(oldEl); + removeEl2(oldEl); + hasMorphAnimation = true; + applyMorphAnimation(getPathList(oldEl), getPathList(newEl2), newItem.divide, newSeries, newIndex, updateMorphingPathProps); + } else { + fadeInElement(newEl2, newSeries, newIndex); + } + } + } + new DataDiffer_default(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, "multiple").update(updateOneToOne).updateManyToOne(function(newIndex, oldIndices) { + const newItem = newDiffItems[newIndex]; + const newData = newItem.data; + const newSeries = newData.hostModel; + const newEl2 = newData.getItemGraphicEl(newItem.dataIndex); + const oldElsList = filter(map(oldIndices, (idx) => oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex)), (oldEl) => oldEl && oldEl !== newEl2 && !isElementStillInChart[oldEl.id]); + if (newEl2) { + stopAnimation(newEl2); + if (oldElsList.length) { + each(oldElsList, (oldEl) => { + stopAnimation(oldEl); + removeEl2(oldEl); + }); + hasMorphAnimation = true; + applyMorphAnimation(getPathList(oldElsList), getPathList(newEl2), newItem.divide, newSeries, newIndex, updateMorphingPathProps); + } else { + fadeInElement(newEl2, newSeries, newItem.dataIndex); + } + } + }).updateOneToMany(function(newIndices, oldIndex) { + const oldItem = oldDiffItems[oldIndex]; + const oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); + if (oldEl && isElementStillInChart[oldEl.id]) { + return; + } + const newElsList = filter(map(newIndices, (idx) => newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex)), (el) => el && el !== oldEl); + const newSeris = newDiffItems[newIndices[0]].data.hostModel; + if (newElsList.length) { + each(newElsList, (newEl2) => stopAnimation(newEl2)); + if (oldEl) { + stopAnimation(oldEl); + removeEl2(oldEl); + hasMorphAnimation = true; + applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, newSeris, newIndices[0], updateMorphingPathProps); + } else { + each(newElsList, (newEl2) => fadeInElement(newEl2, newSeris, newIndices[0])); + } + } + }).updateManyToMany(function(newIndices, oldIndices) { + new DataDiffer_default(oldIndices, newIndices, (rawIdx) => oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex), (rawIdx) => newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex)).update((newIndex, oldIndex) => { + updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]); + }).execute(); + }).execute(); + if (hasMorphAnimation) { + each(newList, ({data}) => { + const seriesModel = data.hostModel; + const view = seriesModel && api2.getViewOfSeriesModel(seriesModel); + const animationCfg = getAnimationConfig("update", seriesModel, 0); + if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) { + view.group.traverse((el) => { + if (el instanceof Path_default && !el.animators.length) { + el.animateFrom({ + style: { + opacity: 0 + } + }, animationCfg); + } + }); + } + }); + } +} +function getSeriesTransitionKey(series) { + const seriesKey = series.getModel("universalTransition").get("seriesKey"); + if (!seriesKey) { + return series.id; + } + return seriesKey; +} +function convertArraySeriesKeyToString(seriesKey) { + if (isArray(seriesKey)) { + return seriesKey.sort().join(","); + } + return seriesKey; +} +function getDivideShapeFromData(data) { + if (data.hostModel) { + return data.hostModel.getModel("universalTransition").get("divideShape"); + } +} +function findTransitionSeriesBatches(globalStore, params) { + const updateBatches = createHashMap(); + const oldDataMap = createHashMap(); + const oldDataMapForSplit = createHashMap(); + each(globalStore.oldSeries, (series, idx) => { + const oldDataGroupId = globalStore.oldDataGroupIds[idx]; + const oldData = globalStore.oldData[idx]; + const transitionKey = getSeriesTransitionKey(series); + const transitionKeyStr = convertArraySeriesKeyToString(transitionKey); + oldDataMap.set(transitionKeyStr, { + dataGroupId: oldDataGroupId, + data: oldData + }); + if (isArray(transitionKey)) { + each(transitionKey, (key) => { + oldDataMapForSplit.set(key, { + key: transitionKeyStr, dataGroupId: oldDataGroupId, data: oldData }); - if (isArray(transitionKey)) { - // Same key can't in different array seriesKey. - each(transitionKey, function (key) { - oldDataMapForSplit.set(key, { - key: transitionKeyStr, - dataGroupId: oldDataGroupId, - data: oldData - }); - }); - } }); - function checkTransitionSeriesKeyDuplicated(transitionKeyStr) { - if (updateBatches.get(transitionKeyStr)) { - warn("Duplicated seriesKey in universalTransition " + transitionKeyStr); - } - } - each(params.updatedSeries, function (series) { - if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) { - var newDataGroupId = series.get('dataGroupId'); - var newData = series.getData(); - var transitionKey = getSeriesTransitionKey(series); - var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); - // Only transition between series with same id. - var oldData = oldDataMap.get(transitionKeyStr); - // string transition key is the best match. - if (oldData) { - if ("development" !== 'production') { - checkTransitionSeriesKeyDuplicated(transitionKeyStr); + } + }); + function checkTransitionSeriesKeyDuplicated(transitionKeyStr) { + if (updateBatches.get(transitionKeyStr)) { + warn(`Duplicated seriesKey in universalTransition ${transitionKeyStr}`); + } + } + each(params.updatedSeries, (series) => { + if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) { + const newDataGroupId = series.get("dataGroupId"); + const newData = series.getData(); + const transitionKey = getSeriesTransitionKey(series); + const transitionKeyStr = convertArraySeriesKeyToString(transitionKey); + const oldData = oldDataMap.get(transitionKeyStr); + if (oldData) { + if (true) { + checkTransitionSeriesKeyDuplicated(transitionKeyStr); + } + updateBatches.set(transitionKeyStr, { + oldSeries: [{ + dataGroupId: oldData.dataGroupId, + divide: getDivideShapeFromData(oldData.data), + data: oldData.data + }], + newSeries: [{ + dataGroupId: newDataGroupId, + divide: getDivideShapeFromData(newData), + data: newData + }] + }); + } else { + if (isArray(transitionKey)) { + if (true) { + checkTransitionSeriesKeyDuplicated(transitionKeyStr); + } + const oldSeries = []; + each(transitionKey, (key) => { + const oldData2 = oldDataMap.get(key); + if (oldData2.data) { + oldSeries.push({ + dataGroupId: oldData2.dataGroupId, + divide: getDivideShapeFromData(oldData2.data), + data: oldData2.data + }); } - // TODO check if data is same? + }); + if (oldSeries.length) { updateBatches.set(transitionKeyStr, { - oldSeries: [{ - dataGroupId: oldData.dataGroupId, - divide: getDivideShapeFromData(oldData.data), - data: oldData.data - }], + oldSeries, newSeries: [{ dataGroupId: newDataGroupId, - divide: getDivideShapeFromData(newData), - data: newData + data: newData, + divide: getDivideShapeFromData(newData) }] }); - } else { - // Transition from multiple series. - // e.g. 'female', 'male' -> ['female', 'male'] - if (isArray(transitionKey)) { - if ("development" !== 'production') { - checkTransitionSeriesKeyDuplicated(transitionKeyStr); - } - var oldSeries_1 = []; - each(transitionKey, function (key) { - var oldData = oldDataMap.get(key); - if (oldData.data) { - oldSeries_1.push({ - dataGroupId: oldData.dataGroupId, - divide: getDivideShapeFromData(oldData.data), - data: oldData.data - }); - } - }); - if (oldSeries_1.length) { - updateBatches.set(transitionKeyStr, { - oldSeries: oldSeries_1, - newSeries: [{ - dataGroupId: newDataGroupId, - data: newData, - divide: getDivideShapeFromData(newData) - }] - }); - } - } else { - // Try transition to multiple series. - // e.g. ['female', 'male'] -> 'female', 'male' - var oldData_1 = oldDataMapForSplit.get(transitionKey); - if (oldData_1) { - var batch = updateBatches.get(oldData_1.key); - if (!batch) { - batch = { - oldSeries: [{ - dataGroupId: oldData_1.dataGroupId, - data: oldData_1.data, - divide: getDivideShapeFromData(oldData_1.data) - }], - newSeries: [] - }; - updateBatches.set(oldData_1.key, batch); - } - batch.newSeries.push({ - dataGroupId: newDataGroupId, - data: newData, - divide: getDivideShapeFromData(newData) - }); - } + } + } else { + const oldData2 = oldDataMapForSplit.get(transitionKey); + if (oldData2) { + let batch = updateBatches.get(oldData2.key); + if (!batch) { + batch = { + oldSeries: [{ + dataGroupId: oldData2.dataGroupId, + data: oldData2.data, + divide: getDivideShapeFromData(oldData2.data) + }], + newSeries: [] + }; + updateBatches.set(oldData2.key, batch); } + batch.newSeries.push({ + dataGroupId: newDataGroupId, + data: newData, + divide: getDivideShapeFromData(newData) + }); } } - }); - return updateBatches; - } - function querySeries(series, finder) { - for (var i = 0; i < series.length; i++) { - var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id; - if (found) { - return i; - } } } - function transitionSeriesFromOpt(transitionOpt, globalStore, params, api) { - var from = []; - var to = []; - each(normalizeToArray(transitionOpt.from), function (finder) { - var idx = querySeries(globalStore.oldSeries, finder); - if (idx >= 0) { - from.push({ - dataGroupId: globalStore.oldDataGroupIds[idx], - data: globalStore.oldData[idx], - // TODO can specify divideShape in transition. - divide: getDivideShapeFromData(globalStore.oldData[idx]), - groupIdDim: finder.dimension - }); - } - }); - each(normalizeToArray(transitionOpt.to), function (finder) { - var idx = querySeries(params.updatedSeries, finder); - if (idx >= 0) { - var data = params.updatedSeries[idx].getData(); - to.push({ - dataGroupId: globalStore.oldDataGroupIds[idx], - data: data, - divide: getDivideShapeFromData(data), - groupIdDim: finder.dimension - }); - } + }); + return updateBatches; +} +function querySeries(series, finder) { + for (let i = 0; i < series.length; i++) { + const found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id; + if (found) { + return i; + } + } +} +function transitionSeriesFromOpt(transitionOpt, globalStore, params, api2) { + const from = []; + const to = []; + each(normalizeToArray(transitionOpt.from), (finder) => { + const idx = querySeries(globalStore.oldSeries, finder); + if (idx >= 0) { + from.push({ + dataGroupId: globalStore.oldDataGroupIds[idx], + data: globalStore.oldData[idx], + divide: getDivideShapeFromData(globalStore.oldData[idx]), + groupIdDim: finder.dimension }); - if (from.length > 0 && to.length > 0) { - transitionBetween(from, to, api); - } - } - function installUniversalTransition(registers) { - registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) { - each(normalizeToArray(params.seriesTransition), function (transOpt) { - each(normalizeToArray(transOpt.to), function (finder) { - var series = params.updatedSeries; - for (var i = 0; i < series.length; i++) { - if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) { - series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true; - } - } - }); - }); + } + }); + each(normalizeToArray(transitionOpt.to), (finder) => { + const idx = querySeries(params.updatedSeries, finder); + if (idx >= 0) { + const data = params.updatedSeries[idx].getData(); + to.push({ + dataGroupId: globalStore.oldDataGroupIds[idx], + data, + divide: getDivideShapeFromData(data), + groupIdDim: finder.dimension }); - registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) { - // TODO api provide an namespace that can save stuff per instance - var globalStore = getUniversalTransitionGlobalStore(api); - // TODO multiple to multiple series. - if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) { - // TODO transitionOpt was used in an old implementation and can be removed now - // Use give transition config if its' give; - var transitionOpt = params.seriesTransition; - if (transitionOpt) { - each(normalizeToArray(transitionOpt), function (opt) { - transitionSeriesFromOpt(opt, globalStore, params, api); - }); - } else { - // Else guess from series based on transition series key. - var updateBatches_1 = findTransitionSeriesBatches(globalStore, params); - each(updateBatches_1.keys(), function (key) { - var batch = updateBatches_1.get(key); - transitionBetween(batch.oldSeries, batch.newSeries, api); - }); + } + }); + if (from.length > 0 && to.length > 0) { + transitionBetween(from, to, api2); + } +} +function installUniversalTransition(registers) { + registers.registerUpdateLifecycle("series:beforeupdate", (ecMOdel, api2, params) => { + each(normalizeToArray(params.seriesTransition), (transOpt) => { + each(normalizeToArray(transOpt.to), (finder) => { + const series = params.updatedSeries; + for (let i = 0; i < series.length; i++) { + if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) { + series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true; } - // Reset - each(params.updatedSeries, function (series) { - // Reset; - if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) { - series[SERIES_UNIVERSAL_TRANSITION_PROP] = false; - } - }); } - // Save all series of current update. Not only the updated one. - var allSeries = ecModel.getSeries(); - var savedSeries = globalStore.oldSeries = []; - var savedDataGroupIds = globalStore.oldDataGroupIds = []; - var savedData = globalStore.oldData = []; - for (var i = 0; i < allSeries.length; i++) { - var data = allSeries[i].getData(); - // Only save the data that can have transition. - // Avoid large data costing too much extra memory - if (data.count() < DATA_COUNT_THRESHOLD) { - savedSeries.push(allSeries[i]); - savedDataGroupIds.push(allSeries[i].get('dataGroupId')); - savedData.push(data); - } + }); + }); + }); + registers.registerUpdateLifecycle("series:transition", (ecModel, api2, params) => { + const globalStore = getUniversalTransitionGlobalStore(api2); + if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) { + const transitionOpt = params.seriesTransition; + if (transitionOpt) { + each(normalizeToArray(transitionOpt), (opt) => { + transitionSeriesFromOpt(opt, globalStore, params, api2); + }); + } else { + const updateBatches = findTransitionSeriesBatches(globalStore, params); + each(updateBatches.keys(), (key) => { + const batch = updateBatches.get(key); + transitionBetween(batch.oldSeries, batch.newSeries, api2); + }); + } + each(params.updatedSeries, (series) => { + if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) { + series[SERIES_UNIVERSAL_TRANSITION_PROP] = false; } }); } - - // ----------------- - // Render engines - // ----------------- - // Render via Canvas. - // echarts.init(dom, null, { renderer: 'canvas' }) - use([install$1]); - // Render via SVG. - // echarts.init(dom, null, { renderer: 'svg' }) - use([install]); - // ---------------- - // Charts (series) - // ---------------- - // All of the series types, for example: - // chart.setOption({ - // series: [{ - // type: 'line' // or 'bar', 'pie', ... - // }] - // }); - use([install$2, install$3, install$4, install$6, install$8, install$a, install$b, install$c, install$d, install$e, install$f, install$h, install$i, install$j, install$k, install$l, install$m, install$n, install$o, install$p, install$q, install$r]); - // ------------------- - // Coordinate systems - // ------------------- - // All of the axis modules have been included in the - // coordinate system module below, do not need to - // make extra import. - // `cartesian` coordinate system. For some historical - // reasons, it is named as grid, for example: - // chart.setOption({ - // grid: {...}, - // xAxis: {...}, - // yAxis: {...}, - // series: [{...}] - // }); - use(install$t); - // `polar` coordinate system, for example: - // chart.setOption({ - // polar: {...}, - // radiusAxis: {...}, - // angleAxis: {...}, - // series: [{ - // coordinateSystem: 'polar' - // }] - // }); - use(install$u); - // `geo` coordinate system, for example: - // chart.setOption({ - // geo: {...}, - // series: [{ - // coordinateSystem: 'geo' - // }] - // }); - use(install$9); - // `singleAxis` coordinate system (notice, it is a coordinate system - // with only one axis, work for chart like theme river), for example: - // chart.setOption({ - // singleAxis: {...} - // series: [{type: 'themeRiver', ...}] - // }); - use(install$v); - // `parallel` coordinate system, only work for parallel series, for example: - // chart.setOption({ - // parallel: {...}, - // parallelAxis: [{...}, ...], - // series: [{ - // type: 'parallel' - // }] - // }); - use(install$g); - // `calendar` coordinate system. for example, - // chart.setOption({ - // calendar: {...}, - // series: [{ - // coordinateSystem: 'calendar' - // }] - // ); - use(install$w); - // ------------------ - // Other components - // ------------------ - // `graphic` component, for example: - // chart.setOption({ - // graphic: {...} - // }); - use(install$x); - // `toolbox` component, for example: - // chart.setOption({ - // toolbox: {...} - // }); - use(install$z); - // `tooltip` component, for example: - // chart.setOption({ - // tooltip: {...} - // }); - use(install$A); - // `axisPointer` component, for example: - // chart.setOption({ - // tooltip: {axisPointer: {...}, ...} - // }); - // Or - // chart.setOption({ - // axisPointer: {...} - // }); - use(install$s); - // `brush` component, for example: - // chart.setOption({ - // brush: {...} - // }); - // Or - // chart.setOption({ - // tooltip: {feature: {brush: {...}} - // }) - use(install$B); - // `title` component, for example: - // chart.setOption({ - // title: {...} - // }); - use(install$C); - // `timeline` component, for example: - // chart.setOption({ - // timeline: {...} - // }); - use(install$D); - // `markPoint` component, for example: - // chart.setOption({ - // series: [{markPoint: {...}}] - // }); - use(install$E); - // `markLine` component, for example: - // chart.setOption({ - // series: [{markLine: {...}}] - // }); - use(install$F); - // `markArea` component, for example: - // chart.setOption({ - // series: [{markArea: {...}}] - // }); - use(install$G); - // `legend` component not scrollable. for example: - // chart.setOption({ - // legend: {...} - // }); - use(install$J); - // `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`. - use(install$M); - // `dataZoom` component providing drag, pinch, wheel behaviors - // inside coordinate system, for example: - // chart.setOption({ - // dataZoom: {type: 'inside'} - // }); - use(install$K); - // `dataZoom` component providing a slider bar, for example: - // chart.setOption({ - // dataZoom: {type: 'slider'} - // }); - use(install$L); - // `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`. - use(install$P); - // `visualMap` component providing continuous bar, for example: - // chart.setOption({ - // visualMap: {type: 'continuous'} - // }); - use(install$N); - // `visualMap` component providing pieces bar, for example: - // chart.setOption({ - // visualMap: {type: 'piecewise'} - // }); - use(install$O); - // `aria` component providing aria, for example: - // chart.setOption({ - // aria: {...} - // }); - use(install$Q); - // dataset transform - // chart.setOption({ - // dataset: { - // transform: [] - // } - // }); - use(install$R); - use(install$S); - // universal transition - // chart.setOption({ - // series: { - // universalTransition: { enabled: true } - // } - // }) - use(installUniversalTransition); - // label layout - // chart.setOption({ - // series: { - // labelLayout: { hideOverlap: true } - // } - // }) - use(installLabelLayout); - - exports.Axis = Axis; - exports.ChartView = ChartView; - exports.ComponentModel = ComponentModel; - exports.ComponentView = ComponentView; - exports.List = SeriesData; - exports.Model = Model; - exports.PRIORITY = PRIORITY; - exports.SeriesModel = SeriesModel; - exports.color = color; - exports.connect = connect; - exports.dataTool = dataTool; - exports.dependencies = dependencies; - exports.disConnect = disConnect; - exports.disconnect = disconnect; - exports.dispose = dispose$1; - exports.env = env; - exports.extendChartView = extendChartView; - exports.extendComponentModel = extendComponentModel; - exports.extendComponentView = extendComponentView; - exports.extendSeriesModel = extendSeriesModel; - exports.format = format$1; - exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions; - exports.getInstanceByDom = getInstanceByDom; - exports.getInstanceById = getInstanceById; - exports.getMap = getMap; - exports.graphic = graphic$1; - exports.helper = helper; - exports.init = init$1; - exports.innerDrawElementOnCanvas = brushSingle; - exports.matrix = matrix; - exports.number = number; - exports.parseGeoJSON = parseGeoJSON; - exports.parseGeoJson = parseGeoJSON; - exports.registerAction = registerAction; - exports.registerCoordinateSystem = registerCoordinateSystem; - exports.registerLayout = registerLayout; - exports.registerLoading = registerLoading; - exports.registerLocale = registerLocale; - exports.registerMap = registerMap; - exports.registerPostInit = registerPostInit; - exports.registerPostUpdate = registerPostUpdate; - exports.registerPreprocessor = registerPreprocessor; - exports.registerProcessor = registerProcessor; - exports.registerTheme = registerTheme; - exports.registerTransform = registerTransform; - exports.registerUpdateLifecycle = registerUpdateLifecycle; - exports.registerVisual = registerVisual; - exports.setCanvasCreator = setCanvasCreator; - exports.setPlatformAPI = setPlatformAPI; - exports.throttle = throttle; - exports.time = time; - exports.use = use; - exports.util = util$1; - exports.vector = vector; - exports.version = version$1; - exports.zrUtil = util; - exports.zrender = zrender; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); + const allSeries = ecModel.getSeries(); + const savedSeries = globalStore.oldSeries = []; + const savedDataGroupIds = globalStore.oldDataGroupIds = []; + const savedData = globalStore.oldData = []; + for (let i = 0; i < allSeries.length; i++) { + const data = allSeries[i].getData(); + if (data.count() < DATA_COUNT_THRESHOLD) { + savedSeries.push(allSeries[i]); + savedDataGroupIds.push(allSeries[i].get("dataGroupId")); + savedData.push(data); + } + } + }); +} + +// src/echarts.all.ts +use([install2]); +use([install]); +use([ + install3, + install4, + install5, + install7, + install9, + install11, + install12, + install13, + install14, + install15, + install16, + install18, + install19, + install20, + install21, + install22, + install23, + install24, + install25, + install26, + install27, + install28 +]); +use(install30); +use(install31); +use(install10); +use(install32); +use(install17); +use(install33); +use(install34); +use(install36); +use(install37); +use(install29); +use(install38); +use(install39); +use(install40); +use(install41); +use(install42); +use(install43); +use(install46); +use(install49); +use(install47); +use(install48); +use(install52); +use(install50); +use(install51); +use(install53); +use(install54); +use(install55); +use(installUniversalTransition); +use(installLabelLayout); + +})); //# sourceMappingURL=echarts.js.map diff --git a/dist/echarts.js.map b/dist/echarts.js.map index 40c5764cc2..5f5c8a7bb6 100644 --- a/dist/echarts.js.map +++ b/dist/echarts.js.map @@ -1 +1,7 @@ -{"version":3,"file":"echarts.js","sources":["../node_modules/tslib/tslib.es6.js","../node_modules/zrender/lib/core/env.js","../node_modules/zrender/lib/core/platform.js","../node_modules/zrender/lib/core/util.js","../node_modules/zrender/lib/core/vector.js","../node_modules/zrender/lib/mixin/Draggable.js","../node_modules/zrender/lib/core/Eventful.js","../node_modules/zrender/lib/core/fourPointsTransform.js","../node_modules/zrender/lib/core/dom.js","../node_modules/zrender/lib/core/event.js","../node_modules/zrender/lib/core/GestureMgr.js","../node_modules/zrender/lib/core/matrix.js","../node_modules/zrender/lib/core/Point.js","../node_modules/zrender/lib/core/BoundingRect.js","../node_modules/zrender/lib/Handler.js","../node_modules/zrender/lib/core/timsort.js","../node_modules/zrender/lib/graphic/constants.js","../node_modules/zrender/lib/Storage.js","../node_modules/zrender/lib/animation/requestAnimationFrame.js","../node_modules/zrender/lib/animation/easing.js","../node_modules/zrender/lib/core/curve.js","../node_modules/zrender/lib/animation/cubicEasing.js","../node_modules/zrender/lib/animation/Clip.js","../node_modules/zrender/lib/core/LRU.js","../node_modules/zrender/lib/tool/color.js","../node_modules/zrender/lib/svg/helper.js","../node_modules/zrender/lib/animation/Animator.js","../node_modules/zrender/lib/animation/Animation.js","../node_modules/zrender/lib/dom/HandlerProxy.js","../node_modules/zrender/lib/config.js","../node_modules/zrender/lib/core/Transformable.js","../node_modules/zrender/lib/contain/text.js","../node_modules/zrender/lib/Element.js","../node_modules/zrender/lib/graphic/Group.js","../node_modules/zrender/lib/zrender.js","../lib/util/number.js","../lib/util/log.js","../lib/util/model.js","../lib/util/clazz.js","../lib/model/mixin/makeStyleMapper.js","../lib/model/mixin/areaStyle.js","../node_modules/zrender/lib/graphic/helper/image.js","../node_modules/zrender/lib/graphic/helper/parseText.js","../node_modules/zrender/lib/graphic/Displayable.js","../node_modules/zrender/lib/core/bbox.js","../node_modules/zrender/lib/core/PathProxy.js","../node_modules/zrender/lib/contain/line.js","../node_modules/zrender/lib/contain/cubic.js","../node_modules/zrender/lib/contain/quadratic.js","../node_modules/zrender/lib/contain/util.js","../node_modules/zrender/lib/contain/arc.js","../node_modules/zrender/lib/contain/windingLine.js","../node_modules/zrender/lib/contain/path.js","../node_modules/zrender/lib/graphic/Path.js","../node_modules/zrender/lib/graphic/TSpan.js","../node_modules/zrender/lib/graphic/Image.js","../node_modules/zrender/lib/graphic/helper/roundRect.js","../node_modules/zrender/lib/graphic/helper/subPixelOptimize.js","../node_modules/zrender/lib/graphic/shape/Rect.js","../node_modules/zrender/lib/graphic/Text.js","../lib/util/innerStore.js","../lib/util/states.js","../node_modules/zrender/lib/tool/transformPath.js","../node_modules/zrender/lib/tool/path.js","../node_modules/zrender/lib/graphic/shape/Circle.js","../node_modules/zrender/lib/graphic/shape/Ellipse.js","../node_modules/zrender/lib/graphic/helper/roundSector.js","../node_modules/zrender/lib/graphic/shape/Sector.js","../node_modules/zrender/lib/graphic/shape/Ring.js","../node_modules/zrender/lib/graphic/helper/smoothBezier.js","../node_modules/zrender/lib/graphic/helper/poly.js","../node_modules/zrender/lib/graphic/shape/Polygon.js","../node_modules/zrender/lib/graphic/shape/Polyline.js","../node_modules/zrender/lib/graphic/shape/Line.js","../node_modules/zrender/lib/graphic/shape/BezierCurve.js","../node_modules/zrender/lib/graphic/shape/Arc.js","../node_modules/zrender/lib/graphic/CompoundPath.js","../node_modules/zrender/lib/graphic/Gradient.js","../node_modules/zrender/lib/graphic/LinearGradient.js","../node_modules/zrender/lib/graphic/RadialGradient.js","../node_modules/zrender/lib/core/OrientedBoundingRect.js","../node_modules/zrender/lib/graphic/IncrementalDisplayable.js","../lib/animation/basicTransition.js","../lib/util/graphic.js","../lib/label/labelStyle.js","../lib/model/mixin/textStyle.js","../lib/model/mixin/lineStyle.js","../lib/model/mixin/itemStyle.js","../lib/model/Model.js","../lib/util/component.js","../lib/i18n/langEN.js","../lib/i18n/langZH.js","../lib/core/locale.js","../lib/util/time.js","../lib/legacy/getTextRect.js","../lib/util/format.js","../lib/util/layout.js","../lib/model/Component.js","../lib/model/globalDefault.js","../lib/util/types.js","../lib/data/helper/sourceHelper.js","../lib/model/internalComponentCreator.js","../lib/model/mixin/palette.js","../lib/model/Global.js","../lib/core/ExtensionAPI.js","../lib/core/CoordinateSystem.js","../lib/model/OptionManager.js","../lib/preprocessor/helper/compatStyle.js","../lib/preprocessor/backwardCompat.js","../lib/processor/dataStack.js","../lib/data/Source.js","../lib/data/helper/dataProvider.js","../lib/model/mixin/dataFormat.js","../lib/core/task.js","../lib/data/helper/dataValueHelper.js","../lib/data/helper/transform.js","../lib/data/DataStore.js","../lib/data/helper/sourceManager.js","../lib/component/tooltip/tooltipMarkup.js","../lib/component/tooltip/seriesFormatTooltip.js","../lib/model/Series.js","../lib/view/Component.js","../lib/chart/helper/createRenderPlanner.js","../lib/view/Chart.js","../lib/util/throttle.js","../lib/visual/style.js","../lib/loading/default.js","../lib/core/Scheduler.js","../lib/theme/light.js","../lib/theme/dark.js","../lib/util/ECEventProcessor.js","../lib/visual/symbol.js","../lib/visual/helper.js","../lib/legacy/dataSelectAction.js","../lib/util/event.js","../node_modules/zrender/lib/core/WeakMap.js","../lib/util/symbol.js","../node_modules/zrender/lib/canvas/helper.js","../node_modules/zrender/lib/canvas/dashStyle.js","../node_modules/zrender/lib/canvas/graphic.js","../lib/util/decal.js","../lib/visual/decal.js","../lib/core/lifecycle.js","../lib/core/impl.js","../lib/core/echarts.js","../lib/extension.js","../lib/data/DataDiffer.js","../lib/data/helper/dimensionHelper.js","../lib/data/SeriesDimensionDefine.js","../lib/data/helper/SeriesDataSchema.js","../lib/data/SeriesData.js","../lib/data/helper/createDimensions.js","../lib/model/referHelper.js","../lib/data/helper/dataStackHelper.js","../lib/chart/helper/createSeriesData.js","../lib/scale/Scale.js","../lib/data/OrdinalMeta.js","../lib/scale/helper.js","../lib/scale/Ordinal.js","../lib/scale/Interval.js","../lib/util/vendor.js","../lib/layout/barGrid.js","../lib/scale/Time.js","../lib/scale/Log.js","../lib/coord/scaleRawExtentInfo.js","../lib/coord/axisHelper.js","../lib/coord/axisModelCommonMixin.js","../lib/export/api/helper.js","../node_modules/zrender/lib/contain/polygon.js","../lib/coord/geo/Region.js","../lib/coord/geo/parseGeoJson.js","../lib/coord/axisTickLabelBuilder.js","../lib/coord/Axis.js","../lib/export/api.js","../lib/label/labelGuideHelper.js","../lib/label/labelLayoutHelper.js","../lib/label/LabelManager.js","../lib/label/installLabelLayout.js","../node_modules/zrender/lib/svg/SVGPathRebuilder.js","../node_modules/zrender/lib/svg/mapStyleToAttrs.js","../node_modules/zrender/lib/svg/core.js","../node_modules/zrender/lib/svg/cssClassId.js","../node_modules/zrender/lib/svg/cssAnimation.js","../node_modules/zrender/lib/svg/cssEmphasis.js","../node_modules/zrender/lib/svg/graphic.js","../node_modules/zrender/lib/svg/domapi.js","../node_modules/zrender/lib/svg/patch.js","../node_modules/zrender/lib/svg/Painter.js","../lib/renderer/installSVGRenderer.js","../node_modules/zrender/lib/canvas/Layer.js","../node_modules/zrender/lib/canvas/Painter.js","../lib/renderer/installCanvasRenderer.js","../lib/chart/line/LineSeries.js","../lib/chart/helper/labelHelper.js","../lib/chart/helper/Symbol.js","../lib/chart/helper/SymbolDraw.js","../lib/chart/line/helper.js","../lib/chart/line/lineAnimationDiff.js","../lib/chart/line/poly.js","../lib/chart/helper/createClipPathFromCoordSys.js","../lib/coord/CoordinateSystem.js","../lib/chart/line/LineView.js","../lib/layout/points.js","../lib/processor/dataSample.js","../lib/chart/line/install.js","../lib/chart/bar/BaseBarSeries.js","../lib/chart/bar/BarSeries.js","../lib/util/shape/sausage.js","../lib/label/sectorLabel.js","../lib/chart/helper/sectorHelper.js","../lib/chart/bar/BarView.js","../lib/chart/bar/install.js","../lib/chart/pie/pieLayout.js","../lib/processor/dataFilter.js","../lib/chart/pie/labelLayout.js","../lib/chart/pie/PieView.js","../lib/chart/helper/createSeriesDataSimply.js","../lib/visual/LegendVisualProvider.js","../lib/chart/pie/PieSeries.js","../lib/processor/negativeDataFilter.js","../lib/chart/pie/install.js","../lib/chart/scatter/ScatterSeries.js","../lib/chart/helper/LargeSymbolDraw.js","../lib/chart/scatter/ScatterView.js","../lib/coord/cartesian/GridModel.js","../lib/coord/cartesian/AxisModel.js","../lib/coord/axisDefault.js","../lib/coord/axisCommonTypes.js","../lib/coord/axisModelCreator.js","../lib/coord/cartesian/Cartesian.js","../lib/coord/cartesian/Cartesian2D.js","../lib/coord/cartesian/Axis2D.js","../lib/coord/cartesian/cartesianAxisHelper.js","../lib/coord/axisAlignTicks.js","../lib/coord/cartesian/Grid.js","../lib/component/axis/AxisBuilder.js","../lib/component/axisPointer/modelHelper.js","../lib/component/axis/AxisView.js","../lib/component/axis/axisSplitHelper.js","../lib/component/axis/CartesianAxisView.js","../lib/component/grid/installSimple.js","../lib/chart/scatter/install.js","../lib/chart/radar/radarLayout.js","../lib/chart/radar/backwardCompat.js","../lib/chart/radar/RadarView.js","../lib/chart/radar/RadarSeries.js","../lib/coord/radar/RadarModel.js","../lib/component/radar/RadarView.js","../lib/coord/radar/IndicatorAxis.js","../lib/coord/radar/Radar.js","../lib/component/radar/install.js","../lib/chart/radar/install.js","../lib/component/helper/interactionMutex.js","../lib/component/helper/RoamController.js","../lib/component/helper/roamHelper.js","../lib/component/helper/cursorHelper.js","../node_modules/zrender/lib/tool/parseXML.js","../node_modules/zrender/lib/tool/parseSVG.js","../lib/coord/geo/GeoSVGResource.js","../lib/coord/geo/fix/nanhai.js","../lib/coord/geo/fix/textCoord.js","../lib/coord/geo/fix/diaoyuIsland.js","../lib/coord/geo/GeoJSONResource.js","../lib/coord/geo/geoSourceManager.js","../lib/component/helper/MapDraw.js","../lib/chart/map/MapView.js","../lib/chart/map/MapSeries.js","../lib/chart/map/mapDataStatistic.js","../lib/chart/map/mapSymbolLayout.js","../lib/coord/View.js","../lib/coord/geo/Geo.js","../lib/coord/geo/geoCreator.js","../lib/coord/geo/GeoModel.js","../lib/action/roamHelper.js","../lib/component/geo/GeoView.js","../lib/component/geo/install.js","../lib/chart/map/install.js","../lib/chart/tree/layoutHelper.js","../lib/chart/tree/TreeView.js","../lib/data/helper/linkSeriesData.js","../lib/data/Tree.js","../lib/chart/helper/treeHelper.js","../lib/chart/tree/TreeSeries.js","../lib/chart/tree/traversalHelper.js","../lib/chart/tree/treeLayout.js","../lib/chart/tree/treeVisual.js","../lib/chart/tree/treeAction.js","../lib/chart/tree/install.js","../lib/chart/treemap/treemapAction.js","../lib/chart/helper/enableAriaDecalForTree.js","../lib/chart/treemap/TreemapSeries.js","../lib/chart/treemap/Breadcrumb.js","../lib/util/animation.js","../lib/chart/treemap/TreemapView.js","../lib/visual/VisualMapping.js","../lib/chart/treemap/treemapVisual.js","../lib/chart/treemap/treemapLayout.js","../lib/chart/treemap/install.js","../lib/chart/graph/categoryFilter.js","../lib/chart/graph/categoryVisual.js","../lib/chart/graph/edgeVisual.js","../lib/chart/helper/multipleGraphEdgeHelper.js","../lib/chart/graph/simpleLayoutHelper.js","../lib/chart/graph/simpleLayout.js","../lib/chart/graph/graphHelper.js","../lib/chart/graph/circularLayoutHelper.js","../lib/chart/graph/circularLayout.js","../lib/chart/graph/forceHelper.js","../lib/chart/graph/forceLayout.js","../lib/chart/graph/createView.js","../lib/chart/helper/LinePath.js","../lib/chart/helper/Line.js","../lib/chart/helper/LineDraw.js","../lib/chart/graph/adjustEdge.js","../lib/chart/graph/GraphView.js","../lib/data/Graph.js","../lib/chart/helper/createGraphFromNodeEdge.js","../lib/chart/graph/GraphSeries.js","../lib/chart/graph/install.js","../lib/chart/gauge/PointerPath.js","../lib/chart/gauge/GaugeView.js","../lib/chart/gauge/GaugeSeries.js","../lib/chart/gauge/install.js","../lib/chart/funnel/FunnelView.js","../lib/chart/funnel/FunnelSeries.js","../lib/chart/funnel/funnelLayout.js","../lib/chart/funnel/install.js","../lib/chart/parallel/ParallelView.js","../lib/chart/parallel/ParallelSeries.js","../lib/chart/parallel/parallelVisual.js","../lib/coord/parallel/parallelPreprocessor.js","../lib/component/parallel/ParallelView.js","../lib/coord/parallel/ParallelModel.js","../lib/coord/parallel/ParallelAxis.js","../lib/component/helper/sliderMove.js","../lib/coord/parallel/Parallel.js","../lib/coord/parallel/parallelCreator.js","../lib/coord/parallel/AxisModel.js","../lib/component/helper/BrushController.js","../lib/component/helper/brushHelper.js","../lib/component/axis/ParallelAxisView.js","../lib/component/axis/parallelAxisAction.js","../lib/component/parallel/install.js","../lib/chart/parallel/install.js","../lib/chart/sankey/SankeyView.js","../lib/chart/sankey/SankeySeries.js","../lib/chart/sankey/sankeyLayout.js","../lib/chart/sankey/sankeyVisual.js","../lib/chart/sankey/install.js","../lib/chart/helper/whiskerBoxCommon.js","../lib/chart/boxplot/BoxplotSeries.js","../lib/chart/boxplot/BoxplotView.js","../lib/chart/boxplot/boxplotLayout.js","../lib/chart/boxplot/prepareBoxplotData.js","../lib/chart/boxplot/boxplotTransform.js","../lib/chart/boxplot/install.js","../lib/chart/candlestick/CandlestickView.js","../lib/chart/candlestick/CandlestickSeries.js","../lib/chart/candlestick/preprocessor.js","../lib/chart/candlestick/candlestickVisual.js","../lib/chart/candlestick/candlestickLayout.js","../lib/chart/candlestick/install.js","../lib/chart/helper/EffectSymbol.js","../lib/chart/effectScatter/EffectScatterView.js","../lib/chart/effectScatter/EffectScatterSeries.js","../lib/chart/effectScatter/install.js","../lib/chart/helper/EffectLine.js","../lib/chart/helper/Polyline.js","../lib/chart/helper/EffectPolyline.js","../lib/chart/helper/LargeLineDraw.js","../lib/chart/lines/linesLayout.js","../lib/chart/lines/LinesView.js","../lib/chart/lines/LinesSeries.js","../lib/chart/lines/linesVisual.js","../lib/chart/lines/install.js","../lib/chart/heatmap/HeatmapLayer.js","../lib/chart/heatmap/HeatmapView.js","../lib/chart/heatmap/HeatmapSeries.js","../lib/chart/heatmap/install.js","../lib/chart/bar/PictorialBarView.js","../lib/chart/bar/PictorialBarSeries.js","../lib/chart/bar/installPictorialBar.js","../lib/chart/themeRiver/ThemeRiverView.js","../lib/chart/themeRiver/ThemeRiverSeries.js","../lib/chart/themeRiver/themeRiverLayout.js","../lib/chart/themeRiver/install.js","../lib/chart/sunburst/SunburstPiece.js","../lib/chart/sunburst/sunburstAction.js","../lib/chart/sunburst/SunburstView.js","../lib/chart/sunburst/SunburstSeries.js","../lib/chart/sunburst/sunburstLayout.js","../lib/chart/sunburst/sunburstVisual.js","../lib/chart/sunburst/install.js","../lib/chart/custom/CustomSeries.js","../lib/coord/cartesian/prepareCustom.js","../lib/coord/geo/prepareCustom.js","../lib/coord/single/prepareCustom.js","../lib/coord/polar/prepareCustom.js","../lib/coord/calendar/prepareCustom.js","../lib/util/styleCompat.js","../lib/animation/customGraphicTransition.js","../lib/animation/customGraphicKeyframeAnimation.js","../lib/chart/custom/CustomView.js","../lib/chart/custom/install.js","../lib/component/axisPointer/BaseAxisPointer.js","../lib/component/axisPointer/viewHelper.js","../lib/component/axisPointer/CartesianAxisPointer.js","../lib/component/axisPointer/AxisPointerModel.js","../lib/component/axisPointer/globalListener.js","../lib/component/axisPointer/AxisPointerView.js","../lib/component/axisPointer/findPointFromSeries.js","../lib/component/axisPointer/axisTrigger.js","../lib/component/axisPointer/install.js","../lib/component/grid/install.js","../lib/component/axisPointer/PolarAxisPointer.js","../lib/coord/polar/PolarModel.js","../lib/coord/polar/AxisModel.js","../lib/coord/polar/RadiusAxis.js","../lib/coord/polar/AngleAxis.js","../lib/coord/polar/Polar.js","../lib/coord/polar/polarCreator.js","../lib/component/axis/AngleAxisView.js","../lib/component/axis/RadiusAxisView.js","../lib/layout/barPolar.js","../lib/component/polar/install.js","../lib/coord/single/singleAxisHelper.js","../lib/component/axis/SingleAxisView.js","../lib/coord/single/AxisModel.js","../lib/coord/single/SingleAxis.js","../lib/coord/single/Single.js","../lib/coord/single/singleCreator.js","../lib/component/axisPointer/SingleAxisPointer.js","../lib/component/singleAxis/install.js","../lib/coord/calendar/CalendarModel.js","../lib/component/calendar/CalendarView.js","../lib/coord/calendar/Calendar.js","../lib/component/calendar/install.js","../lib/component/graphic/GraphicModel.js","../lib/component/graphic/GraphicView.js","../lib/component/graphic/install.js","../lib/component/dataZoom/helper.js","../lib/component/dataZoom/DataZoomModel.js","../lib/component/dataZoom/SelectZoomModel.js","../lib/component/dataZoom/DataZoomView.js","../lib/component/dataZoom/SelectZoomView.js","../lib/component/dataZoom/AxisProxy.js","../lib/component/dataZoom/dataZoomProcessor.js","../lib/component/dataZoom/dataZoomAction.js","../lib/component/dataZoom/installCommon.js","../lib/component/dataZoom/installDataZoomSelect.js","../lib/component/toolbox/featureManager.js","../lib/component/toolbox/ToolboxModel.js","../lib/component/helper/listComponent.js","../lib/component/toolbox/ToolboxView.js","../lib/component/toolbox/feature/SaveAsImage.js","../lib/component/toolbox/feature/MagicType.js","../lib/component/toolbox/feature/DataView.js","../lib/component/dataZoom/history.js","../lib/component/toolbox/feature/Restore.js","../lib/component/helper/BrushTargetManager.js","../lib/component/toolbox/feature/DataZoom.js","../lib/component/toolbox/install.js","../lib/component/tooltip/TooltipModel.js","../lib/component/tooltip/helper.js","../lib/component/tooltip/TooltipHTMLContent.js","../lib/component/tooltip/TooltipRichContent.js","../lib/component/tooltip/TooltipView.js","../lib/component/tooltip/install.js","../lib/component/brush/preprocessor.js","../lib/visual/visualSolution.js","../lib/component/brush/selector.js","../lib/component/brush/visualEncoding.js","../lib/component/brush/BrushView.js","../lib/component/brush/BrushModel.js","../lib/component/toolbox/feature/Brush.js","../lib/component/brush/install.js","../lib/component/title/install.js","../lib/component/timeline/TimelineModel.js","../lib/component/timeline/SliderTimelineModel.js","../lib/component/timeline/TimelineView.js","../lib/component/timeline/TimelineAxis.js","../lib/component/timeline/SliderTimelineView.js","../lib/component/timeline/timelineAction.js","../lib/component/timeline/preprocessor.js","../lib/component/timeline/install.js","../lib/component/marker/checkMarkerInSeries.js","../lib/component/marker/MarkerModel.js","../lib/component/marker/MarkPointModel.js","../lib/component/marker/markerHelper.js","../lib/component/marker/MarkerView.js","../lib/component/marker/MarkPointView.js","../lib/component/marker/installMarkPoint.js","../lib/component/marker/MarkLineModel.js","../lib/component/marker/MarkLineView.js","../lib/component/marker/installMarkLine.js","../lib/component/marker/MarkAreaModel.js","../lib/component/marker/MarkAreaView.js","../lib/component/marker/installMarkArea.js","../lib/component/legend/LegendModel.js","../lib/component/legend/LegendView.js","../lib/component/legend/legendFilter.js","../lib/component/legend/legendAction.js","../lib/component/legend/installLegendPlain.js","../lib/component/legend/ScrollableLegendModel.js","../lib/component/legend/ScrollableLegendView.js","../lib/component/legend/scrollableLegendAction.js","../lib/component/legend/installLegendScroll.js","../lib/component/legend/install.js","../lib/component/dataZoom/InsideZoomModel.js","../lib/component/dataZoom/roams.js","../lib/component/dataZoom/InsideZoomView.js","../lib/component/dataZoom/installDataZoomInside.js","../lib/component/dataZoom/SliderZoomModel.js","../lib/component/dataZoom/SliderZoomView.js","../lib/component/dataZoom/installDataZoomSlider.js","../lib/component/dataZoom/install.js","../lib/visual/visualDefault.js","../lib/component/visualMap/VisualMapModel.js","../lib/component/visualMap/ContinuousModel.js","../lib/component/visualMap/VisualMapView.js","../lib/component/visualMap/helper.js","../lib/component/visualMap/ContinuousView.js","../lib/component/visualMap/visualMapAction.js","../lib/component/visualMap/visualEncoding.js","../lib/component/visualMap/preprocessor.js","../lib/component/visualMap/installCommon.js","../lib/component/visualMap/installVisualMapContinuous.js","../lib/component/visualMap/PiecewiseModel.js","../lib/component/visualMap/PiecewiseView.js","../lib/component/visualMap/installVisualMapPiecewise.js","../lib/component/visualMap/install.js","../lib/visual/aria.js","../lib/component/aria/preprocessor.js","../lib/component/aria/install.js","../lib/util/conditionalExpression.js","../lib/component/transform/filterTransform.js","../lib/component/transform/sortTransform.js","../lib/component/transform/install.js","../lib/component/dataset/install.js","../node_modules/zrender/lib/tool/convertPath.js","../node_modules/zrender/lib/tool/dividePath.js","../node_modules/zrender/lib/tool/morphPath.js","../lib/animation/morphTransitionHelper.js","../lib/animation/universalTransition.js","../index.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","var Browser = (function () {\n function Browser() {\n this.firefox = false;\n this.ie = false;\n this.edge = false;\n this.newEdge = false;\n this.weChat = false;\n }\n return Browser;\n}());\nvar Env = (function () {\n function Env() {\n this.browser = new Browser();\n this.node = false;\n this.wxa = false;\n this.worker = false;\n this.svgSupported = false;\n this.touchEventsSupported = false;\n this.pointerEventsSupported = false;\n this.domSupported = false;\n this.transformSupported = false;\n this.transform3dSupported = false;\n this.hasGlobalWindow = typeof window !== 'undefined';\n }\n return Env;\n}());\nvar env = new Env();\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n env.wxa = true;\n env.touchEventsSupported = true;\n}\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\n env.worker = true;\n}\nelse if (typeof navigator === 'undefined'\n || navigator.userAgent.indexOf('Node.js') === 0) {\n env.node = true;\n env.svgSupported = true;\n}\nelse {\n detect(navigator.userAgent, env);\n}\nfunction detect(ua, env) {\n var browser = env.browser;\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge?\\/([\\d.]+)/);\n var weChat = (/micromessenger/i).test(ua);\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n browser.newEdge = +edge[1].split('.')[0] > 18;\n }\n if (weChat) {\n browser.weChat = true;\n }\n env.svgSupported = typeof SVGRect !== 'undefined';\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\n env.pointerEventsSupported = 'onpointerdown' in window\n && (browser.edge || (browser.ie && +browser.version >= 11));\n env.domSupported = typeof document !== 'undefined';\n var style = document.documentElement.style;\n env.transform3dSupported = ((browser.ie && 'transition' in style)\n || browser.edge\n || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix()))\n || 'MozPerspective' in style)\n && !('OTransition' in style);\n env.transformSupported = env.transform3dSupported\n || (browser.ie && +browser.version >= 9);\n}\nexport default env;\n","export var DEFAULT_FONT_SIZE = 12;\nexport var DEFAULT_FONT_FAMILY = 'sans-serif';\nexport var DEFAULT_FONT = DEFAULT_FONT_SIZE + \"px \" + DEFAULT_FONT_FAMILY;\nvar OFFSET = 20;\nvar SCALE = 100;\nvar defaultWidthMapStr = \"007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\\\\\WQb\\\\0FWLg\\\\bWb\\\\WQ\\\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\\\FFF5.5N\";\nfunction getTextWidthMap(mapStr) {\n var map = {};\n if (typeof JSON === 'undefined') {\n return map;\n }\n for (var i = 0; i < mapStr.length; i++) {\n var char = String.fromCharCode(i + 32);\n var size = (mapStr.charCodeAt(i) - OFFSET) / SCALE;\n map[char] = size;\n }\n return map;\n}\nexport var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr);\nexport var platformApi = {\n createCanvas: function () {\n return typeof document !== 'undefined'\n && document.createElement('canvas');\n },\n measureText: (function () {\n var _ctx;\n var _cachedFont;\n return function (text, font) {\n if (!_ctx) {\n var canvas = platformApi.createCanvas();\n _ctx = canvas && canvas.getContext('2d');\n }\n if (_ctx) {\n if (_cachedFont !== font) {\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\n }\n return _ctx.measureText(text);\n }\n else {\n text = text || '';\n font = font || DEFAULT_FONT;\n var res = /((?:\\d+)?\\.?\\d*)px/.exec(font);\n var fontSize = res && +res[1] || DEFAULT_FONT_SIZE;\n var width = 0;\n if (font.indexOf('mono') >= 0) {\n width = fontSize * text.length;\n }\n else {\n for (var i = 0; i < text.length; i++) {\n var preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]];\n width += preCalcWidth == null ? fontSize : (preCalcWidth * fontSize);\n }\n }\n return { width: width };\n }\n };\n })(),\n loadImage: function (src, onload, onerror) {\n var image = new Image();\n image.onload = onload;\n image.onerror = onerror;\n image.src = src;\n return image;\n }\n};\nexport function setPlatformAPI(newPlatformApis) {\n for (var key in platformApi) {\n if (newPlatformApis[key]) {\n platformApi[key] = newPlatformApis[key];\n }\n }\n}\n","import { platformApi } from './platform.js';\nvar BUILTIN_OBJECT = reduce([\n 'Function',\n 'RegExp',\n 'Date',\n 'Error',\n 'CanvasGradient',\n 'CanvasPattern',\n 'Image',\n 'Canvas'\n], function (obj, val) {\n obj['[object ' + val + ']'] = true;\n return obj;\n}, {});\nvar TYPED_ARRAY = reduce([\n 'Int8',\n 'Uint8',\n 'Uint8Clamped',\n 'Int16',\n 'Uint16',\n 'Int32',\n 'Uint32',\n 'Float32',\n 'Float64'\n], function (obj, val) {\n obj['[object ' + val + 'Array]'] = true;\n return obj;\n}, {});\nvar objToString = Object.prototype.toString;\nvar arrayProto = Array.prototype;\nvar nativeForEach = arrayProto.forEach;\nvar nativeFilter = arrayProto.filter;\nvar nativeSlice = arrayProto.slice;\nvar nativeMap = arrayProto.map;\nvar ctorFunction = function () { }.constructor;\nvar protoFunction = ctorFunction ? ctorFunction.prototype : null;\nvar protoKey = '__proto__';\nvar idStart = 0x0907;\nexport function guid() {\n return idStart++;\n}\nexport function logError() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (typeof console !== 'undefined') {\n console.error.apply(console, args);\n }\n}\nexport function clone(source) {\n if (source == null || typeof source !== 'object') {\n return source;\n }\n var result = source;\n var typeStr = objToString.call(source);\n if (typeStr === '[object Array]') {\n if (!isPrimitive(source)) {\n result = [];\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n }\n else if (TYPED_ARRAY[typeStr]) {\n if (!isPrimitive(source)) {\n var Ctor = source.constructor;\n if (Ctor.from) {\n result = Ctor.from(source);\n }\n else {\n result = new Ctor(source.length);\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = source[i];\n }\n }\n }\n }\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n result = {};\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n result[key] = clone(source[key]);\n }\n }\n }\n return result;\n}\nexport function merge(target, source, overwrite) {\n if (!isObject(source) || !isObject(target)) {\n return overwrite ? clone(source) : target;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n var targetProp = target[key];\n var sourceProp = source[key];\n if (isObject(sourceProp)\n && isObject(targetProp)\n && !isArray(sourceProp)\n && !isArray(targetProp)\n && !isDom(sourceProp)\n && !isDom(targetProp)\n && !isBuiltInObject(sourceProp)\n && !isBuiltInObject(targetProp)\n && !isPrimitive(sourceProp)\n && !isPrimitive(targetProp)) {\n merge(targetProp, sourceProp, overwrite);\n }\n else if (overwrite || !(key in target)) {\n target[key] = clone(source[key]);\n }\n }\n }\n return target;\n}\nexport function mergeAll(targetAndSources, overwrite) {\n var result = targetAndSources[0];\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\n result = merge(result, targetAndSources[i], overwrite);\n }\n return result;\n}\nexport function extend(target, source) {\n if (Object.assign) {\n Object.assign(target, source);\n }\n else {\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\nexport function defaults(target, source, overlay) {\n var keysArr = keys(source);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if ((overlay ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n return target;\n}\nexport var createCanvas = platformApi.createCanvas;\nexport function indexOf(array, value) {\n if (array) {\n if (array.indexOf) {\n return array.indexOf(value);\n }\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n }\n return -1;\n}\nexport function inherits(clazz, baseClazz) {\n var clazzPrototype = clazz.prototype;\n function F() { }\n F.prototype = baseClazz.prototype;\n clazz.prototype = new F();\n for (var prop in clazzPrototype) {\n if (clazzPrototype.hasOwnProperty(prop)) {\n clazz.prototype[prop] = clazzPrototype[prop];\n }\n }\n clazz.prototype.constructor = clazz;\n clazz.superClass = baseClazz;\n}\nexport function mixin(target, source, override) {\n target = 'prototype' in target ? target.prototype : target;\n source = 'prototype' in source ? source.prototype : source;\n if (Object.getOwnPropertyNames) {\n var keyList = Object.getOwnPropertyNames(source);\n for (var i = 0; i < keyList.length; i++) {\n var key = keyList[i];\n if (key !== 'constructor') {\n if ((override ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n }\n }\n else {\n defaults(target, source, override);\n }\n}\nexport function isArrayLike(data) {\n if (!data) {\n return false;\n }\n if (typeof data === 'string') {\n return false;\n }\n return typeof data.length === 'number';\n}\nexport function each(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n if (arr.forEach && arr.forEach === nativeForEach) {\n arr.forEach(cb, context);\n }\n else if (arr.length === +arr.length) {\n for (var i = 0, len = arr.length; i < len; i++) {\n cb.call(context, arr[i], i, arr);\n }\n }\n else {\n for (var key in arr) {\n if (arr.hasOwnProperty(key)) {\n cb.call(context, arr[key], key, arr);\n }\n }\n }\n}\nexport function map(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.map && arr.map === nativeMap) {\n return arr.map(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n result.push(cb.call(context, arr[i], i, arr));\n }\n return result;\n }\n}\nexport function reduce(arr, cb, memo, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n memo = cb.call(context, memo, arr[i], i, arr);\n }\n return memo;\n}\nexport function filter(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.filter && arr.filter === nativeFilter) {\n return arr.filter(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n result.push(arr[i]);\n }\n }\n return result;\n }\n}\nexport function find(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n return arr[i];\n }\n }\n}\nexport function keys(obj) {\n if (!obj) {\n return [];\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keyList = [];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n keyList.push(key);\n }\n }\n return keyList;\n}\nfunction bindPolyfill(func, context) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return function () {\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport var bind = (protoFunction && isFunction(protoFunction.bind))\n ? protoFunction.call.bind(protoFunction.bind)\n : bindPolyfill;\nfunction curry(func) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return function () {\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport { curry };\nexport function isArray(value) {\n if (Array.isArray) {\n return Array.isArray(value);\n }\n return objToString.call(value) === '[object Array]';\n}\nexport function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isString(value) {\n return typeof value === 'string';\n}\nexport function isStringSafe(value) {\n return objToString.call(value) === '[object String]';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function isObject(value) {\n var type = typeof value;\n return type === 'function' || (!!value && type === 'object');\n}\nexport function isBuiltInObject(value) {\n return !!BUILTIN_OBJECT[objToString.call(value)];\n}\nexport function isTypedArray(value) {\n return !!TYPED_ARRAY[objToString.call(value)];\n}\nexport function isDom(value) {\n return typeof value === 'object'\n && typeof value.nodeType === 'number'\n && typeof value.ownerDocument === 'object';\n}\nexport function isGradientObject(value) {\n return value.colorStops != null;\n}\nexport function isImagePatternObject(value) {\n return value.image != null;\n}\nexport function isRegExp(value) {\n return objToString.call(value) === '[object RegExp]';\n}\nexport function eqNaN(value) {\n return value !== value;\n}\nexport function retrieve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0, len = args.length; i < len; i++) {\n if (args[i] != null) {\n return args[i];\n }\n }\n}\nexport function retrieve2(value0, value1) {\n return value0 != null\n ? value0\n : value1;\n}\nexport function retrieve3(value0, value1, value2) {\n return value0 != null\n ? value0\n : value1 != null\n ? value1\n : value2;\n}\nexport function slice(arr) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return nativeSlice.apply(arr, args);\n}\nexport function normalizeCssArray(val) {\n if (typeof (val) === 'number') {\n return [val, val, val, val];\n }\n var len = val.length;\n if (len === 2) {\n return [val[0], val[1], val[0], val[1]];\n }\n else if (len === 3) {\n return [val[0], val[1], val[2], val[1]];\n }\n return val;\n}\nexport function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\nexport function trim(str) {\n if (str == null) {\n return null;\n }\n else if (typeof str.trim === 'function') {\n return str.trim();\n }\n else {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n}\nvar primitiveKey = '__ec_primitive__';\nexport function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}\nexport function isPrimitive(obj) {\n return obj[primitiveKey];\n}\nvar MapPolyfill = (function () {\n function MapPolyfill() {\n this.data = {};\n }\n MapPolyfill.prototype[\"delete\"] = function (key) {\n var existed = this.has(key);\n if (existed) {\n delete this.data[key];\n }\n return existed;\n };\n MapPolyfill.prototype.has = function (key) {\n return this.data.hasOwnProperty(key);\n };\n MapPolyfill.prototype.get = function (key) {\n return this.data[key];\n };\n MapPolyfill.prototype.set = function (key, value) {\n this.data[key] = value;\n return this;\n };\n MapPolyfill.prototype.keys = function () {\n return keys(this.data);\n };\n MapPolyfill.prototype.forEach = function (callback) {\n var data = this.data;\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n callback(data[key], key);\n }\n }\n };\n return MapPolyfill;\n}());\nvar isNativeMapSupported = typeof Map === 'function';\nfunction maybeNativeMap() {\n return (isNativeMapSupported ? new Map() : new MapPolyfill());\n}\nvar HashMap = (function () {\n function HashMap(obj) {\n var isArr = isArray(obj);\n this.data = maybeNativeMap();\n var thisMap = this;\n (obj instanceof HashMap)\n ? obj.each(visit)\n : (obj && each(obj, visit));\n function visit(value, key) {\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n }\n }\n HashMap.prototype.hasKey = function (key) {\n return this.data.has(key);\n };\n HashMap.prototype.get = function (key) {\n return this.data.get(key);\n };\n HashMap.prototype.set = function (key, value) {\n this.data.set(key, value);\n return value;\n };\n HashMap.prototype.each = function (cb, context) {\n this.data.forEach(function (value, key) {\n cb.call(context, value, key);\n });\n };\n HashMap.prototype.keys = function () {\n var keys = this.data.keys();\n return isNativeMapSupported\n ? Array.from(keys)\n : keys;\n };\n HashMap.prototype.removeKey = function (key) {\n this.data[\"delete\"](key);\n };\n return HashMap;\n}());\nexport { HashMap };\nexport function createHashMap(obj) {\n return new HashMap(obj);\n}\nexport function concatArray(a, b) {\n var newArray = new a.constructor(a.length + b.length);\n for (var i = 0; i < a.length; i++) {\n newArray[i] = a[i];\n }\n var offset = a.length;\n for (var i = 0; i < b.length; i++) {\n newArray[i + offset] = b[i];\n }\n return newArray;\n}\nexport function createObject(proto, properties) {\n var obj;\n if (Object.create) {\n obj = Object.create(proto);\n }\n else {\n var StyleCtor = function () { };\n StyleCtor.prototype = proto;\n obj = new StyleCtor();\n }\n if (properties) {\n extend(obj, properties);\n }\n return obj;\n}\nexport function disableUserSelect(dom) {\n var domStyle = dom.style;\n domStyle.webkitUserSelect = 'none';\n domStyle.userSelect = 'none';\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\n domStyle['-webkit-touch-callout'] = 'none';\n}\nexport function hasOwn(own, prop) {\n return own.hasOwnProperty(prop);\n}\nexport function noop() { }\nexport var RADIAN_TO_DEGREE = 180 / Math.PI;\n","export function create(x, y) {\n if (x == null) {\n x = 0;\n }\n if (y == null) {\n y = 0;\n }\n return [x, y];\n}\nexport function copy(out, v) {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\nexport function clone(v) {\n return [v[0], v[1]];\n}\nexport function set(out, a, b) {\n out[0] = a;\n out[1] = b;\n return out;\n}\nexport function add(out, v1, v2) {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\nexport function scaleAndAdd(out, v1, v2, a) {\n out[0] = v1[0] + v2[0] * a;\n out[1] = v1[1] + v2[1] * a;\n return out;\n}\nexport function sub(out, v1, v2) {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\nexport function len(v) {\n return Math.sqrt(lenSquare(v));\n}\nexport var length = len;\nexport function lenSquare(v) {\n return v[0] * v[0] + v[1] * v[1];\n}\nexport var lengthSquare = lenSquare;\nexport function mul(out, v1, v2) {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\nexport function div(out, v1, v2) {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\nexport function dot(v1, v2) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\nexport function scale(out, v, s) {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\nexport function normalize(out, v) {\n var d = len(v);\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n }\n else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n return out;\n}\nexport function distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\nexport var dist = distance;\nexport function distanceSquare(v1, v2) {\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\nexport var distSquare = distanceSquare;\nexport function negate(out, v) {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\nexport function lerp(out, v1, v2, t) {\n out[0] = v1[0] + t * (v2[0] - v1[0]);\n out[1] = v1[1] + t * (v2[1] - v1[1]);\n return out;\n}\nexport function applyTransform(out, v, m) {\n var x = v[0];\n var y = v[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\nexport function min(out, v1, v2) {\n out[0] = Math.min(v1[0], v2[0]);\n out[1] = Math.min(v1[1], v2[1]);\n return out;\n}\nexport function max(out, v1, v2) {\n out[0] = Math.max(v1[0], v2[0]);\n out[1] = Math.max(v1[1], v2[1]);\n return out;\n}\n","var Param = (function () {\n function Param(target, e) {\n this.target = target;\n this.topTarget = e && e.topTarget;\n }\n return Param;\n}());\nvar Draggable = (function () {\n function Draggable(handler) {\n this.handler = handler;\n handler.on('mousedown', this._dragStart, this);\n handler.on('mousemove', this._drag, this);\n handler.on('mouseup', this._dragEnd, this);\n }\n Draggable.prototype._dragStart = function (e) {\n var draggingTarget = e.target;\n while (draggingTarget && !draggingTarget.draggable) {\n draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget;\n }\n if (draggingTarget) {\n this._draggingTarget = draggingTarget;\n draggingTarget.dragging = true;\n this._x = e.offsetX;\n this._y = e.offsetY;\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\n }\n };\n Draggable.prototype._drag = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n var x = e.offsetX;\n var y = e.offsetY;\n var dx = x - this._x;\n var dy = y - this._y;\n this._x = x;\n this._y = y;\n draggingTarget.drift(dx, dy, e);\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\n var lastDropTarget = this._dropTarget;\n this._dropTarget = dropTarget;\n if (draggingTarget !== dropTarget) {\n if (lastDropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\n }\n if (dropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\n }\n }\n }\n };\n Draggable.prototype._dragEnd = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n draggingTarget.dragging = false;\n }\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\n if (this._dropTarget) {\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\n }\n this._draggingTarget = null;\n this._dropTarget = null;\n };\n return Draggable;\n}());\nexport default Draggable;\n","var Eventful = (function () {\n function Eventful(eventProcessors) {\n if (eventProcessors) {\n this._$eventProcessor = eventProcessors;\n }\n }\n Eventful.prototype.on = function (event, query, handler, context) {\n if (!this._$handlers) {\n this._$handlers = {};\n }\n var _h = this._$handlers;\n if (typeof query === 'function') {\n context = handler;\n handler = query;\n query = null;\n }\n if (!handler || !event) {\n return this;\n }\n var eventProcessor = this._$eventProcessor;\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n if (!_h[event]) {\n _h[event] = [];\n }\n for (var i = 0; i < _h[event].length; i++) {\n if (_h[event][i].h === handler) {\n return this;\n }\n }\n var wrap = {\n h: handler,\n query: query,\n ctx: (context || this),\n callAtLast: handler.zrEventfulCallAtLast\n };\n var lastIndex = _h[event].length - 1;\n var lastWrap = _h[event][lastIndex];\n (lastWrap && lastWrap.callAtLast)\n ? _h[event].splice(lastIndex, 0, wrap)\n : _h[event].push(wrap);\n return this;\n };\n Eventful.prototype.isSilent = function (eventName) {\n var _h = this._$handlers;\n return !_h || !_h[eventName] || !_h[eventName].length;\n };\n Eventful.prototype.off = function (eventType, handler) {\n var _h = this._$handlers;\n if (!_h) {\n return this;\n }\n if (!eventType) {\n this._$handlers = {};\n return this;\n }\n if (handler) {\n if (_h[eventType]) {\n var newList = [];\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\n if (_h[eventType][i].h !== handler) {\n newList.push(_h[eventType][i]);\n }\n }\n _h[eventType] = newList;\n }\n if (_h[eventType] && _h[eventType].length === 0) {\n delete _h[eventType];\n }\n }\n else {\n delete _h[eventType];\n }\n return this;\n };\n Eventful.prototype.trigger = function (eventType) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[eventType];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var argLen = args.length;\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(eventType, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(hItem.ctx);\n break;\n case 1:\n hItem.h.call(hItem.ctx, args[0]);\n break;\n case 2:\n hItem.h.call(hItem.ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(eventType);\n return this;\n };\n Eventful.prototype.triggerWithContext = function (type) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var argLen = args.length;\n var ctx = args[argLen - 1];\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(type, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(ctx);\n break;\n case 1:\n hItem.h.call(ctx, args[0]);\n break;\n case 2:\n hItem.h.call(ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(type);\n return this;\n };\n return Eventful;\n}());\nexport default Eventful;\n","var LN2 = Math.log(2);\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\n var cacheKey = rowMask + '-' + colMask;\n var fullRank = rows.length;\n if (detCache.hasOwnProperty(cacheKey)) {\n return detCache[cacheKey];\n }\n if (rank === 1) {\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\n return rows[rowStart][colStart];\n }\n var subRowMask = rowMask | (1 << rowStart);\n var subRowStart = rowStart + 1;\n while (rowMask & (1 << subRowStart)) {\n subRowStart++;\n }\n var sum = 0;\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\n var colTag = 1 << j;\n if (!(colTag & colMask)) {\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\n colLocalIdx++;\n }\n }\n detCache[cacheKey] = sum;\n return sum;\n}\nexport function buildTransformer(src, dest) {\n var mA = [\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\n ];\n var detCache = {};\n var det = determinant(mA, 8, 0, 0, 0, detCache);\n if (det === 0) {\n return;\n }\n var vh = [];\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 8; j++) {\n vh[j] == null && (vh[j] = 0);\n vh[j] += ((i + j) % 2 ? -1 : 1)\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\n / det * dest[i];\n }\n }\n return function (out, srcPointX, srcPointY) {\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\n };\n}\n","import env from './env.js';\nimport { buildTransformer } from './fourPointsTransform.js';\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\nvar _calcOut = [];\nexport function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\n}\nexport function transformCoordWithViewport(out, el, inX, inY, inverse) {\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\n var markers = prepareCoordMarkers(el, saved);\n var transformer = preparePointerTransformer(markers, saved, inverse);\n if (transformer) {\n transformer(out, inX, inY);\n return true;\n }\n }\n return false;\n}\nfunction prepareCoordMarkers(el, saved) {\n var markers = saved.markers;\n if (markers) {\n return markers;\n }\n markers = saved.markers = [];\n var propLR = ['left', 'right'];\n var propTB = ['top', 'bottom'];\n for (var i = 0; i < 4; i++) {\n var marker = document.createElement('div');\n var stl = marker.style;\n var idxLR = i % 2;\n var idxTB = (i >> 1) % 2;\n stl.cssText = [\n 'position: absolute',\n 'visibility: hidden',\n 'padding: 0',\n 'margin: 0',\n 'border-width: 0',\n 'user-select: none',\n 'width:0',\n 'height:0',\n propLR[idxLR] + ':0',\n propTB[idxTB] + ':0',\n propLR[1 - idxLR] + ':auto',\n propTB[1 - idxTB] + ':auto',\n ''\n ].join('!important;');\n el.appendChild(marker);\n markers.push(marker);\n }\n return markers;\n}\nfunction preparePointerTransformer(markers, saved, inverse) {\n var transformerName = inverse ? 'invTrans' : 'trans';\n var transformer = saved[transformerName];\n var oldSrcCoords = saved.srcCoords;\n var srcCoords = [];\n var destCoords = [];\n var oldCoordTheSame = true;\n for (var i = 0; i < 4; i++) {\n var rect = markers[i].getBoundingClientRect();\n var ii = 2 * i;\n var x = rect.left;\n var y = rect.top;\n srcCoords.push(x, y);\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\n }\n return (oldCoordTheSame && transformer)\n ? transformer\n : (saved.srcCoords = srcCoords,\n saved[transformerName] = inverse\n ? buildTransformer(destCoords, srcCoords)\n : buildTransformer(srcCoords, destCoords));\n}\nexport function isCanvasEl(el) {\n return el.nodeName.toUpperCase() === 'CANVAS';\n}\nvar replaceReg = /([&<>\"'])/g;\nvar replaceMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\nexport function encodeHTML(source) {\n return source == null\n ? ''\n : (source + '').replace(replaceReg, function (str, c) {\n return replaceMap[c];\n });\n}\n","import Eventful from './Eventful.js';\nimport env from './env.js';\nimport { isCanvasEl, transformCoordWithViewport } from './dom.js';\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\nvar _calcOut = [];\nvar firefoxNotSupportOffsetXY = env.browser.firefox\n && +env.browser.version.split('.')[0] < 39;\nexport function clientToLocal(el, e, out, calculate) {\n out = out || {};\n if (calculate) {\n calculateZrXY(el, e, out);\n }\n else if (firefoxNotSupportOffsetXY\n && e.layerX != null\n && e.layerX !== e.offsetX) {\n out.zrX = e.layerX;\n out.zrY = e.layerY;\n }\n else if (e.offsetX != null) {\n out.zrX = e.offsetX;\n out.zrY = e.offsetY;\n }\n else {\n calculateZrXY(el, e, out);\n }\n return out;\n}\nfunction calculateZrXY(el, e, out) {\n if (env.domSupported && el.getBoundingClientRect) {\n var ex = e.clientX;\n var ey = e.clientY;\n if (isCanvasEl(el)) {\n var box = el.getBoundingClientRect();\n out.zrX = ex - box.left;\n out.zrY = ey - box.top;\n return;\n }\n else {\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\n out.zrX = _calcOut[0];\n out.zrY = _calcOut[1];\n return;\n }\n }\n }\n out.zrX = out.zrY = 0;\n}\nexport function getNativeEvent(e) {\n return e\n || window.event;\n}\nexport function normalizeEvent(el, e, calculate) {\n e = getNativeEvent(e);\n if (e.zrX != null) {\n return e;\n }\n var eventType = e.type;\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\n if (!isTouch) {\n clientToLocal(el, e, e, calculate);\n var wheelDelta = getWheelDeltaMayPolyfill(e);\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\n }\n else {\n var touch = eventType !== 'touchend'\n ? e.targetTouches[0]\n : e.changedTouches[0];\n touch && clientToLocal(el, touch, e, calculate);\n }\n var button = e.button;\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\n }\n return e;\n}\nfunction getWheelDeltaMayPolyfill(e) {\n var rawWheelDelta = e.wheelDelta;\n if (rawWheelDelta) {\n return rawWheelDelta;\n }\n var deltaX = e.deltaX;\n var deltaY = e.deltaY;\n if (deltaX == null || deltaY == null) {\n return rawWheelDelta;\n }\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\n var sign = deltaY > 0 ? -1\n : deltaY < 0 ? 1\n : deltaX > 0 ? -1\n : 1;\n return 3 * delta * sign;\n}\nexport function addEventListener(el, name, handler, opt) {\n el.addEventListener(name, handler, opt);\n}\nexport function removeEventListener(el, name, handler, opt) {\n el.removeEventListener(name, handler, opt);\n}\nexport var stop = function (e) {\n e.preventDefault();\n e.stopPropagation();\n e.cancelBubble = true;\n};\nexport function isMiddleOrRightButtonOnMouseUpDown(e) {\n return e.which === 2 || e.which === 3;\n}\nexport { Eventful as Dispatcher };\n","import * as eventUtil from './event.js';\nvar GestureMgr = (function () {\n function GestureMgr() {\n this._track = [];\n }\n GestureMgr.prototype.recognize = function (event, target, root) {\n this._doTrack(event, target, root);\n return this._recognize(event);\n };\n GestureMgr.prototype.clear = function () {\n this._track.length = 0;\n return this;\n };\n GestureMgr.prototype._doTrack = function (event, target, root) {\n var touches = event.touches;\n if (!touches) {\n return;\n }\n var trackItem = {\n points: [],\n touches: [],\n target: target,\n event: event\n };\n for (var i = 0, len = touches.length; i < len; i++) {\n var touch = touches[i];\n var pos = eventUtil.clientToLocal(root, touch, {});\n trackItem.points.push([pos.zrX, pos.zrY]);\n trackItem.touches.push(touch);\n }\n this._track.push(trackItem);\n };\n GestureMgr.prototype._recognize = function (event) {\n for (var eventName in recognizers) {\n if (recognizers.hasOwnProperty(eventName)) {\n var gestureInfo = recognizers[eventName](this._track, event);\n if (gestureInfo) {\n return gestureInfo;\n }\n }\n }\n };\n return GestureMgr;\n}());\nexport { GestureMgr };\nfunction dist(pointPair) {\n var dx = pointPair[1][0] - pointPair[0][0];\n var dy = pointPair[1][1] - pointPair[0][1];\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction center(pointPair) {\n return [\n (pointPair[0][0] + pointPair[1][0]) / 2,\n (pointPair[0][1] + pointPair[1][1]) / 2\n ];\n}\nvar recognizers = {\n pinch: function (tracks, event) {\n var trackLen = tracks.length;\n if (!trackLen) {\n return;\n }\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\n if (pinchPre\n && pinchPre.length > 1\n && pinchEnd\n && pinchEnd.length > 1) {\n var pinchScale = dist(pinchEnd) / dist(pinchPre);\n !isFinite(pinchScale) && (pinchScale = 1);\n event.pinchScale = pinchScale;\n var pinchCenter = center(pinchEnd);\n event.pinchX = pinchCenter[0];\n event.pinchY = pinchCenter[1];\n return {\n type: 'pinch',\n target: tracks[0].target,\n event: event\n };\n }\n }\n};\n","export function create() {\n return [1, 0, 0, 1, 0, 0];\n}\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\nexport function copy(out, m) {\n out[0] = m[0];\n out[1] = m[1];\n out[2] = m[2];\n out[3] = m[3];\n out[4] = m[4];\n out[5] = m[5];\n return out;\n}\nexport function mul(out, m1, m2) {\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = out3;\n out[4] = out4;\n out[5] = out5;\n return out;\n}\nexport function translate(out, a, v) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4] + v[0];\n out[5] = a[5] + v[1];\n return out;\n}\nexport function rotate(out, a, rad, pivot) {\n if (pivot === void 0) { pivot = [0, 0]; }\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var st = Math.sin(rad);\n var ct = Math.cos(rad);\n out[0] = aa * ct + ab * st;\n out[1] = -aa * st + ab * ct;\n out[2] = ac * ct + ad * st;\n out[3] = -ac * st + ct * ad;\n out[4] = ct * (atx - pivot[0]) + st * (aty - pivot[1]) + pivot[0];\n out[5] = ct * (aty - pivot[1]) - st * (atx - pivot[0]) + pivot[1];\n return out;\n}\nexport function scale(out, a, v) {\n var vx = v[0];\n var vy = v[1];\n out[0] = a[0] * vx;\n out[1] = a[1] * vy;\n out[2] = a[2] * vx;\n out[3] = a[3] * vy;\n out[4] = a[4] * vx;\n out[5] = a[5] * vy;\n return out;\n}\nexport function invert(out, a) {\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\nexport function clone(a) {\n var b = create();\n copy(b, a);\n return b;\n}\n","var Point = (function () {\n function Point(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n Point.prototype.copy = function (other) {\n this.x = other.x;\n this.y = other.y;\n return this;\n };\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n Point.prototype.set = function (x, y) {\n this.x = x;\n this.y = y;\n return this;\n };\n Point.prototype.equal = function (other) {\n return other.x === this.x && other.y === this.y;\n };\n Point.prototype.add = function (other) {\n this.x += other.x;\n this.y += other.y;\n return this;\n };\n Point.prototype.scale = function (scalar) {\n this.x *= scalar;\n this.y *= scalar;\n };\n Point.prototype.scaleAndAdd = function (other, scalar) {\n this.x += other.x * scalar;\n this.y += other.y * scalar;\n };\n Point.prototype.sub = function (other) {\n this.x -= other.x;\n this.y -= other.y;\n return this;\n };\n Point.prototype.dot = function (other) {\n return this.x * other.x + this.y * other.y;\n };\n Point.prototype.len = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n };\n Point.prototype.lenSquare = function () {\n return this.x * this.x + this.y * this.y;\n };\n Point.prototype.normalize = function () {\n var len = this.len();\n this.x /= len;\n this.y /= len;\n return this;\n };\n Point.prototype.distance = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return Math.sqrt(dx * dx + dy * dy);\n };\n Point.prototype.distanceSquare = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return dx * dx + dy * dy;\n };\n Point.prototype.negate = function () {\n this.x = -this.x;\n this.y = -this.y;\n return this;\n };\n Point.prototype.transform = function (m) {\n if (!m) {\n return;\n }\n var x = this.x;\n var y = this.y;\n this.x = m[0] * x + m[2] * y + m[4];\n this.y = m[1] * x + m[3] * y + m[5];\n return this;\n };\n Point.prototype.toArray = function (out) {\n out[0] = this.x;\n out[1] = this.y;\n return out;\n };\n Point.prototype.fromArray = function (input) {\n this.x = input[0];\n this.y = input[1];\n };\n Point.set = function (p, x, y) {\n p.x = x;\n p.y = y;\n };\n Point.copy = function (p, p2) {\n p.x = p2.x;\n p.y = p2.y;\n };\n Point.len = function (p) {\n return Math.sqrt(p.x * p.x + p.y * p.y);\n };\n Point.lenSquare = function (p) {\n return p.x * p.x + p.y * p.y;\n };\n Point.dot = function (p0, p1) {\n return p0.x * p1.x + p0.y * p1.y;\n };\n Point.add = function (out, p0, p1) {\n out.x = p0.x + p1.x;\n out.y = p0.y + p1.y;\n };\n Point.sub = function (out, p0, p1) {\n out.x = p0.x - p1.x;\n out.y = p0.y - p1.y;\n };\n Point.scale = function (out, p0, scalar) {\n out.x = p0.x * scalar;\n out.y = p0.y * scalar;\n };\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\n out.x = p0.x + p1.x * scalar;\n out.y = p0.y + p1.y * scalar;\n };\n Point.lerp = function (out, p0, p1, t) {\n var onet = 1 - t;\n out.x = onet * p0.x + t * p1.x;\n out.y = onet * p0.y + t * p1.y;\n };\n return Point;\n}());\nexport default Point;\n","import * as matrix from './matrix.js';\nimport Point from './Point.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar lt = new Point();\nvar rb = new Point();\nvar lb = new Point();\nvar rt = new Point();\nvar minTv = new Point();\nvar maxTv = new Point();\nvar BoundingRect = (function () {\n function BoundingRect(x, y, width, height) {\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n BoundingRect.prototype.union = function (other) {\n var x = mathMin(other.x, this.x);\n var y = mathMin(other.y, this.y);\n if (isFinite(this.x) && isFinite(this.width)) {\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\n }\n else {\n this.width = other.width;\n }\n if (isFinite(this.y) && isFinite(this.height)) {\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\n }\n else {\n this.height = other.height;\n }\n this.x = x;\n this.y = y;\n };\n BoundingRect.prototype.applyTransform = function (m) {\n BoundingRect.applyTransform(this, this, m);\n };\n BoundingRect.prototype.calculateTransform = function (b) {\n var a = this;\n var sx = b.width / a.width;\n var sy = b.height / a.height;\n var m = matrix.create();\n matrix.translate(m, m, [-a.x, -a.y]);\n matrix.scale(m, m, [sx, sy]);\n matrix.translate(m, m, [b.x, b.y]);\n return m;\n };\n BoundingRect.prototype.intersect = function (b, mtv) {\n if (!b) {\n return false;\n }\n if (!(b instanceof BoundingRect)) {\n b = BoundingRect.create(b);\n }\n var a = this;\n var ax0 = a.x;\n var ax1 = a.x + a.width;\n var ay0 = a.y;\n var ay1 = a.y + a.height;\n var bx0 = b.x;\n var bx1 = b.x + b.width;\n var by0 = b.y;\n var by1 = b.y + b.height;\n var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n if (mtv) {\n var dMin = Infinity;\n var dMax = 0;\n var d0 = Math.abs(ax1 - bx0);\n var d1 = Math.abs(bx1 - ax0);\n var d2 = Math.abs(ay1 - by0);\n var d3 = Math.abs(by1 - ay0);\n var dx = Math.min(d0, d1);\n var dy = Math.min(d2, d3);\n if (ax1 < bx0 || bx1 < ax0) {\n if (dx > dMax) {\n dMax = dx;\n if (d0 < d1) {\n Point.set(maxTv, -d0, 0);\n }\n else {\n Point.set(maxTv, d1, 0);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d0 < d1) {\n Point.set(minTv, d0, 0);\n }\n else {\n Point.set(minTv, -d1, 0);\n }\n }\n }\n if (ay1 < by0 || by1 < ay0) {\n if (dy > dMax) {\n dMax = dy;\n if (d2 < d3) {\n Point.set(maxTv, 0, -d2);\n }\n else {\n Point.set(maxTv, 0, d3);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d2 < d3) {\n Point.set(minTv, 0, d2);\n }\n else {\n Point.set(minTv, 0, -d3);\n }\n }\n }\n }\n if (mtv) {\n Point.copy(mtv, overlap ? minTv : maxTv);\n }\n return overlap;\n };\n BoundingRect.prototype.contain = function (x, y) {\n var rect = this;\n return x >= rect.x\n && x <= (rect.x + rect.width)\n && y >= rect.y\n && y <= (rect.y + rect.height);\n };\n BoundingRect.prototype.clone = function () {\n return new BoundingRect(this.x, this.y, this.width, this.height);\n };\n BoundingRect.prototype.copy = function (other) {\n BoundingRect.copy(this, other);\n };\n BoundingRect.prototype.plain = function () {\n return {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n };\n };\n BoundingRect.prototype.isFinite = function () {\n return isFinite(this.x)\n && isFinite(this.y)\n && isFinite(this.width)\n && isFinite(this.height);\n };\n BoundingRect.prototype.isZero = function () {\n return this.width === 0 || this.height === 0;\n };\n BoundingRect.create = function (rect) {\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n };\n BoundingRect.copy = function (target, source) {\n target.x = source.x;\n target.y = source.y;\n target.width = source.width;\n target.height = source.height;\n };\n BoundingRect.applyTransform = function (target, source, m) {\n if (!m) {\n if (target !== source) {\n BoundingRect.copy(target, source);\n }\n return;\n }\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\n var sx = m[0];\n var sy = m[3];\n var tx = m[4];\n var ty = m[5];\n target.x = source.x * sx + tx;\n target.y = source.y * sy + ty;\n target.width = source.width * sx;\n target.height = source.height * sy;\n if (target.width < 0) {\n target.x += target.width;\n target.width = -target.width;\n }\n if (target.height < 0) {\n target.y += target.height;\n target.height = -target.height;\n }\n return;\n }\n lt.x = lb.x = source.x;\n lt.y = rt.y = source.y;\n rb.x = rt.x = source.x + source.width;\n rb.y = lb.y = source.y + source.height;\n lt.transform(m);\n rt.transform(m);\n rb.transform(m);\n lb.transform(m);\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\n target.width = maxX - target.x;\n target.height = maxY - target.y;\n };\n return BoundingRect;\n}());\nexport default BoundingRect;\n","import { __extends } from \"tslib\";\nimport * as util from './core/util.js';\nimport * as vec2 from './core/vector.js';\nimport Draggable from './mixin/Draggable.js';\nimport Eventful from './core/Eventful.js';\nimport * as eventTool from './core/event.js';\nimport { GestureMgr } from './core/GestureMgr.js';\nimport BoundingRect from './core/BoundingRect.js';\nvar SILENT = 'silent';\nfunction makeEventPacket(eveType, targetInfo, event) {\n return {\n type: eveType,\n event: event,\n target: targetInfo.target,\n topTarget: targetInfo.topTarget,\n cancelBubble: false,\n offsetX: event.zrX,\n offsetY: event.zrY,\n gestureEvent: event.gestureEvent,\n pinchX: event.pinchX,\n pinchY: event.pinchY,\n pinchScale: event.pinchScale,\n wheelDelta: event.zrDelta,\n zrByTouch: event.zrByTouch,\n which: event.which,\n stop: stopEvent\n };\n}\nfunction stopEvent() {\n eventTool.stop(this.event);\n}\nvar EmptyProxy = (function (_super) {\n __extends(EmptyProxy, _super);\n function EmptyProxy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handler = null;\n return _this;\n }\n EmptyProxy.prototype.dispose = function () { };\n EmptyProxy.prototype.setCursor = function () { };\n return EmptyProxy;\n}(Eventful));\nvar HoveredResult = (function () {\n function HoveredResult(x, y) {\n this.x = x;\n this.y = y;\n }\n return HoveredResult;\n}());\nvar handlerNames = [\n 'click', 'dblclick', 'mousewheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n];\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar Handler = (function (_super) {\n __extends(Handler, _super);\n function Handler(storage, painter, proxy, painterRoot, pointerSize) {\n var _this = _super.call(this) || this;\n _this._hovered = new HoveredResult(0, 0);\n _this.storage = storage;\n _this.painter = painter;\n _this.painterRoot = painterRoot;\n _this._pointerSize = pointerSize;\n proxy = proxy || new EmptyProxy();\n _this.proxy = null;\n _this.setHandlerProxy(proxy);\n _this._draggingMgr = new Draggable(_this);\n return _this;\n }\n Handler.prototype.setHandlerProxy = function (proxy) {\n if (this.proxy) {\n this.proxy.dispose();\n }\n if (proxy) {\n util.each(handlerNames, function (name) {\n proxy.on && proxy.on(name, this[name], this);\n }, this);\n proxy.handler = this;\n }\n this.proxy = proxy;\n };\n Handler.prototype.mousemove = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var lastHovered = this._hovered;\n var lastHoveredTarget = lastHovered.target;\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\n lastHoveredTarget = lastHovered.target;\n }\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\n var hoveredTarget = hovered.target;\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(lastHovered, 'mouseout', event);\n }\n this.dispatchToElement(hovered, 'mousemove', event);\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(hovered, 'mouseover', event);\n }\n };\n Handler.prototype.mouseout = function (event) {\n var eventControl = event.zrEventControl;\n if (eventControl !== 'only_globalout') {\n this.dispatchToElement(this._hovered, 'mouseout', event);\n }\n if (eventControl !== 'no_globalout') {\n this.trigger('globalout', { type: 'globalout', event: event });\n }\n };\n Handler.prototype.resize = function () {\n this._hovered = new HoveredResult(0, 0);\n };\n Handler.prototype.dispatch = function (eventName, eventArgs) {\n var handler = this[eventName];\n handler && handler.call(this, eventArgs);\n };\n Handler.prototype.dispose = function () {\n this.proxy.dispose();\n this.storage = null;\n this.proxy = null;\n this.painter = null;\n };\n Handler.prototype.setCursorStyle = function (cursorStyle) {\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(cursorStyle);\n };\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\n targetInfo = targetInfo || {};\n var el = targetInfo.target;\n if (el && el.silent) {\n return;\n }\n var eventKey = ('on' + eventName);\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\n while (el) {\n el[eventKey]\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\n el.trigger(eventName, eventPacket);\n el = el.__hostTarget ? el.__hostTarget : el.parent;\n if (eventPacket.cancelBubble) {\n break;\n }\n }\n if (!eventPacket.cancelBubble) {\n this.trigger(eventName, eventPacket);\n if (this.painter && this.painter.eachOtherLayer) {\n this.painter.eachOtherLayer(function (layer) {\n if (typeof (layer[eventKey]) === 'function') {\n layer[eventKey].call(layer, eventPacket);\n }\n if (layer.trigger) {\n layer.trigger(eventName, eventPacket);\n }\n });\n }\n }\n };\n Handler.prototype.findHover = function (x, y, exclude) {\n var list = this.storage.getDisplayList();\n var out = new HoveredResult(x, y);\n setHoverTarget(list, out, x, y, exclude);\n if (this._pointerSize && !out.target) {\n var candidates = [];\n var pointerSize = this._pointerSize;\n var targetSizeHalf = pointerSize / 2;\n var pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);\n for (var i = list.length - 1; i >= 0; i--) {\n var el = list[i];\n if (el !== exclude\n && !el.ignore\n && !el.ignoreCoarsePointer\n && (!el.parent || !el.parent.ignoreCoarsePointer)) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n if (tmpRect.intersect(pointerRect)) {\n candidates.push(el);\n }\n }\n }\n if (candidates.length) {\n var rStep = 4;\n var thetaStep = Math.PI / 12;\n var PI2 = Math.PI * 2;\n for (var r = 0; r < targetSizeHalf; r += rStep) {\n for (var theta = 0; theta < PI2; theta += thetaStep) {\n var x1 = x + r * Math.cos(theta);\n var y1 = y + r * Math.sin(theta);\n setHoverTarget(candidates, out, x1, y1, exclude);\n if (out.target) {\n return out;\n }\n }\n }\n }\n }\n return out;\n };\n Handler.prototype.processGesture = function (event, stage) {\n if (!this._gestureMgr) {\n this._gestureMgr = new GestureMgr();\n }\n var gestureMgr = this._gestureMgr;\n stage === 'start' && gestureMgr.clear();\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\n stage === 'end' && gestureMgr.clear();\n if (gestureInfo) {\n var type = gestureInfo.type;\n event.gestureEvent = type;\n var res = new HoveredResult();\n res.target = gestureInfo.target;\n this.dispatchToElement(res, type, gestureInfo.event);\n }\n };\n return Handler;\n}(Eventful));\nutil.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n Handler.prototype[name] = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var hovered;\n var hoveredTarget;\n if (name !== 'mouseup' || !isOutside) {\n hovered = this.findHover(x, y);\n hoveredTarget = hovered.target;\n }\n if (name === 'mousedown') {\n this._downEl = hoveredTarget;\n this._downPoint = [event.zrX, event.zrY];\n this._upEl = hoveredTarget;\n }\n else if (name === 'mouseup') {\n this._upEl = hoveredTarget;\n }\n else if (name === 'click') {\n if (this._downEl !== this._upEl\n || !this._downPoint\n || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\n return;\n }\n this._downPoint = null;\n }\n this.dispatchToElement(hovered, name, event);\n };\n});\nfunction isHover(displayable, x, y) {\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\n var el = displayable;\n var isSilent = void 0;\n var ignoreClip = false;\n while (el) {\n if (el.ignoreClip) {\n ignoreClip = true;\n }\n if (!ignoreClip) {\n var clipPath = el.getClipPath();\n if (clipPath && !clipPath.contain(x, y)) {\n return false;\n }\n }\n if (el.silent) {\n isSilent = true;\n }\n var hostEl = el.__hostTarget;\n el = hostEl ? hostEl : el.parent;\n }\n return isSilent ? SILENT : true;\n }\n return false;\n}\nfunction setHoverTarget(list, out, x, y, exclude) {\n for (var i = list.length - 1; i >= 0; i--) {\n var el = list[i];\n var hoverCheckResult = void 0;\n if (el !== exclude\n && !el.ignore\n && (hoverCheckResult = isHover(el, x, y))) {\n !out.topTarget && (out.topTarget = el);\n if (hoverCheckResult !== SILENT) {\n out.target = el;\n break;\n }\n }\n }\n}\nfunction isOutsideBoundary(handlerInstance, x, y) {\n var painter = handlerInstance.painter;\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\n}\nexport default Handler;\n","var DEFAULT_MIN_MERGE = 32;\nvar DEFAULT_MIN_GALLOPING = 7;\nfunction minRunLength(n) {\n var r = 0;\n while (n >= DEFAULT_MIN_MERGE) {\n r |= n & 1;\n n >>= 1;\n }\n return n + r;\n}\nfunction makeAscendingRun(array, lo, hi, compare) {\n var runHi = lo + 1;\n if (runHi === hi) {\n return 1;\n }\n if (compare(array[runHi++], array[lo]) < 0) {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n runHi++;\n }\n reverseRun(array, lo, runHi);\n }\n else {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n runHi++;\n }\n }\n return runHi - lo;\n}\nfunction reverseRun(array, lo, hi) {\n hi--;\n while (lo < hi) {\n var t = array[lo];\n array[lo++] = array[hi];\n array[hi--] = t;\n }\n}\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\n if (start === lo) {\n start++;\n }\n for (; start < hi; start++) {\n var pivot = array[start];\n var left = lo;\n var right = start;\n var mid;\n while (left < right) {\n mid = left + right >>> 1;\n if (compare(pivot, array[mid]) < 0) {\n right = mid;\n }\n else {\n left = mid + 1;\n }\n }\n var n = start - left;\n switch (n) {\n case 3:\n array[left + 3] = array[left + 2];\n case 2:\n array[left + 2] = array[left + 1];\n case 1:\n array[left + 1] = array[left];\n break;\n default:\n while (n > 0) {\n array[left + n] = array[left + n - 1];\n n--;\n }\n }\n array[left] = pivot;\n }\n}\nfunction gallopLeft(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) > 0) {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n else {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) > 0) {\n lastOffset = m + 1;\n }\n else {\n offset = m;\n }\n }\n return offset;\n}\nfunction gallopRight(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) < 0) {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n else {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) < 0) {\n offset = m;\n }\n else {\n lastOffset = m + 1;\n }\n }\n return offset;\n}\nfunction TimSort(array, compare) {\n var minGallop = DEFAULT_MIN_GALLOPING;\n var runStart;\n var runLength;\n var stackSize = 0;\n var tmp = [];\n runStart = [];\n runLength = [];\n function pushRun(_runStart, _runLength) {\n runStart[stackSize] = _runStart;\n runLength[stackSize] = _runLength;\n stackSize += 1;\n }\n function mergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\n if (runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n }\n else if (runLength[n] > runLength[n + 1]) {\n break;\n }\n mergeAt(n);\n }\n }\n function forceMergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n mergeAt(n);\n }\n }\n function mergeAt(i) {\n var start1 = runStart[i];\n var length1 = runLength[i];\n var start2 = runStart[i + 1];\n var length2 = runLength[i + 1];\n runLength[i] = length1 + length2;\n if (i === stackSize - 3) {\n runStart[i + 1] = runStart[i + 2];\n runLength[i + 1] = runLength[i + 2];\n }\n stackSize--;\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n start1 += k;\n length1 -= k;\n if (length1 === 0) {\n return;\n }\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n if (length2 === 0) {\n return;\n }\n if (length1 <= length2) {\n mergeLow(start1, length1, start2, length2);\n }\n else {\n mergeHigh(start1, length1, start2, length2);\n }\n }\n function mergeLow(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length1; i++) {\n tmp[i] = array[start1 + i];\n }\n var cursor1 = 0;\n var cursor2 = start2;\n var dest = start1;\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n return;\n }\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n return;\n }\n var _minGallop = minGallop;\n var count1;\n var count2;\n var exit;\n while (1) {\n count1 = 0;\n count2 = 0;\n exit = false;\n do {\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\n array[dest++] = array[cursor2++];\n count2++;\n count1 = 0;\n if (--length2 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest++] = tmp[cursor1++];\n count1++;\n count2 = 0;\n if (--length1 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n if (count1 !== 0) {\n for (i = 0; i < count1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n dest += count1;\n cursor1 += count1;\n length1 -= count1;\n if (length1 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n exit = true;\n break;\n }\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n if (count2 !== 0) {\n for (i = 0; i < count2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n dest += count2;\n cursor2 += count2;\n length2 -= count2;\n if (length2 === 0) {\n exit = true;\n break;\n }\n }\n array[dest++] = tmp[cursor1++];\n if (--length1 === 1) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n minGallop < 1 && (minGallop = 1);\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n }\n else if (length1 === 0) {\n throw new Error();\n }\n else {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n }\n }\n function mergeHigh(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length2; i++) {\n tmp[i] = array[start2 + i];\n }\n var cursor1 = start1 + length1 - 1;\n var cursor2 = length2 - 1;\n var dest = start2 + length2 - 1;\n var customCursor = 0;\n var customDest = 0;\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n return;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n return;\n }\n var _minGallop = minGallop;\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n do {\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\n array[dest--] = array[cursor1--];\n count1++;\n count2 = 0;\n if (--length1 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest--] = tmp[cursor2--];\n count2++;\n count1 = 0;\n if (--length2 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n if (count1 !== 0) {\n dest -= count1;\n cursor1 -= count1;\n length1 -= count1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = count1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n if (length1 === 0) {\n exit = true;\n break;\n }\n }\n array[dest--] = tmp[cursor2--];\n if (--length2 === 1) {\n exit = true;\n break;\n }\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n if (count2 !== 0) {\n dest -= count2;\n cursor2 -= count2;\n length2 -= count2;\n customDest = dest + 1;\n customCursor = cursor2 + 1;\n for (i = 0; i < count2; i++) {\n array[customDest + i] = tmp[customCursor + i];\n }\n if (length2 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n if (minGallop < 1) {\n minGallop = 1;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n }\n else if (length2 === 0) {\n throw new Error();\n }\n else {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n }\n }\n return {\n mergeRuns: mergeRuns,\n forceMergeRuns: forceMergeRuns,\n pushRun: pushRun\n };\n}\nexport default function sort(array, compare, lo, hi) {\n if (!lo) {\n lo = 0;\n }\n if (!hi) {\n hi = array.length;\n }\n var remaining = hi - lo;\n if (remaining < 2) {\n return;\n }\n var runLength = 0;\n if (remaining < DEFAULT_MIN_MERGE) {\n runLength = makeAscendingRun(array, lo, hi, compare);\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n return;\n }\n var ts = TimSort(array, compare);\n var minRun = minRunLength(remaining);\n do {\n runLength = makeAscendingRun(array, lo, hi, compare);\n if (runLength < minRun) {\n var force = remaining;\n if (force > minRun) {\n force = minRun;\n }\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n runLength = force;\n }\n ts.pushRun(lo, runLength);\n ts.mergeRuns();\n remaining -= runLength;\n lo += runLength;\n } while (remaining !== 0);\n ts.forceMergeRuns();\n}\n","export var REDRAW_BIT = 1;\nexport var STYLE_CHANGED_BIT = 2;\nexport var SHAPE_CHANGED_BIT = 4;\n","import * as util from './core/util.js';\nimport timsort from './core/timsort.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nvar invalidZErrorLogged = false;\nfunction logInvalidZError() {\n if (invalidZErrorLogged) {\n return;\n }\n invalidZErrorLogged = true;\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\n}\nfunction shapeCompareFunc(a, b) {\n if (a.zlevel === b.zlevel) {\n if (a.z === b.z) {\n return a.z2 - b.z2;\n }\n return a.z - b.z;\n }\n return a.zlevel - b.zlevel;\n}\nvar Storage = (function () {\n function Storage() {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n this.displayableSortFunc = shapeCompareFunc;\n }\n Storage.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._roots.length; i++) {\n this._roots[i].traverse(cb, context);\n }\n };\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\n includeIgnore = includeIgnore || false;\n var displayList = this._displayList;\n if (update || !displayList.length) {\n this.updateDisplayList(includeIgnore);\n }\n return displayList;\n };\n Storage.prototype.updateDisplayList = function (includeIgnore) {\n this._displayListLen = 0;\n var roots = this._roots;\n var displayList = this._displayList;\n for (var i = 0, len = roots.length; i < len; i++) {\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\n }\n displayList.length = this._displayListLen;\n timsort(displayList, shapeCompareFunc);\n };\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\n if (el.ignore && !includeIgnore) {\n return;\n }\n el.beforeUpdate();\n el.update();\n el.afterUpdate();\n var userSetClipPath = el.getClipPath();\n if (el.ignoreClip) {\n clipPaths = null;\n }\n else if (userSetClipPath) {\n if (clipPaths) {\n clipPaths = clipPaths.slice();\n }\n else {\n clipPaths = [];\n }\n var currentClipPath = userSetClipPath;\n var parentClipPath = el;\n while (currentClipPath) {\n currentClipPath.parent = parentClipPath;\n currentClipPath.updateTransform();\n clipPaths.push(currentClipPath);\n parentClipPath = currentClipPath;\n currentClipPath = currentClipPath.getClipPath();\n }\n }\n if (el.childrenRef) {\n var children = el.childrenRef();\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (el.__dirty) {\n child.__dirty |= REDRAW_BIT;\n }\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\n }\n el.__dirty = 0;\n }\n else {\n var disp = el;\n if (clipPaths && clipPaths.length) {\n disp.__clipPaths = clipPaths;\n }\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\n disp.__clipPaths = [];\n }\n if (isNaN(disp.z)) {\n logInvalidZError();\n disp.z = 0;\n }\n if (isNaN(disp.z2)) {\n logInvalidZError();\n disp.z2 = 0;\n }\n if (isNaN(disp.zlevel)) {\n logInvalidZError();\n disp.zlevel = 0;\n }\n this._displayList[this._displayListLen++] = disp;\n }\n var decalEl = el.getDecalElement && el.getDecalElement();\n if (decalEl) {\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\n }\n var textGuide = el.getTextGuideLine();\n if (textGuide) {\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\n }\n var textEl = el.getTextContent();\n if (textEl) {\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\n }\n };\n Storage.prototype.addRoot = function (el) {\n if (el.__zr && el.__zr.storage === this) {\n return;\n }\n this._roots.push(el);\n };\n Storage.prototype.delRoot = function (el) {\n if (el instanceof Array) {\n for (var i = 0, l = el.length; i < l; i++) {\n this.delRoot(el[i]);\n }\n return;\n }\n var idx = util.indexOf(this._roots, el);\n if (idx >= 0) {\n this._roots.splice(idx, 1);\n }\n };\n Storage.prototype.delAllRoots = function () {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n return;\n };\n Storage.prototype.getRoots = function () {\n return this._roots;\n };\n Storage.prototype.dispose = function () {\n this._displayList = null;\n this._roots = null;\n };\n return Storage;\n}());\nexport default Storage;\n","import env from '../core/env.js';\nvar requestAnimationFrame;\nrequestAnimationFrame = (env.hasGlobalWindow\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame)) || function (func) {\n return setTimeout(func, 16);\n};\nexport default requestAnimationFrame;\n","var easingFuncs = {\n linear: function (k) {\n return k;\n },\n quadraticIn: function (k) {\n return k * k;\n },\n quadraticOut: function (k) {\n return k * (2 - k);\n },\n quadraticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n return -0.5 * (--k * (k - 2) - 1);\n },\n cubicIn: function (k) {\n return k * k * k;\n },\n cubicOut: function (k) {\n return --k * k * k + 1;\n },\n cubicInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n quarticIn: function (k) {\n return k * k * k * k;\n },\n quarticOut: function (k) {\n return 1 - (--k * k * k * k);\n },\n quarticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n return -0.5 * ((k -= 2) * k * k * k - 2);\n },\n quinticIn: function (k) {\n return k * k * k * k * k;\n },\n quinticOut: function (k) {\n return --k * k * k * k * k + 1;\n },\n quinticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n sinusoidalIn: function (k) {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n sinusoidalOut: function (k) {\n return Math.sin(k * Math.PI / 2);\n },\n sinusoidalInOut: function (k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n exponentialIn: function (k) {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n exponentialOut: function (k) {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n },\n exponentialInOut: function (k) {\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if ((k *= 2) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n },\n circularIn: function (k) {\n return 1 - Math.sqrt(1 - k * k);\n },\n circularOut: function (k) {\n return Math.sqrt(1 - (--k * k));\n },\n circularInOut: function (k) {\n if ((k *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n elasticIn: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return -(a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n },\n elasticOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return (a * Math.pow(2, -10 * k)\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\n },\n elasticInOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n if ((k *= 2) < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n }\n return a * Math.pow(2, -10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n backIn: function (k) {\n var s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n backOut: function (k) {\n var s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n backInOut: function (k) {\n var s = 1.70158 * 1.525;\n if ((k *= 2) < 1) {\n return 0.5 * (k * k * ((s + 1) * k - s));\n }\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n bounceIn: function (k) {\n return 1 - easingFuncs.bounceOut(1 - k);\n },\n bounceOut: function (k) {\n if (k < (1 / 2.75)) {\n return 7.5625 * k * k;\n }\n else if (k < (2 / 2.75)) {\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n }\n else if (k < (2.5 / 2.75)) {\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n }\n else {\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n }\n },\n bounceInOut: function (k) {\n if (k < 0.5) {\n return easingFuncs.bounceIn(k * 2) * 0.5;\n }\n return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n }\n};\nexport default easingFuncs;\n","import { create as v2Create, distSquare as v2DistSquare } from './vector.js';\nvar mathPow = Math.pow;\nvar mathSqrt = Math.sqrt;\nvar EPSILON = 1e-8;\nvar EPSILON_NUMERIC = 1e-4;\nvar THREE_SQRT = mathSqrt(3);\nvar ONE_THIRD = 1 / 3;\nvar _v0 = v2Create();\nvar _v1 = v2Create();\nvar _v2 = v2Create();\nfunction isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n}\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nexport function cubicAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return onet * onet * (onet * p0 + 3 * t * p1)\n + t * t * (t * p3 + 3 * onet * p2);\n}\nexport function cubicDerivativeAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\n + (p3 - p2) * t * t);\n}\nexport function cubicRootAt(p0, p1, p2, p3, val, roots) {\n var a = p3 + 3 * (p1 - p2) - p0;\n var b = 3 * (p2 - p1 * 2 + p0);\n var c = 3 * (p1 - p0);\n var d = p0 - val;\n var A = b * b - 3 * a * c;\n var B = b * c - 9 * a * d;\n var C = c * c - 3 * b * d;\n var n = 0;\n if (isAroundZero(A) && isAroundZero(B)) {\n if (isAroundZero(b)) {\n roots[0] = 0;\n }\n else {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = B * B - 4 * A * C;\n if (isAroundZero(disc)) {\n var K = B / A;\n var t1 = -b / a + K;\n var t2 = -K / 2;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\n if (Y1 < 0) {\n Y1 = -mathPow(-Y1, ONE_THIRD);\n }\n else {\n Y1 = mathPow(Y1, ONE_THIRD);\n }\n if (Y2 < 0) {\n Y2 = -mathPow(-Y2, ONE_THIRD);\n }\n else {\n Y2 = mathPow(Y2, ONE_THIRD);\n }\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n else {\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\n var theta = Math.acos(T) / 3;\n var ASqrt = mathSqrt(A);\n var tmp = Math.cos(theta);\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n if (t3 >= 0 && t3 <= 1) {\n roots[n++] = t3;\n }\n }\n }\n return n;\n}\nexport function cubicExtrema(p0, p1, p2, p3, extrema) {\n var b = 6 * p2 - 12 * p1 + 6 * p0;\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\n var c = 3 * p1 - 3 * p0;\n var n = 0;\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n extrema[0] = -b / (2 * a);\n }\n else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n extrema[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function cubicSubdivide(p0, p1, p2, p3, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p23 = (p3 - p2) * t + p2;\n var p012 = (p12 - p01) * t + p01;\n var p123 = (p23 - p12) * t + p12;\n var p0123 = (p123 - p012) * t + p012;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p0123;\n out[4] = p0123;\n out[5] = p123;\n out[6] = p23;\n out[7] = p3;\n}\nexport function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\n var t;\n var interval = 0.005;\n var d = Infinity;\n var prev;\n var next;\n var d1;\n var d2;\n _v0[0] = x;\n _v0[1] = y;\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\n d1 = v2DistSquare(_v0, _v1);\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n prev = t - interval;\n next = t + interval;\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\n d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = cubicAt(x0, x1, x2, x3, t);\n out[1] = cubicAt(y0, y1, y2, y3, t);\n }\n return mathSqrt(d);\n}\nexport function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = cubicAt(x0, x1, x2, x3, t);\n var y = cubicAt(y0, y1, y2, y3, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\nexport function quadraticAt(p0, p1, p2, t) {\n var onet = 1 - t;\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\nexport function quadraticDerivativeAt(p0, p1, p2, t) {\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\nexport function quadraticRootAt(p0, p1, p2, val, roots) {\n var a = p0 - 2 * p1 + p2;\n var b = 2 * (p1 - p0);\n var c = p0 - val;\n var n = 0;\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n var t1 = -b / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function quadraticExtremum(p0, p1, p2) {\n var divider = p0 + p2 - 2 * p1;\n if (divider === 0) {\n return 0.5;\n }\n else {\n return (p0 - p1) / divider;\n }\n}\nexport function quadraticSubdivide(p0, p1, p2, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p012 = (p12 - p01) * t + p01;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p012;\n out[4] = p12;\n out[5] = p2;\n}\nexport function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\n var t;\n var interval = 0.005;\n var d = Infinity;\n _v0[0] = x;\n _v0[1] = y;\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = quadraticAt(x0, x1, x2, _t);\n _v1[1] = quadraticAt(y0, y1, y2, _t);\n var d1 = v2DistSquare(_v0, _v1);\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n var prev = t - interval;\n var next = t + interval;\n _v1[0] = quadraticAt(x0, x1, x2, prev);\n _v1[1] = quadraticAt(y0, y1, y2, prev);\n var d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = quadraticAt(x0, x1, x2, next);\n _v2[1] = quadraticAt(y0, y1, y2, next);\n var d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = quadraticAt(x0, x1, x2, t);\n out[1] = quadraticAt(y0, y1, y2, t);\n }\n return mathSqrt(d);\n}\nexport function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = quadraticAt(x0, x1, x2, t);\n var y = quadraticAt(y0, y1, y2, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\n","import { cubicAt, cubicRootAt } from '../core/curve.js';\nimport { trim } from '../core/util.js';\nvar regexp = /cubic-bezier\\(([0-9,\\.e ]+)\\)/;\nexport function createCubicEasingFunc(cubicEasingStr) {\n var cubic = cubicEasingStr && regexp.exec(cubicEasingStr);\n if (cubic) {\n var points = cubic[1].split(',');\n var a_1 = +trim(points[0]);\n var b_1 = +trim(points[1]);\n var c_1 = +trim(points[2]);\n var d_1 = +trim(points[3]);\n if (isNaN(a_1 + b_1 + c_1 + d_1)) {\n return;\n }\n var roots_1 = [];\n return function (p) {\n return p <= 0\n ? 0 : p >= 1\n ? 1\n : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]);\n };\n }\n}\n","import easingFuncs from './easing.js';\nimport { isFunction, noop } from '../core/util.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nvar Clip = (function () {\n function Clip(opts) {\n this._inited = false;\n this._startTime = 0;\n this._pausedTime = 0;\n this._paused = false;\n this._life = opts.life || 1000;\n this._delay = opts.delay || 0;\n this.loop = opts.loop || false;\n this.onframe = opts.onframe || noop;\n this.ondestroy = opts.ondestroy || noop;\n this.onrestart = opts.onrestart || noop;\n opts.easing && this.setEasing(opts.easing);\n }\n Clip.prototype.step = function (globalTime, deltaTime) {\n if (!this._inited) {\n this._startTime = globalTime + this._delay;\n this._inited = true;\n }\n if (this._paused) {\n this._pausedTime += deltaTime;\n return;\n }\n var life = this._life;\n var elapsedTime = globalTime - this._startTime - this._pausedTime;\n var percent = elapsedTime / life;\n if (percent < 0) {\n percent = 0;\n }\n percent = Math.min(percent, 1);\n var easingFunc = this.easingFunc;\n var schedule = easingFunc ? easingFunc(percent) : percent;\n this.onframe(schedule);\n if (percent === 1) {\n if (this.loop) {\n var remainder = elapsedTime % life;\n this._startTime = globalTime - remainder;\n this._pausedTime = 0;\n this.onrestart();\n }\n else {\n return true;\n }\n }\n return false;\n };\n Clip.prototype.pause = function () {\n this._paused = true;\n };\n Clip.prototype.resume = function () {\n this._paused = false;\n };\n Clip.prototype.setEasing = function (easing) {\n this.easing = easing;\n this.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n };\n return Clip;\n}());\nexport default Clip;\n","var Entry = (function () {\n function Entry(val) {\n this.value = val;\n }\n return Entry;\n}());\nexport { Entry };\nvar LinkedList = (function () {\n function LinkedList() {\n this._len = 0;\n }\n LinkedList.prototype.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n };\n LinkedList.prototype.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n }\n else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n this._len++;\n };\n LinkedList.prototype.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this.head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this.tail = prev;\n }\n entry.next = entry.prev = null;\n this._len--;\n };\n LinkedList.prototype.len = function () {\n return this._len;\n };\n LinkedList.prototype.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n };\n return LinkedList;\n}());\nexport { LinkedList };\nvar LRU = (function () {\n function LRU(maxSize) {\n this._list = new LinkedList();\n this._maxSize = 10;\n this._map = {};\n this._maxSize = maxSize;\n }\n LRU.prototype.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n if (map[key] == null) {\n var len = list.len();\n var entry = this._lastRemovedEntry;\n if (len >= this._maxSize && len > 0) {\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n if (entry) {\n entry.value = value;\n }\n else {\n entry = new Entry(value);\n }\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n return removed;\n };\n LRU.prototype.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n if (entry != null) {\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n return entry.value;\n }\n };\n LRU.prototype.clear = function () {\n this._list.clear();\n this._map = {};\n };\n LRU.prototype.len = function () {\n return this._list.len();\n };\n return LRU;\n}());\nexport default LRU;\n","import LRU from '../core/LRU.js';\nimport { extend, isGradientObject, isString, map } from '../core/util.js';\nvar kCSSColorTable = {\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\n};\nfunction clampCssByte(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\nfunction clampCssAngle(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 360 ? 360 : i;\n}\nfunction clampCssFloat(f) {\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\nfunction parseCssInt(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssByte(parseFloat(str) / 100 * 255);\n }\n return clampCssByte(parseInt(str, 10));\n}\nfunction parseCssFloat(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssFloat(parseFloat(str) / 100);\n }\n return clampCssFloat(parseFloat(str));\n}\nfunction cssHueToRgb(m1, m2, h) {\n if (h < 0) {\n h += 1;\n }\n else if (h > 1) {\n h -= 1;\n }\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n}\nfunction lerpNumber(a, b, p) {\n return a + (b - a) * p;\n}\nfunction setRgba(out, r, g, b, a) {\n out[0] = r;\n out[1] = g;\n out[2] = b;\n out[3] = a;\n return out;\n}\nfunction copyRgba(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\nvar colorCache = new LRU(20);\nvar lastRemovedArr = null;\nfunction putToCache(colorStr, rgbaArr) {\n if (lastRemovedArr) {\n copyRgba(lastRemovedArr, rgbaArr);\n }\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\n}\nexport function parse(colorStr, rgbaArr) {\n if (!colorStr) {\n return;\n }\n rgbaArr = rgbaArr || [];\n var cached = colorCache.get(colorStr);\n if (cached) {\n return copyRgba(rgbaArr, cached);\n }\n colorStr = colorStr + '';\n var str = colorStr.replace(/ /g, '').toLowerCase();\n if (str in kCSSColorTable) {\n copyRgba(rgbaArr, kCSSColorTable[str]);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n var strLen = str.length;\n if (str.charAt(0) === '#') {\n if (strLen === 4 || strLen === 5) {\n var iv = parseInt(str.slice(1, 4), 16);\n if (!(iv >= 0 && iv <= 0xfff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else if (strLen === 7 || strLen === 9) {\n var iv = parseInt(str.slice(1, 7), 16);\n if (!(iv >= 0 && iv <= 0xffffff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n return;\n }\n var op = str.indexOf('(');\n var ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === strLen) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\n var alpha = 1;\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) {\n return params.length === 3\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\n : setRgba(rgbaArr, 0, 0, 0, 1);\n }\n alpha = parseCssFloat(params.pop());\n case 'rgb':\n if (params.length >= 3) {\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3]));\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n case 'hsla':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n params[3] = parseCssFloat(params[3]);\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n case 'hsl':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n default:\n return;\n }\n }\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n}\nfunction hsla2rgba(hsla, rgba) {\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\n var s = parseCssFloat(hsla[1]);\n var l = parseCssFloat(hsla[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n rgba = rgba || [];\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\n if (hsla.length === 4) {\n rgba[3] = hsla[3];\n }\n return rgba;\n}\nfunction rgba2hsla(rgba) {\n if (!rgba) {\n return;\n }\n var R = rgba[0] / 255;\n var G = rgba[1] / 255;\n var B = rgba[2] / 255;\n var vMin = Math.min(R, G, B);\n var vMax = Math.max(R, G, B);\n var delta = vMax - vMin;\n var L = (vMax + vMin) / 2;\n var H;\n var S;\n if (delta === 0) {\n H = 0;\n S = 0;\n }\n else {\n if (L < 0.5) {\n S = delta / (vMax + vMin);\n }\n else {\n S = delta / (2 - vMax - vMin);\n }\n var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\n var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\n var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\n if (R === vMax) {\n H = deltaB - deltaG;\n }\n else if (G === vMax) {\n H = (1 / 3) + deltaR - deltaB;\n }\n else if (B === vMax) {\n H = (2 / 3) + deltaG - deltaR;\n }\n if (H < 0) {\n H += 1;\n }\n if (H > 1) {\n H -= 1;\n }\n }\n var hsla = [H * 360, S, L];\n if (rgba[3] != null) {\n hsla.push(rgba[3]);\n }\n return hsla;\n}\nexport function lift(color, level) {\n var colorArr = parse(color);\n if (colorArr) {\n for (var i = 0; i < 3; i++) {\n if (level < 0) {\n colorArr[i] = colorArr[i] * (1 - level) | 0;\n }\n else {\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\n }\n if (colorArr[i] > 255) {\n colorArr[i] = 255;\n }\n else if (colorArr[i] < 0) {\n colorArr[i] = 0;\n }\n }\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n }\n}\nexport function toHex(color) {\n var colorArr = parse(color);\n if (colorArr) {\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\n }\n}\nexport function fastLerp(normalizedValue, colors, out) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n out = out || [];\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = colors[leftIndex];\n var rightColor = colors[rightIndex];\n var dv = value - leftIndex;\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\n return out;\n}\nexport var fastMapToColor = fastLerp;\nexport function lerp(normalizedValue, colors, fullOutput) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = parse(colors[leftIndex]);\n var rightColor = parse(colors[rightIndex]);\n var dv = value - leftIndex;\n var color = stringify([\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\n ], 'rgba');\n return fullOutput\n ? {\n color: color,\n leftIndex: leftIndex,\n rightIndex: rightIndex,\n value: value\n }\n : color;\n}\nexport var mapToColor = lerp;\nexport function modifyHSL(color, h, s, l) {\n var colorArr = parse(color);\n if (color) {\n colorArr = rgba2hsla(colorArr);\n h != null && (colorArr[0] = clampCssAngle(h));\n s != null && (colorArr[1] = parseCssFloat(s));\n l != null && (colorArr[2] = parseCssFloat(l));\n return stringify(hsla2rgba(colorArr), 'rgba');\n }\n}\nexport function modifyAlpha(color, alpha) {\n var colorArr = parse(color);\n if (colorArr && alpha != null) {\n colorArr[3] = clampCssFloat(alpha);\n return stringify(colorArr, 'rgba');\n }\n}\nexport function stringify(arrColor, type) {\n if (!arrColor || !arrColor.length) {\n return;\n }\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n colorStr += ',' + arrColor[3];\n }\n return type + '(' + colorStr + ')';\n}\nexport function lum(color, backgroundLum) {\n var arr = parse(color);\n return arr\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\n + (1 - arr[3]) * backgroundLum\n : 0;\n}\nexport function random() {\n return stringify([\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255)\n ], 'rgb');\n}\nvar liftedColorCache = new LRU(100);\nexport function liftColor(color) {\n if (isString(color)) {\n var liftedColor = liftedColorCache.get(color);\n if (!liftedColor) {\n liftedColor = lift(color, -0.1);\n liftedColorCache.put(color, liftedColor);\n }\n return liftedColor;\n }\n else if (isGradientObject(color)) {\n var ret = extend({}, color);\n ret.colorStops = map(color.colorStops, function (stop) { return ({\n offset: stop.offset,\n color: lift(stop.color, -0.1)\n }); });\n return ret;\n }\n return color;\n}\n","import { RADIAN_TO_DEGREE, retrieve2, logError, isFunction } from '../core/util.js';\nimport { parse } from '../tool/color.js';\nimport env from '../core/env.js';\nvar mathRound = Math.round;\nexport function normalizeColor(color) {\n var opacity;\n if (!color || color === 'transparent') {\n color = 'none';\n }\n else if (typeof color === 'string' && color.indexOf('rgba') > -1) {\n var arr = parse(color);\n if (arr) {\n color = 'rgb(' + arr[0] + ',' + arr[1] + ',' + arr[2] + ')';\n opacity = arr[3];\n }\n }\n return {\n color: color,\n opacity: opacity == null ? 1 : opacity\n };\n}\nvar EPSILON = 1e-4;\nexport function isAroundZero(transform) {\n return transform < EPSILON && transform > -EPSILON;\n}\nexport function round3(transform) {\n return mathRound(transform * 1e3) / 1e3;\n}\nexport function round4(transform) {\n return mathRound(transform * 1e4) / 1e4;\n}\nexport function round1(transform) {\n return mathRound(transform * 10) / 10;\n}\nexport function getMatrixStr(m) {\n return 'matrix('\n + round3(m[0]) + ','\n + round3(m[1]) + ','\n + round3(m[2]) + ','\n + round3(m[3]) + ','\n + round4(m[4]) + ','\n + round4(m[5])\n + ')';\n}\nexport var TEXT_ALIGN_TO_ANCHOR = {\n left: 'start',\n right: 'end',\n center: 'middle',\n middle: 'middle'\n};\nexport function adjustTextY(y, lineHeight, textBaseline) {\n if (textBaseline === 'top') {\n y += lineHeight / 2;\n }\n else if (textBaseline === 'bottom') {\n y -= lineHeight / 2;\n }\n return y;\n}\nexport function hasShadow(style) {\n return style\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\n}\nexport function getShadowKey(displayable) {\n var style = displayable.style;\n var globalScale = displayable.getGlobalScale();\n return [\n style.shadowColor,\n (style.shadowBlur || 0).toFixed(2),\n (style.shadowOffsetX || 0).toFixed(2),\n (style.shadowOffsetY || 0).toFixed(2),\n globalScale[0],\n globalScale[1]\n ].join(',');\n}\nexport function getClipPathsKey(clipPaths) {\n var key = [];\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n key.push(clipPath.id);\n }\n }\n return key.join(',');\n}\nexport function isImagePattern(val) {\n return val && (!!val.image);\n}\nexport function isSVGPattern(val) {\n return val && (!!val.svgElement);\n}\nexport function isPattern(val) {\n return isImagePattern(val) || isSVGPattern(val);\n}\nexport function isLinearGradient(val) {\n return val.type === 'linear';\n}\nexport function isRadialGradient(val) {\n return val.type === 'radial';\n}\nexport function isGradient(val) {\n return val && (val.type === 'linear'\n || val.type === 'radial');\n}\nexport function getIdURL(id) {\n return \"url(#\" + id + \")\";\n}\nexport function getPathPrecision(el) {\n var scale = el.getGlobalScale();\n var size = Math.max(scale[0], scale[1]);\n return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1);\n}\nexport function getSRTTransformString(transform) {\n var x = transform.x || 0;\n var y = transform.y || 0;\n var rotation = (transform.rotation || 0) * RADIAN_TO_DEGREE;\n var scaleX = retrieve2(transform.scaleX, 1);\n var scaleY = retrieve2(transform.scaleY, 1);\n var skewX = transform.skewX || 0;\n var skewY = transform.skewY || 0;\n var res = [];\n if (x || y) {\n res.push(\"translate(\" + x + \"px,\" + y + \"px)\");\n }\n if (rotation) {\n res.push(\"rotate(\" + rotation + \")\");\n }\n if (scaleX !== 1 || scaleY !== 1) {\n res.push(\"scale(\" + scaleX + \",\" + scaleY + \")\");\n }\n if (skewX || skewY) {\n res.push(\"skew(\" + mathRound(skewX * RADIAN_TO_DEGREE) + \"deg, \" + mathRound(skewY * RADIAN_TO_DEGREE) + \"deg)\");\n }\n return res.join(' ');\n}\nexport var encodeBase64 = (function () {\n if (env.hasGlobalWindow && isFunction(window.btoa)) {\n return function (str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n };\n }\n if (typeof Buffer !== 'undefined') {\n return function (str) {\n return Buffer.from(str).toString('base64');\n };\n }\n return function (str) {\n if (process.env.NODE_ENV !== 'production') {\n logError('Base64 isn\\'t natively supported in the current environment.');\n }\n return null;\n };\n})();\n","import Clip from './Clip.js';\nimport * as color from '../tool/color.js';\nimport { eqNaN, extend, isArrayLike, isFunction, isGradientObject, isNumber, isString, keys, logError, map } from '../core/util.js';\nimport easingFuncs from './easing.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nimport { isLinearGradient, isRadialGradient } from '../svg/helper.js';\n;\nvar arraySlice = Array.prototype.slice;\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\nfunction interpolate1DArray(out, p0, p1, percent) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n return out;\n}\nfunction interpolate2DArray(out, p0, p1, percent) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n return out;\n}\nfunction add1DArray(out, p0, p1, sign) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = p0[i] + p1[i] * sign;\n }\n return out;\n}\nfunction add2DArray(out, p0, p1, sign) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = p0[i][j] + p1[i][j] * sign;\n }\n }\n return out;\n}\nfunction fillColorStops(val0, val1) {\n var len0 = val0.length;\n var len1 = val1.length;\n var shorterArr = len0 > len1 ? val1 : val0;\n var shorterLen = Math.min(len0, len1);\n var last = shorterArr[shorterLen - 1] || { color: [0, 0, 0, 0], offset: 0 };\n for (var i = shorterLen; i < Math.max(len0, len1); i++) {\n shorterArr.push({\n offset: last.offset,\n color: last.color.slice()\n });\n }\n}\nfunction fillArray(val0, val1, arrDim) {\n var arr0 = val0;\n var arr1 = val1;\n if (!arr0.push || !arr1.push) {\n return;\n }\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n if (arr0Len !== arr1Len) {\n var isPreviousLarger = arr0Len > arr1Len;\n if (isPreviousLarger) {\n arr0.length = arr1Len;\n }\n else {\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n }\n var len2 = arr0[0] && arr0[0].length;\n for (var i = 0; i < arr0.length; i++) {\n if (arrDim === 1) {\n if (isNaN(arr0[i])) {\n arr0[i] = arr1[i];\n }\n }\n else {\n for (var j = 0; j < len2; j++) {\n if (isNaN(arr0[i][j])) {\n arr0[i][j] = arr1[i][j];\n }\n }\n }\n }\n}\nexport function cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n if (isArrayLike(value[0])) {\n var ret = [];\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n return ret;\n }\n return arraySlice.call(value);\n }\n return value;\n}\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]) || 0;\n rgba[1] = Math.floor(rgba[1]) || 0;\n rgba[2] = Math.floor(rgba[2]) || 0;\n rgba[3] = rgba[3] == null ? 1 : rgba[3];\n return 'rgba(' + rgba.join(',') + ')';\n}\nfunction guessArrayDim(value) {\n return isArrayLike(value && value[0]) ? 2 : 1;\n}\nvar VALUE_TYPE_NUMBER = 0;\nvar VALUE_TYPE_1D_ARRAY = 1;\nvar VALUE_TYPE_2D_ARRAY = 2;\nvar VALUE_TYPE_COLOR = 3;\nvar VALUE_TYPE_LINEAR_GRADIENT = 4;\nvar VALUE_TYPE_RADIAL_GRADIENT = 5;\nvar VALUE_TYPE_UNKOWN = 6;\nfunction isGradientValueType(valType) {\n return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT;\n}\nfunction isArrayValueType(valType) {\n return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY;\n}\nvar tmpRgba = [0, 0, 0, 0];\nvar Track = (function () {\n function Track(propName) {\n this.keyframes = [];\n this.discrete = false;\n this._invalid = false;\n this._needsSort = false;\n this._lastFr = 0;\n this._lastFrP = 0;\n this.propName = propName;\n }\n Track.prototype.isFinished = function () {\n return this._finished;\n };\n Track.prototype.setFinished = function () {\n this._finished = true;\n if (this._additiveTrack) {\n this._additiveTrack.setFinished();\n }\n };\n Track.prototype.needsAnimate = function () {\n return this.keyframes.length >= 1;\n };\n Track.prototype.getAdditiveTrack = function () {\n return this._additiveTrack;\n };\n Track.prototype.addKeyframe = function (time, rawValue, easing) {\n this._needsSort = true;\n var keyframes = this.keyframes;\n var len = keyframes.length;\n var discrete = false;\n var valType = VALUE_TYPE_UNKOWN;\n var value = rawValue;\n if (isArrayLike(rawValue)) {\n var arrayDim = guessArrayDim(rawValue);\n valType = arrayDim;\n if (arrayDim === 1 && !isNumber(rawValue[0])\n || arrayDim === 2 && !isNumber(rawValue[0][0])) {\n discrete = true;\n }\n }\n else {\n if (isNumber(rawValue) && !eqNaN(rawValue)) {\n valType = VALUE_TYPE_NUMBER;\n }\n else if (isString(rawValue)) {\n if (!isNaN(+rawValue)) {\n valType = VALUE_TYPE_NUMBER;\n }\n else {\n var colorArray = color.parse(rawValue);\n if (colorArray) {\n value = colorArray;\n valType = VALUE_TYPE_COLOR;\n }\n }\n }\n else if (isGradientObject(rawValue)) {\n var parsedGradient = extend({}, value);\n parsedGradient.colorStops = map(rawValue.colorStops, function (colorStop) { return ({\n offset: colorStop.offset,\n color: color.parse(colorStop.color)\n }); });\n if (isLinearGradient(rawValue)) {\n valType = VALUE_TYPE_LINEAR_GRADIENT;\n }\n else if (isRadialGradient(rawValue)) {\n valType = VALUE_TYPE_RADIAL_GRADIENT;\n }\n value = parsedGradient;\n }\n }\n if (len === 0) {\n this.valType = valType;\n }\n else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) {\n discrete = true;\n }\n this.discrete = this.discrete || discrete;\n var kf = {\n time: time,\n value: value,\n rawValue: rawValue,\n percent: 0\n };\n if (easing) {\n kf.easing = easing;\n kf.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n }\n keyframes.push(kf);\n return kf;\n };\n Track.prototype.prepare = function (maxTime, additiveTrack) {\n var kfs = this.keyframes;\n if (this._needsSort) {\n kfs.sort(function (a, b) {\n return a.time - b.time;\n });\n }\n var valType = this.valType;\n var kfsLen = kfs.length;\n var lastKf = kfs[kfsLen - 1];\n var isDiscrete = this.discrete;\n var isArr = isArrayValueType(valType);\n var isGradient = isGradientValueType(valType);\n for (var i = 0; i < kfsLen; i++) {\n var kf = kfs[i];\n var value = kf.value;\n var lastValue = lastKf.value;\n kf.percent = kf.time / maxTime;\n if (!isDiscrete) {\n if (isArr && i !== kfsLen - 1) {\n fillArray(value, lastValue, valType);\n }\n else if (isGradient) {\n fillColorStops(value.colorStops, lastValue.colorStops);\n }\n }\n }\n if (!isDiscrete\n && valType !== VALUE_TYPE_RADIAL_GRADIENT\n && additiveTrack\n && this.needsAnimate()\n && additiveTrack.needsAnimate()\n && valType === additiveTrack.valType\n && !additiveTrack._finished) {\n this._additiveTrack = additiveTrack;\n var startValue = kfs[0].value;\n for (var i = 0; i < kfsLen; i++) {\n if (valType === VALUE_TYPE_NUMBER) {\n kfs[i].additiveValue = kfs[i].value - startValue;\n }\n else if (valType === VALUE_TYPE_COLOR) {\n kfs[i].additiveValue =\n add1DArray([], kfs[i].value, startValue, -1);\n }\n else if (isArrayValueType(valType)) {\n kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY\n ? add1DArray([], kfs[i].value, startValue, -1)\n : add2DArray([], kfs[i].value, startValue, -1);\n }\n }\n }\n };\n Track.prototype.step = function (target, percent) {\n if (this._finished) {\n return;\n }\n if (this._additiveTrack && this._additiveTrack._finished) {\n this._additiveTrack = null;\n }\n var isAdditive = this._additiveTrack != null;\n var valueKey = isAdditive ? 'additiveValue' : 'value';\n var valType = this.valType;\n var keyframes = this.keyframes;\n var kfsNum = keyframes.length;\n var propName = this.propName;\n var isValueColor = valType === VALUE_TYPE_COLOR;\n var frameIdx;\n var lastFrame = this._lastFr;\n var mathMin = Math.min;\n var frame;\n var nextFrame;\n if (kfsNum === 1) {\n frame = nextFrame = keyframes[0];\n }\n else {\n if (percent < 0) {\n frameIdx = 0;\n }\n else if (percent < this._lastFrP) {\n var start = mathMin(lastFrame + 1, kfsNum - 1);\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\n if (keyframes[frameIdx].percent <= percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx, kfsNum - 2);\n }\n else {\n for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) {\n if (keyframes[frameIdx].percent > percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx - 1, kfsNum - 2);\n }\n nextFrame = keyframes[frameIdx + 1];\n frame = keyframes[frameIdx];\n }\n if (!(frame && nextFrame)) {\n return;\n }\n this._lastFr = frameIdx;\n this._lastFrP = percent;\n var interval = (nextFrame.percent - frame.percent);\n var w = interval === 0 ? 1 : mathMin((percent - frame.percent) / interval, 1);\n if (nextFrame.easingFunc) {\n w = nextFrame.easingFunc(w);\n }\n var targetArr = isAdditive ? this._additiveValue\n : (isValueColor ? tmpRgba : target[propName]);\n if ((isArrayValueType(valType) || isValueColor) && !targetArr) {\n targetArr = this._additiveValue = [];\n }\n if (this.discrete) {\n target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue;\n }\n else if (isArrayValueType(valType)) {\n valType === VALUE_TYPE_1D_ARRAY\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n }\n else if (isGradientValueType(valType)) {\n var val = frame[valueKey];\n var nextVal_1 = nextFrame[valueKey];\n var isLinearGradient_1 = valType === VALUE_TYPE_LINEAR_GRADIENT;\n target[propName] = {\n type: isLinearGradient_1 ? 'linear' : 'radial',\n x: interpolateNumber(val.x, nextVal_1.x, w),\n y: interpolateNumber(val.y, nextVal_1.y, w),\n colorStops: map(val.colorStops, function (colorStop, idx) {\n var nextColorStop = nextVal_1.colorStops[idx];\n return {\n offset: interpolateNumber(colorStop.offset, nextColorStop.offset, w),\n color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w))\n };\n }),\n global: nextVal_1.global\n };\n if (isLinearGradient_1) {\n target[propName].x2 = interpolateNumber(val.x2, nextVal_1.x2, w);\n target[propName].y2 = interpolateNumber(val.y2, nextVal_1.y2, w);\n }\n else {\n target[propName].r = interpolateNumber(val.r, nextVal_1.r, w);\n }\n }\n else if (isValueColor) {\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n if (!isAdditive) {\n target[propName] = rgba2String(targetArr);\n }\n }\n else {\n var value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\n if (isAdditive) {\n this._additiveValue = value;\n }\n else {\n target[propName] = value;\n }\n }\n if (isAdditive) {\n this._addToTarget(target);\n }\n };\n Track.prototype._addToTarget = function (target) {\n var valType = this.valType;\n var propName = this.propName;\n var additiveValue = this._additiveValue;\n if (valType === VALUE_TYPE_NUMBER) {\n target[propName] = target[propName] + additiveValue;\n }\n else if (valType === VALUE_TYPE_COLOR) {\n color.parse(target[propName], tmpRgba);\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\n target[propName] = rgba2String(tmpRgba);\n }\n else if (valType === VALUE_TYPE_1D_ARRAY) {\n add1DArray(target[propName], target[propName], additiveValue, 1);\n }\n else if (valType === VALUE_TYPE_2D_ARRAY) {\n add2DArray(target[propName], target[propName], additiveValue, 1);\n }\n };\n return Track;\n}());\nvar Animator = (function () {\n function Animator(target, loop, allowDiscreteAnimation, additiveTo) {\n this._tracks = {};\n this._trackKeys = [];\n this._maxTime = 0;\n this._started = 0;\n this._clip = null;\n this._target = target;\n this._loop = loop;\n if (loop && additiveTo) {\n logError('Can\\' use additive animation on looped animation.');\n return;\n }\n this._additiveAnimators = additiveTo;\n this._allowDiscrete = allowDiscreteAnimation;\n }\n Animator.prototype.getMaxTime = function () {\n return this._maxTime;\n };\n Animator.prototype.getDelay = function () {\n return this._delay;\n };\n Animator.prototype.getLoop = function () {\n return this._loop;\n };\n Animator.prototype.getTarget = function () {\n return this._target;\n };\n Animator.prototype.changeTarget = function (target) {\n this._target = target;\n };\n Animator.prototype.when = function (time, props, easing) {\n return this.whenWithKeys(time, props, keys(props), easing);\n };\n Animator.prototype.whenWithKeys = function (time, props, propNames, easing) {\n var tracks = this._tracks;\n for (var i = 0; i < propNames.length; i++) {\n var propName = propNames[i];\n var track = tracks[propName];\n if (!track) {\n track = tracks[propName] = new Track(propName);\n var initialValue = void 0;\n var additiveTrack = this._getAdditiveTrack(propName);\n if (additiveTrack) {\n var addtiveTrackKfs = additiveTrack.keyframes;\n var lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1];\n initialValue = lastFinalKf && lastFinalKf.value;\n if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) {\n initialValue = rgba2String(initialValue);\n }\n }\n else {\n initialValue = this._target[propName];\n }\n if (initialValue == null) {\n continue;\n }\n if (time > 0) {\n track.addKeyframe(0, cloneValue(initialValue), easing);\n }\n this._trackKeys.push(propName);\n }\n track.addKeyframe(time, cloneValue(props[propName]), easing);\n }\n this._maxTime = Math.max(this._maxTime, time);\n return this;\n };\n Animator.prototype.pause = function () {\n this._clip.pause();\n this._paused = true;\n };\n Animator.prototype.resume = function () {\n this._clip.resume();\n this._paused = false;\n };\n Animator.prototype.isPaused = function () {\n return !!this._paused;\n };\n Animator.prototype.duration = function (duration) {\n this._maxTime = duration;\n this._force = true;\n return this;\n };\n Animator.prototype._doneCallback = function () {\n this._setTracksFinished();\n this._clip = null;\n var doneList = this._doneCbs;\n if (doneList) {\n var len = doneList.length;\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n }\n };\n Animator.prototype._abortedCallback = function () {\n this._setTracksFinished();\n var animation = this.animation;\n var abortedList = this._abortedCbs;\n if (animation) {\n animation.removeClip(this._clip);\n }\n this._clip = null;\n if (abortedList) {\n for (var i = 0; i < abortedList.length; i++) {\n abortedList[i].call(this);\n }\n }\n };\n Animator.prototype._setTracksFinished = function () {\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < tracksKeys.length; i++) {\n tracks[tracksKeys[i]].setFinished();\n }\n };\n Animator.prototype._getAdditiveTrack = function (trackName) {\n var additiveTrack;\n var additiveAnimators = this._additiveAnimators;\n if (additiveAnimators) {\n for (var i = 0; i < additiveAnimators.length; i++) {\n var track = additiveAnimators[i].getTrack(trackName);\n if (track) {\n additiveTrack = track;\n }\n }\n }\n return additiveTrack;\n };\n Animator.prototype.start = function (easing) {\n if (this._started > 0) {\n return;\n }\n this._started = 1;\n var self = this;\n var tracks = [];\n var maxTime = this._maxTime || 0;\n for (var i = 0; i < this._trackKeys.length; i++) {\n var propName = this._trackKeys[i];\n var track = this._tracks[propName];\n var additiveTrack = this._getAdditiveTrack(propName);\n var kfs = track.keyframes;\n var kfsNum = kfs.length;\n track.prepare(maxTime, additiveTrack);\n if (track.needsAnimate()) {\n if (!this._allowDiscrete && track.discrete) {\n var lastKf = kfs[kfsNum - 1];\n if (lastKf) {\n self._target[track.propName] = lastKf.rawValue;\n }\n track.setFinished();\n }\n else {\n tracks.push(track);\n }\n }\n }\n if (tracks.length || this._force) {\n var clip = new Clip({\n life: maxTime,\n loop: this._loop,\n delay: this._delay || 0,\n onframe: function (percent) {\n self._started = 2;\n var additiveAnimators = self._additiveAnimators;\n if (additiveAnimators) {\n var stillHasAdditiveAnimator = false;\n for (var i = 0; i < additiveAnimators.length; i++) {\n if (additiveAnimators[i]._clip) {\n stillHasAdditiveAnimator = true;\n break;\n }\n }\n if (!stillHasAdditiveAnimator) {\n self._additiveAnimators = null;\n }\n }\n for (var i = 0; i < tracks.length; i++) {\n tracks[i].step(self._target, percent);\n }\n var onframeList = self._onframeCbs;\n if (onframeList) {\n for (var i = 0; i < onframeList.length; i++) {\n onframeList[i](self._target, percent);\n }\n }\n },\n ondestroy: function () {\n self._doneCallback();\n }\n });\n this._clip = clip;\n if (this.animation) {\n this.animation.addClip(clip);\n }\n if (easing) {\n clip.setEasing(easing);\n }\n }\n else {\n this._doneCallback();\n }\n return this;\n };\n Animator.prototype.stop = function (forwardToLast) {\n if (!this._clip) {\n return;\n }\n var clip = this._clip;\n if (forwardToLast) {\n clip.onframe(1);\n }\n this._abortedCallback();\n };\n Animator.prototype.delay = function (time) {\n this._delay = time;\n return this;\n };\n Animator.prototype.during = function (cb) {\n if (cb) {\n if (!this._onframeCbs) {\n this._onframeCbs = [];\n }\n this._onframeCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.done = function (cb) {\n if (cb) {\n if (!this._doneCbs) {\n this._doneCbs = [];\n }\n this._doneCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.aborted = function (cb) {\n if (cb) {\n if (!this._abortedCbs) {\n this._abortedCbs = [];\n }\n this._abortedCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.getClip = function () {\n return this._clip;\n };\n Animator.prototype.getTrack = function (propName) {\n return this._tracks[propName];\n };\n Animator.prototype.getTracks = function () {\n var _this = this;\n return map(this._trackKeys, function (key) { return _this._tracks[key]; });\n };\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\n if (!propNames.length || !this._clip) {\n return true;\n }\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < propNames.length; i++) {\n var track = tracks[propNames[i]];\n if (track && !track.isFinished()) {\n if (forwardToLast) {\n track.step(this._target, 1);\n }\n else if (this._started === 1) {\n track.step(this._target, 0);\n }\n track.setFinished();\n }\n }\n var allAborted = true;\n for (var i = 0; i < tracksKeys.length; i++) {\n if (!tracks[tracksKeys[i]].isFinished()) {\n allAborted = false;\n break;\n }\n }\n if (allAborted) {\n this._abortedCallback();\n }\n return allAborted;\n };\n Animator.prototype.saveTo = function (target, trackKeys, firstOrLast) {\n if (!target) {\n return;\n }\n trackKeys = trackKeys || this._trackKeys;\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track || track.isFinished()) {\n continue;\n }\n var kfs = track.keyframes;\n var kf = kfs[firstOrLast ? 0 : kfs.length - 1];\n if (kf) {\n target[propName] = cloneValue(kf.rawValue);\n }\n }\n };\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\n trackKeys = trackKeys || keys(finalProps);\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track) {\n continue;\n }\n var kfs = track.keyframes;\n if (kfs.length > 1) {\n var lastKf = kfs.pop();\n track.addKeyframe(lastKf.time, finalProps[propName]);\n track.prepare(this._maxTime, track.getAdditiveTrack());\n }\n }\n };\n return Animator;\n}());\nexport default Animator;\n","import { __extends } from \"tslib\";\nimport Eventful from '../core/Eventful.js';\nimport requestAnimationFrame from './requestAnimationFrame.js';\nimport Animator from './Animator.js';\nexport function getTime() {\n return new Date().getTime();\n}\nvar Animation = (function (_super) {\n __extends(Animation, _super);\n function Animation(opts) {\n var _this = _super.call(this) || this;\n _this._running = false;\n _this._time = 0;\n _this._pausedTime = 0;\n _this._pauseStart = 0;\n _this._paused = false;\n opts = opts || {};\n _this.stage = opts.stage || {};\n return _this;\n }\n Animation.prototype.addClip = function (clip) {\n if (clip.animation) {\n this.removeClip(clip);\n }\n if (!this._head) {\n this._head = this._tail = clip;\n }\n else {\n this._tail.next = clip;\n clip.prev = this._tail;\n clip.next = null;\n this._tail = clip;\n }\n clip.animation = this;\n };\n Animation.prototype.addAnimator = function (animator) {\n animator.animation = this;\n var clip = animator.getClip();\n if (clip) {\n this.addClip(clip);\n }\n };\n Animation.prototype.removeClip = function (clip) {\n if (!clip.animation) {\n return;\n }\n var prev = clip.prev;\n var next = clip.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this._head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this._tail = prev;\n }\n clip.next = clip.prev = clip.animation = null;\n };\n Animation.prototype.removeAnimator = function (animator) {\n var clip = animator.getClip();\n if (clip) {\n this.removeClip(clip);\n }\n animator.animation = null;\n };\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\n var time = getTime() - this._pausedTime;\n var delta = time - this._time;\n var clip = this._head;\n while (clip) {\n var nextClip = clip.next;\n var finished = clip.step(time, delta);\n if (finished) {\n clip.ondestroy();\n this.removeClip(clip);\n clip = nextClip;\n }\n else {\n clip = nextClip;\n }\n }\n this._time = time;\n if (!notTriggerFrameAndStageUpdate) {\n this.trigger('frame', delta);\n this.stage.update && this.stage.update();\n }\n };\n Animation.prototype._startLoop = function () {\n var self = this;\n this._running = true;\n function step() {\n if (self._running) {\n requestAnimationFrame(step);\n !self._paused && self.update();\n }\n }\n requestAnimationFrame(step);\n };\n Animation.prototype.start = function () {\n if (this._running) {\n return;\n }\n this._time = getTime();\n this._pausedTime = 0;\n this._startLoop();\n };\n Animation.prototype.stop = function () {\n this._running = false;\n };\n Animation.prototype.pause = function () {\n if (!this._paused) {\n this._pauseStart = getTime();\n this._paused = true;\n }\n };\n Animation.prototype.resume = function () {\n if (this._paused) {\n this._pausedTime += getTime() - this._pauseStart;\n this._paused = false;\n }\n };\n Animation.prototype.clear = function () {\n var clip = this._head;\n while (clip) {\n var nextClip = clip.next;\n clip.prev = clip.next = clip.animation = null;\n clip = nextClip;\n }\n this._head = this._tail = null;\n };\n Animation.prototype.isFinished = function () {\n return this._head == null;\n };\n Animation.prototype.animate = function (target, options) {\n options = options || {};\n this.start();\n var animator = new Animator(target, options.loop);\n this.addAnimator(animator);\n return animator;\n };\n return Animation;\n}(Eventful));\nexport default Animation;\n","import { __extends } from \"tslib\";\nimport { addEventListener, removeEventListener, normalizeEvent, getNativeEvent } from '../core/event.js';\nimport * as zrUtil from '../core/util.js';\nimport Eventful from '../core/Eventful.js';\nimport env from '../core/env.js';\nvar TOUCH_CLICK_DELAY = 300;\nvar globalEventSupported = env.domSupported;\nvar localNativeListenerNames = (function () {\n var mouseHandlerNames = [\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n ];\n var touchHandlerNames = [\n 'touchstart', 'touchend', 'touchmove'\n ];\n var pointerEventNameMap = {\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\n };\n var pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n var nm = name.replace('mouse', 'pointer');\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n });\n return {\n mouse: mouseHandlerNames,\n touch: touchHandlerNames,\n pointer: pointerHandlerNames\n };\n})();\nvar globalNativeListenerNames = {\n mouse: ['mousemove', 'mouseup'],\n pointer: ['pointermove', 'pointerup']\n};\nvar wheelEventSupported = false;\nfunction isPointerFromTouch(event) {\n var pointerType = event.pointerType;\n return pointerType === 'pen' || pointerType === 'touch';\n}\nfunction setTouchTimer(scope) {\n scope.touching = true;\n if (scope.touchTimer != null) {\n clearTimeout(scope.touchTimer);\n scope.touchTimer = null;\n }\n scope.touchTimer = setTimeout(function () {\n scope.touching = false;\n scope.touchTimer = null;\n }, 700);\n}\nfunction markTouch(event) {\n event && (event.zrByTouch = true);\n}\nfunction normalizeGlobalEvent(instance, event) {\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\n}\nfunction isLocalEl(instance, el) {\n var elTmp = el;\n var isLocal = false;\n while (elTmp && elTmp.nodeType !== 9\n && !(isLocal = elTmp.domBelongToZr\n || (elTmp !== el && elTmp === instance.painterRoot))) {\n elTmp = elTmp.parentNode;\n }\n return isLocal;\n}\nvar FakeGlobalEvent = (function () {\n function FakeGlobalEvent(instance, event) {\n this.stopPropagation = zrUtil.noop;\n this.stopImmediatePropagation = zrUtil.noop;\n this.preventDefault = zrUtil.noop;\n this.type = event.type;\n this.target = this.currentTarget = instance.dom;\n this.pointerType = event.pointerType;\n this.clientX = event.clientX;\n this.clientY = event.clientY;\n }\n return FakeGlobalEvent;\n}());\nvar localDOMHandlers = {\n mousedown: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__mayPointerCapture = [event.zrX, event.zrY];\n this.trigger('mousedown', event);\n },\n mousemove: function (event) {\n event = normalizeEvent(this.dom, event);\n var downPoint = this.__mayPointerCapture;\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n this.__togglePointerCapture(true);\n }\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n },\n mouseout: function (event) {\n event = normalizeEvent(this.dom, event);\n var element = event.toElement || event.relatedTarget;\n if (!isLocalEl(this, element)) {\n if (this.__pointerCapturing) {\n event.zrEventControl = 'no_globalout';\n }\n this.trigger('mouseout', event);\n }\n },\n wheel: function (event) {\n wheelEventSupported = true;\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n mousewheel: function (event) {\n if (wheelEventSupported) {\n return;\n }\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n touchstart: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.__lastTouchMoment = new Date();\n this.handler.processGesture(event, 'start');\n localDOMHandlers.mousemove.call(this, event);\n localDOMHandlers.mousedown.call(this, event);\n },\n touchmove: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'change');\n localDOMHandlers.mousemove.call(this, event);\n },\n touchend: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'end');\n localDOMHandlers.mouseup.call(this, event);\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\n localDOMHandlers.click.call(this, event);\n }\n },\n pointerdown: function (event) {\n localDOMHandlers.mousedown.call(this, event);\n },\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n localDOMHandlers.mouseup.call(this, event);\n },\n pointerout: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mouseout.call(this, event);\n }\n }\n};\nzrUtil.each(['click', 'dblclick', 'contextmenu'], function (name) {\n localDOMHandlers[name] = function (event) {\n event = normalizeEvent(this.dom, event);\n this.trigger(name, event);\n };\n});\nvar globalDOMHandlers = {\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n globalDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n globalDOMHandlers.mouseup.call(this, event);\n },\n mousemove: function (event) {\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n var pointerCaptureReleasing = this.__pointerCapturing;\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n if (pointerCaptureReleasing) {\n event.zrEventControl = 'only_globalout';\n this.trigger('mouseout', event);\n }\n }\n};\nfunction mountLocalDOMEventListeners(instance, scope) {\n var domHandlers = scope.domHandlers;\n if (env.pointerEventsSupported) {\n zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n });\n });\n }\n else {\n if (env.touchEventsSupported) {\n zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n setTouchTimer(scope);\n });\n });\n }\n zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n event = getNativeEvent(event);\n if (!scope.touching) {\n domHandlers[nativeEventName].call(instance, event);\n }\n });\n });\n }\n}\nfunction mountGlobalDOMEventListeners(instance, scope) {\n if (env.pointerEventsSupported) {\n zrUtil.each(globalNativeListenerNames.pointer, mount);\n }\n else if (!env.touchEventsSupported) {\n zrUtil.each(globalNativeListenerNames.mouse, mount);\n }\n function mount(nativeEventName) {\n function nativeEventListener(event) {\n event = getNativeEvent(event);\n if (!isLocalEl(instance, event.target)) {\n event = normalizeGlobalEvent(instance, event);\n scope.domHandlers[nativeEventName].call(instance, event);\n }\n }\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\n }\n}\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\n scope.mounted[nativeEventName] = listener;\n scope.listenerOpts[nativeEventName] = opt;\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\n}\nfunction unmountDOMEventListeners(scope) {\n var mounted = scope.mounted;\n for (var nativeEventName in mounted) {\n if (mounted.hasOwnProperty(nativeEventName)) {\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\n }\n }\n scope.mounted = {};\n}\nvar DOMHandlerScope = (function () {\n function DOMHandlerScope(domTarget, domHandlers) {\n this.mounted = {};\n this.listenerOpts = {};\n this.touching = false;\n this.domTarget = domTarget;\n this.domHandlers = domHandlers;\n }\n return DOMHandlerScope;\n}());\nvar HandlerDomProxy = (function (_super) {\n __extends(HandlerDomProxy, _super);\n function HandlerDomProxy(dom, painterRoot) {\n var _this = _super.call(this) || this;\n _this.__pointerCapturing = false;\n _this.dom = dom;\n _this.painterRoot = painterRoot;\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n if (globalEventSupported) {\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n }\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\n return _this;\n }\n HandlerDomProxy.prototype.dispose = function () {\n unmountDOMEventListeners(this._localHandlerScope);\n if (globalEventSupported) {\n unmountDOMEventListeners(this._globalHandlerScope);\n }\n };\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n };\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\n this.__mayPointerCapture = null;\n if (globalEventSupported\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\n this.__pointerCapturing = isPointerCapturing;\n var globalHandlerScope = this._globalHandlerScope;\n isPointerCapturing\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\n : unmountDOMEventListeners(globalHandlerScope);\n }\n };\n return HandlerDomProxy;\n}(Eventful));\nexport default HandlerDomProxy;\n","import env from './core/env.js';\nvar dpr = 1;\nif (env.hasGlobalWindow) {\n dpr = Math.max(window.devicePixelRatio\n || (window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI)\n || 1, 1);\n}\nexport var debugMode = 0;\nexport var devicePixelRatio = dpr;\nexport var DARK_MODE_THRESHOLD = 0.4;\nexport var DARK_LABEL_COLOR = '#333';\nexport var LIGHT_LABEL_COLOR = '#ccc';\nexport var LIGHTER_LABEL_COLOR = '#eee';\n","import * as matrix from './matrix.js';\nimport * as vector from './vector.js';\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nvar scaleTmp = [];\nvar tmpTransform = [];\nvar originTransform = matrix.create();\nvar abs = Math.abs;\nvar Transformable = (function () {\n function Transformable() {\n }\n Transformable.prototype.getLocalTransform = function (m) {\n return Transformable.getLocalTransform(this, m);\n };\n Transformable.prototype.setPosition = function (arr) {\n this.x = arr[0];\n this.y = arr[1];\n };\n Transformable.prototype.setScale = function (arr) {\n this.scaleX = arr[0];\n this.scaleY = arr[1];\n };\n Transformable.prototype.setSkew = function (arr) {\n this.skewX = arr[0];\n this.skewY = arr[1];\n };\n Transformable.prototype.setOrigin = function (arr) {\n this.originX = arr[0];\n this.originY = arr[1];\n };\n Transformable.prototype.needLocalTransform = function () {\n return isNotAroundZero(this.rotation)\n || isNotAroundZero(this.x)\n || isNotAroundZero(this.y)\n || isNotAroundZero(this.scaleX - 1)\n || isNotAroundZero(this.scaleY - 1)\n || isNotAroundZero(this.skewX)\n || isNotAroundZero(this.skewY);\n };\n Transformable.prototype.updateTransform = function () {\n var parentTransform = this.parent && this.parent.transform;\n var needLocalTransform = this.needLocalTransform();\n var m = this.transform;\n if (!(needLocalTransform || parentTransform)) {\n if (m) {\n mIdentity(m);\n this.invTransform = null;\n }\n return;\n }\n m = m || matrix.create();\n if (needLocalTransform) {\n this.getLocalTransform(m);\n }\n else {\n mIdentity(m);\n }\n if (parentTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parentTransform, m);\n }\n else {\n matrix.copy(m, parentTransform);\n }\n }\n this.transform = m;\n this._resolveGlobalScaleRatio(m);\n };\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\n var globalScaleRatio = this.globalScaleRatio;\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\n this.getGlobalScale(scaleTmp);\n var relX = scaleTmp[0] < 0 ? -1 : 1;\n var relY = scaleTmp[1] < 0 ? -1 : 1;\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\n m[0] *= sx;\n m[1] *= sx;\n m[2] *= sy;\n m[3] *= sy;\n }\n this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n };\n Transformable.prototype.getComputedTransform = function () {\n var transformNode = this;\n var ancestors = [];\n while (transformNode) {\n ancestors.push(transformNode);\n transformNode = transformNode.parent;\n }\n while (transformNode = ancestors.pop()) {\n transformNode.updateTransform();\n }\n return this.transform;\n };\n Transformable.prototype.setLocalTransform = function (m) {\n if (!m) {\n return;\n }\n var sx = m[0] * m[0] + m[1] * m[1];\n var sy = m[2] * m[2] + m[3] * m[3];\n var rotation = Math.atan2(m[1], m[0]);\n var shearX = Math.PI / 2 + rotation - Math.atan2(m[3], m[2]);\n sy = Math.sqrt(sy) * Math.cos(shearX);\n sx = Math.sqrt(sx);\n this.skewX = shearX;\n this.skewY = 0;\n this.rotation = -rotation;\n this.x = +m[4];\n this.y = +m[5];\n this.scaleX = sx;\n this.scaleY = sy;\n this.originX = 0;\n this.originY = 0;\n };\n Transformable.prototype.decomposeTransform = function () {\n if (!this.transform) {\n return;\n }\n var parent = this.parent;\n var m = this.transform;\n if (parent && parent.transform) {\n parent.invTransform = parent.invTransform || matrix.create();\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n var ox = this.originX;\n var oy = this.originY;\n if (ox || oy) {\n originTransform[4] = ox;\n originTransform[5] = oy;\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= ox;\n tmpTransform[5] -= oy;\n m = tmpTransform;\n }\n this.setLocalTransform(m);\n };\n Transformable.prototype.getGlobalScale = function (out) {\n var m = this.transform;\n out = out || [];\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\n }\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\n if (m[0] < 0) {\n out[0] = -out[0];\n }\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n return out;\n };\n Transformable.prototype.transformCoordToLocal = function (x, y) {\n var v2 = [x, y];\n var invTransform = this.invTransform;\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n return v2;\n };\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\n var v2 = [x, y];\n var transform = this.transform;\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n return v2;\n };\n Transformable.prototype.getLineScale = function () {\n var m = this.transform;\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\n : 1;\n };\n Transformable.prototype.copyTransform = function (source) {\n copyTransform(this, source);\n };\n Transformable.getLocalTransform = function (target, m) {\n m = m || [];\n var ox = target.originX || 0;\n var oy = target.originY || 0;\n var sx = target.scaleX;\n var sy = target.scaleY;\n var ax = target.anchorX;\n var ay = target.anchorY;\n var rotation = target.rotation || 0;\n var x = target.x;\n var y = target.y;\n var skewX = target.skewX ? Math.tan(target.skewX) : 0;\n var skewY = target.skewY ? Math.tan(-target.skewY) : 0;\n if (ox || oy || ax || ay) {\n var dx = ox + ax;\n var dy = oy + ay;\n m[4] = -dx * sx - skewX * dy * sy;\n m[5] = -dy * sy - skewY * dx * sx;\n }\n else {\n m[4] = m[5] = 0;\n }\n m[0] = sx;\n m[3] = sy;\n m[1] = skewY * sx;\n m[2] = skewX * sy;\n rotation && matrix.rotate(m, m, rotation);\n m[4] += ox + x;\n m[5] += oy + y;\n return m;\n };\n Transformable.initDefaultProps = (function () {\n var proto = Transformable.prototype;\n proto.scaleX =\n proto.scaleY =\n proto.globalScaleRatio = 1;\n proto.x =\n proto.y =\n proto.originX =\n proto.originY =\n proto.skewX =\n proto.skewY =\n proto.rotation =\n proto.anchorX =\n proto.anchorY = 0;\n })();\n return Transformable;\n}());\n;\nexport var TRANSFORMABLE_PROPS = [\n 'x', 'y', 'originX', 'originY', 'anchorX', 'anchorY', 'rotation', 'scaleX', 'scaleY', 'skewX', 'skewY'\n];\nexport function copyTransform(target, source) {\n for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n var propName = TRANSFORMABLE_PROPS[i];\n target[propName] = source[propName];\n }\n}\nexport default Transformable;\n","import BoundingRect from '../core/BoundingRect.js';\nimport LRU from '../core/LRU.js';\nimport { DEFAULT_FONT, platformApi } from '../core/platform.js';\nvar textWidthCache = {};\nexport function getWidth(text, font) {\n font = font || DEFAULT_FONT;\n var cacheOfFont = textWidthCache[font];\n if (!cacheOfFont) {\n cacheOfFont = textWidthCache[font] = new LRU(500);\n }\n var width = cacheOfFont.get(text);\n if (width == null) {\n width = platformApi.measureText(text, font).width;\n cacheOfFont.put(text, width);\n }\n return width;\n}\nexport function innerGetBoundingRect(text, font, textAlign, textBaseline) {\n var width = getWidth(text, font);\n var height = getLineHeight(font);\n var x = adjustTextX(0, width, textAlign);\n var y = adjustTextY(0, height, textBaseline);\n var rect = new BoundingRect(x, y, width, height);\n return rect;\n}\nexport function getBoundingRect(text, font, textAlign, textBaseline) {\n var textLines = ((text || '') + '').split('\\n');\n var len = textLines.length;\n if (len === 1) {\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\n }\n else {\n var uniondRect = new BoundingRect(0, 0, 0, 0);\n for (var i = 0; i < textLines.length; i++) {\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\n }\n return uniondRect;\n }\n}\nexport function adjustTextX(x, width, textAlign) {\n if (textAlign === 'right') {\n x -= width;\n }\n else if (textAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nexport function adjustTextY(y, height, verticalAlign) {\n if (verticalAlign === 'middle') {\n y -= height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y -= height;\n }\n return y;\n}\nexport function getLineHeight(font) {\n return getWidth('国', font);\n}\nexport function measureText(text, font) {\n return platformApi.measureText(text, font);\n}\nexport function parsePercent(value, maxValue) {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n return parseFloat(value);\n }\n return value;\n}\nexport function calculateTextPosition(out, opts, rect) {\n var textPosition = opts.position || 'inside';\n var distance = opts.distance != null ? opts.distance : 5;\n var height = rect.height;\n var width = rect.width;\n var halfHeight = height / 2;\n var x = rect.x;\n var y = rect.y;\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n if (textPosition instanceof Array) {\n x += parsePercent(textPosition[0], rect.width);\n y += parsePercent(textPosition[1], rect.height);\n textAlign = null;\n textVerticalAlign = null;\n }\n else {\n switch (textPosition) {\n case 'left':\n x -= distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'right':\n x += distance + width;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'top':\n x += width / 2;\n y -= distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'bottom':\n x += width / 2;\n y += height + distance;\n textAlign = 'center';\n break;\n case 'inside':\n x += width / 2;\n y += halfHeight;\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n case 'insideLeft':\n x += distance;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'insideRight':\n x += width - distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'insideTop':\n x += width / 2;\n y += distance;\n textAlign = 'center';\n break;\n case 'insideBottom':\n x += width / 2;\n y += height - distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'insideTopLeft':\n x += distance;\n y += distance;\n break;\n case 'insideTopRight':\n x += width - distance;\n y += distance;\n textAlign = 'right';\n break;\n case 'insideBottomLeft':\n x += distance;\n y += height - distance;\n textVerticalAlign = 'bottom';\n break;\n case 'insideBottomRight':\n x += width - distance;\n y += height - distance;\n textAlign = 'right';\n textVerticalAlign = 'bottom';\n break;\n }\n }\n out = out || {};\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n return out;\n}\n","import Transformable, { TRANSFORMABLE_PROPS } from './core/Transformable.js';\nimport Animator, { cloneValue } from './animation/Animator.js';\nimport BoundingRect from './core/BoundingRect.js';\nimport Eventful from './core/Eventful.js';\nimport { calculateTextPosition, parsePercent } from './contain/text.js';\nimport { guid, isObject, keys, extend, indexOf, logError, mixin, isArrayLike, isTypedArray, isGradientObject, filter, reduce } from './core/util.js';\nimport { LIGHT_LABEL_COLOR, DARK_LABEL_COLOR } from './config.js';\nimport { parse, stringify } from './tool/color.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nexport var PRESERVED_NORMAL_STATE = '__zr_normal__';\nvar PRIMARY_STATES_KEYS = TRANSFORMABLE_PROPS.concat(['ignore']);\nvar DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n obj[key] = true;\n return obj;\n}, { ignore: false });\nvar tmpTextPosCalcRes = {};\nvar tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\nvar Element = (function () {\n function Element(props) {\n this.id = guid();\n this.animators = [];\n this.currentStates = [];\n this.states = {};\n this._init(props);\n }\n Element.prototype._init = function (props) {\n this.attr(props);\n };\n Element.prototype.drift = function (dx, dy, e) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n case 'vertical':\n dx = 0;\n break;\n }\n var m = this.transform;\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.markRedraw();\n };\n Element.prototype.beforeUpdate = function () { };\n Element.prototype.afterUpdate = function () { };\n Element.prototype.update = function () {\n this.updateTransform();\n if (this.__dirty) {\n this.updateInnerText();\n }\n };\n Element.prototype.updateInnerText = function (forceUpdate) {\n var textEl = this._textContent;\n if (textEl && (!textEl.ignore || forceUpdate)) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n var textConfig = this.textConfig;\n var isLocal = textConfig.local;\n var innerTransformable = textEl.innerTransformable;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var textStyleChanged = false;\n innerTransformable.parent = isLocal ? this : null;\n var innerOrigin = false;\n innerTransformable.copyTransform(textEl);\n if (textConfig.position != null) {\n var layoutRect = tmpBoundingRect;\n if (textConfig.layoutRect) {\n layoutRect.copy(textConfig.layoutRect);\n }\n else {\n layoutRect.copy(this.getBoundingRect());\n }\n if (!isLocal) {\n layoutRect.applyTransform(this.transform);\n }\n if (this.calculateTextPosition) {\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n else {\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n innerTransformable.x = tmpTextPosCalcRes.x;\n innerTransformable.y = tmpTextPosCalcRes.y;\n textAlign = tmpTextPosCalcRes.align;\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\n var textOrigin = textConfig.origin;\n if (textOrigin && textConfig.rotation != null) {\n var relOriginX = void 0;\n var relOriginY = void 0;\n if (textOrigin === 'center') {\n relOriginX = layoutRect.width * 0.5;\n relOriginY = layoutRect.height * 0.5;\n }\n else {\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\n }\n innerOrigin = true;\n innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x);\n innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y);\n }\n }\n if (textConfig.rotation != null) {\n innerTransformable.rotation = textConfig.rotation;\n }\n var textOffset = textConfig.offset;\n if (textOffset) {\n innerTransformable.x += textOffset[0];\n innerTransformable.y += textOffset[1];\n if (!innerOrigin) {\n innerTransformable.originX = -textOffset[0];\n innerTransformable.originY = -textOffset[1];\n }\n }\n var isInside = textConfig.inside == null\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\n : textConfig.inside;\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\n var textFill = void 0;\n var textStroke = void 0;\n var autoStroke = void 0;\n if (isInside && this.canBeInsideText()) {\n textFill = textConfig.insideFill;\n textStroke = textConfig.insideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getInsideTextFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getInsideTextStroke(textFill);\n autoStroke = true;\n }\n }\n else {\n textFill = textConfig.outsideFill;\n textStroke = textConfig.outsideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getOutsideFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getOutsideStroke(textFill);\n autoStroke = true;\n }\n }\n textFill = textFill || '#000';\n if (textFill !== innerTextDefaultStyle.fill\n || textStroke !== innerTextDefaultStyle.stroke\n || autoStroke !== innerTextDefaultStyle.autoStroke\n || textAlign !== innerTextDefaultStyle.align\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\n textStyleChanged = true;\n innerTextDefaultStyle.fill = textFill;\n innerTextDefaultStyle.stroke = textStroke;\n innerTextDefaultStyle.autoStroke = autoStroke;\n innerTextDefaultStyle.align = textAlign;\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\n }\n textEl.__dirty |= REDRAW_BIT;\n if (textStyleChanged) {\n textEl.dirtyStyle(true);\n }\n }\n };\n Element.prototype.canBeInsideText = function () {\n return true;\n };\n Element.prototype.getInsideTextFill = function () {\n return '#fff';\n };\n Element.prototype.getInsideTextStroke = function (textFill) {\n return '#000';\n };\n Element.prototype.getOutsideFill = function () {\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\n };\n Element.prototype.getOutsideStroke = function (textFill) {\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\n if (!colorArr) {\n colorArr = [255, 255, 255, 1];\n }\n var alpha = colorArr[3];\n var isDark = this.__zr.isDarkMode();\n for (var i = 0; i < 3; i++) {\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\n }\n colorArr[3] = 1;\n return stringify(colorArr, 'rgba');\n };\n Element.prototype.traverse = function (cb, context) { };\n Element.prototype.attrKV = function (key, value) {\n if (key === 'textConfig') {\n this.setTextConfig(value);\n }\n else if (key === 'textContent') {\n this.setTextContent(value);\n }\n else if (key === 'clipPath') {\n this.setClipPath(value);\n }\n else if (key === 'extra') {\n this.extra = this.extra || {};\n extend(this.extra, value);\n }\n else {\n this[key] = value;\n }\n };\n Element.prototype.hide = function () {\n this.ignore = true;\n this.markRedraw();\n };\n Element.prototype.show = function () {\n this.ignore = false;\n this.markRedraw();\n };\n Element.prototype.attr = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.attrKV(keyOrObj, value);\n }\n else if (isObject(keyOrObj)) {\n var obj = keyOrObj;\n var keysArr = keys(obj);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n this.attrKV(key, keyOrObj[key]);\n }\n }\n this.markRedraw();\n return this;\n };\n Element.prototype.saveCurrentToNormalState = function (toState) {\n this._innerSaveToNormal(toState);\n var normalState = this._normalState;\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var fromStateTransition = animator.__fromStateTransition;\n if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\n continue;\n }\n var targetName = animator.targetName;\n var target = targetName\n ? normalState[targetName] : normalState;\n animator.saveTo(target);\n }\n };\n Element.prototype._innerSaveToNormal = function (toState) {\n var normalState = this._normalState;\n if (!normalState) {\n normalState = this._normalState = {};\n }\n if (toState.textConfig && !normalState.textConfig) {\n normalState.textConfig = this.textConfig;\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\n for (var i = 0; i < primaryKeys.length; i++) {\n var key = primaryKeys[i];\n if (toState[key] != null && !(key in normalState)) {\n normalState[key] = this[key];\n }\n }\n };\n Element.prototype.hasState = function () {\n return this.currentStates.length > 0;\n };\n Element.prototype.getState = function (name) {\n return this.states[name];\n };\n Element.prototype.ensureState = function (name) {\n var states = this.states;\n if (!states[name]) {\n states[name] = {};\n }\n return states[name];\n };\n Element.prototype.clearStates = function (noAnimation) {\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\n };\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation, forceUseHoverLayer) {\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\n var hasStates = this.hasState();\n if (!hasStates && toNormalState) {\n return;\n }\n var currentStates = this.currentStates;\n var animationCfg = this.stateTransition;\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\n return;\n }\n var state;\n if (this.stateProxy && !toNormalState) {\n state = this.stateProxy(stateName);\n }\n if (!state) {\n state = (this.states && this.states[stateName]);\n }\n if (!state && !toNormalState) {\n logError(\"State \" + stateName + \" not exists.\");\n return;\n }\n if (!toNormalState) {\n this.saveCurrentToNormalState(state);\n }\n var useHoverLayer = !!((state && state.hoverLayer) || forceUseHoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n if (toNormalState) {\n this.currentStates = [];\n this._normalState = {};\n }\n else {\n if (!keepCurrentStates) {\n this.currentStates = [stateName];\n }\n else {\n this.currentStates.push(stateName);\n }\n }\n this._updateAnimationTargets();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~REDRAW_BIT;\n }\n return state;\n };\n Element.prototype.useStates = function (states, noAnimation, forceUseHoverLayer) {\n if (!states.length) {\n this.clearStates();\n }\n else {\n var stateObjects = [];\n var currentStates = this.currentStates;\n var len = states.length;\n var notChange = len === currentStates.length;\n if (notChange) {\n for (var i = 0; i < len; i++) {\n if (states[i] !== currentStates[i]) {\n notChange = false;\n break;\n }\n }\n }\n if (notChange) {\n return;\n }\n for (var i = 0; i < len; i++) {\n var stateName = states[i];\n var stateObj = void 0;\n if (this.stateProxy) {\n stateObj = this.stateProxy(stateName, states);\n }\n if (!stateObj) {\n stateObj = this.states[stateName];\n }\n if (stateObj) {\n stateObjects.push(stateObj);\n }\n }\n var lastStateObj = stateObjects[len - 1];\n var useHoverLayer = !!((lastStateObj && lastStateObj.hoverLayer) || forceUseHoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n var mergedState = this._mergeStates(stateObjects);\n var animationCfg = this.stateTransition;\n this.saveCurrentToNormalState(mergedState);\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.useStates(states, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useStates(states, noAnimation, useHoverLayer);\n }\n this._updateAnimationTargets();\n this.currentStates = states.slice();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~REDRAW_BIT;\n }\n }\n };\n Element.prototype.isSilent = function () {\n var isSilent = this.silent;\n var ancestor = this.parent;\n while (!isSilent && ancestor) {\n if (ancestor.silent) {\n isSilent = true;\n break;\n }\n ancestor = ancestor.parent;\n }\n return isSilent;\n };\n Element.prototype._updateAnimationTargets = function () {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n if (animator.targetName) {\n animator.changeTarget(this[animator.targetName]);\n }\n }\n };\n Element.prototype.removeState = function (state) {\n var idx = indexOf(this.currentStates, state);\n if (idx >= 0) {\n var currentStates = this.currentStates.slice();\n currentStates.splice(idx, 1);\n this.useStates(currentStates);\n }\n };\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\n var currentStates = this.currentStates.slice();\n var idx = indexOf(currentStates, oldState);\n var newStateExists = indexOf(currentStates, newState) >= 0;\n if (idx >= 0) {\n if (!newStateExists) {\n currentStates[idx] = newState;\n }\n else {\n currentStates.splice(idx, 1);\n }\n }\n else if (forceAdd && !newStateExists) {\n currentStates.push(newState);\n }\n this.useStates(currentStates);\n };\n Element.prototype.toggleState = function (state, enable) {\n if (enable) {\n this.useState(state, true);\n }\n else {\n this.removeState(state);\n }\n };\n Element.prototype._mergeStates = function (states) {\n var mergedState = {};\n var mergedTextConfig;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n extend(mergedState, state);\n if (state.textConfig) {\n mergedTextConfig = mergedTextConfig || {};\n extend(mergedTextConfig, state.textConfig);\n }\n }\n if (mergedTextConfig) {\n mergedState.textConfig = mergedTextConfig;\n }\n return mergedState;\n };\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n var needsRestoreToNormal = !(state && keepCurrentStates);\n if (state && state.textConfig) {\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\n extend(this.textConfig, state.textConfig);\n }\n else if (needsRestoreToNormal) {\n if (normalState.textConfig) {\n this.textConfig = normalState.textConfig;\n }\n }\n var transitionTarget = {};\n var hasTransition = false;\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\n var key = PRIMARY_STATES_KEYS[i];\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\n if (state && state[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = state[key];\n }\n else {\n this[key] = state[key];\n }\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = normalState[key];\n }\n else {\n this[key] = normalState[key];\n }\n }\n }\n }\n if (!transition) {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var targetName = animator.targetName;\n if (!animator.getLoop()) {\n animator.__changeFinalValue(targetName\n ? (state || normalState)[targetName]\n : (state || normalState));\n }\n }\n }\n if (hasTransition) {\n this._transitionState(stateName, transitionTarget, animationCfg);\n }\n };\n Element.prototype._attachComponent = function (componentEl) {\n if (componentEl.__zr && !componentEl.__hostTarget) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Text element has been added to zrender.');\n }\n return;\n }\n if (componentEl === this) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Recursive component attachment.');\n }\n return;\n }\n var zr = this.__zr;\n if (zr) {\n componentEl.addSelfToZr(zr);\n }\n componentEl.__zr = zr;\n componentEl.__hostTarget = this;\n };\n Element.prototype._detachComponent = function (componentEl) {\n if (componentEl.__zr) {\n componentEl.removeSelfFromZr(componentEl.__zr);\n }\n componentEl.__zr = null;\n componentEl.__hostTarget = null;\n };\n Element.prototype.getClipPath = function () {\n return this._clipPath;\n };\n Element.prototype.setClipPath = function (clipPath) {\n if (this._clipPath && this._clipPath !== clipPath) {\n this.removeClipPath();\n }\n this._attachComponent(clipPath);\n this._clipPath = clipPath;\n this.markRedraw();\n };\n Element.prototype.removeClipPath = function () {\n var clipPath = this._clipPath;\n if (clipPath) {\n this._detachComponent(clipPath);\n this._clipPath = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextContent = function () {\n return this._textContent;\n };\n Element.prototype.setTextContent = function (textEl) {\n var previousTextContent = this._textContent;\n if (previousTextContent === textEl) {\n return;\n }\n if (previousTextContent && previousTextContent !== textEl) {\n this.removeTextContent();\n }\n if (process.env.NODE_ENV !== 'production') {\n if (textEl.__zr && !textEl.__hostTarget) {\n throw new Error('Text element has been added to zrender.');\n }\n }\n textEl.innerTransformable = new Transformable();\n this._attachComponent(textEl);\n this._textContent = textEl;\n this.markRedraw();\n };\n Element.prototype.setTextConfig = function (cfg) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n extend(this.textConfig, cfg);\n this.markRedraw();\n };\n Element.prototype.removeTextConfig = function () {\n this.textConfig = null;\n this.markRedraw();\n };\n Element.prototype.removeTextContent = function () {\n var textEl = this._textContent;\n if (textEl) {\n textEl.innerTransformable = null;\n this._detachComponent(textEl);\n this._textContent = null;\n this._innerTextDefaultStyle = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextGuideLine = function () {\n return this._textGuide;\n };\n Element.prototype.setTextGuideLine = function (guideLine) {\n if (this._textGuide && this._textGuide !== guideLine) {\n this.removeTextGuideLine();\n }\n this._attachComponent(guideLine);\n this._textGuide = guideLine;\n this.markRedraw();\n };\n Element.prototype.removeTextGuideLine = function () {\n var textGuide = this._textGuide;\n if (textGuide) {\n this._detachComponent(textGuide);\n this._textGuide = null;\n this.markRedraw();\n }\n };\n Element.prototype.markRedraw = function () {\n this.__dirty |= REDRAW_BIT;\n var zr = this.__zr;\n if (zr) {\n if (this.__inHover) {\n zr.refreshHover();\n }\n else {\n zr.refresh();\n }\n }\n if (this.__hostTarget) {\n this.__hostTarget.markRedraw();\n }\n };\n Element.prototype.dirty = function () {\n this.markRedraw();\n };\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\n this.__inHover = inHover;\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.__inHover = inHover;\n }\n if (textGuide) {\n textGuide.__inHover = inHover;\n }\n };\n Element.prototype.addSelfToZr = function (zr) {\n if (this.__zr === zr) {\n return;\n }\n this.__zr = zr;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.addSelfToZr(zr);\n }\n if (this._textContent) {\n this._textContent.addSelfToZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.addSelfToZr(zr);\n }\n };\n Element.prototype.removeSelfFromZr = function (zr) {\n if (!this.__zr) {\n return;\n }\n this.__zr = null;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.removeSelfFromZr(zr);\n }\n if (this._textContent) {\n this._textContent.removeSelfFromZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.removeSelfFromZr(zr);\n }\n };\n Element.prototype.animate = function (key, loop, allowDiscreteAnimation) {\n var target = key ? this[key] : this;\n if (process.env.NODE_ENV !== 'production') {\n if (!target) {\n logError('Property \"'\n + key\n + '\" is not existed in element '\n + this.id);\n return;\n }\n }\n var animator = new Animator(target, loop, allowDiscreteAnimation);\n key && (animator.targetName = key);\n this.addAnimator(animator, key);\n return animator;\n };\n Element.prototype.addAnimator = function (animator, key) {\n var zr = this.__zr;\n var el = this;\n animator.during(function () {\n el.updateDuringAnimation(key);\n }).done(function () {\n var animators = el.animators;\n var idx = indexOf(animators, animator);\n if (idx >= 0) {\n animators.splice(idx, 1);\n }\n });\n this.animators.push(animator);\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n zr && zr.wakeUp();\n };\n Element.prototype.updateDuringAnimation = function (key) {\n this.markRedraw();\n };\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\n var animators = this.animators;\n var len = animators.length;\n var leftAnimators = [];\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n if (!scope || scope === animator.scope) {\n animator.stop(forwardToLast);\n }\n else {\n leftAnimators.push(animator);\n }\n }\n this.animators = leftAnimators;\n return this;\n };\n Element.prototype.animateTo = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps);\n };\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps, true);\n };\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\n var animators = animateTo(this, target, cfg, animationProps);\n for (var i = 0; i < animators.length; i++) {\n animators[i].__fromStateTransition = stateName;\n }\n };\n Element.prototype.getBoundingRect = function () {\n return null;\n };\n Element.prototype.getPaintRect = function () {\n return null;\n };\n Element.initDefaultProps = (function () {\n var elProto = Element.prototype;\n elProto.type = 'element';\n elProto.name = '';\n elProto.ignore =\n elProto.silent =\n elProto.isGroup =\n elProto.draggable =\n elProto.dragging =\n elProto.ignoreClip =\n elProto.__inHover = false;\n elProto.__dirty = REDRAW_BIT;\n var logs = {};\n function logDeprecatedError(key, xKey, yKey) {\n if (!logs[key + xKey + yKey]) {\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\n logs[key + xKey + yKey] = true;\n }\n }\n function createLegacyProperty(key, privateKey, xKey, yKey) {\n Object.defineProperty(elProto, key, {\n get: function () {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n if (!this[privateKey]) {\n var pos = this[privateKey] = [];\n enhanceArray(this, pos);\n }\n return this[privateKey];\n },\n set: function (pos) {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n this[xKey] = pos[0];\n this[yKey] = pos[1];\n this[privateKey] = pos;\n enhanceArray(this, pos);\n }\n });\n function enhanceArray(self, pos) {\n Object.defineProperty(pos, 0, {\n get: function () {\n return self[xKey];\n },\n set: function (val) {\n self[xKey] = val;\n }\n });\n Object.defineProperty(pos, 1, {\n get: function () {\n return self[yKey];\n },\n set: function (val) {\n self[yKey] = val;\n }\n });\n }\n }\n if (Object.defineProperty) {\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\n }\n })();\n return Element;\n}());\nmixin(Element, Eventful);\nmixin(Element, Transformable);\nfunction animateTo(animatable, target, cfg, animationProps, reverse) {\n cfg = cfg || {};\n var animators = [];\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\n var finishCount = animators.length;\n var doneHappened = false;\n var cfgDone = cfg.done;\n var cfgAborted = cfg.aborted;\n var doneCb = function () {\n doneHappened = true;\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n var abortedCb = function () {\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n if (!finishCount) {\n cfgDone && cfgDone();\n }\n if (animators.length > 0 && cfg.during) {\n animators[0].during(function (target, percent) {\n cfg.during(percent);\n });\n }\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i];\n if (doneCb) {\n animator.done(doneCb);\n }\n if (abortedCb) {\n animator.aborted(abortedCb);\n }\n if (cfg.force) {\n animator.duration(cfg.duration);\n }\n animator.start(cfg.easing);\n }\n return animators;\n}\nfunction copyArrShallow(source, target, len) {\n for (var i = 0; i < len; i++) {\n source[i] = target[i];\n }\n}\nfunction is2DArray(value) {\n return isArrayLike(value[0]);\n}\nfunction copyValue(target, source, key) {\n if (isArrayLike(source[key])) {\n if (!isArrayLike(target[key])) {\n target[key] = [];\n }\n if (isTypedArray(source[key])) {\n var len = source[key].length;\n if (target[key].length !== len) {\n target[key] = new (source[key].constructor)(len);\n copyArrShallow(target[key], source[key], len);\n }\n }\n else {\n var sourceArr = source[key];\n var targetArr = target[key];\n var len0 = sourceArr.length;\n if (is2DArray(sourceArr)) {\n var len1 = sourceArr[0].length;\n for (var i = 0; i < len0; i++) {\n if (!targetArr[i]) {\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\n }\n else {\n copyArrShallow(targetArr[i], sourceArr[i], len1);\n }\n }\n }\n else {\n copyArrShallow(targetArr, sourceArr, len0);\n }\n targetArr.length = sourceArr.length;\n }\n }\n else {\n target[key] = source[key];\n }\n}\nfunction isValueSame(val1, val2) {\n return val1 === val2\n || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2);\n}\nfunction is1DArraySame(arr0, arr1) {\n var len = arr0.length;\n if (len !== arr1.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n return true;\n}\nfunction animateToShallow(animatable, topKey, animateObj, target, cfg, animationProps, animators, reverse) {\n var targetKeys = keys(target);\n var duration = cfg.duration;\n var delay = cfg.delay;\n var additive = cfg.additive;\n var setToFinal = cfg.setToFinal;\n var animateAll = !isObject(animationProps);\n var existsAnimators = animatable.animators;\n var animationKeys = [];\n for (var k = 0; k < targetKeys.length; k++) {\n var innerKey = targetKeys[k];\n var targetVal = target[innerKey];\n if (targetVal != null && animateObj[innerKey] != null\n && (animateAll || animationProps[innerKey])) {\n if (isObject(targetVal)\n && !isArrayLike(targetVal)\n && !isGradientObject(targetVal)) {\n if (topKey) {\n if (!reverse) {\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n }\n continue;\n }\n animateToShallow(animatable, innerKey, animateObj[innerKey], targetVal, cfg, animationProps && animationProps[innerKey], animators, reverse);\n }\n else {\n animationKeys.push(innerKey);\n }\n }\n else if (!reverse) {\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n animationKeys.push(innerKey);\n }\n }\n var keyLen = animationKeys.length;\n if (!additive && keyLen) {\n for (var i = 0; i < existsAnimators.length; i++) {\n var animator = existsAnimators[i];\n if (animator.targetName === topKey) {\n var allAborted = animator.stopTracks(animationKeys);\n if (allAborted) {\n var idx = indexOf(existsAnimators, animator);\n existsAnimators.splice(idx, 1);\n }\n }\n }\n }\n if (!cfg.force) {\n animationKeys = filter(animationKeys, function (key) { return !isValueSame(target[key], animateObj[key]); });\n keyLen = animationKeys.length;\n }\n if (keyLen > 0\n || (cfg.force && !animators.length)) {\n var revertedSource = void 0;\n var reversedTarget = void 0;\n var sourceClone = void 0;\n if (reverse) {\n reversedTarget = {};\n if (setToFinal) {\n revertedSource = {};\n }\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animationKeys[i];\n reversedTarget[innerKey] = animateObj[innerKey];\n if (setToFinal) {\n revertedSource[innerKey] = target[innerKey];\n }\n else {\n animateObj[innerKey] = target[innerKey];\n }\n }\n }\n else if (setToFinal) {\n sourceClone = {};\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animationKeys[i];\n sourceClone[innerKey] = cloneValue(animateObj[innerKey]);\n copyValue(animateObj, target, innerKey);\n }\n }\n var animator = new Animator(animateObj, false, false, additive ? filter(existsAnimators, function (animator) { return animator.targetName === topKey; }) : null);\n animator.targetName = topKey;\n if (cfg.scope) {\n animator.scope = cfg.scope;\n }\n if (setToFinal && revertedSource) {\n animator.whenWithKeys(0, revertedSource, animationKeys);\n }\n if (sourceClone) {\n animator.whenWithKeys(0, sourceClone, animationKeys);\n }\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animationKeys).delay(delay || 0);\n animatable.addAnimator(animator, topKey);\n animators.push(animator);\n }\n}\nexport default Element;\n","import { __extends } from \"tslib\";\nimport * as zrUtil from '../core/util.js';\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar Group = (function (_super) {\n __extends(Group, _super);\n function Group(opts) {\n var _this = _super.call(this) || this;\n _this.isGroup = true;\n _this._children = [];\n _this.attr(opts);\n return _this;\n }\n Group.prototype.childrenRef = function () {\n return this._children;\n };\n Group.prototype.children = function () {\n return this._children.slice();\n };\n Group.prototype.childAt = function (idx) {\n return this._children[idx];\n };\n Group.prototype.childOfName = function (name) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n if (children[i].name === name) {\n return children[i];\n }\n }\n };\n Group.prototype.childCount = function () {\n return this._children.length;\n };\n Group.prototype.add = function (child) {\n if (child) {\n if (child !== this && child.parent !== this) {\n this._children.push(child);\n this._doAdd(child);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (child.__hostTarget) {\n throw 'This elemenet has been used as an attachment';\n }\n }\n }\n return this;\n };\n Group.prototype.addBefore = function (child, nextSibling) {\n if (child && child !== this && child.parent !== this\n && nextSibling && nextSibling.parent === this) {\n var children = this._children;\n var idx = children.indexOf(nextSibling);\n if (idx >= 0) {\n children.splice(idx, 0, child);\n this._doAdd(child);\n }\n }\n return this;\n };\n Group.prototype.replace = function (oldChild, newChild) {\n var idx = zrUtil.indexOf(this._children, oldChild);\n if (idx >= 0) {\n this.replaceAt(newChild, idx);\n }\n return this;\n };\n Group.prototype.replaceAt = function (child, index) {\n var children = this._children;\n var old = children[index];\n if (child && child !== this && child.parent !== this && child !== old) {\n children[index] = child;\n old.parent = null;\n var zr = this.__zr;\n if (zr) {\n old.removeSelfFromZr(zr);\n }\n this._doAdd(child);\n }\n return this;\n };\n Group.prototype._doAdd = function (child) {\n if (child.parent) {\n child.parent.remove(child);\n }\n child.parent = this;\n var zr = this.__zr;\n if (zr && zr !== child.__zr) {\n child.addSelfToZr(zr);\n }\n zr && zr.refresh();\n };\n Group.prototype.remove = function (child) {\n var zr = this.__zr;\n var children = this._children;\n var idx = zrUtil.indexOf(children, child);\n if (idx < 0) {\n return this;\n }\n children.splice(idx, 1);\n child.parent = null;\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n zr && zr.refresh();\n return this;\n };\n Group.prototype.removeAll = function () {\n var children = this._children;\n var zr = this.__zr;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n child.parent = null;\n }\n children.length = 0;\n return this;\n };\n Group.prototype.eachChild = function (cb, context) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n cb.call(context, child, i);\n }\n return this;\n };\n Group.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n var stopped = cb.call(context, child);\n if (child.isGroup && !stopped) {\n child.traverse(cb, context);\n }\n }\n return this;\n };\n Group.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.addSelfToZr(zr);\n }\n };\n Group.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.removeSelfFromZr(zr);\n }\n };\n Group.prototype.getBoundingRect = function (includeChildren) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = includeChildren || this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.ignore || child.invisible) {\n continue;\n }\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n BoundingRect.applyTransform(tmpRect, childRect, transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n return rect || tmpRect;\n };\n return Group;\n}(Element));\nGroup.prototype.type = 'group';\nexport default Group;\n","/*!\n* ZRender, a high performance 2d drawing library.\n*\n* Copyright (c) 2013, Baidu Inc.\n* All rights reserved.\n*\n* LICENSE\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\n*/\nimport env from './core/env.js';\nimport * as zrUtil from './core/util.js';\nimport Handler from './Handler.js';\nimport Storage from './Storage.js';\nimport Animation, { getTime } from './animation/Animation.js';\nimport HandlerProxy from './dom/HandlerProxy.js';\nimport { lum } from './tool/color.js';\nimport { DARK_MODE_THRESHOLD } from './config.js';\nimport Group from './graphic/Group.js';\nvar painterCtors = {};\nvar instances = {};\nfunction delInstance(id) {\n delete instances[id];\n}\nfunction isDarkMode(backgroundColor) {\n if (!backgroundColor) {\n return false;\n }\n if (typeof backgroundColor === 'string') {\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\n }\n else if (backgroundColor.colorStops) {\n var colorStops = backgroundColor.colorStops;\n var totalLum = 0;\n var len = colorStops.length;\n for (var i = 0; i < len; i++) {\n totalLum += lum(colorStops[i].color, 1);\n }\n totalLum /= len;\n return totalLum < DARK_MODE_THRESHOLD;\n }\n return false;\n}\nvar ZRender = (function () {\n function ZRender(id, dom, opts) {\n var _this = this;\n this._sleepAfterStill = 10;\n this._stillFrameAccum = 0;\n this._needsRefresh = true;\n this._needsRefreshHover = true;\n this._darkMode = false;\n opts = opts || {};\n this.dom = dom;\n this.id = id;\n var storage = new Storage();\n var rendererType = opts.renderer || 'canvas';\n if (!painterCtors[rendererType]) {\n rendererType = zrUtil.keys(painterCtors)[0];\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!painterCtors[rendererType]) {\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\n }\n }\n opts.useDirtyRect = opts.useDirtyRect == null\n ? false\n : opts.useDirtyRect;\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\n var ssrMode = opts.ssr || painter.ssrOnly;\n this.storage = storage;\n this.painter = painter;\n var handlerProxy = (!env.node && !env.worker && !ssrMode)\n ? new HandlerProxy(painter.getViewportRoot(), painter.root)\n : null;\n var useCoarsePointer = opts.useCoarsePointer;\n var usePointerSize = (useCoarsePointer == null || useCoarsePointer === 'auto')\n ? env.touchEventsSupported\n : !!useCoarsePointer;\n var defaultPointerSize = 44;\n var pointerSize;\n if (usePointerSize) {\n pointerSize = zrUtil.retrieve2(opts.pointerSize, defaultPointerSize);\n }\n this.handler = new Handler(storage, painter, handlerProxy, painter.root, pointerSize);\n this.animation = new Animation({\n stage: {\n update: ssrMode ? null : function () { return _this._flush(true); }\n }\n });\n if (!ssrMode) {\n this.animation.start();\n }\n }\n ZRender.prototype.add = function (el) {\n if (this._disposed || !el) {\n return;\n }\n this.storage.addRoot(el);\n el.addSelfToZr(this);\n this.refresh();\n };\n ZRender.prototype.remove = function (el) {\n if (this._disposed || !el) {\n return;\n }\n this.storage.delRoot(el);\n el.removeSelfFromZr(this);\n this.refresh();\n };\n ZRender.prototype.configLayer = function (zLevel, config) {\n if (this._disposed) {\n return;\n }\n if (this.painter.configLayer) {\n this.painter.configLayer(zLevel, config);\n }\n this.refresh();\n };\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\n if (this._disposed) {\n return;\n }\n if (this.painter.setBackgroundColor) {\n this.painter.setBackgroundColor(backgroundColor);\n }\n this.refresh();\n this._backgroundColor = backgroundColor;\n this._darkMode = isDarkMode(backgroundColor);\n };\n ZRender.prototype.getBackgroundColor = function () {\n return this._backgroundColor;\n };\n ZRender.prototype.setDarkMode = function (darkMode) {\n this._darkMode = darkMode;\n };\n ZRender.prototype.isDarkMode = function () {\n return this._darkMode;\n };\n ZRender.prototype.refreshImmediately = function (fromInside) {\n if (this._disposed) {\n return;\n }\n if (!fromInside) {\n this.animation.update(true);\n }\n this._needsRefresh = false;\n this.painter.refresh();\n this._needsRefresh = false;\n };\n ZRender.prototype.refresh = function () {\n if (this._disposed) {\n return;\n }\n this._needsRefresh = true;\n this.animation.start();\n };\n ZRender.prototype.flush = function () {\n if (this._disposed) {\n return;\n }\n this._flush(false);\n };\n ZRender.prototype._flush = function (fromInside) {\n var triggerRendered;\n var start = getTime();\n if (this._needsRefresh) {\n triggerRendered = true;\n this.refreshImmediately(fromInside);\n }\n if (this._needsRefreshHover) {\n triggerRendered = true;\n this.refreshHoverImmediately();\n }\n var end = getTime();\n if (triggerRendered) {\n this._stillFrameAccum = 0;\n this.trigger('rendered', {\n elapsedTime: end - start\n });\n }\n else if (this._sleepAfterStill > 0) {\n this._stillFrameAccum++;\n if (this._stillFrameAccum > this._sleepAfterStill) {\n this.animation.stop();\n }\n }\n };\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\n this._sleepAfterStill = stillFramesCount;\n };\n ZRender.prototype.wakeUp = function () {\n if (this._disposed) {\n return;\n }\n this.animation.start();\n this._stillFrameAccum = 0;\n };\n ZRender.prototype.refreshHover = function () {\n this._needsRefreshHover = true;\n };\n ZRender.prototype.refreshHoverImmediately = function () {\n if (this._disposed) {\n return;\n }\n this._needsRefreshHover = false;\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\n this.painter.refreshHover();\n }\n };\n ZRender.prototype.resize = function (opts) {\n if (this._disposed) {\n return;\n }\n opts = opts || {};\n this.painter.resize(opts.width, opts.height);\n this.handler.resize();\n };\n ZRender.prototype.clearAnimation = function () {\n if (this._disposed) {\n return;\n }\n this.animation.clear();\n };\n ZRender.prototype.getWidth = function () {\n if (this._disposed) {\n return;\n }\n return this.painter.getWidth();\n };\n ZRender.prototype.getHeight = function () {\n if (this._disposed) {\n return;\n }\n return this.painter.getHeight();\n };\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\n if (this._disposed) {\n return;\n }\n this.handler.setCursorStyle(cursorStyle);\n };\n ZRender.prototype.findHover = function (x, y) {\n if (this._disposed) {\n return;\n }\n return this.handler.findHover(x, y);\n };\n ZRender.prototype.on = function (eventName, eventHandler, context) {\n if (!this._disposed) {\n this.handler.on(eventName, eventHandler, context);\n }\n return this;\n };\n ZRender.prototype.off = function (eventName, eventHandler) {\n if (this._disposed) {\n return;\n }\n this.handler.off(eventName, eventHandler);\n };\n ZRender.prototype.trigger = function (eventName, event) {\n if (this._disposed) {\n return;\n }\n this.handler.trigger(eventName, event);\n };\n ZRender.prototype.clear = function () {\n if (this._disposed) {\n return;\n }\n var roots = this.storage.getRoots();\n for (var i = 0; i < roots.length; i++) {\n if (roots[i] instanceof Group) {\n roots[i].removeSelfFromZr(this);\n }\n }\n this.storage.delAllRoots();\n this.painter.clear();\n };\n ZRender.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n this.animation.stop();\n this.clear();\n this.storage.dispose();\n this.painter.dispose();\n this.handler.dispose();\n this.animation =\n this.storage =\n this.painter =\n this.handler = null;\n this._disposed = true;\n delInstance(this.id);\n };\n return ZRender;\n}());\nexport function init(dom, opts) {\n var zr = new ZRender(zrUtil.guid(), dom, opts);\n instances[zr.id] = zr;\n return zr;\n}\nexport function dispose(zr) {\n zr.dispose();\n}\nexport function disposeAll() {\n for (var key in instances) {\n if (instances.hasOwnProperty(key)) {\n instances[key].dispose();\n }\n }\n instances = {};\n}\nexport function getInstance(id) {\n return instances[id];\n}\nexport function registerPainter(name, Ctor) {\n painterCtors[name] = Ctor;\n}\nvar ssrDataGetter;\nexport function getElementSSRData(el) {\n if (typeof ssrDataGetter === 'function') {\n return ssrDataGetter(el);\n }\n}\nexport function registerSSRDataGetter(getter) {\n ssrDataGetter = getter;\n}\nexport var version = '5.6.0';\n;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/*\n* A third-party license is embedded for some of the code in this file:\n* The method \"quantile\" was copied from \"d3.js\".\n* (See more details in the comment of the method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar RADIAN_EPSILON = 1e-4;\n// Although chrome already enlarge this number to 100 for `toFixed`, but\n// we sill follow the spec for compatibility.\nvar ROUND_SUPPORTED_PRECISION_MAX = 20;\nfunction _trim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n/**\n * Linear mapping a value from domain to range\n * @param val\n * @param domain Domain extent domain[0] can be bigger than domain[1]\n * @param range Range extent range[0] can be bigger than range[1]\n * @param clamp Default to be false\n */\nexport function linearMap(val, domain, range, clamp) {\n var d0 = domain[0];\n var d1 = domain[1];\n var r0 = range[0];\n var r1 = range[1];\n var subDomain = d1 - d0;\n var subRange = r1 - r0;\n if (subDomain === 0) {\n return subRange === 0 ? r0 : (r0 + r1) / 2;\n }\n // Avoid accuracy problem in edge, such as\n // 146.39 - 62.83 === 83.55999999999999.\n // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError\n // It is a little verbose for efficiency considering this method\n // is a hotspot.\n if (clamp) {\n if (subDomain > 0) {\n if (val <= d0) {\n return r0;\n } else if (val >= d1) {\n return r1;\n }\n } else {\n if (val >= d0) {\n return r0;\n } else if (val <= d1) {\n return r1;\n }\n }\n } else {\n if (val === d0) {\n return r0;\n }\n if (val === d1) {\n return r1;\n }\n }\n return (val - d0) / subDomain * subRange + r0;\n}\n/**\n * Convert a percent string to absolute number.\n * Returns NaN if percent is not a valid string or number\n */\nexport function parsePercent(percent, all) {\n switch (percent) {\n case 'center':\n case 'middle':\n percent = '50%';\n break;\n case 'left':\n case 'top':\n percent = '0%';\n break;\n case 'right':\n case 'bottom':\n percent = '100%';\n break;\n }\n if (zrUtil.isString(percent)) {\n if (_trim(percent).match(/%$/)) {\n return parseFloat(percent) / 100 * all;\n }\n return parseFloat(percent);\n }\n return percent == null ? NaN : +percent;\n}\nexport function round(x, precision, returnStr) {\n if (precision == null) {\n precision = 10;\n }\n // Avoid range error\n precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX);\n // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01'\n x = (+x).toFixed(precision);\n return returnStr ? x : +x;\n}\n/**\n * Inplacd asc sort arr.\n * The input arr will be modified.\n */\nexport function asc(arr) {\n arr.sort(function (a, b) {\n return a - b;\n });\n return arr;\n}\n/**\n * Get precision.\n */\nexport function getPrecision(val) {\n val = +val;\n if (isNaN(val)) {\n return 0;\n }\n // It is much faster than methods converting number to string as follows\n // let tmp = val.toString();\n // return tmp.length - 1 - tmp.indexOf('.');\n // especially when precision is low\n // Notice:\n // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`.\n // (see https://jsbench.me/2vkpcekkvw/1)\n // (2) If the val is less than for example 1e-15, the result may be incorrect.\n // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`)\n if (val > 1e-14) {\n var e = 1;\n for (var i = 0; i < 15; i++, e *= 10) {\n if (Math.round(val * e) / e === val) {\n return i;\n }\n }\n }\n return getPrecisionSafe(val);\n}\n/**\n * Get precision with slow but safe method\n */\nexport function getPrecisionSafe(val) {\n // toLowerCase for: '3.4E-12'\n var str = val.toString().toLowerCase();\n // Consider scientific notation: '3.4e-12' '3.4e+12'\n var eIndex = str.indexOf('e');\n var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0;\n var significandPartLen = eIndex > 0 ? eIndex : str.length;\n var dotIndex = str.indexOf('.');\n var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex;\n return Math.max(0, decimalPartLen - exp);\n}\n/**\n * Minimal dicernible data precisioin according to a single pixel.\n */\nexport function getPixelPrecision(dataExtent, pixelExtent) {\n var log = Math.log;\n var LN10 = Math.LN10;\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\n // toFixed() digits argument must be between 0 and 20.\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\n return !isFinite(precision) ? 20 : precision;\n}\n/**\n * Get a data of given precision, assuring the sum of percentages\n * in valueList is 1.\n * The largest remainder method is used.\n * https://en.wikipedia.org/wiki/Largest_remainder_method\n *\n * @param valueList a list of all data\n * @param idx index of the data to be processed in valueList\n * @param precision integer number showing digits of precision\n * @return percent ranging from 0 to 100\n */\nexport function getPercentWithPrecision(valueList, idx, precision) {\n if (!valueList[idx]) {\n return 0;\n }\n var seats = getPercentSeats(valueList, precision);\n return seats[idx] || 0;\n}\n/**\n * Get a data of given precision, assuring the sum of percentages\n * in valueList is 1.\n * The largest remainder method is used.\n * https://en.wikipedia.org/wiki/Largest_remainder_method\n *\n * @param valueList a list of all data\n * @param precision integer number showing digits of precision\n * @return {Array}\n */\nexport function getPercentSeats(valueList, precision) {\n var sum = zrUtil.reduce(valueList, function (acc, val) {\n return acc + (isNaN(val) ? 0 : val);\n }, 0);\n if (sum === 0) {\n return [];\n }\n var digits = Math.pow(10, precision);\n var votesPerQuota = zrUtil.map(valueList, function (val) {\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\n });\n var targetSeats = digits * 100;\n var seats = zrUtil.map(votesPerQuota, function (votes) {\n // Assign automatic seats.\n return Math.floor(votes);\n });\n var currentSum = zrUtil.reduce(seats, function (acc, val) {\n return acc + val;\n }, 0);\n var remainder = zrUtil.map(votesPerQuota, function (votes, idx) {\n return votes - seats[idx];\n });\n // Has remainding votes.\n while (currentSum < targetSeats) {\n // Find next largest remainder.\n var max = Number.NEGATIVE_INFINITY;\n var maxId = null;\n for (var i = 0, len = remainder.length; i < len; ++i) {\n if (remainder[i] > max) {\n max = remainder[i];\n maxId = i;\n }\n }\n // Add a vote to max remainder.\n ++seats[maxId];\n remainder[maxId] = 0;\n ++currentSum;\n }\n return zrUtil.map(seats, function (seat) {\n return seat / digits;\n });\n}\n/**\n * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004\n * See \n */\nexport function addSafe(val0, val1) {\n var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1));\n // const multiplier = Math.pow(10, maxPrecision);\n // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier;\n var sum = val0 + val1;\n // // PENDING: support more?\n return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum : round(sum, maxPrecision);\n}\n// Number.MAX_SAFE_INTEGER, ie do not support.\nexport var MAX_SAFE_INTEGER = 9007199254740991;\n/**\n * To 0 - 2 * PI, considering negative radian.\n */\nexport function remRadian(radian) {\n var pi2 = Math.PI * 2;\n return (radian % pi2 + pi2) % pi2;\n}\n/**\n * @param {type} radian\n * @return {boolean}\n */\nexport function isRadianAroundZero(val) {\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\n}\n// eslint-disable-next-line\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // jshint ignore:line\n/**\n * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`\n * These values can be accepted:\n * + An instance of Date, represent a time in its own time zone.\n * + Or string in a subset of ISO 8601, only including:\n * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',\n * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',\n * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',\n * all of which will be treated as local time if time zone is not specified\n * (see ).\n * + Or other string format, including (all of which will be treated as local time):\n * '2012', '2012-3-1', '2012/3/1', '2012/03/01',\n * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'\n * + a timestamp, which represent a time in UTC.\n * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.\n */\nexport function parseDate(value) {\n if (value instanceof Date) {\n return value;\n } else if (zrUtil.isString(value)) {\n // Different browsers parse date in different way, so we parse it manually.\n // Some other issues:\n // new Date('1970-01-01') is UTC,\n // new Date('1970/01/01') and new Date('1970-1-01') is local.\n // See issue #3623\n var match = TIME_REG.exec(value);\n if (!match) {\n // return Invalid Date.\n return new Date(NaN);\n }\n // Use local time when no timezone offset is specified.\n if (!match[8]) {\n // match[n] can only be string or undefined.\n // But take care of '12' + 1 => '121'.\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0);\n }\n // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\n // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\n // For example, system timezone is set as \"Time Zone: America/Toronto\",\n // then these code will get different result:\n // `new Date(1478411999999).getTimezoneOffset(); // get 240`\n // `new Date(1478412000000).getTimezoneOffset(); // get 300`\n // So we should not use `new Date`, but use `Date.UTC`.\n else {\n var hour = +match[4] || 0;\n if (match[8].toUpperCase() !== 'Z') {\n hour -= +match[8].slice(0, 3);\n }\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0));\n }\n } else if (value == null) {\n return new Date(NaN);\n }\n return new Date(Math.round(value));\n}\n/**\n * Quantity of a number. e.g. 0.1, 1, 10, 100\n *\n * @param val\n * @return\n */\nexport function quantity(val) {\n return Math.pow(10, quantityExponent(val));\n}\n/**\n * Exponent of the quantity of a number\n * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3\n *\n * @param val non-negative value\n * @return\n */\nexport function quantityExponent(val) {\n if (val === 0) {\n return 0;\n }\n var exp = Math.floor(Math.log(val) / Math.LN10);\n /**\n * exp is expected to be the rounded-down result of the base-10 log of val.\n * But due to the precision loss with Math.log(val), we need to restore it\n * using 10^exp to make sure we can get val back from exp. #11249\n */\n if (val / Math.pow(10, exp) >= 10) {\n exp++;\n }\n return exp;\n}\n/**\n * find a “nice” number approximately equal to x. Round the number if round = true,\n * take ceiling if round = false. The primary observation is that the “nicest”\n * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.\n *\n * See \"Nice Numbers for Graph Labels\" of Graphic Gems.\n *\n * @param val Non-negative value.\n * @param round\n * @return Niced number\n */\nexport function nice(val, round) {\n var exponent = quantityExponent(val);\n var exp10 = Math.pow(10, exponent);\n var f = val / exp10; // 1 <= f < 10\n var nf;\n if (round) {\n if (f < 1.5) {\n nf = 1;\n } else if (f < 2.5) {\n nf = 2;\n } else if (f < 4) {\n nf = 3;\n } else if (f < 7) {\n nf = 5;\n } else {\n nf = 10;\n }\n } else {\n if (f < 1) {\n nf = 1;\n } else if (f < 2) {\n nf = 2;\n } else if (f < 3) {\n nf = 3;\n } else if (f < 5) {\n nf = 5;\n } else {\n nf = 10;\n }\n }\n val = nf * exp10;\n // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).\n // 20 is the uppper bound of toFixed.\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\n}\n/**\n * This code was copied from \"d3.js\"\n * .\n * See the license statement at the head of this file.\n * @param ascArr\n */\nexport function quantile(ascArr, p) {\n var H = (ascArr.length - 1) * p + 1;\n var h = Math.floor(H);\n var v = +ascArr[h - 1];\n var e = H - h;\n return e ? v + e * (ascArr[h] - v) : v;\n}\n/**\n * Order intervals asc, and split them when overlap.\n * expect(numberUtil.reformIntervals([\n * {interval: [18, 62], close: [1, 1]},\n * {interval: [-Infinity, -70], close: [0, 0]},\n * {interval: [-70, -26], close: [1, 1]},\n * {interval: [-26, 18], close: [1, 1]},\n * {interval: [62, 150], close: [1, 1]},\n * {interval: [106, 150], close: [1, 1]},\n * {interval: [150, Infinity], close: [0, 0]}\n * ])).toEqual([\n * {interval: [-Infinity, -70], close: [0, 0]},\n * {interval: [-70, -26], close: [1, 1]},\n * {interval: [-26, 18], close: [0, 1]},\n * {interval: [18, 62], close: [0, 1]},\n * {interval: [62, 150], close: [0, 1]},\n * {interval: [150, Infinity], close: [0, 0]}\n * ]);\n * @param list, where `close` mean open or close\n * of the interval, and Infinity can be used.\n * @return The origin list, which has been reformed.\n */\nexport function reformIntervals(list) {\n list.sort(function (a, b) {\n return littleThan(a, b, 0) ? -1 : 1;\n });\n var curr = -Infinity;\n var currClose = 1;\n for (var i = 0; i < list.length;) {\n var interval = list[i].interval;\n var close_1 = list[i].close;\n for (var lg = 0; lg < 2; lg++) {\n if (interval[lg] <= curr) {\n interval[lg] = curr;\n close_1[lg] = !lg ? 1 - currClose : 1;\n }\n curr = interval[lg];\n currClose = close_1[lg];\n }\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\n list.splice(i, 1);\n } else {\n i++;\n }\n }\n return list;\n function littleThan(a, b, lg) {\n return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1));\n }\n}\n/**\n * [Numeric is defined as]:\n * `parseFloat(val) == val`\n * For example:\n * numeric:\n * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,\n * and they rounded by white-spaces or line-terminal like ' -123 \\n ' (see es spec)\n * not-numeric:\n * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',\n * empty string, string with only white-spaces or line-terminal (see es spec),\n * 0x12, '0x12', '-0x12', 012, '012', '-012',\n * non-string, ...\n *\n * @test See full test cases in `test/ut/spec/util/number.js`.\n * @return Must be a typeof number. If not numeric, return NaN.\n */\nexport function numericToNumber(val) {\n var valFloat = parseFloat(val);\n return valFloat == val // eslint-disable-line eqeqeq\n && (valFloat !== 0 || !zrUtil.isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '.\n ? valFloat : NaN;\n}\n/**\n * Definition of \"numeric\": see `numericToNumber`.\n */\nexport function isNumeric(val) {\n return !isNaN(numericToNumber(val));\n}\n/**\n * Use random base to prevent users hard code depending on\n * this auto generated marker id.\n * @return An positive integer.\n */\nexport function getRandomIdBase() {\n return Math.round(Math.random() * 9);\n}\n/**\n * Get the greatest common divisor.\n *\n * @param {number} a one number\n * @param {number} b the other number\n */\nexport function getGreatestCommonDividor(a, b) {\n if (b === 0) {\n return a;\n }\n return getGreatestCommonDividor(b, a % b);\n}\n/**\n * Get the least common multiple.\n *\n * @param {number} a one number\n * @param {number} b the other number\n */\nexport function getLeastCommonMultiple(a, b) {\n if (a == null) {\n return b;\n }\n if (b == null) {\n return a;\n }\n return a * b / getGreatestCommonDividor(a, b);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { map, isString, isFunction, eqNaN, isRegExp } from 'zrender/lib/core/util.js';\nvar ECHARTS_PREFIX = '[ECharts] ';\nvar storedLogs = {};\nvar hasConsole = typeof console !== 'undefined'\n// eslint-disable-next-line\n&& console.warn && console.log;\nfunction outputLog(type, str, onlyOnce) {\n if (hasConsole) {\n if (onlyOnce) {\n if (storedLogs[str]) {\n return;\n }\n storedLogs[str] = true;\n }\n // eslint-disable-next-line\n console[type](ECHARTS_PREFIX + str);\n }\n}\nexport function log(str, onlyOnce) {\n outputLog('log', str, onlyOnce);\n}\nexport function warn(str, onlyOnce) {\n outputLog('warn', str, onlyOnce);\n}\nexport function error(str, onlyOnce) {\n outputLog('error', str, onlyOnce);\n}\nexport function deprecateLog(str) {\n if (process.env.NODE_ENV !== 'production') {\n // Not display duplicate message.\n outputLog('warn', 'DEPRECATED: ' + str, true);\n }\n}\nexport function deprecateReplaceLog(oldOpt, newOpt, scope) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\n }\n}\n/**\n * If in __DEV__ environment, get console printable message for users hint.\n * Parameters are separated by ' '.\n * @usage\n * makePrintable('This is an error on', someVar, someObj);\n *\n * @param hintInfo anything about the current execution context to hint users.\n * @throws Error\n */\nexport function makePrintable() {\n var hintInfo = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n hintInfo[_i] = arguments[_i];\n }\n var msg = '';\n if (process.env.NODE_ENV !== 'production') {\n // Fuzzy stringify for print.\n // This code only exist in dev environment.\n var makePrintableStringIfPossible_1 = function (val) {\n return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null;\n };\n msg = map(hintInfo, function (arg) {\n if (isString(arg)) {\n // Print without quotation mark for some statement.\n return arg;\n } else {\n var printableStr = makePrintableStringIfPossible_1(arg);\n if (printableStr != null) {\n return printableStr;\n } else if (typeof JSON !== 'undefined' && JSON.stringify) {\n try {\n return JSON.stringify(arg, function (n, val) {\n var printableStr = makePrintableStringIfPossible_1(val);\n return printableStr == null ? val : printableStr;\n });\n // In most cases the info object is small, so do not line break.\n } catch (err) {\n return '?';\n }\n } else {\n return '?';\n }\n }\n }).join(' ');\n }\n return msg;\n}\n/**\n * @throws Error\n */\nexport function throwError(msg) {\n throw new Error(msg);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isObject, isArray, createHashMap, map, assert, isString, indexOf, isStringSafe, isNumber } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { isNumeric, getRandomIdBase, getPrecision, round } from './number.js';\nimport { warn } from './log.js';\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\n/**\n * Make the name displayable. But we should\n * make sure it is not duplicated with user\n * specified name, so use '\\0';\n */\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\nvar INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\n/**\n * If value is not array, then translate it to array.\n * @param {*} value\n * @return {Array} [value] or value\n */\nexport function normalizeToArray(value) {\n return value instanceof Array ? value : value == null ? [] : [value];\n}\n/**\n * Sync default option between normal and emphasis like `position` and `show`\n * In case some one will write code like\n * label: {\n * show: false,\n * position: 'outside',\n * fontSize: 18\n * },\n * emphasis: {\n * label: { show: true }\n * }\n */\nexport function defaultEmphasis(opt, key, subOpts) {\n // Caution: performance sensitive.\n if (opt) {\n opt[key] = opt[key] || {};\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[key] = opt.emphasis[key] || {};\n // Default emphasis option from normal\n for (var i = 0, len = subOpts.length; i < len; i++) {\n var subOptName = subOpts[i];\n if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) {\n opt.emphasis[key][subOptName] = opt[key][subOptName];\n }\n }\n }\n}\nexport var TEXT_STYLE_OPTIONS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'];\n// modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([\n// 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',\n// 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\n// // FIXME: deprecated, check and remove it.\n// 'textStyle'\n// ]);\n/**\n * The method does not ensure performance.\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method retrieves value from data.\n */\nexport function getDataItemValue(dataItem) {\n return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;\n}\n/**\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method determine if dataItem has extra option besides value\n */\nexport function isDataItemOption(dataItem) {\n return isObject(dataItem) && !(dataItem instanceof Array);\n // // markLine data can be array\n // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));\n}\n\n;\n/**\n * Mapping to existings for merge.\n *\n * Mode \"normalMege\":\n * The mapping result (merge result) will keep the order of the existing\n * component, rather than the order of new option. Because we should ensure\n * some specified index reference (like xAxisIndex) keep work.\n * And in most cases, \"merge option\" is used to update partial option but not\n * be expected to change the order.\n *\n * Mode \"replaceMege\":\n * (1) Only the id mapped components will be merged.\n * (2) Other existing components (except internal components) will be removed.\n * (3) Other new options will be used to create new component.\n * (4) The index of the existing components will not be modified.\n * That means their might be \"hole\" after the removal.\n * The new components are created first at those available index.\n *\n * Mode \"replaceAll\":\n * This mode try to support that reproduce an echarts instance from another\n * echarts instance (via `getOption`) in some simple cases.\n * In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`,\n * which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is,\n * the \"hole\" in `newCmptOptions` will also be kept.\n * On the contrary, other modes try best to eliminate holes.\n * PENDING: This is an experimental mode yet.\n *\n * @return See the comment of .\n */\nexport function mappingToExists(existings, newCmptOptions, mode) {\n var isNormalMergeMode = mode === 'normalMerge';\n var isReplaceMergeMode = mode === 'replaceMerge';\n var isReplaceAllMode = mode === 'replaceAll';\n existings = existings || [];\n newCmptOptions = (newCmptOptions || []).slice();\n var existingIdIdxMap = createHashMap();\n // Validate id and name on user input option.\n each(newCmptOptions, function (cmptOption, index) {\n if (!isObject(cmptOption)) {\n newCmptOptions[index] = null;\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // There is some legacy case that name is set as `false`.\n // But should work normally rather than throw error.\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\n warnInvalidateIdOrName(cmptOption.id);\n }\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\n warnInvalidateIdOrName(cmptOption.name);\n }\n }\n });\n var result = prepareResult(existings, existingIdIdxMap, mode);\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\n }\n if (isNormalMergeMode) {\n mappingByName(result, newCmptOptions);\n }\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\n } else if (isReplaceAllMode) {\n mappingInReplaceAllMode(result, newCmptOptions);\n }\n makeIdAndName(result);\n // The array `result` MUST NOT contain elided items, otherwise the\n // forEach will omit those items and result in incorrect result.\n return result;\n}\nfunction prepareResult(existings, existingIdIdxMap, mode) {\n var result = [];\n if (mode === 'replaceAll') {\n return result;\n }\n // Do not use native `map` to in case that the array `existings`\n // contains elided items, which will be omitted.\n for (var index = 0; index < existings.length; index++) {\n var existing = existings[index];\n // Because of replaceMerge, `existing` may be null/undefined.\n if (existing && existing.id != null) {\n existingIdIdxMap.set(existing.id, index);\n }\n // For non-internal-componnets:\n // Mode \"normalMerge\": all existings kept.\n // Mode \"replaceMerge\": all existing removed unless mapped by id.\n // For internal-components:\n // go with \"replaceMerge\" approach in both mode.\n result.push({\n existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing,\n newOption: null,\n keyInfo: null,\n brandNew: null\n });\n }\n return result;\n}\nfunction mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\n // Mapping by id if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.id == null) {\n return;\n }\n var optionId = makeComparableKey(cmptOption.id);\n var existingIdx = existingIdIdxMap.get(optionId);\n if (existingIdx != null) {\n var resultItem = result[existingIdx];\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\n resultItem.newOption = cmptOption;\n // In both mode, if id matched, new option will be merged to\n // the existings rather than creating new component model.\n resultItem.existing = existings[existingIdx];\n newCmptOptions[index] = null;\n }\n });\n}\nfunction mappingByName(result, newCmptOptions) {\n // Mapping by name if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.name == null) {\n return;\n }\n for (var i = 0; i < result.length; i++) {\n var existing = result[i].existing;\n if (!result[i].newOption // Consider name: two map to one.\n // Can not match when both ids existing but different.\n && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) {\n result[i].newOption = cmptOption;\n newCmptOptions[index] = null;\n return;\n }\n }\n });\n}\nfunction mappingByIndex(result, newCmptOptions, brandNew) {\n each(newCmptOptions, function (cmptOption) {\n if (!cmptOption) {\n return;\n }\n // Find the first place that not mapped by id and not internal component (consider the \"hole\").\n var resultItem;\n var nextIdx = 0;\n while (\n // Be `!resultItem` only when `nextIdx >= result.length`.\n (resultItem = result[nextIdx]\n // (1) Existing models that already have id should be able to mapped to. Because\n // after mapping performed, model will always be assigned with an id if user not given.\n // After that all models have id.\n // (2) If new option has id, it can only set to a hole or append to the last. It should\n // not be merged to the existings with different id. Because id should not be overwritten.\n // (3) Name can be overwritten, because axis use name as 'show label text'.\n ) && (resultItem.newOption || isComponentIdInternal(resultItem.existing) ||\n // In mode \"replaceMerge\", here no not-mapped-non-internal-existing.\n resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) {\n nextIdx++;\n }\n if (resultItem) {\n resultItem.newOption = cmptOption;\n resultItem.brandNew = brandNew;\n } else {\n result.push({\n newOption: cmptOption,\n brandNew: brandNew,\n existing: null,\n keyInfo: null\n });\n }\n nextIdx++;\n });\n}\nfunction mappingInReplaceAllMode(result, newCmptOptions) {\n each(newCmptOptions, function (cmptOption) {\n // The feature \"reproduce\" requires \"hole\" will also reproduced\n // in case that component index referring are broken.\n result.push({\n newOption: cmptOption,\n brandNew: true,\n existing: null,\n keyInfo: null\n });\n });\n}\n/**\n * Make id and name for mapping result (result of mappingToExists)\n * into `keyInfo` field.\n */\nfunction makeIdAndName(mapResult) {\n // We use this id to hash component models and view instances\n // in echarts. id can be specified by user, or auto generated.\n // The id generation rule ensures new view instance are able\n // to mapped to old instance when setOption are called in\n // no-merge mode. So we generate model id by name and plus\n // type in view id.\n // name can be duplicated among components, which is convenient\n // to specify multi components (like series) by one name.\n // Ensure that each id is distinct.\n var idMap = createHashMap();\n each(mapResult, function (item) {\n var existing = item.existing;\n existing && idMap.set(existing.id, item);\n });\n each(mapResult, function (item) {\n var opt = item.newOption;\n // Force ensure id not duplicated.\n assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\n opt && opt.id != null && idMap.set(opt.id, item);\n !item.keyInfo && (item.keyInfo = {});\n });\n // Make name and id.\n each(mapResult, function (item, index) {\n var existing = item.existing;\n var opt = item.newOption;\n var keyInfo = item.keyInfo;\n if (!isObject(opt)) {\n return;\n }\n // Name can be overwritten. Consider case: axis.name = '20km'.\n // But id generated by name will not be changed, which affect\n // only in that case: setOption with 'not merge mode' and view\n // instance will be recreated, which can be accepted.\n keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name\n // Avoid that different series has the same name,\n // because name may be used like in color pallet.\n : DUMMY_COMPONENT_NAME_PREFIX + index;\n if (existing) {\n keyInfo.id = makeComparableKey(existing.id);\n } else if (opt.id != null) {\n keyInfo.id = makeComparableKey(opt.id);\n } else {\n // Consider this situatoin:\n // optionA: [{name: 'a'}, {name: 'a'}, {..}]\n // optionB [{..}, {name: 'a'}, {name: 'a'}]\n // Series with the same name between optionA and optionB\n // should be mapped.\n var idNum = 0;\n do {\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\n } while (idMap.get(keyInfo.id));\n }\n idMap.set(keyInfo.id, item);\n });\n}\nfunction keyExistAndEqual(attr, obj1, obj2) {\n var key1 = convertOptionIdName(obj1[attr], null);\n var key2 = convertOptionIdName(obj2[attr], null);\n // See `MappingExistingItem`. `id` and `name` trade string equals to number.\n return key1 != null && key2 != null && key1 === key2;\n}\n/**\n * @return return null if not exist.\n */\nfunction makeComparableKey(val) {\n if (process.env.NODE_ENV !== 'production') {\n if (val == null) {\n throw new Error();\n }\n }\n return convertOptionIdName(val, '');\n}\nexport function convertOptionIdName(idOrName, defaultValue) {\n if (idOrName == null) {\n return defaultValue;\n }\n return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + '' : defaultValue;\n}\nfunction warnInvalidateIdOrName(idOrName) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\n }\n}\nfunction isValidIdOrName(idOrName) {\n return isStringSafe(idOrName) || isNumeric(idOrName);\n}\nexport function isNameSpecified(componentModel) {\n var name = componentModel.name;\n // Is specified when `indexOf` get -1 or > 0.\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\n}\n/**\n * @public\n * @param {Object} cmptOption\n * @return {boolean}\n */\nexport function isComponentIdInternal(cmptOption) {\n return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\n}\nexport function makeInternalComponentId(idSuffix) {\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\n}\nexport function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\n // Set mainType and complete subType.\n each(mappingResult, function (item) {\n var newOption = item.newOption;\n if (isObject(newOption)) {\n item.keyInfo.mainType = mainType;\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\n }\n });\n}\nfunction determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\n var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType\n // Use determineSubType only when there is no existComponent.\n : componentModelCtor.determineSubType(mainType, newCmptOption);\n // tooltip, markline, markpoint may always has no subType\n return subType;\n}\n/**\n * A helper for removing duplicate items between batchA and batchB,\n * and in themselves, and categorize by series.\n *\n * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @return result: [resultBatchA, resultBatchB]\n */\nexport function compressBatches(batchA, batchB) {\n var mapA = {};\n var mapB = {};\n makeMap(batchA || [], mapA);\n makeMap(batchB || [], mapB, mapA);\n return [mapToArray(mapA), mapToArray(mapB)];\n function makeMap(sourceBatch, map, otherMap) {\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\n var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\n if (seriesId == null) {\n return;\n }\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\n var otherDataIndices = otherMap && otherMap[seriesId];\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\n var dataIndex = dataIndices[j];\n if (otherDataIndices && otherDataIndices[dataIndex]) {\n otherDataIndices[dataIndex] = null;\n } else {\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\n }\n }\n }\n }\n function mapToArray(map, isData) {\n var result = [];\n for (var i in map) {\n if (map.hasOwnProperty(i) && map[i] != null) {\n if (isData) {\n result.push(+i);\n } else {\n var dataIndices = mapToArray(map[i], true);\n dataIndices.length && result.push({\n seriesId: i,\n dataIndex: dataIndices\n });\n }\n }\n }\n return result;\n }\n}\n/**\n * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name\n * each of which can be Array or primary type.\n * @return dataIndex If not found, return undefined/null.\n */\nexport function queryDataIndex(data, payload) {\n if (payload.dataIndexInside != null) {\n return payload.dataIndexInside;\n } else if (payload.dataIndex != null) {\n return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) {\n return data.indexOfRawIndex(value);\n }) : data.indexOfRawIndex(payload.dataIndex);\n } else if (payload.name != null) {\n return isArray(payload.name) ? map(payload.name, function (value) {\n return data.indexOfName(value);\n }) : data.indexOfName(payload.name);\n }\n}\n/**\n * Enable property storage to any host object.\n * Notice: Serialization is not supported.\n *\n * For example:\n * let inner = zrUitl.makeInner();\n *\n * function some1(hostObj) {\n * inner(hostObj).someProperty = 1212;\n * ...\n * }\n * function some2() {\n * let fields = inner(this);\n * fields.someProperty1 = 1212;\n * fields.someProperty2 = 'xx';\n * ...\n * }\n *\n * @return {Function}\n */\nexport function makeInner() {\n var key = '__ec_inner_' + innerUniqueIndex++;\n return function (hostObj) {\n return hostObj[key] || (hostObj[key] = {});\n };\n}\nvar innerUniqueIndex = getRandomIdBase();\n/**\n * The same behavior as `component.getReferringComponents`.\n */\nexport function parseFinder(ecModel, finderInput, opt) {\n var _a = preParseFinder(finderInput, opt),\n mainTypeSpecified = _a.mainTypeSpecified,\n queryOptionMap = _a.queryOptionMap,\n others = _a.others;\n var result = others;\n var defaultMainType = opt ? opt.defaultMainType : null;\n if (!mainTypeSpecified && defaultMainType) {\n queryOptionMap.set(defaultMainType, {});\n }\n queryOptionMap.each(function (queryOption, mainType) {\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\n useDefault: defaultMainType === mainType,\n enableAll: opt && opt.enableAll != null ? opt.enableAll : true,\n enableNone: opt && opt.enableNone != null ? opt.enableNone : true\n });\n result[mainType + 'Models'] = queryResult.models;\n result[mainType + 'Model'] = queryResult.models[0];\n });\n return result;\n}\nexport function preParseFinder(finderInput, opt) {\n var finder;\n if (isString(finderInput)) {\n var obj = {};\n obj[finderInput + 'Index'] = 0;\n finder = obj;\n } else {\n finder = finderInput;\n }\n var queryOptionMap = createHashMap();\n var others = {};\n var mainTypeSpecified = false;\n each(finder, function (value, key) {\n // Exclude 'dataIndex' and other illgal keys.\n if (key === 'dataIndex' || key === 'dataIndexInside') {\n others[key] = value;\n return;\n }\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\n var mainType = parsedKey[1];\n var queryType = (parsedKey[2] || '').toLowerCase();\n if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) {\n return;\n }\n mainTypeSpecified = mainTypeSpecified || !!mainType;\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\n queryOption[queryType] = value;\n });\n return {\n mainTypeSpecified: mainTypeSpecified,\n queryOptionMap: queryOptionMap,\n others: others\n };\n}\nexport var SINGLE_REFERRING = {\n useDefault: true,\n enableAll: false,\n enableNone: false\n};\nexport var MULTIPLE_REFERRING = {\n useDefault: false,\n enableAll: true,\n enableNone: true\n};\nexport function queryReferringComponents(ecModel, mainType, userOption, opt) {\n opt = opt || SINGLE_REFERRING;\n var indexOption = userOption.index;\n var idOption = userOption.id;\n var nameOption = userOption.name;\n var result = {\n models: null,\n specified: indexOption != null || idOption != null || nameOption != null\n };\n if (!result.specified) {\n // Use the first as default if `useDefault`.\n var firstCmpt = void 0;\n result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : [];\n return result;\n }\n if (indexOption === 'none' || indexOption === false) {\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\n result.models = [];\n return result;\n }\n // `queryComponents` will return all components if\n // both all of index/id/name are null/undefined.\n if (indexOption === 'all') {\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\n indexOption = idOption = nameOption = null;\n }\n result.models = ecModel.queryComponents({\n mainType: mainType,\n index: indexOption,\n id: idOption,\n name: nameOption\n });\n return result;\n}\nexport function setAttribute(dom, key, value) {\n dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;\n}\nexport function getAttribute(dom, key) {\n return dom.getAttribute ? dom.getAttribute(key) : dom[key];\n}\nexport function getTooltipRenderMode(renderModeOption) {\n if (renderModeOption === 'auto') {\n // Using html when `document` exists, use richText otherwise\n return env.domSupported ? 'html' : 'richText';\n } else {\n return renderModeOption || 'html';\n }\n}\n/**\n * Group a list by key.\n */\nexport function groupData(array, getKey // return key\n) {\n var buckets = createHashMap();\n var keys = [];\n each(array, function (item) {\n var key = getKey(item);\n (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item);\n });\n return {\n keys: keys,\n buckets: buckets\n };\n}\n/**\n * Interpolate raw values of a series with percent\n *\n * @param data data\n * @param labelModel label model of the text element\n * @param sourceValue start value. May be null/undefined when init.\n * @param targetValue end value\n * @param percent 0~1 percentage; 0 uses start value while 1 uses end value\n * @return interpolated values\n * If `sourceValue` and `targetValue` are `number`, return `number`.\n * If `sourceValue` and `targetValue` are `string`, return `string`.\n * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.\n * Other cases do not supported.\n */\nexport function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\n var isAutoPrecision = precision == null || precision === 'auto';\n if (targetValue == null) {\n return targetValue;\n }\n if (isNumber(targetValue)) {\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\n return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision);\n } else if (isString(targetValue)) {\n return percent < 1 ? sourceValue : targetValue;\n } else {\n var interpolated = [];\n var leftArr = sourceValue;\n var rightArr = targetValue;\n var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length);\n for (var i = 0; i < length_1; ++i) {\n var info = data.getDimensionInfo(i);\n // Don't interpolate ordinal dims\n if (info && info.type === 'ordinal') {\n // In init, there is no `sourceValue`, but should better not to get undefined result.\n interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i];\n } else {\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\n var rightVal = rightArr[i];\n var value = interpolateNumber(leftVal, rightVal, percent);\n interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision);\n }\n }\n return interpolated;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar TYPE_DELIMITER = '.';\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\nvar IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\n/**\n * Notice, parseClassType('') should returns {main: '', sub: ''}\n * @public\n */\nexport function parseClassType(componentType) {\n var ret = {\n main: '',\n sub: ''\n };\n if (componentType) {\n var typeArr = componentType.split(TYPE_DELIMITER);\n ret.main = typeArr[0] || '';\n ret.sub = typeArr[1] || '';\n }\n return ret;\n}\n/**\n * @public\n */\nfunction checkClassType(componentType) {\n zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\n}\nexport function isExtendedClass(clz) {\n return !!(clz && clz[IS_EXTENDED_CLASS]);\n}\n/**\n * Implements `ExtendableConstructor` for `rootClz`.\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & ExtendableConstructor\n * enableClassExtend(Xxx as XxxConstructor);\n * ```\n */\nexport function enableClassExtend(rootClz, mandatoryMethods) {\n rootClz.$constructor = rootClz; // FIXME: not necessary?\n rootClz.extend = function (proto) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(mandatoryMethods, function (method) {\n if (!proto[method]) {\n console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.');\n }\n });\n }\n var superClass = this;\n var ExtendedClass;\n if (isESClass(superClass)) {\n ExtendedClass = /** @class */function (_super) {\n __extends(class_1, _super);\n function class_1() {\n return _super.apply(this, arguments) || this;\n }\n return class_1;\n }(superClass);\n } else {\n // For backward compat, we both support ts class inheritance and this\n // \"extend\" approach.\n // The constructor should keep the same behavior as ts class inheritance:\n // If this constructor/$constructor is not declared, auto invoke the super\n // constructor.\n // If this constructor/$constructor is declared, it is responsible for\n // calling the super constructor.\n ExtendedClass = function () {\n (proto.$constructor || superClass).apply(this, arguments);\n };\n zrUtil.inherits(ExtendedClass, this);\n }\n zrUtil.extend(ExtendedClass.prototype, proto);\n ExtendedClass[IS_EXTENDED_CLASS] = true;\n ExtendedClass.extend = this.extend;\n ExtendedClass.superCall = superCall;\n ExtendedClass.superApply = superApply;\n ExtendedClass.superClass = superClass;\n return ExtendedClass;\n };\n}\nfunction isESClass(fn) {\n return zrUtil.isFunction(fn) && /^class\\s/.test(Function.prototype.toString.call(fn));\n}\n/**\n * A work around to both support ts extend and this extend mechanism.\n * on sub-class.\n * @usage\n * ```ts\n * class Component { ... }\n * classUtil.enableClassExtend(Component);\n * classUtil.enableClassManagement(Component, {registerWhenExtend: true});\n *\n * class Series extends Component { ... }\n * // Without calling `markExtend`, `registerWhenExtend` will not work.\n * Component.markExtend(Series);\n * ```\n */\nexport function mountExtend(SubClz, SupperClz) {\n SubClz.extend = SupperClz.extend;\n}\n// A random offset.\nvar classBase = Math.round(Math.random() * 10);\n/**\n * Implements `CheckableConstructor` for `target`.\n * Can not use instanceof, consider different scope by\n * cross domain or es module import in ec extensions.\n * Mount a method \"isInstance()\" to Clz.\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & CheckableConstructor;\n * enableClassCheck(Xxx as XxxConstructor)\n * ```\n */\nexport function enableClassCheck(target) {\n var classAttr = ['__\\0is_clz', classBase++].join('_');\n target.prototype[classAttr] = true;\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(!target.isInstance, 'The method \"is\" can not be defined.');\n }\n target.isInstance = function (obj) {\n return !!(obj && obj[classAttr]);\n };\n}\n// superCall should have class info, which can not be fetched from 'this'.\n// Consider this case:\n// class A has method f,\n// class B inherits class A, overrides method f, f call superApply('f'),\n// class C inherits class B, does not override method f,\n// then when method of class C is called, dead loop occurred.\nfunction superCall(context, methodName) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return this.superClass.prototype[methodName].apply(context, args);\n}\nfunction superApply(context, methodName, args) {\n return this.superClass.prototype[methodName].apply(context, args);\n}\n/**\n * Implements `ClassManager` for `target`\n *\n * @usage\n * ```ts\n * class Xxx {}\n * type XxxConstructor = typeof Xxx & ClassManager\n * enableClassManagement(Xxx as XxxConstructor);\n * ```\n */\nexport function enableClassManagement(target) {\n /**\n * Component model classes\n * key: componentType,\n * value:\n * componentClass, when componentType is 'a'\n * or Object., when componentType is 'a.b'\n */\n var storage = {};\n target.registerClass = function (clz) {\n // `type` should not be a \"instance member\".\n // If using TS class, should better declared as `static type = 'series.pie'`.\n // otherwise users have to mount `type` on prototype manually.\n // For backward compat and enable instance visit type via `this.type`,\n // we still support fetch `type` from prototype.\n var componentFullType = clz.type || clz.prototype.type;\n if (componentFullType) {\n checkClassType(componentFullType);\n // If only static type declared, we assign it to prototype mandatorily.\n clz.prototype.type = componentFullType;\n var componentTypeInfo = parseClassType(componentFullType);\n if (!componentTypeInfo.sub) {\n if (process.env.NODE_ENV !== 'production') {\n if (storage[componentTypeInfo.main]) {\n console.warn(componentTypeInfo.main + ' exists.');\n }\n }\n storage[componentTypeInfo.main] = clz;\n } else if (componentTypeInfo.sub !== IS_CONTAINER) {\n var container = makeContainer(componentTypeInfo);\n container[componentTypeInfo.sub] = clz;\n }\n }\n return clz;\n };\n target.getClass = function (mainType, subType, throwWhenNotFound) {\n var clz = storage[mainType];\n if (clz && clz[IS_CONTAINER]) {\n clz = subType ? clz[subType] : null;\n }\n if (throwWhenNotFound && !clz) {\n throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.');\n }\n return clz;\n };\n target.getClassesByMainType = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var result = [];\n var obj = storage[componentTypeInfo.main];\n if (obj && obj[IS_CONTAINER]) {\n zrUtil.each(obj, function (o, type) {\n type !== IS_CONTAINER && result.push(o);\n });\n } else {\n result.push(obj);\n }\n return result;\n };\n target.hasClass = function (componentType) {\n // Just consider componentType.main.\n var componentTypeInfo = parseClassType(componentType);\n return !!storage[componentTypeInfo.main];\n };\n /**\n * @return Like ['aa', 'bb'], but can not be ['aa.xx']\n */\n target.getAllClassMainTypes = function () {\n var types = [];\n zrUtil.each(storage, function (obj, type) {\n types.push(type);\n });\n return types;\n };\n /**\n * If a main type is container and has sub types\n */\n target.hasSubTypes = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var obj = storage[componentTypeInfo.main];\n return obj && obj[IS_CONTAINER];\n };\n function makeContainer(componentTypeInfo) {\n var container = storage[componentTypeInfo.main];\n if (!container || !container[IS_CONTAINER]) {\n container = storage[componentTypeInfo.main] = {};\n container[IS_CONTAINER] = true;\n }\n return container;\n }\n}\n// /**\n// * @param {string|Array.} properties\n// */\n// export function setReadOnly(obj, properties) {\n// FIXME It seems broken in IE8 simulation of IE11\n// if (!zrUtil.isArray(properties)) {\n// properties = properties != null ? [properties] : [];\n// }\n// zrUtil.each(properties, function (prop) {\n// let value = obj[prop];\n// Object.defineProperty\n// && Object.defineProperty(obj, prop, {\n// value: value, writable: false\n// });\n// zrUtil.isArray(obj[prop])\n// && Object.freeze\n// && Object.freeze(obj[prop]);\n// });\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO Parse shadow style\n// TODO Only shallow path support\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function makeStyleMapper(properties, ignoreParent) {\n // Normalize\n for (var i = 0; i < properties.length; i++) {\n if (!properties[i][1]) {\n properties[i][1] = properties[i][0];\n }\n }\n ignoreParent = ignoreParent || false;\n return function (model, excludes, includes) {\n var style = {};\n for (var i = 0; i < properties.length; i++) {\n var propName = properties[i][1];\n if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) {\n continue;\n }\n var val = model.getShallow(propName, ignoreParent);\n if (val != null) {\n style[properties[i][0]] = val;\n }\n }\n // TODO Text or image?\n return style;\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var AREA_STYLE_KEY_MAP = [['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\n\nvar getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\nvar AreaStyleMixin = /** @class */function () {\n function AreaStyleMixin() {}\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\n return getAreaStyle(this, excludes, includes);\n };\n return AreaStyleMixin;\n}();\n;\nexport { AreaStyleMixin };","import LRU from '../../core/LRU.js';\nimport { platformApi } from '../../core/platform.js';\nvar globalImageCache = new LRU(50);\nexport function findExistImage(newImageOrSrc) {\n if (typeof newImageOrSrc === 'string') {\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n }\n else {\n return newImageOrSrc;\n }\n}\nexport function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\n if (!newImageOrSrc) {\n return image;\n }\n else if (typeof newImageOrSrc === 'string') {\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\n return image;\n }\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n }\n else {\n image = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad);\n image.__zrImageSrc = newImageOrSrc;\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n });\n }\n return image;\n }\n else {\n return newImageOrSrc;\n }\n}\nfunction imageOnLoad() {\n var cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\n var pendingWrap = cachedImgObj.pending[i];\n var cb = pendingWrap.cb;\n cb && cb(this, pendingWrap.cbPayload);\n pendingWrap.hostEl.dirty();\n }\n cachedImgObj.pending.length = 0;\n}\nexport function isImageReady(image) {\n return image && image.width && image.height;\n}\n","import * as imageHelper from '../helper/image.js';\nimport { extend, retrieve2, retrieve3, reduce } from '../../core/util.js';\nimport { getLineHeight, getWidth, parsePercent } from '../../contain/text.js';\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\nexport function truncateText(text, containerWidth, font, ellipsis, options) {\n if (!containerWidth) {\n return '';\n }\n var textLines = (text + '').split('\\n');\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\n for (var i = 0, len = textLines.length; i < len; i++) {\n textLines[i] = truncateSingleLine(textLines[i], options);\n }\n return textLines.join('\\n');\n}\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\n options = options || {};\n var preparedOpts = extend({}, options);\n preparedOpts.font = font;\n ellipsis = retrieve2(ellipsis, '...');\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\n preparedOpts.cnCharWidth = getWidth('国', font);\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n contentWidth -= ascCharWidth;\n }\n var ellipsisWidth = getWidth(ellipsis, font);\n if (ellipsisWidth > contentWidth) {\n ellipsis = '';\n ellipsisWidth = 0;\n }\n contentWidth = containerWidth - ellipsisWidth;\n preparedOpts.ellipsis = ellipsis;\n preparedOpts.ellipsisWidth = ellipsisWidth;\n preparedOpts.contentWidth = contentWidth;\n preparedOpts.containerWidth = containerWidth;\n return preparedOpts;\n}\nfunction truncateSingleLine(textLine, options) {\n var containerWidth = options.containerWidth;\n var font = options.font;\n var contentWidth = options.contentWidth;\n if (!containerWidth) {\n return '';\n }\n var lineWidth = getWidth(textLine, font);\n if (lineWidth <= containerWidth) {\n return textLine;\n }\n for (var j = 0;; j++) {\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\n textLine += options.ellipsis;\n break;\n }\n var subLength = j === 0\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\n : lineWidth > 0\n ? Math.floor(textLine.length * contentWidth / lineWidth)\n : 0;\n textLine = textLine.substr(0, subLength);\n lineWidth = getWidth(textLine, font);\n }\n if (textLine === '') {\n textLine = options.placeholder;\n }\n return textLine;\n}\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\n var width = 0;\n var i = 0;\n for (var len = text.length; i < len && width < contentWidth; i++) {\n var charCode = text.charCodeAt(i);\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\n }\n return i;\n}\nexport function parsePlainText(text, style) {\n text != null && (text += '');\n var overflow = style.overflow;\n var padding = style.padding;\n var font = style.font;\n var truncate = overflow === 'truncate';\n var calculatedLineHeight = getLineHeight(font);\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\n var bgColorDrawn = !!(style.backgroundColor);\n var truncateLineOverflow = style.lineOverflow === 'truncate';\n var width = style.width;\n var lines;\n if (width != null && (overflow === 'break' || overflow === 'breakAll')) {\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\n }\n else {\n lines = text ? text.split('\\n') : [];\n }\n var contentHeight = lines.length * lineHeight;\n var height = retrieve2(style.height, contentHeight);\n if (contentHeight > height && truncateLineOverflow) {\n var lineCount = Math.floor(height / lineHeight);\n lines = lines.slice(0, lineCount);\n }\n if (text && truncate && width != null) {\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\n minChar: style.truncateMinChar,\n placeholder: style.placeholder\n });\n for (var i = 0; i < lines.length; i++) {\n lines[i] = truncateSingleLine(lines[i], options);\n }\n }\n var outerHeight = height;\n var contentWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n contentWidth = Math.max(getWidth(lines[i], font), contentWidth);\n }\n if (width == null) {\n width = contentWidth;\n }\n var outerWidth = contentWidth;\n if (padding) {\n outerHeight += padding[0] + padding[2];\n outerWidth += padding[1] + padding[3];\n width += padding[1] + padding[3];\n }\n if (bgColorDrawn) {\n outerWidth = width;\n }\n return {\n lines: lines,\n height: height,\n outerWidth: outerWidth,\n outerHeight: outerHeight,\n lineHeight: lineHeight,\n calculatedLineHeight: calculatedLineHeight,\n contentWidth: contentWidth,\n contentHeight: contentHeight,\n width: width\n };\n}\nvar RichTextToken = (function () {\n function RichTextToken() {\n }\n return RichTextToken;\n}());\nvar RichTextLine = (function () {\n function RichTextLine(tokens) {\n this.tokens = [];\n if (tokens) {\n this.tokens = tokens;\n }\n }\n return RichTextLine;\n}());\nvar RichTextContentBlock = (function () {\n function RichTextContentBlock() {\n this.width = 0;\n this.height = 0;\n this.contentWidth = 0;\n this.contentHeight = 0;\n this.outerWidth = 0;\n this.outerHeight = 0;\n this.lines = [];\n }\n return RichTextContentBlock;\n}());\nexport { RichTextContentBlock };\nexport function parseRichText(text, style) {\n var contentBlock = new RichTextContentBlock();\n text != null && (text += '');\n if (!text) {\n return contentBlock;\n }\n var topWidth = style.width;\n var topHeight = style.height;\n var overflow = style.overflow;\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\n : null;\n var lastIndex = STYLE_REG.lastIndex = 0;\n var result;\n while ((result = STYLE_REG.exec(text)) != null) {\n var matchedIndex = result.index;\n if (matchedIndex > lastIndex) {\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\n }\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\n lastIndex = STYLE_REG.lastIndex;\n }\n if (lastIndex < text.length) {\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\n }\n var pendingList = [];\n var calculatedHeight = 0;\n var calculatedWidth = 0;\n var stlPadding = style.padding;\n var truncate = overflow === 'truncate';\n var truncateLine = style.lineOverflow === 'truncate';\n function finishLine(line, lineWidth, lineHeight) {\n line.width = lineWidth;\n line.lineHeight = lineHeight;\n calculatedHeight += lineHeight;\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\n }\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var lineHeight = 0;\n var lineWidth = 0;\n for (var j = 0; j < line.tokens.length; j++) {\n var token = line.tokens[j];\n var tokenStyle = token.styleName && style.rich[token.styleName] || {};\n var textPadding = token.textPadding = tokenStyle.padding;\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\n var font = token.font = tokenStyle.font || style.font;\n token.contentHeight = getLineHeight(font);\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\n token.innerHeight = tokenHeight;\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n token.height = tokenHeight;\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\n token.align = tokenStyle && tokenStyle.align || style.align;\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\n if (j > 0) {\n line.tokens = line.tokens.slice(0, j);\n finishLine(line, lineWidth, lineHeight);\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\n }\n else {\n contentBlock.lines = contentBlock.lines.slice(0, i);\n }\n break outer;\n }\n var styleTokenWidth = tokenStyle.width;\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\n token.percentWidth = styleTokenWidth;\n pendingList.push(token);\n token.contentWidth = getWidth(token.text, font);\n }\n else {\n if (tokenWidthNotSpecified) {\n var textBackgroundColor = tokenStyle.backgroundColor;\n var bgImg = textBackgroundColor && textBackgroundColor.image;\n if (bgImg) {\n bgImg = imageHelper.findExistImage(bgImg);\n if (imageHelper.isImageReady(bgImg)) {\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\n }\n }\n }\n var remainTruncWidth = truncate && topWidth != null\n ? topWidth - lineWidth : null;\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\n token.text = '';\n token.width = token.contentWidth = 0;\n }\n else {\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\n token.width = token.contentWidth = getWidth(token.text, font);\n }\n }\n else {\n token.contentWidth = getWidth(token.text, font);\n }\n }\n token.width += paddingH;\n lineWidth += token.width;\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n }\n finishLine(line, lineWidth, lineHeight);\n }\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\n contentBlock.contentHeight = calculatedHeight;\n contentBlock.contentWidth = calculatedWidth;\n if (stlPadding) {\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\n }\n for (var i = 0; i < pendingList.length; i++) {\n var token = pendingList[i];\n var percentWidth = token.percentWidth;\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\n }\n return contentBlock;\n}\nfunction pushTokens(block, str, style, wrapInfo, styleName) {\n var isEmptyStr = str === '';\n var tokenStyle = styleName && style.rich[styleName] || {};\n var lines = block.lines;\n var font = tokenStyle.font || style.font;\n var newLine = false;\n var strLines;\n var linesWidths;\n if (wrapInfo) {\n var tokenPadding = tokenStyle.padding;\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\n var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\n if (lines.length > 0) {\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\n strLines = str.split('\\n');\n newLine = true;\n }\n }\n wrapInfo.accumWidth = outerWidth_1;\n }\n else {\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\n linesWidths = res.linesWidths;\n strLines = res.lines;\n }\n }\n else {\n strLines = str.split('\\n');\n }\n for (var i = 0; i < strLines.length; i++) {\n var text = strLines[i];\n var token = new RichTextToken();\n token.styleName = styleName;\n token.text = text;\n token.isLineHolder = !text && !isEmptyStr;\n if (typeof tokenStyle.width === 'number') {\n token.width = tokenStyle.width;\n }\n else {\n token.width = linesWidths\n ? linesWidths[i]\n : getWidth(text, font);\n }\n if (!i && !newLine) {\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\n var tokensLen = tokens.length;\n (tokensLen === 1 && tokens[0].isLineHolder)\n ? (tokens[0] = token)\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\n }\n else {\n lines.push(new RichTextLine([token]));\n }\n }\n}\nfunction isAlphabeticLetter(ch) {\n var code = ch.charCodeAt(0);\n return code >= 0x20 && code <= 0x24F\n || code >= 0x370 && code <= 0x10FF\n || code >= 0x1200 && code <= 0x13FF\n || code >= 0x1E00 && code <= 0x206F;\n}\nvar breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\n obj[ch] = true;\n return obj;\n}, {});\nfunction isWordBreakChar(ch) {\n if (isAlphabeticLetter(ch)) {\n if (breakCharMap[ch]) {\n return true;\n }\n return false;\n }\n return true;\n}\nfunction wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\n var lines = [];\n var linesWidths = [];\n var line = '';\n var currentWord = '';\n var currentWordWidth = 0;\n var accumWidth = 0;\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch === '\\n') {\n if (currentWord) {\n line += currentWord;\n accumWidth += currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = '';\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = 0;\n continue;\n }\n var chWidth = getWidth(ch, font);\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\n if (!lines.length\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\n : accumWidth + chWidth > lineWidth) {\n if (!accumWidth) {\n if (inWord) {\n lines.push(currentWord);\n linesWidths.push(currentWordWidth);\n currentWord = ch;\n currentWordWidth = chWidth;\n }\n else {\n lines.push(ch);\n linesWidths.push(chWidth);\n }\n }\n else if (line || currentWord) {\n if (inWord) {\n if (!line) {\n line = currentWord;\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth - currentWordWidth);\n currentWord += ch;\n currentWordWidth += chWidth;\n line = '';\n accumWidth = currentWordWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = ch;\n accumWidth = chWidth;\n }\n }\n continue;\n }\n accumWidth += chWidth;\n if (inWord) {\n currentWord += ch;\n currentWordWidth += chWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n line += ch;\n }\n }\n if (!lines.length && !line) {\n line = text;\n currentWord = '';\n currentWordWidth = 0;\n }\n if (currentWord) {\n line += currentWord;\n }\n if (line) {\n lines.push(line);\n linesWidths.push(accumWidth);\n }\n if (lines.length === 1) {\n accumWidth += lastAccumWidth;\n }\n return {\n accumWidth: accumWidth,\n lines: lines,\n linesWidths: linesWidths\n };\n}\n","import { __extends } from \"tslib\";\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { keys, extend, createObject } from '../core/util.js';\nimport { REDRAW_BIT, STYLE_CHANGED_BIT } from './constants.js';\nvar STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\nexport var DEFAULT_COMMON_STYLE = {\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowColor: '#000',\n opacity: 1,\n blend: 'source-over'\n};\nexport var DEFAULT_COMMON_ANIMATION_PROPS = {\n style: {\n shadowBlur: true,\n shadowOffsetX: true,\n shadowOffsetY: true,\n shadowColor: true,\n opacity: true\n }\n};\nDEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\nvar PRIMARY_STATES_KEYS = ['z', 'z2', 'invisible'];\nvar PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ['invisible'];\nvar Displayable = (function (_super) {\n __extends(Displayable, _super);\n function Displayable(props) {\n return _super.call(this, props) || this;\n }\n Displayable.prototype._init = function (props) {\n var keysArr = keys(props);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if (key === 'style') {\n this.useStyle(props[key]);\n }\n else {\n _super.prototype.attrKV.call(this, key, props[key]);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Displayable.prototype.beforeBrush = function () { };\n Displayable.prototype.afterBrush = function () { };\n Displayable.prototype.innerBeforeBrush = function () { };\n Displayable.prototype.innerAfterBrush = function () { };\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\n var m = this.transform;\n if (this.ignore\n || this.invisible\n || this.style.opacity === 0\n || (this.culling\n && isDisplayableCulled(this, viewWidth, viewHeight))\n || (m && !m[0] && !m[3])) {\n return false;\n }\n if (considerClipPath && this.__clipPaths) {\n for (var i = 0; i < this.__clipPaths.length; ++i) {\n if (this.__clipPaths[i].isZeroArea()) {\n return false;\n }\n }\n }\n if (considerAncestors && this.parent) {\n var parent_1 = this.parent;\n while (parent_1) {\n if (parent_1.ignore) {\n return false;\n }\n parent_1 = parent_1.parent;\n }\n }\n return true;\n };\n Displayable.prototype.contain = function (x, y) {\n return this.rectContain(x, y);\n };\n Displayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n Displayable.prototype.rectContain = function (x, y) {\n var coord = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n return rect.contain(coord[0], coord[1]);\n };\n Displayable.prototype.getPaintRect = function () {\n var rect = this._paintRect;\n if (!this._paintRect || this.__dirty) {\n var transform = this.transform;\n var elRect = this.getBoundingRect();\n var style = this.style;\n var shadowSize = style.shadowBlur || 0;\n var shadowOffsetX = style.shadowOffsetX || 0;\n var shadowOffsetY = style.shadowOffsetY || 0;\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\n if (transform) {\n BoundingRect.applyTransform(rect, elRect, transform);\n }\n else {\n rect.copy(elRect);\n }\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\n }\n var tolerance = this.dirtyRectTolerance;\n if (!rect.isZero()) {\n rect.x = Math.floor(rect.x - tolerance);\n rect.y = Math.floor(rect.y - tolerance);\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\n }\n }\n return rect;\n };\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\n if (paintRect) {\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\n this._prevPaintRect.copy(paintRect);\n }\n else {\n this._prevPaintRect = null;\n }\n };\n Displayable.prototype.getPrevPaintRect = function () {\n return this._prevPaintRect;\n };\n Displayable.prototype.animateStyle = function (loop) {\n return this.animate('style', loop);\n };\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else {\n this.markRedraw();\n }\n };\n Displayable.prototype.attrKV = function (key, value) {\n if (key !== 'style') {\n _super.prototype.attrKV.call(this, key, value);\n }\n else {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n this.setStyle(value);\n }\n }\n };\n Displayable.prototype.setStyle = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.style[keyOrObj] = value;\n }\n else {\n extend(this.style, keyOrObj);\n }\n this.dirtyStyle();\n return this;\n };\n Displayable.prototype.dirtyStyle = function (notRedraw) {\n if (!notRedraw) {\n this.markRedraw();\n }\n this.__dirty |= STYLE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n };\n Displayable.prototype.dirty = function () {\n this.dirtyStyle();\n };\n Displayable.prototype.styleChanged = function () {\n return !!(this.__dirty & STYLE_CHANGED_BIT);\n };\n Displayable.prototype.styleUpdated = function () {\n this.__dirty &= ~STYLE_CHANGED_BIT;\n };\n Displayable.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_COMMON_STYLE, obj);\n };\n Displayable.prototype.useStyle = function (obj) {\n if (!obj[STYLE_MAGIC_KEY]) {\n obj = this.createStyle(obj);\n }\n if (this.__inHover) {\n this.__hoverStyle = obj;\n }\n else {\n this.style = obj;\n }\n this.dirtyStyle();\n };\n Displayable.prototype.isStyleObject = function (obj) {\n return obj[STYLE_MAGIC_KEY];\n };\n Displayable.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.style && !normalState.style) {\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetStyle;\n if (state && state.style) {\n if (transition) {\n if (keepCurrentStates) {\n targetStyle = state.style;\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else if (needsRestoreToNormal) {\n targetStyle = normalState.style;\n }\n if (targetStyle) {\n if (transition) {\n var sourceStyle = this.style;\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\n if (needsRestoreToNormal) {\n var changedKeys = keys(sourceStyle);\n for (var i = 0; i < changedKeys.length; i++) {\n var key = changedKeys[i];\n if (key in targetStyle) {\n targetStyle[key] = targetStyle[key];\n this.style[key] = sourceStyle[key];\n }\n }\n }\n var targetKeys = keys(targetStyle);\n for (var i = 0; i < targetKeys.length; i++) {\n var key = targetKeys[i];\n this.style[key] = this.style[key];\n }\n this._transitionState(stateName, {\n style: targetStyle\n }, animationCfg, this.getAnimationStyleProps());\n }\n else {\n this.useStyle(targetStyle);\n }\n }\n var statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS;\n for (var i = 0; i < statesKeys.length; i++) {\n var key = statesKeys[i];\n if (state && state[key] != null) {\n this[key] = state[key];\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n this[key] = normalState[key];\n }\n }\n }\n };\n Displayable.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedStyle;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.style) {\n mergedStyle = mergedStyle || {};\n this._mergeStyle(mergedStyle, state.style);\n }\n }\n if (mergedStyle) {\n mergedState.style = mergedStyle;\n }\n return mergedState;\n };\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n extend(targetStyle, sourceStyle);\n return targetStyle;\n };\n Displayable.prototype.getAnimationStyleProps = function () {\n return DEFAULT_COMMON_ANIMATION_PROPS;\n };\n Displayable.initDefaultProps = (function () {\n var dispProto = Displayable.prototype;\n dispProto.type = 'displayable';\n dispProto.invisible = false;\n dispProto.z = 0;\n dispProto.z2 = 0;\n dispProto.zlevel = 0;\n dispProto.culling = false;\n dispProto.cursor = 'pointer';\n dispProto.rectHover = false;\n dispProto.incremental = false;\n dispProto._rect = null;\n dispProto.dirtyRectTolerance = 0;\n dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT;\n })();\n return Displayable;\n}(Element));\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar viewRect = new BoundingRect(0, 0, 0, 0);\nfunction isDisplayableCulled(el, width, height) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n viewRect.width = width;\n viewRect.height = height;\n return !tmpRect.intersect(viewRect);\n}\nexport default Displayable;\n","import * as vec2 from './vector.js';\nimport * as curve from './curve.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI2 = Math.PI * 2;\nvar start = vec2.create();\nvar end = vec2.create();\nvar extremity = vec2.create();\nexport function fromPoints(points, min, max) {\n if (points.length === 0) {\n return;\n }\n var p = points[0];\n var left = p[0];\n var right = p[0];\n var top = p[1];\n var bottom = p[1];\n for (var i = 1; i < points.length; i++) {\n p = points[i];\n left = mathMin(left, p[0]);\n right = mathMax(right, p[0]);\n top = mathMin(top, p[1]);\n bottom = mathMax(bottom, p[1]);\n }\n min[0] = left;\n min[1] = top;\n max[0] = right;\n max[1] = bottom;\n}\nexport function fromLine(x0, y0, x1, y1, min, max) {\n min[0] = mathMin(x0, x1);\n min[1] = mathMin(y0, y1);\n max[0] = mathMax(x0, x1);\n max[1] = mathMax(y0, y1);\n}\nvar xDim = [];\nvar yDim = [];\nexport function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\n var cubicExtrema = curve.cubicExtrema;\n var cubicAt = curve.cubicAt;\n var n = cubicExtrema(x0, x1, x2, x3, xDim);\n min[0] = Infinity;\n min[1] = Infinity;\n max[0] = -Infinity;\n max[1] = -Infinity;\n for (var i = 0; i < n; i++) {\n var x = cubicAt(x0, x1, x2, x3, xDim[i]);\n min[0] = mathMin(x, min[0]);\n max[0] = mathMax(x, max[0]);\n }\n n = cubicExtrema(y0, y1, y2, y3, yDim);\n for (var i = 0; i < n; i++) {\n var y = cubicAt(y0, y1, y2, y3, yDim[i]);\n min[1] = mathMin(y, min[1]);\n max[1] = mathMax(y, max[1]);\n }\n min[0] = mathMin(x0, min[0]);\n max[0] = mathMax(x0, max[0]);\n min[0] = mathMin(x3, min[0]);\n max[0] = mathMax(x3, max[0]);\n min[1] = mathMin(y0, min[1]);\n max[1] = mathMax(y0, max[1]);\n min[1] = mathMin(y3, min[1]);\n max[1] = mathMax(y3, max[1]);\n}\nexport function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\n var quadraticExtremum = curve.quadraticExtremum;\n var quadraticAt = curve.quadraticAt;\n var tx = mathMax(mathMin(quadraticExtremum(x0, x1, x2), 1), 0);\n var ty = mathMax(mathMin(quadraticExtremum(y0, y1, y2), 1), 0);\n var x = quadraticAt(x0, x1, x2, tx);\n var y = quadraticAt(y0, y1, y2, ty);\n min[0] = mathMin(x0, x2, x);\n min[1] = mathMin(y0, y2, y);\n max[0] = mathMax(x0, x2, x);\n max[1] = mathMax(y0, y2, y);\n}\nexport function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min, max) {\n var vec2Min = vec2.min;\n var vec2Max = vec2.max;\n var diff = Math.abs(startAngle - endAngle);\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\n min[0] = x - rx;\n min[1] = y - ry;\n max[0] = x + rx;\n max[1] = y + ry;\n return;\n }\n start[0] = mathCos(startAngle) * rx + x;\n start[1] = mathSin(startAngle) * ry + y;\n end[0] = mathCos(endAngle) * rx + x;\n end[1] = mathSin(endAngle) * ry + y;\n vec2Min(min, start, end);\n vec2Max(max, start, end);\n startAngle = startAngle % (PI2);\n if (startAngle < 0) {\n startAngle = startAngle + PI2;\n }\n endAngle = endAngle % (PI2);\n if (endAngle < 0) {\n endAngle = endAngle + PI2;\n }\n if (startAngle > endAngle && !anticlockwise) {\n endAngle += PI2;\n }\n else if (startAngle < endAngle && anticlockwise) {\n startAngle += PI2;\n }\n if (anticlockwise) {\n var tmp = endAngle;\n endAngle = startAngle;\n startAngle = tmp;\n }\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\n if (angle > startAngle) {\n extremity[0] = mathCos(angle) * rx + x;\n extremity[1] = mathSin(angle) * ry + y;\n vec2Min(min, extremity, min);\n vec2Max(max, extremity, max);\n }\n }\n}\n","import * as vec2 from './vector.js';\nimport BoundingRect from './BoundingRect.js';\nimport { devicePixelRatio as dpr } from '../config.js';\nimport { fromLine, fromCubic, fromQuadratic, fromArc } from './bbox.js';\nimport { cubicLength, cubicSubdivide, quadraticLength, quadraticSubdivide } from './curve.js';\nvar CMD = {\n M: 1,\n L: 2,\n C: 3,\n Q: 4,\n A: 5,\n Z: 6,\n R: 7\n};\nvar tmpOutX = [];\nvar tmpOutY = [];\nvar min = [];\nvar max = [];\nvar min2 = [];\nvar max2 = [];\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathCos = Math.cos;\nvar mathSin = Math.sin;\nvar mathAbs = Math.abs;\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar hasTypedArray = typeof Float32Array !== 'undefined';\nvar tmpAngles = [];\nfunction modPI2(radian) {\n var n = Math.round(radian / PI * 1e8) / 1e8;\n return (n % 2) * PI;\n}\nexport function normalizeArcAngles(angles, anticlockwise) {\n var newStartAngle = modPI2(angles[0]);\n if (newStartAngle < 0) {\n newStartAngle += PI2;\n }\n var delta = newStartAngle - angles[0];\n var newEndAngle = angles[1];\n newEndAngle += delta;\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2) {\n newEndAngle = newStartAngle + PI2;\n }\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2) {\n newEndAngle = newStartAngle - PI2;\n }\n else if (!anticlockwise && newStartAngle > newEndAngle) {\n newEndAngle = newStartAngle + (PI2 - modPI2(newStartAngle - newEndAngle));\n }\n else if (anticlockwise && newStartAngle < newEndAngle) {\n newEndAngle = newStartAngle - (PI2 - modPI2(newEndAngle - newStartAngle));\n }\n angles[0] = newStartAngle;\n angles[1] = newEndAngle;\n}\nvar PathProxy = (function () {\n function PathProxy(notSaveData) {\n this.dpr = 1;\n this._xi = 0;\n this._yi = 0;\n this._x0 = 0;\n this._y0 = 0;\n this._len = 0;\n if (notSaveData) {\n this._saveData = false;\n }\n if (this._saveData) {\n this.data = [];\n }\n }\n PathProxy.prototype.increaseVersion = function () {\n this._version++;\n };\n PathProxy.prototype.getVersion = function () {\n return this._version;\n };\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\n if (segmentIgnoreThreshold > 0) {\n this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;\n this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;\n }\n };\n PathProxy.prototype.setDPR = function (dpr) {\n this.dpr = dpr;\n };\n PathProxy.prototype.setContext = function (ctx) {\n this._ctx = ctx;\n };\n PathProxy.prototype.getContext = function () {\n return this._ctx;\n };\n PathProxy.prototype.beginPath = function () {\n this._ctx && this._ctx.beginPath();\n this.reset();\n return this;\n };\n PathProxy.prototype.reset = function () {\n if (this._saveData) {\n this._len = 0;\n }\n if (this._pathSegLen) {\n this._pathSegLen = null;\n this._pathLen = 0;\n }\n this._version++;\n };\n PathProxy.prototype.moveTo = function (x, y) {\n this._drawPendingPt();\n this.addData(CMD.M, x, y);\n this._ctx && this._ctx.moveTo(x, y);\n this._x0 = x;\n this._y0 = y;\n this._xi = x;\n this._yi = y;\n return this;\n };\n PathProxy.prototype.lineTo = function (x, y) {\n var dx = mathAbs(x - this._xi);\n var dy = mathAbs(y - this._yi);\n var exceedUnit = dx > this._ux || dy > this._uy;\n this.addData(CMD.L, x, y);\n if (this._ctx && exceedUnit) {\n this._ctx.lineTo(x, y);\n }\n if (exceedUnit) {\n this._xi = x;\n this._yi = y;\n this._pendingPtDist = 0;\n }\n else {\n var d2 = dx * dx + dy * dy;\n if (d2 > this._pendingPtDist) {\n this._pendingPtX = x;\n this._pendingPtY = y;\n this._pendingPtDist = d2;\n }\n }\n return this;\n };\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\n this._drawPendingPt();\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n if (this._ctx) {\n this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n this._xi = x3;\n this._yi = y3;\n return this;\n };\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\n this._drawPendingPt();\n this.addData(CMD.Q, x1, y1, x2, y2);\n if (this._ctx) {\n this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n }\n this._xi = x2;\n this._yi = y2;\n return this;\n };\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this._drawPendingPt();\n tmpAngles[0] = startAngle;\n tmpAngles[1] = endAngle;\n normalizeArcAngles(tmpAngles, anticlockwise);\n startAngle = tmpAngles[0];\n endAngle = tmpAngles[1];\n var delta = endAngle - startAngle;\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n this._xi = mathCos(endAngle) * r + cx;\n this._yi = mathSin(endAngle) * r + cy;\n return this;\n };\n PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._drawPendingPt();\n if (this._ctx) {\n this._ctx.arcTo(x1, y1, x2, y2, radius);\n }\n return this;\n };\n PathProxy.prototype.rect = function (x, y, w, h) {\n this._drawPendingPt();\n this._ctx && this._ctx.rect(x, y, w, h);\n this.addData(CMD.R, x, y, w, h);\n return this;\n };\n PathProxy.prototype.closePath = function () {\n this._drawPendingPt();\n this.addData(CMD.Z);\n var ctx = this._ctx;\n var x0 = this._x0;\n var y0 = this._y0;\n if (ctx) {\n ctx.closePath();\n }\n this._xi = x0;\n this._yi = y0;\n return this;\n };\n PathProxy.prototype.fill = function (ctx) {\n ctx && ctx.fill();\n this.toStatic();\n };\n PathProxy.prototype.stroke = function (ctx) {\n ctx && ctx.stroke();\n this.toStatic();\n };\n PathProxy.prototype.len = function () {\n return this._len;\n };\n PathProxy.prototype.setData = function (data) {\n var len = data.length;\n if (!(this.data && this.data.length === len) && hasTypedArray) {\n this.data = new Float32Array(len);\n }\n for (var i = 0; i < len; i++) {\n this.data[i] = data[i];\n }\n this._len = len;\n };\n PathProxy.prototype.appendPath = function (path) {\n if (!(path instanceof Array)) {\n path = [path];\n }\n var len = path.length;\n var appendSize = 0;\n var offset = this._len;\n for (var i = 0; i < len; i++) {\n appendSize += path[i].len();\n }\n if (hasTypedArray && (this.data instanceof Float32Array)) {\n this.data = new Float32Array(offset + appendSize);\n }\n for (var i = 0; i < len; i++) {\n var appendPathData = path[i].data;\n for (var k = 0; k < appendPathData.length; k++) {\n this.data[offset++] = appendPathData[k];\n }\n }\n this._len = offset;\n };\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\n if (!this._saveData) {\n return;\n }\n var data = this.data;\n if (this._len + arguments.length > data.length) {\n this._expandData();\n data = this.data;\n }\n for (var i = 0; i < arguments.length; i++) {\n data[this._len++] = arguments[i];\n }\n };\n PathProxy.prototype._drawPendingPt = function () {\n if (this._pendingPtDist > 0) {\n this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY);\n this._pendingPtDist = 0;\n }\n };\n PathProxy.prototype._expandData = function () {\n if (!(this.data instanceof Array)) {\n var newData = [];\n for (var i = 0; i < this._len; i++) {\n newData[i] = this.data[i];\n }\n this.data = newData;\n }\n };\n PathProxy.prototype.toStatic = function () {\n if (!this._saveData) {\n return;\n }\n this._drawPendingPt();\n var data = this.data;\n if (data instanceof Array) {\n data.length = this._len;\n if (hasTypedArray && this._len > 11) {\n this.data = new Float32Array(data);\n }\n }\n };\n PathProxy.prototype.getBoundingRect = function () {\n min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;\n max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\n var data = this.data;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var i;\n for (i = 0; i < this._len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n min2[0] = x0;\n min2[1] = y0;\n max2[0] = x0;\n max2[1] = y0;\n break;\n case CMD.L:\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var endAngle = data[i++] + startAngle;\n i += 1;\n var anticlockwise = !data[i++];\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n break;\n case CMD.Z:\n xi = x0;\n yi = y0;\n break;\n }\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n }\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n };\n PathProxy.prototype._calculateLength = function () {\n var data = this.data;\n var len = this._len;\n var ux = this._ux;\n var uy = this._uy;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n if (!this._pathSegLen) {\n this._pathSegLen = [];\n }\n var pathSegLen = this._pathSegLen;\n var pathTotalLen = 0;\n var segCount = 0;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n var l = -1;\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n break;\n case CMD.L: {\n var x2 = data[i++];\n var y2 = data[i++];\n var dx = x2 - xi;\n var dy = y2 - yi;\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x2;\n yi = y2;\n }\n break;\n }\n case CMD.C: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n var x3 = data[i++];\n var y3 = data[i++];\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var delta = data[i++];\n var endAngle = delta + startAngle;\n i += 1;\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n l = mathMax(rx, ry) * mathMin(PI2, Math.abs(delta));\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R: {\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n l = width * 2 + height * 2;\n break;\n }\n case CMD.Z: {\n var dx = x0 - xi;\n var dy = y0 - yi;\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (l >= 0) {\n pathSegLen[segCount++] = l;\n pathTotalLen += l;\n }\n }\n this._pathLen = pathTotalLen;\n return pathTotalLen;\n };\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\n var d = this.data;\n var ux = this._ux;\n var uy = this._uy;\n var len = this._len;\n var x0;\n var y0;\n var xi;\n var yi;\n var x;\n var y;\n var drawPart = percent < 1;\n var pathSegLen;\n var pathTotalLen;\n var accumLength = 0;\n var segCount = 0;\n var displayedLength;\n var pendingPtDist = 0;\n var pendingPtX;\n var pendingPtY;\n if (drawPart) {\n if (!this._pathSegLen) {\n this._calculateLength();\n }\n pathSegLen = this._pathSegLen;\n pathTotalLen = this._pathLen;\n displayedLength = percent * pathTotalLen;\n if (!displayedLength) {\n return;\n }\n }\n lo: for (var i = 0; i < len;) {\n var cmd = d[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = d[i];\n yi = d[i + 1];\n x0 = xi;\n y0 = yi;\n }\n if (cmd !== CMD.L && pendingPtDist > 0) {\n ctx.lineTo(pendingPtX, pendingPtY);\n pendingPtDist = 0;\n }\n switch (cmd) {\n case CMD.M:\n x0 = xi = d[i++];\n y0 = yi = d[i++];\n ctx.moveTo(xi, yi);\n break;\n case CMD.L: {\n x = d[i++];\n y = d[i++];\n var dx = mathAbs(x - xi);\n var dy = mathAbs(y - yi);\n if (dx > ux || dy > uy) {\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.lineTo(x, y);\n xi = x;\n yi = y;\n pendingPtDist = 0;\n }\n else {\n var d2 = dx * dx + dy * dy;\n if (d2 > pendingPtDist) {\n pendingPtX = x;\n pendingPtY = y;\n pendingPtDist = d2;\n }\n }\n break;\n }\n case CMD.C: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n var x3 = d[i++];\n var y3 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\n break lo;\n }\n accumLength += l;\n }\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\n break lo;\n }\n accumLength += l;\n }\n ctx.quadraticCurveTo(x1, y1, x2, y2);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\n var cx = d[i++];\n var cy = d[i++];\n var rx = d[i++];\n var ry = d[i++];\n var startAngle = d[i++];\n var delta = d[i++];\n var psi = d[i++];\n var anticlockwise = !d[i++];\n var r = (rx > ry) ? rx : ry;\n var isEllipse = mathAbs(rx - ry) > 1e-3;\n var endAngle = startAngle + delta;\n var breakBuild = false;\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\n breakBuild = true;\n }\n accumLength += l;\n }\n if (isEllipse && ctx.ellipse) {\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\n }\n else {\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n }\n if (breakBuild) {\n break lo;\n }\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = d[i];\n y0 = yi = d[i + 1];\n x = d[i++];\n y = d[i++];\n var width = d[i++];\n var height = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var d_1 = displayedLength - accumLength;\n ctx.moveTo(x, y);\n ctx.lineTo(x + mathMin(d_1, width), y);\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x + width, y + mathMin(d_1, height));\n }\n d_1 -= height;\n if (d_1 > 0) {\n ctx.lineTo(x + mathMax(width - d_1, 0), y + height);\n }\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x, y + mathMax(height - d_1, 0));\n }\n break lo;\n }\n accumLength += l;\n }\n ctx.rect(x, y, width, height);\n break;\n case CMD.Z:\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.closePath();\n xi = x0;\n yi = y0;\n }\n }\n };\n PathProxy.prototype.clone = function () {\n var newProxy = new PathProxy();\n var data = this.data;\n newProxy.data = data.slice ? data.slice()\n : Array.prototype.slice.call(data);\n newProxy._len = this._len;\n return newProxy;\n };\n PathProxy.CMD = CMD;\n PathProxy.initDefaultProps = (function () {\n var proto = PathProxy.prototype;\n proto._saveData = true;\n proto._ux = 0;\n proto._uy = 0;\n proto._pendingPtDist = 0;\n proto._version = 0;\n })();\n return PathProxy;\n}());\nexport default PathProxy;\n","export function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n var _a = 0;\n var _b = x0;\n if ((y > y0 + _l && y > y1 + _l)\n || (y < y0 - _l && y < y1 - _l)\n || (x > x0 + _l && x > x1 + _l)\n || (x < x0 - _l && x < x1 - _l)) {\n return false;\n }\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n }\n else {\n return Math.abs(x - x0) <= _l / 2;\n }\n var tmp = _a * x - y + _b;\n var _s = tmp * tmp / (_a * _a + 1);\n return _s <= _l / 2 * _l / 2;\n}\n","import * as curve from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\n return false;\n }\n var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n return d <= _l / 2;\n}\n","import { quadraticProjectPoint } from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\n return false;\n }\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n","var PI2 = Math.PI * 2;\nexport function normalizeRadian(angle) {\n angle %= PI2;\n if (angle < 0) {\n angle += PI2;\n }\n return angle;\n}\n","import { normalizeRadian } from './util.js';\nvar PI2 = Math.PI * 2;\nexport function containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n if ((d - _l > r) || (d + _l < r)) {\n return false;\n }\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n return true;\n }\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n }\n else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n var angle = Math.atan2(y, x);\n if (angle < 0) {\n angle += PI2;\n }\n return (angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);\n}\n","export default function windingLine(x0, y0, x1, y1, x, y) {\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\n return 0;\n }\n if (y1 === y0) {\n return 0;\n }\n var t = (y - y0) / (y1 - y0);\n var dir = y1 < y0 ? 1 : -1;\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n var x_ = t * (x1 - x0) + x0;\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n","import PathProxy from '../core/PathProxy.js';\nimport * as line from './line.js';\nimport * as cubic from './cubic.js';\nimport * as quadratic from './quadratic.js';\nimport * as arc from './arc.js';\nimport * as curve from '../core/curve.js';\nimport windingLine from './windingLine.js';\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\nfunction swapExtrema() {\n var tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n if ((y > y0 && y > y1 && y > y2 && y > y3)\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\n return 0;\n }\n var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var w = 0;\n var nExtrema = -1;\n var y0_ = void 0;\n var y1_ = void 0;\n for (var i = 0; i < nRoots; i++) {\n var t = roots[i];\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\n var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n if (x_ < x) {\n continue;\n }\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n if (nExtrema === 2) {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n }\n else {\n w += y3 < y1_ ? unit : -unit;\n }\n }\n else {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n return w;\n }\n}\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n if ((y > y0 && y > y1 && y > y2)\n || (y < y0 && y < y1 && y < y2)) {\n return 0;\n }\n var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var t = curve.quadraticExtremum(y0, y1, y2);\n if (t >= 0 && t <= 1) {\n var w = 0;\n var y_ = curve.quadraticAt(y0, y1, y2, t);\n for (var i = 0; i < nRoots; i++) {\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n if (x_ < x) {\n continue;\n }\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n }\n else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n return w;\n }\n else {\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n if (x_ < x) {\n return 0;\n }\n return y2 < y0 ? unit : -unit;\n }\n }\n}\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n y -= cy;\n if (y > r || y < -r) {\n return 0;\n }\n var tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n var dTheta = Math.abs(startAngle - endAngle);\n if (dTheta < 1e-4) {\n return 0;\n }\n if (dTheta >= PI2 - 1e-4) {\n startAngle = 0;\n endAngle = PI2;\n var dir = anticlockwise ? 1 : -1;\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n }\n else {\n return 0;\n }\n }\n if (startAngle > endAngle) {\n var tmp_1 = startAngle;\n startAngle = endAngle;\n endAngle = tmp_1;\n }\n if (startAngle < 0) {\n startAngle += PI2;\n endAngle += PI2;\n }\n var w = 0;\n for (var i = 0; i < 2; i++) {\n var x_ = roots[i];\n if (x_ + cx > x) {\n var angle = Math.atan2(y, x_);\n var dir = anticlockwise ? 1 : -1;\n if (angle < 0) {\n angle = PI2 + angle;\n }\n if ((angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n w += dir;\n }\n }\n }\n return w;\n}\nfunction containPath(path, lineWidth, isStroke, x, y) {\n var data = path.data;\n var len = path.len();\n var w = 0;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (cmd === CMD.M && i > 1) {\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n }\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n case CMD.L:\n if (isStroke) {\n if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n if (isStroke) {\n if (cubic.containStroke(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n if (isStroke) {\n if (quadratic.containStroke(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var theta = data[i++];\n var dTheta = data[i++];\n i += 1;\n var anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy;\n if (!isFirst) {\n w += windingLine(xi, yi, x1, y1, x, y);\n }\n else {\n x0 = x1;\n y0 = y1;\n }\n var _x = (x - cx) * ry / rx + cx;\n if (isStroke) {\n if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n return true;\n }\n }\n else {\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n }\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n x1 = x0 + width;\n y1 = y0 + height;\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y)\n || line.containStroke(x1, y0, x1, y1, lineWidth, x, y)\n || line.containStroke(x1, y1, x0, y1, lineWidth, x, y)\n || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n break;\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n return w !== 0;\n}\nexport function contain(pathProxy, x, y) {\n return containPath(pathProxy, 0, false, x, y);\n}\nexport function containStroke(pathProxy, lineWidth, x, y) {\n return containPath(pathProxy, lineWidth, true, x, y);\n}\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport * as pathContain from '../contain/path.js';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util.js';\nimport { lum } from '../tool/color.js';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT, STYLE_CHANGED_BIT } from './constants.js';\nimport { TRANSFORMABLE_PROPS } from '../core/Transformable.js';\nexport var DEFAULT_PATH_STYLE = defaults({\n fill: '#000',\n stroke: null,\n strokePercent: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n miterLimit: 10,\n strokeNoScale: false,\n strokeFirst: false\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_PATH_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n strokePercent: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineDashOffset: true,\n lineWidth: true,\n miterLimit: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar pathCopyParams = TRANSFORMABLE_PROPS.concat(['invisible',\n 'culling', 'z', 'z2', 'zlevel', 'parent'\n]);\nvar Path = (function (_super) {\n __extends(Path, _super);\n function Path(opts) {\n return _super.call(this, opts) || this;\n }\n Path.prototype.update = function () {\n var _this = this;\n _super.prototype.update.call(this);\n var style = this.style;\n if (style.decal) {\n var decalEl = this._decalEl = this._decalEl || new Path();\n if (decalEl.buildPath === Path.prototype.buildPath) {\n decalEl.buildPath = function (ctx) {\n _this.buildPath(ctx, _this.shape);\n };\n }\n decalEl.silent = true;\n var decalElStyle = decalEl.style;\n for (var key in style) {\n if (decalElStyle[key] !== style[key]) {\n decalElStyle[key] = style[key];\n }\n }\n decalElStyle.fill = style.fill ? style.decal : null;\n decalElStyle.decal = null;\n decalElStyle.shadowColor = null;\n style.strokeFirst && (decalElStyle.stroke = null);\n for (var i = 0; i < pathCopyParams.length; ++i) {\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\n }\n decalEl.__dirty |= REDRAW_BIT;\n }\n else if (this._decalEl) {\n this._decalEl = null;\n }\n };\n Path.prototype.getDecalElement = function () {\n return this._decalEl;\n };\n Path.prototype._init = function (props) {\n var keysArr = keys(props);\n this.shape = this.getDefaultShape();\n var defaultStyle = this.getDefaultStyle();\n if (defaultStyle) {\n this.useStyle(defaultStyle);\n }\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n var value = props[key];\n if (key === 'style') {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n extend(this.style, value);\n }\n }\n else if (key === 'shape') {\n extend(this.shape, value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Path.prototype.getDefaultStyle = function () {\n return null;\n };\n Path.prototype.getDefaultShape = function () {\n return {};\n };\n Path.prototype.canBeInsideText = function () {\n return this.hasFill();\n };\n Path.prototype.getInsideTextFill = function () {\n var pathFill = this.style.fill;\n if (pathFill !== 'none') {\n if (isString(pathFill)) {\n var fillLum = lum(pathFill, 0);\n if (fillLum > 0.5) {\n return DARK_LABEL_COLOR;\n }\n else if (fillLum > 0.2) {\n return LIGHTER_LABEL_COLOR;\n }\n return LIGHT_LABEL_COLOR;\n }\n else if (pathFill) {\n return LIGHT_LABEL_COLOR;\n }\n }\n return DARK_LABEL_COLOR;\n };\n Path.prototype.getInsideTextStroke = function (textFill) {\n var pathFill = this.style.fill;\n if (isString(pathFill)) {\n var zr = this.__zr;\n var isDarkMode = !!(zr && zr.isDarkMode());\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\n if (isDarkMode === isDarkLabel) {\n return pathFill;\n }\n }\n };\n Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };\n Path.prototype.pathUpdated = function () {\n this.__dirty &= ~SHAPE_CHANGED_BIT;\n };\n Path.prototype.getUpdatedPathProxy = function (inBatch) {\n !this.path && this.createPathProxy();\n this.path.beginPath();\n this.buildPath(this.path, this.shape, inBatch);\n return this.path;\n };\n Path.prototype.createPathProxy = function () {\n this.path = new PathProxy(false);\n };\n Path.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n };\n Path.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n Path.prototype.getBoundingRect = function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n if (needsUpdateRect) {\n var firstInvoke = false;\n if (!this.path) {\n firstInvoke = true;\n this.createPathProxy();\n }\n var path = this.path;\n if (firstInvoke || (this.__dirty & SHAPE_CHANGED_BIT)) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n this.pathUpdated();\n }\n rect = path.getBoundingRect();\n }\n this._rect = rect;\n if (this.hasStroke() && this.path && this.path.len() > 0) {\n var rectStroke = this._rectStroke || (this._rectStroke = rect.clone());\n if (this.__dirty || needsUpdateRect) {\n rectStroke.copy(rect);\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n var w = style.lineWidth;\n if (!this.hasFill()) {\n var strokeContainThreshold = this.strokeContainThreshold;\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\n }\n if (lineScale > 1e-10) {\n rectStroke.width += w / lineScale;\n rectStroke.height += w / lineScale;\n rectStroke.x -= w / lineScale / 2;\n rectStroke.y -= w / lineScale / 2;\n }\n }\n return rectStroke;\n }\n return rect;\n };\n Path.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n var style = this.style;\n x = localPos[0];\n y = localPos[1];\n if (rect.contain(x, y)) {\n var pathProxy = this.path;\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n if (lineScale > 1e-10) {\n if (!this.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n if (pathContain.containStroke(pathProxy, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n if (this.hasFill()) {\n return pathContain.contain(pathProxy, x, y);\n }\n }\n return false;\n };\n Path.prototype.dirtyShape = function () {\n this.__dirty |= SHAPE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n if (this._decalEl) {\n this._decalEl.dirtyShape();\n }\n this.markRedraw();\n };\n Path.prototype.dirty = function () {\n this.dirtyStyle();\n this.dirtyShape();\n };\n Path.prototype.animateShape = function (loop) {\n return this.animate('shape', loop);\n };\n Path.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else if (targetKey === 'shape') {\n this.dirtyShape();\n }\n else {\n this.markRedraw();\n }\n };\n Path.prototype.attrKV = function (key, value) {\n if (key === 'shape') {\n this.setShape(value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n };\n Path.prototype.setShape = function (keyOrObj, value) {\n var shape = this.shape;\n if (!shape) {\n shape = this.shape = {};\n }\n if (typeof keyOrObj === 'string') {\n shape[keyOrObj] = value;\n }\n else {\n extend(shape, keyOrObj);\n }\n this.dirtyShape();\n return this;\n };\n Path.prototype.shapeChanged = function () {\n return !!(this.__dirty & SHAPE_CHANGED_BIT);\n };\n Path.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_PATH_STYLE, obj);\n };\n Path.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.shape && !normalState.shape) {\n normalState.shape = extend({}, this.shape);\n }\n };\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetShape;\n if (state && state.shape) {\n if (transition) {\n if (keepCurrentStates) {\n targetShape = state.shape;\n }\n else {\n targetShape = extend({}, normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else {\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else if (needsRestoreToNormal) {\n targetShape = normalState.shape;\n }\n if (targetShape) {\n if (transition) {\n this.shape = extend({}, this.shape);\n var targetShapePrimaryProps = {};\n var shapeKeys = keys(targetShape);\n for (var i = 0; i < shapeKeys.length; i++) {\n var key = shapeKeys[i];\n if (typeof targetShape[key] === 'object') {\n this.shape[key] = targetShape[key];\n }\n else {\n targetShapePrimaryProps[key] = targetShape[key];\n }\n }\n this._transitionState(stateName, {\n shape: targetShapePrimaryProps\n }, animationCfg);\n }\n else {\n this.shape = targetShape;\n this.dirtyShape();\n }\n }\n };\n Path.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedShape;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.shape) {\n mergedShape = mergedShape || {};\n this._mergeStyle(mergedShape, state.shape);\n }\n }\n if (mergedShape) {\n mergedState.shape = mergedShape;\n }\n return mergedState;\n };\n Path.prototype.getAnimationStyleProps = function () {\n return DEFAULT_PATH_ANIMATION_PROPS;\n };\n Path.prototype.isZeroArea = function () {\n return false;\n };\n Path.extend = function (defaultProps) {\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n defaultProps.init && defaultProps.init.call(_this, opts);\n return _this;\n }\n Sub.prototype.getDefaultStyle = function () {\n return clone(defaultProps.style);\n };\n Sub.prototype.getDefaultShape = function () {\n return clone(defaultProps.shape);\n };\n return Sub;\n }(Path));\n for (var key in defaultProps) {\n if (typeof defaultProps[key] === 'function') {\n Sub.prototype[key] = defaultProps[key];\n }\n }\n return Sub;\n };\n Path.initDefaultProps = (function () {\n var pathProto = Path.prototype;\n pathProto.type = 'path';\n pathProto.strokeContainThreshold = 5;\n pathProto.segmentIgnoreThreshold = 0;\n pathProto.subPixelOptimize = false;\n pathProto.autoBatch = false;\n pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT;\n })();\n return Path;\n}(Displayable));\nexport default Path;\n","import { __extends } from \"tslib\";\nimport Displayable from './Displayable.js';\nimport { getBoundingRect } from '../contain/text.js';\nimport { DEFAULT_PATH_STYLE } from './Path.js';\nimport { createObject, defaults } from '../core/util.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nexport var DEFAULT_TSPAN_STYLE = defaults({\n strokeFirst: true,\n font: DEFAULT_FONT,\n x: 0,\n y: 0,\n textAlign: 'left',\n textBaseline: 'top',\n miterLimit: 2\n}, DEFAULT_PATH_STYLE);\nvar TSpan = (function (_super) {\n __extends(TSpan, _super);\n function TSpan() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TSpan.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\n };\n TSpan.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n TSpan.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_TSPAN_STYLE, obj);\n };\n TSpan.prototype.setBoundingRect = function (rect) {\n this._rect = rect;\n };\n TSpan.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n var text = style.text;\n text != null ? (text += '') : (text = '');\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n if (this.hasStroke()) {\n var w = style.lineWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n this._rect = rect;\n }\n return this._rect;\n };\n TSpan.initDefaultProps = (function () {\n var tspanProto = TSpan.prototype;\n tspanProto.dirtyRectTolerance = 10;\n })();\n return TSpan;\n}(Displayable));\nTSpan.prototype.type = 'tspan';\nexport default TSpan;\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { defaults, createObject } from '../core/util.js';\nexport var DEFAULT_IMAGE_STYLE = defaults({\n x: 0,\n y: 0\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_IMAGE_ANIMATION_PROPS = {\n style: defaults({\n x: true,\n y: true,\n width: true,\n height: true,\n sx: true,\n sy: true,\n sWidth: true,\n sHeight: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nfunction isImageLike(source) {\n return !!(source\n && typeof source !== 'string'\n && source.width && source.height);\n}\nvar ZRImage = (function (_super) {\n __extends(ZRImage, _super);\n function ZRImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ZRImage.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_IMAGE_STYLE, obj);\n };\n ZRImage.prototype._getSize = function (dim) {\n var style = this.style;\n var size = style[dim];\n if (size != null) {\n return size;\n }\n var imageSource = isImageLike(style.image)\n ? style.image : this.__image;\n if (!imageSource) {\n return 0;\n }\n var otherDim = dim === 'width' ? 'height' : 'width';\n var otherDimSize = style[otherDim];\n if (otherDimSize == null) {\n return imageSource[dim];\n }\n else {\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\n }\n };\n ZRImage.prototype.getWidth = function () {\n return this._getSize('width');\n };\n ZRImage.prototype.getHeight = function () {\n return this._getSize('height');\n };\n ZRImage.prototype.getAnimationStyleProps = function () {\n return DEFAULT_IMAGE_ANIMATION_PROPS;\n };\n ZRImage.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\n }\n return this._rect;\n };\n return ZRImage;\n}(Displayable));\nZRImage.prototype.type = 'image';\nexport default ZRImage;\n","export function buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4;\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n }\n else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n }\n else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n }\n else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n }\n else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = 0;\n }\n var total;\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n","var round = Math.round;\nexport function subPixelOptimizeLine(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n }\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n }\n return outputShape;\n}\nexport function subPixelOptimizeRect(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = originX;\n outputShape.y = originY;\n outputShape.width = originWidth;\n outputShape.height = originHeight;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n return outputShape;\n}\nexport function subPixelOptimize(position, lineWidth, positiveOrNegative) {\n if (!lineWidth) {\n return position;\n }\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0\n ? doubledPosition / 2\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundRectHelper from '../helper/roundRect.js';\nimport { subPixelOptimizeRect } from '../helper/subPixelOptimize.js';\nvar RectShape = (function () {\n function RectShape() {\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.height = 0;\n }\n return RectShape;\n}());\nexport { RectShape };\nvar subPixelOptimizeOutputShape = {};\nvar Rect = (function (_super) {\n __extends(Rect, _super);\n function Rect(opts) {\n return _super.call(this, opts) || this;\n }\n Rect.prototype.getDefaultShape = function () {\n return new RectShape();\n };\n Rect.prototype.buildPath = function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = optimizedShape.x;\n y = optimizedShape.y;\n width = optimizedShape.width;\n height = optimizedShape.height;\n optimizedShape.r = shape.r;\n shape = optimizedShape;\n }\n else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n }\n else {\n roundRectHelper.buildPath(ctx, shape);\n }\n };\n Rect.prototype.isZeroArea = function () {\n return !this.shape.width || !this.shape.height;\n };\n return Rect;\n}(Path));\nRect.prototype.type = 'rect';\nexport default Rect;\n","import { __extends } from \"tslib\";\nimport { parseRichText, parsePlainText } from './helper/parseText.js';\nimport TSpan from './TSpan.js';\nimport { retrieve2, each, normalizeCssArray, trim, retrieve3, extend, keys, defaults } from '../core/util.js';\nimport { adjustTextX, adjustTextY } from '../contain/text.js';\nimport ZRImage from './Image.js';\nimport Rect from './shape/Rect.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Displayable, { DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_SIZE } from '../core/platform.js';\nvar DEFAULT_RICH_TEXT_COLOR = {\n fill: '#000'\n};\nvar DEFAULT_STROKE_LINE_WIDTH = 2;\nexport var DEFAULT_TEXT_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineWidth: true,\n fontSize: true,\n lineHeight: true,\n width: true,\n height: true,\n textShadowColor: true,\n textShadowBlur: true,\n textShadowOffsetX: true,\n textShadowOffsetY: true,\n backgroundColor: true,\n padding: true,\n borderColor: true,\n borderWidth: true,\n borderRadius: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar ZRText = (function (_super) {\n __extends(ZRText, _super);\n function ZRText(opts) {\n var _this = _super.call(this) || this;\n _this.type = 'text';\n _this._children = [];\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\n _this.attr(opts);\n return _this;\n }\n ZRText.prototype.childrenRef = function () {\n return this._children;\n };\n ZRText.prototype.update = function () {\n _super.prototype.update.call(this);\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.zlevel = this.zlevel;\n child.z = this.z;\n child.z2 = this.z2;\n child.culling = this.culling;\n child.cursor = this.cursor;\n child.invisible = this.invisible;\n }\n };\n ZRText.prototype.updateTransform = function () {\n var innerTransformable = this.innerTransformable;\n if (innerTransformable) {\n innerTransformable.updateTransform();\n if (innerTransformable.transform) {\n this.transform = innerTransformable.transform;\n }\n }\n else {\n _super.prototype.updateTransform.call(this);\n }\n };\n ZRText.prototype.getLocalTransform = function (m) {\n var innerTransformable = this.innerTransformable;\n return innerTransformable\n ? innerTransformable.getLocalTransform(m)\n : _super.prototype.getLocalTransform.call(this, m);\n };\n ZRText.prototype.getComputedTransform = function () {\n if (this.__hostTarget) {\n this.__hostTarget.getComputedTransform();\n this.__hostTarget.updateInnerText(true);\n }\n return _super.prototype.getComputedTransform.call(this);\n };\n ZRText.prototype._updateSubTexts = function () {\n this._childCursor = 0;\n normalizeTextStyle(this.style);\n this.style.rich\n ? this._updateRichTexts()\n : this._updatePlainTexts();\n this._children.length = this._childCursor;\n this.styleUpdated();\n };\n ZRText.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = zr;\n }\n };\n ZRText.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = null;\n }\n };\n ZRText.prototype.getBoundingRect = function () {\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n if (!this._rect) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n tmpRect.copy(childRect);\n tmpRect.applyTransform(transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n this._rect = rect || tmpRect;\n }\n return this._rect;\n };\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\n };\n ZRText.prototype.setTextContent = function (textContent) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Can\\'t attach text on another text');\n }\n };\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n if (!sourceStyle) {\n return targetStyle;\n }\n var sourceRich = sourceStyle.rich;\n var targetRich = targetStyle.rich || (sourceRich && {});\n extend(targetStyle, sourceStyle);\n if (sourceRich && targetRich) {\n this._mergeRich(targetRich, sourceRich);\n targetStyle.rich = targetRich;\n }\n else if (targetRich) {\n targetStyle.rich = targetRich;\n }\n return targetStyle;\n };\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\n var richNames = keys(sourceRich);\n for (var i = 0; i < richNames.length; i++) {\n var richName = richNames[i];\n targetRich[richName] = targetRich[richName] || {};\n extend(targetRich[richName], sourceRich[richName]);\n }\n };\n ZRText.prototype.getAnimationStyleProps = function () {\n return DEFAULT_TEXT_ANIMATION_PROPS;\n };\n ZRText.prototype._getOrCreateChild = function (Ctor) {\n var child = this._children[this._childCursor];\n if (!child || !(child instanceof Ctor)) {\n child = new Ctor();\n }\n this._children[this._childCursor++] = child;\n child.__zr = this.__zr;\n child.parent = this;\n return child;\n };\n ZRText.prototype._updatePlainTexts = function () {\n var style = this.style;\n var textFont = style.font || DEFAULT_FONT;\n var textPadding = style.padding;\n var text = getStyleText(style);\n var contentBlock = parsePlainText(text, style);\n var needDrawBg = needDrawBackground(style);\n var bgColorDrawn = !!(style.backgroundColor);\n var outerHeight = contentBlock.outerHeight;\n var outerWidth = contentBlock.outerWidth;\n var contentWidth = contentBlock.contentWidth;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var defaultStyle = this._defaultStyle;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var textAlign = style.align || defaultStyle.align || 'left';\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\n var textX = baseX;\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\n if (needDrawBg || textPadding) {\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n textY += lineHeight / 2;\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n if (verticalAlign === 'top') {\n textY += textPadding[0];\n }\n else if (verticalAlign === 'bottom') {\n textY -= textPadding[2];\n }\n }\n var defaultLineWidth = 0;\n var useDefaultFill = false;\n var textFill = getFill('fill' in style\n ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in style\n ? style.stroke\n : (!bgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill))\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = style.textShadowBlur > 0;\n var fixedBoundingRect = style.width != null\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\n for (var i = 0; i < textLines.length; i++) {\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n subElStyle.text = textLines[i];\n subElStyle.x = textX;\n subElStyle.y = textY;\n if (textAlign) {\n subElStyle.textAlign = textAlign;\n }\n subElStyle.textBaseline = 'middle';\n subElStyle.opacity = style.opacity;\n subElStyle.strokeFirst = true;\n if (hasShadow) {\n subElStyle.shadowBlur = style.textShadowBlur || 0;\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\n }\n subElStyle.stroke = textStroke;\n subElStyle.fill = textFill;\n if (textStroke) {\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\n subElStyle.lineDash = style.lineDash;\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n }\n subElStyle.font = textFont;\n setSeparateFont(subElStyle, style);\n textY += lineHeight;\n if (fixedBoundingRect) {\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), contentWidth, calculatedLineHeight));\n }\n }\n };\n ZRText.prototype._updateRichTexts = function () {\n var style = this.style;\n var text = getStyleText(style);\n var contentBlock = parseRichText(text, style);\n var contentWidth = contentBlock.width;\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var textPadding = style.padding;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var defaultStyle = this._defaultStyle;\n var textAlign = style.align || defaultStyle.align;\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n var xLeft = boxX;\n var lineTop = boxY;\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n var xRight = xLeft + contentWidth;\n if (needDrawBackground(style)) {\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n var bgColorDrawn = !!(style.backgroundColor);\n for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var tokens = line.tokens;\n var tokenCount = tokens.length;\n var lineHeight = line.lineHeight;\n var remainedWidth = line.width;\n var leftIndex = 0;\n var lineXLeft = xLeft;\n var lineXRight = xRight;\n var rightIndex = tokenCount - 1;\n var token = void 0;\n while (leftIndex < tokenCount\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\n remainedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n while (rightIndex >= 0\n && (token = tokens[rightIndex], token.align === 'right')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\n remainedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n }\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex];\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\n lineXLeft += token.width;\n leftIndex++;\n }\n lineTop += lineHeight;\n }\n };\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\n var tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text;\n var verticalAlign = token.verticalAlign;\n var y = lineTop + lineHeight / 2;\n if (verticalAlign === 'top') {\n y = lineTop + token.height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\n ? x - token.width\n : textAlign === 'center'\n ? x - token.width / 2\n : x, y - token.height / 2, token.width, token.height);\n var bgColorDrawn = !!tokenStyle.backgroundColor;\n var textPadding = token.textPadding;\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\n }\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n var defaultStyle = this._defaultStyle;\n var useDefaultFill = false;\n var defaultLineWidth = 0;\n var textFill = getFill('fill' in tokenStyle ? tokenStyle.fill\n : 'fill' in style ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\n : 'stroke' in style ? style.stroke\n : (!bgColorDrawn\n && !parentBgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = tokenStyle.textShadowBlur > 0\n || style.textShadowBlur > 0;\n subElStyle.text = token.text;\n subElStyle.x = x;\n subElStyle.y = y;\n if (hasShadow) {\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\n }\n subElStyle.textAlign = textAlign;\n subElStyle.textBaseline = 'middle';\n subElStyle.font = token.font || DEFAULT_FONT;\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\n setSeparateFont(subElStyle, tokenStyle);\n if (textStroke) {\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n subElStyle.stroke = textStroke;\n }\n if (textFill) {\n subElStyle.fill = textFill;\n }\n var textWidth = token.contentWidth;\n var textHeight = token.contentHeight;\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\n };\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\n var textBackgroundColor = style.backgroundColor;\n var textBorderWidth = style.borderWidth;\n var textBorderColor = style.borderColor;\n var isImageBg = textBackgroundColor && textBackgroundColor.image;\n var isPlainOrGradientBg = textBackgroundColor && !isImageBg;\n var textBorderRadius = style.borderRadius;\n var self = this;\n var rectEl;\n var imgEl;\n if (isPlainOrGradientBg || style.lineHeight || (textBorderWidth && textBorderColor)) {\n rectEl = this._getOrCreateChild(Rect);\n rectEl.useStyle(rectEl.createStyle());\n rectEl.style.fill = null;\n var rectShape = rectEl.shape;\n rectShape.x = x;\n rectShape.y = y;\n rectShape.width = width;\n rectShape.height = height;\n rectShape.r = textBorderRadius;\n rectEl.dirtyShape();\n }\n if (isPlainOrGradientBg) {\n var rectStyle = rectEl.style;\n rectStyle.fill = textBackgroundColor || null;\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\n }\n else if (isImageBg) {\n imgEl = this._getOrCreateChild(ZRImage);\n imgEl.onload = function () {\n self.dirtyStyle();\n };\n var imgStyle = imgEl.style;\n imgStyle.image = textBackgroundColor.image;\n imgStyle.x = x;\n imgStyle.y = y;\n imgStyle.width = width;\n imgStyle.height = height;\n }\n if (textBorderWidth && textBorderColor) {\n var rectStyle = rectEl.style;\n rectStyle.lineWidth = textBorderWidth;\n rectStyle.stroke = textBorderColor;\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\n rectStyle.lineDash = style.borderDash;\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\n rectEl.strokeContainThreshold = 0;\n if (rectEl.hasFill() && rectEl.hasStroke()) {\n rectStyle.strokeFirst = true;\n rectStyle.lineWidth *= 2;\n }\n }\n var commonStyle = (rectEl || imgEl).style;\n commonStyle.shadowBlur = style.shadowBlur || 0;\n commonStyle.shadowColor = style.shadowColor || 'transparent';\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\n };\n ZRText.makeFont = function (style) {\n var font = '';\n if (hasSeparateFont(style)) {\n font = [\n style.fontStyle,\n style.fontWeight,\n parseFontSize(style.fontSize),\n style.fontFamily || 'sans-serif'\n ].join(' ');\n }\n return font && trim(font) || style.textFont || style.font;\n };\n return ZRText;\n}(Displayable));\nvar VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\nvar VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\nvar FONT_PARTS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'];\nexport function parseFontSize(fontSize) {\n if (typeof fontSize === 'string'\n && (fontSize.indexOf('px') !== -1\n || fontSize.indexOf('rem') !== -1\n || fontSize.indexOf('em') !== -1)) {\n return fontSize;\n }\n else if (!isNaN(+fontSize)) {\n return fontSize + 'px';\n }\n else {\n return DEFAULT_FONT_SIZE + 'px';\n }\n}\nfunction setSeparateFont(targetStyle, sourceStyle) {\n for (var i = 0; i < FONT_PARTS.length; i++) {\n var fontProp = FONT_PARTS[i];\n var val = sourceStyle[fontProp];\n if (val != null) {\n targetStyle[fontProp] = val;\n }\n }\n}\nexport function hasSeparateFont(style) {\n return style.fontSize != null || style.fontFamily || style.fontWeight;\n}\nexport function normalizeTextStyle(style) {\n normalizeStyle(style);\n each(style.rich, normalizeStyle);\n return style;\n}\nfunction normalizeStyle(style) {\n if (style) {\n style.font = ZRText.makeFont(style);\n var textAlign = style.align;\n textAlign === 'middle' && (textAlign = 'center');\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\n var verticalAlign = style.verticalAlign;\n verticalAlign === 'center' && (verticalAlign = 'middle');\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\n var textPadding = style.padding;\n if (textPadding) {\n style.padding = normalizeCssArray(style.padding);\n }\n }\n}\nfunction getStroke(stroke, lineWidth) {\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\n ? null\n : (stroke.image || stroke.colorStops)\n ? '#000'\n : stroke;\n}\nfunction getFill(fill) {\n return (fill == null || fill === 'none')\n ? null\n : (fill.image || fill.colorStops)\n ? '#000'\n : fill;\n}\nfunction getTextXForPadding(x, textAlign, textPadding) {\n return textAlign === 'right'\n ? (x - textPadding[1])\n : textAlign === 'center'\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\n : (x + textPadding[3]);\n}\nfunction getStyleText(style) {\n var text = style.text;\n text != null && (text += '');\n return text;\n}\nfunction needDrawBackground(style) {\n return !!(style.backgroundColor\n || style.lineHeight\n || (style.borderWidth && style.borderColor));\n}\nexport default ZRText;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from './model.js';\nexport var getECData = makeInner();\nexport var setCommonECData = function (seriesIndex, dataType, dataIdx, el) {\n if (el) {\n var ecData = getECData(el);\n // Add data index and series index for indexing the data by element\n // Useful in tooltip\n ecData.dataIndex = dataIdx;\n ecData.dataType = dataType;\n ecData.seriesIndex = seriesIndex;\n ecData.ssrType = 'chart';\n // TODO: not store dataIndex on children.\n if (el.type === 'group') {\n el.traverse(function (child) {\n var childECData = getECData(child);\n childECData.seriesIndex = seriesIndex;\n childECData.dataIndex = dataIdx;\n childECData.dataType = dataType;\n childECData.ssrType = 'chart';\n });\n }\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, indexOf, isArrayLike, isObject, keys, isArray, each } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport { liftColor } from 'zrender/lib/tool/color.js';\nimport { queryDataIndex, makeInner } from './model.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { error } from './log.js';\n// Reserve 0 as default.\nvar _highlightNextDigit = 1;\nvar _highlightKeyMap = {};\nvar getSavedStates = makeInner();\nvar getComponentStates = makeInner();\nexport var HOVER_STATE_NORMAL = 0;\nexport var HOVER_STATE_BLUR = 1;\nexport var HOVER_STATE_EMPHASIS = 2;\nexport var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\nexport var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\nexport var Z2_EMPHASIS_LIFT = 10;\nexport var Z2_SELECT_LIFT = 9;\nexport var HIGHLIGHT_ACTION_TYPE = 'highlight';\nexport var DOWNPLAY_ACTION_TYPE = 'downplay';\nexport var SELECT_ACTION_TYPE = 'select';\nexport var UNSELECT_ACTION_TYPE = 'unselect';\nexport var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\nfunction hasFillOrStroke(fillOrStroke) {\n return fillOrStroke != null && fillOrStroke !== 'none';\n}\nfunction doChangeHoverState(el, stateName, hoverStateEnum) {\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\n el.onHoverStateChange(stateName);\n }\n el.hoverState = hoverStateEnum;\n}\nfunction singleEnterEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\n}\nfunction singleLeaveEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\nfunction singleEnterBlur(el) {\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\n}\nfunction singleLeaveBlur(el) {\n if (el.hoverState === HOVER_STATE_BLUR) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\nfunction singleEnterSelect(el) {\n el.selected = true;\n}\nfunction singleLeaveSelect(el) {\n el.selected = false;\n}\nfunction updateElementState(el, updater, commonParam) {\n updater(el, commonParam);\n}\nfunction traverseUpdateState(el, updater, commonParam) {\n updateElementState(el, updater, commonParam);\n el.isGroup && el.traverse(function (child) {\n updateElementState(child, updater, commonParam);\n });\n}\nexport function setStatesFlag(el, stateName) {\n switch (stateName) {\n case 'emphasis':\n el.hoverState = HOVER_STATE_EMPHASIS;\n break;\n case 'normal':\n el.hoverState = HOVER_STATE_NORMAL;\n break;\n case 'blur':\n el.hoverState = HOVER_STATE_BLUR;\n break;\n case 'select':\n el.selected = true;\n }\n}\n/**\n * If we reuse elements when rerender.\n * DON'T forget to clearStates before we update the style and shape.\n * Or we may update on the wrong state instead of normal state.\n */\nexport function clearStates(el) {\n if (el.isGroup) {\n el.traverse(function (child) {\n child.clearStates();\n });\n } else {\n el.clearStates();\n }\n}\nfunction getFromStateStyle(el, props, toStateName, defaultValue) {\n var style = el.style;\n var fromState = {};\n for (var i = 0; i < props.length; i++) {\n var propName = props[i];\n var val = style[propName];\n fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val;\n }\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n if (animator.__fromStateTransition\n // Don't consider the animation to emphasis state.\n && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') {\n animator.saveTo(fromState, props);\n }\n }\n return fromState;\n}\nfunction createEmphasisDefaultState(el, stateName, targetStates, state) {\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\n var cloned = false;\n if (el instanceof Path) {\n var store = getSavedStates(el);\n var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill;\n var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke;\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\n state = state || {};\n var emphasisStyle = state.style || {};\n // inherit case\n if (emphasisStyle.fill === 'inherit') {\n cloned = true;\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n emphasisStyle.fill = fromFill;\n }\n // Apply default color lift\n else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\n cloned = true;\n // Not modify the original value.\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n // Already being applied 'emphasis'. DON'T lift color multiple times.\n emphasisStyle.fill = liftColor(fromFill);\n }\n // Not highlight stroke if fill has been highlighted.\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\n if (!cloned) {\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n }\n emphasisStyle.stroke = liftColor(fromStroke);\n }\n state.style = emphasisStyle;\n }\n }\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n if (!cloned) {\n state = extend({}, state);\n }\n var z2EmphasisLift = el.z2EmphasisLift;\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\n }\n }\n return state;\n}\nfunction createSelectDefaultState(el, stateName, state) {\n // const hasSelect = indexOf(el.currentStates, stateName) >= 0;\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n state = extend({}, state);\n var z2SelectLift = el.z2SelectLift;\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\n }\n }\n return state;\n}\nfunction createBlurDefaultState(el, stateName, state) {\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\n var currentOpacity = el.style.opacity;\n var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, {\n opacity: 1\n }) : null;\n state = state || {};\n var blurStyle = state.style || {};\n if (blurStyle.opacity == null) {\n // clone state\n state = extend({}, state);\n blurStyle = extend({\n // Already being applied 'emphasis'. DON'T mul opacity multiple times.\n opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1\n }, blurStyle);\n state.style = blurStyle;\n }\n return state;\n}\nfunction elementStateProxy(stateName, targetStates) {\n var state = this.states[stateName];\n if (this.style) {\n if (stateName === 'emphasis') {\n return createEmphasisDefaultState(this, stateName, targetStates, state);\n } else if (stateName === 'blur') {\n return createBlurDefaultState(this, stateName, state);\n } else if (stateName === 'select') {\n return createSelectDefaultState(this, stateName, state);\n }\n }\n return state;\n}\n/**\n * Set hover style (namely \"emphasis style\") of element.\n * @param el Should not be `zrender/graphic/Group`.\n * @param focus 'self' | 'selfInSeries' | 'series'\n */\nexport function setDefaultStateProxy(el) {\n el.stateProxy = elementStateProxy;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n if (textContent) {\n textContent.stateProxy = elementStateProxy;\n }\n if (textGuide) {\n textGuide.stateProxy = elementStateProxy;\n }\n}\nexport function enterEmphasisWhenMouseOver(el, e) {\n !shouldSilent(el, e)\n // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasisWhenMouseOut(el, e) {\n !shouldSilent(el, e)\n // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterEmphasis(el, highlightDigit) {\n el.__highByOuter |= 1 << (highlightDigit || 0);\n traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasis(el, highlightDigit) {\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterBlur(el) {\n traverseUpdateState(el, singleEnterBlur);\n}\nexport function leaveBlur(el) {\n traverseUpdateState(el, singleLeaveBlur);\n}\nexport function enterSelect(el) {\n traverseUpdateState(el, singleEnterSelect);\n}\nexport function leaveSelect(el) {\n traverseUpdateState(el, singleLeaveSelect);\n}\nfunction shouldSilent(el, e) {\n return el.__highDownSilentOnTouch && e.zrByTouch;\n}\nexport function allLeaveBlur(api) {\n var model = api.getModel();\n var leaveBlurredSeries = [];\n var allComponentViews = [];\n model.eachComponent(function (componentType, componentModel) {\n var componentStates = getComponentStates(componentModel);\n var isSeries = componentType === 'series';\n var view = isSeries ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel);\n !isSeries && allComponentViews.push(view);\n if (componentStates.isBlured) {\n // Leave blur anyway\n view.group.traverse(function (child) {\n singleLeaveBlur(child);\n });\n isSeries && leaveBlurredSeries.push(componentModel);\n }\n componentStates.isBlured = false;\n });\n each(allComponentViews, function (view) {\n if (view && view.toggleBlurSeries) {\n view.toggleBlurSeries(leaveBlurredSeries, false, model);\n }\n });\n}\nexport function blurSeries(targetSeriesIndex, focus, blurScope, api) {\n var ecModel = api.getModel();\n blurScope = blurScope || 'coordinateSystem';\n function leaveBlurOfIndices(data, dataIndices) {\n for (var i = 0; i < dataIndices.length; i++) {\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\n itemEl && leaveBlur(itemEl);\n }\n }\n if (targetSeriesIndex == null) {\n return;\n }\n if (!focus || focus === 'none') {\n return;\n }\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\n var targetCoordSys = targetSeriesModel.coordinateSystem;\n if (targetCoordSys && targetCoordSys.master) {\n targetCoordSys = targetCoordSys.master;\n }\n var blurredSeries = [];\n ecModel.eachSeries(function (seriesModel) {\n var sameSeries = targetSeriesModel === seriesModel;\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys && coordSys.master) {\n coordSys = coordSys.master;\n }\n var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead.\n if (!(\n // Not blur other series if blurScope series\n blurScope === 'series' && !sameSeries\n // Not blur other coordinate system if blurScope is coordinateSystem\n || blurScope === 'coordinateSystem' && !sameCoordSys\n // Not blur self series if focus is series.\n || focus === 'series' && sameSeries\n // TODO blurScope: coordinate system\n )) {\n var view = api.getViewOfSeriesModel(seriesModel);\n view.group.traverse(function (child) {\n // For the elements that have been triggered by other components,\n // and are still required to be highlighted,\n // because the current is directly forced to blur the element,\n // it will cause the focus self to be unable to highlight, so skip the blur of this element.\n if (child.__highByOuter && sameSeries && focus === 'self') {\n return;\n }\n singleEnterBlur(child);\n });\n if (isArrayLike(focus)) {\n leaveBlurOfIndices(seriesModel.getData(), focus);\n } else if (isObject(focus)) {\n var dataTypes = keys(focus);\n for (var d = 0; d < dataTypes.length; d++) {\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\n }\n }\n blurredSeries.push(seriesModel);\n getComponentStates(seriesModel).isBlured = true;\n }\n });\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n var view = api.getViewOfComponentModel(componentModel);\n if (view && view.toggleBlurSeries) {\n view.toggleBlurSeries(blurredSeries, true, ecModel);\n }\n });\n}\nexport function blurComponent(componentMainType, componentIndex, api) {\n if (componentMainType == null || componentIndex == null) {\n return;\n }\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n if (!componentModel) {\n return;\n }\n getComponentStates(componentModel).isBlured = true;\n var view = api.getViewOfComponentModel(componentModel);\n if (!view || !view.focusBlurEnabled) {\n return;\n }\n view.group.traverse(function (child) {\n singleEnterBlur(child);\n });\n}\nexport function blurSeriesFromHighlightPayload(seriesModel, payload, api) {\n var seriesIndex = seriesModel.seriesIndex;\n var data = seriesModel.getData(payload.dataType);\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n return;\n }\n var dataIndex = queryDataIndex(data, payload);\n // Pick the first one if there is multiple/none exists.\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\n var el = data.getItemGraphicEl(dataIndex);\n if (!el) {\n var count = data.count();\n var current = 0;\n // If data on dataIndex is NaN.\n while (!el && current < count) {\n el = data.getItemGraphicEl(current++);\n }\n }\n if (el) {\n var ecData = getECData(el);\n blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api);\n } else {\n // If there is no element put on the data. Try getting it from raw option\n // TODO Should put it on seriesModel?\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\n if (focus_1 != null) {\n blurSeries(seriesIndex, focus_1, blurScope, api);\n }\n }\n}\nexport function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api) {\n var ret = {\n focusSelf: false,\n dispatchers: null\n };\n if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) {\n return ret;\n }\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n if (!componentModel) {\n return ret;\n }\n var view = api.getViewOfComponentModel(componentModel);\n if (!view || !view.findHighDownDispatchers) {\n return ret;\n }\n var dispatchers = view.findHighDownDispatchers(name);\n // At presnet, the component (like Geo) only blur inside itself.\n // So we do not use `blurScope` in component.\n var focusSelf;\n for (var i = 0; i < dispatchers.length; i++) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatchers[i])) {\n error('param should be highDownDispatcher');\n }\n if (getECData(dispatchers[i]).focus === 'self') {\n focusSelf = true;\n break;\n }\n }\n return {\n focusSelf: focusSelf,\n dispatchers: dispatchers\n };\n}\nexport function handleGlobalMouseOverForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n var ecData = getECData(dispatcher);\n var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api),\n dispatchers = _a.dispatchers,\n focusSelf = _a.focusSelf;\n // If `findHighDownDispatchers` is supported on the component,\n // highlight/downplay elements with the same name.\n if (dispatchers) {\n if (focusSelf) {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n }\n each(dispatchers, function (dispatcher) {\n return enterEmphasisWhenMouseOver(dispatcher, e);\n });\n } else {\n // Try blur all in the related series. Then emphasis the hoverred.\n // TODO. progressive mode.\n blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api);\n if (ecData.focus === 'self') {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n }\n // Other than series, component that not support `findHighDownDispatcher` will\n // also use it. But in this case, highlight/downplay are only supported in\n // mouse hover but not in dispatchAction.\n enterEmphasisWhenMouseOver(dispatcher, e);\n }\n}\nexport function handleGlobalMouseOutForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n allLeaveBlur(api);\n var ecData = getECData(dispatcher);\n var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers;\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n return leaveEmphasisWhenMouseOut(dispatcher, e);\n });\n } else {\n leaveEmphasisWhenMouseOut(dispatcher, e);\n }\n}\nexport function toggleSelectionFromPayload(seriesModel, payload, api) {\n if (!isSelectChangePayload(payload)) {\n return;\n }\n var dataType = payload.dataType;\n var data = seriesModel.getData(dataType);\n var dataIndex = queryDataIndex(data, payload);\n if (!isArray(dataIndex)) {\n dataIndex = [dataIndex];\n }\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\n}\nexport function updateSeriesElementSelection(seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n data.eachItemGraphicEl(function (el, idx) {\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\n });\n });\n}\nexport function getAllSelectedIndices(ecModel) {\n var ret = [];\n ecModel.eachSeries(function (seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n var dataIndices = seriesModel.getSelectedDataIndices();\n if (dataIndices.length > 0) {\n var item = {\n dataIndex: dataIndices,\n seriesIndex: seriesModel.seriesIndex\n };\n if (type != null) {\n item.dataType = type;\n }\n ret.push(item);\n }\n });\n });\n return ret;\n}\n/**\n * Enable the function that mouseover will trigger the emphasis state.\n *\n * NOTE:\n * This function should be used on the element with dataIndex, seriesIndex.\n *\n */\nexport function enableHoverEmphasis(el, focus, blurScope) {\n setAsHighDownDispatcher(el, true);\n traverseUpdateState(el, setDefaultStateProxy);\n enableHoverFocus(el, focus, blurScope);\n}\nexport function disableHoverEmphasis(el) {\n setAsHighDownDispatcher(el, false);\n}\nexport function toggleHoverEmphasis(el, focus, blurScope, isDisabled) {\n isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope);\n}\nexport function enableHoverFocus(el, focus, blurScope) {\n var ecData = getECData(el);\n if (focus != null) {\n // TODO dataIndex may be set after this function. This check is not useful.\n // if (ecData.dataIndex == null) {\n // if (__DEV__) {\n // console.warn('focus can only been set on element with dataIndex');\n // }\n // }\n // else {\n ecData.focus = focus;\n ecData.blurScope = blurScope;\n // }\n } else if (ecData.focus) {\n ecData.focus = null;\n }\n}\nvar OTHER_STATES = ['emphasis', 'blur', 'select'];\nvar defaultStyleGetterMap = {\n itemStyle: 'getItemStyle',\n lineStyle: 'getLineStyle',\n areaStyle: 'getAreaStyle'\n};\n/**\n * Set emphasis/blur/selected states of element.\n */\nexport function setStatesStylesFromModel(el, itemModel, styleType,\n// default itemStyle\ngetter) {\n styleType = styleType || 'itemStyle';\n for (var i = 0; i < OTHER_STATES.length; i++) {\n var stateName = OTHER_STATES[i];\n var model = itemModel.getModel([stateName, styleType]);\n var state = el.ensureState(stateName);\n // Let it throw error if getterType is not found.\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\n }\n}\n/**\n *\n * Set element as highlight / downplay dispatcher.\n * It will be checked when element received mouseover event or from highlight action.\n * It's in change of all highlight/downplay behavior of it's children.\n *\n * @param el\n * @param el.highDownSilentOnTouch\n * In touch device, mouseover event will be trigger on touchstart event\n * (see module:zrender/dom/HandlerProxy). By this mechanism, we can\n * conveniently use hoverStyle when tap on touch screen without additional\n * code for compatibility.\n * But if the chart/component has select feature, which usually also use\n * hoverStyle, there might be conflict between 'select-highlight' and\n * 'hover-highlight' especially when roam is enabled (see geo for example).\n * In this case, `highDownSilentOnTouch` should be used to disable\n * hover-highlight on touch device.\n * @param asDispatcher If `false`, do not set as \"highDownDispatcher\".\n */\nexport function setAsHighDownDispatcher(el, asDispatcher) {\n var disable = asDispatcher === false;\n var extendedEl = el;\n // Make `highDownSilentOnTouch` and `onStateChange` only work after\n // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.\n if (el.highDownSilentOnTouch) {\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\n }\n // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n if (!disable || extendedEl.__highDownDispatcher) {\n // Emphasis, normal can be triggered manually by API or other components like hover link.\n // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);\n // Also keep previous record.\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\n extendedEl.__highDownDispatcher = !disable;\n }\n}\nexport function isHighDownDispatcher(el) {\n return !!(el && el.__highDownDispatcher);\n}\n/**\n * Enable component highlight/downplay features:\n * + hover link (within the same name)\n * + focus blur in component\n */\nexport function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) {\n var ecData = getECData(el);\n ecData.componentMainType = componentModel.mainType;\n ecData.componentIndex = componentModel.componentIndex;\n ecData.componentHighDownName = componentHighDownName;\n}\n/**\n * Support highlight/downplay record on each elements.\n * For the case: hover highlight/downplay (legend, visualMap, ...) and\n * user triggered highlight/downplay should not conflict.\n * Only all of the highlightDigit cleared, return to normal.\n * @param {string} highlightKey\n * @return {number} highlightDigit\n */\nexport function getHighlightDigit(highlightKey) {\n var highlightDigit = _highlightKeyMap[highlightKey];\n if (highlightDigit == null && _highlightNextDigit <= 32) {\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\n }\n return highlightDigit;\n}\nexport function isSelectChangePayload(payload) {\n var payloadType = payload.type;\n return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE;\n}\nexport function isHighDownPayload(payload) {\n var payloadType = payload.type;\n return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE;\n}\nexport function savePathStates(el) {\n var store = getSavedStates(el);\n store.normalFill = el.style.fill;\n store.normalStroke = el.style.stroke;\n var selectState = el.states.select || {};\n store.selectFill = selectState.style && selectState.style.fill || null;\n store.selectStroke = selectState.style && selectState.style.stroke || null;\n}","import PathProxy from '../core/PathProxy.js';\nimport { applyTransform as v2ApplyTransform } from '../core/vector.js';\nvar CMD = PathProxy.CMD;\nvar points = [[], [], []];\nvar mathSqrt = Math.sqrt;\nvar mathAtan2 = Math.atan2;\nexport default function transformPath(path, m) {\n if (!m) {\n return;\n }\n var data = path.data;\n var len = path.len();\n var cmd;\n var nPoint;\n var i;\n var j;\n var k;\n var p;\n var M = CMD.M;\n var C = CMD.C;\n var L = CMD.L;\n var R = CMD.R;\n var A = CMD.A;\n var Q = CMD.Q;\n for (i = 0, j = 0; i < len;) {\n cmd = data[i++];\n j = i;\n nPoint = 0;\n switch (cmd) {\n case M:\n nPoint = 1;\n break;\n case L:\n nPoint = 1;\n break;\n case C:\n nPoint = 3;\n break;\n case Q:\n nPoint = 2;\n break;\n case A:\n var x = m[4];\n var y = m[5];\n var sx = mathSqrt(m[0] * m[0] + m[1] * m[1]);\n var sy = mathSqrt(m[2] * m[2] + m[3] * m[3]);\n var angle = mathAtan2(-m[1] / sy, m[0] / sx);\n data[i] *= sx;\n data[i++] += x;\n data[i] *= sy;\n data[i++] += y;\n data[i++] *= sx;\n data[i++] *= sy;\n data[i++] += angle;\n data[i++] += angle;\n i += 2;\n j = i;\n break;\n case R:\n p[0] = data[i++];\n p[1] = data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n p[0] += data[i++];\n p[1] += data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n }\n for (k = 0; k < nPoint; k++) {\n var p_1 = points[k];\n p_1[0] = data[i++];\n p_1[1] = data[i++];\n v2ApplyTransform(p_1, p_1, m);\n data[j++] = p_1[0];\n data[j++] = p_1[1];\n }\n }\n path.increaseVersion();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../graphic/Path.js';\nimport PathProxy from '../core/PathProxy.js';\nimport transformPath from './transformPath.js';\nimport { extend } from '../core/util.js';\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nfunction vMag(v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n;\nfunction vRatio(u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n}\n;\nfunction vAngle(u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\n * Math.acos(vRatio(u, v));\n}\n;\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\n var psi = psiDeg * (PI / 180.0);\n var xp = mathCos(psi) * (x1 - x2) / 2.0\n + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0\n + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n var f = (fa === fs ? -1 : 1)\n * mathSqrt((((rx * rx) * (ry * ry))\n - ((rx * rx) * (yp * yp))\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\n + (ry * ry) * (xp * xp))) || 0;\n var cxp = f * rx * yp / ry;\n var cyp = f * -ry * xp / rx;\n var cx = (x1 + x2) / 2.0\n + mathCos(psi) * cxp\n - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0\n + mathSin(psi) * cxp\n + mathCos(psi) * cyp;\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (dTheta < 0) {\n var n = Math.round(dTheta / PI * 1e6) / 1e6;\n dTheta = PI * 2 + (n % 2) * PI;\n }\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction createPathProxyFromString(data) {\n var path = new PathProxy();\n if (!data) {\n return path;\n }\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var CMD = PathProxy.CMD;\n var cmdList = data.match(commandReg);\n if (!cmdList) {\n return path;\n }\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd = void 0;\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n var off = 0;\n while (off < pLen) {\n var ctlPtx = void 0;\n var ctlPty = void 0;\n var rx = void 0;\n var ry = void 0;\n var psi = void 0;\n var fa = void 0;\n var fs = void 0;\n var x1 = cpx;\n var y1 = cpy;\n var len = void 0;\n var pathData = void 0;\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd);\n cpx = subpathX;\n cpy = subpathY;\n }\n prevCmd = cmd;\n }\n path.toStatic();\n return path;\n}\nvar SVGPath = (function (_super) {\n __extends(SVGPath, _super);\n function SVGPath() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SVGPath.prototype.applyTransform = function (m) { };\n return SVGPath;\n}(Path));\nfunction isPathProxy(path) {\n return path.setData != null;\n}\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n var innerOpts = extend({}, opts);\n innerOpts.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.setData(pathProxy.data);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n else {\n var ctx = path;\n pathProxy.rebuildPath(ctx, 1);\n }\n };\n innerOpts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirtyShape();\n };\n return innerOpts;\n}\nexport function createFromString(str, opts) {\n return new SVGPath(createPathOptions(str, opts));\n}\nexport function extendFromString(str, defaultOpts) {\n var innerOpts = createPathOptions(str, defaultOpts);\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n _this.applyTransform = innerOpts.applyTransform;\n _this.buildPath = innerOpts.buildPath;\n return _this;\n }\n return Sub;\n }(SVGPath));\n return Sub;\n}\nexport function mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n pathList.push(pathEl.getUpdatedPathProxy(true));\n }\n var pathBundle = new Path(opts);\n pathBundle.createPathProxy();\n pathBundle.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.appendPath(pathList);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n };\n return pathBundle;\n}\nexport function clonePath(sourcePath, opts) {\n opts = opts || {};\n var path = new Path();\n if (sourcePath.shape) {\n path.setShape(sourcePath.shape);\n }\n path.setStyle(sourcePath.style);\n if (opts.bakeTransform) {\n transformPath(path.path, sourcePath.getComputedTransform());\n }\n else {\n if (opts.toLocal) {\n path.setLocalTransform(sourcePath.getComputedTransform());\n }\n else {\n path.copyTransform(sourcePath);\n }\n }\n path.buildPath = sourcePath.buildPath;\n path.applyTransform = path.applyTransform;\n path.z = sourcePath.z;\n path.z2 = sourcePath.z2;\n path.zlevel = sourcePath.zlevel;\n return path;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar CircleShape = (function () {\n function CircleShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n }\n return CircleShape;\n}());\nexport { CircleShape };\nvar Circle = (function (_super) {\n __extends(Circle, _super);\n function Circle(opts) {\n return _super.call(this, opts) || this;\n }\n Circle.prototype.getDefaultShape = function () {\n return new CircleShape();\n };\n Circle.prototype.buildPath = function (ctx, shape) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\n };\n return Circle;\n}(Path));\n;\nCircle.prototype.type = 'circle';\nexport default Circle;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar EllipseShape = (function () {\n function EllipseShape() {\n this.cx = 0;\n this.cy = 0;\n this.rx = 0;\n this.ry = 0;\n }\n return EllipseShape;\n}());\nexport { EllipseShape };\nvar Ellipse = (function (_super) {\n __extends(Ellipse, _super);\n function Ellipse(opts) {\n return _super.call(this, opts) || this;\n }\n Ellipse.prototype.getDefaultShape = function () {\n return new EllipseShape();\n };\n Ellipse.prototype.buildPath = function (ctx, shape) {\n var k = 0.5522848;\n var x = shape.cx;\n var y = shape.cy;\n var a = shape.rx;\n var b = shape.ry;\n var ox = a * k;\n var oy = b * k;\n ctx.moveTo(x - a, y);\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n ctx.closePath();\n };\n return Ellipse;\n}(Path));\nEllipse.prototype.type = 'ellipse';\nexport default Ellipse;\n","import { isArray } from '../../core/util.js';\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar mathACos = Math.acos;\nvar mathATan2 = Math.atan2;\nvar mathAbs = Math.abs;\nvar mathSqrt = Math.sqrt;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar e = 1e-4;\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var dx10 = x1 - x0;\n var dy10 = y1 - y0;\n var dx32 = x3 - x2;\n var dy32 = y3 - y2;\n var t = dy32 * dx10 - dx32 * dy10;\n if (t * t < e) {\n return;\n }\n t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t;\n return [x0 + t * dx10, y0 + t * dy10];\n}\nfunction computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\n var x01 = x0 - x1;\n var y01 = y0 - y1;\n var lo = (clockwise ? cr : -cr) / mathSqrt(x01 * x01 + y01 * y01);\n var ox = lo * y01;\n var oy = -lo * x01;\n var x11 = x0 + ox;\n var y11 = y0 + oy;\n var x10 = x1 + ox;\n var y10 = y1 + oy;\n var x00 = (x11 + x10) / 2;\n var y00 = (y11 + y10) / 2;\n var dx = x10 - x11;\n var dy = y10 - y11;\n var d2 = dx * dx + dy * dy;\n var r = radius - cr;\n var s = x11 * y10 - x10 * y11;\n var d = (dy < 0 ? -1 : 1) * mathSqrt(mathMax(0, r * r * d2 - s * s));\n var cx0 = (s * dy - dx * d) / d2;\n var cy0 = (-s * dx - dy * d) / d2;\n var cx1 = (s * dy + dx * d) / d2;\n var cy1 = (-s * dx + dy * d) / d2;\n var dx0 = cx0 - x00;\n var dy0 = cy0 - y00;\n var dx1 = cx1 - x00;\n var dy1 = cy1 - y00;\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n cx0 = cx1;\n cy0 = cy1;\n }\n return {\n cx: cx0,\n cy: cy0,\n x0: -ox,\n y0: -oy,\n x1: cx0 * (radius / r - 1),\n y1: cy0 * (radius / r - 1)\n };\n}\nfunction normalizeCornerRadius(cr) {\n var arr;\n if (isArray(cr)) {\n var len = cr.length;\n if (!len) {\n return cr;\n }\n if (len === 1) {\n arr = [cr[0], cr[0], 0, 0];\n }\n else if (len === 2) {\n arr = [cr[0], cr[0], cr[1], cr[1]];\n }\n else if (len === 3) {\n arr = cr.concat(cr[2]);\n }\n else {\n arr = cr;\n }\n }\n else {\n arr = [cr, cr, cr, cr];\n }\n return arr;\n}\nexport function buildPath(ctx, shape) {\n var _a;\n var radius = mathMax(shape.r, 0);\n var innerRadius = mathMax(shape.r0 || 0, 0);\n var hasRadius = radius > 0;\n var hasInnerRadius = innerRadius > 0;\n if (!hasRadius && !hasInnerRadius) {\n return;\n }\n if (!hasRadius) {\n radius = innerRadius;\n innerRadius = 0;\n }\n if (innerRadius > radius) {\n var tmp = radius;\n radius = innerRadius;\n innerRadius = tmp;\n }\n var startAngle = shape.startAngle, endAngle = shape.endAngle;\n if (isNaN(startAngle) || isNaN(endAngle)) {\n return;\n }\n var cx = shape.cx, cy = shape.cy;\n var clockwise = !!shape.clockwise;\n var arc = mathAbs(endAngle - startAngle);\n var mod = arc > PI2 && arc % PI2;\n mod > e && (arc = mod);\n if (!(radius > e)) {\n ctx.moveTo(cx, cy);\n }\n else if (arc > PI2 - e) {\n ctx.moveTo(cx + radius * mathCos(startAngle), cy + radius * mathSin(startAngle));\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n if (innerRadius > e) {\n ctx.moveTo(cx + innerRadius * mathCos(endAngle), cy + innerRadius * mathSin(endAngle));\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n else {\n var icrStart = void 0;\n var icrEnd = void 0;\n var ocrStart = void 0;\n var ocrEnd = void 0;\n var ocrs = void 0;\n var ocre = void 0;\n var icrs = void 0;\n var icre = void 0;\n var ocrMax = void 0;\n var icrMax = void 0;\n var limitedOcrMax = void 0;\n var limitedIcrMax = void 0;\n var xre = void 0;\n var yre = void 0;\n var xirs = void 0;\n var yirs = void 0;\n var xrs = radius * mathCos(startAngle);\n var yrs = radius * mathSin(startAngle);\n var xire = innerRadius * mathCos(endAngle);\n var yire = innerRadius * mathSin(endAngle);\n var hasArc = arc > e;\n if (hasArc) {\n var cornerRadius = shape.cornerRadius;\n if (cornerRadius) {\n _a = normalizeCornerRadius(cornerRadius), icrStart = _a[0], icrEnd = _a[1], ocrStart = _a[2], ocrEnd = _a[3];\n }\n var halfRd = mathAbs(radius - innerRadius) / 2;\n ocrs = mathMin(halfRd, ocrStart);\n ocre = mathMin(halfRd, ocrEnd);\n icrs = mathMin(halfRd, icrStart);\n icre = mathMin(halfRd, icrEnd);\n limitedOcrMax = ocrMax = mathMax(ocrs, ocre);\n limitedIcrMax = icrMax = mathMax(icrs, icre);\n if (ocrMax > e || icrMax > e) {\n xre = radius * mathCos(endAngle);\n yre = radius * mathSin(endAngle);\n xirs = innerRadius * mathCos(startAngle);\n yirs = innerRadius * mathSin(startAngle);\n if (arc < PI) {\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\n if (it_1) {\n var x0 = xrs - it_1[0];\n var y0 = yrs - it_1[1];\n var x1 = xre - it_1[0];\n var y1 = yre - it_1[1];\n var a = 1 / mathSin(mathACos((x0 * x1 + y0 * y1) / (mathSqrt(x0 * x0 + y0 * y0) * mathSqrt(x1 * x1 + y1 * y1))) / 2);\n var b = mathSqrt(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\n limitedOcrMax = mathMin(ocrMax, (radius - b) / (a + 1));\n limitedIcrMax = mathMin(icrMax, (innerRadius - b) / (a - 1));\n }\n }\n }\n }\n if (!hasArc) {\n ctx.moveTo(cx + xrs, cy + yrs);\n }\n else if (limitedOcrMax > e) {\n var crStart = mathMin(ocrStart, limitedOcrMax);\n var crEnd = mathMin(ocrEnd, limitedOcrMax);\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise);\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise);\n ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n if (limitedOcrMax < ocrMax && crStart === crEnd) {\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n else {\n crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise);\n crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n else {\n ctx.moveTo(cx + xrs, cy + yrs);\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n }\n if (!(innerRadius > e) || !hasArc) {\n ctx.lineTo(cx + xire, cy + yire);\n }\n else if (limitedIcrMax > e) {\n var crStart = mathMin(icrStart, limitedIcrMax);\n var crEnd = mathMin(icrEnd, limitedIcrMax);\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise);\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise);\n ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n if (limitedIcrMax < icrMax && crStart === crEnd) {\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n else {\n crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise);\n crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n else {\n ctx.lineTo(cx + xire, cy + yire);\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n ctx.closePath();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundSectorHelper from '../helper/roundSector.js';\nvar SectorShape = (function () {\n function SectorShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n this.cornerRadius = 0;\n }\n return SectorShape;\n}());\nexport { SectorShape };\nvar Sector = (function (_super) {\n __extends(Sector, _super);\n function Sector(opts) {\n return _super.call(this, opts) || this;\n }\n Sector.prototype.getDefaultShape = function () {\n return new SectorShape();\n };\n Sector.prototype.buildPath = function (ctx, shape) {\n roundSectorHelper.buildPath(ctx, shape);\n };\n Sector.prototype.isZeroArea = function () {\n return this.shape.startAngle === this.shape.endAngle\n || this.shape.r === this.shape.r0;\n };\n return Sector;\n}(Path));\nSector.prototype.type = 'sector';\nexport default Sector;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar RingShape = (function () {\n function RingShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.r0 = 0;\n }\n return RingShape;\n}());\nexport { RingShape };\nvar Ring = (function (_super) {\n __extends(Ring, _super);\n function Ring(opts) {\n return _super.call(this, opts) || this;\n }\n Ring.prototype.getDefaultShape = function () {\n return new RingShape();\n };\n Ring.prototype.buildPath = function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var PI2 = Math.PI * 2;\n ctx.moveTo(x + shape.r, y);\n ctx.arc(x, y, shape.r, 0, PI2, false);\n ctx.moveTo(x + shape.r0, y);\n ctx.arc(x, y, shape.r0, 0, PI2, true);\n };\n return Ring;\n}(Path));\nRing.prototype.type = 'ring';\nexport default Ring;\n","import { min as v2Min, max as v2Max, scale as v2Scale, distance as v2Distance, add as v2Add, clone as v2Clone, sub as v2Sub } from '../../core/vector.js';\nexport default function smoothBezier(points, smooth, isLoop, constraint) {\n var cps = [];\n var v = [];\n var v1 = [];\n var v2 = [];\n var prevPoint;\n var nextPoint;\n var min;\n var max;\n if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\n for (var i = 0, len = points.length; i < len; i++) {\n v2Min(min, min, points[i]);\n v2Max(max, max, points[i]);\n }\n v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n }\n else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n }\n else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n v2Sub(v, nextPoint, prevPoint);\n v2Scale(v, v, smooth);\n var d0 = v2Distance(point, prevPoint);\n var d1 = v2Distance(point, nextPoint);\n var sum = d0 + d1;\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n var cp0 = v2Add([], point, v1);\n var cp1 = v2Add([], point, v2);\n if (constraint) {\n v2Max(cp0, cp0, min);\n v2Min(cp0, cp0, max);\n v2Max(cp1, cp1, min);\n v2Min(cp1, cp1, max);\n }\n cps.push(cp0);\n cps.push(cp1);\n }\n if (isLoop) {\n cps.push(cps.shift());\n }\n return cps;\n}\n","import smoothBezier from './smoothBezier.js';\nexport function buildPath(ctx, shape, closePath) {\n var smooth = shape.smooth;\n var points = shape.points;\n if (points && points.length >= 2) {\n if (smooth) {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\n var cp1 = controlPoints[i * 2];\n var cp2 = controlPoints[i * 2 + 1];\n var p = points[(i + 1) % len];\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n }\n }\n else {\n ctx.moveTo(points[0][0], points[0][1]);\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n closePath && ctx.closePath();\n }\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolygonShape = (function () {\n function PolygonShape() {\n this.points = null;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolygonShape;\n}());\nexport { PolygonShape };\nvar Polygon = (function (_super) {\n __extends(Polygon, _super);\n function Polygon(opts) {\n return _super.call(this, opts) || this;\n }\n Polygon.prototype.getDefaultShape = function () {\n return new PolygonShape();\n };\n Polygon.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n };\n return Polygon;\n}(Path));\n;\nPolygon.prototype.type = 'polygon';\nexport default Polygon;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolylineShape = (function () {\n function PolylineShape() {\n this.points = null;\n this.percent = 1;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolylineShape;\n}());\nexport { PolylineShape };\nvar Polyline = (function (_super) {\n __extends(Polyline, _super);\n function Polyline(opts) {\n return _super.call(this, opts) || this;\n }\n Polyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Polyline.prototype.getDefaultShape = function () {\n return new PolylineShape();\n };\n Polyline.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n };\n return Polyline;\n}(Path));\nPolyline.prototype.type = 'polyline';\nexport default Polyline;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport { subPixelOptimizeLine } from '../helper/subPixelOptimize.js';\nvar subPixelOptimizeOutputShape = {};\nvar LineShape = (function () {\n function LineShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n return LineShape;\n}());\nexport { LineShape };\nvar Line = (function (_super) {\n __extends(Line, _super);\n function Line(opts) {\n return _super.call(this, opts) || this;\n }\n Line.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Line.prototype.getDefaultShape = function () {\n return new LineShape();\n };\n Line.prototype.buildPath = function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = optimizedShape.x1;\n y1 = optimizedShape.y1;\n x2 = optimizedShape.x2;\n y2 = optimizedShape.y2;\n }\n else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n var percent = shape.percent;\n if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n ctx.lineTo(x2, y2);\n };\n Line.prototype.pointAt = function (p) {\n var shape = this.shape;\n return [\n shape.x1 * (1 - p) + shape.x2 * p,\n shape.y1 * (1 - p) + shape.y2 * p\n ];\n };\n return Line;\n}(Path));\nLine.prototype.type = 'line';\nexport default Line;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as vec2 from '../../core/vector.js';\nimport { quadraticSubdivide, cubicSubdivide, quadraticAt, cubicAt, quadraticDerivativeAt, cubicDerivativeAt } from '../../core/curve.js';\nvar out = [];\nvar BezierCurveShape = (function () {\n function BezierCurveShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.percent = 1;\n }\n return BezierCurveShape;\n}());\nexport { BezierCurveShape };\nfunction someVectorAt(shape, t, isTangent) {\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n if (cpx2 != null || cpy2 != null) {\n return [\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\n ];\n }\n else {\n return [\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\n ];\n }\n}\nvar BezierCurve = (function (_super) {\n __extends(BezierCurve, _super);\n function BezierCurve(opts) {\n return _super.call(this, opts) || this;\n }\n BezierCurve.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n BezierCurve.prototype.getDefaultShape = function () {\n return new BezierCurveShape();\n };\n BezierCurve.prototype.buildPath = function (ctx, shape) {\n var x1 = shape.x1;\n var y1 = shape.y1;\n var x2 = shape.x2;\n var y2 = shape.y2;\n var cpx1 = shape.cpx1;\n var cpy1 = shape.cpy1;\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n var percent = shape.percent;\n if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\n if (cpx2 == null || cpy2 == null) {\n if (percent < 1) {\n quadraticSubdivide(x1, cpx1, x2, percent, out);\n cpx1 = out[1];\n x2 = out[2];\n quadraticSubdivide(y1, cpy1, y2, percent, out);\n cpy1 = out[1];\n y2 = out[2];\n }\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n }\n else {\n if (percent < 1) {\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\n cpx1 = out[1];\n cpx2 = out[2];\n x2 = out[3];\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\n cpy1 = out[1];\n cpy2 = out[2];\n y2 = out[3];\n }\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n }\n };\n BezierCurve.prototype.pointAt = function (t) {\n return someVectorAt(this.shape, t, false);\n };\n BezierCurve.prototype.tangentAt = function (t) {\n var p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n };\n return BezierCurve;\n}(Path));\n;\nBezierCurve.prototype.type = 'bezier-curve';\nexport default BezierCurve;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar ArcShape = (function () {\n function ArcShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n return ArcShape;\n}());\nexport { ArcShape };\nvar Arc = (function (_super) {\n __extends(Arc, _super);\n function Arc(opts) {\n return _super.call(this, opts) || this;\n }\n Arc.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Arc.prototype.getDefaultShape = function () {\n return new ArcShape();\n };\n Arc.prototype.buildPath = function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n };\n return Arc;\n}(Path));\nArc.prototype.type = 'arc';\nexport default Arc;\n","import { __extends } from \"tslib\";\nimport Path from './Path.js';\nvar CompoundPath = (function (_super) {\n __extends(CompoundPath, _super);\n function CompoundPath() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'compound';\n return _this;\n }\n CompoundPath.prototype._updatePathDirty = function () {\n var paths = this.shape.paths;\n var dirtyPath = this.shapeChanged();\n for (var i = 0; i < paths.length; i++) {\n dirtyPath = dirtyPath || paths[i].shapeChanged();\n }\n if (dirtyPath) {\n this.dirtyShape();\n }\n };\n CompoundPath.prototype.beforeBrush = function () {\n this._updatePathDirty();\n var paths = this.shape.paths || [];\n var scale = this.getGlobalScale();\n for (var i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n }\n };\n CompoundPath.prototype.buildPath = function (ctx, shape) {\n var paths = shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n };\n CompoundPath.prototype.afterBrush = function () {\n var paths = this.shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].pathUpdated();\n }\n };\n CompoundPath.prototype.getBoundingRect = function () {\n this._updatePathDirty.call(this);\n return Path.prototype.getBoundingRect.call(this);\n };\n return CompoundPath;\n}(Path));\nexport default CompoundPath;\n","var Gradient = (function () {\n function Gradient(colorStops) {\n this.colorStops = colorStops || [];\n }\n Gradient.prototype.addColorStop = function (offset, color) {\n this.colorStops.push({\n offset: offset,\n color: color\n });\n };\n return Gradient;\n}());\nexport default Gradient;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar LinearGradient = (function (_super) {\n __extends(LinearGradient, _super);\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\n _this.x = x == null ? 0 : x;\n _this.y = y == null ? 0 : y;\n _this.x2 = x2 == null ? 1 : x2;\n _this.y2 = y2 == null ? 0 : y2;\n _this.type = 'linear';\n _this.global = globalCoord || false;\n return _this;\n }\n return LinearGradient;\n}(Gradient));\nexport default LinearGradient;\n;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar RadialGradient = (function (_super) {\n __extends(RadialGradient, _super);\n function RadialGradient(x, y, r, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\n _this.x = x == null ? 0.5 : x;\n _this.y = y == null ? 0.5 : y;\n _this.r = r == null ? 0.5 : r;\n _this.type = 'radial';\n _this.global = globalCoord || false;\n return _this;\n }\n return RadialGradient;\n}(Gradient));\nexport default RadialGradient;\n","import Point from './Point.js';\nvar extent = [0, 0];\nvar extent2 = [0, 0];\nvar minTv = new Point();\nvar maxTv = new Point();\nvar OrientedBoundingRect = (function () {\n function OrientedBoundingRect(rect, transform) {\n this._corners = [];\n this._axes = [];\n this._origin = [0, 0];\n for (var i = 0; i < 4; i++) {\n this._corners[i] = new Point();\n }\n for (var i = 0; i < 2; i++) {\n this._axes[i] = new Point();\n }\n if (rect) {\n this.fromBoundingRect(rect, transform);\n }\n }\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\n var corners = this._corners;\n var axes = this._axes;\n var x = rect.x;\n var y = rect.y;\n var x2 = x + rect.width;\n var y2 = y + rect.height;\n corners[0].set(x, y);\n corners[1].set(x2, y);\n corners[2].set(x2, y2);\n corners[3].set(x, y2);\n if (transform) {\n for (var i = 0; i < 4; i++) {\n corners[i].transform(transform);\n }\n }\n Point.sub(axes[0], corners[1], corners[0]);\n Point.sub(axes[1], corners[3], corners[0]);\n axes[0].normalize();\n axes[1].normalize();\n for (var i = 0; i < 2; i++) {\n this._origin[i] = axes[i].dot(corners[0]);\n }\n };\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\n var overlapped = true;\n var noMtv = !mtv;\n minTv.set(Infinity, Infinity);\n maxTv.set(0, 0);\n if (!this._intersectCheckOneSide(this, other, minTv, maxTv, noMtv, 1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!this._intersectCheckOneSide(other, this, minTv, maxTv, noMtv, -1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!noMtv) {\n Point.copy(mtv, overlapped ? minTv : maxTv);\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\n var overlapped = true;\n for (var i = 0; i < 2; i++) {\n var axis = this._axes[i];\n this._getProjMinMaxOnAxis(i, self._corners, extent);\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) > maxTv.len()) {\n if (dist0 < dist1) {\n Point.scale(maxTv, axis, -dist0 * inverse);\n }\n else {\n Point.scale(maxTv, axis, dist1 * inverse);\n }\n }\n }\n else if (minTv) {\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) < minTv.len()) {\n if (dist0 < dist1) {\n Point.scale(minTv, axis, dist0 * inverse);\n }\n else {\n Point.scale(minTv, axis, -dist1 * inverse);\n }\n }\n }\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\n var axis = this._axes[dim];\n var origin = this._origin;\n var proj = corners[0].dot(axis) + origin[dim];\n var min = proj;\n var max = proj;\n for (var i = 1; i < corners.length; i++) {\n var proj_1 = corners[i].dot(axis) + origin[dim];\n min = Math.min(proj_1, min);\n max = Math.max(proj_1, max);\n }\n out[0] = min;\n out[1] = max;\n };\n return OrientedBoundingRect;\n}());\nexport default OrientedBoundingRect;\n","import { __extends } from \"tslib\";\nimport Displayble from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar m = [];\nvar IncrementalDisplayable = (function (_super) {\n __extends(IncrementalDisplayable, _super);\n function IncrementalDisplayable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.notClear = true;\n _this.incremental = true;\n _this._displayables = [];\n _this._temporaryDisplayables = [];\n _this._cursor = 0;\n return _this;\n }\n IncrementalDisplayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n IncrementalDisplayable.prototype.useStyle = function () {\n this.style = {};\n };\n IncrementalDisplayable.prototype.getCursor = function () {\n return this._cursor;\n };\n IncrementalDisplayable.prototype.innerAfterBrush = function () {\n this._cursor = this._displayables.length;\n };\n IncrementalDisplayable.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.markRedraw();\n this.notClear = false;\n };\n IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {\n this._temporaryDisplayables = [];\n };\n IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n }\n else {\n this._displayables.push(displayable);\n }\n this.markRedraw();\n };\n IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n };\n IncrementalDisplayable.prototype.getDisplayables = function () {\n return this._displayables;\n };\n IncrementalDisplayable.prototype.getTemporalDisplayables = function () {\n return this._temporaryDisplayables;\n };\n IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n };\n IncrementalDisplayable.prototype.update = function () {\n this.updateTransform();\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n };\n IncrementalDisplayable.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n rect.union(childRect);\n }\n this._rect = rect;\n }\n return this._rect;\n };\n IncrementalDisplayable.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n if (rect.contain(localPos[0], localPos[1])) {\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n return false;\n };\n return IncrementalDisplayable;\n}(Displayble));\nexport default IncrementalDisplayable;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js';\n// Stored properties for further transition.\nexport var transitionStore = makeInner();\n/**\n * Return null if animation is disabled.\n */\nexport function getAnimationConfig(animationType, animatableModel, dataIndex,\n// Extra opts can override the option in animatable model.\nextraOpts,\n// TODO It's only for pictorial bar now.\nextraDelayParams) {\n var animationPayload;\n // Check if there is global animation configuration from dataZoom/resize can override the config in option.\n // If animation is enabled. Will use this animation config in payload.\n // If animation is disabled. Just ignore it.\n if (animatableModel && animatableModel.ecModel) {\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\n animationPayload = updatePayload && updatePayload.animation;\n }\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\n var isUpdate = animationType === 'update';\n if (animationEnabled) {\n var duration = void 0;\n var easing = void 0;\n var delay = void 0;\n if (extraOpts) {\n duration = retrieve2(extraOpts.duration, 200);\n easing = retrieve2(extraOpts.easing, 'cubicOut');\n delay = 0;\n } else {\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\n easing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\n delay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\n }\n // animation from payload has highest priority.\n if (animationPayload) {\n animationPayload.duration != null && (duration = animationPayload.duration);\n animationPayload.easing != null && (easing = animationPayload.easing);\n animationPayload.delay != null && (delay = animationPayload.delay);\n }\n if (isFunction(delay)) {\n delay = delay(dataIndex, extraDelayParams);\n }\n if (isFunction(duration)) {\n duration = duration(dataIndex);\n }\n var config = {\n duration: duration || 0,\n delay: delay,\n easing: easing\n };\n return config;\n } else {\n return null;\n }\n}\nfunction animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\n var isFrom = false;\n var removeOpt;\n if (isFunction(dataIndex)) {\n during = cb;\n cb = dataIndex;\n dataIndex = null;\n } else if (isObject(dataIndex)) {\n cb = dataIndex.cb;\n during = dataIndex.during;\n isFrom = dataIndex.isFrom;\n removeOpt = dataIndex.removeOpt;\n dataIndex = dataIndex.dataIndex;\n }\n var isRemove = animationType === 'leave';\n if (!isRemove) {\n // Must stop the remove animation.\n el.stopAnimation('leave');\n }\n var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);\n if (animationConfig && animationConfig.duration > 0) {\n var duration = animationConfig.duration;\n var animationDelay = animationConfig.delay;\n var animationEasing = animationConfig.easing;\n var animateConfig = {\n duration: duration,\n delay: animationDelay || 0,\n easing: animationEasing,\n done: cb,\n force: !!cb || !!during,\n // Set to final state in update/init animation.\n // So the post processing based on the path shape can be done correctly.\n setToFinal: !isRemove,\n scope: animationType,\n during: during\n };\n isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig);\n } else {\n el.stopAnimation();\n // If `isFrom`, the props is the \"from\" props.\n !isFrom && el.attr(props);\n // Call during at least once.\n during && during(1);\n cb && cb();\n }\n}\n/**\n * Update graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n * @example\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\n * // Or\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, function () { console.log('Animation done!'); });\n */\nfunction updateProps(el, props,\n// TODO: TYPE AnimatableModel\nanimatableModel, dataIndex, cb, during) {\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\n}\nexport { updateProps };\n/**\n * Init graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n */\nexport function initProps(el, props, animatableModel, dataIndex, cb, during) {\n animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during);\n}\n/**\n * If element is removed.\n * It can determine if element is having remove animation.\n */\nexport function isElementRemoved(el) {\n if (!el.__zr) {\n return true;\n }\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n if (animator.scope === 'leave') {\n return true;\n }\n }\n return false;\n}\n/**\n * Remove graphic element\n */\nexport function removeElement(el, props, animatableModel, dataIndex, cb, during) {\n // Don't do remove animation twice.\n if (isElementRemoved(el)) {\n return;\n }\n animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during);\n}\nfunction fadeOutDisplayable(el, animatableModel, dataIndex, done) {\n el.removeTextContent();\n el.removeTextGuideLine();\n removeElement(el, {\n style: {\n opacity: 0\n }\n }, animatableModel, dataIndex, done);\n}\nexport function removeElementWithFadeOut(el, animatableModel, dataIndex) {\n function doRemove() {\n el.parent && el.parent.remove(el);\n }\n // Hide label and labelLine first\n // TODO Also use fade out animation?\n if (!el.isGroup) {\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\n } else {\n el.traverse(function (disp) {\n if (!disp.isGroup) {\n // Can invoke doRemove multiple times.\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\n }\n });\n }\n}\n/**\n * Save old style for style transition in universalTransition module.\n * It's used when element will be reused in each render.\n * For chart like map, heatmap, which will always create new element.\n * We don't need to save this because universalTransition can get old style from the old element\n */\nexport function saveOldStyle(el) {\n transitionStore(el).oldStyle = el.style;\n}\nexport function getOldStyle(el) {\n return transitionStore(el).oldStyle;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as pathTool from 'zrender/lib/tool/path.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport Circle from 'zrender/lib/graphic/shape/Circle.js';\nimport Ellipse from 'zrender/lib/graphic/shape/Ellipse.js';\nimport Sector from 'zrender/lib/graphic/shape/Sector.js';\nimport Ring from 'zrender/lib/graphic/shape/Ring.js';\nimport Polygon from 'zrender/lib/graphic/shape/Polygon.js';\nimport Polyline from 'zrender/lib/graphic/shape/Polyline.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport Line from 'zrender/lib/graphic/shape/Line.js';\nimport BezierCurve from 'zrender/lib/graphic/shape/BezierCurve.js';\nimport Arc from 'zrender/lib/graphic/shape/Arc.js';\nimport CompoundPath from 'zrender/lib/graphic/CompoundPath.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport RadialGradient from 'zrender/lib/graphic/RadialGradient.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport OrientedBoundingRect from 'zrender/lib/core/OrientedBoundingRect.js';\nimport Point from 'zrender/lib/core/Point.js';\nimport IncrementalDisplayable from 'zrender/lib/graphic/IncrementalDisplayable.js';\nimport * as subPixelOptimizeUtil from 'zrender/lib/graphic/helper/subPixelOptimize.js';\nimport { extend, isArrayLike, map, defaults, isString, keys, each, hasOwn, isArray } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved } from '../animation/basicTransition.js';\n/**\n * @deprecated export for compatitable reason\n */\nexport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved };\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar _customShapeMap = {};\n/**\n * Extend shape with parameters\n */\nexport function extendShape(opts) {\n return Path.extend(opts);\n}\nvar extendPathFromString = pathTool.extendFromString;\n/**\n * Extend path\n */\nexport function extendPath(pathData, opts) {\n return extendPathFromString(pathData, opts);\n}\n/**\n * Register a user defined shape.\n * The shape class can be fetched by `getShapeClass`\n * This method will overwrite the registered shapes, including\n * the registered built-in shapes, if using the same `name`.\n * The shape can be used in `custom series` and\n * `graphic component` by declaring `{type: name}`.\n *\n * @param name\n * @param ShapeClass Can be generated by `extendShape`.\n */\nexport function registerShape(name, ShapeClass) {\n _customShapeMap[name] = ShapeClass;\n}\n/**\n * Find shape class registered by `registerShape`. Usually used in\n * fetching user defined shape.\n *\n * [Caution]:\n * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared\n * to use user registered shapes.\n * Because the built-in shape (see `getBuiltInShape`) will be registered by\n * `registerShape` by default. That enables users to get both built-in\n * shapes as well as the shapes belonging to themsleves. But users can overwrite\n * the built-in shapes by using names like 'circle', 'rect' via calling\n * `registerShape`. So the echarts inner featrues should not fetch shapes from here\n * in case that it is overwritten by users, except that some features, like\n * `custom series`, `graphic component`, do it deliberately.\n *\n * (2) In the features like `custom series`, `graphic component`, the user input\n * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic\n * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names\n * are reserved names, that is, if some user registers a shape named `'image'`,\n * the shape will not be used. If we intending to add some more reserved names\n * in feature, that might bring break changes (disable some existing user shape\n * names). But that case probably rarely happens. So we don't make more mechanism\n * to resolve this issue here.\n *\n * @param name\n * @return The shape class. If not found, return nothing.\n */\nexport function getShapeClass(name) {\n if (_customShapeMap.hasOwnProperty(name)) {\n return _customShapeMap[name];\n }\n}\n/**\n * Create a path element from path data string\n * @param pathData\n * @param opts\n * @param rect\n * @param layout 'center' or 'cover' default to be cover\n */\nexport function makePath(pathData, opts, rect, layout) {\n var path = pathTool.createFromString(pathData, opts);\n if (rect) {\n if (layout === 'center') {\n rect = centerGraphic(rect, path.getBoundingRect());\n }\n resizePath(path, rect);\n }\n return path;\n}\n/**\n * Create a image element from image url\n * @param imageUrl image url\n * @param opts options\n * @param rect constrain rect\n * @param layout 'center' or 'cover'. Default to be 'cover'\n */\nexport function makeImage(imageUrl, rect, layout) {\n var zrImg = new ZRImage({\n style: {\n image: imageUrl,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n onload: function (img) {\n if (layout === 'center') {\n var boundingRect = {\n width: img.width,\n height: img.height\n };\n zrImg.setStyle(centerGraphic(rect, boundingRect));\n }\n }\n });\n return zrImg;\n}\n/**\n * Get position of centered element in bounding box.\n *\n * @param rect element local bounding box\n * @param boundingRect constraint bounding box\n * @return element position containing x, y, width, and height\n */\nfunction centerGraphic(rect, boundingRect) {\n // Set rect to center, keep width / height ratio.\n var aspect = boundingRect.width / boundingRect.height;\n var width = rect.height * aspect;\n var height;\n if (width <= rect.width) {\n height = rect.height;\n } else {\n width = rect.width;\n height = width / aspect;\n }\n var cx = rect.x + rect.width / 2;\n var cy = rect.y + rect.height / 2;\n return {\n x: cx - width / 2,\n y: cy - height / 2,\n width: width,\n height: height\n };\n}\nexport var mergePath = pathTool.mergePath;\n/**\n * Resize a path to fit the rect\n * @param path\n * @param rect\n */\nexport function resizePath(path, rect) {\n if (!path.applyTransform) {\n return;\n }\n var pathRect = path.getBoundingRect();\n var m = pathRect.calculateTransform(rect);\n path.applyTransform(m);\n}\n/**\n * Sub pixel optimize line for canvas\n */\nexport function subPixelOptimizeLine(shape, lineWidth) {\n subPixelOptimizeUtil.subPixelOptimizeLine(shape, shape, {\n lineWidth: lineWidth\n });\n return shape;\n}\n/**\n * Sub pixel optimize rect for canvas\n */\nexport function subPixelOptimizeRect(param) {\n subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style);\n return param;\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param position Coordinate, such as x, y\n * @param lineWidth Should be nonnegative integer.\n * @param positiveOrNegative Default false (negative).\n * @return Optimized position.\n */\nexport var subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;\n/**\n * Get transform matrix of target (param target),\n * in coordinate of its ancestor (param ancestor)\n *\n * @param target\n * @param [ancestor]\n */\nexport function getTransform(target, ancestor) {\n var mat = matrix.identity([]);\n while (target && target !== ancestor) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n return mat;\n}\n/**\n * Apply transform to an vertex.\n * @param target [x, y]\n * @param transform Can be:\n * + Transform matrix: like [1, 0, 0, 1, 0, 0]\n * + {position, rotation, scale}, the same as `zrender/Transformable`.\n * @param invert Whether use invert matrix.\n * @return [x, y]\n */\nexport function applyTransform(target, transform, invert) {\n if (transform && !isArrayLike(transform)) {\n transform = Transformable.getLocalTransform(transform);\n }\n if (invert) {\n transform = matrix.invert([], transform);\n }\n return vector.applyTransform([], target, transform);\n}\n/**\n * @param direction 'left' 'right' 'top' 'bottom'\n * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]\n * @param invert Whether use invert matrix.\n * @return Transformed direction. 'left' 'right' 'top' 'bottom'\n */\nexport function transformDirection(direction, transform, invert) {\n // Pick a base, ensure that transform result will not be (0, 0).\n var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : Math.abs(2 * transform[4] / transform[0]);\n var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : Math.abs(2 * transform[4] / transform[2]);\n var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0];\n vertex = applyTransform(vertex, transform, invert);\n return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top';\n}\nfunction isNotGroup(el) {\n return !el.isGroup;\n}\nfunction isPath(el) {\n return el.shape != null;\n}\n/**\n * Apply group transition animation from g1 to g2.\n * If no animatableModel, no animation.\n */\nexport function groupTransition(g1, g2, animatableModel) {\n if (!g1 || !g2) {\n return;\n }\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n function getAnimatableProps(el) {\n var obj = {\n x: el.x,\n y: el.y,\n rotation: el.rotation\n };\n if (isPath(el)) {\n obj.shape = extend({}, el.shape);\n }\n return obj;\n }\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n var oldEl = elMap1[el.anid];\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\n }\n }\n });\n}\nexport function clipPointsByRect(points, rect) {\n // FIXME: This way might be incorrect when graphic clipped by a corner\n // and when element has a border.\n return map(points, function (point) {\n var x = point[0];\n x = mathMax(x, rect.x);\n x = mathMin(x, rect.x + rect.width);\n var y = point[1];\n y = mathMax(y, rect.y);\n y = mathMin(y, rect.y + rect.height);\n return [x, y];\n });\n}\n/**\n * Return a new clipped rect. If rect size are negative, return undefined.\n */\nexport function clipRectByRect(targetRect, rect) {\n var x = mathMax(targetRect.x, rect.x);\n var x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width);\n var y = mathMax(targetRect.y, rect.y);\n var y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height);\n // If the total rect is cliped, nothing, including the border,\n // should be painted. So return undefined.\n if (x2 >= x && y2 >= y) {\n return {\n x: x,\n y: y,\n width: x2 - x,\n height: y2 - y\n };\n }\n}\nexport function createIcon(iconStr,\n// Support 'image://' or 'path://' or direct svg path.\nopt, rect) {\n var innerOpts = extend({\n rectHover: true\n }, opt);\n var style = innerOpts.style = {\n strokeNoScale: true\n };\n rect = rect || {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n };\n if (iconStr) {\n return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center');\n }\n}\n/**\n * Return `true` if the given line (line `a`) and the given polygon\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n */\nexport function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\n var p = points[i];\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\n return true;\n }\n p2 = p;\n }\n}\n/**\n * Return `true` if the given two lines (line `a` and line `b`)\n * are intersect.\n * Note that we do not count colinear as intersect here because no\n * requirement for that. We could do that if required in future.\n */\nexport function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y;\n // `vec_m` and `vec_n` are parallel iff\n // existing `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n if (nearZero(nmCrossProduct)) {\n return false;\n }\n // `vec_m` and `vec_n` are intersect iff\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n if (q < 0 || q > 1) {\n return false;\n }\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n if (p < 0 || p > 1) {\n return false;\n }\n return true;\n}\n/**\n * Cross product of 2-dimension vector.\n */\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\nfunction nearZero(val) {\n return val <= 1e-6 && val >= -1e-6;\n}\nexport function setTooltipConfig(opt) {\n var itemTooltipOption = opt.itemTooltipOption;\n var componentModel = opt.componentModel;\n var itemName = opt.itemName;\n var itemTooltipOptionObj = isString(itemTooltipOption) ? {\n formatter: itemTooltipOption\n } : itemTooltipOption;\n var mainType = componentModel.mainType;\n var componentIndex = componentModel.componentIndex;\n var formatterParams = {\n componentType: mainType,\n name: itemName,\n $vars: ['name']\n };\n formatterParams[mainType + 'Index'] = componentIndex;\n var formatterParamsExtra = opt.formatterParamsExtra;\n if (formatterParamsExtra) {\n each(keys(formatterParamsExtra), function (key) {\n if (!hasOwn(formatterParams, key)) {\n formatterParams[key] = formatterParamsExtra[key];\n formatterParams.$vars.push(key);\n }\n });\n }\n var ecData = getECData(opt.el);\n ecData.componentMainType = mainType;\n ecData.componentIndex = componentIndex;\n ecData.tooltipConfig = {\n name: itemName,\n option: defaults({\n content: itemName,\n encodeHTMLContent: true,\n formatterParams: formatterParams\n }, itemTooltipOptionObj)\n };\n}\nfunction traverseElement(el, cb) {\n var stopped;\n // TODO\n // Polyfill for fixing zrender group traverse don't visit it's root issue.\n if (el.isGroup) {\n stopped = cb(el);\n }\n if (!stopped) {\n el.traverse(cb);\n }\n}\nexport function traverseElements(els, cb) {\n if (els) {\n if (isArray(els)) {\n for (var i = 0; i < els.length; i++) {\n traverseElement(els[i], cb);\n }\n } else {\n traverseElement(els, cb);\n }\n }\n}\n// Register built-in shapes. These shapes might be overwritten\n// by users, although we do not recommend that.\nregisterShape('circle', Circle);\nregisterShape('ellipse', Ellipse);\nregisterShape('sector', Sector);\nregisterShape('ring', Ring);\nregisterShape('polygon', Polygon);\nregisterShape('polyline', Polyline);\nregisterShape('rect', Rect);\nregisterShape('line', Line);\nregisterShape('bezierCurve', BezierCurve);\nregisterShape('arc', Arc);\nexport { Group, ZRImage as Image, ZRText as Text, Circle, Ellipse, Sector, Ring, Polygon, Polyline, Rect, Line, BezierCurve, Arc, IncrementalDisplayable, CompoundPath, LinearGradient, RadialGradient, BoundingRect, OrientedBoundingRect, Point, Path };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { isFunction, retrieve2, extend, keys, trim } from 'zrender/lib/core/util.js';\nimport { SPECIAL_STATES, DISPLAY_STATES } from '../util/states.js';\nimport { deprecateReplaceLog } from '../util/log.js';\nimport { makeInner, interpolateRawValues } from '../util/model.js';\nimport { initProps, updateProps } from '../util/graphic.js';\nvar EMPTY_OBJ = {};\nexport function setLabelText(label, labelTexts) {\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var text = labelTexts[stateName];\n var state = label.ensureState(stateName);\n state.style = state.style || {};\n state.style.text = text;\n }\n var oldStates = label.currentStates.slice();\n label.clearStates(true);\n label.setStyle({\n text: labelTexts.normal\n });\n label.useStates(oldStates, true);\n}\nfunction getLabelText(opt, stateModels, interpolatedValue) {\n var labelFetcher = opt.labelFetcher;\n var labelDataIndex = opt.labelDataIndex;\n var labelDimIndex = opt.labelDimIndex;\n var normalModel = stateModels.normal;\n var baseText;\n if (labelFetcher) {\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? {\n interpolatedValue: interpolatedValue\n } : null);\n }\n if (baseText == null) {\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText;\n }\n var statesText = {\n normal: baseText\n };\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = stateModels[stateName];\n statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText);\n }\n return statesText;\n}\nfunction setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified\n// TODO specified position?\n) {\n opt = opt || EMPTY_OBJ;\n var isSetOnText = targetEl instanceof ZRText;\n var needsCreateText = false;\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\n if (stateModel && stateModel.getShallow('show')) {\n needsCreateText = true;\n break;\n }\n }\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\n if (needsCreateText) {\n if (!isSetOnText) {\n // Reuse the previous\n if (!textContent) {\n textContent = new ZRText();\n targetEl.setTextContent(textContent);\n }\n // Use same state proxy\n if (targetEl.stateProxy) {\n textContent.stateProxy = targetEl.stateProxy;\n }\n }\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\n var normalModel = labelStatesModels.normal;\n var showNormal = !!normalModel.getShallow('show');\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\n normalStyle.text = labelStatesTexts.normal;\n if (!isSetOnText) {\n // Always create new\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\n }\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = labelStatesModels[stateName];\n if (stateModel) {\n var stateObj = textContent.ensureState(stateName);\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\n if (stateShow !== showNormal) {\n stateObj.ignore = !stateShow;\n }\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\n stateObj.style.text = labelStatesTexts[stateName];\n if (!isSetOnText) {\n var targetElEmphasisState = targetEl.ensureState(stateName);\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\n }\n }\n }\n // PENDING: if there is many requirements that emphasis position\n // need to be different from normal position, we might consider\n // auto silent is those cases.\n textContent.silent = !!normalModel.getShallow('silent');\n // Keep x and y\n if (textContent.style.x != null) {\n normalStyle.x = textContent.style.x;\n }\n if (textContent.style.y != null) {\n normalStyle.y = textContent.style.y;\n }\n textContent.ignore = !showNormal;\n // Always create new style.\n textContent.useStyle(normalStyle);\n textContent.dirty();\n if (opt.enableTextSetter) {\n labelInner(textContent).setLabelText = function (interpolatedValue) {\n var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue);\n setLabelText(textContent, labelStatesTexts);\n };\n }\n } else if (textContent) {\n // Not display rich text.\n textContent.ignore = true;\n }\n targetEl.dirty();\n}\nexport { setLabelStyle };\nexport function getLabelStatesModels(itemModel, labelName) {\n labelName = labelName || 'label';\n var statesModels = {\n normal: itemModel.getModel(labelName)\n };\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\n }\n return statesModels;\n}\n/**\n * Set basic textStyle properties.\n */\nexport function createTextStyle(textStyleModel, specifiedTextStyle,\n// Fixed style in the code. Can't be set by model.\nopt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender.\n) {\n var textStyle = {};\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\n // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n return textStyle;\n}\nexport function createTextConfig(textStyleModel, opt, isNotNormal) {\n opt = opt || {};\n var textConfig = {};\n var labelPosition;\n var labelRotate = textStyleModel.getShallow('rotate');\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\n var labelOffset = textStyleModel.getShallow('offset');\n labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside');\n // 'outside' is not a valid zr textPostion value, but used\n // in bar series, and magric type should be considered.\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\n if (labelPosition != null) {\n textConfig.position = labelPosition;\n }\n if (labelOffset != null) {\n textConfig.offset = labelOffset;\n }\n if (labelRotate != null) {\n labelRotate *= Math.PI / 180;\n textConfig.rotation = labelRotate;\n }\n if (labelDistance != null) {\n textConfig.distance = labelDistance;\n }\n // fill and auto is determined by the color of path fill if it's not specified by developers.\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto';\n return textConfig;\n}\n/**\n * The uniform entry of set text style, that is, retrieve style definitions\n * from `model` and set to `textStyle` object.\n *\n * Never in merge mode, but in overwrite mode, that is, all of the text style\n * properties will be set. (Consider the states of normal and emphasis and\n * default value can be adopted, merge would make the logic too complicated\n * to manage.)\n */\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\n // Consider there will be abnormal when merge hover style to normal style if given default value.\n opt = opt || EMPTY_OBJ;\n var ecModel = textStyleModel.ecModel;\n var globalTextStyle = ecModel && ecModel.option.textStyle;\n // Consider case:\n // {\n // data: [{\n // value: 12,\n // label: {\n // rich: {\n // // no 'a' here but using parent 'a'.\n // }\n // }\n // }],\n // rich: {\n // a: { ... }\n // }\n // }\n var richItemNames = getRichItemNames(textStyleModel);\n var richResult;\n if (richItemNames) {\n richResult = {};\n for (var name_1 in richItemNames) {\n if (richItemNames.hasOwnProperty(name_1)) {\n // Cascade is supported in rich.\n var richTextStyle = textStyleModel.getModel(['rich', name_1]);\n // In rich, never `disableBox`.\n // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n // the default color `'blue'` will not be adopted if no color declared in `rich`.\n // That might confuses users. So probably we should put `textStyleModel` as the\n // root ancestor of the `richTextStyle`. But that would be a break change.\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\n }\n }\n }\n if (richResult) {\n textStyle.rich = richResult;\n }\n var overflow = textStyleModel.get('overflow');\n if (overflow) {\n textStyle.overflow = overflow;\n }\n var margin = textStyleModel.get('minMargin');\n if (margin != null) {\n textStyle.margin = margin;\n }\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\n}\n// Consider case:\n// {\n// data: [{\n// value: 12,\n// label: {\n// rich: {\n// // no 'a' here but using parent 'a'.\n// }\n// }\n// }],\n// rich: {\n// a: { ... }\n// }\n// }\n// TODO TextStyleModel\nfunction getRichItemNames(textStyleModel) {\n // Use object to remove duplicated names.\n var richItemNameMap;\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\n if (rich) {\n richItemNameMap = richItemNameMap || {};\n var richKeys = keys(rich);\n for (var i = 0; i < richKeys.length; i++) {\n var richKey = richKeys[i];\n richItemNameMap[richKey] = 1;\n }\n }\n textStyleModel = textStyleModel.parentModel;\n }\n return richItemNameMap;\n}\nvar TEXT_PROPS_WITH_GLOBAL = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'];\nvar TEXT_PROPS_SELF = ['align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign', 'ellipsis'];\nvar TEXT_PROPS_BOX = ['padding', 'borderWidth', 'borderRadius', 'borderDashOffset', 'backgroundColor', 'borderColor', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\n // In merge mode, default value should not be given.\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\n var inheritColor = opt && opt.inheritColor;\n var fillColor = textStyleModel.getShallow('color');\n var strokeColor = textStyleModel.getShallow('textBorderColor');\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\n if (fillColor === 'inherit' || fillColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (fillColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n if (inheritColor) {\n fillColor = inheritColor;\n } else {\n fillColor = null;\n }\n }\n if (strokeColor === 'inherit' || strokeColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (strokeColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n if (inheritColor) {\n strokeColor = inheritColor;\n } else {\n strokeColor = null;\n }\n }\n if (!isAttached) {\n // Only use default global textStyle.color if text is individual.\n // Otherwise it will use the strategy of attached text color because text may be on a path.\n fillColor = fillColor || globalTextStyle.color;\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\n }\n if (fillColor != null) {\n textStyle.fill = fillColor;\n }\n if (strokeColor != null) {\n textStyle.stroke = strokeColor;\n }\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\n if (textBorderWidth != null) {\n textStyle.lineWidth = textBorderWidth;\n }\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\n if (textBorderType != null) {\n textStyle.lineDash = textBorderType;\n }\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\n if (textBorderDashOffset != null) {\n textStyle.lineDashOffset = textBorderDashOffset;\n }\n if (!isNotNormal && opacity == null && !inRich) {\n opacity = opt && opt.defaultOpacity;\n }\n if (opacity != null) {\n textStyle.opacity = opacity;\n }\n // TODO\n if (!isNotNormal && !isAttached) {\n // Set default finally.\n if (textStyle.fill == null && opt.inheritColor) {\n textStyle.fill = opt.inheritColor;\n }\n }\n // Do not use `getFont` here, because merge should be supported, where\n // part of these properties may be changed in emphasis style, and the\n // others should remain their original value got from normal style.\n for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\n var key = TEXT_PROPS_WITH_GLOBAL[i];\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\n if (val != null) {\n textStyle[key] = val;\n }\n }\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\n var key = TEXT_PROPS_SELF[i];\n var val = textStyleModel.getShallow(key);\n if (val != null) {\n textStyle[key] = val;\n }\n }\n if (textStyle.verticalAlign == null) {\n var baseline = textStyleModel.getShallow('baseline');\n if (baseline != null) {\n textStyle.verticalAlign = baseline;\n }\n }\n if (!isBlock || !opt.disableBox) {\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\n var key = TEXT_PROPS_BOX[i];\n var val = textStyleModel.getShallow(key);\n if (val != null) {\n textStyle[key] = val;\n }\n }\n var borderType = textStyleModel.getShallow('borderType');\n if (borderType != null) {\n textStyle.borderDash = borderType;\n }\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.backgroundColor === 'auto') {\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\n }\n }\n textStyle.backgroundColor = inheritColor;\n }\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.borderColor === 'auto') {\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\n }\n }\n textStyle.borderColor = inheritColor;\n }\n }\n}\nexport function getFont(opt, ecModel) {\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\n return trim([\n // FIXME in node-canvas fontWeight is before fontStyle\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'].join(' '));\n}\nexport var labelInner = makeInner();\nexport function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\n if (!label) {\n return;\n }\n var obj = labelInner(label);\n obj.prevValue = obj.value;\n obj.value = value;\n var normalLabelModel = labelStatesModels.normal;\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\n if (obj.valueAnimation) {\n obj.precision = normalLabelModel.get('precision');\n obj.defaultInterpolatedText = getDefaultText;\n obj.statesModels = labelStatesModels;\n }\n}\nexport function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) {\n var labelInnerStore = labelInner(textEl);\n if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) {\n // Value not changed, no new label animation\n return;\n }\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\n // Consider the case that being animating, do not use the `obj.value`,\n // Otherwise it will jump to the `obj.value` when this new animation started.\n var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue);\n var targetValue = labelInnerStore.value;\n function during(percent) {\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent);\n labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated;\n var labelText = getLabelText({\n labelDataIndex: dataIndex,\n labelFetcher: labelFetcher,\n defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + ''\n }, labelInnerStore.statesModels, interpolated);\n setLabelText(textEl, labelText);\n }\n textEl.percent = 0;\n (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, {\n // percent is used to prevent animation from being aborted #15916\n percent: 1\n }, animatableModel, dataIndex, null, during);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getFont } from '../../label/labelStyle.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nvar PATH_COLOR = ['textStyle', 'color'];\nvar textStyleParams = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'padding', 'lineHeight', 'rich', 'width', 'height', 'overflow'];\n// TODO Performance improvement?\nvar tmpText = new ZRText();\nvar TextStyleMixin = /** @class */function () {\n function TextStyleMixin() {}\n /**\n * Get color property or get color from option.textStyle.color\n */\n // TODO Callback\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\n var ecModel = this.ecModel;\n return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null);\n };\n /**\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\n * @return {string}\n */\n TextStyleMixin.prototype.getFont = function () {\n return getFont({\n fontStyle: this.getShallow('fontStyle'),\n fontWeight: this.getShallow('fontWeight'),\n fontSize: this.getShallow('fontSize'),\n fontFamily: this.getShallow('fontFamily')\n }, this.ecModel);\n };\n TextStyleMixin.prototype.getTextRect = function (text) {\n var style = {\n text: text,\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline')\n };\n for (var i = 0; i < textStyleParams.length; i++) {\n style[textStyleParams[i]] = this.getShallow(textStyleParams[i]);\n }\n tmpText.useStyle(style);\n tmpText.update();\n return tmpText.getBoundingRect();\n };\n return TextStyleMixin;\n}();\n;\nexport default TextStyleMixin;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var LINE_STYLE_KEY_MAP = [['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'type'], ['lineDashOffset', 'dashOffset'], ['lineCap', 'cap'], ['lineJoin', 'join'], ['miterLimit']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\n\nvar getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\nvar LineStyleMixin = /** @class */function () {\n function LineStyleMixin() {}\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\n return getLineStyle(this, excludes);\n };\n return LineStyleMixin;\n}();\n;\nexport { LineStyleMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var ITEM_STYLE_KEY_MAP = [['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'borderType'], ['lineDashOffset', 'borderDashOffset'], ['lineCap', 'borderCap'], ['lineJoin', 'borderJoin'], ['miterLimit', 'borderMiterLimit']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\n\nvar getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\nvar ItemStyleMixin = /** @class */function () {\n function ItemStyleMixin() {}\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\n return getItemStyle(this, excludes, includes);\n };\n return ItemStyleMixin;\n}();\nexport { ItemStyleMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport env from 'zrender/lib/core/env.js';\nimport { enableClassExtend, enableClassCheck } from '../util/clazz.js';\nimport { AreaStyleMixin } from './mixin/areaStyle.js';\nimport TextStyleMixin from './mixin/textStyle.js';\nimport { LineStyleMixin } from './mixin/lineStyle.js';\nimport { ItemStyleMixin } from './mixin/itemStyle.js';\nimport { mixin, clone, merge } from 'zrender/lib/core/util.js';\nvar Model = /** @class */function () {\n function Model(option, parentModel, ecModel) {\n this.parentModel = parentModel;\n this.ecModel = ecModel;\n this.option = option;\n // Simple optimization\n // if (this.init) {\n // if (arguments.length <= 4) {\n // this.init(option, parentModel, ecModel, extraOpt);\n // }\n // else {\n // this.init.apply(this, arguments);\n // }\n // }\n }\n\n Model.prototype.init = function (option, parentModel, ecModel) {\n var rest = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n rest[_i - 3] = arguments[_i];\n }\n };\n /**\n * Merge the input option to me.\n */\n Model.prototype.mergeOption = function (option, ecModel) {\n merge(this.option, option, true);\n };\n // `path` can be 'a.b.c', so the return value type have to be `ModelOption`\n // TODO: TYPE strict key check?\n // get(path: string | string[], ignoreParent?: boolean): ModelOption;\n Model.prototype.get = function (path, ignoreParent) {\n if (path == null) {\n return this.option;\n }\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\n };\n Model.prototype.getShallow = function (key, ignoreParent) {\n var option = this.option;\n var val = option == null ? option : option[key];\n if (val == null && !ignoreParent) {\n var parentModel = this.parentModel;\n if (parentModel) {\n // FIXME:TS do not know how to make it works\n val = parentModel.getShallow(key);\n }\n }\n return val;\n };\n // `path` can be 'a.b.c', so the return value type have to be `Model`\n // getModel(path: string | string[], parentModel?: Model): Model;\n // TODO 'a.b.c' is deprecated\n Model.prototype.getModel = function (path, parentModel) {\n var hasPath = path != null;\n var pathFinal = hasPath ? this.parsePath(path) : null;\n var obj = hasPath ? this._doGet(pathFinal) : this.option;\n parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal));\n return new Model(obj, parentModel, this.ecModel);\n };\n /**\n * If model has option\n */\n Model.prototype.isEmpty = function () {\n return this.option == null;\n };\n Model.prototype.restoreData = function () {};\n // Pending\n Model.prototype.clone = function () {\n var Ctor = this.constructor;\n return new Ctor(clone(this.option));\n };\n // setReadOnly(properties): void {\n // clazzUtil.setReadOnly(this, properties);\n // }\n // If path is null/undefined, return null/undefined.\n Model.prototype.parsePath = function (path) {\n if (typeof path === 'string') {\n return path.split('.');\n }\n return path;\n };\n // Resolve path for parent. Perhaps useful when parent use a different property.\n // Default to be a identity resolver.\n // Can be modified to a different resolver.\n Model.prototype.resolveParentPath = function (path) {\n return path;\n };\n // FIXME:TS check whether put this method here\n Model.prototype.isAnimationEnabled = function () {\n if (!env.node && this.option) {\n if (this.option.animation != null) {\n return !!this.option.animation;\n } else if (this.parentModel) {\n return this.parentModel.isAnimationEnabled();\n }\n }\n };\n Model.prototype._doGet = function (pathArr, parentModel) {\n var obj = this.option;\n if (!pathArr) {\n return obj;\n }\n for (var i = 0; i < pathArr.length; i++) {\n // Ignore empty\n if (!pathArr[i]) {\n continue;\n }\n // obj could be number/string/... (like 0)\n obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null;\n if (obj == null) {\n break;\n }\n }\n if (obj == null && parentModel) {\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\n }\n return obj;\n };\n return Model;\n}();\n;\n// Enable Model.extend.\nenableClassExtend(Model);\nenableClassCheck(Model);\nmixin(Model, LineStyleMixin);\nmixin(Model, ItemStyleMixin);\nmixin(Model, AreaStyleMixin);\nmixin(Model, TextStyleMixin);\nexport default Model;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\nimport { makePrintable } from './log.js';\n// A random offset\nvar base = Math.round(Math.random() * 10);\n/**\n * @public\n * @param {string} type\n * @return {string}\n */\nexport function getUID(type) {\n // Considering the case of crossing js context,\n // use Math.random to make id as unique as possible.\n return [type || '', base++].join('_');\n}\n/**\n * Implements `SubTypeDefaulterManager` for `target`.\n */\nexport function enableSubTypeDefaulter(target) {\n var subTypeDefaulters = {};\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\n var componentTypeInfo = parseClassType(componentType);\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\n };\n target.determineSubType = function (componentType, option) {\n var type = option.type;\n if (!type) {\n var componentTypeMain = parseClassType(componentType).main;\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\n type = subTypeDefaulters[componentTypeMain](option);\n }\n }\n return type;\n };\n}\n/**\n * Implements `TopologicalTravelable` for `entity`.\n *\n * Topological travel on Activity Network (Activity On Vertices).\n * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].\n * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.\n * If there is circular dependencey, Error will be thrown.\n */\nexport function enableTopologicalTravel(entity, dependencyGetter) {\n /**\n * @param targetNameList Target Component type list.\n * Can be ['aa', 'bb', 'aa.xx']\n * @param fullNameList By which we can build dependency graph.\n * @param callback Params: componentType, dependencies.\n * @param context Scope of callback.\n */\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\n if (!targetNameList.length) {\n return;\n }\n var result = makeDepndencyGraph(fullNameList);\n var graph = result.graph;\n var noEntryList = result.noEntryList;\n var targetNameSet = {};\n zrUtil.each(targetNameList, function (name) {\n targetNameSet[name] = true;\n });\n while (noEntryList.length) {\n var currComponentType = noEntryList.pop();\n var currVertex = graph[currComponentType];\n var isInTargetNameSet = !!targetNameSet[currComponentType];\n if (isInTargetNameSet) {\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\n delete targetNameSet[currComponentType];\n }\n zrUtil.each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\n }\n zrUtil.each(targetNameSet, function () {\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList);\n }\n throw new Error(errMsg);\n });\n function removeEdge(succComponentType) {\n graph[succComponentType].entryCount--;\n if (graph[succComponentType].entryCount === 0) {\n noEntryList.push(succComponentType);\n }\n }\n // Consider this case: legend depends on series, and we call\n // chart.setOption({series: [...]}), where only series is in option.\n // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will\n // not be called, but only sereis.mergeOption is called. Thus legend\n // have no chance to update its local record about series (like which\n // name of series is available in legend).\n function removeEdgeAndAdd(succComponentType) {\n targetNameSet[succComponentType] = true;\n removeEdge(succComponentType);\n }\n };\n function makeDepndencyGraph(fullNameList) {\n var graph = {};\n var noEntryList = [];\n zrUtil.each(fullNameList, function (name) {\n var thisItem = createDependencyGraphItem(graph, name);\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\n thisItem.entryCount = availableDeps.length;\n if (thisItem.entryCount === 0) {\n noEntryList.push(name);\n }\n zrUtil.each(availableDeps, function (dependentName) {\n if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {\n thisItem.predecessor.push(dependentName);\n }\n var thatItem = createDependencyGraphItem(graph, dependentName);\n if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {\n thatItem.successor.push(name);\n }\n });\n });\n return {\n graph: graph,\n noEntryList: noEntryList\n };\n }\n function createDependencyGraphItem(graph, name) {\n if (!graph[name]) {\n graph[name] = {\n predecessor: [],\n successor: []\n };\n }\n return graph[name];\n }\n function getAvailableDependencies(originalDeps, fullNameList) {\n var availableDeps = [];\n zrUtil.each(originalDeps, function (dep) {\n zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\n });\n return availableDeps;\n }\n}\nexport function inheritDefaultOption(superOption, subOption) {\n // See also `model/Component.ts#getDefaultOption`\n return zrUtil.merge(zrUtil.merge({}, superOption, true), subOption, true);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n/**\n * Language: English.\n */\nexport default {\n time: {\n month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n },\n legend: {\n selector: {\n all: 'All',\n inverse: 'Inv'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: 'Box Select',\n polygon: 'Lasso Select',\n lineX: 'Horizontally Select',\n lineY: 'Vertically Select',\n keep: 'Keep Selections',\n clear: 'Clear Selections'\n }\n },\n dataView: {\n title: 'Data View',\n lang: ['Data View', 'Close', 'Refresh']\n },\n dataZoom: {\n title: {\n zoom: 'Zoom',\n back: 'Zoom Reset'\n }\n },\n magicType: {\n title: {\n line: 'Switch to Line Chart',\n bar: 'Switch to Bar Chart',\n stack: 'Stack',\n tiled: 'Tile'\n }\n },\n restore: {\n title: 'Restore'\n },\n saveAsImage: {\n title: 'Save as Image',\n lang: ['Right Click to Save Image']\n }\n },\n series: {\n typeNames: {\n pie: 'Pie chart',\n bar: 'Bar chart',\n line: 'Line chart',\n scatter: 'Scatter plot',\n effectScatter: 'Ripple scatter plot',\n radar: 'Radar chart',\n tree: 'Tree',\n treemap: 'Treemap',\n boxplot: 'Boxplot',\n candlestick: 'Candlestick',\n k: 'K line chart',\n heatmap: 'Heat map',\n map: 'Map',\n parallel: 'Parallel coordinate map',\n lines: 'Line graph',\n graph: 'Relationship graph',\n sankey: 'Sankey diagram',\n funnel: 'Funnel chart',\n gauge: 'Gauge',\n pictorialBar: 'Pictorial bar',\n themeRiver: 'Theme River Map',\n sunburst: 'Sunburst',\n custom: 'Custom chart',\n chart: 'Chart'\n }\n },\n aria: {\n general: {\n withTitle: 'This is a chart about \"{title}\"',\n withoutTitle: 'This is a chart'\n },\n series: {\n single: {\n prefix: '',\n withName: ' with type {seriesType} named {seriesName}.',\n withoutName: ' with type {seriesType}.'\n },\n multiple: {\n prefix: '. It consists of {seriesCount} series count.',\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\n withoutName: ' The {seriesId} series is a {seriesType}.',\n separator: {\n middle: '',\n end: ''\n }\n }\n },\n data: {\n allData: 'The data is as follows: ',\n partialData: 'The first {displayCnt} items are: ',\n withName: 'the data for {name} is {value}',\n withoutName: '{value}',\n separator: {\n middle: ', ',\n end: '. '\n }\n }\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nexport default {\n time: {\n month: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n monthAbbr: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],\n dayOfWeek: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],\n dayOfWeekAbbr: ['日', '一', '二', '三', '四', '五', '六']\n },\n legend: {\n selector: {\n all: '全选',\n inverse: '反选'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: '矩形选择',\n polygon: '圈选',\n lineX: '横向选择',\n lineY: '纵向选择',\n keep: '保持选择',\n clear: '清除选择'\n }\n },\n dataView: {\n title: '数据视图',\n lang: ['数据视图', '关闭', '刷新']\n },\n dataZoom: {\n title: {\n zoom: '区域缩放',\n back: '区域缩放还原'\n }\n },\n magicType: {\n title: {\n line: '切换为折线图',\n bar: '切换为柱状图',\n stack: '切换为堆叠',\n tiled: '切换为平铺'\n }\n },\n restore: {\n title: '还原'\n },\n saveAsImage: {\n title: '保存为图片',\n lang: ['右键另存为图片']\n }\n },\n series: {\n typeNames: {\n pie: '饼图',\n bar: '柱状图',\n line: '折线图',\n scatter: '散点图',\n effectScatter: '涟漪散点图',\n radar: '雷达图',\n tree: '树图',\n treemap: '矩形树图',\n boxplot: '箱型图',\n candlestick: 'K线图',\n k: 'K线图',\n heatmap: '热力图',\n map: '地图',\n parallel: '平行坐标图',\n lines: '线图',\n graph: '关系图',\n sankey: '桑基图',\n funnel: '漏斗图',\n gauge: '仪表盘图',\n pictorialBar: '象形柱图',\n themeRiver: '主题河流图',\n sunburst: '旭日图',\n custom: '自定义图表',\n chart: '图表'\n }\n },\n aria: {\n general: {\n withTitle: '这是一个关于“{title}”的图表。',\n withoutTitle: '这是一个图表,'\n },\n series: {\n single: {\n prefix: '',\n withName: '图表类型是{seriesType},表示{seriesName}。',\n withoutName: '图表类型是{seriesType}。'\n },\n multiple: {\n prefix: '它由{seriesCount}个图表系列组成。',\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\n withoutName: '第{seriesId}个系列是一个{seriesType},',\n separator: {\n middle: ';',\n end: '。'\n }\n }\n },\n data: {\n allData: '其数据是——',\n partialData: '其中,前{displayCnt}项是——',\n withName: '{name}的数据是{value}',\n withoutName: '{value}',\n separator: {\n middle: ',',\n end: ''\n }\n }\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Model from '../model/Model.js';\nimport env from 'zrender/lib/core/env.js';\n// default import ZH and EN lang\nimport langEN from '../i18n/langEN.js';\nimport langZH from '../i18n/langZH.js';\nimport { isString, clone, merge } from 'zrender/lib/core/util.js';\nvar LOCALE_ZH = 'ZH';\nvar LOCALE_EN = 'EN';\nvar DEFAULT_LOCALE = LOCALE_EN;\nvar localeStorage = {};\nvar localeModels = {};\nexport var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {\n var langStr = ( /* eslint-disable-next-line */\n document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE).toUpperCase();\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\n}();\nexport function registerLocale(locale, localeObj) {\n locale = locale.toUpperCase();\n localeModels[locale] = new Model(localeObj);\n localeStorage[locale] = localeObj;\n}\n// export function getLocale(locale: string) {\n// return localeStorage[locale];\n// }\nexport function createLocaleObject(locale) {\n if (isString(locale)) {\n var localeObj = localeStorage[locale.toUpperCase()] || {};\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\n return clone(localeObj);\n } else {\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n } else {\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n}\nexport function getLocaleModel(lang) {\n return localeModels[lang];\n}\nexport function getDefaultLocaleModel() {\n return localeModels[DEFAULT_LOCALE];\n}\n// Default locale\nregisterLocale(LOCALE_EN, langEN);\nregisterLocale(LOCALE_ZH, langZH);","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from './number.js';\nimport { getDefaultLocaleModel, getLocaleModel, SYSTEM_LANG } from '../core/locale.js';\nimport Model from '../model/Model.js';\nexport var ONE_SECOND = 1000;\nexport var ONE_MINUTE = ONE_SECOND * 60;\nexport var ONE_HOUR = ONE_MINUTE * 60;\nexport var ONE_DAY = ONE_HOUR * 24;\nexport var ONE_YEAR = ONE_DAY * 365;\nexport var defaultLeveledFormatter = {\n year: '{yyyy}',\n month: '{MMM}',\n day: '{d}',\n hour: '{HH}:{mm}',\n minute: '{HH}:{mm}',\n second: '{HH}:{mm}:{ss}',\n millisecond: '{HH}:{mm}:{ss} {SSS}',\n none: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}'\n};\nvar fullDayFormatter = '{yyyy}-{MM}-{dd}';\nexport var fullLeveledFormatter = {\n year: '{yyyy}',\n month: '{yyyy}-{MM}',\n day: fullDayFormatter,\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\n millisecond: defaultLeveledFormatter.none\n};\nexport var primaryTimeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport var timeUnits = ['year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day', 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'];\nexport function pad(str, len) {\n str += '';\n return '0000'.substr(0, len - str.length) + str;\n}\nexport function getPrimaryTimeUnit(timeUnit) {\n switch (timeUnit) {\n case 'half-year':\n case 'quarter':\n return 'month';\n case 'week':\n case 'half-week':\n return 'day';\n case 'half-day':\n case 'quarter-day':\n return 'hour';\n default:\n // year, minutes, second, milliseconds\n return timeUnit;\n }\n}\nexport function isPrimaryTimeUnit(timeUnit) {\n return timeUnit === getPrimaryTimeUnit(timeUnit);\n}\nexport function getDefaultFormatPrecisionOfInterval(timeUnit) {\n switch (timeUnit) {\n case 'year':\n case 'month':\n return 'day';\n case 'millisecond':\n return 'millisecond';\n default:\n // Also for day, hour, minute, second\n return 'second';\n }\n}\nexport function format(\n// Note: The result based on `isUTC` are totally different, which can not be just simply\n// substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.\ntime, template, isUTC, lang) {\n var date = numberUtil.parseDate(time);\n var y = date[fullYearGetterName(isUTC)]();\n var M = date[monthGetterName(isUTC)]() + 1;\n var q = Math.floor((M - 1) / 3) + 1;\n var d = date[dateGetterName(isUTC)]();\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\n var H = date[hoursGetterName(isUTC)]();\n var h = (H - 1) % 12 + 1;\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var a = H >= 12 ? 'pm' : 'am';\n var A = a.toUpperCase();\n var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\n var timeModel = localeModel.getModel('time');\n var month = timeModel.get('month');\n var monthAbbr = timeModel.get('monthAbbr');\n var dayOfWeek = timeModel.get('dayOfWeek');\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\n return (template || '').replace(/{a}/g, a + '').replace(/{A}/g, A + '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, pad(y % 100 + '', 2)).replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + '');\n}\nexport function leveledFormat(tick, idx, formatter, lang, isUTC) {\n var template = null;\n if (zrUtil.isString(formatter)) {\n // Single formatter for all units at all levels\n template = formatter;\n } else if (zrUtil.isFunction(formatter)) {\n // Callback formatter\n template = formatter(tick.value, idx, {\n level: tick.level\n });\n } else {\n var defaults = zrUtil.extend({}, defaultLeveledFormatter);\n if (tick.level > 0) {\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\n defaults[primaryTimeUnits[i]] = \"{primary|\" + defaults[primaryTimeUnits[i]] + \"}\";\n }\n }\n var mergedFormatter = formatter ? formatter.inherit === false ? formatter // Use formatter with bigger units\n : zrUtil.defaults(formatter, defaults) : defaults;\n var unit = getUnitFromValue(tick.value, isUTC);\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n } else if (mergedFormatter.inherit) {\n // Unit formatter is not defined and should inherit from bigger units\n var targetId = timeUnits.indexOf(unit);\n for (var i = targetId - 1; i >= 0; --i) {\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n break;\n }\n }\n template = template || defaults.none;\n }\n if (zrUtil.isArray(template)) {\n var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level;\n levelId = Math.min(levelId, template.length - 1);\n template = template[levelId];\n }\n }\n return format(new Date(tick.value), template, isUTC, lang);\n}\nexport function getUnitFromValue(value, isUTC) {\n var date = numberUtil.parseDate(value);\n var M = date[monthGetterName(isUTC)]() + 1;\n var d = date[dateGetterName(isUTC)]();\n var h = date[hoursGetterName(isUTC)]();\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var isSecond = S === 0;\n var isMinute = isSecond && s === 0;\n var isHour = isMinute && m === 0;\n var isDay = isHour && h === 0;\n var isMonth = isDay && d === 1;\n var isYear = isMonth && M === 1;\n if (isYear) {\n return 'year';\n } else if (isMonth) {\n return 'month';\n } else if (isDay) {\n return 'day';\n } else if (isHour) {\n return 'hour';\n } else if (isMinute) {\n return 'minute';\n } else if (isSecond) {\n return 'second';\n } else {\n return 'millisecond';\n }\n}\nexport function getUnitValue(value, unit, isUTC) {\n var date = zrUtil.isNumber(value) ? numberUtil.parseDate(value) : value;\n unit = unit || getUnitFromValue(value, isUTC);\n switch (unit) {\n case 'year':\n return date[fullYearGetterName(isUTC)]();\n case 'half-year':\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\n case 'quarter':\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\n case 'month':\n return date[monthGetterName(isUTC)]();\n case 'day':\n return date[dateGetterName(isUTC)]();\n case 'half-day':\n return date[hoursGetterName(isUTC)]() / 24;\n case 'hour':\n return date[hoursGetterName(isUTC)]();\n case 'minute':\n return date[minutesGetterName(isUTC)]();\n case 'second':\n return date[secondsGetterName(isUTC)]();\n case 'millisecond':\n return date[millisecondsGetterName(isUTC)]();\n }\n}\nexport function fullYearGetterName(isUTC) {\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\n}\nexport function monthGetterName(isUTC) {\n return isUTC ? 'getUTCMonth' : 'getMonth';\n}\nexport function dateGetterName(isUTC) {\n return isUTC ? 'getUTCDate' : 'getDate';\n}\nexport function hoursGetterName(isUTC) {\n return isUTC ? 'getUTCHours' : 'getHours';\n}\nexport function minutesGetterName(isUTC) {\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\n}\nexport function secondsGetterName(isUTC) {\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\n}\nexport function millisecondsGetterName(isUTC) {\n return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds';\n}\nexport function fullYearSetterName(isUTC) {\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\n}\nexport function monthSetterName(isUTC) {\n return isUTC ? 'setUTCMonth' : 'setMonth';\n}\nexport function dateSetterName(isUTC) {\n return isUTC ? 'setUTCDate' : 'setDate';\n}\nexport function hoursSetterName(isUTC) {\n return isUTC ? 'setUTCHours' : 'setHours';\n}\nexport function minutesSetterName(isUTC) {\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\n}\nexport function secondsSetterName(isUTC) {\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\n}\nexport function millisecondsSetterName(isUTC) {\n return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds';\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { Text } from '../util/graphic.js';\nexport function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) {\n var textEl = new Text({\n style: {\n text: text,\n font: font,\n align: align,\n verticalAlign: verticalAlign,\n padding: padding,\n rich: rich,\n overflow: truncate ? 'truncate' : null,\n lineHeight: lineHeight\n }\n });\n return textEl.getBoundingRect();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { encodeHTML } from 'zrender/lib/core/dom.js';\nimport { parseDate, isNumeric, numericToNumber } from './number.js';\nimport { format as timeFormat, pad } from './time.js';\nimport { deprecateReplaceLog } from './log.js';\n/**\n * Add a comma each three digit.\n */\nexport function addCommas(x) {\n if (!isNumeric(x)) {\n return zrUtil.isString(x) ? x : '-';\n }\n var parts = (x + '').split('.');\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : '');\n}\nexport function toCamelCase(str, upperCaseFirst) {\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\n return group1.toUpperCase();\n });\n if (upperCaseFirst && str) {\n str = str.charAt(0).toUpperCase() + str.slice(1);\n }\n return str;\n}\nexport var normalizeCssArray = zrUtil.normalizeCssArray;\nexport { encodeHTML };\n/**\n * Make value user readable for tooltip and label.\n * \"User readable\":\n * Try to not print programmer-specific text like NaN, Infinity, null, undefined.\n * Avoid to display an empty string, which users can not recognize there is\n * a value and it might look like a bug.\n */\nexport function makeValueReadable(value, valueType, useUTC) {\n var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}';\n function stringToUserReadable(str) {\n return str && zrUtil.trim(str) ? str : '-';\n }\n function isNumberUserReadable(num) {\n return !!(num != null && !isNaN(num) && isFinite(num));\n }\n var isTypeTime = valueType === 'time';\n var isValueDate = value instanceof Date;\n if (isTypeTime || isValueDate) {\n var date = isTypeTime ? parseDate(value) : value;\n if (!isNaN(+date)) {\n return timeFormat(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\n } else if (isValueDate) {\n return '-';\n }\n // In other cases, continue to try to display the value in the following code.\n }\n\n if (valueType === 'ordinal') {\n return zrUtil.isStringSafe(value) ? stringToUserReadable(value) : zrUtil.isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-';\n }\n // By default.\n var numericResult = numericToNumber(value);\n return isNumberUserReadable(numericResult) ? addCommas(numericResult) : zrUtil.isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-';\n}\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\nvar wrapVar = function (varName, seriesIdx) {\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\n};\n/**\n * Template formatter\n * @param {Array.|Object} paramsList\n */\nexport function formatTpl(tpl, paramsList, encode) {\n if (!zrUtil.isArray(paramsList)) {\n paramsList = [paramsList];\n }\n var seriesLen = paramsList.length;\n if (!seriesLen) {\n return '';\n }\n var $vars = paramsList[0].$vars || [];\n for (var i = 0; i < $vars.length; i++) {\n var alias = TPL_VAR_ALIAS[i];\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\n }\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\n for (var k = 0; k < $vars.length; k++) {\n var val = paramsList[seriesIdx][$vars[k]];\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\n }\n }\n return tpl;\n}\n/**\n * simple Template formatter\n */\nexport function formatTplSimple(tpl, param, encode) {\n zrUtil.each(param, function (value, key) {\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\n });\n return tpl;\n}\nexport function getTooltipMarker(inOpt, extraCssText) {\n var opt = zrUtil.isString(inOpt) ? {\n color: inOpt,\n extraCssText: extraCssText\n } : inOpt || {};\n var color = opt.color;\n var type = opt.type;\n extraCssText = opt.extraCssText;\n var renderMode = opt.renderMode || 'html';\n if (!color) {\n return '';\n }\n if (renderMode === 'html') {\n return type === 'subItem' ? '' : '';\n } else {\n // Should better not to auto generate style name by auto-increment number here.\n // Because this util is usually called in tooltip formatter, which is probably\n // called repeatedly when mouse move and the auto-increment number increases fast.\n // Users can make their own style name by theirselves, make it unique and readable.\n var markerId = opt.markerId || 'markerX';\n return {\n renderMode: renderMode,\n content: '{' + markerId + '|} ',\n style: type === 'subItem' ? {\n width: 4,\n height: 4,\n borderRadius: 2,\n backgroundColor: color\n } : {\n width: 10,\n height: 10,\n borderRadius: 5,\n backgroundColor: color\n }\n };\n }\n}\n/**\n * @deprecated Use `time/format` instead.\n * ISO Date format\n * @param {string} tpl\n * @param {number} value\n * @param {boolean} [isUTC=false] Default in local time.\n * see `module:echarts/scale/Time`\n * and `module:echarts/util/number#parseDate`.\n * @inner\n */\nexport function formatTime(tpl, value, isUTC) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\n }\n if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') {\n tpl = 'MM-dd\\nyyyy';\n }\n var date = parseDate(value);\n var getUTC = isUTC ? 'getUTC' : 'get';\n var y = date[getUTC + 'FullYear']();\n var M = date[getUTC + 'Month']() + 1;\n var d = date[getUTC + 'Date']();\n var h = date[getUTC + 'Hours']();\n var m = date[getUTC + 'Minutes']();\n var s = date[getUTC + 'Seconds']();\n var S = date[getUTC + 'Milliseconds']();\n tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', pad(y % 100 + '', 2)).replace('dd', pad(d, 2)).replace('d', d).replace('hh', pad(h, 2)).replace('h', h).replace('mm', pad(m, 2)).replace('m', m).replace('ss', pad(s, 2)).replace('s', s).replace('SSS', pad(S, 3));\n return tpl;\n}\n/**\n * Capital first\n * @param {string} str\n * @return {string}\n */\nexport function capitalFirst(str) {\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\n}\n/**\n * @return Never be null/undefined.\n */\nexport function convertToColorString(color, defaultColor) {\n defaultColor = defaultColor || 'transparent';\n return zrUtil.isString(color) ? color : zrUtil.isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor;\n}\nexport { truncateText } from 'zrender/lib/graphic/helper/parseText.js';\n/**\n * open new tab\n * @param link url\n * @param target blank or self\n */\nexport function windowOpen(link, target) {\n /* global window */\n if (target === '_blank' || target === 'blank') {\n var blank = window.open();\n blank.opener = null;\n blank.location.href = link;\n } else {\n window.open(link, target);\n }\n}\nexport { getTextRect } from '../legacy/getTextRect.js';","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Layout helpers for each component positioning\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent } from './number.js';\nimport * as formatUtil from './format.js';\nvar each = zrUtil.each;\n/**\n * @public\n */\nexport var LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height'];\n/**\n * @public\n */\nexport var HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']];\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\n var x = 0;\n var y = 0;\n if (maxWidth == null) {\n maxWidth = Infinity;\n }\n if (maxHeight == null) {\n maxHeight = Infinity;\n }\n var currentLineMaxSize = 0;\n group.eachChild(function (child, idx) {\n var rect = child.getBoundingRect();\n var nextChild = group.childAt(idx + 1);\n var nextChildRect = nextChild && nextChild.getBoundingRect();\n var nextX;\n var nextY;\n if (orient === 'horizontal') {\n var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0);\n nextX = x + moveX;\n // Wrap when width exceeds maxWidth or meet a `newline` group\n // FIXME compare before adding gap?\n if (nextX > maxWidth || child.newline) {\n x = 0;\n nextX = moveX;\n y += currentLineMaxSize + gap;\n currentLineMaxSize = rect.height;\n } else {\n // FIXME: consider rect.y is not `0`?\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\n }\n } else {\n var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0);\n nextY = y + moveY;\n // Wrap when width exceeds maxHeight or meet a `newline` group\n if (nextY > maxHeight || child.newline) {\n x += currentLineMaxSize + gap;\n y = 0;\n nextY = moveY;\n currentLineMaxSize = rect.width;\n } else {\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\n }\n }\n if (child.newline) {\n return;\n }\n child.x = x;\n child.y = y;\n child.markRedraw();\n orient === 'horizontal' ? x = nextX + gap : y = nextY + gap;\n });\n}\n/**\n * VBox or HBox layouting\n * @param {string} orient\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\nexport var box = boxLayout;\n/**\n * VBox layouting\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\nexport var vbox = zrUtil.curry(boxLayout, 'vertical');\n/**\n * HBox layouting\n * @param {module:zrender/graphic/Group} group\n * @param {number} gap\n * @param {number} [width=Infinity]\n * @param {number} [height=Infinity]\n */\nexport var hbox = zrUtil.curry(boxLayout, 'horizontal');\n/**\n * If x or x2 is not specified or 'center' 'left' 'right',\n * the width would be as long as possible.\n * If y or y2 is not specified or 'middle' 'top' 'bottom',\n * the height would be as long as possible.\n */\nexport function getAvailableSize(positionInfo, containerRect, margin) {\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var x = parsePercent(positionInfo.left, containerWidth);\n var y = parsePercent(positionInfo.top, containerHeight);\n var x2 = parsePercent(positionInfo.right, containerWidth);\n var y2 = parsePercent(positionInfo.bottom, containerHeight);\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\n margin = formatUtil.normalizeCssArray(margin || 0);\n return {\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\n };\n}\n/**\n * Parse position info.\n */\nexport function getLayoutRect(positionInfo, containerRect, margin) {\n margin = formatUtil.normalizeCssArray(margin || 0);\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var left = parsePercent(positionInfo.left, containerWidth);\n var top = parsePercent(positionInfo.top, containerHeight);\n var right = parsePercent(positionInfo.right, containerWidth);\n var bottom = parsePercent(positionInfo.bottom, containerHeight);\n var width = parsePercent(positionInfo.width, containerWidth);\n var height = parsePercent(positionInfo.height, containerHeight);\n var verticalMargin = margin[2] + margin[0];\n var horizontalMargin = margin[1] + margin[3];\n var aspect = positionInfo.aspect;\n // If width is not specified, calculate width from left and right\n if (isNaN(width)) {\n width = containerWidth - right - horizontalMargin - left;\n }\n if (isNaN(height)) {\n height = containerHeight - bottom - verticalMargin - top;\n }\n if (aspect != null) {\n // If width and height are not given\n // 1. Graph should not exceeds the container\n // 2. Aspect must be keeped\n // 3. Graph should take the space as more as possible\n // FIXME\n // Margin is not considered, because there is no case that both\n // using margin and aspect so far.\n if (isNaN(width) && isNaN(height)) {\n if (aspect > containerWidth / containerHeight) {\n width = containerWidth * 0.8;\n } else {\n height = containerHeight * 0.8;\n }\n }\n // Calculate width or height with given aspect\n if (isNaN(width)) {\n width = aspect * height;\n }\n if (isNaN(height)) {\n height = width / aspect;\n }\n }\n // If left is not specified, calculate left from right and width\n if (isNaN(left)) {\n left = containerWidth - right - width - horizontalMargin;\n }\n if (isNaN(top)) {\n top = containerHeight - bottom - height - verticalMargin;\n }\n // Align left and top\n switch (positionInfo.left || positionInfo.right) {\n case 'center':\n left = containerWidth / 2 - width / 2 - margin[3];\n break;\n case 'right':\n left = containerWidth - width - horizontalMargin;\n break;\n }\n switch (positionInfo.top || positionInfo.bottom) {\n case 'middle':\n case 'center':\n top = containerHeight / 2 - height / 2 - margin[0];\n break;\n case 'bottom':\n top = containerHeight - height - verticalMargin;\n break;\n }\n // If something is wrong and left, top, width, height are calculated as NaN\n left = left || 0;\n top = top || 0;\n if (isNaN(width)) {\n // Width may be NaN if only one value is given except width\n width = containerWidth - horizontalMargin - left - (right || 0);\n }\n if (isNaN(height)) {\n // Height may be NaN if only one value is given except height\n height = containerHeight - verticalMargin - top - (bottom || 0);\n }\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\n rect.margin = margin;\n return rect;\n}\n/**\n * Position a zr element in viewport\n * Group position is specified by either\n * {left, top}, {right, bottom}\n * If all properties exists, right and bottom will be igonred.\n *\n * Logic:\n * 1. Scale (against origin point in parent coord)\n * 2. Rotate (against origin point in parent coord)\n * 3. Translate (with el.position by this method)\n * So this method only fixes the last step 'Translate', which does not affect\n * scaling and rotating.\n *\n * If be called repeatedly with the same input el, the same result will be gotten.\n *\n * Return true if the layout happened.\n *\n * @param el Should have `getBoundingRect` method.\n * @param positionInfo\n * @param positionInfo.left\n * @param positionInfo.top\n * @param positionInfo.right\n * @param positionInfo.bottom\n * @param positionInfo.width Only for opt.boundingModel: 'raw'\n * @param positionInfo.height Only for opt.boundingModel: 'raw'\n * @param containerRect\n * @param margin\n * @param opt\n * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]\n * @param opt.boundingMode\n * Specify how to calculate boundingRect when locating.\n * 'all': Position the boundingRect that is transformed and uioned\n * both itself and its descendants.\n * This mode simplies confine the elements in the bounding\n * of their container (e.g., using 'right: 0').\n * 'raw': Position the boundingRect that is not transformed and only itself.\n * This mode is useful when you want a element can overflow its\n * container. (Consider a rotated circle needs to be located in a corner.)\n * In this mode positionInfo.width/height can only be number.\n */\nexport function positionElement(el, positionInfo, containerRect, margin, opt, out) {\n var h = !opt || !opt.hv || opt.hv[0];\n var v = !opt || !opt.hv || opt.hv[1];\n var boundingMode = opt && opt.boundingMode || 'all';\n out = out || el;\n out.x = el.x;\n out.y = el.y;\n if (!h && !v) {\n return false;\n }\n var rect;\n if (boundingMode === 'raw') {\n rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect();\n } else {\n rect = el.getBoundingRect();\n if (el.needLocalTransform()) {\n var transform = el.getLocalTransform();\n // Notice: raw rect may be inner object of el,\n // which should not be modified.\n rect = rect.clone();\n rect.applyTransform(transform);\n }\n }\n // The real width and height can not be specified but calculated by the given el.\n var layoutRect = getLayoutRect(zrUtil.defaults({\n width: rect.width,\n height: rect.height\n }, positionInfo), containerRect, margin);\n // Because 'tranlate' is the last step in transform\n // (see zrender/core/Transformable#getLocalTransform),\n // we can just only modify el.position to get final result.\n var dx = h ? layoutRect.x - rect.x : 0;\n var dy = v ? layoutRect.y - rect.y : 0;\n if (boundingMode === 'raw') {\n out.x = dx;\n out.y = dy;\n } else {\n out.x += dx;\n out.y += dy;\n }\n if (out === el) {\n el.markRedraw();\n }\n return true;\n}\n/**\n * @param option Contains some of the properties in HV_NAMES.\n * @param hvIdx 0: horizontal; 1: vertical.\n */\nexport function sizeCalculable(option, hvIdx) {\n return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null;\n}\nexport function fetchLayoutMode(ins) {\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\n return zrUtil.isObject(layoutMode) ? layoutMode : layoutMode ? {\n type: layoutMode\n } : null;\n}\n/**\n * Consider Case:\n * When default option has {left: 0, width: 100}, and we set {right: 0}\n * through setOption or media query, using normal zrUtil.merge will cause\n * {right: 0} does not take effect.\n *\n * @example\n * ComponentModel.extend({\n * init: function () {\n * ...\n * let inputPositionParams = layout.getLayoutParams(option);\n * this.mergeOption(inputPositionParams);\n * },\n * mergeOption: function (newOption) {\n * newOption && zrUtil.merge(thisOption, newOption, true);\n * layout.mergeLayoutParam(thisOption, newOption);\n * }\n * });\n *\n * @param targetOption\n * @param newOption\n * @param opt\n */\nexport function mergeLayoutParam(targetOption, newOption, opt) {\n var ignoreSize = opt && opt.ignoreSize;\n !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\n var hResult = merge(HV_NAMES[0], 0);\n var vResult = merge(HV_NAMES[1], 1);\n copy(HV_NAMES[0], targetOption, hResult);\n copy(HV_NAMES[1], targetOption, vResult);\n function merge(names, hvIdx) {\n var newParams = {};\n var newValueCount = 0;\n var merged = {};\n var mergedValueCount = 0;\n var enoughParamNumber = 2;\n each(names, function (name) {\n merged[name] = targetOption[name];\n });\n each(names, function (name) {\n // Consider case: newOption.width is null, which is\n // set by user for removing width setting.\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\n hasValue(newParams, name) && newValueCount++;\n hasValue(merged, name) && mergedValueCount++;\n });\n if (ignoreSize[hvIdx]) {\n // Only one of left/right is premitted to exist.\n if (hasValue(newOption, names[1])) {\n merged[names[2]] = null;\n } else if (hasValue(newOption, names[2])) {\n merged[names[1]] = null;\n }\n return merged;\n }\n // Case: newOption: {width: ..., right: ...},\n // or targetOption: {right: ...} and newOption: {width: ...},\n // There is no conflict when merged only has params count\n // little than enoughParamNumber.\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\n return merged;\n }\n // Case: newOption: {width: ..., right: ...},\n // Than we can make sure user only want those two, and ignore\n // all origin params in targetOption.\n else if (newValueCount >= enoughParamNumber) {\n return newParams;\n } else {\n // Chose another param from targetOption by priority.\n for (var i = 0; i < names.length; i++) {\n var name_1 = names[i];\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\n newParams[name_1] = targetOption[name_1];\n break;\n }\n }\n return newParams;\n }\n }\n function hasProp(obj, name) {\n return obj.hasOwnProperty(name);\n }\n function hasValue(obj, name) {\n return obj[name] != null && obj[name] !== 'auto';\n }\n function copy(names, target, source) {\n each(names, function (name) {\n target[name] = source[name];\n });\n }\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n */\nexport function getLayoutParams(source) {\n return copyLayoutParams({}, source);\n}\n/**\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\n * @param {Object} source\n * @return {Object} Result contains those props.\n */\nexport function copyLayoutParams(target, source) {\n source && target && each(LOCATION_PARAMS, function (name) {\n source.hasOwnProperty(name) && (target[name] = source[name]);\n });\n return target;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from './Model.js';\nimport * as componentUtil from '../util/component.js';\nimport { enableClassManagement, parseClassType, isExtendedClass, mountExtend } from '../util/clazz.js';\nimport { makeInner, queryReferringComponents } from '../util/model.js';\nimport * as layout from '../util/layout.js';\nvar inner = makeInner();\nvar ComponentModel = /** @class */function (_super) {\n __extends(ComponentModel, _super);\n function ComponentModel(option, parentModel, ecModel) {\n var _this = _super.call(this, option, parentModel, ecModel) || this;\n _this.uid = componentUtil.getUID('ec_cpt_model');\n return _this;\n }\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = layout.fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? layout.getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n zrUtil.merge(option, themeModel.get(this.mainType));\n zrUtil.merge(option, this.getDefaultOption());\n if (layoutMode) {\n layout.mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\n zrUtil.merge(this.option, option, true);\n var layoutMode = layout.fetchLayoutMode(this);\n if (layoutMode) {\n layout.mergeLayoutParam(this.option, option, layoutMode);\n }\n };\n /**\n * Called immediately after `init` or `mergeOption` of this instance called.\n */\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {};\n /**\n * [How to declare defaultOption]:\n *\n * (A) If using class declaration in typescript (since echarts 5):\n * ```ts\n * import {ComponentOption} from '../model/option.js';\n * export interface XxxOption extends ComponentOption {\n * aaa: number\n * }\n * export class XxxModel extends Component {\n * static type = 'xxx';\n * static defaultOption: XxxOption = {\n * aaa: 123\n * }\n * }\n * Component.registerClass(XxxModel);\n * ```\n * ```ts\n * import {inheritDefaultOption} from '../util/component.js';\n * import {XxxModel, XxxOption} from './XxxModel.js';\n * export interface XxxSubOption extends XxxOption {\n * bbb: number\n * }\n * class XxxSubModel extends XxxModel {\n * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {\n * bbb: 456\n * })\n * fn() {\n * let opt = this.getDefaultOption();\n * // opt is {aaa: 123, bbb: 456}\n * }\n * }\n * ```\n *\n * (B) If using class extend (previous approach in echarts 3 & 4):\n * ```js\n * let XxxComponent = Component.extend({\n * defaultOption: {\n * xx: 123\n * }\n * })\n * ```\n * ```js\n * let XxxSubComponent = XxxComponent.extend({\n * defaultOption: {\n * yy: 456\n * },\n * fn: function () {\n * let opt = this.getDefaultOption();\n * // opt is {xx: 123, yy: 456}\n * }\n * })\n * ```\n */\n ComponentModel.prototype.getDefaultOption = function () {\n var ctor = this.constructor;\n // If using class declaration, it is different to travel super class\n // in legacy env and auto merge defaultOption. So if using class\n // declaration, defaultOption should be merged manually.\n if (!isExtendedClass(ctor)) {\n // When using ts class, defaultOption must be declared as static.\n return ctor.defaultOption;\n }\n // FIXME: remove this approach?\n var fields = inner(this);\n if (!fields.defaultOption) {\n var optList = [];\n var clz = ctor;\n while (clz) {\n var opt = clz.prototype.defaultOption;\n opt && optList.push(opt);\n clz = clz.superClass;\n }\n var defaultOption = {};\n for (var i = optList.length - 1; i >= 0; i--) {\n defaultOption = zrUtil.merge(defaultOption, optList[i], true);\n }\n fields.defaultOption = defaultOption;\n }\n return fields.defaultOption;\n };\n /**\n * Notice: always force to input param `useDefault` in case that forget to consider it.\n * The same behavior as `modelUtil.parseFinder`.\n *\n * @param useDefault In many cases like series refer axis and axis refer grid,\n * If axis index / axis id not specified, use the first target as default.\n * In other cases like dataZoom refer axis, if not specified, measn no refer.\n */\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\n var indexKey = mainType + 'Index';\n var idKey = mainType + 'Id';\n return queryReferringComponents(this.ecModel, mainType, {\n index: this.get(indexKey, true),\n id: this.get(idKey, true)\n }, opt);\n };\n ComponentModel.prototype.getBoxLayoutParams = function () {\n // Consider itself having box layout configs.\n var boxLayoutModel = this;\n return {\n left: boxLayoutModel.get('left'),\n top: boxLayoutModel.get('top'),\n right: boxLayoutModel.get('right'),\n bottom: boxLayoutModel.get('bottom'),\n width: boxLayoutModel.get('width'),\n height: boxLayoutModel.get('height')\n };\n };\n /**\n * Get key for zlevel.\n * If developers don't configure zlevel. We will assign zlevel to series based on the key.\n * For example, lines with trail effect and progressive series will in an individual zlevel.\n */\n ComponentModel.prototype.getZLevelKey = function () {\n return '';\n };\n ComponentModel.prototype.setZLevel = function (zlevel) {\n this.option.zlevel = zlevel;\n };\n ComponentModel.protoInitialize = function () {\n var proto = ComponentModel.prototype;\n proto.type = 'component';\n proto.id = '';\n proto.name = '';\n proto.mainType = '';\n proto.subType = '';\n proto.componentIndex = 0;\n }();\n return ComponentModel;\n}(Model);\nmountExtend(ComponentModel, Model);\nenableClassManagement(ComponentModel);\ncomponentUtil.enableSubTypeDefaulter(ComponentModel);\ncomponentUtil.enableTopologicalTravel(ComponentModel, getDependencies);\nfunction getDependencies(componentType) {\n var deps = [];\n zrUtil.each(ComponentModel.getClassesByMainType(componentType), function (clz) {\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\n });\n // Ensure main type.\n deps = zrUtil.map(deps, function (type) {\n return parseClassType(type).main;\n });\n // Hack dataset for convenience.\n if (componentType !== 'dataset' && zrUtil.indexOf(deps, 'dataset') <= 0) {\n deps.unshift('dataset');\n }\n return deps;\n}\nexport default ComponentModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar platform = '';\n// Navigator not exists in node\nif (typeof navigator !== 'undefined') {\n /* global navigator */\n platform = navigator.platform || '';\n}\nvar decalColor = 'rgba(0, 0, 0, 0.2)';\nexport default {\n darkMode: 'auto',\n // backgroundColor: 'rgba(0,0,0,0)',\n colorBy: 'series',\n color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\n aria: {\n decal: {\n decals: [{\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [2, 5],\n symbolSize: 1,\n rotation: Math.PI / 6\n }, {\n color: decalColor,\n symbol: 'circle',\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\n dashArrayY: [6, 0],\n symbolSize: 0.8\n }, {\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [4, 3],\n rotation: -Math.PI / 4\n }, {\n color: decalColor,\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\n dashArrayY: [6, 0]\n }, {\n color: decalColor,\n dashArrayX: [[1, 0], [1, 6]],\n dashArrayY: [1, 0, 6, 0],\n rotation: Math.PI / 4\n }, {\n color: decalColor,\n symbol: 'triangle',\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\n dashArrayY: [7, 2],\n symbolSize: 0.75\n }]\n }\n },\n // If xAxis and yAxis declared, grid is created by default.\n // grid: {},\n textStyle: {\n // color: '#000',\n // decoration: 'none',\n // PENDING\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\n // fontFamily: 'Arial, Verdana, sans-serif',\n fontSize: 12,\n fontStyle: 'normal',\n fontWeight: 'normal'\n },\n // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n // Default is source-over\n blendMode: null,\n stateAnimation: {\n duration: 300,\n easing: 'cubicOut'\n },\n animation: 'auto',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut',\n animationEasingUpdate: 'cubicInOut',\n animationThreshold: 2000,\n // Configuration for progressive/incremental rendering\n progressiveThreshold: 3000,\n progressive: 400,\n // Threshold of if use single hover layer to optimize.\n // It is recommended that `hoverLayerThreshold` is equivalent to or less than\n // `progressiveThreshold`, otherwise hover will cause restart of progressive,\n // which is unexpected.\n // see example .\n hoverLayerThreshold: 3000,\n // See: module:echarts/scale/Time\n useUTC: false\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\n;\n;\n;\nexport var VISUAL_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'itemGroupId', 'itemChildGroupId', 'seriesName']);\nexport var SOURCE_FORMAT_ORIGINAL = 'original';\nexport var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\nexport var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\nexport var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\nexport var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\nexport var SOURCE_FORMAT_UNKNOWN = 'unknown';\nexport var SERIES_LAYOUT_BY_COLUMN = 'column';\nexport var SERIES_LAYOUT_BY_ROW = 'row';\n;\n;\n;\n;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, getDataItemValue, queryReferringComponents, SINGLE_REFERRING } from '../../util/model.js';\nimport { createHashMap, each, isArray, isString, isObject, isTypedArray } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW, SOURCE_FORMAT_KEYED_COLUMNS } from '../../util/types.js';\n// The result of `guessOrdinal`.\nexport var BE_ORDINAL = {\n Must: 1,\n Might: 2,\n Not: 3 // Other cases\n};\n\nvar innerGlobalModel = makeInner();\n/**\n * MUST be called before mergeOption of all series.\n */\nexport function resetSourceDefaulter(ecModel) {\n // `datasetMap` is used to make default encode.\n innerGlobalModel(ecModel).datasetMap = createHashMap();\n}\n/**\n * [The strategy of the arrengment of data dimensions for dataset]:\n * \"value way\": all axes are non-category axes. So series one by one take\n * several (the number is coordSysDims.length) dimensions from dataset.\n * The result of data arrengment of data dimensions like:\n * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\n * \"category way\": at least one axis is category axis. So the the first data\n * dimension is always mapped to the first category axis and shared by\n * all of the series. The other data dimensions are taken by series like\n * \"value way\" does.\n * The result of data arrengment of data dimensions like:\n * | ser_shared_x | ser0_y | ser1_y | ser2_y |\n *\n * @return encode Never be `null/undefined`.\n */\nexport function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\n // Currently only make default when using dataset, util more reqirements occur.\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n });\n // TODO\n // Auto detect first time axis and do arrangement.\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo);\n // In value way.\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count;\n // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when multiple series share one dimension\n // category axis, series name should better use\n // the other dimension name. On the other hand, use\n // both dimensions name.\n }\n // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n }\n // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}\n/**\n * Work for data like [{name: ..., value: ...}, ...].\n *\n * @return encode Never be `null/undefined`.\n */\nexport function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\n // Currently only make default when using dataset, util more reqirements occur.\n if (!datasetModel) {\n return encode;\n }\n var sourceFormat = source.sourceFormat;\n var dimensionsDefine = source.dimensionsDefine;\n var potentialNameDimIndex;\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n var idxResult = function () {\n var idxRes0 = {};\n var idxRes1 = {};\n var guessRecords = [];\n // 5 is an experience value.\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\n guessRecords.push(guessResult);\n var isPureNumber = guessResult === BE_ORDINAL.Not;\n // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\n // and then find a name dim with the priority:\n // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\n idxRes0.v = i;\n }\n if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {\n idxRes0.n = i;\n }\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\n return idxRes0;\n }\n // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\n // find the first BE_ORDINAL.Might as the value dim,\n // and then find a name dim with the priority:\n // \"other dim\" > \"the value dim itself\".\n // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\n // treated as number.\n if (!isPureNumber) {\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\n idxRes1.v = i;\n }\n if (idxRes1.n == null || idxRes1.n === idxRes1.v) {\n idxRes1.n = i;\n }\n }\n }\n function fulfilled(idxResult) {\n return idxResult.v != null && idxResult.n != null;\n }\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\n }();\n if (idxResult) {\n encode.value = [idxResult.v];\n // `potentialNameDimIndex` has highest priority.\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\n // By default, label uses itemName in charts.\n // So we don't set encodeLabel here.\n encode.itemName = [nameDimIndex];\n encode.seriesName = [nameDimIndex];\n }\n return encode;\n}\n/**\n * @return If return null/undefined, indicate that should not use datasetModel.\n */\nexport function querySeriesUpstreamDatasetModel(seriesModel) {\n // Caution: consider the scenario:\n // A dataset is declared and a series is not expected to use the dataset,\n // and at the beginning `setOption({series: { noData })` (just prepare other\n // option but no data), then `setOption({series: {data: [...]}); In this case,\n // the user should set an empty array to avoid that dataset is used by default.\n var thisData = seriesModel.get('data', true);\n if (!thisData) {\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\n index: seriesModel.get('datasetIndex', true),\n id: seriesModel.get('datasetId', true)\n }, SINGLE_REFERRING).models[0];\n }\n}\n/**\n * @return Always return an array event empty.\n */\nexport function queryDatasetUpstreamDatasetModels(datasetModel) {\n // Only these attributes declared, we by default reference to `datasetIndex: 0`.\n // Otherwise, no reference.\n if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) {\n return [];\n }\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\n index: datasetModel.get('fromDatasetIndex', true),\n id: datasetModel.get('fromDatasetId', true)\n }, SINGLE_REFERRING).models;\n}\n/**\n * The rule should not be complex, otherwise user might not\n * be able to known where the data is wrong.\n * The code is ugly, but how to make it neat?\n */\nexport function guessOrdinal(source, dimIndex) {\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\n}\n// dimIndex may be overflow source data.\n// return {BE_ORDINAL}\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\n var result;\n // Experience value.\n var maxLoop = 5;\n if (isTypedArray(data)) {\n return BE_ORDINAL.Not;\n }\n // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n var dimName;\n var dimType;\n if (dimensionsDefine) {\n var dimDefItem = dimensionsDefine[dimIndex];\n if (isObject(dimDefItem)) {\n dimName = dimDefItem.name;\n dimType = dimDefItem.type;\n } else if (isString(dimDefItem)) {\n dimName = dimDefItem;\n }\n }\n if (dimType != null) {\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\n }\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data;\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n var sample = dataArrayRows[dimIndex];\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\n if ((result = detectValue(sample[startIndex + i])) != null) {\n return result;\n }\n }\n } else {\n for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\n var row = dataArrayRows[startIndex + i];\n if (row && (result = detectValue(row[dimIndex])) != null) {\n return result;\n }\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var dataObjectRows = data;\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\n var item = dataObjectRows[i];\n if (item && (result = detectValue(item[dimName])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n var dataKeyedColumns = data;\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n var sample = dataKeyedColumns[dimName];\n if (!sample || isTypedArray(sample)) {\n return BE_ORDINAL.Not;\n }\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\n if ((result = detectValue(sample[i])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var dataOriginal = data;\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\n var item = dataOriginal[i];\n var val = getDataItemValue(item);\n if (!isArray(val)) {\n return BE_ORDINAL.Not;\n }\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n function detectValue(val) {\n var beStr = isString(val);\n // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `Number('')` (or any whitespace) is `0`.\n if (val != null && Number.isFinite(Number(val)) && val !== '') {\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\n } else if (beStr && val !== '-') {\n return BE_ORDINAL.Must;\n }\n }\n return BE_ORDINAL.Not;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, assert } from 'zrender/lib/core/util.js';\nimport { isComponentIdInternal } from '../util/model.js';\nvar internalOptionCreatorMap = createHashMap();\nexport function registerInternalOptionCreator(mainType, creator) {\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\n internalOptionCreatorMap.set(mainType, creator);\n}\nexport function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\n if (!internalOptionCreator) {\n return newCmptOptionList;\n }\n var internalOptions = internalOptionCreator(ecModel);\n if (!internalOptions) {\n return newCmptOptionList;\n }\n if (process.env.NODE_ENV !== 'production') {\n for (var i = 0; i < internalOptions.length; i++) {\n assert(isComponentIdInternal(internalOptions[i]));\n }\n }\n return newCmptOptionList.concat(internalOptions);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, normalizeToArray } from '../../util/model.js';\nvar innerColor = makeInner();\nvar innerDecal = makeInner();\nvar PaletteMixin = /** @class */function () {\n function PaletteMixin() {}\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\n var defaultPalette = normalizeToArray(this.get('color', true));\n var layeredPalette = this.get('colorLayer', true);\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\n };\n PaletteMixin.prototype.clearColorPalette = function () {\n clearPalette(this, innerColor);\n };\n return PaletteMixin;\n}();\nexport function getDecalFromPalette(ecModel, name, scope, requestNum) {\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\n}\nfunction getNearestPalette(palettes, requestColorNum) {\n var paletteNum = palettes.length;\n // TODO palettes must be in order\n for (var i = 0; i < paletteNum; i++) {\n if (palettes[i].length > requestColorNum) {\n return palettes[i];\n }\n }\n return palettes[paletteNum - 1];\n}\n/**\n * @param name MUST NOT be null/undefined. Otherwise call this function\n * twise with the same parameters will get different result.\n * @param scope default this.\n * @return Can be null/undefined\n */\nfunction getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\n scope = scope || that;\n var scopeFields = inner(scope);\n var paletteIdx = scopeFields.paletteIdx || 0;\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\n // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n if (paletteNameMap.hasOwnProperty(name)) {\n return paletteNameMap[name];\n }\n var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum);\n // In case can't find in layered color palette.\n palette = palette || defaultPalette;\n if (!palette || !palette.length) {\n return;\n }\n var pickedPaletteItem = palette[paletteIdx];\n if (name) {\n paletteNameMap[name] = pickedPaletteItem;\n }\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\n return pickedPaletteItem;\n}\nfunction clearPalette(that, inner) {\n inner(that).paletteIdx = 0;\n inner(that).paletteNameMap = {};\n}\nexport { PaletteMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Caution: If the mechanism should be changed some day, these cases\n * should be considered:\n *\n * (1) In `merge option` mode, if using the same option to call `setOption`\n * many times, the result should be the same (try our best to ensure that).\n * (2) In `merge option` mode, if a component has no id/name specified, it\n * will be merged by index, and the result sequence of the components is\n * consistent to the original sequence.\n * (3) In `replaceMerge` mode, keep the result sequence of the components is\n * consistent to the original sequence, even though there might result in \"hole\".\n * (4) `reset` feature (in toolbox). Find detailed info in comments about\n * `mergeOption` in module:echarts/model/OptionManager.\n */\nimport { each, filter, isArray, isObject, isString, createHashMap, assert, clone, merge, extend, mixin, isFunction } from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../util/model.js';\nimport Model from './Model.js';\nimport ComponentModel from './Component.js';\nimport globalDefault from './globalDefault.js';\nimport { resetSourceDefaulter } from '../data/helper/sourceHelper.js';\nimport { concatInternalOptions } from './internalComponentCreator.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { error, warn } from '../util/log.js';\n// -----------------------\n// Internal method names:\n// -----------------------\nvar reCreateSeriesIndices;\nvar assertSeriesInitialized;\nvar initBase;\nvar OPTION_INNER_KEY = '\\0_ec_inner';\nvar OPTION_INNER_VALUE = 1;\nvar BUITIN_COMPONENTS_MAP = {\n grid: 'GridComponent',\n polar: 'PolarComponent',\n geo: 'GeoComponent',\n singleAxis: 'SingleAxisComponent',\n parallel: 'ParallelComponent',\n calendar: 'CalendarComponent',\n graphic: 'GraphicComponent',\n toolbox: 'ToolboxComponent',\n tooltip: 'TooltipComponent',\n axisPointer: 'AxisPointerComponent',\n brush: 'BrushComponent',\n title: 'TitleComponent',\n timeline: 'TimelineComponent',\n markPoint: 'MarkPointComponent',\n markLine: 'MarkLineComponent',\n markArea: 'MarkAreaComponent',\n legend: 'LegendComponent',\n dataZoom: 'DataZoomComponent',\n visualMap: 'VisualMapComponent',\n // aria: 'AriaComponent',\n // dataset: 'DatasetComponent',\n // Dependencies\n xAxis: 'GridComponent',\n yAxis: 'GridComponent',\n angleAxis: 'PolarComponent',\n radiusAxis: 'PolarComponent'\n};\nvar BUILTIN_CHARTS_MAP = {\n line: 'LineChart',\n bar: 'BarChart',\n pie: 'PieChart',\n scatter: 'ScatterChart',\n radar: 'RadarChart',\n map: 'MapChart',\n tree: 'TreeChart',\n treemap: 'TreemapChart',\n graph: 'GraphChart',\n gauge: 'GaugeChart',\n funnel: 'FunnelChart',\n parallel: 'ParallelChart',\n sankey: 'SankeyChart',\n boxplot: 'BoxplotChart',\n candlestick: 'CandlestickChart',\n effectScatter: 'EffectScatterChart',\n lines: 'LinesChart',\n heatmap: 'HeatmapChart',\n pictorialBar: 'PictorialBarChart',\n themeRiver: 'ThemeRiverChart',\n sunburst: 'SunburstChart',\n custom: 'CustomChart'\n};\nvar componetsMissingLogPrinted = {};\nfunction checkMissingComponents(option) {\n each(option, function (componentOption, mainType) {\n if (!ComponentModel.hasClass(mainType)) {\n var componentImportName = BUITIN_COMPONENTS_MAP[mainType];\n if (componentImportName && !componetsMissingLogPrinted[componentImportName]) {\n error(\"Component \" + mainType + \" is used but not imported.\\nimport { \" + componentImportName + \" } from 'echarts/components';\\necharts.use([\" + componentImportName + \"]);\");\n componetsMissingLogPrinted[componentImportName] = true;\n }\n }\n });\n}\nvar GlobalModel = /** @class */function (_super) {\n __extends(GlobalModel, _super);\n function GlobalModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\n theme = theme || {};\n this.option = null; // Mark as not initialized.\n this._theme = new Model(theme);\n this._locale = new Model(locale);\n this._optionManager = optionManager;\n };\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\n if (process.env.NODE_ENV !== 'production') {\n assert(option != null, 'option is null/undefined');\n assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()');\n }\n var innerOpt = normalizeSetOptionInput(opts);\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\n this._resetOption(null, innerOpt);\n };\n /**\n * @param type null/undefined: reset all.\n * 'recreate': force recreate all.\n * 'timeline': only reset timeline option\n * 'media': only reset media query option\n * @return Whether option changed.\n */\n GlobalModel.prototype.resetOption = function (type, opt) {\n return this._resetOption(type, normalizeSetOptionInput(opt));\n };\n GlobalModel.prototype._resetOption = function (type, opt) {\n var optionChanged = false;\n var optionManager = this._optionManager;\n if (!type || type === 'recreate') {\n var baseOption = optionManager.mountOption(type === 'recreate');\n if (process.env.NODE_ENV !== 'production') {\n checkMissingComponents(baseOption);\n }\n if (!this.option || type === 'recreate') {\n initBase(this, baseOption);\n } else {\n this.restoreData();\n this._mergeOption(baseOption, opt);\n }\n optionChanged = true;\n }\n if (type === 'timeline' || type === 'media') {\n this.restoreData();\n }\n // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,\n // it should better not have the same props with `MediaUnit['option']`.\n // Because either `option2` or `MediaUnit['option']` will be always merged to \"current option\"\n // rather than original \"baseOption\". If they both override a prop, the result might be\n // unexpected when media state changed after `setOption` called.\n // If we really need to modify a props in each `MediaUnit['option']`, use the full version\n // (`{baseOption, media}`) in `setOption`.\n // For `timeline`, the case is the same.\n if (!type || type === 'recreate' || type === 'timeline') {\n var timelineOption = optionManager.getTimelineOption(this);\n if (timelineOption) {\n optionChanged = true;\n this._mergeOption(timelineOption, opt);\n }\n }\n if (!type || type === 'recreate' || type === 'media') {\n var mediaOptions = optionManager.getMediaOption(this);\n if (mediaOptions.length) {\n each(mediaOptions, function (mediaOption) {\n optionChanged = true;\n this._mergeOption(mediaOption, opt);\n }, this);\n }\n }\n return optionChanged;\n };\n GlobalModel.prototype.mergeOption = function (option) {\n this._mergeOption(option, null);\n };\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\n var option = this.option;\n var componentsMap = this._componentsMap;\n var componentsCount = this._componentsCount;\n var newCmptTypes = [];\n var newCmptTypeMap = createHashMap();\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\n resetSourceDefaulter(this);\n // If no component class, merge directly.\n // For example: color, animaiton options, etc.\n each(newOption, function (componentOption, mainType) {\n if (componentOption == null) {\n return;\n }\n if (!ComponentModel.hasClass(mainType)) {\n // globalSettingTask.dirty();\n option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n } else if (mainType) {\n newCmptTypes.push(mainType);\n newCmptTypeMap.set(mainType, true);\n }\n });\n if (replaceMergeMainTypeMap) {\n // If there is a mainType `xxx` in `replaceMerge` but not declared in option,\n // we trade it as it is declared in option as `{xxx: []}`. Because:\n // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.\n // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\n newCmptTypes.push(mainTypeInReplaceMerge);\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\n }\n });\n }\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n function visitComponent(mainType) {\n var newCmptOptionList = concatInternalOptions(this, mainType, modelUtil.normalizeToArray(newOption[mainType]));\n var oldCmptList = componentsMap.get(mainType);\n var mergeMode =\n // `!oldCmptList` means init. See the comment in `mappingToExists`\n !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge';\n var mappingResult = modelUtil.mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\n // Set mainType and complete subType.\n modelUtil.setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);\n // Empty it before the travel, in order to prevent `this._componentsMap`\n // from being used in the `init`/`mergeOption`/`optionUpdated` of some\n // components, which is probably incorrect logic.\n option[mainType] = null;\n componentsMap.set(mainType, null);\n componentsCount.set(mainType, 0);\n var optionsByMainType = [];\n var cmptsByMainType = [];\n var cmptsCountByMainType = 0;\n var tooltipExists;\n var tooltipWarningLogged;\n each(mappingResult, function (resultItem, index) {\n var componentModel = resultItem.existing;\n var newCmptOption = resultItem.newOption;\n if (!newCmptOption) {\n if (componentModel) {\n // Consider where is no new option and should be merged using {},\n // see removeEdgeAndAdd in topologicalTravel and\n // ComponentModel.getAllClassMainTypes.\n componentModel.mergeOption({}, this);\n componentModel.optionUpdated({}, false);\n }\n // If no both `resultItem.exist` and `resultItem.option`,\n // either it is in `replaceMerge` and not matched by any id,\n // or it has been removed in previous `replaceMerge` and left a \"hole\" in this component index.\n } else {\n var isSeriesType = mainType === 'series';\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists\n );\n\n if (!ComponentModelClass) {\n if (process.env.NODE_ENV !== 'production') {\n var subType = resultItem.keyInfo.subType;\n var seriesImportName = BUILTIN_CHARTS_MAP[subType];\n if (!componetsMissingLogPrinted[subType]) {\n componetsMissingLogPrinted[subType] = true;\n if (seriesImportName) {\n error(\"Series \" + subType + \" is used but not imported.\\nimport { \" + seriesImportName + \" } from 'echarts/charts';\\necharts.use([\" + seriesImportName + \"]);\");\n } else {\n error(\"Unknown series \" + subType);\n }\n }\n }\n return;\n }\n // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception.\n if (mainType === 'tooltip') {\n if (tooltipExists) {\n if (process.env.NODE_ENV !== 'production') {\n if (!tooltipWarningLogged) {\n warn('Currently only one tooltip component is allowed.');\n tooltipWarningLogged = true;\n }\n }\n return;\n }\n tooltipExists = true;\n }\n if (componentModel && componentModel.constructor === ComponentModelClass) {\n componentModel.name = resultItem.keyInfo.name;\n // componentModel.settingTask && componentModel.settingTask.dirty();\n componentModel.mergeOption(newCmptOption, this);\n componentModel.optionUpdated(newCmptOption, false);\n } else {\n // PENDING Global as parent ?\n var extraOpt = extend({\n componentIndex: index\n }, resultItem.keyInfo);\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);\n // Assign `keyInfo`\n extend(componentModel, extraOpt);\n if (resultItem.brandNew) {\n componentModel.__requireNewView = true;\n }\n componentModel.init(newCmptOption, this, this);\n // Call optionUpdated after init.\n // newCmptOption has been used as componentModel.option\n // and may be merged with theme and default, so pass null\n // to avoid confusion.\n componentModel.optionUpdated(null, true);\n }\n }\n if (componentModel) {\n optionsByMainType.push(componentModel.option);\n cmptsByMainType.push(componentModel);\n cmptsCountByMainType++;\n } else {\n // Always do assign to avoid elided item in array.\n optionsByMainType.push(void 0);\n cmptsByMainType.push(void 0);\n }\n }, this);\n option[mainType] = optionsByMainType;\n componentsMap.set(mainType, cmptsByMainType);\n componentsCount.set(mainType, cmptsCountByMainType);\n // Backup series for filtering.\n if (mainType === 'series') {\n reCreateSeriesIndices(this);\n }\n }\n // If no series declared, ensure `_seriesIndices` initialized.\n if (!this._seriesIndices) {\n reCreateSeriesIndices(this);\n }\n };\n /**\n * Get option for output (cloned option and inner info removed)\n */\n GlobalModel.prototype.getOption = function () {\n var option = clone(this.option);\n each(option, function (optInMainType, mainType) {\n if (ComponentModel.hasClass(mainType)) {\n var opts = modelUtil.normalizeToArray(optInMainType);\n // Inner cmpts need to be removed.\n // Inner cmpts might not be at last since ec5.0, but still\n // compatible for users: if inner cmpt at last, splice the returned array.\n var realLen = opts.length;\n var metNonInner = false;\n for (var i = realLen - 1; i >= 0; i--) {\n // Remove options with inner id.\n if (opts[i] && !modelUtil.isComponentIdInternal(opts[i])) {\n metNonInner = true;\n } else {\n opts[i] = null;\n !metNonInner && realLen--;\n }\n }\n opts.length = realLen;\n option[mainType] = opts;\n }\n });\n delete option[OPTION_INNER_KEY];\n return option;\n };\n GlobalModel.prototype.getTheme = function () {\n return this._theme;\n };\n GlobalModel.prototype.getLocaleModel = function () {\n return this._locale;\n };\n GlobalModel.prototype.setUpdatePayload = function (payload) {\n this._payload = payload;\n };\n GlobalModel.prototype.getUpdatePayload = function () {\n return this._payload;\n };\n /**\n * @param idx If not specified, return the first one.\n */\n GlobalModel.prototype.getComponent = function (mainType, idx) {\n var list = this._componentsMap.get(mainType);\n if (list) {\n var cmpt = list[idx || 0];\n if (cmpt) {\n return cmpt;\n } else if (idx == null) {\n for (var i = 0; i < list.length; i++) {\n if (list[i]) {\n return list[i];\n }\n }\n }\n }\n };\n /**\n * @return Never be null/undefined.\n */\n GlobalModel.prototype.queryComponents = function (condition) {\n var mainType = condition.mainType;\n if (!mainType) {\n return [];\n }\n var index = condition.index;\n var id = condition.id;\n var name = condition.name;\n var cmpts = this._componentsMap.get(mainType);\n if (!cmpts || !cmpts.length) {\n return [];\n }\n var result;\n if (index != null) {\n result = [];\n each(modelUtil.normalizeToArray(index), function (idx) {\n cmpts[idx] && result.push(cmpts[idx]);\n });\n } else if (id != null) {\n result = queryByIdOrName('id', id, cmpts);\n } else if (name != null) {\n result = queryByIdOrName('name', name, cmpts);\n } else {\n // Return all non-empty components in that mainType\n result = filter(cmpts, function (cmpt) {\n return !!cmpt;\n });\n }\n return filterBySubType(result, condition);\n };\n /**\n * The interface is different from queryComponents,\n * which is convenient for inner usage.\n *\n * @usage\n * let result = findComponents(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\n * );\n * let result = findComponents(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\n * );\n * let result = findComponents(\n * {mainType: 'series',\n * filter: function (model, index) {...}}\n * );\n * // result like [component0, componnet1, ...]\n */\n GlobalModel.prototype.findComponents = function (condition) {\n var query = condition.query;\n var mainType = condition.mainType;\n var queryCond = getQueryCond(query);\n var result = queryCond ? this.queryComponents(queryCond)\n // Retrieve all non-empty components.\n : filter(this._componentsMap.get(mainType), function (cmpt) {\n return !!cmpt;\n });\n return doFilter(filterBySubType(result, condition));\n function getQueryCond(q) {\n var indexAttr = mainType + 'Index';\n var idAttr = mainType + 'Id';\n var nameAttr = mainType + 'Name';\n return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n mainType: mainType,\n // subType will be filtered finally.\n index: q[indexAttr],\n id: q[idAttr],\n name: q[nameAttr]\n } : null;\n }\n function doFilter(res) {\n return condition.filter ? filter(res, condition.filter) : res;\n }\n };\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\n var componentsMap = this._componentsMap;\n if (isFunction(mainType)) {\n var ctxForAll_1 = cb;\n var cbForAll_1 = mainType;\n componentsMap.each(function (cmpts, componentType) {\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\n }\n });\n } else {\n var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null;\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\n }\n }\n };\n /**\n * Get series list before filtered by name.\n */\n GlobalModel.prototype.getSeriesByName = function (name) {\n var nameStr = modelUtil.convertOptionIdName(name, null);\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && nameStr != null && oneSeries.name === nameStr;\n });\n };\n /**\n * Get series list before filtered by index.\n */\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\n return this._componentsMap.get('series')[seriesIndex];\n };\n /**\n * Get series list before filtered by type.\n * FIXME: rename to getRawSeriesByType?\n */\n GlobalModel.prototype.getSeriesByType = function (subType) {\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && oneSeries.subType === subType;\n });\n };\n /**\n * Get all series before filtered.\n */\n GlobalModel.prototype.getSeries = function () {\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries;\n });\n };\n /**\n * Count series before filtered.\n */\n GlobalModel.prototype.getSeriesCount = function () {\n return this._componentsCount.get('series');\n };\n /**\n * After filtering, series may be different\n * from raw series.\n */\n GlobalModel.prototype.eachSeries = function (cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n cb.call(context, series, rawSeriesIndex);\n }, this);\n };\n /**\n * Iterate raw series before filtered.\n *\n * @param {Function} cb\n * @param {*} context\n */\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\n each(this._componentsMap.get('series'), function (series) {\n series && cb.call(context, series, series.componentIndex);\n });\n };\n /**\n * After filtering, series may be different.\n * from raw series.\n */\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n if (series.subType === subType) {\n cb.call(context, series, rawSeriesIndex);\n }\n }, this);\n };\n /**\n * Iterate raw series before filtered of given type.\n */\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\n return each(this.getSeriesByType(subType), cb, context);\n };\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\n assertSeriesInitialized(this);\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n };\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\n return (this._seriesIndices || []).slice();\n };\n GlobalModel.prototype.filterSeries = function (cb, context) {\n assertSeriesInitialized(this);\n var newSeriesIndices = [];\n each(this._seriesIndices, function (seriesRawIdx) {\n var series = this._componentsMap.get('series')[seriesRawIdx];\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\n }, this);\n this._seriesIndices = newSeriesIndices;\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\n };\n GlobalModel.prototype.restoreData = function (payload) {\n reCreateSeriesIndices(this);\n var componentsMap = this._componentsMap;\n var componentTypes = [];\n componentsMap.each(function (components, componentType) {\n if (ComponentModel.hasClass(componentType)) {\n componentTypes.push(componentType);\n }\n });\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\n each(componentsMap.get(componentType), function (component) {\n if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) {\n component.restoreData();\n }\n });\n });\n };\n GlobalModel.internalField = function () {\n reCreateSeriesIndices = function (ecModel) {\n var seriesIndices = ecModel._seriesIndices = [];\n each(ecModel._componentsMap.get('series'), function (series) {\n // series may have been removed by `replaceMerge`.\n series && seriesIndices.push(series.componentIndex);\n });\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\n };\n assertSeriesInitialized = function (ecModel) {\n // Components that use _seriesIndices should depends on series component,\n // which make sure that their initialization is after series.\n if (process.env.NODE_ENV !== 'production') {\n if (!ecModel._seriesIndices) {\n throw new Error('Option should contains series.');\n }\n }\n };\n initBase = function (ecModel, baseOption) {\n // Using OPTION_INNER_KEY to mark that this option cannot be used outside,\n // i.e. `chart.setOption(chart.getModel().option);` is forbidden.\n ecModel.option = {};\n ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE;\n // Init with series: [], in case of calling findSeries method\n // before series initialized.\n ecModel._componentsMap = createHashMap({\n series: []\n });\n ecModel._componentsCount = createHashMap();\n // If user spefied `option.aria`, aria will be enable. This detection should be\n // performed before theme and globalDefault merge.\n var airaOption = baseOption.aria;\n if (isObject(airaOption) && airaOption.enabled == null) {\n airaOption.enabled = true;\n }\n mergeTheme(baseOption, ecModel._theme.option);\n // TODO Needs clone when merging to the unexisted property\n merge(baseOption, globalDefault, false);\n ecModel._mergeOption(baseOption, null);\n };\n }();\n return GlobalModel;\n}(Model);\nfunction isNotTargetSeries(seriesModel, payload) {\n if (payload) {\n var index = payload.seriesIndex;\n var id = payload.seriesId;\n var name_1 = payload.seriesName;\n return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1;\n }\n}\nfunction mergeTheme(option, theme) {\n // PENDING\n // NOT use `colorLayer` in theme if option has `color`\n var notMergeColorLayer = option.color && !option.colorLayer;\n each(theme, function (themeItem, name) {\n if (name === 'colorLayer' && notMergeColorLayer) {\n return;\n }\n // If it is component model mainType, the model handles that merge later.\n // otherwise, merge them here.\n if (!ComponentModel.hasClass(name)) {\n if (typeof themeItem === 'object') {\n option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n } else {\n if (option[name] == null) {\n option[name] = themeItem;\n }\n }\n }\n });\n}\nfunction queryByIdOrName(attr, idOrName, cmpts) {\n // Here is a break from echarts4: string and number are\n // treated as equal.\n if (isArray(idOrName)) {\n var keyMap_1 = createHashMap();\n each(idOrName, function (idOrNameItem) {\n if (idOrNameItem != null) {\n var idName = modelUtil.convertOptionIdName(idOrNameItem, null);\n idName != null && keyMap_1.set(idOrNameItem, true);\n }\n });\n return filter(cmpts, function (cmpt) {\n return cmpt && keyMap_1.get(cmpt[attr]);\n });\n } else {\n var idName_1 = modelUtil.convertOptionIdName(idOrName, null);\n return filter(cmpts, function (cmpt) {\n return cmpt && idName_1 != null && cmpt[attr] === idName_1;\n });\n }\n}\nfunction filterBySubType(components, condition) {\n // Using hasOwnProperty for restrict. Consider\n // subType is undefined in user payload.\n return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) {\n return cmpt && cmpt.subType === condition.subType;\n }) : components;\n}\nfunction normalizeSetOptionInput(opts) {\n var replaceMergeMainTypeMap = createHashMap();\n opts && each(modelUtil.normalizeToArray(opts.replaceMerge), function (mainType) {\n if (process.env.NODE_ENV !== 'production') {\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\n }\n replaceMergeMainTypeMap.set(mainType, true);\n });\n return {\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\n };\n}\nmixin(GlobalModel, PaletteMixin);\nexport default GlobalModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isSSR', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL',\n// 'getModel',\n'getOption',\n// 'getViewOfComponentModel',\n// 'getViewOfSeriesModel',\n'getId', 'updateLabelLayout'];\nvar ExtensionAPI = /** @class */function () {\n function ExtensionAPI(ecInstance) {\n zrUtil.each(availableMethods, function (methodName) {\n this[methodName] = zrUtil.bind(ecInstance[methodName], ecInstance);\n }, this);\n }\n return ExtensionAPI;\n}();\nexport default ExtensionAPI;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar coordinateSystemCreators = {};\nvar CoordinateSystemManager = /** @class */function () {\n function CoordinateSystemManager() {\n this._coordinateSystems = [];\n }\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\n var coordinateSystems = [];\n zrUtil.each(coordinateSystemCreators, function (creator, type) {\n var list = creator.create(ecModel, api);\n coordinateSystems = coordinateSystems.concat(list || []);\n });\n this._coordinateSystems = coordinateSystems;\n };\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\n zrUtil.each(this._coordinateSystems, function (coordSys) {\n coordSys.update && coordSys.update(ecModel, api);\n });\n };\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\n return this._coordinateSystems.slice();\n };\n CoordinateSystemManager.register = function (type, creator) {\n coordinateSystemCreators[type] = creator;\n };\n CoordinateSystemManager.get = function (type) {\n return coordinateSystemCreators[type];\n };\n return CoordinateSystemManager;\n}();\nexport default CoordinateSystemManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { normalizeToArray\n// , MappingExistingItem, setComponentTypeToKeyInfo, mappingToExists\n} from '../util/model.js';\nimport { each, clone, map, isTypedArray, setAsPrimitive, isArray, isObject\n// , HashMap , createHashMap, extend, merge,\n} from 'zrender/lib/core/util.js';\nimport { error } from '../util/log.js';\nvar QUERY_REG = /^(min|max)?(.+)$/;\n// Key: mainType\n// type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;\n/**\n * TERM EXPLANATIONS:\n * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.\n */\nvar OptionManager = /** @class */function () {\n // timeline.notMerge is not supported in ec3. Firstly there is rearly\n // case that notMerge is needed. Secondly supporting 'notMerge' requires\n // rawOption cloned and backuped when timeline changed, which does no\n // good to performance. What's more, that both timeline and setOption\n // method supply 'notMerge' brings complex and some problems.\n // Consider this case:\n // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);\n // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);\n function OptionManager(api) {\n this._timelineOptions = [];\n this._mediaList = [];\n /**\n * -1, means default.\n * empty means no media.\n */\n this._currentMediaIndices = [];\n this._api = api;\n }\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\n if (rawOption) {\n // That set dat primitive is dangerous if user reuse the data when setOption again.\n each(normalizeToArray(rawOption.series), function (series) {\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\n });\n each(normalizeToArray(rawOption.dataset), function (dataset) {\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\n });\n }\n // Caution: some series modify option data, if do not clone,\n // it should ensure that the repeat modify correctly\n // (create a new object when modify itself).\n rawOption = clone(rawOption);\n // FIXME\n // If some property is set in timeline options or media option but\n // not set in baseOption, a warning should be given.\n var optionBackup = this._optionBackup;\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\n this._newBaseOption = newParsedOption.baseOption;\n // For setOption at second time (using merge mode);\n if (optionBackup) {\n // FIXME\n // the restore merge solution is essentially incorrect.\n // the mapping can not be 100% consistent with ecModel, which probably brings\n // potential bug!\n // The first merge is delayed, because in most cases, users do not call `setOption` twice.\n // let fakeCmptsMap = this._fakeCmptsMap;\n // if (!fakeCmptsMap) {\n // fakeCmptsMap = this._fakeCmptsMap = createHashMap();\n // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);\n // }\n // mergeToBackupOption(\n // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt\n // );\n // For simplicity, timeline options and media options do not support merge,\n // that is, if you `setOption` twice and both has timeline options, the latter\n // timeline options will not be merged to the former, but just substitute them.\n if (newParsedOption.timelineOptions.length) {\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\n }\n if (newParsedOption.mediaList.length) {\n optionBackup.mediaList = newParsedOption.mediaList;\n }\n if (newParsedOption.mediaDefault) {\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\n }\n } else {\n this._optionBackup = newParsedOption;\n }\n };\n OptionManager.prototype.mountOption = function (isRecreate) {\n var optionBackup = this._optionBackup;\n this._timelineOptions = optionBackup.timelineOptions;\n this._mediaList = optionBackup.mediaList;\n this._mediaDefault = optionBackup.mediaDefault;\n this._currentMediaIndices = [];\n return clone(isRecreate\n // this._optionBackup.baseOption, which is created at the first `setOption`\n // called, and is merged into every new option by inner method `mergeToBackupOption`\n // each time `setOption` called, can be only used in `isRecreate`, because\n // its reliability is under suspicion. In other cases option merge is\n // performed by `model.mergeOption`.\n ? optionBackup.baseOption : this._newBaseOption);\n };\n OptionManager.prototype.getTimelineOption = function (ecModel) {\n var option;\n var timelineOptions = this._timelineOptions;\n if (timelineOptions.length) {\n // getTimelineOption can only be called after ecModel inited,\n // so we can get currentIndex from timelineModel.\n var timelineModel = ecModel.getComponent('timeline');\n if (timelineModel) {\n option = clone(\n // FIXME:TS as TimelineModel or quivlant interface\n timelineOptions[timelineModel.getCurrentIndex()]);\n }\n }\n return option;\n };\n OptionManager.prototype.getMediaOption = function (ecModel) {\n var ecWidth = this._api.getWidth();\n var ecHeight = this._api.getHeight();\n var mediaList = this._mediaList;\n var mediaDefault = this._mediaDefault;\n var indices = [];\n var result = [];\n // No media defined.\n if (!mediaList.length && !mediaDefault) {\n return result;\n }\n // Multi media may be applied, the latter defined media has higher priority.\n for (var i = 0, len = mediaList.length; i < len; i++) {\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\n indices.push(i);\n }\n }\n // FIXME\n // Whether mediaDefault should force users to provide? Otherwise\n // the change by media query can not be recorvered.\n if (!indices.length && mediaDefault) {\n indices = [-1];\n }\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\n result = map(indices, function (index) {\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\n });\n }\n // Otherwise return nothing.\n this._currentMediaIndices = indices;\n return result;\n };\n return OptionManager;\n}();\n/**\n * [RAW_OPTION_PATTERNS]\n * (Note: \"series: []\" represents all other props in `ECUnitOption`)\n *\n * (1) No prop \"baseOption\" declared:\n * Root option is used as \"baseOption\" (except prop \"options\" and \"media\").\n * ```js\n * option = {\n * series: [],\n * timeline: {},\n * options: [],\n * };\n * option = {\n * series: [],\n * media: {},\n * };\n * option = {\n * series: [],\n * timeline: {},\n * options: [],\n * media: {},\n * }\n * ```\n *\n * (2) Prop \"baseOption\" declared:\n * If \"baseOption\" declared, `ECUnitOption` props can only be declared\n * inside \"baseOption\" except prop \"timeline\" (compat ec2).\n * ```js\n * option = {\n * baseOption: {\n * timeline: {},\n * series: [],\n * },\n * options: []\n * };\n * option = {\n * baseOption: {\n * series: [],\n * },\n * media: []\n * };\n * option = {\n * baseOption: {\n * timeline: {},\n * series: [],\n * },\n * options: []\n * media: []\n * };\n * option = {\n * // ec3 compat ec2: allow (only) `timeline` declared\n * // outside baseOption. Keep this setting for compat.\n * timeline: {},\n * baseOption: {\n * series: [],\n * },\n * options: [],\n * media: []\n * };\n * ```\n */\nfunction parseRawOption(\n// `rawOption` May be modified\nrawOption, optionPreprocessorFuncs, isNew) {\n var mediaList = [];\n var mediaDefault;\n var baseOption;\n var declaredBaseOption = rawOption.baseOption;\n // Compatible with ec2, [RAW_OPTION_PATTERNS] above.\n var timelineOnRoot = rawOption.timeline;\n var timelineOptionsOnRoot = rawOption.options;\n var mediaOnRoot = rawOption.media;\n var hasMedia = !!rawOption.media;\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline);\n if (declaredBaseOption) {\n baseOption = declaredBaseOption;\n // For merge option.\n if (!baseOption.timeline) {\n baseOption.timeline = timelineOnRoot;\n }\n }\n // For convenience, enable to use the root option as the `baseOption`:\n // `{ ...normalOptionProps, media: [{ ... }, { ... }] }`\n else {\n if (hasTimeline || hasMedia) {\n rawOption.options = rawOption.media = null;\n }\n baseOption = rawOption;\n }\n if (hasMedia) {\n if (isArray(mediaOnRoot)) {\n each(mediaOnRoot, function (singleMedia) {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) {\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\n }\n }\n if (singleMedia && singleMedia.option) {\n if (singleMedia.query) {\n mediaList.push(singleMedia);\n } else if (!mediaDefault) {\n // Use the first media default.\n mediaDefault = singleMedia;\n }\n }\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\n }\n }\n }\n doPreprocess(baseOption);\n each(timelineOptionsOnRoot, function (option) {\n return doPreprocess(option);\n });\n each(mediaList, function (media) {\n return doPreprocess(media.option);\n });\n function doPreprocess(option) {\n each(optionPreprocessorFuncs, function (preProcess) {\n preProcess(option, isNew);\n });\n }\n return {\n baseOption: baseOption,\n timelineOptions: timelineOptionsOnRoot || [],\n mediaDefault: mediaDefault,\n mediaList: mediaList\n };\n}\n/**\n * @see \n * Support: width, height, aspectRatio\n * Can use max or min as prefix.\n */\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\n var realMap = {\n width: ecWidth,\n height: ecHeight,\n aspectratio: ecWidth / ecHeight // lower case for convenience.\n };\n\n var applicable = true;\n each(query, function (value, attr) {\n var matched = attr.match(QUERY_REG);\n if (!matched || !matched[1] || !matched[2]) {\n return;\n }\n var operator = matched[1];\n var realAttr = matched[2].toLowerCase();\n if (!compare(realMap[realAttr], value, operator)) {\n applicable = false;\n }\n });\n return applicable;\n}\nfunction compare(real, expect, operator) {\n if (operator === 'min') {\n return real >= expect;\n } else if (operator === 'max') {\n return real <= expect;\n } else {\n // Equals\n return real === expect;\n }\n}\nfunction indicesEquals(indices1, indices2) {\n // indices is always order by asc and has only finite number.\n return indices1.join(',') === indices2.join(',');\n}\n/**\n * Consider case:\n * `chart.setOption(opt1);`\n * Then user do some interaction like dataZoom, dataView changing.\n * `chart.setOption(opt2);`\n * Then user press 'reset button' in toolbox.\n *\n * After doing that all of the interaction effects should be reset, the\n * chart should be the same as the result of invoke\n * `chart.setOption(opt1); chart.setOption(opt2);`.\n *\n * Although it is not able ensure that\n * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to\n * `chart.setOption(merge(opt1, opt2));` exactly,\n * this might be the only simple way to implement that feature.\n *\n * MEMO: We've considered some other approaches:\n * 1. Each model handles its self restoration but not uniform treatment.\n * (Too complex in logic and error-prone)\n * 2. Use a shadow ecModel. (Performance expensive)\n *\n * FIXME: A possible solution:\n * Add a extra level of model for each component model. The inheritance chain would be:\n * ecModel <- componentModel <- componentActionModel <- dataItemModel\n * And all of the actions can only modify the `componentActionModel` rather than\n * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.\n * When \"resotre\" action triggered, model from `componentActionModel` will be discarded\n * instead of recreating the \"ecModel\" from the \"_optionBackup\".\n */\n// function mergeToBackupOption(\n// fakeCmptsMap: FakeComponentsMap,\n// // `tarOption` Can be null/undefined, means init\n// tarOption: ECUnitOption,\n// newOption: ECUnitOption,\n// // Can be null/undefined\n// opt: InnerSetOptionOpts\n// ): void {\n// newOption = newOption || {} as ECUnitOption;\n// const notInit = !!tarOption;\n// each(newOption, function (newOptsInMainType, mainType) {\n// if (newOptsInMainType == null) {\n// return;\n// }\n// if (!ComponentModel.hasClass(mainType)) {\n// if (tarOption) {\n// tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);\n// }\n// }\n// else {\n// const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;\n// const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];\n// const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;\n// const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);\n// const mappingResult = mappingToExists(\n// oldFakeCmptsInMainType,\n// normalizeToArray(newOptsInMainType),\n// (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'\n// );\n// setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);\n// each(mappingResult, function (resultItem, index) {\n// // The same logic as `Global.ts#_mergeOption`.\n// let fakeCmpt = resultItem.existing;\n// const newOption = resultItem.newOption;\n// const keyInfo = resultItem.keyInfo;\n// let fakeCmptOpt;\n// if (!newOption) {\n// fakeCmptOpt = oldTarOptsInMainType[index];\n// }\n// else {\n// if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {\n// fakeCmpt.name = keyInfo.name;\n// if (notInit) {\n// fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);\n// }\n// }\n// else {\n// fakeCmpt = extend({}, keyInfo);\n// if (notInit) {\n// fakeCmptOpt = clone(newOption);\n// }\n// }\n// }\n// if (fakeCmpt) {\n// notInit && resultTarOptsInMainType.push(fakeCmptOpt);\n// resultFakeCmptsInMainType.push(fakeCmpt);\n// }\n// else {\n// notInit && resultTarOptsInMainType.push(void 0);\n// resultFakeCmptsInMainType.push(void 0);\n// }\n// });\n// }\n// });\n// }\nexport default OptionManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine'];\nfunction compatEC2ItemStyle(opt) {\n var itemStyleOpt = opt && opt.itemStyle;\n if (!itemStyleOpt) {\n return;\n }\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\n var styleName = POSSIBLE_STYLES[i];\n var normalItemStyleOpt = itemStyleOpt.normal;\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\n }\n opt[styleName] = opt[styleName] || {};\n if (!opt[styleName].normal) {\n opt[styleName].normal = normalItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\n }\n normalItemStyleOpt[styleName] = null;\n }\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\n }\n opt[styleName] = opt[styleName] || {};\n if (!opt[styleName].emphasis) {\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\n }\n emphasisItemStyleOpt[styleName] = null;\n }\n }\n}\nfunction convertNormalEmphasis(opt, optType, useExtend) {\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\n var normalOpt = opt[optType].normal;\n var emphasisOpt = opt[optType].emphasis;\n if (normalOpt) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\n }\n // Timeline controlStyle has other properties besides normal and emphasis\n if (useExtend) {\n opt[optType].normal = opt[optType].emphasis = null;\n zrUtil.defaults(opt[optType], normalOpt);\n } else {\n opt[optType] = normalOpt;\n }\n }\n if (emphasisOpt) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\n }\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[optType] = emphasisOpt;\n // Also compat the case user mix the style and focus together in ec3 style\n // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }\n if (emphasisOpt.focus) {\n opt.emphasis.focus = emphasisOpt.focus;\n }\n if (emphasisOpt.blurScope) {\n opt.emphasis.blurScope = emphasisOpt.blurScope;\n }\n }\n }\n}\nfunction removeEC3NormalStatus(opt) {\n convertNormalEmphasis(opt, 'itemStyle');\n convertNormalEmphasis(opt, 'lineStyle');\n convertNormalEmphasis(opt, 'areaStyle');\n convertNormalEmphasis(opt, 'label');\n convertNormalEmphasis(opt, 'labelLine');\n // treemap\n convertNormalEmphasis(opt, 'upperLabel');\n // graph\n convertNormalEmphasis(opt, 'edgeLabel');\n}\nfunction compatTextStyle(opt, propName) {\n // Check whether is not object (string\\null\\undefined ...)\n var labelOptSingle = isObject(opt) && opt[propName];\n var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;\n if (textStyle) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\n }\n for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {\n var textPropName = modelUtil.TEXT_STYLE_OPTIONS[i];\n if (textStyle.hasOwnProperty(textPropName)) {\n labelOptSingle[textPropName] = textStyle[textPropName];\n }\n }\n }\n}\nfunction compatEC3CommonStyles(opt) {\n if (opt) {\n removeEC3NormalStatus(opt);\n compatTextStyle(opt, 'label');\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\n }\n}\nfunction processSeries(seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n compatEC2ItemStyle(seriesOpt);\n removeEC3NormalStatus(seriesOpt);\n compatTextStyle(seriesOpt, 'label');\n // treemap\n compatTextStyle(seriesOpt, 'upperLabel');\n // graph\n compatTextStyle(seriesOpt, 'edgeLabel');\n if (seriesOpt.emphasis) {\n compatTextStyle(seriesOpt.emphasis, 'label');\n // treemap\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\n // graph\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\n }\n var markPoint = seriesOpt.markPoint;\n if (markPoint) {\n compatEC2ItemStyle(markPoint);\n compatEC3CommonStyles(markPoint);\n }\n var markLine = seriesOpt.markLine;\n if (markLine) {\n compatEC2ItemStyle(markLine);\n compatEC3CommonStyles(markLine);\n }\n var markArea = seriesOpt.markArea;\n if (markArea) {\n compatEC3CommonStyles(markArea);\n }\n var data = seriesOpt.data;\n // Break with ec3: if `setOption` again, there may be no `type` in option,\n // then the backward compat based on option type will not be performed.\n if (seriesOpt.type === 'graph') {\n data = data || seriesOpt.nodes;\n var edgeData = seriesOpt.links || seriesOpt.edges;\n if (edgeData && !zrUtil.isTypedArray(edgeData)) {\n for (var i = 0; i < edgeData.length; i++) {\n compatEC3CommonStyles(edgeData[i]);\n }\n }\n zrUtil.each(seriesOpt.categories, function (opt) {\n removeEC3NormalStatus(opt);\n });\n }\n if (data && !zrUtil.isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatEC3CommonStyles(data[i]);\n }\n }\n // mark point data\n markPoint = seriesOpt.markPoint;\n if (markPoint && markPoint.data) {\n var mpData = markPoint.data;\n for (var i = 0; i < mpData.length; i++) {\n compatEC3CommonStyles(mpData[i]);\n }\n }\n // mark line data\n markLine = seriesOpt.markLine;\n if (markLine && markLine.data) {\n var mlData = markLine.data;\n for (var i = 0; i < mlData.length; i++) {\n if (zrUtil.isArray(mlData[i])) {\n compatEC3CommonStyles(mlData[i][0]);\n compatEC3CommonStyles(mlData[i][1]);\n } else {\n compatEC3CommonStyles(mlData[i]);\n }\n }\n }\n // Series\n if (seriesOpt.type === 'gauge') {\n compatTextStyle(seriesOpt, 'axisLabel');\n compatTextStyle(seriesOpt, 'title');\n compatTextStyle(seriesOpt, 'detail');\n } else if (seriesOpt.type === 'treemap') {\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\n zrUtil.each(seriesOpt.levels, function (opt) {\n removeEC3NormalStatus(opt);\n });\n } else if (seriesOpt.type === 'tree') {\n removeEC3NormalStatus(seriesOpt.leaves);\n }\n // sunburst starts from ec4, so it does not need to compat levels.\n}\n\nfunction toArr(o) {\n return zrUtil.isArray(o) ? o : o ? [o] : [];\n}\nfunction toObj(o) {\n return (zrUtil.isArray(o) ? o[0] : o) || {};\n}\nexport default function globalCompatStyle(option, isTheme) {\n each(toArr(option.series), function (seriesOpt) {\n isObject(seriesOpt) && processSeries(seriesOpt);\n });\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\n each(axes, function (axisName) {\n each(toArr(option[axisName]), function (axisOpt) {\n if (axisOpt) {\n compatTextStyle(axisOpt, 'axisLabel');\n compatTextStyle(axisOpt.axisPointer, 'label');\n }\n });\n });\n each(toArr(option.parallel), function (parallelOpt) {\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\n compatTextStyle(parallelAxisDefault, 'axisLabel');\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\n });\n each(toArr(option.calendar), function (calendarOpt) {\n convertNormalEmphasis(calendarOpt, 'itemStyle');\n compatTextStyle(calendarOpt, 'dayLabel');\n compatTextStyle(calendarOpt, 'monthLabel');\n compatTextStyle(calendarOpt, 'yearLabel');\n });\n // radar.name.textStyle\n each(toArr(option.radar), function (radarOpt) {\n compatTextStyle(radarOpt, 'name');\n // Use axisName instead of name because component has name property\n if (radarOpt.name && radarOpt.axisName == null) {\n radarOpt.axisName = radarOpt.name;\n delete radarOpt.name;\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('name property in radar component has been changed to axisName');\n }\n }\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\n radarOpt.axisNameGap = radarOpt.nameGap;\n delete radarOpt.nameGap;\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n each(radarOpt.indicator, function (indicatorOpt) {\n if (indicatorOpt.text) {\n deprecateReplaceLog('text', 'name', 'radar.indicator');\n }\n });\n }\n });\n each(toArr(option.geo), function (geoOpt) {\n if (isObject(geoOpt)) {\n compatEC3CommonStyles(geoOpt);\n each(toArr(geoOpt.regions), function (regionObj) {\n compatEC3CommonStyles(regionObj);\n });\n }\n });\n each(toArr(option.timeline), function (timelineOpt) {\n compatEC3CommonStyles(timelineOpt);\n convertNormalEmphasis(timelineOpt, 'label');\n convertNormalEmphasis(timelineOpt, 'itemStyle');\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\n var data = timelineOpt.data;\n zrUtil.isArray(data) && zrUtil.each(data, function (item) {\n if (zrUtil.isObject(item)) {\n convertNormalEmphasis(item, 'label');\n convertNormalEmphasis(item, 'itemStyle');\n }\n });\n });\n each(toArr(option.toolbox), function (toolboxOpt) {\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\n each(toolboxOpt.feature, function (featureOpt) {\n convertNormalEmphasis(featureOpt, 'iconStyle');\n });\n });\n compatTextStyle(toObj(option.axisPointer), 'label');\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\n // Clean logs\n // storedLogs = {};\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isArray, isObject, isTypedArray, defaults } from 'zrender/lib/core/util.js';\nimport compatStyle from './helper/compatStyle.js';\nimport { normalizeToArray } from '../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../util/log.js';\nfunction get(opt, path) {\n var pathArr = path.split(',');\n var obj = opt;\n for (var i = 0; i < pathArr.length; i++) {\n obj = obj && obj[pathArr[i]];\n if (obj == null) {\n break;\n }\n }\n return obj;\n}\nfunction set(opt, path, val, overwrite) {\n var pathArr = path.split(',');\n var obj = opt;\n var key;\n var i = 0;\n for (; i < pathArr.length - 1; i++) {\n key = pathArr[i];\n if (obj[key] == null) {\n obj[key] = {};\n }\n obj = obj[key];\n }\n if (overwrite || obj[pathArr[i]] == null) {\n obj[pathArr[i]] = val;\n }\n}\nfunction compatLayoutProperties(option) {\n option && each(LAYOUT_PROPERTIES, function (prop) {\n if (prop[0] in option && !(prop[1] in option)) {\n option[prop[1]] = option[prop[0]];\n }\n });\n}\nvar LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']];\nvar COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'];\nvar BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']];\nfunction compatBarItemStyle(option) {\n var itemStyle = option && option.itemStyle;\n if (itemStyle) {\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\n var newName = BAR_ITEM_STYLE_MAP[i][0];\n if (itemStyle[oldName] != null) {\n itemStyle[newName] = itemStyle[oldName];\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(oldName, newName);\n }\n }\n }\n }\n}\nfunction compatPieLabel(option) {\n if (!option) {\n return;\n }\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\n }\n option.edgeDistance = option.margin;\n }\n}\nfunction compatSunburstState(option) {\n if (!option) {\n return;\n }\n if (option.downplay && !option.blur) {\n option.blur = option.downplay;\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\n }\n }\n}\nfunction compatGraphFocus(option) {\n if (!option) {\n return;\n }\n if (option.focusNodeAdjacency != null) {\n option.emphasis = option.emphasis || {};\n if (option.emphasis.focus == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\n }\n option.emphasis.focus = 'adjacency';\n }\n }\n}\nfunction traverseTree(data, cb) {\n if (data) {\n for (var i = 0; i < data.length; i++) {\n cb(data[i]);\n data[i] && traverseTree(data[i].children, cb);\n }\n }\n}\nexport default function globalBackwardCompat(option, isTheme) {\n compatStyle(option, isTheme);\n // Make sure series array for model initialization.\n option.series = normalizeToArray(option.series);\n each(option.series, function (seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n var seriesType = seriesOpt.type;\n if (seriesType === 'line') {\n if (seriesOpt.clipOverflow != null) {\n seriesOpt.clip = seriesOpt.clipOverflow;\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\n }\n }\n } else if (seriesType === 'pie' || seriesType === 'gauge') {\n if (seriesOpt.clockWise != null) {\n seriesOpt.clockwise = seriesOpt.clockWise;\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clockWise', 'clockwise');\n }\n }\n compatPieLabel(seriesOpt.label);\n var data = seriesOpt.data;\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatPieLabel(data[i]);\n }\n }\n if (seriesOpt.hoverOffset != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n if (seriesOpt.emphasis.scaleSize = null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\n }\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\n }\n }\n } else if (seriesType === 'gauge') {\n var pointerColor = get(seriesOpt, 'pointer.color');\n pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);\n } else if (seriesType === 'bar') {\n compatBarItemStyle(seriesOpt);\n compatBarItemStyle(seriesOpt.backgroundStyle);\n compatBarItemStyle(seriesOpt.emphasis);\n var data = seriesOpt.data;\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n if (typeof data[i] === 'object') {\n compatBarItemStyle(data[i]);\n compatBarItemStyle(data[i] && data[i].emphasis);\n }\n }\n }\n } else if (seriesType === 'sunburst') {\n var highlightPolicy = seriesOpt.highlightPolicy;\n if (highlightPolicy) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n if (!seriesOpt.emphasis.focus) {\n seriesOpt.emphasis.focus = highlightPolicy;\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\n }\n }\n }\n compatSunburstState(seriesOpt);\n traverseTree(seriesOpt.data, compatSunburstState);\n } else if (seriesType === 'graph' || seriesType === 'sankey') {\n compatGraphFocus(seriesOpt);\n // TODO nodes, edges?\n } else if (seriesType === 'map') {\n if (seriesOpt.mapType && !seriesOpt.map) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('mapType', 'map', 'map');\n }\n seriesOpt.map = seriesOpt.mapType;\n }\n if (seriesOpt.mapLocation) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('`mapLocation` is not used anymore.');\n }\n defaults(seriesOpt, seriesOpt.mapLocation);\n }\n }\n if (seriesOpt.hoverAnimation != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\n }\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\n }\n }\n compatLayoutProperties(seriesOpt);\n });\n // dataRange has changed to visualMap\n if (option.dataRange) {\n option.visualMap = option.dataRange;\n }\n each(COMPATITABLE_COMPONENTS, function (componentName) {\n var options = option[componentName];\n if (options) {\n if (!isArray(options)) {\n options = [options];\n }\n each(options, function (option) {\n compatLayoutProperties(option);\n });\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { addSafe } from '../util/number.js';\n// (1) [Caution]: the logic is correct based on the premises:\n// data processing stage is blocked in stream.\n// See \n// (2) Only register once when import repeatedly.\n// Should be executed after series is filtered and before stack calculation.\nexport default function dataStack(ecModel) {\n var stackInfoMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var stack = seriesModel.get('stack');\n // Compatible: when `stack` is set as '', do not stack.\n if (stack) {\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\n var data = seriesModel.getData();\n var stackInfo = {\n // Used for calculate axis extent automatically.\n // TODO: Type getCalculationInfo return more specific type?\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\n stackedDimension: data.getCalculationInfo('stackedDimension'),\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\n data: data,\n seriesModel: seriesModel\n };\n // If stacked on axis that do not support data stack.\n if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\n return;\n }\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\n stackInfoList.push(stackInfo);\n }\n });\n stackInfoMap.each(calculateStack);\n}\nfunction calculateStack(stackInfoList) {\n each(stackInfoList, function (targetStackInfo, idxInStack) {\n var resultVal = [];\n var resultNaN = [NaN, NaN];\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\n var targetData = targetStackInfo.data;\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\n var stackStrategy = targetStackInfo.seriesModel.get('stackStrategy') || 'samesign';\n // Should not write on raw data, because stack series model list changes\n // depending on legend selection.\n targetData.modify(dims, function (v0, v1, dataIndex) {\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex);\n // Consider `connectNulls` of line area, if value is NaN, stackedOver\n // should also be NaN, to draw a appropriate belt area.\n if (isNaN(sum)) {\n return resultNaN;\n }\n var byValue;\n var stackedDataRawIndex;\n if (isStackedByIndex) {\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\n } else {\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\n }\n // If stackOver is NaN, chart view will render point on value start.\n var stackedOver = NaN;\n for (var j = idxInStack - 1; j >= 0; j--) {\n var stackInfo = stackInfoList[j];\n // Has been optimized by inverted indices on `stackedByDimension`.\n if (!isStackedByIndex) {\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\n }\n if (stackedDataRawIndex >= 0) {\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);\n // Considering positive stack, negative stack and empty data\n if (stackStrategy === 'all' // single stack group\n || stackStrategy === 'positive' && val > 0 || stackStrategy === 'negative' && val < 0 || stackStrategy === 'samesign' && sum >= 0 && val > 0 // All positive stack\n || stackStrategy === 'samesign' && sum <= 0 && val < 0 // All negative stack\n ) {\n // The sum has to be very small to be affected by the\n // floating arithmetic problem. An incorrect result will probably\n // cause axis min/max to be filtered incorrectly.\n sum = addSafe(sum, val);\n stackedOver = val;\n break;\n }\n }\n }\n resultVal[0] = sum;\n resultVal[1] = stackedOver;\n return resultVal;\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isTypedArray, clone, createHashMap, isArray, isObject, isArrayLike, hasOwn, assert, each, map, isNumber, isString, keys } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_UNKNOWN, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW } from '../util/types.js';\nimport { getDataItemValue } from '../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './helper/sourceHelper.js';\n;\n// @inner\nvar SourceImpl = /** @class */function () {\n function SourceImpl(fields) {\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\n // Visit config\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n this.startIndex = fields.startIndex || 0;\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\n this.metaRawOption = fields.metaRawOption;\n var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine;\n if (dimensionsDefine) {\n for (var i = 0; i < dimensionsDefine.length; i++) {\n var dim = dimensionsDefine[i];\n if (dim.type == null) {\n if (guessOrdinal(this, i) === BE_ORDINAL.Must) {\n dim.type = 'ordinal';\n }\n }\n }\n }\n }\n return SourceImpl;\n}();\nexport function isSourceInstance(val) {\n return val instanceof SourceImpl;\n}\n/**\n * Create a source from option.\n * NOTE: Created source is immutable. Don't change any properties in it.\n */\nexport function createSource(sourceData, thisMetaRawOption,\n// can be null. If not provided, auto detect it from `sourceData`.\nsourceFormat) {\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\n var source = new SourceImpl({\n data: sourceData,\n sourceFormat: sourceFormat,\n seriesLayoutBy: seriesLayoutBy,\n dimensionsDefine: determined.dimensionsDefine,\n startIndex: determined.startIndex,\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\n metaRawOption: clone(thisMetaRawOption)\n });\n return source;\n}\n/**\n * Wrap original series data for some compatibility cases.\n */\nexport function createSourceFromSeriesDataOption(data) {\n return new SourceImpl({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n });\n}\n/**\n * Clone source but excludes source data.\n */\nexport function cloneSourceShallow(source) {\n return new SourceImpl({\n data: source.data,\n sourceFormat: source.sourceFormat,\n seriesLayoutBy: source.seriesLayoutBy,\n dimensionsDefine: clone(source.dimensionsDefine),\n startIndex: source.startIndex,\n dimensionsDetectedCount: source.dimensionsDetectedCount\n });\n}\n/**\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\n */\nexport function detectSourceFormat(data) {\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\n if (isTypedArray(data)) {\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\n } else if (isArray(data)) {\n // FIXME Whether tolerate null in top level array?\n if (data.length === 0) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n }\n for (var i = 0, len = data.length; i < len; i++) {\n var item = data[i];\n if (item == null) {\n continue;\n } else if (isArray(item) || isTypedArray(item)) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n break;\n } else if (isObject(item)) {\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\n break;\n }\n }\n } else if (isObject(data)) {\n for (var key in data) {\n if (hasOwn(data, key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n }\n return sourceFormat;\n}\n/**\n * Determine the source definitions from data standalone dimensions definitions\n * are not specified.\n */\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader,\n// standalone raw dimensions definition, like:\n// {\n// dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n var dimensionsDetectedCount;\n var startIndex;\n // PENDING: Could data be null/undefined here?\n // currently, if `dataset.source` not specified, error thrown.\n // if `series.data` not specified, nothing rendered without error thrown.\n // Should test these cases.\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n startIndex: startIndex,\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n }\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data;\n // Rule: Most of the first line are string: it is header.\n // Caution: consider a line with 5 string and 1 number,\n // it still can not be sure it is a head, because the\n // 5 string may be 5 values of category columns.\n if (sourceHeader === 'auto' || sourceHeader == null) {\n arrayRowsTravelFirst(function (val) {\n // '-' is regarded as null/undefined.\n if (val != null && val !== '-') {\n if (isString(val)) {\n startIndex == null && (startIndex = 1);\n } else {\n startIndex = 0;\n }\n }\n // 10 is an experience number, avoid long loop.\n }, seriesLayoutBy, dataArrayRows, 10);\n } else {\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\n }\n if (!dimensionsDefine && startIndex === 1) {\n dimensionsDefine = [];\n arrayRowsTravelFirst(function (val, index) {\n dimensionsDefine[index] = val != null ? val + '' : '';\n }, seriesLayoutBy, dataArrayRows, Infinity);\n }\n dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n each(data, function (colArr, key) {\n dimensionsDefine.push(key);\n });\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var value0 = getDataItemValue(data[0]);\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\n }\n }\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n}\nfunction objectRowsCollectDimensions(data) {\n var firstIndex = 0;\n var obj;\n while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\n if (obj) {\n return keys(obj);\n }\n}\n// Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\n// which is reasonable. But dimension name is duplicated.\n// Returns undefined or an array contains only object without null/undefined or string.\nfunction normalizeDimensionsOption(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n var nameMap = createHashMap();\n return map(dimensionsDefine, function (rawItem, index) {\n rawItem = isObject(rawItem) ? rawItem : {\n name: rawItem\n };\n // Other fields will be discarded.\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n };\n // User can set null in dimensions.\n // We don't auto specify name, otherwise a given name may\n // cause it to be referred unexpectedly.\n if (item.name == null) {\n return item;\n }\n // Also consider number form like 2012.\n item.name += '';\n // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n var exist = nameMap.get(item.name);\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n return item;\n });\n}\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n cb(data[i] ? data[i][0] : null, i);\n }\n } else {\n var value0 = data[0] || [];\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\n cb(value0[i], i);\n }\n }\n}\nexport function shouldRetrieveDataByName(source) {\n var sourceFormat = source.sourceFormat;\n return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _a, _b, _c;\n// TODO\n// ??? refactor? check the outer usage of data provider.\n// merge with defaultDimValueGetter?\nimport { isTypedArray, extend, assert, each, isObject, bind } from 'zrender/lib/core/util.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SERIES_LAYOUT_BY_COLUMN, SERIES_LAYOUT_BY_ROW } from '../../util/types.js';\nvar providerMethods;\nvar mountMethods;\n/**\n * If normal array used, mutable chunk size is supported.\n * If typed array used, chunk size must be fixed.\n */\nvar DefaultDataProvider = /** @class */function () {\n function DefaultDataProvider(sourceParam, dimSize) {\n // let source: Source;\n var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam;\n // declare source is Source;\n this._source = source;\n var data = this._data = source.data;\n // Typed array. TODO IE10+?\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n if (dimSize == null) {\n throw new Error('Typed array data must specify dimension size');\n }\n }\n this._offset = 0;\n this._dimSize = dimSize;\n this._data = data;\n }\n mountMethods(this, data, source);\n }\n DefaultDataProvider.prototype.getSource = function () {\n return this._source;\n };\n DefaultDataProvider.prototype.count = function () {\n return 0;\n };\n DefaultDataProvider.prototype.getItem = function (idx, out) {\n return;\n };\n DefaultDataProvider.prototype.appendData = function (newData) {};\n DefaultDataProvider.prototype.clean = function () {};\n DefaultDataProvider.protoInitialize = function () {\n // PENDING: To avoid potential incompat (e.g., prototype\n // is visited somewhere), still init them on prototype.\n var proto = DefaultDataProvider.prototype;\n proto.pure = false;\n proto.persistent = true;\n }();\n DefaultDataProvider.internalField = function () {\n var _a;\n mountMethods = function (provider, data, source) {\n var sourceFormat = source.sourceFormat;\n var seriesLayoutBy = source.seriesLayoutBy;\n var startIndex = source.startIndex;\n var dimsDef = source.dimensionsDefine;\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n if (process.env.NODE_ENV !== 'production') {\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\n }\n extend(provider, methods);\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n provider.getItem = getItemForTypedArray;\n provider.count = countForTypedArray;\n provider.fillStorage = fillStorageForTypedArray;\n } else {\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\n }\n };\n var getItemForTypedArray = function (idx, out) {\n idx = idx - this._offset;\n out = out || [];\n var data = this._data;\n var dimSize = this._dimSize;\n var offset = dimSize * idx;\n for (var i = 0; i < dimSize; i++) {\n out[i] = data[offset + i];\n }\n return out;\n };\n var fillStorageForTypedArray = function (start, end, storage, extent) {\n var data = this._data;\n var dimSize = this._dimSize;\n for (var dim = 0; dim < dimSize; dim++) {\n var dimExtent = extent[dim];\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\n var count = end - start;\n var arr = storage[dim];\n for (var i = 0; i < count; i++) {\n // appendData with TypedArray will always do replace in provider.\n var val = data[i * dimSize + dim];\n arr[start + i] = val;\n val < min && (min = val);\n val > max && (max = val);\n }\n dimExtent[0] = min;\n dimExtent[1] = max;\n }\n };\n var countForTypedArray = function () {\n return this._data ? this._data.length / this._dimSize : 0;\n };\n providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\n pure: true,\n appendData: function () {\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\n }\n }, _a[SOURCE_FORMAT_OBJECT_ROWS] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\n pure: true,\n appendData: function (newData) {\n var data = this._data;\n each(newData, function (newCol, key) {\n var oldCol = data[key] || (data[key] = []);\n for (var i = 0; i < (newCol || []).length; i++) {\n oldCol.push(newCol[i]);\n }\n });\n }\n }, _a[SOURCE_FORMAT_ORIGINAL] = {\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_TYPED_ARRAY] = {\n persistent: false,\n pure: true,\n appendData: function (newData) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\n }\n this._data = newData;\n },\n // Clean self if data is already used.\n clean: function () {\n // PENDING\n this._offset += this.count();\n this._data = null;\n }\n }, _a);\n function appendDataSimply(newData) {\n for (var i = 0; i < newData.length; i++) {\n this._data.push(newData[i]);\n }\n }\n }();\n return DefaultDataProvider;\n}();\nexport { DefaultDataProvider };\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx];\n};\nvar rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx + startIndex];\n}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx, out) {\n idx += startIndex;\n var item = out || [];\n var data = rawData;\n for (var i = 0; i < data.length; i++) {\n var row = data[i];\n item[i] = row ? row[idx] : null;\n }\n return item;\n}, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx, out) {\n var item = out || [];\n for (var i = 0; i < dimsDef.length; i++) {\n var dimName = dimsDef[i].name;\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n var col = rawData[dimName];\n item[i] = col ? col[idx] : null;\n }\n return item;\n}, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a);\nexport function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n return method;\n}\nvar countSimply = function (rawData, startIndex, dimsDef) {\n return rawData.length;\n};\nvar rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\n return Math.max(0, rawData.length - startIndex);\n}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\n var row = rawData[0];\n return row ? Math.max(0, row.length - startIndex) : 0;\n}, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\n var dimName = dimsDef[0].name;\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n var col = rawData[dimName];\n return col ? col.length : 0;\n}, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b);\nexport function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n return method;\n}\nvar getRawValueSimply = function (dataItem, dimIndex, property) {\n return dataItem[dimIndex];\n};\nvar rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, property) {\n return dataItem[property];\n}, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, property) {\n // FIXME: In some case (markpoint in geo (geo-map.html)),\n // dataItem is {coord: [...]}\n var value = getDataItemValue(dataItem);\n return !(value instanceof Array) ? value : value[dimIndex];\n}, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c);\nexport function getRawSourceValueGetter(sourceFormat) {\n var method = rawSourceValueGetterMap[sourceFormat];\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support get value on \"' + sourceFormat + '\".');\n }\n return method;\n}\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat;\n}\n// ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\n// Consider persistent.\n// Caution: why use raw value to display on label or tooltip?\n// A reason is to avoid format. For example time value we do not know\n// how to format is expected. More over, if stack is used, calculated\n// value may be 0.91000000001, which have brings trouble to display.\n// TODO: consider how to treat null/undefined/NaN when display?\nexport function retrieveRawValue(data, dataIndex,\n// If dimIndex is null/undefined, return OptionDataItem.\n// Otherwise, return OptionDataValue.\ndim) {\n if (!data) {\n return;\n }\n // Consider data may be not persistent.\n var dataItem = data.getRawDataItem(dataIndex);\n if (dataItem == null) {\n return;\n }\n var store = data.getStore();\n var sourceFormat = store.getSource().sourceFormat;\n if (dim != null) {\n var dimIndex = data.getDimensionIndex(dim);\n var property = store.getDimensionProperty(dimIndex);\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property);\n } else {\n var result = dataItem;\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n result = getDataItemValue(dataItem);\n }\n return result;\n }\n}\n/**\n * Compatible with some cases (in pie, map) like:\n * data: [{name: 'xx', value: 5, selected: true}, ...]\n * where only sourceFormat is 'original' and 'objectRows' supported.\n *\n * // TODO\n * Supported detail options in data item when using 'arrayRows'.\n *\n * @param data\n * @param dataIndex\n * @param attr like 'selected'\n */\nexport function retrieveRawAttr(data, dataIndex, attr) {\n if (!data) {\n return;\n }\n var sourceFormat = data.getStore().getSource().sourceFormat;\n if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n return;\n }\n var dataItem = data.getRawDataItem(dataIndex);\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\n dataItem = null;\n }\n if (dataItem) {\n return dataItem[attr];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { formatTpl } from '../../util/format.js';\nimport { error, makePrintable } from '../../util/log.js';\nvar DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\nvar DataFormatMixin = /** @class */function () {\n function DataFormatMixin() {}\n /**\n * Get params for formatter\n */\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\n var data = this.getData(dataType);\n var rawValue = this.getRawValue(dataIndex, dataType);\n var rawDataIndex = data.getRawIndex(dataIndex);\n var name = data.getName(dataIndex);\n var itemOpt = data.getRawDataItem(dataIndex);\n var style = data.getItemVisual(dataIndex, 'style');\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\n var borderColor = style && style.stroke;\n var mainType = this.mainType;\n var isSeries = mainType === 'series';\n var userOutput = data.userOutput && data.userOutput.get();\n return {\n componentType: mainType,\n componentSubType: this.subType,\n componentIndex: this.componentIndex,\n seriesType: isSeries ? this.subType : null,\n seriesIndex: this.seriesIndex,\n seriesId: isSeries ? this.id : null,\n seriesName: isSeries ? this.name : null,\n name: name,\n dataIndex: rawDataIndex,\n data: itemOpt,\n dataType: dataType,\n value: rawValue,\n color: color,\n borderColor: borderColor,\n dimensionNames: userOutput ? userOutput.fullDimensions : null,\n encode: userOutput ? userOutput.encode : null,\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\n $vars: ['seriesName', 'name', 'value']\n };\n };\n /**\n * Format label\n * @param dataIndex\n * @param status 'normal' by default\n * @param dataType\n * @param labelDimIndex Only used in some chart that\n * use formatter in different dimensions, like radar.\n * @param formatter Formatter given outside.\n * @return return null/undefined if no formatter\n */\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\n status = status || 'normal';\n var data = this.getData(dataType);\n var params = this.getDataParams(dataIndex, dataType);\n if (extendParams) {\n params.value = extendParams.interpolatedValue;\n }\n if (labelDimIndex != null && zrUtil.isArray(params.value)) {\n params.value = params.value[labelDimIndex];\n }\n if (!formatter) {\n var itemModel = data.getItemModel(dataIndex);\n // @ts-ignore\n formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']);\n }\n if (zrUtil.isFunction(formatter)) {\n params.status = status;\n params.dimensionIndex = labelDimIndex;\n return formatter(params);\n } else if (zrUtil.isString(formatter)) {\n var str = formatTpl(formatter, params);\n // Support 'aaa{@[3]}bbb{@product}ccc'.\n // Do not support '}' in dim name util have to.\n return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) {\n var len = dimStr.length;\n var dimLoose = dimStr;\n if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') {\n dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(dimLoose)) {\n error(\"Invalide label formatter: @\" + dimStr + \", only support @[0], @[1], @[2], ...\");\n }\n }\n }\n var val = retrieveRawValue(data, dataIndex, dimLoose);\n if (extendParams && zrUtil.isArray(extendParams.interpolatedValue)) {\n var dimIndex = data.getDimensionIndex(dimLoose);\n if (dimIndex >= 0) {\n val = extendParams.interpolatedValue[dimIndex];\n }\n }\n return val != null ? val + '' : '';\n });\n }\n };\n /**\n * Get raw value in option\n */\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\n return retrieveRawValue(this.getData(dataType), idx);\n };\n /**\n * Should be implemented.\n * @param {number} dataIndex\n * @param {boolean} [multipleSeries=false]\n * @param {string} [dataType]\n */\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // Empty function\n return;\n };\n return DataFormatMixin;\n}();\nexport { DataFormatMixin };\n;\n// PENDING: previously we accept this type when calling `formatTooltip`,\n// but guess little chance has been used outside. Do we need to backward\n// compat it?\n// type TooltipFormatResultLegacyObject = {\n// // `html` means the markup language text, either in 'html' or 'richText'.\n// // The name `html` is not appropriate because in 'richText' it is not a HTML\n// // string. But still support it for backward compatibility.\n// html: string;\n// markers: Dictionary;\n// };\n/**\n * For backward compat, normalize the return from `formatTooltip`.\n */\nexport function normalizeTooltipFormatResult(result) {\n var markupText;\n // let markers: Dictionary;\n var markupFragment;\n if (zrUtil.isObject(result)) {\n if (result.type) {\n markupFragment = result;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\n }\n }\n // else {\n // markupText = (result as TooltipFormatResultLegacyObject).html;\n // markers = (result as TooltipFormatResultLegacyObject).markers;\n // if (markersExisting) {\n // markers = zrUtil.merge(markersExisting, markers);\n // }\n // }\n } else {\n markupText = result;\n }\n return {\n text: markupText,\n // markers: markers || markersExisting,\n frag: markupFragment\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray } from 'zrender/lib/core/util.js';\n;\n/**\n * @param {Object} define\n * @return See the return of `createTask`.\n */\nexport function createTask(define) {\n return new Task(define);\n}\nvar Task = /** @class */function () {\n function Task(define) {\n define = define || {};\n this._reset = define.reset;\n this._plan = define.plan;\n this._count = define.count;\n this._onDirty = define.onDirty;\n this._dirty = true;\n }\n /**\n * @param step Specified step.\n * @param skip Skip customer perform call.\n * @param modBy Sampling window size.\n * @param modDataCount Sampling count.\n * @return whether unfinished.\n */\n Task.prototype.perform = function (performArgs) {\n var upTask = this._upstream;\n var skip = performArgs && performArgs.skip;\n // TODO some refactor.\n // Pull data. Must pull data each time, because context.data\n // may be updated by Series.setData.\n if (this._dirty && upTask) {\n var context = this.context;\n context.data = context.outputData = upTask.context.outputData;\n }\n if (this.__pipeline) {\n this.__pipeline.currentTask = this;\n }\n var planResult;\n if (this._plan && !skip) {\n planResult = this._plan(this.context);\n }\n // Support sharding by mod, which changes the render sequence and makes the rendered graphic\n // elements uniformed distributed when progress, especially when moving or zooming.\n var lastModBy = normalizeModBy(this._modBy);\n var lastModDataCount = this._modDataCount || 0;\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\n var modDataCount = performArgs && performArgs.modDataCount || 0;\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\n planResult = 'reset';\n }\n function normalizeModBy(val) {\n !(val >= 1) && (val = 1); // jshint ignore:line\n return val;\n }\n var forceFirstProgress;\n if (this._dirty || planResult === 'reset') {\n this._dirty = false;\n forceFirstProgress = this._doReset(skip);\n }\n this._modBy = modBy;\n this._modDataCount = modDataCount;\n var step = performArgs && performArgs.step;\n if (upTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(upTask._outputDueEnd != null);\n }\n this._dueEnd = upTask._outputDueEnd;\n }\n // DataTask or overallTask\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._progress || this._count);\n }\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\n }\n // Note: Stubs, that its host overall task let it has progress, has progress.\n // If no progress, pass index from upstream to downstream each time plan called.\n if (this._progress) {\n var start = this._dueIndex;\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\n if (!skip && (forceFirstProgress || start < end)) {\n var progress = this._progress;\n if (isArray(progress)) {\n for (var i = 0; i < progress.length; i++) {\n this._doProgress(progress[i], start, end, modBy, modDataCount);\n }\n } else {\n this._doProgress(progress, start, end, modBy, modDataCount);\n }\n }\n this._dueIndex = end;\n // If no `outputDueEnd`, assume that output data and\n // input data is the same, so use `dueIndex` as `outputDueEnd`.\n var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end;\n if (process.env.NODE_ENV !== 'production') {\n // ??? Can not rollback.\n assert(outputDueEnd >= this._outputDueEnd);\n }\n this._outputDueEnd = outputDueEnd;\n } else {\n // (1) Some overall task has no progress.\n // (2) Stubs, that its host overall task do not let it has progress, has no progress.\n // This should always be performed so it can be passed to downstream.\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;\n }\n return this.unfinished();\n };\n Task.prototype.dirty = function () {\n this._dirty = true;\n this._onDirty && this._onDirty(this.context);\n };\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\n iterator.reset(start, end, modBy, modDataCount);\n this._callingProgress = progress;\n this._callingProgress({\n start: start,\n end: end,\n count: end - start,\n next: iterator.next\n }, this.context);\n };\n Task.prototype._doReset = function (skip) {\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\n this._settedOutputEnd = null;\n var progress;\n var forceFirstProgress;\n if (!skip && this._reset) {\n progress = this._reset(this.context);\n if (progress && progress.progress) {\n forceFirstProgress = progress.forceFirstProgress;\n progress = progress.progress;\n }\n // To simplify no progress checking, array must has item.\n if (isArray(progress) && !progress.length) {\n progress = null;\n }\n }\n this._progress = progress;\n this._modBy = this._modDataCount = null;\n var downstream = this._downstream;\n downstream && downstream.dirty();\n return forceFirstProgress;\n };\n Task.prototype.unfinished = function () {\n return this._progress && this._dueIndex < this._dueEnd;\n };\n /**\n * @param downTask The downstream task.\n * @return The downstream task.\n */\n Task.prototype.pipe = function (downTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(downTask && !downTask._disposed && downTask !== this);\n }\n // If already downstream, do not dirty downTask.\n if (this._downstream !== downTask || this._dirty) {\n this._downstream = downTask;\n downTask._upstream = this;\n downTask.dirty();\n }\n };\n Task.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n this._upstream && (this._upstream._downstream = null);\n this._downstream && (this._downstream._upstream = null);\n this._dirty = false;\n this._disposed = true;\n };\n Task.prototype.getUpstream = function () {\n return this._upstream;\n };\n Task.prototype.getDownstream = function () {\n return this._downstream;\n };\n Task.prototype.setOutputEnd = function (end) {\n // This only happens in dataTask, dataZoom, map, currently.\n // where dataZoom do not set end each time, but only set\n // when reset. So we should record the set end, in case\n // that the stub of dataZoom perform again and earse the\n // set end by upstream.\n this._outputDueEnd = this._settedOutputEnd = end;\n };\n return Task;\n}();\nexport { Task };\nvar iterator = function () {\n var end;\n var current;\n var modBy;\n var modDataCount;\n var winCount;\n var it = {\n reset: function (s, e, sStep, sCount) {\n current = s;\n end = e;\n modBy = sStep;\n modDataCount = sCount;\n winCount = Math.ceil(modDataCount / modBy);\n it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;\n }\n };\n return it;\n function sequentialNext() {\n return current < end ? current++ : null;\n }\n function modNext() {\n var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);\n var result = current >= end ? null : dataIndex < modDataCount ? dataIndex\n // If modDataCount is smaller than data.count() (consider `appendData` case),\n // Use normal linear rendering mode.\n : current;\n current++;\n return result;\n }\n}();\n// -----------------------------------------------------------------------------\n// For stream debug (Should be commented out after used!)\n// @usage: printTask(this, 'begin');\n// @usage: printTask(this, null, {someExtraProp});\n// @usage: Use `__idxInPipeline` as conditional breakpiont.\n//\n// window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {\n// window.ecTaskUID == null && (window.ecTaskUID = 0);\n// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\n// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\n// let props = [];\n// if (task.__pipeline) {\n// let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\n// props.push({text: '__idxInPipeline/total', value: val});\n// } else {\n// let stubCount = 0;\n// task.agentStubMap.each(() => stubCount++);\n// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\n// }\n// props.push({text: 'uid', value: task.uidDebug});\n// if (task.__pipeline) {\n// props.push({text: 'pipelineId', value: task.__pipeline.id});\n// task.agent && props.push(\n// {text: 'stubFor', value: task.agent.uidDebug}\n// );\n// }\n// props.push(\n// {text: 'dirty', value: task._dirty},\n// {text: 'dueIndex', value: task._dueIndex},\n// {text: 'dueEnd', value: task._dueEnd},\n// {text: 'outputDueEnd', value: task._outputDueEnd}\n// );\n// if (extra) {\n// Object.keys(extra).forEach(key => {\n// props.push({text: key, value: extra[key]});\n// });\n// }\n// let args = ['color: blue'];\n// let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\n// args.push('color: green', 'color: red'),\n// `${item.text}: %c${item.value}`\n// )).join('%c, ');\n// console.log.apply(console, [msg].concat(args));\n// // console.log(this);\n// };\n// window.printPipeline = function (task: any, prefix: string) {\n// const pipeline = task.__pipeline;\n// let currTask = pipeline.head;\n// while (currTask) {\n// window.printTask(currTask, prefix);\n// currTask = currTask._downstream;\n// }\n// };\n// window.showChain = function (chainHeadTask) {\n// var chain = [];\n// var task = chainHeadTask;\n// while (task) {\n// chain.push({\n// task: task,\n// up: task._upstream,\n// down: task._downstream,\n// idxInPipeline: task.__idxInPipeline\n// });\n// task = task._downstream;\n// }\n// return chain;\n// };\n// window.findTaskInChain = function (task, chainHeadTask) {\n// let chain = window.showChain(chainHeadTask);\n// let result = [];\n// for (let i = 0; i < chain.length; i++) {\n// let chainItem = chain[i];\n// if (chainItem.task === task) {\n// result.push(i);\n// }\n// }\n// return result;\n// };\n// window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {\n// let chainA = window.showChain(chainHeadTaskA);\n// for (let i = 0; i < chainA.length; i++) {\n// console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));\n// }\n// };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseDate, numericToNumber } from '../../util/number.js';\nimport { createHashMap, trim, hasOwn, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError } from '../../util/log.js';\n/**\n * Convert raw the value in to inner value in List.\n *\n * [Performance sensitive]\n *\n * [Caution]: this is the key logic of user value parser.\n * For backward compatibility, do not modify it until you have to!\n */\nexport function parseDataValue(value,\n// For high performance, do not omit the second param.\nopt) {\n // Performance sensitive.\n var dimType = opt && opt.type;\n if (dimType === 'ordinal') {\n // If given value is a category string\n return value;\n }\n if (dimType === 'time'\n // spead up when using timestamp\n && !isNumber(value) && value != null && value !== '-') {\n value = +parseDate(value);\n }\n // dimType defaults 'number'.\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\n // parse to NaN.\n // number-like string (like ' 123 ') can be converted to a number.\n // where null/undefined or other string will be converted to NaN.\n return value == null || value === '' ? NaN\n // If string (like '-'), using '+' parse to NaN\n // If object, also parse to NaN\n : Number(value);\n}\n;\nvar valueParserMap = createHashMap({\n 'number': function (val) {\n // Do not use `numericToNumber` here. We have `numericToNumber` by default.\n // Here the number parser can have loose rule:\n // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\n return parseFloat(val);\n },\n 'time': function (val) {\n // return timestamp.\n return +parseDate(val);\n },\n 'trim': function (val) {\n return isString(val) ? trim(val) : val;\n }\n});\nexport function getRawValueParser(type) {\n return valueParserMap.get(type);\n}\nvar ORDER_COMPARISON_OP_MAP = {\n lt: function (lval, rval) {\n return lval < rval;\n },\n lte: function (lval, rval) {\n return lval <= rval;\n },\n gt: function (lval, rval) {\n return lval > rval;\n },\n gte: function (lval, rval) {\n return lval >= rval;\n }\n};\nvar FilterOrderComparator = /** @class */function () {\n function FilterOrderComparator(op, rval) {\n if (!isNumber(rval)) {\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\n }\n throwError(errMsg);\n }\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\n this._rvalFloat = numericToNumber(rval);\n }\n // Performance sensitive.\n FilterOrderComparator.prototype.evaluate = function (lval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);\n };\n return FilterOrderComparator;\n}();\nvar SortOrderComparator = /** @class */function () {\n /**\n * @param order by default: 'asc'\n * @param incomparable by default: Always on the tail.\n * That is, if 'asc' => 'max', if 'desc' => 'min'\n * See the definition of \"incomparable\" in [SORT_COMPARISON_RULE].\n */\n function SortOrderComparator(order, incomparable) {\n var isDesc = order === 'desc';\n this._resultLT = isDesc ? 1 : -1;\n if (incomparable == null) {\n incomparable = isDesc ? 'min' : 'max';\n }\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\n }\n // See [SORT_COMPARISON_RULE].\n // Performance sensitive.\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval);\n var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval);\n var lvalNotNumeric = isNaN(lvalFloat);\n var rvalNotNumeric = isNaN(rvalFloat);\n if (lvalNotNumeric) {\n lvalFloat = this._incomparable;\n }\n if (rvalNotNumeric) {\n rvalFloat = this._incomparable;\n }\n if (lvalNotNumeric && rvalNotNumeric) {\n var lvalIsStr = isString(lval);\n var rvalIsStr = isString(rval);\n if (lvalIsStr) {\n lvalFloat = rvalIsStr ? lval : 0;\n }\n if (rvalIsStr) {\n rvalFloat = lvalIsStr ? rval : 0;\n }\n }\n return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;\n };\n return SortOrderComparator;\n}();\nexport { SortOrderComparator };\nvar FilterEqualityComparator = /** @class */function () {\n function FilterEqualityComparator(isEq, rval) {\n this._rval = rval;\n this._isEQ = isEq;\n this._rvalTypeof = typeof rval;\n this._rvalFloat = numericToNumber(rval);\n }\n // Performance sensitive.\n FilterEqualityComparator.prototype.evaluate = function (lval) {\n var eqResult = lval === this._rval;\n if (!eqResult) {\n var lvalTypeof = typeof lval;\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\n eqResult = numericToNumber(lval) === this._rvalFloat;\n }\n }\n return this._isEQ ? eqResult : !eqResult;\n };\n return FilterEqualityComparator;\n}();\n/**\n * [FILTER_COMPARISON_RULE]\n * `lt`|`lte`|`gt`|`gte`:\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\n * `eq`:\n * + If same type, compare with `===`.\n * + If there is one number, convert to number (`numericToNumber`) to compare.\n * + Else return `false`.\n * `ne`:\n * + Not `eq`.\n *\n *\n * [SORT_COMPARISON_RULE]\n * All the values are grouped into three categories:\n * + \"numeric\" (number and numeric string)\n * + \"non-numeric-string\" (string that excluding numeric string)\n * + \"others\"\n * \"numeric\" vs \"numeric\": values are ordered by number order.\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\n * \"others\" vs \"others\": do not change order (always return 0).\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\n * MEMO:\n * Non-numeric string sort makes sense when we need to put the items with the same tag together.\n * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\n * So we treat \"numeric-string\" sorted by number order rather than string comparison.\n *\n *\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\n * + Do not support string comparison until required. And also need to\n * avoid the misleading of \"2\" > \"12\".\n * + Should avoid the misleading case:\n * `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\n * See `util/number.ts#numericToNumber`.\n *\n * @return If `op` is not `RelationalOperator`, return null;\n */\nexport function createFilterComparator(op, rval) {\n return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createHashMap, bind, each, hasOwn, map, clone, isObject, extend, isNumber } from 'zrender/lib/core/util.js';\nimport { getRawSourceItemGetter, getRawSourceDataCounter, getRawSourceValueGetter } from './dataProvider.js';\nimport { parseDataValue } from './dataValueHelper.js';\nimport { log, makePrintable, throwError } from '../../util/log.js';\nimport { createSource, detectSourceFormat } from '../Source.js';\n/**\n * TODO: disable writable.\n * This structure will be exposed to users.\n */\nvar ExternalSource = /** @class */function () {\n function ExternalSource() {}\n ExternalSource.prototype.getRawData = function () {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n ExternalSource.prototype.cloneRawData = function () {\n return;\n };\n /**\n * @return If dimension not found, return null/undefined.\n */\n ExternalSource.prototype.getDimensionInfo = function (dim) {\n return;\n };\n /**\n * dimensions defined if and only if either:\n * (a) dataset.dimensions are declared.\n * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).\n * If dimensions are defined, `dimensionInfoAll` is corresponding to\n * the defined dimensions.\n * Otherwise, `dimensionInfoAll` is determined by data columns.\n * @return Always return an array (even empty array).\n */\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\n return;\n };\n ExternalSource.prototype.count = function () {\n return;\n };\n /**\n * Only support by dimension index.\n * No need to support by dimension name in transform function,\n * because transform function is not case-specific, no need to use name literally.\n */\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\n return;\n };\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\n return;\n };\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\n return parseDataValue(rawVal, dimInfo);\n };\n return ExternalSource;\n}();\nexport { ExternalSource };\nfunction createExternalSource(internalSource, externalTransform) {\n var extSource = new ExternalSource();\n var data = internalSource.data;\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\n var sourceHeaderCount = internalSource.startIndex;\n var errMsg = '';\n if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {\n // For the logic simplicity in transformer, only 'culumn' is\n // supported in data transform. Otherwise, the `dimensionsDefine`\n // might be detected by 'row', which probably confuses users.\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`seriesLayoutBy` of upstream dataset can only be \"column\" in data transform.';\n }\n throwError(errMsg);\n }\n // [MEMO]\n // Create a new dimensions structure for exposing.\n // Do not expose all dimension info to users directly.\n // Because the dimension is probably auto detected from data and not might reliable.\n // Should not lead the transformers to think that is reliable and return it.\n // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n var dimensions = [];\n var dimsByName = {};\n var dimsDef = internalSource.dimensionsDefine;\n if (dimsDef) {\n each(dimsDef, function (dimDef, idx) {\n var name = dimDef.name;\n var dimDefExt = {\n index: idx,\n name: name,\n displayName: dimDef.displayName\n };\n dimensions.push(dimDefExt);\n // Users probably do not specify dimension name. For simplicity, data transform\n // does not generate dimension name.\n if (name != null) {\n // Dimension name should not be duplicated.\n // For simplicity, data transform forbids name duplication, do not generate\n // new name like module `completeDimensions.ts` did, but just tell users.\n var errMsg_1 = '';\n if (hasOwn(dimsByName, name)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'dimension name \"' + name + '\" duplicated.';\n }\n throwError(errMsg_1);\n }\n dimsByName[name] = dimDefExt;\n }\n });\n }\n // If dimension definitions are not defined and can not be detected.\n // e.g., pure data `[[11, 22], ...]`.\n else {\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\n // Do not generete name or anything others. The consequence process in\n // `transform` or `series` probably have there own name generation strategry.\n dimensions.push({\n index: i\n });\n }\n }\n // Implement public methods:\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n if (externalTransform.__isBuiltIn) {\n extSource.getRawDataItem = function (dataIndex) {\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n };\n extSource.getRawData = bind(getRawData, null, internalSource);\n }\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\n extSource.retrieveValue = function (dataIndex, dimIndex) {\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n return retrieveValueFromItem(rawItem, dimIndex);\n };\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\n if (dataItem == null) {\n return;\n }\n var dimDef = dimensions[dimIndex];\n // When `dimIndex` is `null`, `rawValueGetter` return the whole item.\n if (dimDef) {\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\n }\n };\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\n return extSource;\n}\nfunction getRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\n }\n throwError(errMsg);\n }\n return upstream.data;\n}\nfunction cloneRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n var data = upstream.data;\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;\n }\n throwError(errMsg);\n }\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var result = [];\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(data[i].slice());\n }\n return result;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var result = [];\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(extend({}, data[i]));\n }\n return result;\n }\n}\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\n if (dim == null) {\n return;\n }\n // Keep the same logic as `List::getDimension` did.\n if (isNumber(dim)\n // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !hasOwn(dimsByName, dim)) {\n return dimensions[dim];\n } else if (hasOwn(dimsByName, dim)) {\n return dimsByName[dim];\n }\n}\nfunction cloneAllDimensionInfo(dimensions) {\n return clone(dimensions);\n}\nvar externalTransformMap = createHashMap();\nexport function registerExternalTransform(externalTransform) {\n externalTransform = clone(externalTransform);\n var type = externalTransform.type;\n var errMsg = '';\n if (!type) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have a `type` when `registerTransform`.';\n }\n throwError(errMsg);\n }\n var typeParsed = type.split(':');\n if (typeParsed.length !== 2) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Name must include namespace like \"ns:regression\".';\n }\n throwError(errMsg);\n }\n // Namespace 'echarts:xxx' is official namespace, where the transforms should\n // be called directly via 'xxx' rather than 'echarts:xxx'.\n var isBuiltIn = false;\n if (typeParsed[0] === 'echarts') {\n type = typeParsed[1];\n isBuiltIn = true;\n }\n externalTransform.__isBuiltIn = isBuiltIn;\n externalTransformMap.set(type, externalTransform);\n}\nexport function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\n var pipedTransOption = normalizeToArray(rawTransOption);\n var pipeLen = pipedTransOption.length;\n var errMsg = '';\n if (!pipeLen) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'If `transform` declared, it should at least contain one transform.';\n }\n throwError(errMsg);\n }\n for (var i = 0, len = pipeLen; i < len; i++) {\n var transOption = pipedTransOption[i];\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\n // piped transform only support single input, except the fist one.\n // piped transform only support single output, except the last one.\n if (i !== len - 1) {\n sourceList.length = Math.max(sourceList.length, 1);\n }\n }\n return sourceList;\n}\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint,\n// If `pipeIndex` is null/undefined, no piped transform.\npipeIndex) {\n var errMsg = '';\n if (!upSourceList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have at least one upstream dataset.';\n }\n throwError(errMsg);\n }\n if (!isObject(transOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\n }\n throwError(errMsg);\n }\n var transType = transOption.type;\n var externalTransform = externalTransformMap.get(transType);\n if (!externalTransform) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not find transform on type \"' + transType + '\".';\n }\n throwError(errMsg);\n }\n // Prepare source\n var extUpSourceList = map(upSourceList, function (upSource) {\n return createExternalSource(upSource, externalTransform);\n });\n var resultList = normalizeToArray(externalTransform.transform({\n upstream: extUpSourceList[0],\n upstreamList: extUpSourceList,\n config: clone(transOption.config)\n }));\n if (process.env.NODE_ENV !== 'production') {\n if (transOption.print) {\n var printStrArr = map(resultList, function (extSource) {\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\n return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\\n');\n }).join('\\n');\n log(printStrArr);\n }\n }\n return map(resultList, function (result, resultIndex) {\n var errMsg = '';\n if (!isObject(result)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'A transform should not return some empty results.';\n }\n throwError(errMsg);\n }\n if (!result.data) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be not be null or undefined';\n }\n throwError(errMsg);\n }\n var sourceFormat = detectSourceFormat(result.data);\n if (!isSupportedSourceFormat(sourceFormat)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be array rows or object rows.';\n }\n throwError(errMsg);\n }\n var resultMetaRawOption;\n var firstUpSource = upSourceList[0];\n /**\n * Intuitively, the end users known the content of the original `dataset.source`,\n * calucating the transform result in mind.\n * Suppose the original `dataset.source` is:\n * ```js\n * [\n * ['product', '2012', '2013', '2014', '2015'],\n * ['AAA', 41.1, 30.4, 65.1, 53.3],\n * ['BBB', 86.5, 92.1, 85.7, 83.1],\n * ['CCC', 24.1, 67.2, 79.5, 86.4]\n * ]\n * ```\n * The dimension info have to be detected from the source data.\n * Some of the transformers (like filter, sort) will follow the dimension info\n * of upstream, while others use new dimensions (like aggregate).\n * Transformer can output a field `dimensions` to define the its own output dimensions.\n * We also allow transformers to ignore the output `dimensions` field, and\n * inherit the upstream dimensions definition. It can reduce the burden of handling\n * dimensions in transformers.\n *\n * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n */\n if (firstUpSource && resultIndex === 0\n // If transformer returns `dimensions`, it means that the transformer has different\n // dimensions definitions. We do not inherit anything from upstream.\n && !result.dimensions) {\n var startIndex = firstUpSource.startIndex;\n // We copy the header of upstream to the result, because:\n // (1) The returned data always does not contain header line and can not be used\n // as dimension-detection. In this case we can not use \"detected dimensions\" of\n // upstream directly, because it might be detected based on different `seriesLayoutBy`.\n // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.\n // So the original detected header should be add to the result, otherwise they can not be read.\n if (startIndex) {\n result.data = firstUpSource.data.slice(0, startIndex).concat(result.data);\n }\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: startIndex,\n dimensions: firstUpSource.metaRawOption.dimensions\n };\n } else {\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: 0,\n dimensions: result.dimensions\n };\n }\n return createSource(result.data, resultMetaRawOption, null);\n });\n}\nfunction isSupportedSourceFormat(sourceFormat) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, clone, createHashMap, isFunction, keys, map, reduce } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from './helper/dataValueHelper.js';\nimport { shouldRetrieveDataByName } from './Source.js';\nvar UNDEFINED = 'undefined';\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\nexport var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nexport var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\nexport var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nexport var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array;\n/**\n * Multi dimensional data store\n */\nvar dataCtors = {\n 'float': CtorFloat64Array,\n 'int': CtorInt32Array,\n // Ordinal data type can be string or int\n 'ordinal': Array,\n 'number': Array,\n 'time': CtorFloat64Array\n};\nvar defaultDimValueGetters;\nfunction getIndicesCtor(rawCount) {\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\n return rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n}\n;\nfunction getInitialExtent() {\n return [Infinity, -Infinity];\n}\n;\nfunction cloneChunk(originalChunk) {\n var Ctor = originalChunk.constructor;\n // Only shallow clone is enough when Array.\n return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n}\nfunction prepareStore(store, dimIdx, dimType, end, append) {\n var DataCtor = dataCtors[dimType || 'float'];\n if (append) {\n var oldStore = store[dimIdx];\n var oldLen = oldStore && oldStore.length;\n if (!(oldLen === end)) {\n var newStore = new DataCtor(end);\n // The cost of the copy is probably inconsiderable\n // within the initial chunkSize.\n for (var j = 0; j < oldLen; j++) {\n newStore[j] = oldStore[j];\n }\n store[dimIdx] = newStore;\n }\n } else {\n store[dimIdx] = new DataCtor(end);\n }\n}\n;\n/**\n * Basically, DataStore API keep immutable.\n */\nvar DataStore = /** @class */function () {\n function DataStore() {\n this._chunks = [];\n // It will not be calculated until needed.\n this._rawExtent = [];\n this._extent = [];\n this._count = 0;\n this._rawCount = 0;\n this._calcDimNameToIdx = createHashMap();\n }\n /**\n * Initialize from data\n */\n DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isFunction(provider.getItem) && isFunction(provider.count), 'Invalid data provider.');\n }\n this._provider = provider;\n // Clear\n this._chunks = [];\n this._indices = null;\n this.getRawIndex = this._getRawIdxIdentity;\n var source = provider.getSource();\n var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat];\n // Default dim value getter\n this._dimValueGetter = dimValueGetter || defaultGetter;\n // Reset raw extent.\n this._rawExtent = [];\n var willRetrieveDataByName = shouldRetrieveDataByName(source);\n this._dimensions = map(inputDimensions, function (dim) {\n if (process.env.NODE_ENV !== 'production') {\n if (willRetrieveDataByName) {\n assert(dim.property != null);\n }\n }\n return {\n // Only pick these two props. Not leak other properties like orderMeta.\n type: dim.type,\n property: dim.property\n };\n });\n this._initDataFromProvider(0, provider.count());\n };\n DataStore.prototype.getProvider = function () {\n return this._provider;\n };\n /**\n * Caution: even when a `source` instance owned by a series, the created data store\n * may still be shared by different sereis (the source hash does not use all `source`\n * props, see `sourceManager`). In this case, the `source` props that are not used in\n * hash (like `source.dimensionDefine`) probably only belongs to a certain series and\n * thus should not be fetch here.\n */\n DataStore.prototype.getSource = function () {\n return this._provider.getSource();\n };\n /**\n * @caution Only used in dataStack.\n */\n DataStore.prototype.ensureCalculationDimension = function (dimName, type) {\n var calcDimNameToIdx = this._calcDimNameToIdx;\n var dimensions = this._dimensions;\n var calcDimIdx = calcDimNameToIdx.get(dimName);\n if (calcDimIdx != null) {\n if (dimensions[calcDimIdx].type === type) {\n return calcDimIdx;\n }\n } else {\n calcDimIdx = dimensions.length;\n }\n dimensions[calcDimIdx] = {\n type: type\n };\n calcDimNameToIdx.set(dimName, calcDimIdx);\n this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount);\n this._rawExtent[calcDimIdx] = getInitialExtent();\n return calcDimIdx;\n };\n DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) {\n var chunk = this._chunks[dimIdx];\n var dim = this._dimensions[dimIdx];\n var rawExtents = this._rawExtent;\n var offset = dim.ordinalOffset || 0;\n var len = chunk.length;\n if (offset === 0) {\n // We need to reset the rawExtent if collect is from start.\n // Because this dimension may be guessed as number and calcuating a wrong extent.\n rawExtents[dimIdx] = getInitialExtent();\n }\n var dimRawExtent = rawExtents[dimIdx];\n // Parse from previous data offset. len may be changed after appendData\n for (var i = offset; i < len; i++) {\n var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]);\n if (!isNaN(val)) {\n dimRawExtent[0] = Math.min(val, dimRawExtent[0]);\n dimRawExtent[1] = Math.max(val, dimRawExtent[1]);\n }\n }\n dim.ordinalMeta = ordinalMeta;\n dim.ordinalOffset = len;\n dim.type = 'ordinal'; // Force to be ordinal\n };\n\n DataStore.prototype.getOrdinalMeta = function (dimIdx) {\n var dimInfo = this._dimensions[dimIdx];\n var ordinalMeta = dimInfo.ordinalMeta;\n return ordinalMeta;\n };\n DataStore.prototype.getDimensionProperty = function (dimIndex) {\n var item = this._dimensions[dimIndex];\n return item && item.property;\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */\n DataStore.prototype.appendData = function (data) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._indices, 'appendData can only be called on raw data.');\n }\n var provider = this._provider;\n var start = this.count();\n provider.appendData(data);\n var end = provider.count();\n if (!provider.persistent) {\n end += start;\n }\n if (start < end) {\n this._initDataFromProvider(start, end, true);\n }\n return [start, end];\n };\n DataStore.prototype.appendValues = function (values, minFillLen) {\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var start = this.count();\n var end = start + Math.max(values.length, minFillLen || 0);\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n prepareStore(chunks, i, dim.type, end, true);\n }\n var emptyDataItem = [];\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start;\n // Store the data by dimensions\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx);\n chunks[dimIdx][idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n this._rawCount = this._count = end;\n return {\n start: start,\n end: end\n };\n };\n DataStore.prototype._initDataFromProvider = function (start, end, append) {\n var provider = this._provider;\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var dimNames = map(dimensions, function (dim) {\n return dim.property;\n });\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n if (!rawExtent[i]) {\n rawExtent[i] = getInitialExtent();\n }\n prepareStore(chunks, i, dim.type, end, append);\n }\n if (provider.fillStorage) {\n provider.fillStorage(start, end, chunks, rawExtent);\n } else {\n var dataItem = [];\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n dataItem = provider.getItem(idx, dataItem);\n // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // Store the data by dimensions\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dimStorage = chunks[dimIdx];\n // PENDING NULL is empty or zero\n var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx);\n dimStorage[idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n }\n if (!provider.persistent && provider.clean) {\n // Clean unused data if data source is typed array.\n provider.clean();\n }\n this._rawCount = this._count = end;\n // Reset data extent\n this._extent = [];\n };\n DataStore.prototype.count = function () {\n return this._count;\n };\n /**\n * Get value. Return NaN if idx is out of range.\n */\n DataStore.prototype.get = function (dim, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n DataStore.prototype.getValues = function (dimensions, idx) {\n var values = [];\n var dimArr = [];\n if (idx == null) {\n idx = dimensions;\n // TODO get all from store?\n dimensions = [];\n // All dimensions\n for (var i = 0; i < this._dimensions.length; i++) {\n dimArr.push(i);\n }\n } else {\n dimArr = dimensions;\n }\n for (var i = 0, len = dimArr.length; i < len; i++) {\n values.push(this.get(dimArr[i], idx));\n }\n return values;\n };\n /**\n * @param dim concrete dim\n */\n DataStore.prototype.getByRawIndex = function (dim, rawIdx) {\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n return NaN;\n }\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[rawIdx] : NaN;\n };\n /**\n * Get sum of data in one dimension\n */\n DataStore.prototype.getSum = function (dim) {\n var dimData = this._chunks[dim];\n var sum = 0;\n if (dimData) {\n for (var i = 0, len = this.count(); i < len; i++) {\n var value = this.get(dim, i);\n if (!isNaN(value)) {\n sum += value;\n }\n }\n }\n return sum;\n };\n /**\n * Get median of data in one dimension\n */\n DataStore.prototype.getMedian = function (dim) {\n var dimDataArray = [];\n // map all data of one dimension\n this.each([dim], function (val) {\n if (!isNaN(val)) {\n dimDataArray.push(val);\n }\n });\n // TODO\n // Use quick select?\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\n return a - b;\n });\n var len = this.count();\n // calculate median\n return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n };\n /**\n * Retrieve the index with given raw data index.\n */\n DataStore.prototype.indexOfRawIndex = function (rawIndex) {\n if (rawIndex >= this._rawCount || rawIndex < 0) {\n return -1;\n }\n if (!this._indices) {\n return rawIndex;\n }\n // Indices are ascending\n var indices = this._indices;\n // If rawIndex === dataIndex\n var rawDataIndex = indices[rawIndex];\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n return rawIndex;\n }\n var left = 0;\n var right = this._count - 1;\n while (left <= right) {\n var mid = (left + right) / 2 | 0;\n if (indices[mid] < rawIndex) {\n left = mid + 1;\n } else if (indices[mid] > rawIndex) {\n right = mid - 1;\n } else {\n return mid;\n }\n }\n return -1;\n };\n /**\n * Retrieve the index of nearest value.\n * @param dim\n * @param value\n * @param [maxDistance=Infinity]\n * @return If and only if multiple indices have\n * the same value, they are put to the result.\n */\n DataStore.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n var chunks = this._chunks;\n var dimData = chunks[dim];\n var nearestIndices = [];\n if (!dimData) {\n return nearestIndices;\n }\n if (maxDistance == null) {\n maxDistance = Infinity;\n }\n var minDist = Infinity;\n var minDiff = -1;\n var nearestIndicesLen = 0;\n // Check the test case of `test/ut/spec/data/SeriesData.js`.\n for (var i = 0, len = this.count(); i < len; i++) {\n var dataIndex = this.getRawIndex(i);\n var diff = value - dimData[dataIndex];\n var dist = Math.abs(diff);\n if (dist <= maxDistance) {\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n // So we choose the one that `diff >= 0` in this case.\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n // should be push to `nearestIndices`.\n if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n nearestIndicesLen = 0;\n }\n if (diff === minDiff) {\n nearestIndices[nearestIndicesLen++] = i;\n }\n }\n }\n nearestIndices.length = nearestIndicesLen;\n return nearestIndices;\n };\n DataStore.prototype.getIndices = function () {\n var newIndices;\n var indices = this._indices;\n if (indices) {\n var Ctor = indices.constructor;\n var thisCount = this._count;\n // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n if (Ctor === Array) {\n newIndices = new Ctor(thisCount);\n for (var i = 0; i < thisCount; i++) {\n newIndices[i] = indices[i];\n }\n } else {\n newIndices = new Ctor(indices.buffer, 0, thisCount);\n }\n } else {\n var Ctor = getIndicesCtor(this._rawCount);\n newIndices = new Ctor(this.count());\n for (var i = 0; i < newIndices.length; i++) {\n newIndices[i] = i;\n }\n }\n return newIndices;\n };\n /**\n * Data filter.\n */\n DataStore.prototype.filter = function (dims, cb) {\n if (!this._count) {\n return this;\n }\n var newStore = this.clone();\n var count = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(count);\n var value = [];\n var dimSize = dims.length;\n var offset = 0;\n var dim0 = dims[0];\n var chunks = newStore._chunks;\n for (var i = 0; i < count; i++) {\n var keep = void 0;\n var rawIdx = newStore.getRawIndex(i);\n // Simple optimization\n if (dimSize === 0) {\n keep = cb(i);\n } else if (dimSize === 1) {\n var val = chunks[dim0][rawIdx];\n keep = cb(val, i);\n } else {\n var k = 0;\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n }\n value[k] = i;\n keep = cb.apply(null, value);\n }\n if (keep) {\n newIndices[offset++] = rawIdx;\n }\n }\n // Set indices after filtered.\n if (offset < count) {\n newStore._indices = newIndices;\n }\n newStore._count = offset;\n // Reset data extent\n newStore._extent = [];\n newStore._updateGetRawIdx();\n return newStore;\n };\n /**\n * Select data in range. (For optimization of filter)\n * (Manually inline code, support 5 million data filtering in data zoom.)\n */\n DataStore.prototype.selectRange = function (range) {\n var newStore = this.clone();\n var len = newStore._count;\n if (!len) {\n return this;\n }\n var dims = keys(range);\n var dimSize = dims.length;\n if (!dimSize) {\n return this;\n }\n var originalCount = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(originalCount);\n var offset = 0;\n var dim0 = dims[0];\n var min = range[dim0][0];\n var max = range[dim0][1];\n var storeArr = newStore._chunks;\n var quickFinished = false;\n if (!newStore._indices) {\n // Extreme optimization for common case. About 2x faster in chrome.\n var idx = 0;\n if (dimSize === 1) {\n var dimStorage = storeArr[dims[0]];\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i];\n // NaN will not be filtered. Consider the case, in line chart, empty\n // value indicates the line should be broken. But for the case like\n // scatter plot, a data item with empty value will not be rendered,\n // but the axis extent may be effected if some other dim of the data\n // item has value. Fortunately it is not a significant negative effect.\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = idx;\n }\n idx++;\n }\n quickFinished = true;\n } else if (dimSize === 2) {\n var dimStorage = storeArr[dims[0]];\n var dimStorage2 = storeArr[dims[1]];\n var min2 = range[dims[1]][0];\n var max2 = range[dims[1]][1];\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i];\n var val2 = dimStorage2[i];\n // Do not filter NaN, see comment above.\n if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n newIndices[offset++] = idx;\n }\n idx++;\n }\n quickFinished = true;\n }\n }\n if (!quickFinished) {\n if (dimSize === 1) {\n for (var i = 0; i < originalCount; i++) {\n var rawIndex = newStore.getRawIndex(i);\n var val = storeArr[dims[0]][rawIndex];\n // Do not filter NaN, see comment above.\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = rawIndex;\n }\n }\n } else {\n for (var i = 0; i < originalCount; i++) {\n var keep = true;\n var rawIndex = newStore.getRawIndex(i);\n for (var k = 0; k < dimSize; k++) {\n var dimk = dims[k];\n var val = storeArr[dimk][rawIndex];\n // Do not filter NaN, see comment above.\n if (val < range[dimk][0] || val > range[dimk][1]) {\n keep = false;\n }\n }\n if (keep) {\n newIndices[offset++] = newStore.getRawIndex(i);\n }\n }\n }\n }\n // Set indices after filtered.\n if (offset < originalCount) {\n newStore._indices = newIndices;\n }\n newStore._count = offset;\n // Reset data extent\n newStore._extent = [];\n newStore._updateGetRawIdx();\n return newStore;\n };\n // /**\n // * Data mapping to a plain array\n // */\n // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {\n // const result: any[] = [];\n // this.each(dims, function () {\n // result.push(cb && (cb as MapArrayCb).apply(null, arguments));\n // });\n // return result;\n // }\n /**\n * Data mapping to a new List with given dimensions\n */\n DataStore.prototype.map = function (dims, cb) {\n // TODO only clone picked chunks.\n var target = this.clone(dims);\n this._updateDims(target, dims, cb);\n return target;\n };\n /**\n * @caution Danger!! Only used in dataStack.\n */\n DataStore.prototype.modify = function (dims, cb) {\n this._updateDims(this, dims, cb);\n };\n DataStore.prototype._updateDims = function (target, dims, cb) {\n var targetChunks = target._chunks;\n var tmpRetValue = [];\n var dimSize = dims.length;\n var dataCount = target.count();\n var values = [];\n var rawExtent = target._rawExtent;\n for (var i = 0; i < dims.length; i++) {\n rawExtent[dims[i]] = getInitialExtent();\n }\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n var rawIndex = target.getRawIndex(dataIndex);\n for (var k = 0; k < dimSize; k++) {\n values[k] = targetChunks[dims[k]][rawIndex];\n }\n values[dimSize] = dataIndex;\n var retValue = cb && cb.apply(null, values);\n if (retValue != null) {\n // a number or string (in oridinal dimension)?\n if (typeof retValue !== 'object') {\n tmpRetValue[0] = retValue;\n retValue = tmpRetValue;\n }\n for (var i = 0; i < retValue.length; i++) {\n var dim = dims[i];\n var val = retValue[i];\n var rawExtentOnDim = rawExtent[dim];\n var dimStore = targetChunks[dim];\n if (dimStore) {\n dimStore[rawIndex] = val;\n }\n if (val < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = val;\n }\n if (val > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = val;\n }\n }\n }\n }\n };\n /**\n * Large data down sampling using largest-triangle-three-buckets\n * @param {string} valueDimension\n * @param {number} targetCount\n */\n DataStore.prototype.lttbDownSample = function (valueDimension, rate) {\n var target = this.clone([valueDimension], true);\n var targetStorage = target._chunks;\n var dimStore = targetStorage[valueDimension];\n var len = this.count();\n var sampledIndex = 0;\n var frameSize = Math.floor(1 / rate);\n var currentRawIndex = this.getRawIndex(0);\n var maxArea;\n var area;\n var nextRawIndex;\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len));\n // First frame use the first data.\n newIndices[sampledIndex++] = currentRawIndex;\n for (var i = 1; i < len - 1; i += frameSize) {\n var nextFrameStart = Math.min(i + frameSize, len - 1);\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\n var avgY = 0;\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n if (isNaN(y)) {\n continue;\n }\n avgY += y;\n }\n avgY /= nextFrameEnd - nextFrameStart;\n var frameStart = i;\n var frameEnd = Math.min(i + frameSize, len);\n var pointAX = i - 1;\n var pointAY = dimStore[currentRawIndex];\n maxArea = -1;\n nextRawIndex = frameStart;\n var firstNaNIndex = -1;\n var countNaN = 0;\n // Find a point from current frame that construct a triangle with largest area with previous selected point\n // And the average of next frame.\n for (var idx = frameStart; idx < frameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n if (isNaN(y)) {\n countNaN++;\n if (firstNaNIndex < 0) {\n firstNaNIndex = rawIndex;\n }\n continue;\n }\n // Calculate triangle area over three buckets\n area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));\n if (area > maxArea) {\n maxArea = area;\n nextRawIndex = rawIndex; // Next a is this b\n }\n }\n\n if (countNaN > 0 && countNaN < frameEnd - frameStart) {\n // Append first NaN point in every bucket.\n // It is necessary to ensure the correct order of indices.\n newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex);\n nextRawIndex = Math.max(firstNaNIndex, nextRawIndex);\n }\n newIndices[sampledIndex++] = nextRawIndex;\n currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\n }\n // First frame use the last data.\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\n target._count = sampledIndex;\n target._indices = newIndices;\n target.getRawIndex = this._getRawIdx;\n return target;\n };\n /**\n * Large data down sampling on given dimension\n * @param sampleIndex Sample index for name and id\n */\n DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var target = this.clone([dimension], true);\n var targetStorage = target._chunks;\n var frameValues = [];\n var frameSize = Math.floor(1 / rate);\n var dimStore = targetStorage[dimension];\n var len = this.count();\n var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent();\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize));\n var offset = 0;\n for (var i = 0; i < len; i += frameSize) {\n // Last frame\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n for (var k = 0; k < frameSize; k++) {\n var dataIdx = this.getRawIndex(i + k);\n frameValues[k] = dimStore[dataIdx];\n }\n var value = sampleValue(frameValues);\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1));\n // Only write value on the filtered data\n dimStore[sampleFrameIdx] = value;\n if (value < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = value;\n }\n if (value > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = value;\n }\n newIndices[offset++] = sampleFrameIdx;\n }\n target._count = offset;\n target._indices = newIndices;\n target._updateGetRawIdx();\n return target;\n };\n /**\n * Data iteration\n * @param ctx default this\n * @example\n * list.each('x', function (x, idx) {});\n * list.each(['x', 'y'], function (x, y, idx) {});\n * list.each(function (idx) {})\n */\n DataStore.prototype.each = function (dims, cb) {\n if (!this._count) {\n return;\n }\n var dimSize = dims.length;\n var chunks = this._chunks;\n for (var i = 0, len = this.count(); i < len; i++) {\n var rawIdx = this.getRawIndex(i);\n // Simple optimization\n switch (dimSize) {\n case 0:\n cb(i);\n break;\n case 1:\n cb(chunks[dims[0]][rawIdx], i);\n break;\n case 2:\n cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i);\n break;\n default:\n var k = 0;\n var value = [];\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n }\n // Index\n value[k] = i;\n cb.apply(null, value);\n }\n }\n };\n /**\n * Get extent of data in one dimension\n */\n DataStore.prototype.getDataExtent = function (dim) {\n // Make sure use concrete dim as cache name.\n var dimData = this._chunks[dim];\n var initialExtent = getInitialExtent();\n if (!dimData) {\n return initialExtent;\n }\n // Make more strict checkings to ensure hitting cache.\n var currEnd = this.count();\n // Consider the most cases when using data zoom, `getDataExtent`\n // happened before filtering. We cache raw extent, which is not\n // necessary to be cleared and recalculated when restore data.\n var useRaw = !this._indices;\n var dimExtent;\n if (useRaw) {\n return this._rawExtent[dim].slice();\n }\n dimExtent = this._extent[dim];\n if (dimExtent) {\n return dimExtent.slice();\n }\n dimExtent = initialExtent;\n var min = dimExtent[0];\n var max = dimExtent[1];\n for (var i = 0; i < currEnd; i++) {\n var rawIdx = this.getRawIndex(i);\n var value = dimData[rawIdx];\n value < min && (min = value);\n value > max && (max = value);\n }\n dimExtent = [min, max];\n this._extent[dim] = dimExtent;\n return dimExtent;\n };\n /**\n * Get raw data item\n */\n DataStore.prototype.getRawDataItem = function (idx) {\n var rawIdx = this.getRawIndex(idx);\n if (!this._provider.persistent) {\n var val = [];\n var chunks = this._chunks;\n for (var i = 0; i < chunks.length; i++) {\n val.push(chunks[i][rawIdx]);\n }\n return val;\n } else {\n return this._provider.getItem(rawIdx);\n }\n };\n /**\n * Clone shallow.\n *\n * @param clonedDims Determine which dims to clone. Will share the data if not specified.\n */\n DataStore.prototype.clone = function (clonedDims, ignoreIndices) {\n var target = new DataStore();\n var chunks = this._chunks;\n var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) {\n obj[dimIdx] = true;\n return obj;\n }, {});\n if (clonedDimsMap) {\n for (var i = 0; i < chunks.length; i++) {\n // Not clone if dim is not picked.\n target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]);\n }\n } else {\n target._chunks = chunks;\n }\n this._copyCommonProps(target);\n if (!ignoreIndices) {\n target._indices = this._cloneIndices();\n }\n target._updateGetRawIdx();\n return target;\n };\n DataStore.prototype._copyCommonProps = function (target) {\n target._count = this._count;\n target._rawCount = this._rawCount;\n target._provider = this._provider;\n target._dimensions = this._dimensions;\n target._extent = clone(this._extent);\n target._rawExtent = clone(this._rawExtent);\n };\n DataStore.prototype._cloneIndices = function () {\n if (this._indices) {\n var Ctor = this._indices.constructor;\n var indices = void 0;\n if (Ctor === Array) {\n var thisCount = this._indices.length;\n indices = new Ctor(thisCount);\n for (var i = 0; i < thisCount; i++) {\n indices[i] = this._indices[i];\n }\n } else {\n indices = new Ctor(this._indices);\n }\n return indices;\n }\n return null;\n };\n DataStore.prototype._getRawIdxIdentity = function (idx) {\n return idx;\n };\n DataStore.prototype._getRawIdx = function (idx) {\n if (idx < this._count && idx >= 0) {\n return this._indices[idx];\n }\n return -1;\n };\n DataStore.prototype._updateGetRawIdx = function () {\n this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;\n };\n DataStore.internalField = function () {\n function getDimValueSimply(dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]);\n }\n defaultDimValueGetters = {\n arrayRows: getDimValueSimply,\n objectRows: function (dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[property], this._dimensions[dimIndex]);\n },\n keyedColumns: getDimValueSimply,\n original: function (dataItem, property, dataIndex, dimIndex) {\n // Performance sensitive, do not use modelUtil.getDataItemValue.\n // If dataItem is an plain object with no value field, the let `value`\n // will be assigned with the object, but it will be tread correctly\n // in the `convertValue`.\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\n return parseDataValue(value instanceof Array ? value[dimIndex]\n // If value is a single number or something else not array.\n : value, this._dimensions[dimIndex]);\n },\n typedArray: function (dataItem, property, dataIndex, dimIndex) {\n return dataItem[dimIndex];\n }\n };\n }();\n return DataStore;\n}();\nexport default DataStore;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createSource, cloneSourceShallow } from '../Source.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper.js';\nimport { applyDataTransform } from './transform.js';\nimport DataStore from '../DataStore.js';\nimport { DefaultDataProvider } from './dataProvider.js';\n/**\n * [REQUIREMENT_MEMO]:\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\n * `root-dataset`. Them on `series` has higher priority.\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\n * confuse users: whether those props indicate how to visit the upstream source or visit\n * the transform result source, and some transforms has nothing to do with these props,\n * and some transforms might have multiple upstream.\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\n * declared in `root-dataset`.\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\n * That is for reducing complexity in transforms.\n * PENDING: Whether to provide transposition transform?\n *\n * [IMPLEMENTAION_MEMO]:\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\n * They will not be calculated until `source` is about to be visited (to prevent from\n * duplicate calcuation). `source` is visited only in series and input to transforms.\n *\n * [DIMENSION_INHERIT_RULE]:\n * By default the dimensions are inherited from ancestors, unless a transform return\n * a new dimensions definition.\n * Consider the case:\n * ```js\n * dataset: [{\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\n * }, {\n * transform: { type: 'filter', ... }\n * }]\n * dataset: [{\n * dimension: ['Product', 'Sales', 'Prise'],\n * source: [ ['Cookies', 321, 44.21], ...]\n * }, {\n * transform: { type: 'filter', ... }\n * }]\n * ```\n * The two types of option should have the same behavior after transform.\n *\n *\n * [SCENARIO]:\n * (1) Provide source data directly:\n * ```js\n * series: {\n * encode: {...},\n * dimensions: [...]\n * seriesLayoutBy: 'row',\n * data: [[...]]\n * }\n * ```\n * (2) Series refer to dataset.\n * ```js\n * series: [{\n * encode: {...}\n * // Ignore datasetIndex means `datasetIndex: 0`\n * // and the dimensions defination in dataset is used\n * }, {\n * encode: {...},\n * seriesLayoutBy: 'column',\n * datasetIndex: 1\n * }]\n * ```\n * (3) dataset transform\n * ```js\n * dataset: [{\n * source: [...]\n * }, {\n * source: [...]\n * }, {\n * // By default from 0.\n * transform: { type: 'filter', config: {...} }\n * }, {\n * // Piped.\n * transform: [\n * { type: 'filter', config: {...} },\n * { type: 'sort', config: {...} }\n * ]\n * }, {\n * id: 'regressionData',\n * fromDatasetIndex: 1,\n * // Third-party transform\n * transform: { type: 'ecStat:regression', config: {...} }\n * }, {\n * // retrieve the extra result.\n * id: 'regressionFormula',\n * fromDatasetId: 'regressionData',\n * fromTransformResult: 1\n * }]\n * ```\n */\nvar SourceManager = /** @class */function () {\n function SourceManager(sourceHost) {\n // Cached source. Do not repeat calculating if not dirty.\n this._sourceList = [];\n this._storeList = [];\n // version sign of each upstream source manager.\n this._upstreamSignList = [];\n this._versionSignBase = 0;\n this._dirty = true;\n this._sourceHost = sourceHost;\n }\n /**\n * Mark dirty.\n */\n SourceManager.prototype.dirty = function () {\n this._setLocalSource([], []);\n this._storeList = [];\n this._dirty = true;\n };\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n this._sourceList = sourceList;\n this._upstreamSignList = upstreamSignList;\n this._versionSignBase++;\n if (this._versionSignBase > 9e10) {\n this._versionSignBase = 0;\n }\n };\n /**\n * For detecting whether the upstream source is dirty, so that\n * the local cached source (in `_sourceList`) should be discarded.\n */\n SourceManager.prototype._getVersionSign = function () {\n return this._sourceHost.uid + '_' + this._versionSignBase;\n };\n /**\n * Always return a source instance. Otherwise throw error.\n */\n SourceManager.prototype.prepareSource = function () {\n // For the case that call `setOption` multiple time but no data changed,\n // cache the result source to prevent from repeating transform.\n if (this._isDirty()) {\n this._createSource();\n this._dirty = false;\n }\n };\n SourceManager.prototype._createSource = function () {\n this._setLocalSource([], []);\n var sourceHost = this._sourceHost;\n var upSourceMgrList = this._getUpstreamSourceManagers();\n var hasUpstream = !!upSourceMgrList.length;\n var resultSourceList;\n var upstreamSignList;\n if (isSeries(sourceHost)) {\n var seriesModel = sourceHost;\n var data = void 0;\n var sourceFormat = void 0;\n var upSource = void 0;\n // Has upstream dataset\n if (hasUpstream) {\n var upSourceMgr = upSourceMgrList[0];\n upSourceMgr.prepareSource();\n upSource = upSourceMgr.getSource();\n data = upSource.data;\n sourceFormat = upSource.sourceFormat;\n upstreamSignList = [upSourceMgr._getVersionSign()];\n }\n // Series data is from own.\n else {\n data = seriesModel.get('data', true);\n sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n upstreamSignList = [];\n }\n // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n var newMetaRawOption = this._getSourceMetaRawOption() || {};\n var upMetaRawOption = upSource && upSource.metaRawOption || {};\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader);\n // Note here we should not use `upSource.dimensionsDefine`. Consider the case:\n // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`,\n // but series need `seriesLayoutBy: 'row'`.\n var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions);\n // We share source with dataset as much as possible\n // to avoid extra memory cost of high dimensional data.\n var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions;\n resultSourceList = needsCreateSource ? [createSource(data, {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n }, sourceFormat)] : [];\n } else {\n var datasetModel = sourceHost;\n // Has upstream dataset.\n if (hasUpstream) {\n var result = this._applyTransform(upSourceMgrList);\n resultSourceList = result.sourceList;\n upstreamSignList = result.upstreamSignList;\n }\n // Is root dataset.\n else {\n var sourceData = datasetModel.get('source', true);\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)];\n upstreamSignList = [];\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert(resultSourceList && upstreamSignList);\n }\n this._setLocalSource(resultSourceList, upstreamSignList);\n };\n SourceManager.prototype._applyTransform = function (upMgrList) {\n var datasetModel = this._sourceHost;\n var transformOption = datasetModel.get('transform', true);\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\n if (process.env.NODE_ENV !== 'production') {\n assert(fromTransformResult != null || transformOption != null);\n }\n if (fromTransformResult != null) {\n var errMsg = '';\n if (upMgrList.length !== 1) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\n }\n doThrow(errMsg);\n }\n }\n var sourceList;\n var upSourceList = [];\n var upstreamSignList = [];\n each(upMgrList, function (upMgr) {\n upMgr.prepareSource();\n var upSource = upMgr.getSource(fromTransformResult || 0);\n var errMsg = '';\n if (fromTransformResult != null && !upSource) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n }\n doThrow(errMsg);\n }\n upSourceList.push(upSource);\n upstreamSignList.push(upMgr._getVersionSign());\n });\n if (transformOption) {\n sourceList = applyDataTransform(transformOption, upSourceList, {\n datasetIndex: datasetModel.componentIndex\n });\n } else if (fromTransformResult != null) {\n sourceList = [cloneSourceShallow(upSourceList[0])];\n }\n return {\n sourceList: sourceList,\n upstreamSignList: upstreamSignList\n };\n };\n SourceManager.prototype._isDirty = function () {\n if (this._dirty) {\n return true;\n }\n // All sourceList is from the some upstream.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n for (var i = 0; i < upSourceMgrList.length; i++) {\n var upSrcMgr = upSourceMgrList[i];\n if (\n // Consider the case that there is ancestor diry, call it recursively.\n // The performance is probably not an issue because usually the chain is not long.\n upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\n return true;\n }\n }\n };\n /**\n * @param sourceIndex By default 0, means \"main source\".\n * In most cases there is only one source.\n */\n SourceManager.prototype.getSource = function (sourceIndex) {\n sourceIndex = sourceIndex || 0;\n var source = this._sourceList[sourceIndex];\n if (!source) {\n // Series may share source instance with dataset.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex);\n }\n return source;\n };\n /**\n *\n * Get a data store which can be shared across series.\n * Only available for series.\n *\n * @param seriesDimRequest Dimensions that are generated in series.\n * Should have been sorted by `storeDimIndex` asc.\n */\n SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.');\n }\n var schema = seriesDimRequest.makeStoreSchema();\n return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash);\n };\n SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) {\n // TODO Can use other sourceIndex?\n var sourceIndex = 0;\n var storeList = this._storeList;\n var cachedStoreMap = storeList[sourceIndex];\n if (!cachedStoreMap) {\n cachedStoreMap = storeList[sourceIndex] = {};\n }\n var cachedStore = cachedStoreMap[sourceReadKey];\n if (!cachedStore) {\n var upSourceMgr = this._getUpstreamSourceManagers()[0];\n if (isSeries(this._sourceHost) && upSourceMgr) {\n cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey);\n } else {\n cachedStore = new DataStore();\n // Always create store from source of series.\n cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims);\n }\n cachedStoreMap[sourceReadKey] = cachedStore;\n }\n return cachedStore;\n };\n /**\n * PENDING: Is it fast enough?\n * If no upstream, return empty array.\n */\n SourceManager.prototype._getUpstreamSourceManagers = function () {\n // Always get the relationship from the raw option.\n // Do not cache the link of the dependency graph, so that\n // there is no need to update them when change happens.\n var sourceHost = this._sourceHost;\n if (isSeries(sourceHost)) {\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\n } else {\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) {\n return datasetModel.getSourceManager();\n });\n }\n };\n SourceManager.prototype._getSourceMetaRawOption = function () {\n var sourceHost = this._sourceHost;\n var seriesLayoutBy;\n var sourceHeader;\n var dimensions;\n if (isSeries(sourceHost)) {\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n sourceHeader = sourceHost.get('sourceHeader', true);\n dimensions = sourceHost.get('dimensions', true);\n }\n // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them.\n else if (!this._getUpstreamSourceManagers().length) {\n var model = sourceHost;\n seriesLayoutBy = model.get('seriesLayoutBy', true);\n sourceHeader = model.get('sourceHeader', true);\n dimensions = model.get('dimensions', true);\n }\n return {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n };\n };\n return SourceManager;\n}();\nexport { SourceManager };\n// Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transform clone from rawOption.\nexport function disableTransformOptionMerge(datasetModel) {\n var transformOption = datasetModel.option.transform;\n transformOption && setAsPrimitive(datasetModel.option.transform);\n}\nfunction isSeries(sourceHost) {\n // Avoid circular dependency with Series.ts\n return sourceHost.mainType === 'series';\n}\nfunction doThrow(errMsg) {\n throw new Error(errMsg);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getTooltipMarker, encodeHTML, makeValueReadable, convertToColorString } from '../../util/format.js';\nimport { isString, each, hasOwn, isArray, map, assert, extend } from 'zrender/lib/core/util.js';\nimport { SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nimport { getRandomIdBase } from '../../util/number.js';\nvar TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\n// TODO: more textStyle option\nfunction getTooltipTextStyle(textStyle, renderMode) {\n var nameFontColor = textStyle.color || '#6e7079';\n var nameFontSize = textStyle.fontSize || 12;\n var nameFontWeight = textStyle.fontWeight || '400';\n var valueFontColor = textStyle.color || '#464646';\n var valueFontSize = textStyle.fontSize || 14;\n var valueFontWeight = textStyle.fontWeight || '900';\n if (renderMode === 'html') {\n // `textStyle` is probably from user input, should be encoded to reduce security risk.\n return {\n // eslint-disable-next-line max-len\n nameStyle: \"font-size:\" + encodeHTML(nameFontSize + '') + \"px;color:\" + encodeHTML(nameFontColor) + \";font-weight:\" + encodeHTML(nameFontWeight + ''),\n // eslint-disable-next-line max-len\n valueStyle: \"font-size:\" + encodeHTML(valueFontSize + '') + \"px;color:\" + encodeHTML(valueFontColor) + \";font-weight:\" + encodeHTML(valueFontWeight + '')\n };\n } else {\n return {\n nameStyle: {\n fontSize: nameFontSize,\n fill: nameFontColor,\n fontWeight: nameFontWeight\n },\n valueStyle: {\n fontSize: valueFontSize,\n fill: valueFontColor,\n fontWeight: valueFontWeight\n }\n };\n }\n}\n// See `TooltipMarkupLayoutIntent['innerGapLevel']`.\n// (value from UI design)\nvar HTML_GAPS = [0, 10, 20, 30];\nvar RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\n// eslint-disable-next-line max-len\nexport function createTooltipMarkup(type, option) {\n option.type = type;\n return option;\n}\nfunction isSectionFragment(frag) {\n return frag.type === 'section';\n}\nfunction getBuilder(frag) {\n return isSectionFragment(frag) ? buildSection : buildNameValue;\n}\nfunction getBlockGapLevel(frag) {\n if (isSectionFragment(frag)) {\n var gapLevel_1 = 0;\n var subBlockLen = frag.blocks.length;\n var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader;\n each(frag.blocks, function (subBlock) {\n var subGapLevel = getBlockGapLevel(subBlock);\n // If the some of the sub-blocks have some gaps (like 10px) inside, this block\n // should use a larger gap (like 20px) to distinguish those sub-blocks.\n if (subGapLevel >= gapLevel_1) {\n gapLevel_1 = subGapLevel + +(hasInnerGap_1 && (\n // 0 always can not be readable gap level.\n !subGapLevel\n // If no header, always keep the sub gap level. Otherwise\n // look weird in case `multipleSeries`.\n || isSectionFragment(subBlock) && !subBlock.noHeader));\n }\n });\n return gapLevel_1;\n }\n return 0;\n}\nfunction buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var noHeader = fragment.noHeader;\n var gaps = getGap(getBlockGapLevel(fragment));\n var subMarkupTextList = [];\n var subBlocks = fragment.blocks || [];\n assert(!subBlocks || isArray(subBlocks));\n subBlocks = subBlocks || [];\n var orderMode = ctx.orderMode;\n if (fragment.sortBlocks && orderMode) {\n subBlocks = subBlocks.slice();\n var orderMap = {\n valueAsc: 'asc',\n valueDesc: 'desc'\n };\n if (hasOwn(orderMap, orderMode)) {\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\n subBlocks.sort(function (a, b) {\n return comparator_1.evaluate(a.sortParam, b.sortParam);\n });\n }\n // FIXME 'seriesDesc' necessary?\n else if (orderMode === 'seriesDesc') {\n subBlocks.reverse();\n }\n }\n each(subBlocks, function (subBlock, idx) {\n var valueFormatter = fragment.valueFormatter;\n var subMarkupText = getBuilder(subBlock)(\n // Inherit valueFormatter\n valueFormatter ? extend(extend({}, ctx), {\n valueFormatter: valueFormatter\n }) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle);\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\n });\n var subMarkupText = ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(''), noHeader ? topMarginForOuterGap : gaps.html);\n if (noHeader) {\n return subMarkupText;\n }\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\n var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle;\n if (ctx.renderMode === 'richText') {\n return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText;\n } else {\n return wrapBlockHTML(\"
\" + encodeHTML(displayableHeader) + '
' + subMarkupText, topMarginForOuterGap);\n }\n}\nfunction buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var renderMode = ctx.renderMode;\n var noName = fragment.noName;\n var noValue = fragment.noValue;\n var noMarker = !fragment.markerType;\n var name = fragment.name;\n var useUTC = ctx.useUTC;\n var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function (value) {\n value = isArray(value) ? value : [value];\n return map(value, function (val, idx) {\n return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC);\n });\n };\n if (noName && noValue) {\n return;\n }\n var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\n var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC);\n var valueTypeOption = fragment.valueType;\n var readableValueList = noValue ? [] : valueFormatter(fragment.value, fragment.dataIndex);\n var valueAlignRight = !noMarker || !noName;\n // It little weird if only value next to marker but far from marker.\n var valueCloseToMarker = !noMarker && noName;\n var _a = getTooltipTextStyle(toolTipTextStyle, renderMode),\n nameStyle = _a.nameStyle,\n valueStyle = _a.valueStyle;\n return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle))\n // Value has commas inside, so use ' ' as delimiter for multiple values.\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap);\n}\n/**\n * @return markupText. null/undefined means no content.\n */\nexport function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) {\n if (!fragment) {\n return;\n }\n var builder = getBuilder(fragment);\n var ctx = {\n useUTC: useUTC,\n renderMode: renderMode,\n orderMode: orderMode,\n markupStyleCreator: markupStyleCreator,\n valueFormatter: fragment.valueFormatter\n };\n return builder(ctx, fragment, 0, toolTipTextStyle);\n}\nfunction getGap(gapLevel) {\n return {\n html: HTML_GAPS[gapLevel],\n richText: RICH_TEXT_GAPS[gapLevel]\n };\n}\nfunction wrapBlockHTML(encodedContent, topGap) {\n var clearfix = '
';\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\n return \"
\" + encodedContent + clearfix + '
';\n}\nfunction wrapInlineNameHTML(name, leftHasMarker, style) {\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\n return \"\" + encodeHTML(name) + '';\n}\nfunction wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) {\n // Do not too close to marker, considering there are multiple values separated by spaces.\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\n valueList = isArray(valueList) ? valueList : [valueList];\n return \"\"\n // Value has commas inside, so use ' ' as delimiter for multiple values.\n + map(valueList, function (value) {\n return encodeHTML(value);\n }).join('  ') + '';\n}\nfunction wrapInlineNameRichText(ctx, name, style) {\n return ctx.markupStyleCreator.wrapRichTextStyle(name, style);\n}\nfunction wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) {\n var styles = [style];\n var paddingLeft = valueCloseToMarker ? 10 : 20;\n alignRight && styles.push({\n padding: [0, 0, 0, paddingLeft],\n align: 'right'\n });\n // Value has commas inside, so use ' ' as delimiter for multiple values.\n return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join(' ') : values, styles);\n}\nexport function retrieveVisualColorForTooltipMarker(series, dataIndex) {\n var style = series.getData().getItemVisual(dataIndex, 'style');\n var color = style[series.visualDrawType];\n return convertToColorString(color);\n}\nexport function getPaddingFromTooltipModel(model, renderMode) {\n var padding = model.get('padding');\n return padding != null ? padding\n // We give slightly different to look pretty.\n : renderMode === 'richText' ? [8, 10] : 10;\n}\n/**\n * The major feature is generate styles for `renderMode: 'richText'`.\n * But it also serves `renderMode: 'html'` to provide\n * \"renderMode-independent\" API.\n */\nvar TooltipMarkupStyleCreator = /** @class */function () {\n function TooltipMarkupStyleCreator() {\n this.richTextStyles = {};\n // Notice that \"generate a style name\" usually happens repeatedly when mouse is moving and\n // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator\n // rather than static shared by all creators (which will cause it increase to fast).\n this._nextStyleNameId = getRandomIdBase();\n }\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\n return '__EC_aUTo_' + this._nextStyleNameId++;\n };\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\n var markerId = renderMode === 'richText' ? this._generateStyleName() : null;\n var marker = getTooltipMarker({\n color: colorStr,\n type: markerType,\n renderMode: renderMode,\n markerId: markerId\n });\n if (isString(marker)) {\n return marker;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(markerId);\n }\n this.richTextStyles[markerId] = marker.style;\n return marker.content;\n }\n };\n /**\n * @usage\n * ```ts\n * const styledText = markupStyleCreator.wrapRichTextStyle([\n * // The styles will be auto merged.\n * {\n * fontSize: 12,\n * color: 'blue'\n * },\n * {\n * padding: 20\n * }\n * ]);\n * ```\n */\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\n var finalStl = {};\n if (isArray(styles)) {\n each(styles, function (stl) {\n return extend(finalStl, stl);\n });\n } else {\n extend(finalStl, styles);\n }\n var styleName = this._generateStyleName();\n this.richTextStyles[styleName] = finalStl;\n return \"{\" + styleName + \"|\" + text + \"}\";\n };\n return TooltipMarkupStyleCreator;\n}();\nexport { TooltipMarkupStyleCreator };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { trim, isArray, each, reduce } from 'zrender/lib/core/util.js';\nimport { retrieveVisualColorForTooltipMarker, createTooltipMarkup } from './tooltipMarkup.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isNameSpecified } from '../../util/model.js';\nexport function defaultSeriesFormatTooltip(opt) {\n var series = opt.series;\n var dataIndex = opt.dataIndex;\n var multipleSeries = opt.multipleSeries;\n var data = series.getData();\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\n var tooltipDimLen = tooltipDims.length;\n var value = series.getRawValue(dataIndex);\n var isValueArr = isArray(value);\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\n // Complicated rule for pretty tooltip.\n var inlineValue;\n var inlineValueType;\n var subBlocks;\n var sortParam;\n if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) {\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\n inlineValue = formatArrResult.inlineValues;\n inlineValueType = formatArrResult.inlineValueTypes;\n subBlocks = formatArrResult.blocks;\n // Only support tooltip sort by the first inline value. It's enough in most cases.\n sortParam = formatArrResult.inlineValues[0];\n } else if (tooltipDimLen) {\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\n inlineValueType = dimInfo.type;\n } else {\n sortParam = inlineValue = isValueArr ? value[0] : value;\n }\n // Do not show generated series name. It might not be readable.\n var seriesNameSpecified = isNameSpecified(series);\n var seriesName = seriesNameSpecified && series.name || '';\n var itemName = data.getName(dataIndex);\n var inlineName = multipleSeries ? seriesName : itemName;\n return createTooltipMarkup('section', {\n header: seriesName,\n // When series name is not specified, do not show a header line with only '-'.\n // This case always happens in tooltip.trigger: 'item'.\n noHeader: multipleSeries || !seriesNameSpecified,\n sortParam: sortParam,\n blocks: [createTooltipMarkup('nameValue', {\n markerType: 'item',\n markerColor: markerColor,\n // Do not mix display seriesName and itemName in one tooltip,\n // which might confuses users.\n name: inlineName,\n // name dimension might be auto assigned, where the name might\n // be not readable. So we check trim here.\n noName: !trim(inlineName),\n value: inlineValue,\n valueType: inlineValueType,\n dataIndex: dataIndex\n })].concat(subBlocks || [])\n });\n}\nfunction formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\n // check: category-no-encode-has-axis-data in dataset.html\n var data = series.getData();\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\n var dimItem = data.getDimensionInfo(idx);\n return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null;\n }, false);\n var inlineValues = [];\n var inlineValueTypes = [];\n var blocks = [];\n tooltipDims.length ? each(tooltipDims, function (dim) {\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\n })\n // By default, all dims is used on tooltip.\n : each(value, setEachItem);\n function setEachItem(val, dim) {\n var dimInfo = data.getDimensionInfo(dim);\n // If `dimInfo.tooltip` is not set, show tooltip.\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\n return;\n }\n if (isValueMultipleLine) {\n blocks.push(createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: colorStr,\n name: dimInfo.displayName,\n value: val,\n valueType: dimInfo.type\n }));\n } else {\n inlineValues.push(val);\n inlineValueTypes.push(dimInfo.type);\n }\n }\n return {\n inlineValues: inlineValues,\n inlineValueTypes: inlineValueTypes,\n blocks: blocks\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport * as modelUtil from '../util/model.js';\nimport ComponentModel from './Component.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { DataFormatMixin } from '../model/mixin/dataFormat.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport { createTask } from '../core/task.js';\nimport { mountExtend } from '../util/clazz.js';\nimport { SourceManager } from '../data/helper/sourceManager.js';\nimport { defaultSeriesFormatTooltip } from '../component/tooltip/seriesFormatTooltip.js';\nvar inner = modelUtil.makeInner();\nfunction getSelectionKey(data, dataIndex) {\n return data.getName(dataIndex) || data.getId(dataIndex);\n}\nexport var SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled';\nvar SeriesModel = /** @class */function (_super) {\n __extends(SeriesModel, _super);\n function SeriesModel() {\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\n // the class members must not be initialized in constructor or declaration place.\n // Otherwise there is bad case:\n // class A {xxx = 1;}\n // enableClassExtend(A);\n // class B extends A {}\n // var C = B.extend({xxx: 5});\n // var c = new C();\n // console.log(c.xxx); // expect 5 but always 1.\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // ---------------------------------------\n // Props about data selection\n // ---------------------------------------\n _this._selectedDataIndicesMap = {};\n return _this;\n }\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\n this.seriesIndex = this.componentIndex;\n this.dataTask = createTask({\n count: dataTaskCount,\n reset: dataTaskReset\n });\n this.dataTask.context = {\n model: this\n };\n this.mergeDefaultAndTheme(option, ecModel);\n var sourceManager = inner(this).sourceManager = new SourceManager(this);\n sourceManager.prepareSource();\n var data = this.getInitialData(option, ecModel);\n wrapData(data, this);\n this.dataTask.context.data = data;\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(data, 'getInitialData returned invalid data.');\n }\n inner(this).dataBeforeProcessed = data;\n // If we reverse the order (make data firstly, and then make\n // dataBeforeProcessed by cloneShallow), cloneShallow will\n // cause data.graph.data !== data when using\n // module:echarts/data/Graph or module:echarts/data/Tree.\n // See module:echarts/data/helper/linkSeriesData\n // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model\n // init or merge stage, because the data can be restored. So we do not `restoreData`\n // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.\n // Call `seriesModel.getRawData()` instead.\n // this.restoreData();\n autoSeriesName(this);\n this._initSelectedMapFromData(data);\n };\n /**\n * Util for merge default and theme to option\n */\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n // Backward compat: using subType on theme.\n // But if name duplicate between series subType\n // (for example: parallel) add component mainType,\n // add suffix 'Series'.\n var themeSubType = this.subType;\n if (ComponentModel.hasClass(themeSubType)) {\n themeSubType += 'Series';\n }\n zrUtil.merge(option, ecModel.getTheme().get(this.subType));\n zrUtil.merge(option, this.getDefaultOption());\n // Default label emphasis `show`\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n this.fillDataTextStyle(option.data);\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\n // this.settingTask.dirty();\n newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);\n this.fillDataTextStyle(newSeriesOption.data);\n var layoutMode = fetchLayoutMode(this);\n if (layoutMode) {\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\n }\n var sourceManager = inner(this).sourceManager;\n sourceManager.dirty();\n sourceManager.prepareSource();\n var data = this.getInitialData(newSeriesOption, ecModel);\n wrapData(data, this);\n this.dataTask.dirty();\n this.dataTask.context.data = data;\n inner(this).dataBeforeProcessed = data;\n autoSeriesName(this);\n this._initSelectedMapFromData(data);\n };\n SeriesModel.prototype.fillDataTextStyle = function (data) {\n // Default data label emphasis `show`\n // FIXME Tree structure data ?\n // FIXME Performance ?\n if (data && !zrUtil.isTypedArray(data)) {\n var props = ['show'];\n for (var i = 0; i < data.length; i++) {\n if (data[i] && data[i].label) {\n modelUtil.defaultEmphasis(data[i], 'label', props);\n }\n }\n }\n };\n /**\n * Init a data structure from data related option in series\n * Must be overridden.\n */\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\n return;\n };\n /**\n * Append data to list\n */\n SeriesModel.prototype.appendData = function (params) {\n // FIXME ???\n // (1) If data from dataset, forbidden append.\n // (2) support append data of dataset.\n var data = this.getRawData();\n data.appendData(params.data);\n };\n /**\n * Consider some method like `filter`, `map` need make new data,\n * We should make sure that `seriesModel.getData()` get correct\n * data in the stream procedure. So we fetch data from upstream\n * each time `task.perform` called.\n */\n SeriesModel.prototype.getData = function (dataType) {\n var task = getCurrentTask(this);\n if (task) {\n var data = task.context.data;\n return dataType == null || !data.getLinkedData ? data : data.getLinkedData(dataType);\n } else {\n // When series is not alive (that may happen when click toolbox\n // restore or setOption with not merge mode), series data may\n // be still need to judge animation or something when graphic\n // elements want to know whether fade out.\n return inner(this).data;\n }\n };\n SeriesModel.prototype.getAllData = function () {\n var mainData = this.getData();\n return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{\n data: mainData\n }];\n };\n SeriesModel.prototype.setData = function (data) {\n var task = getCurrentTask(this);\n if (task) {\n var context = task.context;\n // Consider case: filter, data sample.\n // FIXME:TS never used, so comment it\n // if (context.data !== data && task.modifyOutputEnd) {\n // task.setOutputEnd(data.count());\n // }\n context.outputData = data;\n // Caution: setData should update context.data,\n // Because getData may be called multiply in a\n // single stage and expect to get the data just\n // set. (For example, AxisProxy, x y both call\n // getData and setDate sequentially).\n // So the context.data should be fetched from\n // upstream each time when a stage starts to be\n // performed.\n if (task !== this.dataTask) {\n context.data = data;\n }\n }\n inner(this).data = data;\n };\n SeriesModel.prototype.getEncode = function () {\n var encode = this.get('encode', true);\n if (encode) {\n return zrUtil.createHashMap(encode);\n }\n };\n SeriesModel.prototype.getSourceManager = function () {\n return inner(this).sourceManager;\n };\n SeriesModel.prototype.getSource = function () {\n return this.getSourceManager().getSource();\n };\n /**\n * Get data before processed\n */\n SeriesModel.prototype.getRawData = function () {\n return inner(this).dataBeforeProcessed;\n };\n SeriesModel.prototype.getColorBy = function () {\n var colorBy = this.get('colorBy');\n return colorBy || 'series';\n };\n SeriesModel.prototype.isColorBySeries = function () {\n return this.getColorBy() === 'series';\n };\n /**\n * Get base axis if has coordinate system and has axis.\n * By default use coordSys.getBaseAxis();\n * Can be overridden for some chart.\n * @return {type} description\n */\n SeriesModel.prototype.getBaseAxis = function () {\n var coordSys = this.coordinateSystem;\n // @ts-ignore\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\n };\n /**\n * Default tooltip formatter\n *\n * @param dataIndex\n * @param multipleSeries\n * @param dataType\n * @param renderMode valid values: 'html'(by default) and 'richText'.\n * 'html' is used for rendering tooltip in extra DOM form, and the result\n * string is used as DOM HTML content.\n * 'richText' is used for rendering tooltip in rich text form, for those where\n * DOM operation is not supported.\n * @return formatted tooltip with `html` and `markers`\n * Notice: The override method can also return string\n */\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n return defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n };\n SeriesModel.prototype.isAnimationEnabled = function () {\n var ecModel = this.ecModel;\n // Disable animation if using echarts in node but not give ssr flag.\n // In ssr mode, renderToString will generate svg with css animation.\n if (env.node && !(ecModel && ecModel.ssr)) {\n return false;\n }\n var animationEnabled = this.getShallow('animation');\n if (animationEnabled) {\n if (this.getData().count() > this.getShallow('animationThreshold')) {\n animationEnabled = false;\n }\n }\n return !!animationEnabled;\n };\n SeriesModel.prototype.restoreData = function () {\n this.dataTask.dirty();\n };\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\n var ecModel = this.ecModel;\n // PENDING\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\n if (!color) {\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\n }\n return color;\n };\n /**\n * Use `data.mapDimensionsAll(coordDim)` instead.\n * @deprecated\n */\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\n return this.getRawData().mapDimensionsAll(coordDim);\n };\n /**\n * Get progressive rendering count each step\n */\n SeriesModel.prototype.getProgressive = function () {\n return this.get('progressive');\n };\n /**\n * Get progressive rendering count each step\n */\n SeriesModel.prototype.getProgressiveThreshold = function () {\n return this.get('progressiveThreshold');\n };\n // PENGING If selectedMode is null ?\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\n this._innerSelect(this.getData(dataType), innerDataIndices);\n };\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\n var selectedMap = this.option.selectedMap;\n if (!selectedMap) {\n return;\n }\n var selectedMode = this.option.selectedMode;\n var data = this.getData(dataType);\n if (selectedMode === 'series' || selectedMap === 'all') {\n this.option.selectedMap = {};\n this._selectedDataIndicesMap = {};\n return;\n }\n for (var i = 0; i < innerDataIndices.length; i++) {\n var dataIndex = innerDataIndices[i];\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = false;\n this._selectedDataIndicesMap[nameOrId] = -1;\n }\n };\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\n var tmpArr = [];\n for (var i = 0; i < innerDataIndices.length; i++) {\n tmpArr[0] = innerDataIndices[i];\n this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType);\n }\n };\n SeriesModel.prototype.getSelectedDataIndices = function () {\n if (this.option.selectedMap === 'all') {\n return [].slice.call(this.getData().getIndices());\n }\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\n var nameOrIds = zrUtil.keys(selectedDataIndicesMap);\n var dataIndices = [];\n for (var i = 0; i < nameOrIds.length; i++) {\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\n if (dataIndex >= 0) {\n dataIndices.push(dataIndex);\n }\n }\n return dataIndices;\n };\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\n var selectedMap = this.option.selectedMap;\n if (!selectedMap) {\n return false;\n }\n var data = this.getData(dataType);\n return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(['select', 'disabled']);\n };\n SeriesModel.prototype.isUniversalTransitionEnabled = function () {\n if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n return true;\n }\n var universalTransitionOpt = this.option.universalTransition;\n // Quick reject\n if (!universalTransitionOpt) {\n return false;\n }\n if (universalTransitionOpt === true) {\n return true;\n }\n // Can be simply 'universalTransition: true'\n return universalTransitionOpt && universalTransitionOpt.enabled;\n };\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\n var _a, _b;\n var option = this.option;\n var selectedMode = option.selectedMode;\n var len = innerDataIndices.length;\n if (!selectedMode || !len) {\n return;\n }\n if (selectedMode === 'series') {\n option.selectedMap = 'all';\n } else if (selectedMode === 'multiple') {\n if (!zrUtil.isObject(option.selectedMap)) {\n option.selectedMap = {};\n }\n var selectedMap = option.selectedMap;\n for (var i = 0; i < len; i++) {\n var dataIndex = innerDataIndices[i];\n // TODO different types of data share same object.\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = true;\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\n }\n } else if (selectedMode === 'single' || selectedMode === true) {\n var lastDataIndex = innerDataIndices[len - 1];\n var nameOrId = getSelectionKey(data, lastDataIndex);\n option.selectedMap = (_a = {}, _a[nameOrId] = true, _a);\n this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b);\n }\n };\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\n // Ignore select info in data if selectedMap exists.\n // NOTE It's only for legacy usage. edge data is not supported.\n if (this.option.selectedMap) {\n return;\n }\n var dataIndices = [];\n if (data.hasItemOption) {\n data.each(function (idx) {\n var rawItem = data.getRawDataItem(idx);\n if (rawItem && rawItem.selected) {\n dataIndices.push(idx);\n }\n });\n }\n if (dataIndices.length > 0) {\n this._innerSelect(data, dataIndices);\n }\n };\n // /**\n // * @see {module:echarts/stream/Scheduler}\n // */\n // abstract pipeTask: null\n SeriesModel.registerClass = function (clz) {\n return ComponentModel.registerClass(clz);\n };\n SeriesModel.protoInitialize = function () {\n var proto = SeriesModel.prototype;\n proto.type = 'series.__base__';\n proto.seriesIndex = 0;\n proto.ignoreStyleOnData = false;\n proto.hasSymbolVisual = false;\n proto.defaultSymbol = 'circle';\n // Make sure the values can be accessed!\n proto.visualStyleAccessPath = 'itemStyle';\n proto.visualDrawType = 'fill';\n }();\n return SeriesModel;\n}(ComponentModel);\nzrUtil.mixin(SeriesModel, DataFormatMixin);\nzrUtil.mixin(SeriesModel, PaletteMixin);\nmountExtend(SeriesModel, ComponentModel);\n/**\n * MUST be called after `prepareSource` called\n * Here we need to make auto series, especially for auto legend. But we\n * do not modify series.name in option to avoid side effects.\n */\nfunction autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n if (!modelUtil.isNameSpecified(seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}\nfunction getSeriesAutoName(seriesModel) {\n var data = seriesModel.getRawData();\n var dataDims = data.mapDimensionsAll('seriesName');\n var nameArr = [];\n zrUtil.each(dataDims, function (dataDim) {\n var dimInfo = data.getDimensionInfo(dataDim);\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\n });\n return nameArr.join(' ');\n}\nfunction dataTaskCount(context) {\n return context.model.getRawData().count();\n}\nfunction dataTaskReset(context) {\n var seriesModel = context.model;\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\n return dataTaskProgress;\n}\nfunction dataTaskProgress(param, context) {\n // Avoid repeat cloneShallow when data just created in reset.\n if (context.outputData && param.end > context.outputData.count()) {\n context.model.getRawData().cloneShallow(context.outputData);\n }\n}\n// TODO refactor\nfunction wrapData(data, seriesModel) {\n zrUtil.each(zrUtil.concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\n data.wrapMethod(methodName, zrUtil.curry(onDataChange, seriesModel));\n });\n}\nfunction onDataChange(seriesModel, newList) {\n var task = getCurrentTask(seriesModel);\n if (task) {\n // Consider case: filter, selectRange\n task.setOutputEnd((newList || this).count());\n }\n return newList;\n}\nfunction getCurrentTask(seriesModel) {\n var scheduler = (seriesModel.ecModel || {}).scheduler;\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\n if (pipeline) {\n // When pipline finished, the currrentTask keep the last\n // task (renderTask).\n var task = pipeline.currentTask;\n if (task) {\n var agentStubMap = task.agentStubMap;\n if (agentStubMap) {\n task = agentStubMap.get(seriesModel.uid);\n }\n }\n return task;\n }\n}\nexport default SeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\nvar ComponentView = /** @class */function () {\n function ComponentView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewComponent');\n }\n ComponentView.prototype.init = function (ecModel, api) {};\n ComponentView.prototype.render = function (model, ecModel, api, payload) {};\n ComponentView.prototype.dispose = function (ecModel, api) {};\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {\n // Do nothing;\n };\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {\n // Do nothing;\n };\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {\n // Do nothing;\n };\n /**\n * Hook for toggle blur target series.\n * Can be used in marker for blur or leave blur the markers\n */\n ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) {\n // Do nothing;\n };\n /**\n * Traverse the new rendered elements.\n *\n * It will traverse the new added element in progressive rendering.\n * And traverse all in normal rendering.\n */\n ComponentView.prototype.eachRendered = function (cb) {\n var group = this.group;\n if (group) {\n group.traverse(cb);\n }\n };\n return ComponentView;\n}();\n;\nclazzUtil.enableClassExtend(ComponentView);\nclazzUtil.enableClassManagement(ComponentView);\nexport default ComponentView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model.js';\n/**\n * @return {string} If large mode changed, return string 'reset';\n */\nexport default function createRenderPlanner() {\n var inner = makeInner();\n return function (seriesModel) {\n var fields = inner(seriesModel);\n var pipelineContext = seriesModel.pipelineContext;\n var originalLarge = !!fields.large;\n var originalProgressive = !!fields.progressiveRender;\n // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n // exists. See #11611 . Probably we need to modify this structure, see the comment\n // on `performRawSeries` in `Schedular.js`.\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\n return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset';\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\nimport * as modelUtil from '../util/model.js';\nimport { enterEmphasis, leaveEmphasis, getHighlightDigit, isHighDownDispatcher } from '../util/states.js';\nimport { createTask } from '../core/task.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { traverseElements } from '../util/graphic.js';\nimport { error } from '../util/log.js';\nvar inner = modelUtil.makeInner();\nvar renderPlanner = createRenderPlanner();\nvar ChartView = /** @class */function () {\n function ChartView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewChart');\n this.renderTask = createTask({\n plan: renderTaskPlan,\n reset: renderTaskReset\n });\n this.renderTask.context = {\n view: this\n };\n }\n ChartView.prototype.init = function (ecModel, api) {};\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('render method must been implemented');\n }\n };\n /**\n * Highlight series or specified data item.\n */\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData(payload && payload.dataType);\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n return;\n }\n toggleHighlight(data, payload, 'emphasis');\n };\n /**\n * Downplay series or specified data item.\n */\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData(payload && payload.dataType);\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n return;\n }\n toggleHighlight(data, payload, 'normal');\n };\n /**\n * Remove self.\n */\n ChartView.prototype.remove = function (ecModel, api) {\n this.group.removeAll();\n };\n /**\n * Dispose self.\n */\n ChartView.prototype.dispose = function (ecModel, api) {};\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n };\n // FIXME never used?\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n };\n // FIXME never used?\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n };\n /**\n * Traverse the new rendered elements.\n *\n * It will traverse the new added element in progressive rendering.\n * And traverse all in normal rendering.\n */\n ChartView.prototype.eachRendered = function (cb) {\n traverseElements(this.group, cb);\n };\n ChartView.markUpdateMethod = function (payload, methodName) {\n inner(payload).updateMethod = methodName;\n };\n ChartView.protoInitialize = function () {\n var proto = ChartView.prototype;\n proto.type = 'chart';\n }();\n return ChartView;\n}();\n;\n/**\n * Set state of single element\n */\nfunction elSetState(el, state, highlightDigit) {\n if (el && isHighDownDispatcher(el)) {\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\n }\n}\nfunction toggleHighlight(data, payload, state) {\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null;\n if (dataIndex != null) {\n each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\n });\n } else {\n data.eachItemGraphicEl(function (el) {\n elSetState(el, state, highlightDigit);\n });\n }\n}\nclazzUtil.enableClassExtend(ChartView, ['dispose']);\nclazzUtil.enableClassManagement(ChartView);\nfunction renderTaskPlan(context) {\n return renderPlanner(context.model);\n}\nfunction renderTaskReset(context) {\n var seriesModel = context.model;\n var ecModel = context.ecModel;\n var api = context.api;\n var payload = context.payload;\n // FIXME: remove updateView updateVisual\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\n var view = context.view;\n var updateMethod = payload && inner(payload).updateMethod;\n var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod\n // `appendData` is also supported when data amount\n // is less than progressive threshold.\n : 'render';\n if (methodName !== 'render') {\n view[methodName](seriesModel, ecModel, api, payload);\n }\n return progressMethodMap[methodName];\n}\nvar progressMethodMap = {\n incrementalPrepareRender: {\n progress: function (params, context) {\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\n }\n },\n render: {\n // Put view.render in `progress` to support appendData. But in this case\n // view.render should not be called in reset, otherwise it will be called\n // twise. Use `forceFirstProgress` to make sure that view.render is called\n // in any cases.\n forceFirstProgress: true,\n progress: function (params, context) {\n context.view.render(context.model, context.ecModel, context.api, context.payload);\n }\n }\n};\nexport default ChartView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar ORIGIN_METHOD = '\\0__throttleOriginMethod';\nvar RATE = '\\0__throttleRate';\nvar THROTTLE_TYPE = '\\0__throttleType';\n;\n/**\n * @public\n * @param {(Function)} fn\n * @param {number} [delay=0] Unit: ms.\n * @param {boolean} [debounce=false]\n * true: If call interval less than `delay`, only the last call works.\n * false: If call interval less than `delay, call works on fixed rate.\n * @return {(Function)} throttled fn.\n */\nexport function throttle(fn, delay, debounce) {\n var currCall;\n var lastCall = 0;\n var lastExec = 0;\n var timer = null;\n var diff;\n var scope;\n var args;\n var debounceNextCall;\n delay = delay || 0;\n function exec() {\n lastExec = new Date().getTime();\n timer = null;\n fn.apply(scope, args || []);\n }\n var cb = function () {\n var cbArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n cbArgs[_i] = arguments[_i];\n }\n currCall = new Date().getTime();\n scope = this;\n args = cbArgs;\n var thisDelay = debounceNextCall || delay;\n var thisDebounce = debounceNextCall || debounce;\n debounceNextCall = null;\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\n clearTimeout(timer);\n // Here we should make sure that: the `exec` SHOULD NOT be called later\n // than a new call of `cb`, that is, preserving the command order. Consider\n // calculating \"scale rate\" when roaming as an example. When a call of `cb`\n // happens, either the `exec` is called dierectly, or the call is delayed.\n // But the delayed call should never be later than next call of `cb`. Under\n // this assurance, we can simply update view state each time `dispatchAction`\n // triggered by user roaming, but not need to add extra code to avoid the\n // state being \"rolled-back\".\n if (thisDebounce) {\n timer = setTimeout(exec, thisDelay);\n } else {\n if (diff >= 0) {\n exec();\n } else {\n timer = setTimeout(exec, -diff);\n }\n }\n lastCall = currCall;\n };\n /**\n * Clear throttle.\n * @public\n */\n cb.clear = function () {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n };\n /**\n * Enable debounce once.\n */\n cb.debounceNextCall = function (debounceDelay) {\n debounceNextCall = debounceDelay;\n };\n return cb;\n}\n/**\n * Create throttle method or update throttle rate.\n *\n * @example\n * ComponentView.prototype.render = function () {\n * ...\n * throttle.createOrUpdate(\n * this,\n * '_dispatchAction',\n * this.model.get('throttle'),\n * 'fixRate'\n * );\n * };\n * ComponentView.prototype.remove = function () {\n * throttle.clear(this, '_dispatchAction');\n * };\n * ComponentView.prototype.dispose = function () {\n * throttle.clear(this, '_dispatchAction');\n * };\n *\n */\nexport function createOrUpdate(obj, fnAttr, rate, throttleType) {\n var fn = obj[fnAttr];\n if (!fn) {\n return;\n }\n var originFn = fn[ORIGIN_METHOD] || fn;\n var lastThrottleType = fn[THROTTLE_TYPE];\n var lastRate = fn[RATE];\n if (lastRate !== rate || lastThrottleType !== throttleType) {\n if (rate == null || !throttleType) {\n return obj[fnAttr] = originFn;\n }\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\n fn[ORIGIN_METHOD] = originFn;\n fn[THROTTLE_TYPE] = throttleType;\n fn[RATE] = rate;\n }\n return fn;\n}\n/**\n * Clear throttle. Example see throttle.createOrUpdate.\n */\nexport function clear(obj, fnAttr) {\n var fn = obj[fnAttr];\n if (fn && fn[ORIGIN_METHOD]) {\n // Clear throttle\n fn.clear && fn.clear();\n obj[fnAttr] = fn[ORIGIN_METHOD];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction, extend, createHashMap } from 'zrender/lib/core/util.js';\nimport makeStyleMapper from '../model/mixin/makeStyleMapper.js';\nimport { ITEM_STYLE_KEY_MAP } from '../model/mixin/itemStyle.js';\nimport { LINE_STYLE_KEY_MAP } from '../model/mixin/lineStyle.js';\nimport Model from '../model/Model.js';\nimport { makeInner } from '../util/model.js';\nvar inner = makeInner();\nvar defaultStyleMappers = {\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\n};\nvar defaultColorKey = {\n lineStyle: 'stroke',\n itemStyle: 'fill'\n};\nfunction getStyleMapper(seriesModel, stylePath) {\n var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath];\n if (!styleMapper) {\n console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n return defaultStyleMappers.itemStyle;\n }\n return styleMapper;\n}\nfunction getDefaultColorKey(seriesModel, stylePath) {\n // return defaultColorKey[stylePath] ||\n var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath];\n if (!colorKey) {\n console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n return 'fill';\n }\n return colorKey;\n}\nvar seriesStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n // Set in itemStyle\n var styleModel = seriesModel.getModel(stylePath);\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var globalStyle = getStyle(styleModel);\n var decalOption = styleModel.getShallow('decal');\n if (decalOption) {\n data.setVisual('decal', decalOption);\n decalOption.dirty = true;\n }\n // TODO\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n var color = globalStyle[colorKey];\n // TODO style callback\n var colorCallback = isFunction(color) ? color : null;\n var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto';\n // Get from color palette by default.\n if (!globalStyle[colorKey] || colorCallback || hasAutoColor) {\n // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT\n // make it effect palette. Because some scenarios users need to make some series\n // transparent or as background, which should better not effect the palette.\n var colorPalette = seriesModel.getColorFromPalette(\n // TODO series count changed.\n seriesModel.name, null, ecModel.getSeriesCount());\n if (!globalStyle[colorKey]) {\n globalStyle[colorKey] = colorPalette;\n data.setVisual('colorFromPalette', true);\n }\n globalStyle.fill = globalStyle.fill === 'auto' || isFunction(globalStyle.fill) ? colorPalette : globalStyle.fill;\n globalStyle.stroke = globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke) ? colorPalette : globalStyle.stroke;\n }\n data.setVisual('style', globalStyle);\n data.setVisual('drawType', colorKey);\n // Only visible series has each data be visual encoded\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\n data.setVisual('colorFromPalette', false);\n return {\n dataEach: function (data, idx) {\n var dataParams = seriesModel.getDataParams(idx);\n var itemStyle = extend({}, globalStyle);\n itemStyle[colorKey] = colorCallback(dataParams);\n data.setItemVisual(idx, 'style', itemStyle);\n }\n };\n }\n }\n};\nvar sharedModel = new Model();\nvar dataStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n // Set in itemStyle\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var colorKey = data.getVisual('drawType');\n return {\n dataEach: data.hasItemOption ? function (data, idx) {\n // Not use getItemModel for performance considuration\n var rawItem = data.getRawDataItem(idx);\n if (rawItem && rawItem[stylePath]) {\n sharedModel.option = rawItem[stylePath];\n var style = getStyle(sharedModel);\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n if (sharedModel.option.decal) {\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\n sharedModel.option.decal.dirty = true;\n }\n if (colorKey in style) {\n data.setItemVisual(idx, 'colorFromPalette', false);\n }\n }\n } : null\n };\n }\n};\n// Pick color from palette for the data which has not been set with color yet.\n// Note: do not support stream rendering. No such cases yet.\nvar dataColorPaletteTask = {\n performRawSeries: true,\n overallReset: function (ecModel) {\n // Each type of series uses one scope.\n // Pie and funnel are using different scopes.\n var paletteScopeGroupByType = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var colorBy = seriesModel.getColorBy();\n if (seriesModel.isColorBySeries()) {\n return;\n }\n var key = seriesModel.type + '-' + colorBy;\n var colorScope = paletteScopeGroupByType.get(key);\n if (!colorScope) {\n colorScope = {};\n paletteScopeGroupByType.set(key, colorScope);\n }\n inner(seriesModel).scope = colorScope;\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n var colorScope = inner(seriesModel).scope;\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n // Iterate on data before filtered. To make sure color from palette can be\n // Consistent when toggling legend.\n dataAll.each(function (rawIdx) {\n var idx = idxMap[rawIdx];\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette');\n // Get color from palette for each data only when the color is inherited from series color, which is\n // also picked from color palette. So following situation is not in the case:\n // 1. series.itemStyle.color is set\n // 2. color is encoded by visualMap\n if (fromPalette) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n var name_1 = dataAll.getName(rawIdx) || rawIdx + '';\n var dataCount = dataAll.count();\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\n }\n });\n });\n }\n};\nexport { seriesStyleTask, dataStyleTask, dataColorPaletteTask };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../util/graphic.js';\nvar PI = Math.PI;\n/**\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} [opts]\n * @param {string} [opts.text]\n * @param {string} [opts.color]\n * @param {string} [opts.textColor]\n * @return {module:zrender/Element}\n */\nexport default function defaultLoading(api, opts) {\n opts = opts || {};\n zrUtil.defaults(opts, {\n text: 'loading',\n textColor: '#000',\n fontSize: 12,\n fontWeight: 'normal',\n fontStyle: 'normal',\n fontFamily: 'sans-serif',\n maskColor: 'rgba(255, 255, 255, 0.8)',\n showSpinner: true,\n color: '#5470c6',\n spinnerRadius: 10,\n lineWidth: 5,\n zlevel: 0\n });\n var group = new graphic.Group();\n var mask = new graphic.Rect({\n style: {\n fill: opts.maskColor\n },\n zlevel: opts.zlevel,\n z: 10000\n });\n group.add(mask);\n var textContent = new graphic.Text({\n style: {\n text: opts.text,\n fill: opts.textColor,\n fontSize: opts.fontSize,\n fontWeight: opts.fontWeight,\n fontStyle: opts.fontStyle,\n fontFamily: opts.fontFamily\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n var labelRect = new graphic.Rect({\n style: {\n fill: 'none'\n },\n textContent: textContent,\n textConfig: {\n position: 'right',\n distance: 10\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n group.add(labelRect);\n var arc;\n if (opts.showSpinner) {\n arc = new graphic.Arc({\n shape: {\n startAngle: -PI / 2,\n endAngle: -PI / 2 + 0.1,\n r: opts.spinnerRadius\n },\n style: {\n stroke: opts.color,\n lineCap: 'round',\n lineWidth: opts.lineWidth\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n arc.animateShape(true).when(1000, {\n endAngle: PI * 3 / 2\n }).start('circularInOut');\n arc.animateShape(true).when(1000, {\n startAngle: PI * 3 / 2\n }).delay(300).start('circularInOut');\n group.add(arc);\n }\n // Inject resize\n group.resize = function () {\n var textWidth = textContent.getBoundingRect().width;\n var r = opts.showSpinner ? opts.spinnerRadius : 0;\n // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n // textDistance needs to be calculated when both animation and text exist\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2)\n // only show the text\n + (opts.showSpinner ? 0 : textWidth / 2)\n // only show the spinner\n + (textWidth ? 0 : r);\n var cy = api.getHeight() / 2;\n opts.showSpinner && arc.setShape({\n cx: cx,\n cy: cy\n });\n labelRect.setShape({\n x: cx - r,\n y: cy - r,\n width: r * 2,\n height: r * 2\n });\n mask.setShape({\n x: 0,\n y: 0,\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n group.resize();\n return group;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map, isFunction, createHashMap, noop, assert } from 'zrender/lib/core/util.js';\nimport { createTask } from './task.js';\nimport { getUID } from '../util/component.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport { normalizeToArray } from '../util/model.js';\n;\nvar Scheduler = /** @class */function () {\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\n // key: handlerUID\n this._stageTaskMap = createHashMap();\n this.ecInstance = ecInstance;\n this.api = api;\n // Fix current processors in case that in some rear cases that\n // processors might be registered after echarts instance created.\n // Register processors incrementally for a echarts instance is\n // not supported by this stream architecture.\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\n visualHandlers = this._visualHandlers = visualHandlers.slice();\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\n }\n Scheduler.prototype.restoreData = function (ecModel, payload) {\n // TODO: Only restore needed series and components, but not all components.\n // Currently `restoreData` of all of the series and component will be called.\n // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\n // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\n // and some components like coordinate system, axes, dataZoom, visualMap only\n // need their target series refresh.\n // (1) If we are implementing this feature some day, we should consider these cases:\n // if a data processor depends on a component (e.g., dataZoomProcessor depends\n // on the settings of `dataZoom`), it should be re-performed if the component\n // is modified by `setOption`.\n // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\n // it should be re-performed when the result array of `getTargetSeries` changed.\n // We use `dependencies` to cover these issues.\n // (3) How to update target series when coordinate system related components modified.\n // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\n // and this case all of the tasks will be set as dirty.\n ecModel.restoreData(payload);\n // Theoretically an overall task not only depends on each of its target series, but also\n // depends on all of the series.\n // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\n // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\n // that the overall task is set as dirty and to be performed, otherwise it probably cause\n // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\n // probably cause state chaos (consider `dataZoomProcessor`).\n this._stageTaskMap.each(function (taskRecord) {\n var overallTask = taskRecord.overallTask;\n overallTask && overallTask.dirty();\n });\n };\n // If seriesModel provided, incremental threshold is check by series data.\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\n // For overall task\n if (!task.__pipeline) {\n return;\n }\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\n var pCtx = pipeline.context;\n var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;\n var step = incremental ? pipeline.step : null;\n var modDataCount = pCtx && pCtx.modDataCount;\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\n return {\n step: step,\n modBy: modBy,\n modDataCount: modDataCount\n };\n };\n Scheduler.prototype.getPipeline = function (pipelineId) {\n return this._pipelineMap.get(pipelineId);\n };\n /**\n * Current, progressive rendering starts from visual and layout.\n * Always detect render mode in the same stage, avoiding that incorrect\n * detection caused by data filtering.\n * Caution:\n * `updateStreamModes` use `seriesModel.getData()`.\n */\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\n var pipeline = this._pipelineMap.get(seriesModel.uid);\n var data = seriesModel.getData();\n var dataLen = data.count();\n // `progressiveRender` means that can render progressively in each\n // animation frame. Note that some types of series do not provide\n // `view.incrementalPrepareRender` but support `chart.appendData`. We\n // use the term `incremental` but not `progressive` to describe the\n // case that `chart.appendData`.\n var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\n // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\n // see `test/candlestick-large3.html`\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\n seriesModel.pipelineContext = pipeline.context = {\n progressiveRender: progressiveRender,\n modDataCount: modDataCount,\n large: large\n };\n };\n Scheduler.prototype.restorePipelines = function (ecModel) {\n var scheduler = this;\n var pipelineMap = scheduler._pipelineMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var progressive = seriesModel.getProgressive();\n var pipelineId = seriesModel.uid;\n pipelineMap.set(pipelineId, {\n id: pipelineId,\n head: null,\n tail: null,\n threshold: seriesModel.getProgressiveThreshold(),\n progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\n blockIndex: -1,\n step: Math.round(progressive || 700),\n count: 0\n });\n scheduler._pipe(seriesModel, seriesModel.dataTask);\n });\n };\n Scheduler.prototype.prepareStageTasks = function () {\n var stageTaskMap = this._stageTaskMap;\n var ecModel = this.api.getModel();\n var api = this.api;\n each(this._allHandlers, function (handler) {\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n // Currently do not need to support to sepecify them both.\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\n }\n assert(!(handler.reset && handler.overallReset), errMsg);\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\n }, this);\n };\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\n var renderTask = view.renderTask;\n var context = renderTask.context;\n context.model = model;\n context.ecModel = ecModel;\n context.api = api;\n renderTask.__block = !view.incrementalPrepareRender;\n this._pipe(model, renderTask);\n };\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\n // If we do not use `block` here, it should be considered when to update modes.\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {\n block: true\n });\n };\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\n };\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\n opt = opt || {};\n var unfinished = false;\n var scheduler = this;\n each(stageHandlers, function (stageHandler, idx) {\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\n return;\n }\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\n var overallTask = stageHandlerRecord.overallTask;\n if (overallTask) {\n var overallNeedDirty_1;\n var agentStubMap = overallTask.agentStubMap;\n agentStubMap.each(function (stub) {\n if (needSetDirty(opt, stub)) {\n stub.dirty();\n overallNeedDirty_1 = true;\n }\n });\n overallNeedDirty_1 && overallTask.dirty();\n scheduler.updatePayload(overallTask, payload);\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);\n // Execute stubs firstly, which may set the overall task dirty,\n // then execute the overall task. And stub will call seriesModel.setData,\n // which ensures that in the overallTask seriesModel.getData() will not\n // return incorrect data.\n agentStubMap.each(function (stub) {\n stub.perform(performArgs_1);\n });\n if (overallTask.perform(performArgs_1)) {\n unfinished = true;\n }\n } else if (seriesTaskMap) {\n seriesTaskMap.each(function (task, pipelineId) {\n if (needSetDirty(opt, task)) {\n task.dirty();\n }\n var performArgs = scheduler.getPerformArgs(task, opt.block);\n // FIXME\n // if intending to declare `performRawSeries` in handlers, only\n // stream-independent (specifically, data item independent) operations can be\n // performed. Because if a series is filtered, most of the tasks will not\n // be performed. A stream-dependent operation probably cause wrong biz logic.\n // Perhaps we should not provide a separate callback for this case instead\n // of providing the config `performRawSeries`. The stream-dependent operations\n // and stream-independent operations should better not be mixed.\n performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);\n scheduler.updatePayload(task, payload);\n if (task.perform(performArgs)) {\n unfinished = true;\n }\n });\n }\n });\n function needSetDirty(opt, task) {\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\n }\n this.unfinished = unfinished || this.unfinished;\n };\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n // Progress to the end for dataInit and dataRestore.\n unfinished = seriesModel.dataTask.perform() || unfinished;\n });\n this.unfinished = unfinished || this.unfinished;\n };\n Scheduler.prototype.plan = function () {\n // Travel pipelines, check block.\n this._pipelineMap.each(function (pipeline) {\n var task = pipeline.tail;\n do {\n if (task.__block) {\n pipeline.blockIndex = task.__idxInPipeline;\n break;\n }\n task = task.getUpstream();\n } while (task);\n });\n };\n Scheduler.prototype.updatePayload = function (task, payload) {\n payload !== 'remain' && (task.context.payload = payload);\n };\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\n // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries;\n // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\n // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\n // it works but it may cause other irrelevant charts blocked.\n if (stageHandler.createOnAllSeries) {\n ecModel.eachRawSeries(create);\n } else if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, create);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(create);\n }\n function create(seriesModel) {\n var pipelineId = seriesModel.uid;\n // Init tasks for each seriesModel only once.\n // Reuse original task instance.\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({\n plan: seriesTaskPlan,\n reset: seriesTaskReset,\n count: seriesTaskCount\n }));\n task.context = {\n model: seriesModel,\n ecModel: ecModel,\n api: api,\n // PENDING: `useClearVisual` not used?\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\n plan: stageHandler.plan,\n reset: stageHandler.reset,\n scheduler: scheduler\n };\n scheduler._pipe(seriesModel, task);\n }\n };\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\n // For overall task, the function only be called on reset stage.\n || createTask({\n reset: overallTaskReset\n });\n overallTask.context = {\n ecModel: ecModel,\n api: api,\n overallReset: stageHandler.overallReset,\n scheduler: scheduler\n };\n var oldAgentStubMap = overallTask.agentStubMap;\n // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries;\n var overallProgress = true;\n var shouldOverallTaskDirty = false;\n // FIXME:TS never used, so comment it\n // let modifyOutputEnd = stageHandler.modifyOutputEnd;\n // An overall task with seriesType detected or has `getTargetSeries`, we add\n // stub in each pipelines, it will set the overall task dirty when the pipeline\n // progress. Moreover, to avoid call the overall task each frame (too frequent),\n // we set the pipeline block.\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '\"createOnAllSeries\" is not supported for \"overallReset\", ' + 'because it will block all streams.';\n }\n assert(!stageHandler.createOnAllSeries, errMsg);\n if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, createStub);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(createStub);\n }\n // Otherwise, (usually it is legacy case), the overall task will only be\n // executed when upstream is dirty. Otherwise the progressive rendering of all\n // pipelines will be disabled unexpectedly. But it still needs stubs to receive\n // dirty info from upstream.\n else {\n overallProgress = false;\n each(ecModel.getSeries(), createStub);\n }\n function createStub(seriesModel) {\n var pipelineId = seriesModel.uid;\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || (\n // When the result of `getTargetSeries` changed, the overallTask\n // should be set as dirty and re-performed.\n shouldOverallTaskDirty = true, createTask({\n reset: stubReset,\n onDirty: stubOnDirty\n })));\n stub.context = {\n model: seriesModel,\n overallProgress: overallProgress\n // FIXME:TS never used, so comment it\n // modifyOutputEnd: modifyOutputEnd\n };\n\n stub.agent = overallTask;\n stub.__block = overallProgress;\n scheduler._pipe(seriesModel, stub);\n }\n if (shouldOverallTaskDirty) {\n overallTask.dirty();\n }\n };\n Scheduler.prototype._pipe = function (seriesModel, task) {\n var pipelineId = seriesModel.uid;\n var pipeline = this._pipelineMap.get(pipelineId);\n !pipeline.head && (pipeline.head = task);\n pipeline.tail && pipeline.tail.pipe(task);\n pipeline.tail = task;\n task.__idxInPipeline = pipeline.count++;\n task.__pipeline = pipeline;\n };\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\n if (isFunction(stageHandler)) {\n stageHandler = {\n overallReset: stageHandler,\n seriesType: detectSeriseType(stageHandler)\n };\n }\n stageHandler.uid = getUID('stageHandler');\n visualType && (stageHandler.visualType = visualType);\n return stageHandler;\n };\n ;\n return Scheduler;\n}();\nfunction overallTaskReset(context) {\n context.overallReset(context.ecModel, context.api, context.payload);\n}\nfunction stubReset(context) {\n return context.overallProgress && stubProgress;\n}\nfunction stubProgress() {\n this.agent.dirty();\n this.getDownstream().dirty();\n}\nfunction stubOnDirty() {\n this.agent && this.agent.dirty();\n}\nfunction seriesTaskPlan(context) {\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\n}\nfunction seriesTaskReset(context) {\n if (context.useClearVisual) {\n context.data.clearAllVisual();\n }\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\n return resetDefines.length > 1 ? map(resetDefines, function (v, idx) {\n return makeSeriesTaskProgress(idx);\n }) : singleSeriesTaskProgress;\n}\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\nfunction makeSeriesTaskProgress(resetDefineIdx) {\n return function (params, context) {\n var data = context.data;\n var resetDefine = context.resetDefines[resetDefineIdx];\n if (resetDefine && resetDefine.dataEach) {\n for (var i = params.start; i < params.end; i++) {\n resetDefine.dataEach(data, i);\n }\n } else if (resetDefine && resetDefine.progress) {\n resetDefine.progress(params, data);\n }\n };\n}\nfunction seriesTaskCount(context) {\n return context.data.count();\n}\n/**\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\n * To ensure that they can work normally, they should work in block mode, that is,\n * they should not be started util the previous tasks finished. So they cause the\n * progressive rendering disabled. We try to detect the series type, to narrow down\n * the block range to only the series type they concern, but not all series.\n */\nfunction detectSeriseType(legacyFunc) {\n seriesType = null;\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n return seriesType;\n}\nvar ecModelMock = {};\nvar apiMock = {};\nvar seriesType;\nmockMethods(ecModelMock, GlobalModel);\nmockMethods(apiMock, ExtensionAPI);\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\n seriesType = type;\n};\necModelMock.eachComponent = function (cond) {\n if (cond.mainType === 'series' && cond.subType) {\n seriesType = cond.subType;\n }\n};\nfunction mockMethods(target, Clz) {\n /* eslint-disable */\n for (var name_1 in Clz.prototype) {\n // Do not use hasOwnProperty\n target[name_1] = noop;\n }\n /* eslint-enable */\n}\n\nexport default Scheduler;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'];\nexport default {\n color: colorAll,\n colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll]\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar contrastColor = '#B9B8CE';\nvar backgroundColor = '#100C2A';\nvar axisCommon = function () {\n return {\n axisLine: {\n lineStyle: {\n color: contrastColor\n }\n },\n splitLine: {\n lineStyle: {\n color: '#484753'\n }\n },\n splitArea: {\n areaStyle: {\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\n }\n },\n minorSplitLine: {\n lineStyle: {\n color: '#20203B'\n }\n }\n };\n};\nvar colorPalette = ['#4992ff', '#7cffb2', '#fddd60', '#ff6e76', '#58d9f9', '#05c091', '#ff8a45', '#8d48e3', '#dd79ff'];\nvar theme = {\n darkMode: true,\n color: colorPalette,\n backgroundColor: backgroundColor,\n axisPointer: {\n lineStyle: {\n color: '#817f91'\n },\n crossStyle: {\n color: '#817f91'\n },\n label: {\n // TODO Contrast of label backgorundColor\n color: '#fff'\n }\n },\n legend: {\n textStyle: {\n color: contrastColor\n }\n },\n textStyle: {\n color: contrastColor\n },\n title: {\n textStyle: {\n color: '#EEF1FA'\n },\n subtextStyle: {\n color: '#B9B8CE'\n }\n },\n toolbox: {\n iconStyle: {\n borderColor: contrastColor\n }\n },\n dataZoom: {\n borderColor: '#71708A',\n textStyle: {\n color: contrastColor\n },\n brushStyle: {\n color: 'rgba(135,163,206,0.3)'\n },\n handleStyle: {\n color: '#353450',\n borderColor: '#C5CBE3'\n },\n moveHandleStyle: {\n color: '#B0B6C3',\n opacity: 0.3\n },\n fillerColor: 'rgba(135,163,206,0.2)',\n emphasis: {\n handleStyle: {\n borderColor: '#91B7F2',\n color: '#4D587D'\n },\n moveHandleStyle: {\n color: '#636D9A',\n opacity: 0.7\n }\n },\n dataBackground: {\n lineStyle: {\n color: '#71708A',\n width: 1\n },\n areaStyle: {\n color: '#71708A'\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#87A3CE'\n },\n areaStyle: {\n color: '#87A3CE'\n }\n }\n },\n visualMap: {\n textStyle: {\n color: contrastColor\n }\n },\n timeline: {\n lineStyle: {\n color: contrastColor\n },\n label: {\n color: contrastColor\n },\n controlStyle: {\n color: contrastColor,\n borderColor: contrastColor\n }\n },\n calendar: {\n itemStyle: {\n color: backgroundColor\n },\n dayLabel: {\n color: contrastColor\n },\n monthLabel: {\n color: contrastColor\n },\n yearLabel: {\n color: contrastColor\n }\n },\n timeAxis: axisCommon(),\n logAxis: axisCommon(),\n valueAxis: axisCommon(),\n categoryAxis: axisCommon(),\n line: {\n symbol: 'circle'\n },\n graph: {\n color: colorPalette\n },\n gauge: {\n title: {\n color: contrastColor\n },\n axisLine: {\n lineStyle: {\n color: [[1, 'rgba(207,212,219,0.2)']]\n }\n },\n axisLabel: {\n color: contrastColor\n },\n detail: {\n color: '#EEF1FA'\n }\n },\n candlestick: {\n itemStyle: {\n color: '#f64e56',\n color0: '#54ea92',\n borderColor: '#f64e56',\n borderColor0: '#54ea92'\n // borderColor: '#ca2824',\n // borderColor0: '#09a443'\n }\n }\n};\n\ntheme.categoryAxis.splitLine.show = false;\nexport default theme;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\n/**\n * Usage of query:\n * `chart.on('click', query, handler);`\n * The `query` can be:\n * + The component type query string, only `mainType` or `mainType.subType`,\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\n * + The component query object, like:\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\n * + The data query object, like:\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\n * + The other query object (cmponent customized query), like:\n * `{element: 'some'}` (only available in custom series).\n *\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\n * same as there is no such prop in the `query` object.\n */\nvar ECEventProcessor = /** @class */function () {\n function ECEventProcessor() {}\n ECEventProcessor.prototype.normalizeQuery = function (query) {\n var cptQuery = {};\n var dataQuery = {};\n var otherQuery = {};\n // `query` is `mainType` or `mainType.subType` of component.\n if (zrUtil.isString(query)) {\n var condCptType = parseClassType(query);\n // `.main` and `.sub` may be ''.\n cptQuery.mainType = condCptType.main || null;\n cptQuery.subType = condCptType.sub || null;\n }\n // `query` is an object, convert to {mainType, index, name, id}.\n else {\n // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n // can not be used in `compomentModel.filterForExposedEvent`.\n var suffixes_1 = ['Index', 'Name', 'Id'];\n var dataKeys_1 = {\n name: 1,\n dataIndex: 1,\n dataType: 1\n };\n zrUtil.each(query, function (val, key) {\n var reserved = false;\n for (var i = 0; i < suffixes_1.length; i++) {\n var propSuffix = suffixes_1[i];\n var suffixPos = key.lastIndexOf(propSuffix);\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\n var mainType = key.slice(0, suffixPos);\n // Consider `dataIndex`.\n if (mainType !== 'data') {\n cptQuery.mainType = mainType;\n cptQuery[propSuffix.toLowerCase()] = val;\n reserved = true;\n }\n }\n }\n if (dataKeys_1.hasOwnProperty(key)) {\n dataQuery[key] = val;\n reserved = true;\n }\n if (!reserved) {\n otherQuery[key] = val;\n }\n });\n }\n return {\n cptQuery: cptQuery,\n dataQuery: dataQuery,\n otherQuery: otherQuery\n };\n };\n ECEventProcessor.prototype.filter = function (eventType, query) {\n // They should be assigned before each trigger call.\n var eventInfo = this.eventInfo;\n if (!eventInfo) {\n return true;\n }\n var targetEl = eventInfo.targetEl;\n var packedEvent = eventInfo.packedEvent;\n var model = eventInfo.model;\n var view = eventInfo.view;\n // For event like 'globalout'.\n if (!model || !view) {\n return true;\n }\n var cptQuery = query.cptQuery;\n var dataQuery = query.dataQuery;\n return check(cptQuery, model, 'mainType') && check(cptQuery, model, 'subType') && check(cptQuery, model, 'index', 'componentIndex') && check(cptQuery, model, 'name') && check(cptQuery, model, 'id') && check(dataQuery, packedEvent, 'name') && check(dataQuery, packedEvent, 'dataIndex') && check(dataQuery, packedEvent, 'dataType') && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));\n function check(query, host, prop, propOnHost) {\n return query[prop] == null || host[propOnHost || prop] === query[prop];\n }\n };\n ECEventProcessor.prototype.afterTrigger = function () {\n // Make sure the eventInfo won't be used in next trigger.\n this.eventInfo = null;\n };\n return ECEventProcessor;\n}();\nexport { ECEventProcessor };\n;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, isFunction, keys } from 'zrender/lib/core/util.js';\nvar SYMBOL_PROPS_WITH_CB = ['symbol', 'symbolSize', 'symbolRotate', 'symbolOffset'];\nvar SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat(['symbolKeepAspect']);\n// Encoding visual for all series include which is filtered for legend drawing\nvar seriesSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n if (seriesModel.legendIcon) {\n data.setVisual('legendIcon', seriesModel.legendIcon);\n }\n if (!seriesModel.hasSymbolVisual) {\n return;\n }\n var symbolOptions = {};\n var symbolOptionsCb = {};\n var hasCallback = false;\n for (var i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) {\n var symbolPropName = SYMBOL_PROPS_WITH_CB[i];\n var val = seriesModel.get(symbolPropName);\n if (isFunction(val)) {\n hasCallback = true;\n symbolOptionsCb[symbolPropName] = val;\n } else {\n symbolOptions[symbolPropName] = val;\n }\n }\n symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol;\n data.setVisual(extend({\n legendIcon: seriesModel.legendIcon || symbolOptions.symbol,\n symbolKeepAspect: seriesModel.get('symbolKeepAspect')\n }, symbolOptions));\n // Only visible series has each data be visual encoded\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n var symbolPropsCb = keys(symbolOptionsCb);\n function dataEach(data, idx) {\n var rawValue = seriesModel.getRawValue(idx);\n var params = seriesModel.getDataParams(idx);\n for (var i = 0; i < symbolPropsCb.length; i++) {\n var symbolPropName = symbolPropsCb[i];\n data.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params));\n }\n }\n return {\n dataEach: hasCallback ? dataEach : null\n };\n }\n};\nvar dataSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (!seriesModel.hasSymbolVisual) {\n return;\n }\n // Only visible series has each data be visual encoded\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n var data = seriesModel.getData();\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n for (var i = 0; i < SYMBOL_PROPS.length; i++) {\n var symbolPropName = SYMBOL_PROPS[i];\n var val = itemModel.getShallow(symbolPropName, true);\n if (val != null) {\n data.setItemVisual(idx, symbolPropName, val);\n }\n }\n }\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport { seriesSymbolTask, dataSymbolTask };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function getItemVisualFromData(data, dataIndex, key) {\n switch (key) {\n case 'color':\n var style = data.getItemVisual(dataIndex, 'style');\n return style[data.getVisual('drawType')];\n case 'opacity':\n return data.getItemVisual(dataIndex, 'style').opacity;\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getItemVisual(dataIndex, key);\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n }\n}\nexport function getVisualFromData(data, key) {\n switch (key) {\n case 'color':\n var style = data.getVisual('style');\n return style[data.getVisual('drawType')];\n case 'opacity':\n return data.getVisual('style').opacity;\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getVisual(key);\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n }\n}\nexport function setItemVisualFromData(data, dataIndex, key, value) {\n switch (key) {\n case 'color':\n // Make sure not sharing style object.\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\n style[data.getVisual('drawType')] = value;\n // Mark the color has been changed, not from palette anymore\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\n break;\n case 'opacity':\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\n break;\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n data.setItemVisual(dataIndex, key, value);\n break;\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, each, isArray, isString } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog, deprecateLog } from '../util/log.js';\nimport { queryDataIndex } from '../util/model.js';\n// Legacy data selection action.\n// Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect\nexport function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\n function getSeriesIndices(ecModel, payload) {\n var seriesIndices = [];\n ecModel.eachComponent({\n mainType: 'series',\n subType: seriesType,\n query: payload\n }, function (seriesModel) {\n seriesIndices.push(seriesModel.seriesIndex);\n });\n return seriesIndices;\n }\n each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) {\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\n payload = extend({}, payload);\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(payload.type, eventsMap[1]);\n }\n api.dispatchAction(extend(payload, {\n type: eventsMap[1],\n seriesIndex: getSeriesIndices(ecModel, payload)\n }));\n });\n });\n}\nfunction handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\n var legacyEventName = type + eventPostfix;\n if (!ecIns.isSilent(legacyEventName)) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\n }\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'pie'\n }, function (seriesModel) {\n var seriesIndex = seriesModel.seriesIndex;\n var selectedMap = seriesModel.option.selectedMap;\n var selected = payload.selected;\n for (var i = 0; i < selected.length; i++) {\n if (selected[i].seriesIndex === seriesIndex) {\n var data = seriesModel.getData();\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\n ecIns.trigger(legacyEventName, {\n type: legacyEventName,\n seriesId: seriesModel.id,\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\n selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap)\n });\n }\n }\n });\n }\n}\nexport function handleLegacySelectEvents(messageCenter, ecIns, api) {\n messageCenter.on('selectchanged', function (params) {\n var ecModel = api.getModel();\n if (params.isFromClick) {\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\n } else if (params.fromAction === 'select') {\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\n } else if (params.fromAction === 'unselect') {\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function findEventDispatcher(target, det, returnFirstMatch) {\n var found;\n while (target) {\n if (det(target)) {\n found = target;\n if (returnFirstMatch) {\n break;\n }\n }\n target = target.__hostTarget || target.parent;\n }\n return found;\n}","var wmUniqueIndex = Math.round(Math.random() * 9);\nvar supportDefineProperty = typeof Object.defineProperty === 'function';\nvar WeakMap = (function () {\n function WeakMap() {\n this._id = '__ec_inner_' + wmUniqueIndex++;\n }\n WeakMap.prototype.get = function (key) {\n return this._guard(key)[this._id];\n };\n WeakMap.prototype.set = function (key, value) {\n var target = this._guard(key);\n if (supportDefineProperty) {\n Object.defineProperty(target, this._id, {\n value: value,\n enumerable: false,\n configurable: true\n });\n }\n else {\n target[this._id] = value;\n }\n return this;\n };\n WeakMap.prototype[\"delete\"] = function (key) {\n if (this.has(key)) {\n delete this._guard(key)[this._id];\n return true;\n }\n return false;\n };\n WeakMap.prototype.has = function (key) {\n return !!this._guard(key)[this._id];\n };\n WeakMap.prototype._guard = function (key) {\n if (key !== Object(key)) {\n throw TypeError('Value of WeakMap is not a non-null object.');\n }\n return key;\n };\n return WeakMap;\n}());\nexport default WeakMap;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Symbol factory\nimport { each, isArray, retrieve2 } from 'zrender/lib/core/util.js';\nimport * as graphic from './graphic.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { parsePercent } from './number.js';\n/**\n * Triangle shape\n * @inner\n */\nvar Triangle = graphic.Path.extend({\n type: 'triangle',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy + height);\n path.lineTo(cx - width, cy + height);\n path.closePath();\n }\n});\n/**\n * Diamond shape\n * @inner\n */\nvar Diamond = graphic.Path.extend({\n type: 'diamond',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy);\n path.lineTo(cx, cy + height);\n path.lineTo(cx - width, cy);\n path.closePath();\n }\n});\n/**\n * Pin shape\n * @inner\n */\nvar Pin = graphic.Path.extend({\n type: 'pin',\n shape: {\n // x, y on the cusp\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var x = shape.x;\n var y = shape.y;\n var w = shape.width / 5 * 3;\n // Height must be larger than width\n var h = Math.max(w, shape.height);\n var r = w / 2;\n // Dist on y with tangent point and circle center\n var dy = r * r / (h - r);\n var cy = y - h + r + dy;\n var angle = Math.asin(dy / r);\n // Dist on x with tangent point and circle center\n var dx = Math.cos(angle) * r;\n var tanX = Math.sin(angle);\n var tanY = Math.cos(angle);\n var cpLen = r * 0.6;\n var cpLen2 = r * 0.7;\n path.moveTo(x - dx, cy + dy);\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\n path.closePath();\n }\n});\n/**\n * Arrow shape\n * @inner\n */\nvar Arrow = graphic.Path.extend({\n type: 'arrow',\n shape: {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var height = shape.height;\n var width = shape.width;\n var x = shape.x;\n var y = shape.y;\n var dx = width / 3 * 2;\n ctx.moveTo(x, y);\n ctx.lineTo(x + dx, y + height);\n ctx.lineTo(x, y + height / 4 * 3);\n ctx.lineTo(x - dx, y + height);\n ctx.lineTo(x, y);\n ctx.closePath();\n }\n});\n/**\n * Map of path constructors\n */\n// TODO Use function to build symbol path.\nvar symbolCtors = {\n line: graphic.Line,\n rect: graphic.Rect,\n roundRect: graphic.Rect,\n square: graphic.Rect,\n circle: graphic.Circle,\n diamond: Diamond,\n pin: Pin,\n arrow: Arrow,\n triangle: Triangle\n};\nvar symbolShapeMakers = {\n line: function (x, y, w, h, shape) {\n shape.x1 = x;\n shape.y1 = y + h / 2;\n shape.x2 = x + w;\n shape.y2 = y + h / 2;\n },\n rect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n },\n roundRect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n shape.r = Math.min(w, h) / 4;\n },\n square: function (x, y, w, h, shape) {\n var size = Math.min(w, h);\n shape.x = x;\n shape.y = y;\n shape.width = size;\n shape.height = size;\n },\n circle: function (x, y, w, h, shape) {\n // Put circle in the center of square\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.r = Math.min(w, h) / 2;\n },\n diamond: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n pin: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n arrow: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n triangle: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n }\n};\nexport var symbolBuildProxies = {};\neach(symbolCtors, function (Ctor, name) {\n symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.Path.extend({\n type: 'symbol',\n shape: {\n symbolType: '',\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n calculateTextPosition: function (out, config, rect) {\n var res = calculateTextPosition(out, config, rect);\n var shape = this.shape;\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\n res.y = rect.y + rect.height * 0.4;\n }\n return res;\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n if (symbolType !== 'none') {\n var proxySymbol = symbolBuildProxies[symbolType];\n if (!proxySymbol) {\n // Default rect\n symbolType = 'rect';\n proxySymbol = symbolBuildProxies[symbolType];\n }\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\n }\n }\n});\n// Provide setColor helper method to avoid determine if set the fill or stroke outside\nfunction symbolPathSetColor(color, innerColor) {\n if (this.type !== 'image') {\n var symbolStyle = this.style;\n if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff';\n // TODO Same width with lineStyle in LineView\n symbolStyle.lineWidth = 2;\n } else if (this.shape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else {\n symbolStyle.fill = color;\n }\n this.markRedraw();\n }\n}\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n */\nexport function createSymbol(symbolType, x, y, w, h, color,\n// whether to keep the ratio of w/h,\nkeepAspect) {\n // TODO Support image object, DynamicImage.\n var isEmpty = symbolType.indexOf('empty') === 0;\n if (isEmpty) {\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n }\n var symbolPath;\n if (symbolType.indexOf('image://') === 0) {\n symbolPath = graphic.makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else if (symbolType.indexOf('path://') === 0) {\n symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else {\n symbolPath = new SymbolClz({\n shape: {\n symbolType: symbolType,\n x: x,\n y: y,\n width: w,\n height: h\n }\n });\n }\n symbolPath.__isEmptyBrush = isEmpty;\n // TODO Should deprecate setColor\n symbolPath.setColor = symbolPathSetColor;\n if (color) {\n symbolPath.setColor(color);\n }\n return symbolPath;\n}\nexport function normalizeSymbolSize(symbolSize) {\n if (!isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n return [symbolSize[0] || 0, symbolSize[1] || 0];\n}\nexport function normalizeSymbolOffset(symbolOffset, symbolSize) {\n if (symbolOffset == null) {\n return;\n }\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n return [parsePercent(symbolOffset[0], symbolSize[0]) || 0, parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0];\n}","function isSafeNum(num) {\n return isFinite(num);\n}\nexport function createLinearGradient(ctx, obj, rect) {\n var x = obj.x == null ? 0 : obj.x;\n var x2 = obj.x2 == null ? 1 : obj.x2;\n var y = obj.y == null ? 0 : obj.y;\n var y2 = obj.y2 == null ? 0 : obj.y2;\n if (!obj.global) {\n x = x * rect.width + rect.x;\n x2 = x2 * rect.width + rect.x;\n y = y * rect.height + rect.y;\n y2 = y2 * rect.height + rect.y;\n }\n x = isSafeNum(x) ? x : 0;\n x2 = isSafeNum(x2) ? x2 : 1;\n y = isSafeNum(y) ? y : 0;\n y2 = isSafeNum(y2) ? y2 : 0;\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n return canvasGradient;\n}\nexport function createRadialGradient(ctx, obj, rect) {\n var width = rect.width;\n var height = rect.height;\n var min = Math.min(width, height);\n var x = obj.x == null ? 0.5 : obj.x;\n var y = obj.y == null ? 0.5 : obj.y;\n var r = obj.r == null ? 0.5 : obj.r;\n if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n x = isSafeNum(x) ? x : 0.5;\n y = isSafeNum(y) ? y : 0.5;\n r = r >= 0 && isSafeNum(r) ? r : 0.5;\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n return canvasGradient;\n}\nexport function getCanvasGradient(ctx, obj, rect) {\n var canvasGradient = obj.type === 'radial'\n ? createRadialGradient(ctx, obj, rect)\n : createLinearGradient(ctx, obj, rect);\n var colorStops = obj.colorStops;\n for (var i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n }\n return canvasGradient;\n}\nexport function isClipPathChanged(clipPaths, prevClipPaths) {\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\n return false;\n }\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\n return true;\n }\n for (var i = 0; i < clipPaths.length; i++) {\n if (clipPaths[i] !== prevClipPaths[i]) {\n return true;\n }\n }\n return false;\n}\nfunction parseInt10(val) {\n return parseInt(val, 10);\n}\nexport function getSize(root, whIdx, opts) {\n var wh = ['width', 'height'][whIdx];\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\n if (opts[wh] != null && opts[wh] !== 'auto') {\n return parseFloat(opts[wh]);\n }\n var stl = document.defaultView.getComputedStyle(root);\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\n - (parseInt10(stl[plt]) || 0)\n - (parseInt10(stl[prb]) || 0)) | 0;\n}\n","import { isArray, isNumber, map } from '../core/util.js';\nexport function normalizeLineDash(lineType, lineWidth) {\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\n return null;\n }\n return lineType === 'dashed'\n ? [4 * lineWidth, 2 * lineWidth]\n : lineType === 'dotted'\n ? [lineWidth]\n : isNumber(lineType)\n ? [lineType] : isArray(lineType) ? lineType : null;\n}\nexport function getLineDash(el) {\n var style = el.style;\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\n var lineDashOffset = style.lineDashOffset;\n if (lineDash) {\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\n if (lineScale_1 && lineScale_1 !== 1) {\n lineDash = map(lineDash, function (rawVal) {\n return rawVal / lineScale_1;\n });\n lineDashOffset /= lineScale_1;\n }\n }\n return [lineDash, lineDashOffset];\n}\n","import { DEFAULT_COMMON_STYLE } from '../graphic/Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { createOrUpdateImage, isImageReady } from '../graphic/helper/image.js';\nimport { getCanvasGradient, isClipPathChanged } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { RADIAN_TO_DEGREE } from '../core/util.js';\nimport { getLineDash } from './dashStyle.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT } from '../graphic/constants.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nvar pathProxyForDraw = new PathProxy(true);\nfunction styleHasStroke(style) {\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n}\nfunction isValidStrokeFillStyle(strokeOrFill) {\n return typeof strokeOrFill === 'string' && strokeOrFill !== 'none';\n}\nfunction styleHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== 'none';\n}\nfunction doFillPath(ctx, style) {\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.fill();\n }\n}\nfunction doStrokePath(ctx, style) {\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.stroke();\n }\n}\nexport function createCanvasPattern(ctx, pattern, el) {\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\n if (isImageReady(image)) {\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\n if (typeof DOMMatrix === 'function'\n && canvasPattern\n && canvasPattern.setTransform) {\n var matrix = new DOMMatrix();\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE);\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\n canvasPattern.setTransform(matrix);\n }\n return canvasPattern;\n }\n}\nfunction brushPath(ctx, el, style, inBatch) {\n var _a;\n var hasStroke = styleHasStroke(style);\n var hasFill = styleHasFill(style);\n var strokePercent = style.strokePercent;\n var strokePart = strokePercent < 1;\n var firstDraw = !el.path;\n if ((!el.silent || strokePart) && firstDraw) {\n el.createPathProxy();\n }\n var path = el.path || pathProxyForDraw;\n var dirtyFlag = el.__dirty;\n if (!inBatch) {\n var fill = style.fill;\n var stroke = style.stroke;\n var hasFillGradient = hasFill && !!fill.colorStops;\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\n var hasFillPattern = hasFill && !!fill.image;\n var hasStrokePattern = hasStroke && !!stroke.image;\n var fillGradient = void 0;\n var strokeGradient = void 0;\n var fillPattern = void 0;\n var strokePattern = void 0;\n var rect = void 0;\n if (hasFillGradient || hasStrokeGradient) {\n rect = el.getBoundingRect();\n }\n if (hasFillGradient) {\n fillGradient = dirtyFlag\n ? getCanvasGradient(ctx, fill, rect)\n : el.__canvasFillGradient;\n el.__canvasFillGradient = fillGradient;\n }\n if (hasStrokeGradient) {\n strokeGradient = dirtyFlag\n ? getCanvasGradient(ctx, stroke, rect)\n : el.__canvasStrokeGradient;\n el.__canvasStrokeGradient = strokeGradient;\n }\n if (hasFillPattern) {\n fillPattern = (dirtyFlag || !el.__canvasFillPattern)\n ? createCanvasPattern(ctx, fill, el)\n : el.__canvasFillPattern;\n el.__canvasFillPattern = fillPattern;\n }\n if (hasStrokePattern) {\n strokePattern = (dirtyFlag || !el.__canvasStrokePattern)\n ? createCanvasPattern(ctx, stroke, el)\n : el.__canvasStrokePattern;\n el.__canvasStrokePattern = fillPattern;\n }\n if (hasFillGradient) {\n ctx.fillStyle = fillGradient;\n }\n else if (hasFillPattern) {\n if (fillPattern) {\n ctx.fillStyle = fillPattern;\n }\n else {\n hasFill = false;\n }\n }\n if (hasStrokeGradient) {\n ctx.strokeStyle = strokeGradient;\n }\n else if (hasStrokePattern) {\n if (strokePattern) {\n ctx.strokeStyle = strokePattern;\n }\n else {\n hasStroke = false;\n }\n }\n }\n var scale = el.getGlobalScale();\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\n var lineDash;\n var lineDashOffset;\n if (ctx.setLineDash && style.lineDash) {\n _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n }\n var needsRebuild = true;\n if (firstDraw || (dirtyFlag & SHAPE_CHANGED_BIT)) {\n path.setDPR(ctx.dpr);\n if (strokePart) {\n path.setContext(null);\n }\n else {\n path.setContext(ctx);\n needsRebuild = false;\n }\n path.reset();\n el.buildPath(path, el.shape, inBatch);\n path.toStatic();\n el.pathUpdated();\n }\n if (needsRebuild) {\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\n }\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n if (!inBatch) {\n if (style.strokeFirst) {\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n if (hasFill) {\n doFillPath(ctx, style);\n }\n }\n else {\n if (hasFill) {\n doFillPath(ctx, style);\n }\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n }\n }\n if (lineDash) {\n ctx.setLineDash([]);\n }\n}\nfunction brushImage(ctx, el, style) {\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\n if (!image || !isImageReady(image)) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var width = el.getWidth();\n var height = el.getHeight();\n var aspect = image.width / image.height;\n if (width == null && height != null) {\n width = height * aspect;\n }\n else if (height == null && width != null) {\n height = width / aspect;\n }\n else if (width == null && height == null) {\n width = image.width;\n height = image.height;\n }\n if (style.sWidth && style.sHeight) {\n var sx = style.sx || 0;\n var sy = style.sy || 0;\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\n }\n else if (style.sx && style.sy) {\n var sx = style.sx;\n var sy = style.sy;\n var sWidth = width - sx;\n var sHeight = height - sy;\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\n }\n else {\n ctx.drawImage(image, x, y, width, height);\n }\n}\nfunction brushText(ctx, el, style) {\n var _a;\n var text = style.text;\n text != null && (text += '');\n if (text) {\n ctx.font = style.font || DEFAULT_FONT;\n ctx.textAlign = style.textAlign;\n ctx.textBaseline = style.textBaseline;\n var lineDash = void 0;\n var lineDashOffset = void 0;\n if (ctx.setLineDash && style.lineDash) {\n _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n }\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n if (style.strokeFirst) {\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n }\n else {\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n }\n if (lineDash) {\n ctx.setLineDash([]);\n }\n }\n}\nvar SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\nvar STROKE_PROPS = [\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\n];\nfunction bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\n var styleChanged = false;\n if (!forceSetAll) {\n prevStyle = prevStyle || {};\n if (style === prevStyle) {\n return false;\n }\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n var opacity = Math.max(Math.min(style.opacity, 1), 0);\n ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity;\n }\n if (forceSetAll || style.blend !== prevStyle.blend) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\n }\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\n var propName = SHADOW_NUMBER_PROPS[i];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = ctx.dpr * (style[propName] || 0);\n }\n }\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\n }\n return styleChanged;\n}\nfunction bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\n var style = getStyle(el, scope.inHover);\n var prevStyle = forceSetAll\n ? null\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\n if (style === prevStyle) {\n return false;\n }\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\n if (forceSetAll || style.fill !== prevStyle.fill) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);\n }\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n if (el.hasStroke()) {\n var lineWidth = style.lineWidth;\n var newLineWidth = lineWidth / ((style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1);\n if (ctx.lineWidth !== newLineWidth) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.lineWidth = newLineWidth;\n }\n }\n for (var i = 0; i < STROKE_PROPS.length; i++) {\n var prop = STROKE_PROPS[i];\n var propName = prop[0];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = style[propName] || prop[1];\n }\n }\n return styleChanged;\n}\nfunction bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\n}\nfunction setContextTransform(ctx, el) {\n var m = el.transform;\n var dpr = ctx.dpr || 1;\n if (m) {\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\n }\n else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n}\nfunction updateClipStatus(clipPaths, ctx, scope) {\n var allClipped = false;\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n allClipped = allClipped || clipPath.isZeroArea();\n setContextTransform(ctx, clipPath);\n ctx.beginPath();\n clipPath.buildPath(ctx, clipPath.shape);\n ctx.clip();\n }\n scope.allClipped = allClipped;\n}\nfunction isTransformChanged(m0, m1) {\n if (m0 && m1) {\n return m0[0] !== m1[0]\n || m0[1] !== m1[1]\n || m0[2] !== m1[2]\n || m0[3] !== m1[3]\n || m0[4] !== m1[4]\n || m0[5] !== m1[5];\n }\n else if (!m0 && !m1) {\n return false;\n }\n return true;\n}\nvar DRAW_TYPE_PATH = 1;\nvar DRAW_TYPE_IMAGE = 2;\nvar DRAW_TYPE_TEXT = 3;\nvar DRAW_TYPE_INCREMENTAL = 4;\nfunction canPathBatch(style) {\n var hasFill = styleHasFill(style);\n var hasStroke = styleHasStroke(style);\n return !(style.lineDash\n || !(+hasFill ^ +hasStroke)\n || (hasFill && typeof style.fill !== 'string')\n || (hasStroke && typeof style.stroke !== 'string')\n || style.strokePercent < 1\n || style.strokeOpacity < 1\n || style.fillOpacity < 1);\n}\nfunction flushPathDrawn(ctx, scope) {\n scope.batchFill && ctx.fill();\n scope.batchStroke && ctx.stroke();\n scope.batchFill = '';\n scope.batchStroke = '';\n}\nfunction getStyle(el, inHover) {\n return inHover ? (el.__hoverStyle || el.style) : el.style;\n}\nexport function brushSingle(ctx, el) {\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\n}\nexport function brush(ctx, el, scope, isLast) {\n var m = el.transform;\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\n el.__dirty &= ~REDRAW_BIT;\n el.__isRendered = false;\n return;\n }\n var clipPaths = el.__clipPaths;\n var prevElClipPaths = scope.prevElClipPaths;\n var forceSetTransform = false;\n var forceSetStyle = false;\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\n if (prevElClipPaths && prevElClipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.restore();\n forceSetStyle = forceSetTransform = true;\n scope.prevElClipPaths = null;\n scope.allClipped = false;\n scope.prevEl = null;\n }\n if (clipPaths && clipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.save();\n updateClipStatus(clipPaths, ctx, scope);\n forceSetTransform = true;\n }\n scope.prevElClipPaths = clipPaths;\n }\n if (scope.allClipped) {\n el.__isRendered = false;\n return;\n }\n el.beforeBrush && el.beforeBrush();\n el.innerBeforeBrush();\n var prevEl = scope.prevEl;\n if (!prevEl) {\n forceSetStyle = forceSetTransform = true;\n }\n var canBatchPath = el instanceof Path\n && el.autoBatch\n && canPathBatch(el.style);\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\n flushPathDrawn(ctx, scope);\n setContextTransform(ctx, el);\n }\n else if (!canBatchPath) {\n flushPathDrawn(ctx, scope);\n }\n var style = getStyle(el, scope.inHover);\n if (el instanceof Path) {\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_PATH;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\n ctx.beginPath();\n }\n brushPath(ctx, el, style, canBatchPath);\n if (canBatchPath) {\n scope.batchFill = style.fill || '';\n scope.batchStroke = style.stroke || '';\n }\n }\n else {\n if (el instanceof TSpan) {\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_TEXT;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushText(ctx, el, style);\n }\n else if (el instanceof ZRImage) {\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_IMAGE;\n }\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushImage(ctx, el, style);\n }\n else if (el.getTemporalDisplayables) {\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\n }\n brushIncremental(ctx, el, scope);\n }\n }\n if (canBatchPath && isLast) {\n flushPathDrawn(ctx, scope);\n }\n el.innerAfterBrush();\n el.afterBrush && el.afterBrush();\n scope.prevEl = el;\n el.__dirty = 0;\n el.__isRendered = true;\n}\nfunction brushIncremental(ctx, el, scope) {\n var displayables = el.getDisplayables();\n var temporalDisplayables = el.getTemporalDisplayables();\n ctx.save();\n var innerScope = {\n prevElClipPaths: null,\n prevEl: null,\n allClipped: false,\n viewWidth: scope.viewWidth,\n viewHeight: scope.viewHeight,\n inHover: scope.inHover\n };\n var i;\n var len;\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\n var displayable = displayables[i];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i === len - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\n var displayable = temporalDisplayables[i_1];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n el.clearTemporalDisplayables();\n el.notClear = true;\n ctx.restore();\n}\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport WeakMap from 'zrender/lib/core/WeakMap.js';\nimport LRU from 'zrender/lib/core/LRU.js';\nimport { defaults, map, isArray, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { getLeastCommonMultiple } from './number.js';\nimport { createSymbol } from './symbol.js';\nimport { brushSingle } from 'zrender/lib/canvas/graphic.js';\nimport { platformApi } from 'zrender/lib/core/platform.js';\nvar decalMap = new WeakMap();\nvar decalCache = new LRU(100);\nvar decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'maxTileWidth', 'maxTileHeight'];\n/**\n * Create or update pattern image from decal options\n *\n * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal\n * @return {Pattern} pattern with generated image, null if no decal\n */\nexport function createOrUpdatePatternFromDecal(decalObject, api) {\n if (decalObject === 'none') {\n return null;\n }\n var dpr = api.getDevicePixelRatio();\n var zr = api.getZr();\n var isSVG = zr.painter.type === 'svg';\n if (decalObject.dirty) {\n decalMap[\"delete\"](decalObject);\n }\n var oldPattern = decalMap.get(decalObject);\n if (oldPattern) {\n return oldPattern;\n }\n var decalOpt = defaults(decalObject, {\n symbol: 'rect',\n symbolSize: 1,\n symbolKeepAspect: true,\n color: 'rgba(0, 0, 0, 0.2)',\n backgroundColor: null,\n dashArrayX: 5,\n dashArrayY: 5,\n rotation: 0,\n maxTileWidth: 512,\n maxTileHeight: 512\n });\n if (decalOpt.backgroundColor === 'none') {\n decalOpt.backgroundColor = null;\n }\n var pattern = {\n repeat: 'repeat'\n };\n setPatternnSource(pattern);\n pattern.rotation = decalOpt.rotation;\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\n decalMap.set(decalObject, pattern);\n decalObject.dirty = false;\n return pattern;\n function setPatternnSource(pattern) {\n var keys = [dpr];\n var isValidKey = true;\n for (var i = 0; i < decalKeys.length; ++i) {\n var value = decalOpt[decalKeys[i]];\n if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== 'boolean') {\n isValidKey = false;\n break;\n }\n keys.push(value);\n }\n var cacheKey;\n if (isValidKey) {\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\n var cache = decalCache.get(cacheKey);\n if (cache) {\n isSVG ? pattern.svgElement = cache : pattern.image = cache;\n }\n }\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\n var canvas = !isSVG && platformApi.createCanvas();\n var svgRoot = isSVG && {\n tag: 'g',\n attrs: {},\n key: 'dcl',\n children: []\n };\n var pSize = getPatternSize();\n var ctx;\n if (canvas) {\n canvas.width = pSize.width * dpr;\n canvas.height = pSize.height * dpr;\n ctx = canvas.getContext('2d');\n }\n brushDecal();\n if (isValidKey) {\n decalCache.put(cacheKey, canvas || svgRoot);\n }\n pattern.image = canvas;\n pattern.svgElement = svgRoot;\n pattern.svgWidth = pSize.width;\n pattern.svgHeight = pSize.height;\n /**\n * Get minimum length that can make a repeatable pattern.\n *\n * @return {Object} pattern width and height\n */\n function getPatternSize() {\n /**\n * For example, if dash is [[3, 2], [2, 1]] for X, it looks like\n * |--- --- --- --- --- ...\n * |-- -- -- -- -- -- -- -- ...\n * |--- --- --- --- --- ...\n * |-- -- -- -- -- -- -- -- ...\n * So the minimum length of X is 15,\n * which is the least common multiple of `3 + 2` and `2 + 1`\n * |--- --- --- |--- --- ...\n * |-- -- -- -- -- |-- -- -- ...\n */\n var width = 1;\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\n }\n var symbolRepeats = 1;\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\n }\n width *= symbolRepeats;\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\n if (process.env.NODE_ENV !== 'production') {\n var warn = function (attrName) {\n /* eslint-disable-next-line */\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\n };\n if (width > decalOpt.maxTileWidth) {\n warn('maxTileWidth');\n }\n if (height > decalOpt.maxTileHeight) {\n warn('maxTileHeight');\n }\n }\n return {\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\n };\n }\n function brushDecal() {\n if (ctx) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (decalOpt.backgroundColor) {\n ctx.fillStyle = decalOpt.backgroundColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n }\n }\n var ySum = 0;\n for (var i = 0; i < dashArrayY.length; ++i) {\n ySum += dashArrayY[i];\n }\n if (ySum <= 0) {\n // dashArrayY is 0, draw nothing\n return;\n }\n var y = -lineBlockLengthY;\n var yId = 0;\n var yIdTotal = 0;\n var xId0 = 0;\n while (y < pSize.height) {\n if (yId % 2 === 0) {\n var symbolYId = yIdTotal / 2 % symbolArray.length;\n var x = 0;\n var xId1 = 0;\n var xId1Total = 0;\n while (x < pSize.width * 2) {\n var xSum = 0;\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\n xSum += dashArrayX[xId0][i];\n }\n if (xSum <= 0) {\n // Skip empty line\n break;\n }\n // E.g., [15, 5, 20, 5] draws only for 15 and 20\n if (xId1 % 2 === 0) {\n var size = (1 - decalOpt.symbolSize) * 0.5;\n var left = x + dashArrayX[xId0][xId1] * size;\n var top_1 = y + dashArrayY[yId] * size;\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\n var height = dashArrayY[yId] * decalOpt.symbolSize;\n var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length;\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\n }\n x += dashArrayX[xId0][xId1];\n ++xId1Total;\n ++xId1;\n if (xId1 === dashArrayX[xId0].length) {\n xId1 = 0;\n }\n }\n ++xId0;\n if (xId0 === dashArrayX.length) {\n xId0 = 0;\n }\n }\n y += dashArrayY[yId];\n ++yIdTotal;\n ++yId;\n if (yId === dashArrayY.length) {\n yId = 0;\n }\n }\n function brushSymbol(x, y, width, height, symbolType) {\n var scale = isSVG ? 1 : dpr;\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\n if (isSVG) {\n var symbolVNode = zr.painter.renderOneToVNode(symbol);\n if (symbolVNode) {\n svgRoot.children.push(symbolVNode);\n }\n } else {\n // Paint to canvas for all other renderers.\n brushSingle(ctx, symbol);\n }\n }\n }\n }\n}\n/**\n * Convert symbol array into normalized array\n *\n * @param {string | (string | string[])[]} symbol symbol input\n * @return {string[][]} normolized symbol array\n */\nfunction normalizeSymbolArray(symbol) {\n if (!symbol || symbol.length === 0) {\n return [['rect']];\n }\n if (isString(symbol)) {\n return [[symbol]];\n }\n var isAllString = true;\n for (var i = 0; i < symbol.length; ++i) {\n if (!isString(symbol[i])) {\n isAllString = false;\n break;\n }\n }\n if (isAllString) {\n return normalizeSymbolArray([symbol]);\n }\n var result = [];\n for (var i = 0; i < symbol.length; ++i) {\n if (isString(symbol[i])) {\n result.push([symbol[i]]);\n } else {\n result.push(symbol[i]);\n }\n }\n return result;\n}\n/**\n * Convert dash input into dashArray\n *\n * @param {DecalDashArrayX} dash dash input\n * @return {number[][]} normolized dash array\n */\nfunction normalizeDashArrayX(dash) {\n if (!dash || dash.length === 0) {\n return [[0, 0]];\n }\n if (isNumber(dash)) {\n var dashValue = Math.ceil(dash);\n return [[dashValue, dashValue]];\n }\n /**\n * [20, 5] should be normalized into [[20, 5]],\n * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]\n */\n var isAllNumber = true;\n for (var i = 0; i < dash.length; ++i) {\n if (!isNumber(dash[i])) {\n isAllNumber = false;\n break;\n }\n }\n if (isAllNumber) {\n return normalizeDashArrayX([dash]);\n }\n var result = [];\n for (var i = 0; i < dash.length; ++i) {\n if (isNumber(dash[i])) {\n var dashValue = Math.ceil(dash[i]);\n result.push([dashValue, dashValue]);\n } else {\n var dashValue = map(dash[i], function (n) {\n return Math.ceil(n);\n });\n if (dashValue.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // so normalize it to be [4, 2, 1, 4, 2, 1]\n result.push(dashValue.concat(dashValue));\n } else {\n result.push(dashValue);\n }\n }\n }\n return result;\n}\n/**\n * Convert dash input into dashArray\n *\n * @param {DecalDashArrayY} dash dash input\n * @return {number[]} normolized dash array\n */\nfunction normalizeDashArrayY(dash) {\n if (!dash || typeof dash === 'object' && dash.length === 0) {\n return [0, 0];\n }\n if (isNumber(dash)) {\n var dashValue_1 = Math.ceil(dash);\n return [dashValue_1, dashValue_1];\n }\n var dashValue = map(dash, function (n) {\n return Math.ceil(n);\n });\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\n}\n/**\n * Get block length of each line. A block is the length of dash line and space.\n * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after\n * that, so the block length of this line is 5.\n *\n * @param {number[][]} dash dash array of X or Y\n * @return {number[]} block length of each line\n */\nfunction getLineBlockLengthX(dash) {\n return map(dash, function (line) {\n return getLineBlockLengthY(line);\n });\n}\nfunction getLineBlockLengthY(dash) {\n var blockLength = 0;\n for (var i = 0; i < dash.length; ++i) {\n blockLength += dash[i];\n }\n if (dash.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // So total length is (4 + 2 + 1) * 2\n return blockLength * 2;\n }\n return blockLength;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createOrUpdatePatternFromDecal } from '../util/decal.js';\nexport default function decalVisual(ecModel, api) {\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n var data = seriesModel.getData();\n if (data.hasItemVisual()) {\n data.each(function (idx) {\n var decal = data.getItemVisual(idx, 'decal');\n if (decal) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n });\n }\n var decal = data.getVisual('decal');\n if (decal) {\n var style = data.getVisual('style');\n style.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Eventful from 'zrender/lib/core/Eventful.js';\n;\nvar lifecycle = new Eventful();\nexport default lifecycle;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { error } from '../util/log.js';\n// Implementation of exported APIs. For example registerMap, getMap.\n// The implementations will be registered when installing the component.\n// Avoid these code being bundled to the core module.\nvar implsStore = {};\n// TODO Type\nexport function registerImpl(name, impl) {\n if (process.env.NODE_ENV !== 'production') {\n if (implsStore[name]) {\n error(\"Already has an implementation of \" + name + \".\");\n }\n }\n implsStore[name] = impl;\n}\nexport function getImpl(name) {\n if (process.env.NODE_ENV !== 'production') {\n if (!implsStore[name]) {\n error(\"Implementation of \" + name + \" doesn't exists.\");\n }\n }\n return implsStore[name];\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrender from 'zrender/lib/zrender.js';\nimport { assert, each, isFunction, isObject, indexOf, bind, clone, setAsPrimitive, extend, createHashMap, map, defaults, isDom, isArray, noop, isString, retrieve2 } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport timsort from 'zrender/lib/core/timsort.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport CoordinateSystemManager from './CoordinateSystem.js';\nimport OptionManager from '../model/OptionManager.js';\nimport backwardCompat from '../preprocessor/backwardCompat.js';\nimport dataStack from '../processor/dataStack.js';\nimport SeriesModel from '../model/Series.js';\nimport ComponentView from '../view/Component.js';\nimport ChartView from '../view/Chart.js';\nimport * as graphic from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { isHighDownDispatcher, HOVER_STATE_EMPHASIS, HOVER_STATE_BLUR, blurSeriesFromHighlightPayload, toggleSelectionFromPayload, updateSeriesElementSelection, getAllSelectedIndices, isSelectChangePayload, isHighDownPayload, HIGHLIGHT_ACTION_TYPE, DOWNPLAY_ACTION_TYPE, SELECT_ACTION_TYPE, UNSELECT_ACTION_TYPE, TOGGLE_SELECT_ACTION_TYPE, savePathStates, enterEmphasis, leaveEmphasis, leaveBlur, enterSelect, leaveSelect, enterBlur, allLeaveBlur, findComponentHighDownDispatchers, blurComponent, handleGlobalMouseOverForHighDown, handleGlobalMouseOutForHighDown } from '../util/states.js';\nimport * as modelUtil from '../util/model.js';\nimport { throttle } from '../util/throttle.js';\nimport { seriesStyleTask, dataStyleTask, dataColorPaletteTask } from '../visual/style.js';\nimport loadingDefault from '../loading/default.js';\nimport Scheduler from './Scheduler.js';\nimport lightTheme from '../theme/light.js';\nimport darkTheme from '../theme/dark.js';\nimport { parseClassType } from '../util/clazz.js';\nimport { ECEventProcessor } from '../util/ECEventProcessor.js';\nimport { seriesSymbolTask, dataSymbolTask } from '../visual/symbol.js';\nimport { getVisualFromData, getItemVisualFromData } from '../visual/helper.js';\nimport { deprecateLog, deprecateReplaceLog, error, warn } from '../util/log.js';\nimport { handleLegacySelectEvents } from '../legacy/dataSelectAction.js';\nimport { registerExternalTransform } from '../data/helper/transform.js';\nimport { createLocaleObject, SYSTEM_LANG } from './locale.js';\nimport { findEventDispatcher } from '../util/event.js';\nimport decal from '../visual/decal.js';\nimport lifecycle from './lifecycle.js';\nimport { platformApi, setPlatformAPI } from 'zrender/lib/core/platform.js';\nimport { getImpl } from './impl.js';\nexport var version = '5.5.1';\nexport var dependencies = {\n zrender: '5.6.0'\n};\nvar TEST_FRAME_REMAIN_TIME = 1;\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800;\n// Some data processors depends on the stack result dimension (to calculate data extent).\n// So data stack stage should be in front of data processing stage.\nvar PRIORITY_PROCESSOR_DATASTACK = 900;\n// \"Data filter\" will block the stream, so it should be\n// put at the beginning of data processing.\nvar PRIORITY_PROCESSOR_FILTER = 1000;\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\nvar PRIORITY_VISUAL_LAYOUT = 1000;\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\nvar PRIORITY_VISUAL_GLOBAL = 2000;\nvar PRIORITY_VISUAL_CHART = 3000;\nvar PRIORITY_VISUAL_COMPONENT = 4000;\n// Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to\n// overwrite the viusal result of component (like `visualMap`)\n// using data item specific setting (like itemStyle.xxx on data item)\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\n// Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on\n// visual result like `symbolSize`.\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\nvar PRIORITY_VISUAL_BRUSH = 5000;\nvar PRIORITY_VISUAL_ARIA = 6000;\nvar PRIORITY_VISUAL_DECAL = 7000;\nexport var PRIORITY = {\n PROCESSOR: {\n FILTER: PRIORITY_PROCESSOR_FILTER,\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\n },\n VISUAL: {\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\n CHART: PRIORITY_VISUAL_CHART,\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\n BRUSH: PRIORITY_VISUAL_BRUSH,\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\n ARIA: PRIORITY_VISUAL_ARIA,\n DECAL: PRIORITY_VISUAL_DECAL\n }\n};\n// Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\nvar PENDING_UPDATE = '__pendingUpdate';\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\nvar CONNECT_STATUS_PENDING = 0;\nvar CONNECT_STATUS_UPDATING = 1;\nvar CONNECT_STATUS_UPDATED = 2;\n;\n;\nfunction createRegisterEventWithLowercaseECharts(method) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.isDisposed()) {\n disposedWarning(this.id);\n return;\n }\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\nfunction toLowercaseNameAndCallEventful(host, method, args) {\n // `args[0]` is event name. Event name is all lowercase.\n args[0] = args[0] && args[0].toLowerCase();\n return Eventful.prototype[method].apply(host, args);\n}\nvar MessageCenter = /** @class */function (_super) {\n __extends(MessageCenter, _super);\n function MessageCenter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return MessageCenter;\n}(Eventful);\nvar messageCenterProto = MessageCenter.prototype;\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\n// ---------------------------------------\n// Internal method names for class ECharts\n// ---------------------------------------\nvar prepare;\nvar prepareView;\nvar updateDirectly;\nvar updateMethods;\nvar doConvertPixel;\nvar updateStreamModes;\nvar doDispatchAction;\nvar flushPendingActions;\nvar triggerUpdatedEvent;\nvar bindRenderedEvent;\nvar bindMouseEvent;\nvar render;\nvar renderComponents;\nvar renderSeries;\nvar createExtensionAPI;\nvar enableConnect;\nvar markStatusToUpdate;\nvar applyChangedStates;\nvar ECharts = /** @class */function (_super) {\n __extends(ECharts, _super);\n function ECharts(dom,\n // Theme name or themeOption.\n theme, opts) {\n var _this = _super.call(this, new ECEventProcessor()) || this;\n _this._chartsViews = [];\n _this._chartsMap = {};\n _this._componentsViews = [];\n _this._componentsMap = {};\n // Can't dispatch action during rendering procedure\n _this._pendingActions = [];\n opts = opts || {};\n // Get theme by name\n if (isString(theme)) {\n theme = themeStorage[theme];\n }\n _this._dom = dom;\n var defaultRenderer = 'canvas';\n var defaultCoarsePointer = 'auto';\n var defaultUseDirtyRect = false;\n if (process.env.NODE_ENV !== 'production') {\n var root = /* eslint-disable-next-line */\n env.hasGlobalWindow ? window : global;\n if (root) {\n defaultRenderer = retrieve2(root.__ECHARTS__DEFAULT__RENDERER__, defaultRenderer);\n defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer);\n defaultUseDirtyRect = retrieve2(root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__, defaultUseDirtyRect);\n }\n }\n if (opts.ssr) {\n zrender.registerSSRDataGetter(function (el) {\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex;\n if (dataIndex == null) {\n return;\n }\n var hashMap = createHashMap();\n hashMap.set('series_index', ecData.seriesIndex);\n hashMap.set('data_index', dataIndex);\n ecData.ssrType && hashMap.set('ssr_type', ecData.ssrType);\n return hashMap;\n });\n }\n var zr = _this._zr = zrender.init(dom, {\n renderer: opts.renderer || defaultRenderer,\n devicePixelRatio: opts.devicePixelRatio,\n width: opts.width,\n height: opts.height,\n ssr: opts.ssr,\n useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect),\n useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer),\n pointerSize: opts.pointerSize\n });\n _this._ssr = opts.ssr;\n // Expect 60 fps.\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\n theme = clone(theme);\n theme && backwardCompat(theme, true);\n _this._theme = theme;\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\n _this._coordSysMgr = new CoordinateSystemManager();\n var api = _this._api = createExtensionAPI(_this);\n // Sort on demand\n function prioritySortFunc(a, b) {\n return a.__prio - b.__prio;\n }\n timsort(visualFuncs, prioritySortFunc);\n timsort(dataProcessorFuncs, prioritySortFunc);\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\n _this._messageCenter = new MessageCenter();\n // Init mouse events\n _this._initEvents();\n // In case some people write `window.onresize = chart.resize`\n _this.resize = bind(_this.resize, _this);\n zr.animation.on('frame', _this._onframe, _this);\n bindRenderedEvent(zr, _this);\n bindMouseEvent(zr, _this);\n // ECharts instance can be used as value.\n setAsPrimitive(_this);\n return _this;\n }\n ECharts.prototype._onframe = function () {\n if (this._disposed) {\n return;\n }\n applyChangedStates(this);\n var scheduler = this._scheduler;\n // Lazy update\n if (this[PENDING_UPDATE]) {\n var silent = this[PENDING_UPDATE].silent;\n this[IN_MAIN_PROCESS_KEY] = true;\n try {\n prepare(this);\n updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams);\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n this[PENDING_UPDATE] = null;\n throw e;\n }\n // At present, in each frame, zrender performs:\n // (1) animation step forward.\n // (2) trigger('frame') (where this `_onframe` is called)\n // (3) zrender flush (render).\n // If we do nothing here, since we use `setToFinal: true`, the step (3) above\n // will render the final state of the elements before the real animation started.\n this._zr.flush();\n this[IN_MAIN_PROCESS_KEY] = false;\n this[PENDING_UPDATE] = null;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n }\n // Avoid do both lazy update and progress in one frame.\n else if (scheduler.unfinished) {\n // Stream progress.\n var remainTime = TEST_FRAME_REMAIN_TIME;\n var ecModel = this._model;\n var api = this._api;\n scheduler.unfinished = false;\n do {\n var startTime = +new Date();\n scheduler.performSeriesTasks(ecModel);\n // Currently dataProcessorFuncs do not check threshold.\n scheduler.performDataProcessorTasks(ecModel);\n updateStreamModes(this, ecModel);\n // Do not update coordinate system here. Because that coord system update in\n // each frame is not a good user experience. So we follow the rule that\n // the extent of the coordinate system is determined in the first frame (the\n // frame is executed immediately after task reset.\n // this._coordSysMgr.update(ecModel, api);\n // console.log('--- ec frame visual ---', remainTime);\n scheduler.performVisualTasks(ecModel);\n renderSeries(this, this._model, api, 'remain', {});\n remainTime -= +new Date() - startTime;\n } while (remainTime > 0 && scheduler.unfinished);\n // Call flush explicitly for trigger finished event.\n if (!scheduler.unfinished) {\n this._zr.flush();\n }\n // Else, zr flushing be ensue within the same frame,\n // because zr flushing is after onframe event.\n }\n };\n\n ECharts.prototype.getDom = function () {\n return this._dom;\n };\n ECharts.prototype.getId = function () {\n return this.id;\n };\n ECharts.prototype.getZr = function () {\n return this._zr;\n };\n ECharts.prototype.isSSR = function () {\n return this._ssr;\n };\n /* eslint-disable-next-line */\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\n if (this[IN_MAIN_PROCESS_KEY]) {\n if (process.env.NODE_ENV !== 'production') {\n error('`setOption` should not be called during main process.');\n }\n return;\n }\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n var silent;\n var replaceMerge;\n var transitionOpt;\n if (isObject(notMerge)) {\n lazyUpdate = notMerge.lazyUpdate;\n silent = notMerge.silent;\n replaceMerge = notMerge.replaceMerge;\n transitionOpt = notMerge.transition;\n notMerge = notMerge.notMerge;\n }\n this[IN_MAIN_PROCESS_KEY] = true;\n if (!this._model || notMerge) {\n var optionManager = new OptionManager(this._api);\n var theme = this._theme;\n var ecModel = this._model = new GlobalModel();\n ecModel.scheduler = this._scheduler;\n ecModel.ssr = this._ssr;\n ecModel.init(null, null, null, theme, this._locale, optionManager);\n }\n this._model.setOption(option, {\n replaceMerge: replaceMerge\n }, optionPreprocessorFuncs);\n var updateParams = {\n seriesTransition: transitionOpt,\n optionChanged: true\n };\n if (lazyUpdate) {\n this[PENDING_UPDATE] = {\n silent: silent,\n updateParams: updateParams\n };\n this[IN_MAIN_PROCESS_KEY] = false;\n // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.\n // It should wake it up to make sure zrender start to render at the next frame.\n this.getZr().wakeUp();\n } else {\n try {\n prepare(this);\n updateMethods.update.call(this, null, updateParams);\n } catch (e) {\n this[PENDING_UPDATE] = null;\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n }\n // Ensure zr refresh sychronously, and then pixel in canvas can be\n // fetched after `setOption`.\n if (!this._ssr) {\n // not use flush when using ssr mode.\n this._zr.flush();\n }\n this[PENDING_UPDATE] = null;\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n }\n };\n /**\n * @deprecated\n */\n ECharts.prototype.setTheme = function () {\n deprecateLog('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\n };\n // We don't want developers to use getModel directly.\n ECharts.prototype.getModel = function () {\n return this._model;\n };\n ECharts.prototype.getOption = function () {\n return this._model && this._model.getOption();\n };\n ECharts.prototype.getWidth = function () {\n return this._zr.getWidth();\n };\n ECharts.prototype.getHeight = function () {\n return this._zr.getHeight();\n };\n ECharts.prototype.getDevicePixelRatio = function () {\n return this._zr.painter.dpr\n /* eslint-disable-next-line */ || env.hasGlobalWindow && window.devicePixelRatio || 1;\n };\n /**\n * Get canvas which has all thing rendered\n * @deprecated Use renderToCanvas instead.\n */\n ECharts.prototype.getRenderedCanvas = function (opts) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas');\n }\n return this.renderToCanvas(opts);\n };\n ECharts.prototype.renderToCanvas = function (opts) {\n opts = opts || {};\n var painter = this._zr.painter;\n if (process.env.NODE_ENV !== 'production') {\n if (painter.type !== 'canvas') {\n throw new Error('renderToCanvas can only be used in the canvas renderer.');\n }\n }\n return painter.getRenderedCanvas({\n backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'),\n pixelRatio: opts.pixelRatio || this.getDevicePixelRatio()\n });\n };\n ECharts.prototype.renderToSVGString = function (opts) {\n opts = opts || {};\n var painter = this._zr.painter;\n if (process.env.NODE_ENV !== 'production') {\n if (painter.type !== 'svg') {\n throw new Error('renderToSVGString can only be used in the svg renderer.');\n }\n }\n return painter.renderToString({\n useViewBox: opts.useViewBox\n });\n };\n /**\n * Get svg data url\n */\n ECharts.prototype.getSvgDataURL = function () {\n if (!env.svgSupported) {\n return;\n }\n var zr = this._zr;\n var list = zr.storage.getDisplayList();\n // Stop animations\n each(list, function (el) {\n el.stopAnimation(null, true);\n });\n return zr.painter.toDataURL();\n };\n ECharts.prototype.getDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n opts = opts || {};\n var excludeComponents = opts.excludeComponents;\n var ecModel = this._model;\n var excludesComponentViews = [];\n var self = this;\n each(excludeComponents, function (componentType) {\n ecModel.eachComponent({\n mainType: componentType\n }, function (component) {\n var view = self._componentsMap[component.__viewId];\n if (!view.group.ignore) {\n excludesComponentViews.push(view);\n view.group.ignore = true;\n }\n });\n });\n var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\n each(excludesComponentViews, function (view) {\n view.group.ignore = false;\n });\n return url;\n };\n ECharts.prototype.getConnectedDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n var isSvg = opts.type === 'svg';\n var groupId = this.group;\n var mathMin = Math.min;\n var mathMax = Math.max;\n var MAX_NUMBER = Infinity;\n if (connectedGroups[groupId]) {\n var left_1 = MAX_NUMBER;\n var top_1 = MAX_NUMBER;\n var right_1 = -MAX_NUMBER;\n var bottom_1 = -MAX_NUMBER;\n var canvasList_1 = [];\n var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio();\n each(instances, function (chart, id) {\n if (chart.group === groupId) {\n var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts));\n var boundingRect = chart.getDom().getBoundingClientRect();\n left_1 = mathMin(boundingRect.left, left_1);\n top_1 = mathMin(boundingRect.top, top_1);\n right_1 = mathMax(boundingRect.right, right_1);\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\n canvasList_1.push({\n dom: canvas,\n left: boundingRect.left,\n top: boundingRect.top\n });\n }\n });\n left_1 *= dpr_1;\n top_1 *= dpr_1;\n right_1 *= dpr_1;\n bottom_1 *= dpr_1;\n var width = right_1 - left_1;\n var height = bottom_1 - top_1;\n var targetCanvas = platformApi.createCanvas();\n var zr_1 = zrender.init(targetCanvas, {\n renderer: isSvg ? 'svg' : 'canvas'\n });\n zr_1.resize({\n width: width,\n height: height\n });\n if (isSvg) {\n var content_1 = '';\n each(canvasList_1, function (item) {\n var x = item.left - left_1;\n var y = item.top - top_1;\n content_1 += '' + item.dom + '';\n });\n zr_1.painter.getSvgRoot().innerHTML = content_1;\n if (opts.connectedBackgroundColor) {\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\n }\n zr_1.refreshImmediately();\n return zr_1.painter.toDataURL();\n } else {\n // Background between the charts\n if (opts.connectedBackgroundColor) {\n zr_1.add(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n },\n style: {\n fill: opts.connectedBackgroundColor\n }\n }));\n }\n each(canvasList_1, function (item) {\n var img = new graphic.Image({\n style: {\n x: item.left * dpr_1 - left_1,\n y: item.top * dpr_1 - top_1,\n image: item.dom\n }\n });\n zr_1.add(img);\n });\n zr_1.refreshImmediately();\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\n }\n } else {\n return this.getDataURL(opts);\n }\n };\n ECharts.prototype.convertToPixel = function (finder, value) {\n return doConvertPixel(this, 'convertToPixel', finder, value);\n };\n ECharts.prototype.convertFromPixel = function (finder, value) {\n return doConvertPixel(this, 'convertFromPixel', finder, value);\n };\n /**\n * Is the specified coordinate systems or components contain the given pixel point.\n * @param {Array|number} value\n * @return {boolean} result\n */\n ECharts.prototype.containPixel = function (finder, value) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n var ecModel = this._model;\n var result;\n var findResult = modelUtil.parseFinder(ecModel, finder);\n each(findResult, function (models, key) {\n key.indexOf('Models') >= 0 && each(models, function (model) {\n var coordSys = model.coordinateSystem;\n if (coordSys && coordSys.containPoint) {\n result = result || !!coordSys.containPoint(value);\n } else if (key === 'seriesModels') {\n var view = this._chartsMap[model.__viewId];\n if (view && view.containPoint) {\n result = result || view.containPoint(value, model);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.'));\n }\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(key + ': containPoint is not supported');\n }\n }\n }, this);\n }, this);\n return !!result;\n };\n /**\n * Get visual from series or data.\n * @param finder\n * If string, e.g., 'series', means {seriesIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * dataIndex / dataIndexInside\n * }\n * If dataIndex is not specified, series visual will be fetched,\n * but not data item visual.\n * If all of seriesIndex, seriesId, seriesName are not specified,\n * visual will be fetched from first series.\n * @param visualType 'color', 'symbol', 'symbolSize'\n */\n ECharts.prototype.getVisual = function (finder, visualType) {\n var ecModel = this._model;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder, {\n defaultMainType: 'series'\n });\n var seriesModel = parsedFinder.seriesModel;\n if (process.env.NODE_ENV !== 'production') {\n if (!seriesModel) {\n warn('There is no specified series model');\n }\n }\n var data = seriesModel.getData();\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;\n return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);\n };\n /**\n * Get view of corresponding component model\n */\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\n return this._componentsMap[componentModel.__viewId];\n };\n /**\n * Get view of corresponding series model\n */\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\n return this._chartsMap[seriesModel.__viewId];\n };\n ECharts.prototype._initEvents = function () {\n var _this = this;\n each(MOUSE_EVENT_NAMES, function (eveName) {\n var handler = function (e) {\n var ecModel = _this.getModel();\n var el = e.target;\n var params;\n var isGlobalOut = eveName === 'globalout';\n // no e.target when 'globalout'.\n if (isGlobalOut) {\n params = {};\n } else {\n el && findEventDispatcher(el, function (parent) {\n var ecData = getECData(parent);\n if (ecData && ecData.dataIndex != null) {\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\n params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {};\n return true;\n }\n // If element has custom eventData of components\n else if (ecData.eventData) {\n params = extend({}, ecData.eventData);\n return true;\n }\n }, true);\n }\n // Contract: if params prepared in mouse event,\n // these properties must be specified:\n // {\n // componentType: string (component main type)\n // componentIndex: number\n // }\n // Otherwise event query can not work.\n if (params) {\n var componentType = params.componentType;\n var componentIndex = params.componentIndex;\n // Special handling for historic reason: when trigger by\n // markLine/markPoint/markArea, the componentType is\n // 'markLine'/'markPoint'/'markArea', but we should better\n // enable them to be queried by seriesIndex, since their\n // option is set in each series.\n if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') {\n componentType = 'series';\n componentIndex = params.seriesIndex;\n }\n var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\n if (process.env.NODE_ENV !== 'production') {\n // `event.componentType` and `event[componentTpype + 'Index']` must not\n // be missed, otherwise there is no way to distinguish source component.\n // See `dataFormat.getDataParams`.\n if (!isGlobalOut && !(model && view)) {\n warn('model or view can not be found by params');\n }\n }\n params.event = e;\n params.type = eveName;\n _this._$eventProcessor.eventInfo = {\n targetEl: el,\n packedEvent: params,\n model: model,\n view: view\n };\n _this.trigger(eveName, params);\n }\n };\n // Consider that some component (like tooltip, brush, ...)\n // register zr event handler, but user event handler might\n // do anything, such as call `setOption` or `dispatchAction`,\n // which probably update any of the content and probably\n // cause problem if it is called previous other inner handlers.\n handler.zrEventfulCallAtLast = true;\n _this._zr.on(eveName, handler, _this);\n });\n each(eventActionMap, function (actionType, eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n });\n // Extra events\n // TODO register?\n each(['selectchanged'], function (eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n });\n handleLegacySelectEvents(this._messageCenter, this, this._api);\n };\n ECharts.prototype.isDisposed = function () {\n return this._disposed;\n };\n ECharts.prototype.clear = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n this.setOption({\n series: []\n }, true);\n };\n ECharts.prototype.dispose = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n this._disposed = true;\n var dom = this.getDom();\n if (dom) {\n modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\n }\n var chart = this;\n var api = chart._api;\n var ecModel = chart._model;\n each(chart._componentsViews, function (component) {\n component.dispose(ecModel, api);\n });\n each(chart._chartsViews, function (chart) {\n chart.dispose(ecModel, api);\n });\n // Dispose after all views disposed\n chart._zr.dispose();\n // Set properties to null.\n // To reduce the memory cost in case the top code still holds this instance unexpectedly.\n chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null;\n delete instances[chart.id];\n };\n /**\n * Resize the chart\n */\n ECharts.prototype.resize = function (opts) {\n if (this[IN_MAIN_PROCESS_KEY]) {\n if (process.env.NODE_ENV !== 'production') {\n error('`resize` should not be called during main process.');\n }\n return;\n }\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n this._zr.resize(opts);\n var ecModel = this._model;\n // Resize loading effect\n this._loadingFX && this._loadingFX.resize();\n if (!ecModel) {\n return;\n }\n var needPrepare = ecModel.resetOption('media');\n var silent = opts && opts.silent;\n // There is some real cases that:\n // chart.setOption(option, { lazyUpdate: true });\n // chart.resize();\n if (this[PENDING_UPDATE]) {\n if (silent == null) {\n silent = this[PENDING_UPDATE].silent;\n }\n needPrepare = true;\n this[PENDING_UPDATE] = null;\n }\n this[IN_MAIN_PROCESS_KEY] = true;\n try {\n needPrepare && prepare(this);\n updateMethods.update.call(this, {\n type: 'resize',\n animation: extend({\n // Disable animation\n duration: 0\n }, opts && opts.animation)\n });\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n }\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n ECharts.prototype.showLoading = function (name, cfg) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n if (isObject(name)) {\n cfg = name;\n name = '';\n }\n name = name || 'default';\n this.hideLoading();\n if (!loadingEffects[name]) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Loading effects ' + name + ' not exists.');\n }\n return;\n }\n var el = loadingEffects[name](this._api, cfg);\n var zr = this._zr;\n this._loadingFX = el;\n zr.add(el);\n };\n /**\n * Hide loading effect\n */\n ECharts.prototype.hideLoading = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n this._loadingFX && this._zr.remove(this._loadingFX);\n this._loadingFX = null;\n };\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\n var payload = extend({}, eventObj);\n payload.type = eventActionMap[eventObj.type];\n return payload;\n };\n /**\n * @param opt If pass boolean, means opt.silent\n * @param opt.silent Default `false`. Whether trigger events.\n * @param opt.flush Default `undefined`.\n * true: Flush immediately, and then pixel in canvas can be fetched\n * immediately. Caution: it might affect performance.\n * false: Not flush.\n * undefined: Auto decide whether perform flush.\n */\n ECharts.prototype.dispatchAction = function (payload, opt) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n if (!isObject(opt)) {\n opt = {\n silent: !!opt\n };\n }\n if (!actions[payload.type]) {\n return;\n }\n // Avoid dispatch action before setOption. Especially in `connect`.\n if (!this._model) {\n return;\n }\n // May dispatchAction in rendering procedure\n if (this[IN_MAIN_PROCESS_KEY]) {\n this._pendingActions.push(payload);\n return;\n }\n var silent = opt.silent;\n doDispatchAction.call(this, payload, silent);\n var flush = opt.flush;\n if (flush) {\n this._zr.flush();\n } else if (flush !== false && env.browser.weChat) {\n // In WeChat embedded browser, `requestAnimationFrame` and `setInterval`\n // hang when sliding page (on touch event), which cause that zr does not\n // refresh until user interaction finished, which is not expected.\n // But `dispatchAction` may be called too frequently when pan on touch\n // screen, which impacts performance if do not throttle them.\n this._throttledZrFlush();\n }\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n ECharts.prototype.updateLabelLayout = function () {\n lifecycle.trigger('series:layoutlabels', this._model, this._api, {\n // Not adding series labels.\n // TODO\n updatedSeries: []\n });\n };\n ECharts.prototype.appendData = function (params) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n var seriesIndex = params.seriesIndex;\n var ecModel = this.getModel();\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n if (process.env.NODE_ENV !== 'production') {\n assert(params.data && seriesModel);\n }\n seriesModel.appendData(params);\n // Note: `appendData` does not support that update extent of coordinate\n // system, util some scenario require that. In the expected usage of\n // `appendData`, the initial extent of coordinate system should better\n // be fixed by axis `min`/`max` setting or initial data, otherwise if\n // the extent changed while `appendData`, the location of the painted\n // graphic elements have to be changed, which make the usage of\n // `appendData` meaningless.\n this._scheduler.unfinished = true;\n this.getZr().wakeUp();\n };\n // A work around for no `internal` modifier in ts yet but\n // need to strictly hide private methods to JS users.\n ECharts.internalField = function () {\n prepare = function (ecIns) {\n var scheduler = ecIns._scheduler;\n scheduler.restorePipelines(ecIns._model);\n scheduler.prepareStageTasks();\n prepareView(ecIns, true);\n prepareView(ecIns, false);\n scheduler.plan();\n };\n /**\n * Prepare view instances of charts and components\n */\n prepareView = function (ecIns, isComponent) {\n var ecModel = ecIns._model;\n var scheduler = ecIns._scheduler;\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\n var zr = ecIns._zr;\n var api = ecIns._api;\n for (var i = 0; i < viewList.length; i++) {\n viewList[i].__alive = false;\n }\n isComponent ? ecModel.eachComponent(function (componentType, model) {\n componentType !== 'series' && doPrepare(model);\n }) : ecModel.eachSeries(doPrepare);\n function doPrepare(model) {\n // By default view will be reused if possible for the case that `setOption` with \"notMerge\"\n // mode and need to enable transition animation. (Usually, when they have the same id, or\n // especially no id but have the same type & name & index. See the `model.id` generation\n // rule in `makeIdAndName` and `viewId` generation rule here).\n // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that\n // the new model has nothing to do with the old model.\n var requireNewView = model.__requireNewView;\n // This command should not work twice.\n model.__requireNewView = false;\n // Consider: id same and type changed.\n var viewId = '_ec_' + model.id + '_' + model.type;\n var view = !requireNewView && viewMap[viewId];\n if (!view) {\n var classType = parseClassType(model.type);\n var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) :\n // FIXME:TS\n // (ChartView as ChartViewConstructor).getClass('series', classType.sub)\n // For backward compat, still support a chart type declared as only subType\n // like \"liquidfill\", but recommend \"series.liquidfill\"\n // But need a base class to make a type series.\n ChartView.getClass(classType.sub);\n if (process.env.NODE_ENV !== 'production') {\n assert(Clazz, classType.sub + ' does not exist.');\n }\n view = new Clazz();\n view.init(ecModel, api);\n viewMap[viewId] = view;\n viewList.push(view);\n zr.add(view.group);\n }\n model.__viewId = view.__id = viewId;\n view.__alive = true;\n view.__model = model;\n view.group.__ecComponentInfo = {\n mainType: model.mainType,\n index: model.componentIndex\n };\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\n }\n for (var i = 0; i < viewList.length;) {\n var view = viewList[i];\n if (!view.__alive) {\n !isComponent && view.renderTask.dispose();\n zr.remove(view.group);\n view.dispose(ecModel, api);\n viewList.splice(i, 1);\n if (viewMap[view.__id] === view) {\n delete viewMap[view.__id];\n }\n view.__id = view.group.__ecComponentInfo = null;\n } else {\n i++;\n }\n }\n };\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\n var ecModel = ecIns._model;\n ecModel.setUpdatePayload(payload);\n // broadcast\n if (!mainType) {\n // FIXME\n // Chart will not be update directly here, except set dirty.\n // But there is no such scenario now.\n each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\n return;\n }\n var query = {};\n query[mainType + 'Id'] = payload[mainType + 'Id'];\n query[mainType + 'Index'] = payload[mainType + 'Index'];\n query[mainType + 'Name'] = payload[mainType + 'Name'];\n var condition = {\n mainType: mainType,\n query: query\n };\n subType && (condition.subType = subType); // subType may be '' by parseClassType;\n var excludeSeriesId = payload.excludeSeriesId;\n var excludeSeriesIdMap;\n if (excludeSeriesId != null) {\n excludeSeriesIdMap = createHashMap();\n each(modelUtil.normalizeToArray(excludeSeriesId), function (id) {\n var modelId = modelUtil.convertOptionIdName(id, null);\n if (modelId != null) {\n excludeSeriesIdMap.set(modelId, true);\n }\n });\n }\n // If dispatchAction before setOption, do nothing.\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n if (isExcluded) {\n return;\n }\n ;\n if (isHighDownPayload(payload)) {\n if (model instanceof SeriesModel) {\n if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(['emphasis', 'disabled'])) {\n blurSeriesFromHighlightPayload(model, payload, ecIns._api);\n }\n } else {\n var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api),\n focusSelf = _a.focusSelf,\n dispatchers = _a.dispatchers;\n if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {\n blurComponent(model.mainType, model.componentIndex, ecIns._api);\n }\n // PENDING:\n // Whether to put this \"enter emphasis\" code in `ComponentView`,\n // which will be the same as `ChartView` but might be not necessary\n // and will be far from this logic.\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher);\n });\n }\n }\n } else if (isSelectChangePayload(payload)) {\n // TODO geo\n if (model instanceof SeriesModel) {\n toggleSelectionFromPayload(model, payload, ecIns._api);\n updateSeriesElementSelection(model);\n markStatusToUpdate(ecIns);\n }\n }\n }, ecIns);\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n if (isExcluded) {\n return;\n }\n ;\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\n }, ecIns);\n function callView(view) {\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\n }\n };\n updateMethods = {\n prepareAndUpdate: function (payload) {\n prepare(this);\n updateMethods.update.call(this, payload, {\n // Needs to mark option changed if newOption is given.\n // It's from MagicType.\n // TODO If use a separate flag optionChanged in payload?\n optionChanged: payload.newOption != null\n });\n },\n update: function (payload, updateParams) {\n var ecModel = this._model;\n var api = this._api;\n var zr = this._zr;\n var coordSysMgr = this._coordSysMgr;\n var scheduler = this._scheduler;\n // update before setOption\n if (!ecModel) {\n return;\n }\n ecModel.setUpdatePayload(payload);\n scheduler.restoreData(ecModel, payload);\n scheduler.performSeriesTasks(ecModel);\n // TODO\n // Save total ecModel here for undo/redo (after restoring data and before processing data).\n // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n // Create new coordinate system each update\n // In LineView may save the old coordinate system and use it to get the original point.\n coordSysMgr.create(ecModel, api);\n scheduler.performDataProcessorTasks(ecModel, payload);\n // Current stream render is not supported in data process. So we can update\n // stream modes after data processing, where the filtered data is used to\n // determine whether to use progressive rendering.\n updateStreamModes(this, ecModel);\n // We update stream modes before coordinate system updated, then the modes info\n // can be fetched when coord sys updating (consider the barGrid extent fix). But\n // the drawback is the full coord info can not be fetched. Fortunately this full\n // coord is not required in stream mode updater currently.\n coordSysMgr.update(ecModel, api);\n clearColorPalette(ecModel);\n scheduler.performVisualTasks(ecModel, payload);\n render(this, ecModel, api, payload, updateParams);\n // Set background\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\n var darkMode = ecModel.get('darkMode');\n zr.setBackgroundColor(backgroundColor);\n // Force set dark mode.\n if (darkMode != null && darkMode !== 'auto') {\n zr.setDarkMode(darkMode);\n }\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateTransform: function (payload) {\n var _this = this;\n var ecModel = this._model;\n var api = this._api;\n // update before setOption\n if (!ecModel) {\n return;\n }\n ecModel.setUpdatePayload(payload);\n // ChartView.markUpdateMethod(payload, 'updateTransform');\n var componentDirtyList = [];\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n var componentView = _this.getViewOfComponentModel(componentModel);\n if (componentView && componentView.__alive) {\n if (componentView.updateTransform) {\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\n result && result.update && componentDirtyList.push(componentView);\n } else {\n componentDirtyList.push(componentView);\n }\n }\n });\n var seriesDirtyMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n if (chartView.updateTransform) {\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\n } else {\n seriesDirtyMap.set(seriesModel.uid, 1);\n }\n });\n clearColorPalette(ecModel);\n // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true,\n dirtyMap: seriesDirtyMap\n });\n // Currently, not call render of components. Geo render cost a lot.\n // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\n renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap);\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateView: function (payload) {\n var ecModel = this._model;\n // update before setOption\n if (!ecModel) {\n return;\n }\n ecModel.setUpdatePayload(payload);\n ChartView.markUpdateMethod(payload, 'updateView');\n clearColorPalette(ecModel);\n // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true\n });\n render(this, ecModel, this._api, payload, {});\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateVisual: function (payload) {\n // updateMethods.update.call(this, payload);\n var _this = this;\n var ecModel = this._model;\n // update before setOption\n if (!ecModel) {\n return;\n }\n ecModel.setUpdatePayload(payload);\n // clear all visual\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.getData().clearAllVisual();\n });\n // Perform visual\n ChartView.markUpdateMethod(payload, 'updateVisual');\n clearColorPalette(ecModel);\n // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n this._scheduler.performVisualTasks(ecModel, payload, {\n visualType: 'visual',\n setDirty: true\n });\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType !== 'series') {\n var componentView = _this.getViewOfComponentModel(componentModel);\n componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\n });\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateLayout: function (payload) {\n updateMethods.update.call(this, payload);\n }\n };\n doConvertPixel = function (ecIns, methodName, finder, value) {\n if (ecIns._disposed) {\n disposedWarning(ecIns.id);\n return;\n }\n var ecModel = ecIns._model;\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\n var result;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder);\n for (var i = 0; i < coordSysList.length; i++) {\n var coordSys = coordSysList[i];\n if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\n return result;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\n }\n };\n updateStreamModes = function (ecIns, ecModel) {\n var chartsMap = ecIns._chartsMap;\n var scheduler = ecIns._scheduler;\n ecModel.eachSeries(function (seriesModel) {\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\n });\n };\n doDispatchAction = function (payload, silent) {\n var _this = this;\n var ecModel = this.getModel();\n var payloadType = payload.type;\n var escapeConnect = payload.escapeConnect;\n var actionWrap = actions[payloadType];\n var actionInfo = actionWrap.actionInfo;\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\n var updateMethod = cptTypeTmp.pop();\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\n this[IN_MAIN_PROCESS_KEY] = true;\n var payloads = [payload];\n var batched = false;\n // Batch action\n if (payload.batch) {\n batched = true;\n payloads = map(payload.batch, function (item) {\n item = defaults(extend({}, item), payload);\n item.batch = null;\n return item;\n });\n }\n var eventObjBatch = [];\n var eventObj;\n var isSelectChange = isSelectChangePayload(payload);\n var isHighDown = isHighDownPayload(payload);\n // Only leave blur once if there are multiple batches.\n if (isHighDown) {\n allLeaveBlur(this._api);\n }\n each(payloads, function (batchItem) {\n // Action can specify the event by return it.\n eventObj = actionWrap.action(batchItem, _this._model, _this._api);\n // Emit event outside\n eventObj = eventObj || extend({}, batchItem);\n // Convert type to eventType\n eventObj.type = actionInfo.event || eventObj.type;\n eventObjBatch.push(eventObj);\n // light update does not perform data process, layout and visual.\n if (isHighDown) {\n var _a = modelUtil.preParseFinder(payload),\n queryOptionMap = _a.queryOptionMap,\n mainTypeSpecified = _a.mainTypeSpecified;\n var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series';\n updateDirectly(_this, updateMethod, batchItem, componentMainType);\n markStatusToUpdate(_this);\n } else if (isSelectChange) {\n // At present `dispatchAction({ type: 'select', ... })` is not supported on components.\n // geo still use 'geoselect'.\n updateDirectly(_this, updateMethod, batchItem, 'series');\n markStatusToUpdate(_this);\n } else if (cptType) {\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\n }\n });\n if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) {\n try {\n // Still dirty\n if (this[PENDING_UPDATE]) {\n prepare(this);\n updateMethods.update.call(this, payload);\n this[PENDING_UPDATE] = null;\n } else {\n updateMethods[updateMethod].call(this, payload);\n }\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n }\n }\n // Follow the rule of action batch\n if (batched) {\n eventObj = {\n type: actionInfo.event || payloadType,\n escapeConnect: escapeConnect,\n batch: eventObjBatch\n };\n } else {\n eventObj = eventObjBatch[0];\n }\n this[IN_MAIN_PROCESS_KEY] = false;\n if (!silent) {\n var messageCenter = this._messageCenter;\n messageCenter.trigger(eventObj.type, eventObj);\n // Extra triggered 'selectchanged' event\n if (isSelectChange) {\n var newObj = {\n type: 'selectchanged',\n escapeConnect: escapeConnect,\n selected: getAllSelectedIndices(ecModel),\n isFromClick: payload.isFromClick || false,\n fromAction: payload.type,\n fromActionPayload: payload\n };\n messageCenter.trigger(newObj.type, newObj);\n }\n }\n };\n flushPendingActions = function (silent) {\n var pendingActions = this._pendingActions;\n while (pendingActions.length) {\n var payload = pendingActions.shift();\n doDispatchAction.call(this, payload, silent);\n }\n };\n triggerUpdatedEvent = function (silent) {\n !silent && this.trigger('updated');\n };\n /**\n * Event `rendered` is triggered when zr\n * rendered. It is useful for realtime\n * snapshot (reflect animation).\n *\n * Event `finished` is triggered when:\n * (1) zrender rendering finished.\n * (2) initial animation finished.\n * (3) progressive rendering finished.\n * (4) no pending action.\n * (5) no delayed setOption needs to be processed.\n */\n bindRenderedEvent = function (zr, ecIns) {\n zr.on('rendered', function (params) {\n ecIns.trigger('rendered', params);\n // The `finished` event should not be triggered repeatedly,\n // so it should only be triggered when rendering indeed happens\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n if (\n // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n };\n bindMouseEvent = function (zr, ecIns) {\n zr.on('mouseover', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n if (dispatcher) {\n handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('mouseout', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n if (dispatcher) {\n handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('click', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, function (target) {\n return getECData(target).dataIndex != null;\n }, true);\n if (dispatcher) {\n var actionType = dispatcher.selected ? 'unselect' : 'select';\n var ecData = getECData(dispatcher);\n ecIns._api.dispatchAction({\n type: actionType,\n dataType: ecData.dataType,\n dataIndexInside: ecData.dataIndex,\n seriesIndex: ecData.seriesIndex,\n isFromClick: true\n });\n }\n });\n };\n function clearColorPalette(ecModel) {\n ecModel.clearColorPalette();\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.clearColorPalette();\n });\n }\n ;\n // Allocate zlevels for series and components\n function allocateZlevels(ecModel) {\n ;\n var componentZLevels = [];\n var seriesZLevels = [];\n var hasSeparateZLevel = false;\n ecModel.eachComponent(function (componentType, componentModel) {\n var zlevel = componentModel.get('zlevel') || 0;\n var z = componentModel.get('z') || 0;\n var zlevelKey = componentModel.getZLevelKey();\n hasSeparateZLevel = hasSeparateZLevel || !!zlevelKey;\n (componentType === 'series' ? seriesZLevels : componentZLevels).push({\n zlevel: zlevel,\n z: z,\n idx: componentModel.componentIndex,\n type: componentType,\n key: zlevelKey\n });\n });\n if (hasSeparateZLevel) {\n // Series after component\n var zLevels = componentZLevels.concat(seriesZLevels);\n var lastSeriesZLevel_1;\n var lastSeriesKey_1;\n timsort(zLevels, function (a, b) {\n if (a.zlevel === b.zlevel) {\n return a.z - b.z;\n }\n return a.zlevel - b.zlevel;\n });\n each(zLevels, function (item) {\n var componentModel = ecModel.getComponent(item.type, item.idx);\n var zlevel = item.zlevel;\n var key = item.key;\n if (lastSeriesZLevel_1 != null) {\n zlevel = Math.max(lastSeriesZLevel_1, zlevel);\n }\n if (key) {\n if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) {\n zlevel++;\n }\n lastSeriesKey_1 = key;\n } else if (lastSeriesKey_1) {\n if (zlevel === lastSeriesZLevel_1) {\n zlevel++;\n }\n lastSeriesKey_1 = '';\n }\n lastSeriesZLevel_1 = zlevel;\n componentModel.setZLevel(zlevel);\n });\n }\n }\n render = function (ecIns, ecModel, api, payload, updateParams) {\n allocateZlevels(ecModel);\n renderComponents(ecIns, ecModel, api, payload, updateParams);\n each(ecIns._chartsViews, function (chart) {\n chart.__alive = false;\n });\n renderSeries(ecIns, ecModel, api, payload, updateParams);\n // Remove groups of unrendered charts\n each(ecIns._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n });\n };\n renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) {\n each(dirtyList || ecIns._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n clearStates(componentModel, componentView);\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n updateStates(componentModel, componentView);\n });\n };\n /**\n * Render each chart and component\n */\n renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n updateParams = extend(updateParams || {}, {\n updatedSeries: ecModel.getSeries()\n });\n // TODO progressive?\n lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams);\n var unfinished = false;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n // TODO states on marker.\n clearStates(seriesModel, chartView);\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\n unfinished = true;\n }\n chartView.group.silent = !!seriesModel.get('silent');\n // Should not call markRedraw on group, because it will disable zrender\n // incremental render (always render from the __startIndex each frame)\n // chartView.group.markRedraw();\n updateBlend(seriesModel, chartView);\n updateSeriesElementSelection(seriesModel);\n });\n scheduler.unfinished = unfinished || scheduler.unfinished;\n lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams);\n // transition after label is layouted.\n lifecycle.trigger('series:transition', ecModel, api, updateParams);\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n // Update Z after labels updated. Before applying states.\n updateZ(seriesModel, chartView);\n // NOTE: Update states after label is updated.\n // label should be in normal status when layouting.\n updateStates(seriesModel, chartView);\n });\n // If use hover layer\n updateHoverLayerStatus(ecIns, ecModel);\n lifecycle.trigger('series:afterupdate', ecModel, api, updateParams);\n };\n markStatusToUpdate = function (ecIns) {\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\n // Wake up zrender if it's sleep. Let it update states in the next frame.\n ecIns.getZr().wakeUp();\n };\n applyChangedStates = function (ecIns) {\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\n return;\n }\n ecIns.getZr().storage.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n applyElementStates(el);\n });\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\n };\n function applyElementStates(el) {\n var newStates = [];\n var oldStates = el.currentStates;\n // Keep other states.\n for (var i = 0; i < oldStates.length; i++) {\n var stateName = oldStates[i];\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\n newStates.push(stateName);\n }\n }\n // Only use states when it's exists.\n if (el.selected && el.states.select) {\n newStates.push('select');\n }\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\n newStates.push('emphasis');\n } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\n newStates.push('blur');\n }\n el.useStates(newStates);\n }\n function updateHoverLayerStatus(ecIns, ecModel) {\n var zr = ecIns._zr;\n var storage = zr.storage;\n var elCount = 0;\n storage.traverse(function (el) {\n if (!el.isGroup) {\n elCount++;\n }\n });\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.preventUsingHoverLayer) {\n return;\n }\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n if (chartView.__alive) {\n chartView.eachRendered(function (el) {\n if (el.states.emphasis) {\n el.states.emphasis.hoverLayer = true;\n }\n });\n }\n });\n }\n }\n ;\n /**\n * Update chart and blend.\n */\n function updateBlend(seriesModel, chartView) {\n var blendMode = seriesModel.get('blendMode') || null;\n chartView.eachRendered(function (el) {\n // FIXME marker and other components\n if (!el.isGroup) {\n // DON'T mark the element dirty. In case element is incremental and don't want to rerender.\n el.style.blend = blendMode;\n }\n });\n }\n ;\n function updateZ(model, view) {\n if (model.preventAutoZ) {\n return;\n }\n var z = model.get('z') || 0;\n var zlevel = model.get('zlevel') || 0;\n // Set z and zlevel\n view.eachRendered(function (el) {\n doUpdateZ(el, z, zlevel, -Infinity);\n // Don't traverse the children because it has been traversed in _updateZ.\n return true;\n });\n }\n ;\n function doUpdateZ(el, z, zlevel, maxZ2) {\n // Group may also have textContent\n var label = el.getTextContent();\n var labelLine = el.getTextGuideLine();\n var isGroup = el.isGroup;\n if (isGroup) {\n // set z & zlevel of children elements of Group\n var children = el.childrenRef();\n for (var i = 0; i < children.length; i++) {\n maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2);\n }\n } else {\n // not Group\n el.z = z;\n el.zlevel = zlevel;\n maxZ2 = Math.max(el.z2, maxZ2);\n }\n // always set z and zlevel if label/labelLine exists\n if (label) {\n label.z = z;\n label.zlevel = zlevel;\n // lift z2 of text content\n // TODO if el.emphasis.z2 is spcefied, what about textContent.\n isFinite(maxZ2) && (label.z2 = maxZ2 + 2);\n }\n if (labelLine) {\n var textGuideLineConfig = el.textGuideLineConfig;\n labelLine.z = z;\n labelLine.zlevel = zlevel;\n isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));\n }\n return maxZ2;\n }\n // Clear states without animation.\n // TODO States on component.\n function clearStates(model, view) {\n view.eachRendered(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n if (el.stateTransition) {\n el.stateTransition = null;\n }\n if (textContent && textContent.stateTransition) {\n textContent.stateTransition = null;\n }\n if (textGuide && textGuide.stateTransition) {\n textGuide.stateTransition = null;\n }\n // TODO If el is incremental.\n if (el.hasState()) {\n el.prevStates = el.currentStates;\n el.clearStates();\n } else if (el.prevStates) {\n el.prevStates = null;\n }\n });\n }\n function updateStates(model, view) {\n var stateAnimationModel = model.getModel('stateAnimation');\n var enableAnimation = model.isAnimationEnabled();\n var duration = stateAnimationModel.get('duration');\n var stateTransition = duration > 0 ? {\n duration: duration,\n delay: stateAnimationModel.get('delay'),\n easing: stateAnimationModel.get('easing')\n // additive: stateAnimationModel.get('additive')\n } : null;\n view.eachRendered(function (el) {\n if (el.states && el.states.emphasis) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n if (el instanceof graphic.Path) {\n savePathStates(el);\n }\n // Only updated on changed element. In case element is incremental and don't want to rerender.\n // TODO, a more proper way?\n if (el.__dirty) {\n var prevStates = el.prevStates;\n // Restore states without animation\n if (prevStates) {\n el.useStates(prevStates);\n }\n }\n // Update state transition and enable animation again.\n if (enableAnimation) {\n el.stateTransition = stateTransition;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n // TODO Is it necessary to animate label?\n if (textContent) {\n textContent.stateTransition = stateTransition;\n }\n if (textGuide) {\n textGuide.stateTransition = stateTransition;\n }\n }\n // Use highlighted and selected flag to toggle states.\n if (el.__dirty) {\n applyElementStates(el);\n }\n }\n });\n }\n ;\n createExtensionAPI = function (ecIns) {\n return new ( /** @class */function (_super) {\n __extends(class_1, _super);\n function class_1() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n class_1.prototype.getCoordinateSystems = function () {\n return ecIns._coordSysMgr.getCoordinateSystems();\n };\n class_1.prototype.getComponentByElement = function (el) {\n while (el) {\n var modelInfo = el.__ecComponentInfo;\n if (modelInfo != null) {\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\n }\n el = el.parent;\n }\n };\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\n enterEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\n leaveEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n class_1.prototype.enterBlur = function (el) {\n enterBlur(el);\n markStatusToUpdate(ecIns);\n };\n class_1.prototype.leaveBlur = function (el) {\n leaveBlur(el);\n markStatusToUpdate(ecIns);\n };\n class_1.prototype.enterSelect = function (el) {\n enterSelect(el);\n markStatusToUpdate(ecIns);\n };\n class_1.prototype.leaveSelect = function (el) {\n leaveSelect(el);\n markStatusToUpdate(ecIns);\n };\n class_1.prototype.getModel = function () {\n return ecIns.getModel();\n };\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\n return ecIns.getViewOfComponentModel(componentModel);\n };\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\n return ecIns.getViewOfSeriesModel(seriesModel);\n };\n return class_1;\n }(ExtensionAPI))(ecIns);\n };\n enableConnect = function (chart) {\n function updateConnectedChartsStatus(charts, status) {\n for (var i = 0; i < charts.length; i++) {\n var otherChart = charts[i];\n otherChart[CONNECT_STATUS_KEY] = status;\n }\n }\n each(eventActionMap, function (actionType, eventType) {\n chart._messageCenter.on(eventType, function (event) {\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\n if (event && event.escapeConnect) {\n return;\n }\n var action_1 = chart.makeActionFromEvent(event);\n var otherCharts_1 = [];\n each(instances, function (otherChart) {\n if (otherChart !== chart && otherChart.group === chart.group) {\n otherCharts_1.push(otherChart);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\n each(otherCharts_1, function (otherChart) {\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\n otherChart.dispatchAction(action_1);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\n }\n });\n });\n };\n }();\n return ECharts;\n}(Eventful);\nvar echartsProto = ECharts.prototype;\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\n/**\n * @deprecated\n */\n// @ts-ignore\nechartsProto.one = function (eventName, cb, ctx) {\n var self = this;\n deprecateLog('ECharts#one is deprecated.');\n function wrapped() {\n var args2 = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args2[_i] = arguments[_i];\n }\n cb && cb.apply && cb.apply(this, args2);\n // @ts-ignore\n self.off(eventName, wrapped);\n }\n ;\n // @ts-ignore\n this.on.call(this, eventName, wrapped, ctx);\n};\nvar MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu'];\nfunction disposedWarning(id) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Instance ' + id + ' has been disposed');\n }\n}\nvar actions = {};\n/**\n * Map eventType to actionType\n */\nvar eventActionMap = {};\nvar dataProcessorFuncs = [];\nvar optionPreprocessorFuncs = [];\nvar visualFuncs = [];\nvar themeStorage = {};\nvar loadingEffects = {};\nvar instances = {};\nvar connectedGroups = {};\nvar idBase = +new Date() - 0;\nvar groupIdBase = +new Date() - 0;\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\n/**\n * @param opts.devicePixelRatio Use window.devicePixelRatio by default\n * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.\n * @param opts.width Use clientWidth of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n * @param opts.height Use clientHeight of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n * @param opts.locale Specify the locale.\n * @param opts.useDirtyRect Enable dirty rectangle rendering or not.\n */\nexport function init(dom, theme, opts) {\n var isClient = !(opts && opts.ssr);\n if (isClient) {\n if (process.env.NODE_ENV !== 'production') {\n if (!dom) {\n throw new Error('Initialize failed: invalid dom.');\n }\n }\n var existInstance = getInstanceByDom(dom);\n if (existInstance) {\n if (process.env.NODE_ENV !== 'production') {\n warn('There is a chart instance already initialized on the dom.');\n }\n return existInstance;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) {\n warn('Can\\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.');\n }\n }\n }\n var chart = new ECharts(dom, theme, opts);\n chart.id = 'ec_' + idBase++;\n instances[chart.id] = chart;\n isClient && modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\n enableConnect(chart);\n lifecycle.trigger('afterinit', chart);\n return chart;\n}\n/**\n * @usage\n * (A)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * chart1.group = 'xxx';\n * chart2.group = 'xxx';\n * echarts.connect('xxx');\n * ```\n * (B)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * echarts.connect('xxx', [chart1, chart2]);\n * ```\n */\nexport function connect(groupId) {\n // Is array of charts\n if (isArray(groupId)) {\n var charts = groupId;\n groupId = null;\n // If any chart has group\n each(charts, function (chart) {\n if (chart.group != null) {\n groupId = chart.group;\n }\n });\n groupId = groupId || 'g_' + groupIdBase++;\n each(charts, function (chart) {\n chart.group = groupId;\n });\n }\n connectedGroups[groupId] = true;\n return groupId;\n}\nexport function disconnect(groupId) {\n connectedGroups[groupId] = false;\n}\n/**\n * Alias and backward compatibility\n * @deprecated\n */\nexport var disConnect = disconnect;\n/**\n * Dispose a chart instance\n */\nexport function dispose(chart) {\n if (isString(chart)) {\n chart = instances[chart];\n } else if (!(chart instanceof ECharts)) {\n // Try to treat as dom\n chart = getInstanceByDom(chart);\n }\n if (chart instanceof ECharts && !chart.isDisposed()) {\n chart.dispose();\n }\n}\nexport function getInstanceByDom(dom) {\n return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\n}\nexport function getInstanceById(key) {\n return instances[key];\n}\n/**\n * Register theme\n */\nexport function registerTheme(name, theme) {\n themeStorage[name] = theme;\n}\n/**\n * Register option preprocessor\n */\nexport function registerPreprocessor(preprocessorFunc) {\n if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {\n optionPreprocessorFuncs.push(preprocessorFunc);\n }\n}\nexport function registerProcessor(priority, processor) {\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\n}\n/**\n * Register postIniter\n * @param {Function} postInitFunc\n */\nexport function registerPostInit(postInitFunc) {\n registerUpdateLifecycle('afterinit', postInitFunc);\n}\n/**\n * Register postUpdater\n * @param {Function} postUpdateFunc\n */\nexport function registerPostUpdate(postUpdateFunc) {\n registerUpdateLifecycle('afterupdate', postUpdateFunc);\n}\nexport function registerUpdateLifecycle(name, cb) {\n lifecycle.on(name, cb);\n}\nexport function registerAction(actionInfo, eventName, action) {\n if (isFunction(eventName)) {\n action = eventName;\n eventName = '';\n }\n var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = {\n event: eventName\n }][0];\n // Event name is all lowercase\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\n eventName = actionInfo.event;\n if (eventActionMap[eventName]) {\n // Already registered.\n return;\n }\n // Validate action type and event name.\n assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\n if (!actions[actionType]) {\n actions[actionType] = {\n action: action,\n actionInfo: actionInfo\n };\n }\n eventActionMap[eventName] = actionType;\n}\nexport function registerCoordinateSystem(type, coordSysCreator) {\n CoordinateSystemManager.register(type, coordSysCreator);\n}\n/**\n * Get dimensions of specified coordinate system.\n * @param {string} type\n * @return {Array.}\n */\nexport function getCoordinateSystemDimensions(type) {\n var coordSysCreator = CoordinateSystemManager.get(type);\n if (coordSysCreator) {\n return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice();\n }\n}\nexport { registerLocale } from './locale.js';\nfunction registerLayout(priority, layoutTask) {\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\n}\nfunction registerVisual(priority, visualTask) {\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\n}\nexport { registerLayout, registerVisual };\nvar registeredTasks = [];\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\n if (isFunction(priority) || isObject(priority)) {\n fn = priority;\n priority = defaultPriority;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(priority) || priority == null) {\n throw new Error('Illegal priority');\n }\n // Check duplicate\n each(targetList, function (wrap) {\n assert(wrap.__raw !== fn);\n });\n }\n // Already registered\n if (indexOf(registeredTasks, fn) >= 0) {\n return;\n }\n registeredTasks.push(fn);\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\n stageHandler.__prio = priority;\n stageHandler.__raw = fn;\n targetList.push(stageHandler);\n}\nexport function registerLoading(name, loadingFx) {\n loadingEffects[name] = loadingFx;\n}\n/**\n * ZRender need a canvas context to do measureText.\n * But in node environment canvas may be created by node-canvas.\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\n *\n *\n * @deprecated use setPlatformAPI({ createCanvas }) instead.\n *\n * @example\n * let Canvas = require('canvas');\n * let echarts = require('echarts');\n * echarts.setCanvasCreator(function () {\n * // Small size is enough.\n * return new Canvas(32, 32);\n * });\n */\nexport function setCanvasCreator(creator) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.');\n }\n setPlatformAPI({\n createCanvas: creator\n });\n}\n/**\n * The parameters and usage: see `geoSourceManager.registerMap`.\n * Compatible with previous `echarts.registerMap`.\n */\nexport function registerMap(mapName, geoJson, specialAreas) {\n var registerMap = getImpl('registerMap');\n registerMap && registerMap(mapName, geoJson, specialAreas);\n}\nexport function getMap(mapName) {\n var getMap = getImpl('getMap');\n return getMap && getMap(mapName);\n}\nexport var registerTransform = registerExternalTransform;\n/**\n * Globa dispatchAction to a specified chart instance.\n */\n// export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters[1]) {\n// if (!payload || !payload.chartId) {\n// // Must have chartId to find chart\n// return;\n// }\n// const chart = instances[payload.chartId];\n// if (chart) {\n// chart.dispatchAction(payload, opt);\n// }\n// }\n// Builtin global visual\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\nregisterVisual(PRIORITY_VISUAL_DECAL, decal);\nregisterPreprocessor(backwardCompat);\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\nregisterLoading('default', loadingDefault);\n// Default actions\nregisterAction({\n type: HIGHLIGHT_ACTION_TYPE,\n event: HIGHLIGHT_ACTION_TYPE,\n update: HIGHLIGHT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: DOWNPLAY_ACTION_TYPE,\n event: DOWNPLAY_ACTION_TYPE,\n update: DOWNPLAY_ACTION_TYPE\n}, noop);\nregisterAction({\n type: SELECT_ACTION_TYPE,\n event: SELECT_ACTION_TYPE,\n update: SELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: UNSELECT_ACTION_TYPE,\n event: UNSELECT_ACTION_TYPE,\n update: UNSELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: TOGGLE_SELECT_ACTION_TYPE,\n event: TOGGLE_SELECT_ACTION_TYPE,\n update: TOGGLE_SELECT_ACTION_TYPE\n}, noop);\n// Default theme\nregisterTheme('light', lightTheme);\nregisterTheme('dark', darkTheme);\n// For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\nexport var dataTool = {};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { registerPreprocessor, registerProcessor, registerPostInit, registerPostUpdate, registerAction, registerCoordinateSystem, registerLayout, registerVisual, registerTransform, registerLoading, registerMap, registerUpdateLifecycle, PRIORITY } from './core/echarts.js';\nimport ComponentView from './view/Component.js';\nimport ChartView from './view/Chart.js';\nimport ComponentModel from './model/Component.js';\nimport SeriesModel from './model/Series.js';\nimport { isFunction, indexOf, isArray, each } from 'zrender/lib/core/util.js';\nimport { registerImpl } from './core/impl.js';\nimport { registerPainter } from 'zrender/lib/zrender.js';\nvar extensions = [];\nvar extensionRegisters = {\n registerPreprocessor: registerPreprocessor,\n registerProcessor: registerProcessor,\n registerPostInit: registerPostInit,\n registerPostUpdate: registerPostUpdate,\n registerUpdateLifecycle: registerUpdateLifecycle,\n registerAction: registerAction,\n registerCoordinateSystem: registerCoordinateSystem,\n registerLayout: registerLayout,\n registerVisual: registerVisual,\n registerTransform: registerTransform,\n registerLoading: registerLoading,\n registerMap: registerMap,\n registerImpl: registerImpl,\n PRIORITY: PRIORITY,\n ComponentModel: ComponentModel,\n ComponentView: ComponentView,\n SeriesModel: SeriesModel,\n ChartView: ChartView,\n // TODO Use ComponentModel and SeriesModel instead of Constructor\n registerComponentModel: function (ComponentModelClass) {\n ComponentModel.registerClass(ComponentModelClass);\n },\n registerComponentView: function (ComponentViewClass) {\n ComponentView.registerClass(ComponentViewClass);\n },\n registerSeriesModel: function (SeriesModelClass) {\n SeriesModel.registerClass(SeriesModelClass);\n },\n registerChartView: function (ChartViewClass) {\n ChartView.registerClass(ChartViewClass);\n },\n registerSubTypeDefaulter: function (componentType, defaulter) {\n ComponentModel.registerSubTypeDefaulter(componentType, defaulter);\n },\n registerPainter: function (painterType, PainterCtor) {\n registerPainter(painterType, PainterCtor);\n }\n};\nexport function use(ext) {\n if (isArray(ext)) {\n // use([ChartLine, ChartBar]);\n each(ext, function (singleExt) {\n use(singleExt);\n });\n return;\n }\n if (indexOf(extensions, ext) >= 0) {\n return;\n }\n extensions.push(ext);\n if (isFunction(ext)) {\n ext = {\n install: ext\n };\n }\n ext.install(extensionRegisters);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}\nfunction defaultKeyGetter(item) {\n return item;\n}\nvar DataDiffer = /** @class */function () {\n /**\n * @param context Can be visited by this.context in callback.\n */\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context,\n // By default: 'oneToOne'.\n diffMode) {\n this._old = oldArr;\n this._new = newArr;\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\n // Visible in callback via `this.context`;\n this.context = context;\n this._diffModeMultiple = diffMode === 'multiple';\n }\n /**\n * Callback function when add a data\n */\n DataDiffer.prototype.add = function (func) {\n this._add = func;\n return this;\n };\n /**\n * Callback function when update a data\n */\n DataDiffer.prototype.update = function (func) {\n this._update = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n DataDiffer.prototype.updateManyToOne = function (func) {\n this._updateManyToOne = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n DataDiffer.prototype.updateOneToMany = function (func) {\n this._updateOneToMany = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n DataDiffer.prototype.updateManyToMany = function (func) {\n this._updateManyToMany = func;\n return this;\n };\n /**\n * Callback function when remove a data\n */\n DataDiffer.prototype.remove = function (func) {\n this._remove = func;\n return this;\n };\n DataDiffer.prototype.execute = function () {\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\n };\n DataDiffer.prototype._executeOneToOne = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var newDataIndexMap = {};\n var oldDataKeyArr = new Array(oldArr.length);\n var newDataKeyArr = new Array(newArr.length);\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n for (var i = 0; i < oldArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n // idx can never be empty array here. see 'set null' logic below.\n if (newIdxMapValLen > 1) {\n // Consider there is duplicate key (for example, use dataItem.name as key).\n // We should make sure every item in newArr and oldArr can be visited.\n var newIdx = newIdxMapVal.shift();\n if (newIdxMapVal.length === 1) {\n newDataIndexMap[oldKey] = newIdxMapVal[0];\n }\n this._update && this._update(newIdx, i);\n } else if (newIdxMapValLen === 1) {\n newDataIndexMap[oldKey] = null;\n this._update && this._update(newIdxMapVal, i);\n } else {\n this._remove && this._remove(i);\n }\n }\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n /**\n * For example, consider the case:\n * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\n * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\n * Where:\n * o0, o1, n0 has key 'a' (many to one)\n * o5, n4, n5, n6 has key 'b' (one to many)\n * o2, n1 has key 'c' (one to one)\n * n2, n3 has key 'd' (add)\n * o3, o4 has key 'e' (remove)\n * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\n * Then:\n * (The order of the following directives are not ensured.)\n * this._updateManyToOne(n0, [o0, o1]);\n * this._updateOneToMany([n4, n5, n6], o5);\n * this._update(n1, o2);\n * this._remove(o3);\n * this._remove(o4);\n * this._remove(o6);\n * this._remove(o7);\n * this._add(n2);\n * this._add(n3);\n * this._add(n7);\n * this._add(n8);\n */\n DataDiffer.prototype._executeMultiple = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var oldDataIndexMap = {};\n var newDataIndexMap = {};\n var oldDataKeyArr = [];\n var newDataKeyArr = [];\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n for (var i = 0; i < oldDataKeyArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var oldIdxMapVal = oldDataIndexMap[oldKey];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {\n this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1) {\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\n this._remove && this._remove(oldIdxMapVal[i_1]);\n }\n } else {\n this._remove && this._remove(oldIdxMapVal);\n }\n }\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\n for (var i = 0; i < newDataKeyArr.length; i++) {\n var newKey = newDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[newKey];\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n if (idxMapValLen > 1) {\n for (var j = 0; j < idxMapValLen; j++) {\n this._add && this._add(newIdxMapVal[j]);\n }\n } else if (idxMapValLen === 1) {\n this._add && this._add(newIdxMapVal);\n }\n // Support both `newDataKeyArr` are duplication removed or not removed.\n newDataIndexMap[newKey] = null;\n }\n };\n DataDiffer.prototype._initIndexMap = function (arr,\n // Can be null.\n map,\n // In 'byKey', the output `keyArr` is duplication removed.\n // In 'byIndex', the output `keyArr` is not duplication removed and\n // its indices are accurately corresponding to `arr`.\n keyArr, keyGetterName) {\n var cbModeMultiple = this._diffModeMultiple;\n for (var i = 0; i < arr.length; i++) {\n // Add prefix to avoid conflict with Object.prototype.\n var key = '_ec_' + this[keyGetterName](arr[i], i);\n if (!cbModeMultiple) {\n keyArr[i] = key;\n }\n if (!map) {\n continue;\n }\n var idxMapVal = map[key];\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\n if (idxMapValLen === 0) {\n // Simple optimize: in most cases, one index has one key,\n // do not need array.\n map[key] = i;\n if (cbModeMultiple) {\n keyArr.push(key);\n }\n } else if (idxMapValLen === 1) {\n map[key] = [idxMapVal, i];\n } else {\n idxMapVal.push(i);\n }\n }\n };\n return DataDiffer;\n}();\nexport default DataDiffer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, createHashMap, assert, map } from 'zrender/lib/core/util.js';\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\nvar DimensionUserOuput = /** @class */function () {\n function DimensionUserOuput(encode, dimRequest) {\n this._encode = encode;\n this._schema = dimRequest;\n }\n DimensionUserOuput.prototype.get = function () {\n return {\n // Do not generate full dimension name until fist used.\n fullDimensions: this._getFullDimensionNames(),\n encode: this._encode\n };\n };\n /**\n * Get all data store dimension names.\n * Theoretically a series data store is defined both by series and used dataset (if any).\n * If some dimensions are omitted for performance reason in `this.dimensions`,\n * the dimension name may not be auto-generated if user does not specify a dimension name.\n * In this case, the dimension name is `null`/`undefined`.\n */\n DimensionUserOuput.prototype._getFullDimensionNames = function () {\n if (!this._cachedDimNames) {\n this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : [];\n }\n return this._cachedDimNames;\n };\n return DimensionUserOuput;\n}();\n;\nexport function summarizeDimensions(data, schema) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = createHashMap();\n var defaultedLabel = [];\n var defaultedTooltip = [];\n var userOutputEncode = {};\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n if (coordDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\n }\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\n if (!dimItem.isExtraCoord) {\n notExtraCoordDimMap.set(coordDim, 1);\n // Use the last coord dim (and label friendly) as default label,\n // because when dataset is used, it is hard to guess which dimension\n // can be value dimension. If both show x, y on label is not look good,\n // and conventionally y axis is focused more.\n if (mayLabelDimType(dimItem.type)) {\n defaultedLabel[0] = dimName;\n }\n // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name);\n }\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim];\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\n // Not necessary to remove duplicate, because a data\n // dim canot on more than one coordDim.\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n });\n summary.dataDimsOnCoord = dataDimsOnCoord;\n summary.dataDimIndicesOnCoord = map(dataDimsOnCoord, function (dimName) {\n return data.getDimensionInfo(dimName).storeDimIndex;\n });\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label;\n // FIXME `encode.label` is not recommended, because formatter cannot be set\n // in this way. Use label.formatter instead. Maybe remove this approach someday.\n if (encodeLabel && encodeLabel.length) {\n defaultedLabel = encodeLabel.slice();\n }\n var encodeTooltip = encode.tooltip;\n if (encodeTooltip && encodeTooltip.length) {\n defaultedTooltip = encodeTooltip.slice();\n } else if (!defaultedTooltip.length) {\n defaultedTooltip = defaultedLabel.slice();\n }\n encode.defaultedLabel = defaultedLabel;\n encode.defaultedTooltip = defaultedTooltip;\n summary.userOutput = new DimensionUserOuput(userOutputEncode, schema);\n return summary;\n}\nfunction getOrCreateEncodeArr(encode, dim) {\n if (!encode.hasOwnProperty(dim)) {\n encode[dim] = [];\n }\n return encode[dim];\n}\n// FIXME:TS should be type `AxisType`\nexport function getDimensionTypeByAxis(axisType) {\n return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float';\n}\nfunction mayLabelDimType(dimType) {\n // In most cases, ordinal and time do not suitable for label.\n // Ordinal info can be displayed on axis. Time is too long.\n return !(dimType === 'ordinal' || dimType === 'time');\n}\n// function findTheLastDimMayLabel(data) {\n// // Get last value dim\n// let dimensions = data.dimensions.slice();\n// let valueType;\n// let valueDim;\n// while (dimensions.length && (\n// valueDim = dimensions.pop(),\n// valueType = data.getDimensionInfo(valueDim).type,\n// valueType === 'ordinal' || valueType === 'time'\n// )) {} // jshint ignore:line\n// return valueDim;\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar SeriesDimensionDefine = /** @class */function () {\n /**\n * @param opt All of the fields will be shallow copied.\n */\n function SeriesDimensionDefine(opt) {\n /**\n * The format of `otherDims` is:\n * ```js\n * {\n * tooltip?: number\n * label?: number\n * itemName?: number\n * seriesName?: number\n * }\n * ```\n *\n * A `series.encode` can specified these fields:\n * ```js\n * encode: {\n * // \"3, 1, 5\" is the index of data dimension.\n * tooltip: [3, 1, 5],\n * label: [0, 3],\n * ...\n * }\n * ```\n * `otherDims` is the parse result of the `series.encode` above, like:\n * ```js\n * // Suppose the index of this data dimension is `3`.\n * this.otherDims = {\n * // `3` is at the index `0` of the `encode.tooltip`\n * tooltip: 0,\n * // `3` is at the index `1` of the `encode.label`\n * label: 1\n * };\n * ```\n *\n * This prop should never be `null`/`undefined` after initialized.\n */\n this.otherDims = {};\n if (opt != null) {\n zrUtil.extend(this, opt);\n }\n }\n return SeriesDimensionDefine;\n}();\n;\nexport default SeriesDimensionDefine;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { shouldRetrieveDataByName } from '../Source.js';\nvar inner = makeInner();\nvar dimTypeShort = {\n float: 'f',\n int: 'i',\n ordinal: 'o',\n number: 'n',\n time: 't'\n};\n/**\n * Represents the dimension requirement of a series.\n *\n * NOTICE:\n * When there are too many dimensions in dataset and many series, only the used dimensions\n * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.\n * But users may query data by other unused dimension names.\n * In this case, users can only query data if and only if they have defined dimension names\n * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from\n * `source` dimensions.\n */\nvar SeriesDataSchema = /** @class */function () {\n function SeriesDataSchema(opt) {\n this.dimensions = opt.dimensions;\n this._dimOmitted = opt.dimensionOmitted;\n this.source = opt.source;\n this._fullDimCount = opt.fullDimensionCount;\n this._updateDimOmitted(opt.dimensionOmitted);\n }\n SeriesDataSchema.prototype.isDimensionOmitted = function () {\n return this._dimOmitted;\n };\n SeriesDataSchema.prototype._updateDimOmitted = function (dimensionOmitted) {\n this._dimOmitted = dimensionOmitted;\n if (!dimensionOmitted) {\n return;\n }\n if (!this._dimNameMap) {\n this._dimNameMap = ensureSourceDimNameMap(this.source);\n }\n };\n /**\n * @caution Can only be used when `dimensionOmitted: true`.\n *\n * Get index by user defined dimension name (i.e., not internal generate name).\n * That is, get index from `dimensionsDefine`.\n * If no `dimensionsDefine`, or no name get, return -1.\n */\n SeriesDataSchema.prototype.getSourceDimensionIndex = function (dimName) {\n return retrieve2(this._dimNameMap.get(dimName), -1);\n };\n /**\n * @caution Can only be used when `dimensionOmitted: true`.\n *\n * Notice: may return `null`/`undefined` if user not specify dimension names.\n */\n SeriesDataSchema.prototype.getSourceDimension = function (dimIndex) {\n var dimensionsDefine = this.source.dimensionsDefine;\n if (dimensionsDefine) {\n return dimensionsDefine[dimIndex];\n }\n };\n SeriesDataSchema.prototype.makeStoreSchema = function () {\n var dimCount = this._fullDimCount;\n var willRetrieveDataByName = shouldRetrieveDataByName(this.source);\n var makeHashStrict = !shouldOmitUnusedDimensions(dimCount);\n // If source don't have dimensions or series don't omit unsed dimensions.\n // Generate from seriesDimList directly\n var dimHash = '';\n var dims = [];\n for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) {\n var property = void 0;\n var type = void 0;\n var ordinalMeta = void 0;\n var seriesDimDef = this.dimensions[seriesDimIdx];\n // The list has been sorted by `storeDimIndex` asc.\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n property = willRetrieveDataByName ? seriesDimDef.name : null;\n type = seriesDimDef.type;\n ordinalMeta = seriesDimDef.ordinalMeta;\n seriesDimIdx++;\n } else {\n var sourceDimDef = this.getSourceDimension(fullDimIdx);\n if (sourceDimDef) {\n property = willRetrieveDataByName ? sourceDimDef.name : null;\n type = sourceDimDef.type;\n }\n }\n dims.push({\n property: property,\n type: type,\n ordinalMeta: ordinalMeta\n });\n // If retrieving data by index,\n // use to determine whether data can be shared.\n // (Because in this case there might be no dimension name defined in dataset, but indices always exists).\n // (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash).\n // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`),\n // use in hash.\n if (willRetrieveDataByName && property != null\n // For data stack, we have make sure each series has its own dim on this store.\n // So we do not add property to hash to make sure they can share this store.\n && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) {\n dimHash += makeHashStrict\n // Use escape character '`' in case that property name contains '$'.\n ? property.replace(/\\`/g, '`1').replace(/\\$/g, '`2')\n // For better performance, when there are large dimensions, tolerant this defects that hardly meet.\n : property;\n }\n dimHash += '$';\n dimHash += dimTypeShort[type] || 'f';\n if (ordinalMeta) {\n dimHash += ordinalMeta.uid;\n }\n dimHash += '$';\n }\n // Source from endpoint(usually series) will be read differently\n // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different.\n // So we use this three props as key.\n var source = this.source;\n var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join('$$');\n return {\n dimensions: dims,\n hash: hash\n };\n };\n SeriesDataSchema.prototype.makeOutputDimensionNames = function () {\n var result = [];\n for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) {\n var name_1 = void 0;\n var seriesDimDef = this.dimensions[seriesDimIdx];\n // The list has been sorted by `storeDimIndex` asc.\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n if (!seriesDimDef.isCalculationCoord) {\n name_1 = seriesDimDef.name;\n }\n seriesDimIdx++;\n } else {\n var sourceDimDef = this.getSourceDimension(fullDimIdx);\n if (sourceDimDef) {\n name_1 = sourceDimDef.name;\n }\n }\n result.push(name_1);\n }\n return result;\n };\n SeriesDataSchema.prototype.appendCalculationDimension = function (dimDef) {\n this.dimensions.push(dimDef);\n dimDef.isCalculationCoord = true;\n this._fullDimCount++;\n // If append dimension on a data store, consider the store\n // might be shared by different series, series dimensions not\n // really map to store dimensions.\n this._updateDimOmitted(true);\n };\n return SeriesDataSchema;\n}();\nexport { SeriesDataSchema };\nexport function isSeriesDataSchema(schema) {\n return schema instanceof SeriesDataSchema;\n}\nexport function createDimNameMap(dimsDef) {\n var dataDimNameMap = createHashMap();\n for (var i = 0; i < (dimsDef || []).length; i++) {\n var dimDefItemRaw = dimsDef[i];\n var userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw;\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n dataDimNameMap.set(userDimName, i);\n }\n }\n return dataDimNameMap;\n}\nexport function ensureSourceDimNameMap(source) {\n var innerSource = inner(source);\n return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine));\n}\nexport function shouldOmitUnusedDimensions(dimCount) {\n return dimCount > 30;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/* global Int32Array */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../model/Model.js';\nimport DataDiffer from './DataDiffer.js';\nimport { DefaultDataProvider } from './helper/dataProvider.js';\nimport { summarizeDimensions } from './helper/dimensionHelper.js';\nimport SeriesDimensionDefine from './SeriesDimensionDefine.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types.js';\nimport { convertOptionIdName, isDataItemOption } from '../util/model.js';\nimport { setCommonECData } from '../util/innerStore.js';\nimport { isSourceInstance } from './Source.js';\nimport DataStore from './DataStore.js';\nimport { isSeriesDataSchema } from './helper/SeriesDataSchema.js';\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar CtorInt32Array = typeof Int32Array === 'undefined' ? Array : Int32Array;\n// Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird update animation.\nvar ID_PREFIX = 'e\\0\\0';\nvar INDEX_NOT_FOUND = -1;\n// type SeriesDimensionIndex = DimensionIndex;\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_dimSummary', 'userOutput', '_rawData', '_dimValueGetter', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_approximateExtent'];\n// -----------------------------\n// Internal method declarations:\n// -----------------------------\nvar prepareInvertedIndex;\nvar getId;\nvar getIdNameFromStore;\nvar normalizeDimensions;\nvar transferProperties;\nvar cloneListForMapAndSample;\nvar makeIdFromName;\nvar SeriesData = /** @class */function () {\n /**\n * @param dimensionsInput.dimensions\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n */\n function SeriesData(dimensionsInput, hostModel) {\n this.type = 'list';\n this._dimOmitted = false;\n this._nameList = [];\n this._idList = [];\n // Models of data option is stored sparse for optimizing memory cost\n // Never used yet (not used yet).\n // private _optionModels: Model[] = [];\n // Global visual properties after visual coding\n this._visual = {};\n // Global layout properties.\n this._layout = {};\n // Item visual properties after visual coding\n this._itemVisuals = [];\n // Item layout properties after layout\n this._itemLayouts = [];\n // Graphic elements\n this._graphicEls = [];\n // key: dim, value: extent\n this._approximateExtent = {};\n this._calculationInfo = {};\n // Having detected that there is data item is non primitive type\n // (in type `OptionDataItemObject`).\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n this.hasItemOption = false;\n // Methods that create a new list based on this list should be listed here.\n // Notice that those method should `RETURN` the new list.\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'];\n // Methods that change indices of this list should be listed here.\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\n var dimensions;\n var assignStoreDimIdx = false;\n if (isSeriesDataSchema(dimensionsInput)) {\n dimensions = dimensionsInput.dimensions;\n this._dimOmitted = dimensionsInput.isDimensionOmitted();\n this._schema = dimensionsInput;\n } else {\n assignStoreDimIdx = true;\n dimensions = dimensionsInput;\n }\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n var needsHasOwn = false;\n var emptyObj = {};\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimInfoInput = dimensions[i];\n var dimensionInfo = zrUtil.isString(dimInfoInput) ? new SeriesDimensionDefine({\n name: dimInfoInput\n }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput;\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n if (emptyObj[dimensionName] != null) {\n needsHasOwn = true;\n }\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n if (otherDims.itemName === 0) {\n this._nameDimIdx = i;\n }\n if (otherDims.itemId === 0) {\n this._idDimIdx = i;\n }\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0);\n }\n if (assignStoreDimIdx) {\n dimensionInfo.storeDimIndex = i;\n }\n }\n this.dimensions = dimensionNames;\n this._dimInfos = dimensionInfos;\n this._initGetDimensionInfo(needsHasOwn);\n this.hostModel = hostModel;\n this._invertedIndicesMap = invertedIndicesMap;\n if (this._dimOmitted) {\n var dimIdxToName_1 = this._dimIdxToName = zrUtil.createHashMap();\n zrUtil.each(dimensionNames, function (dimName) {\n dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName);\n });\n }\n }\n /**\n *\n * Get concrete dimension name by dimension name or dimension index.\n * If input a dimension name, do not validate whether the dimension name exits.\n *\n * @caution\n * @param dim Must make sure the dimension is `SeriesDimensionLoose`.\n * Because only those dimensions will have auto-generated dimension names if not\n * have a user-specified name, and other dimensions will get a return of null/undefined.\n *\n * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:\n * ```js\n * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);\n * ```\n *\n * @return Concrete dim name.\n */\n SeriesData.prototype.getDimension = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n if (dimIdx == null) {\n return dim;\n }\n dimIdx = dim;\n if (!this._dimOmitted) {\n return this.dimensions[dimIdx];\n }\n // Retrieve from series dimension definition because it probably contains\n // generated dimension name (like 'x', 'y').\n var dimName = this._dimIdxToName.get(dimIdx);\n if (dimName != null) {\n return dimName;\n }\n var sourceDimDef = this._schema.getSourceDimension(dimIdx);\n if (sourceDimDef) {\n return sourceDimDef.name;\n }\n };\n /**\n * Get dimension index in data store. Return -1 if not found.\n * Can be used to index value from getRawValue.\n */\n SeriesData.prototype.getDimensionIndex = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n if (dimIdx != null) {\n return dimIdx;\n }\n if (dim == null) {\n return -1;\n }\n var dimInfo = this._getDimInfo(dim);\n return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1;\n };\n /**\n * The meanings of the input parameter `dim`:\n *\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n * + If dim is a number-like string (e.g., `\"1\"`):\n * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,\n * it means that concrete name.\n * + If not, it will be converted to a number, which means the index of the dimension.\n * (why? because of the backward compatibility. We have been tolerating number-like string in\n * dimension setting, although now it seems that it is not a good idea.)\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n * if no dimension name is defined as `\"1\"`.\n * + If dim is a not-number-like string, it means the concrete dim name.\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n * or customized in `dimensions` property of option like `\"age\"`.\n *\n * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).\n */\n SeriesData.prototype._recognizeDimIndex = function (dim) {\n if (zrUtil.isNumber(dim)\n // If being a number-like string but not being defined as a dimension name.\n || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) {\n return +dim;\n }\n };\n SeriesData.prototype._getStoreDimIndex = function (dim) {\n var dimIdx = this.getDimensionIndex(dim);\n if (process.env.NODE_ENV !== 'production') {\n if (dimIdx == null) {\n throw new Error('Unknown dimension ' + dim);\n }\n }\n return dimIdx;\n };\n /**\n * Get type and calculation info of particular dimension\n * @param dim\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n */\n SeriesData.prototype.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._getDimInfo(this.getDimension(dim));\n };\n SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) {\n var dimensionInfos = this._dimInfos;\n this._getDimInfo = needsHasOwn ? function (dimName) {\n return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined;\n } : function (dimName) {\n return dimensionInfos[dimName];\n };\n };\n /**\n * concrete dimension name list on coord.\n */\n SeriesData.prototype.getDimensionsOnCoord = function () {\n return this._dimSummary.dataDimsOnCoord.slice();\n };\n SeriesData.prototype.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimSummary;\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n var dims = dimensionsSummary.encode[coordDim];\n return dims ? dims[idx] : null;\n };\n SeriesData.prototype.mapDimensionsAll = function (coordDim) {\n var dimensionsSummary = this._dimSummary;\n var dims = dimensionsSummary.encode[coordDim];\n return (dims || []).slice();\n };\n SeriesData.prototype.getStore = function () {\n return this._store;\n };\n /**\n * Initialize from data\n * @param data source or data or data store.\n * @param nameList The name of a datum is used on data diff and\n * default label/tooltip.\n * A name can be specified in encode.itemName,\n * or dataItem.name (only for series option data),\n * or provided in nameList from outside.\n */\n SeriesData.prototype.initData = function (data, nameList, dimValueGetter) {\n var _this = this;\n var store;\n if (data instanceof DataStore) {\n store = data;\n }\n if (!store) {\n var dimensions = this.dimensions;\n var provider = isSourceInstance(data) || zrUtil.isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data;\n store = new DataStore();\n var dimensionInfos = map(dimensions, function (dimName) {\n return {\n type: _this._dimInfos[dimName].type,\n property: dimName\n };\n });\n store.initData(provider, dimensionInfos, dimValueGetter);\n }\n this._store = store;\n // Reset\n this._nameList = (nameList || []).slice();\n this._idList = [];\n this._nameRepeatCount = {};\n this._doInit(0, store.count());\n // Cache summary info for fast visit. See \"dimensionHelper\".\n // Needs to be initialized after store is prepared.\n this._dimSummary = summarizeDimensions(this, this._schema);\n this.userOutput = this._dimSummary.userOutput;\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */\n SeriesData.prototype.appendData = function (data) {\n var range = this._store.appendData(data);\n this._doInit(range[0], range[1]);\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n * This method does not modify `rawData` (`dataProvider`), but only\n * add values to store.\n *\n * The final count will be increased by `Math.max(values.length, names.length)`.\n *\n * @param values That is the SourceType: 'arrayRows', like\n * [\n * [12, 33, 44],\n * [NaN, 43, 1],\n * ['-', 'asdf', 0]\n * ]\n * Each item is exactly corresponding to a dimension.\n */\n SeriesData.prototype.appendValues = function (values, names) {\n var _a = this._store.appendValues(values, names.length),\n start = _a.start,\n end = _a.end;\n var shouldMakeIdFromName = this._shouldMakeIdFromName();\n this._updateOrdinalMeta();\n if (names) {\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start;\n this._nameList[idx] = names[sourceIdx];\n if (shouldMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n };\n SeriesData.prototype._updateOrdinalMeta = function () {\n var store = this._store;\n var dimensions = this.dimensions;\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = this._dimInfos[dimensions[i]];\n if (dimInfo.ordinalMeta) {\n store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);\n }\n }\n };\n SeriesData.prototype._shouldMakeIdFromName = function () {\n var provider = this._store.getProvider();\n return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage;\n };\n SeriesData.prototype._doInit = function (start, end) {\n if (start >= end) {\n return;\n }\n var store = this._store;\n var provider = store.getProvider();\n this._updateOrdinalMeta();\n var nameList = this._nameList;\n var idList = this._idList;\n var sourceFormat = provider.getSource().sourceFormat;\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\n // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n // This kind of ids and names are always stored `_nameList` and `_idList`.\n if (isFormatOriginal && !provider.pure) {\n var sharedDataItem = [];\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n var dataItem = provider.getItem(idx, sharedDataItem);\n if (!this.hasItemOption && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n if (dataItem) {\n var itemName = dataItem.name;\n if (nameList[idx] == null && itemName != null) {\n nameList[idx] = convertOptionIdName(itemName, null);\n }\n var itemId = dataItem.id;\n if (idList[idx] == null && itemId != null) {\n idList[idx] = convertOptionIdName(itemId, null);\n }\n }\n }\n }\n if (this._shouldMakeIdFromName()) {\n for (var idx = start; idx < end; idx++) {\n makeIdFromName(this, idx);\n }\n }\n prepareInvertedIndex(this);\n };\n /**\n * PENDING: In fact currently this function is only used to short-circuit\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\n * be still needed.\n *\n * Optimize for the scenario that data is filtered by a given extent.\n * Consider that if data amount is more than hundreds of thousand,\n * extent calculation will cost more than 10ms and the cache will\n * be erased because of the filtering.\n */\n SeriesData.prototype.getApproximateExtent = function (dim) {\n return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n /**\n * Calculate extent on a filtered data might be time consuming.\n * Approximate extent is only used for: calculate extent of filtered data outside.\n */\n SeriesData.prototype.setApproximateExtent = function (extent, dim) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n };\n SeriesData.prototype.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n };\n SeriesData.prototype.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n };\n /**\n * @return Never be null/undefined. `number` will be converted to string. Because:\n * In most cases, name is used in display, where returning a string is more convenient.\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\n * rule that name `2` equals to name `'2'`.\n */\n SeriesData.prototype.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n var name = this._nameList[rawIndex];\n if (name == null && this._nameDimIdx != null) {\n name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);\n }\n if (name == null) {\n name = '';\n }\n return name;\n };\n SeriesData.prototype._getCategory = function (dimIdx, idx) {\n var ordinal = this._store.get(dimIdx, idx);\n var ordinalMeta = this._store.getOrdinalMeta(dimIdx);\n if (ordinalMeta) {\n return ordinalMeta.categories[ordinal];\n }\n return ordinal;\n };\n /**\n * @return Never null/undefined. `number` will be converted to string. Because:\n * In all cases having encountered at present, id is used in making diff comparison, which\n * are usually based on hash map. We can keep the rule that the internal id are always string\n * (treat `2` is the same as `'2'`) to make the related logic simple.\n */\n SeriesData.prototype.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n };\n SeriesData.prototype.count = function () {\n return this._store.count();\n };\n /**\n * Get value. Return NaN if idx is out of range.\n *\n * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.\n */\n SeriesData.prototype.get = function (dim, idx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n if (dimInfo) {\n return store.get(dimInfo.storeDimIndex, idx);\n }\n };\n /**\n * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.\n */\n SeriesData.prototype.getByRawIndex = function (dim, rawIdx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n if (dimInfo) {\n return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx);\n }\n };\n SeriesData.prototype.getIndices = function () {\n return this._store.getIndices();\n };\n SeriesData.prototype.getDataExtent = function (dim) {\n return this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n SeriesData.prototype.getSum = function (dim) {\n return this._store.getSum(this._getStoreDimIndex(dim));\n };\n SeriesData.prototype.getMedian = function (dim) {\n return this._store.getMedian(this._getStoreDimIndex(dim));\n };\n SeriesData.prototype.getValues = function (dimensions, idx) {\n var _this = this;\n var store = this._store;\n return zrUtil.isArray(dimensions) ? store.getValues(map(dimensions, function (dim) {\n return _this._getStoreDimIndex(dim);\n }), idx) : store.getValues(dimensions);\n };\n /**\n * If value is NaN. Including '-'\n * Only check the coord dimensions.\n */\n SeriesData.prototype.hasValue = function (idx) {\n var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;\n for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) {\n return false;\n }\n }\n return true;\n };\n /**\n * Retrieve the index with given name\n */\n SeriesData.prototype.indexOfName = function (name) {\n for (var i = 0, len = this._store.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n return -1;\n };\n SeriesData.prototype.getRawIndex = function (idx) {\n return this._store.getRawIndex(idx);\n };\n SeriesData.prototype.indexOfRawIndex = function (rawIndex) {\n return this._store.indexOfRawIndex(rawIndex);\n };\n /**\n * Only support the dimension which inverted index created.\n * Do not support other cases until required.\n * @param dim concrete dim\n * @param value ordinal index\n * @return rawIndex\n */\n SeriesData.prototype.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n if (process.env.NODE_ENV !== 'production') {\n if (!invertedIndices) {\n throw new Error('Do not supported yet');\n }\n }\n var rawIndex = invertedIndices[value];\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n return rawIndex;\n };\n /**\n * Retrieve the index of nearest value\n * @param dim\n * @param value\n * @param [maxDistance=Infinity]\n * @return If and only if multiple indices has\n * the same value, they are put to the result.\n */\n SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance);\n };\n SeriesData.prototype.each = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n }\n // ctxCompat just for compat echarts3\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n this._store.each(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n SeriesData.prototype.filterSelf = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n }\n // ctxCompat just for compat echarts3\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n this._store = this._store.filter(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return this;\n };\n /**\n * Select data in range. (For optimization of filter)\n * (Manually inline code, support 5 million data filtering in data zoom.)\n */\n SeriesData.prototype.selectRange = function (range) {\n 'use strict';\n\n var _this = this;\n var innerRange = {};\n var dims = zrUtil.keys(range);\n var dimIndices = [];\n zrUtil.each(dims, function (dim) {\n var dimIdx = _this._getStoreDimIndex(dim);\n innerRange[dimIdx] = range[dim];\n dimIndices.push(dimIdx);\n });\n this._store = this._store.selectRange(innerRange);\n return this;\n };\n /* eslint-enable max-len */\n SeriesData.prototype.mapArray = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n }\n // ctxCompat just for compat echarts3\n ctx = ctx || this;\n var result = [];\n this.each(dims, function () {\n result.push(cb && cb.apply(this, arguments));\n }, ctx);\n return result;\n };\n SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) {\n 'use strict';\n\n // ctxCompat just for compat echarts3\n var fCtx = ctx || ctxCompat || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n var list = cloneListForMapAndSample(this);\n list._store = this._store.map(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return list;\n };\n SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) {\n var _this = this;\n // ctxCompat just for compat echarts3\n var fCtx = ctx || ctxCompat || this;\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(normalizeDimensions(dims), function (dim) {\n var dimInfo = _this.getDimensionInfo(dim);\n if (!dimInfo.isCalculationCoord) {\n console.error('Danger: only stack dimension can be modified');\n }\n });\n }\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n // If do shallow clone here, if there are too many stacked series,\n // it still cost lots of memory, because `_store.dimensions` are not shared.\n // We should consider there probably be shallow clone happen in each series\n // in consequent filter/map.\n this._store.modify(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n /**\n * Large data down sampling on given dimension\n * @param sampleIndex Sample index for name and id\n */\n SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex);\n return list;\n };\n /**\n * Large data down sampling using largest-triangle-three-buckets\n * @param {string} valueDimension\n * @param {number} targetCount\n */\n SeriesData.prototype.lttbDownSample = function (valueDimension, rate) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate);\n return list;\n };\n SeriesData.prototype.getRawDataItem = function (idx) {\n return this._store.getRawDataItem(idx);\n };\n /**\n * Get model of one data item.\n */\n // TODO: Type of data item\n SeriesData.prototype.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n var dataItem = this.getRawDataItem(idx);\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n };\n /**\n * Create a data differ\n */\n SeriesData.prototype.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n };\n /**\n * Get visual property.\n */\n SeriesData.prototype.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n };\n SeriesData.prototype.setVisual = function (kvObj, val) {\n this._visual = this._visual || {};\n if (isObject(kvObj)) {\n zrUtil.extend(this._visual, kvObj);\n } else {\n this._visual[kvObj] = val;\n }\n };\n /**\n * Get visual property of single data item\n */\n // eslint-disable-next-line\n SeriesData.prototype.getItemVisual = function (idx, key) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n if (val == null) {\n // Use global visual property\n return this.getVisual(key);\n }\n return val;\n };\n /**\n * If exists visual property of single data item\n */\n SeriesData.prototype.hasItemVisual = function () {\n return this._itemVisuals.length > 0;\n };\n /**\n * Make sure itemVisual property is unique\n */\n // TODO: use key to save visual to reduce memory.\n SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) {\n var itemVisuals = this._itemVisuals;\n var itemVisual = itemVisuals[idx];\n if (!itemVisual) {\n itemVisual = itemVisuals[idx] = {};\n }\n var val = itemVisual[key];\n if (val == null) {\n val = this.getVisual(key);\n // TODO Performance?\n if (zrUtil.isArray(val)) {\n val = val.slice();\n } else if (isObject(val)) {\n val = zrUtil.extend({}, val);\n }\n itemVisual[key] = val;\n }\n return val;\n };\n // eslint-disable-next-line\n SeriesData.prototype.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n this._itemVisuals[idx] = itemVisual;\n if (isObject(key)) {\n zrUtil.extend(itemVisual, key);\n } else {\n itemVisual[key] = value;\n }\n };\n /**\n * Clear itemVisuals and list visual.\n */\n SeriesData.prototype.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n };\n SeriesData.prototype.setLayout = function (key, val) {\n isObject(key) ? zrUtil.extend(this._layout, key) : this._layout[key] = val;\n };\n /**\n * Get layout property.\n */\n SeriesData.prototype.getLayout = function (key) {\n return this._layout[key];\n };\n /**\n * Get layout of single data item\n */\n SeriesData.prototype.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n };\n /**\n * Set layout of single data item\n */\n SeriesData.prototype.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n };\n /**\n * Clear all layout of single data item\n */\n SeriesData.prototype.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n };\n /**\n * Set graphic element relative to data. It can be set as null\n */\n SeriesData.prototype.setItemGraphicEl = function (idx, el) {\n var seriesIndex = this.hostModel && this.hostModel.seriesIndex;\n setCommonECData(seriesIndex, this.dataType, idx, el);\n this._graphicEls[idx] = el;\n };\n SeriesData.prototype.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n };\n SeriesData.prototype.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n };\n /**\n * Shallow clone a new list except visual and layout properties, and graph elements.\n * New list only change the indices.\n */\n SeriesData.prototype.cloneShallow = function (list) {\n if (!list) {\n list = new SeriesData(this._schema ? this._schema : map(this.dimensions, this._getDimInfo, this), this.hostModel);\n }\n transferProperties(list, this);\n list._store = this._store;\n return list;\n };\n /**\n * Wrap some method to add more feature\n */\n SeriesData.prototype.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n if (!zrUtil.isFunction(originalMethod)) {\n return;\n }\n this.__wrappedMethods = this.__wrappedMethods || [];\n this.__wrappedMethods.push(methodName);\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n };\n // ----------------------------------------------------------\n // A work around for internal method visiting private member.\n // ----------------------------------------------------------\n SeriesData.internalField = function () {\n prepareInvertedIndex = function (data) {\n var invertedIndicesMap = data._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = data._dimInfos[dim];\n // Currently, only dimensions that has ordinalMeta can create inverted indices.\n var ordinalMeta = dimInfo.ordinalMeta;\n var store = data._store;\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);\n // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n for (var i = 0; i < store.count(); i++) {\n // Only support the case that all values are distinct.\n invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i;\n }\n }\n });\n };\n getIdNameFromStore = function (data, dimIdx, idx) {\n return convertOptionIdName(data._getCategory(dimIdx, idx), null);\n };\n /**\n * @see the comment of `List['getId']`.\n */\n getId = function (data, rawIndex) {\n var id = data._idList[rawIndex];\n if (id == null && data._idDimIdx != null) {\n id = getIdNameFromStore(data, data._idDimIdx, rawIndex);\n }\n if (id == null) {\n id = ID_PREFIX + rawIndex;\n }\n return id;\n };\n normalizeDimensions = function (dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = dimensions != null ? [dimensions] : [];\n }\n return dimensions;\n };\n /**\n * Data in excludeDimensions is copied, otherwise transferred.\n */\n cloneListForMapAndSample = function (original) {\n var list = new SeriesData(original._schema ? original._schema : map(original.dimensions, original._getDimInfo, original), original.hostModel);\n // FIXME If needs stackedOn, value may already been stacked\n transferProperties(list, original);\n return list;\n };\n transferProperties = function (target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n };\n makeIdFromName = function (data, idx) {\n var nameList = data._nameList;\n var idList = data._idList;\n var nameDimIdx = data._nameDimIdx;\n var idDimIdx = data._idDimIdx;\n var name = nameList[idx];\n var id = idList[idx];\n if (name == null && nameDimIdx != null) {\n nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);\n }\n if (id == null && idDimIdx != null) {\n idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);\n }\n if (id == null && name != null) {\n var nameRepeatCount = data._nameRepeatCount;\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n id = name;\n if (nmCnt > 1) {\n id += '__ec__' + nmCnt;\n }\n idList[idx] = id;\n }\n };\n }();\n return SeriesData;\n}();\nexport default SeriesData;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\nimport SeriesDimensionDefine from '../SeriesDimensionDefine.js';\nimport { createHashMap, defaults, each, extend, isObject, isString } from 'zrender/lib/core/util.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { CtorInt32Array } from '../DataStore.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './sourceHelper.js';\nimport { createDimNameMap, ensureSourceDimNameMap, SeriesDataSchema, shouldOmitUnusedDimensions } from './SeriesDataSchema.js';\n/**\n * For outside usage compat (like echarts-gl are using it).\n */\nexport function createDimensions(source, opt) {\n return prepareSeriesDataSchema(source, opt).dimensions;\n}\n/**\n * This method builds the relationship between:\n * + \"what the coord sys or series requires (see `coordDimensions`)\",\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)\"\n * + \"what the data source provids (see `source`)\".\n *\n * Some guess strategy will be adapted if user does not define something.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @return The results are always sorted by `storeDimIndex` asc.\n */\nexport default function prepareSeriesDataSchema(\n// TODO: TYPE completeDimensions type\nsource, opt) {\n if (!isSourceInstance(source)) {\n source = createSourceFromSeriesDataOption(source);\n }\n opt = opt || {};\n var sysDims = opt.coordDimensions || [];\n var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];\n var coordDimNameMap = createHashMap();\n var resultList = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount);\n // Try to ignore unused dimensions if sharing a high dimension datastore\n // 30 is an experience value.\n var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);\n var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;\n var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);\n var encodeDef = opt.encodeDefine;\n if (!encodeDef && opt.encodeDefaulter) {\n encodeDef = opt.encodeDefaulter(source, dimCount);\n }\n var encodeDefMap = createHashMap(encodeDef);\n var indicesMap = new CtorInt32Array(dimCount);\n for (var i = 0; i < indicesMap.length; i++) {\n indicesMap[i] = -1;\n }\n function getResultItem(dimIdx) {\n var idx = indicesMap[dimIdx];\n if (idx < 0) {\n var dimDefItemRaw = dimsDef[dimIdx];\n var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : {\n name: dimDefItemRaw\n };\n var resultItem = new SeriesDimensionDefine();\n var userDimName = dimDefItem.name;\n if (userDimName != null && dataDimNameMap.get(userDimName) != null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be displayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n }\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n var newIdx = resultList.length;\n indicesMap[dimIdx] = newIdx;\n resultItem.storeDimIndex = dimIdx;\n resultList.push(resultItem);\n return resultItem;\n }\n return resultList[idx];\n }\n if (!omitUnusedDimensions) {\n for (var i = 0; i < dimCount; i++) {\n getResultItem(i);\n }\n }\n // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\n var dataDims = normalizeToArray(dataDimsRaw).slice();\n // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\n encodeDefMap.set(coordDim, false);\n return;\n }\n var validDataDims = encodeDefMap.set(coordDim, []);\n each(dataDims, function (resultDimIdxOrName, idx) {\n // The input resultDimIdx can be dim name or index.\n var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(getResultItem(resultDimIdx), coordDim, idx);\n }\n });\n });\n // Apply templates and default order from `sysDims`.\n var availDimIdx = 0;\n each(sysDims, function (sysDimItemRaw) {\n var coordDim;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n var sysDimItem;\n if (isString(sysDimItemRaw)) {\n coordDim = sysDimItemRaw;\n sysDimItem = {};\n } else {\n sysDimItem = sysDimItemRaw;\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = extend({}, sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta;\n // `coordDimIndex` should not be set directly.\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n var dataDims = encodeDefMap.get(coordDim);\n // negative resultDimIdx means no need to mapping.\n if (dataDims === false) {\n return;\n }\n dataDims = normalizeToArray(dataDims);\n // dimensions provides default dim sequences.\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) {\n availDimIdx++;\n }\n availDimIdx < dimCount && dataDims.push(availDimIdx++);\n }\n }\n // Apply templates.\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = getResultItem(resultDimIdx);\n // Coordinate system has a higher priority on dim type than source.\n if (isUsingSourceDimensionsDef && sysDimItem.type != null) {\n resultItem.type = sysDimItem.type;\n }\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n }\n // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (VISUAL_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n }\n // Make sure the first extra dim is 'value'.\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value';\n function ifNoNameFillWithCoordName(resultItem) {\n if (resultItem.name == null) {\n // Duplication will be removed in the next step.\n resultItem.name = resultItem.coordDim;\n }\n }\n // Set dim `name` and other `coordDim` and other props.\n if (!omitUnusedDimensions) {\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = getResultItem(resultDimIdx);\n var coordDim = resultItem.coordDim;\n if (coordDim == null) {\n // TODO no need to generate coordDim for isExtraCoord?\n resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0;\n // Series specified generateCoord is using out.\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n generateCoordCount--;\n }\n ifNoNameFillWithCoordName(resultItem);\n if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\n // Consider the case:\n // {\n // dataset: {source: [\n // ['2001', 123],\n // ['2002', 456],\n // ...\n // ['The others', 987],\n // ]},\n // series: {type: 'pie'}\n // }\n // The first column should better be treated as a \"ordinal\" although it\n // might not be detected as an \"ordinal\" by `guessOrdinal`.\n || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n resultItem.type = 'ordinal';\n }\n }\n } else {\n each(resultList, function (resultItem) {\n // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?\n ifNoNameFillWithCoordName(resultItem);\n });\n // Sort dimensions: there are some rule that use the last dim as label,\n // and for some latter travel process easier.\n resultList.sort(function (item0, item1) {\n return item0.storeDimIndex - item1.storeDimIndex;\n });\n }\n removeDuplication(resultList);\n return new SeriesDataSchema({\n source: source,\n dimensions: resultList,\n fullDimensionCount: dimCount,\n dimensionOmitted: omitUnusedDimensions\n });\n}\nfunction removeDuplication(result) {\n var duplicationMap = createHashMap();\n for (var i = 0; i < result.length; i++) {\n var dim = result[i];\n var dimOriginalName = dim.name;\n var count = duplicationMap.get(dimOriginalName) || 0;\n if (count > 0) {\n // Starts from 0.\n dim.name = dimOriginalName + (count - 1);\n }\n count++;\n duplicationMap.set(dimOriginalName, count);\n }\n}\n// ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calculate bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in data store?\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef;\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n }\n });\n return dimCount;\n}\nfunction genCoordDimName(name, map, fromZero) {\n if (fromZero || map.hasKey(name)) {\n var i = 0;\n while (map.hasKey(name + i)) {\n i++;\n }\n name += i;\n }\n map.set(name, true);\n return name;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\nimport { createHashMap, retrieve, each } from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../util/model.js';\n/**\n * @class\n * For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // The index of the first category axis in `coordSysDims`.\n * // `null/undefined` means no category axis exists.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nvar CoordSysInfo = /** @class */function () {\n function CoordSysInfo(coordSysName) {\n this.coordSysDims = [];\n this.axisMap = createHashMap();\n this.categoryAxisMap = createHashMap();\n this.coordSysName = coordSysName;\n }\n return CoordSysInfo;\n}();\nexport function getCoordSysInfoBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = new CoordSysInfo(coordSysName);\n var fetch = fetchers[coordSysName];\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n if (process.env.NODE_ENV !== 'production') {\n if (!xAxisModel) {\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\n }\n if (!yAxisModel) {\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\n }\n }\n result.coordSysDims = ['x', 'y'];\n axisMap.set('x', xAxisModel);\n axisMap.set('y', yAxisModel);\n if (isCategory(xAxisModel)) {\n categoryAxisMap.set('x', xAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n if (isCategory(yAxisModel)) {\n categoryAxisMap.set('y', yAxisModel);\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n if (process.env.NODE_ENV !== 'production') {\n if (!singleAxisModel) {\n throw new Error('singleAxis should be specified.');\n }\n }\n result.coordSysDims = ['single'];\n axisMap.set('single', singleAxisModel);\n if (isCategory(singleAxisModel)) {\n categoryAxisMap.set('single', singleAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n },\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n if (process.env.NODE_ENV !== 'production') {\n if (!angleAxisModel) {\n throw new Error('angleAxis option not found');\n }\n if (!radiusAxisModel) {\n throw new Error('radiusAxis option not found');\n }\n }\n result.coordSysDims = ['radius', 'angle'];\n axisMap.set('radius', radiusAxisModel);\n axisMap.set('angle', angleAxisModel);\n if (isCategory(radiusAxisModel)) {\n categoryAxisMap.set('radius', radiusAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n if (isCategory(angleAxisModel)) {\n categoryAxisMap.set('angle', angleAxisModel);\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\n }\n },\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\n result.coordSysDims = ['lng', 'lat'];\n },\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\n var ecModel = seriesModel.ecModel;\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n var axisDim = coordSysDims[index];\n axisMap.set(axisDim, axisModel);\n if (isCategory(axisModel)) {\n categoryAxisMap.set(axisDim, axisModel);\n if (result.firstCategoryDimIndex == null) {\n result.firstCategoryDimIndex = index;\n }\n }\n });\n }\n};\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString } from 'zrender/lib/core/util.js';\nimport { isSeriesDataSchema } from './SeriesDataSchema.js';\n/**\n * Note that it is too complicated to support 3d stack by value\n * (have to create two-dimension inverted index), so in 3d case\n * we just support that stacked by index.\n *\n * @param seriesModel\n * @param dimensionsInput The same as the input of .\n * The input will be modified.\n * @param opt\n * @param opt.stackedCoordDimension Specify a coord dimension if needed.\n * @param opt.byIndex=false\n * @return calculationInfo\n * {\n * stackedDimension: string\n * stackedByDimension: string\n * isStackedByIndex: boolean\n * stackedOverDimension: string\n * stackResultDimension: string\n * }\n */\nexport function enableDataStack(seriesModel, dimensionsInput, opt) {\n opt = opt || {};\n var byIndex = opt.byIndex;\n var stackedCoordDimension = opt.stackedCoordDimension;\n var dimensionDefineList;\n var schema;\n var store;\n if (isLegacyDimensionsInput(dimensionsInput)) {\n dimensionDefineList = dimensionsInput;\n } else {\n schema = dimensionsInput.schema;\n dimensionDefineList = schema.dimensions;\n store = dimensionsInput.store;\n }\n // Compatibal: when `stack` is set as '', do not stack.\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\n var stackedByDimInfo;\n var stackedDimInfo;\n var stackResultDimension;\n var stackedOverDimension;\n each(dimensionDefineList, function (dimensionInfo, index) {\n if (isString(dimensionInfo)) {\n dimensionDefineList[index] = dimensionInfo = {\n name: dimensionInfo\n };\n }\n if (mayStack && !dimensionInfo.isExtraCoord) {\n // Find the first ordinal dimension as the stackedByDimInfo.\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\n stackedByDimInfo = dimensionInfo;\n }\n // Find the first stackable dimension as the stackedDimInfo.\n if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\n stackedDimInfo = dimensionInfo;\n }\n }\n });\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\n // Compatible with previous design, value axis (time axis) only stack by index.\n // It may make sense if the user provides elaborately constructed data.\n byIndex = true;\n }\n // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n // That put stack logic in List is for using conveniently in echarts extensions, but it\n // might not be a good way.\n if (stackedDimInfo) {\n // Use a weird name that not duplicated with other names.\n // Also need to use seriesModel.id as postfix because different\n // series may share same data store. The stack dimension needs to be distinguished.\n stackResultDimension = '__\\0ecstackresult_' + seriesModel.id;\n stackedOverDimension = '__\\0ecstackedover_' + seriesModel.id;\n // Create inverted index to fast query index by value.\n if (stackedByDimInfo) {\n stackedByDimInfo.createInvertedIndices = true;\n }\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\n var stackedDimType = stackedDimInfo.type;\n var stackedDimCoordIndex_1 = 0;\n each(dimensionDefineList, function (dimensionInfo) {\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\n stackedDimCoordIndex_1++;\n }\n });\n var stackedOverDimensionDefine = {\n name: stackResultDimension,\n coordDim: stackedDimCoordDim_1,\n coordDimIndex: stackedDimCoordIndex_1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true,\n storeDimIndex: dimensionDefineList.length\n };\n var stackResultDimensionDefine = {\n name: stackedOverDimension,\n // This dimension contains stack base (generally, 0), so do not set it as\n // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\n coordDim: stackedOverDimension,\n coordDimIndex: stackedDimCoordIndex_1 + 1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true,\n storeDimIndex: dimensionDefineList.length + 1\n };\n if (schema) {\n if (store) {\n stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType);\n stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType);\n }\n schema.appendCalculationDimension(stackedOverDimensionDefine);\n schema.appendCalculationDimension(stackResultDimensionDefine);\n } else {\n dimensionDefineList.push(stackedOverDimensionDefine);\n dimensionDefineList.push(stackResultDimensionDefine);\n }\n }\n return {\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\n isStackedByIndex: byIndex,\n stackedOverDimension: stackedOverDimension,\n stackResultDimension: stackResultDimension\n };\n}\nfunction isLegacyDimensionsInput(dimensionsInput) {\n return !isSeriesDataSchema(dimensionsInput.schema);\n}\nexport function isDimensionStacked(data, stackedDim) {\n // Each single series only maps to one pair of axis. So we do not need to\n // check stackByDim, whatever stacked by a dimension or stacked by index.\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\n}\nexport function getStackedDimension(data, targetDim) {\n return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { getCoordSysInfoBySeries } from '../../model/referHelper.js';\nimport { createSourceFromSeriesDataOption } from '../../data/Source.js';\nimport { enableDataStack } from '../../data/helper/dataStackHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\nimport { SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nfunction getCoordSysDimDefs(seriesModel, coordSysInfo) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem.get(coordSysName);\n var coordSysDimDefs;\n if (coordSysInfo && coordSysInfo.coordSysDims) {\n coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType);\n }\n return dimInfo;\n });\n }\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n return coordSysDimDefs;\n}\nfunction injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) {\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n if (createInvertedIndices) {\n dimInfo.createInvertedIndices = true;\n }\n }\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n return firstCategoryDimIndex;\n}\n/**\n * Caution: there are side effects to `sourceManager` in this method.\n * Should better only be called in `Series['getInitialData']`.\n */\nfunction createSeriesData(sourceRaw, seriesModel, opt) {\n opt = opt || {};\n var sourceManager = seriesModel.getSourceManager();\n var source;\n var isOriginalSource = false;\n if (sourceRaw) {\n isOriginalSource = true;\n source = createSourceFromSeriesDataOption(sourceRaw);\n } else {\n source = sourceManager.getSource();\n // Is series.data. not dataset.\n isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL;\n }\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo);\n var useEncodeDefaulter = opt.useEncodeDefaulter;\n var encodeDefaulter = zrUtil.isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null;\n var createDimensionOptions = {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefine: seriesModel.getEncode(),\n encodeDefaulter: encodeDefaulter,\n canOmitUnusedDimensions: !isOriginalSource\n };\n var schema = prepareSeriesDataSchema(source, createDimensionOptions);\n var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo);\n var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null;\n var stackCalculationInfo = enableDataStack(seriesModel, {\n schema: schema,\n store: store\n });\n var data = new SeriesData(schema, seriesModel);\n data.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n data.hasItemOption = false;\n data.initData(\n // Try to reuse the data store in sourceManager if using dataset.\n isOriginalSource ? source : store, null, dimValueGetter);\n return data;\n}\nfunction isNeedCompleteOrdinalData(source) {\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var sampleItem = firstDataNotNull(source.data || []);\n return !zrUtil.isArray(getDataItemValue(sampleItem));\n }\n}\nfunction firstDataNotNull(arr) {\n var i = 0;\n while (i < arr.length && arr[i] == null) {\n i++;\n }\n return arr[i];\n}\nexport default createSeriesData;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as clazzUtil from '../util/clazz.js';\nvar Scale = /** @class */function () {\n function Scale(setting) {\n this._setting = setting || {};\n this._extent = [Infinity, -Infinity];\n }\n Scale.prototype.getSetting = function (name) {\n return this._setting[name];\n };\n /**\n * Set extent from data\n */\n Scale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]);\n // not setExtent because in log axis it may transformed to power\n // this.setExtent(extent[0], extent[1]);\n };\n /**\n * Set extent from data\n */\n Scale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\n * Get extent\n *\n * Extent is always in increase order.\n */\n Scale.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\n * Set extent\n */\n Scale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent;\n if (!isNaN(start)) {\n thisExtent[0] = start;\n }\n if (!isNaN(end)) {\n thisExtent[1] = end;\n }\n };\n /**\n * If value is in extent range\n */\n Scale.prototype.isInExtentRange = function (value) {\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n /**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */\n Scale.prototype.isBlank = function () {\n return this._isBlank;\n };\n /**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */\n Scale.prototype.setBlank = function (isBlank) {\n this._isBlank = isBlank;\n };\n return Scale;\n}();\nclazzUtil.enableClassManagement(Scale);\nexport default Scale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, isObject, map, isString } from 'zrender/lib/core/util.js';\nvar uidBase = 0;\nvar OrdinalMeta = /** @class */function () {\n function OrdinalMeta(opt) {\n this.categories = opt.categories || [];\n this._needCollect = opt.needCollect;\n this._deduplication = opt.deduplication;\n this.uid = ++uidBase;\n }\n OrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n };\n ;\n OrdinalMeta.prototype.getOrdinal = function (category) {\n // @ts-ignore\n return this._getOrCreateMap().get(category);\n };\n /**\n * @return The ordinal. If not found, return NaN.\n */\n OrdinalMeta.prototype.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect;\n // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n if (!isString(category) && !needCollect) {\n return category;\n }\n // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n var map = this._getOrCreateMap();\n // @ts-ignore\n index = map.get(category);\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category;\n // @ts-ignore\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n return index;\n };\n // Consider big data, do not create map until needed.\n OrdinalMeta.prototype._getOrCreateMap = function () {\n return this._map || (this._map = createHashMap(this.categories));\n };\n return OrdinalMeta;\n}();\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\nexport default OrdinalMeta;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getPrecision, round, nice, quantityExponent } from '../util/number.js';\nexport function isValueNice(val) {\n var exp10 = Math.pow(10, quantityExponent(Math.abs(val)));\n var f = Math.abs(val / exp10);\n return f === 0 || f === 1 || f === 2 || f === 3 || f === 5;\n}\nexport function isIntervalOrLogScale(scale) {\n return scale.type === 'interval' || scale.type === 'log';\n}\n/**\n * @param extent Both extent[0] and extent[1] should be valid number.\n * Should be extent[0] < extent[1].\n * @param splitNumber splitNumber should be >= 1.\n */\nexport function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\n var result = {};\n var span = extent[1] - extent[0];\n var interval = result.interval = nice(span / splitNumber, true);\n if (minInterval != null && interval < minInterval) {\n interval = result.interval = minInterval;\n }\n if (maxInterval != null && interval > maxInterval) {\n interval = result.interval = maxInterval;\n }\n // Tow more digital for tick.\n var precision = result.intervalPrecision = getIntervalPrecision(interval);\n // Niced extent inside original extent\n var niceTickExtent = result.niceTickExtent = [round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.floor(extent[1] / interval) * interval, precision)];\n fixExtent(niceTickExtent, extent);\n return result;\n}\nexport function increaseInterval(interval) {\n var exp10 = Math.pow(10, quantityExponent(interval));\n // Increase interval\n var f = interval / exp10;\n if (!f) {\n f = 1;\n } else if (f === 2) {\n f = 3;\n } else if (f === 3) {\n f = 5;\n } else {\n // f is 1 or 5\n f *= 2;\n }\n return round(f * exp10);\n}\n/**\n * @return interval precision\n */\nexport function getIntervalPrecision(interval) {\n // Tow more digital for tick.\n return getPrecision(interval) + 2;\n}\nfunction clamp(niceTickExtent, idx, extent) {\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n}\n// In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\nexport function fixExtent(niceTickExtent, extent) {\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n clamp(niceTickExtent, 0, extent);\n clamp(niceTickExtent, 1, extent);\n if (niceTickExtent[0] > niceTickExtent[1]) {\n niceTickExtent[0] = niceTickExtent[1];\n }\n}\nexport function contain(val, extent) {\n return val >= extent[0] && val <= extent[1];\n}\nexport function normalize(val, extent) {\n if (extent[1] === extent[0]) {\n return 0.5;\n }\n return (val - extent[0]) / (extent[1] - extent[0]);\n}\nexport function scale(val, extent) {\n return val * (extent[1] - extent[0]) + extent[0];\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Linear continuous scale\n * http://en.wikipedia.org/wiki/Level_of_measurement\n */\n// FIXME only one data\nimport Scale from './Scale.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport * as scaleHelper from './helper.js';\nimport { isArray, map, isObject, isString } from 'zrender/lib/core/util.js';\nvar OrdinalScale = /** @class */function (_super) {\n __extends(OrdinalScale, _super);\n function OrdinalScale(setting) {\n var _this = _super.call(this, setting) || this;\n _this.type = 'ordinal';\n var ordinalMeta = _this.getSetting('ordinalMeta');\n // Caution: Should not use instanceof, consider ec-extensions using\n // import approach to get OrdinalMeta class.\n if (!ordinalMeta) {\n ordinalMeta = new OrdinalMeta({});\n }\n if (isArray(ordinalMeta)) {\n ordinalMeta = new OrdinalMeta({\n categories: map(ordinalMeta, function (item) {\n return isObject(item) ? item.value : item;\n })\n });\n }\n _this._ordinalMeta = ordinalMeta;\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\n return _this;\n }\n OrdinalScale.prototype.parse = function (val) {\n // Caution: Math.round(null) will return `0` rather than `NaN`\n if (val == null) {\n return NaN;\n }\n return isString(val) ? this._ordinalMeta.getOrdinal(val)\n // val might be float.\n : Math.round(val);\n };\n OrdinalScale.prototype.contain = function (rank) {\n rank = this.parse(rank);\n return scaleHelper.contain(rank, this._extent) && this._ordinalMeta.categories[rank] != null;\n };\n /**\n * Normalize given rank or name to linear [0, 1]\n * @param val raw ordinal number.\n * @return normalized value in [0, 1].\n */\n OrdinalScale.prototype.normalize = function (val) {\n val = this._getTickNumber(this.parse(val));\n return scaleHelper.normalize(val, this._extent);\n };\n /**\n * @param val normalized value in [0, 1].\n * @return raw ordinal number.\n */\n OrdinalScale.prototype.scale = function (val) {\n val = Math.round(scaleHelper.scale(val, this._extent));\n return this.getRawOrdinalNumber(val);\n };\n OrdinalScale.prototype.getTicks = function () {\n var ticks = [];\n var extent = this._extent;\n var rank = extent[0];\n while (rank <= extent[1]) {\n ticks.push({\n value: rank\n });\n rank++;\n }\n return ticks;\n };\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\n // Not support.\n return;\n };\n /**\n * @see `Ordinal['_ordinalNumbersByTick']`\n */\n OrdinalScale.prototype.setSortInfo = function (info) {\n if (info == null) {\n this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;\n return;\n }\n var infoOrdinalNumbers = info.ordinalNumbers;\n var ordinalsByTick = this._ordinalNumbersByTick = [];\n var ticksByOrdinal = this._ticksByOrdinalNumber = [];\n // Unnecessary support negative tick in `realtimeSort`.\n var tickNum = 0;\n var allCategoryLen = this._ordinalMeta.categories.length;\n for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) {\n var ordinalNumber = infoOrdinalNumbers[tickNum];\n ordinalsByTick[tickNum] = ordinalNumber;\n ticksByOrdinal[ordinalNumber] = tickNum;\n }\n // Handle that `series.data` only covers part of the `axis.category.data`.\n var unusedOrdinal = 0;\n for (; tickNum < allCategoryLen; ++tickNum) {\n while (ticksByOrdinal[unusedOrdinal] != null) {\n unusedOrdinal++;\n }\n ;\n ordinalsByTick.push(unusedOrdinal);\n ticksByOrdinal[unusedOrdinal] = tickNum;\n }\n };\n OrdinalScale.prototype._getTickNumber = function (ordinal) {\n var ticksByOrdinalNumber = this._ticksByOrdinalNumber;\n // also support ordinal out of range of `ordinalMeta.categories.length`,\n // where ordinal numbers are used as tick value directly.\n return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal;\n };\n /**\n * @usage\n * ```js\n * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);\n *\n * // case0\n * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];\n * // case1\n * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];\n * // case2\n * const coord = axis.dataToCoord(ordinalNumber);\n * ```\n *\n * @param {OrdinalNumber} tickNumber index of display\n */\n OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) {\n var ordinalNumbersByTick = this._ordinalNumbersByTick;\n // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,\n // where ordinal numbers are used as tick value directly.\n return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber;\n };\n /**\n * Get item on tick\n */\n OrdinalScale.prototype.getLabel = function (tick) {\n if (!this.isBlank()) {\n var ordinalNumber = this.getRawOrdinalNumber(tick.value);\n var cateogry = this._ordinalMeta.categories[ordinalNumber];\n // Note that if no data, ordinalMeta.categories is an empty array.\n // Return empty if it's not exist.\n return cateogry == null ? '' : cateogry + '';\n }\n };\n OrdinalScale.prototype.count = function () {\n return this._extent[1] - this._extent[0] + 1;\n };\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\n * @override\n * If value is in extent range\n */\n OrdinalScale.prototype.isInExtentRange = function (value) {\n value = this._getTickNumber(value);\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n OrdinalScale.prototype.getOrdinalMeta = function () {\n return this._ordinalMeta;\n };\n OrdinalScale.prototype.calcNiceTicks = function () {};\n OrdinalScale.prototype.calcNiceExtent = function () {};\n OrdinalScale.type = 'ordinal';\n return OrdinalScale;\n}(Scale);\nScale.registerClass(OrdinalScale);\nexport default OrdinalScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as numberUtil from '../util/number.js';\nimport * as formatUtil from '../util/format.js';\nimport Scale from './Scale.js';\nimport * as helper from './helper.js';\nvar roundNumber = numberUtil.round;\nvar IntervalScale = /** @class */function (_super) {\n __extends(IntervalScale, _super);\n function IntervalScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'interval';\n // Step is calculated in adjustExtent.\n _this._interval = 0;\n _this._intervalPrecision = 2;\n return _this;\n }\n IntervalScale.prototype.parse = function (val) {\n return val;\n };\n IntervalScale.prototype.contain = function (val) {\n return helper.contain(val, this._extent);\n };\n IntervalScale.prototype.normalize = function (val) {\n return helper.normalize(val, this._extent);\n };\n IntervalScale.prototype.scale = function (val) {\n return helper.scale(val, this._extent);\n };\n IntervalScale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent;\n // start,end may be a Number like '25',so...\n if (!isNaN(start)) {\n thisExtent[0] = parseFloat(start);\n }\n if (!isNaN(end)) {\n thisExtent[1] = parseFloat(end);\n }\n };\n IntervalScale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]);\n // unionExtent may called by it's sub classes\n this.setExtent(extent[0], extent[1]);\n };\n IntervalScale.prototype.getInterval = function () {\n return this._interval;\n };\n IntervalScale.prototype.setInterval = function (interval) {\n this._interval = interval;\n // Dropped auto calculated niceExtent and use user-set extent.\n // We assume user wants to set both interval, min, max to get a better result.\n this._niceExtent = this._extent.slice();\n this._intervalPrecision = helper.getIntervalPrecision(interval);\n };\n /**\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\n */\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var niceTickExtent = this._niceExtent;\n var intervalPrecision = this._intervalPrecision;\n var ticks = [];\n // If interval is 0, return [];\n if (!interval) {\n return ticks;\n }\n // Consider this case: using dataZoom toolbox, zoom and zoom.\n var safeLimit = 10000;\n if (extent[0] < niceTickExtent[0]) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[0]\n });\n }\n }\n var tick = niceTickExtent[0];\n while (tick <= niceTickExtent[1]) {\n ticks.push({\n value: tick\n });\n // Avoid rounding error\n tick = roundNumber(tick + interval, intervalPrecision);\n if (tick === ticks[ticks.length - 1].value) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n if (ticks.length > safeLimit) {\n return [];\n }\n }\n // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\n if (extent[1] > lastNiceTick) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(lastNiceTick + interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[1]\n });\n }\n }\n return ticks;\n };\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\n var ticks = this.getTicks(true);\n var minorTicks = [];\n var extent = this.getExtent();\n for (var i = 1; i < ticks.length; i++) {\n var nextTick = ticks[i];\n var prevTick = ticks[i - 1];\n var count = 0;\n var minorTicksGroup = [];\n var interval = nextTick.value - prevTick.value;\n var minorInterval = interval / splitNumber;\n while (count < splitNumber - 1) {\n var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval);\n // For the first and last interval. The count may be less than splitNumber.\n if (minorTick > extent[0] && minorTick < extent[1]) {\n minorTicksGroup.push(minorTick);\n }\n count++;\n }\n minorTicks.push(minorTicksGroup);\n }\n return minorTicks;\n };\n /**\n * @param opt.precision If 'auto', use nice presision.\n * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\n */\n IntervalScale.prototype.getLabel = function (data, opt) {\n if (data == null) {\n return '';\n }\n var precision = opt && opt.precision;\n if (precision == null) {\n precision = numberUtil.getPrecision(data.value) || 0;\n } else if (precision === 'auto') {\n // Should be more precise then tick.\n precision = this._intervalPrecision;\n }\n // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n var dataNum = roundNumber(data.value, precision, true);\n return formatUtil.addCommas(dataNum);\n };\n /**\n * @param splitNumber By default `5`.\n */\n IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) {\n splitNumber = splitNumber || 5;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n if (!isFinite(span)) {\n return;\n }\n // User may set axis min 0 and data are all negative\n // FIXME If it needs to reverse ?\n if (span < 0) {\n span = -span;\n extent.reverse();\n }\n var result = helper.intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\n this._intervalPrecision = result.intervalPrecision;\n this._interval = result.interval;\n this._niceExtent = result.niceTickExtent;\n };\n IntervalScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent;\n // If extent start and end are same, expand them\n if (extent[0] === extent[1]) {\n if (extent[0] !== 0) {\n // Expand extent\n // Note that extents can be both negative. See #13154\n var expandSize = Math.abs(extent[0]);\n // In the fowllowing case\n // Axis has been fixed max 100\n // Plus data are all 100 and axis extent are [100, 100].\n // Extend to the both side will cause expanded max is larger than fixed max.\n // So only expand to the smaller side.\n if (!opt.fixMax) {\n extent[1] += expandSize / 2;\n extent[0] -= expandSize / 2;\n } else {\n extent[0] -= expandSize / 2;\n }\n } else {\n extent[1] = 1;\n }\n }\n var span = extent[1] - extent[0];\n // If there are no data and extent are [Infinity, -Infinity]\n if (!isFinite(span)) {\n extent[0] = 0;\n extent[1] = 1;\n }\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\n // let extent = this._extent;\n var interval = this._interval;\n if (!opt.fixMin) {\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\n }\n if (!opt.fixMax) {\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\n }\n };\n IntervalScale.prototype.setNiceExtent = function (min, max) {\n this._niceExtent = [min, max];\n };\n IntervalScale.type = 'interval';\n return IntervalScale;\n}(Scale);\nScale.registerClass(IntervalScale);\nexport default IntervalScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\n/* global Float32Array */\nvar supportFloat32Array = typeof Float32Array !== 'undefined';\nvar Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\nexport function createFloat32Array(arg) {\n if (isArray(arg)) {\n // Return self directly if don't support TypedArray.\n return supportFloat32Array ? new Float32Array(arg) : arg;\n }\n // Else is number\n return new Float32ArrayCtor(arg);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, defaults, keys } from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { createFloat32Array } from '../util/vendor.js';\nvar STACK_PREFIX = '__ec_stack_';\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\n}\nfunction getAxisKey(axis) {\n return axis.dim + axis.index;\n}\n/**\n * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.\n */\nexport function getLayoutOnAxis(opt) {\n var params = [];\n var baseAxis = opt.axis;\n var axisKey = 'axis0';\n if (baseAxis.type !== 'category') {\n return;\n }\n var bandWidth = baseAxis.getBandWidth();\n for (var i = 0; i < opt.count || 0; i++) {\n params.push(defaults({\n bandWidth: bandWidth,\n axisKey: axisKey,\n stackId: STACK_PREFIX + i\n }, opt));\n }\n var widthAndOffsets = doCalBarWidthAndOffset(params);\n var result = [];\n for (var i = 0; i < opt.count; i++) {\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\n item.offsetCenter = item.offset + item.width / 2;\n result.push(item);\n }\n return result;\n}\nexport function prepareLayoutBarSeries(seriesType, ecModel) {\n var seriesModels = [];\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for cartesian2d only\n if (isOnCartesian(seriesModel)) {\n seriesModels.push(seriesModel);\n }\n });\n return seriesModels;\n}\n/**\n * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent\n * values.\n * This works for time axes, value axes, and log axes.\n * For a single time axis, return value is in the form like\n * {'x_0': [1000000]}.\n * The value of 1000000 is in milliseconds.\n */\nfunction getValueAxesMinGaps(barSeries) {\n /**\n * Map from axis.index to values.\n * For a single time axis, axisValues is in the form like\n * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.\n * Items in axisValues[x], e.g. 1495555200000, are time values of all\n * series.\n */\n var axisValues = {};\n each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\n return;\n }\n var data = seriesModel.getData();\n var key = baseAxis.dim + '_' + baseAxis.index;\n var dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n var store = data.getStore();\n for (var i = 0, cnt = store.count(); i < cnt; ++i) {\n var value = store.get(dimIdx, i);\n if (!axisValues[key]) {\n // No previous data for the axis\n axisValues[key] = [value];\n } else {\n // No value in previous series\n axisValues[key].push(value);\n }\n // Ignore duplicated time values in the same axis\n }\n });\n\n var axisMinGaps = {};\n for (var key in axisValues) {\n if (axisValues.hasOwnProperty(key)) {\n var valuesInAxis = axisValues[key];\n if (valuesInAxis) {\n // Sort axis values into ascending order to calculate gaps\n valuesInAxis.sort(function (a, b) {\n return a - b;\n });\n var min = null;\n for (var j = 1; j < valuesInAxis.length; ++j) {\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\n if (delta > 0) {\n // Ignore 0 delta because they are of the same axis value\n min = min === null ? delta : Math.min(min, delta);\n }\n }\n // Set to null if only have one data\n axisMinGaps[key] = min;\n }\n }\n }\n return axisMinGaps;\n}\nexport function makeColumnLayout(barSeries) {\n var axisMinGaps = getValueAxesMinGaps(barSeries);\n var seriesInfoList = [];\n each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth;\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n var minGap = axisMinGaps[key];\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\n var scale = baseAxis.scale.getExtent();\n var scaleSpan = Math.abs(scale[1] - scale[0]);\n bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value\n } else {\n var data = seriesModel.getData();\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n }\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barMinWidth = parsePercent(\n // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,\n // the auto-calculated bar width might be less than 0.5 / 1.\n seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n seriesInfoList.push({\n bandWidth: bandWidth,\n barWidth: barWidth,\n barMaxWidth: barMaxWidth,\n barMinWidth: barMinWidth,\n barGap: barGap,\n barCategoryGap: barCategoryGap,\n axisKey: getAxisKey(baseAxis),\n stackId: getSeriesStackId(seriesModel)\n });\n });\n return doCalBarWidthAndOffset(seriesInfoList);\n}\nfunction doCalBarWidthAndOffset(seriesInfoList) {\n // Columns info on each category axis. Key is cartesian name\n var columnsMap = {};\n each(seriesInfoList, function (seriesInfo, idx) {\n var axisKey = seriesInfo.axisKey;\n var bandWidth = seriesInfo.bandWidth;\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: null,\n gap: '20%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = seriesInfo.stackId;\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n // Caution: In a single coordinate system, these barGrid attributes\n // will be shared by series. Consider that they have default values,\n // only the attributes set on the last series will work.\n // Do not change this fact unless there will be a break change.\n var barWidth = seriesInfo.barWidth;\n if (barWidth && !stacks[stackId].width) {\n // See #6312, do not restrict width.\n stacks[stackId].width = barWidth;\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n columnsOnAxis.remainedWidth -= barWidth;\n }\n var barMaxWidth = seriesInfo.barMaxWidth;\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n var barMinWidth = seriesInfo.barMinWidth;\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\n var barGap = seriesInfo.barGap;\n barGap != null && (columnsOnAxis.gap = barGap);\n var barCategoryGap = seriesInfo.barCategoryGap;\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGapPercent = columnsOnAxis.categoryGap;\n if (categoryGapPercent == null) {\n var columnCount = keys(stacks).length;\n // More columns in one group\n // the spaces between group is smaller. Or the column will be too thin.\n categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%';\n }\n var categoryGap = parsePercent(categoryGapPercent, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n // Find if any auto calculated bar exceeded maxBarWidth\n each(stacks, function (column) {\n var maxWidth = column.maxWidth;\n var minWidth = column.minWidth;\n if (!column.width) {\n var finalWidth = autoWidth;\n if (maxWidth && maxWidth < finalWidth) {\n finalWidth = Math.min(maxWidth, remainedWidth);\n }\n // `minWidth` has higher priority. `minWidth` decide that whether the\n // bar is able to be visible. So `minWidth` should not be restricted\n // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In\n // the extreme cases for `value` axis, bars are allowed to overlap\n // with each other if `minWidth` specified.\n if (minWidth && minWidth > finalWidth) {\n finalWidth = minWidth;\n }\n if (finalWidth !== autoWidth) {\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n } else {\n // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n // CSS does. Because barWidth can be a percent value, where\n // `barMaxWidth` can be used to restrict the final width.\n var finalWidth = column.width;\n if (maxWidth) {\n finalWidth = Math.min(finalWidth, maxWidth);\n }\n // `minWidth` has higher priority, as described above\n if (minWidth) {\n finalWidth = Math.max(finalWidth, minWidth);\n }\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n });\n // Recalculate width again\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n var offset = -widthSum / 2;\n each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n bandWidth: bandWidth,\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\n if (barWidthAndOffset && axis) {\n var result = barWidthAndOffset[getAxisKey(axis)];\n if (result != null && seriesModel != null) {\n return result[getSeriesStackId(seriesModel)];\n }\n return result;\n }\n}\nexport { retrieveColumnLayout };\nexport function layout(seriesType, ecModel) {\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\n var barWidthAndOffset = makeColumnLayout(seriesModels);\n each(seriesModels, function (seriesModel) {\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n data.setLayout({\n bandWidth: columnLayoutInfo.bandWidth,\n offset: columnOffset,\n size: columnWidth\n });\n });\n}\n// TODO: Do not support stack in large mode yet.\nexport function createProgressiveLayout(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n if (!isOnCartesian(seriesModel)) {\n return;\n }\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var valueAxis = cartesian.getOtherAxis(baseAxis);\n var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim));\n var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n var drawBackground = seriesModel.get('showBackground', true);\n var valueDim = data.mapDimension(valueAxis.dim);\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries');\n var isValueAxisH = valueAxis.isHorizontal();\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\n var isLarge = isInLargeMode(seriesModel);\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim);\n // Layout info.\n var columnWidth = data.getLayout('size');\n var columnOffset = data.getLayout('offset');\n return {\n progress: function (params, data) {\n var count = params.count;\n var largePoints = isLarge && createFloat32Array(count * 3);\n var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3);\n var largeDataIndices = isLarge && createFloat32Array(count);\n var coordLayout = cartesian.master.getRect();\n var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height;\n var dataIndex;\n var store = data.getStore();\n var idxOffset = 0;\n while ((dataIndex = params.next()) != null) {\n var value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex);\n var baseValue = store.get(baseDimIdx, dataIndex);\n var baseCoord = valueAxisStart;\n var stackStartValue = void 0;\n // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n if (stacked) {\n stackStartValue = +value - store.get(valueDimIdx, dataIndex);\n }\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n if (isValueAxisH) {\n var coord = cartesian.dataToPoint([value, baseValue]);\n if (stacked) {\n var startCoord = cartesian.dataToPoint([stackStartValue, baseValue]);\n baseCoord = startCoord[0];\n }\n x = baseCoord;\n y = coord[1] + columnOffset;\n width = coord[0] - baseCoord;\n height = columnWidth;\n if (Math.abs(width) < barMinHeight) {\n width = (width < 0 ? -1 : 1) * barMinHeight;\n }\n } else {\n var coord = cartesian.dataToPoint([baseValue, value]);\n if (stacked) {\n var startCoord = cartesian.dataToPoint([baseValue, stackStartValue]);\n baseCoord = startCoord[1];\n }\n x = coord[0] + columnOffset;\n y = baseCoord;\n width = columnWidth;\n height = coord[1] - baseCoord;\n if (Math.abs(height) < barMinHeight) {\n // Include zero to has a positive bar\n height = (height <= 0 ? -1 : 1) * barMinHeight;\n }\n }\n if (!isLarge) {\n data.setItemLayout(dataIndex, {\n x: x,\n y: y,\n width: width,\n height: height\n });\n } else {\n largePoints[idxOffset] = x;\n largePoints[idxOffset + 1] = y;\n largePoints[idxOffset + 2] = isValueAxisH ? width : height;\n if (largeBackgroundPoints) {\n largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x;\n largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y;\n largeBackgroundPoints[idxOffset + 2] = bgSize;\n }\n largeDataIndices[dataIndex] = dataIndex;\n }\n idxOffset += 3;\n }\n if (isLarge) {\n data.setLayout({\n largePoints: largePoints,\n largeDataIndices: largeDataIndices,\n largeBackgroundPoints: largeBackgroundPoints,\n valueAxisHorizontal: isValueAxisH\n });\n }\n }\n };\n }\n };\n}\nfunction isOnCartesian(seriesModel) {\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\n}\nfunction isInLargeMode(seriesModel) {\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\n}\n// See cases in `test/bar-start.html` and `#7412`, `#8747`.\nfunction getValueAxisStart(baseAxis, valueAxis) {\n var startValue = valueAxis.model.get('startValue');\n if (!startValue) {\n startValue = 0;\n }\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? startValue > 0 ? startValue : 1 : startValue));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/*\n* A third-party license is embedded for some of the code in this file:\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\n// [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design has\n// considered these common cases:\n// (1) Time that is persistent in server is in UTC, but it is needed to be displayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\nimport * as numberUtil from '../util/number.js';\nimport { ONE_SECOND, ONE_MINUTE, ONE_HOUR, ONE_DAY, ONE_YEAR, format, leveledFormat, getUnitValue, timeUnits, fullLeveledFormatter, getPrimaryTimeUnit, isPrimaryTimeUnit, getDefaultFormatPrecisionOfInterval, fullYearGetterName, monthSetterName, fullYearSetterName, dateSetterName, hoursGetterName, hoursSetterName, minutesSetterName, secondsSetterName, millisecondsSetterName, monthGetterName, dateGetterName, minutesGetterName, secondsGetterName, millisecondsGetterName } from '../util/time.js';\nimport * as scaleHelper from './helper.js';\nimport IntervalScale from './Interval.js';\nimport Scale from './Scale.js';\nimport { warn } from '../util/log.js';\nimport { filter, isNumber, map } from 'zrender/lib/core/util.js';\n// FIXME 公用?\nvar bisect = function (a, x, lo, hi) {\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (a[mid][1] < x) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n return lo;\n};\nvar TimeScale = /** @class */function (_super) {\n __extends(TimeScale, _super);\n function TimeScale(settings) {\n var _this = _super.call(this, settings) || this;\n _this.type = 'time';\n return _this;\n }\n /**\n * Get label is mainly for other components like dataZoom, tooltip.\n */\n TimeScale.prototype.getLabel = function (tick) {\n var useUTC = this.getSetting('useUTC');\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\n };\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\n var isUTC = this.getSetting('useUTC');\n var lang = this.getSetting('locale');\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\n };\n /**\n * @override\n */\n TimeScale.prototype.getTicks = function () {\n var interval = this._interval;\n var extent = this._extent;\n var ticks = [];\n // If interval is 0, return [];\n if (!interval) {\n return ticks;\n }\n ticks.push({\n value: extent[0],\n level: 0\n });\n var useUTC = this.getSetting('useUTC');\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\n ticks = ticks.concat(innerTicks);\n ticks.push({\n value: extent[1],\n level: 0\n });\n return ticks;\n };\n TimeScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent;\n // If extent start and end are same, expand them\n if (extent[0] === extent[1]) {\n // Expand extent\n extent[0] -= ONE_DAY;\n extent[1] += ONE_DAY;\n }\n // If there are no data and extent are [Infinity, -Infinity]\n if (extent[1] === -Infinity && extent[0] === Infinity) {\n var d = new Date();\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\n extent[0] = extent[1] - ONE_DAY;\n }\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\n };\n TimeScale.prototype.calcNiceTicks = function (approxTickNum, minInterval, maxInterval) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n this._approxInterval = span / approxTickNum;\n if (minInterval != null && this._approxInterval < minInterval) {\n this._approxInterval = minInterval;\n }\n if (maxInterval != null && this._approxInterval > maxInterval) {\n this._approxInterval = maxInterval;\n }\n var scaleIntervalsLen = scaleIntervals.length;\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);\n // Interval that can be used to calculate ticks\n this._interval = scaleIntervals[idx][1];\n // Min level used when picking ticks from top down.\n // We check one more level to avoid the ticks are to sparse in some case.\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\n };\n TimeScale.prototype.parse = function (val) {\n // val might be float.\n return isNumber(val) ? val : +numberUtil.parseDate(val);\n };\n TimeScale.prototype.contain = function (val) {\n return scaleHelper.contain(this.parse(val), this._extent);\n };\n TimeScale.prototype.normalize = function (val) {\n return scaleHelper.normalize(this.parse(val), this._extent);\n };\n TimeScale.prototype.scale = function (val) {\n return scaleHelper.scale(val, this._extent);\n };\n TimeScale.type = 'time';\n return TimeScale;\n}(IntervalScale);\n/**\n * This implementation was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\nvar scaleIntervals = [\n// Format interval\n['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y\n];\n\nfunction isUnitValueSame(unit, valueA, valueB, isUTC) {\n var dateA = numberUtil.parseDate(valueA);\n var dateB = numberUtil.parseDate(valueB);\n var isSame = function (unit) {\n return getUnitValue(dateA, unit, isUTC) === getUnitValue(dateB, unit, isUTC);\n };\n var isSameYear = function () {\n return isSame('year');\n };\n // const isSameHalfYear = () => isSameYear() && isSame('half-year');\n // const isSameQuater = () => isSameYear() && isSame('quarter');\n var isSameMonth = function () {\n return isSameYear() && isSame('month');\n };\n var isSameDay = function () {\n return isSameMonth() && isSame('day');\n };\n // const isSameHalfDay = () => isSameDay() && isSame('half-day');\n var isSameHour = function () {\n return isSameDay() && isSame('hour');\n };\n var isSameMinute = function () {\n return isSameHour() && isSame('minute');\n };\n var isSameSecond = function () {\n return isSameMinute() && isSame('second');\n };\n var isSameMilliSecond = function () {\n return isSameSecond() && isSame('millisecond');\n };\n switch (unit) {\n case 'year':\n return isSameYear();\n case 'month':\n return isSameMonth();\n case 'day':\n return isSameDay();\n case 'hour':\n return isSameHour();\n case 'minute':\n return isSameMinute();\n case 'second':\n return isSameSecond();\n case 'millisecond':\n return isSameMilliSecond();\n }\n}\n// const primaryUnitGetters = {\n// year: fullYearGetterName(),\n// month: monthGetterName(),\n// day: dateGetterName(),\n// hour: hoursGetterName(),\n// minute: minutesGetterName(),\n// second: secondsGetterName(),\n// millisecond: millisecondsGetterName()\n// };\n// const primaryUnitUTCGetters = {\n// year: fullYearGetterName(true),\n// month: monthGetterName(true),\n// day: dateGetterName(true),\n// hour: hoursGetterName(true),\n// minute: minutesGetterName(true),\n// second: secondsGetterName(true),\n// millisecond: millisecondsGetterName(true)\n// };\n// function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {\n// step = step || 1;\n// switch (getPrimaryTimeUnit(unitName)) {\n// case 'year':\n// date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);\n// break;\n// case 'month':\n// date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);\n// break;\n// case 'day':\n// date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);\n// break;\n// case 'hour':\n// date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);\n// break;\n// case 'minute':\n// date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);\n// break;\n// case 'second':\n// date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);\n// break;\n// case 'millisecond':\n// date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);\n// break;\n// }\n// return date.getTime();\n// }\n// const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];\n// const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];\n// const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];\nfunction getDateInterval(approxInterval, daysInMonth) {\n approxInterval /= ONE_DAY;\n return approxInterval > 16 ? 16\n // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick between two months.\n : approxInterval > 7.5 ? 7 // TODO week 7 or day 8?\n : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1;\n}\nfunction getMonthInterval(approxInterval) {\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\n approxInterval /= APPROX_ONE_MONTH;\n return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1;\n}\nfunction getHourInterval(approxInterval) {\n approxInterval /= ONE_HOUR;\n return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1;\n}\nfunction getMinutesAndSecondsInterval(approxInterval, isMinutes) {\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\n return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1;\n}\nfunction getMillisecondsInterval(approxInterval) {\n return numberUtil.nice(approxInterval, true);\n}\nfunction getFirstTimestampOfUnit(date, unitName, isUTC) {\n var outDate = new Date(date);\n switch (getPrimaryTimeUnit(unitName)) {\n case 'year':\n case 'month':\n outDate[monthSetterName(isUTC)](0);\n case 'day':\n outDate[dateSetterName(isUTC)](1);\n case 'hour':\n outDate[hoursSetterName(isUTC)](0);\n case 'minute':\n outDate[minutesSetterName(isUTC)](0);\n case 'second':\n outDate[secondsSetterName(isUTC)](0);\n outDate[millisecondsSetterName(isUTC)](0);\n }\n return outDate.getTime();\n}\nfunction getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\n var safeLimit = 10000;\n var unitNames = timeUnits;\n var iter = 0;\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\n var date = new Date(minTimestamp);\n var dateTime = minTimestamp;\n var d = date[getMethodName]();\n // if (isDate) {\n // d -= 1; // Starts with 0; PENDING\n // }\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\n out.push({\n value: dateTime\n });\n d += interval;\n date[setMethodName](d);\n dateTime = date.getTime();\n }\n // This extra tick is for calcuating ticks of next level. Will not been added to the final result\n out.push({\n value: dateTime,\n notAdd: true\n });\n }\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\n var newAddedTicks = [];\n var isFirstLevel = !lastLevelTicks.length;\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\n return;\n }\n if (isFirstLevel) {\n lastLevelTicks = [{\n // TODO Optimize. Not include so may ticks.\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\n }, {\n value: extent[1]\n }];\n }\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\n var startTick = lastLevelTicks[i].value;\n var endTick = lastLevelTicks[i + 1].value;\n if (startTick === endTick) {\n continue;\n }\n var interval = void 0;\n var getterName = void 0;\n var setterName = void 0;\n var isDate = false;\n switch (unitName) {\n case 'year':\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\n getterName = fullYearGetterName(isUTC);\n setterName = fullYearSetterName(isUTC);\n break;\n case 'half-year':\n case 'quarter':\n case 'month':\n interval = getMonthInterval(approxInterval);\n getterName = monthGetterName(isUTC);\n setterName = monthSetterName(isUTC);\n break;\n case 'week': // PENDING If week is added. Ignore day.\n case 'half-week':\n case 'day':\n interval = getDateInterval(approxInterval, 31); // Use 32 days and let interval been 16\n getterName = dateGetterName(isUTC);\n setterName = dateSetterName(isUTC);\n isDate = true;\n break;\n case 'half-day':\n case 'quarter-day':\n case 'hour':\n interval = getHourInterval(approxInterval);\n getterName = hoursGetterName(isUTC);\n setterName = hoursSetterName(isUTC);\n break;\n case 'minute':\n interval = getMinutesAndSecondsInterval(approxInterval, true);\n getterName = minutesGetterName(isUTC);\n setterName = minutesSetterName(isUTC);\n break;\n case 'second':\n interval = getMinutesAndSecondsInterval(approxInterval, false);\n getterName = secondsGetterName(isUTC);\n setterName = secondsSetterName(isUTC);\n break;\n case 'millisecond':\n interval = getMillisecondsInterval(approxInterval);\n getterName = millisecondsGetterName(isUTC);\n setterName = millisecondsSetterName(isUTC);\n break;\n }\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\n // Add nearest years to the left extent.\n levelTicks.unshift({\n value: levelTicks[0].value - interval\n });\n }\n }\n for (var i = 0; i < newAddedTicks.length; i++) {\n levelTicks.push(newAddedTicks[i]);\n }\n // newAddedTicks.length && console.log(unitName, newAddedTicks);\n return newAddedTicks;\n }\n var levelsTicks = [];\n var currentLevelTicks = [];\n var tickCount = 0;\n var lastLevelTickCount = 0;\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\n if (!isPrimaryTimeUnit(unitNames[i])) {\n // TODO\n continue;\n }\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\n if (currentLevelTicks.length) {\n lastLevelTickCount = tickCount;\n // Remove the duplicate so the tick count can be precisely.\n currentLevelTicks.sort(function (a, b) {\n return a.value - b.value;\n });\n var levelTicksRemoveDuplicated = [];\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\n var tickValue = currentLevelTicks[i_1].value;\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\n tickCount++;\n }\n }\n }\n var targetTickNum = (extent[1] - extent[0]) / approxInterval;\n // Added too much in this level and not too less in last level\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\n break;\n }\n // Only treat primary time unit as one level.\n levelsTicks.push(levelTicksRemoveDuplicated);\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\n break;\n }\n }\n // Reset if next unitName is primary\n currentLevelTicks = [];\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n if (iter >= safeLimit) {\n warn('Exceed safe limit.');\n }\n }\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\n return filter(levelTicks, function (tick) {\n return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd;\n });\n }), function (levelTicks) {\n return levelTicks.length > 0;\n });\n var ticks = [];\n var maxLevel = levelsTicksInExtent.length - 1;\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\n var levelTicks = levelsTicksInExtent[i];\n for (var k = 0; k < levelTicks.length; ++k) {\n ticks.push({\n value: levelTicks[k].value,\n level: maxLevel - i\n });\n }\n }\n ticks.sort(function (a, b) {\n return a.value - b.value;\n });\n // Remove duplicates\n var result = [];\n for (var i = 0; i < ticks.length; ++i) {\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\n result.push(ticks[i]);\n }\n }\n return result;\n}\nScale.registerClass(TimeScale);\nexport default TimeScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Scale from './Scale.js';\nimport * as numberUtil from '../util/number.js';\nimport * as scaleHelper from './helper.js';\n// Use some method of IntervalScale\nimport IntervalScale from './Interval.js';\nvar scaleProto = Scale.prototype;\n// FIXME:TS refactor: not good to call it directly with `this`?\nvar intervalScaleProto = IntervalScale.prototype;\nvar roundingErrorFix = numberUtil.round;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar mathPow = Math.pow;\nvar mathLog = Math.log;\nvar LogScale = /** @class */function (_super) {\n __extends(LogScale, _super);\n function LogScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'log';\n _this.base = 10;\n _this._originalScale = new IntervalScale();\n // FIXME:TS actually used by `IntervalScale`\n _this._interval = 0;\n return _this;\n }\n /**\n * @param Whether expand the ticks to niced extent.\n */\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\n var originalScale = this._originalScale;\n var extent = this._extent;\n var originalExtent = originalScale.getExtent();\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\n return zrUtil.map(ticks, function (tick) {\n var val = tick.value;\n var powVal = numberUtil.round(mathPow(this.base, val));\n // Fix #4158\n powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal;\n powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal;\n return {\n value: powVal\n };\n }, this);\n };\n LogScale.prototype.setExtent = function (start, end) {\n var base = mathLog(this.base);\n // log(-Infinity) is NaN, so safe guard here\n start = mathLog(Math.max(0, start)) / base;\n end = mathLog(Math.max(0, end)) / base;\n intervalScaleProto.setExtent.call(this, start, end);\n };\n /**\n * @return {number} end\n */\n LogScale.prototype.getExtent = function () {\n var base = this.base;\n var extent = scaleProto.getExtent.call(this);\n extent[0] = mathPow(base, extent[0]);\n extent[1] = mathPow(base, extent[1]);\n // Fix #4158\n var originalScale = this._originalScale;\n var originalExtent = originalScale.getExtent();\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\n return extent;\n };\n LogScale.prototype.unionExtent = function (extent) {\n this._originalScale.unionExtent(extent);\n var base = this.base;\n extent[0] = mathLog(extent[0]) / mathLog(base);\n extent[1] = mathLog(extent[1]) / mathLog(base);\n scaleProto.unionExtent.call(this, extent);\n };\n LogScale.prototype.unionExtentFromData = function (data, dim) {\n // TODO\n // filter value that <= 0\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\n * Update interval and extent of intervals for nice ticks\n * @param approxTickNum default 10 Given approx tick number\n */\n LogScale.prototype.calcNiceTicks = function (approxTickNum) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n if (span === Infinity || span <= 0) {\n return;\n }\n var interval = numberUtil.quantity(span);\n var err = approxTickNum / span * interval;\n // Filter ticks to get closer to the desired count.\n if (err <= 0.5) {\n interval *= 10;\n }\n // Interval should be integer\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\n interval *= 10;\n }\n var niceExtent = [numberUtil.round(mathCeil(extent[0] / interval) * interval), numberUtil.round(mathFloor(extent[1] / interval) * interval)];\n this._interval = interval;\n this._niceExtent = niceExtent;\n };\n LogScale.prototype.calcNiceExtent = function (opt) {\n intervalScaleProto.calcNiceExtent.call(this, opt);\n this._fixMin = opt.fixMin;\n this._fixMax = opt.fixMax;\n };\n LogScale.prototype.parse = function (val) {\n return val;\n };\n LogScale.prototype.contain = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.contain(val, this._extent);\n };\n LogScale.prototype.normalize = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.normalize(val, this._extent);\n };\n LogScale.prototype.scale = function (val) {\n val = scaleHelper.scale(val, this._extent);\n return mathPow(this.base, val);\n };\n LogScale.type = 'log';\n return LogScale;\n}(Scale);\nvar proto = LogScale.prototype;\nproto.getMinorTicks = intervalScaleProto.getMinorTicks;\nproto.getLabel = intervalScaleProto.getLabel;\nfunction fixRoundingError(val, originalVal) {\n return roundingErrorFix(val, numberUtil.getPrecision(originalVal));\n}\nScale.registerClass(LogScale);\nexport default LogScale;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray, eqNaN, isFunction } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nvar ScaleRawExtentInfo = /** @class */function () {\n function ScaleRawExtentInfo(scale, model,\n // Usually: data extent from all series on this axis.\n originalExtent) {\n this._prepareParams(scale, model, originalExtent);\n }\n /**\n * Parameters depending on outside (like model, user callback)\n * are prepared and fixed here.\n */\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model,\n // Usually: data extent from all series on this axis.\n dataExtent) {\n if (dataExtent[1] < dataExtent[0]) {\n dataExtent = [NaN, NaN];\n }\n this._dataMin = dataExtent[0];\n this._dataMax = dataExtent[1];\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\n this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero();\n var axisMinValue = model.get('min', true);\n if (axisMinValue == null) {\n axisMinValue = model.get('startValue', true);\n }\n var modelMinRaw = this._modelMinRaw = axisMinValue;\n if (isFunction(modelMinRaw)) {\n // This callback always provides users the full data extent (before data is filtered).\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMinRaw !== 'dataMin') {\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\n }\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\n if (isFunction(modelMaxRaw)) {\n // This callback always provides users the full data extent (before data is filtered).\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMaxRaw !== 'dataMax') {\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\n }\n if (isOrdinal) {\n // FIXME: there is a flaw here: if there is no \"block\" data processor like `dataZoom`,\n // and progressive rendering is using, here the category result might just only contain\n // the processed chunk rather than the entire result.\n this._axisDataLen = model.getCategories().length;\n } else {\n var boundaryGap = model.get('boundaryGap');\n var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., \"20%\". Currently, ' + 'boundaryGap is set to be 0.');\n }\n this._boundaryGapInner = [0, 0];\n } else {\n this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)];\n }\n }\n };\n /**\n * Calculate extent by prepared parameters.\n * This method has no external dependency and can be called duplicatedly,\n * getting the same result.\n * If parameters changed, should call this method to recalcuate.\n */\n ScaleRawExtentInfo.prototype.calculate = function () {\n // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n var isOrdinal = this._isOrdinal;\n var dataMin = this._dataMin;\n var dataMax = this._dataMax;\n var axisDataLen = this._axisDataLen;\n var boundaryGapInner = this._boundaryGapInner;\n var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null;\n // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax',\n // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`.\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\n // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed.\n var minFixed = min != null;\n var maxFixed = max != null;\n if (min == null) {\n min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span;\n }\n if (max == null) {\n max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span;\n }\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen;\n // If data extent modified, need to recalculated to ensure cross zero.\n if (this._needCrossZero) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !minFixed) {\n min = 0;\n // minFixed = true;\n }\n // Axis is under zero and max is not set\n if (min < 0 && max < 0 && !maxFixed) {\n max = 0;\n // maxFixed = true;\n }\n // PENDING:\n // When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n // If so, here `minFixed`/`maxFixed` need to be set.\n }\n\n var determinedMin = this._determinedMin;\n var determinedMax = this._determinedMax;\n if (determinedMin != null) {\n min = determinedMin;\n minFixed = true;\n }\n if (determinedMax != null) {\n max = determinedMax;\n maxFixed = true;\n }\n // Ensure min/max be finite number or NaN here. (not to be null/undefined)\n // `NaN` means min/max axis is blank.\n return {\n min: min,\n max: max,\n minFixed: minFixed,\n maxFixed: maxFixed,\n isBlank: isBlank\n };\n };\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen);\n }\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\n };\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen\n // Earse them usually means logic flaw.\n && this[attr] == null);\n }\n this[attr] = val;\n };\n ScaleRawExtentInfo.prototype.freeze = function () {\n // @ts-ignore\n this.frozen = true;\n };\n return ScaleRawExtentInfo;\n}();\nexport { ScaleRawExtentInfo };\nvar DETERMINED_MIN_MAX_ATTR = {\n min: '_determinedMin',\n max: '_determinedMax'\n};\nvar DATA_MIN_MAX_ATTR = {\n min: '_dataMin',\n max: '_dataMax'\n};\n/**\n * Get scale min max and related info only depends on model settings.\n * This method can be called after coordinate system created.\n * For example, in data processing stage.\n *\n * Scale extent info probably be required multiple times during a workflow.\n * For example:\n * (1) `dataZoom` depends it to get the axis extent in \"100%\" state.\n * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.\n * (3) `coordSys.update` use it to finally decide the scale extent.\n * But the callback of `min`/`max` should not be called multiple times.\n * The code below should not be implemented repeatedly either.\n * So we cache the result in the scale instance, which will be recreated at the beginning\n * of the workflow (because `scale` instance will be recreated each round of the workflow).\n */\nexport function ensureScaleRawExtentInfo(scale, model,\n// Usually: data extent from all series on this axis.\noriginalExtent) {\n // Do not permit to recreate.\n var rawExtentInfo = scale.rawExtentInfo;\n if (rawExtentInfo) {\n return rawExtentInfo;\n }\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\n // @ts-ignore\n scale.rawExtentInfo = rawExtentInfo;\n return rawExtentInfo;\n}\nexport function parseAxisModelMinMax(scale, minMax) {\n return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../scale/Ordinal.js';\nimport IntervalScale from '../scale/Interval.js';\nimport Scale from '../scale/Scale.js';\nimport { prepareLayoutBarSeries, makeColumnLayout, retrieveColumnLayout } from '../layout/barGrid.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport TimeScale from '../scale/Time.js';\nimport LogScale from '../scale/Log.js';\nimport { getStackedDimension } from '../data/helper/dataStackHelper.js';\nimport { ensureScaleRawExtentInfo } from './scaleRawExtentInfo.js';\n/**\n * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n *\n * Caution:\n * Precondition of calling this method:\n * The scale extent has been initialized using series data extent via\n * `scale.setExtent` or `scale.unionExtentFromData`;\n */\nexport function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n scale.setBlank(rawExtentResult.isBlank);\n var min = rawExtentResult.min;\n var max = rawExtentResult.max;\n // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n var ecModel = model.ecModel;\n if (ecModel && scaleType === 'time' /* || scaleType === 'interval' */) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries_1 = false;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n });\n if (isBaseAxisAndHasBarSeries_1) {\n // Calculate placement of bars on axis. TODO should be decoupled\n // with barLayout\n var barWidthAndOffset = makeColumnLayout(barSeriesModels);\n // Adjust axis min and max to account for overflow\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: rawExtentResult.minFixed,\n fixMax: rawExtentResult.maxFixed\n };\n}\nfunction adjustScaleForOverflow(min, max, model,\n// Only support cartesian coord yet.\nbarWidthAndOffset) {\n // Get Axis Length\n var axisExtent = model.axis.getExtent();\n var axisLength = axisExtent[1] - axisExtent[0];\n // Get bars on current base axis and calculate min and max overflow\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\n if (barsOnCurrentAxis === undefined) {\n return {\n min: min,\n max: max\n };\n }\n var minOverflow = Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n minOverflow = Math.min(item.offset, minOverflow);\n });\n var maxOverflow = -Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\n });\n minOverflow = Math.abs(minOverflow);\n maxOverflow = Math.abs(maxOverflow);\n var totalOverFlow = minOverflow + maxOverflow;\n // Calculate required buffer based on old range and overflow\n var oldRange = max - min;\n var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;\n var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;\n max += overflowBuffer * (maxOverflow / totalOverFlow);\n min -= overflowBuffer * (minOverflow / totalOverFlow);\n return {\n min: min,\n max: max\n };\n}\n// Precondition of calling this method:\n// The scale extent has been initialized using series data extent via\n// `scale.setExtent` or `scale.unionExtentFromData`;\nexport function niceScaleExtent(scale, inModel) {\n var model = inModel;\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n if (scale instanceof LogScale) {\n scale.base = model.get('logBase');\n }\n var scaleType = scale.type;\n var interval = model.get('interval');\n var isIntervalOrTime = scaleType === 'interval' || scaleType === 'time';\n scale.setExtent(extent[0], extent[1]);\n scale.calcNiceExtent({\n splitNumber: splitNumber,\n fixMin: extentInfo.fixMin,\n fixMax: extentInfo.fixMax,\n minInterval: isIntervalOrTime ? model.get('minInterval') : null,\n maxInterval: isIntervalOrTime ? model.get('maxInterval') : null\n });\n // If some one specified the min, max. And the default calculated interval\n // is not good enough. He can specify the interval. It is often appeared\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n // to be 60.\n // FIXME\n if (interval != null) {\n scale.setInterval && scale.setInterval(interval);\n }\n}\n/**\n * @param axisType Default retrieve from model.type\n */\nexport function createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n default:\n // case 'value'/'interval', 'log', or others.\n return new (Scale.getClass(axisType) || IntervalScale)();\n }\n }\n}\n/**\n * Check if the axis cross 0\n */\nexport function ifAxisCrossZero(axis) {\n var dataExtent = axis.scale.getExtent();\n var min = dataExtent[0];\n var max = dataExtent[1];\n return !(min > 0 && max > 0 || min < 0 && max < 0);\n}\n/**\n * @param axis\n * @return Label formatter function.\n * param: {number} tickValue,\n * param: {number} idx, the index in all ticks.\n * If category axis, this param is not required.\n * return: {string} label string.\n */\nexport function makeLabelFormatter(axis) {\n var labelFormatter = axis.getLabelModel().get('formatter');\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\n if (axis.scale.type === 'time') {\n return function (tpl) {\n return function (tick, idx) {\n return axis.scale.getFormattedLabel(tick, idx, tpl);\n };\n }(labelFormatter);\n } else if (zrUtil.isString(labelFormatter)) {\n return function (tpl) {\n return function (tick) {\n // For category axis, get raw value; for numeric axis,\n // get formatted label like '1,333,444'.\n var label = axis.scale.getLabel(tick);\n var text = tpl.replace('{value}', label != null ? label : '');\n return text;\n };\n }(labelFormatter);\n } else if (zrUtil.isFunction(labelFormatter)) {\n return function (cb) {\n return function (tick, idx) {\n // The original intention of `idx` is \"the index of the tick in all ticks\".\n // But the previous implementation of category axis do not consider the\n // `axisLabel.interval`, which cause that, for example, the `interval` is\n // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n // the definition here for back compatibility.\n if (categoryTickStart != null) {\n idx = tick.value - categoryTickStart;\n }\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\n level: tick.level\n } : null);\n };\n }(labelFormatter);\n } else {\n return function (tick) {\n return axis.scale.getLabel(tick);\n };\n }\n}\nexport function getAxisRawValue(axis, tick) {\n // In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\n}\n/**\n * @param axis\n * @return Be null/undefined if no labels.\n */\nexport function estimateLabelUnionRect(axis) {\n var axisModel = axis.model;\n var scale = axis.scale;\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\n return;\n }\n var realNumberScaleTicks;\n var tickCount;\n var categoryScaleExtent = scale.getExtent();\n // Optimize for large category data, avoid call `getTicks()`.\n if (scale instanceof OrdinalScale) {\n tickCount = scale.count();\n } else {\n realNumberScaleTicks = scale.getTicks();\n tickCount = realNumberScaleTicks.length;\n }\n var axisLabelModel = axis.getLabelModel();\n var labelFormatter = makeLabelFormatter(axis);\n var rect;\n var step = 1;\n // Simple optimization for large amount of labels\n if (tickCount > 40) {\n step = Math.ceil(tickCount / 40);\n }\n for (var i = 0; i < tickCount; i += step) {\n var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : {\n value: categoryScaleExtent[0] + i\n };\n var label = labelFormatter(tick, i);\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\n rect ? rect.union(singleRect) : rect = singleRect;\n }\n return rect;\n}\nfunction rotateTextRect(textRect, rotate) {\n var rotateRadians = rotate * Math.PI / 180;\n var beforeWidth = textRect.width;\n var beforeHeight = textRect.height;\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\n return rotatedRect;\n}\n/**\n * @param model axisLabelModel or axisTickModel\n * @return {number|String} Can be null|'auto'|number|function\n */\nexport function getOptionCategoryInterval(model) {\n var interval = model.get('interval');\n return interval == null ? 'auto' : interval;\n}\n/**\n * Set `categoryInterval` as 0 implicitly indicates that\n * show all labels regardless of overlap.\n * @param {Object} axis axisModel.axis\n */\nexport function shouldShowAllLabels(axis) {\n return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\nexport function getDataDimensionsOnAxis(data, axisDim) {\n // Remove duplicated dat dimensions caused by `getStackedDimension`.\n var dataDimMap = {};\n // Currently `mapDimensionsAll` will contain stack result dimension ('__\\0ecstackresult').\n // PENDING: is it reasonable? Do we need to remove the original dim from \"coord dim\" since\n // there has been stacked result dim?\n zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {\n // For example, the extent of the original dimension\n // is [0.1, 0.5], the extent of the `stackResultDimension`\n // is [7, 9], the final extent should NOT include [0.1, 0.5],\n // because there is no graphic corresponding to [0.1, 0.5].\n // See the case in `test/area-stack.html` `main1`, where area line\n // stack needs `yAxis` not start from 0.\n dataDimMap[getStackedDimension(data, dataDim)] = true;\n });\n return zrUtil.keys(dataDimMap);\n}\nexport function unionAxisExtentFromData(dataExtent, data, axisDim) {\n if (data) {\n zrUtil.each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\n var seriesExtent = data.getApproximateExtent(dim);\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar AxisModelCommonMixin = /** @class */function () {\n function AxisModelCommonMixin() {}\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\n var option = this.option;\n return !option.scale;\n };\n /**\n * Should be implemented by each axis model if necessary.\n * @return coordinate system model\n */\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\n return;\n };\n return AxisModelCommonMixin;\n}();\nexport { AxisModelCommonMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * This module exposes helper functions for developing extensions.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesData from '../../chart/helper/createSeriesData.js';\n// import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport { AxisModelCommonMixin } from '../../coord/axisModelCommonMixin.js';\nimport Model from '../../model/Model.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { enableDataStack, isDimensionStacked, getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle as innerCreateTextStyle } from '../../label/labelStyle.js';\n/**\n * Create a multi dimension List structure from seriesModel.\n */\nexport function createList(seriesModel) {\n return createSeriesData(null, seriesModel);\n}\n// export function createGraph(seriesModel) {\n// let nodes = seriesModel.get('data');\n// let links = seriesModel.get('links');\n// return createGraphFromNodeEdge(nodes, links, seriesModel);\n// }\nexport { getLayoutRect };\nexport { createDimensions } from '../../data/helper/createDimensions.js';\nexport var dataStack = {\n isDimensionStacked: isDimensionStacked,\n enableDataStack: enableDataStack,\n getStackedDimension: getStackedDimension\n};\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolDesc\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n */\nexport { createSymbol } from '../../util/symbol.js';\n/**\n * Create scale\n * @param {Array.} dataExtent\n * @param {Object|module:echarts/Model} option If `optoin.type`\n * is secified, it can only be `'value'` currently.\n */\nexport function createScale(dataExtent, option) {\n var axisModel = option;\n if (!(option instanceof Model)) {\n axisModel = new Model(option);\n // FIXME\n // Currently AxisModelCommonMixin has nothing to do with the\n // the requirements of `axisHelper.createScaleByModel`. For\n // example the methods `getCategories` and `getOrdinalMeta`\n // are required for `'category'` axis, and ecModel is required\n // for `'time'` axis. But occasionally echarts-gl happened\n // to only use `'value'` axis.\n // zrUtil.mixin(axisModel, AxisModelCommonMixin);\n }\n\n var scale = axisHelper.createScaleByModel(axisModel);\n scale.setExtent(dataExtent[0], dataExtent[1]);\n axisHelper.niceScaleExtent(scale, axisModel);\n return scale;\n}\n/**\n * Mixin common methods to axis model,\n *\n * Include methods\n * `getFormattedLabels() => Array.`\n * `getCategories() => Array.`\n * `getMin(origin: boolean) => number`\n * `getMax(origin: boolean) => number`\n * `getNeedCrossZero() => boolean`\n */\nexport function mixinAxisModelCommonMethods(Model) {\n zrUtil.mixin(Model, AxisModelCommonMixin);\n}\nexport { getECData };\nexport { enableHoverEmphasis } from '../../util/states.js';\nexport function createTextStyle(textStyleModel, opts) {\n opts = opts || {};\n return innerCreateTextStyle(textStyleModel, null, null, opts.state !== 'normal');\n}","import windingLine from './windingLine.js';\nvar EPSILON = 1e-8;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nexport function contain(points, x, y) {\n var w = 0;\n var p = points[0];\n if (!p) {\n return false;\n }\n for (var i = 1; i < points.length; i++) {\n var p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n }\n var p0 = points[0];\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n return w !== 0;\n}\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport { each } from 'zrender/lib/core/util.js';\nvar TMP_TRANSFORM = [];\nfunction transformPoints(points, transform) {\n for (var p = 0; p < points.length; p++) {\n vec2.applyTransform(points[p], points[p], transform);\n }\n}\nfunction updateBBoxFromPoints(points, min, max, projection) {\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n if (projection) {\n // projection may return null point.\n p = projection.project(p);\n }\n if (p && isFinite(p[0]) && isFinite(p[1])) {\n vec2.min(min, min, p);\n vec2.max(max, max, p);\n }\n }\n}\nfunction centroid(points) {\n var signedArea = 0;\n var cx = 0;\n var cy = 0;\n var len = points.length;\n var x0 = points[len - 1][0];\n var y0 = points[len - 1][1];\n // Polygon should been closed.\n for (var i = 0; i < len; i++) {\n var x1 = points[i][0];\n var y1 = points[i][1];\n var a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n x0 = x1;\n y0 = y1;\n }\n return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points[0][0] || 0, points[0][1] || 0];\n}\nvar Region = /** @class */function () {\n function Region(name) {\n this.name = name;\n }\n Region.prototype.setCenter = function (center) {\n this._center = center;\n };\n /**\n * Get center point in data unit. That is,\n * for GeoJSONRegion, the unit is lat/lng,\n * for GeoSVGRegion, the unit is SVG local coord.\n */\n Region.prototype.getCenter = function () {\n var center = this._center;\n if (!center) {\n // In most cases there are no need to calculate this center.\n // So calculate only when called.\n center = this._center = this.calcCenter();\n }\n return center;\n };\n return Region;\n}();\nexport { Region };\nvar GeoJSONPolygonGeometry = /** @class */function () {\n function GeoJSONPolygonGeometry(exterior, interiors) {\n this.type = 'polygon';\n this.exterior = exterior;\n this.interiors = interiors;\n }\n return GeoJSONPolygonGeometry;\n}();\nexport { GeoJSONPolygonGeometry };\nvar GeoJSONLineStringGeometry = /** @class */function () {\n function GeoJSONLineStringGeometry(points) {\n this.type = 'linestring';\n this.points = points;\n }\n return GeoJSONLineStringGeometry;\n}();\nexport { GeoJSONLineStringGeometry };\nvar GeoJSONRegion = /** @class */function (_super) {\n __extends(GeoJSONRegion, _super);\n function GeoJSONRegion(name, geometries, cp) {\n var _this = _super.call(this, name) || this;\n _this.type = 'geoJSON';\n _this.geometries = geometries;\n _this._center = cp && [cp[0], cp[1]];\n return _this;\n }\n GeoJSONRegion.prototype.calcCenter = function () {\n var geometries = this.geometries;\n var largestGeo;\n var largestGeoSize = 0;\n for (var i = 0; i < geometries.length; i++) {\n var geo = geometries[i];\n var exterior = geo.exterior;\n // Simple trick to use points count instead of polygon area as region size.\n // Ignore linestring\n var size = exterior && exterior.length;\n if (size > largestGeoSize) {\n largestGeo = geo;\n largestGeoSize = size;\n }\n }\n if (largestGeo) {\n return centroid(largestGeo.exterior);\n }\n // from bounding rect by default.\n var rect = this.getBoundingRect();\n return [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n GeoJSONRegion.prototype.getBoundingRect = function (projection) {\n var rect = this._rect;\n // Always recalculate if using projection.\n if (rect && !projection) {\n return rect;\n }\n var min = [Infinity, Infinity];\n var max = [-Infinity, -Infinity];\n var geometries = this.geometries;\n each(geometries, function (geo) {\n if (geo.type === 'polygon') {\n // Doesn't consider hole\n updateBBoxFromPoints(geo.exterior, min, max, projection);\n } else {\n each(geo.points, function (points) {\n updateBBoxFromPoints(points, min, max, projection);\n });\n }\n });\n // Normalie invalid bounding.\n if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n if (!projection) {\n this._rect = rect;\n }\n return rect;\n };\n GeoJSONRegion.prototype.contain = function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n var geo = geometries[i];\n // Only support polygon.\n if (geo.type !== 'polygon') {\n continue;\n }\n var exterior = geo.exterior;\n var interiors = geo.interiors;\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k], coord[0], coord[1])) {\n continue loopGeo;\n }\n }\n return true;\n }\n }\n return false;\n };\n /**\n * Transform the raw coords to target bounding.\n * @param x\n * @param y\n * @param width\n * @param height\n */\n GeoJSONRegion.prototype.transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n for (var i = 0; i < geometries.length; i++) {\n var geo = geometries[i];\n if (geo.type === 'polygon') {\n transformPoints(geo.exterior, transform);\n each(geo.interiors, function (interior) {\n transformPoints(interior, transform);\n });\n } else {\n each(geo.points, function (points) {\n transformPoints(points, transform);\n });\n }\n }\n rect = this._rect;\n rect.copy(target);\n // Update center\n this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n GeoJSONRegion.prototype.cloneShallow = function (name) {\n name == null && (name = this.name);\n var newRegion = new GeoJSONRegion(name, this.geometries, this._center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n return newRegion;\n };\n return GeoJSONRegion;\n}(Region);\nexport { GeoJSONRegion };\nvar GeoSVGRegion = /** @class */function (_super) {\n __extends(GeoSVGRegion, _super);\n function GeoSVGRegion(name, elOnlyForCalculate) {\n var _this = _super.call(this, name) || this;\n _this.type = 'geoSVG';\n _this._elOnlyForCalculate = elOnlyForCalculate;\n return _this;\n }\n GeoSVGRegion.prototype.calcCenter = function () {\n var el = this._elOnlyForCalculate;\n var rect = el.getBoundingRect();\n var center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n var mat = matrix.identity(TMP_TRANSFORM);\n var target = el;\n while (target && !target.isGeoSVGGraphicRoot) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n matrix.invert(mat, mat);\n vec2.applyTransform(center, center, mat);\n return center;\n };\n return GeoSVGRegion;\n}(Region);\nexport { GeoSVGRegion };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Parse and decode geo json\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONLineStringGeometry, GeoJSONPolygonGeometry, GeoJSONRegion } from './Region.js';\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n var jsonCompressed = json;\n var encodeScale = jsonCompressed.UTF8Scale;\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n var features = jsonCompressed.features;\n zrUtil.each(features, function (feature) {\n var geometry = feature.geometry;\n var encodeOffsets = geometry.encodeOffsets;\n var coordinates = geometry.coordinates;\n // Geometry may be appeded manually in the script after json loaded.\n // In this case this geometry is usually not encoded.\n if (!encodeOffsets) {\n return;\n }\n switch (geometry.type) {\n case 'LineString':\n geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale);\n break;\n case 'Polygon':\n decodeRings(coordinates, encodeOffsets, encodeScale);\n break;\n case 'MultiLineString':\n decodeRings(coordinates, encodeOffsets, encodeScale);\n break;\n case 'MultiPolygon':\n zrUtil.each(coordinates, function (rings, idx) {\n return decodeRings(rings, encodeOffsets[idx], encodeScale);\n });\n }\n });\n // Has been decoded\n jsonCompressed.UTF8Encoding = false;\n return jsonCompressed;\n}\nfunction decodeRings(rings, encodeOffsets, encodeScale) {\n for (var c = 0; c < rings.length; c++) {\n rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale);\n }\n}\nfunction decodeRing(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64;\n // ZigZag decoding\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1);\n // Delta deocding\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y;\n // Dequantize\n result.push([x / encodeScale, y / encodeScale]);\n }\n return result;\n}\nexport default function parseGeoJSON(geoJson, nameProperty) {\n geoJson = decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var geometries = [];\n switch (geo.type) {\n case 'Polygon':\n var coordinates = geo.coordinates;\n // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1)));\n break;\n case 'MultiPolygon':\n zrUtil.each(geo.coordinates, function (item) {\n if (item[0]) {\n geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1)));\n }\n });\n break;\n case 'LineString':\n geometries.push(new GeoJSONLineStringGeometry([geo.coordinates]));\n break;\n case 'MultiLineString':\n geometries.push(new GeoJSONLineStringGeometry(geo.coordinates));\n }\n var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp);\n region.properties = properties;\n return region;\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../util/model.js';\nimport { makeLabelFormatter, getOptionCategoryInterval, shouldShowAllLabels } from './axisHelper.js';\nvar inner = makeInner();\nfunction tickValuesToNumbers(axis, values) {\n var nums = zrUtil.map(values, function (val) {\n return axis.scale.parse(val);\n });\n if (axis.type === 'time' && nums.length > 0) {\n // Time axis needs duplicate first/last tick (see TimeScale.getTicks())\n // The first and last tick/label don't get drawn\n nums.sort();\n nums.unshift(nums[0]);\n nums.push(nums[nums.length - 1]);\n }\n return nums;\n}\nexport function createAxisLabels(axis) {\n var custom = axis.getLabelModel().get('customValues');\n if (custom) {\n var labelFormatter_1 = makeLabelFormatter(axis);\n return {\n labels: tickValuesToNumbers(axis, custom).map(function (numval) {\n var tick = {\n value: numval\n };\n return {\n formattedLabel: labelFormatter_1(tick),\n rawLabel: axis.scale.getLabel(tick),\n tickValue: numval\n };\n })\n };\n }\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis);\n}\n/**\n * @param {module:echats/coord/Axis} axis\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\n * @return {Object} {\n * ticks: Array.\n * tickCategoryInterval: number\n * }\n */\nexport function createAxisTicks(axis, tickModel) {\n var custom = axis.getTickModel().get('customValues');\n if (custom) {\n return {\n ticks: tickValuesToNumbers(axis, custom)\n };\n }\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n ticks: zrUtil.map(axis.scale.getTicks(), function (tick) {\n return tick.value;\n })\n };\n}\nfunction makeCategoryLabels(axis) {\n var labelModel = axis.getLabelModel();\n var result = makeCategoryLabelsActually(axis, labelModel);\n return !labelModel.get('show') || axis.scale.isBlank() ? {\n labels: [],\n labelCategoryInterval: result.labelCategoryInterval\n } : result;\n}\nfunction makeCategoryLabelsActually(axis, labelModel) {\n var labelsCache = getListCache(axis, 'labels');\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\n var result = listCacheGet(labelsCache, optionLabelInterval);\n if (result) {\n return result;\n }\n var labels;\n var numericLabelInterval;\n if (zrUtil.isFunction(optionLabelInterval)) {\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\n } else {\n numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval;\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\n }\n // Cache to avoid calling interval function repeatedly.\n return listCacheSet(labelsCache, optionLabelInterval, {\n labels: labels,\n labelCategoryInterval: numericLabelInterval\n });\n}\nfunction makeCategoryTicks(axis, tickModel) {\n var ticksCache = getListCache(axis, 'ticks');\n var optionTickInterval = getOptionCategoryInterval(tickModel);\n var result = listCacheGet(ticksCache, optionTickInterval);\n if (result) {\n return result;\n }\n var ticks;\n var tickCategoryInterval;\n // Optimize for the case that large category data and no label displayed,\n // we should not return all ticks.\n if (!tickModel.get('show') || axis.scale.isBlank()) {\n ticks = [];\n }\n if (zrUtil.isFunction(optionTickInterval)) {\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\n }\n // Always use label interval by default despite label show. Consider this\n // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n // labels. `splitLine` and `axisTick` should be consistent in this case.\n else if (optionTickInterval === 'auto') {\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\n tickCategoryInterval = labelsResult.labelCategoryInterval;\n ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\n return labelItem.tickValue;\n });\n } else {\n tickCategoryInterval = optionTickInterval;\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\n }\n // Cache to avoid calling interval function repeatedly.\n return listCacheSet(ticksCache, optionTickInterval, {\n ticks: ticks,\n tickCategoryInterval: tickCategoryInterval\n });\n}\nfunction makeRealNumberLabels(axis) {\n var ticks = axis.scale.getTicks();\n var labelFormatter = makeLabelFormatter(axis);\n return {\n labels: zrUtil.map(ticks, function (tick, idx) {\n return {\n level: tick.level,\n formattedLabel: labelFormatter(tick, idx),\n rawLabel: axis.scale.getLabel(tick),\n tickValue: tick.value\n };\n })\n };\n}\nfunction getListCache(axis, prop) {\n // Because key can be a function, and cache size always is small, we use array cache.\n return inner(axis)[prop] || (inner(axis)[prop] = []);\n}\nfunction listCacheGet(cache, key) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].key === key) {\n return cache[i].value;\n }\n }\n}\nfunction listCacheSet(cache, key, value) {\n cache.push({\n key: key,\n value: value\n });\n return value;\n}\nfunction makeAutoCategoryInterval(axis) {\n var result = inner(axis).autoInterval;\n return result != null ? result : inner(axis).autoInterval = axis.calculateCategoryInterval();\n}\n/**\n * Calculate interval for category axis ticks and labels.\n * To get precise result, at least one of `getRotate` and `isHorizontal`\n * should be implemented in axis.\n */\nexport function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n var tickCount = ordinalScale.count();\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n var step = 1;\n // Simple optimization. Empirical value: tick count should less than 40.\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0;\n // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0;\n // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n var rect = textContain.getBoundingRect(labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top');\n // Magic number\n width = rect.width * 1.3;\n height = rect.height * 1.3;\n // Min size, void long loop.\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n var dw = maxW / unitW;\n var dh = maxH / unitH;\n // 0/0 is NaN, 1/0 is Infinity.\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount;\n // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1\n // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval\n // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hidden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n }\n // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n return interval;\n}\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\n var labelModel = axis.getLabelModel();\n return {\n axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,\n labelRotate: labelModel.get('rotate') || 0,\n font: labelModel.getFont()\n };\n}\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\n var labelFormatter = makeLabelFormatter(axis);\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n var labelModel = axis.getLabelModel();\n var result = [];\n // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\n var step = Math.max((categoryInterval || 0) + 1, 1);\n var startTick = ordinalExtent[0];\n var tickCount = ordinalScale.count();\n // Calculate start tick based on zero if possible to keep label consistent\n // while zooming and moving while interval > 0. Otherwise the selection\n // of displayable ticks and symbols probably keep changing.\n // 3 is empirical value.\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\n startTick = Math.round(Math.ceil(startTick / step) * step);\n }\n // (1) Only add min max label here but leave overlap checking\n // to render stage, which also ensure the returned list\n // suitable for splitLine and splitArea rendering.\n // (2) Scales except category always contain min max label so\n // do not need to perform this process.\n var showAllLabel = shouldShowAllLabels(axis);\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\n addItem(ordinalExtent[0]);\n }\n // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\n var tickValue = startTick;\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n addItem(tickValue);\n }\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\n addItem(ordinalExtent[1]);\n }\n function addItem(tickValue) {\n var tickObj = {\n value: tickValue\n };\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickObj),\n rawLabel: ordinalScale.getLabel(tickObj),\n tickValue: tickValue\n });\n }\n return result;\n}\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tick) {\n var rawLabel = ordinalScale.getLabel(tick);\n var tickValue = tick.value;\n if (categoryInterval(tick.value, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tick),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map } from 'zrender/lib/core/util.js';\nimport { linearMap, getPixelPrecision, round } from '../util/number.js';\nimport { createAxisTicks, createAxisLabels, calculateCategoryInterval } from './axisTickLabelBuilder.js';\nvar NORMALIZED_EXTENT = [0, 1];\n/**\n * Base class of Axis.\n */\nvar Axis = /** @class */function () {\n function Axis(dim, scale, extent) {\n this.onBand = false;\n this.inverse = false;\n this.dim = dim;\n this.scale = scale;\n this._extent = extent || [0, 0];\n }\n /**\n * If axis extent contain given coord\n */\n Axis.prototype.contain = function (coord) {\n var extent = this._extent;\n var min = Math.min(extent[0], extent[1]);\n var max = Math.max(extent[0], extent[1]);\n return coord >= min && coord <= max;\n };\n /**\n * If axis extent contain given data\n */\n Axis.prototype.containData = function (data) {\n return this.scale.contain(data);\n };\n /**\n * Get coord extent.\n */\n Axis.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\n * Get precision used for formatting\n */\n Axis.prototype.getPixelPrecision = function (dataExtent) {\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n };\n /**\n * Set coord extent\n */\n Axis.prototype.setExtent = function (start, end) {\n var extent = this._extent;\n extent[0] = start;\n extent[1] = end;\n };\n /**\n * Convert data to coord. Data is the rank if it has an ordinal scale\n */\n Axis.prototype.dataToCoord = function (data, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n data = scale.normalize(data);\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\n };\n /**\n * Convert coord to data. Data is the rank if it has an ordinal scale\n */\n Axis.prototype.coordToData = function (coord, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\n return this.scale.scale(t);\n };\n /**\n * Convert pixel point to data in axis\n */\n Axis.prototype.pointToData = function (point, clamp) {\n // Should be implemented in derived class if necessary.\n return;\n };\n /**\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\n * `axis.getTicksCoords` considers `onBand`, which is used by\n * `boundaryGap:true` of category axis and splitLine and splitArea.\n * @param opt.tickModel default: axis.model.getModel('axisTick')\n * @param opt.clamp If `true`, the first and the last\n * tick must be at the axis end points. Otherwise, clip ticks\n * that outside the axis extent.\n */\n Axis.prototype.getTicksCoords = function (opt) {\n opt = opt || {};\n var tickModel = opt.tickModel || this.getTickModel();\n var result = createAxisTicks(this, tickModel);\n var ticks = result.ticks;\n var ticksCoords = map(ticks, function (tickVal) {\n return {\n coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),\n tickValue: tickVal\n };\n }, this);\n var alignWithLabel = tickModel.get('alignWithLabel');\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n return ticksCoords;\n };\n Axis.prototype.getMinorTicksCoords = function () {\n if (this.scale.type === 'ordinal') {\n // Category axis doesn't support minor ticks\n return [];\n }\n var minorTickModel = this.model.getModel('minorTick');\n var splitNumber = minorTickModel.get('splitNumber');\n // Protection.\n if (!(splitNumber > 0 && splitNumber < 100)) {\n splitNumber = 5;\n }\n var minorTicks = this.scale.getMinorTicks(splitNumber);\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\n return map(minorTicksGroup, function (minorTick) {\n return {\n coord: this.dataToCoord(minorTick),\n tickValue: minorTick\n };\n }, this);\n }, this);\n return minorTicksCoords;\n };\n Axis.prototype.getViewLabels = function () {\n return createAxisLabels(this).labels;\n };\n Axis.prototype.getLabelModel = function () {\n return this.model.getModel('axisLabel');\n };\n /**\n * Notice here we only get the default tick model. For splitLine\n * or splitArea, we should pass the splitLineModel or splitAreaModel\n * manually when calling `getTicksCoords`.\n * In GL, this method may be overridden to:\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\n */\n Axis.prototype.getTickModel = function () {\n return this.model.getModel('axisTick');\n };\n /**\n * Get width of band\n */\n Axis.prototype.getBandWidth = function () {\n var axisExtent = this._extent;\n var dataExtent = this.scale.getExtent();\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\n // Fix #2728, avoid NaN when only one data.\n len === 0 && (len = 1);\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\n return Math.abs(size) / len;\n };\n /**\n * Only be called in category axis.\n * Can be overridden, consider other axes like in 3D.\n * @return Auto interval for cateogry axis tick and label\n */\n Axis.prototype.calculateCategoryInterval = function () {\n return calculateCategoryInterval(this);\n };\n return Axis;\n}();\nfunction fixExtentWithBands(extent, nTick) {\n var size = extent[1] - extent[0];\n var len = nTick;\n var margin = size / len / 2;\n extent[0] += margin;\n extent[1] -= margin;\n}\n// If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[1]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift_1 / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n };\n ticksCoords.push(last);\n }\n var inverse = axisExtent[0] > axisExtent[1];\n // Handling clamp.\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unnecessary tick added.\n a = round(a);\n b = round(b);\n return inverse ? a > b : a < b;\n }\n}\nexport default Axis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// These APIs are for more advanced usages\n// For example extend charts and components, creating graphic elements, formatting.\nimport ComponentModel from '../model/Component.js';\nimport ComponentView from '../view/Component.js';\nimport SeriesModel from '../model/Series.js';\nimport ChartView from '../view/Chart.js';\nimport SeriesData from '../data/SeriesData.js';\nimport * as zrender_1 from 'zrender/lib/zrender.js';\nexport { zrender_1 as zrender };\nimport * as matrix_1 from 'zrender/lib/core/matrix.js';\nexport { matrix_1 as matrix };\nimport * as vector_1 from 'zrender/lib/core/vector.js';\nexport { vector_1 as vector };\nimport * as zrUtil_1 from 'zrender/lib/core/util.js';\nexport { zrUtil_1 as zrUtil };\nimport * as color_1 from 'zrender/lib/tool/color.js';\nexport { color_1 as color };\nexport { throttle } from '../util/throttle.js';\nimport * as helper_1 from './api/helper.js';\nexport { helper_1 as helper };\nexport { use } from '../extension.js';\nexport { setPlatformAPI } from 'zrender/lib/core/platform.js';\n// --------------------- Helper Methods ---------------------\nexport { default as parseGeoJSON } from '../coord/geo/parseGeoJson.js';\nexport { default as parseGeoJson } from '../coord/geo/parseGeoJson.js';\nimport * as number_1 from './api/number.js';\nexport { number_1 as number };\nimport * as time_1 from './api/time.js';\nexport { time_1 as time };\nimport * as graphic_1 from './api/graphic.js';\nexport { graphic_1 as graphic };\nimport * as format_1 from './api/format.js';\nexport { format_1 as format };\nimport * as util_1 from './api/util.js';\nexport { util_1 as util };\nexport { default as env } from 'zrender/lib/core/env.js';\n// --------------------- Export for Extension Usage ---------------------\n// export {SeriesData};\nexport { SeriesData as List }; // TODO: Compatitable with exists echarts-gl code\nexport { default as Model } from '../model/Model.js';\nexport { default as Axis } from '../coord/Axis.js';\nexport { ComponentModel, ComponentView, SeriesModel, ChartView };\n// Only for GL\nexport { brushSingle as innerDrawElementOnCanvas } from 'zrender/lib/canvas/graphic.js';\n// --------------------- Deprecated Extension Methods ---------------------\n// Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class.\n// Then use `registerComponentModel` in `install` parameter when `use` this extension. For example:\n// class Bar3DModel extends ComponentModel {}\n// export function install(registers) { registers.registerComponentModel(Bar3DModel); }\n// echarts.use(install);\nexport function extendComponentModel(proto) {\n var Model = ComponentModel.extend(proto);\n ComponentModel.registerClass(Model);\n return Model;\n}\nexport function extendComponentView(proto) {\n var View = ComponentView.extend(proto);\n ComponentView.registerClass(View);\n return View;\n}\nexport function extendSeriesModel(proto) {\n var Model = SeriesModel.extend(proto);\n SeriesModel.registerClass(Model);\n return Model;\n}\nexport function extendChartView(proto) {\n var View = ChartView.extend(proto);\n ChartView.registerClass(View);\n return View;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { Point, Path, Polyline } from '../util/graphic.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nimport { cubicProjectPoint, quadraticProjectPoint } from 'zrender/lib/core/curve.js';\nimport { defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport { DISPLAY_STATES, SPECIAL_STATES } from '../util/states.js';\nvar PI2 = Math.PI * 2;\nvar CMD = PathProxy.CMD;\nvar DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\nfunction getCandidateAnchor(pos, distance, rect, outPt, outDir) {\n var width = rect.width;\n var height = rect.height;\n switch (pos) {\n case 'top':\n outPt.set(rect.x + width / 2, rect.y - distance);\n outDir.set(0, -1);\n break;\n case 'bottom':\n outPt.set(rect.x + width / 2, rect.y + height + distance);\n outDir.set(0, 1);\n break;\n case 'left':\n outPt.set(rect.x - distance, rect.y + height / 2);\n outDir.set(-1, 0);\n break;\n case 'right':\n outPt.set(rect.x + width + distance, rect.y + height / 2);\n outDir.set(1, 0);\n break;\n }\n}\nfunction projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n x /= d;\n y /= d;\n // Intersect point.\n var ox = x * r + cx;\n var oy = y * r + cy;\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n // Is a circle\n out[0] = ox;\n out[1] = oy;\n return d - r;\n }\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n } else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n var angle = Math.atan2(y, x);\n if (angle < 0) {\n angle += PI2;\n }\n if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {\n // Project point is on the arc.\n out[0] = ox;\n out[1] = oy;\n return d - r;\n }\n var x1 = r * Math.cos(startAngle) + cx;\n var y1 = r * Math.sin(startAngle) + cy;\n var x2 = r * Math.cos(endAngle) + cx;\n var y2 = r * Math.sin(endAngle) + cy;\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\n if (d1 < d2) {\n out[0] = x1;\n out[1] = y1;\n return Math.sqrt(d1);\n } else {\n out[0] = x2;\n out[1] = y2;\n return Math.sqrt(d2);\n }\n}\nfunction projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\n var dx = x - x1;\n var dy = y - y1;\n var dx1 = x2 - x1;\n var dy1 = y2 - y1;\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n dx1 /= lineLen;\n dy1 /= lineLen;\n // dot product\n var projectedLen = dx * dx1 + dy * dy1;\n var t = projectedLen / lineLen;\n if (limitToEnds) {\n t = Math.min(Math.max(t, 0), 1);\n }\n t *= lineLen;\n var ox = out[0] = x1 + t * dx1;\n var oy = out[1] = y1 + t * dy1;\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\nfunction projectPointToRect(x1, y1, width, height, x, y, out) {\n if (width < 0) {\n x1 = x1 + width;\n width = -width;\n }\n if (height < 0) {\n y1 = y1 + height;\n height = -height;\n }\n var x2 = x1 + width;\n var y2 = y1 + height;\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\nvar tmpPt = [];\nfunction nearestPointOnRect(pt, rect, out) {\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\n out.set(tmpPt[0], tmpPt[1]);\n return dist;\n}\n/**\n * Calculate min distance corresponding point.\n * This method won't evaluate if point is in the path.\n */\nfunction nearestPointOnPath(pt, path, out) {\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n var minDist = Infinity;\n var data = path.data;\n var x = pt.x;\n var y = pt.y;\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n if (i === 1) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n var d = minDist;\n switch (cmd) {\n case CMD.M:\n // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点\n // 在 closePath 的时候使用\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n case CMD.L:\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n // TODO Arc 判断的开销比较大\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var theta = data[i++];\n var dTheta = data[i++];\n // TODO Arc 旋转\n i += 1;\n var anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy;\n // 不是直接使用 arc 命令\n if (i <= 1) {\n // 第一个命令起点还未定义\n x0 = x1;\n y0 = y1;\n }\n // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放\n var _x = (x - cx) * ry / rx + cx;\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\n break;\n case CMD.Z:\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\n xi = x0;\n yi = y0;\n break;\n }\n if (d < minDist) {\n minDist = d;\n out.set(tmpPt[0], tmpPt[1]);\n }\n }\n return minDist;\n}\n// Temporal variable for intermediate usage.\nvar pt0 = new Point();\nvar pt1 = new Point();\nvar pt2 = new Point();\nvar dir = new Point();\nvar dir2 = new Point();\n/**\n * Calculate a proper guide line based on the label position and graphic element definition\n * @param label\n * @param labelRect\n * @param target\n * @param targetRect\n */\nexport function updateLabelLinePoints(target, labelLineModel) {\n if (!target) {\n return;\n }\n var labelLine = target.getTextGuideLine();\n var label = target.getTextContent();\n // Needs to create text guide in each charts.\n if (!(label && labelLine)) {\n return;\n }\n var labelGuideConfig = target.textGuideLineConfig || {};\n var points = [[0, 0], [0, 0], [0, 0]];\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n var labelRect = label.getBoundingRect().clone();\n labelRect.applyTransform(label.getComputedTransform());\n var minDist = Infinity;\n var anchorPoint = labelGuideConfig.anchor;\n var targetTransform = target.getComputedTransform();\n var targetInversedTransform = targetTransform && invert([], targetTransform);\n var len = labelLineModel.get('length2') || 0;\n if (anchorPoint) {\n pt2.copy(anchorPoint);\n }\n for (var i = 0; i < searchSpace.length; i++) {\n var candidate = searchSpace[i];\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n Point.scaleAndAdd(pt1, pt0, dir, len);\n // Transform to target coord space.\n pt1.transform(targetInversedTransform);\n // Note: getBoundingRect will ensure the `path` being created.\n var boundingRect = target.getBoundingRect();\n var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2);\n // TODO pt2 is in the path\n if (dist < minDist) {\n minDist = dist;\n // Transform back to global space.\n pt1.transform(targetTransform);\n pt2.transform(targetTransform);\n pt2.toArray(points[0]);\n pt1.toArray(points[1]);\n pt0.toArray(points[2]);\n }\n }\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n labelLine.setShape({\n points: points\n });\n}\n// Temporal variable for the limitTurnAngle function\nvar tmpArr = [];\nvar tmpProjPoint = new Point();\n/**\n * Reduce the line segment attached to the label to limit the turn angle between two segments.\n * @param linePoints\n * @param minTurnAngle Radian of minimum turn angle. 0 - 180\n */\nexport function limitTurnAngle(linePoints, minTurnAngle) {\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\n return;\n }\n minTurnAngle = minTurnAngle / 180 * Math.PI;\n // The line points can be\n // /pt1----pt2 (label)\n // /\n // pt0/\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt0, pt1);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(dir2);\n var minTurnAngleCos = Math.cos(minTurnAngle);\n if (minTurnAngleCos < angleCos) {\n // Smaller than minTurnAngle\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr);\n // Calculate new projected length with limited minTurnAngle and get the new connect point\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\n // Limit the new calculated connect point between pt1 and pt2.\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n if (isNaN(t)) {\n return;\n }\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\n/**\n * Limit the angle of line and the surface\n * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite\n */\nexport function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\n return;\n }\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt1, pt0);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(surfaceNormal);\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\n if (angleCos < maxSurfaceAngleCos) {\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr);\n var HALF_PI = Math.PI / 2;\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\n if (newAngle >= HALF_PI) {\n // parallel\n Point.copy(tmpProjPoint, pt2);\n } else {\n // Calculate new projected length with limited minTurnAngle and get the new connect point\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\n // Limit the new calculated connect point between pt1 and pt2.\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n if (isNaN(t)) {\n return;\n }\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n }\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\nfunction setLabelLineState(labelLine, ignore, stateName, stateModel) {\n var isNormal = stateName === 'normal';\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\n // Make sure display.\n stateObj.ignore = ignore;\n // Set smooth\n var smooth = stateModel.get('smooth');\n if (smooth && smooth === true) {\n smooth = 0.3;\n }\n stateObj.shape = stateObj.shape || {};\n if (smooth > 0) {\n stateObj.shape.smooth = smooth;\n }\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\n}\nfunction buildLabelLinePath(path, shape) {\n var smooth = shape.smooth;\n var points = shape.points;\n if (!points) {\n return;\n }\n path.moveTo(points[0][0], points[0][1]);\n if (smooth > 0 && points.length >= 3) {\n var len1 = vector.dist(points[0], points[1]);\n var len2 = vector.dist(points[1], points[2]);\n if (!len1 || !len2) {\n path.lineTo(points[1][0], points[1][1]);\n path.lineTo(points[2][0], points[2][1]);\n return;\n }\n var moveLen = Math.min(len1, len2) * smooth;\n var midPoint0 = vector.lerp([], points[1], points[0], moveLen / len1);\n var midPoint2 = vector.lerp([], points[1], points[2], moveLen / len2);\n var midPoint1 = vector.lerp([], midPoint0, midPoint2, 0.5);\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\n } else {\n for (var i = 1; i < points.length; i++) {\n path.lineTo(points[i][0], points[i][1]);\n }\n }\n}\n/**\n * Create a label line if necessary and set it's style.\n */\nexport function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n var labelLine = targetEl.getTextGuideLine();\n var label = targetEl.getTextContent();\n if (!label) {\n // Not show label line if there is no label.\n if (labelLine) {\n targetEl.removeTextGuideLine();\n }\n return;\n }\n var normalModel = statesModels.normal;\n var showNormal = normalModel.get('show');\n var labelIgnoreNormal = label.ignore;\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateName = DISPLAY_STATES[i];\n var stateModel = statesModels[stateName];\n var isNormal = stateName === 'normal';\n if (stateModel) {\n var stateShow = stateModel.get('show');\n var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n if (isLabelIgnored // Not show when label is not shown in this state.\n || !retrieve2(stateShow, showNormal) // Use normal state by default if not set.\n ) {\n var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName];\n if (stateObj) {\n stateObj.ignore = true;\n }\n if (!!labelLine) {\n setLabelLineState(labelLine, true, stateName, stateModel);\n }\n continue;\n }\n // Create labelLine if not exists\n if (!labelLine) {\n labelLine = new Polyline();\n targetEl.setTextGuideLine(labelLine);\n // Reset state of normal because it's new created.\n // NOTE: NORMAL should always been the first!\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n }\n // Use same state proxy.\n if (targetEl.stateProxy) {\n labelLine.stateProxy = targetEl.stateProxy;\n }\n }\n setLabelLineState(labelLine, false, stateName, stateModel);\n }\n }\n if (labelLine) {\n defaults(labelLine.style, defaultStyle);\n // Not fill.\n labelLine.style.fill = null;\n var showAbove = normalModel.get('showAbove');\n var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n labelLineConfig.showAbove = showAbove || false;\n // Custom the buildPath.\n labelLine.buildPath = buildLabelLinePath;\n }\n}\nexport function getLabelLineStatesModels(itemModel, labelLineName) {\n labelLineName = labelLineName || 'labelLine';\n var statesModels = {\n normal: itemModel.getModel(labelLineName)\n };\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\n }\n return statesModels;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { BoundingRect, OrientedBoundingRect } from '../util/graphic.js';\nexport function prepareLayoutList(input) {\n var list = [];\n for (var i = 0; i < input.length; i++) {\n var rawItem = input[i];\n if (rawItem.defaultAttr.ignore) {\n continue;\n }\n var label = rawItem.label;\n var transform = label.getComputedTransform();\n // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el.\n var localRect = label.getBoundingRect();\n var isAxisAligned = !transform || transform[1] < 1e-5 && transform[2] < 1e-5;\n var minMargin = label.style.margin || 0;\n var globalRect = localRect.clone();\n globalRect.applyTransform(transform);\n globalRect.x -= minMargin / 2;\n globalRect.y -= minMargin / 2;\n globalRect.width += minMargin;\n globalRect.height += minMargin;\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\n list.push({\n label: label,\n labelLine: rawItem.labelLine,\n rect: globalRect,\n localRect: localRect,\n obb: obb,\n priority: rawItem.priority,\n defaultAttr: rawItem.defaultAttr,\n layoutOption: rawItem.computedLayoutOption,\n axisAligned: isAxisAligned,\n transform: transform\n });\n }\n return list;\n}\nfunction shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\n var len = list.length;\n if (len < 2) {\n return;\n }\n list.sort(function (a, b) {\n return a.rect[xyDim] - b.rect[xyDim];\n });\n var lastPos = 0;\n var delta;\n var adjusted = false;\n var shifts = [];\n var totalShifts = 0;\n for (var i = 0; i < len; i++) {\n var item = list[i];\n var rect = item.rect;\n delta = rect[xyDim] - lastPos;\n if (delta < 0) {\n // shiftForward(i, len, -delta);\n rect[xyDim] -= delta;\n item.label[xyDim] -= delta;\n adjusted = true;\n }\n var shift = Math.max(-delta, 0);\n shifts.push(shift);\n totalShifts += shift;\n lastPos = rect[xyDim] + rect[sizeDim];\n }\n if (totalShifts > 0 && balanceShift) {\n // Shift back to make the distribution more equally.\n shiftList(-totalShifts / len, 0, len);\n }\n // TODO bleedMargin?\n var first = list[0];\n var last = list[len - 1];\n var minGap;\n var maxGap;\n updateMinMaxGap();\n // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.\n minGap < 0 && squeezeGaps(-minGap, 0.8);\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\n updateMinMaxGap();\n takeBoundsGap(minGap, maxGap, 1);\n takeBoundsGap(maxGap, minGap, -1);\n // Handle bailout when there is not enough space.\n updateMinMaxGap();\n if (minGap < 0) {\n squeezeWhenBailout(-minGap);\n }\n if (maxGap < 0) {\n squeezeWhenBailout(maxGap);\n }\n function updateMinMaxGap() {\n minGap = first.rect[xyDim] - minBound;\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\n }\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\n if (gapThisBound < 0) {\n // Move from other gap if can.\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\n if (moveFromMaxGap > 0) {\n shiftList(moveFromMaxGap * moveDir, 0, len);\n var remained = moveFromMaxGap + gapThisBound;\n if (remained < 0) {\n squeezeGaps(-remained * moveDir, 1);\n }\n } else {\n squeezeGaps(-gapThisBound * moveDir, 1);\n }\n }\n }\n function shiftList(delta, start, end) {\n if (delta !== 0) {\n adjusted = true;\n }\n for (var i = start; i < end; i++) {\n var item = list[i];\n var rect = item.rect;\n rect[xyDim] += delta;\n item.label[xyDim] += delta;\n }\n }\n // Squeeze gaps if the labels exceed margin.\n function squeezeGaps(delta, maxSqeezePercent) {\n var gaps = [];\n var totalGaps = 0;\n for (var i = 1; i < len; i++) {\n var prevItemRect = list[i - 1].rect;\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\n gaps.push(gap);\n totalGaps += gap;\n }\n if (!totalGaps) {\n return;\n }\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\n if (delta > 0) {\n for (var i = 0; i < len - 1; i++) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i] * squeezePercent;\n // Forward\n shiftList(movement, 0, i + 1);\n }\n } else {\n // Backward\n for (var i = len - 1; i > 0; i--) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i - 1] * squeezePercent;\n shiftList(-movement, i, len);\n }\n }\n }\n /**\n * Squeeze to allow overlap if there is no more space available.\n * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.\n */\n function squeezeWhenBailout(delta) {\n var dir = delta < 0 ? -1 : 1;\n delta = Math.abs(delta);\n var moveForEachLabel = Math.ceil(delta / (len - 1));\n for (var i = 0; i < len - 1; i++) {\n if (dir > 0) {\n // Forward\n shiftList(moveForEachLabel, 0, i + 1);\n } else {\n // Backward\n shiftList(-moveForEachLabel, len - i - 1, len);\n }\n delta -= moveForEachLabel;\n if (delta <= 0) {\n return;\n }\n }\n }\n return adjusted;\n}\n/**\n * Adjust labels on x direction to avoid overlap.\n */\nexport function shiftLayoutOnX(list, leftBound, rightBound,\n// If average the shifts on all labels and add them to 0\n// TODO: Not sure if should enable it.\n// Pros: The angle of lines will distribute more equally\n// Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\nbalanceShift) {\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\n}\n/**\n * Adjust labels on y direction to avoid overlap.\n */\nexport function shiftLayoutOnY(list, topBound, bottomBound,\n// If average the shifts on all labels and add them to 0\nbalanceShift) {\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\n}\nexport function hideOverlap(labelList) {\n var displayedLabels = [];\n // TODO, render overflow visible first, put in the displayedLabels.\n labelList.sort(function (a, b) {\n return b.priority - a.priority;\n });\n var globalRect = new BoundingRect(0, 0, 0, 0);\n function hideEl(el) {\n if (!el.ignore) {\n // Show on emphasis.\n var emphasisState = el.ensureState('emphasis');\n if (emphasisState.ignore == null) {\n emphasisState.ignore = false;\n }\n }\n el.ignore = true;\n }\n for (var i = 0; i < labelList.length; i++) {\n var labelItem = labelList[i];\n var isAxisAligned = labelItem.axisAligned;\n var localRect = labelItem.localRect;\n var transform = labelItem.transform;\n var label = labelItem.label;\n var labelLine = labelItem.labelLine;\n globalRect.copy(labelItem.rect);\n // Add a threshold because layout may be aligned precisely.\n globalRect.width -= 0.1;\n globalRect.height -= 0.1;\n globalRect.x += 0.05;\n globalRect.y += 0.05;\n var obb = labelItem.obb;\n var overlapped = false;\n for (var j = 0; j < displayedLabels.length; j++) {\n var existsTextCfg = displayedLabels[j];\n // Fast rejection.\n if (!globalRect.intersect(existsTextCfg.rect)) {\n continue;\n }\n if (isAxisAligned && existsTextCfg.axisAligned) {\n // Is overlapped\n overlapped = true;\n break;\n }\n if (!existsTextCfg.obb) {\n // If self is not axis aligned. But other is.\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\n }\n if (!obb) {\n // If self is axis aligned. But other is not.\n obb = new OrientedBoundingRect(localRect, transform);\n }\n if (obb.intersect(existsTextCfg.obb)) {\n overlapped = true;\n break;\n }\n }\n // TODO Callback to determine if this overlap should be handled?\n if (overlapped) {\n hideEl(label);\n labelLine && hideEl(labelLine);\n } else {\n label.attr('ignore', labelItem.defaultAttr.ignore);\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\n displayedLabels.push(labelItem);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO: move labels out of viewport.\nimport { BoundingRect, updateProps, initProps, isElementRemoved } from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { parsePercent } from '../util/number.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { updateLabelLinePoints, setLabelLineStyle, getLabelLineStatesModels } from './labelGuideHelper.js';\nimport { makeInner } from '../util/model.js';\nimport { retrieve2, each, keys, isFunction, filter, indexOf } from 'zrender/lib/core/util.js';\nimport { prepareLayoutList, hideOverlap, shiftLayoutOnX, shiftLayoutOnY } from './labelLayoutHelper.js';\nimport { labelInner, animateLabelValue } from './labelStyle.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nfunction cloneArr(points) {\n if (points) {\n var newPoints = [];\n for (var i = 0; i < points.length; i++) {\n newPoints.push(points[i].slice());\n }\n return newPoints;\n }\n}\nfunction prepareLayoutCallbackParams(labelItem, hostEl) {\n var label = labelItem.label;\n var labelLine = hostEl && hostEl.getTextGuideLine();\n return {\n dataIndex: labelItem.dataIndex,\n dataType: labelItem.dataType,\n seriesIndex: labelItem.seriesModel.seriesIndex,\n text: labelItem.label.style.text,\n rect: labelItem.hostRect,\n labelRect: labelItem.rect,\n // x: labelAttr.x,\n // y: labelAttr.y,\n align: label.style.align,\n verticalAlign: label.style.verticalAlign,\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\n };\n}\nvar LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\nvar dummyTransformable = new Transformable();\nvar labelLayoutInnerStore = makeInner();\nvar labelLineAnimationStore = makeInner();\nfunction extendWithKeys(target, source, keys) {\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (source[key] != null) {\n target[key] = source[key];\n }\n }\n}\nvar LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\nvar LabelManager = /** @class */function () {\n function LabelManager() {\n this._labelList = [];\n this._chartViewList = [];\n }\n LabelManager.prototype.clearLabels = function () {\n this._labelList = [];\n this._chartViewList = [];\n };\n /**\n * Add label to manager\n */\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\n var labelStyle = label.style;\n var hostEl = label.__hostTarget;\n var textConfig = hostEl.textConfig || {};\n // TODO: If label is in other state.\n var labelTransform = label.getComputedTransform();\n var labelRect = label.getBoundingRect().plain();\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\n if (labelTransform) {\n dummyTransformable.setLocalTransform(labelTransform);\n } else {\n // Identity transform.\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0;\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\n }\n dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);\n var host = label.__hostTarget;\n var hostRect;\n if (host) {\n hostRect = host.getBoundingRect().plain();\n var transform = host.getComputedTransform();\n BoundingRect.applyTransform(hostRect, hostRect, transform);\n }\n var labelGuide = hostRect && host.getTextGuideLine();\n this._labelList.push({\n label: label,\n labelLine: labelGuide,\n seriesModel: seriesModel,\n dataIndex: dataIndex,\n dataType: dataType,\n layoutOption: layoutOption,\n computedLayoutOption: null,\n rect: labelRect,\n hostRect: hostRect,\n // Label with lower priority will be hidden when overlapped\n // Use rect size as default priority\n priority: hostRect ? hostRect.width * hostRect.height : 0,\n // Save default label attributes.\n // For restore if developers want get back to default value in callback.\n defaultAttr: {\n ignore: label.ignore,\n labelGuideIgnore: labelGuide && labelGuide.ignore,\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY,\n rotation: dummyTransformable.rotation,\n style: {\n x: labelStyle.x,\n y: labelStyle.y,\n align: labelStyle.align,\n verticalAlign: labelStyle.verticalAlign,\n width: labelStyle.width,\n height: labelStyle.height,\n fontSize: labelStyle.fontSize\n },\n cursor: label.cursor,\n attachedPos: textConfig.position,\n attachedRot: textConfig.rotation\n }\n });\n };\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\n var _this = this;\n this._chartViewList.push(chartView);\n var seriesModel = chartView.__model;\n var layoutOption = seriesModel.get('labelLayout');\n /**\n * Ignore layouting if it's not specified anything.\n */\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\n return;\n }\n chartView.group.traverse(function (child) {\n if (child.ignore) {\n return true; // Stop traverse descendants.\n }\n // Only support label being hosted on graphic elements.\n var textEl = child.getTextContent();\n var ecData = getECData(child);\n // Can only attach the text on the element with dataIndex\n if (textEl && !textEl.disableLabelLayout) {\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\n }\n });\n };\n LabelManager.prototype.updateLayoutConfig = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n function createDragHandler(el, labelLineModel) {\n return function () {\n updateLabelLinePoints(el, labelLineModel);\n };\n }\n for (var i = 0; i < this._labelList.length; i++) {\n var labelItem = this._labelList[i];\n var label = labelItem.label;\n var hostEl = label.__hostTarget;\n var defaultLabelAttr = labelItem.defaultAttr;\n var layoutOption = void 0;\n // TODO A global layout option?\n if (isFunction(labelItem.layoutOption)) {\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\n } else {\n layoutOption = labelItem.layoutOption;\n }\n layoutOption = layoutOption || {};\n labelItem.computedLayoutOption = layoutOption;\n var degreeToRadian = Math.PI / 180;\n // TODO hostEl should always exists.\n // Or label should not have parent because the x, y is all in global space.\n if (hostEl) {\n hostEl.setTextConfig({\n // Force to set local false.\n local: false,\n // Ignore position and rotation config on the host el if x or y is changed.\n position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos,\n // Ignore rotation config on the host el if rotation is changed.\n rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\n });\n }\n var needsUpdateLabelLine = false;\n if (layoutOption.x != null) {\n // TODO width of chart view.\n label.x = parsePercent(layoutOption.x, width);\n label.setStyle('x', 0); // Ignore movement in style. TODO: origin.\n needsUpdateLabelLine = true;\n } else {\n label.x = defaultLabelAttr.x;\n label.setStyle('x', defaultLabelAttr.style.x);\n }\n if (layoutOption.y != null) {\n // TODO height of chart view.\n label.y = parsePercent(layoutOption.y, height);\n label.setStyle('y', 0); // Ignore movement in style.\n needsUpdateLabelLine = true;\n } else {\n label.y = defaultLabelAttr.y;\n label.setStyle('y', defaultLabelAttr.style.y);\n }\n if (layoutOption.labelLinePoints) {\n var guideLine = hostEl.getTextGuideLine();\n if (guideLine) {\n guideLine.setShape({\n points: layoutOption.labelLinePoints\n });\n // Not update\n needsUpdateLabelLine = false;\n }\n }\n var labelLayoutStore = labelLayoutInnerStore(label);\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\n label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\n label.scaleX = defaultLabelAttr.scaleX;\n label.scaleY = defaultLabelAttr.scaleY;\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\n }\n if (layoutOption.draggable) {\n label.draggable = true;\n label.cursor = 'move';\n if (hostEl) {\n var hostModel = labelItem.seriesModel;\n if (labelItem.dataIndex != null) {\n var data = labelItem.seriesModel.getData(labelItem.dataType);\n hostModel = data.getItemModel(labelItem.dataIndex);\n }\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\n }\n } else {\n // TODO Other drag functions?\n label.off('drag');\n label.cursor = defaultLabelAttr.cursor;\n }\n }\n };\n LabelManager.prototype.layout = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n var labelList = prepareLayoutList(this._labelList);\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftX';\n });\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftY';\n });\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\n return item.layoutOption.hideOverlap;\n });\n hideOverlap(labelsNeedsHideOverlap);\n };\n /**\n * Process all labels. Not only labels with layoutOption.\n */\n LabelManager.prototype.processLabelsOverall = function () {\n var _this = this;\n each(this._chartViewList, function (chartView) {\n var seriesModel = chartView.__model;\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\n var animationEnabled = seriesModel.isAnimationEnabled();\n chartView.group.traverse(function (child) {\n if (child.ignore && !child.forceLabelAnimation) {\n return true; // Stop traverse descendants.\n }\n\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\n var label = child.getTextContent();\n if (!needsUpdateLabelLine && label) {\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\n }\n if (needsUpdateLabelLine) {\n _this._updateLabelLine(child, seriesModel);\n }\n if (animationEnabled) {\n _this._animateLabels(child, seriesModel);\n }\n });\n });\n };\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\n // Only support label being hosted on graphic elements.\n var textEl = el.getTextContent();\n // Update label line style.\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex;\n // Only support labelLine on the labels represent data.\n if (textEl && dataIndex != null) {\n var data = seriesModel.getData(ecData.dataType);\n var itemModel = data.getItemModel(dataIndex);\n var defaultStyle = {};\n var visualStyle = data.getItemVisual(dataIndex, 'style');\n if (visualStyle) {\n var visualType = data.getVisual('drawType');\n // Default to be same with main color\n defaultStyle.stroke = visualStyle[visualType];\n }\n var labelLineModel = itemModel.getModel('labelLine');\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\n updateLabelLinePoints(el, labelLineModel);\n }\n };\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\n var textEl = el.getTextContent();\n var guideLine = el.getTextGuideLine();\n // Animate\n if (textEl\n // `forceLabelAnimation` has the highest priority\n && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) {\n var layoutStore = labelLayoutInnerStore(textEl);\n var oldLayout = layoutStore.oldLayout;\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex;\n var newProps = {\n x: textEl.x,\n y: textEl.y,\n rotation: textEl.rotation\n };\n var data = seriesModel.getData(ecData.dataType);\n if (!oldLayout) {\n textEl.attr(newProps);\n // Disable fade in animation if value animation is enabled.\n if (!labelInner(textEl).valueAnimation) {\n var oldOpacity = retrieve2(textEl.style.opacity, 1);\n // Fade in animation\n textEl.style.opacity = 0;\n initProps(textEl, {\n style: {\n opacity: oldOpacity\n }\n }, seriesModel, dataIndex);\n }\n } else {\n textEl.attr(oldLayout);\n // Make sure the animation from is in the right status.\n var prevStates = el.prevStates;\n if (prevStates) {\n if (indexOf(prevStates, 'select') >= 0) {\n textEl.attr(layoutStore.oldLayoutSelect);\n }\n if (indexOf(prevStates, 'emphasis') >= 0) {\n textEl.attr(layoutStore.oldLayoutEmphasis);\n }\n }\n updateProps(textEl, newProps, seriesModel, dataIndex);\n }\n layoutStore.oldLayout = newProps;\n if (textEl.states.select) {\n var layoutSelect = layoutStore.oldLayoutSelect = {};\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\n }\n if (textEl.states.emphasis) {\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\n }\n animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel);\n }\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\n var layoutStore = labelLineAnimationStore(guideLine);\n var oldLayout = layoutStore.oldLayout;\n var newLayout = {\n points: guideLine.shape.points\n };\n if (!oldLayout) {\n guideLine.setShape(newLayout);\n guideLine.style.strokePercent = 0;\n initProps(guideLine, {\n style: {\n strokePercent: 1\n }\n }, seriesModel);\n } else {\n guideLine.attr({\n shape: oldLayout\n });\n updateProps(guideLine, {\n shape: newLayout\n }, seriesModel);\n }\n layoutStore.oldLayout = newLayout;\n }\n };\n return LabelManager;\n}();\nexport default LabelManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../util/model.js';\nimport LabelManager from './LabelManager.js';\nvar getLabelManager = makeInner();\nexport function installLabelLayout(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var labelManager = getLabelManager(api).labelManager;\n if (!labelManager) {\n labelManager = getLabelManager(api).labelManager = new LabelManager();\n }\n labelManager.clearLabels();\n });\n registers.registerUpdateLifecycle('series:layoutlabels', function (ecModel, api, params) {\n var labelManager = getLabelManager(api).labelManager;\n params.updatedSeries.forEach(function (series) {\n labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series));\n });\n labelManager.updateLayoutConfig(api);\n labelManager.layout(api);\n labelManager.processLabelsOverall();\n });\n}","import { isAroundZero } from './helper.js';\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nvar PI2 = Math.PI * 2;\nvar degree = 180 / PI;\nvar SVGPathRebuilder = (function () {\n function SVGPathRebuilder() {\n }\n SVGPathRebuilder.prototype.reset = function (precision) {\n this._start = true;\n this._d = [];\n this._str = '';\n this._p = Math.pow(10, precision || 4);\n };\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\n this._add('M', x, y);\n };\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\n this._add('L', x, y);\n };\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\n this._add('C', x, y, x2, y2, x3, y3);\n };\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\n this._add('Q', x, y, x2, y2);\n };\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\n };\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\n var dTheta = endAngle - startAngle;\n var clockwise = !anticlockwise;\n var dThetaPositive = Math.abs(dTheta);\n var isCircle = isAroundZero(dThetaPositive - PI2)\n || (clockwise ? dTheta >= PI2 : -dTheta >= PI2);\n var unifiedTheta = dTheta > 0 ? dTheta % PI2 : (dTheta % PI2 + PI2);\n var large = false;\n if (isCircle) {\n large = true;\n }\n else if (isAroundZero(dThetaPositive)) {\n large = false;\n }\n else {\n large = (unifiedTheta >= PI) === !!clockwise;\n }\n var x0 = cx + rx * mathCos(startAngle);\n var y0 = cy + ry * mathSin(startAngle);\n if (this._start) {\n this._add('M', x0, y0);\n }\n var xRot = Math.round(psi * degree);\n if (isCircle) {\n var p = 1 / this._p;\n var dTheta_1 = (clockwise ? 1 : -1) * (PI2 - p);\n this._add('A', rx, ry, xRot, 1, +clockwise, cx + rx * mathCos(startAngle + dTheta_1), cy + ry * mathSin(startAngle + dTheta_1));\n if (p > 1e-2) {\n this._add('A', rx, ry, xRot, 0, +clockwise, x0, y0);\n }\n }\n else {\n var x = cx + rx * mathCos(endAngle);\n var y = cy + ry * mathSin(endAngle);\n this._add('A', rx, ry, xRot, +large, +clockwise, x, y);\n }\n };\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\n this._add('M', x, y);\n this._add('l', w, 0);\n this._add('l', 0, h);\n this._add('l', -w, 0);\n this._add('Z');\n };\n SVGPathRebuilder.prototype.closePath = function () {\n if (this._d.length > 0) {\n this._add('Z');\n }\n };\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\n var vals = [];\n var p = this._p;\n for (var i = 1; i < arguments.length; i++) {\n var val = arguments[i];\n if (isNaN(val)) {\n this._invalid = true;\n return;\n }\n vals.push(Math.round(val * p) / p);\n }\n this._d.push(cmd + vals.join(' '));\n this._start = cmd === 'Z';\n };\n SVGPathRebuilder.prototype.generateStr = function () {\n this._str = this._invalid ? '' : this._d.join('');\n this._d = [];\n };\n SVGPathRebuilder.prototype.getStr = function () {\n return this._str;\n };\n return SVGPathRebuilder;\n}());\nexport default SVGPathRebuilder;\n","import { DEFAULT_PATH_STYLE } from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineDash } from '../canvas/dashStyle.js';\nimport { map } from '../core/util.js';\nimport { normalizeColor } from './helper.js';\nvar NONE = 'none';\nvar mathRound = Math.round;\nfunction pathHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== NONE;\n}\nfunction pathHasStroke(style) {\n var stroke = style.stroke;\n return stroke != null && stroke !== NONE;\n}\nvar strokeProps = ['lineCap', 'miterLimit', 'lineJoin'];\nvar svgStrokeProps = map(strokeProps, function (prop) { return \"stroke-\" + prop.toLowerCase(); });\nexport default function mapStyleToAttrs(updateAttr, style, el, forceUpdate) {\n var opacity = style.opacity == null ? 1 : style.opacity;\n if (el instanceof ZRImage) {\n updateAttr('opacity', opacity);\n return;\n }\n if (pathHasFill(style)) {\n var fill = normalizeColor(style.fill);\n updateAttr('fill', fill.color);\n var fillOpacity = style.fillOpacity != null\n ? style.fillOpacity * fill.opacity * opacity\n : fill.opacity * opacity;\n if (forceUpdate || fillOpacity < 1) {\n updateAttr('fill-opacity', fillOpacity);\n }\n }\n else {\n updateAttr('fill', NONE);\n }\n if (pathHasStroke(style)) {\n var stroke = normalizeColor(style.stroke);\n updateAttr('stroke', stroke.color);\n var strokeScale = style.strokeNoScale\n ? el.getLineScale()\n : 1;\n var strokeWidth = (strokeScale ? (style.lineWidth || 0) / strokeScale : 0);\n var strokeOpacity = style.strokeOpacity != null\n ? style.strokeOpacity * stroke.opacity * opacity\n : stroke.opacity * opacity;\n var strokeFirst = style.strokeFirst;\n if (forceUpdate || strokeWidth !== 1) {\n updateAttr('stroke-width', strokeWidth);\n }\n if (forceUpdate || strokeFirst) {\n updateAttr('paint-order', strokeFirst ? 'stroke' : 'fill');\n }\n if (forceUpdate || strokeOpacity < 1) {\n updateAttr('stroke-opacity', strokeOpacity);\n }\n if (style.lineDash) {\n var _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n if (lineDash) {\n lineDashOffset = mathRound(lineDashOffset || 0);\n updateAttr('stroke-dasharray', lineDash.join(','));\n if (lineDashOffset || forceUpdate) {\n updateAttr('stroke-dashoffset', lineDashOffset);\n }\n }\n }\n else if (forceUpdate) {\n updateAttr('stroke-dasharray', NONE);\n }\n for (var i = 0; i < strokeProps.length; i++) {\n var propName = strokeProps[i];\n if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) {\n var val = style[propName] || DEFAULT_PATH_STYLE[propName];\n val && updateAttr(svgStrokeProps[i], val);\n }\n }\n }\n else if (forceUpdate) {\n updateAttr('stroke', NONE);\n }\n}\n","import { keys, map } from '../core/util.js';\nimport { encodeHTML } from '../core/dom.js';\nexport var SVGNS = 'http://www.w3.org/2000/svg';\nexport var XLINKNS = 'http://www.w3.org/1999/xlink';\nexport var XMLNS = 'http://www.w3.org/2000/xmlns/';\nexport var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';\nexport var META_DATA_PREFIX = 'ecmeta_';\nexport function createElement(name) {\n return document.createElementNS(SVGNS, name);\n}\n;\nexport function createVNode(tag, key, attrs, children, text) {\n return {\n tag: tag,\n attrs: attrs || {},\n children: children,\n text: text,\n key: key\n };\n}\nfunction createElementOpen(name, attrs) {\n var attrsStr = [];\n if (attrs) {\n for (var key in attrs) {\n var val = attrs[key];\n var part = key;\n if (val === false) {\n continue;\n }\n else if (val !== true && val != null) {\n part += \"=\\\"\" + val + \"\\\"\";\n }\n attrsStr.push(part);\n }\n }\n return \"<\" + name + \" \" + attrsStr.join(' ') + \">\";\n}\nfunction createElementClose(name) {\n return \"\";\n}\nexport function vNodeToString(el, opts) {\n opts = opts || {};\n var S = opts.newline ? '\\n' : '';\n function convertElToString(el) {\n var children = el.children, tag = el.tag, attrs = el.attrs, text = el.text;\n return createElementOpen(tag, attrs)\n + (tag !== 'style' ? encodeHTML(text) : text || '')\n + (children ? \"\" + S + map(children, function (child) { return convertElToString(child); }).join(S) + S : '')\n + createElementClose(tag);\n }\n return convertElToString(el);\n}\nexport function getCssString(selectorNodes, animationNodes, opts) {\n opts = opts || {};\n var S = opts.newline ? '\\n' : '';\n var bracketBegin = \" {\" + S;\n var bracketEnd = S + \"}\";\n var selectors = map(keys(selectorNodes), function (className) {\n return className + bracketBegin + map(keys(selectorNodes[className]), function (attrName) {\n return attrName + \":\" + selectorNodes[className][attrName] + \";\";\n }).join(S) + bracketEnd;\n }).join(S);\n var animations = map(keys(animationNodes), function (animationName) {\n return \"@keyframes \" + animationName + bracketBegin + map(keys(animationNodes[animationName]), function (percent) {\n return percent + bracketBegin + map(keys(animationNodes[animationName][percent]), function (attrName) {\n var val = animationNodes[animationName][percent][attrName];\n if (attrName === 'd') {\n val = \"path(\\\"\" + val + \"\\\")\";\n }\n return attrName + \":\" + val + \";\";\n }).join(S) + bracketEnd;\n }).join(S) + bracketEnd;\n }).join(S);\n if (!selectors && !animations) {\n return '';\n }\n return [''].join(S);\n}\nexport function createBrushScope(zrId) {\n return {\n zrId: zrId,\n shadowCache: {},\n patternCache: {},\n gradientCache: {},\n clipPathCache: {},\n defs: {},\n cssNodes: {},\n cssAnims: {},\n cssStyleCache: {},\n cssAnimIdx: 0,\n shadowIdx: 0,\n gradientIdx: 0,\n patternIdx: 0,\n clipPathIdx: 0\n };\n}\nexport function createSVGVNode(width, height, children, useViewBox) {\n return createVNode('svg', 'root', {\n 'width': width,\n 'height': height,\n 'xmlns': SVGNS,\n 'xmlns:xlink': XLINKNS,\n 'version': '1.1',\n 'baseProfile': 'full',\n 'viewBox': useViewBox ? \"0 0 \" + width + \" \" + height : false\n }, children);\n}\n","var cssClassIdx = 0;\nexport function getClassId() {\n return cssClassIdx++;\n}\n","import { copyTransform } from '../core/Transformable.js';\nimport { createBrushScope } from './core.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { getPathPrecision, getSRTTransformString } from './helper.js';\nimport { each, extend, filter, isNumber, isString, keys } from '../core/util.js';\nimport CompoundPath from '../graphic/CompoundPath.js';\nimport { createCubicEasingFunc } from '../animation/cubicEasing.js';\nimport { getClassId } from './cssClassId.js';\nexport var EASING_MAP = {\n cubicIn: '0.32,0,0.67,0',\n cubicOut: '0.33,1,0.68,1',\n cubicInOut: '0.65,0,0.35,1',\n quadraticIn: '0.11,0,0.5,0',\n quadraticOut: '0.5,1,0.89,1',\n quadraticInOut: '0.45,0,0.55,1',\n quarticIn: '0.5,0,0.75,0',\n quarticOut: '0.25,1,0.5,1',\n quarticInOut: '0.76,0,0.24,1',\n quinticIn: '0.64,0,0.78,0',\n quinticOut: '0.22,1,0.36,1',\n quinticInOut: '0.83,0,0.17,1',\n sinusoidalIn: '0.12,0,0.39,0',\n sinusoidalOut: '0.61,1,0.88,1',\n sinusoidalInOut: '0.37,0,0.63,1',\n exponentialIn: '0.7,0,0.84,0',\n exponentialOut: '0.16,1,0.3,1',\n exponentialInOut: '0.87,0,0.13,1',\n circularIn: '0.55,0,1,0.45',\n circularOut: '0,0.55,0.45,1',\n circularInOut: '0.85,0,0.15,1'\n};\nvar transformOriginKey = 'transform-origin';\nfunction buildPathString(el, kfShape, path) {\n var shape = extend({}, el.shape);\n extend(shape, kfShape);\n el.buildPath(path, shape);\n var svgPathBuilder = new SVGPathRebuilder();\n svgPathBuilder.reset(getPathPrecision(el));\n path.rebuildPath(svgPathBuilder, 1);\n svgPathBuilder.generateStr();\n return svgPathBuilder.getStr();\n}\nfunction setTransformOrigin(target, transform) {\n var originX = transform.originX, originY = transform.originY;\n if (originX || originY) {\n target[transformOriginKey] = originX + \"px \" + originY + \"px\";\n }\n}\nexport var ANIMATE_STYLE_MAP = {\n fill: 'fill',\n opacity: 'opacity',\n lineWidth: 'stroke-width',\n lineDashOffset: 'stroke-dashoffset'\n};\nfunction addAnimation(cssAnim, scope) {\n var animationName = scope.zrId + '-ani-' + scope.cssAnimIdx++;\n scope.cssAnims[animationName] = cssAnim;\n return animationName;\n}\nfunction createCompoundPathCSSAnimation(el, attrs, scope) {\n var paths = el.shape.paths;\n var composedAnim = {};\n var cssAnimationCfg;\n var cssAnimationName;\n each(paths, function (path) {\n var subScope = createBrushScope(scope.zrId);\n subScope.animation = true;\n createCSSAnimation(path, {}, subScope, true);\n var cssAnims = subScope.cssAnims;\n var cssNodes = subScope.cssNodes;\n var animNames = keys(cssAnims);\n var len = animNames.length;\n if (!len) {\n return;\n }\n cssAnimationName = animNames[len - 1];\n var lastAnim = cssAnims[cssAnimationName];\n for (var percent in lastAnim) {\n var kf = lastAnim[percent];\n composedAnim[percent] = composedAnim[percent] || { d: '' };\n composedAnim[percent].d += kf.d || '';\n }\n for (var className in cssNodes) {\n var val = cssNodes[className].animation;\n if (val.indexOf(cssAnimationName) >= 0) {\n cssAnimationCfg = val;\n }\n }\n });\n if (!cssAnimationCfg) {\n return;\n }\n attrs.d = false;\n var animationName = addAnimation(composedAnim, scope);\n return cssAnimationCfg.replace(cssAnimationName, animationName);\n}\nfunction getEasingFunc(easing) {\n return isString(easing)\n ? EASING_MAP[easing]\n ? \"cubic-bezier(\" + EASING_MAP[easing] + \")\"\n : createCubicEasingFunc(easing) ? easing : ''\n : '';\n}\nexport function createCSSAnimation(el, attrs, scope, onlyShape) {\n var animators = el.animators;\n var len = animators.length;\n var cssAnimations = [];\n if (el instanceof CompoundPath) {\n var animationCfg = createCompoundPathCSSAnimation(el, attrs, scope);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n else if (!len) {\n return;\n }\n }\n else if (!len) {\n return;\n }\n var groupAnimators = {};\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var cfgArr = [animator.getMaxTime() / 1000 + 's'];\n var easing = getEasingFunc(animator.getClip().easing);\n var delay = animator.getDelay();\n if (easing) {\n cfgArr.push(easing);\n }\n else {\n cfgArr.push('linear');\n }\n if (delay) {\n cfgArr.push(delay / 1000 + 's');\n }\n if (animator.getLoop()) {\n cfgArr.push('infinite');\n }\n var cfg = cfgArr.join(' ');\n groupAnimators[cfg] = groupAnimators[cfg] || [cfg, []];\n groupAnimators[cfg][1].push(animator);\n }\n function createSingleCSSAnimation(groupAnimator) {\n var animators = groupAnimator[1];\n var len = animators.length;\n var transformKfs = {};\n var shapeKfs = {};\n var finalKfs = {};\n var animationTimingFunctionAttrName = 'animation-timing-function';\n function saveAnimatorTrackToCssKfs(animator, cssKfs, toCssAttrName) {\n var tracks = animator.getTracks();\n var maxTime = animator.getMaxTime();\n for (var k = 0; k < tracks.length; k++) {\n var track = tracks[k];\n if (track.needsAnimate()) {\n var kfs = track.keyframes;\n var attrName = track.propName;\n toCssAttrName && (attrName = toCssAttrName(attrName));\n if (attrName) {\n for (var i = 0; i < kfs.length; i++) {\n var kf = kfs[i];\n var percent = Math.round(kf.time / maxTime * 100) + '%';\n var kfEasing = getEasingFunc(kf.easing);\n var rawValue = kf.rawValue;\n if (isString(rawValue) || isNumber(rawValue)) {\n cssKfs[percent] = cssKfs[percent] || {};\n cssKfs[percent][attrName] = kf.rawValue;\n if (kfEasing) {\n cssKfs[percent][animationTimingFunctionAttrName] = kfEasing;\n }\n }\n }\n }\n }\n }\n }\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var targetProp = animator.targetName;\n if (!targetProp) {\n !onlyShape && saveAnimatorTrackToCssKfs(animator, transformKfs);\n }\n else if (targetProp === 'shape') {\n saveAnimatorTrackToCssKfs(animator, shapeKfs);\n }\n }\n for (var percent in transformKfs) {\n var transform = {};\n copyTransform(transform, el);\n extend(transform, transformKfs[percent]);\n var str = getSRTTransformString(transform);\n var timingFunction = transformKfs[percent][animationTimingFunctionAttrName];\n finalKfs[percent] = str ? {\n transform: str\n } : {};\n setTransformOrigin(finalKfs[percent], transform);\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n }\n ;\n var path;\n var canAnimateShape = true;\n for (var percent in shapeKfs) {\n finalKfs[percent] = finalKfs[percent] || {};\n var isFirst = !path;\n var timingFunction = shapeKfs[percent][animationTimingFunctionAttrName];\n if (isFirst) {\n path = new PathProxy();\n }\n var len_1 = path.len();\n path.reset();\n finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path);\n var newLen = path.len();\n if (!isFirst && len_1 !== newLen) {\n canAnimateShape = false;\n break;\n }\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n }\n ;\n if (!canAnimateShape) {\n for (var percent in finalKfs) {\n delete finalKfs[percent].d;\n }\n }\n if (!onlyShape) {\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var targetProp = animator.targetName;\n if (targetProp === 'style') {\n saveAnimatorTrackToCssKfs(animator, finalKfs, function (propName) { return ANIMATE_STYLE_MAP[propName]; });\n }\n }\n }\n var percents = keys(finalKfs);\n var allTransformOriginSame = true;\n var transformOrigin;\n for (var i = 1; i < percents.length; i++) {\n var p0 = percents[i - 1];\n var p1 = percents[i];\n if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) {\n allTransformOriginSame = false;\n break;\n }\n transformOrigin = finalKfs[p0][transformOriginKey];\n }\n if (allTransformOriginSame && transformOrigin) {\n for (var percent in finalKfs) {\n if (finalKfs[percent][transformOriginKey]) {\n delete finalKfs[percent][transformOriginKey];\n }\n }\n attrs[transformOriginKey] = transformOrigin;\n }\n if (filter(percents, function (percent) { return keys(finalKfs[percent]).length > 0; }).length) {\n var animationName = addAnimation(finalKfs, scope);\n return animationName + \" \" + groupAnimator[0] + \" both\";\n }\n }\n for (var key in groupAnimators) {\n var animationCfg = createSingleCSSAnimation(groupAnimators[key]);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n }\n if (cssAnimations.length) {\n var className = scope.zrId + '-cls-' + getClassId();\n scope.cssNodes['.' + className] = {\n animation: cssAnimations.join(',')\n };\n attrs[\"class\"] = className;\n }\n}\n","import { liftColor } from '../tool/color.js';\nimport { getClassId } from './cssClassId.js';\nexport function createCSSEmphasis(el, attrs, scope) {\n if (!el.ignore) {\n if (el.isSilent()) {\n var style = {\n 'pointer-events': 'none'\n };\n setClassAttribute(style, attrs, scope, true);\n }\n else {\n var emphasisStyle = el.states.emphasis && el.states.emphasis.style\n ? el.states.emphasis.style\n : {};\n var fill = emphasisStyle.fill;\n if (!fill) {\n var normalFill = el.style && el.style.fill;\n var selectFill = el.states.select\n && el.states.select.style\n && el.states.select.style.fill;\n var fromFill = el.currentStates.indexOf('select') >= 0\n ? (selectFill || normalFill)\n : normalFill;\n if (fromFill) {\n fill = liftColor(fromFill);\n }\n }\n var lineWidth = emphasisStyle.lineWidth;\n if (lineWidth) {\n var scaleX = (!emphasisStyle.strokeNoScale && el.transform)\n ? el.transform[0]\n : 1;\n lineWidth = lineWidth / scaleX;\n }\n var style = {\n cursor: 'pointer'\n };\n if (fill) {\n style.fill = fill;\n }\n if (emphasisStyle.stroke) {\n style.stroke = emphasisStyle.stroke;\n }\n if (lineWidth) {\n style['stroke-width'] = lineWidth;\n }\n setClassAttribute(style, attrs, scope, true);\n }\n }\n}\nfunction setClassAttribute(style, attrs, scope, withHover) {\n var styleKey = JSON.stringify(style);\n var className = scope.cssStyleCache[styleKey];\n if (!className) {\n className = scope.zrId + '-cls-' + getClassId();\n scope.cssStyleCache[styleKey] = className;\n scope.cssNodes['.' + className + (withHover ? ':hover' : '')] = style;\n }\n attrs[\"class\"] = attrs[\"class\"] ? (attrs[\"class\"] + ' ' + className) : className;\n}\n","import { adjustTextY, getIdURL, getMatrixStr, getPathPrecision, getShadowKey, getSRTTransformString, hasShadow, isAroundZero, isGradient, isImagePattern, isLinearGradient, isPattern, isRadialGradient, normalizeColor, round4, TEXT_ALIGN_TO_ANCHOR } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineHeight } from '../contain/text.js';\nimport TSpan from '../graphic/TSpan.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport mapStyleToAttrs from './mapStyleToAttrs.js';\nimport { createVNode, vNodeToString, META_DATA_PREFIX } from './core.js';\nimport { assert, clone, isFunction, isString, logError, map, retrieve2 } from '../core/util.js';\nimport { createOrUpdateImage } from '../graphic/helper/image.js';\nimport { createCSSAnimation } from './cssAnimation.js';\nimport { hasSeparateFont, parseFontSize } from '../graphic/Text.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_FAMILY } from '../core/platform.js';\nimport { createCSSEmphasis } from './cssEmphasis.js';\nimport { getElementSSRData } from '../zrender.js';\nvar round = Math.round;\nfunction isImageLike(val) {\n return val && isString(val.src);\n}\nfunction isCanvasLike(val) {\n return val && isFunction(val.toDataURL);\n}\nfunction setStyleAttrs(attrs, style, el, scope) {\n mapStyleToAttrs(function (key, val) {\n var isFillStroke = key === 'fill' || key === 'stroke';\n if (isFillStroke && isGradient(val)) {\n setGradient(style, attrs, key, scope);\n }\n else if (isFillStroke && isPattern(val)) {\n setPattern(el, attrs, key, scope);\n }\n else if (isFillStroke && val === 'none') {\n attrs[key] = 'transparent';\n }\n else {\n attrs[key] = val;\n }\n }, style, el, false);\n setShadow(el, attrs, scope);\n}\nfunction setMetaData(attrs, el) {\n var metaData = getElementSSRData(el);\n if (metaData) {\n metaData.each(function (val, key) {\n val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + '');\n });\n if (el.isSilent()) {\n attrs[META_DATA_PREFIX + 'silent'] = 'true';\n }\n }\n}\nfunction noRotateScale(m) {\n return isAroundZero(m[0] - 1)\n && isAroundZero(m[1])\n && isAroundZero(m[2])\n && isAroundZero(m[3] - 1);\n}\nfunction noTranslate(m) {\n return isAroundZero(m[4]) && isAroundZero(m[5]);\n}\nfunction setTransform(attrs, m, compress) {\n if (m && !(noTranslate(m) && noRotateScale(m))) {\n var mul = compress ? 10 : 1e4;\n attrs.transform = noRotateScale(m)\n ? \"translate(\" + round(m[4] * mul) / mul + \" \" + round(m[5] * mul) / mul + \")\" : getMatrixStr(m);\n }\n}\nfunction convertPolyShape(shape, attrs, mul) {\n var points = shape.points;\n var strArr = [];\n for (var i = 0; i < points.length; i++) {\n strArr.push(round(points[i][0] * mul) / mul);\n strArr.push(round(points[i][1] * mul) / mul);\n }\n attrs.points = strArr.join(' ');\n}\nfunction validatePolyShape(shape) {\n return !shape.smooth;\n}\nfunction createAttrsConvert(desc) {\n var normalizedDesc = map(desc, function (item) {\n return (typeof item === 'string' ? [item, item] : item);\n });\n return function (shape, attrs, mul) {\n for (var i = 0; i < normalizedDesc.length; i++) {\n var item = normalizedDesc[i];\n var val = shape[item[0]];\n if (val != null) {\n attrs[item[1]] = round(val * mul) / mul;\n }\n }\n };\n}\nvar builtinShapesDef = {\n circle: [createAttrsConvert(['cx', 'cy', 'r'])],\n polyline: [convertPolyShape, validatePolyShape],\n polygon: [convertPolyShape, validatePolyShape]\n};\nfunction hasShapeAnimation(el) {\n var animators = el.animators;\n for (var i = 0; i < animators.length; i++) {\n if (animators[i].targetName === 'shape') {\n return true;\n }\n }\n return false;\n}\nexport function brushSVGPath(el, scope) {\n var style = el.style;\n var shape = el.shape;\n var builtinShpDef = builtinShapesDef[el.type];\n var attrs = {};\n var needsAnimate = scope.animation;\n var svgElType = 'path';\n var strokePercent = el.style.strokePercent;\n var precision = (scope.compress && getPathPrecision(el)) || 4;\n if (builtinShpDef\n && !scope.willUpdate\n && !(builtinShpDef[1] && !builtinShpDef[1](shape))\n && !(needsAnimate && hasShapeAnimation(el))\n && !(strokePercent < 1)) {\n svgElType = el.type;\n var mul = Math.pow(10, precision);\n builtinShpDef[0](shape, attrs, mul);\n }\n else {\n var needBuildPath = !el.path || el.shapeChanged();\n if (!el.path) {\n el.createPathProxy();\n }\n var path = el.path;\n if (needBuildPath) {\n path.beginPath();\n el.buildPath(path, el.shape);\n el.pathUpdated();\n }\n var pathVersion = path.getVersion();\n var elExt = el;\n var svgPathBuilder = elExt.__svgPathBuilder;\n if (elExt.__svgPathVersion !== pathVersion\n || !svgPathBuilder\n || strokePercent !== elExt.__svgPathStrokePercent) {\n if (!svgPathBuilder) {\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\n }\n svgPathBuilder.reset(precision);\n path.rebuildPath(svgPathBuilder, strokePercent);\n svgPathBuilder.generateStr();\n elExt.__svgPathVersion = pathVersion;\n elExt.__svgPathStrokePercent = strokePercent;\n }\n attrs.d = svgPathBuilder.getStr();\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n setMetaData(attrs, el);\n scope.animation && createCSSAnimation(el, attrs, scope);\n scope.emphasis && createCSSEmphasis(el, attrs, scope);\n return createVNode(svgElType, el.id + '', attrs);\n}\nexport function brushSVGImage(el, scope) {\n var style = el.style;\n var image = style.image;\n if (image && !isString(image)) {\n if (isImageLike(image)) {\n image = image.src;\n }\n else if (isCanvasLike(image)) {\n image = image.toDataURL();\n }\n }\n if (!image) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var dw = style.width;\n var dh = style.height;\n var attrs = {\n href: image,\n width: dw,\n height: dh\n };\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n setMetaData(attrs, el);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode('image', el.id + '', attrs);\n}\n;\nexport function brushSVGTSpan(el, scope) {\n var style = el.style;\n var text = style.text;\n text != null && (text += '');\n if (!text || isNaN(style.x) || isNaN(style.y)) {\n return;\n }\n var font = style.font || DEFAULT_FONT;\n var x = style.x || 0;\n var y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline);\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\n || style.textAlign;\n var attrs = {\n 'dominant-baseline': 'central',\n 'text-anchor': textAlign\n };\n if (hasSeparateFont(style)) {\n var separatedFontStr = '';\n var fontStyle = style.fontStyle;\n var fontSize = parseFontSize(style.fontSize);\n if (!parseFloat(fontSize)) {\n return;\n }\n var fontFamily = style.fontFamily || DEFAULT_FONT_FAMILY;\n var fontWeight = style.fontWeight;\n separatedFontStr += \"font-size:\" + fontSize + \";font-family:\" + fontFamily + \";\";\n if (fontStyle && fontStyle !== 'normal') {\n separatedFontStr += \"font-style:\" + fontStyle + \";\";\n }\n if (fontWeight && fontWeight !== 'normal') {\n separatedFontStr += \"font-weight:\" + fontWeight + \";\";\n }\n attrs.style = separatedFontStr;\n }\n else {\n attrs.style = \"font: \" + font;\n }\n if (text.match(/\\s/)) {\n attrs['xml:space'] = 'preserve';\n }\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n setMetaData(attrs, el);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode('text', el.id + '', attrs, undefined, text);\n}\nexport function brush(el, scope) {\n if (el instanceof Path) {\n return brushSVGPath(el, scope);\n }\n else if (el instanceof ZRImage) {\n return brushSVGImage(el, scope);\n }\n else if (el instanceof TSpan) {\n return brushSVGTSpan(el, scope);\n }\n}\nfunction setShadow(el, attrs, scope) {\n var style = el.style;\n if (hasShadow(style)) {\n var shadowKey = getShadowKey(el);\n var shadowCache = scope.shadowCache;\n var shadowId = shadowCache[shadowKey];\n if (!shadowId) {\n var globalScale = el.getGlobalScale();\n var scaleX = globalScale[0];\n var scaleY = globalScale[1];\n if (!scaleX || !scaleY) {\n return;\n }\n var offsetX = style.shadowOffsetX || 0;\n var offsetY = style.shadowOffsetY || 0;\n var blur_1 = style.shadowBlur;\n var _a = normalizeColor(style.shadowColor), opacity = _a.opacity, color = _a.color;\n var stdDx = blur_1 / 2 / scaleX;\n var stdDy = blur_1 / 2 / scaleY;\n var stdDeviation = stdDx + ' ' + stdDy;\n shadowId = scope.zrId + '-s' + scope.shadowIdx++;\n scope.defs[shadowId] = createVNode('filter', shadowId, {\n 'id': shadowId,\n 'x': '-100%',\n 'y': '-100%',\n 'width': '300%',\n 'height': '300%'\n }, [\n createVNode('feDropShadow', '', {\n 'dx': offsetX / scaleX,\n 'dy': offsetY / scaleY,\n 'stdDeviation': stdDeviation,\n 'flood-color': color,\n 'flood-opacity': opacity\n })\n ]);\n shadowCache[shadowKey] = shadowId;\n }\n attrs.filter = getIdURL(shadowId);\n }\n}\nexport function setGradient(style, attrs, target, scope) {\n var val = style[target];\n var gradientTag;\n var gradientAttrs = {\n 'gradientUnits': val.global\n ? 'userSpaceOnUse'\n : 'objectBoundingBox'\n };\n if (isLinearGradient(val)) {\n gradientTag = 'linearGradient';\n gradientAttrs.x1 = val.x;\n gradientAttrs.y1 = val.y;\n gradientAttrs.x2 = val.x2;\n gradientAttrs.y2 = val.y2;\n }\n else if (isRadialGradient(val)) {\n gradientTag = 'radialGradient';\n gradientAttrs.cx = retrieve2(val.x, 0.5);\n gradientAttrs.cy = retrieve2(val.y, 0.5);\n gradientAttrs.r = retrieve2(val.r, 0.5);\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logError('Illegal gradient type.');\n }\n return;\n }\n var colors = val.colorStops;\n var colorStops = [];\n for (var i = 0, len = colors.length; i < len; ++i) {\n var offset = round4(colors[i].offset) * 100 + '%';\n var stopColor = colors[i].color;\n var _a = normalizeColor(stopColor), color = _a.color, opacity = _a.opacity;\n var stopsAttrs = {\n 'offset': offset\n };\n stopsAttrs['stop-color'] = color;\n if (opacity < 1) {\n stopsAttrs['stop-opacity'] = opacity;\n }\n colorStops.push(createVNode('stop', i + '', stopsAttrs));\n }\n var gradientVNode = createVNode(gradientTag, '', gradientAttrs, colorStops);\n var gradientKey = vNodeToString(gradientVNode);\n var gradientCache = scope.gradientCache;\n var gradientId = gradientCache[gradientKey];\n if (!gradientId) {\n gradientId = scope.zrId + '-g' + scope.gradientIdx++;\n gradientCache[gradientKey] = gradientId;\n gradientAttrs.id = gradientId;\n scope.defs[gradientId] = createVNode(gradientTag, gradientId, gradientAttrs, colorStops);\n }\n attrs[target] = getIdURL(gradientId);\n}\nexport function setPattern(el, attrs, target, scope) {\n var val = el.style[target];\n var boundingRect = el.getBoundingRect();\n var patternAttrs = {};\n var repeat = val.repeat;\n var noRepeat = repeat === 'no-repeat';\n var repeatX = repeat === 'repeat-x';\n var repeatY = repeat === 'repeat-y';\n var child;\n if (isImagePattern(val)) {\n var imageWidth_1 = val.imageWidth;\n var imageHeight_1 = val.imageHeight;\n var imageSrc = void 0;\n var patternImage = val.image;\n if (isString(patternImage)) {\n imageSrc = patternImage;\n }\n else if (isImageLike(patternImage)) {\n imageSrc = patternImage.src;\n }\n else if (isCanvasLike(patternImage)) {\n imageSrc = patternImage.toDataURL();\n }\n if (typeof Image === 'undefined') {\n var errMsg = 'Image width/height must been given explictly in svg-ssr renderer.';\n assert(imageWidth_1, errMsg);\n assert(imageHeight_1, errMsg);\n }\n else if (imageWidth_1 == null || imageHeight_1 == null) {\n var setSizeToVNode_1 = function (vNode, img) {\n if (vNode) {\n var svgEl = vNode.elm;\n var width = imageWidth_1 || img.width;\n var height = imageHeight_1 || img.height;\n if (vNode.tag === 'pattern') {\n if (repeatX) {\n height = 1;\n width /= boundingRect.width;\n }\n else if (repeatY) {\n width = 1;\n height /= boundingRect.height;\n }\n }\n vNode.attrs.width = width;\n vNode.attrs.height = height;\n if (svgEl) {\n svgEl.setAttribute('width', width);\n svgEl.setAttribute('height', height);\n }\n }\n };\n var createdImage = createOrUpdateImage(imageSrc, null, el, function (img) {\n noRepeat || setSizeToVNode_1(patternVNode, img);\n setSizeToVNode_1(child, img);\n });\n if (createdImage && createdImage.width && createdImage.height) {\n imageWidth_1 = imageWidth_1 || createdImage.width;\n imageHeight_1 = imageHeight_1 || createdImage.height;\n }\n }\n child = createVNode('image', 'img', {\n href: imageSrc,\n width: imageWidth_1,\n height: imageHeight_1\n });\n patternAttrs.width = imageWidth_1;\n patternAttrs.height = imageHeight_1;\n }\n else if (val.svgElement) {\n child = clone(val.svgElement);\n patternAttrs.width = val.svgWidth;\n patternAttrs.height = val.svgHeight;\n }\n if (!child) {\n return;\n }\n var patternWidth;\n var patternHeight;\n if (noRepeat) {\n patternWidth = patternHeight = 1;\n }\n else if (repeatX) {\n patternHeight = 1;\n patternWidth = patternAttrs.width / boundingRect.width;\n }\n else if (repeatY) {\n patternWidth = 1;\n patternHeight = patternAttrs.height / boundingRect.height;\n }\n else {\n patternAttrs.patternUnits = 'userSpaceOnUse';\n }\n if (patternWidth != null && !isNaN(patternWidth)) {\n patternAttrs.width = patternWidth;\n }\n if (patternHeight != null && !isNaN(patternHeight)) {\n patternAttrs.height = patternHeight;\n }\n var patternTransform = getSRTTransformString(val);\n patternTransform && (patternAttrs.patternTransform = patternTransform);\n var patternVNode = createVNode('pattern', '', patternAttrs, [child]);\n var patternKey = vNodeToString(patternVNode);\n var patternCache = scope.patternCache;\n var patternId = patternCache[patternKey];\n if (!patternId) {\n patternId = scope.zrId + '-p' + scope.patternIdx++;\n patternCache[patternKey] = patternId;\n patternAttrs.id = patternId;\n patternVNode = scope.defs[patternId] = createVNode('pattern', patternId, patternAttrs, [child]);\n }\n attrs[target] = getIdURL(patternId);\n}\nexport function setClipPath(clipPath, attrs, scope) {\n var clipPathCache = scope.clipPathCache, defs = scope.defs;\n var clipPathId = clipPathCache[clipPath.id];\n if (!clipPathId) {\n clipPathId = scope.zrId + '-c' + scope.clipPathIdx++;\n var clipPathAttrs = {\n id: clipPathId\n };\n clipPathCache[clipPath.id] = clipPathId;\n defs[clipPathId] = createVNode('clipPath', clipPathId, clipPathAttrs, [brushSVGPath(clipPath, scope)]);\n }\n attrs['clip-path'] = getIdURL(clipPathId);\n}\n","export function createTextNode(text) {\n return document.createTextNode(text);\n}\nexport function createComment(text) {\n return document.createComment(text);\n}\nexport function insertBefore(parentNode, newNode, referenceNode) {\n parentNode.insertBefore(newNode, referenceNode);\n}\nexport function removeChild(node, child) {\n node.removeChild(child);\n}\nexport function appendChild(node, child) {\n node.appendChild(child);\n}\nexport function parentNode(node) {\n return node.parentNode;\n}\nexport function nextSibling(node) {\n return node.nextSibling;\n}\nexport function tagName(elm) {\n return elm.tagName;\n}\nexport function setTextContent(node, text) {\n node.textContent = text;\n}\nexport function getTextContent(node) {\n return node.textContent;\n}\nexport function isElement(node) {\n return node.nodeType === 1;\n}\nexport function isText(node) {\n return node.nodeType === 3;\n}\nexport function isComment(node) {\n return node.nodeType === 8;\n}\n","import { isArray, isObject } from '../core/util.js';\nimport { createElement, createVNode, XMLNS, XML_NAMESPACE, XLINKNS } from './core.js';\nimport * as api from './domapi.js';\nvar colonChar = 58;\nvar xChar = 120;\nvar emptyNode = createVNode('', '');\nfunction isUndef(s) {\n return s === undefined;\n}\nfunction isDef(s) {\n return s !== undefined;\n}\nfunction createKeyToOldIdx(children, beginIdx, endIdx) {\n var map = {};\n for (var i = beginIdx; i <= endIdx; ++i) {\n var key = children[i].key;\n if (key !== undefined) {\n if (process.env.NODE_ENV !== 'production') {\n if (map[key] != null) {\n console.error(\"Duplicate key \" + key);\n }\n }\n map[key] = i;\n }\n }\n return map;\n}\nfunction sameVnode(vnode1, vnode2) {\n var isSameKey = vnode1.key === vnode2.key;\n var isSameTag = vnode1.tag === vnode2.tag;\n return isSameTag && isSameKey;\n}\nfunction createElm(vnode) {\n var i;\n var children = vnode.children;\n var tag = vnode.tag;\n if (isDef(tag)) {\n var elm = (vnode.elm = createElement(tag));\n updateAttrs(emptyNode, vnode);\n if (isArray(children)) {\n for (i = 0; i < children.length; ++i) {\n var ch = children[i];\n if (ch != null) {\n api.appendChild(elm, createElm(ch));\n }\n }\n }\n else if (isDef(vnode.text) && !isObject(vnode.text)) {\n api.appendChild(elm, api.createTextNode(vnode.text));\n }\n }\n else {\n vnode.elm = api.createTextNode(vnode.text);\n }\n return vnode.elm;\n}\nfunction addVnodes(parentElm, before, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var ch = vnodes[startIdx];\n if (ch != null) {\n api.insertBefore(parentElm, createElm(ch), before);\n }\n }\n}\nfunction removeVnodes(parentElm, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var ch = vnodes[startIdx];\n if (ch != null) {\n if (isDef(ch.tag)) {\n var parent_1 = api.parentNode(ch.elm);\n api.removeChild(parent_1, ch.elm);\n }\n else {\n api.removeChild(parentElm, ch.elm);\n }\n }\n }\n}\nexport function updateAttrs(oldVnode, vnode) {\n var key;\n var elm = vnode.elm;\n var oldAttrs = oldVnode && oldVnode.attrs || {};\n var attrs = vnode.attrs || {};\n if (oldAttrs === attrs) {\n return;\n }\n for (key in attrs) {\n var cur = attrs[key];\n var old = oldAttrs[key];\n if (old !== cur) {\n if (cur === true) {\n elm.setAttribute(key, '');\n }\n else if (cur === false) {\n elm.removeAttribute(key);\n }\n else {\n if (key === 'style') {\n elm.style.cssText = cur;\n }\n else if (key.charCodeAt(0) !== xChar) {\n elm.setAttribute(key, cur);\n }\n else if (key === 'xmlns:xlink' || key === 'xmlns') {\n elm.setAttributeNS(XMLNS, key, cur);\n }\n else if (key.charCodeAt(3) === colonChar) {\n elm.setAttributeNS(XML_NAMESPACE, key, cur);\n }\n else if (key.charCodeAt(5) === colonChar) {\n elm.setAttributeNS(XLINKNS, key, cur);\n }\n else {\n elm.setAttribute(key, cur);\n }\n }\n }\n }\n for (key in oldAttrs) {\n if (!(key in attrs)) {\n elm.removeAttribute(key);\n }\n }\n}\nfunction updateChildren(parentElm, oldCh, newCh) {\n var oldStartIdx = 0;\n var newStartIdx = 0;\n var oldEndIdx = oldCh.length - 1;\n var oldStartVnode = oldCh[0];\n var oldEndVnode = oldCh[oldEndIdx];\n var newEndIdx = newCh.length - 1;\n var newStartVnode = newCh[0];\n var newEndVnode = newCh[newEndIdx];\n var oldKeyToIdx;\n var idxInOld;\n var elmToMove;\n var before;\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n oldStartVnode = oldCh[++oldStartIdx];\n }\n else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n }\n else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n }\n else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newStartVnode)) {\n patchVnode(oldStartVnode, newStartVnode);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else if (sameVnode(oldEndVnode, newEndVnode)) {\n patchVnode(oldEndVnode, newEndVnode);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newEndVnode)) {\n patchVnode(oldStartVnode, newEndVnode);\n api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm));\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldEndVnode, newStartVnode)) {\n patchVnode(oldEndVnode, newStartVnode);\n api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else {\n if (isUndef(oldKeyToIdx)) {\n oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\n }\n idxInOld = oldKeyToIdx[newStartVnode.key];\n if (isUndef(idxInOld)) {\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n }\n else {\n elmToMove = oldCh[idxInOld];\n if (elmToMove.tag !== newStartVnode.tag) {\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n }\n else {\n patchVnode(elmToMove, newStartVnode);\n oldCh[idxInOld] = undefined;\n api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);\n }\n }\n newStartVnode = newCh[++newStartIdx];\n }\n }\n if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {\n if (oldStartIdx > oldEndIdx) {\n before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;\n addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);\n }\n else {\n removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n }\n }\n}\nfunction patchVnode(oldVnode, vnode) {\n var elm = (vnode.elm = oldVnode.elm);\n var oldCh = oldVnode.children;\n var ch = vnode.children;\n if (oldVnode === vnode) {\n return;\n }\n updateAttrs(oldVnode, vnode);\n if (isUndef(vnode.text)) {\n if (isDef(oldCh) && isDef(ch)) {\n if (oldCh !== ch) {\n updateChildren(elm, oldCh, ch);\n }\n }\n else if (isDef(ch)) {\n if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n addVnodes(elm, null, ch, 0, ch.length - 1);\n }\n else if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n else if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n }\n else if (oldVnode.text !== vnode.text) {\n if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n api.setTextContent(elm, vnode.text);\n }\n}\nexport default function patch(oldVnode, vnode) {\n if (sameVnode(oldVnode, vnode)) {\n patchVnode(oldVnode, vnode);\n }\n else {\n var elm = oldVnode.elm;\n var parent_2 = api.parentNode(elm);\n createElm(vnode);\n if (parent_2 !== null) {\n api.insertBefore(parent_2, vnode.elm, api.nextSibling(elm));\n removeVnodes(parent_2, [oldVnode], 0, 0);\n }\n }\n return vnode;\n}\n","import { brush, setClipPath, setGradient, setPattern } from './graphic.js';\nimport { createElement, createVNode, vNodeToString, getCssString, createBrushScope, createSVGVNode } from './core.js';\nimport { normalizeColor, encodeBase64, isGradient, isPattern } from './helper.js';\nimport { extend, keys, logError, map, noop, retrieve2 } from '../core/util.js';\nimport patch, { updateAttrs } from './patch.js';\nimport { getSize } from '../canvas/helper.js';\nvar svgId = 0;\nvar SVGPainter = (function () {\n function SVGPainter(root, storage, opts) {\n this.type = 'svg';\n this.refreshHover = createMethodNotSupport('refreshHover');\n this.configLayer = createMethodNotSupport('configLayer');\n this.storage = storage;\n this._opts = opts = extend({}, opts);\n this.root = root;\n this._id = 'zr' + svgId++;\n this._oldVNode = createSVGVNode(opts.width, opts.height);\n if (root && !opts.ssr) {\n var viewport = this._viewport = document.createElement('div');\n viewport.style.cssText = 'position:relative;overflow:hidden';\n var svgDom = this._svgDom = this._oldVNode.elm = createElement('svg');\n updateAttrs(null, this._oldVNode);\n viewport.appendChild(svgDom);\n root.appendChild(viewport);\n }\n this.resize(opts.width, opts.height);\n }\n SVGPainter.prototype.getType = function () {\n return this.type;\n };\n SVGPainter.prototype.getViewportRoot = function () {\n return this._viewport;\n };\n SVGPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n SVGPainter.prototype.getSvgDom = function () {\n return this._svgDom;\n };\n SVGPainter.prototype.refresh = function () {\n if (this.root) {\n var vnode = this.renderToVNode({\n willUpdate: true\n });\n vnode.attrs.style = 'position:absolute;left:0;top:0;user-select:none';\n patch(this._oldVNode, vnode);\n this._oldVNode = vnode;\n }\n };\n SVGPainter.prototype.renderOneToVNode = function (el) {\n return brush(el, createBrushScope(this._id));\n };\n SVGPainter.prototype.renderToVNode = function (opts) {\n opts = opts || {};\n var list = this.storage.getDisplayList(true);\n var width = this._width;\n var height = this._height;\n var scope = createBrushScope(this._id);\n scope.animation = opts.animation;\n scope.willUpdate = opts.willUpdate;\n scope.compress = opts.compress;\n scope.emphasis = opts.emphasis;\n var children = [];\n var bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope);\n bgVNode && children.push(bgVNode);\n var mainVNode = !opts.compress\n ? (this._mainVNode = createVNode('g', 'main', {}, [])) : null;\n this._paintList(list, scope, mainVNode ? mainVNode.children : children);\n mainVNode && children.push(mainVNode);\n var defs = map(keys(scope.defs), function (id) { return scope.defs[id]; });\n if (defs.length) {\n children.push(createVNode('defs', 'defs', {}, defs));\n }\n if (opts.animation) {\n var animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, { newline: true });\n if (animationCssStr) {\n var styleNode = createVNode('style', 'stl', {}, [], animationCssStr);\n children.push(styleNode);\n }\n }\n return createSVGVNode(width, height, children, opts.useViewBox);\n };\n SVGPainter.prototype.renderToString = function (opts) {\n opts = opts || {};\n return vNodeToString(this.renderToVNode({\n animation: retrieve2(opts.cssAnimation, true),\n emphasis: retrieve2(opts.cssEmphasis, true),\n willUpdate: false,\n compress: true,\n useViewBox: retrieve2(opts.useViewBox, true)\n }), { newline: true });\n };\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n };\n SVGPainter.prototype.getSvgRoot = function () {\n return this._mainVNode && this._mainVNode.elm;\n };\n SVGPainter.prototype._paintList = function (list, scope, out) {\n var listLen = list.length;\n var clipPathsGroupsStack = [];\n var clipPathsGroupsStackDepth = 0;\n var currentClipPathGroup;\n var prevClipPaths;\n var clipGroupNodeIdx = 0;\n for (var i = 0; i < listLen; i++) {\n var displayable = list[i];\n if (!displayable.invisible) {\n var clipPaths = displayable.__clipPaths;\n var len = clipPaths && clipPaths.length || 0;\n var prevLen = prevClipPaths && prevClipPaths.length || 0;\n var lca = void 0;\n for (lca = Math.max(len - 1, prevLen - 1); lca >= 0; lca--) {\n if (clipPaths && prevClipPaths\n && clipPaths[lca] === prevClipPaths[lca]) {\n break;\n }\n }\n for (var i_1 = prevLen - 1; i_1 > lca; i_1--) {\n clipPathsGroupsStackDepth--;\n currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1];\n }\n for (var i_2 = lca + 1; i_2 < len; i_2++) {\n var groupAttrs = {};\n setClipPath(clipPaths[i_2], groupAttrs, scope);\n var g = createVNode('g', 'clip-g-' + clipGroupNodeIdx++, groupAttrs, []);\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(g);\n clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g;\n currentClipPathGroup = g;\n }\n prevClipPaths = clipPaths;\n var ret = brush(displayable, scope);\n if (ret) {\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(ret);\n }\n }\n }\n };\n SVGPainter.prototype.resize = function (width, height) {\n var opts = this._opts;\n var root = this.root;\n var viewport = this._viewport;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n if (root && viewport) {\n viewport.style.display = 'none';\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n viewport.style.display = '';\n }\n if (this._width !== width || this._height !== height) {\n this._width = width;\n this._height = height;\n if (viewport) {\n var viewportStyle = viewport.style;\n viewportStyle.width = width + 'px';\n viewportStyle.height = height + 'px';\n }\n if (!isPattern(this._backgroundColor)) {\n var svgDom = this._svgDom;\n if (svgDom) {\n svgDom.setAttribute('width', width);\n svgDom.setAttribute('height', height);\n }\n var bgEl = this._bgVNode && this._bgVNode.elm;\n if (bgEl) {\n bgEl.setAttribute('width', width);\n bgEl.setAttribute('height', height);\n }\n }\n else {\n this.refresh();\n }\n }\n };\n SVGPainter.prototype.getWidth = function () {\n return this._width;\n };\n SVGPainter.prototype.getHeight = function () {\n return this._height;\n };\n SVGPainter.prototype.dispose = function () {\n if (this.root) {\n this.root.innerHTML = '';\n }\n this._svgDom =\n this._viewport =\n this.storage =\n this._oldVNode =\n this._bgVNode =\n this._mainVNode = null;\n };\n SVGPainter.prototype.clear = function () {\n if (this._svgDom) {\n this._svgDom.innerHTML = null;\n }\n this._oldVNode = null;\n };\n SVGPainter.prototype.toDataURL = function (base64) {\n var str = this.renderToString();\n var prefix = 'data:image/svg+xml;';\n if (base64) {\n str = encodeBase64(str);\n return str && prefix + 'base64,' + str;\n }\n return prefix + 'charset=UTF-8,' + encodeURIComponent(str);\n };\n return SVGPainter;\n}());\nfunction createMethodNotSupport(method) {\n return function () {\n if (process.env.NODE_ENV !== 'production') {\n logError('In SVG mode painter not support method \"' + method + '\"');\n }\n };\n}\nfunction createBackgroundVNode(width, height, backgroundColor, scope) {\n var bgVNode;\n if (backgroundColor && backgroundColor !== 'none') {\n bgVNode = createVNode('rect', 'bg', {\n width: width,\n height: height,\n x: '0',\n y: '0'\n });\n if (isGradient(backgroundColor)) {\n setGradient({ fill: backgroundColor }, bgVNode.attrs, 'fill', scope);\n }\n else if (isPattern(backgroundColor)) {\n setPattern({\n style: {\n fill: backgroundColor\n },\n dirty: noop,\n getBoundingRect: function () { return ({ width: width, height: height }); }\n }, bgVNode.attrs, 'fill', scope);\n }\n else {\n var _a = normalizeColor(backgroundColor), color = _a.color, opacity = _a.opacity;\n bgVNode.attrs.fill = color;\n opacity < 1 && (bgVNode.attrs['fill-opacity'] = opacity);\n }\n }\n return bgVNode;\n}\nexport default SVGPainter;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SVGPainter from 'zrender/lib/svg/Painter.js';\nexport function install(registers) {\n registers.registerPainter('svg', SVGPainter);\n}","import { __extends } from \"tslib\";\nimport * as util from '../core/util.js';\nimport { devicePixelRatio } from '../config.js';\nimport Eventful from '../core/Eventful.js';\nimport { getCanvasGradient } from './helper.js';\nimport { createCanvasPattern } from './graphic.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { platformApi } from '../core/platform.js';\nfunction createDom(id, painter, dpr) {\n var newDom = platformApi.createCanvas();\n var width = painter.getWidth();\n var height = painter.getHeight();\n var newDomStyle = newDom.style;\n if (newDomStyle) {\n newDomStyle.position = 'absolute';\n newDomStyle.left = '0';\n newDomStyle.top = '0';\n newDomStyle.width = width + 'px';\n newDomStyle.height = height + 'px';\n newDom.setAttribute('data-zr-dom-id', id);\n }\n newDom.width = width * dpr;\n newDom.height = height * dpr;\n return newDom;\n}\n;\nvar Layer = (function (_super) {\n __extends(Layer, _super);\n function Layer(id, painter, dpr) {\n var _this = _super.call(this) || this;\n _this.motionBlur = false;\n _this.lastFrameAlpha = 0.7;\n _this.dpr = 1;\n _this.virtual = false;\n _this.config = {};\n _this.incremental = false;\n _this.zlevel = 0;\n _this.maxRepaintRectCount = 5;\n _this.__dirty = true;\n _this.__firstTimePaint = true;\n _this.__used = false;\n _this.__drawIndex = 0;\n _this.__startIndex = 0;\n _this.__endIndex = 0;\n _this.__prevStartIndex = null;\n _this.__prevEndIndex = null;\n var dom;\n dpr = dpr || devicePixelRatio;\n if (typeof id === 'string') {\n dom = createDom(id, painter, dpr);\n }\n else if (util.isObject(id)) {\n dom = id;\n id = dom.id;\n }\n _this.id = id;\n _this.dom = dom;\n var domStyle = dom.style;\n if (domStyle) {\n util.disableUserSelect(dom);\n dom.onselectstart = function () { return false; };\n domStyle.padding = '0';\n domStyle.margin = '0';\n domStyle.borderWidth = '0';\n }\n _this.painter = painter;\n _this.dpr = dpr;\n return _this;\n }\n Layer.prototype.getElementCount = function () {\n return this.__endIndex - this.__startIndex;\n };\n Layer.prototype.afterBrush = function () {\n this.__prevStartIndex = this.__startIndex;\n this.__prevEndIndex = this.__endIndex;\n };\n Layer.prototype.initContext = function () {\n this.ctx = this.dom.getContext('2d');\n this.ctx.dpr = this.dpr;\n };\n Layer.prototype.setUnpainted = function () {\n this.__firstTimePaint = true;\n };\n Layer.prototype.createBackBuffer = function () {\n var dpr = this.dpr;\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\n this.ctxBack = this.domBack.getContext('2d');\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n };\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\n if (this.__firstTimePaint) {\n this.__firstTimePaint = false;\n return null;\n }\n var mergedRepaintRects = [];\n var maxRepaintRectCount = this.maxRepaintRectCount;\n var full = false;\n var pendingRect = new BoundingRect(0, 0, 0, 0);\n function addRectToMergePool(rect) {\n if (!rect.isFinite() || rect.isZero()) {\n return;\n }\n if (mergedRepaintRects.length === 0) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n else {\n var isMerged = false;\n var minDeltaArea = Infinity;\n var bestRectToMergeIdx = 0;\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\n var mergedRect = mergedRepaintRects[i];\n if (mergedRect.intersect(rect)) {\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\n pendingRect_1.copy(mergedRect);\n pendingRect_1.union(rect);\n mergedRepaintRects[i] = pendingRect_1;\n isMerged = true;\n break;\n }\n else if (full) {\n pendingRect.copy(rect);\n pendingRect.union(mergedRect);\n var aArea = rect.width * rect.height;\n var bArea = mergedRect.width * mergedRect.height;\n var pendingArea = pendingRect.width * pendingRect.height;\n var deltaArea = pendingArea - aArea - bArea;\n if (deltaArea < minDeltaArea) {\n minDeltaArea = deltaArea;\n bestRectToMergeIdx = i;\n }\n }\n }\n if (full) {\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\n isMerged = true;\n }\n if (!isMerged) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n if (!full) {\n full = mergedRepaintRects.length >= maxRepaintRectCount;\n }\n }\n }\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\n var el = displayList[i];\n if (el) {\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n var prevRect = el.__isRendered && ((el.__dirty & REDRAW_BIT) || !shouldPaint)\n ? el.getPrevPaintRect()\n : null;\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n var curRect = shouldPaint && ((el.__dirty & REDRAW_BIT) || !el.__isRendered)\n ? el.getPaintRect()\n : null;\n if (curRect) {\n addRectToMergePool(curRect);\n }\n }\n }\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\n var el = prevList[i];\n var shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true);\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\n var prevRect = el.getPrevPaintRect();\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n }\n }\n var hasIntersections;\n do {\n hasIntersections = false;\n for (var i = 0; i < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].isZero()) {\n mergedRepaintRects.splice(i, 1);\n continue;\n }\n for (var j = i + 1; j < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\n hasIntersections = true;\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\n mergedRepaintRects.splice(j, 1);\n }\n else {\n j++;\n }\n }\n i++;\n }\n } while (hasIntersections);\n this._paintRects = mergedRepaintRects;\n return mergedRepaintRects;\n };\n Layer.prototype.debugGetPaintRects = function () {\n return (this._paintRects || []).slice();\n };\n Layer.prototype.resize = function (width, height) {\n var dpr = this.dpr;\n var dom = this.dom;\n var domStyle = dom.style;\n var domBack = this.domBack;\n if (domStyle) {\n domStyle.width = width + 'px';\n domStyle.height = height + 'px';\n }\n dom.width = width * dpr;\n dom.height = height * dpr;\n if (domBack) {\n domBack.width = width * dpr;\n domBack.height = height * dpr;\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n }\n };\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\n var dom = this.dom;\n var ctx = this.ctx;\n var width = dom.width;\n var height = dom.height;\n clearColor = clearColor || this.clearColor;\n var haveMotionBLur = this.motionBlur && !clearAll;\n var lastFrameAlpha = this.lastFrameAlpha;\n var dpr = this.dpr;\n var self = this;\n if (haveMotionBLur) {\n if (!this.domBack) {\n this.createBackBuffer();\n }\n this.ctxBack.globalCompositeOperation = 'copy';\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\n }\n var domBack = this.domBack;\n function doClear(x, y, width, height) {\n ctx.clearRect(x, y, width, height);\n if (clearColor && clearColor !== 'transparent') {\n var clearColorGradientOrPattern = void 0;\n if (util.isGradientObject(clearColor)) {\n var shouldCache = clearColor.global || (clearColor.__width === width\n && clearColor.__height === height);\n clearColorGradientOrPattern = shouldCache\n && clearColor.__canvasGradient\n || getCanvasGradient(ctx, clearColor, {\n x: 0,\n y: 0,\n width: width,\n height: height\n });\n clearColor.__canvasGradient = clearColorGradientOrPattern;\n clearColor.__width = width;\n clearColor.__height = height;\n }\n else if (util.isImagePatternObject(clearColor)) {\n clearColor.scaleX = clearColor.scaleX || dpr;\n clearColor.scaleY = clearColor.scaleY || dpr;\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\n dirty: function () {\n self.setUnpainted();\n self.painter.refresh();\n }\n });\n }\n ctx.save();\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\n ctx.fillRect(x, y, width, height);\n ctx.restore();\n }\n if (haveMotionBLur) {\n ctx.save();\n ctx.globalAlpha = lastFrameAlpha;\n ctx.drawImage(domBack, x, y, width, height);\n ctx.restore();\n }\n }\n ;\n if (!repaintRects || haveMotionBLur) {\n doClear(0, 0, width, height);\n }\n else if (repaintRects.length) {\n util.each(repaintRects, function (rect) {\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n });\n }\n };\n return Layer;\n}(Eventful));\nexport default Layer;\n","import { devicePixelRatio } from '../config.js';\nimport * as util from '../core/util.js';\nimport Layer from './Layer.js';\nimport requestAnimationFrame from '../animation/requestAnimationFrame.js';\nimport env from '../core/env.js';\nimport { brush, brushSingle } from './graphic.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { getSize } from './helper.js';\nvar HOVER_LAYER_ZLEVEL = 1e5;\nvar CANVAS_ZLEVEL = 314159;\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\nvar INCREMENTAL_INC = 0.001;\nfunction isLayerValid(layer) {\n if (!layer) {\n return false;\n }\n if (layer.__builtin__) {\n return true;\n }\n if (typeof (layer.resize) !== 'function'\n || typeof (layer.refresh) !== 'function') {\n return false;\n }\n return true;\n}\nfunction createRoot(width, height) {\n var domRoot = document.createElement('div');\n domRoot.style.cssText = [\n 'position:relative',\n 'width:' + width + 'px',\n 'height:' + height + 'px',\n 'padding:0',\n 'margin:0',\n 'border-width:0'\n ].join(';') + ';';\n return domRoot;\n}\nvar CanvasPainter = (function () {\n function CanvasPainter(root, storage, opts, id) {\n this.type = 'canvas';\n this._zlevelList = [];\n this._prevDisplayList = [];\n this._layers = {};\n this._layerConfig = {};\n this._needsManuallyCompositing = false;\n this.type = 'canvas';\n var singleCanvas = !root.nodeName\n || root.nodeName.toUpperCase() === 'CANVAS';\n this._opts = opts = util.extend({}, opts || {});\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\n this._singleCanvas = singleCanvas;\n this.root = root;\n var rootStyle = root.style;\n if (rootStyle) {\n util.disableUserSelect(root);\n root.innerHTML = '';\n }\n this.storage = storage;\n var zlevelList = this._zlevelList;\n this._prevDisplayList = [];\n var layers = this._layers;\n if (!singleCanvas) {\n this._width = getSize(root, 0, opts);\n this._height = getSize(root, 1, opts);\n var domRoot = this._domRoot = createRoot(this._width, this._height);\n root.appendChild(domRoot);\n }\n else {\n var rootCanvas = root;\n var width = rootCanvas.width;\n var height = rootCanvas.height;\n if (opts.width != null) {\n width = opts.width;\n }\n if (opts.height != null) {\n height = opts.height;\n }\n this.dpr = opts.devicePixelRatio || 1;\n rootCanvas.width = width * this.dpr;\n rootCanvas.height = height * this.dpr;\n this._width = width;\n this._height = height;\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\n mainLayer.__builtin__ = true;\n mainLayer.initContext();\n layers[CANVAS_ZLEVEL] = mainLayer;\n mainLayer.zlevel = CANVAS_ZLEVEL;\n zlevelList.push(CANVAS_ZLEVEL);\n this._domRoot = root;\n }\n }\n CanvasPainter.prototype.getType = function () {\n return 'canvas';\n };\n CanvasPainter.prototype.isSingleCanvas = function () {\n return this._singleCanvas;\n };\n CanvasPainter.prototype.getViewportRoot = function () {\n return this._domRoot;\n };\n CanvasPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n CanvasPainter.prototype.refresh = function (paintAll) {\n var list = this.storage.getDisplayList(true);\n var prevList = this._prevDisplayList;\n var zlevelList = this._zlevelList;\n this._redrawId = Math.random();\n this._paintList(list, prevList, paintAll, this._redrawId);\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__ && layer.refresh) {\n var clearColor = i === 0 ? this._backgroundColor : null;\n layer.refresh(clearColor);\n }\n }\n if (this._opts.useDirtyRect) {\n this._prevDisplayList = list.slice();\n }\n return this;\n };\n CanvasPainter.prototype.refreshHover = function () {\n this._paintHoverList(this.storage.getDisplayList(false));\n };\n CanvasPainter.prototype._paintHoverList = function (list) {\n var len = list.length;\n var hoverLayer = this._hoverlayer;\n hoverLayer && hoverLayer.clear();\n if (!len) {\n return;\n }\n var scope = {\n inHover: true,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var ctx;\n for (var i = 0; i < len; i++) {\n var el = list[i];\n if (el.__inHover) {\n if (!hoverLayer) {\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\n }\n if (!ctx) {\n ctx = hoverLayer.ctx;\n ctx.save();\n }\n brush(ctx, el, scope, i === len - 1);\n }\n }\n if (ctx) {\n ctx.restore();\n }\n };\n CanvasPainter.prototype.getHoverLayer = function () {\n return this.getLayer(HOVER_LAYER_ZLEVEL);\n };\n CanvasPainter.prototype.paintOne = function (ctx, el) {\n brushSingle(ctx, el);\n };\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\n if (this._redrawId !== redrawId) {\n return;\n }\n paintAll = paintAll || false;\n this._updateLayerStatus(list);\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\n if (this._needsManuallyCompositing) {\n this._compositeManually();\n }\n if (needsRefreshHover) {\n this._paintHoverList(list);\n }\n if (!finished) {\n var self_1 = this;\n requestAnimationFrame(function () {\n self_1._paintList(list, prevList, paintAll, redrawId);\n });\n }\n else {\n this.eachLayer(function (layer) {\n layer.afterBrush && layer.afterBrush();\n });\n }\n };\n CanvasPainter.prototype._compositeManually = function () {\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\n var width = this._domRoot.width;\n var height = this._domRoot.height;\n ctx.clearRect(0, 0, width, height);\n this.eachBuiltinLayer(function (layer) {\n if (layer.virtual) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n }\n });\n };\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\n var _this = this;\n var layerList = [];\n var useDirtyRect = this._opts.useDirtyRect;\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\n var zlevel = this._zlevelList[zi];\n var layer = this._layers[zlevel];\n if (layer.__builtin__\n && layer !== this._hoverlayer\n && (layer.__dirty || paintAll)) {\n layerList.push(layer);\n }\n }\n var finished = true;\n var needsRefreshHover = false;\n var _loop_1 = function (k) {\n var layer = layerList[k];\n var ctx = layer.ctx;\n var repaintRects = useDirtyRect\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\n var useTimer = !paintAll && layer.incremental && Date.now;\n var startTime = useTimer && Date.now();\n var clearColor = layer.zlevel === this_1._zlevelList[0]\n ? this_1._backgroundColor : null;\n if (layer.__startIndex === layer.__endIndex) {\n layer.clear(false, clearColor, repaintRects);\n }\n else if (start === layer.__startIndex) {\n var firstEl = list[start];\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\n layer.clear(false, clearColor, repaintRects);\n }\n }\n if (start === -1) {\n console.error('For some unknown reason. drawIndex is -1');\n start = layer.__startIndex;\n }\n var i;\n var repaint = function (repaintRect) {\n var scope = {\n inHover: false,\n allClipped: false,\n prevEl: null,\n viewWidth: _this._width,\n viewHeight: _this._height\n };\n for (i = start; i < layer.__endIndex; i++) {\n var el = list[i];\n if (el.__inHover) {\n needsRefreshHover = true;\n }\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\n if (useTimer) {\n var dTime = Date.now() - startTime;\n if (dTime > 15) {\n break;\n }\n }\n }\n if (scope.prevElClipPaths) {\n ctx.restore();\n }\n };\n if (repaintRects) {\n if (repaintRects.length === 0) {\n i = layer.__endIndex;\n }\n else {\n var dpr = this_1.dpr;\n for (var r = 0; r < repaintRects.length; ++r) {\n var rect = repaintRects[r];\n ctx.save();\n ctx.beginPath();\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n ctx.clip();\n repaint(rect);\n ctx.restore();\n }\n }\n }\n else {\n ctx.save();\n repaint();\n ctx.restore();\n }\n layer.__drawIndex = i;\n if (layer.__drawIndex < layer.__endIndex) {\n finished = false;\n }\n };\n var this_1 = this;\n for (var k = 0; k < layerList.length; k++) {\n _loop_1(k);\n }\n if (env.wxa) {\n util.each(this._layers, function (layer) {\n if (layer && layer.ctx && layer.ctx.draw) {\n layer.ctx.draw();\n }\n });\n }\n return {\n finished: finished,\n needsRefreshHover: needsRefreshHover\n };\n };\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\n var ctx = currentLayer.ctx;\n if (useDirtyRect) {\n var paintRect = el.getPaintRect();\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\n brush(ctx, el, scope, isLast);\n el.setPrevPaintRect(paintRect);\n }\n }\n else {\n brush(ctx, el, scope, isLast);\n }\n };\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\n if (this._singleCanvas && !this._needsManuallyCompositing) {\n zlevel = CANVAS_ZLEVEL;\n }\n var layer = this._layers[zlevel];\n if (!layer) {\n layer = new Layer('zr_' + zlevel, this, this.dpr);\n layer.zlevel = zlevel;\n layer.__builtin__ = true;\n if (this._layerConfig[zlevel]) {\n util.merge(layer, this._layerConfig[zlevel], true);\n }\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\n util.merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\n }\n if (virtual) {\n layer.virtual = virtual;\n }\n this.insertLayer(zlevel, layer);\n layer.initContext();\n }\n return layer;\n };\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\n var layersMap = this._layers;\n var zlevelList = this._zlevelList;\n var len = zlevelList.length;\n var domRoot = this._domRoot;\n var prevLayer = null;\n var i = -1;\n if (layersMap[zlevel]) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('ZLevel ' + zlevel + ' has been used already');\n }\n return;\n }\n if (!isLayerValid(layer)) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('Layer of zlevel ' + zlevel + ' is not valid');\n }\n return;\n }\n if (len > 0 && zlevel > zlevelList[0]) {\n for (i = 0; i < len - 1; i++) {\n if (zlevelList[i] < zlevel\n && zlevelList[i + 1] > zlevel) {\n break;\n }\n }\n prevLayer = layersMap[zlevelList[i]];\n }\n zlevelList.splice(i + 1, 0, zlevel);\n layersMap[zlevel] = layer;\n if (!layer.virtual) {\n if (prevLayer) {\n var prevDom = prevLayer.dom;\n if (prevDom.nextSibling) {\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n else {\n if (domRoot.firstChild) {\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n }\n layer.painter || (layer.painter = this);\n };\n CanvasPainter.prototype.eachLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n cb.call(context, this._layers[z], z);\n }\n };\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.getLayers = function () {\n return this._layers;\n };\n CanvasPainter.prototype._updateLayerStatus = function (list) {\n this.eachBuiltinLayer(function (layer, z) {\n layer.__dirty = layer.__used = false;\n });\n function updatePrevLayer(idx) {\n if (prevLayer) {\n if (prevLayer.__endIndex !== idx) {\n prevLayer.__dirty = true;\n }\n prevLayer.__endIndex = idx;\n }\n }\n if (this._singleCanvas) {\n for (var i_1 = 1; i_1 < list.length; i_1++) {\n var el = list[i_1];\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\n this._needsManuallyCompositing = true;\n break;\n }\n }\n }\n var prevLayer = null;\n var incrementalLayerCount = 0;\n var prevZlevel;\n var i;\n for (i = 0; i < list.length; i++) {\n var el = list[i];\n var zlevel = el.zlevel;\n var layer = void 0;\n if (prevZlevel !== zlevel) {\n prevZlevel = zlevel;\n incrementalLayerCount = 0;\n }\n if (el.incremental) {\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\n layer.incremental = true;\n incrementalLayerCount = 1;\n }\n else {\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\n }\n if (!layer.__builtin__) {\n util.logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\n }\n if (layer !== prevLayer) {\n layer.__used = true;\n if (layer.__startIndex !== i) {\n layer.__dirty = true;\n }\n layer.__startIndex = i;\n if (!layer.incremental) {\n layer.__drawIndex = i;\n }\n else {\n layer.__drawIndex = -1;\n }\n updatePrevLayer(i);\n prevLayer = layer;\n }\n if ((el.__dirty & REDRAW_BIT) && !el.__inHover) {\n layer.__dirty = true;\n if (layer.incremental && layer.__drawIndex < 0) {\n layer.__drawIndex = i;\n }\n }\n }\n updatePrevLayer(i);\n this.eachBuiltinLayer(function (layer, z) {\n if (!layer.__used && layer.getElementCount() > 0) {\n layer.__dirty = true;\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\n }\n if (layer.__dirty && layer.__drawIndex < 0) {\n layer.__drawIndex = layer.__startIndex;\n }\n });\n };\n CanvasPainter.prototype.clear = function () {\n this.eachBuiltinLayer(this._clearLayer);\n return this;\n };\n CanvasPainter.prototype._clearLayer = function (layer) {\n layer.clear();\n };\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n util.each(this._layers, function (layer) {\n layer.setUnpainted();\n });\n };\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\n if (config) {\n var layerConfig = this._layerConfig;\n if (!layerConfig[zlevel]) {\n layerConfig[zlevel] = config;\n }\n else {\n util.merge(layerConfig[zlevel], config, true);\n }\n for (var i = 0; i < this._zlevelList.length; i++) {\n var _zlevel = this._zlevelList[i];\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\n var layer = this._layers[_zlevel];\n util.merge(layer, layerConfig[zlevel], true);\n }\n }\n }\n };\n CanvasPainter.prototype.delLayer = function (zlevel) {\n var layers = this._layers;\n var zlevelList = this._zlevelList;\n var layer = layers[zlevel];\n if (!layer) {\n return;\n }\n layer.dom.parentNode.removeChild(layer.dom);\n delete layers[zlevel];\n zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);\n };\n CanvasPainter.prototype.resize = function (width, height) {\n if (!this._domRoot.style) {\n if (width == null || height == null) {\n return;\n }\n this._width = width;\n this._height = height;\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\n }\n else {\n var domRoot = this._domRoot;\n domRoot.style.display = 'none';\n var opts = this._opts;\n var root = this.root;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n domRoot.style.display = '';\n if (this._width !== width || height !== this._height) {\n domRoot.style.width = width + 'px';\n domRoot.style.height = height + 'px';\n for (var id in this._layers) {\n if (this._layers.hasOwnProperty(id)) {\n this._layers[id].resize(width, height);\n }\n }\n this.refresh(true);\n }\n this._width = width;\n this._height = height;\n }\n return this;\n };\n CanvasPainter.prototype.clearLayer = function (zlevel) {\n var layer = this._layers[zlevel];\n if (layer) {\n layer.clear();\n }\n };\n CanvasPainter.prototype.dispose = function () {\n this.root.innerHTML = '';\n this.root =\n this.storage =\n this._domRoot =\n this._layers = null;\n };\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\n opts = opts || {};\n if (this._singleCanvas && !this._compositeManually) {\n return this._layers[CANVAS_ZLEVEL].dom;\n }\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\n imageLayer.initContext();\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\n var ctx = imageLayer.ctx;\n if (opts.pixelRatio <= this.dpr) {\n this.refresh();\n var width_1 = imageLayer.dom.width;\n var height_1 = imageLayer.dom.height;\n this.eachLayer(function (layer) {\n if (layer.__builtin__) {\n ctx.drawImage(layer.dom, 0, 0, width_1, height_1);\n }\n else if (layer.renderToCanvas) {\n ctx.save();\n layer.renderToCanvas(ctx);\n ctx.restore();\n }\n });\n }\n else {\n var scope = {\n inHover: false,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var displayList = this.storage.getDisplayList(true);\n for (var i = 0, len = displayList.length; i < len; i++) {\n var el = displayList[i];\n brush(ctx, el, scope, i === len - 1);\n }\n }\n return imageLayer.dom;\n };\n CanvasPainter.prototype.getWidth = function () {\n return this._width;\n };\n CanvasPainter.prototype.getHeight = function () {\n return this._height;\n };\n return CanvasPainter;\n}());\nexport default CanvasPainter;\n;\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CanvasPainter from 'zrender/lib/canvas/Painter.js';\nexport function install(registers) {\n registers.registerPainter('canvas', CanvasPainter);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\nvar LineSeriesModel = /** @class */function (_super) {\n __extends(LineSeriesModel, _super);\n function LineSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = LineSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n LineSeriesModel.prototype.getInitialData = function (option) {\n if (process.env.NODE_ENV !== 'production') {\n var coordSys = option.coordinateSystem;\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\n }\n }\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n LineSeriesModel.prototype.getLegendIcon = function (opt) {\n var group = new Group();\n var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false);\n group.add(line);\n line.setStyle(opt.lineStyle);\n var visualType = this.getData().getVisual('symbol');\n var visualRotate = this.getData().getVisual('symbolRotate');\n var symbolType = visualType === 'none' ? 'circle' : visualType;\n // Symbol size is 80% when there is a line\n var size = opt.itemHeight * 0.8;\n var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill);\n group.add(symbol);\n symbol.setStyle(opt.itemStyle);\n var symbolRotate = opt.iconRotate === 'inherit' ? visualRotate : opt.iconRotate || 0;\n symbol.rotation = symbolRotate * Math.PI / 180;\n symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n if (symbolType.indexOf('empty') > -1) {\n symbol.style.stroke = symbol.style.fill;\n symbol.style.fill = '#fff';\n symbol.style.lineWidth = 2;\n }\n return group;\n };\n LineSeriesModel.type = 'series.line';\n LineSeriesModel.dependencies = ['grid', 'polar'];\n LineSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 3,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n clip: true,\n label: {\n position: 'top'\n },\n // itemStyle: {\n // },\n endLabel: {\n show: false,\n valueAnimation: true,\n distance: 8\n },\n lineStyle: {\n width: 2,\n type: 'solid'\n },\n emphasis: {\n scale: true\n },\n // areaStyle: {\n // origin of areaStyle. Valid values:\n // `'auto'/null/undefined`: from axisLine to data\n // `'start'`: from min to data\n // `'end'`: from data to max\n // origin: 'auto'\n // },\n // false, 'start', 'end', 'middle'\n step: false,\n // Disabled if step is true\n smooth: false,\n smoothMonotone: null,\n symbol: 'emptyCircle',\n symbolSize: 4,\n symbolRotate: null,\n showSymbol: true,\n // `false`: follow the label interval strategy.\n // `true`: show all symbols.\n // `'auto'`: If possible, show all symbols, otherwise\n // follow the label interval strategy.\n showAllSymbol: 'auto',\n // Whether to connect break point.\n connectNulls: false,\n // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.\n sampling: 'none',\n animationEasing: 'linear',\n // Disable progressive\n progressive: 0,\n hoverLayerThreshold: Infinity,\n universalTransition: {\n divideShape: 'clone'\n },\n triggerLineEvent: false\n };\n return LineSeriesModel;\n}(SeriesModel);\nexport default LineSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isArray } from 'zrender/lib/core/util.js';\n/**\n * @return label string. Not null/undefined\n */\nexport function getDefaultLabel(data, dataIndex) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n var len = labelDims.length;\n // Simple optimization (in lots of cases, label dims length is 1)\n if (len === 1) {\n var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);\n return rawVal != null ? rawVal + '' : null;\n } else if (len) {\n var vals = [];\n for (var i = 0; i < labelDims.length; i++) {\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\n }\n return vals.join(' ');\n }\n}\nexport function getDefaultInterpolatedLabel(data, interpolatedValue) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n if (!isArray(interpolatedValue)) {\n return interpolatedValue + '';\n }\n var vals = [];\n for (var i = 0; i < labelDims.length; i++) {\n var dimIndex = data.getDimensionIndex(labelDims[i]);\n if (dimIndex >= 0) {\n vals.push(interpolatedValue[dimIndex]);\n }\n }\n return vals.join(' ');\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport { getDefaultLabel } from './labelHelper.js';\nimport { extend } from 'zrender/lib/core/util.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar Symbol = /** @class */function (_super) {\n __extends(Symbol, _super);\n function Symbol(data, idx, seriesScope, opts) {\n var _this = _super.call(this) || this;\n _this.updateData(data, idx, seriesScope, opts);\n return _this;\n }\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\n // Remove paths created before\n this.removeAll();\n // let symbolPath = createSymbol(\n // symbolType, -0.5, -0.5, 1, 1, color\n // );\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4150.\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\n symbolPath.attr({\n z2: 100,\n culling: true,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n });\n // Rewrite drift method\n symbolPath.drift = driftSymbol;\n this._symbolType = symbolType;\n this.add(symbolPath);\n };\n /**\n * Stop animation\n * @param {boolean} toLastFrame\n */\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\n this.childAt(0).stopAnimation(null, toLastFrame);\n };\n Symbol.prototype.getSymbolType = function () {\n return this._symbolType;\n };\n /**\n * FIXME:\n * Caution: This method breaks the encapsulation of this module,\n * but it indeed brings convenience. So do not use the method\n * unless you detailedly know all the implements of `Symbol`,\n * especially animation.\n *\n * Get symbol path element.\n */\n Symbol.prototype.getSymbolPath = function () {\n return this.childAt(0);\n };\n /**\n * Highlight symbol\n */\n Symbol.prototype.highlight = function () {\n enterEmphasis(this.childAt(0));\n };\n /**\n * Downplay symbol\n */\n Symbol.prototype.downplay = function () {\n leaveEmphasis(this.childAt(0));\n };\n /**\n * @param {number} zlevel\n * @param {number} z\n */\n Symbol.prototype.setZ = function (zlevel, z) {\n var symbolPath = this.childAt(0);\n symbolPath.zlevel = zlevel;\n symbolPath.z = z;\n };\n Symbol.prototype.setDraggable = function (draggable, hasCursorOption) {\n var symbolPath = this.childAt(0);\n symbolPath.draggable = draggable;\n symbolPath.cursor = !hasCursorOption && draggable ? 'move' : symbolPath.cursor;\n };\n /**\n * Update symbol properties\n */\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\n this.silent = false;\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n var seriesModel = data.hostModel;\n var symbolSize = Symbol.getSymbolSize(data, idx);\n var isInit = symbolType !== this._symbolType;\n var disableAnimation = opts && opts.disableAnimation;\n if (isInit) {\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\n } else {\n var symbolPath = this.childAt(0);\n symbolPath.silent = false;\n var target = {\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n };\n disableAnimation ? symbolPath.attr(target) : graphic.updateProps(symbolPath, target, seriesModel, idx);\n saveOldStyle(symbolPath);\n }\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\n if (isInit) {\n var symbolPath = this.childAt(0);\n if (!disableAnimation) {\n var target = {\n scaleX: this._sizeX,\n scaleY: this._sizeY,\n style: {\n // Always fadeIn. Because it has fadeOut animation when symbol is removed..\n opacity: symbolPath.style.opacity\n }\n };\n symbolPath.scaleX = symbolPath.scaleY = 0;\n symbolPath.style.opacity = 0;\n graphic.initProps(symbolPath, target, seriesModel, idx);\n }\n }\n if (disableAnimation) {\n // Must stop leave transition manually if don't call initProps or updateProps.\n this.childAt(0).stopAnimation('leave');\n }\n };\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\n var symbolPath = this.childAt(0);\n var seriesModel = data.hostModel;\n var emphasisItemStyle;\n var blurItemStyle;\n var selectItemStyle;\n var focus;\n var blurScope;\n var emphasisDisabled;\n var labelStatesModels;\n var hoverScale;\n var cursorStyle;\n if (seriesScope) {\n emphasisItemStyle = seriesScope.emphasisItemStyle;\n blurItemStyle = seriesScope.blurItemStyle;\n selectItemStyle = seriesScope.selectItemStyle;\n focus = seriesScope.focus;\n blurScope = seriesScope.blurScope;\n labelStatesModels = seriesScope.labelStatesModels;\n hoverScale = seriesScope.hoverScale;\n cursorStyle = seriesScope.cursorStyle;\n emphasisDisabled = seriesScope.emphasisDisabled;\n }\n if (!seriesScope || data.hasItemOption) {\n var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n emphasisDisabled = emphasisModel.get('disabled');\n labelStatesModels = getLabelStatesModels(itemModel);\n hoverScale = emphasisModel.getShallow('scale');\n cursorStyle = itemModel.getShallow('cursor');\n }\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\n var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n if (symbolOffset) {\n symbolPath.x = symbolOffset[0];\n symbolPath.y = symbolOffset[1];\n }\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n if (symbolPath.__isEmptyBrush) {\n // fill and stroke will be swapped if it's empty.\n // So we cloned a new style to avoid it affecting the original style in visual storage.\n // TODO Better implementation. No empty logic!\n symbolPath.useStyle(extend({}, symbolStyle));\n } else {\n symbolPath.useStyle(symbolStyle);\n }\n // Disable decal because symbol scale will been applied on the decal.\n symbolPath.style.decal = null;\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\n symbolPath.style.strokeNoScale = true;\n }\n var liftZ = data.getItemVisual(idx, 'liftZ');\n var z2Origin = this._z2;\n if (liftZ != null) {\n if (z2Origin == null) {\n this._z2 = symbolPath.z2;\n symbolPath.z2 += liftZ;\n }\n } else if (z2Origin != null) {\n symbolPath.z2 = z2Origin;\n this._z2 = null;\n }\n var useNameLabel = opts && opts.useNameLabel;\n setLabelStyle(symbolPath, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultText: getLabelDefaultText,\n inheritColor: visualColor,\n defaultOpacity: symbolStyle.opacity\n });\n // Do not execute util needed.\n function getLabelDefaultText(idx) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }\n this._sizeX = symbolSize[0] / 2;\n this._sizeY = symbolSize[1] / 2;\n var emphasisState = symbolPath.ensureState('emphasis');\n emphasisState.style = emphasisItemStyle;\n symbolPath.ensureState('select').style = selectItemStyle;\n symbolPath.ensureState('blur').style = blurItemStyle;\n // null / undefined / true means to use default strategy.\n // 0 / false / negative number / NaN / Infinity means no scale.\n var scaleRatio = hoverScale == null || hoverScale === true ? Math.max(1.1, 3 / this._sizeY)\n // PENDING: restrict hoverScale > 1? It seems unreasonable to scale down\n : isFinite(hoverScale) && hoverScale > 0 ? +hoverScale : 1;\n // always set scale to allow resetting\n emphasisState.scaleX = this._sizeX * scaleRatio;\n emphasisState.scaleY = this._sizeY * scaleRatio;\n this.setSymbolScale(1);\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n Symbol.prototype.setSymbolScale = function (scale) {\n this.scaleX = this.scaleY = scale;\n };\n Symbol.prototype.fadeOut = function (cb, seriesModel, opt) {\n var symbolPath = this.childAt(0);\n var dataIndex = getECData(this).dataIndex;\n var animationOpt = opt && opt.animation;\n // Avoid mistaken hover when fading out\n this.silent = symbolPath.silent = true;\n // Not show text when animating\n if (opt && opt.fadeLabel) {\n var textContent = symbolPath.getTextContent();\n if (textContent) {\n graphic.removeElement(textContent, {\n style: {\n opacity: 0\n }\n }, seriesModel, {\n dataIndex: dataIndex,\n removeOpt: animationOpt,\n cb: function () {\n symbolPath.removeTextContent();\n }\n });\n }\n } else {\n symbolPath.removeTextContent();\n }\n graphic.removeElement(symbolPath, {\n style: {\n opacity: 0\n },\n scaleX: 0,\n scaleY: 0\n }, seriesModel, {\n dataIndex: dataIndex,\n cb: cb,\n removeOpt: animationOpt\n });\n };\n Symbol.getSymbolSize = function (data, idx) {\n return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n };\n return Symbol;\n}(graphic.Group);\nfunction driftSymbol(dx, dy) {\n this.parent.drift(dx, dy);\n}\nexport default Symbol;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport SymbolClz from './Symbol.js';\nimport { isObject } from 'zrender/lib/core/util.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\nfunction symbolNeedsDraw(data, point, idx, opt) {\n return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx))\n // We do not set clipShape on group, because it will cut part of\n // the symbol element shape. We use the same clip shape here as\n // the line clip.\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none';\n}\nfunction normalizeUpdateOpt(opt) {\n if (opt != null && !isObject(opt)) {\n opt = {\n isIgnore: opt\n };\n }\n return opt || {};\n}\nfunction makeSeriesScope(data) {\n var seriesModel = data.hostModel;\n var emphasisModel = seriesModel.getModel('emphasis');\n return {\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\n focus: emphasisModel.get('focus'),\n blurScope: emphasisModel.get('blurScope'),\n emphasisDisabled: emphasisModel.get('disabled'),\n hoverScale: emphasisModel.get('scale'),\n labelStatesModels: getLabelStatesModels(seriesModel),\n cursorStyle: seriesModel.get('cursor')\n };\n}\nvar SymbolDraw = /** @class */function () {\n function SymbolDraw(SymbolCtor) {\n this.group = new graphic.Group();\n this._SymbolCtor = SymbolCtor || SymbolClz;\n }\n /**\n * Update symbols draw by new data\n */\n SymbolDraw.prototype.updateData = function (data, opt) {\n // Remove progressive els.\n this._progressiveEls = null;\n opt = normalizeUpdateOpt(opt);\n var group = this.group;\n var seriesModel = data.hostModel;\n var oldData = this._data;\n var SymbolCtor = this._SymbolCtor;\n var disableAnimation = opt.disableAnimation;\n var seriesScope = makeSeriesScope(data);\n var symbolUpdateOpt = {\n disableAnimation: disableAnimation\n };\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\n return data.getItemLayout(idx);\n };\n // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n if (!oldData) {\n group.removeAll();\n }\n data.diff(oldData).add(function (newIdx) {\n var point = getSymbolPoint(newIdx);\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n symbolEl.setPosition(point);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n var point = getSymbolPoint(newIdx);\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\n group.remove(symbolEl);\n return;\n }\n var newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle';\n var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType();\n if (!symbolEl\n // Create a new if symbol type changed.\n || oldSymbolType && oldSymbolType !== newSymbolType) {\n group.remove(symbolEl);\n symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n symbolEl.setPosition(point);\n } else {\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\n var target = {\n x: point[0],\n y: point[1]\n };\n disableAnimation ? symbolEl.attr(target) : graphic.updateProps(symbolEl, target, seriesModel);\n }\n // Add back\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && el.fadeOut(function () {\n group.remove(el);\n }, seriesModel);\n }).execute();\n this._getSymbolPoint = getSymbolPoint;\n this._data = data;\n };\n ;\n SymbolDraw.prototype.updateLayout = function () {\n var _this = this;\n var data = this._data;\n if (data) {\n // Not use animation\n data.eachItemGraphicEl(function (el, idx) {\n var point = _this._getSymbolPoint(idx);\n el.setPosition(point);\n el.markRedraw();\n });\n }\n };\n ;\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this._seriesScope = makeSeriesScope(data);\n this._data = null;\n this.group.removeAll();\n };\n ;\n /**\n * Update symbols draw by new data\n */\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n // Clear\n this._progressiveEls = [];\n opt = normalizeUpdateOpt(opt);\n function updateIncrementalAndHover(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var point = data.getItemLayout(idx);\n if (symbolNeedsDraw(data, point, idx, opt)) {\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n el.setPosition(point);\n this.group.add(el);\n data.setItemGraphicEl(idx, el);\n this._progressiveEls.push(el);\n }\n }\n };\n ;\n SymbolDraw.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n SymbolDraw.prototype.remove = function (enableAnimation) {\n var group = this.group;\n var data = this._data;\n // Incremental model do not have this._data.\n if (data && enableAnimation) {\n data.eachItemGraphicEl(function (el) {\n el.fadeOut(function () {\n group.remove(el);\n }, data.hostModel);\n });\n } else {\n group.removeAll();\n }\n };\n ;\n return SymbolDraw;\n}();\nexport default SymbolDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { isNumber, map } from 'zrender/lib/core/util.js';\nexport function prepareDataCoordInfo(coordSys, data, valueOrigin) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueStart = getValueStart(valueAxis, valueOrigin);\n var baseAxisDim = baseAxis.dim;\n var valueAxisDim = valueAxis.dim;\n var valueDim = data.mapDimension(valueAxisDim);\n var baseDim = data.mapDimension(baseAxisDim);\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var dims = map(coordSys.dimensions, function (coordDim) {\n return data.mapDimension(coordDim);\n });\n var stacked = false;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n if (isDimensionStacked(data, dims[0] /* , dims[1] */)) {\n // jshint ignore:line\n stacked = true;\n dims[0] = stackResultDim;\n }\n if (isDimensionStacked(data, dims[1] /* , dims[0] */)) {\n // jshint ignore:line\n stacked = true;\n dims[1] = stackResultDim;\n }\n return {\n dataDimsForPoint: dims,\n valueStart: valueStart,\n valueAxisDim: valueAxisDim,\n baseAxisDim: baseAxisDim,\n stacked: !!stacked,\n valueDim: valueDim,\n baseDim: baseDim,\n baseDataOffset: baseDataOffset,\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\n };\n}\nfunction getValueStart(valueAxis, valueOrigin) {\n var valueStart = 0;\n var extent = valueAxis.scale.getExtent();\n if (valueOrigin === 'start') {\n valueStart = extent[0];\n } else if (valueOrigin === 'end') {\n valueStart = extent[1];\n }\n // If origin is specified as a number, use it as\n // valueStart directly\n else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) {\n valueStart = valueOrigin;\n }\n // auto\n else {\n // Both positive\n if (extent[0] > 0) {\n valueStart = extent[0];\n }\n // Both negative\n else if (extent[1] < 0) {\n valueStart = extent[1];\n }\n // If is one positive, and one negative, onZero shall be true\n }\n\n return valueStart;\n}\nexport function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\n var value = NaN;\n if (dataCoordInfo.stacked) {\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\n }\n if (isNaN(value)) {\n value = dataCoordInfo.valueStart;\n }\n var baseDataOffset = dataCoordInfo.baseDataOffset;\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\n stackedData[1 - baseDataOffset] = value;\n return coordSys.dataToPoint(stackedData);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nfunction diffData(oldData, newData) {\n var diffResult = [];\n newData.diff(oldData).add(function (idx) {\n diffResult.push({\n cmd: '+',\n idx: idx\n });\n }).update(function (newIdx, oldIdx) {\n diffResult.push({\n cmd: '=',\n idx: oldIdx,\n idx1: newIdx\n });\n }).remove(function (idx) {\n diffResult.push({\n cmd: '-',\n idx: idx\n });\n }).execute();\n return diffResult;\n}\nexport default function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\n var diff = diffData(oldData, newData);\n // let newIdList = newData.mapArray(newData.getId);\n // let oldIdList = oldData.mapArray(oldData.getId);\n // convertToIntId(newIdList, oldIdList);\n // // FIXME One data ?\n // diff = arrayDiff(oldIdList, newIdList);\n var currPoints = [];\n var nextPoints = [];\n // Points for stacking base line\n var currStackedPoints = [];\n var nextStackedPoints = [];\n var status = [];\n var sortedIndices = [];\n var rawIndices = [];\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\n // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\n var oldPoints = oldData.getLayout('points') || [];\n var newPoints = newData.getLayout('points') || [];\n for (var i = 0; i < diff.length; i++) {\n var diffItem = diff[i];\n var pointAdded = true;\n var oldIdx2 = void 0;\n var newIdx2 = void 0;\n // FIXME, animation is not so perfect when dataZoom window moves fast\n // Which is in case remvoing or add more than one data in the tail or head\n switch (diffItem.cmd) {\n case '=':\n oldIdx2 = diffItem.idx * 2;\n newIdx2 = diffItem.idx1 * 2;\n var currentX = oldPoints[oldIdx2];\n var currentY = oldPoints[oldIdx2 + 1];\n var nextX = newPoints[newIdx2];\n var nextY = newPoints[newIdx2 + 1];\n // If previous data is NaN, use next point directly\n if (isNaN(currentX) || isNaN(currentY)) {\n currentX = nextX;\n currentY = nextY;\n }\n currPoints.push(currentX, currentY);\n nextPoints.push(nextX, nextY);\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\n break;\n case '+':\n var newIdx = diffItem.idx;\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\n var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]);\n newIdx2 = newIdx * 2;\n currPoints.push(oldPt[0], oldPt[1]);\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(newIdx));\n break;\n case '-':\n pointAdded = false;\n }\n // Original indices\n if (pointAdded) {\n status.push(diffItem);\n sortedIndices.push(sortedIndices.length);\n }\n }\n // Diff result may be crossed if all items are changed\n // Sort by data index\n sortedIndices.sort(function (a, b) {\n return rawIndices[a] - rawIndices[b];\n });\n var len = currPoints.length;\n var sortedCurrPoints = createFloat32Array(len);\n var sortedNextPoints = createFloat32Array(len);\n var sortedCurrStackedPoints = createFloat32Array(len);\n var sortedNextStackedPoints = createFloat32Array(len);\n var sortedStatus = [];\n for (var i = 0; i < sortedIndices.length; i++) {\n var idx = sortedIndices[i];\n var i2 = i * 2;\n var idx2 = idx * 2;\n sortedCurrPoints[i2] = currPoints[idx2];\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\n sortedNextPoints[i2] = nextPoints[idx2];\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\n sortedStatus[i] = status[idx];\n }\n return {\n current: sortedCurrPoints,\n next: sortedNextPoints,\n stackedOnCurrent: sortedCurrStackedPoints,\n stackedOnNext: sortedNextStackedPoints,\n status: sortedStatus\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// Poly path support NaN point\nimport Path from 'zrender/lib/graphic/Path.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { cubicRootAt, cubicAt } from 'zrender/lib/core/curve.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\n/**\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\n * situations. This should be used when points are non-monotone neither in x or\n * y dimension.\n */\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n var prevX;\n var prevY;\n var cpx0;\n var cpy0;\n var cpx1;\n var cpy1;\n var idx = start;\n var k = 0;\n for (; k < segLen; k++) {\n var x = points[idx * 2];\n var y = points[idx * 2 + 1];\n if (idx >= allLen || idx < 0) {\n break;\n }\n if (isPointNull(x, y)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n break;\n }\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n cpx0 = x;\n cpy0 = y;\n } else {\n var dx = x - prevX;\n var dy = y - prevY;\n // Ignore tiny segment.\n if (dx * dx + dy * dy < 0.5) {\n idx += dir;\n continue;\n }\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextX = points[nextIdx * 2];\n var nextY = points[nextIdx * 2 + 1];\n // Ignore duplicate point\n while (nextX === x && nextY === y && k < segLen) {\n k++;\n nextIdx += dir;\n idx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n x = points[idx * 2];\n y = points[idx * 2 + 1];\n dx = x - prevX;\n dy = y - prevY;\n }\n var tmpK = k + 1;\n if (connectNulls) {\n // Find next point not null\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\n tmpK++;\n nextIdx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n }\n }\n var ratioNextSeg = 0.5;\n var vx = 0;\n var vy = 0;\n var nextCpx0 = void 0;\n var nextCpy0 = void 0;\n // Is last point\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n cpx1 = x;\n cpy1 = y;\n } else {\n vx = nextX - prevX;\n vy = nextY - prevY;\n var dx0 = x - prevX;\n var dx1 = nextX - x;\n var dy0 = y - prevY;\n var dy1 = nextY - y;\n var lenPrevSeg = void 0;\n var lenNextSeg = void 0;\n if (smoothMonotone === 'x') {\n lenPrevSeg = Math.abs(dx0);\n lenNextSeg = Math.abs(dx1);\n var dir_1 = vx > 0 ? 1 : -1;\n cpx1 = x - dir_1 * lenPrevSeg * smooth;\n cpy1 = y;\n nextCpx0 = x + dir_1 * lenNextSeg * smooth;\n nextCpy0 = y;\n } else if (smoothMonotone === 'y') {\n lenPrevSeg = Math.abs(dy0);\n lenNextSeg = Math.abs(dy1);\n var dir_2 = vy > 0 ? 1 : -1;\n cpx1 = x;\n cpy1 = y - dir_2 * lenPrevSeg * smooth;\n nextCpx0 = x;\n nextCpy0 = y + dir_2 * lenNextSeg * smooth;\n } else {\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n // Use ratio of seg length\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\n // cp0 of next segment\n nextCpx0 = x + vx * smooth * ratioNextSeg;\n nextCpy0 = y + vy * smooth * ratioNextSeg;\n // Smooth constraint between point and next point.\n // Avoid exceeding extreme after smoothing.\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y));\n // Reclaculate cp1 based on the adjusted cp0 of next seg.\n vx = nextCpx0 - x;\n vy = nextCpy0 - y;\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\n // Smooth constraint between point and prev point.\n // Avoid exceeding extreme after smoothing.\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\n cpy1 = mathMax(cpy1, mathMin(prevY, y));\n // Adjust next cp0 again.\n vx = x - cpx1;\n vy = y - cpy1;\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n }\n }\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n cpx0 = nextCpx0;\n cpy0 = nextCpy0;\n } else {\n ctx.lineTo(x, y);\n }\n }\n prevX = x;\n prevY = y;\n idx += dir;\n }\n return k;\n}\nvar ECPolylineShape = /** @class */function () {\n function ECPolylineShape() {\n this.smooth = 0;\n this.smoothConstraint = true;\n }\n return ECPolylineShape;\n}();\nvar ECPolyline = /** @class */function (_super) {\n __extends(ECPolyline, _super);\n function ECPolyline(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'ec-polyline';\n return _this;\n }\n ECPolyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n ECPolyline.prototype.getDefaultShape = function () {\n return new ECPolylineShape();\n };\n ECPolyline.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var i = 0;\n var len = points.length / 2;\n // const result = getBoundingBox(points, shape.smoothConstraint);\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n while (i < len) {\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\n }\n };\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\n if (!this.path) {\n this.createPathProxy();\n this.buildPath(this.path, this.shape);\n }\n var path = this.path;\n var data = path.data;\n var CMD = PathProxy.CMD;\n var x0;\n var y0;\n var isDimX = dim === 'x';\n var roots = [];\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n var x = void 0;\n var y = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var x3 = void 0;\n var y3 = void 0;\n var t = void 0;\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n break;\n case CMD.L:\n x = data[i++];\n y = data[i++];\n t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0);\n if (t <= 1 && t >= 0) {\n var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0;\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n x0 = x;\n y0 = y;\n break;\n case CMD.C:\n x = data[i++];\n y = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n x3 = data[i++];\n y3 = data[i++];\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots);\n if (nRoot > 0) {\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\n var t_1 = roots[i_1];\n if (t_1 <= 1 && t_1 >= 0) {\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1);\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n }\n }\n x0 = x3;\n y0 = y3;\n break;\n }\n }\n };\n return ECPolyline;\n}(Path);\nexport { ECPolyline };\nvar ECPolygonShape = /** @class */function (_super) {\n __extends(ECPolygonShape, _super);\n function ECPolygonShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return ECPolygonShape;\n}(ECPolylineShape);\nvar ECPolygon = /** @class */function (_super) {\n __extends(ECPolygon, _super);\n function ECPolygon(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'ec-polygon';\n return _this;\n }\n ECPolygon.prototype.getDefaultShape = function () {\n return new ECPolygonShape();\n };\n ECPolygon.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var stackedOnPoints = shape.stackedOnPoints;\n var i = 0;\n var len = points.length / 2;\n var smoothMonotone = shape.smoothMonotone;\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n while (i < len) {\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\n i += k + 1;\n ctx.closePath();\n }\n };\n return ECPolygon;\n}(Path);\nexport { ECPolygon };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { round } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\n var rect = cartesian.getArea();\n var x = rect.x;\n var y = rect.y;\n var width = rect.width;\n var height = rect.height;\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;\n // Expand the clip path a bit to avoid the border is clipped and looks thinner\n x -= lineWidth / 2;\n y -= lineWidth / 2;\n width += lineWidth;\n height += lineWidth;\n // fix: https://github.com/apache/incubator-echarts/issues/11369\n width = Math.ceil(width);\n if (x !== Math.floor(x)) {\n x = Math.floor(x);\n // if no extra 1px on `width`, it will still be clipped since `x` is floored\n width++;\n }\n var clipPath = new graphic.Rect({\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n });\n if (hasAnimation) {\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isAxisInversed = baseAxis.inverse;\n if (isHorizontal) {\n if (isAxisInversed) {\n clipPath.shape.x += width;\n }\n clipPath.shape.width = 0;\n } else {\n if (!isAxisInversed) {\n clipPath.shape.y += height;\n }\n clipPath.shape.height = 0;\n }\n var duringCb = isFunction(during) ? function (percent) {\n during(percent, clipPath);\n } : null;\n graphic.initProps(clipPath, {\n shape: {\n width: width,\n height: height,\n x: x,\n y: y\n }\n }, seriesModel, null, done, duringCb);\n }\n return clipPath;\n}\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\n var sectorArea = polar.getArea();\n // Avoid float number rounding error for symbol on the edge of axis extent.\n var r0 = round(sectorArea.r0, 1);\n var r = round(sectorArea.r, 1);\n var clipPath = new graphic.Sector({\n shape: {\n cx: round(polar.cx, 1),\n cy: round(polar.cy, 1),\n r0: r0,\n r: r,\n startAngle: sectorArea.startAngle,\n endAngle: sectorArea.endAngle,\n clockwise: sectorArea.clockwise\n }\n });\n if (hasAnimation) {\n var isRadial = polar.getBaseAxis().dim === 'angle';\n if (isRadial) {\n clipPath.shape.endAngle = sectorArea.startAngle;\n } else {\n clipPath.shape.r = r0;\n }\n graphic.initProps(clipPath, {\n shape: {\n endAngle: sectorArea.endAngle,\n r: r\n }\n }, seriesModel);\n }\n return clipPath;\n}\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\n if (!coordSys) {\n return null;\n } else if (coordSys.type === 'polar') {\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n } else if (coordSys.type === 'cartesian2d') {\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\n }\n return null;\n}\nexport { createGridClipPath, createPolarClipPath, createClipPath };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function isCoordinateSystemType(coordSys, type) {\n return coordSys.type === type;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// FIXME step not support polar\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport lineAnimationDiff from './lineAnimationDiff.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as modelUtil from '../../util/model.js';\nimport { ECPolyline, ECPolygon } from './poly.js';\nimport ChartView from '../../view/Chart.js';\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createGridClipPath, createPolarClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setStatesStylesFromModel, setStatesFlag, toggleHoverEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, labelInner } from '../../label/labelStyle.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nimport { convertToColorString } from '../../util/format.js';\nimport { lerp } from 'zrender/lib/tool/color.js';\nfunction isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n for (var i = 0; i < points1.length; i++) {\n if (points1[i] !== points2[i]) {\n return;\n }\n }\n return true;\n}\nfunction bboxFromPoints(points) {\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n if (!isNaN(x)) {\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n }\n if (!isNaN(y)) {\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n }\n return [[minX, minY], [maxX, maxY]];\n}\nfunction getBoundingDiff(points1, points2) {\n var _a = bboxFromPoints(points1),\n min1 = _a[0],\n max1 = _a[1];\n var _b = bboxFromPoints(points2),\n min2 = _b[0],\n max2 = _b[1];\n // Get a max value from each corner of two boundings.\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\n}\nfunction getSmooth(smooth) {\n return zrUtil.isNumber(smooth) ? smooth : smooth ? 0.5 : 0;\n}\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\n if (!dataCoordInfo.valueDim) {\n return [];\n }\n var len = data.count();\n var points = createFloat32Array(len * 2);\n for (var idx = 0; idx < len; idx++) {\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\n points[idx * 2] = pt[0];\n points[idx * 2 + 1] = pt[1];\n }\n return points;\n}\nfunction turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) {\n var baseAxis = coordSys.getBaseAxis();\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\n var stepPoints = [];\n var i = 0;\n var stepPt = [];\n var pt = [];\n var nextPt = [];\n var filteredPoints = [];\n if (connectNulls) {\n for (i = 0; i < points.length; i += 2) {\n if (!isNaN(points[i]) && !isNaN(points[i + 1])) {\n filteredPoints.push(points[i], points[i + 1]);\n }\n }\n points = filteredPoints;\n }\n for (i = 0; i < points.length - 2; i += 2) {\n nextPt[0] = points[i + 2];\n nextPt[1] = points[i + 3];\n pt[0] = points[i];\n pt[1] = points[i + 1];\n stepPoints.push(pt[0], pt[1]);\n switch (stepTurnAt) {\n case 'end':\n stepPt[baseIndex] = nextPt[baseIndex];\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n break;\n case 'middle':\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\n var stepPt2 = [];\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n stepPoints.push(stepPt2[0], stepPt2[1]);\n break;\n default:\n // default is start\n stepPt[baseIndex] = pt[baseIndex];\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n }\n }\n // Last points\n stepPoints.push(points[i++], points[i++]);\n return stepPoints;\n}\n/**\n * Clip color stops to edge. Avoid creating too large gradients.\n * Which may lead to blurry when GPU acceleration is enabled. See #15680\n *\n * The stops has been sorted from small to large.\n */\nfunction clipColorStops(colorStops, maxSize) {\n var newColorStops = [];\n var len = colorStops.length;\n // coord will always < 0 in prevOutOfRangeColorStop.\n var prevOutOfRangeColorStop;\n var prevInRangeColorStop;\n function lerpStop(stop0, stop1, clippedCoord) {\n var coord0 = stop0.coord;\n var p = (clippedCoord - coord0) / (stop1.coord - coord0);\n var color = lerp(p, [stop0.color, stop1.color]);\n return {\n coord: clippedCoord,\n color: color\n };\n }\n for (var i = 0; i < len; i++) {\n var stop_1 = colorStops[i];\n var coord = stop_1.coord;\n if (coord < 0) {\n prevOutOfRangeColorStop = stop_1;\n } else if (coord > maxSize) {\n if (prevInRangeColorStop) {\n newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize));\n } else if (prevOutOfRangeColorStop) {\n // If there are two stops and coord range is between these two stops\n newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize));\n }\n // All following stop will be out of range. So just ignore them.\n break;\n } else {\n if (prevOutOfRangeColorStop) {\n newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0));\n // Reset\n prevOutOfRangeColorStop = null;\n }\n newColorStops.push(stop_1);\n prevInRangeColorStop = stop_1;\n }\n }\n return newColorStops;\n}\nfunction getVisualGradient(data, coordSys, api) {\n var visualMetaList = data.getVisual('visualMeta');\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\n // When data.count() is 0, gradient range can not be calculated.\n return;\n }\n if (coordSys.type !== 'cartesian2d') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style is only supported on cartesian2d.');\n }\n return;\n }\n var coordDim;\n var visualMeta;\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\n var dimInfo = data.getDimensionInfo(visualMetaList[i].dimension);\n coordDim = dimInfo && dimInfo.coordDim;\n // Can only be x or y\n if (coordDim === 'x' || coordDim === 'y') {\n visualMeta = visualMetaList[i];\n break;\n }\n }\n if (!visualMeta) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style only support x or y dimension.');\n }\n return;\n }\n // If the area to be rendered is bigger than area defined by LinearGradient,\n // the canvas spec prescribes that the color of the first stop and the last\n // stop should be used. But if two stops are added at offset 0, in effect\n // browsers use the color of the second stop to render area outside\n // LinearGradient. So we can only infinitesimally extend area defined in\n // LinearGradient to render `outerColors`.\n var axis = coordSys.getAxis(coordDim);\n // dataToCoord mapping may not be linear, but must be monotonic.\n var colorStops = zrUtil.map(visualMeta.stops, function (stop) {\n // offset will be calculated later.\n return {\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\n color: stop.color\n };\n });\n var stopLen = colorStops.length;\n var outerColors = visualMeta.outerColors.slice();\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\n colorStops.reverse();\n outerColors.reverse();\n }\n var colorStopsInRange = clipColorStops(colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight());\n var inRangeStopLen = colorStopsInRange.length;\n if (!inRangeStopLen && stopLen) {\n // All stops are out of range. All will be the same color.\n return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color;\n }\n var tinyExtent = 10; // Arbitrary value: 10px\n var minCoord = colorStopsInRange[0].coord - tinyExtent;\n var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent;\n var coordSpan = maxCoord - minCoord;\n if (coordSpan < 1e-3) {\n return 'transparent';\n }\n zrUtil.each(colorStopsInRange, function (stop) {\n stop.offset = (stop.coord - minCoord) / coordSpan;\n });\n colorStopsInRange.push({\n // NOTE: inRangeStopLen may still be 0 if stoplen is zero.\n offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5,\n color: outerColors[1] || 'transparent'\n });\n colorStopsInRange.unshift({\n offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5,\n color: outerColors[0] || 'transparent'\n });\n var gradient = new graphic.LinearGradient(0, 0, 0, 0, colorStopsInRange, true);\n gradient[coordDim] = minCoord;\n gradient[coordDim + '2'] = maxCoord;\n return gradient;\n}\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\n var showAllSymbol = seriesModel.get('showAllSymbol');\n var isAuto = showAllSymbol === 'auto';\n if (showAllSymbol && !isAuto) {\n return;\n }\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n if (!categoryAxis) {\n return;\n }\n // Note that category label interval strategy might bring some weird effect\n // in some scenario: users may wonder why some of the symbols are not\n // displayed. So we show all symbols as possible as we can.\n if (isAuto\n // Simplify the logic, do not determine label overlap here.\n && canShowAllSymbolForCategory(categoryAxis, data)) {\n return;\n }\n // Otherwise follow the label interval strategy on category axis.\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\n var labelMap = {};\n zrUtil.each(categoryAxis.getViewLabels(), function (labelItem) {\n var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue);\n labelMap[ordinalNumber] = 1;\n });\n return function (dataIndex) {\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\n };\n}\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\n // In most cases, line is monotonous on category axis, and the label size\n // is close with each other. So we check the symbol size and some of the\n // label size alone with the category axis to estimate whether all symbol\n // can be shown without overlap.\n var axisExtent = categoryAxis.getExtent();\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\n isNaN(availSize) && (availSize = 0); // 0/0 is NaN.\n // Sampling some points, max 5.\n var dataLen = data.count();\n var step = Math.max(1, Math.round(dataLen / 5));\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\n if (SymbolClz.getSymbolSize(data, dataIndex\n // Only for cartesian, where `isHorizontal` exists.\n )[categoryAxis.isHorizontal() ? 1 : 0]\n // Empirical number\n * 1.5 > availSize) {\n return false;\n }\n }\n return true;\n}\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\nfunction getLastIndexNotNull(points) {\n var len = points.length / 2;\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n return len - 1;\n}\nfunction getPointAtIndex(points, idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n}\nfunction getIndexRange(points, xOrY, dim) {\n var len = points.length / 2;\n var dimIdx = dim === 'x' ? 0 : 1;\n var a;\n var b;\n var prevIndex = 0;\n var nextIndex = -1;\n for (var i = 0; i < len; i++) {\n b = points[i * 2 + dimIdx];\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\n continue;\n }\n if (i === 0) {\n a = b;\n continue;\n }\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\n nextIndex = i;\n break;\n }\n prevIndex = i;\n a = b;\n }\n return {\n range: [prevIndex, nextIndex],\n t: (xOrY - a) / (b - a)\n };\n}\nfunction anyStateShowEndLabel(seriesModel) {\n if (seriesModel.get(['endLabel', 'show'])) {\n return true;\n }\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) {\n return true;\n }\n }\n return false;\n}\nfunction createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n var endLabelModel_1 = seriesModel.getModel('endLabel');\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\n var data_1 = seriesModel.getData();\n var labelAnimationRecord_1 = {\n lastFrameIndex: 0\n };\n var during = anyStateShowEndLabel(seriesModel) ? function (percent, clipRect) {\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\n } : null;\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\n var endLabel = lineView._endLabel;\n if (endLabel && hasAnimation) {\n if (labelAnimationRecord_1.originalX != null) {\n endLabel.attr({\n x: labelAnimationRecord_1.originalX,\n y: labelAnimationRecord_1.originalY\n });\n }\n }\n }, during);\n // Expand clip shape to avoid clipping when line value exceeds axis\n if (!seriesModel.get('clip', true)) {\n var rectShape = clipPath.shape;\n var expandSize = Math.max(rectShape.width, rectShape.height);\n if (isHorizontal) {\n rectShape.y -= expandSize;\n rectShape.height += expandSize * 2;\n } else {\n rectShape.x -= expandSize;\n rectShape.width += expandSize * 2;\n }\n }\n // Set to the final frame. To make sure label layout is right.\n if (during) {\n during(1, clipPath);\n }\n return clipPath;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (seriesModel.get(['endLabel', 'show'])) {\n console.warn('endLabel is not supported for lines in polar systems.');\n }\n }\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n }\n}\nfunction getEndLabelStateSpecified(endLabelModel, coordSys) {\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center';\n var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom';\n return {\n normal: {\n align: endLabelModel.get('align') || align,\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign\n }\n };\n}\nvar LineView = /** @class */function (_super) {\n __extends(LineView, _super);\n function LineView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LineView.prototype.init = function () {\n var lineGroup = new graphic.Group();\n var symbolDraw = new SymbolDraw();\n this.group.add(symbolDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineGroup = lineGroup;\n };\n LineView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n var coordSys = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var lineStyleModel = seriesModel.getModel('lineStyle');\n var areaStyleModel = seriesModel.getModel('areaStyle');\n var points = data.getLayout('points') || [];\n var isCoordSysPolar = coordSys.type === 'polar';\n var prevCoordSys = this._coordSys;\n var symbolDraw = this._symbolDraw;\n var polyline = this._polyline;\n var polygon = this._polygon;\n var lineGroup = this._lineGroup;\n var hasAnimation = !ecModel.ssr && seriesModel.get('animation');\n var isAreaChart = !areaStyleModel.isEmpty();\n var valueOrigin = areaStyleModel.get('origin');\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\n var showSymbol = seriesModel.get('showSymbol');\n var connectNulls = seriesModel.get('connectNulls');\n var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys);\n // Remove temporary symbols\n var oldData = this._data;\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n });\n // Remove previous created symbols if showSymbol changed to false\n if (!showSymbol) {\n symbolDraw.remove();\n }\n group.add(lineGroup);\n // FIXME step not support polar\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\n var clipShapeForSymbol;\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\n clipShapeForSymbol = coordSys.getArea();\n // Avoid float number rounding error for symbol on the edge of axis extent.\n // See #7913 and `test/dataZoom-clip.html`.\n if (clipShapeForSymbol.width != null) {\n clipShapeForSymbol.x -= 0.1;\n clipShapeForSymbol.y -= 0.1;\n clipShapeForSymbol.width += 0.2;\n clipShapeForSymbol.height += 0.2;\n } else if (clipShapeForSymbol.r0) {\n clipShapeForSymbol.r0 -= 0.5;\n clipShapeForSymbol.r += 0.5;\n }\n }\n this._clipShapeForSymbol = clipShapeForSymbol;\n var visualColor = getVisualGradient(data, coordSys, api) || data.getVisual('style')[data.getVisual('drawType')];\n // Initialization animation or coordinate system changed\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n });\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\n }\n }\n polyline = this._newPolyline(points);\n if (isAreaChart) {\n polygon = this._newPolygon(points, stackedOnPoints);\n } // If areaStyle is removed\n else if (polygon) {\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n }\n // NOTE: Must update _endLabel before setClipPath.\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n }\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n } else {\n if (isAreaChart && !polygon) {\n // If areaStyle is added\n polygon = this._newPolygon(points, stackedOnPoints);\n } else if (polygon && !isAreaChart) {\n // If areaStyle is removed\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n }\n // NOTE: Must update _endLabel before setClipPath.\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n }\n // Update clipPath\n var oldClipPath = lineGroup.getClipPath();\n if (oldClipPath) {\n var newClipPath = createLineClipPath(this, coordSys, false, seriesModel);\n graphic.initProps(oldClipPath, {\n shape: newClipPath.shape\n }, seriesModel);\n } else {\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n }\n // Always update, or it is wrong in the case turning on legend\n // because points are not changed.\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n });\n // In the case data zoom triggered refreshing frequently\n // Data may not change if line has a category axis. So it should animate nothing.\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) {\n if (hasAnimation) {\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls);\n } else {\n // Not do it in update with animation\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\n }\n }\n polyline.setShape({\n points: points\n });\n polygon && polygon.setShape({\n points: points,\n stackedOnPoints: stackedOnPoints\n });\n }\n }\n }\n var emphasisModel = seriesModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n polyline.useStyle(zrUtil.defaults(\n // Use color in lineStyle first\n lineStyleModel.getLineStyle(), {\n fill: 'none',\n stroke: visualColor,\n lineJoin: 'bevel'\n }));\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\n var emphasisLineStyle = polyline.getState('emphasis').style;\n emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1;\n }\n // Needs seriesIndex for focus\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\n toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled);\n var smooth = getSmooth(seriesModel.get('smooth'));\n var smoothMonotone = seriesModel.get('smoothMonotone');\n polyline.setShape({\n smooth: smooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n if (polygon) {\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n var stackedOnSmooth = 0;\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: visualColor,\n opacity: 0.7,\n lineJoin: 'bevel',\n decal: data.getVisual('style').decal\n }));\n if (stackedOnSeries) {\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\n }\n polygon.setShape({\n smooth: smooth,\n stackedOnSmooth: stackedOnSmooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\n // Needs seriesIndex for focus\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\n toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled);\n }\n var changePolyState = function (toState) {\n _this._changePolyState(toState);\n };\n data.eachItemGraphicEl(function (el) {\n // Switch polyline / polygon state if element changed its state.\n el && (el.onHoverStateChange = changePolyState);\n });\n this._polyline.onHoverStateChange = changePolyState;\n this._data = data;\n // Save the coordinate system for transition animation when data changed\n this._coordSys = coordSys;\n this._stackedOnPoints = stackedOnPoints;\n this._points = points;\n this._step = step;\n this._valueOrigin = valueOrigin;\n if (seriesModel.get('triggerLineEvent')) {\n this.packEventData(seriesModel, polyline);\n polygon && this.packEventData(seriesModel, polygon);\n }\n };\n LineView.prototype.packEventData = function (seriesModel, el) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'line',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.seriesIndex,\n seriesName: seriesModel.name,\n seriesType: 'line'\n };\n };\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n this._changePolyState('emphasis');\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\n var points = data.getLayout('points');\n var symbol = data.getItemGraphicEl(dataIndex);\n if (!symbol) {\n // Create a temporary symbol if it is not exists\n var x = points[dataIndex * 2];\n var y = points[dataIndex * 2 + 1];\n if (isNaN(x) || isNaN(y)) {\n // Null data\n return;\n }\n // fix #11360: shouldn't draw symbol outside clipShapeForSymbol\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\n return;\n }\n var zlevel = seriesModel.get('zlevel') || 0;\n var z = seriesModel.get('z') || 0;\n symbol = new SymbolClz(data, dataIndex);\n symbol.x = x;\n symbol.y = y;\n symbol.setZ(zlevel, z);\n // ensure label text of the temporary symbol is in front of line and area polygon\n var symbolLabel = symbol.getSymbolPath().getTextContent();\n if (symbolLabel) {\n symbolLabel.zlevel = zlevel;\n symbolLabel.z = z;\n symbolLabel.z2 = this._polyline.z2 + 1;\n }\n symbol.__temp = true;\n data.setItemGraphicEl(dataIndex, symbol);\n // Stop scale animation\n symbol.stopSymbolAnimation(true);\n this.group.add(symbol);\n }\n symbol.highlight();\n } else {\n // Highlight whole series\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\n }\n };\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n this._changePolyState('normal');\n if (dataIndex != null && dataIndex >= 0) {\n var symbol = data.getItemGraphicEl(dataIndex);\n if (symbol) {\n if (symbol.__temp) {\n data.setItemGraphicEl(dataIndex, null);\n this.group.remove(symbol);\n } else {\n symbol.downplay();\n }\n }\n } else {\n // FIXME\n // can not downplay completely.\n // Downplay whole series\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\n }\n };\n LineView.prototype._changePolyState = function (toState) {\n var polygon = this._polygon;\n setStatesFlag(this._polyline, toState);\n polygon && setStatesFlag(polygon, toState);\n };\n LineView.prototype._newPolyline = function (points) {\n var polyline = this._polyline;\n // Remove previous created polyline\n if (polyline) {\n this._lineGroup.remove(polyline);\n }\n polyline = new ECPolyline({\n shape: {\n points: points\n },\n segmentIgnoreThreshold: 2,\n z2: 10\n });\n this._lineGroup.add(polyline);\n this._polyline = polyline;\n return polyline;\n };\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\n var polygon = this._polygon;\n // Remove previous created polygon\n if (polygon) {\n this._lineGroup.remove(polygon);\n }\n polygon = new ECPolygon({\n shape: {\n points: points,\n stackedOnPoints: stackedOnPoints\n },\n segmentIgnoreThreshold: 2\n });\n this._lineGroup.add(polygon);\n this._polygon = polygon;\n return polygon;\n };\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\n var isHorizontalOrRadial;\n var isCoordSysPolar;\n var baseAxis = coordSys.getBaseAxis();\n var isAxisInverse = baseAxis.inverse;\n if (coordSys.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n isCoordSysPolar = false;\n } else if (coordSys.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n isCoordSysPolar = true;\n }\n var seriesModel = data.hostModel;\n var seriesDuration = seriesModel.get('animationDuration');\n if (zrUtil.isFunction(seriesDuration)) {\n seriesDuration = seriesDuration(null);\n }\n var seriesDelay = seriesModel.get('animationDelay') || 0;\n var seriesDelayValue = zrUtil.isFunction(seriesDelay) ? seriesDelay(null) : seriesDelay;\n data.eachItemGraphicEl(function (symbol, idx) {\n var el = symbol;\n if (el) {\n var point = [symbol.x, symbol.y];\n var start = void 0;\n var end = void 0;\n var current = void 0;\n if (clipShape) {\n if (isCoordSysPolar) {\n var polarClip = clipShape;\n var coord = coordSys.pointToCoord(point);\n if (isHorizontalOrRadial) {\n start = polarClip.startAngle;\n end = polarClip.endAngle;\n current = -coord[1] / 180 * Math.PI;\n } else {\n start = polarClip.r0;\n end = polarClip.r;\n current = coord[0];\n }\n } else {\n var gridClip = clipShape;\n if (isHorizontalOrRadial) {\n start = gridClip.x;\n end = gridClip.x + gridClip.width;\n current = symbol.x;\n } else {\n start = gridClip.y + gridClip.height;\n end = gridClip.y;\n current = symbol.y;\n }\n }\n }\n var ratio = end === start ? 0 : (current - start) / (end - start);\n if (isAxisInverse) {\n ratio = 1 - ratio;\n }\n var delay = zrUtil.isFunction(seriesDelay) ? seriesDelay(idx) : seriesDuration * ratio + seriesDelayValue;\n var symbolPath = el.getSymbolPath();\n var text = symbolPath.getTextContent();\n el.attr({\n scaleX: 0,\n scaleY: 0\n });\n el.animateTo({\n scaleX: 1,\n scaleY: 1\n }, {\n duration: 200,\n setToFinal: true,\n delay: delay\n });\n if (text) {\n text.animateFrom({\n style: {\n opacity: 0\n }\n }, {\n duration: 300,\n delay: delay\n });\n }\n symbolPath.disableLabelAnimation = true;\n }\n });\n };\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) {\n var endLabelModel = seriesModel.getModel('endLabel');\n if (anyStateShowEndLabel(seriesModel)) {\n var data_2 = seriesModel.getData();\n var polyline = this._polyline;\n // series may be filtered.\n var points = data_2.getLayout('points');\n if (!points) {\n polyline.removeTextContent();\n this._endLabel = null;\n return;\n }\n var endLabel = this._endLabel;\n if (!endLabel) {\n endLabel = this._endLabel = new graphic.Text({\n z2: 200 // should be higher than item symbol\n });\n\n endLabel.ignoreClip = true;\n polyline.setTextContent(this._endLabel);\n polyline.disableLabelAnimation = true;\n }\n // Find last non-NaN data to display data\n var dataIndex = getLastIndexNotNull(points);\n if (dataIndex >= 0) {\n setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), {\n inheritColor: inheritColor,\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: function (dataIndex, opt, interpolatedValue) {\n return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex);\n },\n enableTextSetter: true\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\n polyline.textConfig.position = null;\n }\n } else if (this._endLabel) {\n this._polyline.removeTextContent();\n this._endLabel = null;\n }\n };\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\n var endLabel = this._endLabel;\n var polyline = this._polyline;\n if (endLabel) {\n // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.\n // The label is not prepared at this time.\n if (percent < 1 && animationRecord.originalX == null) {\n animationRecord.originalX = endLabel.x;\n animationRecord.originalY = endLabel.y;\n }\n var points = data.getLayout('points');\n var seriesModel = data.hostModel;\n var connectNulls = seriesModel.get('connectNulls');\n var precision = endLabelModel.get('precision');\n var distance = endLabelModel.get('distance') || 0;\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var clipShape = clipRect.shape;\n var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y;\n var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1);\n var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1);\n var dim = isHorizontal ? 'x' : 'y';\n var dataIndexRange = getIndexRange(points, xOrY, dim);\n var indices = dataIndexRange.range;\n var diff = indices[1] - indices[0];\n var value = void 0;\n if (diff >= 1) {\n // diff > 1 && connectNulls, which is on the null data.\n if (diff > 1 && !connectNulls) {\n var pt = getPointAtIndex(points, indices[0]);\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\n } else {\n var pt = polyline.getPointOn(xOrY, dim);\n pt && endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n var startValue = seriesModel.getRawValue(indices[0]);\n var endValue = seriesModel.getRawValue(indices[1]);\n valueAnimation && (value = modelUtil.interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\n }\n animationRecord.lastFrameIndex = indices[0];\n } else {\n // If diff <= 0, which is the range is not found(Include NaN)\n // Choose the first point or last point.\n var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0;\n var pt = getPointAtIndex(points, idx);\n valueAnimation && (value = seriesModel.getRawValue(idx));\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n }\n if (valueAnimation) {\n var inner = labelInner(endLabel);\n if (typeof inner.setLabelText === 'function') {\n inner.setLabelText(value);\n }\n }\n }\n };\n /**\n * @private\n */\n // FIXME Two value axis\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls) {\n var polyline = this._polyline;\n var polygon = this._polygon;\n var seriesModel = data.hostModel;\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\n var current = diff.current;\n var stackedOnCurrent = diff.stackedOnCurrent;\n var next = diff.next;\n var stackedOnNext = diff.stackedOnNext;\n if (step) {\n // TODO If stacked series is not step\n current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls);\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls);\n next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls);\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls);\n }\n // Don't apply animation if diff is large.\n // For better result and avoid memory explosion problems like\n // https://github.com/apache/incubator-echarts/issues/12229\n if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) {\n polyline.stopAnimation();\n polyline.setShape({\n points: next\n });\n if (polygon) {\n polygon.stopAnimation();\n polygon.setShape({\n points: next,\n stackedOnPoints: stackedOnNext\n });\n }\n return;\n }\n polyline.shape.__points = diff.current;\n polyline.shape.points = current;\n var target = {\n shape: {\n points: next\n }\n };\n // Also animate the original points.\n // If points reference is changed when turning into step line.\n if (diff.current !== current) {\n target.shape.__points = diff.next;\n }\n // Stop previous animation.\n polyline.stopAnimation();\n graphic.updateProps(polyline, target, seriesModel);\n if (polygon) {\n polygon.setShape({\n // Reuse the points with polyline.\n points: current,\n stackedOnPoints: stackedOnCurrent\n });\n polygon.stopAnimation();\n graphic.updateProps(polygon, {\n shape: {\n stackedOnPoints: stackedOnNext\n }\n }, seriesModel);\n // If use attr directly in updateProps.\n if (polyline.shape.points !== polygon.shape.points) {\n polygon.shape.points = polyline.shape.points;\n }\n }\n var updatedDataInfo = [];\n var diffStatus = diff.status;\n for (var i = 0; i < diffStatus.length; i++) {\n var cmd = diffStatus[i].cmd;\n if (cmd === '=') {\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\n if (el) {\n updatedDataInfo.push({\n el: el,\n ptIdx: i // Index of points\n });\n }\n }\n }\n\n if (polyline.animators && polyline.animators.length) {\n polyline.animators[0].during(function () {\n polygon && polygon.dirtyShape();\n var points = polyline.shape.__points;\n for (var i = 0; i < updatedDataInfo.length; i++) {\n var el = updatedDataInfo[i].el;\n var offset = updatedDataInfo[i].ptIdx * 2;\n el.x = points[offset];\n el.y = points[offset + 1];\n el.markRedraw();\n }\n });\n }\n };\n LineView.prototype.remove = function (ecModel) {\n var group = this.group;\n var oldData = this._data;\n this._lineGroup.removeAll();\n this._symbolDraw.remove(true);\n // Remove temporary created elements when highlighting\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n });\n this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;\n };\n LineView.type = 'line';\n return LineView;\n}(ChartView);\nexport default LineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { map } from 'zrender/lib/core/util.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport { createFloat32Array } from '../util/vendor.js';\nexport default function pointsLayout(seriesType, forceStoreInTypedArray) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\n if (!coordSys) {\n return;\n }\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n if (isDimensionStacked(data, dims[0])) {\n dims[0] = stackResultDim;\n }\n if (isDimensionStacked(data, dims[1])) {\n dims[1] = stackResultDim;\n }\n var store = data.getStore();\n var dimIdx0 = data.getDimensionIndex(dims[0]);\n var dimIdx1 = data.getDimensionIndex(dims[1]);\n return dimLen && {\n progress: function (params, data) {\n var segCount = params.end - params.start;\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\n var tmpIn = [];\n var tmpOut = [];\n for (var i = params.start, offset = 0; i < params.end; i++) {\n var point = void 0;\n if (dimLen === 1) {\n var x = store.get(dimIdx0, i);\n // NOTE: Make sure the second parameter is null to use default strategy.\n point = coordSys.dataToPoint(x, null, tmpOut);\n } else {\n tmpIn[0] = store.get(dimIdx0, i);\n tmpIn[1] = store.get(dimIdx1, i);\n // Let coordinate system to handle the NaN data.\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n if (useTypedArray) {\n points[offset++] = point[0];\n points[offset++] = point[1];\n } else {\n data.setItemLayout(i, point.slice());\n }\n }\n useTypedArray && data.setLayout('points', points);\n }\n };\n }\n };\n}\n;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\nvar samplers = {\n average: function (frame) {\n var sum = 0;\n var count = 0;\n for (var i = 0; i < frame.length; i++) {\n if (!isNaN(frame[i])) {\n sum += frame[i];\n count++;\n }\n }\n // Return NaN if count is 0\n return count === 0 ? NaN : sum / count;\n },\n sum: function (frame) {\n var sum = 0;\n for (var i = 0; i < frame.length; i++) {\n // Ignore NaN\n sum += frame[i] || 0;\n }\n return sum;\n },\n max: function (frame) {\n var max = -Infinity;\n for (var i = 0; i < frame.length; i++) {\n frame[i] > max && (max = frame[i]);\n }\n // NaN will cause illegal axis extent.\n return isFinite(max) ? max : NaN;\n },\n min: function (frame) {\n var min = Infinity;\n for (var i = 0; i < frame.length; i++) {\n frame[i] < min && (min = frame[i]);\n }\n // NaN will cause illegal axis extent.\n return isFinite(min) ? min : NaN;\n },\n minmax: function (frame) {\n var turningPointAbsoluteValue = -Infinity;\n var turningPointOriginalValue = -Infinity;\n for (var i = 0; i < frame.length; i++) {\n var originalValue = frame[i];\n var absoluteValue = Math.abs(originalValue);\n if (absoluteValue > turningPointAbsoluteValue) {\n turningPointAbsoluteValue = absoluteValue;\n turningPointOriginalValue = originalValue;\n }\n }\n return isFinite(turningPointOriginalValue) ? turningPointOriginalValue : NaN;\n },\n // TODO\n // Median\n nearest: function (frame) {\n return frame[0];\n }\n};\nvar indexSampler = function (frame) {\n return Math.round(frame.length / 2);\n};\nexport default function dataSample(seriesType) {\n return {\n seriesType: seriesType,\n // FIXME:TS never used, so comment it\n // modifyOutputEnd: true,\n reset: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var sampling = seriesModel.get('sampling');\n var coordSys = seriesModel.coordinateSystem;\n var count = data.count();\n // Only cartesian2d support down sampling. Disable it when there is few data.\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var extent = baseAxis.getExtent();\n var dpr = api.getDevicePixelRatio();\n // Coordinste system has been resized\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\n var rate = Math.round(count / size);\n if (isFinite(rate) && rate > 1) {\n if (sampling === 'lttb') {\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n }\n var sampler = void 0;\n if (isString(sampling)) {\n sampler = samplers[sampling];\n } else if (isFunction(sampling)) {\n sampler = sampling;\n }\n if (sampler) {\n // Only support sample the first dim mapped from value axis.\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\n }\n }\n }\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LineSeries from './LineSeries.js';\nimport LineView from './LineView.js';\n// In case developer forget to include grid component\nimport layoutPoints from '../../layout/points.js';\nimport dataSample from '../../processor/dataSample.js';\nexport function install(registers) {\n registers.registerChartView(LineView);\n registers.registerSeriesModel(LineSeries);\n registers.registerLayout(layoutPoints('line', true));\n registers.registerVisual({\n seriesType: 'line',\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n // Visual coding for legend\n var lineStyle = seriesModel.getModel('lineStyle').getLineStyle();\n if (lineStyle && !lineStyle.stroke) {\n // Fill in visual should be palette color if\n // has color callback\n lineStyle.stroke = data.getVisual('style').fill;\n }\n data.setVisual('legendLineStyle', lineStyle);\n }\n });\n // Down sample after filter\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { each } from 'zrender/lib/core/util.js';\nvar BaseBarSeriesModel = /** @class */function (_super) {\n __extends(BaseBarSeriesModel, _super);\n function BaseBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = BaseBarSeriesModel.type;\n return _this;\n }\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value, dims, startingAtTick) {\n var coordSys = this.coordinateSystem;\n if (coordSys && coordSys.clampData) {\n // PENDING if clamp ?\n var clampData_1 = coordSys.clampData(value);\n var pt_1 = coordSys.dataToPoint(clampData_1);\n if (startingAtTick) {\n each(coordSys.getAxes(), function (axis, idx) {\n // If axis type is category, use tick coords instead\n if (axis.type === 'category' && dims != null) {\n var tickCoords = axis.getTicksCoords();\n var alignTicksWithLabel = axis.getTickModel().get('alignWithLabel');\n var targetTickId = clampData_1[idx];\n // The index of rightmost tick of markArea is 1 larger than x1/y1 index\n var isEnd = dims[idx] === 'x1' || dims[idx] === 'y1';\n if (isEnd && !alignTicksWithLabel) {\n targetTickId += 1;\n }\n // The only contains one tick, tickCoords is\n // like [{coord: 0, tickValue: 0}, {coord: 0}]\n // to the length should always be larger than 1\n if (tickCoords.length < 2) {\n return;\n } else if (tickCoords.length === 2) {\n // The left value and right value of the axis are\n // the same. coord is 0 in both items. Use the max\n // value of the axis as the coord\n pt_1[idx] = axis.toGlobalCoord(axis.getExtent()[isEnd ? 1 : 0]);\n return;\n }\n var leftCoord = void 0;\n var coord = void 0;\n var stepTickValue = 1;\n for (var i = 0; i < tickCoords.length; i++) {\n var tickCoord = tickCoords[i].coord;\n // The last item of tickCoords doesn't contain\n // tickValue\n var tickValue = i === tickCoords.length - 1 ? tickCoords[i - 1].tickValue + stepTickValue : tickCoords[i].tickValue;\n if (tickValue === targetTickId) {\n coord = tickCoord;\n break;\n } else if (tickValue < targetTickId) {\n leftCoord = tickCoord;\n } else if (leftCoord != null && tickValue > targetTickId) {\n coord = (tickCoord + leftCoord) / 2;\n break;\n }\n if (i === 1) {\n // Here we assume the step of category axes is\n // the same\n stepTickValue = tickValue - tickCoords[0].tickValue;\n }\n }\n if (coord == null) {\n if (!leftCoord) {\n // targetTickId is smaller than all tick ids in the\n // visible area, use the leftmost tick coord\n coord = tickCoords[0].coord;\n } else if (leftCoord) {\n // targetTickId is larger than all tick ids in the\n // visible area, use the rightmost tick coord\n coord = tickCoords[tickCoords.length - 1].coord;\n }\n }\n pt_1[idx] = axis.toGlobalCoord(coord);\n }\n });\n } else {\n var data = this.getData();\n var offset = data.getLayout('offset');\n var size = data.getLayout('size');\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\n pt_1[offsetIndex] += offset + size / 2;\n }\n return pt_1;\n }\n return [NaN, NaN];\n };\n BaseBarSeriesModel.type = 'series.__base_bar__';\n BaseBarSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // stack: null\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n barMinHeight: 0,\n barMinAngle: 0,\n // cursor: null,\n large: false,\n largeThreshold: 400,\n progressive: 3e3,\n progressiveChunkMode: 'mod'\n };\n return BaseBarSeriesModel;\n}(SeriesModel);\nSeriesModel.registerClass(BaseBarSeriesModel);\nexport default BaseBarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar BarSeriesModel = /** @class */function (_super) {\n __extends(BarSeriesModel, _super);\n function BarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = BarSeriesModel.type;\n return _this;\n }\n BarSeriesModel.prototype.getInitialData = function () {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true,\n createInvertedIndices: !!this.get('realtimeSort', true) || null\n });\n };\n /**\n * @override\n */\n BarSeriesModel.prototype.getProgressive = function () {\n // Do not support progressive in normal mode.\n return this.get('large') ? this.get('progressive') : false;\n };\n /**\n * @override\n */\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\n // Do not support progressive in normal mode.\n var progressiveThreshold = this.get('progressiveThreshold');\n var largeThreshold = this.get('largeThreshold');\n if (largeThreshold > progressiveThreshold) {\n progressiveThreshold = largeThreshold;\n }\n return progressiveThreshold;\n };\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.rect(data.getItemLayout(dataIndex));\n };\n BarSeriesModel.type = 'series.bar';\n BarSeriesModel.dependencies = ['grid', 'polar'];\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n // If clipped\n // Only available on cartesian2d\n clip: true,\n roundCap: false,\n showBackground: false,\n backgroundStyle: {\n color: 'rgba(180, 180, 180, 0.2)',\n borderColor: null,\n borderWidth: 0,\n borderType: 'solid',\n borderRadius: 0,\n shadowBlur: 0,\n shadowColor: null,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n realtimeSort: false\n });\n return BarSeriesModel;\n}(BaseBarSeriesModel);\nexport default BarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { Path } from '../graphic.js';\n/**\n * Sausage: similar to sector, but have half circle on both sides\n */\nvar SausageShape = /** @class */function () {\n function SausageShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n return SausageShape;\n}();\nvar SausagePath = /** @class */function (_super) {\n __extends(SausagePath, _super);\n function SausagePath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'sausage';\n return _this;\n }\n SausagePath.prototype.getDefaultShape = function () {\n return new SausageShape();\n };\n SausagePath.prototype.buildPath = function (ctx, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var dr = (r - r0) * 0.5;\n var rCenter = r0 + dr;\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var PI2 = Math.PI * 2;\n var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2;\n if (!lessThanCircle) {\n // Normalize angles\n startAngle = endAngle - (clockwise ? PI2 : -PI2);\n }\n var unitStartX = Math.cos(startAngle);\n var unitStartY = Math.sin(startAngle);\n var unitEndX = Math.cos(endAngle);\n var unitEndY = Math.sin(endAngle);\n if (lessThanCircle) {\n ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy);\n ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise);\n } else {\n ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy);\n }\n ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise);\n ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\n if (r0 !== 0) {\n ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise);\n }\n // ctx.closePath();\n };\n\n return SausagePath;\n}(Path);\nexport default SausagePath;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { isArray, isNumber } from 'zrender/lib/core/util.js';\nexport function createSectorCalculateTextPosition(positionMapping, opts) {\n opts = opts || {};\n var isRoundCap = opts.isRoundCap;\n return function (out, opts, boundingRect) {\n var textPosition = opts.position;\n if (!textPosition || textPosition instanceof Array) {\n return calculateTextPosition(out, opts, boundingRect);\n }\n var mappedSectorPosition = positionMapping(textPosition);\n var distance = opts.distance != null ? opts.distance : 5;\n var sector = this.shape;\n var cx = sector.cx;\n var cy = sector.cy;\n var r = sector.r;\n var r0 = sector.r0;\n var middleR = (r + r0) / 2;\n var startAngle = sector.startAngle;\n var endAngle = sector.endAngle;\n var middleAngle = (startAngle + endAngle) / 2;\n var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0;\n var mathCos = Math.cos;\n var mathSin = Math.sin;\n // base position: top-left\n var x = cx + r * mathCos(startAngle);\n var y = cy + r * mathSin(startAngle);\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n switch (mappedSectorPosition) {\n case 'startArc':\n x = cx + (r0 - distance) * mathCos(middleAngle);\n y = cy + (r0 - distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'top';\n break;\n case 'insideStartArc':\n x = cx + (r0 + distance) * mathCos(middleAngle);\n y = cy + (r0 + distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'startAngle':\n x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, distance + extraDist, false);\n y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, distance + extraDist, false);\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'insideStartAngle':\n x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, -distance + extraDist, false);\n y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, -distance + extraDist, false);\n textAlign = 'left';\n textVerticalAlign = 'middle';\n break;\n case 'middle':\n x = cx + middleR * mathCos(middleAngle);\n y = cy + middleR * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n case 'endArc':\n x = cx + (r + distance) * mathCos(middleAngle);\n y = cy + (r + distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'insideEndArc':\n x = cx + (r - distance) * mathCos(middleAngle);\n y = cy + (r - distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'top';\n break;\n case 'endAngle':\n x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, distance + extraDist, true);\n y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, distance + extraDist, true);\n textAlign = 'left';\n textVerticalAlign = 'middle';\n break;\n case 'insideEndAngle':\n x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, -distance + extraDist, true);\n y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, -distance + extraDist, true);\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n default:\n return calculateTextPosition(out, opts, boundingRect);\n }\n out = out || {};\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n return out;\n };\n}\nexport function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) {\n if (isNumber(rotateType)) {\n // user-set rotation\n sector.setTextConfig({\n rotation: rotateType\n });\n return;\n } else if (isArray(textPosition)) {\n // user-set position, use 0 as auto rotation\n sector.setTextConfig({\n rotation: 0\n });\n return;\n }\n var shape = sector.shape;\n var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle;\n var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle;\n var middleAngle = (startAngle + endAngle) / 2;\n var anchorAngle;\n var mappedSectorPosition = positionMapping(textPosition);\n switch (mappedSectorPosition) {\n case 'startArc':\n case 'insideStartArc':\n case 'middle':\n case 'insideEndArc':\n case 'endArc':\n anchorAngle = middleAngle;\n break;\n case 'startAngle':\n case 'insideStartAngle':\n anchorAngle = startAngle;\n break;\n case 'endAngle':\n case 'insideEndAngle':\n anchorAngle = endAngle;\n break;\n default:\n sector.setTextConfig({\n rotation: 0\n });\n return;\n }\n var rotate = Math.PI * 1.5 - anchorAngle;\n /**\n * TODO: labels with rotate > Math.PI / 2 should be rotate another\n * half round flipped to increase readability. However, only middle\n * position supports this for now, because in other positions, the\n * anchor point is not at the center of the text, so the positions\n * after rotating is not as expected.\n */\n if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) {\n rotate -= Math.PI;\n }\n sector.setTextConfig({\n rotation: rotate\n });\n}\nfunction adjustAngleDistanceX(angle, distance, isEnd) {\n return distance * Math.sin(angle) * (isEnd ? -1 : 1);\n}\nfunction adjustAngleDistanceY(angle, distance, isEnd) {\n return distance * Math.cos(angle) * (isEnd ? 1 : -1);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray, map } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nexport function getSectorCornerRadius(model, shape, zeroIfNull) {\n var cornerRadius = model.get('borderRadius');\n if (cornerRadius == null) {\n return zeroIfNull ? {\n cornerRadius: 0\n } : null;\n }\n if (!isArray(cornerRadius)) {\n cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius];\n }\n var dr = Math.abs(shape.r || 0 - shape.r0 || 0);\n return {\n cornerRadius: map(cornerRadius, function (cr) {\n return parsePercent(cr, dr);\n })\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport { extend, each, map } from 'zrender/lib/core/util.js';\nimport { Rect, Sector, updateProps, initProps, removeElementWithFadeOut, traverseElements } from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, setLabelValueAnimation, labelInner } from '../../label/labelStyle.js';\nimport { throttle } from '../../util/throttle.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { warn } from '../../util/log.js';\nimport { createSectorCalculateTextPosition, setSectorTextRotation } from '../../label/sectorLabel.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nfunction getClipArea(coord, data) {\n var coordSysClipArea = coord.getArea && coord.getArea();\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var baseAxis = coord.getBaseAxis();\n // When boundaryGap is false or using time axis. bar may exceed the grid.\n // We should not clip this part.\n // See test/bar2.html\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\n var expandWidth = data.getLayout('bandWidth');\n if (baseAxis.isHorizontal()) {\n coordSysClipArea.x -= expandWidth;\n coordSysClipArea.width += expandWidth * 2;\n } else {\n coordSysClipArea.y -= expandWidth;\n coordSysClipArea.height += expandWidth * 2;\n }\n }\n }\n return coordSysClipArea;\n}\nvar BarView = /** @class */function (_super) {\n __extends(BarView, _super);\n function BarView() {\n var _this = _super.call(this) || this;\n _this.type = BarView.type;\n _this._isFirstFrame = true;\n return _this;\n }\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\n this._model = seriesModel;\n this._removeOnRenderedListener(api);\n this._updateDrawMode(seriesModel);\n var coordinateSystemType = seriesModel.get('coordinateSystem');\n if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload);\n } else if (process.env.NODE_ENV !== 'production') {\n warn('Only cartesian2d and polar supported for bar.');\n }\n };\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\n this._clear();\n this._updateDrawMode(seriesModel);\n // incremental also need to clip, otherwise might be overlow.\n // But must not set clip in each frame, otherwise all of the children will be marked redraw.\n this._updateLargeClip(seriesModel);\n };\n BarView.prototype.incrementalRender = function (params, seriesModel) {\n // Reset\n this._progressiveEls = [];\n // Do not support progressive in normal mode.\n this._incrementalRenderLarge(params, seriesModel);\n };\n BarView.prototype.eachRendered = function (cb) {\n traverseElements(this._progressiveEls || this.group, cb);\n };\n BarView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n this._clear();\n }\n };\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coord = seriesModel.coordinateSystem;\n var baseAxis = coord.getBaseAxis();\n var isHorizontalOrRadial;\n if (coord.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n } else if (coord.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n }\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\n var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord);\n if (realtimeSortCfg) {\n this._enableRealtimeSort(realtimeSortCfg, data, api);\n }\n var needsClip = seriesModel.get('clip', true) || realtimeSortCfg;\n var coordSysClipArea = getClipArea(coord, data);\n // If there is clipPath created in large mode. Remove it.\n group.removeClipPath();\n // We don't use clipPath in normal mode because we needs a perfect animation\n // And don't want the label are clipped.\n var roundCap = seriesModel.get('roundCap', true);\n var drawBackground = seriesModel.get('showBackground', true);\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\n var bgEls = [];\n var oldBgEls = this._backgroundEls;\n var isInitSort = payload && payload.isInitSort;\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\n function createBackground(dataIndex) {\n var bgLayout = getLayout[coord.type](data, dataIndex);\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\n bgEl.useStyle(backgroundModel.getItemStyle());\n // Only cartesian2d support borderRadius.\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n } else {\n bgEl.setShape('cornerRadius', barBorderRadius);\n }\n bgEls[dataIndex] = bgEl;\n return bgEl;\n }\n ;\n data.diff(oldData).add(function (dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\n if (drawBackground) {\n createBackground(dataIndex);\n }\n // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in \"axisProxy\".\n if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) {\n return;\n }\n var isClipped = false;\n if (needsClip) {\n // Clip will modify the layout params.\n // And return a boolean to determine if the shape are fully clipped.\n isClipped = clip[coord.type](coordSysClipArea, layout);\n }\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\n if (realtimeSortCfg) {\n /**\n * Force label animation because even if the element is\n * ignored because it's clipped, it may not be clipped after\n * changing order. Then, if not using forceLabelAnimation,\n * the label animation was never started, in which case,\n * the label will be the final value and doesn't have label\n * animation.\n */\n el.forceLabelAnimation = true;\n }\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\n } else {\n initProps(el, {\n shape: layout\n }, seriesModel, dataIndex);\n }\n data.setItemGraphicEl(dataIndex, el);\n group.add(el);\n el.ignore = isClipped;\n }).update(function (newIndex, oldIndex) {\n var itemModel = data.getItemModel(newIndex);\n var layout = getLayout[coord.type](data, newIndex, itemModel);\n if (drawBackground) {\n var bgEl = void 0;\n if (oldBgEls.length === 0) {\n bgEl = createBackground(oldIndex);\n } else {\n bgEl = oldBgEls[oldIndex];\n bgEl.useStyle(backgroundModel.getItemStyle());\n // Only cartesian2d support borderRadius.\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n } else {\n bgEl.setShape('cornerRadius', barBorderRadius);\n }\n bgEls[newIndex] = bgEl;\n }\n var bgLayout = getLayout[coord.type](data, newIndex);\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\n updateProps(bgEl, {\n shape: shape\n }, animationModel, newIndex);\n }\n var el = oldData.getItemGraphicEl(oldIndex);\n if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) {\n group.remove(el);\n return;\n }\n var isClipped = false;\n if (needsClip) {\n isClipped = clip[coord.type](coordSysClipArea, layout);\n if (isClipped) {\n group.remove(el);\n }\n }\n if (!el) {\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\n } else {\n saveOldStyle(el);\n }\n if (realtimeSortCfg) {\n el.forceLabelAnimation = true;\n }\n if (isChangeOrder) {\n var textEl = el.getTextContent();\n if (textEl) {\n var labelInnerStore = labelInner(textEl);\n if (labelInnerStore.prevValue != null) {\n /**\n * Set preValue to be value so that no new label\n * should be started, otherwise, it will take a full\n * `animationDurationUpdate` time to finish the\n * animation, which is not expected.\n */\n labelInnerStore.prevValue = labelInnerStore.value;\n }\n }\n }\n // Not change anything if only order changed.\n // Especially not change label.\n else {\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n }\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\n } else {\n updateProps(el, {\n shape: layout\n }, seriesModel, newIndex, null);\n }\n data.setItemGraphicEl(newIndex, el);\n el.ignore = isClipped;\n group.add(el);\n }).remove(function (dataIndex) {\n var el = oldData.getItemGraphicEl(dataIndex);\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\n }).execute();\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\n bgGroup.removeAll();\n for (var i = 0; i < bgEls.length; ++i) {\n bgGroup.add(bgEls[i]);\n }\n group.add(bgGroup);\n this._backgroundEls = bgEls;\n this._data = data;\n };\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\n this._clear();\n createLarge(seriesModel, this.group);\n this._updateLargeClip(seriesModel);\n };\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n this._removeBackground();\n createLarge(seriesModel, this.group, this._progressiveEls, true);\n };\n BarView.prototype._updateLargeClip = function (seriesModel) {\n // Use clipPath in large mode.\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n var group = this.group;\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n };\n BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) {\n var _this = this;\n // If no data in the first frame, wait for data to initSort\n if (!data.count()) {\n return;\n }\n var baseAxis = realtimeSortCfg.baseAxis;\n if (this._isFirstFrame) {\n this._dispatchInitSort(data, realtimeSortCfg, api);\n this._isFirstFrame = false;\n } else {\n var orderMapping_1 = function (idx) {\n var el = data.getItemGraphicEl(idx);\n var shape = el && el.shape;\n return shape &&\n // The result should be consistent with the initial sort by data value.\n // Do not support the case that both positive and negative exist.\n Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width)\n // If data is NaN, shape.xxx may be NaN, so use || 0 here in case\n || 0;\n };\n this._onRendered = function () {\n _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api);\n };\n api.getZr().on('rendered', this._onRendered);\n }\n };\n BarView.prototype._dataSort = function (data, baseAxis, orderMapping) {\n var info = [];\n data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) {\n var mappedValue = orderMapping(dataIdx);\n mappedValue = mappedValue == null ? NaN : mappedValue;\n info.push({\n dataIndex: dataIdx,\n mappedValue: mappedValue,\n ordinalNumber: ordinalNumber\n });\n });\n info.sort(function (a, b) {\n // If NaN, it will be treated as min val.\n return b.mappedValue - a.mappedValue;\n });\n return {\n ordinalNumbers: map(info, function (item) {\n return item.ordinalNumber;\n })\n };\n };\n BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) {\n var scale = baseAxis.scale;\n var ordinalDataDim = data.mapDimension(baseAxis.dim);\n var lastValue = Number.MAX_VALUE;\n for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) {\n var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum));\n var value = rawIdx < 0\n // If some tick have no bar, the tick will be treated as min.\n ? Number.MIN_VALUE\n // PENDING: if dataZoom on baseAxis exits, is it a performance issue?\n : orderMapping(data.indexOfRawIndex(rawIdx));\n if (value > lastValue) {\n return true;\n }\n lastValue = value;\n }\n return false;\n };\n /*\n * Consider the case when A and B changed order, whose representing\n * bars are both out of sight, we don't wish to trigger reorder action\n * as long as the order in the view doesn't change.\n */\n BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) {\n var scale = baseAxis.scale;\n var extent = scale.getExtent();\n var tickNum = Math.max(0, extent[0]);\n var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1);\n for (; tickNum <= tickMax; ++tickNum) {\n if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) {\n return true;\n }\n }\n };\n BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) {\n if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) {\n return;\n }\n var sortInfo = this._dataSort(data, baseAxis, orderMapping);\n if (this._isOrderDifferentInView(sortInfo, baseAxis)) {\n this._removeOnRenderedListener(api);\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n axisId: baseAxis.index,\n sortInfo: sortInfo\n });\n }\n };\n BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) {\n var baseAxis = realtimeSortCfg.baseAxis;\n var sortResult = this._dataSort(data, baseAxis, function (dataIdx) {\n return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx);\n });\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n isInitSort: true,\n axisId: baseAxis.index,\n sortInfo: sortResult\n });\n };\n BarView.prototype.remove = function (ecModel, api) {\n this._clear(this._model);\n this._removeOnRenderedListener(api);\n };\n BarView.prototype.dispose = function (ecModel, api) {\n this._removeOnRenderedListener(api);\n };\n BarView.prototype._removeOnRenderedListener = function (api) {\n if (this._onRendered) {\n api.getZr().off('rendered', this._onRendered);\n this._onRendered = null;\n }\n };\n BarView.prototype._clear = function (model) {\n var group = this.group;\n var data = this._data;\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\n this._removeBackground();\n this._backgroundEls = [];\n data.eachItemGraphicEl(function (el) {\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\n });\n } else {\n group.removeAll();\n }\n this._data = null;\n this._isFirstFrame = true;\n };\n BarView.prototype._removeBackground = function () {\n this.group.remove(this._backgroundGroup);\n this._backgroundGroup = null;\n };\n BarView.type = 'bar';\n return BarView;\n}(ChartView);\nvar clip = {\n cartesian2d: function (coordSysBoundingRect, layout) {\n var signWidth = layout.width < 0 ? -1 : 1;\n var signHeight = layout.height < 0 ? -1 : 1;\n // Needs positive width and height\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width;\n var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height;\n var x = mathMax(layout.x, coordSysBoundingRect.x);\n var x2 = mathMin(layout.x + layout.width, coordSysX2);\n var y = mathMax(layout.y, coordSysBoundingRect.y);\n var y2 = mathMin(layout.y + layout.height, coordSysY2);\n var xClipped = x2 < x;\n var yClipped = y2 < y;\n // When xClipped or yClipped, the element will be marked as `ignore`.\n // But we should also place the element at the edge of the coord sys bounding rect.\n // Because if data changed and the bar shows again, its transition animation\n // will begin at this place.\n layout.x = xClipped && x > coordSysX2 ? x2 : x;\n layout.y = yClipped && y > coordSysY2 ? y2 : y;\n layout.width = xClipped ? 0 : x2 - x;\n layout.height = yClipped ? 0 : y2 - y;\n // Reverse back\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n return xClipped || yClipped;\n },\n polar: function (coordSysClipArea, layout) {\n var signR = layout.r0 <= layout.r ? 1 : -1;\n // Make sure r is larger than r0\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n var r = mathMin(layout.r, coordSysClipArea.r);\n var r0 = mathMax(layout.r0, coordSysClipArea.r0);\n layout.r = r;\n layout.r0 = r0;\n var clipped = r - r0 < 0;\n // Reverse back\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n return clipped;\n }\n};\nvar elementCreator = {\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\n var rect = new Rect({\n shape: extend({}, layout),\n z2: 1\n });\n rect.__dataIndex = newIndex;\n rect.name = 'item';\n if (animationModel) {\n var rectShape = rect.shape;\n var animateProperty = isHorizontal ? 'height' : 'width';\n rectShape[animateProperty] = 0;\n }\n return rect;\n },\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\n var ShapeClass = !isRadial && roundCap ? Sausage : Sector;\n var sector = new ShapeClass({\n shape: layout,\n z2: 1\n });\n sector.name = 'item';\n var positionMap = createPolarPositionMapping(isRadial);\n sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, {\n isRoundCap: ShapeClass === Sausage\n });\n // Animation\n if (animationModel) {\n var sectorShape = sector.shape;\n var animateProperty = isRadial ? 'r' : 'endAngle';\n var animateTarget = {};\n sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle;\n animateTarget[animateProperty] = layout[animateProperty];\n (isUpdate ? updateProps : initProps)(sector, {\n shape: animateTarget\n // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue\n }, animationModel);\n }\n return sector;\n }\n};\nfunction shouldRealtimeSort(seriesModel, coordSys) {\n var realtimeSortOption = seriesModel.get('realtimeSort', true);\n var baseAxis = coordSys.getBaseAxis();\n if (process.env.NODE_ENV !== 'production') {\n if (realtimeSortOption) {\n if (baseAxis.type !== 'category') {\n warn('`realtimeSort` will not work because this bar series is not based on a category axis.');\n }\n if (coordSys.type !== 'cartesian2d') {\n warn('`realtimeSort` will not work because this bar series is not on cartesian2d.');\n }\n }\n }\n if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') {\n return {\n baseAxis: baseAxis,\n otherAxis: coordSys.getOtherAxis(baseAxis)\n };\n }\n}\nfunction updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\n var seriesTarget;\n var axisTarget;\n if (isHorizontal) {\n axisTarget = {\n x: layout.x,\n width: layout.width\n };\n seriesTarget = {\n y: layout.y,\n height: layout.height\n };\n } else {\n axisTarget = {\n y: layout.y,\n height: layout.height\n };\n seriesTarget = {\n x: layout.x,\n width: layout.width\n };\n }\n if (!isChangeOrder) {\n // Keep the original growth animation if only axis order changed.\n // Not start a new animation.\n (isUpdate ? updateProps : initProps)(el, {\n shape: seriesTarget\n }, seriesAnimationModel, newIndex, null);\n }\n var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null;\n (isUpdate ? updateProps : initProps)(el, {\n shape: axisTarget\n }, axisAnimationModel, newIndex);\n}\nfunction checkPropertiesNotValid(obj, props) {\n for (var i = 0; i < props.length; i++) {\n if (!isFinite(obj[props[i]])) {\n return true;\n }\n }\n return false;\n}\nvar rectPropties = ['x', 'y', 'width', 'height'];\nvar polarPropties = ['cx', 'cy', 'r', 'startAngle', 'endAngle'];\nvar isValidLayout = {\n cartesian2d: function (layout) {\n return !checkPropertiesNotValid(layout, rectPropties);\n },\n polar: function (layout) {\n return !checkPropertiesNotValid(layout, polarPropties);\n }\n};\nvar getLayout = {\n // itemModel is only used to get borderWidth, which is not needed\n // when calculating bar background layout.\n cartesian2d: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\n // fix layout with lineWidth\n var signX = layout.width > 0 ? 1 : -1;\n var signY = layout.height > 0 ? 1 : -1;\n return {\n x: layout.x + signX * fixedLineWidth / 2,\n y: layout.y + signY * fixedLineWidth / 2,\n width: layout.width - signX * fixedLineWidth,\n height: layout.height - signY * fixedLineWidth\n };\n },\n polar: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n return {\n cx: layout.cx,\n cy: layout.cy,\n r0: layout.r0,\n r: layout.r,\n startAngle: layout.startAngle,\n endAngle: layout.endAngle,\n clockwise: layout.clockwise\n };\n }\n};\nfunction isZeroOnPolar(layout) {\n return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle;\n}\nfunction createPolarPositionMapping(isRadial) {\n return function (isRadial) {\n var arcOrAngle = isRadial ? 'Arc' : 'Angle';\n return function (position) {\n switch (position) {\n case 'start':\n case 'insideStart':\n case 'end':\n case 'insideEnd':\n return position + arcOrAngle;\n default:\n return position;\n }\n };\n }(isRadial);\n}\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, isPolar) {\n var style = data.getItemVisual(dataIndex, 'style');\n if (!isPolar) {\n var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0;\n el.setShape('r', borderRadius);\n } else if (!seriesModel.get('roundCap')) {\n var sectorShape = el.shape;\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n extend(sectorShape, cornerRadius);\n el.setShape(sectorShape);\n }\n el.useStyle(style);\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && el.attr('cursor', cursorStyle);\n var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout.r >= layout.r0 ? 'endArc' : 'startArc' : layout.endAngle >= layout.startAngle ? 'endAngle' : 'startAngle' : isHorizontalOrRadial ? layout.height >= 0 ? 'bottom' : 'top' : layout.width >= 0 ? 'right' : 'left';\n var labelStatesModels = getLabelStatesModels(itemModel);\n setLabelStyle(el, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\n inheritColor: style.fill,\n defaultOpacity: style.opacity,\n defaultOutsidePosition: labelPositionOutside\n });\n var label = el.getTextContent();\n if (isPolar && label) {\n var position = itemModel.get(['label', 'position']);\n el.textConfig.inside = position === 'middle' ? true : null;\n setSectorTextRotation(el, position === 'outside' ? labelPositionOutside : position, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(['label', 'rotate']));\n }\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) {\n return getDefaultInterpolatedLabel(data, value);\n });\n var emphasisModel = itemModel.getModel(['emphasis']);\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n setStatesStylesFromModel(el, itemModel);\n if (isZeroOnPolar(layout)) {\n el.style.fill = 'none';\n el.style.stroke = 'none';\n each(el.states, function (state) {\n if (state.style) {\n state.style.fill = state.style.stroke = 'none';\n }\n });\n }\n}\n// In case width or height are too small.\nfunction getLineWidth(itemModel, rawLayout) {\n // Has no border.\n var borderColor = itemModel.get(['itemStyle', 'borderColor']);\n if (!borderColor || borderColor === 'none') {\n return 0;\n }\n var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0;\n // width or height may be NaN for empty data\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\n return Math.min(lineWidth, width, height);\n}\nvar LagePathShape = /** @class */function () {\n function LagePathShape() {}\n return LagePathShape;\n}();\nvar LargePath = /** @class */function (_super) {\n __extends(LargePath, _super);\n function LargePath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'largeBar';\n return _this;\n }\n LargePath.prototype.getDefaultShape = function () {\n return new LagePathShape();\n };\n LargePath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n var baseDimIdx = this.baseDimIdx;\n var valueDimIdx = 1 - this.baseDimIdx;\n var startPoint = [];\n var size = [];\n var barWidth = this.barWidth;\n for (var i = 0; i < points.length; i += 3) {\n size[baseDimIdx] = barWidth;\n size[valueDimIdx] = points[i + 2];\n startPoint[baseDimIdx] = points[i + baseDimIdx];\n startPoint[valueDimIdx] = points[i + valueDimIdx];\n ctx.rect(startPoint[0], startPoint[1], size[0], size[1]);\n }\n };\n return LargePath;\n}(Path);\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n // TODO support polar\n var data = seriesModel.getData();\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\n var largeDataIndices = data.getLayout('largeDataIndices');\n var barWidth = data.getLayout('size');\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var bgPoints = data.getLayout('largeBackgroundPoints');\n if (bgPoints) {\n var bgEl = new LargePath({\n shape: {\n points: bgPoints\n },\n incremental: !!incremental,\n silent: true,\n z2: 0\n });\n bgEl.baseDimIdx = baseDimIdx;\n bgEl.largeDataIndices = largeDataIndices;\n bgEl.barWidth = barWidth;\n bgEl.useStyle(backgroundModel.getItemStyle());\n group.add(bgEl);\n progressiveEls && progressiveEls.push(bgEl);\n }\n var el = new LargePath({\n shape: {\n points: data.getLayout('largePoints')\n },\n incremental: !!incremental,\n ignoreCoarsePointer: true,\n z2: 1\n });\n el.baseDimIdx = baseDimIdx;\n el.largeDataIndices = largeDataIndices;\n el.barWidth = barWidth;\n group.add(el);\n el.useStyle(data.getVisual('style'));\n // Enable tooltip and user mouse/touch event handlers.\n getECData(el).seriesIndex = seriesModel.seriesIndex;\n if (!seriesModel.get('silent')) {\n el.on('mousedown', largePathUpdateDataIndex);\n el.on('mousemove', largePathUpdateDataIndex);\n }\n progressiveEls && progressiveEls.push(el);\n}\n// Use throttle to avoid frequently traverse to find dataIndex.\nvar largePathUpdateDataIndex = throttle(function (event) {\n var largePath = this;\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\n}, 30, false);\nfunction largePathFindDataIndex(largePath, x, y) {\n var baseDimIdx = largePath.baseDimIdx;\n var valueDimIdx = 1 - baseDimIdx;\n var points = largePath.shape.points;\n var largeDataIndices = largePath.largeDataIndices;\n var startPoint = [];\n var size = [];\n var barWidth = largePath.barWidth;\n for (var i = 0, len = points.length / 3; i < len; i++) {\n var ii = i * 3;\n size[baseDimIdx] = barWidth;\n size[valueDimIdx] = points[ii + 2];\n startPoint[baseDimIdx] = points[ii + baseDimIdx];\n startPoint[valueDimIdx] = points[ii + valueDimIdx];\n if (size[valueDimIdx] < 0) {\n startPoint[valueDimIdx] += size[valueDimIdx];\n size[valueDimIdx] = -size[valueDimIdx];\n }\n if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) {\n return largeDataIndices[i];\n }\n }\n return -1;\n}\nfunction createBackgroundShape(isHorizontalOrRadial, layout, coord) {\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var rectShape = layout;\n var coordLayout = coord.getArea();\n return {\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\n };\n } else {\n var coordLayout = coord.getArea();\n var sectorShape = layout;\n return {\n cx: coordLayout.cx,\n cy: coordLayout.cy,\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\n };\n }\n}\nfunction createBackgroundEl(coord, isHorizontalOrRadial, layout) {\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\n return new ElementClz({\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\n silent: true,\n z2: 0\n });\n}\nexport default BarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { layout, createProgressiveLayout } from '../../layout/barGrid.js';\nimport dataSample from '../../processor/dataSample.js';\nimport BarSeries from './BarSeries.js';\nimport BarView from './BarView.js';\nexport function install(registers) {\n registers.registerChartView(BarView);\n registers.registerSeriesModel(BarSeries);\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar'));\n // Do layout after other overall layout, which can prepare some information.\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar'));\n // Down sample after filter\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n /**\n * @payload\n * @property {string} [componentType=series]\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\n registers.registerAction({\n type: 'changeAxisOrder',\n event: 'changeAxisOrder',\n update: 'update'\n }, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n if (payload.sortInfo) {\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\n }\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parsePercent, linearMap } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { normalizeArcAngles } from 'zrender/lib/core/PathProxy.js';\nimport { makeInner } from '../../util/model.js';\nvar PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\nexport function getBasicPieLayout(seriesModel, api) {\n var viewRect = getViewRect(seriesModel, api);\n // center can be string or number when coordinateSystem is specified\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n var width = parsePercent(viewRect.width, api.getWidth());\n var height = parsePercent(viewRect.height, api.getHeight());\n var size = Math.min(width, height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var cx;\n var cy;\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys) {\n // percentage is not allowed when coordinate system is specified\n var point = coordSys.dataToPoint(center);\n cx = point[0] || 0;\n cy = point[1] || 0;\n } else {\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n cx = parsePercent(center[0], width) + viewRect.x;\n cy = parsePercent(center[1], height) + viewRect.y;\n }\n return {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r\n };\n}\nexport default function pieLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var viewRect = getViewRect(seriesModel, api);\n var _a = getBasicPieLayout(seriesModel, api),\n cx = _a.cx,\n cy = _a.cy,\n r = _a.r,\n r0 = _a.r0;\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var endAngle = seriesModel.get('endAngle');\n var padAngle = seriesModel.get('padAngle') * RADIAN;\n endAngle = endAngle === 'auto' ? startAngle - PI2 : -endAngle * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var minAndPadAngle = minAngle + padAngle;\n var validDataCount = 0;\n data.each(valueDim, function (value) {\n !isNaN(value) && validDataCount++;\n });\n var sum = data.getSum(valueDim);\n // Sum may be 0\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var clockwise = seriesModel.get('clockwise');\n var roseType = seriesModel.get('roseType');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\n // [0...max]\n var extent = data.getDataExtent(valueDim);\n extent[0] = 0;\n var dir = clockwise ? 1 : -1;\n var angles = [startAngle, endAngle];\n var halfPadAngle = dir * padAngle / 2;\n normalizeArcAngles(angles, !clockwise);\n startAngle = angles[0], endAngle = angles[1];\n var layoutData = getSeriesLayoutData(seriesModel);\n layoutData.startAngle = startAngle;\n layoutData.endAngle = endAngle;\n layoutData.clockwise = clockwise;\n var angleRange = Math.abs(endAngle - startAngle);\n // In the case some sector angle is smaller than minAngle\n var restAngle = angleRange;\n var valueSumLargerThanMinAngle = 0;\n var currentAngle = startAngle;\n data.setLayout({\n viewRect: viewRect,\n r: r\n });\n data.each(valueDim, function (value, idx) {\n var angle;\n if (isNaN(value)) {\n data.setItemLayout(idx, {\n angle: NaN,\n startAngle: NaN,\n endAngle: NaN,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? NaN : r\n });\n return;\n }\n // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?\n if (roseType !== 'area') {\n angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n } else {\n angle = angleRange / validDataCount;\n }\n if (angle < minAndPadAngle) {\n angle = minAndPadAngle;\n restAngle -= minAndPadAngle;\n } else {\n valueSumLargerThanMinAngle += value;\n }\n var endAngle = currentAngle + dir * angle;\n // calculate display angle\n var actualStartAngle = 0;\n var actualEndAngle = 0;\n if (padAngle > angle) {\n actualStartAngle = currentAngle + dir * angle / 2;\n actualEndAngle = actualStartAngle;\n } else {\n actualStartAngle = currentAngle + halfPadAngle;\n actualEndAngle = endAngle - halfPadAngle;\n }\n data.setItemLayout(idx, {\n angle: angle,\n startAngle: actualStartAngle,\n endAngle: actualEndAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? linearMap(value, extent, [r0, r]) : r\n });\n currentAngle = endAngle;\n });\n // Some sector is constrained by minAngle and padAngle\n // Rest sectors needs recalculate angle\n if (restAngle < PI2 && validDataCount) {\n // Average the angle if rest angle is not enough after all angles is\n // Constrained by minAngle and padAngle\n if (restAngle <= 1e-3) {\n var angle_1 = angleRange / validDataCount;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_1 = data.getItemLayout(idx);\n layout_1.angle = angle_1;\n var actualStartAngle = 0;\n var actualEndAngle = 0;\n if (angle_1 < padAngle) {\n actualStartAngle = startAngle + dir * (idx + 1 / 2) * angle_1;\n actualEndAngle = actualStartAngle;\n } else {\n actualStartAngle = startAngle + dir * idx * angle_1 + halfPadAngle;\n actualEndAngle = startAngle + dir * (idx + 1) * angle_1 - halfPadAngle;\n }\n layout_1.startAngle = actualStartAngle;\n layout_1.endAngle = actualEndAngle;\n }\n });\n } else {\n unitRadian = restAngle / valueSumLargerThanMinAngle;\n currentAngle = startAngle;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_2 = data.getItemLayout(idx);\n var angle = layout_2.angle === minAndPadAngle ? minAndPadAngle : value * unitRadian;\n var actualStartAngle = 0;\n var actualEndAngle = 0;\n if (angle < padAngle) {\n actualStartAngle = currentAngle + dir * angle / 2;\n actualEndAngle = actualStartAngle;\n } else {\n actualStartAngle = currentAngle + halfPadAngle;\n actualEndAngle = currentAngle + dir * angle - halfPadAngle;\n }\n layout_2.startAngle = actualStartAngle;\n layout_2.endAngle = actualEndAngle;\n currentAngle += dir * angle;\n }\n });\n }\n }\n });\n}\nexport var getSeriesLayoutData = makeInner();","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function dataFilter(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n if (!legendModels || !legendModels.length) {\n return;\n }\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx);\n // If in any legend component the status is not selected.\n for (var i = 0; i < legendModels.length; i++) {\n // @ts-ignore FIXME: LegendModel\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n return true;\n });\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// FIXME emphasis label position is not same with normal label position\nimport { parsePercent } from '../../util/number.js';\nimport { Point } from '../../util/graphic.js';\nimport { each, isNumber } from 'zrender/lib/core/util.js';\nimport { limitTurnAngle, limitSurfaceAngle } from '../../label/labelGuideHelper.js';\nimport { shiftLayoutOnY } from '../../label/labelLayoutHelper.js';\nvar RADIAN = Math.PI / 180;\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\n if (list.length < 2) {\n return;\n }\n ;\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\n var rB = semi.rB;\n var rB2 = rB * rB;\n for (var i = 0; i < semi.list.length; i++) {\n var item = semi.list[i];\n var dy = Math.abs(item.label.y - cy);\n // horizontal r is always same with original r because x is not changed.\n var rA = r + item.len;\n var rA2 = rA * rA;\n // Use ellipse implicit function to calculate x\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\n var newX = cx + (dx + item.len2) * dir;\n var deltaX = newX - item.label.x;\n var newTargetWidth = item.targetTextWidth - deltaX * dir;\n // text x is changed, so need to recalculate width.\n constrainTextWidth(item, newTargetWidth, true);\n item.label.x = newX;\n }\n }\n // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.\n function recalculateX(items) {\n // Extremes of\n var topSemi = {\n list: [],\n maxY: 0\n };\n var bottomSemi = {\n list: [],\n maxY: 0\n };\n for (var i = 0; i < items.length; i++) {\n if (items[i].labelAlignTo !== 'none') {\n continue;\n }\n var item = items[i];\n var semi = item.label.y > cy ? bottomSemi : topSemi;\n var dy = Math.abs(item.label.y - cy);\n if (dy >= semi.maxY) {\n var dx = item.label.x - cx - item.len2 * dir;\n // horizontal r is always same with original r because x is not changed.\n var rA = r + item.len;\n // Canculate rB based on the topest / bottemest label.\n var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA;\n semi.rB = rB;\n semi.maxY = dy;\n }\n semi.list.push(item);\n }\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\n }\n var len = list.length;\n for (var i = 0; i < len; i++) {\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\n var dx = list[i].label.x - farthestX;\n list[i].linePoints[1][0] += dx;\n list[i].label.x = farthestX;\n }\n }\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\n recalculateX(list);\n }\n}\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\n var leftList = [];\n var rightList = [];\n var leftmostX = Number.MAX_VALUE;\n var rightmostX = -Number.MAX_VALUE;\n for (var i = 0; i < labelLayoutList.length; i++) {\n var label = labelLayoutList[i].label;\n if (isPositionCenter(labelLayoutList[i])) {\n continue;\n }\n if (label.x < cx) {\n leftmostX = Math.min(leftmostX, label.x);\n leftList.push(labelLayoutList[i]);\n } else {\n rightmostX = Math.max(rightmostX, label.x);\n rightList.push(labelLayoutList[i]);\n }\n }\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n if (!isPositionCenter(layout) && layout.linePoints) {\n if (layout.labelStyleWidth != null) {\n continue;\n }\n var label = layout.label;\n var linePoints = layout.linePoints;\n var targetTextWidth = void 0;\n if (layout.labelAlignTo === 'edge') {\n if (label.x < cx) {\n targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance;\n } else {\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance;\n }\n } else if (layout.labelAlignTo === 'labelLine') {\n if (label.x < cx) {\n targetTextWidth = leftmostX - viewLeft - layout.bleedMargin;\n } else {\n targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin;\n }\n } else {\n if (label.x < cx) {\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\n } else {\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\n }\n }\n layout.targetTextWidth = targetTextWidth;\n constrainTextWidth(layout, targetTextWidth);\n }\n }\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n if (!isPositionCenter(layout) && layout.linePoints) {\n var label = layout.label;\n var linePoints = layout.linePoints;\n var isAlignToEdge = layout.labelAlignTo === 'edge';\n var padding = label.style.padding;\n var paddingH = padding ? padding[1] + padding[3] : 0;\n // textRect.width already contains paddingH if bgColor is set\n var extraPaddingH = label.style.backgroundColor ? 0 : paddingH;\n var realTextWidth = layout.rect.width + extraPaddingH;\n var dist = linePoints[1][0] - linePoints[2][0];\n if (isAlignToEdge) {\n if (label.x < cx) {\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\n } else {\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance;\n }\n } else {\n if (label.x < cx) {\n linePoints[2][0] = label.x + layout.labelDistance;\n } else {\n linePoints[2][0] = label.x - layout.labelDistance;\n }\n linePoints[1][0] = linePoints[2][0] + dist;\n }\n linePoints[1][1] = linePoints[2][1] = label.y;\n }\n }\n}\n/**\n * Set max width of each label, and then wrap each label to the max width.\n *\n * @param layout label layout\n * @param availableWidth max width for the label to display\n * @param forceRecalculate recaculate the text layout even if the current width\n * is smaller than `availableWidth`. This is useful when the text was previously\n * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in\n * which case, previous wrapping should be redo.\n */\nfunction constrainTextWidth(layout, availableWidth, forceRecalculate) {\n if (forceRecalculate === void 0) {\n forceRecalculate = false;\n }\n if (layout.labelStyleWidth != null) {\n // User-defined style.width has the highest priority.\n return;\n }\n var label = layout.label;\n var style = label.style;\n var textRect = layout.rect;\n var bgColor = style.backgroundColor;\n var padding = style.padding;\n var paddingH = padding ? padding[1] + padding[3] : 0;\n var overflow = style.overflow;\n // textRect.width already contains paddingH if bgColor is set\n var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH);\n if (availableWidth < oldOuterWidth || forceRecalculate) {\n var oldHeight = textRect.height;\n if (overflow && overflow.match('break')) {\n // Temporarily set background to be null to calculate\n // the bounding box without background.\n label.setStyle('backgroundColor', null);\n // Set constraining width\n label.setStyle('width', availableWidth - paddingH);\n // This is the real bounding box of the text without padding.\n var innerRect = label.getBoundingRect();\n label.setStyle('width', Math.ceil(innerRect.width));\n label.setStyle('backgroundColor', bgColor);\n } else {\n var availableInnerWidth = availableWidth - paddingH;\n var newWidth = availableWidth < oldOuterWidth\n // Current text is too wide, use `availableWidth` as max width.\n ? availableInnerWidth :\n // Current available width is enough, but the text may have\n // already been wrapped with a smaller available width.\n forceRecalculate ? availableInnerWidth > layout.unconstrainedWidth\n // Current available is larger than text width,\n // so don't constrain width (otherwise it may have\n // empty space in the background).\n ? null\n // Current available is smaller than text width, so\n // use the current available width as constraining\n // width.\n : availableInnerWidth\n // Current available width is enough, so no need to\n // constrain.\n : null;\n label.setStyle('width', newWidth);\n }\n var newRect = label.getBoundingRect();\n textRect.width = newRect.width;\n var margin = (label.style.margin || 0) + 2.1;\n textRect.height = newRect.height + margin;\n textRect.y -= (textRect.height - oldHeight) / 2;\n }\n}\nfunction isPositionCenter(sectorShape) {\n // Not change x for center label\n return sectorShape.position === 'center';\n}\nexport default function pieLabelLayout(seriesModel) {\n var data = seriesModel.getData();\n var labelLayoutList = [];\n var cx;\n var cy;\n var hasLabelRotate = false;\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\n var viewRect = data.getLayout('viewRect');\n var r = data.getLayout('r');\n var viewWidth = viewRect.width;\n var viewLeft = viewRect.x;\n var viewTop = viewRect.y;\n var viewHeight = viewRect.height;\n function setNotShow(el) {\n el.ignore = true;\n }\n function isLabelShown(label) {\n if (!label.ignore) {\n return true;\n }\n for (var key in label.states) {\n if (label.states[key].ignore === false) {\n return true;\n }\n }\n return false;\n }\n data.each(function (idx) {\n var sector = data.getItemGraphicEl(idx);\n var sectorShape = sector.shape;\n var label = sector.getTextContent();\n var labelLine = sector.getTextGuideLine();\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label');\n // Use position in normal or emphasis\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\n var labelDistance = labelModel.get('distanceToLabelLine');\n var labelAlignTo = labelModel.get('alignTo');\n var edgeDistance = parsePercent(labelModel.get('edgeDistance'), viewWidth);\n var bleedMargin = labelModel.get('bleedMargin');\n var labelLineModel = itemModel.getModel('labelLine');\n var labelLineLen = labelLineModel.get('length');\n labelLineLen = parsePercent(labelLineLen, viewWidth);\n var labelLineLen2 = labelLineModel.get('length2');\n labelLineLen2 = parsePercent(labelLineLen2, viewWidth);\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\n each(label.states, setNotShow);\n label.ignore = true;\n if (labelLine) {\n each(labelLine.states, setNotShow);\n labelLine.ignore = true;\n }\n return;\n }\n if (!isLabelShown(label)) {\n return;\n }\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\n var nx = Math.cos(midAngle);\n var ny = Math.sin(midAngle);\n var textX;\n var textY;\n var linePoints;\n var textAlign;\n cx = sectorShape.cx;\n cy = sectorShape.cy;\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\n if (labelPosition === 'center') {\n textX = sectorShape.cx;\n textY = sectorShape.cy;\n textAlign = 'center';\n } else {\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\n textX = x1 + nx * 3;\n textY = y1 + ny * 3;\n if (!isLabelInside) {\n // For roseType\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\n var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2;\n var y3 = y2;\n if (labelAlignTo === 'edge') {\n // Adjust textX because text align of edge is opposite\n textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance;\n } else {\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\n }\n textY = y3;\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\n }\n textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right';\n }\n var PI = Math.PI;\n var labelRotate = 0;\n var rotate = labelModel.get('rotate');\n if (isNumber(rotate)) {\n labelRotate = rotate * (PI / 180);\n } else if (labelPosition === 'center') {\n labelRotate = 0;\n } else if (rotate === 'radial' || rotate === true) {\n var radialAngle = nx < 0 ? -midAngle + PI : -midAngle;\n labelRotate = radialAngle;\n } else if (rotate === 'tangential' && labelPosition !== 'outside' && labelPosition !== 'outer') {\n var rad = Math.atan2(nx, ny);\n if (rad < 0) {\n rad = PI * 2 + rad;\n }\n var isDown = ny > 0;\n if (isDown) {\n rad = PI + rad;\n }\n labelRotate = rad - PI;\n }\n hasLabelRotate = !!labelRotate;\n label.x = textX;\n label.y = textY;\n label.rotation = labelRotate;\n label.setStyle({\n verticalAlign: 'middle'\n });\n // Not sectorShape the inside label\n if (!isLabelInside) {\n var textRect = label.getBoundingRect().clone();\n textRect.applyTransform(label.getComputedTransform());\n // Text has a default 1px stroke. Exclude this.\n var margin = (label.style.margin || 0) + 2.1;\n textRect.y -= margin / 2;\n textRect.height += margin;\n labelLayoutList.push({\n label: label,\n labelLine: labelLine,\n position: labelPosition,\n len: labelLineLen,\n len2: labelLineLen2,\n minTurnAngle: labelLineModel.get('minTurnAngle'),\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\n surfaceNormal: new Point(nx, ny),\n linePoints: linePoints,\n textAlign: textAlign,\n labelDistance: labelDistance,\n labelAlignTo: labelAlignTo,\n edgeDistance: edgeDistance,\n bleedMargin: bleedMargin,\n rect: textRect,\n unconstrainedWidth: textRect.width,\n labelStyleWidth: label.style.width\n });\n } else {\n label.setStyle({\n align: textAlign\n });\n var selectState = label.states.select;\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n sector.setTextConfig({\n inside: isLabelInside\n });\n });\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\n }\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n var label = layout.label;\n var labelLine = layout.labelLine;\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\n if (label) {\n label.setStyle({\n align: layout.textAlign\n });\n if (notShowLabel) {\n each(label.states, setNotShow);\n label.ignore = true;\n }\n var selectState = label.states.select;\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n if (labelLine) {\n var linePoints = layout.linePoints;\n if (notShowLabel || !linePoints) {\n each(labelLine.states, setNotShow);\n labelLine.ignore = true;\n } else {\n limitTurnAngle(linePoints, layout.minTurnAngle);\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\n labelLine.setShape({\n points: linePoints\n });\n // Set the anchor to the midpoint of sector\n label.__hostTarget.textGuideLineConfig = {\n anchor: new Point(linePoints[0][0], linePoints[0][1])\n };\n }\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { extend, retrieve3 } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport labelLayout from './labelLayout.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getBasicPieLayout, getSeriesLayoutData } from './pieLayout.js';\n/**\n * Piece of pie including Sector, Label, LabelLine\n */\nvar PiePiece = /** @class */function (_super) {\n __extends(PiePiece, _super);\n function PiePiece(data, idx, startAngle) {\n var _this = _super.call(this) || this;\n _this.z2 = 2;\n var text = new graphic.Text();\n _this.setTextContent(text);\n _this.updateData(data, idx, startAngle, true);\n return _this;\n }\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\n var sector = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = data.getItemLayout(idx);\n // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified.\n // see `setItemLayout` in `pieLayout.ts`.\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout);\n // Ignore NaN data.\n if (isNaN(sectorShape.startAngle)) {\n // Use NaN shape to avoid drawing shape.\n sector.setShape(sectorShape);\n return;\n }\n if (firstCreate) {\n sector.setShape(sectorShape);\n var animationType = seriesModel.getShallow('animationType');\n if (seriesModel.ecModel.ssr) {\n // Use scale animation in SSR mode(opacity?)\n // Because CSS SVG animation doesn't support very customized shape animation.\n graphic.initProps(sector, {\n scaleX: 0,\n scaleY: 0\n }, seriesModel, {\n dataIndex: idx,\n isFrom: true\n });\n sector.originX = sectorShape.cx;\n sector.originY = sectorShape.cy;\n } else if (animationType === 'scale') {\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, idx);\n }\n // Expansion\n else {\n if (startAngle != null) {\n sector.setShape({\n startAngle: startAngle,\n endAngle: startAngle\n });\n graphic.initProps(sector, {\n shape: {\n startAngle: layout.startAngle,\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n } else {\n sector.shape.endAngle = layout.startAngle;\n graphic.updateProps(sector, {\n shape: {\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n }\n }\n } else {\n saveOldStyle(sector);\n // Transition animation from the old shape\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel, idx);\n }\n sector.useStyle(data.getItemVisual(idx, 'style'));\n setStatesStylesFromModel(sector, itemModel);\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var offset = seriesModel.get('selectedOffset');\n var dx = Math.cos(midAngle) * offset;\n var dy = Math.sin(midAngle) * offset;\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n this._updateLabel(seriesModel, data, idx);\n sector.ensureState('emphasis').shape = extend({\n r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0)\n }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\n extend(sector.ensureState('select'), {\n x: dx,\n y: dy,\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\n });\n extend(sector.ensureState('blur'), {\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\n });\n var labelLine = sector.getTextGuideLine();\n var labelText = sector.getTextContent();\n labelLine && extend(labelLine.ensureState('select'), {\n x: dx,\n y: dy\n });\n // TODO: needs dx, dy in zrender?\n extend(labelText.ensureState('select'), {\n x: dx,\n y: dy\n });\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\n var sector = this;\n var itemModel = data.getItemModel(idx);\n var labelLineModel = itemModel.getModel('labelLine');\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style && style.fill;\n var visualOpacity = style && style.opacity;\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx)\n });\n var labelText = sector.getTextContent();\n // Set textConfig on sector.\n sector.setTextConfig({\n // reset position, rotation\n position: null,\n rotation: null\n });\n // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n labelText.attr({\n z2: 10\n });\n var labelPosition = seriesModel.get(['label', 'position']);\n if (labelPosition !== 'outside' && labelPosition !== 'outer') {\n sector.removeTextGuideLine();\n } else {\n var polyline = this.getTextGuideLine();\n if (!polyline) {\n polyline = new graphic.Polyline();\n this.setTextGuideLine(polyline);\n }\n // Default use item visual color\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\n stroke: visualColor,\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\n });\n }\n };\n return PiePiece;\n}(graphic.Sector);\n// Pie view\nvar PieView = /** @class */function (_super) {\n __extends(PieView, _super);\n function PieView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var startAngle;\n // First render\n if (!oldData && data.count() > 0) {\n var shape = data.getItemLayout(0);\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\n shape = data.getItemLayout(s);\n }\n if (shape) {\n startAngle = shape.startAngle;\n }\n }\n // remove empty-circle if it exists\n if (this._emptyCircleSector) {\n group.remove(this._emptyCircleSector);\n }\n // when all data are filtered, show lightgray empty circle\n if (data.count() === 0 && seriesModel.get('showEmptyCircle')) {\n var layoutData = getSeriesLayoutData(seriesModel);\n var sector = new graphic.Sector({\n shape: extend(getBasicPieLayout(seriesModel, api), layoutData)\n });\n sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle());\n this._emptyCircleSector = sector;\n group.add(sector);\n }\n data.diff(oldData).add(function (idx) {\n var piePiece = new PiePiece(data, idx, startAngle);\n data.setItemGraphicEl(idx, piePiece);\n group.add(piePiece);\n }).update(function (newIdx, oldIdx) {\n var piePiece = oldData.getItemGraphicEl(oldIdx);\n piePiece.updateData(data, newIdx, startAngle);\n piePiece.off('click');\n group.add(piePiece);\n data.setItemGraphicEl(newIdx, piePiece);\n }).remove(function (idx) {\n var piePiece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piePiece, seriesModel, idx);\n }).execute();\n labelLayout(seriesModel);\n // Always use initial animation.\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\n this._data = data;\n }\n };\n PieView.prototype.dispose = function () {};\n PieView.prototype.containPoint = function (point, seriesModel) {\n var data = seriesModel.getData();\n var itemLayout = data.getItemLayout(0);\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n PieView.type = 'pie';\n return PieView;\n}(ChartView);\nexport default PieView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { extend, isArray } from 'zrender/lib/core/util.js';\n/**\n * [Usage]:\n * (1)\n * createListSimply(seriesModel, ['value']);\n * (2)\n * createListSimply(seriesModel, {\n * coordDimensions: ['value'],\n * dimensionsCount: 5\n * });\n */\nexport default function createSeriesDataSimply(seriesModel, opt, nameList) {\n opt = isArray(opt) && {\n coordDimensions: opt\n } || extend({\n encodeDefine: seriesModel.getEncode()\n }, opt);\n var source = seriesModel.getSource();\n var dimensions = prepareSeriesDataSchema(source, opt).dimensions;\n var list = new SeriesData(dimensions, seriesModel);\n list.initData(source, nameList);\n return list;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * LegendVisualProvider is an bridge that pick encoded color from data and\n * provide to the legend component.\n */\nvar LegendVisualProvider = /** @class */function () {\n function LegendVisualProvider(\n // Function to get data after filtered. It stores all the encoding info\n getDataWithEncodedVisual,\n // Function to get raw data before filtered.\n getRawData) {\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\n this._getRawData = getRawData;\n }\n LegendVisualProvider.prototype.getAllNames = function () {\n var rawData = this._getRawData();\n // We find the name from the raw data. In case it's filtered by the legend component.\n // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\n return rawData.mapArray(rawData.getName);\n };\n LegendVisualProvider.prototype.containName = function (name) {\n var rawData = this._getRawData();\n return rawData.indexOfName(name) >= 0;\n };\n LegendVisualProvider.prototype.indexOfName = function (name) {\n // Only get data when necessary.\n // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\n // Invoking Series#getData immediately will throw an error.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n return dataWithEncodedVisual.indexOfName(name);\n };\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\n // Get encoded visual properties from final filtered data.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\n };\n return LegendVisualProvider;\n}();\nexport default LegendVisualProvider;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { getPercentSeats } from '../../util/number.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nvar innerData = modelUtil.makeInner();\nvar PieSeriesModel = /** @class */function (_super) {\n __extends(PieSeriesModel, _super);\n function PieSeriesModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @overwrite\n */\n PieSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments);\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n this._defaultLabelLine(option);\n };\n /**\n * @overwrite\n */\n PieSeriesModel.prototype.mergeOption = function () {\n _super.prototype.mergeOption.apply(this, arguments);\n };\n /**\n * @overwrite\n */\n PieSeriesModel.prototype.getInitialData = function () {\n return createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n /**\n * @overwrite\n */\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData();\n // update seats when data is changed\n var dataInner = innerData(data);\n var seats = dataInner.seats;\n if (!seats) {\n var valueList_1 = [];\n data.each(data.mapDimension('value'), function (value) {\n valueList_1.push(value);\n });\n seats = dataInner.seats = getPercentSeats(valueList_1, data.hostModel.get('percentPrecision'));\n }\n var params = _super.prototype.getDataParams.call(this, dataIndex);\n // seats may be empty when sum is 0\n params.percent = seats[dataIndex] || 0;\n params.$vars.push('percent');\n return params;\n };\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n modelUtil.defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine;\n // Not show label line if `label.normal.show = false`\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n };\n PieSeriesModel.type = 'series.pie';\n PieSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n colorBy: 'data',\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n endAngle: 'auto',\n padAngle: 0,\n // 最小角度改为0\n minAngle: 0,\n // If the angle of a sector less than `minShowLabelAngle`,\n // the label will not be displayed.\n minShowLabelAngle: 0,\n // 选中时扇区偏移量\n selectedOffset: 10,\n // 选择模式,默认关闭,可选single,multiple\n // selectedMode: false,\n // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)\n // roseType: null,\n percentPrecision: 2,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // cursor: null,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n width: null,\n height: null,\n label: {\n // color: 'inherit',\n // If rotate around circle\n rotate: 0,\n show: true,\n overflow: 'truncate',\n // 'outer', 'inside', 'center'\n position: 'outer',\n // 'none', 'labelLine', 'edge'. Works only when position is 'outer'\n alignTo: 'none',\n // Closest distance between label and chart edge.\n // Works only position is 'outer' and alignTo is 'edge'.\n edgeDistance: '25%',\n // Works only position is 'outer' and alignTo is not 'edge'.\n bleedMargin: 10,\n // Distance between text and label line.\n distanceToLabelLine: 5\n // formatter: 标签文本格式器,同 tooltip.formatter,不支持异步回调\n // 默认使用全局文本样式,详见 textStyle\n // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数\n },\n\n // Enabled when label.normal.position is 'outer'\n labelLine: {\n show: true,\n // 引导线两段中的第一段长度\n length: 15,\n // 引导线两段中的第二段长度\n length2: 15,\n smooth: false,\n minTurnAngle: 90,\n maxSurfaceAngle: 90,\n lineStyle: {\n // color: 各异,\n width: 1,\n type: 'solid'\n }\n },\n itemStyle: {\n borderWidth: 1,\n borderJoin: 'round'\n },\n showEmptyCircle: true,\n emptyCircleStyle: {\n color: 'lightgray',\n opacity: 1\n },\n labelLayout: {\n // Hide the overlapped label.\n hideOverlap: true\n },\n emphasis: {\n scale: true,\n scaleSize: 5\n },\n // If use strategy to avoid label overlapping\n avoidLabelOverlap: true,\n // Animation type. Valid values: expansion, scale\n animationType: 'expansion',\n animationDuration: 1000,\n // Animation type when update. Valid values: transition, expansion\n animationTypeUpdate: 'transition',\n animationEasingUpdate: 'cubicInOut',\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut'\n };\n return PieSeriesModel;\n}(SeriesModel);\nexport default PieSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function negativeDataFilter(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n // handle negative value condition\n var valueDim = data.mapDimension('value');\n var curValue = data.get(valueDim, idx);\n if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) {\n return false;\n }\n return true;\n });\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport pieLayout from '../pie/pieLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport PieView from './PieView.js';\nimport PieSeriesModel from './PieSeries.js';\nimport negativeDataFilter from '../../processor/negativeDataFilter.js';\nexport function install(registers) {\n registers.registerChartView(PieView);\n registers.registerSeriesModel(PieSeriesModel);\n createLegacyDataSelectAction('pie', registers.registerAction);\n registers.registerLayout(curry(pieLayout, 'pie'));\n registers.registerProcessor(dataFilter('pie'));\n registers.registerProcessor(negativeDataFilter('pie'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nvar ScatterSeriesModel = /** @class */function (_super) {\n __extends(ScatterSeriesModel, _super);\n function ScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n ScatterSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n if (progressive == null) {\n // PENDING\n return this.option.large ? 5e3 : this.get('progressive');\n }\n return progressive;\n };\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n if (progressiveThreshold == null) {\n // PENDING\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\n }\n return progressiveThreshold;\n };\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n ScatterSeriesModel.prototype.getZLevelKey = function () {\n // Each progressive series has individual key.\n return this.getData().count() > this.getProgressiveThreshold() ? this.id : '';\n };\n ScatterSeriesModel.type = 'series.scatter';\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n ScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n symbolSize: 10,\n // symbolRotate: null, // 图形旋转控制\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n // cursor: null,\n itemStyle: {\n opacity: 0.8\n // color: 各异\n },\n\n emphasis: {\n scale: true\n },\n // If clip the overflow graphics\n // Works on cartesian / polar series\n clip: true,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n universalTransition: {\n divideShape: 'clone'\n }\n // progressive: null\n };\n\n return ScatterSeriesModel;\n}(SeriesModel);\nexport default ScatterSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global Float32Array */\n// TODO Batch by color\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { getECData } from '../../util/innerStore.js';\nvar BOOST_SIZE_THRESHOLD = 4;\nvar LargeSymbolPathShape = /** @class */function () {\n function LargeSymbolPathShape() {}\n return LargeSymbolPathShape;\n}();\nvar LargeSymbolPath = /** @class */function (_super) {\n __extends(LargeSymbolPath, _super);\n function LargeSymbolPath(opts) {\n var _this = _super.call(this, opts) || this;\n _this._off = 0;\n _this.hoverDataIdx = -1;\n return _this;\n }\n LargeSymbolPath.prototype.getDefaultShape = function () {\n return new LargeSymbolPathShape();\n };\n LargeSymbolPath.prototype.reset = function () {\n this.notClear = false;\n this._off = 0;\n };\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\n var points = shape.points;\n var size = shape.size;\n var symbolProxy = this.symbolProxy;\n var symbolProxyShape = symbolProxy.shape;\n var ctx = path.getContext ? path.getContext() : path;\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\n var softClipShape = this.softClipShape;\n var i;\n // Do draw in afterBrush.\n if (canBoost) {\n this._ctx = ctx;\n return;\n }\n this._ctx = null;\n for (i = this._off; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n if (softClipShape && !softClipShape.contain(x, y)) {\n continue;\n }\n symbolProxyShape.x = x - size[0] / 2;\n symbolProxyShape.y = y - size[1] / 2;\n symbolProxyShape.width = size[0];\n symbolProxyShape.height = size[1];\n symbolProxy.buildPath(path, symbolProxyShape, true);\n }\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n LargeSymbolPath.prototype.afterBrush = function () {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var ctx = this._ctx;\n var softClipShape = this.softClipShape;\n var i;\n if (!ctx) {\n return;\n }\n // PENDING If style or other canvas status changed?\n for (i = this._off; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n if (softClipShape && !softClipShape.contain(x, y)) {\n continue;\n }\n // fillRect is faster than building a rect path and draw.\n // And it support light globalCompositeOperation.\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n }\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\n // TODO ???\n // Consider transform\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = Math.max(size[0], 4);\n var h = Math.max(size[1], 4);\n // Not consider transform\n // Treat each element as a rect\n // top down traverse\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\n var i = idx * 2;\n var x0 = points[i] - w / 2;\n var y0 = points[i + 1] - h / 2;\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\n return idx;\n }\n }\n return -1;\n };\n LargeSymbolPath.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n x = localPos[0];\n y = localPos[1];\n if (rect.contain(x, y)) {\n // Cache found data index.\n var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n return dataIdx >= 0;\n }\n this.hoverDataIdx = -1;\n return false;\n };\n LargeSymbolPath.prototype.getBoundingRect = function () {\n // Ignore stroke for large symbol draw.\n var rect = this._rect;\n if (!rect) {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = size[0];\n var h = size[1];\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n rect = this._rect = new graphic.BoundingRect(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h);\n }\n return rect;\n };\n return LargeSymbolPath;\n}(graphic.Path);\nvar LargeSymbolDraw = /** @class */function () {\n function LargeSymbolDraw() {\n this.group = new graphic.Group();\n }\n /**\n * Update symbols draw by new data\n */\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\n this._clear();\n var symbolEl = this._create();\n symbolEl.setShape({\n points: data.getLayout('points')\n });\n this._setCommon(symbolEl, data, opt);\n };\n LargeSymbolDraw.prototype.updateLayout = function (data) {\n var points = data.getLayout('points');\n this.group.eachChild(function (child) {\n if (child.startIndex != null) {\n var len = (child.endIndex - child.startIndex) * 2;\n var byteOffset = child.startIndex * 4 * 2;\n points = new Float32Array(points.buffer, byteOffset, len);\n }\n child.setShape('points', points);\n // Reset draw cursor.\n child.reset();\n });\n };\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this._clear();\n };\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n var lastAdded = this._newAdded[0];\n var points = data.getLayout('points');\n var oldPoints = lastAdded && lastAdded.shape.points;\n // Merging the exists. Each element has 1e4 points.\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n if (oldPoints && oldPoints.length < 2e4) {\n var oldLen = oldPoints.length;\n var newPoints = new Float32Array(oldLen + points.length);\n // Concat two array\n newPoints.set(oldPoints);\n newPoints.set(points, oldLen);\n // Update endIndex\n lastAdded.endIndex = taskParams.end;\n lastAdded.setShape({\n points: newPoints\n });\n } else {\n // Clear\n this._newAdded = [];\n var symbolEl = this._create();\n symbolEl.startIndex = taskParams.start;\n symbolEl.endIndex = taskParams.end;\n symbolEl.incremental = true;\n symbolEl.setShape({\n points: points\n });\n this._setCommon(symbolEl, data, opt);\n }\n };\n LargeSymbolDraw.prototype.eachRendered = function (cb) {\n this._newAdded[0] && cb(this._newAdded[0]);\n };\n LargeSymbolDraw.prototype._create = function () {\n var symbolEl = new LargeSymbolPath({\n cursor: 'default'\n });\n symbolEl.ignoreCoarsePointer = true;\n this.group.add(symbolEl);\n this._newAdded.push(symbolEl);\n return symbolEl;\n };\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, opt) {\n var hostModel = data.hostModel;\n opt = opt || {};\n var size = data.getVisual('symbolSize');\n symbolEl.setShape('size', size instanceof Array ? size : [size, size]);\n symbolEl.softClipShape = opt.clipShape || null;\n // Create symbolProxy to build path for each data\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0);\n // Use symbolProxy setColor method\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\n symbolEl.useStyle(\n // Draw shadow when doing fillRect is extremely slow.\n hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\n var globalStyle = data.getVisual('style');\n var visualColor = globalStyle && globalStyle.fill;\n if (visualColor) {\n symbolEl.setColor(visualColor);\n }\n var ecData = getECData(symbolEl);\n // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n ecData.seriesIndex = hostModel.seriesIndex;\n symbolEl.on('mousemove', function (e) {\n ecData.dataIndex = null;\n var dataIndex = symbolEl.hoverDataIdx;\n if (dataIndex >= 0) {\n // Provide dataIndex for tooltip\n ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0);\n }\n });\n };\n LargeSymbolDraw.prototype.remove = function () {\n this._clear();\n };\n LargeSymbolDraw.prototype._clear = function () {\n this._newAdded = [];\n this.group.removeAll();\n };\n return LargeSymbolDraw;\n}();\nexport default LargeSymbolDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LargeSymbolDraw from '../helper/LargeSymbolDraw.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\nvar ScatterView = /** @class */function (_super) {\n __extends(ScatterView, _super);\n function ScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ScatterView.type;\n return _this;\n }\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n symbolDraw.updateData(data, {\n // TODO\n // If this parameter should be a shape or a bounding volume\n // shape will be more general.\n // But bounding volume like bounding rect will be much faster in the contain calculation\n clipShape: this._getClipShape(seriesModel)\n });\n this._finished = true;\n };\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n symbolDraw.incrementalPrepareUpdate(data);\n this._finished = false;\n };\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\n clipShape: this._getClipShape(seriesModel)\n });\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n // Must mark group dirty and make sure the incremental layer will be cleared\n // PENDING\n this.group.dirty();\n if (!this._finished || data.count() > 1e4) {\n return {\n update: true\n };\n } else {\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n this._symbolDraw.updateLayout(data);\n }\n };\n ScatterView.prototype.eachRendered = function (cb) {\n this._symbolDraw && this._symbolDraw.eachRendered(cb);\n };\n ScatterView.prototype._getClipShape = function (seriesModel) {\n if (!seriesModel.get('clip', true)) {\n return;\n }\n var coordSys = seriesModel.coordinateSystem;\n // PENDING make `0.1` configurable, for example, `clipTolerance`?\n return coordSys && coordSys.getArea && coordSys.getArea(.1);\n };\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\n var symbolDraw = this._symbolDraw;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\n symbolDraw && symbolDraw.remove();\n symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw();\n this._isLargeDraw = isLargeDraw;\n this.group.removeAll();\n }\n this.group.add(symbolDraw.group);\n return symbolDraw;\n };\n ScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n this._symbolDraw = null;\n };\n ScatterView.prototype.dispose = function () {};\n ScatterView.type = 'scatter';\n return ScatterView;\n}(ChartView);\nexport default ScatterView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nvar GridModel = /** @class */function (_super) {\n __extends(GridModel, _super);\n function GridModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GridModel.type = 'grid';\n GridModel.dependencies = ['xAxis', 'yAxis'];\n GridModel.layoutMode = 'box';\n GridModel.defaultOption = {\n show: false,\n // zlevel: 0,\n z: 0,\n left: '10%',\n top: 60,\n right: '10%',\n bottom: 70,\n // If grid size contain label\n containLabel: false,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 1,\n borderColor: '#ccc'\n };\n return GridModel;\n}(ComponentModel);\nexport default GridModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar CartesianAxisModel = /** @class */function (_super) {\n __extends(CartesianAxisModel, _super);\n function CartesianAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CartesianAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n };\n CartesianAxisModel.type = 'cartesian2dAxis';\n return CartesianAxisModel;\n}(ComponentModel);\nexport { CartesianAxisModel };\nzrUtil.mixin(CartesianAxisModel, AxisModelCommonMixin);\nexport default CartesianAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar defaultOption = {\n show: true,\n // zlevel: 0,\n z: 0,\n // Inverse the axis.\n inverse: false,\n // Axis name displayed.\n name: '',\n // 'start' | 'middle' | 'end'\n nameLocation: 'end',\n // By degree. By default auto rotate by nameLocation.\n nameRotate: null,\n nameTruncate: {\n maxWidth: null,\n ellipsis: '...',\n placeholder: '.'\n },\n // Use global text style by default.\n nameTextStyle: {},\n // The gap between axisName and axisLine.\n nameGap: 15,\n // Default `false` to support tooltip.\n silent: false,\n // Default `false` to avoid legacy user event listener fail.\n triggerEvent: false,\n tooltip: {\n show: false\n },\n axisPointer: {},\n axisLine: {\n show: true,\n onZero: true,\n onZeroAxisIndex: null,\n lineStyle: {\n color: '#6E7079',\n width: 1,\n type: 'solid'\n },\n // The arrow at both ends the the axis.\n symbol: ['none', 'none'],\n symbolSize: [10, 15]\n },\n axisTick: {\n show: true,\n // Whether axisTick is inside the grid or outside the grid.\n inside: false,\n // The length of axisTick.\n length: 5,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n // Whether axisLabel is inside the grid or outside the grid.\n inside: false,\n rotate: 0,\n // true | false | null/undefined (auto)\n showMinLabel: null,\n // true | false | null/undefined (auto)\n showMaxLabel: null,\n margin: 8,\n // formatter: null,\n fontSize: 12\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#E0E6F1'],\n width: 1,\n type: 'solid'\n }\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\n }\n }\n};\nvar categoryAxis = zrUtil.merge({\n // The gap at both ends of the axis. For categoryAxis, boolean.\n boundaryGap: true,\n // Set false to faster category collection.\n deduplication: null,\n // splitArea: {\n // show: false\n // },\n splitLine: {\n show: false\n },\n axisTick: {\n // If tick is align with label when boundaryGap is true\n alignWithLabel: false,\n interval: 'auto'\n },\n axisLabel: {\n interval: 'auto'\n }\n}, defaultOption);\nvar valueAxis = zrUtil.merge({\n boundaryGap: [0, 0],\n axisLine: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n axisTick: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n // TODO\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n splitNumber: 5,\n minorTick: {\n // Minor tick, not available for cateogry axis.\n show: false,\n // Split number of minor ticks. The value should be in range of (0, 100)\n splitNumber: 5,\n // Length of minor tick\n length: 3,\n // Line style\n lineStyle: {\n // Default to be same with axisTick\n }\n },\n minorSplitLine: {\n show: false,\n lineStyle: {\n color: '#F4F7FD',\n width: 1\n }\n }\n}, defaultOption);\nvar timeAxis = zrUtil.merge({\n splitNumber: 6,\n axisLabel: {\n // To eliminate labels that are not nice\n showMinLabel: false,\n showMaxLabel: false,\n rich: {\n primary: {\n fontWeight: 'bold'\n }\n }\n },\n splitLine: {\n show: false\n }\n}, valueAxis);\nvar logAxis = zrUtil.defaults({\n logBase: 10\n}, valueAxis);\nexport default {\n category: categoryAxis,\n value: valueAxis,\n time: timeAxis,\n log: logAxis\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport var AXIS_TYPES = {\n value: 1,\n category: 1,\n time: 1,\n log: 1\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport axisDefault from './axisDefault.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport { AXIS_TYPES } from './axisCommonTypes.js';\nimport { each, merge } from 'zrender/lib/core/util.js';\n/**\n * Generate sub axis model class\n * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...\n */\nexport default function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n each(AXIS_TYPES, function (v, axisType) {\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n var AxisModel = /** @class */function (_super) {\n __extends(AxisModel, _super);\n function AxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n merge(option, themeModel.get(axisType + 'Axis'));\n merge(option, this.getDefaultOption());\n option.type = getAxisType(option);\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n if (thisOption.type === 'category') {\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option;\n // FIXME\n // warning if called before all of 'getInitailData' finished.\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n return this.__ordinalMeta.categories;\n }\n };\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}\nfunction getAxisType(option) {\n // Default axis with data is category axis\n return option.type || (option.data ? 'category' : 'value');\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar Cartesian = /** @class */function () {\n function Cartesian(name) {\n this.type = 'cartesian';\n this._dimList = [];\n this._axes = {};\n this.name = name || '';\n }\n Cartesian.prototype.getAxis = function (dim) {\n return this._axes[dim];\n };\n Cartesian.prototype.getAxes = function () {\n return zrUtil.map(this._dimList, function (dim) {\n return this._axes[dim];\n }, this);\n };\n Cartesian.prototype.getAxesByScale = function (scaleType) {\n scaleType = scaleType.toLowerCase();\n return zrUtil.filter(this.getAxes(), function (axis) {\n return axis.scale.type === scaleType;\n });\n };\n Cartesian.prototype.addAxis = function (axis) {\n var dim = axis.dim;\n this._axes[dim] = axis;\n this._dimList.push(dim);\n };\n return Cartesian;\n}();\n;\nexport default Cartesian;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Cartesian from './Cartesian.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport { applyTransform } from 'zrender/lib/core/vector.js';\nexport var cartesian2DDimensions = ['x', 'y'];\nfunction canCalculateAffineTransform(scale) {\n return scale.type === 'interval' || scale.type === 'time';\n}\nvar Cartesian2D = /** @class */function (_super) {\n __extends(Cartesian2D, _super);\n function Cartesian2D() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'cartesian2d';\n _this.dimensions = cartesian2DDimensions;\n return _this;\n }\n /**\n * Calculate an affine transform matrix if two axes are time or value.\n * It's mainly for accelartion on the large time series data.\n */\n Cartesian2D.prototype.calcAffineTransform = function () {\n this._transform = this._invTransform = null;\n var xAxisScale = this.getAxis('x').scale;\n var yAxisScale = this.getAxis('y').scale;\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\n return;\n }\n var xScaleExtent = xAxisScale.getExtent();\n var yScaleExtent = yAxisScale.getExtent();\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\n if (!xScaleSpan || !yScaleSpan) {\n return;\n }\n // Accelerate data to point calculation on the special large time series data.\n var scaleX = (end[0] - start[0]) / xScaleSpan;\n var scaleY = (end[1] - start[1]) / yScaleSpan;\n var translateX = start[0] - xScaleExtent[0] * scaleX;\n var translateY = start[1] - yScaleExtent[0] * scaleY;\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\n this._invTransform = invert([], m);\n };\n /**\n * Base axis will be used on stacking.\n */\n Cartesian2D.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x');\n };\n Cartesian2D.prototype.containPoint = function (point) {\n var axisX = this.getAxis('x');\n var axisY = this.getAxis('y');\n return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));\n };\n Cartesian2D.prototype.containData = function (data) {\n return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]);\n };\n Cartesian2D.prototype.containZone = function (data1, data2) {\n var zoneDiag1 = this.dataToPoint(data1);\n var zoneDiag2 = this.dataToPoint(data2);\n var area = this.getArea();\n var zone = new BoundingRect(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]);\n return area.intersect(zone);\n };\n Cartesian2D.prototype.dataToPoint = function (data, clamp, out) {\n out = out || [];\n var xVal = data[0];\n var yVal = data[1];\n // Fast path\n if (this._transform\n // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated.\n && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {\n return applyTransform(out, data, this._transform);\n }\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp));\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp));\n return out;\n };\n Cartesian2D.prototype.clampData = function (data, out) {\n var xScale = this.getAxis('x').scale;\n var yScale = this.getAxis('y').scale;\n var xAxisExtent = xScale.getExtent();\n var yAxisExtent = yScale.getExtent();\n var x = xScale.parse(data[0]);\n var y = yScale.parse(data[1]);\n out = out || [];\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\n return out;\n };\n Cartesian2D.prototype.pointToData = function (point, clamp) {\n var out = [];\n if (this._invTransform) {\n return applyTransform(out, point, this._invTransform);\n }\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp);\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp);\n return out;\n };\n Cartesian2D.prototype.getOtherAxis = function (axis) {\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\n };\n /**\n * Get rect area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n */\n Cartesian2D.prototype.getArea = function (tolerance) {\n tolerance = tolerance || 0;\n var xExtent = this.getAxis('x').getGlobalExtent();\n var yExtent = this.getAxis('y').getGlobalExtent();\n var x = Math.min(xExtent[0], xExtent[1]) - tolerance;\n var y = Math.min(yExtent[0], yExtent[1]) - tolerance;\n var width = Math.max(xExtent[0], xExtent[1]) - x + tolerance;\n var height = Math.max(yExtent[0], yExtent[1]) - y + tolerance;\n return new BoundingRect(x, y, width, height);\n };\n return Cartesian2D;\n}(Cartesian);\n;\nexport default Cartesian2D;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar Axis2D = /** @class */function (_super) {\n __extends(Axis2D, _super);\n function Axis2D(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n /**\n * Index of axis, can be used as key\n * Injected outside.\n */\n _this.index = 0;\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n Axis2D.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n /**\n * Each item cooresponds to this.getExtent(), which\n * means globalExtent[0] may greater than globalExtent[1],\n * unless `asc` is input.\n *\n * @param {boolean} [asc]\n * @return {Array.}\n */\n Axis2D.prototype.getGlobalExtent = function (asc) {\n var ret = this.getExtent();\n ret[0] = this.toGlobalCoord(ret[0]);\n ret[1] = this.toGlobalCoord(ret[1]);\n asc && ret[0] > ret[1] && ret.reverse();\n return ret;\n };\n Axis2D.prototype.pointToData = function (point, clamp) {\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\n };\n /**\n * Set ordinalSortInfo\n * @param info new OrdinalSortInfo\n */\n Axis2D.prototype.setCategorySortInfo = function (info) {\n if (this.type !== 'category') {\n return false;\n }\n this.model.option.categorySortInfo = info;\n this.scale.setSortInfo(info);\n };\n return Axis2D;\n}(Axis);\nexport default Axis2D;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n */\nexport function layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n }\n // Axis position\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]];\n // Axis rotation\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\n // Tick and label direction, x y is axisDim\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n // Special label rotation\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\n // Over splitLine and splitArea\n layout.z2 = 1;\n return layout;\n}\nexport function isCartesian2DSeries(seriesModel) {\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n var axisModelMap = {\n xAxisModel: null,\n yAxisModel: null\n };\n zrUtil.each(axisModelMap, function (v, key) {\n var axisType = key.replace(/Model$/, '');\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n if (process.env.NODE_ENV !== 'production') {\n if (!axisModel) {\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n }\n }\n axisModelMap[key] = axisModel;\n });\n return axisModelMap;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getPrecisionSafe, round } from '../util/number.js';\nimport IntervalScale from '../scale/Interval.js';\nimport { getScaleExtent } from './axisHelper.js';\nimport { warn } from '../util/log.js';\nimport { increaseInterval, isValueNice } from '../scale/helper.js';\nvar mathLog = Math.log;\nexport function alignScaleTicks(scale, axisModel, alignToScale) {\n var intervalScaleProto = IntervalScale.prototype;\n // NOTE: There is a precondition for log scale here:\n // In log scale we store _interval and _extent of exponent value.\n // So if we use the method of InternalScale to set/get these data.\n // It process the exponent value, which is linear and what we want here.\n var alignToTicks = intervalScaleProto.getTicks.call(alignToScale);\n var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true);\n var alignToSplitNumber = alignToTicks.length - 1;\n var alignToInterval = intervalScaleProto.getInterval.call(alignToScale);\n var scaleExtent = getScaleExtent(scale, axisModel);\n var rawExtent = scaleExtent.extent;\n var isMinFixed = scaleExtent.fixMin;\n var isMaxFixed = scaleExtent.fixMax;\n if (scale.type === 'log') {\n var logBase = mathLog(scale.base);\n rawExtent = [mathLog(rawExtent[0]) / logBase, mathLog(rawExtent[1]) / logBase];\n }\n scale.setExtent(rawExtent[0], rawExtent[1]);\n scale.calcNiceExtent({\n splitNumber: alignToSplitNumber,\n fixMin: isMinFixed,\n fixMax: isMaxFixed\n });\n var extent = intervalScaleProto.getExtent.call(scale);\n // Need to update the rawExtent.\n // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax'\n if (isMinFixed) {\n rawExtent[0] = extent[0];\n }\n if (isMaxFixed) {\n rawExtent[1] = extent[1];\n }\n var interval = intervalScaleProto.getInterval.call(scale);\n var min = rawExtent[0];\n var max = rawExtent[1];\n if (isMinFixed && isMaxFixed) {\n // User set min, max, divide to get new interval\n interval = (max - min) / alignToSplitNumber;\n } else if (isMinFixed) {\n max = rawExtent[0] + interval * alignToSplitNumber;\n // User set min, expand extent on the other side\n while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) {\n interval = increaseInterval(interval);\n max = rawExtent[0] + interval * alignToSplitNumber;\n }\n } else if (isMaxFixed) {\n // User set max, expand extent on the other side\n min = rawExtent[1] - interval * alignToSplitNumber;\n while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) {\n interval = increaseInterval(interval);\n min = rawExtent[1] - interval * alignToSplitNumber;\n }\n } else {\n var nicedSplitNumber = scale.getTicks().length - 1;\n if (nicedSplitNumber > alignToSplitNumber) {\n interval = increaseInterval(interval);\n }\n var range = interval * alignToSplitNumber;\n max = Math.ceil(rawExtent[1] / interval) * interval;\n min = round(max - range);\n // Not change the result that crossing zero.\n if (min < 0 && rawExtent[0] >= 0) {\n min = 0;\n max = round(range);\n } else if (max > 0 && rawExtent[1] <= 0) {\n max = 0;\n min = -round(range);\n }\n }\n // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale\n var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;\n var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval;\n // NOTE: Must in setExtent -> setInterval -> setNiceExtent order.\n intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1);\n intervalScaleProto.setInterval.call(scale, interval);\n if (t0 || t1) {\n intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval);\n }\n if (process.env.NODE_ENV !== 'production') {\n var ticks = intervalScaleProto.getTicks.call(scale);\n if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) {\n warn(\n // eslint-disable-next-line\n \"The ticks may be not readable when set min: \" + axisModel.get('min') + \", max: \" + axisModel.get('max') + \" and alignTicks: true\");\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Grid is a region which contains at most 4 cartesian systems\n *\n * TODO Default cartesian\n */\nimport { isObject, each, indexOf, retrieve3, keys } from 'zrender/lib/core/util.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { createScaleByModel, ifAxisCrossZero, niceScaleExtent, estimateLabelUnionRect, getDataDimensionsOnAxis } from '../../coord/axisHelper.js';\nimport Cartesian2D, { cartesian2DDimensions } from './Cartesian2D.js';\nimport Axis2D from './Axis2D.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { isCartesian2DSeries, findAxisModels } from './cartesianAxisHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\nvar Grid = /** @class */function () {\n function Grid(gridModel, ecModel, api) {\n // FIXME:TS where used (different from registered type 'cartesian2d')?\n this.type = 'grid';\n this._coordsMap = {};\n this._coordsList = [];\n this._axesMap = {};\n this._axesList = [];\n this.axisPointerEnabled = true;\n this.dimensions = cartesian2DDimensions;\n this._initCartesian(gridModel, ecModel, api);\n this.model = gridModel;\n }\n Grid.prototype.getRect = function () {\n return this._rect;\n };\n Grid.prototype.update = function (ecModel, api) {\n var axesMap = this._axesMap;\n this._updateScale(ecModel, this.model);\n function updateAxisTicks(axes) {\n var alignTo;\n // Axis is added in order of axisIndex.\n var axesIndices = keys(axes);\n var len = axesIndices.length;\n if (!len) {\n return;\n }\n var axisNeedsAlign = [];\n // Process once and calculate the ticks for those don't use alignTicks.\n for (var i = len - 1; i >= 0; i--) {\n var idx = +axesIndices[i]; // Convert to number.\n var axis = axes[idx];\n var model = axis.model;\n var scale = axis.scale;\n if (\n // Only value and log axis without interval support alignTicks.\n isIntervalOrLogScale(scale) && model.get('alignTicks') && model.get('interval') == null) {\n axisNeedsAlign.push(axis);\n } else {\n niceScaleExtent(scale, model);\n if (isIntervalOrLogScale(scale)) {\n // Can only align to interval or log axis.\n alignTo = axis;\n }\n }\n }\n ;\n // All axes has set alignTicks. Pick the first one.\n // PENDING. Should we find the axis that both set interval, min, max and align to this one?\n if (axisNeedsAlign.length) {\n if (!alignTo) {\n alignTo = axisNeedsAlign.pop();\n niceScaleExtent(alignTo.scale, alignTo.model);\n }\n each(axisNeedsAlign, function (axis) {\n alignScaleTicks(axis.scale, axis.model, alignTo.scale);\n });\n }\n }\n updateAxisTicks(axesMap.x);\n updateAxisTicks(axesMap.y);\n // Key: axisDim_axisIndex, value: boolean, whether onZero target.\n var onZeroRecords = {};\n each(axesMap.x, function (xAxis) {\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\n });\n each(axesMap.y, function (yAxis) {\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\n });\n // Resize again if containLabel is enabled\n // FIXME It may cause getting wrong grid size in data processing stage\n this.resize(this.model, api);\n };\n /**\n * Resize the grid\n */\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\n var boxLayoutParams = gridModel.getBoxLayoutParams();\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\n var gridRect = getLayoutRect(boxLayoutParams, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n this._rect = gridRect;\n var axesList = this._axesList;\n adjustAxes();\n // Minus label size\n if (isContainLabel) {\n each(axesList, function (axis) {\n if (!axis.model.get(['axisLabel', 'inside'])) {\n var labelUnionRect = estimateLabelUnionRect(axis);\n if (labelUnionRect) {\n var dim = axis.isHorizontal() ? 'height' : 'width';\n var margin = axis.model.get(['axisLabel', 'margin']);\n gridRect[dim] -= labelUnionRect[dim] + margin;\n if (axis.position === 'top') {\n gridRect.y += labelUnionRect.height + margin;\n } else if (axis.position === 'left') {\n gridRect.x += labelUnionRect.width + margin;\n }\n }\n }\n });\n adjustAxes();\n }\n each(this._coordsList, function (coord) {\n // Calculate affine matrix to accelerate the data to point transform.\n // If all the axes scales are time or value.\n coord.calcAffineTransform();\n });\n function adjustAxes() {\n each(axesList, function (axis) {\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\n });\n }\n };\n Grid.prototype.getAxis = function (dim, axisIndex) {\n var axesMapOnDim = this._axesMap[dim];\n if (axesMapOnDim != null) {\n return axesMapOnDim[axisIndex || 0];\n }\n };\n Grid.prototype.getAxes = function () {\n return this._axesList.slice();\n };\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\n if (xAxisIndex != null && yAxisIndex != null) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n return this._coordsMap[key];\n }\n if (isObject(xAxisIndex)) {\n yAxisIndex = xAxisIndex.yAxisIndex;\n xAxisIndex = xAxisIndex.xAxisIndex;\n }\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\n if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) {\n return coordList[i];\n }\n }\n };\n Grid.prototype.getCartesians = function () {\n return this._coordsList.slice();\n };\n /**\n * @implements\n */\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;\n };\n /**\n * @implements\n */\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;\n };\n Grid.prototype._findConvertTarget = function (finder) {\n var seriesModel = finder.seriesModel;\n var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n var gridModel = finder.gridModel;\n var coordsList = this._coordsList;\n var cartesian;\n var axis;\n if (seriesModel) {\n cartesian = seriesModel.coordinateSystem;\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\n } else if (xAxisModel && yAxisModel) {\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n } else if (xAxisModel) {\n axis = this.getAxis('x', xAxisModel.componentIndex);\n } else if (yAxisModel) {\n axis = this.getAxis('y', yAxisModel.componentIndex);\n }\n // Lowest priority.\n else if (gridModel) {\n var grid = gridModel.coordinateSystem;\n if (grid === this) {\n cartesian = this._coordsList[0];\n }\n }\n return {\n cartesian: cartesian,\n axis: axis\n };\n };\n /**\n * @implements\n */\n Grid.prototype.containPoint = function (point) {\n var coord = this._coordsList[0];\n if (coord) {\n return coord.containPoint(point);\n }\n };\n /**\n * Initialize cartesian coordinate systems\n */\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\n var _this = this;\n var grid = this;\n var axisPositionUsed = {\n left: false,\n right: false,\n top: false,\n bottom: false\n };\n var axesMap = {\n x: {},\n y: {}\n };\n var axesCount = {\n x: 0,\n y: 0\n };\n // Create axis\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\n if (!axesCount.x || !axesCount.y) {\n // Roll back when there no either x or y axis\n this._axesMap = {};\n this._axesList = [];\n return;\n }\n this._axesMap = axesMap;\n // Create cartesian2d\n each(axesMap.x, function (xAxis, xAxisIndex) {\n each(axesMap.y, function (yAxis, yAxisIndex) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n var cartesian = new Cartesian2D(key);\n cartesian.master = _this;\n cartesian.model = gridModel;\n _this._coordsMap[key] = cartesian;\n _this._coordsList.push(cartesian);\n cartesian.addAxis(xAxis);\n cartesian.addAxis(yAxis);\n });\n });\n function createAxisCreator(dimName) {\n return function (axisModel, idx) {\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\n return;\n }\n var axisPosition = axisModel.get('position');\n if (dimName === 'x') {\n // Fix position\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\n // Default bottom of X\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\n }\n } else {\n // Fix position\n if (axisPosition !== 'left' && axisPosition !== 'right') {\n // Default left of Y\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\n }\n }\n axisPositionUsed[axisPosition] = true;\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n // Inject axis into axisModel\n axisModel.axis = axis;\n // Inject axisModel into axis\n axis.model = axisModel;\n // Inject grid info axis\n axis.grid = grid;\n // Index of axis, can be used as key\n axis.index = idx;\n grid._axesList.push(axis);\n axesMap[dimName][idx] = axis;\n axesCount[dimName]++;\n };\n }\n };\n /**\n * Update cartesian properties from series.\n */\n Grid.prototype._updateScale = function (ecModel, gridModel) {\n // Reset scale\n each(this._axesList, function (axis) {\n axis.scale.setExtent(Infinity, -Infinity);\n if (axis.type === 'category') {\n var categorySortInfo = axis.model.get('categorySortInfo');\n axis.scale.setSortInfo(categorySortInfo);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n if (isCartesian2DSeries(seriesModel)) {\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\n return;\n }\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n var data = seriesModel.getData();\n var xAxis = cartesian.getAxis('x');\n var yAxis = cartesian.getAxis('y');\n unionExtent(data, xAxis);\n unionExtent(data, yAxis);\n }\n }, this);\n function unionExtent(data, axis) {\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\n axis.scale.unionExtentFromData(data, dim);\n });\n }\n };\n /**\n * @param dim 'x' or 'y' or 'auto' or null/undefined\n */\n Grid.prototype.getTooltipAxes = function (dim) {\n var baseAxes = [];\n var otherAxes = [];\n each(this.getCartesians(), function (cartesian) {\n var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\n var otherAxis = cartesian.getOtherAxis(baseAxis);\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\n });\n return {\n baseAxes: baseAxes,\n otherAxes: otherAxes\n };\n };\n Grid.create = function (ecModel, api) {\n var grids = [];\n ecModel.eachComponent('grid', function (gridModel, idx) {\n var grid = new Grid(gridModel, ecModel, api);\n grid.name = 'grid_' + idx;\n // dataSampling requires axis extent, so resize\n // should be performed in create stage.\n grid.resize(gridModel, api, true);\n gridModel.coordinateSystem = grid;\n grids.push(grid);\n });\n // Inject the coordinateSystems into seriesModel\n ecModel.eachSeries(function (seriesModel) {\n if (!isCartesian2DSeries(seriesModel)) {\n return;\n }\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n var gridModel = xAxisModel.getCoordSysModel();\n if (process.env.NODE_ENV !== 'production') {\n if (!gridModel) {\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\n }\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\n throw new Error('xAxis and yAxis must use the same grid');\n }\n }\n var grid = gridModel.coordinateSystem;\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n });\n return grids;\n };\n // For deciding which dimensions to use when creating list data\n Grid.dimensions = cartesian2DDimensions;\n return Grid;\n}();\n/**\n * Check if the axis is used in the specified grid.\n */\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis,\n// Key: see `getOnZeroRecordKey`\nonZeroRecords) {\n axis.getAxesOnZeroOf = function () {\n // TODO: onZero of multiple axes.\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\n };\n // onZero can not be enabled in these two situations:\n // 1. When any other axis is a category axis.\n // 2. When no axis is cross 0 point.\n var otherAxes = axesMap[otherAxisDim];\n var otherAxisOnZeroOf;\n var axisModel = axis.model;\n var onZero = axisModel.get(['axisLine', 'onZero']);\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\n if (!onZero) {\n return;\n }\n // If target axis is specified.\n if (onZeroAxisIndex != null) {\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\n }\n } else {\n // Find the first available other axis.\n for (var idx in otherAxes) {\n if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx])\n // Consider that two Y axes on one value axis,\n // if both onZero, the two Y axes overlap.\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\n otherAxisOnZeroOf = otherAxes[idx];\n break;\n }\n }\n }\n if (otherAxisOnZeroOf) {\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\n }\n function getOnZeroRecordKey(axis) {\n return axis.dim + '_' + axis.index;\n }\n}\nfunction canOnZeroToAxis(axis) {\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\n}\nfunction updateAxisTransform(axis, coordBase) {\n var axisExtent = axis.getExtent();\n var axisExtentSum = axisExtent[0] + axisExtent[1];\n // Fast transform\n axis.toGlobalCoord = axis.dim === 'x' ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n axis.toLocalCoord = axis.dim === 'x' ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n}\nexport default Grid;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { retrieve, defaults, extend, each, isObject, map, isString, isNumber, isFunction, retrieve2 } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport { isRadianAroundZero, remRadian } from '../../util/number.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport * as matrixUtil from 'zrender/lib/core/matrix.js';\nimport { applyTransform as v2ApplyTransform } from 'zrender/lib/core/vector.js';\nimport { shouldShowAllLabels } from '../../coord/axisHelper.js';\nimport { prepareLayoutList, hideOverlap } from '../../label/labelLayoutHelper.js';\nvar PI = Math.PI;\n/**\n * A final axis is translated and rotated from a \"standard axis\".\n * So opt.position and opt.rotation is required.\n *\n * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],\n * for example: (0, 0) ------------> (0, 50)\n *\n * nameDirection or tickDirection or labelDirection is 1 means tick\n * or label is below the standard axis, whereas is -1 means above\n * the standard axis. labelOffset means offset between label and axis,\n * which is useful when 'onZero', where axisLabel is in the grid and\n * label in outside grid.\n *\n * Tips: like always,\n * positive rotation represents anticlockwise, and negative rotation\n * represents clockwise.\n * The direction of position coordinate is the same as the direction\n * of screen coordinate.\n *\n * Do not need to consider axis 'inverse', which is auto processed by\n * axis extent.\n */\nvar AxisBuilder = /** @class */function () {\n function AxisBuilder(axisModel, opt) {\n this.group = new graphic.Group();\n this.opt = opt;\n this.axisModel = axisModel;\n // Default value\n defaults(opt, {\n labelOffset: 0,\n nameDirection: 1,\n tickDirection: 1,\n labelDirection: 1,\n silent: true,\n handleAutoShown: function () {\n return true;\n }\n });\n // FIXME Not use a separate text group?\n var transformGroup = new graphic.Group({\n x: opt.position[0],\n y: opt.position[1],\n rotation: opt.rotation\n });\n // this.group.add(transformGroup);\n // this._transformGroup = transformGroup;\n transformGroup.updateTransform();\n this._transformGroup = transformGroup;\n }\n AxisBuilder.prototype.hasBuilder = function (name) {\n return !!builders[name];\n };\n AxisBuilder.prototype.add = function (name) {\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\n };\n AxisBuilder.prototype.getGroup = function () {\n return this.group;\n };\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\n var rotationDiff = remRadian(textRotation - axisRotation);\n var textAlign;\n var textVerticalAlign;\n if (isRadianAroundZero(rotationDiff)) {\n // Label is parallel with axis line.\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI)) {\n // Label is inverse parallel with axis line.\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n if (rotationDiff > 0 && rotationDiff < PI) {\n textAlign = direction > 0 ? 'right' : 'left';\n } else {\n textAlign = direction > 0 ? 'left' : 'right';\n }\n }\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n };\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\n var eventData = {\n componentType: axisModel.mainType,\n componentIndex: axisModel.componentIndex\n };\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\n return eventData;\n };\n AxisBuilder.isLabelSilent = function (axisModel) {\n var tooltipOpt = axisModel.get('tooltip');\n return axisModel.get('silent')\n // Consider mouse cursor, add these restrictions.\n || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show);\n };\n return AxisBuilder;\n}();\n;\nvar builders = {\n axisLine: function (opt, axisModel, group, transformGroup) {\n var shown = axisModel.get(['axisLine', 'show']);\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisLine');\n }\n if (!shown) {\n return;\n }\n var extent = axisModel.axis.getExtent();\n var matrix = transformGroup.transform;\n var pt1 = [extent[0], 0];\n var pt2 = [extent[1], 0];\n var inverse = pt1[0] > pt2[0];\n if (matrix) {\n v2ApplyTransform(pt1, pt1, matrix);\n v2ApplyTransform(pt2, pt2, matrix);\n }\n var lineStyle = extend({\n lineCap: 'round'\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\n var line = new graphic.Line({\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: lineStyle,\n strokeContainThreshold: opt.strokeContainThreshold || 5,\n silent: true,\n z2: 1\n });\n graphic.subPixelOptimizeLine(line.shape, line.style.lineWidth);\n line.anid = 'line';\n group.add(line);\n var arrows = axisModel.get(['axisLine', 'symbol']);\n if (arrows != null) {\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\n if (isString(arrows)) {\n // Use the same arrow for start and end point\n arrows = [arrows, arrows];\n }\n if (isString(arrowSize) || isNumber(arrowSize)) {\n // Use the same size for width and height\n arrowSize = [arrowSize, arrowSize];\n }\n var arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize);\n var symbolWidth_1 = arrowSize[0];\n var symbolHeight_1 = arrowSize[1];\n each([{\n rotate: opt.rotation + Math.PI / 2,\n offset: arrowOffset[0],\n r: 0\n }, {\n rotate: opt.rotation - Math.PI / 2,\n offset: arrowOffset[1],\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\n }], function (point, index) {\n if (arrows[index] !== 'none' && arrows[index] != null) {\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);\n // Calculate arrow position with offset\n var r = point.r + point.offset;\n var pt = inverse ? pt2 : pt1;\n symbol.attr({\n rotation: point.rotate,\n x: pt[0] + r * Math.cos(opt.rotation),\n y: pt[1] - r * Math.sin(opt.rotation),\n silent: true,\n z2: 11\n });\n group.add(symbol);\n }\n });\n }\n },\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\n // This bit fixes the label overlap issue for the time chart.\n // See https://github.com/apache/echarts/issues/14266 for more.\n if (axisModel.get(['axisLabel', 'hideOverlap'])) {\n var labelList = prepareLayoutList(map(labelEls, function (label) {\n return {\n label: label,\n priority: label.z2,\n defaultAttr: {\n ignore: label.ignore\n }\n };\n }));\n hideOverlap(labelList);\n }\n },\n axisName: function (opt, axisModel, group, transformGroup) {\n var name = retrieve(opt.axisName, axisModel.get('name'));\n if (!name) {\n return;\n }\n var nameLocation = axisModel.get('nameLocation');\n var nameDirection = opt.nameDirection;\n var textStyleModel = axisModel.getModel('nameTextStyle');\n var gap = axisModel.get('nameGap') || 0;\n var extent = axisModel.axis.getExtent();\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\n var pos = [nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2,\n // Reuse labelOffset.\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0];\n var labelLayout;\n var nameRotation = axisModel.get('nameRotate');\n if (nameRotation != null) {\n nameRotation = nameRotation * PI / 180; // To radian.\n }\n\n var axisNameAvailableWidth;\n if (isNameLocationCenter(nameLocation)) {\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation,\n // Adapt to axis.\n nameDirection);\n } else {\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\n if (axisNameAvailableWidth != null) {\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\n }\n }\n var textFont = textStyleModel.getFont();\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\n var ellipsis = truncateOpt.ellipsis;\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\n var textEl = new graphic.Text({\n x: pos[0],\n y: pos[1],\n rotation: labelLayout.rotation,\n silent: AxisBuilder.isLabelSilent(axisModel),\n style: createTextStyle(textStyleModel, {\n text: name,\n font: textFont,\n overflow: 'truncate',\n width: maxWidth,\n ellipsis: ellipsis,\n fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']),\n align: textStyleModel.get('align') || labelLayout.textAlign,\n verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign\n }),\n z2: 1\n });\n graphic.setTooltipConfig({\n el: textEl,\n componentModel: axisModel,\n itemName: name\n });\n textEl.__fullText = name;\n // Id for animation\n textEl.anid = 'name';\n if (axisModel.get('triggerEvent')) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisName';\n eventData.name = name;\n getECData(textEl).eventData = eventData;\n }\n // FIXME\n transformGroup.add(textEl);\n textEl.updateTransform();\n group.add(textEl);\n textEl.decomposeTransform();\n }\n};\nfunction endTextLayout(rotation, textPosition, textRotate, extent) {\n var rotationDiff = remRadian(textRotate - rotation);\n var textAlign;\n var textVerticalAlign;\n var inverse = extent[0] > extent[1];\n var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse;\n if (isRadianAroundZero(rotationDiff - PI / 2)) {\n textVerticalAlign = onLeft ? 'bottom' : 'top';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {\n textVerticalAlign = onLeft ? 'top' : 'bottom';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {\n textAlign = onLeft ? 'left' : 'right';\n } else {\n textAlign = onLeft ? 'right' : 'left';\n }\n }\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n}\nfunction fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\n if (shouldShowAllLabels(axisModel.axis)) {\n return;\n }\n // If min or max are user set, we need to check\n // If the tick on min(max) are overlap on their neighbour tick\n // If they are overlapped, we need to hide the min(max) tick label\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\n // FIXME\n // Have not consider onBand yet, where tick els is more than label els.\n labelEls = labelEls || [];\n tickEls = tickEls || [];\n var firstLabel = labelEls[0];\n var nextLabel = labelEls[1];\n var lastLabel = labelEls[labelEls.length - 1];\n var prevLabel = labelEls[labelEls.length - 2];\n var firstTick = tickEls[0];\n var nextTick = tickEls[1];\n var lastTick = tickEls[tickEls.length - 1];\n var prevTick = tickEls[tickEls.length - 2];\n if (showMinLabel === false) {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\n if (showMinLabel) {\n ignoreEl(nextLabel);\n ignoreEl(nextTick);\n } else {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n }\n }\n if (showMaxLabel === false) {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\n if (showMaxLabel) {\n ignoreEl(prevLabel);\n ignoreEl(prevTick);\n } else {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n }\n }\n}\nfunction ignoreEl(el) {\n el && (el.ignore = true);\n}\nfunction isTwoLabelOverlapped(current, next) {\n // current and next has the same rotation.\n var firstRect = current && current.getBoundingRect().clone();\n var nextRect = next && next.getBoundingRect().clone();\n if (!firstRect || !nextRect) {\n return;\n }\n // When checking intersect of two rotated labels, we use mRotationBack\n // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.\n var mRotationBack = matrixUtil.identity([]);\n matrixUtil.rotate(mRotationBack, mRotationBack, -current.rotation);\n firstRect.applyTransform(matrixUtil.mul([], mRotationBack, current.getLocalTransform()));\n nextRect.applyTransform(matrixUtil.mul([], mRotationBack, next.getLocalTransform()));\n return firstRect.intersect(nextRect);\n}\nfunction isNameLocationCenter(nameLocation) {\n return nameLocation === 'middle' || nameLocation === 'center';\n}\nfunction createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\n var tickEls = [];\n var pt1 = [];\n var pt2 = [];\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = ticksCoords[i].coord;\n pt1[0] = tickCoord;\n pt1[1] = 0;\n pt2[0] = tickCoord;\n pt2[1] = tickEndCoord;\n if (tickTransform) {\n v2ApplyTransform(pt1, pt1, tickTransform);\n v2ApplyTransform(pt2, pt2, tickTransform);\n }\n // Tick line, Not use group transform to have better line draw\n var tickEl = new graphic.Line({\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: tickLineStyle,\n z2: 2,\n autoBatch: true,\n silent: true\n });\n graphic.subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\n tickEls.push(tickEl);\n }\n return tickEls;\n}\nfunction buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var tickModel = axisModel.getModel('axisTick');\n var shown = tickModel.get('show');\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisTick');\n }\n if (!shown || axis.scale.isBlank()) {\n return;\n }\n var lineStyleModel = tickModel.getModel('lineStyle');\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\n var ticksCoords = axis.getTicksCoords();\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }), 'ticks');\n for (var i = 0; i < ticksEls.length; i++) {\n group.add(ticksEls[i]);\n }\n return ticksEls;\n}\nfunction buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\n var axis = axisModel.axis;\n var minorTickModel = axisModel.getModel('minorTick');\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\n return;\n }\n var minorTicksCoords = axis.getMinorTicksCoords();\n if (!minorTicksCoords.length) {\n return;\n }\n var lineStyleModel = minorTickModel.getModel('lineStyle');\n var tickEndCoord = tickDirection * minorTickModel.get('length');\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }));\n for (var i = 0; i < minorTicksCoords.length; i++) {\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\n for (var k = 0; k < minorTicksEls.length; k++) {\n group.add(minorTicksEls[k]);\n }\n }\n}\nfunction buildAxisLabel(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\n if (!show || axis.scale.isBlank()) {\n return;\n }\n var labelModel = axisModel.getModel('axisLabel');\n var labelMargin = labelModel.get('margin');\n var labels = axis.getViewLabels();\n // Special label rotate.\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI / 180;\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\n var labelEls = [];\n var silent = AxisBuilder.isLabelSilent(axisModel);\n var triggerEvent = axisModel.get('triggerEvent');\n each(labels, function (labelItem, index) {\n var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n var formattedLabel = labelItem.formattedLabel;\n var rawLabel = labelItem.rawLabel;\n var itemLabelModel = labelModel;\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\n }\n }\n var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']);\n var tickCoord = axis.dataToCoord(tickValue);\n var align = itemLabelModel.getShallow('align', true) || labelLayout.textAlign;\n var alignMin = retrieve2(itemLabelModel.getShallow('alignMinLabel', true), align);\n var alignMax = retrieve2(itemLabelModel.getShallow('alignMaxLabel', true), align);\n var verticalAlign = itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign;\n var verticalAlignMin = retrieve2(itemLabelModel.getShallow('verticalAlignMinLabel', true), verticalAlign);\n var verticalAlignMax = retrieve2(itemLabelModel.getShallow('verticalAlignMaxLabel', true), verticalAlign);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: opt.labelOffset + opt.labelDirection * labelMargin,\n rotation: labelLayout.rotation,\n silent: silent,\n z2: 10 + (labelItem.level || 0),\n style: createTextStyle(itemLabelModel, {\n text: formattedLabel,\n align: index === 0 ? alignMin : index === labels.length - 1 ? alignMax : align,\n verticalAlign: index === 0 ? verticalAlignMin : index === labels.length - 1 ? verticalAlignMax : verticalAlign,\n fill: isFunction(textColor) ? textColor(\n // (1) In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n // (2) Compatible with previous version, which always use formatted label as\n // input. But in interval scale the formatted label is like '223,445', which\n // maked user replace ','. So we modify it to return original val but remain\n // it as 'string' to avoid error in replacing.\n axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor\n })\n });\n textEl.anid = 'label_' + tickValue;\n // Pack data for mouse event\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = rawLabel;\n eventData.tickIndex = index;\n if (axis.type === 'category') {\n eventData.dataIndex = tickValue;\n }\n getECData(textEl).eventData = eventData;\n }\n // FIXME\n transformGroup.add(textEl);\n textEl.updateTransform();\n labelEls.push(textEl);\n group.add(textEl);\n textEl.decomposeTransform();\n });\n return labelEls;\n}\nexport default AxisBuilder;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Model from '../../model/Model.js';\nimport { each, curry, clone, defaults, isArray, indexOf } from 'zrender/lib/core/util.js';\n// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\nexport function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * triggerEmphasis,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api);\n // Check seriesInvolved for performance, in case too many series in some chart.\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}\nfunction collectAxesInfo(result, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var globalAxisPointerModel = ecModel.getComponent('axisPointer');\n // links can only be set on global.\n var linksOption = globalAxisPointerModel.get('link', true) || [];\n var linkGroups = [];\n // Collect axes info.\n each(api.getCoordinateSystems(), function (coordSys) {\n // Some coordinate system do not support axes, like geo.\n if (!coordSys.axisPointerEnabled) {\n return;\n }\n var coordSysKey = makeKey(coordSys.model);\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\n result.coordSysMap[coordSysKey] = coordSys;\n // Set tooltip (like 'cross') is a convenient way to show axisPointer\n // for user. So we enable setting tooltip on coordSys model.\n var coordSysModel = coordSys.model;\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\n // If axis tooltip used, choose tooltip axis for each coordSys.\n // Notice this case: coordSys is `grid` but not `cartesian2D` here.\n if (coordSys.getTooltipAxes && globalTooltipModel\n // If tooltip.showContent is set as false, tooltip will not\n // show but axisPointer will show as normal.\n && baseTooltipModel.get('show')) {\n // Compatible with previous logic. But series.tooltip.trigger: 'axis'\n // or series.data[n].tooltip.trigger: 'axis' are not support any more.\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\n if (triggerAxis || cross) {\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\n }\n if (cross) {\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\n }\n }\n // fromTooltip: true | false | 'cross'\n // triggerTooltip: true | false | null\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var triggerEmphasis = axisPointerModel.get('triggerEmphasis');\n var axisKey = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n var axisInfo = result.axesInfo[axisKey] = {\n key: axisKey,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n triggerEmphasis: triggerEmphasis,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: [],\n linkGroup: null\n };\n axesInfoInCoordSys[axisKey] = axisInfo;\n result.seriesInvolved = result.seriesInvolved || involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[axisKey] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }\n });\n}\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\n var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'];\n var volatileOption = {};\n each(fields, function (field) {\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\n });\n // category axis do not auto snap, otherwise some tick that do not\n // has value can not be hovered. value/time/log axis default snap if\n // triggered from tooltip and trigger tooltip.\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\n // Compatible with previous behavior, tooltip axis does not show label by default.\n // Only these properties can be overridden from tooltip to axisPointer.\n if (tooltipAxisPointerModel.get('type') === 'cross') {\n volatileOption.type = 'line';\n }\n var labelOption = volatileOption.label || (volatileOption.label = {});\n // Follow the convention, do not show label when triggered by tooltip by default.\n labelOption.show == null && (labelOption.show = false);\n if (fromTooltip === 'cross') {\n // When 'cross', both axes show labels.\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\n // If triggerTooltip, this is a base axis, which should better not use cross style\n // (cross style is dashed by default)\n if (!triggerTooltip) {\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\n crossStyle && defaults(labelOption, crossStyle.textStyle);\n }\n }\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\n}\nfunction collectSeriesInfo(result, ecModel) {\n // Prepare data for axis trigger\n ecModel.eachSeries(function (seriesModel) {\n // Notice this case: this coordSys is `cartesian2D` but not `grid`.\n var coordSys = seriesModel.coordinateSystem;\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\n if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) {\n return;\n }\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\n var axis = axisInfo.axis;\n if (coordSys.getAxis(axis.dim) === axis) {\n axisInfo.seriesModels.push(seriesModel);\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\n axisInfo.seriesDataCount += seriesModel.getData().count();\n }\n });\n });\n}\n/**\n * For example:\n * {\n * axisPointer: {\n * links: [{\n * xAxisIndex: [2, 4],\n * yAxisIndex: 'all'\n * }, {\n * xAxisId: ['a5', 'a7'],\n * xAxisName: 'xxx'\n * }]\n * }\n * }\n */\nfunction getLinkGroupIndex(linksOption, axis) {\n var axisModel = axis.model;\n var dim = axis.dim;\n for (var i = 0; i < linksOption.length; i++) {\n var linkOption = linksOption[i] || {};\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\n return i;\n }\n }\n}\nfunction checkPropInLink(linkPropValue, axisPropValue) {\n return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;\n}\nexport function fixValue(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n if (!axisInfo) {\n return;\n }\n var axisPointerModel = axisInfo.axisPointerModel;\n var scale = axisInfo.axis.scale;\n var option = axisPointerModel.option;\n var status = axisPointerModel.get('status');\n var value = axisPointerModel.get('value');\n // Parse init value for category and time axis.\n if (value != null) {\n value = scale.parse(value);\n }\n var useHandle = isHandleTrigger(axisPointerModel);\n // If `handle` used, `axisPointer` will always be displayed, so value\n // and status should be initialized.\n if (status == null) {\n option.status = useHandle ? 'show' : 'hide';\n }\n var extent = scale.getExtent().slice();\n extent[0] > extent[1] && extent.reverse();\n if (\n // Pick a value on axis when initializing.\n value == null\n // If both `handle` and `dataZoom` are used, value may be out of axis extent,\n // where we should re-pick a value to keep `handle` displaying normally.\n || value > extent[1]) {\n // Make handle displayed on the end of the axis when init, which looks better.\n value = extent[1];\n }\n if (value < extent[0]) {\n value = extent[0];\n }\n option.value = value;\n if (useHandle) {\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\n }\n}\nexport function getAxisInfo(axisModel) {\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo;\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\n}\nexport function getAxisPointerModel(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n return axisInfo && axisInfo.axisPointerModel;\n}\nfunction isHandleTrigger(axisPointerModel) {\n return !!axisPointerModel.get(['handle', 'show']);\n}\n/**\n * @param {module:echarts/model/Model} model\n * @return {string} unique key\n */\nexport function makeKey(model) {\n return model.type + '||' + model.id;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as axisPointerModelHelper from '../axisPointer/modelHelper.js';\nimport ComponentView from '../../view/Component.js';\nvar axisPointerClazz = {};\n/**\n * Base class of AxisView.\n */\nvar AxisView = /** @class */function (_super) {\n __extends(AxisView, _super);\n function AxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = AxisView.type;\n return _this;\n }\n /**\n * @override\n */\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n // FIXME\n // This process should proformed after coordinate systems updated\n // (axis scale updated), and should be performed each time update.\n // So put it here temporarily, although it is not appropriate to\n // put a model-writing procedure in `view`.\n this.axisPointerClass && axisPointerModelHelper.fixValue(axisModel);\n _super.prototype.render.apply(this, arguments);\n this._doUpdateAxisPointerClass(axisModel, api, true);\n };\n /**\n * Action handler.\n */\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\n this._doUpdateAxisPointerClass(axisModel, api, false);\n };\n /**\n * @override\n */\n AxisView.prototype.remove = function (ecModel, api) {\n var axisPointer = this._axisPointer;\n axisPointer && axisPointer.remove(api);\n };\n /**\n * @override\n */\n AxisView.prototype.dispose = function (ecModel, api) {\n this._disposeAxisPointer(api);\n _super.prototype.dispose.apply(this, arguments);\n };\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\n if (!Clazz) {\n return;\n }\n var axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel);\n axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api);\n };\n AxisView.prototype._disposeAxisPointer = function (api) {\n this._axisPointer && this._axisPointer.dispose(api);\n this._axisPointer = null;\n };\n AxisView.registerAxisPointerClass = function (type, clazz) {\n if (process.env.NODE_ENV !== 'production') {\n if (axisPointerClazz[type]) {\n throw new Error('axisPointer ' + type + ' exists');\n }\n }\n axisPointerClazz[type] = clazz;\n };\n ;\n AxisView.getAxisPointerClass = function (type) {\n return type && axisPointerClazz[type];\n };\n ;\n AxisView.type = 'axis';\n return AxisView;\n}(ComponentView);\nexport default AxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nexport function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n if (axis.scale.isBlank()) {\n return;\n }\n // TODO: TYPE\n var splitAreaModel = axisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var gridRect = gridModel.coordinateSystem.getRect();\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitAreaModel,\n clamp: true\n });\n if (!ticksCoords.length) {\n return;\n }\n // For Making appropriate splitArea animation, the color and anid\n // should be corresponding to previous one if possible.\n var areaColorsLen = areaColors.length;\n var lastSplitAreaColors = inner(axisView).splitAreaColors;\n var newSplitAreaColors = zrUtil.createHashMap();\n var colorIndex = 0;\n if (lastSplitAreaColors) {\n for (var i = 0; i < ticksCoords.length; i++) {\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n if (cIndex != null) {\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n break;\n }\n }\n }\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n var areaStyle = areaStyleModel.getAreaStyle();\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n for (var i = 1; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n if (axis.isHorizontal()) {\n x = prev;\n y = gridRect.y;\n width = tickCoord - x;\n height = gridRect.height;\n prev = x + width;\n } else {\n x = gridRect.x;\n y = prev;\n width = gridRect.width;\n height = tickCoord - y;\n prev = y + height;\n }\n var tickValue = ticksCoords[i - 1].tickValue;\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n axisGroup.add(new graphic.Rect({\n anid: tickValue != null ? 'area_' + tickValue : null,\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n },\n style: zrUtil.defaults({\n fill: areaColors[colorIndex]\n }, areaStyle),\n autoBatch: true,\n silent: true\n }));\n colorIndex = (colorIndex + 1) % areaColorsLen;\n }\n inner(axisView).splitAreaColors = newSplitAreaColors;\n}\nexport function rectCoordAxisHandleRemove(axisView) {\n inner(axisView).splitAreaColors = null;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];\nvar CartesianAxisView = /** @class */function (_super) {\n __extends(CartesianAxisView, _super);\n function CartesianAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CartesianAxisView.type;\n _this.axisPointerClass = 'CartesianAxisPointer';\n return _this;\n }\n /**\n * @override\n */\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n if (!axisModel.get('show')) {\n return;\n }\n var gridModel = axisModel.getCoordSysModel();\n var layout = cartesianAxisHelper.layout(gridModel, axisModel);\n var axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({\n handleAutoShown: function (elementType) {\n var cartesians = gridModel.coordinateSystem.getCartesians();\n for (var i = 0; i < cartesians.length; i++) {\n if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {\n // Still show axis tick or axisLine if other axis is value / log\n return true;\n }\n }\n // Not show axisTick or axisLine if other axis is category / time\n return false;\n }\n }, layout));\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n this._axisGroup.add(axisBuilder.getGroup());\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\n }\n }, this);\n // THIS is a special case for bar racing chart.\n // Update the axis label from the natural initial layout to\n // sorted layout should has no animation.\n var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort;\n if (!isInitialSortFromBarRacing) {\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n }\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n CartesianAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n CartesianAxisView.type = 'cartesianAxis';\n return CartesianAxisView;\n}(AxisView);\nvar axisElementBuilders = {\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n if (axis.scale.isBlank()) {\n return;\n }\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n var colorIndex = lineCount++ % lineColors.length;\n var tickValue = ticksCoords[i].tickValue;\n var line = new graphic.Line({\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: zrUtil.defaults({\n stroke: lineColors[colorIndex]\n }, lineStyle),\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n axisGroup.add(line);\n }\n },\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var minorTicksCoords = axis.getMinorTicksCoords();\n if (!minorTicksCoords.length) {\n return;\n }\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n var line = new graphic.Line({\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: lineStyle,\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n axisGroup.add(line);\n }\n }\n },\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\n }\n};\nvar CartesianXAxisView = /** @class */function (_super) {\n __extends(CartesianXAxisView, _super);\n function CartesianXAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n CartesianXAxisView.type = 'xAxis';\n return CartesianXAxisView;\n}(CartesianAxisView);\nexport { CartesianXAxisView };\nvar CartesianYAxisView = /** @class */function (_super) {\n __extends(CartesianYAxisView, _super);\n function CartesianYAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n CartesianYAxisView.type = 'yAxis';\n return CartesianYAxisView;\n}(CartesianAxisView);\nexport { CartesianYAxisView };\nexport default CartesianAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport GridModel from '../../coord/cartesian/GridModel.js';\nimport { Rect } from '../../util/graphic.js';\nimport { defaults } from 'zrender/lib/core/util.js';\nimport { CartesianAxisModel } from '../../coord/cartesian/AxisModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport Grid from '../../coord/cartesian/Grid.js';\nimport { CartesianXAxisView, CartesianYAxisView } from '../axis/CartesianAxisView.js';\n// Grid view\nvar GridView = /** @class */function (_super) {\n __extends(GridView, _super);\n function GridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'grid';\n return _this;\n }\n GridView.prototype.render = function (gridModel, ecModel) {\n this.group.removeAll();\n if (gridModel.get('show')) {\n this.group.add(new Rect({\n shape: gridModel.coordinateSystem.getRect(),\n style: defaults({\n fill: gridModel.get('backgroundColor')\n }, gridModel.getItemStyle()),\n silent: true,\n z2: -1\n }));\n }\n };\n GridView.type = 'grid';\n return GridView;\n}(ComponentView);\nvar extraOption = {\n // gridIndex: 0,\n // gridId: '',\n offset: 0\n};\nexport function install(registers) {\n registers.registerComponentView(GridView);\n registers.registerComponentModel(GridModel);\n registers.registerCoordinateSystem('cartesian2d', Grid);\n axisModelCreator(registers, 'x', CartesianAxisModel, extraOption);\n axisModelCreator(registers, 'y', CartesianAxisModel, extraOption);\n registers.registerComponentView(CartesianXAxisView);\n registers.registerComponentView(CartesianYAxisView);\n registers.registerPreprocessor(function (option) {\n // Only create grid when need\n if (option.xAxis && option.yAxis && !option.grid) {\n option.grid = {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport ScatterSeriesModel from './ScatterSeries.js';\nimport ScatterView from './ScatterView.js';\nimport { install as installGridSimple } from '../../component/grid/installSimple.js';\nimport layoutPoints from '../../layout/points.js';\nexport function install(registers) {\n // In case developer forget to include grid component\n use(installGridSimple);\n registers.registerSeriesModel(ScatterSeriesModel);\n registers.registerChartView(ScatterView);\n registers.registerLayout(layoutPoints('scatter'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarLayout(ecModel) {\n ecModel.eachSeriesByType('radar', function (seriesModel) {\n var data = seriesModel.getData();\n var points = [];\n var coordSys = seriesModel.coordinateSystem;\n if (!coordSys) {\n return;\n }\n var axes = coordSys.getIndicatorAxes();\n zrUtil.each(axes, function (axis, axisIndex) {\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\n points[dataIndex] = points[dataIndex] || [];\n var point = coordSys.dataToPoint(val, axisIndex);\n points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys);\n });\n });\n // Close polygon\n data.each(function (idx) {\n // TODO\n // Is it appropriate to connect to the next data when some data is missing?\n // Or, should trade it like `connectNull` in line chart?\n var firstPoint = zrUtil.find(points[idx], function (point) {\n return isValidPoint(point);\n }) || getValueMissingPoint(coordSys);\n // Copy the first actual point to the end of the array\n points[idx].push(firstPoint.slice());\n data.setItemLayout(idx, points[idx]);\n });\n });\n}\nfunction isValidPoint(point) {\n return !isNaN(point[0]) && !isNaN(point[1]);\n}\nfunction getValueMissingPoint(coordSys) {\n // It is error-prone to input [NaN, NaN] into polygon, polygon.\n // (probably cause problem when refreshing or animating)\n return [coordSys.cx, coordSys.cy];\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\n// Backward compat for radar chart in 2\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarBackwardCompat(option) {\n var polarOptArr = option.polar;\n if (polarOptArr) {\n if (!zrUtil.isArray(polarOptArr)) {\n polarOptArr = [polarOptArr];\n }\n var polarNotRadar_1 = [];\n zrUtil.each(polarOptArr, function (polarOpt, idx) {\n if (polarOpt.indicator) {\n if (polarOpt.type && !polarOpt.shape) {\n polarOpt.shape = polarOpt.type;\n }\n option.radar = option.radar || [];\n if (!zrUtil.isArray(option.radar)) {\n option.radar = [option.radar];\n }\n option.radar.push(polarOpt);\n } else {\n polarNotRadar_1.push(polarOpt);\n }\n });\n option.polar = polarNotRadar_1;\n }\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\n seriesOpt.radarIndex = seriesOpt.polarIndex;\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar RadarView = /** @class */function (_super) {\n __extends(RadarView, _super);\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = RadarView.type;\n return _this;\n }\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\n var polar = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n function createSymbol(data, idx) {\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n if (symbolType === 'none') {\n return;\n }\n var symbolSize = symbolUtil.normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2);\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\n symbolPath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 100,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2,\n rotation: symbolRotate * Math.PI / 180 || 0\n });\n return symbolPath;\n }\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n // Simply rerender all\n symbolGroup.removeAll();\n for (var i = 0; i < newPoints.length - 1; i++) {\n var symbolPath = createSymbol(data, idx);\n if (symbolPath) {\n symbolPath.__dimIdx = i;\n if (oldPoints[i]) {\n symbolPath.setPosition(oldPoints[i]);\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n x: newPoints[i][0],\n y: newPoints[i][1]\n }, seriesModel, idx);\n } else {\n symbolPath.setPosition(newPoints[i]);\n }\n symbolGroup.add(symbolPath);\n }\n }\n }\n function getInitialPoints(points) {\n return zrUtil.map(points, function (pt) {\n return [polar.cx, polar.cy];\n });\n }\n data.diff(oldData).add(function (idx) {\n var points = data.getItemLayout(idx);\n if (!points) {\n return;\n }\n var polygon = new graphic.Polygon();\n var polyline = new graphic.Polyline();\n var target = {\n shape: {\n points: points\n }\n };\n polygon.shape.points = getInitialPoints(points);\n polyline.shape.points = getInitialPoints(points);\n graphic.initProps(polygon, target, seriesModel, idx);\n graphic.initProps(polyline, target, seriesModel, idx);\n var itemGroup = new graphic.Group();\n var symbolGroup = new graphic.Group();\n itemGroup.add(polyline);\n itemGroup.add(polygon);\n itemGroup.add(symbolGroup);\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n data.setItemGraphicEl(idx, itemGroup);\n }).update(function (newIdx, oldIdx) {\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var target = {\n shape: {\n points: data.getItemLayout(newIdx)\n }\n };\n if (!target.shape.points) {\n return;\n }\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n saveOldStyle(polygon);\n saveOldStyle(polyline);\n graphic.updateProps(polyline, target, seriesModel);\n graphic.updateProps(polygon, target, seriesModel);\n data.setItemGraphicEl(newIdx, itemGroup);\n }).remove(function (idx) {\n group.remove(oldData.getItemGraphicEl(idx));\n }).execute();\n data.eachItemGraphicEl(function (itemGroup, idx) {\n var itemModel = data.getItemModel(idx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n // Radar uses the visual encoded from itemStyle.\n var itemStyle = data.getItemVisual(idx, 'style');\n var color = itemStyle.fill;\n group.add(itemGroup);\n polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n fill: 'none',\n stroke: color\n }));\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\n var areaStyleModel = itemModel.getModel('areaStyle');\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n polygon.ignore = polygonIgnore;\n zrUtil.each(['emphasis', 'select', 'blur'], function (stateName) {\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();\n // Won't be ignore if normal state is not ignore.\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\n });\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: color,\n opacity: 0.7,\n decal: itemStyle.decal\n }));\n var emphasisModel = itemModel.getModel('emphasis');\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n symbolGroup.eachChild(function (symbolPath) {\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, itemStyle));\n } else {\n symbolPath.useStyle(itemStyle);\n symbolPath.setColor(color);\n symbolPath.style.strokeNoScale = true;\n }\n var pathEmphasisState = symbolPath.ensureState('emphasis');\n pathEmphasisState.style = zrUtil.clone(itemHoverStyle);\n var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n labelDimIndex: symbolPath.__dimIdx,\n defaultText: defaultText,\n inheritColor: color,\n defaultOpacity: itemStyle.opacity\n });\n });\n toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n this._data = data;\n };\n RadarView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n RadarView.type = 'radar';\n return RadarView;\n}(ChartView);\nexport default RadarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup, retrieveVisualColorForTooltipMarker } from '../../component/tooltip/tooltipMarkup.js';\nvar RadarSeriesModel = /** @class */function (_super) {\n __extends(RadarSeriesModel, _super);\n function RadarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = RadarSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n // Overwrite\n RadarSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments);\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, {\n generateCoord: 'indicator_',\n generateCoordCount: Infinity\n });\n };\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var coordSys = this.coordinateSystem;\n var indicatorAxes = coordSys.getIndicatorAxes();\n var name = this.getData().getName(dataIndex);\n var nameToDisplay = name === '' ? this.name : name;\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\n return createTooltipMarkup('section', {\n header: nameToDisplay,\n sortBlocks: true,\n blocks: zrUtil.map(indicatorAxes, function (axis) {\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\n return createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: markerColor,\n name: axis.name,\n value: val,\n sortParam: val\n });\n })\n });\n };\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var data_1 = this.getData();\n var coordSys = this.coordinateSystem;\n var values = data_1.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data_1.mapDimension(dim);\n }), dataIndex);\n for (var i = 0, len = values.length; i < len; i++) {\n if (!isNaN(values[i])) {\n var indicatorAxes = coordSys.getIndicatorAxes();\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\n }\n }\n }\n };\n RadarSeriesModel.type = 'series.radar';\n RadarSeriesModel.dependencies = ['radar'];\n RadarSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n coordinateSystem: 'radar',\n legendHoverLink: true,\n radarIndex: 0,\n lineStyle: {\n width: 2,\n type: 'solid',\n join: 'round'\n },\n label: {\n position: 'top'\n },\n // areaStyle: {\n // },\n // itemStyle: {}\n symbolSize: 8\n // symbolRotate: null\n };\n\n return RadarSeriesModel;\n}(SeriesModel);\nexport default RadarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport axisDefault from '../axisDefault.js';\nimport Model from '../../model/Model.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport ComponentModel from '../../model/Component.js';\nvar valueAxisDefault = axisDefault.value;\nfunction defaultsShow(opt, show) {\n return zrUtil.defaults({\n show: show\n }, opt);\n}\nvar RadarModel = /** @class */function (_super) {\n __extends(RadarModel, _super);\n function RadarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = RadarModel.type;\n return _this;\n }\n RadarModel.prototype.optionUpdated = function () {\n var boundaryGap = this.get('boundaryGap');\n var splitNumber = this.get('splitNumber');\n var scale = this.get('scale');\n var axisLine = this.get('axisLine');\n var axisTick = this.get('axisTick');\n // let axisType = this.get('axisType');\n var axisLabel = this.get('axisLabel');\n var nameTextStyle = this.get('axisName');\n var showName = this.get(['axisName', 'show']);\n var nameFormatter = this.get(['axisName', 'formatter']);\n var nameGap = this.get('axisNameGap');\n var triggerEvent = this.get('triggerEvent');\n var indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {\n // PENDING\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\n indicatorOpt.min = 0;\n } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\n indicatorOpt.max = 0;\n }\n var iNameTextStyle = nameTextStyle;\n if (indicatorOpt.color != null) {\n iNameTextStyle = zrUtil.defaults({\n color: indicatorOpt.color\n }, nameTextStyle);\n }\n // Use same configuration\n var innerIndicatorOpt = zrUtil.merge(zrUtil.clone(indicatorOpt), {\n boundaryGap: boundaryGap,\n splitNumber: splitNumber,\n scale: scale,\n axisLine: axisLine,\n axisTick: axisTick,\n // axisType: axisType,\n axisLabel: axisLabel,\n // Compatible with 2 and use text\n name: indicatorOpt.text,\n showName: showName,\n nameLocation: 'end',\n nameGap: nameGap,\n // min: 0,\n nameTextStyle: iNameTextStyle,\n triggerEvent: triggerEvent\n }, false);\n if (zrUtil.isString(nameFormatter)) {\n var indName = innerIndicatorOpt.name;\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\n } else if (zrUtil.isFunction(nameFormatter)) {\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\n }\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\n zrUtil.mixin(model, AxisModelCommonMixin.prototype);\n // For triggerEvent.\n model.mainType = 'radar';\n model.componentIndex = this.componentIndex;\n return model;\n }, this);\n this._indicatorModels = indicatorModels;\n };\n RadarModel.prototype.getIndicatorModels = function () {\n return this._indicatorModels;\n };\n RadarModel.type = 'radar';\n RadarModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '75%',\n startAngle: 90,\n axisName: {\n show: true\n // formatter: null\n // textStyle: {}\n },\n\n boundaryGap: [0, 0],\n splitNumber: 5,\n axisNameGap: 15,\n scale: false,\n // Polygon or circle\n shape: 'polygon',\n axisLine: zrUtil.merge({\n lineStyle: {\n color: '#bbb'\n }\n }, valueAxisDefault.axisLine),\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\n // axisType: 'value',\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\n // {text, min, max}\n indicator: []\n };\n return RadarModel;\n}(ComponentModel);\nexport default RadarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar RadarView = /** @class */function (_super) {\n __extends(RadarView, _super);\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = RadarView.type;\n return _this;\n }\n RadarView.prototype.render = function (radarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n this._buildAxes(radarModel);\n this._buildSplitLineAndArea(radarModel);\n };\n RadarView.prototype._buildAxes = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n var axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {\n var axisName = indicatorAxis.model.get('showName') ? indicatorAxis.name : ''; // hide name\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\n axisName: axisName,\n position: [radar.cx, radar.cy],\n rotation: indicatorAxis.angle,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1\n });\n return axisBuilder;\n });\n zrUtil.each(axisBuilders, function (axisBuilder) {\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n this.group.add(axisBuilder.getGroup());\n }, this);\n };\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n if (!indicatorAxes.length) {\n return;\n }\n var shape = radarModel.get('shape');\n var splitLineModel = radarModel.getModel('splitLine');\n var splitAreaModel = radarModel.getModel('splitArea');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var showSplitLine = splitLineModel.get('show');\n var showSplitArea = splitAreaModel.get('show');\n var splitLineColors = lineStyleModel.get('color');\n var splitAreaColors = areaStyleModel.get('color');\n var splitLineColorsArr = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors];\n var splitAreaColorsArr = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\n var splitLines = [];\n var splitAreas = [];\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\n var colorIndex = idx % areaOrLineColorList.length;\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\n return colorIndex;\n }\n if (shape === 'circle') {\n var ticksRadius = indicatorAxes[0].getTicksCoords();\n var cx = radar.cx;\n var cy = radar.cy;\n for (var i = 0; i < ticksRadius.length; i++) {\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: cx,\n cy: cy,\n r: ticksRadius[i].coord\n }\n }));\n }\n if (showSplitArea && i < ticksRadius.length - 1) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\n splitAreas[colorIndex].push(new graphic.Ring({\n shape: {\n cx: cx,\n cy: cy,\n r0: ticksRadius[i].coord,\n r: ticksRadius[i + 1].coord\n }\n }));\n }\n }\n }\n // Polyyon\n else {\n var realSplitNumber_1;\n var axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) {\n var ticksCoords = indicatorAxis.getTicksCoords();\n realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1);\n return zrUtil.map(ticksCoords, function (tickCoord) {\n return radar.coordToPoint(tickCoord.coord, idx);\n });\n });\n var prevPoints = [];\n for (var i = 0; i <= realSplitNumber_1; i++) {\n var points = [];\n for (var j = 0; j < indicatorAxes.length; j++) {\n points.push(axesTicksPoints[j][i]);\n }\n // Close\n if (points[0]) {\n points.push(points[0].slice());\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Can\\'t draw value axis ' + i);\n }\n }\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Polyline({\n shape: {\n points: points\n }\n }));\n }\n if (showSplitArea && prevPoints) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\n splitAreas[colorIndex].push(new graphic.Polygon({\n shape: {\n points: points.concat(prevPoints)\n }\n }));\n }\n prevPoints = points.slice().reverse();\n }\n }\n var lineStyle = lineStyleModel.getLineStyle();\n var areaStyle = areaStyleModel.getAreaStyle();\n // Add splitArea before splitLine\n zrUtil.each(splitAreas, function (splitAreas, idx) {\n this.group.add(graphic.mergePath(splitAreas, {\n style: zrUtil.defaults({\n stroke: 'none',\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\n }, areaStyle),\n silent: true\n }));\n }, this);\n zrUtil.each(splitLines, function (splitLines, idx) {\n this.group.add(graphic.mergePath(splitLines, {\n style: zrUtil.defaults({\n fill: 'none',\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\n }, lineStyle),\n silent: true\n }));\n }, this);\n };\n RadarView.type = 'radar';\n return RadarView;\n}(ComponentView);\nexport default RadarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar IndicatorAxis = /** @class */function (_super) {\n __extends(IndicatorAxis, _super);\n function IndicatorAxis(dim, scale, radiusExtent) {\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\n _this.type = 'value';\n _this.angle = 0;\n _this.name = '';\n return _this;\n }\n return IndicatorAxis;\n}(Axis);\nexport default IndicatorAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO clockwise\nimport IndicatorAxis from './IndicatorAxis.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport * as numberUtil from '../../util/number.js';\nimport { map, each, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\nvar Radar = /** @class */function () {\n function Radar(radarModel, ecModel, api) {\n /**\n *\n * Radar dimensions\n */\n this.dimensions = [];\n this._model = radarModel;\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\n var dim = 'indicator_' + idx;\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale()\n // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()\n );\n\n indicatorAxis.name = indicatorModel.get('name');\n // Inject model and axis\n indicatorAxis.model = indicatorModel;\n indicatorModel.axis = indicatorAxis;\n this.dimensions.push(dim);\n return indicatorAxis;\n }, this);\n this.resize(radarModel, api);\n }\n Radar.prototype.getIndicatorAxes = function () {\n return this._indicatorAxes;\n };\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\n };\n // TODO: API should be coordToPoint([coord, indicatorIndex])\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n var angle = indicatorAxis.angle;\n var x = this.cx + coord * Math.cos(angle);\n var y = this.cy - coord * Math.sin(angle);\n return [x, y];\n };\n Radar.prototype.pointToData = function (pt) {\n var dx = pt[0] - this.cx;\n var dy = pt[1] - this.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx);\n // Find the closest angle\n // FIXME index can calculated directly\n var minRadianDiff = Infinity;\n var closestAxis;\n var closestAxisIdx = -1;\n for (var i = 0; i < this._indicatorAxes.length; i++) {\n var indicatorAxis = this._indicatorAxes[i];\n var diff = Math.abs(radian - indicatorAxis.angle);\n if (diff < minRadianDiff) {\n closestAxis = indicatorAxis;\n closestAxisIdx = i;\n minRadianDiff = diff;\n }\n }\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\n };\n Radar.prototype.resize = function (radarModel, api) {\n var center = radarModel.get('center');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\n this.cx = numberUtil.parsePercent(center[0], viewWidth);\n this.cy = numberUtil.parsePercent(center[1], viewHeight);\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180;\n // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`\n var radius = radarModel.get('radius');\n if (isString(radius) || isNumber(radius)) {\n radius = [0, radius];\n }\n this.r0 = numberUtil.parsePercent(radius[0], viewSize);\n this.r = numberUtil.parsePercent(radius[1], viewSize);\n each(this._indicatorAxes, function (indicatorAxis, idx) {\n indicatorAxis.setExtent(this.r0, this.r);\n var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length;\n // Normalize to [-PI, PI]\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\n indicatorAxis.angle = angle;\n }, this);\n };\n Radar.prototype.update = function (ecModel, api) {\n var indicatorAxes = this._indicatorAxes;\n var radarModel = this._model;\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\n });\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\n if (radarSeries.get('coordinateSystem') !== 'radar'\n // @ts-ignore\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\n return;\n }\n var data = radarSeries.getData();\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\n });\n }, this);\n var splitNumber = radarModel.get('splitNumber');\n var dummyScale = new IntervalScale();\n dummyScale.setExtent(0, splitNumber);\n dummyScale.setInterval(1);\n // Force all the axis fixing the maxSplitNumber.\n each(indicatorAxes, function (indicatorAxis, idx) {\n alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale);\n });\n };\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\n console.warn('Not implemented.');\n return null;\n };\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n console.warn('Not implemented.');\n return null;\n };\n Radar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n Radar.create = function (ecModel, api) {\n var radarList = [];\n ecModel.eachComponent('radar', function (radarModel) {\n var radar = new Radar(radarModel, ecModel, api);\n radarList.push(radar);\n radarModel.coordinateSystem = radar;\n });\n ecModel.eachSeriesByType('radar', function (radarSeries) {\n if (radarSeries.get('coordinateSystem') === 'radar') {\n // Inject coordinate system\n // @ts-ignore\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\n }\n });\n return radarList;\n };\n /**\n * Radar dimensions is based on the data\n */\n Radar.dimensions = [];\n return Radar;\n}();\nexport default Radar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport RadarModel from '../../coord/radar/RadarModel.js';\nimport RadarView from './RadarView.js';\nimport Radar from '../../coord/radar/Radar.js';\nexport function install(registers) {\n registers.registerCoordinateSystem('radar', Radar);\n registers.registerComponentModel(RadarModel);\n registers.registerComponentView(RadarView);\n registers.registerVisual({\n seriesType: 'radar',\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n // itemVisual symbol is for selected data\n data.each(function (idx) {\n data.setItemVisual(idx, 'legendIcon', 'roundRect');\n });\n // visual is for unselected data\n data.setVisual('legendIcon', 'roundRect');\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport radarLayout from '../radar/radarLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport backwardCompat from '../radar/backwardCompat.js';\nimport RadarView from './RadarView.js';\nimport RadarSeriesModel from './RadarSeries.js';\nimport { install as installRadarComponent } from '../../component/radar/install.js';\nexport function install(registers) {\n use(installRadarComponent);\n registers.registerChartView(RadarView);\n registers.registerSeriesModel(RadarSeriesModel);\n registers.registerLayout(radarLayout);\n registers.registerProcessor(dataFilter('radar'));\n registers.registerPreprocessor(backwardCompat);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as echarts from '../../core/echarts.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar ATTR = '\\0_ec_interaction_mutex';\nexport function take(zr, resourceKey, userKey) {\n var store = getStore(zr);\n store[resourceKey] = userKey;\n}\nexport function release(zr, resourceKey, userKey) {\n var store = getStore(zr);\n var uKey = store[resourceKey];\n if (uKey === userKey) {\n store[resourceKey] = null;\n }\n}\nexport function isTaken(zr, resourceKey) {\n return !!getStore(zr)[resourceKey];\n}\nfunction getStore(zr) {\n return zr[ATTR] || (zr[ATTR] = {});\n}\n/**\n * payload: {\n * type: 'takeGlobalCursor',\n * key: 'dataZoomSelect', or 'brush', or ...,\n * If no userKey, release global cursor.\n * }\n */\n// TODO: SELF REGISTERED.\necharts.registerAction({\n type: 'takeGlobalCursor',\n event: 'globalCursorTaken',\n update: 'update'\n}, noop);","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport { isString, bind, defaults, clone } from 'zrender/lib/core/util.js';\n;\nvar RoamController = /** @class */function (_super) {\n __extends(RoamController, _super);\n function RoamController(zr) {\n var _this = _super.call(this) || this;\n _this._zr = zr;\n // Avoid two roamController bind the same handler\n var mousedownHandler = bind(_this._mousedownHandler, _this);\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\n var mouseupHandler = bind(_this._mouseupHandler, _this);\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\n var pinchHandler = bind(_this._pinchHandler, _this);\n /**\n * Notice: only enable needed types. For example, if 'zoom'\n * is not needed, 'zoom' should not be enabled, otherwise\n * default mousewheel behaviour (scroll page) will be disabled.\n */\n _this.enable = function (controlType, opt) {\n // Disable previous first\n this.disable();\n this._opt = defaults(clone(opt) || {}, {\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n // By default, wheel do not trigger move.\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n if (controlType == null) {\n controlType = true;\n }\n if (controlType === true || controlType === 'move' || controlType === 'pan') {\n zr.on('mousedown', mousedownHandler);\n zr.on('mousemove', mousemoveHandler);\n zr.on('mouseup', mouseupHandler);\n }\n if (controlType === true || controlType === 'scale' || controlType === 'zoom') {\n zr.on('mousewheel', mousewheelHandler);\n zr.on('pinch', pinchHandler);\n }\n };\n _this.disable = function () {\n zr.off('mousedown', mousedownHandler);\n zr.off('mousemove', mousemoveHandler);\n zr.off('mouseup', mouseupHandler);\n zr.off('mousewheel', mousewheelHandler);\n zr.off('pinch', pinchHandler);\n };\n return _this;\n }\n RoamController.prototype.isDragging = function () {\n return this._dragging;\n };\n RoamController.prototype.isPinching = function () {\n return this._pinching;\n };\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\n this.pointerChecker = pointerChecker;\n };\n RoamController.prototype.dispose = function () {\n this.disable();\n };\n RoamController.prototype._mousedownHandler = function (e) {\n if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n return;\n }\n var el = e.target;\n while (el) {\n if (el.draggable) {\n return;\n }\n // check if host is draggable\n el = el.__hostTarget || el.parent;\n }\n var x = e.offsetX;\n var y = e.offsetY;\n // Only check on mosedown, but not mousemove.\n // Mouse can be out of target when mouse moving.\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\n this._x = x;\n this._y = y;\n this._dragging = true;\n }\n };\n RoamController.prototype._mousemoveHandler = function (e) {\n if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n var x = e.offsetX;\n var y = e.offsetY;\n var oldX = this._x;\n var oldY = this._y;\n var dx = x - oldX;\n var dy = y - oldY;\n this._x = x;\n this._y = y;\n this._opt.preventDefaultMouseMove && eventTool.stop(e.event);\n trigger(this, 'pan', 'moveOnMouseMove', e, {\n dx: dx,\n dy: dy,\n oldX: oldX,\n oldY: oldY,\n newX: x,\n newY: y,\n isAvailableBehavior: null\n });\n };\n RoamController.prototype._mouseupHandler = function (e) {\n if (!eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n this._dragging = false;\n }\n };\n RoamController.prototype._mousewheelHandler = function (e) {\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\n var wheelDelta = e.wheelDelta;\n var absWheelDeltaDelta = Math.abs(wheelDelta);\n var originX = e.offsetX;\n var originY = e.offsetY;\n // wheelDelta maybe -0 in chrome mac.\n if (wheelDelta === 0 || !shouldZoom && !shouldMove) {\n return;\n }\n // If both `shouldZoom` and `shouldMove` is true, trigger\n // their event both, and the final behavior is determined\n // by event listener themselves.\n if (shouldZoom) {\n // Convenience:\n // Mac and VM Windows on Mac: scroll up: zoom out.\n // Windows: scroll up: zoom in.\n // FIXME: Should do more test in different environment.\n // wheelDelta is too complicated in difference nvironment\n // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n // although it has been normallized by zrender.\n // wheelDelta of mouse wheel is bigger than touch pad.\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\n var scale = wheelDelta > 0 ? factor : 1 / factor;\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\n scale: scale,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n if (shouldMove) {\n // FIXME: Should do more test in different environment.\n var absDelta = Math.abs(wheelDelta);\n // wheelDelta of mouse wheel is bigger than touch pad.\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\n scrollDelta: scrollDelta,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n };\n RoamController.prototype._pinchHandler = function (e) {\n if (interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\n checkPointerAndTrigger(this, 'zoom', null, e, {\n scale: scale,\n originX: e.pinchX,\n originY: e.pinchY,\n isAvailableBehavior: null\n });\n };\n return RoamController;\n}(Eventful);\nfunction checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\n // When mouse is out of roamController rect,\n // default befavoius should not be be disabled, otherwise\n // page sliding is disabled, contrary to expectation.\n eventTool.stop(e.event);\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\n }\n}\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n // Also provide behavior checker for event listener, for some case that\n // multiple components share one listener.\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\n // TODO should not have type issue.\n controller.trigger(eventName, contollerEvent);\n}\n// settings: {\n// zoomOnMouseWheel\n// moveOnMouseMove\n// moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\n var setting = settings[behaviorToCheck];\n return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']);\n}\nexport default RoamController;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * For geo and graph.\n */\nexport function updateViewOnPan(controllerHost, dx, dy) {\n var target = controllerHost.target;\n target.x += dx;\n target.y += dy;\n target.dirty();\n}\n/**\n * For geo and graph.\n */\nexport function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n var target = controllerHost.target;\n var zoomLimit = controllerHost.zoomLimit;\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n newZoom *= zoomDelta;\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n }\n var zoomScale = newZoom / controllerHost.zoom;\n controllerHost.zoom = newZoom;\n // Keep the mouse center when scaling\n target.x -= (zoomX - target.x) * (zoomScale - 1);\n target.y -= (zoomY - target.y) * (zoomScale - 1);\n target.scaleX *= zoomScale;\n target.scaleY *= zoomScale;\n target.dirty();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar IRRELEVANT_EXCLUDES = {\n 'axisPointer': 1,\n 'tooltip': 1,\n 'brush': 1\n};\n/**\n * Avoid that: mouse click on a elements that is over geo or graph,\n * but roam is triggered.\n */\nexport function onIrrelevantElement(e, api, targetCoordSysModel) {\n var model = api.getComponentByElement(e.topTarget);\n // If model is axisModel, it works only if it is injected with coordinateSystem.\n var coordSys = model && model.coordinateSystem;\n return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n}","import { isString } from '../core/util.js';\nexport function parseXML(svg) {\n if (isString(svg)) {\n var parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n }\n var svgNode = svg;\n if (svgNode.nodeType === 9) {\n svgNode = svgNode.firstChild;\n }\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\n svgNode = svgNode.nextSibling;\n }\n return svgNode;\n}\n","import Group from '../graphic/Group.js';\nimport ZRImage from '../graphic/Image.js';\nimport Circle from '../graphic/shape/Circle.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Ellipse from '../graphic/shape/Ellipse.js';\nimport Line from '../graphic/shape/Line.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Polyline from '../graphic/shape/Polyline.js';\nimport * as matrix from '../core/matrix.js';\nimport { createFromString } from './path.js';\nimport { defaults, trim, each, map, keys, hasOwn } from '../core/util.js';\nimport LinearGradient from '../graphic/LinearGradient.js';\nimport RadialGradient from '../graphic/RadialGradient.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { parseXML } from './parseXML.js';\n;\nvar nodeParsers;\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-anchor': 'textAlign',\n 'visibility': 'visibility',\n 'display': 'display'\n};\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP);\nvar SELF_STYLE_ATTRIBUTES_MAP = {\n 'alignment-baseline': 'textBaseline',\n 'stop-color': 'stopColor'\n};\nvar SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP);\nvar SVGParser = (function () {\n function SVGParser() {\n this._defs = {};\n this._root = null;\n }\n SVGParser.prototype.parse = function (xml, opt) {\n opt = opt || {};\n var svg = parseXML(xml);\n if (process.env.NODE_ENV !== 'production') {\n if (!svg) {\n throw new Error('Illegal svg');\n }\n }\n this._defsUsePending = [];\n var root = new Group();\n this._root = root;\n var named = [];\n var viewBox = svg.getAttribute('viewBox') || '';\n var width = parseFloat((svg.getAttribute('width') || opt.width));\n var height = parseFloat((svg.getAttribute('height') || opt.height));\n isNaN(width) && (width = null);\n isNaN(height) && (height = null);\n parseAttributes(svg, root, null, true, false);\n var child = svg.firstChild;\n while (child) {\n this._parseNode(child, root, named, null, false, false);\n child = child.nextSibling;\n }\n applyDefs(this._defs, this._defsUsePending);\n this._defsUsePending = [];\n var viewBoxRect;\n var viewBoxTransform;\n if (viewBox) {\n var viewBoxArr = splitNumberSequence(viewBox);\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat((viewBoxArr[0] || 0)),\n y: parseFloat((viewBoxArr[1] || 0)),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width: width, height: height });\n if (!opt.ignoreViewBox) {\n var elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\n elRoot.x = viewBoxTransform.x;\n elRoot.y = viewBoxTransform.y;\n }\n }\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: { x: 0, y: 0, width: width, height: height }\n }));\n }\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform,\n named: named\n };\n };\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) {\n var nodeName = xmlNode.nodeName.toLowerCase();\n var el;\n var namedFromForSub = namedFrom;\n if (nodeName === 'defs') {\n isInDefs = true;\n }\n if (nodeName === 'text') {\n isInText = true;\n }\n if (nodeName === 'defs' || nodeName === 'switch') {\n el = parentGroup;\n }\n else {\n if (!isInDefs) {\n var parser_1 = nodeParsers[nodeName];\n if (parser_1 && hasOwn(nodeParsers, nodeName)) {\n el = parser_1.call(this, xmlNode, parentGroup);\n var nameAttr = xmlNode.getAttribute('name');\n if (nameAttr) {\n var newNamed = {\n name: nameAttr,\n namedFrom: null,\n svgNodeTagLower: nodeName,\n el: el\n };\n named.push(newNamed);\n if (nodeName === 'g') {\n namedFromForSub = newNamed;\n }\n }\n else if (namedFrom) {\n named.push({\n name: namedFrom.name,\n namedFrom: namedFrom,\n svgNodeTagLower: nodeName,\n el: el\n });\n }\n parentGroup.add(el);\n }\n }\n var parser = paintServerParsers[nodeName];\n if (parser && hasOwn(paintServerParsers, nodeName)) {\n var def = parser.call(this, xmlNode);\n var id = xmlNode.getAttribute('id');\n if (id) {\n this._defs[id] = def;\n }\n }\n }\n if (el && el.isGroup) {\n var child = xmlNode.firstChild;\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText);\n }\n else if (child.nodeType === 3 && isInText) {\n this._parseText(child, el);\n }\n child = child.nextSibling;\n }\n }\n };\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n var text = new TSpan({\n style: {\n text: xmlNode.textContent\n },\n silent: true,\n x: this._textX || 0,\n y: this._textY || 0\n });\n inheritStyle(parentGroup, text);\n parseAttributes(xmlNode, text, this._defsUsePending, false, false);\n applyTextAlignment(text, parentGroup);\n var textStyle = text.style;\n var fontSize = textStyle.fontSize;\n if (fontSize && fontSize < 9) {\n textStyle.fontSize = 9;\n text.scaleX *= fontSize / 9;\n text.scaleY *= fontSize / 9;\n }\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\n textStyle.fontStyle,\n textStyle.fontWeight,\n (textStyle.fontSize || 12) + 'px',\n textStyle.fontFamily || 'sans-serif'\n ].join(' ');\n textStyle.font = font;\n var rect = text.getBoundingRect();\n this._textX += rect.width;\n parentGroup.add(text);\n return text;\n };\n SVGParser.internalField = (function () {\n nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, false);\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n var rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defsUsePending, false, false);\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\n height: parseFloat(xmlNode.getAttribute('height') || '0')\n });\n rect.silent = true;\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n var circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defsUsePending, false, false);\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n r: parseFloat(xmlNode.getAttribute('r') || '0')\n });\n circle.silent = true;\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n var line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defsUsePending, false, false);\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\n });\n line.silent = true;\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n var ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\n });\n ellipse.silent = true;\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polygon = new Polygon({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polyline = new Polyline({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polyline);\n parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n var img = new ZRImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defsUsePending, false, false);\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href') || xmlNode.getAttribute('href'),\n x: +xmlNode.getAttribute('x'),\n y: +xmlNode.getAttribute('y'),\n width: +xmlNode.getAttribute('width'),\n height: +xmlNode.getAttribute('height')\n });\n img.silent = true;\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x') || '0';\n var y = xmlNode.getAttribute('y') || '0';\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x');\n var y = xmlNode.getAttribute('y');\n if (x != null) {\n this._textX = parseFloat(x);\n }\n if (y != null) {\n this._textY = parseFloat(y);\n }\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n var d = xmlNode.getAttribute('d') || '';\n var path = createFromString(d);\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defsUsePending, false, false);\n path.silent = true;\n return path;\n }\n };\n })();\n return SVGParser;\n}());\nvar paintServerParsers = {\n 'lineargradient': function (xmlNode) {\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\n var gradient = new LinearGradient(x1, y1, x2, y2);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n },\n 'radialgradient': function (xmlNode) {\n var cx = parseInt(xmlNode.getAttribute('cx') || '0', 10);\n var cy = parseInt(xmlNode.getAttribute('cy') || '0', 10);\n var r = parseInt(xmlNode.getAttribute('r') || '0', 10);\n var gradient = new RadialGradient(cx, cy, r);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n }\n};\nfunction parsePaintServerUnit(xmlNode, gradient) {\n var gradientUnits = xmlNode.getAttribute('gradientUnits');\n if (gradientUnits === 'userSpaceOnUse') {\n gradient.global = true;\n }\n}\nfunction parseGradientColorStops(xmlNode, gradient) {\n var stop = xmlNode.firstChild;\n while (stop) {\n if (stop.nodeType === 1\n && stop.nodeName.toLocaleLowerCase() === 'stop') {\n var offsetStr = stop.getAttribute('offset');\n var offset = void 0;\n if (offsetStr && offsetStr.indexOf('%') > 0) {\n offset = parseInt(offsetStr, 10) / 100;\n }\n else if (offsetStr) {\n offset = parseFloat(offsetStr);\n }\n else {\n offset = 0;\n }\n var styleVals = {};\n parseInlineStyle(stop, styleVals, styleVals);\n var stopColor = styleVals.stopColor\n || stop.getAttribute('stop-color')\n || '#000000';\n gradient.colorStops.push({\n offset: offset,\n color: stopColor\n });\n }\n stop = stop.nextSibling;\n }\n}\nfunction inheritStyle(parent, child) {\n if (parent && parent.__inheritedStyle) {\n if (!child.__inheritedStyle) {\n child.__inheritedStyle = {};\n }\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\n }\n}\nfunction parsePoints(pointsString) {\n var list = splitNumberSequence(pointsString);\n var points = [];\n for (var i = 0; i < list.length; i += 2) {\n var x = parseFloat(list[i]);\n var y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n return points;\n}\nfunction parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {\n var disp = el;\n var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};\n var selfStyle = {};\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n parseInlineStyle(xmlNode, inheritedStyle, selfStyle);\n if (!onlyInlineStyle) {\n parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);\n }\n }\n disp.style = disp.style || {};\n if (inheritedStyle.fill != null) {\n disp.style.fill = getFillStrokeStyle(disp, 'fill', inheritedStyle.fill, defsUsePending);\n }\n if (inheritedStyle.stroke != null) {\n disp.style.stroke = getFillStrokeStyle(disp, 'stroke', inheritedStyle.stroke, defsUsePending);\n }\n each([\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = parseFloat(inheritedStyle[propName]);\n }\n });\n each([\n 'lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = inheritedStyle[propName];\n }\n });\n if (isTextGroup) {\n disp.__selfStyle = selfStyle;\n }\n if (inheritedStyle.lineDash) {\n disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) {\n return parseFloat(str);\n });\n }\n if (inheritedStyle.visibility === 'hidden' || inheritedStyle.visibility === 'collapse') {\n disp.invisible = true;\n }\n if (inheritedStyle.display === 'none') {\n disp.ignore = true;\n }\n}\nfunction applyTextAlignment(text, parentGroup) {\n var parentSelfStyle = parentGroup.__selfStyle;\n if (parentSelfStyle) {\n var textBaseline = parentSelfStyle.textBaseline;\n var zrTextBaseline = textBaseline;\n if (!textBaseline || textBaseline === 'auto') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'baseline') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'before-edge' || textBaseline === 'text-before-edge') {\n zrTextBaseline = 'top';\n }\n else if (textBaseline === 'after-edge' || textBaseline === 'text-after-edge') {\n zrTextBaseline = 'bottom';\n }\n else if (textBaseline === 'central' || textBaseline === 'mathematical') {\n zrTextBaseline = 'middle';\n }\n text.style.textBaseline = zrTextBaseline;\n }\n var parentInheritedStyle = parentGroup.__inheritedStyle;\n if (parentInheritedStyle) {\n var textAlign = parentInheritedStyle.textAlign;\n var zrTextAlign = textAlign;\n if (textAlign) {\n if (textAlign === 'middle') {\n zrTextAlign = 'center';\n }\n text.style.textAlign = zrTextAlign;\n }\n }\n}\nvar urlRegex = /^url\\(\\s*#(.*?)\\)/;\nfunction getFillStrokeStyle(el, method, str, defsUsePending) {\n var urlMatch = str && str.match(urlRegex);\n if (urlMatch) {\n var url = trim(urlMatch[1]);\n defsUsePending.push([el, method, url]);\n return;\n }\n if (str === 'none') {\n str = null;\n }\n return str;\n}\nfunction applyDefs(defs, defsUsePending) {\n for (var i = 0; i < defsUsePending.length; i++) {\n var item = defsUsePending[i];\n item[0].style[item[1]] = defs[item[2]];\n }\n}\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction splitNumberSequence(rawStr) {\n return rawStr.match(numberReg) || [];\n}\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.eE,]*)\\)/g;\nvar DEGREE_TO_ANGLE = Math.PI / 180;\nfunction parseTransformAttribute(xmlNode, node) {\n var transform = xmlNode.getAttribute('transform');\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n var transformOps_1 = [];\n var mt = null;\n transform.replace(transformRegex, function (str, type, value) {\n transformOps_1.push(type, value);\n return '';\n });\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\n var value = transformOps_1[i];\n var type = transformOps_1[i - 1];\n var valueArr = splitNumberSequence(value);\n mt = mt || matrix.create();\n switch (type) {\n case 'translate':\n matrix.translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\n break;\n case 'scale':\n matrix.scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\n break;\n case 'rotate':\n matrix.rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [\n parseFloat(valueArr[1] || '0'),\n parseFloat(valueArr[2] || '0')\n ]);\n break;\n case 'skewX':\n var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, 0, sx, 1, 0, 0], mt);\n break;\n case 'skewY':\n var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, sy, 0, 1, 0, 0], mt);\n break;\n case 'matrix':\n mt[0] = parseFloat(valueArr[0]);\n mt[1] = parseFloat(valueArr[1]);\n mt[2] = parseFloat(valueArr[2]);\n mt[3] = parseFloat(valueArr[3]);\n mt[4] = parseFloat(valueArr[4]);\n mt[5] = parseFloat(valueArr[5]);\n break;\n }\n }\n node.setLocalTransform(mt);\n }\n}\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\nfunction parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n var style = xmlNode.getAttribute('style');\n if (!style) {\n return;\n }\n styleRegex.lastIndex = 0;\n var styleRegResult;\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n var svgStlAttr = styleRegResult[1];\n var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrInheritableStlAttr) {\n inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];\n }\n var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrSelfStlAttr) {\n selfStyleResult[zrSelfStlAttr] = styleRegResult[2];\n }\n }\n}\nfunction parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n}\nexport function makeViewBoxTransform(viewBoxRect, boundingRect) {\n var scaleX = boundingRect.width / viewBoxRect.width;\n var scaleY = boundingRect.height / viewBoxRect.height;\n var scale = Math.min(scaleX, scaleY);\n return {\n scale: scale,\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2)\n };\n}\nexport function parseSVG(xml, opt) {\n var parser = new SVGParser();\n return parser.parse(xml, opt);\n}\nexport { parseXML };\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseSVG, makeViewBoxTransform } from 'zrender/lib/tool/parseSVG.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport { assert, createHashMap, each } from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parseXML } from 'zrender/lib/tool/parseXML.js';\nimport { GeoSVGRegion } from './Region.js';\n/**\n * \"region available\" means that: enable users to set attribute `name=\"xxx\"` on those tags\n * to make it be a region.\n * 1. region styles and its label styles can be defined in echarts opton:\n * ```js\n * geo: {\n * regions: [{\n * name: 'xxx',\n * itemStyle: { ... },\n * label: { ... }\n * }, {\n * ...\n * },\n * ...]\n * };\n * ```\n * 2. name can be duplicated in different SVG tag. All of the tags with the same name share\n * a region option. For exampel if there are two representing two lung lobes. They have\n * no common parents but both of them need to display label \"lung\" inside.\n */\nvar REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path',\n// are also enabled because some SVG might paint text itself,\n// but still need to trigger events or tooltip.\n'text', 'tspan',\n// is also enabled because this case: if multiple tags share one name\n// and need label displayed, every tags will display the name, which is not\n// expected. So we can put them into a . Thereby only one label\n// displayed and located based on the bounding rect of the .\n'g']);\nvar GeoSVGResource = /** @class */function () {\n function GeoSVGResource(mapName, svg) {\n this.type = 'geoSVG';\n // All used graphics. key: hostKey, value: root\n this._usedGraphicMap = createHashMap();\n // All unused graphics.\n this._freedGraphics = [];\n this._mapName = mapName;\n // Only perform parse to XML object here, which might be time\n // consiming for large SVG.\n // Although convert XML to zrender element is also time consiming,\n // if we do it here, the clone of zrender elements has to be\n // required. So we do it once for each geo instance, util real\n // performance issues call for optimizing it.\n this._parsedXML = parseXML(svg);\n }\n GeoSVGResource.prototype.load = function /* nameMap: NameMap */\n () {\n // In the \"load\" stage, graphic need to be built to\n // get boundingRect for geo coordinate system.\n var firstGraphic = this._firstGraphic;\n // Create the return data structure only when first graphic created.\n // Because they will be used in geo coordinate system update stage,\n // and `regions` will be mounted at `geo` coordinate system,\n // in which there is no \"view\" info, so that it should better not to\n // make references to graphic elements.\n if (!firstGraphic) {\n firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);\n this._freedGraphics.push(firstGraphic);\n this._boundingRect = this._firstGraphic.boundingRect.clone();\n // PENDING: `nameMap` will not be supported until some real requirement come.\n // if (nameMap) {\n // named = applyNameMap(named, nameMap);\n // }\n var _a = createRegions(firstGraphic.named),\n regions = _a.regions,\n regionsMap = _a.regionsMap;\n this._regions = regions;\n this._regionsMap = regionsMap;\n }\n return {\n boundingRect: this._boundingRect,\n regions: this._regions,\n regionsMap: this._regionsMap\n };\n };\n GeoSVGResource.prototype._buildGraphic = function (svgXML) {\n var result;\n var rootFromParse;\n try {\n result = svgXML && parseSVG(svgXML, {\n ignoreViewBox: true,\n ignoreRootClip: true\n }) || {};\n rootFromParse = result.root;\n assert(rootFromParse != null);\n } catch (e) {\n throw new Error('Invalid svg format\\n' + e.message);\n }\n // Note: we keep the covenant that the root has no transform. So always add an extra root.\n var root = new Group();\n root.add(rootFromParse);\n root.isGeoSVGGraphicRoot = true;\n // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]\n //\n // Consider: ``\n // - the `width/height` we call it `svgWidth/svgHeight` for short.\n // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,\n // \"viewport boundingRect\", or `boundingRect` for short.\n // - `viewBox` defines the transform from the real content ot the viewport.\n // `viewBox` has the same unit as the content of SVG.\n // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become\n // different from the content of SVG. Otherwise, they are the same.\n //\n // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:\n // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).\n // 1. Make a transform from `viewBox` to `boundingRect`.\n // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve\n // the aspect ratio.\n // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])\n // (`Geo`/`View` will do this job).\n // Note: this transform might not preserve aspect radio, which depending on how users specify\n // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,\n // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).\n //\n // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG\n // layout look good.\n //\n // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect\n // of the SVG content and use them to make SVG layout look good.\n var svgWidth = result.width;\n var svgHeight = result.height;\n var viewBoxRect = result.viewBoxRect;\n var boundingRect = this._boundingRect;\n if (!boundingRect) {\n var bRectX = void 0;\n var bRectY = void 0;\n var bRectWidth = void 0;\n var bRectHeight = void 0;\n if (svgWidth != null) {\n bRectX = 0;\n bRectWidth = svgWidth;\n } else if (viewBoxRect) {\n bRectX = viewBoxRect.x;\n bRectWidth = viewBoxRect.width;\n }\n if (svgHeight != null) {\n bRectY = 0;\n bRectHeight = svgHeight;\n } else if (viewBoxRect) {\n bRectY = viewBoxRect.y;\n bRectHeight = viewBoxRect.height;\n }\n // If both viewBox and svgWidth/svgHeight not specified,\n // we have to determine how to layout those element to make them look good.\n if (bRectX == null || bRectY == null) {\n var calculatedBoundingRect = rootFromParse.getBoundingRect();\n if (bRectX == null) {\n bRectX = calculatedBoundingRect.x;\n bRectWidth = calculatedBoundingRect.width;\n }\n if (bRectY == null) {\n bRectY = calculatedBoundingRect.y;\n bRectHeight = calculatedBoundingRect.height;\n }\n }\n boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);\n }\n if (viewBoxRect) {\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect);\n // Only support `preserveAspectRatio 'xMidYMid'`\n rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;\n rootFromParse.x = viewBoxTransform.x;\n rootFromParse.y = viewBoxTransform.y;\n }\n // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.\n // They do not strictly confine all of the content inside a display rect, but deliberately\n // use a `viewBox` to define a displayable rect.\n // PENDING:\n // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the\n // edge might also be clipped, because region labels are put as `textContent` of the SVG path.\n root.setClipPath(new Rect({\n shape: boundingRect.plain()\n }));\n var named = [];\n each(result.named, function (namedItem) {\n if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {\n named.push(namedItem);\n setSilent(namedItem.el);\n }\n });\n return {\n root: root,\n boundingRect: boundingRect,\n named: named\n };\n };\n /**\n * Consider:\n * (1) One graphic element can not be shared by different `geoView` running simultaneously.\n * Notice, also need to consider multiple echarts instances share a `mapRecord`.\n * (2) Converting SVG to graphic elements is time consuming.\n * (3) In the current architecture, `load` should be called frequently to get boundingRect,\n * and it is called without view info.\n * So we maintain graphic elements in this module, and enables `view` to use/return these\n * graphics from/to the pool with it's uid.\n */\n GeoSVGResource.prototype.useGraphic = function (hostKey /* , nameMap: NameMap */) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n if (svgGraphic) {\n return svgGraphic;\n }\n svgGraphic = this._freedGraphics.pop()\n // use the first boundingRect to avoid duplicated boundingRect calculation.\n || this._buildGraphic(this._parsedXML);\n usedRootMap.set(hostKey, svgGraphic);\n // PENDING: `nameMap` will not be supported until some real requirement come.\n // `nameMap` can only be obtained from echarts option.\n // The original `named` must not be modified.\n // if (nameMap) {\n // svgGraphic = extend({}, svgGraphic);\n // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap);\n // }\n return svgGraphic;\n };\n GeoSVGResource.prototype.freeGraphic = function (hostKey) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n if (svgGraphic) {\n usedRootMap.removeKey(hostKey);\n this._freedGraphics.push(svgGraphic);\n }\n };\n return GeoSVGResource;\n}();\nexport { GeoSVGResource };\nfunction setSilent(el) {\n // Only named element has silent: false, other elements should\n // act as background and has no user interaction.\n el.silent = false;\n // text|tspan will be converted to group.\n if (el.isGroup) {\n el.traverse(function (child) {\n child.silent = false;\n });\n }\n}\nfunction createRegions(named) {\n var regions = [];\n var regionsMap = createHashMap();\n // Create resions only for the first graphic.\n each(named, function (namedItem) {\n // Region has feature to calculate center for tooltip or other features.\n // If there is a , the center should be the center of the\n // bounding rect of the g.\n if (namedItem.namedFrom != null) {\n return;\n }\n var region = new GeoSVGRegion(namedItem.name, namedItem.el);\n // PENDING: if `nameMap` supported, this region can not be mounted on\n // `this`, but can only be created each time `load()` called.\n regions.push(region);\n // PENDING: if multiple tag named with the same name, only one will be\n // found by `_regionsMap`. `_regionsMap` is used to find a coordinate\n // by name. We use `region.getCenter()` as the coordinate.\n regionsMap.set(namedItem.name, region);\n });\n return {\n regions: regions,\n regionsMap: regionsMap\n };\n}\n// PENDING: `nameMap` will not be supported until some real requirement come.\n// /**\n// * Use the alias in geoNameMap.\n// * The input `named` must not be modified.\n// */\n// function applyNameMap(\n// named: GeoSVGGraphicRecord['named'],\n// nameMap: NameMap\n// ): GeoSVGGraphicRecord['named'] {\n// const result = [] as GeoSVGGraphicRecord['named'];\n// for (let i = 0; i < named.length; i++) {\n// let regionGraphic = named[i];\n// const name = regionGraphic.name;\n// if (nameMap && nameMap.hasOwnProperty(name)) {\n// regionGraphic = extend({}, regionGraphic);\n// regionGraphic.name = name;\n// }\n// result.push(regionGraphic);\n// }\n// return result;\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for 南海诸岛\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONRegion } from '../Region.js';\nvar geoCoord = [126, 25];\nvar nanhaiName = '南海诸岛';\nvar points = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];\nfor (var i = 0; i < points.length; i++) {\n for (var k = 0; k < points[i].length; k++) {\n points[i][k][0] /= 10.5;\n points[i][k][1] /= -10.5 / 0.75;\n points[i][k][0] += geoCoord[0];\n points[i][k][1] += geoCoord[1];\n }\n}\nexport default function fixNanhai(mapType, regions) {\n if (mapType === 'china') {\n for (var i = 0; i < regions.length; i++) {\n // Already exists.\n if (regions[i].name === nanhaiName) {\n return;\n }\n }\n regions.push(new GeoJSONRegion(nanhaiName, zrUtil.map(points, function (exterior) {\n return {\n type: 'polygon',\n exterior: exterior\n };\n }), geoCoord));\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar coordsOffsetMap = {\n '南海诸岛': [32, 80],\n // 全国\n '广东': [0, -10],\n '香港': [10, 5],\n '澳门': [-10, 10],\n // '北京': [-10, 0],\n '天津': [5, 5]\n};\nexport default function fixTextCoords(mapType, region) {\n if (mapType === 'china') {\n var coordFix = coordsOffsetMap[region.name];\n if (coordFix) {\n var cp = region.getCenter();\n cp[0] += coordFix[0] / 10.5;\n cp[1] += -coordFix[1] / (10.5 / 0.75);\n region.setCenter(cp);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for 钓鱼岛\n// let Region = require('../Region');\n// let zrUtil = require('zrender/lib/core/util');\n// let geoCoord = [126, 25];\nvar points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];\nexport default function fixDiaoyuIsland(mapType, region) {\n if (mapType === 'china' && region.name === '台湾') {\n region.geometries.push({\n type: 'polygon',\n exterior: points[0]\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString, createHashMap, hasOwn } from 'zrender/lib/core/util.js';\nimport parseGeoJson from './parseGeoJson.js';\n// Built-in GEO fixer.\nimport fixNanhai from './fix/nanhai.js';\nimport fixTextCoord from './fix/textCoord.js';\nimport fixDiaoyuIsland from './fix/diaoyuIsland.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nvar DEFAULT_NAME_PROPERTY = 'name';\nvar GeoJSONResource = /** @class */function () {\n function GeoJSONResource(mapName, geoJSON, specialAreas) {\n this.type = 'geoJSON';\n this._parsedMap = createHashMap();\n this._mapName = mapName;\n this._specialAreas = specialAreas;\n // PENDING: delay the parse to the first usage to rapid up the FMP?\n this._geoJSON = parseInput(geoJSON);\n }\n /**\n * @param nameMap can be null/undefined\n * @param nameProperty can be null/undefined\n */\n GeoJSONResource.prototype.load = function (nameMap, nameProperty) {\n nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;\n var parsed = this._parsedMap.get(nameProperty);\n if (!parsed) {\n var rawRegions = this._parseToRegions(nameProperty);\n parsed = this._parsedMap.set(nameProperty, {\n regions: rawRegions,\n boundingRect: calculateBoundingRect(rawRegions)\n });\n }\n var regionsMap = createHashMap();\n var finalRegions = [];\n each(parsed.regions, function (region) {\n var regionName = region.name;\n // Try use the alias in geoNameMap\n if (nameMap && hasOwn(nameMap, regionName)) {\n region = region.cloneShallow(regionName = nameMap[regionName]);\n }\n finalRegions.push(region);\n regionsMap.set(regionName, region);\n });\n return {\n regions: finalRegions,\n boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),\n regionsMap: regionsMap\n };\n };\n GeoJSONResource.prototype._parseToRegions = function (nameProperty) {\n var mapName = this._mapName;\n var geoJSON = this._geoJSON;\n var rawRegions;\n // https://jsperf.com/try-catch-performance-overhead\n try {\n rawRegions = geoJSON ? parseGeoJson(geoJSON, nameProperty) : [];\n } catch (e) {\n throw new Error('Invalid geoJson format\\n' + e.message);\n }\n fixNanhai(mapName, rawRegions);\n each(rawRegions, function (region) {\n var regionName = region.name;\n fixTextCoord(mapName, region);\n fixDiaoyuIsland(mapName, region);\n // Some area like Alaska in USA map needs to be tansformed\n // to look better\n var specialArea = this._specialAreas && this._specialAreas[regionName];\n if (specialArea) {\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\n }\n }, this);\n return rawRegions;\n };\n /**\n * Only for exporting to users.\n * **MUST NOT** used internally.\n */\n GeoJSONResource.prototype.getMapForUser = function () {\n return {\n // For backward compatibility, use geoJson\n // PENDING: it has been returning them without clone.\n // do we need to avoid outsite modification?\n geoJson: this._geoJSON,\n geoJSON: this._geoJSON,\n specialAreas: this._specialAreas\n };\n };\n return GeoJSONResource;\n}();\nexport { GeoJSONResource };\nfunction calculateBoundingRect(regions) {\n var rect;\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect();\n rect = rect || regionRect.clone();\n rect.union(regionRect);\n }\n return rect;\n}\nfunction parseInput(source) {\n return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\nimport { GeoSVGResource } from './GeoSVGResource.js';\nimport { GeoJSONResource } from './GeoJSONResource.js';\nvar storage = createHashMap();\nexport default {\n /**\n * Compatible with previous `echarts.registerMap`.\n *\n * @usage\n * ```js\n *\n * echarts.registerMap('USA', geoJson, specialAreas);\n *\n * echarts.registerMap('USA', {\n * geoJson: geoJson,\n * specialAreas: {...}\n * });\n * echarts.registerMap('USA', {\n * geoJSON: geoJson,\n * specialAreas: {...}\n * });\n *\n * echarts.registerMap('airport', {\n * svg: svg\n * }\n * ```\n *\n * Note:\n * Do not support that register multiple geoJSON or SVG\n * one map name. Because different geoJSON and SVG have\n * different unit. It's not easy to make sure how those\n * units are mapping/normalize.\n * If intending to use multiple geoJSON or SVG, we can\n * use multiple geo coordinate system.\n */\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\n if (rawDef.svg) {\n var resource = new GeoSVGResource(mapName, rawDef.svg);\n storage.set(mapName, resource);\n } else {\n // Recommend:\n // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });\n // Backward compatibility:\n // echarts.registerMap('eu', geoJSON, specialAreas);\n // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });\n var geoJSON = rawDef.geoJson || rawDef.geoJSON;\n if (geoJSON && !rawDef.features) {\n rawSpecialAreas = rawDef.specialAreas;\n } else {\n geoJSON = rawDef;\n }\n var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);\n storage.set(mapName, resource);\n }\n },\n getGeoResource: function (mapName) {\n return storage.get(mapName);\n },\n /**\n * Only for exporting to users.\n * **MUST NOT** used internally.\n */\n getMapForUser: function (mapName) {\n var resource = storage.get(mapName);\n // Do not support return SVG until some real requirement come.\n return resource && resource.type === 'geoJSON' && resource.getMapForUser();\n },\n load: function (mapName, nameMap, nameProperty) {\n var resource = storage.get(mapName);\n if (!resource) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\n }\n return;\n }\n return resource.load(nameMap, nameProperty);\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport RoamController from './RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enableComponentHighDownFeatures, setDefaultStateProxy } from '../../util/states.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { getUID } from '../../util/component.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner } from '../../util/model.js';\n/**\n * Only these tags enable use `itemStyle` if they are named in SVG.\n * Other tags like might not suitable for `itemStyle`.\n * They will not be considered to be styled until some requirements come.\n */\nvar OPTION_STYLE_ENABLED_TAGS = ['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path'];\nvar OPTION_STYLE_ENABLED_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS);\nvar STATE_TRIGGER_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar LABEL_HOST_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar mapLabelRaw = makeInner();\nfunction getFixedItemStyle(model) {\n var itemStyle = model.getItemStyle();\n var areaColor = model.get('areaColor');\n // If user want the color not to be changed when hover,\n // they should both set areaColor and color to be null.\n if (areaColor != null) {\n itemStyle.fill = areaColor;\n }\n return itemStyle;\n}\n// Only stroke can be used for line.\n// Using fill in style if stroke not exits.\n// TODO Not sure yet. Perhaps a separate `lineStyle`?\nfunction fixLineStyle(styleHost) {\n var style = styleHost.style;\n if (style) {\n style.stroke = style.stroke || style.fill;\n style.fill = null;\n }\n}\nvar MapDraw = /** @class */function () {\n function MapDraw(api) {\n var group = new graphic.Group();\n this.uid = getUID('ec_map_draw');\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n this.group = group;\n group.add(this._regionsGroup = new graphic.Group());\n group.add(this._svgGroup = new graphic.Group());\n }\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\n var isGeo = mapOrGeoModel.mainType === 'geo';\n // Map series has data. GEO model that controlled by map series\n // will be assigned with map data. Other GEO model has no data.\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n isGeo && ecModel.eachComponent({\n mainType: 'series',\n subType: 'map'\n }, function (mapSeries) {\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n data = mapSeries.getData();\n }\n });\n var geo = mapOrGeoModel.coordinateSystem;\n var regionsGroup = this._regionsGroup;\n var group = this.group;\n var transformInfo = geo.getTransformInfo();\n var transformInfoRaw = transformInfo.raw;\n var transformInfoRoam = transformInfo.roam;\n // No animation when first draw or in action\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\n if (isFirstDraw) {\n group.x = transformInfoRoam.x;\n group.y = transformInfoRoam.y;\n group.scaleX = transformInfoRoam.scaleX;\n group.scaleY = transformInfoRoam.scaleY;\n group.dirty();\n } else {\n graphic.updateProps(group, transformInfoRoam, mapOrGeoModel);\n }\n var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0;\n var viewBuildCtx = {\n api: api,\n geo: geo,\n mapOrGeoModel: mapOrGeoModel,\n data: data,\n isVisualEncodedByVisualMap: isVisualEncodedByVisualMap,\n isGeo: isGeo,\n transformInfoRaw: transformInfoRaw\n };\n if (geo.resourceType === 'geoJSON') {\n this._buildGeoJSON(viewBuildCtx);\n } else if (geo.resourceType === 'geoSVG') {\n this._buildSVG(viewBuildCtx);\n }\n this._updateController(mapOrGeoModel, ecModel, api);\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\n };\n MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) {\n var regionsGroupByName = this._regionsGroupByName = zrUtil.createHashMap();\n var regionsInfoByName = zrUtil.createHashMap();\n var regionsGroup = this._regionsGroup;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n var projection = viewBuildCtx.geo.projection;\n var projectionStream = projection && projection.stream;\n function transformPoint(point, project) {\n if (project) {\n // projection may return null point.\n point = project(point);\n }\n return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y];\n }\n ;\n function transformPolygonPoints(inPoints) {\n var outPoints = [];\n // If projectionStream is provided. Use it instead of single point project.\n var project = !projectionStream && projection && projection.project;\n for (var i = 0; i < inPoints.length; ++i) {\n var newPt = transformPoint(inPoints[i], project);\n newPt && outPoints.push(newPt);\n }\n return outPoints;\n }\n function getPolyShape(points) {\n return {\n shape: {\n points: transformPolygonPoints(points)\n }\n };\n }\n regionsGroup.removeAll();\n // Only when the resource is GeoJSON, there is `geo.regions`.\n zrUtil.each(viewBuildCtx.geo.regions, function (region) {\n var regionName = region.name;\n // Consider in GeoJson properties.name may be duplicated, for example,\n // there is multiple region named \"United Kindom\" or \"France\" (so many\n // colonies). And it is not appropriate to merge them in geo, which\n // will make them share the same label and bring trouble in label\n // location calculation.\n var regionGroup = regionsGroupByName.get(regionName);\n var _a = regionsInfoByName.get(regionName) || {},\n dataIdx = _a.dataIdx,\n regionModel = _a.regionModel;\n if (!regionGroup) {\n regionGroup = regionsGroupByName.set(regionName, new graphic.Group());\n regionsGroup.add(regionGroup);\n dataIdx = data ? data.indexOfName(regionName) : null;\n regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null;\n regionsInfoByName.set(regionName, {\n dataIdx: dataIdx,\n regionModel: regionModel\n });\n }\n var polygonSubpaths = [];\n var polylineSubpaths = [];\n zrUtil.each(region.geometries, function (geometry) {\n // Polygon and MultiPolygon\n if (geometry.type === 'polygon') {\n var polys = [geometry.exterior].concat(geometry.interiors || []);\n if (projectionStream) {\n polys = projectPolys(polys, projectionStream);\n }\n zrUtil.each(polys, function (poly) {\n polygonSubpaths.push(new graphic.Polygon(getPolyShape(poly)));\n });\n }\n // LineString and MultiLineString\n else {\n var points = geometry.points;\n if (projectionStream) {\n points = projectPolys(points, projectionStream, true);\n }\n zrUtil.each(points, function (points) {\n polylineSubpaths.push(new graphic.Polyline(getPolyShape(points)));\n });\n }\n });\n var centerPt = transformPoint(region.getCenter(), projection && projection.project);\n function createCompoundPath(subpaths, isLine) {\n if (!subpaths.length) {\n return;\n }\n var compoundPath = new graphic.CompoundPath({\n culling: true,\n segmentIgnoreThreshold: 1,\n shape: {\n paths: subpaths\n }\n });\n regionGroup.add(compoundPath);\n applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel);\n resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt);\n if (isLine) {\n fixLineStyle(compoundPath);\n zrUtil.each(compoundPath.states, fixLineStyle);\n }\n }\n createCompoundPath(polygonSubpaths);\n createCompoundPath(polylineSubpaths, true);\n });\n // Ensure children have been added to `regionGroup` before calling them.\n regionsGroupByName.each(function (regionGroup, regionName) {\n var _a = regionsInfoByName.get(regionName),\n dataIdx = _a.dataIdx,\n regionModel = _a.regionModel;\n resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n }, this);\n };\n MapDraw.prototype._buildSVG = function (viewBuildCtx) {\n var mapName = viewBuildCtx.geo.map;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n this._svgGroup.x = transformInfoRaw.x;\n this._svgGroup.y = transformInfoRaw.y;\n this._svgGroup.scaleX = transformInfoRaw.scaleX;\n this._svgGroup.scaleY = transformInfoRaw.scaleY;\n if (this._svgResourceChanged(mapName)) {\n this._freeSVG();\n this._useSVG(mapName);\n }\n var svgDispatcherMap = this._svgDispatcherMap = zrUtil.createHashMap();\n var focusSelf = false;\n zrUtil.each(this._svgGraphicRecord.named, function (namedItem) {\n // Note that we also allow different elements have the same name.\n // For example, a glyph of a city and the label of the city have\n // the same name and their tooltip info can be defined in a single\n // region option.\n var regionName = namedItem.name;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n var svgNodeTagLower = namedItem.svgNodeTagLower;\n var el = namedItem.el;\n var dataIdx = data ? data.indexOfName(regionName) : null;\n var regionModel = mapOrGeoModel.getRegionModel(regionName);\n if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) {\n applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);\n }\n if (el instanceof Displayable) {\n el.culling = true;\n }\n // We do not know how the SVG like so we'd better not to change z2.\n // Otherwise it might bring some unexpected result. For example,\n // an area hovered that make some inner city can not be clicked.\n el.z2EmphasisLift = 0;\n // If self named:\n if (!namedItem.namedFrom) {\n // label should batter to be displayed based on the center of \n // if it is named rather than displayed on each child.\n if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {\n resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null);\n }\n resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {\n var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n if (focus_1 === 'self') {\n focusSelf = true;\n }\n var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);\n els.push(el);\n }\n }\n }, this);\n this._enableBlurEntireSVG(focusSelf, viewBuildCtx);\n };\n MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) {\n // It's a little complicated to support blurring the entire geoSVG in series-map.\n // So do not support it until some requirements come.\n // At present, in series-map, only regions can be blurred.\n if (focusSelf && viewBuildCtx.isGeo) {\n var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle();\n // Only support `opacity` here. Because not sure that other props are suitable for\n // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).\n var opacity_1 = blurStyle.opacity;\n this._svgGraphicRecord.root.traverse(function (el) {\n if (!el.isGroup) {\n // PENDING: clear those settings to SVG elements when `_freeSVG`.\n // (Currently it happen not to be needed.)\n setDefaultStateProxy(el);\n var style = el.ensureState('blur').style || {};\n // Do not overwrite the region style that already set from region option.\n if (style.opacity == null && opacity_1 != null) {\n style.opacity = opacity_1;\n }\n // If `ensureState('blur').style = {}`, there will be default opacity.\n // Enable `stateTransition` (animation).\n el.ensureState('emphasis');\n }\n });\n }\n };\n MapDraw.prototype.remove = function () {\n this._regionsGroup.removeAll();\n this._regionsGroupByName = null;\n this._svgGroup.removeAll();\n this._freeSVG();\n this._controller.dispose();\n this._controllerHost = null;\n };\n MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) {\n if (name == null) {\n return [];\n }\n var geo = geoModel.coordinateSystem;\n if (geo.resourceType === 'geoJSON') {\n var regionsGroupByName = this._regionsGroupByName;\n if (regionsGroupByName) {\n var regionGroup = regionsGroupByName.get(name);\n return regionGroup ? [regionGroup] : [];\n }\n } else if (geo.resourceType === 'geoSVG') {\n return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];\n }\n };\n MapDraw.prototype._svgResourceChanged = function (mapName) {\n return this._svgMapName !== mapName;\n };\n MapDraw.prototype._useSVG = function (mapName) {\n var resource = geoSourceManager.getGeoResource(mapName);\n if (resource && resource.type === 'geoSVG') {\n var svgGraphic = resource.useGraphic(this.uid);\n this._svgGroup.add(svgGraphic.root);\n this._svgGraphicRecord = svgGraphic;\n this._svgMapName = mapName;\n }\n };\n MapDraw.prototype._freeSVG = function () {\n var mapName = this._svgMapName;\n if (mapName == null) {\n return;\n }\n var resource = geoSourceManager.getGeoResource(mapName);\n if (resource && resource.type === 'geoSVG') {\n resource.freeGraphic(this.uid);\n }\n this._svgGraphicRecord = null;\n this._svgDispatcherMap = null;\n this._svgGroup.removeAll();\n this._svgMapName = null;\n };\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\n var geo = mapOrGeoModel.coordinateSystem;\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n // @ts-ignore FIXME:TS\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n controllerHost.zoom = geo.getZoom();\n // roamType is will be set default true if it is null\n // @ts-ignore FIXME:TS\n controller.enable(mapOrGeoModel.get('roam') || false);\n var mainType = mapOrGeoModel.mainType;\n function makeActionBase() {\n var action = {\n type: 'geoRoam',\n componentType: mainType\n };\n action[mainType + 'Id'] = mapOrGeoModel.id;\n return action;\n }\n controller.off('pan').on('pan', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n dx: e.dx,\n dy: e.dy,\n animation: {\n duration: 0\n }\n }));\n }, this);\n controller.off('zoom').on('zoom', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n totalZoom: controllerHost.zoom,\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY,\n animation: {\n duration: 0\n }\n }));\n }, this);\n controller.setPointerChecker(function (e, x, y) {\n return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel);\n });\n };\n /**\n * FIXME: this is a temporarily workaround.\n * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like\n * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`\n * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified\n * props will have no chance to be restored.\n * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in\n * `renderSeries` will cache the modified `ignore` to `el._normalState`.\n * TODO:\n * Use clone/immutable in `LabelManager`?\n */\n MapDraw.prototype.resetForLabelLayout = function () {\n this.group.traverse(function (el) {\n var label = el.getTextContent();\n if (label) {\n label.ignore = mapLabelRaw(label).ignore;\n }\n });\n };\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\n var mapDraw = this;\n regionsGroup.off('mousedown');\n regionsGroup.off('click');\n // @ts-ignore FIXME:TS resolve type conflict\n if (mapOrGeoModel.get('selectedMode')) {\n regionsGroup.on('mousedown', function () {\n mapDraw._mouseDownFlag = true;\n });\n regionsGroup.on('click', function (e) {\n if (!mapDraw._mouseDownFlag) {\n return;\n }\n mapDraw._mouseDownFlag = false;\n });\n }\n };\n return MapDraw;\n}();\n;\nfunction applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {\n // All of the path are using `itemStyle`, because\n // (1) Some SVG also use fill on polyline (The different between\n // polyline and polygon is \"open\" or \"close\" but not fill or not).\n // (2) For the common props like opacity, if some use itemStyle\n // and some use `lineStyle`, it might confuse users.\n // (3) Most SVG use , where can not detect whether to draw a \"line\"\n // or a filled shape, so use `itemStyle` for .\n var normalStyleModel = regionModel.getModel('itemStyle');\n var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']);\n var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']);\n var selectStyleModel = regionModel.getModel(['select', 'itemStyle']);\n // NOTE: DON'T use 'style' in visual when drawing map.\n // This component is used for drawing underlying map for both geo component and map series.\n var normalStyle = getFixedItemStyle(normalStyleModel);\n var emphasisStyle = getFixedItemStyle(emphasisStyleModel);\n var selectStyle = getFixedItemStyle(selectStyleModel);\n var blurStyle = getFixedItemStyle(blurStyleModel);\n // Update the itemStyle if has data visual\n var data = viewBuildCtx.data;\n if (data) {\n // Only visual color of each item will be used. It can be encoded by visualMap\n // But visual color of series is used in symbol drawing\n // Visual color for each series is for the symbol draw\n var style = data.getItemVisual(dataIndex, 'style');\n var decal = data.getItemVisual(dataIndex, 'decal');\n if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {\n normalStyle.fill = style.fill;\n }\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);\n }\n }\n // SVG text, tspan and image can be named but not supporeted\n // to be styled by region option yet.\n el.setStyle(normalStyle);\n el.style.strokeNoScale = true;\n el.ensureState('emphasis').style = emphasisStyle;\n el.ensureState('select').style = selectStyle;\n el.ensureState('blur').style = blurStyle;\n // Enable blur\n setDefaultStateProxy(el);\n}\nfunction resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel,\n// Exist only if `viewBuildCtx.data` exists.\ndataIdx,\n// If labelXY not provided, use `textConfig.position: 'inside'`\nlabelXY) {\n var data = viewBuildCtx.data;\n var isGeo = viewBuildCtx.isGeo;\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n var itemLayout = data && data.getItemLayout(dataIdx);\n // In the following cases label will be drawn\n // 1. In map series and data value is NaN\n // 2. In geo component\n // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout\n if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {\n var query = !isGeo ? dataIdx : regionName;\n var labelFetcher = void 0;\n // Consider dataIdx not found.\n if (!data || dataIdx >= 0) {\n labelFetcher = mapOrGeoModel;\n }\n var specifiedTextOpt = labelXY ? {\n normal: {\n align: 'center',\n verticalAlign: 'middle'\n }\n } : null;\n // Caveat: must be called after `setDefaultStateProxy(el);` called.\n // because textContent will be assign with `el.stateProxy` inside.\n setLabelStyle(el, getLabelStatesModels(regionModel), {\n labelFetcher: labelFetcher,\n labelDataIndex: query,\n defaultText: regionName\n }, specifiedTextOpt);\n var textEl = el.getTextContent();\n if (textEl) {\n mapLabelRaw(textEl).ignore = textEl.ignore;\n if (el.textConfig && labelXY) {\n // Compute a relative offset based on the el bounding rect.\n var rect = el.getBoundingRect().clone();\n // Need to make sure the percent position base on the same rect in normal and\n // emphasis state. Otherwise if using boundingRect of el, but the emphasis state\n // has borderWidth (even 0.5px), the text position will be changed obviously\n // if the position is very big like ['1234%', '1345%'].\n el.textConfig.layoutRect = rect;\n el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%'];\n }\n }\n // PENDING:\n // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified.\n // But el.dataIndex is also used to determine whether user event should be triggered,\n // where el.seriesIndex or el.dataModel must be specified. At present for a single el\n // there is not case that \"only label layout enabled but user event disabled\", so here\n // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`.\n el.disableLabelAnimation = true;\n } else {\n el.removeTextContent();\n el.removeTextConfig();\n el.disableLabelAnimation = null;\n }\n}\nfunction resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel,\n// Exist only if `viewBuildCtx.data` exists.\ndataIdx) {\n // setItemGraphicEl, setHoverStyle after all polygons and labels\n // are added to the regionGroup\n if (viewBuildCtx.data) {\n // FIXME: when series-map use a SVG map, and there are duplicated name specified\n // on different SVG elements, after `data.setItemGraphicEl(...)`:\n // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip\n // can be triggered only mouse hover. That's correct.\n // (2) only the last element will be kept in `data`, so that if trigger tooltip\n // by `dispatchAction`, only the last one can be found and triggered. That might be\n // not correct. We will fix it in future if anyone demanding that.\n viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);\n }\n // series-map will not trigger \"geoselectchange\" no matter it is\n // based on a declared geo component. Because series-map will\n // trigger \"selectchange\". If it trigger both the two events,\n // If users call `chart.dispatchAction({type: 'toggleSelect'})`,\n // it not easy to also fire event \"geoselectchanged\".\n else {\n // Package custom mouse event for geo component\n getECData(eventTrigger).eventData = {\n componentType: 'geo',\n componentIndex: mapOrGeoModel.componentIndex,\n geoIndex: mapOrGeoModel.componentIndex,\n name: regionName,\n region: regionModel && regionModel.option || {}\n };\n }\n}\nfunction resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n if (!viewBuildCtx.data) {\n graphic.setTooltipConfig({\n el: el,\n componentModel: mapOrGeoModel,\n itemName: regionName,\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n itemTooltipOption: regionModel.get('tooltip')\n });\n }\n}\nfunction resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n var emphasisModel = regionModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n if (viewBuildCtx.isGeo) {\n enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);\n }\n return focus;\n}\nfunction projectPolys(rings,\n// Polygons include exterior and interiors. Or polylines.\ncreateStream, isLine) {\n var polygons = [];\n var curPoly;\n function startPolygon() {\n curPoly = [];\n }\n function endPolygon() {\n if (curPoly.length) {\n polygons.push(curPoly);\n curPoly = [];\n }\n }\n var stream = createStream({\n polygonStart: startPolygon,\n polygonEnd: endPolygon,\n lineStart: startPolygon,\n lineEnd: endPolygon,\n point: function (x, y) {\n // May have NaN values from stream.\n if (isFinite(x) && isFinite(y)) {\n curPoly.push([x, y]);\n }\n },\n sphere: function () {}\n });\n !isLine && stream.polygonStart();\n zrUtil.each(rings, function (ring) {\n stream.lineStart();\n for (var i = 0; i < ring.length; i++) {\n stream.point(ring[i][0], ring[i][1]);\n }\n stream.lineEnd();\n });\n !isLine && stream.polygonEnd();\n return polygons;\n}\nexport default MapDraw;\n// @ts-ignore FIXME:TS fix the \"compatible with each other\"?","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport MapDraw from '../../component/helper/MapDraw.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { setStatesFlag, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nvar MapView = /** @class */function (_super) {\n __extends(MapView, _super);\n function MapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MapView.type;\n return _this;\n }\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\n // Not render if it is an toggleSelect action from self\n if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) {\n return;\n }\n var group = this.group;\n group.removeAll();\n if (mapModel.getHostGeoModel()) {\n return;\n }\n if (this._mapDraw && payload && payload.type === 'geoRoam') {\n this._mapDraw.resetForLabelLayout();\n }\n // Not update map if it is an roam action from self\n if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) {\n if (mapModel.needsDrawMap) {\n var mapDraw = this._mapDraw || new MapDraw(api);\n group.add(mapDraw.group);\n mapDraw.draw(mapModel, ecModel, api, this, payload);\n this._mapDraw = mapDraw;\n } else {\n // Remove drawn map\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n }\n } else {\n var mapDraw = this._mapDraw;\n mapDraw && group.add(mapDraw.group);\n }\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api);\n };\n MapView.prototype.remove = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n this.group.removeAll();\n };\n MapView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n };\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\n var originalData = mapModel.originalData;\n var group = this.group;\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\n if (isNaN(value)) {\n return;\n }\n var layout = originalData.getItemLayout(originalDataIndex);\n if (!layout || !layout.point) {\n // Not exists in map\n return;\n }\n var point = layout.point;\n var offset = layout.offset;\n var circle = new graphic.Circle({\n style: {\n // Because the special of map draw.\n // Which needs statistic of multiple series and draw on one map.\n // And each series also need a symbol with legend color\n //\n // Layout and visual are put one the different data\n // TODO\n fill: mapModel.getData().getVisual('style').fill\n },\n shape: {\n cx: point[0] + offset * 9,\n cy: point[1],\n r: 3\n },\n silent: true,\n // Do not overlap the first series, on which labels are displayed.\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\n });\n // Only the series that has the first value on the same region is in charge of rendering the label.\n // But consider the case:\n // series: [\n // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},\n // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}\n // ]\n // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.\n // For backward compatibility, we follow the rule that render label `A` by the\n // settings on series `X` but render label `C` by the settings on series `Y`.\n if (!offset) {\n var fullData = mapModel.mainSeries.getData();\n var name_1 = originalData.getName(originalDataIndex);\n var fullIndex_1 = fullData.indexOfName(name_1);\n var itemModel = originalData.getItemModel(originalDataIndex);\n var labelModel = itemModel.getModel('label');\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1);\n // `getFormattedLabel` needs to use `getData` inside. Here\n // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.\n // FIXME\n // If this is not the `mainSeries`, the item model (like label formatter)\n // set on original data item will never get. But it has been working\n // like that from the beginning, and this scenario is rarely encountered.\n // So it won't be fixed until we have to.\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\n labelFetcher: {\n getFormattedLabel: function (idx, state) {\n return mapModel.getFormattedLabel(fullIndex_1, state);\n }\n },\n defaultText: name_1\n });\n circle.disableLabelAnimation = true;\n if (!labelModel.get('position')) {\n circle.setTextConfig({\n position: 'bottom'\n });\n }\n regionGroup.onHoverStateChange = function (toState) {\n setStatesFlag(circle, toState);\n };\n }\n group.add(circle);\n });\n };\n MapView.type = 'map';\n return MapView;\n}(ChartView);\nexport default MapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { createSymbol } from '../../util/symbol.js';\nvar MapSeries = /** @class */function (_super) {\n __extends(MapSeries, _super);\n function MapSeries() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MapSeries.type;\n // Only first map series of same mapType will drawMap.\n _this.needsDrawMap = false;\n // Group of all map series with same mapType\n _this.seriesGroup = [];\n _this.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var name_1 = this.getData().getName(dataIndex);\n var geo = this.coordinateSystem;\n var region = geo.getRegion(name_1);\n return region && geo.dataToPoint(region.getCenter());\n }\n };\n return _this;\n }\n MapSeries.prototype.getInitialData = function (option) {\n var data = createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n var dataNameMap = zrUtil.createHashMap();\n var toAppendNames = [];\n for (var i = 0, len = data.count(); i < len; i++) {\n var name_2 = data.getName(i);\n dataNameMap.set(name_2, true);\n }\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\n zrUtil.each(geoSource.regions, function (region) {\n var name = region.name;\n if (!dataNameMap.get(name)) {\n toAppendNames.push(name);\n }\n });\n // Complete data with missing regions. The consequent processes (like visual\n // map and render) can not be performed without a \"full data\". For example,\n // find `dataIndex` by name.\n data.appendValues([], toAppendNames);\n return data;\n };\n /**\n * If no host geo model, return null, which means using a\n * inner exclusive geo model.\n */\n MapSeries.prototype.getHostGeoModel = function () {\n var geoIndex = this.option.geoIndex;\n return geoIndex != null ? this.ecModel.getComponent('geo', geoIndex) : null;\n };\n MapSeries.prototype.getMapType = function () {\n return (this.getHostGeoModel() || this).option.map;\n };\n // _fillOption(option, mapName) {\n // Shallow clone\n // option = zrUtil.extend({}, option);\n // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);\n // return option;\n // }\n MapSeries.prototype.getRawValue = function (dataIndex) {\n // Use value stored in data instead because it is calculated from multiple series\n // FIXME Provide all value of multiple series ?\n var data = this.getData();\n return data.get(data.mapDimension('value'), dataIndex);\n };\n /**\n * Get model of region\n */\n MapSeries.prototype.getRegionModel = function (regionName) {\n var data = this.getData();\n return data.getItemModel(data.indexOfName(regionName));\n };\n /**\n * Map tooltip formatter\n */\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // FIXME orignalData and data is a bit confusing\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n var seriesGroup = this.seriesGroup;\n var seriesNames = [];\n for (var i = 0; i < seriesGroup.length; i++) {\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\n var valueDim = data.mapDimension('value');\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\n seriesNames.push(seriesGroup[i].name);\n }\n }\n return createTooltipMarkup('section', {\n header: seriesNames.join(', '),\n noHeader: !seriesNames.length,\n blocks: [createTooltipMarkup('nameValue', {\n name: name,\n value: value\n })]\n });\n };\n MapSeries.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n MapSeries.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n MapSeries.prototype.getLegendIcon = function (opt) {\n var iconType = opt.icon || 'roundRect';\n var icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill);\n icon.setStyle(opt.itemStyle);\n // Map do not use itemStyle.borderWidth as border width\n icon.style.stroke = 'none';\n // No rotation because no series visual symbol for map\n if (iconType.indexOf('empty') > -1) {\n icon.style.stroke = icon.style.fill;\n icon.style.fill = '#fff';\n icon.style.lineWidth = 2;\n }\n return icon;\n };\n MapSeries.type = 'series.map';\n MapSeries.dependencies = ['geo'];\n MapSeries.layoutMode = 'box';\n MapSeries.defaultOption = {\n // 一级层叠\n // zlevel: 0,\n // 二级层叠\n z: 2,\n coordinateSystem: 'geo',\n // map should be explicitly specified since ec3.\n map: '',\n // If `geoIndex` is not specified, a exclusive geo will be\n // created. Otherwise use the specified geo component, and\n // `map` and `mapType` are ignored.\n // geoIndex: 0,\n // 'center' | 'left' | 'right' | 'x%' | {number}\n left: 'center',\n // 'center' | 'top' | 'bottom' | 'x%' | {number}\n top: 'center',\n // right\n // bottom\n // width:\n // height\n // Aspect is width / height. Inited to be geoJson bbox aspect\n // This parameter is used for scale this aspect\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n // Layout with center and size\n // If you want to put map in a fixed size box with right aspect ratio\n // This two properties may be more convenient.\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n showLegendSymbol: true,\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ],\n // higher priority than center and zoom\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n selectedMode: true,\n label: {\n show: false,\n color: '#000'\n },\n // scaleLimit: null,\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444',\n areaColor: '#eee'\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n areaColor: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n nameProperty: 'name'\n };\n return MapSeries;\n}(SeriesModel);\nexport default MapSeries;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// FIXME 公用?\nfunction dataStatistics(datas, statisticType) {\n var dataNameMap = {};\n zrUtil.each(datas, function (data) {\n data.each(data.mapDimension('value'), function (value, idx) {\n // Add prefix to avoid conflict with Object.prototype.\n var mapKey = 'ec-' + data.getName(idx);\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\n if (!isNaN(value)) {\n dataNameMap[mapKey].push(value);\n }\n });\n });\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\n var mapKey = 'ec-' + datas[0].getName(idx);\n var sum = 0;\n var min = Infinity;\n var max = -Infinity;\n var len = dataNameMap[mapKey].length;\n for (var i = 0; i < len; i++) {\n min = Math.min(min, dataNameMap[mapKey][i]);\n max = Math.max(max, dataNameMap[mapKey][i]);\n sum += dataNameMap[mapKey][i];\n }\n var result;\n if (statisticType === 'min') {\n result = min;\n } else if (statisticType === 'max') {\n result = max;\n } else if (statisticType === 'average') {\n result = sum / len;\n } else {\n result = sum;\n }\n return len === 0 ? NaN : result;\n });\n}\nexport default function mapDataStatistic(ecModel) {\n var seriesGroups = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n var hostGeoModel = seriesModel.getHostGeoModel();\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\n });\n zrUtil.each(seriesGroups, function (seriesList, key) {\n var data = dataStatistics(zrUtil.map(seriesList, function (seriesModel) {\n return seriesModel.getData();\n }), seriesList[0].get('mapValueCalculation'));\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].originalData = seriesList[i].getData();\n }\n // FIXME Put where?\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].seriesGroup = seriesList;\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\n seriesList[i].setData(data.cloneShallow());\n seriesList[i].mainSeries = seriesList[0];\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function mapSymbolLayout(ecModel) {\n var processedMapType = {};\n ecModel.eachSeriesByType('map', function (mapSeries) {\n var mapType = mapSeries.getMapType();\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\n return;\n }\n var mapSymbolOffsets = {};\n zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {\n var geo = subMapSeries.coordinateSystem;\n var data = subMapSeries.originalData;\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\n data.each(data.mapDimension('value'), function (value, idx) {\n var name = data.getName(idx);\n var region = geo.getRegion(name);\n // If input series.data is [11, 22, '-'/null/undefined, 44],\n // it will be filled with NaN: [11, 22, NaN, 44] and NaN will\n // not be drawn. So here must validate if value is NaN.\n if (!region || isNaN(value)) {\n return;\n }\n var offset = mapSymbolOffsets[name] || 0;\n var point = geo.dataToPoint(region.getCenter());\n mapSymbolOffsets[name] = offset + 1;\n data.setItemLayout(idx, {\n point: point,\n offset: offset\n });\n });\n }\n });\n // Show label of those region not has legendIcon (which is offset 0)\n var data = mapSeries.getData();\n data.each(function (idx) {\n var name = data.getName(idx);\n var layout = data.getItemLayout(idx) || {};\n layout.showLabel = !mapSymbolOffsets[name];\n data.setItemLayout(idx, layout);\n });\n processedMapType[mapType] = true;\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Simple view coordinate system\n * Mapping given x, y to transformd view x, y\n */\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { parsePercent } from '../util/number.js';\nvar v2ApplyTransform = vector.applyTransform;\nvar View = /** @class */function (_super) {\n __extends(View, _super);\n function View(name) {\n var _this = _super.call(this) || this;\n _this.type = 'view';\n _this.dimensions = ['x', 'y'];\n /**\n * Represents the transform brought by roam/zoom.\n * If `View['_viewRect']` applies roam transform,\n * we can get the final displayed rect.\n */\n _this._roamTransformable = new Transformable();\n /**\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\n */\n _this._rawTransformable = new Transformable();\n _this.name = name;\n return _this;\n }\n View.prototype.setBoundingRect = function (x, y, width, height) {\n this._rect = new BoundingRect(x, y, width, height);\n return this._rect;\n };\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n View.prototype.getBoundingRect = function () {\n return this._rect;\n };\n View.prototype.setViewRect = function (x, y, width, height) {\n this._transformTo(x, y, width, height);\n this._viewRect = new BoundingRect(x, y, width, height);\n };\n /**\n * Transformed to particular position and size\n */\n View.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var rawTransform = this._rawTransformable;\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransform.parent;\n rawTransform.parent = null;\n rawTransform.decomposeTransform();\n rawTransform.parent = rawParent;\n this._updateTransform();\n };\n /**\n * Set center of view\n */\n View.prototype.setCenter = function (centerCoord, api) {\n if (!centerCoord) {\n return;\n }\n this._center = [parsePercent(centerCoord[0], api.getWidth()), parsePercent(centerCoord[1], api.getHeight())];\n this._updateCenterAndZoom();\n };\n View.prototype.setZoom = function (zoom) {\n zoom = zoom || 1;\n var zoomLimit = this.zoomLimit;\n if (zoomLimit) {\n if (zoomLimit.max != null) {\n zoom = Math.min(zoomLimit.max, zoom);\n }\n if (zoomLimit.min != null) {\n zoom = Math.max(zoomLimit.min, zoom);\n }\n }\n this._zoom = zoom;\n this._updateCenterAndZoom();\n };\n /**\n * Get default center without roam\n */\n View.prototype.getDefaultCenter = function () {\n // Rect before any transform\n var rawRect = this.getBoundingRect();\n var cx = rawRect.x + rawRect.width / 2;\n var cy = rawRect.y + rawRect.height / 2;\n return [cx, cy];\n };\n View.prototype.getCenter = function () {\n return this._center || this.getDefaultCenter();\n };\n View.prototype.getZoom = function () {\n return this._zoom || 1;\n };\n View.prototype.getRoamTransform = function () {\n return this._roamTransformable.getLocalTransform();\n };\n /**\n * Remove roam\n */\n View.prototype._updateCenterAndZoom = function () {\n // Must update after view transform updated\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\n var roamTransform = this._roamTransformable;\n var defaultCenter = this.getDefaultCenter();\n var center = this.getCenter();\n var zoom = this.getZoom();\n center = vector.applyTransform([], center, rawTransformMatrix);\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\n roamTransform.originX = center[0];\n roamTransform.originY = center[1];\n roamTransform.x = defaultCenter[0] - center[0];\n roamTransform.y = defaultCenter[1] - center[1];\n roamTransform.scaleX = roamTransform.scaleY = zoom;\n this._updateTransform();\n };\n /**\n * Update transform props on `this` based on the current\n * `this._roamTransformable` and `this._rawTransformable`.\n */\n View.prototype._updateTransform = function () {\n var roamTransformable = this._roamTransformable;\n var rawTransformable = this._rawTransformable;\n rawTransformable.parent = roamTransformable;\n roamTransformable.updateTransform();\n rawTransformable.updateTransform();\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\n this._rawTransform = rawTransformable.getLocalTransform();\n this.invTransform = this.invTransform || [];\n matrix.invert(this.invTransform, this.transform);\n this.decomposeTransform();\n };\n View.prototype.getTransformInfo = function () {\n var rawTransformable = this._rawTransformable;\n var roamTransformable = this._roamTransformable;\n // Because roamTransformabel has `originX/originY` modified,\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\n // so need to recalculate them.\n var dummyTransformable = new Transformable();\n dummyTransformable.transform = roamTransformable.transform;\n dummyTransformable.decomposeTransform();\n return {\n roam: {\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY\n },\n raw: {\n x: rawTransformable.x,\n y: rawTransformable.y,\n scaleX: rawTransformable.scaleX,\n scaleY: rawTransformable.scaleY\n }\n };\n };\n View.prototype.getViewRect = function () {\n return this._viewRect;\n };\n /**\n * Get view rect after roam transform\n */\n View.prototype.getViewRectAfterRoam = function () {\n var rect = this.getBoundingRect().clone();\n rect.applyTransform(this.transform);\n return rect;\n };\n /**\n * Convert a single (lon, lat) data item to (x, y) point.\n */\n View.prototype.dataToPoint = function (data, noRoam, out) {\n var transform = noRoam ? this._rawTransform : this.transform;\n out = out || [];\n return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\n };\n /**\n * Convert a (x, y) point to (lon, lat) data\n */\n View.prototype.pointToData = function (point) {\n var invTransform = this.invTransform;\n return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];\n };\n View.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n /**\n * @implements\n */\n View.prototype.containPoint = function (point) {\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\n };\n View.dimensions = ['x', 'y'];\n return View;\n}(Transformable);\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\n}\n\nexport default View;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport View from '../View.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { warn } from '../../util/log.js';\nvar GEO_DEFAULT_PARAMS = {\n 'geoJSON': {\n aspectScale: 0.75,\n invertLongitute: true\n },\n 'geoSVG': {\n aspectScale: 1,\n invertLongitute: false\n }\n};\nexport var geo2DDimensions = ['lng', 'lat'];\nvar Geo = /** @class */function (_super) {\n __extends(Geo, _super);\n function Geo(name, map, opt) {\n var _this = _super.call(this, name) || this;\n _this.dimensions = geo2DDimensions;\n _this.type = 'geo';\n // Only store specified name coord via `addGeoCoord`.\n _this._nameCoordMap = zrUtil.createHashMap();\n _this.map = map;\n var projection = opt.projection;\n var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n var resource = geoSourceManager.getGeoResource(map);\n var resourceType = _this.resourceType = resource ? resource.type : null;\n var regions = _this.regions = source.regions;\n var defaultParams = GEO_DEFAULT_PARAMS[resource.type];\n _this._regionsMap = source.regionsMap;\n _this.regions = source.regions;\n if (process.env.NODE_ENV !== 'production' && projection) {\n // Do some check\n if (resourceType === 'geoSVG') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Map \" + map + \" with SVG source can't use projection. Only GeoJSON source supports projection.\");\n }\n projection = null;\n }\n if (!(projection.project && projection.unproject)) {\n if (process.env.NODE_ENV !== 'production') {\n warn('project and unproject must be both provided in the projeciton.');\n }\n projection = null;\n }\n }\n _this.projection = projection;\n var boundingRect;\n if (projection) {\n // Can't reuse the raw bounding rect\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect(projection);\n boundingRect = boundingRect || regionRect.clone();\n boundingRect.union(regionRect);\n }\n } else {\n boundingRect = source.boundingRect;\n }\n _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);\n // aspectScale and invertLongitute actually is the parameters default raw projection.\n // So we ignore them if projection is given.\n // Ignore default aspect scale if projection exits.\n _this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale);\n // Not invert longitude if projection exits.\n _this._invertLongitute = projection ? false : defaultParams.invertLongitute;\n return _this;\n }\n Geo.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var invertLongitute = this._invertLongitute;\n rect = rect.clone();\n if (invertLongitute) {\n // Longitude is inverted.\n rect.y = -rect.y - rect.height;\n }\n var rawTransformable = this._rawTransformable;\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransformable.parent;\n rawTransformable.parent = null;\n rawTransformable.decomposeTransform();\n rawTransformable.parent = rawParent;\n if (invertLongitute) {\n rawTransformable.scaleY = -rawTransformable.scaleY;\n }\n this._updateTransform();\n };\n Geo.prototype.getRegion = function (name) {\n return this._regionsMap.get(name);\n };\n Geo.prototype.getRegionByCoord = function (coord) {\n var regions = this.regions;\n for (var i = 0; i < regions.length; i++) {\n var region = regions[i];\n if (region.type === 'geoJSON' && region.contain(coord)) {\n return regions[i];\n }\n }\n };\n /**\n * Add geoCoord for indexing by name\n */\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\n this._nameCoordMap.set(name, geoCoord);\n };\n /**\n * Get geoCoord by name\n */\n Geo.prototype.getGeoCoord = function (name) {\n var region = this._regionsMap.get(name);\n // Calculate center only on demand.\n return this._nameCoordMap.get(name) || region && region.getCenter();\n };\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\n if (zrUtil.isString(data)) {\n // Map area name to geoCoord\n data = this.getGeoCoord(data);\n }\n if (data) {\n var projection = this.projection;\n if (projection) {\n // projection may return null point.\n data = projection.project(data);\n }\n return data && this.projectedToPoint(data, noRoam, out);\n }\n };\n Geo.prototype.pointToData = function (point) {\n var projection = this.projection;\n if (projection) {\n // projection may return null point.\n point = projection.unproject(point);\n }\n return point && this.pointToProjected(point);\n };\n /**\n * Point to projected data. Same with pointToData when projection is used.\n */\n Geo.prototype.pointToProjected = function (point) {\n return _super.prototype.pointToData.call(this, point);\n };\n Geo.prototype.projectedToPoint = function (projected, noRoam, out) {\n return _super.prototype.dataToPoint.call(this, projected, noRoam, out);\n };\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n return Geo;\n}(View);\n;\nzrUtil.mixin(Geo, View);\nfunction getCoordSys(finder) {\n var geoModel = finder.geoModel;\n var seriesModel = finder.seriesModel;\n return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\nexport default Geo;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Geo, { geo2DDimensions } from './Geo.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport * as vector from 'zrender/lib/core/vector.js';\n/**\n * Resize method bound to the geo\n */\nfunction resizeGeo(geoModel, api) {\n var boundingCoords = geoModel.get('boundingCoords');\n if (boundingCoords != null) {\n var leftTop_1 = boundingCoords[0];\n var rightBottom_1 = boundingCoords[1];\n if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid boundingCoords');\n }\n } else {\n // Sample around the lng/lat rect and use projection to calculate actual bounding rect.\n var projection_1 = this.projection;\n if (projection_1) {\n var xMin = leftTop_1[0];\n var yMin = leftTop_1[1];\n var xMax = rightBottom_1[0];\n var yMax = rightBottom_1[1];\n leftTop_1 = [Infinity, Infinity];\n rightBottom_1 = [-Infinity, -Infinity];\n // TODO better way?\n var sampleLine = function (x0, y0, x1, y1) {\n var dx = x1 - x0;\n var dy = y1 - y0;\n for (var i = 0; i <= 100; i++) {\n var p = i / 100;\n var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);\n vector.min(leftTop_1, leftTop_1, pt);\n vector.max(rightBottom_1, rightBottom_1, pt);\n }\n };\n // Top\n sampleLine(xMin, yMin, xMax, yMin);\n // Right\n sampleLine(xMax, yMin, xMax, yMax);\n // Bottom\n sampleLine(xMax, yMax, xMin, yMax);\n // Left\n sampleLine(xMin, yMax, xMax, yMin);\n }\n this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);\n }\n }\n var rect = this.getBoundingRect();\n var centerOption = geoModel.get('layoutCenter');\n var sizeOption = geoModel.get('layoutSize');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var aspect = rect.width / rect.height * this.aspectScale;\n var useCenterAndSize = false;\n var center;\n var size;\n if (centerOption && sizeOption) {\n center = [numberUtil.parsePercent(centerOption[0], viewWidth), numberUtil.parsePercent(centerOption[1], viewHeight)];\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\n useCenterAndSize = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\n }\n }\n }\n var viewRect;\n if (useCenterAndSize) {\n viewRect = {};\n if (aspect > 1) {\n // Width is same with size\n viewRect.width = size;\n viewRect.height = size / aspect;\n } else {\n viewRect.height = size;\n viewRect.width = size * aspect;\n }\n viewRect.y = center[1] - viewRect.height / 2;\n viewRect.x = center[0] - viewRect.width / 2;\n } else {\n // Use left/top/width/height\n var boxLayoutOption = geoModel.getBoxLayoutParams();\n boxLayoutOption.aspect = aspect;\n viewRect = layout.getLayoutRect(boxLayoutOption, {\n width: viewWidth,\n height: viewHeight\n });\n }\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n this.setCenter(geoModel.get('center'), api);\n this.setZoom(geoModel.get('zoom'));\n}\n// Back compat for ECharts2, where the coord map is set on map series:\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\nfunction setGeoCoords(geo, model) {\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\n geo.addGeoCoord(name, geoCoord);\n });\n}\nvar GeoCreator = /** @class */function () {\n function GeoCreator() {\n // For deciding which dimensions to use when creating list data\n this.dimensions = geo2DDimensions;\n }\n GeoCreator.prototype.create = function (ecModel, api) {\n var geoList = [];\n function getCommonGeoProperties(model) {\n return {\n nameProperty: model.get('nameProperty'),\n aspectScale: model.get('aspectScale'),\n projection: model.get('projection')\n };\n }\n // FIXME Create each time may be slow\n ecModel.eachComponent('geo', function (geoModel, idx) {\n var mapName = geoModel.get('map');\n var geo = new Geo(mapName + idx, mapName, zrUtil.extend({\n nameMap: geoModel.get('nameMap')\n }, getCommonGeoProperties(geoModel)));\n geo.zoomLimit = geoModel.get('scaleLimit');\n geoList.push(geo);\n // setGeoCoords(geo, geoModel);\n geoModel.coordinateSystem = geo;\n geo.model = geoModel;\n // Inject resize method\n geo.resize = resizeGeo;\n geo.resize(geoModel, api);\n });\n ecModel.eachSeries(function (seriesModel) {\n var coordSys = seriesModel.get('coordinateSystem');\n if (coordSys === 'geo') {\n var geoIndex = seriesModel.get('geoIndex') || 0;\n seriesModel.coordinateSystem = geoList[geoIndex];\n }\n });\n // If has map series\n var mapModelGroupBySeries = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n if (!seriesModel.getHostGeoModel()) {\n var mapType = seriesModel.getMapType();\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\n mapModelGroupBySeries[mapType].push(seriesModel);\n }\n });\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\n var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('nameMap');\n });\n var geo = new Geo(mapType, mapType, zrUtil.extend({\n nameMap: zrUtil.mergeAll(nameMapList)\n }, getCommonGeoProperties(mapSeries[0])));\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('scaleLimit');\n }));\n geoList.push(geo);\n // Inject resize method\n geo.resize = resizeGeo;\n geo.resize(mapSeries[0], api);\n zrUtil.each(mapSeries, function (singleMapSeries) {\n singleMapSeries.coordinateSystem = geo;\n setGeoCoords(geo, singleMapSeries);\n });\n });\n return geoList;\n };\n /**\n * Fill given regions array\n */\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\n // Not use the original\n var regionsArr = (originRegionArr || []).slice();\n var dataNameMap = zrUtil.createHashMap();\n for (var i = 0; i < regionsArr.length; i++) {\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\n }\n var source = geoSourceManager.load(mapName, nameMap, nameProperty);\n zrUtil.each(source.regions, function (region) {\n var name = region.name;\n !dataNameMap.get(name) && regionsArr.push({\n name: name\n });\n });\n return regionsArr;\n };\n return GeoCreator;\n}();\nvar geoCreator = new GeoCreator();\nexport default geoCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport Model from '../../model/Model.js';\nimport geoCreator from './geoCreator.js';\nimport geoSourceManager from './geoSourceManager.js';\n;\nvar GeoModel = /** @class */function (_super) {\n __extends(GeoModel, _super);\n function GeoModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GeoModel.type;\n return _this;\n }\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\n var source = geoSourceManager.getGeoResource(option.map);\n if (source && source.type === 'geoJSON') {\n var itemStyle = option.itemStyle = option.itemStyle || {};\n if (!('color' in itemStyle)) {\n itemStyle.color = '#eee';\n }\n }\n this.mergeDefaultAndTheme(option, ecModel);\n // Default label emphasis `show`\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n };\n GeoModel.prototype.optionUpdated = function () {\n var _this = this;\n var option = this.option;\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);\n var selectedMap = {};\n this._optionModelMap = zrUtil.reduce(option.regions || [], function (optionModelMap, regionOpt) {\n var regionName = regionOpt.name;\n if (regionName) {\n optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel));\n if (regionOpt.selected) {\n selectedMap[regionName] = true;\n }\n }\n return optionModelMap;\n }, zrUtil.createHashMap());\n if (!option.selectedMap) {\n option.selectedMap = selectedMap;\n }\n };\n /**\n * Get model of region.\n */\n GeoModel.prototype.getRegionModel = function (name) {\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\n };\n /**\n * Format label\n * @param name Region name\n */\n GeoModel.prototype.getFormattedLabel = function (name, status) {\n var regionModel = this.getRegionModel(name);\n var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']);\n var params = {\n name: name\n };\n if (zrUtil.isFunction(formatter)) {\n params.status = status;\n return formatter(params);\n } else if (zrUtil.isString(formatter)) {\n return formatter.replace('{a}', name != null ? name : '');\n }\n };\n GeoModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n GeoModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n // PENGING If selectedMode is null ?\n GeoModel.prototype.select = function (name) {\n var option = this.option;\n var selectedMode = option.selectedMode;\n if (!selectedMode) {\n return;\n }\n if (selectedMode !== 'multiple') {\n option.selectedMap = null;\n }\n var selectedMap = option.selectedMap || (option.selectedMap = {});\n selectedMap[name] = true;\n };\n GeoModel.prototype.unSelect = function (name) {\n var selectedMap = this.option.selectedMap;\n if (selectedMap) {\n selectedMap[name] = false;\n }\n };\n GeoModel.prototype.toggleSelected = function (name) {\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\n };\n GeoModel.prototype.isSelected = function (name) {\n var selectedMap = this.option.selectedMap;\n return !!(selectedMap && selectedMap[name]);\n };\n GeoModel.type = 'geo';\n GeoModel.layoutMode = 'box';\n GeoModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n show: true,\n left: 'center',\n top: 'center',\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n // /// Layout with center and size\n // If you want to put map in a fixed size box with right aspect ratio\n // This two properties may be more convenient\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n silent: false,\n // Map type\n map: '',\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ]\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n // selectedMode: false\n label: {\n show: false,\n color: '#000'\n },\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444'\n // Default color:\n // + geoJSON: #eee\n // + geoSVG: null (use SVG original `fill`)\n // color: '#eee'\n },\n\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n regions: []\n // tooltip: {\n // show: false\n // }\n };\n\n return GeoModel;\n}(ComponentModel);\nexport default GeoModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction getCenterCoord(view, point) {\n // Use projected coord as center because it's linear.\n return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point);\n}\nexport function updateCenterAndZoom(view, payload, zoomLimit, api) {\n var previousZoom = view.getZoom();\n var center = view.getCenter();\n var zoom = payload.zoom;\n var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center);\n if (payload.dx != null && payload.dy != null) {\n point[0] -= payload.dx;\n point[1] -= payload.dy;\n view.setCenter(getCenterCoord(view, point), api);\n }\n if (zoom != null) {\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\n }\n // Zoom on given point(originX, originY)\n view.scaleX *= zoom;\n view.scaleY *= zoom;\n var fixX = (payload.originX - view.x) * (zoom - 1);\n var fixY = (payload.originY - view.y) * (zoom - 1);\n view.x -= fixX;\n view.y -= fixY;\n view.updateTransform();\n // Get the new center\n view.setCenter(getCenterCoord(view, point), api);\n view.setZoom(zoom * previousZoom);\n }\n return {\n center: view.getCenter(),\n zoom: view.getZoom()\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MapDraw from '../helper/MapDraw.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { findEventDispatcher } from '../../util/event.js';\nvar GeoView = /** @class */function (_super) {\n __extends(GeoView, _super);\n function GeoView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GeoView.type;\n _this.focusBlurEnabled = true;\n return _this;\n }\n GeoView.prototype.init = function (ecModel, api) {\n this._api = api;\n };\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\n this._model = geoModel;\n if (!geoModel.get('show')) {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n return;\n }\n if (!this._mapDraw) {\n this._mapDraw = new MapDraw(api);\n }\n var mapDraw = this._mapDraw;\n mapDraw.draw(geoModel, ecModel, api, this, payload);\n mapDraw.group.on('click', this._handleRegionClick, this);\n mapDraw.group.silent = geoModel.get('silent');\n this.group.add(mapDraw.group);\n this.updateSelectStatus(geoModel, ecModel, api);\n };\n GeoView.prototype._handleRegionClick = function (e) {\n var eventData;\n findEventDispatcher(e.target, function (current) {\n return (eventData = getECData(current).eventData) != null;\n }, true);\n if (eventData) {\n this._api.dispatchAction({\n type: 'geoToggleSelect',\n geoId: this._model.id,\n name: eventData.name\n });\n }\n };\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\n var _this = this;\n this._mapDraw.group.traverse(function (node) {\n var eventData = getECData(node).eventData;\n if (eventData) {\n _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node);\n // No need to traverse children.\n return true;\n }\n });\n };\n GeoView.prototype.findHighDownDispatchers = function (name) {\n return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);\n };\n GeoView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n };\n GeoView.type = 'geo';\n return GeoView;\n}(ComponentView);\nexport default GeoView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport GeoModel from '../../coord/geo/GeoModel.js';\nimport geoCreator from '../../coord/geo/geoCreator.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nimport GeoView from './GeoView.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nfunction registerMap(mapName, geoJson, specialAreas) {\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\n}\nexport function install(registers) {\n registers.registerCoordinateSystem('geo', geoCreator);\n registers.registerComponentModel(GeoModel);\n registers.registerComponentView(GeoView);\n registers.registerImpl('registerMap', registerMap);\n registers.registerImpl('getMap', function (mapName) {\n return geoSourceManager.getMapForUser(mapName);\n });\n function makeAction(method, actionInfo) {\n actionInfo.update = 'geo:updateSelectStatus';\n registers.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n var allSelected = [];\n ecModel.eachComponent({\n mainType: 'geo',\n query: payload\n }, function (geoModel) {\n geoModel[method](payload.name);\n var geo = geoModel.coordinateSystem;\n each(geo.regions, function (region) {\n selected[region.name] = geoModel.isSelected(region.name) || false;\n });\n // Notice: there might be duplicated name in different regions.\n var names = [];\n each(selected, function (v, name) {\n selected[name] && names.push(name);\n });\n allSelected.push({\n geoIndex: geoModel.componentIndex,\n // Use singular, the same naming convention as the event `selectchanged`.\n name: names\n });\n });\n return {\n selected: selected,\n allSelected: allSelected,\n name: payload.name\n };\n });\n }\n makeAction('toggleSelected', {\n type: 'geoToggleSelect',\n event: 'geoselectchanged'\n });\n makeAction('select', {\n type: 'geoSelect',\n event: 'geoselected'\n });\n makeAction('unSelect', {\n type: 'geoUnSelect',\n event: 'geounselected'\n });\n /**\n * @payload\n * @property {string} [componentType=series]\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\n registers.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n }, function (payload, ecModel, api) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n if (geo.type !== 'geo') {\n return;\n }\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'), api);\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom);\n // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n if (componentType === 'series') {\n each(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport MapView from './MapView.js';\nimport MapSeries from './MapSeries.js';\nimport mapDataStatistic from './mapDataStatistic.js';\nimport mapSymbolLayout from './mapSymbolLayout.js';\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport { install as installGeo } from '../../component/geo/install.js';\nexport function install(registers) {\n use(installGeo);\n registers.registerChartView(MapView);\n registers.registerSeriesModel(MapSeries);\n registers.registerLayout(mapSymbolLayout);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\n createLegacyDataSelectAction('map', registers.registerAction);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/*\n* A third-party license is embedded for some of the code in this file:\n* The tree layoutHelper implementation was originally copied from\n* \"d3.js\"(https://github.com/d3/d3-hierarchy) with\n* some modifications made for this project.\n* (see more details in the comment of the specific method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the licence of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\n/**\n * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing\n * the tree.\n */\nimport * as layout from '../../util/layout.js';\n/**\n * Initialize all computational message for following algorithm.\n */\nexport function init(inRoot) {\n var root = inRoot;\n root.hierNode = {\n defaultAncestor: null,\n ancestor: root,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: 0,\n thread: null\n };\n var nodes = [root];\n var node;\n var children;\n while (node = nodes.pop()) {\n // jshint ignore:line\n children = node.children;\n if (node.isExpand && children.length) {\n var n = children.length;\n for (var i = n - 1; i >= 0; i--) {\n var child = children[i];\n child.hierNode = {\n defaultAncestor: null,\n ancestor: child,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: i,\n thread: null\n };\n nodes.push(child);\n }\n }\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes a preliminary x coordinate for node. Before that, this function is\n * applied recursively to the children of node, as well as the function\n * apportion(). After spacing out the children by calling executeShifts(), the\n * node is placed to the midpoint of its outermost children.\n */\nexport function firstWalk(node, separation) {\n var children = node.isExpand ? node.children : [];\n var siblings = node.parentNode.children;\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\n if (children.length) {\n executeShifts(node);\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\n if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\n } else {\n node.hierNode.prelim = midPoint;\n }\n } else if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n }\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes all real x-coordinates by summing up the modifiers recursively.\n */\nexport function secondWalk(node) {\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\n node.setLayout({\n x: nodeX\n }, true);\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\n}\nexport function separation(cb) {\n return arguments.length ? cb : defaultSeparation;\n}\n/**\n * Transform the common coordinate to radial coordinate.\n */\nexport function radialCoordinate(rad, r) {\n rad -= Math.PI / 2;\n return {\n x: r * Math.cos(rad),\n y: r * Math.sin(rad)\n };\n}\n/**\n * Get the layout position of the whole view.\n */\nexport function getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n/**\n * All other shifts, applied to the smaller subtrees between w- and w+, are\n * performed by this function.\n *\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\nfunction executeShifts(node) {\n var children = node.children;\n var n = children.length;\n var shift = 0;\n var change = 0;\n while (--n >= 0) {\n var child = children[n];\n child.hierNode.prelim += shift;\n child.hierNode.modifier += shift;\n change += child.hierNode.change;\n shift += child.hierNode.shift + change;\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * The core of the algorithm. Here, a new subtree is combined with the\n * previous subtrees. Threads are used to traverse the inside and outside\n * contours of the left and right subtree up to the highest common level.\n * Whenever two nodes of the inside contours conflict, we compute the left\n * one of the greatest uncommon ancestors using the function nextAncestor()\n * and call moveSubtree() to shift the subtree and prepare the shifts of\n * smaller subtrees. Finally, we add a new thread (if necessary).\n */\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\n if (subtreeW) {\n var nodeOutRight = subtreeV;\n var nodeInRight = subtreeV;\n var nodeOutLeft = nodeInRight.parentNode.children[0];\n var nodeInLeft = subtreeW;\n var sumOutRight = nodeOutRight.hierNode.modifier;\n var sumInRight = nodeInRight.hierNode.modifier;\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\n var sumInLeft = nodeInLeft.hierNode.modifier;\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\n nodeOutRight = nextRight(nodeOutRight);\n nodeOutLeft = nextLeft(nodeOutLeft);\n nodeOutRight.hierNode.ancestor = subtreeV;\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight);\n if (shift > 0) {\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\n sumInRight += shift;\n sumOutRight += shift;\n }\n sumInLeft += nodeInLeft.hierNode.modifier;\n sumInRight += nodeInRight.hierNode.modifier;\n sumOutRight += nodeOutRight.hierNode.modifier;\n sumOutLeft += nodeOutLeft.hierNode.modifier;\n }\n if (nodeInLeft && !nextRight(nodeOutRight)) {\n nodeOutRight.hierNode.thread = nodeInLeft;\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\n }\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\n nodeOutLeft.hierNode.thread = nodeInRight;\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\n ancestor = subtreeV;\n }\n }\n return ancestor;\n}\n/**\n * This function is used to traverse the right contour of a subtree.\n * It returns the rightmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n */\nfunction nextRight(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n}\n/**\n * This function is used to traverse the left contour of a subtree (or a subforest).\n * It returns the leftmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n */\nfunction nextLeft(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}\n/**\n * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.\n * Otherwise, returns the specified ancestor.\n */\nfunction nextAncestor(nodeInLeft, node, ancestor) {\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Shifts the current subtree rooted at wr.\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\n */\nfunction moveSubtree(wl, wr, shift) {\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\n wr.hierNode.change -= change;\n wr.hierNode.shift += shift;\n wr.hierNode.modifier += shift;\n wr.hierNode.prelim += shift;\n wl.hierNode.change += change;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\nfunction defaultSeparation(node1, node2) {\n return node1.parentNode === node2.parentNode ? 1 : 2;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport { radialCoordinate } from './layoutHelper.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport View from '../../coord/View.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport { parsePercent } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { setStatesStylesFromModel, setStatesFlag, setDefaultStateProxy, HOVER_STATE_BLUR } from '../../util/states.js';\nvar TreeEdgeShape = /** @class */function () {\n function TreeEdgeShape() {\n this.parentPoint = [];\n this.childPoints = [];\n }\n return TreeEdgeShape;\n}();\nvar TreePath = /** @class */function (_super) {\n __extends(TreePath, _super);\n function TreePath(opts) {\n return _super.call(this, opts) || this;\n }\n TreePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n TreePath.prototype.getDefaultShape = function () {\n return new TreeEdgeShape();\n };\n TreePath.prototype.buildPath = function (ctx, shape) {\n var childPoints = shape.childPoints;\n var childLen = childPoints.length;\n var parentPoint = shape.parentPoint;\n var firstChildPos = childPoints[0];\n var lastChildPos = childPoints[childLen - 1];\n if (childLen === 1) {\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\n return;\n }\n var orient = shape.orient;\n var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1;\n var otherDim = 1 - forkDim;\n var forkPosition = parsePercent(shape.forkPosition, 1);\n var tmpPoint = [];\n tmpPoint[forkDim] = parentPoint[forkDim];\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\n tmpPoint[forkDim] = firstChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n tmpPoint[forkDim] = lastChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\n for (var i = 1; i < childLen - 1; i++) {\n var point = childPoints[i];\n ctx.moveTo(point[0], point[1]);\n tmpPoint[forkDim] = point[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n }\n };\n return TreePath;\n}(Path);\nvar TreeView = /** @class */function (_super) {\n __extends(TreeView, _super);\n function TreeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TreeView.type;\n _this._mainGroup = new graphic.Group();\n return _this;\n }\n TreeView.prototype.init = function (ecModel, api) {\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: this.group\n };\n this.group.add(this._mainGroup);\n };\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var layoutInfo = seriesModel.layoutInfo;\n var group = this._mainGroup;\n var layout = seriesModel.get('layout');\n if (layout === 'radial') {\n group.x = layoutInfo.x + layoutInfo.width / 2;\n group.y = layoutInfo.y + layoutInfo.height / 2;\n } else {\n group.x = layoutInfo.x;\n group.y = layoutInfo.y;\n }\n this._updateViewCoordSys(seriesModel, api);\n this._updateController(seriesModel, ecModel, api);\n var oldData = this._data;\n data.diff(oldData).add(function (newIdx) {\n if (symbolNeedsDraw(data, newIdx)) {\n // Create node and edge\n updateNode(data, newIdx, null, group, seriesModel);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n if (!symbolNeedsDraw(data, newIdx)) {\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n return;\n }\n // Update node and edge\n updateNode(data, newIdx, symbolEl, group, seriesModel);\n }).remove(function (oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n // When remove a collapsed node of subtree, since the collapsed\n // node haven't been initialized with a symbol element,\n // you can't found it's symbol element through index.\n // so if we want to remove the symbol element we should insure\n // that the symbol element is not null.\n if (symbolEl) {\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n }\n }).execute();\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\n this._updateNodeAndLinkScale(seriesModel);\n if (seriesModel.get('expandAndCollapse') === true) {\n data.eachItemGraphicEl(function (el, dataIndex) {\n el.off('click').on('click', function () {\n api.dispatchAction({\n type: 'treeExpandAndCollapse',\n seriesId: seriesModel.id,\n dataIndex: dataIndex\n });\n });\n });\n }\n this._data = data;\n };\n TreeView.prototype._updateViewCoordSys = function (seriesModel, api) {\n var data = seriesModel.getData();\n var points = [];\n data.each(function (idx) {\n var layout = data.getItemLayout(idx);\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\n points.push([+layout.x, +layout.y]);\n }\n });\n var min = [];\n var max = [];\n bbox.fromPoints(points, min, max);\n // If don't Store min max when collapse the root node after roam,\n // the root node will disappear.\n var oldMin = this._min;\n var oldMax = this._max;\n // If width or height is 0\n if (max[0] - min[0] === 0) {\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\n }\n if (max[1] - min[1] === 0) {\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\n }\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group\n this.group.attr({\n x: viewCoordSys.x,\n y: viewCoordSys.y,\n scaleX: viewCoordSys.scaleX,\n scaleY: viewCoordSys.scaleY\n });\n this._min = min;\n this._max = max;\n };\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n _this._updateNodeAndLinkScale(seriesModel);\n // Only update label layout on zoom\n api.updateLabelLayout();\n });\n };\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\n var data = seriesModel.getData();\n var nodeScale = this._getNodeGlobalScale(seriesModel);\n data.eachItemGraphicEl(function (el, idx) {\n el.setSymbolScale(nodeScale);\n });\n };\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys.type !== 'view') {\n return 1;\n }\n var nodeScaleRatio = this._nodeScaleRatio;\n var groupZoom = coordSys.scaleX || 1;\n // Scale node when zoom changes\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n };\n TreeView.prototype.dispose = function () {\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n TreeView.prototype.remove = function () {\n this._mainGroup.removeAll();\n this._data = null;\n };\n TreeView.type = 'tree';\n return TreeView;\n}(ChartView);\nfunction symbolNeedsDraw(data, dataIndex) {\n var layout = data.getItemLayout(dataIndex);\n return layout && !isNaN(layout.x) && !isNaN(layout.y);\n}\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel) {\n var isInit = !symbolEl;\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var itemModel = node.getModel();\n var visualColor = node.getVisual('style').fill;\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : '#fff';\n var virtualRoot = data.tree.root;\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceLayout = source.getLayout();\n var sourceOldLayout = sourceSymbolEl ? {\n x: sourceSymbolEl.__oldX,\n y: sourceSymbolEl.__oldY,\n rawX: sourceSymbolEl.__radialOldRawX,\n rawY: sourceSymbolEl.__radialOldRawY\n } : sourceLayout;\n var targetLayout = node.getLayout();\n if (isInit) {\n symbolEl = new SymbolClz(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n symbolEl.x = sourceOldLayout.x;\n symbolEl.y = sourceOldLayout.y;\n } else {\n symbolEl.updateData(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n }\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\n symbolEl.__radialRawX = targetLayout.rawX;\n symbolEl.__radialRawY = targetLayout.rawY;\n group.add(symbolEl);\n data.setItemGraphicEl(dataIndex, symbolEl);\n symbolEl.__oldX = symbolEl.x;\n symbolEl.__oldY = symbolEl.y;\n graphic.updateProps(symbolEl, {\n x: targetLayout.x,\n y: targetLayout.y\n }, seriesModel);\n var symbolPath = symbolEl.getSymbolPath();\n if (seriesModel.get('layout') === 'radial') {\n var realRoot = virtualRoot.children[0];\n var rootLayout = realRoot.getLayout();\n var length_1 = realRoot.children.length;\n var rad = void 0;\n var isLeft = void 0;\n if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) {\n var center = {\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\n };\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n isLeft = center.x < rootLayout.x;\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) {\n isLeft = targetLayout.x < rootLayout.x;\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n isLeft = targetLayout.x > rootLayout.x;\n if (!isLeft) {\n rad = rad - Math.PI;\n }\n }\n }\n var textPosition = isLeft ? 'left' : 'right';\n var normalLabelModel = itemModel.getModel('label');\n var rotate = normalLabelModel.get('rotate');\n var labelRotateRadian = rotate * (Math.PI / 180);\n var textContent = symbolPath.getTextContent();\n if (textContent) {\n symbolPath.setTextConfig({\n position: normalLabelModel.get('position') || textPosition,\n rotation: rotate == null ? -rad : labelRotateRadian,\n origin: 'center'\n });\n textContent.setStyle('verticalAlign', 'middle');\n }\n }\n // Handle status\n var focus = itemModel.get(['emphasis', 'focus']);\n var focusDataIndices = focus === 'relative' ? zrUtil.concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null;\n if (focusDataIndices) {\n // Modify the focus to data indices.\n getECData(symbolEl).focus = focusDataIndices;\n }\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\n if (symbolEl.__edge) {\n symbolEl.onHoverStateChange = function (toState) {\n if (toState !== 'blur') {\n // NOTE: Ensure the parent elements will been blurred firstly.\n // According to the return of getAncestorsIndices and getDescendantIndices\n // TODO: A bit tricky.\n var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex);\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\n setStatesFlag(symbolEl.__edge, toState);\n }\n }\n };\n }\n}\nfunction drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\n var itemModel = node.getModel();\n var edgeShape = seriesModel.get('edgeShape');\n var layout = seriesModel.get('layout');\n var orient = seriesModel.getOrient();\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n var edge = symbolEl.__edge;\n // curve edge from node -> parent\n // polyline edge from node -> children\n if (edgeShape === 'curve') {\n if (node.parentNode && node.parentNode !== virtualRoot) {\n if (!edge) {\n edge = symbolEl.__edge = new graphic.BezierCurve({\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\n });\n }\n graphic.updateProps(edge, {\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\n }, seriesModel);\n }\n } else if (edgeShape === 'polyline') {\n if (layout === 'orthogonal') {\n if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) {\n var children = node.children;\n var childPoints = [];\n for (var i = 0; i < children.length; i++) {\n var childLayout = children[i].getLayout();\n childPoints.push([childLayout.x, childLayout.y]);\n }\n if (!edge) {\n edge = symbolEl.__edge = new TreePath({\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: [[targetLayout.x, targetLayout.y]],\n orient: orient,\n forkPosition: edgeForkPosition\n }\n });\n }\n graphic.updateProps(edge, {\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: childPoints\n }\n }, seriesModel);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\n }\n }\n }\n // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'\n if (edge && !(edgeShape === 'polyline' && !node.isExpand)) {\n edge.useStyle(zrUtil.defaults({\n strokeNoScale: true,\n fill: null\n }, lineStyle));\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\n setDefaultStateProxy(edge);\n group.add(edge);\n }\n}\nfunction removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) {\n var virtualRoot = data.tree.root;\n var _a = getSourceNode(virtualRoot, node),\n source = _a.source,\n sourceLayout = _a.sourceLayout;\n var symbolEl = data.getItemGraphicEl(node.dataIndex);\n if (!symbolEl) {\n return;\n }\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceEdge = sourceSymbolEl.__edge;\n // 1. when expand the sub tree, delete the children node should delete the edge of\n // the source at the same time. because the polyline edge shape is only owned by the source.\n // 2.when the node is the only children of the source, delete the node should delete the edge of\n // the source at the same time. the same reason as above.\n var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined);\n var edgeShape = seriesModel.get('edgeShape');\n var layoutOpt = seriesModel.get('layout');\n var orient = seriesModel.get('orient');\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n if (edge) {\n if (edgeShape === 'curve') {\n graphic.removeElement(edge, {\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\n graphic.removeElement(edge, {\n shape: {\n parentPoint: [sourceLayout.x, sourceLayout.y],\n childPoints: [[sourceLayout.x, sourceLayout.y]]\n },\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n }\n }\n}\nfunction getSourceNode(virtualRoot, node) {\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceLayout;\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\n }\n return {\n source: source,\n sourceLayout: sourceLayout\n };\n}\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel) {\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var virtualRoot = data.tree.root;\n var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout;\n // Use same duration and easing with update to have more consistent animation.\n var removeAnimationOpt = {\n duration: seriesModel.get('animationDurationUpdate'),\n easing: seriesModel.get('animationEasingUpdate')\n };\n graphic.removeElement(symbolEl, {\n x: sourceLayout.x + 1,\n y: sourceLayout.y + 1\n }, seriesModel, {\n cb: function () {\n group.remove(symbolEl);\n data.setItemGraphicEl(dataIndex, null);\n },\n removeOpt: removeAnimationOpt\n });\n symbolEl.fadeOut(null, data.hostModel, {\n fadeLabel: true,\n animation: removeAnimationOpt\n });\n // remove edge as parent node\n node.children.forEach(function (childNode) {\n removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt);\n });\n // remove edge as child node\n removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt);\n}\nfunction getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n var x1;\n var x2;\n var y1;\n var y2;\n if (layoutOpt === 'radial') {\n x1 = sourceLayout.rawX;\n y1 = sourceLayout.rawY;\n x2 = targetLayout.rawX;\n y2 = targetLayout.rawY;\n var radialCoor1 = radialCoordinate(x1, y1);\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\n var radialCoor4 = radialCoordinate(x2, y2);\n return {\n x1: radialCoor1.x || 0,\n y1: radialCoor1.y || 0,\n x2: radialCoor4.x || 0,\n y2: radialCoor4.y || 0,\n cpx1: radialCoor2.x || 0,\n cpy1: radialCoor2.y || 0,\n cpx2: radialCoor3.x || 0,\n cpy2: radialCoor3.y || 0\n };\n } else {\n x1 = sourceLayout.x;\n y1 = sourceLayout.y;\n x2 = targetLayout.x;\n y2 = targetLayout.y;\n if (orient === 'LR' || orient === 'RL') {\n cpx1 = x1 + (x2 - x1) * curvature;\n cpy1 = y1;\n cpx2 = x2 + (x1 - x2) * curvature;\n cpy2 = y2;\n }\n if (orient === 'TB' || orient === 'BT') {\n cpx1 = x1;\n cpy1 = y1 + (y2 - y1) * curvature;\n cpx2 = x2;\n cpy2 = y2 + (y1 - y2) * curvature;\n }\n }\n return {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n };\n}\nexport default TreeView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Link lists and struct (graph or tree)\n */\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nfunction linkSeriesData(opt) {\n var mainData = opt.mainData;\n var datas = opt.datas;\n if (!datas) {\n datas = {\n main: mainData\n };\n opt.datasAttr = {\n main: 'data'\n };\n }\n opt.datas = opt.mainData = null;\n linkAll(mainData, datas, opt);\n // Porxy data original methods.\n each(datas, function (data) {\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, curry(transferInjection, opt));\n });\n });\n // Beyond transfer, additional features should be added to `cloneShallow`.\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt));\n // Only mainData trigger change, because struct.update may trigger\n // another changable methods, which may bring about dead lock.\n each(mainData.CHANGABLE_METHODS, function (methodName) {\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\n });\n // Make sure datas contains mainData.\n assert(datas[mainData.dataType] === mainData);\n}\nfunction transferInjection(opt, res) {\n if (isMainData(this)) {\n // Transfer datas to new main data.\n var datas = extend({}, inner(this).datas);\n datas[this.dataType] = res;\n linkAll(res, datas, opt);\n } else {\n // Modify the reference in main data to point newData.\n linkSingle(res, this.dataType, inner(this).mainData, opt);\n }\n return res;\n}\nfunction changeInjection(opt, res) {\n opt.struct && opt.struct.update();\n return res;\n}\nfunction cloneShallowInjection(opt, res) {\n // cloneShallow, which brings about some fragilities, may be inappropriate\n // to be exposed as an API. So for implementation simplicity we can make\n // the restriction that cloneShallow of not-mainData should not be invoked\n // outside, but only be invoked here.\n each(inner(res).datas, function (data, dataType) {\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n });\n return res;\n}\n/**\n * Supplement method to List.\n *\n * @public\n * @param [dataType] If not specified, return mainData.\n */\nfunction getLinkedData(dataType) {\n var mainData = inner(this).mainData;\n return dataType == null || mainData == null ? mainData : inner(mainData).datas[dataType];\n}\n/**\n * Get list of all linked data\n */\nfunction getLinkedDataAll() {\n var mainData = inner(this).mainData;\n return mainData == null ? [{\n data: mainData\n }] : map(keys(inner(mainData).datas), function (type) {\n return {\n type: type,\n data: inner(mainData).datas[type]\n };\n });\n}\nfunction isMainData(data) {\n return inner(data).mainData === data;\n}\nfunction linkAll(mainData, datas, opt) {\n inner(mainData).datas = {};\n each(datas, function (data, dataType) {\n linkSingle(data, dataType, mainData, opt);\n });\n}\nfunction linkSingle(data, dataType, mainData, opt) {\n inner(mainData).datas[dataType] = data;\n inner(data).mainData = mainData;\n data.dataType = dataType;\n if (opt.struct) {\n data[opt.structAttr] = opt.struct;\n opt.struct[opt.datasAttr[dataType]] = data;\n }\n // Supplement method.\n data.getLinkedData = getLinkedData;\n data.getLinkedDataAll = getLinkedDataAll;\n}\nexport default linkSeriesData;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Tree data structure\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport linkSeriesData from './helper/linkSeriesData.js';\nimport SeriesData from './SeriesData.js';\nimport prepareSeriesDataSchema from './helper/createDimensions.js';\nimport { convertOptionIdName } from '../util/model.js';\nvar TreeNode = /** @class */function () {\n function TreeNode(name, hostTree) {\n this.depth = 0;\n this.height = 0;\n /**\n * Reference to list item.\n * Do not persistent dataIndex outside,\n * besause it may be changed by list.\n * If dataIndex -1,\n * this node is logical deleted (filtered) in list.\n */\n this.dataIndex = -1;\n this.children = [];\n this.viewChildren = [];\n this.isExpand = false;\n this.name = name || '';\n this.hostTree = hostTree;\n }\n /**\n * The node is removed.\n */\n TreeNode.prototype.isRemoved = function () {\n return this.dataIndex < 0;\n };\n TreeNode.prototype.eachNode = function (options, cb, context) {\n if (zrUtil.isFunction(options)) {\n context = cb;\n cb = options;\n options = null;\n }\n options = options || {};\n if (zrUtil.isString(options)) {\n options = {\n order: options\n };\n }\n var order = options.order || 'preorder';\n var children = this[options.attr || 'children'];\n var suppressVisitSub;\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\n children[i].eachNode(options, cb, context);\n }\n order === 'postorder' && cb.call(context, this);\n };\n /**\n * Update depth and height of this subtree.\n */\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\n var height = 0;\n this.depth = depth;\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n child.updateDepthAndHeight(depth + 1);\n if (child.height > height) {\n height = child.height;\n }\n }\n this.height = height + 1;\n };\n TreeNode.prototype.getNodeById = function (id) {\n if (this.getId() === id) {\n return this;\n }\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].getNodeById(id);\n if (res) {\n return res;\n }\n }\n };\n TreeNode.prototype.contains = function (node) {\n if (node === this) {\n return true;\n }\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].contains(node);\n if (res) {\n return res;\n }\n }\n };\n /**\n * @param includeSelf Default false.\n * @return order: [root, child, grandchild, ...]\n */\n TreeNode.prototype.getAncestors = function (includeSelf) {\n var ancestors = [];\n var node = includeSelf ? this : this.parentNode;\n while (node) {\n ancestors.push(node);\n node = node.parentNode;\n }\n ancestors.reverse();\n return ancestors;\n };\n TreeNode.prototype.getAncestorsIndices = function () {\n var indices = [];\n var currNode = this;\n while (currNode) {\n indices.push(currNode.dataIndex);\n currNode = currNode.parentNode;\n }\n indices.reverse();\n return indices;\n };\n TreeNode.prototype.getDescendantIndices = function () {\n var indices = [];\n this.eachNode(function (childNode) {\n indices.push(childNode.dataIndex);\n });\n return indices;\n };\n TreeNode.prototype.getValue = function (dimension) {\n var data = this.hostTree.data;\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n };\n TreeNode.prototype.setLayout = function (layout, merge) {\n this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\n };\n /**\n * @return {Object} layout\n */\n TreeNode.prototype.getLayout = function () {\n return this.hostTree.data.getItemLayout(this.dataIndex);\n };\n // @depcrecated\n // getModel(path: S): Model\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TreeNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n var hostTree = this.hostTree;\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n // TODO: TYPE More specific model\n TreeNode.prototype.getLevelModel = function () {\n return (this.hostTree.levelModels || [])[this.depth];\n };\n TreeNode.prototype.setVisual = function (key, value) {\n this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\n };\n /**\n * Get item visual\n * FIXME: make return type better\n */\n TreeNode.prototype.getVisual = function (key) {\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\n };\n TreeNode.prototype.getRawIndex = function () {\n return this.hostTree.data.getRawIndex(this.dataIndex);\n };\n TreeNode.prototype.getId = function () {\n return this.hostTree.data.getId(this.dataIndex);\n };\n /**\n * index in parent's children\n */\n TreeNode.prototype.getChildIndex = function () {\n if (this.parentNode) {\n var children = this.parentNode.children;\n for (var i = 0; i < children.length; ++i) {\n if (children[i] === this) {\n return i;\n }\n }\n return -1;\n }\n return -1;\n };\n /**\n * if this is an ancestor of another node\n *\n * @param node another node\n * @return if is ancestor\n */\n TreeNode.prototype.isAncestorOf = function (node) {\n var parent = node.parentNode;\n while (parent) {\n if (parent === this) {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n };\n /**\n * if this is an descendant of another node\n *\n * @param node another node\n * @return if is descendant\n */\n TreeNode.prototype.isDescendantOf = function (node) {\n return node !== this && node.isAncestorOf(this);\n };\n return TreeNode;\n}();\nexport { TreeNode };\n;\nvar Tree = /** @class */function () {\n function Tree(hostModel) {\n this.type = 'tree';\n this._nodes = [];\n this.hostModel = hostModel;\n }\n Tree.prototype.eachNode = function (options, cb, context) {\n this.root.eachNode(options, cb, context);\n };\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\n var rawIndex = this.data.getRawIndex(dataIndex);\n return this._nodes[rawIndex];\n };\n Tree.prototype.getNodeById = function (name) {\n return this.root.getNodeById(name);\n };\n /**\n * Update item available by list,\n * when list has been performed options like 'filterSelf' or 'map'.\n */\n Tree.prototype.update = function () {\n var data = this.data;\n var nodes = this._nodes;\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n };\n /**\n * Clear all layouts\n */\n Tree.prototype.clearLayouts = function () {\n this.data.clearItemLayouts();\n };\n /**\n * data node format:\n * {\n * name: ...\n * value: ...\n * children: [\n * {\n * name: ...\n * value: ...\n * children: ...\n * },\n * ...\n * ]\n * }\n */\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\n var tree = new Tree(hostModel);\n var listData = [];\n var dimMax = 1;\n buildHierarchy(dataRoot);\n function buildHierarchy(dataNode, parentNode) {\n var value = dataNode.value;\n dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1);\n listData.push(dataNode);\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\n parentNode ? addChild(node, parentNode) : tree.root = node;\n tree._nodes.push(node);\n var children = dataNode.children;\n if (children) {\n for (var i = 0; i < children.length; i++) {\n buildHierarchy(children[i], node);\n }\n }\n }\n tree.root.updateDepthAndHeight(0);\n var dimensions = prepareSeriesDataSchema(listData, {\n coordDimensions: ['value'],\n dimensionsCount: dimMax\n }).dimensions;\n var list = new SeriesData(dimensions, hostModel);\n list.initData(listData);\n beforeLink && beforeLink(list);\n linkSeriesData({\n mainData: list,\n struct: tree,\n structAttr: 'tree'\n });\n tree.update();\n return tree;\n };\n return Tree;\n}();\n/**\n * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,\n * so this function is not ready and not necessary to be public.\n */\nfunction addChild(child, node) {\n var children = node.children;\n if (child.parentNode === node) {\n return;\n }\n children.push(child);\n child.parentNode = node;\n}\nexport default Tree;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\n if (payload && zrUtil.indexOf(validPayloadTypes, payload.type) >= 0) {\n var root = seriesModel.getData().tree.root;\n var targetNode = payload.targetNode;\n if (zrUtil.isString(targetNode)) {\n targetNode = root.getNodeById(targetNode);\n }\n if (targetNode && root.contains(targetNode)) {\n return {\n node: targetNode\n };\n }\n var targetNodeId = payload.targetNodeId;\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\n return {\n node: targetNode\n };\n }\n }\n}\n// Not includes the given node at the last item.\nexport function getPathToRoot(node) {\n var path = [];\n while (node) {\n node = node.parentNode;\n node && path.push(node);\n }\n return path.reverse();\n}\nexport function aboveViewRoot(viewRoot, node) {\n var viewPath = getPathToRoot(viewRoot);\n return zrUtil.indexOf(viewPath, node) >= 0;\n}\n// From root to the input node (the input node will be included).\nexport function wrapTreePathInfo(node, seriesModel) {\n var treePathInfo = [];\n while (node) {\n var nodeDataIndex = node.dataIndex;\n treePathInfo.push({\n name: node.name,\n dataIndex: nodeDataIndex,\n value: seriesModel.getRawValue(nodeDataIndex)\n });\n node = node.parentNode;\n }\n treePathInfo.reverse();\n return treePathInfo;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nvar TreeSeriesModel = /** @class */function (_super) {\n __extends(TreeSeriesModel, _super);\n function TreeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.hasSymbolVisual = true;\n // Do it self.\n _this.ignoreStyleOnData = true;\n return _this;\n }\n /**\n * Init a tree data structure from data in option series\n */\n TreeSeriesModel.prototype.getInitialData = function (option) {\n // create a virtual root\n var root = {\n name: option.name,\n children: option.data\n };\n var leaves = option.leaves || {};\n var leavesModel = new Model(leaves, this, this.ecModel);\n var tree = Tree.createTree(root, this, beforeLink);\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n if (!(node && node.children.length && node.isExpand)) {\n model.parentModel = leavesModel;\n }\n return model;\n });\n }\n var treeDepth = 0;\n tree.eachNode('preorder', function (node) {\n if (node.depth > treeDepth) {\n treeDepth = node.depth;\n }\n });\n var expandAndCollapse = option.expandAndCollapse;\n var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\n tree.root.eachNode('preorder', function (node) {\n var item = node.hostTree.data.getRawDataItem(node.dataIndex);\n // Add item.collapsed != null, because users can collapse node original in the series.data.\n node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\n });\n return tree.data;\n };\n /**\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\n * @returns {string} orient\n */\n TreeSeriesModel.prototype.getOrient = function () {\n var orient = this.get('orient');\n if (orient === 'horizontal') {\n orient = 'LR';\n } else if (orient === 'vertical') {\n orient = 'TB';\n }\n return orient;\n };\n TreeSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n TreeSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var tree = this.getData().tree;\n var realRoot = tree.root.children[0];\n var node = tree.getNodeByDataIndex(dataIndex);\n var value = node.getValue();\n var name = node.name;\n while (node && node !== realRoot) {\n name = node.parentNode.name + '.' + name;\n node = node.parentNode;\n }\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value,\n noValue: isNaN(value) || value == null\n });\n };\n // Add tree path to tooltip param\n TreeSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treeAncestors = wrapTreePathInfo(node, this);\n params.collapsed = !node.isExpand;\n return params;\n };\n TreeSeriesModel.type = 'series.tree';\n // can support the position parameters 'left', 'top','right','bottom', 'width',\n // 'height' in the setOption() with 'merge' mode normal.\n TreeSeriesModel.layoutMode = 'box';\n TreeSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // the position of the whole view\n left: '12%',\n top: '12%',\n right: '12%',\n bottom: '12%',\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\n layout: 'orthogonal',\n // value can be 'polyline'\n edgeShape: 'curve',\n edgeForkPosition: '50%',\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n roam: false,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.4,\n // Default on center of graph\n center: null,\n zoom: 1,\n orient: 'LR',\n symbol: 'emptyCircle',\n symbolSize: 7,\n expandAndCollapse: true,\n initialTreeDepth: 2,\n lineStyle: {\n color: '#ccc',\n width: 1.5,\n curveness: 0.5\n },\n itemStyle: {\n color: 'lightsteelblue',\n // borderColor: '#c23531',\n borderWidth: 1.5\n },\n label: {\n show: true\n },\n animationEasing: 'linear',\n animationDuration: 700,\n animationDurationUpdate: 500\n };\n return TreeSeriesModel;\n}(SeriesModel);\nexport default TreeSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Traverse the tree from bottom to top and do something\n */\nfunction eachAfter(root, callback, separation) {\n var nodes = [root];\n var next = [];\n var node;\n while (node = nodes.pop()) {\n // jshint ignore:line\n next.push(node);\n if (node.isExpand) {\n var children = node.children;\n if (children.length) {\n for (var i = 0; i < children.length; i++) {\n nodes.push(children[i]);\n }\n }\n }\n }\n while (node = next.pop()) {\n // jshint ignore:line\n callback(node, separation);\n }\n}\n/**\n * Traverse the tree from top to bottom and do something\n */\nfunction eachBefore(root, callback) {\n var nodes = [root];\n var node;\n while (node = nodes.pop()) {\n // jshint ignore:line\n callback(node);\n if (node.isExpand) {\n var children = node.children;\n if (children.length) {\n for (var i = children.length - 1; i >= 0; i--) {\n nodes.push(children[i]);\n }\n }\n }\n }\n}\nexport { eachAfter, eachBefore };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { eachAfter, eachBefore } from './traversalHelper.js';\nimport { init, firstWalk, secondWalk, separation as sep, radialCoordinate, getViewRect } from './layoutHelper.js';\nexport default function treeLayout(ecModel, api) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n commonLayout(seriesModel, api);\n });\n}\nfunction commonLayout(seriesModel, api) {\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var layout = seriesModel.get('layout');\n var width = 0;\n var height = 0;\n var separation = null;\n if (layout === 'radial') {\n width = 2 * Math.PI;\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\n separation = sep(function (node1, node2) {\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\n });\n } else {\n width = layoutInfo.width;\n height = layoutInfo.height;\n separation = sep();\n }\n var virtualRoot = seriesModel.getData().tree.root;\n var realRoot = virtualRoot.children[0];\n if (realRoot) {\n init(virtualRoot);\n eachAfter(realRoot, firstWalk, separation);\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\n eachBefore(realRoot, secondWalk);\n var left_1 = realRoot;\n var right_1 = realRoot;\n var bottom_1 = realRoot;\n eachBefore(realRoot, function (node) {\n var x = node.getLayout().x;\n if (x < left_1.getLayout().x) {\n left_1 = node;\n }\n if (x > right_1.getLayout().x) {\n right_1 = node;\n }\n if (node.depth > bottom_1.depth) {\n bottom_1 = node;\n }\n });\n var delta = left_1 === right_1 ? 1 : separation(left_1, right_1) / 2;\n var tx_1 = delta - left_1.getLayout().x;\n var kx_1 = 0;\n var ky_1 = 0;\n var coorX_1 = 0;\n var coorY_1 = 0;\n if (layout === 'radial') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\n // here we use (node.depth - 1), bucause the real root's depth is 1\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = (node.depth - 1) * ky_1;\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\n node.setLayout({\n x: finalCoor.x,\n y: finalCoor.y,\n rawX: coorX_1,\n rawY: coorY_1\n }, true);\n });\n } else {\n var orient_1 = seriesModel.getOrient();\n if (orient_1 === 'RL' || orient_1 === 'LR') {\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\n kx_1 = width / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\n coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n } else if (orient_1 === 'TB' || orient_1 === 'BT') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n }\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nexport default function treeVisual(ecModel) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel();\n // TODO Optimize\n var style = model.getModel('itemStyle').getItemStyle();\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nexport function installTreeAction(registers) {\n registers.registerAction({\n type: 'treeExpandAndCollapse',\n event: 'treeExpandAndCollapse',\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var dataIndex = payload.dataIndex;\n var tree = seriesModel.getData().tree;\n var node = tree.getNodeByDataIndex(dataIndex);\n node.isExpand = !node.isExpand;\n });\n });\n registers.registerAction({\n type: 'treeRoam',\n event: 'treeRoam',\n // Here we set 'none' instead of 'update', because roam action\n // just need to update the transform matrix without having to recalculate\n // the layout. So don't need to go through the whole update process, such\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\n update: 'none'\n }, function (payload, ecModel, api) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload, undefined, api);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport TreeView from './TreeView.js';\nimport TreeSeriesModel from './TreeSeries.js';\nimport treeLayout from './treeLayout.js';\nimport treeVisual from './treeVisual.js';\nimport { installTreeAction } from './treeAction.js';\nexport function install(registers) {\n registers.registerChartView(TreeView);\n registers.registerSeriesModel(TreeSeriesModel);\n registers.registerLayout(treeLayout);\n registers.registerVisual(treeVisual);\n installTreeAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as helper from '../helper/treeHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove'];\nexport function installTreemapAction(registers) {\n for (var i = 0; i < actionTypes.length; i++) {\n registers.registerAction({\n type: actionTypes[i],\n update: 'updateView'\n }, noop);\n }\n registers.registerAction({\n type: 'treemapRootToNode',\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n }, handleRootToNode);\n function handleRootToNode(model, index) {\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, model);\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n if (originViewRoot) {\n payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n model.resetViewRoot(targetInfo.node);\n }\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { getDecalFromPalette } from '../../model/mixin/palette.js';\nexport default function enableAriaDecalForTree(seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n var decalPaletteScope = {};\n tree.eachNode(function (node) {\n // Use decal of level 1 node\n var current = node;\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\n node.setVisual('decal', decal);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\nvar TreemapSeriesModel = /** @class */function (_super) {\n __extends(TreemapSeriesModel, _super);\n function TreemapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TreemapSeriesModel.type;\n _this.preventUsingHoverLayer = true;\n return _this;\n }\n /**\n * @override\n */\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levels = option.levels || [];\n // Used in \"visual priority\" in `treemapVisual.js`.\n // This way is a little tricky, must satisfy the precondition:\n // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.\n // 2. The `Model.prototype.getModel()` will not use any clone-like way.\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\n var designatedVisualModel = new Model({\n itemStyle: designatedVisualItemStyle\n }, this, ecModel);\n levels = option.levels = setDefault(levels, ecModel);\n var levelModels = zrUtil.map(levels || [], function (levelDefine) {\n return new Model(levelDefine, designatedVisualModel, ecModel);\n }, this);\n // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n var tree = Tree.createTree(root, this, beforeLink);\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = node ? levelModels[node.depth] : null;\n // If no levelModel, we also need `designatedVisualModel`.\n model.parentModel = levelModel || designatedVisualModel;\n return model;\n });\n }\n return tree.data;\n };\n TreemapSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /**\n * @override\n * @param {number} dataIndex\n * @param {boolean} [mutipleSeries=false]\n */\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n /**\n * Add tree path to tooltip param\n *\n * @override\n * @param {number} dataIndex\n * @return {Object}\n */\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treeAncestors = wrapTreePathInfo(node, this);\n // compatitable the previous code.\n params.treePathInfo = params.treeAncestors;\n return params;\n };\n /**\n * @public\n * @param {Object} layoutInfo {\n * x: containerGroup x\n * y: containerGroup y\n * width: containerGroup width\n * height: containerGroup height\n * }\n */\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\n /**\n * @readOnly\n * @type {Object}\n */\n this.layoutInfo = this.layoutInfo || {};\n zrUtil.extend(this.layoutInfo, layoutInfo);\n };\n /**\n * @param {string} id\n * @return {number} index\n */\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\n // A feature is implemented:\n // index is monotone increasing with the sequence of\n // input id at the first time.\n // This feature can make sure that each data item and its\n // mapped color have the same index between data list and\n // color list at the beginning, which is useful for user\n // to adjust data-color mapping.\n /**\n * @private\n * @type {Object}\n */\n var idIndexMap = this._idIndexMap;\n if (!idIndexMap) {\n idIndexMap = this._idIndexMap = zrUtil.createHashMap();\n /**\n * @private\n * @type {number}\n */\n this._idIndexMapCount = 0;\n }\n var index = idIndexMap.get(id);\n if (index == null) {\n idIndexMap.set(id, index = this._idIndexMapCount++);\n }\n return index;\n };\n TreemapSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n TreemapSeriesModel.type = 'series.treemap';\n TreemapSeriesModel.layoutMode = 'box';\n TreemapSeriesModel.defaultOption = {\n // Disable progressive rendering\n progressive: 0,\n // size: ['80%', '80%'], // deprecated, compatible with ec2.\n left: 'center',\n top: 'middle',\n width: '80%',\n height: '80%',\n sort: true,\n clipWindow: 'origin',\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\n leafDepth: null,\n drillDownIcon: '▶',\n // to align specialized icon. ▷▶❒❐▼✚\n zoomToNodeRatio: 0.32 * 0.32,\n scaleLimit: null,\n roam: true,\n nodeClick: 'zoomToNode',\n animation: true,\n animationDurationUpdate: 900,\n animationEasing: 'quinticInOut',\n breadcrumb: {\n show: true,\n height: 22,\n left: 'center',\n top: 'bottom',\n // right\n // bottom\n emptyItemWidth: 25,\n itemStyle: {\n color: 'rgba(0,0,0,0.7)',\n textStyle: {\n color: '#fff'\n }\n },\n emphasis: {\n itemStyle: {\n color: 'rgba(0,0,0,0.9)' // '#5793f3',\n }\n }\n },\n\n label: {\n show: true,\n // Do not use textDistance, for ellipsis rect just the same as treemap node rect.\n distance: 0,\n padding: 5,\n position: 'inside',\n // formatter: null,\n color: '#fff',\n overflow: 'truncate'\n // align\n // verticalAlign\n },\n\n upperLabel: {\n show: false,\n position: [0, '50%'],\n height: 20,\n // formatter: null,\n // color: '#fff',\n overflow: 'truncate',\n // align: null,\n verticalAlign: 'middle'\n },\n itemStyle: {\n color: null,\n colorAlpha: null,\n colorSaturation: null,\n borderWidth: 0,\n gapWidth: 0,\n borderColor: '#fff',\n borderColorSaturation: null // If specified, borderColor will be ineffective, and the\n // border color is evaluated by color of current node and\n // borderColorSaturation.\n },\n\n emphasis: {\n upperLabel: {\n show: true,\n position: [0, '50%'],\n overflow: 'truncate',\n verticalAlign: 'middle'\n }\n },\n visualDimension: 0,\n visualMin: null,\n visualMax: null,\n color: [],\n // level[n].color (if necessary).\n // + Specify color list of each level. level[0].color would be global\n // color list if not specified. (see method `setDefault`).\n // + But set as a empty array to forbid fetch color from global palette\n // when using nodeModel.get('color'), otherwise nodes on deep level\n // will always has color palette set and are not able to inherit color\n // from parent node.\n // + TreemapSeries.color can not be set as 'none', otherwise effect\n // legend color fetching (see seriesColor.js).\n colorAlpha: null,\n colorSaturation: null,\n colorMappingBy: 'index',\n visibleMin: 10,\n // be rendered. Only works when sort is 'asc' or 'desc'.\n childrenVisibleMin: null,\n // grandchildren will not show.\n // Why grandchildren? If not grandchildren but children,\n // some siblings show children and some not,\n // the appearance may be mess and not consistent,\n levels: [] // Each item: {\n // visibleMin, itemStyle, visualDimension, label\n // }\n };\n\n return TreemapSeriesModel;\n}(SeriesModel);\n/**\n * @param {Object} dataNode\n */\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value;\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n }\n // Value should not less than 0.\n if (thisValue < 0) {\n thisValue = 0;\n }\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n/**\n * set default to level configuration\n */\nfunction setDefault(levels, ecModel) {\n var globalColorList = normalizeToArray(ecModel.get('color'));\n var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n if (!globalColorList) {\n return;\n }\n levels = levels || [];\n var hasColorDefine;\n var hasDecalDefine;\n zrUtil.each(levels, function (levelDefine) {\n var model = new Model(levelDefine);\n var modelColor = model.get('color');\n var modelDecal = model.get('decal');\n if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') {\n hasColorDefine = true;\n }\n if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') {\n hasDecalDefine = true;\n }\n });\n var level0 = levels[0] || (levels[0] = {});\n if (!hasColorDefine) {\n level0.color = globalColorList.slice();\n }\n if (!hasDecalDefine && globalDecalList) {\n level0.decal = globalDecalList.slice();\n }\n return levels;\n}\nexport default TreemapSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport * as layout from '../../util/layout.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { curry, defaults } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName } from '../../util/model.js';\nimport { toggleHoverEmphasis, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar TEXT_PADDING = 8;\nvar ITEM_GAP = 8;\nvar ARRAY_LENGTH = 5;\nvar Breadcrumb = /** @class */function () {\n function Breadcrumb(containerGroup) {\n this.group = new graphic.Group();\n containerGroup.add(this.group);\n }\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\n var model = seriesModel.getModel('breadcrumb');\n var thisGroup = this.group;\n thisGroup.removeAll();\n if (!model.get('show') || !targetNode) {\n return;\n }\n var normalStyleModel = model.getModel('itemStyle');\n var emphasisModel = model.getModel('emphasis');\n var textStyleModel = normalStyleModel.getModel('textStyle');\n var emphasisTextStyleModel = emphasisModel.getModel(['itemStyle', 'textStyle']);\n var layoutParam = {\n pos: {\n left: model.get('left'),\n right: model.get('right'),\n top: model.get('top'),\n bottom: model.get('bottom')\n },\n box: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n emptyItemWidth: model.get('emptyItemWidth'),\n totalWidth: 0,\n renderList: []\n };\n this._prepare(targetNode, layoutParam, textStyleModel);\n this._renderContent(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect);\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\n };\n /**\n * Prepare render list and total width\n * @private\n */\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\n for (var node = targetNode; node; node = node.parentNode) {\n var text = convertOptionIdName(node.getModel().get('name'), '');\n var textRect = textStyleModel.getTextRect(text);\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\n layoutParam.renderList.push({\n node: node,\n text: text,\n width: itemWidth\n });\n }\n };\n /**\n * @private\n */\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect) {\n // Start rendering.\n var lastX = 0;\n var emptyItemWidth = layoutParam.emptyItemWidth;\n var height = seriesModel.get(['breadcrumb', 'height']);\n var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\n var totalWidth = layoutParam.totalWidth;\n var renderList = layoutParam.renderList;\n var emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n for (var i = renderList.length - 1; i >= 0; i--) {\n var item = renderList[i];\n var itemNode = item.node;\n var itemWidth = item.width;\n var text = item.text;\n // Hdie text and shorten width if necessary.\n if (totalWidth > availableSize.width) {\n totalWidth -= itemWidth - emptyItemWidth;\n itemWidth = emptyItemWidth;\n text = null;\n }\n var el = new graphic.Polygon({\n shape: {\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\n },\n style: defaults(normalStyleModel.getItemStyle(), {\n lineJoin: 'bevel'\n }),\n textContent: new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: text\n })\n }),\n textConfig: {\n position: 'inside'\n },\n z2: Z2_EMPHASIS_LIFT * 1e4,\n onclick: curry(onSelect, itemNode)\n });\n el.disableLabelAnimation = true;\n el.getTextContent().ensureState('emphasis').style = createTextStyle(emphasisTextStyleModel, {\n text: text\n });\n el.ensureState('emphasis').style = emphasisItemStyle;\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n this.group.add(el);\n packEventData(el, seriesModel, itemNode);\n lastX += itemWidth + ITEM_GAP;\n }\n };\n Breadcrumb.prototype.remove = function () {\n this.group.removeAll();\n };\n return Breadcrumb;\n}();\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\n var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\n !head && points.push([x, y + itemHeight / 2]);\n return points;\n}\n// Package custom mouse event.\nfunction packEventData(el, seriesModel, itemNode) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'treemap',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.seriesIndex,\n seriesName: seriesModel.name,\n seriesType: 'treemap',\n selfType: 'breadcrumb',\n nodeData: {\n dataIndex: itemNode && itemNode.dataIndex,\n name: itemNode && itemNode.name\n },\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\n };\n}\nexport default Breadcrumb;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Animate multiple elements with a single done-callback.\n *\n * @example\n * animation\n * .createWrap()\n * .add(el1, {x: 10, y: 10})\n * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)\n * .done(function () { // done })\n * .start('cubicOut');\n */\nvar AnimationWrap = /** @class */function () {\n function AnimationWrap() {\n this._storage = [];\n this._elExistsMap = {};\n }\n /**\n * Caution: a el can only be added once, otherwise 'done'\n * might not be called. This method checks this (by el.id),\n * suppresses adding and returns false when existing el found.\n *\n * @return Whether adding succeeded.\n */\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\n if (this._elExistsMap[el.id]) {\n return false;\n }\n this._elExistsMap[el.id] = true;\n this._storage.push({\n el: el,\n target: target,\n duration: duration,\n delay: delay,\n easing: easing\n });\n return true;\n };\n /**\n * Only execute when animation done/aborted.\n */\n AnimationWrap.prototype.finished = function (callback) {\n this._finishedCallback = callback;\n return this;\n };\n /**\n * Will stop exist animation firstly.\n */\n AnimationWrap.prototype.start = function () {\n var _this = this;\n var count = this._storage.length;\n var checkTerminate = function () {\n count--;\n if (count <= 0) {\n // Guard.\n _this._storage.length = 0;\n _this._elExistsMap = {};\n _this._finishedCallback && _this._finishedCallback();\n }\n };\n for (var i = 0, len = this._storage.length; i < len; i++) {\n var item = this._storage[i];\n item.el.animateTo(item.target, {\n duration: item.duration,\n delay: item.delay,\n easing: item.easing,\n setToFinal: true,\n done: checkTerminate,\n aborted: checkTerminate\n });\n }\n return this;\n };\n return AnimationWrap;\n}();\nexport function createWrap() {\n return new AnimationWrap();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, indexOf, curry, extend, normalizeCssArray, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isHighDownDispatcher, setAsHighDownDispatcher, setDefaultStateProxy, enableHoverFocus, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as helper from '../helper/treeHelper.js';\nimport Breadcrumb from './Breadcrumb.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as animationUtil from '../../util/animation.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport ChartView from '../../view/Chart.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner, convertOptionIdName } from '../../util/model.js';\nimport { windowOpen } from '../../util/format.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nvar Group = graphic.Group;\nvar Rect = graphic.Rect;\nvar DRAG_THRESHOLD = 3;\nvar PATH_LABEL_NOAMAL = 'label';\nvar PATH_UPPERLABEL_NORMAL = 'upperLabel';\n// Should larger than emphasis states lift z\nvar Z2_BASE = Z2_EMPHASIS_LIFT * 10; // Should bigger than every z2.\nvar Z2_BG = Z2_EMPHASIS_LIFT * 2;\nvar Z2_CONTENT = Z2_EMPHASIS_LIFT * 3;\nvar getStateItemStyle = makeStyleMapper([['fill', 'color'],\n// `borderColor` and `borderWidth` has been occupied,\n// so use `stroke` to indicate the stroke of the rect.\n['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor']\n// Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n]);\n\nvar getItemStyleNormal = function (model) {\n // Normal style props should include emphasis style props.\n var itemStyle = getStateItemStyle(model);\n // Clear styles set by emphasis.\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\n return itemStyle;\n};\nvar inner = makeInner();\nvar TreemapView = /** @class */function (_super) {\n __extends(TreemapView, _super);\n function TreemapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TreemapView.type;\n _this._state = 'ready';\n _this._storage = createStorage();\n return _this;\n }\n /**\n * @override\n */\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var models = ecModel.findComponents({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n });\n if (indexOf(models, seriesModel) < 0) {\n return;\n }\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var payloadType = payload && payload.type;\n var layoutInfo = seriesModel.layoutInfo;\n var isInit = !this._oldTree;\n var thisStorage = this._storage;\n // Mark new root when action is treemapRootToNode.\n var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? {\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\n direction: payload.direction\n } : null;\n var containerGroup = this._giveContainerGroup(layoutInfo);\n var hasAnimation = seriesModel.get('animation');\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\n hasAnimation && !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally();\n this._resetController(api);\n this._renderBreadcrumb(seriesModel, api, targetInfo);\n };\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\n var containerGroup = this._containerGroup;\n if (!containerGroup) {\n // FIXME\n // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。\n containerGroup = this._containerGroup = new Group();\n this._initEvents(containerGroup);\n this.group.add(containerGroup);\n }\n containerGroup.x = layoutInfo.x;\n containerGroup.y = layoutInfo.y;\n return containerGroup;\n };\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\n var thisTree = seriesModel.getData().tree;\n var oldTree = this._oldTree;\n // Clear last shape records.\n var lastsForAnimation = createStorage();\n var thisStorage = createStorage();\n var oldStorage = this._storage;\n var willInvisibleEls = [];\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\n }\n // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow),\n // the oldTree is actually losted, so we cannot find all of the old graphic\n // elements from tree. So we use this strategy: make element storage, move\n // from old storage to new storage, clear old storage.\n dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0);\n // Process all removing.\n var willDeleteEls = clearStorage(oldStorage);\n this._oldTree = thisTree;\n this._storage = thisStorage;\n if (this._controllerHost) {\n var _oldRootLayout = this.seriesModel.layoutInfo;\n var rootLayout = thisTree.root.getLayout();\n if (rootLayout.width === _oldRootLayout.width && rootLayout.height === _oldRootLayout.height) {\n this._controllerHost.zoom = 1;\n }\n }\n return {\n lastsForAnimation: lastsForAnimation,\n willDeleteEls: willDeleteEls,\n renderFinally: renderFinally\n };\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\n // When 'render' is triggered by action,\n // 'this' and 'old' may be the same tree,\n // we use rawIndex in that case.\n if (sameTree) {\n oldViewChildren = thisViewChildren;\n each(thisViewChildren, function (child, index) {\n !child.isRemoved() && processNode(index, index);\n });\n }\n // Diff hierarchically (diff only in each subtree, but not whole).\n // because, consistency of view is important.\n else {\n new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute();\n }\n function getKey(node) {\n // Identify by name or raw index.\n return node.getId();\n }\n function processNode(newIndex, oldIndex) {\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\n }\n }\n function clearStorage(storage) {\n var willDeleteEls = createStorage();\n storage && each(storage, function (store, storageName) {\n var delEls = willDeleteEls[storageName];\n each(store, function (el) {\n el && (delEls.push(el), inner(el).willDelete = true);\n });\n });\n return willDeleteEls;\n }\n function renderFinally() {\n each(willDeleteEls, function (els) {\n each(els, function (el) {\n el.parent && el.parent.remove(el);\n });\n });\n each(willInvisibleEls, function (el) {\n el.invisible = true;\n // Setting invisible is for optimizing, so no need to set dirty,\n // just mark as invisible.\n el.dirty();\n });\n }\n };\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\n var durationOption = seriesModel.get('animationDurationUpdate');\n var easingOption = seriesModel.get('animationEasing');\n // TODO: do not support function until necessary.\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\n var animationWrap = animationUtil.createWrap();\n // Make delete animations.\n each(renderResult.willDeleteEls, function (store, storageName) {\n each(store, function (el, rawIndex) {\n if (el.invisible) {\n return;\n }\n var parent = el.parent; // Always has parent, and parent is nodeGroup.\n var target;\n var innerStore = inner(parent);\n if (reRoot && reRoot.direction === 'drillDown') {\n target = parent === reRoot.rootNodeGroup\n // This is the content element of view root.\n // Only `content` will enter this branch, because\n // `background` and `nodeGroup` will not be deleted.\n ? {\n shape: {\n x: 0,\n y: 0,\n width: innerStore.nodeWidth,\n height: innerStore.nodeHeight\n },\n style: {\n opacity: 0\n }\n }\n // Others.\n : {\n style: {\n opacity: 0\n }\n };\n } else {\n var targetX = 0;\n var targetY = 0;\n if (!innerStore.willDelete) {\n // Let node animate to right-bottom corner, cooperating with fadeout,\n // which is appropriate for user understanding.\n // Divided by 2 for reRoot rolling up effect.\n targetX = innerStore.nodeWidth / 2;\n targetY = innerStore.nodeHeight / 2;\n }\n target = storageName === 'nodeGroup' ? {\n x: targetX,\n y: targetY,\n style: {\n opacity: 0\n }\n } : {\n shape: {\n x: targetX,\n y: targetY,\n width: 0,\n height: 0\n },\n style: {\n opacity: 0\n }\n };\n }\n // TODO: do not support delay until necessary.\n target && animationWrap.add(el, target, duration, 0, easing);\n });\n });\n // Make other animations\n each(this._storage, function (store, storageName) {\n each(store, function (el, rawIndex) {\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\n var target = {};\n if (!last) {\n return;\n }\n if (el instanceof graphic.Group) {\n if (last.oldX != null) {\n target.x = el.x;\n target.y = el.y;\n el.x = last.oldX;\n el.y = last.oldY;\n }\n } else {\n if (last.oldShape) {\n target.shape = extend({}, el.shape);\n el.setShape(last.oldShape);\n }\n if (last.fadein) {\n el.setStyle('opacity', 0);\n target.style = {\n opacity: 1\n };\n }\n // When animation is stopped for succedent animation starting,\n // el.style.opacity might not be 1\n else if (el.style.opacity !== 1) {\n target.style = {\n opacity: 1\n };\n }\n }\n animationWrap.add(el, target, duration, 0, easing);\n });\n }, this);\n this._state = 'animating';\n animationWrap.finished(bind(function () {\n this._state = 'ready';\n renderResult.renderFinally();\n }, this)).start();\n };\n TreemapView.prototype._resetController = function (api) {\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n if (!controllerHost) {\n this._controllerHost = {\n target: this.group\n };\n controllerHost = this._controllerHost;\n }\n // Init controller.\n if (!controller) {\n controller = this._controller = new RoamController(api.getZr());\n controller.enable(this.seriesModel.get('roam'));\n controllerHost.zoomLimit = this.seriesModel.get('scaleLimit');\n controllerHost.zoom = this.seriesModel.get('zoom');\n controller.on('pan', bind(this._onPan, this));\n controller.on('zoom', bind(this._onZoom, this));\n }\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\n controller.setPointerChecker(function (e, x, y) {\n return rect.contain(x, y);\n });\n };\n TreemapView.prototype._clearController = function () {\n var controller = this._controller;\n this._controllerHost = null;\n if (controller) {\n controller.dispose();\n controller = null;\n }\n };\n TreemapView.prototype._onPan = function (e) {\n if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n if (!root) {\n return;\n }\n var rootLayout = root.getLayout();\n if (!rootLayout) {\n return;\n }\n this.api.dispatchAction({\n type: 'treemapMove',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rootLayout.x + e.dx,\n y: rootLayout.y + e.dy,\n width: rootLayout.width,\n height: rootLayout.height\n }\n });\n }\n };\n TreemapView.prototype._onZoom = function (e) {\n var mouseX = e.originX;\n var mouseY = e.originY;\n var zoomDelta = e.scale;\n if (this._state !== 'animating') {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n if (!root) {\n return;\n }\n var rootLayout = root.getLayout();\n if (!rootLayout) {\n return;\n }\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\n // scaleLimit\n var zoomLimit = null;\n var _controllerHost = this._controllerHost;\n zoomLimit = _controllerHost.zoomLimit;\n var newZoom = _controllerHost.zoom = _controllerHost.zoom || 1;\n newZoom *= zoomDelta;\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n }\n var zoomScale = newZoom / _controllerHost.zoom;\n _controllerHost.zoom = newZoom;\n var layoutInfo = this.seriesModel.layoutInfo;\n // Transform mouse coord from global to containerGroup.\n mouseX -= layoutInfo.x;\n mouseY -= layoutInfo.y;\n // Scale root bounding rect.\n var m = matrix.create();\n matrix.translate(m, m, [-mouseX, -mouseY]);\n matrix.scale(m, m, [zoomScale, zoomScale]);\n matrix.translate(m, m, [mouseX, mouseY]);\n rect.applyTransform(m);\n this.api.dispatchAction({\n type: 'treemapRender',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n }\n };\n TreemapView.prototype._initEvents = function (containerGroup) {\n var _this = this;\n containerGroup.on('click', function (e) {\n if (_this._state !== 'ready') {\n return;\n }\n var nodeClick = _this.seriesModel.get('nodeClick', true);\n if (!nodeClick) {\n return;\n }\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\n if (!targetInfo) {\n return;\n }\n var node = targetInfo.node;\n if (node.getLayout().isLeafRoot) {\n _this._rootToNode(targetInfo);\n } else {\n if (nodeClick === 'zoomToNode') {\n _this._zoomToNode(targetInfo);\n } else if (nodeClick === 'link') {\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\n var link = itemModel.get('link', true);\n var linkTarget = itemModel.get('target', true) || 'blank';\n link && windowOpen(link, linkTarget);\n }\n }\n }, this);\n };\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\n var _this = this;\n if (!targetInfo) {\n targetInfo = seriesModel.get('leafDepth', true) != null ? {\n node: seriesModel.getViewRoot()\n }\n // FIXME\n // better way?\n // Find breadcrumb tail on center of containerGroup.\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\n if (!targetInfo) {\n targetInfo = {\n node: seriesModel.getData().tree.root\n };\n }\n }\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) {\n if (_this._state !== 'animating') {\n helper.aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({\n node: node\n }) : _this._zoomToNode({\n node: node\n });\n }\n });\n };\n /**\n * @override\n */\n TreemapView.prototype.remove = function () {\n this._clearController();\n this._containerGroup && this._containerGroup.removeAll();\n this._storage = createStorage();\n this._state = 'ready';\n this._breadcrumb && this._breadcrumb.remove();\n };\n TreemapView.prototype.dispose = function () {\n this._clearController();\n };\n TreemapView.prototype._zoomToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapZoomToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n TreemapView.prototype._rootToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapRootToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n /**\n * @public\n * @param {number} x Global coord x.\n * @param {number} y Global coord y.\n * @return {Object} info If not found, return undefined;\n * @return {number} info.node Target node.\n * @return {number} info.offsetX x refer to target node.\n * @return {number} info.offsetY y refer to target node.\n */\n TreemapView.prototype.findTarget = function (x, y) {\n var targetInfo;\n var viewRoot = this.seriesModel.getViewRoot();\n viewRoot.eachNode({\n attr: 'viewChildren',\n order: 'preorder'\n }, function (node) {\n var bgEl = this._storage.background[node.getRawIndex()];\n // If invisible, there might be no element.\n if (bgEl) {\n var point = bgEl.transformCoordToLocal(x, y);\n var shape = bgEl.shape;\n // For performance consideration, don't use 'getBoundingRect'.\n if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) {\n targetInfo = {\n node: node,\n offsetX: point[0],\n offsetY: point[1]\n };\n } else {\n return false; // Suppress visit subtree.\n }\n }\n }, this);\n return targetInfo;\n };\n TreemapView.type = 'treemap';\n return TreemapView;\n}(ChartView);\n/**\n * @inner\n */\nfunction createStorage() {\n return {\n nodeGroup: [],\n background: [],\n content: []\n };\n}\n/**\n * @inner\n * @return Return undefined means do not travel further.\n */\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\n // Whether under viewRoot.\n if (!thisNode) {\n // Deleting nodes will be performed finally. This method just find\n // element from old storage, or create new element, set them to new\n // storage, and set styles.\n return;\n }\n // -------------------------------------------------------------------\n // Start of closure variables available in \"Procedures in renderNode\".\n var thisLayout = thisNode.getLayout();\n var data = seriesModel.getData();\n var nodeModel = thisNode.getModel();\n // Only for enabling highlight/downplay. Clear firstly.\n // Because some node will not be rendered.\n data.setItemGraphicEl(thisNode.dataIndex, null);\n if (!thisLayout || !thisLayout.isInView) {\n return;\n }\n var thisWidth = thisLayout.width;\n var thisHeight = thisLayout.height;\n var borderWidth = thisLayout.borderWidth;\n var thisInvisible = thisLayout.invisible;\n var thisRawIndex = thisNode.getRawIndex();\n var oldRawIndex = oldNode && oldNode.getRawIndex();\n var thisViewChildren = thisNode.viewChildren;\n var upperHeight = thisLayout.upperHeight;\n var isParent = thisViewChildren && thisViewChildren.length;\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0;\n // End of closure ariables available in \"Procedures in renderNode\".\n // -----------------------------------------------------------------\n // Node group\n var group = giveGraphic('nodeGroup', Group);\n if (!group) {\n return;\n }\n parentGroup.add(group);\n // x,y are not set when el is above view root.\n group.x = thisLayout.x || 0;\n group.y = thisLayout.y || 0;\n group.markRedraw();\n inner(group).nodeWidth = thisWidth;\n inner(group).nodeHeight = thisHeight;\n if (thisLayout.isAboveViewRoot) {\n return group;\n }\n // Background\n var bg = giveGraphic('background', Rect, depth, Z2_BG);\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\n var emphasisModel = nodeModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var isDisabled = emphasisModel.get('disabled');\n var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus;\n // No children, render content.\n if (isParent) {\n // Because of the implementation about \"traverse\" in graphic hover style, we\n // can not set hover listener on the \"group\" of non-leaf node. Otherwise the\n // hover event from the descendents will be listenered.\n if (isHighDownDispatcher(group)) {\n setAsHighDownDispatcher(group, false);\n }\n if (bg) {\n setAsHighDownDispatcher(bg, !isDisabled);\n // Only for enabling highlight/downplay.\n data.setItemGraphicEl(thisNode.dataIndex, bg);\n enableHoverFocus(bg, focusOrIndices, blurScope);\n }\n } else {\n var content = giveGraphic('content', Rect, depth, Z2_CONTENT);\n content && renderContent(group, content);\n bg.disableMorphing = true;\n if (bg && isHighDownDispatcher(bg)) {\n setAsHighDownDispatcher(bg, false);\n }\n setAsHighDownDispatcher(group, !isDisabled);\n // Only for enabling highlight/downplay.\n data.setItemGraphicEl(thisNode.dataIndex, group);\n enableHoverFocus(group, focusOrIndices, blurScope);\n }\n return group;\n // ----------------------------\n // | Procedures in renderNode |\n // ----------------------------\n function renderBackground(group, bg, useUpperLabel) {\n var ecData = getECData(bg);\n // For tooltip.\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n bg.setShape({\n x: 0,\n y: 0,\n width: thisWidth,\n height: thisHeight,\n r: borderRadius\n });\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(bg);\n } else {\n bg.invisible = false;\n var style = thisNode.getVisual('style');\n var visualBorderColor = style.stroke;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualBorderColor;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\n if (useUpperLabel) {\n var upperLabelWidth = thisWidth - 2 * borderWidth;\n prepareText(\n // PENDING: convert ZRColor to ColorString for text.\n bg, visualBorderColor, style.opacity, {\n x: borderWidth,\n y: 0,\n width: upperLabelWidth,\n height: upperHeight\n });\n }\n // For old bg.\n else {\n bg.removeTextContent();\n }\n bg.setStyle(normalStyle);\n bg.ensureState('emphasis').style = emphasisStyle;\n bg.ensureState('blur').style = blurStyle;\n bg.ensureState('select').style = selectStyle;\n setDefaultStateProxy(bg);\n }\n group.add(bg);\n }\n function renderContent(group, content) {\n var ecData = getECData(content);\n // For tooltip.\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\n content.culling = true;\n content.setShape({\n x: borderWidth,\n y: borderWidth,\n width: contentWidth,\n height: contentHeight,\n r: borderRadius\n });\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(content);\n } else {\n content.invisible = false;\n var nodeStyle = thisNode.getVisual('style');\n var visualColor = nodeStyle.fill;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualColor;\n normalStyle.decal = nodeStyle.decal;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\n // PENDING: convert ZRColor to ColorString for text.\n prepareText(content, visualColor, nodeStyle.opacity, null);\n content.setStyle(normalStyle);\n content.ensureState('emphasis').style = emphasisStyle;\n content.ensureState('blur').style = blurStyle;\n content.ensureState('select').style = selectStyle;\n setDefaultStateProxy(content);\n }\n group.add(content);\n }\n function processInvisible(element) {\n // Delay invisible setting utill animation finished,\n // avoid element vanish suddenly before animation.\n !element.invisible && willInvisibleEls.push(element);\n }\n function prepareText(rectEl, visualColor, visualOpacity,\n // Can be null/undefined\n upperLabelRect) {\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\n var defaultText = convertOptionIdName(nodeModel.get('name'), null);\n var isShow = normalLabelModel.getShallow('show');\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\n defaultText: isShow ? defaultText : null,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n labelFetcher: seriesModel,\n labelDataIndex: thisNode.dataIndex\n });\n var textEl = rectEl.getTextContent();\n if (!textEl) {\n return;\n }\n var textStyle = textEl.style;\n var textPadding = normalizeCssArray(textStyle.padding || 0);\n if (upperLabelRect) {\n rectEl.setTextConfig({\n layoutRect: upperLabelRect\n });\n textEl.disableLabelLayout = true;\n }\n textEl.beforeUpdate = function () {\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\n if (textStyle.width !== width || textStyle.height !== height) {\n textEl.setStyle({\n width: width,\n height: height\n });\n }\n };\n textStyle.truncateMinChar = 2;\n textStyle.lineOverflow = 'truncate';\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\n var textEmphasisState = textEl.getState('emphasis');\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\n }\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\n var text = style ? style.text : null;\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\n var iconChar = seriesModel.get('drillDownIcon', true);\n style.text = iconChar ? iconChar + ' ' + text : text;\n }\n }\n function giveGraphic(storageName, Ctor, depth, z) {\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\n var lasts = lastsForAnimation[storageName];\n if (element) {\n // Remove from oldStorage\n oldStorage[storageName][oldRawIndex] = null;\n prepareAnimationWhenHasOld(lasts, element);\n }\n // If invisible and no old element, do not create new element (for optimizing).\n else if (!thisInvisible) {\n element = new Ctor();\n if (element instanceof Displayable) {\n element.z2 = calculateZ2(depth, z);\n }\n prepareAnimationWhenNoOld(lasts, element);\n }\n // Set to thisStorage\n return thisStorage[storageName][thisRawIndex] = element;\n }\n function prepareAnimationWhenHasOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n if (element instanceof Group) {\n lastCfg.oldX = element.x;\n lastCfg.oldY = element.y;\n } else {\n lastCfg.oldShape = extend({}, element.shape);\n }\n }\n // If a element is new, we need to find the animation start point carefully,\n // otherwise it will looks strange when 'zoomToNode'.\n function prepareAnimationWhenNoOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n var parentNode = thisNode.parentNode;\n var isGroup = element instanceof graphic.Group;\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\n var parentOldX = 0;\n var parentOldY = 0;\n // New nodes appear from right-bottom corner in 'zoomToNode' animation.\n // For convenience, get old bounding rect from background.\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\n parentOldX = parentOldBg.oldShape.width;\n parentOldY = parentOldBg.oldShape.height;\n }\n // When no parent old shape found, its parent is new too,\n // so we can just use {x:0, y:0}.\n if (isGroup) {\n lastCfg.oldX = 0;\n lastCfg.oldY = parentOldY;\n } else {\n lastCfg.oldShape = {\n x: parentOldX,\n y: parentOldY,\n width: 0,\n height: 0\n };\n }\n }\n // Fade in, user can be aware that these nodes are new.\n lastCfg.fadein = !isGroup;\n }\n}\n// We cannot set all background with the same z, because the behaviour of\n// drill down and roll up differ background creation sequence from tree\n// hierarchy sequence, which cause lower background elements to overlap\n// upper ones. So we calculate z based on depth.\n// Moreover, we try to shrink down z interval to [0, 1] to avoid that\n// treemap with large z overlaps other components.\nfunction calculateZ2(depth, z2InLevel) {\n return depth * Z2_BASE + z2InLevel;\n}\nexport default TreemapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as zrColor from 'zrender/lib/tool/color.js';\nimport { linearMap } from '../util/number.js';\nimport { warn } from '../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar CATEGORY_DEFAULT_VISUAL_INDEX = -1;\nvar VisualMapping = /** @class */function () {\n function VisualMapping(option) {\n var mappingMethod = option.mappingMethod;\n var visualType = option.type;\n var thisOption = this.option = zrUtil.clone(option);\n this.type = visualType;\n this.mappingMethod = mappingMethod;\n this._normalizeData = normalizers[mappingMethod];\n var visualHandler = VisualMapping.visualHandlers[visualType];\n this.applyVisual = visualHandler.applyVisual;\n this.getColorMapper = visualHandler.getColorMapper;\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\n if (mappingMethod === 'piecewise') {\n normalizeVisualRange(thisOption);\n preprocessForPiecewise(thisOption);\n } else if (mappingMethod === 'category') {\n thisOption.categories ? preprocessForSpecifiedCategory(thisOption)\n // categories is ordinal when thisOption.categories not specified,\n // which need no more preprocess except normalize visual.\n : normalizeVisualRange(thisOption, true);\n } else {\n // mappingMethod === 'linear' or 'fixed'\n zrUtil.assert(mappingMethod !== 'linear' || thisOption.dataExtent);\n normalizeVisualRange(thisOption);\n }\n }\n VisualMapping.prototype.mapValueToVisual = function (value) {\n var normalized = this._normalizeData(value);\n return this._normalizedToVisual(normalized, value);\n };\n VisualMapping.prototype.getNormalizer = function () {\n return zrUtil.bind(this._normalizeData, this);\n };\n /**\n * List available visual types.\n *\n * @public\n * @return {Array.}\n */\n VisualMapping.listVisualTypes = function () {\n return zrUtil.keys(VisualMapping.visualHandlers);\n };\n // /**\n // * @public\n // */\n // static addVisualHandler(name, handler) {\n // visualHandlers[name] = handler;\n // }\n /**\n * @public\n */\n VisualMapping.isValidType = function (visualType) {\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\n };\n /**\n * Convenient method.\n * Visual can be Object or Array or primary type.\n */\n VisualMapping.eachVisual = function (visual, callback, context) {\n if (zrUtil.isObject(visual)) {\n zrUtil.each(visual, callback, context);\n } else {\n callback.call(context, visual);\n }\n };\n VisualMapping.mapVisual = function (visual, callback, context) {\n var isPrimary;\n var newVisual = zrUtil.isArray(visual) ? [] : zrUtil.isObject(visual) ? {} : (isPrimary = true, null);\n VisualMapping.eachVisual(visual, function (v, key) {\n var newVal = callback.call(context, v, key);\n isPrimary ? newVisual = newVal : newVisual[key] = newVal;\n });\n return newVisual;\n };\n /**\n * Retrieve visual properties from given object.\n */\n VisualMapping.retrieveVisuals = function (obj) {\n var ret = {};\n var hasVisual;\n obj && each(VisualMapping.visualHandlers, function (h, visualType) {\n if (obj.hasOwnProperty(visualType)) {\n ret[visualType] = obj[visualType];\n hasVisual = true;\n }\n });\n return hasVisual ? ret : null;\n };\n /**\n * Give order to visual types, considering colorSaturation, colorAlpha depends on color.\n *\n * @public\n * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}\n * IF Array, like: ['color', 'symbol', 'colorSaturation']\n * @return {Array.} Sorted visual types.\n */\n VisualMapping.prepareVisualTypes = function (visualTypes) {\n if (zrUtil.isArray(visualTypes)) {\n visualTypes = visualTypes.slice();\n } else if (isObject(visualTypes)) {\n var types_1 = [];\n each(visualTypes, function (item, type) {\n types_1.push(type);\n });\n visualTypes = types_1;\n } else {\n return [];\n }\n visualTypes.sort(function (type1, type2) {\n // color should be front of colorSaturation, colorAlpha, ...\n // symbol and symbolSize do not matter.\n return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1;\n });\n return visualTypes;\n };\n /**\n * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.\n * Other visuals are only depends on themself.\n */\n VisualMapping.dependsOn = function (visualType1, visualType2) {\n return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2;\n };\n /**\n * @param value\n * @param pieceList [{value: ..., interval: [min, max]}, ...]\n * Always from small to big.\n * @param findClosestWhenOutside Default to be false\n * @return index\n */\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\n var possibleI;\n var abs = Infinity;\n // value has the higher priority.\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var pieceValue = pieceList[i].value;\n if (pieceValue != null) {\n if (pieceValue === value\n // FIXME\n // It is supposed to compare value according to value type of dimension,\n // but currently value type can exactly be string or number.\n // Compromise for numeric-like string (like '12'), especially\n // in the case that visualMap.categories is ['22', '33'].\n || zrUtil.isString(pieceValue) && pieceValue === value + '') {\n return i;\n }\n findClosestWhenOutside && updatePossible(pieceValue, i);\n }\n }\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var piece = pieceList[i];\n var interval = piece.interval;\n var close_1 = piece.close;\n if (interval) {\n if (interval[0] === -Infinity) {\n if (littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n } else if (interval[1] === Infinity) {\n if (littleThan(close_1[0], interval[0], value)) {\n return i;\n }\n } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n findClosestWhenOutside && updatePossible(interval[0], i);\n findClosestWhenOutside && updatePossible(interval[1], i);\n }\n }\n if (findClosestWhenOutside) {\n return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI;\n }\n function updatePossible(val, index) {\n var newAbs = Math.abs(val - value);\n if (newAbs < abs) {\n abs = newAbs;\n possibleI = index;\n }\n }\n };\n VisualMapping.visualHandlers = {\n color: {\n applyVisual: makeApplyVisual('color'),\n getColorMapper: function () {\n var thisOption = this.option;\n return zrUtil.bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) {\n !isNormalized && (value = this._normalizeData(value));\n return doMapCategory.call(this, value);\n } : function (value, isNormalized, out) {\n // If output rgb array\n // which will be much faster and useful in pixel manipulation\n var returnRGBArray = !!out;\n !isNormalized && (value = this._normalizeData(value));\n out = zrColor.fastLerp(value, thisOption.parsedVisual, out);\n return returnRGBArray ? out : zrColor.stringify(out, 'rgba');\n }, this);\n },\n _normalizedToVisual: {\n linear: function (normalized) {\n return zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n if (result == null) {\n result = zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n }\n return result;\n },\n fixed: doMapFixed\n }\n },\n colorHue: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, value);\n }),\n colorSaturation: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, value);\n }),\n colorLightness: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, null, value);\n }),\n colorAlpha: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyAlpha(color, value);\n }),\n decal: {\n applyVisual: makeApplyVisual('decal'),\n _normalizedToVisual: {\n linear: null,\n category: doMapCategory,\n piecewise: null,\n fixed: null\n }\n },\n opacity: {\n applyVisual: makeApplyVisual('opacity'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n },\n liftZ: {\n applyVisual: makeApplyVisual('liftZ'),\n _normalizedToVisual: {\n linear: doMapFixed,\n category: doMapFixed,\n piecewise: doMapFixed,\n fixed: doMapFixed\n }\n },\n symbol: {\n applyVisual: function (value, getter, setter) {\n var symbolCfg = this.mapValueToVisual(value);\n setter('symbol', symbolCfg);\n },\n _normalizedToVisual: {\n linear: doMapToArray,\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n if (result == null) {\n result = doMapToArray.call(this, normalized);\n }\n return result;\n },\n fixed: doMapFixed\n }\n },\n symbolSize: {\n applyVisual: makeApplyVisual('symbolSize'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n }\n };\n return VisualMapping;\n}();\nfunction preprocessForPiecewise(thisOption) {\n var pieceList = thisOption.pieceList;\n thisOption.hasSpecialVisual = false;\n zrUtil.each(pieceList, function (piece, index) {\n piece.originIndex = index;\n // piece.visual is \"result visual value\" but not\n // a visual range, so it does not need to be normalized.\n if (piece.visual != null) {\n thisOption.hasSpecialVisual = true;\n }\n });\n}\nfunction preprocessForSpecifiedCategory(thisOption) {\n // Hash categories.\n var categories = thisOption.categories;\n var categoryMap = thisOption.categoryMap = {};\n var visual = thisOption.visual;\n each(categories, function (cate, index) {\n categoryMap[cate] = index;\n });\n // Process visual map input.\n if (!zrUtil.isArray(visual)) {\n var visualArr_1 = [];\n if (zrUtil.isObject(visual)) {\n each(visual, function (v, cate) {\n var index = categoryMap[cate];\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\n });\n } else {\n // Is primary type, represents default visual.\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\n }\n visual = setVisualToOption(thisOption, visualArr_1);\n }\n // Remove categories that has no visual,\n // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.\n for (var i = categories.length - 1; i >= 0; i--) {\n if (visual[i] == null) {\n delete categoryMap[categories[i]];\n categories.pop();\n }\n }\n}\nfunction normalizeVisualRange(thisOption, isCategory) {\n var visual = thisOption.visual;\n var visualArr = [];\n if (zrUtil.isObject(visual)) {\n each(visual, function (v) {\n visualArr.push(v);\n });\n } else if (visual != null) {\n visualArr.push(visual);\n }\n var doNotNeedPair = {\n color: 1,\n symbol: 1\n };\n if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\n // Do not care visualArr.length === 0, which is illegal.\n visualArr[1] = visualArr[0];\n }\n setVisualToOption(thisOption, visualArr);\n}\nfunction makePartialColorVisualHandler(applyValue) {\n return {\n applyVisual: function (value, getter, setter) {\n // Only used in HSL\n var colorChannel = this.mapValueToVisual(value);\n // Must not be array value\n setter('color', applyValue(getter('color'), colorChannel));\n },\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n };\n}\nfunction doMapToArray(normalized) {\n var visual = this.option.visual;\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}?\n}\n\nfunction makeApplyVisual(visualType) {\n return function (value, getter, setter) {\n setter(visualType, this.mapValueToVisual(value));\n };\n}\nfunction doMapCategory(normalized) {\n var visual = this.option.visual;\n return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];\n}\nfunction doMapFixed() {\n // visual will be convert to array.\n return this.option.visual[0];\n}\n/**\n * Create mapped to numeric visual\n */\nfunction createNormalizedToNumericVisual(sourceExtent) {\n return {\n linear: function (normalized) {\n return linearMap(normalized, sourceExtent, this.option.visual, true);\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n if (result == null) {\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\n }\n return result;\n },\n fixed: doMapFixed\n };\n}\nfunction getSpecifiedVisual(value) {\n var thisOption = this.option;\n var pieceList = thisOption.pieceList;\n if (thisOption.hasSpecialVisual) {\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\n var piece = pieceList[pieceIndex];\n if (piece && piece.visual) {\n return piece.visual[this.type];\n }\n }\n}\nfunction setVisualToOption(thisOption, visualArr) {\n thisOption.visual = visualArr;\n if (thisOption.type === 'color') {\n thisOption.parsedVisual = zrUtil.map(visualArr, function (item) {\n var color = zrColor.parse(item);\n if (!color && process.env.NODE_ENV !== 'production') {\n warn(\"'\" + item + \"' is an illegal color, fallback to '#000000'\", true);\n }\n return color || [0, 0, 0, 1];\n });\n }\n return visualArr;\n}\n/**\n * Normalizers by mapping methods.\n */\nvar normalizers = {\n linear: function (value) {\n return linearMap(value, this.option.dataExtent, [0, 1], true);\n },\n piecewise: function (value) {\n var pieceList = this.option.pieceList;\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\n if (pieceIndex != null) {\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\n }\n },\n category: function (value) {\n var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\n },\n fixed: zrUtil.noop\n};\nfunction littleThan(close, a, b) {\n return close ? a <= b : a < b;\n}\nexport default VisualMapping;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { each, extend, isArray } from 'zrender/lib/core/util.js';\nimport { modifyHSL, modifyAlpha } from 'zrender/lib/tool/color.js';\nimport { makeInner } from '../../util/model.js';\nvar ITEM_STYLE_NORMAL = 'itemStyle';\nvar inner = makeInner();\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel) {\n var tree = seriesModel.getData().tree;\n var root = tree.root;\n if (root.isRemoved()) {\n return;\n }\n travelTree(root,\n // Visual should calculate from tree root but not view root.\n {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\n }\n};\nfunction travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\n var nodeModel = node.getModel();\n var nodeLayout = node.getLayout();\n var data = node.hostTree.data;\n // Optimize\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\n return;\n }\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n // calculate border color\n var borderColor = nodeItemStyleModel.get('borderColor');\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\n var thisNodeColor;\n if (borderColorSaturation != null) {\n // For performance, do not always execute 'calculateColor'.\n thisNodeColor = calculateColor(visuals);\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\n }\n existsStyle.stroke = borderColor;\n var viewChildren = node.viewChildren;\n if (!viewChildren || !viewChildren.length) {\n thisNodeColor = calculateColor(visuals);\n // Apply visual to this node.\n existsStyle.fill = thisNodeColor;\n } else {\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren);\n // Designate visual to children.\n each(viewChildren, function (child, index) {\n // If higher than viewRoot, only ancestors of viewRoot is needed to visit.\n if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\n }\n });\n }\n}\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\n var visuals = extend({}, designatedVisual);\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\n // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\n var val = nodeItemStyleModel.get(visualName);\n designatedVisualItemStyle[visualName] = null;\n val != null && (visuals[visualName] = val);\n });\n return visuals;\n}\nfunction calculateColor(visuals) {\n var color = getValueVisualDefine(visuals, 'color');\n if (color) {\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\n if (colorSaturation) {\n color = modifyHSL(color, null, null, colorSaturation);\n }\n if (colorAlpha) {\n color = modifyAlpha(color, colorAlpha);\n }\n return color;\n }\n}\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\n return thisNodeColor != null\n // Can only be string\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null;\n}\nfunction getValueVisualDefine(visuals, name) {\n var value = visuals[name];\n if (value != null && value !== 'none') {\n return value;\n }\n}\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\n if (!viewChildren || !viewChildren.length) {\n return;\n }\n var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation'));\n if (!rangeVisual) {\n return;\n }\n var visualMin = nodeModel.get('visualMin');\n var visualMax = nodeModel.get('visualMax');\n var dataExtent = nodeLayout.dataExtent.slice();\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\n var colorMappingBy = nodeModel.get('colorMappingBy');\n var opt = {\n type: rangeVisual.name,\n dataExtent: dataExtent,\n visual: rangeVisual.range\n };\n if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\n opt.mappingMethod = 'category';\n opt.loop = true;\n // categories is ordinal, so do not set opt.categories.\n } else {\n opt.mappingMethod = 'linear';\n }\n var mapping = new VisualMapping(opt);\n inner(mapping).drColorMappingBy = colorMappingBy;\n return mapping;\n}\n// Notice: If we don't have the attribute 'colorRange', but only use\n// attribute 'color' to represent both concepts of 'colorRange' and 'color',\n// (It means 'colorRange' when 'color' is Array, means 'color' when not array),\n// this problem will be encountered:\n// If a level-1 node doesn't have children, and its siblings have children,\n// and colorRange is set on level-1, then the node cannot be colored.\n// So we separate 'colorRange' and 'color' to different attributes.\nfunction getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exists on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return isArray(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\n var childVisuals = extend({}, visuals);\n if (mapping) {\n // Only support color, colorAlpha, colorSaturation.\n var mappingType = mapping.type;\n var colorMappingBy = mappingType === 'color' && inner(mapping).drColorMappingBy;\n var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension'));\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\n }\n return childVisuals;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/*\n* A third-party license is embedded for some of the code in this file:\n* The treemap layout implementation was originally copied from\n* \"d3.js\" with some modifications made for this project.\n* (See more details in the comment of the method \"squarify\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent, MAX_SAFE_INTEGER } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from '../helper/treeHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar retrieveValue = zrUtil.retrieve;\nvar each = zrUtil.each;\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\n;\n/**\n * @public\n */\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel, ecModel, api, payload) {\n // Layout result in each node:\n // {x, y, width, height, area, borderWidth}\n var ecWidth = api.getWidth();\n var ecHeight = api.getHeight();\n var seriesOption = seriesModel.option;\n var layoutInfo = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n var size = seriesOption.size || []; // Compatible with ec2.\n var containerWidth = parsePercent(retrieveValue(layoutInfo.width, size[0]), ecWidth);\n var containerHeight = parsePercent(retrieveValue(layoutInfo.height, size[1]), ecHeight);\n // Fetch payload info.\n var payloadType = payload && payload.type;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null;\n var viewRoot = seriesModel.getViewRoot();\n var viewAbovePath = helper.getPathToRoot(viewRoot);\n if (payloadType !== 'treemapMove') {\n var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight];\n var sort_1 = seriesOption.sort;\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\n // Default to be desc order.\n sort_1 = 'desc';\n }\n var options = {\n squareRatio: seriesOption.squareRatio,\n sort: sort_1,\n leafDepth: seriesOption.leafDepth\n };\n // layout should be cleared because using updateView but not update.\n viewRoot.hostTree.clearLayouts();\n // TODO\n // optimize: if out of view clip, do not layout.\n // But take care that if do not render node out of view clip,\n // how to calculate start po\n var viewRootLayout_1 = {\n x: 0,\n y: 0,\n width: rootSize[0],\n height: rootSize[1],\n area: rootSize[0] * rootSize[1]\n };\n viewRoot.setLayout(viewRootLayout_1);\n squarify(viewRoot, options, false, 0);\n // Supplement layout.\n viewRootLayout_1 = viewRoot.getLayout();\n each(viewAbovePath, function (node, index) {\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\n node.setLayout(zrUtil.extend({\n dataExtent: [childValue, childValue],\n borderWidth: 0,\n upperHeight: 0\n }, viewRootLayout_1));\n });\n }\n var treeRoot = seriesModel.getData().tree.root;\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\n seriesModel.setLayoutInfo(layoutInfo);\n // FIXME\n // 现在没有clip功能,暂时取ec高宽。\n prunning(treeRoot,\n // Transform to base element coordinate system.\n new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\n }\n};\n/**\n * Layout treemap with squarify algorithm.\n * The original presentation of this algorithm\n * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk\n * .\n * The implementation of this algorithm was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * @protected\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {Object} options\n * @param {string} options.sort 'asc' or 'desc'\n * @param {number} options.squareRatio\n * @param {boolean} hideChildren\n * @param {number} depth\n */\nfunction squarify(node, options, hideChildren, depth) {\n var width;\n var height;\n if (node.isRemoved()) {\n return;\n }\n var thisLayout = node.getLayout();\n width = thisLayout.width;\n height = thisLayout.height;\n // Considering border and gap\n var nodeModel = node.getModel();\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\n var layoutOffset = borderWidth - halfGapWidth;\n var layoutOffsetUpper = upperHeight - halfGapWidth;\n node.setLayout({\n borderWidth: borderWidth,\n upperHeight: upperHeight,\n upperLabelHeight: upperLabelHeight\n }, true);\n width = mathMax(width - 2 * layoutOffset, 0);\n height = mathMax(height - layoutOffset - layoutOffsetUpper, 0);\n var totalArea = width * height;\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\n if (!viewChildren.length) {\n return;\n }\n var rect = {\n x: layoutOffset,\n y: layoutOffsetUpper,\n width: width,\n height: height\n };\n var rowFixedLength = mathMin(width, height);\n var best = Infinity; // the best row score so far\n var row = [];\n row.area = 0;\n for (var i = 0, len = viewChildren.length; i < len;) {\n var child = viewChildren[i];\n row.push(child);\n row.area += child.getLayout().area;\n var score = worst(row, rowFixedLength, options.squareRatio);\n // continue with this orientation\n if (score <= best) {\n i++;\n best = score;\n }\n // abort, and try a different orientation\n else {\n row.area -= row.pop().getLayout().area;\n position(row, rowFixedLength, rect, halfGapWidth, false);\n rowFixedLength = mathMin(rect.width, rect.height);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n if (row.length) {\n position(row, rowFixedLength, rect, halfGapWidth, true);\n }\n if (!hideChildren) {\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\n hideChildren = true;\n }\n }\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n squarify(viewChildren[i], options, hideChildren, depth + 1);\n }\n}\n/**\n * Set area to each child, and calculate data extent for visual coding.\n */\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\n // leafDepth has higher priority.\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n }\n // Sort children, order by desc.\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n // Set area to each child.\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea;\n // Do not use setLayout({...}, true), because it is needed to clear last layout.\n viewChildren[i].setLayout({\n area: area\n });\n }\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n}\n/**\n * Consider 'visibleMin'. Modify viewChildren and get new sum.\n */\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\n // visibleMin is not supported yet when no option.sort.\n if (!orderBy) {\n return sum;\n }\n var visibleMin = nodeModel.get('visibleMin');\n var len = orderedChildren.length;\n var deletePoint = len;\n // Always travel from little value to big value.\n for (var i = len - 1; i >= 0; i--) {\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\n if (value / sum * totalArea < visibleMin) {\n deletePoint = i;\n sum -= value;\n }\n }\n orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint);\n return sum;\n}\n/**\n * Sort\n */\nfunction sort(viewChildren, orderBy) {\n if (orderBy) {\n viewChildren.sort(function (a, b) {\n var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue();\n return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff;\n });\n }\n return viewChildren;\n}\n/**\n * Statistic\n */\nfunction statistic(nodeModel, children, orderBy) {\n // Calculate sum.\n var sum = 0;\n for (var i = 0, len = children.length; i < len; i++) {\n sum += children[i].getValue();\n }\n // Statistic data extent for latter visual coding.\n // Notice: data extent should be calculate based on raw children\n // but not filtered view children, otherwise visual mapping will not\n // be stable when zoom (where children is filtered by visibleMin).\n var dimension = nodeModel.get('visualDimension');\n var dataExtent;\n // The same as area dimension.\n if (!children || !children.length) {\n dataExtent = [NaN, NaN];\n } else if (dimension === 'value' && orderBy) {\n dataExtent = [children[children.length - 1].getValue(), children[0].getValue()];\n orderBy === 'asc' && dataExtent.reverse();\n }\n // Other dimension.\n else {\n dataExtent = [Infinity, -Infinity];\n each(children, function (child) {\n var value = child.getValue(dimension);\n value < dataExtent[0] && (dataExtent[0] = value);\n value > dataExtent[1] && (dataExtent[1] = value);\n });\n }\n return {\n sum: sum,\n dataExtent: dataExtent\n };\n}\n/**\n * Computes the score for the specified row,\n * as the worst aspect ratio.\n */\nfunction worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}\n/**\n * Positions the specified row of nodes. Modifies `rect`.\n */\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\n // When rowFixedLength === rect.width,\n // it is horizontal subdivision,\n // rowFixedLength is the width of the subdivision,\n // rowOtherLength is the height of the subdivision,\n // and nodes will be positioned from left to right.\n // wh[idx0WhenH] means: when horizontal,\n // wh[idx0WhenH] => wh[0] => 'width'.\n // xy[idx1WhenH] => xy[1] => 'y'.\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n var idx1WhenH = 1 - idx0WhenH;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var last = rect[xy[idx0WhenH]];\n var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n }\n\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n var node = row[i];\n var nodeLayout = {};\n var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0);\n // We use Math.max/min to avoid negative width/height when considering gap width.\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n var modWH = i === rowLen - 1 || remain < step ? remain : step;\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);\n nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);\n last += modWH;\n node.setLayout(nodeLayout, true);\n }\n rect[xy[idx1WhenH]] += rowOtherLength;\n rect[wh[idx1WhenH]] -= rowOtherLength;\n}\n// Return [containerWidth, containerHeight] as default.\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\n // If targetInfo.node exists, we zoom to the node,\n // so estimate whole width and height by target node.\n var currNode = (targetInfo || {}).node;\n var defaultSize = [containerWidth, containerHeight];\n if (!currNode || currNode === viewRoot) {\n return defaultSize;\n }\n var parent;\n var viewArea = containerWidth * containerHeight;\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\n while (parent = currNode.parentNode) {\n // jshint ignore:line\n var sum = 0;\n var siblings = parent.children;\n for (var i = 0, len = siblings.length; i < len; i++) {\n sum += siblings[i].getValue();\n }\n var currNodeValue = currNode.getValue();\n if (currNodeValue === 0) {\n return defaultSize;\n }\n area *= sum / currNodeValue;\n // Considering border, suppose aspect ratio is 1.\n var parentModel = parent.getModel();\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\n area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\n currNode = parent;\n }\n area < viewArea && (area = viewArea);\n var scale = Math.pow(area / viewArea, 0.5);\n return [containerWidth * scale, containerHeight * scale];\n}\n// Root position based on coord of containerGroup\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\n if (rootRect) {\n return {\n x: rootRect.x,\n y: rootRect.y\n };\n }\n var defaultPosition = {\n x: 0,\n y: 0\n };\n if (!targetInfo) {\n return defaultPosition;\n }\n // If targetInfo is fetched by 'retrieveTargetInfo',\n // old tree and new tree are the same tree,\n // so the node still exists and we can visit it.\n var targetNode = targetInfo.node;\n var layout = targetNode.getLayout();\n if (!layout) {\n return defaultPosition;\n }\n // Transform coord from local to container.\n var targetCenter = [layout.width / 2, layout.height / 2];\n var node = targetNode;\n while (node) {\n var nodeLayout = node.getLayout();\n targetCenter[0] += nodeLayout.x;\n targetCenter[1] += nodeLayout.y;\n node = node.parentNode;\n }\n return {\n x: layoutInfo.width / 2 - targetCenter[0],\n y: layoutInfo.height / 2 - targetCenter[1]\n };\n}\n// Mark nodes visible for prunning when visual coding and rendering.\n// Prunning depends on layout and root position, so we have to do it after layout.\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\n var nodeLayout = node.getLayout();\n var nodeInViewAbovePath = viewAbovePath[depth];\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\n if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) {\n return;\n }\n node.setLayout({\n // isInView means: viewRoot sub tree + viewAbovePath\n isInView: true,\n // invisible only means: outside view clip so that the node can not\n // see but still layout for animation preparation but not render.\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\n isAboveViewRoot: isAboveViewRoot\n }, true);\n // Transform to child coordinate.\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\n each(node.viewChildren || [], function (child) {\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\n });\n}\nfunction getUpperLabelHeight(model) {\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { installTreemapAction } from './treemapAction.js';\nimport TreemapSeriesModel from './TreemapSeries.js';\nimport TreemapView from './TreemapView.js';\nimport treemapVisual from './treemapVisual.js';\nimport treemapLayout from './treemapLayout.js';\nexport function install(registers) {\n registers.registerSeriesModel(TreemapSeriesModel);\n registers.registerChartView(TreemapView);\n registers.registerVisual(treemapVisual);\n registers.registerLayout(treemapLayout);\n installTreemapAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function categoryFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n if (!legendModels || !legendModels.length) {\n return;\n }\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var categoriesData = graphSeries.getCategoriesData();\n var graph = graphSeries.getGraph();\n var data = graph.data;\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\n data.filterSelf(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n if (category != null) {\n if (isNumber(category)) {\n category = categoryNames[category];\n }\n // If in any legend component the status is not selected.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(category)) {\n return false;\n }\n }\n }\n return true;\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function categoryVisual(ecModel) {\n var paletteScope = {};\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var categoriesData = seriesModel.getCategoriesData();\n var data = seriesModel.getData();\n var categoryNameIdxMap = {};\n categoriesData.each(function (idx) {\n var name = categoriesData.getName(idx);\n // Add prefix to avoid conflict with Object.prototype.\n categoryNameIdxMap['ec-' + name] = idx;\n var itemModel = categoriesData.getItemModel(idx);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n if (!style.fill) {\n // Get color from palette.\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\n }\n categoriesData.setItemVisual(idx, 'style', style);\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n for (var i = 0; i < symbolVisualList.length; i++) {\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\n if (symbolVisual != null) {\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\n }\n }\n });\n // Assign category color to visual\n if (categoriesData.count()) {\n data.each(function (idx) {\n var model = data.getItemModel(idx);\n var categoryIdx = model.getShallow('category');\n if (categoryIdx != null) {\n if (isString(categoryIdx)) {\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\n }\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\n var style = data.ensureUniqueItemVisual(idx, 'style');\n extend(style, categoryStyle);\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n for (var i = 0; i < visualList.length; i++) {\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\n }\n }\n });\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n return a;\n}\nexport default function graphEdgeVisual(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var edgeData = seriesModel.getEdgeData();\n var symbolType = normalize(seriesModel.get('edgeSymbol'));\n var symbolSize = normalize(seriesModel.get('edgeSymbolSize'));\n // const colorQuery = ['lineStyle', 'color'] as const;\n // const opacityQuery = ['lineStyle', 'opacity'] as const;\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\n edgeData.each(function (idx) {\n var itemModel = edgeData.getItemModel(idx);\n var edge = graph.getEdgeByIndex(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n // Edge visual must after node visual\n var style = itemModel.getModel('lineStyle').getLineStyle();\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n switch (existsStyle.stroke) {\n case 'source':\n {\n var nodeStyle = edge.node1.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n case 'target':\n {\n var nodeStyle = edge.node2.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n }\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar KEY_DELIMITER = '-->';\n/**\n * params handler\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @returns {*}\n */\nvar getAutoCurvenessParams = function (seriesModel) {\n return seriesModel.get('autoCurveness') || null;\n};\n/**\n * Generate a list of edge curvatures, 20 is the default\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param {number} appendLength\n * @return 20 => [0, -0.2, 0.2, -0.4, 0.4, -0.6, 0.6, -0.8, 0.8, -1, 1, -1.2, 1.2, -1.4, 1.4, -1.6, 1.6, -1.8, 1.8, -2]\n */\nvar createCurveness = function (seriesModel, appendLength) {\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\n var length = 20;\n var curvenessList = [];\n // handler the function set\n if (zrUtil.isNumber(autoCurvenessParmas)) {\n length = autoCurvenessParmas;\n } else if (zrUtil.isArray(autoCurvenessParmas)) {\n seriesModel.__curvenessList = autoCurvenessParmas;\n return;\n }\n // append length\n if (appendLength > length) {\n length = appendLength;\n }\n // make sure the length is even\n var len = length % 2 ? length + 2 : length + 3;\n curvenessList = [];\n for (var i = 0; i < len; i++) {\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\n }\n seriesModel.__curvenessList = curvenessList;\n};\n/**\n * Create different cache key data in the positive and negative directions, in order to set the curvature later\n * @param {number|string|module:echarts/data/Graph.Node} n1\n * @param {number|string|module:echarts/data/Graph.Node} n2\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @returns {string} key\n */\nvar getKeyOfEdges = function (n1, n2, seriesModel) {\n var source = [n1.id, n1.dataIndex].join('.');\n var target = [n2.id, n2.dataIndex].join('.');\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\n};\n/**\n * get opposite key\n * @param {string} key\n * @returns {string}\n */\nvar getOppositeKey = function (key) {\n var keys = key.split(KEY_DELIMITER);\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\n};\n/**\n * get edgeMap with key\n * @param edge\n * @param {module:echarts/model/SeriesModel} seriesModel\n */\nvar getEdgeFromMap = function (edge, seriesModel) {\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n return seriesModel.__edgeMap[key];\n};\n/**\n * calculate all cases total length\n * @param edge\n * @param seriesModel\n * @returns {number}\n */\nvar getTotalLengthBetweenNodes = function (edge, seriesModel) {\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\n return len + lenV;\n};\n/**\n *\n * @param key\n */\nvar getEdgeMapLengthWithKey = function (key, seriesModel) {\n var edgeMap = seriesModel.__edgeMap;\n return edgeMap[key] ? edgeMap[key].length : 0;\n};\n/**\n * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge\n * @see /graph/GraphSeries.js@getInitialData\n * @param {module:echarts/model/SeriesModel} seriesModel\n */\nexport function initCurvenessList(seriesModel) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n seriesModel.__curvenessList = [];\n seriesModel.__edgeMap = {};\n // calc the array of curveness List\n createCurveness(seriesModel);\n}\n/**\n * set edgeMap with key\n * @param {number|string|module:echarts/data/Graph.Node} n1\n * @param {number|string|module:echarts/data/Graph.Node} n2\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param {number} index\n */\nexport function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n var key = getKeyOfEdges(n1, n2, seriesModel);\n var edgeMap = seriesModel.__edgeMap;\n var oppositeEdges = edgeMap[getOppositeKey(key)];\n // set direction\n if (edgeMap[key] && !oppositeEdges) {\n edgeMap[key].isForward = true;\n } else if (oppositeEdges && edgeMap[key]) {\n oppositeEdges.isForward = true;\n edgeMap[key].isForward = false;\n }\n edgeMap[key] = edgeMap[key] || [];\n edgeMap[key].push(index);\n}\n/**\n * get curvature for edge\n * @param edge\n * @param {module:echarts/model/SeriesModel} seriesModel\n * @param index\n */\nexport function getCurvenessForEdge(edge, seriesModel, index, needReverse) {\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\n var isArrayParam = zrUtil.isArray(autoCurvenessParams);\n if (!autoCurvenessParams) {\n return null;\n }\n var edgeArray = getEdgeFromMap(edge, seriesModel);\n if (!edgeArray) {\n return null;\n }\n var edgeIndex = -1;\n for (var i = 0; i < edgeArray.length; i++) {\n if (edgeArray[i] === index) {\n edgeIndex = i;\n break;\n }\n }\n // if totalLen is Longer createCurveness\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\n createCurveness(seriesModel, totalLen);\n edge.lineStyle = edge.lineStyle || {};\n // if is opposite edge, must set curvenss to opposite number\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n var curvenessList = seriesModel.__curvenessList;\n // if pass array no need parity\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\n if (!edgeArray.isForward) {\n // the opposite edge show outside\n var oppositeKey = getOppositeKey(curKey);\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\n var resValue = curvenessList[edgeIndex + len + parityCorrection];\n // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite\n if (needReverse) {\n // set as array may make the parity handle with the len of opposite\n if (isArrayParam) {\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n } else {\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return curvenessList[edgeIndex + len + parityCorrection];\n }\n } else {\n return curvenessList[parityCorrection + edgeIndex];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport function simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph, seriesModel);\n}\nexport function simpleLayoutEdge(graph, seriesModel) {\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n edge.setLayout(points);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport { simpleLayout, simpleLayoutEdge } from './simpleLayoutHelper.js';\nexport default function graphSimpleLayout(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys && coordSys.type !== 'view') {\n var data_1 = seriesModel.getData();\n var dimensions_1 = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\n });\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n for (var i = 0; i < dimensions_1.length; i++) {\n var val = data_1.get(dimensions_1[i], dataIndex);\n if (!isNaN(val)) {\n hasValue = true;\n }\n value.push(val);\n }\n if (hasValue) {\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.}, not undefined to avoid if...else... statement\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n simpleLayoutEdge(data_1.graph, seriesModel);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function getNodeGlobalScale(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys.type !== 'view') {\n return 1;\n }\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\n var groupZoom = coordSys.scaleX;\n // Scale node when zoom changes\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n}\nexport function getSymbolSize(node) {\n var symbolSize = node.getVisual('symbolSize');\n if (symbolSize instanceof Array) {\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\n }\n return +symbolSize;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize, getNodeGlobalScale } from './graphHelper.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nvar PI = Math.PI;\nvar _symbolRadiansHalf = [];\n/**\n * `basedOn` can be:\n * 'value':\n * This layout is not accurate and have same bad case. For example,\n * if the min value is very smaller than the max value, the nodes\n * with the min value probably overlap even though there is enough\n * space to layout them. So we only use this approach in the as the\n * init layout of the force layout.\n * FIXME\n * Probably we do not need this method any more but use\n * `basedOn: 'symbolSize'` in force layout if\n * delay its init operations to GraphView.\n * 'symbolSize':\n * This approach work only if all of the symbol size calculated.\n * That is, the progressive rendering is not applied to graph.\n * FIXME\n * If progressive rendering is applied to graph some day,\n * probably we have to use `basedOn: 'value'`.\n */\nexport function circularLayout(seriesModel, basedOn, draggingNode, pointer) {\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n var rect = coordSys.getBoundingRect();\n var nodeData = seriesModel.getData();\n var graph = nodeData.graph;\n var cx = rect.width / 2 + rect.x;\n var cy = rect.height / 2 + rect.y;\n var r = Math.min(rect.width, rect.height) / 2;\n var count = nodeData.count();\n nodeData.setLayout({\n cx: cx,\n cy: cy\n });\n if (!count) {\n return;\n }\n if (draggingNode) {\n var _a = coordSys.pointToData(pointer),\n tempX = _a[0],\n tempY = _a[1];\n var v = [tempX - cx, tempY - cy];\n vec2.normalize(v, v);\n vec2.scale(v, v, r);\n draggingNode.setLayout([cx + v[0], cy + v[1]], true);\n var circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']);\n rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy);\n }\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var cp1;\n var x12 = (p1[0] + p2[0]) / 2;\n var y12 = (p1[1] + p2[1]) / 2;\n if (+curveness) {\n curveness *= 3;\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n }\n edge.setLayout([p1, p2, cp1]);\n });\n}\nvar _layoutNodesBasedOn = {\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var angle = 0;\n var sum = nodeData.getSum('value');\n var unitAngle = Math.PI * 2 / (sum || count);\n graph.eachNode(function (node) {\n var value = node.getValue('value');\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\n angle += radianHalf;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n },\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var sumRadian = 0;\n _symbolRadiansHalf.length = count;\n var nodeScale = getNodeGlobalScale(seriesModel);\n graph.eachNode(function (node) {\n var symbolSize = getSymbolSize(node);\n // Normally this case will not happen, but we still add\n // some the defensive code (2px is an arbitrary value).\n isNaN(symbolSize) && (symbolSize = 2);\n symbolSize < 0 && (symbolSize = 0);\n symbolSize *= nodeScale;\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r);\n // when `symbolSize / 2` is bigger than `r`.\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\n sumRadian += symbolRadianHalf * 2;\n });\n var halfRemainRadian = (2 * PI - sumRadian) / count / 2;\n var angle = 0;\n graph.eachNode(function (node) {\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\n angle += radianHalf;\n // init circular layout for\n // 1. layout undefined node\n // 2. not fixed node\n (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n }\n};\nexport function rotateNodeLabel(node, circularRotateLabel, cx, cy) {\n var el = node.getGraphicEl();\n // need to check if el exists. '-' value may not create node element.\n if (!el) {\n return;\n }\n var nodeModel = node.getModel();\n var labelRotate = nodeModel.get(['label', 'rotate']) || 0;\n var symbolPath = el.getSymbolPath();\n if (circularRotateLabel) {\n var pos = node.getLayout();\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n var isLeft = pos[0] < cx;\n if (isLeft) {\n rad = rad - Math.PI;\n }\n var textPosition = isLeft ? 'left' : 'right';\n symbolPath.setTextConfig({\n rotation: -rad,\n position: textPosition,\n origin: 'center'\n });\n var emphasisState = symbolPath.ensureState('emphasis');\n zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\n position: textPosition\n });\n } else {\n symbolPath.setTextConfig({\n rotation: labelRotate *= Math.PI / 180\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { circularLayout } from './circularLayoutHelper.js';\nexport default function graphCircularLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n if (seriesModel.get('layout') === 'circular') {\n circularLayout(seriesModel, 'symbolSize');\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/*\n* A third-party license is embedded for some of the code in this file:\n* Some formulas were originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment of the method \"step\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar scaleAndAdd = vec2.scaleAndAdd;\n// function adjacentNode(n, e) {\n// return e.n1 === n ? e.n2 : e.n1;\n// }\nexport function forceLayout(inNodes, inEdges, opts) {\n var nodes = inNodes;\n var edges = inEdges;\n var rect = opts.rect;\n var width = rect.width;\n var height = rect.height;\n var center = [rect.x + width / 2, rect.y + height / 2];\n // let scale = opts.scale || 1;\n var gravity = opts.gravity == null ? 0.1 : opts.gravity;\n // for (let i = 0; i < edges.length; i++) {\n // let e = edges[i];\n // let n1 = e.n1;\n // let n2 = e.n2;\n // n1.edges = n1.edges || [];\n // n2.edges = n2.edges || [];\n // n1.edges.push(e);\n // n2.edges.push(e);\n // }\n // Init position\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n if (!n.p) {\n n.p = vec2.create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\n }\n n.pp = vec2.clone(n.p);\n n.edges = null;\n }\n // Formula in 'Graph Drawing by Force-directed Placement'\n // let k = scale * Math.sqrt(width * height / nodes.length);\n // let k2 = k * k;\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\n var friction = initialFriction;\n var beforeStepCallback;\n var afterStepCallback;\n return {\n warmUp: function () {\n friction = initialFriction * 0.8;\n },\n setFixed: function (idx) {\n nodes[idx].fixed = true;\n },\n setUnfixed: function (idx) {\n nodes[idx].fixed = false;\n },\n /**\n * Before step hook\n */\n beforeStep: function (cb) {\n beforeStepCallback = cb;\n },\n /**\n * After step hook\n */\n afterStep: function (cb) {\n afterStepCallback = cb;\n },\n /**\n * Some formulas were originally copied from \"d3.js\"\n * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js\n * with some modifications made for this project.\n * See the license statement at the head of this file.\n */\n step: function (cb) {\n beforeStepCallback && beforeStepCallback(nodes, edges);\n var v12 = [];\n var nLen = nodes.length;\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n if (e.ignoreForceLayout) {\n continue;\n }\n var n1 = e.n1;\n var n2 = e.n2;\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12) - e.d;\n var w = n2.w / (n1.w + n2.w);\n if (isNaN(w)) {\n w = 0;\n }\n vec2.normalize(v12, v12);\n !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);\n !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);\n }\n // Gravity\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n if (!n.fixed) {\n vec2.sub(v12, center, n.p);\n // let d = vec2.len(v12);\n // vec2.scale(v12, v12, 1 / d);\n // let gravityFactor = gravity;\n scaleAndAdd(n.p, n.p, v12, gravity * friction);\n }\n }\n // Repulsive\n // PENDING\n for (var i = 0; i < nLen; i++) {\n var n1 = nodes[i];\n for (var j = i + 1; j < nLen; j++) {\n var n2 = nodes[j];\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12);\n if (d === 0) {\n // Random repulse\n vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);\n d = 1;\n }\n var repFact = (n1.rep + n2.rep) / d / d;\n !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);\n !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);\n }\n }\n var v = [];\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n if (!n.fixed) {\n vec2.sub(v, n.p, n.pp);\n scaleAndAdd(n.p, n.p, v, friction);\n vec2.copy(n.pp, n.p);\n }\n }\n friction = friction * 0.992;\n var finished = friction < 0.01;\n afterStepCallback && afterStepCallback(nodes, edges, finished);\n cb && cb(finished);\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { forceLayout } from './forceHelper.js';\nimport { simpleLayout } from './simpleLayoutHelper.js';\nimport { circularLayout } from './circularLayoutHelper.js';\nimport { linearMap } from '../../util/number.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport default function graphForceLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var coordSys = graphSeries.coordinateSystem;\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n if (graphSeries.get('layout') === 'force') {\n var preservedPoints_1 = graphSeries.preservedPoints || {};\n var graph_1 = graphSeries.getGraph();\n var nodeData_1 = graph_1.data;\n var edgeData = graph_1.edgeData;\n var forceModel = graphSeries.getModel('force');\n var initLayout = forceModel.get('initLayout');\n if (graphSeries.preservedPoints) {\n nodeData_1.each(function (idx) {\n var id = nodeData_1.getId(idx);\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\n });\n } else if (!initLayout || initLayout === 'none') {\n simpleLayout(graphSeries);\n } else if (initLayout === 'circular') {\n circularLayout(graphSeries, 'value');\n }\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\n var edgeDataExtent_1 = edgeData.getDataExtent('value');\n // let edgeDataExtent = edgeData.getDataExtent('value');\n var repulsion = forceModel.get('repulsion');\n var edgeLength = forceModel.get('edgeLength');\n var repulsionArr_1 = zrUtil.isArray(repulsion) ? repulsion : [repulsion, repulsion];\n var edgeLengthArr_1 = zrUtil.isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength];\n // Larger value has smaller length\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\n var point = nodeData_1.getItemLayout(idx);\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\n if (isNaN(rep)) {\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\n }\n return {\n w: rep,\n rep: rep,\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\n p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point\n };\n });\n var edges = edgeData.mapArray('value', function (value, idx) {\n var edge = graph_1.getEdgeByIndex(idx);\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\n if (isNaN(d)) {\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\n }\n var edgeModel = edge.getModel();\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\n return {\n n1: nodes_1[edge.node1.dataIndex],\n n2: nodes_1[edge.node2.dataIndex],\n d: d,\n curveness: curveness,\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\n };\n });\n // let coordSys = graphSeries.coordinateSystem;\n var rect = coordSys.getBoundingRect();\n var forceInstance = forceLayout(nodes_1, edges, {\n rect: rect,\n gravity: forceModel.get('gravity'),\n friction: forceModel.get('friction')\n });\n forceInstance.beforeStep(function (nodes, edges) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i].fixed) {\n // Write back to layout instance\n vec2.copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\n }\n }\n });\n forceInstance.afterStep(function (nodes, edges, stopped) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (!nodes[i].fixed) {\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\n }\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\n }\n for (var i = 0, l = edges.length; i < l; i++) {\n var e = edges[i];\n var edge = graph_1.getEdgeByIndex(i);\n var p1 = e.n1.p;\n var p2 = e.n2.p;\n var points = edge.getLayout();\n points = points ? points.slice() : [];\n points[0] = points[0] || [];\n points[1] = points[1] || [];\n vec2.copy(points[0], p1);\n vec2.copy(points[1], p2);\n if (+e.curveness) {\n points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness];\n }\n edge.setLayout(points);\n }\n });\n graphSeries.forceLayout = forceInstance;\n graphSeries.preservedPoints = preservedPoints_1;\n // Step to get the layout\n forceInstance.step();\n } else {\n // Remove prev injected forceLayout instance\n graphSeries.forceLayout = null;\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// FIXME Where to create the simple view coordinate system\nimport View from '../../coord/View.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport { extend } from 'zrender/lib/core/util.js';\nfunction getViewRect(seriesModel, api, aspect) {\n var option = extend(seriesModel.getBoxLayoutParams(), {\n aspect: aspect\n });\n return getLayoutRect(option, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\nexport default function createViewCoordSys(ecModel, api) {\n var viewList = [];\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var coordSysType = seriesModel.get('coordinateSystem');\n if (!coordSysType || coordSysType === 'view') {\n var data_1 = seriesModel.getData();\n var positions = data_1.mapArray(function (idx) {\n var itemModel = data_1.getItemModel(idx);\n return [+itemModel.get('x'), +itemModel.get('y')];\n });\n var min = [];\n var max = [];\n bbox.fromPoints(positions, min, max);\n // If width or height is 0\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n var aspect = (max[0] - min[0]) / (max[1] - min[1]);\n // FIXME If get view rect after data processed?\n var viewRect = getViewRect(seriesModel, api, aspect);\n // Position may be NaN, use view rect instead\n if (isNaN(aspect)) {\n min = [viewRect.x, viewRect.y];\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n }\n var bbWidth = max[0] - min[0];\n var bbHeight = max[1] - min[1];\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight);\n // Update roam info\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n viewList.push(viewCoordSys);\n }\n });\n return viewList;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Line path for bezier and straight line draw\n */\nimport * as graphic from '../../util/graphic.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar straightLineProto = graphic.Line.prototype;\nvar bezierCurveProto = graphic.BezierCurve.prototype;\nvar StraightLineShape = /** @class */function () {\n function StraightLineShape() {\n // Start point\n this.x1 = 0;\n this.y1 = 0;\n // End point\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n return StraightLineShape;\n}();\nvar CurveShape = /** @class */function (_super) {\n __extends(CurveShape, _super);\n function CurveShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return CurveShape;\n}(StraightLineShape);\nfunction isStraightLine(shape) {\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\n}\nvar ECLinePath = /** @class */function (_super) {\n __extends(ECLinePath, _super);\n function ECLinePath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'ec-line';\n return _this;\n }\n ECLinePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n ECLinePath.prototype.getDefaultShape = function () {\n return new StraightLineShape();\n };\n ECLinePath.prototype.buildPath = function (ctx, shape) {\n if (isStraightLine(shape)) {\n straightLineProto.buildPath.call(this, ctx, shape);\n } else {\n bezierCurveProto.buildPath.call(this, ctx, shape);\n }\n };\n ECLinePath.prototype.pointAt = function (t) {\n if (isStraightLine(this.shape)) {\n return straightLineProto.pointAt.call(this, t);\n } else {\n return bezierCurveProto.pointAt.call(this, t);\n }\n };\n ECLinePath.prototype.tangentAt = function (t) {\n var shape = this.shape;\n var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);\n return vec2.normalize(p, p);\n };\n return ECLinePath;\n}(graphic.Path);\nexport default ECLinePath;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { isArray, each } from 'zrender/lib/core/util.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ECLinePath from './LinePath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enterEmphasis, leaveEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle.js';\nimport { round } from '../../util/number.js';\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\nfunction makeSymbolTypeKey(symbolCategory) {\n return '_' + symbolCategory + 'Type';\n}\nfunction makeSymbolTypeValue(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n if (!symbolType || symbolType === 'none') {\n return symbolType;\n }\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || '') + (symbolKeepAspect || '');\n}\n/**\n * @inner\n */\nfunction createSymbol(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n if (!symbolType || symbolType === 'none') {\n return;\n }\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n var symbolPath = symbolUtil.createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;\n symbolPath.name = name;\n return symbolPath;\n}\nfunction createLine(points) {\n var line = new ECLinePath({\n name: 'line',\n subPixelOptimize: true\n });\n setLinePoints(line.shape, points);\n return line;\n}\nfunction setLinePoints(targetShape, points) {\n targetShape.x1 = points[0][0];\n targetShape.y1 = points[0][1];\n targetShape.x2 = points[1][0];\n targetShape.y2 = points[1][1];\n targetShape.percent = 1;\n var cp1 = points[2];\n if (cp1) {\n targetShape.cpx1 = cp1[0];\n targetShape.cpy1 = cp1[1];\n } else {\n targetShape.cpx1 = NaN;\n targetShape.cpy1 = NaN;\n }\n}\nvar Line = /** @class */function (_super) {\n __extends(Line, _super);\n function Line(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n _this._createLine(lineData, idx, seriesScope);\n return _this;\n }\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var linePoints = lineData.getItemLayout(idx);\n var line = createLine(linePoints);\n line.shape.percent = 0;\n graphic.initProps(line, {\n shape: {\n percent: 1\n }\n }, seriesModel, idx);\n this.add(line);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = createSymbol(symbolCategory, lineData, idx);\n // symbols must added after line to make sure\n // it will be updated after line#update.\n // Or symbol position and rotation update in line#beforeUpdate will be one frame slow\n this.add(symbol);\n this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx);\n }, this);\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n // TODO More strict on the List type in parameters?\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var linePoints = lineData.getItemLayout(idx);\n var target = {\n shape: {}\n };\n setLinePoints(target.shape, linePoints);\n graphic.updateProps(line, target, seriesModel, idx);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx);\n var key = makeSymbolTypeKey(symbolCategory);\n // Symbol changed\n if (this[key] !== symbolType) {\n this.remove(this.childOfName(symbolCategory));\n var symbol = createSymbol(symbolCategory, lineData, idx);\n this.add(symbol);\n }\n this[key] = symbolType;\n }, this);\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n ;\n Line.prototype.getLinePath = function () {\n return this.childAt(0);\n };\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\n var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n var focus = seriesScope && seriesScope.focus;\n var blurScope = seriesScope && seriesScope.blurScope;\n // Optimization for large dataset\n if (!seriesScope || lineData.hasItemOption) {\n var itemModel = lineData.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\n emphasisDisabled = emphasisModel.get('disabled');\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var visualColor = lineStyle.stroke;\n line.useStyle(lineStyle);\n line.style.fill = null;\n line.style.strokeNoScale = true;\n line.ensureState('emphasis').style = emphasisLineStyle;\n line.ensureState('blur').style = blurLineStyle;\n line.ensureState('select').style = selectLineStyle;\n // Update symbol\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = this.childOfName(symbolCategory);\n if (symbol) {\n // Share opacity and color with line.\n symbol.setColor(visualColor);\n symbol.style.opacity = lineStyle.opacity;\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var lineState = line.getState(stateName);\n if (lineState) {\n var lineStateStyle = lineState.style || {};\n var state = symbol.ensureState(stateName);\n var stateStyle = state.style || (state.style = {});\n if (lineStateStyle.stroke != null) {\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\n }\n if (lineStateStyle.opacity != null) {\n stateStyle.opacity = lineStateStyle.opacity;\n }\n }\n }\n symbol.markRedraw();\n }\n }, this);\n var rawVal = seriesModel.getRawValue(idx);\n setLabelStyle(this, labelStatesModels, {\n labelDataIndex: idx,\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\n }\n },\n inheritColor: visualColor || '#000',\n defaultOpacity: lineStyle.opacity,\n defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + ''\n });\n var label = this.getTextContent();\n // Always set `textStyle` even if `normalStyle.text` is null, because default\n // values have to be set on `normalStyle`.\n if (label) {\n var labelNormalModel = labelStatesModels.normal;\n label.__align = label.style.align;\n label.__verticalAlign = label.style.verticalAlign;\n // 'start', 'middle', 'end'\n label.__position = labelNormalModel.get('position') || 'middle';\n var distance = labelNormalModel.get('distance');\n if (!isArray(distance)) {\n distance = [distance, distance];\n }\n label.__labelDistance = distance;\n }\n this.setTextConfig({\n position: null,\n local: true,\n inside: false // Can't be inside for stroke element.\n });\n\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n Line.prototype.highlight = function () {\n enterEmphasis(this);\n };\n Line.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n Line.prototype.updateLayout = function (lineData, idx) {\n this.setLinePoints(lineData.getItemLayout(idx));\n };\n Line.prototype.setLinePoints = function (points) {\n var linePath = this.childOfName('line');\n setLinePoints(linePath.shape, points);\n linePath.dirty();\n };\n Line.prototype.beforeUpdate = function () {\n var lineGroup = this;\n var symbolFrom = lineGroup.childOfName('fromSymbol');\n var symbolTo = lineGroup.childOfName('toSymbol');\n var label = lineGroup.getTextContent();\n // Quick reject\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\n return;\n }\n var invScale = 1;\n var parentNode = this.parent;\n while (parentNode) {\n if (parentNode.scaleX) {\n invScale /= parentNode.scaleX;\n }\n parentNode = parentNode.parent;\n }\n var line = lineGroup.childOfName('line');\n // If line not changed\n // FIXME Parent scale changed\n if (!this.__dirty && !line.__dirty) {\n return;\n }\n var percent = line.shape.percent;\n var fromPos = line.pointAt(0);\n var toPos = line.pointAt(percent);\n var d = vector.sub([], toPos, fromPos);\n vector.normalize(d, d);\n function setSymbolRotation(symbol, percent) {\n // Fix #12388\n // when symbol is set to be 'arrow' in markLine,\n // symbolRotate value will be ignored, and compulsively use tangent angle.\n // rotate by default if symbol rotation is not specified\n var specifiedRotation = symbol.__specifiedRotation;\n if (specifiedRotation == null) {\n var tangent = line.tangentAt(percent);\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\n } else {\n symbol.attr('rotation', specifiedRotation);\n }\n }\n if (symbolFrom) {\n symbolFrom.setPosition(fromPos);\n setSymbolRotation(symbolFrom, 0);\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\n symbolFrom.markRedraw();\n }\n if (symbolTo) {\n symbolTo.setPosition(toPos);\n setSymbolRotation(symbolTo, 1);\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\n symbolTo.markRedraw();\n }\n if (label && !label.ignore) {\n label.x = label.y = 0;\n label.originX = label.originY = 0;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var distance = label.__labelDistance;\n var distanceX = distance[0] * invScale;\n var distanceY = distance[1] * invScale;\n var halfPercent = percent / 2;\n var tangent = line.tangentAt(halfPercent);\n var n = [tangent[1], -tangent[0]];\n var cp = line.pointAt(halfPercent);\n if (n[1] > 0) {\n n[0] = -n[0];\n n[1] = -n[1];\n }\n var dir = tangent[0] < 0 ? -1 : 1;\n if (label.__position !== 'start' && label.__position !== 'end') {\n var rotation = -Math.atan2(tangent[1], tangent[0]);\n if (toPos[0] < fromPos[0]) {\n rotation = Math.PI + rotation;\n }\n label.rotation = rotation;\n }\n var dy = void 0;\n switch (label.__position) {\n case 'insideStartTop':\n case 'insideMiddleTop':\n case 'insideEndTop':\n case 'middle':\n dy = -distanceY;\n textVerticalAlign = 'bottom';\n break;\n case 'insideStartBottom':\n case 'insideMiddleBottom':\n case 'insideEndBottom':\n dy = distanceY;\n textVerticalAlign = 'top';\n break;\n default:\n dy = 0;\n textVerticalAlign = 'middle';\n }\n switch (label.__position) {\n case 'end':\n label.x = d[0] * distanceX + toPos[0];\n label.y = d[1] * distanceY + toPos[1];\n textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle';\n break;\n case 'start':\n label.x = -d[0] * distanceX + fromPos[0];\n label.y = -d[1] * distanceY + fromPos[1];\n textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle';\n break;\n case 'insideStartTop':\n case 'insideStart':\n case 'insideStartBottom':\n label.x = distanceX * dir + fromPos[0];\n label.y = fromPos[1] + dy;\n textAlign = tangent[0] < 0 ? 'right' : 'left';\n label.originX = -distanceX * dir;\n label.originY = -dy;\n break;\n case 'insideMiddleTop':\n case 'insideMiddle':\n case 'insideMiddleBottom':\n case 'middle':\n label.x = cp[0];\n label.y = cp[1] + dy;\n textAlign = 'center';\n label.originY = -dy;\n break;\n case 'insideEndTop':\n case 'insideEnd':\n case 'insideEndBottom':\n label.x = -distanceX * dir + toPos[0];\n label.y = toPos[1] + dy;\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\n label.originX = distanceX * dir;\n label.originY = -dy;\n break;\n }\n label.scaleX = label.scaleY = invScale;\n label.setStyle({\n // Use the user specified text align and baseline first\n verticalAlign: label.__verticalAlign || textVerticalAlign,\n align: label.__align || textAlign\n });\n }\n };\n return Line;\n}(graphic.Group);\nexport default Line;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as graphic from '../../util/graphic.js';\nimport LineGroup from './Line.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\nvar LineDraw = /** @class */function () {\n function LineDraw(LineCtor) {\n this.group = new graphic.Group();\n this._LineCtor = LineCtor || LineGroup;\n }\n LineDraw.prototype.updateData = function (lineData) {\n var _this = this;\n // Remove progressive els.\n this._progressiveEls = null;\n var lineDraw = this;\n var group = lineDraw.group;\n var oldLineData = lineDraw._lineData;\n lineDraw._lineData = lineData;\n // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n if (!oldLineData) {\n group.removeAll();\n }\n var seriesScope = makeSeriesScope(lineData);\n lineData.diff(oldLineData).add(function (idx) {\n _this._doAdd(lineData, idx, seriesScope);\n }).update(function (newIdx, oldIdx) {\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\n }).remove(function (idx) {\n group.remove(oldLineData.getItemGraphicEl(idx));\n }).execute();\n };\n ;\n LineDraw.prototype.updateLayout = function () {\n var lineData = this._lineData;\n // Do not support update layout in incremental mode.\n if (!lineData) {\n return;\n }\n lineData.eachItemGraphicEl(function (el, idx) {\n el.updateLayout(lineData, idx);\n }, this);\n };\n ;\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\n this._seriesScope = makeSeriesScope(lineData);\n this._lineData = null;\n this.group.removeAll();\n };\n ;\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\n this._progressiveEls = [];\n function updateIncrementalAndHover(el) {\n if (!el.isGroup && !isEffectObject(el)) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var itemLayout = lineData.getItemLayout(idx);\n if (lineNeedsDraw(itemLayout)) {\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n this.group.add(el);\n lineData.setItemGraphicEl(idx, el);\n this._progressiveEls.push(el);\n }\n }\n };\n ;\n LineDraw.prototype.remove = function () {\n this.group.removeAll();\n };\n ;\n LineDraw.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\n var itemLayout = lineData.getItemLayout(idx);\n if (!lineNeedsDraw(itemLayout)) {\n return;\n }\n var el = new this._LineCtor(lineData, idx, seriesScope);\n lineData.setItemGraphicEl(idx, el);\n this.group.add(el);\n };\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\n this.group.remove(itemEl);\n return;\n }\n if (!itemEl) {\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\n } else {\n itemEl.updateData(newLineData, newIdx, seriesScope);\n }\n newLineData.setItemGraphicEl(newIdx, itemEl);\n this.group.add(itemEl);\n };\n return LineDraw;\n}();\nfunction isEffectObject(el) {\n return el.animators && el.animators.length > 0;\n}\nfunction makeSeriesScope(lineData) {\n var hostModel = lineData.hostModel;\n var emphasisModel = hostModel.getModel('emphasis');\n return {\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\n emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(),\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\n emphasisDisabled: emphasisModel.get('disabled'),\n blurScope: emphasisModel.get('blurScope'),\n focus: emphasisModel.get('focus'),\n labelStatesModels: getLabelStatesModels(hostModel)\n };\n}\nfunction isPointNaN(pt) {\n return isNaN(pt[0]) || isNaN(pt[1]);\n}\nfunction lineNeedsDraw(pts) {\n return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\n}\nexport default LineDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as curveTool from 'zrender/lib/core/curve.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize } from './graphHelper.js';\nvar v1 = [];\nvar v2 = [];\nvar v3 = [];\nvar quadraticAt = curveTool.quadraticAt;\nvar v2DistSquare = vec2.distSquare;\nvar mathAbs = Math.abs;\nfunction intersectCurveCircle(curvePoints, center, radius) {\n var p0 = curvePoints[0];\n var p1 = curvePoints[1];\n var p2 = curvePoints[2];\n var d = Infinity;\n var t;\n var radiusSquare = radius * radius;\n var interval = 0.1;\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\n v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t);\n v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t);\n var diff = mathAbs(v2DistSquare(v1, center) - radiusSquare);\n if (diff < d) {\n d = diff;\n t = _t;\n }\n }\n // Assume the segment is monotone,Find root through Bisection method\n // At most 32 iteration\n for (var i = 0; i < 32; i++) {\n // let prev = t - interval;\n var next = t + interval;\n // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);\n // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);\n v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);\n v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);\n v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);\n v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);\n var diff = v2DistSquare(v2, center) - radiusSquare;\n if (mathAbs(diff) < 1e-2) {\n break;\n }\n // let prevDiff = v2DistSquare(v1, center) - radiusSquare;\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\n interval /= 2;\n if (diff < 0) {\n if (nextDiff >= 0) {\n t = t + interval;\n } else {\n t = t - interval;\n }\n } else {\n if (nextDiff >= 0) {\n t = t - interval;\n } else {\n t = t + interval;\n }\n }\n }\n return t;\n}\n// Adjust edge to avoid\nexport default function adjustEdge(graph, scale) {\n var tmp0 = [];\n var quadraticSubdivide = curveTool.quadraticSubdivide;\n var pts = [[], [], []];\n var pts2 = [[], []];\n var v = [];\n scale /= 2;\n graph.eachEdge(function (edge, idx) {\n var linePoints = edge.getLayout();\n var fromSymbol = edge.getVisual('fromSymbol');\n var toSymbol = edge.getVisual('toSymbol');\n if (!linePoints.__original) {\n linePoints.__original = [vec2.clone(linePoints[0]), vec2.clone(linePoints[1])];\n if (linePoints[2]) {\n linePoints.__original.push(vec2.clone(linePoints[2]));\n }\n }\n var originalPoints = linePoints.__original;\n // Quadratic curve\n if (linePoints[2] != null) {\n vec2.copy(pts[0], originalPoints[0]);\n vec2.copy(pts[1], originalPoints[2]);\n vec2.copy(pts[2], originalPoints[1]);\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale);\n // Subdivide and get the second\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[0][0] = tmp0[3];\n pts[1][0] = tmp0[4];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[0][1] = tmp0[3];\n pts[1][1] = tmp0[4];\n }\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale);\n // Subdivide and get the first\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[1][0] = tmp0[1];\n pts[2][0] = tmp0[2];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[1][1] = tmp0[1];\n pts[2][1] = tmp0[2];\n }\n // Copy back to layout\n vec2.copy(linePoints[0], pts[0]);\n vec2.copy(linePoints[1], pts[2]);\n vec2.copy(linePoints[2], pts[1]);\n }\n // Line\n else {\n vec2.copy(pts2[0], originalPoints[0]);\n vec2.copy(pts2[1], originalPoints[1]);\n vec2.sub(v, pts2[1], pts2[0]);\n vec2.normalize(v, v);\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\n }\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\n }\n vec2.copy(linePoints[0], pts2[0]);\n vec2.copy(linePoints[1], pts2[1]);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LineDraw from '../helper/LineDraw.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport adjustEdge from './adjustEdge.js';\nimport { getNodeGlobalScale } from './graphHelper.js';\nimport ChartView from '../../view/Chart.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { simpleLayoutEdge } from './simpleLayoutHelper.js';\nimport { circularLayout, rotateNodeLabel } from './circularLayoutHelper.js';\nfunction isViewCoordSys(coordSys) {\n return coordSys.type === 'view';\n}\nvar GraphView = /** @class */function (_super) {\n __extends(GraphView, _super);\n function GraphView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GraphView.type;\n return _this;\n }\n GraphView.prototype.init = function (ecModel, api) {\n var symbolDraw = new SymbolDraw();\n var lineDraw = new LineDraw();\n var group = this.group;\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n group.add(symbolDraw.group);\n group.add(lineDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineDraw = lineDraw;\n this._firstRender = true;\n };\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n var coordSys = seriesModel.coordinateSystem;\n this._model = seriesModel;\n var symbolDraw = this._symbolDraw;\n var lineDraw = this._lineDraw;\n var group = this.group;\n if (isViewCoordSys(coordSys)) {\n var groupNewProp = {\n x: coordSys.x,\n y: coordSys.y,\n scaleX: coordSys.scaleX,\n scaleY: coordSys.scaleY\n };\n if (this._firstRender) {\n group.attr(groupNewProp);\n } else {\n graphic.updateProps(group, groupNewProp, seriesModel);\n }\n }\n // Fix edge contact point with node\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n var data = seriesModel.getData();\n symbolDraw.updateData(data);\n var edgeData = seriesModel.getEdgeData();\n // TODO: TYPE\n lineDraw.updateData(edgeData);\n this._updateNodeAndLinkScale();\n this._updateController(seriesModel, ecModel, api);\n clearTimeout(this._layoutTimeout);\n var forceLayout = seriesModel.forceLayout;\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\n if (forceLayout) {\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\n }\n var layout = seriesModel.get('layout');\n data.graph.eachNode(function (node) {\n var idx = node.dataIndex;\n var el = node.getGraphicEl();\n var itemModel = node.getModel();\n if (!el) {\n return;\n }\n // Update draggable\n el.off('drag').off('dragend');\n var draggable = itemModel.get('draggable');\n if (draggable) {\n el.on('drag', function (e) {\n switch (layout) {\n case 'force':\n forceLayout.warmUp();\n !_this._layouting && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\n forceLayout.setFixed(idx);\n // Write position back to layout\n data.setItemLayout(idx, [el.x, el.y]);\n break;\n case 'circular':\n data.setItemLayout(idx, [el.x, el.y]);\n // mark node fixed\n node.setLayout({\n fixed: true\n }, true);\n // recalculate circular layout\n circularLayout(seriesModel, 'symbolSize', node, [e.offsetX, e.offsetY]);\n _this.updateLayout(seriesModel);\n break;\n case 'none':\n default:\n data.setItemLayout(idx, [el.x, el.y]);\n // update edge\n simpleLayoutEdge(seriesModel.getGraph(), seriesModel);\n _this.updateLayout(seriesModel);\n break;\n }\n }).on('dragend', function () {\n if (forceLayout) {\n forceLayout.setUnfixed(idx);\n }\n });\n }\n el.setDraggable(draggable, !!itemModel.get('cursor'));\n var focus = itemModel.get(['emphasis', 'focus']);\n if (focus === 'adjacency') {\n getECData(el).focus = node.getAdjacentDataIndices();\n }\n });\n data.graph.eachEdge(function (edge) {\n var el = edge.getGraphicEl();\n var focus = edge.getModel().get(['emphasis', 'focus']);\n if (!el) {\n return;\n }\n if (focus === 'adjacency') {\n getECData(el).focus = {\n edge: [edge.dataIndex],\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\n };\n }\n });\n var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']);\n var cx = data.getLayout('cx');\n var cy = data.getLayout('cy');\n data.graph.eachNode(function (node) {\n rotateNodeLabel(node, circularRotateLabel, cx, cy);\n });\n this._firstRender = false;\n };\n GraphView.prototype.dispose = function () {\n this.remove();\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\n var self = this;\n (function step() {\n forceLayout.step(function (stopped) {\n self.updateLayout(self._model);\n (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step());\n });\n })();\n };\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\n controller.disable();\n return;\n }\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n _this._updateNodeAndLinkScale();\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n _this._lineDraw.updateLayout();\n // Only update label layout on zoom\n api.updateLabelLayout();\n });\n };\n GraphView.prototype._updateNodeAndLinkScale = function () {\n var seriesModel = this._model;\n var data = seriesModel.getData();\n var nodeScale = getNodeGlobalScale(seriesModel);\n data.eachItemGraphicEl(function (el, idx) {\n el && el.setSymbolScale(nodeScale);\n });\n };\n GraphView.prototype.updateLayout = function (seriesModel) {\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n this._symbolDraw.updateLayout();\n this._lineDraw.updateLayout();\n };\n GraphView.prototype.remove = function () {\n clearTimeout(this._layoutTimeout);\n this._layouting = false;\n this._layoutTimeout = null;\n this._symbolDraw && this._symbolDraw.remove();\n this._lineDraw && this._lineDraw.remove();\n };\n GraphView.type = 'graph';\n return GraphView;\n}(ChartView);\nexport default GraphView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// id may be function name of Object, add a prefix to avoid this problem.\nfunction generateNodeKey(id) {\n return '_EC_' + id;\n}\nvar Graph = /** @class */function () {\n function Graph(directed) {\n this.type = 'graph';\n this.nodes = [];\n this.edges = [];\n this._nodesMap = {};\n /**\n * @type {Object.}\n * @private\n */\n this._edgesMap = {};\n this._directed = directed || false;\n }\n /**\n * If is directed graph\n */\n Graph.prototype.isDirected = function () {\n return this._directed;\n };\n ;\n /**\n * Add a new node\n */\n Graph.prototype.addNode = function (id, dataIndex) {\n id = id == null ? '' + dataIndex : '' + id;\n var nodesMap = this._nodesMap;\n if (nodesMap[generateNodeKey(id)]) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Graph nodes have duplicate name or id');\n }\n return;\n }\n var node = new GraphNode(id, dataIndex);\n node.hostGraph = this;\n this.nodes.push(node);\n nodesMap[generateNodeKey(id)] = node;\n return node;\n };\n ;\n /**\n * Get node by data index\n */\n Graph.prototype.getNodeByIndex = function (dataIndex) {\n var rawIdx = this.data.getRawIndex(dataIndex);\n return this.nodes[rawIdx];\n };\n ;\n /**\n * Get node by id\n */\n Graph.prototype.getNodeById = function (id) {\n return this._nodesMap[generateNodeKey(id)];\n };\n ;\n /**\n * Add a new edge\n */\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\n var nodesMap = this._nodesMap;\n var edgesMap = this._edgesMap;\n // PENDING\n if (zrUtil.isNumber(n1)) {\n n1 = this.nodes[n1];\n }\n if (zrUtil.isNumber(n2)) {\n n2 = this.nodes[n2];\n }\n if (!(n1 instanceof GraphNode)) {\n n1 = nodesMap[generateNodeKey(n1)];\n }\n if (!(n2 instanceof GraphNode)) {\n n2 = nodesMap[generateNodeKey(n2)];\n }\n if (!n1 || !n2) {\n return;\n }\n var key = n1.id + '-' + n2.id;\n var edge = new GraphEdge(n1, n2, dataIndex);\n edge.hostGraph = this;\n if (this._directed) {\n n1.outEdges.push(edge);\n n2.inEdges.push(edge);\n }\n n1.edges.push(edge);\n if (n1 !== n2) {\n n2.edges.push(edge);\n }\n this.edges.push(edge);\n edgesMap[key] = edge;\n return edge;\n };\n ;\n /**\n * Get edge by data index\n */\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\n return this.edges[rawIdx];\n };\n ;\n /**\n * Get edge by two linked nodes\n */\n Graph.prototype.getEdge = function (n1, n2) {\n if (n1 instanceof GraphNode) {\n n1 = n1.id;\n }\n if (n2 instanceof GraphNode) {\n n2 = n2.id;\n }\n var edgesMap = this._edgesMap;\n if (this._directed) {\n return edgesMap[n1 + '-' + n2];\n } else {\n return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1];\n }\n };\n ;\n /**\n * Iterate all nodes\n */\n Graph.prototype.eachNode = function (cb, context) {\n var nodes = this.nodes;\n var len = nodes.length;\n for (var i = 0; i < len; i++) {\n if (nodes[i].dataIndex >= 0) {\n cb.call(context, nodes[i], i);\n }\n }\n };\n ;\n /**\n * Iterate all edges\n */\n Graph.prototype.eachEdge = function (cb, context) {\n var edges = this.edges;\n var len = edges.length;\n for (var i = 0; i < len; i++) {\n if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) {\n cb.call(context, edges[i], i);\n }\n }\n };\n ;\n /**\n * Breadth first traverse\n * Return true to stop traversing\n */\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\n if (!(startNode instanceof GraphNode)) {\n startNode = this._nodesMap[generateNodeKey(startNode)];\n }\n if (!startNode) {\n return;\n }\n var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges';\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].__visited = false;\n }\n if (cb.call(context, startNode, null)) {\n return;\n }\n var queue = [startNode];\n while (queue.length) {\n var currentNode = queue.shift();\n var edges = currentNode[edgeType];\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n var otherNode = e.node1 === currentNode ? e.node2 : e.node1;\n if (!otherNode.__visited) {\n if (cb.call(context, otherNode, currentNode)) {\n // Stop traversing\n return;\n }\n queue.push(otherNode);\n otherNode.__visited = true;\n }\n }\n }\n };\n ;\n // TODO\n // depthFirstTraverse(\n // cb, startNode, direction, context\n // ) {\n // };\n // Filter update\n Graph.prototype.update = function () {\n var data = this.data;\n var edgeData = this.edgeData;\n var nodes = this.nodes;\n var edges = this.edges;\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n edgeData.filterSelf(function (idx) {\n var edge = edges[edgeData.getRawIndex(idx)];\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\n });\n // Update edge\n for (var i = 0, len = edges.length; i < len; i++) {\n edges[i].dataIndex = -1;\n }\n for (var i = 0, len = edgeData.count(); i < len; i++) {\n edges[edgeData.getRawIndex(i)].dataIndex = i;\n }\n };\n ;\n /**\n * @return {module:echarts/data/Graph}\n */\n Graph.prototype.clone = function () {\n var graph = new Graph(this._directed);\n var nodes = this.nodes;\n var edges = this.edges;\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\n }\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\n }\n return graph;\n };\n ;\n return Graph;\n}();\nvar GraphNode = /** @class */function () {\n function GraphNode(id, dataIndex) {\n this.inEdges = [];\n this.outEdges = [];\n this.edges = [];\n this.dataIndex = -1;\n this.id = id == null ? '' : id;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n /**\n * @return {number}\n */\n GraphNode.prototype.degree = function () {\n return this.edges.length;\n };\n /**\n * @return {number}\n */\n GraphNode.prototype.inDegree = function () {\n return this.inEdges.length;\n };\n /**\n * @return {number}\n */\n GraphNode.prototype.outDegree = function () {\n return this.outEdges.length;\n };\n GraphNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n var graph = this.hostGraph;\n var itemModel = graph.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n GraphNode.prototype.getAdjacentDataIndices = function () {\n var dataIndices = {\n edge: [],\n node: []\n };\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n dataIndices.edge.push(adjacentEdge.dataIndex);\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\n }\n return dataIndices;\n };\n GraphNode.prototype.getTrajectoryDataIndices = function () {\n var connectedEdgesMap = zrUtil.createHashMap();\n var connectedNodesMap = zrUtil.createHashMap();\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n connectedEdgesMap.set(adjacentEdge.dataIndex, true);\n var sourceNodesQueue = [adjacentEdge.node1];\n var targetNodesQueue = [adjacentEdge.node2];\n var nodeIteratorIndex = 0;\n while (nodeIteratorIndex < sourceNodesQueue.length) {\n var sourceNode = sourceNodesQueue[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(sourceNode.dataIndex, true);\n for (var j = 0; j < sourceNode.inEdges.length; j++) {\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\n sourceNodesQueue.push(sourceNode.inEdges[j].node1);\n }\n }\n nodeIteratorIndex = 0;\n while (nodeIteratorIndex < targetNodesQueue.length) {\n var targetNode = targetNodesQueue[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(targetNode.dataIndex, true);\n for (var j = 0; j < targetNode.outEdges.length; j++) {\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\n targetNodesQueue.push(targetNode.outEdges[j].node2);\n }\n }\n }\n return {\n edge: connectedEdgesMap.keys(),\n node: connectedNodesMap.keys()\n };\n };\n return GraphNode;\n}();\nvar GraphEdge = /** @class */function () {\n function GraphEdge(n1, n2, dataIndex) {\n this.dataIndex = -1;\n this.node1 = n1;\n this.node2 = n2;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n GraphEdge.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n var graph = this.hostGraph;\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n GraphEdge.prototype.getAdjacentDataIndices = function () {\n return {\n edge: [this.dataIndex],\n node: [this.node1.dataIndex, this.node2.dataIndex]\n };\n };\n GraphEdge.prototype.getTrajectoryDataIndices = function () {\n var connectedEdgesMap = zrUtil.createHashMap();\n var connectedNodesMap = zrUtil.createHashMap();\n connectedEdgesMap.set(this.dataIndex, true);\n var sourceNodes = [this.node1];\n var targetNodes = [this.node2];\n var nodeIteratorIndex = 0;\n while (nodeIteratorIndex < sourceNodes.length) {\n var sourceNode = sourceNodes[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(sourceNode.dataIndex, true);\n for (var j = 0; j < sourceNode.inEdges.length; j++) {\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\n sourceNodes.push(sourceNode.inEdges[j].node1);\n }\n }\n nodeIteratorIndex = 0;\n while (nodeIteratorIndex < targetNodes.length) {\n var targetNode = targetNodes[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(targetNode.dataIndex, true);\n for (var j = 0; j < targetNode.outEdges.length; j++) {\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\n targetNodes.push(targetNode.outEdges[j].node2);\n }\n }\n return {\n edge: connectedEdgesMap.keys(),\n node: connectedNodesMap.keys()\n };\n };\n return GraphEdge;\n}();\nfunction createGraphDataProxyMixin(hostName, dataName) {\n return {\n /**\n * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\n */\n getValue: function (dimension) {\n var data = this[hostName][dataName];\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n },\n // TODO: TYPE stricter type.\n setVisual: function (key, value) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\n },\n getVisual: function (key) {\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\n },\n setLayout: function (layout, merge) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\n },\n getLayout: function () {\n return this[hostName][dataName].getItemLayout(this.dataIndex);\n },\n getGraphicEl: function () {\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\n },\n getRawIndex: function () {\n return this[hostName][dataName].getRawIndex(this.dataIndex);\n }\n };\n}\n;\n;\n;\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\nexport default Graph;\nexport { GraphNode, GraphEdge };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport Graph from '../../data/Graph.js';\nimport linkSeriesData from '../../data/helper/linkSeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport createSeriesData from './createSeriesData.js';\nimport { convertOptionIdName } from '../../util/model.js';\nexport default function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve(\n // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target;\n // addEdge may fail when source or target not exists\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\n linkCount++;\n }\n }\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createSeriesData(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : [];\n // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n var dimensions = prepareSeriesDataSchema(nodes, {\n coordDimensions: coordDimensions,\n encodeDefine: seriesModel.getEncode()\n }).dimensions;\n nodeData = new SeriesData(dimensions, seriesModel);\n nodeData.initData(nodes);\n }\n var edgeData = new SeriesData(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkSeriesData({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n });\n // Update dataIndex of nodes and edges because invalid edge may be removed\n graph.update();\n return graph;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport Model from '../../model/Model.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { defaultSeriesFormatTooltip } from '../../component/tooltip/seriesFormatTooltip.js';\nimport { initCurvenessList, createEdgeMapForCurveness } from '../helper/multipleGraphEdgeHelper.js';\nvar GraphSeriesModel = /** @class */function (_super) {\n __extends(GraphSeriesModel, _super);\n function GraphSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GraphSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n GraphSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments);\n var self = this;\n function getCategoriesData() {\n return self._categoriesData;\n }\n // Provide data for legend select\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\n this.fillDataTextStyle(option.edges || option.links);\n this._updateCategoriesData();\n };\n GraphSeriesModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n this.fillDataTextStyle(option.edges || option.links);\n this._updateCategoriesData();\n };\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\n defaultEmphasis(option, 'edgeLabel', ['show']);\n };\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var edges = option.edges || option.links || [];\n var nodes = option.data || option.nodes || [];\n var self = this;\n if (nodes && edges) {\n // auto curveness\n initCurvenessList(this);\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\n zrUtil.each(graph.edges, function (edge) {\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\n }, this);\n return graph.data;\n }\n function beforeLink(nodeData, edgeData) {\n // Overwrite nodeData.getItemModel to\n nodeData.wrapMethod('getItemModel', function (model) {\n var categoriesModels = self._categoriesModels;\n var categoryIdx = model.getShallow('category');\n var categoryModel = categoriesModels[categoryIdx];\n if (categoryModel) {\n categoryModel.parentModel = model.parentModel;\n model.parentModel = categoryModel;\n }\n return model;\n });\n // TODO Inherit resolveParentPath by default in Model#getModel?\n var oldGetModel = Model.prototype.getModel;\n function newGetModel(path, parentModel) {\n var model = oldGetModel.call(this, path, parentModel);\n model.resolveParentPath = resolveParentPath;\n return model;\n }\n edgeData.wrapMethod('getItemModel', function (model) {\n model.resolveParentPath = resolveParentPath;\n model.getModel = newGetModel;\n return model;\n });\n function resolveParentPath(pathArr) {\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\n var newPathArr = pathArr.slice();\n if (pathArr[0] === 'label') {\n newPathArr[0] = 'edgeLabel';\n } else if (pathArr[1] === 'label') {\n newPathArr[1] = 'edgeLabel';\n }\n return newPathArr;\n }\n return pathArr;\n }\n }\n };\n GraphSeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n GraphSeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n GraphSeriesModel.prototype.getCategoriesData = function () {\n return this._categoriesData;\n };\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n if (dataType === 'edge') {\n var nodeData = this.getData();\n var params = this.getDataParams(dataIndex, dataType);\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\n var sourceName = nodeData.getName(edge.node1.dataIndex);\n var targetName = nodeData.getName(edge.node2.dataIndex);\n var nameArr = [];\n sourceName != null && nameArr.push(sourceName);\n targetName != null && nameArr.push(targetName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > '),\n value: params.value,\n noValue: params.value == null\n });\n }\n // dataType === 'node' or empty\n var nodeMarkup = defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n return nodeMarkup;\n };\n GraphSeriesModel.prototype._updateCategoriesData = function () {\n var categories = zrUtil.map(this.option.categories || [], function (category) {\n // Data must has value\n return category.value != null ? category : zrUtil.extend({\n value: 0\n }, category);\n });\n var categoriesData = new SeriesData(['value'], this);\n categoriesData.initData(categories);\n this._categoriesData = categoriesData;\n this._categoriesModels = categoriesData.mapArray(function (idx) {\n return categoriesData.getItemModel(idx);\n });\n };\n GraphSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n GraphSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\n return _super.prototype.isAnimationEnabled.call(this)\n // Not enable animation when do force layout\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\n };\n GraphSeriesModel.type = 'series.graph';\n GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n GraphSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // Default option for all coordinate systems\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // polarIndex: 0,\n // geoIndex: 0,\n legendHoverLink: true,\n layout: null,\n // Configuration of circular layout\n circular: {\n rotateLabel: false\n },\n // Configuration of force directed layout\n force: {\n initLayout: null,\n // Node repulsion. Can be an array to represent range.\n repulsion: [0, 50],\n gravity: 0.1,\n // Initial friction\n friction: 0.6,\n // Edge length. Can be an array to represent range.\n edgeLength: 30,\n layoutAnimation: true\n },\n left: 'center',\n top: 'center',\n // right: null,\n // bottom: null,\n // width: '80%',\n // height: '80%',\n symbol: 'circle',\n symbolSize: 10,\n edgeSymbol: ['none', 'none'],\n edgeSymbolSize: 10,\n edgeLabel: {\n position: 'middle',\n distance: 5\n },\n draggable: false,\n roam: false,\n // Default on center of graph\n center: null,\n zoom: 1,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.6,\n // cursor: null,\n // categories: [],\n // data: []\n // Or\n // nodes: []\n //\n // links: []\n // Or\n // edges: []\n label: {\n show: false,\n formatter: '{b}'\n },\n itemStyle: {},\n lineStyle: {\n color: '#aaa',\n width: 1,\n opacity: 0.5\n },\n emphasis: {\n scale: true,\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return GraphSeriesModel;\n}(SeriesModel);\nexport default GraphSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport categoryFilter from './categoryFilter.js';\nimport categoryVisual from './categoryVisual.js';\nimport edgeVisual from './edgeVisual.js';\nimport simpleLayout from './simpleLayout.js';\nimport circularLayout from './circularLayout.js';\nimport forceLayout from './forceLayout.js';\nimport createView from './createView.js';\nimport View from '../../coord/View.js';\nimport GraphView from './GraphView.js';\nimport GraphSeriesModel from './GraphSeries.js';\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar actionInfo = {\n type: 'graphRoam',\n event: 'graphRoam',\n update: 'none'\n};\nexport function install(registers) {\n registers.registerChartView(GraphView);\n registers.registerSeriesModel(GraphSeriesModel);\n registers.registerProcessor(categoryFilter);\n registers.registerVisual(categoryVisual);\n registers.registerVisual(edgeVisual);\n registers.registerLayout(simpleLayout);\n registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout);\n registers.registerLayout(forceLayout);\n registers.registerCoordinateSystem('graphView', {\n dimensions: View.dimensions,\n create: createView\n });\n // Register legacy focus actions\n registers.registerAction({\n type: 'focusNodeAdjacency',\n event: 'focusNodeAdjacency',\n update: 'series:focusNodeAdjacency'\n }, noop);\n registers.registerAction({\n type: 'unfocusNodeAdjacency',\n event: 'unfocusNodeAdjacency',\n update: 'series:unfocusNodeAdjacency'\n }, noop);\n // Register roam action.\n registers.registerAction(actionInfo, function (payload, ecModel, api) {\n ecModel.eachComponent({\n mainType: 'series',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload, undefined, api);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\nvar PointerShape = /** @class */function () {\n function PointerShape() {\n this.angle = 0;\n this.width = 10;\n this.r = 10;\n this.x = 0;\n this.y = 0;\n }\n return PointerShape;\n}();\nvar PointerPath = /** @class */function (_super) {\n __extends(PointerPath, _super);\n function PointerPath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'pointer';\n return _this;\n }\n PointerPath.prototype.getDefaultShape = function () {\n return new PointerShape();\n };\n PointerPath.prototype.buildPath = function (ctx, shape) {\n var mathCos = Math.cos;\n var mathSin = Math.sin;\n var r = shape.r;\n var width = shape.width;\n var angle = shape.angle;\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\n angle = shape.angle - Math.PI / 2;\n ctx.moveTo(x, y);\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\n ctx.lineTo(x, y);\n };\n return PointerPath;\n}(Path);\nexport default PointerPath;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport PointerPath from './PointerPath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { createTextStyle, setLabelValueAnimation, animateLabelValue } from '../../label/labelStyle.js';\nimport ChartView from '../../view/Chart.js';\nimport { parsePercent, round, linearMap } from '../../util/number.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { extend, isFunction, isString, isNumber, each } from 'zrender/lib/core/util.js';\nimport { setCommonECData } from '../../util/innerStore.js';\nimport { normalizeArcAngles } from 'zrender/lib/core/PathProxy.js';\nfunction parsePosition(seriesModel, api) {\n var center = seriesModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], api.getWidth());\n var cy = parsePercent(center[1], api.getHeight());\n var r = parsePercent(seriesModel.get('radius'), size / 2);\n return {\n cx: cx,\n cy: cy,\n r: r\n };\n}\nfunction formatLabel(value, labelFormatter) {\n var label = value == null ? '' : value + '';\n if (labelFormatter) {\n if (isString(labelFormatter)) {\n label = labelFormatter.replace('{value}', label);\n } else if (isFunction(labelFormatter)) {\n label = labelFormatter(value);\n }\n }\n return label;\n}\nvar GaugeView = /** @class */function (_super) {\n __extends(GaugeView, _super);\n function GaugeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GaugeView.type;\n return _this;\n }\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\n var posInfo = parsePosition(seriesModel, api);\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\n this._data = seriesModel.getData();\n };\n GaugeView.prototype.dispose = function () {};\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\n var group = this.group;\n var clockwise = seriesModel.get('clockwise');\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\n var axisLineModel = seriesModel.getModel('axisLine');\n var roundCap = axisLineModel.get('roundCap');\n var MainPath = roundCap ? Sausage : graphic.Sector;\n var showAxis = axisLineModel.get('show');\n var lineStyleModel = axisLineModel.getModel('lineStyle');\n var axisLineWidth = lineStyleModel.get('width');\n var angles = [startAngle, endAngle];\n normalizeArcAngles(angles, !clockwise);\n startAngle = angles[0];\n endAngle = angles[1];\n var angleRangeSpan = endAngle - startAngle;\n var prevEndAngle = startAngle;\n var sectors = [];\n for (var i = 0; showAxis && i < colorList.length; i++) {\n // Clamp\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\n endAngle = startAngle + angleRangeSpan * percent;\n var sector = new MainPath({\n shape: {\n startAngle: prevEndAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: posInfo.r - axisLineWidth,\n r: posInfo.r\n },\n silent: true\n });\n sector.setStyle({\n fill: colorList[i][1]\n });\n sector.setStyle(lineStyleModel.getLineStyle(\n // Because we use sector to simulate arc\n // so the properties for stroking are useless\n ['color', 'width']));\n sectors.push(sector);\n prevEndAngle = endAngle;\n }\n sectors.reverse();\n each(sectors, function (sector) {\n return group.add(sector);\n });\n var getColor = function (percent) {\n // Less than 0\n if (percent <= 0) {\n return colorList[0][1];\n }\n var i;\n for (i = 0; i < colorList.length; i++) {\n if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\n return colorList[i][1];\n }\n }\n // More than 1\n return colorList[i - 1][1];\n };\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\n this._renderAnchor(seriesModel, posInfo);\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n };\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var cx = posInfo.cx;\n var cy = posInfo.cy;\n var r = posInfo.r;\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var splitLineModel = seriesModel.getModel('splitLine');\n var tickModel = seriesModel.getModel('axisTick');\n var labelModel = seriesModel.getModel('axisLabel');\n var splitNumber = seriesModel.get('splitNumber');\n var subSplitNumber = tickModel.get('splitNumber');\n var splitLineLen = parsePercent(splitLineModel.get('length'), r);\n var tickLen = parsePercent(tickModel.get('length'), r);\n var angle = startAngle;\n var step = (endAngle - startAngle) / splitNumber;\n var subStep = step / subSplitNumber;\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\n var splitLineDistance = splitLineModel.get('distance');\n var unitX;\n var unitY;\n for (var i = 0; i <= splitNumber; i++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle);\n // Split line\n if (splitLineModel.get('show')) {\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\n var splitLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - splitLineLen - distance) + cx,\n y2: unitY * (r - splitLineLen - distance) + cy\n },\n style: splitLineStyle,\n silent: true\n });\n if (splitLineStyle.stroke === 'auto') {\n splitLine.setStyle({\n stroke: getColor(i / splitNumber)\n });\n }\n group.add(splitLine);\n }\n // Label\n if (labelModel.get('show')) {\n var distance = labelModel.get('distance') + splitLineDistance;\n var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\n var autoColor = getColor(i / splitNumber);\n var textStyleX = unitX * (r - splitLineLen - distance) + cx;\n var textStyleY = unitY * (r - splitLineLen - distance) + cy;\n var rotateType = labelModel.get('rotate');\n var rotate = 0;\n if (rotateType === 'radial') {\n rotate = -angle + 2 * Math.PI;\n if (rotate > Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (rotateType === 'tangential') {\n rotate = -angle - Math.PI / 2;\n } else if (isNumber(rotateType)) {\n rotate = rotateType * Math.PI / 180;\n }\n if (rotate === 0) {\n group.add(new graphic.Text({\n style: createTextStyle(labelModel, {\n text: label,\n x: textStyleX,\n y: textStyleY,\n verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle',\n align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center'\n }, {\n inheritColor: autoColor\n }),\n silent: true\n }));\n } else {\n group.add(new graphic.Text({\n style: createTextStyle(labelModel, {\n text: label,\n x: textStyleX,\n y: textStyleY,\n verticalAlign: 'middle',\n align: 'center'\n }, {\n inheritColor: autoColor\n }),\n silent: true,\n originX: textStyleX,\n originY: textStyleY,\n rotation: rotate\n }));\n }\n }\n // Axis tick\n if (tickModel.get('show') && i !== splitNumber) {\n var distance = tickModel.get('distance');\n distance = distance ? distance + axisLineWidth : axisLineWidth;\n for (var j = 0; j <= subSplitNumber; j++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle);\n var tickLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - tickLen - distance) + cx,\n y2: unitY * (r - tickLen - distance) + cy\n },\n silent: true,\n style: tickLineStyle\n });\n if (tickLineStyle.stroke === 'auto') {\n tickLine.setStyle({\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\n });\n }\n group.add(tickLine);\n angle += subStep;\n }\n angle -= subStep;\n } else {\n angle += step;\n }\n }\n };\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var oldData = this._data;\n var oldProgressData = this._progressEls;\n var progressList = [];\n var showPointer = seriesModel.get(['pointer', 'show']);\n var progressModel = seriesModel.getModel('progress');\n var showProgress = progressModel.get('show');\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var valueExtent = [minVal, maxVal];\n var angleExtent = [startAngle, endAngle];\n function createPointer(idx, angle) {\n var itemModel = data.getItemModel(idx);\n var pointerModel = itemModel.getModel('pointer');\n var pointerWidth = parsePercent(pointerModel.get('width'), posInfo.r);\n var pointerLength = parsePercent(pointerModel.get('length'), posInfo.r);\n var pointerStr = seriesModel.get(['pointer', 'icon']);\n var pointerOffset = pointerModel.get('offsetCenter');\n var pointerOffsetX = parsePercent(pointerOffset[0], posInfo.r);\n var pointerOffsetY = parsePercent(pointerOffset[1], posInfo.r);\n var pointerKeepAspect = pointerModel.get('keepAspect');\n var pointer;\n // not exist icon type will be set 'rect'\n if (pointerStr) {\n pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\n } else {\n pointer = new PointerPath({\n shape: {\n angle: -Math.PI / 2,\n width: pointerWidth,\n r: pointerLength,\n x: pointerOffsetX,\n y: pointerOffsetY\n }\n });\n }\n pointer.rotation = -(angle + Math.PI / 2);\n pointer.x = posInfo.cx;\n pointer.y = posInfo.cy;\n return pointer;\n }\n function createProgress(idx, endAngle) {\n var roundCap = progressModel.get('roundCap');\n var ProgressPath = roundCap ? Sausage : graphic.Sector;\n var isOverlap = progressModel.get('overlap');\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\n var progress = new ProgressPath({\n shape: {\n startAngle: startAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: r0,\n r: r\n }\n });\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\n return progress;\n }\n if (showProgress || showPointer) {\n data.diff(oldData).add(function (idx) {\n var val = data.get(valueDim, idx);\n if (showPointer) {\n var pointer = createPointer(idx, startAngle);\n // TODO hide pointer on NaN value?\n graphic.initProps(pointer, {\n rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(idx, pointer);\n }\n if (showProgress) {\n var progress = createProgress(idx, startAngle);\n var isClip = progressModel.get('clip');\n graphic.initProps(progress, {\n shape: {\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress);\n // Add data index and series index for indexing the data by element\n // Useful in tooltip\n setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress);\n progressList[idx] = progress;\n }\n }).update(function (newIdx, oldIdx) {\n var val = data.get(valueDim, newIdx);\n if (showPointer) {\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\n var pointer = createPointer(newIdx, previousRotate);\n pointer.rotation = previousRotate;\n graphic.updateProps(pointer, {\n rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(newIdx, pointer);\n }\n if (showProgress) {\n var previousProgress = oldProgressData[oldIdx];\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\n var progress = createProgress(newIdx, previousEndAngle);\n var isClip = progressModel.get('clip');\n graphic.updateProps(progress, {\n shape: {\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress);\n // Add data index and series index for indexing the data by element\n // Useful in tooltip\n setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress);\n progressList[newIdx] = progress;\n }\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n if (showPointer) {\n var pointer = data.getItemGraphicEl(idx);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n if (pointer instanceof ZRImage) {\n var pathStyle = pointer.style;\n pointer.useStyle(extend({\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n pointer.useStyle(symbolStyle);\n pointer.type !== 'pointer' && pointer.setColor(visualColor);\n }\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\n if (pointer.style.fill === 'auto') {\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\n }\n pointer.z2EmphasisLift = 0;\n setStatesStylesFromModel(pointer, itemModel);\n toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled);\n }\n if (showProgress) {\n var progress = progressList[idx];\n progress.useStyle(data.getItemVisual(idx, 'style'));\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\n progress.z2EmphasisLift = 0;\n setStatesStylesFromModel(progress, itemModel);\n toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled);\n }\n });\n this._progressEls = progressList;\n }\n };\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\n var anchorModel = seriesModel.getModel('anchor');\n var showAnchor = anchorModel.get('show');\n if (showAnchor) {\n var anchorSize = anchorModel.get('size');\n var anchorType = anchorModel.get('icon');\n var offsetCenter = anchorModel.get('offsetCenter');\n var anchorKeepAspect = anchorModel.get('keepAspect');\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\n this.group.add(anchor);\n }\n };\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\n var _this = this;\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var contentGroup = new graphic.Group();\n var newTitleEls = [];\n var newDetailEls = [];\n var hasAnimation = seriesModel.isAnimationEnabled();\n var showPointerAbove = seriesModel.get(['pointer', 'showAbove']);\n data.diff(this._data).add(function (idx) {\n newTitleEls[idx] = new graphic.Text({\n silent: true\n });\n newDetailEls[idx] = new graphic.Text({\n silent: true\n });\n }).update(function (idx, oldIdx) {\n newTitleEls[idx] = _this._titleEls[oldIdx];\n newDetailEls[idx] = _this._detailEls[oldIdx];\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var value = data.get(valueDim, idx);\n var itemGroup = new graphic.Group();\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\n var itemTitleModel = itemModel.getModel('title');\n if (itemTitleModel.get('show')) {\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\n var titleX = posInfo.cx + parsePercent(titleOffsetCenter[0], posInfo.r);\n var titleY = posInfo.cy + parsePercent(titleOffsetCenter[1], posInfo.r);\n var labelEl = newTitleEls[idx];\n labelEl.attr({\n z2: showPointerAbove ? 0 : 2,\n style: createTextStyle(itemTitleModel, {\n x: titleX,\n y: titleY,\n text: data.getName(idx),\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: autoColor\n })\n });\n itemGroup.add(labelEl);\n }\n var itemDetailModel = itemModel.getModel('detail');\n if (itemDetailModel.get('show')) {\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\n var detailX = posInfo.cx + parsePercent(detailOffsetCenter[0], posInfo.r);\n var detailY = posInfo.cy + parsePercent(detailOffsetCenter[1], posInfo.r);\n var width = parsePercent(itemDetailModel.get('width'), posInfo.r);\n var height = parsePercent(itemDetailModel.get('height'), posInfo.r);\n var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor;\n var labelEl = newDetailEls[idx];\n var formatter_1 = itemDetailModel.get('formatter');\n labelEl.attr({\n z2: showPointerAbove ? 0 : 2,\n style: createTextStyle(itemDetailModel, {\n x: detailX,\n y: detailY,\n text: formatLabel(value, formatter_1),\n width: isNaN(width) ? null : width,\n height: isNaN(height) ? null : height,\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: detailColor\n })\n });\n setLabelValueAnimation(labelEl, {\n normal: itemDetailModel\n }, value, function (value) {\n return formatLabel(value, formatter_1);\n });\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, {\n getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) {\n return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1);\n }\n });\n itemGroup.add(labelEl);\n }\n contentGroup.add(itemGroup);\n });\n this.group.add(contentGroup);\n this._titleEls = newTitleEls;\n this._detailEls = newDetailEls;\n };\n GaugeView.type = 'gauge';\n return GaugeView;\n}(ChartView);\nexport default GaugeView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\nvar GaugeSeriesModel = /** @class */function (_super) {\n __extends(GaugeSeriesModel, _super);\n function GaugeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GaugeSeriesModel.type;\n _this.visualStyleAccessPath = 'itemStyle';\n return _this;\n }\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, ['value']);\n };\n GaugeSeriesModel.type = 'series.gauge';\n GaugeSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n // 默认全局居中\n center: ['50%', '50%'],\n legendHoverLink: true,\n radius: '75%',\n startAngle: 225,\n endAngle: -45,\n clockwise: true,\n // 最小值\n min: 0,\n // 最大值\n max: 100,\n // 分割段数,默认为10\n splitNumber: 10,\n // 坐标轴线\n axisLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n roundCap: false,\n lineStyle: {\n color: [[1, '#E6EBF8']],\n width: 10\n }\n },\n // 坐标轴线\n progress: {\n // 默认显示,属性show控制显示与否\n show: false,\n overlap: true,\n width: 10,\n roundCap: false,\n clip: true\n },\n // 分隔线\n splitLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n // 属性length控制线长\n length: 10,\n distance: 10,\n // 属性lineStyle(详见lineStyle)控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 3,\n type: 'solid'\n }\n },\n // 坐标轴小标记\n axisTick: {\n // 属性show控制显示与否,默认不显示\n show: true,\n // 每份split细分多少段\n splitNumber: 5,\n // 属性length控制线长\n length: 6,\n distance: 10,\n // 属性lineStyle控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 1,\n type: 'solid'\n }\n },\n axisLabel: {\n show: true,\n distance: 15,\n // formatter: null,\n color: '#464646',\n fontSize: 12,\n rotate: 0\n },\n pointer: {\n icon: null,\n offsetCenter: [0, 0],\n show: true,\n showAbove: true,\n length: '60%',\n width: 6,\n keepAspect: false\n },\n anchor: {\n show: false,\n showAbove: false,\n size: 6,\n icon: 'circle',\n offsetCenter: [0, 0],\n keepAspect: false,\n itemStyle: {\n color: '#fff',\n borderWidth: 0,\n borderColor: '#5470c6'\n }\n },\n title: {\n show: true,\n // x, y,单位px\n offsetCenter: [0, '20%'],\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 16,\n valueAnimation: false\n },\n detail: {\n show: true,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n borderColor: '#ccc',\n width: 100,\n height: null,\n padding: [5, 10],\n // x, y,单位px\n offsetCenter: [0, '40%'],\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 30,\n fontWeight: 'bold',\n lineHeight: 30,\n valueAnimation: false\n }\n };\n return GaugeSeriesModel;\n}(SeriesModel);\nexport default GaugeSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport GaugeView from './GaugeView.js';\nimport GaugeSeriesModel from './GaugeSeries.js';\nexport function install(registers) {\n registers.registerChartView(GaugeView);\n registers.registerSeriesModel(GaugeSeriesModel);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar opacityAccessPath = ['itemStyle', 'opacity'];\n/**\n * Piece of pie including Sector, Label, LabelLine\n */\nvar FunnelPiece = /** @class */function (_super) {\n __extends(FunnelPiece, _super);\n function FunnelPiece(data, idx) {\n var _this = _super.call(this) || this;\n var polygon = _this;\n var labelLine = new graphic.Polyline();\n var text = new graphic.Text();\n polygon.setTextContent(text);\n _this.setTextGuideLine(labelLine);\n _this.updateData(data, idx, true);\n return _this;\n }\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\n var polygon = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var opacity = itemModel.get(opacityAccessPath);\n opacity = opacity == null ? 1 : opacity;\n if (!firstCreate) {\n saveOldStyle(polygon);\n }\n // Update common style\n polygon.useStyle(data.getItemVisual(idx, 'style'));\n polygon.style.lineJoin = 'round';\n if (firstCreate) {\n polygon.setShape({\n points: layout.points\n });\n polygon.style.opacity = 0;\n graphic.initProps(polygon, {\n style: {\n opacity: opacity\n }\n }, seriesModel, idx);\n } else {\n graphic.updateProps(polygon, {\n style: {\n opacity: opacity\n },\n shape: {\n points: layout.points\n }\n }, seriesModel, idx);\n }\n setStatesStylesFromModel(polygon, itemModel);\n this._updateLabel(data, idx);\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n FunnelPiece.prototype._updateLabel = function (data, idx) {\n var polygon = this;\n var labelLine = this.getTextGuideLine();\n var labelText = polygon.getTextContent();\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var labelLayout = layout.label;\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style.fill;\n setLabelStyle(\n // position will not be used in setLabelStyle\n labelText, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: data.getName(idx)\n }, {\n normal: {\n align: labelLayout.textAlign,\n verticalAlign: labelLayout.verticalAlign\n }\n });\n polygon.setTextConfig({\n local: true,\n inside: !!labelLayout.inside,\n insideStroke: visualColor,\n // insideFill: 'auto',\n outsideFill: visualColor\n });\n var linePoints = labelLayout.linePoints;\n labelLine.setShape({\n points: linePoints\n });\n polygon.textGuideLineConfig = {\n anchor: linePoints ? new graphic.Point(linePoints[0][0], linePoints[0][1]) : null\n };\n // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n graphic.updateProps(labelText, {\n style: {\n x: labelLayout.x,\n y: labelLayout.y\n }\n }, seriesModel, idx);\n labelText.attr({\n rotation: labelLayout.rotation,\n originX: labelLayout.x,\n originY: labelLayout.y,\n z2: 10\n });\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\n // Default use item visual color\n stroke: visualColor\n });\n };\n return FunnelPiece;\n}(graphic.Polygon);\nvar FunnelView = /** @class */function (_super) {\n __extends(FunnelView, _super);\n function FunnelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = FunnelView.type;\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n data.diff(oldData).add(function (idx) {\n var funnelPiece = new FunnelPiece(data, idx);\n data.setItemGraphicEl(idx, funnelPiece);\n group.add(funnelPiece);\n }).update(function (newIdx, oldIdx) {\n var piece = oldData.getItemGraphicEl(oldIdx);\n piece.updateData(data, newIdx);\n group.add(piece);\n data.setItemGraphicEl(newIdx, piece);\n }).remove(function (idx) {\n var piece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piece, seriesModel, idx);\n }).execute();\n this._data = data;\n };\n FunnelView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n FunnelView.prototype.dispose = function () {};\n FunnelView.type = 'funnel';\n return FunnelView;\n}(ChartView);\nexport default FunnelView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nvar FunnelSeriesModel = /** @class */function (_super) {\n __extends(FunnelSeriesModel, _super);\n function FunnelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = FunnelSeriesModel.type;\n return _this;\n }\n FunnelSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments);\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n // Extend labelLine emphasis\n this._defaultLabelLine(option);\n };\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine;\n // Not show label line if `label.normal.show = false`\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n };\n // Overwrite\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData();\n var params = _super.prototype.getDataParams.call(this, dataIndex);\n var valueDim = data.mapDimension('value');\n var sum = data.getSum(valueDim);\n // Percent is 0 if sum is 0\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\n params.$vars.push('percent');\n return params;\n };\n FunnelSeriesModel.type = 'series.funnel';\n FunnelSeriesModel.defaultOption = {\n // zlevel: 0, // 一级层叠\n z: 2,\n legendHoverLink: true,\n colorBy: 'data',\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n // 默认取数据最小最大值\n // min: 0,\n // max: 100,\n minSize: '0%',\n maxSize: '100%',\n sort: 'descending',\n orient: 'vertical',\n gap: 0,\n funnelAlign: 'center',\n label: {\n show: true,\n position: 'outer'\n // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n },\n\n labelLine: {\n show: true,\n length: 20,\n lineStyle: {\n // color: 各异,\n width: 1\n }\n },\n itemStyle: {\n // color: 各异,\n borderColor: '#fff',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return FunnelSeriesModel;\n}(SeriesModel);\nexport default FunnelSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as layout from '../../util/layout.js';\nimport { parsePercent, linearMap } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\nfunction getSortedIndices(data, sort) {\n var valueDim = data.mapDimension('value');\n var valueArr = data.mapArray(valueDim, function (val) {\n return val;\n });\n var indices = [];\n var isAscending = sort === 'ascending';\n for (var i = 0, len = data.count(); i < len; i++) {\n indices[i] = i;\n }\n // Add custom sortable function & none sortable opetion by \"options.sort\"\n if (isFunction(sort)) {\n indices.sort(sort);\n } else if (sort !== 'none') {\n indices.sort(function (a, b) {\n return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a];\n });\n }\n return indices;\n}\nfunction labelLayout(data) {\n var seriesModel = data.hostModel;\n var orient = seriesModel.get('orient');\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label');\n var labelPosition = labelModel.get('position');\n var labelLineModel = itemModel.getModel('labelLine');\n var layout = data.getItemLayout(idx);\n var points = layout.points;\n var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\n var textAlign;\n var textX;\n var textY;\n var linePoints;\n if (isLabelInside) {\n if (labelPosition === 'insideLeft') {\n textX = (points[0][0] + points[3][0]) / 2 + 5;\n textY = (points[0][1] + points[3][1]) / 2;\n textAlign = 'left';\n } else if (labelPosition === 'insideRight') {\n textX = (points[1][0] + points[2][0]) / 2 - 5;\n textY = (points[1][1] + points[2][1]) / 2;\n textAlign = 'right';\n } else {\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\n textAlign = 'center';\n }\n linePoints = [[textX, textY], [textX, textY]];\n } else {\n var x1 = void 0;\n var y1 = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var labelLineLen = labelLineModel.get('length');\n if (process.env.NODE_ENV !== 'production') {\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\n labelPosition = 'left';\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\n }\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\n labelPosition = 'bottom';\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\n }\n }\n if (labelPosition === 'left') {\n // Left side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n } else if (labelPosition === 'right') {\n // Right side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n } else if (labelPosition === 'top') {\n // Top side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else if (labelPosition === 'bottom') {\n // Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else if (labelPosition === 'rightTop') {\n // RightTop side\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'top';\n }\n } else if (labelPosition === 'rightBottom') {\n // RightBottom side\n x1 = points[2][0];\n y1 = points[2][1];\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'bottom';\n }\n } else if (labelPosition === 'leftTop') {\n // LeftTop side\n x1 = points[0][0];\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else if (labelPosition === 'leftBottom') {\n // LeftBottom side\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else {\n // Right side or Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n }\n }\n if (orient === 'horizontal') {\n x2 = x1;\n textX = x2;\n } else {\n y2 = y1;\n textY = y2;\n }\n linePoints = [[x1, y1], [x2, y2]];\n }\n layout.label = {\n linePoints: linePoints,\n x: textX,\n y: textY,\n verticalAlign: 'middle',\n textAlign: textAlign,\n inside: isLabelInside\n };\n });\n}\nexport default function funnelLayout(ecModel, api) {\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var sort = seriesModel.get('sort');\n var viewRect = getViewRect(seriesModel, api);\n var orient = seriesModel.get('orient');\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var indices = getSortedIndices(data, sort);\n var x = viewRect.x;\n var y = viewRect.y;\n var sizeExtent = orient === 'horizontal' ? [parsePercent(seriesModel.get('minSize'), viewHeight), parsePercent(seriesModel.get('maxSize'), viewHeight)] : [parsePercent(seriesModel.get('minSize'), viewWidth), parsePercent(seriesModel.get('maxSize'), viewWidth)];\n var dataExtent = data.getDataExtent(valueDim);\n var min = seriesModel.get('min');\n var max = seriesModel.get('max');\n if (min == null) {\n min = Math.min(dataExtent[0], 0);\n }\n if (max == null) {\n max = dataExtent[1];\n }\n var funnelAlign = seriesModel.get('funnelAlign');\n var gap = seriesModel.get('gap');\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\n var getLinePoints = function (idx, offset) {\n // End point index is data.count() and we assign it 0\n if (orient === 'horizontal') {\n var val_1 = data.get(valueDim, idx) || 0;\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\n var y0 = void 0;\n switch (funnelAlign) {\n case 'top':\n y0 = y;\n break;\n case 'center':\n y0 = y + (viewHeight - itemHeight) / 2;\n break;\n case 'bottom':\n y0 = y + (viewHeight - itemHeight);\n break;\n }\n return [[offset, y0], [offset, y0 + itemHeight]];\n }\n var val = data.get(valueDim, idx) || 0;\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\n var x0;\n switch (funnelAlign) {\n case 'left':\n x0 = x;\n break;\n case 'center':\n x0 = x + (viewWidth - itemWidth) / 2;\n break;\n case 'right':\n x0 = x + viewWidth - itemWidth;\n break;\n }\n return [[x0, offset], [x0 + itemWidth, offset]];\n };\n if (sort === 'ascending') {\n // From bottom to top\n itemSize = -itemSize;\n gap = -gap;\n if (orient === 'horizontal') {\n x += viewWidth;\n } else {\n y += viewHeight;\n }\n indices = indices.reverse();\n }\n for (var i = 0; i < indices.length; i++) {\n var idx = indices[i];\n var nextIdx = indices[i + 1];\n var itemModel = data.getItemModel(idx);\n if (orient === 'horizontal') {\n var width = itemModel.get(['itemStyle', 'width']);\n if (width == null) {\n width = itemSize;\n } else {\n width = parsePercent(width, viewWidth);\n if (sort === 'ascending') {\n width = -width;\n }\n }\n var start = getLinePoints(idx, x);\n var end = getLinePoints(nextIdx, x + width);\n x += width + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n } else {\n var height = itemModel.get(['itemStyle', 'height']);\n if (height == null) {\n height = itemSize;\n } else {\n height = parsePercent(height, viewHeight);\n if (sort === 'ascending') {\n height = -height;\n }\n }\n var start = getLinePoints(idx, y);\n var end = getLinePoints(nextIdx, y + height);\n y += height + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n }\n }\n labelLayout(data);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport FunnelView from './FunnelView.js';\nimport FunnelSeriesModel from './FunnelSeries.js';\nimport funnelLayout from './funnelLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n registers.registerChartView(FunnelView);\n registers.registerSeriesModel(FunnelSeriesModel);\n registers.registerLayout(funnelLayout);\n registers.registerProcessor(dataFilter('funnel'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { numericToNumber } from '../../util/number.js';\nimport { eqNaN } from 'zrender/lib/core/util.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar DEFAULT_SMOOTH = 0.3;\nvar ParallelView = /** @class */function (_super) {\n __extends(ParallelView, _super);\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ParallelView.type;\n _this._dataGroup = new graphic.Group();\n _this._initialized = false;\n return _this;\n }\n ParallelView.prototype.init = function () {\n this.group.add(this._dataGroup);\n };\n /**\n * @override\n */\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var dataGroup = this._dataGroup;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n data.diff(oldData).add(add).update(update).remove(remove).execute();\n function add(newDataIndex) {\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n function update(newDataIndex, oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\n data.setItemGraphicEl(newDataIndex, line);\n graphic.updateProps(line, {\n shape: {\n points: points\n }\n }, seriesModel, newDataIndex);\n saveOldStyle(line);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n function remove(oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n dataGroup.remove(line);\n }\n // First create\n if (!this._initialized) {\n this._initialized = true;\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\n // Callback will be invoked immediately if there is no animation\n setTimeout(function () {\n dataGroup.removeClipPath();\n });\n });\n dataGroup.setClipPath(clipPath);\n }\n this._data = data;\n };\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._initialized = true;\n this._data = null;\n this._dataGroup.removeAll();\n };\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n var progressiveEls = this._progressiveEls = [];\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\n line.incremental = true;\n updateElCommon(line, data, dataIndex, seriesScope);\n progressiveEls.push(line);\n }\n };\n ParallelView.prototype.remove = function () {\n this._dataGroup && this._dataGroup.removeAll();\n this._data = null;\n };\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ChartView);\nfunction createGridClipShape(coordSys, seriesModel, cb) {\n var parallelModel = coordSys.model;\n var rect = coordSys.getRect();\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\n rectEl.setShape(dim, 0);\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width,\n height: rect.height\n }\n }, seriesModel, cb);\n return rectEl;\n}\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\n var points = [];\n for (var i = 0; i < dimensions.length; i++) {\n var dimName = dimensions[i];\n var value = data.get(data.mapDimension(dimName), dataIndex);\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\n points.push(coordSys.dataToPoint(value, dimName));\n }\n }\n return points;\n}\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\n var line = new graphic.Polyline({\n shape: {\n points: points\n },\n // silent: true,\n z2: 10\n });\n dataGroup.add(line);\n data.setItemGraphicEl(dataIndex, line);\n return line;\n}\nfunction makeSeriesScope(seriesModel) {\n var smooth = seriesModel.get('smooth', true);\n smooth === true && (smooth = DEFAULT_SMOOTH);\n smooth = numericToNumber(smooth);\n eqNaN(smooth) && (smooth = 0);\n return {\n smooth: smooth\n };\n}\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.fill = null;\n el.setShape('smooth', seriesScope.smooth);\n var itemModel = data.getItemModel(dataIndex);\n var emphasisModel = itemModel.getModel('emphasis');\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n}\n// function simpleDiff(oldData, newData, dimensions) {\n// let oldLen;\n// if (!oldData\n// || !oldData.__plProgressive\n// || (oldLen = oldData.count()) !== newData.count()\n// ) {\n// return true;\n// }\n// let dimLen = dimensions.length;\n// for (let i = 0; i < oldLen; i++) {\n// for (let j = 0; j < dimLen; j++) {\n// if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {\n// return true;\n// }\n// }\n// }\n// return false;\n// }\n// FIXME put in common util?\nfunction isEmptyValue(val, axisType) {\n return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value'\n}\n\nexport default ParallelView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { each, bind } from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nvar ParallelSeriesModel = /** @class */function (_super) {\n __extends(ParallelSeriesModel, _super);\n function ParallelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ParallelSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\n });\n };\n /**\n * User can get data raw indices on 'axisAreaSelected' event received.\n *\n * @return Raw indices\n */\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\n var coordSys = this.coordinateSystem;\n var data = this.getData();\n var indices = [];\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\n if (activeState === theActiveState) {\n indices.push(data.getRawIndex(dataIndex));\n }\n });\n return indices;\n };\n ParallelSeriesModel.type = 'series.parallel';\n ParallelSeriesModel.dependencies = ['parallel'];\n ParallelSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'parallel',\n parallelIndex: 0,\n label: {\n show: false\n },\n inactiveOpacity: 0.05,\n activeOpacity: 1,\n lineStyle: {\n width: 1,\n opacity: 0.45,\n type: 'solid'\n },\n emphasis: {\n label: {\n show: false\n }\n },\n progressive: 500,\n smooth: false,\n animationEasing: 'linear'\n };\n return ParallelSeriesModel;\n}(SeriesModel);\nfunction makeDefaultEncode(seriesModel) {\n // The mapping of parallelAxis dimension to data dimension can\n // be specified in parallelAxis.option.dim. For example, if\n // parallelAxis.option.dim is 'dim3', it mapping to the third\n // dimension of data. But `data.encode` has higher priority.\n // Moreover, parallelModel.dimension should not be regarded as data\n // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n if (!parallelModel) {\n return;\n }\n var encodeDefine = {};\n each(parallelModel.dimensions, function (axisDim) {\n var dataDimIndex = convertDimNameToNumber(axisDim);\n encodeDefine[axisDim] = dataDimIndex;\n });\n return encodeDefine;\n}\nfunction convertDimNameToNumber(dimName) {\n return +dimName.replace('dim', '');\n}\nexport default ParallelSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar opacityAccessPath = ['lineStyle', 'opacity'];\nvar parallelVisual = {\n seriesType: 'parallel',\n reset: function (seriesModel, ecModel) {\n var coordSys = seriesModel.coordinateSystem;\n var opacityMap = {\n normal: seriesModel.get(['lineStyle', 'opacity']),\n active: seriesModel.get('activeOpacity'),\n inactive: seriesModel.get('inactiveOpacity')\n };\n return {\n progress: function (params, data) {\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\n var opacity = opacityMap[activeState];\n if (activeState === 'normal' && data.hasItemOption) {\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath, true);\n itemOpacity != null && (opacity = itemOpacity);\n }\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n existsStyle.opacity = opacity;\n }, params.start, params.end);\n }\n };\n }\n};\nexport default parallelVisual;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nexport default function parallelPreprocessor(option) {\n createParallelIfNeeded(option);\n mergeAxisOptionFromParallel(option);\n}\n/**\n * Create a parallel coordinate if not exists.\n * @inner\n */\nfunction createParallelIfNeeded(option) {\n if (option.parallel) {\n return;\n }\n var hasParallelSeries = false;\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'parallel') {\n hasParallelSeries = true;\n }\n });\n if (hasParallelSeries) {\n option.parallel = [{}];\n }\n}\n/**\n * Merge aixs definition from parallel option (if exists) to axis option.\n * @inner\n */\nfunction mergeAxisOptionFromParallel(option) {\n var axes = modelUtil.normalizeToArray(option.parallelAxis);\n zrUtil.each(axes, function (axisOption) {\n if (!zrUtil.isObject(axisOption)) {\n return;\n }\n var parallelIndex = axisOption.parallelIndex || 0;\n var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];\n if (parallelOption && parallelOption.parallelAxisDefault) {\n zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { each, bind, extend } from 'zrender/lib/core/util.js';\nimport { createOrUpdate, clear } from '../../util/throttle.js';\nvar CLICK_THRESHOLD = 5; // > 4\nvar ParallelView = /** @class */function (_super) {\n __extends(ParallelView, _super);\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ParallelView.type;\n return _this;\n }\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n if (!this._handlers) {\n this._handlers = {};\n each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\n }, this);\n }\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n };\n ParallelView.prototype.dispose = function (ecModel, api) {\n clear(this, '_throttledDispatchExpand');\n each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n };\n /**\n * @internal\n * @param {Object} [opt] If null, cancel the last action triggering for debounce.\n */\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\n this._dispatchExpand(opt);\n };\n /**\n * @internal\n */\n ParallelView.prototype._dispatchExpand = function (opt) {\n opt && this._api.dispatchAction(extend({\n type: 'parallelAxisExpand'\n }, opt));\n };\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ComponentView);\nvar handlers = {\n mousedown: function (e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function (e) {\n var mouseDownPoint = this._mouseDownPoint;\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n this._mouseDownPoint = null;\n },\n mousemove: function (e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancel the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : {\n duration: 0 // Disable animation.\n }\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\nexport default ParallelView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nvar ParallelModel = /** @class */function (_super) {\n __extends(ParallelModel, _super);\n function ParallelModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ParallelModel.type;\n return _this;\n }\n ParallelModel.prototype.init = function () {\n _super.prototype.init.apply(this, arguments);\n this.mergeOption({});\n };\n ParallelModel.prototype.mergeOption = function (newOption) {\n var thisOption = this.option;\n newOption && zrUtil.merge(thisOption, newOption, true);\n this._initDimensions();\n };\n /**\n * Whether series or axis is in this coordinate system.\n */\n ParallelModel.prototype.contains = function (model, ecModel) {\n var parallelIndex = model.get('parallelIndex');\n return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this;\n };\n ParallelModel.prototype.setAxisExpand = function (opt) {\n zrUtil.each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) {\n if (opt.hasOwnProperty(name)) {\n // @ts-ignore FIXME: why \"never\" inferred in this.option[name]?\n this.option[name] = opt[name];\n }\n }, this);\n };\n ParallelModel.prototype._initDimensions = function () {\n var dimensions = this.dimensions = [];\n var parallelAxisIndex = this.parallelAxisIndex = [];\n var axisModels = zrUtil.filter(this.ecModel.queryComponents({\n mainType: 'parallelAxis'\n }), function (axisModel) {\n // Can not use this.contains here, because\n // initialization has not been completed yet.\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\n }, this);\n zrUtil.each(axisModels, function (axisModel) {\n dimensions.push('dim' + axisModel.get('dim'));\n parallelAxisIndex.push(axisModel.componentIndex);\n });\n };\n ParallelModel.type = 'parallel';\n ParallelModel.dependencies = ['parallelAxis'];\n ParallelModel.layoutMode = 'box';\n ParallelModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n layout: 'horizontal',\n // FIXME\n // naming?\n axisExpandable: false,\n axisExpandCenter: null,\n axisExpandCount: 0,\n axisExpandWidth: 50,\n axisExpandRate: 17,\n axisExpandDebounce: 50,\n // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\n // Do not doc to user until necessary.\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\n axisExpandTriggerOn: 'click',\n parallelAxisDefault: null\n };\n return ParallelModel;\n}(ComponentModel);\nexport default ParallelModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar ParallelAxis = /** @class */function (_super) {\n __extends(ParallelAxis, _super);\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n _this.type = axisType || 'value';\n _this.axisIndex = axisIndex;\n return _this;\n }\n ParallelAxis.prototype.isHorizontal = function () {\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\n };\n return ParallelAxis;\n}(Axis);\nexport default ParallelAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Calculate slider move result.\n * Usage:\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\n *\n * @param delta Move length.\n * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].\n * handleEnds will be modified in this method.\n * @param extent handleEnds is restricted by extent.\n * extent[0] should less or equals than extent[1].\n * @param handleIndex Can be 'all', means that both move the two handleEnds.\n * @param minSpan The range of dataZoom can not be smaller than that.\n * If not set, handle0 and cross handle1. If set as a non-negative\n * number (including `0`), handles will push each other when reaching\n * the minSpan.\n * @param maxSpan The range of dataZoom can not be larger than that.\n * @return The input handleEnds.\n */\nexport default function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\n delta = delta || 0;\n var extentSpan = extent[1] - extent[0];\n // Notice maxSpan and minSpan can be null/undefined.\n if (minSpan != null) {\n minSpan = restrict(minSpan, [0, extentSpan]);\n }\n if (maxSpan != null) {\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\n }\n if (handleIndex === 'all') {\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\n handleSpan = restrict(handleSpan, [0, extentSpan]);\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\n handleIndex = 0;\n }\n handleEnds[0] = restrict(handleEnds[0], extent);\n handleEnds[1] = restrict(handleEnds[1], extent);\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\n handleEnds[handleIndex] += delta;\n // Restrict in extent.\n var extentMinSpan = minSpan || 0;\n var realExtent = extent.slice();\n originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\n // Expand span.\n var currDistSign;\n currDistSign = getSpanSign(handleEnds, handleIndex);\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\n // If minSpan exists, 'cross' is forbidden.\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\n }\n // Shrink span.\n currDistSign = getSpanSign(handleEnds, handleIndex);\n if (maxSpan != null && currDistSign.span > maxSpan) {\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\n }\n return handleEnds;\n}\nfunction getSpanSign(handleEnds, handleIndex) {\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\n // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\n // is at left of handleEnds[1] for non-cross case.\n return {\n span: Math.abs(dist),\n sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1\n };\n}\nfunction restrict(value, extend) {\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Parallel Coordinates\n * \n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport ParallelAxis from './ParallelAxis.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../../component/helper/sliderMove.js';\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar round = numberUtil.round;\nvar PI = Math.PI;\nvar Parallel = /** @class */function () {\n function Parallel(parallelModel, ecModel, api) {\n this.type = 'parallel';\n /**\n * key: dimension\n */\n this._axesMap = zrUtil.createHashMap();\n /**\n * key: dimension\n * value: {position: [], rotation, }\n */\n this._axesLayout = {};\n this.dimensions = parallelModel.dimensions;\n this._model = parallelModel;\n this._init(parallelModel, ecModel, api);\n }\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\n var dimensions = parallelModel.dimensions;\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\n each(dimensions, function (dim, idx) {\n var axisIndex = parallelAxisIndex[idx];\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n // Injection\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = axisModel.coordinateSystem = this;\n }, this);\n };\n /**\n * Update axis scale after data processed\n */\n Parallel.prototype.update = function (ecModel, api) {\n this._updateAxesFromSeries(this._model, ecModel);\n };\n Parallel.prototype.containPoint = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n var axisBase = layoutInfo.axisBase;\n var layoutBase = layoutInfo.layoutBase;\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var pAxis = point[1 - pixelDimIndex];\n var pLayout = point[pixelDimIndex];\n return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;\n };\n Parallel.prototype.getModel = function () {\n return this._model;\n };\n /**\n * Update properties from series\n */\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\n ecModel.eachSeries(function (seriesModel) {\n if (!parallelModel.contains(seriesModel, ecModel)) {\n return;\n }\n var data = seriesModel.getData();\n each(this.dimensions, function (dim) {\n var axis = this._axesMap.get(dim);\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\n axisHelper.niceScaleExtent(axis.scale, axis.model);\n }, this);\n }, this);\n };\n /**\n * Resize the parallel coordinate system.\n */\n Parallel.prototype.resize = function (parallelModel, api) {\n this._rect = layoutUtil.getLayoutRect(parallelModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n this._layoutAxes();\n };\n Parallel.prototype.getRect = function () {\n return this._rect;\n };\n Parallel.prototype._makeLayoutInfo = function () {\n var parallelModel = this._model;\n var rect = this._rect;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var layout = parallelModel.get('layout');\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\n var layoutLength = rect[wh[pixelDimIndex]];\n var layoutExtent = [0, layoutLength];\n var axisCount = this.dimensions.length;\n var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent);\n var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\n var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0;\n // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength],\n // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow),\n // where collapsed axes should be overlapped.\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\n var winSize;\n if (!axisExpandWindow) {\n winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor(axisCount / 2);\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n } else {\n winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n }\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);\n // Avoid axisCollapseWidth is too small.\n axisCollapseWidth < 3 && (axisCollapseWidth = 0);\n // Find the first and last indices > ewin[0] and < ewin[1].\n var winInnerIndices = [mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1];\n // Pos in ec coordinates.\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\n return {\n layout: layout,\n pixelDimIndex: pixelDimIndex,\n layoutBase: rect[xy[pixelDimIndex]],\n layoutLength: layoutLength,\n axisBase: rect[xy[1 - pixelDimIndex]],\n axisLength: rect[wh[1 - pixelDimIndex]],\n axisExpandable: axisExpandable,\n axisExpandWidth: axisExpandWidth,\n axisCollapseWidth: axisCollapseWidth,\n axisExpandWindow: axisExpandWindow,\n axisCount: axisCount,\n winInnerIndices: winInnerIndices,\n axisExpandWindow0Pos: axisExpandWindow0Pos\n };\n };\n Parallel.prototype._layoutAxes = function () {\n var rect = this._rect;\n var axes = this._axesMap;\n var dimensions = this.dimensions;\n var layoutInfo = this._makeLayoutInfo();\n var layout = layoutInfo.layout;\n axes.each(function (axis) {\n var axisExtent = [0, layoutInfo.axisLength];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\n });\n each(dimensions, function (dim, idx) {\n var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\n var positionTable = {\n horizontal: {\n x: posInfo.position,\n y: layoutInfo.axisLength\n },\n vertical: {\n x: 0,\n y: posInfo.position\n }\n };\n var rotationTable = {\n horizontal: PI / 2,\n vertical: 0\n };\n var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y];\n var rotation = rotationTable[layout];\n var transform = matrix.create();\n matrix.rotate(transform, transform, rotation);\n matrix.translate(transform, transform, position);\n // TODO\n // tick layout info\n // TODO\n // update dimensions info based on axis order.\n this._axesLayout[dim] = {\n position: position,\n rotation: rotation,\n transform: transform,\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\n axisLabelShow: posInfo.axisLabelShow,\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\n tickDirection: 1,\n labelDirection: 1\n };\n }, this);\n };\n /**\n * Get axis by dim.\n */\n Parallel.prototype.getAxis = function (dim) {\n return this._axesMap.get(dim);\n };\n /**\n * Convert a dim value of a single item of series data to Point.\n */\n Parallel.prototype.dataToPoint = function (value, dim) {\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\n };\n /**\n * Travel data for one time, get activeState of each data item.\n * @param start the start dataIndex that travel from.\n * @param end the next dataIndex of the last dataIndex will be travel.\n */\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\n start == null && (start = 0);\n end == null && (end = data.count());\n var axesMap = this._axesMap;\n var dimensions = this.dimensions;\n var dataDimensions = [];\n var axisModels = [];\n zrUtil.each(dimensions, function (axisDim) {\n dataDimensions.push(data.mapDimension(axisDim));\n axisModels.push(axesMap.get(axisDim).model);\n });\n var hasActiveSet = this.hasAxisBrushed();\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\n var activeState = void 0;\n if (!hasActiveSet) {\n activeState = 'normal';\n } else {\n activeState = 'active';\n var values = data.getValues(dataDimensions, dataIndex);\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n var state = axisModels[j].getActiveState(values[j]);\n if (state === 'inactive') {\n activeState = 'inactive';\n break;\n }\n }\n }\n callback(activeState, dataIndex);\n }\n };\n /**\n * Whether has any activeSet.\n */\n Parallel.prototype.hasAxisBrushed = function () {\n var dimensions = this.dimensions;\n var axesMap = this._axesMap;\n var hasActiveSet = false;\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\n hasActiveSet = true;\n }\n }\n return hasActiveSet;\n };\n /**\n * Convert coords of each axis to Point.\n * Return point. For example: [10, 20]\n */\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\n var axisLayout = this._axesLayout[dim];\n return graphic.applyTransform([coord, 0], axisLayout.transform);\n };\n /**\n * Get axis layout.\n */\n Parallel.prototype.getAxisLayout = function (dim) {\n return zrUtil.clone(this._axesLayout[dim]);\n };\n /**\n * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.\n */\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];\n // Out of the area of coordinate system.\n if (!this.containPoint(point)) {\n return {\n behavior: 'none',\n axisExpandWindow: axisExpandWindow\n };\n }\n // Convert the point from global to expand coordinates.\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;\n // For dragging operation convenience, the window should not be\n // slided when mouse is the center area of the window.\n var delta;\n var behavior = 'slide';\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n var triggerArea = this._model.get('axisExpandSlideTriggerArea');\n // But consider touch device, jump is necessary.\n var useJump = triggerArea[0] != null;\n if (axisCollapseWidth) {\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\n behavior = 'jump';\n delta = pointCoord - winSize * triggerArea[2];\n } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\n behavior = 'jump';\n delta = pointCoord - winSize * (1 - triggerArea[2]);\n } else {\n (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);\n }\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\n delta ? sliderMove(delta, axisExpandWindow, extent, 'all')\n // Avoid nonsense triger on mousemove.\n : behavior = 'none';\n }\n // When screen is too narrow, make it visible and slidable, although it is hard to interact.\n else {\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\n var pos = extent[1] * pointCoord / winSize2;\n axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];\n axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\n }\n return {\n axisExpandWindow: axisExpandWindow,\n behavior: behavior\n };\n };\n return Parallel;\n}();\nfunction restrict(len, extent) {\n return mathMin(mathMax(len, extent[0]), extent[1]);\n}\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\n return {\n position: step * axisIndex,\n axisNameAvailableWidth: step,\n axisLabelShow: true\n };\n}\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\n var layoutLength = layoutInfo.layoutLength;\n var axisExpandWidth = layoutInfo.axisExpandWidth;\n var axisCount = layoutInfo.axisCount;\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n var winInnerIndices = layoutInfo.winInnerIndices;\n var position;\n var axisNameAvailableWidth = axisCollapseWidth;\n var axisLabelShow = false;\n var nameTruncateMaxWidth;\n if (axisIndex < winInnerIndices[0]) {\n position = axisIndex * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n } else if (axisIndex <= winInnerIndices[1]) {\n position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\n axisNameAvailableWidth = axisExpandWidth;\n axisLabelShow = true;\n } else {\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n }\n return {\n position: position,\n axisNameAvailableWidth: axisNameAvailableWidth,\n axisLabelShow: axisLabelShow,\n nameTruncateMaxWidth: nameTruncateMaxWidth\n };\n}\nexport default Parallel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Parallel coordinate system creater.\n */\nimport Parallel from './Parallel.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nfunction createParallelCoordSys(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n });\n // Inject the coordinateSystems into seriesModel\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}\nvar parallelCoordSysCreator = {\n create: createParallelCoordSys\n};\nexport default parallelCoordSysCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport * as numberUtil from '../../util/number.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nvar ParallelAxisModel = /** @class */function (_super) {\n __extends(ParallelAxisModel, _super);\n function ParallelAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ParallelAxisModel.type;\n /**\n * @readOnly\n */\n _this.activeIntervals = [];\n return _this;\n }\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\n return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity']\n // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n // So do not transfer decal directly.\n ])(this.getModel('areaSelectStyle'));\n };\n /**\n * The code of this feature is put on AxisModel but not ParallelAxis,\n * because axisModel can be alive after echarts updating but instance of\n * ParallelAxis having been disposed. this._activeInterval should be kept\n * when action dispatched (i.e. legend click).\n *\n * @param intervals `interval.length === 0` means set all active.\n */\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\n var activeIntervals = this.activeIntervals = zrUtil.clone(intervals);\n // Normalize\n if (activeIntervals) {\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\n numberUtil.asc(activeIntervals[i]);\n }\n }\n };\n /**\n * @param value When only attempting detect whether 'no activeIntervals set',\n * `value` is not needed to be input.\n */\n ParallelAxisModel.prototype.getActiveState = function (value) {\n var activeIntervals = this.activeIntervals;\n if (!activeIntervals.length) {\n return 'normal';\n }\n if (value == null || isNaN(+value)) {\n return 'inactive';\n }\n // Simple optimization\n if (activeIntervals.length === 1) {\n var interval = activeIntervals[0];\n if (interval[0] <= value && value <= interval[1]) {\n return 'active';\n }\n } else {\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\n return 'active';\n }\n }\n }\n return 'inactive';\n };\n return ParallelAxisModel;\n}(ComponentModel);\nzrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);\nexport default ParallelAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { curry, each, map, bind, merge, clone, defaults, assert } from 'zrender/lib/core/util.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nvar BRUSH_PANEL_GLOBAL = true;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathPow = Math.pow;\nvar COVER_Z = 10000;\nvar UNSELECT_THRESHOLD = 6;\nvar MIN_RESIZE_LINE_WIDTH = 6;\nvar MUTEX_RESOURCE_KEY = 'globalPan';\nvar DIRECTION_MAP = {\n w: [0, 0],\n e: [0, 1],\n n: [1, 0],\n s: [1, 1]\n};\nvar CURSOR_MAP = {\n w: 'ew',\n e: 'ew',\n n: 'ns',\n s: 'ns',\n ne: 'nesw',\n sw: 'nesw',\n nw: 'nwse',\n se: 'nwse'\n};\nvar DEFAULT_BRUSH_OPT = {\n brushStyle: {\n lineWidth: 2,\n stroke: 'rgba(210,219,238,0.3)',\n fill: '#D2DBEE'\n },\n transformable: true,\n brushMode: 'single',\n removeOnClick: false\n};\nvar baseUID = 0;\n/**\n * params:\n * areas: Array., coord relates to container group,\n * If no container specified, to global.\n * opt {\n * isEnd: boolean,\n * removeOnClick: boolean\n * }\n */\nvar BrushController = /** @class */function (_super) {\n __extends(BrushController, _super);\n function BrushController(zr) {\n var _this = _super.call(this) || this;\n /**\n * @internal\n */\n _this._track = [];\n /**\n * @internal\n */\n _this._covers = [];\n _this._handlers = {};\n if (process.env.NODE_ENV !== 'production') {\n assert(zr);\n }\n _this._zr = zr;\n _this.group = new graphic.Group();\n _this._uid = 'brushController_' + baseUID++;\n each(pointerHandlers, function (handler, eventName) {\n this._handlers[eventName] = bind(handler, this);\n }, _this);\n return _this;\n }\n /**\n * If set to `false`, select disabled.\n */\n BrushController.prototype.enableBrush = function (brushOption) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n this._brushType && this._doDisableBrush();\n brushOption.brushType && this._doEnableBrush(brushOption);\n return this;\n };\n BrushController.prototype._doEnableBrush = function (brushOption) {\n var zr = this._zr;\n // Consider roam, which takes globalPan too.\n if (!this._enableGlobalPan) {\n interactionMutex.take(zr, MUTEX_RESOURCE_KEY, this._uid);\n }\n each(this._handlers, function (handler, eventName) {\n zr.on(eventName, handler);\n });\n this._brushType = brushOption.brushType;\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\n };\n BrushController.prototype._doDisableBrush = function () {\n var zr = this._zr;\n interactionMutex.release(zr, MUTEX_RESOURCE_KEY, this._uid);\n each(this._handlers, function (handler, eventName) {\n zr.off(eventName, handler);\n });\n this._brushType = this._brushOption = null;\n };\n /**\n * @param panelOpts If not pass, it is global brush.\n */\n BrushController.prototype.setPanels = function (panelOpts) {\n if (panelOpts && panelOpts.length) {\n var panels_1 = this._panels = {};\n each(panelOpts, function (panelOpts) {\n panels_1[panelOpts.panelId] = clone(panelOpts);\n });\n } else {\n this._panels = null;\n }\n return this;\n };\n BrushController.prototype.mount = function (opt) {\n opt = opt || {};\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = true; // should be at first.\n }\n\n this._enableGlobalPan = opt.enableGlobalPan;\n var thisGroup = this.group;\n this._zr.add(thisGroup);\n thisGroup.attr({\n x: opt.x || 0,\n y: opt.y || 0,\n rotation: opt.rotation || 0,\n scaleX: opt.scaleX || 1,\n scaleY: opt.scaleY || 1\n });\n this._transform = thisGroup.getLocalTransform();\n return this;\n };\n // eachCover(cb, context): void {\n // each(this._covers, cb, context);\n // }\n /**\n * Update covers.\n * @param coverConfigList\n * If coverConfigList is null/undefined, all covers removed.\n */\n BrushController.prototype.updateCovers = function (coverConfigList) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n coverConfigList = map(coverConfigList, function (coverConfig) {\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\n });\n var tmpIdPrefix = '\\0-brush-index-';\n var oldCovers = this._covers;\n var newCovers = this._covers = [];\n var controller = this;\n var creatingCover = this._creatingCover;\n new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();\n return this;\n function getKey(brushOption, index) {\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType;\n }\n function oldGetKey(cover, index) {\n return getKey(cover.__brushOption, index);\n }\n function addOrUpdate(newIndex, oldIndex) {\n var newBrushInternal = coverConfigList[newIndex];\n // Consider setOption in event listener of brushSelect,\n // where updating cover when creating should be forbidden.\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\n newCovers[newIndex] = oldCovers[oldIndex];\n } else {\n var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal));\n updateCoverAfterCreation(controller, cover);\n }\n }\n function remove(oldIndex) {\n if (oldCovers[oldIndex] !== creatingCover) {\n controller.group.remove(oldCovers[oldIndex]);\n }\n }\n };\n BrushController.prototype.unmount = function () {\n if (process.env.NODE_ENV !== 'production') {\n if (!this._mounted) {\n return;\n }\n }\n this.enableBrush(false);\n // container may 'removeAll' outside.\n clearCovers(this);\n this._zr.remove(this.group);\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = false; // should be at last.\n }\n\n return this;\n };\n BrushController.prototype.dispose = function () {\n this.unmount();\n this.off();\n };\n return BrushController;\n}(Eventful);\nfunction createCover(controller, brushOption) {\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\n cover.__brushOption = brushOption;\n updateZ(cover, brushOption);\n controller.group.add(cover);\n return cover;\n}\nfunction endCreating(controller, creatingCover) {\n var coverRenderer = getCoverRenderer(creatingCover);\n if (coverRenderer.endCreating) {\n coverRenderer.endCreating(controller, creatingCover);\n updateZ(creatingCover, creatingCover.__brushOption);\n }\n return creatingCover;\n}\nfunction updateCoverShape(controller, cover) {\n var brushOption = cover.__brushOption;\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\n}\nfunction updateZ(cover, brushOption) {\n var z = brushOption.z;\n z == null && (z = COVER_Z);\n cover.traverse(function (el) {\n el.z = z;\n el.z2 = z; // Consider in given container.\n });\n}\n\nfunction updateCoverAfterCreation(controller, cover) {\n getCoverRenderer(cover).updateCommon(controller, cover);\n updateCoverShape(controller, cover);\n}\nfunction getCoverRenderer(cover) {\n return coverRenderers[cover.__brushOption.brushType];\n}\n// return target panel or `true` (means global panel)\nfunction getPanelByPoint(controller, e, localCursorPoint) {\n var panels = controller._panels;\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panel;\n var transform = controller._transform;\n each(panels, function (pn) {\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\n });\n return panel;\n}\n// Return a panel or true\nfunction getPanelByCover(controller, cover) {\n var panels = controller._panels;\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panelId = cover.__brushOption.panelId;\n // User may give cover without coord sys info,\n // which is then treated as global panel.\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\n}\nfunction clearCovers(controller) {\n var covers = controller._covers;\n var originalLength = covers.length;\n each(covers, function (cover) {\n controller.group.remove(cover);\n }, controller);\n covers.length = 0;\n return !!originalLength;\n}\nfunction trigger(controller, opt) {\n var areas = map(controller._covers, function (cover) {\n var brushOption = cover.__brushOption;\n var range = clone(brushOption.range);\n return {\n brushType: brushOption.brushType,\n panelId: brushOption.panelId,\n range: range\n };\n });\n controller.trigger('brush', {\n areas: areas,\n isEnd: !!opt.isEnd,\n removeOnClick: !!opt.removeOnClick\n });\n}\nfunction shouldShowCover(controller) {\n var track = controller._track;\n if (!track.length) {\n return false;\n }\n var p2 = track[track.length - 1];\n var p1 = track[0];\n var dx = p2[0] - p1[0];\n var dy = p2[1] - p1[1];\n var dist = mathPow(dx * dx + dy * dy, 0.5);\n return dist > UNSELECT_THRESHOLD;\n}\nfunction getTrackEnds(track) {\n var tail = track.length - 1;\n tail < 0 && (tail = 0);\n return [track[0], track[tail]];\n}\n;\nfunction createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\n var cover = new graphic.Group();\n cover.add(new graphic.Rect({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true,\n draggable: true,\n cursor: 'move',\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n each(edgeNameSequences, function (nameSequence) {\n cover.add(new graphic.Rect({\n name: nameSequence.join(''),\n style: {\n opacity: 0\n },\n draggable: true,\n silent: true,\n invisible: true,\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n });\n return cover;\n}\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\n var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);\n var x = localRange[0][0];\n var y = localRange[1][0];\n var xa = x - lineWidth / 2;\n var ya = y - lineWidth / 2;\n var x2 = localRange[0][1];\n var y2 = localRange[1][1];\n var x2a = x2 - handleSize + lineWidth / 2;\n var y2a = y2 - handleSize + lineWidth / 2;\n var width = x2 - x;\n var height = y2 - y;\n var widtha = width + lineWidth;\n var heighta = height + lineWidth;\n updateRectShape(controller, cover, 'main', x, y, width, height);\n if (brushOption.transformable) {\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\n }\n}\nfunction updateCommon(controller, cover) {\n var brushOption = cover.__brushOption;\n var transformable = brushOption.transformable;\n var mainEl = cover.childAt(0);\n mainEl.useStyle(makeStyle(brushOption));\n mainEl.attr({\n silent: !transformable,\n cursor: transformable ? 'move' : 'default'\n });\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\n var el = cover.childOfName(nameSequence.join(''));\n var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);\n el && el.attr({\n silent: !transformable,\n invisible: !transformable,\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\n });\n });\n}\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\n var el = cover.childOfName(name);\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\n}\nfunction makeStyle(brushOption) {\n return defaults({\n strokeNoScale: true\n }, brushOption.brushStyle);\n}\nfunction formatRectRange(x, y, x2, y2) {\n var min = [mathMin(x, x2), mathMin(y, y2)];\n var max = [mathMax(x, x2), mathMax(y, y2)];\n return [[min[0], max[0]], [min[1], max[1]] // y range\n ];\n}\n\nfunction getTransform(controller) {\n return graphic.getTransform(controller.group);\n}\nfunction getGlobalDirection1(controller, localDirName) {\n var map = {\n w: 'left',\n e: 'right',\n n: 'top',\n s: 'bottom'\n };\n var inverseMap = {\n left: 'w',\n right: 'e',\n top: 'n',\n bottom: 's'\n };\n var dir = graphic.transformDirection(map[localDirName], getTransform(controller));\n return inverseMap[dir];\n}\nfunction getGlobalDirection2(controller, localDirNameSeq) {\n var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\n return globalDir.join('');\n}\nfunction driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\n var brushOption = cover.__brushOption;\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\n var localDelta = toLocalDelta(controller, dx, dy);\n each(dirNameSequence, function (dirName) {\n var ind = DIRECTION_MAP[dirName];\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\n });\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\nfunction driftPolygon(controller, cover, dx, dy) {\n var range = cover.__brushOption.range;\n var localDelta = toLocalDelta(controller, dx, dy);\n each(range, function (point) {\n point[0] += localDelta[0];\n point[1] += localDelta[1];\n });\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\nfunction toLocalDelta(controller, dx, dy) {\n var thisGroup = controller.group;\n var localD = thisGroup.transformCoordToLocal(dx, dy);\n var localZero = thisGroup.transformCoordToLocal(0, 0);\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\n}\nfunction clipByPanel(controller, cover, data) {\n var panel = getPanelByCover(controller, cover);\n return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data);\n}\nfunction pointsToRect(points) {\n var xmin = mathMin(points[0][0], points[1][0]);\n var ymin = mathMin(points[0][1], points[1][1]);\n var xmax = mathMax(points[0][0], points[1][0]);\n var ymax = mathMax(points[0][1], points[1][1]);\n return {\n x: xmin,\n y: ymin,\n width: xmax - xmin,\n height: ymax - ymin\n };\n}\nfunction resetCursor(controller, e, localCursorPoint) {\n if (\n // Check active\n !controller._brushType\n // resetCursor should be always called when mouse is in zr area,\n // but not called when mouse is out of zr area to avoid bad influence\n // if `mousemove`, `mouseup` are triggered from `document` event.\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\n return;\n }\n var zr = controller._zr;\n var covers = controller._covers;\n var currPanel = getPanelByPoint(controller, e, localCursorPoint);\n // Check whether in covers.\n if (!controller._dragging) {\n for (var i = 0; i < covers.length; i++) {\n var brushOption = covers[i].__brushOption;\n if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\n // Use cursor style set on cover.\n return;\n }\n }\n }\n currPanel && zr.setCursorStyle('crosshair');\n}\nfunction preventDefault(e) {\n var rawE = e.event;\n rawE.preventDefault && rawE.preventDefault();\n}\nfunction mainShapeContain(cover, x, y) {\n return cover.childOfName('main').contain(x, y);\n}\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\n var creatingCover = controller._creatingCover;\n var panel = controller._creatingPanel;\n var thisBrushOption = controller._brushOption;\n var eventParams;\n controller._track.push(localCursorPoint.slice());\n if (shouldShowCover(controller) || creatingCover) {\n if (panel && !creatingCover) {\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\n var brushOption = clone(thisBrushOption);\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\n controller._covers.push(creatingCover);\n }\n if (creatingCover) {\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\n var coverBrushOption = creatingCover.__brushOption;\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\n if (isEnd) {\n endCreating(controller, creatingCover);\n coverRenderer.updateCommon(controller, creatingCover);\n }\n updateCoverShape(controller, creatingCover);\n eventParams = {\n isEnd: isEnd\n };\n }\n } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) {\n // Help user to remove covers easily, only by a tiny drag, in 'single' mode.\n // But a single click do not clear covers, because user may have casual\n // clicks (for example, click on other component and do not expect covers\n // disappear).\n // Only some cover removed, trigger action, but not every click trigger action.\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\n eventParams = {\n isEnd: isEnd,\n removeOnClick: true\n };\n }\n }\n return eventParams;\n}\nfunction determineBrushType(brushType, panel) {\n if (brushType === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\n }\n return panel.defaultBrushType;\n }\n return brushType;\n}\nvar pointerHandlers = {\n mousedown: function (e) {\n if (this._dragging) {\n // In case some browser do not support globalOut,\n // and release mouse out side the browser.\n handleDragEnd(this, e);\n } else if (!e.target || !e.target.draggable) {\n preventDefault(e);\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\n this._creatingCover = null;\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\n if (panel) {\n this._dragging = true;\n this._track = [localCursorPoint.slice()];\n }\n }\n },\n mousemove: function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\n resetCursor(this, e, localCursorPoint);\n if (this._dragging) {\n preventDefault(e);\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\n eventParams && trigger(this, eventParams);\n }\n },\n mouseup: function (e) {\n handleDragEnd(this, e);\n }\n};\nfunction handleDragEnd(controller, e) {\n if (controller._dragging) {\n preventDefault(e);\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\n controller._dragging = false;\n controller._track = [];\n controller._creatingCover = null;\n // trigger event should be at final, after procedure will be nested.\n eventParams && trigger(controller, eventParams);\n }\n}\nfunction isOutsideZrArea(controller, x, y) {\n var zr = controller._zr;\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\n}\n/**\n * key: brushType\n */\nvar coverRenderers = {\n lineX: getLineRenderer(0),\n lineY: getLineRenderer(1),\n rect: {\n createCover: function (controller, brushOption) {\n function returnInput(range) {\n return range;\n }\n return createBaseRectCover({\n toRectRange: returnInput,\n fromRectRange: returnInput\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n updateBaseRect(controller, cover, localRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n },\n polygon: {\n createCover: function (controller, brushOption) {\n var cover = new graphic.Group();\n // Do not use graphic.Polygon because graphic.Polyline do not close the\n // border of the shape when drawing, which is a better experience for user.\n cover.add(new graphic.Polyline({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true\n }));\n return cover;\n },\n getCreatingRange: function (localTrack) {\n return localTrack;\n },\n endCreating: function (controller, cover) {\n cover.remove(cover.childAt(0));\n // Use graphic.Polygon close the shape.\n cover.add(new graphic.Polygon({\n name: 'main',\n draggable: true,\n drift: curry(driftPolygon, controller, cover),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n cover.childAt(0).setShape({\n points: clipByPanel(controller, cover, localRange)\n });\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n }\n};\nfunction getLineRenderer(xyIndex) {\n return {\n createCover: function (controller, brushOption) {\n return createBaseRectCover({\n toRectRange: function (range) {\n var rectRange = [range, [0, 100]];\n xyIndex && rectRange.reverse();\n return rectRange;\n },\n fromRectRange: function (rectRange) {\n return rectRange[xyIndex];\n }\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n var min = mathMin(ends[0][xyIndex], ends[1][xyIndex]);\n var max = mathMax(ends[0][xyIndex], ends[1][xyIndex]);\n return [min, max];\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n var otherExtent;\n // If brushWidth not specified, fit the panel.\n var panel = getPanelByCover(controller, cover);\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\n } else {\n var zr = controller._zr;\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\n }\n var rectRange = [localRange, otherExtent];\n xyIndex && rectRange.reverse();\n updateBaseRect(controller, cover, rectRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n };\n}\nexport default BrushController;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { onIrrelevantElement } from './cursorHelper.js';\nimport * as graphicUtil from '../../util/graphic.js';\nexport function makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}\nexport function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n rect = normalizeRect(rect);\n return function (xyIndex) {\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n var brushWidth = idx ? rect.width : rect.height;\n var base = idx ? rect.x : rect.y;\n return [base, base + (brushWidth || 0)];\n };\n}\nexport function makeRectIsTargetByCursor(rect, api, targetModel) {\n var boundingRect = normalizeRect(rect);\n return function (e, localCursorPoint) {\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n };\n}\n// Consider width/height is negative.\nfunction normalizeRect(rect) {\n return BoundingRect.create(rect);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport BrushController from '../helper/BrushController.js';\nimport * as brushHelper from '../helper/brushHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar elementList = ['axisLine', 'axisTickLabel', 'axisName'];\nvar ParallelAxisView = /** @class */function (_super) {\n __extends(ParallelAxisView, _super);\n function ParallelAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ParallelAxisView.type;\n return _this;\n }\n ParallelAxisView.prototype.init = function (ecModel, api) {\n _super.prototype.init.apply(this, arguments);\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this));\n };\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\n return;\n }\n this.axisModel = axisModel;\n this.api = api;\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n if (!axisModel.get('show')) {\n return;\n }\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\n var coordSys = coordSysModel.coordinateSystem;\n var areaSelectStyle = axisModel.getAreaSelectStyle();\n var areaWidth = areaSelectStyle.width;\n var dim = axisModel.axis.dim;\n var axisLayout = coordSys.getAxisLayout(dim);\n var builderOpt = zrUtil.extend({\n strokeContainThreshold: areaWidth\n }, axisLayout);\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\n zrUtil.each(elementList, axisBuilder.add, axisBuilder);\n this._axisGroup.add(axisBuilder.getGroup());\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n };\n // /**\n // * @override\n // */\n // updateVisual(axisModel, ecModel, api, payload) {\n // this._brushController && this._brushController\n // .updateCovers(getCoverInfoList(axisModel));\n // }\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\n // After filtering, axis may change, select area needs to be update.\n var extent = axisModel.axis.getExtent();\n var extentLen = extent[1] - extent[0];\n var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value.\n // width/height might be negative, which will be\n // normalized in BoundingRect.\n var rect = graphic.BoundingRect.create({\n x: extent[0],\n y: -areaWidth / 2,\n width: extentLen,\n height: areaWidth\n });\n rect.x -= extra;\n rect.width += 2 * extra;\n this._brushController.mount({\n enableGlobalPan: true,\n rotation: builderOpt.rotation,\n x: builderOpt.position[0],\n y: builderOpt.position[1]\n }).setPanels([{\n panelId: 'pl',\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect, 0)\n }]).enableBrush({\n brushType: 'lineX',\n brushStyle: areaSelectStyle,\n removeOnClick: true\n }).updateCovers(getCoverInfoList(axisModel));\n };\n ParallelAxisView.prototype._onBrush = function (eventParam) {\n var coverInfoList = eventParam.areas;\n // Do not cache these object, because the mey be changed.\n var axisModel = this.axisModel;\n var axis = axisModel.axis;\n var intervals = zrUtil.map(coverInfoList, function (coverInfo) {\n return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];\n });\n // If realtime is true, action is not dispatched on drag end, because\n // the drag end emits the same params with the last drag move event,\n // and may have some delay when using touch pad.\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'axisAreaSelect',\n parallelAxisId: axisModel.id,\n intervals: intervals\n });\n }\n };\n ParallelAxisView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n ParallelAxisView.type = 'parallelAxis';\n return ParallelAxisView;\n}(ComponentView);\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\n return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({\n mainType: 'parallelAxis',\n query: payload\n })[0] === axisModel;\n}\nfunction getCoverInfoList(axisModel) {\n var axis = axisModel.axis;\n return zrUtil.map(axisModel.activeIntervals, function (interval) {\n return {\n brushType: 'lineX',\n panelId: 'pl',\n range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]\n };\n });\n}\nfunction getCoordSysModel(axisModel, ecModel) {\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\n}\nexport default ParallelAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar actionInfo = {\n type: 'axisAreaSelect',\n event: 'axisAreaSelected'\n // update: 'updateVisual'\n};\n\nexport function installParallelActions(registers) {\n registers.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallelAxis',\n query: payload\n }, function (parallelAxisModel) {\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\n });\n });\n /**\n * @payload\n */\n registers.registerAction('parallelAxisExpand', function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallel',\n query: payload\n }, function (parallelModel) {\n parallelModel.setAxisExpand(payload);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport parallelPreprocessor from '../../coord/parallel/parallelPreprocessor.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelModel from '../../coord/parallel/ParallelModel.js';\nimport parallelCoordSysCreator from '../../coord/parallel/parallelCreator.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport ParallelAxisModel from '../../coord/parallel/AxisModel.js';\nimport ParallelAxisView from '../axis/ParallelAxisView.js';\nimport { installParallelActions } from '../axis/parallelAxisAction.js';\nvar defaultAxisOption = {\n type: 'value',\n areaSelectStyle: {\n width: 20,\n borderWidth: 1,\n borderColor: 'rgba(160,197,232)',\n color: 'rgba(160,197,232)',\n opacity: 0.3\n },\n realtime: true,\n z: 10\n};\nexport function install(registers) {\n registers.registerComponentView(ParallelView);\n registers.registerComponentModel(ParallelModel);\n registers.registerCoordinateSystem('parallel', parallelCoordSysCreator);\n registers.registerPreprocessor(parallelPreprocessor);\n registers.registerComponentModel(ParallelAxisModel);\n registers.registerComponentView(ParallelAxisView);\n axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption);\n installParallelActions(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelSeriesModel from './ParallelSeries.js';\nimport parallelVisual from './parallelVisual.js';\nimport { install as installParallelComponent } from '../../component/parallel/install.js';\nexport function install(registers) {\n use(installParallelComponent);\n registers.registerChartView(ParallelView);\n registers.registerSeriesModel(ParallelSeriesModel);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isString, retrieve3 } from 'zrender/lib/core/util.js';\nvar SankeyPathShape = /** @class */function () {\n function SankeyPathShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.cpx2 = 0;\n this.cpy2 = 0;\n this.extent = 0;\n }\n return SankeyPathShape;\n}();\nvar SankeyPath = /** @class */function (_super) {\n __extends(SankeyPath, _super);\n function SankeyPath(opts) {\n return _super.call(this, opts) || this;\n }\n SankeyPath.prototype.getDefaultShape = function () {\n return new SankeyPathShape();\n };\n SankeyPath.prototype.buildPath = function (ctx, shape) {\n var extent = shape.extent;\n ctx.moveTo(shape.x1, shape.y1);\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\n if (shape.orient === 'vertical') {\n ctx.lineTo(shape.x2 + extent, shape.y2);\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\n } else {\n ctx.lineTo(shape.x2, shape.y2 + extent);\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\n }\n ctx.closePath();\n };\n SankeyPath.prototype.highlight = function () {\n enterEmphasis(this);\n };\n SankeyPath.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n return SankeyPath;\n}(graphic.Path);\nvar SankeyView = /** @class */function (_super) {\n __extends(SankeyView, _super);\n function SankeyView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SankeyView.type;\n _this._focusAdjacencyDisabled = false;\n return _this;\n }\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\n var sankeyView = this;\n var graph = seriesModel.getGraph();\n var group = this.group;\n var layoutInfo = seriesModel.layoutInfo;\n // view width\n var width = layoutInfo.width;\n // view height\n var height = layoutInfo.height;\n var nodeData = seriesModel.getData();\n var edgeData = seriesModel.getData('edge');\n var orient = seriesModel.get('orient');\n this._model = seriesModel;\n group.removeAll();\n group.x = layoutInfo.x;\n group.y = layoutInfo.y;\n // generate a bezire Curve for each edge\n graph.eachEdge(function (edge) {\n var curve = new SankeyPath();\n var ecData = getECData(curve);\n ecData.dataIndex = edge.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n ecData.dataType = 'edge';\n var edgeModel = edge.getModel();\n var lineStyleModel = edgeModel.getModel('lineStyle');\n var curvature = lineStyleModel.get('curveness');\n var n1Layout = edge.node1.getLayout();\n var node1Model = edge.node1.getModel();\n var dragX1 = node1Model.get('localX');\n var dragY1 = node1Model.get('localY');\n var n2Layout = edge.node2.getLayout();\n var node2Model = edge.node2.getModel();\n var dragX2 = node2Model.get('localX');\n var dragY2 = node2Model.get('localY');\n var edgeLayout = edge.getLayout();\n var x1;\n var y1;\n var x2;\n var y2;\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n curve.shape.extent = Math.max(1, edgeLayout.dy);\n curve.shape.orient = orient;\n if (orient === 'vertical') {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\n cpx1 = x1;\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\n cpx2 = x2;\n cpy2 = y1 * curvature + y2 * (1 - curvature);\n } else {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\n cpy1 = y1;\n cpx2 = x1 * curvature + x2 * (1 - curvature);\n cpy2 = y2;\n }\n curve.setShape({\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n });\n curve.useStyle(lineStyleModel.getItemStyle());\n // Special color, use source node color or target node color\n applyCurveStyle(curve.style, orient, edge);\n var defaultEdgeLabelText = \"\" + edgeModel.get('value');\n var edgeLabelStateModels = getLabelStatesModels(edgeModel, 'edgeLabel');\n setLabelStyle(curve, edgeLabelStateModels, {\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, 'edge', labelDimIndex,\n // ensure edgeLabel formatter is provided\n // to prevent the inheritance from `label.formatter` of the series\n retrieve3(formatter, edgeLabelStateModels.normal && edgeLabelStateModels.normal.get('formatter'), defaultEdgeLabelText), extendParams);\n }\n },\n labelDataIndex: edge.dataIndex,\n defaultText: defaultEdgeLabelText\n });\n curve.setTextConfig({\n position: 'inside'\n });\n var emphasisModel = edgeModel.getModel('emphasis');\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) {\n var style = model.getItemStyle();\n applyCurveStyle(style, orient, edge);\n return style;\n });\n group.add(curve);\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus === 'trajectory' ? edge.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n // Generate a rect for each node\n graph.eachNode(function (node) {\n var layout = node.getLayout();\n var itemModel = node.getModel();\n var dragX = itemModel.get('localX');\n var dragY = itemModel.get('localY');\n var emphasisModel = itemModel.getModel('emphasis');\n var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0;\n var rect = new graphic.Rect({\n shape: {\n x: dragX != null ? dragX * width : layout.x,\n y: dragY != null ? dragY * height : layout.y,\n width: layout.dx,\n height: layout.dy,\n r: borderRadius\n },\n style: itemModel.getModel('itemStyle').getItemStyle(),\n z2: 10\n });\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, 'node');\n }\n },\n labelDataIndex: node.dataIndex,\n defaultText: node.id\n });\n rect.disableLabelAnimation = true;\n rect.setStyle('fill', node.getVisual('color'));\n rect.setStyle('decal', node.getVisual('style').decal);\n setStatesStylesFromModel(rect, itemModel);\n group.add(rect);\n nodeData.setItemGraphicEl(node.dataIndex, rect);\n getECData(rect).dataType = 'node';\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus === 'trajectory' ? node.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\n var itemModel = nodeData.getItemModel(dataIndex);\n if (itemModel.get('draggable')) {\n el.drift = function (dx, dy) {\n sankeyView._focusAdjacencyDisabled = true;\n this.shape.x += dx;\n this.shape.y += dy;\n this.dirty();\n api.dispatchAction({\n type: 'dragNode',\n seriesId: seriesModel.id,\n dataIndex: nodeData.getRawIndex(dataIndex),\n localX: this.shape.x / width,\n localY: this.shape.y / height\n });\n };\n el.ondragend = function () {\n sankeyView._focusAdjacencyDisabled = false;\n };\n el.draggable = true;\n el.cursor = 'move';\n }\n });\n if (!this._data && seriesModel.isAnimationEnabled()) {\n group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {\n group.removeClipPath();\n }));\n }\n this._data = seriesModel.getData();\n };\n SankeyView.prototype.dispose = function () {};\n SankeyView.type = 'sankey';\n return SankeyView;\n}(ChartView);\n/**\n * Special color, use source node color or target node color\n * @param curveProps curve's style to parse\n * @param orient direction\n * @param edge current curve data\n */\nfunction applyCurveStyle(curveProps, orient, edge) {\n switch (curveProps.fill) {\n case 'source':\n curveProps.fill = edge.node1.getVisual('color');\n curveProps.decal = edge.node1.getVisual('style').decal;\n break;\n case 'target':\n curveProps.fill = edge.node2.getVisual('color');\n curveProps.decal = edge.node2.getVisual('style').decal;\n break;\n case 'gradient':\n var sourceColor = edge.node1.getVisual('color');\n var targetColor = edge.node2.getVisual('color');\n if (isString(sourceColor) && isString(targetColor)) {\n curveProps.fill = new graphic.LinearGradient(0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{\n color: sourceColor,\n offset: 0\n }, {\n color: targetColor,\n offset: 1\n }]);\n }\n }\n}\n// Add animation to the view\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\nexport default SankeyView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar SankeySeriesModel = /** @class */function (_super) {\n __extends(SankeySeriesModel, _super);\n function SankeySeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SankeySeriesModel.type;\n return _this;\n }\n /**\n * Init a graph data structure from data in option series\n */\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\n var links = option.edges || option.links;\n var nodes = option.data || option.nodes;\n var levels = option.levels;\n this.levelModels = [];\n var levelModels = this.levelModels;\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].depth != null && levels[i].depth >= 0) {\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('levels[i].depth is mandatory and should be natural number');\n }\n }\n }\n if (nodes && links) {\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\n return graph.data;\n }\n function beforeLink(nodeData, edgeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var layout = seriesModel.getData().getItemLayout(idx);\n if (layout) {\n var nodeDepth = layout.depth;\n var levelModel = seriesModel.levelModels[nodeDepth];\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n return model;\n });\n edgeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\n var layout = edge.node1.getLayout();\n if (layout) {\n var depth = layout.depth;\n var levelModel = seriesModel.levelModels[depth];\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n return model;\n });\n }\n };\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\n var nodes = this.option.data || this.option.nodes;\n var dataItem = nodes[dataIndex];\n dataItem.localX = localPosition[0];\n dataItem.localY = localPosition[1];\n };\n /**\n * Return the graphic data structure\n *\n * @return graphic data structure\n */\n SankeySeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n /**\n * Get edge data of graphic data structure\n *\n * @return data structure of list\n */\n SankeySeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n function noValue(val) {\n return isNaN(val) || val == null;\n }\n // dataType === 'node' or empty do not show tooltip by default\n if (dataType === 'edge') {\n var params = this.getDataParams(dataIndex, dataType);\n var rawDataOpt = params.data;\n var edgeValue = params.value;\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\n return createTooltipMarkup('nameValue', {\n name: edgeName,\n value: edgeValue,\n noValue: noValue(edgeValue)\n });\n }\n // dataType === 'node'\n else {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var value = node.getLayout().value;\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\n return createTooltipMarkup('nameValue', {\n name: name_1 != null ? name_1 + '' : null,\n value: value,\n noValue: noValue(value)\n });\n }\n };\n SankeySeriesModel.prototype.optionUpdated = function () {};\n // Override Series.getDataParams()\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n if (params.value == null && dataType === 'node') {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var nodeValue = node.getLayout().value;\n params.value = nodeValue;\n }\n return params;\n };\n SankeySeriesModel.type = 'series.sankey';\n SankeySeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n left: '5%',\n top: '5%',\n right: '20%',\n bottom: '5%',\n orient: 'horizontal',\n nodeWidth: 20,\n nodeGap: 8,\n draggable: true,\n layoutIterations: 32,\n label: {\n show: true,\n position: 'right',\n fontSize: 12\n },\n edgeLabel: {\n show: false,\n fontSize: 12\n },\n levels: [],\n nodeAlign: 'justify',\n lineStyle: {\n color: '#314656',\n opacity: 0.2,\n curveness: 0.5\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n opacity: 0.5\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n animationEasing: 'linear',\n animationDuration: 1000\n };\n return SankeySeriesModel;\n}(SeriesModel);\nexport default SankeySeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as layout from '../../util/layout.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData } from '../../util/model.js';\nexport default function sankeyLayout(ecModel, api) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var nodeWidth = seriesModel.get('nodeWidth');\n var nodeGap = seriesModel.get('nodeGap');\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var width = layoutInfo.width;\n var height = layoutInfo.height;\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n computeNodeValues(nodes);\n var filteredNodes = zrUtil.filter(nodes, function (node) {\n return node.getLayout().value === 0;\n });\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\n var orient = seriesModel.get('orient');\n var nodeAlign = seriesModel.get('nodeAlign');\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\n });\n}\n/**\n * Get the layout position of the whole view\n */\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\n computeEdgeDepths(nodes, orient);\n}\n/**\n * Compute the value of each node by summing the associated edge's value\n */\nfunction computeNodeValues(nodes) {\n zrUtil.each(nodes, function (node) {\n var value1 = sum(node.outEdges, getEdgeValue);\n var value2 = sum(node.inEdges, getEdgeValue);\n var nodeRawValue = node.getValue() || 0;\n var value = Math.max(value1, value2, nodeRawValue);\n node.setLayout({\n value: value\n }, true);\n });\n}\n/**\n * Compute the x-position for each node.\n *\n * Here we use Kahn algorithm to detect cycle when we traverse\n * the node to computer the initial x position.\n */\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\n // Used to mark whether the edge is deleted. if it is deleted,\n // the value is 0, otherwise it is 1.\n var remainEdges = [];\n // Storage each node's indegree.\n var indegreeArr = [];\n // Used to storage the node with indegree is equal to 0.\n var zeroIndegrees = [];\n var nextTargetNode = [];\n var x = 0;\n // let kx = 0;\n for (var i = 0; i < edges.length; i++) {\n remainEdges[i] = 1;\n }\n for (var i = 0; i < nodes.length; i++) {\n indegreeArr[i] = nodes[i].inEdges.length;\n if (indegreeArr[i] === 0) {\n zeroIndegrees.push(nodes[i]);\n }\n }\n var maxNodeDepth = -1;\n // Traversing nodes using topological sorting to calculate the\n // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\n // position of the nodes.\n while (zeroIndegrees.length) {\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n var node = zeroIndegrees[idx];\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n var isItemDepth = item.depth != null && item.depth >= 0;\n if (isItemDepth && item.depth > maxNodeDepth) {\n maxNodeDepth = item.depth;\n }\n node.setLayout({\n depth: isItemDepth ? item.depth : x\n }, true);\n orient === 'vertical' ? node.setLayout({\n dy: nodeWidth\n }, true) : node.setLayout({\n dx: nodeWidth\n }, true);\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\n var edge = node.outEdges[edgeIdx];\n var indexEdge = edges.indexOf(edge);\n remainEdges[indexEdge] = 0;\n var targetNode = edge.node2;\n var nodeIndex = nodes.indexOf(targetNode);\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\n nextTargetNode.push(targetNode);\n }\n }\n }\n ++x;\n zeroIndegrees = nextTargetNode;\n nextTargetNode = [];\n }\n for (var i = 0; i < remainEdges.length; i++) {\n if (remainEdges[i] === 1) {\n throw new Error('Sankey is a DAG, the original data has cycle!');\n }\n }\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\n if (nodeAlign && nodeAlign !== 'left') {\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\n }\n var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;\n scaleNodeBreadths(nodes, kx, orient);\n}\nfunction isNodeDepth(node) {\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n return item.depth != null && item.depth >= 0;\n}\nfunction adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\n if (nodeAlign === 'right') {\n var nextSourceNode = [];\n var remainNodes = nodes;\n var nodeHeight = 0;\n while (remainNodes.length) {\n for (var i = 0; i < remainNodes.length; i++) {\n var node = remainNodes[i];\n node.setLayout({\n skNodeHeight: nodeHeight\n }, true);\n for (var j = 0; j < node.inEdges.length; j++) {\n var edge = node.inEdges[j];\n if (nextSourceNode.indexOf(edge.node1) < 0) {\n nextSourceNode.push(edge.node1);\n }\n }\n }\n remainNodes = nextSourceNode;\n nextSourceNode = [];\n ++nodeHeight;\n }\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node)) {\n node.setLayout({\n depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)\n }, true);\n }\n });\n } else if (nodeAlign === 'justify') {\n moveSinksRight(nodes, maxDepth);\n }\n}\n/**\n * All the node without outEgdes are assigned maximum x-position and\n * be aligned in the last column.\n *\n * @param nodes. node of sankey view.\n * @param maxDepth. use to assign to node without outEdges as x-position.\n */\nfunction moveSinksRight(nodes, maxDepth) {\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node) && !node.outEdges.length) {\n node.setLayout({\n depth: maxDepth\n }, true);\n }\n });\n}\n/**\n * Scale node x-position to the width\n *\n * @param nodes node of sankey view\n * @param kx multiple used to scale nodes\n */\nfunction scaleNodeBreadths(nodes, kx, orient) {\n zrUtil.each(nodes, function (node) {\n var nodeDepth = node.getLayout().depth * kx;\n orient === 'vertical' ? node.setLayout({\n y: nodeDepth\n }, true) : node.setLayout({\n x: nodeDepth\n }, true);\n });\n}\n/**\n * Using Gauss-Seidel iterations method to compute the node depth(y-position)\n *\n * @param nodes node of sankey view\n * @param edges edge of sankey view\n * @param height the whole height of the area to draw the view\n * @param nodeGap the vertical distance between two nodes\n * in the same column.\n * @param iterations the number of iterations for the algorithm\n */\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n for (var alpha = 1; iterations > 0; iterations--) {\n // 0.99 is a experience parameter, ensure that each iterations of\n // changes as small as possible.\n alpha *= 0.99;\n relaxRightToLeft(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n relaxLeftToRight(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n }\n}\nfunction prepareNodesByBreadth(nodes, orient) {\n var nodesByBreadth = [];\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\n var groupResult = groupData(nodes, function (node) {\n return node.getLayout()[keyAttr];\n });\n groupResult.keys.sort(function (a, b) {\n return a - b;\n });\n zrUtil.each(groupResult.keys, function (key) {\n nodesByBreadth.push(groupResult.buckets.get(key));\n });\n return nodesByBreadth;\n}\n/**\n * Compute the original y-position for each node\n */\nfunction initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n var minKy = Infinity;\n zrUtil.each(nodesByBreadth, function (nodes) {\n var n = nodes.length;\n var sum = 0;\n zrUtil.each(nodes, function (node) {\n sum += node.getLayout().value;\n });\n var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n if (ky < minKy) {\n minKy = ky;\n }\n });\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node, i) {\n var nodeDy = node.getLayout().value * minKy;\n if (orient === 'vertical') {\n node.setLayout({\n x: i\n }, true);\n node.setLayout({\n dx: nodeDy\n }, true);\n } else {\n node.setLayout({\n y: i\n }, true);\n node.setLayout({\n dy: nodeDy\n }, true);\n }\n });\n });\n zrUtil.each(edges, function (edge) {\n var edgeDy = +edge.getValue() * minKy;\n edge.setLayout({\n dy: edgeDy\n }, true);\n });\n}\n/**\n * Resolve the collision of initialized depth (y-position)\n */\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodesByBreadth, function (nodes) {\n nodes.sort(function (a, b) {\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\n });\n var nodeX;\n var node;\n var dy;\n var y0 = 0;\n var n = nodes.length;\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\n for (var i = 0; i < n; i++) {\n node = nodes[i];\n dy = y0 - node.getLayout()[keyAttr];\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] + dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\n }\n var viewWidth = orient === 'vertical' ? width : height;\n // If the bottommost node goes outside the bounds, push it back up\n dy = y0 - nodeGap - viewWidth;\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n y0 = nodeX;\n for (var i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n y0 = node.getLayout()[keyAttr];\n }\n }\n });\n}\n/**\n * Change the y-position of the nodes, except most the right side nodes\n * @param nodesByBreadth\n * @param alpha parameter used to adjust the nodes y-position\n */\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.outEdges.length) {\n var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue);\n if (isNaN(y)) {\n var len = node.outEdges.length;\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\n }\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\nfunction weightedTarget(edge, orient) {\n return center(edge.node2, orient) * edge.getValue();\n}\nfunction centerTarget(edge, orient) {\n return center(edge.node2, orient);\n}\nfunction weightedSource(edge, orient) {\n return center(edge.node1, orient) * edge.getValue();\n}\nfunction centerSource(edge, orient) {\n return center(edge.node1, orient);\n}\nfunction center(node, orient) {\n return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2;\n}\nfunction getEdgeValue(edge) {\n return edge.getValue();\n}\nfunction sum(array, cb, orient) {\n var sum = 0;\n var len = array.length;\n var i = -1;\n while (++i < len) {\n var value = +cb(array[i], orient);\n if (!isNaN(value)) {\n sum += value;\n }\n }\n return sum;\n}\n/**\n * Change the y-position of the nodes, except most the left side nodes\n */\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.inEdges.length) {\n var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue);\n if (isNaN(y)) {\n var len = node.inEdges.length;\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\n }\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n/**\n * Compute the depth(y-position) of each edge\n */\nfunction computeEdgeDepths(nodes, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodes, function (node) {\n node.outEdges.sort(function (a, b) {\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\n });\n node.inEdges.sort(function (a, b) {\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\n });\n });\n zrUtil.each(nodes, function (node) {\n var sy = 0;\n var ty = 0;\n zrUtil.each(node.outEdges, function (edge) {\n edge.setLayout({\n sy: sy\n }, true);\n sy += edge.getLayout().dy;\n });\n zrUtil.each(node.inEdges, function (edge) {\n edge.setLayout({\n ty: ty\n }, true);\n ty += edge.getLayout().dy;\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nexport default function sankeyVisual(ecModel) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n if (nodes.length) {\n var minValue_1 = Infinity;\n var maxValue_1 = -Infinity;\n zrUtil.each(nodes, function (node) {\n var nodeValue = node.getLayout().value;\n if (nodeValue < minValue_1) {\n minValue_1 = nodeValue;\n }\n if (nodeValue > maxValue_1) {\n maxValue_1 = nodeValue;\n }\n });\n zrUtil.each(nodes, function (node) {\n var mapping = new VisualMapping({\n type: 'color',\n mappingMethod: 'linear',\n dataExtent: [minValue_1, maxValue_1],\n visual: seriesModel.get('color')\n });\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n var customColor = node.getModel().get(['itemStyle', 'color']);\n if (customColor != null) {\n node.setVisual('color', customColor);\n node.setVisual('style', {\n fill: customColor\n });\n } else {\n node.setVisual('color', mapValueToColor);\n node.setVisual('style', {\n fill: mapValueToColor\n });\n }\n });\n }\n if (edges.length) {\n zrUtil.each(edges, function (edge) {\n var edgeStyle = edge.getModel().get('lineStyle');\n edge.setVisual('style', edgeStyle);\n });\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SankeyView from './SankeyView.js';\nimport SankeySeriesModel from './SankeySeries.js';\nimport sankeyLayout from './sankeyLayout.js';\nimport sankeyVisual from './sankeyVisual.js';\nexport function install(registers) {\n registers.registerChartView(SankeyView);\n registers.registerSeriesModel(SankeySeriesModel);\n registers.registerLayout(sankeyLayout);\n registers.registerVisual(sankeyVisual);\n registers.registerAction({\n type: 'dragNode',\n event: 'dragnode',\n // here can only use 'update' now, other value is not support in echarts.\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sankey',\n query: payload\n }, function (seriesModel) {\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport createSeriesDataSimply from './createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\nvar WhiskerBoxCommonMixin = /** @class */function () {\n function WhiskerBoxCommonMixin() {}\n /**\n * @override\n */\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\n // When both types of xAxis and yAxis are 'value', layout is\n // needed to be specified by user. Otherwise, layout can be\n // judged by which axis is category.\n var ordinalMeta;\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\n var xAxisType = xAxisModel.get('type');\n var yAxisType = yAxisModel.get('type');\n var addOrdinal;\n // FIXME\n // Consider time axis.\n if (xAxisType === 'category') {\n option.layout = 'horizontal';\n ordinalMeta = xAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else if (yAxisType === 'category') {\n option.layout = 'vertical';\n ordinalMeta = yAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else {\n option.layout = option.layout || 'horizontal';\n }\n var coordDims = ['x', 'y'];\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\n var axisModels = [xAxisModel, yAxisModel];\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\n var data = option.data;\n // Clone a new data for next setOption({}) usage.\n // Avoid modifying current data will affect further update.\n if (data && addOrdinal) {\n var newOptionData_1 = [];\n zrUtil.each(data, function (item, index) {\n var newItem;\n if (zrUtil.isArray(item)) {\n newItem = item.slice();\n // Modify current using data.\n item.unshift(index);\n } else if (zrUtil.isArray(item.value)) {\n newItem = zrUtil.extend({}, item);\n newItem.value = newItem.value.slice();\n // Modify current using data.\n item.value.unshift(index);\n } else {\n newItem = item;\n }\n newOptionData_1.push(newItem);\n });\n option.data = newOptionData_1;\n }\n var defaultValueDimensions = this.defaultValueDimensions;\n var coordDimensions = [{\n name: baseAxisDim,\n type: getDimensionTypeByAxis(baseAxisType),\n ordinalMeta: ordinalMeta,\n otherDims: {\n tooltip: false,\n itemName: 0\n },\n dimsDef: ['base']\n }, {\n name: otherAxisDim,\n type: getDimensionTypeByAxis(otherAxisType),\n dimsDef: defaultValueDimensions.slice()\n }];\n return createSeriesDataSimply(this, {\n coordDimensions: coordDimensions,\n dimensionsCount: defaultValueDimensions.length + 1,\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\n });\n };\n /**\n * If horizontal, base axis is x, otherwise y.\n * @override\n */\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\n var dim = this._baseAxisDim;\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\n };\n return WhiskerBoxCommonMixin;\n}();\n;\nexport { WhiskerBoxCommonMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nvar BoxplotSeriesModel = /** @class */function (_super) {\n __extends(BoxplotSeriesModel, _super);\n function BoxplotSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = BoxplotSeriesModel.type;\n // TODO\n // box width represents group size, so dimension should have 'size'.\n /**\n * @see \n * The meanings of 'min' and 'max' depend on user,\n * and echarts do not need to know it.\n * @readOnly\n */\n _this.defaultValueDimensions = [{\n name: 'min',\n defaultTooltip: true\n }, {\n name: 'Q1',\n defaultTooltip: true\n }, {\n name: 'median',\n defaultTooltip: true\n }, {\n name: 'Q3',\n defaultTooltip: true\n }, {\n name: 'max',\n defaultTooltip: true\n }];\n _this.visualDrawType = 'stroke';\n return _this;\n }\n BoxplotSeriesModel.type = 'series.boxplot';\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n BoxplotSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n layout: null,\n boxWidth: [7, 50],\n itemStyle: {\n color: '#fff',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2,\n shadowBlur: 5,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n }\n },\n animationDuration: 800\n };\n return BoxplotSeriesModel;\n}(SeriesModel);\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\nexport default BoxplotSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar BoxplotView = /** @class */function (_super) {\n __extends(BoxplotView, _super);\n function BoxplotView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = BoxplotView.type;\n return _this;\n }\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var group = this.group;\n var oldData = this._data;\n // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n if (!this._data) {\n group.removeAll();\n }\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n // Empty data\n if (!data.hasValue(newIdx)) {\n group.remove(symbolEl);\n return;\n }\n var itemLayout = data.getItemLayout(newIdx);\n if (!symbolEl) {\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\n } else {\n saveOldStyle(symbolEl);\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\n }\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n BoxplotView.prototype.remove = function (ecModel) {\n var group = this.group;\n var data = this._data;\n this._data = null;\n data && data.eachItemGraphicEl(function (el) {\n el && group.remove(el);\n });\n };\n BoxplotView.type = 'boxplot';\n return BoxplotView;\n}(ChartView);\nvar BoxPathShape = /** @class */function () {\n function BoxPathShape() {}\n return BoxPathShape;\n}();\nvar BoxPath = /** @class */function (_super) {\n __extends(BoxPath, _super);\n function BoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'boxplotBoxPath';\n return _this;\n }\n BoxPath.prototype.getDefaultShape = function () {\n return new BoxPathShape();\n };\n BoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n var i = 0;\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n for (; i < 4; i++) {\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n ctx.closePath();\n for (; i < ends.length; i++) {\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n };\n return BoxPath;\n}(Path);\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\n var ends = itemLayout.ends;\n var el = new BoxPath({\n shape: {\n points: isInit ? transInit(ends, constDim, itemLayout) : ends\n }\n });\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\n return el;\n}\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\n var seriesModel = data.hostModel;\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\n updateMethod(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.z2 = 100;\n var itemModel = data.getItemModel(dataIndex);\n var emphasisModel = itemModel.getModel('emphasis');\n setStatesStylesFromModel(el, itemModel);\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n}\nfunction transInit(points, dim, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[dim] = itemLayout.initBaseline;\n return point;\n });\n}\nexport default BoxplotView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../../util/number.js';\nvar each = zrUtil.each;\nexport default function boxplotLayout(ecModel) {\n var groupResult = groupSeriesByAxis(ecModel);\n each(groupResult, function (groupItem) {\n var seriesModels = groupItem.seriesModels;\n if (!seriesModels.length) {\n return;\n }\n calculateBase(groupItem);\n each(seriesModels, function (seriesModel, idx) {\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\n });\n });\n}\n/**\n * Group series by axis.\n */\nfunction groupSeriesByAxis(ecModel) {\n var result = [];\n var axisList = [];\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n var baseAxis = seriesModel.getBaseAxis();\n var idx = zrUtil.indexOf(axisList, baseAxis);\n if (idx < 0) {\n idx = axisList.length;\n axisList[idx] = baseAxis;\n result[idx] = {\n axis: baseAxis,\n seriesModels: []\n };\n }\n result[idx].seriesModels.push(seriesModel);\n });\n return result;\n}\n/**\n * Calculate offset and box width for each series.\n */\nfunction calculateBase(groupItem) {\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount_1 = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n });\n var extent = baseAxis.getExtent();\n bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n }\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}\n/**\n * Calculate points location for each series.\n */\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var halfWidth = boxWidth / 2;\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\n var vDimIdx = 1 - cDimIdx;\n var coordDims = ['x', 'y'];\n var cDim = data.mapDimension(coordDims[cDimIdx]);\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\n if (cDim == null || vDims.length < 5) {\n return;\n }\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var axisDimVal = data.get(cDim, dataIndex);\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\n var ends = [];\n addBodyEnd(ends, end2, false);\n addBodyEnd(ends, end4, true);\n ends.push(end1, end2, end5, end4);\n layEndLine(ends, end1);\n layEndLine(ends, end5);\n layEndLine(ends, median);\n data.setItemLayout(dataIndex, {\n initBaseline: median[vDimIdx],\n ends: ends\n });\n }\n function getPoint(axisDimVal, dim, dataIndex) {\n var val = data.get(dim, dataIndex);\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n var point;\n if (isNaN(axisDimVal) || isNaN(val)) {\n point = [NaN, NaN];\n } else {\n point = coordSys.dataToPoint(p);\n point[cDimIdx] += offset;\n }\n return point;\n }\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] += halfWidth;\n point2[cDimIdx] -= halfWidth;\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n function layEndLine(ends, endCenter) {\n var from = endCenter.slice();\n var to = endCenter.slice();\n from[cDimIdx] -= halfWidth;\n to[cDimIdx] += halfWidth;\n ends.push(from, to);\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { quantile, asc } from '../../util/number.js';\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\n/**\n * See:\n * \n * \n *\n * Helper method for preparing data.\n *\n * @param rawData like\n * [\n * [12,232,443], (raw data set for the first box)\n * [3843,5545,1232], (raw data set for the second box)\n * ...\n * ]\n * @param opt.boundIQR=1.5 Data less than min bound is outlier.\n * default 1.5, means Q1 - 1.5 * (Q3 - Q1).\n * If 'none'/0 passed, min bound will not be used.\n */\nexport default function prepareBoxplotData(rawData, opt) {\n opt = opt || {};\n var boxData = [];\n var outliers = [];\n var boundIQR = opt.boundIQR;\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\n for (var i = 0; i < rawData.length; i++) {\n var ascList = asc(rawData[i].slice());\n var Q1 = quantile(ascList, 0.25);\n var Q2 = quantile(ascList, 0.5);\n var Q3 = quantile(ascList, 0.75);\n var min = ascList[0];\n var max = ascList[ascList.length - 1];\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\n var low = useExtreme ? min : Math.max(min, Q1 - bound);\n var high = useExtreme ? max : Math.min(max, Q3 + bound);\n var itemNameFormatter = opt.itemNameFormatter;\n var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({\n value: i\n }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + '';\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\n for (var j = 0; j < ascList.length; j++) {\n var dataItem = ascList[j];\n if (dataItem < low || dataItem > high) {\n var outlier = [itemName, dataItem];\n outliers.push(outlier);\n }\n }\n }\n return {\n boxData: boxData,\n outliers: outliers\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport prepareBoxplotData from './prepareBoxplotData.js';\nimport { throwError, makePrintable } from '../../util/log.js';\nimport { SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nexport var boxplotTransform = {\n type: 'echarts:boxplot',\n transform: function transform(params) {\n var upstream = params.upstream;\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\n }\n throwError(errMsg);\n }\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\n return [{\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\n data: result.boxData\n }, {\n data: result.outliers\n }];\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport BoxplotSeriesModel from './BoxplotSeries.js';\nimport BoxplotView from './BoxplotView.js';\nimport boxplotLayout from './boxplotLayout.js';\nimport { boxplotTransform } from './boxplotTransform.js';\nexport function install(registers) {\n registers.registerSeriesModel(BoxplotSeriesModel);\n registers.registerChartView(BoxplotView);\n registers.registerLayout(boxplotLayout);\n registers.registerTransform(boxplotTransform);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar SKIP_PROPS = ['color', 'borderColor'];\nvar CandlestickView = /** @class */function (_super) {\n __extends(CandlestickView, _super);\n function CandlestickView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CandlestickView.type;\n return _this;\n }\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\n // If there is clipPath created in large mode. Remove it.\n this.group.removeClipPath();\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n this._updateDrawMode(seriesModel);\n this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel);\n };\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._clear();\n this._updateDrawMode(seriesModel);\n };\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n this._progressiveEls = [];\n this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel);\n };\n CandlestickView.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n this._clear();\n }\n };\n CandlestickView.prototype._renderNormal = function (seriesModel) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var isSimpleBox = data.getLayout('isSimpleBox');\n var needsClip = seriesModel.get('clip', true);\n var coord = seriesModel.coordinateSystem;\n var clipArea = coord.getArea && coord.getArea();\n // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n if (!this._data) {\n group.removeAll();\n }\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n return;\n }\n var el = createNormalBox(itemLayout, newIdx, true);\n graphic.initProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }\n }).update(function (newIdx, oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n // Empty data\n if (!data.hasValue(newIdx)) {\n group.remove(el);\n return;\n }\n var itemLayout = data.getItemLayout(newIdx);\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n group.remove(el);\n return;\n }\n if (!el) {\n el = createNormalBox(itemLayout, newIdx);\n } else {\n graphic.updateProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n saveOldStyle(el);\n }\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n CandlestickView.prototype._renderLarge = function (seriesModel) {\n this._clear();\n createLarge(seriesModel, this.group);\n var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n };\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\n var data = seriesModel.getData();\n var isSimpleBox = data.getLayout('isSimpleBox');\n var dataIndex;\n while ((dataIndex = params.next()) != null) {\n var itemLayout = data.getItemLayout(dataIndex);\n var el = createNormalBox(itemLayout, dataIndex);\n setBoxCommon(el, data, dataIndex, isSimpleBox);\n el.incremental = true;\n this.group.add(el);\n this._progressiveEls.push(el);\n }\n };\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n createLarge(seriesModel, this.group, this._progressiveEls, true);\n };\n CandlestickView.prototype.remove = function (ecModel) {\n this._clear();\n };\n CandlestickView.prototype._clear = function () {\n this.group.removeAll();\n this._data = null;\n };\n CandlestickView.type = 'candlestick';\n return CandlestickView;\n}(ChartView);\nvar NormalBoxPathShape = /** @class */function () {\n function NormalBoxPathShape() {}\n return NormalBoxPathShape;\n}();\nvar NormalBoxPath = /** @class */function (_super) {\n __extends(NormalBoxPath, _super);\n function NormalBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'normalCandlestickBox';\n return _this;\n }\n NormalBoxPath.prototype.getDefaultShape = function () {\n return new NormalBoxPathShape();\n };\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n if (this.__simpleBox) {\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[6][0], ends[6][1]);\n } else {\n ctx.moveTo(ends[0][0], ends[0][1]);\n ctx.lineTo(ends[1][0], ends[1][1]);\n ctx.lineTo(ends[2][0], ends[2][1]);\n ctx.lineTo(ends[3][0], ends[3][1]);\n ctx.closePath();\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[5][0], ends[5][1]);\n ctx.moveTo(ends[6][0], ends[6][1]);\n ctx.lineTo(ends[7][0], ends[7][1]);\n }\n };\n return NormalBoxPath;\n}(Path);\nfunction createNormalBox(itemLayout, dataIndex, isInit) {\n var ends = itemLayout.ends;\n return new NormalBoxPath({\n shape: {\n points: isInit ? transInit(ends, itemLayout) : ends\n },\n z2: 100\n });\n}\nfunction isNormalBoxClipped(clipArea, itemLayout) {\n var clipped = true;\n for (var i = 0; i < itemLayout.ends.length; i++) {\n // If any point are in the region.\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\n clipped = false;\n break;\n }\n }\n return clipped;\n}\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\n var itemModel = data.getItemModel(dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.__simpleBox = isSimpleBox;\n setStatesStylesFromModel(el, itemModel);\n}\nfunction transInit(points, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[1] = itemLayout.initBaseline;\n return point;\n });\n}\nvar LargeBoxPathShape = /** @class */function () {\n function LargeBoxPathShape() {}\n return LargeBoxPathShape;\n}();\nvar LargeBoxPath = /** @class */function (_super) {\n __extends(LargeBoxPath, _super);\n function LargeBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = 'largeCandlestickBox';\n return _this;\n }\n LargeBoxPath.prototype.getDefaultShape = function () {\n return new LargeBoxPathShape();\n };\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n for (var i = 0; i < points.length;) {\n if (this.__sign === points[i++]) {\n var x = points[i++];\n ctx.moveTo(x, points[i++]);\n ctx.lineTo(x, points[i++]);\n } else {\n i += 3;\n }\n }\n };\n return LargeBoxPath;\n}(Path);\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n var data = seriesModel.getData();\n var largePoints = data.getLayout('largePoints');\n var elP = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 1,\n ignoreCoarsePointer: true\n });\n group.add(elP);\n var elN = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: -1,\n ignoreCoarsePointer: true\n });\n group.add(elN);\n var elDoji = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 0,\n ignoreCoarsePointer: true\n });\n group.add(elDoji);\n setLargeStyle(1, elP, seriesModel, data);\n setLargeStyle(-1, elN, seriesModel, data);\n setLargeStyle(0, elDoji, seriesModel, data);\n if (incremental) {\n elP.incremental = true;\n elN.incremental = true;\n }\n if (progressiveEls) {\n progressiveEls.push(elP, elN);\n }\n}\nfunction setLargeStyle(sign, el, seriesModel, data) {\n // TODO put in visual?\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0'])\n // Use color for border color by default.\n || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']);\n if (sign === 0) {\n borderColor = seriesModel.get(['itemStyle', 'borderColorDoji']);\n }\n // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\n el.useStyle(itemStyle);\n el.style.fill = null;\n el.style.stroke = borderColor;\n}\nexport default CandlestickView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nvar CandlestickSeriesModel = /** @class */function (_super) {\n __extends(CandlestickSeriesModel, _super);\n function CandlestickSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CandlestickSeriesModel.type;\n _this.defaultValueDimensions = [{\n name: 'open',\n defaultTooltip: true\n }, {\n name: 'close',\n defaultTooltip: true\n }, {\n name: 'lowest',\n defaultTooltip: true\n }, {\n name: 'highest',\n defaultTooltip: true\n }];\n return _this;\n }\n /**\n * Get dimension for shadow in dataZoom\n * @return dimension name\n */\n CandlestickSeriesModel.prototype.getShadowDim = function () {\n return 'open';\n };\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n var itemLayout = data.getItemLayout(dataIndex);\n return itemLayout && selectors.rect(itemLayout.brushRect);\n };\n CandlestickSeriesModel.type = 'series.candlestick';\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n CandlestickSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n layout: null,\n clip: true,\n itemStyle: {\n color: '#eb5454',\n color0: '#47b262',\n borderColor: '#eb5454',\n borderColor0: '#47b262',\n borderColorDoji: null,\n // borderColor: '#d24040',\n // borderColor0: '#398f4f',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2\n }\n },\n barMaxWidth: null,\n barMinWidth: null,\n barWidth: null,\n large: true,\n largeThreshold: 600,\n progressive: 3e3,\n progressiveThreshold: 1e4,\n progressiveChunkMode: 'mod',\n animationEasing: 'linear',\n animationDuration: 300\n };\n return CandlestickSeriesModel;\n}(SeriesModel);\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\nexport default CandlestickSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function candlestickPreprocessor(option) {\n if (!option || !zrUtil.isArray(option.series)) {\n return;\n }\n // Translate 'k' to 'candlestick'.\n zrUtil.each(option.series, function (seriesItem) {\n if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {\n seriesItem.type = 'candlestick';\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { extend } from 'zrender/lib/core/util.js';\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\nvar dojiBorderColorQuery = ['itemStyle', 'borderColorDoji'];\nvar positiveColorQuery = ['itemStyle', 'color'];\nvar negativeColorQuery = ['itemStyle', 'color0'];\nvar candlestickVisual = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n function getColor(sign, model) {\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\n }\n function getBorderColor(sign, model) {\n return model.get(sign === 0 ? dojiBorderColorQuery : sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\n }\n // Only visible series has each data be visual encoded\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n var isLargeRender = seriesModel.pipelineContext.large;\n return !isLargeRender && {\n progress: function (params, data) {\n var dataIndex;\n while ((dataIndex = params.next()) != null) {\n var itemModel = data.getItemModel(dataIndex);\n var sign = data.getItemLayout(dataIndex).sign;\n var style = itemModel.getItemStyle();\n style.fill = getColor(sign, itemModel);\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n extend(existsStyle, style);\n }\n }\n };\n }\n};\nexport default candlestickVisual;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { subPixelOptimize } from '../../util/graphic.js';\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { parsePercent } from '../../util/number.js';\nimport { map, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nvar candlestickLayout = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var candleWidth = calculateCandleWidth(seriesModel, data);\n var cDimIdx = 0;\n var vDimIdx = 1;\n var coordDims = ['x', 'y'];\n var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx]));\n var vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data);\n var openDimI = vDimsI[0];\n var closeDimI = vDimsI[1];\n var lowestDimI = vDimsI[2];\n var highestDimI = vDimsI[3];\n data.setLayout({\n candleWidth: candleWidth,\n // The value is experimented visually.\n isSimpleBox: candleWidth <= 1.3\n });\n if (cDimI < 0 || vDimsI.length < 4) {\n return;\n }\n return {\n progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress\n };\n function normalProgress(params, data) {\n var dataIndex;\n var store = data.getStore();\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = store.get(cDimI, dataIndex);\n var openVal = store.get(openDimI, dataIndex);\n var closeVal = store.get(closeDimI, dataIndex);\n var lowestVal = store.get(lowestDimI, dataIndex);\n var highestVal = store.get(highestDimI, dataIndex);\n var ocLow = Math.min(openVal, closeVal);\n var ocHigh = Math.max(openVal, closeVal);\n var ocLowPoint = getPoint(ocLow, axisDimVal);\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\n var lowestPoint = getPoint(lowestVal, axisDimVal);\n var highestPoint = getPoint(highestVal, axisDimVal);\n var ends = [];\n addBodyEnd(ends, ocHighPoint, 0);\n addBodyEnd(ends, ocLowPoint, 1);\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\n var itemModel = data.getItemModel(dataIndex);\n var hasDojiColor = !!itemModel.get(['itemStyle', 'borderColorDoji']);\n data.setItemLayout(dataIndex, {\n sign: getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor),\n initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\n ends: ends,\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\n });\n }\n function getPoint(val, axisDimVal) {\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p);\n }\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] = subPixelOptimize(point1[cDimIdx] + candleWidth / 2, 1, false);\n point2[cDimIdx] = subPixelOptimize(point2[cDimIdx] - candleWidth / 2, 1, true);\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\n var pmin = getPoint(lowestVal, axisDimVal);\n var pmax = getPoint(highestVal, axisDimVal);\n pmin[cDimIdx] -= candleWidth / 2;\n pmax[cDimIdx] -= candleWidth / 2;\n return {\n x: pmin[0],\n y: pmin[1],\n width: vDimIdx ? candleWidth : pmax[0] - pmin[0],\n height: vDimIdx ? pmax[1] - pmin[1] : candleWidth\n };\n }\n function subPixelOptimizePoint(point) {\n point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);\n return point;\n }\n }\n function largeProgress(params, data) {\n // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]\n var points = createFloat32Array(params.count * 4);\n var offset = 0;\n var point;\n var tmpIn = [];\n var tmpOut = [];\n var dataIndex;\n var store = data.getStore();\n var hasDojiColor = !!seriesModel.get(['itemStyle', 'borderColorDoji']);\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = store.get(cDimI, dataIndex);\n var openVal = store.get(openDimI, dataIndex);\n var closeVal = store.get(closeDimI, dataIndex);\n var lowestVal = store.get(lowestDimI, dataIndex);\n var highestVal = store.get(highestDimI, dataIndex);\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\n points[offset++] = NaN;\n offset += 3;\n continue;\n }\n points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor);\n tmpIn[cDimIdx] = axisDimVal;\n tmpIn[vDimIdx] = lowestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n tmpIn[vDimIdx] = highestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[1] : NaN;\n }\n data.setLayout('largePoints', points);\n }\n }\n};\n/**\n * Get the sign of a single data.\n *\n * @returns 0 for doji with hasDojiColor: true,\n * 1 for positive,\n * -1 for negative.\n */\nfunction getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor) {\n var sign;\n if (openVal > closeVal) {\n sign = -1;\n } else if (openVal < closeVal) {\n sign = 1;\n } else {\n sign = hasDojiColor\n // When doji color is set, use it instead of color/color0.\n ? 0 : dataIndex > 0\n // If close === open, compare with close of last record\n ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1\n // No record of previous, set to be positive\n : 1;\n }\n return sign;\n}\nfunction calculateCandleWidth(seriesModel, data) {\n var baseAxis = seriesModel.getBaseAxis();\n var extent;\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count());\n var barMaxWidth = parsePercent(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\n var barMinWidth = parsePercent(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\n var barWidth = seriesModel.get('barWidth');\n return barWidth != null ? parsePercent(barWidth, bandWidth)\n // Put max outer to ensure bar visible in spite of overlap.\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\n}\nexport default candlestickLayout;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CandlestickView from './CandlestickView.js';\nimport CandlestickSeriesModel from './CandlestickSeries.js';\nimport preprocessor from './preprocessor.js';\nimport candlestickVisual from './candlestickVisual.js';\nimport candlestickLayout from './candlestickLayout.js';\nexport function install(registers) {\n registers.registerChartView(CandlestickView);\n registers.registerSeriesModel(CandlestickSeriesModel);\n registers.registerPreprocessor(preprocessor);\n registers.registerVisual(candlestickVisual);\n registers.registerLayout(candlestickLayout);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport SymbolClz from './Symbol.js';\nfunction updateRipplePath(rippleGroup, effectCfg) {\n var color = effectCfg.rippleEffectColor || effectCfg.color;\n rippleGroup.eachChild(function (ripplePath) {\n ripplePath.attr({\n z: effectCfg.z,\n zlevel: effectCfg.zlevel,\n style: {\n stroke: effectCfg.brushType === 'stroke' ? color : null,\n fill: effectCfg.brushType === 'fill' ? color : null\n }\n });\n });\n}\nvar EffectSymbol = /** @class */function (_super) {\n __extends(EffectSymbol, _super);\n function EffectSymbol(data, idx) {\n var _this = _super.call(this) || this;\n var symbol = new SymbolClz(data, idx);\n var rippleGroup = new Group();\n _this.add(symbol);\n _this.add(rippleGroup);\n _this.updateData(data, idx);\n return _this;\n }\n EffectSymbol.prototype.stopEffectAnimation = function () {\n this.childAt(1).removeAll();\n };\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\n var symbolType = effectCfg.symbolType;\n var color = effectCfg.color;\n var rippleNumber = effectCfg.rippleNumber;\n var rippleGroup = this.childAt(1);\n for (var i = 0; i < rippleNumber; i++) {\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4136.\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\n ripplePath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 99,\n silent: true,\n scaleX: 0.5,\n scaleY: 0.5\n });\n var delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset;\n ripplePath.animate('', true).when(effectCfg.period, {\n scaleX: effectCfg.rippleScale / 2,\n scaleY: effectCfg.rippleScale / 2\n }).delay(delay).start();\n ripplePath.animateStyle(true).when(effectCfg.period, {\n opacity: 0\n }).delay(delay).start();\n rippleGroup.add(ripplePath);\n }\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\n * Update effect symbol\n */\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\n var oldEffectCfg = this._effectCfg;\n var rippleGroup = this.childAt(1);\n // Must reinitialize effect if following configuration changed\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber'];\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\n var propName = DIFFICULT_PROPS[i];\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\n this.stopEffectAnimation();\n this.startEffectAnimation(effectCfg);\n return;\n }\n }\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\n * Highlight symbol\n */\n EffectSymbol.prototype.highlight = function () {\n enterEmphasis(this);\n };\n /**\n * Downplay symbol\n */\n EffectSymbol.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n EffectSymbol.prototype.getSymbolType = function () {\n var symbol = this.childAt(0);\n return symbol && symbol.getSymbolType();\n };\n /**\n * Update symbol properties\n */\n EffectSymbol.prototype.updateData = function (data, idx) {\n var _this = this;\n var seriesModel = data.hostModel;\n this.childAt(0).updateData(data, idx);\n var rippleGroup = this.childAt(1);\n var itemModel = data.getItemModel(idx);\n var symbolType = data.getItemVisual(idx, 'symbol');\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolStyle = data.getItemVisual(idx, 'style');\n var color = symbolStyle && symbolStyle.fill;\n var emphasisModel = itemModel.getModel('emphasis');\n rippleGroup.setScale(symbolSize);\n rippleGroup.traverse(function (ripplePath) {\n ripplePath.setStyle('fill', color);\n });\n var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n if (symbolOffset) {\n rippleGroup.x = symbolOffset[0];\n rippleGroup.y = symbolOffset[1];\n }\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var effectCfg = {};\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\n effectCfg.effectOffset = idx / data.count();\n effectCfg.z = seriesModel.getShallow('z') || 0;\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\n effectCfg.symbolType = symbolType;\n effectCfg.color = color;\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\n effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']);\n if (effectCfg.showEffectOn === 'render') {\n this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg);\n this._effectCfg = effectCfg;\n } else {\n // Not keep old effect config\n this._effectCfg = null;\n this.stopEffectAnimation();\n this.onHoverStateChange = function (toState) {\n if (toState === 'emphasis') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.startEffectAnimation(effectCfg);\n }\n } else if (toState === 'normal') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.stopEffectAnimation();\n }\n }\n };\n }\n this._effectCfg = effectCfg;\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n ;\n EffectSymbol.prototype.fadeOut = function (cb) {\n cb && cb();\n };\n ;\n return EffectSymbol;\n}(Group);\nexport default EffectSymbol;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport EffectSymbol from '../helper/EffectSymbol.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\nvar EffectScatterView = /** @class */function (_super) {\n __extends(EffectScatterView, _super);\n function EffectScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = EffectScatterView.type;\n return _this;\n }\n EffectScatterView.prototype.init = function () {\n this._symbolDraw = new SymbolDraw(EffectSymbol);\n };\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var effectSymbolDraw = this._symbolDraw;\n effectSymbolDraw.updateData(data, {\n clipShape: this._getClipShape(seriesModel)\n });\n this.group.add(effectSymbolDraw.group);\n };\n EffectScatterView.prototype._getClipShape = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n return seriesModel.get('clip', true) ? clipArea : null;\n };\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n this.group.dirty();\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n this._symbolDraw.updateLayout();\n };\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys && coordSys.getRoamTransform) {\n this.group.transform = matrix.clone(coordSys.getRoamTransform());\n this.group.decomposeTransform();\n }\n };\n EffectScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n };\n EffectScatterView.type = 'effectScatter';\n return EffectScatterView;\n}(ChartView);\nexport default EffectScatterView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nvar EffectScatterSeriesModel = /** @class */function (_super) {\n __extends(EffectScatterSeriesModel, _super);\n function EffectScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = EffectScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n EffectScatterSeriesModel.type = 'series.effectScatter';\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\n EffectScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n effectType: 'ripple',\n progressive: 0,\n // When to show the effect, option: 'render'|'emphasis'\n showEffectOn: 'render',\n clip: true,\n // Ripple effect config\n rippleEffect: {\n period: 4,\n // Scale of ripple\n scale: 2.5,\n // Brush type can be fill or stroke\n brushType: 'fill',\n // Ripple number\n number: 3\n },\n universalTransition: {\n divideShape: 'clone'\n },\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n // symbol: null, // 图形类型\n symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2\n // symbolRotate: null, // 图形旋转控制\n // itemStyle: {\n // opacity: 1\n // }\n };\n\n return EffectScatterSeriesModel;\n}(SeriesModel);\nexport default EffectScatterSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport EffectScatterView from './EffectScatterView.js';\nimport EffectScatterSeriesModel from './EffectScatterSeries.js';\nimport layoutPoints from '../../layout/points.js';\nexport function install(registers) {\n registers.registerChartView(EffectScatterView);\n registers.registerSeriesModel(EffectScatterSeriesModel);\n registers.registerLayout(layoutPoints('effectScatter'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Provide effect for line\n */\nimport * as graphic from '../../util/graphic.js';\nimport Line from './Line.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as curveUtil from 'zrender/lib/core/curve.js';\nvar EffectLine = /** @class */function (_super) {\n __extends(EffectLine, _super);\n function EffectLine(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n _this.add(_this.createLine(lineData, idx, seriesScope));\n _this._updateEffectSymbol(lineData, idx);\n return _this;\n }\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Line(lineData, idx, seriesScope);\n };\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\n var itemModel = lineData.getItemModel(idx);\n var effectModel = itemModel.getModel('effect');\n var size = effectModel.get('symbolSize');\n var symbolType = effectModel.get('symbol');\n if (!zrUtil.isArray(size)) {\n size = [size, size];\n }\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var color = effectModel.get('color') || lineStyle && lineStyle.stroke;\n var symbol = this.childAt(1);\n if (this._symbolType !== symbolType) {\n // Remove previous\n this.remove(symbol);\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n symbol.z2 = 100;\n symbol.culling = true;\n this.add(symbol);\n }\n // Symbol may be removed if loop is false\n if (!symbol) {\n return;\n }\n // Shadow color is same with color in default\n symbol.setStyle('shadowColor', color);\n symbol.setStyle(effectModel.getItemStyle(['color']));\n symbol.scaleX = size[0];\n symbol.scaleY = size[1];\n symbol.setColor(color);\n this._symbolType = symbolType;\n this._symbolScale = size;\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\n var symbol = this.childAt(1);\n if (!symbol) {\n return;\n }\n var points = lineData.getItemLayout(idx);\n var period = effectModel.get('period') * 1000;\n var loop = effectModel.get('loop');\n var roundTrip = effectModel.get('roundTrip');\n var constantSpeed = effectModel.get('constantSpeed');\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n return idx / lineData.count() * period / 3;\n });\n // Ignore when updating\n symbol.ignore = true;\n this._updateAnimationPoints(symbol, points);\n if (constantSpeed > 0) {\n period = this._getLineLength(symbol) / constantSpeed * 1000;\n }\n if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) {\n symbol.stopAnimation();\n var delayNum = void 0;\n if (zrUtil.isFunction(delayExpr)) {\n delayNum = delayExpr(idx);\n } else {\n delayNum = delayExpr;\n }\n if (symbol.__t > 0) {\n delayNum = -period * symbol.__t;\n }\n this._animateSymbol(symbol, period, delayNum, loop, roundTrip);\n }\n this._period = period;\n this._loop = loop;\n this._roundTrip = roundTrip;\n };\n EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop, roundTrip) {\n if (period > 0) {\n symbol.__t = 0;\n var self_1 = this;\n var animator = symbol.animate('', loop).when(roundTrip ? period * 2 : period, {\n __t: roundTrip ? 2 : 1\n }).delay(delayNum).during(function () {\n self_1._updateSymbolPosition(symbol);\n });\n if (!loop) {\n animator.done(function () {\n self_1.remove(symbol);\n });\n }\n animator.start();\n }\n };\n EffectLine.prototype._getLineLength = function (symbol) {\n // Not so accurate\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n };\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\n symbol.__p1 = points[0];\n symbol.__p2 = points[1];\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n };\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\n this.childAt(0).updateData(lineData, idx, seriesScope);\n this._updateEffectSymbol(lineData, idx);\n };\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\n var p1 = symbol.__p1;\n var p2 = symbol.__p2;\n var cp1 = symbol.__cp1;\n var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n var pos = [symbol.x, symbol.y];\n var lastPos = pos.slice();\n var quadraticAt = curveUtil.quadraticAt;\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t);\n // Tangent\n var tx = symbol.__t < 1 ? quadraticDerivativeAt(p1[0], cp1[0], p2[0], t) : quadraticDerivativeAt(p2[0], cp1[0], p1[0], 1 - t);\n var ty = symbol.__t < 1 ? quadraticDerivativeAt(p1[1], cp1[1], p2[1], t) : quadraticDerivativeAt(p2[1], cp1[1], p1[1], 1 - t);\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\n symbol.scaleY = vec2.dist(lastPos, pos) * 1.05;\n // make sure the last segment render within endPoint\n if (t === 1) {\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\n }\n } else if (symbol.__lastT === 1) {\n // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\n symbol.scaleY = 2 * vec2.dist(p1, pos);\n } else {\n symbol.scaleY = this._symbolScale[1];\n }\n }\n symbol.__lastT = symbol.__t;\n symbol.ignore = false;\n symbol.x = pos[0];\n symbol.y = pos[1];\n };\n EffectLine.prototype.updateLayout = function (lineData, idx) {\n this.childAt(0).updateLayout(lineData, idx);\n var effectModel = lineData.getItemModel(idx).getModel('effect');\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n return EffectLine;\n}(graphic.Group);\nexport default EffectLine;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nvar Polyline = /** @class */function (_super) {\n __extends(Polyline, _super);\n function Polyline(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n _this._createPolyline(lineData, idx, seriesScope);\n return _this;\n }\n Polyline.prototype._createPolyline = function (lineData, idx, seriesScope) {\n // let seriesModel = lineData.hostModel;\n var points = lineData.getItemLayout(idx);\n var line = new graphic.Polyline({\n shape: {\n points: points\n }\n });\n this.add(line);\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n ;\n Polyline.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childAt(0);\n var target = {\n shape: {\n points: lineData.getItemLayout(idx)\n }\n };\n graphic.updateProps(line, target, seriesModel, idx);\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n ;\n Polyline.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var line = this.childAt(0);\n var itemModel = lineData.getItemModel(idx);\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var focus = seriesScope && seriesScope.focus;\n var blurScope = seriesScope && seriesScope.blurScope;\n var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n if (!seriesScope || lineData.hasItemOption) {\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n emphasisDisabled = emphasisModel.get('disabled');\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n }\n line.useStyle(lineData.getItemVisual(idx, 'style'));\n line.style.fill = null;\n line.style.strokeNoScale = true;\n var lineEmphasisState = line.ensureState('emphasis');\n lineEmphasisState.style = emphasisLineStyle;\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n ;\n Polyline.prototype.updateLayout = function (lineData, idx) {\n var polyline = this.childAt(0);\n polyline.setShape('points', lineData.getItemLayout(idx));\n };\n ;\n return Polyline;\n}(graphic.Group);\nexport default Polyline;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Polyline from './Polyline.js';\nimport EffectLine from './EffectLine.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar EffectPolyline = /** @class */function (_super) {\n __extends(EffectPolyline, _super);\n function EffectPolyline() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._lastFrame = 0;\n _this._lastFramePercent = 0;\n return _this;\n }\n // Override\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Polyline(lineData, idx, seriesScope);\n };\n ;\n // Override\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\n this._points = points;\n var accLenArr = [0];\n var len = 0;\n for (var i = 1; i < points.length; i++) {\n var p1 = points[i - 1];\n var p2 = points[i];\n len += vec2.dist(p1, p2);\n accLenArr.push(len);\n }\n if (len === 0) {\n this._length = 0;\n return;\n }\n for (var i = 0; i < accLenArr.length; i++) {\n accLenArr[i] /= len;\n }\n this._offsets = accLenArr;\n this._length = len;\n };\n ;\n // Override\n EffectPolyline.prototype._getLineLength = function () {\n return this._length;\n };\n ;\n // Override\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\n var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n var points = this._points;\n var offsets = this._offsets;\n var len = points.length;\n if (!offsets) {\n // Has length 0\n return;\n }\n var lastFrame = this._lastFrame;\n var frame;\n if (t < this._lastFramePercent) {\n // Start from the next frame\n // PENDING start from lastFrame ?\n var start = Math.min(lastFrame + 1, len - 1);\n for (frame = start; frame >= 0; frame--) {\n if (offsets[frame] <= t) {\n break;\n }\n }\n // PENDING really need to do this ?\n frame = Math.min(frame, len - 2);\n } else {\n for (frame = lastFrame; frame < len; frame++) {\n if (offsets[frame] > t) {\n break;\n }\n }\n frame = Math.min(frame - 1, len - 2);\n }\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\n var p0 = points[frame];\n var p1 = points[frame + 1];\n symbol.x = p0[0] * (1 - p) + p * p1[0];\n symbol.y = p0[1] * (1 - p) + p * p1[1];\n var tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0];\n var ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1];\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n this._lastFrame = frame;\n this._lastFramePercent = t;\n symbol.ignore = false;\n };\n ;\n return EffectPolyline;\n}(EffectLine);\nexport default EffectPolyline;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// TODO Batch by color\nimport * as graphic from '../../util/graphic.js';\nimport * as lineContain from 'zrender/lib/contain/line.js';\nimport * as quadraticContain from 'zrender/lib/contain/quadratic.js';\nimport { getECData } from '../../util/innerStore.js';\nvar LargeLinesPathShape = /** @class */function () {\n function LargeLinesPathShape() {\n this.polyline = false;\n this.curveness = 0;\n this.segs = [];\n }\n return LargeLinesPathShape;\n}();\nvar LargeLinesPath = /** @class */function (_super) {\n __extends(LargeLinesPath, _super);\n function LargeLinesPath(opts) {\n var _this = _super.call(this, opts) || this;\n _this._off = 0;\n _this.hoverDataIdx = -1;\n return _this;\n }\n LargeLinesPath.prototype.reset = function () {\n this.notClear = false;\n this._off = 0;\n };\n LargeLinesPath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n LargeLinesPath.prototype.getDefaultShape = function () {\n return new LargeLinesPathShape();\n };\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\n var segs = shape.segs;\n var curveness = shape.curveness;\n var i;\n if (shape.polyline) {\n for (i = this._off; i < segs.length;) {\n var count = segs[i++];\n if (count > 0) {\n ctx.moveTo(segs[i++], segs[i++]);\n for (var k = 1; k < count; k++) {\n ctx.lineTo(segs[i++], segs[i++]);\n }\n }\n }\n } else {\n for (i = this._off; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n ctx.moveTo(x0, y0);\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n ctx.quadraticCurveTo(x2, y2, x1, y1);\n } else {\n ctx.lineTo(x1, y1);\n }\n }\n }\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\n var shape = this.shape;\n var segs = shape.segs;\n var curveness = shape.curveness;\n var lineWidth = this.style.lineWidth;\n if (shape.polyline) {\n var dataIndex = 0;\n for (var i = 0; i < segs.length;) {\n var count = segs[i++];\n if (count > 0) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n for (var k = 1; k < count; k++) {\n var x1 = segs[i++];\n var y1 = segs[i++];\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n }\n dataIndex++;\n }\n } else {\n var dataIndex = 0;\n for (var i = 0; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n if (quadraticContain.containStroke(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n } else {\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n dataIndex++;\n }\n }\n return -1;\n };\n LargeLinesPath.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n x = localPos[0];\n y = localPos[1];\n if (rect.contain(x, y)) {\n // Cache found data index.\n var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n return dataIdx >= 0;\n }\n this.hoverDataIdx = -1;\n return false;\n };\n LargeLinesPath.prototype.getBoundingRect = function () {\n // Ignore stroke for large symbol draw.\n var rect = this._rect;\n if (!rect) {\n var shape = this.shape;\n var points = shape.segs;\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n rect = this._rect = new graphic.BoundingRect(minX, minY, maxX, maxY);\n }\n return rect;\n };\n return LargeLinesPath;\n}(graphic.Path);\nvar LargeLineDraw = /** @class */function () {\n function LargeLineDraw() {\n this.group = new graphic.Group();\n }\n /**\n * Update symbols draw by new data\n */\n LargeLineDraw.prototype.updateData = function (data) {\n this._clear();\n var lineEl = this._create();\n lineEl.setShape({\n segs: data.getLayout('linesPoints')\n });\n this._setCommon(lineEl, data);\n };\n ;\n /**\n * @override\n */\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\n this.group.removeAll();\n this._clear();\n };\n ;\n /**\n * @override\n */\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\n var lastAdded = this._newAdded[0];\n var linePoints = data.getLayout('linesPoints');\n var oldSegs = lastAdded && lastAdded.shape.segs;\n // Merging the exists. Each element has 1e4 points.\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n if (oldSegs && oldSegs.length < 2e4) {\n var oldLen = oldSegs.length;\n var newSegs = new Float32Array(oldLen + linePoints.length);\n // Concat two array\n newSegs.set(oldSegs);\n newSegs.set(linePoints, oldLen);\n lastAdded.setShape({\n segs: newSegs\n });\n } else {\n // Clear\n this._newAdded = [];\n var lineEl = this._create();\n lineEl.incremental = true;\n lineEl.setShape({\n segs: linePoints\n });\n this._setCommon(lineEl, data);\n lineEl.__startIndex = taskParams.start;\n }\n };\n /**\n * @override\n */\n LargeLineDraw.prototype.remove = function () {\n this._clear();\n };\n LargeLineDraw.prototype.eachRendered = function (cb) {\n this._newAdded[0] && cb(this._newAdded[0]);\n };\n LargeLineDraw.prototype._create = function () {\n var lineEl = new LargeLinesPath({\n cursor: 'default',\n ignoreCoarsePointer: true\n });\n this._newAdded.push(lineEl);\n this.group.add(lineEl);\n return lineEl;\n };\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\n var hostModel = data.hostModel;\n lineEl.setShape({\n polyline: hostModel.get('polyline'),\n curveness: hostModel.get(['lineStyle', 'curveness'])\n });\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\n lineEl.style.strokeNoScale = true;\n var style = data.getVisual('style');\n if (style && style.stroke) {\n lineEl.setStyle('stroke', style.stroke);\n }\n lineEl.setStyle('fill', null);\n var ecData = getECData(lineEl);\n // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n ecData.seriesIndex = hostModel.seriesIndex;\n lineEl.on('mousemove', function (e) {\n ecData.dataIndex = null;\n var dataIndex = lineEl.hoverDataIdx;\n if (dataIndex > 0) {\n // Provide dataIndex for tooltip\n ecData.dataIndex = dataIndex + lineEl.__startIndex;\n }\n });\n };\n ;\n LargeLineDraw.prototype._clear = function () {\n this._newAdded = [];\n this.group.removeAll();\n };\n ;\n return LargeLineDraw;\n}();\nexport default LargeLineDraw;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/* global Float32Array */\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { error } from '../../util/log.js';\nvar linesLayout = {\n seriesType: 'lines',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n if (!coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n error('The lines series must have a coordinate system.');\n }\n return;\n }\n var isPolyline = seriesModel.get('polyline');\n var isLarge = seriesModel.pipelineContext.large;\n return {\n progress: function (params, lineData) {\n var lineCoords = [];\n if (isLarge) {\n var points = void 0;\n var segCount = params.end - params.start;\n if (isPolyline) {\n var totalCoordsCount = 0;\n for (var i = params.start; i < params.end; i++) {\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\n }\n points = new Float32Array(segCount + totalCoordsCount * 2);\n } else {\n points = new Float32Array(segCount * 4);\n }\n var offset = 0;\n var pt = [];\n for (var i = params.start; i < params.end; i++) {\n var len = seriesModel.getLineCoords(i, lineCoords);\n if (isPolyline) {\n points[offset++] = len;\n }\n for (var k = 0; k < len; k++) {\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\n points[offset++] = pt[0];\n points[offset++] = pt[1];\n }\n }\n lineData.setLayout('linesPoints', points);\n } else {\n for (var i = params.start; i < params.end; i++) {\n var itemModel = lineData.getItemModel(i);\n var len = seriesModel.getLineCoords(i, lineCoords);\n var pts = [];\n if (isPolyline) {\n for (var j = 0; j < len; j++) {\n pts.push(coordSys.dataToPoint(lineCoords[j]));\n }\n } else {\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\n var curveness = itemModel.get(['lineStyle', 'curveness']);\n if (+curveness) {\n 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];\n }\n }\n lineData.setItemLayout(i, pts);\n }\n }\n }\n };\n }\n};\nexport default linesLayout;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport LineDraw from '../helper/LineDraw.js';\nimport EffectLine from '../helper/EffectLine.js';\nimport Line from '../helper/Line.js';\nimport Polyline from '../helper/Polyline.js';\nimport EffectPolyline from '../helper/EffectPolyline.js';\nimport LargeLineDraw from '../helper/LargeLineDraw.js';\nimport linesLayout from './linesLayout.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport ChartView from '../../view/Chart.js';\nvar LinesView = /** @class */function (_super) {\n __extends(LinesView, _super);\n function LinesView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = LinesView.type;\n return _this;\n }\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var lineDraw = this._updateLineDraw(data, seriesModel);\n var zlevel = seriesModel.get('zlevel');\n var trailLength = seriesModel.get(['effect', 'trailLength']);\n var zr = api.getZr();\n // Avoid the drag cause ghost shadow\n // FIXME Better way ?\n // SVG doesn't support\n var isSvg = zr.painter.getType() === 'svg';\n if (!isSvg) {\n zr.painter.getLayer(zlevel).clear(true);\n }\n // Config layer with motion blur\n if (this._lastZlevel != null && !isSvg) {\n zr.configLayer(this._lastZlevel, {\n motionBlur: false\n });\n }\n if (this._showEffect(seriesModel) && trailLength > 0) {\n if (!isSvg) {\n zr.configLayer(zlevel, {\n motionBlur: true,\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n });\n } else if (process.env.NODE_ENV !== 'production') {\n console.warn('SVG render mode doesn\\'t support lines with trail effect');\n }\n }\n lineDraw.updateData(data);\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n this._lastZlevel = zlevel;\n this._finished = true;\n };\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var lineDraw = this._updateLineDraw(data, seriesModel);\n lineDraw.incrementalPrepareUpdate(data);\n this._clearLayer(api);\n this._finished = false;\n };\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n LinesView.prototype.eachRendered = function (cb) {\n this._lineDraw && this._lineDraw.eachRendered(cb);\n };\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var pipelineContext = seriesModel.pipelineContext;\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n return {\n update: true\n };\n } else {\n // TODO Use same logic with ScatterView.\n // Manually update layout\n var res = linesLayout.reset(seriesModel, ecModel, api);\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n // Not in large mode\n this._lineDraw.updateLayout();\n this._clearLayer(api);\n }\n };\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\n var lineDraw = this._lineDraw;\n var hasEffect = this._showEffect(seriesModel);\n var isPolyline = !!seriesModel.get('polyline');\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n if (process.env.NODE_ENV !== 'production') {\n if (hasEffect && isLargeDraw) {\n console.warn('Large lines not support effect');\n }\n }\n if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n if (lineDraw) {\n lineDraw.remove();\n }\n lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n this._hasEffet = hasEffect;\n this._isPolyline = isPolyline;\n this._isLargeDraw = isLargeDraw;\n }\n this.group.add(lineDraw.group);\n return lineDraw;\n };\n LinesView.prototype._showEffect = function (seriesModel) {\n return !!seriesModel.get(['effect', 'show']);\n };\n LinesView.prototype._clearLayer = function (api) {\n // Not use motion when dragging or zooming\n var zr = api.getZr();\n var isSvg = zr.painter.getType() === 'svg';\n if (!isSvg && this._lastZlevel != null) {\n zr.painter.getLayer(this._lastZlevel).clear(true);\n }\n };\n LinesView.prototype.remove = function (ecModel, api) {\n this._lineDraw && this._lineDraw.remove();\n this._lineDraw = null;\n // Clear motion when lineDraw is removed\n this._clearLayer(api);\n };\n LinesView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n LinesView.type = 'lines';\n return LinesView;\n}(ChartView);\nexport default LinesView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global Uint32Array, Float64Array, Float32Array */\nimport SeriesModel from '../../model/Series.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { concatArray, mergeAll, map, isNumber } from 'zrender/lib/core/util.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\nfunction compatEc2(seriesOpt) {\n var data = seriesOpt.data;\n if (data && data[0] && data[0][0] && data[0][0].coord) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }');\n }\n seriesOpt.data = map(data, function (itemOpt) {\n var coords = [itemOpt[0].coord, itemOpt[1].coord];\n var target = {\n coords: coords\n };\n if (itemOpt[0].name) {\n target.fromName = itemOpt[0].name;\n }\n if (itemOpt[1].name) {\n target.toName = itemOpt[1].name;\n }\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\n });\n }\n}\nvar LinesSeriesModel = /** @class */function (_super) {\n __extends(LinesSeriesModel, _super);\n function LinesSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = LinesSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n LinesSeriesModel.prototype.init = function (option) {\n // The input data may be null/undefined.\n option.data = option.data || [];\n // Not using preprocessor because mergeOption may not have series.type\n compatEc2(option);\n var result = this._processFlatCoordsArray(option.data);\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n _super.prototype.init.apply(this, arguments);\n };\n LinesSeriesModel.prototype.mergeOption = function (option) {\n compatEc2(option);\n if (option.data) {\n // Only update when have option data to merge.\n var result = this._processFlatCoordsArray(option.data);\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n }\n _super.prototype.mergeOption.apply(this, arguments);\n };\n LinesSeriesModel.prototype.appendData = function (params) {\n var result = this._processFlatCoordsArray(params.data);\n if (result.flatCoords) {\n if (!this._flatCoords) {\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n } else {\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\n }\n params.data = new Float32Array(result.count);\n }\n this.getRawData().appendData(params.data);\n };\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\n var itemModel = this.getData().getItemModel(idx);\n var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords');\n if (process.env.NODE_ENV !== 'production') {\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\n }\n }\n return coords;\n };\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\n if (this._flatCoordsOffset) {\n return this._flatCoordsOffset[idx * 2 + 1];\n } else {\n return this._getCoordsFromItemModel(idx).length;\n }\n };\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\n if (this._flatCoordsOffset) {\n var offset = this._flatCoordsOffset[idx * 2];\n var len = this._flatCoordsOffset[idx * 2 + 1];\n for (var i = 0; i < len; i++) {\n out[i] = out[i] || [];\n out[i][0] = this._flatCoords[offset + i * 2];\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\n }\n return len;\n } else {\n var coords = this._getCoordsFromItemModel(idx);\n for (var i = 0; i < coords.length; i++) {\n out[i] = out[i] || [];\n out[i][0] = coords[i][0];\n out[i][1] = coords[i][1];\n }\n return coords.length;\n }\n };\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\n var startOffset = 0;\n if (this._flatCoords) {\n startOffset = this._flatCoords.length;\n }\n // Stored as a typed array. In format\n // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |\n if (isNumber(data[0])) {\n var len = data.length;\n // Store offset and len of each segment\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\n var coordsStorage = new Float64Arr(len);\n var coordsCursor = 0;\n var offsetCursor = 0;\n var dataCount = 0;\n for (var i = 0; i < len;) {\n dataCount++;\n var count = data[i++];\n // Offset\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;\n // Len\n coordsOffsetAndLenStorage[offsetCursor++] = count;\n for (var k = 0; k < count; k++) {\n var x = data[i++];\n var y = data[i++];\n coordsStorage[coordsCursor++] = x;\n coordsStorage[coordsCursor++] = y;\n if (i > len) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Invalid data format.');\n }\n }\n }\n }\n return {\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\n flatCoords: coordsStorage,\n count: dataCount\n };\n }\n return {\n flatCoordsOffset: null,\n flatCoords: null,\n count: data.length\n };\n };\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n var CoordSys = CoordinateSystem.get(option.coordinateSystem);\n if (!CoordSys) {\n throw new Error('Unknown coordinate system ' + option.coordinateSystem);\n }\n }\n var lineData = new SeriesData(['value'], this);\n lineData.hasItemOption = false;\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\n // dataItem is simply coords\n if (dataItem instanceof Array) {\n return NaN;\n } else {\n lineData.hasItemOption = true;\n var value = dataItem.value;\n if (value != null) {\n return value instanceof Array ? value[dimIndex] : value;\n }\n }\n });\n return lineData;\n };\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var itemModel = data.getItemModel(dataIndex);\n var name = itemModel.get('name');\n if (name) {\n return name;\n }\n var fromName = itemModel.get('fromName');\n var toName = itemModel.get('toName');\n var nameArr = [];\n fromName != null && nameArr.push(fromName);\n toName != null && nameArr.push(toName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > ')\n });\n };\n LinesSeriesModel.prototype.preventIncremental = function () {\n return !!this.get(['effect', 'show']);\n };\n LinesSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n if (progressive == null) {\n return this.option.large ? 1e4 : this.get('progressive');\n }\n return progressive;\n };\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n if (progressiveThreshold == null) {\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\n }\n return progressiveThreshold;\n };\n LinesSeriesModel.prototype.getZLevelKey = function () {\n var effectModel = this.getModel('effect');\n var trailLength = effectModel.get('trailLength');\n return this.getData().count() > this.getProgressiveThreshold()\n // Each progressive series has individual key.\n ? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : '';\n };\n LinesSeriesModel.type = 'series.lines';\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\n LinesSeriesModel.defaultOption = {\n coordinateSystem: 'geo',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Cartesian coordinate system\n xAxisIndex: 0,\n yAxisIndex: 0,\n symbol: ['none', 'none'],\n symbolSize: [10, 10],\n // Geo coordinate system\n geoIndex: 0,\n effect: {\n show: false,\n period: 4,\n constantSpeed: 0,\n symbol: 'circle',\n symbolSize: 3,\n loop: true,\n trailLength: 0.2\n },\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n polyline: false,\n clip: true,\n label: {\n show: false,\n position: 'end'\n // distance: 5,\n // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n },\n\n lineStyle: {\n opacity: 0.5\n }\n };\n return LinesSeriesModel;\n}(SeriesModel);\nexport default LinesSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n return a;\n}\nvar linesVisual = {\n seriesType: 'lines',\n reset: function (seriesModel) {\n var symbolType = normalize(seriesModel.get('symbol'));\n var symbolSize = normalize(seriesModel.get('symbolSize'));\n var data = seriesModel.getData();\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\n data.setVisual('toSymbol', symbolType && symbolType[1]);\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\n }\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport default linesVisual;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LinesView from './LinesView.js';\nimport LinesSeriesModel from './LinesSeries.js';\nimport linesLayout from './linesLayout.js';\nimport linesVisual from './linesVisual.js';\nexport function install(registers) {\n registers.registerChartView(LinesView);\n registers.registerSeriesModel(LinesSeriesModel);\n registers.registerLayout(linesLayout);\n registers.registerVisual(linesVisual);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/* global Uint8ClampedArray */\nimport { platformApi } from 'zrender/lib/core/platform.js';\nvar GRADIENT_LEVELS = 256;\nvar HeatmapLayer = /** @class */function () {\n function HeatmapLayer() {\n this.blurSize = 30;\n this.pointSize = 20;\n this.maxOpacity = 1;\n this.minOpacity = 0;\n this._gradientPixels = {\n inRange: null,\n outOfRange: null\n };\n var canvas = platformApi.createCanvas();\n this.canvas = canvas;\n }\n /**\n * Renders Heatmap and returns the rendered canvas\n * @param data array of data, each has x, y, value\n * @param width canvas width\n * @param height canvas height\n */\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\n var brush = this._getBrush();\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\n var r = this.pointSize + this.blurSize;\n var canvas = this.canvas;\n var ctx = canvas.getContext('2d');\n var len = data.length;\n canvas.width = width;\n canvas.height = height;\n for (var i = 0; i < len; ++i) {\n var p = data[i];\n var x = p[0];\n var y = p[1];\n var value = p[2];\n // calculate alpha using value\n var alpha = normalize(value);\n // draw with the circle brush with alpha\n ctx.globalAlpha = alpha;\n ctx.drawImage(brush, x - r, y - r);\n }\n if (!canvas.width || !canvas.height) {\n // Avoid \"Uncaught DOMException: Failed to execute 'getImageData' on\n // 'CanvasRenderingContext2D': The source height is 0.\"\n return canvas;\n }\n // colorize the canvas using alpha value and set with gradient\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n var pixels = imageData.data;\n var offset = 0;\n var pixelLen = pixels.length;\n var minOpacity = this.minOpacity;\n var maxOpacity = this.maxOpacity;\n var diffOpacity = maxOpacity - minOpacity;\n while (offset < pixelLen) {\n var alpha = pixels[offset + 3] / 256;\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;\n // Simple optimize to ignore the empty data\n if (alpha > 0) {\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;\n // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\n pixels[offset++] = gradient[gradientOffset];\n pixels[offset++] = gradient[gradientOffset + 1];\n pixels[offset++] = gradient[gradientOffset + 2];\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\n } else {\n offset += 4;\n }\n }\n ctx.putImageData(imageData, 0, 0);\n return canvas;\n };\n /**\n * get canvas of a black circle brush used for canvas to draw later\n */\n HeatmapLayer.prototype._getBrush = function () {\n var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas());\n // set brush size\n var r = this.pointSize + this.blurSize;\n var d = r * 2;\n brushCanvas.width = d;\n brushCanvas.height = d;\n var ctx = brushCanvas.getContext('2d');\n ctx.clearRect(0, 0, d, d);\n // in order to render shadow without the distinct circle,\n // draw the distinct circle in an invisible place,\n // and use shadowOffset to draw shadow in the center of the canvas\n ctx.shadowOffsetX = d;\n ctx.shadowBlur = this.blurSize;\n // draw the shadow in black, and use alpha and shadow blur to generate\n // color in color map\n ctx.shadowColor = '#000';\n // draw circle in the left to the canvas\n ctx.beginPath();\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fill();\n return brushCanvas;\n };\n /**\n * get gradient color map\n * @private\n */\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\n var gradientPixels = this._gradientPixels;\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\n var color = [0, 0, 0, 0];\n var off = 0;\n for (var i = 0; i < 256; i++) {\n colorFunc[state](i / 255, true, color);\n pixelsSingleState[off++] = color[0];\n pixelsSingleState[off++] = color[1];\n pixelsSingleState[off++] = color[2];\n pixelsSingleState[off++] = color[3];\n }\n return pixelsSingleState;\n };\n return HeatmapLayer;\n}();\nexport default HeatmapLayer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport HeatmapLayer from './HeatmapLayer.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n var i;\n // Try to find in the location of the last found\n for (i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n if (i === len) {\n // Not found, back interation\n for (i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n return i >= 0 && i < len && selected[i];\n };\n}\nfunction getIsInContinuousRange(dataExtent, range) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan];\n return function (val) {\n return val >= range[0] && val <= range[1];\n };\n}\nfunction isGeoCoordSys(coordSys) {\n var dimensions = coordSys.dimensions;\n // Not use coordSys.type === 'geo' because coordSys maybe extended\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\n}\nvar HeatmapView = /** @class */function (_super) {\n __extends(HeatmapView, _super);\n function HeatmapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = HeatmapView.type;\n return _this;\n }\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\n var visualMapOfThisSeries;\n ecModel.eachComponent('visualMap', function (visualMap) {\n visualMap.eachTargetSeries(function (targetSeries) {\n if (targetSeries === seriesModel) {\n visualMapOfThisSeries = visualMap;\n }\n });\n });\n if (process.env.NODE_ENV !== 'production') {\n if (!visualMapOfThisSeries) {\n throw new Error('Heatmap must use with visualMap');\n }\n }\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n this.group.removeAll();\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\n } else if (isGeoCoordSys(coordSys)) {\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\n }\n };\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n };\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys) {\n // geo does not support incremental rendering?\n if (isGeoCoordSys(coordSys)) {\n this.render(seriesModel, ecModel, api);\n } else {\n this._progressiveEls = [];\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\n }\n }\n };\n HeatmapView.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\n var coordSys = seriesModel.coordinateSystem;\n var isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d');\n var width;\n var height;\n var xAxisExtent;\n var yAxisExtent;\n if (isCartesian2d) {\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n if (process.env.NODE_ENV !== 'production') {\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\n throw new Error('Heatmap on cartesian must have two category axes');\n }\n if (!(xAxis.onBand && yAxis.onBand)) {\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\n }\n }\n // add 0.5px to avoid the gaps\n width = xAxis.getBandWidth() + .5;\n height = yAxis.getBandWidth() + .5;\n xAxisExtent = xAxis.scale.getExtent();\n yAxisExtent = yAxis.scale.getExtent();\n }\n var group = this.group;\n var data = seriesModel.getData();\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\n var borderRadius = seriesModel.get(['itemStyle', 'borderRadius']);\n var labelStatesModels = getLabelStatesModels(seriesModel);\n var emphasisModel = seriesModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n var dataDims = isCartesian2d ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')];\n for (var idx = start; idx < end; idx++) {\n var rect = void 0;\n var style = data.getItemVisual(idx, 'style');\n if (isCartesian2d) {\n var dataDimX = data.get(dataDims[0], idx);\n var dataDimY = data.get(dataDims[1], idx);\n // Ignore empty data and out of extent data\n if (isNaN(data.get(dataDims[2], idx)) || isNaN(dataDimX) || isNaN(dataDimY) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) {\n continue;\n }\n var point = coordSys.dataToPoint([dataDimX, dataDimY]);\n rect = new graphic.Rect({\n shape: {\n x: point[0] - width / 2,\n y: point[1] - height / 2,\n width: width,\n height: height\n },\n style: style\n });\n } else {\n // Ignore empty data\n if (isNaN(data.get(dataDims[1], idx))) {\n continue;\n }\n rect = new graphic.Rect({\n z2: 1,\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\n style: style\n });\n }\n // Optimization for large dataset\n if (data.hasItemOption) {\n var itemModel = data.getItemModel(idx);\n var emphasisModel_1 = itemModel.getModel('emphasis');\n emphasisStyle = emphasisModel_1.getModel('itemStyle').getItemStyle();\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n // Each item value struct in the data would be firstly\n // {\n // itemStyle: { borderRadius: [30, 30] },\n // value: [2022, 02, 22]\n // }\n borderRadius = itemModel.get(['itemStyle', 'borderRadius']);\n focus = emphasisModel_1.get('focus');\n blurScope = emphasisModel_1.get('blurScope');\n emphasisDisabled = emphasisModel_1.get('disabled');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n rect.shape.r = borderRadius;\n var rawValue = seriesModel.getRawValue(idx);\n var defaultText = '-';\n if (rawValue && rawValue[2] != null) {\n defaultText = rawValue[2] + '';\n }\n setLabelStyle(rect, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: defaultText\n });\n rect.ensureState('emphasis').style = emphasisStyle;\n rect.ensureState('blur').style = blurStyle;\n rect.ensureState('select').style = selectStyle;\n toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled);\n rect.incremental = incremental;\n // PENDING\n if (incremental) {\n // Rect must use hover layer if it's incremental.\n rect.states.emphasis.hoverLayer = true;\n }\n group.add(rect);\n data.setItemGraphicEl(idx, rect);\n if (this._progressiveEls) {\n this._progressiveEls.push(rect);\n }\n }\n };\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;\n // if (!visualMapping) {\n // throw new Error('Data range must have color visuals');\n // }\n var data = seriesModel.getData();\n var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer();\n hmLayer.blurSize = seriesModel.get('blurSize');\n hmLayer.pointSize = seriesModel.get('pointSize');\n hmLayer.minOpacity = seriesModel.get('minOpacity');\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\n var rect = geo.getViewRect().clone();\n var roamTransform = geo.getRoamTransform();\n rect.applyTransform(roamTransform);\n // Clamp on viewport\n var x = Math.max(rect.x, 0);\n var y = Math.max(rect.y, 0);\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\n var width = x2 - x;\n var height = y2 - y;\n var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')];\n var points = data.mapArray(dims, function (lng, lat, value) {\n var pt = geo.dataToPoint([lng, lat]);\n pt[0] -= x;\n pt[1] -= y;\n pt.push(value);\n return pt;\n });\n var dataExtent = visualMapModel.getExtent();\n var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\n inRange: inRangeVisuals.color.getColorMapper(),\n outOfRange: outOfRangeVisuals.color.getColorMapper()\n }, isInRange);\n var img = new graphic.Image({\n style: {\n width: width,\n height: height,\n x: x,\n y: y,\n image: hmLayer.canvas\n },\n silent: true\n });\n this.group.add(img);\n };\n HeatmapView.type = 'heatmap';\n return HeatmapView;\n}(ChartView);\nexport default HeatmapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nvar HeatmapSeriesModel = /** @class */function (_super) {\n __extends(HeatmapSeriesModel, _super);\n function HeatmapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = HeatmapSeriesModel.type;\n return _this;\n }\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n generateCoord: 'value'\n });\n };\n HeatmapSeriesModel.prototype.preventIncremental = function () {\n var coordSysCreator = CoordinateSystem.get(this.get('coordinateSystem'));\n if (coordSysCreator && coordSysCreator.dimensions) {\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\n }\n };\n HeatmapSeriesModel.type = 'series.heatmap';\n HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar'];\n HeatmapSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Geo coordinate system\n geoIndex: 0,\n blurSize: 30,\n pointSize: 20,\n maxOpacity: 1,\n minOpacity: 0,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return HeatmapSeriesModel;\n}(SeriesModel);\nexport default HeatmapSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport HeatmapView from './HeatmapView.js';\nimport HeatmapSeriesModel from './HeatmapSeries.js';\nexport function install(registers) {\n registers.registerChartView(HeatmapView);\n registers.registerSeriesModel(HeatmapSeriesModel);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport { parsePercent, isNumeric } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'];\n// index: +isHorizontal\nvar LAYOUT_ATTRS = [{\n xy: 'x',\n wh: 'width',\n index: 0,\n posDesc: ['left', 'right']\n}, {\n xy: 'y',\n wh: 'height',\n index: 1,\n posDesc: ['top', 'bottom']\n}];\nvar pathForLineWidth = new graphic.Circle();\nvar PictorialBarView = /** @class */function (_super) {\n __extends(PictorialBarView, _super);\n function PictorialBarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = PictorialBarView.type;\n return _this;\n }\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var coordSysRect = cartesian.master.getRect();\n var opt = {\n ecSize: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n seriesModel: seriesModel,\n coordSys: cartesian,\n coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]],\n isHorizontal: isHorizontal,\n valueDim: LAYOUT_ATTRS[+isHorizontal],\n categoryDim: LAYOUT_ATTRS[1 - +isHorizontal]\n };\n data.diff(oldData).add(function (dataIndex) {\n if (!data.hasValue(dataIndex)) {\n return;\n }\n var itemModel = getItemModel(data, dataIndex);\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\n var bar = createBar(data, opt, symbolMeta);\n data.setItemGraphicEl(dataIndex, bar);\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).update(function (newIndex, oldIndex) {\n var bar = oldData.getItemGraphicEl(oldIndex);\n if (!data.hasValue(newIndex)) {\n group.remove(bar);\n return;\n }\n var itemModel = getItemModel(data, newIndex);\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\n group.remove(bar);\n data.setItemGraphicEl(newIndex, null);\n bar = null;\n }\n if (bar) {\n updateBar(bar, opt, symbolMeta);\n } else {\n bar = createBar(data, opt, symbolMeta, true);\n }\n data.setItemGraphicEl(newIndex, bar);\n bar.__pictorialSymbolMeta = symbolMeta;\n // Add back\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).remove(function (dataIndex) {\n var bar = oldData.getItemGraphicEl(dataIndex);\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\n }).execute();\n // Do clipping\n var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n this._data = data;\n return this.group;\n };\n PictorialBarView.prototype.remove = function (ecModel, api) {\n var group = this.group;\n var data = this._data;\n if (ecModel.get('animation')) {\n if (data) {\n data.eachItemGraphicEl(function (bar) {\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\n });\n }\n } else {\n group.removeAll();\n }\n };\n PictorialBarView.type = 'pictorialBar';\n return PictorialBarView;\n}(ChartView);\n// Set or calculate default value about symbol, and calculate layout info.\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n style: data.getItemVisual(dataIndex, 'style'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize);\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n}\n// bar length can be negative.\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n var boundingLength;\n if (zrUtil.isArray(symbolBoundingData)) {\n var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx];\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();\n boundingLength = symbolBoundingExtent[pxSignIdx];\n } else if (symbolBoundingData != null) {\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n } else if (symbolRepeat) {\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n } else {\n boundingLength = layout[valueDim.wh];\n }\n outputSymbolMeta.boundingLength = boundingLength;\n if (symbolRepeat) {\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\n }\n // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero\n // and when borderWidth be settled, the actual linewidth will be NaN\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1;\n}\nfunction convertToCoordOnAxis(axis, value) {\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\n}\n// Support ['100%', '100%']\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var categoryDim = opt.categoryDim;\n var categorySize = Math.abs(layout[categoryDim.wh]);\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\n var parsedSymbolSize;\n if (zrUtil.isArray(symbolSize)) {\n parsedSymbolSize = symbolSize.slice();\n } else {\n if (symbolSize == null) {\n // will parse to number below\n parsedSymbolSize = ['100%', '100%'];\n } else {\n parsedSymbolSize = [symbolSize, symbolSize];\n }\n }\n // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is\n // to complicated to calculate real percent value if considering scaled lineWidth.\n // So the actual size will bigger than layout size if lineWidth is bigger than zero,\n // which can be tolerated in pictorial chart.\n parsedSymbolSize[categoryDim.index] = parsePercent(parsedSymbolSize[categoryDim.index], categorySize);\n parsedSymbolSize[valueDim.index] = parsePercent(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\n outputSymbolMeta.symbolSize = parsedSymbolSize;\n // If x or y is less than zero, show reversed shape.\n var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize];\n // Follow convention, 'right' and 'top' is the normal scale.\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\n}\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\n // In symbols are drawn with scale, so do not need to care about the case that width\n // or height are too small. But symbol use strokeNoScale, where acture lineWidth should\n // be calculated.\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\n if (valueLineWidth) {\n pathForLineWidth.attr({\n scaleX: symbolScale[0],\n scaleY: symbolScale[1],\n rotation: rotation\n });\n pathForLineWidth.updateTransform();\n valueLineWidth /= pathForLineWidth.getLineScale();\n valueLineWidth *= symbolScale[opt.valueDim.index];\n }\n outputSymbolMeta.valueLineWidth = valueLineWidth || 0;\n}\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\n var categoryDim = opt.categoryDim;\n var valueDim = opt.valueDim;\n var pxSign = outputSymbolMeta.pxSign;\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\n var pathLen = unitLength;\n // Note: rotation will not effect the layout of symbols, because user may\n // want symbols to rotate on its center, which should not be translated\n // when rotating.\n if (symbolRepeat) {\n var absBoundingLength = Math.abs(boundingLength);\n var symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + '';\n var hasEndGap = false;\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\n hasEndGap = true;\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\n }\n var symbolMarginNumeric = parsePercent(symbolMargin, symbolSize[valueDim.index]);\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);\n // When symbol margin is less than 0, margin at both ends will be subtracted\n // to ensure that all of the symbols will not be overflow the given area.\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\n // Both final repeatTimes and final symbolMarginNumeric area calculated based on\n // boundingLength.\n var repeatSpecified = isNumeric(symbolRepeat);\n var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);\n // Adjust calculate margin, to ensure each symbol is displayed\n // entirely in the given layout area.\n var mDiff = absBoundingLength - repeatTimes * unitLength;\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1));\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\n // Update repeatTimes when not all symbol will be shown.\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\n repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0;\n }\n pathLen = repeatTimes * uLenWithMargin - endFix;\n outputSymbolMeta.repeatTimes = repeatTimes;\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\n }\n var sizeFix = pxSign * (pathLen / 2);\n var pathPosition = outputSymbolMeta.pathPosition = [];\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\n pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center'\n if (symbolOffset) {\n pathPosition[0] += symbolOffset[0];\n pathPosition[1] += symbolOffset[1];\n }\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\n bundlePosition[valueDim.index] = layout[valueDim.xy];\n var barRectShape = outputSymbolMeta.barRectShape = zrUtil.extend({}, layout);\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\n var clipShape = outputSymbolMeta.clipShape = {};\n // Consider that symbol may be overflow layout rect.\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\n clipShape[valueDim.xy] = 0;\n clipShape[valueDim.wh] = layout[valueDim.wh];\n}\nfunction createPath(symbolMeta) {\n var symbolPatternSize = symbolMeta.symbolPatternSize;\n var path = createSymbol(\n // Consider texture img, make a big size.\n symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\n path.attr({\n culling: true\n });\n path.type !== 'image' && path.setStyle({\n strokeNoScale: true\n });\n return path;\n}\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var symbolSize = symbolMeta.symbolSize;\n var valueLineWidth = symbolMeta.valueLineWidth;\n var pathPosition = symbolMeta.pathPosition;\n var valueDim = opt.valueDim;\n var repeatTimes = symbolMeta.repeatTimes || 0;\n var index = 0;\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\n eachPath(bar, function (path) {\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n if (index < repeatTimes) {\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\n } else {\n updateAttr(path, null, {\n scaleX: 0,\n scaleY: 0\n }, symbolMeta, isUpdate, function () {\n bundle.remove(path);\n });\n }\n // updateHoverAnimation(path, symbolMeta);\n index++;\n });\n for (; index < repeatTimes; index++) {\n var path = createPath(symbolMeta);\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n bundle.add(path);\n var target = makeTarget(index);\n updateAttr(path, {\n x: target.x,\n y: target.y,\n scaleX: 0,\n scaleY: 0\n }, {\n scaleX: target.scaleX,\n scaleY: target.scaleY,\n rotation: target.rotation\n }, symbolMeta, isUpdate);\n }\n function makeTarget(index) {\n var position = pathPosition.slice();\n // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index\n // Otherwise: i = index;\n var pxSign = symbolMeta.pxSign;\n var i = index;\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\n i = repeatTimes - 1 - index;\n }\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\n return {\n x: position[0],\n y: position[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n };\n }\n}\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var mainPath = bar.__pictorialMainPath;\n if (!mainPath) {\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\n bundle.add(mainPath);\n updateAttr(mainPath, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: 0,\n scaleY: 0,\n rotation: symbolMeta.rotation\n }, {\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1]\n }, symbolMeta, isUpdate);\n } else {\n updateAttr(mainPath, null, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n }, symbolMeta, isUpdate);\n }\n}\n// bar rect is used for label.\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\n var rectShape = zrUtil.extend({}, symbolMeta.barRectShape);\n var barRect = bar.__pictorialBarRect;\n if (!barRect) {\n barRect = bar.__pictorialBarRect = new graphic.Rect({\n z2: 2,\n shape: rectShape,\n silent: true,\n style: {\n stroke: 'transparent',\n fill: 'transparent',\n lineWidth: 0\n }\n });\n barRect.disableMorphing = true;\n bar.add(barRect);\n } else {\n updateAttr(barRect, null, {\n shape: rectShape\n }, symbolMeta, isUpdate);\n }\n}\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\n // If not clip, symbol will be remove and rebuilt.\n if (symbolMeta.symbolClip) {\n var clipPath = bar.__pictorialClipPath;\n var clipShape = zrUtil.extend({}, symbolMeta.clipShape);\n var valueDim = opt.valueDim;\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n if (clipPath) {\n graphic.updateProps(clipPath, {\n shape: clipShape\n }, animationModel, dataIndex);\n } else {\n clipShape[valueDim.wh] = 0;\n clipPath = new graphic.Rect({\n shape: clipShape\n });\n bar.__pictorialBundle.setClipPath(clipPath);\n bar.__pictorialClipPath = clipPath;\n var target = {};\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, {\n shape: target\n }, animationModel, dataIndex);\n }\n }\n}\nfunction getItemModel(data, dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\n itemModel.isAnimationEnabled = isAnimationEnabled;\n return itemModel;\n}\nfunction getAnimationDelayParams(path) {\n // The order is the same as the z-order, see `symbolRepeatDiretion`.\n return {\n index: path.__pictorialAnimationIndex,\n count: path.__pictorialRepeatTimes\n };\n}\nfunction isAnimationEnabled() {\n // `animation` prop can be set on itemModel in pictorial bar chart.\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\n}\nfunction createBar(data, opt, symbolMeta, isUpdate) {\n // bar is the main element for each data.\n var bar = new graphic.Group();\n // bundle is used for location and clip.\n var bundle = new graphic.Group();\n bar.add(bundle);\n bar.__pictorialBundle = bundle;\n bundle.x = symbolMeta.bundlePosition[0];\n bundle.y = symbolMeta.bundlePosition[1];\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\n }\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\n bar.__pictorialSymbolMeta = symbolMeta;\n return bar;\n}\nfunction updateBar(bar, opt, symbolMeta) {\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n var bundle = bar.__pictorialBundle;\n graphic.updateProps(bundle, {\n x: symbolMeta.bundlePosition[0],\n y: symbolMeta.bundlePosition[1]\n }, animationModel, dataIndex);\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\n }\n createOrUpdateBarRect(bar, symbolMeta, true);\n createOrUpdateClip(bar, opt, symbolMeta, true);\n}\nfunction removeBar(data, dataIndex, animationModel, bar) {\n // Not show text when animating\n var labelRect = bar.__pictorialBarRect;\n labelRect && labelRect.removeTextContent();\n var paths = [];\n eachPath(bar, function (path) {\n paths.push(path);\n });\n bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath);\n // I do not find proper remove animation for clip yet.\n bar.__pictorialClipPath && (animationModel = null);\n zrUtil.each(paths, function (path) {\n graphic.removeElement(path, {\n scaleX: 0,\n scaleY: 0\n }, animationModel, dataIndex, function () {\n bar.parent && bar.parent.remove(bar);\n });\n });\n data.setItemGraphicEl(dataIndex, null);\n}\nfunction getShapeStr(data, symbolMeta) {\n return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':');\n}\nfunction eachPath(bar, cb, context) {\n // Do not use Group#eachChild, because it do not support remove.\n zrUtil.each(bar.__pictorialBundle.children(), function (el) {\n el !== bar.__pictorialBarRect && cb.call(context, el);\n });\n}\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\n immediateAttrs && el.attr(immediateAttrs);\n // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.\n if (symbolMeta.symbolClip && !isUpdate) {\n animationAttrs && el.attr(animationAttrs);\n } else {\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\n }\n}\nfunction updateCommon(bar, opt, symbolMeta) {\n var dataIndex = symbolMeta.dataIndex;\n var itemModel = symbolMeta.itemModel;\n // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n var emphasisModel = itemModel.getModel('emphasis');\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n var cursorStyle = itemModel.getShallow('cursor');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var hoverScale = emphasisModel.get('scale');\n eachPath(bar, function (path) {\n if (path instanceof ZRImage) {\n var pathStyle = path.style;\n path.useStyle(zrUtil.extend({\n // TODO other properties like dx, dy ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolMeta.style));\n } else {\n path.useStyle(symbolMeta.style);\n }\n var emphasisState = path.ensureState('emphasis');\n emphasisState.style = emphasisStyle;\n if (hoverScale) {\n // NOTE: Must after scale is set after updateAttr\n emphasisState.scaleX = path.scaleX * 1.1;\n emphasisState.scaleY = path.scaleY * 1.1;\n }\n path.ensureState('blur').style = blurStyle;\n path.ensureState('select').style = selectStyle;\n cursorStyle && (path.cursor = cursorStyle);\n path.z2 = symbolMeta.z2;\n });\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\n var barRect = bar.__pictorialBarRect;\n barRect.ignoreClip = true;\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\n labelFetcher: opt.seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\n inheritColor: symbolMeta.style.fill,\n defaultOpacity: symbolMeta.style.opacity,\n defaultOutsidePosition: barPositionOutside\n });\n toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled'));\n}\nfunction toIntTimes(times) {\n var roundedTimes = Math.round(times);\n // Escapse accurate error\n return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times);\n}\nexport default PictorialBarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar PictorialBarSeriesModel = /** @class */function (_super) {\n __extends(PictorialBarSeriesModel, _super);\n function PictorialBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = PictorialBarSeriesModel.type;\n _this.hasSymbolVisual = true;\n _this.defaultSymbol = 'roundRect';\n return _this;\n }\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\n // Disable stack.\n option.stack = null;\n return _super.prototype.getInitialData.apply(this, arguments);\n };\n PictorialBarSeriesModel.type = 'series.pictorialBar';\n PictorialBarSeriesModel.dependencies = ['grid'];\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n symbol: 'circle',\n symbolSize: null,\n symbolRotate: null,\n symbolPosition: null,\n symbolOffset: null,\n symbolMargin: null,\n symbolRepeat: false,\n symbolRepeatDirection: 'end',\n symbolClip: false,\n symbolBoundingData: null,\n symbolPatternSize: 400,\n barGap: '-100%',\n // Pictorial bar do not clip by default because in many cases\n // xAxis and yAxis are not displayed and it's expected not to clip\n clip: false,\n // z can be set in data item, which is z2 actually.\n // Disable progressive\n progressive: 0,\n emphasis: {\n // By default pictorialBar do not hover scale. Hover scale is not suitable\n // for the case that both has foreground and background.\n scale: false\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n });\n return PictorialBarSeriesModel;\n}(BaseBarSeriesModel);\nexport default PictorialBarSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport PictorialBarView from './PictorialBarView.js';\nimport PictorialBarSeriesModel from './PictorialBarSeries.js';\nimport { createProgressiveLayout, layout } from '../../layout/barGrid.js';\nimport { curry } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n registers.registerChartView(PictorialBarView);\n registers.registerSeriesModel(PictorialBarSeriesModel);\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar'));\n // Do layout after other overall layout, which can prepare some information.\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { ECPolygon } from '../line/poly.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { bind } from 'zrender/lib/core/util.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar ThemeRiverView = /** @class */function (_super) {\n __extends(ThemeRiverView, _super);\n function ThemeRiverView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ThemeRiverView.type;\n _this._layers = [];\n return _this;\n }\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var self = this;\n var group = this.group;\n var layersSeries = seriesModel.getLayerSeries();\n var layoutInfo = data.getLayout('layoutInfo');\n var rect = layoutInfo.rect;\n var boundaryGap = layoutInfo.boundaryGap;\n group.x = 0;\n group.y = rect.y + boundaryGap[0];\n function keyGetter(item) {\n return item.name;\n }\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\n var newLayersGroups = [];\n dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute();\n function process(status, idx, oldIdx) {\n var oldLayersGroups = self._layers;\n if (status === 'remove') {\n group.remove(oldLayersGroups[idx]);\n return;\n }\n var points0 = [];\n var points1 = [];\n var style;\n var indices = layersSeries[idx].indices;\n var j = 0;\n for (; j < indices.length; j++) {\n var layout = data.getItemLayout(indices[j]);\n var x = layout.x;\n var y0 = layout.y0;\n var y = layout.y;\n points0.push(x, y0);\n points1.push(x, y0 + y);\n style = data.getItemVisual(indices[j], 'style');\n }\n var polygon;\n var textLayout = data.getItemLayout(indices[0]);\n var labelModel = seriesModel.getModel('label');\n var margin = labelModel.get('margin');\n var emphasisModel = seriesModel.getModel('emphasis');\n if (status === 'add') {\n var layerGroup = newLayersGroups[idx] = new graphic.Group();\n polygon = new ECPolygon({\n shape: {\n points: points0,\n stackedOnPoints: points1,\n smooth: 0.4,\n stackedOnSmooth: 0.4,\n smoothConstraint: false\n },\n z2: 0\n });\n layerGroup.add(polygon);\n group.add(layerGroup);\n if (seriesModel.isAnimationEnabled()) {\n polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function () {\n polygon.removeClipPath();\n }));\n }\n } else {\n var layerGroup = oldLayersGroups[oldIdx];\n polygon = layerGroup.childAt(0);\n group.add(layerGroup);\n newLayersGroups[idx] = layerGroup;\n graphic.updateProps(polygon, {\n shape: {\n points: points0,\n stackedOnPoints: points1\n }\n }, seriesModel);\n saveOldStyle(polygon);\n }\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\n labelDataIndex: indices[j - 1],\n defaultText: data.getName(indices[j - 1]),\n inheritColor: style.fill\n }, {\n normal: {\n verticalAlign: 'middle'\n // align: 'right'\n }\n });\n\n polygon.setTextConfig({\n position: null,\n local: true\n });\n var labelEl = polygon.getTextContent();\n // TODO More label position options.\n if (labelEl) {\n labelEl.x = textLayout.x - margin;\n labelEl.y = textLayout.y0 + textLayout.y / 2;\n }\n polygon.useStyle(style);\n data.setItemGraphicEl(idx, polygon);\n setStatesStylesFromModel(polygon, seriesModel);\n toggleHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n }\n this._layersSeries = layersSeries;\n this._layers = newLayersGroups;\n };\n ThemeRiverView.type = 'themeRiver';\n return ThemeRiverView;\n}(ChartView);\n;\n// add animation to the view\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n x: rect.x - 50,\n width: rect.width + 100,\n height: rect.height + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\nexport default ThemeRiverView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData, SINGLE_REFERRING } from '../../util/model.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar DATA_NAME_INDEX = 2;\nvar ThemeRiverSeriesModel = /** @class */function (_super) {\n __extends(ThemeRiverSeriesModel, _super);\n function ThemeRiverSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ThemeRiverSeriesModel.type;\n return _this;\n }\n /**\n * @override\n */\n ThemeRiverSeriesModel.prototype.init = function (option) {\n // eslint-disable-next-line\n _super.prototype.init.apply(this, arguments);\n // Put this function here is for the sake of consistency of code style.\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n /**\n * If there is no value of a certain point in the time for some event,set it value to 0.\n *\n * @param {Array} data initial data in the option\n * @return {Array}\n */\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\n var rawDataLength = data.length;\n /**\n * Make sure every layer data get the same keys.\n * The value index tells which layer has visited.\n * {\n * 2014/01/01: -1\n * }\n */\n var timeValueKeys = {};\n // grouped data by name\n var groupResult = groupData(data, function (item) {\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\n timeValueKeys[item[0] + ''] = -1;\n }\n return item[2];\n });\n var layerData = [];\n groupResult.buckets.each(function (items, key) {\n layerData.push({\n name: key,\n dataList: items\n });\n });\n var layerNum = layerData.length;\n for (var k = 0; k < layerNum; ++k) {\n var name_1 = layerData[k].name;\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\n var timeValue = layerData[k].dataList[j][0] + '';\n timeValueKeys[timeValue] = k;\n }\n for (var timeValue in timeValueKeys) {\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\n timeValueKeys[timeValue] = k;\n data[rawDataLength] = [timeValue, 0, name_1];\n rawDataLength++;\n }\n }\n }\n return data;\n };\n /**\n * @override\n * @param option the initial option that user gave\n * @param ecModel the model object for themeRiver option\n */\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n var axisType = singleAxisModel.get('type');\n // filter the data item with the value of label is undefined\n var filterData = zrUtil.filter(option.data, function (dataItem) {\n return dataItem[2] !== undefined;\n });\n // ??? TODO design a stage to transfer data for themeRiver and lines?\n var data = this.fixData(filterData || []);\n var nameList = [];\n var nameMap = this.nameMap = zrUtil.createHashMap();\n var count = 0;\n for (var i = 0; i < data.length; ++i) {\n nameList.push(data[i][DATA_NAME_INDEX]);\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\n nameMap.set(data[i][DATA_NAME_INDEX], count);\n count++;\n }\n }\n var dimensions = prepareSeriesDataSchema(data, {\n coordDimensions: ['single'],\n dimensionsDefine: [{\n name: 'time',\n type: getDimensionTypeByAxis(axisType)\n }, {\n name: 'value',\n type: 'float'\n }, {\n name: 'name',\n type: 'ordinal'\n }],\n encodeDefine: {\n single: 0,\n value: 1,\n itemName: 2\n }\n }).dimensions;\n var list = new SeriesData(dimensions, this);\n list.initData(data);\n return list;\n };\n /**\n * The raw data is divided into multiple layers and each layer\n * has same name.\n */\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\n var data = this.getData();\n var lenCount = data.count();\n var indexArr = [];\n for (var i = 0; i < lenCount; ++i) {\n indexArr[i] = i;\n }\n var timeDim = data.mapDimension('single');\n // data group by name\n var groupResult = groupData(indexArr, function (index) {\n return data.get('name', index);\n });\n var layerSeries = [];\n groupResult.buckets.each(function (items, key) {\n items.sort(function (index1, index2) {\n return data.get(timeDim, index1) - data.get(timeDim, index2);\n });\n layerSeries.push({\n name: key,\n indices: items\n });\n });\n return layerSeries;\n };\n /**\n * Get data indices for show tooltip content\n */\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\n if (!zrUtil.isArray(dim)) {\n dim = dim ? [dim] : [];\n }\n var data = this.getData();\n var layerSeries = this.getLayerSeries();\n var indices = [];\n var layerNum = layerSeries.length;\n var nestestValue;\n for (var i = 0; i < layerNum; ++i) {\n var minDist = Number.MAX_VALUE;\n var nearestIdx = -1;\n var pointNum = layerSeries[i].indices.length;\n for (var j = 0; j < pointNum; ++j) {\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\n var dist = Math.abs(theValue - value);\n if (dist <= minDist) {\n nestestValue = theValue;\n minDist = dist;\n nearestIdx = layerSeries[i].indices[j];\n }\n }\n indices.push(nearestIdx);\n }\n return {\n dataIndices: indices,\n nestestValue: nestestValue\n };\n };\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var name = data.getName(dataIndex);\n var value = data.get(data.mapDimension('value'), dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n ThemeRiverSeriesModel.type = 'series.themeRiver';\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\n ThemeRiverSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n coordinateSystem: 'singleAxis',\n // gap in axis's orthogonal orientation\n boundaryGap: ['10%', '10%'],\n // legendHoverLink: true,\n singleAxisIndex: 0,\n animationEasing: 'linear',\n label: {\n margin: 4,\n show: true,\n position: 'left',\n fontSize: 11\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return ThemeRiverSeriesModel;\n}(SeriesModel);\nexport default ThemeRiverSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nexport default function themeRiverLayout(ecModel, api) {\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\n var data = seriesModel.getData();\n var single = seriesModel.coordinateSystem;\n var layoutInfo = {};\n // use the axis boundingRect for view\n var rect = single.getRect();\n layoutInfo.rect = rect;\n var boundaryGap = seriesModel.get('boundaryGap');\n var axis = single.getAxis();\n layoutInfo.boundaryGap = boundaryGap;\n if (axis.orient === 'horizontal') {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, height);\n } else {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, width);\n }\n data.setLayout('layoutInfo', layoutInfo);\n });\n}\n/**\n * The layout information about themeriver\n *\n * @param data data in the series\n * @param seriesModel the model object of themeRiver series\n * @param height value used to compute every series height\n */\nfunction doThemeRiverLayout(data, seriesModel, height) {\n if (!data.count()) {\n return;\n }\n var coordSys = seriesModel.coordinateSystem;\n // the data in each layer are organized into a series.\n var layerSeries = seriesModel.getLayerSeries();\n // the points in each layer.\n var timeDim = data.mapDimension('single');\n var valueDim = data.mapDimension('value');\n var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {\n return zrUtil.map(singleLayer.indices, function (idx) {\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\n pt[1] = data.get(valueDim, idx);\n return pt;\n });\n });\n var base = computeBaseline(layerPoints);\n var baseLine = base.y0;\n var ky = height / base.max;\n // set layout information for each item.\n var n = layerSeries.length;\n var m = layerSeries[0].indices.length;\n var baseY0;\n for (var j = 0; j < m; ++j) {\n baseY0 = baseLine[j] * ky;\n data.setItemLayout(layerSeries[0].indices[j], {\n layerIndex: 0,\n x: layerPoints[0][j][0],\n y0: baseY0,\n y: layerPoints[0][j][1] * ky\n });\n for (var i = 1; i < n; ++i) {\n baseY0 += layerPoints[i - 1][j][1] * ky;\n data.setItemLayout(layerSeries[i].indices[j], {\n layerIndex: i,\n x: layerPoints[i][j][0],\n y0: baseY0,\n y: layerPoints[i][j][1] * ky\n });\n }\n }\n}\n/**\n * Compute the baseLine of the rawdata\n * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics\n *\n * @param data the points in each layer\n */\nfunction computeBaseline(data) {\n var layerNum = data.length;\n var pointNum = data[0].length;\n var sums = [];\n var y0 = [];\n var max = 0;\n for (var i = 0; i < pointNum; ++i) {\n var temp = 0;\n for (var j = 0; j < layerNum; ++j) {\n temp += data[j][i][1];\n }\n if (temp > max) {\n max = temp;\n }\n sums.push(temp);\n }\n for (var k = 0; k < pointNum; ++k) {\n y0[k] = (max - sums[k]) / 2;\n }\n max = 0;\n for (var l = 0; l < pointNum; ++l) {\n var sum = sums[l] + y0[l];\n if (sum > max) {\n max = sum;\n }\n }\n return {\n y0: y0,\n max: max\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport ThemeRiverView from './ThemeRiverView.js';\nimport ThemeRiverSeriesModel from './ThemeRiverSeries.js';\nimport themeRiverLayout from './themeRiverLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n registers.registerChartView(ThemeRiverView);\n registers.registerSeriesModel(ThemeRiverSeriesModel);\n registers.registerLayout(themeRiverLayout);\n registers.registerProcessor(dataFilter('themeRiver'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, SPECIAL_STATES, DISPLAY_STATES } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nimport { isRadianAroundZero } from '../../util/number.js';\nvar DEFAULT_SECTOR_Z = 2;\nvar DEFAULT_TEXT_Z = 4;\n/**\n * Sunburstce of Sunburst including Sector, Label, LabelLine\n */\nvar SunburstPiece = /** @class */function (_super) {\n __extends(SunburstPiece, _super);\n function SunburstPiece(node, seriesModel, ecModel, api) {\n var _this = _super.call(this) || this;\n _this.z2 = DEFAULT_SECTOR_Z;\n _this.textConfig = {\n inside: true\n };\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\n var text = new graphic.Text({\n z2: DEFAULT_TEXT_Z,\n silent: node.getModel().get(['label', 'silent'])\n });\n _this.setTextContent(text);\n _this.updateData(true, node, seriesModel, ecModel, api);\n return _this;\n }\n SunburstPiece.prototype.updateData = function (firstCreate, node,\n // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',\n seriesModel, ecModel, api) {\n this.node = node;\n node.piece = this;\n seriesModel = seriesModel || this._seriesModel;\n ecModel = ecModel || this._ecModel;\n var sector = this;\n getECData(sector).dataIndex = node.dataIndex;\n var itemModel = node.getModel();\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = node.getLayout();\n var sectorShape = zrUtil.extend({}, layout);\n sectorShape.label = null;\n var normalStyle = node.getVisual('style');\n normalStyle.lineJoin = 'bevel';\n var decal = node.getVisual('decal');\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n zrUtil.extend(sectorShape, cornerRadius);\n zrUtil.each(SPECIAL_STATES, function (stateName) {\n var state = sector.ensureState(stateName);\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\n state.style = itemStyleModel.getItemStyle();\n // border radius\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\n if (cornerRadius) {\n state.shape = cornerRadius;\n }\n });\n if (firstCreate) {\n sector.setShape(sectorShape);\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, node.dataIndex);\n } else {\n // Disable animation for gradient since no interpolation method\n // is supported for gradient\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel);\n saveOldStyle(sector);\n }\n sector.useStyle(normalStyle);\n this._updateLabel(seriesModel);\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n this._seriesModel = seriesModel || this._seriesModel;\n this._ecModel = ecModel || this._ecModel;\n var focus = emphasisModel.get('focus');\n var focusOrIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus;\n toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\n var _this = this;\n var itemModel = this.node.getModel();\n var normalLabelModel = itemModel.getModel('label');\n var layout = this.node.getLayout();\n var angle = layout.endAngle - layout.startAngle;\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var dx = Math.cos(midAngle);\n var dy = Math.sin(midAngle);\n var sector = this;\n var label = sector.getTextContent();\n var dataIndex = this.node.dataIndex;\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\n var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\n label.ignore = !isNormalShown;\n // TODO use setLabelStyle\n zrUtil.each(DISPLAY_STATES, function (stateName) {\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']);\n var isNormal = stateName === 'normal';\n var state = isNormal ? label : label.ensureState(stateName);\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\n if (isNormal) {\n text = text || _this.node.name;\n }\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\n if (text) {\n state.style.text = text;\n }\n // Not displaying text when angle is too small\n var isShown = labelStateModel.get('show');\n if (isShown != null && !isNormal) {\n state.ignore = !isShown;\n }\n var labelPosition = getLabelAttr(labelStateModel, 'position');\n var sectorState = isNormal ? sector : sector.states[stateName];\n var labelColor = sectorState.style.fill;\n sectorState.textConfig = {\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\n inside: labelPosition !== 'outside'\n };\n var r;\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\n var textAlign = getLabelAttr(labelStateModel, 'align');\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\n var flipStartAngle = Math.PI * 0.5;\n var flipEndAngle = Math.PI * 1.5;\n var midAngleNormal = normalizeRadian(rotateType === 'tangential' ? Math.PI / 2 - midAngle : midAngle);\n // For text that is up-side down, rotate 180 degrees to make sure\n // it's readable\n var needsFlip = midAngleNormal > flipStartAngle && !isRadianAroundZero(midAngleNormal - flipStartAngle) && midAngleNormal < flipEndAngle;\n if (labelPosition === 'outside') {\n r = layout.r + labelPadding;\n textAlign = needsFlip ? 'right' : 'left';\n } else {\n if (!textAlign || textAlign === 'center') {\n // Put label in the center if it's a circle\n if (angle === 2 * Math.PI && layout.r0 === 0) {\n r = 0;\n } else {\n r = (layout.r + layout.r0) / 2;\n }\n textAlign = 'center';\n } else if (textAlign === 'left') {\n r = layout.r0 + labelPadding;\n textAlign = needsFlip ? 'right' : 'left';\n } else if (textAlign === 'right') {\n r = layout.r - labelPadding;\n textAlign = needsFlip ? 'left' : 'right';\n }\n }\n state.style.align = textAlign;\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\n state.x = r * dx + layout.cx;\n state.y = r * dy + layout.cy;\n var rotate = 0;\n if (rotateType === 'radial') {\n rotate = normalizeRadian(-midAngle) + (needsFlip ? Math.PI : 0);\n } else if (rotateType === 'tangential') {\n rotate = normalizeRadian(Math.PI / 2 - midAngle) + (needsFlip ? Math.PI : 0);\n } else if (zrUtil.isNumber(rotateType)) {\n rotate = rotateType * Math.PI / 180;\n }\n state.rotation = normalizeRadian(rotate);\n });\n function getLabelAttr(model, name) {\n var stateAttr = model.get(name);\n if (stateAttr == null) {\n return normalLabelModel.get(name);\n }\n return stateAttr;\n }\n label.dirtyStyle();\n };\n return SunburstPiece;\n}(graphic.Sector);\nexport default SunburstPiece;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog } from '../../util/log.js';\nimport { retrieveTargetInfo, aboveViewRoot } from '../helper/treeHelper.js';\nexport var ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\nexport function installSunburstAction(registers) {\n registers.registerAction({\n type: ROOT_TO_NODE_ACTION,\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleRootToNode);\n function handleRootToNode(model, index) {\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n if (originViewRoot) {\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n model.resetViewRoot(targetInfo.node);\n }\n }\n });\n registers.registerAction({\n type: HIGHLIGHT_ACTION,\n update: 'none'\n }, function (payload, ecModel, api) {\n // Clone\n payload = extend({}, payload);\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleHighlight);\n function handleHighlight(model) {\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\n if (targetInfo) {\n payload.dataIndex = targetInfo.node.dataIndex;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('sunburstHighlight', 'highlight');\n }\n // Fast forward action\n api.dispatchAction(extend(payload, {\n type: 'highlight'\n }));\n });\n registers.registerAction({\n type: UNHIGHLIGHT_ACTION,\n update: 'updateView'\n }, function (payload, ecModel, api) {\n payload = extend({}, payload);\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('sunburstUnhighlight', 'downplay');\n }\n api.dispatchAction(extend(payload, {\n type: 'downplay'\n }));\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport SunburstPiece from './SunburstPiece.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport { ROOT_TO_NODE_ACTION } from './sunburstAction.js';\nimport { windowOpen } from '../../util/format.js';\nvar SunburstView = /** @class */function (_super) {\n __extends(SunburstView, _super);\n function SunburstView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SunburstView.type;\n return _this;\n }\n SunburstView.prototype.render = function (seriesModel, ecModel, api,\n // @ts-ignore\n payload) {\n var self = this;\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var data = seriesModel.getData();\n var virtualRoot = data.tree.root;\n var newRoot = seriesModel.getViewRoot();\n var group = this.group;\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\n var newChildren = [];\n newRoot.eachNode(function (node) {\n newChildren.push(node);\n });\n var oldChildren = this._oldChildren || [];\n dualTravel(newChildren, oldChildren);\n renderRollUp(virtualRoot, newRoot);\n this._initEvents();\n this._oldChildren = newChildren;\n function dualTravel(newChildren, oldChildren) {\n if (newChildren.length === 0 && oldChildren.length === 0) {\n return;\n }\n new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(zrUtil.curry(processNode, null)).execute();\n function getKey(node) {\n return node.getId();\n }\n function processNode(newIdx, oldIdx) {\n var newNode = newIdx == null ? null : newChildren[newIdx];\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\n doRenderNode(newNode, oldNode);\n }\n }\n function doRenderNode(newNode, oldNode) {\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\n // Not render data with value 0\n newNode = null;\n }\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\n if (oldNode && oldNode.piece) {\n if (newNode) {\n // Update\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api);\n // For tooltip\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\n } else {\n // Remove\n removeNode(oldNode);\n }\n } else if (newNode) {\n // Add\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\n group.add(piece);\n // For tooltip\n data.setItemGraphicEl(newNode.dataIndex, piece);\n }\n }\n }\n function removeNode(node) {\n if (!node) {\n return;\n }\n if (node.piece) {\n group.remove(node.piece);\n node.piece = null;\n }\n }\n function renderRollUp(virtualRoot, viewRoot) {\n if (viewRoot.depth > 0) {\n // Render\n if (self.virtualPiece) {\n // Update\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\n } else {\n // Add\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\n group.add(self.virtualPiece);\n }\n // TODO event scope\n viewRoot.piece.off('click');\n self.virtualPiece.on('click', function (e) {\n self._rootToNode(viewRoot.parentNode);\n });\n } else if (self.virtualPiece) {\n // Remove\n group.remove(self.virtualPiece);\n self.virtualPiece = null;\n }\n }\n };\n /**\n * @private\n */\n SunburstView.prototype._initEvents = function () {\n var _this = this;\n this.group.off('click');\n this.group.on('click', function (e) {\n var targetFound = false;\n var viewRoot = _this.seriesModel.getViewRoot();\n viewRoot.eachNode(function (node) {\n if (!targetFound && node.piece && node.piece === e.target) {\n var nodeClick = node.getModel().get('nodeClick');\n if (nodeClick === 'rootToNode') {\n _this._rootToNode(node);\n } else if (nodeClick === 'link') {\n var itemModel = node.getModel();\n var link = itemModel.get('link');\n if (link) {\n var linkTarget = itemModel.get('target', true) || '_blank';\n windowOpen(link, linkTarget);\n }\n }\n targetFound = true;\n }\n });\n });\n };\n /**\n * @private\n */\n SunburstView.prototype._rootToNode = function (node) {\n if (node !== this.seriesModel.getViewRoot()) {\n this.api.dispatchAction({\n type: ROOT_TO_NODE_ACTION,\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: node\n });\n }\n };\n /**\n * @implement\n */\n SunburstView.prototype.containPoint = function (point, seriesModel) {\n var treeRoot = seriesModel.getData();\n var itemLayout = treeRoot.getItemLayout(0);\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n SunburstView.type = 'sunburst';\n return SunburstView;\n}(ChartView);\nexport default SunburstView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport Model from '../../model/Model.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\nvar SunburstSeriesModel = /** @class */function (_super) {\n __extends(SunburstSeriesModel, _super);\n function SunburstSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SunburstSeriesModel.type;\n _this.ignoreStyleOnData = true;\n return _this;\n }\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levelModels = this._levelModels = zrUtil.map(option.levels || [], function (levelDefine) {\n return new Model(levelDefine, this, ecModel);\n }, this);\n // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n var tree = Tree.createTree(root, this, beforeLink);\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = levelModels[node.depth];\n levelModel && (model.parentModel = levelModel);\n return model;\n });\n }\n return tree.data;\n };\n SunburstSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /*\n * @override\n */\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treePathInfo = wrapTreePathInfo(node, this);\n return params;\n };\n SunburstSeriesModel.prototype.getLevelModel = function (node) {\n return this._levelModels && this._levelModels[node.depth];\n };\n SunburstSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n SunburstSeriesModel.type = 'series.sunburst';\n SunburstSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // 'rootToNode', 'link', or false\n nodeClick: 'rootToNode',\n renderLabelForZeroData: false,\n label: {\n // could be: 'radial', 'tangential', or 'none'\n rotate: 'radial',\n show: true,\n opacity: 1,\n // 'left' is for inner side of inside, and 'right' is for outer\n // side for inside\n align: 'center',\n position: 'inside',\n distance: 5,\n silent: true\n },\n itemStyle: {\n borderWidth: 1,\n borderColor: 'white',\n borderType: 'solid',\n shadowBlur: 0,\n shadowColor: 'rgba(0, 0, 0, 0.2)',\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n emphasis: {\n focus: 'descendant'\n },\n blur: {\n itemStyle: {\n opacity: 0.2\n },\n label: {\n opacity: 0.1\n }\n },\n // Animation type can be expansion, scale.\n animationType: 'expansion',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n data: [],\n /**\n * Sort order.\n *\n * Valid values: 'desc', 'asc', null, or callback function.\n * 'desc' and 'asc' for descend and ascendant order;\n * null for not sorting;\n * example of callback function:\n * function(nodeA, nodeB) {\n * return nodeA.getValue() - nodeB.getValue();\n * }\n */\n sort: 'desc'\n };\n return SunburstSeriesModel;\n}(SeriesModel);\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value;\n // TODO First value of array must be a number\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n }\n // Value should not less than 0.\n if (thisValue < 0) {\n thisValue = 0;\n }\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\nexport default SunburstSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parsePercent } from '../../util/number.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// let PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\nexport default function sunburstLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var virtualRoot = seriesModel.getData().tree.root;\n var treeRoot = seriesModel.getViewRoot();\n var rootDepth = treeRoot.depth;\n var sort = seriesModel.get('sort');\n if (sort != null) {\n initChildren(treeRoot, sort);\n }\n var validDataCount = 0;\n zrUtil.each(treeRoot.children, function (child) {\n !isNaN(child.getValue()) && validDataCount++;\n });\n var sum = treeRoot.getValue();\n // Sum may be 0\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var renderRollupNode = treeRoot.depth > 0;\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\n var rPerLevel = (r - r0) / (levels || 1);\n var clockwise = seriesModel.get('clockwise');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum');\n // In the case some sector angle is smaller than minAngle\n // let restAngle = PI2;\n // let valueSumLargerThanMinAngle = 0;\n var dir = clockwise ? 1 : -1;\n /**\n * Render a tree\n * @return increased angle\n */\n var renderNode = function (node, startAngle) {\n if (!node) {\n return;\n }\n var endAngle = startAngle;\n // Render self\n if (node !== virtualRoot) {\n // Tree node is virtual, so it doesn't need to be drawn\n var value = node.getValue();\n var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n if (angle < minAngle) {\n angle = minAngle;\n // restAngle -= minAngle;\n }\n // else {\n // valueSumLargerThanMinAngle += value;\n // }\n endAngle = startAngle + dir * angle;\n var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1);\n var rStart = r0 + rPerLevel * depth;\n var rEnd = r0 + rPerLevel * (depth + 1);\n var levelModel = seriesModel.getLevelModel(node);\n if (levelModel) {\n var r0_1 = levelModel.get('r0', true);\n var r_1 = levelModel.get('r', true);\n var radius_1 = levelModel.get('radius', true);\n if (radius_1 != null) {\n r0_1 = radius_1[0];\n r_1 = radius_1[1];\n }\n r0_1 != null && (rStart = parsePercent(r0_1, size / 2));\n r_1 != null && (rEnd = parsePercent(r_1, size / 2));\n }\n node.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n }\n // Render children\n if (node.children && node.children.length) {\n // currentAngle = startAngle;\n var siblingAngle_1 = 0;\n zrUtil.each(node.children, function (node) {\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\n });\n }\n return endAngle - startAngle;\n };\n // Virtual root node for roll up\n if (renderRollupNode) {\n var rStart = r0;\n var rEnd = r0 + rPerLevel;\n var angle = Math.PI * 2;\n virtualRoot.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: startAngle + angle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n }\n renderNode(treeRoot, startAngle);\n });\n}\n/**\n * Init node children by order and update visual\n */\nfunction initChildren(node, sortOrder) {\n var children = node.children || [];\n node.children = sort(children, sortOrder);\n // Init children recursively\n if (children.length) {\n zrUtil.each(node.children, function (child) {\n initChildren(child, sortOrder);\n });\n }\n}\n/**\n * Sort children nodes\n *\n * @param {TreeNode[]} children children of node to be sorted\n * @param {string | function | null} sort sort method\n * See SunburstSeries.js for details.\n */\nfunction sort(children, sortOrder) {\n if (zrUtil.isFunction(sortOrder)) {\n var sortTargets = zrUtil.map(children, function (child, idx) {\n var value = child.getValue();\n return {\n params: {\n depth: child.depth,\n height: child.height,\n dataIndex: child.dataIndex,\n getValue: function () {\n return value;\n }\n },\n index: idx\n };\n });\n sortTargets.sort(function (a, b) {\n return sortOrder(a.params, b.params);\n });\n return zrUtil.map(sortTargets, function (target) {\n return children[target.index];\n });\n } else {\n var isAsc_1 = sortOrder === 'asc';\n return children.sort(function (a, b) {\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\n return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff;\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { lift } from 'zrender/lib/tool/color.js';\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function sunburstVisual(ecModel) {\n var paletteScope = {};\n // Default color strategy\n function pickColor(node, seriesModel, treeHeight) {\n // Choose color from palette based on the first level.\n var current = node;\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);\n if (node.depth > 1 && isString(color)) {\n // Lighter on the deeper level.\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\n }\n return color;\n }\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel();\n var style = model.getModel('itemStyle').getItemStyle();\n if (!style.fill) {\n style.fill = pickColor(node, seriesModel, tree.root.height);\n }\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SunburstView from './SunburstView.js';\nimport SunburstSeriesModel from './SunburstSeries.js';\nimport sunburstLayout from './sunburstLayout.js';\nimport sunburstVisual from './sunburstVisual.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport { installSunburstAction } from './sunburstAction.js';\nexport function install(registers) {\n registers.registerChartView(SunburstView);\n registers.registerSeriesModel(SunburstSeriesModel);\n registers.registerLayout(curry(sunburstLayout, 'sunburst'));\n registers.registerProcessor(curry(dataFilter, 'sunburst'));\n registers.registerVisual(sunburstVisual);\n installSunburstAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { makeInner } from '../../util/model.js';\nimport SeriesModel from '../../model/Series.js';\n// Also compat with ec4, where\n// `visual('color') visual('borderColor')` is supported.\nexport var STYLE_VISUAL_TYPE = {\n color: 'fill',\n borderColor: 'stroke'\n};\nexport var NON_STYLE_VISUAL_PROPS = {\n symbol: 1,\n symbolSize: 1,\n symbolKeepAspect: 1,\n legendIcon: 1,\n visualMeta: 1,\n liftZ: 1,\n decal: 1\n};\n;\nexport var customInnerStore = makeInner();\nvar CustomSeriesModel = /** @class */function (_super) {\n __extends(CustomSeriesModel, _super);\n function CustomSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CustomSeriesModel.type;\n return _this;\n }\n CustomSeriesModel.prototype.optionUpdated = function () {\n this.currentZLevel = this.get('zlevel', true);\n this.currentZ = this.get('z', true);\n };\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this);\n };\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n el && (params.info = customInnerStore(el).info);\n return params;\n };\n CustomSeriesModel.type = 'series.custom';\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n CustomSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Custom series will not clip by default.\n // Some case will use custom series to draw label\n // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight\n clip: false\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n };\n\n return CustomSeriesModel;\n}(SeriesModel);\nexport default CustomSeriesModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['x', 'y'], function (dim, dimIdx) {\n var axis = this.getAxis(dim);\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n }, this);\n}\nexport default function cartesianPrepareCustom(coordSys) {\n var rect = coordSys.master.getRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'cartesian2d',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map([0, 1], function (dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var p2 = [];\n p1[dimIdx] = val - halfSize;\n p2[dimIdx] = val + halfSize;\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\n }, this);\n}\nexport default function geoPrepareCustom(coordSys) {\n var rect = coordSys.getBoundingRect();\n return {\n coordSys: {\n type: 'geo',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n zoom: coordSys.getZoom()\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" and noRoam param,\n // Compatible with this usage:\n // echarts.util.map(item.points, api.coord)\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { bind } from 'zrender/lib/core/util.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}\nexport default function singlePrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n return {\n coordSys: {\n type: 'singleAxis',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (val) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(val);\n },\n size: bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n// import AngleAxis from './AngleAxis.js';\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['Radius', 'Angle'], function (dim, dimIdx) {\n var getterName = 'get' + dim + 'Axis';\n // TODO: TYPE Check Angle Axis\n var axis = this[getterName]();\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n if (dim === 'Angle') {\n result = result * Math.PI / 180;\n }\n return result;\n }, this);\n}\nexport default function polarPrepareCustom(coordSys) {\n var radiusAxis = coordSys.getRadiusAxis();\n var angleAxis = coordSys.getAngleAxis();\n var radius = radiusAxis.getExtent();\n radius[0] > radius[1] && radius.reverse();\n return {\n coordSys: {\n type: 'polar',\n cx: coordSys.cx,\n cy: coordSys.cy,\n r: radius[1],\n r0: radius[0]\n },\n api: {\n coord: function (data) {\n var radius = radiusAxis.dataToRadius(data[0]);\n var angle = angleAxis.dataToAngle(data[1]);\n var coord = coordSys.coordToPoint([radius, angle]);\n coord.push(radius, angle * Math.PI / 180);\n return coord;\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function calendarPrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n var rangeInfo = coordSys.getRangeInfo();\n return {\n coordSys: {\n type: 'calendar',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n cellWidth: coordSys.getCellWidth(),\n cellHeight: coordSys.getCellHeight(),\n rangeInfo: {\n start: rangeInfo.start,\n end: rangeInfo.end,\n weeks: rangeInfo.weeks,\n dayCount: rangeInfo.allDay\n }\n },\n api: {\n coord: function (data, clamp) {\n return coordSys.dataToPoint(data, clamp);\n }\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, hasOwn } from 'zrender/lib/core/util.js';\nvar deprecatedLogs = {};\n/**\n * Whether need to call `convertEC4CompatibleStyle`.\n */\nexport function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\n // Since echarts5, `RectText` is separated from its host element and style.text\n // does not exist any more. The compat work brings some extra burden on performance.\n // So we provide:\n // `legacy: true` force make compat.\n // `legacy: false`, force do not compat.\n // `legacy` not set: auto detect whether legacy.\n // But in this case we do not compat (difficult to detect and rare case):\n // Becuse custom series and graphic component support \"merge\", users may firstly\n // only set `textStrokeWidth` style or secondly only set `text`.\n return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan'\n // Difficult to detect whether legacy for a \"text\" el.\n && (elType === 'text' || hasOwn(style, 'text')));\n}\n/**\n * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.\n * @param hostStyle The properties might be modified.\n * @return If be text el, `textContentStyle` and `textConfig` will not be returned.\n * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area\n * retried from the `hostStyle`.\n */\nexport function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\n var srcStyle = hostStyle;\n var textConfig;\n var textContent;\n var textContentStyle;\n if (elType === 'text') {\n textContentStyle = srcStyle;\n } else {\n textContentStyle = {};\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\n hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily);\n hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize);\n hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle);\n hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight);\n textContent = {\n type: 'text',\n style: textContentStyle,\n // ec4 does not support rectText trigger.\n // And when text position is different in normal and emphasis\n // => hover text trigger emphasis;\n // => text position changed, leave mouse pointer immediately;\n // That might cause incorrect state.\n silent: true\n };\n textConfig = {};\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\n if (isNormal) {\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\n } else {\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\n }\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\n }\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\n each(textContentStyle.rich, function (richItem) {\n convertEC4CompatibleRichItem(richItem, richItem);\n });\n return {\n textConfig: textConfig,\n textContent: textContent\n };\n}\n/**\n * The result will be set to `out`.\n */\nfunction convertEC4CompatibleRichItem(out, richItem) {\n if (!richItem) {\n return;\n }\n // (1) For simplicity, make textXXX properties (deprecated since ec5) has\n // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`\n // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached\n // richText in ec5.\n // (2) `out === richItem` if and only if `out` is text el or rich item.\n // So we can overwrite existing props in `out` since textXXX has higher priority.\n richItem.font = richItem.textFont || richItem.font;\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\n}\n/**\n * Convert to pure echarts4 format style.\n * `itemStyle` will be modified, added with ec4 style properties from\n * `textStyle` and `textConfig`.\n *\n * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where\n * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.\n */\nexport function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\n var out = itemStl;\n // See `custom.ts`, a trick to set extra `textPosition` firstly.\n out.textPosition = out.textPosition || txCfg.position || 'inside';\n txCfg.offset != null && (out.textOffset = txCfg.offset);\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\n txCfg.distance != null && (out.textDistance = txCfg.distance);\n var isInside = out.textPosition.indexOf('inside') >= 0;\n var hostFill = itemStl.fill || '#000';\n convertToEC4RichItem(out, txStl);\n var textFillNotSet = out.textFill == null;\n if (isInside) {\n if (textFillNotSet) {\n out.textFill = txCfg.insideFill || '#fff';\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\n !out.textStroke && (out.textStroke = hostFill);\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\n }\n } else {\n if (textFillNotSet) {\n out.textFill = itemStl.fill || txCfg.outsideFill || '#000';\n }\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\n }\n out.text = txStl.text;\n out.rich = txStl.rich;\n each(txStl.rich, function (richItem) {\n convertToEC4RichItem(richItem, richItem);\n });\n return out;\n}\nfunction convertToEC4RichItem(out, richItem) {\n if (!richItem) {\n return;\n }\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\n hasOwn(richItem, 'font') && (out.font = richItem.font);\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\n}\nexport function warnDeprecated(deprecated, insteadApproach) {\n if (process.env.NODE_ENV !== 'production') {\n var key = deprecated + '^_^' + insteadApproach;\n if (!deprecatedLogs[key]) {\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\n deprecatedLogs[key] = true;\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { assert, bind, each, eqNaN, extend, hasOwn, indexOf, isArrayLike, keys, reduce } from 'zrender/lib/core/util.js';\nimport { cloneValue } from 'zrender/lib/animation/Animator.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { Path } from '../util/graphic.js';\nimport { warn } from '../util/log.js';\nimport { TRANSFORMABLE_PROPS } from 'zrender/lib/core/Transformable.js';\nvar LEGACY_TRANSFORM_PROPS_MAP = {\n position: ['x', 'y'],\n scale: ['scaleX', 'scaleY'],\n origin: ['originX', 'originY']\n};\nvar LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP);\nvar TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n obj[key] = 1;\n return obj;\n}, {});\nvar transformPropNamesStr = TRANSFORMABLE_PROPS.join(', ');\n// '' means root\nexport var ELEMENT_ANIMATABLE_PROPS = ['', 'style', 'shape', 'extra'];\n;\nvar transitionInnerStore = makeInner();\n;\nfunction getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) {\n var animationProp = animationType + \"Animation\";\n var config = getAnimationConfig(animationType, parentModel, dataIndex) || {};\n var userDuring = transitionInnerStore(el).userDuring;\n // Only set when duration is > 0 and it's need to be animated.\n if (config.duration > 0) {\n // For simplicity, if during not specified, the previous during will not work any more.\n config.during = userDuring ? bind(duringCall, {\n el: el,\n userDuring: userDuring\n }) : null;\n config.setToFinal = true;\n config.scope = animationType;\n }\n extend(config, elOption[animationProp]);\n return config;\n}\nexport function applyUpdateTransition(el, elOption, animatableModel, opts) {\n opts = opts || {};\n var dataIndex = opts.dataIndex,\n isInit = opts.isInit,\n clearStyle = opts.clearStyle;\n var hasAnimation = animatableModel.isAnimationEnabled();\n // Save the meta info for further morphing. Like apply on the sub morphing elements.\n var store = transitionInnerStore(el);\n var styleOpt = elOption.style;\n store.userDuring = elOption.during;\n var transFromProps = {};\n var propsToSet = {};\n prepareTransformAllPropsFinal(el, elOption, propsToSet);\n prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet);\n prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet);\n if (!isInit && hasAnimation) {\n prepareTransformTransitionFrom(el, elOption, transFromProps);\n prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps);\n prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps);\n prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);\n }\n propsToSet.style = styleOpt;\n applyPropsDirectly(el, propsToSet, clearStyle);\n applyMiscProps(el, elOption);\n if (hasAnimation) {\n if (isInit) {\n var enterFromProps_1 = {};\n each(ELEMENT_ANIMATABLE_PROPS, function (propName) {\n var prop = propName ? elOption[propName] : elOption;\n if (prop && prop.enterFrom) {\n if (propName) {\n enterFromProps_1[propName] = enterFromProps_1[propName] || {};\n }\n extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom);\n }\n });\n var config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex);\n if (config.duration > 0) {\n el.animateFrom(enterFromProps_1, config);\n }\n } else {\n applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);\n }\n }\n // Store leave to be used in leave transition.\n updateLeaveTo(el, elOption);\n styleOpt ? el.dirty() : el.markRedraw();\n}\nexport function updateLeaveTo(el, elOption) {\n // Try merge to previous set leaveTo\n var leaveToProps = transitionInnerStore(el).leaveToProps;\n for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) {\n var propName = ELEMENT_ANIMATABLE_PROPS[i];\n var prop = propName ? elOption[propName] : elOption;\n if (prop && prop.leaveTo) {\n if (!leaveToProps) {\n leaveToProps = transitionInnerStore(el).leaveToProps = {};\n }\n if (propName) {\n leaveToProps[propName] = leaveToProps[propName] || {};\n }\n extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo);\n }\n }\n}\nexport function applyLeaveTransition(el, elOption, animatableModel, onRemove) {\n if (el) {\n var parent_1 = el.parent;\n var leaveToProps = transitionInnerStore(el).leaveToProps;\n if (leaveToProps) {\n // TODO TODO use leave after leaveAnimation in series is introduced\n // TODO Data index?\n var config = getElementAnimationConfig('update', el, elOption, animatableModel, 0);\n config.done = function () {\n parent_1.remove(el);\n onRemove && onRemove();\n };\n el.animateTo(leaveToProps, config);\n } else {\n parent_1.remove(el);\n onRemove && onRemove();\n }\n }\n}\nexport function isTransitionAll(transition) {\n return transition === 'all';\n}\nfunction applyPropsDirectly(el,\n// Can be null/undefined\nallPropsFinal, clearStyle) {\n var styleOpt = allPropsFinal.style;\n if (!el.isGroup && styleOpt) {\n if (clearStyle) {\n el.useStyle({});\n // When style object changed, how to trade the existing animation?\n // It is probably complicated and not needed to cover all the cases.\n // But still need consider the case:\n // (1) When using init animation on `style.opacity`, and before the animation\n // ended users triggers an update by mousewhel. At that time the init\n // animation should better be continued rather than terminated.\n // So after `useStyle` called, we should change the animation target manually\n // to continue the effect of the init animation.\n // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need\n // to update the value to `val2` and no animation declared, should be terminate\n // the previous animation or just modify the target of the animation?\n // Therotically That will happen not only on `style` but also on `shape` and\n // `transfrom` props. But we haven't handle this case at present yet.\n // (3) PENDING: Is it proper to visit `animators` and `targetName`?\n var animators = el.animators;\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i];\n // targetName is the \"topKey\".\n if (animator.targetName === 'style') {\n animator.changeTarget(el.style);\n }\n }\n }\n el.setStyle(styleOpt);\n }\n if (allPropsFinal) {\n // Not set style here.\n allPropsFinal.style = null;\n // Set el to the final state firstly.\n allPropsFinal && el.attr(allPropsFinal);\n allPropsFinal.style = styleOpt;\n }\n}\nfunction applyPropsTransition(el, elOption, dataIndex, model,\n// Can be null/undefined\ntransFromProps) {\n if (transFromProps) {\n var config = getElementAnimationConfig('update', el, elOption, model, dataIndex);\n if (config.duration > 0) {\n el.animateFrom(transFromProps, config);\n }\n }\n}\nfunction applyMiscProps(el, elOption) {\n // Merge by default.\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\n if (el instanceof Displayable) {\n hasOwn(elOption, 'invisible') && (el.invisible = elOption.invisible);\n }\n if (el instanceof Path) {\n hasOwn(elOption, 'autoBatch') && (el.autoBatch = elOption.autoBatch);\n }\n}\n// Use it to avoid it be exposed to user.\nvar tmpDuringScope = {};\nvar transitionDuringAPI = {\n // Usually other props do not need to be changed in animation during.\n setTransform: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\n }\n tmpDuringScope.el[key] = val;\n return this;\n },\n getTransform: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\n }\n return tmpDuringScope.el[key];\n },\n setShape: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n var el = tmpDuringScope.el;\n var shape = el.shape || (el.shape = {});\n shape[key] = val;\n el.dirtyShape && el.dirtyShape();\n return this;\n },\n getShape: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n var shape = tmpDuringScope.el.shape;\n if (shape) {\n return shape[key];\n }\n },\n setStyle: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n var el = tmpDuringScope.el;\n var style = el.style;\n if (style) {\n if (process.env.NODE_ENV !== 'production') {\n if (eqNaN(val)) {\n warn('style.' + key + ' must not be assigned with NaN.');\n }\n }\n style[key] = val;\n el.dirtyStyle && el.dirtyStyle();\n }\n return this;\n },\n getStyle: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n var style = tmpDuringScope.el.style;\n if (style) {\n return style[key];\n }\n },\n setExtra: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {});\n extra[key] = val;\n return this;\n },\n getExtra: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n var extra = tmpDuringScope.el.extra;\n if (extra) {\n return extra[key];\n }\n }\n};\nfunction assertNotReserved(key) {\n if (process.env.NODE_ENV !== 'production') {\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\n throw new Error('key must not be \"' + key + '\"');\n }\n }\n}\nfunction duringCall() {\n // Do not provide \"percent\" until some requirements come.\n // Because consider thies case:\n // enterFrom: {x: 100, y: 30}, transition: 'x'.\n // And enter duration is different from update duration.\n // Thus it might be confused about the meaning of \"percent\" in during callback.\n var scope = this;\n var el = scope.el;\n if (!el) {\n return;\n }\n // If el is remove from zr by reason like legend, during still need to called,\n // because el will be added back to zr and the prop value should not be incorrect.\n var latestUserDuring = transitionInnerStore(el).userDuring;\n var scopeUserDuring = scope.userDuring;\n // Ensured a during is only called once in each animation frame.\n // If a during is called multiple times in one frame, maybe some users' calculation logic\n // might be wrong (not sure whether this usage exists).\n // The case of a during might be called twice can be: by default there is a animator for\n // 'x', 'y' when init. Before the init animation finished, call `setOption` to start\n // another animators for 'style'/'shape'/'extra'.\n if (latestUserDuring !== scopeUserDuring) {\n // release\n scope.el = scope.userDuring = null;\n return;\n }\n tmpDuringScope.el = el;\n // Give no `this` to user in \"during\" calling.\n scopeUserDuring(transitionDuringAPI);\n // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`,\n // consider the issue that the prop might be incorrect when return to \"normal\" state.\n}\n\nfunction prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) {\n var attrOpt = elOption[mainAttr];\n if (!attrOpt) {\n return;\n }\n var elPropsInAttr = fromEl[mainAttr];\n var transFromPropsInAttr;\n if (elPropsInAttr) {\n var transition = elOption.transition;\n var attrTransition = attrOpt.transition;\n if (attrTransition) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n if (isTransitionAll(attrTransition)) {\n extend(transFromPropsInAttr, elPropsInAttr);\n } else {\n var transitionKeys = normalizeToArray(attrTransition);\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = elPropsInAttr[key];\n transFromPropsInAttr[key] = elVal;\n }\n }\n } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n var elPropsInAttrKeys = keys(elPropsInAttr);\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\n var key = elPropsInAttrKeys[i];\n var elVal = elPropsInAttr[key];\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\n transFromPropsInAttr[key] = elVal;\n }\n }\n }\n }\n}\nfunction prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\n var attrOpt = elOption[mainAttr];\n if (!attrOpt) {\n return;\n }\n var allPropsInAttr = allProps[mainAttr] = {};\n var keysInAttr = keys(attrOpt);\n for (var i = 0; i < keysInAttr.length; i++) {\n var key = keysInAttr[i];\n // To avoid share one object with different element, and\n // to avoid user modify the object inexpectedly, have to clone.\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\n }\n}\nfunction prepareTransformTransitionFrom(el, elOption, transFromProps) {\n var transition = elOption.transition;\n var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []);\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n if (key === 'style' || key === 'shape' || key === 'extra') {\n continue;\n }\n var elVal = el[key];\n if (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer(key, 'el.transition');\n }\n // Do not clone, animator will perform that clone.\n transFromProps[key] = elVal;\n }\n}\nfunction prepareTransformAllPropsFinal(el, elOption, allProps) {\n for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) {\n var legacyName = LEGACY_TRANSFORM_PROPS[i];\n var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];\n var legacyArr = elOption[legacyName];\n if (legacyArr) {\n allProps[xyName[0]] = legacyArr[0];\n allProps[xyName[1]] = legacyArr[1];\n }\n }\n for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n var key = TRANSFORMABLE_PROPS[i];\n if (elOption[key] != null) {\n allProps[key] = elOption[key];\n }\n }\n}\nfunction prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) {\n if (!styleOpt) {\n return;\n }\n var fromElStyle = fromEl.style;\n var transFromStyleProps;\n if (fromElStyle) {\n var styleTransition = styleOpt.transition;\n var elTransition = elOption.transition;\n if (styleTransition && !isTransitionAll(styleTransition)) {\n var transitionKeys = normalizeToArray(styleTransition);\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = fromElStyle[key];\n // Do not clone, see `checkNonStyleTansitionRefer`.\n transFromStyleProps[key] = elVal;\n }\n } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, 'style') >= 0)) {\n var animationProps = fromEl.getAnimationStyleProps();\n var animationStyleProps = animationProps ? animationProps.style : null;\n if (animationStyleProps) {\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n var styleKeys = keys(styleOpt);\n for (var i = 0; i < styleKeys.length; i++) {\n var key = styleKeys[i];\n if (animationStyleProps[key]) {\n var elVal = fromElStyle[key];\n transFromStyleProps[key] = elVal;\n }\n }\n }\n }\n }\n}\nfunction isNonStyleTransitionEnabled(optVal, elVal) {\n // The same as `checkNonStyleTansitionRefer`.\n return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;\n}\nvar checkTransformPropRefer;\nif (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer = function (key, usedIn) {\n if (!hasOwn(TRANSFORM_PROPS_MAP, key)) {\n warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.');\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { keys, filter, each, isArray, indexOf } from 'zrender/lib/core/util.js';\nimport { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { warn } from '../util/log.js';\nimport { makeInner } from '../util/model.js';\nvar getStateToRestore = makeInner();\nvar KEYFRAME_EXCLUDE_KEYS = ['percent', 'easing', 'shape', 'style', 'extra'];\n/**\n * Stop previous keyframe animation and restore the attributes.\n * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.\n */\nexport function stopPreviousKeyframeAnimationAndRestore(el) {\n // Stop previous keyframe animation.\n el.stopAnimation('keyframe');\n // Restore\n el.attr(getStateToRestore(el));\n}\nexport function applyKeyframeAnimation(el, animationOpts, animatableModel) {\n if (!animatableModel.isAnimationEnabled() || !animationOpts) {\n return;\n }\n if (isArray(animationOpts)) {\n each(animationOpts, function (singleAnimationOpts) {\n applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);\n });\n return;\n }\n var keyframes = animationOpts.keyframes;\n var duration = animationOpts.duration;\n if (animatableModel && duration == null) {\n // Default to use duration of config.\n // NOTE: animation config from payload will be ignored because they are mainly for transitions.\n var config = getAnimationConfig('enter', animatableModel, 0);\n duration = config && config.duration;\n }\n if (!keyframes || !duration) {\n return;\n }\n var stateToRestore = getStateToRestore(el);\n each(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) {\n if (targetPropName && !el[targetPropName]) {\n return;\n }\n var animator;\n var endFrameIsSet = false;\n // Sort keyframes by percent.\n keyframes.sort(function (a, b) {\n return a.percent - b.percent;\n });\n each(keyframes, function (kf) {\n // Stop current animation.\n var animators = el.animators;\n var kfValues = targetPropName ? kf[targetPropName] : kf;\n if (process.env.NODE_ENV !== 'production') {\n if (kf.percent >= 1) {\n endFrameIsSet = true;\n }\n }\n if (!kfValues) {\n return;\n }\n var propKeys = keys(kfValues);\n if (!targetPropName) {\n // PENDING performance?\n propKeys = filter(propKeys, function (key) {\n return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0;\n });\n }\n if (!propKeys.length) {\n return;\n }\n if (!animator) {\n animator = el.animate(targetPropName, animationOpts.loop, true);\n animator.scope = 'keyframe';\n }\n for (var i = 0; i < animators.length; i++) {\n // Stop all other animation that is not keyframe.\n if (animators[i] !== animator && animators[i].targetName === animator.targetName) {\n animators[i].stopTracks(propKeys);\n }\n }\n targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});\n var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;\n each(propKeys, function (key) {\n // Save original value.\n savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key];\n });\n animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing);\n });\n if (!animator) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!endFrameIsSet) {\n warn('End frame with percent: 1 is missing in the keyframeAnimation.', true);\n }\n }\n animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, indexOf } from 'zrender/lib/core/util.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport { setDefaultStateProxy, toggleHoverEmphasis } from '../../util/states.js';\nimport * as labelStyleHelper from '../../label/labelStyle.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { getLayoutOnAxis } from '../../layout/barGrid.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom.js';\nimport prepareGeo from '../../coord/geo/prepareCustom.js';\nimport prepareSingleAxis from '../../coord/single/prepareCustom.js';\nimport preparePolar from '../../coord/polar/prepareCustom.js';\nimport prepareCalendar from '../../coord/calendar/prepareCustom.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { convertToEC4StyleForCustomSerise, isEC4CompatibleStyle, convertFromEC4CompatibleStyle, warnDeprecated } from '../../util/styleCompat.js';\nimport { throwError } from '../../util/log.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { STYLE_VISUAL_TYPE, NON_STYLE_VISUAL_PROPS, customInnerStore } from './CustomSeries.js';\nimport { applyLeaveTransition, applyUpdateTransition } from '../../animation/customGraphicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal';\nvar BLUR = 'blur';\nvar SELECT = 'select';\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\nvar PATH_ITEM_STYLE = {\n normal: ['itemStyle'],\n emphasis: [EMPHASIS, 'itemStyle'],\n blur: [BLUR, 'itemStyle'],\n select: [SELECT, 'itemStyle']\n};\nvar PATH_LABEL = {\n normal: ['label'],\n emphasis: [EMPHASIS, 'label'],\n blur: [BLUR, 'label'],\n select: [SELECT, 'label']\n};\nvar DEFAULT_TRANSITION = ['x', 'y'];\n// Use prefix to avoid index to be the same as el.name,\n// which will cause weird update animation.\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\nvar attachedTxInfoTmp = {\n normal: {},\n emphasis: {},\n blur: {},\n select: {}\n};\n/**\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\n * of each coordinate systems are not required by each coordinate systems directly, but\n * required by the module `custom`.\n *\n * prepareInfoForCustomSeries {Function}: optional\n * @return {Object} {coordSys: {...}, api: {\n * coord: function (data, clamp) {}, // return point in global.\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\n * }}\n */\nvar prepareCustoms = {\n cartesian2d: prepareCartesian2d,\n geo: prepareGeo,\n single: prepareSingleAxis,\n polar: preparePolar,\n calendar: prepareCalendar\n};\nfunction isPath(el) {\n return el instanceof graphicUtil.Path;\n}\nfunction isDisplayable(el) {\n return el instanceof Displayable;\n}\nfunction copyElement(sourceEl, targetEl) {\n targetEl.copyTransform(sourceEl);\n if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {\n targetEl.setStyle(sourceEl.style);\n targetEl.z = sourceEl.z;\n targetEl.z2 = sourceEl.z2;\n targetEl.zlevel = sourceEl.zlevel;\n targetEl.invisible = sourceEl.invisible;\n targetEl.ignore = sourceEl.ignore;\n if (isPath(targetEl) && isPath(sourceEl)) {\n targetEl.setShape(sourceEl.shape);\n }\n }\n}\nvar CustomChartView = /** @class */function (_super) {\n __extends(CustomChartView, _super);\n function CustomChartView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CustomChartView.type;\n return _this;\n }\n CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var oldData = this._data;\n var data = customSeries.getData();\n var group = this.group;\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n if (!oldData) {\n // Previous render is incremental render or first render.\n // Needs remove the incremental rendered elements.\n group.removeAll();\n }\n data.diff(oldData).add(function (newIdx) {\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);\n }).update(function (newIdx, oldIdx) {\n var oldEl = oldData.getItemGraphicEl(oldIdx);\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).execute();\n // Do clipping\n var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n this._data = data;\n };\n CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\n this.group.removeAll();\n this._data = null;\n };\n CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\n var data = customSeries.getData();\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n var progressiveEls = this._progressiveEls = [];\n function setIncrementalAndHoverLayer(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n for (var idx = params.start; idx < params.end; idx++) {\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data);\n if (el) {\n el.traverse(setIncrementalAndHoverLayer);\n progressiveEls.push(el);\n }\n }\n };\n CustomChartView.prototype.eachRendered = function (cb) {\n graphicUtil.traverseElements(this._progressiveEls || this.group, cb);\n };\n CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\n var elementName = query.element;\n if (elementName == null || targetEl.name === elementName) {\n return true;\n }\n // Enable to give a name on a group made by `renderItem`, and listen\n // events that are triggered by its descendents.\n while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {\n if (targetEl.name === elementName) {\n return true;\n }\n }\n return false;\n };\n CustomChartView.type = 'custom';\n return CustomChartView;\n}(ChartView);\nexport default CustomChartView;\nfunction createEl(elOption) {\n var graphicType = elOption.type;\n var el;\n // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n if (graphicType === 'path') {\n var shape = elOption.shape;\n // Using pathRect brings convenience to users sacle svg path.\n var pathRect = shape.width != null && shape.height != null ? {\n x: shape.x || 0,\n y: shape.y || 0,\n width: shape.width,\n height: shape.height\n } : null;\n var pathData = getPathData(shape);\n // Path is also used for icon, so layout 'center' by default.\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n customInnerStore(el).customPathData = pathData;\n } else if (graphicType === 'image') {\n el = new graphicUtil.Image({});\n customInnerStore(el).customImagePath = elOption.style.image;\n } else if (graphicType === 'text') {\n el = new graphicUtil.Text({});\n // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;\n } else if (graphicType === 'group') {\n el = new graphicUtil.Group();\n } else if (graphicType === 'compoundPath') {\n throw new Error('\"compoundPath\" is not supported yet.');\n } else {\n var Clz = graphicUtil.getShapeClass(graphicType);\n if (!Clz) {\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n }\n throwError(errMsg);\n }\n el = new Clz();\n }\n customInnerStore(el).customGraphicType = graphicType;\n el.name = elOption.name;\n // Compat ec4: the default z2 lift is 1. If changing the number,\n // some cases probably be broken: hierarchy layout along z, like circle packing,\n // where emphasis only intending to modify color/border rather than lift z2.\n el.z2EmphasisLift = 1;\n el.z2SelectLift = 1;\n return el;\n}\nfunction updateElNormal(\n// Can be null/undefined\napi, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) {\n // Stop and restore before update any other attributes.\n stopPreviousKeyframeAnimationAndRestore(el);\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\n if (txCfgOpt) {\n // PENDING: whether use user object directly rather than clone?\n // TODO:5.0 textConfig transition animation?\n el.setTextConfig(txCfgOpt);\n }\n // Default transition ['x', 'y']\n if (elOption && elOption.transition == null) {\n elOption.transition = DEFAULT_TRANSITION;\n }\n // Do some normalization on style.\n var styleOpt = elOption && elOption.style;\n if (styleOpt) {\n if (el.type === 'text') {\n var textOptionStyle = styleOpt;\n // Compatible with ec4: if `textFill` or `textStroke` exists use them.\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\n }\n var decalPattern = void 0;\n var decalObj = isPath(el) ? styleOpt.decal : null;\n if (api && decalObj) {\n decalObj.dirty = true;\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\n }\n // Always overwrite in case user specify this prop.\n styleOpt.__decalPattern = decalPattern;\n }\n if (isDisplayable(el)) {\n if (styleOpt) {\n var decalPattern = styleOpt.__decalPattern;\n if (decalPattern) {\n styleOpt.decal = decalPattern;\n }\n }\n }\n applyUpdateTransition(el, elOption, seriesModel, {\n dataIndex: dataIndex,\n isInit: isInit,\n clearStyle: true\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);\n}\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) {\n var elDisplayable = el.isGroup ? null : el;\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;\n // PENDING:5.0 support customize scale change and transition animation?\n if (elDisplayable) {\n // By default support auto lift color when hover whether `emphasis` specified.\n var stateObj = elDisplayable.ensureState(state);\n if (styleOpt === false) {\n var existingEmphasisState = elDisplayable.getState(state);\n if (existingEmphasisState) {\n existingEmphasisState.style = null;\n }\n } else {\n // style is needed to enable default emphasis.\n stateObj.style = styleOpt || null;\n }\n // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\n // remove hover style.\n // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\n // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\n if (txCfgOpt) {\n stateObj.textConfig = txCfgOpt;\n }\n setDefaultStateProxy(elDisplayable);\n }\n}\nfunction updateZ(el, elOption, seriesModel) {\n // Group not support textContent and not support z yet.\n if (el.isGroup) {\n return;\n }\n var elDisplayable = el;\n var currentZ = seriesModel.currentZ;\n var currentZLevel = seriesModel.currentZLevel;\n // Always erase.\n elDisplayable.z = currentZ;\n elDisplayable.zlevel = currentZLevel;\n // z2 must not be null/undefined, otherwise sort error may occur.\n var optZ2 = elOption.z2;\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\n for (var i = 0; i < STATES.length; i++) {\n updateZForEachState(elDisplayable, elOption, STATES[i]);\n }\n}\nfunction updateZForEachState(elDisplayable, elOption, state) {\n var isNormal = state === NORMAL;\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\n var stateObj;\n if (optZ2 != null) {\n // Do not `ensureState` until required.\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\n stateObj.z2 = optZ2 || 0;\n }\n}\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n var renderItem = customSeries.get('renderItem');\n var coordSys = customSeries.coordinateSystem;\n var prepareResult = {};\n if (coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n assert(renderItem, 'series.render is required.');\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\n }\n // `coordSys.prepareCustoms` is used for external coord sys like bmap.\n prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);\n }\n var userAPI = defaults({\n getWidth: api.getWidth,\n getHeight: api.getHeight,\n getZr: api.getZr,\n getDevicePixelRatio: api.getDevicePixelRatio,\n value: value,\n style: style,\n ordinalRawValue: ordinalRawValue,\n styleEmphasis: styleEmphasis,\n visual: visual,\n barLayout: barLayout,\n currentSeriesIndices: currentSeriesIndices,\n font: font\n }, prepareResult.api || {});\n var userParams = {\n // The life cycle of context: current round of rendering.\n // The global life cycle is probably not necessary, because\n // user can store global status by themselves.\n context: {},\n seriesId: customSeries.id,\n seriesName: customSeries.name,\n seriesIndex: customSeries.seriesIndex,\n coordSys: prepareResult.coordSys,\n dataInsideLength: data.count(),\n encode: wrapEncodeDef(customSeries.getData())\n };\n // If someday intending to refactor them to a class, should consider do not\n // break change: currently these attribute member are encapsulated in a closure\n // so that do not need to force user to call these method with a scope.\n // Do not support call `api` asynchronously without dataIndexInside input.\n var currDataIndexInside;\n var currItemModel;\n var currItemStyleModels = {};\n var currLabelModels = {};\n var seriesItemStyleModels = {};\n var seriesLabelModels = {};\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);\n seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);\n }\n function getItemModel(dataIndexInside) {\n return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);\n }\n function getItemStyleModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\n }\n function getLabelModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\n }\n return function (dataIndexInside, payload) {\n currDataIndexInside = dataIndexInside;\n currItemModel = null;\n currItemStyleModels = {};\n currLabelModels = {};\n return renderItem && renderItem(defaults({\n dataIndexInside: dataIndexInside,\n dataIndex: data.getRawIndex(dataIndexInside),\n // Can be used for optimization when zoom or roam.\n actionType: payload ? payload.type : null\n }, userParams), userAPI);\n };\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n function value(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);\n }\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n function ordinalRawValue(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n dim = dim || 0;\n var dimInfo = data.getDimensionInfo(dim);\n if (!dimInfo) {\n var dimIndex = data.getDimensionIndex(dim);\n return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined;\n }\n var val = data.get(dimInfo.name, dataIndexInside);\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n return ordinalMeta ? ordinalMeta.categories[val] : val;\n }\n /**\n * @deprecated The original intention of `api.style` is enable to set itemStyle\n * like other series. But it is not necessary and not easy to give a strict definition\n * of what it returns. And since echarts5 it needs to be make compat work. So\n * deprecates it since echarts5.\n *\n * By default, `visual` is applied to style (to support visualMap).\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\n * it can be implemented as:\n * `api.style({stroke: api.visual('color'), fill: null})`;\n *\n * [Compat]: since ec5, RectText has been separated from its hosts el.\n * so `api.style()` will only return the style from `itemStyle` but not handle `label`\n * any more. But `series.label` config is never published in doc.\n * We still compat it in `api.style()`. But not encourage to use it and will still not\n * to pulish it to doc.\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n function style(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.style', 'Please write literal style directly instead.');\n }\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var style = data.getItemVisual(dataIndexInside, 'style');\n var visualColor = style && style.fill;\n var opacity = style && style.opacity;\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\n visualColor != null && (itemStyle.fill = visualColor);\n opacity != null && (itemStyle.opacity = opacity);\n var opt = {\n inheritColor: isString(visualColor) ? visualColor : '#000'\n };\n var labelModel = getLabelModel(dataIndexInside, NORMAL);\n // Now that the feature of \"auto adjust text fill/stroke\" has been migrated to zrender\n // since ec5, we should set `isAttached` as `false` here and make compat in\n // `convertToEC4StyleForCustomSerise`.\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n /**\n * @deprecated The reason see `api.style()`\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n function styleEmphasis(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\n }\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n function applyUserPropsAfter(itemStyle, extra) {\n for (var key in extra) {\n if (hasOwn(extra, key)) {\n itemStyle[key] = extra[key];\n }\n }\n }\n function preFetchFromExtra(extra, itemStyle) {\n // A trick to retrieve those props firstly, which are used to\n // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\n // (It's not reasonable but only for a degree of compat)\n if (extra) {\n extra.textFill && (itemStyle.textFill = extra.textFill);\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\n }\n }\n /**\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n function visual(visualType, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\n return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;\n }\n // Only support these visuals. Other visual might be inner tricky\n // for performance (like `style`), do not expose to users.\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\n return data.getItemVisual(dataIndexInside, visualType);\n }\n }\n /**\n * @public\n * @return If not support, return undefined.\n */\n function barLayout(opt) {\n if (coordSys.type === 'cartesian2d') {\n var baseAxis = coordSys.getBaseAxis();\n return getLayoutOnAxis(defaults({\n axis: baseAxis\n }, opt));\n }\n }\n /**\n * @public\n */\n function currentSeriesIndices() {\n return ecModel.getCurrentSeriesIndices();\n }\n /**\n * @public\n * @return font string\n */\n function font(opt) {\n return labelStyleHelper.getFont(opt, ecModel);\n }\n}\nfunction wrapEncodeDef(data) {\n var encodeDef = {};\n each(data.dimensions, function (dimName) {\n var dimInfo = data.getDimensionInfo(dimName);\n if (!dimInfo.isExtraCoord) {\n var coordDim = dimInfo.coordDim;\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);\n }\n });\n return encodeDef;\n}\nfunction createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) {\n // [Rule]\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n // most cases.)\n // The rule or \"merge\" see [STRATEGY_MERGE].\n // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\n if (!elOption) {\n group.remove(existsEl);\n return;\n }\n var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group);\n el && data.setItemGraphicEl(dataIndex, el);\n el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled);\n return el;\n}\nfunction doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) {\n if (process.env.NODE_ENV !== 'production') {\n assert(elOption, 'should not have an null/undefined element setting');\n }\n var toBeReplacedIdx = -1;\n var oldEl = existsEl;\n if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel)\n // || (\n // // PENDING: even in one-to-one mapping case, if el is marked as morph,\n // // do not sure whether the el will be mapped to another el with different\n // // hierarchy in Group tree. So always recreate el rather than reuse the el.\n // morphHelper && morphHelper.isOneToOneFrom(el)\n // )\n ) {\n // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\n toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);\n existsEl = null;\n }\n var isInit = !existsEl;\n var el = existsEl;\n if (!el) {\n el = createEl(elOption);\n if (oldEl) {\n copyElement(oldEl, el);\n }\n } else {\n // FIMXE:NEXT unified clearState?\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n el.clearStates();\n }\n // Need to set morph: false explictly to disable automatically morphing.\n if (elOption.morph === false) {\n el.disableMorphing = true;\n } else if (el.disableMorphing) {\n el.disableMorphing = false;\n }\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\n attachedTxInfoTmp.isLegacy = false;\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\n updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit);\n // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n // Update them only when user specified, otherwise, remain.\n hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info);\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n if (stateName !== NORMAL) {\n var otherStateOpt = retrieveStateOption(elOption, stateName);\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\n }\n }\n updateZ(el, elOption, seriesModel);\n if (elOption.type === 'group') {\n mergeChildren(api, el, dataIndex, elOption, seriesModel);\n }\n if (toBeReplacedIdx >= 0) {\n group.replaceAt(el, toBeReplacedIdx);\n } else {\n group.add(el);\n }\n return el;\n}\n// `el` must not be null/undefined.\nfunction doesElNeedRecreate(el, elOption, seriesModel) {\n var elInner = customInnerStore(el);\n var elOptionType = elOption.type;\n var elOptionShape = elOption.shape;\n var elOptionStyle = elOption.style;\n return (\n // Always create new if universal transition is enabled.\n // Because we do transition after render. It needs to know what old element is. Replacement will loose it.\n seriesModel.isUniversalTransitionEnabled()\n // If `elOptionType` is `null`, follow the merge principle.\n || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath\n // // FIXME test and remove this restriction?\n // || (elOptionType === 'text'\n // && hasOwn(elOptionStyle, 'text')\n // && (elOptionStyle as TextStyleProps).text !== elInner.customText\n // )\n );\n}\n\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\n // Based on the \"merge\" principle, if no clipPath provided,\n // do nothing. The exists clip will be totally removed only if\n // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\n var clipPathOpt = elOption.clipPath;\n if (clipPathOpt === false) {\n if (el && el.getClipPath()) {\n el.removeClipPath();\n }\n } else if (clipPathOpt) {\n var clipPath = el.getClipPath();\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) {\n clipPath = null;\n }\n if (!clipPath) {\n clipPath = createEl(clipPathOpt);\n if (process.env.NODE_ENV !== 'production') {\n assert(isPath(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\n }\n el.setClipPath(clipPath);\n }\n updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit);\n }\n // If not define `clipPath` in option, do nothing unnecessary.\n}\n\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\n // Group does not support textContent temporarily until necessary.\n if (el.isGroup) {\n return;\n }\n // Normal must be called before emphasis, for `isLegacy` detection.\n processTxInfo(elOption, null, attachedTxInfo);\n processTxInfo(elOption, EMPHASIS, attachedTxInfo);\n // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.\n // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\n // trade them as set to null to el.\n // Especially:\n // `elOption.textContent: false` means remove textContent.\n // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\n var txConOptNormal = attachedTxInfo.normal.conOpt;\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\n var txConOptBlur = attachedTxInfo.blur.conOpt;\n var txConOptSelect = attachedTxInfo.select.conOpt;\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\n var textContent = el.getTextContent();\n if (txConOptNormal === false) {\n textContent && el.removeTextContent();\n } else {\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {\n type: 'text'\n };\n if (!textContent) {\n textContent = createEl(txConOptNormal);\n el.setTextContent(textContent);\n } else {\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n textContent.clearStates();\n }\n updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n if (stateName !== NORMAL) {\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\n }\n }\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\n }\n }\n}\nfunction processTxInfo(elOption, state, attachedTxInfo) {\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\n var elType = elOption.type;\n var txCfg = stateOpt ? stateOpt.textConfig : null;\n var txConOptNormal = elOption.textContent;\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\n if (styleOpt && (\n // Because emphasis style has little info to detect legacy,\n // if normal is legacy, emphasis is trade as legacy.\n attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\n attachedTxInfo.isLegacy = true;\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);\n // Explicitly specified `textConfig` and `textContent` has higher priority than\n // the ones generated by legacy style. Otherwise if users use them and `api.style`\n // at the same time, they not both work and hardly to known why.\n if (!txCfg && convertResult.textConfig) {\n txCfg = convertResult.textConfig;\n }\n if (!txConOpt && convertResult.textContent) {\n txConOpt = convertResult.textContent;\n }\n }\n if (!state && txConOpt) {\n var txConOptNormal_1 = txConOpt;\n // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\n if (process.env.NODE_ENV !== 'production') {\n // Do not tolerate incorrcet type for forward compat.\n assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\n }\n }\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\n info.cfg = txCfg;\n info.conOpt = txConOpt;\n}\nfunction retrieveStateOption(elOption, state) {\n return !state ? elOption : elOption ? elOption[state] : null;\n}\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\n var style = stateOption && stateOption.style;\n if (style == null && state === EMPHASIS && stateOptionNormal) {\n style = stateOptionNormal.styleEmphasis;\n }\n return style;\n}\n// Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates\n// that the existing children will not be removed, and enables the feature\n// that update some of the props of some of the children simply by construct\n// the returned children of `renderItem` like:\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n// by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n// replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will\n// happen.\n// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the\n// `el` is a group, and if any of the new child is null, it means to remove\n// the element at the same index, if exists. On the other hand, if the new\n// child is and empty object `{}`, it means to keep the element not changed.\n//\n// For implementation simpleness, do not provide a direct way to remove single\n// child (otherwise the total indices of the children array have to be modified).\n// User can remove a single child by setting its `ignore` to `true`.\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel) {\n var newChildren = elOption.children;\n var newLen = newChildren ? newChildren.length : 0;\n var mergeChildren = elOption.$mergeChildren;\n // `diffChildrenByName` has been deprecated.\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n var notMerge = mergeChildren === false;\n // For better performance on roam update, only enter if necessary.\n if (!newLen && !byName && !notMerge) {\n return;\n }\n if (byName) {\n diffGroupChildren({\n api: api,\n oldChildren: el.children() || [],\n newChildren: newChildren || [],\n dataIndex: dataIndex,\n seriesModel: seriesModel,\n group: el\n });\n return;\n }\n notMerge && el.removeAll();\n // Mapping children of a group simply by index, which\n // might be better performance.\n var index = 0;\n for (; index < newLen; index++) {\n var newChild = newChildren[index];\n var oldChild = el.childAt(index);\n if (newChild) {\n if (newChild.ignore == null) {\n // The old child is set to be ignored if null (see comments\n // below). So we need to set ignore to be false back.\n newChild.ignore = false;\n }\n doCreateOrUpdateEl(api, oldChild, dataIndex, newChild, seriesModel, el);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(oldChild, 'renderItem should not return a group containing elements' + ' as null/undefined/{} if they do not exist before.');\n }\n // If the new element option is null, it means to remove the old\n // element. But we cannot really remove the element from the group\n // directly, because the element order may not be stable when this\n // element is added back. So we set the element to be ignored.\n oldChild.ignore = true;\n }\n }\n for (var i = el.childCount() - 1; i >= index; i--) {\n var child = el.childAt(i);\n removeChildFromGroup(el, child, seriesModel);\n }\n}\nfunction removeChildFromGroup(group, child, seriesModel) {\n // Do not support leave elements that are not mentioned in the latest\n // `renderItem` return. Otherwise users may not have a clear and simple\n // concept that how to control all of the elements.\n child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel);\n}\nfunction diffGroupChildren(context) {\n new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\nfunction getKey(item, idx) {\n var name = item && item.name;\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\nfunction processAddUpdate(newIndex, oldIndex) {\n var context = this.context;\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group);\n}\nfunction processRemove(oldIndex) {\n var context = this.context;\n var child = context.oldChildren[oldIndex];\n child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);\n}\n/**\n * @return SVG Path data.\n */\nfunction getPathData(shape) {\n // \"d\" follows the SVG convention.\n return shape && (shape.pathData || shape.d);\n}\nfunction hasOwnPathData(shape) {\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CustomSeriesModel from './CustomSeries.js';\nimport CustomChartView from './CustomView.js';\nexport function install(registers) {\n registers.registerChartView(CustomChartView);\n registers.registerSeriesModel(CustomSeriesModel);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as axisPointerModelHelper from './modelHelper.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\n * Base axis pointer class in 2D.\n */\nvar BaseAxisPointer = /** @class */function () {\n function BaseAxisPointer() {\n this._dragging = false;\n /**\n * In px, arbitrary value. Do not set too small,\n * no animation is ok for most cases.\n */\n this.animationThreshold = 15;\n }\n /**\n * @implement\n */\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n var value = axisPointerModel.get('value');\n var status = axisPointerModel.get('status');\n // Bind them to `this`, not in closure, otherwise they will not\n // be replaced when user calling setOption in not merge mode.\n this._axisModel = axisModel;\n this._axisPointerModel = axisPointerModel;\n this._api = api;\n // Optimize: `render` will be called repeatedly during mouse move.\n // So it is power consuming if performing `render` each time,\n // especially on mobile device.\n if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n return;\n }\n this._lastValue = value;\n this._lastStatus = status;\n var group = this._group;\n var handle = this._handle;\n if (!status || status === 'hide') {\n // Do not clear here, for animation better.\n group && group.hide();\n handle && handle.hide();\n return;\n }\n group && group.show();\n handle && handle.show();\n // Otherwise status is 'show'\n var elOption = {};\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\n // Enable change axis pointer type.\n var graphicKey = elOption.graphicKey;\n if (graphicKey !== this._lastGraphicKey) {\n this.clear(api);\n }\n this._lastGraphicKey = graphicKey;\n var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n if (!group) {\n group = this._group = new graphic.Group();\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n api.getZr().add(group);\n } else {\n var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n this.updatePointerEl(group, elOption, doUpdateProps);\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n }\n updateMandatoryProps(group, axisPointerModel, true);\n this._renderHandle(value);\n };\n /**\n * @implement\n */\n BaseAxisPointer.prototype.remove = function (api) {\n this.clear(api);\n };\n /**\n * @implement\n */\n BaseAxisPointer.prototype.dispose = function (api) {\n this.clear(api);\n };\n /**\n * @protected\n */\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n var animation = axisPointerModel.get('animation');\n var axis = axisModel.axis;\n var isCategoryAxis = axis.type === 'category';\n var useSnap = axisPointerModel.get('snap');\n // Value axis without snap always do not snap.\n if (!useSnap && !isCategoryAxis) {\n return false;\n }\n if (animation === 'auto' || animation == null) {\n var animationThreshold = this.animationThreshold;\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n return true;\n }\n // It is important to auto animation when snap used. Consider if there is\n // a dataZoom, animation will be disabled when too many points exist, while\n // it will be enabled for better visual effect when little points exist.\n if (useSnap) {\n var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n var axisExtent = axis.getExtent();\n // Approximate band width\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n }\n return false;\n }\n return animation === true;\n };\n /**\n * add {pointer, label, graphicKey} to elOption\n * @protected\n */\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n // Should be implemenented by sub-class.\n };\n /**\n * @protected\n */\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n var pointerOption = elOption.pointer;\n if (pointerOption) {\n var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n group.add(pointerEl);\n }\n };\n /**\n * @protected\n */\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n if (elOption.label) {\n var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n group.add(labelEl);\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @protected\n */\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n var pointerEl = inner(group).pointerEl;\n if (pointerEl && elOption.pointer) {\n pointerEl.setStyle(elOption.pointer.style);\n updateProps(pointerEl, {\n shape: elOption.pointer.shape\n });\n }\n };\n /**\n * @protected\n */\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n var labelEl = inner(group).labelEl;\n if (labelEl) {\n labelEl.setStyle(elOption.label.style);\n updateProps(labelEl, {\n // Consider text length change in vertical axis, animation should\n // be used on shape, otherwise the effect will be weird.\n // TODOTODO\n // shape: elOption.label.shape,\n x: elOption.label.x,\n y: elOption.label.y\n });\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\n * @private\n */\n BaseAxisPointer.prototype._renderHandle = function (value) {\n if (this._dragging || !this.updateHandleTransform) {\n return;\n }\n var axisPointerModel = this._axisPointerModel;\n var zr = this._api.getZr();\n var handle = this._handle;\n var handleModel = axisPointerModel.getModel('handle');\n var status = axisPointerModel.get('status');\n if (!handleModel.get('show') || !status || status === 'hide') {\n handle && zr.remove(handle);\n this._handle = null;\n return;\n }\n var isInit;\n if (!this._handle) {\n isInit = true;\n handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n cursor: 'move',\n draggable: true,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n drift: bind(this._onHandleDragMove, this),\n ondragend: bind(this._onHandleDragEnd, this)\n });\n zr.add(handle);\n }\n updateMandatoryProps(handle, axisPointerModel, false);\n // update style\n handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY']));\n // update position\n var handleSize = handleModel.get('size');\n if (!zrUtil.isArray(handleSize)) {\n handleSize = [handleSize, handleSize];\n }\n handle.scaleX = handleSize[0] / 2;\n handle.scaleY = handleSize[1] / 2;\n throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n this._moveHandleToValue(value, isInit);\n };\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n };\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n var handle = this._handle;\n if (!handle) {\n return;\n }\n this._dragging = true;\n // Persistent for throttle.\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n this._payloadInfo = trans;\n handle.stopAnimation();\n handle.attr(getHandleTransProps(trans));\n inner(handle).lastProp = null;\n this._doDispatchAxisPointer();\n };\n /**\n * Throttled method.\n */\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n var handle = this._handle;\n if (!handle) {\n return;\n }\n var payloadInfo = this._payloadInfo;\n var axisModel = this._axisModel;\n this._api.dispatchAction({\n type: 'updateAxisPointer',\n x: payloadInfo.cursorPoint[0],\n y: payloadInfo.cursorPoint[1],\n tooltipOption: payloadInfo.tooltipOption,\n axesInfo: [{\n axisDim: axisModel.axis.dim,\n axisIndex: axisModel.componentIndex\n }]\n });\n };\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\n this._dragging = false;\n var handle = this._handle;\n if (!handle) {\n return;\n }\n var value = this._axisPointerModel.get('value');\n // Consider snap or categroy axis, handle may be not consistent with\n // axisPointer. So move handle to align the exact value position when\n // drag ended.\n this._moveHandleToValue(value);\n // For the effect: tooltip will be shown when finger holding on handle\n // button, and will be hidden after finger left handle button.\n this._api.dispatchAction({\n type: 'hideTip'\n });\n };\n /**\n * @private\n */\n BaseAxisPointer.prototype.clear = function (api) {\n this._lastValue = null;\n this._lastStatus = null;\n var zr = api.getZr();\n var group = this._group;\n var handle = this._handle;\n if (zr && group) {\n this._lastGraphicKey = null;\n group && zr.remove(group);\n handle && zr.remove(handle);\n this._group = null;\n this._handle = null;\n this._payloadInfo = null;\n }\n throttleUtil.clear(this, '_doDispatchAxisPointer');\n };\n /**\n * @protected\n */\n BaseAxisPointer.prototype.doClear = function () {\n // Implemented by sub-class if necessary.\n };\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n };\n return BaseAxisPointer;\n}();\nfunction updateProps(animationModel, moveAnimation, el, props) {\n // Animation optimize.\n if (!propsEqual(inner(el).lastProp, props)) {\n inner(el).lastProp = props;\n moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n }\n}\nfunction propsEqual(lastProps, newProps) {\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n var equals_1 = true;\n zrUtil.each(newProps, function (item, key) {\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\n });\n return !!equals_1;\n } else {\n return lastProps === newProps;\n }\n}\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\nfunction getHandleTransProps(trans) {\n return {\n x: trans.x || 0,\n y: trans.y || 0,\n rotation: trans.rotation || 0\n };\n}\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n var z = axisPointerModel.get('z');\n var zlevel = axisPointerModel.get('zlevel');\n group && group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n el.silent = silent;\n }\n });\n}\nexport default BaseAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nexport function buildElStyle(axisPointerModel) {\n var axisPointerType = axisPointerModel.get('type');\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\n var style;\n if (axisPointerType === 'line') {\n style = styleModel.getLineStyle();\n style.fill = null;\n } else if (axisPointerType === 'shadow') {\n style = styleModel.getAreaStyle();\n style.stroke = null;\n }\n return style;\n}\n/**\n * @param {Function} labelPos {align, verticalAlign, position}\n */\nexport function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\n var value = axisPointerModel.get('value');\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n });\n var labelModel = axisPointerModel.getModel('label');\n var paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);\n var font = labelModel.getFont();\n var textRect = textContain.getBoundingRect(text, font);\n var position = labelPos.position;\n var width = textRect.width + paddings[1] + paddings[3];\n var height = textRect.height + paddings[0] + paddings[2];\n // Adjust by align.\n var align = labelPos.align;\n align === 'right' && (position[0] -= width);\n align === 'center' && (position[0] -= width / 2);\n var verticalAlign = labelPos.verticalAlign;\n verticalAlign === 'bottom' && (position[1] -= height);\n verticalAlign === 'middle' && (position[1] -= height / 2);\n // Not overflow ec container\n confineInContainer(position, width, height, api);\n var bgColor = labelModel.get('backgroundColor');\n if (!bgColor || bgColor === 'auto') {\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\n }\n elOption.label = {\n // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},\n x: position[0],\n y: position[1],\n style: createTextStyle(labelModel, {\n text: text,\n font: font,\n fill: labelModel.getTextColor(),\n padding: paddings,\n backgroundColor: bgColor\n }),\n // Label should be over axisPointer.\n z2: 10\n };\n}\n// Do not overflow ec container\nfunction confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n}\nexport function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\n value = axis.scale.parse(value);\n var text = axis.scale.getLabel({\n value: value\n }, {\n // If `precision` is set, width can be fixed (like '12.00500'), which\n // helps to debounce when when moving label.\n precision: opt.precision\n });\n var formatter = opt.formatter;\n if (formatter) {\n var params_1 = {\n value: axisHelper.getAxisRawValue(axis, {\n value: value\n }),\n axisDimension: axis.dim,\n axisIndex: axis.index,\n seriesData: []\n };\n zrUtil.each(seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var dataParams = series && series.getDataParams(dataIndex);\n dataParams && params_1.seriesData.push(dataParams);\n });\n if (zrUtil.isString(formatter)) {\n text = formatter.replace('{value}', text);\n } else if (zrUtil.isFunction(formatter)) {\n text = formatter(params_1);\n }\n }\n return text;\n}\nexport function getTransformedPosition(axis, value, layoutInfo) {\n var transform = matrix.create();\n matrix.rotate(transform, transform, layoutInfo.rotation);\n matrix.translate(transform, transform, layoutInfo.position);\n return graphic.applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform);\n}\nexport function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\n // @ts-ignore\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\n align: textLayout.textAlign,\n verticalAlign: textLayout.textVerticalAlign\n });\n}\nexport function makeLineShape(p1, p2, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x1: p1[xDimIndex],\n y1: p1[1 - xDimIndex],\n x2: p2[xDimIndex],\n y2: p2[1 - xDimIndex]\n };\n}\nexport function makeRectShape(xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n}\nexport function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\n return {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: true\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\nvar CartesianAxisPointer = /** @class */function (_super) {\n __extends(CartesianAxisPointer, _super);\n function CartesianAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @override\n */\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisPointerType = axisPointerModel.get('type');\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n var layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\n viewHelper.buildCartesianSingleLabelElOption(\n // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\n * @override\n */\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\n labelInside: false\n });\n // @ts-ignore\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var pos = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: pos[0],\n y: pos[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\n * @override\n */\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisExtent = axis.getGlobalExtent(true);\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var dimIndex = axis.dim === 'x' ? 0 : 1;\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex];\n // Make tooltip do not overlap axisPointer and in the middle of the grid.\n var tooltipOptions = [{\n verticalAlign: 'middle'\n }, {\n align: 'center'\n }];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: tooltipOptions[dimIndex]\n };\n };\n return CartesianAxisPointer;\n}(BaseAxisPointer);\nfunction getCartesian(grid, axis) {\n var opt = {};\n opt[axis.dim + 'AxisIndex'] = axis.index;\n return grid.getCartesian(opt);\n}\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n };\n }\n};\nfunction getAxisDimIndex(axis) {\n return axis.dim === 'x' ? 0 : 1;\n}\nexport default CartesianAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nvar AxisPointerModel = /** @class */function (_super) {\n __extends(AxisPointerModel, _super);\n function AxisPointerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = AxisPointerModel.type;\n return _this;\n }\n AxisPointerModel.type = 'axisPointer';\n AxisPointerModel.defaultOption = {\n // 'auto' means that show when triggered by tooltip or handle.\n show: 'auto',\n // zlevel: 0,\n z: 50,\n type: 'line',\n // axispointer triggered by tootip determine snap automatically,\n // see `modelHelper`.\n snap: false,\n triggerTooltip: true,\n triggerEmphasis: true,\n value: null,\n status: null,\n link: [],\n // Do not set 'auto' here, otherwise global animation: false\n // will not effect at this axispointer.\n animation: null,\n animationDurationUpdate: 200,\n lineStyle: {\n color: '#B9BEC9',\n width: 1,\n type: 'dashed'\n },\n shadowStyle: {\n color: 'rgba(210,219,238,0.2)'\n },\n label: {\n show: true,\n formatter: null,\n precision: 'auto',\n margin: 3,\n color: '#fff',\n padding: [5, 7, 5, 7],\n backgroundColor: 'auto',\n borderColor: null,\n borderWidth: 0,\n borderRadius: 3\n },\n handle: {\n show: false,\n // eslint-disable-next-line\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',\n size: 45,\n // handle margin is from symbol center to axis, which is stable when circular move.\n margin: 50,\n // color: '#1b8bbd'\n // color: '#2f4554'\n color: '#333',\n shadowBlur: 3,\n shadowColor: '#aaa',\n shadowOffsetX: 0,\n shadowOffsetY: 2,\n // For mobile performance\n throttle: 40\n }\n };\n return AxisPointerModel;\n}(ComponentModel);\nexport default AxisPointerModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar each = zrUtil.each;\n/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n * @param {Function} handler\n * param: {string} currTrigger\n * param: {Array.} point\n */\nexport function register(key, api, handler) {\n if (env.node) {\n return;\n }\n var zr = api.getZr();\n inner(zr).records || (inner(zr).records = {});\n initGlobalListeners(zr, api);\n var record = inner(zr).records[key] || (inner(zr).records[key] = {});\n record.handler = handler;\n}\nfunction initGlobalListeners(zr, api) {\n if (inner(zr).initialized) {\n return;\n }\n inner(zr).initialized = true;\n useHandler('click', zrUtil.curry(doEnter, 'click'));\n useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove'));\n // useHandler('mouseout', onLeave);\n useHandler('globalout', onLeave);\n function useHandler(eventType, cb) {\n zr.on(eventType, function (e) {\n var dis = makeDispatchAction(api);\n each(inner(zr).records, function (record) {\n record && cb(record, e, dis.dispatchAction);\n });\n dispatchTooltipFinally(dis.pendings, api);\n });\n }\n}\nfunction dispatchTooltipFinally(pendings, api) {\n var showLen = pendings.showTip.length;\n var hideLen = pendings.hideTip.length;\n var actuallyPayload;\n if (showLen) {\n actuallyPayload = pendings.showTip[showLen - 1];\n } else if (hideLen) {\n actuallyPayload = pendings.hideTip[hideLen - 1];\n }\n if (actuallyPayload) {\n actuallyPayload.dispatchAction = null;\n api.dispatchAction(actuallyPayload);\n }\n}\nfunction onLeave(record, e, dispatchAction) {\n record.handler('leave', null, dispatchAction);\n}\nfunction doEnter(currTrigger, record, e, dispatchAction) {\n record.handler(currTrigger, e, dispatchAction);\n}\nfunction makeDispatchAction(api) {\n var pendings = {\n showTip: [],\n hideTip: []\n };\n // FIXME\n // better approach?\n // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n // So we have to add \"final stage\" to merge those dispatched actions.\n var dispatchAction = function (payload) {\n var pendingList = pendings[payload.type];\n if (pendingList) {\n pendingList.push(payload);\n } else {\n payload.dispatchAction = dispatchAction;\n api.dispatchAction(payload);\n }\n };\n return {\n dispatchAction: dispatchAction,\n pendings: pendings\n };\n}\nexport function unregister(key, api) {\n if (env.node) {\n return;\n }\n var zr = api.getZr();\n var record = (inner(zr).records || {})[key];\n if (record) {\n inner(zr).records[key] = null;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as globalListener from './globalListener.js';\nimport ComponentView from '../../view/Component.js';\nvar AxisPointerView = /** @class */function (_super) {\n __extends(AxisPointerView, _super);\n function AxisPointerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = AxisPointerView.type;\n return _this;\n }\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click';\n // Register global listener in AxisPointerView to enable\n // AxisPointerView to be independent to Tooltip.\n globalListener.register('axisPointer', api, function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\n dispatchAction({\n type: 'updateAxisPointer',\n currTrigger: currTrigger,\n x: e && e.offsetX,\n y: e && e.offsetY\n });\n }\n });\n };\n AxisPointerView.prototype.remove = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n AxisPointerView.prototype.dispose = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n AxisPointerView.type = 'axisPointer';\n return AxisPointerView;\n}(ComponentView);\nexport default AxisPointerView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\n/**\n * @param finder contains {seriesIndex, dataIndex, dataIndexInside}\n * @param ecModel\n * @return {point: [x, y], el: ...} point Will not be null.\n */\nexport default function findPointFromSeries(finder, ecModel) {\n var point = [];\n var seriesIndex = finder.seriesIndex;\n var seriesModel;\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\n return {\n point: []\n };\n }\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, finder);\n if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\n return {\n point: []\n };\n }\n var el = data.getItemGraphicEl(dataIndex);\n var coordSys = seriesModel.coordinateSystem;\n if (seriesModel.getTooltipPosition) {\n point = seriesModel.getTooltipPosition(dataIndex) || [];\n } else if (coordSys && coordSys.dataToPoint) {\n if (finder.isStacked) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueAxisDim = valueAxis.dim;\n var baseAxisDim = baseAxis.dim;\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var baseDim = data.mapDimension(baseAxisDim);\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\n point = coordSys.dataToPoint(stackedData) || [];\n } else {\n point = coordSys.dataToPoint(data.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }), dataIndex)) || [];\n }\n } else if (el) {\n // Use graphic bounding rect\n var rect = el.getBoundingRect().clone();\n rect.applyTransform(el.transform);\n point = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n }\n return {\n point: point,\n el: el\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { makeInner } from '../../util/model.js';\nimport * as modelHelper from './modelHelper.js';\nimport findPointFromSeries from './findPointFromSeries.js';\nimport { each, curry, bind, extend } from 'zrender/lib/core/util.js';\nvar inner = makeInner();\n/**\n * Basic logic: check all axis, if they do not demand show/highlight,\n * then hide/downplay them.\n *\n * @return content of event obj for echarts.connect.\n */\nexport default function axisTrigger(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\n // Pending\n // See #6121. But we are not able to reproduce it yet.\n if (!coordSysAxesInfo) {\n return;\n }\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n var isIllegalPoint = illegalPoint(point);\n // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n // and dataIndex.\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputPayload = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: curry(showPointer, showValueMap),\n showTooltip: curry(showTooltip, dataByCoordSys)\n };\n // Process for triggered axes.\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\n // If no inputAxesInfo, no axis is restricted.\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n }\n });\n });\n // Process for linked axes.\n var linkTriggers = {};\n each(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup;\n // If axis has been triggered in the previous stage, it should not be triggered by link.\n if (linkGroup && !showValueMap[tarKey]) {\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey];\n // If srcValItem exist, source axis is triggered, so link to target axis.\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n each(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n });\n updateModelActually(showValueMap, axesInfo, outputPayload);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputPayload;\n}\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\n var axis = axisInfo.axis;\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\n return;\n }\n if (!axisInfo.involveSeries) {\n updaters.showPointer(axisInfo, newValue);\n return;\n }\n // Heavy calculation. So put it after axis.containData checking.\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\n var payloadBatch = payloadInfo.payloadBatch;\n var snapToValue = payloadInfo.snapToValue;\n // Fill content of event obj for echarts.connect.\n // By default use the first involved series data as a sample to connect.\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\n extend(outputFinder, payloadBatch[0]);\n }\n // If no linkSource input, this process is for collecting link\n // target, where snap should not be accepted.\n if (!noSnap && axisInfo.snap) {\n if (axis.containData(snapToValue) && snapToValue != null) {\n newValue = snapToValue;\n }\n }\n updaters.showPointer(axisInfo, newValue, payloadBatch);\n // Tooltip should always be snapToValue, otherwise there will be\n // incorrect \"axis value ~ series value\" mapping displayed in tooltip.\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\n}\nfunction buildPayloadsBySeries(value, axisInfo) {\n var axis = axisInfo.axis;\n var dim = axis.dim;\n var snapToValue = value;\n var payloadBatch = [];\n var minDist = Number.MAX_VALUE;\n var minDiff = -1;\n each(axisInfo.seriesModels, function (series, idx) {\n var dataDim = series.getData().mapDimensionsAll(dim);\n var seriesNestestValue;\n var dataIndices;\n if (series.getAxisTooltipData) {\n var result = series.getAxisTooltipData(dataDim, value, axis);\n dataIndices = result.dataIndices;\n seriesNestestValue = result.nestestValue;\n } else {\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value,\n // Add a threshold to avoid find the wrong dataIndex\n // when data length is not same.\n // false,\n axis.type === 'category' ? 0.5 : null);\n if (!dataIndices.length) {\n return;\n }\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\n }\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\n return;\n }\n var diff = value - seriesNestestValue;\n var dist = Math.abs(diff);\n // Consider category case\n if (dist <= minDist) {\n if (dist < minDist || diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n snapToValue = seriesNestestValue;\n payloadBatch.length = 0;\n }\n each(dataIndices, function (dataIndex) {\n payloadBatch.push({\n seriesIndex: series.seriesIndex,\n dataIndexInside: dataIndex,\n dataIndex: series.getData().getRawIndex(dataIndex)\n });\n });\n }\n });\n return {\n payloadBatch: payloadBatch,\n snapToValue: snapToValue\n };\n}\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\n showValueMap[axisInfo.key] = {\n value: value,\n payloadBatch: payloadBatch\n };\n}\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\n var payloadBatch = payloadInfo.payloadBatch;\n var axis = axisInfo.axis;\n var axisModel = axis.model;\n var axisPointerModel = axisInfo.axisPointerModel;\n // If no data, do not create anything in dataByCoordSys,\n // whose length will be used to judge whether dispatch action.\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\n return;\n }\n var coordSysModel = axisInfo.coordSys.model;\n var coordSysKey = modelHelper.makeKey(coordSysModel);\n var coordSysItem = dataByCoordSys.map[coordSysKey];\n if (!coordSysItem) {\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\n coordSysId: coordSysModel.id,\n coordSysIndex: coordSysModel.componentIndex,\n coordSysType: coordSysModel.type,\n coordSysMainType: coordSysModel.mainType,\n dataByAxis: []\n };\n dataByCoordSys.list.push(coordSysItem);\n }\n coordSysItem.dataByAxis.push({\n axisDim: axis.dim,\n axisIndex: axisModel.componentIndex,\n axisType: axisModel.type,\n axisId: axisModel.id,\n value: value,\n // Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n // depends that all models have been updated. So it should not be performed\n // here. Considering axisPointerModel used here is volatile, which is hard\n // to be retrieve in TooltipView, we prepare parameters here.\n valueLabelOpt: {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n },\n seriesDataIndices: payloadBatch.slice()\n });\n}\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\n var outputAxesInfo = outputPayload.axesInfo = [];\n // Basic logic: If no 'show' required, 'hide' this axisPointer.\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n var valItem = showValueMap[key];\n if (valItem) {\n !axisInfo.useHandle && (option.status = 'show');\n option.value = valItem.value;\n // For label formatter param and highlight.\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\n }\n // When always show (e.g., handle used), remain\n // original value and status.\n else {\n // If hide, value still need to be set, consider\n // click legend to toggle axis blank.\n !axisInfo.useHandle && (option.status = 'hide');\n }\n // If status is 'hide', should be no info in payload.\n option.status === 'show' && outputAxesInfo.push({\n axisDim: axisInfo.axis.dim,\n axisIndex: axisInfo.axis.model.componentIndex,\n value: option.value\n });\n });\n}\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\n // Basic logic: If no showTip required, hideTip will be dispatched.\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\n dispatchAction({\n type: 'hideTip'\n });\n return;\n }\n // In most case only one axis (or event one series is used). It is\n // convenient to fetch payload.seriesIndex and payload.dataIndex\n // directly. So put the first seriesIndex and dataIndex of the first\n // axis on the payload.\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\n dispatchAction({\n type: 'showTip',\n escapeConnect: true,\n x: point[0],\n y: point[1],\n tooltipOption: payload.tooltipOption,\n position: payload.position,\n dataIndexInside: sampleItem.dataIndexInside,\n dataIndex: sampleItem.dataIndex,\n seriesIndex: sampleItem.seriesIndex,\n dataByCoordSys: dataByCoordSys.list\n });\n}\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\n // FIXME\n // highlight status modification should be a stage of main process?\n // (Consider confilct (e.g., legend and axisPointer) and setOption)\n var zr = api.getZr();\n var highDownKey = 'axisPointerLastHighlights';\n var lastHighlights = inner(zr)[highDownKey] || {};\n var newHighlights = inner(zr)[highDownKey] = {};\n // Update highlight/downplay status according to axisPointer model.\n // Build hash map and remove duplicate incidentally.\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n option.status === 'show' && axisInfo.triggerEmphasis && each(option.seriesDataIndices, function (batchItem) {\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\n newHighlights[key] = batchItem;\n });\n });\n // Diff.\n var toHighlight = [];\n var toDownplay = [];\n each(lastHighlights, function (batchItem, key) {\n !newHighlights[key] && toDownplay.push(batchItem);\n });\n each(newHighlights, function (batchItem, key) {\n !lastHighlights[key] && toHighlight.push(batchItem);\n });\n toDownplay.length && api.dispatchAction({\n type: 'downplay',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toDownplay\n });\n toHighlight.length && api.dispatchAction({\n type: 'highlight',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toHighlight\n });\n}\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\n var inputAxisInfo = inputAxesInfo[i];\n if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\n return inputAxisInfo;\n }\n }\n}\nfunction makeMapperParam(axisInfo) {\n var axisModel = axisInfo.axis.model;\n var item = {};\n var dim = item.axisDim = axisInfo.axis.dim;\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\n return item;\n}\nfunction illegalPoint(point) {\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport AxisView from '../axis/AxisView.js';\nimport CartesianAxisPointer from './CartesianAxisPointer.js';\nimport AxisPointerModel from './AxisPointerModel.js';\nimport AxisPointerView from './AxisPointerView.js';\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { collect } from './modelHelper.js';\nimport axisTrigger from './axisTrigger.js';\nexport function install(registers) {\n // CartesianAxisPointer is not supposed to be required here. But consider\n // echarts.simple.js and online build tooltip, which only require gridSimple,\n // CartesianAxisPointer should be able to required somewhere.\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n registers.registerComponentModel(AxisPointerModel);\n registers.registerComponentView(AxisPointerView);\n registers.registerPreprocessor(function (option) {\n // Always has a global axisPointerModel for default setting.\n if (option) {\n (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n var link = option.axisPointer.link;\n // Normalize to array to avoid object mergin. But if link\n // is not set, remain null/undefined, otherwise it will\n // override existent link setting.\n if (link && !isArray(link)) {\n option.axisPointer.link = [link];\n }\n }\n });\n // This process should proformed after coordinate systems created\n // and series data processed. So put it on statistic processing stage.\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n // allAxesInfo should be updated when setOption performed.\n ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n });\n // Broadcast to all views.\n registers.registerAction({\n type: 'updateAxisPointer',\n event: 'updateAxisPointer',\n update: ':updateAxisPointer'\n }, axisTrigger);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { install as installSimple } from './installSimple.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nexport function install(registers) {\n use(installSimple);\n use(installAxisPointer);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nvar PolarAxisPointer = /** @class */function (_super) {\n __extends(PolarAxisPointer, _super);\n function PolarAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @override\n */\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n if (axis.dim === 'angle') {\n this.animationThreshold = Math.PI / 18;\n }\n var polar = axis.polar;\n var otherAxis = polar.getOtherAxis(axis);\n var otherExtent = otherAxis.getExtent();\n var coordValue = axis.dataToCoord(value);\n var axisPointerType = axisPointerModel.get('type');\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, polar, coordValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n var labelMargin = axisPointerModel.get(['label', 'margin']);\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\n viewHelper.buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\n };\n return PolarAxisPointer;\n}(BaseAxisPointer);\n;\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\n var axis = axisModel.axis;\n var coord = axis.dataToCoord(value);\n var axisAngle = polar.getAngleAxis().getExtent()[0];\n axisAngle = axisAngle / 180 * Math.PI;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var position;\n var align;\n var verticalAlign;\n if (axis.dim === 'radius') {\n var transform = matrix.create();\n matrix.rotate(transform, transform, axisAngle);\n matrix.translate(transform, transform, [polar.cx, polar.cy]);\n position = graphic.applyTransform([coord, -labelMargin], transform);\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\n // @ts-ignore\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\n align = labelLayout.textAlign;\n verticalAlign = labelLayout.textVerticalAlign;\n } else {\n // angle axis\n var r = radiusExtent[1];\n position = polar.coordToPoint([r + labelMargin, coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right';\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom';\n }\n return {\n position: position,\n align: align,\n verticalAlign: verticalAlign\n };\n}\nvar pointerShapeBuilder = {\n line: function (axis, polar, coordValue, otherExtent) {\n return axis.dim === 'angle' ? {\n type: 'Line',\n shape: viewHelper.makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\n } : {\n type: 'Circle',\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: coordValue\n }\n };\n },\n shadow: function (axis, polar, coordValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var radian = Math.PI / 180;\n return axis.dim === 'angle' ? {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1],\n // In ECharts y is negative if angle is positive\n (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\n } : {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\n };\n }\n};\nexport default PolarAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nvar PolarModel = /** @class */function (_super) {\n __extends(PolarModel, _super);\n function PolarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = PolarModel.type;\n return _this;\n }\n PolarModel.prototype.findAxisModel = function (axisType) {\n var foundAxisModel;\n var ecModel = this.ecModel;\n ecModel.eachComponent(axisType, function (axisModel) {\n if (axisModel.getCoordSysModel() === this) {\n foundAxisModel = axisModel;\n }\n }, this);\n return foundAxisModel;\n };\n PolarModel.type = 'polar';\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\n PolarModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '80%'\n };\n return PolarModel;\n}(ComponentModel);\nexport default PolarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar PolarAxisModel = /** @class */function (_super) {\n __extends(PolarAxisModel, _super);\n function PolarAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PolarAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n };\n PolarAxisModel.type = 'polarAxis';\n return PolarAxisModel;\n}(ComponentModel);\nzrUtil.mixin(PolarAxisModel, AxisModelCommonMixin);\nexport { PolarAxisModel };\nvar AngleAxisModel = /** @class */function (_super) {\n __extends(AngleAxisModel, _super);\n function AngleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = AngleAxisModel.type;\n return _this;\n }\n AngleAxisModel.type = 'angleAxis';\n return AngleAxisModel;\n}(PolarAxisModel);\nexport { AngleAxisModel };\nvar RadiusAxisModel = /** @class */function (_super) {\n __extends(RadiusAxisModel, _super);\n function RadiusAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = RadiusAxisModel.type;\n return _this;\n }\n RadiusAxisModel.type = 'radiusAxis';\n return RadiusAxisModel;\n}(PolarAxisModel);\nexport { RadiusAxisModel };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar RadiusAxis = /** @class */function (_super) {\n __extends(RadiusAxis, _super);\n function RadiusAxis(scale, radiusExtent) {\n return _super.call(this, 'radius', scale, radiusExtent) || this;\n }\n RadiusAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n return RadiusAxis;\n}(Axis);\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\nexport default RadiusAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport Axis from '../Axis.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar AngleAxis = /** @class */function (_super) {\n __extends(AngleAxis, _super);\n function AngleAxis(scale, angleExtent) {\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\n }\n AngleAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n /**\n * Only be called in category axis.\n * Angle axis uses text height to decide interval\n *\n * @override\n * @return {number} Auto interval for cateogry axis tick and label\n */\n AngleAxis.prototype.calculateCategoryInterval = function () {\n var axis = this;\n var labelModel = axis.getLabelModel();\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n var tickCount = ordinalScale.count();\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitH = Math.abs(unitSpan);\n // Not precise, just use height as text width\n // and each distance from axis line yet.\n var rect = textContain.getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\n var maxH = Math.max(rect.height, 7);\n var dh = maxH / unitH;\n // 0/0 is NaN, 1/0 is Infinity.\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(dh));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount;\n // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1\n // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n }\n // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n return interval;\n };\n return AngleAxis;\n}(Axis);\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\nexport default AngleAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport RadiusAxis from './RadiusAxis.js';\nimport AngleAxis from './AngleAxis.js';\nexport var polarDimensions = ['radius', 'angle'];\nvar Polar = /** @class */function () {\n function Polar(name) {\n this.dimensions = polarDimensions;\n this.type = 'polar';\n /**\n * x of polar center\n */\n this.cx = 0;\n /**\n * y of polar center\n */\n this.cy = 0;\n this._radiusAxis = new RadiusAxis();\n this._angleAxis = new AngleAxis();\n this.axisPointerEnabled = true;\n this.name = name || '';\n this._radiusAxis.polar = this._angleAxis.polar = this;\n }\n /**\n * If contain coord\n */\n Polar.prototype.containPoint = function (point) {\n var coord = this.pointToCoord(point);\n return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);\n };\n /**\n * If contain data\n */\n Polar.prototype.containData = function (data) {\n return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);\n };\n Polar.prototype.getAxis = function (dim) {\n var key = '_' + dim + 'Axis';\n return this[key];\n };\n Polar.prototype.getAxes = function () {\n return [this._radiusAxis, this._angleAxis];\n };\n /**\n * Get axes by type of scale\n */\n Polar.prototype.getAxesByScale = function (scaleType) {\n var axes = [];\n var angleAxis = this._angleAxis;\n var radiusAxis = this._radiusAxis;\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\n return axes;\n };\n Polar.prototype.getAngleAxis = function () {\n return this._angleAxis;\n };\n Polar.prototype.getRadiusAxis = function () {\n return this._radiusAxis;\n };\n Polar.prototype.getOtherAxis = function (axis) {\n var angleAxis = this._angleAxis;\n return axis === angleAxis ? this._radiusAxis : angleAxis;\n };\n /**\n * Base axis will be used on stacking.\n *\n */\n Polar.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis();\n };\n Polar.prototype.getTooltipAxes = function (dim) {\n var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis();\n return {\n baseAxes: [baseAxis],\n otherAxes: [this.getOtherAxis(baseAxis)]\n };\n };\n /**\n * Convert a single data item to (x, y) point.\n * Parameter data is an array which the first element is radius and the second is angle\n */\n Polar.prototype.dataToPoint = function (data, clamp) {\n return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]);\n };\n /**\n * Convert a (x, y) point to data\n */\n Polar.prototype.pointToData = function (point, clamp) {\n var coord = this.pointToCoord(point);\n return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)];\n };\n /**\n * Convert a (x, y) point to (radius, angle) coord\n */\n Polar.prototype.pointToCoord = function (point) {\n var dx = point[0] - this.cx;\n var dy = point[1] - this.cy;\n var angleAxis = this.getAngleAxis();\n var extent = angleAxis.getExtent();\n var minAngle = Math.min(extent[0], extent[1]);\n var maxAngle = Math.max(extent[0], extent[1]);\n // Fix fixed extent in polarCreator\n // FIXME\n angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx) / Math.PI * 180;\n // move to angleExtent\n var dir = radian < minAngle ? 1 : -1;\n while (radian < minAngle || radian > maxAngle) {\n radian += dir * 360;\n }\n return [radius, radian];\n };\n /**\n * Convert a (radius, angle) coord to (x, y) point\n */\n Polar.prototype.coordToPoint = function (coord) {\n var radius = coord[0];\n var radian = coord[1] / 180 * Math.PI;\n var x = Math.cos(radian) * radius + this.cx;\n // Inverse the y\n var y = -Math.sin(radian) * radius + this.cy;\n return [x, y];\n };\n /**\n * Get ring area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n */\n Polar.prototype.getArea = function () {\n var angleAxis = this.getAngleAxis();\n var radiusAxis = this.getRadiusAxis();\n var radiusExtent = radiusAxis.getExtent().slice();\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\n var angleExtent = angleAxis.getExtent();\n var RADIAN = Math.PI / 180;\n return {\n cx: this.cx,\n cy: this.cy,\n r0: radiusExtent[0],\n r: radiusExtent[1],\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse,\n contain: function (x, y) {\n // It's a ring shape.\n // Start angle and end angle don't matter\n var dx = x - this.cx;\n var dy = y - this.cy;\n // minus a tiny value 1e-4 to avoid being clipped unexpectedly\n var d2 = dx * dx + dy * dy - 1e-4;\n var r = this.r;\n var r0 = this.r0;\n return d2 <= r * r && d2 >= r0 * r0;\n }\n };\n };\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n return Polar;\n}();\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var polarModel = finder.polarModel;\n return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\nexport default Polar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO Axis scale\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Polar, { polarDimensions } from './Polar.js';\nimport { parsePercent } from '../../util/number.js';\nimport { createScaleByModel, niceScaleExtent, getDataDimensionsOnAxis } from '../../coord/axisHelper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\n * Resize method bound to the polar\n */\nfunction resizePolar(polar, polarModel, api) {\n var center = polarModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n polar.cx = parsePercent(center[0], width);\n polar.cy = parsePercent(center[1], height);\n var radiusAxis = polar.getRadiusAxis();\n var size = Math.min(width, height) / 2;\n var radius = polarModel.get('radius');\n if (radius == null) {\n radius = [0, '100%'];\n } else if (!zrUtil.isArray(radius)) {\n // r0 = 0\n radius = [0, radius];\n }\n var parsedRadius = [parsePercent(radius[0], size), parsePercent(radius[1], size)];\n radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\n}\n/**\n * Update polar\n */\nfunction updatePolarScale(ecModel, api) {\n var polar = this;\n var angleAxis = polar.getAngleAxis();\n var radiusAxis = polar.getRadiusAxis();\n // Reset scale\n angleAxis.scale.setExtent(Infinity, -Infinity);\n radiusAxis.scale.setExtent(Infinity, -Infinity);\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === polar) {\n var data_1 = seriesModel.getData();\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\n radiusAxis.scale.unionExtentFromData(data_1, dim);\n });\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\n angleAxis.scale.unionExtentFromData(data_1, dim);\n });\n }\n });\n niceScaleExtent(angleAxis.scale, angleAxis.model);\n niceScaleExtent(radiusAxis.scale, radiusAxis.model);\n // Fix extent of category angle axis\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\n var extent = angleAxis.getExtent();\n var diff = 360 / angleAxis.scale.count();\n angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;\n angleAxis.setExtent(extent[0], extent[1]);\n }\n}\nfunction isAngleAxisModel(axisModel) {\n return axisModel.mainType === 'angleAxis';\n}\n/**\n * Set common axis properties\n */\nfunction setAxis(axis, axisModel) {\n var _a;\n axis.type = axisModel.get('type');\n axis.scale = createScaleByModel(axisModel);\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n axis.inverse = axisModel.get('inverse');\n if (isAngleAxisModel(axisModel)) {\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\n var startAngle = axisModel.get('startAngle');\n var endAngle = (_a = axisModel.get('endAngle')) !== null && _a !== void 0 ? _a : startAngle + (axis.inverse ? -360 : 360);\n axis.setExtent(startAngle, endAngle);\n }\n // Inject axis instance\n axisModel.axis = axis;\n axis.model = axisModel;\n}\nvar polarCreator = {\n dimensions: polarDimensions,\n create: function (ecModel, api) {\n var polarList = [];\n ecModel.eachComponent('polar', function (polarModel, idx) {\n var polar = new Polar(idx + '');\n // Inject resize and update method\n polar.update = updatePolarScale;\n var radiusAxis = polar.getRadiusAxis();\n var angleAxis = polar.getAngleAxis();\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n setAxis(radiusAxis, radiusAxisModel);\n setAxis(angleAxis, angleAxisModel);\n resizePolar(polar, polarModel, api);\n polarList.push(polar);\n polarModel.coordinateSystem = polar;\n polar.model = polarModel;\n });\n // Inject coordinateSystem to series\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'polar') {\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n if (process.env.NODE_ENV !== 'production') {\n if (!polarModel) {\n throw new Error('Polar \"' + zrUtil.retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\n }\n }\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\n }\n });\n return polarList;\n }\n};\nexport default polarCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport AxisView from './AxisView.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport { getECData } from '../../util/innerStore.js';\nvar elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea'];\nfunction getAxisLineShape(polar, rExtent, angle) {\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\n var start = polar.coordToPoint([rExtent[0], angle]);\n var end = polar.coordToPoint([rExtent[1], angle]);\n return {\n x1: start[0],\n y1: start[1],\n x2: end[0],\n y2: end[1]\n };\n}\nfunction getRadiusIdx(polar) {\n var radiusAxis = polar.getRadiusAxis();\n return radiusAxis.inverse ? 0 : 1;\n}\n// Remove the last tick which will overlap the first tick\nfunction fixAngleOverlap(list) {\n var firstItem = list[0];\n var lastItem = list[list.length - 1];\n if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\n list.pop();\n }\n}\nvar AngleAxisView = /** @class */function (_super) {\n __extends(AngleAxisView, _super);\n function AngleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = AngleAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\n this.group.removeAll();\n if (!angleAxisModel.get('show')) {\n return;\n }\n var angleAxis = angleAxisModel.axis;\n var polar = angleAxis.polar;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var ticksAngles = angleAxis.getTicksCoords();\n var minorTickAngles = angleAxis.getMinorTicksCoords();\n var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {\n labelItem = zrUtil.clone(labelItem);\n var scale = angleAxis.scale;\n var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n labelItem.coord = angleAxis.dataToCoord(tickValue);\n return labelItem;\n });\n fixAngleOverlap(labels);\n fixAngleOverlap(ticksAngles);\n zrUtil.each(elementList, function (name) {\n if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\n }\n }, this);\n };\n AngleAxisView.type = 'angleAxis';\n return AngleAxisView;\n}(AxisView);\nvar angelAxisElementsBuilders = {\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);\n var angleAxis = polar.getAngleAxis();\n var RADIAN = Math.PI / 180;\n var angleExtent = angleAxis.getExtent();\n // extent id of the axis radius (r0 and r)\n var rId = getRadiusIdx(polar);\n var r0Id = rId ? 0 : 1;\n var shape;\n var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';\n if (radiusExtent[r0Id] === 0) {\n shape = new graphic[shapeType]({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId],\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n } else {\n shape = new graphic.Ring({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId],\n r0: radiusExtent[r0Id]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n }\n shape.style.fill = null;\n group.add(shape);\n },\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var tickModel = angleAxisModel.getModel('axisTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = zrUtil.map(ticksAngles, function (tickAngleItem) {\n return new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\n });\n });\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(tickModel.getModel('lineStyle').getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n })\n }));\n },\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n var tickModel = angleAxisModel.getModel('axisTick');\n var minorTickModel = angleAxisModel.getModel('minorTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = [];\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\n }));\n }\n }\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n }))\n }));\n },\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\n var rawCategoryData = angleAxisModel.getCategories(true);\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\n var labelMargin = commonLabelModel.get('margin');\n var triggerEvent = angleAxisModel.get('triggerEvent');\n // Use length of ticksAngles because it may remove the last tick to avoid overlapping\n zrUtil.each(labels, function (labelItem, idx) {\n var labelModel = commonLabelModel;\n var tickValue = labelItem.tickValue;\n var r = radiusExtent[getRadiusIdx(polar)];\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right';\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom';\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n if (zrUtil.isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\n }\n }\n var textEl = new graphic.Text({\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\n style: createTextStyle(labelModel, {\n x: p[0],\n y: p[1],\n fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\n text: labelItem.formattedLabel,\n align: labelTextAlign,\n verticalAlign: labelTextVerticalAlign\n })\n });\n group.add(textEl);\n // Pack data for mouse event\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = labelItem.rawLabel;\n getECData(textEl).eventData = eventData;\n }\n }, this);\n },\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var splitLineModel = angleAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n for (var i = 0; i < ticksAngles.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\n }));\n }\n // Simple optimization\n // Batching the lines if color are the same\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyleModel.getLineStyle()),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n }\n },\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\n }));\n }\n }\n group.add(graphic.mergePath(lines, {\n style: lineStyleModel.getLineStyle(),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n },\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!ticksAngles.length) {\n return;\n }\n var splitAreaModel = angleAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var RADIAN = Math.PI / 180;\n var prevAngle = -ticksAngles[0].coord * RADIAN;\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\n var clockwise = angleAxisModel.get('clockwise');\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: r0,\n r: r1,\n startAngle: prevAngle,\n endAngle: -coord * RADIAN,\n clockwise: clockwise\n },\n silent: true\n }));\n prevAngle = -coord * RADIAN;\n }\n // Simple optimization\n // Batching the lines if color are the same\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\nexport default AngleAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];\nvar RadiusAxisView = /** @class */function (_super) {\n __extends(RadiusAxisView, _super);\n function RadiusAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = RadiusAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\n this.group.removeAll();\n if (!radiusAxisModel.get('show')) {\n return;\n }\n var oldAxisGroup = this._axisGroup;\n var newAxisGroup = this._axisGroup = new graphic.Group();\n this.group.add(newAxisGroup);\n var radiusAxis = radiusAxisModel.axis;\n var polar = radiusAxis.polar;\n var angleAxis = polar.getAngleAxis();\n var ticksCoords = radiusAxis.getTicksCoords();\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\n var axisAngle = angleAxis.getExtent()[0];\n var radiusExtent = radiusAxis.getExtent();\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n newAxisGroup.add(axisBuilder.getGroup());\n graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\n axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\n }\n }, this);\n };\n RadiusAxisView.type = 'radiusAxis';\n return RadiusAxisView;\n}(AxisView);\nvar axisElementBuilders = {\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n var splitLineModel = radiusAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n var angleAxis = polar.getAngleAxis();\n var RADIAN = Math.PI / 180;\n var angleExtent = angleAxis.getExtent();\n var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n for (var i = 0; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic[shapeType]({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n // ensure circle radius >= 0\n r: Math.max(ticksCoords[i].coord, 0),\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse\n }\n }));\n }\n // Simple optimization\n // Batching the lines if color are the same\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length],\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n }\n },\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\n if (!minorTicksCoords.length) {\n return;\n }\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n lines.push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: minorTicksCoords[i][k].coord\n }\n }));\n }\n }\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults({\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n },\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n if (!ticksCoords.length) {\n return;\n }\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var prevRadius = ticksCoords[0].coord;\n for (var i = 1; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: prevRadius,\n r: ticksCoords[i].coord,\n startAngle: 0,\n endAngle: Math.PI * 2\n },\n silent: true\n }));\n prevRadius = ticksCoords[i].coord;\n }\n // Simple optimization\n // Batching the lines if color are the same\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\n/**\n * @inner\n */\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n return {\n position: [polar.cx, polar.cy],\n rotation: axisAngle / 180 * Math.PI,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1,\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n // Over splitLine and splitArea\n z2: 1\n };\n}\nexport default RadiusAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex;\n}\nfunction getAxisKey(polar, axis) {\n return axis.dim + polar.model.componentIndex;\n}\nfunction barLayoutPolar(seriesType, ecModel, api) {\n var lastStackCoords = {};\n var barWidthAndOffset = calRadialBar(zrUtil.filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\n return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar';\n }));\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for polar only\n if (seriesModel.coordinateSystem.type !== 'polar') {\n return;\n }\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n var valueAxis = polar.getOtherAxis(baseAxis);\n var cx = seriesModel.coordinateSystem.cx;\n var cy = seriesModel.coordinateSystem.cy;\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var stacked = isDimensionStacked(data, valueDim /* , baseDim */);\n var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true);\n var valueAxisModel = valueAxis.model;\n var startValue = valueAxisModel.get('startValue');\n var valueAxisStart = valueAxis.dataToCoord(startValue || 0);\n for (var idx = 0, len = data.count(); idx < len; idx++) {\n var value = data.get(valueDim, idx);\n var baseValue = data.get(baseDim, idx);\n var sign = value >= 0 ? 'p' : 'n';\n var baseCoord = valueAxisStart;\n // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n // Only ordinal axis can be stacked.\n if (stacked) {\n if (!lastStackCoords[stackId][baseValue]) {\n lastStackCoords[stackId][baseValue] = {\n p: valueAxisStart,\n n: valueAxisStart // Negative stack\n };\n }\n // Should also consider #4243\n baseCoord = lastStackCoords[stackId][baseValue][sign];\n }\n var r0 = void 0;\n var r = void 0;\n var startAngle = void 0;\n var endAngle = void 0;\n // radial sector\n if (valueAxis.dim === 'radius') {\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\n var angle = baseAxis.dataToCoord(baseValue);\n if (Math.abs(radiusSpan) < barMinHeight) {\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\n }\n r0 = baseCoord;\n r = baseCoord + radiusSpan;\n startAngle = angle - columnOffset;\n endAngle = startAngle - columnWidth;\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\n }\n // tangential sector\n else {\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\n var radius = baseAxis.dataToCoord(baseValue);\n if (Math.abs(angleSpan) < barMinAngle) {\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\n }\n r0 = radius + columnOffset;\n r = r0 + columnWidth;\n startAngle = baseCoord;\n endAngle = baseCoord + angleSpan;\n // if the previous stack is at the end of the ring,\n // add a round to differentiate it from origin\n // let extent = angleAxis.getExtent();\n // let stackCoord = angle;\n // if (stackCoord === extent[0] && value > 0) {\n // stackCoord = extent[1];\n // }\n // else if (stackCoord === extent[1] && value < 0) {\n // stackCoord = extent[0];\n // }\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\n }\n data.setItemLayout(idx, {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n // Consider that positive angle is anti-clockwise,\n // while positive radian of sector is clockwise\n startAngle: -startAngle * Math.PI / 180,\n endAngle: -endAngle * Math.PI / 180,\n /**\n * Keep the same logic with bar in catesion: use end value to\n * control direction. Notice that if clockwise is true (by\n * default), the sector will always draw clockwisely, no matter\n * whether endAngle is greater or less than startAngle.\n */\n clockwise: startAngle >= endAngle\n });\n }\n });\n}\n/**\n * Calculate bar width and offset for radial bar charts\n */\nfunction calRadialBar(barSeries) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n // Find if any auto calculated bar exceeded maxBarWidth\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n });\n // Recalculate width again\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\nexport default barLayoutPolar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport AxisView from '../axis/AxisView.js';\nimport PolarAxisPointer from '../axisPointer/PolarAxisPointer.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport PolarModel from '../../coord/polar/PolarModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport { AngleAxisModel, RadiusAxisModel } from '../../coord/polar/AxisModel.js';\nimport polarCreator from '../../coord/polar/polarCreator.js';\nimport AngleAxisView from '../axis/AngleAxisView.js';\nimport RadiusAxisView from '../axis/RadiusAxisView.js';\nimport ComponentView from '../../view/Component.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport barLayoutPolar from '../../layout/barPolar.js';\nvar angleAxisExtraOption = {\n startAngle: 90,\n clockwise: true,\n splitNumber: 12,\n axisLabel: {\n rotate: 0\n }\n};\nvar radiusAxisExtraOption = {\n splitNumber: 5\n};\nvar PolarView = /** @class */function (_super) {\n __extends(PolarView, _super);\n function PolarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = PolarView.type;\n return _this;\n }\n PolarView.type = 'polar';\n return PolarView;\n}(ComponentView);\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n registers.registerCoordinateSystem('polar', polarCreator);\n registers.registerComponentModel(PolarModel);\n registers.registerComponentView(PolarView);\n // Model and view for angleAxis and radiusAxis\n axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption);\n axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption);\n registers.registerComponentView(AngleAxisView);\n registers.registerComponentView(RadiusAxisView);\n registers.registerLayout(curry(barLayoutPolar, 'bar'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nimport AxisView from './AxisView.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine'];\nvar SingleAxisView = /** @class */function (_super) {\n __extends(SingleAxisView, _super);\n function SingleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SingleAxisView.type;\n _this.axisPointerClass = 'SingleAxisPointer';\n return _this;\n }\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n var layout = singleAxisHelper.layout(axisModel);\n var axisBuilder = new AxisBuilder(axisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n group.add(this._axisGroup);\n group.add(axisBuilder.getGroup());\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this.group, this._axisGroup, axisModel);\n }\n }, this);\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n SingleAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n SingleAxisView.type = 'singleAxis';\n return SingleAxisView;\n}(AxisView);\nvar axisElementBuilders = {\n splitLine: function (axisView, group, axisGroup, axisModel) {\n var axis = axisModel.axis;\n if (axis.scale.isBlank()) {\n return;\n }\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var lineWidth = lineStyleModel.get('width');\n var gridRect = axisModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var splitLines = [];\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n for (var i = 0; i < ticksCoords.length; ++i) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n var line = new graphic.Line({\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineWidth);\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(line);\n }\n var lineStyle = lineStyleModel.getLineStyle(['color']);\n for (var i = 0; i < splitLines.length; ++i) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyle),\n silent: true\n }));\n }\n },\n splitArea: function (axisView, group, axisGroup, axisModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\n }\n};\nexport default SingleAxisView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nvar SingleAxisModel = /** @class */function (_super) {\n __extends(SingleAxisModel, _super);\n function SingleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SingleAxisModel.type;\n return _this;\n }\n SingleAxisModel.prototype.getCoordSysModel = function () {\n return this;\n };\n SingleAxisModel.type = 'singleAxis';\n SingleAxisModel.layoutMode = 'box';\n SingleAxisModel.defaultOption = {\n left: '5%',\n top: '5%',\n right: '5%',\n bottom: '5%',\n type: 'value',\n position: 'bottom',\n orient: 'horizontal',\n axisLine: {\n show: true,\n lineStyle: {\n width: 1,\n type: 'solid'\n }\n },\n // Single coordinate system and single axis is the,\n // which is used as the parent tooltip model.\n // same model, so we set default tooltip show as true.\n tooltip: {\n show: true\n },\n axisTick: {\n show: true,\n length: 6,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n interval: 'auto'\n },\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n opacity: 0.2\n }\n }\n };\n return SingleAxisModel;\n}(ComponentModel);\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\nexport default SingleAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\nvar SingleAxis = /** @class */function (_super) {\n __extends(SingleAxis, _super);\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n /**\n * Judge the orient of the axis.\n */\n SingleAxis.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n SingleAxis.prototype.pointToData = function (point, clamp) {\n return this.coordinateSystem.pointToData(point)[0];\n };\n return SingleAxis;\n}(Axis);\nexport default SingleAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Single coordinates system.\n */\nimport SingleAxis from './SingleAxis.js';\nimport * as axisHelper from '../axisHelper.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport var singleDimensions = ['single'];\n/**\n * Create a single coordinates system.\n */\nvar Single = /** @class */function () {\n function Single(axisModel, ecModel, api) {\n this.type = 'single';\n this.dimension = 'single';\n /**\n * Add it just for draw tooltip.\n */\n this.dimensions = singleDimensions;\n this.axisPointerEnabled = true;\n this.model = axisModel;\n this._init(axisModel, ecModel, api);\n }\n /**\n * Initialize single coordinate system.\n */\n Single.prototype._init = function (axisModel, ecModel, api) {\n var dim = this.dimension;\n var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n axis.orient = axisModel.get('orient');\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = this;\n this._axis = axis;\n };\n /**\n * Update axis scale after data processed\n */\n Single.prototype.update = function (ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === this) {\n var data_1 = seriesModel.getData();\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n this._axis.scale.unionExtentFromData(data_1, dim);\n }, this);\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n }\n }, this);\n };\n /**\n * Resize the single coordinate system.\n */\n Single.prototype.resize = function (axisModel, api) {\n this._rect = getLayoutRect({\n left: axisModel.get('left'),\n top: axisModel.get('top'),\n right: axisModel.get('right'),\n bottom: axisModel.get('bottom'),\n width: axisModel.get('width'),\n height: axisModel.get('height')\n }, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n this._adjustAxis();\n };\n Single.prototype.getRect = function () {\n return this._rect;\n };\n Single.prototype._adjustAxis = function () {\n var rect = this._rect;\n var axis = this._axis;\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n };\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\n var axisExtent = axis.getExtent();\n var extentSum = axisExtent[0] + axisExtent[1];\n var isHorizontal = axis.isHorizontal();\n axis.toGlobalCoord = isHorizontal ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n axis.toLocalCoord = isHorizontal ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n };\n /**\n * Get axis.\n */\n Single.prototype.getAxis = function () {\n return this._axis;\n };\n /**\n * Get axis, add it just for draw tooltip.\n */\n Single.prototype.getBaseAxis = function () {\n return this._axis;\n };\n Single.prototype.getAxes = function () {\n return [this._axis];\n };\n Single.prototype.getTooltipAxes = function () {\n return {\n baseAxes: [this.getAxis()],\n // Empty otherAxes\n otherAxes: []\n };\n };\n /**\n * If contain point.\n */\n Single.prototype.containPoint = function (point) {\n var rect = this.getRect();\n var axis = this.getAxis();\n var orient = axis.orient;\n if (orient === 'horizontal') {\n return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n } else {\n return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n }\n };\n Single.prototype.pointToData = function (point) {\n var axis = this.getAxis();\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\n };\n /**\n * Convert the series data to concrete point.\n * Can be [val] | val\n */\n Single.prototype.dataToPoint = function (val) {\n var axis = this.getAxis();\n var rect = this.getRect();\n var pt = [];\n var idx = axis.orient === 'horizontal' ? 0 : 1;\n if (val instanceof Array) {\n val = val[0];\n }\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n return pt;\n };\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n return Single;\n}();\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var singleModel = finder.singleAxisModel;\n return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\nexport default Single;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * Single coordinate system creator.\n */\nimport Single, { singleDimensions } from './Single.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\n * Create single coordinate system and inject it into seriesModel.\n */\nfunction create(ecModel, api) {\n var singles = [];\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n var single = new Single(axisModel, ecModel, api);\n single.name = 'single_' + idx;\n single.resize(axisModel, api);\n axisModel.coordinateSystem = single;\n singles.push(single);\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n }\n });\n return singles;\n}\nvar singleCreator = {\n create: create,\n dimensions: singleDimensions\n};\nexport default singleCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nvar XY = ['x', 'y'];\nvar WH = ['width', 'height'];\nvar SingleAxisPointer = /** @class */function (_super) {\n __extends(SingleAxisPointer, _super);\n function SingleAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @override\n */\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\n var pixelValue = coordSys.dataToPoint(value)[0];\n var axisPointerType = axisPointerModel.get('type');\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n var layoutInfo = singleAxisHelper.layout(axisModel);\n viewHelper.buildCartesianSingleLabelElOption(\n // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\n * @override\n */\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = singleAxisHelper.layout(axisModel, {\n labelInside: false\n });\n // @ts-ignore\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var position = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: position[0],\n y: position[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\n * @override\n */\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var dimIndex = getPointDimIndex(axis);\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: {\n verticalAlign: 'middle'\n }\n };\n };\n return SingleAxisPointer;\n}(BaseAxisPointer);\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = axis.getBandWidth();\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\n };\n }\n};\nfunction getPointDimIndex(axis) {\n return axis.isHorizontal() ? 0 : 1;\n}\nfunction getGlobalExtent(coordSys, dimIndex) {\n var rect = coordSys.getRect();\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\n}\nexport default SingleAxisPointer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport ComponentView from '../../view/Component.js';\nimport SingleAxisView from '../axis/SingleAxisView.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport SingleAxisModel from '../../coord/single/AxisModel.js';\nimport singleCreator from '../../coord/single/singleCreator.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport AxisView from '../axis/AxisView.js';\nimport SingleAxisPointer from '../axisPointer/SingleAxisPointer.js';\nvar SingleView = /** @class */function (_super) {\n __extends(SingleView, _super);\n function SingleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SingleView.type;\n return _this;\n }\n SingleView.type = 'single';\n return SingleView;\n}(ComponentView);\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n registers.registerComponentView(SingleView);\n // Axis\n registers.registerComponentView(SingleAxisView);\n registers.registerComponentModel(SingleAxisModel);\n axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption);\n registers.registerCoordinateSystem('single', singleCreator);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout.js';\nvar CalendarModel = /** @class */function (_super) {\n __extends(CalendarModel, _super);\n function CalendarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CalendarModel.type;\n return _this;\n }\n /**\n * @override\n */\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n _super.prototype.init.apply(this, arguments);\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\n };\n /**\n * @override\n */\n CalendarModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n mergeAndNormalizeLayoutParams(this.option, option);\n };\n CalendarModel.prototype.getCellSize = function () {\n // Has been normalized\n return this.option.cellSize;\n };\n CalendarModel.type = 'calendar';\n CalendarModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n left: 80,\n top: 60,\n cellSize: 20,\n // horizontal vertical\n orient: 'horizontal',\n // month separate line style\n splitLine: {\n show: true,\n lineStyle: {\n color: '#000',\n width: 1,\n type: 'solid'\n }\n },\n // rect style temporarily unused emphasis\n itemStyle: {\n color: '#fff',\n borderWidth: 1,\n borderColor: '#ccc'\n },\n // week text style\n dayLabel: {\n show: true,\n firstDay: 0,\n // start end\n position: 'start',\n margin: '50%',\n color: '#000'\n },\n // month text style\n monthLabel: {\n show: true,\n // start end\n position: 'start',\n margin: 5,\n // center or left\n align: 'center',\n formatter: null,\n color: '#000'\n },\n // year text style\n yearLabel: {\n show: true,\n // top bottom left right\n position: null,\n margin: 30,\n formatter: null,\n color: '#ccc',\n fontFamily: 'sans-serif',\n fontWeight: 'bolder',\n fontSize: 20\n }\n };\n return CalendarModel;\n}(ComponentModel);\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n // Normalize cellSize\n var cellSize = target.cellSize;\n var cellSizeArr;\n if (!zrUtil.isArray(cellSize)) {\n cellSizeArr = target.cellSize = [cellSize, cellSize];\n } else {\n cellSizeArr = cellSize;\n }\n if (cellSizeArr.length === 1) {\n cellSizeArr[1] = cellSizeArr[0];\n }\n var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n // If user have set `width` or both `left` and `right`, cellSizeArr\n // will be automatically set to 'auto', otherwise the default\n // setting of cellSizeArr will make `width` setting not work.\n if (sizeCalculable(raw, hvIdx)) {\n cellSizeArr[hvIdx] = 'auto';\n }\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n });\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: ignoreSize\n });\n}\nexport default CalendarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { isString, extend, map, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { formatTplSimple } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getLocaleModel } from '../../core/locale.js';\nvar CalendarView = /** @class */function (_super) {\n __extends(CalendarView, _super);\n function CalendarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = CalendarView.type;\n return _this;\n }\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n var coordSys = calendarModel.coordinateSystem;\n // range info\n var rangeData = coordSys.getRangeInfo();\n var orient = coordSys.getOrient();\n // locale\n var localeModel = ecModel.getLocaleModel();\n this._renderDayRect(calendarModel, rangeData, group);\n // _renderLines must be called prior to following function\n this._renderLines(calendarModel, rangeData, orient, group);\n this._renderYearText(calendarModel, rangeData, orient, group);\n this._renderMonthText(calendarModel, localeModel, orient, group);\n this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);\n };\n // render day rect\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\n var coordSys = calendarModel.coordinateSystem;\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\n var sw = coordSys.getCellWidth();\n var sh = coordSys.getCellHeight();\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\n var point = coordSys.dataToRect([i], false).tl;\n // every rect\n var rect = new graphic.Rect({\n shape: {\n x: point[0],\n y: point[1],\n width: sw,\n height: sh\n },\n cursor: 'default',\n style: itemRectStyleModel\n });\n group.add(rect);\n }\n };\n // render separate line\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\n var self = this;\n var coordSys = calendarModel.coordinateSystem;\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\n var show = calendarModel.get(['splitLine', 'show']);\n var lineWidth = lineStyleModel.lineWidth;\n this._tlpoints = [];\n this._blpoints = [];\n this._firstDayOfMonth = [];\n this._firstDayPoints = [];\n var firstDay = rangeData.start;\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\n addPoints(firstDay.formatedDate);\n if (i === 0) {\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\n }\n var date = firstDay.date;\n date.setMonth(date.getMonth() + 1);\n firstDay = coordSys.getDateInfo(date);\n }\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\n function addPoints(date) {\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\n self._tlpoints.push(points[0]);\n self._blpoints.push(points[points.length - 1]);\n show && self._drawSplitline(points, lineStyleModel, group);\n }\n // render top/left line\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);\n // render bottom/right line\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\n };\n // get points at both ends\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\n var rs = [points[0].slice(), points[points.length - 1].slice()];\n var idx = orient === 'horizontal' ? 0 : 1;\n // both ends of the line are extend half lineWidth\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\n return rs;\n };\n // render split line\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\n var poyline = new graphic.Polyline({\n z2: 20,\n shape: {\n points: points\n },\n style: lineStyle\n });\n group.add(poyline);\n };\n // render month line of one week points\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\n var coordSys = calendarModel.coordinateSystem;\n var parsedDate = coordSys.getDateInfo(date);\n var points = [];\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\n var point = coordSys.dataToRect([tmpD.time], false);\n points[2 * tmpD.day] = point.tl;\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\n }\n return points;\n };\n CalendarView.prototype._formatterLabel = function (formatter, params) {\n if (isString(formatter) && formatter) {\n return formatTplSimple(formatter, params);\n }\n if (isFunction(formatter)) {\n return formatter(params);\n }\n return params.nameMap;\n };\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\n var x = point[0];\n var y = point[1];\n var aligns = ['center', 'bottom'];\n if (position === 'bottom') {\n y += margin;\n aligns = ['center', 'top'];\n } else if (position === 'left') {\n x -= margin;\n } else if (position === 'right') {\n x += margin;\n aligns = ['center', 'top'];\n } else {\n // top\n y -= margin;\n }\n var rotate = 0;\n if (position === 'left' || position === 'right') {\n rotate = Math.PI / 2;\n }\n return {\n rotation: rotate,\n x: x,\n y: y,\n style: {\n align: aligns[0],\n verticalAlign: aligns[1]\n }\n };\n };\n // render year\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\n var yearLabel = calendarModel.getModel('yearLabel');\n if (!yearLabel.get('show')) {\n return;\n }\n var margin = yearLabel.get('margin');\n var pos = yearLabel.get('position');\n if (!pos) {\n pos = orient !== 'horizontal' ? 'top' : 'left';\n }\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\n var xc = (points[0][0] + points[1][0]) / 2;\n var yc = (points[0][1] + points[1][1]) / 2;\n var idx = orient === 'horizontal' ? 0 : 1;\n var posPoints = {\n top: [xc, points[idx][1]],\n bottom: [xc, points[1 - idx][1]],\n left: [points[1 - idx][0], yc],\n right: [points[idx][0], yc]\n };\n var name = rangeData.start.y;\n if (+rangeData.end.y > +rangeData.start.y) {\n name = name + '-' + rangeData.end.y;\n }\n var formatter = yearLabel.get('formatter');\n var params = {\n start: rangeData.start.y,\n end: rangeData.end.y,\n nameMap: name\n };\n var content = this._formatterLabel(formatter, params);\n var yearText = new graphic.Text({\n z2: 30,\n style: createTextStyle(yearLabel, {\n text: content\n })\n });\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\n group.add(yearText);\n };\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\n var align = 'left';\n var vAlign = 'top';\n var x = point[0];\n var y = point[1];\n if (orient === 'horizontal') {\n y = y + margin;\n if (isCenter) {\n align = 'center';\n }\n if (position === 'start') {\n vAlign = 'bottom';\n }\n } else {\n x = x + margin;\n if (isCenter) {\n vAlign = 'middle';\n }\n if (position === 'start') {\n align = 'right';\n }\n }\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n };\n // render month and year text\n CalendarView.prototype._renderMonthText = function (calendarModel, localeModel, orient, group) {\n var monthLabel = calendarModel.getModel('monthLabel');\n if (!monthLabel.get('show')) {\n return;\n }\n var nameMap = monthLabel.get('nameMap');\n var margin = monthLabel.get('margin');\n var pos = monthLabel.get('position');\n var align = monthLabel.get('align');\n var termPoints = [this._tlpoints, this._blpoints];\n if (!nameMap || isString(nameMap)) {\n if (nameMap) {\n // case-sensitive\n localeModel = getLocaleModel(nameMap) || localeModel;\n }\n // PENDING\n // for ZH locale, original form is `一月` but current form is `1月`\n nameMap = localeModel.get(['time', 'monthAbbr']) || [];\n }\n var idx = pos === 'start' ? 0 : 1;\n var axis = orient === 'horizontal' ? 0 : 1;\n margin = pos === 'start' ? -margin : margin;\n var isCenter = align === 'center';\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\n var tmp = termPoints[idx][i].slice();\n var firstDay = this._firstDayOfMonth[i];\n if (isCenter) {\n var firstDayPoints = this._firstDayPoints[i];\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\n }\n var formatter = monthLabel.get('formatter');\n var name_1 = nameMap[+firstDay.m - 1];\n var params = {\n yyyy: firstDay.y,\n yy: (firstDay.y + '').slice(2),\n MM: firstDay.m,\n M: +firstDay.m,\n nameMap: name_1\n };\n var content = this._formatterLabel(formatter, params);\n var monthText = new graphic.Text({\n z2: 30,\n style: extend(createTextStyle(monthLabel, {\n text: content\n }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\n });\n group.add(monthText);\n }\n };\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\n var align = 'center';\n var vAlign = 'middle';\n var x = point[0];\n var y = point[1];\n var isStart = position === 'start';\n if (orient === 'horizontal') {\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\n align = isStart ? 'right' : 'left';\n } else {\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\n vAlign = isStart ? 'bottom' : 'top';\n }\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n };\n // render weeks\n CalendarView.prototype._renderWeekText = function (calendarModel, localeModel, rangeData, orient, group) {\n var dayLabel = calendarModel.getModel('dayLabel');\n if (!dayLabel.get('show')) {\n return;\n }\n var coordSys = calendarModel.coordinateSystem;\n var pos = dayLabel.get('position');\n var nameMap = dayLabel.get('nameMap');\n var margin = dayLabel.get('margin');\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\n if (!nameMap || isString(nameMap)) {\n if (nameMap) {\n // case-sensitive\n localeModel = getLocaleModel(nameMap) || localeModel;\n }\n // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file\n var dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort']);\n nameMap = dayOfWeekShort || map(localeModel.get(['time', 'dayOfWeekAbbr']), function (val) {\n return val[0];\n });\n }\n var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\n margin = parsePercent(margin, Math.min(cellSize[1], cellSize[0]));\n if (pos === 'start') {\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\n margin = -margin;\n }\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(start, i);\n var point = coordSys.dataToRect([tmpD.time], false).center;\n var day = i;\n day = Math.abs((i + firstDayOfWeek) % 7);\n var weekText = new graphic.Text({\n z2: 30,\n style: extend(createTextStyle(dayLabel, {\n text: nameMap[day]\n }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\n });\n group.add(weekText);\n }\n };\n CalendarView.type = 'calendar';\n return CalendarView;\n}(ComponentView);\nexport default CalendarView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js';\n// (24*60*60*1000)\nvar PROXIMATE_ONE_DAY = 86400000;\nvar Calendar = /** @class */function () {\n function Calendar(calendarModel, ecModel, api) {\n this.type = 'calendar';\n this.dimensions = Calendar.dimensions;\n // Required in createListFromData\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\n this._model = calendarModel;\n }\n Calendar.getDimensionsInfo = function () {\n return [{\n name: 'time',\n type: 'time'\n }, 'value'];\n };\n Calendar.prototype.getRangeInfo = function () {\n return this._rangeInfo;\n };\n Calendar.prototype.getModel = function () {\n return this._model;\n };\n Calendar.prototype.getRect = function () {\n return this._rect;\n };\n Calendar.prototype.getCellWidth = function () {\n return this._sw;\n };\n Calendar.prototype.getCellHeight = function () {\n return this._sh;\n };\n Calendar.prototype.getOrient = function () {\n return this._orient;\n };\n /**\n * getFirstDayOfWeek\n *\n * @example\n * 0 : start at Sunday\n * 1 : start at Monday\n *\n * @return {number}\n */\n Calendar.prototype.getFirstDayOfWeek = function () {\n return this._firstDayOfWeek;\n };\n /**\n * get date info\n * }\n */\n Calendar.prototype.getDateInfo = function (date) {\n date = numberUtil.parseDate(date);\n var y = date.getFullYear();\n var m = date.getMonth() + 1;\n var mStr = m < 10 ? '0' + m : '' + m;\n var d = date.getDate();\n var dStr = d < 10 ? '0' + d : '' + d;\n var day = date.getDay();\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\n return {\n y: y + '',\n m: mStr,\n d: dStr,\n day: day,\n time: date.getTime(),\n formatedDate: y + '-' + mStr + '-' + dStr,\n date: date\n };\n };\n Calendar.prototype.getNextNDay = function (date, n) {\n n = n || 0;\n if (n === 0) {\n return this.getDateInfo(date);\n }\n date = new Date(this.getDateInfo(date).time);\n date.setDate(date.getDate() + n);\n return this.getDateInfo(date);\n };\n Calendar.prototype.update = function (ecModel, api) {\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\n this._orient = this._model.get('orient');\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\n var weeks = this._rangeInfo.weeks || 1;\n var whNames = ['width', 'height'];\n var cellSize = this._model.getCellSize().slice();\n var layoutParams = this._model.getBoxLayoutParams();\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\n zrUtil.each([0, 1], function (idx) {\n if (cellSizeSpecified(cellSize, idx)) {\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\n }\n });\n var whGlobal = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal);\n zrUtil.each([0, 1], function (idx) {\n if (!cellSizeSpecified(cellSize, idx)) {\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\n }\n });\n function cellSizeSpecified(cellSize, idx) {\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\n }\n // Has been calculated out number.\n this._sw = cellSize[0];\n this._sh = cellSize[1];\n };\n /**\n * Convert a time data(time, value) item to (x, y) point.\n */\n // TODO Clamp of calendar is not same with cartesian coordinate systems.\n // It will return NaN if data exceeds.\n Calendar.prototype.dataToPoint = function (data, clamp) {\n zrUtil.isArray(data) && (data = data[0]);\n clamp == null && (clamp = true);\n var dayInfo = this.getDateInfo(data);\n var range = this._rangeInfo;\n var date = dayInfo.formatedDate;\n // if not in range return [NaN, NaN]\n if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\n return [NaN, NaN];\n }\n var week = dayInfo.day;\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\n if (this._orient === 'vertical') {\n return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];\n }\n return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];\n };\n /**\n * Convert a (x, y) point to time data\n */\n Calendar.prototype.pointToData = function (point) {\n var date = this.pointToDate(point);\n return date && date.time;\n };\n /**\n * Convert a time date item to (x, y) four point.\n */\n Calendar.prototype.dataToRect = function (data, clamp) {\n var point = this.dataToPoint(data, clamp);\n return {\n contentShape: {\n x: point[0] - (this._sw - this._lineWidth) / 2,\n y: point[1] - (this._sh - this._lineWidth) / 2,\n width: this._sw - this._lineWidth,\n height: this._sh - this._lineWidth\n },\n center: point,\n tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],\n tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],\n br: [point[0] + this._sw / 2, point[1] + this._sh / 2],\n bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]\n };\n };\n /**\n * Convert a (x, y) point to time date\n *\n * @param {Array} point point\n * @return {Object} date\n */\n Calendar.prototype.pointToDate = function (point) {\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\n var range = this._rangeInfo.range;\n if (this._orient === 'vertical') {\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\n }\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\n };\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n Calendar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n /**\n * initRange\n * Normalize to an [start, end] array\n */\n Calendar.prototype._initRangeOption = function () {\n var range = this._model.get('range');\n var normalizedRange;\n // Convert [1990] to 1990\n if (zrUtil.isArray(range) && range.length === 1) {\n range = range[0];\n }\n if (!zrUtil.isArray(range)) {\n var rangeStr = range.toString();\n // One year.\n if (/^\\d{4}$/.test(rangeStr)) {\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\n }\n // One month\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n var start = this.getDateInfo(rangeStr);\n var firstDay = start.date;\n firstDay.setMonth(firstDay.getMonth() + 1);\n var end = this.getNextNDay(firstDay, -1);\n normalizedRange = [start.formatedDate, end.formatedDate];\n }\n // One day\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n normalizedRange = [rangeStr, rangeStr];\n }\n } else {\n normalizedRange = range;\n }\n if (!normalizedRange) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.logError('Invalid date range.');\n }\n // Not handling it.\n return range;\n }\n var tmp = this._getRangeInfo(normalizedRange);\n if (tmp.start.time > tmp.end.time) {\n normalizedRange.reverse();\n }\n return normalizedRange;\n };\n /**\n * range info\n *\n * @private\n * @param {Array} range range ['2017-01-01', '2017-07-08']\n * If range[0] > range[1], they will not be reversed.\n * @return {Object} obj\n */\n Calendar.prototype._getRangeInfo = function (range) {\n var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];\n var reversed;\n if (parsedRange[0].time > parsedRange[1].time) {\n reversed = true;\n parsedRange.reverse();\n }\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;\n // Consider case1 (#11677 #10430):\n // Set the system timezone as \"UK\", set the range to `['2016-07-01', '2016-12-31']`\n // Consider case2:\n // Firstly set system timezone as \"Time Zone: America/Toronto\",\n // ```\n // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);\n // let second = new Date(1478412000000);\n // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;\n // ```\n // will get wrong result because of DST. So we should fix it.\n var date = new Date(parsedRange[0].time);\n var startDateNum = date.getDate();\n var endDateNum = parsedRange[1].date.getDate();\n date.setDate(startDateNum + allDay - 1);\n // The bias can not over a month, so just compare date.\n var dateNum = date.getDate();\n if (dateNum !== endDateNum) {\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\n while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {\n allDay -= sign;\n date.setDate(dateNum - sign);\n }\n }\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\n reversed && parsedRange.reverse();\n return {\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\n start: parsedRange[0],\n end: parsedRange[1],\n allDay: allDay,\n weeks: weeks,\n // From 0.\n nthWeek: nthWeek,\n fweek: parsedRange[0].day,\n lweek: parsedRange[1].day\n };\n };\n /**\n * get date by nthWeeks and week day in range\n *\n * @private\n * @param {number} nthWeek the week\n * @param {number} day the week day\n * @param {Array} range [d1, d2]\n * @return {Object}\n */\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\n var rangeInfo = this._getRangeInfo(range);\n if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {\n return null;\n }\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\n var date = new Date(rangeInfo.start.time);\n date.setDate(+rangeInfo.start.d + nthDay);\n return this.getDateInfo(date);\n };\n Calendar.create = function (ecModel, api) {\n var calendarList = [];\n ecModel.eachComponent('calendar', function (calendarModel) {\n var calendar = new Calendar(calendarModel, ecModel, api);\n calendarList.push(calendar);\n calendarModel.coordinateSystem = calendar;\n });\n ecModel.eachSeries(function (calendarSeries) {\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\n // Inject coordinate system\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\n }\n });\n return calendarList;\n };\n Calendar.dimensions = ['time', 'value'];\n return Calendar;\n}();\nfunction getCoordSys(finder) {\n var calendarModel = finder.calendarModel;\n var seriesModel = finder.seriesModel;\n var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;\n return coordSys;\n}\nexport default Calendar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport CalendarModel from '../../coord/calendar/CalendarModel.js';\nimport CalendarView from './CalendarView.js';\nimport Calendar from '../../coord/calendar/Calendar.js';\nexport function install(registers) {\n registers.registerComponentModel(CalendarModel);\n registers.registerComponentView(CalendarView);\n registers.registerCoordinateSystem('calendar', Calendar);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport { copyLayoutParams, mergeLayoutParam } from '../../util/layout.js';\n;\n;\n;\nexport function setKeyInfoToNewElOption(resultItem, newElOption) {\n var existElOption = resultItem.existing;\n // Set id and type after id assigned.\n newElOption.id = resultItem.keyInfo.id;\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\n // Set parent id if not specified\n if (newElOption.parentId == null) {\n var newElParentOption = newElOption.parentOption;\n if (newElParentOption) {\n newElOption.parentId = newElParentOption.id;\n } else if (existElOption) {\n newElOption.parentId = existElOption.parentId;\n }\n }\n // Clear\n newElOption.parentOption = null;\n}\nfunction isSetLoc(obj, props) {\n var isSet;\n zrUtil.each(props, function (prop) {\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\n });\n return isSet;\n}\nfunction mergeNewElOptionToExist(existList, index, newElOption) {\n // Update existing options, for `getOption` feature.\n var newElOptCopy = zrUtil.extend({}, newElOption);\n var existElOption = existList[index];\n var $action = newElOption.$action || 'merge';\n if ($action === 'merge') {\n if (existElOption) {\n if (process.env.NODE_ENV !== 'production') {\n var newType = newElOption.type;\n zrUtil.assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\n }\n // We can ensure that newElOptCopy and existElOption are not\n // the same object, so `merge` will not change newElOptCopy.\n zrUtil.merge(existElOption, newElOptCopy, true);\n // Rigid body, use ignoreSize.\n mergeLayoutParam(existElOption, newElOptCopy, {\n ignoreSize: true\n });\n // Will be used in render.\n copyLayoutParams(newElOption, existElOption);\n // Copy transition info to new option so it can be used in the transition.\n // DO IT AFTER merge\n copyTransitionInfo(newElOption, existElOption);\n copyTransitionInfo(newElOption, existElOption, 'shape');\n copyTransitionInfo(newElOption, existElOption, 'style');\n copyTransitionInfo(newElOption, existElOption, 'extra');\n // Copy clipPath\n newElOption.clipPath = existElOption.clipPath;\n } else {\n existList[index] = newElOptCopy;\n }\n } else if ($action === 'replace') {\n existList[index] = newElOptCopy;\n } else if ($action === 'remove') {\n // null will be cleaned later.\n existElOption && (existList[index] = null);\n }\n}\nvar TRANSITION_PROPS_TO_COPY = ['transition', 'enterFrom', 'leaveTo'];\nvar ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(['enterAnimation', 'updateAnimation', 'leaveAnimation']);\nfunction copyTransitionInfo(target, source, targetProp) {\n if (targetProp) {\n if (!target[targetProp] && source[targetProp]) {\n // TODO avoid creating this empty object when there is no transition configuration.\n target[targetProp] = {};\n }\n target = target[targetProp];\n source = source[targetProp];\n }\n if (!target || !source) {\n return;\n }\n var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n if (target[prop] == null && source[prop] != null) {\n target[prop] = source[prop];\n }\n }\n}\nfunction setLayoutInfoToExist(existItem, newElOption) {\n if (!existItem) {\n return;\n }\n existItem.hv = newElOption.hv = [\n // Rigid body, don't care about `width`.\n isSetLoc(newElOption, ['left', 'right']),\n // Rigid body, don't care about `height`.\n isSetLoc(newElOption, ['top', 'bottom'])];\n // Give default group size. Otherwise layout error may occur.\n if (existItem.type === 'group') {\n var existingGroupOpt = existItem;\n var newGroupOpt = newElOption;\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\n }\n}\nvar GraphicComponentModel = /** @class */function (_super) {\n __extends(GraphicComponentModel, _super);\n function GraphicComponentModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GraphicComponentModel.type;\n _this.preventAutoZ = true;\n return _this;\n }\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\n // Prevent default merge to elements\n var elements = this.option.elements;\n this.option.elements = null;\n _super.prototype.mergeOption.call(this, option, ecModel);\n this.option.elements = elements;\n };\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n var newList = (isInit ? thisOption : newOption).elements;\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\n var flattenedList = [];\n this._flatten(newList, flattenedList, null);\n var mappingResult = modelUtil.mappingToExists(existList, flattenedList, 'normalMerge');\n // Clear elOptionsToUpdate\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\n zrUtil.each(mappingResult, function (resultItem, index) {\n var newElOption = resultItem.newOption;\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\n }\n if (!newElOption) {\n return;\n }\n elOptionsToUpdate.push(newElOption);\n setKeyInfoToNewElOption(resultItem, newElOption);\n mergeNewElOptionToExist(existList, index, newElOption);\n setLayoutInfoToExist(existList[index], newElOption);\n }, this);\n // Clean\n thisOption.elements = zrUtil.filter(existList, function (item) {\n // $action should be volatile, otherwise option gotten from\n // `getOption` will contain unexpected $action.\n item && delete item.$action;\n return item != null;\n });\n };\n /**\n * Convert\n * [{\n * type: 'group',\n * id: 'xx',\n * children: [{type: 'circle'}, {type: 'polygon'}]\n * }]\n * to\n * [\n * {type: 'group', id: 'xx'},\n * {type: 'circle', parentId: 'xx'},\n * {type: 'polygon', parentId: 'xx'}\n * ]\n */\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\n zrUtil.each(optionList, function (option) {\n if (!option) {\n return;\n }\n if (parentOption) {\n option.parentOption = parentOption;\n }\n result.push(option);\n var children = option.children;\n // here we don't judge if option.type is `group`\n // when new option doesn't provide `type`, it will cause that the children can't be updated.\n if (children && children.length) {\n this._flatten(children, result, option);\n }\n // Deleting for JSON output, and for not affecting group creation.\n delete option.children;\n }, this);\n };\n // FIXME\n // Pass to view using payload? setOption has a payload?\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\n var els = this._elOptionsToUpdate;\n // Clear to avoid render duplicately when zooming.\n this._elOptionsToUpdate = null;\n return els;\n };\n GraphicComponentModel.type = 'graphic';\n GraphicComponentModel.defaultOption = {\n elements: []\n // parentId: null\n };\n\n return GraphicComponentModel;\n}(ComponentModel);\nexport { GraphicComponentModel };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isEC4CompatibleStyle, convertFromEC4CompatibleStyle } from '../../util/styleCompat.js';\nimport { applyLeaveTransition, applyUpdateTransition, isTransitionAll, updateLeaveTo } from '../../animation/customGraphicTransition.js';\nimport { updateProps } from '../../animation/basicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar nonShapeGraphicElements = {\n // Reserved but not supported in graphic component.\n path: null,\n compoundPath: null,\n // Supported in graphic component.\n group: graphicUtil.Group,\n image: graphicUtil.Image,\n text: graphicUtil.Text\n};\nexport var inner = modelUtil.makeInner();\n// ------------------------\n// View\n// ------------------------\nvar GraphicComponentView = /** @class */function (_super) {\n __extends(GraphicComponentView, _super);\n function GraphicComponentView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = GraphicComponentView.type;\n return _this;\n }\n GraphicComponentView.prototype.init = function () {\n this._elMap = zrUtil.createHashMap();\n };\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\n // Having leveraged between use cases and algorithm complexity, a very\n // simple layout mechanism is used:\n // The size(width/height) can be determined by itself or its parent (not\n // implemented yet), but can not by its children. (Top-down travel)\n // The location(x/y) can be determined by the bounding rect of itself\n // (can including its descendants or not) and the size of its parent.\n // (Bottom-up travel)\n // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\n // view will be reused.\n if (graphicModel !== this._lastGraphicModel) {\n this._clear();\n }\n this._lastGraphicModel = graphicModel;\n this._updateElements(graphicModel);\n this._relocate(graphicModel, api);\n };\n /**\n * Update graphic elements.\n */\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\n if (!elOptionsToUpdate) {\n return;\n }\n var elMap = this._elMap;\n var rootGroup = this.group;\n var globalZ = graphicModel.get('z');\n var globalZLevel = graphicModel.get('zlevel');\n // Top-down tranverse to assign graphic settings to each elements.\n zrUtil.each(elOptionsToUpdate, function (elOption) {\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var elExisting = id != null ? elMap.get(id) : null;\n var parentId = modelUtil.convertOptionIdName(elOption.parentId, null);\n var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;\n var elType = elOption.type;\n var elOptionStyle = elOption.style;\n if (elType === 'text' && elOptionStyle) {\n // In top/bottom mode, textVerticalAlign should not be used, which cause\n // inaccurately locating.\n if (elOption.hv && elOption.hv[1]) {\n elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;\n }\n }\n var textContentOption = elOption.textContent;\n var textConfig = elOption.textConfig;\n if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\n if (!textConfig && convertResult.textConfig) {\n textConfig = elOption.textConfig = convertResult.textConfig;\n }\n if (!textContentOption && convertResult.textContent) {\n textContentOption = convertResult.textContent;\n }\n }\n // Remove unnecessary props to avoid potential problems.\n var elOptionCleaned = getCleanedElOption(elOption);\n // For simple, do not support parent change, otherwise reorder is needed.\n if (process.env.NODE_ENV !== 'production') {\n elExisting && zrUtil.assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\n }\n var $action = elOption.$action || 'merge';\n var isMerge = $action === 'merge';\n var isReplace = $action === 'replace';\n if (isMerge) {\n var isInit = !elExisting;\n var el_1 = elExisting;\n if (isInit) {\n el_1 = createEl(id, targetElParent, elOption.type, elMap);\n } else {\n el_1 && (inner(el_1).isNew = false);\n // Stop and restore before update any other attributes.\n stopPreviousKeyframeAnimationAndRestore(el_1);\n }\n if (el_1) {\n applyUpdateTransition(el_1, elOptionCleaned, graphicModel, {\n isInit: isInit\n });\n updateCommonAttrs(el_1, elOption, globalZ, globalZLevel);\n }\n } else if (isReplace) {\n removeEl(elExisting, elOption, elMap, graphicModel);\n var el_2 = createEl(id, targetElParent, elOption.type, elMap);\n if (el_2) {\n applyUpdateTransition(el_2, elOptionCleaned, graphicModel, {\n isInit: true\n });\n updateCommonAttrs(el_2, elOption, globalZ, globalZLevel);\n }\n } else if ($action === 'remove') {\n updateLeaveTo(elExisting, elOption);\n removeEl(elExisting, elOption, elMap, graphicModel);\n }\n var el = elMap.get(id);\n if (el && textContentOption) {\n if (isMerge) {\n var textContentExisting = el.getTextContent();\n textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new graphicUtil.Text(textContentOption));\n } else if (isReplace) {\n el.setTextContent(new graphicUtil.Text(textContentOption));\n }\n }\n if (el) {\n var clipPathOption = elOption.clipPath;\n if (clipPathOption) {\n var clipPathType = clipPathOption.type;\n var clipPath = void 0;\n var isInit = false;\n if (isMerge) {\n var oldClipPath = el.getClipPath();\n isInit = !oldClipPath || inner(oldClipPath).type !== clipPathType;\n clipPath = isInit ? newEl(clipPathType) : oldClipPath;\n } else if (isReplace) {\n isInit = true;\n clipPath = newEl(clipPathType);\n }\n el.setClipPath(clipPath);\n applyUpdateTransition(clipPath, clipPathOption, graphicModel, {\n isInit: isInit\n });\n applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);\n }\n var elInner = inner(el);\n el.setTextConfig(textConfig);\n elInner.option = elOption;\n setEventData(el, graphicModel, elOption);\n graphicUtil.setTooltipConfig({\n el: el,\n componentModel: graphicModel,\n itemName: el.name,\n itemTooltipOption: elOption.tooltip\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);\n }\n });\n };\n /**\n * Locate graphic elements.\n */\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\n var elOptions = graphicModel.option.elements;\n var rootGroup = this.group;\n var elMap = this._elMap;\n var apiWidth = api.getWidth();\n var apiHeight = api.getHeight();\n var xy = ['x', 'y'];\n // Top-down to calculate percentage width/height of group\n for (var i = 0; i < elOptions.length; i++) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n if (!el || !el.isGroup) {\n continue;\n }\n var parentEl = el.parent;\n var isParentRoot = parentEl === rootGroup;\n // Like 'position:absolut' in css, default 0.\n var elInner = inner(el);\n var parentElInner = inner(parentEl);\n elInner.width = parsePercent(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;\n elInner.height = parsePercent(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;\n }\n // Bottom-up tranvese all elements (consider ec resize) to locate elements.\n for (var i = elOptions.length - 1; i >= 0; i--) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n if (!el) {\n continue;\n }\n var parentEl = el.parent;\n var parentElInner = inner(parentEl);\n var containerInfo = parentEl === rootGroup ? {\n width: apiWidth,\n height: apiHeight\n } : {\n width: parentElInner.width,\n height: parentElInner.height\n };\n // PENDING\n // Currently, when `bounding: 'all'`, the union bounding rect of the group\n // does not include the rect of [0, 0, group.width, group.height], which\n // is probably weird for users. Should we make a break change for it?\n var layoutPos = {};\n var layouted = layoutUtil.positionElement(el, elOption, containerInfo, null, {\n hv: elOption.hv,\n boundingMode: elOption.bounding\n }, layoutPos);\n if (!inner(el).isNew && layouted) {\n var transition = elOption.transition;\n var animatePos = {};\n for (var k = 0; k < xy.length; k++) {\n var key = xy[k];\n var val = layoutPos[key];\n if (transition && (isTransitionAll(transition) || zrUtil.indexOf(transition, key) >= 0)) {\n animatePos[key] = val;\n } else {\n el[key] = val;\n }\n }\n updateProps(el, animatePos, graphicModel, 0);\n } else {\n el.attr(layoutPos);\n }\n }\n };\n /**\n * Clear all elements.\n */\n GraphicComponentView.prototype._clear = function () {\n var _this = this;\n var elMap = this._elMap;\n elMap.each(function (el) {\n removeEl(el, inner(el).option, elMap, _this._lastGraphicModel);\n });\n this._elMap = zrUtil.createHashMap();\n };\n GraphicComponentView.prototype.dispose = function () {\n this._clear();\n };\n GraphicComponentView.type = 'graphic';\n return GraphicComponentView;\n}(ComponentView);\nexport { GraphicComponentView };\nfunction newEl(graphicType) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(graphicType, 'graphic type MUST be set');\n }\n var Clz = zrUtil.hasOwn(nonShapeGraphicElements, graphicType)\n // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n ? nonShapeGraphicElements[graphicType] : graphicUtil.getShapeClass(graphicType);\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(Clz, \"graphic type \" + graphicType + \" can not be found\");\n }\n var el = new Clz({});\n inner(el).type = graphicType;\n return el;\n}\nfunction createEl(id, targetElParent, graphicType, elMap) {\n var el = newEl(graphicType);\n targetElParent.add(el);\n elMap.set(id, el);\n inner(el).id = id;\n inner(el).isNew = true;\n return el;\n}\nfunction removeEl(elExisting, elOption, elMap, graphicModel) {\n var existElParent = elExisting && elExisting.parent;\n if (existElParent) {\n elExisting.type === 'group' && elExisting.traverse(function (el) {\n removeEl(el, elOption, elMap, graphicModel);\n });\n applyLeaveTransition(elExisting, elOption, graphicModel);\n elMap.removeKey(inner(elExisting).id);\n }\n}\nfunction updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) {\n if (!el.isGroup) {\n zrUtil.each([['cursor', Displayable.prototype.cursor],\n // We should not support configure z and zlevel in the element level.\n // But seems we didn't limit it previously. So here still use it to avoid breaking.\n ['zlevel', defaultZlevel || 0], ['z', defaultZ || 0],\n // z2 must not be null/undefined, otherwise sort error may occur.\n ['z2', 0]], function (item) {\n var prop = item[0];\n if (zrUtil.hasOwn(elOption, prop)) {\n el[prop] = zrUtil.retrieve2(elOption[prop], item[1]);\n } else if (el[prop] == null) {\n el[prop] = item[1];\n }\n });\n }\n zrUtil.each(zrUtil.keys(elOption), function (key) {\n // Assign event handlers.\n // PENDING: should enumerate all event names or use pattern matching?\n if (key.indexOf('on') === 0) {\n var val = elOption[key];\n el[key] = zrUtil.isFunction(val) ? val : null;\n }\n });\n if (zrUtil.hasOwn(elOption, 'draggable')) {\n el.draggable = elOption.draggable;\n }\n // Other attributes\n elOption.name != null && (el.name = elOption.name);\n elOption.id != null && (el.id = elOption.id);\n}\n// Remove unnecessary props to avoid potential problems.\nfunction getCleanedElOption(elOption) {\n elOption = zrUtil.extend({}, elOption);\n zrUtil.each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(layoutUtil.LOCATION_PARAMS), function (name) {\n delete elOption[name];\n });\n return elOption;\n}\nfunction setEventData(el, graphicModel, elOption) {\n var eventData = getECData(el).eventData;\n // Simple optimize for large amount of elements that no need event.\n if (!el.silent && !el.ignore && !eventData) {\n eventData = getECData(el).eventData = {\n componentType: 'graphic',\n componentIndex: graphicModel.componentIndex,\n name: el.name\n };\n }\n // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n if (eventData) {\n eventData.info = elOption.info;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { GraphicComponentModel } from './GraphicModel.js';\nimport { GraphicComponentView } from './GraphicView.js';\nexport function install(registers) {\n registers.registerComponentModel(GraphicComponentModel);\n registers.registerComponentView(GraphicComponentView);\n registers.registerPreprocessor(function (option) {\n var graphicOption = option.graphic;\n // Convert\n // {graphic: [{left: 10, type: 'circle'}, ...]}\n // or\n // {graphic: {left: 10, type: 'circle'}}\n // to\n // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\n if (isArray(graphicOption)) {\n if (!graphicOption[0] || !graphicOption[0].elements) {\n option.graphic = [{\n elements: graphicOption\n }];\n } else {\n // Only one graphic instance can be instantiated. (We don't\n // want that too many views are created in echarts._viewMap.)\n option.graphic = [option.graphic[0]];\n }\n } else if (graphicOption && !graphicOption.elements) {\n option.graphic = [{\n elements: [graphicOption]\n }];\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { indexOf, createHashMap, assert } from 'zrender/lib/core/util.js';\nexport var DATA_ZOOM_AXIS_DIMENSIONS = ['x', 'y', 'radius', 'angle', 'single'];\n// Supported coords.\n// FIXME: polar has been broken (but rarely used).\nvar SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\nexport function isCoordSupported(seriesModel) {\n var coordType = seriesModel.get('coordinateSystem');\n return indexOf(SERIES_COORDS, coordType) >= 0;\n}\nexport function getAxisMainType(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n return axisDim + 'Axis';\n}\nexport function getAxisIndexPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n return axisDim + 'AxisIndex';\n}\nexport function getAxisIdPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n return axisDim + 'AxisId';\n}\n/**\n * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.\n * This function finds all linked dataZoomModels start from the given payload.\n */\nexport function findEffectedDataZooms(ecModel, payload) {\n // Key: `DataZoomAxisDimension`\n var axisRecords = createHashMap();\n var effectedModels = [];\n // Key: uid of dataZoomModel\n var effectedModelMap = createHashMap();\n // Find the dataZooms specified by payload.\n ecModel.eachComponent({\n mainType: 'dataZoom',\n query: payload\n }, function (dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid)) {\n addToEffected(dataZoomModel);\n }\n });\n // Start from the given dataZoomModels, travel the graph to find\n // all of the linked dataZoom models.\n var foundNewLink;\n do {\n foundNewLink = false;\n ecModel.eachComponent('dataZoom', processSingle);\n } while (foundNewLink);\n function processSingle(dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\n addToEffected(dataZoomModel);\n foundNewLink = true;\n }\n }\n function addToEffected(dataZoom) {\n effectedModelMap.set(dataZoom.uid, true);\n effectedModels.push(dataZoom);\n markAxisControlled(dataZoom);\n }\n function isLinked(dataZoomModel) {\n var isLink = false;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisIdxArr = axisRecords.get(axisDim);\n if (axisIdxArr && axisIdxArr[axisIndex]) {\n isLink = true;\n }\n });\n return isLink;\n }\n function markAxisControlled(dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\n });\n }\n return effectedModels;\n}\n/**\n * Find the first target coordinate system.\n * Available after model built.\n *\n * @return Like {\n * grid: [\n * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\n * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\n * ...\n * ], // cartesians must not be null/undefined.\n * polar: [\n * {model: coord0, axisModels: [axis4], coordIndex: 0},\n * ...\n * ], // polars must not be null/undefined.\n * singleAxis: [\n * {model: coord0, axisModels: [], coordIndex: 0}\n * ]\n * }\n */\nexport function collectReferCoordSysModelInfo(dataZoomModel) {\n var ecModel = dataZoomModel.ecModel;\n var coordSysInfoWrap = {\n infoList: [],\n infoMap: createHashMap()\n };\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n if (!axisModel) {\n return;\n }\n var coordSysModel = axisModel.getCoordSysModel();\n if (!coordSysModel) {\n return;\n }\n var coordSysUid = coordSysModel.uid;\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\n if (!coordSysInfo) {\n coordSysInfo = {\n model: coordSysModel,\n axisModels: []\n };\n coordSysInfoWrap.infoList.push(coordSysInfo);\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\n }\n coordSysInfo.axisModels.push(axisModel);\n });\n return coordSysInfoWrap;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { each, createHashMap, merge, assert } from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getAxisMainType, DATA_ZOOM_AXIS_DIMENSIONS } from './helper.js';\nimport { MULTIPLE_REFERRING, SINGLE_REFERRING } from '../../util/model.js';\nvar DataZoomAxisInfo = /** @class */function () {\n function DataZoomAxisInfo() {\n this.indexList = [];\n this.indexMap = [];\n }\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\n // Remove duplication.\n if (!this.indexMap[axisCmptIdx]) {\n this.indexList.push(axisCmptIdx);\n this.indexMap[axisCmptIdx] = true;\n }\n };\n return DataZoomAxisInfo;\n}();\nvar DataZoomModel = /** @class */function (_super) {\n __extends(DataZoomModel, _super);\n function DataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = DataZoomModel.type;\n _this._autoThrottle = true;\n _this._noTarget = true;\n /**\n * It is `[rangeModeForMin, rangeModeForMax]`.\n * The optional values for `rangeMode`:\n * + `'value'` mode: the axis extent will always be determined by\n * `dataZoom.startValue` and `dataZoom.endValue`, despite\n * how data like and how `axis.min` and `axis.max` are.\n * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\n * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\n * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\n * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\n *\n * For example, when users are using dynamic data (update data periodically via `setOption`),\n * if in `'value`' mode, the window will be kept in a fixed value range despite how\n * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\n * the appended data (suppose `axis.min` and `axis.max` are not specified).\n */\n _this._rangePropMode = ['percent', 'percent'];\n return _this;\n }\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\n var inputRawOption = retrieveRawOption(option);\n /**\n * Suppose a \"main process\" start at the point that model prepared (that is,\n * model initialized or merged or method called in `action`).\n * We should keep the `main process` idempotent, that is, given a set of values\n * on `option`, we get the same result.\n *\n * But sometimes, values on `option` will be updated for providing users\n * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\n * should not be the base/input of the `main process`.\n *\n * So in that case we should save and keep the input of the `main process`\n * separately, called `settledOption`.\n *\n * For example, consider the case:\n * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\n * where the original input `option.startValue`, `option.endValue` are earsed by\n * calculated value.\n * (Step)2) click the legend to hide and show a series,\n * where the new range is calculated by the earsed `startValue` and `endValue`,\n * which brings incorrect result.\n */\n this.settledOption = inputRawOption;\n this.mergeDefaultAndTheme(option, ecModel);\n this._doInit(inputRawOption);\n };\n DataZoomModel.prototype.mergeOption = function (newOption) {\n var inputRawOption = retrieveRawOption(newOption);\n // FIX #2591\n merge(this.option, newOption, true);\n merge(this.settledOption, inputRawOption, true);\n this._doInit(inputRawOption);\n };\n DataZoomModel.prototype._doInit = function (inputRawOption) {\n var thisOption = this.option;\n this._setDefaultThrottle(inputRawOption);\n this._updateRangeUse(inputRawOption);\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n // start/end has higher priority over startValue/endValue if they\n // both set, but we should make chart.setOption({endValue: 1000})\n // effective, rather than chart.setOption({endValue: 1000, end: null}).\n if (this._rangePropMode[index] === 'value') {\n thisOption[names[0]] = settledOption[names[0]] = null;\n }\n // Otherwise do nothing and use the merge result.\n }, this);\n this._resetTarget();\n };\n DataZoomModel.prototype._resetTarget = function () {\n var optionOrient = this.get('orient', true);\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\n if (hasAxisSpecified) {\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\n } else {\n this._orient = optionOrient || 'horizontal';\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\n }\n this._noTarget = true;\n targetAxisIndexMap.each(function (axisInfo) {\n if (axisInfo.indexList.length) {\n this._noTarget = false;\n }\n }, this);\n };\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\n var hasAxisSpecified = false;\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\n // When user set axisIndex as a empty array, we think that user specify axisIndex\n // but do not want use auto mode. Because empty array may be encountered when\n // some error occurred.\n if (!refering.specified) {\n return;\n }\n hasAxisSpecified = true;\n var axisInfo = new DataZoomAxisInfo();\n each(refering.models, function (axisModel) {\n axisInfo.add(axisModel.componentIndex);\n });\n targetAxisIndexMap.set(axisDim, axisInfo);\n }, this);\n return hasAxisSpecified;\n };\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\n var ecModel = this.ecModel;\n var needAuto = true;\n // Find axis that parallel to dataZoom as default.\n if (needAuto) {\n var axisDim = orient === 'vertical' ? 'y' : 'x';\n var axisModels = ecModel.findComponents({\n mainType: axisDim + 'Axis'\n });\n setParallelAxis(axisModels, axisDim);\n }\n // Find axis that parallel to dataZoom as default.\n if (needAuto) {\n var axisModels = ecModel.findComponents({\n mainType: 'singleAxis',\n filter: function (axisModel) {\n return axisModel.get('orient', true) === orient;\n }\n });\n setParallelAxis(axisModels, 'single');\n }\n function setParallelAxis(axisModels, axisDim) {\n // At least use the first parallel axis as the target axis.\n var axisModel = axisModels[0];\n if (!axisModel) {\n return;\n }\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModel.componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false;\n // Find parallel axes in the same grid.\n if (axisDim === 'x' || axisDim === 'y') {\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n gridModel_1 && each(axisModels, function (axModel) {\n if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\n axisInfo.add(axModel.componentIndex);\n }\n });\n }\n }\n if (needAuto) {\n // If no parallel axis, find the first category axis as default. (Also consider polar).\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n if (!needAuto) {\n return;\n }\n var axisModels = ecModel.findComponents({\n mainType: getAxisMainType(axisDim),\n filter: function (axisModel) {\n return axisModel.get('type', true) === 'category';\n }\n });\n if (axisModels[0]) {\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModels[0].componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false;\n }\n }, this);\n }\n };\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\n var dim;\n // Find the first axis\n this.eachTargetAxis(function (axisDim) {\n !dim && (dim = axisDim);\n }, this);\n return dim === 'y' ? 'vertical' : 'horizontal';\n };\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\n // When first time user set throttle, auto throttle ends.\n if (inputRawOption.hasOwnProperty('throttle')) {\n this._autoThrottle = false;\n }\n if (this._autoThrottle) {\n var globalOption = this.ecModel.option;\n this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;\n }\n };\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\n var rangePropMode = this._rangePropMode;\n var rangeModeInOption = this.get('rangeMode');\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n var percentSpecified = inputRawOption[names[0]] != null;\n var valueSpecified = inputRawOption[names[1]] != null;\n if (percentSpecified && !valueSpecified) {\n rangePropMode[index] = 'percent';\n } else if (!percentSpecified && valueSpecified) {\n rangePropMode[index] = 'value';\n } else if (rangeModeInOption) {\n rangePropMode[index] = rangeModeInOption[index];\n } else if (percentSpecified) {\n // percentSpecified && valueSpecified\n rangePropMode[index] = 'percent';\n }\n // else remain its original setting.\n });\n };\n\n DataZoomModel.prototype.noTarget = function () {\n return this._noTarget;\n };\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\n var firstAxisModel;\n this.eachTargetAxis(function (axisDim, axisIndex) {\n if (firstAxisModel == null) {\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n }, this);\n return firstAxisModel;\n };\n /**\n * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\n */\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\n each(axisInfo.indexList, function (axisIndex) {\n callback.call(context, axisDim, axisIndex);\n });\n });\n };\n /**\n * @return If not found, return null/undefined.\n */\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\n var axisModel = this.getAxisModel(axisDim, axisIndex);\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n }\n };\n /**\n * @return If not found, return null/undefined.\n */\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim && axisIndex != null);\n }\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n };\n /**\n * If not specified, set to undefined.\n */\n DataZoomModel.prototype.setRawRange = function (opt) {\n var thisOption = this.option;\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\n // Consider the pair :\n // If one has value and the other one is `null/undefined`, we both set them\n // to `settledOption`. This strategy enables the feature to clear the original\n // value in `settledOption` to `null/undefined`.\n // But if both of them are `null/undefined`, we do not set them to `settledOption`\n // and keep `settledOption` with the original value. This strategy enables users to\n // only set but not set when calling\n // `dispatchAction`.\n // The pair is treated in the same way.\n if (opt[names[0]] != null || opt[names[1]] != null) {\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\n }\n }, this);\n this._updateRangeUse(opt);\n };\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\n var option = this.option;\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\n option[name] = opt[name];\n });\n };\n DataZoomModel.prototype.getPercentRange = function () {\n var axisProxy = this.findRepresentativeAxisProxy();\n if (axisProxy) {\n return axisProxy.getDataPercentWindow();\n }\n };\n /**\n * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\n *\n * @return [startValue, endValue] value can only be '-' or finite number.\n */\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\n if (axisDim == null && axisIndex == null) {\n var axisProxy = this.findRepresentativeAxisProxy();\n if (axisProxy) {\n return axisProxy.getDataValueWindow();\n }\n } else {\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\n }\n };\n /**\n * @param axisModel If axisModel given, find axisProxy\n * corresponding to the axisModel\n */\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n }\n // Find the first hosted axisProxy\n var firstProxy;\n var axisDimList = this._targetAxisInfoMap.keys();\n for (var i = 0; i < axisDimList.length; i++) {\n var axisDim = axisDimList[i];\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n for (var j = 0; j < axisInfo.indexList.length; j++) {\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\n if (proxy.hostedBy(this)) {\n return proxy;\n }\n if (!firstProxy) {\n firstProxy = proxy;\n }\n }\n }\n // If no hosted proxy found, still need to return a proxy.\n // This case always happens in toolbox dataZoom, where axes are all hosted by\n // other dataZooms.\n return firstProxy;\n };\n DataZoomModel.prototype.getRangePropMode = function () {\n return this._rangePropMode.slice();\n };\n DataZoomModel.prototype.getOrient = function () {\n if (process.env.NODE_ENV !== 'production') {\n // Should not be called before initialized.\n assert(this._orient);\n }\n return this._orient;\n };\n DataZoomModel.type = 'dataZoom';\n DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'];\n DataZoomModel.defaultOption = {\n // zlevel: 0,\n z: 4,\n filterMode: 'filter',\n start: 0,\n end: 100\n };\n return DataZoomModel;\n}(ComponentModel);\n/**\n * Retrieve those raw params from option, which will be cached separately,\n * because they will be overwritten by normalized/calculated values in the main\n * process.\n */\nfunction retrieveRawOption(option) {\n var ret = {};\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n option.hasOwnProperty(name) && (ret[name] = option[name]);\n });\n return ret;\n}\nexport default DataZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nvar SelectDataZoomModel = /** @class */function (_super) {\n __extends(SelectDataZoomModel, _super);\n function SelectDataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SelectDataZoomModel.type;\n return _this;\n }\n SelectDataZoomModel.type = 'dataZoom.select';\n return SelectDataZoomModel;\n}(DataZoomModel);\nexport default SelectDataZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nvar DataZoomView = /** @class */function (_super) {\n __extends(DataZoomView, _super);\n function DataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = DataZoomView.type;\n return _this;\n }\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n this.dataZoomModel = dataZoomModel;\n this.ecModel = ecModel;\n this.api = api;\n };\n DataZoomView.type = 'dataZoom';\n return DataZoomView;\n}(ComponentView);\nexport default DataZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\nvar SelectDataZoomView = /** @class */function (_super) {\n __extends(SelectDataZoomView, _super);\n function SelectDataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SelectDataZoomView.type;\n return _this;\n }\n SelectDataZoomView.type = 'dataZoom.select';\n return SelectDataZoomView;\n}(DataZoomView);\nexport default SelectDataZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { unionAxisExtentFromData } from '../../coord/axisHelper.js';\nimport { ensureScaleRawExtentInfo } from '../../coord/scaleRawExtentInfo.js';\nimport { getAxisMainType, isCoordSupported } from './helper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\n/**\n * Operate single axis.\n * One axis can only operated by one axis operator.\n * Different dataZoomModels may be defined to operate the same axis.\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\n * So dataZoomModels share one axisProxy in that case.\n */\nvar AxisProxy = /** @class */function () {\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\n this._dimName = dimName;\n this._axisIndex = axisIndex;\n this.ecModel = ecModel;\n this._dataZoomModel = dataZoomModel;\n // /**\n // * @readOnly\n // * @private\n // */\n // this.hasSeriesStacked;\n }\n /**\n * Whether the axisProxy is hosted by dataZoomModel.\n */\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\n return this._dataZoomModel === dataZoomModel;\n };\n /**\n * @return Value can only be NaN or finite value.\n */\n AxisProxy.prototype.getDataValueWindow = function () {\n return this._valueWindow.slice();\n };\n /**\n * @return {Array.}\n */\n AxisProxy.prototype.getDataPercentWindow = function () {\n return this._percentWindow.slice();\n };\n AxisProxy.prototype.getTargetSeriesModels = function () {\n var seriesModels = [];\n this.ecModel.eachSeries(function (seriesModel) {\n if (isCoordSupported(seriesModel)) {\n var axisMainType = getAxisMainType(this._dimName);\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\n seriesModels.push(seriesModel);\n }\n }\n }, this);\n return seriesModels;\n };\n AxisProxy.prototype.getAxisModel = function () {\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\n };\n AxisProxy.prototype.getMinMaxSpan = function () {\n return zrUtil.clone(this._minMaxSpan);\n };\n /**\n * Only calculate by given range and this._dataExtent, do not change anything.\n */\n AxisProxy.prototype.calculateDataWindow = function (opt) {\n var dataExtent = this._dataExtent;\n var axisModel = this.getAxisModel();\n var scale = axisModel.axis.scale;\n var rangePropMode = this._dataZoomModel.getRangePropMode();\n var percentExtent = [0, 100];\n var percentWindow = [];\n var valueWindow = [];\n var hasPropModeValue;\n each(['start', 'end'], function (prop, idx) {\n var boundPercent = opt[prop];\n var boundValue = opt[prop + 'Value'];\n // Notice: dataZoom is based either on `percentProp` ('start', 'end') or\n // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\n // but not min/max of axis, which will be calculated by data window then).\n // The former one is suitable for cases that a dataZoom component controls multiple\n // axes with different unit or extent, and the latter one is suitable for accurate\n // zoom by pixel (e.g., in dataZoomSelect).\n // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\n // only when setOption or dispatchAction, otherwise it remains its original value.\n // (Why not only record `percentProp` and always map to `valueProp`? Because\n // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\n // `valueProp`. consider two axes constrolled by one dataZoom. They have different\n // data extent. All of values that are overflow the `dataExtent` will be calculated\n // to percent '100%').\n if (rangePropMode[idx] === 'percent') {\n boundPercent == null && (boundPercent = percentExtent[idx]);\n // Use scale.parse to math round for category or time axis.\n boundValue = scale.parse(numberUtil.linearMap(boundPercent, percentExtent, dataExtent));\n } else {\n hasPropModeValue = true;\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\n // Calculating `percent` from `value` may be not accurate, because\n // This calculation can not be inversed, because all of values that\n // are overflow the `dataExtent` will be calculated to percent '100%'\n boundPercent = numberUtil.linearMap(boundValue, dataExtent, percentExtent);\n }\n // valueWindow[idx] = round(boundValue);\n // percentWindow[idx] = round(boundPercent);\n // fallback to extent start/end when parsed value or percent is invalid\n valueWindow[idx] = boundValue == null || isNaN(boundValue) ? dataExtent[idx] : boundValue;\n percentWindow[idx] = boundPercent == null || isNaN(boundPercent) ? percentExtent[idx] : boundPercent;\n });\n asc(valueWindow);\n asc(percentWindow);\n // The windows from user calling of `dispatchAction` might be out of the extent,\n // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window\n // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\n // where API is able to initialize/modify the window size even though `zoomLock`\n // specified.\n var spans = this._minMaxSpan;\n hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\n var suffix = toValue ? 'Span' : 'ValueSpan';\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\n for (var i = 0; i < 2; i++) {\n toWindow[i] = numberUtil.linearMap(fromWindow[i], fromExtent, toExtent, true);\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\n }\n }\n return {\n valueWindow: valueWindow,\n percentWindow: percentWindow\n };\n };\n /**\n * Notice: reset should not be called before series.restoreData() is called,\n * so it is recommended to be called in \"process stage\" but not \"model init\n * stage\".\n */\n AxisProxy.prototype.reset = function (dataZoomModel) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n var targetSeries = this.getTargetSeriesModels();\n // Culculate data window and data extent, and record them.\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\n // `calculateDataWindow` uses min/maxSpan.\n this._updateMinMaxSpan();\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\n this._valueWindow = dataWindow.valueWindow;\n this._percentWindow = dataWindow.percentWindow;\n // Update axis setting then.\n this._setAxisModel();\n };\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n var axisDim = this._dimName;\n var seriesModels = this.getTargetSeriesModels();\n var filterMode = dataZoomModel.get('filterMode');\n var valueWindow = this._valueWindow;\n if (filterMode === 'none') {\n return;\n }\n // FIXME\n // Toolbox may has dataZoom injected. And if there are stacked bar chart\n // with NaN data, NaN will be filtered and stack will be wrong.\n // So we need to force the mode to be set empty.\n // In fect, it is not a big deal that do not support filterMode-'filter'\n // when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\n // selection\" some day, which might need \"adapt to data extent on the\n // otherAxis\", which is disabled by filterMode-'empty'.\n // But currently, stack has been fixed to based on value but not index,\n // so this is not an issue any more.\n // let otherAxisModel = this.getOtherAxisModel();\n // if (dataZoomModel.get('$fromToolbox')\n // && otherAxisModel\n // && otherAxisModel.hasSeriesStacked\n // ) {\n // filterMode = 'empty';\n // }\n // TODO\n // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\n each(seriesModels, function (seriesModel) {\n var seriesData = seriesModel.getData();\n var dataDims = seriesData.mapDimensionsAll(axisDim);\n if (!dataDims.length) {\n return;\n }\n if (filterMode === 'weakFilter') {\n var store_1 = seriesData.getStore();\n var dataDimIndices_1 = zrUtil.map(dataDims, function (dim) {\n return seriesData.getDimensionIndex(dim);\n }, seriesData);\n seriesData.filterSelf(function (dataIndex) {\n var leftOut;\n var rightOut;\n var hasValue;\n for (var i = 0; i < dataDims.length; i++) {\n var value = store_1.get(dataDimIndices_1[i], dataIndex);\n var thisHasValue = !isNaN(value);\n var thisLeftOut = value < valueWindow[0];\n var thisRightOut = value > valueWindow[1];\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\n return true;\n }\n thisHasValue && (hasValue = true);\n thisLeftOut && (leftOut = true);\n thisRightOut && (rightOut = true);\n }\n // If both left out and right out, do not filter.\n return hasValue && leftOut && rightOut;\n });\n } else {\n each(dataDims, function (dim) {\n if (filterMode === 'empty') {\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\n return !isInWindow(value) ? NaN : value;\n }));\n } else {\n var range = {};\n range[dim] = valueWindow;\n // console.time('select');\n seriesData.selectRange(range);\n // console.timeEnd('select');\n }\n });\n }\n\n each(dataDims, function (dim) {\n seriesData.setApproximateExtent(valueWindow, dim);\n });\n });\n function isInWindow(value) {\n return value >= valueWindow[0] && value <= valueWindow[1];\n }\n };\n AxisProxy.prototype._updateMinMaxSpan = function () {\n var minMaxSpan = this._minMaxSpan = {};\n var dataZoomModel = this._dataZoomModel;\n var dataExtent = this._dataExtent;\n each(['min', 'max'], function (minMax) {\n var percentSpan = dataZoomModel.get(minMax + 'Span');\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\n // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\n if (valueSpan != null) {\n percentSpan = numberUtil.linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\n } else if (percentSpan != null) {\n valueSpan = numberUtil.linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\n }\n minMaxSpan[minMax + 'Span'] = percentSpan;\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\n }, this);\n };\n AxisProxy.prototype._setAxisModel = function () {\n var axisModel = this.getAxisModel();\n var percentWindow = this._percentWindow;\n var valueWindow = this._valueWindow;\n if (!percentWindow) {\n return;\n }\n // [0, 500]: arbitrary value, guess axis extent.\n var precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);\n precision = Math.min(precision, 20);\n // For value axis, if min/max/scale are not set, we just use the extent obtained\n // by series data, which may be a little different from the extent calculated by\n // `axisHelper.getScaleExtent`. But the different just affects the experience a\n // little when zooming. So it will not be fixed until some users require it strongly.\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\n if (percentWindow[0] !== 0) {\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\n }\n if (percentWindow[1] !== 100) {\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\n }\n rawExtentInfo.freeze();\n };\n return AxisProxy;\n}();\nfunction calculateDataExtent(axisProxy, axisDim, seriesModels) {\n var dataExtent = [Infinity, -Infinity];\n each(seriesModels, function (seriesModel) {\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\n });\n // It is important to get \"consistent\" extent when more then one axes is\n // controlled by a `dataZoom`, otherwise those axes will not be synchronized\n // when zooming. But it is difficult to know what is \"consistent\", considering\n // axes have different type or even different meanings (For example, two\n // time axes are used to compare data of the same date in different years).\n // So basically dataZoom just obtains extent by series.data (in category axis\n // extent can be obtained from axis.data).\n // Nevertheless, user can set min/max/scale on axes to make extent of axes\n // consistent.\n var axisModel = axisProxy.getAxisModel();\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\n return [rawExtentResult.min, rawExtentResult.max];\n}\nexport default AxisProxy;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { getAxisMainType } from './helper.js';\nimport AxisProxy from './AxisProxy.js';\nvar dataZoomProcessor = {\n // `dataZoomProcessor` will only be performed in needed series. Consider if\n // there is a line series and a pie series, it is better not to update the\n // line series if only pie series is needed to be updated.\n getTargetSeries: function (ecModel) {\n function eachAxisModel(cb) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\n });\n });\n }\n // FIXME: it brings side-effect to `getTargetSeries`.\n // Prepare axis proxies.\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // dispose all last axis proxy, in case that some axis are deleted.\n axisModel.__dzAxisProxy = null;\n });\n var proxyList = [];\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // Different dataZooms may constrol the same axis. In that case,\n // an axisProxy serves both of them.\n if (!axisModel.__dzAxisProxy) {\n // Use the first dataZoomModel as the main model of axisProxy.\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\n proxyList.push(axisModel.__dzAxisProxy);\n }\n });\n var seriesModelMap = createHashMap();\n each(proxyList, function (axisProxy) {\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\n seriesModelMap.set(seriesModel.uid, seriesModel);\n });\n });\n return seriesModelMap;\n },\n // Consider appendData, where filter should be performed. Because data process is\n // in block mode currently, it is not need to worry about that the overallProgress\n // execute every frame.\n overallReset: function (ecModel, api) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // We calculate window and reset axis here but not in model\n // init stage and not after action dispatch handler, because\n // reset should be called after seriesData.restoreData.\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\n });\n // Caution: data zoom filtering is order sensitive when using\n // percent range and no min/max/scale set on axis.\n // For example, we have dataZoom definition:\n // [\n // {xAxisIndex: 0, start: 30, end: 70},\n // {yAxisIndex: 0, start: 20, end: 80}\n // ]\n // In this case, [20, 80] of y-dataZoom should be based on data\n // that have filtered by x-dataZoom using range of [30, 70],\n // but should not be based on full raw data. Thus sliding\n // x-dataZoom will change both ranges of xAxis and yAxis,\n // while sliding y-dataZoom will only change the range of yAxis.\n // So we should filter x-axis after reset x-axis immediately,\n // and then reset y-axis and filter y-axis.\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\n });\n });\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // Fullfill all of the range props so that user\n // is able to get them from chart.getOption().\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n if (axisProxy) {\n var percentRange = axisProxy.getDataPercentWindow();\n var valueRange = axisProxy.getDataValueWindow();\n dataZoomModel.setCalculatedRange({\n start: percentRange[0],\n end: percentRange[1],\n startValue: valueRange[0],\n endValue: valueRange[1]\n });\n }\n });\n }\n};\nexport default dataZoomProcessor;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { findEffectedDataZooms } from './helper.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport default function installDataZoomAction(registers) {\n registers.registerAction('dataZoom', function (payload, ecModel) {\n var effectedModels = findEffectedDataZooms(ecModel, payload);\n each(effectedModels, function (dataZoomModel) {\n dataZoomModel.setRawRange({\n start: payload.start,\n end: payload.end,\n startValue: payload.startValue,\n endValue: payload.endValue\n });\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport dataZoomProcessor from './dataZoomProcessor.js';\nimport installDataZoomAction from './dataZoomAction.js';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n installed = true;\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor);\n installDataZoomAction(registers);\n registers.registerSubTypeDefaulter('dataZoom', function () {\n // Default 'slider' when no type specified.\n return 'slider';\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SelectZoomModel from './SelectZoomModel.js';\nimport SelectZoomView from './SelectZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(SelectZoomModel);\n registers.registerComponentView(SelectZoomView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nvar ToolboxFeature = /** @class */function () {\n function ToolboxFeature() {}\n return ToolboxFeature;\n}();\nexport { ToolboxFeature };\nvar features = {};\nexport function registerFeature(name, ctor) {\n features[name] = ctor;\n}\nexport function getFeature(name) {\n return features[name];\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as featureManager from './featureManager.js';\nimport ComponentModel from '../../model/Component.js';\nvar ToolboxModel = /** @class */function (_super) {\n __extends(ToolboxModel, _super);\n function ToolboxModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ToolboxModel.type;\n return _this;\n }\n ToolboxModel.prototype.optionUpdated = function () {\n _super.prototype.optionUpdated.apply(this, arguments);\n var ecModel = this.ecModel;\n zrUtil.each(this.option.feature, function (featureOpt, featureName) {\n var Feature = featureManager.getFeature(featureName);\n if (Feature) {\n if (Feature.getDefaultOption) {\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\n }\n zrUtil.merge(featureOpt, Feature.defaultOption);\n }\n });\n };\n ToolboxModel.type = 'toolbox';\n ToolboxModel.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n ToolboxModel.defaultOption = {\n show: true,\n z: 6,\n // zlevel: 0,\n orient: 'horizontal',\n left: 'right',\n top: 'top',\n // right\n // bottom\n backgroundColor: 'transparent',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemSize: 15,\n itemGap: 8,\n showTitle: true,\n iconStyle: {\n borderColor: '#666',\n color: 'none'\n },\n emphasis: {\n iconStyle: {\n borderColor: '#3E98C5'\n }\n },\n // textStyle: {},\n // feature\n tooltip: {\n show: false,\n position: 'bottom'\n }\n };\n return ToolboxModel;\n}(ComponentModel);\nexport default ToolboxModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport { getLayoutRect, box as layoutBox, positionElement } from '../../util/layout.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as graphic from '../../util/graphic.js';\n/**\n * Layout list like component.\n * It will box layout each items in group of component and then position the whole group in the viewport\n * @param {module:zrender/group/Group} group\n * @param {module:echarts/model/Component} componentModel\n * @param {module:echarts/ExtensionAPI}\n */\nexport function layout(group, componentModel, api) {\n var boxLayoutParams = componentModel.getBoxLayoutParams();\n var padding = componentModel.get('padding');\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\n layoutBox(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\n positionElement(group, boxLayoutParams, viewportSize, padding);\n}\nexport function makeBackground(rect, componentModel) {\n var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n var style = componentModel.getItemStyle(['color', 'opacity']);\n style.fill = componentModel.get('backgroundColor');\n rect = new graphic.Rect({\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[1] + padding[3],\n height: rect.height + padding[0] + padding[2],\n r: componentModel.get('borderRadius')\n },\n style: style,\n silent: true,\n z2: -1\n });\n // FIXME\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n // and background rect when setting like `left: 0`, `top: 0`.\n // graphic.subPixelOptimizeRect(rect);\n return rect;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis } from '../../util/states.js';\nimport Model from '../../model/Model.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as listComponentHelper from '../helper/listComponent.js';\nimport ComponentView from '../../view/Component.js';\nimport { ToolboxFeature, getFeature } from './featureManager.js';\nimport { getUID } from '../../util/component.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { getFont } from '../../label/labelStyle.js';\nvar ToolboxView = /** @class */function (_super) {\n __extends(ToolboxView, _super);\n function ToolboxView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n if (!toolboxModel.get('show')) {\n return;\n }\n var itemSize = +toolboxModel.get('itemSize');\n var isVertical = toolboxModel.get('orient') === 'vertical';\n var featureOpts = toolboxModel.get('feature') || {};\n var features = this._features || (this._features = {});\n var featureNames = [];\n zrUtil.each(featureOpts, function (opt, name) {\n featureNames.push(name);\n });\n new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(zrUtil.curry(processFeature, null)).execute();\n // Keep for diff.\n this._featureNames = featureNames;\n function processFeature(newIndex, oldIndex) {\n var featureName = featureNames[newIndex];\n var oldName = featureNames[oldIndex];\n var featureOpt = featureOpts[featureName];\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\n var feature;\n // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\n featureOpt.title = payload.newTitle;\n }\n if (featureName && !oldName) {\n // Create\n if (isUserFeatureName(featureName)) {\n feature = {\n onclick: featureModel.option.onclick,\n featureName: featureName\n };\n } else {\n var Feature = getFeature(featureName);\n if (!Feature) {\n return;\n }\n feature = new Feature();\n }\n features[featureName] = feature;\n } else {\n feature = features[oldName];\n // If feature does not exist.\n if (!feature) {\n return;\n }\n }\n feature.uid = getUID('toolbox-feature');\n feature.model = featureModel;\n feature.ecModel = ecModel;\n feature.api = api;\n var isToolboxFeature = feature instanceof ToolboxFeature;\n if (!featureName && oldName) {\n isToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n return;\n }\n if (!featureModel.get('show') || isToolboxFeature && feature.unusable) {\n isToolboxFeature && feature.remove && feature.remove(ecModel, api);\n return;\n }\n createIconPaths(featureModel, feature, featureName);\n featureModel.setIconStatus = function (iconName, status) {\n var option = this.option;\n var iconPaths = this.iconPaths;\n option.iconStatus = option.iconStatus || {};\n option.iconStatus[iconName] = status;\n if (iconPaths[iconName]) {\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\n }\n };\n if (feature instanceof ToolboxFeature) {\n if (feature.render) {\n feature.render(featureModel, ecModel, api, payload);\n }\n }\n }\n function createIconPaths(featureModel, feature, featureName) {\n var iconStyleModel = featureModel.getModel('iconStyle');\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\n // If one feature has multiple icons, they are organized as\n // {\n // icon: {\n // foo: '',\n // bar: ''\n // },\n // title: {\n // foo: '',\n // bar: ''\n // }\n // }\n var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon');\n var titles = featureModel.get('title') || {};\n var iconsMap;\n var titlesMap;\n if (zrUtil.isString(icons)) {\n iconsMap = {};\n iconsMap[featureName] = icons;\n } else {\n iconsMap = icons;\n }\n if (zrUtil.isString(titles)) {\n titlesMap = {};\n titlesMap[featureName] = titles;\n } else {\n titlesMap = titles;\n }\n var iconPaths = featureModel.iconPaths = {};\n zrUtil.each(iconsMap, function (iconStr, iconName) {\n var path = graphic.createIcon(iconStr, {}, {\n x: -itemSize / 2,\n y: -itemSize / 2,\n width: itemSize,\n height: itemSize\n }); // TODO handling image\n path.setStyle(iconStyleModel.getItemStyle());\n var pathEmphasisState = path.ensureState('emphasis');\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\n // Text position calculation\n // TODO: extract `textStyle` from `iconStyle` and use `createTextStyle`\n var textContent = new ZRText({\n style: {\n text: titlesMap[iconName],\n align: iconStyleEmphasisModel.get('textAlign'),\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\n padding: iconStyleEmphasisModel.get('textPadding'),\n fill: null,\n font: getFont({\n fontStyle: iconStyleEmphasisModel.get('textFontStyle'),\n fontFamily: iconStyleEmphasisModel.get('textFontFamily'),\n fontSize: iconStyleEmphasisModel.get('textFontSize'),\n fontWeight: iconStyleEmphasisModel.get('textFontWeight')\n }, ecModel)\n },\n ignore: true\n });\n path.setTextContent(textContent);\n graphic.setTooltipConfig({\n el: path,\n componentModel: toolboxModel,\n itemName: iconName,\n formatterParamsExtra: {\n title: titlesMap[iconName]\n }\n });\n path.__title = titlesMap[iconName];\n path.on('mouseover', function () {\n // Should not reuse above hoverStyle, which might be modified.\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\n var defaultTextPosition = isVertical ? toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' ? 'right' : 'left' : toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' ? 'bottom' : 'top';\n textContent.setStyle({\n fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000',\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\n });\n path.setTextConfig({\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\n });\n textContent.ignore = !toolboxModel.get('showTitle');\n // Use enterEmphasis and leaveEmphasis provide by ec.\n // There are flags managed by the echarts.\n api.enterEmphasis(this);\n }).on('mouseout', function () {\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\n api.leaveEmphasis(this);\n }\n textContent.hide();\n });\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\n group.add(path);\n path.on('click', zrUtil.bind(feature.onclick, feature, ecModel, api, iconName));\n iconPaths[iconName] = path;\n });\n }\n listComponentHelper.layout(group, toolboxModel, api);\n // Render background after group is layout\n // FIXME\n group.add(listComponentHelper.makeBackground(group.getBoundingRect(), toolboxModel));\n // Adjust icon title positions to avoid them out of screen\n isVertical || group.eachChild(function (icon) {\n var titleText = icon.__title;\n // const hoverStyle = icon.hoverStyle;\n // TODO simplify code?\n var emphasisState = icon.ensureState('emphasis');\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\n var textContent = icon.getTextContent();\n var emphasisTextState = textContent && textContent.ensureState('emphasis');\n // May be background element\n if (emphasisTextState && !zrUtil.isFunction(emphasisTextState) && titleText) {\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\n var rect = textContain.getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\n var offsetX = icon.x + group.x;\n var offsetY = icon.y + group.y + itemSize;\n var needPutOnTop = false;\n if (offsetY + rect.height > api.getHeight()) {\n emphasisTextConfig.position = 'top';\n needPutOnTop = true;\n }\n var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10;\n if (offsetX + rect.width / 2 > api.getWidth()) {\n emphasisTextConfig.position = ['100%', topOffset];\n emphasisTextStyle.align = 'right';\n } else if (offsetX - rect.width / 2 < 0) {\n emphasisTextConfig.position = [0, topOffset];\n emphasisTextStyle.align = 'left';\n }\n }\n });\n };\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\n });\n };\n // updateLayout(toolboxModel, ecModel, api, payload) {\n // zrUtil.each(this._features, function (feature) {\n // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\n // });\n // },\n ToolboxView.prototype.remove = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api);\n });\n this.group.removeAll();\n };\n ToolboxView.prototype.dispose = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n });\n };\n ToolboxView.type = 'toolbox';\n return ToolboxView;\n}(ComponentView);\nfunction isUserFeatureName(featureName) {\n return featureName.indexOf('my') === 0;\n}\nexport default ToolboxView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global window, Uint8Array, document */\nimport env from 'zrender/lib/core/env.js';\nimport { ToolboxFeature } from '../featureManager.js';\nvar SaveAsImage = /** @class */function (_super) {\n __extends(SaveAsImage, _super);\n function SaveAsImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SaveAsImage.prototype.onclick = function (ecModel, api) {\n var model = this.model;\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\n var isSvg = api.getZr().painter.getType() === 'svg';\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\n var url = api.getConnectedDataURL({\n type: type,\n backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff',\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\n excludeComponents: model.get('excludeComponents'),\n pixelRatio: model.get('pixelRatio')\n });\n var browser = env.browser;\n // Chrome, Firefox, New Edge\n if (typeof MouseEvent === 'function' && (browser.newEdge || !browser.ie && !browser.edge)) {\n var $a = document.createElement('a');\n $a.download = title + '.' + type;\n $a.target = '_blank';\n $a.href = url;\n var evt = new MouseEvent('click', {\n // some micro front-end framework, window maybe is a Proxy\n view: document.defaultView,\n bubbles: true,\n cancelable: false\n });\n $a.dispatchEvent(evt);\n }\n // IE or old Edge\n else {\n // @ts-ignore\n if (window.navigator.msSaveOrOpenBlob || isSvg) {\n var parts = url.split(',');\n // data:[][;charset=][;base64],\n var base64Encoded = parts[0].indexOf('base64') > -1;\n var bstr = isSvg\n // should decode the svg data uri first\n ? decodeURIComponent(parts[1]) : parts[1];\n // only `atob` when the data uri is encoded with base64\n // otherwise, like `svg` data uri exported by zrender,\n // there will be an error, for it's not encoded with base64.\n // (just a url-encoded string through `encodeURIComponent`)\n base64Encoded && (bstr = window.atob(bstr));\n var filename = title + '.' + type;\n // @ts-ignore\n if (window.navigator.msSaveOrOpenBlob) {\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new Blob([u8arr]); // @ts-ignore\n window.navigator.msSaveOrOpenBlob(blob, filename);\n } else {\n var frame = document.createElement('iframe');\n document.body.appendChild(frame);\n var cw = frame.contentWindow;\n var doc = cw.document;\n doc.open('image/svg+xml', 'replace');\n doc.write(bstr);\n doc.close();\n cw.focus();\n doc.execCommand('SaveAs', true, filename);\n document.body.removeChild(frame);\n }\n } else {\n var lang = model.get('lang');\n var html = '' + '' + '' + '';\n var tab = window.open();\n tab.document.write(html);\n tab.document.title = title;\n }\n }\n };\n SaveAsImage.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\n title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']),\n type: 'png',\n // Default use option.backgroundColor\n // backgroundColor: '#fff',\n connectedBackgroundColor: '#fff',\n name: '',\n excludeComponents: ['toolbox'],\n // use current pixel ratio of device by default\n // pixelRatio: 1,\n lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang'])\n };\n return defaultOption;\n };\n return SaveAsImage;\n}(ToolboxFeature);\nexport default SaveAsImage;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { SINGLE_REFERRING } from '../../../util/model.js';\nvar INNER_STACK_KEYWORD = '__ec_magicType_stack__';\nvar ICON_TYPES = ['line', 'bar', 'stack'];\n// stack and tiled appears in pair for the title\nvar TITLE_TYPES = ['line', 'bar', 'stack', 'tiled'];\nvar radioTypes = [['line', 'bar'], ['stack']];\nvar MagicType = /** @class */function (_super) {\n __extends(MagicType, _super);\n function MagicType() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MagicType.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon');\n var icons = {};\n zrUtil.each(model.get('type'), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n MagicType.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: [],\n // Icon group\n icon: {\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\n // eslint-disable-next-line\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z' // jshint ignore:line\n },\n\n // `line`, `bar`, `stack`, `tiled`\n title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']),\n option: {},\n seriesIndex: {}\n };\n return defaultOption;\n };\n MagicType.prototype.onclick = function (ecModel, api, type) {\n var model = this.model;\n var seriesIndex = model.get(['seriesIndex', type]);\n // Not supported magicType\n if (!seriesOptGenreator[type]) {\n return;\n }\n var newOption = {\n series: []\n };\n var generateNewSeriesTypes = function (seriesModel) {\n var seriesType = seriesModel.subType;\n var seriesId = seriesModel.id;\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\n if (newSeriesOpt) {\n // PENDING If merge original option?\n zrUtil.defaults(newSeriesOpt, seriesModel.option);\n newOption.series.push(newSeriesOpt);\n }\n // Modify boundaryGap\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n if (categoryAxis) {\n var axisDim = categoryAxis.dim;\n var axisType = axisDim + 'Axis';\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n var axisIndex = axisModel.componentIndex;\n newOption[axisType] = newOption[axisType] || [];\n for (var i = 0; i <= axisIndex; i++) {\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\n }\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\n }\n }\n };\n zrUtil.each(radioTypes, function (radio) {\n if (zrUtil.indexOf(radio, type) >= 0) {\n zrUtil.each(radio, function (item) {\n model.setIconStatus(item, 'normal');\n });\n }\n });\n model.setIconStatus(type, 'emphasis');\n ecModel.eachComponent({\n mainType: 'series',\n query: seriesIndex == null ? null : {\n seriesIndex: seriesIndex\n }\n }, generateNewSeriesTypes);\n var newTitle;\n var currentType = type;\n // Change title of stack\n if (type === 'stack') {\n // use titles in model instead of ecModel\n // as stack and tiled appears in pair, just flip them\n // no need of checking stack state\n newTitle = zrUtil.merge({\n stack: model.option.title.tiled,\n tiled: model.option.title.stack\n }, model.option.title);\n if (model.get(['iconStatus', type]) !== 'emphasis') {\n currentType = 'tiled';\n }\n }\n api.dispatchAction({\n type: 'changeMagicType',\n currentType: currentType,\n newOption: newOption,\n newTitle: newTitle,\n featureName: 'magicType'\n });\n };\n return MagicType;\n}(ToolboxFeature);\nvar seriesOptGenreator = {\n 'line': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'bar') {\n return zrUtil.merge({\n id: seriesId,\n type: 'line',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'line']) || {}, true);\n }\n },\n 'bar': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'line') {\n return zrUtil.merge({\n id: seriesId,\n type: 'bar',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'bar']) || {}, true);\n }\n },\n 'stack': function (seriesType, seriesId, seriesModel, model) {\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\n if (seriesType === 'line' || seriesType === 'bar') {\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\n return zrUtil.merge({\n id: seriesId,\n stack: isStack ? '' : INNER_STACK_KEYWORD\n }, model.get(['option', 'stack']) || {}, true);\n }\n }\n};\n// TODO: SELF REGISTERED.\necharts.registerAction({\n type: 'changeMagicType',\n event: 'magicTypeChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.mergeOption(payload.newOption);\n});\nexport default MagicType;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/* global document */\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { addEventListener } from 'zrender/lib/core/event.js';\nimport { warn } from '../../../util/log.js';\n/* global document */\nvar BLOCK_SPLITER = new Array(60).join('-');\nvar ITEM_SPLITER = '\\t';\n/**\n * Group series into two types\n * 1. on category axis, like line, bar\n * 2. others, like scatter, pie\n */\nfunction groupSeries(ecModel) {\n var seriesGroupByCategoryAxis = {};\n var otherSeries = [];\n var meta = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\n // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.\n var baseAxis = coordSys.getBaseAxis();\n if (baseAxis.type === 'category') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n if (!seriesGroupByCategoryAxis[key]) {\n seriesGroupByCategoryAxis[key] = {\n categoryAxis: baseAxis,\n valueAxis: coordSys.getOtherAxis(baseAxis),\n series: []\n };\n meta.push({\n axisDim: baseAxis.dim,\n axisIndex: baseAxis.index\n });\n }\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\n } else {\n otherSeries.push(seriesModel);\n }\n } else {\n otherSeries.push(seriesModel);\n }\n });\n return {\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\n other: otherSeries,\n meta: meta\n };\n}\n/**\n * Assemble content of series on cateogory axis\n * @inner\n */\nfunction assembleSeriesWithCategoryAxis(groups) {\n var tables = [];\n zrUtil.each(groups, function (group, key) {\n var categoryAxis = group.categoryAxis;\n var valueAxis = group.valueAxis;\n var valueAxisDim = valueAxis.dim;\n var headers = [' '].concat(zrUtil.map(group.series, function (series) {\n return series.name;\n }));\n // @ts-ignore TODO Polar\n var columns = [categoryAxis.model.getCategories()];\n zrUtil.each(group.series, function (series) {\n var rawData = series.getRawData();\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\n return val;\n }));\n });\n // Assemble table content\n var lines = [headers.join(ITEM_SPLITER)];\n for (var i = 0; i < columns[0].length; i++) {\n var items = [];\n for (var j = 0; j < columns.length; j++) {\n items.push(columns[j][i]);\n }\n lines.push(items.join(ITEM_SPLITER));\n }\n tables.push(lines.join('\\n'));\n });\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n/**\n * Assemble content of other series\n */\nfunction assembleOtherSeries(series) {\n return zrUtil.map(series, function (series) {\n var data = series.getRawData();\n var lines = [series.name];\n var vals = [];\n data.each(data.dimensions, function () {\n var argLen = arguments.length;\n var dataIndex = arguments[argLen - 1];\n var name = data.getName(dataIndex);\n for (var i = 0; i < argLen - 1; i++) {\n vals[i] = arguments[i];\n }\n lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER));\n });\n return lines.join('\\n');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\nfunction getContentFromModel(ecModel) {\n var result = groupSeries(ecModel);\n return {\n value: zrUtil.filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) {\n return !!str.replace(/[\\n\\t\\s]/g, '');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\n meta: result.meta\n };\n}\nfunction trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}\n/**\n * If a block is tsv format\n */\nfunction isTSVFormat(block) {\n // Simple method to find out if a block is tsv format\n var firstLine = block.slice(0, block.indexOf('\\n'));\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n return true;\n }\n}\nvar itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\n/**\n * @param {string} tsv\n * @return {Object}\n */\nfunction parseTSVContents(tsv) {\n var tsvLines = tsv.split(/\\n+/g);\n var headers = trim(tsvLines.shift()).split(itemSplitRegex);\n var categories = [];\n var series = zrUtil.map(headers, function (header) {\n return {\n name: header,\n data: []\n };\n });\n for (var i = 0; i < tsvLines.length; i++) {\n var items = trim(tsvLines[i]).split(itemSplitRegex);\n categories.push(items.shift());\n for (var j = 0; j < items.length; j++) {\n series[j] && (series[j].data[i] = items[j]);\n }\n }\n return {\n series: series,\n categories: categories\n };\n}\nfunction parseListContents(str) {\n var lines = str.split(/\\n+/g);\n var seriesName = trim(lines.shift());\n var data = [];\n for (var i = 0; i < lines.length; i++) {\n // if line is empty, ignore it.\n // there is a case that a user forgot to delete `\\n`.\n var line = trim(lines[i]);\n if (!line) {\n continue;\n }\n var items = line.split(itemSplitRegex);\n var name_1 = '';\n var value = void 0;\n var hasName = false;\n if (isNaN(items[0])) {\n // First item is name\n hasName = true;\n name_1 = items[0];\n items = items.slice(1);\n data[i] = {\n name: name_1,\n value: []\n };\n value = data[i].value;\n } else {\n value = data[i] = [];\n }\n for (var j = 0; j < items.length; j++) {\n value.push(+items[j]);\n }\n if (value.length === 1) {\n hasName ? data[i].value = value[0] : data[i] = value[0];\n }\n }\n return {\n name: seriesName,\n data: data\n };\n}\nfunction parseContents(str, blockMetaList) {\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\n var newOption = {\n series: []\n };\n zrUtil.each(blocks, function (block, idx) {\n if (isTSVFormat(block)) {\n var result = parseTSVContents(block);\n var blockMeta = blockMetaList[idx];\n var axisKey = blockMeta.axisDim + 'Axis';\n if (blockMeta) {\n newOption[axisKey] = newOption[axisKey] || [];\n newOption[axisKey][blockMeta.axisIndex] = {\n data: result.categories\n };\n newOption.series = newOption.series.concat(result.series);\n }\n } else {\n var result = parseListContents(block);\n newOption.series.push(result);\n }\n });\n return newOption;\n}\nvar DataView = /** @class */function (_super) {\n __extends(DataView, _super);\n function DataView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DataView.prototype.onclick = function (ecModel, api) {\n // FIXME: better way?\n setTimeout(function () {\n api.dispatchAction({\n type: 'hideTip'\n });\n });\n var container = api.getDom();\n var model = this.model;\n if (this._dom) {\n container.removeChild(this._dom);\n }\n var root = document.createElement('div');\n // use padding to avoid 5px whitespace\n root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px';\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\n // Create elements\n var header = document.createElement('h4');\n var lang = model.get('lang') || [];\n header.innerHTML = lang[0] || model.get('title');\n header.style.cssText = 'margin:10px 20px';\n header.style.color = model.get('textColor');\n var viewMain = document.createElement('div');\n var textarea = document.createElement('textarea');\n viewMain.style.cssText = 'overflow:auto';\n var optionToContent = model.get('optionToContent');\n var contentToOption = model.get('contentToOption');\n var result = getContentFromModel(ecModel);\n if (zrUtil.isFunction(optionToContent)) {\n var htmlOrDom = optionToContent(api.getOption());\n if (zrUtil.isString(htmlOrDom)) {\n viewMain.innerHTML = htmlOrDom;\n } else if (zrUtil.isDom(htmlOrDom)) {\n viewMain.appendChild(htmlOrDom);\n }\n } else {\n // Use default textarea\n textarea.readOnly = model.get('readOnly');\n var style = textarea.style;\n // eslint-disable-next-line max-len\n style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none';\n style.color = model.get('textColor');\n style.borderColor = model.get('textareaBorderColor');\n style.backgroundColor = model.get('textareaColor');\n textarea.value = result.value;\n viewMain.appendChild(textarea);\n }\n var blockMetaList = result.meta;\n var buttonContainer = document.createElement('div');\n buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0';\n // eslint-disable-next-line max-len\n var buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\n var closeButton = document.createElement('div');\n var refreshButton = document.createElement('div');\n buttonStyle += ';background-color:' + model.get('buttonColor');\n buttonStyle += ';color:' + model.get('buttonTextColor');\n var self = this;\n function close() {\n container.removeChild(root);\n self._dom = null;\n }\n addEventListener(closeButton, 'click', close);\n addEventListener(refreshButton, 'click', function () {\n if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\n }\n close();\n return;\n }\n var newOption;\n try {\n if (zrUtil.isFunction(contentToOption)) {\n newOption = contentToOption(viewMain, api.getOption());\n } else {\n newOption = parseContents(textarea.value, blockMetaList);\n }\n } catch (e) {\n close();\n throw new Error('Data view format error ' + e);\n }\n if (newOption) {\n api.dispatchAction({\n type: 'changeDataView',\n newOption: newOption\n });\n }\n close();\n });\n closeButton.innerHTML = lang[1];\n refreshButton.innerHTML = lang[2];\n refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\n buttonContainer.appendChild(closeButton);\n root.appendChild(header);\n root.appendChild(viewMain);\n root.appendChild(buttonContainer);\n viewMain.style.height = container.clientHeight - 80 + 'px';\n container.appendChild(root);\n this._dom = root;\n };\n DataView.prototype.remove = function (ecModel, api) {\n this._dom && api.getDom().removeChild(this._dom);\n };\n DataView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n DataView.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n readOnly: false,\n optionToContent: null,\n contentToOption: null,\n // eslint-disable-next-line\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\n title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']),\n lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']),\n backgroundColor: '#fff',\n textColor: '#000',\n textareaColor: '#fff',\n textareaBorderColor: '#333',\n buttonColor: '#c23531',\n buttonTextColor: '#fff'\n };\n return defaultOption;\n };\n return DataView;\n}(ToolboxFeature);\n/**\n * @inner\n */\nfunction tryMergeDataOption(newData, originalData) {\n return zrUtil.map(newData, function (newVal, idx) {\n var original = originalData && originalData[idx];\n if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {\n var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);\n if (!newValIsObject) {\n newVal = {\n value: newVal\n };\n }\n // original data has name but new data has no name\n var shouldDeleteName = original.name != null && newVal.name == null;\n // Original data has option\n newVal = zrUtil.defaults(newVal, original);\n shouldDeleteName && delete newVal.name;\n return newVal;\n } else {\n return newVal;\n }\n });\n}\n// TODO: SELF REGISTERED.\necharts.registerAction({\n type: 'changeDataView',\n event: 'dataViewChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n var newSeriesOptList = [];\n zrUtil.each(payload.newOption.series, function (seriesOpt) {\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\n if (!seriesModel) {\n // New created series\n // Geuss the series type\n newSeriesOptList.push(zrUtil.extend({\n // Default is scatter\n type: 'scatter'\n }, seriesOpt));\n } else {\n var originalData = seriesModel.get('data');\n newSeriesOptList.push({\n name: seriesOpt.name,\n data: tryMergeDataOption(seriesOpt.data, originalData)\n });\n }\n });\n ecModel.mergeOption(zrUtil.defaults({\n series: newSeriesOptList\n }, payload.newOption));\n});\nexport default DataView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar each = zrUtil.each;\nvar inner = makeInner();\n/**\n * @param ecModel\n * @param newSnapshot key is dataZoomId\n */\nexport function push(ecModel, newSnapshot) {\n var storedSnapshots = getStoreSnapshots(ecModel);\n // If previous dataZoom can not be found,\n // complete an range with current range.\n each(newSnapshot, function (batchItem, dataZoomId) {\n var i = storedSnapshots.length - 1;\n for (; i >= 0; i--) {\n var snapshot = storedSnapshots[i];\n if (snapshot[dataZoomId]) {\n break;\n }\n }\n if (i < 0) {\n // No origin range set, create one by current range.\n var dataZoomModel = ecModel.queryComponents({\n mainType: 'dataZoom',\n subType: 'select',\n id: dataZoomId\n })[0];\n if (dataZoomModel) {\n var percentRange = dataZoomModel.getPercentRange();\n storedSnapshots[0][dataZoomId] = {\n dataZoomId: dataZoomId,\n start: percentRange[0],\n end: percentRange[1]\n };\n }\n }\n });\n storedSnapshots.push(newSnapshot);\n}\nexport function pop(ecModel) {\n var storedSnapshots = getStoreSnapshots(ecModel);\n var head = storedSnapshots[storedSnapshots.length - 1];\n storedSnapshots.length > 1 && storedSnapshots.pop();\n // Find top for all dataZoom.\n var snapshot = {};\n each(head, function (batchItem, dataZoomId) {\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\n batchItem = storedSnapshots[i][dataZoomId];\n if (batchItem) {\n snapshot[dataZoomId] = batchItem;\n break;\n }\n }\n });\n return snapshot;\n}\nexport function clear(ecModel) {\n inner(ecModel).snapshots = null;\n}\nexport function count(ecModel) {\n return getStoreSnapshots(ecModel).length;\n}\n/**\n * History length of each dataZoom may be different.\n * this._history[0] is used to store origin range.\n */\nfunction getStoreSnapshots(ecModel) {\n var store = inner(ecModel);\n if (!store.snapshots) {\n store.snapshots = [{}];\n }\n return store.snapshots;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as history from '../../dataZoom/history.js';\nimport { ToolboxFeature } from '../featureManager.js';\nvar RestoreOption = /** @class */function (_super) {\n __extends(RestoreOption, _super);\n function RestoreOption() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n RestoreOption.prototype.onclick = function (ecModel, api) {\n history.clear(ecModel);\n api.dispatchAction({\n type: 'restore',\n from: this.uid\n });\n };\n RestoreOption.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n // eslint-disable-next-line\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\n title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title'])\n };\n return defaultOption;\n };\n return RestoreOption;\n}(ToolboxFeature);\n// TODO: SELF REGISTERED.\necharts.registerAction({\n type: 'restore',\n event: 'restore',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.resetOption('recreate');\n});\nexport default RestoreOption;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, indexOf, curry, assert, map, createHashMap } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as brushHelper from './brushHelper.js';\nimport { parseFinder as modelUtilParseFinder } from '../../util/model.js';\n// FIXME\n// how to genarialize to more coordinate systems.\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\nvar BrushTargetManager = /** @class */function () {\n /**\n * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\n * @param opt.include include coordinate system types.\n */\n function BrushTargetManager(finder, ecModel, opt) {\n var _this = this;\n this._targetInfoList = [];\n var foundCpts = parseFinder(ecModel, finder);\n each(targetInfoBuilders, function (builder, type) {\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n builder(foundCpts, _this._targetInfoList);\n }\n });\n }\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\n // area.coordRange is the first of area.coordRanges\n if (!area.coordRange) {\n area.coordRange = coordRange;\n // In 'category' axis, coord to pixel is not reversible, so we can not\n // rebuild range by coordRange accrately, which may bring trouble when\n // brushing only one item. So we use __rangeOffset to rebuilding range\n // by coordRange. And this it only used in brush component so it is no\n // need to be adapted to coordRanges.\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\n area.__rangeOffset = {\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n xyMinMax: result.xyMinMax\n };\n }\n });\n return areas;\n };\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n if (targetInfo && targetInfo !== true) {\n each(targetInfo.coordSyses, function (coordSys) {\n var result = coordConvert[area.brushType](1, coordSys, area.range, true);\n cb(area, result.values, coordSys, ecModel);\n });\n }\n }, this);\n };\n /**\n * the `areas` is `BrushModel.areas`.\n * Called in layout stage.\n * convert `area.coordRange` to global range and set panelId to `area.range`.\n */\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n if (process.env.NODE_ENV !== 'production') {\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\n }\n area.range = area.range || [];\n // convert coordRange to global range and set panelId.\n if (targetInfo && targetInfo !== true) {\n area.panelId = targetInfo.panelId;\n // (1) area.range should always be calculate from coordRange but does\n // not keep its original value, for the sake of the dataZoom scenario,\n // where area.coordRange remains unchanged but area.range may be changed.\n // (2) Only support converting one coordRange to pixel range in brush\n // component. So do not consider `coordRanges`.\n // (3) About __rangeOffset, see comment above.\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n var rangeOffset = area.__rangeOffset;\n area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n }\n }, this);\n };\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\n return map(this._targetInfoList, function (targetInfo) {\n var rect = targetInfo.getPanelRect();\n return {\n panelId: targetInfo.panelId,\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n };\n });\n };\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\n // Check whether area is bound in coord, and series do not belong to that coord.\n // If do not do this check, some brush (like lineX) will controll all axes.\n var targetInfo = this.findTargetInfo(area, ecModel);\n return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n };\n /**\n * If return Object, a coord found.\n * If return true, global found.\n * Otherwise nothing found.\n */\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\n var targetInfoList = this._targetInfoList;\n var foundCpts = parseFinder(ecModel, area);\n for (var i = 0; i < targetInfoList.length; i++) {\n var targetInfo = targetInfoList[i];\n var areaPanelId = area.panelId;\n if (areaPanelId) {\n if (targetInfo.panelId === areaPanelId) {\n return targetInfo;\n }\n } else {\n for (var j = 0; j < targetInfoMatchers.length; j++) {\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\n return targetInfo;\n }\n }\n }\n }\n return true;\n };\n return BrushTargetManager;\n}();\nfunction formatMinMax(minMax) {\n minMax[0] > minMax[1] && minMax.reverse();\n return minMax;\n}\nfunction parseFinder(ecModel, finder) {\n return modelUtilParseFinder(ecModel, finder, {\n includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n });\n}\nvar targetInfoBuilders = {\n grid: function (foundCpts, targetInfoList) {\n var xAxisModels = foundCpts.xAxisModels;\n var yAxisModels = foundCpts.yAxisModels;\n var gridModels = foundCpts.gridModels;\n // Remove duplicated.\n var gridModelMap = createHashMap();\n var xAxesHas = {};\n var yAxesHas = {};\n if (!xAxisModels && !yAxisModels && !gridModels) {\n return;\n }\n each(xAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n });\n each(yAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n yAxesHas[gridModel.id] = true;\n });\n each(gridModels, function (gridModel) {\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n yAxesHas[gridModel.id] = true;\n });\n gridModelMap.each(function (gridModel) {\n var grid = gridModel.coordinateSystem;\n var cartesians = [];\n each(grid.getCartesians(), function (cartesian, index) {\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n cartesians.push(cartesian);\n }\n });\n targetInfoList.push({\n panelId: 'grid--' + gridModel.id,\n gridModel: gridModel,\n coordSysModel: gridModel,\n // Use the first one as the representitive coordSys.\n coordSys: cartesians[0],\n coordSyses: cartesians,\n getPanelRect: panelRectBuilders.grid,\n xAxisDeclared: xAxesHas[gridModel.id],\n yAxisDeclared: yAxesHas[gridModel.id]\n });\n });\n },\n geo: function (foundCpts, targetInfoList) {\n each(foundCpts.geoModels, function (geoModel) {\n var coordSys = geoModel.coordinateSystem;\n targetInfoList.push({\n panelId: 'geo--' + geoModel.id,\n geoModel: geoModel,\n coordSysModel: geoModel,\n coordSys: coordSys,\n coordSyses: [coordSys],\n getPanelRect: panelRectBuilders.geo\n });\n });\n }\n};\nvar targetInfoMatchers = [\n// grid\nfunction (foundCpts, targetInfo) {\n var xAxisModel = foundCpts.xAxisModel;\n var yAxisModel = foundCpts.yAxisModel;\n var gridModel = foundCpts.gridModel;\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n return gridModel && gridModel === targetInfo.gridModel;\n},\n// geo\nfunction (foundCpts, targetInfo) {\n var geoModel = foundCpts.geoModel;\n return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilders = {\n grid: function () {\n // grid is not Transformable.\n return this.coordSys.master.getRect().clone();\n },\n geo: function () {\n var coordSys = this.coordSys;\n var rect = coordSys.getBoundingRect().clone();\n // geo roam and zoom transform\n rect.applyTransform(graphic.getTransform(coordSys));\n return rect;\n }\n};\nvar coordConvert = {\n lineX: curry(axisConvert, 0),\n lineY: curry(axisConvert, 1),\n rect: function (to, coordSys, rangeOrCoordRange, clamp) {\n var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp);\n var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp);\n var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n return {\n values: values,\n xyMinMax: values\n };\n },\n polygon: function (to, coordSys, rangeOrCoordRange, clamp) {\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n var values = map(rangeOrCoordRange, function (item) {\n var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp);\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n return p;\n });\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n }\n};\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n if (process.env.NODE_ENV !== 'production') {\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\n }\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n var values = formatMinMax(map([0, 1], function (i) {\n return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n }));\n var xyMinMax = [];\n xyMinMax[axisNameIndex] = values;\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n}\nvar diffProcessor = {\n lineX: curry(axisDiffProcessor, 0),\n lineY: curry(axisDiffProcessor, 1),\n rect: function (values, refer, scales) {\n return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];\n },\n polygon: function (values, refer, scales) {\n return map(values, function (item, idx) {\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n });\n }\n};\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n}\n// We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n// Return [0~1, 0~1]\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}\nfunction getSize(xyMinMax) {\n return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\nexport default BrushTargetManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// TODO depends on DataZoom and Brush\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../../helper/BrushController.js';\nimport BrushTargetManager from '../../helper/BrushTargetManager.js';\nimport * as history from '../../dataZoom/history.js';\nimport sliderMove from '../../helper/sliderMove.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { makeInternalComponentId, parseFinder } from '../../../util/model.js';\nimport { registerInternalOptionCreator } from '../../../model/internalComponentCreator.js';\nvar each = zrUtil.each;\nvar DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\nvar ICON_TYPES = ['zoom', 'back'];\nvar DataZoomFeature = /** @class */function (_super) {\n __extends(DataZoomFeature, _super);\n function DataZoomFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\n if (!this._brushController) {\n this._brushController = new BrushController(api.getZr());\n this._brushController.on('brush', zrUtil.bind(this._onBrush, this)).mount();\n }\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\n updateBackBtnStatus(featureModel, ecModel);\n };\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\n handlers[type].call(this);\n };\n DataZoomFeature.prototype.remove = function (ecModel, api) {\n this._brushController && this._brushController.unmount();\n };\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\n this._brushController && this._brushController.dispose();\n };\n DataZoomFeature.prototype._onBrush = function (eventParam) {\n var areas = eventParam.areas;\n if (!eventParam.isEnd || !areas.length) {\n return;\n }\n var snapshot = {};\n var ecModel = this.ecModel;\n this._brushController.updateCovers([]); // remove cover\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, {\n include: ['grid']\n });\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n if (coordSys.type !== 'cartesian2d') {\n return;\n }\n var brushType = area.brushType;\n if (brushType === 'rect') {\n setBatch('x', coordSys, coordRange[0]);\n setBatch('y', coordSys, coordRange[1]);\n } else {\n setBatch({\n lineX: 'x',\n lineY: 'y'\n }[brushType], coordSys, coordRange);\n }\n });\n history.push(ecModel, snapshot);\n this._dispatchZoomAction(snapshot);\n function setBatch(dimName, coordSys, minMax) {\n var axis = coordSys.getAxis(dimName);\n var axisModel = axis.model;\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\n // Restrict range.\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\n }\n dataZoomModel && (snapshot[dataZoomModel.id] = {\n dataZoomId: dataZoomModel.id,\n startValue: minMax[0],\n endValue: minMax[1]\n });\n }\n function findDataZoom(dimName, axisModel, ecModel) {\n var found;\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'select'\n }, function (dzModel) {\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\n has && (found = dzModel);\n });\n return found;\n }\n };\n ;\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\n var batch = [];\n // Convert from hash map to array.\n each(snapshot, function (batchItem, dataZoomId) {\n batch.push(zrUtil.clone(batchItem));\n });\n batch.length && this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n batch: batch\n });\n };\n DataZoomFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n filterMode: 'filter',\n // Icon group\n icon: {\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\n },\n // `zoom`, `back`\n title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']),\n brushStyle: {\n borderWidth: 0,\n color: 'rgba(210,219,238,0.2)'\n }\n };\n return defaultOption;\n };\n return DataZoomFeature;\n}(ToolboxFeature);\nvar handlers = {\n zoom: function () {\n var nextActive = !this._isZoomActive;\n this.api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: nextActive\n });\n },\n back: function () {\n this._dispatchZoomAction(history.pop(this.ecModel));\n }\n};\nfunction makeAxisFinder(dzFeatureModel) {\n var setting = {\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\n xAxisId: dzFeatureModel.get('xAxisId', true),\n yAxisId: dzFeatureModel.get('yAxisId', true)\n };\n // If both `xAxisIndex` `xAxisId` not set, it means 'all'.\n // If both `yAxisIndex` `yAxisId` not set, it means 'all'.\n // Some old cases set like this below to close yAxis control but leave xAxis control:\n // `{ feature: { dataZoom: { yAxisIndex: false } }`.\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\n setting.xAxisIndex = 'all';\n }\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\n setting.yAxisIndex = 'all';\n }\n return setting;\n}\nfunction updateBackBtnStatus(featureModel, ecModel) {\n featureModel.setIconStatus('back', history.count(ecModel) > 1 ? 'emphasis' : 'normal');\n}\nfunction updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\n var zoomActive = view._isZoomActive;\n if (payload && payload.type === 'takeGlobalCursor') {\n zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false;\n }\n view._isZoomActive = zoomActive;\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, {\n include: ['grid']\n });\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\n return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect';\n });\n view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {\n brushType: 'auto',\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\n } : false);\n}\nregisterInternalOptionCreator('dataZoom', function (ecModel) {\n var toolboxModel = ecModel.getComponent('toolbox', 0);\n var featureDataZoomPath = ['feature', 'dataZoom'];\n if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {\n return;\n }\n var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath);\n var dzOptions = [];\n var finder = makeAxisFinder(dzFeatureModel);\n var finderResult = parseFinder(ecModel, finder);\n each(finderResult.xAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex');\n });\n each(finderResult.yAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex');\n });\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\n var axisIndex = axisModel.componentIndex;\n var newOpt = {\n type: 'select',\n $fromToolbox: true,\n // Default to be filter\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\n // Id for merge mapping.\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\n };\n newOpt[axisIndexPropName] = axisIndex;\n dzOptions.push(newOpt);\n }\n return dzOptions;\n});\nexport default DataZoomFeature;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomSelect } from '../../component/dataZoom/installDataZoomSelect.js';\nimport ToolboxModel from './ToolboxModel.js';\nimport ToolboxView from './ToolboxView.js';\n// TODOD: REGISTER IN INSTALL\nimport { registerFeature } from './featureManager.js';\nimport SaveAsImage from './feature/SaveAsImage.js';\nimport MagicType from './feature/MagicType.js';\nimport DataView from './feature/DataView.js';\nimport Restore from './feature/Restore.js';\nimport DataZoom from './feature/DataZoom.js';\nexport function install(registers) {\n registers.registerComponentModel(ToolboxModel);\n registers.registerComponentView(ToolboxView);\n registerFeature('saveAsImage', SaveAsImage);\n registerFeature('magicType', MagicType);\n registerFeature('dataView', DataView);\n registerFeature('dataZoom', DataZoom);\n registerFeature('restore', Restore);\n use(installDataZoomSelect);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nvar TooltipModel = /** @class */function (_super) {\n __extends(TooltipModel, _super);\n function TooltipModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TooltipModel.type;\n return _this;\n }\n TooltipModel.type = 'tooltip';\n TooltipModel.dependencies = ['axisPointer'];\n TooltipModel.defaultOption = {\n // zlevel: 0,\n z: 60,\n show: true,\n // tooltip main content\n showContent: true,\n // 'trigger' only works on coordinate system.\n // 'item' | 'axis' | 'none'\n trigger: 'item',\n // 'click' | 'mousemove' | 'none'\n triggerOn: 'mousemove|click',\n alwaysShowContent: false,\n displayMode: 'single',\n renderMode: 'auto',\n // whether restraint content inside viewRect.\n // If renderMode: 'richText', default true.\n // If renderMode: 'html', defaut false (for backward compat).\n confine: null,\n showDelay: 0,\n hideDelay: 100,\n // Animation transition time, unit is second\n transitionDuration: 0.4,\n enterable: false,\n backgroundColor: '#fff',\n // box shadow\n shadowBlur: 10,\n shadowColor: 'rgba(0, 0, 0, .2)',\n shadowOffsetX: 1,\n shadowOffsetY: 2,\n // tooltip border radius, unit is px, default is 4\n borderRadius: 4,\n // tooltip border width, unit is px, default is 0 (no border)\n borderWidth: 1,\n // Tooltip inside padding, default is 5 for all direction\n // Array is allowed to set up, right, bottom, left, same with css\n // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.\n padding: null,\n // Extra css text\n extraCssText: '',\n // axis indicator, trigger by axis\n axisPointer: {\n // default is line\n // legal values: 'line' | 'shadow' | 'cross'\n type: 'line',\n // Valid when type is line, appoint tooltip line locate on which line. Optional\n // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'\n // default is 'auto', chose the axis which type is category.\n // for multiply y axis, cartesian coord chose x axis, polar chose angle axis\n axis: 'auto',\n animation: 'auto',\n animationDurationUpdate: 200,\n animationEasingUpdate: 'exponentialOut',\n crossStyle: {\n color: '#999',\n width: 1,\n type: 'dashed',\n // TODO formatter\n textStyle: {}\n }\n // lineStyle and shadowStyle should not be specified here,\n // otherwise it will always override those styles on option.axisPointer.\n },\n\n textStyle: {\n color: '#666',\n fontSize: 14\n }\n };\n return TooltipModel;\n}(ComponentModel);\nexport default TooltipModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { toCamelCase } from '../../util/format.js';\nimport env from 'zrender/lib/core/env.js';\n/* global document */\nexport function shouldTooltipConfine(tooltipModel) {\n var confineOption = tooltipModel.get('confine');\n return confineOption != null ? !!confineOption\n // In richText mode, the outside part can not be visible.\n : tooltipModel.get('renderMode') === 'richText';\n}\nfunction testStyle(styleProps) {\n if (!env.domSupported) {\n return;\n }\n var style = document.documentElement.style;\n for (var i = 0, len = styleProps.length; i < len; i++) {\n if (styleProps[i] in style) {\n return styleProps[i];\n }\n }\n}\nexport var TRANSFORM_VENDOR = testStyle(['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\nexport var TRANSITION_VENDOR = testStyle(['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\nexport function toCSSVendorPrefix(styleVendor, styleProp) {\n if (!styleVendor) {\n return styleProp;\n }\n styleProp = toCamelCase(styleProp, true);\n var idx = styleVendor.indexOf(styleProp);\n styleVendor = idx === -1 ? styleProp : \"-\" + styleVendor.slice(0, idx) + \"-\" + styleProp;\n return styleVendor.toLowerCase();\n}\nexport function getComputedStyle(el, style) {\n var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);\n return stl ? style ? stl[style] : stl : null;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isString, indexOf, each, bind, isFunction, isArray, isDom } from 'zrender/lib/core/util.js';\nimport { normalizeEvent } from 'zrender/lib/core/event.js';\nimport { transformLocalCoord } from 'zrender/lib/core/dom.js';\nimport env from 'zrender/lib/core/env.js';\nimport { convertToColorString, toCamelCase, normalizeCssArray } from '../../util/format.js';\nimport { shouldTooltipConfine, toCSSVendorPrefix, getComputedStyle, TRANSFORM_VENDOR, TRANSITION_VENDOR } from './helper.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\n/* global document, window */\nvar CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition');\nvar CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform');\n// eslint-disable-next-line\nvar gCssText = \"position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;\" + (env.transform3dSupported ? 'will-change:transform;' : '');\nfunction mirrorPos(pos) {\n pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top';\n return pos;\n}\nfunction assembleArrow(tooltipModel, borderColor, arrowPosition) {\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\n return '';\n }\n var backgroundColor = tooltipModel.get('backgroundColor');\n var borderWidth = tooltipModel.get('borderWidth');\n borderColor = convertToColorString(borderColor);\n var arrowPos = mirrorPos(arrowPosition);\n var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);\n var positionStyle = '';\n var transformStyle = CSS_TRANSFORM_VENDOR + ':';\n var rotateDeg;\n if (indexOf(['left', 'right'], arrowPos) > -1) {\n positionStyle += 'top:50%';\n transformStyle += \"translateY(-50%) rotate(\" + (rotateDeg = arrowPos === 'left' ? -225 : -45) + \"deg)\";\n } else {\n positionStyle += 'left:50%';\n transformStyle += \"translateX(-50%) rotate(\" + (rotateDeg = arrowPos === 'top' ? 225 : 45) + \"deg)\";\n }\n var rotateRadian = rotateDeg * Math.PI / 180;\n var arrowWH = arrowSize + borderWidth;\n var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));\n var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;\n positionStyle += \";\" + arrowPos + \":-\" + arrowOffset + \"px\";\n var borderStyle = borderColor + \" solid \" + borderWidth + \"px;\";\n var styleCss = [\"position:absolute;width:\" + arrowSize + \"px;height:\" + arrowSize + \"px;z-index:-1;\", positionStyle + \";\" + transformStyle + \";\", \"border-bottom:\" + borderStyle, \"border-right:\" + borderStyle, \"background-color:\" + backgroundColor + \";\"];\n return \"
\";\n}\nfunction assembleTransition(duration, onlyFade) {\n var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)';\n var transitionOption = \" \" + duration / 2 + \"s \" + transitionCurve;\n var transitionText = \"opacity\" + transitionOption + \",visibility\" + transitionOption;\n if (!onlyFade) {\n transitionOption = \" \" + duration + \"s \" + transitionCurve;\n transitionText += env.transformSupported ? \",\" + CSS_TRANSFORM_VENDOR + transitionOption : \",left\" + transitionOption + \",top\" + transitionOption;\n }\n return CSS_TRANSITION_VENDOR + ':' + transitionText;\n}\nfunction assembleTransform(x, y, toString) {\n // If using float on style, the final width of the dom might\n // keep changing slightly while mouse move. So `toFixed(0)` them.\n var x0 = x.toFixed(0) + 'px';\n var y0 = y.toFixed(0) + 'px';\n // not support transform, use `left` and `top` instead.\n if (!env.transformSupported) {\n return toString ? \"top:\" + y0 + \";left:\" + x0 + \";\" : [['top', y0], ['left', x0]];\n }\n // support transform\n var is3d = env.transform3dSupported;\n var translate = \"translate\" + (is3d ? '3d' : '') + \"(\" + x0 + \",\" + y0 + (is3d ? ',0' : '') + \")\";\n return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]];\n}\n/**\n * @param {Object} textStyle\n * @return {string}\n * @inner\n */\nfunction assembleFont(textStyleModel) {\n var cssText = [];\n var fontSize = textStyleModel.get('fontSize');\n var color = textStyleModel.getTextColor();\n color && cssText.push('color:' + color);\n cssText.push('font:' + textStyleModel.getFont());\n fontSize\n // @ts-ignore, leave it to the tooltip refactor.\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\n var shadowColor = textStyleModel.get('textShadowColor');\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\n shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor);\n each(['decoration', 'align'], function (name) {\n var val = textStyleModel.get(name);\n val && cssText.push('text-' + name + ':' + val);\n });\n return cssText.join(';');\n}\nfunction assembleCssText(tooltipModel, enableTransition, onlyFade) {\n var cssText = [];\n var transitionDuration = tooltipModel.get('transitionDuration');\n var backgroundColor = tooltipModel.get('backgroundColor');\n var shadowBlur = tooltipModel.get('shadowBlur');\n var shadowColor = tooltipModel.get('shadowColor');\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\n var textStyleModel = tooltipModel.getModel('textStyle');\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\n cssText.push('box-shadow:' + boxShadow);\n // Animation transition. Do not animate when transitionDuration is 0.\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\n if (backgroundColor) {\n cssText.push('background-color:' + backgroundColor);\n }\n // Border style\n each(['width', 'color', 'radius'], function (name) {\n var borderName = 'border-' + name;\n var camelCase = toCamelCase(borderName);\n var val = tooltipModel.get(camelCase);\n val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\n });\n // Text style\n cssText.push(assembleFont(textStyleModel));\n // Padding\n if (padding != null) {\n cssText.push('padding:' + normalizeCssArray(padding).join('px ') + 'px');\n }\n return cssText.join(';') + ';';\n}\n// If not able to make, do not modify the input `out`.\nfunction makeStyleCoord(out, zr, container, zrX, zrY) {\n var zrPainter = zr && zr.painter;\n if (container) {\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\n if (zrViewportRoot) {\n // Some APPs might use scale on body, so we support CSS transform here.\n transformLocalCoord(out, zrViewportRoot, container, zrX, zrY);\n }\n } else {\n out[0] = zrX;\n out[1] = zrY;\n // xy should be based on canvas root. But tooltipContent is\n // the sibling of canvas root. So padding of ec container\n // should be considered here.\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\n if (viewportRootOffset) {\n out[0] += viewportRootOffset.offsetLeft;\n out[1] += viewportRootOffset.offsetTop;\n }\n }\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\nvar TooltipHTMLContent = /** @class */function () {\n function TooltipHTMLContent(api, opt) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._enterable = true;\n this._alwaysShowContent = false;\n this._firstShow = true;\n this._longHide = true;\n if (env.wxa) {\n return null;\n }\n var el = document.createElement('div');\n // TODO: TYPE\n el.domBelongToZr = true;\n this.el = el;\n var zr = this._zr = api.getZr();\n var appendTo = opt.appendTo;\n var container = appendTo && (isString(appendTo) ? document.querySelector(appendTo) : isDom(appendTo) ? appendTo : isFunction(appendTo) && appendTo(api.getDom()));\n makeStyleCoord(this._styleCoord, zr, container, api.getWidth() / 2, api.getHeight() / 2);\n (container || api.getDom()).appendChild(el);\n this._api = api;\n this._container = container;\n // FIXME\n // Is it needed to trigger zr event manually if\n // the browser do not support `pointer-events: none`.\n var self = this;\n el.onmouseenter = function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n self._inContent = true;\n };\n el.onmousemove = function (e) {\n e = e || window.event;\n if (!self._enterable) {\n // `pointer-events: none` is set to tooltip content div\n // if `enterable` is set as `false`, and `el.onmousemove`\n // can not be triggered. But in browser that do not\n // support `pointer-events`, we need to do this:\n // Try trigger zrender event to avoid mouse\n // in and out shape too frequently\n var handler = zr.handler;\n var zrViewportRoot = zr.painter.getViewportRoot();\n normalizeEvent(zrViewportRoot, e, true);\n handler.dispatch('mousemove', e);\n }\n };\n el.onmouseleave = function () {\n // set `_inContent` to `false` before `hideLater`\n self._inContent = false;\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n };\n }\n /**\n * Update when tooltip is rendered\n */\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\n // FIXME\n // Move this logic to ec main?\n if (!this._container) {\n var container = this._api.getDom();\n var position = getComputedStyle(container, 'position');\n var domStyle = container.style;\n if (domStyle.position !== 'absolute' && position !== 'absolute') {\n domStyle.position = 'relative';\n }\n }\n // move tooltip if chart resized\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized();\n // update alwaysShowContent\n this._alwaysShowContent = alwaysShowContent;\n // update className\n this.el.className = tooltipModel.get('className') || '';\n // Hide the tooltip\n // PENDING\n // this.hide();\n };\n\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\n clearTimeout(this._hideTimeout);\n clearTimeout(this._longHideTimeout);\n var el = this.el;\n var style = el.style;\n var styleCoord = this._styleCoord;\n if (!el.innerHTML) {\n style.display = 'none';\n } else {\n style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\n // initial transform\n + assembleTransform(styleCoord[0], styleCoord[1], true) + (\"border-color:\" + convertToColorString(nearPointColor) + \";\") + (tooltipModel.get('extraCssText') || '')\n // If mouse occasionally move over the tooltip, a mouseout event will be\n // triggered by canvas, and cause some unexpectable result like dragging\n // stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\n // it. Although it is not supported by IE8~IE10, fortunately it is a rare\n // scenario.\n + (\";pointer-events:\" + (this._enterable ? 'auto' : 'none'));\n }\n this._show = true;\n this._firstShow = false;\n this._longHide = false;\n };\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\n var el = this.el;\n if (content == null) {\n el.innerHTML = '';\n return;\n }\n var arrow = '';\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) {\n arrow = assembleArrow(tooltipModel, borderColor, arrowPosition);\n }\n if (isString(content)) {\n el.innerHTML = content + arrow;\n } else if (content) {\n // Clear previous\n el.innerHTML = '';\n if (!isArray(content)) {\n content = [content];\n }\n for (var i = 0; i < content.length; i++) {\n if (isDom(content[i]) && content[i].parentNode !== el) {\n el.appendChild(content[i]);\n }\n }\n // no arrow if empty\n if (arrow && el.childNodes.length) {\n // no need to create a new parent element, but it's not supported by IE 10 and older.\n // const arrowEl = document.createRange().createContextualFragment(arrow);\n var arrowEl = document.createElement('div');\n arrowEl.innerHTML = arrow;\n el.appendChild(arrowEl);\n }\n }\n };\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n TooltipHTMLContent.prototype.getSize = function () {\n var el = this.el;\n return [el.offsetWidth, el.offsetHeight];\n };\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY);\n if (styleCoord[0] != null && styleCoord[1] != null) {\n var style_1 = this.el.style;\n var transforms = assembleTransform(styleCoord[0], styleCoord[1]);\n each(transforms, function (transform) {\n style_1[transform[0]] = transform[1];\n });\n }\n };\n /**\n * when `alwaysShowContent` is true,\n * move the tooltip after chart resized\n */\n TooltipHTMLContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2];\n // The ratio of top to height\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n TooltipHTMLContent.prototype.hide = function () {\n var _this = this;\n var style = this.el.style;\n style.visibility = 'hidden';\n style.opacity = '0';\n env.transform3dSupported && (style.willChange = '');\n this._show = false;\n this._longHideTimeout = setTimeout(function () {\n return _this._longHide = true;\n }, 500);\n };\n TooltipHTMLContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n if (time) {\n this._hideDelay = time;\n // Set show false to avoid invoke hideLater multiple times\n this._show = false;\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n TooltipHTMLContent.prototype.isShow = function () {\n return this._show;\n };\n TooltipHTMLContent.prototype.dispose = function () {\n clearTimeout(this._hideTimeout);\n clearTimeout(this._longHideTimeout);\n var parentNode = this.el.parentNode;\n parentNode && parentNode.removeChild(this.el);\n this.el = this._container = null;\n };\n return TooltipHTMLContent;\n}();\nexport default TooltipHTMLContent;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\nimport { throwError } from '../../util/log.js';\nvar TooltipRichContent = /** @class */function () {\n function TooltipRichContent(api) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._alwaysShowContent = false;\n this._enterable = true;\n this._zr = api.getZr();\n makeStyleCoord(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\n }\n /**\n * Update when tooltip is rendered\n */\n TooltipRichContent.prototype.update = function (tooltipModel) {\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized();\n // update alwaysShowContent\n this._alwaysShowContent = alwaysShowContent;\n };\n TooltipRichContent.prototype.show = function () {\n if (this._hideTimeout) {\n clearTimeout(this._hideTimeout);\n }\n this.el.show();\n this._show = true;\n };\n /**\n * Set tooltip content\n */\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\n var _this = this;\n if (zrUtil.isObject(content)) {\n throwError(process.env.NODE_ENV !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\n }\n if (this.el) {\n this._zr.remove(this.el);\n }\n var textStyleModel = tooltipModel.getModel('textStyle');\n this.el = new ZRText({\n style: {\n rich: markupStyleCreator.richTextStyles,\n text: content,\n lineHeight: 22,\n borderWidth: 1,\n borderColor: borderColor,\n textShadowColor: textStyleModel.get('textShadowColor'),\n fill: tooltipModel.get(['textStyle', 'color']),\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\n verticalAlign: 'top',\n align: 'left'\n },\n z: tooltipModel.get('z')\n });\n zrUtil.each(['backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'], function (propName) {\n _this.el.style[propName] = tooltipModel.get(propName);\n });\n zrUtil.each(['textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'], function (propName) {\n _this.el.style[propName] = textStyleModel.get(propName) || 0;\n });\n this._zr.add(this.el);\n var self = this;\n this.el.on('mouseover', function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n self._inContent = true;\n });\n this.el.on('mouseout', function () {\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n self._inContent = false;\n });\n };\n TooltipRichContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n TooltipRichContent.prototype.getSize = function () {\n var el = this.el;\n var bounding = this.el.getBoundingRect();\n // bounding rect does not include shadow. For renderMode richText,\n // if overflow, it will be cut. So calculate them accurately.\n var shadowOuterSize = calcShadowOuterSize(el.style);\n return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];\n };\n TooltipRichContent.prototype.moveTo = function (x, y) {\n var el = this.el;\n if (el) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, x, y);\n x = styleCoord[0];\n y = styleCoord[1];\n var style = el.style;\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\n var shadowOuterSize = calcShadowOuterSize(style);\n // rich text x, y do not include border.\n el.x = x + borderWidth + shadowOuterSize.left;\n el.y = y + borderWidth + shadowOuterSize.top;\n el.markRedraw();\n }\n };\n /**\n * when `alwaysShowContent` is true,\n * move the tooltip after chart resized\n */\n TooltipRichContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2];\n // The ratio of top to height\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n TooltipRichContent.prototype.hide = function () {\n if (this.el) {\n this.el.hide();\n }\n this._show = false;\n };\n TooltipRichContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n if (time) {\n this._hideDelay = time;\n // Set show false to avoid invoke hideLater multiple times\n this._show = false;\n this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n TooltipRichContent.prototype.isShow = function () {\n return this._show;\n };\n TooltipRichContent.prototype.dispose = function () {\n this._zr.remove(this.el);\n };\n return TooltipRichContent;\n}();\nfunction mathMaxWith0(val) {\n return Math.max(0, val);\n}\nfunction calcShadowOuterSize(style) {\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\n return {\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\n };\n}\nfunction makeStyleCoord(out, zr, zrX, zrY) {\n out[0] = zrX;\n out[1] = zrY;\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\nexport default TooltipRichContent;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { bind, each, clone, trim, isString, isFunction, isArray, isObject, extend } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport TooltipHTMLContent from './TooltipHTMLContent.js';\nimport TooltipRichContent from './TooltipRichContent.js';\nimport { convertToColorString, encodeHTML, formatTpl } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport { Rect } from '../../util/graphic.js';\nimport findPointFromSeries from '../axisPointer/findPointFromSeries.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport Model from '../../model/Model.js';\nimport * as globalListener from '../axisPointer/globalListener.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport * as axisPointerViewHelper from '../axisPointer/viewHelper.js';\nimport { getTooltipRenderMode, preParseFinder, queryReferringComponents } from '../../util/model.js';\nimport ComponentView from '../../view/Component.js';\nimport { format as timeFormat } from '../../util/time.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { shouldTooltipConfine } from './helper.js';\nimport { normalizeTooltipFormatResult } from '../../model/mixin/dataFormat.js';\nimport { createTooltipMarkup, buildTooltipMarkup, TooltipMarkupStyleCreator } from './tooltipMarkup.js';\nimport { findEventDispatcher } from '../../util/event.js';\nimport { clear, createOrUpdate } from '../../util/throttle.js';\nvar proxyRect = new Rect({\n shape: {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n }\n});\nvar TooltipView = /** @class */function (_super) {\n __extends(TooltipView, _super);\n function TooltipView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TooltipView.type;\n return _this;\n }\n TooltipView.prototype.init = function (ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n }\n var tooltipModel = ecModel.getComponent('tooltip');\n var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode'));\n this._tooltipContent = renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api, {\n appendTo: tooltipModel.get('appendToBody', true) ? 'body' : tooltipModel.get('appendTo', true)\n });\n };\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n }\n // Reset\n this.group.removeAll();\n this._tooltipModel = tooltipModel;\n this._ecModel = ecModel;\n this._api = api;\n var tooltipContent = this._tooltipContent;\n tooltipContent.update(tooltipModel);\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\n this._initGlobalListener();\n this._keepShow();\n // PENDING\n // `mousemove` event will be triggered very frequently when the mouse moves fast,\n // which causes that the `updatePosition` function was also called frequently.\n // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101\n // To avoid frequent triggering,\n // consider throttling it in 50ms when transition is enabled\n if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) {\n createOrUpdate(this, '_updatePosition', 50, 'fixRate');\n } else {\n clear(this, '_updatePosition');\n }\n };\n TooltipView.prototype._initGlobalListener = function () {\n var tooltipModel = this._tooltipModel;\n var triggerOn = tooltipModel.get('triggerOn');\n globalListener.register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none') {\n if (triggerOn.indexOf(currTrigger) >= 0) {\n this._tryShow(e, dispatchAction);\n } else if (currTrigger === 'leave') {\n this._hide(dispatchAction);\n }\n }\n }, this));\n };\n TooltipView.prototype._keepShow = function () {\n var tooltipModel = this._tooltipModel;\n var ecModel = this._ecModel;\n var api = this._api;\n var triggerOn = tooltipModel.get('triggerOn');\n // Try to keep the tooltip show when refreshing\n if (this._lastX != null && this._lastY != null\n // When user is willing to control tooltip totally using API,\n // self.manuallyShowTip({x, y}) might cause tooltip hide,\n // which is not expected.\n && triggerOn !== 'none' && triggerOn !== 'click') {\n var self_1 = this;\n clearTimeout(this._refreshUpdateTimeout);\n this._refreshUpdateTimeout = setTimeout(function () {\n // Show tip next tick after other charts are rendered\n // In case highlight action has wrong result\n // FIXME\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\n x: self_1._lastX,\n y: self_1._lastY,\n dataByCoordSys: self_1._lastDataByCoordSys\n });\n });\n }\n };\n /**\n * Show tip manually by\n * dispatchAction({\n * type: 'showTip',\n * x: 10,\n * y: 10\n * });\n * Or\n * dispatchAction({\n * type: 'showTip',\n * seriesIndex: 0,\n * dataIndex or dataIndexInside or name\n * });\n *\n * TODO Batch\n */\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\n if (payload.from === this.uid || env.node || !api.getDom()) {\n return;\n }\n var dispatchAction = makeDispatchAction(payload, api);\n // Reset ticket\n this._ticket = '';\n // When triggered from axisPointer.\n var dataByCoordSys = payload.dataByCoordSys;\n var cmptRef = findComponentReference(payload, ecModel, api);\n if (cmptRef) {\n var rect = cmptRef.el.getBoundingRect().clone();\n rect.applyTransform(cmptRef.el.transform);\n this._tryShow({\n offsetX: rect.x + rect.width / 2,\n offsetY: rect.y + rect.height / 2,\n target: cmptRef.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n } else if (payload.tooltip && payload.x != null && payload.y != null) {\n var el = proxyRect;\n el.x = payload.x;\n el.y = payload.y;\n el.update();\n getECData(el).tooltipConfig = {\n name: null,\n option: payload.tooltip\n };\n // Manually show tooltip while view is not using zrender elements.\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n target: el\n }, dispatchAction);\n } else if (dataByCoordSys) {\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n dataByCoordSys: dataByCoordSys,\n tooltipOption: payload.tooltipOption\n }, dispatchAction);\n } else if (payload.seriesIndex != null) {\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\n return;\n }\n var pointInfo = findPointFromSeries(payload, ecModel);\n var cx = pointInfo.point[0];\n var cy = pointInfo.point[1];\n if (cx != null && cy != null) {\n this._tryShow({\n offsetX: cx,\n offsetY: cy,\n target: pointInfo.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n }\n } else if (payload.x != null && payload.y != null) {\n // FIXME\n // should wrap dispatchAction like `axisPointer/globalListener` ?\n api.dispatchAction({\n type: 'updateAxisPointer',\n x: payload.x,\n y: payload.y\n });\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n target: api.getZr().findHover(payload.x, payload.y).target\n }, dispatchAction);\n }\n };\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\n var tooltipContent = this._tooltipContent;\n if (this._tooltipModel) {\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\n }\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\n if (payload.from !== this.uid) {\n this._hide(makeDispatchAction(payload, api));\n }\n };\n // Be compatible with previous design, that is, when tooltip.type is 'axis' and\n // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\n // and tooltip.\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\n var seriesIndex = payload.seriesIndex;\n var dataIndex = payload.dataIndex;\n // @ts-ignore\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\n return;\n }\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n if (!seriesModel) {\n return;\n }\n var data = seriesModel.getData();\n var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\n return;\n }\n api.dispatchAction({\n type: 'updateAxisPointer',\n seriesIndex: seriesIndex,\n dataIndex: dataIndex,\n position: payload.position\n });\n return true;\n };\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\n var el = e.target;\n var tooltipModel = this._tooltipModel;\n if (!tooltipModel) {\n return;\n }\n // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\n this._lastX = e.offsetX;\n this._lastY = e.offsetY;\n var dataByCoordSys = e.dataByCoordSys;\n if (dataByCoordSys && dataByCoordSys.length) {\n this._showAxisTooltip(dataByCoordSys, e);\n } else if (el) {\n var ecData = getECData(el);\n if (ecData.ssrType === 'legend') {\n // Don't trigger tooltip for legend tooltip item\n return;\n }\n this._lastDataByCoordSys = null;\n var seriesDispatcher_1;\n var cmptDispatcher_1;\n findEventDispatcher(el, function (target) {\n // Always show item tooltip if mouse is on the element with dataIndex\n if (getECData(target).dataIndex != null) {\n seriesDispatcher_1 = target;\n return true;\n }\n // Tooltip provided directly. Like legend.\n if (getECData(target).tooltipConfig != null) {\n cmptDispatcher_1 = target;\n return true;\n }\n }, true);\n if (seriesDispatcher_1) {\n this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction);\n } else if (cmptDispatcher_1) {\n this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction);\n } else {\n this._hide(dispatchAction);\n }\n } else {\n this._lastDataByCoordSys = null;\n this._hide(dispatchAction);\n }\n };\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\n // showDelay is used in this case: tooltip.enterable is set\n // as true. User intent to move mouse into tooltip and click\n // something. `showDelay` makes it easier to enter the content\n // but tooltip do not move immediately.\n var delay = tooltipModel.get('showDelay');\n cb = bind(cb, this);\n clearTimeout(this._showTimout);\n delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();\n };\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\n var ecModel = this._ecModel;\n var globalTooltipModel = this._tooltipModel;\n var point = [e.offsetX, e.offsetY];\n var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel);\n var renderMode = this._renderMode;\n var cbParamsList = [];\n var articleMarkup = createTooltipMarkup('section', {\n blocks: [],\n noHeader: true\n });\n // Only for legacy: `Serise['formatTooltip']` returns a string.\n var markupTextArrLegacy = [];\n var markupStyleCreator = new TooltipMarkupStyleCreator();\n each(dataByCoordSys, function (itemCoordSys) {\n each(itemCoordSys.dataByAxis, function (axisItem) {\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\n var axisValue = axisItem.value;\n if (!axisModel || axisValue == null) {\n return;\n }\n var axisValueLabel = axisPointerViewHelper.getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\n var axisSectionMarkup = createTooltipMarkup('section', {\n header: axisValueLabel,\n noHeader: !trim(axisValueLabel),\n sortBlocks: true,\n blocks: []\n });\n articleMarkup.blocks.push(axisSectionMarkup);\n each(axisItem.seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var cbParams = series.getDataParams(dataIndex);\n // Can't find data.\n if (cbParams.dataIndex < 0) {\n return;\n }\n cbParams.axisDim = axisItem.axisDim;\n cbParams.axisIndex = axisItem.axisIndex;\n cbParams.axisType = axisItem.axisType;\n cbParams.axisId = axisItem.axisId;\n cbParams.axisValue = axisHelper.getAxisRawValue(axisModel.axis, {\n value: axisValue\n });\n cbParams.axisValueLabel = axisValueLabel;\n // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\n var frag = seriesTooltipResult.frag;\n if (frag) {\n var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter');\n axisSectionMarkup.blocks.push(valueFormatter ? extend({\n valueFormatter: valueFormatter\n }, frag) : frag);\n }\n if (seriesTooltipResult.text) {\n markupTextArrLegacy.push(seriesTooltipResult.text);\n }\n cbParamsList.push(cbParams);\n });\n });\n });\n // In most cases, the second axis is displays upper on the first one.\n // So we reverse it to look better.\n articleMarkup.blocks.reverse();\n markupTextArrLegacy.reverse();\n var positionExpr = e.position;\n var orderMode = singleTooltipModel.get('order');\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle'));\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\n this._showOrMove(singleTooltipModel, function () {\n if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\n } else {\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\n }\n });\n // Do not trigger events here, because this branch only be entered\n // from dispatchAction.\n };\n\n TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) {\n var ecModel = this._ecModel;\n var ecData = getECData(dispatcher);\n // Use dataModel in element if possible\n // Used when mouseover on a element like markPoint or edge\n // In which case, the data is not main data in series.\n var seriesIndex = ecData.seriesIndex;\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n // For example, graph link.\n var dataModel = ecData.dataModel || seriesModel;\n var dataIndex = ecData.dataIndex;\n var dataType = ecData.dataType;\n var data = dataModel.getData(dataType);\n var renderMode = this._renderMode;\n var positionDefault = e.positionDefault;\n var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var tooltipTrigger = tooltipModel.get('trigger');\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\n return;\n }\n var params = dataModel.getDataParams(dataIndex, dataType);\n var markupStyleCreator = new TooltipMarkupStyleCreator();\n // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\n var orderMode = tooltipModel.get('order');\n var valueFormatter = tooltipModel.get('valueFormatter');\n var frag = seriesTooltipResult.frag;\n var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({\n valueFormatter: valueFormatter\n }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text;\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\n this._showOrMove(tooltipModel, function () {\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\n });\n // FIXME\n // duplicated showtip if manuallyShowTip is called from dispatchAction.\n dispatchAction({\n type: 'showTip',\n dataIndexInside: dataIndex,\n dataIndex: data.getRawIndex(dataIndex),\n seriesIndex: seriesIndex,\n from: this.uid\n });\n };\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\n var isHTMLRenderMode = this._renderMode === 'html';\n var ecData = getECData(el);\n var tooltipConfig = ecData.tooltipConfig;\n var tooltipOpt = tooltipConfig.option || {};\n var encodeHTMLContent = tooltipOpt.encodeHTMLContent;\n if (isString(tooltipOpt)) {\n var content = tooltipOpt;\n tooltipOpt = {\n content: content,\n // Fixed formatter\n formatter: content\n };\n // when `tooltipConfig.option` is a string rather than an object,\n // we can't know if the content needs to be encoded\n // for the sake of security, encode it by default.\n encodeHTMLContent = true;\n }\n if (encodeHTMLContent && isHTMLRenderMode && tooltipOpt.content) {\n // clone might be unnecessary?\n tooltipOpt = clone(tooltipOpt);\n tooltipOpt.content = encodeHTML(tooltipOpt.content);\n }\n var tooltipModelCascade = [tooltipOpt];\n var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);\n if (cmpt) {\n tooltipModelCascade.push(cmpt);\n }\n // In most cases, component tooltip formatter has different params with series tooltip formatter,\n // so that they cannot share the same formatter. Since the global tooltip formatter is used for series\n // by convention, we do not use it as the default formatter for component.\n tooltipModelCascade.push({\n formatter: tooltipOpt.content\n });\n var positionDefault = e.positionDefault;\n var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var defaultHtml = subTooltipModel.get('content');\n var asyncTicket = Math.random() + '';\n // PENDING: this case do not support richText style yet.\n var markupStyleCreator = new TooltipMarkupStyleCreator();\n // Do not check whether `trigger` is 'none' here, because `trigger`\n // only works on coordinate system. In fact, we have not found case\n // that requires setting `trigger` nothing on component yet.\n this._showOrMove(subTooltipModel, function () {\n // Use formatterParams from element defined in component\n // Avoid users modify it.\n var formatterParams = clone(subTooltipModel.get('formatterParams') || {});\n this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\n });\n // If not dispatch showTip, tip may be hide triggered by axis.\n dispatchAction({\n type: 'showTip',\n from: this.uid\n });\n };\n TooltipView.prototype._showTooltipContent = function (\n // Use Model insteadof TooltipModel because this model may be from series or other options.\n // Instead of top level tooltip.\n tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\n // Reset ticket\n this._ticket = '';\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\n return;\n }\n var tooltipContent = this._tooltipContent;\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\n var formatter = tooltipModel.get('formatter');\n positionExpr = positionExpr || tooltipModel.get('position');\n var html = defaultHtml;\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor'));\n var nearPointColor = nearPoint.color;\n if (formatter) {\n if (isString(formatter)) {\n var useUTC = tooltipModel.ecModel.get('useUTC');\n var params0 = isArray(params) ? params[0] : params;\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\n html = formatter;\n if (isTimeAxis) {\n html = timeFormat(params0.axisValue, html, useUTC);\n }\n html = formatTpl(html, params, true);\n } else if (isFunction(formatter)) {\n var callback = bind(function (cbTicket, html) {\n if (cbTicket === this._ticket) {\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n }\n }, this);\n this._ticket = asyncTicket;\n html = formatter(params, asyncTicket, callback);\n } else {\n html = formatter;\n }\n }\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n tooltipContent.show(tooltipModel, nearPointColor);\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n };\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor) {\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\n return {\n color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none')\n };\n }\n if (!isArray(tooltipDataParams)) {\n return {\n color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor\n };\n }\n };\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x,\n // Mouse x\n y,\n // Mouse y\n content, params, el) {\n var viewWidth = this._api.getWidth();\n var viewHeight = this._api.getHeight();\n positionExpr = positionExpr || tooltipModel.get('position');\n var contentSize = content.getSize();\n var align = tooltipModel.get('align');\n var vAlign = tooltipModel.get('verticalAlign');\n var rect = el && el.getBoundingRect().clone();\n el && rect.applyTransform(el.transform);\n if (isFunction(positionExpr)) {\n // Callback of position can be an array or a string specify the position\n positionExpr = positionExpr([x, y], params, content.el, rect, {\n viewSize: [viewWidth, viewHeight],\n contentSize: contentSize.slice()\n });\n }\n if (isArray(positionExpr)) {\n x = parsePercent(positionExpr[0], viewWidth);\n y = parsePercent(positionExpr[1], viewHeight);\n } else if (isObject(positionExpr)) {\n var boxLayoutPosition = positionExpr;\n boxLayoutPosition.width = contentSize[0];\n boxLayoutPosition.height = contentSize[1];\n var layoutRect = getLayoutRect(boxLayoutPosition, {\n width: viewWidth,\n height: viewHeight\n });\n x = layoutRect.x;\n y = layoutRect.y;\n align = null;\n // When positionExpr is left/top/right/bottom,\n // align and verticalAlign will not work.\n vAlign = null;\n }\n // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\n else if (isString(positionExpr) && el) {\n var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get('borderWidth'));\n x = pos[0];\n y = pos[1];\n } else {\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\n x = pos[0];\n y = pos[1];\n }\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\n if (shouldTooltipConfine(tooltipModel)) {\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\n x = pos[0];\n y = pos[1];\n }\n content.moveTo(x, y);\n };\n // FIXME\n // Should we remove this but leave this to user?\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys, cbParamsList) {\n var lastCoordSys = this._lastDataByCoordSys;\n var lastCbParamsList = this._cbParamsList;\n var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;\n contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\n contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) {\n var thisItem = thisDataByAxis[indexAxis] || {};\n var lastIndices = lastItem.seriesDataIndices || [];\n var newIndices = thisItem.seriesDataIndices || [];\n contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;\n contentNotChanged && each(lastIndices, function (lastIdxItem, j) {\n var newIdxItem = newIndices[j];\n contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;\n });\n // check is cbParams data value changed\n lastCbParamsList && each(lastItem.seriesDataIndices, function (idxItem) {\n var seriesIdx = idxItem.seriesIndex;\n var cbParams = cbParamsList[seriesIdx];\n var lastCbParams = lastCbParamsList[seriesIdx];\n if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {\n contentNotChanged = false;\n }\n });\n });\n });\n this._lastDataByCoordSys = dataByCoordSys;\n this._cbParamsList = cbParamsList;\n return !!contentNotChanged;\n };\n TooltipView.prototype._hide = function (dispatchAction) {\n // Do not directly hideLater here, because this behavior may be prevented\n // in dispatchAction when showTip is dispatched.\n // FIXME\n // duplicated hideTip if manuallyHideTip is called from dispatchAction.\n this._lastDataByCoordSys = null;\n dispatchAction({\n type: 'hideTip',\n from: this.uid\n });\n };\n TooltipView.prototype.dispose = function (ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n }\n clear(this, '_updatePosition');\n this._tooltipContent.dispose();\n globalListener.unregister('itemTooltip', api);\n };\n TooltipView.type = 'tooltip';\n return TooltipView;\n}(ComponentView);\n/**\n * From top to bottom. (the last one should be globalTooltipModel);\n */\nfunction buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {\n // Last is always tooltip model.\n var ecModel = globalTooltipModel.ecModel;\n var resultModel;\n if (defaultTooltipOption) {\n resultModel = new Model(defaultTooltipOption, ecModel, ecModel);\n resultModel = new Model(globalTooltipModel.option, resultModel, ecModel);\n } else {\n resultModel = globalTooltipModel;\n }\n for (var i = modelCascade.length - 1; i >= 0; i--) {\n var tooltipOpt = modelCascade[i];\n if (tooltipOpt) {\n if (tooltipOpt instanceof Model) {\n tooltipOpt = tooltipOpt.get('tooltip', true);\n }\n // In each data item tooltip can be simply write:\n // {\n // value: 10,\n // tooltip: 'Something you need to know'\n // }\n if (isString(tooltipOpt)) {\n tooltipOpt = {\n formatter: tooltipOpt\n };\n }\n if (tooltipOpt) {\n resultModel = new Model(tooltipOpt, resultModel, ecModel);\n }\n }\n }\n return resultModel;\n}\nfunction makeDispatchAction(payload, api) {\n return payload.dispatchAction || bind(api.dispatchAction, api);\n}\nfunction refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\n var size = content.getSize();\n var width = size[0];\n var height = size[1];\n if (gapH != null) {\n // Add extra 2 pixels for this case:\n // At present the \"values\" in default tooltip are using CSS `float: right`.\n // When the right edge of the tooltip box is on the right side of the\n // viewport, the `float` layout might push the \"values\" to the second line.\n if (x + width + gapH + 2 > viewWidth) {\n x -= width + gapH;\n } else {\n x += gapH;\n }\n }\n if (gapV != null) {\n if (y + height + gapV > viewHeight) {\n y -= height + gapV;\n } else {\n y += gapV;\n }\n }\n return [x, y];\n}\nfunction confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\n var size = content.getSize();\n var width = size[0];\n var height = size[1];\n x = Math.min(x + width, viewWidth) - width;\n y = Math.min(y + height, viewHeight) - height;\n x = Math.max(x, 0);\n y = Math.max(y, 0);\n return [x, y];\n}\nfunction calcTooltipPosition(position, rect, contentSize, borderWidth) {\n var domWidth = contentSize[0];\n var domHeight = contentSize[1];\n var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8;\n var x = 0;\n var y = 0;\n var rectWidth = rect.width;\n var rectHeight = rect.height;\n switch (position) {\n case 'inside':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n case 'top':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y - domHeight - offset;\n break;\n case 'bottom':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight + offset;\n break;\n case 'left':\n x = rect.x - domWidth - offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n case 'right':\n x = rect.x + rectWidth + offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n }\n return [x, y];\n}\nfunction isCenterAlign(align) {\n return align === 'center' || align === 'middle';\n}\n/**\n * Find target component by payload like:\n * ```js\n * { legendId: 'some_id', name: 'xxx' }\n * { toolboxIndex: 1, name: 'xxx' }\n * { geoName: 'some_name', name: 'xxx' }\n * ```\n * PENDING: at present only\n *\n * If not found, return null/undefined.\n */\nfunction findComponentReference(payload, ecModel, api) {\n var queryOptionMap = preParseFinder(payload).queryOptionMap;\n var componentMainType = queryOptionMap.keys()[0];\n if (!componentMainType || componentMainType === 'series') {\n return;\n }\n var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {\n useDefault: false,\n enableAll: false,\n enableNone: false\n });\n var model = queryResult.models[0];\n if (!model) {\n return;\n }\n var view = api.getViewOfComponentModel(model);\n var el;\n view.group.traverse(function (subEl) {\n var tooltipConfig = getECData(subEl).tooltipConfig;\n if (tooltipConfig && tooltipConfig.name === payload.name) {\n el = subEl;\n return true; // stop\n }\n });\n\n if (el) {\n return {\n componentMainType: componentMainType,\n componentIndex: model.componentIndex,\n el: el\n };\n }\n}\nexport default TooltipView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nimport TooltipModel from './TooltipModel.js';\nimport TooltipView from './TooltipView.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n use(installAxisPointer);\n registers.registerComponentModel(TooltipModel);\n registers.registerComponentView(TooltipView);\n /**\n * @action\n * @property {string} type\n * @property {number} seriesIndex\n * @property {number} dataIndex\n * @property {number} [x]\n * @property {number} [y]\n */\n registers.registerAction({\n type: 'showTip',\n event: 'showTip',\n update: 'tooltip:manuallyShowTip'\n }, noop);\n registers.registerAction({\n type: 'hideTip',\n event: 'hideTip',\n update: 'tooltip:manuallyHideTip'\n }, noop);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nvar DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\nexport default function brushPreprocessor(option, isNew) {\n var brushComponents = normalizeToArray(option ? option.brush : []);\n if (!brushComponents.length) {\n return;\n }\n var brushComponentSpecifiedBtns = [];\n zrUtil.each(brushComponents, function (brushOpt) {\n var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : [];\n if (tbs instanceof Array) {\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\n }\n });\n var toolbox = option && option.toolbox;\n if (zrUtil.isArray(toolbox)) {\n toolbox = toolbox[0];\n }\n if (!toolbox) {\n toolbox = {\n feature: {}\n };\n option.toolbox = [toolbox];\n }\n var toolboxFeature = toolbox.feature || (toolbox.feature = {});\n var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\n removeDuplicate(brushTypes);\n if (isNew && !brushTypes.length) {\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\n }\n}\nfunction removeDuplicate(arr) {\n var map = {};\n zrUtil.each(arr, function (val) {\n map[val] = 1;\n });\n arr.length = 0;\n zrUtil.each(map, function (flag, val) {\n arr.push(val);\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * @file Visual solution, for consistent option specification.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from './VisualMapping.js';\nimport { getItemVisualFromData, setItemVisualFromData } from './helper.js';\nvar each = zrUtil.each;\nfunction hasKeys(obj) {\n if (obj) {\n for (var name_1 in obj) {\n if (obj.hasOwnProperty(name_1)) {\n return true;\n }\n }\n }\n}\nexport function createVisualMappings(option, stateList, supplementVisualOption) {\n var visualMappings = {};\n each(stateList, function (state) {\n var mappings = visualMappings[state] = createMappings();\n each(option[state], function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n var mappingOption = {\n type: visualType,\n visual: visualData\n };\n supplementVisualOption && supplementVisualOption(mappingOption, state);\n mappings[visualType] = new VisualMapping(mappingOption);\n // Prepare a alpha for opacity, for some case that opacity\n // is not supported, such as rendering using gradient color.\n if (visualType === 'opacity') {\n mappingOption = zrUtil.clone(mappingOption);\n mappingOption.type = 'colorAlpha';\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\n }\n });\n });\n return visualMappings;\n function createMappings() {\n var Creater = function () {};\n // Make sure hidden fields will not be visited by\n // object iteration (with hasOwnProperty checking).\n Creater.prototype.__hidden = Creater.prototype;\n var obj = new Creater();\n return obj;\n }\n}\nexport function replaceVisualOption(thisOption, newOption, keys) {\n // Visual attributes merge is not supported, otherwise it\n // brings overcomplicated merge logic. See #2853. So if\n // newOption has anyone of these keys, all of these keys\n // will be reset. Otherwise, all keys remain.\n var has;\n zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n has = true;\n }\n });\n has && zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n thisOption[key] = zrUtil.clone(newOption[key]);\n } else {\n delete thisOption[key];\n }\n });\n}\n/**\n * @param stateList\n * @param visualMappings\n * @param list\n * @param getValueState param: valueOrIndex, return: state.\n * @param scope Scope for getValueState\n * @param dimension Concrete dimension, if used.\n */\n// ???! handle brush?\nexport function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n var dataIndex;\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n if (dimension == null) {\n data.each(eachItem);\n } else {\n data.each([dimension], eachItem);\n }\n function eachItem(valueOrIndex, index) {\n dataIndex = dimension == null ? valueOrIndex // First argument is index\n : index;\n var rawDataItem = data.getRawDataItem(dataIndex);\n // Consider performance\n // @ts-ignore\n if (rawDataItem && rawDataItem.visualMap === false) {\n return;\n }\n var valueState = getValueState.call(scope, valueOrIndex);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\n }\n }\n}\n/**\n * @param data\n * @param stateList\n * @param visualMappings >\n * @param getValueState param: valueOrIndex, return: state.\n * @param dim dimension or dimension index.\n */\nexport function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n return {\n progress: function progress(params, data) {\n var dimIndex;\n if (dim != null) {\n dimIndex = data.getDimensionIndex(dim);\n }\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n var dataIndex;\n var store = data.getStore();\n while ((dataIndex = params.next()) != null) {\n var rawDataItem = data.getRawDataItem(dataIndex);\n // Consider performance\n // @ts-ignore\n if (rawDataItem && rawDataItem.visualMap === false) {\n continue;\n }\n var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex;\n var valueState = getValueState(value);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\n }\n }\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { linePolygonIntersect } from '../../util/graphic.js';\nexport function makeBrushCommonSelectorForSeries(area) {\n var brushType = area.brushType;\n // Do not use function binding or curry for performance.\n var selectors = {\n point: function (itemLayout) {\n return selector[brushType].point(itemLayout, selectors, area);\n },\n rect: function (itemLayout) {\n return selector[brushType].rect(itemLayout, selectors, area);\n }\n };\n return selectors;\n}\nvar selector = {\n lineX: getLineSelectors(0),\n lineY: getLineSelectors(1),\n rect: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.intersect(itemLayout);\n }\n },\n polygon: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && polygonContain.contain(area.range, itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n var points = area.range;\n if (!itemLayout || points.length <= 1) {\n return false;\n }\n var x = itemLayout.x;\n var y = itemLayout.y;\n var width = itemLayout.width;\n var height = itemLayout.height;\n var p = points[0];\n if (polygonContain.contain(points, x, y) || polygonContain.contain(points, x + width, y) || polygonContain.contain(points, x, y + height) || polygonContain.contain(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\n return true;\n }\n }\n }\n};\nfunction getLineSelectors(xyIndex) {\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n return {\n point: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var p = itemLayout[xyIndex];\n return inLineRange(p, range);\n }\n },\n rect: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\n return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);\n }\n }\n };\n}\nfunction inLineRange(p, range) {\n return range[0] <= p && p <= range[1];\n}\nexport default selector;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport { makeBrushCommonSelectorForSeries } from './selector.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport BrushTargetManager from '../helper/BrushTargetManager.js';\nvar STATE_LIST = ['inBrush', 'outOfBrush'];\nvar DISPATCH_METHOD = '__ecBrushSelect';\nvar DISPATCH_FLAG = '__ecInBrushSelectEvent';\n;\nexport function layoutCovers(ecModel) {\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\n });\n}\n/**\n * Register the visual encoding if this modules required.\n */\nexport default function brushVisual(ecModel, api, payload) {\n var brushSelected = [];\n var throttleType;\n var throttleDelay;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : {\n brushType: false\n });\n });\n layoutCovers(ecModel);\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel, brushIndex) {\n var thisBrushSelected = {\n brushId: brushModel.id,\n brushIndex: brushIndex,\n brushName: brushModel.name,\n areas: zrUtil.clone(brushModel.areas),\n selected: []\n };\n // Every brush component exists in event params, convenient\n // for user to find by index.\n brushSelected.push(thisBrushSelected);\n var brushOption = brushModel.option;\n var brushLink = brushOption.brushLink;\n var linkedSeriesMap = [];\n var selectedDataIndexForLink = [];\n var rangeInfoBySeries = [];\n var hasBrushExists = false;\n if (!brushIndex) {\n // Only the first throttle setting works.\n throttleType = brushOption.throttleType;\n throttleDelay = brushOption.throttleDelay;\n }\n // Add boundingRect and selectors to range.\n var areas = zrUtil.map(brushModel.areas, function (area) {\n var builder = boundingRectBuilders[area.brushType];\n var selectableArea = zrUtil.defaults({\n boundingRect: builder ? builder(area) : void 0\n }, area);\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\n return selectableArea;\n });\n var visualMappings = visualSolution.createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\n mappingOption.mappingMethod = 'fixed';\n });\n zrUtil.isArray(brushLink) && zrUtil.each(brushLink, function (seriesIndex) {\n linkedSeriesMap[seriesIndex] = 1;\n });\n function linkOthers(seriesIndex) {\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\n }\n // If no supported brush or no brush on the series,\n // all visuals should be in original state.\n function brushed(rangeInfoList) {\n return !!rangeInfoList.length;\n }\n /**\n * Logic for each series: (If the logic has to be modified one day, do it carefully!)\n *\n * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord.\n * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord.\n * └!hasBrushExist┘ └nothing.\n * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord.\n * └!hasBrushExist┘ └nothing.\n * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck.\n * !brushed┘ └nothing.\n * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing.\n */\n // Step A\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\n seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\n });\n function stepAParallel(seriesModel, seriesIndex) {\n var coordSys = seriesModel.coordinateSystem;\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\n });\n }\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\n return;\n }\n zrUtil.each(areas, function (area) {\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\n rangeInfoList.push(area);\n }\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\n });\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\n var data_1 = seriesModel.getData();\n data_1.each(function (dataIndex) {\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\n selectedDataIndexForLink[dataIndex] = 1;\n }\n });\n }\n }\n // Step B\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var seriesBrushSelected = {\n seriesId: seriesModel.id,\n seriesIndex: seriesIndex,\n seriesName: seriesModel.name,\n dataIndex: []\n };\n // Every series exists in event params, convenient\n // for user to find series by seriesIndex.\n thisBrushSelected.selected.push(seriesBrushSelected);\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\n var data = seriesModel.getData();\n var getValueState = linkOthers(seriesIndex) ? function (dataIndex) {\n return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n } : function (dataIndex) {\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n };\n // If no supported brush or no brush, all visuals are in original state.\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && visualSolution.applyVisual(STATE_LIST, visualMappings, data, getValueState);\n });\n });\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\n}\n;\nfunction dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\n // This event will not be triggered when `setOpion`, otherwise dead lock may\n // triggered when do `setOption` in event listener, which we do not find\n // satisfactory way to solve yet. Some considered resolutions:\n // (a) Diff with prevoius selected data ant only trigger event when changed.\n // But store previous data and diff precisely (i.e., not only by dataIndex, but\n // also detect value changes in selected data) might bring complexity or fragility.\n // (b) Use spectial param like `silent` to suppress event triggering.\n // But such kind of volatile param may be weird in `setOption`.\n if (!payload) {\n return;\n }\n var zr = api.getZr();\n if (zr[DISPATCH_FLAG]) {\n return;\n }\n if (!zr[DISPATCH_METHOD]) {\n zr[DISPATCH_METHOD] = doDispatch;\n }\n var fn = throttleUtil.createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\n fn(api, brushSelected);\n}\nfunction doDispatch(api, brushSelected) {\n if (!api.isDisposed()) {\n var zr = api.getZr();\n zr[DISPATCH_FLAG] = true;\n api.dispatchAction({\n type: 'brushSelect',\n batch: brushSelected\n });\n zr[DISPATCH_FLAG] = false;\n }\n}\nfunction checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\n var area = rangeInfoList[i];\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\n return true;\n }\n }\n}\nfunction brushModelNotControll(brushModel, seriesIndex) {\n var seriesIndices = brushModel.option.seriesIndex;\n return seriesIndices != null && seriesIndices !== 'all' && (zrUtil.isArray(seriesIndices) ? zrUtil.indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);\n}\nvar boundingRectBuilders = {\n rect: function (area) {\n return getBoundingRectFromMinMax(area.range);\n },\n polygon: function (area) {\n var minMax;\n var range = area.range;\n for (var i = 0, len = range.length; i < len; i++) {\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\n var rg = range[i];\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\n }\n return minMax && getBoundingRectFromMinMax(minMax);\n }\n};\nfunction getBoundingRectFromMinMax(minMax) {\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../helper/BrushController.js';\nimport { layoutCovers } from './visualEncoding.js';\nimport ComponentView from '../../view/Component.js';\nvar BrushView = /** @class */function (_super) {\n __extends(BrushView, _super);\n function BrushView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = BrushView.type;\n return _this;\n }\n BrushView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n this.model;\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this)).mount();\n };\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\n this.model = brushModel;\n this._updateController(brushModel, ecModel, api, payload);\n };\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\n // PENDING: `updateTransform` is a little tricky, whose layout need\n // to be calculate mandatorily and other stages will not be performed.\n // Take care the correctness of the logic. See #11754 .\n layoutCovers(ecModel);\n this._updateController(brushModel, ecModel, api, payload);\n };\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\n this.updateTransform(brushModel, ecModel, api, payload);\n };\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\n this._updateController(brushModel, ecModel, api, payload);\n };\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\n // Do not update controller when drawing.\n (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());\n };\n // updateLayout: updateController,\n // updateVisual: updateController,\n BrushView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n BrushView.prototype._onBrush = function (eventParam) {\n var modelId = this.model.id;\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);\n // Action is not dispatched on drag end, because the drag end\n // emits the same params with the last drag move event, and\n // may have some delay when using touch pad, which makes\n // animation not smooth (when using debounce).\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\n type: 'brush',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n eventParam.isEnd && this.api.dispatchAction({\n type: 'brushEnd',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n };\n BrushView.type = 'brush';\n return BrushView;\n}(ComponentView);\nexport default BrushView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport Model from '../../model/Model.js';\nimport ComponentModel from '../../model/Component.js';\nvar DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\nvar BrushModel = /** @class */function (_super) {\n __extends(BrushModel, _super);\n function BrushModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = BrushModel.type;\n /**\n * @readOnly\n */\n _this.areas = [];\n /**\n * Current brush painting area settings.\n * @readOnly\n */\n _this.brushOption = {};\n return _this;\n }\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\n var inBrush = thisOption.inBrush = thisOption.inBrush || {};\n // Always give default visual, consider setOption at the second time.\n thisOption.outOfBrush = thisOption.outOfBrush || {\n color: DEFAULT_OUT_OF_BRUSH_COLOR\n };\n if (!inBrush.hasOwnProperty('liftZ')) {\n // Bigger than the highlight z lift, otherwise it will\n // be effected by the highlight z when brush.\n inBrush.liftZ = 5;\n }\n };\n /**\n * If `areas` is null/undefined, range state remain.\n */\n BrushModel.prototype.setAreas = function (areas) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isArray(areas));\n zrUtil.each(areas, function (area) {\n zrUtil.assert(area.brushType, 'Illegal areas');\n });\n }\n // If areas is null/undefined, range state remain.\n // This helps user to dispatchAction({type: 'brush'}) with no areas\n // set but just want to get the current brush select info from a `brush` event.\n if (!areas) {\n return;\n }\n this.areas = zrUtil.map(areas, function (area) {\n return generateBrushOption(this.option, area);\n }, this);\n };\n /**\n * Set the current painting brush option.\n */\n BrushModel.prototype.setBrushOption = function (brushOption) {\n this.brushOption = generateBrushOption(this.option, brushOption);\n this.brushType = this.brushOption.brushType;\n };\n BrushModel.type = 'brush';\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\n BrushModel.defaultOption = {\n seriesIndex: 'all',\n brushType: 'rect',\n brushMode: 'single',\n transformable: true,\n brushStyle: {\n borderWidth: 1,\n color: 'rgba(210,219,238,0.3)',\n borderColor: '#D2DBEE'\n },\n throttleType: 'fixRate',\n throttleDelay: 0,\n removeOnClick: true,\n z: 10000\n };\n return BrushModel;\n}(ComponentModel);\nfunction generateBrushOption(option, brushOption) {\n return zrUtil.merge({\n brushType: option.brushType,\n brushMode: option.brushMode,\n transformable: option.transformable,\n brushStyle: new Model(option.brushStyle).getItemStyle(),\n removeOnClick: option.removeOnClick,\n z: option.z\n }, brushOption, true);\n}\nexport default BrushModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nvar ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\nvar BrushFeature = /** @class */function (_super) {\n __extends(BrushFeature, _super);\n function BrushFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\n var brushType;\n var brushMode;\n var isBrushed;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n brushType = brushModel.brushType;\n brushMode = brushModel.brushOption.brushMode || 'single';\n isBrushed = isBrushed || !!brushModel.areas.length;\n });\n this._brushType = brushType;\n this._brushMode = brushMode;\n zrUtil.each(featureModel.get('type', true), function (type) {\n featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal');\n });\n };\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\n this.render(featureModel, ecModel, api);\n };\n BrushFeature.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon', true);\n var icons = {};\n zrUtil.each(model.get('type', true), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n ;\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\n var brushType = this._brushType;\n var brushMode = this._brushMode;\n if (type === 'clear') {\n // Trigger parallel action firstly\n api.dispatchAction({\n type: 'axisAreaSelect',\n intervals: []\n });\n api.dispatchAction({\n type: 'brush',\n command: 'clear',\n // Clear all areas of all brush components.\n areas: []\n });\n } else {\n api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'brush',\n brushOption: {\n brushType: type === 'keep' ? brushType : brushType === type ? false : type,\n brushMode: type === 'keep' ? brushMode === 'multiple' ? 'single' : 'multiple' : brushMode\n }\n });\n }\n };\n ;\n BrushFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: ICON_TYPES.slice(),\n icon: {\n /* eslint-disable */\n 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',\n 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',\n 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',\n 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',\n 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',\n 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\n /* eslint-enable */\n },\n\n // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`\n title: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title'])\n };\n return defaultOption;\n };\n return BrushFeature;\n}(ToolboxFeature);\nexport default BrushFeature;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport brushPreprocessor from './preprocessor.js';\nimport BrushView from './BrushView.js';\nimport BrushModel from './BrushModel.js';\nimport brushVisual from './visualEncoding.js';\n// TODO\nimport BrushFeature from '../toolbox/feature/Brush.js';\nimport { registerFeature } from '../toolbox/featureManager.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n registers.registerComponentView(BrushView);\n registers.registerComponentModel(BrushModel);\n registers.registerPreprocessor(brushPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);\n registers.registerAction({\n type: 'brush',\n event: 'brush',\n update: 'updateVisual'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'brush',\n query: payload\n }, function (brushModel) {\n brushModel.setAreas(payload.areas);\n });\n });\n /**\n * payload: {\n * brushComponents: [\n * {\n * brushId,\n * brushIndex,\n * brushName,\n * series: [\n * {\n * seriesId,\n * seriesIndex,\n * seriesName,\n * rawIndices: [21, 34, ...]\n * },\n * ...\n * ]\n * },\n * ...\n * ]\n * }\n */\n registers.registerAction({\n type: 'brushSelect',\n event: 'brushSelected',\n update: 'none'\n }, noop);\n registers.registerAction({\n type: 'brushEnd',\n event: 'brushEnd',\n update: 'none'\n }, noop);\n registerFeature('brush', BrushFeature);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { windowOpen } from '../../util/format.js';\nvar TitleModel = /** @class */function (_super) {\n __extends(TitleModel, _super);\n function TitleModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TitleModel.type;\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n return _this;\n }\n TitleModel.type = 'title';\n TitleModel.defaultOption = {\n // zlevel: 0,\n z: 6,\n show: true,\n text: '',\n target: 'blank',\n subtext: '',\n subtarget: 'blank',\n left: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n textStyle: {\n fontSize: 18,\n fontWeight: 'bold',\n color: '#464646'\n },\n subtextStyle: {\n fontSize: 12,\n color: '#6E7079'\n }\n };\n return TitleModel;\n}(ComponentModel);\n// View\nvar TitleView = /** @class */function (_super) {\n __extends(TitleView, _super);\n function TitleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TitleView.type;\n return _this;\n }\n TitleView.prototype.render = function (titleModel, ecModel, api) {\n this.group.removeAll();\n if (!titleModel.get('show')) {\n return;\n }\n var group = this.group;\n var textStyleModel = titleModel.getModel('textStyle');\n var subtextStyleModel = titleModel.getModel('subtextStyle');\n var textAlign = titleModel.get('textAlign');\n var textVerticalAlign = zrUtil.retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\n var textEl = new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: titleModel.get('text'),\n fill: textStyleModel.getTextColor()\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var textRect = textEl.getBoundingRect();\n var subText = titleModel.get('subtext');\n var subTextEl = new graphic.Text({\n style: createTextStyle(subtextStyleModel, {\n text: subText,\n fill: subtextStyleModel.getTextColor(),\n y: textRect.height + titleModel.get('itemGap'),\n verticalAlign: 'top'\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var link = titleModel.get('link');\n var sublink = titleModel.get('sublink');\n var triggerEvent = titleModel.get('triggerEvent', true);\n textEl.silent = !link && !triggerEvent;\n subTextEl.silent = !sublink && !triggerEvent;\n if (link) {\n textEl.on('click', function () {\n windowOpen(link, '_' + titleModel.get('target'));\n });\n }\n if (sublink) {\n subTextEl.on('click', function () {\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\n });\n }\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? {\n componentType: 'title',\n componentIndex: titleModel.componentIndex\n } : null;\n group.add(textEl);\n subText && group.add(subTextEl);\n // If no subText, but add subTextEl, there will be an empty line.\n var groupRect = group.getBoundingRect();\n var layoutOption = titleModel.getBoxLayoutParams();\n layoutOption.width = groupRect.width;\n layoutOption.height = groupRect.height;\n var layoutRect = getLayoutRect(layoutOption, {\n width: api.getWidth(),\n height: api.getHeight()\n }, titleModel.get('padding'));\n // Adjust text align based on position\n if (!textAlign) {\n // Align left if title is on the left. center and right is same\n textAlign = titleModel.get('left') || titleModel.get('right');\n // @ts-ignore\n if (textAlign === 'middle') {\n textAlign = 'center';\n }\n // Adjust layout by text align\n if (textAlign === 'right') {\n layoutRect.x += layoutRect.width;\n } else if (textAlign === 'center') {\n layoutRect.x += layoutRect.width / 2;\n }\n }\n if (!textVerticalAlign) {\n textVerticalAlign = titleModel.get('top') || titleModel.get('bottom');\n // @ts-ignore\n if (textVerticalAlign === 'center') {\n textVerticalAlign = 'middle';\n }\n if (textVerticalAlign === 'bottom') {\n layoutRect.y += layoutRect.height;\n } else if (textVerticalAlign === 'middle') {\n layoutRect.y += layoutRect.height / 2;\n }\n textVerticalAlign = textVerticalAlign || 'top';\n }\n group.x = layoutRect.x;\n group.y = layoutRect.y;\n group.markRedraw();\n var alignStyle = {\n align: textAlign,\n verticalAlign: textVerticalAlign\n };\n textEl.setStyle(alignStyle);\n subTextEl.setStyle(alignStyle);\n // Render background\n // Get groupRect again because textAlign has been changed\n groupRect = group.getBoundingRect();\n var padding = layoutRect.margin;\n var style = titleModel.getItemStyle(['color', 'opacity']);\n style.fill = titleModel.get('backgroundColor');\n var rect = new graphic.Rect({\n shape: {\n x: groupRect.x - padding[3],\n y: groupRect.y - padding[0],\n width: groupRect.width + padding[1] + padding[3],\n height: groupRect.height + padding[0] + padding[2],\n r: titleModel.get('borderRadius')\n },\n style: style,\n subPixelOptimize: true,\n silent: true\n });\n group.add(rect);\n };\n TitleView.type = 'title';\n return TitleView;\n}(ComponentView);\nexport function install(registers) {\n registers.registerComponentModel(TitleModel);\n registers.registerComponentView(TitleView);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { each, isObject, clone } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName, getDataItemValue } from '../../util/model.js';\nvar TimelineModel = /** @class */function (_super) {\n __extends(TimelineModel, _super);\n function TimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TimelineModel.type;\n _this.layoutMode = 'box';\n return _this;\n }\n /**\n * @override\n */\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n this._initData();\n };\n /**\n * @override\n */\n TimelineModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n this._initData();\n };\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\n if (currentIndex == null) {\n currentIndex = this.option.currentIndex;\n }\n var count = this._data.count();\n if (this.option.loop) {\n currentIndex = (currentIndex % count + count) % count;\n } else {\n currentIndex >= count && (currentIndex = count - 1);\n currentIndex < 0 && (currentIndex = 0);\n }\n this.option.currentIndex = currentIndex;\n };\n /**\n * @return {number} currentIndex\n */\n TimelineModel.prototype.getCurrentIndex = function () {\n return this.option.currentIndex;\n };\n /**\n * @return {boolean}\n */\n TimelineModel.prototype.isIndexMax = function () {\n return this.getCurrentIndex() >= this._data.count() - 1;\n };\n /**\n * @param {boolean} state true: play, false: stop\n */\n TimelineModel.prototype.setPlayState = function (state) {\n this.option.autoPlay = !!state;\n };\n /**\n * @return {boolean} true: play, false: stop\n */\n TimelineModel.prototype.getPlayState = function () {\n return !!this.option.autoPlay;\n };\n /**\n * @private\n */\n TimelineModel.prototype._initData = function () {\n var thisOption = this.option;\n var dataArr = thisOption.data || [];\n var axisType = thisOption.axisType;\n var names = this._names = [];\n var processedDataArr;\n if (axisType === 'category') {\n processedDataArr = [];\n each(dataArr, function (item, index) {\n var value = convertOptionIdName(getDataItemValue(item), '');\n var newItem;\n if (isObject(item)) {\n newItem = clone(item);\n newItem.value = index;\n } else {\n newItem = index;\n }\n processedDataArr.push(newItem);\n names.push(value);\n });\n } else {\n processedDataArr = dataArr;\n }\n var dimType = {\n category: 'ordinal',\n time: 'time',\n value: 'number'\n }[axisType] || 'number';\n var data = this._data = new SeriesData([{\n name: 'value',\n type: dimType\n }], this);\n data.initData(processedDataArr, names);\n };\n TimelineModel.prototype.getData = function () {\n return this._data;\n };\n /**\n * @public\n * @return {Array.} categoreis\n */\n TimelineModel.prototype.getCategories = function () {\n if (this.get('axisType') === 'category') {\n return this._names.slice();\n }\n };\n TimelineModel.type = 'timeline';\n /**\n * @protected\n */\n TimelineModel.defaultOption = {\n // zlevel: 0, // 一级层叠\n z: 4,\n show: true,\n axisType: 'time',\n realtime: true,\n left: '20%',\n top: null,\n right: '20%',\n bottom: 0,\n width: null,\n height: 40,\n padding: 5,\n controlPosition: 'left',\n autoPlay: false,\n rewind: false,\n loop: true,\n playInterval: 2000,\n currentIndex: 0,\n itemStyle: {},\n label: {\n color: '#000'\n },\n data: []\n };\n return TimelineModel;\n}(ComponentModel);\nexport default TimelineModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport TimelineModel from './TimelineModel.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar SliderTimelineModel = /** @class */function (_super) {\n __extends(SliderTimelineModel, _super);\n function SliderTimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SliderTimelineModel.type;\n return _this;\n }\n SliderTimelineModel.type = 'timeline.slider';\n /**\n * @protected\n */\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n orient: 'horizontal',\n inverse: false,\n tooltip: {\n trigger: 'item' // data item may also have tootip attr.\n },\n\n symbol: 'circle',\n symbolSize: 12,\n lineStyle: {\n show: true,\n width: 2,\n color: '#DAE1F5'\n },\n label: {\n position: 'auto',\n // When using number, label position is not\n // restricted by viewRect.\n // positive: right/bottom, negative: left/top\n show: true,\n interval: 'auto',\n rotate: 0,\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#A4B1D7'\n },\n itemStyle: {\n color: '#A4B1D7',\n borderWidth: 1\n },\n checkpointStyle: {\n symbol: 'circle',\n symbolSize: 15,\n color: '#316bf3',\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0, 0, 0, 0.3)',\n // borderColor: 'rgba(194,53,49, 0.5)',\n animation: true,\n animationDuration: 300,\n animationEasing: 'quinticInOut'\n },\n controlStyle: {\n show: true,\n showPlayBtn: true,\n showPrevBtn: true,\n showNextBtn: true,\n itemSize: 24,\n itemGap: 12,\n position: 'left',\n playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z',\n stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',\n // eslint-disable-next-line max-len\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\n // eslint-disable-next-line max-len\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\n prevBtnSize: 18,\n nextBtnSize: 18,\n color: '#A4B1D7',\n borderColor: '#A4B1D7',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#6f778d'\n },\n itemStyle: {\n color: '#316BF3'\n },\n controlStyle: {\n color: '#316BF3',\n borderColor: '#316BF3',\n borderWidth: 2\n }\n },\n progress: {\n lineStyle: {\n color: '#316BF3'\n },\n itemStyle: {\n color: '#316BF3'\n },\n label: {\n color: '#6f778d'\n }\n },\n data: []\n });\n return SliderTimelineModel;\n}(TimelineModel);\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\nexport default SliderTimelineModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nvar TimelineView = /** @class */function (_super) {\n __extends(TimelineView, _super);\n function TimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = TimelineView.type;\n return _this;\n }\n TimelineView.type = 'timeline';\n return TimelineView;\n}(ComponentView);\nexport default TimelineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../../coord/Axis.js';\n/**\n * Extend axis 2d\n */\nvar TimelineAxis = /** @class */function (_super) {\n __extends(TimelineAxis, _super);\n function TimelineAxis(dim, scale, coordExtent, axisType) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n _this.type = axisType || 'value';\n return _this;\n }\n /**\n * @override\n */\n TimelineAxis.prototype.getLabelModel = function () {\n // Force override\n return this.model.getModel('label');\n };\n /**\n * @override\n */\n TimelineAxis.prototype.isHorizontal = function () {\n return this.model.get('orient') === 'horizontal';\n };\n return TimelineAxis;\n}(Axis);\nexport default TimelineAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport * as layout from '../../util/layout.js';\nimport TimelineView from './TimelineView.js';\nimport TimelineAxis from './TimelineAxis.js';\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as numberUtil from '../../util/number.js';\nimport { merge, each, extend, isString, bind, defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../../scale/Ordinal.js';\nimport TimeScale from '../../scale/Time.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../../util/model.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\nvar PI = Math.PI;\nvar labelDataIndexStore = makeInner();\nvar SliderTimelineView = /** @class */function (_super) {\n __extends(SliderTimelineView, _super);\n function SliderTimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SliderTimelineView.type;\n return _this;\n }\n SliderTimelineView.prototype.init = function (ecModel, api) {\n this.api = api;\n };\n /**\n * @override\n */\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\n this.model = timelineModel;\n this.api = api;\n this.ecModel = ecModel;\n this.group.removeAll();\n if (timelineModel.get('show', true)) {\n var layoutInfo_1 = this._layout(timelineModel, api);\n var mainGroup_1 = this._createGroup('_mainGroup');\n var labelGroup = this._createGroup('_labelGroup');\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\n timelineModel.formatTooltip = function (dataIndex) {\n var name = axis_1.scale.getLabel({\n value: dataIndex\n });\n return createTooltipMarkup('nameValue', {\n noName: true,\n value: name\n });\n };\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\n }, this);\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\n this._position(layoutInfo_1, timelineModel);\n }\n this._doPlayStop();\n this._updateTicksStatus();\n };\n /**\n * @override\n */\n SliderTimelineView.prototype.remove = function () {\n this._clearTimer();\n this.group.removeAll();\n };\n /**\n * @override\n */\n SliderTimelineView.prototype.dispose = function () {\n this._clearTimer();\n };\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\n var labelPosOpt = timelineModel.get(['label', 'position']);\n var orient = timelineModel.get('orient');\n var viewRect = getViewRect(timelineModel, api);\n var parsedLabelPos;\n // Auto label offset.\n if (labelPosOpt == null || labelPosOpt === 'auto') {\n parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-';\n } else if (isString(labelPosOpt)) {\n parsedLabelPos = {\n horizontal: {\n top: '-',\n bottom: '+'\n },\n vertical: {\n left: '-',\n right: '+'\n }\n }[orient][labelPosOpt];\n } else {\n // is number\n parsedLabelPos = labelPosOpt;\n }\n var labelAlignMap = {\n horizontal: 'center',\n vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right'\n };\n var labelBaselineMap = {\n horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom',\n vertical: 'middle'\n };\n var rotationMap = {\n horizontal: 0,\n vertical: PI / 2\n };\n // Position\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\n var controlModel = timelineModel.getModel('controlStyle');\n var showControl = controlModel.get('show', true);\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\n var sizePlusGap = controlSize + controlGap;\n // Special label rotate.\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\n labelRotation = labelRotation * PI / 180; // To radian.\n var playPosition;\n var prevBtnPosition;\n var nextBtnPosition;\n var controlPosition = controlModel.get('position', true);\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\n var xLeft = 0;\n var xRight = mainLength;\n // position[0] means left, position[1] means middle.\n if (controlPosition === 'left' || controlPosition === 'bottom') {\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n } else {\n // 'top' 'right'\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n }\n var axisExtent = [xLeft, xRight];\n if (timelineModel.get('inverse')) {\n axisExtent.reverse();\n }\n return {\n viewRect: viewRect,\n mainLength: mainLength,\n orient: orient,\n rotation: rotationMap[orient],\n labelRotation: labelRotation,\n labelPosOpt: parsedLabelPos,\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\n labelBaseline: timelineModel.get(['label', 'verticalAlign']) || timelineModel.get(['label', 'baseline']) || labelBaselineMap[orient],\n // Based on mainGroup.\n playPosition: playPosition,\n prevBtnPosition: prevBtnPosition,\n nextBtnPosition: nextBtnPosition,\n axisExtent: axisExtent,\n controlSize: controlSize,\n controlGap: controlGap\n };\n };\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\n // Position is be called finally, because bounding rect is needed for\n // adapt content to fill viewRect (auto adapt offset).\n // Timeline may be not all in the viewRect when 'offset' is specified\n // as a number, because it is more appropriate that label aligns at\n // 'offset' but not the other edge defined by viewRect.\n var mainGroup = this._mainGroup;\n var labelGroup = this._labelGroup;\n var viewRect = layoutInfo.viewRect;\n if (layoutInfo.orient === 'vertical') {\n // transform to horizontal, inverse rotate by left-top point.\n var m = matrix.create();\n var rotateOriginX = viewRect.x;\n var rotateOriginY = viewRect.y + viewRect.height;\n matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]);\n matrix.rotate(m, m, -PI / 2);\n matrix.translate(m, m, [rotateOriginX, rotateOriginY]);\n viewRect = viewRect.clone();\n viewRect.applyTransform(m);\n }\n var viewBound = getBound(viewRect);\n var mainBound = getBound(mainGroup.getBoundingRect());\n var labelBound = getBound(labelGroup.getBoundingRect());\n var mainPosition = [mainGroup.x, mainGroup.y];\n var labelsPosition = [labelGroup.x, labelGroup.y];\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\n var labelPosOpt = layoutInfo.labelPosOpt;\n if (labelPosOpt == null || isString(labelPosOpt)) {\n // '+' or '-'\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\n } else {\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\n }\n mainGroup.setPosition(mainPosition);\n labelGroup.setPosition(labelsPosition);\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\n setOrigin(mainGroup);\n setOrigin(labelGroup);\n function setOrigin(targetGroup) {\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\n }\n function getBound(rect) {\n // [[xmin, xmax], [ymin, ymax]]\n return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];\n }\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\n }\n };\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\n var data = timelineModel.getData();\n var axisType = timelineModel.get('axisType');\n var scale = createScaleByModel(timelineModel, axisType);\n // Customize scale. The `tickValue` is `dataIndex`.\n scale.getTicks = function () {\n return data.mapArray(['value'], function (value) {\n return {\n value: value\n };\n });\n };\n var dataExtent = data.getDataExtent('value');\n scale.setExtent(dataExtent[0], dataExtent[1]);\n scale.calcNiceTicks();\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\n axis.model = timelineModel;\n return axis;\n };\n SliderTimelineView.prototype._createGroup = function (key) {\n var newGroup = this[key] = new graphic.Group();\n this.group.add(newGroup);\n return newGroup;\n };\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\n var axisExtent = axis.getExtent();\n if (!timelineModel.get(['lineStyle', 'show'])) {\n return;\n }\n var line = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n y1: 0,\n x2: axisExtent[1],\n y2: 0\n },\n style: extend({\n lineCap: 'round'\n }, timelineModel.getModel('lineStyle').getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(line);\n var progressLine = this._progressLine = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],\n y1: 0,\n y2: 0\n },\n style: defaults({\n lineCap: 'round',\n lineWidth: line.style.lineWidth\n }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(progressLine);\n };\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n var data = timelineModel.getData();\n // Show all ticks, despite ignoring strategy.\n var ticks = axis.scale.getTicks();\n this._tickSymbols = [];\n // The value is dataIndex, see the customized scale.\n each(ticks, function (tick) {\n var tickCoord = axis.dataToCoord(tick.value);\n var itemModel = data.getItemModel(tick.value);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\n var symbolOpt = {\n x: tickCoord,\n y: 0,\n onclick: bind(_this._changeTimeline, _this, tick.value)\n };\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\n enableHoverEmphasis(el);\n var ecData = getECData(el);\n if (itemModel.get('tooltip')) {\n ecData.dataIndex = tick.value;\n ecData.dataModel = timelineModel;\n } else {\n ecData.dataIndex = ecData.dataModel = null;\n }\n _this._tickSymbols.push(el);\n });\n };\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n var labelModel = axis.getLabelModel();\n if (!labelModel.get('show')) {\n return;\n }\n var data = timelineModel.getData();\n var labels = axis.getViewLabels();\n this._tickLabels = [];\n each(labels, function (labelItem) {\n // The tickValue is dataIndex, see the customized scale.\n var dataIndex = labelItem.tickValue;\n var itemModel = data.getItemModel(dataIndex);\n var normalLabelModel = itemModel.getModel('label');\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: 0,\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\n onclick: bind(_this._changeTimeline, _this, dataIndex),\n silent: false,\n style: createTextStyle(normalLabelModel, {\n text: labelItem.formattedLabel,\n align: layoutInfo.labelAlign,\n verticalAlign: layoutInfo.labelBaseline\n })\n });\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\n group.add(textEl);\n enableHoverEmphasis(textEl);\n labelDataIndexStore(textEl).dataIndex = dataIndex;\n _this._tickLabels.push(textEl);\n });\n };\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\n var controlSize = layoutInfo.controlSize;\n var rotation = layoutInfo.rotation;\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\n var playState = timelineModel.getPlayState();\n var inverse = timelineModel.get('inverse', true);\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\n makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true);\n function makeBtn(position, iconName, onclick, willRotate) {\n if (!position) {\n return;\n }\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\n var rect = [0, -iconSize / 2, iconSize, iconSize];\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, {\n x: position[0],\n y: position[1],\n originX: controlSize / 2,\n originY: 0,\n rotation: willRotate ? -rotation : 0,\n rectHover: true,\n style: itemStyle,\n onclick: onclick\n });\n btn.ensureState('emphasis').style = hoverStyle;\n group.add(btn);\n enableHoverEmphasis(btn);\n }\n };\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\n var data = timelineModel.getData();\n var currentIndex = timelineModel.getCurrentIndex();\n var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle');\n var me = this;\n var callback = {\n onCreate: function (pointer) {\n pointer.draggable = true;\n pointer.drift = bind(me._handlePointerDrag, me);\n pointer.ondragend = bind(me._handlePointerDragend, me);\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\n },\n onUpdate: function (pointer) {\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\n }\n };\n // Reuse when exists, for animation and drag.\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\n };\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\n this._clearTimer();\n this.api.dispatchAction({\n type: 'timelinePlayChange',\n playState: nextState,\n from: this.uid\n });\n };\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\n this._clearTimer();\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\n };\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\n };\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\n var toCoord = this._toAxisCoord(mousePos)[0];\n var axis = this._axis;\n var axisExtent = numberUtil.asc(axis.getExtent().slice());\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\n this._currentPointer.x = toCoord;\n this._currentPointer.markRedraw();\n var progressLine = this._progressLine;\n if (progressLine) {\n progressLine.shape.x2 = toCoord;\n progressLine.dirty();\n }\n var targetDataIndex = this._findNearestTick(toCoord);\n var timelineModel = this.model;\n if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) {\n this._changeTimeline(targetDataIndex);\n }\n };\n SliderTimelineView.prototype._doPlayStop = function () {\n var _this = this;\n this._clearTimer();\n if (this.model.getPlayState()) {\n this._timer = setTimeout(function () {\n // Do not cache\n var timelineModel = _this.model;\n _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1));\n }, this.model.get('playInterval'));\n }\n };\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\n var trans = this._mainGroup.getLocalTransform();\n return graphic.applyTransform(vertex, trans, true);\n };\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\n var data = this.model.getData();\n var dist = Infinity;\n var targetDataIndex;\n var axis = this._axis;\n data.each(['value'], function (value, dataIndex) {\n var coord = axis.dataToCoord(value);\n var d = Math.abs(coord - axisCoord);\n if (d < dist) {\n dist = d;\n targetDataIndex = dataIndex;\n }\n });\n return targetDataIndex;\n };\n SliderTimelineView.prototype._clearTimer = function () {\n if (this._timer) {\n clearTimeout(this._timer);\n this._timer = null;\n }\n };\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\n var currentIndex = this.model.getCurrentIndex();\n if (nextIndex === '+') {\n nextIndex = currentIndex + 1;\n } else if (nextIndex === '-') {\n nextIndex = currentIndex - 1;\n }\n this.api.dispatchAction({\n type: 'timelineChange',\n currentIndex: nextIndex,\n from: this.uid\n });\n };\n SliderTimelineView.prototype._updateTicksStatus = function () {\n var currentIndex = this.model.getCurrentIndex();\n var tickSymbols = this._tickSymbols;\n var tickLabels = this._tickLabels;\n if (tickSymbols) {\n for (var i = 0; i < tickSymbols.length; i++) {\n tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex);\n }\n }\n if (tickLabels) {\n for (var i = 0; i < tickLabels.length; i++) {\n tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\n }\n }\n };\n SliderTimelineView.type = 'timeline.slider';\n return SliderTimelineView;\n}(TimelineView);\nfunction createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n default:\n // default to be value\n return new IntervalScale();\n }\n }\n}\nfunction getViewRect(model, api) {\n return layout.getLayoutRect(model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n }, model.get('padding'));\n}\nfunction makeControlIcon(timelineModel, objPath, rect, opts) {\n var style = opts.style;\n var icon = graphic.createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3]));\n // TODO createIcon won't use style in opt.\n if (style) {\n icon.setStyle(style);\n }\n return icon;\n}\n/**\n * Create symbol or update symbol\n * opt: basic position and event handlers\n */\nfunction giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n var color = itemStyleModel.get('color');\n if (!symbol) {\n var symbolType = hostModel.get('symbol');\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\n symbol.setStyle('strokeNoScale', true);\n group.add(symbol);\n callback && callback.onCreate(symbol);\n } else {\n symbol.setColor(color);\n group.add(symbol); // Group may be new, also need to add.\n callback && callback.onUpdate(symbol);\n }\n // Style\n var itemStyle = itemStyleModel.getItemStyle(['color']);\n symbol.setStyle(itemStyle);\n // Transform and events.\n opt = merge({\n rectHover: true,\n z2: 100\n }, opt, true);\n var symbolSize = normalizeSymbolSize(hostModel.get('symbolSize'));\n opt.scaleX = symbolSize[0] / 2;\n opt.scaleY = symbolSize[1] / 2;\n var symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize);\n if (symbolOffset) {\n opt.x = (opt.x || 0) + symbolOffset[0];\n opt.y = (opt.y || 0) + symbolOffset[1];\n }\n var symbolRotate = hostModel.get('symbolRotate');\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n symbol.attr(opt);\n // FIXME\n // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n // getBoundingRect will return wrong result.\n // (This is supposed to be resolved in zrender, but it is a little difficult to\n // leverage performance and auto updateTransform)\n // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n symbol.updateTransform();\n return symbol;\n}\nfunction pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\n if (pointer.dragging) {\n return;\n }\n var pointerModel = timelineModel.getModel('checkpointStyle');\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\n if (noAnimation || !pointerModel.get('animation', true)) {\n pointer.attr({\n x: toCoord,\n y: 0\n });\n progressLine && progressLine.attr({\n shape: {\n x2: toCoord\n }\n });\n } else {\n var animationCfg = {\n duration: pointerModel.get('animationDuration', true),\n easing: pointerModel.get('animationEasing', true)\n };\n pointer.stopAnimation(null, true);\n pointer.animateTo({\n x: toCoord,\n y: 0\n }, animationCfg);\n progressLine && progressLine.animateTo({\n shape: {\n x2: toCoord\n }\n }, animationCfg);\n }\n}\nexport default SliderTimelineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { defaults } from 'zrender/lib/core/util.js';\nexport function installTimelineAction(registers) {\n registers.registerAction({\n type: 'timelineChange',\n event: 'timelineChanged',\n update: 'prepareAndUpdate'\n }, function (payload, ecModel, api) {\n var timelineModel = ecModel.getComponent('timeline');\n if (timelineModel && payload.currentIndex != null) {\n timelineModel.setCurrentIndex(payload.currentIndex);\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) {\n timelineModel.setPlayState(false);\n // The timeline has played to the end, trigger event\n api.dispatchAction({\n type: 'timelinePlayChange',\n playState: false,\n from: payload.from\n });\n }\n }\n // Set normalized currentIndex to payload.\n ecModel.resetOption('timeline', {\n replaceMerge: timelineModel.get('replaceMerge', true)\n });\n return defaults({\n currentIndex: timelineModel.option.currentIndex\n }, payload);\n });\n registers.registerAction({\n type: 'timelinePlayChange',\n event: 'timelinePlayChanged',\n update: 'update'\n }, function (payload, ecModel) {\n var timelineModel = ecModel.getComponent('timeline');\n if (timelineModel && payload.playState != null) {\n timelineModel.setPlayState(payload.playState);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function timelinePreprocessor(option) {\n var timelineOpt = option && option.timeline;\n if (!zrUtil.isArray(timelineOpt)) {\n timelineOpt = timelineOpt ? [timelineOpt] : [];\n }\n zrUtil.each(timelineOpt, function (opt) {\n if (!opt) {\n return;\n }\n compatibleEC2(opt);\n });\n}\nfunction compatibleEC2(opt) {\n var type = opt.type;\n var ec2Types = {\n 'number': 'value',\n 'time': 'time'\n };\n // Compatible with ec2\n if (ec2Types[type]) {\n opt.axisType = ec2Types[type];\n delete opt.type;\n }\n transferItem(opt);\n if (has(opt, 'controlPosition')) {\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\n if (!has(controlStyle, 'position')) {\n controlStyle.position = opt.controlPosition;\n }\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\n controlStyle.show = false;\n delete controlStyle.position;\n }\n delete opt.controlPosition;\n }\n zrUtil.each(opt.data || [], function (dataItem) {\n if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\n // In ec2, using name as value.\n dataItem.value = dataItem.name;\n }\n transferItem(dataItem);\n }\n });\n}\nfunction transferItem(opt) {\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});\n // Transfer label out\n var label = opt.label || opt.label || {};\n var labelNormal = label.normal || (label.normal = {});\n var excludeLabelAttr = {\n normal: 1,\n emphasis: 1\n };\n zrUtil.each(label, function (value, name) {\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\n labelNormal[name] = value;\n }\n });\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\n label.emphasis = itemStyleEmphasis.label;\n delete itemStyleEmphasis.label;\n }\n}\nfunction has(obj, attr) {\n return obj.hasOwnProperty(attr);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport SliderTimelineModel from './SliderTimelineModel.js';\nimport SliderTimelineView from './SliderTimelineView.js';\nimport { installTimelineAction } from './timelineAction.js';\nimport preprocessor from './preprocessor.js';\nexport function install(registers) {\n registers.registerComponentModel(SliderTimelineModel);\n registers.registerComponentView(SliderTimelineView);\n registers.registerSubTypeDefaulter('timeline', function () {\n // Only slider now.\n return 'slider';\n });\n installTimelineAction(registers);\n registers.registerPreprocessor(preprocessor);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nexport default function checkMarkerInSeries(seriesOpts, markerType) {\n if (!seriesOpts) {\n return false;\n }\n var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];\n for (var idx = 0; idx < seriesOptArr.length; idx++) {\n if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {\n return true;\n }\n }\n return false;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport ComponentModel from '../../model/Component.js';\nimport { makeInner, defaultEmphasis } from '../../util/model.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\nfunction fillLabel(opt) {\n defaultEmphasis(opt, 'label', ['show']);\n}\n// { [componentType]: MarkerModel }\nvar inner = makeInner();\nvar MarkerModel = /** @class */function (_super) {\n __extends(MarkerModel, _super);\n function MarkerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkerModel.type;\n /**\n * If marker model is created by self from series\n */\n _this.createdBySelf = false;\n return _this;\n }\n /**\n * @overrite\n */\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n if (this.type === 'marker') {\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\n }\n }\n this.mergeDefaultAndTheme(option, ecModel);\n this._mergeOption(option, ecModel, false, true);\n };\n MarkerModel.prototype.isAnimationEnabled = function () {\n if (env.node) {\n return false;\n }\n var hostSeries = this.__hostSeries;\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\n };\n /**\n * @overrite\n */\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\n this._mergeOption(newOpt, ecModel, false, false);\n };\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\n var componentType = this.mainType;\n if (!createdBySelf) {\n ecModel.eachSeries(function (seriesModel) {\n // mainType can be markPoint, markLine, markArea\n var markerOpt = seriesModel.get(this.mainType, true);\n var markerModel = inner(seriesModel)[componentType];\n if (!markerOpt || !markerOpt.data) {\n inner(seriesModel)[componentType] = null;\n return;\n }\n if (!markerModel) {\n if (isInit) {\n // Default label emphasis `position` and `show`\n fillLabel(markerOpt);\n }\n zrUtil.each(markerOpt.data, function (item) {\n // FIXME Overwrite fillLabel method ?\n if (item instanceof Array) {\n fillLabel(item[0]);\n fillLabel(item[1]);\n } else {\n fillLabel(item);\n }\n });\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);\n // markerModel = new ImplementedMarkerModel(\n // markerOpt, this, ecModel\n // );\n zrUtil.extend(markerModel, {\n mainType: this.mainType,\n // Use the same series index and name\n seriesIndex: seriesModel.seriesIndex,\n name: seriesModel.name,\n createdBySelf: true\n });\n markerModel.__hostSeries = seriesModel;\n } else {\n markerModel._mergeOption(markerOpt, ecModel, true);\n }\n inner(seriesModel)[componentType] = markerModel;\n }, this);\n }\n };\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var itemName = data.getName(dataIndex);\n return createTooltipMarkup('section', {\n header: this.name,\n blocks: [createTooltipMarkup('nameValue', {\n name: itemName,\n value: value,\n noName: !itemName,\n noValue: value == null\n })]\n });\n };\n MarkerModel.prototype.getData = function () {\n return this._data;\n };\n MarkerModel.prototype.setData = function (data) {\n this._data = data;\n };\n MarkerModel.prototype.getDataParams = function (dataIndex, dataType) {\n var params = DataFormatMixin.prototype.getDataParams.call(this, dataIndex, dataType);\n var hostSeries = this.__hostSeries;\n if (hostSeries) {\n params.seriesId = hostSeries.id;\n params.seriesName = hostSeries.name;\n params.seriesType = hostSeries.subType;\n }\n return params;\n };\n MarkerModel.getMarkerModelFromSeries = function (seriesModel,\n // Support three types of markers. Strict check.\n componentType) {\n return inner(seriesModel)[componentType];\n };\n MarkerModel.type = 'marker';\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\n return MarkerModel;\n}(ComponentModel);\nzrUtil.mixin(MarkerModel, DataFormatMixin.prototype);\nexport default MarkerModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\nvar MarkPointModel = /** @class */function (_super) {\n __extends(MarkPointModel, _super);\n function MarkPointModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkPointModel.type;\n return _this;\n }\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\n };\n MarkPointModel.type = 'markPoint';\n MarkPointModel.defaultOption = {\n // zlevel: 0,\n z: 5,\n symbol: 'pin',\n symbolSize: 50,\n // symbolRotate: 0,\n // symbolOffset: [0, 0]\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'inside'\n },\n itemStyle: {\n borderWidth: 2\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return MarkPointModel;\n}(MarkerModel);\nexport default MarkPointModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as numberUtil from '../../util/number.js';\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { indexOf, curry, clone, isArray } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\nfunction hasXOrY(item) {\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\n}\nfunction hasXAndY(item) {\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\n}\nfunction markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\n var coordArr = [];\n var stacked = isDimensionStacked(data, targetDataDim /* , otherDataDim */);\n var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim;\n var value = numCalculate(data, calcDataDim, markerType);\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\n var coordArrValue = data.get(targetDataDim, dataIndex);\n // Make it simple, do not visit all stacked value to count precision.\n var precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));\n precision = Math.min(precision, 20);\n if (precision >= 0) {\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\n }\n return [coordArr, coordArrValue];\n}\n// TODO Specified percent\nvar markerTypeCalculator = {\n min: curry(markerTypeCalculatorWithExtent, 'min'),\n max: curry(markerTypeCalculatorWithExtent, 'max'),\n average: curry(markerTypeCalculatorWithExtent, 'average'),\n median: curry(markerTypeCalculatorWithExtent, 'median')\n};\n/**\n * Transform markPoint data item to format used in List by do the following\n * 1. Calculate statistic like `max`, `min`, `average`\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\n */\nexport function dataTransform(seriesModel, item) {\n if (!item) {\n return;\n }\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dims = coordSys && coordSys.dimensions;\n // 1. If not specify the position with pixel directly\n // 2. If `coord` is not a data array. Which uses `xAxis`,\n // `yAxis` to specify the coord on each dimension\n // parseFloat first because item.x and item.y can be percent string like '20%'\n if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) {\n var axisInfo = getAxisInfo(item, data, coordSys, seriesModel);\n // Clone the option\n // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\n item = clone(item);\n if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\n item.coord = coordInfo[0];\n // Force to use the value of calculated value.\n // let item use the value without stack.\n item.value = coordInfo[1];\n } else {\n // FIXME Only has one of xAxis and yAxis.\n item.coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis];\n }\n }\n // x y is provided\n if (item.coord == null || !isArray(dims)) {\n item.coord = [];\n } else {\n // Each coord support max, min, average\n var coord = item.coord;\n for (var i = 0; i < 2; i++) {\n if (markerTypeCalculator[coord[i]]) {\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\n }\n }\n }\n return item;\n}\nexport function getAxisInfo(item, data, coordSys, seriesModel) {\n var ret = {};\n if (item.valueIndex != null || item.valueDim != null) {\n ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n } else {\n ret.baseAxis = seriesModel.getBaseAxis();\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\n }\n return ret;\n}\nfunction dataDimToCoordDim(seriesModel, dataDim) {\n var dimItem = seriesModel.getData().getDimensionInfo(dataDim);\n return dimItem && dimItem.coordDim;\n}\n/**\n * Filter data which is out of coordinateSystem range\n * [dataFilter description]\n */\nexport function dataFilter(\n// Currently only polar and cartesian has containData.\ncoordSys, item) {\n // Always return true if there is no coordSys\n return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;\n}\nexport function zoneFilter(\n// Currently only polar and cartesian has containData.\ncoordSys, item1, item2) {\n // Always return true if there is no coordSys\n return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true;\n}\nexport function createMarkerDimValueGetter(inCoordSys, dims) {\n return inCoordSys ? function (item, dimName, dataIndex, dimIndex) {\n var rawVal = dimIndex < 2\n // x, y, radius, angle\n ? item.coord && item.coord[dimIndex] : item.value;\n return parseDataValue(rawVal, dims[dimIndex]);\n } : function (item, dimName, dataIndex, dimIndex) {\n return parseDataValue(item.value, dims[dimIndex]);\n };\n}\nexport function numCalculate(data, valueDataDim, type) {\n if (type === 'average') {\n var sum_1 = 0;\n var count_1 = 0;\n data.each(valueDataDim, function (val, idx) {\n if (!isNaN(val)) {\n sum_1 += val;\n count_1++;\n }\n });\n return sum_1 / count_1;\n } else if (type === 'median') {\n return data.getMedian(valueDataDim);\n } else {\n // max & min\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { enterBlur, leaveBlur } from '../../util/states.js';\nvar inner = makeInner();\nvar MarkerView = /** @class */function (_super) {\n __extends(MarkerView, _super);\n function MarkerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkerView.type;\n return _this;\n }\n MarkerView.prototype.init = function () {\n this.markerGroupMap = createHashMap();\n };\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\n var _this = this;\n var markerGroupMap = this.markerGroupMap;\n markerGroupMap.each(function (item) {\n inner(item).keep = false;\n });\n ecModel.eachSeries(function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\n });\n markerGroupMap.each(function (item) {\n !inner(item).keep && _this.group.remove(item.group);\n });\n };\n MarkerView.prototype.markKeep = function (drawGroup) {\n inner(drawGroup).keep = true;\n };\n MarkerView.prototype.toggleBlurSeries = function (seriesModelList, isBlur) {\n var _this = this;\n each(seriesModelList, function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n if (markerModel) {\n var data = markerModel.getData();\n data.eachItemGraphicEl(function (el) {\n if (el) {\n isBlur ? enterBlur(el) : leaveBlur(el);\n }\n });\n }\n });\n };\n MarkerView.type = 'marker';\n return MarkerView;\n}(ComponentView);\nexport default MarkerView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../../chart/helper/SymbolDraw.js';\nimport * as numberUtil from '../../util/number.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isFunction, map, filter, curry, extend } from 'zrender/lib/core/util.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nfunction updateMarkerLayout(mpData, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n }\n // Chart like bar may have there own marker positioning logic\n else if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\n } else if (coordSys) {\n var x = mpData.get(coordSys.dimensions[0], idx);\n var y = mpData.get(coordSys.dimensions[1], idx);\n point = coordSys.dataToPoint([x, y]);\n }\n // Use x, y if has any\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n mpData.setItemLayout(idx, point);\n });\n}\nvar MarkPointView = /** @class */function (_super) {\n __extends(MarkPointView, _super);\n function MarkPointView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkPointView.type;\n return _this;\n }\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\n if (mpModel) {\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var symbolDrawMap = this.markerGroupMap;\n var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw());\n var mpData = createData(coordSys, seriesModel, mpModel);\n // FIXME\n mpModel.setData(mpData);\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var symbol = itemModel.getShallow('symbol');\n var symbolSize = itemModel.getShallow('symbolSize');\n var symbolRotate = itemModel.getShallow('symbolRotate');\n var symbolOffset = itemModel.getShallow('symbolOffset');\n var symbolKeepAspect = itemModel.getShallow('symbolKeepAspect');\n // TODO: refactor needed: single data item should not support callback function\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {\n var rawIdx = mpModel.getRawValue(idx);\n var dataParams = mpModel.getDataParams(idx);\n if (isFunction(symbol)) {\n symbol = symbol(rawIdx, dataParams);\n }\n if (isFunction(symbolSize)) {\n // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?\n symbolSize = symbolSize(rawIdx, dataParams);\n }\n if (isFunction(symbolRotate)) {\n symbolRotate = symbolRotate(rawIdx, dataParams);\n }\n if (isFunction(symbolOffset)) {\n symbolOffset = symbolOffset(rawIdx, dataParams);\n }\n }\n var style = itemModel.getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n if (!style.fill) {\n style.fill = color;\n }\n mpData.setItemVisual(idx, {\n symbol: symbol,\n symbolSize: symbolSize,\n symbolRotate: symbolRotate,\n symbolOffset: symbolOffset,\n symbolKeepAspect: symbolKeepAspect,\n style: style\n });\n });\n // TODO Text are wrong\n symbolDraw.updateData(mpData);\n this.group.add(symbolDraw.group);\n // Set host model for tooltip\n // FIXME\n mpData.eachItemGraphicEl(function (el) {\n el.traverse(function (child) {\n getECData(child).dataModel = mpModel;\n });\n });\n this.markKeep(symbolDraw);\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\n };\n MarkPointView.type = 'markPoint';\n return MarkPointView;\n}(MarkerView);\nfunction createData(coordSys, seriesModel, mpModel) {\n var coordDimsInfos;\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\n // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n var mpData = new SeriesData(coordDimsInfos, mpModel);\n var dataOpt = map(mpModel.get('data'), curry(markerHelper.dataTransform, seriesModel));\n if (coordSys) {\n dataOpt = filter(dataOpt, curry(markerHelper.dataFilter, coordSys));\n }\n var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n mpData.initData(dataOpt, null, dimValueGetter);\n return mpData;\n}\nexport default MarkPointView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkPointModel from './MarkPointModel.js';\nimport MarkPointView from './MarkPointView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkPointModel);\n registers.registerComponentView(MarkPointView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markPoint')) {\n // Make sure markPoint component is enabled\n opt.markPoint = opt.markPoint || {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\nvar MarkLineModel = /** @class */function (_super) {\n __extends(MarkLineModel, _super);\n function MarkLineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkLineModel.type;\n return _this;\n }\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\n };\n MarkLineModel.type = 'markLine';\n MarkLineModel.defaultOption = {\n // zlevel: 0,\n z: 5,\n symbol: ['circle', 'arrow'],\n symbolSize: [8, 16],\n // symbolRotate: 0,\n symbolOffset: 0,\n precision: 2,\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'end',\n distance: 5\n },\n lineStyle: {\n type: 'dashed'\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n width: 3\n }\n },\n animationEasing: 'linear'\n };\n return MarkLineModel;\n}(MarkerModel);\nexport default MarkLineModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as markerHelper from './markerHelper.js';\nimport LineDraw from '../../chart/helper/LineDraw.js';\nimport MarkerView from './MarkerView.js';\nimport { getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getECData } from '../../util/innerStore.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isArray, retrieve, retrieve2, clone, extend, logError, merge, map, curry, filter, isNumber } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nvar inner = makeInner();\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\n var data = seriesModel.getData();\n var itemArray;\n if (!isArray(item)) {\n // Special type markLine like 'min', 'max', 'average', 'median'\n var mlType = item.type;\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\n // In case\n // data: [{\n // yAxis: 10\n // }]\n || item.xAxis != null || item.yAxis != null) {\n var valueAxis = void 0;\n var value = void 0;\n if (item.yAxis != null || item.xAxis != null) {\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\n value = retrieve(item.yAxis, item.xAxis);\n } else {\n var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);\n valueAxis = axisInfo.valueAxis;\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\n value = markerHelper.numCalculate(data, valueDataDim, mlType);\n }\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\n var baseIndex = 1 - valueIndex;\n // Normized to 2d data with start and end point\n var mlFrom = clone(item);\n var mlTo = {\n coord: []\n };\n mlFrom.type = null;\n mlFrom.coord = [];\n mlFrom.coord[baseIndex] = -Infinity;\n mlTo.coord[baseIndex] = Infinity;\n var precision = mlModel.get('precision');\n if (precision >= 0 && isNumber(value)) {\n value = +value.toFixed(Math.min(precision, 20));\n }\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\n itemArray = [mlFrom, mlTo, {\n type: mlType,\n valueIndex: item.valueIndex,\n // Force to use the value of calculated value.\n value: value\n }];\n } else {\n // Invalid data\n if (process.env.NODE_ENV !== 'production') {\n logError('Invalid markLine data.');\n }\n itemArray = [];\n }\n } else {\n itemArray = item;\n }\n var normalizedItem = [markerHelper.dataTransform(seriesModel, itemArray[0]), markerHelper.dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])];\n // Avoid line data type is extended by from(to) data type\n normalizedItem[2].type = normalizedItem[2].type || null;\n // Merge from option and to option into line option\n merge(normalizedItem[2], normalizedItem[0]);\n merge(normalizedItem[2], normalizedItem[1]);\n return normalizedItem;\n};\nfunction isInfinity(val) {\n return !isNaN(val) && !isFinite(val);\n}\n// If a markLine has one dim\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n var dimName = coordSys.dimensions[dimIndex];\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\n}\nfunction markLineFilter(coordSys, item) {\n if (coordSys.type === 'cartesian2d') {\n var fromCoord = item[0].coord;\n var toCoord = item[1].coord;\n // In case\n // {\n // markLine: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n }\n }\n return markerHelper.dataFilter(coordSys, item[0]) && markerHelper.dataFilter(coordSys, item[1]);\n}\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\n } else {\n var dims = coordSys.dimensions;\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n point = coordSys.dataToPoint([x, y]);\n }\n // Expand line to the edge of grid if value on one axis is Inifnity\n // In case\n // markLine: {\n // data: [{\n // yAxis: 2\n // // or\n // type: 'average'\n // }]\n // }\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var dims = coordSys.dimensions;\n if (isInfinity(data.get(dims[0], idx))) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\n } else if (isInfinity(data.get(dims[1], idx))) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\n }\n }\n // Use x, y if has any\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n data.setItemLayout(idx, point);\n}\nvar MarkLineView = /** @class */function (_super) {\n __extends(MarkLineView, _super);\n function MarkLineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkLineView.type;\n return _this;\n }\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\n if (mlModel) {\n var mlData_1 = mlModel.getData();\n var fromData_1 = inner(mlModel).from;\n var toData_1 = inner(mlModel).to;\n // Update visual and layout of from symbol and to symbol\n fromData_1.each(function (idx) {\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\n });\n // Update layout of line\n mlData_1.each(function (idx) {\n mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);\n });\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var lineDrawMap = this.markerGroupMap;\n var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw());\n this.group.add(lineDraw.group);\n var mlData = createList(coordSys, seriesModel, mlModel);\n var fromData = mlData.from;\n var toData = mlData.to;\n var lineData = mlData.line;\n inner(mlModel).from = fromData;\n inner(mlModel).to = toData;\n // Line data for tooltip and formatter\n mlModel.setData(lineData);\n // TODO\n // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.\n // But the related logic and type definition are not finished yet.\n // Finish it if required\n var symbolType = mlModel.get('symbol');\n var symbolSize = mlModel.get('symbolSize');\n var symbolRotate = mlModel.get('symbolRotate');\n var symbolOffset = mlModel.get('symbolOffset');\n // TODO: support callback function like markPoint\n if (!isArray(symbolType)) {\n symbolType = [symbolType, symbolType];\n }\n if (!isArray(symbolSize)) {\n symbolSize = [symbolSize, symbolSize];\n }\n if (!isArray(symbolRotate)) {\n symbolRotate = [symbolRotate, symbolRotate];\n }\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n // Update visual and layout of from symbol and to symbol\n mlData.from.each(function (idx) {\n updateDataVisualAndLayout(fromData, idx, true);\n updateDataVisualAndLayout(toData, idx, false);\n });\n // Update visual and layout of line\n lineData.each(function (idx) {\n var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle();\n // lineData.setItemVisual(idx, {\n // color: lineColor || fromData.getItemVisual(idx, 'color')\n // });\n lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);\n if (lineStyle.stroke == null) {\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\n }\n lineData.setItemVisual(idx, {\n fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'),\n fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'),\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\n toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'),\n toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'),\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\n toSymbol: toData.getItemVisual(idx, 'symbol'),\n style: lineStyle\n });\n });\n lineDraw.updateData(lineData);\n // Set host model for tooltip\n // FIXME\n mlData.line.eachItemGraphicEl(function (el) {\n getECData(el).dataModel = mlModel;\n el.traverse(function (child) {\n getECData(child).dataModel = mlModel;\n });\n });\n function updateDataVisualAndLayout(data, idx, isFrom) {\n var itemModel = data.getItemModel(idx);\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n if (style.fill == null) {\n style.fill = getVisualFromData(seriesData, 'color');\n }\n data.setItemVisual(idx, {\n symbolKeepAspect: itemModel.get('symbolKeepAspect'),\n // `0` should be considered as a valid value, so use `retrieve2` instead of `||`\n symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]),\n symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]),\n // TODO: when 2d array is supported, it should ignore parent\n symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]),\n symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]),\n style: style\n });\n }\n this.markKeep(lineDraw);\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\n };\n MarkLineView.type = 'markLine';\n return MarkLineView;\n}(MarkerView);\nfunction createList(coordSys, seriesModel, mlModel) {\n var coordDimsInfos;\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};\n // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n var fromData = new SeriesData(coordDimsInfos, mlModel);\n var toData = new SeriesData(coordDimsInfos, mlModel);\n // No dimensions\n var lineData = new SeriesData([], mlModel);\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\n if (coordSys) {\n optData = filter(optData, curry(markLineFilter, coordSys));\n }\n var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n fromData.initData(map(optData, function (item) {\n return item[0];\n }), null, dimValueGetter);\n toData.initData(map(optData, function (item) {\n return item[1];\n }), null, dimValueGetter);\n lineData.initData(map(optData, function (item) {\n return item[2];\n }));\n lineData.hasItemOption = true;\n return {\n from: fromData,\n to: toData,\n line: lineData\n };\n}\nexport default MarkLineView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkLineModel from './MarkLineModel.js';\nimport MarkLineView from './MarkLineView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkLineModel);\n registers.registerComponentView(MarkLineView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markLine')) {\n // Make sure markLine component is enabled\n opt.markLine = opt.markLine || {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\nvar MarkAreaModel = /** @class */function (_super) {\n __extends(MarkAreaModel, _super);\n function MarkAreaModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkAreaModel.type;\n return _this;\n }\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\n };\n MarkAreaModel.type = 'markArea';\n MarkAreaModel.defaultOption = {\n // zlevel: 0,\n // PENDING\n z: 1,\n tooltip: {\n trigger: 'item'\n },\n // markArea should fixed on the coordinate system\n animation: false,\n label: {\n show: true,\n position: 'top'\n },\n itemStyle: {\n // color and borderColor default to use color from series\n // color: 'auto'\n // borderColor: 'auto'\n borderWidth: 0\n },\n emphasis: {\n label: {\n show: true,\n position: 'top'\n }\n }\n };\n return MarkAreaModel;\n}(MarkerModel);\nexport default MarkAreaModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n// TODO Optimize on polar\nimport * as colorUtil from 'zrender/lib/tool/color.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport { retrieve, mergeAll, map, curry, filter, extend, isString } from 'zrender/lib/core/util.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\nvar inner = makeInner();\nvar markAreaTransform = function (seriesModel, coordSys, maModel, item) {\n // item may be null\n var item0 = item[0];\n var item1 = item[1];\n if (!item0 || !item1) {\n return;\n }\n var lt = markerHelper.dataTransform(seriesModel, item0);\n var rb = markerHelper.dataTransform(seriesModel, item1);\n // FIXME make sure lt is less than rb\n var ltCoord = lt.coord;\n var rbCoord = rb.coord;\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\n // Merge option into one\n var result = mergeAll([{}, lt, rb]);\n result.coord = [lt.coord, rb.coord];\n result.x0 = lt.x;\n result.y0 = lt.y;\n result.x1 = rb.x;\n result.y1 = rb.y;\n return result;\n};\nfunction isInfinity(val) {\n return !isNaN(val) && !isFinite(val);\n}\n// If a markArea has one dim\nfunction ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]);\n}\nfunction markAreaFilter(coordSys, item) {\n var fromCoord = item.coord[0];\n var toCoord = item.coord[1];\n var item0 = {\n coord: fromCoord,\n x: item.x0,\n y: item.y0\n };\n var item1 = {\n coord: toCoord,\n x: item.x1,\n y: item.y1\n };\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // In case\n // {\n // markArea: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n }\n // Directly returning true may also do the work,\n // because markArea will not be shown automatically\n // when it's not included in coordinate system.\n // But filtering ahead can avoid keeping rendering markArea\n // when there are too many of them.\n return markerHelper.zoneFilter(coordSys, item0, item1);\n }\n return markerHelper.dataFilter(coordSys, item0) || markerHelper.dataFilter(coordSys, item1);\n}\n// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\nfunction getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get(dims[0]), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get(dims[1]), api.getHeight());\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Consider the case that user input the right-bottom point first\n // Pick the larger x and y as 'x1' and 'y1'\n var pointValue0 = data.getValues(['x0', 'y0'], idx);\n var pointValue1 = data.getValues(['x1', 'y1'], idx);\n var clampPointValue0 = coordSys.clampData(pointValue0);\n var clampPointValue1 = coordSys.clampData(pointValue1);\n var pointValue = [];\n if (dims[0] === 'x0') {\n pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue1[0] : pointValue0[0];\n } else {\n pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue0[0] : pointValue1[0];\n }\n if (dims[1] === 'y0') {\n pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue1[1] : pointValue0[1];\n } else {\n pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue0[1] : pointValue1[1];\n }\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(pointValue, dims, true);\n } else {\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n var pt = [x, y];\n coordSys.clampData && coordSys.clampData(pt, pt);\n point = coordSys.dataToPoint(pt, true);\n }\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n if (isInfinity(x)) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\n } else if (isInfinity(y)) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\n }\n }\n // Use x, y if has any\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n return point;\n}\nexport var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\nvar MarkAreaView = /** @class */function (_super) {\n __extends(MarkAreaView, _super);\n function MarkAreaView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = MarkAreaView.type;\n return _this;\n }\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\n if (maModel) {\n var areaData_1 = maModel.getData();\n areaData_1.each(function (idx) {\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\n });\n // Layout\n areaData_1.setItemLayout(idx, points);\n var el = areaData_1.getItemGraphicEl(idx);\n el.setShape('points', points);\n });\n }\n }, this);\n };\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var areaGroupMap = this.markerGroupMap;\n var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {\n group: new graphic.Group()\n });\n this.group.add(polygonGroup.group);\n this.markKeep(polygonGroup);\n var areaData = createList(coordSys, seriesModel, maModel);\n // Line data for tooltip and formatter\n maModel.setData(areaData);\n // Update visual and layout of line\n areaData.each(function (idx) {\n // Layout\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\n });\n var xAxisScale = coordSys.getAxis('x').scale;\n var yAxisScale = coordSys.getAxis('y').scale;\n var xAxisExtent = xAxisScale.getExtent();\n var yAxisExtent = yAxisScale.getExtent();\n var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))];\n var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))];\n numberUtil.asc(xPointExtent);\n numberUtil.asc(yPointExtent);\n var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]);\n // If none of the area is inside coordSys, allClipped is set to be true\n // in layout so that label will not be displayed. See #12591\n var allClipped = !overlapped;\n areaData.setItemLayout(idx, {\n points: points,\n allClipped: allClipped\n });\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n if (!style.fill) {\n style.fill = color;\n if (isString(style.fill)) {\n style.fill = colorUtil.modifyAlpha(style.fill, 0.4);\n }\n }\n if (!style.stroke) {\n style.stroke = color;\n }\n // Visual\n areaData.setItemVisual(idx, 'style', style);\n });\n areaData.diff(inner(polygonGroup).data).add(function (idx) {\n var layout = areaData.getItemLayout(idx);\n if (!layout.allClipped) {\n var polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n areaData.setItemGraphicEl(idx, polygon);\n polygonGroup.group.add(polygon);\n }\n }).update(function (newIdx, oldIdx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(oldIdx);\n var layout = areaData.getItemLayout(newIdx);\n if (!layout.allClipped) {\n if (polygon) {\n graphic.updateProps(polygon, {\n shape: {\n points: layout.points\n }\n }, maModel, newIdx);\n } else {\n polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n }\n areaData.setItemGraphicEl(newIdx, polygon);\n polygonGroup.group.add(polygon);\n } else if (polygon) {\n polygonGroup.group.remove(polygon);\n }\n }).remove(function (idx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(idx);\n polygonGroup.group.remove(polygon);\n }).execute();\n areaData.eachItemGraphicEl(function (polygon, idx) {\n var itemModel = areaData.getItemModel(idx);\n var style = areaData.getItemVisual(idx, 'style');\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\n labelFetcher: maModel,\n labelDataIndex: idx,\n defaultText: areaData.getName(idx) || '',\n inheritColor: isString(style.fill) ? colorUtil.modifyAlpha(style.fill, 1) : '#000'\n });\n setStatesStylesFromModel(polygon, itemModel);\n toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled']));\n getECData(polygon).dataModel = maModel;\n });\n inner(polygonGroup).data = areaData;\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\n };\n MarkAreaView.type = 'markArea';\n return MarkAreaView;\n}(MarkerView);\nfunction createList(coordSys, seriesModel, maModel) {\n var areaData;\n var dataDims;\n var dims = ['x0', 'y0', 'x1', 'y1'];\n if (coordSys) {\n var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function (coordDim) {\n var data = seriesModel.getData();\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};\n // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n dataDims = map(dims, function (dim, idx) {\n return {\n name: dim,\n type: coordDimsInfos_1[idx % 2].type\n };\n });\n areaData = new SeriesData(dataDims, maModel);\n } else {\n dataDims = [{\n name: 'value',\n type: 'float'\n }];\n areaData = new SeriesData(dataDims, maModel);\n }\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\n if (coordSys) {\n optData = filter(optData, curry(markAreaFilter, coordSys));\n }\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\n // TODO should convert to ParsedValue?\n var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\n return parseDataValue(rawVal, dataDims[dimIndex]);\n } : function (item, dimName, dataIndex, dimIndex) {\n return parseDataValue(item.value, dataDims[dimIndex]);\n };\n areaData.initData(optData, null, dimValueGetter);\n areaData.hasItemOption = true;\n return areaData;\n}\nexport default MarkAreaView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkAreaModel from './MarkAreaModel.js';\nimport MarkAreaView from './MarkAreaView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkAreaModel);\n registers.registerComponentView(MarkAreaView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markArea')) {\n // Make sure markArea component is enabled\n opt.markArea = opt.markArea || {};\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../../model/Model.js';\nimport { isNameSpecified } from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nvar getDefaultSelectorOptions = function (ecModel, type) {\n if (type === 'all') {\n return {\n type: 'all',\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'all'])\n };\n } else if (type === 'inverse') {\n return {\n type: 'inverse',\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse'])\n };\n }\n};\nvar LegendModel = /** @class */function (_super) {\n __extends(LegendModel, _super);\n function LegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = LegendModel.type;\n _this.layoutMode = {\n type: 'box',\n // legend.width/height are maxWidth/maxHeight actually,\n // whereas real width/height is calculated by its content.\n // (Setting {left: 10, right: 10} does not make sense).\n // So consider the case:\n // `setOption({legend: {left: 10});`\n // then `setOption({legend: {right: 10});`\n // The previous `left` should be cleared by setting `ignoreSize`.\n ignoreSize: true\n };\n return _this;\n }\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n option.selected = option.selected || {};\n this._updateSelector(option);\n };\n LegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n this._updateSelector(option);\n };\n LegendModel.prototype._updateSelector = function (option) {\n var selector = option.selector;\n var ecModel = this.ecModel;\n if (selector === true) {\n selector = option.selector = ['all', 'inverse'];\n }\n if (zrUtil.isArray(selector)) {\n zrUtil.each(selector, function (item, index) {\n zrUtil.isString(item) && (item = {\n type: item\n });\n selector[index] = zrUtil.merge(item, getDefaultSelectorOptions(ecModel, item.type));\n });\n }\n };\n LegendModel.prototype.optionUpdated = function () {\n this._updateData(this.ecModel);\n var legendData = this._data;\n // If selectedMode is single, try to select one\n if (legendData[0] && this.get('selectedMode') === 'single') {\n var hasSelected = false;\n // If has any selected in option.selected\n for (var i = 0; i < legendData.length; i++) {\n var name_1 = legendData[i].get('name');\n if (this.isSelected(name_1)) {\n // Force to unselect others\n this.select(name_1);\n hasSelected = true;\n break;\n }\n }\n // Try select the first if selectedMode is single\n !hasSelected && this.select(legendData[0].get('name'));\n }\n };\n LegendModel.prototype._updateData = function (ecModel) {\n var potentialData = [];\n var availableNames = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var seriesName = seriesModel.name;\n availableNames.push(seriesName);\n var isPotential;\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n var names = provider.getAllNames();\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n availableNames = availableNames.concat(names);\n }\n if (names.length) {\n potentialData = potentialData.concat(names);\n } else {\n isPotential = true;\n }\n } else {\n isPotential = true;\n }\n if (isPotential && isNameSpecified(seriesModel)) {\n potentialData.push(seriesModel.name);\n }\n });\n /**\n * @type {Array.}\n * @private\n */\n this._availableNames = availableNames;\n // If legend.data is not specified in option, use availableNames as data,\n // which is convenient for user preparing option.\n var rawData = this.get('data') || potentialData;\n var legendNameMap = zrUtil.createHashMap();\n var legendData = zrUtil.map(rawData, function (dataItem) {\n // Can be string or number\n if (zrUtil.isString(dataItem) || zrUtil.isNumber(dataItem)) {\n dataItem = {\n name: dataItem\n };\n }\n if (legendNameMap.get(dataItem.name)) {\n // remove legend name duplicate\n return null;\n }\n legendNameMap.set(dataItem.name, true);\n return new Model(dataItem, this, this.ecModel);\n }, this);\n /**\n * @type {Array.}\n * @private\n */\n this._data = zrUtil.filter(legendData, function (item) {\n return !!item;\n });\n };\n LegendModel.prototype.getData = function () {\n return this._data;\n };\n LegendModel.prototype.select = function (name) {\n var selected = this.option.selected;\n var selectedMode = this.get('selectedMode');\n if (selectedMode === 'single') {\n var data = this._data;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name')] = false;\n });\n }\n selected[name] = true;\n };\n LegendModel.prototype.unSelect = function (name) {\n if (this.get('selectedMode') !== 'single') {\n this.option.selected[name] = false;\n }\n };\n LegendModel.prototype.toggleSelected = function (name) {\n var selected = this.option.selected;\n // Default is true\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n this[selected[name] ? 'unSelect' : 'select'](name);\n };\n LegendModel.prototype.allSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name', true)] = true;\n });\n };\n LegendModel.prototype.inverseSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n var name = dataItem.get('name', true);\n // Initially, default value is true\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n selected[name] = !selected[name];\n });\n };\n LegendModel.prototype.isSelected = function (name) {\n var selected = this.option.selected;\n return !(selected.hasOwnProperty(name) && !selected[name]) && zrUtil.indexOf(this._availableNames, name) >= 0;\n };\n LegendModel.prototype.getOrient = function () {\n return this.get('orient') === 'vertical' ? {\n index: 1,\n name: 'vertical'\n } : {\n index: 0,\n name: 'horizontal'\n };\n };\n LegendModel.type = 'legend.plain';\n LegendModel.dependencies = ['series'];\n LegendModel.defaultOption = {\n // zlevel: 0,\n z: 4,\n show: true,\n orient: 'horizontal',\n left: 'center',\n // right: 'center',\n top: 0,\n // bottom: null,\n align: 'auto',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n itemWidth: 25,\n itemHeight: 14,\n symbolRotate: 'inherit',\n symbolKeepAspect: true,\n inactiveColor: '#ccc',\n inactiveBorderColor: '#ccc',\n inactiveBorderWidth: 'auto',\n itemStyle: {\n color: 'inherit',\n opacity: 'inherit',\n borderColor: 'inherit',\n borderWidth: 'auto',\n borderCap: 'inherit',\n borderJoin: 'inherit',\n borderDashOffset: 'inherit',\n borderMiterLimit: 'inherit'\n },\n lineStyle: {\n width: 'auto',\n color: 'inherit',\n inactiveColor: '#ccc',\n inactiveWidth: 2,\n opacity: 'inherit',\n type: 'inherit',\n cap: 'inherit',\n join: 'inherit',\n dashOffset: 'inherit',\n miterLimit: 'inherit'\n },\n textStyle: {\n color: '#333'\n },\n selectedMode: true,\n selector: false,\n selectorLabel: {\n show: true,\n borderRadius: 10,\n padding: [3, 5, 3, 5],\n fontSize: 12,\n fontFamily: 'sans-serif',\n color: '#666',\n borderWidth: 1,\n borderColor: '#666'\n },\n emphasis: {\n selectorLabel: {\n show: true,\n color: '#eee',\n backgroundColor: '#666'\n }\n },\n selectorPosition: 'auto',\n selectorItemGap: 7,\n selectorButtonGap: 10,\n tooltip: {\n show: false\n }\n };\n return LegendModel;\n}(ComponentModel);\nexport default LegendModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parse, stringify } from 'zrender/lib/tool/color.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle.js';\nimport { makeBackground } from '../helper/listComponent.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport ComponentView from '../../view/Component.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { getECData } from '../../util/innerStore.js';\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\nvar LegendView = /** @class */function (_super) {\n __extends(LegendView, _super);\n function LegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = LegendView.type;\n _this.newlineDisabled = false;\n return _this;\n }\n LegendView.prototype.init = function () {\n this.group.add(this._contentGroup = new Group());\n this.group.add(this._selectorGroup = new Group());\n this._isFirstRender = true;\n };\n /**\n * @protected\n */\n LegendView.prototype.getContentGroup = function () {\n return this._contentGroup;\n };\n /**\n * @protected\n */\n LegendView.prototype.getSelectorGroup = function () {\n return this._selectorGroup;\n };\n /**\n * @override\n */\n LegendView.prototype.render = function (legendModel, ecModel, api) {\n var isFirstRender = this._isFirstRender;\n this._isFirstRender = false;\n this.resetInner();\n if (!legendModel.get('show', true)) {\n return;\n }\n var itemAlign = legendModel.get('align');\n var orient = legendModel.get('orient');\n if (!itemAlign || itemAlign === 'auto') {\n itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left';\n }\n // selector has been normalized to an array in model\n var selector = legendModel.get('selector', true);\n var selectorPosition = legendModel.get('selectorPosition', true);\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\n }\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\n // Perform layout.\n var positionInfo = legendModel.getBoxLayoutParams();\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var padding = legendModel.get('padding');\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\n // Place mainGroup, based on the calculated `mainRect`.\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n width: mainRect.width,\n height: mainRect.height\n }, positionInfo), viewportSize, padding);\n this.group.x = layoutRect.x - mainRect.x;\n this.group.y = layoutRect.y - mainRect.y;\n this.group.markRedraw();\n // Render background after group is layout.\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\n };\n LegendView.prototype.resetInner = function () {\n this.getContentGroup().removeAll();\n this._backgroundEl && this.group.remove(this._backgroundEl);\n this.getSelectorGroup().removeAll();\n };\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var legendDrawnMap = zrUtil.createHashMap();\n var selectMode = legendModel.get('selectedMode');\n var excludeSeriesId = [];\n ecModel.eachRawSeries(function (seriesModel) {\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n });\n each(legendModel.getData(), function (legendItemModel, dataIndex) {\n var name = legendItemModel.get('name');\n // Use empty string or \\n as a newline string\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n var g = new Group();\n // @ts-ignore\n g.newline = true;\n contentGroup.add(g);\n return;\n }\n // Representitive series.\n var seriesModel = ecModel.getSeriesByName(name)[0];\n if (legendDrawnMap.get(name)) {\n // Have been drawn\n return;\n }\n // Legend to control series.\n if (seriesModel) {\n var data = seriesModel.getData();\n var lineVisualStyle = data.getVisual('legendLineStyle') || {};\n var legendIcon = data.getVisual('legendIcon');\n /**\n * `data.getVisual('style')` may be the color from the register\n * in series. For example, for line series,\n */\n var style = data.getVisual('style');\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api);\n itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n if (ecModel.ssr) {\n itemGroup.eachChild(function (child) {\n var ecData = getECData(child);\n ecData.seriesIndex = seriesModel.seriesIndex;\n ecData.dataIndex = dataIndex;\n ecData.ssrType = 'legend';\n });\n }\n legendDrawnMap.set(name, true);\n } else {\n // Legend to control data. In pie and funnel.\n ecModel.eachRawSeries(function (seriesModel) {\n // In case multiple series has same data name\n if (legendDrawnMap.get(name)) {\n return;\n }\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n if (!provider.containName(name)) {\n return;\n }\n var idx = provider.indexOfName(name);\n var style = provider.getItemVisual(idx, 'style');\n var legendIcon = provider.getItemVisual(idx, 'legendIcon');\n var colorArr = parse(style.fill);\n // Color may be set to transparent in visualMap when data is out of range.\n // Do not show nothing.\n if (colorArr && colorArr[3] === 0) {\n colorArr[3] = 0.2;\n // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\n style = zrUtil.extend(zrUtil.extend({}, style), {\n fill: stringify(colorArr, 'rgba')\n });\n }\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode, api);\n // FIXME: consider different series has items with the same name.\n itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId))\n // Should not specify the series name, consider legend controls\n // more than one pie series.\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n if (ecModel.ssr) {\n itemGroup.eachChild(function (child) {\n var ecData = getECData(child);\n ecData.seriesIndex = seriesModel.seriesIndex;\n ecData.dataIndex = dataIndex;\n ecData.ssrType = 'legend';\n });\n }\n legendDrawnMap.set(name, true);\n }\n }, this);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!legendDrawnMap.get(name)) {\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\n }\n }\n }, this);\n if (selector) {\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\n }\n };\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n each(selector, function createSelectorButton(selectorItem) {\n var type = selectorItem.type;\n var labelText = new graphic.Text({\n style: {\n x: 0,\n y: 0,\n align: 'center',\n verticalAlign: 'middle'\n },\n onclick: function () {\n api.dispatchAction({\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\n });\n }\n });\n selectorGroup.add(labelText);\n var labelModel = legendModel.getModel('selectorLabel');\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\n setLabelStyle(labelText, {\n normal: labelModel,\n emphasis: emphasisLabelModel\n }, {\n defaultText: selectorItem.title\n });\n enableHoverEmphasis(labelText);\n });\n };\n LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api) {\n var drawType = seriesModel.visualDrawType;\n var itemWidth = legendModel.get('itemWidth');\n var itemHeight = legendModel.get('itemHeight');\n var isSelected = legendModel.isSelected(name);\n var iconRotate = legendItemModel.get('symbolRotate');\n var symbolKeepAspect = legendItemModel.get('symbolKeepAspect');\n var legendIconType = legendItemModel.get('icon');\n legendIcon = legendIconType || legendIcon || 'roundRect';\n var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api);\n var itemGroup = new Group();\n var textStyleModel = legendItemModel.getModel('textStyle');\n if (zrUtil.isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) {\n // Series has specific way to define legend icon\n itemGroup.add(seriesModel.getLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: iconRotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n } else {\n // Use default legend icon policy for most series\n var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon\n itemGroup.add(getDefaultLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: rotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n }\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n var textAlign = itemAlign;\n var formatter = legendModel.get('formatter');\n var content = name;\n if (zrUtil.isString(formatter) && formatter) {\n content = formatter.replace('{name}', name != null ? name : '');\n } else if (zrUtil.isFunction(formatter)) {\n content = formatter(name);\n }\n var textColor = isSelected ? textStyleModel.getTextColor() : legendItemModel.get('inactiveColor');\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: content,\n x: textX,\n y: itemHeight / 2,\n fill: textColor,\n align: textAlign,\n verticalAlign: 'middle'\n }, {\n inheritColor: textColor\n })\n }));\n // Add a invisible rect to increase the area of mouse hover\n var hitRect = new graphic.Rect({\n shape: itemGroup.getBoundingRect(),\n style: {\n // Cannot use 'invisible' because SVG SSR will miss the node\n fill: 'transparent'\n }\n });\n var tooltipModel = legendItemModel.getModel('tooltip');\n if (tooltipModel.get('show')) {\n graphic.setTooltipConfig({\n el: hitRect,\n componentModel: legendModel,\n itemName: name,\n itemTooltipOption: tooltipModel.option\n });\n }\n itemGroup.add(hitRect);\n itemGroup.eachChild(function (child) {\n child.silent = true;\n });\n hitRect.silent = !selectMode;\n this.getContentGroup().add(itemGroup);\n enableHoverEmphasis(itemGroup);\n // @ts-ignore\n itemGroup.__legendDataIndex = dataIndex;\n return itemGroup;\n };\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var selectorGroup = this.getSelectorGroup();\n // Place items in contentGroup.\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n var contentRect = contentGroup.getBoundingRect();\n var contentPos = [-contentRect.x, -contentRect.y];\n selectorGroup.markRedraw();\n contentGroup.markRedraw();\n if (selector) {\n // Place buttons in selectorGroup\n layoutUtil.box(\n // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var orientIdx = legendModel.getOrient().index;\n var wh = orientIdx === 0 ? 'width' : 'height';\n var hw = orientIdx === 0 ? 'height' : 'width';\n var yx = orientIdx === 0 ? 'y' : 'x';\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\n } else {\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\n }\n // Always align selector to content as 'middle'\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n var mainRect = {\n x: 0,\n y: 0\n };\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\n return mainRect;\n } else {\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n return this.group.getBoundingRect();\n }\n };\n /**\n * @protected\n */\n LegendView.prototype.remove = function () {\n this.getContentGroup().removeAll();\n this._isFirstRender = true;\n };\n LegendView.type = 'legend.plain';\n return LegendView;\n}(ComponentView);\nfunction getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api) {\n /**\n * Use series style if is inherit;\n * elsewise, use legend style\n */\n function handleCommonProps(style, visualStyle) {\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\n if (style.lineWidth === 'auto') {\n style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;\n }\n each(style, function (propVal, propName) {\n style[propName] === 'inherit' && (style[propName] = visualStyle[propName]);\n });\n }\n // itemStyle\n var itemStyleModel = legendItemModel.getModel('itemStyle');\n var itemStyle = itemStyleModel.getItemStyle();\n var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke';\n var decalStyle = itemStyleModel.getShallow('decal');\n itemStyle.decal = !decalStyle || decalStyle === 'inherit' ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api);\n if (itemStyle.fill === 'inherit') {\n /**\n * Series with visualDrawType as 'stroke' should have\n * series stroke as legend fill\n */\n itemStyle.fill = itemVisualStyle[drawType];\n }\n if (itemStyle.stroke === 'inherit') {\n /**\n * icon type with \"emptyXXX\" should use fill color\n * in visual style\n */\n itemStyle.stroke = itemVisualStyle[iconBrushType];\n }\n if (itemStyle.opacity === 'inherit') {\n /**\n * Use lineStyle.opacity if drawType is stroke\n */\n itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\n }\n handleCommonProps(itemStyle, itemVisualStyle);\n // lineStyle\n var legendLineModel = legendItemModel.getModel('lineStyle');\n var lineStyle = legendLineModel.getLineStyle();\n handleCommonProps(lineStyle, lineVisualStyle);\n // Fix auto color to real color\n itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill);\n itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill);\n lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill);\n if (!isSelected) {\n var borderWidth = legendItemModel.get('inactiveBorderWidth');\n /**\n * Since stroke is set to be inactiveBorderColor, it may occur that\n * there is no border in series but border in legend, so we need to\n * use border only when series has border if is set to be auto\n */\n var visualHasBorder = itemStyle[iconBrushType];\n itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;\n itemStyle.fill = legendItemModel.get('inactiveColor');\n itemStyle.stroke = legendItemModel.get('inactiveBorderColor');\n lineStyle.stroke = legendLineModel.get('inactiveColor');\n lineStyle.lineWidth = legendLineModel.get('inactiveWidth');\n }\n return {\n itemStyle: itemStyle,\n lineStyle: lineStyle\n };\n}\nfunction getDefaultLegendIcon(opt) {\n var symboType = opt.icon || 'roundRect';\n var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\n icon.setStyle(opt.itemStyle);\n icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;\n icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n if (symboType.indexOf('empty') > -1) {\n icon.style.stroke = icon.style.fill;\n icon.style.fill = '#fff';\n icon.style.lineWidth = 2;\n }\n return icon;\n}\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\n // downplay before unselect\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\n api.dispatchAction({\n type: 'legendToggleSelect',\n name: seriesName != null ? seriesName : dataName\n });\n // highlight after select\n // TODO highlight immediately may cause animation loss.\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\n}\nfunction isUseHoverLayer(api) {\n var list = api.getZr().storage.getDisplayList();\n var emphasisState;\n var i = 0;\n var len = list.length;\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\n i++;\n }\n return emphasisState && emphasisState.hoverLayer;\n}\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'highlight',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'downplay',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\nexport default LegendView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function legendFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n return true;\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport { curry, each } from 'zrender/lib/core/util.js';\nfunction legendSelectActionHandler(methodName, payload, ecModel) {\n var selectedMap = {};\n var isToggleSelect = methodName === 'toggleSelected';\n var isSelected;\n // Update all legend components\n ecModel.eachComponent('legend', function (legendModel) {\n if (isToggleSelect && isSelected != null) {\n // Force other legend has same selected status\n // Or the first is toggled to true and other are toggled to false\n // In the case one legend has some item unSelected in option. And if other legend\n // doesn't has the item, they will assume it is selected.\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\n } else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\n legendModel[methodName]();\n } else {\n legendModel[methodName](payload.name);\n isSelected = legendModel.isSelected(payload.name);\n }\n var legendData = legendModel.getData();\n each(legendData, function (model) {\n var name = model.get('name');\n // Wrap element\n if (name === '\\n' || name === '') {\n return;\n }\n var isItemSelected = legendModel.isSelected(name);\n if (selectedMap.hasOwnProperty(name)) {\n // Unselected if any legend is unselected\n selectedMap[name] = selectedMap[name] && isItemSelected;\n } else {\n selectedMap[name] = isItemSelected;\n }\n });\n });\n // Return the event explicitly\n return methodName === 'allSelect' || methodName === 'inverseSelect' ? {\n selected: selectedMap\n } : {\n name: payload.name,\n selected: selectedMap\n };\n}\nexport function installLegendAction(registers) {\n /**\n * @event legendToggleSelect\n * @type {Object}\n * @property {string} type 'legendToggleSelect'\n * @property {string} [from]\n * @property {string} name Series name or data item name\n */\n registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\n registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\n registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\n /**\n * @event legendSelect\n * @type {Object}\n * @property {string} type 'legendSelect'\n * @property {string} name Series name or data item name\n */\n registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\n /**\n * @event legendUnSelect\n * @type {Object}\n * @property {string} type 'legendUnSelect'\n * @property {string} name Series name or data item name\n */\n registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport LegendModel from './LegendModel.js';\nimport LegendView from './LegendView.js';\nimport legendFilter from './legendFilter.js';\nimport { installLegendAction } from './legendAction.js';\nexport function install(registers) {\n registers.registerComponentModel(LegendModel);\n registers.registerComponentView(LegendView);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\n registers.registerSubTypeDefaulter('legend', function () {\n return 'plain';\n });\n installLegendAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport LegendModel from './LegendModel.js';\nimport { mergeLayoutParam, getLayoutParams } from '../../util/layout.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar ScrollableLegendModel = /** @class */function (_super) {\n __extends(ScrollableLegendModel, _super);\n function ScrollableLegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ScrollableLegendModel.type;\n return _this;\n }\n /**\n * @param {number} scrollDataIndex\n */\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\n this.option.scrollDataIndex = scrollDataIndex;\n };\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n _super.prototype.init.call(this, option, parentModel, ecModel);\n mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\n };\n /**\n * @override\n */\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n mergeAndNormalizeLayoutParams(this, this.option, option);\n };\n ScrollableLegendModel.type = 'legend.scroll';\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\n scrollDataIndex: 0,\n pageButtonItemGap: 5,\n pageButtonGap: null,\n pageButtonPosition: 'end',\n pageFormatter: '{current}/{total}',\n pageIcons: {\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\n },\n pageIconColor: '#2f4554',\n pageIconInactiveColor: '#aaa',\n pageIconSize: 15,\n pageTextStyle: {\n color: '#333'\n },\n animationDurationUpdate: 800\n });\n return ScrollableLegendModel;\n}(LegendModel);\n;\n// Do not `ignoreSize` to enable setting {left: 10, right: 10}.\nfunction mergeAndNormalizeLayoutParams(legendModel, target, raw) {\n var orient = legendModel.getOrient();\n var ignoreSize = [1, 1];\n ignoreSize[orient.index] = 0;\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: !!ignoreSize\n });\n}\nexport default ScrollableLegendModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Separate legend and scrollable legend to reduce package size.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport LegendView from './LegendView.js';\nvar Group = graphic.Group;\nvar WH = ['width', 'height'];\nvar XY = ['x', 'y'];\nvar ScrollableLegendView = /** @class */function (_super) {\n __extends(ScrollableLegendView, _super);\n function ScrollableLegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ScrollableLegendView.type;\n _this.newlineDisabled = true;\n _this._currentIndex = 0;\n return _this;\n }\n ScrollableLegendView.prototype.init = function () {\n _super.prototype.init.call(this);\n this.group.add(this._containerGroup = new Group());\n this._containerGroup.add(this.getContentGroup());\n this.group.add(this._controllerGroup = new Group());\n };\n /**\n * @override\n */\n ScrollableLegendView.prototype.resetInner = function () {\n _super.prototype.resetInner.call(this);\n this._controllerGroup.removeAll();\n this._containerGroup.removeClipPath();\n this._containerGroup.__rectSize = null;\n };\n /**\n * @override\n */\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var self = this;\n // Render content items.\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\n var controllerGroup = this._controllerGroup;\n // FIXME: support be 'auto' adapt to size number text length,\n // e.g., '3/12345' should not overlap with the control arrow button.\n var pageIconSize = legendModel.get('pageIconSize', true);\n var pageIconSizeArr = zrUtil.isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];\n createPageButton('pagePrev', 0);\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\n controllerGroup.add(new graphic.Text({\n name: 'pageText',\n style: {\n // Placeholder to calculate a proper layout.\n text: 'xx/xx',\n fill: pageTextStyleModel.getTextColor(),\n font: pageTextStyleModel.getFont(),\n verticalAlign: 'middle',\n align: 'center'\n },\n silent: true\n }));\n createPageButton('pageNext', 1);\n function createPageButton(name, iconIdx) {\n var pageDataIndexName = name + 'DataIndex';\n var icon = graphic.createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\n // Buttons will be created in each render, so we do not need\n // to worry about avoiding using legendModel kept in scope.\n onclick: zrUtil.bind(self._pageGo, self, pageDataIndexName, legendModel, api)\n }, {\n x: -pageIconSizeArr[0] / 2,\n y: -pageIconSizeArr[1] / 2,\n width: pageIconSizeArr[0],\n height: pageIconSizeArr[1]\n });\n icon.name = name;\n controllerGroup.add(icon);\n }\n };\n /**\n * @override\n */\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n var hw = WH[1 - orientIdx];\n var yx = XY[1 - orientIdx];\n selector && layoutUtil.box(\n // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var processMaxSize = zrUtil.clone(maxSize);\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\n if (selector) {\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\n } else {\n var offset = selectorRect[wh] + selectorButtonGap;\n selectorPos[orientIdx] -= offset;\n mainRect[xy] -= offset;\n }\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n selectorGroup.markRedraw();\n }\n return mainRect;\n };\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\n var contentGroup = this.getContentGroup();\n var containerGroup = this._containerGroup;\n var controllerGroup = this._controllerGroup;\n // Place items in contentGroup.\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\n layoutUtil.box(\n // Buttons in controller are layout always horizontally.\n 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\n var contentRect = contentGroup.getBoundingRect();\n var controllerRect = controllerGroup.getBoundingRect();\n var showController = this._showController = contentRect[wh] > maxSize[wh];\n // In case that the inner elements of contentGroup layout do not based on [0, 0]\n var contentPos = [-contentRect.x, -contentRect.y];\n // Remain contentPos when scroll animation perfroming.\n // If first rendering, `contentGroup.position` is [0, 0], which\n // does not make sense and may cause unexepcted animation if adopted.\n if (!isFirstRender) {\n contentPos[orientIdx] = contentGroup[xy];\n }\n // Layout container group based on 0.\n var containerPos = [0, 0];\n var controllerPos = [-controllerRect.x, -controllerRect.y];\n var pageButtonGap = zrUtil.retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true));\n // Place containerGroup and controllerGroup and contentGroup.\n if (showController) {\n var pageButtonPosition = legendModel.get('pageButtonPosition', true);\n // controller is on the right / bottom.\n if (pageButtonPosition === 'end') {\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\n }\n // controller is on the left / top.\n else {\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\n }\n }\n // Always align controller to content as 'middle'.\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\n contentGroup.setPosition(contentPos);\n containerGroup.setPosition(containerPos);\n controllerGroup.setPosition(controllerPos);\n // Calculate `mainRect` and set `clipPath`.\n // mainRect should not be calculated by `this.group.getBoundingRect()`\n // for sake of the overflow.\n var mainRect = {\n x: 0,\n y: 0\n };\n // Consider content may be overflow (should be clipped).\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\n // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\n containerGroup.__rectSize = maxSize[wh];\n if (showController) {\n var clipShape = {\n x: 0,\n y: 0\n };\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\n clipShape[hw] = mainRect[hw];\n containerGroup.setClipPath(new graphic.Rect({\n shape: clipShape\n }));\n // Consider content may be larger than container, container rect\n // can not be obtained from `containerGroup.getBoundingRect()`.\n containerGroup.__rectSize = clipShape[wh];\n } else {\n // Do not remove or ignore controller. Keep them set as placeholders.\n controllerGroup.eachChild(function (child) {\n child.attr({\n invisible: true,\n silent: true\n });\n });\n }\n // Content translate animation.\n var pageInfo = this._getPageInfo(legendModel);\n pageInfo.pageIndex != null && graphic.updateProps(contentGroup, {\n x: pageInfo.contentPosition[0],\n y: pageInfo.contentPosition[1]\n },\n // When switch from \"show controller\" to \"not show controller\", view should be\n // updated immediately without animation, otherwise causes weird effect.\n showController ? legendModel : null);\n this._updatePageInfoView(legendModel, pageInfo);\n return mainRect;\n };\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\n scrollDataIndex != null && api.dispatchAction({\n type: 'legendScroll',\n scrollDataIndex: scrollDataIndex,\n legendId: legendModel.id\n });\n };\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\n var controllerGroup = this._controllerGroup;\n zrUtil.each(['pagePrev', 'pageNext'], function (name) {\n var key = name + 'DataIndex';\n var canJump = pageInfo[key] != null;\n var icon = controllerGroup.childOfName(name);\n if (icon) {\n icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true));\n icon.cursor = canJump ? 'pointer' : 'default';\n }\n });\n var pageText = controllerGroup.childOfName('pageText');\n var pageFormatter = legendModel.get('pageFormatter');\n var pageIndex = pageInfo.pageIndex;\n var current = pageIndex != null ? pageIndex + 1 : 0;\n var total = pageInfo.pageCount;\n pageText && pageFormatter && pageText.setStyle('text', zrUtil.isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({\n current: current,\n total: total\n }));\n };\n /**\n * contentPosition: Array., null when data item not found.\n * pageIndex: number, null when data item not found.\n * pageCount: number, always be a number, can be 0.\n * pagePrevDataIndex: number, null when no previous page.\n * pageNextDataIndex: number, null when no next page.\n * }\n */\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\n var contentGroup = this.getContentGroup();\n var containerRectSize = this._containerGroup.__rectSize;\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\n var children = contentGroup.children();\n var targetItem = children[targetItemIndex];\n var itemCount = children.length;\n var pCount = !itemCount ? 0 : 1;\n var result = {\n contentPosition: [contentGroup.x, contentGroup.y],\n pageCount: pCount,\n pageIndex: pCount - 1,\n pagePrevDataIndex: null,\n pageNextDataIndex: null\n };\n if (!targetItem) {\n return result;\n }\n var targetItemInfo = getItemInfo(targetItem);\n result.contentPosition[orientIdx] = -targetItemInfo.s;\n // Strategy:\n // (1) Always align based on the left/top most item.\n // (2) It is user-friendly that the last item shown in the\n // current window is shown at the begining of next window.\n // Otherwise if half of the last item is cut by the window,\n // it will have no chance to display entirely.\n // (3) Consider that item size probably be different, we\n // have calculate pageIndex by size rather than item index,\n // and we can not get page index directly by division.\n // (4) The window is to narrow to contain more than\n // one item, we should make sure that the page can be fliped.\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\n currItemInfo = getItemInfo(children[i]);\n if (\n // Half of the last item is out of the window.\n !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize\n // If the current item does not intersect with the window, the new page\n // can be started at the current item or the last item.\n || currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) {\n if (winEndItemInfo.i > winStartItemInfo.i) {\n winStartItemInfo = winEndItemInfo;\n } else {\n // e.g., when page size is smaller than item size.\n winStartItemInfo = currItemInfo;\n }\n if (winStartItemInfo) {\n if (result.pageNextDataIndex == null) {\n result.pageNextDataIndex = winStartItemInfo.i;\n }\n ++result.pageCount;\n }\n }\n winEndItemInfo = currItemInfo;\n }\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\n currItemInfo = getItemInfo(children[i]);\n if (\n // If the the end item does not intersect with the window started\n // from the current item, a page can be settled.\n (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)\n // e.g., when page size is smaller than item size.\n ) && winStartItemInfo.i < winEndItemInfo.i) {\n winEndItemInfo = winStartItemInfo;\n if (result.pagePrevDataIndex == null) {\n result.pagePrevDataIndex = winStartItemInfo.i;\n }\n ++result.pageCount;\n ++result.pageIndex;\n }\n winStartItemInfo = currItemInfo;\n }\n return result;\n function getItemInfo(el) {\n if (el) {\n var itemRect = el.getBoundingRect();\n var start = itemRect[xy] + el[xy];\n return {\n s: start,\n e: start + itemRect[wh],\n i: el.__legendDataIndex\n };\n }\n }\n function intersect(itemInfo, winStart) {\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\n }\n };\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\n if (!this._showController) {\n return 0;\n }\n var index;\n var contentGroup = this.getContentGroup();\n var defaultIndex;\n contentGroup.eachChild(function (child, idx) {\n var legendDataIdx = child.__legendDataIndex;\n // FIXME\n // If the given targetDataIndex (from model) is illegal,\n // we use defaultIndex. But the index on the legend model and\n // action payload is still illegal. That case will not be\n // changed until some scenario requires.\n if (defaultIndex == null && legendDataIdx != null) {\n defaultIndex = idx;\n }\n if (legendDataIdx === targetDataIndex) {\n index = idx;\n }\n });\n return index != null ? index : defaultIndex;\n };\n ScrollableLegendView.type = 'legend.scroll';\n return ScrollableLegendView;\n}(LegendView);\nexport default ScrollableLegendView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function installScrollableLegendAction(registers) {\n /**\n * @event legendScroll\n * @type {Object}\n * @property {string} type 'legendScroll'\n * @property {string} scrollDataIndex\n */\n registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\n var scrollDataIndex = payload.scrollDataIndex;\n scrollDataIndex != null && ecModel.eachComponent({\n mainType: 'legend',\n subType: 'scroll',\n query: payload\n }, function (legendModel) {\n legendModel.setScrollDataIndex(scrollDataIndex);\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport ScrollableLegendModel from './ScrollableLegendModel.js';\nimport ScrollableLegendView from './ScrollableLegendView.js';\nimport installScrollableLegendAction from './scrollableLegendAction.js';\nexport function install(registers) {\n use(installLegendPlain);\n registers.registerComponentModel(ScrollableLegendModel);\n registers.registerComponentView(ScrollableLegendView);\n installScrollableLegendAction(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport { install as installLegendScroll } from './installLegendScroll.js';\nexport function install(registers) {\n use(installLegendPlain);\n use(installLegendScroll);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar InsideZoomModel = /** @class */function (_super) {\n __extends(InsideZoomModel, _super);\n function InsideZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = InsideZoomModel.type;\n return _this;\n }\n InsideZoomModel.type = 'dataZoom.inside';\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n disabled: false,\n zoomLock: false,\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n return InsideZoomModel;\n}(DataZoomModel);\nexport default InsideZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Only create one roam controller for each coordinate system.\n// one roam controller might be refered by two inside data zoom\n// components (for example, one for x and one for y). When user\n// pan or zoom, only dispatch one action for those data zoom\n// components.\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nimport { each, curry, createHashMap } from 'zrender/lib/core/util.js';\nimport { collectReferCoordSysModelInfo } from './helper.js';\nvar inner = makeInner();\nexport function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\n inner(api).coordSysRecordMap.each(function (coordSysRecord) {\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\n if (dzInfo) {\n dzInfo.getRange = getRange;\n }\n });\n}\nexport function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\n var coordSysRecordMap = inner(api).coordSysRecordMap;\n var coordSysKeyArr = coordSysRecordMap.keys();\n for (var i = 0; i < coordSysKeyArr.length; i++) {\n var coordSysKey = coordSysKeyArr[i];\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n if (dataZoomInfoMap) {\n var dzUid = dataZoomModel.uid;\n var dzInfo = dataZoomInfoMap.get(dzUid);\n if (dzInfo) {\n dataZoomInfoMap.removeKey(dzUid);\n if (!dataZoomInfoMap.keys().length) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n }\n }\n }\n }\n}\nfunction disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\n if (coordSysRecord) {\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\n var controller = coordSysRecord.controller;\n controller && controller.dispose();\n }\n}\nfunction createCoordSysRecord(api, coordSysModel) {\n // These init props will never change after record created.\n var coordSysRecord = {\n model: coordSysModel,\n containsPoint: curry(containsPoint, coordSysModel),\n dispatchAction: curry(dispatchAction, api),\n dataZoomInfoMap: null,\n controller: null\n };\n // Must not do anything depends on coordSysRecord outside the event handler here,\n // because coordSysRecord not completed yet.\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\n controller.on(eventName, function (event) {\n var batch = [];\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\n // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\n // moveOnMouseWheel, ...) enabled.\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\n return;\n }\n var method = (dzInfo.getRange || {})[eventName];\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\n !dzInfo.model.get('disabled', true) && range && batch.push({\n dataZoomId: dzInfo.model.id,\n start: range[0],\n end: range[1]\n });\n });\n batch.length && coordSysRecord.dispatchAction(batch);\n });\n });\n return coordSysRecord;\n}\n/**\n * This action will be throttled.\n */\nfunction dispatchAction(api, batch) {\n if (!api.isDisposed()) {\n api.dispatchAction({\n type: 'dataZoom',\n animation: {\n easing: 'cubicOut',\n duration: 100\n },\n batch: batch\n });\n }\n}\nfunction containsPoint(coordSysModel, e, x, y) {\n return coordSysModel.coordinateSystem.containPoint([x, y]);\n}\n/**\n * Merge roamController settings when multiple dataZooms share one roamController.\n */\nfunction mergeControllerParams(dataZoomInfoMap) {\n var controlType;\n // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n // as string, it is probably revert to reserved word by compress tool. See #7411.\n var prefix = 'type_';\n var typePriority = {\n 'type_true': 2,\n 'type_move': 1,\n 'type_false': 0,\n 'type_undefined': -1\n };\n var preventDefaultMouseMove = true;\n dataZoomInfoMap.each(function (dataZoomInfo) {\n var dataZoomModel = dataZoomInfo.model;\n var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true;\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n controlType = oneType;\n }\n // Prevent default move event by default. If one false, do not prevent. Otherwise\n // users may be confused why it does not work when multiple insideZooms exist.\n preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true);\n });\n return {\n controlType: controlType,\n opt: {\n // RoamController will enable all of these functionalities,\n // and the final behavior is determined by its event listener\n // provided by each inside zoom.\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: true,\n preventDefaultMouseMove: !!preventDefaultMouseMove\n }\n };\n}\nexport function installDataZoomRoamProcessor(registers) {\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\n var apiInner = inner(api);\n var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());\n coordSysRecordMap.each(function (coordSysRecord) {\n // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should\n // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.\n coordSysRecord.dataZoomInfoMap = null;\n });\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'inside'\n }, function (dataZoomModel) {\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\n var coordSysUid = dzCoordSysInfo.model.uid;\n var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap());\n // Notice these props might be changed each time for a single dataZoomModel.\n dataZoomInfoMap.set(dataZoomModel.uid, {\n dzReferCoordSysInfo: dzCoordSysInfo,\n model: dataZoomModel,\n getRange: null\n });\n });\n });\n // (1) Merge dataZoom settings for each coord sys and set to the roam controller.\n // (2) Clear coord sys if not refered by any dataZoom.\n coordSysRecordMap.each(function (coordSysRecord) {\n var controller = coordSysRecord.controller;\n var firstDzInfo;\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n if (dataZoomInfoMap) {\n var firstDzKey = dataZoomInfoMap.keys()[0];\n if (firstDzKey != null) {\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\n }\n }\n if (!firstDzInfo) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n return;\n }\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\n controller.enable(controllerParams.controlType, controllerParams.opt);\n controller.setPointerChecker(coordSysRecord.containsPoint);\n throttleUtil.createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\n });\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as roams from './roams.js';\nimport { bind } from 'zrender/lib/core/util.js';\nvar InsideZoomView = /** @class */function (_super) {\n __extends(InsideZoomView, _super);\n function InsideZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'dataZoom.inside';\n return _this;\n }\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\n _super.prototype.render.apply(this, arguments);\n if (dataZoomModel.noTarget()) {\n this._clear();\n return;\n }\n // Hence the `throttle` util ensures to preserve command order,\n // here simply updating range all the time will not cause missing\n // any of the the roam change.\n this.range = dataZoomModel.getPercentRange();\n // Reset controllers.\n roams.setViewInfoToCoordSysRecord(api, dataZoomModel, {\n pan: bind(getRangeHandlers.pan, this),\n zoom: bind(getRangeHandlers.zoom, this),\n scrollMove: bind(getRangeHandlers.scrollMove, this)\n });\n };\n InsideZoomView.prototype.dispose = function () {\n this._clear();\n _super.prototype.dispose.apply(this, arguments);\n };\n InsideZoomView.prototype._clear = function () {\n roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\n this.range = null;\n };\n InsideZoomView.type = 'dataZoom.inside';\n return InsideZoomView;\n}(DataZoomView);\nvar getRangeHandlers = {\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice();\n // Calculate transform by the first axis.\n var axisModel = coordSysInfo.axisModels[0];\n if (!axisModel) {\n return;\n }\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\n var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\n var scale = Math.max(1 / e.scale, 0);\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\n // Restrict range.\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\n this.range = range;\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n },\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;\n }),\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\n })\n};\nfunction makeMover(getPercentDelta) {\n return function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice();\n // Calculate transform by the first axis.\n var axisModel = coordSysInfo.axisModels[0];\n if (!axisModel) {\n return;\n }\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\n sliderMove(percentDelta, range, [0, 100], 'all');\n this.range = range;\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n };\n}\nvar getDirectionInfo = {\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n oldPoint = oldPoint || [0, 0];\n if (axis.dim === 'x') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // axis.dim === 'y'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n return ret;\n },\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var polar = coordSysInfo.model.coordinateSystem;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var angleExtent = polar.getAngleAxis().getExtent();\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\n newPoint = polar.pointToCoord(newPoint);\n if (axisModel.mainType === 'radiusAxis') {\n ret.pixel = newPoint[0] - oldPoint[0];\n // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\n ret.pixelStart = radiusExtent[0];\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'angleAxis'\n ret.pixel = newPoint[1] - oldPoint[1];\n // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\n ret.pixelLength = angleExtent[1] - angleExtent[0];\n ret.pixelStart = angleExtent[0];\n ret.signal = axis.inverse ? -1 : 1;\n }\n return ret;\n },\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n var ret = {};\n oldPoint = oldPoint || [0, 0];\n if (axis.orient === 'horizontal') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'vertical'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n return ret;\n }\n};\nexport default InsideZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport InsideZoomModel from './InsideZoomModel.js';\nimport InsideZoomView from './InsideZoomView.js';\nimport { installDataZoomRoamProcessor } from './roams.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n installCommon(registers);\n registers.registerComponentModel(InsideZoomModel);\n registers.registerComponentView(InsideZoomView);\n installDataZoomRoamProcessor(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar SliderZoomModel = /** @class */function (_super) {\n __extends(SliderZoomModel, _super);\n function SliderZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SliderZoomModel.type;\n return _this;\n }\n SliderZoomModel.type = 'dataZoom.slider';\n SliderZoomModel.layoutMode = 'box';\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n show: true,\n // deault value can only be drived in view stage.\n right: 'ph',\n top: 'ph',\n width: 'ph',\n height: 'ph',\n left: null,\n bottom: null,\n borderColor: '#d2dbee',\n borderRadius: 3,\n backgroundColor: 'rgba(47,69,84,0)',\n // dataBackgroundColor: '#ddd',\n dataBackground: {\n lineStyle: {\n color: '#d2dbee',\n width: 0.5\n },\n areaStyle: {\n color: '#d2dbee',\n opacity: 0.2\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#8fb0f7',\n width: 0.5\n },\n areaStyle: {\n color: '#8fb0f7',\n opacity: 0.2\n }\n },\n // Color of selected window.\n fillerColor: 'rgba(135,175,274,0.2)',\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\n // Percent of the slider height\n handleSize: '100%',\n handleStyle: {\n color: '#fff',\n borderColor: '#ACB8D1'\n },\n moveHandleSize: 7,\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\n moveHandleStyle: {\n color: '#D2DBEE',\n opacity: 0.7\n },\n showDetail: true,\n showDataShadow: 'auto',\n realtime: true,\n zoomLock: false,\n textStyle: {\n color: '#6E7079'\n },\n brushSelect: true,\n brushStyle: {\n color: 'rgba(135,175,274,0.15)'\n },\n emphasis: {\n handleStyle: {\n borderColor: '#8FB0F7'\n },\n moveHandleStyle: {\n color: '#8FB0F7'\n }\n }\n });\n return SliderZoomModel;\n}(DataZoomModel);\nexport default SliderZoomModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, isFunction, isString, indexOf } from 'zrender/lib/core/util.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as throttle from '../../util/throttle.js';\nimport DataZoomView from './DataZoomView.js';\nimport { linearMap, asc, parsePercent } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { getAxisMainType, collectReferCoordSysModelInfo } from './helper.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, symbolBuildProxies } from '../../util/symbol.js';\nimport { deprecateLog } from '../../util/log.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar Rect = graphic.Rect;\n// Constants\nvar DEFAULT_LOCATION_EDGE_GAP = 7;\nvar DEFAULT_FRAME_BORDER_WIDTH = 1;\nvar DEFAULT_FILLER_SIZE = 30;\nvar DEFAULT_MOVE_HANDLE_SIZE = 7;\nvar HORIZONTAL = 'horizontal';\nvar VERTICAL = 'vertical';\nvar LABEL_GAP = 5;\nvar SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\nvar REALTIME_ANIMATION_CONFIG = {\n easing: 'cubicOut',\n duration: 100,\n delay: 0\n};\nvar SliderZoomView = /** @class */function (_super) {\n __extends(SliderZoomView, _super);\n function SliderZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = SliderZoomView.type;\n _this._displayables = {};\n return _this;\n }\n SliderZoomView.prototype.init = function (ecModel, api) {\n this.api = api;\n // A unique handler for each dataZoom component\n this._onBrush = bind(this._onBrush, this);\n this._onBrushEnd = bind(this._onBrushEnd, this);\n };\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n _super.prototype.render.apply(this, arguments);\n throttle.createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\n this._orient = dataZoomModel.getOrient();\n if (dataZoomModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n if (dataZoomModel.noTarget()) {\n this._clear();\n this.group.removeAll();\n return;\n }\n // Notice: this._resetInterval() should not be executed when payload.type\n // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\n // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\n this._buildView();\n }\n this._updateView();\n };\n SliderZoomView.prototype.dispose = function () {\n this._clear();\n _super.prototype.dispose.apply(this, arguments);\n };\n SliderZoomView.prototype._clear = function () {\n throttle.clear(this, '_dispatchZoomAction');\n var zr = this.api.getZr();\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n };\n SliderZoomView.prototype._buildView = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n this._brushing = false;\n this._displayables.brushRect = null;\n this._resetLocation();\n this._resetInterval();\n var barGroup = this._displayables.sliderGroup = new graphic.Group();\n this._renderBackground();\n this._renderHandle();\n this._renderDataShadow();\n thisGroup.add(barGroup);\n this._positionGroup();\n };\n SliderZoomView.prototype._resetLocation = function () {\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var showMoveHandle = dataZoomModel.get('brushSelect');\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\n // If some of x/y/width/height are not specified,\n // auto-adapt according to target grid.\n var coordRect = this._findCoordRect();\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n // Default align by coordinate system rect.\n var positionInfo = this._orient === HORIZONTAL ? {\n // Why using 'right', because right should be used in vertical,\n // and it is better to be consistent for dealing with position param merge.\n right: ecSize.width - coordRect.x - coordRect.width,\n top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize,\n width: coordRect.width,\n height: DEFAULT_FILLER_SIZE\n } : {\n right: DEFAULT_LOCATION_EDGE_GAP,\n top: coordRect.y,\n width: DEFAULT_FILLER_SIZE,\n height: coordRect.height\n };\n // Do not write back to option and replace value 'ph', because\n // the 'ph' value should be recalculated when resize.\n var layoutParams = layout.getLayoutParams(dataZoomModel.option);\n // Replace the placeholder value.\n each(['right', 'top', 'width', 'height'], function (name) {\n if (layoutParams[name] === 'ph') {\n layoutParams[name] = positionInfo[name];\n }\n });\n var layoutRect = layout.getLayoutRect(layoutParams, ecSize);\n this._location = {\n x: layoutRect.x,\n y: layoutRect.y\n };\n this._size = [layoutRect.width, layoutRect.height];\n this._orient === VERTICAL && this._size.reverse();\n };\n SliderZoomView.prototype._positionGroup = function () {\n var thisGroup = this.group;\n var location = this._location;\n var orient = this._orient;\n // Just use the first axis to determine mapping.\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\n var sliderGroup = this._displayables.sliderGroup;\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\n // Transform barGroup.\n sliderGroup.attr(orient === HORIZONTAL && !inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: 1\n } : orient === HORIZONTAL && inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: -1\n } : orient === VERTICAL && !inverse ? {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: 1,\n rotation: Math.PI / 2\n }\n // Don't use Math.PI, considering shadow direction.\n : {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: -1,\n rotation: Math.PI / 2\n });\n // Position barGroup\n var rect = thisGroup.getBoundingRect([sliderGroup]);\n thisGroup.x = location.x - rect.x;\n thisGroup.y = location.y - rect.y;\n thisGroup.markRedraw();\n };\n SliderZoomView.prototype._getViewExtent = function () {\n return [0, this._size[0]];\n };\n SliderZoomView.prototype._renderBackground = function () {\n var dataZoomModel = this.dataZoomModel;\n var size = this._size;\n var barGroup = this._displayables.sliderGroup;\n var brushSelect = dataZoomModel.get('brushSelect');\n barGroup.add(new Rect({\n silent: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: dataZoomModel.get('backgroundColor')\n },\n z2: -40\n }));\n // Click panel, over shadow, below handles.\n var clickPanel = new Rect({\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: 'transparent'\n },\n z2: 0,\n onclick: bind(this._onClickPanel, this)\n });\n var zr = this.api.getZr();\n if (brushSelect) {\n clickPanel.on('mousedown', this._onBrushStart, this);\n clickPanel.cursor = 'crosshair';\n zr.on('mousemove', this._onBrush);\n zr.on('mouseup', this._onBrushEnd);\n } else {\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n }\n barGroup.add(clickPanel);\n };\n SliderZoomView.prototype._renderDataShadow = function () {\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\n this._displayables.dataShadowSegs = [];\n if (!info) {\n return;\n }\n var size = this._size;\n var oldSize = this._shadowSize || [];\n var seriesModel = info.series;\n var data = seriesModel.getRawData();\n var candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim();\n var otherDim = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() // @see candlestick\n : info.otherDim;\n if (otherDim == null) {\n return;\n }\n var polygonPts = this._shadowPolygonPts;\n var polylinePts = this._shadowPolylinePts;\n // Not re-render if data doesn't change.\n if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) {\n var otherDataExtent_1 = data.getDataExtent(otherDim);\n // Nice extent.\n var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3;\n otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset];\n var otherShadowExtent_1 = [0, size[1]];\n var thisShadowExtent = [0, size[0]];\n var areaPoints_1 = [[size[0], 0], [0, 0]];\n var linePoints_1 = [];\n var step_1 = thisShadowExtent[1] / (data.count() - 1);\n var thisCoord_1 = 0;\n // Optimize for large data shadow\n var stride_1 = Math.round(data.count() / size[0]);\n var lastIsEmpty_1;\n data.each([otherDim], function (value, index) {\n if (stride_1 > 0 && index % stride_1) {\n thisCoord_1 += step_1;\n return;\n }\n // FIXME\n // Should consider axis.min/axis.max when drawing dataShadow.\n // FIXME\n // 应该使用统一的空判断?还是在list里进行空判断?\n var isEmpty = value == null || isNaN(value) || value === '';\n // See #4235.\n var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true);\n // Attempt to draw data shadow precisely when there are empty value.\n if (isEmpty && !lastIsEmpty_1 && index) {\n areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]);\n linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]);\n } else if (!isEmpty && lastIsEmpty_1) {\n areaPoints_1.push([thisCoord_1, 0]);\n linePoints_1.push([thisCoord_1, 0]);\n }\n areaPoints_1.push([thisCoord_1, otherCoord]);\n linePoints_1.push([thisCoord_1, otherCoord]);\n thisCoord_1 += step_1;\n lastIsEmpty_1 = isEmpty;\n });\n polygonPts = this._shadowPolygonPts = areaPoints_1;\n polylinePts = this._shadowPolylinePts = linePoints_1;\n }\n this._shadowData = data;\n this._shadowDim = otherDim;\n this._shadowSize = [size[0], size[1]];\n var dataZoomModel = this.dataZoomModel;\n function createDataShadowGroup(isSelectedArea) {\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\n var group = new graphic.Group();\n var polygon = new graphic.Polygon({\n shape: {\n points: polygonPts\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('areaStyle').getAreaStyle(),\n silent: true,\n z2: -20\n });\n var polyline = new graphic.Polyline({\n shape: {\n points: polylinePts\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('lineStyle').getLineStyle(),\n silent: true,\n z2: -19\n });\n group.add(polygon);\n group.add(polyline);\n return group;\n }\n // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');\n for (var i = 0; i < 3; i++) {\n var group = createDataShadowGroup(i === 1);\n this._displayables.sliderGroup.add(group);\n this._displayables.dataShadowSegs.push(group);\n }\n };\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\n var dataZoomModel = this.dataZoomModel;\n var showDataShadow = dataZoomModel.get('showDataShadow');\n if (showDataShadow === false) {\n return;\n }\n // Find a representative series.\n var result;\n var ecModel = this.ecModel;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();\n each(seriesModels, function (seriesModel) {\n if (result) {\n return;\n }\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\n return;\n }\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\n var otherDim = getOtherDim(axisDim);\n var otherAxisInverse;\n var coordSys = seriesModel.coordinateSystem;\n if (otherDim != null && coordSys.getOtherAxis) {\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\n }\n otherDim = seriesModel.getData().mapDimension(otherDim);\n result = {\n thisAxis: thisAxis,\n series: seriesModel,\n thisDim: axisDim,\n otherDim: otherDim,\n otherAxisInverse: otherAxisInverse\n };\n }, this);\n }, this);\n return result;\n };\n SliderZoomView.prototype._renderHandle = function () {\n var thisGroup = this.group;\n var displayables = this._displayables;\n var handles = displayables.handles = [null, null];\n var handleLabels = displayables.handleLabels = [null, null];\n var sliderGroup = this._displayables.sliderGroup;\n var size = this._size;\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\n var brushSelect = dataZoomModel.get('brushSelect');\n var filler = displayables.filler = new Rect({\n silent: brushSelect,\n style: {\n fill: dataZoomModel.get('fillerColor')\n },\n textConfig: {\n position: 'inside'\n }\n });\n sliderGroup.add(filler);\n // Frame border.\n sliderGroup.add(new Rect({\n silent: true,\n subPixelOptimize: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1],\n r: borderRadius\n },\n style: {\n // deprecated option\n stroke: dataZoomModel.get('dataBackgroundColor') || dataZoomModel.get('borderColor'),\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\n fill: 'rgba(0,0,0,0)'\n }\n }));\n // Left and right handle to resize\n each([0, 1], function (handleIndex) {\n var iconStr = dataZoomModel.get('handleIcon');\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) {\n // Compatitable with the old icon parsers. Which can use a path string without path://\n iconStr = 'path://' + iconStr;\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\n }\n }\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\n path.attr({\n cursor: getCursor(this._orient),\n draggable: true,\n drift: bind(this._onDragMove, this, handleIndex),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false),\n z2: 5\n });\n var bRect = path.getBoundingRect();\n var handleSize = dataZoomModel.get('handleSize');\n this._handleHeight = parsePercent(handleSize, this._size[1]);\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\n path.style.strokeNoScale = true;\n path.rectHover = true;\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n enableHoverEmphasis(path);\n var handleColor = dataZoomModel.get('handleColor'); // deprecated option\n // Compatitable with previous version\n if (handleColor != null) {\n path.style.fill = handleColor;\n }\n sliderGroup.add(handles[handleIndex] = path);\n var textStyleModel = dataZoomModel.getModel('textStyle');\n thisGroup.add(handleLabels[handleIndex] = new graphic.Text({\n silent: true,\n invisible: true,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: '',\n verticalAlign: 'middle',\n align: 'center',\n fill: textStyleModel.getTextColor(),\n font: textStyleModel.getFont()\n }),\n z2: 10\n }));\n }, this);\n // Handle to move. Only visible when brushSelect is set true.\n var actualMoveZone = filler;\n if (brushSelect) {\n var moveHandleHeight = parsePercent(dataZoomModel.get('moveHandleSize'), size[1]);\n var moveHandle_1 = displayables.moveHandle = new graphic.Rect({\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\n silent: true,\n shape: {\n r: [0, 0, 2, 2],\n y: size[1] - 0.5,\n height: moveHandleHeight\n }\n });\n var iconSize = moveHandleHeight * 0.8;\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\n moveHandleIcon.silent = true;\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\n actualMoveZone = displayables.moveZone = new graphic.Rect({\n invisible: true,\n shape: {\n y: size[1] - moveZoneExpandSize,\n height: moveHandleHeight + moveZoneExpandSize\n }\n });\n actualMoveZone.on('mouseover', function () {\n api.enterEmphasis(moveHandle_1);\n }).on('mouseout', function () {\n api.leaveEmphasis(moveHandle_1);\n });\n sliderGroup.add(moveHandle_1);\n sliderGroup.add(moveHandleIcon);\n sliderGroup.add(actualMoveZone);\n }\n actualMoveZone.attr({\n draggable: true,\n cursor: getCursor(this._orient),\n drift: bind(this._onDragMove, this, 'all'),\n ondragstart: bind(this._showDataInfo, this, true),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false)\n });\n };\n SliderZoomView.prototype._resetInterval = function () {\n var range = this._range = this.dataZoomModel.getPercentRange();\n var viewExtent = this._getViewExtent();\n this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)];\n };\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\n var dataZoomModel = this.dataZoomModel;\n var handleEnds = this._handleEnds;\n var viewExtend = this._getViewExtent();\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n var percentExtent = [0, 100];\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\n var lastRange = this._range;\n var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\n };\n SliderZoomView.prototype._updateView = function (nonRealtime) {\n var displaybles = this._displayables;\n var handleEnds = this._handleEnds;\n var handleInterval = asc(handleEnds.slice());\n var size = this._size;\n each([0, 1], function (handleIndex) {\n // Handles\n var handle = displaybles.handles[handleIndex];\n var handleHeight = this._handleHeight;\n handle.attr({\n scaleX: handleHeight / 2,\n scaleY: handleHeight / 2,\n // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.\n // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\n y: size[1] / 2 - handleHeight / 2\n });\n }, this);\n // Filler\n displaybles.filler.setShape({\n x: handleInterval[0],\n y: 0,\n width: handleInterval[1] - handleInterval[0],\n height: size[1]\n });\n var viewExtent = {\n x: handleInterval[0],\n width: handleInterval[1] - handleInterval[0]\n };\n // Move handle\n if (displaybles.moveHandle) {\n displaybles.moveHandle.setShape(viewExtent);\n displaybles.moveZone.setShape(viewExtent);\n // Force update path on the invisible object\n displaybles.moveZone.getBoundingRect();\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\n }\n // update clip path of shadow.\n var dataShadowSegs = displaybles.dataShadowSegs;\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\n for (var i = 0; i < dataShadowSegs.length; i++) {\n var segGroup = dataShadowSegs[i];\n var clipPath = segGroup.getClipPath();\n if (!clipPath) {\n clipPath = new graphic.Rect();\n segGroup.setClipPath(clipPath);\n }\n clipPath.setShape({\n x: segIntervals[i],\n y: 0,\n width: segIntervals[i + 1] - segIntervals[i],\n height: size[1]\n });\n }\n this._updateDataInfo(nonRealtime);\n };\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\n var dataZoomModel = this.dataZoomModel;\n var displaybles = this._displayables;\n var handleLabels = displaybles.handleLabels;\n var orient = this._orient;\n var labelTexts = ['', ''];\n // FIXME\n // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)\n if (dataZoomModel.get('showDetail')) {\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n if (axisProxy) {\n var axis = axisProxy.getAxisModel().axis;\n var range = this._range;\n var dataInterval = nonRealtime\n // See #4434, data and axis are not processed and reset yet in non-realtime mode.\n ? axisProxy.calculateDataWindow({\n start: range[0],\n end: range[1]\n }).valueWindow : axisProxy.getDataValueWindow();\n labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];\n }\n }\n var orderedHandleEnds = asc(this._handleEnds.slice());\n setLabel.call(this, 0);\n setLabel.call(this, 1);\n function setLabel(handleIndex) {\n // Label\n // Text should not transform by barGroup.\n // Ignore handlers transform\n var barTransform = graphic.getTransform(displaybles.handles[handleIndex].parent, this.group);\n var direction = graphic.transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\n var offset = this._handleWidth / 2 + LABEL_GAP;\n var textPoint = graphic.applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform);\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\n align: orient === HORIZONTAL ? direction : 'center',\n text: labelTexts[handleIndex]\n });\n }\n };\n SliderZoomView.prototype._formatLabel = function (value, axis) {\n var dataZoomModel = this.dataZoomModel;\n var labelFormatter = dataZoomModel.get('labelFormatter');\n var labelPrecision = dataZoomModel.get('labelPrecision');\n if (labelPrecision == null || labelPrecision === 'auto') {\n labelPrecision = axis.getPixelPrecision();\n }\n var valueStr = value == null || isNaN(value) ? ''\n // FIXME Glue code\n : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({\n value: Math.round(value)\n })\n // param of toFixed should less then 20.\n : value.toFixed(Math.min(labelPrecision, 20));\n return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr;\n };\n /**\n * @param showOrHide true: show, false: hide\n */\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\n // Always show when drgging.\n showOrHide = this._dragging || showOrHide;\n var displayables = this._displayables;\n var handleLabels = displayables.handleLabels;\n handleLabels[0].attr('invisible', !showOrHide);\n handleLabels[1].attr('invisible', !showOrHide);\n // Highlight move handle\n displayables.moveHandle && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\n };\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\n this._dragging = true;\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(event.event);\n // Transform dx, dy to bar coordination.\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\n var vertex = graphic.applyTransform([dx, dy], barTransform, true);\n var changed = this._updateInterval(handleIndex, vertex[0]);\n var realtime = this.dataZoomModel.get('realtime');\n this._updateView(!realtime);\n // Avoid dispatch dataZoom repeatly but range not changed,\n // which cause bad visual effect when progressive enabled.\n changed && realtime && this._dispatchZoomAction(true);\n };\n SliderZoomView.prototype._onDragEnd = function () {\n this._dragging = false;\n this._showDataInfo(false);\n // While in realtime mode and stream mode, dispatch action when\n // drag end will cause the whole view rerender, which is unnecessary.\n var realtime = this.dataZoomModel.get('realtime');\n !realtime && this._dispatchZoomAction(false);\n };\n SliderZoomView.prototype._onClickPanel = function (e) {\n var size = this._size;\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\n if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {\n return;\n }\n var handleEnds = this._handleEnds;\n var center = (handleEnds[0] + handleEnds[1]) / 2;\n var changed = this._updateInterval('all', localPoint[0] - center);\n this._updateView();\n changed && this._dispatchZoomAction(false);\n };\n SliderZoomView.prototype._onBrushStart = function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n this._brushStart = new graphic.Point(x, y);\n this._brushing = true;\n this._brushStartTime = +new Date();\n // this._updateBrushRect(x, y);\n };\n\n SliderZoomView.prototype._onBrushEnd = function (e) {\n if (!this._brushing) {\n return;\n }\n var brushRect = this._displayables.brushRect;\n this._brushing = false;\n if (!brushRect) {\n return;\n }\n brushRect.attr('ignore', true);\n var brushShape = brushRect.shape;\n var brushEndTime = +new Date();\n // console.log(brushEndTime - this._brushStartTime);\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\n // Will treat it as a click\n return;\n }\n var viewExtend = this._getViewExtent();\n var percentExtent = [0, 100];\n this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]);\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\n this._updateView();\n this._dispatchZoomAction(false);\n };\n SliderZoomView.prototype._onBrush = function (e) {\n if (this._brushing) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n this._updateBrushRect(e.offsetX, e.offsetY);\n }\n };\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\n var displayables = this._displayables;\n var dataZoomModel = this.dataZoomModel;\n var brushRect = displayables.brushRect;\n if (!brushRect) {\n brushRect = displayables.brushRect = new Rect({\n silent: true,\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\n });\n displayables.sliderGroup.add(brushRect);\n }\n brushRect.attr('ignore', false);\n var brushStart = this._brushStart;\n var sliderGroup = this._displayables.sliderGroup;\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\n var size = this._size;\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\n brushRect.setShape({\n x: startPoint[0],\n y: 0,\n width: endPoint[0] - startPoint[0],\n height: size[1]\n });\n };\n /**\n * This action will be throttled.\n */\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\n var range = this._range;\n this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n dataZoomId: this.dataZoomModel.id,\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\n start: range[0],\n end: range[1]\n });\n };\n SliderZoomView.prototype._findCoordRect = function () {\n // Find the grid corresponding to the first axis referred by dataZoom.\n var rect;\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\n if (!rect && coordSysInfoList.length) {\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\n rect = coordSys.getRect && coordSys.getRect();\n }\n if (!rect) {\n var width = this.api.getWidth();\n var height = this.api.getHeight();\n rect = {\n x: width * 0.2,\n y: height * 0.2,\n width: width * 0.6,\n height: height * 0.6\n };\n }\n return rect;\n };\n SliderZoomView.type = 'dataZoom.slider';\n return SliderZoomView;\n}(DataZoomView);\nfunction getOtherDim(thisDim) {\n // FIXME\n // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好\n var map = {\n x: 'y',\n y: 'x',\n radius: 'angle',\n angle: 'radius'\n };\n return map[thisDim];\n}\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\nexport default SliderZoomView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport SliderZoomModel from './SliderZoomModel.js';\nimport SliderZoomView from './SliderZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(SliderZoomModel);\n registers.registerComponentView(SliderZoomView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomInside } from './installDataZoomInside.js';\nimport { install as installDataZoomSlider } from './installDataZoomSlider.js';\nexport function install(registers) {\n use(installDataZoomInside);\n use(installDataZoomSlider);\n // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n/**\n * @file Visual mapping.\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar visualDefault = {\n /**\n * @public\n */\n get: function (visualType, key, isCategory) {\n var value = zrUtil.clone((defaultOption[visualType] || {})[key]);\n return isCategory ? zrUtil.isArray(value) ? value[value.length - 1] : value : value;\n }\n};\nvar defaultOption = {\n color: {\n active: ['#006edd', '#e0ffff'],\n inactive: ['rgba(0,0,0,0)']\n },\n colorHue: {\n active: [0, 360],\n inactive: [0, 0]\n },\n colorSaturation: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n colorLightness: {\n active: [0.9, 0.5],\n inactive: [0, 0]\n },\n colorAlpha: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n opacity: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n symbol: {\n active: ['circle', 'roundRect', 'diamond'],\n inactive: ['none']\n },\n symbolSize: {\n active: [10, 50],\n inactive: [0, 0]\n }\n};\nexport default visualDefault;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as numberUtil from '../../util/number.js';\nimport ComponentModel from '../../model/Component.js';\nvar mapVisual = VisualMapping.mapVisual;\nvar eachVisual = VisualMapping.eachVisual;\nvar isArray = zrUtil.isArray;\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\nvar linearMap = numberUtil.linearMap;\nvar VisualMapModel = /** @class */function (_super) {\n __extends(VisualMapModel, _super);\n function VisualMapModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = VisualMapModel.type;\n _this.stateList = ['inRange', 'outOfRange'];\n _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color'];\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n /**\n * [lowerBound, upperBound]\n */\n _this.dataBound = [-Infinity, Infinity];\n _this.targetVisuals = {};\n _this.controllerVisuals = {};\n return _this;\n }\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n /**\n * @protected\n */\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\n this.textStyleModel = this.getModel('textStyle');\n this.resetItemSize();\n this.completeVisualOption();\n };\n /**\n * @protected\n */\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\n var stateList = this.stateList;\n supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\n this.controllerVisuals = visualSolution.createVisualMappings(this.option.controller, stateList, supplementVisualOption);\n this.targetVisuals = visualSolution.createVisualMappings(this.option.target, stateList, supplementVisualOption);\n };\n /**\n * @public\n */\n VisualMapModel.prototype.getItemSymbol = function () {\n return null;\n };\n /**\n * @protected\n * @return {Array.} An array of series indices.\n */\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\n this.ecModel.eachSeries(function (seriesModel, index) {\n seriesIndices.push(index);\n });\n } else {\n seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);\n }\n return seriesIndices;\n };\n /**\n * @public\n */\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\n if (seriesModel) {\n callback.call(context, seriesModel);\n }\n }, this);\n };\n /**\n * @pubilc\n */\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\n var is = false;\n this.eachTargetSeries(function (model) {\n model === seriesModel && (is = true);\n });\n return is;\n };\n /**\n * @example\n * this.formatValueText(someVal); // format single numeric value to text.\n * this.formatValueText(someVal, true); // format single category value to text.\n * this.formatValueText([min, max]); // format numeric min-max to text.\n * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\n * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\n *\n * @param value Real value, or this.dataBound[0 or 1].\n * @param isCategory Only available when value is number.\n * @param edgeSymbols Open-close symbol when value is interval.\n * @protected\n */\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\n var option = this.option;\n var precision = option.precision;\n var dataBound = this.dataBound;\n var formatter = option.formatter;\n var isMinMax;\n edgeSymbols = edgeSymbols || ['<', '>'];\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n var textValue = isCategory ? value // Value is string when isCategory\n : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n if (zrUtil.isString(formatter)) {\n return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue);\n } else if (zrUtil.isFunction(formatter)) {\n return isMinMax ? formatter(value[0], value[1]) : formatter(value);\n }\n if (isMinMax) {\n if (value[0] === dataBound[0]) {\n return edgeSymbols[0] + ' ' + textValue[1];\n } else if (value[1] === dataBound[1]) {\n return edgeSymbols[1] + ' ' + textValue[0];\n } else {\n return textValue[0] + ' - ' + textValue[1];\n }\n } else {\n // Format single value (includes category case).\n return textValue;\n }\n function toFixed(val) {\n return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20));\n }\n };\n /**\n * @protected\n */\n VisualMapModel.prototype.resetExtent = function () {\n var thisOption = this.option;\n // Can not calculate data extent by data here.\n // Because series and data may be modified in processing stage.\n // So we do not support the feature \"auto min/max\".\n var extent = asc([thisOption.min, thisOption.max]);\n this._dataExtent = extent;\n };\n /**\n * PENDING:\n * delete this method if no outer usage.\n *\n * Return Concrete dimension. If null/undefined is returned, no dimension is used.\n */\n // getDataDimension(data: SeriesData) {\n // const optDim = this.option.dimension;\n // if (optDim != null) {\n // return data.getDimension(optDim);\n // }\n // const dimNames = data.dimensions;\n // for (let i = dimNames.length - 1; i >= 0; i--) {\n // const dimName = dimNames[i];\n // const dimInfo = data.getDimensionInfo(dimName);\n // if (!dimInfo.isCalculationCoord) {\n // return dimName;\n // }\n // }\n // }\n VisualMapModel.prototype.getDataDimensionIndex = function (data) {\n var optDim = this.option.dimension;\n if (optDim != null) {\n return data.getDimensionIndex(optDim);\n }\n var dimNames = data.dimensions;\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = data.getDimensionInfo(dimName);\n if (!dimInfo.isCalculationCoord) {\n return dimInfo.storeDimIndex;\n }\n }\n };\n VisualMapModel.prototype.getExtent = function () {\n return this._dataExtent.slice();\n };\n VisualMapModel.prototype.completeVisualOption = function () {\n var ecModel = this.ecModel;\n var thisOption = this.option;\n var base = {\n inRange: thisOption.inRange,\n outOfRange: thisOption.outOfRange\n };\n var target = thisOption.target || (thisOption.target = {});\n var controller = thisOption.controller || (thisOption.controller = {});\n zrUtil.merge(target, base); // Do not override\n zrUtil.merge(controller, base); // Do not override\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange');\n // completeInactive.call(this, target, 'outOfRange', 'inRange');\n completeController.call(this, controller);\n function completeSingle(base) {\n // Compatible with ec2 dataRange.color.\n // The mapping order of dataRange.color is: [high value, ..., low value]\n // whereas inRange.color and outOfRange.color is [low value, ..., high value]\n // Notice: ec2 has no inverse.\n if (isArray(thisOption.color)\n // If there has been inRange: {symbol: ...}, adding color is a mistake.\n // So adding color only when no inRange defined.\n && !base.inRange) {\n base.inRange = {\n color: thisOption.color.slice().reverse()\n };\n }\n // Compatible with previous logic, always give a default color, otherwise\n // simple config with no inRange and outOfRange will not work.\n // Originally we use visualMap.color as the default color, but setOption at\n // the second time the default color will be erased. So we change to use\n // constant DEFAULT_COLOR.\n // If user do not want the default color, set inRange: {color: null}.\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n };\n }\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n if (defa != null) {\n optAbsent[visualType] = defa;\n // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\n }\n });\n }\n }\n function completeController(controller) {\n var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol;\n var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize;\n var inactiveColor = this.get('inactiveColor');\n var itemSymbol = this.getItemSymbol();\n var defaultSymbol = itemSymbol || 'roundRect';\n each(this.stateList, function (state) {\n var itemSize = this.itemSize;\n var visuals = controller[state];\n // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n }\n // Consistent symbol and symbolSize if not specified.\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);\n }\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n }\n // Filter none\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' ? defaultSymbol : symbol;\n });\n // Normalize symbolSize\n var symbolSize = visuals.symbolSize;\n if (symbolSize != null) {\n var max_1 = -Infinity;\n // symbolSize can be object when categories defined.\n eachVisual(symbolSize, function (value) {\n value > max_1 && (max_1 = value);\n });\n visuals.symbolSize = mapVisual(symbolSize, function (value) {\n return linearMap(value, [0, max_1], [0, itemSize[0]], true);\n });\n }\n }, this);\n }\n };\n VisualMapModel.prototype.resetItemSize = function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n };\n VisualMapModel.prototype.isCategory = function () {\n return !!this.option.categories;\n };\n /**\n * @public\n * @abstract\n */\n VisualMapModel.prototype.setSelected = function (selected) {};\n VisualMapModel.prototype.getSelected = function () {\n return null;\n };\n /**\n * @public\n * @abstract\n */\n VisualMapModel.prototype.getValueState = function (value) {\n return null;\n };\n /**\n * FIXME\n * Do not publish to thirt-part-dev temporarily\n * util the interface is stable. (Should it return\n * a function but not visual meta?)\n *\n * @pubilc\n * @abstract\n * @param getColorVisual\n * params: value, valueState\n * return: color\n * @return {Object} visualMeta\n * should includes {stops, outerColors}\n * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\n */\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\n return null;\n };\n VisualMapModel.type = 'visualMap';\n VisualMapModel.dependencies = ['series'];\n VisualMapModel.defaultOption = {\n show: true,\n // zlevel: 0,\n z: 4,\n seriesIndex: 'all',\n min: 0,\n max: 200,\n left: 0,\n right: null,\n top: null,\n bottom: 0,\n itemWidth: null,\n itemHeight: null,\n inverse: false,\n orient: 'vertical',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n contentColor: '#5793f3',\n inactiveColor: '#aaa',\n borderWidth: 0,\n padding: 5,\n // 接受数组分别设定上右下左边距,同css\n textGap: 10,\n precision: 0,\n textStyle: {\n color: '#333' // 值域文字颜色\n }\n };\n\n return VisualMapModel;\n}(ComponentModel);\nexport default VisualMapModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport * as numberUtil from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n// Constant\nvar DEFAULT_BAR_BOUND = [20, 140];\nvar ContinuousModel = /** @class */function (_super) {\n __extends(ContinuousModel, _super);\n function ContinuousModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ContinuousModel.type;\n return _this;\n }\n /**\n * @override\n */\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n this.resetExtent();\n this.resetVisual(function (mappingOption) {\n mappingOption.mappingMethod = 'linear';\n mappingOption.dataExtent = this.getExtent();\n });\n this._resetRange();\n };\n /**\n * @protected\n * @override\n */\n ContinuousModel.prototype.resetItemSize = function () {\n _super.prototype.resetItemSize.apply(this, arguments);\n var itemSize = this.itemSize;\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\n };\n /**\n * @private\n */\n ContinuousModel.prototype._resetRange = function () {\n var dataExtent = this.getExtent();\n var range = this.option.range;\n if (!range || range.auto) {\n // `range` should always be array (so we don't use other\n // value like 'auto') for user-friend. (consider getOption).\n dataExtent.auto = 1;\n this.option.range = dataExtent;\n } else if (zrUtil.isArray(range)) {\n if (range[0] > range[1]) {\n range.reverse();\n }\n range[0] = Math.max(range[0], dataExtent[0]);\n range[1] = Math.min(range[1], dataExtent[1]);\n }\n };\n /**\n * @protected\n * @override\n */\n ContinuousModel.prototype.completeVisualOption = function () {\n _super.prototype.completeVisualOption.apply(this, arguments);\n zrUtil.each(this.stateList, function (state) {\n var symbolSize = this.option.controller[state].symbolSize;\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\n symbolSize[0] = symbolSize[1] / 3; // For good looking.\n }\n }, this);\n };\n /**\n * @override\n */\n ContinuousModel.prototype.setSelected = function (selected) {\n this.option.range = selected.slice();\n this._resetRange();\n };\n /**\n * @public\n */\n ContinuousModel.prototype.getSelected = function () {\n var dataExtent = this.getExtent();\n var dataInterval = numberUtil.asc((this.get('range') || []).slice());\n // Clamp\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\n return dataInterval;\n };\n /**\n * @override\n */\n ContinuousModel.prototype.getValueState = function (value) {\n var range = this.option.range;\n var dataExtent = this.getExtent();\n // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.\n // range[1] is processed likewise.\n return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange';\n };\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\n var result = [];\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\n * @implement\n */\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\n var stops = [];\n function setStop(value, valueState) {\n stops.push({\n value: value,\n color: getColorVisual(value, valueState)\n });\n }\n // Format to: outOfRange -- inRange -- outOfRange.\n var iIdx = 0;\n var oIdx = 0;\n var iLen = iVals.length;\n var oLen = oVals.length;\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\n // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.\n if (oVals[oIdx] < iVals[iIdx]) {\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\n // If range is full, value beyond min, max will be clamped.\n // make a singularity\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\n setStop(iVals[iIdx], 'inRange');\n }\n for (var first = 1; oIdx < oLen; oIdx++) {\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\n // make a singularity\n if (first) {\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\n first = 0;\n }\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n var stopsLen = stops.length;\n return {\n stops: stops,\n outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent']\n };\n };\n ContinuousModel.type = 'visualMap.continuous';\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n align: 'auto',\n calculable: false,\n hoverLink: true,\n realtime: true,\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\n handleSize: '120%',\n handleStyle: {\n borderColor: '#fff',\n borderWidth: 1\n },\n indicatorIcon: 'circle',\n indicatorSize: '50%',\n indicatorStyle: {\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n }\n // emphasis: {\n // handleStyle: {\n // shadowBlur: 3,\n // shadowOffsetX: 1,\n // shadowOffsetY: 1,\n // shadowColor: 'rgba(0,0,0,0.2)'\n // }\n // }\n });\n\n return ContinuousModel;\n}(VisualMapModel);\nfunction getColorStopValues(visualMapModel, valueState, dataExtent) {\n if (dataExtent[0] === dataExtent[1]) {\n return dataExtent.slice();\n }\n // When using colorHue mapping, it is not linear color any more.\n // Moreover, canvas gradient seems not to be accurate linear.\n // FIXME\n // Should be arbitrary value 100? or based on pixel size?\n var count = 200;\n var step = (dataExtent[1] - dataExtent[0]) / count;\n var value = dataExtent[0];\n var stopValues = [];\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\n stopValues.push(value);\n value += step;\n }\n stopValues.push(dataExtent[1]);\n return stopValues;\n}\nexport default ContinuousModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { Rect } from '../../util/graphic.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as layout from '../../util/layout.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport ComponentView from '../../view/Component.js';\nvar VisualMapView = /** @class */function (_super) {\n __extends(VisualMapView, _super);\n function VisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = VisualMapView.type;\n _this.autoPositionValues = {\n left: 1,\n right: 1,\n top: 1,\n bottom: 1\n };\n return _this;\n }\n VisualMapView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n };\n /**\n * @protected\n */\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE\n ) {\n this.visualMapModel = visualMapModel;\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n this.doRender(visualMapModel, ecModel, api, payload);\n };\n /**\n * @protected\n */\n VisualMapView.prototype.renderBackground = function (group) {\n var visualMapModel = this.visualMapModel;\n var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\n var rect = group.getBoundingRect();\n group.add(new Rect({\n z2: -1,\n silent: true,\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[3] + padding[1],\n height: rect.height + padding[0] + padding[2]\n },\n style: {\n fill: visualMapModel.get('backgroundColor'),\n stroke: visualMapModel.get('borderColor'),\n lineWidth: visualMapModel.get('borderWidth')\n }\n }));\n };\n /**\n * @protected\n * @param targetValue can be Infinity or -Infinity\n * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\n * @param opts\n * @param opts.forceState Specify state, instead of using getValueState method.\n * @param opts.convertOpacityToAlpha For color gradient in controller widget.\n * @return {*} Visual value.\n */\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\n opts = opts || {};\n var forceState = opts.forceState;\n var visualMapModel = this.visualMapModel;\n var visualObj = {};\n // Default values.\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n function getter(key) {\n return visualObj[key];\n }\n function setter(key, value) {\n visualObj[key] = value;\n }\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n zrUtil.each(visualTypes, function (type) {\n var visualMapping = mappings[type];\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n };\n VisualMapView.prototype.positionGroup = function (group) {\n var model = this.visualMapModel;\n var api = this.api;\n layout.positionElement(group, model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {};\n VisualMapView.type = 'visualMap';\n return VisualMapView;\n}(ComponentView);\nexport default VisualMapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getLayoutRect } from '../../util/layout.js';\nvar paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']];\n/**\n * @param visualMapModel\n * @param api\n * @param itemSize always [short, long]\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\n */\nexport function getItemAlign(visualMapModel, api, itemSize) {\n var modelOption = visualMapModel.option;\n var itemAlign = modelOption.align;\n if (itemAlign != null && itemAlign !== 'auto') {\n return itemAlign;\n }\n // Auto decision align.\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\n var reals = paramsSet[realIndex];\n var fakeValue = [0, null, 10];\n var layoutInput = {};\n for (var i = 0; i < 3; i++) {\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\n }\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];\n}\n/**\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\n * dataIndexInside means filtered index.\n */\n// TODO: TYPE more specified payload types.\nexport function makeHighDownBatch(batch, visualMapModel) {\n zrUtil.each(batch || [], function (batchItem) {\n if (batchItem.dataIndex != null) {\n batchItem.dataIndexInside = batchItem.dataIndex;\n batchItem.dataIndex = null;\n }\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\n });\n return batch;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as helper from './helper.js';\nimport * as modelUtil from '../../util/model.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { setAsHighDownDispatcher } from '../../util/states.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { findEventDispatcher } from '../../util/event.js';\nvar linearMap = numberUtil.linearMap;\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\n// Arbitrary value\nvar HOVER_LINK_SIZE = 12;\nvar HOVER_LINK_OUT = 6;\n// Notice:\n// Any \"interval\" should be by the order of [low, high].\n// \"handle0\" (handleIndex === 0) maps to\n// low data value: this._dataInterval[0] and has low coord.\n// \"handle1\" (handleIndex === 1) maps to\n// high data value: this._dataInterval[1] and has high coord.\n// The logic of transform is implemented in this._createBarGroup.\nvar ContinuousView = /** @class */function (_super) {\n __extends(ContinuousView, _super);\n function ContinuousView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = ContinuousView.type;\n _this._shapes = {};\n _this._dataInterval = [];\n _this._handleEnds = [];\n _this._hoverLinkDataIndices = [];\n return _this;\n }\n ContinuousView.prototype.init = function (ecModel, api) {\n _super.prototype.init.call(this, ecModel, api);\n this._hoverLinkFromSeriesMouseOver = zrUtil.bind(this._hoverLinkFromSeriesMouseOver, this);\n this._hideIndicator = zrUtil.bind(this._hideIndicator, this);\n };\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\n this._buildView();\n }\n };\n ContinuousView.prototype._buildView = function () {\n this.group.removeAll();\n var visualMapModel = this.visualMapModel;\n var thisGroup = this.group;\n this._orient = visualMapModel.get('orient');\n this._useHandle = visualMapModel.get('calculable');\n this._resetInterval();\n this._renderBar(thisGroup);\n var dataRangeText = visualMapModel.get('text');\n this._renderEndsText(thisGroup, dataRangeText, 0);\n this._renderEndsText(thisGroup, dataRangeText, 1);\n // Do this for background size calculation.\n this._updateView(true);\n // After updating view, inner shapes is built completely,\n // and then background can be rendered.\n this.renderBackground(thisGroup);\n // Real update view\n this._updateView();\n this._enableHoverLinkToSeries();\n this._enableHoverLinkFromSeries();\n this.positionGroup(thisGroup);\n };\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\n if (!dataRangeText) {\n return;\n }\n // Compatible with ec2, text[0] map to high value, text[1] map low value.\n var text = dataRangeText[1 - endsIndex];\n text = text != null ? text + '' : '';\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var itemSize = visualMapModel.itemSize;\n var barGroup = this._shapes.mainGroup;\n var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup);\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\n var orient = this._orient;\n var textStyleModel = this.visualMapModel.textStyleModel;\n this.group.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n x: position[0],\n y: position[1],\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\n align: orient === 'horizontal' ? align : 'center',\n text: text\n })\n }));\n };\n ContinuousView.prototype._renderBar = function (targetGroup) {\n var visualMapModel = this.visualMapModel;\n var shapes = this._shapes;\n var itemSize = visualMapModel.itemSize;\n var orient = this._orient;\n var useHandle = this._useHandle;\n var itemAlign = helper.getItemAlign(visualMapModel, this.api, itemSize);\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\n var gradientBarGroup = new graphic.Group();\n mainGroup.add(gradientBarGroup);\n // Bar\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor(this._orient) : null, zrUtil.bind(this._dragHandle, this, 'all', false), zrUtil.bind(this._dragHandle, this, 'all', true)));\n // A border radius clip.\n gradientBarGroup.setClipPath(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: itemSize[0],\n height: itemSize[1],\n r: 3\n }\n }));\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\n var textSize = mathMax(textRect.width, textRect.height);\n // Handle\n if (useHandle) {\n shapes.handleThumbs = [];\n shapes.handleLabels = [];\n shapes.handleLabelPoints = [];\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\n }\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\n targetGroup.add(mainGroup);\n };\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\n var onDrift = zrUtil.bind(this._dragHandle, this, handleIndex, false);\n var onDragEnd = zrUtil.bind(this._dragHandle, this, handleIndex, true);\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\n var cursor = getCursor(this._orient);\n handleThumb.attr({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n ondragend: onDragEnd,\n onmousemove: function (e) {\n eventTool.stop(e.event);\n }\n });\n handleThumb.x = itemSize[0] / 2;\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\n handleThumb.setStyle({\n strokeNoScale: true,\n strokeFirst: true\n });\n handleThumb.style.lineWidth *= 2;\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n setAsHighDownDispatcher(handleThumb, true);\n mainGroup.add(handleThumb);\n // Text is always horizontal layout but should not be effected by\n // transform (orient/inverse). So label is built separately but not\n // use zrender/graphic/helper/RectText, and is located based on view\n // group (according to handleLabelPoint) but not barGroup.\n var textStyleModel = this.visualMapModel.textStyleModel;\n var handleLabel = new graphic.Text({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: ''\n })\n });\n handleLabel.ensureState('blur').style = {\n opacity: 0.1\n };\n handleLabel.stateTransition = {\n duration: 200\n };\n this.group.add(handleLabel);\n var handleLabelPoint = [handleSize, 0];\n var shapes = this._shapes;\n shapes.handleThumbs[handleIndex] = handleThumb;\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\n shapes.handleLabels[handleIndex] = handleLabel;\n };\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\n indicator.attr({\n cursor: 'move',\n invisible: true,\n silent: true,\n x: itemSize[0] / 2\n });\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\n if (indicator instanceof ZRImage) {\n var pathStyle = indicator.style;\n indicator.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, indicatorStyle));\n } else {\n indicator.useStyle(indicatorStyle);\n }\n mainGroup.add(indicator);\n var textStyleModel = this.visualMapModel.textStyleModel;\n var indicatorLabel = new graphic.Text({\n silent: true,\n invisible: true,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: ''\n })\n });\n this.group.add(indicatorLabel);\n var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0];\n var shapes = this._shapes;\n shapes.indicator = indicator;\n shapes.indicatorLabel = indicatorLabel;\n shapes.indicatorLabelPoint = indicatorLabelPoint;\n this._firstShowIndicator = true;\n };\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd,\n // dx is event from ondragend if isEnd is true. It's not used\n dx, dy) {\n if (!this._useHandle) {\n return;\n }\n this._dragging = !isEnd;\n if (!isEnd) {\n // Transform dx, dy to bar coordination.\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\n this._updateInterval(handleIndex, vertex[1]);\n this._hideIndicator();\n // Considering realtime, update view should be executed\n // before dispatch action.\n this._updateView();\n }\n // dragEnd do not dispatch action when realtime.\n if (isEnd === !this.visualMapModel.get('realtime')) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: this._dataInterval.slice()\n });\n }\n if (isEnd) {\n !this._hovering && this._clearHoverLinkToSeries();\n } else if (useHoverLinkOnHandle(this.visualMapModel)) {\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\n }\n };\n ContinuousView.prototype._resetInterval = function () {\n var visualMapModel = this.visualMapModel;\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\n var dataExtent = visualMapModel.getExtent();\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n this._handleEnds = [linearMap(dataInterval[0], dataExtent, sizeExtent, true), linearMap(dataInterval[1], dataExtent, sizeExtent, true)];\n };\n /**\n * @private\n * @param {(number|string)} handleIndex 0 or 1 or 'all'\n * @param {number} dx\n * @param {number} dy\n */\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\n delta = delta || 0;\n var visualMapModel = this.visualMapModel;\n var handleEnds = this._handleEnds;\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n sliderMove(delta, handleEnds, sizeExtent, handleIndex,\n // cross is forbidden\n 0);\n var dataExtent = visualMapModel.getExtent();\n // Update data interval.\n this._dataInterval = [linearMap(handleEnds[0], sizeExtent, dataExtent, true), linearMap(handleEnds[1], sizeExtent, dataExtent, true)];\n };\n ContinuousView.prototype._updateView = function (forSketch) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var shapes = this._shapes;\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\n shapes.inRange.setStyle({\n fill: visualInRange.barColor\n // opacity: visualInRange.opacity\n }).setShape('points', visualInRange.barPoints);\n shapes.outOfRange.setStyle({\n fill: visualOutOfRange.barColor\n // opacity: visualOutOfRange.opacity\n }).setShape('points', visualOutOfRange.barPoints);\n this._updateHandle(inRangeHandleEnds, visualInRange);\n };\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\n var opts = {\n forceState: forceState,\n convertOpacityToAlpha: true\n };\n var colorStops = this._makeColorGradient(dataInterval, opts);\n var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)];\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\n return {\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\n barPoints: barPoints,\n handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]\n };\n };\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\n // Considering colorHue, which is not linear, so we have to sample\n // to calculate gradient color stops, but not only calculate head\n // and tail.\n var sampleNumber = 100; // Arbitrary value.\n var colorStops = [];\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\n colorStops.push({\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\n offset: 0\n });\n for (var i = 1; i < sampleNumber; i++) {\n var currValue = dataInterval[0] + step * i;\n if (currValue > dataInterval[1]) {\n break;\n }\n colorStops.push({\n color: this.getControllerVisual(currValue, 'color', opts),\n offset: i / sampleNumber\n });\n }\n colorStops.push({\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\n offset: 1\n });\n return colorStops;\n };\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\n var itemSize = this.visualMapModel.itemSize;\n return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]];\n };\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\n var orient = this._orient;\n var inverse = this.visualMapModel.get('inverse');\n return new graphic.Group(orient === 'horizontal' && !inverse ? {\n scaleX: itemAlign === 'bottom' ? 1 : -1,\n rotation: Math.PI / 2\n } : orient === 'horizontal' && inverse ? {\n scaleX: itemAlign === 'bottom' ? -1 : 1,\n rotation: -Math.PI / 2\n } : orient === 'vertical' && !inverse ? {\n scaleX: itemAlign === 'left' ? 1 : -1,\n scaleY: -1\n } : {\n scaleX: itemAlign === 'left' ? 1 : -1\n });\n };\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\n if (!this._useHandle) {\n return;\n }\n var shapes = this._shapes;\n var visualMapModel = this.visualMapModel;\n var handleThumbs = shapes.handleThumbs;\n var handleLabels = shapes.handleLabels;\n var itemSize = visualMapModel.itemSize;\n var dataExtent = visualMapModel.getExtent();\n each([0, 1], function (handleIndex) {\n var handleThumb = handleThumbs[handleIndex];\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\n handleThumb.y = handleEnds[handleIndex];\n var val = linearMap(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\n handleThumb.x = itemSize[0] - symbolSize / 2;\n // Update handle label position.\n var textPoint = graphic.applyTransform(shapes.handleLabelPoints[handleIndex], graphic.getTransform(handleThumb, this.group));\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\n verticalAlign: 'middle',\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\n });\n }, this);\n };\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var itemSize = visualMapModel.itemSize;\n var sizeExtent = [0, itemSize[1]];\n var shapes = this._shapes;\n var indicator = shapes.indicator;\n if (!indicator) {\n return;\n }\n indicator.attr('invisible', false);\n var opts = {\n convertOpacityToAlpha: true\n };\n var color = this.getControllerVisual(cursorValue, 'color', opts);\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\n var y = linearMap(cursorValue, dataExtent, sizeExtent, true);\n var x = itemSize[0] - symbolSize / 2;\n var oldIndicatorPos = {\n x: indicator.x,\n y: indicator.y\n };\n // Update handle label position.\n indicator.y = y;\n indicator.x = x;\n var textPoint = graphic.applyTransform(shapes.indicatorLabelPoint, graphic.getTransform(indicator, this.group));\n var indicatorLabel = shapes.indicatorLabel;\n indicatorLabel.attr('invisible', false);\n var align = this._applyTransform('left', shapes.mainGroup);\n var orient = this._orient;\n var isHorizontal = orient === 'horizontal';\n indicatorLabel.setStyle({\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\n verticalAlign: isHorizontal ? align : 'middle',\n align: isHorizontal ? 'center' : align\n });\n var indicatorNewProps = {\n x: x,\n y: y,\n style: {\n fill: color\n }\n };\n var labelNewProps = {\n style: {\n x: textPoint[0],\n y: textPoint[1]\n }\n };\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\n var animationCfg = {\n duration: 100,\n easing: 'cubicInOut',\n additive: true\n };\n indicator.x = oldIndicatorPos.x;\n indicator.y = oldIndicatorPos.y;\n indicator.animateTo(indicatorNewProps, animationCfg);\n indicatorLabel.animateTo(labelNewProps, animationCfg);\n } else {\n indicator.attr(indicatorNewProps);\n indicatorLabel.attr(labelNewProps);\n }\n this._firstShowIndicator = false;\n var handleLabels = this._shapes.handleLabels;\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this.api.enterBlur(handleLabels[i]);\n }\n }\n };\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\n var self = this;\n this._shapes.mainGroup.on('mousemove', function (e) {\n self._hovering = true;\n if (!self._dragging) {\n var itemSize = self.visualMapModel.itemSize;\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);\n // For hover link show when hover handle, which might be\n // below or upper than sizeExtent.\n pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\n }\n }).on('mouseout', function () {\n // When mouse is out of handle, hoverLink still need\n // to be displayed when realtime is set as false.\n self._hovering = false;\n !self._dragging && self._clearHoverLinkToSeries();\n });\n };\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\n var zr = this.api.getZr();\n if (this.visualMapModel.option.hoverLink) {\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\n zr.on('mouseout', this._hideIndicator, this);\n } else {\n this._clearHoverLinkFromSeries();\n }\n };\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\n var visualMapModel = this.visualMapModel;\n var itemSize = visualMapModel.itemSize;\n if (!visualMapModel.option.hoverLink) {\n return;\n }\n var sizeExtent = [0, itemSize[1]];\n var dataExtent = visualMapModel.getExtent();\n // For hover link show when hover handle, which might be below or upper than sizeExtent.\n cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\n var cursorValue = linearMap(cursorPos, sizeExtent, dataExtent, true);\n var valueRange = [linearMap(hoverRange[0], sizeExtent, dataExtent, true), linearMap(hoverRange[1], sizeExtent, dataExtent, true)];\n // Consider data range is out of visualMap range, see test/visualMap-continuous.html,\n // where china and india has very large population.\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);\n // Do not show indicator when mouse is over handle,\n // otherwise labels overlap, especially when dragging.\n if (hoverOnBar) {\n if (valueRange[0] === -Infinity) {\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\n } else if (valueRange[1] === Infinity) {\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\n } else {\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\n }\n }\n // When realtime is set as false, handles, which are in barGroup,\n // also trigger hoverLink, which help user to realize where they\n // focus on when dragging. (see test/heatmap-large.html)\n // When realtime is set as true, highlight will not show when hover\n // handle, because the label on handle, which displays a exact value\n // but not range, might mislead users.\n var oldBatch = this._hoverLinkDataIndices;\n var newBatch = [];\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\n }\n var resultBatches = modelUtil.compressBatches(oldBatch, newBatch);\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(resultBatches[0], visualMapModel));\n this._dispatchHighDown('highlight', helper.makeHighDownBatch(resultBatches[1], visualMapModel));\n };\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\n var ecData;\n findEventDispatcher(e.target, function (target) {\n var currECData = getECData(target);\n if (currECData.dataIndex != null) {\n ecData = currECData;\n return true;\n }\n }, true);\n if (!ecData) {\n return;\n }\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\n var visualMapModel = this.visualMapModel;\n if (!visualMapModel.isTargetSeries(dataModel)) {\n return;\n }\n var data = dataModel.getData(ecData.dataType);\n var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex);\n if (!isNaN(value)) {\n this._showIndicator(value, value);\n }\n };\n ContinuousView.prototype._hideIndicator = function () {\n var shapes = this._shapes;\n shapes.indicator && shapes.indicator.attr('invisible', true);\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\n var handleLabels = this._shapes.handleLabels;\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this.api.leaveBlur(handleLabels[i]);\n }\n }\n };\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\n this._hideIndicator();\n var indices = this._hoverLinkDataIndices;\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(indices, this.visualMapModel));\n indices.length = 0;\n };\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\n this._hideIndicator();\n var zr = this.api.getZr();\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\n zr.off('mouseout', this._hideIndicator);\n };\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\n var transform = graphic.getTransform(element, global ? null : this.group);\n return zrUtil.isArray(vertex) ? graphic.applyTransform(vertex, transform, inverse) : graphic.transformDirection(vertex, transform, inverse);\n };\n // TODO: TYPE more specified payload types.\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\n batch && batch.length && this.api.dispatchAction({\n type: type,\n batch: batch\n });\n };\n /**\n * @override\n */\n ContinuousView.prototype.dispose = function () {\n this._clearHoverLinkFromSeries();\n this._clearHoverLinkToSeries();\n };\n ContinuousView.type = 'visualMap.continuous';\n return ContinuousView;\n}(VisualMapView);\nfunction createPolygon(points, cursor, onDrift, onDragEnd) {\n return new graphic.Polygon({\n shape: {\n points: points\n },\n draggable: !!onDrift,\n cursor: cursor,\n drift: onDrift,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd\n });\n}\nfunction getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\n if (hoverLinkDataSize) {\n halfHoverLinkSize = linearMap(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\n }\n return halfHoverLinkSize;\n}\nfunction useHoverLinkOnHandle(visualMapModel) {\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\n}\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\nexport default ContinuousView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport var visualMapActionInfo = {\n type: 'selectDataRange',\n event: 'dataRangeSelected',\n // FIXME use updateView appears wrong\n update: 'update'\n};\nexport var visualMapActionHander = function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'visualMap',\n query: payload\n }, function (model) {\n model.setSelected(payload.selected);\n });\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nexport var visualMapEncodingHandlers = [{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var resetDefines = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n var pipelineContext = seriesModel.pipelineContext;\n if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {\n return;\n }\n resetDefines.push(visualSolution.incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, zrUtil.bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData())));\n });\n return resetDefines;\n }\n},\n// Only support color.\n{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var visualMetaList = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n if (visualMapModel.isTargetSeries(seriesModel)) {\n var visualMeta = visualMapModel.getVisualMeta(zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)) || {\n stops: [],\n outerColors: []\n };\n var dimIdx = visualMapModel.getDataDimensionIndex(data);\n if (dimIdx >= 0) {\n // visualMeta.dimension should be dimension index, but not concrete dimension.\n visualMeta.dimension = dimIdx;\n visualMetaList.push(visualMeta);\n }\n }\n });\n // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\n }\n}];\n// FIXME\n// performance and export for heatmap?\n// value can be Infinity or -Infinity\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\n var mappings = visualMapModel.targetVisuals[valueState];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n var resultVisual = {\n color: getVisualFromData(seriesModel.getData(), 'color') // default color.\n };\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type];\n mapping && mapping.applyVisual(value, getVisual, setVisual);\n }\n return resultVisual.color;\n function getVisual(key) {\n return resultVisual[key];\n }\n function setVisual(key, value) {\n resultVisual[key] = value;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar each = zrUtil.each;\nexport default function visualMapPreprocessor(option) {\n var visualMap = option && option.visualMap;\n if (!zrUtil.isArray(visualMap)) {\n visualMap = visualMap ? [visualMap] : [];\n }\n each(visualMap, function (opt) {\n if (!opt) {\n return;\n }\n // rename splitList to pieces\n if (has(opt, 'splitList') && !has(opt, 'pieces')) {\n opt.pieces = opt.splitList;\n delete opt.splitList;\n }\n var pieces = opt.pieces;\n if (pieces && zrUtil.isArray(pieces)) {\n each(pieces, function (piece) {\n if (zrUtil.isObject(piece)) {\n if (has(piece, 'start') && !has(piece, 'min')) {\n piece.min = piece.start;\n }\n if (has(piece, 'end') && !has(piece, 'max')) {\n piece.max = piece.end;\n }\n }\n });\n }\n });\n}\nfunction has(obj, name) {\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { visualMapActionInfo, visualMapActionHander } from './visualMapAction.js';\nimport { visualMapEncodingHandlers } from './visualEncoding.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport preprocessor from './preprocessor.js';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n installed = true;\n registers.registerSubTypeDefaulter('visualMap', function (option) {\n // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\n return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';\n });\n registers.registerAction(visualMapActionInfo, visualMapActionHander);\n each(visualMapEncodingHandlers, function (handler) {\n registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);\n });\n registers.registerPreprocessor(preprocessor);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ContinuousModel from './ContinuousModel.js';\nimport ContinuousView from './ContinuousView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(ContinuousModel);\n registers.registerComponentView(ContinuousView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport { reformIntervals } from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js';\nvar PiecewiseModel = /** @class */function (_super) {\n __extends(PiecewiseModel, _super);\n function PiecewiseModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = PiecewiseModel.type;\n /**\n * The order is always [low, ..., high].\n * [{text: string, interval: Array.}, ...]\n */\n _this._pieceList = [];\n return _this;\n }\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n this.resetExtent();\n var mode = this._mode = this._determineMode();\n this._pieceList = [];\n resetMethods[this._mode].call(this, this._pieceList);\n this._resetSelected(newOption, isInit);\n var categories = this.option.categories;\n this.resetVisual(function (mappingOption, state) {\n if (mode === 'categories') {\n mappingOption.mappingMethod = 'category';\n mappingOption.categories = zrUtil.clone(categories);\n } else {\n mappingOption.dataExtent = this.getExtent();\n mappingOption.mappingMethod = 'piecewise';\n mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {\n piece = zrUtil.clone(piece);\n if (state !== 'inRange') {\n // FIXME\n // outOfRange do not support special visual in pieces.\n piece.visual = null;\n }\n return piece;\n });\n }\n });\n };\n /**\n * @protected\n * @override\n */\n PiecewiseModel.prototype.completeVisualOption = function () {\n // Consider this case:\n // visualMap: {\n // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]\n // }\n // where no inRange/outOfRange set but only pieces. So we should make\n // default inRange/outOfRange for this case, otherwise visuals that only\n // appear in `pieces` will not be taken into account in visual encoding.\n var option = this.option;\n var visualTypesInPieces = {};\n var visualTypes = VisualMapping.listVisualTypes();\n var isCategory = this.isCategory();\n zrUtil.each(option.pieces, function (piece) {\n zrUtil.each(visualTypes, function (visualType) {\n if (piece.hasOwnProperty(visualType)) {\n visualTypesInPieces[visualType] = 1;\n }\n });\n });\n zrUtil.each(visualTypesInPieces, function (v, visualType) {\n var exists = false;\n zrUtil.each(this.stateList, function (state) {\n exists = exists || has(option, state, visualType) || has(option.target, state, visualType);\n }, this);\n !exists && zrUtil.each(this.stateList, function (state) {\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\n });\n }, this);\n function has(obj, state, visualType) {\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\n }\n _super.prototype.completeVisualOption.apply(this, arguments);\n };\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\n var thisOption = this.option;\n var pieceList = this._pieceList;\n // Selected do not merge but all override.\n var selected = (isInit ? thisOption : newOption).selected || {};\n thisOption.selected = selected;\n // Consider 'not specified' means true.\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n if (!selected.hasOwnProperty(key)) {\n selected[key] = true;\n }\n }, this);\n if (thisOption.selectedMode === 'single') {\n // Ensure there is only one selected.\n var hasSel_1 = false;\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n if (selected[key]) {\n hasSel_1 ? selected[key] = false : hasSel_1 = true;\n }\n }, this);\n }\n // thisOption.selectedMode === 'multiple', default: all selected.\n };\n /**\n * @public\n */\n PiecewiseModel.prototype.getItemSymbol = function () {\n return this.get('itemSymbol');\n };\n /**\n * @public\n */\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\n return this._mode === 'categories' ? piece.value + '' : piece.index + '';\n };\n /**\n * @public\n */\n PiecewiseModel.prototype.getPieceList = function () {\n return this._pieceList;\n };\n /**\n * @return {string}\n */\n PiecewiseModel.prototype._determineMode = function () {\n var option = this.option;\n return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber';\n };\n /**\n * @override\n */\n PiecewiseModel.prototype.setSelected = function (selected) {\n this.option.selected = zrUtil.clone(selected);\n };\n /**\n * @override\n */\n PiecewiseModel.prototype.getValueState = function (value) {\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\n return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' : 'outOfRange';\n };\n /**\n * @public\n * @param pieceIndex piece index in visualMapModel.getPieceList()\n */\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\n var result = [];\n var pieceList = this._pieceList;\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n // Should always base on model pieceList, because it is order sensitive.\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\n pIdx === pieceIndex && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\n * @private\n * @param piece piece.value or piece.interval is required.\n * @return Can be Infinity or -Infinity\n */\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\n var representValue;\n if (this.isCategory()) {\n representValue = piece.value;\n } else {\n if (piece.value != null) {\n representValue = piece.value;\n } else {\n var pieceInterval = piece.interval || [];\n representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;\n }\n }\n return representValue;\n };\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\n // Do not support category. (category axis is ordinal, numerical)\n if (this.isCategory()) {\n return;\n }\n var stops = [];\n var outerColors = ['', ''];\n var visualMapModel = this;\n function setStop(interval, valueState) {\n var representValue = visualMapModel.getRepresentValue({\n interval: interval\n }); // Not category\n if (!valueState) {\n valueState = visualMapModel.getValueState(representValue);\n }\n var color = getColorVisual(representValue, valueState);\n if (interval[0] === -Infinity) {\n outerColors[0] = color;\n } else if (interval[1] === Infinity) {\n outerColors[1] = color;\n } else {\n stops.push({\n value: interval[0],\n color: color\n }, {\n value: interval[1],\n color: color\n });\n }\n }\n // Suplement\n var pieceList = this._pieceList.slice();\n if (!pieceList.length) {\n pieceList.push({\n interval: [-Infinity, Infinity]\n });\n } else {\n var edge = pieceList[0].interval[0];\n edge !== -Infinity && pieceList.unshift({\n interval: [-Infinity, edge]\n });\n edge = pieceList[pieceList.length - 1].interval[1];\n edge !== Infinity && pieceList.push({\n interval: [edge, Infinity]\n });\n }\n var curr = -Infinity;\n zrUtil.each(pieceList, function (piece) {\n var interval = piece.interval;\n if (interval) {\n // Fulfill gap.\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\n setStop(interval.slice());\n curr = interval[1];\n }\n }, this);\n return {\n stops: stops,\n outerColors: outerColors\n };\n };\n PiecewiseModel.type = 'visualMap.piecewise';\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n selected: null,\n minOpen: false,\n maxOpen: false,\n align: 'auto',\n itemWidth: 20,\n itemHeight: 14,\n itemSymbol: 'roundRect',\n pieces: null,\n categories: null,\n splitNumber: 5,\n selectedMode: 'multiple',\n itemGap: 10,\n hoverLink: true // Enable hover highlight.\n });\n\n return PiecewiseModel;\n}(VisualMapModel);\n;\n/**\n * Key is this._mode\n * @type {Object}\n * @this {module:echarts/component/viusalMap/PiecewiseMode}\n */\nvar resetMethods = {\n splitNumber: function (outPieceList) {\n var thisOption = this.option;\n var precision = Math.min(thisOption.precision, 20);\n var dataExtent = this.getExtent();\n var splitNumber = thisOption.splitNumber;\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\n thisOption.splitNumber = splitNumber;\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;\n // Precision auto-adaption\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\n precision++;\n }\n thisOption.precision = precision;\n splitStep = +splitStep.toFixed(precision);\n if (thisOption.minOpen) {\n outPieceList.push({\n interval: [-Infinity, dataExtent[0]],\n close: [0, 0]\n });\n }\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\n var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;\n outPieceList.push({\n interval: [curr, max],\n close: [1, 1]\n });\n }\n if (thisOption.maxOpen) {\n outPieceList.push({\n interval: [dataExtent[1], Infinity],\n close: [0, 0]\n });\n }\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece, index) {\n piece.index = index;\n piece.text = this.formatValueText(piece.interval);\n }, this);\n },\n categories: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.categories, function (cate) {\n // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。\n // 是否改一致。\n outPieceList.push({\n text: this.formatValueText(cate, true),\n value: cate\n });\n }, this);\n // See \"Order Rule\".\n normalizeReverse(thisOption, outPieceList);\n },\n pieces: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.pieces, function (pieceListItem, index) {\n if (!zrUtil.isObject(pieceListItem)) {\n pieceListItem = {\n value: pieceListItem\n };\n }\n var item = {\n text: '',\n index: index\n };\n if (pieceListItem.label != null) {\n item.text = pieceListItem.label;\n }\n if (pieceListItem.hasOwnProperty('value')) {\n var value = item.value = pieceListItem.value;\n item.interval = [value, value];\n item.close = [1, 1];\n } else {\n // `min` `max` is legacy option.\n // `lt` `gt` `lte` `gte` is recommended.\n var interval = item.interval = [];\n var close_1 = item.close = [0, 0];\n var closeList = [1, 0, 1];\n var infinityList = [-Infinity, Infinity];\n var useMinMax = [];\n for (var lg = 0; lg < 2; lg++) {\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\n interval[lg] = pieceListItem[names[i]];\n close_1[lg] = closeList[i];\n useMinMax[lg] = i === 2;\n }\n interval[lg] == null && (interval[lg] = infinityList[lg]);\n }\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\n if (process.env.NODE_ENV !== 'production') {\n if (interval[0] > interval[1]) {\n console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.');\n }\n }\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\n // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],\n // we use value to lift the priority when min === max\n item.value = interval[0];\n }\n }\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\n outPieceList.push(item);\n }, this);\n // See \"Order Rule\".\n normalizeReverse(thisOption, outPieceList);\n // Only pieces\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece) {\n var close = piece.close;\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\n }, this);\n }\n};\nfunction normalizeReverse(thisOption, pieceList) {\n var inverse = thisOption.inverse;\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\n pieceList.reverse();\n }\n}\nexport default PiecewiseModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from './helper.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar PiecewiseVisualMapView = /** @class */function (_super) {\n __extends(PiecewiseVisualMapView, _super);\n function PiecewiseVisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = PiecewiseVisualMapView.type;\n return _this;\n }\n PiecewiseVisualMapView.prototype.doRender = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var textStyleModel = visualMapModel.textStyleModel;\n var textFont = textStyleModel.getFont();\n var textFill = textStyleModel.getTextColor();\n var itemAlign = this._getItemAlign();\n var itemSize = visualMapModel.itemSize;\n var viewData = this._getViewData();\n var endsText = viewData.endsText;\n var showLabel = zrUtil.retrieve(visualMapModel.get('showLabel', true), !endsText);\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\n zrUtil.each(viewData.viewPieceList, function (item) {\n var piece = item.piece;\n var itemGroup = new graphic.Group();\n itemGroup.onclick = zrUtil.bind(this._onItemClick, this, piece);\n this._enableHoverLink(itemGroup, item.indexInModelPieceList);\n // TODO Category\n var representValue = visualMapModel.getRepresentValue(piece);\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\n if (showLabel) {\n var visualState = this.visualMapModel.getValueState(representValue);\n itemGroup.add(new graphic.Text({\n style: {\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\n y: itemSize[1] / 2,\n text: piece.text,\n verticalAlign: 'middle',\n align: itemAlign,\n font: textFont,\n fill: textFill,\n opacity: visualState === 'outOfRange' ? 0.5 : 1\n }\n }));\n }\n thisGroup.add(itemGroup);\n }, this);\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\n layout.box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\n this.renderBackground(thisGroup);\n this.positionGroup(thisGroup);\n };\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\n var _this = this;\n itemGroup.on('mouseover', function () {\n return onHoverLink('highlight');\n }).on('mouseout', function () {\n return onHoverLink('downplay');\n });\n var onHoverLink = function (method) {\n var visualMapModel = _this.visualMapModel;\n // TODO: TYPE More detailed action types\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\n type: method,\n batch: helper.makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\n });\n };\n };\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\n var visualMapModel = this.visualMapModel;\n var modelOption = visualMapModel.option;\n if (modelOption.orient === 'vertical') {\n return helper.getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\n } else {\n // horizontal, most case left unless specifying right.\n var align = modelOption.align;\n if (!align || align === 'auto') {\n align = 'left';\n }\n return align;\n }\n };\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\n if (!text) {\n return;\n }\n var itemGroup = new graphic.Group();\n var textStyleModel = this.visualMapModel.textStyleModel;\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2,\n y: itemSize[1] / 2,\n verticalAlign: 'middle',\n align: showLabel ? itemAlign : 'center',\n text: text\n })\n }));\n group.add(itemGroup);\n };\n /**\n * @private\n * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.\n */\n PiecewiseVisualMapView.prototype._getViewData = function () {\n var visualMapModel = this.visualMapModel;\n var viewPieceList = zrUtil.map(visualMapModel.getPieceList(), function (piece, index) {\n return {\n piece: piece,\n indexInModelPieceList: index\n };\n });\n var endsText = visualMapModel.get('text');\n // Consider orient and inverse.\n var orient = visualMapModel.get('orient');\n var inverse = visualMapModel.get('inverse');\n // Order of model pieceList is always [low, ..., high]\n if (orient === 'horizontal' ? inverse : !inverse) {\n viewPieceList.reverse();\n }\n // Origin order of endsText is [high, low]\n else if (endsText) {\n endsText = endsText.slice().reverse();\n }\n return {\n viewPieceList: viewPieceList,\n endsText: endsText\n };\n };\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\n group.add(createSymbol(\n // symbol will be string\n this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3],\n // color will be string\n this.getControllerVisual(representValue, 'color')));\n };\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\n var visualMapModel = this.visualMapModel;\n var option = visualMapModel.option;\n var selectedMode = option.selectedMode;\n if (!selectedMode) {\n return;\n }\n var selected = zrUtil.clone(option.selected);\n var newKey = visualMapModel.getSelectedMapKey(piece);\n if (selectedMode === 'single' || selectedMode === true) {\n selected[newKey] = true;\n zrUtil.each(selected, function (o, key) {\n selected[key] = key === newKey;\n });\n } else {\n selected[newKey] = !selected[newKey];\n }\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: selected\n });\n };\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\n return PiecewiseVisualMapView;\n}(VisualMapView);\nexport default PiecewiseVisualMapView;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport PiecewiseModel from './PiecewiseModel.js';\nimport PiecewiseView from './PiecewiseView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(PiecewiseModel);\n registers.registerComponentView(PiecewiseView);\n installCommon(registers);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from '../../extension.js';\nimport { install as installVisualMapContinuous } from './installVisualMapContinuous.js';\nimport { install as installVisualMapPiecewise } from './installVisualMapPiecewise.js';\nexport function install(registers) {\n use(installVisualMapContinuous);\n use(installVisualMapPiecewise);\n // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js';\nimport { getDecalFromPalette } from '../model/mixin/palette.js';\nvar DEFAULT_OPTION = {\n label: {\n enabled: true\n },\n decal: {\n show: false\n }\n};\nvar inner = makeInner();\nvar decalPaletteScope = {};\nexport default function ariaVisual(ecModel, api) {\n var ariaModel = ecModel.getModel('aria');\n // See \"area enabled\" detection code in `GlobalModel.ts`.\n if (!ariaModel.get('enabled')) {\n return;\n }\n var defaultOption = zrUtil.clone(DEFAULT_OPTION);\n zrUtil.merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\n zrUtil.merge(ariaModel.option, defaultOption, false);\n setDecal();\n setLabel();\n function setDecal() {\n var decalModel = ariaModel.getModel('decal');\n var useDecal = decalModel.get('show');\n if (useDecal) {\n // Each type of series use one scope.\n // Pie and funnel are using different scopes.\n var paletteScopeGroupByType_1 = zrUtil.createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.isColorBySeries()) {\n return;\n }\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\n if (!decalScope) {\n decalScope = {};\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\n }\n inner(seriesModel).scope = decalScope;\n });\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n if (zrUtil.isFunction(seriesModel.enableAriaDecal)) {\n // Let series define how to use decal palette on data\n seriesModel.enableAriaDecal();\n return;\n }\n var data = seriesModel.getData();\n if (!seriesModel.isColorBySeries()) {\n var dataAll_1 = seriesModel.getRawData();\n var idxMap_1 = {};\n var decalScope_1 = inner(seriesModel).scope;\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap_1[rawIdx] = idx;\n });\n var dataCount_1 = dataAll_1.count();\n dataAll_1.each(function (rawIdx) {\n var idx = idxMap_1[rawIdx];\n var name = dataAll_1.getName(rawIdx) || rawIdx + '';\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\n var specifiedDecal = data.getItemVisual(idx, 'decal');\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\n });\n } else {\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\n var specifiedDecal = data.getVisual('decal');\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\n }\n function mergeDecal(specifiedDecal, paletteDecal) {\n // Merge decal from palette to decal from itemStyle.\n // User do not need to specify all of the decal props.\n var resultDecal = specifiedDecal ? zrUtil.extend(zrUtil.extend({}, paletteDecal), specifiedDecal) : paletteDecal;\n resultDecal.dirty = true;\n return resultDecal;\n }\n });\n }\n }\n function setLabel() {\n var dom = api.getZr().dom;\n // TODO: support for SSR\n if (!dom) {\n return;\n }\n var labelLocale = ecModel.getLocaleModel().get('aria');\n var labelModel = ariaModel.getModel('label');\n labelModel.option = zrUtil.defaults(labelModel.option, labelLocale);\n if (!labelModel.get('enabled')) {\n return;\n }\n if (labelModel.get('description')) {\n dom.setAttribute('aria-label', labelModel.get('description'));\n return;\n }\n var seriesCnt = ecModel.getSeriesCount();\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\n var ariaLabel;\n if (seriesCnt < 1) {\n // No series, no aria label\n return;\n } else {\n var title = getTitle();\n if (title) {\n var withTitle = labelModel.get(['general', 'withTitle']);\n ariaLabel = replace(withTitle, {\n title: title\n });\n } else {\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\n }\n var seriesLabels_1 = [];\n var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']);\n ariaLabel += replace(prefix, {\n seriesCount: seriesCnt\n });\n ecModel.eachSeries(function (seriesModel, idx) {\n if (idx < displaySeriesCnt) {\n var seriesLabel = void 0;\n var seriesName = seriesModel.get('name');\n var withName = seriesName ? 'withName' : 'withoutName';\n seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]);\n seriesLabel = replace(seriesLabel, {\n seriesId: seriesModel.seriesIndex,\n seriesName: seriesModel.get('name'),\n seriesType: getSeriesTypeName(seriesModel.subType)\n });\n var data = seriesModel.getData();\n if (data.count() > maxDataCnt) {\n // Show part of data\n var partialLabel = labelModel.get(['data', 'partialData']);\n seriesLabel += replace(partialLabel, {\n displayCnt: maxDataCnt\n });\n } else {\n seriesLabel += labelModel.get(['data', 'allData']);\n }\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\n var dataLabels = [];\n for (var i = 0; i < data.count(); i++) {\n if (i < maxDataCnt) {\n var name_1 = data.getName(i);\n var value = data.getValues(i);\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\n dataLabels.push(replace(dataLabel, {\n name: name_1,\n value: value.join(middleSeparator_1)\n }));\n }\n }\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\n seriesLabels_1.push(seriesLabel);\n }\n });\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\n var middleSeparator = separatorModel.get('middle');\n var endSeparator = separatorModel.get('end');\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\n dom.setAttribute('aria-label', ariaLabel);\n }\n }\n function replace(str, keyValues) {\n if (!zrUtil.isString(str)) {\n return str;\n }\n var result = str;\n zrUtil.each(keyValues, function (value, key) {\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\n });\n return result;\n }\n function getTitle() {\n var title = ecModel.get('title');\n if (title && title.length) {\n title = title[0];\n }\n return title && title.text;\n }\n function getSeriesTypeName(type) {\n var typeNames = ecModel.getLocaleModel().get(['series', 'typeNames']);\n return typeNames[type] || typeNames.chart;\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function ariaPreprocessor(option) {\n if (!option || !option.aria) {\n return;\n }\n var aria = option.aria;\n // aria.show is deprecated and should use aria.enabled instead\n if (aria.show != null) {\n aria.enabled = aria.show;\n }\n aria.label = aria.label || {};\n // move description, general, series, data to be under aria.label\n zrUtil.each(['description', 'general', 'series', 'data'], function (name) {\n if (aria[name] != null) {\n aria.label[name] = aria[name];\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport ariaVisual from '../../visual/aria.js';\nimport ariaPreprocessor from './preprocessor.js';\nexport function install(registers) {\n registers.registerPreprocessor(ariaPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { keys, isArray, map, isObject, isString, isRegExp, isArrayLike, hasOwn, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError, makePrintable } from './log.js';\nimport { getRawValueParser, createFilterComparator } from '../data/helper/dataValueHelper.js';\n;\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\n value: 'eq',\n // PENDING: not good for literal semantic?\n '<': 'lt',\n '<=': 'lte',\n '>': 'gt',\n '>=': 'gte',\n '=': 'eq',\n '!=': 'ne',\n '<>': 'ne'\n // Might be misleading for sake of the difference between '==' and '===',\n // so don't support them.\n // '==': 'eq',\n // '===': 'seq',\n // '!==': 'sne'\n // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\n // ge: 'gte',\n // le: 'lte',\n // neq: 'ne',\n};\n// type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;\nvar RegExpEvaluator = /** @class */function () {\n function RegExpEvaluator(rVal) {\n // Support condVal: RegExp | string\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;\n if (condValue == null) {\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\n }\n throwError(errMsg);\n }\n }\n RegExpEvaluator.prototype.evaluate = function (lVal) {\n var type = typeof lVal;\n return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false;\n };\n return RegExpEvaluator;\n}();\nvar ConstConditionInternal = /** @class */function () {\n function ConstConditionInternal() {}\n ConstConditionInternal.prototype.evaluate = function () {\n return this.value;\n };\n return ConstConditionInternal;\n}();\nvar AndConditionInternal = /** @class */function () {\n function AndConditionInternal() {}\n AndConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n for (var i = 0; i < children.length; i++) {\n if (!children[i].evaluate()) {\n return false;\n }\n }\n return true;\n };\n return AndConditionInternal;\n}();\nvar OrConditionInternal = /** @class */function () {\n function OrConditionInternal() {}\n OrConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n for (var i = 0; i < children.length; i++) {\n if (children[i].evaluate()) {\n return true;\n }\n }\n return false;\n };\n return OrConditionInternal;\n}();\nvar NotConditionInternal = /** @class */function () {\n function NotConditionInternal() {}\n NotConditionInternal.prototype.evaluate = function () {\n return !this.child.evaluate();\n };\n return NotConditionInternal;\n}();\nvar RelationalConditionInternal = /** @class */function () {\n function RelationalConditionInternal() {}\n RelationalConditionInternal.prototype.evaluate = function () {\n var needParse = !!this.valueParser;\n // Call getValue with no `this`.\n var getValue = this.getValue;\n var tarValRaw = getValue(this.valueGetterParam);\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;\n // Relational cond follow \"and\" logic internally.\n for (var i = 0; i < this.subCondList.length; i++) {\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\n return false;\n }\n }\n return true;\n };\n return RelationalConditionInternal;\n}();\nfunction parseOption(exprOption, getters) {\n if (exprOption === true || exprOption === false) {\n var cond = new ConstConditionInternal();\n cond.value = exprOption;\n return cond;\n }\n var errMsg = '';\n if (!isObjectNotArray(exprOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\n }\n throwError(errMsg);\n }\n if (exprOption.and) {\n return parseAndOrOption('and', exprOption, getters);\n } else if (exprOption.or) {\n return parseAndOrOption('or', exprOption, getters);\n } else if (exprOption.not) {\n return parseNotOption(exprOption, getters);\n }\n return parseRelationalOption(exprOption, getters);\n}\nfunction parseAndOrOption(op, exprOption, getters) {\n var subOptionArr = exprOption[op];\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\n }\n if (!isArray(subOptionArr)) {\n throwError(errMsg);\n }\n if (!subOptionArr.length) {\n throwError(errMsg);\n }\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\n cond.children = map(subOptionArr, function (subOption) {\n return parseOption(subOption, getters);\n });\n if (!cond.children.length) {\n throwError(errMsg);\n }\n return cond;\n}\nfunction parseNotOption(exprOption, getters) {\n var subOption = exprOption.not;\n var errMsg = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\n }\n if (!isObjectNotArray(subOption)) {\n throwError(errMsg);\n }\n var cond = new NotConditionInternal();\n cond.child = parseOption(subOption, getters);\n if (!cond.child) {\n throwError(errMsg);\n }\n return cond;\n}\nfunction parseRelationalOption(exprOption, getters) {\n var errMsg = '';\n var valueGetterParam = getters.prepareGetValue(exprOption);\n var subCondList = [];\n var exprKeys = keys(exprOption);\n var parserName = exprOption.parser;\n var valueParser = parserName ? getRawValueParser(parserName) : null;\n for (var i = 0; i < exprKeys.length; i++) {\n var keyRaw = exprKeys[i];\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\n continue;\n }\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;\n var condValueRaw = exprOption[keyRaw];\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\n var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed);\n if (!evaluator) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\n }\n throwError(errMsg);\n }\n subCondList.push(evaluator);\n }\n if (!subCondList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\n }\n // No relational operator always disabled in case of dangers result.\n throwError(errMsg);\n }\n var cond = new RelationalConditionInternal();\n cond.valueGetterParam = valueGetterParam;\n cond.valueParser = valueParser;\n cond.getValue = getters.getValue;\n cond.subCondList = subCondList;\n return cond;\n}\nfunction isObjectNotArray(val) {\n return isObject(val) && !isArrayLike(val);\n}\nvar ConditionalExpressionParsed = /** @class */function () {\n function ConditionalExpressionParsed(exprOption, getters) {\n this._cond = parseOption(exprOption, getters);\n }\n ConditionalExpressionParsed.prototype.evaluate = function () {\n return this._cond.evaluate();\n };\n return ConditionalExpressionParsed;\n}();\n;\nexport function parseConditionalExpression(exprOption, getters) {\n return new ConditionalExpressionParsed(exprOption, getters);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseConditionalExpression } from '../../util/conditionalExpression.js';\nimport { hasOwn, createHashMap } from 'zrender/lib/core/util.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nexport var filterTransform = {\n type: 'echarts:filter',\n // PENDING: enhance to filter by index rather than create new data\n transform: function (params) {\n // [Caveat] Fail-Fast:\n // Do not return the whole dataset unless user config indicates it explicitly.\n // For example, if no condition is specified by mistake, returning an empty result\n // is better than returning the entire raw source for the user to find the mistake.\n var upstream = params.upstream;\n var rawItem;\n var condition = parseConditionalExpression(params.config, {\n valueGetterAttrMap: createHashMap({\n dimension: true\n }),\n prepareGetValue: function (exprOption) {\n var errMsg = '';\n var dimLoose = exprOption.dimension;\n if (!hasOwn(exprOption, 'dimension')) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\n }\n throwError(errMsg);\n }\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\n }\n throwError(errMsg);\n }\n return {\n dimIdx: dimInfo.index\n };\n },\n getValue: function (param) {\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\n }\n });\n var resultData = [];\n for (var i = 0, len = upstream.count(); i < len; i++) {\n rawItem = upstream.getRawDataItem(i);\n if (condition.evaluate()) {\n resultData.push(rawItem);\n }\n }\n return {\n data: resultData\n };\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS } from '../../util/types.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { getRawValueParser, SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nvar sampleLog = '';\nif (process.env.NODE_ENV !== 'production') {\n sampleLog = ['Valid config is like:', '{ dimension: \"age\", order: \"asc\" }', 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'].join(' ');\n}\nexport var sortTransform = {\n type: 'echarts:sort',\n transform: function (params) {\n var upstream = params.upstream;\n var config = params.config;\n var errMsg = '';\n // Normalize\n // const orderExprList: OrderExpression[] = isArray(config[0])\n // ? config as OrderExpression[]\n // : [config as OrderExpression];\n var orderExprList = normalizeToArray(config);\n if (!orderExprList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Empty `config` in sort transform.';\n }\n throwError(errMsg);\n }\n var orderDefList = [];\n each(orderExprList, function (orderExpr) {\n var dimLoose = orderExpr.dimension;\n var order = orderExpr.order;\n var parserName = orderExpr.parser;\n var incomparable = orderExpr.incomparable;\n if (dimLoose == null) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\n }\n throwError(errMsg);\n }\n if (order !== 'asc' && order !== 'desc') {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\n }\n throwError(errMsg);\n }\n if (incomparable && incomparable !== 'min' && incomparable !== 'max') {\n var errMsg_1 = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\n }\n throwError(errMsg_1);\n }\n if (order !== 'asc' && order !== 'desc') {\n var errMsg_2 = '';\n if (process.env.NODE_ENV !== 'production') {\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\n }\n throwError(errMsg_2);\n }\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n throwError(errMsg);\n }\n var parser = parserName ? getRawValueParser(parserName) : null;\n if (parserName && !parser) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n throwError(errMsg);\n }\n orderDefList.push({\n dimIdx: dimInfo.index,\n parser: parser,\n comparator: new SortOrderComparator(order, incomparable)\n });\n });\n // TODO: support it?\n var sourceFormat = upstream.sourceFormat;\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\n }\n throwError(errMsg);\n }\n // Other upstream format are all array.\n var resultData = [];\n for (var i = 0, len = upstream.count(); i < len; i++) {\n resultData.push(upstream.getRawDataItem(i));\n }\n resultData.sort(function (item0, item1) {\n for (var i = 0; i < orderDefList.length; i++) {\n var orderDef = orderDefList[i];\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\n if (orderDef.parser) {\n val0 = orderDef.parser(val0);\n val1 = orderDef.parser(val1);\n }\n var result = orderDef.comparator.evaluate(val0, val1);\n if (result !== 0) {\n return result;\n }\n }\n return 0;\n });\n return {\n data: resultData\n };\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { filterTransform } from './filterTransform.js';\nimport { sortTransform } from './sortTransform.js';\nexport function install(registers) {\n registers.registerTransform(filterTransform);\n registers.registerTransform(sortTransform);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * This module is imported by echarts directly.\n *\n * Notice:\n * Always keep this file exists for backward compatibility.\n * Because before 4.1.0, dataset is an optional component,\n * some users may import this module manually.\n */\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { SERIES_LAYOUT_BY_COLUMN } from '../../util/types.js';\nimport { disableTransformOptionMerge, SourceManager } from '../../data/helper/sourceManager.js';\nvar DatasetModel = /** @class */function (_super) {\n __extends(DatasetModel, _super);\n function DatasetModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'dataset';\n return _this;\n }\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\n _super.prototype.init.call(this, option, parentModel, ecModel);\n this._sourceManager = new SourceManager(this);\n disableTransformOptionMerge(this);\n };\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\n _super.prototype.mergeOption.call(this, newOption, ecModel);\n disableTransformOptionMerge(this);\n };\n DatasetModel.prototype.optionUpdated = function () {\n this._sourceManager.dirty();\n };\n DatasetModel.prototype.getSourceManager = function () {\n return this._sourceManager;\n };\n DatasetModel.type = 'dataset';\n DatasetModel.defaultOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\n };\n return DatasetModel;\n}(ComponentModel);\nexport { DatasetModel };\nvar DatasetView = /** @class */function (_super) {\n __extends(DatasetView, _super);\n function DatasetView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'dataset';\n return _this;\n }\n DatasetView.type = 'dataset';\n return DatasetView;\n}(ComponentView);\nexport function install(registers) {\n registers.registerComponentModel(DatasetModel);\n registers.registerComponentView(DatasetView);\n}","import { cubicSubdivide } from '../core/curve.js';\nimport PathProxy from '../core/PathProxy.js';\nvar CMD = PathProxy.CMD;\nfunction aroundEqual(a, b) {\n return Math.abs(a - b) < 1e-5;\n}\nexport function pathToBezierCurves(path) {\n var data = path.data;\n var len = path.len();\n var bezierArrayGroups = [];\n var currentSubpath;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n function createNewSubpath(x, y) {\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n currentSubpath = [x, y];\n }\n function addLine(x0, y0, x1, y1) {\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\n }\n }\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\n var delta = Math.abs(endAngle - startAngle);\n var len = Math.tan(delta / 4) * 4 / 3;\n var dir = endAngle < startAngle ? -1 : 1;\n var c1 = Math.cos(startAngle);\n var s1 = Math.sin(startAngle);\n var c2 = Math.cos(endAngle);\n var s2 = Math.sin(endAngle);\n var x1 = c1 * rx + cx;\n var y1 = s1 * ry + cy;\n var x4 = c2 * rx + cx;\n var y4 = s2 * ry + cy;\n var hx = rx * len * dir;\n var hy = ry * len * dir;\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\n }\n var x1;\n var y1;\n var x2;\n var y2;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n if (cmd === CMD.L || cmd === CMD.C || cmd === CMD.Q) {\n currentSubpath = [x0, y0];\n }\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n createNewSubpath(x0, y0);\n break;\n case CMD.L:\n x1 = data[i++];\n y1 = data[i++];\n addLine(xi, yi, x1, y1);\n xi = x1;\n yi = y1;\n break;\n case CMD.C:\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\n break;\n case CMD.Q:\n x1 = data[i++];\n y1 = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\n xi = x2;\n yi = y2;\n break;\n case CMD.A:\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var endAngle = data[i++] + startAngle;\n i += 1;\n var anticlockwise = !data[i++];\n x1 = Math.cos(startAngle) * rx + cx;\n y1 = Math.sin(startAngle) * ry + cy;\n if (isFirst) {\n x0 = x1;\n y0 = y1;\n createNewSubpath(x0, y0);\n }\n else {\n addLine(xi, yi, x1, y1);\n }\n xi = Math.cos(endAngle) * rx + cx;\n yi = Math.sin(endAngle) * ry + cy;\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\n : Math.min(angle + step, endAngle);\n addArc(angle, nextAngle, cx, cy, rx, ry);\n }\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n x1 = x0 + data[i++];\n y1 = y0 + data[i++];\n createNewSubpath(x1, y0);\n addLine(x1, y0, x1, y1);\n addLine(x1, y1, x0, y1);\n addLine(x0, y1, x0, y0);\n addLine(x0, y0, x1, y0);\n break;\n case CMD.Z:\n currentSubpath && addLine(xi, yi, x0, y0);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n return bezierArrayGroups;\n}\nfunction adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out, scale) {\n if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) {\n out.push(x3, y3);\n return;\n }\n var PIXEL_DISTANCE = 2 / scale;\n var PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE;\n var dx = x3 - x0;\n var dy = y3 - y0;\n var d = Math.sqrt(dx * dx + dy * dy);\n dx /= d;\n dy /= d;\n var dx1 = x1 - x0;\n var dy1 = y1 - y0;\n var dx2 = x2 - x3;\n var dy2 = y2 - y3;\n var cp1LenSqr = dx1 * dx1 + dy1 * dy1;\n var cp2LenSqr = dx2 * dx2 + dy2 * dy2;\n if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) {\n out.push(x3, y3);\n return;\n }\n var projLen1 = dx * dx1 + dy * dy1;\n var projLen2 = -dx * dx2 - dy * dy2;\n var d1Sqr = cp1LenSqr - projLen1 * projLen1;\n var d2Sqr = cp2LenSqr - projLen2 * projLen2;\n if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0\n && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0) {\n out.push(x3, y3);\n return;\n }\n var tmpSegX = [];\n var tmpSegY = [];\n cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY);\n adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out, scale);\n adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out, scale);\n}\nexport function pathToPolygons(path, scale) {\n var bezierArrayGroups = pathToBezierCurves(path);\n var polygons = [];\n scale = scale || 1;\n for (var i = 0; i < bezierArrayGroups.length; i++) {\n var beziers = bezierArrayGroups[i];\n var polygon = [];\n var x0 = beziers[0];\n var y0 = beziers[1];\n polygon.push(x0, y0);\n for (var k = 2; k < beziers.length;) {\n var x1 = beziers[k++];\n var y1 = beziers[k++];\n var x2 = beziers[k++];\n var y2 = beziers[k++];\n var x3 = beziers[k++];\n var y3 = beziers[k++];\n adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale);\n x0 = x3;\n y0 = y3;\n }\n polygons.push(polygon);\n }\n return polygons;\n}\n","import { fromPoints } from '../core/bbox.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Point from '../core/Point.js';\nimport { map } from '../core/util.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Sector from '../graphic/shape/Sector.js';\nimport { pathToPolygons } from './convertPath.js';\nimport { clonePath } from './path.js';\nfunction getDividingGrids(dimSize, rowDim, count) {\n var rowSize = dimSize[rowDim];\n var columnSize = dimSize[1 - rowDim];\n var ratio = Math.abs(rowSize / columnSize);\n var rowCount = Math.ceil(Math.sqrt(ratio * count));\n var columnCount = Math.floor(count / rowCount);\n if (columnCount === 0) {\n columnCount = 1;\n rowCount = count;\n }\n var grids = [];\n for (var i = 0; i < rowCount; i++) {\n grids.push(columnCount);\n }\n var currentCount = rowCount * columnCount;\n var remained = count - currentCount;\n if (remained > 0) {\n for (var i = 0; i < remained; i++) {\n grids[i % rowCount] += 1;\n }\n }\n return grids;\n}\nfunction divideSector(sectorShape, count, outShapes) {\n var r0 = sectorShape.r0;\n var r = sectorShape.r;\n var startAngle = sectorShape.startAngle;\n var endAngle = sectorShape.endAngle;\n var angle = Math.abs(endAngle - startAngle);\n var arcLen = angle * r;\n var deltaR = r - r0;\n var isAngleRow = arcLen > Math.abs(deltaR);\n var grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count);\n var rowSize = (isAngleRow ? angle : deltaR) / grids.length;\n for (var row = 0; row < grids.length; row++) {\n var columnSize = (isAngleRow ? deltaR : angle) / grids[row];\n for (var column = 0; column < grids[row]; column++) {\n var newShape = {};\n if (isAngleRow) {\n newShape.startAngle = startAngle + rowSize * row;\n newShape.endAngle = startAngle + rowSize * (row + 1);\n newShape.r0 = r0 + columnSize * column;\n newShape.r = r0 + columnSize * (column + 1);\n }\n else {\n newShape.startAngle = startAngle + columnSize * column;\n newShape.endAngle = startAngle + columnSize * (column + 1);\n newShape.r0 = r0 + rowSize * row;\n newShape.r = r0 + rowSize * (row + 1);\n }\n newShape.clockwise = sectorShape.clockwise;\n newShape.cx = sectorShape.cx;\n newShape.cy = sectorShape.cy;\n outShapes.push(newShape);\n }\n }\n}\nfunction divideRect(rectShape, count, outShapes) {\n var width = rectShape.width;\n var height = rectShape.height;\n var isHorizontalRow = width > height;\n var grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count);\n var rowSizeDim = isHorizontalRow ? 'width' : 'height';\n var columnSizeDim = isHorizontalRow ? 'height' : 'width';\n var rowDim = isHorizontalRow ? 'x' : 'y';\n var columnDim = isHorizontalRow ? 'y' : 'x';\n var rowSize = rectShape[rowSizeDim] / grids.length;\n for (var row = 0; row < grids.length; row++) {\n var columnSize = rectShape[columnSizeDim] / grids[row];\n for (var column = 0; column < grids[row]; column++) {\n var newShape = {};\n newShape[rowDim] = row * rowSize;\n newShape[columnDim] = column * columnSize;\n newShape[rowSizeDim] = rowSize;\n newShape[columnSizeDim] = columnSize;\n newShape.x += rectShape.x;\n newShape.y += rectShape.y;\n outShapes.push(newShape);\n }\n }\n}\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\nfunction lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y;\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n if (Math.abs(nmCrossProduct) < 1e-6) {\n return null;\n }\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n if (p < 0 || p > 1) {\n return null;\n }\n return new Point(p * mx + a1x, p * my + a1y);\n}\nfunction projPtOnLine(pt, lineA, lineB) {\n var dir = new Point();\n Point.sub(dir, lineB, lineA);\n dir.normalize();\n var dir2 = new Point();\n Point.sub(dir2, pt, lineA);\n var len = dir2.dot(dir);\n return len;\n}\nfunction addToPoly(poly, pt) {\n var last = poly[poly.length - 1];\n if (last && last[0] === pt[0] && last[1] === pt[1]) {\n return;\n }\n poly.push(pt);\n}\nfunction splitPolygonByLine(points, lineA, lineB) {\n var len = points.length;\n var intersections = [];\n for (var i = 0; i < len; i++) {\n var p0 = points[i];\n var p1 = points[(i + 1) % len];\n var intersectionPt = lineLineIntersect(p0[0], p0[1], p1[0], p1[1], lineA.x, lineA.y, lineB.x, lineB.y);\n if (intersectionPt) {\n intersections.push({\n projPt: projPtOnLine(intersectionPt, lineA, lineB),\n pt: intersectionPt,\n idx: i\n });\n }\n }\n if (intersections.length < 2) {\n return [{ points: points }, { points: points }];\n }\n intersections.sort(function (a, b) {\n return a.projPt - b.projPt;\n });\n var splitPt0 = intersections[0];\n var splitPt1 = intersections[intersections.length - 1];\n if (splitPt1.idx < splitPt0.idx) {\n var tmp = splitPt0;\n splitPt0 = splitPt1;\n splitPt1 = tmp;\n }\n var splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y];\n var splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y];\n var newPolyA = [splitPt0Arr];\n var newPolyB = [splitPt1Arr];\n for (var i = splitPt0.idx + 1; i <= splitPt1.idx; i++) {\n addToPoly(newPolyA, points[i].slice());\n }\n addToPoly(newPolyA, splitPt1Arr);\n addToPoly(newPolyA, splitPt0Arr);\n for (var i = splitPt1.idx + 1; i <= splitPt0.idx + len; i++) {\n addToPoly(newPolyB, points[i % len].slice());\n }\n addToPoly(newPolyB, splitPt0Arr);\n addToPoly(newPolyB, splitPt1Arr);\n return [{\n points: newPolyA\n }, {\n points: newPolyB\n }];\n}\nfunction binaryDividePolygon(polygonShape) {\n var points = polygonShape.points;\n var min = [];\n var max = [];\n fromPoints(points, min, max);\n var boundingRect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n var width = boundingRect.width;\n var height = boundingRect.height;\n var x = boundingRect.x;\n var y = boundingRect.y;\n var pt0 = new Point();\n var pt1 = new Point();\n if (width > height) {\n pt0.x = pt1.x = x + width / 2;\n pt0.y = y;\n pt1.y = y + height;\n }\n else {\n pt0.y = pt1.y = y + height / 2;\n pt0.x = x;\n pt1.x = x + width;\n }\n return splitPolygonByLine(points, pt0, pt1);\n}\nfunction binaryDivideRecursive(divider, shape, count, out) {\n if (count === 1) {\n out.push(shape);\n }\n else {\n var mid = Math.floor(count / 2);\n var sub = divider(shape);\n binaryDivideRecursive(divider, sub[0], mid, out);\n binaryDivideRecursive(divider, sub[1], count - mid, out);\n }\n return out;\n}\nexport function clone(path, count) {\n var paths = [];\n for (var i = 0; i < count; i++) {\n paths.push(clonePath(path));\n }\n return paths;\n}\nfunction copyPathProps(source, target) {\n target.setStyle(source.style);\n target.z = source.z;\n target.z2 = source.z2;\n target.zlevel = source.zlevel;\n}\nfunction polygonConvert(points) {\n var out = [];\n for (var i = 0; i < points.length;) {\n out.push([points[i++], points[i++]]);\n }\n return out;\n}\nexport function split(path, count) {\n var outShapes = [];\n var shape = path.shape;\n var OutShapeCtor;\n switch (path.type) {\n case 'rect':\n divideRect(shape, count, outShapes);\n OutShapeCtor = Rect;\n break;\n case 'sector':\n divideSector(shape, count, outShapes);\n OutShapeCtor = Sector;\n break;\n case 'circle':\n divideSector({\n r0: 0, r: shape.r, startAngle: 0, endAngle: Math.PI * 2,\n cx: shape.cx, cy: shape.cy\n }, count, outShapes);\n OutShapeCtor = Sector;\n break;\n default:\n var m = path.getComputedTransform();\n var scale = m ? Math.sqrt(Math.max(m[0] * m[0] + m[1] * m[1], m[2] * m[2] + m[3] * m[3])) : 1;\n var polygons = map(pathToPolygons(path.getUpdatedPathProxy(), scale), function (poly) { return polygonConvert(poly); });\n var polygonCount = polygons.length;\n if (polygonCount === 0) {\n binaryDivideRecursive(binaryDividePolygon, {\n points: polygons[0]\n }, count, outShapes);\n }\n else if (polygonCount === count) {\n for (var i = 0; i < polygonCount; i++) {\n outShapes.push({\n points: polygons[i]\n });\n }\n }\n else {\n var totalArea_1 = 0;\n var items = map(polygons, function (poly) {\n var min = [];\n var max = [];\n fromPoints(poly, min, max);\n var area = (max[1] - min[1]) * (max[0] - min[0]);\n totalArea_1 += area;\n return { poly: poly, area: area };\n });\n items.sort(function (a, b) { return b.area - a.area; });\n var left = count;\n for (var i = 0; i < polygonCount; i++) {\n var item = items[i];\n if (left <= 0) {\n break;\n }\n var selfCount = i === polygonCount - 1\n ? left\n : Math.ceil(item.area / totalArea_1 * count);\n if (selfCount < 0) {\n continue;\n }\n binaryDivideRecursive(binaryDividePolygon, {\n points: item.poly\n }, selfCount, outShapes);\n left -= selfCount;\n }\n ;\n }\n OutShapeCtor = Polygon;\n break;\n }\n if (!OutShapeCtor) {\n return clone(path, count);\n }\n var out = [];\n for (var i = 0; i < outShapes.length; i++) {\n var subPath = new OutShapeCtor();\n subPath.setShape(outShapes[i]);\n copyPathProps(path, subPath);\n out.push(subPath);\n }\n return out;\n}\n","import { cubicSubdivide } from '../core/curve.js';\nimport Path from '../graphic/Path.js';\nimport { defaults, map } from '../core/util.js';\nimport { lerp } from '../core/vector.js';\nimport { clonePath } from './path.js';\nimport Transformable from '../core/Transformable.js';\nimport { split } from './dividePath.js';\nimport { pathToBezierCurves } from './convertPath.js';\nfunction alignSubpath(subpath1, subpath2) {\n var len1 = subpath1.length;\n var len2 = subpath2.length;\n if (len1 === len2) {\n return [subpath1, subpath2];\n }\n var tmpSegX = [];\n var tmpSegY = [];\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\n var shorterLen = Math.min(len1, len2);\n var diff = Math.abs(len2 - len1) / 6;\n var shorterBezierCount = (shorterLen - 2) / 6;\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\n var newSubpath = [shorterPath[0], shorterPath[1]];\n var remained = diff;\n for (var i = 2; i < shorterLen;) {\n var x0 = shorterPath[i - 2];\n var y0 = shorterPath[i - 1];\n var x1 = shorterPath[i++];\n var y1 = shorterPath[i++];\n var x2 = shorterPath[i++];\n var y2 = shorterPath[i++];\n var x3 = shorterPath[i++];\n var y3 = shorterPath[i++];\n if (remained <= 0) {\n newSubpath.push(x1, y1, x2, y2, x3, y3);\n continue;\n }\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\n for (var k = 1; k <= actualSubDivCount; k++) {\n var p = k / actualSubDivCount;\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\n x0 = tmpSegX[3];\n y0 = tmpSegY[3];\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\n x1 = tmpSegX[5];\n y1 = tmpSegY[5];\n x2 = tmpSegX[6];\n y2 = tmpSegY[6];\n }\n remained -= actualSubDivCount - 1;\n }\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\n}\nfunction createSubpath(lastSubpathSubpath, otherSubpath) {\n var len = lastSubpathSubpath.length;\n var lastX = lastSubpathSubpath[len - 2];\n var lastY = lastSubpathSubpath[len - 1];\n var newSubpath = [];\n for (var i = 0; i < otherSubpath.length;) {\n newSubpath[i++] = lastX;\n newSubpath[i++] = lastY;\n }\n return newSubpath;\n}\nexport function alignBezierCurves(array1, array2) {\n var _a;\n var lastSubpath1;\n var lastSubpath2;\n var newArray1 = [];\n var newArray2 = [];\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\n var subpath1 = array1[i];\n var subpath2 = array2[i];\n var newSubpath1 = void 0;\n var newSubpath2 = void 0;\n if (!subpath1) {\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\n newSubpath2 = subpath2;\n }\n else if (!subpath2) {\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\n newSubpath1 = subpath1;\n }\n else {\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\n lastSubpath1 = newSubpath1;\n lastSubpath2 = newSubpath2;\n }\n newArray1.push(newSubpath1);\n newArray2.push(newSubpath2);\n }\n return [newArray1, newArray2];\n}\nexport function centroid(array) {\n var signedArea = 0;\n var cx = 0;\n var cy = 0;\n var len = array.length;\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\n var x0 = array[j];\n var y0 = array[j + 1];\n var x1 = array[i];\n var y1 = array[i + 1];\n var a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n }\n if (signedArea === 0) {\n return [array[0] || 0, array[1] || 0];\n }\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\n}\nfunction findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\n var bezierCount = (fromSubBeziers.length - 2) / 6;\n var bestScore = Infinity;\n var bestOffset = 0;\n var len = fromSubBeziers.length;\n var len2 = len - 2;\n for (var offset = 0; offset < bezierCount; offset++) {\n var cursorOffset = offset * 6;\n var score = 0;\n for (var k = 0; k < len; k += 2) {\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\n var x0 = fromSubBeziers[idx] - fromCp[0];\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\n var x1 = toSubBeziers[k] - toCp[0];\n var y1 = toSubBeziers[k + 1] - toCp[1];\n var dx = x1 - x0;\n var dy = y1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestOffset = offset;\n }\n }\n return bestOffset;\n}\nfunction reverse(array) {\n var newArr = [];\n var len = array.length;\n for (var i = 0; i < len; i += 2) {\n newArr[i] = array[len - i - 2];\n newArr[i + 1] = array[len - i - 1];\n }\n return newArr;\n}\nfunction findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\n var result = [];\n var fromNeedsReverse;\n for (var i = 0; i < fromArr.length; i++) {\n var fromSubpathBezier = fromArr[i];\n var toSubpathBezier = toArr[i];\n var fromCp = centroid(fromSubpathBezier);\n var toCp = centroid(toSubpathBezier);\n if (fromNeedsReverse == null) {\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\n }\n var newFromSubpathBezier = [];\n var newToSubpathBezier = [];\n var bestAngle = 0;\n var bestScore = Infinity;\n var tmpArr = [];\n var len = fromSubpathBezier.length;\n if (fromNeedsReverse) {\n fromSubpathBezier = reverse(fromSubpathBezier);\n }\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\n var len2 = len - 2;\n for (var k = 0; k < len2; k += 2) {\n var idx = (offset + k) % len2 + 2;\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\n }\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\n if (searchAngleIteration > 0) {\n var step = searchAngleRange / searchAngleIteration;\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n var score = 0;\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\n var x0 = newFromSubpathBezier[k];\n var y0 = newFromSubpathBezier[k + 1];\n var x1 = toSubpathBezier[k] - toCp[0];\n var y1 = toSubpathBezier[k + 1] - toCp[1];\n var newX1 = x1 * ca - y1 * sa;\n var newY1 = x1 * sa + y1 * ca;\n tmpArr[k] = newX1;\n tmpArr[k + 1] = newY1;\n var dx = newX1 - x0;\n var dy = newY1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestAngle = angle;\n for (var m = 0; m < tmpArr.length; m++) {\n newToSubpathBezier[m] = tmpArr[m];\n }\n }\n }\n }\n else {\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\n }\n }\n result.push({\n from: newFromSubpathBezier,\n to: newToSubpathBezier,\n fromCp: fromCp,\n toCp: toCp,\n rotation: -bestAngle\n });\n }\n return result;\n}\nexport function isCombineMorphing(path) {\n return path.__isCombineMorphing;\n}\nexport function isMorphing(el) {\n return el.__morphT >= 0;\n}\nvar SAVED_METHOD_PREFIX = '__mOriginal_';\nfunction saveAndModifyMethod(obj, methodName, modifiers) {\n var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n var originalMethod = obj[savedMethodName] || obj[methodName];\n if (!obj[savedMethodName]) {\n obj[savedMethodName] = obj[methodName];\n }\n var replace = modifiers.replace;\n var after = modifiers.after;\n var before = modifiers.before;\n obj[methodName] = function () {\n var args = arguments;\n var res;\n before && before.apply(this, args);\n if (replace) {\n res = replace.apply(this, args);\n }\n else {\n res = originalMethod.apply(this, args);\n }\n after && after.apply(this, args);\n return res;\n };\n}\nfunction restoreMethod(obj, methodName) {\n var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n if (obj[savedMethodName]) {\n obj[methodName] = obj[savedMethodName];\n obj[savedMethodName] = null;\n }\n}\nfunction applyTransformOnBeziers(bezierCurves, mm) {\n for (var i = 0; i < bezierCurves.length; i++) {\n var subBeziers = bezierCurves[i];\n for (var k = 0; k < subBeziers.length;) {\n var x = subBeziers[k];\n var y = subBeziers[k + 1];\n subBeziers[k++] = mm[0] * x + mm[2] * y + mm[4];\n subBeziers[k++] = mm[1] * x + mm[3] * y + mm[5];\n }\n }\n}\nfunction prepareMorphPath(fromPath, toPath) {\n var fromPathProxy = fromPath.getUpdatedPathProxy();\n var toPathProxy = toPath.getUpdatedPathProxy();\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\n var fromPathTransform = fromPath.getComputedTransform();\n var toPathTransform = toPath.getComputedTransform();\n function updateIdentityTransform() {\n this.transform = null;\n }\n fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform);\n toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform);\n saveAndModifyMethod(toPath, 'updateTransform', { replace: updateIdentityTransform });\n toPath.transform = null;\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\n var tmpArr = [];\n saveAndModifyMethod(toPath, 'buildPath', { replace: function (path) {\n var t = toPath.__morphT;\n var onet = 1 - t;\n var newCp = [];\n for (var i = 0; i < morphingData.length; i++) {\n var item = morphingData[i];\n var from = item.from;\n var to = item.to;\n var angle = item.rotation * t;\n var fromCp = item.fromCp;\n var toCp = item.toCp;\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n lerp(newCp, fromCp, toCp, t);\n for (var m = 0; m < from.length; m += 2) {\n var x0_1 = from[m];\n var y0_1 = from[m + 1];\n var x1 = to[m];\n var y1 = to[m + 1];\n var x = x0_1 * onet + x1 * t;\n var y = y0_1 * onet + y1 * t;\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\n }\n var x0 = tmpArr[0];\n var y0 = tmpArr[1];\n path.moveTo(x0, y0);\n for (var m = 2; m < from.length;) {\n var x1 = tmpArr[m++];\n var y1 = tmpArr[m++];\n var x2 = tmpArr[m++];\n var y2 = tmpArr[m++];\n var x3 = tmpArr[m++];\n var y3 = tmpArr[m++];\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n }\n else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n } });\n}\nexport function morphPath(fromPath, toPath, animationOpts) {\n if (!fromPath || !toPath) {\n return toPath;\n }\n var oldDone = animationOpts.done;\n var oldDuring = animationOpts.during;\n prepareMorphPath(fromPath, toPath);\n toPath.__morphT = 0;\n function restoreToPath() {\n restoreMethod(toPath, 'buildPath');\n restoreMethod(toPath, 'updateTransform');\n toPath.__morphT = -1;\n toPath.createPathProxy();\n toPath.dirtyShape();\n }\n toPath.animateTo({\n __morphT: 1\n }, defaults({\n during: function (p) {\n toPath.dirtyShape();\n oldDuring && oldDuring(p);\n },\n done: function () {\n restoreToPath();\n oldDone && oldDone();\n }\n }, animationOpts));\n return toPath;\n}\nfunction hilbert(x, y, minX, minY, maxX, maxY) {\n var bits = 16;\n x = (maxX === minX) ? 0 : Math.round(32767 * (x - minX) / (maxX - minX));\n y = (maxY === minY) ? 0 : Math.round(32767 * (y - minY) / (maxY - minY));\n var d = 0;\n var tmp;\n for (var s = (1 << bits) / 2; s > 0; s /= 2) {\n var rx = 0;\n var ry = 0;\n if ((x & s) > 0) {\n rx = 1;\n }\n if ((y & s) > 0) {\n ry = 1;\n }\n d += s * s * ((3 * rx) ^ ry);\n if (ry === 0) {\n if (rx === 1) {\n x = s - 1 - x;\n y = s - 1 - y;\n }\n tmp = x;\n x = y;\n y = tmp;\n }\n }\n return d;\n}\nfunction sortPaths(pathList) {\n var xMin = Infinity;\n var yMin = Infinity;\n var xMax = -Infinity;\n var yMax = -Infinity;\n var cps = map(pathList, function (path) {\n var rect = path.getBoundingRect();\n var m = path.getComputedTransform();\n var x = rect.x + rect.width / 2 + (m ? m[4] : 0);\n var y = rect.y + rect.height / 2 + (m ? m[5] : 0);\n xMin = Math.min(x, xMin);\n yMin = Math.min(y, yMin);\n xMax = Math.max(x, xMax);\n yMax = Math.max(y, yMax);\n return [x, y];\n });\n var items = map(cps, function (cp, idx) {\n return {\n cp: cp,\n z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax),\n path: pathList[idx]\n };\n });\n return items.sort(function (a, b) { return a.z - b.z; }).map(function (item) { return item.path; });\n}\n;\nfunction defaultDividePath(param) {\n return split(param.path, param.count);\n}\nfunction createEmptyReturn() {\n return {\n fromIndividuals: [],\n toIndividuals: [],\n count: 0\n };\n}\nexport function combineMorph(fromList, toPath, animationOpts) {\n var fromPathList = [];\n function addFromPath(fromList) {\n for (var i = 0; i < fromList.length; i++) {\n var from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath(from.childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n addFromPath(fromList);\n var separateCount = fromPathList.length;\n if (!separateCount) {\n return createEmptyReturn();\n }\n var dividePath = animationOpts.dividePath || defaultDividePath;\n var toSubPathList = dividePath({\n path: toPath, count: separateCount\n });\n if (toSubPathList.length !== separateCount) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n fromPathList = sortPaths(fromPathList);\n toSubPathList = sortPaths(toSubPathList);\n var oldDone = animationOpts.done;\n var oldDuring = animationOpts.during;\n var individualDelay = animationOpts.individualDelay;\n var identityTransform = new Transformable();\n for (var i = 0; i < separateCount; i++) {\n var from = fromPathList[i];\n var to = toSubPathList[i];\n to.parent = toPath;\n to.copyTransform(identityTransform);\n if (!individualDelay) {\n prepareMorphPath(from, to);\n }\n }\n toPath.__isCombineMorphing = true;\n toPath.childrenRef = function () {\n return toSubPathList;\n };\n function addToSubPathListToZr(zr) {\n for (var i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].addSelfToZr(zr);\n }\n }\n saveAndModifyMethod(toPath, 'addSelfToZr', {\n after: function (zr) {\n addToSubPathListToZr(zr);\n }\n });\n saveAndModifyMethod(toPath, 'removeSelfFromZr', {\n after: function (zr) {\n for (var i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].removeSelfFromZr(zr);\n }\n }\n });\n function restoreToPath() {\n toPath.__isCombineMorphing = false;\n toPath.__morphT = -1;\n toPath.childrenRef = null;\n restoreMethod(toPath, 'addSelfToZr');\n restoreMethod(toPath, 'removeSelfFromZr');\n }\n var toLen = toSubPathList.length;\n if (individualDelay) {\n var animating_1 = toLen;\n var eachDone = function () {\n animating_1--;\n if (animating_1 === 0) {\n restoreToPath();\n oldDone && oldDone();\n }\n };\n for (var i = 0; i < toLen; i++) {\n var indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toSubPathList[i]),\n done: eachDone\n }, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toSubPathList[i], indivdualAnimationOpts);\n }\n }\n else {\n toPath.__morphT = 0;\n toPath.animateTo({\n __morphT: 1\n }, defaults({\n during: function (p) {\n for (var i = 0; i < toLen; i++) {\n var child = toSubPathList[i];\n child.__morphT = toPath.__morphT;\n child.dirtyShape();\n }\n oldDuring && oldDuring(p);\n },\n done: function () {\n restoreToPath();\n for (var i = 0; i < fromList.length; i++) {\n restoreMethod(fromList[i], 'updateTransform');\n }\n oldDone && oldDone();\n }\n }, animationOpts));\n }\n if (toPath.__zr) {\n addToSubPathListToZr(toPath.__zr);\n }\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toSubPathList,\n count: toLen\n };\n}\nexport function separateMorph(fromPath, toPathList, animationOpts) {\n var toLen = toPathList.length;\n var fromPathList = [];\n var dividePath = animationOpts.dividePath || defaultDividePath;\n function addFromPath(fromList) {\n for (var i = 0; i < fromList.length; i++) {\n var from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath(from.childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n if (isCombineMorphing(fromPath)) {\n addFromPath(fromPath.childrenRef());\n var fromLen = fromPathList.length;\n if (fromLen < toLen) {\n var k = 0;\n for (var i = fromLen; i < toLen; i++) {\n fromPathList.push(clonePath(fromPathList[k++ % fromLen]));\n }\n }\n fromPathList.length = toLen;\n }\n else {\n fromPathList = dividePath({ path: fromPath, count: toLen });\n var fromPathTransform = fromPath.getComputedTransform();\n for (var i = 0; i < fromPathList.length; i++) {\n fromPathList[i].setLocalTransform(fromPathTransform);\n }\n if (fromPathList.length !== toLen) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n }\n fromPathList = sortPaths(fromPathList);\n toPathList = sortPaths(toPathList);\n var individualDelay = animationOpts.individualDelay;\n for (var i = 0; i < toLen; i++) {\n var indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toPathList[i])\n }, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toPathList[i], indivdualAnimationOpts);\n }\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toPathList,\n count: toPathList.length\n };\n}\nexport { split as defaultDividePath };\n","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { separateMorph, combineMorph, morphPath, isCombineMorphing } from 'zrender/lib/tool/morphPath.js';\nimport { Path } from '../util/graphic.js';\nimport { defaults, isArray } from 'zrender/lib/core/util.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { clonePath } from 'zrender/lib/tool/path.js';\nfunction isMultiple(elements) {\n return isArray(elements[0]);\n}\nfunction prepareMorphBatches(one, many) {\n var batches = [];\n var batchCount = one.length;\n for (var i = 0; i < batchCount; i++) {\n batches.push({\n one: one[i],\n many: []\n });\n }\n for (var i = 0; i < many.length; i++) {\n var len = many[i].length;\n var k = void 0;\n for (k = 0; k < len; k++) {\n batches[k % batchCount].many.push(many[i][k]);\n }\n }\n var off = 0;\n // If one has more paths than each one of many. average them.\n for (var i = batchCount - 1; i >= 0; i--) {\n if (!batches[i].many.length) {\n var moveFrom = batches[off].many;\n if (moveFrom.length <= 1) {\n // Not enough\n // Start from the first one.\n if (off) {\n off = 0;\n } else {\n return batches;\n }\n }\n var len = moveFrom.length;\n var mid = Math.ceil(len / 2);\n batches[i].many = moveFrom.slice(mid, len);\n batches[off].many = moveFrom.slice(0, mid);\n off++;\n }\n }\n return batches;\n}\nvar pathDividers = {\n clone: function (params) {\n var ret = [];\n // Fitting the alpha\n var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);\n for (var i = 0; i < params.count; i++) {\n var cloned = clonePath(params.path);\n cloned.setStyle('opacity', approxOpacity);\n ret.push(cloned);\n }\n return ret;\n },\n // Use the default divider\n split: null\n};\nexport function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) {\n if (!from.length || !to.length) {\n return;\n }\n var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex);\n if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {\n return;\n }\n var animationDelay = seriesModel.getModel('universalTransition').get('delay');\n var animationCfg = Object.assign({\n // Need to setToFinal so the further calculation based on the style can be correct.\n // Like emphasis color.\n setToFinal: true\n }, updateAnimationCfg);\n var many;\n var one;\n if (isMultiple(from)) {\n // manyToOne\n many = from;\n one = to;\n }\n if (isMultiple(to)) {\n // oneToMany\n many = to;\n one = from;\n }\n function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) {\n var batchMany = batch.many;\n var batchOne = batch.one;\n if (batchMany.length === 1 && !forceManyOne) {\n // Is one to one\n var batchFrom = fromIsMany ? batchMany[0] : batchOne;\n var batchTo = fromIsMany ? batchOne : batchMany[0];\n if (isCombineMorphing(batchFrom)) {\n // Keep doing combine animation.\n morphOneBatch({\n many: [batchFrom],\n one: batchTo\n }, true, animateIndex, animateCount, true);\n } else {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(animateIndex, animateCount)\n }, animationCfg) : animationCfg;\n morphPath(batchFrom, batchTo, individualAnimationCfg);\n animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);\n }\n } else {\n var separateAnimationCfg = defaults({\n dividePath: pathDividers[divideShape],\n individualDelay: animationDelay && function (idx, count, fromPath, toPath) {\n return animationDelay(idx + animateIndex, animateCount);\n }\n }, animationCfg);\n var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg),\n fromIndividuals = _a.fromIndividuals,\n toIndividuals = _a.toIndividuals;\n var count = fromIndividuals.length;\n for (var k = 0; k < count; k++) {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(k, count)\n }, animationCfg) : animationCfg;\n animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg);\n }\n }\n }\n var fromIsMany = many ? many === from\n // Is one to one. If the path number not match. also needs do merge and separate morphing.\n : from.length > to.length;\n var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]);\n var animateCount = 0;\n for (var i = 0; i < morphBatches.length; i++) {\n animateCount += morphBatches[i].many.length;\n }\n var animateIndex = 0;\n for (var i = 0; i < morphBatches.length; i++) {\n morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount);\n animateIndex += morphBatches[i].many.length;\n }\n}\nexport function getPathList(elements) {\n if (!elements) {\n return [];\n }\n if (isArray(elements)) {\n var pathList_1 = [];\n for (var i = 0; i < elements.length; i++) {\n pathList_1.push(getPathList(elements[i]));\n }\n return pathList_1;\n }\n var pathList = [];\n elements.traverse(function (el) {\n if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) {\n pathList.push(el);\n }\n });\n return pathList;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Universal transitions that can animate between any shapes(series) and any properties in any amounts.\nimport { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series.js';\nimport { createHashMap, each, map, filter, isArray, extend } from 'zrender/lib/core/util.js';\nimport { applyMorphAnimation, getPathList } from './morphTransitionHelper.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { initProps } from '../util/graphic.js';\nimport DataDiffer from '../data/DataDiffer.js';\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { warn } from '../util/log.js';\nimport { getAnimationConfig, getOldStyle } from './basicTransition.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nvar DATA_COUNT_THRESHOLD = 1e4;\nvar TRANSITION_NONE = 0;\nvar TRANSITION_P2C = 1;\nvar TRANSITION_C2P = 2;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\nfunction getDimension(data, visualDimension) {\n var dimensions = data.dimensions;\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = data.getDimensionInfo(dimensions[i]);\n if (dimInfo && dimInfo.otherDims[visualDimension] === 0) {\n return dimensions[i];\n }\n }\n}\n// get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string)\nfunction getValueByDimension(data, dataIndex, dimension) {\n var dimInfo = data.getDimensionInfo(dimension);\n var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n if (dimInfo) {\n var value = data.get(dimInfo.name, dataIndex);\n if (dimOrdinalMeta) {\n return dimOrdinalMeta.categories[value] || value + '';\n }\n return value + '';\n }\n}\nfunction getGroupId(data, dataIndex, dataGroupId, isChild) {\n // try to get groupId from encode\n var visualDimension = isChild ? 'itemChildGroupId' : 'itemGroupId';\n var groupIdDim = getDimension(data, visualDimension);\n if (groupIdDim) {\n var groupId = getValueByDimension(data, dataIndex, groupIdDim);\n return groupId;\n }\n // try to get groupId from raw data item\n var rawDataItem = data.getRawDataItem(dataIndex);\n var property = isChild ? 'childGroupId' : 'groupId';\n if (rawDataItem && rawDataItem[property]) {\n return rawDataItem[property] + '';\n }\n // fallback\n if (isChild) {\n return;\n }\n // try to use series.dataGroupId as groupId, otherwise use dataItem's id as groupId\n return dataGroupId || data.getId(dataIndex);\n}\n// flatten all data items from different serieses into one arrary\nfunction flattenDataDiffItems(list) {\n var items = [];\n each(list, function (seriesInfo) {\n var data = seriesInfo.data;\n var dataGroupId = seriesInfo.dataGroupId;\n if (data.count() > DATA_COUNT_THRESHOLD) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Universal transition is disabled on large data > 10k.');\n }\n return;\n }\n var indices = data.getIndices();\n for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n items.push({\n data: data,\n groupId: getGroupId(data, dataIndex, dataGroupId, false),\n childGroupId: getGroupId(data, dataIndex, dataGroupId, true),\n divide: seriesInfo.divide,\n dataIndex: dataIndex\n });\n }\n });\n return items;\n}\nfunction fadeInElement(newEl, newSeries, newIndex) {\n newEl.traverse(function (el) {\n if (el instanceof Path) {\n // TODO use fade in animation for target element.\n initProps(el, {\n style: {\n opacity: 0\n }\n }, newSeries, {\n dataIndex: newIndex,\n isFrom: true\n });\n }\n });\n}\nfunction removeEl(el) {\n if (el.parent) {\n // Bake parent transform to element.\n // So it can still have proper transform to transition after it's removed.\n var computedTransform = el.getComputedTransform();\n el.setLocalTransform(computedTransform);\n el.parent.remove(el);\n }\n}\nfunction stopAnimation(el) {\n el.stopAnimation();\n if (el.isGroup) {\n el.traverse(function (child) {\n child.stopAnimation();\n });\n }\n}\nfunction animateElementStyles(el, dataIndex, seriesModel) {\n var animationConfig = getAnimationConfig('update', seriesModel, dataIndex);\n animationConfig && el.traverse(function (child) {\n if (child instanceof Displayable) {\n var oldStyle = getOldStyle(child);\n if (oldStyle) {\n child.animateFrom({\n style: oldStyle\n }, animationConfig);\n }\n }\n });\n}\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n var len = oldDiffItems.length;\n if (len !== newDiffItems.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var oldItem = oldDiffItems[i];\n var newItem = newDiffItems[i];\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n return false;\n }\n }\n return true;\n}\nfunction transitionBetween(oldList, newList, api) {\n var oldDiffItems = flattenDataDiffItems(oldList);\n var newDiffItems = flattenDataDiffItems(newList);\n function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n if (rawFrom || from) {\n to.animateFrom({\n style: rawFrom && rawFrom !== from\n // dividingMethod like clone may override the style(opacity)\n // So extend it to raw style.\n ? extend(extend({}, rawFrom.style), from.style) : from.style\n }, animationCfg);\n }\n }\n var hasMorphAnimation = false;\n /**\n * With groupId and childGroupId, we can build parent-child relationships between dataItems.\n * However, we should mind the parent-child \"direction\" between old and new options.\n *\n * For example, suppose we have two dataItems from two series.data:\n *\n * dataA: [ dataB: [\n * { {\n * value: 5, value: 3,\n * groupId: 'creatures', groupId: 'animals',\n * childGroupId: 'animals' childGroupId: 'dogs'\n * }, },\n * ... ...\n * ] ]\n *\n * where dataA is belong to optionA and dataB is belong to optionB.\n *\n * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of\n * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition\n * will work. This derection is \"parent -> child\".\n *\n * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId\n * of dataItemA as keys and universalTransition will work. This derection is \"child -> parent\".\n *\n * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no\n * parent-child relationship exists. This direction is \"none\".\n *\n * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter\n * functions. Thus, we need to decide the direction first.\n *\n * The rule is:\n *\n * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) {\n * direction = 'parent -> child';\n * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) {\n * direction = 'child -> parent';\n * } else {\n * direction = 'none';\n * }\n */\n var direction = TRANSITION_NONE;\n // find all groupIds and childGroupIds from oldDiffItems\n var oldGroupIds = createHashMap();\n var oldChildGroupIds = createHashMap();\n oldDiffItems.forEach(function (item) {\n item.groupId && oldGroupIds.set(item.groupId, true);\n item.childGroupId && oldChildGroupIds.set(item.childGroupId, true);\n });\n // traverse newDiffItems and decide the direction according to the rule\n for (var i = 0; i < newDiffItems.length; i++) {\n var newGroupId = newDiffItems[i].groupId;\n if (oldChildGroupIds.get(newGroupId)) {\n direction = TRANSITION_P2C;\n break;\n }\n var newChildGroupId = newDiffItems[i].childGroupId;\n if (newChildGroupId && oldGroupIds.get(newChildGroupId)) {\n direction = TRANSITION_C2P;\n break;\n }\n }\n function createKeyGetter(isOld, onlyGetId) {\n return function (diffItem) {\n var data = diffItem.data;\n var dataIndex = diffItem.dataIndex;\n // TODO if specified dim\n if (onlyGetId) {\n return data.getId(dataIndex);\n }\n if (isOld) {\n return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId;\n } else {\n return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId;\n }\n };\n }\n // Use id if it's very likely to be an one to one animation\n // It's more robust than groupId\n // TODO Check if key dimension is specified.\n var useId = isAllIdSame(oldDiffItems, newDiffItems);\n var isElementStillInChart = {};\n if (!useId) {\n // We may have different diff strategy with basicTransition if we use other dimension as key.\n // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.\n // We can't use the elements that already being morphed. Let it keep it's original basic transition.\n for (var i = 0; i < newDiffItems.length; i++) {\n var newItem = newDiffItems[i];\n var el = newItem.data.getItemGraphicEl(newItem.dataIndex);\n if (el) {\n isElementStillInChart[el.id] = true;\n }\n }\n }\n function updateOneToOne(newIndex, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var newItem = newDiffItems[newIndex];\n var newSeries = newItem.data.hostModel;\n // TODO Mark this elements is morphed and don't morph them anymore\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex);\n // Can't handle same elements.\n if (oldEl === newEl) {\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n return;\n }\n if (\n // We can't use the elements that already being morphed\n oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n if (newEl) {\n // TODO: If keep animating the group in case\n // some of the elements don't want to be morphed.\n // TODO Label?\n stopAnimation(newEl);\n if (oldEl) {\n stopAnimation(oldEl);\n // If old element is doing leaving animation. stop it and remove it immediately.\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newIndex);\n }\n }\n // else keep oldEl leaving animation.\n }\n\n new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) {\n var newItem = newDiffItems[newIndex];\n var newData = newItem.data;\n var newSeries = newData.hostModel;\n var newEl = newData.getItemGraphicEl(newItem.dataIndex);\n var oldElsList = filter(map(oldIndices, function (idx) {\n return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex);\n }), function (oldEl) {\n return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id];\n });\n if (newEl) {\n stopAnimation(newEl);\n if (oldElsList.length) {\n // If old element is doing leaving animation. stop it and remove it immediately.\n each(oldElsList, function (oldEl) {\n stopAnimation(oldEl);\n removeEl(oldEl);\n });\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newItem.dataIndex);\n }\n }\n // else keep oldEl leaving animation.\n }).updateOneToMany(function (newIndices, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n // We can't use the elements that already being morphed\n if (oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n var newElsList = filter(map(newIndices, function (idx) {\n return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex);\n }), function (el) {\n return el && el !== oldEl;\n });\n var newSeris = newDiffItems[newIndices[0]].data.hostModel;\n if (newElsList.length) {\n each(newElsList, function (newEl) {\n return stopAnimation(newEl);\n });\n if (oldEl) {\n stopAnimation(oldEl);\n // If old element is doing leaving animation. stop it and remove it immediately.\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide,\n // Use divide on old.\n newSeris, newIndices[0], updateMorphingPathProps);\n } else {\n each(newElsList, function (newEl) {\n return fadeInElement(newEl, newSeris, newIndices[0]);\n });\n }\n }\n // else keep oldEl leaving animation.\n }).updateManyToMany(function (newIndices, oldIndices) {\n // If two data are same and both have groupId.\n // Normally they should be diff by id.\n new DataDiffer(oldIndices, newIndices, function (rawIdx) {\n return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex);\n }, function (rawIdx) {\n return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex);\n }).update(function (newIndex, oldIndex) {\n // Use the original index\n updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);\n }).execute();\n }).execute();\n if (hasMorphAnimation) {\n each(newList, function (_a) {\n var data = _a.data;\n var seriesModel = data.hostModel;\n var view = seriesModel && api.getViewOfSeriesModel(seriesModel);\n var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index.\n if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {\n view.group.traverse(function (el) {\n if (el instanceof Path && !el.animators.length) {\n // We can't accept there still exists element that has no animation\n // if universalTransition is enabled\n el.animateFrom({\n style: {\n opacity: 0\n }\n }, animationCfg);\n }\n });\n }\n });\n }\n}\nfunction getSeriesTransitionKey(series) {\n var seriesKey = series.getModel('universalTransition').get('seriesKey');\n if (!seriesKey) {\n // Use series id by default.\n return series.id;\n }\n return seriesKey;\n}\nfunction convertArraySeriesKeyToString(seriesKey) {\n if (isArray(seriesKey)) {\n // Order independent.\n return seriesKey.sort().join(',');\n }\n return seriesKey;\n}\nfunction getDivideShapeFromData(data) {\n if (data.hostModel) {\n return data.hostModel.getModel('universalTransition').get('divideShape');\n }\n}\nfunction findTransitionSeriesBatches(globalStore, params) {\n var updateBatches = createHashMap();\n var oldDataMap = createHashMap();\n // Map that only store key in array seriesKey.\n // Which is used to query the old data when transition from one to multiple series.\n var oldDataMapForSplit = createHashMap();\n each(globalStore.oldSeries, function (series, idx) {\n var oldDataGroupId = globalStore.oldDataGroupIds[idx];\n var oldData = globalStore.oldData[idx];\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n oldDataMap.set(transitionKeyStr, {\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n if (isArray(transitionKey)) {\n // Same key can't in different array seriesKey.\n each(transitionKey, function (key) {\n oldDataMapForSplit.set(key, {\n key: transitionKeyStr,\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n });\n }\n });\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n if (updateBatches.get(transitionKeyStr)) {\n warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n }\n }\n each(params.updatedSeries, function (series) {\n if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {\n var newDataGroupId = series.get('dataGroupId');\n var newData = series.getData();\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n // Only transition between series with same id.\n var oldData = oldDataMap.get(transitionKeyStr);\n // string transition key is the best match.\n if (oldData) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n // TODO check if data is same?\n updateBatches.set(transitionKeyStr, {\n oldSeries: [{\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n }],\n newSeries: [{\n dataGroupId: newDataGroupId,\n divide: getDivideShapeFromData(newData),\n data: newData\n }]\n });\n } else {\n // Transition from multiple series.\n // e.g. 'female', 'male' -> ['female', 'male']\n if (isArray(transitionKey)) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n var oldSeries_1 = [];\n each(transitionKey, function (key) {\n var oldData = oldDataMap.get(key);\n if (oldData.data) {\n oldSeries_1.push({\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n });\n }\n });\n if (oldSeries_1.length) {\n updateBatches.set(transitionKeyStr, {\n oldSeries: oldSeries_1,\n newSeries: [{\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n }]\n });\n }\n } else {\n // Try transition to multiple series.\n // e.g. ['female', 'male'] -> 'female', 'male'\n var oldData_1 = oldDataMapForSplit.get(transitionKey);\n if (oldData_1) {\n var batch = updateBatches.get(oldData_1.key);\n if (!batch) {\n batch = {\n oldSeries: [{\n dataGroupId: oldData_1.dataGroupId,\n data: oldData_1.data,\n divide: getDivideShapeFromData(oldData_1.data)\n }],\n newSeries: []\n };\n updateBatches.set(oldData_1.key, batch);\n }\n batch.newSeries.push({\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n });\n }\n }\n }\n }\n });\n return updateBatches;\n}\nfunction querySeries(series, finder) {\n for (var i = 0; i < series.length; i++) {\n var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id;\n if (found) {\n return i;\n }\n }\n}\nfunction transitionSeriesFromOpt(transitionOpt, globalStore, params, api) {\n var from = [];\n var to = [];\n each(normalizeToArray(transitionOpt.from), function (finder) {\n var idx = querySeries(globalStore.oldSeries, finder);\n if (idx >= 0) {\n from.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: globalStore.oldData[idx],\n // TODO can specify divideShape in transition.\n divide: getDivideShapeFromData(globalStore.oldData[idx]),\n groupIdDim: finder.dimension\n });\n }\n });\n each(normalizeToArray(transitionOpt.to), function (finder) {\n var idx = querySeries(params.updatedSeries, finder);\n if (idx >= 0) {\n var data = params.updatedSeries[idx].getData();\n to.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: data,\n divide: getDivideShapeFromData(data),\n groupIdDim: finder.dimension\n });\n }\n });\n if (from.length > 0 && to.length > 0) {\n transitionBetween(from, to, api);\n }\n}\nexport function installUniversalTransition(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) {\n each(normalizeToArray(params.seriesTransition), function (transOpt) {\n each(normalizeToArray(transOpt.to), function (finder) {\n var series = params.updatedSeries;\n for (var i = 0; i < series.length; i++) {\n if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) {\n series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true;\n }\n }\n });\n });\n });\n registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var globalStore = getUniversalTransitionGlobalStore(api);\n // TODO multiple to multiple series.\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n // TODO transitionOpt was used in an old implementation and can be removed now\n // Use give transition config if its' give;\n var transitionOpt = params.seriesTransition;\n if (transitionOpt) {\n each(normalizeToArray(transitionOpt), function (opt) {\n transitionSeriesFromOpt(opt, globalStore, params, api);\n });\n } else {\n // Else guess from series based on transition series key.\n var updateBatches_1 = findTransitionSeriesBatches(globalStore, params);\n each(updateBatches_1.keys(), function (key) {\n var batch = updateBatches_1.get(key);\n transitionBetween(batch.oldSeries, batch.newSeries, api);\n });\n }\n // Reset\n each(params.updatedSeries, function (series) {\n // Reset;\n if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;\n }\n });\n }\n // Save all series of current update. Not only the updated one.\n var allSeries = ecModel.getSeries();\n var savedSeries = globalStore.oldSeries = [];\n var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n var savedData = globalStore.oldData = [];\n for (var i = 0; i < allSeries.length; i++) {\n var data = allSeries[i].getData();\n // Only save the data that can have transition.\n // Avoid large data costing too much extra memory\n if (data.count() < DATA_COUNT_THRESHOLD) {\n savedSeries.push(allSeries[i]);\n savedDataGroupIds.push(allSeries[i].get('dataGroupId'));\n savedData.push(data);\n }\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { use } from './lib/extension.js';\nexport * from './lib/export/core.js';\n// ----------------------------------------------\n// All of the modules that are allowed to be\n// imported are listed below.\n//\n// Users MUST NOT import other modules that are\n// not included in this list.\n// ----------------------------------------------\nimport { SVGRenderer, CanvasRenderer } from './lib/export/renderers.js';\nimport { LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart } from './lib/export/charts.js';\nimport { GridComponent, PolarComponent, GeoComponent, SingleAxisComponent, ParallelComponent, CalendarComponent, GraphicComponent, ToolboxComponent, TooltipComponent, AxisPointerComponent, BrushComponent, TitleComponent, TimelineComponent, MarkPointComponent, MarkLineComponent, MarkAreaComponent, LegendComponent, DataZoomComponent, DataZoomInsideComponent, DataZoomSliderComponent, VisualMapComponent, VisualMapContinuousComponent, VisualMapPiecewiseComponent, AriaComponent, DatasetComponent, TransformComponent } from './lib/export/components.js';\nimport { UniversalTransition, LabelLayout } from './lib/export/features.js';\n// -----------------\n// Render engines\n// -----------------\n// Render via Canvas.\n// echarts.init(dom, null, { renderer: 'canvas' })\nuse([CanvasRenderer]);\n// Render via SVG.\n// echarts.init(dom, null, { renderer: 'svg' })\nuse([SVGRenderer]);\n// ----------------\n// Charts (series)\n// ----------------\n// All of the series types, for example:\n// chart.setOption({\n// series: [{\n// type: 'line' // or 'bar', 'pie', ...\n// }]\n// });\nuse([LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart]);\n// -------------------\n// Coordinate systems\n// -------------------\n// All of the axis modules have been included in the\n// coordinate system module below, do not need to\n// make extra import.\n// `cartesian` coordinate system. For some historical\n// reasons, it is named as grid, for example:\n// chart.setOption({\n// grid: {...},\n// xAxis: {...},\n// yAxis: {...},\n// series: [{...}]\n// });\nuse(GridComponent);\n// `polar` coordinate system, for example:\n// chart.setOption({\n// polar: {...},\n// radiusAxis: {...},\n// angleAxis: {...},\n// series: [{\n// coordinateSystem: 'polar'\n// }]\n// });\nuse(PolarComponent);\n// `geo` coordinate system, for example:\n// chart.setOption({\n// geo: {...},\n// series: [{\n// coordinateSystem: 'geo'\n// }]\n// });\nuse(GeoComponent);\n// `singleAxis` coordinate system (notice, it is a coordinate system\n// with only one axis, work for chart like theme river), for example:\n// chart.setOption({\n// singleAxis: {...}\n// series: [{type: 'themeRiver', ...}]\n// });\nuse(SingleAxisComponent);\n// `parallel` coordinate system, only work for parallel series, for example:\n// chart.setOption({\n// parallel: {...},\n// parallelAxis: [{...}, ...],\n// series: [{\n// type: 'parallel'\n// }]\n// });\nuse(ParallelComponent);\n// `calendar` coordinate system. for example,\n// chart.setOption({\n// calendar: {...},\n// series: [{\n// coordinateSystem: 'calendar'\n// }]\n// );\nuse(CalendarComponent);\n// ------------------\n// Other components\n// ------------------\n// `graphic` component, for example:\n// chart.setOption({\n// graphic: {...}\n// });\nuse(GraphicComponent);\n// `toolbox` component, for example:\n// chart.setOption({\n// toolbox: {...}\n// });\nuse(ToolboxComponent);\n// `tooltip` component, for example:\n// chart.setOption({\n// tooltip: {...}\n// });\nuse(TooltipComponent);\n// `axisPointer` component, for example:\n// chart.setOption({\n// tooltip: {axisPointer: {...}, ...}\n// });\n// Or\n// chart.setOption({\n// axisPointer: {...}\n// });\nuse(AxisPointerComponent);\n// `brush` component, for example:\n// chart.setOption({\n// brush: {...}\n// });\n// Or\n// chart.setOption({\n// tooltip: {feature: {brush: {...}}\n// })\nuse(BrushComponent);\n// `title` component, for example:\n// chart.setOption({\n// title: {...}\n// });\nuse(TitleComponent);\n// `timeline` component, for example:\n// chart.setOption({\n// timeline: {...}\n// });\nuse(TimelineComponent);\n// `markPoint` component, for example:\n// chart.setOption({\n// series: [{markPoint: {...}}]\n// });\nuse(MarkPointComponent);\n// `markLine` component, for example:\n// chart.setOption({\n// series: [{markLine: {...}}]\n// });\nuse(MarkLineComponent);\n// `markArea` component, for example:\n// chart.setOption({\n// series: [{markArea: {...}}]\n// });\nuse(MarkAreaComponent);\n// `legend` component not scrollable. for example:\n// chart.setOption({\n// legend: {...}\n// });\nuse(LegendComponent);\n// `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.\nuse(DataZoomComponent);\n// `dataZoom` component providing drag, pinch, wheel behaviors\n// inside coordinate system, for example:\n// chart.setOption({\n// dataZoom: {type: 'inside'}\n// });\nuse(DataZoomInsideComponent);\n// `dataZoom` component providing a slider bar, for example:\n// chart.setOption({\n// dataZoom: {type: 'slider'}\n// });\nuse(DataZoomSliderComponent);\n// `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.\nuse(VisualMapComponent);\n// `visualMap` component providing continuous bar, for example:\n// chart.setOption({\n// visualMap: {type: 'continuous'}\n// });\nuse(VisualMapContinuousComponent);\n// `visualMap` component providing pieces bar, for example:\n// chart.setOption({\n// visualMap: {type: 'piecewise'}\n// });\nuse(VisualMapPiecewiseComponent);\n// `aria` component providing aria, for example:\n// chart.setOption({\n// aria: {...}\n// });\nuse(AriaComponent);\n// dataset transform\n// chart.setOption({\n// dataset: {\n// transform: []\n// }\n// });\nuse(TransformComponent);\nuse(DatasetComponent);\n// universal transition\n// chart.setOption({\n// series: {\n// universalTransition: { enabled: true }\n// }\n// })\nuse(UniversalTransition);\n// label layout\n// chart.setOption({\n// series: {\n// labelLayout: { hideOverlap: true }\n// }\n// })\nuse(LabelLayout);"],"names":["clone","_calcOut","eventUtil.clientToLocal","dist","create","copy","mul","scale","matrix.create","matrix.translate","matrix.scale","eventTool.stop","util.each","vec2.dist","timsort","util.indexOf","v2Create","v2DistSquare","lerp","EPSILON","isAroundZero","color.parse","requestAnimationFrame","zrUtil.map","zrUtil.noop","zrUtil.each","matrix.identity","isNotAroundZero","matrix.mul","matrix.copy","matrix.invert","vector.applyTransform","matrix.rotate","adjustTextY","zrUtil.indexOf","zrUtil.keys","HandlerProxy","zrUtil.retrieve2","zrUtil.guid","parsePercent","zrUtil.isString","zrUtil.reduce","interpolateNumber","zrUtil.assert","zrUtil.inherits","zrUtil.extend","zrUtil.isFunction","imageHelper.findExistImage","imageHelper.isImageReady","PRIMARY_STATES_KEYS","tmpRect","mathMin","mathMax","vec2.create","cubicExtrema","curve.cubicExtrema","cubicAt","curve.cubicAt","quadraticExtremum","curve.quadraticExtremum","quadraticAt","curve.quadraticAt","min","max","vec2.min","vec2.max","mathCos","mathSin","PI2","dpr","containStroke","curve.cubicProjectPoint","CMD","curve.cubicRootAt","curve.quadraticRootAt","line.containStroke","cubic.containStroke","quadratic.containStroke","arc.containStroke","pathContain.containStroke","pathContain.contain","round","roundRectHelper.buildPath","mathSqrt","v2ApplyTransform","PI","mathAbs","buildPath","roundSectorHelper.buildPath","v2Min","v2Max","v2Clone","v2Sub","v2Scale","v2Distance","v2Add","polyHelper.buildPath","subPixelOptimizeOutputShape","vec2.normalize","minTv","maxTv","Displayble","pathTool.extendFromString","pathTool.createFromString","mergePath","pathTool.mergePath","subPixelOptimizeLine","subPixelOptimizeUtil.subPixelOptimizeLine","subPixelOptimizeRect","subPixelOptimizeUtil.subPixelOptimizeRect","subPixelOptimize","subPixelOptimizeUtil.subPixelOptimize","applyTransform","invert","zrUtil.merge","numberUtil.parseDate","defaults","zrUtil.defaults","zrUtil.isArray","zrUtil.isNumber","Text","normalizeCssArray","zrUtil.normalizeCssArray","zrUtil.trim","timeFormat","zrUtil.isStringSafe","zrUtil.isObject","each","zrUtil.curry","formatUtil.normalizeCssArray","componentUtil.getUID","layout.fetchLayoutMode","layout.getLayoutParams","layout.mergeLayoutParam","componentUtil.enableSubTypeDefaulter","componentUtil.enableTopologicalTravel","modelUtil.normalizeToArray","modelUtil.mappingToExists","modelUtil.setComponentTypeToKeyInfo","modelUtil.isComponentIdInternal","modelUtil.convertOptionIdName","zrUtil.bind","isObject","modelUtil.TEXT_STYLE_OPTIONS","zrUtil.isTypedArray","set","compatStyle","inner","modelUtil.makeInner","modelUtil.defaultEmphasis","zrUtil.createHashMap","zrUtil.mixin","modelUtil.isNameSpecified","zrUtil.concatArray","clazzUtil.enableClassExtend","clazzUtil.enableClassManagement","modelUtil.queryDataIndex","graphic.Group","graphic.Rect","graphic.Text","graphic.Arc","graphic.Path","graphic.Line","graphic.Circle","graphic.makeImage","graphic.makePath","version","zrender.registerSSRDataGetter","zrender.init","backwardCompat","instances","graphic.Image","modelUtil.parseFinder","modelUtil.setAttribute","modelUtil.preParseFinder","graphic.isElementRemoved","init","dispose","modelUtil.getAttribute","decal","loadingDefault","darkTheme","map","CtorInt32Array","zrUtil.isArrayLike","zrUtil.slice","zrUtil.clone","CoordinateSystem","contain","normalize","scaleHelper.contain","scaleHelper.normalize","scaleHelper.scale","numberUtil.round","helper.contain","helper.normalize","helper.scale","helper.getIntervalPrecision","numberUtil.getPrecision","formatUtil.addCommas","helper.intervalScaleNiceTicks","numberUtil.nice","mathPow","numberUtil.quantity","dataStack","axisHelper.createScaleByModel","axisHelper.niceScaleExtent","createTextStyle","innerCreateTextStyle","isAroundEqual","vec2.applyTransform","polygonContain.contain","zrUtil.filter","textContain.getBoundingRect","vector.dist","vector.lerp","mathRound","isImageLike","brush","api.appendChild","api.createTextNode","api.insertBefore","api.parentNode","api.removeChild","api.nextSibling","api.setTextContent","util.isObject","util.disableUserSelect","util.isGradientObject","util.isImagePatternObject","util.extend","util.merge","util.logError","install","graphic.updateProps","graphic.initProps","graphic.removeElement","SymbolClz","graphic.traverseElements","graphic.Sector","graphic.LinearGradient","isPointNull","modelUtil.interpolateRawValues","LineSeries","layoutPoints","Sausage","BarSeries","layout.getLayoutRect","RADIAN","graphic.Polyline","graphic.removeElementWithFadeOut","labelLayout","graphic.BoundingRect","layout","zrUtil.retrieve","zrUtil.retrieve3","mathLog","graphic.subPixelOptimizeLine","graphic.setTooltipConfig","matrixUtil.identity","matrixUtil.rotate","matrixUtil.mul","axisPointerModelHelper.fixValue","axisPointerModelHelper.getAxisPointerModel","cartesianAxisHelper.layout","graphic.groupTransition","installGridSimple","zrUtil.find","createSymbol","symbolUtil.normalizeSymbolSize","symbolUtil.createSymbol","graphic.Polygon","axisBuilderAttrs","RadarView","graphic.Ring","graphic.mergePath","numberUtil.parsePercent","installRadarComponent","echarts.registerAction","eventTool.isMiddleOrRightButtonOnMouseUpDown","interactionMutex.isTaken","numberReg","points","parseGeoJson","fixTextCoord","graphic.CompoundPath","roamHelper.updateViewOnPan","roamHelper.updateViewOnZoom","vector.copy","getCoordSys","vector.min","vector.max","zrUtil.mergeAll","registerMap","installGeo","getViewRect","symbolNeedsDraw","bbox.fromPoints","graphic.BezierCurve","separation","sep","helper.retrieveTargetInfo","helper.aboveViewRoot","layout.positionElement","layout.getAvailableSize","Group","Rect","animationUtil.createWrap","zrColor.fastLerp","zrColor.stringify","color","zrColor.modifyHSL","zrColor.modifyAlpha","zrColor.parse","helper.getPathToRoot","sort","vec2.clone","vec2.scale","scaleAndAdd","vec2.scaleAndAdd","vec2.sub","vec2.len","vec2.set","vec2.copy","symbolUtil.normalizeSymbolOffset","Line","vector.sub","vector.normalize","LineGroup","makeSeriesScope","curveTool.quadraticAt","vec2.distSquare","quadraticSubdivide","curveTool.quadraticSubdivide","edgeVisual","simpleLayout","circularLayout","forceLayout","createView","graphic.Point","opacityAccessPath","ParallelView","mathFloor","mathCeil","layoutUtil.getLayoutRect","restrict","graphic.applyTransform","numberUtil.asc","interactionMutex.take","interactionMutex.release","trigger","getTransform","graphic.getTransform","graphic.transformDirection","graphicUtil.clipPointsByRect","brushHelper.makeRectPanelClipPath","brushHelper.makeRectIsTargetByCursor","brushHelper.makeLinearBrushOtherExtent","actionInfo","installParallelComponent","createGridClipShape","center","createNormalBox","createLarge","transInit","preprocessor","matrix.clone","curveUtil.quadraticAt","quadraticDerivativeAt","curveUtil.quadraticDerivativeAt","Polyline","lineContain.containStroke","quadraticContain.containStroke","updateCommon","completeTreeValue","initChildren","dataToCoordSize","prepareCartesian2d","prepareGeo","prepareSingleAxis","preparePolar","prepareCalendar","isPath","graphicUtil.Path","graphicUtil.traverseElements","graphicUtil.makePath","graphicUtil.Image","graphicUtil.Text","graphicUtil.Group","graphicUtil.getShapeClass","updateZ","labelStyleHelper.createTextStyle","labelStyleHelper.createTextConfig","labelStyleHelper.getFont","bind","updateProps","axisPointerModelHelper.getAxisInfo","graphic.createIcon","throttleUtil.createOrUpdate","throttleUtil.clear","axisHelper.getAxisRawValue","viewHelper.buildElStyle","viewHelper.buildCartesianSingleLabelElOption","viewHelper.getTransformedPosition","viewHelper.makeLineShape","viewHelper.makeRectShape","globalListener.register","globalListener.unregister","modelHelper.makeKey","installSimple","installAxisPointer","pointerShapeBuilder","viewHelper.buildLabelElOption","viewHelper.makeSectorShape","elementList","selfBuilderAttrs","axisElementBuilders","getSeriesStackId","getAxisKey","singleAxisHelper.layout","zrUtil.logError","createEl","graphicUtil.setTooltipConfig","layoutUtil.positionElement","zrUtil.hasOwn","layoutUtil.LOCATION_PARAMS","asc","numberUtil.linearMap","numberUtil.getPixelPrecision","SelectZoomModel","SelectZoomView","featureManager.getFeature","layoutBox","listComponentHelper.layout","listComponentHelper.makeBackground","trim","zrUtil.isDom","clear","history.clear","parseFinder","modelUtilParseFinder","getSize","handlers","history.push","history.pop","history.count","DataZoom","Restore","installDataZoomSelect","makeStyleCoord","makeDispatchAction","axisPointerViewHelper.getValueLabel","visualSolution.createVisualMappings","visualSolution.applyVisual","visualSolution.replaceVisualOption","createScaleByModel","getAxisInfo","dataFilter","markerHelper.dataTransform","markerHelper.dataFilter","markerHelper.createMarkerDimValueGetter","markerHelper.getAxisInfo","markerHelper.numCalculate","createList","isInfinity","markerHelper.zoneFilter","colorUtil.modifyAlpha","curry","layoutUtil.box","mergeAndNormalizeLayoutParams","WH","XY","installLegendPlain","installLegendScroll","dispatchAction","roams.setViewInfoToCoordSysRecord","roams.disposeCoordSysRecordIfNeeded","throttle.createOrUpdate","throttle.clear","installDataZoomInside","installDataZoomSlider","defaultOption","mapVisual","isArray","linearMap","helper.getItemAlign","getCursor","modelUtil.compressBatches","helper.makeHighDownBatch","visualSolution.incrementalApplyVisual","has","installed","installCommon","layout.box","PiecewiseView","installVisualMapContinuous","installVisualMapPiecewise","crossProduct2d","lineLineIntersect","centroid","removeEl","CanvasRenderer","SVGRenderer","LineChart","BarChart","PieChart","ScatterChart","RadarChart","MapChart","TreeChart","TreemapChart","GraphChart","GaugeChart","FunnelChart","ParallelChart","SankeyChart","BoxplotChart","CandlestickChart","EffectScatterChart","LinesChart","HeatmapChart","PictorialBarChart","ThemeRiverChart","SunburstChart","CustomChart","GridComponent","PolarComponent","GeoComponent","SingleAxisComponent","ParallelComponent","CalendarComponent","GraphicComponent","ToolboxComponent","TooltipComponent","AxisPointerComponent","BrushComponent","TitleComponent","TimelineComponent","MarkPointComponent","MarkLineComponent","MarkAreaComponent","LegendComponent","DataZoomComponent","DataZoomInsideComponent","DataZoomSliderComponent","VisualMapComponent","VisualMapContinuousComponent","VisualMapPiecewiseComponent","AriaComponent","TransformComponent","DatasetComponent","UniversalTransition","LabelLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;AACF;IACO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AI,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC/E,IAAI,IAAI,MAAM,GAAG,OAAO,IAAI,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS;IAC7E;IACA;IACA,MAAM,OAAO,CAAC;IACd,IAAI,OAAO,EAAE,CAAC;IACd,IAAI,OAAO,MAAM,CAAC;IAClB,GAAG;IACH,CAAC,EAAE,CAAC;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IC1SA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,SAAS,cAAc,CAAC,KAAK;IACpC;IACA,GAAG,EAAE;IACL;IACA,EAAE,IAAI,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC;IAChC,EAAE,IAAI,OAAO,KAAK,SAAS,EAAE;IAC7B;IACA,IAAI,OAAO,KAAK,CAAC;IACjB,GAAG;IACH,EAAE,IAAI,OAAO,KAAK,MAAM;IACxB;IACA,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,GAAG,EAAE;IACzD,IAAI,KAAK,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,GAAG;IACH;IACA;IACA;IACA;IACA;IACA,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,G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AEC,SAAgB,EAAEC,SAAkB,EAAEC,SAAU,EAAEC,SAAY,EAAEC,SAAiB,EAAEC,SAAe,EAAEC,SAAa,EAAEC,SAAW,CAAC,CAAC,CAAC;IACjT;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAa,CAAC,CAAC;IACnB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAc,CAAC,CAAC;IACpB;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAY,CAAC,CAAC;IAClB;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAmB,CAAC,CAAC;IACzB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAiB,CAAC,CAAC;IACvB;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAiB,CAAC,CAAC;IACvB;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAgB,CAAC,CAAC;IACtB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAgB,CAAC,CAAC;IACtB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAgB,CAAC,CAAC;IACtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAoB,CAAC,CAAC;IAC1B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAc,CAAC,CAAC;IACpB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAc,CAAC,CAAC;IACpB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAiB,CAAC,CAAC;IACvB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAkB,CAAC,CAAC;IACxB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAiB,CAAC,CAAC;IACvB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAiB,CAAC,CAAC;IACvB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAe,CAAC,CAAC;IACrB;IACA,GAAG,CAACC,SAAiB,CAAC,CAAC;IACvB;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAuB,CAAC,CAAC;IAC7B;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAuB,CAAC,CAAC;IAC7B;IACA,GAAG,CAACC,SAAkB,CAAC,CAAC;IACxB;IACA;IACA;IACA;IACA,GAAG,CAACC,SAA4B,CAAC,CAAC;IAClC;IACA;IACA;IACA;IACA,GAAG,CAACC,SAA2B,CAAC,CAAC;IACjC;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAa,CAAC,CAAC;IACnB;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,SAAkB,CAAC,CAAC;IACxB,GAAG,CAACC,SAAgB,CAAC,CAAC;IACtB;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,0BAAmB,CAAC,CAAC;IACzB;IACA;IACA;IACA;IACA;IACA;IACA,GAAG,CAACC,kBAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{ + "version": 3, + "sources": ["../src/echarts.all.ts", "../node_modules/zrender/src/zrender.ts", "../node_modules/zrender/src/core/env.ts", "../node_modules/zrender/src/core/util.ts", "../node_modules/zrender/src/core/platform.ts", "../node_modules/zrender/src/core/vector.ts", "../node_modules/zrender/src/mixin/Draggable.ts", "../node_modules/zrender/src/core/Eventful.ts", "../node_modules/zrender/src/core/fourPointsTransform.ts", "../node_modules/zrender/src/core/dom.ts", "../node_modules/zrender/src/core/event.ts", "../node_modules/zrender/src/core/GestureMgr.ts", "../node_modules/zrender/src/core/matrix.ts", "../node_modules/zrender/src/core/Point.ts", "../node_modules/zrender/src/core/BoundingRect.ts", "../node_modules/zrender/src/Handler.ts", "../node_modules/zrender/src/core/timsort.ts", "../node_modules/zrender/src/graphic/constants.ts", "../node_modules/zrender/src/Storage.ts", "../node_modules/zrender/src/animation/requestAnimationFrame.ts", "../node_modules/zrender/src/animation/easing.ts", "../node_modules/zrender/src/core/curve.ts", "../node_modules/zrender/src/animation/cubicEasing.ts", "../node_modules/zrender/src/animation/Clip.ts", "../node_modules/zrender/src/tool/color.ts", "../node_modules/zrender/src/core/LRU.ts", "../node_modules/zrender/src/svg/helper.ts", "../node_modules/zrender/src/animation/Animator.ts", "../node_modules/zrender/src/animation/Animation.ts", "../node_modules/zrender/src/dom/HandlerProxy.ts", "../node_modules/zrender/src/config.ts", "../node_modules/zrender/src/core/Transformable.ts", "../node_modules/zrender/src/contain/text.ts", "../node_modules/zrender/src/Element.ts", "../node_modules/zrender/src/graphic/Group.ts", "../src/util/number.ts", "../src/util/log.ts", "../src/util/model.ts", "../src/util/clazz.ts", "../src/model/mixin/makeStyleMapper.ts", "../src/model/mixin/areaStyle.ts", "../node_modules/zrender/src/graphic/helper/image.ts", "../node_modules/zrender/src/graphic/helper/parseText.ts", "../node_modules/zrender/src/graphic/Displayable.ts", "../node_modules/zrender/src/core/bbox.ts", "../node_modules/zrender/src/core/PathProxy.ts", "../node_modules/zrender/src/contain/line.ts", "../node_modules/zrender/src/contain/cubic.ts", "../node_modules/zrender/src/contain/quadratic.ts", "../node_modules/zrender/src/contain/util.ts", "../node_modules/zrender/src/contain/arc.ts", "../node_modules/zrender/src/contain/windingLine.ts", "../node_modules/zrender/src/contain/path.ts", "../node_modules/zrender/src/graphic/Path.ts", "../node_modules/zrender/src/graphic/TSpan.ts", "../node_modules/zrender/src/graphic/Image.ts", "../node_modules/zrender/src/graphic/helper/roundRect.ts", "../node_modules/zrender/src/graphic/helper/subPixelOptimize.ts", "../node_modules/zrender/src/graphic/shape/Rect.ts", "../node_modules/zrender/src/graphic/Text.ts", "../src/util/innerStore.ts", "../src/util/states.ts", "../src/util/graphic.ts", "../node_modules/zrender/src/tool/transformPath.ts", "../node_modules/zrender/src/tool/path.ts", "../node_modules/zrender/src/graphic/shape/Circle.ts", "../node_modules/zrender/src/graphic/shape/Ellipse.ts", "../node_modules/zrender/src/graphic/helper/roundSector.ts", "../node_modules/zrender/src/graphic/shape/Sector.ts", "../node_modules/zrender/src/graphic/shape/Ring.ts", "../node_modules/zrender/src/graphic/helper/smoothBezier.ts", "../node_modules/zrender/src/graphic/helper/poly.ts", "../node_modules/zrender/src/graphic/shape/Polygon.ts", "../node_modules/zrender/src/graphic/shape/Polyline.ts", "../node_modules/zrender/src/graphic/shape/Line.ts", "../node_modules/zrender/src/graphic/shape/BezierCurve.ts", "../node_modules/zrender/src/graphic/shape/Arc.ts", "../node_modules/zrender/src/graphic/CompoundPath.ts", "../node_modules/zrender/src/graphic/Gradient.ts", "../node_modules/zrender/src/graphic/LinearGradient.ts", "../node_modules/zrender/src/graphic/RadialGradient.ts", "../node_modules/zrender/src/core/OrientedBoundingRect.ts", "../node_modules/zrender/src/graphic/IncrementalDisplayable.ts", "../src/animation/basicTransition.ts", "../src/label/labelStyle.ts", "../src/model/mixin/textStyle.ts", "../src/model/mixin/lineStyle.ts", "../src/model/mixin/itemStyle.ts", "../src/model/Model.ts", "../src/util/component.ts", "../src/i18n/langEN.ts", "../src/i18n/langZH.ts", "../src/core/locale.ts", "../src/util/time.ts", "../src/legacy/getTextRect.ts", "../src/util/format.ts", "../src/util/layout.ts", "../src/model/Component.ts", "../src/model/globalDefault.ts", "../src/util/types.ts", "../src/data/helper/sourceHelper.ts", "../src/model/internalComponentCreator.ts", "../src/model/mixin/palette.ts", "../src/model/Global.ts", "../src/core/ExtensionAPI.ts", "../src/core/CoordinateSystem.ts", "../src/model/OptionManager.ts", "../src/preprocessor/helper/compatStyle.ts", "../src/preprocessor/backwardCompat.ts", "../src/processor/dataStack.ts", "../src/data/Source.ts", "../src/data/helper/dataProvider.ts", "../src/model/mixin/dataFormat.ts", "../src/core/task.ts", "../src/data/helper/dataValueHelper.ts", "../src/data/helper/transform.ts", "../src/data/DataStore.ts", "../src/data/helper/sourceManager.ts", "../src/component/tooltip/tooltipMarkup.ts", "../src/component/tooltip/seriesFormatTooltip.ts", "../src/model/Series.ts", "../src/view/Component.ts", "../src/chart/helper/createRenderPlanner.ts", "../src/view/Chart.ts", "../src/util/throttle.ts", "../src/visual/style.ts", "../src/loading/default.ts", "../src/core/Scheduler.ts", "../src/theme/light.ts", "../src/theme/dark.ts", "../src/util/ECEventProcessor.ts", "../src/visual/symbol.ts", "../src/visual/helper.ts", "../src/legacy/dataSelectAction.ts", "../src/util/event.ts", "../node_modules/zrender/src/core/WeakMap.ts", "../src/util/symbol.ts", "../node_modules/zrender/src/canvas/helper.ts", "../node_modules/zrender/src/canvas/dashStyle.ts", "../node_modules/zrender/src/canvas/graphic.ts", "../src/util/decal.ts", "../src/visual/decal.ts", "../src/core/lifecycle.ts", "../src/core/impl.ts", "../src/core/echarts.ts", "../src/extension.ts", "../src/data/DataDiffer.ts", "../src/data/helper/dimensionHelper.ts", "../src/data/SeriesDimensionDefine.ts", "../src/data/helper/SeriesDataSchema.ts", "../src/data/SeriesData.ts", "../src/export/api/helper.ts", "../src/data/helper/createDimensions.ts", "../src/model/referHelper.ts", "../src/data/helper/dataStackHelper.ts", "../src/chart/helper/createSeriesData.ts", "../src/scale/Scale.ts", "../src/data/OrdinalMeta.ts", "../src/scale/helper.ts", "../src/scale/Ordinal.ts", "../src/scale/Interval.ts", "../src/util/vendor.ts", "../src/layout/barGrid.ts", "../src/scale/Time.ts", "../src/scale/Log.ts", "../src/coord/scaleRawExtentInfo.ts", "../src/coord/axisHelper.ts", "../src/coord/axisModelCommonMixin.ts", "../node_modules/zrender/src/contain/polygon.ts", "../src/coord/geo/Region.ts", "../src/coord/geo/parseGeoJson.ts", "../src/export/api/number.ts", "../src/export/api/time.ts", "../src/export/api/graphic.ts", "../src/export/api/format.ts", "../src/export/api/util.ts", "../src/coord/axisTickLabelBuilder.ts", "../src/coord/Axis.ts", "../src/export/api.ts", "../src/label/labelGuideHelper.ts", "../src/label/labelLayoutHelper.ts", "../src/label/LabelManager.ts", "../src/label/installLabelLayout.ts", "../node_modules/zrender/src/svg/SVGPathRebuilder.ts", "../node_modules/zrender/src/svg/mapStyleToAttrs.ts", "../node_modules/zrender/src/svg/core.ts", "../node_modules/zrender/src/svg/cssClassId.ts", "../node_modules/zrender/src/svg/cssAnimation.ts", "../node_modules/zrender/src/svg/cssEmphasis.ts", "../node_modules/zrender/src/svg/graphic.ts", "../node_modules/zrender/src/svg/domapi.ts", "../node_modules/zrender/src/svg/patch.ts", "../node_modules/zrender/src/svg/Painter.ts", "../src/renderer/installSVGRenderer.ts", "../node_modules/zrender/src/canvas/Layer.ts", "../node_modules/zrender/src/canvas/Painter.ts", "../src/renderer/installCanvasRenderer.ts", "../src/chart/line/LineSeries.ts", "../src/chart/helper/labelHelper.ts", "../src/chart/helper/Symbol.ts", "../src/chart/helper/SymbolDraw.ts", "../src/chart/line/helper.ts", "../src/chart/line/lineAnimationDiff.ts", "../src/chart/line/poly.ts", "../src/chart/helper/createClipPathFromCoordSys.ts", "../src/coord/CoordinateSystem.ts", "../src/chart/line/LineView.ts", "../src/layout/points.ts", "../src/processor/dataSample.ts", "../src/chart/line/install.ts", "../src/chart/bar/BaseBarSeries.ts", "../src/chart/bar/BarSeries.ts", "../src/util/shape/sausage.ts", "../src/label/sectorLabel.ts", "../src/chart/helper/sectorHelper.ts", "../src/chart/bar/BarView.ts", "../src/chart/bar/install.ts", "../src/chart/pie/pieLayout.ts", "../src/processor/dataFilter.ts", "../src/chart/pie/labelLayout.ts", "../src/chart/pie/PieView.ts", "../src/chart/helper/createSeriesDataSimply.ts", "../src/visual/LegendVisualProvider.ts", "../src/chart/pie/PieSeries.ts", "../src/processor/negativeDataFilter.ts", "../src/chart/pie/install.ts", "../src/chart/scatter/ScatterSeries.ts", "../src/chart/helper/LargeSymbolDraw.ts", "../src/chart/scatter/ScatterView.ts", "../src/coord/cartesian/GridModel.ts", "../src/coord/cartesian/AxisModel.ts", "../src/coord/axisDefault.ts", "../src/coord/axisCommonTypes.ts", "../src/coord/axisModelCreator.ts", "../src/coord/cartesian/Cartesian.ts", "../src/coord/cartesian/Cartesian2D.ts", "../src/coord/cartesian/Axis2D.ts", "../src/coord/cartesian/cartesianAxisHelper.ts", "../src/coord/axisAlignTicks.ts", "../src/coord/cartesian/Grid.ts", "../src/component/axis/AxisBuilder.ts", "../src/component/axisPointer/modelHelper.ts", "../src/component/axis/AxisView.ts", "../src/component/axis/axisSplitHelper.ts", "../src/component/axis/CartesianAxisView.ts", "../src/component/grid/installSimple.ts", "../src/chart/scatter/install.ts", "../src/chart/radar/radarLayout.ts", "../src/chart/radar/backwardCompat.ts", "../src/chart/radar/RadarView.ts", "../src/chart/radar/RadarSeries.ts", "../src/coord/radar/RadarModel.ts", "../src/component/radar/RadarView.ts", "../src/coord/radar/IndicatorAxis.ts", "../src/coord/radar/Radar.ts", "../src/component/radar/install.ts", "../src/chart/radar/install.ts", "../src/component/helper/interactionMutex.ts", "../src/component/helper/RoamController.ts", "../src/component/helper/roamHelper.ts", "../src/component/helper/cursorHelper.ts", "../node_modules/zrender/src/tool/parseXML.ts", "../node_modules/zrender/src/tool/parseSVG.ts", "../src/coord/geo/GeoSVGResource.ts", "../src/coord/geo/fix/nanhai.ts", "../src/coord/geo/fix/textCoord.ts", "../src/coord/geo/fix/diaoyuIsland.ts", "../src/coord/geo/GeoJSONResource.ts", "../src/coord/geo/geoSourceManager.ts", "../src/component/helper/MapDraw.ts", "../src/chart/map/MapView.ts", "../src/chart/map/MapSeries.ts", "../src/chart/map/mapDataStatistic.ts", "../src/chart/map/mapSymbolLayout.ts", "../src/coord/View.ts", "../src/coord/geo/Geo.ts", "../src/coord/geo/geoCreator.ts", "../src/coord/geo/GeoModel.ts", "../src/action/roamHelper.ts", "../src/component/geo/GeoView.ts", "../src/component/geo/install.ts", "../src/chart/map/install.ts", "../src/chart/tree/layoutHelper.ts", "../src/chart/tree/TreeView.ts", "../src/data/helper/linkSeriesData.ts", "../src/data/Tree.ts", "../src/chart/helper/treeHelper.ts", "../src/chart/tree/TreeSeries.ts", "../src/chart/tree/traversalHelper.ts", "../src/chart/tree/treeLayout.ts", "../src/chart/tree/treeVisual.ts", "../src/chart/tree/treeAction.ts", "../src/chart/tree/install.ts", "../src/chart/treemap/treemapAction.ts", "../src/chart/helper/enableAriaDecalForTree.ts", "../src/chart/treemap/TreemapSeries.ts", "../src/chart/treemap/Breadcrumb.ts", "../src/util/animation.ts", "../src/chart/treemap/TreemapView.ts", "../src/visual/VisualMapping.ts", "../src/chart/treemap/treemapVisual.ts", "../src/chart/treemap/treemapLayout.ts", "../src/chart/treemap/install.ts", "../src/chart/graph/categoryFilter.ts", "../src/chart/graph/categoryVisual.ts", "../src/chart/graph/edgeVisual.ts", "../src/chart/helper/multipleGraphEdgeHelper.ts", "../src/chart/graph/simpleLayoutHelper.ts", "../src/chart/graph/simpleLayout.ts", "../src/chart/graph/graphHelper.ts", "../src/chart/graph/circularLayoutHelper.ts", "../src/chart/graph/circularLayout.ts", "../src/chart/graph/forceHelper.ts", "../src/chart/graph/forceLayout.ts", "../src/chart/graph/createView.ts", "../src/chart/helper/LinePath.ts", "../src/chart/helper/Line.ts", "../src/chart/helper/LineDraw.ts", "../src/chart/graph/adjustEdge.ts", "../src/chart/graph/GraphView.ts", "../src/data/Graph.ts", "../src/chart/helper/createGraphFromNodeEdge.ts", "../src/chart/graph/GraphSeries.ts", "../src/chart/graph/install.ts", "../src/chart/gauge/PointerPath.ts", "../src/chart/gauge/GaugeView.ts", "../src/chart/gauge/GaugeSeries.ts", "../src/chart/gauge/install.ts", "../src/chart/funnel/FunnelView.ts", "../src/chart/funnel/FunnelSeries.ts", "../src/chart/funnel/funnelLayout.ts", "../src/chart/funnel/install.ts", "../src/chart/parallel/ParallelView.ts", "../src/chart/parallel/ParallelSeries.ts", "../src/chart/parallel/parallelVisual.ts", "../src/coord/parallel/parallelPreprocessor.ts", "../src/component/parallel/ParallelView.ts", "../src/coord/parallel/ParallelModel.ts", "../src/coord/parallel/ParallelAxis.ts", "../src/component/helper/sliderMove.ts", "../src/coord/parallel/Parallel.ts", "../src/coord/parallel/parallelCreator.ts", "../src/coord/parallel/AxisModel.ts", "../src/component/helper/BrushController.ts", "../src/component/helper/brushHelper.ts", "../src/component/axis/ParallelAxisView.ts", "../src/component/axis/parallelAxisAction.ts", "../src/component/parallel/install.ts", "../src/chart/parallel/install.ts", "../src/chart/sankey/SankeyView.ts", "../src/chart/sankey/SankeySeries.ts", "../src/chart/sankey/sankeyLayout.ts", "../src/chart/sankey/sankeyVisual.ts", "../src/chart/sankey/install.ts", "../src/chart/helper/whiskerBoxCommon.ts", "../src/chart/boxplot/BoxplotSeries.ts", "../src/chart/boxplot/BoxplotView.ts", "../src/chart/boxplot/boxplotLayout.ts", "../src/chart/boxplot/prepareBoxplotData.ts", "../src/chart/boxplot/boxplotTransform.ts", "../src/chart/boxplot/install.ts", "../src/chart/candlestick/candlestickVisual.ts", "../src/chart/candlestick/CandlestickView.ts", "../src/chart/candlestick/CandlestickSeries.ts", "../src/chart/candlestick/preprocessor.ts", "../src/chart/candlestick/candlestickLayout.ts", "../src/chart/candlestick/install.ts", "../src/chart/helper/EffectSymbol.ts", "../src/chart/effectScatter/EffectScatterView.ts", "../src/chart/effectScatter/EffectScatterSeries.ts", "../src/chart/effectScatter/install.ts", "../src/chart/helper/EffectLine.ts", "../src/chart/helper/Polyline.ts", "../src/chart/helper/EffectPolyline.ts", "../src/chart/helper/LargeLineDraw.ts", "../src/chart/lines/linesLayout.ts", "../src/chart/lines/LinesView.ts", "../src/chart/lines/LinesSeries.ts", "../src/chart/lines/linesVisual.ts", "../src/chart/lines/install.ts", "../src/chart/heatmap/HeatmapLayer.ts", "../src/chart/heatmap/HeatmapView.ts", "../src/chart/heatmap/HeatmapSeries.ts", "../src/chart/heatmap/install.ts", "../src/chart/bar/PictorialBarView.ts", "../src/chart/bar/PictorialBarSeries.ts", "../src/chart/bar/installPictorialBar.ts", "../src/chart/themeRiver/ThemeRiverView.ts", "../src/chart/themeRiver/ThemeRiverSeries.ts", "../src/chart/themeRiver/themeRiverLayout.ts", "../src/chart/themeRiver/install.ts", "../src/chart/sunburst/SunburstPiece.ts", "../src/chart/sunburst/sunburstAction.ts", "../src/chart/sunburst/SunburstView.ts", "../src/chart/sunburst/SunburstSeries.ts", "../src/chart/sunburst/sunburstLayout.ts", "../src/chart/sunburst/sunburstVisual.ts", "../src/chart/sunburst/install.ts", "../src/chart/custom/CustomSeries.ts", "../src/coord/cartesian/prepareCustom.ts", "../src/coord/geo/prepareCustom.ts", "../src/coord/single/prepareCustom.ts", "../src/coord/polar/prepareCustom.ts", "../src/coord/calendar/prepareCustom.ts", "../src/util/styleCompat.ts", "../src/animation/customGraphicTransition.ts", "../src/animation/customGraphicKeyframeAnimation.ts", "../src/chart/custom/CustomView.ts", "../src/chart/custom/install.ts", "../src/component/graphic/GraphicModel.ts", "../src/component/axisPointer/BaseAxisPointer.ts", "../src/component/axisPointer/viewHelper.ts", "../src/component/axisPointer/CartesianAxisPointer.ts", "../src/component/axisPointer/AxisPointerModel.ts", "../src/component/axisPointer/globalListener.ts", "../src/component/axisPointer/AxisPointerView.ts", "../src/component/axisPointer/findPointFromSeries.ts", "../src/component/axisPointer/axisTrigger.ts", "../src/component/axisPointer/install.ts", "../src/component/grid/install.ts", "../src/component/axisPointer/PolarAxisPointer.ts", "../src/coord/polar/PolarModel.ts", "../src/coord/polar/AxisModel.ts", "../src/coord/polar/RadiusAxis.ts", "../src/coord/polar/AngleAxis.ts", "../src/coord/polar/Polar.ts", "../src/coord/polar/polarCreator.ts", "../src/component/axis/AngleAxisView.ts", "../src/component/axis/RadiusAxisView.ts", "../src/layout/barPolar.ts", "../src/component/polar/install.ts", "../src/coord/single/singleAxisHelper.ts", "../src/component/axis/SingleAxisView.ts", "../src/coord/single/AxisModel.ts", "../src/coord/single/SingleAxis.ts", "../src/coord/single/Single.ts", "../src/coord/single/singleCreator.ts", "../src/component/axisPointer/SingleAxisPointer.ts", "../src/component/singleAxis/install.ts", "../src/coord/calendar/CalendarModel.ts", "../src/component/calendar/CalendarView.ts", "../src/coord/calendar/Calendar.ts", "../src/component/calendar/install.ts", "../src/component/graphic/GraphicView.ts", "../src/component/graphic/install.ts", "../src/component/dataZoom/helper.ts", "../src/component/dataZoom/DataZoomModel.ts", "../src/component/dataZoom/SelectZoomModel.ts", "../src/component/dataZoom/DataZoomView.ts", "../src/component/dataZoom/SelectZoomView.ts", "../src/component/dataZoom/AxisProxy.ts", "../src/component/dataZoom/dataZoomProcessor.ts", "../src/component/dataZoom/dataZoomAction.ts", "../src/component/dataZoom/installCommon.ts", "../src/component/dataZoom/installDataZoomSelect.ts", "../src/component/toolbox/featureManager.ts", "../src/component/toolbox/ToolboxModel.ts", "../src/component/helper/listComponent.ts", "../src/component/toolbox/ToolboxView.ts", "../src/component/toolbox/feature/SaveAsImage.ts", "../src/component/toolbox/feature/MagicType.ts", "../src/component/toolbox/feature/DataView.ts", "../src/component/dataZoom/history.ts", "../src/component/toolbox/feature/Restore.ts", "../src/component/helper/BrushTargetManager.ts", "../src/component/toolbox/feature/DataZoom.ts", "../src/component/toolbox/install.ts", "../src/component/tooltip/TooltipModel.ts", "../src/component/tooltip/helper.ts", "../src/component/tooltip/TooltipHTMLContent.ts", "../src/component/tooltip/TooltipRichContent.ts", "../src/component/tooltip/TooltipView.ts", "../src/component/tooltip/install.ts", "../src/component/brush/preprocessor.ts", "../src/visual/visualSolution.ts", "../src/component/brush/selector.ts", "../src/component/brush/visualEncoding.ts", "../src/component/brush/BrushView.ts", "../src/component/brush/BrushModel.ts", "../src/component/toolbox/feature/Brush.ts", "../src/component/brush/install.ts", "../src/component/title/install.ts", "../src/component/timeline/TimelineModel.ts", "../src/component/timeline/SliderTimelineModel.ts", "../src/component/timeline/TimelineView.ts", "../src/component/timeline/TimelineAxis.ts", "../src/component/timeline/SliderTimelineView.ts", "../src/component/timeline/timelineAction.ts", "../src/component/timeline/preprocessor.ts", "../src/component/timeline/install.ts", "../src/component/marker/checkMarkerInSeries.ts", "../src/component/marker/MarkerModel.ts", "../src/component/marker/MarkPointModel.ts", "../src/component/marker/markerHelper.ts", "../src/component/marker/MarkerView.ts", "../src/component/marker/MarkPointView.ts", "../src/component/marker/installMarkPoint.ts", "../src/component/marker/MarkLineModel.ts", "../src/component/marker/MarkLineView.ts", "../src/component/marker/installMarkLine.ts", "../src/component/marker/MarkAreaModel.ts", "../src/component/marker/MarkAreaView.ts", "../src/component/marker/installMarkArea.ts", "../src/component/legend/LegendModel.ts", "../src/component/legend/LegendView.ts", "../src/component/legend/legendFilter.ts", "../src/component/legend/legendAction.ts", "../src/component/legend/installLegendPlain.ts", "../src/component/legend/ScrollableLegendModel.ts", "../src/component/legend/ScrollableLegendView.ts", "../src/component/legend/scrollableLegendAction.ts", "../src/component/legend/installLegendScroll.ts", "../src/component/legend/install.ts", "../src/component/dataZoom/InsideZoomModel.ts", "../src/component/dataZoom/roams.ts", "../src/component/dataZoom/InsideZoomView.ts", "../src/component/dataZoom/installDataZoomInside.ts", "../src/component/dataZoom/SliderZoomModel.ts", "../src/component/dataZoom/SliderZoomView.ts", "../src/component/dataZoom/installDataZoomSlider.ts", "../src/component/dataZoom/install.ts", "../src/visual/visualDefault.ts", "../src/component/visualMap/VisualMapModel.ts", "../src/component/visualMap/ContinuousModel.ts", "../src/component/visualMap/VisualMapView.ts", "../src/component/visualMap/helper.ts", "../src/component/visualMap/ContinuousView.ts", "../src/component/visualMap/visualMapAction.ts", "../src/component/visualMap/visualEncoding.ts", "../src/component/visualMap/preprocessor.ts", "../src/component/visualMap/installCommon.ts", "../src/component/visualMap/installVisualMapContinuous.ts", "../src/component/visualMap/PiecewiseModel.ts", "../src/component/visualMap/PiecewiseView.ts", "../src/component/visualMap/installVisualMapPiecewise.ts", "../src/component/visualMap/install.ts", "../src/visual/aria.ts", "../src/component/aria/preprocessor.ts", "../src/component/aria/install.ts", "../src/util/conditionalExpression.ts", "../src/component/transform/filterTransform.ts", "../src/component/transform/sortTransform.ts", "../src/component/transform/install.ts", "../src/component/dataset/install.ts", "../node_modules/zrender/src/tool/convertPath.ts", "../node_modules/zrender/src/tool/dividePath.ts", "../node_modules/zrender/src/tool/morphPath.ts", "../src/animation/morphTransitionHelper.ts", "../src/animation/universalTransition.ts"], + "sourcesContent": ["/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {use} from './extension';\r\n\r\nexport * from './export/core';\r\n// ----------------------------------------------\r\n// All of the modules that are allowed to be\r\n// imported are listed below.\r\n//\r\n// Users MUST NOT import other modules that are\r\n// not included in this list.\r\n// ----------------------------------------------\r\n\r\nimport {\r\n SVGRenderer,\r\n CanvasRenderer\r\n} from './export/renderers';\r\n\r\nimport {\r\n LineChart,\r\n BarChart,\r\n PieChart,\r\n ScatterChart,\r\n RadarChart,\r\n MapChart,\r\n TreeChart,\r\n TreemapChart,\r\n GraphChart,\r\n GaugeChart,\r\n FunnelChart,\r\n ParallelChart,\r\n SankeyChart,\r\n BoxplotChart,\r\n CandlestickChart,\r\n EffectScatterChart,\r\n LinesChart,\r\n HeatmapChart,\r\n PictorialBarChart,\r\n ThemeRiverChart,\r\n SunburstChart,\r\n CustomChart\r\n} from './export/charts';\r\n\r\nimport {\r\n GridComponent,\r\n PolarComponent,\r\n GeoComponent,\r\n SingleAxisComponent,\r\n ParallelComponent,\r\n CalendarComponent,\r\n GraphicComponent,\r\n ToolboxComponent,\r\n TooltipComponent,\r\n AxisPointerComponent,\r\n BrushComponent,\r\n TitleComponent,\r\n TimelineComponent,\r\n MarkPointComponent,\r\n MarkLineComponent,\r\n MarkAreaComponent,\r\n LegendComponent,\r\n DataZoomComponent,\r\n DataZoomInsideComponent,\r\n DataZoomSliderComponent,\r\n VisualMapComponent,\r\n VisualMapContinuousComponent,\r\n VisualMapPiecewiseComponent,\r\n AriaComponent,\r\n DatasetComponent,\r\n TransformComponent\r\n} from './export/components';\r\n\r\nimport {\r\n UniversalTransition,\r\n LabelLayout\r\n} from './export/features';\r\n\r\n\r\n// -----------------\r\n// Render engines\r\n// -----------------\r\n\r\n\r\n// Render via Canvas.\r\n// echarts.init(dom, null, { renderer: 'canvas' })\r\nuse([CanvasRenderer]);\r\n// Render via SVG.\r\n// echarts.init(dom, null, { renderer: 'svg' })\r\nuse([SVGRenderer]);\r\n\r\n// ----------------\r\n// Charts (series)\r\n// ----------------\r\n\r\n// All of the series types, for example:\r\n// chart.setOption({\r\n// series: [{\r\n// type: 'line' // or 'bar', 'pie', ...\r\n// }]\r\n// });\r\n\r\n\r\nuse([\r\n LineChart,\r\n BarChart,\r\n PieChart,\r\n ScatterChart,\r\n RadarChart,\r\n MapChart,\r\n TreeChart,\r\n TreemapChart,\r\n GraphChart,\r\n GaugeChart,\r\n FunnelChart,\r\n ParallelChart,\r\n SankeyChart,\r\n BoxplotChart,\r\n CandlestickChart,\r\n EffectScatterChart,\r\n LinesChart,\r\n HeatmapChart,\r\n PictorialBarChart,\r\n ThemeRiverChart,\r\n SunburstChart,\r\n CustomChart\r\n]);\r\n\r\n// -------------------\r\n// Coordinate systems\r\n// -------------------\r\n\r\n\r\n\r\n// All of the axis modules have been included in the\r\n// coordinate system module below, do not need to\r\n// make extra import.\r\n\r\n// `cartesian` coordinate system. For some historical\r\n// reasons, it is named as grid, for example:\r\n// chart.setOption({\r\n// grid: {...},\r\n// xAxis: {...},\r\n// yAxis: {...},\r\n// series: [{...}]\r\n// });\r\nuse(GridComponent);\r\n\r\n// `polar` coordinate system, for example:\r\n// chart.setOption({\r\n// polar: {...},\r\n// radiusAxis: {...},\r\n// angleAxis: {...},\r\n// series: [{\r\n// coordinateSystem: 'polar'\r\n// }]\r\n// });\r\nuse(PolarComponent);\r\n\r\n// `geo` coordinate system, for example:\r\n// chart.setOption({\r\n// geo: {...},\r\n// series: [{\r\n// coordinateSystem: 'geo'\r\n// }]\r\n// });\r\nuse(GeoComponent);\r\n\r\n// `singleAxis` coordinate system (notice, it is a coordinate system\r\n// with only one axis, work for chart like theme river), for example:\r\n// chart.setOption({\r\n// singleAxis: {...}\r\n// series: [{type: 'themeRiver', ...}]\r\n// });\r\nuse(SingleAxisComponent);\r\n\r\n// `parallel` coordinate system, only work for parallel series, for example:\r\n// chart.setOption({\r\n// parallel: {...},\r\n// parallelAxis: [{...}, ...],\r\n// series: [{\r\n// type: 'parallel'\r\n// }]\r\n// });\r\nuse(ParallelComponent);\r\n\r\n// `calendar` coordinate system. for example,\r\n// chart.setOption({\r\n// calendar: {...},\r\n// series: [{\r\n// coordinateSystem: 'calendar'\r\n// }]\r\n// );\r\nuse(CalendarComponent);\r\n\r\n\r\n\r\n// ------------------\r\n// Other components\r\n// ------------------\r\n\r\n\r\n\r\n// `graphic` component, for example:\r\n// chart.setOption({\r\n// graphic: {...}\r\n// });\r\nuse(GraphicComponent);\r\n\r\n// `toolbox` component, for example:\r\n// chart.setOption({\r\n// toolbox: {...}\r\n// });\r\nuse(ToolboxComponent);\r\n\r\n// `tooltip` component, for example:\r\n// chart.setOption({\r\n// tooltip: {...}\r\n// });\r\nuse(TooltipComponent);\r\n\r\n// `axisPointer` component, for example:\r\n// chart.setOption({\r\n// tooltip: {axisPointer: {...}, ...}\r\n// });\r\n// Or\r\n// chart.setOption({\r\n// axisPointer: {...}\r\n// });\r\nuse(AxisPointerComponent);\r\n\r\n// `brush` component, for example:\r\n// chart.setOption({\r\n// brush: {...}\r\n// });\r\n// Or\r\n// chart.setOption({\r\n// tooltip: {feature: {brush: {...}}\r\n// })\r\nuse(BrushComponent);\r\n\r\n// `title` component, for example:\r\n// chart.setOption({\r\n// title: {...}\r\n// });\r\nuse(TitleComponent);\r\n\r\n// `timeline` component, for example:\r\n// chart.setOption({\r\n// timeline: {...}\r\n// });\r\nuse(TimelineComponent);\r\n\r\n// `markPoint` component, for example:\r\n// chart.setOption({\r\n// series: [{markPoint: {...}}]\r\n// });\r\nuse(MarkPointComponent);\r\n\r\n// `markLine` component, for example:\r\n// chart.setOption({\r\n// series: [{markLine: {...}}]\r\n// });\r\nuse(MarkLineComponent);\r\n\r\n// `markArea` component, for example:\r\n// chart.setOption({\r\n// series: [{markArea: {...}}]\r\n// });\r\nuse(MarkAreaComponent);\r\n\r\n// `legend` component not scrollable. for example:\r\n// chart.setOption({\r\n// legend: {...}\r\n// });\r\nuse(LegendComponent);\r\n\r\n// `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.\r\nuse(DataZoomComponent);\r\n\r\n// `dataZoom` component providing drag, pinch, wheel behaviors\r\n// inside coordinate system, for example:\r\n// chart.setOption({\r\n// dataZoom: {type: 'inside'}\r\n// });\r\nuse(DataZoomInsideComponent);\r\n\r\n// `dataZoom` component providing a slider bar, for example:\r\n// chart.setOption({\r\n// dataZoom: {type: 'slider'}\r\n// });\r\nuse(DataZoomSliderComponent);\r\n\r\n// `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.\r\nuse(VisualMapComponent);\r\n\r\n// `visualMap` component providing continuous bar, for example:\r\n// chart.setOption({\r\n// visualMap: {type: 'continuous'}\r\n// });\r\nuse(VisualMapContinuousComponent);\r\n\r\n// `visualMap` component providing pieces bar, for example:\r\n// chart.setOption({\r\n// visualMap: {type: 'piecewise'}\r\n// });\r\nuse(VisualMapPiecewiseComponent);\r\n\r\n// `aria` component providing aria, for example:\r\n// chart.setOption({\r\n// aria: {...}\r\n// });\r\nuse(AriaComponent);\r\n\r\n\r\n// dataset transform\r\n// chart.setOption({\r\n// dataset: {\r\n// transform: []\r\n// }\r\n// });\r\nuse(TransformComponent);\r\n\r\nuse(DatasetComponent);\r\n\r\n// universal transition\r\n// chart.setOption({\r\n// series: {\r\n// universalTransition: { enabled: true }\r\n// }\r\n// })\r\nuse(UniversalTransition);\r\n\r\n// label layout\r\n// chart.setOption({\r\n// series: {\r\n// labelLayout: { hideOverlap: true }\r\n// }\r\n// })\r\nuse(LabelLayout);\r\n", "/*!\n* ZRender, a high performance 2d drawing library.\n*\n* Copyright (c) 2013, Baidu Inc.\n* All rights reserved.\n*\n* LICENSE\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\n*/\n\nimport env from './core/env';\nimport * as zrUtil from './core/util';\nimport Handler from './Handler';\nimport Storage from './Storage';\nimport {PainterBase} from './PainterBase';\nimport Animation, {getTime} from './animation/Animation';\nimport HandlerProxy from './dom/HandlerProxy';\nimport Element, { ElementEventCallback } from './Element';\nimport { Dictionary, ElementEventName, RenderedEvent, WithThisType } from './core/types';\nimport { LayerConfig } from './canvas/Layer';\nimport { GradientObject } from './graphic/Gradient';\nimport { PatternObject } from './graphic/Pattern';\nimport { EventCallback } from './core/Eventful';\nimport Displayable from './graphic/Displayable';\nimport { lum } from './tool/color';\nimport { DARK_MODE_THRESHOLD } from './config';\nimport Group from './graphic/Group';\n\n\ntype PainterBaseCtor = {\n new(dom: HTMLElement, storage: Storage, ...args: any[]): PainterBase\n}\n\nconst painterCtors: Dictionary = {};\n\nlet instances: { [key: number]: ZRender } = {};\n\nfunction delInstance(id: number) {\n delete instances[id];\n}\n\nfunction isDarkMode(backgroundColor: string | GradientObject | PatternObject): boolean {\n if (!backgroundColor) {\n return false;\n }\n if (typeof backgroundColor === 'string') {\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\n }\n else if ((backgroundColor as GradientObject).colorStops) {\n const colorStops = (backgroundColor as GradientObject).colorStops;\n let totalLum = 0;\n const len = colorStops.length;\n // Simply do the math of average the color. Not consider the offset\n for (let i = 0; i < len; i++) {\n totalLum += lum(colorStops[i].color, 1);\n }\n totalLum /= len;\n\n return totalLum < DARK_MODE_THRESHOLD;\n }\n // Can't determine\n return false;\n}\n\nclass ZRender {\n /**\n * Not necessary if using SSR painter like svg-ssr\n */\n dom?: HTMLElement\n\n id: number\n\n storage: Storage\n painter: PainterBase\n handler: Handler\n animation: Animation\n\n private _sleepAfterStill = 10;\n\n private _stillFrameAccum = 0;\n\n private _needsRefresh = true\n private _needsRefreshHover = true\n private _disposed: boolean;\n /**\n * If theme is dark mode. It will determine the color strategy for labels.\n */\n private _darkMode = false;\n\n private _backgroundColor: string | GradientObject | PatternObject;\n\n constructor(id: number, dom?: HTMLElement, opts?: ZRenderInitOpt) {\n opts = opts || {};\n\n /**\n * @type {HTMLDomElement}\n */\n this.dom = dom;\n\n this.id = id;\n\n const storage = new Storage();\n\n let rendererType = opts.renderer || 'canvas';\n\n if (!painterCtors[rendererType]) {\n // Use the first registered renderer.\n rendererType = zrUtil.keys(painterCtors)[0];\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!painterCtors[rendererType]) {\n throw new Error(`Renderer '${rendererType}' is not imported. Please import it first.`);\n }\n }\n\n opts.useDirtyRect = opts.useDirtyRect == null\n ? false\n : opts.useDirtyRect;\n\n const painter = new painterCtors[rendererType](dom, storage, opts, id);\n const ssrMode = opts.ssr || painter.ssrOnly;\n\n this.storage = storage;\n this.painter = painter;\n\n const handlerProxy = (!env.node && !env.worker && !ssrMode)\n ? new HandlerProxy(painter.getViewportRoot(), painter.root)\n : null;\n\n const useCoarsePointer = opts.useCoarsePointer;\n const usePointerSize = (useCoarsePointer == null || useCoarsePointer === 'auto')\n ? env.touchEventsSupported\n : !!useCoarsePointer;\n const defaultPointerSize = 44;\n let pointerSize;\n if (usePointerSize) {\n pointerSize = zrUtil.retrieve2(opts.pointerSize, defaultPointerSize);\n }\n\n this.handler = new Handler(storage, painter, handlerProxy, painter.root, pointerSize);\n\n this.animation = new Animation({\n stage: {\n update: ssrMode ? null : () => this._flush(true)\n }\n });\n\n if (!ssrMode) {\n this.animation.start();\n }\n }\n\n /**\n * \u6DFB\u52A0\u5143\u7D20\n */\n add(el: Element) {\n if (this._disposed || !el) {\n return;\n }\n this.storage.addRoot(el);\n el.addSelfToZr(this);\n this.refresh();\n }\n\n /**\n * \u5220\u9664\u5143\u7D20\n */\n remove(el: Element) {\n if (this._disposed || !el) {\n return;\n }\n this.storage.delRoot(el);\n el.removeSelfFromZr(this);\n this.refresh();\n }\n\n /**\n * Change configuration of layer\n */\n configLayer(zLevel: number, config: LayerConfig) {\n if (this._disposed) {\n return;\n }\n if (this.painter.configLayer) {\n this.painter.configLayer(zLevel, config);\n }\n this.refresh();\n }\n\n /**\n * Set background color\n */\n setBackgroundColor(backgroundColor: string | GradientObject | PatternObject) {\n if (this._disposed) {\n return;\n }\n if (this.painter.setBackgroundColor) {\n this.painter.setBackgroundColor(backgroundColor);\n }\n this.refresh();\n this._backgroundColor = backgroundColor;\n this._darkMode = isDarkMode(backgroundColor);\n }\n\n getBackgroundColor() {\n return this._backgroundColor;\n }\n\n /**\n * Force to set dark mode\n */\n setDarkMode(darkMode: boolean) {\n this._darkMode = darkMode;\n }\n\n isDarkMode() {\n return this._darkMode;\n }\n\n /**\n * Repaint the canvas immediately\n */\n refreshImmediately(fromInside?: boolean) {\n if (this._disposed) {\n return;\n }\n // const start = new Date();\n if (!fromInside) {\n // Update animation if refreshImmediately is invoked from outside.\n // Not trigger stage update to call flush again. Which may refresh twice\n this.animation.update(true);\n }\n\n // Clear needsRefresh ahead to avoid something wrong happens in refresh\n // Or it will cause zrender refreshes again and again.\n this._needsRefresh = false;\n this.painter.refresh();\n // Avoid trigger zr.refresh in Element#beforeUpdate hook\n this._needsRefresh = false;\n }\n\n /**\n * Mark and repaint the canvas in the next frame of browser\n */\n refresh() {\n if (this._disposed) {\n return;\n }\n this._needsRefresh = true;\n // Active the animation again.\n this.animation.start();\n }\n\n /**\n * Perform all refresh\n */\n flush() {\n if (this._disposed) {\n return;\n }\n this._flush(false);\n }\n\n private _flush(fromInside?: boolean) {\n let triggerRendered;\n\n const start = getTime();\n if (this._needsRefresh) {\n triggerRendered = true;\n this.refreshImmediately(fromInside);\n }\n\n if (this._needsRefreshHover) {\n triggerRendered = true;\n this.refreshHoverImmediately();\n }\n const end = getTime();\n\n if (triggerRendered) {\n this._stillFrameAccum = 0;\n this.trigger('rendered', {\n elapsedTime: end - start\n } as RenderedEvent);\n }\n else if (this._sleepAfterStill > 0) {\n this._stillFrameAccum++;\n // Stop the animation after still for 10 frames.\n if (this._stillFrameAccum > this._sleepAfterStill) {\n this.animation.stop();\n }\n }\n }\n\n /**\n * Set sleep after still for frames.\n * Disable auto sleep when it's 0.\n */\n setSleepAfterStill(stillFramesCount: number) {\n this._sleepAfterStill = stillFramesCount;\n }\n\n /**\n * Wake up animation loop. But not render.\n */\n wakeUp() {\n if (this._disposed) {\n return;\n }\n this.animation.start();\n // Reset the frame count.\n this._stillFrameAccum = 0;\n }\n\n /**\n * Refresh hover in next frame\n */\n refreshHover() {\n this._needsRefreshHover = true;\n }\n\n /**\n * Refresh hover immediately\n */\n refreshHoverImmediately() {\n if (this._disposed) {\n return;\n }\n this._needsRefreshHover = false;\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\n this.painter.refreshHover();\n }\n }\n\n /**\n * Resize the canvas.\n * Should be invoked when container size is changed\n */\n resize(opts?: {\n width?: number| string\n height?: number | string\n }) {\n if (this._disposed) {\n return;\n }\n opts = opts || {};\n this.painter.resize(opts.width, opts.height);\n this.handler.resize();\n }\n\n /**\n * Stop and clear all animation immediately\n */\n clearAnimation() {\n if (this._disposed) {\n return;\n }\n this.animation.clear();\n }\n\n /**\n * Get container width\n */\n getWidth(): number | undefined {\n if (this._disposed) {\n return;\n }\n return this.painter.getWidth();\n }\n\n /**\n * Get container height\n */\n getHeight(): number | undefined {\n if (this._disposed) {\n return;\n }\n return this.painter.getHeight();\n }\n\n /**\n * Set default cursor\n * @param cursorStyle='default' \u4F8B\u5982 crosshair\n */\n setCursorStyle(cursorStyle: string) {\n if (this._disposed) {\n return;\n }\n this.handler.setCursorStyle(cursorStyle);\n }\n\n /**\n * Find hovered element\n * @param x\n * @param y\n * @return {target, topTarget}\n */\n findHover(x: number, y: number): {\n target: Displayable\n topTarget: Displayable\n } | undefined {\n if (this._disposed) {\n return;\n }\n return this.handler.findHover(x, y);\n }\n\n on(eventName: ElementEventName, eventHandler: ElementEventCallback, context?: Ctx): this\n // eslint-disable-next-line max-len\n on(eventName: string, eventHandler: WithThisType, unknown extends Ctx ? ZRenderType : Ctx>, context?: Ctx): this\n // eslint-disable-next-line max-len\n on(eventName: string, eventHandler: (...args: any) => any, context?: Ctx): this {\n if (!this._disposed) {\n this.handler.on(eventName, eventHandler, context);\n }\n return this;\n }\n\n /**\n * Unbind event\n * @param eventName Event name\n * @param eventHandler Handler function\n */\n // eslint-disable-next-line max-len\n off(eventName?: string, eventHandler?: EventCallback) {\n if (this._disposed) {\n return;\n }\n this.handler.off(eventName, eventHandler);\n }\n\n /**\n * Trigger event manually\n *\n * @param eventName Event name\n * @param event Event object\n */\n trigger(eventName: string, event?: unknown) {\n if (this._disposed) {\n return;\n }\n this.handler.trigger(eventName, event);\n }\n\n\n /**\n * Clear all objects and the canvas.\n */\n clear() {\n if (this._disposed) {\n return;\n }\n const roots = this.storage.getRoots();\n for (let i = 0; i < roots.length; i++) {\n if (roots[i] instanceof Group) {\n roots[i].removeSelfFromZr(this);\n }\n }\n this.storage.delAllRoots();\n this.painter.clear();\n }\n\n /**\n * Dispose self.\n */\n dispose() {\n if (this._disposed) {\n return;\n }\n\n this.animation.stop();\n\n this.clear();\n this.storage.dispose();\n this.painter.dispose();\n this.handler.dispose();\n\n this.animation =\n this.storage =\n this.painter =\n this.handler = null;\n\n this._disposed = true;\n\n delInstance(this.id);\n }\n}\n\n\nexport interface ZRenderInitOpt {\n renderer?: string // 'canvas' or 'svg\n devicePixelRatio?: number\n width?: number | string // 10, 10px, 'auto'\n height?: number | string\n useDirtyRect?: boolean\n useCoarsePointer?: 'auto' | boolean\n pointerSize?: number\n ssr?: boolean // If enable ssr mode.\n}\n\n/**\n * Initializing a zrender instance\n *\n * @param dom Not necessary if using SSR painter like svg-ssr\n */\nexport function init(dom?: HTMLElement | null, opts?: ZRenderInitOpt) {\n const zr = new ZRender(zrUtil.guid(), dom, opts);\n instances[zr.id] = zr;\n return zr;\n}\n\n/**\n * Dispose zrender instance\n */\nexport function dispose(zr: ZRender) {\n zr.dispose();\n}\n\n/**\n * Dispose all zrender instances\n */\nexport function disposeAll() {\n for (let key in instances) {\n if (instances.hasOwnProperty(key)) {\n instances[key].dispose();\n }\n }\n instances = {};\n}\n\n/**\n * Get zrender instance by id\n */\nexport function getInstance(id: number): ZRender {\n return instances[id];\n}\n\nexport function registerPainter(name: string, Ctor: PainterBaseCtor) {\n painterCtors[name] = Ctor;\n}\n\nexport type ElementSSRData = zrUtil.HashMap;\nexport type ElementSSRDataGetter = (el: Element) => zrUtil.HashMap;\n\nlet ssrDataGetter: ElementSSRDataGetter;\n\nexport function getElementSSRData(el: Element): ElementSSRData {\n if (typeof ssrDataGetter === 'function') {\n return ssrDataGetter(el);\n }\n}\n\nexport function registerSSRDataGetter(getter: ElementSSRDataGetter) {\n ssrDataGetter = getter;\n}\n\n/**\n * @type {string}\n */\nexport const version = '5.6.1-dev.20241025';\n\n\nexport interface ZRenderType extends ZRender {};", "declare const wx: {\n getSystemInfoSync: Function\n};\n\nclass Browser {\n firefox = false\n ie = false\n edge = false\n newEdge = false\n weChat = false\n version: string | number\n}\n\nclass Env {\n browser = new Browser()\n node = false\n wxa = false\n worker = false\n\n svgSupported = false\n touchEventsSupported = false\n pointerEventsSupported = false\n domSupported = false\n transformSupported = false\n transform3dSupported = false\n\n hasGlobalWindow = typeof window !== 'undefined'\n}\n\nconst env = new Env();\n\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n env.wxa = true;\n env.touchEventsSupported = true;\n}\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\n // In worker\n env.worker = true;\n}\nelse if (!env.hasGlobalWindow || 'Deno' in window) {\n // In node\n env.node = true;\n env.svgSupported = true;\n}\nelse {\n detect(navigator.userAgent, env);\n}\n\n// Zepto.js\n// (c) 2010-2013 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\nfunction detect(ua: string, env: Env) {\n const browser = env.browser;\n const firefox = ua.match(/Firefox\\/([\\d.]+)/);\n const ie = ua.match(/MSIE\\s([\\d.]+)/)\n // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n const edge = ua.match(/Edge?\\/([\\d.]+)/); // IE 12 and 12+\n\n const weChat = (/micromessenger/i).test(ua);\n\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n browser.newEdge = +edge[1].split('.')[0] > 18;\n }\n\n // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n if (weChat) {\n browser.weChat = true;\n }\n\n env.svgSupported = typeof SVGRect !== 'undefined';\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\n env.pointerEventsSupported = 'onpointerdown' in window\n && (browser.edge || (browser.ie && +browser.version >= 11));\n env.domSupported = typeof document !== 'undefined';\n\n const style = document.documentElement.style;\n\n env.transform3dSupported = (\n // IE9 only supports transform 2D\n // transform 3D supported since IE10\n // we detect it by whether 'transition' is in style\n (browser.ie && 'transition' in style)\n // edge\n || browser.edge\n // webkit\n || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix()))\n // gecko-based browsers\n || 'MozPerspective' in style\n ) // Opera supports CSS transforms after version 12\n && !('OTransition' in style);\n\n // except IE 6-8 and very old firefox 2-3 & opera 10.1\n // other browsers all support `transform`\n env.transformSupported = env.transform3dSupported\n // transform 2D is supported in IE9\n || (browser.ie && +browser.version >= 9);\n\n}\n\n\nexport default env;\n", "/* global: defineProperty */\nimport { Dictionary, ArrayLike, KeyOfDistributive } from './types';\nimport { GradientObject } from '../graphic/Gradient';\nimport { ImagePatternObject } from '../graphic/Pattern';\nimport { platformApi } from './platform';\n\n// \u7528\u4E8E\u5904\u7406merge\u65F6\u65E0\u6CD5\u904D\u5386Date\u7B49\u5BF9\u8C61\u7684\u95EE\u9898\nconst BUILTIN_OBJECT: Record = reduce([\n 'Function',\n 'RegExp',\n 'Date',\n 'Error',\n 'CanvasGradient',\n 'CanvasPattern',\n // For node-canvas\n 'Image',\n 'Canvas'\n], (obj, val) => {\n obj['[object ' + val + ']'] = true;\n return obj;\n}, {} as Record);\n\nconst TYPED_ARRAY: Record = reduce([\n 'Int8',\n 'Uint8',\n 'Uint8Clamped',\n 'Int16',\n 'Uint16',\n 'Int32',\n 'Uint32',\n 'Float32',\n 'Float64'\n], (obj, val) => {\n obj['[object ' + val + 'Array]'] = true;\n return obj;\n}, {} as Record);\n\nconst objToString = Object.prototype.toString;\n\nconst arrayProto = Array.prototype;\nconst nativeForEach = arrayProto.forEach;\nconst nativeFilter = arrayProto.filter;\nconst nativeSlice = arrayProto.slice;\nconst nativeMap = arrayProto.map;\n// In case some env may redefine the global variable `Function`.\nconst ctorFunction = function () {}.constructor;\nconst protoFunction = ctorFunction ? ctorFunction.prototype : null;\nconst protoKey = '__proto__';\n\n\nlet idStart = 0x0907;\n\n/**\n * Generate unique id\n */\nexport function guid(): number {\n return idStart++;\n}\n\nexport function logError(...args: any[]) {\n if (typeof console !== 'undefined') {\n console.error.apply(console, args);\n }\n}\n/**\n * Those data types can be cloned:\n * Plain object, Array, TypedArray, number, string, null, undefined.\n * Those data types will be assigned using the original data:\n * BUILTIN_OBJECT\n * Instance of user defined class will be cloned to a plain object, without\n * properties in prototype.\n * Other data types is not supported (not sure what will happen).\n *\n * Caution: do not support clone Date, for performance consideration.\n * (There might be a large number of date in `series.data`).\n * So date should not be modified in and out of echarts.\n */\nexport function clone(source: T): T {\n if (source == null || typeof source !== 'object') {\n return source;\n }\n\n let result = source as any;\n const typeStr = objToString.call(source);\n\n if (typeStr === '[object Array]') {\n if (!isPrimitive(source)) {\n result = [] as any;\n for (let i = 0, len = (source as any[]).length; i < len; i++) {\n result[i] = clone((source as any[])[i]);\n }\n }\n }\n else if (TYPED_ARRAY[typeStr]) {\n if (!isPrimitive(source)) {\n /* eslint-disable-next-line */\n const Ctor = source.constructor as typeof Float32Array;\n if (Ctor.from) {\n result = Ctor.from(source as Float32Array);\n }\n else {\n result = new Ctor((source as Float32Array).length);\n for (let i = 0, len = (source as Float32Array).length; i < len; i++) {\n result[i] = (source as Float32Array)[i];\n }\n }\n }\n }\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n result = {} as any;\n for (let key in source) {\n // Check if key is __proto__ to avoid prototype pollution\n if (source.hasOwnProperty(key) && key !== protoKey) {\n result[key] = clone(source[key]);\n }\n }\n }\n\n return result;\n}\n\nexport function merge<\n T extends Dictionary,\n S extends Dictionary\n>(target: T, source: S, overwrite?: boolean): T & S;\nexport function merge<\n T extends any,\n S extends any\n>(target: T, source: S, overwrite?: boolean): T | S;\nexport function merge(target: any, source: any, overwrite?: boolean): any {\n // We should escapse that source is string\n // and enter for ... in ...\n if (!isObject(source) || !isObject(target)) {\n return overwrite ? clone(source) : target;\n }\n\n for (let key in source) {\n // Check if key is __proto__ to avoid prototype pollution\n if (source.hasOwnProperty(key) && key !== protoKey) {\n const targetProp = target[key];\n const sourceProp = source[key];\n\n if (isObject(sourceProp)\n && isObject(targetProp)\n && !isArray(sourceProp)\n && !isArray(targetProp)\n && !isDom(sourceProp)\n && !isDom(targetProp)\n && !isBuiltInObject(sourceProp)\n && !isBuiltInObject(targetProp)\n && !isPrimitive(sourceProp)\n && !isPrimitive(targetProp)\n ) {\n // \u5982\u679C\u9700\u8981\u9012\u5F52\u8986\u76D6\uFF0C\u5C31\u9012\u5F52\u8C03\u7528merge\n merge(targetProp, sourceProp, overwrite);\n }\n else if (overwrite || !(key in target)) {\n // \u5426\u5219\u53EA\u5904\u7406overwrite\u4E3Atrue\uFF0C\u6216\u8005\u5728\u76EE\u6807\u5BF9\u8C61\u4E2D\u6CA1\u6709\u6B64\u5C5E\u6027\u7684\u60C5\u51B5\n // NOTE\uFF0C\u5728 target[key] \u4E0D\u5B58\u5728\u7684\u65F6\u5019\u4E5F\u662F\u76F4\u63A5\u8986\u76D6\n target[key] = clone(source[key]);\n }\n }\n }\n\n return target;\n}\n\n/**\n * @param targetAndSources The first item is target, and the rests are source.\n * @param overwrite\n * @return Merged result\n */\nexport function mergeAll(targetAndSources: any[], overwrite?: boolean): any {\n let result = targetAndSources[0];\n for (let i = 1, len = targetAndSources.length; i < len; i++) {\n result = merge(result, targetAndSources[i], overwrite);\n }\n return result;\n}\n\nexport function extend<\n T extends Dictionary,\n S extends Dictionary\n>(target: T, source: S): T & S {\n // @ts-ignore\n if (Object.assign) {\n // @ts-ignore\n Object.assign(target, source);\n }\n else {\n for (let key in source) {\n // Check if key is __proto__ to avoid prototype pollution\n if (source.hasOwnProperty(key) && key !== protoKey) {\n (target as S & T)[key] = (source as T & S)[key];\n }\n }\n }\n return target as T & S;\n}\n\nexport function defaults<\n T extends Dictionary,\n S extends Dictionary\n>(target: T, source: S, overlay?: boolean): T & S {\n const keysArr = keys(source);\n for (let i = 0; i < keysArr.length; i++) {\n let key = keysArr[i];\n if ((overlay ? source[key] != null : (target as T & S)[key] == null)) {\n (target as S & T)[key] = (source as T & S)[key];\n }\n }\n return target as T & S;\n}\n\n// Expose createCanvas in util for compatibility\nexport const createCanvas = platformApi.createCanvas;\n\n/**\n * \u67E5\u8BE2\u6570\u7EC4\u4E2D\u5143\u7D20\u7684index\n */\nexport function indexOf(array: T[] | readonly T[] | ArrayLike, value: T): number {\n if (array) {\n if ((array as T[]).indexOf) {\n return (array as T[]).indexOf(value);\n }\n for (let i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n }\n return -1;\n}\n\n/**\n * \u6784\u9020\u7C7B\u7EE7\u627F\u5173\u7CFB\n *\n * @param clazz \u6E90\u7C7B\n * @param baseClazz \u57FA\u7C7B\n */\nexport function inherits(clazz: Function, baseClazz: Function) {\n const clazzPrototype = clazz.prototype;\n function F() {}\n F.prototype = baseClazz.prototype;\n clazz.prototype = new (F as any)();\n\n for (let prop in clazzPrototype) {\n if (clazzPrototype.hasOwnProperty(prop)) {\n clazz.prototype[prop] = clazzPrototype[prop];\n }\n }\n clazz.prototype.constructor = clazz;\n (clazz as any).superClass = baseClazz;\n}\n\nexport function mixin(target: T | Function, source: S | Function, override?: boolean) {\n target = 'prototype' in target ? target.prototype : target;\n source = 'prototype' in source ? source.prototype : source;\n // If build target is ES6 class. prototype methods is not enumerable. Use getOwnPropertyNames instead\n // TODO: Determine if source is ES6 class?\n if (Object.getOwnPropertyNames) {\n const keyList = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keyList.length; i++) {\n const key = keyList[i];\n if (key !== 'constructor') {\n if ((override ? (source as any)[key] != null : (target as any)[key] == null)) {\n (target as any)[key] = (source as any)[key];\n }\n }\n }\n }\n else {\n defaults(target, source, override);\n }\n}\n\n/**\n * Consider typed array.\n * @param data\n */\nexport function isArrayLike(data: any): data is ArrayLike {\n if (!data) {\n return false;\n }\n if (typeof data === 'string') {\n return false;\n }\n return typeof data.length === 'number';\n}\n\n/**\n * \u6570\u7EC4\u6216\u5BF9\u8C61\u904D\u5386\n */\nexport function each | any[] | readonly any[] | ArrayLike, Context>(\n arr: I,\n cb: (\n this: Context,\n // Use unknown to avoid to infer to \"any\", which may disable typo check.\n value: I extends (infer T)[] | readonly (infer T)[] | ArrayLike ? T\n // Use Dictionary may cause infer fail when I is an interface.\n // So here use a Record to infer type.\n : I extends Dictionary ? I extends Record ? T : unknown : unknown,\n index?: I extends any[] | readonly any[] | ArrayLike ? number : keyof I & string, // keyof Dictionary will return number | string\n arr?: I\n ) => void,\n context?: Context\n) {\n if (!(arr && cb)) {\n return;\n }\n if ((arr as any).forEach && (arr as any).forEach === nativeForEach) {\n (arr as any).forEach(cb, context);\n }\n else if (arr.length === +arr.length) {\n for (let i = 0, len = arr.length; i < len; i++) {\n // FIXME: should the elided item be travelled? like `[33,,55]`.\n cb.call(context, (arr as any[])[i], i as any, arr);\n }\n }\n else {\n for (let key in arr) {\n if (arr.hasOwnProperty(key)) {\n cb.call(context, (arr as Dictionary)[key], key as any, arr);\n }\n }\n }\n}\n\n/**\n * Array mapping.\n * @typeparam T Type in Array\n * @typeparam R Type Returned\n * @return Must be an array.\n */\nexport function map(\n arr: readonly T[],\n cb: (this: Context, val: T, index?: number, arr?: readonly T[]) => R,\n context?: Context\n): R[] {\n // Take the same behavior with lodash when !arr and !cb,\n // which might be some common sense.\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr) as unknown[] as R[];\n }\n if (arr.map && arr.map === nativeMap) {\n return arr.map(cb, context);\n }\n else {\n const result = [];\n for (let i = 0, len = arr.length; i < len; i++) {\n // FIXME: should the elided item be travelled, like `[33,,55]`.\n result.push(cb.call(context, arr[i], i, arr));\n }\n return result;\n }\n}\n\nexport function reduce(\n arr: readonly T[],\n cb: (this: Context, previousValue: S, currentValue: T, currentIndex?: number, arr?: readonly T[]) => S,\n memo?: S,\n context?: Context\n): S {\n if (!(arr && cb)) {\n return;\n }\n for (let i = 0, len = arr.length; i < len; i++) {\n memo = cb.call(context, memo, arr[i], i, arr);\n }\n return memo;\n}\n\n/**\n * Array filtering.\n * @return Must be an array.\n */\nexport function filter(\n arr: readonly T[],\n cb: (this: Context, value: T, index: number, arr: readonly T[]) => boolean,\n context?: Context\n): T[] {\n // Take the same behavior with lodash when !arr and !cb,\n // which might be some common sense.\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.filter && arr.filter === nativeFilter) {\n return arr.filter(cb, context);\n }\n else {\n const result = [];\n for (let i = 0, len = arr.length; i < len; i++) {\n // FIXME: should the elided items be travelled? like `[33,,55]`.\n if (cb.call(context, arr[i], i, arr)) {\n result.push(arr[i]);\n }\n }\n return result;\n }\n}\n\n/**\n * \u6570\u7EC4\u9879\u67E5\u627E\n */\nexport function find(\n arr: readonly T[],\n cb: (this: Context, value: T, index?: number, arr?: readonly T[]) => boolean,\n context?: Context\n): T {\n if (!(arr && cb)) {\n return;\n }\n for (let i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n return arr[i];\n }\n }\n}\n\n/**\n * Get all object keys\n *\n * Will return an empty array if obj is null/undefined\n */\nexport function keys(obj: T): (KeyOfDistributive & string)[] {\n if (!obj) {\n return [];\n }\n // Return type should be `keyof T` but exclude `number`, becuase\n // `Object.keys` only return string rather than `number | string`.\n type TKeys = KeyOfDistributive & string;\n if (Object.keys) {\n return Object.keys(obj) as TKeys[];\n }\n let keyList: TKeys[] = [];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n keyList.push(key as any);\n }\n }\n return keyList;\n}\n\n// Remove this type in returned function. Or it will conflicts wicth callback with given context. Like Eventful.\n// According to lib.es5.d.ts\n/* eslint-disable max-len*/\nexport type Bind1 = F extends (this: Ctx, ...args: infer A) => infer R ? (...args: A) => R : unknown;\nexport type Bind2 = F extends (this: Ctx, a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown;\nexport type Bind3 = F extends (this: Ctx, a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown;\nexport type Bind4 = F extends (this: Ctx, a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown;\nexport type Bind5 = F extends (this: Ctx, a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown;\ntype BindFunc = (this: Ctx, ...arg: any[]) => any\n\ninterface FunctionBind {\n , Ctx>(func: F, ctx: Ctx): Bind1\n , Ctx, T1 extends Parameters[0]>(func: F, ctx: Ctx, a: T1): Bind2\n , Ctx, T1 extends Parameters[0], T2 extends Parameters[1]>(func: F, ctx: Ctx, a: T1, b: T2): Bind3\n , Ctx, T1 extends Parameters[0], T2 extends Parameters[1], T3 extends Parameters[2]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3): Bind4\n , Ctx, T1 extends Parameters[0], T2 extends Parameters[1], T3 extends Parameters[2], T4 extends Parameters[3]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3, d: T4): Bind5\n}\nfunction bindPolyfill any>(\n func: Fn, context: Ctx, ...args: any[]\n): (...args: Parameters) => ReturnType {\n return function (this: Ctx) {\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport const bind: FunctionBind = (protoFunction && isFunction(protoFunction.bind))\n ? protoFunction.call.bind(protoFunction.bind)\n : bindPolyfill;\n\nexport type Curry1 = F extends (a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown;\nexport type Curry2 = F extends (a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown;\nexport type Curry3 = F extends (a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown;\nexport type Curry4 = F extends (a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown;\ntype CurryFunc = (...arg: any[]) => any\n\nfunction curry[0]>(func: F, a: T1): Curry1\nfunction curry[0], T2 extends Parameters[1]>(func: F, a: T1, b: T2): Curry2\nfunction curry[0], T2 extends Parameters[1], T3 extends Parameters[2]>(func: F, a: T1, b: T2, c: T3): Curry3\nfunction curry[0], T2 extends Parameters[1], T3 extends Parameters[2], T4 extends Parameters[3]>(func: F, a: T1, b: T2, c: T3, d: T4): Curry4\nfunction curry(func: Function, ...args: any[]): Function {\n return function (this: any) {\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport {curry};\n/* eslint-enable max-len*/\n\nexport function isArray(value: any): value is any[] {\n if (Array.isArray) {\n return Array.isArray(value);\n }\n return objToString.call(value) === '[object Array]';\n}\n\nexport function isFunction(value: any): value is Function {\n return typeof value === 'function';\n}\n\nexport function isString(value: any): value is string {\n // Faster than `objToString.call` several times in chromium and webkit.\n // And `new String()` is rarely used.\n return typeof value === 'string';\n}\n\nexport function isStringSafe(value: any): value is string {\n return objToString.call(value) === '[object String]';\n}\n\nexport function isNumber(value: any): value is number {\n // Faster than `objToString.call` several times in chromium and webkit.\n // And `new Number()` is rarely used.\n return typeof value === 'number';\n}\n\n// Usage: `isObject(xxx)` or `isObject(SomeType)(xxx)`\n// Generic T can be used to avoid \"ts type gruards\" casting the `value` from its original\n// type `Object` implicitly so that loose its original type info in the subsequent code.\nexport function isObject(value: T): value is (object & T) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n const type = typeof value;\n return type === 'function' || (!!value && type === 'object');\n}\n\nexport function isBuiltInObject(value: any): boolean {\n return !!BUILTIN_OBJECT[objToString.call(value)];\n}\n\nexport function isTypedArray(value: any): boolean {\n return !!TYPED_ARRAY[objToString.call(value)];\n}\n\nexport function isDom(value: any): value is HTMLElement {\n return typeof value === 'object'\n && typeof value.nodeType === 'number'\n && typeof value.ownerDocument === 'object';\n}\n\nexport function isGradientObject(value: any): value is GradientObject {\n return (value as GradientObject).colorStops != null;\n}\n\nexport function isImagePatternObject(value: any): value is ImagePatternObject {\n return (value as ImagePatternObject).image != null;\n}\n\nexport function isRegExp(value: unknown): value is RegExp {\n return objToString.call(value) === '[object RegExp]';\n}\n\n/**\n * Whether is exactly NaN. Notice isNaN('a') returns true.\n */\nexport function eqNaN(value: any): boolean {\n /* eslint-disable-next-line no-self-compare */\n return value !== value;\n}\n\n/**\n * If value1 is not null, then return value1, otherwise judget rest of values.\n * Low performance.\n * @return Final value\n */\nexport function retrieve(...args: T[]): T {\n for (let i = 0, len = args.length; i < len; i++) {\n if (args[i] != null) {\n return args[i];\n }\n }\n}\n\nexport function retrieve2(value0: T, value1: R): T | R {\n return value0 != null\n ? value0\n : value1;\n}\n\nexport function retrieve3(value0: T, value1: R, value2: W): T | R | W {\n return value0 != null\n ? value0\n : value1 != null\n ? value1\n : value2;\n}\n\ntype SliceParams = Parameters;\nexport function slice(arr: ArrayLike, ...args: SliceParams): T[] {\n return nativeSlice.apply(arr, args as any[]);\n}\n\n/**\n * Normalize css liked array configuration\n * e.g.\n * 3 => [3, 3, 3, 3]\n * [4, 2] => [4, 2, 4, 2]\n * [4, 3, 2] => [4, 3, 2, 3]\n */\nexport function normalizeCssArray(val: number | number[]) {\n if (typeof (val) === 'number') {\n return [val, val, val, val];\n }\n const len = val.length;\n if (len === 2) {\n // vertical | horizontal\n return [val[0], val[1], val[0], val[1]];\n }\n else if (len === 3) {\n // top | horizontal | bottom\n return [val[0], val[1], val[2], val[1]];\n }\n return val;\n}\n\nexport function assert(condition: any, message?: string) {\n if (!condition) {\n throw new Error(message);\n }\n}\n\n/**\n * @param str string to be trimmed\n * @return trimmed string\n */\nexport function trim(str: string): string {\n if (str == null) {\n return null;\n }\n else if (typeof str.trim === 'function') {\n return str.trim();\n }\n else {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n}\n\nconst primitiveKey = '__ec_primitive__';\n/**\n * Set an object as primitive to be ignored traversing children in clone or merge\n */\nexport function setAsPrimitive(obj: any) {\n obj[primitiveKey] = true;\n}\n\nexport function isPrimitive(obj: any): boolean {\n return obj[primitiveKey];\n}\n\ninterface MapInterface {\n delete(key: KEY): boolean;\n has(key: KEY): boolean;\n get(key: KEY): T | undefined;\n set(key: KEY, value: T): this;\n keys(): KEY[];\n forEach(callback: (value: T, key: KEY) => void): void;\n}\n\nclass MapPolyfill implements MapInterface {\n private data: Record = {} as Record;\n\n delete(key: KEY): boolean {\n const existed = this.has(key);\n if (existed) {\n delete this.data[key];\n }\n return existed;\n }\n has(key: KEY): boolean {\n return this.data.hasOwnProperty(key);\n }\n get(key: KEY): T | undefined {\n return this.data[key];\n }\n set(key: KEY, value: T): this {\n this.data[key] = value;\n return this;\n }\n keys(): KEY[] {\n return keys(this.data);\n }\n forEach(callback: (value: T, key: KEY) => void): void {\n // This is a potential performance bottleneck, see details in\n // https://github.com/ecomfe/zrender/issues/965, however it is now\n // less likely to occur as we default to native maps when possible.\n const data = this.data;\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n callback(data[key], key);\n }\n }\n }\n}\n\n// We want to use native Map if it is available, but we do not want to polyfill the global scope\n// in case users ship their own polyfills or patch the native map object in any way.\nconst isNativeMapSupported = typeof Map === 'function';\nfunction maybeNativeMap(): MapInterface {\n // Map may be a native class if we are running in an ES6 compatible environment.\n // eslint-disable-next-line\n return (isNativeMapSupported ? new Map() : new MapPolyfill()) as MapInterface;\n}\n\n/**\n * @constructor\n * @param {Object} obj\n */\nexport class HashMap {\n data: MapInterface\n\n constructor(obj?: HashMap | { [key in KEY]?: T } | KEY[]) {\n const isArr = isArray(obj);\n // Key should not be set on this, otherwise\n // methods get/set/... may be overridden.\n this.data = maybeNativeMap();\n const thisMap = this;\n\n (obj instanceof HashMap)\n ? obj.each(visit)\n : (obj && each(obj, visit));\n\n function visit(value: any, key: any) {\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n }\n }\n\n // `hasKey` instead of `has` for potential misleading.\n hasKey(key: KEY): boolean {\n return this.data.has(key);\n }\n get(key: KEY): T {\n return this.data.get(key);\n }\n set(key: KEY, value: T): T {\n // Comparing with invocation chaining, `return value` is more commonly\n // used in this case: `const someVal = map.set('a', genVal());`\n this.data.set(key, value);\n return value;\n }\n // Although util.each can be performed on this hashMap directly, user\n // should not use the exposed keys, who are prefixed.\n each(\n cb: (this: Context, value?: T, key?: KEY) => void,\n context?: Context\n ) {\n this.data.forEach((value, key) => {\n cb.call(context, value, key);\n });\n }\n keys(): KEY[] {\n const keys = this.data.keys();\n return isNativeMapSupported\n // Native map returns an iterator so we need to convert it to an array\n ? Array.from(keys)\n : keys;\n }\n // Do not use this method if performance sensitive.\n removeKey(key: KEY): void {\n this.data.delete(key);\n }\n}\n\nexport function createHashMap(\n obj?: HashMap | { [key in KEY]?: T } | KEY[]\n) {\n return new HashMap(obj);\n}\n\nexport function concatArray(a: ArrayLike, b: ArrayLike): ArrayLike {\n const newArray = new (a as any).constructor(a.length + b.length);\n for (let i = 0; i < a.length; i++) {\n newArray[i] = a[i];\n }\n const offset = a.length;\n for (let i = 0; i < b.length; i++) {\n newArray[i + offset] = b[i];\n }\n return newArray;\n}\n\nexport function createObject(proto?: object, properties?: T): T {\n // Performance of Object.create\n // https://jsperf.com/style-strategy-proto-or-others\n let obj: T;\n if (Object.create) {\n obj = Object.create(proto);\n }\n else {\n const StyleCtor = function () {};\n StyleCtor.prototype = proto;\n obj = new (StyleCtor as any)();\n }\n if (properties) {\n extend(obj, properties);\n }\n\n return obj;\n}\n\n\nexport function disableUserSelect(dom: HTMLElement) {\n const domStyle = dom.style;\n domStyle.webkitUserSelect = 'none';\n domStyle.userSelect = 'none';\n // @ts-ignore\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\n (domStyle as any)['-webkit-touch-callout'] = 'none';\n}\n\nexport function hasOwn(own: object, prop: string): boolean {\n return own.hasOwnProperty(prop);\n}\n\nexport function noop() {}\n\nexport const RADIAN_TO_DEGREE = 180 / Math.PI;", "export const DEFAULT_FONT_SIZE = 12;\nexport const DEFAULT_FONT_FAMILY = 'sans-serif';\nexport const DEFAULT_FONT = `${DEFAULT_FONT_SIZE}px ${DEFAULT_FONT_FAMILY}`;\n\ninterface Platform {\n // TODO CanvasLike?\n createCanvas(): HTMLCanvasElement\n measureText(text: string, font?: string): { width: number }\n loadImage(\n src: string,\n onload: () => void | HTMLImageElement['onload'],\n onerror: () => void | HTMLImageElement['onerror']\n ): HTMLImageElement\n}\n\n// Text width map used for environment there is no canvas\n// Only common ascii is used for size concern.\n\n// Generated from following code\n//\n// ctx.font = '12px sans-serif';\n// const asciiRange = [32, 126];\n// let mapStr = '';\n// for (let i = asciiRange[0]; i <= asciiRange[1]; i++) {\n// const char = String.fromCharCode(i);\n// const width = ctx.measureText(char).width;\n// const ratio = Math.round(width / 12 * 100);\n// mapStr += String.fromCharCode(ratio + 20))\n// }\n// mapStr.replace(/\\\\/g, '\\\\\\\\');\nconst OFFSET = 20;\nconst SCALE = 100;\n// TODO other basic fonts?\n// eslint-disable-next-line\nconst defaultWidthMapStr = `007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\\\\\WQb\\\\0FWLg\\\\bWb\\\\WQ\\\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\\\FFF5.5N`;\n\nfunction getTextWidthMap(mapStr: string): Record {\n const map: Record = {};\n if (typeof JSON === 'undefined') {\n return map;\n }\n for (let i = 0; i < mapStr.length; i++) {\n const char = String.fromCharCode(i + 32);\n const size = (mapStr.charCodeAt(i) - OFFSET) / SCALE;\n map[char] = size;\n }\n return map;\n}\n\nexport const DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr);\n\nexport const platformApi: Platform = {\n // Export methods\n createCanvas() {\n return typeof document !== 'undefined'\n && document.createElement('canvas');\n },\n\n measureText: (function () {\n\n let _ctx: CanvasRenderingContext2D;\n let _cachedFont: string;\n return (text: string, font?: string) => {\n if (!_ctx) {\n const canvas = platformApi.createCanvas();\n _ctx = canvas && canvas.getContext('2d');\n }\n if (_ctx) {\n if (_cachedFont !== font) {\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\n }\n return _ctx.measureText(text);\n }\n else {\n text = text || '';\n font = font || DEFAULT_FONT;\n // Use font size if there is no other method can be used.\n const res = /((?:\\d+)?\\.?\\d*)px/.exec(font);\n const fontSize = res && +res[1] || DEFAULT_FONT_SIZE;\n let width = 0;\n if (font.indexOf('mono') >= 0) { // is monospace\n width = fontSize * text.length;\n }\n else {\n for (let i = 0; i < text.length; i++) {\n const preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]];\n width += preCalcWidth == null ? fontSize : (preCalcWidth * fontSize);\n }\n }\n return { width };\n }\n };\n })(),\n\n loadImage(src, onload, onerror) {\n const image = new Image();\n image.onload = onload;\n image.onerror = onerror;\n image.src = src;\n return image;\n }\n};\n\nexport function setPlatformAPI(newPlatformApis: Partial) {\n for (let key in platformApi) {\n // Don't assign unknown methods.\n if ((newPlatformApis as any)[key]) {\n (platformApi as any)[key] = (newPlatformApis as any)[key];\n }\n }\n}\n", "/**\n * @deprecated\n * Use zrender.Point class instead\n */\nimport { MatrixArray } from './matrix';\n\n/* global Float32Array */\n\n// const ArrayCtor = typeof Float32Array === 'undefined'\n// ? Array\n// : Float32Array;\n\nexport type VectorArray = number[]\n/**\n * \u521B\u5EFA\u4E00\u4E2A\u5411\u91CF\n */\nexport function create(x?: number, y?: number): VectorArray {\n if (x == null) {\n x = 0;\n }\n if (y == null) {\n y = 0;\n }\n return [x, y];\n}\n\n/**\n * \u590D\u5236\u5411\u91CF\u6570\u636E\n */\nexport function copy(out: T, v: VectorArray): T {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\n\n/**\n * \u514B\u9686\u4E00\u4E2A\u5411\u91CF\n */\nexport function clone(v: VectorArray): VectorArray {\n return [v[0], v[1]];\n}\n\n/**\n * \u8BBE\u7F6E\u5411\u91CF\u7684\u4E24\u4E2A\u9879\n */\nexport function set(out: T, a: number, b: number): T {\n out[0] = a;\n out[1] = b;\n return out;\n}\n\n/**\n * \u5411\u91CF\u76F8\u52A0\n */\nexport function add(out: T, v1: VectorArray, v2: VectorArray): T {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\n\n/**\n * \u5411\u91CF\u7F29\u653E\u540E\u76F8\u52A0\n */\nexport function scaleAndAdd(out: T, v1: VectorArray, v2: VectorArray, a: number): T {\n out[0] = v1[0] + v2[0] * a;\n out[1] = v1[1] + v2[1] * a;\n return out;\n}\n\n/**\n * \u5411\u91CF\u76F8\u51CF\n */\nexport function sub(out: T, v1: VectorArray, v2: VectorArray): T {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\n\n/**\n * \u5411\u91CF\u957F\u5EA6\n */\nexport function len(v: VectorArray): number {\n return Math.sqrt(lenSquare(v));\n}\nexport const length = len;\n\n/**\n * \u5411\u91CF\u957F\u5EA6\u5E73\u65B9\n */\nexport function lenSquare(v: VectorArray): number {\n return v[0] * v[0] + v[1] * v[1];\n}\nexport const lengthSquare = lenSquare;\n\n/**\n * \u5411\u91CF\u4E58\u6CD5\n */\nexport function mul(out: T, v1: VectorArray, v2: VectorArray): T {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\n\n/**\n * \u5411\u91CF\u9664\u6CD5\n */\nexport function div(out: T, v1: VectorArray, v2: VectorArray): T {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\n\n/**\n * \u5411\u91CF\u70B9\u4E58\n */\nexport function dot(v1: VectorArray, v2: VectorArray) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\n\n/**\n * \u5411\u91CF\u7F29\u653E\n */\nexport function scale(out: T, v: VectorArray, s: number): T {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\n\n/**\n * \u5411\u91CF\u5F52\u4E00\u5316\n */\nexport function normalize(out: T, v: VectorArray): T {\n const d = len(v);\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n }\n else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n return out;\n}\n\n/**\n * \u8BA1\u7B97\u5411\u91CF\u95F4\u8DDD\u79BB\n */\nexport function distance(v1: VectorArray, v2: VectorArray): number {\n return Math.sqrt(\n (v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1])\n );\n}\nexport const dist = distance;\n\n/**\n * \u5411\u91CF\u8DDD\u79BB\u5E73\u65B9\n */\nexport function distanceSquare(v1: VectorArray, v2: VectorArray): number {\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\nexport const distSquare = distanceSquare;\n\n/**\n * \u6C42\u8D1F\u5411\u91CF\n */\nexport function negate(out: T, v: VectorArray): T {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\n\n/**\n * \u63D2\u503C\u4E24\u4E2A\u70B9\n */\nexport function lerp(out: T, v1: VectorArray, v2: VectorArray, t: number): T {\n out[0] = v1[0] + t * (v2[0] - v1[0]);\n out[1] = v1[1] + t * (v2[1] - v1[1]);\n return out;\n}\n\n/**\n * \u77E9\u9635\u5DE6\u4E58\u5411\u91CF\n */\nexport function applyTransform(out: T, v: VectorArray, m: MatrixArray): T {\n const x = v[0];\n const y = v[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n\n/**\n * \u6C42\u4E24\u4E2A\u5411\u91CF\u6700\u5C0F\u503C\n */\nexport function min(out: T, v1: VectorArray, v2: VectorArray): T {\n out[0] = Math.min(v1[0], v2[0]);\n out[1] = Math.min(v1[1], v2[1]);\n return out;\n}\n\n/**\n * \u6C42\u4E24\u4E2A\u5411\u91CF\u6700\u5927\u503C\n */\nexport function max(out: T, v1: VectorArray, v2: VectorArray): T {\n out[0] = Math.max(v1[0], v2[0]);\n out[1] = Math.max(v1[1], v2[1]);\n return out;\n}\n", "import Handler from '../Handler';\nimport Element, { ElementEvent } from '../Element';\nimport Displayable from '../graphic/Displayable';\n\nclass Param {\n\n target: Element\n topTarget: Element\n\n constructor(target: Element, e?: ElementEvent) {\n this.target = target;\n this.topTarget = e && e.topTarget;\n }\n}\n\n// FIXME Draggable on element which has parent rotation or scale\nexport default class Draggable {\n\n handler: Handler\n\n _draggingTarget: Element\n _dropTarget: Element\n\n _x: number\n _y: number\n\n constructor(handler: Handler) {\n this.handler = handler;\n\n handler.on('mousedown', this._dragStart, this);\n handler.on('mousemove', this._drag, this);\n handler.on('mouseup', this._dragEnd, this);\n // `mosuemove` and `mouseup` can be continue to fire when dragging.\n // See [DRAG_OUTSIDE] in `Handler.js`. So we do not need to trigger\n // `_dragEnd` when globalout. That would brings better user experience.\n // this.on('globalout', this._dragEnd, this);\n\n // this._dropTarget = null;\n // this._draggingTarget = null;\n\n // this._x = 0;\n // this._y = 0;\n }\n\n _dragStart(e: ElementEvent) {\n let draggingTarget = e.target;\n // Find if there is draggable in the ancestor\n while (draggingTarget && !draggingTarget.draggable) {\n draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget;\n }\n if (draggingTarget) {\n this._draggingTarget = draggingTarget;\n draggingTarget.dragging = true;\n this._x = e.offsetX;\n this._y = e.offsetY;\n\n this.handler.dispatchToElement(\n new Param(draggingTarget, e), 'dragstart', e.event\n );\n }\n }\n\n _drag(e: ElementEvent) {\n const draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n\n const x = e.offsetX;\n const y = e.offsetY;\n\n const dx = x - this._x;\n const dy = y - this._y;\n this._x = x;\n this._y = y;\n\n draggingTarget.drift(dx, dy, e);\n this.handler.dispatchToElement(\n new Param(draggingTarget, e), 'drag', e.event\n );\n\n const dropTarget = this.handler.findHover(\n x, y, draggingTarget as Displayable // PENDING\n ).target;\n const lastDropTarget = this._dropTarget;\n this._dropTarget = dropTarget;\n\n if (draggingTarget !== dropTarget) {\n if (lastDropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(\n new Param(lastDropTarget, e), 'dragleave', e.event\n );\n }\n if (dropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(\n new Param(dropTarget, e), 'dragenter', e.event\n );\n }\n }\n }\n }\n\n _dragEnd(e: ElementEvent) {\n const draggingTarget = this._draggingTarget;\n\n if (draggingTarget) {\n draggingTarget.dragging = false;\n }\n\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\n\n if (this._dropTarget) {\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\n }\n\n this._draggingTarget = null;\n this._dropTarget = null;\n }\n\n}", "import { Dictionary, WithThisType } from './types';\n\n// Return true to cancel bubble\nexport type EventCallbackSingleParam = EvtParam extends any\n ? (params: EvtParam) => boolean | void\n : never\n\nexport type EventCallback = EvtParams extends any[]\n ? (...args: EvtParams) => boolean | void\n : never\nexport type EventQuery = string | Object\n\ntype CbThis = unknown extends Ctx ? Impl : Ctx;\n\ntype EventHandler = {\n h: EventCallback\n ctx: CbThis\n query: EventQuery\n\n callAtLast: boolean\n}\n\ntype DefaultEventDefinition = Dictionary>;\n\nexport interface EventProcessor {\n normalizeQuery?: (query: EventQuery) => EventQuery\n filter?: (eventType: keyof EvtDef, query: EventQuery) => boolean\n afterTrigger?: (eventType: keyof EvtDef) => void\n}\n\n/**\n * Event dispatcher.\n *\n * Event can be defined in EvtDef to enable type check. For example:\n * ```ts\n * interface FooEvents {\n * // key: event name, value: the first event param in `trigger` and `callback`.\n * myevent: {\n * aa: string;\n * bb: number;\n * };\n * }\n * class Foo extends Eventful {\n * fn() {\n * // Type check of event name and the first event param is enabled here.\n * this.trigger('myevent', {aa: 'xx', bb: 3});\n * }\n * }\n * let foo = new Foo();\n * // Type check of event name and the first event param is enabled here.\n * foo.on('myevent', (eventParam) => { ... });\n * ```\n *\n * @param eventProcessor The object eventProcessor is the scope when\n * `eventProcessor.xxx` called.\n * @param eventProcessor.normalizeQuery\n * param: {string|Object} Raw query.\n * return: {string|Object} Normalized query.\n * @param eventProcessor.filter Event will be dispatched only\n * if it returns `true`.\n * param: {string} eventType\n * param: {string|Object} query\n * return: {boolean}\n * @param eventProcessor.afterTrigger Called after all handlers called.\n * param: {string} eventType\n */\nexport default class Eventful {\n\n private _$handlers: Dictionary[]>\n\n protected _$eventProcessor: EventProcessor\n\n constructor(eventProcessors?: EventProcessor) {\n if (eventProcessors) {\n this._$eventProcessor = eventProcessors;\n }\n }\n\n on(\n event: EvtNm,\n handler: WithThisType>,\n context?: Ctx\n ): this\n on(\n event: EvtNm,\n query: EventQuery,\n handler: WithThisType>,\n context?: Ctx\n ): this\n /**\n * Bind a handler.\n *\n * @param event The event name.\n * @param Condition used on event filter.\n * @param handler The event handler.\n * @param context\n */\n on(\n event: EvtNm,\n query: EventQuery | WithThisType, CbThis>,\n handler?: WithThisType, CbThis> | Ctx,\n context?: Ctx\n ): this {\n if (!this._$handlers) {\n this._$handlers = {};\n }\n\n const _h = this._$handlers;\n\n if (typeof query === 'function') {\n context = handler as Ctx;\n handler = query as (...args: any) => any;\n query = null;\n }\n\n if (!handler || !event) {\n return this;\n }\n\n const eventProcessor = this._$eventProcessor;\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n\n if (!_h[event as string]) {\n _h[event as string] = [];\n }\n\n for (let i = 0; i < _h[event as string].length; i++) {\n if (_h[event as string][i].h === handler) {\n return this;\n }\n }\n\n const wrap: EventHandler = {\n h: handler as EventCallback,\n query: query,\n ctx: (context || this) as CbThis,\n // FIXME\n // Do not publish this feature util it is proved that it makes sense.\n callAtLast: (handler as any).zrEventfulCallAtLast\n };\n\n const lastIndex = _h[event as string].length - 1;\n const lastWrap = _h[event as string][lastIndex];\n (lastWrap && lastWrap.callAtLast)\n ? _h[event as string].splice(lastIndex, 0, wrap)\n : _h[event as string].push(wrap);\n\n return this;\n }\n\n /**\n * Whether any handler has bound.\n */\n isSilent(eventName: keyof EvtDef): boolean {\n const _h = this._$handlers;\n return !_h || !_h[eventName as string] || !_h[eventName as string].length;\n }\n\n /**\n * Unbind a event.\n *\n * @param eventType The event name.\n * If no `event` input, \"off\" all listeners.\n * @param handler The event handler.\n * If no `handler` input, \"off\" all listeners of the `event`.\n */\n off(eventType?: keyof EvtDef, handler?: Function): this {\n const _h = this._$handlers;\n\n if (!_h) {\n return this;\n }\n\n if (!eventType) {\n this._$handlers = {};\n return this;\n }\n\n if (handler) {\n if (_h[eventType as string]) {\n const newList = [];\n for (let i = 0, l = _h[eventType as string].length; i < l; i++) {\n if (_h[eventType as string][i].h !== handler) {\n newList.push(_h[eventType as string][i]);\n }\n }\n _h[eventType as string] = newList;\n }\n\n if (_h[eventType as string] && _h[eventType as string].length === 0) {\n delete _h[eventType as string];\n }\n }\n else {\n delete _h[eventType as string];\n }\n\n return this;\n }\n\n /**\n * Dispatch a event.\n *\n * @param {string} eventType The event name.\n */\n trigger(\n eventType: EvtNm,\n ...args: Parameters\n ): this {\n if (!this._$handlers) {\n return this;\n }\n\n const _h = this._$handlers[eventType as string];\n const eventProcessor = this._$eventProcessor;\n\n if (_h) {\n const argLen = args.length;\n\n const len = _h.length;\n for (let i = 0; i < len; i++) {\n const hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(eventType, hItem.query)\n ) {\n continue;\n }\n\n // Optimize advise from backbone\n switch (argLen) {\n case 0:\n hItem.h.call(hItem.ctx);\n break;\n case 1:\n hItem.h.call(hItem.ctx, args[0]);\n break;\n case 2:\n hItem.h.call(hItem.ctx, args[0], args[1]);\n break;\n default:\n // have more than 2 given arguments\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(eventType);\n\n return this;\n }\n\n /**\n * Dispatch a event with context, which is specified at the last parameter.\n *\n * @param {string} type The event name.\n */\n triggerWithContext(type: keyof EvtDef, ...args: any[]): this {\n if (!this._$handlers) {\n return this;\n }\n\n const _h = this._$handlers[type as string];\n const eventProcessor = this._$eventProcessor;\n\n if (_h) {\n const argLen = args.length;\n const ctx = args[argLen - 1];\n\n const len = _h.length;\n for (let i = 0; i < len; i++) {\n const hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(type, hItem.query)\n ) {\n continue;\n }\n\n // Optimize advise from backbone\n switch (argLen) {\n case 0:\n hItem.h.call(ctx);\n break;\n case 1:\n hItem.h.call(ctx, args[0]);\n break;\n case 2:\n hItem.h.call(ctx, args[0], args[1]);\n break;\n default:\n // have more than 2 given arguments\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\n break;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(type);\n\n return this;\n }\n\n}\n", "/**\n * The algoritm is learnt from\n * https://franklinta.com/2014/09/08/computing-css-matrix3d-transforms/\n * And we made some optimization for matrix inversion.\n * Other similar approaches:\n * \"cv::getPerspectiveTransform\", \"Direct Linear Transformation\".\n */\n\nconst LN2 = Math.log(2);\n\nfunction determinant(\n rows: number[][],\n rank: number,\n rowStart: number,\n rowMask: number,\n colMask: number,\n detCache: {[key: string]: number}\n) {\n const cacheKey = rowMask + '-' + colMask;\n const fullRank = rows.length;\n\n if (detCache.hasOwnProperty(cacheKey)) {\n return detCache[cacheKey];\n }\n\n if (rank === 1) {\n // In this case the colMask must be like: `11101111`. We can find the place of `0`.\n const colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\n return rows[rowStart][colStart];\n }\n\n const subRowMask = rowMask | (1 << rowStart);\n let subRowStart = rowStart + 1;\n while (rowMask & (1 << subRowStart)) {\n subRowStart++;\n }\n\n let sum = 0;\n for (let j = 0, colLocalIdx = 0; j < fullRank; j++) {\n const colTag = 1 << j;\n if (!(colTag & colMask)) {\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\n // det(subMatrix(0, j))\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\n colLocalIdx++;\n }\n }\n\n detCache[cacheKey] = sum;\n\n return sum;\n}\n\n/**\n * Usage:\n * ```js\n * const transformer = buildTransformer(\n * [10, 44, 100, 44, 100, 300, 10, 300],\n * [50, 54, 130, 14, 140, 330, 14, 220]\n * );\n * const out = [];\n * transformer && transformer([11, 33], out);\n * ```\n *\n * Notice: `buildTransformer` may take more than 10ms in some Android device.\n *\n * @param src source four points, [x0, y0, x1, y1, x2, y2, x3, y3]\n * @param dest destination four points, [x0, y0, x1, y1, x2, y2, x3, y3]\n * @return transformer If fail, return null/undefined.\n */\nexport function buildTransformer(src: number[], dest: number[]) {\n const mA = [\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\n ];\n\n const detCache = {};\n const det = determinant(mA, 8, 0, 0, 0, detCache);\n if (det === 0) {\n // can not make transformer when and only when\n // any three of the markers are collinear.\n return;\n }\n\n // `invert(mA) * dest`, that is, `adj(mA) / det * dest`.\n const vh: number[] = [];\n for (let i = 0; i < 8; i++) {\n for (let j = 0; j < 8; j++) {\n vh[j] == null && (vh[j] = 0);\n vh[j] += ((i + j) % 2 ? -1 : 1)\n // det(subMatrix(i, j))\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\n / det * dest[i];\n }\n }\n\n return function (out: number[], srcPointX: number, srcPointY: number) {\n const pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\n };\n}\n", "\nimport env from './env';\nimport {buildTransformer} from './fourPointsTransform';\nimport {Dictionary} from './types';\n\nconst EVENT_SAVED_PROP = '___zrEVENTSAVED';\nconst _calcOut: number[] = [];\n\ntype SavedInfo = {\n markers?: HTMLDivElement[]\n trans?: ReturnType\n invTrans?: ReturnType\n srcCoords?: number[]\n}\n\n/**\n * Transform \"local coord\" from `elFrom` to `elTarget`.\n * \"local coord\": the coord based on the input `el`. The origin point is at\n * the position of \"left: 0; top: 0;\" in the `el`.\n *\n * Support when CSS transform is used.\n *\n * Having the `out` (that is, `[outX, outY]`), we can create an DOM element\n * and set the CSS style as \"left: outX; top: outY;\" and append it to `elTarge`\n * to locate the element.\n *\n * For example, this code below positions a child of `document.body` on the event\n * point, no matter whether `body` has `margin`/`paddin`/`transfrom`/... :\n * ```js\n * transformLocalCoord(out, container, document.body, event.offsetX, event.offsetY);\n * if (!eqNaN(out[0])) {\n * // Then locate the tip element on the event point.\n * var tipEl = document.createElement('div');\n * tipEl.style.cssText = 'position: absolute; left:' + out[0] + ';top:' + out[1] + ';';\n * document.body.appendChild(tipEl);\n * }\n * ```\n *\n * Notice: In some env this method is not supported. If called, `out` will be `[NaN, NaN]`.\n *\n * @param {Array.} out [inX: number, inY: number] The output..\n * If can not transform, `out` will not be modified but return `false`.\n * @param {HTMLElement} elFrom The `[inX, inY]` is based on elFrom.\n * @param {HTMLElement} elTarget The `out` is based on elTarget.\n * @param {number} inX\n * @param {number} inY\n * @return {boolean} Whether transform successfully.\n */\nexport function transformLocalCoord(\n out: number[],\n elFrom: HTMLElement,\n elTarget: HTMLElement,\n inX: number,\n inY: number\n) {\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\n}\n\n/**\n * Transform between a \"viewport coord\" and a \"local coord\".\n * \"viewport coord\": the coord based on the left-top corner of the viewport\n * of the browser.\n * \"local coord\": the coord based on the input `el`. The origin point is at\n * the position of \"left: 0; top: 0;\" in the `el`.\n *\n * Support the case when CSS transform is used on el.\n *\n * @param out [inX: number, inY: number] The output. If `inverse: false`,\n * it represents \"local coord\", otherwise \"vireport coord\".\n * If can not transform, `out` will not be modified but return `false`.\n * @param el The \"local coord\" is based on the `el`, see comment above.\n * @param inX If `inverse: false`,\n * it represents \"vireport coord\", otherwise \"local coord\".\n * @param inY If `inverse: false`,\n * it represents \"vireport coord\", otherwise \"local coord\".\n * @param inverse\n * `true`: from \"viewport coord\" to \"local coord\".\n * `false`: from \"local coord\" to \"viewport coord\".\n * @return {boolean} Whether transform successfully.\n */\nexport function transformCoordWithViewport(\n out: number[],\n el: HTMLElement,\n inX: number,\n inY: number,\n inverse?: boolean\n) {\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\n const saved = (el as any)[EVENT_SAVED_PROP] || ((el as any)[EVENT_SAVED_PROP] = {});\n const markers = prepareCoordMarkers(el, saved);\n const transformer = preparePointerTransformer(markers, saved, inverse);\n if (transformer) {\n transformer(out, inX, inY);\n return true;\n }\n }\n return false;\n}\n\nfunction prepareCoordMarkers(el: HTMLElement, saved: SavedInfo) {\n let markers = saved.markers;\n if (markers) {\n return markers;\n }\n\n markers = saved.markers = [];\n const propLR = ['left', 'right'];\n const propTB = ['top', 'bottom'];\n\n for (let i = 0; i < 4; i++) {\n const marker = document.createElement('div');\n const stl = marker.style;\n const idxLR = i % 2;\n const idxTB = (i >> 1) % 2;\n stl.cssText = [\n 'position: absolute',\n 'visibility: hidden',\n 'padding: 0',\n 'margin: 0',\n 'border-width: 0',\n 'user-select: none',\n 'width:0',\n 'height:0',\n // 'width: 5px',\n // 'height: 5px',\n propLR[idxLR] + ':0',\n propTB[idxTB] + ':0',\n propLR[1 - idxLR] + ':auto',\n propTB[1 - idxTB] + ':auto',\n ''\n ].join('!important;');\n el.appendChild(marker);\n markers.push(marker);\n }\n\n return markers;\n}\n\nfunction preparePointerTransformer(markers: HTMLDivElement[], saved: SavedInfo, inverse?: boolean) {\n const transformerName: 'invTrans' | 'trans' = inverse ? 'invTrans' : 'trans';\n const transformer = saved[transformerName];\n const oldSrcCoords = saved.srcCoords;\n const srcCoords = [];\n const destCoords = [];\n let oldCoordTheSame = true;\n\n for (let i = 0; i < 4; i++) {\n const rect = markers[i].getBoundingClientRect();\n const ii = 2 * i;\n const x = rect.left;\n const y = rect.top;\n srcCoords.push(x, y);\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\n }\n // Cache to avoid time consuming of `buildTransformer`.\n return (oldCoordTheSame && transformer)\n ? transformer\n : (\n saved.srcCoords = srcCoords,\n saved[transformerName] = inverse\n ? buildTransformer(destCoords, srcCoords)\n : buildTransformer(srcCoords, destCoords)\n );\n}\n\nexport function isCanvasEl(el: HTMLElement): el is HTMLCanvasElement {\n return el.nodeName.toUpperCase() === 'CANVAS';\n}\n\nconst replaceReg = /([&<>\"'])/g;\nconst replaceMap: Dictionary = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\n\nexport function encodeHTML(source: string): string {\n return source == null\n ? ''\n : (source + '').replace(replaceReg, function (str, c) {\n return replaceMap[c];\n });\n}\n", "/**\n * Utilities for mouse or touch events.\n */\n\nimport Eventful from './Eventful';\nimport env from './env';\nimport { ZRRawEvent } from './types';\nimport {isCanvasEl, transformCoordWithViewport} from './dom';\n\nconst MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\nconst _calcOut: number[] = [];\nconst firefoxNotSupportOffsetXY = env.browser.firefox\n // use offsetX/offsetY for Firefox >= 39\n // PENDING: consider Firefox for Android and Firefox OS? >= 43\n && +(env.browser.version as string).split('.')[0] < 39;\n\ntype FirefoxMouseEvent = {\n layerX: number\n layerY: number\n}\n\n\n/**\n * Get the `zrX` and `zrY`, which are relative to the top-left of\n * the input `el`.\n * CSS transform (2D & 3D) is supported.\n *\n * The strategy to fetch the coords:\n * + If `calculate` is not set as `true`, users of this method should\n * ensure that `el` is the same or the same size & location as `e.target`.\n * Otherwise the result coords are probably not expected. Because we\n * firstly try to get coords from e.offsetX/e.offsetY.\n * + If `calculate` is set as `true`, the input `el` can be any element\n * and we force to calculate the coords based on `el`.\n * + The input `el` should be positionable (not position:static).\n *\n * The force `calculate` can be used in case like:\n * When mousemove event triggered on ec tooltip, `e.target` is not `el`(zr painter.dom).\n *\n * @param el DOM element.\n * @param e Mouse event or touch event.\n * @param out Get `out.zrX` and `out.zrY` as the result.\n * @param calculate Whether to force calculate\n * the coordinates but not use ones provided by browser.\n */\nexport function clientToLocal(\n el: HTMLElement,\n e: ZRRawEvent | FirefoxMouseEvent | Touch,\n out: {zrX?: number, zrY?: number},\n calculate?: boolean\n) {\n out = out || {};\n\n // According to the W3C Working Draft, offsetX and offsetY should be relative\n // to the padding edge of the target element. The only browser using this convention\n // is IE. Webkit uses the border edge, Opera uses the content edge, and FireFox does\n // not support the properties.\n // (see http://www.jacklmoore.com/notes/mouse-position/)\n // In zr painter.dom, padding edge equals to border edge.\n if (calculate) {\n calculateZrXY(el, e as ZRRawEvent, out);\n }\n // Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned\n // ancestor element, so we should make sure el is positioned (e.g., not position:static).\n // BTW1, Webkit don't return the same results as FF in non-simple cases (like add\n // zoom-factor, overflow / opacity layers, transforms ...)\n // BTW2, (ev.offsetY || ev.pageY - $(ev.target).offset().top) is not correct in preserve-3d.\n // \n // BTW3, In ff, offsetX/offsetY is always 0.\n else if (firefoxNotSupportOffsetXY\n && (e as FirefoxMouseEvent).layerX != null\n && (e as FirefoxMouseEvent).layerX !== (e as MouseEvent).offsetX\n ) {\n out.zrX = (e as FirefoxMouseEvent).layerX;\n out.zrY = (e as FirefoxMouseEvent).layerY;\n }\n // For IE6+, chrome, safari, opera, firefox >= 39\n else if ((e as MouseEvent).offsetX != null) {\n out.zrX = (e as MouseEvent).offsetX;\n out.zrY = (e as MouseEvent).offsetY;\n }\n // For some other device, e.g., IOS safari.\n else {\n calculateZrXY(el, e as ZRRawEvent, out);\n }\n\n return out;\n}\n\nfunction calculateZrXY(\n el: HTMLElement,\n e: ZRRawEvent,\n out: {zrX?: number, zrY?: number}\n) {\n // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect.\n if (env.domSupported && el.getBoundingClientRect) {\n const ex = (e as MouseEvent).clientX;\n const ey = (e as MouseEvent).clientY;\n\n if (isCanvasEl(el)) {\n // Original approach, which do not support CSS transform.\n // marker can not be locationed in a canvas container\n // (getBoundingClientRect is always 0). We do not support\n // that input a pre-created canvas to zr while using css\n // transform in iOS.\n const box = el.getBoundingClientRect();\n out.zrX = ex - box.left;\n out.zrY = ey - box.top;\n return;\n }\n else {\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\n out.zrX = _calcOut[0];\n out.zrY = _calcOut[1];\n return;\n }\n }\n }\n out.zrX = out.zrY = 0;\n}\n\n/**\n * Find native event compat for legency IE.\n * Should be called at the begining of a native event listener.\n *\n * @param e Mouse event or touch event or pointer event.\n * For lagency IE, we use `window.event` is used.\n * @return The native event.\n */\nexport function getNativeEvent(e: ZRRawEvent): ZRRawEvent {\n return e\n || (window.event as any); // For IE\n}\n\n/**\n * Normalize the coordinates of the input event.\n *\n * Get the `e.zrX` and `e.zrY`, which are relative to the top-left of\n * the input `el`.\n * Get `e.zrDelta` if using mouse wheel.\n * Get `e.which`, see the comment inside this function.\n *\n * Do not calculate repeatly if `zrX` and `zrY` already exist.\n *\n * Notice: see comments in `clientToLocal`. check the relationship\n * between the result coords and the parameters `el` and `calculate`.\n *\n * @param el DOM element.\n * @param e See `getNativeEvent`.\n * @param calculate Whether to force calculate\n * the coordinates but not use ones provided by browser.\n * @return The normalized native UIEvent.\n */\nexport function normalizeEvent(\n el: HTMLElement,\n e: ZRRawEvent,\n calculate?: boolean\n) {\n\n e = getNativeEvent(e);\n\n if (e.zrX != null) {\n return e;\n }\n\n const eventType = e.type;\n const isTouch = eventType && eventType.indexOf('touch') >= 0;\n\n if (!isTouch) {\n clientToLocal(el, e, e, calculate);\n const wheelDelta = getWheelDeltaMayPolyfill(e);\n // FIXME: IE8- has \"wheelDeta\" in event \"mousewheel\" but hat different value (120 times)\n // with Chrome and Safari. It's not correct for zrender event but we left it as it was.\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\n }\n else {\n const touch = eventType !== 'touchend'\n ? (e).targetTouches[0]\n : (e).changedTouches[0];\n touch && clientToLocal(el, touch, e, calculate);\n }\n\n // Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0;\n // See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js\n // If e.which has been defined, it may be readonly,\n // see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which\n const button = (e).button;\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\n (e as any).which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\n }\n // [Caution]: `e.which` from browser is not always reliable. For example,\n // when press left button and `mousemove (pointermove)` in Edge, the `e.which`\n // is 65536 and the `e.button` is -1. But the `mouseup (pointerup)` and\n // `mousedown (pointerdown)` is the same as Chrome does.\n\n return e;\n}\n\n// TODO: also provide prop \"deltaX\" \"deltaY\" in zrender \"mousewheel\" event.\nfunction getWheelDeltaMayPolyfill(e: ZRRawEvent): number {\n // Although event \"wheel\" do not has the prop \"wheelDelta\" in spec,\n // agent like Chrome and Safari still provide \"wheelDelta\" like\n // event \"mousewheel\" did (perhaps for backward compat).\n // Since zrender has been using \"wheelDeta\" in zrender event \"mousewheel\".\n // we currently do not break it.\n // But event \"wheel\" in firefox do not has \"wheelDelta\", so we calculate\n // \"wheelDeta\" from \"deltaX\", \"deltaY\" (which is the props in spec).\n const rawWheelDelta = (e as any).wheelDelta;\n // Theroetically `e.wheelDelta` won't be 0 unless some day it has been deprecated\n // by agent like Chrome or Safari. So we also calculate it if rawWheelDelta is 0.\n if (rawWheelDelta) {\n return rawWheelDelta;\n }\n\n const deltaX = (e as any).deltaX;\n const deltaY = (e as any).deltaY;\n if (deltaX == null || deltaY == null) {\n return rawWheelDelta;\n }\n\n // Test in Chrome and Safari (MacOS):\n // The sign is corrent.\n // The abs value is 99% corrent (inconsist case only like 62~63, 125~126 ...)\n const delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\n const sign = deltaY > 0 ? -1\n : deltaY < 0 ? 1\n : deltaX > 0 ? -1\n : 1;\n return 3 * delta * sign;\n}\n\n\ntype AddEventListenerParams = Parameters\ntype RemoveEventListenerParams = Parameters\n/**\n * @param el\n * @param name\n * @param handler\n * @param opt If boolean, means `opt.capture`\n * @param opt.capture\n * @param opt.passive\n */\nexport function addEventListener(\n el: HTMLElement | HTMLDocument,\n name: AddEventListenerParams[0],\n handler: AddEventListenerParams[1],\n opt?: AddEventListenerParams[2]\n) {\n // Reproduct the console warning:\n // [Violation] Added non-passive event listener to a scroll-blocking event.\n // Consider marking event handler as 'passive' to make the page more responsive.\n // Just set console log level: verbose in chrome dev tool.\n // then the warning log will be printed when addEventListener called.\n // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n // We have not yet found a neat way to using passive. Because in zrender the dom event\n // listener delegate all of the upper events of element. Some of those events need\n // to prevent default. For example, the feature `preventDefaultMouseMove` of echarts.\n // Before passive can be adopted, these issues should be considered:\n // (1) Whether and how a zrender user specifies an event listener passive. And by default,\n // passive or not.\n // (2) How to tread that some zrender event listener is passive, and some is not. If\n // we use other way but not preventDefault of mousewheel and touchmove, browser\n // compatibility should be handled.\n\n // const opts = (env.passiveSupported && name === 'mousewheel')\n // ? {passive: true}\n // // By default, the third param of el.addEventListener is `capture: false`.\n // : void 0;\n // el.addEventListener(name, handler /* , opts */);\n el.addEventListener(name, handler, opt);\n}\n\n/**\n * Parameter are the same as `addEventListener`.\n *\n * Notice that if a listener is registered twice, one with capture and one without,\n * remove each one separately. Removal of a capturing listener does not affect a\n * non-capturing version of the same listener, and vice versa.\n */\nexport function removeEventListener(\n el: HTMLElement | HTMLDocument,\n name: RemoveEventListenerParams[0],\n handler: RemoveEventListenerParams[1],\n opt: RemoveEventListenerParams[2]\n) {\n el.removeEventListener(name, handler, opt);\n}\n\n/**\n * preventDefault and stopPropagation.\n * Notice: do not use this method in zrender. It can only be\n * used by upper applications if necessary.\n *\n * @param {Event} e A mouse or touch event.\n */\nexport const stop = function (e: MouseEvent | TouchEvent | PointerEvent) {\n e.preventDefault();\n e.stopPropagation();\n e.cancelBubble = true;\n};\n\n/**\n * This method only works for mouseup and mousedown. The functionality is restricted\n * for fault tolerance, See the `e.which` compatibility above.\n *\n * params can be MouseEvent or ElementEvent\n */\nexport function isMiddleOrRightButtonOnMouseUpDown(e: { which: number }) {\n return e.which === 2 || e.which === 3;\n}\n\n// For backward compatibility\nexport {Eventful as Dispatcher};\n", "/**\n * Only implements needed gestures for mobile.\n */\n\nimport * as eventUtil from './event';\nimport { ZRRawTouchEvent, ZRPinchEvent, Dictionary } from './types';\nimport Displayable from '../graphic/Displayable';\n\ninterface TrackItem {\n points: number[][]\n touches: Touch[]\n target: Displayable,\n event: ZRRawTouchEvent\n}\n\nexport class GestureMgr {\n\n private _track: TrackItem[] = []\n\n constructor() {}\n\n recognize(event: ZRRawTouchEvent, target: Displayable, root: HTMLElement) {\n this._doTrack(event, target, root);\n return this._recognize(event);\n }\n\n clear() {\n this._track.length = 0;\n return this;\n }\n\n _doTrack(event: ZRRawTouchEvent, target: Displayable, root: HTMLElement) {\n const touches = event.touches;\n\n if (!touches) {\n return;\n }\n\n const trackItem: TrackItem = {\n points: [],\n touches: [],\n target: target,\n event: event\n };\n\n for (let i = 0, len = touches.length; i < len; i++) {\n const touch = touches[i];\n const pos = eventUtil.clientToLocal(root, touch, {});\n trackItem.points.push([pos.zrX, pos.zrY]);\n trackItem.touches.push(touch);\n }\n\n this._track.push(trackItem);\n }\n\n _recognize(event: ZRRawTouchEvent) {\n for (let eventName in recognizers) {\n if (recognizers.hasOwnProperty(eventName)) {\n const gestureInfo = recognizers[eventName](this._track, event);\n if (gestureInfo) {\n return gestureInfo;\n }\n }\n }\n }\n}\n\nfunction dist(pointPair: number[][]): number {\n const dx = pointPair[1][0] - pointPair[0][0];\n const dy = pointPair[1][1] - pointPair[0][1];\n\n return Math.sqrt(dx * dx + dy * dy);\n}\n\nfunction center(pointPair: number[][]): number[] {\n return [\n (pointPair[0][0] + pointPair[1][0]) / 2,\n (pointPair[0][1] + pointPair[1][1]) / 2\n ];\n}\n\ntype Recognizer = (tracks: TrackItem[], event: ZRRawTouchEvent) => {\n type: string\n target: Displayable\n event: ZRRawTouchEvent\n}\n\nconst recognizers: Dictionary = {\n\n pinch: function (tracks: TrackItem[], event: ZRRawTouchEvent) {\n const trackLen = tracks.length;\n\n if (!trackLen) {\n return;\n }\n\n const pinchEnd = (tracks[trackLen - 1] || {}).points;\n const pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\n\n if (pinchPre\n && pinchPre.length > 1\n && pinchEnd\n && pinchEnd.length > 1\n ) {\n let pinchScale = dist(pinchEnd) / dist(pinchPre);\n !isFinite(pinchScale) && (pinchScale = 1);\n\n (event as ZRPinchEvent).pinchScale = pinchScale;\n\n const pinchCenter = center(pinchEnd);\n (event as ZRPinchEvent).pinchX = pinchCenter[0];\n (event as ZRPinchEvent).pinchY = pinchCenter[1];\n\n return {\n type: 'pinch',\n target: tracks[0].target,\n event: event\n };\n }\n }\n\n // Only pinch currently.\n};", "/**\n * 3x2\u77E9\u9635\u64CD\u4F5C\u7C7B\n * @exports zrender/tool/matrix\n */\n\n/* global Float32Array */\n\nimport {VectorArray} from './vector';\n\nexport type MatrixArray = number[]\n/**\n * Create a identity matrix.\n */\nexport function create(): MatrixArray {\n return [1, 0, 0, 1, 0, 0];\n}\n\n/**\n * \u8BBE\u7F6E\u77E9\u9635\u4E3A\u5355\u4F4D\u77E9\u9635\n */\nexport function identity(out: MatrixArray): MatrixArray {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * \u590D\u5236\u77E9\u9635\n */\nexport function copy(out: MatrixArray, m: MatrixArray): MatrixArray {\n out[0] = m[0];\n out[1] = m[1];\n out[2] = m[2];\n out[3] = m[3];\n out[4] = m[4];\n out[5] = m[5];\n return out;\n}\n\n/**\n * \u77E9\u9635\u76F8\u4E58\n */\nexport function mul(out: MatrixArray, m1: MatrixArray, m2: MatrixArray): MatrixArray {\n // Consider matrix.mul(m, m2, m);\n // where out is the same as m2.\n // So use temp constiable to escape error.\n const out0 = m1[0] * m2[0] + m1[2] * m2[1];\n const out1 = m1[1] * m2[0] + m1[3] * m2[1];\n const out2 = m1[0] * m2[2] + m1[2] * m2[3];\n const out3 = m1[1] * m2[2] + m1[3] * m2[3];\n const out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\n const out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = out3;\n out[4] = out4;\n out[5] = out5;\n return out;\n}\n\n/**\n * \u5E73\u79FB\u53D8\u6362\n */\nexport function translate(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4] + v[0];\n out[5] = a[5] + v[1];\n return out;\n}\n\n/**\n * \u65CB\u8F6C\u53D8\u6362\n */\nexport function rotate(\n out: MatrixArray,\n a: MatrixArray,\n rad: number,\n pivot: VectorArray = [0, 0]\n): MatrixArray {\n const aa = a[0];\n const ac = a[2];\n const atx = a[4];\n const ab = a[1];\n const ad = a[3];\n const aty = a[5];\n const st = Math.sin(rad);\n const ct = Math.cos(rad);\n\n out[0] = aa * ct + ab * st;\n out[1] = -aa * st + ab * ct;\n out[2] = ac * ct + ad * st;\n out[3] = -ac * st + ct * ad;\n out[4] = ct * (atx - pivot[0]) + st * (aty - pivot[1]) + pivot[0];\n out[5] = ct * (aty - pivot[1]) - st * (atx - pivot[0]) + pivot[1];\n return out;\n}\n\n/**\n * \u7F29\u653E\u53D8\u6362\n */\nexport function scale(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray {\n const vx = v[0];\n const vy = v[1];\n out[0] = a[0] * vx;\n out[1] = a[1] * vy;\n out[2] = a[2] * vx;\n out[3] = a[3] * vy;\n out[4] = a[4] * vx;\n out[5] = a[5] * vy;\n return out;\n}\n\n/**\n * \u6C42\u9006\u77E9\u9635\n */\nexport function invert(out: MatrixArray, a: MatrixArray): MatrixArray | null {\n\n const aa = a[0];\n const ac = a[2];\n const atx = a[4];\n const ab = a[1];\n const ad = a[3];\n const aty = a[5];\n\n let det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n\n/**\n * Clone a new matrix.\n */\nexport function clone(a: MatrixArray): MatrixArray {\n const b = create();\n copy(b, a);\n return b;\n}\n", "import { MatrixArray } from './matrix';\n\nexport interface PointLike {\n x: number\n y: number\n}\nexport default class Point {\n\n x: number\n\n y: number\n\n constructor(x?: number, y?: number) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n /**\n * Copy from another point\n */\n copy(other: PointLike) {\n this.x = other.x;\n this.y = other.y;\n return this;\n }\n\n /**\n * Clone a point\n */\n clone() {\n return new Point(this.x, this.y);\n }\n\n /**\n * Set x and y\n */\n set(x: number, y: number) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n /**\n * If equal to another point\n */\n equal(other: PointLike) {\n return other.x === this.x && other.y === this.y;\n }\n\n /**\n * Add another point\n */\n add(other: PointLike) {\n this.x += other.x;\n this.y += other.y;\n return this;\n }\n\n scale(scalar: number) {\n this.x *= scalar;\n this.y *= scalar;\n }\n\n scaleAndAdd(other: PointLike, scalar: number) {\n this.x += other.x * scalar;\n this.y += other.y * scalar;\n }\n\n /**\n * Sub another point\n */\n sub(other: PointLike) {\n this.x -= other.x;\n this.y -= other.y;\n return this;\n }\n\n /**\n * Dot product with other point\n */\n dot(other: PointLike) {\n return this.x * other.x + this.y * other.y;\n }\n\n /**\n * Get length of point\n */\n len() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n /**\n * Get squared length\n */\n lenSquare() {\n return this.x * this.x + this.y * this.y;\n }\n\n /**\n * Normalize\n */\n normalize() {\n const len = this.len();\n this.x /= len;\n this.y /= len;\n return this;\n }\n\n /**\n * Distance to another point\n */\n distance(other: PointLike) {\n const dx = this.x - other.x;\n const dy = this.y - other.y;\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n /**\n * Square distance to another point\n */\n distanceSquare(other: Point) {\n const dx = this.x - other.x;\n const dy = this.y - other.y;\n return dx * dx + dy * dy;\n }\n\n /**\n * Negate\n */\n negate() {\n this.x = -this.x;\n this.y = -this.y;\n return this;\n }\n\n /**\n * Apply a transform matrix array.\n */\n transform(m: MatrixArray) {\n if (!m) {\n return;\n }\n const x = this.x;\n const y = this.y;\n this.x = m[0] * x + m[2] * y + m[4];\n this.y = m[1] * x + m[3] * y + m[5];\n return this;\n }\n\n toArray(out: number[]) {\n out[0] = this.x;\n out[1] = this.y;\n return out;\n }\n\n fromArray(input: number[]) {\n this.x = input[0];\n this.y = input[1];\n }\n\n static set(p: PointLike, x: number, y: number) {\n p.x = x;\n p.y = y;\n }\n\n static copy(p: PointLike, p2: PointLike) {\n p.x = p2.x;\n p.y = p2.y;\n }\n\n static len(p: PointLike) {\n return Math.sqrt(p.x * p.x + p.y * p.y);\n }\n\n static lenSquare(p: PointLike) {\n return p.x * p.x + p.y * p.y;\n }\n\n static dot(p0: PointLike, p1: PointLike) {\n return p0.x * p1.x + p0.y * p1.y;\n }\n\n static add(out: PointLike, p0: PointLike, p1: PointLike) {\n out.x = p0.x + p1.x;\n out.y = p0.y + p1.y;\n }\n\n static sub(out: PointLike, p0: PointLike, p1: PointLike) {\n out.x = p0.x - p1.x;\n out.y = p0.y - p1.y;\n }\n\n static scale(out: PointLike, p0: PointLike, scalar: number) {\n out.x = p0.x * scalar;\n out.y = p0.y * scalar;\n }\n\n static scaleAndAdd(out: PointLike, p0: PointLike, p1: PointLike, scalar: number) {\n out.x = p0.x + p1.x * scalar;\n out.y = p0.y + p1.y * scalar;\n }\n\n static lerp(out: PointLike, p0: PointLike, p1: PointLike, t: number) {\n const onet = 1 - t;\n out.x = onet * p0.x + t * p1.x;\n out.y = onet * p0.y + t * p1.y;\n }\n}", "/**\n * @module echarts/core/BoundingRect\n */\n\nimport * as matrix from './matrix';\nimport Point, { PointLike } from './Point';\n\nconst mathMin = Math.min;\nconst mathMax = Math.max;\n\nconst lt = new Point();\nconst rb = new Point();\nconst lb = new Point();\nconst rt = new Point();\n\nconst minTv = new Point();\nconst maxTv = new Point();\n\nclass BoundingRect {\n\n x: number\n y: number\n width: number\n height: number\n\n constructor(x: number, y: number, width: number, height: number) {\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n union(other: BoundingRect) {\n const x = mathMin(other.x, this.x);\n const y = mathMin(other.y, this.y);\n\n // If x is -Infinity and width is Infinity (like in the case of\n // IncrementalDisplayble), x + width would be NaN\n if (isFinite(this.x) && isFinite(this.width)) {\n this.width = mathMax(\n other.x + other.width,\n this.x + this.width\n ) - x;\n }\n else {\n this.width = other.width;\n }\n\n if (isFinite(this.y) && isFinite(this.height)) {\n this.height = mathMax(\n other.y + other.height,\n this.y + this.height\n ) - y;\n }\n else {\n this.height = other.height;\n }\n\n this.x = x;\n this.y = y;\n }\n\n applyTransform(m: matrix.MatrixArray) {\n BoundingRect.applyTransform(this, this, m);\n }\n\n calculateTransform(b: RectLike): matrix.MatrixArray {\n const a = this;\n const sx = b.width / a.width;\n const sy = b.height / a.height;\n\n const m = matrix.create();\n\n // \u77E9\u9635\u53F3\u4E58\n matrix.translate(m, m, [-a.x, -a.y]);\n matrix.scale(m, m, [sx, sy]);\n matrix.translate(m, m, [b.x, b.y]);\n\n return m;\n }\n\n intersect(b: RectLike, mtv?: PointLike): boolean {\n if (!b) {\n return false;\n }\n\n if (!(b instanceof BoundingRect)) {\n // Normalize negative width/height.\n b = BoundingRect.create(b);\n }\n\n const a = this;\n const ax0 = a.x;\n const ax1 = a.x + a.width;\n const ay0 = a.y;\n const ay1 = a.y + a.height;\n\n const bx0 = b.x;\n const bx1 = b.x + b.width;\n const by0 = b.y;\n const by1 = b.y + b.height;\n\n let overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n if (mtv) {\n let dMin = Infinity;\n let dMax = 0;\n const d0 = Math.abs(ax1 - bx0);\n const d1 = Math.abs(bx1 - ax0);\n const d2 = Math.abs(ay1 - by0);\n const d3 = Math.abs(by1 - ay0);\n const dx = Math.min(d0, d1);\n const dy = Math.min(d2, d3);\n // On x axis\n if (ax1 < bx0 || bx1 < ax0) {\n if (dx > dMax) {\n dMax = dx;\n if (d0 < d1) {\n Point.set(maxTv, -d0, 0); // b is on the right\n }\n else {\n Point.set(maxTv, d1, 0); // b is on the left\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d0 < d1) {\n Point.set(minTv, d0, 0); // b is on the right\n }\n else {\n Point.set(minTv, -d1, 0); // b is on the left\n }\n }\n }\n\n // On y axis\n if (ay1 < by0 || by1 < ay0) {\n if (dy > dMax) {\n dMax = dy;\n if (d2 < d3) {\n Point.set(maxTv, 0, -d2); // b is on the bottom(larger y)\n }\n else {\n Point.set(maxTv, 0, d3); // b is on the top(smaller y)\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d2 < d3) {\n Point.set(minTv, 0, d2); // b is on the bottom\n }\n else {\n Point.set(minTv, 0, -d3); // b is on the top\n }\n }\n }\n }\n\n if (mtv) {\n Point.copy(mtv, overlap ? minTv : maxTv);\n }\n return overlap;\n }\n\n contain(x: number, y: number): boolean {\n const rect = this;\n return x >= rect.x\n && x <= (rect.x + rect.width)\n && y >= rect.y\n && y <= (rect.y + rect.height);\n }\n\n clone() {\n return new BoundingRect(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Copy from another rect\n */\n copy(other: RectLike) {\n BoundingRect.copy(this, other);\n }\n\n plain(): RectLike {\n return {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n };\n }\n\n /**\n * If not having NaN or Infinity with attributes\n */\n isFinite(): boolean {\n return isFinite(this.x)\n && isFinite(this.y)\n && isFinite(this.width)\n && isFinite(this.height);\n }\n\n isZero(): boolean {\n return this.width === 0 || this.height === 0;\n }\n\n static create(rect: RectLike): BoundingRect {\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n }\n\n static copy(target: RectLike, source: RectLike) {\n target.x = source.x;\n target.y = source.y;\n target.width = source.width;\n target.height = source.height;\n }\n\n static applyTransform(target: RectLike, source: RectLike, m: matrix.MatrixArray) {\n // In case usage like this\n // el.getBoundingRect().applyTransform(el.transform)\n // And element has no transform\n if (!m) {\n if (target !== source) {\n BoundingRect.copy(target, source);\n }\n return;\n }\n // Fast path when there is no rotation in matrix.\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\n const sx = m[0];\n const sy = m[3];\n const tx = m[4];\n const ty = m[5];\n target.x = source.x * sx + tx;\n target.y = source.y * sy + ty;\n target.width = source.width * sx;\n target.height = source.height * sy;\n if (target.width < 0) {\n target.x += target.width;\n target.width = -target.width;\n }\n if (target.height < 0) {\n target.y += target.height;\n target.height = -target.height;\n }\n return;\n }\n\n // source and target can be same instance.\n lt.x = lb.x = source.x;\n lt.y = rt.y = source.y;\n rb.x = rt.x = source.x + source.width;\n rb.y = lb.y = source.y + source.height;\n\n lt.transform(m);\n rt.transform(m);\n rb.transform(m);\n lb.transform(m);\n\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\n const maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\n const maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\n target.width = maxX - target.x;\n target.height = maxY - target.y;\n }\n}\n\n\nexport type RectLike = {\n x: number\n y: number\n width: number\n height: number\n}\n\nexport default BoundingRect;", "import * as util from './core/util';\nimport * as vec2 from './core/vector';\nimport Draggable from './mixin/Draggable';\nimport Eventful from './core/Eventful';\nimport * as eventTool from './core/event';\nimport {GestureMgr} from './core/GestureMgr';\nimport Displayable from './graphic/Displayable';\nimport {PainterBase} from './PainterBase';\nimport HandlerDomProxy, { HandlerProxyInterface } from './dom/HandlerProxy';\nimport { ZRRawEvent, ZRPinchEvent, ElementEventName, ElementEventNameWithOn, ZRRawTouchEvent } from './core/types';\nimport Storage from './Storage';\nimport Element, {ElementEvent} from './Element';\nimport CanvasPainter from './canvas/Painter';\nimport BoundingRect from './core/BoundingRect';\n\n/**\n * [The interface between `Handler` and `HandlerProxy`]:\n *\n * The default `HandlerProxy` only support the common standard web environment\n * (e.g., standalone browser, headless browser, embed browser in mobild APP, ...).\n * But `HandlerProxy` can be replaced to support more non-standard environment\n * (e.g., mini app), or to support more feature that the default `HandlerProxy`\n * not provided (like echarts-gl did).\n * So the interface between `Handler` and `HandlerProxy` should be stable. Do not\n * make break changes util inevitable. The interface include the public methods\n * of `Handler` and the events listed in `handlerNames` below, by which `HandlerProxy`\n * drives `Handler`.\n */\n\n/**\n * [DRAG_OUTSIDE]:\n *\n * That is, triggering `mousemove` and `mouseup` event when the pointer is out of the\n * zrender area when dragging. That is important for the improvement of the user experience\n * when dragging something near the boundary without being terminated unexpectedly.\n *\n * We originally consider to introduce new events like `pagemovemove` and `pagemouseup`\n * to resolve this issue. But some drawbacks of it is described in\n * https://github.com/ecomfe/zrender/pull/536#issuecomment-560286899\n *\n * Instead, we referenced the specifications:\n * https://www.w3.org/TR/touch-events/#the-touchmove-event\n * https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#event-type-mousemove\n * where the the mousemove/touchmove can be continue to fire if the user began a drag\n * operation and the pointer has left the boundary. (for the mouse event, browsers\n * only do it on `document` and when the pointer has left the boundary of the browser.)\n *\n * So the default `HandlerProxy` supports this feature similarly: if it is in the dragging\n * state (see `pointerCapture` in `HandlerProxy`), the `mousemove` and `mouseup` continue\n * to fire until release the pointer. That is implemented by listen to those event on\n * `document`.\n * If we implement some other `HandlerProxy` only for touch device, that would be easier.\n * The touch event support this feature by default.\n * The term \"pointer capture\" is from the spec:\n * https://www.w3.org/TR/pointerevents2/#idl-def-element-setpointercapture-pointerid\n *\n * Note:\n * There might be some cases that the mouse event can not be received on `document`.\n * For example,\n * (A) When `useCapture` is not supported and some user defined event listeners on the ancestor\n * of zr dom throw Error.\n * (B) When `useCapture` is not supported and some user defined event listeners on the ancestor of\n * zr dom call `stopPropagation`.\n * In these cases, the `mousemove` event might be keep triggering event when the mouse is released.\n * We try to reduce the side-effect in those cases, that is, use `isOutsideBoundary` to prevent\n * it from do anything (especially, `findHover`).\n * (`useCapture` mean, `addEvnetListener(listener, {capture: true})`, althought it may not be\n * suppported in some environments.)\n *\n * Note:\n * If `HandlerProxy` listens to `document` with `useCapture`, `HandlerProxy` needs to\n * prevent user-registered-handler from calling `stopPropagation` and `preventDefault`\n * when the `event.target` is not a zrender dom element. Otherwise the user-registered-handler\n * may be able to prevent other elements (that not relevant to zrender) in the web page from receiving\n * dom events.\n */\n\nconst SILENT = 'silent';\n\nfunction makeEventPacket(eveType: ElementEventName, targetInfo: {\n target?: Element\n topTarget?: Element\n}, event: ZRRawEvent): ElementEvent {\n return {\n type: eveType,\n event: event,\n // target can only be an element that is not silent.\n target: targetInfo.target,\n // topTarget can be a silent element.\n topTarget: targetInfo.topTarget,\n cancelBubble: false,\n offsetX: event.zrX,\n offsetY: event.zrY,\n gestureEvent: (event as ZRPinchEvent).gestureEvent,\n pinchX: (event as ZRPinchEvent).pinchX,\n pinchY: (event as ZRPinchEvent).pinchY,\n pinchScale: (event as ZRPinchEvent).pinchScale,\n wheelDelta: event.zrDelta,\n zrByTouch: event.zrByTouch,\n which: event.which,\n stop: stopEvent\n };\n}\n\nfunction stopEvent(this: ElementEvent) {\n eventTool.stop(this.event);\n}\n\nclass EmptyProxy extends Eventful {\n handler: Handler = null\n dispose() {}\n setCursor() {}\n}\n\nclass HoveredResult {\n x: number\n y: number\n target: Displayable\n topTarget: Displayable\n constructor(x?: number, y?: number) {\n this.x = x;\n this.y = y;\n }\n}\n\nconst handlerNames = [\n 'click', 'dblclick', 'mousewheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n];\n\ntype HandlerName = 'click' |'dblclick' |'mousewheel' |'mouseout' |\n 'mouseup' |'mousedown' |'mousemove' |'contextmenu';\n\nconst tmpRect = new BoundingRect(0, 0, 0, 0);\n\n// TODO draggable\nclass Handler extends Eventful {\n\n storage: Storage\n painter: PainterBase\n painterRoot: HTMLElement\n\n proxy: HandlerProxyInterface\n\n private _hovered = new HoveredResult(0, 0)\n\n private _gestureMgr: GestureMgr\n\n private _draggingMgr: Draggable\n\n private _pointerSize: number\n\n _downEl: Element\n _upEl: Element\n _downPoint: [number, number]\n\n constructor(\n storage: Storage,\n painter: PainterBase,\n proxy: HandlerProxyInterface,\n painterRoot: HTMLElement,\n pointerSize: number\n ) {\n super();\n\n this.storage = storage;\n\n this.painter = painter;\n\n this.painterRoot = painterRoot;\n\n this._pointerSize = pointerSize;\n\n proxy = proxy || new EmptyProxy();\n\n /**\n * Proxy of event. can be Dom, WebGLSurface, etc.\n */\n this.proxy = null;\n\n this.setHandlerProxy(proxy);\n\n this._draggingMgr = new Draggable(this);\n }\n\n setHandlerProxy(proxy: HandlerProxyInterface) {\n if (this.proxy) {\n this.proxy.dispose();\n }\n\n if (proxy) {\n util.each(handlerNames, function (name) {\n proxy.on && proxy.on(name, this[name as HandlerName], this);\n }, this);\n // Attach handler\n proxy.handler = this;\n }\n this.proxy = proxy;\n }\n\n mousemove(event: ZRRawEvent) {\n const x = event.zrX;\n const y = event.zrY;\n\n const isOutside = isOutsideBoundary(this, x, y);\n\n let lastHovered = this._hovered;\n let lastHoveredTarget = lastHovered.target;\n\n // If lastHoveredTarget is removed from zr (detected by '__zr') by some API call\n // (like 'setOption' or 'dispatchAction') in event handlers, we should find\n // lastHovered again here. Otherwise 'mouseout' can not be triggered normally.\n // See #6198.\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\n lastHoveredTarget = lastHovered.target;\n }\n\n const hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\n const hoveredTarget = hovered.target;\n\n const proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\n\n // Mouse out on previous hovered element\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(lastHovered, 'mouseout', event);\n }\n\n // Mouse moving on one element\n this.dispatchToElement(hovered, 'mousemove', event);\n\n // Mouse over on a new element\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(hovered, 'mouseover', event);\n }\n }\n\n mouseout(event: ZRRawEvent) {\n const eventControl = event.zrEventControl;\n\n if (eventControl !== 'only_globalout') {\n this.dispatchToElement(this._hovered, 'mouseout', event);\n }\n\n if (eventControl !== 'no_globalout') {\n // FIXME: if the pointer moving from the extra doms to realy \"outside\",\n // the `globalout` should have been triggered. But currently not.\n this.trigger('globalout', {type: 'globalout', event: event});\n }\n }\n\n /**\n * Resize\n */\n resize() {\n this._hovered = new HoveredResult(0, 0);\n }\n\n /**\n * Dispatch event\n */\n dispatch(eventName: HandlerName, eventArgs?: any) {\n const handler = this[eventName];\n handler && handler.call(this, eventArgs);\n }\n\n /**\n * Dispose\n */\n dispose() {\n\n this.proxy.dispose();\n\n this.storage = null;\n this.proxy = null;\n this.painter = null;\n }\n\n /**\n * \u8BBE\u7F6E\u9ED8\u8BA4\u7684cursor style\n * @param cursorStyle \u4F8B\u5982 crosshair\uFF0C\u9ED8\u8BA4\u4E3A 'default'\n */\n setCursorStyle(cursorStyle: string) {\n const proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(cursorStyle);\n }\n\n /**\n * \u4E8B\u4EF6\u5206\u53D1\u4EE3\u7406\n *\n * @private\n * @param {Object} targetInfo {target, topTarget} \u76EE\u6807\u56FE\u5F62\u5143\u7D20\n * @param {string} eventName \u4E8B\u4EF6\u540D\u79F0\n * @param {Object} event \u4E8B\u4EF6\u5BF9\u8C61\n */\n dispatchToElement(targetInfo: {\n target?: Element\n topTarget?: Element\n }, eventName: ElementEventName, event: ZRRawEvent) {\n\n targetInfo = targetInfo || {};\n\n let el = targetInfo.target as Element;\n if (el && el.silent) {\n return;\n }\n const eventKey = ('on' + eventName) as ElementEventNameWithOn;\n const eventPacket = makeEventPacket(eventName, targetInfo, event);\n\n while (el) {\n el[eventKey]\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\n\n el.trigger(eventName, eventPacket);\n\n // Bubble to the host if on the textContent.\n // PENDING\n el = el.__hostTarget ? el.__hostTarget : el.parent;\n\n if (eventPacket.cancelBubble) {\n break;\n }\n }\n\n if (!eventPacket.cancelBubble) {\n // \u5192\u6CE1\u5230\u9876\u7EA7 zrender \u5BF9\u8C61\n this.trigger(eventName, eventPacket);\n // \u5206\u53D1\u4E8B\u4EF6\u5230\u7528\u6237\u81EA\u5B9A\u4E49\u5C42\n // \u7528\u6237\u6709\u53EF\u80FD\u5728\u5168\u5C40 click \u4E8B\u4EF6\u4E2D dispose\uFF0C\u6240\u4EE5\u9700\u8981\u5224\u65AD\u4E0B painter \u662F\u5426\u5B58\u5728\n if (this.painter && (this.painter as CanvasPainter).eachOtherLayer) {\n (this.painter as CanvasPainter).eachOtherLayer(function (layer) {\n if (typeof (layer[eventKey]) === 'function') {\n layer[eventKey].call(layer, eventPacket);\n }\n if (layer.trigger) {\n layer.trigger(eventName, eventPacket);\n }\n });\n }\n }\n }\n\n findHover(x: number, y: number, exclude?: Displayable): HoveredResult {\n const list = this.storage.getDisplayList();\n const out = new HoveredResult(x, y);\n setHoverTarget(list, out, x, y, exclude);\n\n if (this._pointerSize && !out.target) {\n /**\n * If no element at pointer position, check intersection with\n * elements with pointer enlarged by target size.\n */\n const candidates: Displayable[] = [];\n const pointerSize = this._pointerSize;\n const targetSizeHalf = pointerSize / 2;\n const pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);\n\n for (let i = list.length - 1; i >= 0; i--) {\n const el = list[i];\n if (el !== exclude\n && !el.ignore\n && !el.ignoreCoarsePointer\n // If an element ignores, its textContent should also ignore.\n // TSpan's parent is not a Group but a ZRText.\n // See Text.js _getOrCreateChild\n && (!el.parent || !(el.parent as any).ignoreCoarsePointer)\n ) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n if (tmpRect.intersect(pointerRect)) {\n candidates.push(el);\n }\n }\n }\n\n /**\n * If there are elements whose bounding boxes are near the pointer,\n * use the most top one that intersects with the enlarged pointer.\n */\n if (candidates.length) {\n const rStep = 4;\n const thetaStep = Math.PI / 12;\n const PI2 = Math.PI * 2;\n for (let r = 0; r < targetSizeHalf; r += rStep) {\n for (let theta = 0; theta < PI2; theta += thetaStep) {\n const x1 = x + r * Math.cos(theta);\n const y1 = y + r * Math.sin(theta);\n setHoverTarget(candidates, out, x1, y1, exclude);\n if (out.target) {\n return out;\n }\n }\n }\n }\n }\n\n return out;\n }\n\n processGesture(event: ZRRawEvent, stage?: 'start' | 'end' | 'change') {\n if (!this._gestureMgr) {\n this._gestureMgr = new GestureMgr();\n }\n const gestureMgr = this._gestureMgr;\n\n stage === 'start' && gestureMgr.clear();\n\n const gestureInfo = gestureMgr.recognize(\n event as ZRRawTouchEvent,\n this.findHover(event.zrX, event.zrY, null).target,\n (this.proxy as HandlerDomProxy).dom\n );\n\n stage === 'end' && gestureMgr.clear();\n\n // Do not do any preventDefault here. Upper application do that if necessary.\n if (gestureInfo) {\n const type = gestureInfo.type;\n (event as ZRPinchEvent).gestureEvent = type;\n\n let res = new HoveredResult();\n res.target = gestureInfo.target;\n this.dispatchToElement(res, type as ElementEventName, gestureInfo.event as ZRRawEvent);\n }\n }\n\n click: (event: ZRRawEvent) => void\n mousedown: (event: ZRRawEvent) => void\n mouseup: (event: ZRRawEvent) => void\n mousewheel: (event: ZRRawEvent) => void\n dblclick: (event: ZRRawEvent) => void\n contextmenu: (event: ZRRawEvent) => void\n}\n\n// Common handlers\nutil.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name: HandlerName) {\n Handler.prototype[name] = function (event) {\n const x = event.zrX;\n const y = event.zrY;\n const isOutside = isOutsideBoundary(this, x, y);\n\n let hovered;\n let hoveredTarget;\n\n if (name !== 'mouseup' || !isOutside) {\n // Find hover again to avoid click event is dispatched manually. Or click is triggered without mouseover\n hovered = this.findHover(x, y);\n hoveredTarget = hovered.target;\n }\n\n if (name === 'mousedown') {\n this._downEl = hoveredTarget;\n this._downPoint = [event.zrX, event.zrY];\n // In case click triggered before mouseup\n this._upEl = hoveredTarget;\n }\n else if (name === 'mouseup') {\n this._upEl = hoveredTarget;\n }\n else if (name === 'click') {\n if (this._downEl !== this._upEl\n // Original click event is triggered on the whole canvas element,\n // including the case that `mousedown` - `mousemove` - `mouseup`,\n // which should be filtered, otherwise it will bring trouble to\n // pan and zoom.\n || !this._downPoint\n // Arbitrary value\n || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4\n ) {\n return;\n }\n this._downPoint = null;\n }\n\n this.dispatchToElement(hovered, name, event);\n };\n});\n\nfunction isHover(displayable: Displayable, x: number, y: number) {\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\n let el: Element = displayable;\n let isSilent;\n let ignoreClip = false;\n while (el) {\n // Ignore clip on any ancestors.\n if (el.ignoreClip) {\n ignoreClip = true;\n }\n if (!ignoreClip) {\n let clipPath = el.getClipPath();\n // If clipped by ancestor.\n // FIXME: If clipPath has neither stroke nor fill,\n // el.clipPath.contain(x, y) will always return false.\n if (clipPath && !clipPath.contain(x, y)) {\n return false;\n }\n }\n if (el.silent) {\n isSilent = true;\n }\n // Consider when el is textContent, also need to be silent\n // if any of its host el and its ancestors is silent.\n const hostEl = el.__hostTarget;\n el = hostEl ? hostEl : el.parent;\n }\n return isSilent ? SILENT : true;\n }\n\n return false;\n}\n\nfunction setHoverTarget(\n list: Displayable[],\n out: HoveredResult,\n x: number,\n y: number,\n exclude: Displayable\n) {\n for (let i = list.length - 1; i >= 0; i--) {\n const el = list[i];\n let hoverCheckResult;\n if (el !== exclude\n // getDisplayList may include ignored item in VML mode\n && !el.ignore\n && (hoverCheckResult = isHover(el, x, y))\n ) {\n !out.topTarget && (out.topTarget = el);\n if (hoverCheckResult !== SILENT) {\n out.target = el;\n break;\n }\n }\n }\n}\n\n/**\n * See [DRAG_OUTSIDE].\n */\nfunction isOutsideBoundary(handlerInstance: Handler, x: number, y: number) {\n const painter = handlerInstance.painter;\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\n}\n\nexport default Handler;\n", "// https://github.com/mziccard/node-timsort\nconst DEFAULT_MIN_MERGE = 32;\n\nconst DEFAULT_MIN_GALLOPING = 7;\n\ntype CompareFunc =(a: T, b: T) => number\n\nfunction minRunLength(n: number): number {\n var r = 0;\n\n while (n >= DEFAULT_MIN_MERGE) {\n r |= n & 1;\n n >>= 1;\n }\n\n return n + r;\n}\n\nfunction makeAscendingRun(array: T[], lo: number, hi: number, compare: CompareFunc) {\n var runHi = lo + 1;\n\n if (runHi === hi) {\n return 1;\n }\n\n if (compare(array[runHi++], array[lo]) < 0) {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n runHi++;\n }\n\n reverseRun(array, lo, runHi);\n }\n else {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n runHi++;\n }\n }\n\n return runHi - lo;\n}\n\nfunction reverseRun(array: T[], lo: number, hi: number) {\n hi--;\n\n while (lo < hi) {\n var t = array[lo];\n array[lo++] = array[hi];\n array[hi--] = t;\n }\n}\n\nfunction binaryInsertionSort(array: T[], lo: number, hi: number, start: number, compare: CompareFunc) {\n if (start === lo) {\n start++;\n }\n\n for (; start < hi; start++) {\n var pivot = array[start];\n\n var left = lo;\n var right = start;\n var mid;\n\n while (left < right) {\n mid = left + right >>> 1;\n\n if (compare(pivot, array[mid]) < 0) {\n right = mid;\n }\n else {\n left = mid + 1;\n }\n }\n\n var n = start - left;\n\n switch (n) {\n case 3:\n array[left + 3] = array[left + 2];\n\n case 2:\n array[left + 2] = array[left + 1];\n\n case 1:\n array[left + 1] = array[left];\n break;\n default:\n while (n > 0) {\n array[left + n] = array[left + n - 1];\n n--;\n }\n }\n\n array[left] = pivot;\n }\n}\n\nfunction gallopLeft(value: T, array: T[], start: number, length: number, hint: number, compare: CompareFunc) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n\n if (compare(value, array[start + hint]) > 0) {\n maxOffset = length - hint;\n\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n lastOffset += hint;\n offset += hint;\n }\n else {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n\n if (compare(value, array[start + m]) > 0) {\n lastOffset = m + 1;\n }\n else {\n offset = m;\n }\n }\n return offset;\n}\n\nfunction gallopRight(value: T, array: T[], start: number, length: number, hint: number, compare: CompareFunc) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n\n if (compare(value, array[start + hint]) < 0) {\n maxOffset = hint + 1;\n\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n else {\n maxOffset = length - hint;\n\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n lastOffset += hint;\n offset += hint;\n }\n\n lastOffset++;\n\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n\n if (compare(value, array[start + m]) < 0) {\n offset = m;\n }\n else {\n lastOffset = m + 1;\n }\n }\n\n return offset;\n}\n\nfunction TimSort(array: T[], compare: CompareFunc) {\n let minGallop = DEFAULT_MIN_GALLOPING;\n let runStart: number[];\n let runLength: number[];\n let stackSize = 0;\n\n var tmp: T[] = [];\n\n runStart = [];\n runLength = [];\n\n function pushRun(_runStart: number, _runLength: number) {\n runStart[stackSize] = _runStart;\n runLength[stackSize] = _runLength;\n stackSize += 1;\n }\n\n function mergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n\n if (\n (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])\n ) {\n if (runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n }\n else if (runLength[n] > runLength[n + 1]) {\n break;\n }\n mergeAt(n);\n }\n }\n\n function forceMergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n\n mergeAt(n);\n }\n }\n\n function mergeAt(i: number) {\n var start1 = runStart[i];\n var length1 = runLength[i];\n var start2 = runStart[i + 1];\n var length2 = runLength[i + 1];\n\n runLength[i] = length1 + length2;\n\n if (i === stackSize - 3) {\n runStart[i + 1] = runStart[i + 2];\n runLength[i + 1] = runLength[i + 2];\n }\n\n stackSize--;\n\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n start1 += k;\n length1 -= k;\n\n if (length1 === 0) {\n return;\n }\n\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n\n if (length2 === 0) {\n return;\n }\n\n if (length1 <= length2) {\n mergeLow(start1, length1, start2, length2);\n }\n else {\n mergeHigh(start1, length1, start2, length2);\n }\n }\n\n function mergeLow(start1: number, length1: number, start2: number, length2: number) {\n var i = 0;\n\n for (i = 0; i < length1; i++) {\n tmp[i] = array[start1 + i];\n }\n\n var cursor1 = 0;\n var cursor2 = start2;\n var dest = start1;\n\n array[dest++] = array[cursor2++];\n\n if (--length2 === 0) {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n return;\n }\n\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n return;\n }\n\n var _minGallop = minGallop;\n var count1;\n var count2;\n var exit;\n\n while (1) {\n count1 = 0;\n count2 = 0;\n exit = false;\n\n do {\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\n array[dest++] = array[cursor2++];\n count2++;\n count1 = 0;\n\n if (--length2 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest++] = tmp[cursor1++];\n count1++;\n count2 = 0;\n if (--length1 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n\n if (exit) {\n break;\n }\n\n do {\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n\n if (count1 !== 0) {\n for (i = 0; i < count1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n\n dest += count1;\n cursor1 += count1;\n length1 -= count1;\n if (length1 <= 1) {\n exit = true;\n break;\n }\n }\n\n array[dest++] = array[cursor2++];\n\n if (--length2 === 0) {\n exit = true;\n break;\n }\n\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n\n if (count2 !== 0) {\n for (i = 0; i < count2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n\n dest += count2;\n cursor2 += count2;\n length2 -= count2;\n\n if (length2 === 0) {\n exit = true;\n break;\n }\n }\n array[dest++] = tmp[cursor1++];\n\n if (--length1 === 1) {\n exit = true;\n break;\n }\n\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n\n if (exit) {\n break;\n }\n\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n\n _minGallop += 2;\n }\n\n minGallop = _minGallop;\n\n minGallop < 1 && (minGallop = 1);\n\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n }\n else if (length1 === 0) {\n throw new Error();\n }\n else {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n }\n }\n\n function mergeHigh(start1: number, length1: number, start2: number, length2: number) {\n var i = 0;\n\n for (i = 0; i < length2; i++) {\n tmp[i] = array[start2 + i];\n }\n\n var cursor1 = start1 + length1 - 1;\n var cursor2 = length2 - 1;\n var dest = start2 + length2 - 1;\n var customCursor = 0;\n var customDest = 0;\n\n array[dest--] = array[cursor1--];\n\n if (--length1 === 0) {\n customCursor = dest - (length2 - 1);\n\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n\n return;\n }\n\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n array[dest] = tmp[cursor2];\n return;\n }\n\n var _minGallop = minGallop;\n\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n\n do {\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\n array[dest--] = array[cursor1--];\n count1++;\n count2 = 0;\n if (--length1 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest--] = tmp[cursor2--];\n count2++;\n count1 = 0;\n if (--length2 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n\n if (exit) {\n break;\n }\n\n do {\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n\n if (count1 !== 0) {\n dest -= count1;\n cursor1 -= count1;\n length1 -= count1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = count1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n if (length1 === 0) {\n exit = true;\n break;\n }\n }\n\n array[dest--] = tmp[cursor2--];\n\n if (--length2 === 1) {\n exit = true;\n break;\n }\n\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n\n if (count2 !== 0) {\n dest -= count2;\n cursor2 -= count2;\n length2 -= count2;\n customDest = dest + 1;\n customCursor = cursor2 + 1;\n\n for (i = 0; i < count2; i++) {\n array[customDest + i] = tmp[customCursor + i];\n }\n\n if (length2 <= 1) {\n exit = true;\n break;\n }\n }\n\n array[dest--] = array[cursor1--];\n\n if (--length1 === 0) {\n exit = true;\n break;\n }\n\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n\n if (exit) {\n break;\n }\n\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n\n _minGallop += 2;\n }\n\n minGallop = _minGallop;\n\n if (minGallop < 1) {\n minGallop = 1;\n }\n\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n array[dest] = tmp[cursor2];\n }\n else if (length2 === 0) {\n throw new Error();\n // throw new Error('mergeHigh preconditions were not respected');\n }\n else {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n }\n }\n\n return {\n mergeRuns,\n forceMergeRuns,\n pushRun\n };\n}\n\nexport default function sort(\n array: T[],\n compare: CompareFunc,\n lo?: number, hi?: number\n) {\n if (!lo) {\n lo = 0;\n }\n if (!hi) {\n hi = array.length;\n }\n\n var remaining = hi - lo;\n\n if (remaining < 2) {\n return;\n }\n\n var runLength = 0;\n\n if (remaining < DEFAULT_MIN_MERGE) {\n runLength = makeAscendingRun(array, lo, hi, compare);\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n return;\n }\n\n var ts = TimSort(array, compare);\n\n var minRun = minRunLength(remaining);\n\n do {\n runLength = makeAscendingRun(array, lo, hi, compare);\n if (runLength < minRun) {\n var force = remaining;\n if (force > minRun) {\n force = minRun;\n }\n\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n runLength = force;\n }\n\n ts.pushRun(lo, runLength);\n ts.mergeRuns();\n\n remaining -= runLength;\n lo += runLength;\n } while (remaining !== 0);\n\n ts.forceMergeRuns();\n}\n", "// Bit masks to check which parts of element needs to be updated.\nexport const REDRAW_BIT = 1;\nexport const STYLE_CHANGED_BIT = 2;\nexport const SHAPE_CHANGED_BIT = 4;\n", "import * as util from './core/util';\nimport Group, { GroupLike } from './graphic/Group';\nimport Element from './Element';\n\n// Use timsort because in most case elements are partially sorted\n// https://jsfiddle.net/pissang/jr4x7mdm/8/\nimport timsort from './core/timsort';\nimport Displayable from './graphic/Displayable';\nimport Path from './graphic/Path';\nimport { REDRAW_BIT } from './graphic/constants';\n\nlet invalidZErrorLogged = false;\nfunction logInvalidZError() {\n if (invalidZErrorLogged) {\n return;\n }\n invalidZErrorLogged = true;\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\n}\n\nfunction shapeCompareFunc(a: Displayable, b: Displayable) {\n if (a.zlevel === b.zlevel) {\n if (a.z === b.z) {\n return a.z2 - b.z2;\n }\n return a.z - b.z;\n }\n return a.zlevel - b.zlevel;\n}\n\nexport default class Storage {\n\n private _roots: Element[] = []\n\n private _displayList: Displayable[] = []\n\n private _displayListLen = 0\n\n traverse(\n cb: (this: T, el: Element) => void,\n context?: T\n ) {\n for (let i = 0; i < this._roots.length; i++) {\n this._roots[i].traverse(cb, context);\n }\n }\n\n /**\n * get a list of elements to be rendered\n *\n * @param {boolean} update whether to update elements before return\n * @param {DisplayParams} params options\n * @return {Displayable[]} a list of elements\n */\n getDisplayList(update?: boolean, includeIgnore?: boolean): Displayable[] {\n includeIgnore = includeIgnore || false;\n const displayList = this._displayList;\n // If displaylist is not created yet. Update force\n if (update || !displayList.length) {\n this.updateDisplayList(includeIgnore);\n }\n return displayList;\n }\n\n /**\n * \u66F4\u65B0\u56FE\u5F62\u7684\u7ED8\u5236\u961F\u5217\u3002\n * \u6BCF\u6B21\u7ED8\u5236\u524D\u90FD\u4F1A\u8C03\u7528\uFF0C\u8BE5\u65B9\u6CD5\u4F1A\u5148\u6DF1\u5EA6\u4F18\u5148\u904D\u5386\u6574\u4E2A\u6811\uFF0C\u66F4\u65B0\u6240\u6709Group\u548CShape\u7684\u53D8\u6362\u5E76\u4E14\u628A\u6240\u6709\u53EF\u89C1\u7684Shape\u4FDD\u5B58\u5230\u6570\u7EC4\u4E2D\uFF0C\n * \u6700\u540E\u6839\u636E\u7ED8\u5236\u7684\u4F18\u5148\u7EA7\uFF08zlevel > z > \u63D2\u5165\u987A\u5E8F\uFF09\u6392\u5E8F\u5F97\u5230\u7ED8\u5236\u961F\u5217\n */\n updateDisplayList(includeIgnore?: boolean) {\n this._displayListLen = 0;\n\n const roots = this._roots;\n const displayList = this._displayList;\n for (let i = 0, len = roots.length; i < len; i++) {\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\n }\n\n displayList.length = this._displayListLen;\n\n timsort(displayList, shapeCompareFunc);\n }\n\n private _updateAndAddDisplayable(\n el: Element,\n clipPaths: Path[],\n includeIgnore?: boolean\n ) {\n if (el.ignore && !includeIgnore) {\n return;\n }\n\n el.beforeUpdate();\n el.update();\n el.afterUpdate();\n\n const userSetClipPath = el.getClipPath();\n\n if (el.ignoreClip) {\n clipPaths = null;\n }\n else if (userSetClipPath) {\n\n // FIXME \u6548\u7387\u5F71\u54CD\n if (clipPaths) {\n clipPaths = clipPaths.slice();\n }\n else {\n clipPaths = [];\n }\n\n let currentClipPath = userSetClipPath;\n let parentClipPath = el;\n // Recursively add clip path\n while (currentClipPath) {\n // clipPath \u7684\u53D8\u6362\u662F\u57FA\u4E8E\u4F7F\u7528\u8FD9\u4E2A clipPath \u7684\u5143\u7D20\n // TODO: parent should be group type.\n currentClipPath.parent = parentClipPath as Group;\n currentClipPath.updateTransform();\n\n clipPaths.push(currentClipPath);\n\n parentClipPath = currentClipPath;\n currentClipPath = currentClipPath.getClipPath();\n }\n }\n\n // ZRText and Group and combining morphing Path may use children\n if ((el as GroupLike).childrenRef) {\n const children = (el as GroupLike).childrenRef();\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n\n // Force to mark as dirty if group is dirty\n if (el.__dirty) {\n child.__dirty |= REDRAW_BIT;\n }\n\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\n }\n\n // Mark group clean here\n el.__dirty = 0;\n\n }\n else {\n const disp = el as Displayable;\n // Element is displayable\n if (clipPaths && clipPaths.length) {\n disp.__clipPaths = clipPaths;\n }\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\n disp.__clipPaths = [];\n }\n\n // Avoid invalid z, z2, zlevel cause sorting error.\n if (isNaN(disp.z)) {\n logInvalidZError();\n disp.z = 0;\n }\n if (isNaN(disp.z2)) {\n logInvalidZError();\n disp.z2 = 0;\n }\n if (isNaN(disp.zlevel)) {\n logInvalidZError();\n disp.zlevel = 0;\n }\n\n this._displayList[this._displayListLen++] = disp;\n }\n\n // Add decal\n const decalEl = (el as Path).getDecalElement && (el as Path).getDecalElement();\n if (decalEl) {\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\n }\n\n // Add attached text element and guide line.\n const textGuide = el.getTextGuideLine();\n if (textGuide) {\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\n }\n\n const textEl = el.getTextContent();\n if (textEl) {\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\n }\n }\n\n /**\n * \u6DFB\u52A0\u56FE\u5F62(Displayable)\u6216\u8005\u7EC4(Group)\u5230\u6839\u8282\u70B9\n */\n addRoot(el: Element) {\n if (el.__zr && el.__zr.storage === this) {\n return;\n }\n\n this._roots.push(el);\n }\n\n /**\n * \u5220\u9664\u6307\u5B9A\u7684\u56FE\u5F62(Displayable)\u6216\u8005\u7EC4(Group)\n * @param el\n */\n delRoot(el: Element | Element[]) {\n\n if (el instanceof Array) {\n for (let i = 0, l = el.length; i < l; i++) {\n this.delRoot(el[i]);\n }\n return;\n }\n\n const idx = util.indexOf(this._roots, el);\n if (idx >= 0) {\n this._roots.splice(idx, 1);\n }\n }\n\n delAllRoots() {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n\n return;\n }\n\n getRoots() {\n return this._roots;\n }\n\n /**\n * \u6E05\u7A7A\u5E76\u4E14\u91CA\u653EStorage\n */\n dispose() {\n this._displayList = null;\n this._roots = null;\n }\n\n displayableSortFunc = shapeCompareFunc\n}", "import env from '../core/env';\n\ntype RequestAnimationFrameType = typeof window.requestAnimationFrame\n\nlet requestAnimationFrame: RequestAnimationFrameType;\n\nrequestAnimationFrame = (\n\tenv.hasGlobalWindow\n\t\t&& (\n\t\t\t(window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\n\t\t\t// https://github.com/ecomfe/zrender/issues/189#issuecomment-224919809\n\t\t\t|| ((window as any).msRequestAnimationFrame && (window as any).msRequestAnimationFrame.bind(window))\n\t\t\t|| (window as any).mozRequestAnimationFrame\n\t\t\t// @ts-ignore\n\t\t\t|| window.webkitRequestAnimationFrame\n\t\t)\n) || function (func: Parameters[0]): number {\n\treturn setTimeout(func, 16) as any;\n};\n\nexport default requestAnimationFrame;\n", "/**\n * \u7F13\u52A8\u4EE3\u7801\u6765\u81EA https://github.com/sole/tween.js/blob/master/src/Tween.js\n * @see http://sole.github.io/tween.js/examples/03_graphs.html\n * @exports zrender/animation/easing\n */\n\ntype easingFunc = (percent: number) => number;\n\nexport type AnimationEasing = keyof typeof easingFuncs | easingFunc;\n\nconst easingFuncs = {\n /**\n * @param {number} k\n * @return {number}\n */\n linear(k: number) {\n return k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticIn(k: number) {\n return k * k;\n },\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticOut(k: number) {\n return k * (2 - k);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticInOut(k: number) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n return -0.5 * (--k * (k - 2) - 1);\n },\n\n // \u4E09\u6B21\u65B9\u7684\u7F13\u52A8\uFF08t^3\uFF09\n /**\n * @param {number} k\n * @return {number}\n */\n cubicIn(k: number) {\n return k * k * k;\n },\n /**\n * @param {number} k\n * @return {number}\n */\n cubicOut(k: number) {\n return --k * k * k + 1;\n },\n /**\n * @param {number} k\n * @return {number}\n */\n cubicInOut(k: number) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n\n // \u56DB\u6B21\u65B9\u7684\u7F13\u52A8\uFF08t^4\uFF09\n /**\n * @param {number} k\n * @return {number}\n */\n quarticIn(k: number) {\n return k * k * k * k;\n },\n /**\n * @param {number} k\n * @return {number}\n */\n quarticOut(k: number) {\n return 1 - (--k * k * k * k);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n quarticInOut(k: number) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n return -0.5 * ((k -= 2) * k * k * k - 2);\n },\n\n // \u4E94\u6B21\u65B9\u7684\u7F13\u52A8\uFF08t^5\uFF09\n /**\n * @param {number} k\n * @return {number}\n */\n quinticIn(k: number) {\n return k * k * k * k * k;\n },\n /**\n * @param {number} k\n * @return {number}\n */\n quinticOut(k: number) {\n return --k * k * k * k * k + 1;\n },\n /**\n * @param {number} k\n * @return {number}\n */\n quinticInOut(k: number) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n\n // \u6B63\u5F26\u66F2\u7EBF\u7684\u7F13\u52A8\uFF08sin(t)\uFF09\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalIn(k: number) {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalOut(k: number) {\n return Math.sin(k * Math.PI / 2);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalInOut(k: number) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n\n // \u6307\u6570\u66F2\u7EBF\u7684\u7F13\u52A8\uFF082^t\uFF09\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialIn(k: number) {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialOut(k: number) {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialInOut(k: number) {\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if ((k *= 2) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n },\n\n // \u5706\u5F62\u66F2\u7EBF\u7684\u7F13\u52A8\uFF08sqrt(1-t^2)\uFF09\n /**\n * @param {number} k\n * @return {number}\n */\n circularIn(k: number) {\n return 1 - Math.sqrt(1 - k * k);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n circularOut(k: number) {\n return Math.sqrt(1 - (--k * k));\n },\n /**\n * @param {number} k\n * @return {number}\n */\n circularInOut(k: number) {\n if ((k *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n\n // \u521B\u5EFA\u7C7B\u4F3C\u4E8E\u5F39\u7C27\u5728\u505C\u6B62\u524D\u6765\u56DE\u632F\u8361\u7684\u52A8\u753B\n /**\n * @param {number} k\n * @return {number}\n */\n elasticIn(k: number) {\n let s;\n let a = 0.1;\n let p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return -(a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n },\n /**\n * @param {number} k\n * @return {number}\n */\n elasticOut(k: number) {\n let s;\n let a = 0.1;\n let p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return (a * Math.pow(2, -10 * k)\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n elasticInOut(k: number) {\n let s;\n let a = 0.1;\n let p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n if ((k *= 2) < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n }\n return a * Math.pow(2, -10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n\n },\n\n // \u5728\u67D0\u4E00\u52A8\u753B\u5F00\u59CB\u6CBF\u6307\u793A\u7684\u8DEF\u5F84\u8FDB\u884C\u52A8\u753B\u5904\u7406\u524D\u7A0D\u7A0D\u6536\u56DE\u8BE5\u52A8\u753B\u7684\u79FB\u52A8\n /**\n * @param {number} k\n * @return {number}\n */\n backIn(k: number) {\n let s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n backOut(k: number) {\n let s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n /**\n * @param {number} k\n * @return {number}\n */\n backInOut(k: number) {\n let s = 1.70158 * 1.525;\n if ((k *= 2) < 1) {\n return 0.5 * (k * k * ((s + 1) * k - s));\n }\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n\n // \u521B\u5EFA\u5F39\u8DF3\u6548\u679C\n /**\n * @param {number} k\n * @return {number}\n */\n bounceIn(k: number) {\n return 1 - easingFuncs.bounceOut(1 - k);\n },\n /**\n * @param {number} k\n * @return {number}\n */\n bounceOut(k: number) {\n if (k < (1 / 2.75)) {\n return 7.5625 * k * k;\n }\n else if (k < (2 / 2.75)) {\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n }\n else if (k < (2.5 / 2.75)) {\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n }\n else {\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n }\n },\n /**\n * @param {number} k\n * @return {number}\n */\n bounceInOut(k: number) {\n if (k < 0.5) {\n return easingFuncs.bounceIn(k * 2) * 0.5;\n }\n return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n }\n};\n\n\nexport default easingFuncs;", "/**\n * \u66F2\u7EBF\u8F85\u52A9\u6A21\u5757\n */\n\nimport {\n create as v2Create,\n distSquare as v2DistSquare,\n VectorArray\n} from './vector';\n\nconst mathPow = Math.pow;\nconst mathSqrt = Math.sqrt;\n\nconst EPSILON = 1e-8;\nconst EPSILON_NUMERIC = 1e-4;\n\nconst THREE_SQRT = mathSqrt(3);\nconst ONE_THIRD = 1 / 3;\n\n// \u4E34\u65F6\u53D8\u91CF\nconst _v0 = v2Create();\nconst _v1 = v2Create();\nconst _v2 = v2Create();\n\nfunction isAroundZero(val: number) {\n return val > -EPSILON && val < EPSILON;\n}\nfunction isNotAroundZero(val: number) {\n return val > EPSILON || val < -EPSILON;\n}\n/**\n * \u8BA1\u7B97\u4E09\u6B21\u8D1D\u585E\u5C14\u503C\n */\nexport function cubicAt(p0: number, p1: number, p2: number, p3: number, t: number): number {\n const onet = 1 - t;\n return onet * onet * (onet * p0 + 3 * t * p1)\n + t * t * (t * p3 + 3 * onet * p2);\n}\n\n/**\n * \u8BA1\u7B97\u4E09\u6B21\u8D1D\u585E\u5C14\u5BFC\u6570\u503C\n */\nexport function cubicDerivativeAt(p0: number, p1: number, p2: number, p3: number, t: number): number {\n const onet = 1 - t;\n return 3 * (\n ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\n + (p3 - p2) * t * t\n );\n}\n\n/**\n * \u8BA1\u7B97\u4E09\u6B21\u8D1D\u585E\u5C14\u65B9\u7A0B\u6839\uFF0C\u4F7F\u7528\u76DB\u91D1\u516C\u5F0F\n */\nexport function cubicRootAt(p0: number, p1: number, p2: number, p3: number, val: number, roots: number[]): number {\n // Evaluate roots of cubic functions\n const a = p3 + 3 * (p1 - p2) - p0;\n const b = 3 * (p2 - p1 * 2 + p0);\n const c = 3 * (p1 - p0);\n const d = p0 - val;\n\n const A = b * b - 3 * a * c;\n const B = b * c - 9 * a * d;\n const C = c * c - 3 * b * d;\n\n let n = 0;\n\n if (isAroundZero(A) && isAroundZero(B)) {\n if (isAroundZero(b)) {\n roots[0] = 0;\n }\n else {\n const t1 = -c / b; //t1, t2, t3, b is not zero\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n const disc = B * B - 4 * A * C;\n\n if (isAroundZero(disc)) {\n const K = B / A;\n const t1 = -b / a + K; // t1, a is not zero\n const t2 = -K / 2; // t2, t3\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n else if (disc > 0) {\n const discSqrt = mathSqrt(disc);\n let Y1 = A * b + 1.5 * a * (-B + discSqrt);\n let Y2 = A * b + 1.5 * a * (-B - discSqrt);\n if (Y1 < 0) {\n Y1 = -mathPow(-Y1, ONE_THIRD);\n }\n else {\n Y1 = mathPow(Y1, ONE_THIRD);\n }\n if (Y2 < 0) {\n Y2 = -mathPow(-Y2, ONE_THIRD);\n }\n else {\n Y2 = mathPow(Y2, ONE_THIRD);\n }\n const t1 = (-b - (Y1 + Y2)) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n else {\n const T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\n const theta = Math.acos(T) / 3;\n const ASqrt = mathSqrt(A);\n const tmp = Math.cos(theta);\n\n const t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\n const t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\n const t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n if (t3 >= 0 && t3 <= 1) {\n roots[n++] = t3;\n }\n }\n }\n return n;\n}\n\n/**\n * \u8BA1\u7B97\u4E09\u6B21\u8D1D\u585E\u5C14\u65B9\u7A0B\u6781\u9650\u503C\u7684\u4F4D\u7F6E\n * @return \u6709\u6548\u6570\u76EE\n */\nexport function cubicExtrema(p0: number, p1: number, p2: number, p3: number, extrema: number[]): number {\n const b = 6 * p2 - 12 * p1 + 6 * p0;\n const a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\n const c = 3 * p1 - 3 * p0;\n\n let n = 0;\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n const t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n }\n }\n else {\n const disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n extrema[0] = -b / (2 * a);\n }\n else if (disc > 0) {\n const discSqrt = mathSqrt(disc);\n const t1 = (-b + discSqrt) / (2 * a);\n const t2 = (-b - discSqrt) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n extrema[n++] = t2;\n }\n }\n }\n return n;\n}\n\n/**\n * \u7EC6\u5206\u4E09\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\n */\nexport function cubicSubdivide(p0: number, p1: number, p2: number, p3: number, t: number, out: number[]) {\n const p01 = (p1 - p0) * t + p0;\n const p12 = (p2 - p1) * t + p1;\n const p23 = (p3 - p2) * t + p2;\n\n const p012 = (p12 - p01) * t + p01;\n const p123 = (p23 - p12) * t + p12;\n\n const p0123 = (p123 - p012) * t + p012;\n // Seg0\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p0123;\n // Seg1\n out[4] = p0123;\n out[5] = p123;\n out[6] = p23;\n out[7] = p3;\n}\n\n/**\n * \u6295\u5C04\u70B9\u5230\u4E09\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\u4E0A\uFF0C\u8FD4\u56DE\u6295\u5C04\u8DDD\u79BB\u3002\n * \u6295\u5C04\u70B9\u6709\u53EF\u80FD\u4F1A\u6709\u4E00\u4E2A\u6216\u8005\u591A\u4E2A\uFF0C\u8FD9\u91CC\u53EA\u8FD4\u56DE\u5176\u4E2D\u8DDD\u79BB\u6700\u77ED\u7684\u4E00\u4E2A\u3002\n */\nexport function cubicProjectPoint(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number,\n x: number, y: number, out: VectorArray\n): number {\n // http://pomax.github.io/bezierinfo/#projections\n let t;\n let interval = 0.005;\n let d = Infinity;\n let prev;\n let next;\n let d1;\n let d2;\n\n _v0[0] = x;\n _v0[1] = y;\n\n // \u5148\u7C97\u7565\u4F30\u8BA1\u4E00\u4E0B\u53EF\u80FD\u7684\u6700\u5C0F\u8DDD\u79BB\u7684 t \u503C\n // PENDING\n for (let _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\n d1 = v2DistSquare(_v0, _v1);\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n\n // At most 32 iteration\n for (let i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n prev = t - interval;\n next = t + interval;\n // t - interval\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n\n d1 = v2DistSquare(_v1, _v0);\n\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n // t + interval\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\n d2 = v2DistSquare(_v2, _v0);\n\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n // t\n if (out) {\n out[0] = cubicAt(x0, x1, x2, x3, t);\n out[1] = cubicAt(y0, y1, y2, y3, t);\n }\n // console.log(interval, i);\n return mathSqrt(d);\n}\n\n/**\n * \u8BA1\u7B97\u4E09\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\u957F\u5EA6\n */\nexport function cubicLength(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number,\n iteration: number\n) {\n let px = x0;\n let py = y0;\n\n let d = 0;\n\n const step = 1 / iteration;\n\n for (let i = 1; i <= iteration; i++) {\n let t = i * step;\n const x = cubicAt(x0, x1, x2, x3, t);\n const y = cubicAt(y0, y1, y2, y3, t);\n\n const dx = x - px;\n const dy = y - py;\n\n d += Math.sqrt(dx * dx + dy * dy);\n\n px = x;\n py = y;\n }\n\n return d;\n}\n\n/**\n * \u8BA1\u7B97\u4E8C\u6B21\u65B9\u8D1D\u585E\u5C14\u503C\n */\nexport function quadraticAt(p0: number, p1: number, p2: number, t: number): number {\n const onet = 1 - t;\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\n\n/**\n * \u8BA1\u7B97\u4E8C\u6B21\u65B9\u8D1D\u585E\u5C14\u5BFC\u6570\u503C\n */\nexport function quadraticDerivativeAt(p0: number, p1: number, p2: number, t: number): number {\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\n\n/**\n * \u8BA1\u7B97\u4E8C\u6B21\u65B9\u8D1D\u585E\u5C14\u65B9\u7A0B\u6839\n * @return \u6709\u6548\u6839\u6570\u76EE\n */\nexport function quadraticRootAt(p0: number, p1: number, p2: number, val: number, roots: number[]): number {\n const a = p0 - 2 * p1 + p2;\n const b = 2 * (p1 - p0);\n const c = p0 - val;\n\n let n = 0;\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n const t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n const disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n const t1 = -b / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n else if (disc > 0) {\n const discSqrt = mathSqrt(disc);\n const t1 = (-b + discSqrt) / (2 * a);\n const t2 = (-b - discSqrt) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n }\n return n;\n}\n\n/**\n * \u8BA1\u7B97\u4E8C\u6B21\u8D1D\u585E\u5C14\u65B9\u7A0B\u6781\u9650\u503C\n */\nexport function quadraticExtremum(p0: number, p1: number, p2: number): number {\n const divider = p0 + p2 - 2 * p1;\n if (divider === 0) {\n // p1 is center of p0 and p2\n return 0.5;\n }\n else {\n return (p0 - p1) / divider;\n }\n}\n\n/**\n * \u7EC6\u5206\u4E8C\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\n */\nexport function quadraticSubdivide(p0: number, p1: number, p2: number, t: number, out: number[]) {\n const p01 = (p1 - p0) * t + p0;\n const p12 = (p2 - p1) * t + p1;\n const p012 = (p12 - p01) * t + p01;\n\n // Seg0\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n\n // Seg1\n out[3] = p012;\n out[4] = p12;\n out[5] = p2;\n}\n\n/**\n * \u6295\u5C04\u70B9\u5230\u4E8C\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\u4E0A\uFF0C\u8FD4\u56DE\u6295\u5C04\u8DDD\u79BB\u3002\n * \u6295\u5C04\u70B9\u6709\u53EF\u80FD\u4F1A\u6709\u4E00\u4E2A\u6216\u8005\u591A\u4E2A\uFF0C\u8FD9\u91CC\u53EA\u8FD4\u56DE\u5176\u4E2D\u8DDD\u79BB\u6700\u77ED\u7684\u4E00\u4E2A\u3002\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x\n * @param {number} y\n * @param {Array.} out \u6295\u5C04\u70B9\n * @return {number}\n */\nexport function quadraticProjectPoint(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number,\n x: number, y: number, out: VectorArray\n): number {\n // http://pomax.github.io/bezierinfo/#projections\n let t: number;\n let interval = 0.005;\n let d = Infinity;\n\n _v0[0] = x;\n _v0[1] = y;\n\n // \u5148\u7C97\u7565\u4F30\u8BA1\u4E00\u4E0B\u53EF\u80FD\u7684\u6700\u5C0F\u8DDD\u79BB\u7684 t \u503C\n // PENDING\n for (let _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = quadraticAt(x0, x1, x2, _t);\n _v1[1] = quadraticAt(y0, y1, y2, _t);\n const d1 = v2DistSquare(_v0, _v1);\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n\n // At most 32 iteration\n for (let i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n const prev = t - interval;\n const next = t + interval;\n // t - interval\n _v1[0] = quadraticAt(x0, x1, x2, prev);\n _v1[1] = quadraticAt(y0, y1, y2, prev);\n\n const d1 = v2DistSquare(_v1, _v0);\n\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n // t + interval\n _v2[0] = quadraticAt(x0, x1, x2, next);\n _v2[1] = quadraticAt(y0, y1, y2, next);\n const d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n // t\n if (out) {\n out[0] = quadraticAt(x0, x1, x2, t);\n out[1] = quadraticAt(y0, y1, y2, t);\n }\n // console.log(interval, i);\n return mathSqrt(d);\n}\n\n/**\n * \u8BA1\u7B97\u4E8C\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\u957F\u5EA6\n */\nexport function quadraticLength(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number,\n iteration: number\n) {\n let px = x0;\n let py = y0;\n\n let d = 0;\n\n const step = 1 / iteration;\n\n for (let i = 1; i <= iteration; i++) {\n let t = i * step;\n const x = quadraticAt(x0, x1, x2, t);\n const y = quadraticAt(y0, y1, y2, t);\n\n const dx = x - px;\n const dy = y - py;\n\n d += Math.sqrt(dx * dx + dy * dy);\n\n px = x;\n py = y;\n }\n\n return d;\n}\n", "import { cubicAt, cubicRootAt } from '../core/curve';\nimport { trim } from '../core/util';\n\nconst regexp = /cubic-bezier\\(([0-9,\\.e ]+)\\)/;\n\nexport function createCubicEasingFunc(cubicEasingStr: string) {\n const cubic = cubicEasingStr && regexp.exec(cubicEasingStr);\n if (cubic) {\n const points = cubic[1].split(',');\n const a = +trim(points[0]);\n const b = +trim(points[1]);\n const c = +trim(points[2]);\n const d = +trim(points[3]);\n\n if (isNaN(a + b + c + d)) {\n return;\n }\n\n const roots: number[] = [];\n return (p: number) => {\n return p <= 0\n ? 0 : p >= 1\n ? 1\n : cubicRootAt(0, a, c, 1, p, roots) && cubicAt(0, b, d, 1, roots[0]);\n };\n }\n}", "/**\n * \u52A8\u753B\u4E3B\u63A7\u5236\u5668\n * @config target \u52A8\u753B\u5BF9\u8C61\uFF0C\u53EF\u4EE5\u662F\u6570\u7EC4\uFF0C\u5982\u679C\u662F\u6570\u7EC4\u7684\u8BDD\u4F1A\u6279\u91CF\u5206\u53D1onframe\u7B49\u4E8B\u4EF6\n * @config life(1000) \u52A8\u753B\u65F6\u957F\n * @config delay(0) \u52A8\u753B\u5EF6\u8FDF\u65F6\u95F4\n * @config loop(true)\n * @config onframe\n * @config easing(optional)\n * @config ondestroy(optional)\n * @config onrestart(optional)\n *\n * TODO pause\n */\n\nimport easingFuncs, {AnimationEasing} from './easing';\nimport type Animation from './Animation';\nimport { isFunction, noop } from '../core/util';\nimport { createCubicEasingFunc } from './cubicEasing';\n\ntype OnframeCallback = (percent: number) => void;\ntype ondestroyCallback = () => void\ntype onrestartCallback = () => void\n\nexport type DeferredEventTypes = 'destroy' | 'restart'\n// type DeferredEventKeys = 'ondestroy' | 'onrestart'\n\nexport interface ClipProps {\n life?: number\n delay?: number\n loop?: boolean\n easing?: AnimationEasing\n\n onframe?: OnframeCallback\n ondestroy?: ondestroyCallback\n onrestart?: onrestartCallback\n}\n\nexport default class Clip {\n\n private _life: number\n private _delay: number\n\n private _inited: boolean = false\n private _startTime = 0 // \u5F00\u59CB\u65F6\u95F4\u5355\u4F4D\u6BEB\u79D2\n\n private _pausedTime = 0\n private _paused = false\n\n animation: Animation\n\n loop: boolean\n\n easing: AnimationEasing\n easingFunc: (p: number) => number\n\n // For linked list. Readonly\n next: Clip\n prev: Clip\n\n onframe: OnframeCallback\n ondestroy: ondestroyCallback\n onrestart: onrestartCallback\n\n constructor(opts: ClipProps) {\n\n this._life = opts.life || 1000;\n this._delay = opts.delay || 0;\n\n this.loop = opts.loop || false;\n\n this.onframe = opts.onframe || noop;\n this.ondestroy = opts.ondestroy || noop;\n this.onrestart = opts.onrestart || noop;\n\n opts.easing && this.setEasing(opts.easing);\n }\n\n step(globalTime: number, deltaTime: number): boolean {\n // Set startTime on first step, or _startTime may has milleseconds different between clips\n // PENDING\n if (!this._inited) {\n this._startTime = globalTime + this._delay;\n this._inited = true;\n }\n\n if (this._paused) {\n this._pausedTime += deltaTime;\n return;\n }\n\n const life = this._life;\n let elapsedTime = globalTime - this._startTime - this._pausedTime;\n let percent = elapsedTime / life;\n\n // PENDING: Not begin yet. Still run the loop.\n // In the case callback needs to be invoked.\n // Or want to update to the begin state at next frame when `setToFinal` and `delay` are both used.\n // To avoid the unexpected blink.\n if (percent < 0) {\n percent = 0;\n }\n\n percent = Math.min(percent, 1);\n\n const easingFunc = this.easingFunc;\n const schedule = easingFunc ? easingFunc(percent) : percent;\n\n this.onframe(schedule);\n\n // \u7ED3\u675F\n if (percent === 1) {\n if (this.loop) {\n // Restart\n const remainder = elapsedTime % life;\n this._startTime = globalTime - remainder;\n this._pausedTime = 0;\n\n this.onrestart();\n }\n else {\n return true;\n }\n }\n\n return false;\n }\n\n pause() {\n this._paused = true;\n }\n\n resume() {\n this._paused = false;\n }\n\n setEasing(easing: AnimationEasing) {\n this.easing = easing;\n this.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n }\n}", "import LRU from '../core/LRU';\nimport { extend, isGradientObject, isString, map } from '../core/util';\nimport { GradientObject } from '../graphic/Gradient';\n\nconst kCSSColorTable = {\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\n};\n\nfunction clampCssByte(i: number): number { // Clamp to integer 0 .. 255.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\n\nfunction clampCssAngle(i: number): number { // Clamp to integer 0 .. 360.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n return i < 0 ? 0 : i > 360 ? 360 : i;\n}\n\nfunction clampCssFloat(f: number): number { // Clamp to float 0.0 .. 1.0.\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\n\nfunction parseCssInt(val: string | number): number { // int or percentage.\n let str = val as string;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssByte(parseFloat(str) / 100 * 255);\n }\n return clampCssByte(parseInt(str, 10));\n}\n\nfunction parseCssFloat(val: string | number): number { // float or percentage.\n let str = val as string;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssFloat(parseFloat(str) / 100);\n }\n return clampCssFloat(parseFloat(str));\n}\n\nfunction cssHueToRgb(m1: number, m2: number, h: number): number {\n if (h < 0) {\n h += 1;\n }\n else if (h > 1) {\n h -= 1;\n }\n\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n}\n\nfunction lerpNumber(a: number, b: number, p: number): number {\n return a + (b - a) * p;\n}\n\nfunction setRgba(out: number[], r: number, g: number, b: number, a: number): number[] {\n out[0] = r;\n out[1] = g;\n out[2] = b;\n out[3] = a;\n return out;\n}\nfunction copyRgba(out: number[], a: number[]) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\nconst colorCache = new LRU(20);\nlet lastRemovedArr: number[] = null;\n\nfunction putToCache(colorStr: string, rgbaArr: number[]) {\n // Reuse removed array\n if (lastRemovedArr) {\n copyRgba(lastRemovedArr, rgbaArr);\n }\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\n}\n\nexport function parse(colorStr: string, rgbaArr?: number[]): number[] {\n if (!colorStr) {\n return;\n }\n rgbaArr = rgbaArr || [];\n\n let cached = colorCache.get(colorStr);\n if (cached) {\n return copyRgba(rgbaArr, cached);\n }\n\n // colorStr may be not string\n colorStr = colorStr + '';\n // Remove all whitespace, not compliant, but should just be more accepting.\n let str = colorStr.replace(/ /g, '').toLowerCase();\n\n // Color keywords (and transparent) lookup.\n if (str in kCSSColorTable) {\n copyRgba(rgbaArr, kCSSColorTable[str as keyof typeof kCSSColorTable]);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n\n // supports the forms #rgb, #rrggbb, #rgba, #rrggbbaa\n // #rrggbbaa(use the last pair of digits as alpha)\n // see https://drafts.csswg.org/css-color/#hex-notation\n const strLen = str.length;\n if (str.charAt(0) === '#') {\n if (strLen === 4 || strLen === 5) {\n const iv = parseInt(str.slice(1, 4), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xfff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return; // Covers NaN.\n }\n // interpret values of the form #rgb as #rrggbb and #rgba as #rrggbbaa\n setRgba(rgbaArr,\n ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),\n (iv & 0xf0) | ((iv & 0xf0) >> 4),\n (iv & 0xf) | ((iv & 0xf) << 4),\n strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1\n );\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else if (strLen === 7 || strLen === 9) {\n const iv = parseInt(str.slice(1, 7), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xffffff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return; // Covers NaN.\n }\n setRgba(rgbaArr,\n (iv & 0xff0000) >> 16,\n (iv & 0xff00) >> 8,\n iv & 0xff,\n strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1\n );\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n\n return;\n }\n let op = str.indexOf('(');\n let ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === strLen) {\n let fname = str.substr(0, op);\n let params: (number | string)[] = str.substr(op + 1, ep - (op + 1)).split(',');\n let alpha = 1; // To allow case fallthrough.\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) {\n return params.length === 3\n // to be compatible with rgb\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\n : setRgba(rgbaArr, 0, 0, 0, 1);\n }\n alpha = parseCssFloat(params.pop()); // jshint ignore:line\n // Fall through.\n case 'rgb':\n if (params.length >= 3) {\n setRgba(rgbaArr,\n parseCssInt(params[0]),\n parseCssInt(params[1]),\n parseCssInt(params[2]),\n params.length === 3 ? alpha : parseCssFloat(params[3])\n );\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n case 'hsla':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n params[3] = parseCssFloat(params[3]);\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n case 'hsl':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n default:\n return;\n }\n }\n\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n}\n\nfunction hsla2rgba(hsla: (number | string) [], rgba?: number[]): number[] {\n const h = (((parseFloat(hsla[0] as string) % 360) + 360) % 360) / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n const s = parseCssFloat(hsla[1]);\n const l = parseCssFloat(hsla[2]);\n const m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n const m1 = l * 2 - m2;\n\n rgba = rgba || [];\n setRgba(rgba,\n clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255),\n clampCssByte(cssHueToRgb(m1, m2, h) * 255),\n clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255),\n 1\n );\n\n if (hsla.length === 4) {\n rgba[3] = hsla[3] as number;\n }\n\n return rgba;\n}\n\nfunction rgba2hsla(rgba: number[]): number[] {\n if (!rgba) {\n return;\n }\n\n // RGB from 0 to 255\n const R = rgba[0] / 255;\n const G = rgba[1] / 255;\n const B = rgba[2] / 255;\n\n const vMin = Math.min(R, G, B); // Min. value of RGB\n const vMax = Math.max(R, G, B); // Max. value of RGB\n const delta = vMax - vMin; // Delta RGB value\n\n const L = (vMax + vMin) / 2;\n let H;\n let S;\n // HSL results from 0 to 1\n if (delta === 0) {\n H = 0;\n S = 0;\n }\n else {\n if (L < 0.5) {\n S = delta / (vMax + vMin);\n }\n else {\n S = delta / (2 - vMax - vMin);\n }\n\n const deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;\n const deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;\n const deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;\n\n if (R === vMax) {\n H = deltaB - deltaG;\n }\n else if (G === vMax) {\n H = (1 / 3) + deltaR - deltaB;\n }\n else if (B === vMax) {\n H = (2 / 3) + deltaG - deltaR;\n }\n\n if (H < 0) {\n H += 1;\n }\n\n if (H > 1) {\n H -= 1;\n }\n }\n\n const hsla = [H * 360, S, L];\n\n if (rgba[3] != null) {\n hsla.push(rgba[3]);\n }\n\n return hsla;\n}\n\nexport function lift(color: string, level: number) {\n const colorArr = parse(color);\n if (colorArr) {\n for (let i = 0; i < 3; i++) {\n if (level < 0) {\n colorArr[i] = colorArr[i] * (1 - level) | 0;\n }\n else {\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\n }\n if (colorArr[i] > 255) {\n colorArr[i] = 255;\n }\n else if (colorArr[i] < 0) {\n colorArr[i] = 0;\n }\n }\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n }\n}\n\nexport function toHex(color: string): string {\n const colorArr = parse(color);\n if (colorArr) {\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\n }\n}\n\n/**\n * Map value to color. Faster than lerp methods because color is represented by rgba array.\n * @param normalizedValue A float between 0 and 1.\n * @param colors List of rgba color array\n * @param out Mapped gba color array\n * @return will be null/undefined if input illegal.\n */\nexport function fastLerp(\n normalizedValue: number,\n colors: number[][],\n out?: number[]\n): number[] {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)\n ) {\n return;\n }\n\n out = out || [];\n\n const value = normalizedValue * (colors.length - 1);\n const leftIndex = Math.floor(value);\n const rightIndex = Math.ceil(value);\n const leftColor = colors[leftIndex];\n const rightColor = colors[rightIndex];\n const dv = value - leftIndex;\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\n\n return out;\n}\n\n/**\n * @deprecated\n */\nexport const fastMapToColor = fastLerp;\n\ntype LerpFullOutput = {\n color: string\n leftIndex: number\n rightIndex: number\n value: number\n}\n/**\n * @param normalizedValue A float between 0 and 1.\n * @param colors Color list.\n * @param fullOutput Default false.\n * @return Result color. If fullOutput,\n return {color: ..., leftIndex: ..., rightIndex: ..., value: ...},\n */\nexport function lerp(\n normalizedValue: number,\n colors: string[],\n fullOutput: boolean\n): LerpFullOutput\nexport function lerp(\n normalizedValue: number,\n colors: string[]\n): string\nexport function lerp(\n normalizedValue: number,\n colors: string[],\n fullOutput?: boolean\n): string | LerpFullOutput {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)\n ) {\n return;\n }\n\n const value = normalizedValue * (colors.length - 1);\n const leftIndex = Math.floor(value);\n const rightIndex = Math.ceil(value);\n const leftColor = parse(colors[leftIndex]);\n const rightColor = parse(colors[rightIndex]);\n const dv = value - leftIndex;\n\n const color = stringify(\n [\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\n ],\n 'rgba'\n );\n\n return fullOutput\n ? {\n color: color,\n leftIndex: leftIndex,\n rightIndex: rightIndex,\n value: value\n }\n : color;\n}\n\n/**\n * @deprecated\n */\nexport const mapToColor = lerp;\n\n/**\n * @param color\n * @param h 0 ~ 360, ignore when null.\n * @param s 0 ~ 1, ignore when null.\n * @param l 0 ~ 1, ignore when null.\n * @return Color string in rgba format.\n * @memberOf module:zrender/util/color\n */\nexport function modifyHSL(color: string, h?: number, s?: number, l?: number): string {\n let colorArr = parse(color);\n\n if (color) {\n colorArr = rgba2hsla(colorArr);\n h != null && (colorArr[0] = clampCssAngle(h));\n s != null && (colorArr[1] = parseCssFloat(s));\n l != null && (colorArr[2] = parseCssFloat(l));\n\n return stringify(hsla2rgba(colorArr), 'rgba');\n }\n}\n\n/**\n * @param color\n * @param alpha 0 ~ 1\n * @return Color string in rgba format.\n * @memberOf module:zrender/util/color\n */\nexport function modifyAlpha(color: string, alpha?: number): string {\n const colorArr = parse(color);\n\n if (colorArr && alpha != null) {\n colorArr[3] = clampCssFloat(alpha);\n return stringify(colorArr, 'rgba');\n }\n}\n\n/**\n * @param arrColor like [12,33,44,0.4]\n * @param type 'rgba', 'hsva', ...\n * @return Result color. (If input illegal, return undefined).\n */\nexport function stringify(arrColor: number[], type: string): string {\n if (!arrColor || !arrColor.length) {\n return;\n }\n let colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n colorStr += ',' + arrColor[3];\n }\n return type + '(' + colorStr + ')';\n}\n\n/**\n * Calculate luminance. It will include alpha.\n */\nexport function lum(color: string, backgroundLum: number) {\n const arr = parse(color);\n return arr\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\n + (1 - arr[3]) * backgroundLum // Blending with assumed white background.\n : 0;\n}\n\n/**\n * Generate a random color\n */\nexport function random(): string {\n return stringify([\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255)\n ], 'rgb');\n}\n\nconst liftedColorCache = new LRU(100);\nexport function liftColor(color: GradientObject): GradientObject;\nexport function liftColor(color: string): string;\nexport function liftColor(color: string | GradientObject): string | GradientObject {\n if (isString(color)) {\n let liftedColor = liftedColorCache.get(color);\n if (!liftedColor) {\n liftedColor = lift(color, -0.1);\n liftedColorCache.put(color, liftedColor);\n }\n return liftedColor;\n }\n else if (isGradientObject(color)) {\n const ret = extend({}, color) as GradientObject;\n ret.colorStops = map(color.colorStops, stop => ({\n offset: stop.offset,\n color: lift(stop.color, -0.1)\n }));\n return ret;\n }\n // Change nothing.\n return color;\n}\n", "import { Dictionary } from './types';\n\n// Simple LRU cache use doubly linked list\n// @module zrender/core/LRU\n\nexport class Entry {\n\n value: T\n\n key: string | number\n\n next: Entry\n\n prev: Entry\n\n constructor(val: T) {\n this.value = val;\n }\n}\n/**\n * Simple double linked list. Compared with array, it has O(1) remove operation.\n * @constructor\n */\nexport class LinkedList {\n\n head: Entry\n tail: Entry\n\n private _len = 0\n\n /**\n * Insert a new value at the tail\n */\n insert(val: T): Entry {\n const entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n }\n\n /**\n * Insert an entry at the tail\n */\n insertEntry(entry: Entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n }\n else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n this._len++;\n }\n\n /**\n * Remove entry.\n */\n remove(entry: Entry) {\n const prev = entry.prev;\n const next = entry.next;\n if (prev) {\n prev.next = next;\n }\n else {\n // Is head\n this.head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n // Is tail\n this.tail = prev;\n }\n entry.next = entry.prev = null;\n this._len--;\n }\n\n /**\n * Get length\n */\n len(): number {\n return this._len;\n }\n\n /**\n * Clear list\n */\n clear() {\n this.head = this.tail = null;\n this._len = 0;\n }\n\n}\n\n/**\n * LRU Cache\n */\nexport default class LRU {\n\n private _list = new LinkedList()\n\n private _maxSize = 10\n\n private _lastRemovedEntry: Entry\n\n private _map: Dictionary> = {}\n\n constructor(maxSize: number) {\n this._maxSize = maxSize;\n }\n\n /**\n * @return Removed value\n */\n put(key: string | number, value: T): T {\n const list = this._list;\n const map = this._map;\n let removed = null;\n if (map[key] == null) {\n const len = list.len();\n // Reuse last removed entry\n let entry = this._lastRemovedEntry;\n\n if (len >= this._maxSize && len > 0) {\n // Remove the least recently used\n const leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n\n if (entry) {\n entry.value = value;\n }\n else {\n entry = new Entry(value);\n }\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n\n return removed;\n }\n\n get(key: string | number): T {\n const entry = this._map[key];\n const list = this._list;\n if (entry != null) {\n // Put the latest used entry in the tail\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n\n return entry.value;\n }\n }\n\n /**\n * Clear the cache\n */\n clear() {\n this._list.clear();\n this._map = {};\n }\n\n len() {\n return this._list.len();\n }\n}", "// Shared methods of svg and svg-ssr\n\nimport { MatrixArray } from '../core/matrix';\nimport Transformable, { TransformProp } from '../core/Transformable';\nimport { RADIAN_TO_DEGREE, retrieve2, logError, isFunction } from '../core/util';\nimport Displayable from '../graphic/Displayable';\nimport { GradientObject } from '../graphic/Gradient';\nimport { LinearGradientObject } from '../graphic/LinearGradient';\nimport Path from '../graphic/Path';\nimport { ImagePatternObject, PatternObject, SVGPatternObject } from '../graphic/Pattern';\nimport { RadialGradientObject } from '../graphic/RadialGradient';\nimport { parse } from '../tool/color';\nimport env from '../core/env';\n\nconst mathRound = Math.round;\n\nexport function normalizeColor(color: string): { color: string; opacity: number; } {\n let opacity;\n if (!color || color === 'transparent') {\n color = 'none';\n }\n else if (typeof color === 'string' && color.indexOf('rgba') > -1) {\n const arr = parse(color);\n if (arr) {\n // TODO use hex?\n color = 'rgb(' + arr[0] + ',' + arr[1] + ',' + arr[2] + ')';\n opacity = arr[3];\n }\n }\n return {\n color,\n opacity: opacity == null ? 1 : opacity\n };\n}\nconst EPSILON = 1e-4;\nexport function isAroundZero(transform: number) {\n return transform < EPSILON && transform > -EPSILON;\n}\n\nexport function round3(transform: number) {\n return mathRound(transform * 1e3) / 1e3;\n}\nexport function round4(transform: number) {\n return mathRound(transform * 1e4) / 1e4;\n}\nexport function round1(transform: number) {\n return mathRound(transform * 10) / 10;\n}\n\nexport function getMatrixStr(m: MatrixArray) {\n return 'matrix('\n // Avoid large string of matrix\n // PENDING If have precision issue when scaled\n + round3(m[0]) + ','\n + round3(m[1]) + ','\n + round3(m[2]) + ','\n + round3(m[3]) + ','\n + round4(m[4]) + ','\n + round4(m[5])\n + ')';\n}\n\nexport const TEXT_ALIGN_TO_ANCHOR = {\n left: 'start',\n right: 'end',\n center: 'middle',\n middle: 'middle'\n};\n\nexport function adjustTextY(y: number, lineHeight: number, textBaseline: CanvasTextBaseline): number {\n // TODO Other baselines.\n if (textBaseline === 'top') {\n y += lineHeight / 2;\n }\n else if (textBaseline === 'bottom') {\n y -= lineHeight / 2;\n }\n return y;\n}\n\n\nexport function hasShadow(style: Displayable['style']) {\n // TODO: textBoxShadowBlur is not supported yet\n return style\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\n}\n\nexport function getShadowKey(displayable: Displayable) {\n const style = displayable.style;\n const globalScale = displayable.getGlobalScale();\n return [\n style.shadowColor,\n (style.shadowBlur || 0).toFixed(2), // Reduce the precision\n (style.shadowOffsetX || 0).toFixed(2),\n (style.shadowOffsetY || 0).toFixed(2),\n globalScale[0],\n globalScale[1]\n ].join(',');\n}\n\nexport function getClipPathsKey(clipPaths: Path[]) {\n let key: number[] = [];\n if (clipPaths) {\n for (let i = 0; i < clipPaths.length; i++) {\n const clipPath = clipPaths[i];\n key.push(clipPath.id);\n }\n }\n return key.join(',');\n}\n\nexport function isImagePattern(val: any): val is ImagePatternObject {\n return val && (!!(val as ImagePatternObject).image);\n}\nexport function isSVGPattern(val: any): val is SVGPatternObject {\n return val && (!!(val as SVGPatternObject).svgElement);\n}\nexport function isPattern(val: any): val is PatternObject {\n return isImagePattern(val) || isSVGPattern(val);\n}\n\nexport function isLinearGradient(val: GradientObject): val is LinearGradientObject {\n return val.type === 'linear';\n}\n\nexport function isRadialGradient(val: GradientObject): val is RadialGradientObject {\n return val.type === 'radial';\n}\n\nexport function isGradient(val: any): val is GradientObject {\n return val && (\n (val as GradientObject).type === 'linear'\n || (val as GradientObject).type === 'radial'\n );\n}\n\nexport function getIdURL(id: string) {\n return `url(#${id})`;\n}\n\nexport function getPathPrecision(el: Path) {\n const scale = el.getGlobalScale();\n const size = Math.max(scale[0], scale[1]);\n return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1);\n}\n\nexport function getSRTTransformString(\n transform: Partial>\n) {\n const x = transform.x || 0;\n const y = transform.y || 0;\n const rotation = (transform.rotation || 0) * RADIAN_TO_DEGREE;\n const scaleX = retrieve2(transform.scaleX, 1);\n const scaleY = retrieve2(transform.scaleY, 1);\n const skewX = transform.skewX || 0;\n const skewY = transform.skewY || 0;\n const res = [];\n if (x || y) {\n // TODO not using px unit?\n res.push(`translate(${x}px,${y}px)`);\n }\n if (rotation) {\n res.push(`rotate(${rotation})`);\n }\n if (scaleX !== 1 || scaleY !== 1) {\n res.push(`scale(${scaleX},${scaleY})`);\n }\n if (skewX || skewY) {\n res.push(`skew(${mathRound(skewX * RADIAN_TO_DEGREE)}deg, ${mathRound(skewY * RADIAN_TO_DEGREE)}deg)`);\n }\n\n return res.join(' ');\n}\n\nexport const encodeBase64 = (function () {\n if (env.hasGlobalWindow && isFunction(window.btoa)) {\n return function (str: string) {\n return window.btoa(unescape(encodeURIComponent(str)));\n };\n }\n if (typeof Buffer !== 'undefined') {\n return function (str: string) {\n return Buffer.from(str).toString('base64');\n };\n }\n return function (str: string): string {\n if (process.env.NODE_ENV !== 'production') {\n logError('Base64 isn\\'t natively supported in the current environment.');\n }\n return null;\n };\n})();", "/**\n * @module echarts/animation/Animator\n */\n\nimport Clip from './Clip';\nimport * as color from '../tool/color';\nimport {\n eqNaN,\n extend,\n isArrayLike,\n isFunction,\n isGradientObject,\n isNumber,\n isString,\n keys,\n logError,\n map\n} from '../core/util';\nimport {ArrayLike, Dictionary} from '../core/types';\nimport easingFuncs, { AnimationEasing } from './easing';\nimport Animation from './Animation';\nimport { createCubicEasingFunc } from './cubicEasing';\nimport { isLinearGradient, isRadialGradient } from '../svg/helper';\n\ntype NumberArray = ArrayLike\ntype InterpolatableType = string | number | NumberArray | NumberArray[];\n\ninterface ParsedColorStop {\n color: number[],\n offset: number\n};\n\ninterface ParsedGradientObject {\n colorStops: ParsedColorStop[]\n x: number\n y: number\n global: boolean\n}\ninterface ParsedLinearGradientObject extends ParsedGradientObject {\n x2: number\n y2: number\n}\ninterface ParsedRadialGradientObject extends ParsedGradientObject {\n r: number\n}\n\nconst arraySlice = Array.prototype.slice;\n\nfunction interpolateNumber(p0: number, p1: number, percent: number): number {\n return (p1 - p0) * percent + p0;\n}\nfunction interpolate1DArray(\n out: NumberArray,\n p0: NumberArray,\n p1: NumberArray,\n percent: number\n) {\n // TODO Handling different length TypedArray\n const len = p0.length;\n for (let i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n return out;\n}\n\nfunction interpolate2DArray(\n out: NumberArray[],\n p0: NumberArray[],\n p1: NumberArray[],\n percent: number\n) {\n const len = p0.length;\n // TODO differnt length on each item?\n const len2 = len && p0[0].length;\n for (let i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (let j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n return out;\n}\n\nfunction add1DArray(\n out: NumberArray,\n p0: NumberArray,\n p1: NumberArray,\n sign: 1 | -1\n) {\n const len = p0.length;\n for (let i = 0; i < len; i++) {\n out[i] = p0[i] + p1[i] * sign;\n }\n return out;\n}\n\nfunction add2DArray(\n out: NumberArray[],\n p0: NumberArray[],\n p1: NumberArray[],\n sign: 1 | -1\n) {\n const len = p0.length;\n const len2 = len && p0[0].length;\n for (let i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (let j = 0; j < len2; j++) {\n out[i][j] = p0[i][j] + p1[i][j] * sign;\n }\n }\n return out;\n}\n\nfunction fillColorStops(val0: ParsedColorStop[], val1: ParsedColorStop[]) {\n const len0 = val0.length;\n const len1 = val1.length;\n\n const shorterArr = len0 > len1 ? val1 : val0;\n const shorterLen = Math.min(len0, len1);\n const last = shorterArr[shorterLen - 1] || { color: [0, 0, 0, 0], offset: 0 };\n for (let i = shorterLen; i < Math.max(len0, len1); i++) {\n // Use last color stop to fill the shorter array\n shorterArr.push({\n offset: last.offset,\n color: last.color.slice()\n });\n }\n}\n// arr0 is source array, arr1 is target array.\n// Do some preprocess to avoid error happened when interpolating from arr0 to arr1\nfunction fillArray(\n val0: NumberArray | NumberArray[],\n val1: NumberArray | NumberArray[],\n arrDim: 1 | 2\n) {\n // TODO Handling different length TypedArray\n let arr0 = val0 as (number | number[])[];\n let arr1 = val1 as (number | number[])[];\n if (!arr0.push || !arr1.push) {\n return;\n }\n const arr0Len = arr0.length;\n const arr1Len = arr1.length;\n if (arr0Len !== arr1Len) {\n // FIXME Not work for TypedArray\n const isPreviousLarger = arr0Len > arr1Len;\n if (isPreviousLarger) {\n // Cut the previous\n arr0.length = arr1Len;\n }\n else {\n // Fill the previous\n for (let i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n }\n // Handling NaN value\n const len2 = arr0[0] && (arr0[0] as number[]).length;\n for (let i = 0; i < arr0.length; i++) {\n if (arrDim === 1) {\n if (isNaN(arr0[i] as number)) {\n arr0[i] = arr1[i];\n }\n }\n else {\n for (let j = 0; j < len2; j++) {\n if (isNaN((arr0 as number[][])[i][j])) {\n (arr0 as number[][])[i][j] = (arr1 as number[][])[i][j];\n }\n }\n }\n }\n}\n\nexport function cloneValue(value: InterpolatableType) {\n if (isArrayLike(value)) {\n const len = value.length;\n if (isArrayLike(value[0])) {\n const ret = [];\n for (let i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n return ret;\n }\n\n return arraySlice.call(value);\n }\n\n return value;\n}\n\nfunction rgba2String(rgba: number[]): string {\n rgba[0] = Math.floor(rgba[0]) || 0;\n rgba[1] = Math.floor(rgba[1]) || 0;\n rgba[2] = Math.floor(rgba[2]) || 0;\n rgba[3] = rgba[3] == null ? 1 : rgba[3];\n\n return 'rgba(' + rgba.join(',') + ')';\n}\n\nfunction guessArrayDim(value: ArrayLike): 1 | 2 {\n return isArrayLike(value && (value as ArrayLike)[0]) ? 2 : 1;\n}\n\nconst VALUE_TYPE_NUMBER = 0;\nconst VALUE_TYPE_1D_ARRAY = 1;\nconst VALUE_TYPE_2D_ARRAY = 2;\nconst VALUE_TYPE_COLOR = 3;\nconst VALUE_TYPE_LINEAR_GRADIENT = 4;\nconst VALUE_TYPE_RADIAL_GRADIENT = 5;\n// Other value type that can only use discrete animation.\nconst VALUE_TYPE_UNKOWN = 6;\n\ntype ValueType = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\ntype Keyframe = {\n time: number\n value: unknown\n percent: number\n // Raw value for discrete animation.\n rawValue: unknown\n\n easing?: AnimationEasing // Raw easing\n easingFunc?: (percent: number) => number\n additiveValue?: unknown\n}\n\n\nfunction isGradientValueType(valType: ValueType): valType is 4 | 5 {\n return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT;\n}\nfunction isArrayValueType(valType: ValueType): valType is 1 | 2 {\n return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY;\n}\n\n\nlet tmpRgba: number[] = [0, 0, 0, 0];\n\nclass Track {\n\n keyframes: Keyframe[] = []\n\n propName: string\n\n valType: ValueType\n\n discrete: boolean = false\n\n _invalid: boolean = false;\n\n private _finished: boolean\n\n private _needsSort: boolean = false\n\n private _additiveTrack: Track\n // Temporal storage for interpolated additive value.\n private _additiveValue: unknown\n\n // Info for run\n /**\n * Last frame\n */\n private _lastFr = 0\n /**\n * Percent of last frame.\n */\n private _lastFrP = 0\n\n constructor(propName: string) {\n this.propName = propName;\n }\n\n isFinished() {\n return this._finished;\n }\n\n setFinished() {\n this._finished = true;\n // Also set additive track to finished.\n // Make sure the final value stopped on the latest track\n if (this._additiveTrack) {\n this._additiveTrack.setFinished();\n }\n }\n\n needsAnimate() {\n return this.keyframes.length >= 1;\n }\n\n getAdditiveTrack() {\n return this._additiveTrack;\n }\n\n addKeyframe(time: number, rawValue: unknown, easing?: AnimationEasing) {\n this._needsSort = true;\n\n let keyframes = this.keyframes;\n let len = keyframes.length;\n\n let discrete = false;\n let valType: ValueType = VALUE_TYPE_UNKOWN;\n let value = rawValue;\n\n // Handling values only if it's possible to be interpolated.\n if (isArrayLike(rawValue)) {\n let arrayDim = guessArrayDim(rawValue);\n valType = arrayDim;\n // Not a number array.\n if (arrayDim === 1 && !isNumber(rawValue[0])\n || arrayDim === 2 && !isNumber(rawValue[0][0])) {\n discrete = true;\n }\n }\n else {\n if (isNumber(rawValue) && !eqNaN(rawValue)) {\n valType = VALUE_TYPE_NUMBER;\n }\n else if (isString(rawValue)) {\n if (!isNaN(+rawValue)) { // Can be string number like '2'\n valType = VALUE_TYPE_NUMBER;\n }\n else {\n const colorArray = color.parse(rawValue);\n if (colorArray) {\n value = colorArray;\n valType = VALUE_TYPE_COLOR;\n }\n }\n }\n else if (isGradientObject(rawValue)) {\n // TODO Color to gradient or gradient to color.\n const parsedGradient = extend({}, value) as unknown as ParsedGradientObject;\n parsedGradient.colorStops = map(rawValue.colorStops, colorStop => ({\n offset: colorStop.offset,\n color: color.parse(colorStop.color)\n }));\n if (isLinearGradient(rawValue)) {\n valType = VALUE_TYPE_LINEAR_GRADIENT;\n }\n else if (isRadialGradient(rawValue)) {\n valType = VALUE_TYPE_RADIAL_GRADIENT;\n }\n value = parsedGradient;\n }\n }\n\n if (len === 0) {\n // Inference type from the first keyframe.\n this.valType = valType;\n }\n // Not same value type or can't be interpolated.\n else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) {\n discrete = true;\n }\n\n this.discrete = this.discrete || discrete;\n\n const kf: Keyframe = {\n time,\n value,\n rawValue,\n percent: 0\n };\n if (easing) {\n // Save the raw easing name to be used in css animation output\n kf.easing = easing;\n kf.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n }\n // Not check if value equal here.\n keyframes.push(kf);\n return kf;\n }\n\n prepare(maxTime: number, additiveTrack?: Track) {\n let kfs = this.keyframes;\n if (this._needsSort) {\n // Sort keyframe as ascending\n kfs.sort(function (a: Keyframe, b: Keyframe) {\n return a.time - b.time;\n });\n }\n\n const valType = this.valType;\n const kfsLen = kfs.length;\n const lastKf = kfs[kfsLen - 1];\n const isDiscrete = this.discrete;\n const isArr = isArrayValueType(valType);\n const isGradient = isGradientValueType(valType);\n\n for (let i = 0; i < kfsLen; i++) {\n const kf = kfs[i];\n const value = kf.value;\n const lastValue = lastKf.value;\n kf.percent = kf.time / maxTime;\n if (!isDiscrete) {\n if (isArr && i !== kfsLen - 1) {\n // Align array with target frame.\n fillArray(value as NumberArray, lastValue as NumberArray, valType);\n }\n else if (isGradient) {\n fillColorStops(\n (value as ParsedLinearGradientObject).colorStops,\n (lastValue as ParsedLinearGradientObject).colorStops\n );\n }\n }\n }\n\n // Only apply additive animaiton on INTERPOLABLE SAME TYPE values.\n if (\n !isDiscrete\n // TODO support gradient\n && valType !== VALUE_TYPE_RADIAL_GRADIENT\n && additiveTrack\n // If two track both will be animated and have same value format.\n && this.needsAnimate()\n && additiveTrack.needsAnimate()\n && valType === additiveTrack.valType\n && !additiveTrack._finished\n ) {\n this._additiveTrack = additiveTrack;\n\n const startValue = kfs[0].value;\n // Calculate difference\n for (let i = 0; i < kfsLen; i++) {\n if (valType === VALUE_TYPE_NUMBER) {\n kfs[i].additiveValue = kfs[i].value as number - (startValue as number);\n }\n else if (valType === VALUE_TYPE_COLOR) {\n kfs[i].additiveValue =\n add1DArray([], kfs[i].value as NumberArray, startValue as NumberArray, -1);\n }\n else if (isArrayValueType(valType)) {\n kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY\n ? add1DArray([], kfs[i].value as NumberArray, startValue as NumberArray, -1)\n : add2DArray([], kfs[i].value as NumberArray[], startValue as NumberArray[], -1);\n }\n }\n }\n }\n\n step(target: any, percent: number) {\n if (this._finished) { // Track may be set to finished.\n return;\n }\n\n if (this._additiveTrack && this._additiveTrack._finished) {\n // Remove additive track if it's finished.\n this._additiveTrack = null;\n }\n const isAdditive = this._additiveTrack != null;\n const valueKey = isAdditive ? 'additiveValue' : 'value';\n\n const valType = this.valType;\n const keyframes = this.keyframes;\n const kfsNum = keyframes.length;\n const propName = this.propName;\n const isValueColor = valType === VALUE_TYPE_COLOR;\n // Find the range keyframes\n // kf1-----kf2---------current--------kf3\n // find kf2 and kf3 and do interpolation\n let frameIdx;\n const lastFrame = this._lastFr;\n const mathMin = Math.min;\n let frame;\n let nextFrame;\n if (kfsNum === 1) {\n frame = nextFrame = keyframes[0];\n }\n else {\n // In the easing function like elasticOut, percent may less than 0\n if (percent < 0) {\n frameIdx = 0;\n }\n else if (percent < this._lastFrP) {\n // Start from next key\n // PENDING start from lastFrame ?\n const start = mathMin(lastFrame + 1, kfsNum - 1);\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\n if (keyframes[frameIdx].percent <= percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx, kfsNum - 2);\n }\n else {\n for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) {\n if (keyframes[frameIdx].percent > percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx - 1, kfsNum - 2);\n }\n\n nextFrame = keyframes[frameIdx + 1];\n frame = keyframes[frameIdx];\n }\n\n // Defensive coding.\n if (!(frame && nextFrame)) {\n return;\n }\n\n this._lastFr = frameIdx;\n this._lastFrP = percent;\n\n const interval = (nextFrame.percent - frame.percent);\n let w = interval === 0 ? 1 : mathMin((percent - frame.percent) / interval, 1);\n\n // Apply different easing of each keyframe.\n // Use easing specified in target frame.\n if (nextFrame.easingFunc) {\n w = nextFrame.easingFunc(w);\n }\n\n // If value is arr\n let targetArr = isAdditive ? this._additiveValue\n : (isValueColor ? tmpRgba : target[propName]);\n\n if ((isArrayValueType(valType) || isValueColor) && !targetArr) {\n targetArr = this._additiveValue = [];\n }\n\n if (this.discrete) {\n // use raw value without parse in discrete animation.\n target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue;\n }\n else if (isArrayValueType(valType)) {\n valType === VALUE_TYPE_1D_ARRAY\n ? interpolate1DArray(\n targetArr as NumberArray,\n frame[valueKey] as NumberArray,\n nextFrame[valueKey] as NumberArray,\n w\n )\n : interpolate2DArray(\n targetArr as NumberArray[],\n frame[valueKey] as NumberArray[],\n nextFrame[valueKey] as NumberArray[],\n w\n );\n }\n else if (isGradientValueType(valType)) {\n const val = frame[valueKey] as ParsedGradientObject;\n const nextVal = nextFrame[valueKey] as ParsedGradientObject;\n const isLinearGradient = valType === VALUE_TYPE_LINEAR_GRADIENT;\n target[propName] = {\n type: isLinearGradient ? 'linear' : 'radial',\n x: interpolateNumber(val.x, nextVal.x, w),\n y: interpolateNumber(val.y, nextVal.y, w),\n // TODO performance\n colorStops: map(val.colorStops, (colorStop, idx) => {\n const nextColorStop = nextVal.colorStops[idx];\n return {\n offset: interpolateNumber(colorStop.offset, nextColorStop.offset, w),\n color: rgba2String(interpolate1DArray(\n [] as number[], colorStop.color, nextColorStop.color, w\n ) as number[])\n };\n }),\n global: nextVal.global\n };\n if (isLinearGradient) {\n // Linear\n target[propName].x2 = interpolateNumber(\n (val as ParsedLinearGradientObject).x2, (nextVal as ParsedLinearGradientObject).x2, w\n );\n target[propName].y2 = interpolateNumber(\n (val as ParsedLinearGradientObject).y2, (nextVal as ParsedLinearGradientObject).y2, w\n );\n }\n else {\n // Radial\n target[propName].r = interpolateNumber(\n (val as ParsedRadialGradientObject).r, (nextVal as ParsedRadialGradientObject).r, w\n );\n }\n }\n else if (isValueColor) {\n interpolate1DArray(\n targetArr,\n frame[valueKey] as NumberArray,\n nextFrame[valueKey] as NumberArray,\n w\n );\n if (!isAdditive) { // Convert to string later:)\n target[propName] = rgba2String(targetArr);\n }\n }\n else {\n const value = interpolateNumber(frame[valueKey] as number, nextFrame[valueKey] as number, w);\n if (isAdditive) {\n this._additiveValue = value;\n }\n else {\n target[propName] = value;\n }\n }\n\n // Add additive to target\n if (isAdditive) {\n this._addToTarget(target);\n }\n }\n\n private _addToTarget(target: any) {\n const valType = this.valType;\n const propName = this.propName;\n const additiveValue = this._additiveValue;\n\n if (valType === VALUE_TYPE_NUMBER) {\n // Add a difference value based on the change of previous frame.\n target[propName] = target[propName] + additiveValue;\n }\n else if (valType === VALUE_TYPE_COLOR) {\n // TODO reduce unnecessary parse\n color.parse(target[propName], tmpRgba);\n add1DArray(tmpRgba, tmpRgba, additiveValue as NumberArray, 1);\n target[propName] = rgba2String(tmpRgba);\n }\n else if (valType === VALUE_TYPE_1D_ARRAY) {\n add1DArray(target[propName], target[propName], additiveValue as NumberArray, 1);\n }\n else if (valType === VALUE_TYPE_2D_ARRAY) {\n add2DArray(target[propName], target[propName], additiveValue as NumberArray[], 1);\n }\n }\n}\n\n\ntype DoneCallback = () => void;\ntype AbortCallback = () => void;\nexport type OnframeCallback = (target: T, percent: number) => void;\n\nexport type AnimationPropGetter = (target: T, key: string) => InterpolatableType;\nexport type AnimationPropSetter = (target: T, key: string, value: InterpolatableType) => void;\n\nexport default class Animator {\n\n animation?: Animation\n\n targetName?: string\n\n scope?: string\n\n __fromStateTransition?: string\n\n private _tracks: Dictionary = {}\n private _trackKeys: string[] = []\n\n private _target: T\n\n private _loop: boolean\n private _delay: number\n private _maxTime = 0\n\n /**\n * If force run regardless of empty tracks when duration is set.\n */\n private _force: boolean;\n\n /**\n * If animator is paused\n * @default false\n */\n private _paused: boolean\n // 0: Not started\n // 1: Invoked started\n // 2: Has been run for at least one frame.\n private _started = 0\n\n /**\n * If allow discrete animation\n * @default false\n */\n private _allowDiscrete: boolean\n\n private _additiveAnimators: Animator[]\n\n private _doneCbs: DoneCallback[]\n private _onframeCbs: OnframeCallback[]\n\n private _abortedCbs: AbortCallback[]\n\n private _clip: Clip = null\n\n constructor(\n target: T,\n loop: boolean,\n allowDiscreteAnimation?: boolean, // If doing discrete animation on the values can't be interpolated\n additiveTo?: Animator[]\n ) {\n this._target = target;\n this._loop = loop;\n if (loop && additiveTo) {\n logError('Can\\' use additive animation on looped animation.');\n return;\n }\n this._additiveAnimators = additiveTo;\n\n this._allowDiscrete = allowDiscreteAnimation;\n }\n\n getMaxTime() {\n return this._maxTime;\n }\n\n getDelay() {\n return this._delay;\n }\n\n getLoop() {\n return this._loop;\n }\n\n getTarget() {\n return this._target;\n }\n\n /**\n * Target can be changed during animation\n * For example if style is changed during state change.\n * We need to change target to the new style object.\n */\n changeTarget(target: T) {\n this._target = target;\n }\n\n /**\n * Set Animation keyframe\n * @param time time of keyframe in ms\n * @param props key-value props of keyframe.\n * @param easing\n */\n when(time: number, props: Dictionary, easing?: AnimationEasing) {\n return this.whenWithKeys(time, props, keys(props) as string[], easing);\n }\n\n\n // Fast path for add keyframes of aniamteTo\n whenWithKeys(time: number, props: Dictionary, propNames: string[], easing?: AnimationEasing) {\n const tracks = this._tracks;\n for (let i = 0; i < propNames.length; i++) {\n const propName = propNames[i];\n\n let track = tracks[propName];\n if (!track) {\n track = tracks[propName] = new Track(propName);\n\n let initialValue;\n const additiveTrack = this._getAdditiveTrack(propName);\n if (additiveTrack) {\n const addtiveTrackKfs = additiveTrack.keyframes;\n const lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1];\n // Use the last state of additived animator.\n initialValue = lastFinalKf && lastFinalKf.value;\n if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) {\n // Convert to rgba string\n initialValue = rgba2String(initialValue as number[]);\n }\n }\n else {\n initialValue = (this._target as any)[propName];\n }\n // Invalid value\n if (initialValue == null) {\n // zrLog('Invalid property ' + propName);\n continue;\n }\n // If time is <= 0\n // Then props is given initialize value\n // Note: initial percent can be negative, which means the initial value is before the animation start.\n // Else\n // Initialize value from current prop value\n if (time > 0) {\n track.addKeyframe(0, cloneValue(initialValue), easing);\n }\n\n this._trackKeys.push(propName);\n }\n track.addKeyframe(time, cloneValue(props[propName]), easing);\n }\n this._maxTime = Math.max(this._maxTime, time);\n return this;\n }\n\n pause() {\n this._clip.pause();\n this._paused = true;\n }\n\n resume() {\n this._clip.resume();\n this._paused = false;\n }\n\n isPaused(): boolean {\n return !!this._paused;\n }\n\n /**\n * Set duration of animator.\n * Will run this duration regardless the track max time or if trackes exits.\n * @param duration\n * @returns\n */\n duration(duration: number) {\n this._maxTime = duration;\n this._force = true;\n return this;\n }\n\n private _doneCallback() {\n this._setTracksFinished();\n // Clear clip\n this._clip = null;\n\n const doneList = this._doneCbs;\n if (doneList) {\n const len = doneList.length;\n for (let i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n }\n }\n private _abortedCallback() {\n this._setTracksFinished();\n\n const animation = this.animation;\n const abortedList = this._abortedCbs;\n\n if (animation) {\n animation.removeClip(this._clip);\n }\n this._clip = null;\n\n if (abortedList) {\n for (let i = 0; i < abortedList.length; i++) {\n abortedList[i].call(this);\n }\n }\n }\n private _setTracksFinished() {\n const tracks = this._tracks;\n const tracksKeys = this._trackKeys;\n for (let i = 0; i < tracksKeys.length; i++) {\n tracks[tracksKeys[i]].setFinished();\n }\n }\n\n private _getAdditiveTrack(trackName: string): Track {\n let additiveTrack;\n const additiveAnimators = this._additiveAnimators;\n if (additiveAnimators) {\n for (let i = 0; i < additiveAnimators.length; i++) {\n const track = additiveAnimators[i].getTrack(trackName);\n if (track) {\n // Use the track of latest animator.\n additiveTrack = track;\n }\n }\n }\n return additiveTrack;\n }\n\n /**\n * Start the animation\n * @param easing\n * @return\n */\n start(easing?: AnimationEasing) {\n if (this._started > 0) {\n return;\n }\n this._started = 1;\n\n const self = this;\n\n const tracks: Track[] = [];\n const maxTime = this._maxTime || 0;\n for (let i = 0; i < this._trackKeys.length; i++) {\n const propName = this._trackKeys[i];\n const track = this._tracks[propName];\n const additiveTrack = this._getAdditiveTrack(propName);\n const kfs = track.keyframes;\n const kfsNum = kfs.length;\n track.prepare(maxTime, additiveTrack);\n if (track.needsAnimate()) {\n // Set value directly if discrete animation is not allowed.\n if (!this._allowDiscrete && track.discrete) {\n const lastKf = kfs[kfsNum - 1];\n // Set final value.\n if (lastKf) {\n // use raw value without parse.\n (self._target as any)[track.propName] = lastKf.rawValue;\n }\n track.setFinished();\n }\n else {\n tracks.push(track);\n }\n }\n }\n // Add during callback on the last clip\n if (tracks.length || this._force) {\n const clip = new Clip({\n life: maxTime,\n loop: this._loop,\n delay: this._delay || 0,\n onframe(percent: number) {\n self._started = 2;\n // Remove additived animator if it's finished.\n // For the purpose of memory effeciency.\n const additiveAnimators = self._additiveAnimators;\n if (additiveAnimators) {\n let stillHasAdditiveAnimator = false;\n for (let i = 0; i < additiveAnimators.length; i++) {\n if (additiveAnimators[i]._clip) {\n stillHasAdditiveAnimator = true;\n break;\n }\n }\n if (!stillHasAdditiveAnimator) {\n self._additiveAnimators = null;\n }\n }\n\n for (let i = 0; i < tracks.length; i++) {\n // NOTE: don't cache target outside.\n // Because target may be changed.\n tracks[i].step(self._target, percent);\n }\n\n const onframeList = self._onframeCbs;\n if (onframeList) {\n for (let i = 0; i < onframeList.length; i++) {\n onframeList[i](self._target, percent);\n }\n }\n },\n ondestroy() {\n self._doneCallback();\n }\n });\n this._clip = clip;\n\n if (this.animation) {\n this.animation.addClip(clip);\n }\n\n if (easing) {\n clip.setEasing(easing);\n }\n }\n else {\n // This optimization will help the case that in the upper application\n // the view may be refreshed frequently, where animation will be\n // called repeatly but nothing changed.\n this._doneCallback();\n }\n\n return this;\n }\n /**\n * Stop animation\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stop(forwardToLast?: boolean) {\n if (!this._clip) {\n return;\n }\n const clip = this._clip;\n if (forwardToLast) {\n // Move to last frame before stop\n clip.onframe(1);\n }\n\n this._abortedCallback();\n }\n /**\n * Set when animation delay starts\n * @param time \u5355\u4F4Dms\n */\n delay(time: number) {\n this._delay = time;\n return this;\n }\n /**\n * \u6DFB\u52A0\u52A8\u753B\u6BCF\u4E00\u5E27\u7684\u56DE\u8C03\u51FD\u6570\n * @param callback\n */\n during(cb: OnframeCallback) {\n if (cb) {\n if (!this._onframeCbs) {\n this._onframeCbs = [];\n }\n this._onframeCbs.push(cb);\n }\n return this;\n }\n /**\n * Add callback for animation end\n * @param cb\n */\n done(cb: DoneCallback) {\n if (cb) {\n if (!this._doneCbs) {\n this._doneCbs = [];\n }\n this._doneCbs.push(cb);\n }\n return this;\n }\n\n aborted(cb: AbortCallback) {\n if (cb) {\n if (!this._abortedCbs) {\n this._abortedCbs = [];\n }\n this._abortedCbs.push(cb);\n }\n return this;\n }\n\n getClip() {\n return this._clip;\n }\n\n getTrack(propName: string) {\n return this._tracks[propName];\n }\n\n getTracks() {\n return map(this._trackKeys, key => this._tracks[key]);\n }\n\n /**\n * Return true if animator is not available anymore.\n */\n stopTracks(propNames: string[], forwardToLast?: boolean): boolean {\n if (!propNames.length || !this._clip) {\n return true;\n }\n const tracks = this._tracks;\n const tracksKeys = this._trackKeys;\n\n for (let i = 0; i < propNames.length; i++) {\n const track = tracks[propNames[i]];\n if (track && !track.isFinished()) {\n if (forwardToLast) {\n track.step(this._target, 1);\n }\n // If the track has not been run for at least one frame.\n // The property may be stayed at the final state. when setToFinal is set true.\n // For example:\n // Animate x from 0 to 100, then animate to 150 immediately.\n // We want the x is translated from 0 to 150, not 100 to 150.\n else if (this._started === 1) {\n track.step(this._target, 0);\n }\n // Set track to finished\n track.setFinished();\n }\n }\n let allAborted = true;\n for (let i = 0; i < tracksKeys.length; i++) {\n if (!tracks[tracksKeys[i]].isFinished()) {\n allAborted = false;\n break;\n }\n }\n // Remove clip if all tracks has been aborted.\n if (allAborted) {\n this._abortedCallback();\n }\n\n return allAborted;\n }\n\n /**\n * Save values of final state to target.\n * It is mainly used in state mangement. When state is switching during animation.\n * We need to save final state of animation to the normal state. Not interpolated value.\n *\n * @param target\n * @param trackKeys\n * @param firstOrLast If save first frame or last frame\n */\n saveTo(\n target: T,\n trackKeys?: readonly string[],\n firstOrLast?: boolean\n ) {\n if (!target) { // DO nothing if target is not given.\n return;\n }\n\n trackKeys = trackKeys || this._trackKeys;\n\n for (let i = 0; i < trackKeys.length; i++) {\n const propName = trackKeys[i];\n const track = this._tracks[propName];\n if (!track || track.isFinished()) { // Ignore finished track.\n continue;\n }\n const kfs = track.keyframes;\n const kf = kfs[firstOrLast ? 0 : kfs.length - 1];\n if (kf) {\n // TODO CLONE?\n // Use raw value without parse.\n (target as any)[propName] = cloneValue(kf.rawValue as any);\n }\n }\n }\n\n // Change final value after animator has been started.\n // NOTE: Be careful to use it.\n __changeFinalValue(finalProps: Dictionary, trackKeys?: readonly string[]) {\n trackKeys = trackKeys || keys(finalProps);\n\n for (let i = 0; i < trackKeys.length; i++) {\n const propName = trackKeys[i];\n\n const track = this._tracks[propName];\n if (!track) {\n continue;\n }\n\n const kfs = track.keyframes;\n if (kfs.length > 1) {\n // Remove the original last kf and add again.\n const lastKf = kfs.pop();\n\n track.addKeyframe(lastKf.time, finalProps[propName]);\n // Prepare again.\n track.prepare(this._maxTime, track.getAdditiveTrack());\n }\n }\n }\n}\n\nexport type AnimatorTrack = Track;", "/**\n * Animation main class, dispatch and manage all animation controllers\n *\n */\n// TODO Additive animation\n// http://iosoteric.com/additive-animations-animatewithduration-in-ios-8/\n// https://developer.apple.com/videos/wwdc2014/#236\n\nimport Eventful from '../core/Eventful';\nimport requestAnimationFrame from './requestAnimationFrame';\nimport Animator from './Animator';\nimport Clip from './Clip';\n\nexport function getTime() {\n return new Date().getTime();\n}\n\ninterface Stage {\n update?: () => void\n}\n\ninterface AnimationOption {\n stage?: Stage\n}\n/**\n * @example\n * const animation = new Animation();\n * const obj = {\n * x: 100,\n * y: 100\n * };\n * animation.animate(node.position)\n * .when(1000, {\n * x: 500,\n * y: 500\n * })\n * .when(2000, {\n * x: 100,\n * y: 100\n * })\n * .start();\n */\n\nexport default class Animation extends Eventful {\n\n stage: Stage\n\n // Use linked list to store clip\n private _head: Clip\n private _tail: Clip\n\n private _running = false\n\n private _time = 0\n private _pausedTime = 0\n private _pauseStart = 0\n\n private _paused = false;\n\n constructor(opts?: AnimationOption) {\n super();\n\n opts = opts || {};\n\n this.stage = opts.stage || {};\n }\n\n /**\n * Add clip\n */\n addClip(clip: Clip) {\n if (clip.animation) {\n // Clip has been added\n this.removeClip(clip);\n }\n\n if (!this._head) {\n this._head = this._tail = clip;\n }\n else {\n this._tail.next = clip;\n clip.prev = this._tail;\n clip.next = null;\n this._tail = clip;\n }\n clip.animation = this;\n }\n /**\n * Add animator\n */\n addAnimator(animator: Animator) {\n animator.animation = this;\n const clip = animator.getClip();\n if (clip) {\n this.addClip(clip);\n }\n }\n /**\n * Delete animation clip\n */\n removeClip(clip: Clip) {\n if (!clip.animation) {\n return;\n }\n const prev = clip.prev;\n const next = clip.next;\n if (prev) {\n prev.next = next;\n }\n else {\n // Is head\n this._head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n // Is tail\n this._tail = prev;\n }\n clip.next = clip.prev = clip.animation = null;\n }\n\n /**\n * Delete animation clip\n */\n removeAnimator(animator: Animator) {\n const clip = animator.getClip();\n if (clip) {\n this.removeClip(clip);\n }\n animator.animation = null;\n }\n\n update(notTriggerFrameAndStageUpdate?: boolean) {\n const time = getTime() - this._pausedTime;\n const delta = time - this._time;\n let clip = this._head;\n\n while (clip) {\n // Save the nextClip before step.\n // So the loop will not been affected if the clip is removed in the callback\n const nextClip = clip.next;\n let finished = clip.step(time, delta);\n if (finished) {\n clip.ondestroy();\n this.removeClip(clip);\n clip = nextClip;\n }\n else {\n clip = nextClip;\n }\n }\n\n this._time = time;\n\n if (!notTriggerFrameAndStageUpdate) {\n\n // 'frame' should be triggered before stage, because upper application\n // depends on the sequence (e.g., echarts-stream and finish\n // event judge)\n this.trigger('frame', delta);\n\n this.stage.update && this.stage.update();\n }\n }\n\n _startLoop() {\n const self = this;\n\n this._running = true;\n\n function step() {\n if (self._running) {\n requestAnimationFrame(step);\n !self._paused && self.update();\n }\n }\n\n requestAnimationFrame(step);\n }\n\n /**\n * Start animation.\n */\n start() {\n if (this._running) {\n return;\n }\n\n this._time = getTime();\n this._pausedTime = 0;\n\n this._startLoop();\n }\n\n /**\n * Stop animation.\n */\n stop() {\n this._running = false;\n }\n\n /**\n * Pause animation.\n */\n pause() {\n if (!this._paused) {\n this._pauseStart = getTime();\n this._paused = true;\n }\n }\n\n /**\n * Resume animation.\n */\n resume() {\n if (this._paused) {\n this._pausedTime += getTime() - this._pauseStart;\n this._paused = false;\n }\n }\n\n /**\n * Clear animation.\n */\n clear() {\n let clip = this._head;\n\n while (clip) {\n let nextClip = clip.next;\n clip.prev = clip.next = clip.animation = null;\n clip = nextClip;\n }\n\n this._head = this._tail = null;\n }\n\n /**\n * Whether animation finished.\n */\n isFinished() {\n return this._head == null;\n }\n\n /**\n * Creat animator for a target, whose props can be animated.\n */\n // TODO Gap\n animate(target: T, options: {\n loop?: boolean // Whether loop animation\n }) {\n options = options || {};\n\n // Start animation loop\n this.start();\n\n const animator = new Animator(\n target,\n options.loop\n );\n\n this.addAnimator(animator);\n\n return animator;\n }\n}", "\n/* global document */\n\nimport {\n addEventListener,\n removeEventListener,\n normalizeEvent,\n getNativeEvent\n} from '../core/event';\nimport * as zrUtil from '../core/util';\nimport Eventful from '../core/Eventful';\nimport env from '../core/env';\nimport { Dictionary, ZRRawEvent, ZRRawMouseEvent } from '../core/types';\nimport { VectorArray } from '../core/vector';\nimport Handler from '../Handler';\n\ntype DomHandlersMap = Dictionary<(this: HandlerDomProxy, event: ZRRawEvent) => void>\n\ntype DomExtended = Node & {\n domBelongToZr: boolean\n}\n\nconst TOUCH_CLICK_DELAY = 300;\n\nconst globalEventSupported = env.domSupported;\n\n\nconst localNativeListenerNames = (function () {\n const mouseHandlerNames = [\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n ];\n const touchHandlerNames = [\n 'touchstart', 'touchend', 'touchmove'\n ];\n const pointerEventNameMap = {\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\n };\n const pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n const nm = name.replace('mouse', 'pointer');\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n });\n\n return {\n mouse: mouseHandlerNames,\n touch: touchHandlerNames,\n pointer: pointerHandlerNames\n };\n})();\n\nconst globalNativeListenerNames = {\n mouse: ['mousemove', 'mouseup'],\n pointer: ['pointermove', 'pointerup']\n};\n\nlet wheelEventSupported = false;\n\n\n// Although firfox has 'DOMMouseScroll' event and do not has 'mousewheel' event,\n// the 'DOMMouseScroll' event do not performe the same behavior on touch pad device\n// (like on Mac) ('DOMMouseScroll' will be triggered only if a big wheel delta).\n// So we should not use it.\n// function eventNameFix(name: string) {\n// return (name === 'mousewheel' && env.browser.firefox) ? 'DOMMouseScroll' : name;\n// }\n\nfunction isPointerFromTouch(event: ZRRawEvent) {\n const pointerType = (event as any).pointerType;\n return pointerType === 'pen' || pointerType === 'touch';\n}\n\n// function useMSGuesture(handlerProxy, event) {\n// return isPointerFromTouch(event) && !!handlerProxy._msGesture;\n// }\n\n// function onMSGestureChange(proxy, event) {\n// if (event.translationX || event.translationY) {\n// // mousemove is carried by MSGesture to reduce the sensitivity.\n// proxy.handler.dispatchToElement(event.target, 'mousemove', event);\n// }\n// if (event.scale !== 1) {\n// event.pinchX = event.offsetX;\n// event.pinchY = event.offsetY;\n// event.pinchScale = event.scale;\n// proxy.handler.dispatchToElement(event.target, 'pinch', event);\n// }\n// }\n\n/**\n * Prevent mouse event from being dispatched after Touch Events action\n * @see \n * 1. Mobile browsers dispatch mouse events 300ms after touchend.\n * 2. Chrome for Android dispatch mousedown for long-touch about 650ms\n * Result: Blocking Mouse Events for 700ms.\n *\n * @param {DOMHandlerScope} scope\n */\nfunction setTouchTimer(scope: DOMHandlerScope) {\n scope.touching = true;\n if (scope.touchTimer != null) {\n clearTimeout(scope.touchTimer);\n scope.touchTimer = null;\n }\n scope.touchTimer = setTimeout(function () {\n scope.touching = false;\n scope.touchTimer = null;\n }, 700);\n}\n\n// Mark touch, which is useful in distinguish touch and\n// mouse event in upper applicatoin.\nfunction markTouch(event: ZRRawEvent) {\n event && (event.zrByTouch = true);\n}\n\n\n// function markTriggeredFromLocal(event) {\n// event && (event.__zrIsFromLocal = true);\n// }\n\n// function isTriggeredFromLocal(instance, event) {\n// return !!(event && event.__zrIsFromLocal);\n// }\n\nfunction normalizeGlobalEvent(instance: HandlerDomProxy, event: ZRRawEvent) {\n // offsetX, offsetY still need to be calculated. They are necessary in the event\n // handlers of the upper applications. Set `true` to force calculate them.\n return normalizeEvent(\n instance.dom,\n // TODO ANY TYPE\n new FakeGlobalEvent(instance, event) as any as ZRRawEvent,\n true\n );\n}\n\n/**\n * Detect whether the given el is in `painterRoot`.\n */\nfunction isLocalEl(instance: HandlerDomProxy, el: Node) {\n let elTmp = el;\n let isLocal = false;\n while (elTmp && elTmp.nodeType !== 9\n && !(\n isLocal = (elTmp as DomExtended).domBelongToZr\n || (elTmp !== el && elTmp === instance.painterRoot)\n )\n ) {\n elTmp = elTmp.parentNode;\n }\n return isLocal;\n}\n\n/**\n * Make a fake event but not change the original event,\n * because the global event probably be used by other\n * listeners not belonging to zrender.\n * @class\n */\nclass FakeGlobalEvent {\n type: string\n target: HTMLElement\n currentTarget: HTMLElement\n\n pointerType: string\n clientX: number\n clientY: number\n\n constructor(instance: HandlerDomProxy, event: ZRRawEvent) {\n this.type = event.type;\n this.target = this.currentTarget = instance.dom;\n this.pointerType = (event as any).pointerType;\n // Necessray for the force calculation of zrX, zrY\n this.clientX = (event as ZRRawMouseEvent).clientX;\n this.clientY = (event as ZRRawMouseEvent).clientY;\n // Because we do not mount global listeners to touch events,\n // we do not copy `targetTouches` and `changedTouches` here.\n }\n\n // we make the default methods on the event do nothing,\n // otherwise it is dangerous. See more details in\n // [DRAG_OUTSIDE] in `Handler.js`.\n stopPropagation = zrUtil.noop\n stopImmediatePropagation = zrUtil.noop\n preventDefault = zrUtil.noop\n}\n\n\n/**\n * Local DOM Handlers\n * @this {HandlerProxy}\n */\nconst localDOMHandlers: DomHandlersMap = {\n\n mousedown(event: ZRRawEvent) {\n event = normalizeEvent(this.dom, event);\n\n this.__mayPointerCapture = [event.zrX, event.zrY];\n\n this.trigger('mousedown', event);\n },\n\n mousemove(event: ZRRawEvent) {\n event = normalizeEvent(this.dom, event);\n\n const downPoint = this.__mayPointerCapture;\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n this.__togglePointerCapture(true);\n }\n\n this.trigger('mousemove', event);\n },\n\n mouseup(event: ZRRawEvent) {\n event = normalizeEvent(this.dom, event);\n\n this.__togglePointerCapture(false);\n\n this.trigger('mouseup', event);\n },\n\n mouseout(event: ZRRawEvent) {\n event = normalizeEvent(this.dom, event);\n\n // There might be some doms created by upper layer application\n // at the same level of painter.getViewportRoot() (e.g., tooltip\n // dom created by echarts), where 'globalout' event should not\n // be triggered when mouse enters these doms. (But 'mouseout'\n // should be triggered at the original hovered element as usual).\n const element = (event as any).toElement || (event as ZRRawMouseEvent).relatedTarget;\n\n // For SVG rendering, there are SVG elements inside `this.dom`.\n // (especially in decal case). Should not to handle those \"mouseout\"..\n if (!isLocalEl(this, element)) {\n // Similarly to the browser did on `document` and touch event,\n // `globalout` will be delayed to final pointer cature release.\n if (this.__pointerCapturing) {\n event.zrEventControl = 'no_globalout';\n }\n\n this.trigger('mouseout', event);\n }\n },\n\n wheel(event: ZRRawEvent) {\n // Morden agent has supported event `wheel` instead of `mousewheel`.\n // About the polyfill of the props \"delta\", see \"arc/core/event.ts\".\n\n // Firefox only support `wheel` rather than `mousewheel`. Although firfox has been supporting\n // event `DOMMouseScroll`, it do not act the same behavior as `wheel` on touch pad device\n // like on Mac, where `DOMMouseScroll` will be triggered only if a big wheel delta occurs,\n // and it results in no chance to \"preventDefault\". So we should not use `DOMMouseScroll`.\n\n wheelEventSupported = true;\n event = normalizeEvent(this.dom, event);\n // Follow the definition of the previous version, the zrender event name is still 'mousewheel'.\n this.trigger('mousewheel', event);\n },\n\n mousewheel(event: ZRRawEvent) {\n // IE8- and some other lagacy agent do not support event `wheel`, so we still listen\n // to the legacy event `mouseevent`.\n // Typically if event `wheel` is supported and the handler has been mounted on a\n // DOM element, the legacy `mousewheel` event will not be triggered (Chrome and Safari).\n // But we still do this guard to avoid to duplicated handle.\n if (wheelEventSupported) {\n return;\n }\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n\n touchstart(event: ZRRawEvent) {\n // Default mouse behaviour should not be disabled here.\n // For example, page may needs to be slided.\n event = normalizeEvent(this.dom, event);\n\n markTouch(event);\n\n this.__lastTouchMoment = new Date();\n\n this.handler.processGesture(event, 'start');\n\n // For consistent event listener for both touch device and mouse device,\n // we simulate \"mouseover-->mousedown\" in touch device. So we trigger\n // `mousemove` here (to trigger `mouseover` inside), and then trigger\n // `mousedown`.\n localDOMHandlers.mousemove.call(this, event);\n localDOMHandlers.mousedown.call(this, event);\n },\n\n touchmove(event: ZRRawEvent) {\n event = normalizeEvent(this.dom, event);\n\n markTouch(event);\n\n this.handler.processGesture(event, 'change');\n\n // Mouse move should always be triggered no matter whether\n // there is gestrue event, because mouse move and pinch may\n // be used at the same time.\n localDOMHandlers.mousemove.call(this, event);\n },\n\n touchend(event: ZRRawEvent) {\n event = normalizeEvent(this.dom, event);\n\n markTouch(event);\n\n this.handler.processGesture(event, 'end');\n\n localDOMHandlers.mouseup.call(this, event);\n\n // Do not trigger `mouseout` here, in spite of `mousemove`(`mouseover`) is\n // triggered in `touchstart`. This seems to be illogical, but by this mechanism,\n // we can conveniently implement \"hover style\" in both PC and touch device just\n // by listening to `mouseover` to add \"hover style\" and listening to `mouseout`\n // to remove \"hover style\" on an element, without any additional code for\n // compatibility. (`mouseout` will not be triggered in `touchend`, so \"hover\n // style\" will remain for user view)\n\n // click event should always be triggered no matter whether\n // there is gestrue event. System click can not be prevented.\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\n localDOMHandlers.click.call(this, event);\n }\n },\n\n pointerdown(event: ZRRawEvent) {\n localDOMHandlers.mousedown.call(this, event);\n\n // if (useMSGuesture(this, event)) {\n // this._msGesture.addPointer(event.pointerId);\n // }\n },\n\n pointermove(event: ZRRawEvent) {\n // FIXME\n // pointermove is so sensitive that it always triggered when\n // tap(click) on touch screen, which affect some judgement in\n // upper application. So, we don't support mousemove on MS touch\n // device yet.\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mousemove.call(this, event);\n }\n },\n\n pointerup(event: ZRRawEvent) {\n localDOMHandlers.mouseup.call(this, event);\n },\n\n pointerout(event: ZRRawEvent) {\n // pointerout will be triggered when tap on touch screen\n // (IE11+/Edge on MS Surface) after click event triggered,\n // which is inconsistent with the mousout behavior we defined\n // in touchend. So we unify them.\n // (check localDOMHandlers.touchend for detailed explanation)\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mouseout.call(this, event);\n }\n }\n\n};\n\n/**\n * Othere DOM UI Event handlers for zr dom.\n * @this {HandlerProxy}\n */\nzrUtil.each(['click', 'dblclick', 'contextmenu'], function (name) {\n localDOMHandlers[name] = function (event) {\n event = normalizeEvent(this.dom, event);\n this.trigger(name, event);\n };\n});\n\n\n/**\n * DOM UI Event handlers for global page.\n *\n * [Caution]:\n * those handlers should both support in capture phase and bubble phase!\n */\nconst globalDOMHandlers: DomHandlersMap = {\n\n pointermove: function (event: ZRRawEvent) {\n // FIXME\n // pointermove is so sensitive that it always triggered when\n // tap(click) on touch screen, which affect some judgement in\n // upper application. So, we don't support mousemove on MS touch\n // device yet.\n if (!isPointerFromTouch(event)) {\n globalDOMHandlers.mousemove.call(this, event);\n }\n },\n\n pointerup: function (event: ZRRawEvent) {\n globalDOMHandlers.mouseup.call(this, event);\n },\n\n mousemove: function (event: ZRRawEvent) {\n this.trigger('mousemove', event);\n },\n\n mouseup: function (event: ZRRawEvent) {\n const pointerCaptureReleasing = this.__pointerCapturing;\n\n this.__togglePointerCapture(false);\n\n this.trigger('mouseup', event);\n\n if (pointerCaptureReleasing) {\n event.zrEventControl = 'only_globalout';\n this.trigger('mouseout', event);\n }\n }\n\n};\n\n\nfunction mountLocalDOMEventListeners(instance: HandlerDomProxy, scope: DOMHandlerScope) {\n const domHandlers = scope.domHandlers;\n\n if (env.pointerEventsSupported) { // Only IE11+/Edge\n // 1. On devices that both enable touch and mouse (e.g., MS Surface and lenovo X240),\n // IE11+/Edge do not trigger touch event, but trigger pointer event and mouse event\n // at the same time.\n // 2. On MS Surface, it probablely only trigger mousedown but no mouseup when tap on\n // screen, which do not occurs in pointer event.\n // So we use pointer event to both detect touch gesture and mouse behavior.\n zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n });\n });\n\n // FIXME\n // Note: MS Gesture require CSS touch-action set. But touch-action is not reliable,\n // which does not prevent defuault behavior occasionally (which may cause view port\n // zoomed in but use can not zoom it back). And event.preventDefault() does not work.\n // So we have to not to use MSGesture and not to support touchmove and pinch on MS\n // touch screen. And we only support click behavior on MS touch screen now.\n\n // MS Gesture Event is only supported on IE11+/Edge and on Windows 8+.\n // We don't support touch on IE on win7.\n // See \n // if (typeof MSGesture === 'function') {\n // (this._msGesture = new MSGesture()).target = dom; // jshint ignore:line\n // dom.addEventListener('MSGestureChange', onMSGestureChange);\n // }\n }\n else {\n if (env.touchEventsSupported) {\n zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n setTouchTimer(scope);\n });\n });\n // Handler of 'mouseout' event is needed in touch mode, which will be mounted below.\n // addEventListener(root, 'mouseout', this._mouseoutHandler);\n }\n\n // 1. Considering some devices that both enable touch and mouse event (like on MS Surface\n // and lenovo X240, @see #2350), we make mouse event be always listened, otherwise\n // mouse event can not be handle in those devices.\n // 2. On MS Surface, Chrome will trigger both touch event and mouse event. How to prevent\n // mouseevent after touch event triggered, see `setTouchTimer`.\n zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event: ZRRawEvent) {\n event = getNativeEvent(event);\n if (!scope.touching) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n }\n });\n });\n }\n}\n\nfunction mountGlobalDOMEventListeners(instance: HandlerDomProxy, scope: DOMHandlerScope) {\n // Only IE11+/Edge. See the comment in `mountLocalDOMEventListeners`.\n if (env.pointerEventsSupported) {\n zrUtil.each(globalNativeListenerNames.pointer, mount);\n }\n // Touch event has implemented \"drag outside\" so we do not mount global listener for touch event.\n // (see https://www.w3.org/TR/touch-events/#the-touchmove-event) (see also `DRAG_OUTSIDE`).\n // We do not consider \"both-support-touch-and-mouse device\" for this feature (see the comment of\n // `mountLocalDOMEventListeners`) to avoid bugs util some requirements come.\n else if (!env.touchEventsSupported) {\n zrUtil.each(globalNativeListenerNames.mouse, mount);\n }\n\n function mount(nativeEventName: string) {\n function nativeEventListener(event: ZRRawEvent) {\n event = getNativeEvent(event);\n // See the reason in [DRAG_OUTSIDE] in `Handler.js`\n // This checking supports both `useCapture` or not.\n // PENDING: if there is performance issue in some devices,\n // we probably can not use `useCapture` and change a easier\n // to judes whether local (mark).\n if (!isLocalEl(instance, event.target as Node)) {\n event = normalizeGlobalEvent(instance, event);\n scope.domHandlers[nativeEventName].call(instance, event);\n }\n }\n mountSingleDOMEventListener(\n scope, nativeEventName, nativeEventListener,\n {capture: true} // See [DRAG_OUTSIDE] in `Handler.js`\n );\n }\n}\n\nfunction mountSingleDOMEventListener(\n scope: DOMHandlerScope,\n nativeEventName: string,\n listener: EventListener,\n opt?: boolean | AddEventListenerOptions\n) {\n scope.mounted[nativeEventName] = listener;\n scope.listenerOpts[nativeEventName] = opt;\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\n}\n\nfunction unmountDOMEventListeners(scope: DOMHandlerScope) {\n const mounted = scope.mounted;\n for (let nativeEventName in mounted) {\n if (mounted.hasOwnProperty(nativeEventName)) {\n removeEventListener(\n scope.domTarget, nativeEventName, mounted[nativeEventName],\n scope.listenerOpts[nativeEventName]\n );\n }\n }\n scope.mounted = {};\n}\n\n\nclass DOMHandlerScope {\n domTarget: HTMLElement | HTMLDocument\n domHandlers: DomHandlersMap\n\n // Key: eventName, value: mounted handler functions.\n // Used for unmount.\n mounted: Dictionary = {};\n\n listenerOpts: Dictionary = {};\n\n touchTimer: ReturnType;\n touching = false;\n\n constructor(\n domTarget: HTMLElement | HTMLDocument,\n domHandlers: DomHandlersMap\n ) {\n this.domTarget = domTarget;\n this.domHandlers = domHandlers;\n\n }\n}\n\n\nexport default class HandlerDomProxy extends Eventful {\n\n dom: HTMLElement\n painterRoot: HTMLElement\n\n handler: Handler\n\n private _localHandlerScope: DOMHandlerScope\n private _globalHandlerScope: DOMHandlerScope\n\n __lastTouchMoment: Date\n\n // See [DRAG_OUTSIDE] in `Handler.ts`.\n __pointerCapturing = false\n // [x, y]\n __mayPointerCapture: VectorArray\n\n\n constructor(dom: HTMLElement, painterRoot: HTMLElement) {\n super();\n\n this.dom = dom;\n this.painterRoot = painterRoot;\n\n this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n\n if (globalEventSupported) {\n this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n }\n\n mountLocalDOMEventListeners(this, this._localHandlerScope);\n }\n\n dispose() {\n unmountDOMEventListeners(this._localHandlerScope);\n if (globalEventSupported) {\n unmountDOMEventListeners(this._globalHandlerScope);\n }\n }\n\n setCursor(cursorStyle: string) {\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n }\n\n /**\n * See [DRAG_OUTSIDE] in `Handler.js`.\n * @implement\n * @param isPointerCapturing Should never be `null`/`undefined`.\n * `true`: start to capture pointer if it is not capturing.\n * `false`: end the capture if it is capturing.\n */\n __togglePointerCapture(isPointerCapturing?: boolean) {\n this.__mayPointerCapture = null;\n\n if (globalEventSupported\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))\n ) {\n this.__pointerCapturing = isPointerCapturing;\n\n const globalHandlerScope = this._globalHandlerScope;\n isPointerCapturing\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\n : unmountDOMEventListeners(globalHandlerScope);\n }\n }\n}\n\nexport interface HandlerProxyInterface extends Eventful {\n handler: Handler\n dispose: () => void\n setCursor: (cursorStyle?: string) => void\n}", "import env from './core/env';\n\nlet dpr = 1;\n\n// If in browser environment\nif (env.hasGlobalWindow) {\n dpr = Math.max(\n window.devicePixelRatio\n || (window.screen && (window.screen as any).deviceXDPI / (window.screen as any).logicalXDPI)\n || 1, 1\n );\n}\n\n/**\n * Debug log mode:\n * 0: Do nothing, for release.\n * 1: console.error, for debug.\n */\nexport const debugMode = 0;\n\n// retina \u5C4F\u5E55\u4F18\u5316\nexport const devicePixelRatio = dpr;\n\n\n/**\n * Determine when to turn on dark mode based on the luminance of backgroundColor\n */\nexport const DARK_MODE_THRESHOLD = 0.4;\n\n/**\n * Color of default dark label.\n */\nexport const DARK_LABEL_COLOR = '#333';\n\n/**\n * Color of default light label.\n */\nexport const LIGHT_LABEL_COLOR = '#ccc';\n\n/**\n * Color of default light label.\n */\nexport const LIGHTER_LABEL_COLOR = '#eee';\n", "import * as matrix from './matrix';\nimport * as vector from './vector';\n\nconst mIdentity = matrix.identity;\n\nconst EPSILON = 5e-5;\n\nfunction isNotAroundZero(val: number) {\n return val > EPSILON || val < -EPSILON;\n}\n\nconst scaleTmp: vector.VectorArray = [];\nconst tmpTransform: matrix.MatrixArray = [];\nconst originTransform = matrix.create();\nconst abs = Math.abs;\n\nclass Transformable {\n\n parent: Transformable\n\n x: number\n y: number\n\n scaleX: number\n scaleY: number\n\n skewX: number\n skewY: number\n\n rotation: number\n\n /**\n * Will translated the element to the anchor position before applying other transforms.\n */\n anchorX: number\n anchorY: number\n /**\n * Origin of scale, rotation, skew\n */\n originX: number\n originY: number\n\n /**\n * Scale ratio\n */\n globalScaleRatio: number\n\n transform: matrix.MatrixArray\n invTransform: matrix.MatrixArray\n\n /**\n * Get computed local transform\n */\n getLocalTransform(m?: matrix.MatrixArray) {\n return Transformable.getLocalTransform(this, m);\n }\n\n /**\n * Set position from array\n */\n setPosition(arr: number[]) {\n this.x = arr[0];\n this.y = arr[1];\n }\n /**\n * Set scale from array\n */\n setScale(arr: number[]) {\n this.scaleX = arr[0];\n this.scaleY = arr[1];\n }\n\n /**\n * Set skew from array\n */\n setSkew(arr: number[]) {\n this.skewX = arr[0];\n this.skewY = arr[1];\n }\n\n /**\n * Set origin from array\n */\n setOrigin(arr: number[]) {\n this.originX = arr[0];\n this.originY = arr[1];\n }\n\n /**\n * If needs to compute transform\n */\n needLocalTransform(): boolean {\n return isNotAroundZero(this.rotation)\n || isNotAroundZero(this.x)\n || isNotAroundZero(this.y)\n || isNotAroundZero(this.scaleX - 1)\n || isNotAroundZero(this.scaleY - 1)\n || isNotAroundZero(this.skewX)\n || isNotAroundZero(this.skewY);\n }\n\n /**\n * Update global transform\n */\n updateTransform() {\n const parentTransform = this.parent && this.parent.transform;\n const needLocalTransform = this.needLocalTransform();\n\n let m = this.transform;\n if (!(needLocalTransform || parentTransform)) {\n if (m) {\n mIdentity(m);\n // reset invTransform\n this.invTransform = null;\n }\n return;\n }\n\n m = m || matrix.create();\n\n if (needLocalTransform) {\n this.getLocalTransform(m);\n }\n else {\n mIdentity(m);\n }\n\n // \u5E94\u7528\u7236\u8282\u70B9\u53D8\u6362\n if (parentTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parentTransform, m);\n }\n else {\n matrix.copy(m, parentTransform);\n }\n }\n // \u4FDD\u5B58\u8FD9\u4E2A\u53D8\u6362\u77E9\u9635\n this.transform = m;\n\n this._resolveGlobalScaleRatio(m);\n }\n\n private _resolveGlobalScaleRatio(m: matrix.MatrixArray) {\n const globalScaleRatio = this.globalScaleRatio;\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\n this.getGlobalScale(scaleTmp);\n const relX = scaleTmp[0] < 0 ? -1 : 1;\n const relY = scaleTmp[1] < 0 ? -1 : 1;\n const sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\n const sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\n\n m[0] *= sx;\n m[1] *= sx;\n m[2] *= sy;\n m[3] *= sy;\n }\n\n this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n }\n\n /**\n * Get computed global transform\n * NOTE: this method will force update transform on all ancestors.\n * Please be aware of the potential performance cost.\n */\n getComputedTransform() {\n let transformNode: Transformable = this;\n const ancestors: Transformable[] = [];\n while (transformNode) {\n ancestors.push(transformNode);\n transformNode = transformNode.parent;\n }\n\n // Update from topdown.\n while (transformNode = ancestors.pop()) {\n transformNode.updateTransform();\n }\n\n return this.transform;\n }\n\n setLocalTransform(m: vector.VectorArray) {\n if (!m) {\n // TODO return or set identity?\n return;\n }\n let sx = m[0] * m[0] + m[1] * m[1];\n let sy = m[2] * m[2] + m[3] * m[3];\n\n const rotation = Math.atan2(m[1], m[0]);\n\n const shearX = Math.PI / 2 + rotation - Math.atan2(m[3], m[2]);\n sy = Math.sqrt(sy) * Math.cos(shearX);\n sx = Math.sqrt(sx);\n\n this.skewX = shearX;\n this.skewY = 0;\n this.rotation = -rotation;\n\n this.x = +m[4];\n this.y = +m[5];\n this.scaleX = sx;\n this.scaleY = sy;\n\n this.originX = 0;\n this.originY = 0;\n }\n /**\n * \u5206\u89E3`transform`\u77E9\u9635\u5230`position`, `rotation`, `scale`\n */\n decomposeTransform() {\n if (!this.transform) {\n return;\n }\n const parent = this.parent;\n let m = this.transform;\n if (parent && parent.transform) {\n // Get local transform and decompose them to position, scale, rotation\n parent.invTransform = parent.invTransform || matrix.create();\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n const ox = this.originX;\n const oy = this.originY;\n if (ox || oy) {\n originTransform[4] = ox;\n originTransform[5] = oy;\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= ox;\n tmpTransform[5] -= oy;\n m = tmpTransform;\n }\n\n this.setLocalTransform(m);\n }\n\n /**\n * Get global scale\n */\n getGlobalScale(out?: vector.VectorArray): vector.VectorArray {\n const m = this.transform;\n out = out || [];\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\n }\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\n if (m[0] < 0) {\n out[0] = -out[0];\n }\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n return out;\n }\n /**\n * \u53D8\u6362\u5750\u6807\u4F4D\u7F6E\u5230 shape \u7684\u5C40\u90E8\u5750\u6807\u7A7A\u95F4\n */\n transformCoordToLocal(x: number, y: number): number[] {\n const v2 = [x, y];\n const invTransform = this.invTransform;\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n return v2;\n }\n\n /**\n * \u53D8\u6362\u5C40\u90E8\u5750\u6807\u4F4D\u7F6E\u5230\u5168\u5C40\u5750\u6807\u7A7A\u95F4\n */\n transformCoordToGlobal(x: number, y: number): number[] {\n const v2 = [x, y];\n const transform = this.transform;\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n return v2;\n }\n\n\n getLineScale() {\n const m = this.transform;\n // Get the line scale.\n // Determinant of `m` means how much the area is enlarged by the\n // transformation. So its square root can be used as a scale factor\n // for width.\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\n : 1;\n }\n\n copyTransform(source: Transformable) {\n copyTransform(this, source);\n }\n\n\n static getLocalTransform(target: Transformable, m?: matrix.MatrixArray): matrix.MatrixArray {\n m = m || [];\n\n const ox = target.originX || 0;\n const oy = target.originY || 0;\n const sx = target.scaleX;\n const sy = target.scaleY;\n const ax = target.anchorX;\n const ay = target.anchorY;\n const rotation = target.rotation || 0;\n const x = target.x;\n const y = target.y;\n const skewX = target.skewX ? Math.tan(target.skewX) : 0;\n // TODO: zrender use different hand in coordinate system and y axis is inversed.\n const skewY = target.skewY ? Math.tan(-target.skewY) : 0;\n\n // The order of transform (-anchor * -origin * scale * skew * rotate * origin * translate).\n // We merge (-origin * scale * skew) into one. Also did identity in these operations.\n // origin\n if (ox || oy || ax || ay) {\n const dx = ox + ax;\n const dy = oy + ay;\n m[4] = -dx * sx - skewX * dy * sy;\n m[5] = -dy * sy - skewY * dx * sx;\n }\n else {\n m[4] = m[5] = 0;\n }\n // scale\n m[0] = sx;\n m[3] = sy;\n // skew\n m[1] = skewY * sx;\n m[2] = skewX * sy;\n\n // Apply rotation\n rotation && matrix.rotate(m, m, rotation);\n\n // Translate back from origin and apply translation\n m[4] += ox + x;\n m[5] += oy + y;\n\n return m;\n }\n\n private static initDefaultProps = (function () {\n const proto = Transformable.prototype;\n proto.scaleX =\n proto.scaleY =\n proto.globalScaleRatio = 1;\n proto.x =\n proto.y =\n proto.originX =\n proto.originY =\n proto.skewX =\n proto.skewY =\n proto.rotation =\n proto.anchorX =\n proto.anchorY = 0;\n })()\n};\n\nexport const TRANSFORMABLE_PROPS = [\n 'x', 'y', 'originX', 'originY', 'anchorX', 'anchorY', 'rotation', 'scaleX', 'scaleY', 'skewX', 'skewY'\n] as const;\n\nexport type TransformProp = (typeof TRANSFORMABLE_PROPS)[number]\n\nexport function copyTransform(\n target: Partial>,\n source: Pick\n) {\n for (let i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n const propName = TRANSFORMABLE_PROPS[i];\n target[propName] = source[propName];\n }\n}\n\nexport default Transformable;", "import BoundingRect, { RectLike } from '../core/BoundingRect';\nimport { Dictionary, TextAlign, TextVerticalAlign, BuiltinTextPosition } from '../core/types';\nimport LRU from '../core/LRU';\nimport { DEFAULT_FONT, platformApi } from '../core/platform';\n\nlet textWidthCache: Dictionary> = {};\n\nexport function getWidth(text: string, font: string): number {\n font = font || DEFAULT_FONT;\n let cacheOfFont = textWidthCache[font];\n if (!cacheOfFont) {\n cacheOfFont = textWidthCache[font] = new LRU(500);\n }\n let width = cacheOfFont.get(text);\n if (width == null) {\n width = platformApi.measureText(text, font).width;\n cacheOfFont.put(text, width);\n }\n\n return width;\n}\n\n/**\n *\n * Get bounding rect for inner usage(TSpan)\n * Which not include text newline.\n */\nexport function innerGetBoundingRect(\n text: string,\n font: string,\n textAlign?: TextAlign,\n textBaseline?: TextVerticalAlign\n): BoundingRect {\n const width = getWidth(text, font);\n const height = getLineHeight(font);\n\n const x = adjustTextX(0, width, textAlign);\n const y = adjustTextY(0, height, textBaseline);\n\n const rect = new BoundingRect(x, y, width, height);\n\n return rect;\n}\n\n/**\n *\n * Get bounding rect for outer usage. Compatitable with old implementation\n * Which includes text newline.\n */\nexport function getBoundingRect(\n text: string,\n font: string,\n textAlign?: TextAlign,\n textBaseline?: TextVerticalAlign\n) {\n const textLines = ((text || '') + '').split('\\n');\n const len = textLines.length;\n if (len === 1) {\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\n }\n else {\n const uniondRect = new BoundingRect(0, 0, 0, 0);\n for (let i = 0; i < textLines.length; i++) {\n const rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\n }\n return uniondRect;\n }\n}\n\nexport function adjustTextX(x: number, width: number, textAlign: TextAlign): number {\n // TODO Right to left language\n if (textAlign === 'right') {\n x -= width;\n }\n else if (textAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\n\nexport function adjustTextY(y: number, height: number, verticalAlign: TextVerticalAlign): number {\n if (verticalAlign === 'middle') {\n y -= height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y -= height;\n }\n return y;\n}\n\n\nexport function getLineHeight(font?: string): number {\n // FIXME A rough approach.\n return getWidth('\u56FD', font);\n}\n\nexport function measureText(text: string, font?: string): {\n width: number\n} {\n return platformApi.measureText(text, font);\n}\n\n\nexport function parsePercent(value: number | string, maxValue: number): number {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n return parseFloat(value);\n }\n return value;\n}\n\nexport interface TextPositionCalculationResult {\n x: number\n y: number\n align: TextAlign\n verticalAlign: TextVerticalAlign\n}\n/**\n * Follow same interface to `Displayable.prototype.calculateTextPosition`.\n * @public\n * @param out Prepared out object. If not input, auto created in the method.\n * @param style where `textPosition` and `textDistance` are visited.\n * @param rect {x, y, width, height} Rect of the host elment, according to which the text positioned.\n * @return The input `out`. Set: {x, y, textAlign, textVerticalAlign}\n */\nexport function calculateTextPosition(\n out: TextPositionCalculationResult,\n opts: {\n position?: BuiltinTextPosition | (number | string)[]\n distance?: number // Default 5\n global?: boolean\n },\n rect: RectLike\n): TextPositionCalculationResult {\n const textPosition = opts.position || 'inside';\n const distance = opts.distance != null ? opts.distance : 5;\n\n const height = rect.height;\n const width = rect.width;\n const halfHeight = height / 2;\n\n let x = rect.x;\n let y = rect.y;\n\n let textAlign: TextAlign = 'left';\n let textVerticalAlign: TextVerticalAlign = 'top';\n\n if (textPosition instanceof Array) {\n x += parsePercent(textPosition[0], rect.width);\n y += parsePercent(textPosition[1], rect.height);\n // Not use textAlign / textVerticalAlign\n textAlign = null;\n textVerticalAlign = null;\n }\n else {\n switch (textPosition) {\n case 'left':\n x -= distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'right':\n x += distance + width;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'top':\n x += width / 2;\n y -= distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'bottom':\n x += width / 2;\n y += height + distance;\n textAlign = 'center';\n break;\n case 'inside':\n x += width / 2;\n y += halfHeight;\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n case 'insideLeft':\n x += distance;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'insideRight':\n x += width - distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'insideTop':\n x += width / 2;\n y += distance;\n textAlign = 'center';\n break;\n case 'insideBottom':\n x += width / 2;\n y += height - distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'insideTopLeft':\n x += distance;\n y += distance;\n break;\n case 'insideTopRight':\n x += width - distance;\n y += distance;\n textAlign = 'right';\n break;\n case 'insideBottomLeft':\n x += distance;\n y += height - distance;\n textVerticalAlign = 'bottom';\n break;\n case 'insideBottomRight':\n x += width - distance;\n y += height - distance;\n textAlign = 'right';\n textVerticalAlign = 'bottom';\n break;\n }\n }\n\n out = out || {} as TextPositionCalculationResult;\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n\n return out;\n}\n", "import Transformable, {TRANSFORMABLE_PROPS, TransformProp} from './core/Transformable';\nimport { AnimationEasing } from './animation/easing';\nimport Animator, {cloneValue} from './animation/Animator';\nimport { ZRenderType } from './zrender';\nimport {\n Dictionary, ElementEventName, ZRRawEvent, BuiltinTextPosition, AllPropTypes,\n TextVerticalAlign, TextAlign, MapToType\n} from './core/types';\nimport Path from './graphic/Path';\nimport BoundingRect, { RectLike } from './core/BoundingRect';\nimport Eventful from './core/Eventful';\nimport ZRText, { DefaultTextStyle } from './graphic/Text';\nimport { calculateTextPosition, TextPositionCalculationResult, parsePercent } from './contain/text';\nimport {\n guid,\n isObject,\n keys,\n extend,\n indexOf,\n logError,\n mixin,\n isArrayLike,\n isTypedArray,\n isGradientObject,\n filter,\n reduce\n} from './core/util';\nimport Polyline from './graphic/shape/Polyline';\nimport Group from './graphic/Group';\nimport Point from './core/Point';\nimport { LIGHT_LABEL_COLOR, DARK_LABEL_COLOR } from './config';\nimport { parse, stringify } from './tool/color';\nimport { REDRAW_BIT } from './graphic/constants';\n\nexport interface ElementAnimateConfig {\n duration?: number\n delay?: number\n easing?: AnimationEasing\n during?: (percent: number) => void\n\n // `done` will be called when all of the animations of the target props are\n // \"done\" or \"aborted\", and at least one \"done\" happened.\n // Common cases: animations declared, but some of them are aborted (e.g., by state change).\n // The calling of `animationTo` done rather than aborted if at least one done happened.\n done?: Function\n // `aborted` will be called when all of the animations of the target props are \"aborted\".\n aborted?: Function\n\n scope?: string\n /**\n * If force animate\n * Prevent stop animation and callback\n * immediently when target values are the same as current values.\n */\n force?: boolean\n /**\n * If use additive animation.\n */\n additive?: boolean\n /**\n * If set to final state before animation started.\n * It can be useful if something you want to calcuate depends on the final state of element.\n * Like bounding rect for text layouting.\n *\n * Only available in animateTo\n */\n setToFinal?: boolean\n}\n\nexport interface ElementTextConfig {\n /**\n * Position relative to the element bounding rect\n * @default 'inside'\n */\n position?: BuiltinTextPosition | (number | string)[]\n\n /**\n * Rotation of the label.\n */\n rotation?: number\n\n /**\n * Rect that text will be positioned.\n * Default to be the rect of element.\n */\n layoutRect?: RectLike\n\n /**\n * Offset of the label.\n * The difference of offset and position is that it will be applied\n * in the rotation\n */\n offset?: number[]\n\n /**\n * Origin or rotation. Which is relative to the bounding box of the attached element.\n * Can be percent value. Relative to the bounding box.\n * If specified center. It will be center of the bounding box.\n *\n * Only available when position and rotation are both set.\n */\n origin?: (number | string)[] | 'center'\n\n /**\n * Distance to the rect\n * @default 5\n */\n distance?: number\n\n /**\n * If use local user space. Which will apply host's transform\n * @default false\n */\n local?: boolean\n\n /**\n * `insideFill` is a color string or left empty.\n * If a `textContent` is \"inside\", its final `fill` will be picked by this priority:\n * `textContent.style.fill` > `textConfig.insideFill` > \"auto-calculated-fill\"\n * In most cases, \"auto-calculated-fill\" is white.\n */\n insideFill?: string\n\n /**\n * `insideStroke` is a color string or left empty.\n * If a `textContent` is \"inside\", its final `stroke` will be picked by this priority:\n * `textContent.style.stroke` > `textConfig.insideStroke` > \"auto-calculated-stroke\"\n *\n * The rule of getting \"auto-calculated-stroke\":\n * If (A) the `fill` is specified in style (either in `textContent.style` or `textContent.style.rich`)\n * or (B) needed to draw text background (either defined in `textContent.style` or `textContent.style.rich`)\n * \"auto-calculated-stroke\" will be null.\n * Otherwise, \"auto-calculated-stroke\" will be the same as `fill` of this element if possible, or null.\n *\n * The reason of (A) is not decisive:\n * 1. If users specify `fill` in style and still use \"auto-calculated-stroke\", the effect\n * is not good and unexpected in some cases. It not easy and seams uncessary to auto calculate\n * a proper `stroke` for the given `fill`, since they can specify `stroke` themselve.\n * 2. Backward compat.\n */\n insideStroke?: string\n\n /**\n * `outsideFill` is a color string or left empty.\n * If a `textContent` is \"inside\", its final `fill` will be picked by this priority:\n * `textContent.style.fill` > `textConfig.outsideFill` > #000\n */\n outsideFill?: string\n\n /**\n * `outsideStroke` is a color string or left empth.\n * If a `textContent` is not \"inside\", its final `stroke` will be picked by this priority:\n * `textContent.style.stroke` > `textConfig.outsideStroke` > \"auto-calculated-stroke\"\n *\n * The rule of getting \"auto-calculated-stroke\":\n * If (A) the `fill` is specified in style (either in `textContent.style` or `textContent.style.rich`)\n * or (B) needed to draw text background (either defined in `textContent.style` or `textContent.style.rich`)\n * \"auto-calculated-stroke\" will be null.\n * Otherwise, \"auto-calculated-stroke\" will be a neer white color to distinguish \"front end\"\n * label with messy background (like other text label, line or other graphic).\n */\n outsideStroke?: string\n\n /**\n * Tell zrender I can sure this text is inside or not.\n * In case position is not using builtin `inside` hints.\n */\n inside?: boolean\n}\nexport interface ElementTextGuideLineConfig {\n /**\n * Anchor for text guide line.\n * Notice: Won't work\n */\n anchor?: Point\n\n /**\n * If above the target element.\n */\n showAbove?: boolean\n\n /**\n * Candidates of connectors. Used when autoCalculate is true and anchor is not specified.\n */\n candidates?: ('left' | 'top' | 'right' | 'bottom')[]\n}\n\nexport interface ElementEvent {\n type: ElementEventName,\n event: ZRRawEvent,\n // target can only be an element that is not silent.\n target: Element,\n // topTarget can be a silent element.\n topTarget: Element,\n cancelBubble: boolean,\n offsetX: number,\n offsetY: number,\n gestureEvent: string,\n pinchX: number,\n pinchY: number,\n pinchScale: number,\n wheelDelta: number,\n zrByTouch: boolean,\n which: number,\n stop: (this: ElementEvent) => void\n}\n\nexport type ElementEventCallback = (\n this: CbThis, e: ElementEvent\n) => boolean | void\ntype CbThis = unknown extends Ctx ? Impl : Ctx;\n\ninterface ElementEventHandlerProps {\n // Events\n onclick: ElementEventCallback\n ondblclick: ElementEventCallback\n onmouseover: ElementEventCallback\n onmouseout: ElementEventCallback\n onmousemove: ElementEventCallback\n onmousewheel: ElementEventCallback\n onmousedown: ElementEventCallback\n onmouseup: ElementEventCallback\n oncontextmenu: ElementEventCallback\n\n ondrag: ElementEventCallback\n ondragstart: ElementEventCallback\n ondragend: ElementEventCallback\n ondragenter: ElementEventCallback\n ondragleave: ElementEventCallback\n ondragover: ElementEventCallback\n ondrop: ElementEventCallback\n}\n\nexport interface ElementProps extends Partial, Partial> {\n name?: string\n ignore?: boolean\n isGroup?: boolean\n draggable?: boolean | 'horizontal' | 'vertical'\n\n silent?: boolean\n\n ignoreClip?: boolean\n globalScaleRatio?: number\n\n textConfig?: ElementTextConfig\n textContent?: ZRText\n\n clipPath?: Path\n drift?: Element['drift']\n\n extra?: Dictionary\n\n // For echarts animation.\n anid?: string\n}\n\n// Properties can be used in state.\nexport const PRESERVED_NORMAL_STATE = '__zr_normal__';\n// export const PRESERVED_MERGED_STATE = '__zr_merged__';\n\nconst PRIMARY_STATES_KEYS = (TRANSFORMABLE_PROPS as any).concat(['ignore']) as [TransformProp, 'ignore'];\nconst DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, (obj, key) => {\n obj[key] = true;\n return obj;\n}, {ignore: false} as Partial>);\n\nexport type ElementStatePropNames = (typeof PRIMARY_STATES_KEYS)[number] | 'textConfig';\nexport type ElementState = Pick & ElementCommonState\n\nexport type ElementCommonState = {\n hoverLayer?: boolean\n}\n\nexport type ElementCalculateTextPosition = (\n out: TextPositionCalculationResult,\n style: ElementTextConfig,\n rect: RectLike\n) => TextPositionCalculationResult;\n\nlet tmpTextPosCalcRes = {} as TextPositionCalculationResult;\nlet tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Element extends Transformable,\n Eventful<{\n [key in ElementEventName]: (e: ElementEvent) => void | boolean\n } & {\n [key in string]: (...args: any) => void | boolean\n }>,\n ElementEventHandlerProps {\n}\n\nclass Element {\n\n id: number = guid()\n /**\n * Element type\n */\n type: string\n\n /**\n * Element name\n */\n name: string\n\n /**\n * If ignore drawing and events of the element object\n */\n ignore: boolean\n\n /**\n * Whether to respond to mouse events.\n */\n silent: boolean\n\n /**\n * \u662F\u5426\u662F Group\n */\n isGroup: boolean\n\n /**\n * Whether it can be dragged.\n */\n draggable: boolean | 'horizontal' | 'vertical'\n\n /**\n * Whether is it dragging.\n */\n dragging: boolean\n\n parent: Group\n\n animators: Animator[] = []\n\n /**\n * If ignore clip from it's parent or hosts.\n * Applied on itself and all it's children.\n *\n * NOTE: It won't affect the clipPath set on the children.\n */\n ignoreClip: boolean\n\n /**\n * If element is used as a component of other element.\n */\n __hostTarget: Element\n\n /**\n * ZRender instance will be assigned when element is associated with zrender\n */\n __zr: ZRenderType\n\n /**\n * Dirty bits.\n * From which painter will determine if this displayable object needs brush.\n */\n __dirty: number\n\n /**\n * If element was painted on the screen\n */\n __isRendered: boolean;\n\n /**\n * If element has been moved to the hover layer.\n *\n * If so, dirty will only trigger the zrender refresh hover layer\n */\n __inHover: boolean\n\n /**\n * path to clip the elements and its children, if it is a group.\n * @see http://www.w3.org/TR/2dcontext/#clipping-region\n */\n private _clipPath?: Path\n\n /**\n * Attached text element.\n * `position`, `style.textAlign`, `style.textVerticalAlign`\n * of element will be ignored if textContent.position is set\n */\n private _textContent?: ZRText\n\n /**\n * Text guide line.\n */\n private _textGuide?: Polyline\n\n /**\n * Config of textContent. Inlcuding layout, color, ...etc.\n */\n textConfig?: ElementTextConfig\n\n /**\n * Config for guide line calculating.\n *\n * NOTE: This is just a property signature. READ and WRITE are all done in echarts.\n */\n textGuideLineConfig?: ElementTextGuideLineConfig\n\n // FOR ECHARTS\n /**\n * Id for mapping animation\n */\n anid: string\n\n extra: Dictionary\n\n currentStates?: string[] = []\n // prevStates is for storager in echarts.\n prevStates?: string[]\n /**\n * Store of element state.\n * '__normal__' key is preserved for default properties.\n */\n states: Dictionary = {}\n\n /**\n * Animation config applied on state switching.\n */\n stateTransition: ElementAnimateConfig\n\n /**\n * Proxy function for getting state with given stateName.\n * ZRender will first try to get with stateProxy. Then find from states if stateProxy returns nothing\n *\n * targetStates will be given in useStates\n */\n stateProxy?: (stateName: string, targetStates?: string[]) => ElementState\n\n protected _normalState: ElementState\n\n // Temporary storage for inside text color configuration.\n private _innerTextDefaultStyle: DefaultTextStyle\n\n constructor(props?: Props) {\n this._init(props);\n }\n\n protected _init(props?: Props) {\n // Init default properties\n this.attr(props);\n }\n\n /**\n * Drift element\n * @param {number} dx dx on the global space\n * @param {number} dy dy on the global space\n */\n drift(dx: number, dy: number, e?: ElementEvent) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n case 'vertical':\n dx = 0;\n break;\n }\n\n let m = this.transform;\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n m[4] += dx;\n m[5] += dy;\n\n this.decomposeTransform();\n this.markRedraw();\n }\n\n /**\n * Hook before update\n */\n beforeUpdate() {}\n /**\n * Hook after update\n */\n afterUpdate() {}\n /**\n * Update each frame\n */\n update() {\n this.updateTransform();\n\n if (this.__dirty) {\n this.updateInnerText();\n }\n }\n\n updateInnerText(forceUpdate?: boolean) {\n // Update textContent\n const textEl = this._textContent;\n if (textEl && (!textEl.ignore || forceUpdate)) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n const textConfig = this.textConfig;\n const isLocal = textConfig.local;\n const innerTransformable = textEl.innerTransformable;\n\n let textAlign: TextAlign;\n let textVerticalAlign: TextVerticalAlign;\n\n let textStyleChanged = false;\n\n // Apply host's transform.\n innerTransformable.parent = isLocal ? this as unknown as Group : null;\n\n let innerOrigin = false;\n\n // Reset x/y/rotation\n innerTransformable.copyTransform(textEl);\n\n // Force set attached text's position if `position` is in config.\n if (textConfig.position != null) {\n let layoutRect = tmpBoundingRect;\n if (textConfig.layoutRect) {\n layoutRect.copy(textConfig.layoutRect);\n }\n else {\n layoutRect.copy(this.getBoundingRect());\n }\n if (!isLocal) {\n layoutRect.applyTransform(this.transform);\n }\n\n if (this.calculateTextPosition) {\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n else {\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n\n // TODO Should modify back if textConfig.position is set to null again.\n // Or textContent is detached.\n innerTransformable.x = tmpTextPosCalcRes.x;\n innerTransformable.y = tmpTextPosCalcRes.y;\n\n // User specified align/verticalAlign has higher priority, which is\n // useful in the case that attached text is rotated 90 degree.\n textAlign = tmpTextPosCalcRes.align;\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\n\n const textOrigin = textConfig.origin;\n if (textOrigin && textConfig.rotation != null) {\n let relOriginX;\n let relOriginY;\n if (textOrigin === 'center') {\n relOriginX = layoutRect.width * 0.5;\n relOriginY = layoutRect.height * 0.5;\n }\n else {\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\n }\n\n innerOrigin = true;\n innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x);\n innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y);\n }\n }\n\n\n if (textConfig.rotation != null) {\n innerTransformable.rotation = textConfig.rotation;\n }\n\n // TODO\n const textOffset = textConfig.offset;\n if (textOffset) {\n innerTransformable.x += textOffset[0];\n innerTransformable.y += textOffset[1];\n\n // Not change the user set origin.\n if (!innerOrigin) {\n innerTransformable.originX = -textOffset[0];\n innerTransformable.originY = -textOffset[1];\n }\n }\n\n // Calculate text color\n const isInside = textConfig.inside == null // Force to be inside or not.\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\n : textConfig.inside;\n const innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\n\n let textFill;\n let textStroke;\n let autoStroke;\n if (isInside && this.canBeInsideText()) {\n // In most cases `textContent` need this \"auto\" strategy.\n // So by default be 'auto'. Otherwise users need to literally\n // set `insideFill: 'auto', insideStroke: 'auto'` each time.\n textFill = textConfig.insideFill;\n textStroke = textConfig.insideStroke;\n\n if (textFill == null || textFill === 'auto') {\n textFill = this.getInsideTextFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getInsideTextStroke(textFill);\n autoStroke = true;\n }\n }\n else {\n textFill = textConfig.outsideFill;\n textStroke = textConfig.outsideStroke;\n\n if (textFill == null || textFill === 'auto') {\n textFill = this.getOutsideFill();\n }\n // By default give a stroke to distinguish \"front end\" label with\n // messy background (like other text label, line or other graphic).\n // If textContent.style.fill specified, this auto stroke will not be used.\n if (textStroke == null || textStroke === 'auto') {\n // If some time need to customize the default stroke getter,\n // add some kind of override method.\n textStroke = this.getOutsideStroke(textFill);\n autoStroke = true;\n }\n }\n // Default `textFill` should must have a value to ensure text can be displayed.\n textFill = textFill || '#000';\n\n if (textFill !== innerTextDefaultStyle.fill\n || textStroke !== innerTextDefaultStyle.stroke\n || autoStroke !== innerTextDefaultStyle.autoStroke\n || textAlign !== innerTextDefaultStyle.align\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign\n ) {\n\n textStyleChanged = true;\n\n innerTextDefaultStyle.fill = textFill;\n innerTextDefaultStyle.stroke = textStroke;\n innerTextDefaultStyle.autoStroke = autoStroke;\n innerTextDefaultStyle.align = textAlign;\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\n\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\n }\n\n // Mark textEl to update transform.\n // DON'T use markRedraw. It will cause Element itself to dirty again.\n textEl.__dirty |= REDRAW_BIT;\n\n if (textStyleChanged) {\n // Only mark style dirty if necessary. Update ZRText is costly.\n textEl.dirtyStyle(true);\n }\n }\n }\n\n protected canBeInsideText() {\n return true;\n }\n\n protected getInsideTextFill(): string | undefined {\n return '#fff';\n }\n\n protected getInsideTextStroke(textFill: string): string | undefined {\n return '#000';\n }\n\n protected getOutsideFill(): string | undefined {\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\n }\n\n protected getOutsideStroke(textFill: string): string {\n const backgroundColor = this.__zr && this.__zr.getBackgroundColor();\n let colorArr = typeof backgroundColor === 'string' && parse(backgroundColor as string);\n if (!colorArr) {\n colorArr = [255, 255, 255, 1];\n }\n // Assume blending on a white / black(dark) background.\n const alpha = colorArr[3];\n const isDark = this.__zr.isDarkMode();\n for (let i = 0; i < 3; i++) {\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\n }\n colorArr[3] = 1;\n return stringify(colorArr, 'rgba');\n }\n\n traverse(\n cb: (this: Context, el: Element) => void,\n context?: Context\n ) {}\n\n protected attrKV(key: string, value: unknown) {\n if (key === 'textConfig') {\n this.setTextConfig(value as ElementTextConfig);\n }\n else if (key === 'textContent') {\n this.setTextContent(value as ZRText);\n }\n else if (key === 'clipPath') {\n this.setClipPath(value as Path);\n }\n else if (key === 'extra') {\n this.extra = this.extra || {};\n extend(this.extra, value);\n }\n else {\n (this as any)[key] = value;\n }\n }\n\n /**\n * Hide the element\n */\n hide() {\n this.ignore = true;\n this.markRedraw();\n }\n\n /**\n * Show the element\n */\n show() {\n this.ignore = false;\n this.markRedraw();\n }\n\n attr(keyOrObj: Props): this\n attr(keyOrObj: T, value: Props[T]): this\n attr(keyOrObj: keyof Props | Props, value?: unknown): this {\n if (typeof keyOrObj === 'string') {\n this.attrKV(keyOrObj as keyof ElementProps, value as AllPropTypes);\n }\n else if (isObject(keyOrObj)) {\n let obj = keyOrObj as object;\n let keysArr = keys(obj);\n for (let i = 0; i < keysArr.length; i++) {\n let key = keysArr[i];\n this.attrKV(key as keyof ElementProps, keyOrObj[key]);\n }\n }\n this.markRedraw();\n return this;\n }\n\n // Save current state to normal\n saveCurrentToNormalState(toState: ElementState) {\n this._innerSaveToNormal(toState);\n\n // If we are switching from normal to other state during animation.\n // We need to save final value of animation to the normal state. Not interpolated value.\n const normalState = this._normalState;\n for (let i = 0; i < this.animators.length; i++) {\n const animator = this.animators[i];\n const fromStateTransition = animator.__fromStateTransition;\n // Ignore animation from state transition(except normal).\n // Ignore loop animation.\n if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\n continue;\n }\n\n const targetName = animator.targetName;\n // Respecting the order of animation if multiple animator is\n // animating on the same property(If additive animation is used)\n const target = targetName\n ? (normalState as any)[targetName] : normalState;\n // Only save keys that are changed by the states.\n animator.saveTo(target);\n }\n }\n\n protected _innerSaveToNormal(toState: ElementState) {\n let normalState = this._normalState;\n if (!normalState) {\n // Clear previous stored normal states when switching from normalState to otherState.\n normalState = this._normalState = {};\n }\n if (toState.textConfig && !normalState.textConfig) {\n normalState.textConfig = this.textConfig;\n }\n\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n }\n\n protected _savePrimaryToNormal(\n toState: Dictionary, normalState: Dictionary, primaryKeys: readonly string[]\n ) {\n for (let i = 0; i < primaryKeys.length; i++) {\n let key = primaryKeys[i];\n // Only save property that will be changed by toState\n // and has not been saved to normalState yet.\n if (toState[key] != null && !(key in normalState)) {\n (normalState as any)[key] = (this as any)[key];\n }\n }\n }\n\n /**\n * If has any state.\n */\n hasState() {\n return this.currentStates.length > 0;\n }\n\n /**\n * Get state object\n */\n getState(name: string) {\n return this.states[name];\n }\n\n\n /**\n * Ensure state exists. If not, will create one and return.\n */\n ensureState(name: string) {\n const states = this.states;\n if (!states[name]) {\n states[name] = {};\n }\n return states[name];\n }\n\n /**\n * Clear all states.\n */\n clearStates(noAnimation?: boolean) {\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\n // TODO set _normalState to null?\n }\n /**\n * Use state. State is a collection of properties.\n * Will return current state object if state exists and stateName has been changed.\n *\n * @param stateName State name to be switched to\n * @param keepCurrentState If keep current states.\n * If not, it will inherit from the normal state.\n */\n useState(stateName: string, keepCurrentStates?: boolean, noAnimation?: boolean, forceUseHoverLayer?: boolean) {\n // Use preserved word __normal__\n // TODO: Only restore changed properties when restore to normal???\n const toNormalState = stateName === PRESERVED_NORMAL_STATE;\n const hasStates = this.hasState();\n\n if (!hasStates && toNormalState) {\n // If switched from normal to normal.\n return;\n }\n\n const currentStates = this.currentStates;\n const animationCfg = this.stateTransition;\n\n // No need to change in following cases:\n // 1. Keep current states. and already being applied before.\n // 2. Don't keep current states. And new state is same with the only one exists state.\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\n return;\n }\n\n let state;\n if (this.stateProxy && !toNormalState) {\n state = this.stateProxy(stateName);\n }\n\n if (!state) {\n state = (this.states && this.states[stateName]);\n }\n\n if (!state && !toNormalState) {\n logError(`State ${stateName} not exists.`);\n return;\n }\n\n if (!toNormalState) {\n this.saveCurrentToNormalState(state);\n }\n\n const useHoverLayer = !!((state && state.hoverLayer) || forceUseHoverLayer);\n\n if (useHoverLayer) {\n // Enter hover layer before states update.\n this._toggleHoverLayerFlag(true);\n }\n\n this._applyStateObj(\n stateName,\n state,\n this._normalState,\n keepCurrentStates,\n !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0,\n animationCfg\n );\n\n // Also set text content.\n const textContent = this._textContent;\n const textGuide = this._textGuide;\n if (textContent) {\n // Force textContent use hover layer if self is using it.\n textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n\n if (toNormalState) {\n // Clear state\n this.currentStates = [];\n // Reset normal state.\n this._normalState = {};\n }\n else {\n if (!keepCurrentStates) {\n this.currentStates = [stateName];\n }\n else {\n this.currentStates.push(stateName);\n }\n }\n\n // Update animating target to the new object after state changed.\n this._updateAnimationTargets();\n\n this.markRedraw();\n\n if (!useHoverLayer && this.__inHover) {\n // Leave hover layer after states update and markRedraw.\n this._toggleHoverLayerFlag(false);\n // NOTE: avoid unexpected refresh when moving out from hover layer!!\n // Only clear from hover layer.\n this.__dirty &= ~REDRAW_BIT;\n }\n\n // Return used state.\n return state;\n }\n\n /**\n * Apply multiple states.\n * @param states States list.\n */\n useStates(states: string[], noAnimation?: boolean, forceUseHoverLayer?: boolean) {\n if (!states.length) {\n this.clearStates();\n }\n else {\n const stateObjects: ElementState[] = [];\n const currentStates = this.currentStates;\n const len = states.length;\n let notChange = len === currentStates.length;\n if (notChange) {\n for (let i = 0; i < len; i++) {\n if (states[i] !== currentStates[i]) {\n notChange = false;\n break;\n }\n }\n }\n if (notChange) {\n return;\n }\n\n for (let i = 0; i < len; i++) {\n const stateName = states[i];\n let stateObj: ElementState;\n if (this.stateProxy) {\n stateObj = this.stateProxy(stateName, states);\n }\n if (!stateObj) {\n stateObj = this.states[stateName];\n }\n if (stateObj) {\n stateObjects.push(stateObj);\n }\n }\n\n const lastStateObj = stateObjects[len - 1];\n const useHoverLayer = !!((lastStateObj && lastStateObj.hoverLayer) || forceUseHoverLayer);\n if (useHoverLayer) {\n // Enter hover layer before states update.\n this._toggleHoverLayerFlag(true);\n }\n\n const mergedState = this._mergeStates(stateObjects);\n const animationCfg = this.stateTransition;\n\n this.saveCurrentToNormalState(mergedState);\n\n this._applyStateObj(\n states.join(','),\n mergedState,\n this._normalState,\n false,\n !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0,\n animationCfg\n );\n\n const textContent = this._textContent;\n const textGuide = this._textGuide;\n if (textContent) {\n textContent.useStates(states, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useStates(states, noAnimation, useHoverLayer);\n }\n\n this._updateAnimationTargets();\n\n // Create a copy\n this.currentStates = states.slice();\n this.markRedraw();\n\n if (!useHoverLayer && this.__inHover) {\n // Leave hover layer after states update and markRedraw.\n this._toggleHoverLayerFlag(false);\n // NOTE: avoid unexpected refresh when moving out from hover layer!!\n // Only clear from hover layer.\n this.__dirty &= ~REDRAW_BIT;\n }\n }\n }\n\n /**\n * Return if el.silent or any ancestor element has silent true.\n */\n isSilent() {\n let isSilent = this.silent;\n let ancestor = this.parent;\n while (!isSilent && ancestor) {\n if (ancestor.silent) {\n isSilent = true;\n break;\n }\n ancestor = ancestor.parent;\n }\n return isSilent;\n }\n\n /**\n * Update animation targets when reference is changed.\n */\n private _updateAnimationTargets() {\n for (let i = 0; i < this.animators.length; i++) {\n const animator = this.animators[i];\n if (animator.targetName) {\n animator.changeTarget((this as any)[animator.targetName]);\n }\n }\n }\n\n /**\n * Remove state\n * @param state State to remove\n */\n removeState(state: string) {\n const idx = indexOf(this.currentStates, state);\n if (idx >= 0) {\n const currentStates = this.currentStates.slice();\n currentStates.splice(idx, 1);\n this.useStates(currentStates);\n }\n }\n\n /**\n * Replace exists state.\n * @param oldState\n * @param newState\n * @param forceAdd If still add when even if replaced target not exists.\n */\n replaceState(oldState: string, newState: string, forceAdd: boolean) {\n const currentStates = this.currentStates.slice();\n const idx = indexOf(currentStates, oldState);\n const newStateExists = indexOf(currentStates, newState) >= 0;\n if (idx >= 0) {\n if (!newStateExists) {\n // Replace the old with the new one.\n currentStates[idx] = newState;\n }\n else {\n // Only remove the old one.\n currentStates.splice(idx, 1);\n }\n }\n else if (forceAdd && !newStateExists) {\n currentStates.push(newState);\n }\n this.useStates(currentStates);\n }\n\n /**\n * Toogle state.\n */\n toggleState(state: string, enable: boolean) {\n if (enable) {\n this.useState(state, true);\n }\n else {\n this.removeState(state);\n }\n }\n\n protected _mergeStates(states: ElementState[]) {\n const mergedState: ElementState = {};\n let mergedTextConfig: ElementTextConfig;\n for (let i = 0; i < states.length; i++) {\n const state = states[i];\n extend(mergedState, state);\n\n if (state.textConfig) {\n mergedTextConfig = mergedTextConfig || {};\n extend(mergedTextConfig, state.textConfig);\n }\n }\n if (mergedTextConfig) {\n mergedState.textConfig = mergedTextConfig;\n }\n\n return mergedState;\n }\n\n protected _applyStateObj(\n stateName: string,\n state: ElementState,\n normalState: ElementState,\n keepCurrentStates: boolean,\n transition: boolean,\n animationCfg: ElementAnimateConfig\n ) {\n const needsRestoreToNormal = !(state && keepCurrentStates);\n\n // TODO: Save current state to normal?\n // TODO: Animation\n if (state && state.textConfig) {\n // Inherit from current state or normal state.\n this.textConfig = extend(\n {},\n keepCurrentStates ? this.textConfig : normalState.textConfig\n );\n extend(this.textConfig, state.textConfig);\n }\n else if (needsRestoreToNormal) {\n if (normalState.textConfig) { // Only restore if changed and saved.\n this.textConfig = normalState.textConfig;\n }\n }\n\n const transitionTarget: Dictionary = {};\n let hasTransition = false;\n\n for (let i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\n const key = PRIMARY_STATES_KEYS[i];\n const propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\n\n if (state && state[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = state[key];\n }\n else {\n // Replace if it exist in target state\n (this as any)[key] = state[key];\n }\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = normalState[key];\n }\n else {\n // Restore to normal state\n (this as any)[key] = normalState[key];\n }\n }\n }\n }\n\n if (!transition) {\n // Keep the running animation to the new values after states changed.\n // Not simply stop animation. Or it may have jump effect.\n for (let i = 0; i < this.animators.length; i++) {\n const animator = this.animators[i];\n const targetName = animator.targetName;\n // Ignore loop animation\n if (!animator.getLoop()) {\n animator.__changeFinalValue(targetName\n ? ((state || normalState) as any)[targetName]\n : (state || normalState)\n );\n }\n }\n }\n\n if (hasTransition) {\n this._transitionState(\n stateName,\n transitionTarget as Props,\n animationCfg\n );\n }\n }\n\n /**\n * Component is some elements attached on this element for specific purpose.\n * Like clipPath, textContent\n */\n private _attachComponent(componentEl: Element) {\n if (componentEl.__zr && !componentEl.__hostTarget) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Text element has been added to zrender.');\n }\n return;\n }\n\n if (componentEl === this) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Recursive component attachment.');\n }\n return;\n }\n\n const zr = this.__zr;\n if (zr) {\n // Needs to add self to zrender. For rerender triggering, or animation.\n componentEl.addSelfToZr(zr);\n }\n\n componentEl.__zr = zr;\n componentEl.__hostTarget = this as unknown as Element;\n }\n\n private _detachComponent(componentEl: Element) {\n if (componentEl.__zr) {\n componentEl.removeSelfFromZr(componentEl.__zr);\n }\n\n componentEl.__zr = null;\n componentEl.__hostTarget = null;\n }\n\n /**\n * Get clip path\n */\n getClipPath() {\n return this._clipPath;\n }\n\n /**\n * Set clip path\n *\n * clipPath can't be shared between two elements.\n */\n setClipPath(clipPath: Path) {\n // Remove previous clip path\n if (this._clipPath && this._clipPath !== clipPath) {\n this.removeClipPath();\n }\n\n this._attachComponent(clipPath);\n\n this._clipPath = clipPath;\n this.markRedraw();\n }\n\n /**\n * Remove clip path\n */\n removeClipPath() {\n const clipPath = this._clipPath;\n if (clipPath) {\n this._detachComponent(clipPath);\n this._clipPath = null;\n this.markRedraw();\n }\n }\n\n /**\n * Get attached text content.\n */\n getTextContent(): ZRText {\n return this._textContent;\n }\n\n /**\n * Attach text on element\n */\n setTextContent(textEl: ZRText) {\n const previousTextContent = this._textContent;\n if (previousTextContent === textEl) {\n return;\n }\n // Remove previous textContent\n if (previousTextContent && previousTextContent !== textEl) {\n this.removeTextContent();\n }\n if (process.env.NODE_ENV !== 'production') {\n if (textEl.__zr && !textEl.__hostTarget) {\n throw new Error('Text element has been added to zrender.');\n }\n }\n\n textEl.innerTransformable = new Transformable();\n\n this._attachComponent(textEl);\n\n this._textContent = textEl;\n\n this.markRedraw();\n }\n\n /**\n * Set layout of attached text. Will merge with the previous.\n */\n setTextConfig(cfg: ElementTextConfig) {\n // TODO hide cfg property?\n if (!this.textConfig) {\n this.textConfig = {};\n }\n extend(this.textConfig, cfg);\n this.markRedraw();\n }\n\n /**\n * Remove text config\n */\n removeTextConfig() {\n this.textConfig = null;\n this.markRedraw();\n }\n\n /**\n * Remove attached text element.\n */\n removeTextContent() {\n const textEl = this._textContent;\n if (textEl) {\n textEl.innerTransformable = null;\n this._detachComponent(textEl);\n this._textContent = null;\n this._innerTextDefaultStyle = null;\n this.markRedraw();\n }\n }\n\n getTextGuideLine(): Polyline {\n return this._textGuide;\n }\n\n setTextGuideLine(guideLine: Polyline) {\n // Remove previous clip path\n if (this._textGuide && this._textGuide !== guideLine) {\n this.removeTextGuideLine();\n }\n\n this._attachComponent(guideLine);\n\n this._textGuide = guideLine;\n\n this.markRedraw();\n }\n\n removeTextGuideLine() {\n const textGuide = this._textGuide;\n if (textGuide) {\n this._detachComponent(textGuide);\n this._textGuide = null;\n this.markRedraw();\n }\n }\n /**\n * Mark element needs to be repainted\n */\n markRedraw() {\n this.__dirty |= REDRAW_BIT;\n const zr = this.__zr;\n if (zr) {\n if (this.__inHover) {\n zr.refreshHover();\n }\n else {\n zr.refresh();\n }\n }\n\n // Used as a clipPath or textContent\n if (this.__hostTarget) {\n this.__hostTarget.markRedraw();\n }\n }\n\n /**\n * Besides marking elements to be refreshed.\n * It will also invalid all cache and doing recalculate next frame.\n */\n dirty() {\n this.markRedraw();\n }\n\n private _toggleHoverLayerFlag(inHover: boolean) {\n this.__inHover = inHover;\n const textContent = this._textContent;\n const textGuide = this._textGuide;\n if (textContent) {\n textContent.__inHover = inHover;\n }\n if (textGuide) {\n textGuide.__inHover = inHover;\n }\n }\n\n /**\n * Add self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n */\n addSelfToZr(zr: ZRenderType) {\n if (this.__zr === zr) {\n return;\n }\n\n this.__zr = zr;\n // \u6DFB\u52A0\u52A8\u753B\n const animators = this.animators;\n if (animators) {\n for (let i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n\n if (this._clipPath) {\n this._clipPath.addSelfToZr(zr);\n }\n if (this._textContent) {\n this._textContent.addSelfToZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.addSelfToZr(zr);\n }\n }\n\n /**\n * Remove self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n */\n removeSelfFromZr(zr: ZRenderType) {\n if (!this.__zr) {\n return;\n }\n\n this.__zr = null;\n // Remove animation\n const animators = this.animators;\n if (animators) {\n for (let i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n\n if (this._clipPath) {\n this._clipPath.removeSelfFromZr(zr);\n }\n if (this._textContent) {\n this._textContent.removeSelfFromZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.removeSelfFromZr(zr);\n }\n }\n\n /**\n * \u52A8\u753B\n *\n * @param path The key to fetch value from object. Mostly style or shape.\n * @param loop Whether to loop animation.\n * @param allowDiscreteAnimation Whether to allow discrete animation\n * @example:\n * el.animate('style', false)\n * .when(1000, {x: 10} )\n * .done(function(){ // Animation done })\n * .start()\n */\n animate(key?: string, loop?: boolean, allowDiscreteAnimation?: boolean) {\n let target = key ? (this as any)[key] : this;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!target) {\n logError(\n 'Property \"'\n + key\n + '\" is not existed in element '\n + this.id\n );\n return;\n }\n }\n\n const animator = new Animator(target, loop, allowDiscreteAnimation);\n key && (animator.targetName = key);\n this.addAnimator(animator, key);\n return animator;\n }\n\n addAnimator(animator: Animator, key: string): void {\n const zr = this.__zr;\n\n const el = this;\n\n animator.during(function () {\n el.updateDuringAnimation(key as string);\n }).done(function () {\n const animators = el.animators;\n // FIXME Animator will not be removed if use `Animator#stop` to stop animation\n const idx = indexOf(animators, animator);\n if (idx >= 0) {\n animators.splice(idx, 1);\n }\n });\n\n this.animators.push(animator);\n\n // If animate after added to the zrender\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n\n // Wake up zrender to start the animation loop.\n zr && zr.wakeUp();\n }\n\n updateDuringAnimation(key: string) {\n this.markRedraw();\n }\n\n /**\n * \u505C\u6B62\u52A8\u753B\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stopAnimation(scope?: string, forwardToLast?: boolean) {\n const animators = this.animators;\n const len = animators.length;\n const leftAnimators: Animator[] = [];\n for (let i = 0; i < len; i++) {\n const animator = animators[i];\n if (!scope || scope === animator.scope) {\n animator.stop(forwardToLast);\n }\n else {\n leftAnimators.push(animator);\n }\n }\n this.animators = leftAnimators;\n\n return this;\n }\n\n /**\n * @param animationProps A map to specify which property to animate. If not specified, will animate all.\n * @example\n * // Animate position\n * el.animateTo({\n * position: [10, 10]\n * }, { done: () => { // done } })\n *\n * // Animate shape, style and position in 100ms, delayed 100ms, with cubicOut easing\n * el.animateTo({\n * shape: {\n * width: 500\n * },\n * style: {\n * fill: 'red'\n * }\n * position: [10, 10]\n * }, {\n * duration: 100,\n * delay: 100,\n * easing: 'cubicOut',\n * done: () => { // done }\n * })\n */\n animateTo(target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType) {\n animateTo(this, target, cfg, animationProps);\n }\n\n /**\n * Animate from the target state to current state.\n * The params and the value are the same as `this.animateTo`.\n */\n\n // Overload definitions\n animateFrom(\n target: Props, cfg: ElementAnimateConfig, animationProps?: MapToType\n ) {\n animateTo(this, target, cfg, animationProps, true);\n }\n\n protected _transitionState(\n stateName: string, target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType\n ) {\n const animators = animateTo(this, target, cfg, animationProps);\n for (let i = 0; i < animators.length; i++) {\n animators[i].__fromStateTransition = stateName;\n }\n }\n\n /**\n * Interface of getting the minimum bounding box.\n */\n getBoundingRect(): BoundingRect {\n return null;\n }\n\n getPaintRect(): BoundingRect {\n return null;\n }\n\n /**\n * The string value of `textPosition` needs to be calculated to a real postion.\n * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]`\n * by default. See `contain/text.js#calculateTextPosition` for more details.\n * But some coutom shapes like \"pin\", \"flag\" have center that is not exactly\n * `[width/2, height/2]`. So we provide this hook to customize the calculation\n * for those shapes. It will be called if the `style.textPosition` is a string.\n * @param {Obejct} [out] Prepared out object. If not provided, this method should\n * be responsible for creating one.\n * @param {module:zrender/graphic/Style} style\n * @param {Object} rect {x, y, width, height}\n * @return {Obejct} out The same as the input out.\n * {\n * x: number. mandatory.\n * y: number. mandatory.\n * align: string. optional. use style.textAlign by default.\n * verticalAlign: string. optional. use style.textVerticalAlign by default.\n * }\n */\n calculateTextPosition: ElementCalculateTextPosition;\n\n protected static initDefaultProps = (function () {\n const elProto = Element.prototype;\n elProto.type = 'element';\n elProto.name = '';\n\n elProto.ignore =\n elProto.silent =\n elProto.isGroup =\n elProto.draggable =\n elProto.dragging =\n elProto.ignoreClip =\n elProto.__inHover = false;\n\n elProto.__dirty = REDRAW_BIT;\n\n\n const logs: Dictionary = {};\n function logDeprecatedError(key: string, xKey: string, yKey: string) {\n if (!logs[key + xKey + yKey]) {\n console.warn(`DEPRECATED: '${key}' has been deprecated. use '${xKey}', '${yKey}' instead`);\n logs[key + xKey + yKey] = true;\n }\n }\n // Legacy transform properties. position and scale\n function createLegacyProperty(\n key: string,\n privateKey: string,\n xKey: string,\n yKey: string\n ) {\n Object.defineProperty(elProto, key, {\n get() {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n if (!this[privateKey]) {\n const pos: number[] = this[privateKey] = [];\n enhanceArray(this, pos);\n }\n return this[privateKey];\n },\n set(pos: number[]) {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n this[xKey] = pos[0];\n this[yKey] = pos[1];\n this[privateKey] = pos;\n enhanceArray(this, pos);\n }\n });\n function enhanceArray(self: any, pos: number[]) {\n Object.defineProperty(pos, 0, {\n get() {\n return self[xKey];\n },\n set(val: number) {\n self[xKey] = val;\n }\n });\n Object.defineProperty(pos, 1, {\n get() {\n return self[yKey];\n },\n set(val: number) {\n self[yKey] = val;\n }\n });\n }\n }\n if (Object.defineProperty\n // Just don't support ie8\n // && (!(env as any).browser.ie || (env as any).browser.version > 8)\n ) {\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\n }\n })()\n}\n\nmixin(Element, Eventful);\nmixin(Element, Transformable);\n\nfunction animateTo(\n animatable: Element,\n target: Dictionary,\n cfg: ElementAnimateConfig,\n animationProps: Dictionary,\n reverse?: boolean\n) {\n cfg = cfg || {};\n const animators: Animator[] = [];\n animateToShallow(\n animatable,\n '',\n animatable,\n target,\n cfg,\n animationProps,\n animators,\n reverse\n );\n\n let finishCount = animators.length;\n let doneHappened = false;\n const cfgDone = cfg.done;\n const cfgAborted = cfg.aborted;\n\n const doneCb = () => {\n doneHappened = true;\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n\n const abortedCb = () => {\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n\n // No animators. This should be checked before animators[i].start(),\n // because 'done' may be executed immediately if no need to animate.\n if (!finishCount) {\n cfgDone && cfgDone();\n }\n\n // Adding during callback to the first animator\n if (animators.length > 0 && cfg.during) {\n // TODO If there are two animators in animateTo, and the first one is stopped by other animator.\n animators[0].during((target, percent) => {\n cfg.during(percent);\n });\n }\n\n // Start after all animators created\n // Incase any animator is done immediately when all animation properties are not changed\n for (let i = 0; i < animators.length; i++) {\n const animator = animators[i];\n if (doneCb) {\n animator.done(doneCb);\n }\n if (abortedCb) {\n animator.aborted(abortedCb);\n }\n if (cfg.force) {\n animator.duration(cfg.duration);\n }\n animator.start(cfg.easing);\n }\n\n return animators;\n}\n\nfunction copyArrShallow(source: number[], target: number[], len: number) {\n for (let i = 0; i < len; i++) {\n source[i] = target[i];\n }\n}\n\nfunction is2DArray(value: any[]): value is number[][] {\n return isArrayLike(value[0]);\n}\n\nfunction copyValue(target: Dictionary, source: Dictionary, key: string) {\n if (isArrayLike(source[key])) {\n if (!isArrayLike(target[key])) {\n target[key] = [];\n }\n\n if (isTypedArray(source[key])) {\n const len = source[key].length;\n if (target[key].length !== len) {\n target[key] = new (source[key].constructor)(len);\n copyArrShallow(target[key], source[key], len);\n }\n }\n else {\n const sourceArr = source[key] as any[];\n const targetArr = target[key] as any[];\n\n const len0 = sourceArr.length;\n if (is2DArray(sourceArr)) {\n // NOTE: each item should have same length\n const len1 = sourceArr[0].length;\n\n for (let i = 0; i < len0; i++) {\n if (!targetArr[i]) {\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\n }\n else {\n copyArrShallow(targetArr[i], sourceArr[i], len1);\n }\n }\n }\n else {\n copyArrShallow(targetArr, sourceArr, len0);\n }\n\n targetArr.length = sourceArr.length;\n }\n }\n else {\n target[key] = source[key];\n }\n}\n\nfunction isValueSame(val1: any, val2: any) {\n return val1 === val2\n // Only check 1 dimension array\n || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2);\n}\n\nfunction is1DArraySame(arr0: ArrayLike, arr1: ArrayLike) {\n const len = arr0.length;\n if (len !== arr1.length) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction animateToShallow(\n animatable: Element,\n topKey: string,\n animateObj: Dictionary,\n target: Dictionary,\n cfg: ElementAnimateConfig,\n animationProps: Dictionary | true,\n animators: Animator[],\n reverse: boolean // If `true`, animate from the `target` to current state.\n) {\n const targetKeys = keys(target);\n const duration = cfg.duration;\n const delay = cfg.delay;\n const additive = cfg.additive;\n const setToFinal = cfg.setToFinal;\n const animateAll = !isObject(animationProps);\n // Find last animator animating same prop.\n const existsAnimators = animatable.animators;\n\n let animationKeys: string[] = [];\n for (let k = 0; k < targetKeys.length; k++) {\n const innerKey = targetKeys[k] as string;\n const targetVal = target[innerKey];\n\n if (\n targetVal != null && animateObj[innerKey] != null\n && (animateAll || (animationProps as Dictionary)[innerKey])\n ) {\n if (isObject(targetVal)\n && !isArrayLike(targetVal)\n && !isGradientObject(targetVal)\n ) {\n if (topKey) {\n // logError('Only support 1 depth nest object animation.');\n // Assign directly.\n // TODO richText?\n if (!reverse) {\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n }\n continue;\n }\n animateToShallow(\n animatable,\n innerKey,\n animateObj[innerKey],\n targetVal,\n cfg,\n animationProps && (animationProps as Dictionary)[innerKey],\n animators,\n reverse\n );\n }\n else {\n animationKeys.push(innerKey);\n }\n }\n else if (!reverse) {\n // Assign target value directly.\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n // Previous animation will be stopped on the changed keys.\n // So direct assign is also included.\n animationKeys.push(innerKey);\n }\n }\n\n let keyLen = animationKeys.length;\n // Stop previous animations on the same property.\n if (!additive && keyLen) {\n // Stop exists animation on specific tracks. Only one animator available for each property.\n // TODO Should invoke previous animation callback?\n for (let i = 0; i < existsAnimators.length; i++) {\n const animator = existsAnimators[i];\n if (animator.targetName === topKey) {\n const allAborted = animator.stopTracks(animationKeys);\n if (allAborted) { // This animator can't be used.\n const idx = indexOf(existsAnimators, animator);\n existsAnimators.splice(idx, 1);\n }\n }\n }\n }\n\n // Ignore values not changed.\n // NOTE: Must filter it after previous animation stopped\n // and make sure the value to compare is using initial frame if animation is not started yet when setToFinal is used.\n if (!cfg.force) {\n animationKeys = filter(animationKeys, key => !isValueSame(target[key], animateObj[key]));\n keyLen = animationKeys.length;\n }\n\n if (keyLen > 0\n // cfg.force is mainly for keep invoking onframe and ondone callback even if animation is not necessary.\n // So if there is already has animators. There is no need to create another animator if not necessary.\n // Or it will always add one more with empty target.\n || (cfg.force && !animators.length)\n ) {\n let revertedSource: Dictionary;\n let reversedTarget: Dictionary;\n let sourceClone: Dictionary;\n if (reverse) {\n reversedTarget = {};\n if (setToFinal) {\n revertedSource = {};\n }\n for (let i = 0; i < keyLen; i++) {\n const innerKey = animationKeys[i];\n reversedTarget[innerKey] = animateObj[innerKey];\n if (setToFinal) {\n revertedSource[innerKey] = target[innerKey];\n }\n else {\n // The usage of \"animateFrom\" expects that the element props has been updated dirctly to\n // \"final\" values outside, and input the \"from\" values here (i.e., in variable `target` here).\n // So here we assign the \"from\" values directly to element here (rather that in the next frame)\n // to prevent the \"final\" values from being read in any other places (like other running\n // animator during callbacks).\n // But if `setToFinal: true` this feature can not be satisfied.\n animateObj[innerKey] = target[innerKey];\n }\n }\n }\n else if (setToFinal) {\n sourceClone = {};\n for (let i = 0; i < keyLen; i++) {\n const innerKey = animationKeys[i];\n // NOTE: Must clone source after the stopTracks. The property may be modified in stopTracks.\n sourceClone[innerKey] = cloneValue(animateObj[innerKey]);\n // Use copy, not change the original reference\n // Copy from target to source.\n copyValue(animateObj, target, innerKey);\n }\n }\n\n const animator = new Animator(animateObj, false, false, additive ? filter(\n // Use key string instead object reference because ref may be changed.\n existsAnimators, animator => animator.targetName === topKey\n ) : null);\n\n animator.targetName = topKey;\n if (cfg.scope) {\n animator.scope = cfg.scope;\n }\n\n if (setToFinal && revertedSource) {\n animator.whenWithKeys(0, revertedSource, animationKeys);\n }\n if (sourceClone) {\n animator.whenWithKeys(0, sourceClone, animationKeys);\n }\n\n animator.whenWithKeys(\n duration == null ? 500 : duration,\n reverse ? reversedTarget : target,\n animationKeys\n ).delay(delay || 0);\n\n animatable.addAnimator(animator, topKey);\n animators.push(animator);\n }\n}\n\n\nexport default Element;\n", "/**\n * Group\u662F\u4E00\u4E2A\u5BB9\u5668\uFF0C\u53EF\u4EE5\u63D2\u5165\u5B50\u8282\u70B9\uFF0CGroup\u7684\u53D8\u6362\u4E5F\u4F1A\u88AB\u5E94\u7528\u5230\u5B50\u8282\u70B9\u4E0A\n * @module zrender/graphic/Group\n * @example\n * const Group = require('zrender/graphic/Group');\n * const Circle = require('zrender/graphic/shape/Circle');\n * const g = new Group();\n * g.position[0] = 100;\n * g.position[1] = 100;\n * g.add(new Circle({\n * style: {\n * x: 100,\n * y: 100,\n * r: 20,\n * }\n * }));\n * zr.add(g);\n */\n\nimport * as zrUtil from '../core/util';\nimport Element, { ElementProps } from '../Element';\nimport BoundingRect from '../core/BoundingRect';\nimport { MatrixArray } from '../core/matrix';\nimport Displayable from './Displayable';\nimport { ZRenderType } from '../zrender';\n\nexport interface GroupProps extends ElementProps {\n}\n\nclass Group extends Element {\n\n readonly isGroup = true\n\n private _children: Element[] = []\n\n\n constructor(opts?: GroupProps) {\n super();\n\n this.attr(opts);\n }\n\n /**\n * Get children reference.\n */\n childrenRef() {\n return this._children;\n }\n\n /**\n * Get children copy.\n */\n children() {\n return this._children.slice();\n }\n\n /**\n * \u83B7\u53D6\u6307\u5B9A index \u7684\u513F\u5B50\u8282\u70B9\n */\n childAt(idx: number): Element {\n return this._children[idx];\n }\n\n /**\n * \u83B7\u53D6\u6307\u5B9A\u540D\u5B57\u7684\u513F\u5B50\u8282\u70B9\n */\n childOfName(name: string): Element {\n const children = this._children;\n for (let i = 0; i < children.length; i++) {\n if (children[i].name === name) {\n return children[i];\n }\n }\n }\n\n childCount(): number {\n return this._children.length;\n }\n\n /**\n * \u6DFB\u52A0\u5B50\u8282\u70B9\u5230\u6700\u540E\n */\n add(child: Element): Group {\n if (child) {\n if (child !== this && child.parent !== this) {\n this._children.push(child);\n this._doAdd(child);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (child.__hostTarget) {\n throw 'This elemenet has been used as an attachment';\n }\n }\n }\n\n return this;\n }\n\n /**\n * \u6DFB\u52A0\u5B50\u8282\u70B9\u5728 nextSibling \u4E4B\u524D\n */\n addBefore(child: Element, nextSibling: Element) {\n if (child && child !== this && child.parent !== this\n && nextSibling && nextSibling.parent === this) {\n\n const children = this._children;\n const idx = children.indexOf(nextSibling);\n\n if (idx >= 0) {\n children.splice(idx, 0, child);\n this._doAdd(child);\n }\n }\n\n return this;\n }\n\n replace(oldChild: Element, newChild: Element) {\n const idx = zrUtil.indexOf(this._children, oldChild);\n if (idx >= 0) {\n this.replaceAt(newChild, idx);\n }\n return this;\n }\n\n replaceAt(child: Element, index: number) {\n const children = this._children;\n const old = children[index];\n\n if (child && child !== this && child.parent !== this && child !== old) {\n children[index] = child;\n\n old.parent = null;\n const zr = this.__zr;\n if (zr) {\n old.removeSelfFromZr(zr);\n }\n\n this._doAdd(child);\n }\n\n return this;\n }\n\n _doAdd(child: Element) {\n if (child.parent) {\n // Parent must be a group\n (child.parent as Group).remove(child);\n }\n\n child.parent = this;\n\n const zr = this.__zr;\n if (zr && zr !== (child as Group).__zr) { // Only group has __storage\n\n child.addSelfToZr(zr);\n }\n\n zr && zr.refresh();\n }\n\n /**\n * Remove child\n * @param child\n */\n remove(child: Element) {\n const zr = this.__zr;\n const children = this._children;\n\n const idx = zrUtil.indexOf(children, child);\n if (idx < 0) {\n return this;\n }\n children.splice(idx, 1);\n\n child.parent = null;\n\n if (zr) {\n\n child.removeSelfFromZr(zr);\n }\n\n zr && zr.refresh();\n\n return this;\n }\n\n /**\n * Remove all children\n */\n removeAll() {\n const children = this._children;\n const zr = this.__zr;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n child.parent = null;\n }\n children.length = 0;\n\n return this;\n }\n\n /**\n * \u904D\u5386\u6240\u6709\u5B50\u8282\u70B9\n */\n eachChild(\n cb: (this: Context, el: Element, index?: number) => void,\n context?: Context\n ) {\n const children = this._children;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n cb.call(context, child, i);\n }\n return this;\n }\n\n /**\n * Visit all descendants.\n * Return false in callback to stop visit descendants of current node\n */\n // TODO Group itself should also invoke the callback.\n traverse(\n cb: (this: T, el: Element) => boolean | void,\n context?: T\n ) {\n for (let i = 0; i < this._children.length; i++) {\n const child = this._children[i];\n const stopped = cb.call(context, child);\n\n if (child.isGroup && !stopped) {\n child.traverse(cb, context);\n }\n }\n return this;\n }\n\n addSelfToZr(zr: ZRenderType) {\n super.addSelfToZr(zr);\n for (let i = 0; i < this._children.length; i++) {\n const child = this._children[i];\n child.addSelfToZr(zr);\n }\n }\n\n removeSelfFromZr(zr: ZRenderType) {\n super.removeSelfFromZr(zr);\n for (let i = 0; i < this._children.length; i++) {\n const child = this._children[i];\n child.removeSelfFromZr(zr);\n }\n }\n\n getBoundingRect(includeChildren?: Element[]): BoundingRect {\n // TODO Caching\n const tmpRect = new BoundingRect(0, 0, 0, 0);\n const children = includeChildren || this._children;\n const tmpMat: MatrixArray = [];\n let rect = null;\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n // TODO invisible?\n if (child.ignore || (child as Displayable).invisible) {\n continue;\n }\n\n const childRect = child.getBoundingRect();\n const transform = child.getLocalTransform(tmpMat);\n // TODO\n // The boundingRect cacluated by transforming original\n // rect may be bigger than the actual bundingRect when rotation\n // is used. (Consider a circle rotated aginst its center, where\n // the actual boundingRect should be the same as that not be\n // rotated.) But we can not find better approach to calculate\n // actual boundingRect yet, considering performance.\n if (transform) {\n BoundingRect.applyTransform(tmpRect, childRect, transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n return rect || tmpRect;\n }\n}\n\nGroup.prototype.type = 'group';\n// Storage will use childrenRef to get children to render.\nexport interface GroupLike extends Element {\n childrenRef(): Element[]\n}\n\nexport default Group;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The method \"quantile\" was copied from \"d3.js\".\r\n* (See more details in the comment of the method below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\n\r\nconst RADIAN_EPSILON = 1e-4;\r\n// Although chrome already enlarge this number to 100 for `toFixed`, but\r\n// we sill follow the spec for compatibility.\r\nconst ROUND_SUPPORTED_PRECISION_MAX = 20;\r\n\r\nfunction _trim(str: string): string {\r\n return str.replace(/^\\s+|\\s+$/g, '');\r\n}\r\n\r\n/**\r\n * Linear mapping a value from domain to range\r\n * @param val\r\n * @param domain Domain extent domain[0] can be bigger than domain[1]\r\n * @param range Range extent range[0] can be bigger than range[1]\r\n * @param clamp Default to be false\r\n */\r\nexport function linearMap(\r\n val: number,\r\n domain: number[],\r\n range: number[],\r\n clamp?: boolean\r\n): number {\r\n const d0 = domain[0];\r\n const d1 = domain[1];\r\n const r0 = range[0];\r\n const r1 = range[1];\r\n\r\n const subDomain = d1 - d0;\r\n const subRange = r1 - r0;\r\n\r\n if (subDomain === 0) {\r\n return subRange === 0\r\n ? r0\r\n : (r0 + r1) / 2;\r\n }\r\n\r\n // Avoid accuracy problem in edge, such as\r\n // 146.39 - 62.83 === 83.55999999999999.\r\n // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError\r\n // It is a little verbose for efficiency considering this method\r\n // is a hotspot.\r\n if (clamp) {\r\n if (subDomain > 0) {\r\n if (val <= d0) {\r\n return r0;\r\n }\r\n else if (val >= d1) {\r\n return r1;\r\n }\r\n }\r\n else {\r\n if (val >= d0) {\r\n return r0;\r\n }\r\n else if (val <= d1) {\r\n return r1;\r\n }\r\n }\r\n }\r\n else {\r\n if (val === d0) {\r\n return r0;\r\n }\r\n if (val === d1) {\r\n return r1;\r\n }\r\n }\r\n\r\n return (val - d0) / subDomain * subRange + r0;\r\n}\r\n\r\n/**\r\n * Convert a percent string to absolute number.\r\n * Returns NaN if percent is not a valid string or number\r\n */\r\nexport function parsePercent(percent: number | string, all: number): number {\r\n switch (percent) {\r\n case 'center':\r\n case 'middle':\r\n percent = '50%';\r\n break;\r\n case 'left':\r\n case 'top':\r\n percent = '0%';\r\n break;\r\n case 'right':\r\n case 'bottom':\r\n percent = '100%';\r\n break;\r\n }\r\n if (zrUtil.isString(percent)) {\r\n if (_trim(percent).match(/%$/)) {\r\n return parseFloat(percent) / 100 * all;\r\n }\r\n\r\n return parseFloat(percent);\r\n }\r\n\r\n return percent == null ? NaN : +percent;\r\n}\r\n\r\n/**\r\n * (1) Fix rounding error of float numbers.\r\n * (2) Support return string to avoid scientific notation like '3.5e-7'.\r\n */\r\nexport function round(x: number | string, precision?: number): number;\r\nexport function round(x: number | string, precision: number, returnStr: false): number;\r\nexport function round(x: number | string, precision: number, returnStr: true): string;\r\nexport function round(x: number | string, precision?: number, returnStr?: boolean): string | number {\r\n if (precision == null) {\r\n precision = 10;\r\n }\r\n // Avoid range error\r\n precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX);\r\n // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01'\r\n x = (+x).toFixed(precision);\r\n return (returnStr ? x : +x);\r\n}\r\n\r\n/**\r\n * Inplacd asc sort arr.\r\n * The input arr will be modified.\r\n */\r\nexport function asc(arr: T): T {\r\n arr.sort(function (a, b) {\r\n return a - b;\r\n });\r\n return arr;\r\n}\r\n\r\n/**\r\n * Get precision.\r\n */\r\nexport function getPrecision(val: string | number): number {\r\n val = +val;\r\n if (isNaN(val)) {\r\n return 0;\r\n }\r\n\r\n // It is much faster than methods converting number to string as follows\r\n // let tmp = val.toString();\r\n // return tmp.length - 1 - tmp.indexOf('.');\r\n // especially when precision is low\r\n // Notice:\r\n // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`.\r\n // (see https://jsbench.me/2vkpcekkvw/1)\r\n // (2) If the val is less than for example 1e-15, the result may be incorrect.\r\n // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`)\r\n if (val > 1e-14) {\r\n let e = 1;\r\n for (let i = 0; i < 15; i++, e *= 10) {\r\n if (Math.round(val * e) / e === val) {\r\n return i;\r\n }\r\n }\r\n }\r\n\r\n return getPrecisionSafe(val);\r\n}\r\n\r\n/**\r\n * Get precision with slow but safe method\r\n */\r\nexport function getPrecisionSafe(val: string | number): number {\r\n // toLowerCase for: '3.4E-12'\r\n const str = val.toString().toLowerCase();\r\n\r\n // Consider scientific notation: '3.4e-12' '3.4e+12'\r\n const eIndex = str.indexOf('e');\r\n const exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0;\r\n const significandPartLen = eIndex > 0 ? eIndex : str.length;\r\n const dotIndex = str.indexOf('.');\r\n const decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex;\r\n return Math.max(0, decimalPartLen - exp);\r\n}\r\n\r\n/**\r\n * Minimal dicernible data precisioin according to a single pixel.\r\n */\r\nexport function getPixelPrecision(dataExtent: [number, number], pixelExtent: [number, number]): number {\r\n const log = Math.log;\r\n const LN10 = Math.LN10;\r\n const dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\r\n const sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);\r\n // toFixed() digits argument must be between 0 and 20.\r\n const precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\r\n return !isFinite(precision) ? 20 : precision;\r\n}\r\n\r\n/**\r\n * Get a data of given precision, assuring the sum of percentages\r\n * in valueList is 1.\r\n * The largest remainder method is used.\r\n * https://en.wikipedia.org/wiki/Largest_remainder_method\r\n *\r\n * @param valueList a list of all data\r\n * @param idx index of the data to be processed in valueList\r\n * @param precision integer number showing digits of precision\r\n * @return percent ranging from 0 to 100\r\n */\r\nexport function getPercentWithPrecision(valueList: number[], idx: number, precision: number): number {\r\n if (!valueList[idx]) {\r\n return 0;\r\n }\r\n\r\n const seats = getPercentSeats(valueList, precision);\r\n\r\n return seats[idx] || 0;\r\n}\r\n\r\n/**\r\n * Get a data of given precision, assuring the sum of percentages\r\n * in valueList is 1.\r\n * The largest remainder method is used.\r\n * https://en.wikipedia.org/wiki/Largest_remainder_method\r\n *\r\n * @param valueList a list of all data\r\n * @param precision integer number showing digits of precision\r\n * @return {Array}\r\n */\r\nexport function getPercentSeats(valueList: number[], precision: number): number[] {\r\n const sum = zrUtil.reduce(valueList, function (acc, val) {\r\n return acc + (isNaN(val) ? 0 : val);\r\n }, 0);\r\n if (sum === 0) {\r\n return [];\r\n }\r\n\r\n const digits = Math.pow(10, precision);\r\n const votesPerQuota = zrUtil.map(valueList, function (val) {\r\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\r\n });\r\n const targetSeats = digits * 100;\r\n\r\n const seats = zrUtil.map(votesPerQuota, function (votes) {\r\n // Assign automatic seats.\r\n return Math.floor(votes);\r\n });\r\n let currentSum = zrUtil.reduce(seats, function (acc, val) {\r\n return acc + val;\r\n }, 0);\r\n\r\n const remainder = zrUtil.map(votesPerQuota, function (votes, idx) {\r\n return votes - seats[idx];\r\n });\r\n\r\n // Has remainding votes.\r\n while (currentSum < targetSeats) {\r\n // Find next largest remainder.\r\n let max = Number.NEGATIVE_INFINITY;\r\n let maxId = null;\r\n for (let i = 0, len = remainder.length; i < len; ++i) {\r\n if (remainder[i] > max) {\r\n max = remainder[i];\r\n maxId = i;\r\n }\r\n }\r\n\r\n // Add a vote to max remainder.\r\n ++seats[maxId];\r\n remainder[maxId] = 0;\r\n ++currentSum;\r\n }\r\n return zrUtil.map(seats, function (seat) {\r\n return seat / digits;\r\n });\r\n}\r\n\r\n/**\r\n * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004\r\n * See \r\n */\r\nexport function addSafe(val0: number, val1: number): number {\r\n const maxPrecision = Math.max(getPrecision(val0), getPrecision(val1));\r\n // const multiplier = Math.pow(10, maxPrecision);\r\n // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier;\r\n const sum = val0 + val1;\r\n // // PENDING: support more?\r\n return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX\r\n ? sum : round(sum, maxPrecision);\r\n}\r\n\r\n// Number.MAX_SAFE_INTEGER, ie do not support.\r\nexport const MAX_SAFE_INTEGER = 9007199254740991;\r\n\r\n/**\r\n * To 0 - 2 * PI, considering negative radian.\r\n */\r\nexport function remRadian(radian: number): number {\r\n const pi2 = Math.PI * 2;\r\n return (radian % pi2 + pi2) % pi2;\r\n}\r\n\r\n/**\r\n * @param {type} radian\r\n * @return {boolean}\r\n */\r\nexport function isRadianAroundZero(val: number): boolean {\r\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\r\n}\r\n\r\n// eslint-disable-next-line\r\nconst TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // jshint ignore:line\r\n\r\n/**\r\n * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`\r\n * These values can be accepted:\r\n * + An instance of Date, represent a time in its own time zone.\r\n * + Or string in a subset of ISO 8601, only including:\r\n * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',\r\n * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',\r\n * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',\r\n * all of which will be treated as local time if time zone is not specified\r\n * (see ).\r\n * + Or other string format, including (all of which will be treated as local time):\r\n * '2012', '2012-3-1', '2012/3/1', '2012/03/01',\r\n * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'\r\n * + a timestamp, which represent a time in UTC.\r\n * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.\r\n */\r\nexport function parseDate(value: unknown): Date {\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n else if (zrUtil.isString(value)) {\r\n // Different browsers parse date in different way, so we parse it manually.\r\n // Some other issues:\r\n // new Date('1970-01-01') is UTC,\r\n // new Date('1970/01/01') and new Date('1970-1-01') is local.\r\n // See issue #3623\r\n const match = TIME_REG.exec(value);\r\n\r\n if (!match) {\r\n // return Invalid Date.\r\n return new Date(NaN);\r\n }\r\n\r\n // Use local time when no timezone offset is specified.\r\n if (!match[8]) {\r\n // match[n] can only be string or undefined.\r\n // But take care of '12' + 1 => '121'.\r\n return new Date(\r\n +match[1],\r\n +(match[2] || 1) - 1,\r\n +match[3] || 1,\r\n +match[4] || 0,\r\n +(match[5] || 0),\r\n +match[6] || 0,\r\n match[7] ? +match[7].substring(0, 3) : 0\r\n );\r\n }\r\n // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\r\n // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\r\n // For example, system timezone is set as \"Time Zone: America/Toronto\",\r\n // then these code will get different result:\r\n // `new Date(1478411999999).getTimezoneOffset(); // get 240`\r\n // `new Date(1478412000000).getTimezoneOffset(); // get 300`\r\n // So we should not use `new Date`, but use `Date.UTC`.\r\n else {\r\n let hour = +match[4] || 0;\r\n if (match[8].toUpperCase() !== 'Z') {\r\n hour -= +match[8].slice(0, 3);\r\n }\r\n return new Date(Date.UTC(\r\n +match[1],\r\n +(match[2] || 1) - 1,\r\n +match[3] || 1,\r\n hour,\r\n +(match[5] || 0),\r\n +match[6] || 0,\r\n match[7] ? +match[7].substring(0, 3) : 0\r\n ));\r\n }\r\n }\r\n else if (value == null) {\r\n return new Date(NaN);\r\n }\r\n\r\n return new Date(Math.round(value as number));\r\n}\r\n\r\n/**\r\n * Quantity of a number. e.g. 0.1, 1, 10, 100\r\n *\r\n * @param val\r\n * @return\r\n */\r\nexport function quantity(val: number): number {\r\n return Math.pow(10, quantityExponent(val));\r\n}\r\n\r\n/**\r\n * Exponent of the quantity of a number\r\n * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3\r\n *\r\n * @param val non-negative value\r\n * @return\r\n */\r\nexport function quantityExponent(val: number): number {\r\n if (val === 0) {\r\n return 0;\r\n }\r\n\r\n let exp = Math.floor(Math.log(val) / Math.LN10);\r\n /**\r\n * exp is expected to be the rounded-down result of the base-10 log of val.\r\n * But due to the precision loss with Math.log(val), we need to restore it\r\n * using 10^exp to make sure we can get val back from exp. #11249\r\n */\r\n if (val / Math.pow(10, exp) >= 10) {\r\n exp++;\r\n }\r\n return exp;\r\n}\r\n\r\n/**\r\n * find a \u201Cnice\u201D number approximately equal to x. Round the number if round = true,\r\n * take ceiling if round = false. The primary observation is that the \u201Cnicest\u201D\r\n * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.\r\n *\r\n * See \"Nice Numbers for Graph Labels\" of Graphic Gems.\r\n *\r\n * @param val Non-negative value.\r\n * @param round\r\n * @return Niced number\r\n */\r\nexport function nice(val: number, round?: boolean): number {\r\n const exponent = quantityExponent(val);\r\n const exp10 = Math.pow(10, exponent);\r\n const f = val / exp10; // 1 <= f < 10\r\n let nf;\r\n if (round) {\r\n if (f < 1.5) {\r\n nf = 1;\r\n }\r\n else if (f < 2.5) {\r\n nf = 2;\r\n }\r\n else if (f < 4) {\r\n nf = 3;\r\n }\r\n else if (f < 7) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n else {\r\n if (f < 1) {\r\n nf = 1;\r\n }\r\n else if (f < 2) {\r\n nf = 2;\r\n }\r\n else if (f < 3) {\r\n nf = 3;\r\n }\r\n else if (f < 5) {\r\n nf = 5;\r\n }\r\n else {\r\n nf = 10;\r\n }\r\n }\r\n val = nf * exp10;\r\n\r\n // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).\r\n // 20 is the uppper bound of toFixed.\r\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\r\n}\r\n\r\n/**\r\n * This code was copied from \"d3.js\"\r\n * .\r\n * See the license statement at the head of this file.\r\n * @param ascArr\r\n */\r\nexport function quantile(ascArr: number[], p: number): number {\r\n const H = (ascArr.length - 1) * p + 1;\r\n const h = Math.floor(H);\r\n const v = +ascArr[h - 1];\r\n const e = H - h;\r\n return e ? v + e * (ascArr[h] - v) : v;\r\n}\r\n\r\ntype IntervalItem = {\r\n interval: [number, number]\r\n close: [0 | 1, 0 | 1]\r\n};\r\n/**\r\n * Order intervals asc, and split them when overlap.\r\n * expect(numberUtil.reformIntervals([\r\n * {interval: [18, 62], close: [1, 1]},\r\n * {interval: [-Infinity, -70], close: [0, 0]},\r\n * {interval: [-70, -26], close: [1, 1]},\r\n * {interval: [-26, 18], close: [1, 1]},\r\n * {interval: [62, 150], close: [1, 1]},\r\n * {interval: [106, 150], close: [1, 1]},\r\n * {interval: [150, Infinity], close: [0, 0]}\r\n * ])).toEqual([\r\n * {interval: [-Infinity, -70], close: [0, 0]},\r\n * {interval: [-70, -26], close: [1, 1]},\r\n * {interval: [-26, 18], close: [0, 1]},\r\n * {interval: [18, 62], close: [0, 1]},\r\n * {interval: [62, 150], close: [0, 1]},\r\n * {interval: [150, Infinity], close: [0, 0]}\r\n * ]);\r\n * @param list, where `close` mean open or close\r\n * of the interval, and Infinity can be used.\r\n * @return The origin list, which has been reformed.\r\n */\r\nexport function reformIntervals(list: IntervalItem[]): IntervalItem[] {\r\n list.sort(function (a, b) {\r\n return littleThan(a, b, 0) ? -1 : 1;\r\n });\r\n\r\n let curr = -Infinity;\r\n let currClose = 1;\r\n for (let i = 0; i < list.length;) {\r\n const interval = list[i].interval;\r\n const close = list[i].close;\r\n\r\n for (let lg = 0; lg < 2; lg++) {\r\n if (interval[lg] <= curr) {\r\n interval[lg] = curr;\r\n close[lg] = (!lg ? 1 - currClose : 1) as 0 | 1;\r\n }\r\n curr = interval[lg];\r\n currClose = close[lg];\r\n }\r\n\r\n if (interval[0] === interval[1] && close[0] * close[1] !== 1) {\r\n list.splice(i, 1);\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n\r\n return list;\r\n\r\n function littleThan(a: IntervalItem, b: IntervalItem, lg: number): boolean {\r\n return a.interval[lg] < b.interval[lg]\r\n || (\r\n a.interval[lg] === b.interval[lg]\r\n && (\r\n (a.close[lg] - b.close[lg] === (!lg ? 1 : -1))\r\n || (!lg && littleThan(a, b, 1))\r\n )\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * [Numeric is defined as]:\r\n * `parseFloat(val) == val`\r\n * For example:\r\n * numeric:\r\n * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,\r\n * and they rounded by white-spaces or line-terminal like ' -123 \\n ' (see es spec)\r\n * not-numeric:\r\n * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',\r\n * empty string, string with only white-spaces or line-terminal (see es spec),\r\n * 0x12, '0x12', '-0x12', 012, '012', '-012',\r\n * non-string, ...\r\n *\r\n * @test See full test cases in `test/ut/spec/util/number.js`.\r\n * @return Must be a typeof number. If not numeric, return NaN.\r\n */\r\nexport function numericToNumber(val: unknown): number {\r\n const valFloat = parseFloat(val as string);\r\n return (\r\n valFloat == val // eslint-disable-line eqeqeq\r\n && (valFloat !== 0 || !zrUtil.isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '.\r\n ) ? valFloat : NaN;\r\n}\r\n\r\n/**\r\n * Definition of \"numeric\": see `numericToNumber`.\r\n */\r\nexport function isNumeric(val: unknown): val is number {\r\n return !isNaN(numericToNumber(val));\r\n}\r\n\r\n/**\r\n * Use random base to prevent users hard code depending on\r\n * this auto generated marker id.\r\n * @return An positive integer.\r\n */\r\nexport function getRandomIdBase(): number {\r\n return Math.round(Math.random() * 9);\r\n}\r\n\r\n/**\r\n * Get the greatest common divisor.\r\n *\r\n * @param {number} a one number\r\n * @param {number} b the other number\r\n */\r\nexport function getGreatestCommonDividor(a: number, b: number): number {\r\n if (b === 0) {\r\n return a;\r\n }\r\n return getGreatestCommonDividor(b, a % b);\r\n}\r\n\r\n/**\r\n * Get the least common multiple.\r\n *\r\n * @param {number} a one number\r\n * @param {number} b the other number\r\n */\r\nexport function getLeastCommonMultiple(a: number, b: number) {\r\n if (a == null) {\r\n return b;\r\n }\r\n if (b == null) {\r\n return a;\r\n }\r\n return a * b / getGreatestCommonDividor(a, b);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { Dictionary } from './types';\r\nimport { map, isString, isFunction, eqNaN, isRegExp } from 'zrender/src/core/util';\r\n\r\nconst ECHARTS_PREFIX = '[ECharts] ';\r\nconst storedLogs: Dictionary = {};\r\n\r\nconst hasConsole = typeof console !== 'undefined'\r\n // eslint-disable-next-line\r\n && console.warn && console.log;\r\n\r\nfunction outputLog(type: 'log' | 'warn' | 'error', str: string, onlyOnce?: boolean) {\r\n if (hasConsole) {\r\n if (onlyOnce) {\r\n if (storedLogs[str]) {\r\n return;\r\n }\r\n storedLogs[str] = true;\r\n }\r\n // eslint-disable-next-line\r\n console[type](ECHARTS_PREFIX + str);\r\n }\r\n}\r\n\r\nexport function log(str: string, onlyOnce?: boolean) {\r\n outputLog('log', str, onlyOnce);\r\n}\r\n\r\nexport function warn(str: string, onlyOnce?: boolean) {\r\n outputLog('warn', str, onlyOnce);\r\n}\r\n\r\nexport function error(str: string, onlyOnce?: boolean) {\r\n outputLog('error', str, onlyOnce);\r\n}\r\n\r\nexport function deprecateLog(str: string) {\r\n if (__DEV__) {\r\n // Not display duplicate message.\r\n outputLog('warn', 'DEPRECATED: ' + str, true);\r\n }\r\n}\r\n\r\nexport function deprecateReplaceLog(oldOpt: string, newOpt: string, scope?: string) {\r\n if (__DEV__) {\r\n deprecateLog((scope ? `[${scope}]` : '') + `${oldOpt} is deprecated, use ${newOpt} instead.`);\r\n }\r\n}\r\n\r\n/**\r\n * If in __DEV__ environment, get console printable message for users hint.\r\n * Parameters are separated by ' '.\r\n * @usage\r\n * makePrintable('This is an error on', someVar, someObj);\r\n *\r\n * @param hintInfo anything about the current execution context to hint users.\r\n * @throws Error\r\n */\r\nexport function makePrintable(...hintInfo: unknown[]): string {\r\n let msg = '';\r\n\r\n if (__DEV__) {\r\n // Fuzzy stringify for print.\r\n // This code only exist in dev environment.\r\n const makePrintableStringIfPossible = (val: unknown): string => {\r\n return val === void 0 ? 'undefined'\r\n : val === Infinity ? 'Infinity'\r\n : val === -Infinity ? '-Infinity'\r\n : eqNaN(val) ? 'NaN'\r\n : val instanceof Date ? 'Date(' + val.toISOString() + ')'\r\n : isFunction(val) ? 'function () { ... }'\r\n : isRegExp(val) ? val + ''\r\n : null;\r\n };\r\n msg = map(hintInfo, arg => {\r\n if (isString(arg)) {\r\n // Print without quotation mark for some statement.\r\n return arg;\r\n }\r\n else {\r\n const printableStr = makePrintableStringIfPossible(arg);\r\n if (printableStr != null) {\r\n return printableStr;\r\n }\r\n else if (typeof JSON !== 'undefined' && JSON.stringify) {\r\n try {\r\n return JSON.stringify(arg, function (n, val) {\r\n const printableStr = makePrintableStringIfPossible(val);\r\n return printableStr == null ? val : printableStr;\r\n });\r\n // In most cases the info object is small, so do not line break.\r\n }\r\n catch (err) {\r\n return '?';\r\n }\r\n }\r\n else {\r\n return '?';\r\n }\r\n }\r\n }).join(' ');\r\n }\r\n\r\n return msg;\r\n}\r\n\r\n/**\r\n * @throws Error\r\n */\r\nexport function throwError(msg?: string) {\r\n throw new Error(msg);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n each,\r\n isObject,\r\n isArray,\r\n createHashMap,\r\n HashMap,\r\n map,\r\n assert,\r\n isString,\r\n indexOf,\r\n isStringSafe,\r\n isNumber\r\n} from 'zrender/src/core/util';\r\nimport env from 'zrender/src/core/env';\r\nimport GlobalModel from '../model/Global';\r\nimport ComponentModel, {ComponentModelConstructor} from '../model/Component';\r\nimport SeriesData from '../data/SeriesData';\r\nimport {\r\n ComponentOption,\r\n ComponentMainType,\r\n ComponentSubType,\r\n DisplayStateHostOption,\r\n OptionDataItem,\r\n OptionDataValue,\r\n TooltipRenderMode,\r\n Payload,\r\n OptionId,\r\n OptionName,\r\n InterpolatableValue\r\n} from './types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport SeriesModel from '../model/Series';\r\nimport CartesianAxisModel from '../coord/cartesian/AxisModel';\r\nimport GridModel from '../coord/cartesian/GridModel';\r\nimport { isNumeric, getRandomIdBase, getPrecision, round } from './number';\r\nimport { warn } from './log';\r\n\r\nfunction interpolateNumber(p0: number, p1: number, percent: number): number {\r\n return (p1 - p0) * percent + p0;\r\n}\r\n\r\n/**\r\n * Make the name displayable. But we should\r\n * make sure it is not duplicated with user\r\n * specified name, so use '\\0';\r\n */\r\nconst DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\r\n\r\nconst INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\r\n\r\n/**\r\n * If value is not array, then translate it to array.\r\n * @param {*} value\r\n * @return {Array} [value] or value\r\n */\r\nexport function normalizeToArray(value?: T | T[]): T[] {\r\n return value instanceof Array\r\n ? value\r\n : value == null\r\n ? []\r\n : [value];\r\n}\r\n\r\n/**\r\n * Sync default option between normal and emphasis like `position` and `show`\r\n * In case some one will write code like\r\n * label: {\r\n * show: false,\r\n * position: 'outside',\r\n * fontSize: 18\r\n * },\r\n * emphasis: {\r\n * label: { show: true }\r\n * }\r\n */\r\nexport function defaultEmphasis(\r\n opt: DisplayStateHostOption,\r\n key: string,\r\n subOpts: string[]\r\n): void {\r\n // Caution: performance sensitive.\r\n if (opt) {\r\n opt[key] = opt[key] || {};\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[key] = opt.emphasis[key] || {};\r\n\r\n // Default emphasis option from normal\r\n for (let i = 0, len = subOpts.length; i < len; i++) {\r\n const subOptName = subOpts[i];\r\n if (!opt.emphasis[key].hasOwnProperty(subOptName)\r\n && opt[key].hasOwnProperty(subOptName)\r\n ) {\r\n opt.emphasis[key][subOptName] = opt[key][subOptName];\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport const TEXT_STYLE_OPTIONS = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth',\r\n 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY',\r\n 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding'\r\n] as const;\r\n\r\n// modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([\r\n// 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',\r\n// 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n// // FIXME: deprecated, check and remove it.\r\n// 'textStyle'\r\n// ]);\r\n\r\n/**\r\n * The method does not ensure performance.\r\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\r\n * This helper method retrieves value from data.\r\n */\r\nexport function getDataItemValue(\r\n dataItem: OptionDataItem\r\n): OptionDataValue | OptionDataValue[] {\r\n return (isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date))\r\n ? (dataItem as Dictionary).value : dataItem;\r\n}\r\n\r\n/**\r\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\r\n * This helper method determine if dataItem has extra option besides value\r\n */\r\nexport function isDataItemOption(dataItem: OptionDataItem): boolean {\r\n return isObject(dataItem)\r\n && !(dataItem instanceof Array);\r\n // // markLine data can be array\r\n // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));\r\n}\r\n\r\n// Compatible with previous definition: id could be number (but not recommended).\r\n// number and string are treated the same when compared.\r\n// number id will not be converted to string in option.\r\n// number id will be converted to string in component instance id.\r\nexport interface MappingExistingItem {\r\n id?: OptionId;\r\n name?: string;\r\n};\r\n/**\r\n * The array `MappingResult[]` exactly represents the content of the result\r\n * components array after merge.\r\n * The indices are the same as the `existings`.\r\n * Items will not be `null`/`undefined` even if the corresponding `existings` will be removed.\r\n */\r\ntype MappingResult = MappingResultItem[];\r\ninterface MappingResultItem {\r\n // Existing component instance.\r\n existing: T;\r\n // The mapped new component option.\r\n newOption: ComponentOption;\r\n // Mark that the new component has nothing to do with any of the old components.\r\n // So they won't share view. Also see `__requireNewView`.\r\n brandNew: boolean;\r\n // keyInfo for new component.\r\n // All of them will be assigned to a created component instance.\r\n keyInfo: {\r\n name: string,\r\n id: string,\r\n mainType: ComponentMainType,\r\n subType: ComponentSubType\r\n };\r\n}\r\n\r\ntype MappingToExistsMode = 'normalMerge' | 'replaceMerge' | 'replaceAll';\r\n\r\n/**\r\n * Mapping to existings for merge.\r\n *\r\n * Mode \"normalMege\":\r\n * The mapping result (merge result) will keep the order of the existing\r\n * component, rather than the order of new option. Because we should ensure\r\n * some specified index reference (like xAxisIndex) keep work.\r\n * And in most cases, \"merge option\" is used to update partial option but not\r\n * be expected to change the order.\r\n *\r\n * Mode \"replaceMege\":\r\n * (1) Only the id mapped components will be merged.\r\n * (2) Other existing components (except internal components) will be removed.\r\n * (3) Other new options will be used to create new component.\r\n * (4) The index of the existing components will not be modified.\r\n * That means their might be \"hole\" after the removal.\r\n * The new components are created first at those available index.\r\n *\r\n * Mode \"replaceAll\":\r\n * This mode try to support that reproduce an echarts instance from another\r\n * echarts instance (via `getOption`) in some simple cases.\r\n * In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`,\r\n * which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is,\r\n * the \"hole\" in `newCmptOptions` will also be kept.\r\n * On the contrary, other modes try best to eliminate holes.\r\n * PENDING: This is an experimental mode yet.\r\n *\r\n * @return See the comment of .\r\n */\r\nexport function mappingToExists(\r\n existings: T[],\r\n newCmptOptions: ComponentOption[],\r\n mode: MappingToExistsMode\r\n): MappingResult {\r\n\r\n const isNormalMergeMode = mode === 'normalMerge';\r\n const isReplaceMergeMode = mode === 'replaceMerge';\r\n const isReplaceAllMode = mode === 'replaceAll';\r\n existings = existings || [];\r\n newCmptOptions = (newCmptOptions || []).slice();\r\n const existingIdIdxMap = createHashMap();\r\n\r\n // Validate id and name on user input option.\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!isObject(cmptOption)) {\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n\r\n if (__DEV__) {\r\n // There is some legacy case that name is set as `false`.\r\n // But should work normally rather than throw error.\r\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\r\n warnInvalidateIdOrName(cmptOption.id);\r\n }\r\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\r\n warnInvalidateIdOrName(cmptOption.name);\r\n }\r\n }\r\n });\r\n\r\n const result = prepareResult(existings, existingIdIdxMap, mode);\r\n\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\r\n }\r\n\r\n if (isNormalMergeMode) {\r\n mappingByName(result, newCmptOptions);\r\n }\r\n\r\n if (isNormalMergeMode || isReplaceMergeMode) {\r\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\r\n }\r\n else if (isReplaceAllMode) {\r\n mappingInReplaceAllMode(result, newCmptOptions);\r\n }\r\n\r\n makeIdAndName(result);\r\n\r\n // The array `result` MUST NOT contain elided items, otherwise the\r\n // forEach will omit those items and result in incorrect result.\r\n return result;\r\n}\r\n\r\nfunction prepareResult(\r\n existings: T[],\r\n existingIdIdxMap: HashMap,\r\n mode: MappingToExistsMode\r\n): MappingResultItem[] {\r\n const result: MappingResultItem[] = [];\r\n\r\n if (mode === 'replaceAll') {\r\n return result;\r\n }\r\n\r\n // Do not use native `map` to in case that the array `existings`\r\n // contains elided items, which will be omitted.\r\n for (let index = 0; index < existings.length; index++) {\r\n const existing = existings[index];\r\n // Because of replaceMerge, `existing` may be null/undefined.\r\n if (existing && existing.id != null) {\r\n existingIdIdxMap.set(existing.id, index);\r\n }\r\n // For non-internal-componnets:\r\n // Mode \"normalMerge\": all existings kept.\r\n // Mode \"replaceMerge\": all existing removed unless mapped by id.\r\n // For internal-components:\r\n // go with \"replaceMerge\" approach in both mode.\r\n result.push({\r\n existing: (mode === 'replaceMerge' || isComponentIdInternal(existing))\r\n ? null\r\n : existing,\r\n newOption: null,\r\n keyInfo: null,\r\n brandNew: null\r\n });\r\n }\r\n return result;\r\n}\r\n\r\nfunction mappingById(\r\n result: MappingResult,\r\n existings: T[],\r\n existingIdIdxMap: HashMap,\r\n newCmptOptions: ComponentOption[]\r\n): void {\r\n // Mapping by id if specified.\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.id == null) {\r\n return;\r\n }\r\n const optionId = makeComparableKey(cmptOption.id);\r\n const existingIdx = existingIdIdxMap.get(optionId);\r\n if (existingIdx != null) {\r\n const resultItem = result[existingIdx];\r\n assert(\r\n !resultItem.newOption,\r\n 'Duplicated option on id \"' + optionId + '\".'\r\n );\r\n resultItem.newOption = cmptOption;\r\n // In both mode, if id matched, new option will be merged to\r\n // the existings rather than creating new component model.\r\n resultItem.existing = existings[existingIdx];\r\n newCmptOptions[index] = null;\r\n }\r\n });\r\n}\r\n\r\nfunction mappingByName(\r\n result: MappingResult,\r\n newCmptOptions: ComponentOption[]\r\n): void {\r\n // Mapping by name if specified.\r\n each(newCmptOptions, function (cmptOption, index) {\r\n if (!cmptOption || cmptOption.name == null) {\r\n return;\r\n }\r\n for (let i = 0; i < result.length; i++) {\r\n const existing = result[i].existing;\r\n if (!result[i].newOption // Consider name: two map to one.\r\n // Can not match when both ids existing but different.\r\n && existing\r\n && (existing.id == null || cmptOption.id == null)\r\n && !isComponentIdInternal(cmptOption)\r\n && !isComponentIdInternal(existing)\r\n && keyExistAndEqual('name', existing, cmptOption)\r\n ) {\r\n result[i].newOption = cmptOption;\r\n newCmptOptions[index] = null;\r\n return;\r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction mappingByIndex(\r\n result: MappingResult,\r\n newCmptOptions: ComponentOption[],\r\n brandNew: boolean\r\n): void {\r\n each(newCmptOptions, function (cmptOption) {\r\n if (!cmptOption) {\r\n return;\r\n }\r\n\r\n // Find the first place that not mapped by id and not internal component (consider the \"hole\").\r\n let resultItem;\r\n let nextIdx = 0;\r\n while (\r\n // Be `!resultItem` only when `nextIdx >= result.length`.\r\n (resultItem = result[nextIdx])\r\n // (1) Existing models that already have id should be able to mapped to. Because\r\n // after mapping performed, model will always be assigned with an id if user not given.\r\n // After that all models have id.\r\n // (2) If new option has id, it can only set to a hole or append to the last. It should\r\n // not be merged to the existings with different id. Because id should not be overwritten.\r\n // (3) Name can be overwritten, because axis use name as 'show label text'.\r\n && (\r\n resultItem.newOption\r\n || isComponentIdInternal(resultItem.existing)\r\n || (\r\n // In mode \"replaceMerge\", here no not-mapped-non-internal-existing.\r\n resultItem.existing\r\n && cmptOption.id != null\r\n && !keyExistAndEqual('id', cmptOption, resultItem.existing)\r\n )\r\n )\r\n ) {\r\n nextIdx++;\r\n }\r\n\r\n if (resultItem) {\r\n resultItem.newOption = cmptOption;\r\n resultItem.brandNew = brandNew;\r\n }\r\n else {\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: brandNew,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n }\r\n nextIdx++;\r\n });\r\n}\r\n\r\nfunction mappingInReplaceAllMode(\r\n result: MappingResult,\r\n newCmptOptions: ComponentOption[]\r\n): void {\r\n each(newCmptOptions, function (cmptOption) {\r\n // The feature \"reproduce\" requires \"hole\" will also reproduced\r\n // in case that component index referring are broken.\r\n result.push({\r\n newOption: cmptOption,\r\n brandNew: true,\r\n existing: null,\r\n keyInfo: null\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Make id and name for mapping result (result of mappingToExists)\r\n * into `keyInfo` field.\r\n */\r\nfunction makeIdAndName(\r\n mapResult: MappingResult\r\n): void {\r\n // We use this id to hash component models and view instances\r\n // in echarts. id can be specified by user, or auto generated.\r\n\r\n // The id generation rule ensures new view instance are able\r\n // to mapped to old instance when setOption are called in\r\n // no-merge mode. So we generate model id by name and plus\r\n // type in view id.\r\n\r\n // name can be duplicated among components, which is convenient\r\n // to specify multi components (like series) by one name.\r\n\r\n // Ensure that each id is distinct.\r\n const idMap = createHashMap();\r\n\r\n each(mapResult, function (item) {\r\n const existing = item.existing;\r\n existing && idMap.set(existing.id, item);\r\n });\r\n\r\n each(mapResult, function (item) {\r\n const opt = item.newOption;\r\n\r\n // Force ensure id not duplicated.\r\n assert(\r\n !opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item,\r\n 'id duplicates: ' + (opt && opt.id)\r\n );\r\n\r\n opt && opt.id != null && idMap.set(opt.id, item);\r\n !item.keyInfo && (item.keyInfo = {} as MappingResultItem['keyInfo']);\r\n });\r\n\r\n // Make name and id.\r\n each(mapResult, function (item, index) {\r\n const existing = item.existing;\r\n const opt = item.newOption;\r\n const keyInfo = item.keyInfo;\r\n\r\n if (!isObject(opt)) {\r\n return;\r\n }\r\n\r\n // Name can be overwritten. Consider case: axis.name = '20km'.\r\n // But id generated by name will not be changed, which affect\r\n // only in that case: setOption with 'not merge mode' and view\r\n // instance will be recreated, which can be accepted.\r\n keyInfo.name = opt.name != null\r\n ? makeComparableKey(opt.name)\r\n : existing\r\n ? existing.name\r\n // Avoid that different series has the same name,\r\n // because name may be used like in color pallet.\r\n : DUMMY_COMPONENT_NAME_PREFIX + index;\r\n\r\n if (existing) {\r\n keyInfo.id = makeComparableKey(existing.id);\r\n }\r\n else if (opt.id != null) {\r\n keyInfo.id = makeComparableKey(opt.id);\r\n }\r\n else {\r\n // Consider this situatoin:\r\n // optionA: [{name: 'a'}, {name: 'a'}, {..}]\r\n // optionB [{..}, {name: 'a'}, {name: 'a'}]\r\n // Series with the same name between optionA and optionB\r\n // should be mapped.\r\n let idNum = 0;\r\n do {\r\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\r\n }\r\n while (idMap.get(keyInfo.id));\r\n }\r\n\r\n idMap.set(keyInfo.id, item);\r\n });\r\n}\r\n\r\nfunction keyExistAndEqual(\r\n attr: 'id' | 'name',\r\n obj1: { id?: OptionId, name?: OptionName },\r\n obj2: { id?: OptionId, name?: OptionName }\r\n): boolean {\r\n const key1 = convertOptionIdName(obj1[attr], null);\r\n const key2 = convertOptionIdName(obj2[attr], null);\r\n // See `MappingExistingItem`. `id` and `name` trade string equals to number.\r\n return key1 != null && key2 != null && key1 === key2;\r\n}\r\n\r\n/**\r\n * @return return null if not exist.\r\n */\r\nfunction makeComparableKey(val: unknown): string {\r\n if (__DEV__) {\r\n if (val == null) {\r\n throw new Error();\r\n }\r\n }\r\n return convertOptionIdName(val, '');\r\n}\r\n\r\nexport function convertOptionIdName(idOrName: unknown, defaultValue: string): string {\r\n if (idOrName == null) {\r\n return defaultValue;\r\n }\r\n return isString(idOrName)\r\n ? idOrName\r\n : (isNumber(idOrName) || isStringSafe(idOrName))\r\n ? idOrName + ''\r\n : defaultValue;\r\n}\r\n\r\nfunction warnInvalidateIdOrName(idOrName: unknown) {\r\n if (__DEV__) {\r\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\r\n }\r\n}\r\n\r\nfunction isValidIdOrName(idOrName: unknown): boolean {\r\n return isStringSafe(idOrName) || isNumeric(idOrName);\r\n}\r\n\r\nexport function isNameSpecified(componentModel: ComponentModel): boolean {\r\n const name = componentModel.name;\r\n // Is specified when `indexOf` get -1 or > 0.\r\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\r\n}\r\n\r\n/**\r\n * @public\r\n * @param {Object} cmptOption\r\n * @return {boolean}\r\n */\r\nexport function isComponentIdInternal(cmptOption: { id?: MappingExistingItem['id'] }): boolean {\r\n return cmptOption\r\n && cmptOption.id != null\r\n && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\r\n}\r\n\r\nexport function makeInternalComponentId(idSuffix: string) {\r\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\r\n}\r\n\r\nexport function setComponentTypeToKeyInfo(\r\n mappingResult: MappingResult,\r\n mainType: ComponentMainType,\r\n componentModelCtor: ComponentModelConstructor\r\n): void {\r\n // Set mainType and complete subType.\r\n each(mappingResult, function (item) {\r\n const newOption = item.newOption;\r\n if (isObject(newOption)) {\r\n item.keyInfo.mainType = mainType;\r\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\r\n }\r\n });\r\n}\r\n\r\nfunction determineSubType(\r\n mainType: ComponentMainType,\r\n newCmptOption: ComponentOption,\r\n existComponent: { subType?: ComponentSubType },\r\n componentModelCtor: ComponentModelConstructor\r\n): ComponentSubType {\r\n const subType = newCmptOption.type\r\n ? newCmptOption.type\r\n : existComponent\r\n ? existComponent.subType\r\n // Use determineSubType only when there is no existComponent.\r\n : (componentModelCtor as ComponentModelConstructor).determineSubType(mainType, newCmptOption);\r\n\r\n // tooltip, markline, markpoint may always has no subType\r\n return subType;\r\n}\r\n\r\n\r\ntype BatchItem = {\r\n seriesId: OptionId,\r\n dataIndex: number | number[]\r\n};\r\n/**\r\n * A helper for removing duplicate items between batchA and batchB,\r\n * and in themselves, and categorize by series.\r\n *\r\n * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\r\n * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\r\n * @return result: [resultBatchA, resultBatchB]\r\n */\r\nexport function compressBatches(\r\n batchA: BatchItem[],\r\n batchB: BatchItem[]\r\n): [BatchItem[], BatchItem[]] {\r\n\r\n type InnerMap = {\r\n [seriesId: string]: {\r\n [dataIndex: string]: 1\r\n }\r\n };\r\n const mapA = {} as InnerMap;\r\n const mapB = {} as InnerMap;\r\n\r\n makeMap(batchA || [], mapA);\r\n makeMap(batchB || [], mapB, mapA);\r\n\r\n return [mapToArray(mapA), mapToArray(mapB)];\r\n\r\n function makeMap(sourceBatch: BatchItem[], map: InnerMap, otherMap?: InnerMap): void {\r\n for (let i = 0, len = sourceBatch.length; i < len; i++) {\r\n const seriesId = convertOptionIdName(sourceBatch[i].seriesId, null);\r\n if (seriesId == null) {\r\n return;\r\n }\r\n const dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\r\n const otherDataIndices = otherMap && otherMap[seriesId];\r\n\r\n for (let j = 0, lenj = dataIndices.length; j < lenj; j++) {\r\n const dataIndex = dataIndices[j];\r\n\r\n if (otherDataIndices && otherDataIndices[dataIndex]) {\r\n otherDataIndices[dataIndex] = null;\r\n }\r\n else {\r\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function mapToArray(map: Dictionary, isData?: boolean): any[] {\r\n const result = [];\r\n for (const i in map) {\r\n if (map.hasOwnProperty(i) && map[i] != null) {\r\n if (isData) {\r\n result.push(+i);\r\n }\r\n else {\r\n const dataIndices = mapToArray(map[i], true);\r\n dataIndices.length && result.push({seriesId: i, dataIndex: dataIndices});\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name\r\n * each of which can be Array or primary type.\r\n * @return dataIndex If not found, return undefined/null.\r\n */\r\nexport function queryDataIndex(data: SeriesData, payload: Payload & {\r\n dataIndexInside?: number | number[]\r\n dataIndex?: number | number[]\r\n name?: string | string[]\r\n}): number | number[] {\r\n if (payload.dataIndexInside != null) {\r\n return payload.dataIndexInside;\r\n }\r\n else if (payload.dataIndex != null) {\r\n return isArray(payload.dataIndex)\r\n ? map(payload.dataIndex, function (value) {\r\n return data.indexOfRawIndex(value);\r\n })\r\n : data.indexOfRawIndex(payload.dataIndex);\r\n }\r\n else if (payload.name != null) {\r\n return isArray(payload.name)\r\n ? map(payload.name, function (value) {\r\n return data.indexOfName(value);\r\n })\r\n : data.indexOfName(payload.name);\r\n }\r\n}\r\n\r\n/**\r\n * Enable property storage to any host object.\r\n * Notice: Serialization is not supported.\r\n *\r\n * For example:\r\n * let inner = zrUitl.makeInner();\r\n *\r\n * function some1(hostObj) {\r\n * inner(hostObj).someProperty = 1212;\r\n * ...\r\n * }\r\n * function some2() {\r\n * let fields = inner(this);\r\n * fields.someProperty1 = 1212;\r\n * fields.someProperty2 = 'xx';\r\n * ...\r\n * }\r\n *\r\n * @return {Function}\r\n */\r\nexport function makeInner() {\r\n const key = '__ec_inner_' + innerUniqueIndex++;\r\n return function (hostObj: Host): T {\r\n return (hostObj as any)[key] || ((hostObj as any)[key] = {});\r\n };\r\n}\r\nlet innerUniqueIndex = getRandomIdBase();\r\n\r\n/**\r\n * If string, e.g., 'geo', means {geoIndex: 0}.\r\n * If Object, could contain some of these properties below:\r\n * {\r\n * seriesIndex, seriesId, seriesName,\r\n * geoIndex, geoId, geoName,\r\n * bmapIndex, bmapId, bmapName,\r\n * xAxisIndex, xAxisId, xAxisName,\r\n * yAxisIndex, yAxisId, yAxisName,\r\n * gridIndex, gridId, gridName,\r\n * ... (can be extended)\r\n * }\r\n * Each properties can be number|string|Array.|Array.\r\n * For example, a finder could be\r\n * {\r\n * seriesIndex: 3,\r\n * geoId: ['aa', 'cc'],\r\n * gridName: ['xx', 'rr']\r\n * }\r\n * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify)\r\n * If nothing or null/undefined specified, return nothing.\r\n * If both `abcIndex`, `abcId`, `abcName` specified, only one work.\r\n * The priority is: index > id > name, the same with `ecModel.queryComponents`.\r\n */\r\nexport type ModelFinderIndexQuery = number | number[] | 'all' | 'none' | false;\r\nexport type ModelFinderIdQuery = OptionId | OptionId[];\r\nexport type ModelFinderNameQuery = OptionId | OptionId[];\r\n// If string, like 'series', means { seriesIndex: 0 }.\r\nexport type ModelFinder = string | ModelFinderObject;\r\nexport type ModelFinderObject = {\r\n seriesIndex?: ModelFinderIndexQuery, seriesId?: ModelFinderIdQuery, seriesName?: ModelFinderNameQuery\r\n geoIndex?: ModelFinderIndexQuery, geoId?: ModelFinderIdQuery, geoName?: ModelFinderNameQuery\r\n bmapIndex?: ModelFinderIndexQuery, bmapId?: ModelFinderIdQuery, bmapName?: ModelFinderNameQuery\r\n xAxisIndex?: ModelFinderIndexQuery, xAxisId?: ModelFinderIdQuery, xAxisName?: ModelFinderNameQuery\r\n yAxisIndex?: ModelFinderIndexQuery, yAxisId?: ModelFinderIdQuery, yAxisName?: ModelFinderNameQuery\r\n gridIndex?: ModelFinderIndexQuery, gridId?: ModelFinderIdQuery, gridName?: ModelFinderNameQuery\r\n dataIndex?: number, dataIndexInside?: number\r\n // ... (can be extended)\r\n};\r\n/**\r\n * {\r\n * seriesModels: [seriesModel1, seriesModel2],\r\n * seriesModel: seriesModel1, // The first model\r\n * geoModels: [geoModel1, geoModel2],\r\n * geoModel: geoModel1, // The first model\r\n * ...\r\n * }\r\n */\r\nexport type ParsedModelFinder = {\r\n // other components\r\n [key: string]: ComponentModel | ComponentModel[] | undefined;\r\n};\r\n\r\nexport type ParsedModelFinderKnown = ParsedModelFinder & {\r\n seriesModels?: SeriesModel[];\r\n seriesModel?: SeriesModel;\r\n xAxisModels?: CartesianAxisModel[];\r\n xAxisModel?: CartesianAxisModel;\r\n yAxisModels?: CartesianAxisModel[];\r\n yAxisModel?: CartesianAxisModel;\r\n gridModels?: GridModel[];\r\n gridModel?: GridModel;\r\n dataIndex?: number;\r\n dataIndexInside?: number;\r\n};\r\n\r\n/**\r\n * The same behavior as `component.getReferringComponents`.\r\n */\r\nexport function parseFinder(\r\n ecModel: GlobalModel,\r\n finderInput: ModelFinder,\r\n opt?: {\r\n // If no main type specified, use this main type.\r\n defaultMainType?: ComponentMainType;\r\n // If pervided, types out of this list will be ignored.\r\n includeMainTypes?: ComponentMainType[];\r\n enableAll?: boolean;\r\n enableNone?: boolean;\r\n }\r\n): ParsedModelFinder {\r\n const { mainTypeSpecified, queryOptionMap, others } = preParseFinder(finderInput, opt);\r\n const result = others as ParsedModelFinderKnown;\r\n\r\n const defaultMainType = opt ? opt.defaultMainType : null;\r\n if (!mainTypeSpecified && defaultMainType) {\r\n queryOptionMap.set(defaultMainType, {});\r\n }\r\n\r\n queryOptionMap.each(function (queryOption, mainType) {\r\n const queryResult = queryReferringComponents(\r\n ecModel,\r\n mainType,\r\n queryOption,\r\n {\r\n useDefault: defaultMainType === mainType,\r\n enableAll: (opt && opt.enableAll != null) ? opt.enableAll : true,\r\n enableNone: (opt && opt.enableNone != null) ? opt.enableNone : true\r\n }\r\n );\r\n result[mainType + 'Models'] = queryResult.models;\r\n result[mainType + 'Model'] = queryResult.models[0];\r\n });\r\n\r\n return result;\r\n}\r\n\r\nexport function preParseFinder(\r\n finderInput: ModelFinder,\r\n opt?: {\r\n // If pervided, types out of this list will be ignored.\r\n includeMainTypes?: ComponentMainType[];\r\n }\r\n): {\r\n mainTypeSpecified: boolean;\r\n queryOptionMap: HashMap;\r\n others: Partial>\r\n} {\r\n let finder: ModelFinderObject;\r\n if (isString(finderInput)) {\r\n const obj = {};\r\n (obj as any)[finderInput + 'Index'] = 0;\r\n finder = obj;\r\n }\r\n else {\r\n finder = finderInput;\r\n }\r\n\r\n const queryOptionMap = createHashMap();\r\n const others = {} as Partial>;\r\n let mainTypeSpecified = false;\r\n\r\n each(finder, function (value, key) {\r\n // Exclude 'dataIndex' and other illgal keys.\r\n if (key === 'dataIndex' || key === 'dataIndexInside') {\r\n others[key] = value as number;\r\n return;\r\n }\r\n\r\n const parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\r\n const mainType = parsedKey[1];\r\n const queryType = (parsedKey[2] || '').toLowerCase() as keyof QueryReferringUserOption;\r\n\r\n if (\r\n !mainType\r\n || !queryType\r\n || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0)\r\n ) {\r\n return;\r\n }\r\n\r\n mainTypeSpecified = mainTypeSpecified || !!mainType;\r\n\r\n const queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\r\n queryOption[queryType] = value as any;\r\n });\r\n\r\n return { mainTypeSpecified, queryOptionMap, others };\r\n}\r\n\r\n\r\nexport type QueryReferringUserOption = {\r\n index?: ModelFinderIndexQuery,\r\n id?: ModelFinderIdQuery,\r\n name?: ModelFinderNameQuery,\r\n};\r\n\r\nexport const SINGLE_REFERRING: QueryReferringOpt = { useDefault: true, enableAll: false, enableNone: false };\r\nexport const MULTIPLE_REFERRING: QueryReferringOpt = { useDefault: false, enableAll: true, enableNone: true };\r\n\r\nexport type QueryReferringOpt = {\r\n // Whether to use the first component as the default if none of index/id/name are specified.\r\n useDefault?: boolean;\r\n // Whether to enable `'all'` on index option.\r\n enableAll?: boolean;\r\n // Whether to enable `'none'`/`false` on index option.\r\n enableNone?: boolean;\r\n};\r\n\r\nexport function queryReferringComponents(\r\n ecModel: GlobalModel,\r\n mainType: ComponentMainType,\r\n userOption: QueryReferringUserOption,\r\n opt?: QueryReferringOpt\r\n): {\r\n // Always be array rather than null/undefined, which is convenient to use.\r\n models: ComponentModel[];\r\n // Whether there is indexOption/id/name specified\r\n specified: boolean;\r\n} {\r\n opt = opt || SINGLE_REFERRING as QueryReferringOpt;\r\n let indexOption = userOption.index;\r\n let idOption = userOption.id;\r\n let nameOption = userOption.name;\r\n\r\n const result = {\r\n models: null as ComponentModel[],\r\n specified: indexOption != null || idOption != null || nameOption != null\r\n };\r\n\r\n if (!result.specified) {\r\n // Use the first as default if `useDefault`.\r\n let firstCmpt;\r\n result.models = (\r\n opt.useDefault && (firstCmpt = ecModel.getComponent(mainType))\r\n ) ? [firstCmpt] : [];\r\n return result;\r\n }\r\n\r\n if (indexOption === 'none' || indexOption === false) {\r\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\r\n result.models = [];\r\n return result;\r\n }\r\n\r\n // `queryComponents` will return all components if\r\n // both all of index/id/name are null/undefined.\r\n if (indexOption === 'all') {\r\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\r\n indexOption = idOption = nameOption = null;\r\n }\r\n result.models = ecModel.queryComponents({\r\n mainType: mainType,\r\n index: indexOption as number | number[],\r\n id: idOption,\r\n name: nameOption\r\n });\r\n return result;\r\n}\r\n\r\nexport function setAttribute(dom: HTMLElement, key: string, value: any) {\r\n dom.setAttribute\r\n ? dom.setAttribute(key, value)\r\n : ((dom as any)[key] = value);\r\n}\r\n\r\nexport function getAttribute(dom: HTMLElement, key: string): any {\r\n return dom.getAttribute\r\n ? dom.getAttribute(key)\r\n : (dom as any)[key];\r\n}\r\n\r\nexport function getTooltipRenderMode(renderModeOption: TooltipRenderMode | 'auto'): TooltipRenderMode {\r\n if (renderModeOption === 'auto') {\r\n // Using html when `document` exists, use richText otherwise\r\n return env.domSupported ? 'html' : 'richText';\r\n }\r\n else {\r\n return renderModeOption || 'html';\r\n }\r\n}\r\n\r\n/**\r\n * Group a list by key.\r\n */\r\nexport function groupData(\r\n array: T[],\r\n getKey: (item: T) => R // return key\r\n): {\r\n keys: R[],\r\n buckets: HashMap // hasmap key: the key returned by `getKey`.\r\n} {\r\n const buckets = createHashMap();\r\n const keys: R[] = [];\r\n\r\n each(array, function (item) {\r\n const key = getKey(item);\r\n (buckets.get(key)\r\n || (keys.push(key), buckets.set(key, []))\r\n ).push(item);\r\n });\r\n\r\n return {\r\n keys: keys,\r\n buckets: buckets\r\n };\r\n}\r\n\r\n\r\n/**\r\n * Interpolate raw values of a series with percent\r\n *\r\n * @param data data\r\n * @param labelModel label model of the text element\r\n * @param sourceValue start value. May be null/undefined when init.\r\n * @param targetValue end value\r\n * @param percent 0~1 percentage; 0 uses start value while 1 uses end value\r\n * @return interpolated values\r\n * If `sourceValue` and `targetValue` are `number`, return `number`.\r\n * If `sourceValue` and `targetValue` are `string`, return `string`.\r\n * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.\r\n * Other cases do not supported.\r\n */\r\nexport function interpolateRawValues(\r\n data: SeriesData,\r\n precision: number | 'auto',\r\n sourceValue: InterpolatableValue,\r\n targetValue: InterpolatableValue,\r\n percent: number\r\n): InterpolatableValue {\r\n const isAutoPrecision = precision == null || precision === 'auto';\r\n\r\n if (targetValue == null) {\r\n return targetValue;\r\n }\r\n\r\n if (isNumber(targetValue)) {\r\n const value = interpolateNumber(\r\n sourceValue as number || 0,\r\n targetValue as number,\r\n percent\r\n );\r\n return round(\r\n value,\r\n isAutoPrecision ? Math.max(\r\n getPrecision(sourceValue as number || 0),\r\n getPrecision(targetValue as number)\r\n )\r\n : precision as number\r\n );\r\n }\r\n else if (isString(targetValue)) {\r\n return percent < 1 ? sourceValue : targetValue;\r\n }\r\n else {\r\n const interpolated = [];\r\n const leftArr = sourceValue as (string | number)[];\r\n const rightArr = targetValue as (string | number[]);\r\n const length = Math.max(leftArr ? leftArr.length : 0, rightArr.length);\r\n for (let i = 0; i < length; ++i) {\r\n const info = data.getDimensionInfo(i);\r\n // Don't interpolate ordinal dims\r\n if (info && info.type === 'ordinal') {\r\n // In init, there is no `sourceValue`, but should better not to get undefined result.\r\n interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i] as number;\r\n }\r\n else {\r\n const leftVal = leftArr && leftArr[i] ? leftArr[i] as number : 0;\r\n const rightVal = rightArr[i] as number;\r\n const value = interpolateNumber(leftVal, rightVal, percent);\r\n interpolated[i] = round(\r\n value,\r\n isAutoPrecision ? Math.max(\r\n getPrecision(leftVal),\r\n getPrecision(rightVal)\r\n )\r\n : precision as number\r\n );\r\n }\r\n }\r\n return interpolated;\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { ComponentFullType, ComponentTypeInfo, ComponentMainType, ComponentSubType } from './types';\r\n\r\nconst TYPE_DELIMITER = '.';\r\nconst IS_CONTAINER = '___EC__COMPONENT__CONTAINER___' as const;\r\nconst IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___' as const;\r\n\r\n/**\r\n * Notice, parseClassType('') should returns {main: '', sub: ''}\r\n * @public\r\n */\r\nexport function parseClassType(componentType: ComponentFullType): ComponentTypeInfo {\r\n const ret = {main: '', sub: ''};\r\n if (componentType) {\r\n const typeArr = componentType.split(TYPE_DELIMITER);\r\n ret.main = typeArr[0] || '';\r\n ret.sub = typeArr[1] || '';\r\n }\r\n return ret;\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nfunction checkClassType(componentType: ComponentFullType): void {\r\n zrUtil.assert(\r\n /^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType),\r\n 'componentType \"' + componentType + '\" illegal'\r\n );\r\n}\r\n\r\nexport function isExtendedClass(clz: any): boolean {\r\n return !!(clz && clz[IS_EXTENDED_CLASS]);\r\n}\r\n\r\n\r\nexport interface ExtendableConstructor {\r\n new (...args: any): any;\r\n $constructor?: new (...args: any) => any;\r\n extend: (proto: {[name: string]: any}) => ExtendableConstructor;\r\n superCall: (context: any, methodName: string, ...args: any) => any;\r\n superApply: (context: any, methodName: string, args: []) => any;\r\n superClass?: ExtendableConstructor;\r\n [IS_EXTENDED_CLASS]?: boolean;\r\n}\r\n\r\n/**\r\n * Implements `ExtendableConstructor` for `rootClz`.\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & ExtendableConstructor\r\n * enableClassExtend(Xxx as XxxConstructor);\r\n * ```\r\n */\r\nexport function enableClassExtend(rootClz: ExtendableConstructor, mandatoryMethods?: string[]): void {\r\n\r\n rootClz.$constructor = rootClz; // FIXME: not necessary?\r\n\r\n rootClz.extend = function (proto: Dictionary) {\r\n if (__DEV__) {\r\n zrUtil.each(mandatoryMethods, function (method) {\r\n if (!proto[method]) {\r\n console.warn(\r\n 'Method `' + method + '` should be implemented'\r\n + (proto.type ? ' in ' + proto.type : '') + '.'\r\n );\r\n }\r\n });\r\n }\r\n\r\n const superClass = this;\r\n let ExtendedClass: any;\r\n\r\n if (isESClass(superClass)) {\r\n ExtendedClass = class extends superClass {\r\n constructor() {\r\n super(...arguments as any);\r\n }\r\n };\r\n }\r\n else {\r\n // For backward compat, we both support ts class inheritance and this\r\n // \"extend\" approach.\r\n // The constructor should keep the same behavior as ts class inheritance:\r\n // If this constructor/$constructor is not declared, auto invoke the super\r\n // constructor.\r\n // If this constructor/$constructor is declared, it is responsible for\r\n // calling the super constructor.\r\n ExtendedClass = function (this: any) {\r\n (proto.$constructor || superClass).apply(this, arguments);\r\n };\r\n\r\n zrUtil.inherits(ExtendedClass, this);\r\n }\r\n\r\n zrUtil.extend(ExtendedClass.prototype, proto);\r\n ExtendedClass[IS_EXTENDED_CLASS] = true;\r\n\r\n ExtendedClass.extend = this.extend;\r\n ExtendedClass.superCall = superCall;\r\n ExtendedClass.superApply = superApply;\r\n ExtendedClass.superClass = superClass;\r\n\r\n return ExtendedClass as unknown as ExtendableConstructor;\r\n };\r\n}\r\n\r\nfunction isESClass(fn: unknown): boolean {\r\n return zrUtil.isFunction(fn)\r\n && /^class\\s/.test(Function.prototype.toString.call(fn));\r\n}\r\n\r\n/**\r\n * A work around to both support ts extend and this extend mechanism.\r\n * on sub-class.\r\n * @usage\r\n * ```ts\r\n * class Component { ... }\r\n * classUtil.enableClassExtend(Component);\r\n * classUtil.enableClassManagement(Component, {registerWhenExtend: true});\r\n *\r\n * class Series extends Component { ... }\r\n * // Without calling `markExtend`, `registerWhenExtend` will not work.\r\n * Component.markExtend(Series);\r\n * ```\r\n */\r\nexport function mountExtend(SubClz: any, SupperClz: any): void {\r\n SubClz.extend = SupperClz.extend;\r\n}\r\n\r\n\r\nexport interface CheckableConstructor {\r\n new (...args: any): any;\r\n isInstance: (ins: any) => boolean;\r\n}\r\n\r\n// A random offset.\r\nlet classBase = Math.round(Math.random() * 10);\r\n\r\n/**\r\n * Implements `CheckableConstructor` for `target`.\r\n * Can not use instanceof, consider different scope by\r\n * cross domain or es module import in ec extensions.\r\n * Mount a method \"isInstance()\" to Clz.\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & CheckableConstructor;\r\n * enableClassCheck(Xxx as XxxConstructor)\r\n * ```\r\n */\r\nexport function enableClassCheck(target: CheckableConstructor): void {\r\n const classAttr = ['__\\0is_clz', classBase++].join('_');\r\n target.prototype[classAttr] = true;\r\n\r\n if (__DEV__) {\r\n zrUtil.assert(!target.isInstance, 'The method \"is\" can not be defined.');\r\n }\r\n\r\n target.isInstance = function (obj) {\r\n return !!(obj && obj[classAttr]);\r\n };\r\n}\r\n\r\n// superCall should have class info, which can not be fetched from 'this'.\r\n// Consider this case:\r\n// class A has method f,\r\n// class B inherits class A, overrides method f, f call superApply('f'),\r\n// class C inherits class B, does not override method f,\r\n// then when method of class C is called, dead loop occurred.\r\nfunction superCall(this: any, context: any, methodName: string, ...args: any): any {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n}\r\n\r\nfunction superApply(this: any, context: any, methodName: string, args: any): any {\r\n return this.superClass.prototype[methodName].apply(context, args);\r\n}\r\n\r\nexport type Constructor = new (...args: any) => any;\r\ntype SubclassContainer = {[subType: string]: Constructor} & {[IS_CONTAINER]?: true};\r\n\r\nexport interface ClassManager {\r\n registerClass: (clz: Constructor) => Constructor;\r\n getClass: (\r\n componentMainType: ComponentMainType, subType?: ComponentSubType, throwWhenNotFound?: boolean\r\n ) => Constructor;\r\n getClassesByMainType: (componentType: ComponentMainType) => Constructor[];\r\n hasClass: (componentType: ComponentFullType) => boolean;\r\n getAllClassMainTypes: () => ComponentMainType[];\r\n hasSubTypes: (componentType: ComponentFullType) => boolean;\r\n}\r\n\r\n/**\r\n * Implements `ClassManager` for `target`\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & ClassManager\r\n * enableClassManagement(Xxx as XxxConstructor);\r\n * ```\r\n */\r\nexport function enableClassManagement(\r\n target: ClassManager\r\n): void {\r\n\r\n /**\r\n * Component model classes\r\n * key: componentType,\r\n * value:\r\n * componentClass, when componentType is 'a'\r\n * or Object., when componentType is 'a.b'\r\n */\r\n const storage: {\r\n [componentMainType: string]: (Constructor | SubclassContainer)\r\n } = {};\r\n\r\n target.registerClass = function (\r\n clz: Constructor\r\n ): Constructor {\r\n\r\n // `type` should not be a \"instance member\".\r\n // If using TS class, should better declared as `static type = 'series.pie'`.\r\n // otherwise users have to mount `type` on prototype manually.\r\n // For backward compat and enable instance visit type via `this.type`,\r\n // we still support fetch `type` from prototype.\r\n const componentFullType = (clz as any).type || clz.prototype.type;\r\n\r\n if (componentFullType) {\r\n checkClassType(componentFullType);\r\n\r\n // If only static type declared, we assign it to prototype mandatorily.\r\n clz.prototype.type = componentFullType;\r\n\r\n const componentTypeInfo = parseClassType(componentFullType);\r\n\r\n if (!componentTypeInfo.sub) {\r\n if (__DEV__) {\r\n if (storage[componentTypeInfo.main]) {\r\n console.warn(componentTypeInfo.main + ' exists.');\r\n }\r\n }\r\n storage[componentTypeInfo.main] = clz;\r\n }\r\n else if (componentTypeInfo.sub !== IS_CONTAINER) {\r\n const container = makeContainer(componentTypeInfo);\r\n container[componentTypeInfo.sub] = clz;\r\n }\r\n }\r\n return clz;\r\n };\r\n\r\n target.getClass = function (\r\n mainType: ComponentMainType,\r\n subType?: ComponentSubType,\r\n throwWhenNotFound?: boolean\r\n ): Constructor {\r\n let clz = storage[mainType];\r\n\r\n if (clz && (clz as SubclassContainer)[IS_CONTAINER]) {\r\n clz = subType ? (clz as SubclassContainer)[subType] : null;\r\n }\r\n\r\n if (throwWhenNotFound && !clz) {\r\n throw new Error(\r\n !subType\r\n ? mainType + '.' + 'type should be specified.'\r\n : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.'\r\n );\r\n }\r\n\r\n return clz as Constructor;\r\n };\r\n\r\n target.getClassesByMainType = function (componentType: ComponentFullType): Constructor[] {\r\n const componentTypeInfo = parseClassType(componentType);\r\n\r\n const result: Constructor[] = [];\r\n const obj = storage[componentTypeInfo.main];\r\n\r\n if (obj && (obj as SubclassContainer)[IS_CONTAINER]) {\r\n zrUtil.each(obj as SubclassContainer, function (o, type) {\r\n type !== IS_CONTAINER && result.push(o as Constructor);\r\n });\r\n }\r\n else {\r\n result.push(obj as Constructor);\r\n }\r\n\r\n return result;\r\n };\r\n\r\n target.hasClass = function (componentType: ComponentFullType): boolean {\r\n // Just consider componentType.main.\r\n const componentTypeInfo = parseClassType(componentType);\r\n return !!storage[componentTypeInfo.main];\r\n };\r\n\r\n /**\r\n * @return Like ['aa', 'bb'], but can not be ['aa.xx']\r\n */\r\n target.getAllClassMainTypes = function (): ComponentMainType[] {\r\n const types: string[] = [];\r\n zrUtil.each(storage, function (obj, type) {\r\n types.push(type);\r\n });\r\n return types;\r\n };\r\n\r\n /**\r\n * If a main type is container and has sub types\r\n */\r\n target.hasSubTypes = function (componentType: ComponentFullType): boolean {\r\n const componentTypeInfo = parseClassType(componentType);\r\n const obj = storage[componentTypeInfo.main];\r\n return obj && (obj as SubclassContainer)[IS_CONTAINER];\r\n };\r\n\r\n function makeContainer(componentTypeInfo: ComponentTypeInfo): SubclassContainer {\r\n let container = storage[componentTypeInfo.main];\r\n if (!container || !(container as SubclassContainer)[IS_CONTAINER]) {\r\n container = storage[componentTypeInfo.main] = {};\r\n container[IS_CONTAINER] = true;\r\n }\r\n return container as SubclassContainer;\r\n }\r\n}\r\n\r\n// /**\r\n// * @param {string|Array.} properties\r\n// */\r\n// export function setReadOnly(obj, properties) {\r\n // FIXME It seems broken in IE8 simulation of IE11\r\n // if (!zrUtil.isArray(properties)) {\r\n // properties = properties != null ? [properties] : [];\r\n // }\r\n // zrUtil.each(properties, function (prop) {\r\n // let value = obj[prop];\r\n\r\n // Object.defineProperty\r\n // && Object.defineProperty(obj, prop, {\r\n // value: value, writable: false\r\n // });\r\n // zrUtil.isArray(obj[prop])\r\n // && Object.freeze\r\n // && Object.freeze(obj[prop]);\r\n // });\r\n// }\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// TODO Parse shadow style\r\n// TODO Only shallow path support\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {Dictionary} from 'zrender/src/core/types';\r\nimport {PathStyleProps} from 'zrender/src/graphic/Path';\r\nimport Model from '../Model';\r\n\r\nexport default function makeStyleMapper(properties: readonly string[][], ignoreParent?: boolean) {\r\n // Normalize\r\n for (let i = 0; i < properties.length; i++) {\r\n if (!properties[i][1]) {\r\n properties[i][1] = properties[i][0];\r\n }\r\n }\r\n\r\n ignoreParent = ignoreParent || false;\r\n\r\n return function (model: Model, excludes?: readonly string[], includes?: readonly string[]) {\r\n const style: Dictionary = {};\r\n for (let i = 0; i < properties.length; i++) {\r\n const propName = properties[i][1];\r\n if ((excludes && zrUtil.indexOf(excludes, propName) >= 0)\r\n || (includes && zrUtil.indexOf(includes, propName) < 0)\r\n ) {\r\n continue;\r\n }\r\n const val = model.getShallow(propName, ignoreParent);\r\n if (val != null) {\r\n style[properties[i][0]] = val;\r\n }\r\n }\r\n // TODO Text or image?\r\n return style as PathStyleProps;\r\n };\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport makeStyleMapper from './makeStyleMapper';\r\nimport Model from '../Model';\r\nimport { AreaStyleOption } from '../../util/types';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\n\r\nexport const AREA_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['opacity'],\r\n ['shadowColor']\r\n // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\r\n // So do not transfer decal directly.\r\n];\r\nconst getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\r\n\r\ntype AreaStyleProps = Pick;\r\n\r\nclass AreaStyleMixin {\r\n getAreaStyle(\r\n this: Model,\r\n excludes?: readonly (keyof AreaStyleOption)[],\r\n includes?: readonly (keyof AreaStyleOption)[]\r\n ): AreaStyleProps {\r\n return getAreaStyle(this, excludes, includes);\r\n }\r\n};\r\n\r\nexport {AreaStyleMixin};\r\n", "\nimport LRU from '../../core/LRU';\nimport { platformApi } from '../../core/platform';\nimport { ImageLike } from '../../core/types';\n\nconst globalImageCache = new LRU(50);\n\ntype PendingWrap = {\n hostEl: {dirty: () => void}\n cb: (image: ImageLike, payload: any) => void\n cbPayload: any\n}\n\ntype CachedImageObj = {\n image: ImageLike\n pending: PendingWrap[]\n}\n\nexport function findExistImage(newImageOrSrc: string | ImageLike): ImageLike {\n if (typeof newImageOrSrc === 'string') {\n const cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n }\n else {\n return newImageOrSrc;\n }\n}\n\n/**\n * Caution: User should cache loaded images, but not just count on LRU.\n * Consider if required images more than LRU size, will dead loop occur?\n *\n * @param newImageOrSrc\n * @param image Existent image.\n * @param hostEl For calling `dirty`.\n * @param onload params: (image, cbPayload)\n * @param cbPayload Payload on cb calling.\n * @return image\n */\nexport function createOrUpdateImage(\n newImageOrSrc: string | ImageLike,\n image: ImageLike,\n hostEl: { dirty: () => void },\n onload?: (image: ImageLike, payload: T) => void,\n cbPayload?: T\n) {\n if (!newImageOrSrc) {\n return image;\n }\n else if (typeof newImageOrSrc === 'string') {\n\n // Image should not be loaded repeatly.\n if ((image && (image as any).__zrImageSrc === newImageOrSrc) || !hostEl) {\n return image;\n }\n\n // Only when there is no existent image or existent image src\n // is different, this method is responsible for load.\n const cachedImgObj = globalImageCache.get(newImageOrSrc);\n\n const pendingWrap = {hostEl: hostEl, cb: onload, cbPayload: cbPayload};\n\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n }\n else {\n image = platformApi.loadImage(\n newImageOrSrc, imageOnLoad, imageOnLoad\n );\n (image as any).__zrImageSrc = newImageOrSrc;\n\n globalImageCache.put(\n newImageOrSrc,\n (image as any).__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n }\n );\n }\n\n return image;\n }\n // newImageOrSrc is an HTMLImageElement or HTMLCanvasElement or Canvas\n else {\n return newImageOrSrc;\n }\n}\n\nfunction imageOnLoad(this: any) {\n const cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\n\n for (let i = 0; i < cachedImgObj.pending.length; i++) {\n const pendingWrap = cachedImgObj.pending[i];\n const cb = pendingWrap.cb;\n cb && cb(this, pendingWrap.cbPayload);\n pendingWrap.hostEl.dirty();\n }\n cachedImgObj.pending.length = 0;\n}\n\nexport function isImageReady(image: ImageLike) {\n return image && image.width && image.height;\n}\n\n", "import * as imageHelper from '../helper/image';\nimport {\n extend,\n retrieve2,\n retrieve3,\n reduce\n} from '../../core/util';\nimport { TextAlign, TextVerticalAlign, ImageLike, Dictionary } from '../../core/types';\nimport { TextStyleProps } from '../Text';\nimport { getLineHeight, getWidth, parsePercent } from '../../contain/text';\n\nconst STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\n\ninterface InnerTruncateOption {\n maxIteration?: number\n // If truncate result are less than minChar, ellipsis will not show\n // which is better for user hint in some cases\n minChar?: number\n // When all truncated, use the placeholder\n placeholder?: string\n\n maxIterations?: number\n}\n\ninterface InnerPreparedTruncateOption extends Required {\n font: string\n\n ellipsis: string\n ellipsisWidth: number\n contentWidth: number\n\n containerWidth: number\n cnCharWidth: number\n ascCharWidth: number\n}\n\n/**\n * Show ellipsis if overflow.\n */\nexport function truncateText(\n text: string,\n containerWidth: number,\n font: string,\n ellipsis?: string,\n options?: InnerTruncateOption\n): string {\n if (!containerWidth) {\n return '';\n }\n\n const textLines = (text + '').split('\\n');\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\n\n // FIXME\n // It is not appropriate that every line has '...' when truncate multiple lines.\n for (let i = 0, len = textLines.length; i < len; i++) {\n textLines[i] = truncateSingleLine(textLines[i], options as InnerPreparedTruncateOption);\n }\n\n return textLines.join('\\n');\n}\n\nfunction prepareTruncateOptions(\n containerWidth: number,\n font: string,\n ellipsis?: string,\n options?: InnerTruncateOption\n): InnerPreparedTruncateOption {\n options = options || {};\n let preparedOpts = extend({}, options) as InnerPreparedTruncateOption;\n\n preparedOpts.font = font;\n ellipsis = retrieve2(ellipsis, '...');\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\n const minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\n // FIXME\n // Other languages?\n preparedOpts.cnCharWidth = getWidth('\u56FD', font);\n // FIXME\n // Consider proportional font?\n const ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\n\n // Example 1: minChar: 3, text: 'asdfzxcv', truncate result: 'asdf', but not: 'a...'.\n // Example 2: minChar: 3, text: '\u7EF4\u5EA6', truncate result: '\u7EF4', but not: '...'.\n let contentWidth = containerWidth = Math.max(0, containerWidth - 1); // Reserve some gap.\n for (let i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n contentWidth -= ascCharWidth;\n }\n\n let ellipsisWidth = getWidth(ellipsis, font);\n if (ellipsisWidth > contentWidth) {\n ellipsis = '';\n ellipsisWidth = 0;\n }\n\n contentWidth = containerWidth - ellipsisWidth;\n\n preparedOpts.ellipsis = ellipsis;\n preparedOpts.ellipsisWidth = ellipsisWidth;\n preparedOpts.contentWidth = contentWidth;\n preparedOpts.containerWidth = containerWidth;\n\n return preparedOpts;\n}\n\nfunction truncateSingleLine(textLine: string, options: InnerPreparedTruncateOption): string {\n const containerWidth = options.containerWidth;\n const font = options.font;\n const contentWidth = options.contentWidth;\n\n if (!containerWidth) {\n return '';\n }\n\n let lineWidth = getWidth(textLine, font);\n\n if (lineWidth <= containerWidth) {\n return textLine;\n }\n\n for (let j = 0; ; j++) {\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\n textLine += options.ellipsis;\n break;\n }\n\n const subLength = j === 0\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\n : lineWidth > 0\n ? Math.floor(textLine.length * contentWidth / lineWidth)\n : 0;\n\n textLine = textLine.substr(0, subLength);\n lineWidth = getWidth(textLine, font);\n }\n\n if (textLine === '') {\n textLine = options.placeholder;\n }\n\n return textLine;\n}\n\nfunction estimateLength(\n text: string, contentWidth: number, ascCharWidth: number, cnCharWidth: number\n): number {\n let width = 0;\n let i = 0;\n for (let len = text.length; i < len && width < contentWidth; i++) {\n const charCode = text.charCodeAt(i);\n width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth;\n }\n return i;\n}\n\nexport interface PlainTextContentBlock {\n lineHeight: number\n // Line height of actual content.\n calculatedLineHeight: number\n\n contentWidth: number\n contentHeight: number\n\n width: number\n height: number\n\n /**\n * Real text width containing padding.\n * It should be the same as `width` if background is rendered\n * and `width` is set by user.\n */\n outerWidth: number\n outerHeight: number\n\n lines: string[]\n}\n\nexport function parsePlainText(\n text: string,\n style?: TextStyleProps\n): PlainTextContentBlock {\n text != null && (text += '');\n\n // textPadding has been normalized\n const overflow = style.overflow;\n const padding = style.padding as number[];\n const font = style.font;\n const truncate = overflow === 'truncate';\n const calculatedLineHeight = getLineHeight(font);\n const lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\n const bgColorDrawn = !!(style.backgroundColor);\n\n const truncateLineOverflow = style.lineOverflow === 'truncate';\n\n let width = style.width;\n let lines: string[];\n\n if (width != null && (overflow === 'break' || overflow === 'breakAll')) {\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\n }\n else {\n lines = text ? text.split('\\n') : [];\n }\n\n const contentHeight = lines.length * lineHeight;\n const height = retrieve2(style.height, contentHeight);\n\n // Truncate lines.\n if (contentHeight > height && truncateLineOverflow) {\n const lineCount = Math.floor(height / lineHeight);\n\n lines = lines.slice(0, lineCount);\n\n // TODO If show ellipse for line truncate\n // if (style.ellipsis) {\n // const options = prepareTruncateOptions(width, font, style.ellipsis, {\n // minChar: style.truncateMinChar,\n // placeholder: style.placeholder\n // });\n // lines[lineCount - 1] = truncateSingleLine(lastLine, options);\n // }\n }\n\n if (text && truncate && width != null) {\n const options = prepareTruncateOptions(width, font, style.ellipsis, {\n minChar: style.truncateMinChar,\n placeholder: style.placeholder\n });\n // Having every line has '...' when truncate multiple lines.\n for (let i = 0; i < lines.length; i++) {\n lines[i] = truncateSingleLine(lines[i], options);\n }\n }\n\n // Calculate real text width and height\n let outerHeight = height;\n let contentWidth = 0;\n for (let i = 0; i < lines.length; i++) {\n contentWidth = Math.max(getWidth(lines[i], font), contentWidth);\n }\n if (width == null) {\n // When width is not explicitly set, use outerWidth as width.\n width = contentWidth;\n }\n\n let outerWidth = contentWidth;\n if (padding) {\n outerHeight += padding[0] + padding[2];\n outerWidth += padding[1] + padding[3];\n width += padding[1] + padding[3];\n }\n\n if (bgColorDrawn) {\n // When render background, outerWidth should be the same as width.\n outerWidth = width;\n }\n\n return {\n lines: lines,\n height: height,\n outerWidth: outerWidth,\n outerHeight: outerHeight,\n lineHeight: lineHeight,\n calculatedLineHeight: calculatedLineHeight,\n contentWidth: contentWidth,\n contentHeight: contentHeight,\n width: width\n };\n}\n\nclass RichTextToken {\n styleName: string\n text: string\n width: number\n height: number\n\n // Inner height exclude padding\n innerHeight: number\n\n // Width and height of actual text content.\n contentHeight: number\n contentWidth: number\n\n lineHeight: number\n font: string\n align: TextAlign\n verticalAlign: TextVerticalAlign\n\n textPadding: number[]\n percentWidth?: string\n\n isLineHolder: boolean\n}\nclass RichTextLine {\n lineHeight: number\n width: number\n tokens: RichTextToken[] = []\n\n constructor(tokens?: RichTextToken[]) {\n if (tokens) {\n this.tokens = tokens;\n }\n }\n}\nexport class RichTextContentBlock {\n // width/height of content\n width: number = 0\n height: number = 0\n // Calculated text height\n contentWidth: number = 0\n contentHeight: number = 0\n // outerWidth/outerHeight with padding\n outerWidth: number = 0\n outerHeight: number = 0\n lines: RichTextLine[] = []\n}\n\ntype WrapInfo = {\n width: number,\n accumWidth: number,\n breakAll: boolean\n}\n/**\n * For example: 'some text {a|some text}other text{b|some text}xxx{c|}xxx'\n * Also consider 'bbbb{a|xxx\\nzzz}xxxx\\naaaa'.\n * If styleName is undefined, it is plain text.\n */\nexport function parseRichText(text: string, style: TextStyleProps) {\n const contentBlock = new RichTextContentBlock();\n\n text != null && (text += '');\n if (!text) {\n return contentBlock;\n }\n\n const topWidth = style.width;\n const topHeight = style.height;\n const overflow = style.overflow;\n let wrapInfo: WrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\n ? {width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll'}\n : null;\n\n let lastIndex = STYLE_REG.lastIndex = 0;\n let result;\n while ((result = STYLE_REG.exec(text)) != null) {\n const matchedIndex = result.index;\n if (matchedIndex > lastIndex) {\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\n }\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\n lastIndex = STYLE_REG.lastIndex;\n }\n\n if (lastIndex < text.length) {\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\n }\n\n // For `textWidth: xx%`\n let pendingList = [];\n\n let calculatedHeight = 0;\n let calculatedWidth = 0;\n\n const stlPadding = style.padding as number[];\n\n const truncate = overflow === 'truncate';\n const truncateLine = style.lineOverflow === 'truncate';\n\n // let prevToken: RichTextToken;\n\n function finishLine(line: RichTextLine, lineWidth: number, lineHeight: number) {\n line.width = lineWidth;\n line.lineHeight = lineHeight;\n calculatedHeight += lineHeight;\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\n }\n // Calculate layout info of tokens.\n outer: for (let i = 0; i < contentBlock.lines.length; i++) {\n const line = contentBlock.lines[i];\n let lineHeight = 0;\n let lineWidth = 0;\n\n for (let j = 0; j < line.tokens.length; j++) {\n const token = line.tokens[j];\n const tokenStyle = token.styleName && style.rich[token.styleName] || {};\n // textPadding should not inherit from style.\n const textPadding = token.textPadding = tokenStyle.padding as number[];\n const paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\n\n const font = token.font = tokenStyle.font || style.font;\n\n token.contentHeight = getLineHeight(font);\n // textHeight can be used when textVerticalAlign is specified in token.\n let tokenHeight = retrieve2(\n // textHeight should not be inherited, consider it can be specified\n // as box height of the block.\n tokenStyle.height, token.contentHeight\n );\n token.innerHeight = tokenHeight;\n\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n token.height = tokenHeight;\n // Inlcude padding in lineHeight.\n token.lineHeight = retrieve3(\n tokenStyle.lineHeight, style.lineHeight, tokenHeight\n );\n\n token.align = tokenStyle && tokenStyle.align || style.align;\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\n\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\n // TODO Add ellipsis on the previous token.\n // prevToken.text =\n if (j > 0) {\n line.tokens = line.tokens.slice(0, j);\n finishLine(line, lineWidth, lineHeight);\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\n }\n else {\n contentBlock.lines = contentBlock.lines.slice(0, i);\n }\n break outer;\n }\n\n let styleTokenWidth = tokenStyle.width;\n let tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\n\n // Percent width, can be `100%`, can be used in drawing separate\n // line when box width is needed to be auto.\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\n token.percentWidth = styleTokenWidth;\n pendingList.push(token);\n\n token.contentWidth = getWidth(token.text, font);\n // Do not truncate in this case, because there is no user case\n // and it is too complicated.\n }\n else {\n if (tokenWidthNotSpecified) {\n // FIXME: If image is not loaded and textWidth is not specified, calling\n // `getBoundingRect()` will not get correct result.\n const textBackgroundColor = tokenStyle.backgroundColor;\n let bgImg = textBackgroundColor && (textBackgroundColor as { image: ImageLike }).image;\n\n if (bgImg) {\n bgImg = imageHelper.findExistImage(bgImg);\n if (imageHelper.isImageReady(bgImg)) {\n // Update token width from image size.\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\n }\n }\n }\n\n const remainTruncWidth = truncate && topWidth != null\n ? topWidth - lineWidth : null;\n\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\n token.text = '';\n token.width = token.contentWidth = 0;\n }\n else {\n token.text = truncateText(\n token.text, remainTruncWidth - paddingH, font, style.ellipsis,\n {minChar: style.truncateMinChar}\n );\n token.width = token.contentWidth = getWidth(token.text, font);\n }\n }\n else {\n token.contentWidth = getWidth(token.text, font);\n }\n }\n\n token.width += paddingH;\n\n lineWidth += token.width;\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n\n // prevToken = token;\n }\n\n finishLine(line, lineWidth, lineHeight);\n }\n\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\n contentBlock.contentHeight = calculatedHeight;\n contentBlock.contentWidth = calculatedWidth;\n\n if (stlPadding) {\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\n }\n\n for (let i = 0; i < pendingList.length; i++) {\n const token = pendingList[i];\n const percentWidth = token.percentWidth;\n // Should not base on outerWidth, because token can not be placed out of padding.\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\n }\n\n return contentBlock;\n}\n\ntype TokenStyle = TextStyleProps['rich'][string];\n\nfunction pushTokens(\n block: RichTextContentBlock,\n str: string,\n style: TextStyleProps,\n wrapInfo: WrapInfo,\n styleName?: string\n) {\n const isEmptyStr = str === '';\n const tokenStyle: TokenStyle = styleName && style.rich[styleName] || {};\n const lines = block.lines;\n const font = tokenStyle.font || style.font;\n let newLine = false;\n let strLines;\n let linesWidths;\n\n if (wrapInfo) {\n const tokenPadding = tokenStyle.padding as number[];\n let tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\n // Wrap the whole token if tokenWidth if fixed.\n const outerWidth = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\n if (lines.length > 0) { // Not first line\n if (outerWidth + wrapInfo.accumWidth > wrapInfo.width) {\n // TODO Support wrap text in token.\n strLines = str.split('\\n');\n newLine = true;\n }\n }\n\n wrapInfo.accumWidth = outerWidth;\n }\n else {\n const res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\n linesWidths = res.linesWidths;\n strLines = res.lines;\n }\n }\n else {\n strLines = str.split('\\n');\n }\n\n for (let i = 0; i < strLines.length; i++) {\n const text = strLines[i];\n const token = new RichTextToken();\n token.styleName = styleName;\n token.text = text;\n token.isLineHolder = !text && !isEmptyStr;\n\n if (typeof tokenStyle.width === 'number') {\n token.width = tokenStyle.width;\n }\n else {\n token.width = linesWidths\n ? linesWidths[i] // Caculated width in the wrap\n : getWidth(text, font);\n }\n\n // The first token should be appended to the last line if not new line.\n if (!i && !newLine) {\n const tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\n\n // Consider cases:\n // (1) ''.split('\\n') => ['', '\\n', ''], the '' at the first item\n // (which is a placeholder) should be replaced by new token.\n // (2) A image backage, where token likes {a|}.\n // (3) A redundant '' will affect textAlign in line.\n // (4) tokens with the same tplName should not be merged, because\n // they should be displayed in different box (with border and padding).\n const tokensLen = tokens.length;\n (tokensLen === 1 && tokens[0].isLineHolder)\n ? (tokens[0] = token)\n // Consider text is '', only insert when it is the \"lineHolder\" or\n // \"emptyStr\". Otherwise a redundant '' will affect textAlign in line.\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\n }\n // Other tokens always start a new line.\n else {\n // If there is '', insert it as a placeholder.\n lines.push(new RichTextLine([token]));\n }\n }\n}\n\n\nfunction isAlphabeticLetter(ch: string) {\n // Unicode Character Ranges\n // https://jrgraphix.net/research/unicode_blocks.php\n // The following ranges may not cover all letter ranges but only the more\n // popular ones. Developers could make pull requests when they find those\n // not covered.\n let code = ch.charCodeAt(0);\n return code >= 0x20 && code <= 0x24F // Latin\n || code >= 0x370 && code <= 0x10FF // Greek, Coptic, Cyrilic, and etc.\n || code >= 0x1200 && code <= 0x13FF // Ethiopic and Cherokee\n || code >= 0x1E00 && code <= 0x206F; // Latin and Greek extended\n}\n\nconst breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\n obj[ch] = true;\n return obj;\n}, {} as Dictionary);\n/**\n * If break by word. For latin languages.\n */\nfunction isWordBreakChar(ch: string) {\n if (isAlphabeticLetter(ch)) {\n if (breakCharMap[ch]) {\n return true;\n }\n return false;\n }\n return true;\n}\n\nfunction wrapText(\n text: string,\n font: string,\n lineWidth: number,\n isBreakAll: boolean,\n lastAccumWidth: number\n) {\n let lines: string[] = [];\n let linesWidths: number[] = [];\n let line = '';\n let currentWord = '';\n let currentWordWidth = 0;\n let accumWidth = 0;\n\n for (let i = 0; i < text.length; i++) {\n\n const ch = text.charAt(i);\n if (ch === '\\n') {\n if (currentWord) {\n line += currentWord;\n accumWidth += currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n // Reset\n line = '';\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = 0;\n continue;\n }\n\n const chWidth = getWidth(ch, font);\n const inWord = isBreakAll ? false : !isWordBreakChar(ch);\n\n if (!lines.length\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\n : accumWidth + chWidth > lineWidth\n ) {\n if (!accumWidth) { // If nothing appended yet.\n if (inWord) {\n // The word length is still too long for one line\n // Force break the word\n lines.push(currentWord);\n linesWidths.push(currentWordWidth);\n\n currentWord = ch;\n currentWordWidth = chWidth;\n }\n else {\n // lineWidth is too small for ch\n lines.push(ch);\n linesWidths.push(chWidth);\n }\n }\n else if (line || currentWord) {\n if (inWord) {\n if (!line) {\n // The one word is still too long for one line\n // Force break the word\n // TODO Keep the word?\n line = currentWord;\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = currentWordWidth;\n }\n\n lines.push(line);\n linesWidths.push(accumWidth - currentWordWidth);\n\n // Break the whole word\n currentWord += ch;\n currentWordWidth += chWidth;\n line = '';\n accumWidth = currentWordWidth;\n }\n else {\n // Append lastWord if have\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n\n line = ch;\n accumWidth = chWidth;\n }\n }\n\n continue;\n }\n\n accumWidth += chWidth;\n\n if (inWord) {\n currentWord += ch;\n currentWordWidth += chWidth;\n }\n else {\n // Append whole word\n if (currentWord) {\n line += currentWord;\n // Reset\n currentWord = '';\n currentWordWidth = 0;\n }\n\n // Append character\n line += ch;\n }\n }\n\n if (!lines.length && !line) {\n line = text;\n currentWord = '';\n currentWordWidth = 0;\n }\n\n // Append last line.\n if (currentWord) {\n line += currentWord;\n }\n if (line) {\n lines.push(line);\n linesWidths.push(accumWidth);\n }\n\n if (lines.length === 1) {\n // No new line.\n accumWidth += lastAccumWidth;\n }\n\n return {\n // Accum width of last line\n accumWidth,\n lines: lines,\n linesWidths\n };\n}", "/**\n * Base class of all displayable graphic objects\n */\n\nimport Element, {ElementProps, ElementStatePropNames, ElementAnimateConfig, ElementCommonState} from '../Element';\nimport BoundingRect from '../core/BoundingRect';\nimport { PropType, Dictionary, MapToType } from '../core/types';\nimport Path from './Path';\nimport { keys, extend, createObject } from '../core/util';\nimport Animator from '../animation/Animator';\nimport { REDRAW_BIT, STYLE_CHANGED_BIT } from './constants';\n\n// type CalculateTextPositionResult = ReturnType\n\nconst STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\n\nexport interface CommonStyleProps {\n shadowBlur?: number\n shadowOffsetX?: number\n shadowOffsetY?: number\n shadowColor?: string\n\n opacity?: number\n /**\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n */\n blend?: string\n}\n\nexport const DEFAULT_COMMON_STYLE: CommonStyleProps = {\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowColor: '#000',\n opacity: 1,\n blend: 'source-over'\n};\n\nexport const DEFAULT_COMMON_ANIMATION_PROPS: MapToType = {\n style: {\n shadowBlur: true,\n shadowOffsetX: true,\n shadowOffsetY: true,\n shadowColor: true,\n opacity: true\n }\n };\n\n(DEFAULT_COMMON_STYLE as any)[STYLE_MAGIC_KEY] = true;\n\nexport interface DisplayableProps extends ElementProps {\n style?: Dictionary\n\n zlevel?: number\n z?: number\n z2?: number\n\n culling?: boolean\n\n // TODO list all cursors\n cursor?: string\n\n rectHover?: boolean\n\n progressive?: boolean\n\n incremental?: boolean\n\n ignoreCoarsePointer?: boolean\n\n batch?: boolean\n invisible?: boolean\n}\n\ntype DisplayableKey = keyof DisplayableProps\ntype DisplayablePropertyType = PropType\n\nexport type DisplayableStatePropNames = ElementStatePropNames | 'style' | 'z' | 'z2' | 'invisible';\nexport type DisplayableState = Pick & ElementCommonState;\n\nconst PRIMARY_STATES_KEYS = ['z', 'z2', 'invisible'] as const;\nconst PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ['invisible'] as const;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Displayable {\n animate(key?: '', loop?: boolean): Animator\n animate(key: 'style', loop?: boolean): Animator\n\n getState(stateName: string): DisplayableState\n ensureState(stateName: string): DisplayableState\n\n states: Dictionary\n stateProxy: (stateName: string) => DisplayableState\n}\n\nclass Displayable extends Element {\n\n /**\n * Whether the displayable object is visible. when it is true, the displayable object\n * is not drawn, but the mouse event can still trigger the object.\n */\n invisible: boolean\n\n z: number\n\n z2: number\n\n /**\n * The z level determines the displayable object can be drawn in which layer canvas.\n */\n zlevel: number\n\n /**\n * If enable culling\n */\n culling: boolean\n\n /**\n * Mouse cursor when hovered\n */\n cursor: string\n\n /**\n * If hover area is bounding rect\n */\n rectHover: boolean\n /**\n * For increamental rendering\n */\n incremental: boolean\n\n /**\n * Never increase to target size\n */\n ignoreCoarsePointer?: boolean\n\n style: Dictionary\n\n protected _normalState: DisplayableState\n\n protected _rect: BoundingRect\n protected _paintRect: BoundingRect\n protected _prevPaintRect: BoundingRect\n\n dirtyRectTolerance: number\n\n /************* Properties will be inejected in other modules. *******************/\n\n // @deprecated.\n useHoverLayer?: boolean\n\n __hoverStyle?: CommonStyleProps\n\n // TODO use WeakMap?\n\n // Shapes for cascade clipping.\n // Can only be `null`/`undefined` or an non-empty array, MUST NOT be an empty array.\n // because it is easy to only using null to check whether clipPaths changed.\n __clipPaths?: Path[]\n\n // FOR CANVAS PAINTER\n __canvasFillGradient: CanvasGradient\n __canvasStrokeGradient: CanvasGradient\n __canvasFillPattern: CanvasPattern\n __canvasStrokePattern: CanvasPattern\n\n // FOR SVG PAINTER\n __svgEl: SVGElement\n\n constructor(props?: Props) {\n super(props);\n }\n\n protected _init(props?: Props) {\n // Init default properties\n const keysArr = keys(props);\n for (let i = 0; i < keysArr.length; i++) {\n const key = keysArr[i];\n if (key === 'style') {\n this.useStyle(props[key] as Props['style']);\n }\n else {\n super.attrKV(key as any, props[key]);\n }\n }\n // Give a empty style\n if (!this.style) {\n this.useStyle({});\n }\n }\n\n // Hook provided to developers.\n beforeBrush() {}\n afterBrush() {}\n\n // Hook provided to inherited classes.\n // Executed between beforeBrush / afterBrush\n innerBeforeBrush() {}\n innerAfterBrush() {}\n\n shouldBePainted(\n viewWidth: number,\n viewHeight: number,\n considerClipPath: boolean,\n considerAncestors: boolean\n ) {\n const m = this.transform;\n if (\n this.ignore\n // Ignore invisible element\n || this.invisible\n // Ignore transparent element\n || this.style.opacity === 0\n // Ignore culled element\n || (this.culling\n && isDisplayableCulled(this, viewWidth, viewHeight)\n )\n // Ignore scale 0 element, in some environment like node-canvas\n // Draw a scale 0 element can cause all following draw wrong\n // And setTransform with scale 0 will cause set back transform failed.\n || (m && !m[0] && !m[3])\n ) {\n return false;\n }\n\n if (considerClipPath && this.__clipPaths) {\n for (let i = 0; i < this.__clipPaths.length; ++i) {\n if (this.__clipPaths[i].isZeroArea()) {\n return false;\n }\n }\n }\n\n if (considerAncestors && this.parent) {\n let parent = this.parent;\n while (parent) {\n if (parent.ignore) {\n return false;\n }\n parent = parent.parent;\n }\n }\n\n return true;\n }\n\n /**\n * If displayable element contain coord x, y\n */\n contain(x: number, y: number) {\n return this.rectContain(x, y);\n }\n\n traverse(\n cb: (this: Context, el: this) => void,\n context?: Context\n ) {\n cb.call(context, this);\n }\n\n /**\n * If bounding rect of element contain coord x, y\n */\n rectContain(x: number, y: number) {\n const coord = this.transformCoordToLocal(x, y);\n const rect = this.getBoundingRect();\n return rect.contain(coord[0], coord[1]);\n }\n\n getPaintRect(): BoundingRect {\n let rect = this._paintRect;\n if (!this._paintRect || this.__dirty) {\n const transform = this.transform;\n const elRect = this.getBoundingRect();\n\n const style = this.style;\n const shadowSize = style.shadowBlur || 0;\n const shadowOffsetX = style.shadowOffsetX || 0;\n const shadowOffsetY = style.shadowOffsetY || 0;\n\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\n if (transform) {\n BoundingRect.applyTransform(rect, elRect, transform);\n }\n else {\n rect.copy(elRect);\n }\n\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\n\n }\n\n // For the accuracy tolerance of text height or line joint point\n const tolerance = this.dirtyRectTolerance;\n if (!rect.isZero()) {\n rect.x = Math.floor(rect.x - tolerance);\n rect.y = Math.floor(rect.y - tolerance);\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\n }\n }\n return rect;\n }\n\n setPrevPaintRect(paintRect: BoundingRect) {\n if (paintRect) {\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\n this._prevPaintRect.copy(paintRect);\n }\n else {\n this._prevPaintRect = null;\n }\n }\n\n getPrevPaintRect(): BoundingRect {\n return this._prevPaintRect;\n }\n\n /**\n * Alias for animate('style')\n * @param loop\n */\n animateStyle(loop: boolean) {\n return this.animate('style', loop);\n }\n\n // Override updateDuringAnimation\n updateDuringAnimation(targetKey: string) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else {\n this.markRedraw();\n }\n }\n\n attrKV(key: DisplayableKey, value: DisplayablePropertyType) {\n if (key !== 'style') {\n super.attrKV(key as keyof DisplayableProps, value);\n }\n else {\n if (!this.style) {\n this.useStyle(value as Dictionary);\n }\n else {\n this.setStyle(value as Dictionary);\n }\n }\n }\n\n setStyle(obj: Props['style']): this\n setStyle(obj: T, value: Props['style'][T]): this\n setStyle(keyOrObj: keyof Props['style'] | Props['style'], value?: unknown): this {\n if (typeof keyOrObj === 'string') {\n this.style[keyOrObj] = value;\n }\n else {\n extend(this.style, keyOrObj as Props['style']);\n }\n this.dirtyStyle();\n return this;\n }\n\n // getDefaultStyleValue(key: T): Props['style'][T] {\n // // Default value is on the prototype.\n // return this.style.prototype[key];\n // }\n\n dirtyStyle(notRedraw?: boolean) {\n if (!notRedraw) {\n this.markRedraw();\n }\n this.__dirty |= STYLE_CHANGED_BIT;\n // Clear bounding rect.\n if (this._rect) {\n this._rect = null;\n }\n }\n\n dirty() {\n this.dirtyStyle();\n }\n\n /**\n * Is style changed. Used with dirtyStyle.\n */\n styleChanged() {\n return !!(this.__dirty & STYLE_CHANGED_BIT);\n }\n\n /**\n * Mark style updated. Only useful when style is used for caching. Like in the text.\n */\n styleUpdated() {\n this.__dirty &= ~STYLE_CHANGED_BIT;\n }\n\n /**\n * Create a style object with default values in it's prototype.\n */\n createStyle(obj?: Props['style']) {\n return createObject(DEFAULT_COMMON_STYLE, obj);\n }\n\n /**\n * Replace style property.\n * It will create a new style if given obj is not a valid style object.\n */\n // PENDING should not createStyle if it's an style object.\n useStyle(obj: Props['style']) {\n if (!obj[STYLE_MAGIC_KEY]) {\n obj = this.createStyle(obj);\n }\n if (this.__inHover) {\n this.__hoverStyle = obj; // Not affect exists style.\n }\n else {\n this.style = obj;\n }\n this.dirtyStyle();\n }\n\n /**\n * Determine if an object is a valid style object.\n * Which means it is created by `createStyle.`\n *\n * A valid style object will have all default values in it's prototype.\n * To avoid get null/undefined values.\n */\n isStyleObject(obj: Props['style']) {\n return obj[STYLE_MAGIC_KEY];\n }\n\n protected _innerSaveToNormal(toState: DisplayableState) {\n super._innerSaveToNormal(toState);\n\n const normalState = this._normalState;\n if (toState.style && !normalState.style) {\n // Clone style object.\n // TODO: Only save changed style.\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\n }\n\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n }\n\n protected _applyStateObj(\n stateName: string,\n state: DisplayableState,\n normalState: DisplayableState,\n keepCurrentStates: boolean,\n transition: boolean,\n animationCfg: ElementAnimateConfig\n ) {\n super._applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n\n const needsRestoreToNormal = !(state && keepCurrentStates);\n let targetStyle: Props['style'];\n if (state && state.style) {\n // Only animate changed properties.\n if (transition) {\n if (keepCurrentStates) {\n targetStyle = state.style;\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else {\n targetStyle = this._mergeStyle(\n this.createStyle(),\n keepCurrentStates ? this.style : normalState.style\n );\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else if (needsRestoreToNormal) {\n targetStyle = normalState.style;\n }\n\n if (targetStyle) {\n if (transition) {\n // Clone a new style. Not affect the original one.\n const sourceStyle = this.style;\n\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\n // const sourceStyle = this.style = this.createStyle(this.style);\n\n if (needsRestoreToNormal) {\n const changedKeys = keys(sourceStyle);\n for (let i = 0; i < changedKeys.length; i++) {\n const key = changedKeys[i];\n if (key in targetStyle) { // Not use `key == null` because == null may means no stroke/fill.\n // Pick out from prototype. Or the property won't be animated.\n (targetStyle as any)[key] = targetStyle[key];\n // Omit the property has no default value.\n (this.style as any)[key] = sourceStyle[key];\n }\n }\n }\n\n // If states is switched twice in ONE FRAME, for example:\n // one property(for example shadowBlur) changed from default value to a specifed value,\n // then switched back in immediately. this.style may don't set this property yet when switching back.\n // It won't treat it as an changed property when switching back. And it won't be animated.\n // So here we make sure the properties will be animated from default value to a specifed value are set.\n const targetKeys = keys(targetStyle);\n for (let i = 0; i < targetKeys.length; i++) {\n const key = targetKeys[i];\n this.style[key] = this.style[key];\n }\n\n this._transitionState(stateName, {\n style: targetStyle\n } as Props, animationCfg, this.getAnimationStyleProps() as MapToType);\n }\n else {\n this.useStyle(targetStyle);\n }\n }\n\n // Don't change z, z2 for element moved into hover layer.\n // It's not necessary and will cause paint list order changed.\n const statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS;\n for (let i = 0; i < statesKeys.length; i++) {\n let key = statesKeys[i];\n if (state && state[key] != null) {\n // Replace if it exist in target state\n (this as any)[key] = state[key];\n }\n else if (needsRestoreToNormal) {\n // Restore to normal state\n if (normalState[key] != null) {\n (this as any)[key] = normalState[key];\n }\n }\n }\n }\n\n protected _mergeStates(states: DisplayableState[]) {\n const mergedState = super._mergeStates(states) as DisplayableState;\n let mergedStyle: Props['style'];\n for (let i = 0; i < states.length; i++) {\n const state = states[i];\n if (state.style) {\n mergedStyle = mergedStyle || {};\n this._mergeStyle(mergedStyle, state.style);\n }\n }\n if (mergedStyle) {\n mergedState.style = mergedStyle;\n }\n return mergedState;\n }\n\n protected _mergeStyle(\n targetStyle: CommonStyleProps,\n sourceStyle: CommonStyleProps\n ) {\n extend(targetStyle, sourceStyle);\n return targetStyle;\n }\n\n getAnimationStyleProps() {\n return DEFAULT_COMMON_ANIMATION_PROPS;\n }\n\n /**\n * The string value of `textPosition` needs to be calculated to a real postion.\n * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]`\n * by default. See `contain/text.js#calculateTextPosition` for more details.\n * But some coutom shapes like \"pin\", \"flag\" have center that is not exactly\n * `[width/2, height/2]`. So we provide this hook to customize the calculation\n * for those shapes. It will be called if the `style.textPosition` is a string.\n * @param out Prepared out object. If not provided, this method should\n * be responsible for creating one.\n * @param style\n * @param rect {x, y, width, height}\n * @return out The same as the input out.\n * {\n * x: number. mandatory.\n * y: number. mandatory.\n * textAlign: string. optional. use style.textAlign by default.\n * textVerticalAlign: string. optional. use style.textVerticalAlign by default.\n * }\n */\n // calculateTextPosition: (out: CalculateTextPositionResult, style: Dictionary, rect: RectLike) => CalculateTextPositionResult\n\n protected static initDefaultProps = (function () {\n const dispProto = Displayable.prototype;\n dispProto.type = 'displayable';\n dispProto.invisible = false;\n dispProto.z = 0;\n dispProto.z2 = 0;\n dispProto.zlevel = 0;\n dispProto.culling = false;\n dispProto.cursor = 'pointer';\n dispProto.rectHover = false;\n dispProto.incremental = false;\n dispProto._rect = null;\n dispProto.dirtyRectTolerance = 0;\n\n dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT;\n })()\n}\n\nconst tmpRect = new BoundingRect(0, 0, 0, 0);\nconst viewRect = new BoundingRect(0, 0, 0, 0);\nfunction isDisplayableCulled(el: Displayable, width: number, height: number) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n viewRect.width = width;\n viewRect.height = height;\n return !tmpRect.intersect(viewRect);\n}\n\nexport default Displayable;", "/**\n * @author Yi Shen(https://github.com/pissang)\n */\n\nimport * as vec2 from './vector';\nimport * as curve from './curve';\n\nconst mathMin = Math.min;\nconst mathMax = Math.max;\nconst mathSin = Math.sin;\nconst mathCos = Math.cos;\nconst PI2 = Math.PI * 2;\n\nconst start = vec2.create();\nconst end = vec2.create();\nconst extremity = vec2.create();\n\n/**\n * \u4ECE\u9876\u70B9\u6570\u7EC4\u4E2D\u8BA1\u7B97\u51FA\u6700\u5C0F\u5305\u56F4\u76D2\uFF0C\u5199\u5165`min`\u548C`max`\u4E2D\n */\nexport function fromPoints(points: ArrayLike[], min: vec2.VectorArray, max: vec2.VectorArray) {\n if (points.length === 0) {\n return;\n }\n let p = points[0];\n let left = p[0];\n let right = p[0];\n let top = p[1];\n let bottom = p[1];\n\n for (let i = 1; i < points.length; i++) {\n p = points[i];\n left = mathMin(left, p[0]);\n right = mathMax(right, p[0]);\n top = mathMin(top, p[1]);\n bottom = mathMax(bottom, p[1]);\n }\n\n min[0] = left;\n min[1] = top;\n max[0] = right;\n max[1] = bottom;\n}\n\nexport function fromLine(\n x0: number, y0: number, x1: number, y1: number,\n min: vec2.VectorArray, max: vec2.VectorArray\n) {\n min[0] = mathMin(x0, x1);\n min[1] = mathMin(y0, y1);\n max[0] = mathMax(x0, x1);\n max[1] = mathMax(y0, y1);\n}\n\nconst xDim: number[] = [];\nconst yDim: number[] = [];\n/**\n * \u4ECE\u4E09\u9636\u8D1D\u585E\u5C14\u66F2\u7EBF(p0, p1, p2, p3)\u4E2D\u8BA1\u7B97\u51FA\u6700\u5C0F\u5305\u56F4\u76D2\uFF0C\u5199\u5165`min`\u548C`max`\u4E2D\n */\nexport function fromCubic(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number,\n min: vec2.VectorArray, max: vec2.VectorArray\n) {\n const cubicExtrema = curve.cubicExtrema;\n const cubicAt = curve.cubicAt;\n let n = cubicExtrema(x0, x1, x2, x3, xDim);\n min[0] = Infinity;\n min[1] = Infinity;\n max[0] = -Infinity;\n max[1] = -Infinity;\n\n for (let i = 0; i < n; i++) {\n const x = cubicAt(x0, x1, x2, x3, xDim[i]);\n min[0] = mathMin(x, min[0]);\n max[0] = mathMax(x, max[0]);\n }\n n = cubicExtrema(y0, y1, y2, y3, yDim);\n for (let i = 0; i < n; i++) {\n const y = cubicAt(y0, y1, y2, y3, yDim[i]);\n min[1] = mathMin(y, min[1]);\n max[1] = mathMax(y, max[1]);\n }\n\n min[0] = mathMin(x0, min[0]);\n max[0] = mathMax(x0, max[0]);\n min[0] = mathMin(x3, min[0]);\n max[0] = mathMax(x3, max[0]);\n\n min[1] = mathMin(y0, min[1]);\n max[1] = mathMax(y0, max[1]);\n min[1] = mathMin(y3, min[1]);\n max[1] = mathMax(y3, max[1]);\n}\n\n/**\n * \u4ECE\u4E8C\u9636\u8D1D\u585E\u5C14\u66F2\u7EBF(p0, p1, p2)\u4E2D\u8BA1\u7B97\u51FA\u6700\u5C0F\u5305\u56F4\u76D2\uFF0C\u5199\u5165`min`\u548C`max`\u4E2D\n */\nexport function fromQuadratic(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number,\n min: vec2.VectorArray, max: vec2.VectorArray\n) {\n const quadraticExtremum = curve.quadraticExtremum;\n const quadraticAt = curve.quadraticAt;\n // Find extremities, where derivative in x dim or y dim is zero\n const tx =\n mathMax(\n mathMin(quadraticExtremum(x0, x1, x2), 1), 0\n );\n const ty =\n mathMax(\n mathMin(quadraticExtremum(y0, y1, y2), 1), 0\n );\n\n const x = quadraticAt(x0, x1, x2, tx);\n const y = quadraticAt(y0, y1, y2, ty);\n\n min[0] = mathMin(x0, x2, x);\n min[1] = mathMin(y0, y2, y);\n max[0] = mathMax(x0, x2, x);\n max[1] = mathMax(y0, y2, y);\n}\n\n/**\n * \u4ECE\u5706\u5F27\u4E2D\u8BA1\u7B97\u51FA\u6700\u5C0F\u5305\u56F4\u76D2\uFF0C\u5199\u5165`min`\u548C`max`\u4E2D\n */\nexport function fromArc(\n x: number, y: number, rx: number, ry: number, startAngle: number, endAngle: number, anticlockwise: boolean,\n min: vec2.VectorArray, max: vec2.VectorArray\n) {\n const vec2Min = vec2.min;\n const vec2Max = vec2.max;\n\n const diff = Math.abs(startAngle - endAngle);\n\n\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\n // Is a circle\n min[0] = x - rx;\n min[1] = y - ry;\n max[0] = x + rx;\n max[1] = y + ry;\n return;\n }\n\n start[0] = mathCos(startAngle) * rx + x;\n start[1] = mathSin(startAngle) * ry + y;\n\n end[0] = mathCos(endAngle) * rx + x;\n end[1] = mathSin(endAngle) * ry + y;\n\n vec2Min(min, start, end);\n vec2Max(max, start, end);\n\n // Thresh to [0, Math.PI * 2]\n startAngle = startAngle % (PI2);\n if (startAngle < 0) {\n startAngle = startAngle + PI2;\n }\n endAngle = endAngle % (PI2);\n if (endAngle < 0) {\n endAngle = endAngle + PI2;\n }\n\n if (startAngle > endAngle && !anticlockwise) {\n endAngle += PI2;\n }\n else if (startAngle < endAngle && anticlockwise) {\n startAngle += PI2;\n }\n if (anticlockwise) {\n const tmp = endAngle;\n endAngle = startAngle;\n startAngle = tmp;\n }\n\n // const number = 0;\n // const step = (anticlockwise ? -Math.PI : Math.PI) / 2;\n for (let angle = 0; angle < endAngle; angle += Math.PI / 2) {\n if (angle > startAngle) {\n extremity[0] = mathCos(angle) * rx + x;\n extremity[1] = mathSin(angle) * ry + y;\n\n vec2Min(min, extremity, min);\n vec2Max(max, extremity, max);\n }\n }\n}\n", "/**\n * Path \u4EE3\u7406\uFF0C\u53EF\u4EE5\u5728`buildPath`\u4E2D\u7528\u4E8E\u66FF\u4EE3`ctx`, \u4F1A\u4FDD\u5B58\u6BCF\u4E2Apath\u64CD\u4F5C\u7684\u547D\u4EE4\u5230pathCommands\u5C5E\u6027\u4E2D\n * \u53EF\u4EE5\u7528\u4E8E isInsidePath \u5224\u65AD\u4EE5\u53CA\u83B7\u53D6boundingRect\n */\n\n// TODO getTotalLength, getPointAtLength, arcTo\n\n/* global Float32Array */\n\nimport * as vec2 from './vector';\nimport BoundingRect from './BoundingRect';\nimport {devicePixelRatio as dpr} from '../config';\nimport { fromLine, fromCubic, fromQuadratic, fromArc } from './bbox';\nimport { cubicLength, cubicSubdivide, quadraticLength, quadraticSubdivide } from './curve';\n\nconst CMD = {\n M: 1,\n L: 2,\n C: 3,\n Q: 4,\n A: 5,\n Z: 6,\n // Rect\n R: 7\n};\n\n// const CMD_MEM_SIZE = {\n// M: 3,\n// L: 3,\n// C: 7,\n// Q: 5,\n// A: 9,\n// R: 5,\n// Z: 1\n// };\n\ninterface ExtendedCanvasRenderingContext2D extends CanvasRenderingContext2D {\n dpr?: number\n}\n\nconst tmpOutX: number[] = [];\nconst tmpOutY: number[] = [];\n\nconst min: number[] = [];\nconst max: number[] = [];\nconst min2: number[] = [];\nconst max2: number[] = [];\nconst mathMin = Math.min;\nconst mathMax = Math.max;\nconst mathCos = Math.cos;\nconst mathSin = Math.sin;\nconst mathAbs = Math.abs;\n\nconst PI = Math.PI;\nconst PI2 = PI * 2;\n\nconst hasTypedArray = typeof Float32Array !== 'undefined';\n\nconst tmpAngles: number[] = [];\n\nfunction modPI2(radian: number) {\n // It's much more stable to mod N instedof PI\n const n = Math.round(radian / PI * 1e8) / 1e8;\n return (n % 2) * PI;\n}\n/**\n * Normalize start and end angles.\n * startAngle will be normalized to 0 ~ PI*2\n * sweepAngle(endAngle - startAngle) will be normalized to 0 ~ PI*2 if clockwise.\n * -PI*2 ~ 0 if anticlockwise.\n */\nexport function normalizeArcAngles(angles: number[], anticlockwise: boolean): void {\n let newStartAngle = modPI2(angles[0]);\n if (newStartAngle < 0) {\n // Normlize to 0 - PI2\n newStartAngle += PI2;\n }\n\n let delta = newStartAngle - angles[0];\n let newEndAngle = angles[1];\n newEndAngle += delta;\n\n // https://github.com/chromium/chromium/blob/c20d681c9c067c4e15bb1408f17114b9e8cba294/third_party/blink/renderer/modules/canvas/canvas2d/canvas_path.cc#L184\n // Is circle\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2) {\n newEndAngle = newStartAngle + PI2;\n }\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2) {\n newEndAngle = newStartAngle - PI2;\n }\n // Make startAngle < endAngle when clockwise, otherwise endAngle < startAngle.\n // The sweep angle can never been larger than P2.\n else if (!anticlockwise && newStartAngle > newEndAngle) {\n newEndAngle = newStartAngle + (PI2 - modPI2(newStartAngle - newEndAngle));\n }\n else if (anticlockwise && newStartAngle < newEndAngle) {\n newEndAngle = newStartAngle - (PI2 - modPI2(newEndAngle - newStartAngle));\n }\n\n angles[0] = newStartAngle;\n angles[1] = newEndAngle;\n}\n\n\nexport default class PathProxy {\n\n dpr = 1\n\n data: number[] | Float32Array\n\n /**\n * Version is for tracking if the path has been changed.\n */\n private _version: number\n\n /**\n * If save path data.\n */\n private _saveData: boolean\n\n /**\n * If the line segment is too small to draw. It will be added to the pending pt.\n * It will be added if the subpath needs to be finished before stroke, fill, or starting a new subpath.\n */\n private _pendingPtX: number;\n private _pendingPtY: number;\n // Distance of pending pt to previous point.\n // 0 if there is no pending point.\n // Only update the pending pt when distance is larger.\n private _pendingPtDist: number;\n\n private _ctx: ExtendedCanvasRenderingContext2D\n\n private _xi = 0\n private _yi = 0\n\n private _x0 = 0\n private _y0 = 0\n\n private _len = 0\n\n // Calculating path len and seg len.\n private _pathSegLen: number[]\n private _pathLen: number\n // Unit x, Unit y. Provide for avoiding drawing that too short line segment\n private _ux: number\n private _uy: number\n\n static CMD = CMD\n\n constructor(notSaveData?: boolean) {\n if (notSaveData) {\n this._saveData = false;\n }\n\n if (this._saveData) {\n this.data = [];\n }\n }\n\n increaseVersion() {\n this._version++;\n }\n\n /**\n * Version can be used outside for compare if the path is changed.\n * For example to determine if need to update svg d str in svg renderer.\n */\n getVersion() {\n return this._version;\n }\n\n /**\n * @readOnly\n */\n setScale(sx: number, sy: number, segmentIgnoreThreshold?: number) {\n // Compat. Previously there is no segmentIgnoreThreshold.\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\n if (segmentIgnoreThreshold > 0) {\n this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;\n this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;\n }\n }\n\n setDPR(dpr: number) {\n this.dpr = dpr;\n }\n\n setContext(ctx: ExtendedCanvasRenderingContext2D) {\n this._ctx = ctx;\n }\n\n getContext(): ExtendedCanvasRenderingContext2D {\n return this._ctx;\n }\n\n beginPath() {\n this._ctx && this._ctx.beginPath();\n this.reset();\n return this;\n }\n\n /**\n * Reset path data.\n */\n reset() {\n // Reset\n if (this._saveData) {\n this._len = 0;\n }\n\n if (this._pathSegLen) {\n this._pathSegLen = null;\n this._pathLen = 0;\n }\n\n // Update version\n this._version++;\n }\n\n moveTo(x: number, y: number) {\n // Add pending point for previous path.\n this._drawPendingPt();\n\n this.addData(CMD.M, x, y);\n this._ctx && this._ctx.moveTo(x, y);\n\n // x0, y0, xi, yi \u662F\u8BB0\u5F55\u5728 _dashedXXXXTo \u65B9\u6CD5\u4E2D\u4F7F\u7528\n // xi, yi \u8BB0\u5F55\u5F53\u524D\u70B9, x0, y0 \u5728 closePath \u7684\u65F6\u5019\u56DE\u5230\u8D77\u59CB\u70B9\u3002\n // \u6709\u53EF\u80FD\u5728 beginPath \u4E4B\u540E\u76F4\u63A5\u8C03\u7528 lineTo\uFF0C\u8FD9\u65F6\u5019 x0, y0 \u9700\u8981\n // \u5728 lineTo \u65B9\u6CD5\u4E2D\u8BB0\u5F55\uFF0C\u8FD9\u91CC\u5148\u4E0D\u8003\u8651\u8FD9\u79CD\u60C5\u51B5\uFF0Cdashed line \u4E5F\u53EA\u5728 IE10- \u4E2D\u4E0D\u652F\u6301\n this._x0 = x;\n this._y0 = y;\n\n this._xi = x;\n this._yi = y;\n\n return this;\n }\n\n lineTo(x: number, y: number) {\n const dx = mathAbs(x - this._xi);\n const dy = mathAbs(y - this._yi);\n const exceedUnit = dx > this._ux || dy > this._uy;\n\n this.addData(CMD.L, x, y);\n\n if (this._ctx && exceedUnit) {\n this._ctx.lineTo(x, y);\n }\n if (exceedUnit) {\n this._xi = x;\n this._yi = y;\n this._pendingPtDist = 0;\n }\n else {\n const d2 = dx * dx + dy * dy;\n // Only use the farthest pending point.\n if (d2 > this._pendingPtDist) {\n this._pendingPtX = x;\n this._pendingPtY = y;\n this._pendingPtDist = d2;\n }\n }\n\n return this;\n }\n\n bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number) {\n this._drawPendingPt();\n\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n if (this._ctx) {\n this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n this._xi = x3;\n this._yi = y3;\n return this;\n }\n\n quadraticCurveTo(x1: number, y1: number, x2: number, y2: number) {\n this._drawPendingPt();\n\n this.addData(CMD.Q, x1, y1, x2, y2);\n if (this._ctx) {\n this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n }\n this._xi = x2;\n this._yi = y2;\n return this;\n }\n\n arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise?: boolean) {\n this._drawPendingPt();\n\n tmpAngles[0] = startAngle;\n tmpAngles[1] = endAngle;\n normalizeArcAngles(tmpAngles, anticlockwise);\n\n startAngle = tmpAngles[0];\n endAngle = tmpAngles[1];\n\n let delta = endAngle - startAngle;\n\n this.addData(\n CMD.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1\n );\n\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n\n this._xi = mathCos(endAngle) * r + cx;\n this._yi = mathSin(endAngle) * r + cy;\n return this;\n }\n\n // TODO\n arcTo(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this._drawPendingPt();\n\n if (this._ctx) {\n this._ctx.arcTo(x1, y1, x2, y2, radius);\n }\n return this;\n }\n\n // TODO\n rect(x: number, y: number, w: number, h: number) {\n this._drawPendingPt();\n\n this._ctx && this._ctx.rect(x, y, w, h);\n this.addData(CMD.R, x, y, w, h);\n return this;\n }\n\n closePath() {\n // Add pending point for previous path.\n this._drawPendingPt();\n\n this.addData(CMD.Z);\n\n const ctx = this._ctx;\n const x0 = this._x0;\n const y0 = this._y0;\n if (ctx) {\n ctx.closePath();\n }\n\n this._xi = x0;\n this._yi = y0;\n return this;\n }\n\n fill(ctx: CanvasRenderingContext2D) {\n ctx && ctx.fill();\n this.toStatic();\n }\n\n stroke(ctx: CanvasRenderingContext2D) {\n ctx && ctx.stroke();\n this.toStatic();\n }\n\n len() {\n return this._len;\n }\n\n setData(data: Float32Array | number[]) {\n\n const len = data.length;\n\n if (!(this.data && this.data.length === len) && hasTypedArray) {\n this.data = new Float32Array(len);\n }\n\n for (let i = 0; i < len; i++) {\n this.data[i] = data[i];\n }\n\n this._len = len;\n }\n\n appendPath(path: PathProxy | PathProxy[]) {\n if (!(path instanceof Array)) {\n path = [path];\n }\n const len = path.length;\n let appendSize = 0;\n let offset = this._len;\n for (let i = 0; i < len; i++) {\n appendSize += path[i].len();\n }\n if (hasTypedArray && (this.data instanceof Float32Array || !this.data)) {\n this.data = new Float32Array(offset + appendSize);\n }\n for (let i = 0; i < len; i++) {\n const appendPathData = path[i].data;\n for (let k = 0; k < appendPathData.length; k++) {\n this.data[offset++] = appendPathData[k];\n }\n }\n this._len = offset;\n }\n\n /**\n * \u586B\u5145 Path \u6570\u636E\u3002\n * \u5C3D\u91CF\u590D\u7528\u800C\u4E0D\u7533\u660E\u65B0\u7684\u6570\u7EC4\u3002\u5927\u90E8\u5206\u56FE\u5F62\u91CD\u7ED8\u7684\u6307\u4EE4\u6570\u636E\u957F\u5EA6\u90FD\u662F\u4E0D\u53D8\u7684\u3002\n */\n addData(\n cmd: number,\n a?: number,\n b?: number,\n c?: number,\n d?: number,\n e?: number,\n f?: number,\n g?: number,\n h?: number\n ) {\n if (!this._saveData) {\n return;\n }\n\n let data = this.data;\n if (this._len + arguments.length > data.length) {\n // \u56E0\u4E3A\u4E4B\u524D\u7684\u6570\u7EC4\u5DF2\u7ECF\u8F6C\u6362\u6210\u9759\u6001\u7684 Float32Array\n // \u6240\u4EE5\u4E0D\u591F\u7528\u65F6\u9700\u8981\u6269\u5C55\u4E00\u4E2A\u65B0\u7684\u52A8\u6001\u6570\u7EC4\n this._expandData();\n data = this.data;\n }\n for (let i = 0; i < arguments.length; i++) {\n data[this._len++] = arguments[i];\n }\n }\n\n private _drawPendingPt() {\n if (this._pendingPtDist > 0) {\n this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY);\n this._pendingPtDist = 0;\n }\n }\n\n private _expandData() {\n // Only if data is Float32Array\n if (!(this.data instanceof Array)) {\n const newData = [];\n for (let i = 0; i < this._len; i++) {\n newData[i] = this.data[i];\n }\n this.data = newData;\n }\n }\n\n /**\n * Convert dynamic array to static Float32Array\n *\n * It will still use a normal array if command buffer length is less than 10\n * Because Float32Array itself may take more memory than a normal array.\n *\n * 10 length will make sure at least one M command and one A(arc) command.\n */\n toStatic() {\n if (!this._saveData) {\n return;\n }\n\n this._drawPendingPt();\n\n const data = this.data;\n if (data instanceof Array) {\n data.length = this._len;\n if (hasTypedArray && this._len > 11) {\n this.data = new Float32Array(data);\n }\n }\n }\n\n\n getBoundingRect() {\n min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;\n max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\n\n const data = this.data;\n let xi = 0;\n let yi = 0;\n let x0 = 0;\n let y0 = 0;\n\n let i;\n for (i = 0; i < this._len;) {\n const cmd = data[i++] as number;\n\n const isFirst = i === 1;\n if (isFirst) {\n // \u5982\u679C\u7B2C\u4E00\u4E2A\u547D\u4EE4\u662F L, C, Q\n // \u5219 previous point \u540C\u7ED8\u5236\u547D\u4EE4\u7684\u7B2C\u4E00\u4E2A point\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u4E3A Arc \u7684\u60C5\u51B5\u4E0B\u4F1A\u5728\u540E\u9762\u7279\u6B8A\u5904\u7406\n xi = data[i];\n yi = data[i + 1];\n\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n // moveTo \u547D\u4EE4\u91CD\u65B0\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684 subpath, \u5E76\u4E14\u66F4\u65B0\u65B0\u7684\u8D77\u70B9\n // \u5728 closePath \u7684\u65F6\u5019\u4F7F\u7528\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n min2[0] = x0;\n min2[1] = y0;\n max2[0] = x0;\n max2[1] = y0;\n break;\n case CMD.L:\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n fromCubic(\n xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1],\n min2, max2\n );\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n fromQuadratic(\n xi, yi, data[i++], data[i++], data[i], data[i + 1],\n min2, max2\n );\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n const cx = data[i++];\n const cy = data[i++];\n const rx = data[i++];\n const ry = data[i++];\n const startAngle = data[i++];\n const endAngle = data[i++] + startAngle;\n // TODO Arc \u65CB\u8F6C\n i += 1;\n const anticlockwise = !data[i++];\n\n if (isFirst) {\n // \u76F4\u63A5\u4F7F\u7528 arc \u547D\u4EE4\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u8D77\u70B9\u8FD8\u672A\u5B9A\u4E49\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n\n fromArc(\n cx, cy, rx, ry, startAngle, endAngle,\n anticlockwise, min2, max2\n );\n\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n const width = data[i++];\n const height = data[i++];\n // Use fromLine\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n break;\n case CMD.Z:\n xi = x0;\n yi = y0;\n break;\n }\n\n // Union\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n }\n\n // No data\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return new BoundingRect(\n min[0], min[1], max[0] - min[0], max[1] - min[1]\n );\n }\n\n private _calculateLength(): number {\n const data = this.data;\n const len = this._len;\n const ux = this._ux;\n const uy = this._uy;\n let xi = 0;\n let yi = 0;\n let x0 = 0;\n let y0 = 0;\n\n if (!this._pathSegLen) {\n this._pathSegLen = [];\n }\n const pathSegLen = this._pathSegLen;\n let pathTotalLen = 0;\n let segCount = 0;\n\n for (let i = 0; i < len;) {\n const cmd = data[i++] as number;\n const isFirst = i === 1;\n\n if (isFirst) {\n // \u5982\u679C\u7B2C\u4E00\u4E2A\u547D\u4EE4\u662F L, C, Q\n // \u5219 previous point \u540C\u7ED8\u5236\u547D\u4EE4\u7684\u7B2C\u4E00\u4E2A point\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u4E3A Arc \u7684\u60C5\u51B5\u4E0B\u4F1A\u5728\u540E\u9762\u7279\u6B8A\u5904\u7406\n xi = data[i];\n yi = data[i + 1];\n\n x0 = xi;\n y0 = yi;\n }\n\n let l = -1;\n\n switch (cmd) {\n case CMD.M:\n // moveTo \u547D\u4EE4\u91CD\u65B0\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684 subpath, \u5E76\u4E14\u66F4\u65B0\u65B0\u7684\u8D77\u70B9\n // \u5728 closePath \u7684\u65F6\u5019\u4F7F\u7528\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n break;\n case CMD.L: {\n const x2 = data[i++];\n const y2 = data[i++];\n const dx = x2 - xi;\n const dy = y2 - yi;\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x2;\n yi = y2;\n }\n break;\n }\n case CMD.C: {\n const x1 = data[i++];\n const y1 = data[i++];\n const x2 = data[i++];\n const y2 = data[i++];\n const x3 = data[i++];\n const y3 = data[i++];\n // TODO adaptive iteration\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n const x1 = data[i++];\n const y1 = data[i++];\n const x2 = data[i++];\n const y2 = data[i++];\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\n // TODO Arc \u5224\u65AD\u7684\u5F00\u9500\u6BD4\u8F83\u5927\n const cx = data[i++];\n const cy = data[i++];\n const rx = data[i++];\n const ry = data[i++];\n const startAngle = data[i++];\n let delta = data[i++];\n const endAngle = delta + startAngle;\n // TODO Arc \u65CB\u8F6C\n i += 1;\n if (isFirst) {\n // \u76F4\u63A5\u4F7F\u7528 arc \u547D\u4EE4\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u8D77\u70B9\u8FD8\u672A\u5B9A\u4E49\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n\n // TODO Ellipse\n l = mathMax(rx, ry) * mathMin(PI2, Math.abs(delta));\n\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R: {\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n const width = data[i++];\n const height = data[i++];\n l = width * 2 + height * 2;\n break;\n }\n case CMD.Z: {\n const dx = x0 - xi;\n const dy = y0 - yi;\n l = Math.sqrt(dx * dx + dy * dy);\n\n xi = x0;\n yi = y0;\n break;\n }\n }\n\n if (l >= 0) {\n pathSegLen[segCount++] = l;\n pathTotalLen += l;\n }\n }\n\n // TODO Optimize memory cost.\n this._pathLen = pathTotalLen;\n\n return pathTotalLen;\n }\n /**\n * Rebuild path from current data\n * Rebuild path will not consider javascript implemented line dash.\n * @param {CanvasRenderingContext2D} ctx\n */\n rebuildPath(ctx: PathRebuilder, percent: number) {\n const d = this.data;\n const ux = this._ux;\n const uy = this._uy;\n const len = this._len;\n let x0;\n let y0;\n let xi;\n let yi;\n let x;\n let y;\n\n const drawPart = percent < 1;\n let pathSegLen;\n let pathTotalLen;\n let accumLength = 0;\n let segCount = 0;\n let displayedLength;\n\n let pendingPtDist = 0;\n let pendingPtX: number;\n let pendingPtY: number;\n\n\n if (drawPart) {\n if (!this._pathSegLen) {\n this._calculateLength();\n }\n pathSegLen = this._pathSegLen;\n pathTotalLen = this._pathLen;\n displayedLength = percent * pathTotalLen;\n\n if (!displayedLength) {\n return;\n }\n }\n\n lo: for (let i = 0; i < len;) {\n const cmd = d[i++];\n const isFirst = i === 1;\n\n if (isFirst) {\n // \u5982\u679C\u7B2C\u4E00\u4E2A\u547D\u4EE4\u662F L, C, Q\n // \u5219 previous point \u540C\u7ED8\u5236\u547D\u4EE4\u7684\u7B2C\u4E00\u4E2A point\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u4E3A Arc \u7684\u60C5\u51B5\u4E0B\u4F1A\u5728\u540E\u9762\u7279\u6B8A\u5904\u7406\n xi = d[i];\n yi = d[i + 1];\n\n x0 = xi;\n y0 = yi;\n }\n // Only lineTo support ignoring small segments.\n // Otherwise if the pending point should always been flushed.\n if (cmd !== CMD.L && pendingPtDist > 0) {\n ctx.lineTo(pendingPtX, pendingPtY);\n pendingPtDist = 0;\n }\n switch (cmd) {\n case CMD.M:\n x0 = xi = d[i++];\n y0 = yi = d[i++];\n ctx.moveTo(xi, yi);\n break;\n case CMD.L: {\n x = d[i++];\n y = d[i++];\n const dx = mathAbs(x - xi);\n const dy = mathAbs(y - yi);\n // Not draw too small seg between\n if (dx > ux || dy > uy) {\n if (drawPart) {\n const l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n const t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\n break lo;\n }\n accumLength += l;\n }\n\n ctx.lineTo(x, y);\n xi = x;\n yi = y;\n pendingPtDist = 0;\n }\n else {\n const d2 = dx * dx + dy * dy;\n // Only use the farthest pending point.\n if (d2 > pendingPtDist) {\n pendingPtX = x;\n pendingPtY = y;\n pendingPtDist = d2;\n }\n }\n break;\n }\n case CMD.C: {\n const x1 = d[i++];\n const y1 = d[i++];\n const x2 = d[i++];\n const y2 = d[i++];\n const x3 = d[i++];\n const y3 = d[i++];\n if (drawPart) {\n const l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n const t = (displayedLength - accumLength) / l;\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\n break lo;\n }\n accumLength += l;\n }\n\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n const x1 = d[i++];\n const y1 = d[i++];\n const x2 = d[i++];\n const y2 = d[i++];\n\n if (drawPart) {\n const l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n const t = (displayedLength - accumLength) / l;\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\n break lo;\n }\n accumLength += l;\n }\n\n ctx.quadraticCurveTo(x1, y1, x2, y2);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\n const cx = d[i++];\n const cy = d[i++];\n const rx = d[i++];\n const ry = d[i++];\n let startAngle = d[i++];\n let delta = d[i++];\n const psi = d[i++];\n const anticlockwise = !d[i++];\n const r = (rx > ry) ? rx : ry;\n // const scaleX = (rx > ry) ? 1 : rx / ry;\n // const scaleY = (rx > ry) ? ry / rx : 1;\n const isEllipse = mathAbs(rx - ry) > 1e-3;\n let endAngle = startAngle + delta;\n let breakBuild = false;\n\n if (drawPart) {\n const l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\n breakBuild = true;\n }\n accumLength += l;\n }\n if (isEllipse && ctx.ellipse) {\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\n }\n else {\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n }\n\n if (breakBuild) {\n break lo;\n }\n\n if (isFirst) {\n // \u76F4\u63A5\u4F7F\u7528 arc \u547D\u4EE4\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u8D77\u70B9\u8FD8\u672A\u5B9A\u4E49\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = d[i];\n y0 = yi = d[i + 1];\n\n x = d[i++];\n y = d[i++];\n const width = d[i++];\n const height = d[i++];\n\n if (drawPart) {\n const l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n let d = displayedLength - accumLength;\n ctx.moveTo(x, y);\n ctx.lineTo(x + mathMin(d, width), y);\n d -= width;\n if (d > 0) {\n ctx.lineTo(x + width, y + mathMin(d, height));\n }\n d -= height;\n if (d > 0) {\n ctx.lineTo(x + mathMax(width - d, 0), y + height);\n }\n d -= width;\n if (d > 0) {\n ctx.lineTo(x, y + mathMax(height - d, 0));\n }\n break lo;\n }\n accumLength += l;\n }\n ctx.rect(x, y, width, height);\n break;\n case CMD.Z:\n if (drawPart) {\n const l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n const t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\n break lo;\n }\n accumLength += l;\n }\n\n ctx.closePath();\n xi = x0;\n yi = y0;\n }\n }\n }\n\n clone() {\n const newProxy = new PathProxy();\n const data = this.data;\n newProxy.data = data.slice ? data.slice()\n : Array.prototype.slice.call(data);\n newProxy._len = this._len;\n return newProxy;\n }\n\n private static initDefaultProps = (function () {\n const proto = PathProxy.prototype;\n proto._saveData = true;\n proto._ux = 0;\n proto._uy = 0;\n proto._pendingPtDist = 0;\n proto._version = 0;\n })()\n}\n\n\nexport interface PathRebuilder {\n moveTo(x: number, y: number): void\n lineTo(x: number, y: number): void\n bezierCurveTo(x: number, y: number, x2: number, y2: number, x3: number, y3: number): void\n quadraticCurveTo(x: number, y: number, x2: number, y2: number): void\n arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise: boolean): void\n // eslint-disable-next-line max-len\n ellipse(cx: number, cy: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise: boolean): void\n rect(x: number, y: number, width: number, height: number): void\n closePath(): void\n}", "\n/**\n * \u7EBF\u6BB5\u5305\u542B\u5224\u65AD\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nexport function containStroke(\n x0: number, y0: number, x1: number, y1: number,\n lineWidth: number, x: number, y: number\n): boolean {\n if (lineWidth === 0) {\n return false;\n }\n const _l = lineWidth;\n let _a = 0;\n let _b = x0;\n // Quick reject\n if (\n (y > y0 + _l && y > y1 + _l)\n || (y < y0 - _l && y < y1 - _l)\n || (x > x0 + _l && x > x1 + _l)\n || (x < x0 - _l && x < x1 - _l)\n ) {\n return false;\n }\n\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n }\n else {\n return Math.abs(x - x0) <= _l / 2;\n }\n const tmp = _a * x - y + _b;\n const _s = tmp * tmp / (_a * _a + 1);\n return _s <= _l / 2 * _l / 2;\n}", "\nimport * as curve from '../core/curve';\n\n/**\n * \u4E09\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\u63CF\u8FB9\u5305\u542B\u5224\u65AD\n */\nexport function containStroke(\n x0: number, y0: number, x1: number, y1: number,\n x2: number, y2: number, x3: number, y3: number,\n lineWidth: number, x: number, y: number\n): boolean {\n if (lineWidth === 0) {\n return false;\n }\n const _l = lineWidth;\n // Quick reject\n if (\n (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)\n ) {\n return false;\n }\n const d = curve.cubicProjectPoint(\n x0, y0, x1, y1, x2, y2, x3, y3,\n x, y, null\n );\n return d <= _l / 2;\n}", "import {quadraticProjectPoint} from '../core/curve';\n\n/**\n * \u4E8C\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\u63CF\u8FB9\u5305\u542B\u5224\u65AD\n */\nexport function containStroke(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number,\n lineWidth: number, x: number, y: number\n): boolean {\n if (lineWidth === 0) {\n return false;\n }\n const _l = lineWidth;\n // Quick reject\n if (\n (y > y0 + _l && y > y1 + _l && y > y2 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)\n ) {\n return false;\n }\n const d = quadraticProjectPoint(\n x0, y0, x1, y1, x2, y2,\n x, y, null\n );\n return d <= _l / 2;\n}\n", "\nconst PI2 = Math.PI * 2;\n\nexport function normalizeRadian(angle: number): number {\n angle %= PI2;\n if (angle < 0) {\n angle += PI2;\n }\n return angle;\n}", "\nimport {normalizeRadian} from './util';\n\nconst PI2 = Math.PI * 2;\n\n/**\n * \u5706\u5F27\u63CF\u8FB9\u5305\u542B\u5224\u65AD\n */\nexport function containStroke(\n cx: number, cy: number, r: number, startAngle: number, endAngle: number,\n anticlockwise: boolean,\n lineWidth: number, x: number, y: number\n): boolean {\n\n if (lineWidth === 0) {\n return false;\n }\n const _l = lineWidth;\n\n x -= cx;\n y -= cy;\n const d = Math.sqrt(x * x + y * y);\n\n if ((d - _l > r) || (d + _l < r)) {\n return false;\n }\n // TODO\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n // Is a circle\n return true;\n }\n if (anticlockwise) {\n const tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n }\n else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n\n let angle = Math.atan2(y, x);\n if (angle < 0) {\n angle += PI2;\n }\n return (angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);\n}", "\nexport default function windingLine(\n x0: number, y0: number, x1: number, y1: number, x: number, y: number\n): number {\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\n return 0;\n }\n // Ignore horizontal line\n if (y1 === y0) {\n return 0;\n }\n const t = (y - y0) / (y1 - y0);\n\n let dir = y1 < y0 ? 1 : -1;\n // Avoid winding error when intersection point is the connect point of two line of polygon\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n\n const x_ = t * (x1 - x0) + x0;\n\n // If (x, y) on the line, considered as \"contain\".\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}", "import PathProxy from '../core/PathProxy';\nimport * as line from './line';\nimport * as cubic from './cubic';\nimport * as quadratic from './quadratic';\nimport * as arc from './arc';\nimport * as curve from '../core/curve';\nimport windingLine from './windingLine';\n\nconst CMD = PathProxy.CMD;\nconst PI2 = Math.PI * 2;\n\nconst EPSILON = 1e-4;\n\nfunction isAroundEqual(a: number, b: number) {\n return Math.abs(a - b) < EPSILON;\n}\n\n// \u4E34\u65F6\u6570\u7EC4\nconst roots = [-1, -1, -1];\nconst extrema = [-1, -1];\n\nfunction swapExtrema() {\n const tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\n\nfunction windingCubic(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number,\n x: number, y: number\n): number {\n // Quick reject\n if (\n (y > y0 && y > y1 && y > y2 && y > y3)\n || (y < y0 && y < y1 && y < y2 && y < y3)\n ) {\n return 0;\n }\n const nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n let w = 0;\n let nExtrema = -1;\n let y0_;\n let y1_;\n for (let i = 0; i < nRoots; i++) {\n let t = roots[i];\n\n // Avoid winding error when intersection point is the connect point of two line of polygon\n let unit = (t === 0 || t === 1) ? 0.5 : 1;\n\n let x_ = curve.cubicAt(x0, x1, x2, x3, t);\n if (x_ < x) { // Quick reject\n continue;\n }\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n if (nExtrema === 2) {\n // \u5206\u6210\u4E09\u6BB5\u5355\u8C03\u51FD\u6570\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n }\n else {\n w += y3 < y1_ ? unit : -unit;\n }\n }\n else {\n // \u5206\u6210\u4E24\u6BB5\u5355\u8C03\u51FD\u6570\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n return w;\n }\n}\n\nfunction windingQuadratic(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number,\n x: number, y: number\n): number {\n // Quick reject\n if (\n (y > y0 && y > y1 && y > y2)\n || (y < y0 && y < y1 && y < y2)\n ) {\n return 0;\n }\n const nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n const t = curve.quadraticExtremum(y0, y1, y2);\n if (t >= 0 && t <= 1) {\n let w = 0;\n let y_ = curve.quadraticAt(y0, y1, y2, t);\n for (let i = 0; i < nRoots; i++) {\n // Remove one endpoint.\n let unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\n\n let x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n if (x_ < x) { // Quick reject\n continue;\n }\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n }\n else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n return w;\n }\n else {\n // Remove one endpoint.\n const unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\n\n const x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n if (x_ < x) { // Quick reject\n return 0;\n }\n return y2 < y0 ? unit : -unit;\n }\n }\n}\n// TODO\n// Arc \u65CB\u8F6C\n// startAngle, endAngle has been normalized by normalizeArcAngles\nfunction windingArc(\n cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise: boolean,\n x: number, y: number\n) {\n y -= cy;\n if (y > r || y < -r) {\n return 0;\n }\n const tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n\n const dTheta = Math.abs(startAngle - endAngle);\n if (dTheta < 1e-4) {\n return 0;\n }\n if (dTheta >= PI2 - 1e-4) {\n // Is a circle\n startAngle = 0;\n endAngle = PI2;\n const dir = anticlockwise ? 1 : -1;\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n }\n else {\n return 0;\n }\n }\n\n if (startAngle > endAngle) {\n // Swap, make sure startAngle is smaller than endAngle.\n const tmp = startAngle;\n startAngle = endAngle;\n endAngle = tmp;\n }\n // endAngle - startAngle is normalized to 0 - 2*PI.\n // So following will normalize them to 0 - 4*PI\n if (startAngle < 0) {\n startAngle += PI2;\n endAngle += PI2;\n }\n\n let w = 0;\n for (let i = 0; i < 2; i++) {\n const x_ = roots[i];\n if (x_ + cx > x) {\n let angle = Math.atan2(y, x_);\n let dir = anticlockwise ? 1 : -1;\n if (angle < 0) {\n angle = PI2 + angle;\n }\n if (\n (angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)\n ) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n w += dir;\n }\n }\n }\n return w;\n}\n\n\nfunction containPath(\n path: PathProxy, lineWidth: number, isStroke: boolean, x: number, y: number\n): boolean {\n const data = path.data;\n const len = path.len();\n let w = 0;\n let xi = 0;\n let yi = 0;\n let x0 = 0;\n let y0 = 0;\n let x1;\n let y1;\n\n for (let i = 0; i < len;) {\n const cmd = data[i++];\n const isFirst = i === 1;\n // Begin a new subpath\n if (cmd === CMD.M && i > 1) {\n // Close previous subpath\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n // \u5982\u679C\u88AB\u4EFB\u4F55\u4E00\u4E2A subpath \u5305\u542B\n // if (w !== 0) {\n // return true;\n // }\n }\n\n if (isFirst) {\n // \u5982\u679C\u7B2C\u4E00\u4E2A\u547D\u4EE4\u662F L, C, Q\n // \u5219 previous point \u540C\u7ED8\u5236\u547D\u4EE4\u7684\u7B2C\u4E00\u4E2A point\n //\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u4E3A Arc \u7684\u60C5\u51B5\u4E0B\u4F1A\u5728\u540E\u9762\u7279\u6B8A\u5904\u7406\n xi = data[i];\n yi = data[i + 1];\n\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n // moveTo \u547D\u4EE4\u91CD\u65B0\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684 subpath, \u5E76\u4E14\u66F4\u65B0\u65B0\u7684\u8D77\u70B9\n // \u5728 closePath \u7684\u65F6\u5019\u4F7F\u7528\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n case CMD.L:\n if (isStroke) {\n if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n }\n else {\n // NOTE \u5728\u7B2C\u4E00\u4E2A\u547D\u4EE4\u4E3A L, C, Q \u7684\u65F6\u5019\u4F1A\u8BA1\u7B97\u51FA NaN\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n if (isStroke) {\n if (cubic.containStroke(xi, yi,\n data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1],\n lineWidth, x, y\n )) {\n return true;\n }\n }\n else {\n w += windingCubic(\n xi, yi,\n data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1],\n x, y\n ) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.Q:\n if (isStroke) {\n if (quadratic.containStroke(xi, yi,\n data[i++], data[i++], data[i], data[i + 1],\n lineWidth, x, y\n )) {\n return true;\n }\n }\n else {\n w += windingQuadratic(\n xi, yi,\n data[i++], data[i++], data[i], data[i + 1],\n x, y\n ) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\n // TODO Arc \u5224\u65AD\u7684\u5F00\u9500\u6BD4\u8F83\u5927\n const cx = data[i++];\n const cy = data[i++];\n const rx = data[i++];\n const ry = data[i++];\n const theta = data[i++];\n const dTheta = data[i++];\n // TODO Arc \u65CB\u8F6C\n i += 1;\n const anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy;\n // \u4E0D\u662F\u76F4\u63A5\u4F7F\u7528 arc \u547D\u4EE4\n if (!isFirst) {\n w += windingLine(xi, yi, x1, y1, x, y);\n }\n else {\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u8D77\u70B9\u8FD8\u672A\u5B9A\u4E49\n x0 = x1;\n y0 = y1;\n }\n // zr \u4F7F\u7528scale\u6765\u6A21\u62DF\u692D\u5706, \u8FD9\u91CC\u4E5F\u5BF9x\u505A\u4E00\u5B9A\u7684\u7F29\u653E\n const _x = (x - cx) * ry / rx + cx;\n if (isStroke) {\n if (arc.containStroke(\n cx, cy, ry, theta, theta + dTheta, anticlockwise,\n lineWidth, _x, y\n )) {\n return true;\n }\n }\n else {\n w += windingArc(\n cx, cy, ry, theta, theta + dTheta, anticlockwise,\n _x, y\n );\n }\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n const width = data[i++];\n const height = data[i++];\n x1 = x0 + width;\n y1 = y0 + height;\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y)\n || line.containStroke(x1, y0, x1, y1, lineWidth, x, y)\n || line.containStroke(x1, y1, x0, y1, lineWidth, x, y)\n || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)\n ) {\n return true;\n }\n }\n else {\n // FIXME Clockwise ?\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n break;\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(\n xi, yi, x0, y0, lineWidth, x, y\n )) {\n return true;\n }\n }\n else {\n // Close a subpath\n w += windingLine(xi, yi, x0, y0, x, y);\n // \u5982\u679C\u88AB\u4EFB\u4F55\u4E00\u4E2A subpath \u5305\u542B\n // FIXME subpaths may overlap\n // if (w !== 0) {\n // return true;\n // }\n }\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n return w !== 0;\n}\n\nexport function contain(pathProxy: PathProxy, x: number, y: number): boolean {\n return containPath(pathProxy, 0, false, x, y);\n}\n\nexport function containStroke(pathProxy: PathProxy, lineWidth: number, x: number, y: number): boolean {\n return containPath(pathProxy, lineWidth, true, x, y);\n}", "import Displayable, { DisplayableProps,\n CommonStyleProps,\n DEFAULT_COMMON_STYLE,\n DisplayableStatePropNames,\n DEFAULT_COMMON_ANIMATION_PROPS\n} from './Displayable';\nimport Element, { ElementAnimateConfig } from '../Element';\nimport PathProxy from '../core/PathProxy';\nimport * as pathContain from '../contain/path';\nimport { PatternObject } from './Pattern';\nimport { Dictionary, PropType, MapToType } from '../core/types';\nimport BoundingRect from '../core/BoundingRect';\nimport { LinearGradientObject } from './LinearGradient';\nimport { RadialGradientObject } from './RadialGradient';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util';\nimport Animator from '../animation/Animator';\nimport { lum } from '../tool/color';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT, STYLE_CHANGED_BIT } from './constants';\nimport { TRANSFORMABLE_PROPS } from '../core/Transformable';\n\n\nexport interface PathStyleProps extends CommonStyleProps {\n fill?: string | PatternObject | LinearGradientObject | RadialGradientObject\n stroke?: string | PatternObject | LinearGradientObject | RadialGradientObject\n decal?: PatternObject\n\n /**\n * Still experimental, not works weel on arc with edge cases(large angle).\n */\n strokePercent?: number\n strokeNoScale?: boolean\n fillOpacity?: number\n strokeOpacity?: number\n\n /**\n * `true` is not supported.\n * `false`/`null`/`undefined` are the same.\n * `false` is used to remove lineDash in some\n * case that `null`/`undefined` can not be set.\n * (e.g., emphasis.lineStyle in echarts)\n */\n lineDash?: false | number[] | 'solid' | 'dashed' | 'dotted'\n lineDashOffset?: number\n\n lineWidth?: number\n lineCap?: CanvasLineCap\n lineJoin?: CanvasLineJoin\n\n miterLimit?: number\n /**\n * Paint order, if do stroke first. Similar to SVG paint-order\n * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/paint-order\n */\n strokeFirst?: boolean\n}\n\nexport const DEFAULT_PATH_STYLE: PathStyleProps = defaults({\n fill: '#000',\n stroke: null,\n strokePercent: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n miterLimit: 10,\n\n strokeNoScale: false,\n strokeFirst: false\n} as PathStyleProps, DEFAULT_COMMON_STYLE);\n\n\nexport const DEFAULT_PATH_ANIMATION_PROPS: MapToType = {\n style: defaults, MapToType>({\n fill: true,\n stroke: true,\n strokePercent: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineDashOffset: true,\n lineWidth: true,\n miterLimit: true\n } as MapToType, DEFAULT_COMMON_ANIMATION_PROPS.style)\n };\n\nexport interface PathProps extends DisplayableProps {\n strokeContainThreshold?: number\n segmentIgnoreThreshold?: number\n subPixelOptimize?: boolean\n\n style?: PathStyleProps\n shape?: Dictionary\n\n autoBatch?: boolean\n\n __value?: (string | number)[] | (string | number)\n\n buildPath?: (\n ctx: PathProxy | CanvasRenderingContext2D,\n shapeCfg: Dictionary,\n inBatch?: boolean\n ) => void\n}\n\n\ntype PathKey = keyof PathProps\ntype PathPropertyType = PropType\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Path {\n animate(key?: '', loop?: boolean): Animator\n animate(key: 'style', loop?: boolean): Animator\n animate(key: 'shape', loop?: boolean): Animator\n\n getState(stateName: string): PathState\n ensureState(stateName: string): PathState\n\n states: Dictionary\n stateProxy: (stateName: string) => PathState\n}\n\nexport type PathStatePropNames = DisplayableStatePropNames | 'shape';\nexport type PathState = Pick & {\n hoverLayer?: boolean\n}\n\nconst pathCopyParams = (TRANSFORMABLE_PROPS as readonly string[]).concat(['invisible',\n 'culling', 'z', 'z2', 'zlevel', 'parent'\n]) as (keyof Path)[];\n\nclass Path extends Displayable {\n\n path: PathProxy\n\n strokeContainThreshold: number\n\n // This item default to be false. But in map series in echarts,\n // in order to improve performance, it should be set to true,\n // so the shorty segment won't draw.\n segmentIgnoreThreshold: number\n\n subPixelOptimize: boolean\n\n style: PathStyleProps\n /**\n * If element can be batched automatically\n */\n autoBatch: boolean\n\n private _rectStroke: BoundingRect\n\n protected _normalState: PathState\n\n protected _decalEl: Path\n\n // Must have an initial value on shape.\n // It will be assigned by default value.\n shape: Dictionary\n\n constructor(opts?: Props) {\n super(opts);\n }\n\n update() {\n super.update();\n\n const style = this.style;\n if (style.decal) {\n const decalEl: Path = this._decalEl = this._decalEl || new Path();\n if (decalEl.buildPath === Path.prototype.buildPath) {\n decalEl.buildPath = ctx => {\n this.buildPath(ctx, this.shape);\n };\n }\n\n decalEl.silent = true;\n\n const decalElStyle = decalEl.style;\n\n for (let key in style) {\n if ((decalElStyle as any)[key] !== (style as any)[key]) {\n (decalElStyle as any)[key] = (style as any)[key];\n }\n }\n decalElStyle.fill = style.fill ? style.decal : null;\n decalElStyle.decal = null;\n decalElStyle.shadowColor = null;\n style.strokeFirst && (decalElStyle.stroke = null);\n\n for (let i = 0; i < pathCopyParams.length; ++i) {\n (decalEl as any)[pathCopyParams[i]] = this[pathCopyParams[i]];\n }\n\n decalEl.__dirty |= REDRAW_BIT;\n }\n else if (this._decalEl) {\n this._decalEl = null;\n }\n }\n\n getDecalElement() {\n return this._decalEl;\n }\n\n protected _init(props?: Props) {\n // Init default properties\n const keysArr = keys(props);\n\n this.shape = this.getDefaultShape();\n const defaultStyle = this.getDefaultStyle();\n if (defaultStyle) {\n this.useStyle(defaultStyle);\n }\n\n for (let i = 0; i < keysArr.length; i++) {\n const key = keysArr[i];\n const value = props[key];\n if (key === 'style') {\n if (!this.style) {\n // PENDING Reuse style object if possible?\n this.useStyle(value as Props['style']);\n }\n else {\n extend(this.style, value as Props['style']);\n }\n }\n else if (key === 'shape') {\n // this.shape = value;\n extend(this.shape, value as Props['shape']);\n }\n else {\n super.attrKV(key as any, value);\n }\n }\n\n // Create an empty one if no style object exists.\n if (!this.style) {\n this.useStyle({});\n }\n // const defaultShape = this.getDefaultShape();\n // if (!this.shape) {\n // this.shape = defaultShape;\n // }\n // else {\n // defaults(this.shape, defaultShape);\n // }\n }\n\n protected getDefaultStyle(): Props['style'] {\n return null;\n }\n\n // Needs to override\n protected getDefaultShape() {\n return {};\n }\n\n protected canBeInsideText() {\n return this.hasFill();\n }\n\n protected getInsideTextFill() {\n const pathFill = this.style.fill;\n if (pathFill !== 'none') {\n if (isString(pathFill)) {\n const fillLum = lum(pathFill, 0);\n // Determin text color based on the lum of path fill.\n // TODO use (1 - DARK_MODE_THRESHOLD)?\n if (fillLum > 0.5) { // TODO Consider background lum?\n return DARK_LABEL_COLOR;\n }\n else if (fillLum > 0.2) {\n return LIGHTER_LABEL_COLOR;\n }\n return LIGHT_LABEL_COLOR;\n }\n else if (pathFill) {\n return LIGHT_LABEL_COLOR;\n }\n\n }\n return DARK_LABEL_COLOR;\n }\n\n protected getInsideTextStroke(textFill?: string) {\n const pathFill = this.style.fill;\n // Not stroke on none fill object or gradient object\n if (isString(pathFill)) {\n const zr = this.__zr;\n const isDarkMode = !!(zr && zr.isDarkMode());\n const isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\n // All dark or all light.\n if (isDarkMode === isDarkLabel) {\n return pathFill;\n }\n }\n }\n\n // When bundling path, some shape may decide if use moveTo to begin a new subpath or closePath\n // Like in circle\n buildPath(\n ctx: PathProxy | CanvasRenderingContext2D,\n shapeCfg: Dictionary,\n inBatch?: boolean\n ) {}\n\n pathUpdated() {\n this.__dirty &= ~SHAPE_CHANGED_BIT;\n }\n\n getUpdatedPathProxy(inBatch?: boolean) {\n // Update path proxy data to latest.\n !this.path && this.createPathProxy();\n this.path.beginPath();\n this.buildPath(this.path, this.shape, inBatch);\n return this.path;\n }\n\n createPathProxy() {\n this.path = new PathProxy(false);\n }\n\n hasStroke() {\n const style = this.style;\n const stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n }\n\n hasFill() {\n const style = this.style;\n const fill = style.fill;\n return fill != null && fill !== 'none';\n }\n\n getBoundingRect(): BoundingRect {\n let rect = this._rect;\n const style = this.style;\n const needsUpdateRect = !rect;\n if (needsUpdateRect) {\n let firstInvoke = false;\n if (!this.path) {\n firstInvoke = true;\n // Create path on demand.\n this.createPathProxy();\n }\n let path = this.path;\n if (firstInvoke || (this.__dirty & SHAPE_CHANGED_BIT)) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n this.pathUpdated();\n }\n rect = path.getBoundingRect();\n }\n this._rect = rect;\n\n if (this.hasStroke() && this.path && this.path.len() > 0) {\n // Needs update rect with stroke lineWidth when\n // 1. Element changes scale or lineWidth\n // 2. Shape is changed\n const rectStroke = this._rectStroke || (this._rectStroke = rect.clone());\n if (this.__dirty || needsUpdateRect) {\n rectStroke.copy(rect);\n // PENDING, Min line width is needed when line is horizontal or vertical\n const lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n // FIXME Must after updateTransform\n let w = style.lineWidth;\n\n // Only add extra hover lineWidth when there are no fill\n if (!this.hasFill()) {\n const strokeContainThreshold = this.strokeContainThreshold;\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\n }\n // Consider line width\n // Line scale can't be 0;\n if (lineScale > 1e-10) {\n rectStroke.width += w / lineScale;\n rectStroke.height += w / lineScale;\n rectStroke.x -= w / lineScale / 2;\n rectStroke.y -= w / lineScale / 2;\n }\n }\n\n // Return rect with stroke\n return rectStroke;\n }\n\n return rect;\n }\n\n contain(x: number, y: number): boolean {\n const localPos = this.transformCoordToLocal(x, y);\n const rect = this.getBoundingRect();\n const style = this.style;\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n const pathProxy = this.path;\n if (this.hasStroke()) {\n let lineWidth = style.lineWidth;\n let lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n // Line scale can't be 0;\n if (lineScale > 1e-10) {\n // Only add extra hover lineWidth when there are no fill\n if (!this.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n if (pathContain.containStroke(\n pathProxy, lineWidth / lineScale, x, y\n )) {\n return true;\n }\n }\n }\n if (this.hasFill()) {\n return pathContain.contain(pathProxy, x, y);\n }\n }\n return false;\n }\n\n /**\n * Shape changed\n */\n dirtyShape() {\n this.__dirty |= SHAPE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n if (this._decalEl) {\n this._decalEl.dirtyShape();\n }\n this.markRedraw();\n }\n\n dirty() {\n this.dirtyStyle();\n this.dirtyShape();\n }\n\n /**\n * Alias for animate('shape')\n * @param {boolean} loop\n */\n animateShape(loop: boolean) {\n return this.animate('shape', loop);\n }\n\n // Override updateDuringAnimation\n updateDuringAnimation(targetKey: string) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else if (targetKey === 'shape') {\n this.dirtyShape();\n }\n else {\n this.markRedraw();\n }\n }\n\n // Overwrite attrKV\n attrKV(key: PathKey, value: PathPropertyType) {\n // FIXME\n if (key === 'shape') {\n this.setShape(value as Props['shape']);\n }\n else {\n super.attrKV(key as keyof DisplayableProps, value);\n }\n }\n\n setShape(obj: Props['shape']): this\n setShape(obj: T, value: Props['shape'][T]): this\n setShape(keyOrObj: keyof Props['shape'] | Props['shape'], value?: unknown): this {\n let shape = this.shape;\n if (!shape) {\n shape = this.shape = {};\n }\n // Path from string may not have shape\n if (typeof keyOrObj === 'string') {\n shape[keyOrObj] = value;\n }\n else {\n extend(shape, keyOrObj as Props['shape']);\n }\n this.dirtyShape();\n\n return this;\n }\n\n /**\n * If shape changed. used with dirtyShape\n */\n shapeChanged() {\n return !!(this.__dirty & SHAPE_CHANGED_BIT);\n }\n\n /**\n * Create a path style object with default values in it's prototype.\n * @override\n */\n createStyle(obj?: Props['style']) {\n return createObject(DEFAULT_PATH_STYLE, obj);\n }\n\n protected _innerSaveToNormal(toState: PathState) {\n super._innerSaveToNormal(toState);\n\n const normalState = this._normalState;\n // Clone a new one. DON'T share object reference between states and current using.\n // TODO: Clone array in shape?.\n // TODO: Only save changed shape.\n if (toState.shape && !normalState.shape) {\n normalState.shape = extend({}, this.shape);\n }\n }\n\n protected _applyStateObj(\n stateName: string,\n state: PathState,\n normalState: PathState,\n keepCurrentStates: boolean,\n transition: boolean,\n animationCfg: ElementAnimateConfig\n ) {\n super._applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n const needsRestoreToNormal = !(state && keepCurrentStates);\n let targetShape: Props['shape'];\n if (state && state.shape) {\n // Only animate changed properties.\n if (transition) {\n if (keepCurrentStates) {\n targetShape = state.shape;\n }\n else {\n // Inherits from normal state.\n targetShape = extend({}, normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else {\n // Because the shape will be replaced. So inherits from current shape.\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else if (needsRestoreToNormal) {\n targetShape = normalState.shape;\n }\n\n if (targetShape) {\n if (transition) {\n // Clone a new shape.\n this.shape = extend({}, this.shape);\n // Only supports transition on primary props. Because shape is not deep cloned.\n const targetShapePrimaryProps: Props['shape'] = {};\n const shapeKeys = keys(targetShape);\n for (let i = 0; i < shapeKeys.length; i++) {\n const key = shapeKeys[i];\n if (typeof targetShape[key] === 'object') {\n (this.shape as Props['shape'])[key] = targetShape[key];\n }\n else {\n targetShapePrimaryProps[key] = targetShape[key];\n }\n }\n this._transitionState(stateName, {\n shape: targetShapePrimaryProps\n } as Props, animationCfg);\n }\n else {\n this.shape = targetShape;\n this.dirtyShape();\n }\n }\n }\n\n protected _mergeStates(states: PathState[]) {\n const mergedState = super._mergeStates(states) as PathState;\n let mergedShape: Props['shape'];\n for (let i = 0; i < states.length; i++) {\n const state = states[i];\n if (state.shape) {\n mergedShape = mergedShape || {};\n this._mergeStyle(mergedShape, state.shape);\n }\n }\n if (mergedShape) {\n mergedState.shape = mergedShape;\n }\n return mergedState;\n }\n\n getAnimationStyleProps() {\n return DEFAULT_PATH_ANIMATION_PROPS;\n }\n /**\n * If path shape is zero area\n */\n isZeroArea(): boolean {\n return false;\n }\n /**\n * \u6269\u5C55\u4E00\u4E2A Path element, \u6BD4\u5982\u661F\u5F62\uFF0C\u5706\u7B49\u3002\n * Extend a path element\n * @DEPRECATED Use class extends\n * @param props\n * @param props.type Path type\n * @param props.init Initialize\n * @param props.buildPath Overwrite buildPath method\n * @param props.style Extended default style config\n * @param props.shape Extended default shape config\n */\n static extend>(defaultProps: {\n type?: string\n shape?: Shape\n style?: PathStyleProps\n beforeBrush?: Displayable['beforeBrush']\n afterBrush?: Displayable['afterBrush']\n getBoundingRect?: Displayable['getBoundingRect']\n\n calculateTextPosition?: Element['calculateTextPosition']\n buildPath(this: Path, ctx: CanvasRenderingContext2D | PathProxy, shape: Shape, inBatch?: boolean): void\n init?(this: Path, opts: PathProps): void // TODO Should be SubPathOption\n }): {\n new(opts?: PathProps & {shape: Shape}): Path\n } {\n interface SubPathOption extends PathProps {\n shape: Shape\n }\n\n class Sub extends Path {\n\n shape: Shape\n\n getDefaultStyle() {\n return clone(defaultProps.style);\n }\n\n getDefaultShape() {\n return clone(defaultProps.shape);\n }\n\n constructor(opts?: SubPathOption) {\n super(opts);\n defaultProps.init && defaultProps.init.call(this as any, opts);\n }\n }\n\n // TODO Legacy usage. Extend functions\n for (let key in defaultProps) {\n if (typeof (defaultProps as any)[key] === 'function') {\n (Sub.prototype as any)[key] = (defaultProps as any)[key];\n }\n }\n // Sub.prototype.buildPath = defaultProps.buildPath;\n // Sub.prototype.beforeBrush = defaultProps.beforeBrush;\n // Sub.prototype.afterBrush = defaultProps.afterBrush;\n\n return Sub as any;\n }\n\n protected static initDefaultProps = (function () {\n const pathProto = Path.prototype;\n pathProto.type = 'path';\n pathProto.strokeContainThreshold = 5;\n pathProto.segmentIgnoreThreshold = 0;\n pathProto.subPixelOptimize = false;\n pathProto.autoBatch = false;\n pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT;\n })()\n}\n\nexport default Path;", "import Displayable, { DisplayableProps, DisplayableStatePropNames } from './Displayable';\nimport { getBoundingRect } from '../contain/text';\nimport BoundingRect from '../core/BoundingRect';\nimport { PathStyleProps, DEFAULT_PATH_STYLE } from './Path';\nimport { createObject, defaults } from '../core/util';\nimport { FontStyle, FontWeight, TextAlign, TextVerticalAlign } from '../core/types';\nimport { DEFAULT_FONT } from '../core/platform';\n\nexport interface TSpanStyleProps extends PathStyleProps {\n\n x?: number\n y?: number\n\n // TODO Text is assigned inside zrender\n text?: string\n\n // Final generated font string\n // Used in canvas, and when developers specified it.\n font?: string\n\n // Value for each part of font\n // Used in svg.\n // NOTE: font should always been sync with these 4 properties.\n fontSize?: number\n fontWeight?: FontWeight\n fontStyle?: FontStyle\n fontFamily?: string\n\n textAlign?: CanvasTextAlign\n\n textBaseline?: CanvasTextBaseline\n}\n\nexport const DEFAULT_TSPAN_STYLE: TSpanStyleProps = defaults({\n strokeFirst: true,\n font: DEFAULT_FONT,\n x: 0,\n y: 0,\n textAlign: 'left',\n textBaseline: 'top',\n miterLimit: 2\n} as TSpanStyleProps, DEFAULT_PATH_STYLE);\n\n\nexport interface TSpanProps extends DisplayableProps {\n style?: TSpanStyleProps\n}\n\nexport type TSpanState = Pick\n\nclass TSpan extends Displayable {\n\n style: TSpanStyleProps\n\n hasStroke() {\n const style = this.style;\n const stroke = style.stroke;\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\n }\n\n hasFill() {\n const style = this.style;\n const fill = style.fill;\n return fill != null && fill !== 'none';\n }\n\n /**\n * Create an image style object with default values in it's prototype.\n * @override\n */\n createStyle(obj?: TSpanStyleProps) {\n return createObject(DEFAULT_TSPAN_STYLE, obj);\n }\n\n /**\n * Set bounding rect calculated from Text\n * For reducing time of calculating bounding rect.\n */\n setBoundingRect(rect: BoundingRect) {\n this._rect = rect;\n }\n\n getBoundingRect(): BoundingRect {\n const style = this.style;\n\n if (!this._rect) {\n let text = style.text;\n text != null ? (text += '') : (text = '');\n\n const rect = getBoundingRect(\n text,\n style.font,\n style.textAlign as TextAlign,\n style.textBaseline as TextVerticalAlign\n );\n\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n\n if (this.hasStroke()) {\n const w = style.lineWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n }\n\n protected static initDefaultProps = (function () {\n const tspanProto = TSpan.prototype;\n // TODO Calculate tolerance smarter\n tspanProto.dirtyRectTolerance = 10;\n })()\n}\n\nTSpan.prototype.type = 'tspan';\n\nexport default TSpan;", "import Displayable, { DisplayableProps,\n CommonStyleProps,\n DEFAULT_COMMON_STYLE,\n DisplayableStatePropNames,\n DEFAULT_COMMON_ANIMATION_PROPS\n} from './Displayable';\nimport BoundingRect from '../core/BoundingRect';\nimport { ImageLike, MapToType } from '../core/types';\nimport { defaults, createObject } from '../core/util';\nimport { ElementCommonState } from '../Element';\n\nexport interface ImageStyleProps extends CommonStyleProps {\n image?: string | ImageLike\n x?: number\n y?: number\n width?: number\n height?: number\n sx?: number\n sy?: number\n sWidth?: number\n sHeight?: number\n}\n\nexport const DEFAULT_IMAGE_STYLE: CommonStyleProps = defaults({\n x: 0,\n y: 0\n}, DEFAULT_COMMON_STYLE);\n\nexport const DEFAULT_IMAGE_ANIMATION_PROPS: MapToType = {\n style: defaults, MapToType>({\n x: true,\n y: true,\n width: true,\n height: true,\n sx: true,\n sy: true,\n sWidth: true,\n sHeight: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n };\n\nexport interface ImageProps extends DisplayableProps {\n style?: ImageStyleProps\n\n onload?: (image: ImageLike) => void\n}\n\nexport type ImageState = Pick & ElementCommonState\n\nfunction isImageLike(source: unknown): source is HTMLImageElement {\n return !!(source\n && typeof source !== 'string'\n // Image source is an image, canvas, video.\n && (source as HTMLImageElement).width && (source as HTMLImageElement).height);\n}\n\nclass ZRImage extends Displayable {\n\n style: ImageStyleProps\n\n // FOR CANVAS RENDERER\n __image: ImageLike\n // FOR SVG RENDERER\n __imageSrc: string\n\n onload: (image: ImageLike) => void\n\n /**\n * Create an image style object with default values in it's prototype.\n * @override\n */\n createStyle(obj?: ImageStyleProps) {\n return createObject(DEFAULT_IMAGE_STYLE, obj);\n }\n\n private _getSize(dim: 'width' | 'height') {\n const style = this.style;\n\n let size = style[dim];\n if (size != null) {\n return size;\n }\n\n const imageSource = isImageLike(style.image)\n ? style.image : this.__image;\n\n if (!imageSource) {\n return 0;\n }\n\n const otherDim = dim === 'width' ? 'height' : 'width';\n let otherDimSize = style[otherDim];\n if (otherDimSize == null) {\n return imageSource[dim];\n }\n else {\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\n }\n }\n\n getWidth(): number {\n return this._getSize('width');\n }\n\n getHeight(): number {\n return this._getSize('height');\n }\n\n getAnimationStyleProps() {\n return DEFAULT_IMAGE_ANIMATION_PROPS;\n }\n\n getBoundingRect(): BoundingRect {\n const style = this.style;\n if (!this._rect) {\n this._rect = new BoundingRect(\n style.x || 0, style.y || 0, this.getWidth(), this.getHeight()\n );\n }\n return this._rect;\n }\n}\n\nZRImage.prototype.type = 'image';\n\nexport default ZRImage;", "import PathProxy from '../../core/PathProxy';\n\nexport function buildPath(ctx: CanvasRenderingContext2D | PathProxy, shape: {\n x: number\n y: number\n width: number\n height: number\n r?: number | number[]\n}) {\n let x = shape.x;\n let y = shape.y;\n let width = shape.width;\n let height = shape.height;\n let r = shape.r;\n let r1;\n let r2;\n let r3;\n let r4;\n\n // Convert width and height to positive for better borderRadius\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n }\n else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n }\n else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n }\n else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n }\n else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = 0;\n }\n\n let total;\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n", "import { PathStyleProps } from '../Path';\n\n/**\n * Sub-pixel optimize for canvas rendering, prevent from blur\n * when rendering a thin vertical/horizontal line.\n */\n\nconst round = Math.round;\n\ntype LineShape = {\n x1: number\n y1: number\n x2: number\n y2: number\n}\n\ntype RectShape = {\n x: number\n y: number\n width: number\n height: number\n r?: number | number[]\n}\n/**\n * Sub pixel optimize line for canvas\n *\n * @param outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x1`, `x2`, `y1`, `y2` will be assigned in this method.\n */\nexport function subPixelOptimizeLine(\n outputShape: Partial,\n inputShape: LineShape,\n style: Pick // DO not optimize when lineWidth is 0\n): LineShape {\n if (!inputShape) {\n return;\n }\n\n const x1 = inputShape.x1;\n const x2 = inputShape.x2;\n const y1 = inputShape.y1;\n const y2 = inputShape.y2;\n\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n\n const lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape as LineShape;\n }\n\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n }\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n }\n\n return outputShape as LineShape;\n}\n\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x`, `y`, `width`, `height` will be assigned in this method.\n */\nexport function subPixelOptimizeRect(\n outputShape: Partial,\n inputShape: RectShape,\n style: Pick // DO not optimize when lineWidth is 0\n): RectShape {\n if (!inputShape) {\n return;\n }\n\n const originX = inputShape.x;\n const originY = inputShape.y;\n const originWidth = inputShape.width;\n const originHeight = inputShape.height;\n\n outputShape.x = originX;\n outputShape.y = originY;\n outputShape.width = originWidth;\n outputShape.height = originHeight;\n\n const lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape as RectShape;\n }\n\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(\n subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x,\n originWidth === 0 ? 0 : 1\n );\n outputShape.height = Math.max(\n subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y,\n originHeight === 0 ? 0 : 1\n );\n\n return outputShape as RectShape;\n}\n\n/**\n * Sub pixel optimize for canvas\n *\n * @param position Coordinate, such as x, y\n * @param lineWidth If `null`/`undefined`/`0`, do not optimize.\n * @param positiveOrNegative Default false (negative).\n * @return Optimized position.\n */\nexport function subPixelOptimize(\n position: number,\n lineWidth?: number,\n positiveOrNegative?: boolean\n) {\n if (!lineWidth) {\n return position;\n }\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n const doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0\n ? doubledPosition / 2\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n", "/**\n * \u77E9\u5F62\n * @module zrender/graphic/shape/Rect\n */\n\nimport Path, { PathProps } from '../Path';\nimport * as roundRectHelper from '../helper/roundRect';\nimport {subPixelOptimizeRect} from '../helper/subPixelOptimize';\n\nexport class RectShape {\n // \u5DE6\u4E0A\u3001\u53F3\u4E0A\u3001\u53F3\u4E0B\u3001\u5DE6\u4E0B\u89D2\u7684\u534A\u5F84\u4F9D\u6B21\u4E3Ar1\u3001r2\u3001r3\u3001r4\n // r\u7F29\u5199\u4E3A1 \u76F8\u5F53\u4E8E [1, 1, 1, 1]\n // r\u7F29\u5199\u4E3A[1] \u76F8\u5F53\u4E8E [1, 1, 1, 1]\n // r\u7F29\u5199\u4E3A[1, 2] \u76F8\u5F53\u4E8E [1, 2, 1, 2]\n // r\u7F29\u5199\u4E3A[1, 2, 3] \u76F8\u5F53\u4E8E [1, 2, 3, 2]\n r?: number | number[]\n\n x = 0\n y = 0\n width = 0\n height = 0\n}\n\nexport interface RectProps extends PathProps {\n shape?: Partial\n}\n// Avoid create repeatly.\nconst subPixelOptimizeOutputShape = {};\n\nclass Rect extends Path {\n\n shape: RectShape\n\n constructor(opts?: RectProps) {\n super(opts);\n }\n\n getDefaultShape() {\n return new RectShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: RectShape) {\n let x: number;\n let y: number;\n let width: number;\n let height: number;\n\n if (this.subPixelOptimize) {\n const optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = optimizedShape.x;\n y = optimizedShape.y;\n width = optimizedShape.width;\n height = optimizedShape.height;\n optimizedShape.r = shape.r;\n shape = optimizedShape;\n }\n else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n }\n else {\n roundRectHelper.buildPath(ctx, shape);\n }\n }\n\n isZeroArea() {\n return !this.shape.width || !this.shape.height;\n }\n}\n\nRect.prototype.type = 'rect';\n\nexport default Rect;", "/**\n * RichText is a container that manages complex text label.\n * It will parse text string and create sub displayble elements respectively.\n */\nimport { TextAlign, TextVerticalAlign, ImageLike, Dictionary, MapToType, FontWeight, FontStyle } from '../core/types';\nimport { parseRichText, parsePlainText } from './helper/parseText';\nimport TSpan, { TSpanStyleProps } from './TSpan';\nimport { retrieve2, each, normalizeCssArray, trim, retrieve3, extend, keys, defaults } from '../core/util';\nimport { adjustTextX, adjustTextY } from '../contain/text';\nimport ZRImage from './Image';\nimport Rect from './shape/Rect';\nimport BoundingRect from '../core/BoundingRect';\nimport { MatrixArray } from '../core/matrix';\nimport Displayable, {\n DisplayableStatePropNames,\n DisplayableProps,\n DEFAULT_COMMON_ANIMATION_PROPS\n} from './Displayable';\nimport { ZRenderType } from '../zrender';\nimport Animator from '../animation/Animator';\nimport Transformable from '../core/Transformable';\nimport { ElementCommonState } from '../Element';\nimport { GroupLike } from './Group';\nimport { DEFAULT_FONT, DEFAULT_FONT_SIZE } from '../core/platform';\n\ntype TextContentBlock = ReturnType\ntype TextLine = TextContentBlock['lines'][0]\ntype TextToken = TextLine['tokens'][0]\n\n// TODO Default value?\nexport interface TextStylePropsPart {\n // TODO Text is assigned inside zrender\n text?: string\n\n fill?: string\n stroke?: string\n strokeNoScale?: boolean\n\n opacity?: number\n fillOpacity?: number\n strokeOpacity?: number\n /**\n * textStroke may be set as some color as a default\n * value in upper applicaion, where the default value\n * of lineWidth should be 0 to make sure that\n * user can choose to do not use text stroke.\n */\n lineWidth?: number\n lineDash?: false | number[]\n lineDashOffset?: number\n borderDash?: false | number[]\n borderDashOffset?: number\n\n /**\n * If `fontSize` or `fontFamily` exists, `font` will be reset by\n * `fontSize`, `fontStyle`, `fontWeight`, `fontFamily`.\n * So do not visit it directly in upper application (like echarts),\n * but use `contain/text#makeFont` instead.\n */\n font?: string\n /**\n * The same as font. Use font please.\n * @deprecated\n */\n textFont?: string\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n */\n fontStyle?: FontStyle\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n */\n fontWeight?: FontWeight\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n */\n fontFamily?: string\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * Should be 12 but not '12px'.\n */\n fontSize?: number | string\n\n align?: TextAlign\n verticalAlign?: TextVerticalAlign\n\n /**\n * Line height. Default to be text height of '\u56FD'\n */\n lineHeight?: number\n /**\n * Width of text block. Not include padding\n * Used for background, truncate, wrap\n */\n width?: number | string\n /**\n * Height of text block. Not include padding\n * Used for background, truncate\n */\n height?: number\n /**\n * Reserved for special functinality, like 'hr'.\n */\n tag?: string\n\n textShadowColor?: string\n textShadowBlur?: number\n textShadowOffsetX?: number\n textShadowOffsetY?: number\n\n // Shadow, background, border of text box.\n backgroundColor?: string | {\n image: ImageLike | string\n }\n\n /**\n * Can be `2` or `[2, 4]` or `[2, 3, 4, 5]`\n */\n padding?: number | number[]\n /**\n * Margin of label. Used when layouting the label.\n */\n margin?: number\n\n borderColor?: string\n borderWidth?: number\n borderRadius?: number | number[]\n\n /**\n * Shadow color for background box.\n */\n shadowColor?: string\n /**\n * Shadow blur for background box.\n */\n shadowBlur?: number\n /**\n * Shadow offset x for background box.\n */\n shadowOffsetX?: number\n /**\n * Shadow offset y for background box.\n */\n shadowOffsetY?: number\n}\nexport interface TextStyleProps extends TextStylePropsPart {\n\n text?: string\n\n x?: number\n y?: number\n\n /**\n * Only support number in the top block.\n */\n width?: number\n /**\n * Text styles for rich text.\n */\n rich?: Dictionary\n\n /**\n * Strategy when calculated text width exceeds textWidth.\n * break: break by word\n * break: will break inside the word\n * truncate: truncate the text and show ellipsis\n * Do nothing if not set\n */\n overflow?: 'break' | 'breakAll' | 'truncate' | 'none'\n\n /**\n * Strategy when text lines exceeds textHeight.\n * Do nothing if not set\n */\n lineOverflow?: 'truncate'\n\n /**\n * Epllipsis used if text is truncated\n */\n ellipsis?: string\n /**\n * Placeholder used if text is truncated to empty\n */\n placeholder?: string\n /**\n * Min characters for truncating\n */\n truncateMinChar?: number\n}\n\nexport interface TextProps extends DisplayableProps {\n style?: TextStyleProps\n\n zlevel?: number\n z?: number\n z2?: number\n\n culling?: boolean\n cursor?: string\n}\n\nexport type TextState = Pick & ElementCommonState\n\nexport type DefaultTextStyle = Pick & {\n autoStroke?: boolean\n};\n\nconst DEFAULT_RICH_TEXT_COLOR = {\n fill: '#000'\n};\nconst DEFAULT_STROKE_LINE_WIDTH = 2;\n\n// const DEFAULT_TEXT_STYLE: TextStyleProps = {\n// x: 0,\n// y: 0,\n// fill: '#000',\n// stroke: null,\n// opacity: 0,\n// fillOpacity:\n// }\n\nexport const DEFAULT_TEXT_ANIMATION_PROPS: MapToType = {\n style: defaults, MapToType>({\n fill: true,\n stroke: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineWidth: true,\n fontSize: true,\n lineHeight: true,\n width: true,\n height: true,\n textShadowColor: true,\n textShadowBlur: true,\n textShadowOffsetX: true,\n textShadowOffsetY: true,\n backgroundColor: true,\n padding: true, // TODO needs normalize padding before animate\n borderColor: true,\n borderWidth: true,\n borderRadius: true // TODO needs normalize radius before animate\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n };\n\n\ninterface ZRText {\n animate(key?: '', loop?: boolean): Animator\n animate(key: 'style', loop?: boolean): Animator\n\n getState(stateName: string): TextState\n ensureState(stateName: string): TextState\n\n states: Dictionary\n stateProxy: (stateName: string) => TextState\n}\n\nclass ZRText extends Displayable implements GroupLike {\n\n type = 'text'\n\n style: TextStyleProps\n\n /**\n * How to handling label overlap\n *\n * hidden:\n */\n overlap: 'hidden' | 'show' | 'blur'\n\n /**\n * Will use this to calculate transform matrix\n * instead of Element itseelf if it's give.\n * Not exposed to developers\n */\n innerTransformable: Transformable\n\n private _children: (ZRImage | Rect | TSpan)[] = []\n\n private _childCursor: 0\n\n private _defaultStyle: DefaultTextStyle = DEFAULT_RICH_TEXT_COLOR\n\n constructor(opts?: TextProps) {\n super();\n this.attr(opts);\n }\n\n childrenRef() {\n return this._children;\n }\n\n update() {\n\n super.update();\n\n // Update children\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n\n for (let i = 0; i < this._children.length; i++) {\n const child = this._children[i];\n // Set common properties.\n child.zlevel = this.zlevel;\n child.z = this.z;\n child.z2 = this.z2;\n child.culling = this.culling;\n child.cursor = this.cursor;\n child.invisible = this.invisible;\n }\n }\n\n updateTransform() {\n const innerTransformable = this.innerTransformable;\n if (innerTransformable) {\n innerTransformable.updateTransform();\n if (innerTransformable.transform) {\n this.transform = innerTransformable.transform;\n }\n }\n else {\n super.updateTransform();\n }\n }\n\n getLocalTransform(m?: MatrixArray): MatrixArray {\n const innerTransformable = this.innerTransformable;\n return innerTransformable\n ? innerTransformable.getLocalTransform(m)\n : super.getLocalTransform(m);\n }\n\n // TODO override setLocalTransform?\n getComputedTransform() {\n if (this.__hostTarget) {\n // Update host target transform\n this.__hostTarget.getComputedTransform();\n // Update text position.\n this.__hostTarget.updateInnerText(true);\n }\n\n return super.getComputedTransform();\n }\n\n private _updateSubTexts() {\n // Reset child visit cursor\n this._childCursor = 0;\n\n normalizeTextStyle(this.style);\n this.style.rich\n ? this._updateRichTexts()\n : this._updatePlainTexts();\n\n this._children.length = this._childCursor;\n\n this.styleUpdated();\n }\n\n addSelfToZr(zr: ZRenderType) {\n super.addSelfToZr(zr);\n for (let i = 0; i < this._children.length; i++) {\n // Also need mount __zr for case like hover detection.\n // The case: hover on a label (position: 'top') causes host el\n // scaled and label Y position lifts a bit so that out of the\n // pointer, then mouse move should be able to trigger \"mouseout\".\n this._children[i].__zr = zr;\n }\n }\n\n removeSelfFromZr(zr: ZRenderType) {\n super.removeSelfFromZr(zr);\n for (let i = 0; i < this._children.length; i++) {\n this._children[i].__zr = null;\n }\n }\n\n getBoundingRect(): BoundingRect {\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n if (!this._rect) {\n // TODO: Optimize when using width and overflow: wrap/truncate\n const tmpRect = new BoundingRect(0, 0, 0, 0);\n const children = this._children;\n const tmpMat: MatrixArray = [];\n let rect = null;\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const childRect = child.getBoundingRect();\n const transform = child.getLocalTransform(tmpMat);\n\n if (transform) {\n tmpRect.copy(childRect);\n tmpRect.applyTransform(transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n this._rect = rect || tmpRect;\n }\n return this._rect;\n }\n\n // Can be set in Element. To calculate text fill automatically when textContent is inside element\n setDefaultTextStyle(defaultTextStyle: DefaultTextStyle) {\n // Use builtin if defaultTextStyle is not given.\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\n }\n\n setTextContent(textContent: never) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Can\\'t attach text on another text');\n }\n }\n\n // getDefaultStyleValue(key: T): TextStyleProps[T] {\n // // Default value is on the prototype.\n // return this.style.prototype[key];\n // }\n\n protected _mergeStyle(targetStyle: TextStyleProps, sourceStyle: TextStyleProps) {\n if (!sourceStyle) {\n return targetStyle;\n }\n\n // DO deep merge on rich configurations.\n const sourceRich = sourceStyle.rich;\n const targetRich = targetStyle.rich || (sourceRich && {}); // Create a new one if source have rich but target don't\n\n extend(targetStyle, sourceStyle);\n\n if (sourceRich && targetRich) {\n // merge rich and assign rich again.\n this._mergeRich(targetRich, sourceRich);\n targetStyle.rich = targetRich;\n }\n else if (targetRich) {\n // If source rich not exists. DON'T override the target rich\n targetStyle.rich = targetRich;\n }\n\n return targetStyle;\n }\n\n private _mergeRich(targetRich: TextStyleProps['rich'], sourceRich: TextStyleProps['rich']) {\n const richNames = keys(sourceRich);\n // Merge by rich names.\n for (let i = 0; i < richNames.length; i++) {\n const richName = richNames[i];\n targetRich[richName] = targetRich[richName] || {};\n extend(targetRich[richName], sourceRich[richName]);\n }\n }\n\n getAnimationStyleProps() {\n return DEFAULT_TEXT_ANIMATION_PROPS;\n }\n\n\n private _getOrCreateChild(Ctor: {new(): TSpan}): TSpan\n private _getOrCreateChild(Ctor: {new(): ZRImage}): ZRImage\n private _getOrCreateChild(Ctor: {new(): Rect}): Rect\n private _getOrCreateChild(Ctor: {new(): TSpan | Rect | ZRImage}): TSpan | Rect | ZRImage {\n let child = this._children[this._childCursor];\n if (!child || !(child instanceof Ctor)) {\n child = new Ctor();\n }\n this._children[this._childCursor++] = child;\n child.__zr = this.__zr;\n // TODO to users parent can only be group.\n child.parent = this as any;\n return child;\n }\n\n private _updatePlainTexts() {\n const style = this.style;\n const textFont = style.font || DEFAULT_FONT;\n const textPadding = style.padding as number[];\n\n const text = getStyleText(style);\n const contentBlock = parsePlainText(text, style);\n const needDrawBg = needDrawBackground(style);\n const bgColorDrawn = !!(style.backgroundColor);\n\n const outerHeight = contentBlock.outerHeight;\n const outerWidth = contentBlock.outerWidth;\n const contentWidth = contentBlock.contentWidth;\n\n const textLines = contentBlock.lines;\n const lineHeight = contentBlock.lineHeight;\n\n const defaultStyle = this._defaultStyle;\n\n const baseX = style.x || 0;\n const baseY = style.y || 0;\n const textAlign = style.align || defaultStyle.align || 'left';\n const verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\n\n let textX = baseX;\n let textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n const boxX = adjustTextX(baseX, outerWidth, textAlign);\n const boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n\n // `textBaseline` is set as 'middle'.\n textY += lineHeight / 2;\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n if (verticalAlign === 'top') {\n textY += textPadding[0];\n }\n else if (verticalAlign === 'bottom') {\n textY -= textPadding[2];\n }\n }\n\n let defaultLineWidth = 0;\n let useDefaultFill = false;\n const textFill = getFill(\n 'fill' in style\n ? style.fill\n : (useDefaultFill = true, defaultStyle.fill)\n );\n const textStroke = getStroke(\n 'stroke' in style\n ? style.stroke\n : (!bgColorDrawn\n // If we use \"auto lineWidth\" widely, it probably bring about some bad case.\n // So the current strategy is:\n // If `style.fill` is specified (i.e., `useDefaultFill` is `false`)\n // (A) And if `textConfig.insideStroke/outsideStroke` is not specified as a color\n // (i.e., `defaultStyle.autoStroke` is `true`), we do not actually display\n // the auto stroke because we can not make sure wether the stoke is approperiate to\n // the given `fill`.\n // (B) But if `textConfig.insideStroke/outsideStroke` is specified as a color,\n // we give the auto lineWidth to display the given stoke color.\n && (!defaultStyle.autoStroke || useDefaultFill)\n )\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null\n );\n\n const hasShadow = style.textShadowBlur > 0;\n\n const fixedBoundingRect = style.width != null\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\n const calculatedLineHeight = contentBlock.calculatedLineHeight;\n\n for (let i = 0; i < textLines.length; i++) {\n const el = this._getOrCreateChild(TSpan);\n // Always create new style.\n const subElStyle: TSpanStyleProps = el.createStyle();\n el.useStyle(subElStyle);\n subElStyle.text = textLines[i];\n subElStyle.x = textX;\n subElStyle.y = textY;\n // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n if (textAlign) {\n subElStyle.textAlign = textAlign;\n }\n // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n subElStyle.textBaseline = 'middle';\n subElStyle.opacity = style.opacity;\n // Fill after stroke so the outline will not cover the main part.\n subElStyle.strokeFirst = true;\n\n if (hasShadow) {\n subElStyle.shadowBlur = style.textShadowBlur || 0;\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\n }\n\n // Always override default fill and stroke value.\n subElStyle.stroke = textStroke as string;\n subElStyle.fill = textFill as string;\n\n if (textStroke) {\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\n subElStyle.lineDash = style.lineDash;\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n }\n\n subElStyle.font = textFont;\n setSeparateFont(subElStyle, style);\n\n textY += lineHeight;\n\n if (fixedBoundingRect) {\n el.setBoundingRect(new BoundingRect(\n adjustTextX(subElStyle.x, style.width, subElStyle.textAlign as TextAlign),\n adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline as TextVerticalAlign),\n /**\n * Text boundary should be the real text width.\n * Otherwise, there will be extra space in the\n * bounding rect calculated.\n */\n contentWidth,\n calculatedLineHeight\n ));\n }\n }\n }\n\n\n private _updateRichTexts() {\n const style = this.style;\n\n // TODO Only parse when text changed?\n const text = getStyleText(style);\n const contentBlock = parseRichText(text, style);\n\n const contentWidth = contentBlock.width;\n const outerWidth = contentBlock.outerWidth;\n const outerHeight = contentBlock.outerHeight;\n const textPadding = style.padding as number[];\n\n const baseX = style.x || 0;\n const baseY = style.y || 0;\n const defaultStyle = this._defaultStyle;\n const textAlign = style.align || defaultStyle.align;\n const verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\n\n const boxX = adjustTextX(baseX, outerWidth, textAlign);\n const boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n let xLeft = boxX;\n let lineTop = boxY;\n\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n\n let xRight = xLeft + contentWidth;\n\n if (needDrawBackground(style)) {\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n const bgColorDrawn = !!(style.backgroundColor);\n\n for (let i = 0; i < contentBlock.lines.length; i++) {\n const line = contentBlock.lines[i];\n const tokens = line.tokens;\n const tokenCount = tokens.length;\n const lineHeight = line.lineHeight;\n\n let remainedWidth = line.width;\n let leftIndex = 0;\n let lineXLeft = xLeft;\n let lineXRight = xRight;\n let rightIndex = tokenCount - 1;\n let token;\n\n while (\n leftIndex < tokenCount\n && (token = tokens[leftIndex], !token.align || token.align === 'left')\n ) {\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\n remainedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n\n while (\n rightIndex >= 0\n && (token = tokens[rightIndex], token.align === 'right')\n ) {\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\n remainedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n }\n\n // The other tokens are placed as textAlign 'center' if there is enough space.\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex];\n // Consider width specified by user, use 'center' rather than 'left'.\n this._placeToken(\n token, style, lineHeight, lineTop,\n lineXLeft + token.width / 2, 'center', bgColorDrawn\n );\n lineXLeft += token.width;\n leftIndex++;\n }\n\n lineTop += lineHeight;\n }\n }\n\n private _placeToken(\n token: TextToken,\n style: TextStyleProps,\n lineHeight: number,\n lineTop: number,\n x: number,\n textAlign: string,\n parentBgColorDrawn: boolean\n ) {\n const tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text;\n\n // 'ctx.textBaseline' is always set as 'middle', for sake of\n // the bias of \"Microsoft YaHei\".\n const verticalAlign = token.verticalAlign;\n let y = lineTop + lineHeight / 2;\n if (verticalAlign === 'top') {\n y = lineTop + token.height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n\n const needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\n needDrawBg && this._renderBackground(\n tokenStyle,\n style,\n textAlign === 'right'\n ? x - token.width\n : textAlign === 'center'\n ? x - token.width / 2\n : x,\n y - token.height / 2,\n token.width,\n token.height\n );\n const bgColorDrawn = !!tokenStyle.backgroundColor;\n\n const textPadding = token.textPadding;\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\n }\n\n const el = this._getOrCreateChild(TSpan);\n const subElStyle: TSpanStyleProps = el.createStyle();\n // Always create new style.\n el.useStyle(subElStyle);\n\n const defaultStyle = this._defaultStyle;\n let useDefaultFill = false;\n let defaultLineWidth = 0;\n const textFill = getFill(\n 'fill' in tokenStyle ? tokenStyle.fill\n : 'fill' in style ? style.fill\n : (useDefaultFill = true, defaultStyle.fill)\n );\n const textStroke = getStroke(\n 'stroke' in tokenStyle ? tokenStyle.stroke\n : 'stroke' in style ? style.stroke\n : (\n !bgColorDrawn\n && !parentBgColorDrawn\n // See the strategy explained above.\n && (!defaultStyle.autoStroke || useDefaultFill)\n ) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null\n );\n\n const hasShadow = tokenStyle.textShadowBlur > 0\n || style.textShadowBlur > 0;\n\n subElStyle.text = token.text;\n subElStyle.x = x;\n subElStyle.y = y;\n if (hasShadow) {\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\n }\n\n subElStyle.textAlign = textAlign as CanvasTextAlign;\n // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n subElStyle.textBaseline = 'middle';\n subElStyle.font = token.font || DEFAULT_FONT;\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\n\n\n // TODO inherit each item from top style in token style?\n setSeparateFont(subElStyle, tokenStyle);\n\n if (textStroke) {\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n subElStyle.stroke = textStroke;\n }\n if (textFill) {\n subElStyle.fill = textFill;\n }\n\n const textWidth = token.contentWidth;\n const textHeight = token.contentHeight;\n // NOTE: Should not call dirtyStyle after setBoundingRect. Or it will be cleared.\n el.setBoundingRect(new BoundingRect(\n adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign as TextAlign),\n adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline as TextVerticalAlign),\n textWidth,\n textHeight\n ));\n }\n\n private _renderBackground(\n style: TextStylePropsPart,\n topStyle: TextStylePropsPart,\n x: number,\n y: number,\n width: number,\n height: number\n ) {\n const textBackgroundColor = style.backgroundColor;\n const textBorderWidth = style.borderWidth;\n const textBorderColor = style.borderColor;\n const isImageBg = textBackgroundColor && (textBackgroundColor as {image: ImageLike}).image;\n const isPlainOrGradientBg = textBackgroundColor && !isImageBg;\n const textBorderRadius = style.borderRadius;\n const self = this;\n\n let rectEl: Rect;\n let imgEl: ZRImage;\n if (isPlainOrGradientBg || style.lineHeight || (textBorderWidth && textBorderColor)) {\n // Background is color\n rectEl = this._getOrCreateChild(Rect);\n rectEl.useStyle(rectEl.createStyle()); // Create an empty style.\n rectEl.style.fill = null;\n const rectShape = rectEl.shape;\n rectShape.x = x;\n rectShape.y = y;\n rectShape.width = width;\n rectShape.height = height;\n rectShape.r = textBorderRadius;\n rectEl.dirtyShape();\n }\n\n if (isPlainOrGradientBg) {\n const rectStyle = rectEl.style;\n rectStyle.fill = textBackgroundColor as string || null;\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\n }\n else if (isImageBg) {\n imgEl = this._getOrCreateChild(ZRImage);\n imgEl.onload = function () {\n // Refresh and relayout after image loaded.\n self.dirtyStyle();\n };\n const imgStyle = imgEl.style;\n imgStyle.image = (textBackgroundColor as {image: ImageLike}).image;\n imgStyle.x = x;\n imgStyle.y = y;\n imgStyle.width = width;\n imgStyle.height = height;\n }\n\n if (textBorderWidth && textBorderColor) {\n const rectStyle = rectEl.style;\n rectStyle.lineWidth = textBorderWidth;\n rectStyle.stroke = textBorderColor;\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\n rectStyle.lineDash = style.borderDash;\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\n rectEl.strokeContainThreshold = 0;\n\n // Making shadow looks better.\n if (rectEl.hasFill() && rectEl.hasStroke()) {\n rectStyle.strokeFirst = true;\n rectStyle.lineWidth *= 2;\n }\n }\n\n const commonStyle = (rectEl || imgEl).style;\n commonStyle.shadowBlur = style.shadowBlur || 0;\n commonStyle.shadowColor = style.shadowColor || 'transparent';\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\n }\n\n static makeFont(style: TextStylePropsPart): string {\n // FIXME in node-canvas fontWeight is before fontStyle\n // Use `fontSize` `fontFamily` to check whether font properties are defined.\n let font = '';\n if (hasSeparateFont(style)) {\n font = [\n style.fontStyle,\n style.fontWeight,\n parseFontSize(style.fontSize),\n // If font properties are defined, `fontFamily` should not be ignored.\n style.fontFamily || 'sans-serif'\n ].join(' ');\n }\n return font && trim(font) || style.textFont || style.font;\n }\n}\n\n\nconst VALID_TEXT_ALIGN = {left: true, right: 1, center: 1};\nconst VALID_TEXT_VERTICAL_ALIGN = {top: 1, bottom: 1, middle: 1};\n\nconst FONT_PARTS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'] as const;\n\nexport function parseFontSize(fontSize: number | string) {\n if (\n typeof fontSize === 'string'\n && (\n fontSize.indexOf('px') !== -1\n || fontSize.indexOf('rem') !== -1\n || fontSize.indexOf('em') !== -1\n )\n ) {\n return fontSize;\n }\n else if (!isNaN(+fontSize)) {\n return fontSize + 'px';\n }\n else {\n return DEFAULT_FONT_SIZE + 'px';\n }\n}\n\nfunction setSeparateFont(\n targetStyle: TSpanStyleProps,\n sourceStyle: TextStylePropsPart\n) {\n for (let i = 0; i < FONT_PARTS.length; i++) {\n const fontProp = FONT_PARTS[i];\n const val = sourceStyle[fontProp];\n if (val != null) {\n (targetStyle as any)[fontProp] = val;\n }\n }\n}\n\nexport function hasSeparateFont(style: Pick) {\n return style.fontSize != null || style.fontFamily || style.fontWeight;\n}\n\nexport function normalizeTextStyle(style: TextStyleProps): TextStyleProps {\n normalizeStyle(style);\n // TODO inherit each item from top style in token style?\n each(style.rich, normalizeStyle);\n return style;\n}\n\nfunction normalizeStyle(style: TextStylePropsPart) {\n if (style) {\n style.font = ZRText.makeFont(style);\n let textAlign = style.align;\n // 'middle' is invalid, convert it to 'center'\n (textAlign as string) === 'middle' && (textAlign = 'center');\n style.align = (\n textAlign == null || VALID_TEXT_ALIGN[textAlign]\n ) ? textAlign : 'left';\n\n // Compatible with textBaseline.\n let verticalAlign = style.verticalAlign;\n (verticalAlign as string) === 'center' && (verticalAlign = 'middle');\n style.verticalAlign = (\n verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]\n ) ? verticalAlign : 'top';\n\n // TODO Should not change the orignal value.\n const textPadding = style.padding;\n if (textPadding) {\n style.padding = normalizeCssArray(style.padding);\n }\n }\n}\n\n/**\n * @param stroke If specified, do not check style.textStroke.\n * @param lineWidth If specified, do not check style.textStroke.\n */\nfunction getStroke(\n stroke?: TextStylePropsPart['stroke'],\n lineWidth?: number\n) {\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\n ? null\n : ((stroke as any).image || (stroke as any).colorStops)\n ? '#000'\n : stroke;\n}\n\nfunction getFill(\n fill?: TextStylePropsPart['fill']\n) {\n return (fill == null || fill === 'none')\n ? null\n // TODO pattern and gradient?\n : ((fill as any).image || (fill as any).colorStops)\n ? '#000'\n : fill;\n}\n\nfunction getTextXForPadding(x: number, textAlign: string, textPadding: number[]): number {\n return textAlign === 'right'\n ? (x - textPadding[1])\n : textAlign === 'center'\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\n : (x + textPadding[3]);\n}\n\nfunction getStyleText(style: TextStylePropsPart): string {\n // Compat: set number to text is supported.\n // set null/undefined to text is supported.\n let text = style.text;\n text != null && (text += '');\n return text;\n}\n\n/**\n * If needs draw background\n * @param style Style of element\n */\nfunction needDrawBackground(style: TextStylePropsPart): boolean {\n return !!(\n style.backgroundColor\n || style.lineHeight\n || (style.borderWidth && style.borderColor)\n );\n}\n\nexport default ZRText;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Element from 'zrender/src/Element';\r\nimport {\r\n DataModel, ECEventData, BlurScope, InnerFocus, SeriesDataType,\r\n ComponentMainType, ComponentItemTooltipOption\r\n} from './types';\r\nimport { makeInner } from './model';\r\n\r\nexport type SSRItemType = 'chart' | 'legend';\r\n\r\n/**\r\n * ECData stored on graphic element\r\n */\r\nexport interface ECData {\r\n dataIndex?: number;\r\n dataModel?: DataModel;\r\n eventData?: ECEventData;\r\n seriesIndex?: number;\r\n dataType?: SeriesDataType;\r\n focus?: InnerFocus;\r\n blurScope?: BlurScope;\r\n ssrType?: SSRItemType;\r\n\r\n // Required by `tooltipConfig` and `focus`.\r\n componentMainType?: ComponentMainType;\r\n componentIndex?: number;\r\n componentHighDownName?: string;\r\n\r\n // To make a tooltipConfig, seach `setTooltipConfig`.\r\n // Used to find component tooltip option, which is used as\r\n // the parent of tooltipConfig.option for cascading.\r\n // If not provided, do not use component as its parent.\r\n // (Set manatary to make developers not to forget them).\r\n tooltipConfig?: {\r\n // Target item name to locate tooltip.\r\n name: string;\r\n option: ComponentItemTooltipOption;\r\n };\r\n}\r\n\r\nexport const getECData = makeInner();\r\n\r\nexport const setCommonECData = (seriesIndex: number, dataType: SeriesDataType, dataIdx: number, el: Element) => {\r\n if (el) {\r\n const ecData = getECData(el);\r\n // Add data index and series index for indexing the data by element\r\n // Useful in tooltip\r\n ecData.dataIndex = dataIdx;\r\n ecData.dataType = dataType;\r\n ecData.seriesIndex = seriesIndex;\r\n ecData.ssrType = 'chart';\r\n\r\n // TODO: not store dataIndex on children.\r\n if (el.type === 'group') {\r\n el.traverse(function (child: Element): void {\r\n const childECData = getECData(child);\r\n childECData.seriesIndex = seriesIndex;\r\n childECData.dataIndex = dataIdx;\r\n childECData.dataType = dataType;\r\n childECData.ssrType = 'chart';\r\n });\r\n }\r\n }\r\n};\r\n", "\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport Displayable, { DisplayableState } from 'zrender/src/graphic/Displayable';\r\nimport { PatternObject } from 'zrender/src/graphic/Pattern';\r\nimport { GradientObject } from 'zrender/src/graphic/Gradient';\r\nimport Element, { ElementEvent } from 'zrender/src/Element';\r\nimport Model from '../model/Model';\r\nimport {\r\n SeriesDataType,\r\n DisplayState,\r\n ECElement,\r\n ColorString,\r\n BlurScope,\r\n InnerFocus,\r\n Payload,\r\n ZRColor,\r\n HighlightPayload,\r\n DownplayPayload,\r\n ComponentMainType\r\n} from './types';\r\nimport {\r\n extend,\r\n indexOf,\r\n isArrayLike,\r\n isObject,\r\n keys,\r\n isArray,\r\n each\r\n} from 'zrender/src/core/util';\r\nimport { getECData } from './innerStore';\r\nimport { liftColor } from 'zrender/src/tool/color';\r\nimport SeriesData from '../data/SeriesData';\r\nimport SeriesModel from '../model/Series';\r\nimport { CoordinateSystemMaster, CoordinateSystem } from '../coord/CoordinateSystem';\r\nimport { queryDataIndex, makeInner } from './model';\r\nimport Path, { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport GlobalModel from '../model/Global';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport ComponentModel from '../model/Component';\r\nimport { error } from './log';\r\nimport type ComponentView from '../view/Component';\r\n\r\n// Reserve 0 as default.\r\nlet _highlightNextDigit = 1;\r\n\r\nconst _highlightKeyMap: Dictionary = {};\r\n\r\nconst getSavedStates = makeInner<{\r\n normalFill: ZRColor\r\n normalStroke: ZRColor\r\n selectFill?: ZRColor\r\n selectStroke?: ZRColor\r\n}, Path>();\r\n\r\nconst getComponentStates = makeInner<{\r\n isBlured: boolean\r\n}, SeriesModel | ComponentModel>();\r\n\r\nexport const HOVER_STATE_NORMAL: 0 = 0;\r\nexport const HOVER_STATE_BLUR: 1 = 1;\r\nexport const HOVER_STATE_EMPHASIS: 2 = 2;\r\n\r\nexport const SPECIAL_STATES = ['emphasis', 'blur', 'select'] as const;\r\nexport const DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'] as const;\r\n\r\nexport const Z2_EMPHASIS_LIFT = 10;\r\nexport const Z2_SELECT_LIFT = 9;\r\n\r\nexport const HIGHLIGHT_ACTION_TYPE = 'highlight';\r\nexport const DOWNPLAY_ACTION_TYPE = 'downplay';\r\n\r\nexport const SELECT_ACTION_TYPE = 'select';\r\nexport const UNSELECT_ACTION_TYPE = 'unselect';\r\nexport const TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\r\n\r\ntype ExtendedProps = {\r\n __highByOuter: number\r\n\r\n __highDownSilentOnTouch: boolean\r\n\r\n __highDownDispatcher: boolean\r\n};\r\ntype ExtendedElement = Element & ExtendedProps;\r\ntype ExtendedDisplayable = Displayable & ExtendedProps;\r\n\r\nfunction hasFillOrStroke(fillOrStroke: string | PatternObject | GradientObject) {\r\n return fillOrStroke != null && fillOrStroke !== 'none';\r\n}\r\n\r\nfunction doChangeHoverState(el: ECElement, stateName: DisplayState, hoverStateEnum: 0 | 1 | 2) {\r\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\r\n el.onHoverStateChange(stateName);\r\n }\r\n el.hoverState = hoverStateEnum;\r\n}\r\n\r\nfunction singleEnterEmphasis(el: ECElement) {\r\n // Only mark the flag.\r\n // States will be applied in the echarts.ts in next frame.\r\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\r\n}\r\n\r\nfunction singleLeaveEmphasis(el: ECElement) {\r\n // Only mark the flag.\r\n // States will be applied in the echarts.ts in next frame.\r\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n}\r\n\r\nfunction singleEnterBlur(el: ECElement) {\r\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\r\n}\r\n\r\nfunction singleLeaveBlur(el: ECElement) {\r\n if (el.hoverState === HOVER_STATE_BLUR) {\r\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\r\n }\r\n}\r\n\r\nfunction singleEnterSelect(el: ECElement) {\r\n el.selected = true;\r\n}\r\nfunction singleLeaveSelect(el: ECElement) {\r\n el.selected = false;\r\n}\r\n\r\nfunction updateElementState(\r\n el: ExtendedElement,\r\n updater: (this: void, el: Element, commonParam?: T) => void,\r\n commonParam?: T\r\n) {\r\n updater(el, commonParam);\r\n}\r\n\r\nfunction traverseUpdateState(\r\n el: ExtendedElement,\r\n updater: (this: void, el: Element, commonParam?: T) => void,\r\n commonParam?: T\r\n) {\r\n updateElementState(el, updater, commonParam);\r\n el.isGroup && el.traverse(function (child: ExtendedElement) {\r\n updateElementState(child, updater, commonParam);\r\n });\r\n}\r\n\r\nexport function setStatesFlag(el: ECElement, stateName: DisplayState) {\r\n switch (stateName) {\r\n case 'emphasis':\r\n el.hoverState = HOVER_STATE_EMPHASIS;\r\n break;\r\n case 'normal':\r\n el.hoverState = HOVER_STATE_NORMAL;\r\n break;\r\n case 'blur':\r\n el.hoverState = HOVER_STATE_BLUR;\r\n break;\r\n case 'select':\r\n el.selected = true;\r\n }\r\n}\r\n\r\n/**\r\n * If we reuse elements when rerender.\r\n * DON'T forget to clearStates before we update the style and shape.\r\n * Or we may update on the wrong state instead of normal state.\r\n */\r\nexport function clearStates(el: Element) {\r\n if (el.isGroup) {\r\n el.traverse(function (child) {\r\n child.clearStates();\r\n });\r\n }\r\n else {\r\n el.clearStates();\r\n }\r\n}\r\n\r\nfunction getFromStateStyle(\r\n el: Displayable,\r\n props: (keyof PathStyleProps)[],\r\n toStateName: string,\r\n defaultValue?: PathStyleProps\r\n): PathStyleProps {\r\n const style = el.style;\r\n const fromState: PathStyleProps = {};\r\n for (let i = 0; i < props.length; i++) {\r\n const propName = props[i];\r\n const val = style[propName];\r\n (fromState as any)[propName] = val == null ? (defaultValue && defaultValue[propName]) : val;\r\n }\r\n for (let i = 0; i < el.animators.length; i++) {\r\n const animator = el.animators[i];\r\n if (animator.__fromStateTransition\r\n // Don't consider the animation to emphasis state.\r\n && animator.__fromStateTransition.indexOf(toStateName) < 0\r\n && animator.targetName === 'style') {\r\n animator.saveTo(fromState, props);\r\n }\r\n }\r\n return fromState;\r\n}\r\n\r\nfunction createEmphasisDefaultState(\r\n el: Displayable,\r\n stateName: 'emphasis',\r\n targetStates: string[],\r\n state: Displayable['states'][number]\r\n): DisplayableState {\r\n const hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\r\n let cloned = false;\r\n if (el instanceof Path) {\r\n const store = getSavedStates(el);\r\n const fromFill = hasSelect ? (store.selectFill || store.normalFill) : store.normalFill;\r\n const fromStroke = hasSelect ? (store.selectStroke || store.normalStroke) : store.normalStroke;\r\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\r\n state = state || {};\r\n let emphasisStyle = state.style || {};\r\n\r\n // inherit case\r\n if (emphasisStyle.fill === 'inherit') {\r\n cloned = true;\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n emphasisStyle.fill = fromFill;\r\n }\r\n // Apply default color lift\r\n else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\r\n cloned = true;\r\n // Not modify the original value.\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n // Already being applied 'emphasis'. DON'T lift color multiple times.\r\n emphasisStyle.fill = liftColor(fromFill as ColorString);\r\n }\r\n // Not highlight stroke if fill has been highlighted.\r\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n emphasisStyle = extend({}, emphasisStyle);\r\n }\r\n emphasisStyle.stroke = liftColor(fromStroke as ColorString);\r\n }\r\n state.style = emphasisStyle;\r\n }\r\n }\r\n if (state) {\r\n // TODO Share with textContent?\r\n if (state.z2 == null) {\r\n if (!cloned) {\r\n state = extend({}, state);\r\n }\r\n const z2EmphasisLift = (el as ECElement).z2EmphasisLift;\r\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\r\n }\r\n }\r\n return state;\r\n}\r\n\r\nfunction createSelectDefaultState(\r\n el: Displayable,\r\n stateName: 'select',\r\n state: Displayable['states'][number]\r\n): DisplayableState {\r\n // const hasSelect = indexOf(el.currentStates, stateName) >= 0;\r\n if (state) {\r\n // TODO Share with textContent?\r\n if (state.z2 == null) {\r\n state = extend({}, state);\r\n const z2SelectLift = (el as ECElement).z2SelectLift;\r\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\r\n }\r\n }\r\n return state;\r\n}\r\n\r\nfunction createBlurDefaultState(\r\n el: Displayable,\r\n stateName: 'blur',\r\n state: Displayable['states'][number]\r\n): DisplayableState {\r\n const hasBlur = indexOf(el.currentStates, stateName) >= 0;\r\n const currentOpacity = el.style.opacity;\r\n\r\n const fromState = !hasBlur\r\n ? getFromStateStyle(el, ['opacity'], stateName, {\r\n opacity: 1\r\n })\r\n : null;\r\n\r\n state = state || {};\r\n let blurStyle = state.style || {};\r\n if (blurStyle.opacity == null) {\r\n // clone state\r\n state = extend({}, state);\r\n blurStyle = extend({\r\n // Already being applied 'emphasis'. DON'T mul opacity multiple times.\r\n opacity: hasBlur ? currentOpacity : (fromState.opacity * 0.1)\r\n }, blurStyle);\r\n state.style = blurStyle;\r\n }\r\n\r\n return state;\r\n}\r\n\r\nfunction elementStateProxy(this: Displayable, stateName: string, targetStates?: string[]): DisplayableState {\r\n const state = this.states[stateName];\r\n if (this.style) {\r\n if (stateName === 'emphasis') {\r\n return createEmphasisDefaultState(this, stateName, targetStates, state);\r\n }\r\n else if (stateName === 'blur') {\r\n return createBlurDefaultState(this, stateName, state);\r\n }\r\n else if (stateName === 'select') {\r\n return createSelectDefaultState(this, stateName, state);\r\n }\r\n }\r\n return state;\r\n}\r\n\r\n/**\r\n * Set hover style (namely \"emphasis style\") of element.\r\n * @param el Should not be `zrender/graphic/Group`.\r\n * @param focus 'self' | 'selfInSeries' | 'series'\r\n */\r\nexport function setDefaultStateProxy(el: Displayable) {\r\n el.stateProxy = elementStateProxy;\r\n const textContent = el.getTextContent();\r\n const textGuide = el.getTextGuideLine();\r\n if (textContent) {\r\n textContent.stateProxy = elementStateProxy;\r\n }\r\n if (textGuide) {\r\n textGuide.stateProxy = elementStateProxy;\r\n }\r\n}\r\n\r\nexport function enterEmphasisWhenMouseOver(el: Element, e: ElementEvent) {\r\n !shouldSilent(el, e)\r\n // \"emphasis\" event highlight has higher priority than mouse highlight.\r\n && !(el as ExtendedElement).__highByOuter\r\n && traverseUpdateState((el as ExtendedElement), singleEnterEmphasis);\r\n}\r\n\r\nexport function leaveEmphasisWhenMouseOut(el: Element, e: ElementEvent) {\r\n !shouldSilent(el, e)\r\n // \"emphasis\" event highlight has higher priority than mouse highlight.\r\n && !(el as ExtendedElement).__highByOuter\r\n && traverseUpdateState((el as ExtendedElement), singleLeaveEmphasis);\r\n}\r\n\r\nexport function enterEmphasis(el: Element, highlightDigit?: number) {\r\n (el as ExtendedElement).__highByOuter |= 1 << (highlightDigit || 0);\r\n traverseUpdateState((el as ExtendedElement), singleEnterEmphasis);\r\n}\r\n\r\nexport function leaveEmphasis(el: Element, highlightDigit?: number) {\r\n !((el as ExtendedElement).__highByOuter &= ~(1 << (highlightDigit || 0)))\r\n && traverseUpdateState((el as ExtendedElement), singleLeaveEmphasis);\r\n}\r\n\r\nexport function enterBlur(el: Element) {\r\n traverseUpdateState(el as ExtendedElement, singleEnterBlur);\r\n}\r\n\r\nexport function leaveBlur(el: Element) {\r\n traverseUpdateState(el as ExtendedElement, singleLeaveBlur);\r\n}\r\n\r\nexport function enterSelect(el: Element) {\r\n traverseUpdateState(el as ExtendedElement, singleEnterSelect);\r\n}\r\n\r\nexport function leaveSelect(el: Element) {\r\n traverseUpdateState(el as ExtendedElement, singleLeaveSelect);\r\n}\r\n\r\nfunction shouldSilent(el: Element, e: ElementEvent) {\r\n return (el as ExtendedElement).__highDownSilentOnTouch && e.zrByTouch;\r\n}\r\n\r\nexport function allLeaveBlur(api: ExtensionAPI) {\r\n const model = api.getModel();\r\n const leaveBlurredSeries: SeriesModel[] = [];\r\n const allComponentViews: ComponentView[] = [];\r\n model.eachComponent(function (componentType, componentModel) {\r\n const componentStates = getComponentStates(componentModel);\r\n const isSeries = componentType === 'series';\r\n const view = isSeries ? api.getViewOfSeriesModel(componentModel as SeriesModel)\r\n : api.getViewOfComponentModel(componentModel);\r\n !isSeries && allComponentViews.push(view as ComponentView);\r\n if (componentStates.isBlured) {\r\n // Leave blur anyway\r\n view.group.traverse(function (child) {\r\n singleLeaveBlur(child);\r\n });\r\n isSeries && leaveBlurredSeries.push(componentModel as SeriesModel);\r\n }\r\n componentStates.isBlured = false;\r\n });\r\n each(allComponentViews, function (view) {\r\n if (view && view.toggleBlurSeries) {\r\n view.toggleBlurSeries(leaveBlurredSeries, false, model);\r\n }\r\n });\r\n}\r\n\r\nexport function blurSeries(\r\n targetSeriesIndex: number,\r\n focus: InnerFocus,\r\n blurScope: BlurScope,\r\n api: ExtensionAPI\r\n) {\r\n const ecModel = api.getModel();\r\n blurScope = blurScope || 'coordinateSystem';\r\n\r\n function leaveBlurOfIndices(data: SeriesData, dataIndices: ArrayLike) {\r\n for (let i = 0; i < dataIndices.length; i++) {\r\n const itemEl = data.getItemGraphicEl(dataIndices[i]);\r\n itemEl && leaveBlur(itemEl);\r\n }\r\n }\r\n\r\n if (targetSeriesIndex == null) {\r\n return;\r\n }\r\n\r\n if (!focus || focus === 'none') {\r\n return;\r\n }\r\n\r\n const targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\r\n let targetCoordSys: CoordinateSystemMaster | CoordinateSystem = targetSeriesModel.coordinateSystem;\r\n if (targetCoordSys && (targetCoordSys as CoordinateSystem).master) {\r\n targetCoordSys = (targetCoordSys as CoordinateSystem).master;\r\n }\r\n\r\n const blurredSeries: SeriesModel[] = [];\r\n\r\n ecModel.eachSeries(function (seriesModel) {\r\n\r\n const sameSeries = targetSeriesModel === seriesModel;\r\n let coordSys: CoordinateSystemMaster | CoordinateSystem = seriesModel.coordinateSystem;\r\n if (coordSys && (coordSys as CoordinateSystem).master) {\r\n coordSys = (coordSys as CoordinateSystem).master;\r\n }\r\n const sameCoordSys = coordSys && targetCoordSys\r\n ? coordSys === targetCoordSys\r\n : sameSeries; // If there is no coordinate system. use sameSeries instead.\r\n if (!(\r\n // Not blur other series if blurScope series\r\n blurScope === 'series' && !sameSeries\r\n // Not blur other coordinate system if blurScope is coordinateSystem\r\n || blurScope === 'coordinateSystem' && !sameCoordSys\r\n // Not blur self series if focus is series.\r\n || focus === 'series' && sameSeries\r\n // TODO blurScope: coordinate system\r\n )) {\r\n const view = api.getViewOfSeriesModel(seriesModel);\r\n view.group.traverse(function (child) {\r\n // For the elements that have been triggered by other components,\r\n // and are still required to be highlighted,\r\n // because the current is directly forced to blur the element,\r\n // it will cause the focus self to be unable to highlight, so skip the blur of this element.\r\n if ((child as ExtendedElement).__highByOuter && sameSeries && focus === 'self') {\r\n return;\r\n }\r\n singleEnterBlur(child);\r\n });\r\n\r\n if (isArrayLike(focus)) {\r\n leaveBlurOfIndices(seriesModel.getData(), focus as ArrayLike);\r\n }\r\n else if (isObject(focus)) {\r\n const dataTypes = keys(focus);\r\n for (let d = 0; d < dataTypes.length; d++) {\r\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d] as SeriesDataType), focus[dataTypes[d]]);\r\n }\r\n }\r\n\r\n blurredSeries.push(seriesModel);\r\n\r\n getComponentStates(seriesModel).isBlured = true;\r\n }\r\n });\r\n\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n const view = api.getViewOfComponentModel(componentModel);\r\n if (view && view.toggleBlurSeries) {\r\n view.toggleBlurSeries(blurredSeries, true, ecModel);\r\n }\r\n });\r\n}\r\n\r\nexport function blurComponent(\r\n componentMainType: ComponentMainType,\r\n componentIndex: number,\r\n api: ExtensionAPI\r\n) {\r\n if (componentMainType == null || componentIndex == null) {\r\n return;\r\n }\r\n\r\n const componentModel = api.getModel().getComponent(componentMainType, componentIndex);\r\n if (!componentModel) {\r\n return;\r\n }\r\n\r\n getComponentStates(componentModel).isBlured = true;\r\n\r\n const view = api.getViewOfComponentModel(componentModel);\r\n if (!view || !view.focusBlurEnabled) {\r\n return;\r\n }\r\n\r\n view.group.traverse(function (child) {\r\n singleEnterBlur(child);\r\n });\r\n}\r\n\r\nexport function blurSeriesFromHighlightPayload(\r\n seriesModel: SeriesModel,\r\n payload: HighlightPayload,\r\n api: ExtensionAPI\r\n) {\r\n const seriesIndex = seriesModel.seriesIndex;\r\n const data = seriesModel.getData(payload.dataType);\r\n if (!data) {\r\n if (__DEV__) {\r\n error(`Unknown dataType ${payload.dataType}`);\r\n }\r\n return;\r\n }\r\n let dataIndex = queryDataIndex(data, payload);\r\n // Pick the first one if there is multiple/none exists.\r\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\r\n let el = data.getItemGraphicEl(dataIndex as number);\r\n if (!el) {\r\n const count = data.count();\r\n let current = 0;\r\n // If data on dataIndex is NaN.\r\n while (!el && current < count) {\r\n el = data.getItemGraphicEl(current++);\r\n }\r\n }\r\n\r\n if (el) {\r\n const ecData = getECData(el);\r\n blurSeries(\r\n seriesIndex, ecData.focus, ecData.blurScope, api\r\n );\r\n }\r\n else {\r\n // If there is no element put on the data. Try getting it from raw option\r\n // TODO Should put it on seriesModel?\r\n const focus = seriesModel.get(['emphasis', 'focus']);\r\n const blurScope = seriesModel.get(['emphasis', 'blurScope']);\r\n if (focus != null) {\r\n blurSeries(seriesIndex, focus, blurScope, api);\r\n }\r\n }\r\n}\r\n\r\nexport function findComponentHighDownDispatchers(\r\n componentMainType: ComponentMainType,\r\n componentIndex: number,\r\n name: string,\r\n api: ExtensionAPI\r\n): {\r\n focusSelf: boolean;\r\n // If return null/undefined, do not support this feature.\r\n dispatchers: Element[];\r\n} {\r\n const ret = {\r\n focusSelf: false,\r\n dispatchers: null as Element[]\r\n };\r\n if (componentMainType == null\r\n || componentMainType === 'series'\r\n || componentIndex == null\r\n || name == null\r\n ) {\r\n return ret;\r\n }\r\n\r\n const componentModel = api.getModel().getComponent(componentMainType, componentIndex);\r\n if (!componentModel) {\r\n return ret;\r\n }\r\n\r\n const view = api.getViewOfComponentModel(componentModel);\r\n if (!view || !view.findHighDownDispatchers) {\r\n return ret;\r\n }\r\n\r\n const dispatchers = view.findHighDownDispatchers(name);\r\n\r\n // At presnet, the component (like Geo) only blur inside itself.\r\n // So we do not use `blurScope` in component.\r\n let focusSelf: boolean;\r\n for (let i = 0; i < dispatchers.length; i++) {\r\n if (__DEV__ && !isHighDownDispatcher(dispatchers[i])) {\r\n error('param should be highDownDispatcher');\r\n }\r\n if (getECData(dispatchers[i]).focus === 'self') {\r\n focusSelf = true;\r\n break;\r\n }\r\n }\r\n\r\n return { focusSelf, dispatchers };\r\n}\r\n\r\nexport function handleGlobalMouseOverForHighDown(\r\n dispatcher: Element,\r\n e: ElementEvent,\r\n api: ExtensionAPI\r\n): void {\r\n if (__DEV__ && !isHighDownDispatcher(dispatcher)) {\r\n error('param should be highDownDispatcher');\r\n }\r\n\r\n const ecData = getECData(dispatcher);\r\n\r\n const { dispatchers, focusSelf } = findComponentHighDownDispatchers(\r\n ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api\r\n );\r\n // If `findHighDownDispatchers` is supported on the component,\r\n // highlight/downplay elements with the same name.\r\n if (dispatchers) {\r\n if (focusSelf) {\r\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\r\n }\r\n each(dispatchers, dispatcher => enterEmphasisWhenMouseOver(dispatcher, e));\r\n }\r\n else {\r\n // Try blur all in the related series. Then emphasis the hoverred.\r\n // TODO. progressive mode.\r\n blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api);\r\n if (ecData.focus === 'self') {\r\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\r\n }\r\n // Other than series, component that not support `findHighDownDispatcher` will\r\n // also use it. But in this case, highlight/downplay are only supported in\r\n // mouse hover but not in dispatchAction.\r\n enterEmphasisWhenMouseOver(dispatcher, e);\r\n }\r\n}\r\n\r\nexport function handleGlobalMouseOutForHighDown(\r\n dispatcher: Element,\r\n e: ElementEvent,\r\n api: ExtensionAPI\r\n): void {\r\n if (__DEV__ && !isHighDownDispatcher(dispatcher)) {\r\n error('param should be highDownDispatcher');\r\n }\r\n\r\n allLeaveBlur(api);\r\n\r\n const ecData = getECData(dispatcher);\r\n const { dispatchers } = findComponentHighDownDispatchers(\r\n ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api\r\n );\r\n if (dispatchers) {\r\n each(dispatchers, dispatcher => leaveEmphasisWhenMouseOut(dispatcher, e));\r\n }\r\n else {\r\n leaveEmphasisWhenMouseOut(dispatcher, e);\r\n }\r\n}\r\n\r\n\r\nexport function toggleSelectionFromPayload(\r\n seriesModel: SeriesModel,\r\n payload: Payload,\r\n api: ExtensionAPI\r\n) {\r\n if (!(isSelectChangePayload(payload))) {\r\n return;\r\n }\r\n const dataType = payload.dataType;\r\n const data = seriesModel.getData(dataType);\r\n let dataIndex = queryDataIndex(data, payload);\r\n if (!isArray(dataIndex)) {\r\n dataIndex = [dataIndex];\r\n }\r\n\r\n seriesModel[\r\n payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect'\r\n : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'\r\n ](dataIndex, dataType);\r\n}\r\n\r\n\r\nexport function updateSeriesElementSelection(seriesModel: SeriesModel) {\r\n const allData = seriesModel.getAllData();\r\n each(allData, function ({ data, type }) {\r\n data.eachItemGraphicEl(function (el, idx) {\r\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\r\n });\r\n });\r\n}\r\n\r\nexport function getAllSelectedIndices(ecModel: GlobalModel) {\r\n const ret: {\r\n seriesIndex: number\r\n dataType?: SeriesDataType\r\n dataIndex: number[]\r\n }[] = [];\r\n ecModel.eachSeries(function (seriesModel) {\r\n const allData = seriesModel.getAllData();\r\n each(allData, function ({ data, type }) {\r\n const dataIndices = seriesModel.getSelectedDataIndices();\r\n if (dataIndices.length > 0) {\r\n const item: typeof ret[number] = {\r\n dataIndex: dataIndices,\r\n seriesIndex: seriesModel.seriesIndex\r\n };\r\n if (type != null) {\r\n item.dataType = type;\r\n }\r\n ret.push(item);\r\n\r\n }\r\n });\r\n });\r\n return ret;\r\n}\r\n\r\n/**\r\n * Enable the function that mouseover will trigger the emphasis state.\r\n *\r\n * NOTE:\r\n * This function should be used on the element with dataIndex, seriesIndex.\r\n *\r\n */\r\nexport function enableHoverEmphasis(el: Element, focus?: InnerFocus, blurScope?: BlurScope) {\r\n setAsHighDownDispatcher(el, true);\r\n traverseUpdateState(el as ExtendedElement, setDefaultStateProxy);\r\n\r\n enableHoverFocus(el, focus, blurScope);\r\n}\r\n\r\nexport function disableHoverEmphasis(el: Element) {\r\n setAsHighDownDispatcher(el, false);\r\n}\r\n\r\nexport function toggleHoverEmphasis(el: Element, focus: InnerFocus, blurScope: BlurScope, isDisabled: boolean) {\r\n isDisabled ? disableHoverEmphasis(el)\r\n : enableHoverEmphasis(el, focus, blurScope);\r\n}\r\n\r\nexport function enableHoverFocus(el: Element, focus: InnerFocus, blurScope: BlurScope) {\r\n const ecData = getECData(el);\r\n if (focus != null) {\r\n // TODO dataIndex may be set after this function. This check is not useful.\r\n // if (ecData.dataIndex == null) {\r\n // if (__DEV__) {\r\n // console.warn('focus can only been set on element with dataIndex');\r\n // }\r\n // }\r\n // else {\r\n ecData.focus = focus;\r\n ecData.blurScope = blurScope;\r\n // }\r\n }\r\n else if (ecData.focus) {\r\n ecData.focus = null;\r\n }\r\n}\r\n\r\nconst OTHER_STATES = ['emphasis', 'blur', 'select'] as const;\r\nconst defaultStyleGetterMap: Dictionary<'getItemStyle' | 'getLineStyle' | 'getAreaStyle'> = {\r\n itemStyle: 'getItemStyle',\r\n lineStyle: 'getLineStyle',\r\n areaStyle: 'getAreaStyle'\r\n};\r\n/**\r\n * Set emphasis/blur/selected states of element.\r\n */\r\nexport function setStatesStylesFromModel(\r\n el: Displayable,\r\n itemModel: Model>>,\r\n styleType?: string, // default itemStyle\r\n getter?: (model: Model) => Dictionary\r\n) {\r\n styleType = styleType || 'itemStyle';\r\n for (let i = 0; i < OTHER_STATES.length; i++) {\r\n const stateName = OTHER_STATES[i];\r\n const model = itemModel.getModel([stateName, styleType]);\r\n const state = el.ensureState(stateName);\r\n // Let it throw error if getterType is not found.\r\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\r\n }\r\n}\r\n\r\n\r\n/**\r\n *\r\n * Set element as highlight / downplay dispatcher.\r\n * It will be checked when element received mouseover event or from highlight action.\r\n * It's in change of all highlight/downplay behavior of it's children.\r\n *\r\n * @param el\r\n * @param el.highDownSilentOnTouch\r\n * In touch device, mouseover event will be trigger on touchstart event\r\n * (see module:zrender/dom/HandlerProxy). By this mechanism, we can\r\n * conveniently use hoverStyle when tap on touch screen without additional\r\n * code for compatibility.\r\n * But if the chart/component has select feature, which usually also use\r\n * hoverStyle, there might be conflict between 'select-highlight' and\r\n * 'hover-highlight' especially when roam is enabled (see geo for example).\r\n * In this case, `highDownSilentOnTouch` should be used to disable\r\n * hover-highlight on touch device.\r\n * @param asDispatcher If `false`, do not set as \"highDownDispatcher\".\r\n */\r\nexport function setAsHighDownDispatcher(el: Element, asDispatcher: boolean) {\r\n const disable = asDispatcher === false;\r\n const extendedEl = el as ExtendedElement;\r\n // Make `highDownSilentOnTouch` and `onStateChange` only work after\r\n // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.\r\n if ((el as ECElement).highDownSilentOnTouch) {\r\n extendedEl.__highDownSilentOnTouch = (el as ECElement).highDownSilentOnTouch;\r\n }\r\n // Simple optimize, since this method might be\r\n // called for each elements of a group in some cases.\r\n if (!disable || extendedEl.__highDownDispatcher) {\r\n // Emphasis, normal can be triggered manually by API or other components like hover link.\r\n // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);\r\n // Also keep previous record.\r\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\r\n extendedEl.__highDownDispatcher = !disable;\r\n }\r\n}\r\n\r\nexport function isHighDownDispatcher(el: Element): boolean {\r\n return !!(el && (el as ExtendedDisplayable).__highDownDispatcher);\r\n}\r\n\r\n/**\r\n * Enable component highlight/downplay features:\r\n * + hover link (within the same name)\r\n * + focus blur in component\r\n */\r\nexport function enableComponentHighDownFeatures(\r\n el: Element,\r\n componentModel: ComponentModel,\r\n componentHighDownName: string\r\n): void {\r\n const ecData = getECData(el);\r\n ecData.componentMainType = componentModel.mainType;\r\n ecData.componentIndex = componentModel.componentIndex;\r\n ecData.componentHighDownName = componentHighDownName;\r\n}\r\n\r\n/**\r\n * Support highlight/downplay record on each elements.\r\n * For the case: hover highlight/downplay (legend, visualMap, ...) and\r\n * user triggered highlight/downplay should not conflict.\r\n * Only all of the highlightDigit cleared, return to normal.\r\n * @param {string} highlightKey\r\n * @return {number} highlightDigit\r\n */\r\nexport function getHighlightDigit(highlightKey: number) {\r\n let highlightDigit = _highlightKeyMap[highlightKey];\r\n if (highlightDigit == null && _highlightNextDigit <= 32) {\r\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\r\n }\r\n return highlightDigit;\r\n}\r\n\r\nexport function isSelectChangePayload(payload: Payload) {\r\n const payloadType = payload.type;\r\n return payloadType === SELECT_ACTION_TYPE\r\n || payloadType === UNSELECT_ACTION_TYPE\r\n || payloadType === TOGGLE_SELECT_ACTION_TYPE;\r\n}\r\n\r\nexport function isHighDownPayload(payload: Payload): payload is HighlightPayload | DownplayPayload {\r\n const payloadType = payload.type;\r\n return payloadType === HIGHLIGHT_ACTION_TYPE\r\n || payloadType === DOWNPLAY_ACTION_TYPE;\r\n}\r\n\r\nexport function savePathStates(el: Path) {\r\n const store = getSavedStates(el);\r\n store.normalFill = el.style.fill;\r\n store.normalStroke = el.style.stroke;\r\n\r\n const selectState = el.states.select || {};\r\n store.selectFill = (selectState.style && selectState.style.fill) || null;\r\n store.selectStroke = (selectState.style && selectState.style.stroke) || null;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as pathTool from 'zrender/src/tool/path';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport * as vector from 'zrender/src/core/vector';\r\nimport Path, { PathProps } from 'zrender/src/graphic/Path';\r\nimport Transformable from 'zrender/src/core/Transformable';\r\nimport ZRImage, { ImageStyleProps } from 'zrender/src/graphic/Image';\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport ZRText from 'zrender/src/graphic/Text';\r\nimport Circle from 'zrender/src/graphic/shape/Circle';\r\nimport Ellipse from 'zrender/src/graphic/shape/Ellipse';\r\nimport Sector from 'zrender/src/graphic/shape/Sector';\r\nimport Ring from 'zrender/src/graphic/shape/Ring';\r\nimport Polygon from 'zrender/src/graphic/shape/Polygon';\r\nimport Polyline from 'zrender/src/graphic/shape/Polyline';\r\nimport Rect from 'zrender/src/graphic/shape/Rect';\r\nimport Line from 'zrender/src/graphic/shape/Line';\r\nimport BezierCurve from 'zrender/src/graphic/shape/BezierCurve';\r\nimport Arc from 'zrender/src/graphic/shape/Arc';\r\nimport CompoundPath from 'zrender/src/graphic/CompoundPath';\r\nimport LinearGradient from 'zrender/src/graphic/LinearGradient';\r\nimport RadialGradient from 'zrender/src/graphic/RadialGradient';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport OrientedBoundingRect from 'zrender/src/core/OrientedBoundingRect';\r\nimport Point from 'zrender/src/core/Point';\r\nimport IncrementalDisplayable from 'zrender/src/graphic/IncrementalDisplayable';\r\nimport * as subPixelOptimizeUtil from 'zrender/src/graphic/helper/subPixelOptimize';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport Displayable, { DisplayableProps } from 'zrender/src/graphic/Displayable';\r\nimport Element from 'zrender/src/Element';\r\nimport Model from '../model/Model';\r\nimport {\r\n AnimationOptionMixin,\r\n ZRRectLike,\r\n ZRStyleProps,\r\n CommonTooltipOption,\r\n ComponentItemTooltipLabelFormatterParams\r\n} from './types';\r\nimport {\r\n extend,\r\n isArrayLike,\r\n map,\r\n defaults,\r\n isString,\r\n keys,\r\n each,\r\n hasOwn,\r\n isArray\r\n} from 'zrender/src/core/util';\r\nimport { getECData } from './innerStore';\r\nimport ComponentModel from '../model/Component';\r\n\r\nimport {\r\n updateProps,\r\n initProps,\r\n removeElement,\r\n removeElementWithFadeOut,\r\n isElementRemoved\r\n} from '../animation/basicTransition';\r\n\r\n/**\r\n * @deprecated export for compatitable reason\r\n */\r\nexport {updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved};\r\n\r\n\r\nconst mathMax = Math.max;\r\nconst mathMin = Math.min;\r\n\r\nconst _customShapeMap: Dictionary<{ new(): Path }> = {};\r\n\r\ntype ExtendShapeOpt = Parameters[0];\r\ntype ExtendShapeReturn = ReturnType;\r\n\r\n/**\r\n * Extend shape with parameters\r\n */\r\nexport function extendShape(opts: ExtendShapeOpt): ExtendShapeReturn {\r\n return Path.extend(opts);\r\n}\r\n\r\nconst extendPathFromString = pathTool.extendFromString;\r\ntype SVGPathOption = Parameters[1];\r\ntype SVGPathCtor = ReturnType;\r\ntype SVGPath = InstanceType;\r\n/**\r\n * Extend path\r\n */\r\nexport function extendPath(pathData: string, opts: SVGPathOption): SVGPathCtor {\r\n return extendPathFromString(pathData, opts);\r\n}\r\n\r\n/**\r\n * Register a user defined shape.\r\n * The shape class can be fetched by `getShapeClass`\r\n * This method will overwrite the registered shapes, including\r\n * the registered built-in shapes, if using the same `name`.\r\n * The shape can be used in `custom series` and\r\n * `graphic component` by declaring `{type: name}`.\r\n *\r\n * @param name\r\n * @param ShapeClass Can be generated by `extendShape`.\r\n */\r\nexport function registerShape(name: string, ShapeClass: {new(): Path}) {\r\n _customShapeMap[name] = ShapeClass;\r\n}\r\n\r\n/**\r\n * Find shape class registered by `registerShape`. Usually used in\r\n * fetching user defined shape.\r\n *\r\n * [Caution]:\r\n * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared\r\n * to use user registered shapes.\r\n * Because the built-in shape (see `getBuiltInShape`) will be registered by\r\n * `registerShape` by default. That enables users to get both built-in\r\n * shapes as well as the shapes belonging to themsleves. But users can overwrite\r\n * the built-in shapes by using names like 'circle', 'rect' via calling\r\n * `registerShape`. So the echarts inner featrues should not fetch shapes from here\r\n * in case that it is overwritten by users, except that some features, like\r\n * `custom series`, `graphic component`, do it deliberately.\r\n *\r\n * (2) In the features like `custom series`, `graphic component`, the user input\r\n * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic\r\n * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names\r\n * are reserved names, that is, if some user registers a shape named `'image'`,\r\n * the shape will not be used. If we intending to add some more reserved names\r\n * in feature, that might bring break changes (disable some existing user shape\r\n * names). But that case probably rarely happens. So we don't make more mechanism\r\n * to resolve this issue here.\r\n *\r\n * @param name\r\n * @return The shape class. If not found, return nothing.\r\n */\r\nexport function getShapeClass(name: string): {new(): Path} {\r\n if (_customShapeMap.hasOwnProperty(name)) {\r\n return _customShapeMap[name];\r\n }\r\n}\r\n\r\n/**\r\n * Create a path element from path data string\r\n * @param pathData\r\n * @param opts\r\n * @param rect\r\n * @param layout 'center' or 'cover' default to be cover\r\n */\r\nexport function makePath(\r\n pathData: string,\r\n opts: SVGPathOption,\r\n rect: ZRRectLike,\r\n layout?: 'center' | 'cover'\r\n): SVGPath {\r\n const path = pathTool.createFromString(pathData, opts);\r\n if (rect) {\r\n if (layout === 'center') {\r\n rect = centerGraphic(rect, path.getBoundingRect());\r\n }\r\n resizePath(path, rect);\r\n }\r\n return path;\r\n}\r\n\r\n/**\r\n * Create a image element from image url\r\n * @param imageUrl image url\r\n * @param opts options\r\n * @param rect constrain rect\r\n * @param layout 'center' or 'cover'. Default to be 'cover'\r\n */\r\nexport function makeImage(\r\n imageUrl: string,\r\n rect: ZRRectLike,\r\n layout?: 'center' | 'cover'\r\n) {\r\n const zrImg = new ZRImage({\r\n style: {\r\n image: imageUrl,\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n onload(img) {\r\n if (layout === 'center') {\r\n const boundingRect = {\r\n width: img.width,\r\n height: img.height\r\n };\r\n zrImg.setStyle(centerGraphic(rect, boundingRect));\r\n }\r\n }\r\n });\r\n return zrImg;\r\n}\r\n\r\n/**\r\n * Get position of centered element in bounding box.\r\n *\r\n * @param rect element local bounding box\r\n * @param boundingRect constraint bounding box\r\n * @return element position containing x, y, width, and height\r\n */\r\nfunction centerGraphic(rect: ZRRectLike, boundingRect: {\r\n width: number\r\n height: number\r\n}): ZRRectLike {\r\n // Set rect to center, keep width / height ratio.\r\n const aspect = boundingRect.width / boundingRect.height;\r\n let width = rect.height * aspect;\r\n let height;\r\n if (width <= rect.width) {\r\n height = rect.height;\r\n }\r\n else {\r\n width = rect.width;\r\n height = width / aspect;\r\n }\r\n const cx = rect.x + rect.width / 2;\r\n const cy = rect.y + rect.height / 2;\r\n\r\n return {\r\n x: cx - width / 2,\r\n y: cy - height / 2,\r\n width: width,\r\n height: height\r\n };\r\n}\r\n\r\nexport const mergePath = pathTool.mergePath;\r\n\r\n/**\r\n * Resize a path to fit the rect\r\n * @param path\r\n * @param rect\r\n */\r\nexport function resizePath(path: SVGPath, rect: ZRRectLike): void {\r\n if (!path.applyTransform) {\r\n return;\r\n }\r\n\r\n const pathRect = path.getBoundingRect();\r\n\r\n const m = pathRect.calculateTransform(rect);\r\n\r\n path.applyTransform(m);\r\n}\r\n\r\n/**\r\n * Sub pixel optimize line for canvas\r\n */\r\nexport function subPixelOptimizeLine(\r\n shape: {\r\n x1: number, y1: number, x2: number, y2: number\r\n },\r\n lineWidth: number\r\n) {\r\n subPixelOptimizeUtil.subPixelOptimizeLine(shape, shape, {lineWidth});\r\n return shape;\r\n}\r\n\r\n/**\r\n * Sub pixel optimize rect for canvas\r\n */\r\nexport function subPixelOptimizeRect(param: {\r\n shape: {\r\n x: number, y: number, width: number, height: number\r\n },\r\n style: {\r\n lineWidth: number\r\n }\r\n}) {\r\n subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style);\r\n return param;\r\n}\r\n\r\n/**\r\n * Sub pixel optimize for canvas\r\n *\r\n * @param position Coordinate, such as x, y\r\n * @param lineWidth Should be nonnegative integer.\r\n * @param positiveOrNegative Default false (negative).\r\n * @return Optimized position.\r\n */\r\nexport const subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;\r\n\r\n\r\n/**\r\n * Get transform matrix of target (param target),\r\n * in coordinate of its ancestor (param ancestor)\r\n *\r\n * @param target\r\n * @param [ancestor]\r\n */\r\nexport function getTransform(target: Transformable, ancestor?: Transformable): matrix.MatrixArray {\r\n const mat = matrix.identity([]);\r\n\r\n while (target && target !== ancestor) {\r\n matrix.mul(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n\r\n return mat;\r\n}\r\n\r\n/**\r\n * Apply transform to an vertex.\r\n * @param target [x, y]\r\n * @param transform Can be:\r\n * + Transform matrix: like [1, 0, 0, 1, 0, 0]\r\n * + {position, rotation, scale}, the same as `zrender/Transformable`.\r\n * @param invert Whether use invert matrix.\r\n * @return [x, y]\r\n */\r\nexport function applyTransform(\r\n target: vector.VectorArray,\r\n transform: Transformable | matrix.MatrixArray,\r\n invert?: boolean\r\n): number[] {\r\n if (transform && !isArrayLike(transform)) {\r\n transform = Transformable.getLocalTransform(transform);\r\n }\r\n\r\n if (invert) {\r\n transform = matrix.invert([], transform as matrix.MatrixArray);\r\n }\r\n return vector.applyTransform([], target, transform as matrix.MatrixArray);\r\n}\r\n\r\n/**\r\n * @param direction 'left' 'right' 'top' 'bottom'\r\n * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]\r\n * @param invert Whether use invert matrix.\r\n * @return Transformed direction. 'left' 'right' 'top' 'bottom'\r\n */\r\nexport function transformDirection(\r\n direction: 'left' | 'right' | 'top' | 'bottom',\r\n transform: matrix.MatrixArray,\r\n invert?: boolean\r\n): 'left' | 'right' | 'top' | 'bottom' {\r\n\r\n // Pick a base, ensure that transform result will not be (0, 0).\r\n const hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[0]);\r\n const vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)\r\n ? 1 : Math.abs(2 * transform[4] / transform[2]);\r\n\r\n let vertex: vector.VectorArray = [\r\n direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,\r\n direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0\r\n ];\r\n\r\n vertex = applyTransform(vertex, transform, invert);\r\n\r\n return Math.abs(vertex[0]) > Math.abs(vertex[1])\r\n ? (vertex[0] > 0 ? 'right' : 'left')\r\n : (vertex[1] > 0 ? 'bottom' : 'top');\r\n}\r\n\r\nfunction isNotGroup(el: Element): el is Displayable {\r\n return !el.isGroup;\r\n}\r\nfunction isPath(el: Displayable): el is Path {\r\n return (el as Path).shape != null;\r\n}\r\n/**\r\n * Apply group transition animation from g1 to g2.\r\n * If no animatableModel, no animation.\r\n */\r\nexport function groupTransition(\r\n g1: Group,\r\n g2: Group,\r\n animatableModel: Model\r\n) {\r\n if (!g1 || !g2) {\r\n return;\r\n }\r\n\r\n function getElMap(g: Group) {\r\n const elMap: Dictionary = {};\r\n g.traverse(function (el: Element) {\r\n if (isNotGroup(el) && el.anid) {\r\n elMap[el.anid] = el;\r\n }\r\n });\r\n return elMap;\r\n }\r\n function getAnimatableProps(el: Displayable) {\r\n const obj: PathProps = {\r\n x: el.x,\r\n y: el.y,\r\n rotation: el.rotation\r\n };\r\n if (isPath(el)) {\r\n obj.shape = extend({}, el.shape);\r\n }\r\n return obj;\r\n }\r\n const elMap1 = getElMap(g1);\r\n\r\n g2.traverse(function (el) {\r\n if (isNotGroup(el) && el.anid) {\r\n const oldEl = elMap1[el.anid];\r\n if (oldEl) {\r\n const newProp = getAnimatableProps(el);\r\n el.attr(getAnimatableProps(oldEl));\r\n updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\r\n }\r\n }\r\n });\r\n}\r\n\r\nexport function clipPointsByRect(points: vector.VectorArray[], rect: ZRRectLike): number[][] {\r\n // FIXME: This way might be incorrect when graphic clipped by a corner\r\n // and when element has a border.\r\n return map(points, function (point) {\r\n let x = point[0];\r\n x = mathMax(x, rect.x);\r\n x = mathMin(x, rect.x + rect.width);\r\n let y = point[1];\r\n y = mathMax(y, rect.y);\r\n y = mathMin(y, rect.y + rect.height);\r\n return [x, y];\r\n });\r\n}\r\n\r\n/**\r\n * Return a new clipped rect. If rect size are negative, return undefined.\r\n */\r\nexport function clipRectByRect(targetRect: ZRRectLike, rect: ZRRectLike): ZRRectLike | undefined {\r\n const x = mathMax(targetRect.x, rect.x);\r\n const x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width);\r\n const y = mathMax(targetRect.y, rect.y);\r\n const y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height);\r\n\r\n // If the total rect is cliped, nothing, including the border,\r\n // should be painted. So return undefined.\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n };\r\n }\r\n}\r\n\r\nexport function createIcon(\r\n iconStr: string, // Support 'image://' or 'path://' or direct svg path.\r\n opt?: Omit,\r\n rect?: ZRRectLike\r\n): SVGPath | ZRImage {\r\n const innerOpts: DisplayableProps = extend({rectHover: true}, opt);\r\n const style: ZRStyleProps = innerOpts.style = {strokeNoScale: true};\r\n rect = rect || {x: -1, y: -1, width: 2, height: 2};\r\n\r\n if (iconStr) {\r\n return iconStr.indexOf('image://') === 0\r\n ? (\r\n (style as ImageStyleProps).image = iconStr.slice(8),\r\n defaults(style, rect),\r\n new ZRImage(innerOpts)\r\n )\r\n : (\r\n makePath(\r\n iconStr.replace('path://', ''),\r\n innerOpts,\r\n rect,\r\n 'center'\r\n )\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Return `true` if the given line (line `a`) and the given polygon\r\n * are intersect.\r\n * Note that we do not count colinear as intersect here because no\r\n * requirement for that. We could do that if required in future.\r\n */\r\nexport function linePolygonIntersect(\r\n a1x: number, a1y: number, a2x: number, a2y: number,\r\n points: vector.VectorArray[]\r\n): boolean {\r\n for (let i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\r\n const p = points[i];\r\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\r\n return true;\r\n }\r\n p2 = p;\r\n }\r\n}\r\n\r\n/**\r\n * Return `true` if the given two lines (line `a` and line `b`)\r\n * are intersect.\r\n * Note that we do not count colinear as intersect here because no\r\n * requirement for that. We could do that if required in future.\r\n */\r\nexport function lineLineIntersect(\r\n a1x: number, a1y: number, a2x: number, a2y: number,\r\n b1x: number, b1y: number, b2x: number, b2y: number\r\n): boolean {\r\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\r\n const mx = a2x - a1x;\r\n const my = a2y - a1y;\r\n const nx = b2x - b1x;\r\n const ny = b2y - b1y;\r\n\r\n // `vec_m` and `vec_n` are parallel iff\r\n // existing `k` such that `vec_m = k \u00B7 vec_n`, equivalent to `vec_m X vec_n = 0`.\r\n const nmCrossProduct = crossProduct2d(nx, ny, mx, my);\r\n if (nearZero(nmCrossProduct)) {\r\n return false;\r\n }\r\n\r\n // `vec_m` and `vec_n` are intersect iff\r\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\r\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\r\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\r\n const b1a1x = a1x - b1x;\r\n const b1a1y = a1y - b1y;\r\n const q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\r\n if (q < 0 || q > 1) {\r\n return false;\r\n }\r\n const p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\r\n if (p < 0 || p > 1) {\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n\r\n/**\r\n * Cross product of 2-dimension vector.\r\n */\r\nfunction crossProduct2d(x1: number, y1: number, x2: number, y2: number) {\r\n return x1 * y2 - x2 * y1;\r\n}\r\n\r\nfunction nearZero(val: number) {\r\n return val <= (1e-6) && val >= -(1e-6);\r\n}\r\n\r\n\r\nexport function setTooltipConfig(opt: {\r\n el: Element,\r\n componentModel: ComponentModel,\r\n itemName: string,\r\n itemTooltipOption?: string | CommonTooltipOption\r\n formatterParamsExtra?: Dictionary\r\n}): void {\r\n const itemTooltipOption = opt.itemTooltipOption;\r\n const componentModel = opt.componentModel;\r\n const itemName = opt.itemName;\r\n\r\n const itemTooltipOptionObj = isString(itemTooltipOption)\r\n ? { formatter: itemTooltipOption }\r\n : itemTooltipOption;\r\n const mainType = componentModel.mainType;\r\n const componentIndex = componentModel.componentIndex;\r\n\r\n const formatterParams = {\r\n componentType: mainType,\r\n name: itemName,\r\n $vars: ['name']\r\n } as ComponentItemTooltipLabelFormatterParams;\r\n (formatterParams as any)[mainType + 'Index'] = componentIndex;\r\n\r\n const formatterParamsExtra = opt.formatterParamsExtra;\r\n if (formatterParamsExtra) {\r\n each(keys(formatterParamsExtra), key => {\r\n if (!hasOwn(formatterParams, key)) {\r\n formatterParams[key] = formatterParamsExtra[key];\r\n formatterParams.$vars.push(key);\r\n }\r\n });\r\n }\r\n\r\n const ecData = getECData(opt.el);\r\n ecData.componentMainType = mainType;\r\n ecData.componentIndex = componentIndex;\r\n ecData.tooltipConfig = {\r\n name: itemName,\r\n option: defaults({\r\n content: itemName,\r\n encodeHTMLContent: true,\r\n formatterParams: formatterParams\r\n }, itemTooltipOptionObj)\r\n };\r\n}\r\n\r\nfunction traverseElement(el: Element, cb: (el: Element) => boolean | void) {\r\n let stopped;\r\n // TODO\r\n // Polyfill for fixing zrender group traverse don't visit it's root issue.\r\n if (el.isGroup) {\r\n stopped = cb(el);\r\n }\r\n if (!stopped) {\r\n el.traverse(cb);\r\n }\r\n}\r\n\r\nexport function traverseElements(els: Element | Element[] | undefined | null, cb: (el: Element) => boolean | void) {\r\n if (els) {\r\n if (isArray(els)) {\r\n for (let i = 0; i < els.length; i++) {\r\n traverseElement(els[i], cb);\r\n }\r\n }\r\n else {\r\n traverseElement(els, cb);\r\n }\r\n }\r\n}\r\n\r\n// Register built-in shapes. These shapes might be overwritten\r\n// by users, although we do not recommend that.\r\nregisterShape('circle', Circle);\r\nregisterShape('ellipse', Ellipse);\r\nregisterShape('sector', Sector);\r\nregisterShape('ring', Ring);\r\nregisterShape('polygon', Polygon);\r\nregisterShape('polyline', Polyline);\r\nregisterShape('rect', Rect);\r\nregisterShape('line', Line);\r\nregisterShape('bezierCurve', BezierCurve);\r\nregisterShape('arc', Arc);\r\n\r\nexport {\r\n Group,\r\n ZRImage as Image,\r\n ZRText as Text,\r\n Circle,\r\n Ellipse,\r\n Sector,\r\n Ring,\r\n Polygon,\r\n Polyline,\r\n Rect,\r\n Line,\r\n BezierCurve,\r\n Arc,\r\n IncrementalDisplayable,\r\n CompoundPath,\r\n LinearGradient,\r\n RadialGradient,\r\n BoundingRect,\r\n OrientedBoundingRect,\r\n Point,\r\n Path\r\n};\r\n", "import PathProxy from '../core/PathProxy';\nimport {applyTransform as v2ApplyTransform, VectorArray} from '../core/vector';\nimport { MatrixArray } from '../core/matrix';\n\nconst CMD = PathProxy.CMD;\n\nconst points: VectorArray[] = [[], [], []];\nconst mathSqrt = Math.sqrt;\nconst mathAtan2 = Math.atan2;\n\nexport default function transformPath(path: PathProxy, m: MatrixArray) {\n if (!m) {\n return;\n }\n\n let data = path.data;\n const len = path.len();\n let cmd;\n let nPoint: number;\n let i: number;\n let j: number;\n let k: number;\n let p: VectorArray;\n\n const M = CMD.M;\n const C = CMD.C;\n const L = CMD.L;\n const R = CMD.R;\n const A = CMD.A;\n const Q = CMD.Q;\n\n for (i = 0, j = 0; i < len;) {\n cmd = data[i++];\n j = i;\n nPoint = 0;\n\n switch (cmd) {\n case M:\n nPoint = 1;\n break;\n case L:\n nPoint = 1;\n break;\n case C:\n nPoint = 3;\n break;\n case Q:\n nPoint = 2;\n break;\n case A:\n const x = m[4];\n const y = m[5];\n const sx = mathSqrt(m[0] * m[0] + m[1] * m[1]);\n const sy = mathSqrt(m[2] * m[2] + m[3] * m[3]);\n const angle = mathAtan2(-m[1] / sy, m[0] / sx);\n // cx\n data[i] *= sx;\n data[i++] += x;\n // cy\n data[i] *= sy;\n data[i++] += y;\n // Scale rx and ry\n // FIXME Assume psi is 0 here\n data[i++] *= sx;\n data[i++] *= sy;\n\n // Start angle\n data[i++] += angle;\n // end angle\n data[i++] += angle;\n // FIXME psi\n i += 2;\n j = i;\n break;\n case R:\n // x0, y0\n p[0] = data[i++];\n p[1] = data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n // x1, y1\n p[0] += data[i++];\n p[1] += data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n }\n\n for (k = 0; k < nPoint; k++) {\n let p = points[k];\n p[0] = data[i++];\n p[1] = data[i++];\n\n v2ApplyTransform(p, p, m);\n // Write back\n data[j++] = p[0];\n data[j++] = p[1];\n }\n }\n\n path.increaseVersion();\n}\n", "import Path, { PathProps } from '../graphic/Path';\nimport PathProxy from '../core/PathProxy';\nimport transformPath from './transformPath';\nimport { VectorArray } from '../core/vector';\nimport { MatrixArray } from '../core/matrix';\nimport { extend } from '../core/util';\n\n// command chars\n// const cc = [\n// 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z',\n// 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A'\n// ];\n\nconst mathSqrt = Math.sqrt;\nconst mathSin = Math.sin;\nconst mathCos = Math.cos;\nconst PI = Math.PI;\n\nfunction vMag(v: VectorArray): number {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n};\nfunction vRatio(u: VectorArray, v: VectorArray): number {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n};\nfunction vAngle(u: VectorArray, v: VectorArray): number {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\n * Math.acos(vRatio(u, v));\n};\n\nfunction processArc(\n x1: number, y1: number, x2: number, y2: number, fa: number, fs: number,\n rx: number, ry: number, psiDeg: number, cmd: number, path: PathProxy\n) {\n // https://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n const psi = psiDeg * (PI / 180.0);\n const xp = mathCos(psi) * (x1 - x2) / 2.0\n + mathSin(psi) * (y1 - y2) / 2.0;\n const yp = -1 * mathSin(psi) * (x1 - x2) / 2.0\n + mathCos(psi) * (y1 - y2) / 2.0;\n\n const lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n\n const f = (fa === fs ? -1 : 1)\n * mathSqrt((((rx * rx) * (ry * ry))\n - ((rx * rx) * (yp * yp))\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\n + (ry * ry) * (xp * xp))\n ) || 0;\n\n const cxp = f * rx * yp / ry;\n const cyp = f * -ry * xp / rx;\n\n const cx = (x1 + x2) / 2.0\n + mathCos(psi) * cxp\n - mathSin(psi) * cyp;\n const cy = (y1 + y2) / 2.0\n + mathSin(psi) * cxp\n + mathCos(psi) * cyp;\n\n const theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]);\n const u = [ (xp - cxp) / rx, (yp - cyp) / ry ];\n const v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ];\n let dTheta = vAngle(u, v);\n\n if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n\n if (dTheta < 0) {\n const n = Math.round(dTheta / PI * 1e6) / 1e6;\n // Convert to positive\n dTheta = PI * 2 + (n % 2) * PI;\n }\n\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\n\n\nconst commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\n// Consider case:\n// (1) delimiter can be comma or space, where continuous commas\n// or spaces should be seen as one comma.\n// (2) value can be like:\n// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983',\n// 'l-.5E1,54', '121-23-44-11' (no delimiter)\nconst numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\n// const valueSplitReg = /[\\s,]+/;\n\nfunction createPathProxyFromString(data: string) {\n const path = new PathProxy();\n\n if (!data) {\n return path;\n }\n\n // const data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n\n // const n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n\n // data = data.replace(/-/g, ',-');\n\n // create array\n // const arr = cs.split('|');\n // init context point\n let cpx = 0;\n let cpy = 0;\n let subpathX = cpx;\n let subpathY = cpy;\n let prevCmd;\n\n const CMD = PathProxy.CMD;\n\n // commandReg.lastIndex = 0;\n // const cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // const cmdStr = cmdResult[1];\n // const cmdContent = cmdResult[2];\n\n const cmdList = data.match(commandReg);\n if (!cmdList) {\n // Invalid svg path.\n return path;\n }\n\n for (let l = 0; l < cmdList.length; l++) {\n const cmdText = cmdList[l];\n let cmdStr = cmdText.charAt(0);\n\n let cmd;\n\n // String#split is faster a little bit than String#replace or RegExp#exec.\n // const p = cmdContent.split(valueSplitReg);\n // const pLen = 0;\n // for (let i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // const val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n\n // Following code will convert string to number. So convert type to number here\n const p = cmdText.match(numberReg) as any[] as number[] || [];\n const pLen = p.length;\n for (let i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i] as any as string);\n }\n\n let off = 0;\n while (off < pLen) {\n let ctlPtx;\n let ctlPty;\n\n let rx;\n let ry;\n let psi;\n let fa;\n let fs;\n\n let x1 = cpx;\n let y1 = cpy;\n\n let len: number;\n let pathData: number[] | Float32Array;\n // convert l, H, h, V, and v to L\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'C':\n cmd = CMD.C;\n path.addData(\n cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]\n );\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n case 'c':\n cmd = CMD.C;\n path.addData(\n cmd,\n p[off++] + cpx, p[off++] + cpy,\n p[off++] + cpx, p[off++] + cpy,\n p[off++] + cpx, p[off++] + cpy\n );\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(\n x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path\n );\n break;\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(\n x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path\n );\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd);\n // z may be in the middle of the path.\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n\n return path;\n}\n\ntype SVGPathOption = Omit\ninterface InnerSVGPathOption extends PathProps {\n applyTransform?: (m: MatrixArray) => void\n}\nclass SVGPath extends Path {\n applyTransform(m: MatrixArray) {}\n}\n\nfunction isPathProxy(path: PathProxy | CanvasRenderingContext2D): path is PathProxy {\n return (path as PathProxy).setData != null;\n}\n// TODO Optimize double memory cost problem\nfunction createPathOptions(str: string, opts: SVGPathOption): InnerSVGPathOption {\n const pathProxy = createPathProxyFromString(str);\n const innerOpts: InnerSVGPathOption = extend({}, opts);\n innerOpts.buildPath = function (path: PathProxy | CanvasRenderingContext2D) {\n if (isPathProxy(path)) {\n path.appendPath(pathProxy);\n // Svg and vml renderer don't have context\n const ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n else {\n const ctx = path;\n pathProxy.rebuildPath(ctx, 1);\n }\n };\n\n innerOpts.applyTransform = function (this: SVGPath, m: MatrixArray) {\n transformPath(pathProxy, m);\n this.dirtyShape();\n };\n\n return innerOpts;\n}\n\n/**\n * Create a Path object from path string data\n * http://www.w3.org/TR/SVG/paths.html#PathData\n * @param opts Other options\n */\nexport function createFromString(str: string, opts?: SVGPathOption): SVGPath {\n // PENDING\n return new SVGPath(createPathOptions(str, opts));\n}\n\n/**\n * Create a Path class from path string data\n * @param str\n * @param opts Other options\n */\nexport function extendFromString(str: string, defaultOpts?: SVGPathOption): typeof SVGPath {\n const innerOpts = createPathOptions(str, defaultOpts);\n class Sub extends SVGPath {\n constructor(opts: InnerSVGPathOption) {\n super(opts);\n this.applyTransform = innerOpts.applyTransform;\n this.buildPath = innerOpts.buildPath;\n }\n }\n return Sub;\n}\n\n/**\n * Merge multiple paths\n */\n// TODO Apply transform\n// TODO stroke dash\n// TODO Optimize double memory cost problem\nexport function mergePath(pathEls: Path[], opts: PathProps) {\n const pathList: PathProxy[] = [];\n const len = pathEls.length;\n for (let i = 0; i < len; i++) {\n const pathEl = pathEls[i];\n pathList.push(pathEl.getUpdatedPathProxy(true));\n }\n\n const pathBundle = new Path(opts);\n // Need path proxy.\n pathBundle.createPathProxy();\n pathBundle.buildPath = function (path: PathProxy | CanvasRenderingContext2D) {\n if (isPathProxy(path)) {\n path.appendPath(pathList);\n // Svg and vml renderer don't have context\n const ctx = path.getContext();\n if (ctx) {\n // Path bundle not support percent draw.\n path.rebuildPath(ctx, 1);\n }\n }\n };\n\n return pathBundle;\n}\n\n/**\n * Clone a path.\n */\nexport function clonePath(sourcePath: Path, opts?: {\n /**\n * If bake global transform to path.\n */\n bakeTransform?: boolean\n /**\n * Convert global transform to local.\n */\n toLocal?: boolean\n}) {\n opts = opts || {};\n const path = new Path();\n if (sourcePath.shape) {\n path.setShape(sourcePath.shape);\n }\n path.setStyle(sourcePath.style);\n\n if (opts.bakeTransform) {\n transformPath(path.path, sourcePath.getComputedTransform());\n }\n else {\n // TODO Copy getLocalTransform, updateTransform since they can be changed.\n if (opts.toLocal) {\n path.setLocalTransform(sourcePath.getComputedTransform());\n }\n else {\n path.copyTransform(sourcePath);\n }\n }\n\n // These methods may be overridden\n path.buildPath = sourcePath.buildPath;\n (path as SVGPath).applyTransform = (path as SVGPath).applyTransform;\n\n path.z = sourcePath.z;\n path.z2 = sourcePath.z2;\n path.zlevel = sourcePath.zlevel;\n\n return path;\n}\n", "/**\n * \u5706\u5F62\n */\n\nimport Path, { PathProps } from '../Path';\n\nexport class CircleShape {\n cx = 0\n cy = 0\n r = 0\n}\n\nexport interface CircleProps extends PathProps {\n shape?: Partial\n}\nclass Circle extends Path {\n\n shape: CircleShape\n\n constructor(opts?: CircleProps) {\n super(opts);\n }\n\n getDefaultShape() {\n return new CircleShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: CircleShape) {\n // Use moveTo to start a new sub path.\n // Or it will be connected to other subpaths when in CompoundPath\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\n }\n};\n\nCircle.prototype.type = 'circle';\n\nexport default Circle;", "/**\n * \u692D\u5706\u5F62\u72B6\n */\n\nimport Path, { PathProps } from '../Path';\n\nexport class EllipseShape {\n cx = 0\n cy = 0\n rx = 0\n ry = 0\n}\n\nexport interface EllipseProps extends PathProps {\n shape?: Partial\n}\nclass Ellipse extends Path {\n\n shape: EllipseShape\n\n constructor(opts?: EllipseProps) {\n super(opts);\n }\n\n getDefaultShape() {\n return new EllipseShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: EllipseShape) {\n const k = 0.5522848;\n const x = shape.cx;\n const y = shape.cy;\n const a = shape.rx;\n const b = shape.ry;\n const ox = a * k; // \u6C34\u5E73\u63A7\u5236\u70B9\u504F\u79FB\u91CF\n const oy = b * k; // \u5782\u76F4\u63A7\u5236\u70B9\u504F\u79FB\u91CF\n // \u4ECE\u692D\u5706\u7684\u5DE6\u7AEF\u70B9\u5F00\u59CB\u987A\u65F6\u9488\u7ED8\u5236\u56DB\u6761\u4E09\u6B21\u8D1D\u585E\u5C14\u66F2\u7EBF\n ctx.moveTo(x - a, y);\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n ctx.closePath();\n }\n}\n\nEllipse.prototype.type = 'ellipse';\n\nexport default Ellipse;", "import PathProxy from '../../core/PathProxy';\nimport { isArray } from '../../core/util';\n\nconst PI = Math.PI;\nconst PI2 = PI * 2;\nconst mathSin = Math.sin;\nconst mathCos = Math.cos;\nconst mathACos = Math.acos;\nconst mathATan2 = Math.atan2;\nconst mathAbs = Math.abs;\nconst mathSqrt = Math.sqrt;\nconst mathMax = Math.max;\nconst mathMin = Math.min;\nconst e = 1e-4;\n\nfunction intersect(\n x0: number, y0: number,\n x1: number, y1: number,\n x2: number, y2: number,\n x3: number, y3: number\n): [number, number] {\n const dx10 = x1 - x0;\n const dy10 = y1 - y0;\n const dx32 = x3 - x2;\n const dy32 = y3 - y2;\n let t = dy32 * dx10 - dx32 * dy10;\n if (t * t < e) {\n return;\n }\n t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t;\n return [x0 + t * dx10, y0 + t * dy10];\n}\n\n// Compute perpendicular offset line of length rc.\nfunction computeCornerTangents(\n x0: number, y0: number,\n x1: number, y1: number,\n radius: number, cr: number,\n clockwise: boolean\n) {\n const x01 = x0 - x1;\n const y01 = y0 - y1;\n const lo = (clockwise ? cr : -cr) / mathSqrt(x01 * x01 + y01 * y01);\n const ox = lo * y01;\n const oy = -lo * x01;\n const x11 = x0 + ox;\n const y11 = y0 + oy;\n const x10 = x1 + ox;\n const y10 = y1 + oy;\n const x00 = (x11 + x10) / 2;\n const y00 = (y11 + y10) / 2;\n const dx = x10 - x11;\n const dy = y10 - y11;\n const d2 = dx * dx + dy * dy;\n const r = radius - cr;\n const s = x11 * y10 - x10 * y11;\n const d = (dy < 0 ? -1 : 1) * mathSqrt(mathMax(0, r * r * d2 - s * s));\n let cx0 = (s * dy - dx * d) / d2;\n let cy0 = (-s * dx - dy * d) / d2;\n const cx1 = (s * dy + dx * d) / d2;\n const cy1 = (-s * dx + dy * d) / d2;\n const dx0 = cx0 - x00;\n const dy0 = cy0 - y00;\n const dx1 = cx1 - x00;\n const dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points\n // TODO: Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n cx0 = cx1;\n cy0 = cy1;\n }\n\n return {\n cx: cx0,\n cy: cy0,\n x0: -ox,\n y0: -oy,\n x1: cx0 * (radius / r - 1),\n y1: cy0 * (radius / r - 1)\n };\n}\n\n// For compatibility, don't use normalizeCssArray\n// 5 represents [5, 5, 5, 5]\n// [5] represents [5, 5, 0, 0]\n// [5, 10] represents [5, 5, 10, 10]\n// [5, 10, 15] represents [5, 10, 15, 15]\n// [5, 10, 15, 20] represents [5, 10, 15, 20]\nfunction normalizeCornerRadius(cr: number | number[]): number[] {\n let arr: number[];\n if (isArray(cr)) {\n const len = cr.length;\n if (!len) {\n return cr as number[];\n }\n if (len === 1) {\n arr = [cr[0], cr[0], 0, 0];\n }\n else if (len === 2) {\n arr = [cr[0], cr[0], cr[1], cr[1]];\n }\n else if (len === 3) {\n arr = cr.concat(cr[2]);\n }\n else {\n arr = cr;\n }\n }\n else {\n arr = [cr, cr, cr, cr];\n }\n return arr;\n}\n\nexport function buildPath(ctx: CanvasRenderingContext2D | PathProxy, shape: {\n cx: number\n cy: number\n startAngle: number\n endAngle: number\n clockwise?: boolean,\n r?: number,\n r0?: number,\n cornerRadius?: number | number[]\n}) {\n let radius = mathMax(shape.r, 0);\n let innerRadius = mathMax(shape.r0 || 0, 0);\n const hasRadius = radius > 0;\n const hasInnerRadius = innerRadius > 0;\n\n if (!hasRadius && !hasInnerRadius) {\n return;\n }\n\n if (!hasRadius) {\n // use innerRadius as radius if no radius\n radius = innerRadius;\n innerRadius = 0;\n }\n\n if (innerRadius > radius) {\n // swap, ensure that radius is always larger than innerRadius\n const tmp = radius;\n radius = innerRadius;\n innerRadius = tmp;\n }\n\n const { startAngle, endAngle } = shape;\n if (isNaN(startAngle) || isNaN(endAngle)) {\n return;\n }\n\n const { cx, cy } = shape;\n const clockwise = !!shape.clockwise;\n\n let arc = mathAbs(endAngle - startAngle);\n const mod = arc > PI2 && arc % PI2;\n mod > e && (arc = mod);\n\n // is a point\n if (!(radius > e)) {\n ctx.moveTo(cx, cy);\n }\n // is a circle or annulus\n else if (arc > PI2 - e) {\n ctx.moveTo(\n cx + radius * mathCos(startAngle),\n cy + radius * mathSin(startAngle)\n );\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n\n if (innerRadius > e) {\n ctx.moveTo(\n cx + innerRadius * mathCos(endAngle),\n cy + innerRadius * mathSin(endAngle)\n );\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n // is a circular or annular sector\n else {\n let icrStart;\n let icrEnd;\n let ocrStart;\n let ocrEnd;\n\n let ocrs;\n let ocre;\n let icrs;\n let icre;\n\n let ocrMax;\n let icrMax;\n let limitedOcrMax;\n let limitedIcrMax;\n\n let xre;\n let yre;\n let xirs;\n let yirs;\n\n const xrs = radius * mathCos(startAngle);\n const yrs = radius * mathSin(startAngle);\n const xire = innerRadius * mathCos(endAngle);\n const yire = innerRadius * mathSin(endAngle);\n\n const hasArc = arc > e;\n if (hasArc) {\n const cornerRadius = shape.cornerRadius;\n if (cornerRadius) {\n [icrStart, icrEnd, ocrStart, ocrEnd] = normalizeCornerRadius(cornerRadius);\n }\n\n const halfRd = mathAbs(radius - innerRadius) / 2;\n ocrs = mathMin(halfRd, ocrStart);\n ocre = mathMin(halfRd, ocrEnd);\n icrs = mathMin(halfRd, icrStart);\n icre = mathMin(halfRd, icrEnd);\n\n limitedOcrMax = ocrMax = mathMax(ocrs, ocre);\n limitedIcrMax = icrMax = mathMax(icrs, icre);\n\n // draw corner radius\n if (ocrMax > e || icrMax > e) {\n xre = radius * mathCos(endAngle);\n yre = radius * mathSin(endAngle);\n xirs = innerRadius * mathCos(startAngle);\n yirs = innerRadius * mathSin(startAngle);\n\n // restrict the max value of corner radius\n if (arc < PI) {\n const it = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\n if (it) {\n const x0 = xrs - it[0];\n const y0 = yrs - it[1];\n const x1 = xre - it[0];\n const y1 = yre - it[1];\n const a = 1 / mathSin(\n // eslint-disable-next-line max-len\n mathACos((x0 * x1 + y0 * y1) / (mathSqrt(x0 * x0 + y0 * y0) * mathSqrt(x1 * x1 + y1 * y1))) / 2\n );\n const b = mathSqrt(it[0] * it[0] + it[1] * it[1]);\n limitedOcrMax = mathMin(ocrMax, (radius - b) / (a + 1));\n limitedIcrMax = mathMin(icrMax, (innerRadius - b) / (a - 1));\n }\n }\n }\n }\n\n // the sector is collapsed to a line\n if (!hasArc) {\n ctx.moveTo(cx + xrs, cy + yrs);\n }\n // the outer ring has corners\n else if (limitedOcrMax > e) {\n const crStart = mathMin(ocrStart, limitedOcrMax);\n const crEnd = mathMin(ocrEnd, limitedOcrMax);\n const ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise);\n const ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise);\n\n ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n\n // Have the corners merged?\n if (limitedOcrMax < ocrMax && crStart === crEnd) {\n // eslint-disable-next-line max-len\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n else {\n // draw the two corners and the ring\n // eslint-disable-next-line max-len\n crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n // eslint-disable-next-line max-len\n ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise);\n // eslint-disable-next-line max-len\n crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n // the outer ring is a circular arc\n else {\n ctx.moveTo(cx + xrs, cy + yrs);\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n }\n\n // no inner ring, is a circular sector\n if (!(innerRadius > e) || !hasArc) {\n ctx.lineTo(cx + xire, cy + yire);\n }\n // the inner ring has corners\n else if (limitedIcrMax > e) {\n const crStart = mathMin(icrStart, limitedIcrMax);\n const crEnd = mathMin(icrEnd, limitedIcrMax);\n const ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise);\n const ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise);\n ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n\n // Have the corners merged?\n if (limitedIcrMax < icrMax && crStart === crEnd) {\n // eslint-disable-next-line max-len\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n // draw the two corners and the ring\n else {\n // eslint-disable-next-line max-len\n crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n // eslint-disable-next-line max-len\n ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise);\n // eslint-disable-next-line max-len\n crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n // the inner ring is just a circular arc\n else {\n // FIXME: if no lineTo, svg renderer will perform an abnormal drawing behavior.\n ctx.lineTo(cx + xire, cy + yire);\n\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n\n ctx.closePath();\n}\n", "import Path, { PathProps } from '../Path';\nimport * as roundSectorHelper from '../helper/roundSector';\n\nexport class SectorShape {\n cx = 0\n cy = 0\n r0 = 0\n r = 0\n startAngle = 0\n endAngle = Math.PI * 2\n clockwise = true\n /**\n * Corner radius of sector\n *\n * clockwise, from inside to outside, four corners are\n * inner start -> inner end\n * outer start -> outer end\n *\n * 5 => [5, 5, 5, 5]\n * [5] => [5, 5, 0, 0]\n * [5, 10] => [5, 5, 10, 10]\n * [5, 10, 15] => [5, 10, 15, 15]\n * [5, 10, 15, 20] => [5, 10, 15, 20]\n */\n cornerRadius: number | number[] = 0\n}\n\nexport interface SectorProps extends PathProps {\n shape?: Partial\n}\n\nclass Sector extends Path {\n\n shape: SectorShape\n\n constructor(opts?: SectorProps) {\n super(opts);\n }\n\n getDefaultShape() {\n return new SectorShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: SectorShape) {\n roundSectorHelper.buildPath(ctx, shape);\n }\n\n isZeroArea() {\n return this.shape.startAngle === this.shape.endAngle\n || this.shape.r === this.shape.r0;\n }\n}\n\nSector.prototype.type = 'sector';\n\nexport default Sector;\n", "/**\n * \u5706\u73AF\n */\n\nimport Path, { PathProps } from '../Path';\n\nexport class RingShape {\n cx = 0\n cy = 0\n r = 0\n r0 = 0\n}\n\nexport interface RingProps extends PathProps {\n shape?: Partial\n}\nclass Ring extends Path {\n\n shape: RingShape\n\n constructor(opts?: RingProps) {\n super(opts);\n }\n\n getDefaultShape() {\n return new RingShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: RingShape) {\n const x = shape.cx;\n const y = shape.cy;\n const PI2 = Math.PI * 2;\n ctx.moveTo(x + shape.r, y);\n ctx.arc(x, y, shape.r, 0, PI2, false);\n ctx.moveTo(x + shape.r0, y);\n ctx.arc(x, y, shape.r0, 0, PI2, true);\n }\n}\n\nRing.prototype.type = 'ring';\nexport default Ring;", "/**\n * \u8D1D\u585E\u5C14\u5E73\u6ED1\u66F2\u7EBF\n */\n\nimport {\n min as v2Min,\n max as v2Max,\n scale as v2Scale,\n distance as v2Distance,\n add as v2Add,\n clone as v2Clone,\n sub as v2Sub,\n VectorArray\n} from '../../core/vector';\n\n/**\n * \u8D1D\u585E\u5C14\u5E73\u6ED1\u66F2\u7EBF\n * @param points \u7EBF\u6BB5\u9876\u70B9\u6570\u7EC4\n * @param smooth \u5E73\u6ED1\u7B49\u7EA7, 0-1\n * @param isLoop\n * @param constraint \u5C06\u8BA1\u7B97\u51FA\u6765\u7684\u63A7\u5236\u70B9\u7EA6\u675F\u5728\u4E00\u4E2A\u5305\u56F4\u76D2\u5185\n * \u6BD4\u5982 [[0, 0], [100, 100]], \u8FD9\u4E2A\u5305\u56F4\u76D2\u4F1A\u4E0E\n * \u6574\u4E2A\u6298\u7EBF\u7684\u5305\u56F4\u76D2\u505A\u4E00\u4E2A\u5E76\u96C6\u7528\u6765\u7EA6\u675F\u63A7\u5236\u70B9\u3002\n * @param \u8BA1\u7B97\u51FA\u6765\u7684\u63A7\u5236\u70B9\u6570\u7EC4\n */\nexport default function smoothBezier(\n points: VectorArray[],\n smooth?: number,\n isLoop?: boolean,\n constraint?: VectorArray[]\n) {\n const cps = [];\n\n const v: VectorArray = [];\n const v1: VectorArray = [];\n const v2: VectorArray = [];\n let prevPoint;\n let nextPoint;\n\n let min;\n let max;\n if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\n for (let i = 0, len = points.length; i < len; i++) {\n v2Min(min, min, points[i]);\n v2Max(max, max, points[i]);\n }\n // \u4E0E\u6307\u5B9A\u7684\u5305\u56F4\u76D2\u505A\u5E76\u96C6\n v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n\n for (let i = 0, len = points.length; i < len; i++) {\n const point = points[i];\n\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n }\n else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n }\n else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n\n v2Sub(v, nextPoint, prevPoint);\n\n // use degree to scale the handle length\n v2Scale(v, v, smooth);\n\n let d0 = v2Distance(point, prevPoint);\n let d1 = v2Distance(point, nextPoint);\n const sum = d0 + d1;\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n const cp0 = v2Add([], point, v1);\n const cp1 = v2Add([], point, v2);\n if (constraint) {\n v2Max(cp0, cp0, min);\n v2Min(cp0, cp0, max);\n v2Max(cp1, cp1, min);\n v2Min(cp1, cp1, max);\n }\n cps.push(cp0);\n cps.push(cp1);\n }\n\n if (isLoop) {\n cps.push(cps.shift());\n }\n\n return cps;\n}", "\nimport smoothBezier from './smoothBezier';\nimport { VectorArray } from '../../core/vector';\nimport PathProxy from '../../core/PathProxy';\n\nexport function buildPath(\n ctx: CanvasRenderingContext2D | PathProxy,\n shape: {\n points: VectorArray[],\n smooth?: number\n smoothConstraint?: VectorArray[]\n },\n closePath: boolean\n) {\n const smooth = shape.smooth;\n let points = shape.points;\n if (points && points.length >= 2) {\n if (smooth) {\n const controlPoints = smoothBezier(\n points, smooth, closePath, shape.smoothConstraint\n );\n\n ctx.moveTo(points[0][0], points[0][1]);\n const len = points.length;\n for (let i = 0; i < (closePath ? len : len - 1); i++) {\n const cp1 = controlPoints[i * 2];\n const cp2 = controlPoints[i * 2 + 1];\n const p = points[(i + 1) % len];\n ctx.bezierCurveTo(\n cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]\n );\n }\n }\n else {\n ctx.moveTo(points[0][0], points[0][1]);\n for (let i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n\n closePath && ctx.closePath();\n }\n}\n", "/**\n * \u591A\u8FB9\u5F62\n * @module zrender/shape/Polygon\n */\n\nimport Path, { PathProps } from '../Path';\nimport * as polyHelper from '../helper/poly';\nimport { VectorArray } from '../../core/vector';\n\nexport class PolygonShape {\n points: VectorArray[] = null\n smooth?: number = 0\n smoothConstraint?: VectorArray[] = null\n}\n\nexport interface PolygonProps extends PathProps {\n shape?: Partial\n}\nclass Polygon extends Path {\n\n shape: PolygonShape\n\n constructor(opts?: PolygonProps) {\n super(opts);\n }\n\n getDefaultShape() {\n return new PolygonShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: PolygonShape) {\n polyHelper.buildPath(ctx, shape, true);\n }\n};\n\nPolygon.prototype.type = 'polygon';\n\nexport default Polygon;", "/**\n * @module zrender/graphic/shape/Polyline\n */\n\nimport Path, { PathProps } from '../Path';\nimport * as polyHelper from '../helper/poly';\nimport { VectorArray } from '../../core/vector';\n\nexport class PolylineShape {\n points: VectorArray[] = null\n // Percent of displayed polyline. For animating purpose\n percent?: number = 1\n smooth?: number = 0\n smoothConstraint?: VectorArray[] = null\n}\n\nexport interface PolylineProps extends PathProps {\n shape?: Partial\n}\nclass Polyline extends Path {\n\n shape: PolylineShape\n\n constructor(opts?: PolylineProps) {\n super(opts);\n }\n\n getDefaultStyle() {\n return {\n stroke: '#000',\n fill: null as string\n };\n }\n\n getDefaultShape() {\n return new PolylineShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: PolylineShape) {\n polyHelper.buildPath(ctx, shape, false);\n }\n}\n\nPolyline.prototype.type = 'polyline';\nexport default Polyline;", "/**\n * \u76F4\u7EBF\n * @module zrender/graphic/shape/Line\n */\n\nimport Path, { PathProps } from '../Path';\nimport {subPixelOptimizeLine} from '../helper/subPixelOptimize';\nimport { VectorArray } from '../../core/vector';\n\n// Avoid create repeatly.\nconst subPixelOptimizeOutputShape = {};\n\nexport class LineShape {\n // Start point\n x1 = 0\n y1 = 0\n // End point\n x2 = 0\n y2 = 0\n\n percent = 1\n}\n\nexport interface LineProps extends PathProps {\n shape?: Partial\n}\nclass Line extends Path {\n\n shape: LineShape\n\n constructor(opts?: LineProps) {\n super(opts);\n }\n\n getDefaultStyle() {\n return {\n stroke: '#000',\n fill: null as string\n };\n }\n\n getDefaultShape() {\n return new LineShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: LineShape) {\n let x1;\n let y1;\n let x2;\n let y2;\n\n if (this.subPixelOptimize) {\n const optimizedShape = subPixelOptimizeLine(\n subPixelOptimizeOutputShape, shape, this.style\n );\n x1 = optimizedShape.x1;\n y1 = optimizedShape.y1;\n x2 = optimizedShape.x2;\n y2 = optimizedShape.y2;\n }\n else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n\n const percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n ctx.lineTo(x2, y2);\n }\n\n /**\n * Get point at percent\n */\n pointAt(p: number): VectorArray {\n const shape = this.shape;\n return [\n shape.x1 * (1 - p) + shape.x2 * p,\n shape.y1 * (1 - p) + shape.y2 * p\n ];\n }\n}\n\nLine.prototype.type = 'line';\nexport default Line;", "/**\n * \u8D1D\u585E\u5C14\u66F2\u7EBF\n */\n\nimport Path, { PathProps } from '../Path';\nimport * as vec2 from '../../core/vector';\nimport {\n quadraticSubdivide,\n cubicSubdivide,\n quadraticAt,\n cubicAt,\n quadraticDerivativeAt,\n cubicDerivativeAt\n} from '../../core/curve';\n\nconst out: number[] = [];\n\nexport class BezierCurveShape {\n x1 = 0\n y1 = 0\n x2 = 0\n y2 = 0\n cpx1 = 0\n cpy1 = 0\n cpx2?: number\n cpy2?: number\n // Curve show percent, for animating\n percent = 1\n}\n\nfunction someVectorAt(shape: BezierCurveShape, t: number, isTangent: boolean) {\n const cpx2 = shape.cpx2;\n const cpy2 = shape.cpy2;\n if (cpx2 != null || cpy2 != null) {\n return [\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\n ];\n }\n else {\n return [\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\n ];\n }\n}\n\nexport interface BezierCurveProps extends PathProps {\n shape?: Partial\n}\nclass BezierCurve extends Path {\n\n shape: BezierCurveShape\n\n constructor(opts?: BezierCurveProps) {\n super(opts);\n }\n\n getDefaultStyle() {\n return {\n stroke: '#000',\n fill: null as string\n };\n }\n\n getDefaultShape() {\n return new BezierCurveShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: BezierCurveShape) {\n let x1 = shape.x1;\n let y1 = shape.y1;\n let x2 = shape.x2;\n let y2 = shape.y2;\n let cpx1 = shape.cpx1;\n let cpy1 = shape.cpy1;\n let cpx2 = shape.cpx2;\n let cpy2 = shape.cpy2;\n let percent = shape.percent;\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (cpx2 == null || cpy2 == null) {\n if (percent < 1) {\n quadraticSubdivide(x1, cpx1, x2, percent, out);\n cpx1 = out[1];\n x2 = out[2];\n quadraticSubdivide(y1, cpy1, y2, percent, out);\n cpy1 = out[1];\n y2 = out[2];\n }\n\n ctx.quadraticCurveTo(\n cpx1, cpy1,\n x2, y2\n );\n }\n else {\n if (percent < 1) {\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\n cpx1 = out[1];\n cpx2 = out[2];\n x2 = out[3];\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\n cpy1 = out[1];\n cpy2 = out[2];\n y2 = out[3];\n }\n ctx.bezierCurveTo(\n cpx1, cpy1,\n cpx2, cpy2,\n x2, y2\n );\n }\n }\n\n /**\n * Get point at percent\n */\n pointAt(t: number) {\n return someVectorAt(this.shape, t, false);\n }\n\n /**\n * Get tangent at percent\n */\n tangentAt(t: number) {\n const p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n }\n};\n\nBezierCurve.prototype.type = 'bezier-curve';\n\nexport default BezierCurve;\n", "/**\n * \u5706\u5F27\n */\n\nimport Path, { PathProps } from '../Path';\n\nexport class ArcShape {\n cx = 0;\n cy = 0;\n r = 0;\n startAngle = 0;\n endAngle = Math.PI * 2\n clockwise? = true\n}\n\nexport interface ArcProps extends PathProps {\n shape?: Partial\n}\n\nclass Arc extends Path {\n\n shape: ArcShape\n\n constructor(opts?: ArcProps) {\n super(opts);\n }\n\n getDefaultStyle() {\n return {\n stroke: '#000',\n fill: null as string\n };\n }\n\n getDefaultShape() {\n return new ArcShape();\n }\n\n buildPath(ctx: CanvasRenderingContext2D, shape: ArcShape) {\n\n const x = shape.cx;\n const y = shape.cy;\n const r = Math.max(shape.r, 0);\n const startAngle = shape.startAngle;\n const endAngle = shape.endAngle;\n const clockwise = shape.clockwise;\n\n const unitX = Math.cos(startAngle);\n const unitY = Math.sin(startAngle);\n\n ctx.moveTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n }\n}\n\nArc.prototype.type = 'arc';\n\nexport default Arc;", "// CompoundPath to improve performance\n\nimport Path from './Path';\nimport PathProxy from '../core/PathProxy';\n\nexport interface CompoundPathShape {\n paths: Path[]\n}\n\nexport default class CompoundPath extends Path {\n\n type = 'compound'\n\n shape: CompoundPathShape\n\n private _updatePathDirty() {\n const paths = this.shape.paths;\n let dirtyPath = this.shapeChanged();\n for (let i = 0; i < paths.length; i++) {\n // Mark as dirty if any subpath is dirty\n dirtyPath = dirtyPath || paths[i].shapeChanged();\n }\n if (dirtyPath) {\n this.dirtyShape();\n }\n }\n\n beforeBrush() {\n this._updatePathDirty();\n const paths = this.shape.paths || [];\n const scale = this.getGlobalScale();\n // Update path scale\n for (let i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n }\n }\n\n buildPath(ctx: PathProxy | CanvasRenderingContext2D, shape: CompoundPathShape) {\n const paths = shape.paths || [];\n for (let i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n }\n\n afterBrush() {\n const paths = this.shape.paths || [];\n for (let i = 0; i < paths.length; i++) {\n paths[i].pathUpdated();\n }\n }\n\n getBoundingRect() {\n this._updatePathDirty.call(this);\n return Path.prototype.getBoundingRect.call(this);\n }\n}", "// TODO Should GradientObject been LinearGradientObject | RadialGradientObject\nexport interface GradientObject {\n\n id?: number\n\n type: string\n\n colorStops: GradientColorStop[]\n\n global?: boolean\n}\n\nexport interface InnerGradientObject extends GradientObject {\n __canvasGradient: CanvasGradient\n __width: number\n __height: number\n}\n\nexport interface GradientColorStop {\n offset: number\n color: string\n}\n\nexport default class Gradient {\n\n id?: number\n\n type: string\n\n colorStops: GradientColorStop[]\n\n global: boolean\n\n constructor(colorStops: GradientColorStop[]) {\n this.colorStops = colorStops || [];\n }\n\n addColorStop(offset: number, color: string) {\n this.colorStops.push({\n offset,\n color\n });\n }\n}", "import Gradient, {GradientObject, GradientColorStop} from './Gradient';\n\nexport interface LinearGradientObject extends GradientObject {\n type: 'linear'\n\n x: number\n y: number\n x2: number\n y2: number\n}\n/**\n * x, y, x2, y2 are all percent from 0 to 1 when globalCoord is false\n */\n\nexport default class LinearGradient extends Gradient {\n\n type: 'linear'\n\n x: number\n y: number\n x2: number\n y2: number\n\n constructor(\n x: number, y: number, x2: number, y2: number,\n colorStops?: GradientColorStop[], globalCoord?: boolean\n ) {\n\n super(colorStops);\n\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'linear', colorStops: ...}`, where\n // this constructor will not be called.\n\n this.x = x == null ? 0 : x;\n\n this.y = y == null ? 0 : y;\n\n this.x2 = x2 == null ? 1 : x2;\n\n this.y2 = y2 == null ? 0 : y2;\n\n // Can be cloned\n this.type = 'linear';\n\n // If use global coord\n this.global = globalCoord || false;\n }\n};\n", "import Gradient, {GradientColorStop, GradientObject} from './Gradient';\n\nexport interface RadialGradientObject extends GradientObject {\n type: 'radial'\n\n x: number\n y: number\n r: number\n}\n/**\n * x, y, r are all percent from 0 to 1 when globalCoord is false\n */\nclass RadialGradient extends Gradient {\n\n type: 'radial'\n\n x: number\n y: number\n r: number\n\n constructor(\n x: number, y: number, r: number,\n colorStops?: GradientColorStop[], globalCoord?: boolean\n ) {\n super(colorStops);\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'radial', colorStops: ...}`, where\n // this constructor will not be called.\n this.x = x == null ? 0.5 : x;\n\n this.y = y == null ? 0.5 : y;\n\n this.r = r == null ? 0.5 : r;\n\n // Can be cloned\n this.type = 'radial';\n\n // If use global coord\n this.global = globalCoord || false;\n }\n}\n\nexport default RadialGradient;", "/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nimport Point, { PointLike } from './Point';\nimport BoundingRect from './BoundingRect';\nimport { MatrixArray } from './matrix';\n\nconst extent = [0, 0];\nconst extent2 = [0, 0];\n\nconst minTv = new Point();\nconst maxTv = new Point();\n\nclass OrientedBoundingRect {\n\n // lt, rt, rb, lb\n private _corners: Point[] = [];\n\n private _axes: Point[] = [];\n\n private _origin: number[] = [0, 0];\n\n constructor(rect?: BoundingRect, transform?: MatrixArray) {\n for (let i = 0; i < 4; i++) {\n this._corners[i] = new Point();\n }\n for (let i = 0; i < 2; i++) {\n this._axes[i] = new Point();\n }\n\n if (rect) {\n this.fromBoundingRect(rect, transform);\n }\n }\n\n fromBoundingRect(rect: BoundingRect, transform?: MatrixArray) {\n const corners = this._corners;\n const axes = this._axes;\n const x = rect.x;\n const y = rect.y;\n const x2 = x + rect.width;\n const y2 = y + rect.height;\n corners[0].set(x, y);\n corners[1].set(x2, y);\n corners[2].set(x2, y2);\n corners[3].set(x, y2);\n\n if (transform) {\n for (let i = 0; i < 4; i++) {\n corners[i].transform(transform);\n }\n }\n\n // Calculate axes\n Point.sub(axes[0], corners[1], corners[0]);\n Point.sub(axes[1], corners[3], corners[0]);\n axes[0].normalize();\n axes[1].normalize();\n\n // Calculate projected origin\n for (let i = 0; i < 2; i++) {\n this._origin[i] = axes[i].dot(corners[0]);\n }\n }\n\n /**\n * If intersect with another OBB\n * @param other Bounding rect to be intersected with\n * @param mtv Calculated .\n * If it's not overlapped. it means needs to move given rect with Maximum Translation Vector to be overlapped.\n * Else it means needs to move given rect with Minimum Translation Vector to be not overlapped.\n */\n intersect(other: OrientedBoundingRect, mtv?: PointLike): boolean {\n // OBB collision with SAT method\n\n let overlapped = true;\n const noMtv = !mtv;\n minTv.set(Infinity, Infinity);\n maxTv.set(0, 0);\n // Check two axes for both two obb.\n if (!this._intersectCheckOneSide(this, other, minTv, maxTv, noMtv, 1)) {\n overlapped = false;\n if (noMtv) {\n // Early return if no need to calculate mtv\n return overlapped;\n }\n }\n if (!this._intersectCheckOneSide(other, this, minTv, maxTv, noMtv, -1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n\n if (!noMtv) {\n Point.copy(mtv, overlapped ? minTv : maxTv);\n }\n\n return overlapped;\n }\n\n\n private _intersectCheckOneSide(\n self: OrientedBoundingRect,\n other: OrientedBoundingRect,\n minTv: Point,\n maxTv: Point,\n noMtv: boolean,\n inverse: 1 | -1\n ): boolean {\n let overlapped = true;\n for (let i = 0; i < 2; i++) {\n const axis = this._axes[i];\n this._getProjMinMaxOnAxis(i, self._corners, extent);\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\n\n // Not overlap on the any axis.\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n const dist0 = Math.abs(extent2[0] - extent[1]);\n const dist1 = Math.abs(extent[0] - extent2[1]);\n\n // Find longest distance of all axes.\n if (Math.min(dist0, dist1) > maxTv.len()) {\n if (dist0 < dist1) {\n Point.scale(maxTv, axis, -dist0 * inverse);\n }\n else {\n Point.scale(maxTv, axis, dist1 * inverse);\n }\n }\n }\n else if (minTv) {\n const dist0 = Math.abs(extent2[0] - extent[1]);\n const dist1 = Math.abs(extent[0] - extent2[1]);\n\n if (Math.min(dist0, dist1) < minTv.len()) {\n if (dist0 < dist1) {\n Point.scale(minTv, axis, dist0 * inverse);\n }\n else {\n Point.scale(minTv, axis, -dist1 * inverse);\n }\n }\n }\n }\n return overlapped;\n }\n\n private _getProjMinMaxOnAxis(dim: number, corners: Point[], out: number[]) {\n const axis = this._axes[dim];\n const origin = this._origin;\n const proj = corners[0].dot(axis) + origin[dim];\n let min = proj;\n let max = proj;\n\n for (let i = 1; i < corners.length; i++) {\n const proj = corners[i].dot(axis) + origin[dim];\n min = Math.min(proj, min);\n max = Math.max(proj, max);\n }\n\n out[0] = min;\n out[1] = max;\n }\n}\n\nexport default OrientedBoundingRect;", "/**\n * Displayable for incremental rendering. It will be rendered in a separate layer\n * IncrementalDisplay have two main methods. `clearDisplayables` and `addDisplayables`\n * addDisplayables will render the added displayables incremetally.\n *\n * It use a notClear flag to tell the painter don't clear the layer if it's the first element.\n *\n * It's not available for SVG rendering.\n */\nimport Displayble from './Displayable';\nimport BoundingRect from '../core/BoundingRect';\nimport { MatrixArray } from '../core/matrix';\nimport Group from './Group';\n\nconst m: MatrixArray = [];\n// TODO Style override ?\n\nexport default class IncrementalDisplayable extends Displayble {\n\n notClear: boolean = true\n\n incremental = true\n\n private _displayables: Displayble[] = []\n private _temporaryDisplayables: Displayble[] = []\n\n private _cursor = 0\n\n traverse(\n cb: (this: T, el: this) => void,\n context: T\n ) {\n cb.call(context, this);\n }\n\n useStyle() {\n // Use an empty style\n // PENDING\n this.style = {};\n }\n\n // getCurrentCursor / updateCursorAfterBrush\n // is used in graphic.ts. It's not provided for developers\n getCursor() {\n return this._cursor;\n }\n // Update cursor after brush.\n innerAfterBrush() {\n this._cursor = this._displayables.length;\n }\n\n clearDisplaybles() {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.markRedraw();\n\n this.notClear = false;\n }\n\n clearTemporalDisplayables() {\n this._temporaryDisplayables = [];\n }\n\n addDisplayable(displayable: Displayble, notPersistent?: boolean) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n }\n else {\n this._displayables.push(displayable);\n }\n this.markRedraw();\n }\n\n addDisplayables(displayables: Displayble[], notPersistent?: boolean) {\n notPersistent = notPersistent || false;\n for (let i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n }\n\n getDisplayables(): Displayble[] {\n return this._displayables;\n }\n\n getTemporalDisplayables(): Displayble[] {\n return this._temporaryDisplayables;\n }\n\n eachPendingDisplayable(cb: (displayable: Displayble) => void) {\n for (let i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n for (let i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n }\n\n update() {\n this.updateTransform();\n for (let i = this._cursor; i < this._displayables.length; i++) {\n const displayable = this._displayables[i];\n // PENDING\n displayable.parent = this as unknown as Group;\n displayable.update();\n displayable.parent = null;\n }\n for (let i = 0; i < this._temporaryDisplayables.length; i++) {\n const displayable = this._temporaryDisplayables[i];\n // PENDING\n displayable.parent = this as unknown as Group;\n displayable.update();\n displayable.parent = null;\n }\n }\n\n getBoundingRect() {\n if (!this._rect) {\n const rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n for (let i = 0; i < this._displayables.length; i++) {\n const displayable = this._displayables[i];\n const childRect = displayable.getBoundingRect().clone();\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n rect.union(childRect);\n }\n this._rect = rect;\n }\n return this._rect;\n }\n\n contain(x: number, y: number): boolean {\n const localPos = this.transformCoordToLocal(x, y);\n const rect = this.getBoundingRect();\n\n if (rect.contain(localPos[0], localPos[1])) {\n for (let i = 0; i < this._displayables.length; i++) {\n const displayable = this._displayables[i];\n if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n return false;\n }\n\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Basic transitions in the same series when shapes are the same.\r\n\r\nimport {\r\n AnimationOptionMixin,\r\n AnimationDelayCallbackParam,\r\n PayloadAnimationPart,\r\n AnimationOption\r\n} from '../util/types';\r\nimport { AnimationEasing } from 'zrender/src/animation/easing';\r\nimport Element, { ElementAnimateConfig, ElementProps } from 'zrender/src/Element';\r\nimport Model from '../model/Model';\r\nimport {\r\n isFunction,\r\n isObject,\r\n retrieve2\r\n} from 'zrender/src/core/util';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport { makeInner } from '../util/model';\r\n\r\n// Stored properties for further transition.\r\n\r\nexport const transitionStore = makeInner<{\r\n oldStyle: Displayable['style']\r\n}, Displayable>();\r\n\r\n\r\ntype AnimateOrSetPropsOption = {\r\n dataIndex?: number;\r\n cb?: () => void;\r\n during?: (percent: number) => void;\r\n removeOpt?: AnimationOption\r\n isFrom?: boolean;\r\n};\r\n\r\n/**\r\n * Return null if animation is disabled.\r\n */\r\nexport function getAnimationConfig(\r\n animationType: 'enter' | 'update' | 'leave',\r\n animatableModel: Model,\r\n dataIndex: number,\r\n // Extra opts can override the option in animatable model.\r\n extraOpts?: Pick,\r\n // TODO It's only for pictorial bar now.\r\n extraDelayParams?: unknown\r\n): Pick | null {\r\n let animationPayload: PayloadAnimationPart;\r\n // Check if there is global animation configuration from dataZoom/resize can override the config in option.\r\n // If animation is enabled. Will use this animation config in payload.\r\n // If animation is disabled. Just ignore it.\r\n if (animatableModel && animatableModel.ecModel) {\r\n const updatePayload = animatableModel.ecModel.getUpdatePayload();\r\n animationPayload = (updatePayload && updatePayload.animation) as PayloadAnimationPart;\r\n }\r\n const animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\r\n\r\n const isUpdate = animationType === 'update';\r\n\r\n if (animationEnabled) {\r\n let duration: number | Function;\r\n let easing: AnimationEasing;\r\n let delay: number | Function;\r\n if (extraOpts) {\r\n duration = retrieve2(extraOpts.duration, 200);\r\n easing = retrieve2(extraOpts.easing, 'cubicOut');\r\n delay = 0;\r\n }\r\n else {\r\n duration = animatableModel.getShallow(\r\n isUpdate ? 'animationDurationUpdate' : 'animationDuration'\r\n );\r\n easing = animatableModel.getShallow(\r\n isUpdate ? 'animationEasingUpdate' : 'animationEasing'\r\n );\r\n delay = animatableModel.getShallow(\r\n isUpdate ? 'animationDelayUpdate' : 'animationDelay'\r\n );\r\n }\r\n // animation from payload has highest priority.\r\n if (animationPayload) {\r\n animationPayload.duration != null && (duration = animationPayload.duration);\r\n animationPayload.easing != null && (easing = animationPayload.easing);\r\n animationPayload.delay != null && (delay = animationPayload.delay);\r\n }\r\n if (isFunction(delay)) {\r\n delay = delay(\r\n dataIndex as number,\r\n extraDelayParams\r\n );\r\n }\r\n if (isFunction(duration)) {\r\n duration = duration(dataIndex as number);\r\n }\r\n const config = {\r\n duration: duration as number || 0,\r\n delay: delay as number,\r\n easing\r\n };\r\n\r\n return config;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\r\n\r\nfunction animateOrSetProps(\r\n animationType: 'enter' | 'update' | 'leave',\r\n el: Element,\r\n props: Props,\r\n animatableModel?: Model & {\r\n getAnimationDelayParams?: (el: Element, dataIndex: number) => AnimationDelayCallbackParam\r\n },\r\n dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption,\r\n cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'],\r\n during?: AnimateOrSetPropsOption['during']\r\n) {\r\n let isFrom = false;\r\n let removeOpt: AnimationOption;\r\n if (isFunction(dataIndex)) {\r\n during = cb;\r\n cb = dataIndex;\r\n dataIndex = null;\r\n }\r\n else if (isObject(dataIndex)) {\r\n cb = dataIndex.cb;\r\n during = dataIndex.during;\r\n isFrom = dataIndex.isFrom;\r\n removeOpt = dataIndex.removeOpt;\r\n dataIndex = dataIndex.dataIndex;\r\n }\r\n\r\n const isRemove = (animationType === 'leave');\r\n\r\n if (!isRemove) {\r\n // Must stop the remove animation.\r\n el.stopAnimation('leave');\r\n }\r\n\r\n const animationConfig = getAnimationConfig(\r\n animationType,\r\n animatableModel,\r\n dataIndex as number,\r\n isRemove ? (removeOpt || {}) : null,\r\n (animatableModel && animatableModel.getAnimationDelayParams)\r\n ? animatableModel.getAnimationDelayParams(el, dataIndex as number)\r\n : null\r\n );\r\n if (animationConfig && animationConfig.duration > 0) {\r\n const duration = animationConfig.duration;\r\n const animationDelay = animationConfig.delay;\r\n const animationEasing = animationConfig.easing;\r\n\r\n const animateConfig: ElementAnimateConfig = {\r\n duration: duration as number,\r\n delay: animationDelay as number || 0,\r\n easing: animationEasing,\r\n done: cb,\r\n force: !!cb || !!during,\r\n // Set to final state in update/init animation.\r\n // So the post processing based on the path shape can be done correctly.\r\n setToFinal: !isRemove,\r\n scope: animationType,\r\n during: during\r\n };\r\n\r\n isFrom\r\n ? el.animateFrom(props, animateConfig)\r\n : el.animateTo(props, animateConfig);\r\n }\r\n else {\r\n el.stopAnimation();\r\n // If `isFrom`, the props is the \"from\" props.\r\n !isFrom && el.attr(props);\r\n // Call during at least once.\r\n during && during(1);\r\n cb && (cb as AnimateOrSetPropsOption['cb'])();\r\n }\r\n}\r\n\r\n\r\n\r\n/**\r\n * Update graphic element properties with or without animation according to the\r\n * configuration in series.\r\n *\r\n * Caution: this method will stop previous animation.\r\n * So do not use this method to one element twice before\r\n * animation starts, unless you know what you are doing.\r\n * @example\r\n * graphic.updateProps(el, {\r\n * position: [100, 100]\r\n * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\r\n * // Or\r\n * graphic.updateProps(el, {\r\n * position: [100, 100]\r\n * }, seriesModel, function () { console.log('Animation done!'); });\r\n */\r\n function updateProps(\r\n el: Element,\r\n props: Props,\r\n // TODO: TYPE AnimatableModel\r\n animatableModel?: Model,\r\n dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption,\r\n cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'],\r\n during?: AnimateOrSetPropsOption['during']\r\n) {\r\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\n\r\nexport {updateProps};\r\n\r\n/**\r\n * Init graphic element properties with or without animation according to the\r\n * configuration in series.\r\n *\r\n * Caution: this method will stop previous animation.\r\n * So do not use this method to one element twice before\r\n * animation starts, unless you know what you are doing.\r\n */\r\nexport function initProps(\r\n el: Element,\r\n props: Props,\r\n animatableModel?: Model,\r\n dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption,\r\n cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'],\r\n during?: AnimateOrSetPropsOption['during']\r\n) {\r\n animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\n\r\n/**\r\n * If element is removed.\r\n * It can determine if element is having remove animation.\r\n */\r\n export function isElementRemoved(el: Element) {\r\n if (!el.__zr) {\r\n return true;\r\n }\r\n for (let i = 0; i < el.animators.length; i++) {\r\n const animator = el.animators[i];\r\n if (animator.scope === 'leave') {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Remove graphic element\r\n */\r\nexport function removeElement(\r\n el: Element,\r\n props: Props,\r\n animatableModel?: Model,\r\n dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption,\r\n cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'],\r\n during?: AnimateOrSetPropsOption['during']\r\n) {\r\n // Don't do remove animation twice.\r\n if (isElementRemoved(el)) {\r\n return;\r\n }\r\n\r\n animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during);\r\n}\r\n\r\nfunction fadeOutDisplayable(\r\n el: Displayable,\r\n animatableModel?: Model,\r\n dataIndex?: number,\r\n done?: AnimateOrSetPropsOption['cb']\r\n) {\r\n el.removeTextContent();\r\n el.removeTextGuideLine();\r\n removeElement(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, animatableModel, dataIndex, done);\r\n}\r\n\r\nexport function removeElementWithFadeOut(\r\n el: Element,\r\n animatableModel?: Model,\r\n dataIndex?: number\r\n) {\r\n function doRemove() {\r\n el.parent && el.parent.remove(el);\r\n }\r\n // Hide label and labelLine first\r\n // TODO Also use fade out animation?\r\n if (!el.isGroup) {\r\n fadeOutDisplayable(el as Displayable, animatableModel, dataIndex, doRemove);\r\n }\r\n else {\r\n (el as Group).traverse(function (disp: Displayable) {\r\n if (!disp.isGroup) {\r\n // Can invoke doRemove multiple times.\r\n fadeOutDisplayable(disp as Displayable, animatableModel, dataIndex, doRemove);\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Save old style for style transition in universalTransition module.\r\n * It's used when element will be reused in each render.\r\n * For chart like map, heatmap, which will always create new element.\r\n * We don't need to save this because universalTransition can get old style from the old element\r\n */\r\nexport function saveOldStyle(el: Displayable) {\r\n transitionStore(el).oldStyle = el.style;\r\n}\r\n\r\nexport function getOldStyle(el: Displayable) {\r\n return transitionStore(el).oldStyle;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ZRText, { TextProps, TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport Element, { ElementTextConfig } from 'zrender/src/Element';\r\nimport Model from '../model/Model';\r\nimport {\r\n LabelOption,\r\n DisplayState,\r\n TextCommonOption,\r\n StatesOptionMixin,\r\n DisplayStateNonNormal,\r\n ColorString,\r\n ZRStyleProps,\r\n AnimationOptionMixin,\r\n InterpolatableValue\r\n} from '../util/types';\r\nimport GlobalModel from '../model/Global';\r\nimport { isFunction, retrieve2, extend, keys, trim } from 'zrender/src/core/util';\r\nimport { SPECIAL_STATES, DISPLAY_STATES } from '../util/states';\r\nimport { deprecateReplaceLog } from '../util/log';\r\nimport { makeInner, interpolateRawValues } from '../util/model';\r\nimport SeriesData from '../data/SeriesData';\r\nimport { initProps, updateProps } from '../util/graphic';\r\n\r\ntype TextCommonParams = {\r\n /**\r\n * Whether disable drawing box of block (outer most).\r\n */\r\n disableBox?: boolean\r\n /**\r\n * Specify a color when color is 'inherit',\r\n * If inheritColor specified, it is used as default textFill.\r\n */\r\n inheritColor?: ColorString\r\n\r\n /**\r\n * Specify a opacity when opacity is not given.\r\n */\r\n defaultOpacity?: number\r\n\r\n defaultOutsidePosition?: LabelOption['position']\r\n\r\n /**\r\n * If support legacy 'auto' for 'inherit' usage.\r\n */\r\n // supportLegacyAuto?: boolean\r\n\r\n textStyle?: ZRStyleProps\r\n};\r\nconst EMPTY_OBJ = {};\r\n\r\ninterface SetLabelStyleOpt extends TextCommonParams {\r\n defaultText?: string | ((\r\n labelDataIndex: TLabelDataIndex,\r\n opt: SetLabelStyleOpt,\r\n interpolatedValue?: InterpolatableValue\r\n ) => string);\r\n // Fetch text by:\r\n // opt.labelFetcher.getFormattedLabel(\r\n // opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp\r\n // )\r\n labelFetcher?: {\r\n getFormattedLabel: (\r\n // In MapDraw case it can be string (region name)\r\n labelDataIndex: TLabelDataIndex,\r\n status: DisplayState,\r\n dataType?: string,\r\n labelDimIndex?: number,\r\n formatter?: string | ((params: object) => string),\r\n // If provided, the implementation of `getFormattedLabel` can use it\r\n // to generate the final label text.\r\n extendParams?: {\r\n interpolatedValue: InterpolatableValue\r\n }\r\n ) => string;\r\n };\r\n labelDataIndex?: TLabelDataIndex;\r\n labelDimIndex?: number;\r\n\r\n /**\r\n * Inject a setter of text for the text animation case.\r\n */\r\n enableTextSetter?: boolean\r\n}\r\ntype LabelModel = Model string);\r\n showDuringLabel?: boolean // Currently only supported by line charts\r\n}>;\r\ntype LabelModelForText = Model & {\r\n formatter?: string | ((params: any) => string);\r\n }>;\r\n\r\ntype LabelStatesModels = Partial> & {normal: LabelModel};\r\n\r\nexport function setLabelText(label: ZRText, labelTexts: Record) {\r\n for (let i = 0; i < SPECIAL_STATES.length; i++) {\r\n const stateName = SPECIAL_STATES[i];\r\n const text = labelTexts[stateName];\r\n const state = label.ensureState(stateName);\r\n state.style = state.style || {};\r\n state.style.text = text;\r\n }\r\n\r\n const oldStates = label.currentStates.slice();\r\n label.clearStates(true);\r\n label.setStyle({ text: labelTexts.normal });\r\n label.useStates(oldStates, true);\r\n}\r\n\r\nfunction getLabelText(\r\n opt: SetLabelStyleOpt,\r\n stateModels: LabelStatesModels,\r\n interpolatedValue?: InterpolatableValue\r\n): Record {\r\n const labelFetcher = opt.labelFetcher;\r\n const labelDataIndex = opt.labelDataIndex;\r\n const labelDimIndex = opt.labelDimIndex;\r\n const normalModel = stateModels.normal;\r\n let baseText;\r\n if (labelFetcher) {\r\n baseText = labelFetcher.getFormattedLabel(\r\n labelDataIndex, 'normal',\r\n null,\r\n labelDimIndex,\r\n normalModel && normalModel.get('formatter'),\r\n interpolatedValue != null ? {\r\n interpolatedValue\r\n } : null\r\n );\r\n }\r\n if (baseText == null) {\r\n baseText = isFunction(opt.defaultText)\r\n ? opt.defaultText(labelDataIndex, opt, interpolatedValue)\r\n : opt.defaultText;\r\n }\r\n\r\n const statesText = {\r\n normal: baseText\r\n } as Record;\r\n\r\n for (let i = 0; i < SPECIAL_STATES.length; i++) {\r\n const stateName = SPECIAL_STATES[i];\r\n const stateModel = stateModels[stateName];\r\n statesText[stateName] = retrieve2(labelFetcher\r\n ? labelFetcher.getFormattedLabel(\r\n labelDataIndex,\r\n stateName,\r\n null,\r\n labelDimIndex,\r\n stateModel && stateModel.get('formatter')\r\n )\r\n : null, baseText);\r\n }\r\n return statesText;\r\n}\r\n/**\r\n * Set normal styles and emphasis styles about text on target element\r\n * If target is a ZRText. It will create a new style object.\r\n * If target is other Element. It will create or reuse ZRText which is attached on the target.\r\n * And create a new style object.\r\n *\r\n * NOTICE: Because the style on ZRText will be replaced with new(only x, y are keeped).\r\n * So please update the style on ZRText after use this method.\r\n */\r\n// eslint-disable-next-line\r\nfunction setLabelStyle(\r\n targetEl: ZRText,\r\n labelStatesModels: LabelStatesModels,\r\n opt?: SetLabelStyleOpt,\r\n stateSpecified?: Partial>\r\n): void;\r\n// eslint-disable-next-line\r\nfunction setLabelStyle(\r\n targetEl: Element,\r\n labelStatesModels: LabelStatesModels,\r\n opt?: SetLabelStyleOpt,\r\n stateSpecified?: Partial>\r\n): void;\r\nfunction setLabelStyle(\r\n targetEl: Element,\r\n labelStatesModels: LabelStatesModels,\r\n opt?: SetLabelStyleOpt,\r\n stateSpecified?: Partial>\r\n // TODO specified position?\r\n) {\r\n opt = opt || EMPTY_OBJ;\r\n const isSetOnText = targetEl instanceof ZRText;\r\n let needsCreateText = false;\r\n for (let i = 0; i < DISPLAY_STATES.length; i++) {\r\n const stateModel = labelStatesModels[DISPLAY_STATES[i]];\r\n if (stateModel && stateModel.getShallow('show')) {\r\n needsCreateText = true;\r\n break;\r\n }\r\n }\r\n let textContent = isSetOnText ? targetEl as ZRText : targetEl.getTextContent();\r\n if (needsCreateText) {\r\n if (!isSetOnText) {\r\n // Reuse the previous\r\n if (!textContent) {\r\n textContent = new ZRText();\r\n targetEl.setTextContent(textContent);\r\n }\r\n // Use same state proxy\r\n if (targetEl.stateProxy) {\r\n textContent.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n const labelStatesTexts = getLabelText(opt, labelStatesModels);\r\n\r\n const normalModel = labelStatesModels.normal;\r\n const showNormal = !!normalModel.getShallow('show');\r\n const normalStyle = createTextStyle(\r\n normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText\r\n );\r\n normalStyle.text = labelStatesTexts.normal;\r\n if (!isSetOnText) {\r\n // Always create new\r\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\r\n }\r\n\r\n for (let i = 0; i < SPECIAL_STATES.length; i++) {\r\n const stateName = SPECIAL_STATES[i];\r\n const stateModel = labelStatesModels[stateName];\r\n\r\n if (stateModel) {\r\n const stateObj = textContent.ensureState(stateName);\r\n const stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\r\n if (stateShow !== showNormal) {\r\n stateObj.ignore = !stateShow;\r\n }\r\n stateObj.style = createTextStyle(\r\n stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText\r\n );\r\n stateObj.style.text = labelStatesTexts[stateName];\r\n\r\n if (!isSetOnText) {\r\n const targetElEmphasisState = targetEl.ensureState(stateName);\r\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\r\n }\r\n }\r\n }\r\n\r\n // PENDING: if there is many requirements that emphasis position\r\n // need to be different from normal position, we might consider\r\n // auto silent is those cases.\r\n textContent.silent = !!normalModel.getShallow('silent');\r\n // Keep x and y\r\n if (textContent.style.x != null) {\r\n normalStyle.x = textContent.style.x;\r\n }\r\n if (textContent.style.y != null) {\r\n normalStyle.y = textContent.style.y;\r\n }\r\n textContent.ignore = !showNormal;\r\n // Always create new style.\r\n textContent.useStyle(normalStyle);\r\n textContent.dirty();\r\n\r\n if (opt.enableTextSetter) {\r\n labelInner(textContent).setLabelText = function (interpolatedValue: InterpolatableValue) {\r\n const labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue);\r\n setLabelText(textContent, labelStatesTexts);\r\n };\r\n }\r\n }\r\n else if (textContent) {\r\n // Not display rich text.\r\n textContent.ignore = true;\r\n }\r\n targetEl.dirty();\r\n}\r\nexport { setLabelStyle };\r\n\r\nexport function getLabelStatesModels(\r\n itemModel: Model & Partial>>,\r\n labelName?: LabelName\r\n): Record {\r\n labelName = (labelName || 'label') as LabelName;\r\n const statesModels = {\r\n normal: itemModel.getModel(labelName) as LabelModel\r\n } as Record;\r\n for (let i = 0; i < SPECIAL_STATES.length; i++) {\r\n const stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\r\n }\r\n return statesModels;\r\n}\r\n/**\r\n * Set basic textStyle properties.\r\n */\r\nexport function createTextStyle(\r\n textStyleModel: Model,\r\n specifiedTextStyle?: TextStyleProps, // Fixed style in the code. Can't be set by model.\r\n opt?: Pick,\r\n isNotNormal?: boolean,\r\n isAttached?: boolean // If text is attached on an element. If so, auto color will handling in zrender.\r\n) {\r\n const textStyle: TextStyleProps = {};\r\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\r\n specifiedTextStyle && extend(textStyle, specifiedTextStyle);\r\n // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\r\n return textStyle;\r\n}\r\nexport function createTextConfig(\r\n textStyleModel: Model,\r\n opt?: Pick,\r\n isNotNormal?: boolean\r\n) {\r\n opt = opt || {};\r\n const textConfig: ElementTextConfig = {};\r\n let labelPosition;\r\n let labelRotate = textStyleModel.getShallow('rotate');\r\n const labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\r\n const labelOffset = textStyleModel.getShallow('offset');\r\n labelPosition = textStyleModel.getShallow('position')\r\n || (isNotNormal ? null : 'inside');\r\n // 'outside' is not a valid zr textPostion value, but used\r\n // in bar series, and magric type should be considered.\r\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\r\n if (labelPosition != null) {\r\n textConfig.position = labelPosition;\r\n }\r\n if (labelOffset != null) {\r\n textConfig.offset = labelOffset;\r\n }\r\n if (labelRotate != null) {\r\n labelRotate *= Math.PI / 180;\r\n textConfig.rotation = labelRotate;\r\n }\r\n if (labelDistance != null) {\r\n textConfig.distance = labelDistance;\r\n }\r\n // fill and auto is determined by the color of path fill if it's not specified by developers.\r\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit'\r\n ? (opt.inheritColor || null)\r\n : 'auto';\r\n return textConfig;\r\n}\r\n/**\r\n * The uniform entry of set text style, that is, retrieve style definitions\r\n * from `model` and set to `textStyle` object.\r\n *\r\n * Never in merge mode, but in overwrite mode, that is, all of the text style\r\n * properties will be set. (Consider the states of normal and emphasis and\r\n * default value can be adopted, merge would make the logic too complicated\r\n * to manage.)\r\n */\r\nfunction setTextStyleCommon(\r\n textStyle: TextStyleProps,\r\n textStyleModel: Model,\r\n opt?: Pick,\r\n isNotNormal?: boolean,\r\n isAttached?: boolean\r\n) {\r\n // Consider there will be abnormal when merge hover style to normal style if given default value.\r\n opt = opt || EMPTY_OBJ;\r\n const ecModel = textStyleModel.ecModel;\r\n const globalTextStyle = ecModel && ecModel.option.textStyle;\r\n // Consider case:\r\n // {\r\n // data: [{\r\n // value: 12,\r\n // label: {\r\n // rich: {\r\n // // no 'a' here but using parent 'a'.\r\n // }\r\n // }\r\n // }],\r\n // rich: {\r\n // a: { ... }\r\n // }\r\n // }\r\n const richItemNames = getRichItemNames(textStyleModel);\r\n let richResult: TextStyleProps['rich'];\r\n if (richItemNames) {\r\n richResult = {};\r\n for (const name in richItemNames) {\r\n if (richItemNames.hasOwnProperty(name)) {\r\n // Cascade is supported in rich.\r\n const richTextStyle = textStyleModel.getModel(['rich', name]);\r\n // In rich, never `disableBox`.\r\n // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\r\n // the default color `'blue'` will not be adopted if no color declared in `rich`.\r\n // That might confuses users. So probably we should put `textStyleModel` as the\r\n // root ancestor of the `richTextStyle`. But that would be a break change.\r\n setTokenTextStyle(\r\n richResult[name] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true\r\n );\r\n }\r\n }\r\n }\r\n if (richResult) {\r\n textStyle.rich = richResult;\r\n }\r\n const overflow = textStyleModel.get('overflow');\r\n if (overflow) {\r\n textStyle.overflow = overflow;\r\n }\r\n const margin = textStyleModel.get('minMargin');\r\n if (margin != null) {\r\n textStyle.margin = margin;\r\n }\r\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\r\n}\r\n// Consider case:\r\n// {\r\n// data: [{\r\n// value: 12,\r\n// label: {\r\n// rich: {\r\n// // no 'a' here but using parent 'a'.\r\n// }\r\n// }\r\n// }],\r\n// rich: {\r\n// a: { ... }\r\n// }\r\n// }\r\n// TODO TextStyleModel\r\nfunction getRichItemNames(textStyleModel: Model) {\r\n // Use object to remove duplicated names.\r\n let richItemNameMap: Dictionary;\r\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\r\n const rich = (textStyleModel.option || EMPTY_OBJ as LabelOption).rich;\r\n if (rich) {\r\n richItemNameMap = richItemNameMap || {};\r\n const richKeys = keys(rich);\r\n for (let i = 0; i < richKeys.length; i++) {\r\n const richKey = richKeys[i];\r\n richItemNameMap[richKey] = 1;\r\n }\r\n }\r\n textStyleModel = textStyleModel.parentModel;\r\n }\r\n return richItemNameMap;\r\n}\r\nconst TEXT_PROPS_WITH_GLOBAL = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\r\n 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n] as const;\r\nconst TEXT_PROPS_SELF = [\r\n 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign', 'ellipsis'\r\n] as const;\r\nconst TEXT_PROPS_BOX = [\r\n 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset',\r\n 'backgroundColor', 'borderColor',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n] as const;\r\n\r\nfunction setTokenTextStyle(\r\n textStyle: TextStyleProps['rich'][string],\r\n textStyleModel: Model,\r\n globalTextStyle: LabelOption,\r\n opt?: Pick,\r\n isNotNormal?: boolean,\r\n isAttached?: boolean,\r\n isBlock?: boolean,\r\n inRich?: boolean\r\n) {\r\n // In merge mode, default value should not be given.\r\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\r\n const inheritColor = opt && opt.inheritColor;\r\n let fillColor = textStyleModel.getShallow('color');\r\n let strokeColor = textStyleModel.getShallow('textBorderColor');\r\n let opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\r\n if (fillColor === 'inherit' || fillColor === 'auto') {\r\n if (__DEV__) {\r\n if (fillColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n fillColor = inheritColor;\r\n }\r\n else {\r\n fillColor = null;\r\n }\r\n }\r\n if (strokeColor === 'inherit' || (strokeColor === 'auto')) {\r\n if (__DEV__) {\r\n if (strokeColor === 'auto') {\r\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\r\n }\r\n }\r\n if (inheritColor) {\r\n strokeColor = inheritColor;\r\n }\r\n else {\r\n strokeColor = null;\r\n }\r\n }\r\n if (!isAttached) {\r\n // Only use default global textStyle.color if text is individual.\r\n // Otherwise it will use the strategy of attached text color because text may be on a path.\r\n fillColor = fillColor || globalTextStyle.color;\r\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\r\n }\r\n if (fillColor != null) {\r\n textStyle.fill = fillColor;\r\n }\r\n if (strokeColor != null) {\r\n textStyle.stroke = strokeColor;\r\n }\r\n const textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\r\n if (textBorderWidth != null) {\r\n textStyle.lineWidth = textBorderWidth;\r\n }\r\n const textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\r\n if (textBorderType != null) {\r\n textStyle.lineDash = textBorderType as any;\r\n }\r\n const textBorderDashOffset = retrieve2(\r\n textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset\r\n );\r\n if (textBorderDashOffset != null) {\r\n textStyle.lineDashOffset = textBorderDashOffset;\r\n }\r\n\r\n if (!isNotNormal && (opacity == null) && !inRich) {\r\n opacity = opt && opt.defaultOpacity;\r\n }\r\n if (opacity != null) {\r\n textStyle.opacity = opacity;\r\n }\r\n\r\n // TODO\r\n if (!isNotNormal && !isAttached) {\r\n // Set default finally.\r\n if (textStyle.fill == null && opt.inheritColor) {\r\n textStyle.fill = opt.inheritColor;\r\n }\r\n }\r\n // Do not use `getFont` here, because merge should be supported, where\r\n // part of these properties may be changed in emphasis style, and the\r\n // others should remain their original value got from normal style.\r\n for (let i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\r\n const key = TEXT_PROPS_WITH_GLOBAL[i];\r\n const val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\r\n if (val != null) {\r\n (textStyle as any)[key] = val;\r\n }\r\n }\r\n for (let i = 0; i < TEXT_PROPS_SELF.length; i++) {\r\n const key = TEXT_PROPS_SELF[i];\r\n const val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n (textStyle as any)[key] = val;\r\n }\r\n }\r\n if (textStyle.verticalAlign == null) {\r\n const baseline = textStyleModel.getShallow('baseline');\r\n if (baseline != null) {\r\n textStyle.verticalAlign = baseline;\r\n }\r\n }\r\n if (!isBlock || !opt.disableBox) {\r\n for (let i = 0; i < TEXT_PROPS_BOX.length; i++) {\r\n const key = TEXT_PROPS_BOX[i];\r\n const val = textStyleModel.getShallow(key);\r\n if (val != null) {\r\n (textStyle as any)[key] = val;\r\n }\r\n }\r\n\r\n const borderType = textStyleModel.getShallow('borderType');\r\n if (borderType != null) {\r\n textStyle.borderDash = borderType as any;\r\n }\r\n\r\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.backgroundColor === 'auto') {\r\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.backgroundColor = inheritColor;\r\n }\r\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\r\n if (__DEV__) {\r\n if (textStyle.borderColor === 'auto') {\r\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\r\n }\r\n }\r\n textStyle.borderColor = inheritColor;\r\n }\r\n }\r\n}\r\n\r\nexport function getFont(\r\n opt: Pick,\r\n ecModel: GlobalModel\r\n) {\r\n const gTextStyleModel = ecModel && ecModel.getModel('textStyle');\r\n return trim([\r\n // FIXME in node-canvas fontWeight is before fontStyle\r\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',\r\n opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',\r\n (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',\r\n opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'\r\n ].join(' '));\r\n}\r\n\r\nexport const labelInner = makeInner<{\r\n /**\r\n * Previous target value stored used for label.\r\n * It's mainly for text animation\r\n */\r\n prevValue?: InterpolatableValue\r\n /**\r\n * Target value stored used for label.\r\n */\r\n value?: InterpolatableValue\r\n /**\r\n * Current value in text animation.\r\n */\r\n interpolatedValue?: InterpolatableValue\r\n /**\r\n * If enable value animation\r\n */\r\n valueAnimation?: boolean\r\n /**\r\n * Label value precision during animation.\r\n */\r\n precision?: number | 'auto'\r\n\r\n /**\r\n * If enable value animation\r\n */\r\n statesModels?: LabelStatesModels\r\n /**\r\n * Default text getter during interpolation\r\n */\r\n defaultInterpolatedText?: (value: InterpolatableValue) => string\r\n /**\r\n * Change label text from interpolated text during animation\r\n */\r\n setLabelText?: (interpolatedValue?: InterpolatableValue) => void\r\n\r\n}, ZRText>();\r\n\r\nexport function setLabelValueAnimation(\r\n label: ZRText,\r\n labelStatesModels: LabelStatesModels,\r\n value: InterpolatableValue,\r\n getDefaultText: (value: InterpolatableValue) => string\r\n) {\r\n if (!label) {\r\n return;\r\n }\r\n\r\n const obj = labelInner(label);\r\n obj.prevValue = obj.value;\r\n obj.value = value;\r\n const normalLabelModel = labelStatesModels.normal;\r\n\r\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\r\n\r\n if (obj.valueAnimation) {\r\n obj.precision = normalLabelModel.get('precision');\r\n obj.defaultInterpolatedText = getDefaultText;\r\n obj.statesModels = labelStatesModels;\r\n }\r\n}\r\n\r\nexport function animateLabelValue(\r\n textEl: ZRText,\r\n dataIndex: number,\r\n data: SeriesData,\r\n animatableModel: Model,\r\n labelFetcher: SetLabelStyleOpt['labelFetcher']\r\n) {\r\n const labelInnerStore = labelInner(textEl);\r\n if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) {\r\n // Value not changed, no new label animation\r\n return;\r\n }\r\n\r\n const defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;\r\n // Consider the case that being animating, do not use the `obj.value`,\r\n // Otherwise it will jump to the `obj.value` when this new animation started.\r\n const currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue);\r\n const targetValue = labelInnerStore.value;\r\n\r\n function during(percent: number) {\r\n const interpolated = interpolateRawValues(\r\n data,\r\n labelInnerStore.precision,\r\n currValue,\r\n targetValue,\r\n percent\r\n );\r\n\r\n labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated;\r\n\r\n const labelText = getLabelText({\r\n labelDataIndex: dataIndex,\r\n labelFetcher: labelFetcher,\r\n defaultText: defaultInterpolatedText\r\n ? defaultInterpolatedText(interpolated)\r\n : interpolated + ''\r\n }, labelInnerStore.statesModels, interpolated);\r\n\r\n setLabelText(textEl, labelText);\r\n }\r\n\r\n (textEl as ZRText & {percent?: number}).percent = 0;\r\n (labelInnerStore.prevValue == null\r\n ? initProps\r\n : updateProps\r\n )(textEl, {\r\n // percent is used to prevent animation from being aborted #15916\r\n percent: 1\r\n }, animatableModel, dataIndex, null, during);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphicUtil from '../../util/graphic';\r\nimport {getFont} from '../../label/labelStyle';\r\nimport Model from '../Model';\r\nimport { LabelOption, ColorString } from '../../util/types';\r\nimport ZRText, {TextStyleProps} from 'zrender/src/graphic/Text';\r\n\r\nconst PATH_COLOR = ['textStyle', 'color'] as const;\r\n\r\nexport type LabelFontOption = Pick;\r\ntype LabelRectRelatedOption = Pick & LabelFontOption;\r\n\r\nconst textStyleParams = [\r\n 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'padding',\r\n 'lineHeight', 'rich', 'width', 'height', 'overflow'\r\n] as const;\r\n\r\n// TODO Performance improvement?\r\nconst tmpText = new ZRText();\r\nclass TextStyleMixin {\r\n /**\r\n * Get color property or get color from option.textStyle.color\r\n */\r\n // TODO Callback\r\n getTextColor(this: Model, isEmphasis?: boolean): ColorString {\r\n const ecModel = this.ecModel;\r\n return this.getShallow('color')\r\n || (\r\n (!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null\r\n );\r\n }\r\n\r\n /**\r\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\r\n * @return {string}\r\n */\r\n getFont(this: Model) {\r\n return getFont({\r\n fontStyle: this.getShallow('fontStyle'),\r\n fontWeight: this.getShallow('fontWeight'),\r\n fontSize: this.getShallow('fontSize'),\r\n fontFamily: this.getShallow('fontFamily')\r\n }, this.ecModel);\r\n }\r\n\r\n getTextRect(this: Model & TextStyleMixin, text: string): graphicUtil.BoundingRect {\r\n const style: TextStyleProps = {\r\n text: text,\r\n verticalAlign: this.getShallow('verticalAlign')\r\n || this.getShallow('baseline')\r\n };\r\n for (let i = 0; i < textStyleParams.length; i++) {\r\n (style as any)[textStyleParams[i]] = this.getShallow(textStyleParams[i]);\r\n }\r\n tmpText.useStyle(style);\r\n tmpText.update();\r\n return tmpText.getBoundingRect();\r\n }\r\n};\r\n\r\nexport default TextStyleMixin;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport makeStyleMapper from './makeStyleMapper';\r\nimport Model from '../Model';\r\nimport { LineStyleOption } from '../../util/types';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\n\r\nexport const LINE_STYLE_KEY_MAP = [\r\n ['lineWidth', 'width'],\r\n ['stroke', 'color'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'type'],\r\n ['lineDashOffset', 'dashOffset'],\r\n ['lineCap', 'cap'],\r\n ['lineJoin', 'join'],\r\n ['miterLimit']\r\n // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\r\n // So do not transfer decal directly.\r\n];\r\n\r\nconst getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\r\n\r\ntype LineStyleKeys = 'lineWidth'\r\n | 'stroke'\r\n | 'opacity'\r\n | 'shadowBlur'\r\n | 'shadowOffsetX'\r\n | 'shadowOffsetY'\r\n | 'shadowColor'\r\n | 'lineDash'\r\n | 'lineDashOffset'\r\n | 'lineCap'\r\n | 'lineJoin'\r\n | 'miterLimit';\r\n\r\nexport type LineStyleProps = Pick;\r\n\r\nclass LineStyleMixin {\r\n\r\n getLineStyle(\r\n this: Model,\r\n excludes?: readonly (keyof LineStyleOption)[]\r\n ): LineStyleProps {\r\n return getLineStyle(this, excludes);\r\n }\r\n\r\n};\r\n\r\nexport {LineStyleMixin};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport makeStyleMapper from './makeStyleMapper';\r\nimport Model from '../Model';\r\nimport { ItemStyleOption } from '../../util/types';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\n\r\nexport const ITEM_STYLE_KEY_MAP = [\r\n ['fill', 'color'],\r\n ['stroke', 'borderColor'],\r\n ['lineWidth', 'borderWidth'],\r\n ['opacity'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor'],\r\n ['lineDash', 'borderType'],\r\n ['lineDashOffset', 'borderDashOffset'],\r\n ['lineCap', 'borderCap'],\r\n ['lineJoin', 'borderJoin'],\r\n ['miterLimit', 'borderMiterLimit']\r\n // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\r\n // So do not transfer decal directly.\r\n];\r\n\r\nconst getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\r\n\r\ntype ItemStyleKeys = 'fill'\r\n | 'stroke'\r\n | 'decal'\r\n | 'lineWidth'\r\n | 'opacity'\r\n | 'shadowBlur'\r\n | 'shadowOffsetX'\r\n | 'shadowOffsetY'\r\n | 'shadowColor'\r\n | 'lineDash'\r\n | 'lineDashOffset'\r\n | 'lineCap'\r\n | 'lineJoin'\r\n | 'miterLimit';\r\n\r\nexport type ItemStyleProps = Pick;\r\n\r\nclass ItemStyleMixin {\r\n\r\n getItemStyle(\r\n this: Model,\r\n excludes?: readonly (keyof ItemStyleOption)[],\r\n includes?: readonly (keyof ItemStyleOption)[]\r\n ): ItemStyleProps {\r\n return getItemStyle(this, excludes, includes);\r\n }\r\n\r\n}\r\n\r\nexport {ItemStyleMixin};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport env from 'zrender/src/core/env';\r\nimport {\r\n enableClassExtend,\r\n ExtendableConstructor,\r\n enableClassCheck,\r\n CheckableConstructor\r\n} from '../util/clazz';\r\n\r\nimport {AreaStyleMixin} from './mixin/areaStyle';\r\nimport TextStyleMixin from './mixin/textStyle';\r\nimport {LineStyleMixin} from './mixin/lineStyle';\r\nimport {ItemStyleMixin} from './mixin/itemStyle';\r\nimport GlobalModel from './Global';\r\nimport { AnimationOptionMixin, ModelOption } from '../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { mixin, clone, merge } from 'zrender/src/core/util';\r\n\r\n// Since model.option can be not only `Dictionary` but also primary types,\r\n// we do this conditional type to avoid getting type 'never';\r\n// type Key = Opt extends Dictionary\r\n// ? keyof Opt : string;\r\n// type Value = Opt extends Dictionary\r\n// ? (R extends keyof Opt ? Opt[R] : ModelOption)\r\n// : ModelOption;\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\ninterface Model\r\n extends LineStyleMixin, ItemStyleMixin, TextStyleMixin, AreaStyleMixin {}\r\nclass Model { // TODO: TYPE use unknown instead of any?\r\n\r\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\r\n // the class members must not be initialized in constructor or declaration place.\r\n // Otherwise there is bad case:\r\n // class A {xxx = 1;}\r\n // enableClassExtend(A);\r\n // class B extends A {}\r\n // var C = B.extend({xxx: 5});\r\n // var c = new C();\r\n // console.log(c.xxx); // expect 5 but always 1.\r\n\r\n parentModel: Model;\r\n\r\n ecModel: GlobalModel;\r\n\r\n option: Opt; // TODO Opt should only be object.\r\n\r\n constructor(option?: Opt, parentModel?: Model, ecModel?: GlobalModel) {\r\n this.parentModel = parentModel;\r\n this.ecModel = ecModel;\r\n this.option = option;\r\n\r\n // Simple optimization\r\n // if (this.init) {\r\n // if (arguments.length <= 4) {\r\n // this.init(option, parentModel, ecModel, extraOpt);\r\n // }\r\n // else {\r\n // this.init.apply(this, arguments);\r\n // }\r\n // }\r\n }\r\n\r\n init(option: Opt, parentModel?: Model, ecModel?: GlobalModel, ...rest: any): void {}\r\n\r\n /**\r\n * Merge the input option to me.\r\n */\r\n mergeOption(option: Opt, ecModel?: GlobalModel): void {\r\n merge(this.option, option, true);\r\n }\r\n\r\n // FIXME:TS consider there is parentModel,\r\n // return type have to be ModelOption or can be Option?\r\n // (Is there any chance that parentModel value type is different?)\r\n get(\r\n path: R, ignoreParent?: boolean\r\n ): Opt[R];\r\n get(\r\n path: readonly [R], ignoreParent?: boolean\r\n ): Opt[R];\r\n get(\r\n path: readonly [R, S], ignoreParent?: boolean\r\n ): Opt[R][S];\r\n get(\r\n path: readonly [R, S, T], ignoreParent?: boolean\r\n ): Opt[R][S][T];\r\n // `path` can be 'a.b.c', so the return value type have to be `ModelOption`\r\n // TODO: TYPE strict key check?\r\n // get(path: string | string[], ignoreParent?: boolean): ModelOption;\r\n get(path: string | readonly string[], ignoreParent?: boolean): ModelOption {\r\n if (path == null) {\r\n return this.option;\r\n }\r\n\r\n return this._doGet(\r\n this.parsePath(path),\r\n !ignoreParent && this.parentModel\r\n );\r\n }\r\n\r\n getShallow(\r\n key: R, ignoreParent?: boolean\r\n ): Opt[R] {\r\n const option = this.option;\r\n\r\n let val = option == null ? option : option[key];\r\n if (val == null && !ignoreParent) {\r\n const parentModel = this.parentModel;\r\n if (parentModel) {\r\n // FIXME:TS do not know how to make it works\r\n val = parentModel.getShallow(key);\r\n }\r\n }\r\n return val as Opt[R];\r\n }\r\n\r\n // TODO At most 3 depth?\r\n getModel(\r\n path: R, parentModel?: Model\r\n ): Model;\r\n getModel(\r\n path: readonly [R], parentModel?: Model\r\n ): Model;\r\n getModel(\r\n path: readonly [R, S], parentModel?: Model\r\n ): Model;\r\n getModel(\r\n path: readonly [Ra] | readonly [Rb, S], parentModel?: Model\r\n ): Model | Model;\r\n getModel(\r\n path: readonly [R, S, T], parentModel?: Model\r\n ): Model;\r\n // `path` can be 'a.b.c', so the return value type have to be `Model`\r\n // getModel(path: string | string[], parentModel?: Model): Model;\r\n // TODO 'a.b.c' is deprecated\r\n getModel(path: string | readonly string[], parentModel?: Model): Model {\r\n const hasPath = path != null;\r\n const pathFinal = hasPath ? this.parsePath(path) : null;\r\n const obj = hasPath\r\n ? this._doGet(pathFinal)\r\n : this.option;\r\n\r\n parentModel = parentModel || (\r\n this.parentModel\r\n && this.parentModel.getModel(this.resolveParentPath(pathFinal) as [string])\r\n );\r\n\r\n return new Model(obj, parentModel, this.ecModel);\r\n }\r\n\r\n /**\r\n * If model has option\r\n */\r\n isEmpty(): boolean {\r\n return this.option == null;\r\n }\r\n\r\n restoreData(): void {}\r\n\r\n // Pending\r\n clone(): Model {\r\n const Ctor = this.constructor;\r\n return new (Ctor as any)(clone(this.option));\r\n }\r\n\r\n // setReadOnly(properties): void {\r\n // clazzUtil.setReadOnly(this, properties);\r\n // }\r\n\r\n // If path is null/undefined, return null/undefined.\r\n parsePath(path: string | readonly string[]): readonly string[] {\r\n if (typeof path === 'string') {\r\n return path.split('.');\r\n }\r\n return path;\r\n }\r\n\r\n // Resolve path for parent. Perhaps useful when parent use a different property.\r\n // Default to be a identity resolver.\r\n // Can be modified to a different resolver.\r\n resolveParentPath(path: readonly string[]): string[] {\r\n return path as string[];\r\n }\r\n\r\n // FIXME:TS check whether put this method here\r\n isAnimationEnabled(): boolean {\r\n if (!env.node && this.option) {\r\n if ((this.option as AnimationOptionMixin).animation != null) {\r\n return !!(this.option as AnimationOptionMixin).animation;\r\n }\r\n else if (this.parentModel) {\r\n return this.parentModel.isAnimationEnabled();\r\n }\r\n }\r\n }\r\n\r\n private _doGet(pathArr: readonly string[], parentModel?: Model>) {\r\n let obj = this.option;\r\n if (!pathArr) {\r\n return obj;\r\n }\r\n\r\n for (let i = 0; i < pathArr.length; i++) {\r\n // Ignore empty\r\n if (!pathArr[i]) {\r\n continue;\r\n }\r\n // obj could be number/string/... (like 0)\r\n obj = (obj && typeof obj === 'object')\r\n ? (obj as ModelOption)[pathArr[i] as keyof ModelOption] : null;\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n if (obj == null && parentModel) {\r\n obj = parentModel._doGet(\r\n this.resolveParentPath(pathArr) as [string],\r\n parentModel.parentModel\r\n ) as any;\r\n }\r\n\r\n return obj;\r\n }\r\n};\r\n\r\ntype ModelConstructor = typeof Model\r\n & ExtendableConstructor\r\n & CheckableConstructor;\r\n\r\n// Enable Model.extend.\r\nenableClassExtend(Model as ModelConstructor);\r\nenableClassCheck(Model as ModelConstructor);\r\n\r\n\r\nmixin(Model, LineStyleMixin);\r\nmixin(Model, ItemStyleMixin);\r\nmixin(Model, AreaStyleMixin);\r\nmixin(Model, TextStyleMixin);\r\n\r\nexport default Model;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {parseClassType, ClassManager} from './clazz';\r\nimport { ComponentOption, ComponentMainType, ComponentSubType, ComponentFullType } from './types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { makePrintable } from './log';\r\n\r\n// A random offset\r\nlet base = Math.round(Math.random() * 10);\r\n\r\n\r\n/**\r\n * @public\r\n * @param {string} type\r\n * @return {string}\r\n */\r\nexport function getUID(type: string): string {\r\n // Considering the case of crossing js context,\r\n // use Math.random to make id as unique as possible.\r\n return [(type || ''), base++].join('_');\r\n}\r\n\r\nexport interface SubTypeDefaulter {\r\n // return subType.\r\n (option: ComponentOption): ComponentSubType;\r\n}\r\n\r\nexport interface SubTypeDefaulterManager {\r\n registerSubTypeDefaulter: (componentType: string, defaulter: SubTypeDefaulter) => void;\r\n determineSubType: (componentType: string, option: ComponentOption) => string;\r\n}\r\n\r\n/**\r\n * Implements `SubTypeDefaulterManager` for `target`.\r\n */\r\nexport function enableSubTypeDefaulter(target: SubTypeDefaulterManager & ClassManager): void {\r\n const subTypeDefaulters: Dictionary = {};\r\n\r\n target.registerSubTypeDefaulter = function (\r\n componentType: ComponentFullType,\r\n defaulter: SubTypeDefaulter\r\n ): void {\r\n const componentTypeInfo = parseClassType(componentType);\r\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\r\n };\r\n\r\n target.determineSubType = function (\r\n componentType: ComponentFullType,\r\n option: ComponentOption\r\n ): string {\r\n let type = option.type;\r\n if (!type) {\r\n const componentTypeMain = parseClassType(componentType).main;\r\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\r\n type = subTypeDefaulters[componentTypeMain](option);\r\n }\r\n }\r\n return type;\r\n };\r\n}\r\n\r\nexport interface TopologicalTravelable {\r\n topologicalTravel: (\r\n targetNameList: ComponentMainType[],\r\n fullNameList: ComponentMainType[],\r\n callback: (this: T, mainType: string, dependencies: string[]) => void,\r\n context?: T\r\n ) => void;\r\n}\r\n\r\n\r\n// ComponentMainType can be 'bb' or 'aa.xx'.\r\ntype DepGraphItem = {\r\n predecessor: ComponentMainType[],\r\n successor: ComponentMainType[],\r\n originalDeps: ComponentMainType[],\r\n entryCount: number\r\n};\r\ntype DepGraph = {[cmptMainType: string]: DepGraphItem};\r\n\r\n/**\r\n * Implements `TopologicalTravelable` for `entity`.\r\n *\r\n * Topological travel on Activity Network (Activity On Vertices).\r\n * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].\r\n * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.\r\n * If there is circular dependencey, Error will be thrown.\r\n */\r\nexport function enableTopologicalTravel(\r\n entity: TopologicalTravelable,\r\n dependencyGetter: (name: ComponentMainType) => ComponentMainType[]\r\n): void {\r\n\r\n /**\r\n * @param targetNameList Target Component type list.\r\n * Can be ['aa', 'bb', 'aa.xx']\r\n * @param fullNameList By which we can build dependency graph.\r\n * @param callback Params: componentType, dependencies.\r\n * @param context Scope of callback.\r\n */\r\n entity.topologicalTravel = function (\r\n targetNameList: ComponentMainType[],\r\n fullNameList: ComponentMainType[],\r\n callback: (this: Ctx, mainType: ComponentMainType, dependencies: ComponentMainType[]) => void,\r\n context?: Ctx\r\n ) {\r\n if (!targetNameList.length) {\r\n return;\r\n }\r\n\r\n const result = makeDepndencyGraph(fullNameList);\r\n const graph = result.graph;\r\n const noEntryList = result.noEntryList;\r\n\r\n const targetNameSet: {[cmtpMainType: string]: boolean} = {};\r\n zrUtil.each(targetNameList, function (name) {\r\n targetNameSet[name] = true;\r\n });\r\n\r\n while (noEntryList.length) {\r\n const currComponentType = noEntryList.pop();\r\n const currVertex = graph[currComponentType];\r\n const isInTargetNameSet = !!targetNameSet[currComponentType];\r\n if (isInTargetNameSet) {\r\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\r\n delete targetNameSet[currComponentType];\r\n }\r\n zrUtil.each(\r\n currVertex.successor,\r\n isInTargetNameSet ? removeEdgeAndAdd : removeEdge\r\n );\r\n }\r\n\r\n zrUtil.each(targetNameSet, function () {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList);\r\n }\r\n throw new Error(errMsg);\r\n });\r\n\r\n function removeEdge(succComponentType: ComponentMainType): void {\r\n graph[succComponentType].entryCount--;\r\n if (graph[succComponentType].entryCount === 0) {\r\n noEntryList.push(succComponentType);\r\n }\r\n }\r\n\r\n // Consider this case: legend depends on series, and we call\r\n // chart.setOption({series: [...]}), where only series is in option.\r\n // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will\r\n // not be called, but only sereis.mergeOption is called. Thus legend\r\n // have no chance to update its local record about series (like which\r\n // name of series is available in legend).\r\n function removeEdgeAndAdd(succComponentType: ComponentMainType): void {\r\n targetNameSet[succComponentType] = true;\r\n removeEdge(succComponentType);\r\n }\r\n };\r\n\r\n function makeDepndencyGraph(fullNameList: ComponentMainType[]) {\r\n const graph: DepGraph = {};\r\n const noEntryList: ComponentMainType[] = [];\r\n\r\n zrUtil.each(fullNameList, function (name: ComponentMainType) {\r\n\r\n const thisItem = createDependencyGraphItem(graph, name);\r\n const originalDeps = thisItem.originalDeps = dependencyGetter(name);\r\n\r\n const availableDeps = getAvailableDependencies(originalDeps, fullNameList);\r\n thisItem.entryCount = availableDeps.length;\r\n if (thisItem.entryCount === 0) {\r\n noEntryList.push(name);\r\n }\r\n\r\n zrUtil.each(availableDeps, function (dependentName) {\r\n if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {\r\n thisItem.predecessor.push(dependentName);\r\n }\r\n const thatItem = createDependencyGraphItem(graph, dependentName);\r\n if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {\r\n thatItem.successor.push(name);\r\n }\r\n });\r\n });\r\n\r\n return {graph: graph, noEntryList: noEntryList};\r\n }\r\n\r\n function createDependencyGraphItem(graph: DepGraph, name: ComponentMainType) {\r\n if (!graph[name]) {\r\n graph[name] = {predecessor: [], successor: []} as DepGraphItem;\r\n }\r\n return graph[name];\r\n }\r\n\r\n function getAvailableDependencies(\r\n originalDeps: ComponentMainType[], fullNameList: ComponentMainType[]\r\n ): ComponentMainType[] {\r\n const availableDeps = [] as ComponentMainType[];\r\n zrUtil.each(originalDeps, function (dep) {\r\n zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\r\n });\r\n return availableDeps;\r\n }\r\n\r\n}\r\n\r\nexport function inheritDefaultOption(superOption: T, subOption: K): K {\r\n // See also `model/Component.ts#getDefaultOption`\r\n return zrUtil.merge(zrUtil.merge({}, superOption, true), subOption, true);\r\n}\r\n", "/*\r\n * Licensed to the Apache Software Foundation (ASF) under one\r\n * or more contributor license agreements. See the NOTICE file\r\n * distributed with this work for additional information\r\n * regarding copyright ownership. The ASF licenses this file\r\n * to you under the Apache License, Version 2.0 (the\r\n * \"License\"); you may not use this file except in compliance\r\n * with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing,\r\n * software distributed under the License is distributed on an\r\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n * KIND, either express or implied. See the License for the\r\n * specific language governing permissions and limitations\r\n * under the License.\r\n */\r\n\r\n/**\r\n * Language: English.\r\n */\r\n\r\nexport default {\r\n time: {\r\n month: [\r\n 'January', 'February', 'March', 'April', 'May', 'June',\r\n 'July', 'August', 'September', 'October', 'November', 'December'\r\n ],\r\n monthAbbr: [\r\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\r\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\r\n ],\r\n dayOfWeek: [\r\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\r\n ],\r\n dayOfWeekAbbr: [\r\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: 'All',\r\n inverse: 'Inv'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: 'Box Select',\r\n polygon: 'Lasso Select',\r\n lineX: 'Horizontally Select',\r\n lineY: 'Vertically Select',\r\n keep: 'Keep Selections',\r\n clear: 'Clear Selections'\r\n }\r\n },\r\n dataView: {\r\n title: 'Data View',\r\n lang: ['Data View', 'Close', 'Refresh']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: 'Zoom',\r\n back: 'Zoom Reset'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: 'Switch to Line Chart',\r\n bar: 'Switch to Bar Chart',\r\n stack: 'Stack',\r\n tiled: 'Tile'\r\n }\r\n },\r\n restore: {\r\n title: 'Restore'\r\n },\r\n saveAsImage: {\r\n title: 'Save as Image',\r\n lang: ['Right Click to Save Image']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: 'Pie chart',\r\n bar: 'Bar chart',\r\n line: 'Line chart',\r\n scatter: 'Scatter plot',\r\n effectScatter: 'Ripple scatter plot',\r\n radar: 'Radar chart',\r\n tree: 'Tree',\r\n treemap: 'Treemap',\r\n boxplot: 'Boxplot',\r\n candlestick: 'Candlestick',\r\n k: 'K line chart',\r\n heatmap: 'Heat map',\r\n map: 'Map',\r\n parallel: 'Parallel coordinate map',\r\n lines: 'Line graph',\r\n graph: 'Relationship graph',\r\n sankey: 'Sankey diagram',\r\n funnel: 'Funnel chart',\r\n gauge: 'Gauge',\r\n pictorialBar: 'Pictorial bar',\r\n themeRiver: 'Theme River Map',\r\n sunburst: 'Sunburst',\r\n custom: 'Custom chart',\r\n chart: 'Chart'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: 'This is a chart about \"{title}\"',\r\n withoutTitle: 'This is a chart'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: ' with type {seriesType} named {seriesName}.',\r\n withoutName: ' with type {seriesType}.'\r\n },\r\n multiple: {\r\n prefix: '. It consists of {seriesCount} series count.',\r\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\r\n withoutName: ' The {seriesId} series is a {seriesType}.',\r\n separator: {\r\n middle: '',\r\n end: ''\r\n }\r\n }\r\n },\r\n data: {\r\n allData: 'The data is as follows: ',\r\n partialData: 'The first {displayCnt} items are: ',\r\n withName: 'the data for {name} is {value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: ', ',\r\n end: '. '\r\n }\r\n }\r\n }\r\n};\r\n", "/*\r\n * Licensed to the Apache Software Foundation (ASF) under one\r\n * or more contributor license agreements. See the NOTICE file\r\n * distributed with this work for additional information\r\n * regarding copyright ownership. The ASF licenses this file\r\n * to you under the Apache License, Version 2.0 (the\r\n * \"License\"); you may not use this file except in compliance\r\n * with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing,\r\n * software distributed under the License is distributed on an\r\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n * KIND, either express or implied. See the License for the\r\n * specific language governing permissions and limitations\r\n * under the License.\r\n */\r\n\r\nexport default {\r\n time: {\r\n month: [\r\n '\u4E00\u6708', '\u4E8C\u6708', '\u4E09\u6708', '\u56DB\u6708', '\u4E94\u6708', '\u516D\u6708',\r\n '\u4E03\u6708', '\u516B\u6708', '\u4E5D\u6708', '\u5341\u6708', '\u5341\u4E00\u6708', '\u5341\u4E8C\u6708'\r\n ],\r\n monthAbbr: [\r\n '1\u6708', '2\u6708', '3\u6708', '4\u6708', '5\u6708', '6\u6708',\r\n '7\u6708', '8\u6708', '9\u6708', '10\u6708', '11\u6708', '12\u6708'\r\n ],\r\n dayOfWeek: [\r\n '\u661F\u671F\u65E5', '\u661F\u671F\u4E00', '\u661F\u671F\u4E8C', '\u661F\u671F\u4E09', '\u661F\u671F\u56DB', '\u661F\u671F\u4E94', '\u661F\u671F\u516D'\r\n ],\r\n dayOfWeekAbbr: [\r\n '\u65E5', '\u4E00', '\u4E8C', '\u4E09', '\u56DB', '\u4E94', '\u516D'\r\n ]\r\n },\r\n legend: {\r\n selector: {\r\n all: '\u5168\u9009',\r\n inverse: '\u53CD\u9009'\r\n }\r\n },\r\n toolbox: {\r\n brush: {\r\n title: {\r\n rect: '\u77E9\u5F62\u9009\u62E9',\r\n polygon: '\u5708\u9009',\r\n lineX: '\u6A2A\u5411\u9009\u62E9',\r\n lineY: '\u7EB5\u5411\u9009\u62E9',\r\n keep: '\u4FDD\u6301\u9009\u62E9',\r\n clear: '\u6E05\u9664\u9009\u62E9'\r\n }\r\n },\r\n dataView: {\r\n title: '\u6570\u636E\u89C6\u56FE',\r\n lang: ['\u6570\u636E\u89C6\u56FE', '\u5173\u95ED', '\u5237\u65B0']\r\n },\r\n dataZoom: {\r\n title: {\r\n zoom: '\u533A\u57DF\u7F29\u653E',\r\n back: '\u533A\u57DF\u7F29\u653E\u8FD8\u539F'\r\n }\r\n },\r\n magicType: {\r\n title: {\r\n line: '\u5207\u6362\u4E3A\u6298\u7EBF\u56FE',\r\n bar: '\u5207\u6362\u4E3A\u67F1\u72B6\u56FE',\r\n stack: '\u5207\u6362\u4E3A\u5806\u53E0',\r\n tiled: '\u5207\u6362\u4E3A\u5E73\u94FA'\r\n }\r\n },\r\n restore: {\r\n title: '\u8FD8\u539F'\r\n },\r\n saveAsImage: {\r\n title: '\u4FDD\u5B58\u4E3A\u56FE\u7247',\r\n lang: ['\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247']\r\n }\r\n },\r\n series: {\r\n typeNames: {\r\n pie: '\u997C\u56FE',\r\n bar: '\u67F1\u72B6\u56FE',\r\n line: '\u6298\u7EBF\u56FE',\r\n scatter: '\u6563\u70B9\u56FE',\r\n effectScatter: '\u6D9F\u6F2A\u6563\u70B9\u56FE',\r\n radar: '\u96F7\u8FBE\u56FE',\r\n tree: '\u6811\u56FE',\r\n treemap: '\u77E9\u5F62\u6811\u56FE',\r\n boxplot: '\u7BB1\u578B\u56FE',\r\n candlestick: 'K\u7EBF\u56FE',\r\n k: 'K\u7EBF\u56FE',\r\n heatmap: '\u70ED\u529B\u56FE',\r\n map: '\u5730\u56FE',\r\n parallel: '\u5E73\u884C\u5750\u6807\u56FE',\r\n lines: '\u7EBF\u56FE',\r\n graph: '\u5173\u7CFB\u56FE',\r\n sankey: '\u6851\u57FA\u56FE',\r\n funnel: '\u6F0F\u6597\u56FE',\r\n gauge: '\u4EEA\u8868\u76D8\u56FE',\r\n pictorialBar: '\u8C61\u5F62\u67F1\u56FE',\r\n themeRiver: '\u4E3B\u9898\u6CB3\u6D41\u56FE',\r\n sunburst: '\u65ED\u65E5\u56FE',\r\n custom: '\u81EA\u5B9A\u4E49\u56FE\u8868',\r\n chart: '\u56FE\u8868'\r\n }\r\n },\r\n aria: {\r\n general: {\r\n withTitle: '\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002',\r\n withoutTitle: '\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C'\r\n },\r\n series: {\r\n single: {\r\n prefix: '',\r\n withName: '\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002',\r\n withoutName: '\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002'\r\n },\r\n multiple: {\r\n prefix: '\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002',\r\n withName: '\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C',\r\n withoutName: '\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C',\r\n separator: {\r\n middle: '\uFF1B',\r\n end: '\u3002'\r\n }\r\n }\r\n },\r\n data: {\r\n allData: '\u5176\u6570\u636E\u662F\u2014\u2014',\r\n partialData: '\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014',\r\n withName: '{name}\u7684\u6570\u636E\u662F{value}',\r\n withoutName: '{value}',\r\n separator: {\r\n middle: '\uFF0C',\r\n end: ''\r\n }\r\n }\r\n }\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { Dictionary } from '../util/types';\r\nimport Model from '../model/Model';\r\nimport env from 'zrender/src/core/env';\r\n// default import ZH and EN lang\r\nimport langEN from '../i18n/langEN';\r\nimport langZH from '../i18n/langZH';\r\nimport { isString, clone, merge } from 'zrender/src/core/util';\r\n\r\nexport type LocaleOption = typeof langEN;\r\n\r\nconst LOCALE_ZH = 'ZH';\r\nconst LOCALE_EN = 'EN';\r\nconst DEFAULT_LOCALE = LOCALE_EN;\r\n\r\nconst localeStorage: Dictionary = {};\r\nconst localeModels: Dictionary = {};\r\n\r\nexport const SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : (function () {\r\n const langStr = (\r\n /* eslint-disable-next-line */\r\n document.documentElement.lang || navigator.language || (navigator as any).browserLanguage || DEFAULT_LOCALE\r\n ).toUpperCase();\r\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\r\n})();\r\n\r\nexport function registerLocale(locale: string, localeObj: LocaleOption) {\r\n locale = locale.toUpperCase();\r\n localeModels[locale] = new Model(localeObj);\r\n localeStorage[locale] = localeObj;\r\n}\r\n\r\n// export function getLocale(locale: string) {\r\n// return localeStorage[locale];\r\n// }\r\n\r\nexport function createLocaleObject(locale: string | LocaleOption): LocaleOption {\r\n if (isString(locale)) {\r\n const localeObj = localeStorage[locale.toUpperCase()] || {} as LocaleOption;\r\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\r\n return clone(localeObj);\r\n }\r\n else {\r\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n }\r\n else {\r\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\r\n }\r\n}\r\n\r\nexport function getLocaleModel(lang: string): Model {\r\n return localeModels[lang];\r\n}\r\n\r\nexport function getDefaultLocaleModel(): Model {\r\n return localeModels[DEFAULT_LOCALE];\r\n}\r\n\r\n// Default locale\r\nregisterLocale(LOCALE_EN, langEN);\r\nregisterLocale(LOCALE_ZH, langZH);\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {TimeAxisLabelFormatterOption} from './../coord/axisCommonTypes';\r\nimport * as numberUtil from './number';\r\nimport {TimeScaleTick} from './types';\r\nimport { getDefaultLocaleModel, getLocaleModel, SYSTEM_LANG, LocaleOption } from '../core/locale';\r\nimport Model from '../model/Model';\r\n\r\nexport const ONE_SECOND = 1000;\r\nexport const ONE_MINUTE = ONE_SECOND * 60;\r\nexport const ONE_HOUR = ONE_MINUTE * 60;\r\nexport const ONE_DAY = ONE_HOUR * 24;\r\nexport const ONE_YEAR = ONE_DAY * 365;\r\n\r\nexport const defaultLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{MMM}',\r\n day: '{d}',\r\n hour: '{HH}:{mm}',\r\n minute: '{HH}:{mm}',\r\n second: '{HH}:{mm}:{ss}',\r\n millisecond: '{HH}:{mm}:{ss} {SSS}',\r\n none: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}'\r\n};\r\n\r\nconst fullDayFormatter = '{yyyy}-{MM}-{dd}';\r\n\r\nexport const fullLeveledFormatter = {\r\n year: '{yyyy}',\r\n month: '{yyyy}-{MM}',\r\n day: fullDayFormatter,\r\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\r\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\r\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\r\n millisecond: defaultLeveledFormatter.none\r\n};\r\n\r\nexport type PrimaryTimeUnit = 'millisecond' | 'second' | 'minute' | 'hour'\r\n | 'day' | 'month' | 'year';\r\nexport type TimeUnit = PrimaryTimeUnit | 'half-year' | 'quarter' | 'week'\r\n | 'half-week' | 'half-day' | 'quarter-day';\r\n\r\nexport const primaryTimeUnits: PrimaryTimeUnit[] = [\r\n 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'\r\n];\r\nexport const timeUnits: TimeUnit[] = [\r\n 'year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day',\r\n 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'\r\n];\r\n\r\nexport function pad(str: string | number, len: number): string {\r\n str += '';\r\n return '0000'.substr(0, len - (str as string).length) + str;\r\n}\r\n\r\nexport function getPrimaryTimeUnit(timeUnit: TimeUnit): PrimaryTimeUnit {\r\n switch (timeUnit) {\r\n case 'half-year':\r\n case 'quarter':\r\n return 'month';\r\n case 'week':\r\n case 'half-week':\r\n return 'day';\r\n case 'half-day':\r\n case 'quarter-day':\r\n return 'hour';\r\n default:\r\n // year, minutes, second, milliseconds\r\n return timeUnit;\r\n }\r\n}\r\n\r\nexport function isPrimaryTimeUnit(timeUnit: TimeUnit): boolean {\r\n return timeUnit === getPrimaryTimeUnit(timeUnit);\r\n}\r\n\r\nexport function getDefaultFormatPrecisionOfInterval(timeUnit: PrimaryTimeUnit): PrimaryTimeUnit {\r\n switch (timeUnit) {\r\n case 'year':\r\n case 'month':\r\n return 'day';\r\n case 'millisecond':\r\n return 'millisecond';\r\n default:\r\n // Also for day, hour, minute, second\r\n return 'second';\r\n }\r\n}\r\n\r\nexport function format(\r\n // Note: The result based on `isUTC` are totally different, which can not be just simply\r\n // substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.\r\n time: unknown, template: string, isUTC: boolean, lang?: string | Model\r\n): string {\r\n const date = numberUtil.parseDate(time);\r\n const y = date[fullYearGetterName(isUTC)]();\r\n const M = date[monthGetterName(isUTC)]() + 1;\r\n const q = Math.floor((M - 1) / 3) + 1;\r\n const d = date[dateGetterName(isUTC)]();\r\n const e = date['get' + (isUTC ? 'UTC' : '') + 'Day' as 'getDay' | 'getUTCDay']();\r\n const H = date[hoursGetterName(isUTC)]();\r\n const h = (H - 1) % 12 + 1;\r\n const m = date[minutesGetterName(isUTC)]();\r\n const s = date[secondsGetterName(isUTC)]();\r\n const S = date[millisecondsGetterName(isUTC)]();\r\n const a = H >= 12 ? 'pm' : 'am';\r\n const A = a.toUpperCase();\r\n\r\n const localeModel = lang instanceof Model ? lang\r\n : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\r\n const timeModel = localeModel.getModel('time');\r\n const month = timeModel.get('month');\r\n const monthAbbr = timeModel.get('monthAbbr');\r\n const dayOfWeek = timeModel.get('dayOfWeek');\r\n const dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\r\n\r\n return (template || '')\r\n .replace(/{a}/g, a + '')\r\n .replace(/{A}/g, A + '')\r\n .replace(/{yyyy}/g, y + '')\r\n .replace(/{yy}/g, pad(y % 100 + '', 2))\r\n .replace(/{Q}/g, q + '')\r\n .replace(/{MMMM}/g, month[M - 1])\r\n .replace(/{MMM}/g, monthAbbr[M - 1])\r\n .replace(/{MM}/g, pad(M, 2))\r\n .replace(/{M}/g, M + '')\r\n .replace(/{dd}/g, pad(d, 2))\r\n .replace(/{d}/g, d + '')\r\n .replace(/{eeee}/g, dayOfWeek[e])\r\n .replace(/{ee}/g, dayOfWeekAbbr[e])\r\n .replace(/{e}/g, e + '')\r\n .replace(/{HH}/g, pad(H, 2))\r\n .replace(/{H}/g, H + '')\r\n .replace(/{hh}/g, pad(h + '', 2))\r\n .replace(/{h}/g, h + '')\r\n .replace(/{mm}/g, pad(m, 2))\r\n .replace(/{m}/g, m + '')\r\n .replace(/{ss}/g, pad(s, 2))\r\n .replace(/{s}/g, s + '')\r\n .replace(/{SSS}/g, pad(S, 3))\r\n .replace(/{S}/g, S + '');\r\n}\r\n\r\nexport function leveledFormat(\r\n tick: TimeScaleTick,\r\n idx: number,\r\n formatter: TimeAxisLabelFormatterOption,\r\n lang: string | Model,\r\n isUTC: boolean\r\n) {\r\n let template = null;\r\n if (zrUtil.isString(formatter)) {\r\n // Single formatter for all units at all levels\r\n template = formatter;\r\n }\r\n else if (zrUtil.isFunction(formatter)) {\r\n // Callback formatter\r\n template = formatter(tick.value, idx, {\r\n level: tick.level\r\n });\r\n }\r\n else {\r\n const defaults = zrUtil.extend({}, defaultLeveledFormatter);\r\n if (tick.level > 0) {\r\n for (let i = 0; i < primaryTimeUnits.length; ++i) {\r\n defaults[primaryTimeUnits[i]] = `{primary|${defaults[primaryTimeUnits[i]]}}`;\r\n }\r\n }\r\n\r\n const mergedFormatter = (formatter\r\n ? (formatter.inherit === false\r\n ? formatter // Use formatter with bigger units\r\n : zrUtil.defaults(formatter, defaults)\r\n )\r\n : defaults) as any;\r\n\r\n const unit = getUnitFromValue(tick.value, isUTC);\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n }\r\n else if (mergedFormatter.inherit) {\r\n // Unit formatter is not defined and should inherit from bigger units\r\n const targetId = timeUnits.indexOf(unit);\r\n for (let i = targetId - 1; i >= 0; --i) {\r\n if (mergedFormatter[unit]) {\r\n template = mergedFormatter[unit];\r\n break;\r\n }\r\n }\r\n template = template || defaults.none;\r\n }\r\n\r\n if (zrUtil.isArray(template)) {\r\n let levelId = tick.level == null\r\n ? 0\r\n : (tick.level >= 0 ? tick.level : template.length + tick.level);\r\n levelId = Math.min(levelId, template.length - 1);\r\n template = template[levelId];\r\n }\r\n }\r\n\r\n return format(new Date(tick.value), template, isUTC, lang);\r\n}\r\n\r\nexport function getUnitFromValue(\r\n value: number | string | Date,\r\n isUTC: boolean\r\n): PrimaryTimeUnit {\r\n const date = numberUtil.parseDate(value);\r\n const M = (date as any)[monthGetterName(isUTC)]() + 1;\r\n const d = (date as any)[dateGetterName(isUTC)]();\r\n const h = (date as any)[hoursGetterName(isUTC)]();\r\n const m = (date as any)[minutesGetterName(isUTC)]();\r\n const s = (date as any)[secondsGetterName(isUTC)]();\r\n const S = (date as any)[millisecondsGetterName(isUTC)]();\r\n\r\n const isSecond = S === 0;\r\n const isMinute = isSecond && s === 0;\r\n const isHour = isMinute && m === 0;\r\n const isDay = isHour && h === 0;\r\n const isMonth = isDay && d === 1;\r\n const isYear = isMonth && M === 1;\r\n\r\n if (isYear) {\r\n return 'year';\r\n }\r\n else if (isMonth) {\r\n return 'month';\r\n }\r\n else if (isDay) {\r\n return 'day';\r\n }\r\n else if (isHour) {\r\n return 'hour';\r\n }\r\n else if (isMinute) {\r\n return 'minute';\r\n }\r\n else if (isSecond) {\r\n return 'second';\r\n }\r\n else {\r\n return 'millisecond';\r\n }\r\n}\r\n\r\nexport function getUnitValue(\r\n value: number | Date,\r\n unit: TimeUnit,\r\n isUTC: boolean\r\n) : number {\r\n const date = zrUtil.isNumber(value)\r\n ? numberUtil.parseDate(value)\r\n : value;\r\n unit = unit || getUnitFromValue(value, isUTC);\r\n\r\n switch (unit) {\r\n case 'year':\r\n return date[fullYearGetterName(isUTC)]();\r\n case 'half-year':\r\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\r\n case 'quarter':\r\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\r\n case 'month':\r\n return date[monthGetterName(isUTC)]();\r\n case 'day':\r\n return date[dateGetterName(isUTC)]();\r\n case 'half-day':\r\n return date[hoursGetterName(isUTC)]() / 24;\r\n case 'hour':\r\n return date[hoursGetterName(isUTC)]();\r\n case 'minute':\r\n return date[minutesGetterName(isUTC)]();\r\n case 'second':\r\n return date[secondsGetterName(isUTC)]();\r\n case 'millisecond':\r\n return date[millisecondsGetterName(isUTC)]();\r\n }\r\n}\r\n\r\nexport function fullYearGetterName(isUTC: boolean) {\r\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\r\n}\r\n\r\nexport function monthGetterName(isUTC: boolean) {\r\n return isUTC ? 'getUTCMonth' : 'getMonth';\r\n}\r\n\r\nexport function dateGetterName(isUTC: boolean) {\r\n return isUTC ? 'getUTCDate' : 'getDate';\r\n}\r\n\r\nexport function hoursGetterName(isUTC: boolean) {\r\n return isUTC ? 'getUTCHours' : 'getHours';\r\n}\r\n\r\nexport function minutesGetterName(isUTC: boolean) {\r\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\r\n}\r\n\r\nexport function secondsGetterName(isUTC: boolean) {\r\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\r\n}\r\n\r\nexport function millisecondsGetterName(isUTC: boolean) {\r\n return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds';\r\n}\r\n\r\nexport function fullYearSetterName(isUTC: boolean) {\r\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\r\n}\r\n\r\nexport function monthSetterName(isUTC: boolean) {\r\n return isUTC ? 'setUTCMonth' : 'setMonth';\r\n}\r\n\r\nexport function dateSetterName(isUTC: boolean) {\r\n return isUTC ? 'setUTCDate' : 'setDate';\r\n}\r\n\r\nexport function hoursSetterName(isUTC: boolean) {\r\n return isUTC ? 'setUTCHours' : 'setHours';\r\n}\r\n\r\nexport function minutesSetterName(isUTC: boolean) {\r\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\r\n}\r\n\r\nexport function secondsSetterName(isUTC: boolean) {\r\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\r\n}\r\n\r\nexport function millisecondsSetterName(isUTC: boolean) {\r\n return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds';\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { Text } from '../util/graphic';\r\n\r\ntype TextStyleProps = Text['style'];\r\nexport function getTextRect(\r\n text: TextStyleProps['text'],\r\n font?: TextStyleProps['font'],\r\n align?: TextStyleProps['align'],\r\n verticalAlign?: TextStyleProps['verticalAlign'],\r\n padding?: TextStyleProps['padding'],\r\n rich?: TextStyleProps['rich'],\r\n truncate?: boolean,\r\n lineHeight?: number\r\n) {\r\n const textEl = new Text({\r\n style: {\r\n text,\r\n font,\r\n align,\r\n verticalAlign,\r\n padding,\r\n rich,\r\n overflow: truncate ? 'truncate' : null,\r\n lineHeight\r\n }\r\n });\r\n\r\n return textEl.getBoundingRect();\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { encodeHTML } from 'zrender/src/core/dom';\r\nimport { parseDate, isNumeric, numericToNumber } from './number';\r\nimport { TooltipRenderMode, ColorString, ZRColor, DimensionType } from './types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { GradientObject } from 'zrender/src/graphic/Gradient';\r\nimport { format as timeFormat, pad } from './time';\r\nimport { deprecateReplaceLog } from './log';\r\n\r\n/**\r\n * Add a comma each three digit.\r\n */\r\nexport function addCommas(x: string | number): string {\r\n if (!isNumeric(x)) {\r\n return zrUtil.isString(x) ? x : '-';\r\n }\r\n const parts = (x + '').split('.');\r\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,')\r\n + (parts.length > 1 ? ('.' + parts[1]) : '');\r\n}\r\n\r\nexport function toCamelCase(str: string, upperCaseFirst?: boolean): string {\r\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\r\n return group1.toUpperCase();\r\n });\r\n\r\n if (upperCaseFirst && str) {\r\n str = str.charAt(0).toUpperCase() + str.slice(1);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nexport const normalizeCssArray = zrUtil.normalizeCssArray;\r\n\r\nexport { encodeHTML };\r\n\r\n/**\r\n * Make value user readable for tooltip and label.\r\n * \"User readable\":\r\n * Try to not print programmer-specific text like NaN, Infinity, null, undefined.\r\n * Avoid to display an empty string, which users can not recognize there is\r\n * a value and it might look like a bug.\r\n */\r\nexport function makeValueReadable(\r\n value: unknown,\r\n valueType: DimensionType,\r\n useUTC: boolean\r\n): string {\r\n const USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}';\r\n\r\n function stringToUserReadable(str: string): string {\r\n return (str && zrUtil.trim(str)) ? str : '-';\r\n }\r\n function isNumberUserReadable(num: number): boolean {\r\n return !!(num != null && !isNaN(num) && isFinite(num));\r\n }\r\n\r\n const isTypeTime = valueType === 'time';\r\n const isValueDate = value instanceof Date;\r\n if (isTypeTime || isValueDate) {\r\n const date = isTypeTime ? parseDate(value) : value;\r\n if (!isNaN(+date)) {\r\n return timeFormat(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\r\n }\r\n else if (isValueDate) {\r\n return '-';\r\n }\r\n // In other cases, continue to try to display the value in the following code.\r\n }\r\n\r\n if (valueType === 'ordinal') {\r\n return zrUtil.isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : zrUtil.isNumber(value)\r\n ? (isNumberUserReadable(value) ? value + '' : '-')\r\n : '-';\r\n }\r\n // By default.\r\n const numericResult = numericToNumber(value);\r\n return isNumberUserReadable(numericResult)\r\n ? addCommas(numericResult)\r\n : zrUtil.isStringSafe(value)\r\n ? stringToUserReadable(value)\r\n : typeof value === 'boolean'\r\n ? value + ''\r\n : '-';\r\n}\r\n\r\n\r\nconst TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\r\n\r\nconst wrapVar = function (varName: string, seriesIdx?: number): string {\r\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\r\n};\r\n\r\nexport interface TplFormatterParam extends Dictionary {\r\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\r\n $vars: string[];\r\n}\r\n/**\r\n * Template formatter\r\n * @param {Array.|Object} paramsList\r\n */\r\nexport function formatTpl(\r\n tpl: string,\r\n paramsList: TplFormatterParam | TplFormatterParam[],\r\n encode?: boolean\r\n): string {\r\n if (!zrUtil.isArray(paramsList)) {\r\n paramsList = [paramsList];\r\n }\r\n const seriesLen = paramsList.length;\r\n if (!seriesLen) {\r\n return '';\r\n }\r\n\r\n const $vars = paramsList[0].$vars || [];\r\n for (let i = 0; i < $vars.length; i++) {\r\n const alias = TPL_VAR_ALIAS[i];\r\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\r\n }\r\n for (let seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\r\n for (let k = 0; k < $vars.length; k++) {\r\n const val = paramsList[seriesIdx][$vars[k]];\r\n tpl = tpl.replace(\r\n wrapVar(TPL_VAR_ALIAS[k], seriesIdx),\r\n encode ? encodeHTML(val) : val\r\n );\r\n }\r\n }\r\n\r\n return tpl;\r\n}\r\n\r\n/**\r\n * simple Template formatter\r\n */\r\nexport function formatTplSimple(tpl: string, param: Dictionary, encode?: boolean) {\r\n zrUtil.each(param, function (value, key) {\r\n tpl = tpl.replace(\r\n '{' + key + '}',\r\n encode ? encodeHTML(value) : value\r\n );\r\n });\r\n return tpl;\r\n}\r\n\r\ninterface RichTextTooltipMarker {\r\n renderMode: TooltipRenderMode;\r\n content: string;\r\n style: Dictionary;\r\n}\r\nexport type TooltipMarker = string | RichTextTooltipMarker;\r\nexport type TooltipMarkerType = 'item' | 'subItem';\r\ninterface GetTooltipMarkerOpt {\r\n color?: ColorString;\r\n extraCssText?: string;\r\n // By default: 'item'\r\n type?: TooltipMarkerType;\r\n renderMode?: TooltipRenderMode;\r\n // id name for marker. If only one marker is in a rich text, this can be omitted.\r\n // By default: 'markerX'\r\n markerId?: string;\r\n}\r\n// Only support color string\r\nexport function getTooltipMarker(color: ColorString, extraCssText?: string): TooltipMarker;\r\nexport function getTooltipMarker(opt: GetTooltipMarkerOpt): TooltipMarker;\r\nexport function getTooltipMarker(inOpt: ColorString | GetTooltipMarkerOpt, extraCssText?: string): TooltipMarker {\r\n const opt = zrUtil.isString(inOpt) ? {\r\n color: inOpt,\r\n extraCssText: extraCssText\r\n } : (inOpt || {}) as GetTooltipMarkerOpt;\r\n const color = opt.color;\r\n const type = opt.type;\r\n extraCssText = opt.extraCssText;\r\n const renderMode = opt.renderMode || 'html';\r\n\r\n if (!color) {\r\n return '';\r\n }\r\n\r\n if (renderMode === 'html') {\r\n return type === 'subItem'\r\n ? ''\r\n : '';\r\n }\r\n else {\r\n // Should better not to auto generate style name by auto-increment number here.\r\n // Because this util is usually called in tooltip formatter, which is probably\r\n // called repeatedly when mouse move and the auto-increment number increases fast.\r\n // Users can make their own style name by theirselves, make it unique and readable.\r\n const markerId = opt.markerId || 'markerX';\r\n return {\r\n renderMode: renderMode,\r\n content: '{' + markerId + '|} ',\r\n style: type === 'subItem'\r\n ? {\r\n width: 4,\r\n height: 4,\r\n borderRadius: 2,\r\n backgroundColor: color\r\n }\r\n : {\r\n width: 10,\r\n height: 10,\r\n borderRadius: 5,\r\n backgroundColor: color\r\n }\r\n };\r\n }\r\n}\r\n\r\n\r\n/**\r\n * @deprecated Use `time/format` instead.\r\n * ISO Date format\r\n * @param {string} tpl\r\n * @param {number} value\r\n * @param {boolean} [isUTC=false] Default in local time.\r\n * see `module:echarts/scale/Time`\r\n * and `module:echarts/util/number#parseDate`.\r\n * @inner\r\n */\r\nexport function formatTime(tpl: string, value: unknown, isUTC?: boolean) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\r\n }\r\n\r\n if (tpl === 'week'\r\n || tpl === 'month'\r\n || tpl === 'quarter'\r\n || tpl === 'half-year'\r\n || tpl === 'year'\r\n ) {\r\n tpl = 'MM-dd\\nyyyy';\r\n }\r\n\r\n const date = parseDate(value);\r\n const getUTC = isUTC ? 'getUTC' : 'get';\r\n const y = (date as any)[getUTC + 'FullYear']();\r\n const M = (date as any)[getUTC + 'Month']() + 1;\r\n const d = (date as any)[getUTC + 'Date']();\r\n const h = (date as any)[getUTC + 'Hours']();\r\n const m = (date as any)[getUTC + 'Minutes']();\r\n const s = (date as any)[getUTC + 'Seconds']();\r\n const S = (date as any)[getUTC + 'Milliseconds']();\r\n\r\n tpl = tpl.replace('MM', pad(M, 2))\r\n .replace('M', M)\r\n .replace('yyyy', y)\r\n .replace('yy', pad(y % 100 + '', 2))\r\n .replace('dd', pad(d, 2))\r\n .replace('d', d)\r\n .replace('hh', pad(h, 2))\r\n .replace('h', h)\r\n .replace('mm', pad(m, 2))\r\n .replace('m', m)\r\n .replace('ss', pad(s, 2))\r\n .replace('s', s)\r\n .replace('SSS', pad(S, 3));\r\n\r\n return tpl;\r\n}\r\n\r\n/**\r\n * Capital first\r\n * @param {string} str\r\n * @return {string}\r\n */\r\nexport function capitalFirst(str: string): string {\r\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\r\n}\r\n\r\n/**\r\n * @return Never be null/undefined.\r\n */\r\nexport function convertToColorString(color: ZRColor, defaultColor?: ColorString): ColorString {\r\n defaultColor = defaultColor || 'transparent';\r\n return zrUtil.isString(color)\r\n ? color\r\n : zrUtil.isObject(color)\r\n ? (\r\n (color as GradientObject).colorStops\r\n && ((color as GradientObject).colorStops[0] || {}).color\r\n || defaultColor\r\n )\r\n : defaultColor;\r\n}\r\n\r\nexport {truncateText} from 'zrender/src/graphic/helper/parseText';\r\n\r\n/**\r\n * open new tab\r\n * @param link url\r\n * @param target blank or self\r\n */\r\nexport function windowOpen(link: string, target: string): void {\r\n /* global window */\r\n if (target === '_blank' || target === 'blank') {\r\n const blank = window.open();\r\n blank.opener = null;\r\n blank.location.href = link;\r\n }\r\n else {\r\n window.open(link, target);\r\n }\r\n}\r\n\r\n\r\nexport {getTextRect} from '../legacy/getTextRect';\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Layout helpers for each component positioning\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport {parsePercent} from './number';\r\nimport * as formatUtil from './format';\r\nimport { BoxLayoutOptionMixin, ComponentLayoutMode } from './types';\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport Element from 'zrender/src/Element';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\n\r\nconst each = zrUtil.each;\r\n\r\nexport interface LayoutRect extends BoundingRect {\r\n margin: number[]\r\n}\r\n\r\nexport interface NewlineElement extends Element {\r\n newline: boolean\r\n}\r\n\r\ntype BoxLayoutKeys = keyof BoxLayoutOptionMixin;\r\n/**\r\n * @public\r\n */\r\nexport const LOCATION_PARAMS = [\r\n 'left', 'right', 'top', 'bottom', 'width', 'height'\r\n] as const;\r\n\r\n/**\r\n * @public\r\n */\r\nexport const HV_NAMES = [\r\n ['width', 'left', 'right'],\r\n ['height', 'top', 'bottom']\r\n] as const;\r\n\r\nfunction boxLayout(\r\n orient: 'horizontal' | 'vertical',\r\n group: Group,\r\n gap: number,\r\n maxWidth?: number,\r\n maxHeight?: number\r\n) {\r\n let x = 0;\r\n let y = 0;\r\n\r\n if (maxWidth == null) {\r\n maxWidth = Infinity;\r\n }\r\n if (maxHeight == null) {\r\n maxHeight = Infinity;\r\n }\r\n let currentLineMaxSize = 0;\r\n\r\n group.eachChild(function (child, idx) {\r\n const rect = child.getBoundingRect();\r\n const nextChild = group.childAt(idx + 1);\r\n const nextChildRect = nextChild && nextChild.getBoundingRect();\r\n let nextX: number;\r\n let nextY: number;\r\n\r\n if (orient === 'horizontal') {\r\n const moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);\r\n nextX = x + moveX;\r\n // Wrap when width exceeds maxWidth or meet a `newline` group\r\n // FIXME compare before adding gap?\r\n if (nextX > maxWidth || (child as NewlineElement).newline) {\r\n x = 0;\r\n nextX = moveX;\r\n y += currentLineMaxSize + gap;\r\n currentLineMaxSize = rect.height;\r\n }\r\n else {\r\n // FIXME: consider rect.y is not `0`?\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\r\n }\r\n }\r\n else {\r\n const moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);\r\n nextY = y + moveY;\r\n // Wrap when width exceeds maxHeight or meet a `newline` group\r\n if (nextY > maxHeight || (child as NewlineElement).newline) {\r\n x += currentLineMaxSize + gap;\r\n y = 0;\r\n nextY = moveY;\r\n currentLineMaxSize = rect.width;\r\n }\r\n else {\r\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\r\n }\r\n }\r\n\r\n if ((child as NewlineElement).newline) {\r\n return;\r\n }\r\n\r\n child.x = x;\r\n child.y = y;\r\n child.markRedraw();\r\n\r\n orient === 'horizontal'\r\n ? (x = nextX + gap)\r\n : (y = nextY + gap);\r\n });\r\n}\r\n\r\n/**\r\n * VBox or HBox layouting\r\n * @param {string} orient\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\r\nexport const box = boxLayout;\r\n\r\n/**\r\n * VBox layouting\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\r\nexport const vbox = zrUtil.curry(boxLayout, 'vertical');\r\n\r\n/**\r\n * HBox layouting\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\r\nexport const hbox = zrUtil.curry(boxLayout, 'horizontal');\r\n\r\n/**\r\n * If x or x2 is not specified or 'center' 'left' 'right',\r\n * the width would be as long as possible.\r\n * If y or y2 is not specified or 'middle' 'top' 'bottom',\r\n * the height would be as long as possible.\r\n */\r\nexport function getAvailableSize(\r\n positionInfo: {\r\n left?: number | string\r\n top?: number | string\r\n right?: number | string\r\n bottom?: number | string\r\n },\r\n containerRect: { width: number, height: number },\r\n margin?: number[] | number\r\n) {\r\n const containerWidth = containerRect.width;\r\n const containerHeight = containerRect.height;\r\n\r\n let x = parsePercent(positionInfo.left, containerWidth);\r\n let y = parsePercent(positionInfo.top, containerHeight);\r\n let x2 = parsePercent(positionInfo.right, containerWidth);\r\n let y2 = parsePercent(positionInfo.bottom, containerHeight);\r\n\r\n (isNaN(x) || isNaN(parseFloat(positionInfo.left as string))) && (x = 0);\r\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right as string))) && (x2 = containerWidth);\r\n (isNaN(y) || isNaN(parseFloat(positionInfo.top as string))) && (y = 0);\r\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom as string))) && (y2 = containerHeight);\r\n\r\n margin = formatUtil.normalizeCssArray(margin || 0);\r\n\r\n return {\r\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\r\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\r\n };\r\n}\r\n\r\n/**\r\n * Parse position info.\r\n */\r\nexport function getLayoutRect(\r\n positionInfo: BoxLayoutOptionMixin & {\r\n aspect?: number // aspect is width / height\r\n },\r\n containerRect: {width: number, height: number},\r\n margin?: number | number[]\r\n): LayoutRect {\r\n margin = formatUtil.normalizeCssArray(margin || 0);\r\n\r\n const containerWidth = containerRect.width;\r\n const containerHeight = containerRect.height;\r\n\r\n let left = parsePercent(positionInfo.left, containerWidth);\r\n let top = parsePercent(positionInfo.top, containerHeight);\r\n const right = parsePercent(positionInfo.right, containerWidth);\r\n const bottom = parsePercent(positionInfo.bottom, containerHeight);\r\n let width = parsePercent(positionInfo.width, containerWidth);\r\n let height = parsePercent(positionInfo.height, containerHeight);\r\n\r\n const verticalMargin = margin[2] + margin[0];\r\n const horizontalMargin = margin[1] + margin[3];\r\n const aspect = positionInfo.aspect;\r\n\r\n // If width is not specified, calculate width from left and right\r\n if (isNaN(width)) {\r\n width = containerWidth - right - horizontalMargin - left;\r\n }\r\n if (isNaN(height)) {\r\n height = containerHeight - bottom - verticalMargin - top;\r\n }\r\n\r\n if (aspect != null) {\r\n // If width and height are not given\r\n // 1. Graph should not exceeds the container\r\n // 2. Aspect must be keeped\r\n // 3. Graph should take the space as more as possible\r\n // FIXME\r\n // Margin is not considered, because there is no case that both\r\n // using margin and aspect so far.\r\n if (isNaN(width) && isNaN(height)) {\r\n if (aspect > containerWidth / containerHeight) {\r\n width = containerWidth * 0.8;\r\n }\r\n else {\r\n height = containerHeight * 0.8;\r\n }\r\n }\r\n\r\n // Calculate width or height with given aspect\r\n if (isNaN(width)) {\r\n width = aspect * height;\r\n }\r\n if (isNaN(height)) {\r\n height = width / aspect;\r\n }\r\n }\r\n\r\n // If left is not specified, calculate left from right and width\r\n if (isNaN(left)) {\r\n left = containerWidth - right - width - horizontalMargin;\r\n }\r\n if (isNaN(top)) {\r\n top = containerHeight - bottom - height - verticalMargin;\r\n }\r\n\r\n // Align left and top\r\n switch (positionInfo.left || positionInfo.right) {\r\n case 'center':\r\n left = containerWidth / 2 - width / 2 - margin[3];\r\n break;\r\n case 'right':\r\n left = containerWidth - width - horizontalMargin;\r\n break;\r\n }\r\n switch (positionInfo.top || positionInfo.bottom) {\r\n case 'middle':\r\n case 'center':\r\n top = containerHeight / 2 - height / 2 - margin[0];\r\n break;\r\n case 'bottom':\r\n top = containerHeight - height - verticalMargin;\r\n break;\r\n }\r\n // If something is wrong and left, top, width, height are calculated as NaN\r\n left = left || 0;\r\n top = top || 0;\r\n if (isNaN(width)) {\r\n // Width may be NaN if only one value is given except width\r\n width = containerWidth - horizontalMargin - left - (right || 0);\r\n }\r\n if (isNaN(height)) {\r\n // Height may be NaN if only one value is given except height\r\n height = containerHeight - verticalMargin - top - (bottom || 0);\r\n }\r\n\r\n const rect = new BoundingRect(left + margin[3], top + margin[0], width, height) as LayoutRect;\r\n rect.margin = margin;\r\n return rect;\r\n}\r\n\r\n\r\n/**\r\n * Position a zr element in viewport\r\n * Group position is specified by either\r\n * {left, top}, {right, bottom}\r\n * If all properties exists, right and bottom will be igonred.\r\n *\r\n * Logic:\r\n * 1. Scale (against origin point in parent coord)\r\n * 2. Rotate (against origin point in parent coord)\r\n * 3. Translate (with el.position by this method)\r\n * So this method only fixes the last step 'Translate', which does not affect\r\n * scaling and rotating.\r\n *\r\n * If be called repeatedly with the same input el, the same result will be gotten.\r\n *\r\n * Return true if the layout happened.\r\n *\r\n * @param el Should have `getBoundingRect` method.\r\n * @param positionInfo\r\n * @param positionInfo.left\r\n * @param positionInfo.top\r\n * @param positionInfo.right\r\n * @param positionInfo.bottom\r\n * @param positionInfo.width Only for opt.boundingModel: 'raw'\r\n * @param positionInfo.height Only for opt.boundingModel: 'raw'\r\n * @param containerRect\r\n * @param margin\r\n * @param opt\r\n * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]\r\n * @param opt.boundingMode\r\n * Specify how to calculate boundingRect when locating.\r\n * 'all': Position the boundingRect that is transformed and uioned\r\n * both itself and its descendants.\r\n * This mode simplies confine the elements in the bounding\r\n * of their container (e.g., using 'right: 0').\r\n * 'raw': Position the boundingRect that is not transformed and only itself.\r\n * This mode is useful when you want a element can overflow its\r\n * container. (Consider a rotated circle needs to be located in a corner.)\r\n * In this mode positionInfo.width/height can only be number.\r\n */\r\nexport function positionElement(\r\n el: Element,\r\n positionInfo: BoxLayoutOptionMixin,\r\n containerRect: {width: number, height: number},\r\n margin?: number[] | number,\r\n opt?: {\r\n hv: [1 | 0 | boolean, 1 | 0 | boolean],\r\n boundingMode: 'all' | 'raw'\r\n },\r\n out?: { x?: number, y?: number }\r\n): boolean {\r\n const h = !opt || !opt.hv || opt.hv[0];\r\n const v = !opt || !opt.hv || opt.hv[1];\r\n const boundingMode = opt && opt.boundingMode || 'all';\r\n out = out || el;\r\n\r\n out.x = el.x;\r\n out.y = el.y;\r\n\r\n if (!h && !v) {\r\n return false;\r\n }\r\n\r\n let rect;\r\n if (boundingMode === 'raw') {\r\n rect = el.type === 'group'\r\n ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0)\r\n : el.getBoundingRect();\r\n }\r\n else {\r\n rect = el.getBoundingRect();\r\n if (el.needLocalTransform()) {\r\n const transform = el.getLocalTransform();\r\n // Notice: raw rect may be inner object of el,\r\n // which should not be modified.\r\n rect = rect.clone();\r\n rect.applyTransform(transform);\r\n }\r\n }\r\n\r\n // The real width and height can not be specified but calculated by the given el.\r\n const layoutRect = getLayoutRect(\r\n zrUtil.defaults(\r\n {width: rect.width, height: rect.height},\r\n positionInfo\r\n ),\r\n containerRect,\r\n margin\r\n );\r\n\r\n // Because 'tranlate' is the last step in transform\r\n // (see zrender/core/Transformable#getLocalTransform),\r\n // we can just only modify el.position to get final result.\r\n const dx = h ? layoutRect.x - rect.x : 0;\r\n const dy = v ? layoutRect.y - rect.y : 0;\r\n\r\n if (boundingMode === 'raw') {\r\n out.x = dx;\r\n out.y = dy;\r\n }\r\n else {\r\n out.x += dx;\r\n out.y += dy;\r\n }\r\n if (out === el) {\r\n el.markRedraw();\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * @param option Contains some of the properties in HV_NAMES.\r\n * @param hvIdx 0: horizontal; 1: vertical.\r\n */\r\nexport function sizeCalculable(option: BoxLayoutOptionMixin, hvIdx: number): boolean {\r\n return option[HV_NAMES[hvIdx][0]] != null\r\n || (option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null);\r\n}\r\n\r\nexport function fetchLayoutMode(ins: any): ComponentLayoutMode {\r\n const layoutMode = ins.layoutMode || ins.constructor.layoutMode;\r\n return zrUtil.isObject(layoutMode)\r\n ? layoutMode\r\n : layoutMode\r\n ? {type: layoutMode}\r\n : null;\r\n}\r\n\r\n/**\r\n * Consider Case:\r\n * When default option has {left: 0, width: 100}, and we set {right: 0}\r\n * through setOption or media query, using normal zrUtil.merge will cause\r\n * {right: 0} does not take effect.\r\n *\r\n * @example\r\n * ComponentModel.extend({\r\n * init: function () {\r\n * ...\r\n * let inputPositionParams = layout.getLayoutParams(option);\r\n * this.mergeOption(inputPositionParams);\r\n * },\r\n * mergeOption: function (newOption) {\r\n * newOption && zrUtil.merge(thisOption, newOption, true);\r\n * layout.mergeLayoutParam(thisOption, newOption);\r\n * }\r\n * });\r\n *\r\n * @param targetOption\r\n * @param newOption\r\n * @param opt\r\n */\r\nexport function mergeLayoutParam(\r\n targetOption: T,\r\n newOption: T,\r\n opt?: ComponentLayoutMode\r\n) {\r\n let ignoreSize = opt && opt.ignoreSize;\r\n !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\r\n\r\n const hResult = merge(HV_NAMES[0], 0);\r\n const vResult = merge(HV_NAMES[1], 1);\r\n\r\n copy(HV_NAMES[0], targetOption, hResult);\r\n copy(HV_NAMES[1], targetOption, vResult);\r\n\r\n function merge(names: typeof HV_NAMES[number], hvIdx: number) {\r\n const newParams: BoxLayoutOptionMixin = {};\r\n let newValueCount = 0;\r\n const merged: BoxLayoutOptionMixin = {};\r\n let mergedValueCount = 0;\r\n const enoughParamNumber = 2;\r\n\r\n each(names, function (name: BoxLayoutKeys) {\r\n merged[name] = targetOption[name];\r\n });\r\n each(names, function (name: BoxLayoutKeys) {\r\n // Consider case: newOption.width is null, which is\r\n // set by user for removing width setting.\r\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\r\n hasValue(newParams, name) && newValueCount++;\r\n hasValue(merged, name) && mergedValueCount++;\r\n });\r\n\r\n if ((ignoreSize as [boolean, boolean])[hvIdx]) {\r\n // Only one of left/right is premitted to exist.\r\n if (hasValue(newOption, names[1])) {\r\n merged[names[2]] = null;\r\n }\r\n else if (hasValue(newOption, names[2])) {\r\n merged[names[1]] = null;\r\n }\r\n return merged;\r\n }\r\n\r\n // Case: newOption: {width: ..., right: ...},\r\n // or targetOption: {right: ...} and newOption: {width: ...},\r\n // There is no conflict when merged only has params count\r\n // little than enoughParamNumber.\r\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\r\n return merged;\r\n }\r\n // Case: newOption: {width: ..., right: ...},\r\n // Than we can make sure user only want those two, and ignore\r\n // all origin params in targetOption.\r\n else if (newValueCount >= enoughParamNumber) {\r\n return newParams;\r\n }\r\n else {\r\n // Chose another param from targetOption by priority.\r\n for (let i = 0; i < names.length; i++) {\r\n const name = names[i];\r\n if (!hasProp(newParams, name) && hasProp(targetOption, name)) {\r\n newParams[name] = targetOption[name];\r\n break;\r\n }\r\n }\r\n return newParams;\r\n }\r\n }\r\n\r\n function hasProp(obj: object, name: string): boolean {\r\n return obj.hasOwnProperty(name);\r\n }\r\n\r\n function hasValue(obj: Dictionary, name: string): boolean {\r\n return obj[name] != null && obj[name] !== 'auto';\r\n }\r\n\r\n function copy(names: readonly string[], target: Dictionary, source: Dictionary) {\r\n each(names, function (name) {\r\n target[name] = source[name];\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\r\n */\r\nexport function getLayoutParams(source: BoxLayoutOptionMixin): BoxLayoutOptionMixin {\r\n return copyLayoutParams({}, source);\r\n}\r\n\r\n/**\r\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\r\n * @param {Object} source\r\n * @return {Object} Result contains those props.\r\n */\r\nexport function copyLayoutParams(target: BoxLayoutOptionMixin, source: BoxLayoutOptionMixin): BoxLayoutOptionMixin {\r\n source && target && each(LOCATION_PARAMS, function (name: BoxLayoutKeys) {\r\n source.hasOwnProperty(name) && (target[name] = source[name]);\r\n });\r\n return target;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Model from './Model';\r\nimport * as componentUtil from '../util/component';\r\nimport {\r\n enableClassManagement,\r\n parseClassType,\r\n isExtendedClass,\r\n ExtendableConstructor,\r\n ClassManager,\r\n mountExtend\r\n} from '../util/clazz';\r\nimport {\r\n makeInner, ModelFinderIndexQuery, queryReferringComponents, ModelFinderIdQuery, QueryReferringOpt\r\n} from '../util/model';\r\nimport * as layout from '../util/layout';\r\nimport GlobalModel from './Global';\r\nimport {\r\n ComponentOption,\r\n ComponentMainType,\r\n ComponentSubType,\r\n ComponentFullType,\r\n ComponentLayoutMode,\r\n BoxLayoutOptionMixin\r\n} from '../util/types';\r\n\r\nconst inner = makeInner<{\r\n defaultOption: ComponentOption\r\n}, ComponentModel>();\r\n\r\n\r\nclass ComponentModel extends Model {\r\n\r\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\r\n // the class members must not be initialized in constructor or declaration place.\r\n // Otherwise there is bad case:\r\n // class A {xxx = 1;}\r\n // enableClassExtend(A);\r\n // class B extends A {}\r\n // var C = B.extend({xxx: 5});\r\n // var c = new C();\r\n // console.log(c.xxx); // expect 5 but always 1.\r\n\r\n /**\r\n * @readonly\r\n */\r\n type: ComponentFullType;\r\n\r\n /**\r\n * @readonly\r\n */\r\n id: string;\r\n\r\n /**\r\n * Because simplified concept is probably better, series.name (or component.name)\r\n * has been having too many responsibilities:\r\n * (1) Generating id (which requires name in option should not be modified).\r\n * (2) As an index to mapping series when merging option or calling API (a name\r\n * can refer to more than one component, which is convenient is some cases).\r\n * (3) Display.\r\n * @readOnly But injected\r\n */\r\n name: string;\r\n\r\n /**\r\n * @readOnly\r\n */\r\n mainType: ComponentMainType;\r\n\r\n /**\r\n * @readOnly\r\n */\r\n subType: ComponentSubType;\r\n\r\n /**\r\n * @readOnly\r\n */\r\n componentIndex: number;\r\n\r\n /**\r\n * @readOnly\r\n */\r\n protected defaultOption: ComponentOption;\r\n\r\n /**\r\n * @readOnly\r\n */\r\n ecModel: GlobalModel;\r\n\r\n /**\r\n * @readOnly\r\n */\r\n static dependencies: string[];\r\n\r\n\r\n readonly uid: string;\r\n\r\n // // No common coordinateSystem needed. Each sub class implement\r\n // // `CoordinateSystemHostModel` itself.\r\n // coordinateSystem: CoordinateSystemMaster | CoordinateSystemExecutive;\r\n\r\n /**\r\n * Support merge layout params.\r\n * Only support 'box' now (left/right/top/bottom/width/height).\r\n */\r\n static layoutMode: ComponentLayoutMode | ComponentLayoutMode['type'];\r\n\r\n /**\r\n * Prevent from auto set z, zlevel, z2 by the framework.\r\n */\r\n preventAutoZ: boolean;\r\n\r\n // Injectable properties:\r\n __viewId: string;\r\n __requireNewView: boolean;\r\n\r\n static protoInitialize = (function () {\r\n const proto = ComponentModel.prototype;\r\n proto.type = 'component';\r\n proto.id = '';\r\n proto.name = '';\r\n proto.mainType = '';\r\n proto.subType = '';\r\n proto.componentIndex = 0;\r\n })();\r\n\r\n\r\n constructor(option: Opt, parentModel: Model, ecModel: GlobalModel) {\r\n super(option, parentModel, ecModel);\r\n this.uid = componentUtil.getUID('ec_cpt_model');\r\n }\r\n\r\n init(option: Opt, parentModel: Model, ecModel: GlobalModel): void {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n }\r\n\r\n mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void {\r\n const layoutMode = layout.fetchLayoutMode(this);\r\n const inputPositionParams = layoutMode\r\n ? layout.getLayoutParams(option as BoxLayoutOptionMixin) : {};\r\n\r\n const themeModel = ecModel.getTheme();\r\n zrUtil.merge(option, themeModel.get(this.mainType));\r\n zrUtil.merge(option, this.getDefaultOption());\r\n\r\n if (layoutMode) {\r\n layout.mergeLayoutParam(option as BoxLayoutOptionMixin, inputPositionParams, layoutMode);\r\n }\r\n }\r\n\r\n mergeOption(option: Opt, ecModel: GlobalModel): void {\r\n zrUtil.merge(this.option, option, true);\r\n\r\n const layoutMode = layout.fetchLayoutMode(this);\r\n if (layoutMode) {\r\n layout.mergeLayoutParam(\r\n this.option as BoxLayoutOptionMixin,\r\n option as BoxLayoutOptionMixin,\r\n layoutMode\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Called immediately after `init` or `mergeOption` of this instance called.\r\n */\r\n optionUpdated(newCptOption: Opt, isInit: boolean): void {}\r\n\r\n /**\r\n * [How to declare defaultOption]:\r\n *\r\n * (A) If using class declaration in typescript (since echarts 5):\r\n * ```ts\r\n * import {ComponentOption} from '../model/option';\r\n * export interface XxxOption extends ComponentOption {\r\n * aaa: number\r\n * }\r\n * export class XxxModel extends Component {\r\n * static type = 'xxx';\r\n * static defaultOption: XxxOption = {\r\n * aaa: 123\r\n * }\r\n * }\r\n * Component.registerClass(XxxModel);\r\n * ```\r\n * ```ts\r\n * import {inheritDefaultOption} from '../util/component';\r\n * import {XxxModel, XxxOption} from './XxxModel';\r\n * export interface XxxSubOption extends XxxOption {\r\n * bbb: number\r\n * }\r\n * class XxxSubModel extends XxxModel {\r\n * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {\r\n * bbb: 456\r\n * })\r\n * fn() {\r\n * let opt = this.getDefaultOption();\r\n * // opt is {aaa: 123, bbb: 456}\r\n * }\r\n * }\r\n * ```\r\n *\r\n * (B) If using class extend (previous approach in echarts 3 & 4):\r\n * ```js\r\n * let XxxComponent = Component.extend({\r\n * defaultOption: {\r\n * xx: 123\r\n * }\r\n * })\r\n * ```\r\n * ```js\r\n * let XxxSubComponent = XxxComponent.extend({\r\n * defaultOption: {\r\n * yy: 456\r\n * },\r\n * fn: function () {\r\n * let opt = this.getDefaultOption();\r\n * // opt is {xx: 123, yy: 456}\r\n * }\r\n * })\r\n * ```\r\n */\r\n getDefaultOption(): Opt {\r\n const ctor = this.constructor;\r\n\r\n // If using class declaration, it is different to travel super class\r\n // in legacy env and auto merge defaultOption. So if using class\r\n // declaration, defaultOption should be merged manually.\r\n if (!isExtendedClass(ctor)) {\r\n // When using ts class, defaultOption must be declared as static.\r\n return (ctor as any).defaultOption;\r\n }\r\n\r\n // FIXME: remove this approach?\r\n const fields = inner(this);\r\n if (!fields.defaultOption) {\r\n const optList = [];\r\n let clz = ctor as ExtendableConstructor;\r\n while (clz) {\r\n const opt = clz.prototype.defaultOption;\r\n opt && optList.push(opt);\r\n clz = clz.superClass;\r\n }\r\n\r\n let defaultOption = {};\r\n for (let i = optList.length - 1; i >= 0; i--) {\r\n defaultOption = zrUtil.merge(defaultOption, optList[i], true);\r\n }\r\n fields.defaultOption = defaultOption;\r\n }\r\n return fields.defaultOption as Opt;\r\n }\r\n\r\n /**\r\n * Notice: always force to input param `useDefault` in case that forget to consider it.\r\n * The same behavior as `modelUtil.parseFinder`.\r\n *\r\n * @param useDefault In many cases like series refer axis and axis refer grid,\r\n * If axis index / axis id not specified, use the first target as default.\r\n * In other cases like dataZoom refer axis, if not specified, measn no refer.\r\n */\r\n getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): {\r\n // Always be array rather than null/undefined, which is convenient to use.\r\n models: ComponentModel[];\r\n // Whether target component is specified\r\n specified: boolean;\r\n } {\r\n const indexKey = (mainType + 'Index') as keyof Opt;\r\n const idKey = (mainType + 'Id') as keyof Opt;\r\n\r\n return queryReferringComponents(\r\n this.ecModel,\r\n mainType,\r\n {\r\n index: this.get(indexKey, true) as unknown as ModelFinderIndexQuery,\r\n id: this.get(idKey, true) as unknown as ModelFinderIdQuery\r\n },\r\n opt\r\n );\r\n }\r\n\r\n getBoxLayoutParams() {\r\n // Consider itself having box layout configs.\r\n const boxLayoutModel = this as Model;\r\n return {\r\n left: boxLayoutModel.get('left'),\r\n top: boxLayoutModel.get('top'),\r\n right: boxLayoutModel.get('right'),\r\n bottom: boxLayoutModel.get('bottom'),\r\n width: boxLayoutModel.get('width'),\r\n height: boxLayoutModel.get('height')\r\n };\r\n }\r\n\r\n /**\r\n * Get key for zlevel.\r\n * If developers don't configure zlevel. We will assign zlevel to series based on the key.\r\n * For example, lines with trail effect and progressive series will in an individual zlevel.\r\n */\r\n getZLevelKey(): string {\r\n return '';\r\n }\r\n\r\n setZLevel(zlevel: number) {\r\n this.option.zlevel = zlevel;\r\n }\r\n\r\n // // Interfaces for component / series with select ability.\r\n // select(dataIndex?: number[], dataType?: string): void {}\r\n\r\n // unSelect(dataIndex?: number[], dataType?: string): void {}\r\n\r\n // getSelectedDataIndices(): number[] {\r\n // return [];\r\n // }\r\n\r\n\r\n static registerClass: ClassManager['registerClass'];\r\n\r\n static hasClass: ClassManager['hasClass'];\r\n\r\n static registerSubTypeDefaulter: componentUtil.SubTypeDefaulterManager['registerSubTypeDefaulter'];\r\n\r\n}\r\n\r\nexport type ComponentModelConstructor = typeof ComponentModel\r\n & ClassManager\r\n & componentUtil.SubTypeDefaulterManager\r\n & ExtendableConstructor\r\n & componentUtil.TopologicalTravelable;\r\n\r\nmountExtend(ComponentModel, Model);\r\nenableClassManagement(ComponentModel as ComponentModelConstructor);\r\ncomponentUtil.enableSubTypeDefaulter(ComponentModel as ComponentModelConstructor);\r\ncomponentUtil.enableTopologicalTravel(ComponentModel as ComponentModelConstructor, getDependencies);\r\n\r\n\r\nfunction getDependencies(componentType: string): string[] {\r\n let deps: string[] = [];\r\n zrUtil.each((ComponentModel as ComponentModelConstructor).getClassesByMainType(componentType), function (clz) {\r\n deps = deps.concat((clz as any).dependencies || (clz as any).prototype.dependencies || []);\r\n });\r\n\r\n // Ensure main type.\r\n deps = zrUtil.map(deps, function (type) {\r\n return parseClassType(type).main;\r\n });\r\n\r\n // Hack dataset for convenience.\r\n if (componentType !== 'dataset' && zrUtil.indexOf(deps, 'dataset') <= 0) {\r\n deps.unshift('dataset');\r\n }\r\n\r\n return deps;\r\n}\r\n\r\n\r\nexport default ComponentModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nlet platform = '';\r\n// Navigator not exists in node\r\nif (typeof navigator !== 'undefined') {\r\n /* global navigator */\r\n platform = navigator.platform || '';\r\n}\r\n\r\nconst decalColor = 'rgba(0, 0, 0, 0.2)';\r\n\r\nexport default {\r\n\r\n darkMode: 'auto',\r\n // backgroundColor: 'rgba(0,0,0,0)',\r\n\r\n colorBy: 'series',\r\n\r\n color: [\r\n '#5470c6',\r\n '#91cc75',\r\n '#fac858',\r\n '#ee6666',\r\n '#73c0de',\r\n '#3ba272',\r\n '#fc8452',\r\n '#9a60b4',\r\n '#ea7ccc'\r\n ],\r\n\r\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\r\n\r\n aria: {\r\n decal: {\r\n decals: [{\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [2, 5],\r\n symbolSize: 1,\r\n rotation: Math.PI / 6\r\n }, {\r\n color: decalColor,\r\n symbol: 'circle',\r\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\r\n dashArrayY: [6, 0],\r\n symbolSize: 0.8\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [1, 0],\r\n dashArrayY: [4, 3],\r\n rotation: -Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\r\n dashArrayY: [6, 0]\r\n }, {\r\n color: decalColor,\r\n dashArrayX: [[1, 0], [1, 6]],\r\n dashArrayY: [1, 0, 6, 0],\r\n rotation: Math.PI / 4\r\n }, {\r\n color: decalColor,\r\n symbol: 'triangle',\r\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\r\n dashArrayY: [7, 2],\r\n symbolSize: 0.75\r\n }]\r\n }\r\n },\r\n\r\n // If xAxis and yAxis declared, grid is created by default.\r\n // grid: {},\r\n\r\n textStyle: {\r\n // color: '#000',\r\n // decoration: 'none',\r\n // PENDING\r\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\r\n // fontFamily: 'Arial, Verdana, sans-serif',\r\n fontSize: 12,\r\n fontStyle: 'normal',\r\n fontWeight: 'normal'\r\n },\r\n\r\n // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/\r\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\r\n // Default is source-over\r\n blendMode: null,\r\n\r\n stateAnimation: {\r\n duration: 300,\r\n easing: 'cubicOut'\r\n },\r\n\r\n animation: 'auto',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut',\r\n animationEasingUpdate: 'cubicInOut',\r\n\r\n animationThreshold: 2000,\r\n\r\n // Configuration for progressive/incremental rendering\r\n progressiveThreshold: 3000,\r\n progressive: 400,\r\n\r\n // Threshold of if use single hover layer to optimize.\r\n // It is recommended that `hoverLayerThreshold` is equivalent to or less than\r\n // `progressiveThreshold`, otherwise hover will cause restart of progressive,\r\n // which is unexpected.\r\n // see example .\r\n hoverLayerThreshold: 3000,\r\n\r\n // See: module:echarts/scale/Time\r\n useUTC: false\r\n};", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * [Notice]:\r\n * Consider custom bundle on demand, chart specified\r\n * or component specified types and constants should\r\n * not put here. Only common types and constants can\r\n * be put in this file.\r\n */\r\n\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport Element, {ElementEvent, ElementTextConfig} from 'zrender/src/Element';\r\nimport { DataFormatMixin } from '../model/mixin/dataFormat';\r\nimport GlobalModel from '../model/Global';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport SeriesModel from '../model/Series';\r\nimport { createHashMap, HashMap } from 'zrender/src/core/util';\r\nimport { TaskPlanCallbackReturn, TaskProgressParams } from '../core/task';\r\nimport SeriesData from '../data/SeriesData';\r\nimport { Dictionary, ElementEventName, ImageLike, TextAlign, TextVerticalAlign } from 'zrender/src/core/types';\r\nimport { PatternObject } from 'zrender/src/graphic/Pattern';\r\nimport { TooltipMarker } from './format';\r\nimport { AnimationEasing } from 'zrender/src/animation/easing';\r\nimport { LinearGradientObject } from 'zrender/src/graphic/LinearGradient';\r\nimport { RadialGradientObject } from 'zrender/src/graphic/RadialGradient';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport { TSpanStyleProps } from 'zrender/src/graphic/TSpan';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { ImageStyleProps } from 'zrender/src/graphic/Image';\r\nimport ZRText, { TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport { Source } from '../data/Source';\r\nimport Model from '../model/Model';\r\nimport { DataStoreDimensionType } from '../data/DataStore';\r\nimport { DimensionUserOuputEncode } from '../data/helper/dimensionHelper';\r\n\r\n\r\n\r\n// ---------------------------\r\n// Common types and constants\r\n// ---------------------------\r\n\r\nexport {Dictionary};\r\n\r\nexport type RendererType = 'canvas' | 'svg';\r\nexport type NullUndefined = null | undefined;\r\n\r\nexport type LayoutOrient = 'vertical' | 'horizontal';\r\nexport type HorizontalAlign = 'left' | 'center' | 'right';\r\nexport type VerticalAlign = 'top' | 'middle' | 'bottom';\r\n\r\n// Types from zrender\r\nexport type ColorString = string;\r\nexport type ZRColor = ColorString | LinearGradientObject | RadialGradientObject | PatternObject;\r\nexport type ZRLineType = 'solid' | 'dotted' | 'dashed' | number | number[];\r\n\r\nexport type ZRFontStyle = 'normal' | 'italic' | 'oblique';\r\nexport type ZRFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number;\r\n\r\nexport type ZREasing = AnimationEasing;\r\n\r\nexport type ZRTextAlign = TextAlign;\r\nexport type ZRTextVerticalAlign = TextVerticalAlign;\r\n\r\nexport type ZRElementEvent = ElementEvent;\r\n\r\nexport type ZRRectLike = RectLike;\r\n\r\nexport type ZRStyleProps = PathStyleProps | ImageStyleProps | TSpanStyleProps | TextStyleProps;\r\n\r\nexport type ZRElementEventName = ElementEventName | 'globalout';\r\n\r\n// ComponentFullType can be:\r\n// 'a.b': means ComponentMainType.ComponentSubType.\r\n// 'a': means ComponentMainType.\r\n// See `checkClassType` check the restict definition.\r\nexport type ComponentFullType = string;\r\nexport type ComponentMainType = keyof ECUnitOption & string;\r\nexport type ComponentSubType = Exclude;\r\n/**\r\n * Use `parseClassType` to parse componentType declaration to componentTypeInfo.\r\n * For example:\r\n * componentType declaration: 'a.b', get componentTypeInfo {main: 'a', sub: 'b'}.\r\n * componentType declaration: '', get componentTypeInfo {main: '', sub: ''}.\r\n */\r\nexport interface ComponentTypeInfo {\r\n main: ComponentMainType; // Never null/undefined. `''` represents absence.\r\n sub: ComponentSubType; // Never null/undefined. `''` represents absence.\r\n}\r\n\r\nexport interface ECElement extends Element {\r\n highDownSilentOnTouch?: boolean;\r\n onHoverStateChange?: (toState: DisplayState) => void;\r\n\r\n // 0: normal\r\n // 1: blur\r\n // 2: emphasis\r\n hoverState?: 0 | 1 | 2;\r\n selected?: boolean;\r\n\r\n z2EmphasisLift?: number;\r\n z2SelectLift?: number;\r\n\r\n /**\r\n * Force enable animation.\r\n * This property is useful when an ignored/invisible/removed element\r\n * should have label animation, like the case in the bar-racing charts.\r\n * `forceLabelAnimation` has higher priority than `disableLabelAnimation`.\r\n */\r\n forceLabelAnimation?: boolean;\r\n /**\r\n * Force disable animation.\r\n * `forceLabelAnimation` has higher priority than `disableLabelAnimation`.\r\n */\r\n disableLabelAnimation?: boolean\r\n /**\r\n * Force disable overall layout\r\n */\r\n disableLabelLayout?: boolean\r\n /**\r\n * Force disable morphing\r\n */\r\n disableMorphing?: boolean\r\n}\r\n\r\nexport interface DataHost {\r\n getData(dataType?: SeriesDataType): SeriesData;\r\n}\r\n\r\nexport interface DataModel extends Model, DataHost, DataFormatMixin {\r\n getDataParams(dataIndex: number, dataType?: SeriesDataType, el?: Element): CallbackDataParams;\r\n}\r\n // Pick,\r\n // Pick {}\r\n\r\ninterface PayloadItem {\r\n excludeSeriesId?: OptionId | OptionId[];\r\n animation?: PayloadAnimationPart\r\n // TODO use unknown\r\n [other: string]: any;\r\n}\r\n\r\nexport interface Payload extends PayloadItem {\r\n type: string;\r\n escapeConnect?: boolean;\r\n batch?: PayloadItem[];\r\n}\r\n\r\nexport interface HighlightPayload extends Payload {\r\n type: 'highlight';\r\n notBlur?: boolean\r\n}\r\n\r\nexport interface DownplayPayload extends Payload {\r\n type: 'downplay';\r\n notBlur?: boolean\r\n}\r\n\r\n// Payload includes override anmation info\r\nexport interface PayloadAnimationPart {\r\n duration?: number\r\n easing?: AnimationEasing\r\n delay?: number\r\n}\r\n\r\nexport interface SelectChangedPayload extends Payload {\r\n type: 'selectchanged'\r\n escapeConnect: boolean\r\n isFromClick: boolean\r\n fromAction: 'select' | 'unselect' | 'toggleSelected'\r\n fromActionPayload: Payload\r\n selected: {\r\n seriesIndex: number\r\n dataType?: SeriesDataType\r\n dataIndex: number[]\r\n }[]\r\n}\r\n\r\nexport interface ViewRootGroup extends Group {\r\n __ecComponentInfo?: {\r\n mainType: string,\r\n index: number\r\n };\r\n}\r\n\r\nexport interface ECElementEvent extends\r\n ECEventData,\r\n CallbackDataParams {\r\n\r\n type: ZRElementEventName;\r\n event?: ElementEvent;\r\n\r\n}\r\n/**\r\n * The echarts event type to user.\r\n * Also known as packedEvent.\r\n */\r\nexport interface ECActionEvent extends ECEventData {\r\n // event type\r\n type: string;\r\n componentType?: string;\r\n componentIndex?: number;\r\n seriesIndex?: number;\r\n escapeConnect?: boolean;\r\n batch?: ECEventData;\r\n}\r\nexport interface ECEventData {\r\n // TODO use unknown\r\n [key: string]: any;\r\n}\r\n\r\nexport interface EventQueryItem {\r\n // TODO use unknown\r\n [key: string]: any;\r\n}\r\nexport interface NormalizedEventQuery {\r\n cptQuery: EventQueryItem;\r\n dataQuery: EventQueryItem;\r\n otherQuery: EventQueryItem;\r\n}\r\n\r\nexport interface ActionInfo {\r\n // action type\r\n type: string;\r\n // If not provided, use the same string of `type`.\r\n event?: string;\r\n // update method\r\n update?: string;\r\n}\r\nexport interface ActionHandler {\r\n (payload: Payload, ecModel: GlobalModel, api: ExtensionAPI): void | ECEventData;\r\n}\r\n\r\nexport interface OptionPreprocessor {\r\n (option: ECUnitOption, isTheme: boolean): void\r\n}\r\n\r\nexport interface PostUpdater {\r\n (ecModel: GlobalModel, api: ExtensionAPI): void;\r\n}\r\n\r\nexport interface StageHandlerReset {\r\n (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload):\r\n StageHandlerProgressExecutor | StageHandlerProgressExecutor[] | void\r\n}\r\nexport interface StageHandlerOverallReset {\r\n (ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): void\r\n}\r\nexport interface StageHandler {\r\n /**\r\n * Indicate that the task will be piped all series\r\n * (`performRawSeries` indicate whether includes filtered series).\r\n */\r\n createOnAllSeries?: boolean;\r\n /**\r\n * Indicate that the task will be only piped in the pipeline of this type of series.\r\n * (`performRawSeries` indicate whether includes filtered series).\r\n */\r\n seriesType?: string;\r\n /**\r\n * Indicate that the task will be only piped in the pipeline of the returned series.\r\n */\r\n getTargetSeries?: (ecModel: GlobalModel, api: ExtensionAPI) => HashMap;\r\n\r\n /**\r\n * If `true`, filtered series will also be \"performed\".\r\n */\r\n performRawSeries?: boolean;\r\n\r\n /**\r\n * Called only when this task in a pipeline.\r\n */\r\n plan?: StageHandlerPlan;\r\n /**\r\n * If `overallReset` specified, an \"overall task\" will be created.\r\n * \"overall task\" does not belong to a certain pipeline.\r\n * They always be \"performed\" in certain phase (depends on when they declared).\r\n * They has \"stub\"s to connect with pipelines (one stub for one pipeline),\r\n * delivering info like \"dirty\" and \"output end\".\r\n */\r\n overallReset?: StageHandlerOverallReset;\r\n /**\r\n * Called only when this task in a pipeline, and \"dirty\".\r\n */\r\n reset?: StageHandlerReset;\r\n}\r\n\r\nexport interface StageHandlerInternal extends StageHandler {\r\n uid: string;\r\n visualType?: 'layout' | 'visual';\r\n // modifyOutputEnd?: boolean;\r\n __prio: number;\r\n __raw: StageHandler | StageHandlerOverallReset;\r\n isVisual?: boolean; // PENDING: not used\r\n isLayout?: boolean; // PENDING: not used\r\n}\r\n\r\n\r\nexport type StageHandlerProgressParams = TaskProgressParams;\r\nexport interface StageHandlerProgressExecutor {\r\n dataEach?: (data: SeriesData, idx: number) => void;\r\n progress?: (params: StageHandlerProgressParams, data: SeriesData) => void;\r\n}\r\nexport type StageHandlerPlanReturn = TaskPlanCallbackReturn;\r\nexport interface StageHandlerPlan {\r\n (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload):\r\n StageHandlerPlanReturn\r\n}\r\n\r\nexport interface LoadingEffectCreator {\r\n (api: ExtensionAPI, cfg: object): LoadingEffect;\r\n}\r\nexport interface LoadingEffect extends Element {\r\n resize: () => void;\r\n}\r\n\r\n/**\r\n * 'html' is used for rendering tooltip in extra DOM form, and the result\r\n * string is used as DOM HTML content.\r\n * 'richText' is used for rendering tooltip in rich text form, for those where\r\n * DOM operation is not supported.\r\n */\r\nexport type TooltipRenderMode = 'html' | 'richText';\r\n\r\nexport type TooltipOrderMode = 'valueAsc' | 'valueDesc' | 'seriesAsc' | 'seriesDesc';\r\n\r\n\r\n// ---------------------------------\r\n// Data and dimension related types\r\n// ---------------------------------\r\n\r\n// Finally the user data will be parsed and stored in `list._storage`.\r\n// `NaN` represents \"no data\" (raw data `null`/`undefined`/`NaN`/`'-'`).\r\n// `Date` will be parsed to timestamp.\r\n// Ordinal/category data will be parsed to its index if possible, otherwise\r\n// keep its original string in list._storage.\r\n// Check `convertValue` for more details.\r\nexport type OrdinalRawValue = string | number;\r\nexport type OrdinalNumber = number; // The number mapped from each OrdinalRawValue.\r\n\r\n/**\r\n * @usage For example,\r\n * ```js\r\n * { ordinalNumbers: [2, 5, 3, 4] }\r\n * ```\r\n * means that ordinal 2 should be displayed on tick 0,\r\n * ordinal 5 should be displayed on tick 1, ...\r\n */\r\nexport type OrdinalSortInfo = {\r\n ordinalNumbers: OrdinalNumber[];\r\n};\r\n\r\n/**\r\n * `OptionDataValue` is the primitive value in `series.data` or `dataset.source`.\r\n * `OptionDataValue` are parsed (see `src/data/helper/dataValueHelper.parseDataValue`)\r\n * into `ParsedValue` and stored into `data/SeriesData` storage.\r\n * Note:\r\n * (1) The term \"parse\" does not mean `src/scale/Scale['parse']`.\r\n * (2) If a category dimension is not mapped to any axis, its raw value will NOT be\r\n * parsed to `OrdinalNumber` but keep the original `OrdinalRawValue` in `src/data/SeriesData` storage.\r\n */\r\nexport type ParsedValue = ParsedValueNumeric | OrdinalRawValue;\r\nexport type ParsedValueNumeric = number | OrdinalNumber;\r\n\r\n/**\r\n * `ScaleDataValue` means that the user input primitive value to `src/scale/Scale`.\r\n * (For example, used in `axis.min`, `axis.max`, `convertToPixel`).\r\n * Note:\r\n * `ScaleDataValue` is a little different from `OptionDataValue`, because it will not go through\r\n * `src/data/helper/dataValueHelper.parseDataValue`, but go through `src/scale/Scale['parse']`.\r\n */\r\nexport type ScaleDataValue = ParsedValueNumeric | OrdinalRawValue | Date;\r\n\r\nexport interface ScaleTick {\r\n level?: number,\r\n value: number\r\n};\r\nexport interface TimeScaleTick extends ScaleTick {\r\n /**\r\n * Level information is used for label formatting.\r\n * For example, a time axis may contain labels like: Jan, 8th, 16th, 23th,\r\n * Feb, and etc. In this case, month labels like Jan and Feb should be\r\n * displayed in a more significant way than days.\r\n * `level` is set to be 0 when it's the most significant level, like month\r\n * labels in the above case.\r\n */\r\n level?: number\r\n};\r\nexport interface OrdinalScaleTick extends ScaleTick {\r\n /**\r\n * Represents where the tick will be placed visually.\r\n * Notice:\r\n * The value is not the raw ordinal value. And do not changed\r\n * after ordinal scale sorted.\r\n * We need to:\r\n * ```js\r\n * const coord = dataToCoord(ordinalScale.getRawOrdinalNumber(tick.value)).\r\n * ```\r\n * Why place the tick value here rather than the raw ordinal value (like LogScale did)?\r\n * Because ordinal scale sort is the different case from LogScale, where\r\n * axis tick, splitArea should better not to be sorted, especially in\r\n * anid(animation id) when `boundaryGap: true`.\r\n * Only axis label are sorted.\r\n */\r\n value: number\r\n};\r\n\r\n// Can only be string or index, because it is used in object key in some code.\r\n// Making the type alias here just intending to show the meaning clearly in code.\r\nexport type DimensionIndex = number;\r\n// If being a number-like string but not being defined a dimension name.\r\n// See `List.js#getDimension` for more details.\r\nexport type DimensionIndexLoose = DimensionIndex | string;\r\nexport type DimensionName = string;\r\nexport type DimensionLoose = DimensionName | DimensionIndexLoose;\r\nexport type DimensionType = DataStoreDimensionType;\r\n\r\nexport const VISUAL_DIMENSIONS = createHashMap([\r\n 'tooltip', 'label', 'itemName', 'itemId', 'itemGroupId', 'itemChildGroupId', 'seriesName'\r\n]);\r\n// The key is VISUAL_DIMENSIONS\r\nexport interface DataVisualDimensions {\r\n // can be set as false to directly to prevent this data\r\n // dimension from displaying in the default tooltip.\r\n // see `Series.ts#formatTooltip`.\r\n tooltip?: DimensionIndex | false;\r\n label?: DimensionIndex;\r\n itemName?: DimensionIndex;\r\n itemId?: DimensionIndex;\r\n itemGroupId?: DimensionIndex;\r\n itemChildGroupId?: DimensionIndex;\r\n seriesName?: DimensionIndex;\r\n}\r\n\r\nexport type DimensionDefinition = {\r\n type?: DataStoreDimensionType,\r\n name?: DimensionName,\r\n displayName?: string\r\n};\r\nexport type DimensionDefinitionLoose = DimensionDefinition['name'] | DimensionDefinition;\r\n\r\nexport const SOURCE_FORMAT_ORIGINAL = 'original' as const;\r\nexport const SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows' as const;\r\nexport const SOURCE_FORMAT_OBJECT_ROWS = 'objectRows' as const;\r\nexport const SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns' as const;\r\nexport const SOURCE_FORMAT_TYPED_ARRAY = 'typedArray' as const;\r\nexport const SOURCE_FORMAT_UNKNOWN = 'unknown' as const;\r\n\r\nexport type SourceFormat =\r\n typeof SOURCE_FORMAT_ORIGINAL\r\n | typeof SOURCE_FORMAT_ARRAY_ROWS\r\n | typeof SOURCE_FORMAT_OBJECT_ROWS\r\n | typeof SOURCE_FORMAT_KEYED_COLUMNS\r\n | typeof SOURCE_FORMAT_TYPED_ARRAY\r\n | typeof SOURCE_FORMAT_UNKNOWN;\r\n\r\nexport const SERIES_LAYOUT_BY_COLUMN = 'column' as const;\r\nexport const SERIES_LAYOUT_BY_ROW = 'row' as const;\r\n\r\nexport type SeriesLayoutBy = typeof SERIES_LAYOUT_BY_COLUMN | typeof SERIES_LAYOUT_BY_ROW;\r\n// null/undefined/'auto': auto detect header, see \"src/data/helper/sourceHelper\".\r\n// If number, means header lines count, or say, `startIndex`.\r\n// Like `sourceHeader: 2`, means line 0 and line 1 are header, data start from line 2.\r\nexport type OptionSourceHeader = boolean | 'auto' | number;\r\n\r\nexport type SeriesDataType = 'main' | 'node' | 'edge';\r\n\r\n\r\n// --------------------------------------------\r\n// echarts option types (base and common part)\r\n// --------------------------------------------\r\n\r\n/**\r\n * [ECUnitOption]:\r\n * An object that contains definitions of components\r\n * and other properties. For example:\r\n *\r\n * ```ts\r\n * let option: ECUnitOption = {\r\n *\r\n * // Single `title` component:\r\n * title: {...},\r\n *\r\n * // Two `visualMap` components:\r\n * visualMap: [{...}, {...}],\r\n *\r\n * // Two `series.bar` components\r\n * // and one `series.pie` component:\r\n * series: [\r\n * {type: 'bar', data: [...]},\r\n * {type: 'bar', data: [...]},\r\n * {type: 'pie', data: [...]}\r\n * ],\r\n *\r\n * // A property:\r\n * backgroundColor: '#421ae4'\r\n *\r\n * // A property object:\r\n * textStyle: {\r\n * color: 'red',\r\n * fontSize: 20\r\n * }\r\n * };\r\n * ```\r\n */\r\nexport type ECUnitOption = {\r\n // Exclude these reserved word for `ECOption` to avoid to infer to \"any\".\r\n baseOption?: unknown\r\n options?: unknown\r\n media?: unknown\r\n\r\n timeline?: ComponentOption | ComponentOption[]\r\n backgroundColor?: ZRColor\r\n darkMode?: boolean | 'auto'\r\n textStyle?: Pick\r\n useUTC?: boolean\r\n\r\n [key: string]: ComponentOption | ComponentOption[] | Dictionary | unknown\r\n\r\n stateAnimation?: AnimationOption\r\n} & AnimationOptionMixin & ColorPaletteOptionMixin;\r\n\r\n/**\r\n * [ECOption]:\r\n * An object input to echarts.setOption(option).\r\n * May be an 'option: ECUnitOption',\r\n * or may be an object contains multi-options. For example:\r\n *\r\n * ```ts\r\n * let option: ECOption = {\r\n * baseOption: {\r\n * title: {...},\r\n * legend: {...},\r\n * series: [\r\n * {data: [...]},\r\n * {data: [...]},\r\n * ...\r\n * ]\r\n * },\r\n * timeline: {...},\r\n * options: [\r\n * {title: {...}, series: {data: [...]}},\r\n * {title: {...}, series: {data: [...]}},\r\n * ...\r\n * ],\r\n * media: [\r\n * {\r\n * query: {maxWidth: 320},\r\n * option: {series: {x: 20}, visualMap: {show: false}}\r\n * },\r\n * {\r\n * query: {minWidth: 320, maxWidth: 720},\r\n * option: {series: {x: 500}, visualMap: {show: true}}\r\n * },\r\n * {\r\n * option: {series: {x: 1200}, visualMap: {show: true}}\r\n * }\r\n * ]\r\n * };\r\n * ```\r\n */\r\nexport interface ECBasicOption extends ECUnitOption {\r\n baseOption?: ECUnitOption;\r\n timeline?: ComponentOption | ComponentOption[];\r\n options?: ECUnitOption[];\r\n media?: MediaUnit[];\r\n};\r\n\r\n// series.data or dataset.source\r\nexport type OptionSourceData<\r\n VAL extends OptionDataValue = OptionDataValue,\r\n ORIITEM extends OptionDataItemOriginal = OptionDataItemOriginal\r\n> =\r\n OptionSourceDataOriginal\r\n | OptionSourceDataObjectRows\r\n | OptionSourceDataArrayRows\r\n | OptionSourceDataKeyedColumns\r\n | OptionSourceDataTypedArray;\r\nexport type OptionDataItemOriginal<\r\n VAL extends OptionDataValue = OptionDataValue\r\n> = VAL | VAL[] | OptionDataItemObject;\r\nexport type OptionSourceDataOriginal<\r\n VAL extends OptionDataValue = OptionDataValue,\r\n ORIITEM extends OptionDataItemOriginal = OptionDataItemOriginal\r\n> = ArrayLike;\r\nexport type OptionSourceDataObjectRows =\r\n Array>;\r\nexport type OptionSourceDataArrayRows =\r\n Array>;\r\nexport type OptionSourceDataKeyedColumns =\r\n Dictionary>;\r\nexport type OptionSourceDataTypedArray = ArrayLike;\r\n\r\n// See also `model.js#getDataItemValue`.\r\nexport type OptionDataItem =\r\n OptionDataValue\r\n | Dictionary\r\n | OptionDataValue[]\r\n // FIXME: In some case (markpoint in geo (geo-map.html)), dataItem is {coord: [...]}\r\n | OptionDataItemObject;\r\n// Only for `SOURCE_FORMAT_KEYED_ORIGINAL`\r\nexport type OptionDataItemObject = {\r\n id?: OptionId;\r\n name?: OptionName;\r\n groupId?: OptionId;\r\n childGroupId?: OptionId;\r\n value?: T[] | T;\r\n selected?: boolean;\r\n};\r\n// Compat number because it is usually used and not easy to\r\n// restrict it in practise.\r\nexport type OptionId = string | number;\r\nexport type OptionName = string | number;\r\nexport interface GraphEdgeItemObject<\r\n VAL extends OptionDataValue\r\n> extends OptionDataItemObject {\r\n /**\r\n * Name or index of source node.\r\n */\r\n source?: string | number\r\n /**\r\n * Name or index of target node.\r\n */\r\n target?: string | number\r\n}\r\nexport type OptionDataValue = string | number | Date | null | undefined;\r\n\r\nexport type OptionDataValueNumeric = number | '-';\r\nexport type OptionDataValueCategory = string;\r\nexport type OptionDataValueDate = Date | string | number;\r\n\r\n// export type ModelOption = Dictionary | any[] | string | number | boolean | ((...args: any) => any);\r\nexport type ModelOption = any;\r\nexport type ThemeOption = Dictionary;\r\n\r\nexport type DisplayState = 'normal' | 'emphasis' | 'blur' | 'select';\r\nexport type DisplayStateNonNormal = Exclude;\r\nexport type DisplayStateHostOption = {\r\n emphasis?: Dictionary,\r\n [key: string]: any\r\n};\r\n\r\n// The key is VISUAL_DIMENSIONS\r\nexport interface OptionEncodeVisualDimensions {\r\n tooltip?: OptionEncodeValue;\r\n label?: OptionEncodeValue;\r\n itemName?: OptionEncodeValue;\r\n itemId?: OptionEncodeValue;\r\n seriesName?: OptionEncodeValue;\r\n // Notice: `value` is coordDim, not nonCoordDim.\r\n\r\n // Group id is used for linking the aggregate relationship between two set of data.\r\n // Which is useful in prepresenting the transition key of drilldown/up animation.\r\n // Or hover linking.\r\n itemGroupId?: OptionEncodeValue;\r\n childGroupdId?: OptionEncodeValue;\r\n}\r\nexport interface OptionEncode extends OptionEncodeVisualDimensions {\r\n [coordDim: string]: OptionEncodeValue | undefined\r\n}\r\nexport type OptionEncodeValue = DimensionLoose | DimensionLoose[];\r\nexport type EncodeDefaulter = (source: Source, dimCount: number) => OptionEncode;\r\n\r\n// TODO: TYPE Different callback param for different series\r\nexport interface CallbackDataParams {\r\n // component main type\r\n componentType: string;\r\n // component sub type\r\n componentSubType: string;\r\n componentIndex: number;\r\n // series component sub type\r\n seriesType?: string;\r\n // series component index (the alias of `componentIndex` for series)\r\n seriesIndex?: number;\r\n seriesId?: string;\r\n seriesName?: string;\r\n name: string;\r\n dataIndex: number;\r\n data: OptionDataItem;\r\n dataType?: SeriesDataType;\r\n value: OptionDataItem | OptionDataValue;\r\n color?: ZRColor;\r\n borderColor?: string;\r\n dimensionNames?: DimensionName[];\r\n encode?: DimensionUserOuputEncode;\r\n marker?: TooltipMarker;\r\n status?: DisplayState;\r\n dimensionIndex?: number;\r\n percent?: number; // Only for chart like 'pie'\r\n\r\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\r\n $vars: string[];\r\n}\r\nexport type InterpolatableValue = ParsedValue | ParsedValue[];\r\n\r\nexport type DecalDashArrayX = number | (number | number[])[];\r\nexport type DecalDashArrayY = number | number[];\r\nexport interface DecalObject {\r\n // 'image', 'triangle', 'diamond', 'pin', 'arrow', 'line', 'rect', 'roundRect', 'square', 'circle'\r\n symbol?: string | string[]\r\n\r\n // size relative to the dash bounding box; valued from 0 to 1\r\n symbolSize?: number\r\n // keep the aspect ratio and use the smaller one of width and height as bounding box size\r\n symbolKeepAspect?: boolean\r\n\r\n // foreground color of the pattern\r\n color?: string\r\n // background color of the pattern; default value is 'none' (same as 'transparent') so that the underlying series color is displayed\r\n backgroundColor?: string\r\n\r\n // dash-gap pattern on x\r\n dashArrayX?: DecalDashArrayX\r\n // dash-gap pattern on y\r\n dashArrayY?: DecalDashArrayY\r\n\r\n // in radians; valued from -Math.PI to Math.PI\r\n rotation?: number\r\n\r\n // boundary of largest tile width\r\n maxTileWidth?: number\r\n // boundary of largest tile height\r\n maxTileHeight?: number\r\n};\r\n\r\nexport interface InnerDecalObject extends DecalObject {\r\n // Mark dirty when object may be changed.\r\n // The record in WeakMap will be deleted.\r\n dirty?: boolean\r\n}\r\n\r\nexport interface MediaQuery {\r\n minWidth?: number;\r\n maxWidth?: number;\r\n minHeight?: number;\r\n maxHeight?: number;\r\n minAspectRatio?: number;\r\n maxAspectRatio?: number;\r\n};\r\nexport type MediaUnit = {\r\n query?: MediaQuery,\r\n option: ECUnitOption\r\n};\r\n\r\nexport type ComponentLayoutMode = {\r\n // Only support 'box' now.\r\n type?: 'box',\r\n ignoreSize?: boolean | boolean[]\r\n};\r\n\r\n// ------------------ Mixins for Common Option Properties ------------------\r\nexport type PaletteOptionMixin = ColorPaletteOptionMixin;\r\n\r\nexport interface ColorPaletteOptionMixin {\r\n color?: ZRColor | ZRColor[]\r\n colorLayer?: ZRColor[][]\r\n}\r\n/**\r\n * Mixin of option set to control the box layout of each component.\r\n */\r\nexport interface BoxLayoutOptionMixin {\r\n width?: number | string;\r\n height?: number | string;\r\n top?: number | string;\r\n right?: number | string;\r\n bottom?: number | string;\r\n left?: number | string;\r\n}\r\n\r\nexport interface CircleLayoutOptionMixin {\r\n // Can be percent\r\n center?: (number | string)[]\r\n // Can specify [innerRadius, outerRadius]\r\n radius?: (number | string)[] | number | string\r\n}\r\n\r\nexport interface ShadowOptionMixin {\r\n shadowBlur?: number\r\n shadowColor?: ColorString\r\n shadowOffsetX?: number\r\n shadowOffsetY?: number\r\n}\r\n\r\nexport interface BorderOptionMixin {\r\n borderColor?: ZRColor\r\n borderWidth?: number\r\n borderType?: ZRLineType\r\n borderCap?: CanvasLineCap\r\n borderJoin?: CanvasLineJoin\r\n borderDashOffset?: number\r\n borderMiterLimit?: number\r\n}\r\n\r\nexport type ColorBy = 'series' | 'data';\r\n\r\nexport interface SunburstColorByMixin {\r\n colorBy?: ColorBy\r\n}\r\n\r\nexport type AnimationDelayCallbackParam = {\r\n count: number\r\n index: number\r\n};\r\nexport type AnimationDurationCallback = (idx: number) => number;\r\nexport type AnimationDelayCallback = (idx: number, params?: AnimationDelayCallbackParam) => number;\r\n\r\nexport interface AnimationOption {\r\n duration?: number\r\n easing?: AnimationEasing\r\n delay?: number\r\n // additive?: boolean\r\n}\r\n\r\n/**\r\n * Mixin of option set to control the animation of series.\r\n */\r\nexport interface AnimationOptionMixin {\r\n /**\r\n * If enable animation\r\n */\r\n animation?: boolean\r\n /**\r\n * Disable animation when the number of elements exceeds the threshold\r\n */\r\n animationThreshold?: number\r\n // For init animation\r\n /**\r\n * Duration of initialize animation.\r\n * Can be a callback to specify duration of each element\r\n */\r\n animationDuration?: number | AnimationDurationCallback\r\n /**\r\n * Easing of initialize animation\r\n */\r\n animationEasing?: AnimationEasing\r\n /**\r\n * Delay of initialize animation\r\n * Can be a callback to specify duration of each element\r\n */\r\n animationDelay?: number | AnimationDelayCallback\r\n // For update animation\r\n /**\r\n * Delay of data update animation.\r\n * Can be a callback to specify duration of each element\r\n */\r\n animationDurationUpdate?: number | AnimationDurationCallback\r\n /**\r\n * Easing of data update animation.\r\n */\r\n animationEasingUpdate?: AnimationEasing\r\n /**\r\n * Delay of data update animation.\r\n * Can be a callback to specify duration of each element\r\n */\r\n animationDelayUpdate?: number | AnimationDelayCallback\r\n}\r\n\r\nexport interface RoamOptionMixin {\r\n /**\r\n * If enable roam. can be specified 'scale' or 'move'\r\n */\r\n roam?: boolean | 'pan' | 'move' | 'zoom' | 'scale'\r\n /**\r\n * Current center position.\r\n */\r\n center?: (number | string)[]\r\n /**\r\n * Current zoom level. Default is 1\r\n */\r\n zoom?: number\r\n\r\n scaleLimit?: {\r\n min?: number\r\n max?: number\r\n }\r\n}\r\n\r\n// TODO: TYPE value type?\r\nexport type SymbolSizeCallback = (rawValue: any, params: T) => number | number[];\r\nexport type SymbolCallback = (rawValue: any, params: T) => string;\r\nexport type SymbolRotateCallback = (rawValue: any, params: T) => number;\r\nexport type SymbolOffsetCallback = (rawValue: any, params: T) => string | number | (string | number)[];\r\n/**\r\n * Mixin of option set to control the element symbol.\r\n * Include type of symbol, and size of symbol.\r\n */\r\nexport interface SymbolOptionMixin {\r\n /**\r\n * type of symbol, like `cirlce`, `rect`, or custom path and image.\r\n */\r\n symbol?: string | (T extends never ? never : SymbolCallback)\r\n /**\r\n * Size of symbol.\r\n */\r\n symbolSize?: number | number[] | (T extends never ? never : SymbolSizeCallback)\r\n\r\n symbolRotate?: number | (T extends never ? never : SymbolRotateCallback)\r\n\r\n symbolKeepAspect?: boolean\r\n\r\n symbolOffset?: string | number | (string | number)[] | (T extends never ? never : SymbolOffsetCallback)\r\n}\r\n\r\n/**\r\n * ItemStyleOption is a most common used set to config element styles.\r\n * It includes both fill and stroke style.\r\n */\r\nexport interface ItemStyleOption extends ShadowOptionMixin, BorderOptionMixin {\r\n color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor))\r\n opacity?: number\r\n decal?: DecalObject | 'none'\r\n borderRadius?: (number | string)[] | number | string\r\n}\r\n\r\n/**\r\n * ItemStyleOption is a option set to control styles on lines.\r\n * Used in the components or series like `line`, `axis`\r\n * It includes stroke style.\r\n */\r\nexport interface LineStyleOption extends ShadowOptionMixin {\r\n width?: number\r\n color?: Clr\r\n opacity?: number\r\n type?: ZRLineType\r\n cap?: CanvasLineCap\r\n join?: CanvasLineJoin\r\n dashOffset?: number\r\n miterLimit?: number\r\n}\r\n\r\n/**\r\n * ItemStyleOption is a option set to control styles on an area, like polygon, rectangle.\r\n * It only include fill style.\r\n */\r\nexport interface AreaStyleOption extends ShadowOptionMixin {\r\n color?: Clr\r\n opacity?: number\r\n}\r\n\r\ntype Arrayable> = { [key in keyof T]: T[key] | T[key][] };\r\ntype Dictionaryable> = { [key in keyof T]: T[key] | Dictionary};\r\n\r\nexport interface VisualOptionUnit {\r\n symbol?: string\r\n // TODO Support [number, number]?\r\n symbolSize?: number\r\n color?: ColorString\r\n colorAlpha?: number\r\n opacity?: number\r\n colorLightness?: number\r\n colorSaturation?: number\r\n colorHue?: number\r\n decal?: DecalObject\r\n\r\n // Not exposed?\r\n liftZ?: number\r\n}\r\nexport type VisualOptionFixed = VisualOptionUnit;\r\n/**\r\n * Option about visual properties used in piecewise mapping\r\n * Used in each piece.\r\n */\r\nexport type VisualOptionPiecewise = VisualOptionUnit;\r\n/**\r\n * Option about visual properties used in linear mapping\r\n */\r\nexport type VisualOptionLinear = Arrayable;\r\n\r\n/**\r\n * Option about visual properties can be encoded from ordinal categories.\r\n * Each value can either be a dictonary to lookup with category name, or\r\n * be an array to lookup with category index. In this case the array length should\r\n * be same with categories\r\n */\r\nexport type VisualOptionCategory = Arrayable | Dictionaryable;\r\n\r\n/**\r\n * All visual properties can be encoded.\r\n */\r\nexport type BuiltinVisualProperty = keyof VisualOptionUnit;\r\n\r\nexport interface TextCommonOption extends ShadowOptionMixin {\r\n color?: string\r\n fontStyle?: ZRFontStyle\r\n fontWeight?: ZRFontWeight\r\n fontFamily?: string\r\n fontSize?: number | string\r\n align?: HorizontalAlign\r\n verticalAlign?: VerticalAlign\r\n // @deprecated\r\n baseline?: VerticalAlign\r\n\r\n opacity?: number\r\n\r\n lineHeight?: number\r\n backgroundColor?: ColorString | {\r\n image: ImageLike | string\r\n }\r\n borderColor?: string\r\n borderWidth?: number\r\n borderType?: ZRLineType\r\n borderDashOffset?: number\r\n borderRadius?: number | number[]\r\n padding?: number | number[]\r\n\r\n width?: number | string// Percent\r\n height?: number\r\n textBorderColor?: string\r\n textBorderWidth?: number\r\n textBorderType?: ZRLineType\r\n textBorderDashOffset?: number\r\n\r\n textShadowBlur?: number\r\n textShadowColor?: string\r\n textShadowOffsetX?: number\r\n textShadowOffsetY?: number\r\n\r\n tag?: string\r\n}\r\n\r\nexport interface LabelFormatterCallback {\r\n (params: T): string\r\n}\r\n/**\r\n * LabelOption is an option set to control the style of labels.\r\n * Include color, background, shadow, truncate, rotation, distance, etc..\r\n */\r\nexport interface LabelOption extends TextCommonOption {\r\n /**\r\n * If show label\r\n */\r\n show?: boolean\r\n // TODO: TYPE More specified 'inside', 'insideTop'....\r\n // x, y can be both percent string or number px.\r\n position?: ElementTextConfig['position']\r\n distance?: number\r\n rotate?: number\r\n offset?: number[]\r\n\r\n /**\r\n * Min margin between labels. Used when label has layout.\r\n */\r\n // It's minMargin instead of margin is for not breaking the previous code using margin.\r\n minMargin?: number\r\n\r\n overflow?: TextStyleProps['overflow']\r\n ellipsis?: TextStyleProps['ellipsis']\r\n\r\n silent?: boolean\r\n precision?: number | 'auto'\r\n valueAnimation?: boolean\r\n\r\n // TODO: TYPE not all label support formatter\r\n // formatter?: string | ((params: CallbackDataParams) => string)\r\n\r\n rich?: Dictionary\r\n}\r\n\r\nexport interface SeriesLabelOption extends LabelOption {\r\n formatter?: string | LabelFormatterCallback\r\n}\r\n\r\n/**\r\n * Option for labels on line, like markLine, lines\r\n */\r\nexport interface LineLabelOption extends Omit {\r\n position?: 'start'\r\n | 'middle'\r\n | 'end'\r\n | 'insideStart'\r\n | 'insideStartTop'\r\n | 'insideStartBottom'\r\n | 'insideMiddle'\r\n | 'insideMiddleTop'\r\n | 'insideMiddleBottom'\r\n | 'insideEnd'\r\n | 'insideEndTop'\r\n | 'insideEndBottom'\r\n | 'insideMiddleBottom'\r\n /**\r\n * Distance can be an array.\r\n * Which will specify horizontal and vertical distance respectively\r\n */\r\n distance?: number | number[]\r\n}\r\n\r\nexport interface LabelLineOption {\r\n show?: boolean\r\n /**\r\n * If displayed above other elements\r\n */\r\n showAbove?: boolean\r\n length?: number\r\n length2?: number\r\n smooth?: boolean | number\r\n minTurnAngle?: number,\r\n lineStyle?: LineStyleOption\r\n}\r\n\r\nexport interface SeriesLineLabelOption extends LineLabelOption {\r\n formatter?: string | LabelFormatterCallback\r\n}\r\n\r\n\r\n\r\nexport interface LabelLayoutOptionCallbackParams {\r\n /**\r\n * Index of data which the label represents.\r\n * It can be null if label doesn't represent any data.\r\n */\r\n dataIndex?: number,\r\n /**\r\n * Type of data which the label represents.\r\n * It can be null if label doesn't represent any data.\r\n */\r\n dataType?: SeriesDataType,\r\n seriesIndex: number,\r\n text: string\r\n align: ZRTextAlign\r\n verticalAlign: ZRTextVerticalAlign\r\n rect: RectLike\r\n labelRect: RectLike\r\n // Points of label line in pie/funnel\r\n labelLinePoints?: number[][]\r\n // x: number\r\n // y: number\r\n};\r\n\r\nexport interface LabelLayoutOption {\r\n /**\r\n * If move the overlapped label. If label is still overlapped after moved.\r\n * It will determine if to hide this label with `hideOverlap` policy.\r\n *\r\n * shiftX/Y will keep the order on x/y\r\n * shuffleX/y will move the label around the original position randomly.\r\n */\r\n moveOverlap?: 'shiftX'\r\n | 'shiftY'\r\n | 'shuffleX'\r\n | 'shuffleY'\r\n /**\r\n * If hide the overlapped label. It will be handled after move.\r\n * @default 'none'\r\n */\r\n hideOverlap?: boolean\r\n /**\r\n * If label is draggable.\r\n */\r\n draggable?: boolean\r\n /**\r\n * Can be absolute px number or percent string.\r\n */\r\n x?: number | string\r\n y?: number | string\r\n /**\r\n * offset on x based on the original position.\r\n */\r\n dx?: number\r\n /**\r\n * offset on y based on the original position.\r\n */\r\n dy?: number\r\n rotate?: number\r\n\r\n align?: ZRTextAlign\r\n verticalAlign?: ZRTextVerticalAlign\r\n width?: number\r\n height?: number\r\n fontSize?: number\r\n\r\n labelLinePoints?: number[][]\r\n}\r\n\r\nexport type LabelLayoutOptionCallback = (params: LabelLayoutOptionCallbackParams) => LabelLayoutOption;\r\n\r\n\r\nexport interface TooltipFormatterCallback {\r\n /**\r\n * For sync callback\r\n * params will be an array on axis trigger.\r\n */\r\n (params: T, asyncTicket: string): string | HTMLElement | HTMLElement[]\r\n /**\r\n * For async callback.\r\n * Returned html string will be a placeholder when callback is not invoked.\r\n */\r\n (\r\n params: T, asyncTicket: string,\r\n callback: (cbTicket: string, htmlOrDomNodes: string | HTMLElement | HTMLElement[]) => void\r\n ) : string | HTMLElement | HTMLElement[]\r\n}\r\n\r\ntype TooltipBuiltinPosition = 'inside' | 'top' | 'left' | 'right' | 'bottom';\r\ntype TooltipBoxLayoutOption = Pick<\r\n BoxLayoutOptionMixin, 'top' | 'left' | 'right' | 'bottom'\r\n>;\r\n\r\nexport type TooltipPositionCallbackParams = CallbackDataParams | CallbackDataParams[];\r\n\r\n/**\r\n * Position relative to the hoverred element. Only available when trigger is item.\r\n */\r\nexport interface TooltipPositionCallback {\r\n (\r\n point: [number, number],\r\n /**\r\n * params will be an array on axis trigger.\r\n */\r\n params: TooltipPositionCallbackParams,\r\n /**\r\n * Will be HTMLDivElement when renderMode is html\r\n * Otherwise it's graphic.Text\r\n */\r\n el: HTMLDivElement | ZRText | null,\r\n /**\r\n * Rect of hover elements. Will be null if not hovered\r\n */\r\n rect: RectLike | null,\r\n size: {\r\n /**\r\n * Size of popup content\r\n */\r\n contentSize: [number, number]\r\n /**\r\n * Size of the chart view\r\n */\r\n viewSize: [number, number]\r\n }\r\n ): Array | TooltipBuiltinPosition | TooltipBoxLayoutOption\r\n}\r\n/**\r\n * Common tooltip option\r\n * Can be configured on series, graphic elements\r\n */\r\nexport interface CommonTooltipOption {\r\n\r\n show?: boolean\r\n\r\n /**\r\n * When to trigger\r\n */\r\n triggerOn?: 'mousemove' | 'click' | 'none' | 'mousemove|click'\r\n /**\r\n * Whether to not hide popup content automatically\r\n */\r\n alwaysShowContent?: boolean\r\n\r\n formatter?: string | TooltipFormatterCallback\r\n\r\n /**\r\n * Formatter of value.\r\n *\r\n * Will be ignored if tooltip.formatter is specified.\r\n */\r\n valueFormatter?: (value: OptionDataValue | OptionDataValue[], dataIndex: number) => string\r\n /**\r\n * Absolution pixel [x, y] array. Or relative percent string [x, y] array.\r\n * If trigger is 'item'. position can be set to 'inside' / 'top' / 'left' / 'right' / 'bottom',\r\n * which is relative to the hovered element.\r\n *\r\n * Support to be a callback\r\n */\r\n position?: (number | string)[] | TooltipBuiltinPosition | TooltipPositionCallback | TooltipBoxLayoutOption\r\n\r\n confine?: boolean\r\n\r\n /**\r\n * Consider triggered from axisPointer handle, verticalAlign should be 'middle'\r\n */\r\n align?: HorizontalAlign\r\n\r\n verticalAlign?: VerticalAlign\r\n /**\r\n * Delay of show. milesecond.\r\n */\r\n showDelay?: number\r\n\r\n /**\r\n * Delay of hide. milesecond.\r\n */\r\n hideDelay?: number\r\n\r\n transitionDuration?: number\r\n /**\r\n * Whether mouse is allowed to enter the floating layer of tooltip\r\n * If you need to interact in the tooltip like with links or buttons, it can be set as true.\r\n */\r\n enterable?: boolean\r\n\r\n backgroundColor?: ColorString\r\n borderColor?: ColorString\r\n borderRadius?: number\r\n borderWidth?: number\r\n shadowBlur?: number\r\n shadowColor?: string\r\n shadowOffsetX?: number\r\n shadowOffsetY?: number\r\n\r\n /**\r\n * Padding between tooltip content and tooltip border.\r\n */\r\n padding?: number | number[]\r\n\r\n /**\r\n * Available when renderMode is 'html'\r\n */\r\n extraCssText?: string\r\n\r\n textStyle?: Pick & {\r\n\r\n // Available when renderMode is html\r\n decoration?: string\r\n }\r\n}\r\n\r\nexport type ComponentItemTooltipOption = CommonTooltipOption & {\r\n // Default content HTML.\r\n content?: string;\r\n /**\r\n * Whether to encode HTML content according to `tooltip.renderMode`.\r\n *\r\n * e.g. renderMode 'html' needs to encode but 'richText' does not.\r\n */\r\n encodeHTMLContent?: boolean;\r\n formatterParams?: ComponentItemTooltipLabelFormatterParams;\r\n};\r\nexport type ComponentItemTooltipLabelFormatterParams = {\r\n componentType: string\r\n name: string\r\n // properties key array like ['name']\r\n $vars: string[]\r\n} & {\r\n // Other properties\r\n [key in string]: unknown\r\n};\r\n\r\n\r\n/**\r\n * Tooltip option configured on each series\r\n */\r\nexport type SeriesTooltipOption = CommonTooltipOption & {\r\n trigger?: 'item' | 'axis' | boolean | 'none'\r\n};\r\n\r\n\r\n\r\n\r\ntype LabelFormatterParams = {\r\n value: ScaleDataValue\r\n axisDimension: string\r\n axisIndex: number\r\n seriesData: CallbackDataParams[]\r\n};\r\n/**\r\n * Common axis option. can be configured on each axis\r\n */\r\nexport interface CommonAxisPointerOption {\r\n show?: boolean | 'auto'\r\n\r\n z?: number;\r\n zlevel?: number;\r\n\r\n triggerOn?: 'click' | 'mousemove' | 'none' | 'mousemove|click'\r\n\r\n type?: 'line' | 'shadow' | 'none'\r\n\r\n snap?: boolean\r\n\r\n triggerTooltip?: boolean\r\n\r\n triggerEmphasis?: boolean\r\n\r\n /**\r\n * current value. When using axisPointer.handle, value can be set to define the initial position of axisPointer.\r\n */\r\n value?: ScaleDataValue\r\n\r\n status?: 'show' | 'hide'\r\n\r\n // [group0, group1, ...]\r\n // Each group can be: {\r\n // mapper: function () {},\r\n // singleTooltip: 'multiple', // 'multiple' or 'single'\r\n // xAxisId: ...,\r\n // yAxisName: ...,\r\n // angleAxisIndex: ...\r\n // }\r\n // mapper: can be ignored.\r\n // input: {axisInfo, value}\r\n // output: {axisInfo, value}\r\n\r\n label?: LabelOption & {\r\n precision?: 'auto' | number\r\n margin?: number\r\n /**\r\n * String template include variable {value} or callback function\r\n */\r\n formatter?: string | ((params: LabelFormatterParams) => string)\r\n }\r\n animation?: boolean | 'auto'\r\n animationDurationUpdate?: number\r\n animationEasingUpdate?: ZREasing\r\n\r\n /**\r\n * Available when type is 'line'\r\n */\r\n lineStyle?: LineStyleOption\r\n /**\r\n * Available when type is 'shadow'\r\n */\r\n shadowStyle?: AreaStyleOption\r\n\r\n handle?: {\r\n show?: boolean\r\n icon?: string\r\n /**\r\n * The size of the handle\r\n */\r\n size?: number | number[]\r\n /**\r\n * Distance from handle center to axis.\r\n */\r\n margin?: number\r\n\r\n color?: ColorString\r\n\r\n /**\r\n * Throttle for mobile performance\r\n */\r\n throttle?: number\r\n } & ShadowOptionMixin\r\n\r\n\r\n seriesDataIndices?: {\r\n seriesIndex: number\r\n dataIndex: number\r\n dataIndexInside: number\r\n }[]\r\n\r\n}\r\n\r\nexport interface ComponentOption {\r\n mainType?: string;\r\n\r\n type?: string;\r\n\r\n id?: OptionId;\r\n name?: OptionName;\r\n\r\n z?: number;\r\n zlevel?: number;\r\n}\r\n\r\nexport type BlurScope = 'coordinateSystem' | 'series' | 'global';\r\n\r\n/**\r\n * can be array of data indices.\r\n * Or may be an dictionary if have different types of data like in graph.\r\n */\r\nexport type InnerFocus = DefaultEmphasisFocus | ArrayLike | Dictionary>;\r\n\r\nexport interface DefaultStatesMixin {\r\n // FIXME\r\n emphasis?: any\r\n select?: any\r\n blur?: any\r\n}\r\n\r\nexport type DefaultEmphasisFocus = 'none' | 'self' | 'series';\r\n\r\nexport interface DefaultStatesMixinEmphasis {\r\n /**\r\n * self: Focus self and blur all others.\r\n * series: Focus series and blur all other series.\r\n */\r\n focus?: DefaultEmphasisFocus\r\n}\r\n\r\nexport interface StatesMixinBase {\r\n emphasis?: unknown\r\n select?: unknown\r\n blur?: unknown\r\n}\r\n\r\nexport interface StatesOptionMixin<\r\n StateOption,\r\n StatesMixin extends StatesMixinBase\r\n> {\r\n /**\r\n * Emphasis states\r\n */\r\n emphasis?: StateOption & StatesMixin['emphasis'] & {\r\n /**\r\n * Scope of blurred element when focus.\r\n *\r\n * coordinateSystem: blur others in the same coordinateSystem\r\n * series: blur others in the same series\r\n * global: blur all others\r\n *\r\n * Default to be coordinate system.\r\n */\r\n blurScope?: BlurScope\r\n\r\n /**\r\n * If emphasis state is disabled.\r\n */\r\n disabled?: boolean\r\n }\r\n /**\r\n * Select states\r\n */\r\n select?: StateOption & StatesMixin['select'] & {\r\n disabled?: boolean\r\n }\r\n /**\r\n * Blur states.\r\n */\r\n blur?: StateOption & StatesMixin['blur']\r\n}\r\n\r\nexport interface UniversalTransitionOption {\r\n enabled?: boolean\r\n /**\r\n * Animation delay of each divided element\r\n */\r\n delay?: (index: number, count: number) => number\r\n /**\r\n * How to divide the shape in combine and split animation.\r\n */\r\n divideShape?: 'clone' | 'split'\r\n /**\r\n * Series will have transition between if they have same seriesKey.\r\n * Usually it is a string. It can also be an array,\r\n * which means it can be transition from or to multiple series with each key in this array item.\r\n *\r\n * Note:\r\n * If two series have both array seriesKey. They will be compared after concated to a string(which is order independent)\r\n * Transition between string key has higher priority.\r\n *\r\n * Default to use series id.\r\n */\r\n seriesKey?: string | string[]\r\n}\r\n\r\nexport interface SeriesOption<\r\n StateOption = unknown,\r\n StatesMixin extends StatesMixinBase = DefaultStatesMixin\r\n> extends\r\n ComponentOption,\r\n AnimationOptionMixin,\r\n ColorPaletteOptionMixin,\r\n StatesOptionMixin\r\n{\r\n mainType?: 'series'\r\n\r\n silent?: boolean\r\n\r\n blendMode?: string\r\n\r\n /**\r\n * Cursor when mouse on the elements\r\n */\r\n cursor?: string\r\n\r\n /**\r\n * groupId of data. can be used for doing drilldown / up animation\r\n * It will be ignored if:\r\n * - groupId is specified in each data\r\n * - encode.itemGroupId is given.\r\n */\r\n dataGroupId?: OptionId\r\n // Needs to be override\r\n data?: unknown\r\n\r\n colorBy?: ColorBy\r\n\r\n legendHoverLink?: boolean\r\n\r\n /**\r\n * Configurations about progressive rendering\r\n */\r\n progressive?: number | false\r\n progressiveThreshold?: number\r\n progressiveChunkMode?: 'mod'\r\n /**\r\n * Not available on every series\r\n */\r\n coordinateSystem?: string\r\n\r\n hoverLayerThreshold?: number\r\n\r\n /**\r\n * When dataset is used, seriesLayoutBy specifies whether the column or the row of dataset is mapped to the series\r\n * namely, the series is \"layout\" on columns or rows\r\n * @default 'column'\r\n */\r\n seriesLayoutBy?: 'column' | 'row'\r\n\r\n labelLine?: LabelLineOption\r\n\r\n /**\r\n * Overall label layout option in label layout stage.\r\n */\r\n labelLayout?: LabelLayoutOption | LabelLayoutOptionCallback\r\n\r\n /**\r\n * Animation config for state transition.\r\n */\r\n stateAnimation?: AnimationOption\r\n\r\n /**\r\n * If enabled universal transition cross series.\r\n * @example\r\n * universalTransition: true\r\n * universalTransition: { enabled: true }\r\n */\r\n universalTransition?: boolean | UniversalTransitionOption\r\n\r\n /**\r\n * Map of selected data\r\n * key is name or index of data.\r\n */\r\n selectedMap?: Dictionary | 'all'\r\n selectedMode?: 'single' | 'multiple' | 'series' | boolean\r\n}\r\n\r\nexport interface SeriesOnCartesianOptionMixin {\r\n xAxisIndex?: number\r\n yAxisIndex?: number\r\n\r\n xAxisId?: string\r\n yAxisId?: string\r\n}\r\n\r\nexport interface SeriesOnPolarOptionMixin {\r\n polarIndex?: number\r\n polarId?: string;\r\n}\r\n\r\nexport interface SeriesOnSingleOptionMixin {\r\n singleAxisIndex?: number\r\n singleAxisId?: string\r\n}\r\n\r\nexport interface SeriesOnGeoOptionMixin {\r\n geoIndex?: number;\r\n geoId?: string\r\n}\r\n\r\nexport interface SeriesOnCalendarOptionMixin {\r\n calendarIndex?: number\r\n calendarId?: string\r\n}\r\n\r\nexport interface SeriesLargeOptionMixin {\r\n large?: boolean\r\n largeThreshold?: number\r\n}\r\nexport interface SeriesStackOptionMixin {\r\n stack?: string\r\n stackStrategy?: 'samesign' | 'all' | 'positive' | 'negative';\r\n}\r\n\r\ntype SamplingFunc = (frame: ArrayLike) => number;\r\n\r\nexport interface SeriesSamplingOptionMixin {\r\n sampling?: 'none' | 'average' | 'min' | 'max' | 'minmax' | 'sum' | 'lttb' | SamplingFunc\r\n}\r\n\r\nexport interface SeriesEncodeOptionMixin {\r\n datasetIndex?: number;\r\n datasetId?: string | number;\r\n seriesLayoutBy?: SeriesLayoutBy;\r\n sourceHeader?: OptionSourceHeader;\r\n dimensions?: DimensionDefinitionLoose[];\r\n encode?: OptionEncode\r\n}\r\n\r\nexport type SeriesEncodableModel = SeriesModel;\r\n\r\n\r\n// TODO Move to aria component\r\nexport interface AriaLabelOption {\r\n enabled?: boolean;\r\n description?: string;\r\n general?: {\r\n withTitle?: string;\r\n withoutTitle?: string;\r\n };\r\n series?: {\r\n maxCount?: number;\r\n single?: {\r\n prefix?: string;\r\n withName?: string;\r\n withoutName?: string;\r\n };\r\n multiple?: {\r\n prefix?: string;\r\n withName?: string;\r\n withoutName?: string;\r\n separator?: {\r\n middle?: string;\r\n end?: string;\r\n }\r\n }\r\n };\r\n data?: {\r\n maxCount?: number;\r\n allData?: string;\r\n partialData?: string;\r\n withName?: string;\r\n withoutName?: string;\r\n separator?: {\r\n middle?: string;\r\n end?: string;\r\n },\r\n excludeDimensionId?: number[]\r\n }\r\n}\r\n\r\n// Extending is for compating ECharts 4\r\nexport interface AriaOption extends AriaLabelOption {\r\n mainType?: 'aria';\r\n\r\n enabled?: boolean;\r\n label?: AriaLabelOption;\r\n decal?: {\r\n show?: boolean;\r\n decals?: DecalObject | DecalObject[];\r\n };\r\n}\r\n\r\nexport interface AriaOptionMixin {\r\n aria?: AriaOption\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport {makeInner, getDataItemValue, queryReferringComponents, SINGLE_REFERRING} from '../../util/model';\r\nimport {\r\n createHashMap,\r\n each,\r\n isArray,\r\n isString,\r\n isObject,\r\n isTypedArray,\r\n HashMap\r\n} from 'zrender/src/core/util';\r\nimport { Source } from '../Source';\r\n\r\nimport {\r\n SOURCE_FORMAT_ORIGINAL,\r\n SOURCE_FORMAT_ARRAY_ROWS,\r\n SOURCE_FORMAT_OBJECT_ROWS,\r\n SERIES_LAYOUT_BY_ROW,\r\n SOURCE_FORMAT_KEYED_COLUMNS,\r\n DimensionName,\r\n OptionSourceDataArrayRows,\r\n OptionDataValue,\r\n OptionSourceDataKeyedColumns,\r\n OptionSourceDataOriginal,\r\n OptionSourceDataObjectRows,\r\n OptionEncode,\r\n DimensionIndex,\r\n SeriesEncodableModel\r\n} from '../../util/types';\r\nimport { DatasetModel } from '../../component/dataset/install';\r\nimport SeriesModel from '../../model/Series';\r\nimport GlobalModel from '../../model/Global';\r\nimport { CoordDimensionDefinition } from './createDimensions';\r\n\r\n// The result of `guessOrdinal`.\r\nexport const BE_ORDINAL = {\r\n Must: 1, // Encounter string but not '-' and not number-like.\r\n Might: 2, // Encounter string but number-like.\r\n Not: 3 // Other cases\r\n};\r\ntype BeOrdinalValue = (typeof BE_ORDINAL)[keyof typeof BE_ORDINAL];\r\n\r\nconst innerGlobalModel = makeInner<{\r\n datasetMap: HashMap\r\n}, GlobalModel>();\r\n\r\n\r\ninterface DatasetRecord {\r\n categoryWayDim: number;\r\n valueWayDim: number;\r\n}\r\n\r\ntype SeriesEncodeInternal = {\r\n [key in keyof OptionEncode]: DimensionIndex[];\r\n};\r\n\r\n/**\r\n * MUST be called before mergeOption of all series.\r\n */\r\nexport function resetSourceDefaulter(ecModel: GlobalModel): void {\r\n // `datasetMap` is used to make default encode.\r\n innerGlobalModel(ecModel).datasetMap = createHashMap();\r\n}\r\n\r\n/**\r\n * [The strategy of the arrengment of data dimensions for dataset]:\r\n * \"value way\": all axes are non-category axes. So series one by one take\r\n * several (the number is coordSysDims.length) dimensions from dataset.\r\n * The result of data arrengment of data dimensions like:\r\n * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\r\n * \"category way\": at least one axis is category axis. So the the first data\r\n * dimension is always mapped to the first category axis and shared by\r\n * all of the series. The other data dimensions are taken by series like\r\n * \"value way\" does.\r\n * The result of data arrengment of data dimensions like:\r\n * | ser_shared_x | ser0_y | ser1_y | ser2_y |\r\n *\r\n * @return encode Never be `null/undefined`.\r\n */\r\nexport function makeSeriesEncodeForAxisCoordSys(\r\n coordDimensions: (DimensionName | CoordDimensionDefinition)[],\r\n seriesModel: SeriesModel,\r\n source: Source\r\n): SeriesEncodeInternal {\r\n const encode: SeriesEncodeInternal = {};\r\n\r\n const datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n // Currently only make default when using dataset, util more reqirements occur.\r\n if (!datasetModel || !coordDimensions) {\r\n return encode;\r\n }\r\n\r\n const encodeItemName: DimensionIndex[] = [];\r\n const encodeSeriesName: DimensionIndex[] = [];\r\n\r\n const ecModel = seriesModel.ecModel;\r\n const datasetMap = innerGlobalModel(ecModel).datasetMap;\r\n const key = datasetModel.uid + '_' + source.seriesLayoutBy;\r\n\r\n let baseCategoryDimIndex: number;\r\n let categoryWayValueDimStart;\r\n coordDimensions = coordDimensions.slice();\r\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\r\n const coordDimInfo: CoordDimensionDefinition = isObject(coordDimInfoLoose)\r\n ? coordDimInfoLoose\r\n : (coordDimensions[coordDimIdx] = { name: coordDimInfoLoose as DimensionName });\r\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\r\n baseCategoryDimIndex = coordDimIdx;\r\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\r\n }\r\n encode[coordDimInfo.name] = [];\r\n });\r\n\r\n const datasetRecord = datasetMap.get(key)\r\n || datasetMap.set(key, {categoryWayDim: categoryWayValueDimStart, valueWayDim: 0});\r\n\r\n // TODO\r\n // Auto detect first time axis and do arrangement.\r\n each(coordDimensions, function (coordDimInfo: CoordDimensionDefinition, coordDimIdx) {\r\n const coordDimName = coordDimInfo.name;\r\n const count = getDataDimCountOnCoordDim(coordDimInfo);\r\n\r\n // In value way.\r\n if (baseCategoryDimIndex == null) {\r\n const start = datasetRecord.valueWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.valueWayDim += count;\r\n\r\n // ??? TODO give a better default series name rule?\r\n // especially when encode x y specified.\r\n // consider: when multiple series share one dimension\r\n // category axis, series name should better use\r\n // the other dimension name. On the other hand, use\r\n // both dimensions name.\r\n }\r\n // In category way, the first category axis.\r\n else if (baseCategoryDimIndex === coordDimIdx) {\r\n pushDim(encode[coordDimName], 0, count);\r\n pushDim(encodeItemName, 0, count);\r\n }\r\n // In category way, the other axis.\r\n else {\r\n const start = datasetRecord.categoryWayDim;\r\n pushDim(encode[coordDimName], start, count);\r\n pushDim(encodeSeriesName, start, count);\r\n datasetRecord.categoryWayDim += count;\r\n }\r\n });\r\n\r\n function pushDim(dimIdxArr: DimensionIndex[], idxFrom: number, idxCount: number) {\r\n for (let i = 0; i < idxCount; i++) {\r\n dimIdxArr.push(idxFrom + i);\r\n }\r\n }\r\n\r\n function getDataDimCountOnCoordDim(coordDimInfo: CoordDimensionDefinition) {\r\n const dimsDef = coordDimInfo.dimsDef;\r\n return dimsDef ? dimsDef.length : 1;\r\n }\r\n\r\n encodeItemName.length && (encode.itemName = encodeItemName);\r\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\r\n\r\n return encode;\r\n}\r\n\r\n/**\r\n * Work for data like [{name: ..., value: ...}, ...].\r\n *\r\n * @return encode Never be `null/undefined`.\r\n */\r\nexport function makeSeriesEncodeForNameBased(\r\n seriesModel: SeriesModel,\r\n source: Source,\r\n dimCount: number\r\n): SeriesEncodeInternal {\r\n const encode: SeriesEncodeInternal = {};\r\n\r\n const datasetModel = querySeriesUpstreamDatasetModel(seriesModel);\r\n // Currently only make default when using dataset, util more reqirements occur.\r\n if (!datasetModel) {\r\n return encode;\r\n }\r\n\r\n const sourceFormat = source.sourceFormat;\r\n const dimensionsDefine = source.dimensionsDefine;\r\n\r\n let potentialNameDimIndex;\r\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n each(dimensionsDefine, function (dim, idx) {\r\n if ((isObject(dim) ? dim.name : dim) === 'name') {\r\n potentialNameDimIndex = idx;\r\n }\r\n });\r\n }\r\n\r\n type IdxResult = { v: number, n: number };\r\n\r\n const idxResult = (function () {\r\n\r\n const idxRes0 = {} as IdxResult;\r\n const idxRes1 = {} as IdxResult;\r\n const guessRecords = [];\r\n\r\n // 5 is an experience value.\r\n for (let i = 0, len = Math.min(5, dimCount); i < len; i++) {\r\n const guessResult = doGuessOrdinal(\r\n source.data, sourceFormat, source.seriesLayoutBy,\r\n dimensionsDefine, source.startIndex, i\r\n );\r\n guessRecords.push(guessResult);\r\n const isPureNumber = guessResult === BE_ORDINAL.Not;\r\n\r\n // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\r\n // and then find a name dim with the priority:\r\n // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\r\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\r\n idxRes0.v = i;\r\n }\r\n if (idxRes0.n == null\r\n || (idxRes0.n === idxRes0.v)\r\n || (!isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not)\r\n ) {\r\n idxRes0.n = i;\r\n }\r\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\r\n return idxRes0;\r\n }\r\n\r\n // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\r\n // find the first BE_ORDINAL.Might as the value dim,\r\n // and then find a name dim with the priority:\r\n // \"other dim\" > \"the value dim itself\".\r\n // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\r\n // treated as number.\r\n if (!isPureNumber) {\r\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\r\n idxRes1.v = i;\r\n }\r\n if (idxRes1.n == null || (idxRes1.n === idxRes1.v)) {\r\n idxRes1.n = i;\r\n }\r\n }\r\n }\r\n\r\n function fulfilled(idxResult: IdxResult) {\r\n return idxResult.v != null && idxResult.n != null;\r\n }\r\n\r\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\r\n })();\r\n\r\n if (idxResult) {\r\n encode.value = [idxResult.v];\r\n // `potentialNameDimIndex` has highest priority.\r\n const nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;\r\n // By default, label uses itemName in charts.\r\n // So we don't set encodeLabel here.\r\n encode.itemName = [nameDimIndex];\r\n encode.seriesName = [nameDimIndex];\r\n }\r\n\r\n return encode;\r\n}\r\n\r\n/**\r\n * @return If return null/undefined, indicate that should not use datasetModel.\r\n */\r\nexport function querySeriesUpstreamDatasetModel(\r\n seriesModel: SeriesEncodableModel\r\n): DatasetModel {\r\n // Caution: consider the scenario:\r\n // A dataset is declared and a series is not expected to use the dataset,\r\n // and at the beginning `setOption({series: { noData })` (just prepare other\r\n // option but no data), then `setOption({series: {data: [...]}); In this case,\r\n // the user should set an empty array to avoid that dataset is used by default.\r\n const thisData = seriesModel.get('data', true);\r\n if (!thisData) {\r\n return queryReferringComponents(\r\n seriesModel.ecModel,\r\n 'dataset',\r\n {\r\n index: seriesModel.get('datasetIndex', true),\r\n id: seriesModel.get('datasetId', true)\r\n },\r\n SINGLE_REFERRING\r\n ).models[0] as DatasetModel;\r\n }\r\n}\r\n\r\n/**\r\n * @return Always return an array event empty.\r\n */\r\nexport function queryDatasetUpstreamDatasetModels(\r\n datasetModel: DatasetModel\r\n): DatasetModel[] {\r\n // Only these attributes declared, we by default reference to `datasetIndex: 0`.\r\n // Otherwise, no reference.\r\n if (!datasetModel.get('transform', true)\r\n && !datasetModel.get('fromTransformResult', true)\r\n ) {\r\n return [];\r\n }\r\n\r\n return queryReferringComponents(\r\n datasetModel.ecModel,\r\n 'dataset',\r\n {\r\n index: datasetModel.get('fromDatasetIndex', true),\r\n id: datasetModel.get('fromDatasetId', true)\r\n },\r\n SINGLE_REFERRING\r\n ).models as DatasetModel[];\r\n}\r\n\r\n/**\r\n * The rule should not be complex, otherwise user might not\r\n * be able to known where the data is wrong.\r\n * The code is ugly, but how to make it neat?\r\n */\r\nexport function guessOrdinal(source: Source, dimIndex: DimensionIndex): BeOrdinalValue {\r\n return doGuessOrdinal(\r\n source.data,\r\n source.sourceFormat,\r\n source.seriesLayoutBy,\r\n source.dimensionsDefine,\r\n source.startIndex,\r\n dimIndex\r\n );\r\n}\r\n\r\n// dimIndex may be overflow source data.\r\n// return {BE_ORDINAL}\r\nfunction doGuessOrdinal(\r\n data: Source['data'],\r\n sourceFormat: Source['sourceFormat'],\r\n seriesLayoutBy: Source['seriesLayoutBy'],\r\n dimensionsDefine: Source['dimensionsDefine'],\r\n startIndex: Source['startIndex'],\r\n dimIndex: DimensionIndex\r\n): BeOrdinalValue {\r\n let result;\r\n // Experience value.\r\n const maxLoop = 5;\r\n\r\n if (isTypedArray(data)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n\r\n // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\r\n // always exists in source.\r\n let dimName;\r\n let dimType;\r\n if (dimensionsDefine) {\r\n const dimDefItem = dimensionsDefine[dimIndex];\r\n if (isObject(dimDefItem)) {\r\n dimName = dimDefItem.name;\r\n dimType = dimDefItem.type;\r\n }\r\n else if (isString(dimDefItem)) {\r\n dimName = dimDefItem;\r\n }\r\n }\r\n\r\n if (dimType != null) {\r\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\r\n }\r\n\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n const dataArrayRows = data as OptionSourceDataArrayRows;\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n const sample = dataArrayRows[dimIndex];\r\n for (let i = 0; i < (sample || []).length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[startIndex + i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else {\r\n for (let i = 0; i < dataArrayRows.length && i < maxLoop; i++) {\r\n const row = dataArrayRows[startIndex + i];\r\n if (row && (result = detectValue(row[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n const dataObjectRows = data as OptionSourceDataObjectRows;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (let i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\r\n const item = dataObjectRows[i];\r\n if (item && (result = detectValue(item[dimName])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n const dataKeyedColumns = data as OptionSourceDataKeyedColumns;\r\n if (!dimName) {\r\n return BE_ORDINAL.Not;\r\n }\r\n const sample = dataKeyedColumns[dimName];\r\n if (!sample || isTypedArray(sample)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n for (let i = 0; i < sample.length && i < maxLoop; i++) {\r\n if ((result = detectValue(sample[i])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n const dataOriginal = data as OptionSourceDataOriginal;\r\n for (let i = 0; i < dataOriginal.length && i < maxLoop; i++) {\r\n const item = dataOriginal[i];\r\n const val = getDataItemValue(item);\r\n if (!isArray(val)) {\r\n return BE_ORDINAL.Not;\r\n }\r\n if ((result = detectValue(val[dimIndex])) != null) {\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n function detectValue(val: OptionDataValue): BeOrdinalValue {\r\n const beStr = isString(val);\r\n // Consider usage convenience, '1', '2' will be treated as \"number\".\r\n // `Number('')` (or any whitespace) is `0`.\r\n if (val != null && Number.isFinite(Number(val)) && val !== '') {\r\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\r\n }\r\n else if (beStr && val !== '-') {\r\n return BE_ORDINAL.Must;\r\n }\r\n }\r\n\r\n return BE_ORDINAL.Not;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from './Global';\r\nimport { ComponentOption, ComponentMainType } from '../util/types';\r\nimport { createHashMap, assert } from 'zrender/src/core/util';\r\nimport { isComponentIdInternal } from '../util/model';\r\n\r\n// PNEDING:\r\n// (1) Only Internal usage at present, do not export to uses.\r\n// (2) \"Internal components\" are generated internally during the `Global.ts#_mergeOption`.\r\n// It is added since echarts 3.\r\n// (3) Why keep supporting \"internal component\" in global model rather than\r\n// make each type components manage their models themselves?\r\n// Because a potential feature that reproduces a chart from a different chart instance\r\n// might be useful in some BI analysis scenario, where the entire state needs to be\r\n// retrieved from the current chart instance. So we'd better manage all of the\r\n// state universally.\r\n// (4) Internal component always merged in \"replaceMerge\" approach, that is, if the existing\r\n// internal components does not matched by a new option with the same id, it will be\r\n// removed.\r\n// (5) In `InternalOptionCreator`, only the previous component models (dependencies) can be read.\r\n\r\ninterface InternalOptionCreator {\r\n (ecModel: GlobalModel): ComponentOption[]\r\n}\r\n\r\nconst internalOptionCreatorMap = createHashMap();\r\n\r\n\r\nexport function registerInternalOptionCreator(\r\n mainType: ComponentMainType, creator: InternalOptionCreator\r\n) {\r\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\r\n internalOptionCreatorMap.set(mainType, creator);\r\n}\r\n\r\n\r\nexport function concatInternalOptions(\r\n ecModel: GlobalModel,\r\n mainType: ComponentMainType,\r\n newCmptOptionList: ComponentOption[]\r\n): ComponentOption[] {\r\n const internalOptionCreator = internalOptionCreatorMap.get(mainType);\r\n if (!internalOptionCreator) {\r\n return newCmptOptionList;\r\n }\r\n const internalOptions = internalOptionCreator(ecModel);\r\n if (!internalOptions) {\r\n return newCmptOptionList;\r\n }\r\n if (__DEV__) {\r\n for (let i = 0; i < internalOptions.length; i++) {\r\n assert(isComponentIdInternal(internalOptions[i]));\r\n }\r\n }\r\n return newCmptOptionList.concat(internalOptions);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {Dictionary} from 'zrender/src/core/types';\r\nimport {makeInner, normalizeToArray} from '../../util/model';\r\nimport Model from '../Model';\r\nimport {ZRColor, PaletteOptionMixin, DecalObject, AriaOptionMixin} from '../../util/types';\r\nimport GlobalModel from '../Global';\r\n\r\ntype Inner = (hostObj: PaletteMixin) => {\r\n paletteIdx: number;\r\n paletteNameMap: Dictionary;\r\n};\r\n\r\nconst innerColor: Inner = makeInner<{\r\n paletteIdx: number\r\n paletteNameMap: Dictionary\r\n}, PaletteMixin>();\r\n\r\nconst innerDecal: Inner = makeInner<{\r\n paletteIdx: number\r\n paletteNameMap: Dictionary\r\n}, PaletteMixin>();\r\n\r\n\r\n\r\ninterface PaletteMixin\r\n extends Pick, 'get'> {}\r\n\r\nclass PaletteMixin {\r\n getColorFromPalette(\r\n this: PaletteMixin,\r\n name: string,\r\n scope?: any,\r\n requestNum?: number\r\n ): ZRColor {\r\n const defaultPalette = normalizeToArray(this.get('color', true));\r\n const layeredPalette = this.get('colorLayer', true);\r\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\r\n }\r\n\r\n clearColorPalette(this: PaletteMixin) {\r\n clearPalette(this, innerColor);\r\n }\r\n}\r\n\r\nexport function getDecalFromPalette(\r\n ecModel: GlobalModel,\r\n name: string,\r\n scope?: any,\r\n requestNum?: number\r\n): DecalObject {\r\n const defaultDecals = normalizeToArray((ecModel as Model).get(['aria', 'decal', 'decals']));\r\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\r\n}\r\n\r\n\r\nfunction getNearestPalette(\r\n palettes: T[][], requestColorNum: number\r\n): T[] {\r\n const paletteNum = palettes.length;\r\n // TODO palettes must be in order\r\n for (let i = 0; i < paletteNum; i++) {\r\n if (palettes[i].length > requestColorNum) {\r\n return palettes[i];\r\n }\r\n }\r\n return palettes[paletteNum - 1];\r\n}\r\n\r\n/**\r\n * @param name MUST NOT be null/undefined. Otherwise call this function\r\n * twise with the same parameters will get different result.\r\n * @param scope default this.\r\n * @return Can be null/undefined\r\n */\r\nfunction getFromPalette(\r\n that: PaletteMixin,\r\n inner: Inner,\r\n defaultPalette: T[],\r\n layeredPalette: T[][],\r\n name: string,\r\n scope?: any,\r\n requestNum?: number\r\n): T {\r\n scope = scope || that;\r\n const scopeFields = inner(scope);\r\n const paletteIdx = scopeFields.paletteIdx || 0;\r\n const paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};\r\n // Use `hasOwnProperty` to avoid conflict with Object.prototype.\r\n if (paletteNameMap.hasOwnProperty(name)) {\r\n return paletteNameMap[name];\r\n }\r\n let palette = ((requestNum == null || !layeredPalette)\r\n ? defaultPalette : getNearestPalette(layeredPalette, requestNum));\r\n\r\n // In case can't find in layered color palette.\r\n palette = palette || defaultPalette;\r\n\r\n if (!palette || !palette.length) {\r\n return;\r\n }\r\n\r\n const pickedPaletteItem = palette[paletteIdx];\r\n if (name) {\r\n paletteNameMap[name] = pickedPaletteItem;\r\n }\r\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\r\n\r\n return pickedPaletteItem;\r\n}\r\n\r\nfunction clearPalette(that: PaletteMixin, inner: Inner) {\r\n inner(that).paletteIdx = 0;\r\n inner(that).paletteNameMap = {};\r\n}\r\n\r\nexport {PaletteMixin};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * Caution: If the mechanism should be changed some day, these cases\r\n * should be considered:\r\n *\r\n * (1) In `merge option` mode, if using the same option to call `setOption`\r\n * many times, the result should be the same (try our best to ensure that).\r\n * (2) In `merge option` mode, if a component has no id/name specified, it\r\n * will be merged by index, and the result sequence of the components is\r\n * consistent to the original sequence.\r\n * (3) In `replaceMerge` mode, keep the result sequence of the components is\r\n * consistent to the original sequence, even though there might result in \"hole\".\r\n * (4) `reset` feature (in toolbox). Find detailed info in comments about\r\n * `mergeOption` in module:echarts/model/OptionManager.\r\n */\r\n\r\nimport {\r\n each, filter, isArray, isObject, isString,\r\n createHashMap, assert, clone, merge, extend, mixin, HashMap, isFunction\r\n} from 'zrender/src/core/util';\r\nimport * as modelUtil from '../util/model';\r\nimport Model from './Model';\r\nimport ComponentModel, {ComponentModelConstructor} from './Component';\r\nimport globalDefault from './globalDefault';\r\nimport {resetSourceDefaulter} from '../data/helper/sourceHelper';\r\nimport SeriesModel from './Series';\r\nimport {\r\n Payload,\r\n OptionPreprocessor,\r\n ECBasicOption,\r\n ECUnitOption,\r\n ThemeOption,\r\n ComponentOption,\r\n ComponentMainType,\r\n ComponentSubType,\r\n OptionId,\r\n OptionName,\r\n AriaOptionMixin\r\n} from '../util/types';\r\nimport OptionManager from './OptionManager';\r\nimport Scheduler from '../core/Scheduler';\r\nimport { concatInternalOptions } from './internalComponentCreator';\r\nimport { LocaleOption } from '../core/locale';\r\nimport {PaletteMixin} from './mixin/palette';\r\nimport { error, warn } from '../util/log';\r\n\r\nexport interface GlobalModelSetOptionOpts {\r\n replaceMerge: ComponentMainType | ComponentMainType[];\r\n}\r\nexport interface InnerSetOptionOpts {\r\n replaceMergeMainTypeMap: HashMap;\r\n}\r\n\r\n// -----------------------\r\n// Internal method names:\r\n// -----------------------\r\nlet reCreateSeriesIndices: (ecModel: GlobalModel) => void;\r\nlet assertSeriesInitialized: (ecModel: GlobalModel) => void;\r\nlet initBase: (ecModel: GlobalModel, baseOption: ECUnitOption) => void;\r\n\r\nconst OPTION_INNER_KEY = '\\0_ec_inner';\r\nconst OPTION_INNER_VALUE = 1;\r\n\r\nconst BUITIN_COMPONENTS_MAP = {\r\n grid: 'GridComponent',\r\n polar: 'PolarComponent',\r\n geo: 'GeoComponent',\r\n singleAxis: 'SingleAxisComponent',\r\n parallel: 'ParallelComponent',\r\n calendar: 'CalendarComponent',\r\n graphic: 'GraphicComponent',\r\n toolbox: 'ToolboxComponent',\r\n tooltip: 'TooltipComponent',\r\n axisPointer: 'AxisPointerComponent',\r\n brush: 'BrushComponent',\r\n title: 'TitleComponent',\r\n timeline: 'TimelineComponent',\r\n markPoint: 'MarkPointComponent',\r\n markLine: 'MarkLineComponent',\r\n markArea: 'MarkAreaComponent',\r\n legend: 'LegendComponent',\r\n dataZoom: 'DataZoomComponent',\r\n visualMap: 'VisualMapComponent',\r\n // aria: 'AriaComponent',\r\n // dataset: 'DatasetComponent',\r\n\r\n // Dependencies\r\n xAxis: 'GridComponent',\r\n yAxis: 'GridComponent',\r\n angleAxis: 'PolarComponent',\r\n radiusAxis: 'PolarComponent'\r\n} as const;\r\n\r\nconst BUILTIN_CHARTS_MAP = {\r\n line: 'LineChart',\r\n bar: 'BarChart',\r\n pie: 'PieChart',\r\n scatter: 'ScatterChart',\r\n radar: 'RadarChart',\r\n map: 'MapChart',\r\n tree: 'TreeChart',\r\n treemap: 'TreemapChart',\r\n graph: 'GraphChart',\r\n gauge: 'GaugeChart',\r\n funnel: 'FunnelChart',\r\n parallel: 'ParallelChart',\r\n sankey: 'SankeyChart',\r\n boxplot: 'BoxplotChart',\r\n candlestick: 'CandlestickChart',\r\n effectScatter: 'EffectScatterChart',\r\n lines: 'LinesChart',\r\n heatmap: 'HeatmapChart',\r\n pictorialBar: 'PictorialBarChart',\r\n themeRiver: 'ThemeRiverChart',\r\n sunburst: 'SunburstChart',\r\n custom: 'CustomChart'\r\n} as const;\r\n\r\nconst componetsMissingLogPrinted: Record = {};\r\n\r\nfunction checkMissingComponents(option: ECUnitOption) {\r\n each(option, function (componentOption, mainType: ComponentMainType) {\r\n if (!ComponentModel.hasClass(mainType)) {\r\n const componentImportName = BUITIN_COMPONENTS_MAP[mainType as keyof typeof BUITIN_COMPONENTS_MAP];\r\n if (componentImportName && !componetsMissingLogPrinted[componentImportName]) {\r\n error(`Component ${mainType} is used but not imported.\r\nimport { ${componentImportName} } from 'echarts/components';\r\necharts.use([${componentImportName}]);`);\r\n componetsMissingLogPrinted[componentImportName] = true;\r\n }\r\n }\r\n });\r\n}\r\n\r\nclass GlobalModel extends Model {\r\n // @readonly\r\n option: ECUnitOption;\r\n\r\n private _theme: Model;\r\n\r\n private _locale: Model;\r\n\r\n private _optionManager: OptionManager;\r\n\r\n private _componentsMap: HashMap;\r\n\r\n /**\r\n * `_componentsMap` might have \"hole\" because of remove.\r\n * So save components count for a certain mainType here.\r\n */\r\n private _componentsCount: HashMap;\r\n\r\n /**\r\n * Mapping between filtered series list and raw series list.\r\n * key: filtered series indices, value: raw series indices.\r\n * Items of `_seriesIndices` never be null/empty/-1.\r\n * If series has been removed by `replaceMerge`, those series\r\n * also won't be in `_seriesIndices`, just like be filtered.\r\n */\r\n private _seriesIndices: number[];\r\n\r\n /**\r\n * Key: seriesIndex.\r\n * Keep consistent with `_seriesIndices`.\r\n */\r\n private _seriesIndicesMap: HashMap;\r\n\r\n /**\r\n * Model for store update payload\r\n */\r\n private _payload: Payload;\r\n\r\n // Injectable properties:\r\n scheduler: Scheduler;\r\n\r\n // If in ssr mode.\r\n // TODO put in a better place?\r\n ssr: boolean;\r\n\r\n init(\r\n option: ECBasicOption,\r\n parentModel: Model,\r\n ecModel: GlobalModel,\r\n theme: object,\r\n locale: object,\r\n optionManager: OptionManager\r\n ): void {\r\n theme = theme || {};\r\n this.option = null; // Mark as not initialized.\r\n this._theme = new Model(theme);\r\n this._locale = new Model(locale);\r\n this._optionManager = optionManager;\r\n }\r\n\r\n setOption(\r\n option: ECBasicOption,\r\n opts: GlobalModelSetOptionOpts,\r\n optionPreprocessorFuncs: OptionPreprocessor[]\r\n ): void {\r\n\r\n if (__DEV__) {\r\n assert(option != null, 'option is null/undefined');\r\n assert(\r\n option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE,\r\n 'please use chart.getOption()'\r\n );\r\n }\r\n\r\n const innerOpt = normalizeSetOptionInput(opts);\r\n\r\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\r\n\r\n this._resetOption(null, innerOpt);\r\n }\r\n\r\n /**\r\n * @param type null/undefined: reset all.\r\n * 'recreate': force recreate all.\r\n * 'timeline': only reset timeline option\r\n * 'media': only reset media query option\r\n * @return Whether option changed.\r\n */\r\n resetOption(\r\n type: 'recreate' | 'timeline' | 'media',\r\n opt?: Pick\r\n ): boolean {\r\n return this._resetOption(type, normalizeSetOptionInput(opt));\r\n }\r\n\r\n private _resetOption(\r\n type: 'recreate' | 'timeline' | 'media',\r\n opt: InnerSetOptionOpts\r\n ): boolean {\r\n let optionChanged = false;\r\n const optionManager = this._optionManager;\r\n\r\n if (!type || type === 'recreate') {\r\n const baseOption = optionManager.mountOption(type === 'recreate');\r\n if (__DEV__) {\r\n checkMissingComponents(baseOption);\r\n }\r\n\r\n if (!this.option || type === 'recreate') {\r\n initBase(this, baseOption);\r\n }\r\n else {\r\n this.restoreData();\r\n this._mergeOption(baseOption, opt);\r\n }\r\n optionChanged = true;\r\n }\r\n\r\n if (type === 'timeline' || type === 'media') {\r\n this.restoreData();\r\n }\r\n\r\n // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,\r\n // it should better not have the same props with `MediaUnit['option']`.\r\n // Because either `option2` or `MediaUnit['option']` will be always merged to \"current option\"\r\n // rather than original \"baseOption\". If they both override a prop, the result might be\r\n // unexpected when media state changed after `setOption` called.\r\n // If we really need to modify a props in each `MediaUnit['option']`, use the full version\r\n // (`{baseOption, media}`) in `setOption`.\r\n // For `timeline`, the case is the same.\r\n\r\n if (!type || type === 'recreate' || type === 'timeline') {\r\n const timelineOption = optionManager.getTimelineOption(this);\r\n if (timelineOption) {\r\n optionChanged = true;\r\n this._mergeOption(timelineOption, opt);\r\n }\r\n }\r\n\r\n if (!type || type === 'recreate' || type === 'media') {\r\n const mediaOptions = optionManager.getMediaOption(this);\r\n if (mediaOptions.length) {\r\n each(mediaOptions, function (mediaOption) {\r\n optionChanged = true;\r\n this._mergeOption(mediaOption, opt);\r\n }, this);\r\n }\r\n }\r\n\r\n return optionChanged;\r\n }\r\n\r\n public mergeOption(option: ECUnitOption): void {\r\n this._mergeOption(option, null);\r\n }\r\n\r\n private _mergeOption(\r\n newOption: ECUnitOption,\r\n opt: InnerSetOptionOpts\r\n ): void {\r\n const option = this.option;\r\n const componentsMap = this._componentsMap;\r\n const componentsCount = this._componentsCount;\r\n const newCmptTypes: ComponentMainType[] = [];\r\n const newCmptTypeMap = createHashMap();\r\n const replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\r\n\r\n resetSourceDefaulter(this);\r\n\r\n // If no component class, merge directly.\r\n // For example: color, animaiton options, etc.\r\n each(newOption, function (componentOption, mainType: ComponentMainType) {\r\n if (componentOption == null) {\r\n return;\r\n }\r\n\r\n if (!ComponentModel.hasClass(mainType)) {\r\n // globalSettingTask.dirty();\r\n option[mainType] = option[mainType] == null\r\n ? clone(componentOption)\r\n : merge(option[mainType], componentOption, true);\r\n }\r\n else if (mainType) {\r\n newCmptTypes.push(mainType);\r\n newCmptTypeMap.set(mainType, true);\r\n }\r\n });\r\n\r\n if (replaceMergeMainTypeMap) {\r\n // If there is a mainType `xxx` in `replaceMerge` but not declared in option,\r\n // we trade it as it is declared in option as `{xxx: []}`. Because:\r\n // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.\r\n // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.\r\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\r\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\r\n newCmptTypes.push(mainTypeInReplaceMerge);\r\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\r\n }\r\n });\r\n }\r\n\r\n (ComponentModel as ComponentModelConstructor).topologicalTravel(\r\n newCmptTypes,\r\n (ComponentModel as ComponentModelConstructor).getAllClassMainTypes(),\r\n visitComponent,\r\n this\r\n );\r\n\r\n function visitComponent(\r\n this: GlobalModel,\r\n mainType: ComponentMainType\r\n ): void {\r\n const newCmptOptionList = concatInternalOptions(\r\n this, mainType, modelUtil.normalizeToArray(newOption[mainType])\r\n );\r\n\r\n const oldCmptList = componentsMap.get(mainType);\r\n const mergeMode =\r\n // `!oldCmptList` means init. See the comment in `mappingToExists`\r\n !oldCmptList ? 'replaceAll'\r\n : (replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge'\r\n : 'normalMerge';\r\n const mappingResult = modelUtil.mappingToExists(oldCmptList, newCmptOptionList, mergeMode);\r\n\r\n // Set mainType and complete subType.\r\n modelUtil.setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);\r\n\r\n // Empty it before the travel, in order to prevent `this._componentsMap`\r\n // from being used in the `init`/`mergeOption`/`optionUpdated` of some\r\n // components, which is probably incorrect logic.\r\n option[mainType] = null;\r\n componentsMap.set(mainType, null);\r\n componentsCount.set(mainType, 0);\r\n\r\n const optionsByMainType = [] as ComponentOption[];\r\n const cmptsByMainType = [] as ComponentModel[];\r\n let cmptsCountByMainType = 0;\r\n\r\n let tooltipExists: boolean;\r\n let tooltipWarningLogged: boolean;\r\n\r\n each(mappingResult, function (resultItem, index) {\r\n let componentModel = resultItem.existing;\r\n const newCmptOption = resultItem.newOption;\r\n\r\n if (!newCmptOption) {\r\n if (componentModel) {\r\n // Consider where is no new option and should be merged using {},\r\n // see removeEdgeAndAdd in topologicalTravel and\r\n // ComponentModel.getAllClassMainTypes.\r\n componentModel.mergeOption({}, this);\r\n componentModel.optionUpdated({}, false);\r\n }\r\n // If no both `resultItem.exist` and `resultItem.option`,\r\n // either it is in `replaceMerge` and not matched by any id,\r\n // or it has been removed in previous `replaceMerge` and left a \"hole\" in this component index.\r\n }\r\n else {\r\n const isSeriesType = mainType === 'series';\r\n const ComponentModelClass = (ComponentModel as ComponentModelConstructor).getClass(\r\n mainType, resultItem.keyInfo.subType,\r\n !isSeriesType // Give a more detailed warn later if series don't exists\r\n );\r\n\r\n if (!ComponentModelClass) {\r\n if (__DEV__) {\r\n const subType = resultItem.keyInfo.subType;\r\n const seriesImportName = BUILTIN_CHARTS_MAP[subType as keyof typeof BUILTIN_CHARTS_MAP];\r\n if (!componetsMissingLogPrinted[subType]) {\r\n componetsMissingLogPrinted[subType] = true;\r\n if (seriesImportName) {\r\n error(`Series ${subType} is used but not imported.\r\nimport { ${seriesImportName} } from 'echarts/charts';\r\necharts.use([${seriesImportName}]);`);\r\n }\r\n else {\r\n error(`Unknown series ${subType}`);\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n\r\n // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception.\r\n if (mainType === 'tooltip') {\r\n if (tooltipExists) {\r\n if (__DEV__) {\r\n if (!tooltipWarningLogged) {\r\n warn('Currently only one tooltip component is allowed.');\r\n tooltipWarningLogged = true;\r\n }\r\n }\r\n return;\r\n }\r\n tooltipExists = true;\r\n }\r\n\r\n if (componentModel && componentModel.constructor === ComponentModelClass) {\r\n componentModel.name = resultItem.keyInfo.name;\r\n // componentModel.settingTask && componentModel.settingTask.dirty();\r\n componentModel.mergeOption(newCmptOption, this);\r\n componentModel.optionUpdated(newCmptOption, false);\r\n }\r\n else {\r\n // PENDING Global as parent ?\r\n const extraOpt = extend(\r\n {\r\n componentIndex: index\r\n },\r\n resultItem.keyInfo\r\n );\r\n componentModel = new ComponentModelClass(\r\n newCmptOption, this, this, extraOpt\r\n );\r\n // Assign `keyInfo`\r\n extend(componentModel, extraOpt);\r\n if (resultItem.brandNew) {\r\n componentModel.__requireNewView = true;\r\n }\r\n componentModel.init(newCmptOption, this, this);\r\n\r\n // Call optionUpdated after init.\r\n // newCmptOption has been used as componentModel.option\r\n // and may be merged with theme and default, so pass null\r\n // to avoid confusion.\r\n componentModel.optionUpdated(null, true);\r\n }\r\n }\r\n\r\n if (componentModel) {\r\n optionsByMainType.push(componentModel.option);\r\n cmptsByMainType.push(componentModel);\r\n cmptsCountByMainType++;\r\n }\r\n else {\r\n // Always do assign to avoid elided item in array.\r\n optionsByMainType.push(void 0);\r\n cmptsByMainType.push(void 0);\r\n }\r\n }, this);\r\n\r\n option[mainType] = optionsByMainType;\r\n componentsMap.set(mainType, cmptsByMainType);\r\n componentsCount.set(mainType, cmptsCountByMainType);\r\n\r\n // Backup series for filtering.\r\n if (mainType === 'series') {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n\r\n // If no series declared, ensure `_seriesIndices` initialized.\r\n if (!this._seriesIndices) {\r\n reCreateSeriesIndices(this);\r\n }\r\n }\r\n\r\n /**\r\n * Get option for output (cloned option and inner info removed)\r\n */\r\n getOption(): ECUnitOption {\r\n const option = clone(this.option);\r\n\r\n each(option, function (optInMainType, mainType) {\r\n if (ComponentModel.hasClass(mainType)) {\r\n const opts = modelUtil.normalizeToArray(optInMainType);\r\n // Inner cmpts need to be removed.\r\n // Inner cmpts might not be at last since ec5.0, but still\r\n // compatible for users: if inner cmpt at last, splice the returned array.\r\n let realLen = opts.length;\r\n let metNonInner = false;\r\n for (let i = realLen - 1; i >= 0; i--) {\r\n // Remove options with inner id.\r\n if (opts[i] && !modelUtil.isComponentIdInternal(opts[i])) {\r\n metNonInner = true;\r\n }\r\n else {\r\n opts[i] = null;\r\n !metNonInner && realLen--;\r\n }\r\n }\r\n opts.length = realLen;\r\n option[mainType] = opts;\r\n }\r\n });\r\n\r\n delete option[OPTION_INNER_KEY];\r\n\r\n return option;\r\n }\r\n\r\n getTheme(): Model {\r\n return this._theme;\r\n }\r\n\r\n getLocaleModel(): Model {\r\n return this._locale;\r\n }\r\n\r\n setUpdatePayload(payload: Payload) {\r\n this._payload = payload;\r\n }\r\n\r\n getUpdatePayload(): Payload {\r\n return this._payload;\r\n }\r\n\r\n /**\r\n * @param idx If not specified, return the first one.\r\n */\r\n getComponent(mainType: ComponentMainType, idx?: number): ComponentModel {\r\n const list = this._componentsMap.get(mainType);\r\n if (list) {\r\n const cmpt = list[idx || 0];\r\n if (cmpt) {\r\n return cmpt;\r\n }\r\n else if (idx == null) {\r\n for (let i = 0; i < list.length; i++) {\r\n if (list[i]) {\r\n return list[i];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @return Never be null/undefined.\r\n */\r\n queryComponents(condition: QueryConditionKindB): ComponentModel[] {\r\n const mainType = condition.mainType;\r\n if (!mainType) {\r\n return [];\r\n }\r\n\r\n const index = condition.index;\r\n const id = condition.id;\r\n const name = condition.name;\r\n const cmpts = this._componentsMap.get(mainType);\r\n\r\n if (!cmpts || !cmpts.length) {\r\n return [];\r\n }\r\n\r\n let result: ComponentModel[];\r\n\r\n if (index != null) {\r\n result = [];\r\n each(modelUtil.normalizeToArray(index), function (idx) {\r\n cmpts[idx] && result.push(cmpts[idx]);\r\n });\r\n }\r\n else if (id != null) {\r\n result = queryByIdOrName('id', id, cmpts);\r\n }\r\n else if (name != null) {\r\n result = queryByIdOrName('name', name, cmpts);\r\n }\r\n else {\r\n // Return all non-empty components in that mainType\r\n result = filter(cmpts, cmpt => !!cmpt);\r\n }\r\n\r\n return filterBySubType(result, condition);\r\n }\r\n\r\n /**\r\n * The interface is different from queryComponents,\r\n * which is convenient for inner usage.\r\n *\r\n * @usage\r\n * let result = findComponents(\r\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\r\n * );\r\n * let result = findComponents(\r\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\r\n * );\r\n * let result = findComponents(\r\n * {mainType: 'series',\r\n * filter: function (model, index) {...}}\r\n * );\r\n * // result like [component0, componnet1, ...]\r\n */\r\n findComponents(condition: QueryConditionKindA): ComponentModel[] {\r\n const query = condition.query;\r\n const mainType = condition.mainType;\r\n\r\n const queryCond = getQueryCond(query);\r\n const result = queryCond\r\n ? this.queryComponents(queryCond)\r\n // Retrieve all non-empty components.\r\n : filter(this._componentsMap.get(mainType), cmpt => !!cmpt);\r\n\r\n return doFilter(filterBySubType(result, condition));\r\n\r\n function getQueryCond(q: QueryConditionKindA['query']): QueryConditionKindB {\r\n const indexAttr = mainType + 'Index';\r\n const idAttr = mainType + 'Id';\r\n const nameAttr = mainType + 'Name';\r\n return q && (\r\n q[indexAttr] != null\r\n || q[idAttr] != null\r\n || q[nameAttr] != null\r\n )\r\n ? {\r\n mainType: mainType,\r\n // subType will be filtered finally.\r\n index: q[indexAttr] as (number | number[]),\r\n id: q[idAttr] as (OptionId | OptionId[]),\r\n name: q[nameAttr] as (OptionName | OptionName[])\r\n }\r\n : null;\r\n }\r\n\r\n function doFilter(res: ComponentModel[]) {\r\n return condition.filter\r\n ? filter(res, condition.filter)\r\n : res;\r\n }\r\n }\r\n\r\n /**\r\n * Travel components (before filtered).\r\n *\r\n * @usage\r\n * eachComponent('legend', function (legendModel, index) {\r\n * ...\r\n * });\r\n * eachComponent(function (componentType, model, index) {\r\n * // componentType does not include subType\r\n * // (componentType is 'a' but not 'a.b')\r\n * });\r\n * eachComponent(\r\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},\r\n * function (model, index) {...}\r\n * );\r\n * eachComponent(\r\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},\r\n * function (model, index) {...}\r\n * );\r\n */\r\n eachComponent(\r\n cb: EachComponentAllCallback,\r\n context?: T\r\n ): void;\r\n eachComponent(\r\n mainType: string,\r\n cb: EachComponentInMainTypeCallback,\r\n context?: T\r\n ): void;\r\n eachComponent(\r\n mainType: QueryConditionKindA,\r\n cb: EachComponentInMainTypeCallback,\r\n context?: T\r\n ): void;\r\n eachComponent(\r\n mainType: string | QueryConditionKindA | EachComponentAllCallback,\r\n cb?: EachComponentInMainTypeCallback | T,\r\n context?: T\r\n ) {\r\n const componentsMap = this._componentsMap;\r\n\r\n if (isFunction(mainType)) {\r\n const ctxForAll = cb as T;\r\n const cbForAll = mainType as EachComponentAllCallback;\r\n componentsMap.each(function (cmpts, componentType) {\r\n for (let i = 0; cmpts && i < cmpts.length; i++) {\r\n const cmpt = cmpts[i];\r\n cmpt && cbForAll.call(ctxForAll, componentType, cmpt, cmpt.componentIndex);\r\n }\r\n });\r\n }\r\n else {\r\n const cmpts = isString(mainType)\r\n ? componentsMap.get(mainType)\r\n : isObject(mainType)\r\n ? this.findComponents(mainType)\r\n : null;\r\n for (let i = 0; cmpts && i < cmpts.length; i++) {\r\n const cmpt = cmpts[i];\r\n cmpt && (cb as EachComponentInMainTypeCallback).call(\r\n context, cmpt, cmpt.componentIndex\r\n );\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Get series list before filtered by name.\r\n */\r\n getSeriesByName(name: OptionName): SeriesModel[] {\r\n const nameStr = modelUtil.convertOptionIdName(name, null);\r\n return filter(\r\n this._componentsMap.get('series') as SeriesModel[],\r\n oneSeries => !!oneSeries && nameStr != null && oneSeries.name === nameStr\r\n );\r\n }\r\n\r\n /**\r\n * Get series list before filtered by index.\r\n */\r\n getSeriesByIndex(seriesIndex: number): SeriesModel {\r\n return this._componentsMap.get('series')[seriesIndex] as SeriesModel;\r\n }\r\n\r\n /**\r\n * Get series list before filtered by type.\r\n * FIXME: rename to getRawSeriesByType?\r\n */\r\n getSeriesByType(subType: ComponentSubType): SeriesModel[] {\r\n return filter(\r\n this._componentsMap.get('series') as SeriesModel[],\r\n oneSeries => !!oneSeries && oneSeries.subType === subType\r\n );\r\n }\r\n\r\n /**\r\n * Get all series before filtered.\r\n */\r\n getSeries(): SeriesModel[] {\r\n return filter(\r\n this._componentsMap.get('series') as SeriesModel[],\r\n oneSeries => !!oneSeries\r\n );\r\n }\r\n\r\n /**\r\n * Count series before filtered.\r\n */\r\n getSeriesCount(): number {\r\n return this._componentsCount.get('series');\r\n }\r\n\r\n /**\r\n * After filtering, series may be different\r\n * from raw series.\r\n */\r\n eachSeries(\r\n cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void,\r\n context?: T\r\n ): void {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n const series = this._componentsMap.get('series')[rawSeriesIndex] as SeriesModel;\r\n cb.call(context, series, rawSeriesIndex);\r\n }, this);\r\n }\r\n\r\n /**\r\n * Iterate raw series before filtered.\r\n *\r\n * @param {Function} cb\r\n * @param {*} context\r\n */\r\n eachRawSeries(\r\n cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void,\r\n context?: T\r\n ): void {\r\n each(this._componentsMap.get('series'), function (series) {\r\n series && cb.call(context, series, series.componentIndex);\r\n });\r\n }\r\n\r\n /**\r\n * After filtering, series may be different.\r\n * from raw series.\r\n */\r\n eachSeriesByType(\r\n subType: ComponentSubType,\r\n cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void,\r\n context?: T\r\n ): void {\r\n assertSeriesInitialized(this);\r\n each(this._seriesIndices, function (rawSeriesIndex) {\r\n const series = this._componentsMap.get('series')[rawSeriesIndex] as SeriesModel;\r\n if (series.subType === subType) {\r\n cb.call(context, series, rawSeriesIndex);\r\n }\r\n }, this);\r\n }\r\n\r\n /**\r\n * Iterate raw series before filtered of given type.\r\n */\r\n eachRawSeriesByType(\r\n subType: ComponentSubType,\r\n cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void,\r\n context?: T\r\n ): void {\r\n return each(this.getSeriesByType(subType), cb, context);\r\n }\r\n\r\n isSeriesFiltered(seriesModel: SeriesModel): boolean {\r\n assertSeriesInitialized(this);\r\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\r\n }\r\n\r\n getCurrentSeriesIndices(): number[] {\r\n return (this._seriesIndices || []).slice();\r\n }\r\n\r\n filterSeries(\r\n cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => boolean,\r\n context?: T\r\n ): void {\r\n assertSeriesInitialized(this);\r\n\r\n const newSeriesIndices: number[] = [];\r\n each(this._seriesIndices, function (seriesRawIdx) {\r\n const series = this._componentsMap.get('series')[seriesRawIdx] as SeriesModel;\r\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\r\n }, this);\r\n\r\n this._seriesIndices = newSeriesIndices;\r\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\r\n }\r\n\r\n restoreData(payload?: Payload): void {\r\n\r\n reCreateSeriesIndices(this);\r\n\r\n const componentsMap = this._componentsMap;\r\n const componentTypes: string[] = [];\r\n componentsMap.each(function (components, componentType) {\r\n if (ComponentModel.hasClass(componentType)) {\r\n componentTypes.push(componentType);\r\n }\r\n });\r\n\r\n (ComponentModel as ComponentModelConstructor).topologicalTravel(\r\n componentTypes,\r\n (ComponentModel as ComponentModelConstructor).getAllClassMainTypes(),\r\n function (componentType) {\r\n each(componentsMap.get(componentType), function (component) {\r\n if (component\r\n && (\r\n componentType !== 'series'\r\n || !isNotTargetSeries(component as SeriesModel, payload)\r\n )\r\n ) {\r\n component.restoreData();\r\n }\r\n });\r\n }\r\n );\r\n }\r\n\r\n private static internalField = (function () {\r\n\r\n reCreateSeriesIndices = function (ecModel: GlobalModel): void {\r\n const seriesIndices: number[] = ecModel._seriesIndices = [];\r\n each(ecModel._componentsMap.get('series'), function (series) {\r\n // series may have been removed by `replaceMerge`.\r\n series && seriesIndices.push(series.componentIndex);\r\n });\r\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\r\n };\r\n\r\n assertSeriesInitialized = function (ecModel: GlobalModel): void {\r\n // Components that use _seriesIndices should depends on series component,\r\n // which make sure that their initialization is after series.\r\n if (__DEV__) {\r\n if (!ecModel._seriesIndices) {\r\n throw new Error('Option should contains series.');\r\n }\r\n }\r\n };\r\n\r\n initBase = function (ecModel: GlobalModel, baseOption: ECUnitOption & AriaOptionMixin): void {\r\n // Using OPTION_INNER_KEY to mark that this option cannot be used outside,\r\n // i.e. `chart.setOption(chart.getModel().option);` is forbidden.\r\n ecModel.option = {} as ECUnitOption;\r\n ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE;\r\n\r\n // Init with series: [], in case of calling findSeries method\r\n // before series initialized.\r\n ecModel._componentsMap = createHashMap({series: []});\r\n ecModel._componentsCount = createHashMap();\r\n\r\n // If user spefied `option.aria`, aria will be enable. This detection should be\r\n // performed before theme and globalDefault merge.\r\n const airaOption = baseOption.aria;\r\n if (isObject(airaOption) && airaOption.enabled == null) {\r\n airaOption.enabled = true;\r\n }\r\n\r\n mergeTheme(baseOption, ecModel._theme.option);\r\n\r\n // TODO Needs clone when merging to the unexisted property\r\n merge(baseOption, globalDefault, false);\r\n\r\n ecModel._mergeOption(baseOption, null);\r\n };\r\n\r\n })();\r\n}\r\n\r\n\r\n/**\r\n * @param condition.mainType Mandatory.\r\n * @param condition.subType Optional.\r\n * @param condition.query like {xxxIndex, xxxId, xxxName},\r\n * where xxx is mainType.\r\n * If query attribute is null/undefined or has no index/id/name,\r\n * do not filtering by query conditions, which is convenient for\r\n * no-payload situations or when target of action is global.\r\n * @param condition.filter parameter: component, return boolean.\r\n */\r\nexport interface QueryConditionKindA {\r\n mainType: ComponentMainType;\r\n subType?: ComponentSubType;\r\n query?: {\r\n [k: string]: number | number[] | string | string[]\r\n };\r\n filter?: (cmpt: ComponentModel) => boolean;\r\n}\r\n\r\n/**\r\n * If none of index and id and name used, return all components with mainType.\r\n * @param condition.mainType\r\n * @param condition.subType If ignore, only query by mainType\r\n * @param condition.index Either input index or id or name.\r\n * @param condition.id Either input index or id or name.\r\n * @param condition.name Either input index or id or name.\r\n */\r\nexport interface QueryConditionKindB {\r\n mainType: ComponentMainType;\r\n subType?: ComponentSubType;\r\n index?: number | number[];\r\n id?: OptionId | OptionId[];\r\n name?: OptionName | OptionName[];\r\n}\r\nexport interface EachComponentAllCallback {\r\n (mainType: string, model: ComponentModel, componentIndex: number): void;\r\n}\r\ninterface EachComponentInMainTypeCallback {\r\n (model: ComponentModel, componentIndex: number): void;\r\n}\r\n\r\n\r\nfunction isNotTargetSeries(seriesModel: SeriesModel, payload: Payload): boolean {\r\n if (payload) {\r\n const index = payload.seriesIndex;\r\n const id = payload.seriesId;\r\n const name = payload.seriesName;\r\n return (index != null && seriesModel.componentIndex !== index)\r\n || (id != null && seriesModel.id !== id)\r\n || (name != null && seriesModel.name !== name);\r\n }\r\n}\r\n\r\nfunction mergeTheme(option: ECUnitOption, theme: ThemeOption): void {\r\n // PENDING\r\n // NOT use `colorLayer` in theme if option has `color`\r\n const notMergeColorLayer = option.color && !option.colorLayer;\r\n\r\n each(theme, function (themeItem, name) {\r\n if (name === 'colorLayer' && notMergeColorLayer) {\r\n return;\r\n }\r\n\r\n // If it is component model mainType, the model handles that merge later.\r\n // otherwise, merge them here.\r\n if (!ComponentModel.hasClass(name)) {\r\n if (typeof themeItem === 'object') {\r\n option[name] = !option[name]\r\n ? clone(themeItem)\r\n : merge(option[name], themeItem, false);\r\n }\r\n else {\r\n if (option[name] == null) {\r\n option[name] = themeItem;\r\n }\r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction queryByIdOrName(\r\n attr: 'id' | 'name',\r\n idOrName: string | number | (string | number)[],\r\n cmpts: T[]\r\n): T[] {\r\n // Here is a break from echarts4: string and number are\r\n // treated as equal.\r\n if (isArray(idOrName)) {\r\n const keyMap = createHashMap();\r\n each(idOrName, function (idOrNameItem) {\r\n if (idOrNameItem != null) {\r\n const idName = modelUtil.convertOptionIdName(idOrNameItem, null);\r\n idName != null && keyMap.set(idOrNameItem, true);\r\n }\r\n });\r\n return filter(cmpts, cmpt => cmpt && keyMap.get(cmpt[attr]));\r\n }\r\n else {\r\n const idName = modelUtil.convertOptionIdName(idOrName, null);\r\n return filter(cmpts, cmpt => cmpt && idName != null && cmpt[attr] === idName);\r\n }\r\n}\r\n\r\nfunction filterBySubType(\r\n components: ComponentModel[],\r\n condition: QueryConditionKindA | QueryConditionKindB\r\n): ComponentModel[] {\r\n // Using hasOwnProperty for restrict. Consider\r\n // subType is undefined in user payload.\r\n return condition.hasOwnProperty('subType')\r\n ? filter(components, cmpt => cmpt && cmpt.subType === condition.subType)\r\n : components;\r\n}\r\n\r\nfunction normalizeSetOptionInput(opts: GlobalModelSetOptionOpts): InnerSetOptionOpts {\r\n const replaceMergeMainTypeMap = createHashMap();\r\n opts && each(modelUtil.normalizeToArray(opts.replaceMerge), function (mainType) {\r\n if (__DEV__) {\r\n assert(\r\n ComponentModel.hasClass(mainType),\r\n '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"'\r\n );\r\n }\r\n replaceMergeMainTypeMap.set(mainType, true);\r\n });\r\n return {\r\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\r\n };\r\n}\r\n\r\ninterface GlobalModel extends PaletteMixin {}\r\nmixin(GlobalModel, PaletteMixin);\r\n\r\nexport default GlobalModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {EChartsType} from './echarts';\r\n\r\nimport type {CoordinateSystemMaster} from '../coord/CoordinateSystem';\r\nimport type Element from 'zrender/src/Element';\r\nimport type ComponentModel from '../model/Component';\r\nimport type ComponentView from '../view/Component';\r\nimport type ChartView from '../view/Chart';\r\nimport type SeriesModel from '../model/Series';\r\nimport type GlobalModel from '../model/Global';\r\n\r\nconst availableMethods: (keyof EChartsType)[] = [\r\n 'getDom',\r\n 'getZr',\r\n 'getWidth',\r\n 'getHeight',\r\n 'getDevicePixelRatio',\r\n 'dispatchAction',\r\n 'isSSR',\r\n 'isDisposed',\r\n 'on',\r\n 'off',\r\n 'getDataURL',\r\n 'getConnectedDataURL',\r\n // 'getModel',\r\n 'getOption',\r\n // 'getViewOfComponentModel',\r\n // 'getViewOfSeriesModel',\r\n 'getId',\r\n 'updateLabelLayout'\r\n];\r\n\r\ninterface ExtensionAPI extends Pick {}\r\n\r\nabstract class ExtensionAPI {\r\n\r\n constructor(ecInstance: EChartsType) {\r\n zrUtil.each(availableMethods, function (methodName: string) {\r\n (this as any)[methodName] = zrUtil.bind((ecInstance as any)[methodName], ecInstance);\r\n }, this);\r\n }\r\n\r\n // Implemented in echarts.js\r\n abstract getCoordinateSystems(): CoordinateSystemMaster[];\r\n abstract getComponentByElement(el: Element): ComponentModel;\r\n abstract enterEmphasis(el: Element, highlightDigit?: number): void;\r\n abstract leaveEmphasis(el: Element, highlightDigit?: number): void;\r\n abstract enterSelect(el: Element): void;\r\n abstract leaveSelect(el: Element): void;\r\n abstract enterBlur(el: Element): void;\r\n abstract leaveBlur(el: Element): void;\r\n // These methods are not planned to be exposed to outside.\r\n abstract getViewOfComponentModel(componentModel: ComponentModel): ComponentView;\r\n abstract getViewOfSeriesModel(seriesModel: SeriesModel): ChartView;\r\n abstract getModel(): GlobalModel;\r\n}\r\n\r\nexport default ExtensionAPI;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\n\r\nimport type GlobalModel from '../model/Global';\r\nimport type ExtensionAPI from './ExtensionAPI';\r\nimport type { CoordinateSystemCreator, CoordinateSystemMaster } from '../coord/CoordinateSystem';\r\n\r\nconst coordinateSystemCreators: {[type: string]: CoordinateSystemCreator} = {};\r\n\r\nclass CoordinateSystemManager {\r\n\r\n private _coordinateSystems: CoordinateSystemMaster[] = [];\r\n\r\n create(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n let coordinateSystems: CoordinateSystemMaster[] = [];\r\n zrUtil.each(coordinateSystemCreators, function (creator, type) {\r\n const list = creator.create(ecModel, api);\r\n coordinateSystems = coordinateSystems.concat(list || []);\r\n });\r\n\r\n this._coordinateSystems = coordinateSystems;\r\n }\r\n\r\n update(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n zrUtil.each(this._coordinateSystems, function (coordSys) {\r\n coordSys.update && coordSys.update(ecModel, api);\r\n });\r\n }\r\n\r\n getCoordinateSystems(): CoordinateSystemMaster[] {\r\n return this._coordinateSystems.slice();\r\n }\r\n\r\n static register = function (type: string, creator: CoordinateSystemCreator): void {\r\n coordinateSystemCreators[type] = creator;\r\n };\r\n\r\n static get = function (type: string): CoordinateSystemCreator {\r\n return coordinateSystemCreators[type];\r\n };\r\n\r\n}\r\n\r\nexport default CoordinateSystemManager;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * ECharts option manager\r\n */\r\n\r\n\r\n// import ComponentModel, { ComponentModelConstructor } from './Component';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport {\r\n OptionPreprocessor, MediaQuery, ECUnitOption, MediaUnit, ECBasicOption, SeriesOption\r\n} from '../util/types';\r\nimport GlobalModel, { InnerSetOptionOpts } from './Global';\r\nimport {\r\n normalizeToArray\r\n // , MappingExistingItem, setComponentTypeToKeyInfo, mappingToExists\r\n} from '../util/model';\r\nimport {\r\n each, clone, map, isTypedArray, setAsPrimitive, isArray, isObject\r\n // , HashMap , createHashMap, extend, merge,\r\n} from 'zrender/src/core/util';\r\nimport { DatasetOption } from '../component/dataset/install';\r\nimport { error } from '../util/log';\r\n\r\nconst QUERY_REG = /^(min|max)?(.+)$/;\r\n\r\ninterface ParsedRawOption {\r\n baseOption: ECUnitOption;\r\n timelineOptions: ECUnitOption[];\r\n mediaDefault: MediaUnit;\r\n mediaList: MediaUnit[];\r\n}\r\n\r\n// Key: mainType\r\n// type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;\r\n\r\n/**\r\n * TERM EXPLANATIONS:\r\n * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.\r\n */\r\nclass OptionManager {\r\n\r\n private _api: ExtensionAPI;\r\n\r\n private _timelineOptions: ECUnitOption[] = [];\r\n\r\n private _mediaList: MediaUnit[] = [];\r\n\r\n private _mediaDefault: MediaUnit;\r\n\r\n /**\r\n * -1, means default.\r\n * empty means no media.\r\n */\r\n private _currentMediaIndices: number[] = [];\r\n\r\n private _optionBackup: ParsedRawOption;\r\n\r\n // private _fakeCmptsMap: FakeComponentsMap;\r\n\r\n private _newBaseOption: ECUnitOption;\r\n\r\n // timeline.notMerge is not supported in ec3. Firstly there is rearly\r\n // case that notMerge is needed. Secondly supporting 'notMerge' requires\r\n // rawOption cloned and backuped when timeline changed, which does no\r\n // good to performance. What's more, that both timeline and setOption\r\n // method supply 'notMerge' brings complex and some problems.\r\n // Consider this case:\r\n // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);\r\n // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);\r\n\r\n constructor(api: ExtensionAPI) {\r\n this._api = api;\r\n }\r\n\r\n setOption(\r\n rawOption: ECBasicOption,\r\n optionPreprocessorFuncs: OptionPreprocessor[],\r\n opt: InnerSetOptionOpts\r\n ): void {\r\n if (rawOption) {\r\n // That set dat primitive is dangerous if user reuse the data when setOption again.\r\n each(normalizeToArray((rawOption as ECUnitOption).series), function (series: SeriesOption) {\r\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\r\n });\r\n each(normalizeToArray((rawOption as ECUnitOption).dataset), function (dataset: DatasetOption) {\r\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\r\n });\r\n }\r\n\r\n // Caution: some series modify option data, if do not clone,\r\n // it should ensure that the repeat modify correctly\r\n // (create a new object when modify itself).\r\n rawOption = clone(rawOption);\r\n\r\n // FIXME\r\n // If some property is set in timeline options or media option but\r\n // not set in baseOption, a warning should be given.\r\n\r\n const optionBackup = this._optionBackup;\r\n const newParsedOption = parseRawOption(\r\n rawOption, optionPreprocessorFuncs, !optionBackup\r\n );\r\n this._newBaseOption = newParsedOption.baseOption;\r\n\r\n // For setOption at second time (using merge mode);\r\n if (optionBackup) {\r\n // FIXME\r\n // the restore merge solution is essentially incorrect.\r\n // the mapping can not be 100% consistent with ecModel, which probably brings\r\n // potential bug!\r\n\r\n // The first merge is delayed, because in most cases, users do not call `setOption` twice.\r\n // let fakeCmptsMap = this._fakeCmptsMap;\r\n // if (!fakeCmptsMap) {\r\n // fakeCmptsMap = this._fakeCmptsMap = createHashMap();\r\n // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);\r\n // }\r\n\r\n // mergeToBackupOption(\r\n // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt\r\n // );\r\n\r\n // For simplicity, timeline options and media options do not support merge,\r\n // that is, if you `setOption` twice and both has timeline options, the latter\r\n // timeline options will not be merged to the former, but just substitute them.\r\n if (newParsedOption.timelineOptions.length) {\r\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\r\n }\r\n if (newParsedOption.mediaList.length) {\r\n optionBackup.mediaList = newParsedOption.mediaList;\r\n }\r\n if (newParsedOption.mediaDefault) {\r\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\r\n }\r\n }\r\n else {\r\n this._optionBackup = newParsedOption;\r\n }\r\n }\r\n\r\n mountOption(isRecreate: boolean): ECUnitOption {\r\n const optionBackup = this._optionBackup;\r\n\r\n this._timelineOptions = optionBackup.timelineOptions;\r\n this._mediaList = optionBackup.mediaList;\r\n this._mediaDefault = optionBackup.mediaDefault;\r\n this._currentMediaIndices = [];\r\n\r\n return clone(isRecreate\r\n // this._optionBackup.baseOption, which is created at the first `setOption`\r\n // called, and is merged into every new option by inner method `mergeToBackupOption`\r\n // each time `setOption` called, can be only used in `isRecreate`, because\r\n // its reliability is under suspicion. In other cases option merge is\r\n // performed by `model.mergeOption`.\r\n ? optionBackup.baseOption : this._newBaseOption\r\n );\r\n }\r\n\r\n getTimelineOption(ecModel: GlobalModel): ECUnitOption {\r\n let option;\r\n const timelineOptions = this._timelineOptions;\r\n\r\n if (timelineOptions.length) {\r\n // getTimelineOption can only be called after ecModel inited,\r\n // so we can get currentIndex from timelineModel.\r\n const timelineModel = ecModel.getComponent('timeline');\r\n if (timelineModel) {\r\n option = clone(\r\n // FIXME:TS as TimelineModel or quivlant interface\r\n timelineOptions[(timelineModel as any).getCurrentIndex()]\r\n );\r\n }\r\n }\r\n\r\n return option;\r\n }\r\n\r\n getMediaOption(ecModel: GlobalModel): ECUnitOption[] {\r\n const ecWidth = this._api.getWidth();\r\n const ecHeight = this._api.getHeight();\r\n const mediaList = this._mediaList;\r\n const mediaDefault = this._mediaDefault;\r\n let indices = [];\r\n let result: ECUnitOption[] = [];\r\n\r\n // No media defined.\r\n if (!mediaList.length && !mediaDefault) {\r\n return result;\r\n }\r\n\r\n // Multi media may be applied, the latter defined media has higher priority.\r\n for (let i = 0, len = mediaList.length; i < len; i++) {\r\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\r\n indices.push(i);\r\n }\r\n }\r\n\r\n // FIXME\r\n // Whether mediaDefault should force users to provide? Otherwise\r\n // the change by media query can not be recorvered.\r\n if (!indices.length && mediaDefault) {\r\n indices = [-1];\r\n }\r\n\r\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\r\n result = map(indices, function (index) {\r\n return clone(\r\n index === -1 ? mediaDefault.option : mediaList[index].option\r\n );\r\n });\r\n }\r\n // Otherwise return nothing.\r\n\r\n this._currentMediaIndices = indices;\r\n\r\n return result;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * [RAW_OPTION_PATTERNS]\r\n * (Note: \"series: []\" represents all other props in `ECUnitOption`)\r\n *\r\n * (1) No prop \"baseOption\" declared:\r\n * Root option is used as \"baseOption\" (except prop \"options\" and \"media\").\r\n * ```js\r\n * option = {\r\n * series: [],\r\n * timeline: {},\r\n * options: [],\r\n * };\r\n * option = {\r\n * series: [],\r\n * media: {},\r\n * };\r\n * option = {\r\n * series: [],\r\n * timeline: {},\r\n * options: [],\r\n * media: {},\r\n * }\r\n * ```\r\n *\r\n * (2) Prop \"baseOption\" declared:\r\n * If \"baseOption\" declared, `ECUnitOption` props can only be declared\r\n * inside \"baseOption\" except prop \"timeline\" (compat ec2).\r\n * ```js\r\n * option = {\r\n * baseOption: {\r\n * timeline: {},\r\n * series: [],\r\n * },\r\n * options: []\r\n * };\r\n * option = {\r\n * baseOption: {\r\n * series: [],\r\n * },\r\n * media: []\r\n * };\r\n * option = {\r\n * baseOption: {\r\n * timeline: {},\r\n * series: [],\r\n * },\r\n * options: []\r\n * media: []\r\n * };\r\n * option = {\r\n * // ec3 compat ec2: allow (only) `timeline` declared\r\n * // outside baseOption. Keep this setting for compat.\r\n * timeline: {},\r\n * baseOption: {\r\n * series: [],\r\n * },\r\n * options: [],\r\n * media: []\r\n * };\r\n * ```\r\n */\r\nfunction parseRawOption(\r\n // `rawOption` May be modified\r\n rawOption: ECBasicOption,\r\n optionPreprocessorFuncs: OptionPreprocessor[],\r\n isNew: boolean\r\n): ParsedRawOption {\r\n const mediaList: MediaUnit[] = [];\r\n let mediaDefault: MediaUnit;\r\n let baseOption: ECUnitOption;\r\n\r\n const declaredBaseOption = rawOption.baseOption;\r\n // Compatible with ec2, [RAW_OPTION_PATTERNS] above.\r\n const timelineOnRoot = rawOption.timeline;\r\n const timelineOptionsOnRoot = rawOption.options;\r\n const mediaOnRoot = rawOption.media;\r\n const hasMedia = !!rawOption.media;\r\n const hasTimeline = !!(\r\n timelineOptionsOnRoot || timelineOnRoot || (declaredBaseOption && declaredBaseOption.timeline)\r\n );\r\n\r\n if (declaredBaseOption) {\r\n baseOption = declaredBaseOption;\r\n // For merge option.\r\n if (!baseOption.timeline) {\r\n baseOption.timeline = timelineOnRoot;\r\n }\r\n }\r\n // For convenience, enable to use the root option as the `baseOption`:\r\n // `{ ...normalOptionProps, media: [{ ... }, { ... }] }`\r\n else {\r\n if (hasTimeline || hasMedia) {\r\n rawOption.options = rawOption.media = null;\r\n }\r\n baseOption = rawOption;\r\n }\r\n\r\n if (hasMedia) {\r\n if (isArray(mediaOnRoot)) {\r\n each(mediaOnRoot, function (singleMedia) {\r\n if (__DEV__) {\r\n // Real case of wrong config.\r\n if (singleMedia\r\n && !singleMedia.option\r\n && isObject(singleMedia.query)\r\n && isObject((singleMedia.query as any).option)\r\n ) {\r\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\r\n }\r\n }\r\n if (singleMedia && singleMedia.option) {\r\n if (singleMedia.query) {\r\n mediaList.push(singleMedia);\r\n }\r\n else if (!mediaDefault) {\r\n // Use the first media default.\r\n mediaDefault = singleMedia;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n if (__DEV__) {\r\n // Real case of wrong config.\r\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\r\n }\r\n }\r\n }\r\n\r\n doPreprocess(baseOption);\r\n each(timelineOptionsOnRoot, option => doPreprocess(option));\r\n each(mediaList, media => doPreprocess(media.option));\r\n\r\n function doPreprocess(option: ECUnitOption) {\r\n each(optionPreprocessorFuncs, function (preProcess) {\r\n preProcess(option, isNew);\r\n });\r\n }\r\n\r\n return {\r\n baseOption: baseOption,\r\n timelineOptions: timelineOptionsOnRoot || [],\r\n mediaDefault: mediaDefault,\r\n mediaList: mediaList\r\n };\r\n}\r\n\r\n/**\r\n * @see \r\n * Support: width, height, aspectRatio\r\n * Can use max or min as prefix.\r\n */\r\nfunction applyMediaQuery(query: MediaQuery, ecWidth: number, ecHeight: number): boolean {\r\n const realMap = {\r\n width: ecWidth,\r\n height: ecHeight,\r\n aspectratio: ecWidth / ecHeight // lower case for convenience.\r\n };\r\n\r\n let applicable = true;\r\n\r\n each(query, function (value: number, attr) {\r\n const matched = attr.match(QUERY_REG);\r\n\r\n if (!matched || !matched[1] || !matched[2]) {\r\n return;\r\n }\r\n\r\n const operator = matched[1];\r\n const realAttr = matched[2].toLowerCase();\r\n\r\n if (!compare(realMap[realAttr as keyof typeof realMap], value, operator)) {\r\n applicable = false;\r\n }\r\n });\r\n\r\n return applicable;\r\n}\r\n\r\nfunction compare(real: number, expect: number, operator: string): boolean {\r\n if (operator === 'min') {\r\n return real >= expect;\r\n }\r\n else if (operator === 'max') {\r\n return real <= expect;\r\n }\r\n else { // Equals\r\n return real === expect;\r\n }\r\n}\r\n\r\nfunction indicesEquals(indices1: number[], indices2: number[]): boolean {\r\n // indices is always order by asc and has only finite number.\r\n return indices1.join(',') === indices2.join(',');\r\n}\r\n\r\n/**\r\n * Consider case:\r\n * `chart.setOption(opt1);`\r\n * Then user do some interaction like dataZoom, dataView changing.\r\n * `chart.setOption(opt2);`\r\n * Then user press 'reset button' in toolbox.\r\n *\r\n * After doing that all of the interaction effects should be reset, the\r\n * chart should be the same as the result of invoke\r\n * `chart.setOption(opt1); chart.setOption(opt2);`.\r\n *\r\n * Although it is not able ensure that\r\n * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to\r\n * `chart.setOption(merge(opt1, opt2));` exactly,\r\n * this might be the only simple way to implement that feature.\r\n *\r\n * MEMO: We've considered some other approaches:\r\n * 1. Each model handles its self restoration but not uniform treatment.\r\n * (Too complex in logic and error-prone)\r\n * 2. Use a shadow ecModel. (Performance expensive)\r\n *\r\n * FIXME: A possible solution:\r\n * Add a extra level of model for each component model. The inheritance chain would be:\r\n * ecModel <- componentModel <- componentActionModel <- dataItemModel\r\n * And all of the actions can only modify the `componentActionModel` rather than\r\n * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.\r\n * When \"resotre\" action triggered, model from `componentActionModel` will be discarded\r\n * instead of recreating the \"ecModel\" from the \"_optionBackup\".\r\n */\r\n// function mergeToBackupOption(\r\n// fakeCmptsMap: FakeComponentsMap,\r\n// // `tarOption` Can be null/undefined, means init\r\n// tarOption: ECUnitOption,\r\n// newOption: ECUnitOption,\r\n// // Can be null/undefined\r\n// opt: InnerSetOptionOpts\r\n// ): void {\r\n// newOption = newOption || {} as ECUnitOption;\r\n// const notInit = !!tarOption;\r\n\r\n// each(newOption, function (newOptsInMainType, mainType) {\r\n// if (newOptsInMainType == null) {\r\n// return;\r\n// }\r\n\r\n// if (!ComponentModel.hasClass(mainType)) {\r\n// if (tarOption) {\r\n// tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);\r\n// }\r\n// }\r\n// else {\r\n// const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;\r\n// const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];\r\n// const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;\r\n// const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);\r\n\r\n// const mappingResult = mappingToExists(\r\n// oldFakeCmptsInMainType,\r\n// normalizeToArray(newOptsInMainType),\r\n// (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'\r\n// );\r\n// setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);\r\n\r\n// each(mappingResult, function (resultItem, index) {\r\n// // The same logic as `Global.ts#_mergeOption`.\r\n// let fakeCmpt = resultItem.existing;\r\n// const newOption = resultItem.newOption;\r\n// const keyInfo = resultItem.keyInfo;\r\n// let fakeCmptOpt;\r\n\r\n// if (!newOption) {\r\n// fakeCmptOpt = oldTarOptsInMainType[index];\r\n// }\r\n// else {\r\n// if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {\r\n// fakeCmpt.name = keyInfo.name;\r\n// if (notInit) {\r\n// fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);\r\n// }\r\n// }\r\n// else {\r\n// fakeCmpt = extend({}, keyInfo);\r\n// if (notInit) {\r\n// fakeCmptOpt = clone(newOption);\r\n// }\r\n// }\r\n// }\r\n\r\n// if (fakeCmpt) {\r\n// notInit && resultTarOptsInMainType.push(fakeCmptOpt);\r\n// resultFakeCmptsInMainType.push(fakeCmpt);\r\n// }\r\n// else {\r\n// notInit && resultTarOptsInMainType.push(void 0);\r\n// resultFakeCmptsInMainType.push(void 0);\r\n// }\r\n// });\r\n// }\r\n// });\r\n// }\r\n\r\nexport default OptionManager;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as modelUtil from '../../util/model';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { deprecateLog, deprecateReplaceLog } from '../../util/log';\r\n\r\nconst each = zrUtil.each;\r\nconst isObject = zrUtil.isObject;\r\n\r\nconst POSSIBLE_STYLES = [\r\n 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',\r\n 'chordStyle', 'label', 'labelLine'\r\n];\r\n\r\n\r\nfunction compatEC2ItemStyle(opt: Dictionary) {\r\n const itemStyleOpt = opt && opt.itemStyle;\r\n if (!itemStyleOpt) {\r\n return;\r\n }\r\n for (let i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\r\n const styleName = POSSIBLE_STYLES[i];\r\n const normalItemStyleOpt = itemStyleOpt.normal;\r\n const emphasisItemStyleOpt = itemStyleOpt.emphasis;\r\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(`itemStyle.normal.${styleName}`, styleName);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].normal) {\r\n opt[styleName].normal = normalItemStyleOpt[styleName];\r\n }\r\n else {\r\n zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\r\n }\r\n normalItemStyleOpt[styleName] = null;\r\n }\r\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\r\n if (__DEV__) {\r\n deprecateReplaceLog(`itemStyle.emphasis.${styleName}`, `emphasis.${styleName}`);\r\n }\r\n opt[styleName] = opt[styleName] || {};\r\n if (!opt[styleName].emphasis) {\r\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\r\n }\r\n else {\r\n zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\r\n }\r\n emphasisItemStyleOpt[styleName] = null;\r\n }\r\n }\r\n}\r\n\r\nfunction convertNormalEmphasis(opt: Dictionary, optType: string, useExtend?: boolean) {\r\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\r\n const normalOpt = opt[optType].normal;\r\n const emphasisOpt = opt[optType].emphasis;\r\n\r\n if (normalOpt) {\r\n if (__DEV__) {\r\n // eslint-disable-next-line max-len\r\n deprecateLog(`'normal' hierarchy in ${optType} has been removed since 4.0. All style properties are configured in ${optType} directly now.`);\r\n }\r\n // Timeline controlStyle has other properties besides normal and emphasis\r\n if (useExtend) {\r\n opt[optType].normal = opt[optType].emphasis = null;\r\n zrUtil.defaults(opt[optType], normalOpt);\r\n }\r\n else {\r\n opt[optType] = normalOpt;\r\n }\r\n }\r\n if (emphasisOpt) {\r\n if (__DEV__) {\r\n deprecateLog(`${optType}.emphasis has been changed to emphasis.${optType} since 4.0`);\r\n }\r\n opt.emphasis = opt.emphasis || {};\r\n opt.emphasis[optType] = emphasisOpt;\r\n\r\n // Also compat the case user mix the style and focus together in ec3 style\r\n // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }\r\n if (emphasisOpt.focus) {\r\n opt.emphasis.focus = emphasisOpt.focus;\r\n }\r\n if (emphasisOpt.blurScope) {\r\n opt.emphasis.blurScope = emphasisOpt.blurScope;\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction removeEC3NormalStatus(opt: Dictionary) {\r\n convertNormalEmphasis(opt, 'itemStyle');\r\n convertNormalEmphasis(opt, 'lineStyle');\r\n convertNormalEmphasis(opt, 'areaStyle');\r\n convertNormalEmphasis(opt, 'label');\r\n convertNormalEmphasis(opt, 'labelLine');\r\n // treemap\r\n convertNormalEmphasis(opt, 'upperLabel');\r\n // graph\r\n convertNormalEmphasis(opt, 'edgeLabel');\r\n}\r\n\r\nfunction compatTextStyle(opt: any, propName: string) {\r\n // Check whether is not object (string\\null\\undefined ...)\r\n const labelOptSingle = isObject(opt) && opt[propName];\r\n const textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;\r\n if (textStyle) {\r\n if (__DEV__) {\r\n // eslint-disable-next-line max-len\r\n deprecateLog(`textStyle hierarchy in ${propName} has been removed since 4.0. All textStyle properties are configured in ${propName} directly now.`);\r\n }\r\n for (let i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {\r\n const textPropName = modelUtil.TEXT_STYLE_OPTIONS[i];\r\n if (textStyle.hasOwnProperty(textPropName)) {\r\n labelOptSingle[textPropName] = textStyle[textPropName];\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction compatEC3CommonStyles(opt: Dictionary) {\r\n if (opt) {\r\n removeEC3NormalStatus(opt);\r\n compatTextStyle(opt, 'label');\r\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\r\n }\r\n}\r\n\r\nfunction processSeries(seriesOpt: any) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n\r\n compatEC2ItemStyle(seriesOpt);\r\n removeEC3NormalStatus(seriesOpt);\r\n\r\n compatTextStyle(seriesOpt, 'label');\r\n // treemap\r\n compatTextStyle(seriesOpt, 'upperLabel');\r\n // graph\r\n compatTextStyle(seriesOpt, 'edgeLabel');\r\n if (seriesOpt.emphasis) {\r\n compatTextStyle(seriesOpt.emphasis, 'label');\r\n // treemap\r\n compatTextStyle(seriesOpt.emphasis, 'upperLabel');\r\n // graph\r\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\r\n }\r\n\r\n let markPoint = seriesOpt.markPoint;\r\n if (markPoint) {\r\n compatEC2ItemStyle(markPoint);\r\n compatEC3CommonStyles(markPoint);\r\n }\r\n\r\n let markLine = seriesOpt.markLine;\r\n if (markLine) {\r\n compatEC2ItemStyle(markLine);\r\n compatEC3CommonStyles(markLine);\r\n }\r\n\r\n const markArea = seriesOpt.markArea;\r\n if (markArea) {\r\n compatEC3CommonStyles(markArea);\r\n }\r\n\r\n let data = seriesOpt.data;\r\n\r\n // Break with ec3: if `setOption` again, there may be no `type` in option,\r\n // then the backward compat based on option type will not be performed.\r\n\r\n if (seriesOpt.type === 'graph') {\r\n data = data || seriesOpt.nodes;\r\n const edgeData = seriesOpt.links || seriesOpt.edges;\r\n if (edgeData && !zrUtil.isTypedArray(edgeData)) {\r\n for (let i = 0; i < edgeData.length; i++) {\r\n compatEC3CommonStyles(edgeData[i]);\r\n }\r\n }\r\n zrUtil.each(seriesOpt.categories, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n\r\n if (data && !zrUtil.isTypedArray(data)) {\r\n for (let i = 0; i < data.length; i++) {\r\n compatEC3CommonStyles(data[i]);\r\n }\r\n }\r\n\r\n // mark point data\r\n markPoint = seriesOpt.markPoint;\r\n if (markPoint && markPoint.data) {\r\n const mpData = markPoint.data;\r\n for (let i = 0; i < mpData.length; i++) {\r\n compatEC3CommonStyles(mpData[i]);\r\n }\r\n }\r\n // mark line data\r\n markLine = seriesOpt.markLine;\r\n if (markLine && markLine.data) {\r\n const mlData = markLine.data;\r\n for (let i = 0; i < mlData.length; i++) {\r\n if (zrUtil.isArray(mlData[i])) {\r\n compatEC3CommonStyles(mlData[i][0]);\r\n compatEC3CommonStyles(mlData[i][1]);\r\n }\r\n else {\r\n compatEC3CommonStyles(mlData[i]);\r\n }\r\n }\r\n }\r\n\r\n // Series\r\n if (seriesOpt.type === 'gauge') {\r\n compatTextStyle(seriesOpt, 'axisLabel');\r\n compatTextStyle(seriesOpt, 'title');\r\n compatTextStyle(seriesOpt, 'detail');\r\n }\r\n else if (seriesOpt.type === 'treemap') {\r\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\r\n zrUtil.each(seriesOpt.levels, function (opt) {\r\n removeEC3NormalStatus(opt);\r\n });\r\n }\r\n else if (seriesOpt.type === 'tree') {\r\n removeEC3NormalStatus(seriesOpt.leaves);\r\n }\r\n // sunburst starts from ec4, so it does not need to compat levels.\r\n}\r\n\r\nfunction toArr(o: any) {\r\n return zrUtil.isArray(o) ? o : o ? [o] : [];\r\n}\r\n\r\nfunction toObj(o: any) {\r\n return (zrUtil.isArray(o) ? o[0] : o) || {};\r\n}\r\n\r\nexport default function globalCompatStyle(option: any, isTheme?: boolean) {\r\n each(toArr(option.series), function (seriesOpt) {\r\n isObject(seriesOpt) && processSeries(seriesOpt);\r\n });\r\n\r\n const axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\r\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\r\n\r\n each(\r\n axes,\r\n function (axisName) {\r\n each(toArr(option[axisName]), function (axisOpt) {\r\n if (axisOpt) {\r\n compatTextStyle(axisOpt, 'axisLabel');\r\n compatTextStyle(axisOpt.axisPointer, 'label');\r\n }\r\n });\r\n }\r\n );\r\n\r\n each(toArr(option.parallel), function (parallelOpt) {\r\n const parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\r\n compatTextStyle(parallelAxisDefault, 'axisLabel');\r\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\r\n });\r\n\r\n each(toArr(option.calendar), function (calendarOpt) {\r\n convertNormalEmphasis(calendarOpt, 'itemStyle');\r\n compatTextStyle(calendarOpt, 'dayLabel');\r\n compatTextStyle(calendarOpt, 'monthLabel');\r\n compatTextStyle(calendarOpt, 'yearLabel');\r\n });\r\n\r\n // radar.name.textStyle\r\n each(toArr(option.radar), function (radarOpt) {\r\n compatTextStyle(radarOpt, 'name');\r\n // Use axisName instead of name because component has name property\r\n if (radarOpt.name && radarOpt.axisName == null) {\r\n radarOpt.axisName = radarOpt.name;\r\n delete radarOpt.name;\r\n if (__DEV__) {\r\n deprecateLog('name property in radar component has been changed to axisName');\r\n }\r\n }\r\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\r\n radarOpt.axisNameGap = radarOpt.nameGap;\r\n delete radarOpt.nameGap;\r\n if (__DEV__) {\r\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\r\n }\r\n }\r\n if (__DEV__) {\r\n each(radarOpt.indicator, function (indicatorOpt: any) {\r\n if (indicatorOpt.text) {\r\n deprecateReplaceLog('text', 'name', 'radar.indicator');\r\n }\r\n });\r\n }\r\n });\r\n\r\n each(toArr(option.geo), function (geoOpt) {\r\n if (isObject(geoOpt)) {\r\n compatEC3CommonStyles(geoOpt);\r\n each(toArr(geoOpt.regions), function (regionObj) {\r\n compatEC3CommonStyles(regionObj);\r\n });\r\n }\r\n });\r\n\r\n each(toArr(option.timeline), function (timelineOpt) {\r\n compatEC3CommonStyles(timelineOpt);\r\n convertNormalEmphasis(timelineOpt, 'label');\r\n convertNormalEmphasis(timelineOpt, 'itemStyle');\r\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\r\n\r\n const data = timelineOpt.data;\r\n zrUtil.isArray(data) && zrUtil.each(data, function (item) {\r\n if (zrUtil.isObject(item)) {\r\n convertNormalEmphasis(item, 'label');\r\n convertNormalEmphasis(item, 'itemStyle');\r\n }\r\n });\r\n });\r\n\r\n each(toArr(option.toolbox), function (toolboxOpt) {\r\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\r\n each(toolboxOpt.feature, function (featureOpt) {\r\n convertNormalEmphasis(featureOpt, 'iconStyle');\r\n });\r\n });\r\n\r\n compatTextStyle(toObj(option.axisPointer), 'label');\r\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label');\r\n\r\n // Clean logs\r\n // storedLogs = {};\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {each, isArray, isObject, isTypedArray, defaults} from 'zrender/src/core/util';\r\nimport compatStyle from './helper/compatStyle';\r\nimport {normalizeToArray} from '../util/model';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { ECUnitOption } from '../util/types';\r\nimport type { BarSeriesOption } from '../chart/bar/BarSeries';\r\nimport type { PieSeriesOption } from '../chart/pie/PieSeries';\r\nimport { deprecateLog, deprecateReplaceLog } from '../util/log';\r\n\r\nfunction get(opt: Dictionary, path: string): any {\r\n const pathArr = path.split(',');\r\n let obj = opt;\r\n for (let i = 0; i < pathArr.length; i++) {\r\n obj = obj && obj[pathArr[i]];\r\n if (obj == null) {\r\n break;\r\n }\r\n }\r\n return obj;\r\n}\r\n\r\nfunction set(opt: Dictionary, path: string, val: any, overwrite?: boolean) {\r\n const pathArr = path.split(',');\r\n let obj = opt;\r\n let key;\r\n let i = 0;\r\n for (; i < pathArr.length - 1; i++) {\r\n key = pathArr[i];\r\n if (obj[key] == null) {\r\n obj[key] = {};\r\n }\r\n obj = obj[key];\r\n }\r\n if (overwrite || obj[pathArr[i]] == null) {\r\n obj[pathArr[i]] = val;\r\n }\r\n}\r\n\r\nfunction compatLayoutProperties(option: Dictionary) {\r\n option && each(LAYOUT_PROPERTIES, function (prop) {\r\n if (prop[0] in option && !(prop[1] in option)) {\r\n option[prop[1]] = option[prop[0]];\r\n }\r\n });\r\n}\r\n\r\nconst LAYOUT_PROPERTIES = [\r\n ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']\r\n];\r\n\r\nconst COMPATITABLE_COMPONENTS = [\r\n 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'\r\n];\r\n\r\nconst BAR_ITEM_STYLE_MAP = [\r\n ['borderRadius', 'barBorderRadius'],\r\n ['borderColor', 'barBorderColor'],\r\n ['borderWidth', 'barBorderWidth']\r\n];\r\n\r\nfunction compatBarItemStyle(option: Dictionary) {\r\n const itemStyle = option && option.itemStyle;\r\n if (itemStyle) {\r\n for (let i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\r\n const oldName = BAR_ITEM_STYLE_MAP[i][1];\r\n const newName = BAR_ITEM_STYLE_MAP[i][0];\r\n if (itemStyle[oldName] != null) {\r\n itemStyle[newName] = itemStyle[oldName];\r\n if (__DEV__) {\r\n deprecateReplaceLog(oldName, newName);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction compatPieLabel(option: Dictionary) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\r\n }\r\n option.edgeDistance = option.margin;\r\n }\r\n}\r\n\r\nfunction compatSunburstState(option: Dictionary) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.downplay && !option.blur) {\r\n option.blur = option.downplay;\r\n if (__DEV__) {\r\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\r\n }\r\n }\r\n}\r\n\r\nfunction compatGraphFocus(option: Dictionary) {\r\n if (!option) {\r\n return;\r\n }\r\n if (option.focusNodeAdjacency != null) {\r\n option.emphasis = option.emphasis || {};\r\n if (option.emphasis.focus == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\r\n }\r\n option.emphasis.focus = 'adjacency';\r\n }\r\n }\r\n}\r\n\r\nfunction traverseTree(data: any[], cb: Function) {\r\n if (data) {\r\n for (let i = 0; i < data.length; i++) {\r\n cb(data[i]);\r\n data[i] && traverseTree(data[i].children, cb);\r\n }\r\n }\r\n}\r\n\r\nexport default function globalBackwardCompat(option: ECUnitOption, isTheme?: boolean) {\r\n compatStyle(option, isTheme);\r\n\r\n // Make sure series array for model initialization.\r\n option.series = normalizeToArray(option.series);\r\n\r\n each(option.series, function (seriesOpt: any) {\r\n if (!isObject(seriesOpt)) {\r\n return;\r\n }\r\n\r\n const seriesType = seriesOpt.type;\r\n\r\n if (seriesType === 'line') {\r\n if (seriesOpt.clipOverflow != null) {\r\n seriesOpt.clip = seriesOpt.clipOverflow;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\r\n }\r\n }\r\n }\r\n else if (seriesType === 'pie' || seriesType === 'gauge') {\r\n if (seriesOpt.clockWise != null) {\r\n seriesOpt.clockwise = seriesOpt.clockWise;\r\n if (__DEV__) {\r\n deprecateReplaceLog('clockWise', 'clockwise');\r\n }\r\n }\r\n compatPieLabel((seriesOpt as PieSeriesOption).label);\r\n const data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (let i = 0; i < data.length; i++) {\r\n compatPieLabel(data[i]);\r\n }\r\n }\r\n\r\n if (seriesOpt.hoverOffset != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis.scaleSize = null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\r\n }\r\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\r\n }\r\n }\r\n }\r\n else if (seriesType === 'gauge') {\r\n const pointerColor = get(seriesOpt, 'pointer.color');\r\n pointerColor != null\r\n && set(seriesOpt, 'itemStyle.color', pointerColor);\r\n }\r\n else if (seriesType === 'bar') {\r\n compatBarItemStyle(seriesOpt);\r\n compatBarItemStyle((seriesOpt as BarSeriesOption).backgroundStyle);\r\n compatBarItemStyle(seriesOpt.emphasis);\r\n const data = seriesOpt.data;\r\n if (data && !isTypedArray(data)) {\r\n for (let i = 0; i < data.length; i++) {\r\n if (typeof data[i] === 'object') {\r\n compatBarItemStyle(data[i]);\r\n compatBarItemStyle(data[i] && data[i].emphasis);\r\n }\r\n }\r\n }\r\n }\r\n else if (seriesType === 'sunburst') {\r\n const highlightPolicy = seriesOpt.highlightPolicy;\r\n if (highlightPolicy) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (!seriesOpt.emphasis.focus) {\r\n seriesOpt.emphasis.focus = highlightPolicy;\r\n if (__DEV__) {\r\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\r\n }\r\n }\r\n }\r\n\r\n compatSunburstState(seriesOpt);\r\n\r\n traverseTree(seriesOpt.data, compatSunburstState);\r\n }\r\n else if (seriesType === 'graph' || seriesType === 'sankey') {\r\n compatGraphFocus(seriesOpt);\r\n // TODO nodes, edges?\r\n }\r\n else if (seriesType === 'map') {\r\n if (seriesOpt.mapType && !seriesOpt.map) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('mapType', 'map', 'map');\r\n }\r\n seriesOpt.map = seriesOpt.mapType;\r\n }\r\n if (seriesOpt.mapLocation) {\r\n if (__DEV__) {\r\n deprecateLog('`mapLocation` is not used anymore.');\r\n }\r\n defaults(seriesOpt, seriesOpt.mapLocation);\r\n }\r\n }\r\n\r\n if (seriesOpt.hoverAnimation != null) {\r\n seriesOpt.emphasis = seriesOpt.emphasis || {};\r\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\r\n if (__DEV__) {\r\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\r\n }\r\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\r\n }\r\n }\r\n\r\n compatLayoutProperties(seriesOpt);\r\n });\r\n\r\n // dataRange has changed to visualMap\r\n if (option.dataRange) {\r\n option.visualMap = option.dataRange;\r\n }\r\n\r\n each(COMPATITABLE_COMPONENTS, function (componentName) {\r\n let options = option[componentName];\r\n if (options) {\r\n if (!isArray(options)) {\r\n options = [options];\r\n }\r\n each(options, function (option) {\r\n compatLayoutProperties(option);\r\n });\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {createHashMap, each} from 'zrender/src/core/util';\r\nimport GlobalModel from '../model/Global';\r\nimport SeriesModel from '../model/Series';\r\nimport { SeriesOption, SeriesStackOptionMixin } from '../util/types';\r\nimport SeriesData, { DataCalculationInfo } from '../data/SeriesData';\r\nimport { addSafe } from '../util/number';\r\n\r\ntype StackInfo = Pick<\r\n DataCalculationInfo,\r\n 'stackedDimension'\r\n | 'isStackedByIndex'\r\n | 'stackedByDimension'\r\n | 'stackResultDimension'\r\n | 'stackedOverDimension'\r\n> & {\r\n data: SeriesData\r\n seriesModel: SeriesModel\r\n};\r\n\r\n// (1) [Caution]: the logic is correct based on the premises:\r\n// data processing stage is blocked in stream.\r\n// See \r\n// (2) Only register once when import repeatedly.\r\n// Should be executed after series is filtered and before stack calculation.\r\nexport default function dataStack(ecModel: GlobalModel) {\r\n const stackInfoMap = createHashMap();\r\n ecModel.eachSeries(function (seriesModel: SeriesModel) {\r\n const stack = seriesModel.get('stack');\r\n // Compatible: when `stack` is set as '', do not stack.\r\n if (stack) {\r\n const stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\r\n const data = seriesModel.getData();\r\n\r\n const stackInfo: StackInfo = {\r\n // Used for calculate axis extent automatically.\r\n // TODO: Type getCalculationInfo return more specific type?\r\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\r\n stackedDimension: data.getCalculationInfo('stackedDimension'),\r\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\r\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\r\n data: data,\r\n seriesModel: seriesModel\r\n };\r\n\r\n // If stacked on axis that do not support data stack.\r\n if (!stackInfo.stackedDimension\r\n || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)\r\n ) {\r\n return;\r\n }\r\n\r\n stackInfoList.length && data.setCalculationInfo(\r\n 'stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel\r\n );\r\n\r\n stackInfoList.push(stackInfo);\r\n }\r\n });\r\n\r\n stackInfoMap.each(calculateStack);\r\n}\r\n\r\nfunction calculateStack(stackInfoList: StackInfo[]) {\r\n each(stackInfoList, function (targetStackInfo, idxInStack) {\r\n const resultVal: number[] = [];\r\n const resultNaN = [NaN, NaN];\r\n const dims: [string, string] = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\r\n const targetData = targetStackInfo.data;\r\n const isStackedByIndex = targetStackInfo.isStackedByIndex;\r\n const stackStrategy = targetStackInfo.seriesModel.get('stackStrategy') || 'samesign';\r\n\r\n // Should not write on raw data, because stack series model list changes\r\n // depending on legend selection.\r\n targetData.modify(dims, function (v0, v1, dataIndex) {\r\n let sum = targetData.get(targetStackInfo.stackedDimension, dataIndex) as number;\r\n\r\n // Consider `connectNulls` of line area, if value is NaN, stackedOver\r\n // should also be NaN, to draw a appropriate belt area.\r\n if (isNaN(sum)) {\r\n return resultNaN;\r\n }\r\n\r\n let byValue: number;\r\n let stackedDataRawIndex;\r\n\r\n if (isStackedByIndex) {\r\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\r\n }\r\n else {\r\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex) as number;\r\n }\r\n\r\n // If stackOver is NaN, chart view will render point on value start.\r\n let stackedOver = NaN;\r\n\r\n for (let j = idxInStack - 1; j >= 0; j--) {\r\n const stackInfo = stackInfoList[j];\r\n\r\n // Has been optimized by inverted indices on `stackedByDimension`.\r\n if (!isStackedByIndex) {\r\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\r\n }\r\n\r\n if (stackedDataRawIndex >= 0) {\r\n const val = stackInfo.data.getByRawIndex(\r\n stackInfo.stackResultDimension, stackedDataRawIndex\r\n ) as number;\r\n\r\n // Considering positive stack, negative stack and empty data\r\n if (\r\n stackStrategy === 'all' // single stack group\r\n || (stackStrategy === 'positive' && val > 0)\r\n || (stackStrategy === 'negative' && val < 0)\r\n || (stackStrategy === 'samesign' && sum >= 0 && val > 0) // All positive stack\r\n || (stackStrategy === 'samesign' && sum <= 0 && val < 0) // All negative stack\r\n ) {\r\n // The sum has to be very small to be affected by the\r\n // floating arithmetic problem. An incorrect result will probably\r\n // cause axis min/max to be filtered incorrectly.\r\n sum = addSafe(sum, val);\r\n stackedOver = val;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n resultVal[0] = sum;\r\n resultVal[1] = stackedOver;\r\n\r\n return resultVal;\r\n });\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n isTypedArray, HashMap, clone, createHashMap, isArray, isObject, isArrayLike,\r\n hasOwn, assert, each, map, isNumber, isString, keys\r\n} from 'zrender/src/core/util';\r\nimport {\r\n SourceFormat, SeriesLayoutBy, DimensionDefinition,\r\n OptionEncodeValue, OptionSourceData,\r\n SOURCE_FORMAT_ORIGINAL,\r\n SERIES_LAYOUT_BY_COLUMN,\r\n SOURCE_FORMAT_UNKNOWN,\r\n SOURCE_FORMAT_KEYED_COLUMNS,\r\n SOURCE_FORMAT_TYPED_ARRAY,\r\n DimensionName,\r\n OptionSourceHeader,\r\n DimensionDefinitionLoose,\r\n SOURCE_FORMAT_ARRAY_ROWS,\r\n SOURCE_FORMAT_OBJECT_ROWS,\r\n Dictionary,\r\n OptionSourceDataObjectRows,\r\n OptionDataValue,\r\n OptionSourceDataArrayRows,\r\n SERIES_LAYOUT_BY_ROW,\r\n OptionSourceDataOriginal,\r\n OptionSourceDataKeyedColumns\r\n} from '../util/types';\r\nimport { DatasetOption } from '../component/dataset/install';\r\nimport { getDataItemValue } from '../util/model';\r\nimport { BE_ORDINAL, guessOrdinal } from './helper/sourceHelper';\r\n\r\n/**\r\n * [sourceFormat]\r\n *\r\n * + \"original\":\r\n * This format is only used in series.data, where\r\n * itemStyle can be specified in data item.\r\n *\r\n * + \"arrayRows\":\r\n * [\r\n * ['product', 'score', 'amount'],\r\n * ['Matcha Latte', 89.3, 95.8],\r\n * ['Milk Tea', 92.1, 89.4],\r\n * ['Cheese Cocoa', 94.4, 91.2],\r\n * ['Walnut Brownie', 85.4, 76.9]\r\n * ]\r\n *\r\n * + \"objectRows\":\r\n * [\r\n * {product: 'Matcha Latte', score: 89.3, amount: 95.8},\r\n * {product: 'Milk Tea', score: 92.1, amount: 89.4},\r\n * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2},\r\n * {product: 'Walnut Brownie', score: 85.4, amount: 76.9}\r\n * ]\r\n *\r\n * + \"keyedColumns\":\r\n * {\r\n * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'],\r\n * 'count': [823, 235, 1042, 988],\r\n * 'score': [95.8, 81.4, 91.2, 76.9]\r\n * }\r\n *\r\n * + \"typedArray\"\r\n *\r\n * + \"unknown\"\r\n */\r\n\r\nexport interface SourceMetaRawOption {\r\n seriesLayoutBy: SeriesLayoutBy;\r\n sourceHeader: OptionSourceHeader;\r\n dimensions: DimensionDefinitionLoose[];\r\n}\r\n\r\n// Prevent from `new Source()` external and circular reference.\r\nexport interface Source extends SourceImpl {};\r\n// @inner\r\nclass SourceImpl {\r\n\r\n /**\r\n * Not null/undefined.\r\n */\r\n readonly data: OptionSourceData;\r\n\r\n /**\r\n * See also \"detectSourceFormat\".\r\n * Not null/undefined.\r\n */\r\n readonly sourceFormat: SourceFormat;\r\n\r\n /**\r\n * 'row' or 'column'\r\n * Not null/undefined.\r\n */\r\n readonly seriesLayoutBy: SeriesLayoutBy;\r\n\r\n /**\r\n * dimensions definition from:\r\n * (1) standalone defined in option prop `dimensions: [...]`\r\n * (2) detected from option data. See `determineSourceDimensions`.\r\n * If can not be detected (e.g., there is only pure data `[[11, 33], ...]`\r\n * `dimensionsDefine` will be null/undefined.\r\n */\r\n readonly dimensionsDefine: DimensionDefinition[];\r\n\r\n /**\r\n * Only make sense in `SOURCE_FORMAT_ARRAY_ROWS`.\r\n * That is the same as `sourceHeader: number`,\r\n * which means from which line the real data start.\r\n * Not null/undefined, uint.\r\n */\r\n readonly startIndex: number;\r\n\r\n /**\r\n * Dimension count detected from data. Only works when `dimensionDefine`\r\n * does not exists.\r\n * Can be null/undefined (when unknown), uint.\r\n */\r\n readonly dimensionsDetectedCount: number;\r\n\r\n /**\r\n * Raw props from user option.\r\n */\r\n readonly metaRawOption: SourceMetaRawOption;\r\n\r\n\r\n constructor(fields: {\r\n data: OptionSourceData,\r\n sourceFormat: SourceFormat, // default: SOURCE_FORMAT_UNKNOWN\r\n\r\n // Visit config are optional:\r\n seriesLayoutBy?: SeriesLayoutBy, // default: 'column'\r\n dimensionsDefine?: DimensionDefinition[],\r\n startIndex?: number, // default: 0\r\n dimensionsDetectedCount?: number,\r\n\r\n metaRawOption?: SourceMetaRawOption,\r\n\r\n // [Caveat]\r\n // This is the raw user defined `encode` in `series`.\r\n // If user not defined, DO NOT make a empty object or hashMap here.\r\n // An empty object or hashMap will prevent from auto generating encode.\r\n encodeDefine?: HashMap\r\n }) {\r\n\r\n this.data = fields.data || (\r\n fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []\r\n );\r\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\r\n\r\n // Visit config\r\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\r\n this.startIndex = fields.startIndex || 0;\r\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\r\n this.metaRawOption = fields.metaRawOption;\r\n\r\n const dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine;\r\n\r\n if (dimensionsDefine) {\r\n for (let i = 0; i < dimensionsDefine.length; i++) {\r\n const dim = dimensionsDefine[i];\r\n if (dim.type == null) {\r\n if (guessOrdinal(this, i) === BE_ORDINAL.Must) {\r\n dim.type = 'ordinal';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexport function isSourceInstance(val: unknown): val is Source {\r\n return val instanceof SourceImpl;\r\n}\r\n\r\n/**\r\n * Create a source from option.\r\n * NOTE: Created source is immutable. Don't change any properties in it.\r\n */\r\nexport function createSource(\r\n sourceData: OptionSourceData,\r\n thisMetaRawOption: SourceMetaRawOption,\r\n // can be null. If not provided, auto detect it from `sourceData`.\r\n sourceFormat: SourceFormat\r\n): Source {\r\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\r\n const seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\r\n const determined = determineSourceDimensions(\r\n sourceData,\r\n sourceFormat,\r\n seriesLayoutBy,\r\n thisMetaRawOption.sourceHeader,\r\n thisMetaRawOption.dimensions\r\n );\r\n const source = new SourceImpl({\r\n data: sourceData,\r\n sourceFormat: sourceFormat,\r\n\r\n seriesLayoutBy: seriesLayoutBy,\r\n dimensionsDefine: determined.dimensionsDefine,\r\n startIndex: determined.startIndex,\r\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\r\n metaRawOption: clone(thisMetaRawOption)\r\n });\r\n\r\n return source;\r\n}\r\n\r\n/**\r\n * Wrap original series data for some compatibility cases.\r\n */\r\nexport function createSourceFromSeriesDataOption(data: OptionSourceData): Source {\r\n return new SourceImpl({\r\n data: data,\r\n sourceFormat: isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY\r\n : SOURCE_FORMAT_ORIGINAL\r\n });\r\n}\r\n\r\n/**\r\n * Clone source but excludes source data.\r\n */\r\nexport function cloneSourceShallow(source: Source): Source {\r\n return new SourceImpl({\r\n data: source.data,\r\n sourceFormat: source.sourceFormat,\r\n\r\n seriesLayoutBy: source.seriesLayoutBy,\r\n dimensionsDefine: clone(source.dimensionsDefine),\r\n startIndex: source.startIndex,\r\n dimensionsDetectedCount: source.dimensionsDetectedCount\r\n });\r\n}\r\n\r\n/**\r\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\r\n */\r\nexport function detectSourceFormat(data: DatasetOption['source']): SourceFormat {\r\n let sourceFormat: SourceFormat = SOURCE_FORMAT_UNKNOWN;\r\n\r\n if (isTypedArray(data)) {\r\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\r\n }\r\n else if (isArray(data)) {\r\n // FIXME Whether tolerate null in top level array?\r\n if (data.length === 0) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n }\r\n\r\n for (let i = 0, len = data.length; i < len; i++) {\r\n const item = data[i];\r\n\r\n if (item == null) {\r\n continue;\r\n }\r\n else if (isArray(item) || isTypedArray(item)) {\r\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\r\n break;\r\n }\r\n else if (isObject(item)) {\r\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\r\n break;\r\n }\r\n }\r\n }\r\n else if (isObject(data)) {\r\n for (const key in data) {\r\n if (hasOwn(data, key) && isArrayLike((data as Dictionary)[key])) {\r\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return sourceFormat;\r\n}\r\n\r\n/**\r\n * Determine the source definitions from data standalone dimensions definitions\r\n * are not specified.\r\n */\r\nfunction determineSourceDimensions(\r\n data: OptionSourceData,\r\n sourceFormat: SourceFormat,\r\n seriesLayoutBy: SeriesLayoutBy,\r\n sourceHeader: OptionSourceHeader,\r\n // standalone raw dimensions definition, like:\r\n // {\r\n // dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\r\n // }\r\n // in `dataset` or `series`\r\n dimensionsDefine: DimensionDefinitionLoose[]\r\n): {\r\n // If the input `dimensionsDefine` is specified, return it.\r\n // Else determine dimensions from the input `data`.\r\n // If not determined, `dimensionsDefine` will be null/undefined.\r\n dimensionsDefine: Source['dimensionsDefine'];\r\n startIndex: Source['startIndex'];\r\n dimensionsDetectedCount: Source['dimensionsDetectedCount'];\r\n} {\r\n let dimensionsDetectedCount;\r\n let startIndex: number;\r\n\r\n // PENDING: Could data be null/undefined here?\r\n // currently, if `dataset.source` not specified, error thrown.\r\n // if `series.data` not specified, nothing rendered without error thrown.\r\n // Should test these cases.\r\n if (!data) {\r\n return {\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n startIndex,\r\n dimensionsDetectedCount\r\n };\r\n }\r\n\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n const dataArrayRows = data as OptionSourceDataArrayRows;\r\n // Rule: Most of the first line are string: it is header.\r\n // Caution: consider a line with 5 string and 1 number,\r\n // it still can not be sure it is a head, because the\r\n // 5 string may be 5 values of category columns.\r\n if (sourceHeader === 'auto' || sourceHeader == null) {\r\n arrayRowsTravelFirst(function (val) {\r\n // '-' is regarded as null/undefined.\r\n if (val != null && val !== '-') {\r\n if (isString(val)) {\r\n startIndex == null && (startIndex = 1);\r\n }\r\n else {\r\n startIndex = 0;\r\n }\r\n }\r\n // 10 is an experience number, avoid long loop.\r\n }, seriesLayoutBy, dataArrayRows, 10);\r\n }\r\n else {\r\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\r\n }\r\n\r\n if (!dimensionsDefine && startIndex === 1) {\r\n dimensionsDefine = [];\r\n arrayRowsTravelFirst(function (val, index) {\r\n dimensionsDefine[index] = (val != null ? val + '' : '') as DimensionName;\r\n }, seriesLayoutBy, dataArrayRows, Infinity);\r\n }\r\n\r\n dimensionsDetectedCount = dimensionsDefine\r\n ? dimensionsDefine.length\r\n : seriesLayoutBy === SERIES_LAYOUT_BY_ROW\r\n ? dataArrayRows.length\r\n : dataArrayRows[0]\r\n ? dataArrayRows[0].length\r\n : null;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = objectRowsCollectDimensions(data as OptionSourceDataObjectRows);\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\r\n if (!dimensionsDefine) {\r\n dimensionsDefine = [];\r\n each(data as OptionSourceDataKeyedColumns, function (colArr, key) {\r\n dimensionsDefine.push(key);\r\n });\r\n }\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n const value0 = getDataItemValue((data as OptionSourceDataOriginal)[0]);\r\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\r\n }\r\n }\r\n\r\n return {\r\n startIndex: startIndex,\r\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\r\n dimensionsDetectedCount: dimensionsDetectedCount\r\n };\r\n}\r\n\r\nfunction objectRowsCollectDimensions(data: OptionSourceDataObjectRows): DimensionDefinitionLoose[] {\r\n let firstIndex = 0;\r\n let obj;\r\n while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\r\n if (obj) {\r\n return keys(obj);\r\n }\r\n}\r\n\r\n// Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\r\n// which is reasonable. But dimension name is duplicated.\r\n// Returns undefined or an array contains only object without null/undefined or string.\r\nfunction normalizeDimensionsOption(dimensionsDefine: DimensionDefinitionLoose[]): DimensionDefinition[] {\r\n if (!dimensionsDefine) {\r\n // The meaning of null/undefined is different from empty array.\r\n return;\r\n }\r\n const nameMap = createHashMap<{ count: number }, string>();\r\n return map(dimensionsDefine, function (rawItem, index) {\r\n rawItem = isObject(rawItem) ? rawItem : { name: rawItem };\r\n // Other fields will be discarded.\r\n const item: DimensionDefinition = {\r\n name: rawItem.name,\r\n displayName: rawItem.displayName,\r\n type: rawItem.type\r\n };\r\n\r\n // User can set null in dimensions.\r\n // We don't auto specify name, otherwise a given name may\r\n // cause it to be referred unexpectedly.\r\n if (item.name == null) {\r\n return item;\r\n }\r\n\r\n // Also consider number form like 2012.\r\n item.name += '';\r\n // User may also specify displayName.\r\n // displayName will always exists except user not\r\n // specified or dim name is not specified or detected.\r\n // (A auto generated dim name will not be used as\r\n // displayName).\r\n if (item.displayName == null) {\r\n item.displayName = item.name;\r\n }\r\n\r\n const exist = nameMap.get(item.name);\r\n if (!exist) {\r\n nameMap.set(item.name, {count: 1});\r\n }\r\n else {\r\n item.name += '-' + exist.count++;\r\n }\r\n\r\n return item;\r\n });\r\n}\r\n\r\nfunction arrayRowsTravelFirst(\r\n cb: (val: OptionDataValue, idx: number) => void,\r\n seriesLayoutBy: SeriesLayoutBy,\r\n data: OptionSourceDataArrayRows,\r\n maxLoop: number\r\n): void {\r\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\r\n for (let i = 0; i < data.length && i < maxLoop; i++) {\r\n cb(data[i] ? data[i][0] : null, i);\r\n }\r\n }\r\n else {\r\n const value0 = data[0] || [];\r\n for (let i = 0; i < value0.length && i < maxLoop; i++) {\r\n cb(value0[i], i);\r\n }\r\n }\r\n}\r\n\r\nexport function shouldRetrieveDataByName(source: Source): boolean {\r\n const sourceFormat = source.sourceFormat;\r\n return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// TODO\r\n// ??? refactor? check the outer usage of data provider.\r\n// merge with defaultDimValueGetter?\r\n\r\nimport {isTypedArray, extend, assert, each, isObject, bind} from 'zrender/src/core/util';\r\nimport {getDataItemValue} from '../../util/model';\r\nimport { createSourceFromSeriesDataOption, Source, isSourceInstance } from '../Source';\r\nimport {ArrayLike, Dictionary} from 'zrender/src/core/types';\r\nimport {\r\n SOURCE_FORMAT_ORIGINAL,\r\n SOURCE_FORMAT_OBJECT_ROWS,\r\n SOURCE_FORMAT_KEYED_COLUMNS,\r\n SOURCE_FORMAT_TYPED_ARRAY,\r\n SOURCE_FORMAT_ARRAY_ROWS,\r\n SERIES_LAYOUT_BY_COLUMN,\r\n SERIES_LAYOUT_BY_ROW,\r\n DimensionName, DimensionIndex, OptionSourceData,\r\n OptionDataItem, OptionDataValue, SourceFormat, SeriesLayoutBy, ParsedValue, DimensionLoose, NullUndefined\r\n} from '../../util/types';\r\nimport SeriesData from '../SeriesData';\r\n\r\nexport interface DataProvider {\r\n /**\r\n * true: all of the value are in primitive type (in type `OptionDataValue`).\r\n * false: Not sure whether any of them is non primitive type (in type `OptionDataItemObject`).\r\n * Like `data: [ { value: xx, itemStyle: {...} }, ...]`\r\n * At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\r\n */\r\n pure?: boolean;\r\n /**\r\n * If data is persistent and will not be released after use.\r\n */\r\n persistent?: boolean;\r\n\r\n getSource(): Source;\r\n count(): number;\r\n getItem(idx: number, out?: OptionDataItem): OptionDataItem;\r\n fillStorage?(\r\n start: number,\r\n end: number,\r\n out: ArrayLike[],\r\n extent: number[][]\r\n ): void\r\n appendData?(newData: ArrayLike): void;\r\n clean?(): void;\r\n}\r\n\r\n\r\nlet providerMethods: Dictionary;\r\nlet mountMethods: (provider: DefaultDataProvider, data: OptionSourceData, source: Source) => void;\r\n\r\nexport interface DefaultDataProvider {\r\n fillStorage?(\r\n start: number,\r\n end: number,\r\n out: ArrayLike[],\r\n extent: number[][]\r\n ): void\r\n}\r\n/**\r\n * If normal array used, mutable chunk size is supported.\r\n * If typed array used, chunk size must be fixed.\r\n */\r\nexport class DefaultDataProvider implements DataProvider {\r\n\r\n private _source: Source;\r\n\r\n private _data: OptionSourceData;\r\n\r\n private _offset: number;\r\n\r\n private _dimSize: number;\r\n\r\n pure: boolean;\r\n\r\n persistent: boolean;\r\n\r\n static protoInitialize = (function () {\r\n // PENDING: To avoid potential incompat (e.g., prototype\r\n // is visited somewhere), still init them on prototype.\r\n const proto = DefaultDataProvider.prototype;\r\n proto.pure = false;\r\n proto.persistent = true;\r\n })();\r\n\r\n\r\n constructor(sourceParam: Source | OptionSourceData, dimSize?: number) {\r\n // let source: Source;\r\n const source: Source = !isSourceInstance(sourceParam)\r\n ? createSourceFromSeriesDataOption(sourceParam as OptionSourceData)\r\n : sourceParam as Source;\r\n\r\n // declare source is Source;\r\n this._source = source;\r\n const data = this._data = source.data;\r\n\r\n // Typed array. TODO IE10+?\r\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n if (__DEV__) {\r\n if (dimSize == null) {\r\n throw new Error('Typed array data must specify dimension size');\r\n }\r\n }\r\n this._offset = 0;\r\n this._dimSize = dimSize;\r\n this._data = data;\r\n }\r\n\r\n mountMethods(this, data, source);\r\n }\r\n\r\n getSource(): Source {\r\n return this._source;\r\n }\r\n\r\n count(): number {\r\n return 0;\r\n }\r\n\r\n getItem(idx: number, out?: ArrayLike): OptionDataItem {\r\n return;\r\n }\r\n\r\n appendData(newData: OptionSourceData): void {\r\n }\r\n\r\n clean(): void {\r\n }\r\n\r\n private static internalField = (function () {\r\n\r\n mountMethods = function (provider, data, source) {\r\n const sourceFormat = source.sourceFormat;\r\n const seriesLayoutBy = source.seriesLayoutBy;\r\n const startIndex = source.startIndex;\r\n const dimsDef = source.dimensionsDefine;\r\n\r\n const methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\r\n }\r\n\r\n extend(provider, methods);\r\n\r\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\r\n provider.getItem = getItemForTypedArray;\r\n provider.count = countForTypedArray;\r\n provider.fillStorage = fillStorageForTypedArray;\r\n }\r\n else {\r\n const rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\r\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\r\n const rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\r\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\r\n }\r\n };\r\n\r\n const getItemForTypedArray: DefaultDataProvider['getItem'] = function (\r\n this: DefaultDataProvider, idx: number, out: ArrayLike\r\n ): ArrayLike {\r\n idx = idx - this._offset;\r\n out = out || [];\r\n const data = this._data;\r\n const dimSize = this._dimSize;\r\n const offset = dimSize * idx;\r\n for (let i = 0; i < dimSize; i++) {\r\n out[i] = (data as ArrayLike)[offset + i];\r\n }\r\n return out;\r\n };\r\n\r\n const fillStorageForTypedArray: DefaultDataProvider['fillStorage'] = function (\r\n this: DefaultDataProvider, start: number, end: number, storage: ArrayLike[], extent: number[][]\r\n ) {\r\n const data = this._data as ArrayLike;\r\n const dimSize = this._dimSize;\r\n\r\n for (let dim = 0; dim < dimSize; dim++) {\r\n const dimExtent = extent[dim];\r\n let min = dimExtent[0] == null ? Infinity : dimExtent[0];\r\n let max = dimExtent[1] == null ? -Infinity : dimExtent[1];\r\n const count = end - start;\r\n const arr = storage[dim];\r\n for (let i = 0; i < count; i++) {\r\n // appendData with TypedArray will always do replace in provider.\r\n const val = data[i * dimSize + dim];\r\n arr[start + i] = val;\r\n val < min && (min = val);\r\n val > max && (max = val);\r\n }\r\n dimExtent[0] = min;\r\n dimExtent[1] = max;\r\n }\r\n };\r\n\r\n const countForTypedArray: DefaultDataProvider['count'] = function (\r\n this: DefaultDataProvider\r\n ) {\r\n return this._data ? ((this._data as ArrayLike).length / this._dimSize) : 0;\r\n };\r\n\r\n providerMethods = {\r\n\r\n [SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN]: {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n\r\n [SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW]: {\r\n pure: true,\r\n appendData: function () {\r\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\r\n }\r\n },\r\n\r\n [SOURCE_FORMAT_OBJECT_ROWS]: {\r\n pure: true,\r\n appendData: appendDataSimply\r\n },\r\n\r\n [SOURCE_FORMAT_KEYED_COLUMNS]: {\r\n pure: true,\r\n appendData: function (this: DefaultDataProvider, newData: Dictionary) {\r\n const data = this._data as Dictionary;\r\n each(newData, function (newCol, key) {\r\n const oldCol = data[key] || (data[key] = []);\r\n for (let i = 0; i < (newCol || []).length; i++) {\r\n oldCol.push(newCol[i]);\r\n }\r\n });\r\n }\r\n },\r\n\r\n [SOURCE_FORMAT_ORIGINAL]: {\r\n appendData: appendDataSimply\r\n },\r\n\r\n [SOURCE_FORMAT_TYPED_ARRAY]: {\r\n persistent: false,\r\n pure: true,\r\n appendData: function (this: DefaultDataProvider, newData: ArrayLike): void {\r\n if (__DEV__) {\r\n assert(\r\n isTypedArray(newData),\r\n 'Added data must be TypedArray if data in initialization is TypedArray'\r\n );\r\n }\r\n this._data = newData;\r\n },\r\n\r\n // Clean self if data is already used.\r\n clean: function (this: DefaultDataProvider): void {\r\n // PENDING\r\n this._offset += this.count();\r\n this._data = null;\r\n }\r\n }\r\n };\r\n\r\n function appendDataSimply(this: DefaultDataProvider, newData: ArrayLike): void {\r\n for (let i = 0; i < newData.length; i++) {\r\n (this._data as any[]).push(newData[i]);\r\n }\r\n }\r\n\r\n })();\r\n}\r\n\r\n\r\n\r\ntype RawSourceItemGetter = (\r\n rawData: OptionSourceData,\r\n startIndex: number,\r\n dimsDef: { name?: DimensionName }[],\r\n idx: number,\r\n // Only used in SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW and SOURCE_FORMAT_KEYED_COLUMNS\r\n // to avoid create a new [] if `out` is provided.\r\n out?: ArrayLike\r\n) => OptionDataItem | ArrayLike;\r\n\r\nconst getItemSimply: RawSourceItemGetter = function (\r\n rawData, startIndex, dimsDef, idx\r\n): OptionDataItem {\r\n return (rawData as [])[idx];\r\n};\r\n\r\nconst rawSourceItemGetterMap: Dictionary = {\r\n [SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN]: function (\r\n rawData, startIndex, dimsDef, idx\r\n ) {\r\n return (rawData as OptionDataValue[][])[idx + startIndex];\r\n },\r\n [SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW]: function (\r\n rawData, startIndex, dimsDef, idx, out\r\n ) {\r\n idx += startIndex;\r\n const item = out || [];\r\n const data = rawData as OptionDataValue[][];\r\n for (let i = 0; i < data.length; i++) {\r\n const row = data[i];\r\n item[i] = row ? row[idx] : null;\r\n }\r\n return item;\r\n },\r\n [SOURCE_FORMAT_OBJECT_ROWS]: getItemSimply,\r\n [SOURCE_FORMAT_KEYED_COLUMNS]: function (\r\n rawData, startIndex, dimsDef, idx, out\r\n ) {\r\n const item = out || [];\r\n for (let i = 0; i < dimsDef.length; i++) {\r\n const dimName = dimsDef[i].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n const col = (rawData as Dictionary)[dimName];\r\n item[i] = col ? col[idx] : null;\r\n }\r\n return item;\r\n },\r\n [SOURCE_FORMAT_ORIGINAL]: getItemSimply\r\n};\r\n\r\nexport function getRawSourceItemGetter(\r\n sourceFormat: SourceFormat, seriesLayoutBy: SeriesLayoutBy\r\n): RawSourceItemGetter {\r\n const method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not support get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n}\r\n\r\n\r\n\r\n\r\ntype RawSourceDataCounter = (\r\n rawData: OptionSourceData,\r\n startIndex: number,\r\n dimsDef: { name?: DimensionName }[]\r\n) => number;\r\n\r\nconst countSimply: RawSourceDataCounter = function (\r\n rawData, startIndex, dimsDef\r\n) {\r\n return (rawData as []).length;\r\n};\r\n\r\nconst rawSourceDataCounterMap: Dictionary = {\r\n [SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN]: function (\r\n rawData, startIndex, dimsDef\r\n ) {\r\n return Math.max(0, (rawData as OptionDataItem[][]).length - startIndex);\r\n },\r\n [SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW]: function (\r\n rawData, startIndex, dimsDef\r\n ) {\r\n const row = (rawData as OptionDataValue[][])[0];\r\n return row ? Math.max(0, row.length - startIndex) : 0;\r\n },\r\n [SOURCE_FORMAT_OBJECT_ROWS]: countSimply,\r\n [SOURCE_FORMAT_KEYED_COLUMNS]: function (\r\n rawData, startIndex, dimsDef\r\n ) {\r\n const dimName = dimsDef[0].name;\r\n if (__DEV__) {\r\n if (dimName == null) {\r\n throw new Error();\r\n }\r\n }\r\n const col = (rawData as Dictionary)[dimName];\r\n return col ? col.length : 0;\r\n },\r\n [SOURCE_FORMAT_ORIGINAL]: countSimply\r\n};\r\n\r\nexport function getRawSourceDataCounter(\r\n sourceFormat: SourceFormat, seriesLayoutBy: SeriesLayoutBy\r\n): RawSourceDataCounter {\r\n const method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\r\n if (__DEV__) {\r\n assert(method, 'Do not support count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\r\n }\r\n return method;\r\n}\r\n\r\n\r\ntype RawSourceValueGetter = (\r\n dataItem: OptionDataItem,\r\n dimIndex: DimensionIndex,\r\n property: DimensionName\r\n) => OptionDataValue;\r\n\r\nconst getRawValueSimply = function (\r\n dataItem: ArrayLike, dimIndex: number, property: string\r\n): OptionDataValue {\r\n return dataItem[dimIndex];\r\n};\r\n\r\nconst rawSourceValueGetterMap: Partial> = {\r\n\r\n [SOURCE_FORMAT_ARRAY_ROWS]: getRawValueSimply,\r\n\r\n [SOURCE_FORMAT_OBJECT_ROWS]: function (\r\n dataItem: Dictionary, dimIndex: number, property: string\r\n ): OptionDataValue {\r\n return dataItem[property];\r\n },\r\n\r\n [SOURCE_FORMAT_KEYED_COLUMNS]: getRawValueSimply,\r\n\r\n [SOURCE_FORMAT_ORIGINAL]: function (\r\n dataItem: OptionDataItem, dimIndex: number, property: string\r\n ): OptionDataValue {\r\n // FIXME: In some case (markpoint in geo (geo-map.html)),\r\n // dataItem is {coord: [...]}\r\n const value = getDataItemValue(dataItem);\r\n return !(value instanceof Array)\r\n ? value\r\n : value[dimIndex];\r\n },\r\n\r\n [SOURCE_FORMAT_TYPED_ARRAY]: getRawValueSimply\r\n};\r\n\r\nexport function getRawSourceValueGetter(sourceFormat: SourceFormat): RawSourceValueGetter {\r\n const method = rawSourceValueGetterMap[sourceFormat];\r\n if (__DEV__) {\r\n assert(method, 'Do not support get value on \"' + sourceFormat + '\".');\r\n }\r\n return method;\r\n}\r\n\r\n\r\nfunction getMethodMapKey(sourceFormat: SourceFormat, seriesLayoutBy: SeriesLayoutBy): string {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS\r\n ? sourceFormat + '_' + seriesLayoutBy\r\n : sourceFormat;\r\n}\r\n\r\n\r\n// ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\r\n// Consider persistent.\r\n// Caution: why use raw value to display on label or tooltip?\r\n// A reason is to avoid format. For example time value we do not know\r\n// how to format is expected. More over, if stack is used, calculated\r\n// value may be 0.91000000001, which have brings trouble to display.\r\n// TODO: consider how to treat null/undefined/NaN when display?\r\nexport function retrieveRawValue(\r\n data: SeriesData, dataIndex: number,\r\n // If dimIndex is null/undefined, return OptionDataItem.\r\n // Otherwise, return OptionDataValue.\r\n dim?: DimensionLoose | NullUndefined\r\n): OptionDataValue | OptionDataItem {\r\n if (!data) {\r\n return;\r\n }\r\n\r\n // Consider data may be not persistent.\r\n const dataItem = data.getRawDataItem(dataIndex);\r\n\r\n if (dataItem == null) {\r\n return;\r\n }\r\n\r\n const store = data.getStore();\r\n const sourceFormat = store.getSource().sourceFormat;\r\n\r\n if (dim != null) {\r\n const dimIndex = data.getDimensionIndex(dim);\r\n const property = store.getDimensionProperty(dimIndex);\r\n\r\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property);\r\n }\r\n else {\r\n let result = dataItem;\r\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n result = getDataItemValue(dataItem);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Compatible with some cases (in pie, map) like:\r\n * data: [{name: 'xx', value: 5, selected: true}, ...]\r\n * where only sourceFormat is 'original' and 'objectRows' supported.\r\n *\r\n * // TODO\r\n * Supported detail options in data item when using 'arrayRows'.\r\n *\r\n * @param data\r\n * @param dataIndex\r\n * @param attr like 'selected'\r\n */\r\nexport function retrieveRawAttr(data: SeriesData, dataIndex: number, attr: string): any {\r\n if (!data) {\r\n return;\r\n }\r\n\r\n const sourceFormat = data.getStore().getSource().sourceFormat;\r\n\r\n if (sourceFormat !== SOURCE_FORMAT_ORIGINAL\r\n && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS\r\n ) {\r\n return;\r\n }\r\n\r\n let dataItem = data.getRawDataItem(dataIndex);\r\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\r\n dataItem = null;\r\n }\r\n if (dataItem) {\r\n return (dataItem as Dictionary)[attr];\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {retrieveRawValue} from '../../data/helper/dataProvider';\r\nimport {formatTpl} from '../../util/format';\r\nimport {\r\n DataHost,\r\n DisplayState,\r\n CallbackDataParams,\r\n ColorString,\r\n ZRColor,\r\n OptionDataValue,\r\n SeriesDataType,\r\n ComponentMainType,\r\n ComponentSubType,\r\n DimensionLoose,\r\n InterpolatableValue\r\n} from '../../util/types';\r\nimport GlobalModel from '../Global';\r\nimport { TooltipMarkupBlockFragment } from '../../component/tooltip/tooltipMarkup';\r\nimport { error, makePrintable } from '../../util/log';\r\n\r\nconst DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\r\n\r\n\r\nexport interface DataFormatMixin extends DataHost {\r\n ecModel: GlobalModel;\r\n mainType: ComponentMainType;\r\n subType: ComponentSubType;\r\n componentIndex: number;\r\n id: string;\r\n name: string;\r\n animatedValue: OptionDataValue[];\r\n}\r\n\r\nexport class DataFormatMixin {\r\n\r\n /**\r\n * Get params for formatter\r\n */\r\n getDataParams(\r\n dataIndex: number,\r\n dataType?: SeriesDataType\r\n ): CallbackDataParams {\r\n\r\n const data = this.getData(dataType);\r\n const rawValue = this.getRawValue(dataIndex, dataType);\r\n const rawDataIndex = data.getRawIndex(dataIndex);\r\n const name = data.getName(dataIndex);\r\n const itemOpt = data.getRawDataItem(dataIndex);\r\n const style = data.getItemVisual(dataIndex, 'style');\r\n const color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'] as ZRColor;\r\n const borderColor = style && style.stroke as ColorString;\r\n const mainType = this.mainType;\r\n const isSeries = mainType === 'series';\r\n const userOutput = data.userOutput && data.userOutput.get();\r\n\r\n return {\r\n componentType: mainType,\r\n componentSubType: this.subType,\r\n componentIndex: this.componentIndex,\r\n seriesType: isSeries ? this.subType : null,\r\n seriesIndex: (this as any).seriesIndex,\r\n seriesId: isSeries ? this.id : null,\r\n seriesName: isSeries ? this.name : null,\r\n name: name,\r\n dataIndex: rawDataIndex,\r\n data: itemOpt,\r\n dataType: dataType,\r\n value: rawValue,\r\n color: color,\r\n borderColor: borderColor,\r\n dimensionNames: userOutput ? userOutput.fullDimensions : null,\r\n encode: userOutput ? userOutput.encode : null,\r\n\r\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\r\n $vars: ['seriesName', 'name', 'value']\r\n };\r\n }\r\n\r\n /**\r\n * Format label\r\n * @param dataIndex\r\n * @param status 'normal' by default\r\n * @param dataType\r\n * @param labelDimIndex Only used in some chart that\r\n * use formatter in different dimensions, like radar.\r\n * @param formatter Formatter given outside.\r\n * @return return null/undefined if no formatter\r\n */\r\n getFormattedLabel(\r\n dataIndex: number,\r\n status?: DisplayState,\r\n dataType?: SeriesDataType,\r\n labelDimIndex?: number,\r\n formatter?: string | ((params: object) => string),\r\n extendParams?: {\r\n interpolatedValue: InterpolatableValue\r\n }\r\n ): string {\r\n status = status || 'normal';\r\n const data = this.getData(dataType);\r\n\r\n const params = this.getDataParams(dataIndex, dataType);\r\n\r\n if (extendParams) {\r\n params.value = extendParams.interpolatedValue;\r\n }\r\n\r\n if (labelDimIndex != null && zrUtil.isArray(params.value)) {\r\n params.value = params.value[labelDimIndex];\r\n }\r\n\r\n if (!formatter) {\r\n const itemModel = data.getItemModel(dataIndex);\r\n // @ts-ignore\r\n formatter = itemModel.get(status === 'normal'\r\n ? ['label', 'formatter']\r\n : [status, 'label', 'formatter']\r\n );\r\n }\r\n\r\n if (zrUtil.isFunction(formatter)) {\r\n params.status = status;\r\n params.dimensionIndex = labelDimIndex;\r\n return formatter(params);\r\n }\r\n else if (zrUtil.isString(formatter)) {\r\n const str = formatTpl(formatter, params);\r\n\r\n // Support 'aaa{@[3]}bbb{@product}ccc'.\r\n // Do not support '}' in dim name util have to.\r\n return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr: string) {\r\n const len = dimStr.length;\r\n\r\n let dimLoose: DimensionLoose = dimStr;\r\n if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') {\r\n dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0\r\n if (__DEV__) {\r\n if (isNaN(dimLoose)) {\r\n error(`Invalide label formatter: @${dimStr}, only support @[0], @[1], @[2], ...`);\r\n }\r\n }\r\n }\r\n\r\n let val = retrieveRawValue(data, dataIndex, dimLoose) as OptionDataValue;\r\n\r\n if (extendParams && zrUtil.isArray(extendParams.interpolatedValue)) {\r\n const dimIndex = data.getDimensionIndex(dimLoose);\r\n if (dimIndex >= 0) {\r\n val = extendParams.interpolatedValue[dimIndex];\r\n }\r\n }\r\n\r\n return val != null ? val + '' : '';\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Get raw value in option\r\n */\r\n getRawValue(\r\n idx: number,\r\n dataType?: SeriesDataType\r\n ): unknown {\r\n return retrieveRawValue(this.getData(dataType), idx);\r\n }\r\n\r\n /**\r\n * Should be implemented.\r\n * @param {number} dataIndex\r\n * @param {boolean} [multipleSeries=false]\r\n * @param {string} [dataType]\r\n */\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries?: boolean,\r\n dataType?: string\r\n ): TooltipFormatResult {\r\n // Empty function\r\n return;\r\n }\r\n};\r\n\r\ntype TooltipFormatResult =\r\n // If `string`, means `TooltipFormatResultLegacyObject['html']`\r\n string\r\n // | TooltipFormatResultLegacyObject\r\n | TooltipMarkupBlockFragment;\r\n\r\n// PENDING: previously we accept this type when calling `formatTooltip`,\r\n// but guess little chance has been used outside. Do we need to backward\r\n// compat it?\r\n// type TooltipFormatResultLegacyObject = {\r\n// // `html` means the markup language text, either in 'html' or 'richText'.\r\n// // The name `html` is not appropriate because in 'richText' it is not a HTML\r\n// // string. But still support it for backward compatibility.\r\n// html: string;\r\n// markers: Dictionary;\r\n// };\r\n\r\n/**\r\n * For backward compat, normalize the return from `formatTooltip`.\r\n */\r\nexport function normalizeTooltipFormatResult(result: TooltipFormatResult): {\r\n // If `markupFragment` exists, `markupText` should be ignored.\r\n frag: TooltipMarkupBlockFragment;\r\n // Can be `null`/`undefined`, means no tooltip.\r\n text: string;\r\n // Merged with `markersExisting`.\r\n // markers: Dictionary;\r\n} {\r\n let markupText;\r\n // let markers: Dictionary;\r\n let markupFragment: TooltipMarkupBlockFragment;\r\n if (zrUtil.isObject(result)) {\r\n if ((result as TooltipMarkupBlockFragment).type) {\r\n markupFragment = result as TooltipMarkupBlockFragment;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\r\n }\r\n }\r\n // else {\r\n // markupText = (result as TooltipFormatResultLegacyObject).html;\r\n // markers = (result as TooltipFormatResultLegacyObject).markers;\r\n // if (markersExisting) {\r\n // markers = zrUtil.merge(markersExisting, markers);\r\n // }\r\n // }\r\n }\r\n else {\r\n markupText = result;\r\n }\r\n\r\n return {\r\n text: markupText,\r\n // markers: markers || markersExisting,\r\n frag: markupFragment\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {assert, isArray} from 'zrender/src/core/util';\r\nimport SeriesModel from '../model/Series';\r\nimport { Pipeline } from './Scheduler';\r\nimport { Payload } from '../util/types';\r\nimport SeriesData from '../data/SeriesData';\r\n\r\n\r\nexport interface TaskContext {\r\n outputData?: SeriesData;\r\n data?: SeriesData;\r\n payload?: Payload;\r\n model?: SeriesModel;\r\n};\r\n\r\nexport type TaskResetCallback = (\r\n this: Task, context: Ctx\r\n) => TaskResetCallbackReturn;\r\nexport type TaskResetCallbackReturn =\r\n void\r\n | (TaskProgressCallback | TaskProgressCallback[])\r\n | {\r\n forceFirstProgress?: boolean\r\n progress: TaskProgressCallback | TaskProgressCallback[]\r\n };\r\nexport type TaskProgressCallback = (\r\n this: Task, params: TaskProgressParams, context: Ctx\r\n) => void;\r\nexport type TaskProgressParams = {\r\n start: number, end: number, count: number, next?: TaskDataIteratorNext\r\n};\r\nexport type TaskPlanCallback = (\r\n this: Task, context: Ctx\r\n) => TaskPlanCallbackReturn;\r\nexport type TaskPlanCallbackReturn = 'reset' | false | null | undefined;\r\nexport type TaskCountCallback = (\r\n this: Task, context: Ctx\r\n) => number;\r\nexport type TaskOnDirtyCallback = (\r\n this: Task, context: Ctx\r\n) => void;\r\n\r\ntype TaskDataIteratorNext = () => number;\r\ntype TaskDataIterator = {\r\n reset: (s: number, e: number, sStep: number, sCount: number) => void,\r\n next?: TaskDataIteratorNext\r\n};\r\n\r\ntype TaskDefineParam = {\r\n reset?: TaskResetCallback,\r\n // Returns 'reset' indicate reset immediately\r\n plan?: TaskPlanCallback,\r\n // count is used to determine data task.\r\n count?: TaskCountCallback,\r\n onDirty?: TaskOnDirtyCallback\r\n};\r\nexport type PerformArgs = {\r\n step?: number,\r\n skip?: boolean,\r\n modBy?: number,\r\n modDataCount?: number\r\n};\r\n\r\n/**\r\n * @param {Object} define\r\n * @return See the return of `createTask`.\r\n */\r\nexport function createTask(\r\n define: TaskDefineParam\r\n): Task {\r\n return new Task(define);\r\n}\r\n\r\nexport class Task {\r\n\r\n private _reset: TaskResetCallback;\r\n private _plan: TaskPlanCallback;\r\n private _count: TaskCountCallback;\r\n private _onDirty: TaskOnDirtyCallback;\r\n private _progress: TaskProgressCallback | TaskProgressCallback[];\r\n private _callingProgress: TaskProgressCallback;\r\n\r\n private _dirty: boolean;\r\n private _modBy: number;\r\n private _modDataCount: number;\r\n private _upstream: Task;\r\n private _downstream: Task;\r\n private _dueEnd: number;\r\n private _outputDueEnd: number;\r\n private _settedOutputEnd: number;\r\n private _dueIndex: number;\r\n private _disposed: boolean;\r\n\r\n // Injected in schedular\r\n __pipeline: Pipeline;\r\n __idxInPipeline: number;\r\n __block: boolean;\r\n\r\n // Context must be specified implicitly, to\r\n // avoid miss update context when model changed.\r\n context: Ctx;\r\n\r\n constructor(define: TaskDefineParam) {\r\n define = define || {};\r\n\r\n this._reset = define.reset;\r\n this._plan = define.plan;\r\n this._count = define.count;\r\n this._onDirty = define.onDirty;\r\n\r\n this._dirty = true;\r\n }\r\n\r\n /**\r\n * @param step Specified step.\r\n * @param skip Skip customer perform call.\r\n * @param modBy Sampling window size.\r\n * @param modDataCount Sampling count.\r\n * @return whether unfinished.\r\n */\r\n perform(performArgs?: PerformArgs): boolean {\r\n const upTask = this._upstream;\r\n const skip = performArgs && performArgs.skip;\r\n\r\n // TODO some refactor.\r\n // Pull data. Must pull data each time, because context.data\r\n // may be updated by Series.setData.\r\n if (this._dirty && upTask) {\r\n const context = this.context;\r\n context.data = context.outputData = upTask.context.outputData;\r\n }\r\n\r\n if (this.__pipeline) {\r\n this.__pipeline.currentTask = this;\r\n }\r\n\r\n let planResult;\r\n if (this._plan && !skip) {\r\n planResult = this._plan(this.context);\r\n }\r\n\r\n // Support sharding by mod, which changes the render sequence and makes the rendered graphic\r\n // elements uniformed distributed when progress, especially when moving or zooming.\r\n const lastModBy = normalizeModBy(this._modBy);\r\n const lastModDataCount = this._modDataCount || 0;\r\n const modBy = normalizeModBy(performArgs && performArgs.modBy);\r\n const modDataCount = performArgs && performArgs.modDataCount || 0;\r\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\r\n planResult = 'reset';\r\n }\r\n\r\n function normalizeModBy(val: number) {\r\n !(val >= 1) && (val = 1); // jshint ignore:line\r\n return val;\r\n }\r\n\r\n let forceFirstProgress;\r\n if (this._dirty || planResult === 'reset') {\r\n this._dirty = false;\r\n forceFirstProgress = this._doReset(skip);\r\n }\r\n\r\n this._modBy = modBy;\r\n this._modDataCount = modDataCount;\r\n\r\n const step = performArgs && performArgs.step;\r\n\r\n if (upTask) {\r\n if (__DEV__) {\r\n assert(upTask._outputDueEnd != null);\r\n }\r\n this._dueEnd = upTask._outputDueEnd;\r\n }\r\n // DataTask or overallTask\r\n else {\r\n if (__DEV__) {\r\n assert(!this._progress || this._count);\r\n }\r\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\r\n }\r\n\r\n // Note: Stubs, that its host overall task let it has progress, has progress.\r\n // If no progress, pass index from upstream to downstream each time plan called.\r\n if (this._progress) {\r\n const start = this._dueIndex;\r\n const end = Math.min(\r\n step != null ? this._dueIndex + step : Infinity,\r\n this._dueEnd\r\n );\r\n\r\n if (!skip && (forceFirstProgress || start < end)) {\r\n const progress = this._progress;\r\n if (isArray(progress)) {\r\n for (let i = 0; i < progress.length; i++) {\r\n this._doProgress(progress[i], start, end, modBy, modDataCount);\r\n }\r\n }\r\n else {\r\n this._doProgress(progress, start, end, modBy, modDataCount);\r\n }\r\n }\r\n\r\n this._dueIndex = end;\r\n // If no `outputDueEnd`, assume that output data and\r\n // input data is the same, so use `dueIndex` as `outputDueEnd`.\r\n const outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : end;\r\n\r\n if (__DEV__) {\r\n // ??? Can not rollback.\r\n assert(outputDueEnd >= this._outputDueEnd);\r\n }\r\n\r\n this._outputDueEnd = outputDueEnd;\r\n }\r\n else {\r\n // (1) Some overall task has no progress.\r\n // (2) Stubs, that its host overall task do not let it has progress, has no progress.\r\n // This should always be performed so it can be passed to downstream.\r\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null\r\n ? this._settedOutputEnd : this._dueEnd;\r\n }\r\n\r\n return this.unfinished();\r\n }\r\n\r\n dirty(): void {\r\n this._dirty = true;\r\n this._onDirty && this._onDirty(this.context);\r\n }\r\n\r\n private _doProgress(\r\n progress: TaskProgressCallback,\r\n start: number,\r\n end: number,\r\n modBy: number,\r\n modDataCount: number\r\n ): void {\r\n iterator.reset(start, end, modBy, modDataCount);\r\n this._callingProgress = progress;\r\n this._callingProgress({\r\n start: start, end: end, count: end - start, next: iterator.next\r\n }, this.context);\r\n }\r\n\r\n private _doReset(skip: boolean): boolean {\r\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\r\n this._settedOutputEnd = null;\r\n\r\n let progress: TaskResetCallbackReturn;\r\n let forceFirstProgress: boolean;\r\n\r\n if (!skip && this._reset) {\r\n progress = this._reset(this.context);\r\n if (progress && (progress as any).progress) {\r\n forceFirstProgress = (progress as any).forceFirstProgress;\r\n progress = (progress as any).progress;\r\n }\r\n // To simplify no progress checking, array must has item.\r\n if (isArray(progress) && !progress.length) {\r\n progress = null;\r\n }\r\n }\r\n\r\n this._progress = progress as TaskProgressCallback;\r\n this._modBy = this._modDataCount = null;\r\n\r\n const downstream = this._downstream;\r\n downstream && downstream.dirty();\r\n\r\n return forceFirstProgress;\r\n }\r\n\r\n unfinished(): boolean {\r\n return this._progress && this._dueIndex < this._dueEnd;\r\n }\r\n\r\n /**\r\n * @param downTask The downstream task.\r\n * @return The downstream task.\r\n */\r\n pipe(downTask: Task): void {\r\n if (__DEV__) {\r\n assert(downTask && !downTask._disposed && downTask !== this);\r\n }\r\n\r\n // If already downstream, do not dirty downTask.\r\n if (this._downstream !== downTask || this._dirty) {\r\n this._downstream = downTask;\r\n downTask._upstream = this;\r\n downTask.dirty();\r\n }\r\n }\r\n\r\n dispose(): void {\r\n if (this._disposed) {\r\n return;\r\n }\r\n\r\n this._upstream && (this._upstream._downstream = null);\r\n this._downstream && (this._downstream._upstream = null);\r\n\r\n this._dirty = false;\r\n this._disposed = true;\r\n }\r\n\r\n getUpstream(): Task {\r\n return this._upstream;\r\n }\r\n\r\n getDownstream(): Task {\r\n return this._downstream;\r\n }\r\n\r\n setOutputEnd(end: number): void {\r\n // This only happens in dataTask, dataZoom, map, currently.\r\n // where dataZoom do not set end each time, but only set\r\n // when reset. So we should record the set end, in case\r\n // that the stub of dataZoom perform again and earse the\r\n // set end by upstream.\r\n this._outputDueEnd = this._settedOutputEnd = end;\r\n }\r\n\r\n}\r\n\r\nconst iterator: TaskDataIterator = (function () {\r\n\r\n let end: number;\r\n let current: number;\r\n let modBy: number;\r\n let modDataCount: number;\r\n let winCount: number;\r\n\r\n const it: TaskDataIterator = {\r\n reset: function (s: number, e: number, sStep: number, sCount: number): void {\r\n current = s;\r\n end = e;\r\n\r\n modBy = sStep;\r\n modDataCount = sCount;\r\n winCount = Math.ceil(modDataCount / modBy);\r\n\r\n it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;\r\n }\r\n };\r\n\r\n return it;\r\n\r\n function sequentialNext(): number {\r\n return current < end ? current++ : null;\r\n }\r\n\r\n function modNext(): number {\r\n const dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);\r\n const result = current >= end\r\n ? null\r\n : dataIndex < modDataCount\r\n ? dataIndex\r\n // If modDataCount is smaller than data.count() (consider `appendData` case),\r\n // Use normal linear rendering mode.\r\n : current;\r\n current++;\r\n return result;\r\n }\r\n})();\r\n\r\n\r\n\r\n// -----------------------------------------------------------------------------\r\n// For stream debug (Should be commented out after used!)\r\n// @usage: printTask(this, 'begin');\r\n// @usage: printTask(this, null, {someExtraProp});\r\n// @usage: Use `__idxInPipeline` as conditional breakpiont.\r\n//\r\n// window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {\r\n// window.ecTaskUID == null && (window.ecTaskUID = 0);\r\n// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\r\n// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\r\n// let props = [];\r\n// if (task.__pipeline) {\r\n// let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\r\n// props.push({text: '__idxInPipeline/total', value: val});\r\n// } else {\r\n// let stubCount = 0;\r\n// task.agentStubMap.each(() => stubCount++);\r\n// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\r\n// }\r\n// props.push({text: 'uid', value: task.uidDebug});\r\n// if (task.__pipeline) {\r\n// props.push({text: 'pipelineId', value: task.__pipeline.id});\r\n// task.agent && props.push(\r\n// {text: 'stubFor', value: task.agent.uidDebug}\r\n// );\r\n// }\r\n// props.push(\r\n// {text: 'dirty', value: task._dirty},\r\n// {text: 'dueIndex', value: task._dueIndex},\r\n// {text: 'dueEnd', value: task._dueEnd},\r\n// {text: 'outputDueEnd', value: task._outputDueEnd}\r\n// );\r\n// if (extra) {\r\n// Object.keys(extra).forEach(key => {\r\n// props.push({text: key, value: extra[key]});\r\n// });\r\n// }\r\n// let args = ['color: blue'];\r\n// let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\r\n// args.push('color: green', 'color: red'),\r\n// `${item.text}: %c${item.value}`\r\n// )).join('%c, ');\r\n// console.log.apply(console, [msg].concat(args));\r\n// // console.log(this);\r\n// };\r\n// window.printPipeline = function (task: any, prefix: string) {\r\n// const pipeline = task.__pipeline;\r\n// let currTask = pipeline.head;\r\n// while (currTask) {\r\n// window.printTask(currTask, prefix);\r\n// currTask = currTask._downstream;\r\n// }\r\n// };\r\n// window.showChain = function (chainHeadTask) {\r\n// var chain = [];\r\n// var task = chainHeadTask;\r\n// while (task) {\r\n// chain.push({\r\n// task: task,\r\n// up: task._upstream,\r\n// down: task._downstream,\r\n// idxInPipeline: task.__idxInPipeline\r\n// });\r\n// task = task._downstream;\r\n// }\r\n// return chain;\r\n// };\r\n// window.findTaskInChain = function (task, chainHeadTask) {\r\n// let chain = window.showChain(chainHeadTask);\r\n// let result = [];\r\n// for (let i = 0; i < chain.length; i++) {\r\n// let chainItem = chain[i];\r\n// if (chainItem.task === task) {\r\n// result.push(i);\r\n// }\r\n// }\r\n// return result;\r\n// };\r\n// window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {\r\n// let chainA = window.showChain(chainHeadTaskA);\r\n// for (let i = 0; i < chainA.length; i++) {\r\n// console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));\r\n// }\r\n// };\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { ParsedValue, DimensionType } from '../../util/types';\r\nimport { parseDate, numericToNumber } from '../../util/number';\r\nimport { createHashMap, trim, hasOwn, isString, isNumber } from 'zrender/src/core/util';\r\nimport { throwError } from '../../util/log';\r\n\r\n\r\n/**\r\n * Convert raw the value in to inner value in List.\r\n *\r\n * [Performance sensitive]\r\n *\r\n * [Caution]: this is the key logic of user value parser.\r\n * For backward compatibility, do not modify it until you have to!\r\n */\r\nexport function parseDataValue(\r\n value: any,\r\n // For high performance, do not omit the second param.\r\n opt: {\r\n // Default type: 'number'. There is no 'unknown' type. That is, a string\r\n // will be parsed to NaN if do not set `type` as 'ordinal'. It has been\r\n // the logic in `List.ts` for long time. Follow the same way if you need\r\n // to get same result as List did from a raw value.\r\n type?: DimensionType\r\n }\r\n): ParsedValue {\r\n // Performance sensitive.\r\n const dimType = opt && opt.type;\r\n if (dimType === 'ordinal') {\r\n // If given value is a category string\r\n return value;\r\n }\r\n\r\n if (dimType === 'time'\r\n // spead up when using timestamp\r\n && !isNumber(value)\r\n && value != null\r\n && value !== '-'\r\n ) {\r\n value = +parseDate(value);\r\n }\r\n\r\n // dimType defaults 'number'.\r\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\r\n // parse to NaN.\r\n // number-like string (like ' 123 ') can be converted to a number.\r\n // where null/undefined or other string will be converted to NaN.\r\n return (value == null || value === '')\r\n ? NaN\r\n // If string (like '-'), using '+' parse to NaN\r\n // If object, also parse to NaN\r\n : Number(value);\r\n};\r\n\r\n\r\n\r\n\r\nexport type RawValueParserType = 'number' | 'time' | 'trim';\r\ntype RawValueParser = (val: unknown) => unknown;\r\nconst valueParserMap = createHashMap({\r\n 'number': function (val): number {\r\n // Do not use `numericToNumber` here. We have `numericToNumber` by default.\r\n // Here the number parser can have loose rule:\r\n // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\r\n return parseFloat(val as string);\r\n },\r\n 'time': function (val): number {\r\n // return timestamp.\r\n return +parseDate(val);\r\n },\r\n 'trim': function (val) {\r\n return isString(val) ? trim(val) : val;\r\n }\r\n});\r\n\r\nexport function getRawValueParser(type: RawValueParserType): RawValueParser {\r\n return valueParserMap.get(type);\r\n}\r\n\r\n\r\n\r\n\r\nexport interface FilterComparator {\r\n evaluate(val: unknown): boolean;\r\n}\r\n\r\nconst ORDER_COMPARISON_OP_MAP: {\r\n [key in OrderRelationOperator]: ((lval: unknown, rval: unknown) => boolean)\r\n} = {\r\n lt: (lval, rval) => lval < rval,\r\n lte: (lval, rval) => lval <= rval,\r\n gt: (lval, rval) => lval > rval,\r\n gte: (lval, rval) => lval >= rval\r\n};\r\n\r\nclass FilterOrderComparator implements FilterComparator {\r\n private _rvalFloat: number;\r\n private _opFn: (lval: unknown, rval: unknown) => boolean;\r\n constructor(op: OrderRelationOperator, rval: unknown) {\r\n if (!isNumber(rval)) {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\r\n }\r\n throwError(errMsg);\r\n }\r\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n // Performance sensitive.\r\n evaluate(lval: unknown): boolean {\r\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\r\n return isNumber(lval)\r\n ? this._opFn(lval, this._rvalFloat)\r\n : this._opFn(numericToNumber(lval), this._rvalFloat);\r\n }\r\n}\r\n\r\nexport class SortOrderComparator {\r\n private _incomparable: number;\r\n private _resultLT: -1 | 1;\r\n /**\r\n * @param order by default: 'asc'\r\n * @param incomparable by default: Always on the tail.\r\n * That is, if 'asc' => 'max', if 'desc' => 'min'\r\n * See the definition of \"incomparable\" in [SORT_COMPARISON_RULE].\r\n */\r\n constructor(order: 'asc' | 'desc', incomparable: 'min' | 'max') {\r\n const isDesc = order === 'desc';\r\n this._resultLT = isDesc ? 1 : -1;\r\n if (incomparable == null) {\r\n incomparable = isDesc ? 'min' : 'max';\r\n }\r\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\r\n }\r\n // See [SORT_COMPARISON_RULE].\r\n // Performance sensitive.\r\n evaluate(lval: unknown, rval: unknown): -1 | 0 | 1 {\r\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\r\n let lvalFloat = isNumber(lval) ? lval : numericToNumber(lval);\r\n let rvalFloat = isNumber(rval) ? rval : numericToNumber(rval);\r\n const lvalNotNumeric = isNaN(lvalFloat as number);\r\n const rvalNotNumeric = isNaN(rvalFloat as number);\r\n\r\n if (lvalNotNumeric) {\r\n lvalFloat = this._incomparable;\r\n }\r\n if (rvalNotNumeric) {\r\n rvalFloat = this._incomparable;\r\n }\r\n if (lvalNotNumeric && rvalNotNumeric) {\r\n const lvalIsStr = isString(lval);\r\n const rvalIsStr = isString(rval);\r\n if (lvalIsStr) {\r\n lvalFloat = rvalIsStr ? lval as unknown as number : 0;\r\n }\r\n if (rvalIsStr) {\r\n rvalFloat = lvalIsStr ? rval as unknown as number : 0;\r\n }\r\n }\r\n\r\n return lvalFloat < rvalFloat ? this._resultLT\r\n : lvalFloat > rvalFloat ? (-this._resultLT as -1 | 1)\r\n : 0;\r\n }\r\n}\r\n\r\nclass FilterEqualityComparator implements FilterComparator {\r\n private _isEQ: boolean;\r\n private _rval: unknown;\r\n private _rvalTypeof: string;\r\n private _rvalFloat: number;\r\n constructor(isEq: boolean, rval: unknown) {\r\n this._rval = rval;\r\n this._isEQ = isEq;\r\n this._rvalTypeof = typeof rval;\r\n this._rvalFloat = numericToNumber(rval);\r\n }\r\n // Performance sensitive.\r\n evaluate(lval: unknown): boolean {\r\n let eqResult = lval === this._rval;\r\n if (!eqResult) {\r\n const lvalTypeof = typeof lval;\r\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\r\n eqResult = numericToNumber(lval) === this._rvalFloat;\r\n }\r\n }\r\n return this._isEQ ? eqResult : !eqResult;\r\n }\r\n}\r\n\r\ntype OrderRelationOperator = 'lt' | 'lte' | 'gt' | 'gte';\r\nexport type RelationalOperator = OrderRelationOperator | 'eq' | 'ne';\r\n\r\n/**\r\n * [FILTER_COMPARISON_RULE]\r\n * `lt`|`lte`|`gt`|`gte`:\r\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\r\n * `eq`:\r\n * + If same type, compare with `===`.\r\n * + If there is one number, convert to number (`numericToNumber`) to compare.\r\n * + Else return `false`.\r\n * `ne`:\r\n * + Not `eq`.\r\n *\r\n *\r\n * [SORT_COMPARISON_RULE]\r\n * All the values are grouped into three categories:\r\n * + \"numeric\" (number and numeric string)\r\n * + \"non-numeric-string\" (string that excluding numeric string)\r\n * + \"others\"\r\n * \"numeric\" vs \"numeric\": values are ordered by number order.\r\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\r\n * \"others\" vs \"others\": do not change order (always return 0).\r\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\r\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\r\n * MEMO:\r\n * Non-numeric string sort makes sense when we need to put the items with the same tag together.\r\n * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\r\n * So we treat \"numeric-string\" sorted by number order rather than string comparison.\r\n *\r\n *\r\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\r\n * + Do not support string comparison until required. And also need to\r\n * avoid the misleading of \"2\" > \"12\".\r\n * + Should avoid the misleading case:\r\n * `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\r\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\r\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\r\n * See `util/number.ts#numericToNumber`.\r\n *\r\n * @return If `op` is not `RelationalOperator`, return null;\r\n */\r\nexport function createFilterComparator(\r\n op: string,\r\n rval?: unknown\r\n): FilterComparator {\r\n return (op === 'eq' || op === 'ne')\r\n ? new FilterEqualityComparator(op === 'eq', rval)\r\n : hasOwn(ORDER_COMPARISON_OP_MAP, op)\r\n ? new FilterOrderComparator(op as OrderRelationOperator, rval)\r\n : null;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n Dictionary, DimensionDefinitionLoose,\r\n SourceFormat, DimensionDefinition, DimensionIndex,\r\n OptionDataValue, DimensionLoose, DimensionName, ParsedValue,\r\n SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_ARRAY_ROWS,\r\n OptionSourceDataObjectRows, OptionSourceDataArrayRows\r\n} from '../../util/types';\r\nimport { normalizeToArray } from '../../util/model';\r\nimport {\r\n createHashMap, bind, each, hasOwn, map, clone, isObject, extend, isNumber\r\n} from 'zrender/src/core/util';\r\nimport {\r\n getRawSourceItemGetter, getRawSourceDataCounter, getRawSourceValueGetter\r\n} from './dataProvider';\r\nimport { parseDataValue } from './dataValueHelper';\r\nimport { log, makePrintable, throwError } from '../../util/log';\r\nimport { createSource, Source, SourceMetaRawOption, detectSourceFormat } from '../Source';\r\n\r\n\r\nexport type PipedDataTransformOption = DataTransformOption[];\r\nexport type DataTransformType = string;\r\nexport type DataTransformConfig = unknown;\r\n\r\nexport interface DataTransformOption {\r\n type: DataTransformType;\r\n config?: DataTransformConfig;\r\n // Print the result via `console.log` when transform performed. Only work in dev mode for debug.\r\n print?: boolean;\r\n}\r\n\r\nexport interface ExternalDataTransform {\r\n // Must include namespace like: 'ecStat:regression'\r\n type: string;\r\n __isBuiltIn?: boolean;\r\n transform: (\r\n param: ExternalDataTransformParam\r\n ) => ExternalDataTransformResultItem | ExternalDataTransformResultItem[];\r\n}\r\n\r\ninterface ExternalDataTransformParam {\r\n // This is the first source in upstreamList. In most cases,\r\n // there is only one upstream source.\r\n upstream: ExternalSource;\r\n upstreamList: ExternalSource[];\r\n config: TO['config'];\r\n}\r\nexport interface ExternalDataTransformResultItem {\r\n /**\r\n * If `data` is null/undefined, inherit upstream data.\r\n */\r\n data: OptionSourceDataArrayRows | OptionSourceDataObjectRows;\r\n /**\r\n * A `transform` can optionally return a dimensions definition.\r\n * The rule:\r\n * If this `transform result` have different dimensions from the upstream, it should return\r\n * a new dimension definition. For example, this transform inherit the upstream data totally\r\n * but add a extra dimension.\r\n * Otherwise, do not need to return that dimension definition. echarts will inherit dimension\r\n * definition from the upstream.\r\n */\r\n dimensions?: DimensionDefinitionLoose[];\r\n}\r\nexport type DataTransformDataItem = ExternalDataTransformResultItem['data'][number];\r\nexport interface ExternalDimensionDefinition extends Partial {\r\n // Mandatory\r\n index: DimensionIndex;\r\n}\r\n\r\n/**\r\n * TODO: disable writable.\r\n * This structure will be exposed to users.\r\n */\r\nexport class ExternalSource {\r\n /**\r\n * [Caveat]\r\n * This instance is to be exposed to users.\r\n * (1) DO NOT mount private members on this instance directly.\r\n * If we have to use private members, we can make them in closure or use `makeInner`.\r\n * (2) \"source header count\" is not provided to transform, because it's complicated to manage\r\n * header and dimensions definition in each transform. Source headers are all normalized to\r\n * dimensions definitions in transforms and their downstreams.\r\n */\r\n\r\n sourceFormat: SourceFormat;\r\n\r\n getRawData(): Source['data'] {\r\n // Only built-in transform available.\r\n throw new Error('not supported');\r\n }\r\n\r\n getRawDataItem(dataIndex: number): DataTransformDataItem {\r\n // Only built-in transform available.\r\n throw new Error('not supported');\r\n }\r\n\r\n cloneRawData(): Source['data'] {\r\n return;\r\n }\r\n\r\n /**\r\n * @return If dimension not found, return null/undefined.\r\n */\r\n getDimensionInfo(dim: DimensionLoose): ExternalDimensionDefinition {\r\n return;\r\n }\r\n\r\n /**\r\n * dimensions defined if and only if either:\r\n * (a) dataset.dimensions are declared.\r\n * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).\r\n * If dimensions are defined, `dimensionInfoAll` is corresponding to\r\n * the defined dimensions.\r\n * Otherwise, `dimensionInfoAll` is determined by data columns.\r\n * @return Always return an array (even empty array).\r\n */\r\n cloneAllDimensionInfo(): ExternalDimensionDefinition[] {\r\n return;\r\n }\r\n\r\n count(): number {\r\n return;\r\n }\r\n\r\n /**\r\n * Only support by dimension index.\r\n * No need to support by dimension name in transform function,\r\n * because transform function is not case-specific, no need to use name literally.\r\n */\r\n retrieveValue(dataIndex: number, dimIndex: DimensionIndex): OptionDataValue {\r\n return;\r\n }\r\n\r\n retrieveValueFromItem(dataItem: DataTransformDataItem, dimIndex: DimensionIndex): OptionDataValue {\r\n return;\r\n }\r\n\r\n convertValue(rawVal: unknown, dimInfo: ExternalDimensionDefinition): ParsedValue {\r\n return parseDataValue(rawVal, dimInfo);\r\n }\r\n}\r\n\r\n\r\nfunction createExternalSource(internalSource: Source, externalTransform: ExternalDataTransform): ExternalSource {\r\n const extSource = new ExternalSource();\r\n\r\n const data = internalSource.data;\r\n const sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\r\n const sourceHeaderCount = internalSource.startIndex;\r\n\r\n let errMsg = '';\r\n if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {\r\n // For the logic simplicity in transformer, only 'culumn' is\r\n // supported in data transform. Otherwise, the `dimensionsDefine`\r\n // might be detected by 'row', which probably confuses users.\r\n if (__DEV__) {\r\n errMsg = '`seriesLayoutBy` of upstream dataset can only be \"column\" in data transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n // [MEMO]\r\n // Create a new dimensions structure for exposing.\r\n // Do not expose all dimension info to users directly.\r\n // Because the dimension is probably auto detected from data and not might reliable.\r\n // Should not lead the transformers to think that is reliable and return it.\r\n // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\r\n const dimensions = [] as ExternalDimensionDefinition[];\r\n const dimsByName = {} as Dictionary;\r\n\r\n const dimsDef = internalSource.dimensionsDefine;\r\n if (dimsDef) {\r\n each(dimsDef, function (dimDef, idx) {\r\n const name = dimDef.name;\r\n const dimDefExt = {\r\n index: idx,\r\n name: name,\r\n displayName: dimDef.displayName\r\n };\r\n dimensions.push(dimDefExt);\r\n // Users probably do not specify dimension name. For simplicity, data transform\r\n // does not generate dimension name.\r\n if (name != null) {\r\n // Dimension name should not be duplicated.\r\n // For simplicity, data transform forbids name duplication, do not generate\r\n // new name like module `completeDimensions.ts` did, but just tell users.\r\n let errMsg = '';\r\n if (hasOwn(dimsByName, name)) {\r\n if (__DEV__) {\r\n errMsg = 'dimension name \"' + name + '\" duplicated.';\r\n }\r\n throwError(errMsg);\r\n }\r\n dimsByName[name] = dimDefExt;\r\n }\r\n });\r\n }\r\n // If dimension definitions are not defined and can not be detected.\r\n // e.g., pure data `[[11, 22], ...]`.\r\n else {\r\n for (let i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\r\n // Do not generete name or anything others. The consequence process in\r\n // `transform` or `series` probably have there own name generation strategry.\r\n dimensions.push({ index: i });\r\n }\r\n }\r\n\r\n // Implement public methods:\r\n const rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n if (externalTransform.__isBuiltIn) {\r\n extSource.getRawDataItem = function (dataIndex) {\r\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex) as DataTransformDataItem;\r\n };\r\n extSource.getRawData = bind(getRawData, null, internalSource);\r\n }\r\n\r\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\r\n\r\n const rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\r\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\r\n\r\n const rawValueGetter = getRawSourceValueGetter(sourceFormat);\r\n extSource.retrieveValue = function (dataIndex, dimIndex) {\r\n const rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex) as DataTransformDataItem;\r\n return retrieveValueFromItem(rawItem, dimIndex);\r\n };\r\n const retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\r\n if (dataItem == null) {\r\n return;\r\n }\r\n const dimDef = dimensions[dimIndex];\r\n // When `dimIndex` is `null`, `rawValueGetter` return the whole item.\r\n if (dimDef) {\r\n return rawValueGetter(dataItem, dimIndex, dimDef.name) as OptionDataValue;\r\n }\r\n };\r\n\r\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\r\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\r\n\r\n return extSource;\r\n}\r\n\r\nfunction getRawData(upstream: Source): Source['data'] {\r\n const sourceFormat = upstream.sourceFormat;\r\n\r\n if (!isSupportedSourceFormat(sourceFormat)) {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n return upstream.data;\r\n}\r\n\r\nfunction cloneRawData(upstream: Source): Source['data'] {\r\n const sourceFormat = upstream.sourceFormat;\r\n const data = upstream.data;\r\n\r\n if (!isSupportedSourceFormat(sourceFormat)) {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\r\n const result = [];\r\n for (let i = 0, len = data.length; i < len; i++) {\r\n // Not strictly clone for performance\r\n result.push((data as OptionSourceDataArrayRows)[i].slice());\r\n }\r\n return result;\r\n }\r\n else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\r\n const result = [];\r\n for (let i = 0, len = data.length; i < len; i++) {\r\n // Not strictly clone for performance\r\n result.push(extend({}, (data as OptionSourceDataObjectRows)[i]));\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nfunction getDimensionInfo(\r\n dimensions: ExternalDimensionDefinition[],\r\n dimsByName: Dictionary,\r\n dim: DimensionLoose\r\n): ExternalDimensionDefinition {\r\n if (dim == null) {\r\n return;\r\n }\r\n // Keep the same logic as `List::getDimension` did.\r\n if (isNumber(dim)\r\n // If being a number-like string but not being defined a dimension name.\r\n || (!isNaN(dim as any) && !hasOwn(dimsByName, dim))\r\n ) {\r\n return dimensions[dim as DimensionIndex];\r\n }\r\n else if (hasOwn(dimsByName, dim)) {\r\n return dimsByName[dim as DimensionName];\r\n }\r\n}\r\n\r\nfunction cloneAllDimensionInfo(dimensions: ExternalDimensionDefinition[]): ExternalDimensionDefinition[] {\r\n return clone(dimensions);\r\n}\r\n\r\n\r\nconst externalTransformMap = createHashMap();\r\n\r\nexport function registerExternalTransform(\r\n externalTransform: ExternalDataTransform\r\n): void {\r\n externalTransform = clone(externalTransform);\r\n let type = externalTransform.type;\r\n let errMsg = '';\r\n if (!type) {\r\n if (__DEV__) {\r\n errMsg = 'Must have a `type` when `registerTransform`.';\r\n }\r\n throwError(errMsg);\r\n }\r\n const typeParsed = type.split(':');\r\n if (typeParsed.length !== 2) {\r\n if (__DEV__) {\r\n errMsg = 'Name must include namespace like \"ns:regression\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n // Namespace 'echarts:xxx' is official namespace, where the transforms should\r\n // be called directly via 'xxx' rather than 'echarts:xxx'.\r\n let isBuiltIn = false;\r\n if (typeParsed[0] === 'echarts') {\r\n type = typeParsed[1];\r\n isBuiltIn = true;\r\n }\r\n externalTransform.__isBuiltIn = isBuiltIn;\r\n externalTransformMap.set(type, externalTransform);\r\n}\r\n\r\nexport function applyDataTransform(\r\n rawTransOption: DataTransformOption | PipedDataTransformOption,\r\n sourceList: Source[],\r\n infoForPrint: { datasetIndex: number }\r\n): Source[] {\r\n const pipedTransOption: PipedDataTransformOption = normalizeToArray(rawTransOption);\r\n const pipeLen = pipedTransOption.length;\r\n\r\n let errMsg = '';\r\n if (!pipeLen) {\r\n if (__DEV__) {\r\n errMsg = 'If `transform` declared, it should at least contain one transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n for (let i = 0, len = pipeLen; i < len; i++) {\r\n const transOption = pipedTransOption[i];\r\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i);\r\n // piped transform only support single input, except the fist one.\r\n // piped transform only support single output, except the last one.\r\n if (i !== len - 1) {\r\n sourceList.length = Math.max(sourceList.length, 1);\r\n }\r\n }\r\n\r\n return sourceList;\r\n}\r\n\r\nfunction applySingleDataTransform(\r\n transOption: DataTransformOption,\r\n upSourceList: Source[],\r\n infoForPrint: { datasetIndex: number },\r\n // If `pipeIndex` is null/undefined, no piped transform.\r\n pipeIndex: number\r\n): Source[] {\r\n let errMsg = '';\r\n if (!upSourceList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Must have at least one upstream dataset.';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (!isObject(transOption)) {\r\n if (__DEV__) {\r\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n const transType = transOption.type;\r\n const externalTransform = externalTransformMap.get(transType);\r\n\r\n if (!externalTransform) {\r\n if (__DEV__) {\r\n errMsg = 'Can not find transform on type \"' + transType + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n // Prepare source\r\n const extUpSourceList = map(upSourceList, upSource => createExternalSource(upSource, externalTransform));\r\n\r\n const resultList = normalizeToArray(\r\n externalTransform.transform({\r\n upstream: extUpSourceList[0],\r\n upstreamList: extUpSourceList,\r\n config: clone(transOption.config)\r\n })\r\n );\r\n\r\n if (__DEV__) {\r\n if (transOption.print) {\r\n const printStrArr = map(resultList, extSource => {\r\n const pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\r\n return [\r\n '=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===',\r\n '- transform result data:',\r\n makePrintable(extSource.data),\r\n '- transform result dimensions:',\r\n makePrintable(extSource.dimensions)\r\n ].join('\\n');\r\n }).join('\\n');\r\n log(printStrArr);\r\n }\r\n }\r\n\r\n return map(resultList, function (result, resultIndex) {\r\n let errMsg = '';\r\n\r\n if (!isObject(result)) {\r\n if (__DEV__) {\r\n errMsg = 'A transform should not return some empty results.';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n if (!result.data) {\r\n if (__DEV__) {\r\n errMsg = 'Transform result data should be not be null or undefined';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n const sourceFormat = detectSourceFormat(result.data);\r\n if (!isSupportedSourceFormat(sourceFormat)) {\r\n if (__DEV__) {\r\n errMsg = 'Transform result data should be array rows or object rows.';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n let resultMetaRawOption: SourceMetaRawOption;\r\n const firstUpSource = upSourceList[0];\r\n\r\n /**\r\n * Intuitively, the end users known the content of the original `dataset.source`,\r\n * calucating the transform result in mind.\r\n * Suppose the original `dataset.source` is:\r\n * ```js\r\n * [\r\n * ['product', '2012', '2013', '2014', '2015'],\r\n * ['AAA', 41.1, 30.4, 65.1, 53.3],\r\n * ['BBB', 86.5, 92.1, 85.7, 83.1],\r\n * ['CCC', 24.1, 67.2, 79.5, 86.4]\r\n * ]\r\n * ```\r\n * The dimension info have to be detected from the source data.\r\n * Some of the transformers (like filter, sort) will follow the dimension info\r\n * of upstream, while others use new dimensions (like aggregate).\r\n * Transformer can output a field `dimensions` to define the its own output dimensions.\r\n * We also allow transformers to ignore the output `dimensions` field, and\r\n * inherit the upstream dimensions definition. It can reduce the burden of handling\r\n * dimensions in transformers.\r\n *\r\n * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\r\n */\r\n if (\r\n firstUpSource\r\n && resultIndex === 0\r\n // If transformer returns `dimensions`, it means that the transformer has different\r\n // dimensions definitions. We do not inherit anything from upstream.\r\n && !result.dimensions\r\n ) {\r\n const startIndex = firstUpSource.startIndex;\r\n // We copy the header of upstream to the result, because:\r\n // (1) The returned data always does not contain header line and can not be used\r\n // as dimension-detection. In this case we can not use \"detected dimensions\" of\r\n // upstream directly, because it might be detected based on different `seriesLayoutBy`.\r\n // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.\r\n // So the original detected header should be add to the result, otherwise they can not be read.\r\n if (startIndex) {\r\n result.data = (firstUpSource.data as []).slice(0, startIndex)\r\n .concat(result.data as []);\r\n }\r\n\r\n resultMetaRawOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: startIndex,\r\n dimensions: firstUpSource.metaRawOption.dimensions\r\n };\r\n }\r\n else {\r\n resultMetaRawOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\r\n sourceHeader: 0,\r\n dimensions: result.dimensions\r\n };\r\n }\r\n\r\n return createSource(\r\n result.data,\r\n resultMetaRawOption,\r\n null\r\n );\r\n });\r\n}\r\n\r\nfunction isSupportedSourceFormat(sourceFormat: SourceFormat): boolean {\r\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { assert, clone, createHashMap, isFunction, keys, map, reduce } from 'zrender/src/core/util';\r\nimport {\r\n DimensionIndex,\r\n DimensionName,\r\n OptionDataItem,\r\n ParsedValue,\r\n ParsedValueNumeric\r\n} from '../util/types';\r\nimport { DataProvider } from './helper/dataProvider';\r\nimport { parseDataValue } from './helper/dataValueHelper';\r\nimport OrdinalMeta from './OrdinalMeta';\r\nimport { shouldRetrieveDataByName, Source } from './Source';\r\n\r\nconst UNDEFINED = 'undefined';\r\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\r\n\r\n// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\r\n// different from the Ctor of typed array.\r\nexport const CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\r\nexport const CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\r\nexport const CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\r\nexport const CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array;\r\n/**\r\n * Multi dimensional data store\r\n */\r\nconst dataCtors = {\r\n 'float': CtorFloat64Array,\r\n 'int': CtorInt32Array,\r\n // Ordinal data type can be string or int\r\n 'ordinal': Array,\r\n 'number': Array,\r\n 'time': CtorFloat64Array\r\n} as const;\r\n\r\nexport type DataStoreDimensionType = keyof typeof dataCtors;\r\n\r\ntype DataTypedArray = Uint32Array | Int32Array | Uint16Array | Float64Array;\r\ntype DataTypedArrayConstructor = typeof Uint32Array | typeof Int32Array | typeof Uint16Array | typeof Float64Array;\r\ntype DataArrayLikeConstructor = typeof Array | DataTypedArrayConstructor;\r\n\r\n\r\ntype DataValueChunk = ArrayLike;\r\n\r\n// If Ctx not specified, use List as Ctx\r\ntype EachCb0 = (idx: number) => void;\r\ntype EachCb1 = (x: ParsedValue, idx: number) => void;\r\ntype EachCb2 = (x: ParsedValue, y: ParsedValue, idx: number) => void;\r\ntype EachCb = (...args: any) => void;\r\ntype FilterCb0 = (idx: number) => boolean;\r\ntype FilterCb1 = (x: ParsedValue, idx: number) => boolean;\r\ntype FilterCb = (...args: any) => boolean;\r\n// type MapArrayCb = (...args: any) => any;\r\ntype MapCb = (...args: any) => ParsedValue | ParsedValue[];\r\n\r\nexport type DimValueGetter = (\r\n this: DataStore,\r\n dataItem: any,\r\n property: string,\r\n dataIndex: number,\r\n dimIndex: DimensionIndex\r\n) => ParsedValue;\r\n\r\nexport interface DataStoreDimensionDefine {\r\n /**\r\n * Default to be float.\r\n */\r\n type?: DataStoreDimensionType;\r\n\r\n /**\r\n * Only used in SOURCE_FORMAT_OBJECT_ROWS and SOURCE_FORMAT_KEYED_COLUMNS to retrieve value\r\n * by \"object property\".\r\n * For example, in `[{bb: 124, aa: 543}, ...]`, \"aa\" and \"bb\" is \"object property\".\r\n *\r\n * Deliberately name it as \"property\" rather than \"name\" to prevent it from been used in\r\n * SOURCE_FORMAT_ARRAY_ROWS, because if it comes from series, it probably\r\n * can not be shared by different series.\r\n */\r\n property?: string;\r\n\r\n /**\r\n * When using category axis.\r\n * Category strings will be collected and stored in ordinalMeta.categories.\r\n * And store will store the index of categories.\r\n */\r\n ordinalMeta?: OrdinalMeta,\r\n\r\n /**\r\n * Offset for ordinal parsing and collect\r\n */\r\n ordinalOffset?: number\r\n}\r\n\r\nlet defaultDimValueGetters: {[sourceFormat: string]: DimValueGetter};\r\n\r\nfunction getIndicesCtor(rawCount: number): DataArrayLikeConstructor {\r\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\r\n return rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\r\n};\r\nfunction getInitialExtent(): [number, number] {\r\n return [Infinity, -Infinity];\r\n};\r\nfunction cloneChunk(originalChunk: DataValueChunk): DataValueChunk {\r\n const Ctor = originalChunk.constructor;\r\n // Only shallow clone is enough when Array.\r\n return Ctor === Array\r\n ? (originalChunk as Array).slice()\r\n : new (Ctor as DataTypedArrayConstructor)(originalChunk as DataTypedArray);\r\n}\r\n\r\nfunction prepareStore(\r\n store: DataValueChunk[],\r\n dimIdx: number,\r\n dimType: DataStoreDimensionType,\r\n end: number,\r\n append?: boolean\r\n): void {\r\n const DataCtor = dataCtors[dimType || 'float'];\r\n\r\n if (append) {\r\n const oldStore = store[dimIdx];\r\n const oldLen = oldStore && oldStore.length;\r\n if (!(oldLen === end)) {\r\n const newStore = new DataCtor(end);\r\n // The cost of the copy is probably inconsiderable\r\n // within the initial chunkSize.\r\n for (let j = 0; j < oldLen; j++) {\r\n newStore[j] = oldStore[j];\r\n }\r\n store[dimIdx] = newStore;\r\n }\r\n }\r\n else {\r\n store[dimIdx] = new DataCtor(end);\r\n }\r\n};\r\n\r\n/**\r\n * Basically, DataStore API keep immutable.\r\n */\r\nclass DataStore {\r\n private _chunks: DataValueChunk[] = [];\r\n\r\n private _provider: DataProvider;\r\n\r\n // It will not be calculated until needed.\r\n private _rawExtent: [number, number][] = [];\r\n\r\n private _extent: [number, number][] = [];\r\n\r\n // Indices stores the indices of data subset after filtered.\r\n // This data subset will be used in chart.\r\n private _indices: ArrayLike;\r\n\r\n private _count: number = 0;\r\n private _rawCount: number = 0;\r\n\r\n private _dimensions: DataStoreDimensionDefine[];\r\n private _dimValueGetter: DimValueGetter;\r\n\r\n private _calcDimNameToIdx = createHashMap();\r\n\r\n defaultDimValueGetter: DimValueGetter;\r\n\r\n /**\r\n * Initialize from data\r\n */\r\n initData(\r\n provider: DataProvider,\r\n inputDimensions: DataStoreDimensionDefine[],\r\n dimValueGetter?: DimValueGetter\r\n ): void {\r\n if (__DEV__) {\r\n assert(\r\n isFunction(provider.getItem) && isFunction(provider.count),\r\n 'Invalid data provider.'\r\n );\r\n }\r\n\r\n this._provider = provider;\r\n\r\n // Clear\r\n this._chunks = [];\r\n this._indices = null;\r\n this.getRawIndex = this._getRawIdxIdentity;\r\n\r\n const source = provider.getSource();\r\n const defaultGetter = this.defaultDimValueGetter =\r\n defaultDimValueGetters[source.sourceFormat];\r\n // Default dim value getter\r\n this._dimValueGetter = dimValueGetter || defaultGetter;\r\n\r\n // Reset raw extent.\r\n this._rawExtent = [];\r\n const willRetrieveDataByName = shouldRetrieveDataByName(source);\r\n this._dimensions = map(inputDimensions, dim => {\r\n if (__DEV__) {\r\n if (willRetrieveDataByName) {\r\n assert(dim.property != null);\r\n }\r\n }\r\n return {\r\n // Only pick these two props. Not leak other properties like orderMeta.\r\n type: dim.type,\r\n property: dim.property\r\n };\r\n });\r\n\r\n this._initDataFromProvider(0, provider.count());\r\n }\r\n\r\n getProvider(): DataProvider {\r\n return this._provider;\r\n }\r\n\r\n /**\r\n * Caution: even when a `source` instance owned by a series, the created data store\r\n * may still be shared by different sereis (the source hash does not use all `source`\r\n * props, see `sourceManager`). In this case, the `source` props that are not used in\r\n * hash (like `source.dimensionDefine`) probably only belongs to a certain series and\r\n * thus should not be fetch here.\r\n */\r\n getSource(): Source {\r\n return this._provider.getSource();\r\n }\r\n\r\n /**\r\n * @caution Only used in dataStack.\r\n */\r\n ensureCalculationDimension(dimName: DimensionName, type: DataStoreDimensionType): DimensionIndex {\r\n const calcDimNameToIdx = this._calcDimNameToIdx;\r\n const dimensions = this._dimensions;\r\n\r\n let calcDimIdx = calcDimNameToIdx.get(dimName);\r\n if (calcDimIdx != null) {\r\n if (dimensions[calcDimIdx].type === type) {\r\n return calcDimIdx;\r\n }\r\n }\r\n else {\r\n calcDimIdx = dimensions.length;\r\n }\r\n\r\n dimensions[calcDimIdx] = { type: type };\r\n calcDimNameToIdx.set(dimName, calcDimIdx);\r\n\r\n this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount);\r\n this._rawExtent[calcDimIdx] = getInitialExtent();\r\n\r\n return calcDimIdx;\r\n }\r\n\r\n collectOrdinalMeta(\r\n dimIdx: number,\r\n ordinalMeta: OrdinalMeta\r\n ): void {\r\n const chunk = this._chunks[dimIdx];\r\n const dim = this._dimensions[dimIdx];\r\n const rawExtents = this._rawExtent;\r\n\r\n const offset = dim.ordinalOffset || 0;\r\n const len = chunk.length;\r\n\r\n if (offset === 0) {\r\n // We need to reset the rawExtent if collect is from start.\r\n // Because this dimension may be guessed as number and calcuating a wrong extent.\r\n rawExtents[dimIdx] = getInitialExtent();\r\n }\r\n\r\n const dimRawExtent = rawExtents[dimIdx];\r\n\r\n // Parse from previous data offset. len may be changed after appendData\r\n for (let i = offset; i < len; i++) {\r\n const val = (chunk as any)[i] = ordinalMeta.parseAndCollect(chunk[i]);\r\n if (!isNaN(val)) {\r\n dimRawExtent[0] = Math.min(val, dimRawExtent[0]);\r\n dimRawExtent[1] = Math.max(val, dimRawExtent[1]);\r\n }\r\n }\r\n\r\n dim.ordinalMeta = ordinalMeta;\r\n dim.ordinalOffset = len;\r\n dim.type = 'ordinal'; // Force to be ordinal\r\n }\r\n\r\n getOrdinalMeta(dimIdx: number): OrdinalMeta {\r\n const dimInfo = this._dimensions[dimIdx];\r\n const ordinalMeta = dimInfo.ordinalMeta;\r\n return ordinalMeta;\r\n }\r\n\r\n getDimensionProperty(dimIndex: DimensionIndex): DataStoreDimensionDefine['property'] {\r\n const item = this._dimensions[dimIndex];\r\n return item && item.property;\r\n }\r\n\r\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n */\r\n appendData(data: ArrayLike): number[] {\r\n if (__DEV__) {\r\n assert(!this._indices, 'appendData can only be called on raw data.');\r\n }\r\n\r\n const provider = this._provider;\r\n const start = this.count();\r\n provider.appendData(data);\r\n let end = provider.count();\r\n if (!provider.persistent) {\r\n end += start;\r\n }\r\n\r\n if (start < end) {\r\n this._initDataFromProvider(start, end, true);\r\n }\r\n\r\n return [start, end];\r\n }\r\n\r\n appendValues(values: any[][], minFillLen?: number): { start: number; end: number } {\r\n const chunks = this._chunks;\r\n const dimensions = this._dimensions;\r\n const dimLen = dimensions.length;\r\n const rawExtent = this._rawExtent;\r\n\r\n const start = this.count();\r\n const end = start + Math.max(values.length, minFillLen || 0);\r\n\r\n for (let i = 0; i < dimLen; i++) {\r\n const dim = dimensions[i];\r\n prepareStore(chunks, i, dim.type, end, true);\r\n }\r\n\r\n const emptyDataItem: number[] = [];\r\n for (let idx = start; idx < end; idx++) {\r\n const sourceIdx = idx - start;\r\n // Store the data by dimensions\r\n for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n const dim = dimensions[dimIdx];\r\n const val = defaultDimValueGetters.arrayRows.call(\r\n this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx\r\n ) as ParsedValueNumeric;\r\n (chunks[dimIdx] as any)[idx] = val;\r\n\r\n const dimRawExtent = rawExtent[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n }\r\n\r\n this._rawCount = this._count = end;\r\n\r\n return {start, end};\r\n }\r\n\r\n private _initDataFromProvider(\r\n start: number,\r\n end: number,\r\n append?: boolean\r\n ): void {\r\n const provider = this._provider;\r\n const chunks = this._chunks;\r\n const dimensions = this._dimensions;\r\n const dimLen = dimensions.length;\r\n const rawExtent = this._rawExtent;\r\n const dimNames = map(dimensions, dim => dim.property);\r\n\r\n for (let i = 0; i < dimLen; i++) {\r\n const dim = dimensions[i];\r\n if (!rawExtent[i]) {\r\n rawExtent[i] = getInitialExtent();\r\n }\r\n prepareStore(chunks, i, dim.type, end, append);\r\n }\r\n\r\n if (provider.fillStorage) {\r\n provider.fillStorage(start, end, chunks, rawExtent);\r\n }\r\n else {\r\n let dataItem = [] as OptionDataItem;\r\n for (let idx = start; idx < end; idx++) {\r\n // NOTICE: Try not to write things into dataItem\r\n dataItem = provider.getItem(idx, dataItem);\r\n // Each data item is value\r\n // [1, 2]\r\n // 2\r\n // Bar chart, line chart which uses category axis\r\n // only gives the 'y' value. 'x' value is the indices of category\r\n // Use a tempValue to normalize the value to be a (x, y) value\r\n\r\n // Store the data by dimensions\r\n for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {\r\n const dimStorage = chunks[dimIdx];\r\n // PENDING NULL is empty or zero\r\n const val = this._dimValueGetter(\r\n dataItem, dimNames[dimIdx], idx, dimIdx\r\n ) as ParsedValueNumeric;\r\n (dimStorage as ParsedValue[])[idx] = val;\r\n\r\n const dimRawExtent = rawExtent[dimIdx];\r\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\r\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\r\n }\r\n }\r\n }\r\n\r\n if (!provider.persistent && provider.clean) {\r\n // Clean unused data if data source is typed array.\r\n provider.clean();\r\n }\r\n\r\n this._rawCount = this._count = end;\r\n // Reset data extent\r\n this._extent = [];\r\n }\r\n\r\n count(): number {\r\n return this._count;\r\n }\r\n\r\n /**\r\n * Get value. Return NaN if idx is out of range.\r\n */\r\n get(dim: DimensionIndex, idx: number): ParsedValue {\r\n if (!(idx >= 0 && idx < this._count)) {\r\n return NaN;\r\n }\r\n const dimStore = this._chunks[dim];\r\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\r\n }\r\n\r\n getValues(idx: number): ParsedValue[];\r\n getValues(dimensions: readonly DimensionIndex[], idx?: number): ParsedValue[];\r\n getValues(dimensions: readonly DimensionIndex[] | number, idx?: number): ParsedValue[] {\r\n const values = [];\r\n let dimArr: DimensionIndex[] = [];\r\n if (idx == null) {\r\n idx = dimensions as number;\r\n // TODO get all from store?\r\n dimensions = [];\r\n // All dimensions\r\n for (let i = 0; i < this._dimensions.length; i++) {\r\n dimArr.push(i);\r\n }\r\n }\r\n else {\r\n dimArr = dimensions as DimensionIndex[];\r\n }\r\n\r\n for (let i = 0, len = dimArr.length; i < len; i++) {\r\n values.push(this.get(dimArr[i], idx));\r\n }\r\n\r\n return values;\r\n }\r\n\r\n /**\r\n * @param dim concrete dim\r\n */\r\n getByRawIndex(dim: DimensionIndex, rawIdx: number): ParsedValue {\r\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\r\n return NaN;\r\n }\r\n const dimStore = this._chunks[dim];\r\n return dimStore ? dimStore[rawIdx] : NaN;\r\n }\r\n\r\n /**\r\n * Get sum of data in one dimension\r\n */\r\n getSum(dim: DimensionIndex): number {\r\n const dimData = this._chunks[dim];\r\n let sum = 0;\r\n if (dimData) {\r\n for (let i = 0, len = this.count(); i < len; i++) {\r\n const value = this.get(dim, i) as number;\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n }\r\n return sum;\r\n }\r\n\r\n /**\r\n * Get median of data in one dimension\r\n */\r\n getMedian(dim: DimensionIndex): number {\r\n const dimDataArray: ParsedValue[] = [];\r\n // map all data of one dimension\r\n this.each([dim], function (val) {\r\n if (!isNaN(val as number)) {\r\n dimDataArray.push(val);\r\n }\r\n });\r\n\r\n // TODO\r\n // Use quick select?\r\n const sortedDimDataArray = dimDataArray.sort(function (a: number, b: number) {\r\n return a - b;\r\n }) as number[];\r\n const len = this.count();\r\n // calculate median\r\n return len === 0\r\n ? 0\r\n : len % 2 === 1\r\n ? sortedDimDataArray[(len - 1) / 2]\r\n : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\r\n }\r\n\r\n /**\r\n * Retrieve the index with given raw data index.\r\n */\r\n indexOfRawIndex(rawIndex: number): number {\r\n if (rawIndex >= this._rawCount || rawIndex < 0) {\r\n return -1;\r\n }\r\n\r\n if (!this._indices) {\r\n return rawIndex;\r\n }\r\n\r\n // Indices are ascending\r\n const indices = this._indices;\r\n\r\n // If rawIndex === dataIndex\r\n const rawDataIndex = indices[rawIndex];\r\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\r\n return rawIndex;\r\n }\r\n\r\n let left = 0;\r\n let right = this._count - 1;\r\n while (left <= right) {\r\n const mid = (left + right) / 2 | 0;\r\n if (indices[mid] < rawIndex) {\r\n left = mid + 1;\r\n }\r\n else if (indices[mid] > rawIndex) {\r\n right = mid - 1;\r\n }\r\n else {\r\n return mid;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n\r\n /**\r\n * Retrieve the index of nearest value.\r\n * @param dim\r\n * @param value\r\n * @param [maxDistance=Infinity]\r\n * @return If and only if multiple indices have\r\n * the same value, they are put to the result.\r\n */\r\n indicesOfNearest(\r\n dim: DimensionIndex, value: number, maxDistance?: number\r\n ): number[] {\r\n const chunks = this._chunks;\r\n const dimData = chunks[dim];\r\n const nearestIndices: number[] = [];\r\n\r\n if (!dimData) {\r\n return nearestIndices;\r\n }\r\n\r\n if (maxDistance == null) {\r\n maxDistance = Infinity;\r\n }\r\n\r\n let minDist = Infinity;\r\n let minDiff = -1;\r\n let nearestIndicesLen = 0;\r\n\r\n // Check the test case of `test/ut/spec/data/SeriesData.js`.\r\n for (let i = 0, len = this.count(); i < len; i++) {\r\n const dataIndex = this.getRawIndex(i);\r\n const diff = value - (dimData[dataIndex] as number);\r\n const dist = Math.abs(diff);\r\n if (dist <= maxDistance) {\r\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\r\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\r\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\r\n // So we choose the one that `diff >= 0` in this case.\r\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\r\n // should be push to `nearestIndices`.\r\n if (dist < minDist\r\n || (dist === minDist && diff >= 0 && minDiff < 0)\r\n ) {\r\n minDist = dist;\r\n minDiff = diff;\r\n nearestIndicesLen = 0;\r\n }\r\n if (diff === minDiff) {\r\n nearestIndices[nearestIndicesLen++] = i;\r\n }\r\n }\r\n }\r\n nearestIndices.length = nearestIndicesLen;\r\n\r\n return nearestIndices;\r\n }\r\n\r\n getIndices(): ArrayLike {\r\n let newIndices;\r\n\r\n const indices = this._indices;\r\n if (indices) {\r\n const Ctor = indices.constructor as DataArrayLikeConstructor;\r\n const thisCount = this._count;\r\n // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\r\n if (Ctor === Array) {\r\n newIndices = new Ctor(thisCount);\r\n for (let i = 0; i < thisCount; i++) {\r\n newIndices[i] = indices[i];\r\n }\r\n }\r\n else {\r\n newIndices = new (Ctor as DataTypedArrayConstructor)(\r\n (indices as DataTypedArray).buffer, 0, thisCount\r\n );\r\n }\r\n }\r\n else {\r\n const Ctor = getIndicesCtor(this._rawCount);\r\n newIndices = new Ctor(this.count());\r\n for (let i = 0; i < newIndices.length; i++) {\r\n newIndices[i] = i;\r\n }\r\n }\r\n\r\n return newIndices;\r\n }\r\n\r\n /**\r\n * Data filter.\r\n */\r\n filter(\r\n dims: DimensionIndex[],\r\n cb: FilterCb\r\n ): DataStore {\r\n if (!this._count) {\r\n return this;\r\n }\r\n\r\n const newStore = this.clone();\r\n\r\n const count = newStore.count();\r\n const Ctor = getIndicesCtor(newStore._rawCount);\r\n const newIndices = new Ctor(count);\r\n const value = [];\r\n const dimSize = dims.length;\r\n\r\n let offset = 0;\r\n const dim0 = dims[0];\r\n const chunks = newStore._chunks;\r\n\r\n for (let i = 0; i < count; i++) {\r\n let keep;\r\n const rawIdx = newStore.getRawIndex(i);\r\n // Simple optimization\r\n if (dimSize === 0) {\r\n keep = (cb as FilterCb0)(i);\r\n }\r\n else if (dimSize === 1) {\r\n const val = chunks[dim0][rawIdx];\r\n keep = (cb as FilterCb1)(val, i);\r\n }\r\n else {\r\n let k = 0;\r\n for (; k < dimSize; k++) {\r\n value[k] = chunks[dims[k]][rawIdx];\r\n }\r\n value[k] = i;\r\n keep = (cb as FilterCb).apply(null, value);\r\n }\r\n if (keep) {\r\n newIndices[offset++] = rawIdx;\r\n }\r\n }\r\n\r\n // Set indices after filtered.\r\n if (offset < count) {\r\n newStore._indices = newIndices;\r\n }\r\n newStore._count = offset;\r\n // Reset data extent\r\n newStore._extent = [];\r\n\r\n newStore._updateGetRawIdx();\r\n\r\n return newStore;\r\n }\r\n\r\n /**\r\n * Select data in range. (For optimization of filter)\r\n * (Manually inline code, support 5 million data filtering in data zoom.)\r\n */\r\n selectRange(range: {[dimIdx: number]: [number, number]}): DataStore {\r\n const newStore = this.clone();\r\n\r\n const len = newStore._count;\r\n\r\n if (!len) {\r\n return this;\r\n }\r\n\r\n const dims = keys(range);\r\n const dimSize = dims.length;\r\n if (!dimSize) {\r\n return this;\r\n }\r\n\r\n const originalCount = newStore.count();\r\n const Ctor = getIndicesCtor(newStore._rawCount);\r\n const newIndices = new Ctor(originalCount);\r\n\r\n let offset = 0;\r\n const dim0 = dims[0];\r\n\r\n const min = range[dim0][0];\r\n const max = range[dim0][1];\r\n const storeArr = newStore._chunks;\r\n\r\n let quickFinished = false;\r\n if (!newStore._indices) {\r\n // Extreme optimization for common case. About 2x faster in chrome.\r\n let idx = 0;\r\n if (dimSize === 1) {\r\n const dimStorage = storeArr[dims[0]];\r\n for (let i = 0; i < len; i++) {\r\n const val = dimStorage[i];\r\n // NaN will not be filtered. Consider the case, in line chart, empty\r\n // value indicates the line should be broken. But for the case like\r\n // scatter plot, a data item with empty value will not be rendered,\r\n // but the axis extent may be effected if some other dim of the data\r\n // item has value. Fortunately it is not a significant negative effect.\r\n if (\r\n (val >= min && val <= max) || isNaN(val as any)\r\n ) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n else if (dimSize === 2) {\r\n const dimStorage = storeArr[dims[0]];\r\n const dimStorage2 = storeArr[dims[1]];\r\n const min2 = range[dims[1]][0];\r\n const max2 = range[dims[1]][1];\r\n for (let i = 0; i < len; i++) {\r\n const val = dimStorage[i];\r\n const val2 = dimStorage2[i];\r\n // Do not filter NaN, see comment above.\r\n if ((\r\n (val >= min && val <= max) || isNaN(val as any)\r\n )\r\n && (\r\n (val2 >= min2 && val2 <= max2) || isNaN(val2 as any)\r\n )\r\n ) {\r\n newIndices[offset++] = idx;\r\n }\r\n idx++;\r\n }\r\n quickFinished = true;\r\n }\r\n }\r\n if (!quickFinished) {\r\n if (dimSize === 1) {\r\n for (let i = 0; i < originalCount; i++) {\r\n const rawIndex = newStore.getRawIndex(i);\r\n const val = storeArr[dims[0]][rawIndex];\r\n // Do not filter NaN, see comment above.\r\n if (\r\n (val >= min && val <= max) || isNaN(val as any)\r\n ) {\r\n newIndices[offset++] = rawIndex;\r\n }\r\n }\r\n }\r\n else {\r\n for (let i = 0; i < originalCount; i++) {\r\n let keep = true;\r\n const rawIndex = newStore.getRawIndex(i);\r\n for (let k = 0; k < dimSize; k++) {\r\n const dimk = dims[k];\r\n const val = storeArr[dimk][rawIndex];\r\n // Do not filter NaN, see comment above.\r\n if (val < range[dimk][0] || val > range[dimk][1]) {\r\n keep = false;\r\n }\r\n }\r\n if (keep) {\r\n newIndices[offset++] = newStore.getRawIndex(i);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Set indices after filtered.\r\n if (offset < originalCount) {\r\n newStore._indices = newIndices;\r\n }\r\n newStore._count = offset;\r\n // Reset data extent\r\n newStore._extent = [];\r\n\r\n newStore._updateGetRawIdx();\r\n\r\n return newStore;\r\n }\r\n\r\n // /**\r\n // * Data mapping to a plain array\r\n // */\r\n // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {\r\n // const result: any[] = [];\r\n // this.each(dims, function () {\r\n // result.push(cb && (cb as MapArrayCb).apply(null, arguments));\r\n // });\r\n // return result;\r\n // }\r\n\r\n /**\r\n * Data mapping to a new List with given dimensions\r\n */\r\n map(dims: DimensionIndex[], cb: MapCb): DataStore {\r\n // TODO only clone picked chunks.\r\n const target = this.clone(dims);\r\n this._updateDims(target, dims, cb);\r\n return target;\r\n }\r\n\r\n /**\r\n * @caution Danger!! Only used in dataStack.\r\n */\r\n modify(dims: DimensionIndex[], cb: MapCb) {\r\n this._updateDims(this, dims, cb);\r\n }\r\n\r\n private _updateDims(\r\n target: DataStore,\r\n dims: DimensionIndex[],\r\n cb: MapCb\r\n ) {\r\n const targetChunks = target._chunks;\r\n\r\n const tmpRetValue = [];\r\n const dimSize = dims.length;\r\n const dataCount = target.count();\r\n const values = [];\r\n const rawExtent = target._rawExtent;\r\n\r\n for (let i = 0; i < dims.length; i++) {\r\n rawExtent[dims[i]] = getInitialExtent();\r\n }\r\n\r\n for (let dataIndex = 0; dataIndex < dataCount; dataIndex++) {\r\n const rawIndex = target.getRawIndex(dataIndex);\r\n\r\n for (let k = 0; k < dimSize; k++) {\r\n values[k] = targetChunks[dims[k]][rawIndex];\r\n }\r\n values[dimSize] = dataIndex;\r\n\r\n let retValue = cb && cb.apply(null, values);\r\n if (retValue != null) {\r\n // a number or string (in oridinal dimension)?\r\n if (typeof retValue !== 'object') {\r\n tmpRetValue[0] = retValue;\r\n retValue = tmpRetValue;\r\n }\r\n\r\n for (let i = 0; i < retValue.length; i++) {\r\n const dim = dims[i];\r\n const val = retValue[i];\r\n const rawExtentOnDim = rawExtent[dim];\r\n\r\n const dimStore = targetChunks[dim];\r\n if (dimStore) {\r\n (dimStore as ParsedValue[])[rawIndex] = val;\r\n }\r\n\r\n if (val < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = val as number;\r\n }\r\n if (val > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = val as number;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Large data down sampling using largest-triangle-three-buckets\r\n * @param {string} valueDimension\r\n * @param {number} targetCount\r\n */\r\n lttbDownSample(\r\n valueDimension: DimensionIndex,\r\n rate: number\r\n ): DataStore {\r\n const target = this.clone([valueDimension], true);\r\n const targetStorage = target._chunks;\r\n const dimStore = targetStorage[valueDimension];\r\n const len = this.count();\r\n\r\n let sampledIndex = 0;\r\n\r\n const frameSize = Math.floor(1 / rate);\r\n\r\n let currentRawIndex = this.getRawIndex(0);\r\n let maxArea;\r\n let area;\r\n let nextRawIndex;\r\n\r\n const newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len));\r\n\r\n // First frame use the first data.\r\n newIndices[sampledIndex++] = currentRawIndex;\r\n for (let i = 1; i < len - 1; i += frameSize) {\r\n const nextFrameStart = Math.min(i + frameSize, len - 1);\r\n const nextFrameEnd = Math.min(i + frameSize * 2, len);\r\n\r\n const avgX = (nextFrameEnd + nextFrameStart) / 2;\r\n let avgY = 0;\r\n\r\n for (let idx = nextFrameStart; idx < nextFrameEnd; idx++) {\r\n const rawIndex = this.getRawIndex(idx);\r\n const y = dimStore[rawIndex] as number;\r\n if (isNaN(y)) {\r\n continue;\r\n }\r\n avgY += y as number;\r\n }\r\n avgY /= (nextFrameEnd - nextFrameStart);\r\n\r\n const frameStart = i;\r\n const frameEnd = Math.min(i + frameSize, len);\r\n\r\n const pointAX = i - 1;\r\n const pointAY = dimStore[currentRawIndex] as number;\r\n\r\n maxArea = -1;\r\n\r\n nextRawIndex = frameStart;\r\n\r\n let firstNaNIndex = -1;\r\n let countNaN = 0;\r\n // Find a point from current frame that construct a triangle with largest area with previous selected point\r\n // And the average of next frame.\r\n for (let idx = frameStart; idx < frameEnd; idx++) {\r\n const rawIndex = this.getRawIndex(idx);\r\n const y = dimStore[rawIndex] as number;\r\n if (isNaN(y)) {\r\n countNaN++;\r\n if (firstNaNIndex < 0) {\r\n firstNaNIndex = rawIndex;\r\n }\r\n continue;\r\n }\r\n // Calculate triangle area over three buckets\r\n area = Math.abs((pointAX - avgX) * (y - pointAY)\r\n - (pointAX - idx) * (avgY - pointAY)\r\n );\r\n if (area > maxArea) {\r\n maxArea = area;\r\n nextRawIndex = rawIndex; // Next a is this b\r\n }\r\n }\r\n\r\n if (countNaN > 0 && countNaN < frameEnd - frameStart) {\r\n // Append first NaN point in every bucket.\r\n // It is necessary to ensure the correct order of indices.\r\n newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex);\r\n nextRawIndex = Math.max(firstNaNIndex, nextRawIndex);\r\n }\r\n\r\n newIndices[sampledIndex++] = nextRawIndex;\r\n\r\n currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\r\n }\r\n\r\n // First frame use the last data.\r\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\r\n target._count = sampledIndex;\r\n target._indices = newIndices;\r\n\r\n target.getRawIndex = this._getRawIdx;\r\n return target;\r\n }\r\n\r\n\r\n /**\r\n * Large data down sampling on given dimension\r\n * @param sampleIndex Sample index for name and id\r\n */\r\n downSample(\r\n dimension: DimensionIndex,\r\n rate: number,\r\n sampleValue: (frameValues: ArrayLike) => ParsedValueNumeric,\r\n sampleIndex: (frameValues: ArrayLike, value: ParsedValueNumeric) => number\r\n ): DataStore {\r\n const target = this.clone([dimension], true);\r\n const targetStorage = target._chunks;\r\n\r\n const frameValues = [];\r\n let frameSize = Math.floor(1 / rate);\r\n\r\n const dimStore = targetStorage[dimension];\r\n const len = this.count();\r\n const rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent();\r\n\r\n const newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize));\r\n\r\n let offset = 0;\r\n for (let i = 0; i < len; i += frameSize) {\r\n // Last frame\r\n if (frameSize > len - i) {\r\n frameSize = len - i;\r\n frameValues.length = frameSize;\r\n }\r\n for (let k = 0; k < frameSize; k++) {\r\n const dataIdx = this.getRawIndex(i + k);\r\n frameValues[k] = dimStore[dataIdx];\r\n }\r\n const value = sampleValue(frameValues);\r\n const sampleFrameIdx = this.getRawIndex(\r\n Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)\r\n );\r\n // Only write value on the filtered data\r\n (dimStore as number[])[sampleFrameIdx] = value;\r\n\r\n if (value < rawExtentOnDim[0]) {\r\n rawExtentOnDim[0] = value;\r\n }\r\n if (value > rawExtentOnDim[1]) {\r\n rawExtentOnDim[1] = value;\r\n }\r\n\r\n newIndices[offset++] = sampleFrameIdx;\r\n }\r\n\r\n target._count = offset;\r\n target._indices = newIndices;\r\n\r\n target._updateGetRawIdx();\r\n\r\n return target;\r\n }\r\n\r\n /**\r\n * Data iteration\r\n * @param ctx default this\r\n * @example\r\n * list.each('x', function (x, idx) {});\r\n * list.each(['x', 'y'], function (x, y, idx) {});\r\n * list.each(function (idx) {})\r\n */\r\n each(dims: DimensionIndex[], cb: EachCb): void {\r\n if (!this._count) {\r\n return;\r\n }\r\n const dimSize = dims.length;\r\n const chunks = this._chunks;\r\n\r\n for (let i = 0, len = this.count(); i < len; i++) {\r\n const rawIdx = this.getRawIndex(i);\r\n // Simple optimization\r\n switch (dimSize) {\r\n case 0:\r\n (cb as EachCb0)(i);\r\n break;\r\n case 1:\r\n (cb as EachCb1)(chunks[dims[0]][rawIdx], i);\r\n break;\r\n case 2:\r\n (cb as EachCb2)(\r\n chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i\r\n );\r\n break;\r\n default:\r\n let k = 0;\r\n const value = [];\r\n for (; k < dimSize; k++) {\r\n value[k] = chunks[dims[k]][rawIdx];\r\n }\r\n // Index\r\n value[k] = i;\r\n (cb as EachCb).apply(null, value);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Get extent of data in one dimension\r\n */\r\n getDataExtent(dim: DimensionIndex): [number, number] {\r\n // Make sure use concrete dim as cache name.\r\n const dimData = this._chunks[dim];\r\n const initialExtent = getInitialExtent();\r\n\r\n if (!dimData) {\r\n return initialExtent;\r\n }\r\n\r\n // Make more strict checkings to ensure hitting cache.\r\n const currEnd = this.count();\r\n\r\n // Consider the most cases when using data zoom, `getDataExtent`\r\n // happened before filtering. We cache raw extent, which is not\r\n // necessary to be cleared and recalculated when restore data.\r\n const useRaw = !this._indices;\r\n let dimExtent: [number, number];\r\n\r\n if (useRaw) {\r\n return this._rawExtent[dim].slice() as [number, number];\r\n }\r\n dimExtent = this._extent[dim];\r\n if (dimExtent) {\r\n return dimExtent.slice() as [number, number];\r\n }\r\n dimExtent = initialExtent;\r\n\r\n let min = dimExtent[0];\r\n let max = dimExtent[1];\r\n\r\n for (let i = 0; i < currEnd; i++) {\r\n const rawIdx = this.getRawIndex(i);\r\n const value = dimData[rawIdx] as ParsedValueNumeric;\r\n value < min && (min = value);\r\n value > max && (max = value);\r\n }\r\n\r\n dimExtent = [min, max];\r\n\r\n this._extent[dim] = dimExtent;\r\n\r\n return dimExtent;\r\n }\r\n\r\n /**\r\n * Get raw data index.\r\n * Do not initialize.\r\n * Default `getRawIndex`. And it can be changed.\r\n */\r\n getRawIndex: (idx: number) => number;\r\n\r\n /**\r\n * Get raw data item\r\n */\r\n getRawDataItem(idx: number): OptionDataItem {\r\n const rawIdx = this.getRawIndex(idx);\r\n if (!this._provider.persistent) {\r\n const val = [];\r\n const chunks = this._chunks;\r\n for (let i = 0; i < chunks.length; i++) {\r\n val.push(chunks[i][rawIdx]);\r\n }\r\n return val;\r\n }\r\n else {\r\n return this._provider.getItem(rawIdx);\r\n }\r\n }\r\n\r\n /**\r\n * Clone shallow.\r\n *\r\n * @param clonedDims Determine which dims to clone. Will share the data if not specified.\r\n */\r\n clone(clonedDims?: DimensionIndex[], ignoreIndices?: boolean): DataStore {\r\n const target = new DataStore();\r\n const chunks = this._chunks;\r\n const clonedDimsMap = clonedDims && reduce(clonedDims, (obj, dimIdx) => {\r\n obj[dimIdx] = true;\r\n return obj;\r\n }, {} as Record);\r\n\r\n if (clonedDimsMap) {\r\n for (let i = 0; i < chunks.length; i++) {\r\n // Not clone if dim is not picked.\r\n target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]);\r\n }\r\n }\r\n else {\r\n target._chunks = chunks;\r\n }\r\n this._copyCommonProps(target);\r\n\r\n if (!ignoreIndices) {\r\n target._indices = this._cloneIndices();\r\n }\r\n target._updateGetRawIdx();\r\n return target;\r\n }\r\n\r\n private _copyCommonProps(target: DataStore): void {\r\n target._count = this._count;\r\n target._rawCount = this._rawCount;\r\n target._provider = this._provider;\r\n target._dimensions = this._dimensions;\r\n\r\n target._extent = clone(this._extent);\r\n target._rawExtent = clone(this._rawExtent);\r\n }\r\n\r\n private _cloneIndices(): DataStore['_indices'] {\r\n if (this._indices) {\r\n const Ctor = this._indices.constructor as DataArrayLikeConstructor;\r\n let indices;\r\n if (Ctor === Array) {\r\n const thisCount = this._indices.length;\r\n indices = new Ctor(thisCount);\r\n for (let i = 0; i < thisCount; i++) {\r\n indices[i] = this._indices[i];\r\n }\r\n }\r\n else {\r\n indices = new (Ctor as DataTypedArrayConstructor)(this._indices);\r\n }\r\n return indices;\r\n }\r\n return null;\r\n }\r\n\r\n private _getRawIdxIdentity(idx: number): number {\r\n return idx;\r\n }\r\n private _getRawIdx(idx: number): number {\r\n if (idx < this._count && idx >= 0) {\r\n return this._indices[idx];\r\n }\r\n return -1;\r\n }\r\n\r\n private _updateGetRawIdx(): void {\r\n this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;\r\n }\r\n\r\n private static internalField = (function () {\r\n\r\n function getDimValueSimply(\r\n this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: number\r\n ): ParsedValue {\r\n return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]);\r\n }\r\n\r\n defaultDimValueGetters = {\r\n\r\n arrayRows: getDimValueSimply,\r\n\r\n objectRows(\r\n this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: number\r\n ): ParsedValue {\r\n return parseDataValue(dataItem[property], this._dimensions[dimIndex]);\r\n },\r\n\r\n keyedColumns: getDimValueSimply,\r\n\r\n original(\r\n this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: number\r\n ): ParsedValue {\r\n // Performance sensitive, do not use modelUtil.getDataItemValue.\r\n // If dataItem is an plain object with no value field, the let `value`\r\n // will be assigned with the object, but it will be tread correctly\r\n // in the `convertValue`.\r\n const value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\r\n\r\n return parseDataValue(\r\n (value instanceof Array)\r\n ? value[dimIndex]\r\n // If value is a single number or something else not array.\r\n : value,\r\n this._dimensions[dimIndex]\r\n );\r\n },\r\n\r\n typedArray: function (\r\n this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: number\r\n ): ParsedValue {\r\n return dataItem[dimIndex];\r\n }\r\n\r\n };\r\n\r\n })();\r\n}\r\n\r\nexport default DataStore;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { DatasetModel } from '../../component/dataset/install';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n setAsPrimitive, map, isTypedArray, assert, each, retrieve2\r\n} from 'zrender/src/core/util';\r\nimport { SourceMetaRawOption, Source, createSource, cloneSourceShallow } from '../Source';\r\nimport {\r\n SeriesEncodableModel, OptionSourceData,\r\n SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL,\r\n SourceFormat, SeriesLayoutBy, OptionSourceHeader,\r\n DimensionDefinitionLoose, Dictionary\r\n} from '../../util/types';\r\nimport {\r\n querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels\r\n} from './sourceHelper';\r\nimport { applyDataTransform } from './transform';\r\nimport DataStore, { DataStoreDimensionDefine } from '../DataStore';\r\nimport { DefaultDataProvider } from './dataProvider';\r\nimport { SeriesDataSchema } from './SeriesDataSchema';\r\n\r\ntype DataStoreMap = Dictionary;\r\n\r\n/**\r\n * [REQUIREMENT_MEMO]:\r\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\r\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\r\n * `root-dataset`. Them on `series` has higher priority.\r\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\r\n * confuse users: whether those props indicate how to visit the upstream source or visit\r\n * the transform result source, and some transforms has nothing to do with these props,\r\n * and some transforms might have multiple upstream.\r\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\r\n * declared in `root-dataset`.\r\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\r\n * That is for reducing complexity in transforms.\r\n * PENDING: Whether to provide transposition transform?\r\n *\r\n * [IMPLEMENTAION_MEMO]:\r\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\r\n * They will not be calculated until `source` is about to be visited (to prevent from\r\n * duplicate calcuation). `source` is visited only in series and input to transforms.\r\n *\r\n * [DIMENSION_INHERIT_RULE]:\r\n * By default the dimensions are inherited from ancestors, unless a transform return\r\n * a new dimensions definition.\r\n * Consider the case:\r\n * ```js\r\n * dataset: [{\r\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * dataset: [{\r\n * dimension: ['Product', 'Sales', 'Prise'],\r\n * source: [ ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * ```\r\n * The two types of option should have the same behavior after transform.\r\n *\r\n *\r\n * [SCENARIO]:\r\n * (1) Provide source data directly:\r\n * ```js\r\n * series: {\r\n * encode: {...},\r\n * dimensions: [...]\r\n * seriesLayoutBy: 'row',\r\n * data: [[...]]\r\n * }\r\n * ```\r\n * (2) Series refer to dataset.\r\n * ```js\r\n * series: [{\r\n * encode: {...}\r\n * // Ignore datasetIndex means `datasetIndex: 0`\r\n * // and the dimensions defination in dataset is used\r\n * }, {\r\n * encode: {...},\r\n * seriesLayoutBy: 'column',\r\n * datasetIndex: 1\r\n * }]\r\n * ```\r\n * (3) dataset transform\r\n * ```js\r\n * dataset: [{\r\n * source: [...]\r\n * }, {\r\n * source: [...]\r\n * }, {\r\n * // By default from 0.\r\n * transform: { type: 'filter', config: {...} }\r\n * }, {\r\n * // Piped.\r\n * transform: [\r\n * { type: 'filter', config: {...} },\r\n * { type: 'sort', config: {...} }\r\n * ]\r\n * }, {\r\n * id: 'regressionData',\r\n * fromDatasetIndex: 1,\r\n * // Third-party transform\r\n * transform: { type: 'ecStat:regression', config: {...} }\r\n * }, {\r\n * // retrieve the extra result.\r\n * id: 'regressionFormula',\r\n * fromDatasetId: 'regressionData',\r\n * fromTransformResult: 1\r\n * }]\r\n * ```\r\n */\r\n\r\nexport class SourceManager {\r\n\r\n // Currently only datasetModel can host `transform`\r\n private _sourceHost: DatasetModel | SeriesModel;\r\n\r\n // Cached source. Do not repeat calculating if not dirty.\r\n private _sourceList: Source[] = [];\r\n\r\n private _storeList: DataStoreMap[] = [];\r\n\r\n // version sign of each upstream source manager.\r\n private _upstreamSignList: string[] = [];\r\n\r\n private _versionSignBase = 0;\r\n\r\n private _dirty = true;\r\n\r\n constructor(sourceHost: DatasetModel | SeriesModel) {\r\n this._sourceHost = sourceHost;\r\n }\r\n\r\n /**\r\n * Mark dirty.\r\n */\r\n dirty() {\r\n this._setLocalSource([], []);\r\n this._storeList = [];\r\n this._dirty = true;\r\n }\r\n\r\n private _setLocalSource(\r\n sourceList: Source[],\r\n upstreamSignList: string[]\r\n ): void {\r\n this._sourceList = sourceList;\r\n this._upstreamSignList = upstreamSignList;\r\n this._versionSignBase++;\r\n if (this._versionSignBase > 9e10) {\r\n this._versionSignBase = 0;\r\n }\r\n }\r\n\r\n /**\r\n * For detecting whether the upstream source is dirty, so that\r\n * the local cached source (in `_sourceList`) should be discarded.\r\n */\r\n private _getVersionSign(): string {\r\n return this._sourceHost.uid + '_' + this._versionSignBase;\r\n }\r\n\r\n /**\r\n * Always return a source instance. Otherwise throw error.\r\n */\r\n prepareSource(): void {\r\n // For the case that call `setOption` multiple time but no data changed,\r\n // cache the result source to prevent from repeating transform.\r\n if (this._isDirty()) {\r\n this._createSource();\r\n this._dirty = false;\r\n }\r\n }\r\n\r\n private _createSource(): void {\r\n this._setLocalSource([], []);\r\n\r\n const sourceHost = this._sourceHost;\r\n\r\n const upSourceMgrList = this._getUpstreamSourceManagers();\r\n const hasUpstream = !!upSourceMgrList.length;\r\n let resultSourceList: Source[];\r\n let upstreamSignList: string[];\r\n\r\n if (isSeries(sourceHost)) {\r\n const seriesModel = sourceHost as SeriesEncodableModel;\r\n let data;\r\n let sourceFormat: SourceFormat;\r\n let upSource: Source;\r\n\r\n // Has upstream dataset\r\n if (hasUpstream) {\r\n const upSourceMgr = upSourceMgrList[0];\r\n upSourceMgr.prepareSource();\r\n upSource = upSourceMgr.getSource();\r\n data = upSource.data;\r\n sourceFormat = upSource.sourceFormat;\r\n upstreamSignList = [upSourceMgr._getVersionSign()];\r\n }\r\n // Series data is from own.\r\n else {\r\n data = seriesModel.get('data', true) as OptionSourceData;\r\n sourceFormat = isTypedArray(data)\r\n ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\r\n upstreamSignList = [];\r\n }\r\n\r\n // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\r\n const newMetaRawOption = this._getSourceMetaRawOption() || {} as SourceMetaRawOption;\r\n const upMetaRawOption = upSource && upSource.metaRawOption || {} as SourceMetaRawOption;\r\n const seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;\r\n const sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader);\r\n // Note here we should not use `upSource.dimensionsDefine`. Consider the case:\r\n // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`,\r\n // but series need `seriesLayoutBy: 'row'`.\r\n const dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions);\r\n\r\n // We share source with dataset as much as possible\r\n // to avoid extra memory cost of high dimensional data.\r\n const needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy\r\n || !!sourceHeader !== !!upMetaRawOption.sourceHeader\r\n || dimensions;\r\n resultSourceList = needsCreateSource ? [createSource(\r\n data,\r\n { seriesLayoutBy, sourceHeader, dimensions },\r\n sourceFormat\r\n )] : [];\r\n }\r\n else {\r\n const datasetModel = sourceHost as DatasetModel;\r\n\r\n // Has upstream dataset.\r\n if (hasUpstream) {\r\n const result = this._applyTransform(upSourceMgrList);\r\n resultSourceList = result.sourceList;\r\n upstreamSignList = result.upstreamSignList;\r\n }\r\n // Is root dataset.\r\n else {\r\n const sourceData = datasetModel.get('source', true);\r\n resultSourceList = [createSource(\r\n sourceData,\r\n this._getSourceMetaRawOption(),\r\n null\r\n )];\r\n upstreamSignList = [];\r\n }\r\n }\r\n\r\n if (__DEV__) {\r\n assert(resultSourceList && upstreamSignList);\r\n }\r\n\r\n this._setLocalSource(resultSourceList, upstreamSignList);\r\n }\r\n\r\n private _applyTransform(\r\n upMgrList: SourceManager[]\r\n ): {\r\n sourceList: Source[],\r\n upstreamSignList: string[]\r\n } {\r\n const datasetModel = this._sourceHost as DatasetModel;\r\n const transformOption = datasetModel.get('transform', true);\r\n const fromTransformResult = datasetModel.get('fromTransformResult', true);\r\n\r\n if (__DEV__) {\r\n assert(fromTransformResult != null || transformOption != null);\r\n }\r\n\r\n if (fromTransformResult != null) {\r\n let errMsg = '';\r\n if (upMgrList.length !== 1) {\r\n if (__DEV__) {\r\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\r\n }\r\n doThrow(errMsg);\r\n }\r\n }\r\n\r\n let sourceList: Source[];\r\n const upSourceList: Source[] = [];\r\n const upstreamSignList: string[] = [];\r\n each(upMgrList, upMgr => {\r\n upMgr.prepareSource();\r\n const upSource = upMgr.getSource(fromTransformResult || 0);\r\n let errMsg = '';\r\n if (fromTransformResult != null && !upSource) {\r\n if (__DEV__) {\r\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\r\n }\r\n doThrow(errMsg);\r\n }\r\n upSourceList.push(upSource);\r\n upstreamSignList.push(upMgr._getVersionSign());\r\n });\r\n\r\n if (transformOption) {\r\n sourceList = applyDataTransform(\r\n transformOption,\r\n upSourceList,\r\n { datasetIndex: datasetModel.componentIndex }\r\n );\r\n }\r\n else if (fromTransformResult != null) {\r\n sourceList = [cloneSourceShallow(upSourceList[0])];\r\n }\r\n\r\n return { sourceList, upstreamSignList };\r\n }\r\n\r\n private _isDirty(): boolean {\r\n if (this._dirty) {\r\n return true;\r\n }\r\n\r\n // All sourceList is from the some upstream.\r\n const upSourceMgrList = this._getUpstreamSourceManagers();\r\n for (let i = 0; i < upSourceMgrList.length; i++) {\r\n const upSrcMgr = upSourceMgrList[i];\r\n if (\r\n // Consider the case that there is ancestor diry, call it recursively.\r\n // The performance is probably not an issue because usually the chain is not long.\r\n upSrcMgr._isDirty()\r\n || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()\r\n ) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @param sourceIndex By default 0, means \"main source\".\r\n * In most cases there is only one source.\r\n */\r\n getSource(sourceIndex?: number): Source {\r\n sourceIndex = sourceIndex || 0;\r\n const source = this._sourceList[sourceIndex];\r\n if (!source) {\r\n // Series may share source instance with dataset.\r\n const upSourceMgrList = this._getUpstreamSourceManagers();\r\n return upSourceMgrList[0]\r\n && upSourceMgrList[0].getSource(sourceIndex);\r\n }\r\n return source;\r\n }\r\n\r\n /**\r\n *\r\n * Get a data store which can be shared across series.\r\n * Only available for series.\r\n *\r\n * @param seriesDimRequest Dimensions that are generated in series.\r\n * Should have been sorted by `storeDimIndex` asc.\r\n */\r\n getSharedDataStore(seriesDimRequest: SeriesDataSchema): DataStore {\r\n if (__DEV__) {\r\n assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.');\r\n }\r\n const schema = seriesDimRequest.makeStoreSchema();\r\n return this._innerGetDataStore(\r\n schema.dimensions, seriesDimRequest.source, schema.hash\r\n );\r\n }\r\n\r\n private _innerGetDataStore(\r\n storeDims: DataStoreDimensionDefine[],\r\n seriesSource: Source,\r\n sourceReadKey: string\r\n ): DataStore | undefined {\r\n // TODO Can use other sourceIndex?\r\n const sourceIndex = 0;\r\n\r\n const storeList = this._storeList;\r\n\r\n let cachedStoreMap = storeList[sourceIndex];\r\n\r\n if (!cachedStoreMap) {\r\n cachedStoreMap = storeList[sourceIndex] = {};\r\n }\r\n\r\n let cachedStore = cachedStoreMap[sourceReadKey];\r\n if (!cachedStore) {\r\n const upSourceMgr = this._getUpstreamSourceManagers()[0];\r\n\r\n if (isSeries(this._sourceHost) && upSourceMgr) {\r\n cachedStore = upSourceMgr._innerGetDataStore(\r\n storeDims, seriesSource, sourceReadKey\r\n );\r\n }\r\n else {\r\n cachedStore = new DataStore();\r\n // Always create store from source of series.\r\n cachedStore.initData(\r\n new DefaultDataProvider(seriesSource, storeDims.length),\r\n storeDims\r\n );\r\n }\r\n cachedStoreMap[sourceReadKey] = cachedStore;\r\n }\r\n\r\n return cachedStore;\r\n }\r\n\r\n /**\r\n * PENDING: Is it fast enough?\r\n * If no upstream, return empty array.\r\n */\r\n private _getUpstreamSourceManagers(): SourceManager[] {\r\n // Always get the relationship from the raw option.\r\n // Do not cache the link of the dependency graph, so that\r\n // there is no need to update them when change happens.\r\n const sourceHost = this._sourceHost;\r\n\r\n if (isSeries(sourceHost)) {\r\n const datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\r\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\r\n }\r\n else {\r\n return map(\r\n queryDatasetUpstreamDatasetModels(sourceHost as DatasetModel),\r\n datasetModel => datasetModel.getSourceManager()\r\n );\r\n }\r\n }\r\n\r\n private _getSourceMetaRawOption(): SourceMetaRawOption {\r\n const sourceHost = this._sourceHost;\r\n let seriesLayoutBy: SeriesLayoutBy;\r\n let sourceHeader: OptionSourceHeader;\r\n let dimensions: DimensionDefinitionLoose[];\r\n if (isSeries(sourceHost)) {\r\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\r\n sourceHeader = sourceHost.get('sourceHeader', true);\r\n dimensions = sourceHost.get('dimensions', true);\r\n }\r\n // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them.\r\n else if (!this._getUpstreamSourceManagers().length) {\r\n const model = sourceHost as DatasetModel;\r\n seriesLayoutBy = model.get('seriesLayoutBy', true);\r\n sourceHeader = model.get('sourceHeader', true);\r\n dimensions = model.get('dimensions', true);\r\n }\r\n return { seriesLayoutBy, sourceHeader, dimensions };\r\n }\r\n\r\n}\r\n\r\n// Call this method after `super.init` and `super.mergeOption` to\r\n// disable the transform merge, but do not disable transform clone from rawOption.\r\nexport function disableTransformOptionMerge(datasetModel: DatasetModel): void {\r\n const transformOption = datasetModel.option.transform;\r\n transformOption && setAsPrimitive(datasetModel.option.transform);\r\n}\r\n\r\nfunction isSeries(sourceHost: SourceManager['_sourceHost']): sourceHost is SeriesEncodableModel {\r\n // Avoid circular dependency with Series.ts\r\n return (sourceHost as SeriesModel).mainType === 'series';\r\n}\r\n\r\nfunction doThrow(errMsg: string): void {\r\n throw new Error(errMsg);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n Dictionary, TooltipRenderMode, ColorString,\r\n TooltipOrderMode, DimensionType, CommonTooltipOption, OptionDataValue\r\n} from '../../util/types';\r\nimport {\r\n TooltipMarkerType, getTooltipMarker, encodeHTML,\r\n makeValueReadable, convertToColorString\r\n} from '../../util/format';\r\nimport { isString, each, hasOwn, isArray, map, assert, extend } from 'zrender/src/core/util';\r\nimport { SortOrderComparator } from '../../data/helper/dataValueHelper';\r\nimport SeriesModel from '../../model/Series';\r\nimport { getRandomIdBase } from '../../util/number';\r\nimport Model from '../../model/Model';\r\nimport { TooltipOption } from './TooltipModel';\r\n\r\ntype RichTextStyle = {\r\n fontSize: number | string,\r\n fill: string,\r\n fontWeight?: number | string\r\n};\r\n\r\ntype TextStyle = string | RichTextStyle;\r\n\r\nconst TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';\r\n\r\n// TODO: more textStyle option\r\nfunction getTooltipTextStyle(\r\n textStyle: TooltipOption['textStyle'],\r\n renderMode: TooltipRenderMode\r\n): {\r\n nameStyle: TextStyle\r\n valueStyle: TextStyle\r\n} {\r\n const nameFontColor = textStyle.color || '#6e7079';\r\n const nameFontSize = textStyle.fontSize || 12;\r\n const nameFontWeight = textStyle.fontWeight || '400';\r\n const valueFontColor = textStyle.color || '#464646';\r\n const valueFontSize = textStyle.fontSize || 14;\r\n const valueFontWeight = textStyle.fontWeight || '900';\r\n\r\n if (renderMode === 'html') {\r\n // `textStyle` is probably from user input, should be encoded to reduce security risk.\r\n return {\r\n // eslint-disable-next-line max-len\r\n nameStyle: `font-size:${encodeHTML(nameFontSize + '')}px;color:${encodeHTML(nameFontColor)};font-weight:${encodeHTML(nameFontWeight + '')}`,\r\n // eslint-disable-next-line max-len\r\n valueStyle: `font-size:${encodeHTML(valueFontSize + '')}px;color:${encodeHTML(valueFontColor)};font-weight:${encodeHTML(valueFontWeight + '')}`\r\n };\r\n }\r\n else {\r\n return {\r\n nameStyle: {\r\n fontSize: nameFontSize,\r\n fill: nameFontColor,\r\n fontWeight: nameFontWeight\r\n },\r\n valueStyle: {\r\n fontSize: valueFontSize,\r\n fill: valueFontColor,\r\n fontWeight: valueFontWeight\r\n }\r\n };\r\n }\r\n}\r\n\r\n// 0: no gap in this block.\r\n// 1: has max gap in level 1 in this block.\r\n// ...\r\ntype GapLevel = number;\r\n// See `TooltipMarkupLayoutIntent['innerGapLevel']`.\r\n// (value from UI design)\r\nconst HTML_GAPS: Record = [0, 10, 20, 30];\r\nconst RICH_TEXT_GAPS: Record = ['', '\\n', '\\n\\n', '\\n\\n\\n'];\r\n\r\n/**\r\n * This is an abstract layer to insulate the upper usage of tooltip content\r\n * from the different backends according to different `renderMode` ('html' or 'richText').\r\n * With the help of the abstract layer, it does not need to consider how to create and\r\n * assemble html or richText snippets when making tooltip content.\r\n *\r\n * @usage\r\n *\r\n * ```ts\r\n * class XxxSeriesModel {\r\n * formatTooltip(\r\n * dataIndex: number,\r\n * multipleSeries: boolean,\r\n * dataType: string\r\n * ) {\r\n * ...\r\n * return createTooltipMarkup('section', {\r\n * header: header,\r\n * blocks: [\r\n * createTooltipMarkup('nameValue', {\r\n * name: name,\r\n * value: value,\r\n * noValue: value == null\r\n * })\r\n * ]\r\n * });\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport type TooltipMarkupBlockFragment =\r\n TooltipMarkupSection\r\n | TooltipMarkupNameValueBlock;\r\n\r\ninterface TooltipMarkupBlock {\r\n // Use to make comparison when `sortBlocks: true`.\r\n sortParam?: unknown;\r\n}\r\n\r\nexport interface TooltipMarkupSection extends TooltipMarkupBlock {\r\n type: 'section';\r\n header?: unknown;\r\n // If `noHeader` is `true`, do not display header.\r\n // Otherwise, always display it even if it is\r\n // null/undefined/NaN/''... (displayed as '-').\r\n noHeader?: boolean;\r\n blocks?: TooltipMarkupBlockFragment[];\r\n // Enable to sort blocks when making final html or richText.\r\n sortBlocks?: boolean;\r\n\r\n valueFormatter?: CommonTooltipOption['valueFormatter']\r\n}\r\n\r\nexport interface TooltipMarkupNameValueBlock extends TooltipMarkupBlock {\r\n type: 'nameValue';\r\n // If `!markerType`, tooltip marker is not used.\r\n markerType?: TooltipMarkerType;\r\n markerColor?: ColorString;\r\n name?: string;\r\n // Also support value is `[121, 555, 94.2]`.\r\n value?: unknown | unknown[];\r\n // If not specified, treat value as normal string or numeric.\r\n // If needs to display formatted time, set as 'time'.\r\n // If needs to display original string with numeric guessing, set as 'ordinal'.\r\n // If both `value` and `valueType` are array, each valueType[i] cooresponds to value[i].\r\n valueType?: DimensionType | DimensionType[];\r\n // If `noName` or `noValue` is `true`, do not display name or value.\r\n // Otherwise, always display them even if they are\r\n // null/undefined/NaN/''... (displayed as '-').\r\n noName?: boolean;\r\n noValue?: boolean;\r\n dataIndex?: number;\r\n\r\n valueFormatter?: CommonTooltipOption['valueFormatter']\r\n}\r\n\r\n/**\r\n * Create tooltip markup by this function, we can get TS type check.\r\n */\r\n// eslint-disable-next-line max-len\r\nexport function createTooltipMarkup(type: 'section', option: Omit): TooltipMarkupSection;\r\n// eslint-disable-next-line max-len\r\nexport function createTooltipMarkup(type: 'nameValue', option: Omit): TooltipMarkupNameValueBlock;\r\n// eslint-disable-next-line max-len\r\nexport function createTooltipMarkup(type: TooltipMarkupBlockFragment['type'], option: Omit): TooltipMarkupBlockFragment {\r\n (option as TooltipMarkupBlockFragment).type = type;\r\n return option as TooltipMarkupBlockFragment;\r\n}\r\n\r\n\r\n// Can be null/undefined, which means generate nothing markup text.\r\ntype MarkupText = string;\r\ninterface TooltipMarkupFragmentBuilder {\r\n (\r\n ctx: TooltipMarkupBuildContext,\r\n fragment: TooltipMarkupBlockFragment,\r\n topMarginForOuterGap: number,\r\n toolTipTextStyle: TooltipOption['textStyle']\r\n ): MarkupText;\r\n}\r\n\r\nfunction isSectionFragment(frag: TooltipMarkupBlockFragment): frag is TooltipMarkupSection {\r\n return frag.type === 'section';\r\n}\r\n\r\nfunction getBuilder(frag: TooltipMarkupBlockFragment): TooltipMarkupFragmentBuilder {\r\n return isSectionFragment(frag) ? buildSection : buildNameValue;\r\n}\r\n\r\nfunction getBlockGapLevel(frag: TooltipMarkupBlockFragment) {\r\n if (isSectionFragment(frag)) {\r\n let gapLevel = 0;\r\n const subBlockLen = frag.blocks.length;\r\n const hasInnerGap = subBlockLen > 1 || (subBlockLen > 0 && !frag.noHeader);\r\n each(frag.blocks, function (subBlock) {\r\n const subGapLevel = getBlockGapLevel(subBlock);\r\n // If the some of the sub-blocks have some gaps (like 10px) inside, this block\r\n // should use a larger gap (like 20px) to distinguish those sub-blocks.\r\n if (subGapLevel >= gapLevel) {\r\n gapLevel = subGapLevel + (\r\n +(\r\n hasInnerGap && (\r\n // 0 always can not be readable gap level.\r\n !subGapLevel\r\n // If no header, always keep the sub gap level. Otherwise\r\n // look weird in case `multipleSeries`.\r\n || (isSectionFragment(subBlock) && !subBlock.noHeader)\r\n )\r\n )\r\n );\r\n }\r\n });\r\n return gapLevel;\r\n }\r\n return 0;\r\n}\r\n\r\nfunction buildSection(\r\n ctx: TooltipMarkupBuildContext,\r\n fragment: TooltipMarkupSection,\r\n topMarginForOuterGap: number,\r\n toolTipTextStyle: TooltipOption['textStyle']\r\n) {\r\n const noHeader = fragment.noHeader;\r\n\r\n const gaps = getGap(getBlockGapLevel(fragment));\r\n\r\n const subMarkupTextList: string[] = [];\r\n let subBlocks = fragment.blocks || [];\r\n assert(!subBlocks || isArray(subBlocks));\r\n subBlocks = subBlocks || [];\r\n\r\n const orderMode = ctx.orderMode;\r\n if (fragment.sortBlocks && orderMode) {\r\n subBlocks = subBlocks.slice();\r\n const orderMap = { valueAsc: 'asc', valueDesc: 'desc' } as const;\r\n if (hasOwn(orderMap, orderMode)) {\r\n const comparator = new SortOrderComparator(orderMap[orderMode as 'valueAsc' | 'valueDesc'], null);\r\n subBlocks.sort((a, b) => comparator.evaluate(a.sortParam, b.sortParam));\r\n }\r\n // FIXME 'seriesDesc' necessary?\r\n else if (orderMode === 'seriesDesc') {\r\n subBlocks.reverse();\r\n }\r\n }\r\n\r\n each(subBlocks, function (subBlock, idx) {\r\n const valueFormatter = fragment.valueFormatter;\r\n const subMarkupText = getBuilder(subBlock)(\r\n // Inherit valueFormatter\r\n valueFormatter ? extend(extend({}, ctx), { valueFormatter }) : ctx,\r\n subBlock,\r\n idx > 0 ? gaps.html : 0,\r\n toolTipTextStyle\r\n );\r\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\r\n });\r\n\r\n const subMarkupText = ctx.renderMode === 'richText'\r\n ? subMarkupTextList.join(gaps.richText)\r\n : wrapBlockHTML(\r\n subMarkupTextList.join(''),\r\n noHeader ? topMarginForOuterGap : gaps.html\r\n );\r\n\r\n if (noHeader) {\r\n return subMarkupText;\r\n }\r\n\r\n const displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\r\n const {nameStyle} = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode);\r\n if (ctx.renderMode === 'richText') {\r\n return wrapInlineNameRichText(ctx, displayableHeader, nameStyle as RichTextStyle) + gaps.richText\r\n + subMarkupText;\r\n }\r\n else {\r\n return wrapBlockHTML(\r\n `
`\r\n + encodeHTML(displayableHeader)\r\n + '
'\r\n + subMarkupText,\r\n topMarginForOuterGap\r\n );\r\n }\r\n}\r\n\r\nfunction buildNameValue(\r\n ctx: TooltipMarkupBuildContext,\r\n fragment: TooltipMarkupNameValueBlock,\r\n topMarginForOuterGap: number,\r\n toolTipTextStyle: TooltipOption['textStyle']\r\n) {\r\n const renderMode = ctx.renderMode;\r\n const noName = fragment.noName;\r\n const noValue = fragment.noValue;\r\n const noMarker = !fragment.markerType;\r\n const name = fragment.name;\r\n const useUTC = ctx.useUTC;\r\n const valueFormatter = fragment.valueFormatter || ctx.valueFormatter || ((value) => {\r\n value = isArray(value) ? value : [value];\r\n return map(value as unknown[], (val, idx) => makeValueReadable(\r\n val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC\r\n ));\r\n });\r\n\r\n if (noName && noValue) {\r\n return;\r\n }\r\n\r\n const markerStr = noMarker\r\n ? ''\r\n : ctx.markupStyleCreator.makeTooltipMarker(\r\n fragment.markerType,\r\n fragment.markerColor || '#333',\r\n renderMode\r\n );\r\n const readableName = noName\r\n ? ''\r\n : makeValueReadable(name, 'ordinal', useUTC);\r\n const valueTypeOption = fragment.valueType;\r\n const readableValueList = noValue\r\n ? []\r\n : valueFormatter(fragment.value as OptionDataValue, fragment.dataIndex);\r\n const valueAlignRight = !noMarker || !noName;\r\n // It little weird if only value next to marker but far from marker.\r\n const valueCloseToMarker = !noMarker && noName;\r\n\r\n const {nameStyle, valueStyle} = getTooltipTextStyle(toolTipTextStyle, renderMode);\r\n\r\n return renderMode === 'richText'\r\n ? (\r\n (noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle as RichTextStyle))\r\n // Value has commas inside, so use ' ' as delimiter for multiple values.\r\n + (noValue ? '' : wrapInlineValueRichText(\r\n ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle as RichTextStyle\r\n ))\r\n )\r\n : wrapBlockHTML(\r\n (noMarker ? '' : markerStr)\r\n + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle as string))\r\n + (noValue ? '' : wrapInlineValueHTML(\r\n readableValueList, valueAlignRight, valueCloseToMarker, valueStyle as string\r\n )),\r\n topMarginForOuterGap\r\n );\r\n}\r\n\r\ninterface TooltipMarkupBuildContext {\r\n useUTC: boolean;\r\n renderMode: TooltipRenderMode;\r\n orderMode: TooltipOrderMode;\r\n markupStyleCreator: TooltipMarkupStyleCreator;\r\n\r\n valueFormatter: CommonTooltipOption['valueFormatter']\r\n}\r\n\r\n/**\r\n * @return markupText. null/undefined means no content.\r\n */\r\nexport function buildTooltipMarkup(\r\n fragment: TooltipMarkupBlockFragment,\r\n markupStyleCreator: TooltipMarkupStyleCreator,\r\n renderMode: TooltipRenderMode,\r\n orderMode: TooltipOrderMode,\r\n useUTC: boolean,\r\n toolTipTextStyle: TooltipOption['textStyle']\r\n): MarkupText {\r\n if (!fragment) {\r\n return;\r\n }\r\n\r\n const builder = getBuilder(fragment);\r\n const ctx: TooltipMarkupBuildContext = {\r\n useUTC: useUTC,\r\n renderMode: renderMode,\r\n orderMode: orderMode,\r\n markupStyleCreator: markupStyleCreator,\r\n valueFormatter: fragment.valueFormatter\r\n };\r\n return builder(ctx, fragment, 0, toolTipTextStyle);\r\n}\r\n\r\n\r\nfunction getGap(gapLevel: number): {\r\n html: number;\r\n richText: string\r\n} {\r\n return {\r\n html: HTML_GAPS[gapLevel],\r\n richText: RICH_TEXT_GAPS[gapLevel]\r\n };\r\n}\r\n\r\nfunction wrapBlockHTML(\r\n encodedContent: string,\r\n topGap: number\r\n): string {\r\n const clearfix = '
';\r\n const marginCSS = `margin: ${topGap}px 0 0`;\r\n return `
`\r\n + encodedContent + clearfix\r\n + '
';\r\n}\r\n\r\nfunction wrapInlineNameHTML(\r\n name: string,\r\n leftHasMarker: boolean,\r\n style: string\r\n): string {\r\n const marginCss = leftHasMarker ? 'margin-left:2px' : '';\r\n return ``\r\n + encodeHTML(name)\r\n + '';\r\n}\r\n\r\nfunction wrapInlineValueHTML(\r\n valueList: string | string[],\r\n alignRight: boolean,\r\n valueCloseToMarker: boolean,\r\n style: string\r\n): string {\r\n // Do not too close to marker, considering there are multiple values separated by spaces.\r\n const paddingStr = valueCloseToMarker ? '10px' : '20px';\r\n const alignCSS = alignRight ? `float:right;margin-left:${paddingStr}` : '';\r\n valueList = isArray(valueList) ? valueList : [valueList];\r\n return (\r\n ``\r\n // Value has commas inside, so use ' ' as delimiter for multiple values.\r\n + map(valueList, value => encodeHTML(value)).join('  ')\r\n + ''\r\n );\r\n}\r\n\r\nfunction wrapInlineNameRichText(ctx: TooltipMarkupBuildContext, name: string, style: RichTextStyle): string {\r\n return ctx.markupStyleCreator.wrapRichTextStyle(name, style as Dictionary);\r\n}\r\n\r\nfunction wrapInlineValueRichText(\r\n ctx: TooltipMarkupBuildContext,\r\n values: string | string[],\r\n alignRight: boolean,\r\n valueCloseToMarker: boolean,\r\n style: RichTextStyle\r\n): string {\r\n const styles: Dictionary[] = [style];\r\n const paddingLeft = valueCloseToMarker ? 10 : 20;\r\n alignRight && styles.push({ padding: [0, 0, 0, paddingLeft], align: 'right' });\r\n // Value has commas inside, so use ' ' as delimiter for multiple values.\r\n return ctx.markupStyleCreator.wrapRichTextStyle(\r\n isArray(values) ? values.join(' ') : values,\r\n styles\r\n );\r\n}\r\n\r\n\r\nexport function retrieveVisualColorForTooltipMarker(\r\n series: SeriesModel,\r\n dataIndex: number\r\n): ColorString {\r\n const style = series.getData().getItemVisual(dataIndex, 'style');\r\n const color = style[series.visualDrawType];\r\n return convertToColorString(color);\r\n}\r\n\r\nexport function getPaddingFromTooltipModel(\r\n model: Model,\r\n renderMode: TooltipRenderMode\r\n): number | number[] {\r\n const padding = model.get('padding');\r\n return padding != null\r\n ? padding\r\n // We give slightly different to look pretty.\r\n : renderMode === 'richText'\r\n ? [8, 10]\r\n : 10;\r\n}\r\n\r\n/**\r\n * The major feature is generate styles for `renderMode: 'richText'`.\r\n * But it also serves `renderMode: 'html'` to provide\r\n * \"renderMode-independent\" API.\r\n */\r\nexport class TooltipMarkupStyleCreator {\r\n readonly richTextStyles: Dictionary> = {};\r\n\r\n // Notice that \"generate a style name\" usually happens repeatedly when mouse is moving and\r\n // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator\r\n // rather than static shared by all creators (which will cause it increase to fast).\r\n private _nextStyleNameId: number = getRandomIdBase();\r\n\r\n private _generateStyleName() {\r\n return '__EC_aUTo_' + this._nextStyleNameId++;\r\n }\r\n\r\n makeTooltipMarker(\r\n markerType: TooltipMarkerType,\r\n colorStr: ColorString,\r\n renderMode: TooltipRenderMode\r\n ): string {\r\n const markerId = renderMode === 'richText'\r\n ? this._generateStyleName()\r\n : null;\r\n const marker = getTooltipMarker({\r\n color: colorStr,\r\n type: markerType,\r\n renderMode,\r\n markerId: markerId\r\n });\r\n if (isString(marker)) {\r\n return marker;\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(markerId);\r\n }\r\n this.richTextStyles[markerId] = marker.style;\r\n return marker.content;\r\n }\r\n }\r\n\r\n /**\r\n * @usage\r\n * ```ts\r\n * const styledText = markupStyleCreator.wrapRichTextStyle([\r\n * // The styles will be auto merged.\r\n * {\r\n * fontSize: 12,\r\n * color: 'blue'\r\n * },\r\n * {\r\n * padding: 20\r\n * }\r\n * ]);\r\n * ```\r\n */\r\n wrapRichTextStyle(text: string, styles: Dictionary | Dictionary[]): string {\r\n const finalStl = {};\r\n if (isArray(styles)) {\r\n each(styles, stl => extend(finalStl, stl));\r\n }\r\n else {\r\n extend(finalStl, styles);\r\n }\r\n const styleName = this._generateStyleName();\r\n this.richTextStyles[styleName] = finalStl;\r\n return `{${styleName}|${text}}`;\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport { trim, isArray, each, reduce } from 'zrender/src/core/util';\r\nimport { DimensionName, DimensionType, ColorString } from '../../util/types';\r\nimport {\r\n retrieveVisualColorForTooltipMarker,\r\n TooltipMarkupBlockFragment,\r\n createTooltipMarkup,\r\n TooltipMarkupSection\r\n} from './tooltipMarkup';\r\nimport { retrieveRawValue } from '../../data/helper/dataProvider';\r\nimport { isNameSpecified } from '../../util/model';\r\n\r\n\r\nexport function defaultSeriesFormatTooltip(opt: {\r\n series: SeriesModel;\r\n dataIndex: number;\r\n // `multipleSeries` means multiple series displayed in one tooltip,\r\n // and this method only return the part of one series.\r\n multipleSeries: boolean;\r\n}): TooltipMarkupSection {\r\n const series = opt.series;\r\n const dataIndex = opt.dataIndex;\r\n const multipleSeries = opt.multipleSeries;\r\n\r\n const data = series.getData();\r\n const tooltipDims = data.mapDimensionsAll('defaultedTooltip');\r\n const tooltipDimLen = tooltipDims.length;\r\n const value = series.getRawValue(dataIndex) as any;\r\n const isValueArr = isArray(value);\r\n const markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);\r\n\r\n // Complicated rule for pretty tooltip.\r\n let inlineValue;\r\n let inlineValueType: DimensionType | DimensionType[];\r\n let subBlocks: TooltipMarkupBlockFragment[];\r\n let sortParam: unknown;\r\n if (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) {\r\n const formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\r\n inlineValue = formatArrResult.inlineValues;\r\n inlineValueType = formatArrResult.inlineValueTypes;\r\n subBlocks = formatArrResult.blocks;\r\n // Only support tooltip sort by the first inline value. It's enough in most cases.\r\n sortParam = formatArrResult.inlineValues[0];\r\n }\r\n else if (tooltipDimLen) {\r\n const dimInfo = data.getDimensionInfo(tooltipDims[0]);\r\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\r\n inlineValueType = dimInfo.type;\r\n }\r\n else {\r\n sortParam = inlineValue = isValueArr ? value[0] : value;\r\n }\r\n\r\n // Do not show generated series name. It might not be readable.\r\n const seriesNameSpecified = isNameSpecified(series);\r\n const seriesName = seriesNameSpecified && series.name || '';\r\n const itemName = data.getName(dataIndex);\r\n const inlineName = multipleSeries ? seriesName : itemName;\r\n\r\n return createTooltipMarkup('section', {\r\n header: seriesName,\r\n // When series name is not specified, do not show a header line with only '-'.\r\n // This case always happens in tooltip.trigger: 'item'.\r\n noHeader: multipleSeries || !seriesNameSpecified,\r\n sortParam: sortParam,\r\n blocks: [\r\n createTooltipMarkup('nameValue', {\r\n markerType: 'item',\r\n markerColor: markerColor,\r\n // Do not mix display seriesName and itemName in one tooltip,\r\n // which might confuses users.\r\n name: inlineName,\r\n // name dimension might be auto assigned, where the name might\r\n // be not readable. So we check trim here.\r\n noName: !trim(inlineName),\r\n value: inlineValue,\r\n valueType: inlineValueType,\r\n dataIndex\r\n })\r\n ].concat(subBlocks || [] as any)\r\n });\r\n}\r\n\r\nfunction formatTooltipArrayValue(\r\n value: unknown[],\r\n series: SeriesModel,\r\n dataIndex: number,\r\n tooltipDims: DimensionName[],\r\n colorStr: ColorString\r\n): {\r\n inlineValues: unknown[];\r\n inlineValueTypes: DimensionType[];\r\n blocks: TooltipMarkupBlockFragment[];\r\n} {\r\n // check: category-no-encode-has-axis-data in dataset.html\r\n const data = series.getData();\r\n const isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\r\n const dimItem = data.getDimensionInfo(idx);\r\n return isValueMultipleLine = isValueMultipleLine\r\n || (dimItem && dimItem.tooltip !== false && dimItem.displayName != null);\r\n }, false);\r\n\r\n const inlineValues: unknown[] = [];\r\n const inlineValueTypes: DimensionType[] = [];\r\n const blocks: TooltipMarkupBlockFragment[] = [];\r\n\r\n tooltipDims.length\r\n ? each(tooltipDims, function (dim) {\r\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\r\n })\r\n // By default, all dims is used on tooltip.\r\n : each(value, setEachItem);\r\n\r\n function setEachItem(val: unknown, dim: DimensionName | number): void {\r\n const dimInfo = data.getDimensionInfo(dim);\r\n // If `dimInfo.tooltip` is not set, show tooltip.\r\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\r\n return;\r\n }\r\n if (isValueMultipleLine) {\r\n blocks.push(createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: colorStr,\r\n name: dimInfo.displayName,\r\n value: val,\r\n valueType: dimInfo.type\r\n }));\r\n }\r\n else {\r\n inlineValues.push(val);\r\n inlineValueTypes.push(dimInfo.type);\r\n }\r\n }\r\n\r\n return { inlineValues, inlineValueTypes, blocks };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport env from 'zrender/src/core/env';\r\nimport * as modelUtil from '../util/model';\r\nimport {\r\n DataHost, DimensionName, StageHandlerProgressParams,\r\n SeriesOption, ZRColor, BoxLayoutOptionMixin,\r\n ScaleDataValue,\r\n Dictionary,\r\n OptionDataItemObject,\r\n SeriesDataType,\r\n SeriesEncodeOptionMixin,\r\n OptionEncodeValue,\r\n ColorBy,\r\n StatesOptionMixin\r\n} from '../util/types';\r\nimport ComponentModel, { ComponentModelConstructor } from './Component';\r\nimport {PaletteMixin} from './mixin/palette';\r\nimport { DataFormatMixin } from '../model/mixin/dataFormat';\r\nimport Model from '../model/Model';\r\nimport {\r\n getLayoutParams,\r\n mergeLayoutParam,\r\n fetchLayoutMode\r\n} from '../util/layout';\r\nimport {createTask} from '../core/task';\r\nimport GlobalModel from './Global';\r\nimport { CoordinateSystem } from '../coord/CoordinateSystem';\r\nimport { ExtendableConstructor, mountExtend, Constructor } from '../util/clazz';\r\nimport { PipelineContext, SeriesTaskContext, GeneralTask, OverallTask, SeriesTask } from '../core/Scheduler';\r\nimport LegendVisualProvider from '../visual/LegendVisualProvider';\r\nimport SeriesData from '../data/SeriesData';\r\nimport Axis from '../coord/Axis';\r\nimport type { BrushCommonSelectorsForSeries, BrushSelectableArea } from '../component/brush/selector';\r\nimport makeStyleMapper from './mixin/makeStyleMapper';\r\nimport { SourceManager } from '../data/helper/sourceManager';\r\nimport { Source } from '../data/Source';\r\nimport { defaultSeriesFormatTooltip } from '../component/tooltip/seriesFormatTooltip';\r\nimport {ECSymbol} from '../util/symbol';\r\nimport {Group} from '../util/graphic';\r\nimport {LegendIconParams} from '../component/legend/LegendModel';\r\nimport {dimPermutations} from '../component/marker/MarkAreaView';\r\n\r\nconst inner = modelUtil.makeInner<{\r\n data: SeriesData\r\n dataBeforeProcessed: SeriesData\r\n sourceManager: SourceManager\r\n}, SeriesModel>();\r\n\r\nfunction getSelectionKey(data: SeriesData, dataIndex: number): string {\r\n return data.getName(dataIndex) || data.getId(dataIndex);\r\n}\r\n\r\nexport const SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled';\r\n\r\ninterface SeriesModel {\r\n /**\r\n * Convenient for override in extended class.\r\n * Implement it if needed.\r\n */\r\n preventIncremental(): boolean;\r\n /**\r\n * See tooltip.\r\n * Implement it if needed.\r\n * @return Point of tooltip. null/undefined can be returned.\r\n */\r\n getTooltipPosition(dataIndex: number): number[];\r\n\r\n /**\r\n * Get data indices for show tooltip content. See tooltip.\r\n * Implement it if needed.\r\n */\r\n getAxisTooltipData(\r\n dim: DimensionName[],\r\n value: ScaleDataValue,\r\n baseAxis: Axis\r\n ): {\r\n dataIndices: number[],\r\n nestestValue: any\r\n };\r\n\r\n /**\r\n * Get position for marker\r\n */\r\n getMarkerPosition(\r\n value: ScaleDataValue[],\r\n dims?: typeof dimPermutations[number],\r\n startingAtTick?: boolean\r\n ): number[];\r\n\r\n /**\r\n * Get legend icon symbol according to each series type\r\n */\r\n getLegendIcon(opt: LegendIconParams): ECSymbol | Group;\r\n\r\n /**\r\n * See `component/brush/selector.js`\r\n * Defined the brush selector for this series.\r\n */\r\n brushSelector(\r\n dataIndex: number,\r\n data: SeriesData,\r\n selectors: BrushCommonSelectorsForSeries,\r\n area: BrushSelectableArea\r\n ): boolean;\r\n\r\n enableAriaDecal(): void;\r\n}\r\n\r\nclass SeriesModel extends ComponentModel {\r\n\r\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\r\n // the class members must not be initialized in constructor or declaration place.\r\n // Otherwise there is bad case:\r\n // class A {xxx = 1;}\r\n // enableClassExtend(A);\r\n // class B extends A {}\r\n // var C = B.extend({xxx: 5});\r\n // var c = new C();\r\n // console.log(c.xxx); // expect 5 but always 1.\r\n\r\n // @readonly\r\n type: string;\r\n\r\n // Should be implenented in subclass.\r\n defaultOption: SeriesOption;\r\n\r\n // @readonly\r\n seriesIndex: number;\r\n\r\n // coordinateSystem will be injected in the echarts/CoordinateSystem\r\n coordinateSystem: CoordinateSystem;\r\n\r\n // Injected outside\r\n dataTask: SeriesTask;\r\n // Injected outside\r\n pipelineContext: PipelineContext;\r\n\r\n // ---------------------------------------\r\n // Props to tell visual/style.ts about how to do visual encoding.\r\n // ---------------------------------------\r\n // legend visual provider to the legend component\r\n legendVisualProvider: LegendVisualProvider;\r\n\r\n // Access path of style for visual\r\n visualStyleAccessPath: string;\r\n // Which property is treated as main color. Which can get from the palette.\r\n visualDrawType: 'fill' | 'stroke';\r\n // Style mapping rules.\r\n visualStyleMapper: ReturnType;\r\n // If ignore style on data. It's only for global visual/style.ts\r\n // Enabled when series it self will handle it.\r\n ignoreStyleOnData: boolean;\r\n // If do symbol visual encoding\r\n hasSymbolVisual: boolean;\r\n // Default symbol type.\r\n defaultSymbol: string;\r\n // Symbol provide to legend.\r\n legendIcon: string;\r\n\r\n // It will be set temporary when cross series transition setting is from setOption.\r\n // TODO if deprecate further?\r\n [SERIES_UNIVERSAL_TRANSITION_PROP]: boolean;\r\n\r\n // ---------------------------------------\r\n // Props about data selection\r\n // ---------------------------------------\r\n private _selectedDataIndicesMap: Dictionary = {};\r\n readonly preventUsingHoverLayer: boolean;\r\n\r\n static protoInitialize = (function () {\r\n const proto = SeriesModel.prototype;\r\n proto.type = 'series.__base__';\r\n proto.seriesIndex = 0;\r\n proto.ignoreStyleOnData = false;\r\n proto.hasSymbolVisual = false;\r\n proto.defaultSymbol = 'circle';\r\n // Make sure the values can be accessed!\r\n proto.visualStyleAccessPath = 'itemStyle';\r\n proto.visualDrawType = 'fill';\r\n })();\r\n\r\n\r\n init(option: Opt, parentModel: Model, ecModel: GlobalModel) {\r\n\r\n this.seriesIndex = this.componentIndex;\r\n\r\n this.dataTask = createTask({\r\n count: dataTaskCount,\r\n reset: dataTaskReset\r\n });\r\n this.dataTask.context = {model: this};\r\n\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n\r\n const sourceManager = inner(this).sourceManager = new SourceManager(this);\r\n sourceManager.prepareSource();\r\n\r\n const data = this.getInitialData(option, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.context.data = data;\r\n\r\n if (__DEV__) {\r\n zrUtil.assert(data, 'getInitialData returned invalid data.');\r\n }\r\n\r\n inner(this).dataBeforeProcessed = data;\r\n\r\n // If we reverse the order (make data firstly, and then make\r\n // dataBeforeProcessed by cloneShallow), cloneShallow will\r\n // cause data.graph.data !== data when using\r\n // module:echarts/data/Graph or module:echarts/data/Tree.\r\n // See module:echarts/data/helper/linkSeriesData\r\n\r\n // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model\r\n // init or merge stage, because the data can be restored. So we do not `restoreData`\r\n // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.\r\n // Call `seriesModel.getRawData()` instead.\r\n // this.restoreData();\r\n\r\n autoSeriesName(this);\r\n\r\n this._initSelectedMapFromData(data);\r\n }\r\n\r\n /**\r\n * Util for merge default and theme to option\r\n */\r\n mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void {\r\n const layoutMode = fetchLayoutMode(this);\r\n const inputPositionParams = layoutMode\r\n ? getLayoutParams(option as BoxLayoutOptionMixin) : {};\r\n\r\n // Backward compat: using subType on theme.\r\n // But if name duplicate between series subType\r\n // (for example: parallel) add component mainType,\r\n // add suffix 'Series'.\r\n let themeSubType = this.subType;\r\n if ((ComponentModel as ComponentModelConstructor).hasClass(themeSubType)) {\r\n themeSubType += 'Series';\r\n }\r\n zrUtil.merge(\r\n option,\r\n ecModel.getTheme().get(this.subType)\r\n );\r\n zrUtil.merge(option, this.getDefaultOption());\r\n\r\n // Default label emphasis `show`\r\n modelUtil.defaultEmphasis(option, 'label', ['show']);\r\n\r\n this.fillDataTextStyle(option.data as ArrayLike);\r\n\r\n if (layoutMode) {\r\n mergeLayoutParam(option as BoxLayoutOptionMixin, inputPositionParams, layoutMode);\r\n }\r\n }\r\n\r\n mergeOption(newSeriesOption: Opt, ecModel: GlobalModel) {\r\n // this.settingTask.dirty();\r\n\r\n newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);\r\n this.fillDataTextStyle(newSeriesOption.data as ArrayLike);\r\n\r\n const layoutMode = fetchLayoutMode(this);\r\n if (layoutMode) {\r\n mergeLayoutParam(\r\n this.option as BoxLayoutOptionMixin,\r\n newSeriesOption as BoxLayoutOptionMixin,\r\n layoutMode\r\n );\r\n }\r\n\r\n const sourceManager = inner(this).sourceManager;\r\n sourceManager.dirty();\r\n sourceManager.prepareSource();\r\n\r\n const data = this.getInitialData(newSeriesOption, ecModel);\r\n wrapData(data, this);\r\n this.dataTask.dirty();\r\n this.dataTask.context.data = data;\r\n\r\n inner(this).dataBeforeProcessed = data;\r\n\r\n autoSeriesName(this);\r\n\r\n this._initSelectedMapFromData(data);\r\n }\r\n\r\n fillDataTextStyle(data: ArrayLike): void {\r\n // Default data label emphasis `show`\r\n // FIXME Tree structure data ?\r\n // FIXME Performance ?\r\n if (data && !zrUtil.isTypedArray(data)) {\r\n const props = ['show'];\r\n for (let i = 0; i < data.length; i++) {\r\n if (data[i] && data[i].label) {\r\n modelUtil.defaultEmphasis(data[i], 'label', props);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Init a data structure from data related option in series\r\n * Must be overridden.\r\n */\r\n getInitialData(option: Opt, ecModel: GlobalModel): SeriesData {\r\n return;\r\n }\r\n\r\n /**\r\n * Append data to list\r\n */\r\n appendData(params: {data: ArrayLike}): void {\r\n // FIXME ???\r\n // (1) If data from dataset, forbidden append.\r\n // (2) support append data of dataset.\r\n const data = this.getRawData();\r\n data.appendData(params.data);\r\n }\r\n\r\n /**\r\n * Consider some method like `filter`, `map` need make new data,\r\n * We should make sure that `seriesModel.getData()` get correct\r\n * data in the stream procedure. So we fetch data from upstream\r\n * each time `task.perform` called.\r\n */\r\n getData(dataType?: SeriesDataType): SeriesData {\r\n const task = getCurrentTask(this);\r\n if (task) {\r\n const data = task.context.data;\r\n return (dataType == null || !data.getLinkedData ? data : data.getLinkedData(dataType)) as SeriesData;\r\n }\r\n else {\r\n // When series is not alive (that may happen when click toolbox\r\n // restore or setOption with not merge mode), series data may\r\n // be still need to judge animation or something when graphic\r\n // elements want to know whether fade out.\r\n return inner(this).data as SeriesData;\r\n }\r\n }\r\n\r\n getAllData(): ({\r\n data: SeriesData,\r\n type?: SeriesDataType\r\n })[] {\r\n const mainData = this.getData();\r\n return (mainData && mainData.getLinkedDataAll)\r\n ? mainData.getLinkedDataAll()\r\n : [{ data: mainData }];\r\n }\r\n\r\n setData(data: SeriesData): void {\r\n const task = getCurrentTask(this);\r\n if (task) {\r\n const context = task.context;\r\n // Consider case: filter, data sample.\r\n // FIXME:TS never used, so comment it\r\n // if (context.data !== data && task.modifyOutputEnd) {\r\n // task.setOutputEnd(data.count());\r\n // }\r\n context.outputData = data;\r\n // Caution: setData should update context.data,\r\n // Because getData may be called multiply in a\r\n // single stage and expect to get the data just\r\n // set. (For example, AxisProxy, x y both call\r\n // getData and setDate sequentially).\r\n // So the context.data should be fetched from\r\n // upstream each time when a stage starts to be\r\n // performed.\r\n if (task !== this.dataTask) {\r\n context.data = data;\r\n }\r\n }\r\n inner(this).data = data;\r\n }\r\n\r\n getEncode() {\r\n const encode = (this as Model).get('encode', true);\r\n if (encode) {\r\n return zrUtil.createHashMap(encode);\r\n }\r\n }\r\n\r\n getSourceManager(): SourceManager {\r\n return inner(this).sourceManager;\r\n }\r\n\r\n getSource(): Source {\r\n return this.getSourceManager().getSource();\r\n }\r\n\r\n /**\r\n * Get data before processed\r\n */\r\n getRawData(): SeriesData {\r\n return inner(this).dataBeforeProcessed;\r\n }\r\n\r\n getColorBy(): ColorBy {\r\n const colorBy = this.get('colorBy');\r\n return colorBy || 'series';\r\n }\r\n\r\n isColorBySeries(): boolean {\r\n return this.getColorBy() === 'series';\r\n }\r\n\r\n /**\r\n * Get base axis if has coordinate system and has axis.\r\n * By default use coordSys.getBaseAxis();\r\n * Can be overridden for some chart.\r\n * @return {type} description\r\n */\r\n getBaseAxis(): Axis {\r\n const coordSys = this.coordinateSystem;\r\n // @ts-ignore\r\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\r\n }\r\n\r\n /**\r\n * Default tooltip formatter\r\n *\r\n * @param dataIndex\r\n * @param multipleSeries\r\n * @param dataType\r\n * @param renderMode valid values: 'html'(by default) and 'richText'.\r\n * 'html' is used for rendering tooltip in extra DOM form, and the result\r\n * string is used as DOM HTML content.\r\n * 'richText' is used for rendering tooltip in rich text form, for those where\r\n * DOM operation is not supported.\r\n * @return formatted tooltip with `html` and `markers`\r\n * Notice: The override method can also return string\r\n */\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries?: boolean,\r\n dataType?: SeriesDataType\r\n ): ReturnType {\r\n return defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n }\r\n\r\n isAnimationEnabled(): boolean {\r\n const ecModel = this.ecModel;\r\n // Disable animation if using echarts in node but not give ssr flag.\r\n // In ssr mode, renderToString will generate svg with css animation.\r\n if (env.node && !(ecModel && ecModel.ssr)) {\r\n return false;\r\n }\r\n let animationEnabled = this.getShallow('animation');\r\n if (animationEnabled) {\r\n if (this.getData().count() > this.getShallow('animationThreshold')) {\r\n animationEnabled = false;\r\n }\r\n }\r\n return !!animationEnabled;\r\n }\r\n\r\n restoreData() {\r\n this.dataTask.dirty();\r\n }\r\n\r\n getColorFromPalette(name: string, scope: any, requestColorNum?: number): ZRColor {\r\n const ecModel = this.ecModel;\r\n // PENDING\r\n let color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\r\n if (!color) {\r\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\r\n }\r\n return color;\r\n }\r\n\r\n /**\r\n * Use `data.mapDimensionsAll(coordDim)` instead.\r\n * @deprecated\r\n */\r\n coordDimToDataDim(coordDim: DimensionName): DimensionName[] {\r\n return this.getRawData().mapDimensionsAll(coordDim);\r\n }\r\n\r\n /**\r\n * Get progressive rendering count each step\r\n */\r\n getProgressive(): number | false {\r\n return this.get('progressive');\r\n }\r\n\r\n /**\r\n * Get progressive rendering count each step\r\n */\r\n getProgressiveThreshold(): number {\r\n return this.get('progressiveThreshold');\r\n }\r\n\r\n // PENGING If selectedMode is null ?\r\n select(innerDataIndices: number[], dataType?: SeriesDataType): void {\r\n this._innerSelect(this.getData(dataType), innerDataIndices);\r\n }\r\n\r\n unselect(innerDataIndices: number[], dataType?: SeriesDataType): void {\r\n const selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return;\r\n }\r\n const selectedMode = this.option.selectedMode;\r\n\r\n const data = this.getData(dataType);\r\n if (selectedMode === 'series' || selectedMap === 'all') {\r\n this.option.selectedMap = {};\r\n this._selectedDataIndicesMap = {};\r\n return;\r\n }\r\n\r\n for (let i = 0; i < innerDataIndices.length; i++) {\r\n const dataIndex = innerDataIndices[i];\r\n const nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = false;\r\n this._selectedDataIndicesMap[nameOrId] = -1;\r\n }\r\n }\r\n\r\n toggleSelect(innerDataIndices: number[], dataType?: SeriesDataType): void {\r\n const tmpArr: number[] = [];\r\n for (let i = 0; i < innerDataIndices.length; i++) {\r\n tmpArr[0] = innerDataIndices[i];\r\n this.isSelected(innerDataIndices[i], dataType)\r\n ? this.unselect(tmpArr, dataType)\r\n : this.select(tmpArr, dataType);\r\n }\r\n }\r\n\r\n getSelectedDataIndices(): number[] {\r\n if (this.option.selectedMap === 'all') {\r\n return [].slice.call(this.getData().getIndices());\r\n }\r\n const selectedDataIndicesMap = this._selectedDataIndicesMap;\r\n const nameOrIds = zrUtil.keys(selectedDataIndicesMap);\r\n const dataIndices = [];\r\n for (let i = 0; i < nameOrIds.length; i++) {\r\n const dataIndex = selectedDataIndicesMap[nameOrIds[i]];\r\n if (dataIndex >= 0) {\r\n dataIndices.push(dataIndex);\r\n }\r\n }\r\n return dataIndices;\r\n }\r\n\r\n isSelected(dataIndex: number, dataType?: SeriesDataType): boolean {\r\n const selectedMap = this.option.selectedMap;\r\n if (!selectedMap) {\r\n return false;\r\n }\r\n\r\n const data = this.getData(dataType);\r\n\r\n return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)])\r\n && !data.getItemModel>(dataIndex).get(['select', 'disabled']);\r\n }\r\n\r\n isUniversalTransitionEnabled(): boolean {\r\n if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) {\r\n return true;\r\n }\r\n\r\n const universalTransitionOpt = this.option.universalTransition;\r\n // Quick reject\r\n if (!universalTransitionOpt) {\r\n return false;\r\n }\r\n\r\n if (universalTransitionOpt === true) {\r\n return true;\r\n }\r\n\r\n // Can be simply 'universalTransition: true'\r\n return universalTransitionOpt && universalTransitionOpt.enabled;\r\n }\r\n\r\n private _innerSelect(data: SeriesData, innerDataIndices: number[]) {\r\n const option = this.option;\r\n const selectedMode = option.selectedMode;\r\n const len = innerDataIndices.length;\r\n if (!selectedMode || !len) {\r\n return;\r\n }\r\n\r\n if (selectedMode === 'series') {\r\n option.selectedMap = 'all';\r\n }\r\n else if (selectedMode === 'multiple') {\r\n if (!zrUtil.isObject(option.selectedMap)) {\r\n option.selectedMap = {};\r\n }\r\n const selectedMap = option.selectedMap;\r\n for (let i = 0; i < len; i++) {\r\n const dataIndex = innerDataIndices[i];\r\n // TODO different types of data share same object.\r\n const nameOrId = getSelectionKey(data, dataIndex);\r\n selectedMap[nameOrId] = true;\r\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\r\n }\r\n }\r\n else if (selectedMode === 'single' || selectedMode === true) {\r\n const lastDataIndex = innerDataIndices[len - 1];\r\n const nameOrId = getSelectionKey(data, lastDataIndex);\r\n option.selectedMap = {\r\n [nameOrId]: true\r\n };\r\n this._selectedDataIndicesMap = {\r\n [nameOrId]: data.getRawIndex(lastDataIndex)\r\n };\r\n }\r\n }\r\n\r\n private _initSelectedMapFromData(data: SeriesData) {\r\n // Ignore select info in data if selectedMap exists.\r\n // NOTE It's only for legacy usage. edge data is not supported.\r\n if (this.option.selectedMap) {\r\n return;\r\n }\r\n\r\n const dataIndices: number[] = [];\r\n if (data.hasItemOption) {\r\n data.each(function (idx) {\r\n const rawItem = data.getRawDataItem(idx);\r\n if (rawItem && (rawItem as OptionDataItemObject).selected) {\r\n dataIndices.push(idx);\r\n }\r\n });\r\n }\r\n\r\n if (dataIndices.length > 0) {\r\n this._innerSelect(data, dataIndices);\r\n }\r\n }\r\n\r\n // /**\r\n // * @see {module:echarts/stream/Scheduler}\r\n // */\r\n // abstract pipeTask: null\r\n\r\n static registerClass(clz: Constructor): Constructor {\r\n return ComponentModel.registerClass(clz);\r\n }\r\n}\r\n\r\ninterface SeriesModel\r\n extends DataFormatMixin, PaletteMixin, DataHost {\r\n\r\n // methods that can be implemented optionally to provide to components\r\n /**\r\n * Get dimension to render shadow in dataZoom component\r\n */\r\n getShadowDim?(): string\r\n}\r\nzrUtil.mixin(SeriesModel, DataFormatMixin);\r\nzrUtil.mixin(SeriesModel, PaletteMixin);\r\n\r\nexport type SeriesModelConstructor = typeof SeriesModel & ExtendableConstructor;\r\nmountExtend(SeriesModel, ComponentModel as SeriesModelConstructor);\r\n\r\n\r\n/**\r\n * MUST be called after `prepareSource` called\r\n * Here we need to make auto series, especially for auto legend. But we\r\n * do not modify series.name in option to avoid side effects.\r\n */\r\nfunction autoSeriesName(seriesModel: SeriesModel): void {\r\n // User specified name has higher priority, otherwise it may cause\r\n // series can not be queried unexpectedly.\r\n const name = seriesModel.name;\r\n if (!modelUtil.isNameSpecified(seriesModel)) {\r\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\r\n }\r\n}\r\n\r\nfunction getSeriesAutoName(seriesModel: SeriesModel): string {\r\n const data = seriesModel.getRawData();\r\n const dataDims = data.mapDimensionsAll('seriesName');\r\n const nameArr: string[] = [];\r\n zrUtil.each(dataDims, function (dataDim) {\r\n const dimInfo = data.getDimensionInfo(dataDim);\r\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\r\n });\r\n return nameArr.join(' ');\r\n}\r\n\r\nfunction dataTaskCount(context: SeriesTaskContext): number {\r\n return context.model.getRawData().count();\r\n}\r\n\r\nfunction dataTaskReset(context: SeriesTaskContext) {\r\n const seriesModel = context.model;\r\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\r\n return dataTaskProgress;\r\n}\r\n\r\nfunction dataTaskProgress(param: StageHandlerProgressParams, context: SeriesTaskContext): void {\r\n // Avoid repeat cloneShallow when data just created in reset.\r\n if (context.outputData && param.end > context.outputData.count()) {\r\n context.model.getRawData().cloneShallow(context.outputData);\r\n }\r\n}\r\n\r\n// TODO refactor\r\nfunction wrapData(data: SeriesData, seriesModel: SeriesModel): void {\r\n zrUtil.each(zrUtil.concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\r\n data.wrapMethod(methodName as any, zrUtil.curry(onDataChange, seriesModel));\r\n });\r\n}\r\n\r\nfunction onDataChange(this: SeriesData, seriesModel: SeriesModel, newList: SeriesData): SeriesData {\r\n const task = getCurrentTask(seriesModel);\r\n if (task) {\r\n // Consider case: filter, selectRange\r\n task.setOutputEnd((newList || this).count());\r\n }\r\n return newList;\r\n}\r\n\r\nfunction getCurrentTask(seriesModel: SeriesModel): GeneralTask {\r\n const scheduler = (seriesModel.ecModel || {}).scheduler;\r\n const pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\r\n\r\n if (pipeline) {\r\n // When pipline finished, the currrentTask keep the last\r\n // task (renderTask).\r\n let task = pipeline.currentTask;\r\n if (task) {\r\n const agentStubMap = (task as OverallTask).agentStubMap;\r\n if (agentStubMap) {\r\n task = agentStubMap.get(seriesModel.uid);\r\n }\r\n }\r\n return task;\r\n }\r\n}\r\n\r\n\r\nexport default SeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport * as componentUtil from '../util/component';\r\nimport * as clazzUtil from '../util/clazz';\r\nimport ComponentModel from '../model/Component';\r\nimport GlobalModel from '../model/Global';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport {Payload, ViewRootGroup, ECActionEvent, EventQueryItem, ECElementEvent} from '../util/types';\r\nimport Element from 'zrender/src/Element';\r\nimport SeriesModel from '../model/Series';\r\n\r\ninterface ComponentView {\r\n /**\r\n * Implement it if needed.\r\n */\r\n updateTransform?(\r\n model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload\r\n ): void | {update: true};\r\n\r\n /**\r\n * Pass only when return `true`.\r\n * Implement it if needed.\r\n */\r\n filterForExposedEvent(\r\n eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent\r\n ): boolean;\r\n\r\n /**\r\n * Find dispatchers for highlight/downplay by name.\r\n * If this methods provided, hover link (within the same name) is enabled in component.\r\n * That is, in component, a name can correspond to multiple dispatchers.\r\n * Those dispatchers can have no common ancestor.\r\n * The highlight/downplay state change will be applied on the\r\n * dispatchers and their descendents.\r\n *\r\n * @return Must return an array but not null/undefined.\r\n */\r\n findHighDownDispatchers?(\r\n name: string\r\n ): Element[];\r\n\r\n focusBlurEnabled?: boolean;\r\n}\r\n\r\nclass ComponentView {\r\n\r\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\r\n // the class members must not be initialized in constructor or declaration place.\r\n // Otherwise there is bad case:\r\n // class A {xxx = 1;}\r\n // enableClassExtend(A);\r\n // class B extends A {}\r\n // var C = B.extend({xxx: 5});\r\n // var c = new C();\r\n // console.log(c.xxx); // expect 5 but always 1.\r\n\r\n readonly group: ViewRootGroup;\r\n\r\n readonly uid: string;\r\n\r\n // ----------------------\r\n // Injectable properties\r\n // ----------------------\r\n __model: ComponentModel;\r\n __alive: boolean;\r\n __id: string;\r\n\r\n constructor() {\r\n this.group = new Group();\r\n this.uid = componentUtil.getUID('viewComponent');\r\n }\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI): void {}\r\n\r\n render(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {}\r\n\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI): void {}\r\n\r\n updateView(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n // Do nothing;\r\n }\r\n\r\n updateLayout(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n // Do nothing;\r\n }\r\n\r\n updateVisual(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n // Do nothing;\r\n }\r\n\r\n /**\r\n * Hook for toggle blur target series.\r\n * Can be used in marker for blur or leave blur the markers\r\n */\r\n toggleBlurSeries(seriesModels: SeriesModel[], isBlur: boolean, ecModel: GlobalModel): void {\r\n // Do nothing;\r\n }\r\n\r\n /**\r\n * Traverse the new rendered elements.\r\n *\r\n * It will traverse the new added element in progressive rendering.\r\n * And traverse all in normal rendering.\r\n */\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n const group = this.group;\r\n if (group) {\r\n group.traverse(cb);\r\n }\r\n }\r\n\r\n static registerClass: clazzUtil.ClassManager['registerClass'];\r\n};\r\n\r\n\r\nexport type ComponentViewConstructor = typeof ComponentView\r\n & clazzUtil.ExtendableConstructor\r\n & clazzUtil.ClassManager;\r\n\r\nclazzUtil.enableClassExtend(ComponentView as ComponentViewConstructor);\r\nclazzUtil.enableClassManagement(ComponentView as ComponentViewConstructor);\r\n\r\nexport default ComponentView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {makeInner} from '../../util/model';\r\nimport SeriesModel from '../../model/Series';\r\nimport { StageHandlerPlanReturn } from '../../util/types';\r\n\r\n/**\r\n * @return {string} If large mode changed, return string 'reset';\r\n */\r\nexport default function createRenderPlanner() {\r\n const inner = makeInner<{\r\n large: boolean\r\n progressiveRender: boolean\r\n }, SeriesModel>();\r\n\r\n return function (seriesModel: SeriesModel): StageHandlerPlanReturn {\r\n const fields = inner(seriesModel);\r\n const pipelineContext = seriesModel.pipelineContext;\r\n\r\n const originalLarge = !!fields.large;\r\n const originalProgressive = !!fields.progressiveRender;\r\n\r\n // FIXME: if the planner works on a filtered series, `pipelineContext` does not\r\n // exists. See #11611 . Probably we need to modify this structure, see the comment\r\n // on `performRawSeries` in `Schedular.js`.\r\n const large = fields.large = !!(pipelineContext && pipelineContext.large);\r\n const progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\r\n\r\n return (\r\n !!((originalLarge !== large) || (originalProgressive !== progressive)) && 'reset'\r\n ) as StageHandlerPlanReturn;\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {each} from 'zrender/src/core/util';\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport * as componentUtil from '../util/component';\r\nimport * as clazzUtil from '../util/clazz';\r\nimport * as modelUtil from '../util/model';\r\nimport { enterEmphasis, leaveEmphasis, getHighlightDigit, isHighDownDispatcher } from '../util/states';\r\nimport {createTask, TaskResetCallbackReturn} from '../core/task';\r\nimport createRenderPlanner from '../chart/helper/createRenderPlanner';\r\nimport SeriesModel from '../model/Series';\r\nimport GlobalModel from '../model/Global';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport Element from 'zrender/src/Element';\r\nimport {\r\n Payload, ViewRootGroup, ECActionEvent, EventQueryItem,\r\n StageHandlerPlanReturn, DisplayState, StageHandlerProgressParams, ECElementEvent\r\n} from '../util/types';\r\nimport { SeriesTaskContext, SeriesTask } from '../core/Scheduler';\r\nimport SeriesData from '../data/SeriesData';\r\nimport { traverseElements } from '../util/graphic';\r\nimport { error } from '../util/log';\r\n\r\nconst inner = modelUtil.makeInner<{\r\n updateMethod: keyof ChartView\r\n}, Payload>();\r\nconst renderPlanner = createRenderPlanner();\r\n\r\ninterface ChartView {\r\n /**\r\n * Rendering preparation in progressive mode.\r\n * Implement it if needed.\r\n */\r\n incrementalPrepareRender(\r\n seriesModel: SeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void;\r\n\r\n /**\r\n * Render in progressive mode.\r\n * Implement it if needed.\r\n * @param params See taskParams in `stream/task.js`\r\n */\r\n incrementalRender(\r\n params: StageHandlerProgressParams,\r\n seriesModel: SeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void;\r\n\r\n /**\r\n * Update transform directly.\r\n * Implement it if needed.\r\n */\r\n updateTransform(\r\n seriesModel: SeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void | {update: true};\r\n\r\n /**\r\n * The view contains the given point.\r\n * Implement it if needed.\r\n */\r\n containPoint(\r\n point: number[], seriesModel: SeriesModel\r\n ): boolean;\r\n\r\n /**\r\n * Pass only when return `true`.\r\n * Implement it if needed.\r\n */\r\n filterForExposedEvent(\r\n eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent\r\n ): boolean;\r\n}\r\nclass ChartView {\r\n\r\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\r\n // the class members must not be initialized in constructor or declaration place.\r\n // Otherwise there is bad case:\r\n // class A {xxx = 1;}\r\n // enableClassExtend(A);\r\n // class B extends A {}\r\n // var C = B.extend({xxx: 5});\r\n // var c = new C();\r\n // console.log(c.xxx); // expect 5 but always 1.\r\n\r\n // @readonly\r\n type: string;\r\n\r\n readonly group: ViewRootGroup;\r\n\r\n readonly uid: string;\r\n\r\n readonly renderTask: SeriesTask;\r\n\r\n /**\r\n * Ignore label line update in global stage. Will handle it in chart itself.\r\n * Used in pie / funnel\r\n */\r\n ignoreLabelLineUpdate: boolean;\r\n\r\n // ----------------------\r\n // Injectable properties\r\n // ----------------------\r\n __alive: boolean;\r\n __model: SeriesModel;\r\n __id: string;\r\n\r\n static protoInitialize = (function () {\r\n const proto = ChartView.prototype;\r\n proto.type = 'chart';\r\n })();\r\n\r\n\r\n constructor() {\r\n this.group = new Group();\r\n this.uid = componentUtil.getUID('viewChart');\r\n\r\n this.renderTask = createTask({\r\n plan: renderTaskPlan,\r\n reset: renderTaskReset\r\n });\r\n this.renderTask.context = {view: this} as SeriesTaskContext;\r\n }\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI): void {}\r\n\r\n render(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n if (__DEV__) {\r\n throw new Error('render method must been implemented');\r\n }\r\n }\r\n\r\n /**\r\n * Highlight series or specified data item.\r\n */\r\n highlight(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n const data = seriesModel.getData(payload && payload.dataType);\r\n if (!data) {\r\n if (__DEV__) {\r\n error(`Unknown dataType ${payload.dataType}`);\r\n }\r\n return;\r\n }\r\n toggleHighlight(data, payload, 'emphasis');\r\n }\r\n\r\n /**\r\n * Downplay series or specified data item.\r\n */\r\n downplay(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n const data = seriesModel.getData(payload && payload.dataType);\r\n if (!data) {\r\n if (__DEV__) {\r\n error(`Unknown dataType ${payload.dataType}`);\r\n }\r\n return;\r\n }\r\n toggleHighlight(data, payload, 'normal');\r\n }\r\n\r\n /**\r\n * Remove self.\r\n */\r\n remove(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n this.group.removeAll();\r\n }\r\n\r\n /**\r\n * Dispose self.\r\n */\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI): void {}\r\n\r\n\r\n updateView(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n this.render(seriesModel, ecModel, api, payload);\r\n }\r\n\r\n // FIXME never used?\r\n updateLayout(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n this.render(seriesModel, ecModel, api, payload);\r\n }\r\n\r\n // FIXME never used?\r\n updateVisual(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n this.render(seriesModel, ecModel, api, payload);\r\n }\r\n\r\n /**\r\n * Traverse the new rendered elements.\r\n *\r\n * It will traverse the new added element in progressive rendering.\r\n * And traverse all in normal rendering.\r\n */\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n traverseElements(this.group, cb);\r\n }\r\n\r\n static markUpdateMethod(payload: Payload, methodName: keyof ChartView): void {\r\n inner(payload).updateMethod = methodName;\r\n }\r\n\r\n static registerClass: clazzUtil.ClassManager['registerClass'];\r\n};\r\n\r\n\r\n/**\r\n * Set state of single element\r\n */\r\nfunction elSetState(el: Element, state: DisplayState, highlightDigit: number) {\r\n if (el && isHighDownDispatcher(el)) {\r\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\r\n }\r\n}\r\n\r\nfunction toggleHighlight(data: SeriesData, payload: Payload, state: DisplayState) {\r\n const dataIndex = modelUtil.queryDataIndex(data, payload);\r\n\r\n const highlightDigit = (payload && payload.highlightKey != null)\r\n ? getHighlightDigit(payload.highlightKey)\r\n : null;\r\n\r\n if (dataIndex != null) {\r\n each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {\r\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\r\n });\r\n }\r\n else {\r\n data.eachItemGraphicEl(function (el) {\r\n elSetState(el, state, highlightDigit);\r\n });\r\n }\r\n}\r\n\r\nexport type ChartViewConstructor = typeof ChartView\r\n & clazzUtil.ExtendableConstructor\r\n & clazzUtil.ClassManager;\r\n\r\nclazzUtil.enableClassExtend(ChartView as ChartViewConstructor, ['dispose']);\r\nclazzUtil.enableClassManagement(ChartView as ChartViewConstructor);\r\n\r\n\r\nfunction renderTaskPlan(context: SeriesTaskContext): StageHandlerPlanReturn {\r\n return renderPlanner(context.model);\r\n}\r\n\r\nfunction renderTaskReset(context: SeriesTaskContext): TaskResetCallbackReturn {\r\n const seriesModel = context.model;\r\n const ecModel = context.ecModel;\r\n const api = context.api;\r\n const payload = context.payload;\r\n // FIXME: remove updateView updateVisual\r\n const progressiveRender = seriesModel.pipelineContext.progressiveRender;\r\n const view = context.view;\r\n\r\n const updateMethod = payload && inner(payload).updateMethod;\r\n const methodName: keyof ChartView = progressiveRender\r\n ? 'incrementalPrepareRender'\r\n : (updateMethod && view[updateMethod])\r\n ? updateMethod\r\n // `appendData` is also supported when data amount\r\n // is less than progressive threshold.\r\n : 'render';\r\n\r\n if (methodName !== 'render') {\r\n (view[methodName] as any)(seriesModel, ecModel, api, payload);\r\n }\r\n\r\n return progressMethodMap[methodName];\r\n}\r\n\r\nconst progressMethodMap: {[method: string]: TaskResetCallbackReturn} = {\r\n incrementalPrepareRender: {\r\n progress: function (params: StageHandlerProgressParams, context: SeriesTaskContext): void {\r\n context.view.incrementalRender(\r\n params, context.model, context.ecModel, context.api, context.payload\r\n );\r\n }\r\n },\r\n render: {\r\n // Put view.render in `progress` to support appendData. But in this case\r\n // view.render should not be called in reset, otherwise it will be called\r\n // twise. Use `forceFirstProgress` to make sure that view.render is called\r\n // in any cases.\r\n forceFirstProgress: true,\r\n progress: function (params: StageHandlerProgressParams, context: SeriesTaskContext): void {\r\n context.view.render(\r\n context.model, context.ecModel, context.api, context.payload\r\n );\r\n }\r\n }\r\n};\r\n\r\nexport default ChartView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nconst ORIGIN_METHOD = '\\0__throttleOriginMethod' as const;\r\nconst RATE = '\\0__throttleRate' as const;\r\nconst THROTTLE_TYPE = '\\0__throttleType' as const;\r\n\r\ntype ThrottleFunction = (this: unknown, ...args: unknown[]) => void;\r\nexport type ThrottleType = 'fixRate' | 'debounce';\r\n\r\nexport interface ThrottleController {\r\n clear(): void;\r\n debounceNextCall(debounceDelay: number): void;\r\n};\r\n\r\n/**\r\n * @public\r\n * @param {(Function)} fn\r\n * @param {number} [delay=0] Unit: ms.\r\n * @param {boolean} [debounce=false]\r\n * true: If call interval less than `delay`, only the last call works.\r\n * false: If call interval less than `delay, call works on fixed rate.\r\n * @return {(Function)} throttled fn.\r\n */\r\nexport function throttle(\r\n fn: T,\r\n delay?: number,\r\n debounce?: boolean\r\n): T & ThrottleController {\r\n\r\n let currCall;\r\n let lastCall = 0;\r\n let lastExec = 0;\r\n let timer: ReturnType = null;\r\n let diff;\r\n let scope: unknown;\r\n let args: unknown[];\r\n let debounceNextCall: number;\r\n\r\n delay = delay || 0;\r\n\r\n function exec(): void {\r\n lastExec = (new Date()).getTime();\r\n timer = null;\r\n fn.apply(scope, args || []);\r\n }\r\n\r\n const cb = function (this: unknown, ...cbArgs: unknown[]): void {\r\n currCall = (new Date()).getTime();\r\n scope = this;\r\n args = cbArgs;\r\n const thisDelay = debounceNextCall || delay;\r\n const thisDebounce = debounceNextCall || debounce;\r\n debounceNextCall = null;\r\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\r\n\r\n clearTimeout(timer);\r\n\r\n // Here we should make sure that: the `exec` SHOULD NOT be called later\r\n // than a new call of `cb`, that is, preserving the command order. Consider\r\n // calculating \"scale rate\" when roaming as an example. When a call of `cb`\r\n // happens, either the `exec` is called dierectly, or the call is delayed.\r\n // But the delayed call should never be later than next call of `cb`. Under\r\n // this assurance, we can simply update view state each time `dispatchAction`\r\n // triggered by user roaming, but not need to add extra code to avoid the\r\n // state being \"rolled-back\".\r\n if (thisDebounce) {\r\n timer = setTimeout(exec, thisDelay);\r\n }\r\n else {\r\n if (diff >= 0) {\r\n exec();\r\n }\r\n else {\r\n timer = setTimeout(exec, -diff);\r\n }\r\n }\r\n\r\n lastCall = currCall;\r\n } as T & ThrottleController;\r\n\r\n /**\r\n * Clear throttle.\r\n * @public\r\n */\r\n cb.clear = function (): void {\r\n if (timer) {\r\n clearTimeout(timer);\r\n timer = null;\r\n }\r\n };\r\n\r\n /**\r\n * Enable debounce once.\r\n */\r\n cb.debounceNextCall = function (debounceDelay: number): void {\r\n debounceNextCall = debounceDelay;\r\n };\r\n\r\n return cb;\r\n}\r\n\r\n/**\r\n * Create throttle method or update throttle rate.\r\n *\r\n * @example\r\n * ComponentView.prototype.render = function () {\r\n * ...\r\n * throttle.createOrUpdate(\r\n * this,\r\n * '_dispatchAction',\r\n * this.model.get('throttle'),\r\n * 'fixRate'\r\n * );\r\n * };\r\n * ComponentView.prototype.remove = function () {\r\n * throttle.clear(this, '_dispatchAction');\r\n * };\r\n * ComponentView.prototype.dispose = function () {\r\n * throttle.clear(this, '_dispatchAction');\r\n * };\r\n *\r\n */\r\nexport function createOrUpdate(\r\n obj: T,\r\n fnAttr: S,\r\n rate: number,\r\n throttleType: ThrottleType\r\n): P extends ThrottleFunction ? P & ThrottleController : never {\r\n let fn = obj[fnAttr];\r\n\r\n if (!fn) {\r\n return;\r\n }\r\n\r\n const originFn = (fn as any)[ORIGIN_METHOD] || fn;\r\n const lastThrottleType = (fn as any)[THROTTLE_TYPE];\r\n const lastRate = (fn as any)[RATE];\r\n\r\n if (lastRate !== rate || lastThrottleType !== throttleType) {\r\n if (rate == null || !throttleType) {\r\n return (obj[fnAttr] = originFn);\r\n }\r\n\r\n fn = obj[fnAttr] = throttle(\r\n originFn, rate, throttleType === 'debounce'\r\n );\r\n (fn as any)[ORIGIN_METHOD] = originFn;\r\n (fn as any)[THROTTLE_TYPE] = throttleType;\r\n (fn as any)[RATE] = rate;\r\n }\r\n\r\n return fn as ReturnType;\r\n}\r\n\r\n/**\r\n * Clear throttle. Example see throttle.createOrUpdate.\r\n */\r\nexport function clear(obj: T, fnAttr: S): void {\r\n const fn = obj[fnAttr];\r\n if (fn && (fn as any)[ORIGIN_METHOD]) {\r\n // Clear throttle\r\n (fn as any).clear && (fn as any).clear();\r\n obj[fnAttr] = (fn as any)[ORIGIN_METHOD];\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { isFunction, extend, createHashMap } from 'zrender/src/core/util';\r\nimport { StageHandler, CallbackDataParams, ZRColor, Dictionary, InnerDecalObject }\r\n from '../util/types';\r\nimport makeStyleMapper from '../model/mixin/makeStyleMapper';\r\nimport { ITEM_STYLE_KEY_MAP } from '../model/mixin/itemStyle';\r\nimport { LINE_STYLE_KEY_MAP } from '../model/mixin/lineStyle';\r\nimport SeriesModel from '../model/Series';\r\nimport Model from '../model/Model';\r\nimport { makeInner } from '../util/model';\r\n\r\nconst inner = makeInner<{scope: object}, SeriesModel>();\r\n\r\nconst defaultStyleMappers = {\r\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\r\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\r\n};\r\n\r\nconst defaultColorKey = {\r\n lineStyle: 'stroke',\r\n itemStyle: 'fill'\r\n} as const;\r\n\r\nfunction getStyleMapper(seriesModel: SeriesModel, stylePath: string) {\r\n const styleMapper = seriesModel.visualStyleMapper\r\n || defaultStyleMappers[stylePath as 'itemStyle' | 'lineStyle'];\r\n if (!styleMapper) {\r\n console.warn(`Unknown style type '${stylePath}'.`);\r\n return defaultStyleMappers.itemStyle;\r\n }\r\n return styleMapper;\r\n}\r\n\r\nfunction getDefaultColorKey(seriesModel: SeriesModel, stylePath: string): 'stroke' | 'fill' {\r\n // return defaultColorKey[stylePath] ||\r\n const colorKey = seriesModel.visualDrawType\r\n || defaultColorKey[stylePath as 'itemStyle' | 'lineStyle'];\r\n\r\n if (!colorKey) {\r\n console.warn(`Unknown style type '${stylePath}'.`);\r\n return 'fill';\r\n }\r\n\r\n return colorKey;\r\n}\r\n\r\ntype ColorCallback = (params: CallbackDataParams) => ZRColor;\r\n\r\nconst seriesStyleTask: StageHandler = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset(seriesModel, ecModel) {\r\n const data = seriesModel.getData();\r\n const stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n // Set in itemStyle\r\n const styleModel = seriesModel.getModel(stylePath as any);\r\n const getStyle = getStyleMapper(seriesModel, stylePath);\r\n\r\n const globalStyle = getStyle(styleModel);\r\n\r\n const decalOption = styleModel.getShallow('decal') as InnerDecalObject;\r\n if (decalOption) {\r\n data.setVisual('decal', decalOption);\r\n decalOption.dirty = true;\r\n }\r\n\r\n // TODO\r\n const colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n const color = globalStyle[colorKey];\r\n\r\n // TODO style callback\r\n const colorCallback = isFunction(color) ? color as unknown as ColorCallback : null;\r\n const hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto';\r\n // Get from color palette by default.\r\n if (!globalStyle[colorKey] || colorCallback || hasAutoColor) {\r\n // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT\r\n // make it effect palette. Because some scenarios users need to make some series\r\n // transparent or as background, which should better not effect the palette.\r\n const colorPalette = seriesModel.getColorFromPalette(\r\n // TODO series count changed.\r\n seriesModel.name, null, ecModel.getSeriesCount()\r\n );\r\n if (!globalStyle[colorKey]) {\r\n globalStyle[colorKey] = colorPalette;\r\n data.setVisual('colorFromPalette', true);\r\n }\r\n globalStyle.fill = (globalStyle.fill === 'auto' || isFunction(globalStyle.fill))\r\n ? colorPalette\r\n : globalStyle.fill;\r\n globalStyle.stroke = (globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke))\r\n ? colorPalette\r\n : globalStyle.stroke;\r\n }\r\n\r\n data.setVisual('style', globalStyle);\r\n data.setVisual('drawType', colorKey);\r\n\r\n // Only visible series has each data be visual encoded\r\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\r\n data.setVisual('colorFromPalette', false);\r\n\r\n return {\r\n dataEach(data, idx) {\r\n const dataParams = seriesModel.getDataParams(idx);\r\n const itemStyle = extend({}, globalStyle);\r\n itemStyle[colorKey] = colorCallback(dataParams);\r\n data.setItemVisual(idx, 'style', itemStyle);\r\n }\r\n };\r\n }\r\n }\r\n};\r\n\r\nconst sharedModel = new Model();\r\nconst dataStyleTask: StageHandler = {\r\n createOnAllSeries: true,\r\n performRawSeries: true,\r\n reset(seriesModel, ecModel) {\r\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n const stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n // Set in itemStyle\r\n const getStyle = getStyleMapper(seriesModel, stylePath);\r\n\r\n const colorKey = data.getVisual('drawType');\r\n\r\n return {\r\n dataEach: data.hasItemOption ? function (data, idx) {\r\n // Not use getItemModel for performance considuration\r\n const rawItem = data.getRawDataItem(idx) as any;\r\n if (rawItem && rawItem[stylePath]) {\r\n sharedModel.option = rawItem[stylePath];\r\n const style = getStyle(sharedModel);\r\n\r\n const existsStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n\r\n if (sharedModel.option.decal) {\r\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\r\n sharedModel.option.decal.dirty = true;\r\n }\r\n\r\n if (colorKey in style) {\r\n data.setItemVisual(idx, 'colorFromPalette', false);\r\n }\r\n }\r\n } : null\r\n };\r\n }\r\n};\r\n\r\n// Pick color from palette for the data which has not been set with color yet.\r\n// Note: do not support stream rendering. No such cases yet.\r\nconst dataColorPaletteTask: StageHandler = {\r\n performRawSeries: true,\r\n overallReset(ecModel) {\r\n // Each type of series uses one scope.\r\n // Pie and funnel are using different scopes.\r\n const paletteScopeGroupByType = createHashMap();\r\n ecModel.eachSeries((seriesModel: SeriesModel) => {\r\n const colorBy = seriesModel.getColorBy();\r\n if (seriesModel.isColorBySeries()) {\r\n return;\r\n }\r\n const key = seriesModel.type + '-' + colorBy;\r\n let colorScope = paletteScopeGroupByType.get(key);\r\n if (!colorScope) {\r\n colorScope = {};\r\n paletteScopeGroupByType.set(key, colorScope);\r\n }\r\n inner(seriesModel).scope = colorScope;\r\n });\r\n\r\n\r\n ecModel.eachSeries((seriesModel: SeriesModel) => {\r\n if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n\r\n const dataAll = seriesModel.getRawData();\r\n const idxMap: Dictionary = {};\r\n const data = seriesModel.getData();\r\n const colorScope = inner(seriesModel).scope;\r\n\r\n const stylePath = seriesModel.visualStyleAccessPath\r\n || 'itemStyle';\r\n const colorKey = getDefaultColorKey(seriesModel, stylePath);\r\n\r\n data.each(function (idx) {\r\n const rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n\r\n // Iterate on data before filtered. To make sure color from palette can be\r\n // Consistent when toggling legend.\r\n dataAll.each(function (rawIdx) {\r\n const idx = idxMap[rawIdx];\r\n const fromPalette = data.getItemVisual(idx, 'colorFromPalette');\r\n // Get color from palette for each data only when the color is inherited from series color, which is\r\n // also picked from color palette. So following situation is not in the case:\r\n // 1. series.itemStyle.color is set\r\n // 2. color is encoded by visualMap\r\n if (fromPalette) {\r\n const itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n const name = dataAll.getName(rawIdx) || (rawIdx + '');\r\n const dataCount = dataAll.count();\r\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name, colorScope, dataCount);\r\n }\r\n });\r\n });\r\n }\r\n};\r\n\r\nexport {\r\n seriesStyleTask,\r\n dataStyleTask,\r\n dataColorPaletteTask\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../util/graphic';\r\nimport { LoadingEffect } from '../util/types';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\n\r\nconst PI = Math.PI;\r\n\r\n/**\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Object} [opts]\r\n * @param {string} [opts.text]\r\n * @param {string} [opts.color]\r\n * @param {string} [opts.textColor]\r\n * @return {module:zrender/Element}\r\n */\r\nexport default function defaultLoading(\r\n api: ExtensionAPI,\r\n opts?: {\r\n text?: string;\r\n color?: string;\r\n textColor?: string;\r\n maskColor?: string;\r\n zlevel?: number;\r\n showSpinner?: boolean;\r\n spinnerRadius?: number;\r\n lineWidth?: number;\r\n fontSize?: number;\r\n fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | number;\r\n fontStyle?: 'normal' | 'italic' | 'oblique';\r\n fontFamily?: string\r\n }\r\n): LoadingEffect {\r\n opts = opts || {};\r\n zrUtil.defaults(opts, {\r\n text: 'loading',\r\n textColor: '#000',\r\n fontSize: 12,\r\n fontWeight: 'normal',\r\n fontStyle: 'normal',\r\n fontFamily: 'sans-serif',\r\n maskColor: 'rgba(255, 255, 255, 0.8)',\r\n showSpinner: true,\r\n color: '#5470c6',\r\n spinnerRadius: 10,\r\n lineWidth: 5,\r\n zlevel: 0\r\n });\r\n const group = new graphic.Group() as (graphic.Group & LoadingEffect);\r\n const mask = new graphic.Rect({\r\n style: {\r\n fill: opts.maskColor\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10000\r\n });\r\n group.add(mask);\r\n\r\n const textContent = new graphic.Text({\r\n style: {\r\n text: opts.text,\r\n fill: opts.textColor,\r\n fontSize: opts.fontSize,\r\n fontWeight: opts.fontWeight,\r\n fontStyle: opts.fontStyle,\r\n fontFamily: opts.fontFamily\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n\r\n const labelRect = new graphic.Rect({\r\n style: {\r\n fill: 'none'\r\n },\r\n textContent: textContent,\r\n textConfig: {\r\n position: 'right',\r\n distance: 10\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n group.add(labelRect);\r\n let arc: graphic.Arc;\r\n\r\n if (opts.showSpinner) {\r\n arc = new graphic.Arc({\r\n shape: {\r\n startAngle: -PI / 2,\r\n endAngle: -PI / 2 + 0.1,\r\n r: opts.spinnerRadius\r\n },\r\n style: {\r\n stroke: opts.color,\r\n lineCap: 'round',\r\n lineWidth: opts.lineWidth\r\n },\r\n zlevel: opts.zlevel,\r\n z: 10001\r\n });\r\n arc.animateShape(true)\r\n .when(1000, {\r\n endAngle: PI * 3 / 2\r\n })\r\n .start('circularInOut');\r\n arc.animateShape(true)\r\n .when(1000, {\r\n startAngle: PI * 3 / 2\r\n })\r\n .delay(300)\r\n .start('circularInOut');\r\n\r\n group.add(arc);\r\n }\r\n\r\n // Inject resize\r\n group.resize = function () {\r\n const textWidth = textContent.getBoundingRect().width;\r\n const r = opts.showSpinner ? opts.spinnerRadius : 0;\r\n // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\r\n // textDistance needs to be calculated when both animation and text exist\r\n const cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2\r\n - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2)\r\n // only show the text\r\n + (opts.showSpinner ? 0 : textWidth / 2)\r\n // only show the spinner\r\n + (textWidth ? 0 : r);\r\n const cy = api.getHeight() / 2;\r\n opts.showSpinner && arc.setShape({\r\n cx: cx,\r\n cy: cy\r\n });\r\n labelRect.setShape({\r\n x: cx - r,\r\n y: cy - r,\r\n width: r * 2,\r\n height: r * 2\r\n });\r\n\r\n mask.setShape({\r\n x: 0,\r\n y: 0,\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n };\r\n group.resize();\r\n return group;\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {each, map, isFunction, createHashMap, noop, HashMap, assert} from 'zrender/src/core/util';\r\nimport {\r\n createTask, Task, TaskContext,\r\n TaskProgressCallback, TaskProgressParams, TaskPlanCallbackReturn, PerformArgs\r\n} from './task';\r\nimport {getUID} from '../util/component';\r\nimport GlobalModel from '../model/Global';\r\nimport ExtensionAPI from './ExtensionAPI';\r\nimport {normalizeToArray} from '../util/model';\r\nimport {\r\n StageHandlerInternal, StageHandlerOverallReset, StageHandler,\r\n Payload, StageHandlerReset, StageHandlerPlan, StageHandlerProgressExecutor, SeriesLargeOptionMixin, SeriesOption\r\n} from '../util/types';\r\nimport { EChartsType } from './echarts';\r\nimport SeriesModel from '../model/Series';\r\nimport ChartView from '../view/Chart';\r\nimport SeriesData from '../data/SeriesData';\r\n\r\nexport type GeneralTask = Task;\r\nexport type SeriesTask = Task;\r\nexport type OverallTask = Task & {\r\n agentStubMap?: HashMap\r\n};\r\nexport type StubTask = Task & {\r\n agent?: OverallTask;\r\n};\r\n\r\nexport type Pipeline = {\r\n id: string\r\n head: GeneralTask,\r\n tail: GeneralTask,\r\n threshold: number,\r\n progressiveEnabled: boolean,\r\n blockIndex: number,\r\n step: number,\r\n count: number,\r\n currentTask?: GeneralTask,\r\n context?: PipelineContext\r\n};\r\nexport type PipelineContext = {\r\n progressiveRender: boolean,\r\n modDataCount: number,\r\n large: boolean\r\n};\r\n\r\ntype TaskRecord = {\r\n // key: seriesUID\r\n seriesTaskMap?: HashMap,\r\n overallTask?: OverallTask\r\n};\r\ntype PerformStageTaskOpt = {\r\n block?: boolean,\r\n setDirty?: boolean,\r\n visualType?: StageHandlerInternal['visualType'],\r\n dirtyMap?: HashMap\r\n};\r\n\r\nexport interface SeriesTaskContext extends TaskContext {\r\n model?: SeriesModel;\r\n data?: SeriesData;\r\n view?: ChartView;\r\n ecModel?: GlobalModel;\r\n api?: ExtensionAPI;\r\n useClearVisual?: boolean;\r\n plan?: StageHandlerPlan;\r\n reset?: StageHandlerReset;\r\n scheduler?: Scheduler;\r\n payload?: Payload;\r\n resetDefines?: StageHandlerProgressExecutor[]\r\n}\r\ninterface OverallTaskContext extends TaskContext {\r\n ecModel: GlobalModel;\r\n api: ExtensionAPI;\r\n overallReset: StageHandlerOverallReset;\r\n scheduler: Scheduler;\r\n payload?: Payload;\r\n}\r\ninterface StubTaskContext extends TaskContext {\r\n model: SeriesModel;\r\n overallProgress: boolean;\r\n};\r\n\r\nclass Scheduler {\r\n\r\n readonly ecInstance: EChartsType;\r\n readonly api: ExtensionAPI;\r\n\r\n // Shared with echarts.js, should only be modified by\r\n // this file and echarts.js\r\n unfinished: boolean;\r\n\r\n private _dataProcessorHandlers: StageHandlerInternal[];\r\n private _visualHandlers: StageHandlerInternal[];\r\n private _allHandlers: StageHandlerInternal[];\r\n\r\n // key: handlerUID\r\n private _stageTaskMap: HashMap = createHashMap();\r\n // key: pipelineId\r\n private _pipelineMap: HashMap;\r\n\r\n\r\n constructor(\r\n ecInstance: EChartsType,\r\n api: ExtensionAPI,\r\n dataProcessorHandlers: StageHandlerInternal[],\r\n visualHandlers: StageHandlerInternal[]\r\n ) {\r\n this.ecInstance = ecInstance;\r\n this.api = api;\r\n\r\n // Fix current processors in case that in some rear cases that\r\n // processors might be registered after echarts instance created.\r\n // Register processors incrementally for a echarts instance is\r\n // not supported by this stream architecture.\r\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\r\n visualHandlers = this._visualHandlers = visualHandlers.slice();\r\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\r\n }\r\n\r\n restoreData(ecModel: GlobalModel, payload: Payload): void {\r\n // TODO: Only restore needed series and components, but not all components.\r\n // Currently `restoreData` of all of the series and component will be called.\r\n // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\r\n // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\r\n // and some components like coordinate system, axes, dataZoom, visualMap only\r\n // need their target series refresh.\r\n // (1) If we are implementing this feature some day, we should consider these cases:\r\n // if a data processor depends on a component (e.g., dataZoomProcessor depends\r\n // on the settings of `dataZoom`), it should be re-performed if the component\r\n // is modified by `setOption`.\r\n // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\r\n // it should be re-performed when the result array of `getTargetSeries` changed.\r\n // We use `dependencies` to cover these issues.\r\n // (3) How to update target series when coordinate system related components modified.\r\n\r\n // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\r\n // and this case all of the tasks will be set as dirty.\r\n\r\n ecModel.restoreData(payload);\r\n\r\n // Theoretically an overall task not only depends on each of its target series, but also\r\n // depends on all of the series.\r\n // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\r\n // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\r\n // that the overall task is set as dirty and to be performed, otherwise it probably cause\r\n // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\r\n // probably cause state chaos (consider `dataZoomProcessor`).\r\n this._stageTaskMap.each(function (taskRecord) {\r\n const overallTask = taskRecord.overallTask;\r\n overallTask && overallTask.dirty();\r\n });\r\n }\r\n\r\n // If seriesModel provided, incremental threshold is check by series data.\r\n getPerformArgs(task: GeneralTask, isBlock?: boolean): {\r\n step: number, modBy: number, modDataCount: number\r\n } {\r\n // For overall task\r\n if (!task.__pipeline) {\r\n return;\r\n }\r\n\r\n const pipeline = this._pipelineMap.get(task.__pipeline.id);\r\n const pCtx = pipeline.context;\r\n const incremental = !isBlock\r\n && pipeline.progressiveEnabled\r\n && (!pCtx || pCtx.progressiveRender)\r\n && task.__idxInPipeline > pipeline.blockIndex;\r\n\r\n const step = incremental ? pipeline.step : null;\r\n const modDataCount = pCtx && pCtx.modDataCount;\r\n const modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\r\n\r\n return {step: step, modBy: modBy, modDataCount: modDataCount};\r\n }\r\n\r\n getPipeline(pipelineId: string) {\r\n return this._pipelineMap.get(pipelineId);\r\n }\r\n\r\n /**\r\n * Current, progressive rendering starts from visual and layout.\r\n * Always detect render mode in the same stage, avoiding that incorrect\r\n * detection caused by data filtering.\r\n * Caution:\r\n * `updateStreamModes` use `seriesModel.getData()`.\r\n */\r\n updateStreamModes(seriesModel: SeriesModel, view: ChartView): void {\r\n const pipeline = this._pipelineMap.get(seriesModel.uid);\r\n const data = seriesModel.getData();\r\n const dataLen = data.count();\r\n\r\n // `progressiveRender` means that can render progressively in each\r\n // animation frame. Note that some types of series do not provide\r\n // `view.incrementalPrepareRender` but support `chart.appendData`. We\r\n // use the term `incremental` but not `progressive` to describe the\r\n // case that `chart.appendData`.\r\n const progressiveRender = pipeline.progressiveEnabled\r\n && view.incrementalPrepareRender\r\n && dataLen >= pipeline.threshold;\r\n\r\n const large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');\r\n\r\n // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\r\n // see `test/candlestick-large3.html`\r\n const modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\r\n\r\n seriesModel.pipelineContext = pipeline.context = {\r\n progressiveRender: progressiveRender,\r\n modDataCount: modDataCount,\r\n large: large\r\n };\r\n }\r\n\r\n restorePipelines(ecModel: GlobalModel): void {\r\n const scheduler = this;\r\n const pipelineMap = scheduler._pipelineMap = createHashMap();\r\n\r\n ecModel.eachSeries(function (seriesModel) {\r\n const progressive = seriesModel.getProgressive();\r\n const pipelineId = seriesModel.uid;\r\n\r\n pipelineMap.set(pipelineId, {\r\n id: pipelineId,\r\n head: null,\r\n tail: null,\r\n threshold: seriesModel.getProgressiveThreshold(),\r\n progressiveEnabled: progressive\r\n && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\r\n blockIndex: -1,\r\n step: Math.round(progressive || 700),\r\n count: 0\r\n });\r\n\r\n scheduler._pipe(seriesModel, seriesModel.dataTask);\r\n });\r\n }\r\n\r\n prepareStageTasks(): void {\r\n const stageTaskMap = this._stageTaskMap;\r\n const ecModel = this.api.getModel();\r\n const api = this.api;\r\n\r\n each(this._allHandlers, function (handler) {\r\n const record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\r\n\r\n let errMsg = '';\r\n if (__DEV__) {\r\n // Currently do not need to support to sepecify them both.\r\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\r\n }\r\n assert(!(handler.reset && handler.overallReset), errMsg);\r\n\r\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\r\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\r\n }, this);\r\n }\r\n\r\n prepareView(view: ChartView, model: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void {\r\n const renderTask = view.renderTask;\r\n const context = renderTask.context;\r\n\r\n context.model = model;\r\n context.ecModel = ecModel;\r\n context.api = api;\r\n\r\n renderTask.__block = !view.incrementalPrepareRender;\r\n\r\n this._pipe(model, renderTask);\r\n }\r\n\r\n performDataProcessorTasks(ecModel: GlobalModel, payload?: Payload): void {\r\n // If we do not use `block` here, it should be considered when to update modes.\r\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {block: true});\r\n }\r\n\r\n performVisualTasks(\r\n ecModel: GlobalModel,\r\n payload?: Payload,\r\n opt?: PerformStageTaskOpt\r\n ): void {\r\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\r\n }\r\n\r\n private _performStageTasks(\r\n stageHandlers: StageHandlerInternal[],\r\n ecModel: GlobalModel,\r\n payload: Payload,\r\n opt?: PerformStageTaskOpt\r\n ): void {\r\n opt = opt || {};\r\n let unfinished: boolean = false;\r\n const scheduler = this;\r\n\r\n each(stageHandlers, function (stageHandler, idx) {\r\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\r\n return;\r\n }\r\n\r\n const stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\r\n const seriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n const overallTask = stageHandlerRecord.overallTask;\r\n\r\n if (overallTask) {\r\n let overallNeedDirty;\r\n const agentStubMap = overallTask.agentStubMap;\r\n agentStubMap.each(function (stub) {\r\n if (needSetDirty(opt, stub)) {\r\n stub.dirty();\r\n overallNeedDirty = true;\r\n }\r\n });\r\n overallNeedDirty && overallTask.dirty();\r\n scheduler.updatePayload(overallTask, payload);\r\n const performArgs = scheduler.getPerformArgs(overallTask, opt.block);\r\n // Execute stubs firstly, which may set the overall task dirty,\r\n // then execute the overall task. And stub will call seriesModel.setData,\r\n // which ensures that in the overallTask seriesModel.getData() will not\r\n // return incorrect data.\r\n agentStubMap.each(function (stub) {\r\n stub.perform(performArgs);\r\n });\r\n if (overallTask.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n }\r\n else if (seriesTaskMap) {\r\n seriesTaskMap.each(function (task, pipelineId) {\r\n if (needSetDirty(opt, task)) {\r\n task.dirty();\r\n }\r\n const performArgs: PerformArgs = scheduler.getPerformArgs(task, opt.block);\r\n // FIXME\r\n // if intending to declare `performRawSeries` in handlers, only\r\n // stream-independent (specifically, data item independent) operations can be\r\n // performed. Because if a series is filtered, most of the tasks will not\r\n // be performed. A stream-dependent operation probably cause wrong biz logic.\r\n // Perhaps we should not provide a separate callback for this case instead\r\n // of providing the config `performRawSeries`. The stream-dependent operations\r\n // and stream-independent operations should better not be mixed.\r\n performArgs.skip = !stageHandler.performRawSeries\r\n && ecModel.isSeriesFiltered(task.context.model);\r\n scheduler.updatePayload(task, payload);\r\n\r\n if (task.perform(performArgs)) {\r\n unfinished = true;\r\n }\r\n });\r\n }\r\n });\r\n\r\n function needSetDirty(opt: PerformStageTaskOpt, task: GeneralTask): boolean {\r\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\r\n }\r\n\r\n this.unfinished = unfinished || this.unfinished;\r\n }\r\n\r\n performSeriesTasks(ecModel: GlobalModel): void {\r\n let unfinished: boolean;\r\n\r\n ecModel.eachSeries(function (seriesModel) {\r\n // Progress to the end for dataInit and dataRestore.\r\n unfinished = seriesModel.dataTask.perform() || unfinished;\r\n });\r\n\r\n this.unfinished = unfinished || this.unfinished;\r\n }\r\n\r\n plan(): void {\r\n // Travel pipelines, check block.\r\n this._pipelineMap.each(function (pipeline) {\r\n let task = pipeline.tail;\r\n do {\r\n if (task.__block) {\r\n pipeline.blockIndex = task.__idxInPipeline;\r\n break;\r\n }\r\n task = task.getUpstream();\r\n }\r\n while (task);\r\n });\r\n }\r\n\r\n updatePayload(\r\n task: Task,\r\n payload: Payload | 'remain'\r\n ): void {\r\n payload !== 'remain' && (task.context.payload = payload);\r\n }\r\n\r\n private _createSeriesStageTask(\r\n stageHandler: StageHandlerInternal,\r\n stageHandlerRecord: TaskRecord,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ): void {\r\n const scheduler = this;\r\n const oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;\r\n // The count of stages are totally about only several dozen, so\r\n // do not need to reuse the map.\r\n const newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\r\n const seriesType = stageHandler.seriesType;\r\n const getTargetSeries = stageHandler.getTargetSeries;\r\n\r\n // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\r\n // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\r\n // it works but it may cause other irrelevant charts blocked.\r\n if (stageHandler.createOnAllSeries) {\r\n ecModel.eachRawSeries(create);\r\n }\r\n else if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, create);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(create);\r\n }\r\n\r\n function create(seriesModel: SeriesModel): void {\r\n const pipelineId = seriesModel.uid;\r\n\r\n // Init tasks for each seriesModel only once.\r\n // Reuse original task instance.\r\n const task = newSeriesTaskMap.set(\r\n pipelineId,\r\n oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId)\r\n || createTask({\r\n plan: seriesTaskPlan,\r\n reset: seriesTaskReset,\r\n count: seriesTaskCount\r\n })\r\n );\r\n task.context = {\r\n model: seriesModel,\r\n ecModel: ecModel,\r\n api: api,\r\n // PENDING: `useClearVisual` not used?\r\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\r\n plan: stageHandler.plan,\r\n reset: stageHandler.reset,\r\n scheduler: scheduler\r\n };\r\n scheduler._pipe(seriesModel, task);\r\n }\r\n }\r\n\r\n private _createOverallStageTask(\r\n stageHandler: StageHandlerInternal,\r\n stageHandlerRecord: TaskRecord,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ): void {\r\n const scheduler = this;\r\n const overallTask: OverallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask\r\n // For overall task, the function only be called on reset stage.\r\n || createTask({reset: overallTaskReset});\r\n\r\n overallTask.context = {\r\n ecModel: ecModel,\r\n api: api,\r\n overallReset: stageHandler.overallReset,\r\n scheduler: scheduler\r\n };\r\n\r\n const oldAgentStubMap = overallTask.agentStubMap;\r\n // The count of stages are totally about only several dozen, so\r\n // do not need to reuse the map.\r\n const newAgentStubMap = overallTask.agentStubMap = createHashMap();\r\n\r\n const seriesType = stageHandler.seriesType;\r\n const getTargetSeries = stageHandler.getTargetSeries;\r\n let overallProgress = true;\r\n let shouldOverallTaskDirty = false;\r\n // FIXME:TS never used, so comment it\r\n // let modifyOutputEnd = stageHandler.modifyOutputEnd;\r\n\r\n // An overall task with seriesType detected or has `getTargetSeries`, we add\r\n // stub in each pipelines, it will set the overall task dirty when the pipeline\r\n // progress. Moreover, to avoid call the overall task each frame (too frequent),\r\n // we set the pipeline block.\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = '\"createOnAllSeries\" is not supported for \"overallReset\", '\r\n + 'because it will block all streams.';\r\n }\r\n assert(!stageHandler.createOnAllSeries, errMsg);\r\n if (seriesType) {\r\n ecModel.eachRawSeriesByType(seriesType, createStub);\r\n }\r\n else if (getTargetSeries) {\r\n getTargetSeries(ecModel, api).each(createStub);\r\n }\r\n // Otherwise, (usually it is legacy case), the overall task will only be\r\n // executed when upstream is dirty. Otherwise the progressive rendering of all\r\n // pipelines will be disabled unexpectedly. But it still needs stubs to receive\r\n // dirty info from upstream.\r\n else {\r\n overallProgress = false;\r\n each(ecModel.getSeries(), createStub);\r\n }\r\n\r\n function createStub(seriesModel: SeriesModel): void {\r\n const pipelineId = seriesModel.uid;\r\n const stub = newAgentStubMap.set(\r\n pipelineId,\r\n oldAgentStubMap && oldAgentStubMap.get(pipelineId)\r\n || (\r\n // When the result of `getTargetSeries` changed, the overallTask\r\n // should be set as dirty and re-performed.\r\n shouldOverallTaskDirty = true,\r\n createTask(\r\n {reset: stubReset, onDirty: stubOnDirty}\r\n )\r\n )\r\n );\r\n stub.context = {\r\n model: seriesModel,\r\n overallProgress: overallProgress\r\n // FIXME:TS never used, so comment it\r\n // modifyOutputEnd: modifyOutputEnd\r\n };\r\n stub.agent = overallTask;\r\n stub.__block = overallProgress;\r\n\r\n scheduler._pipe(seriesModel, stub);\r\n }\r\n\r\n if (shouldOverallTaskDirty) {\r\n overallTask.dirty();\r\n }\r\n }\r\n\r\n private _pipe(seriesModel: SeriesModel, task: GeneralTask) {\r\n const pipelineId = seriesModel.uid;\r\n const pipeline = this._pipelineMap.get(pipelineId);\r\n !pipeline.head && (pipeline.head = task);\r\n pipeline.tail && pipeline.tail.pipe(task);\r\n pipeline.tail = task;\r\n task.__idxInPipeline = pipeline.count++;\r\n task.__pipeline = pipeline;\r\n }\r\n\r\n static wrapStageHandler(\r\n stageHandler: StageHandler | StageHandlerOverallReset,\r\n visualType: StageHandlerInternal['visualType']\r\n ): StageHandlerInternal {\r\n if (isFunction(stageHandler)) {\r\n stageHandler = {\r\n overallReset: stageHandler,\r\n seriesType: detectSeriseType(stageHandler)\r\n } as StageHandlerInternal;\r\n }\r\n\r\n (stageHandler as StageHandlerInternal).uid = getUID('stageHandler');\r\n visualType && ((stageHandler as StageHandlerInternal).visualType = visualType);\r\n\r\n return stageHandler as StageHandlerInternal;\r\n };\r\n\r\n}\r\n\r\n\r\nfunction overallTaskReset(context: OverallTaskContext): void {\r\n context.overallReset(\r\n context.ecModel, context.api, context.payload\r\n );\r\n}\r\n\r\nfunction stubReset(context: StubTaskContext): TaskProgressCallback {\r\n return context.overallProgress && stubProgress;\r\n}\r\n\r\nfunction stubProgress(this: StubTask): void {\r\n this.agent.dirty();\r\n this.getDownstream().dirty();\r\n}\r\n\r\nfunction stubOnDirty(this: StubTask): void {\r\n this.agent && this.agent.dirty();\r\n}\r\n\r\nfunction seriesTaskPlan(context: SeriesTaskContext): TaskPlanCallbackReturn {\r\n return context.plan ? context.plan(\r\n context.model, context.ecModel, context.api, context.payload\r\n ) : null;\r\n}\r\n\r\nfunction seriesTaskReset(\r\n context: SeriesTaskContext\r\n): TaskProgressCallback | TaskProgressCallback[] {\r\n if (context.useClearVisual) {\r\n context.data.clearAllVisual();\r\n }\r\n const resetDefines = context.resetDefines = normalizeToArray(\r\n context.reset(context.model, context.ecModel, context.api, context.payload)\r\n ) as StageHandlerProgressExecutor[];\r\n return resetDefines.length > 1\r\n ? map(resetDefines, function (v, idx) {\r\n return makeSeriesTaskProgress(idx);\r\n })\r\n : singleSeriesTaskProgress;\r\n}\r\n\r\nconst singleSeriesTaskProgress = makeSeriesTaskProgress(0);\r\n\r\nfunction makeSeriesTaskProgress(resetDefineIdx: number): TaskProgressCallback {\r\n return function (params: TaskProgressParams, context: SeriesTaskContext): void {\r\n const data = context.data;\r\n const resetDefine = context.resetDefines[resetDefineIdx];\r\n\r\n if (resetDefine && resetDefine.dataEach) {\r\n for (let i = params.start; i < params.end; i++) {\r\n resetDefine.dataEach(data, i);\r\n }\r\n }\r\n else if (resetDefine && resetDefine.progress) {\r\n resetDefine.progress(params, data);\r\n }\r\n };\r\n}\r\n\r\nfunction seriesTaskCount(context: SeriesTaskContext): number {\r\n return context.data.count();\r\n}\r\n\r\n\r\n\r\n/**\r\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\r\n * To ensure that they can work normally, they should work in block mode, that is,\r\n * they should not be started util the previous tasks finished. So they cause the\r\n * progressive rendering disabled. We try to detect the series type, to narrow down\r\n * the block range to only the series type they concern, but not all series.\r\n */\r\nfunction detectSeriseType(legacyFunc: StageHandlerOverallReset): string {\r\n seriesType = null;\r\n try {\r\n // Assume there is no async when calling `eachSeriesByType`.\r\n legacyFunc(ecModelMock, apiMock);\r\n }\r\n catch (e) {\r\n }\r\n return seriesType;\r\n}\r\n\r\nconst ecModelMock: GlobalModel = {} as GlobalModel;\r\nconst apiMock: ExtensionAPI = {} as ExtensionAPI;\r\nlet seriesType;\r\n\r\nmockMethods(ecModelMock, GlobalModel);\r\nmockMethods(apiMock, ExtensionAPI);\r\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\r\n seriesType = type;\r\n};\r\necModelMock.eachComponent = function (cond: any): void {\r\n if (cond.mainType === 'series' && cond.subType) {\r\n seriesType = cond.subType;\r\n }\r\n};\r\n\r\nfunction mockMethods(target: any, Clz: any): void {\r\n /* eslint-disable */\r\n for (let name in Clz.prototype) {\r\n // Do not use hasOwnProperty\r\n target[name] = noop;\r\n }\r\n /* eslint-enable */\r\n}\r\n\r\nexport default Scheduler;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nconst colorAll = [\r\n '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f',\r\n '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'\r\n];\r\n\r\nexport default {\r\n\r\n color: colorAll,\r\n\r\n colorLayer: [\r\n ['#37A2DA', '#ffd85c', '#fd7b5f'],\r\n ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'],\r\n ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'],\r\n colorAll\r\n ]\r\n};", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nconst contrastColor = '#B9B8CE';\r\nconst backgroundColor = '#100C2A';\r\nconst axisCommon = function () {\r\n return {\r\n axisLine: {\r\n lineStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n splitLine: {\r\n lineStyle: {\r\n color: '#484753'\r\n }\r\n },\r\n splitArea: {\r\n areaStyle: {\r\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\r\n }\r\n },\r\n minorSplitLine: {\r\n lineStyle: {\r\n color: '#20203B'\r\n }\r\n }\r\n };\r\n};\r\n\r\nconst colorPalette = [\r\n '#4992ff',\r\n '#7cffb2',\r\n '#fddd60',\r\n '#ff6e76',\r\n '#58d9f9',\r\n '#05c091',\r\n '#ff8a45',\r\n '#8d48e3',\r\n '#dd79ff'\r\n];\r\nconst theme = {\r\n darkMode: true,\r\n\r\n color: colorPalette,\r\n backgroundColor: backgroundColor,\r\n axisPointer: {\r\n lineStyle: {\r\n color: '#817f91'\r\n },\r\n crossStyle: {\r\n color: '#817f91'\r\n },\r\n label: {\r\n // TODO Contrast of label backgorundColor\r\n color: '#fff'\r\n }\r\n },\r\n legend: {\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n pageTextStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n title: {\r\n textStyle: {\r\n color: '#EEF1FA'\r\n },\r\n subtextStyle: {\r\n color: '#B9B8CE'\r\n }\r\n },\r\n toolbox: {\r\n iconStyle: {\r\n borderColor: contrastColor\r\n }\r\n },\r\n dataZoom: {\r\n borderColor: '#71708A',\r\n textStyle: {\r\n color: contrastColor\r\n },\r\n brushStyle: {\r\n color: 'rgba(135,163,206,0.3)'\r\n },\r\n handleStyle: {\r\n color: '#353450',\r\n borderColor: '#C5CBE3'\r\n },\r\n moveHandleStyle: {\r\n color: '#B0B6C3',\r\n opacity: 0.3\r\n },\r\n fillerColor: 'rgba(135,163,206,0.2)',\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#91B7F2',\r\n color: '#4D587D'\r\n },\r\n moveHandleStyle: {\r\n color: '#636D9A',\r\n opacity: 0.7\r\n }\r\n },\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#71708A',\r\n width: 1\r\n },\r\n areaStyle: {\r\n color: '#71708A'\r\n }\r\n },\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#87A3CE'\r\n },\r\n areaStyle: {\r\n color: '#87A3CE'\r\n }\r\n }\r\n },\r\n visualMap: {\r\n textStyle: {\r\n color: contrastColor\r\n }\r\n },\r\n timeline: {\r\n lineStyle: {\r\n color: contrastColor\r\n },\r\n label: {\r\n color: contrastColor\r\n },\r\n controlStyle: {\r\n color: contrastColor,\r\n borderColor: contrastColor\r\n }\r\n },\r\n calendar: {\r\n itemStyle: {\r\n color: backgroundColor\r\n },\r\n dayLabel: {\r\n color: contrastColor\r\n },\r\n monthLabel: {\r\n color: contrastColor\r\n },\r\n yearLabel: {\r\n color: contrastColor\r\n }\r\n },\r\n timeAxis: axisCommon(),\r\n logAxis: axisCommon(),\r\n valueAxis: axisCommon(),\r\n categoryAxis: axisCommon(),\r\n\r\n line: {\r\n symbol: 'circle'\r\n },\r\n graph: {\r\n color: colorPalette\r\n },\r\n gauge: {\r\n title: {\r\n color: contrastColor\r\n },\r\n axisLine: {\r\n lineStyle: {\r\n color: [[1, 'rgba(207,212,219,0.2)']]\r\n }\r\n },\r\n axisLabel: {\r\n color: contrastColor\r\n },\r\n detail: {\r\n color: '#EEF1FA'\r\n }\r\n },\r\n candlestick: {\r\n itemStyle: {\r\n color: '#f64e56',\r\n color0: '#54ea92',\r\n borderColor: '#f64e56',\r\n borderColor0: '#54ea92'\r\n // borderColor: '#ca2824',\r\n // borderColor0: '#09a443'\r\n }\r\n }\r\n};\r\n(theme.categoryAxis.splitLine as any).show = false;\r\n\r\nexport default theme;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport { EventProcessor, EventQuery } from 'zrender/src/core/Eventful';\r\nimport { ECActionEvent, NormalizedEventQuery, EventQueryItem, ECElementEvent } from './types';\r\nimport ComponentModel from '../model/Component';\r\nimport ComponentView from '../view/Component';\r\nimport ChartView from '../view/Chart';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { parseClassType } from './clazz';\r\nimport Element from 'zrender/src/Element';\r\n\r\n/**\r\n * Usage of query:\r\n * `chart.on('click', query, handler);`\r\n * The `query` can be:\r\n * + The component type query string, only `mainType` or `mainType.subType`,\r\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\r\n * + The component query object, like:\r\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\r\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\r\n * + The data query object, like:\r\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\r\n * + The other query object (cmponent customized query), like:\r\n * `{element: 'some'}` (only available in custom series).\r\n *\r\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\r\n * same as there is no such prop in the `query` object.\r\n */\r\nexport class ECEventProcessor implements EventProcessor {\r\n\r\n // These info required: targetEl, packedEvent, model, view\r\n eventInfo: {\r\n targetEl: Element;\r\n packedEvent: ECActionEvent | ECElementEvent;\r\n model: ComponentModel;\r\n view: ComponentView | ChartView;\r\n };\r\n\r\n normalizeQuery(query: EventQuery): NormalizedEventQuery {\r\n const cptQuery: EventQueryItem = {};\r\n const dataQuery: EventQueryItem = {};\r\n const otherQuery: EventQueryItem = {};\r\n\r\n // `query` is `mainType` or `mainType.subType` of component.\r\n if (zrUtil.isString(query)) {\r\n const condCptType = parseClassType(query);\r\n // `.main` and `.sub` may be ''.\r\n cptQuery.mainType = condCptType.main || null;\r\n cptQuery.subType = condCptType.sub || null;\r\n }\r\n // `query` is an object, convert to {mainType, index, name, id}.\r\n else {\r\n // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\r\n // can not be used in `compomentModel.filterForExposedEvent`.\r\n const suffixes = ['Index', 'Name', 'Id'];\r\n const dataKeys = {name: 1, dataIndex: 1, dataType: 1};\r\n zrUtil.each(query, function (val, key) {\r\n let reserved = false;\r\n for (let i = 0; i < suffixes.length; i++) {\r\n const propSuffix = suffixes[i];\r\n const suffixPos = key.lastIndexOf(propSuffix);\r\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\r\n const mainType = key.slice(0, suffixPos);\r\n // Consider `dataIndex`.\r\n if (mainType !== 'data') {\r\n cptQuery.mainType = mainType;\r\n cptQuery[propSuffix.toLowerCase()] = val;\r\n reserved = true;\r\n }\r\n }\r\n }\r\n if (dataKeys.hasOwnProperty(key)) {\r\n dataQuery[key] = val;\r\n reserved = true;\r\n }\r\n if (!reserved) {\r\n otherQuery[key] = val;\r\n }\r\n });\r\n }\r\n\r\n return {\r\n cptQuery: cptQuery,\r\n dataQuery: dataQuery,\r\n otherQuery: otherQuery\r\n };\r\n }\r\n\r\n filter(eventType: string, query: NormalizedEventQuery): boolean {\r\n // They should be assigned before each trigger call.\r\n const eventInfo = this.eventInfo;\r\n\r\n if (!eventInfo) {\r\n return true;\r\n }\r\n\r\n const targetEl = eventInfo.targetEl;\r\n const packedEvent = eventInfo.packedEvent;\r\n const model = eventInfo.model;\r\n const view = eventInfo.view;\r\n\r\n // For event like 'globalout'.\r\n if (!model || !view) {\r\n return true;\r\n }\r\n\r\n const cptQuery = query.cptQuery;\r\n const dataQuery = query.dataQuery;\r\n\r\n return check(cptQuery, model, 'mainType')\r\n && check(cptQuery, model, 'subType')\r\n && check(cptQuery, model, 'index', 'componentIndex')\r\n && check(cptQuery, model, 'name')\r\n && check(cptQuery, model, 'id')\r\n && check(dataQuery, packedEvent, 'name')\r\n && check(dataQuery, packedEvent, 'dataIndex')\r\n && check(dataQuery, packedEvent, 'dataType')\r\n && (!view.filterForExposedEvent || view.filterForExposedEvent(\r\n eventType, query.otherQuery, targetEl, packedEvent\r\n ));\r\n\r\n function check(\r\n query: EventQueryItem, host: any, prop: string, propOnHost?: string\r\n ): boolean {\r\n return query[prop] == null || host[propOnHost || prop] === query[prop];\r\n }\r\n }\r\n\r\n afterTrigger() {\r\n // Make sure the eventInfo won't be used in next trigger.\r\n this.eventInfo = null;\r\n }\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {extend, isFunction, keys} from 'zrender/src/core/util';\r\nimport {\r\n StageHandler,\r\n SeriesOption,\r\n SymbolOptionMixin,\r\n SymbolCallback,\r\n CallbackDataParams\r\n} from '../util/types';\r\nimport SeriesData from '../data/SeriesData';\r\nimport SeriesModel from '../model/Series';\r\nimport GlobalModel from '../model/Global';\r\n\r\nconst SYMBOL_PROPS_WITH_CB = [\r\n 'symbol', 'symbolSize', 'symbolRotate', 'symbolOffset'\r\n] as const;\r\nconst SYMBOL_PROPS: [...typeof SYMBOL_PROPS_WITH_CB, 'symbolKeepAspect'] = SYMBOL_PROPS_WITH_CB.concat([\r\n 'symbolKeepAspect'\r\n] as any) as any;\r\n// Encoding visual for all series include which is filtered for legend drawing\r\nconst seriesSymbolTask: StageHandler = {\r\n\r\n createOnAllSeries: true,\r\n\r\n // For legend.\r\n performRawSeries: true,\r\n\r\n reset: function (\r\n seriesModel: SeriesModel>,\r\n ecModel: GlobalModel\r\n ) {\r\n const data = seriesModel.getData();\r\n\r\n if (seriesModel.legendIcon) {\r\n data.setVisual('legendIcon', seriesModel.legendIcon);\r\n }\r\n\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n\r\n const symbolOptions = {} as Record<(typeof SYMBOL_PROPS_WITH_CB)[number], any>;\r\n const symbolOptionsCb = {} as Record<(typeof SYMBOL_PROPS_WITH_CB)[number], any>;\r\n let hasCallback = false;\r\n for (let i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) {\r\n const symbolPropName = SYMBOL_PROPS_WITH_CB[i];\r\n const val = seriesModel.get(symbolPropName);\r\n if (isFunction(val)) {\r\n hasCallback = true;\r\n symbolOptionsCb[symbolPropName] = val;\r\n }\r\n else {\r\n symbolOptions[symbolPropName] = val;\r\n }\r\n }\r\n symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol;\r\n\r\n data.setVisual(extend({\r\n legendIcon: seriesModel.legendIcon || symbolOptions.symbol,\r\n symbolKeepAspect: seriesModel.get('symbolKeepAspect')\r\n }, symbolOptions));\r\n\r\n // Only visible series has each data be visual encoded\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n\r\n const symbolPropsCb = keys(symbolOptionsCb);\r\n\r\n function dataEach(data: SeriesData, idx: number) {\r\n const rawValue = seriesModel.getRawValue(idx);\r\n const params = seriesModel.getDataParams(idx);\r\n\r\n for (let i = 0; i < symbolPropsCb.length; i++) {\r\n const symbolPropName = symbolPropsCb[i];\r\n data.setItemVisual(\r\n idx, symbolPropName,\r\n (symbolOptionsCb[symbolPropName] as SymbolCallback)(rawValue, params)\r\n );\r\n }\r\n }\r\n\r\n return { dataEach: hasCallback ? dataEach : null };\r\n }\r\n};\r\n\r\nconst dataSymbolTask: StageHandler = {\r\n\r\n createOnAllSeries: true,\r\n\r\n // For legend.\r\n performRawSeries: true,\r\n\r\n reset: function (\r\n seriesModel: SeriesModel>,\r\n ecModel: GlobalModel\r\n ) {\r\n if (!seriesModel.hasSymbolVisual) {\r\n return;\r\n }\r\n // Only visible series has each data be visual encoded\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n\r\n function dataEach(data: SeriesData, idx: number) {\r\n const itemModel = data.getItemModel(idx);\r\n\r\n for (let i = 0; i < SYMBOL_PROPS.length; i++) {\r\n const symbolPropName = SYMBOL_PROPS[i];\r\n const val = itemModel.getShallow(symbolPropName, true);\r\n if (val != null) {\r\n data.setItemVisual(idx, symbolPropName, val);\r\n }\r\n }\r\n }\r\n\r\n return { dataEach: data.hasItemOption ? dataEach : null };\r\n }\r\n};\r\n\r\nexport {seriesSymbolTask, dataSymbolTask};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * A mapping of visual provided to developer and visual stored in the List module.\r\n * To developer:\r\n * 'color', 'opacity', 'symbol', 'symbolSize'...\r\n * In the List module storage:\r\n * 'style', 'symbol', 'symbolSize'...\r\n */\r\nimport SeriesData from '../data/SeriesData';\r\n\r\n\r\nexport function getItemVisualFromData(data: SeriesData, dataIndex: number, key: string) {\r\n switch (key) {\r\n case 'color':\r\n const style = data.getItemVisual(dataIndex, 'style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getItemVisual(dataIndex, 'style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getItemVisual(dataIndex, key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(`Unknown visual type ${key}`);\r\n }\r\n }\r\n}\r\n\r\nexport function getVisualFromData(data: SeriesData, key: string) {\r\n switch (key) {\r\n case 'color':\r\n const style = data.getVisual('style');\r\n return style[data.getVisual('drawType')];\r\n case 'opacity':\r\n return data.getVisual('style').opacity;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n return data.getVisual(key);\r\n default:\r\n if (__DEV__) {\r\n console.warn(`Unknown visual type ${key}`);\r\n }\r\n }\r\n}\r\n\r\nexport function setItemVisualFromData(data: SeriesData, dataIndex: number, key: string, value: any) {\r\n switch (key) {\r\n case 'color':\r\n // Make sure not sharing style object.\r\n const style = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n style[data.getVisual('drawType')] = value;\r\n // Mark the color has been changed, not from palette anymore\r\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\r\n break;\r\n case 'opacity':\r\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\r\n break;\r\n case 'symbol':\r\n case 'symbolSize':\r\n case 'liftZ':\r\n data.setItemVisual(dataIndex, key, value);\r\n break;\r\n default:\r\n if (__DEV__) {\r\n console.warn(`Unknown visual type ${key}`);\r\n }\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { Payload, SelectChangedPayload } from '../util/types';\r\nimport SeriesModel from '../model/Series';\r\nimport { extend, each, isArray, isString } from 'zrender/src/core/util';\r\nimport GlobalModel from '../model/Global';\r\nimport { deprecateReplaceLog, deprecateLog } from '../util/log';\r\nimport Eventful from 'zrender/src/core/Eventful';\r\nimport type { EChartsType, registerAction } from '../core/echarts';\r\nimport { queryDataIndex } from '../util/model';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\n\r\n// Legacy data selection action.\r\n// Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect\r\nexport function createLegacyDataSelectAction(seriesType: string, ecRegisterAction: typeof registerAction) {\r\n\r\n function getSeriesIndices(ecModel: GlobalModel, payload: Payload) {\r\n const seriesIndices: number[] = [];\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: seriesType, query: payload\r\n }, function (seriesModel: SeriesModel) {\r\n seriesIndices.push(seriesModel.seriesIndex);\r\n });\r\n return seriesIndices;\r\n }\r\n\r\n each([\r\n [seriesType + 'ToggleSelect', 'toggleSelect'],\r\n [seriesType + 'Select', 'select'],\r\n [seriesType + 'UnSelect', 'unselect']\r\n ], function (eventsMap) {\r\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\r\n payload = extend({}, payload);\r\n\r\n if (__DEV__) {\r\n deprecateReplaceLog(payload.type, eventsMap[1]);\r\n }\r\n\r\n api.dispatchAction(extend(payload, {\r\n type: eventsMap[1],\r\n seriesIndex: getSeriesIndices(ecModel, payload)\r\n }));\r\n });\r\n });\r\n}\r\n\r\nfunction handleSeriesLegacySelectEvents(\r\n type: 'map' | 'pie',\r\n eventPostfix: 'selectchanged' | 'selected' | 'unselected',\r\n ecIns: EChartsType,\r\n ecModel: GlobalModel,\r\n payload: SelectChangedPayload\r\n) {\r\n const legacyEventName = type + eventPostfix;\r\n if (!ecIns.isSilent(legacyEventName)) {\r\n if (__DEV__) {\r\n deprecateLog(`event ${legacyEventName} is deprecated.`);\r\n }\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'pie'\r\n }, function (seriesModel: SeriesModel) {\r\n const seriesIndex = seriesModel.seriesIndex;\r\n const selectedMap = seriesModel.option.selectedMap;\r\n const selected = payload.selected;\r\n for (let i = 0; i < selected.length; i++) {\r\n if (selected[i].seriesIndex === seriesIndex) {\r\n const data = seriesModel.getData();\r\n const dataIndex = queryDataIndex(data, payload.fromActionPayload);\r\n ecIns.trigger(legacyEventName, {\r\n type: legacyEventName,\r\n seriesId: seriesModel.id,\r\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\r\n selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport function handleLegacySelectEvents(messageCenter: Eventful, ecIns: EChartsType, api: ExtensionAPI) {\r\n messageCenter.on('selectchanged', function (params: SelectChangedPayload) {\r\n const ecModel = api.getModel();\r\n if (params.isFromClick) {\r\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'select') {\r\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\r\n }\r\n else if (params.fromAction === 'unselect') {\r\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\r\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Element from 'zrender/src/Element';\r\n\r\nexport function findEventDispatcher(\r\n target: Element,\r\n det: (target: Element) => boolean,\r\n returnFirstMatch?: boolean\r\n) {\r\n let found;\r\n while (target) {\r\n if (det(target)) {\r\n found = target;\r\n if (returnFirstMatch) {\r\n break;\r\n }\r\n }\r\n\r\n target = target.__hostTarget || target.parent;\r\n }\r\n return found;\r\n}", "let wmUniqueIndex = Math.round(Math.random() * 9);\n\nconst supportDefineProperty = typeof Object.defineProperty === 'function';\n\nexport default class WeakMap {\n\n protected _id: string;\n\n constructor() {\n this._id = '__ec_inner_' + wmUniqueIndex++;\n }\n\n get(key: K): V {\n return (this._guard(key) as any)[this._id];\n }\n\n set(key: K, value: V): WeakMap {\n const target = this._guard(key) as any;\n if (supportDefineProperty) {\n Object.defineProperty(target, this._id, {\n value: value,\n enumerable: false,\n configurable: true\n });\n }\n else {\n target[this._id] = value;\n }\n return this;\n }\n\n delete(key: K): boolean {\n if (this.has(key)) {\n delete (this._guard(key) as any)[this._id];\n return true;\n }\n return false;\n }\n\n has(key: K): boolean {\n return !!(this._guard(key) as any)[this._id];\n }\n\n protected _guard(key: K): K {\n if (key !== Object(key)) {\n throw TypeError('Value of WeakMap is not a non-null object.');\n }\n return key;\n }\n}\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Symbol factory\r\n\r\nimport { each, isArray, retrieve2 } from 'zrender/src/core/util';\r\nimport * as graphic from './graphic';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport { calculateTextPosition } from 'zrender/src/contain/text';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { SymbolOptionMixin, ZRColor } from './types';\r\nimport { parsePercent } from './number';\r\n\r\nexport type ECSymbol = graphic.Path & {\r\n __isEmptyBrush?: boolean\r\n setColor: (color: ZRColor, innerColor?: ZRColor) => void\r\n getColor: () => ZRColor\r\n};\r\ntype SymbolCtor = { new(): ECSymbol };\r\ntype SymbolShapeMaker = (x: number, y: number, w: number, h: number, shape: Dictionary) => void;\r\n\r\n/**\r\n * Triangle shape\r\n * @inner\r\n */\r\nconst Triangle = graphic.Path.extend({\r\n type: 'triangle',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n const cx = shape.cx;\r\n const cy = shape.cy;\r\n const width = shape.width / 2;\r\n const height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy + height);\r\n path.lineTo(cx - width, cy + height);\r\n path.closePath();\r\n }\r\n});\r\n\r\n/**\r\n * Diamond shape\r\n * @inner\r\n */\r\nconst Diamond = graphic.Path.extend({\r\n type: 'diamond',\r\n shape: {\r\n cx: 0,\r\n cy: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n buildPath: function (path, shape) {\r\n const cx = shape.cx;\r\n const cy = shape.cy;\r\n const width = shape.width / 2;\r\n const height = shape.height / 2;\r\n path.moveTo(cx, cy - height);\r\n path.lineTo(cx + width, cy);\r\n path.lineTo(cx, cy + height);\r\n path.lineTo(cx - width, cy);\r\n path.closePath();\r\n }\r\n});\r\n\r\n/**\r\n * Pin shape\r\n * @inner\r\n */\r\nconst Pin = graphic.Path.extend({\r\n type: 'pin',\r\n shape: {\r\n // x, y on the cusp\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n\r\n buildPath: function (path, shape) {\r\n const x = shape.x;\r\n const y = shape.y;\r\n const w = shape.width / 5 * 3;\r\n // Height must be larger than width\r\n const h = Math.max(w, shape.height);\r\n const r = w / 2;\r\n\r\n // Dist on y with tangent point and circle center\r\n const dy = r * r / (h - r);\r\n const cy = y - h + r + dy;\r\n const angle = Math.asin(dy / r);\r\n // Dist on x with tangent point and circle center\r\n const dx = Math.cos(angle) * r;\r\n\r\n const tanX = Math.sin(angle);\r\n const tanY = Math.cos(angle);\r\n\r\n const cpLen = r * 0.6;\r\n const cpLen2 = r * 0.7;\r\n\r\n path.moveTo(x - dx, cy + dy);\r\n\r\n path.arc(\r\n x, cy, r,\r\n Math.PI - angle,\r\n Math.PI * 2 + angle\r\n );\r\n path.bezierCurveTo(\r\n x + dx - tanX * cpLen, cy + dy + tanY * cpLen,\r\n x, y - cpLen2,\r\n x, y\r\n );\r\n path.bezierCurveTo(\r\n x, y - cpLen2,\r\n x - dx + tanX * cpLen, cy + dy + tanY * cpLen,\r\n x - dx, cy + dy\r\n );\r\n path.closePath();\r\n }\r\n});\r\n\r\n/**\r\n * Arrow shape\r\n * @inner\r\n */\r\nconst Arrow = graphic.Path.extend({\r\n\r\n type: 'arrow',\r\n\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n\r\n buildPath: function (ctx, shape) {\r\n const height = shape.height;\r\n const width = shape.width;\r\n const x = shape.x;\r\n const y = shape.y;\r\n const dx = width / 3 * 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + dx, y + height);\r\n ctx.lineTo(x, y + height / 4 * 3);\r\n ctx.lineTo(x - dx, y + height);\r\n ctx.lineTo(x, y);\r\n ctx.closePath();\r\n }\r\n});\r\n\r\n/**\r\n * Map of path constructors\r\n */\r\n// TODO Use function to build symbol path.\r\nconst symbolCtors: Dictionary = {\r\n line: graphic.Line as unknown as SymbolCtor,\r\n\r\n rect: graphic.Rect as unknown as SymbolCtor,\r\n\r\n roundRect: graphic.Rect as unknown as SymbolCtor,\r\n\r\n square: graphic.Rect as unknown as SymbolCtor,\r\n\r\n circle: graphic.Circle as unknown as SymbolCtor,\r\n\r\n diamond: Diamond as unknown as SymbolCtor,\r\n\r\n pin: Pin as unknown as SymbolCtor,\r\n\r\n arrow: Arrow as unknown as SymbolCtor,\r\n\r\n triangle: Triangle as unknown as SymbolCtor\r\n};\r\n\r\n\r\nconst symbolShapeMakers: Dictionary = {\r\n\r\n line: function (x, y, w, h, shape: graphic.Line['shape']) {\r\n shape.x1 = x;\r\n shape.y1 = y + h / 2;\r\n shape.x2 = x + w;\r\n shape.y2 = y + h / 2;\r\n },\r\n\r\n rect: function (x, y, w, h, shape: graphic.Rect['shape']) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n\r\n roundRect: function (x, y, w, h, shape: graphic.Rect['shape']) {\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = w;\r\n shape.height = h;\r\n shape.r = Math.min(w, h) / 4;\r\n },\r\n\r\n square: function (x, y, w, h, shape: graphic.Rect['shape']) {\r\n const size = Math.min(w, h);\r\n shape.x = x;\r\n shape.y = y;\r\n shape.width = size;\r\n shape.height = size;\r\n },\r\n\r\n circle: function (x, y, w, h, shape: graphic.Circle['shape']) {\r\n // Put circle in the center of square\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.r = Math.min(w, h) / 2;\r\n },\r\n\r\n diamond: function (x, y, w, h, shape: InstanceType['shape']) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n\r\n pin: function (x, y, w, h, shape: InstanceType['shape']) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n\r\n arrow: function (x, y, w, h, shape: InstanceType['shape']) {\r\n shape.x = x + w / 2;\r\n shape.y = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n },\r\n\r\n triangle: function (x, y, w, h, shape: InstanceType['shape']) {\r\n shape.cx = x + w / 2;\r\n shape.cy = y + h / 2;\r\n shape.width = w;\r\n shape.height = h;\r\n }\r\n};\r\n\r\nexport const symbolBuildProxies: Dictionary = {};\r\neach(symbolCtors, function (Ctor, name) {\r\n symbolBuildProxies[name] = new Ctor();\r\n});\r\n\r\nconst SymbolClz = graphic.Path.extend({\r\n\r\n type: 'symbol',\r\n\r\n shape: {\r\n symbolType: '',\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n },\r\n\r\n calculateTextPosition(out, config, rect) {\r\n const res = calculateTextPosition(out, config, rect);\r\n const shape = this.shape;\r\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\r\n res.y = rect.y + rect.height * 0.4;\r\n }\r\n return res;\r\n },\r\n\r\n buildPath(ctx, shape, inBundle) {\r\n let symbolType = shape.symbolType;\r\n if (symbolType !== 'none') {\r\n let proxySymbol = symbolBuildProxies[symbolType];\r\n if (!proxySymbol) {\r\n // Default rect\r\n symbolType = 'rect';\r\n proxySymbol = symbolBuildProxies[symbolType];\r\n }\r\n symbolShapeMakers[symbolType](\r\n shape.x, shape.y, shape.width, shape.height, proxySymbol.shape\r\n );\r\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\r\n }\r\n }\r\n});\r\n\r\n// Provide setColor helper method to avoid determine if set the fill or stroke outside\r\nfunction symbolPathSetColor(this: ECSymbol, color: ZRColor, innerColor?: ZRColor) {\r\n if (this.type !== 'image') {\r\n const symbolStyle = this.style;\r\n if (this.__isEmptyBrush) {\r\n symbolStyle.stroke = color;\r\n symbolStyle.fill = innerColor || '#fff';\r\n // TODO Same width with lineStyle in LineView\r\n symbolStyle.lineWidth = 2;\r\n }\r\n else if (this.shape.symbolType === 'line') {\r\n symbolStyle.stroke = color;\r\n }\r\n else {\r\n symbolStyle.fill = color;\r\n }\r\n this.markRedraw();\r\n }\r\n}\r\n\r\n/**\r\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\r\n */\r\nexport function createSymbol(\r\n symbolType: string,\r\n x: number,\r\n y: number,\r\n w: number,\r\n h: number,\r\n color?: ZRColor,\r\n // whether to keep the ratio of w/h,\r\n keepAspect?: boolean\r\n) {\r\n // TODO Support image object, DynamicImage.\r\n\r\n const isEmpty = symbolType.indexOf('empty') === 0;\r\n if (isEmpty) {\r\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\r\n }\r\n let symbolPath: ECSymbol | graphic.Image;\r\n\r\n if (symbolType.indexOf('image://') === 0) {\r\n symbolPath = graphic.makeImage(\r\n symbolType.slice(8),\r\n new BoundingRect(x, y, w, h),\r\n keepAspect ? 'center' : 'cover'\r\n );\r\n }\r\n else if (symbolType.indexOf('path://') === 0) {\r\n symbolPath = graphic.makePath(\r\n symbolType.slice(7),\r\n {},\r\n new BoundingRect(x, y, w, h),\r\n keepAspect ? 'center' : 'cover'\r\n ) as unknown as ECSymbol;\r\n }\r\n else {\r\n symbolPath = new SymbolClz({\r\n shape: {\r\n symbolType: symbolType,\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }\r\n }) as unknown as ECSymbol;\r\n }\r\n\r\n (symbolPath as ECSymbol).__isEmptyBrush = isEmpty;\r\n\r\n // TODO Should deprecate setColor\r\n (symbolPath as ECSymbol).setColor = symbolPathSetColor;\r\n\r\n if (color) {\r\n (symbolPath as ECSymbol).setColor(color);\r\n }\r\n\r\n return symbolPath as ECSymbol;\r\n}\r\n\r\nexport function normalizeSymbolSize(symbolSize: number | number[]): [number, number] {\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [+symbolSize, +symbolSize];\r\n }\r\n return [symbolSize[0] || 0, symbolSize[1] || 0];\r\n}\r\n\r\nexport function normalizeSymbolOffset(\r\n symbolOffset: SymbolOptionMixin['symbolOffset'],\r\n symbolSize: number[]\r\n): [number, number] {\r\n if (symbolOffset == null) {\r\n return;\r\n }\r\n if (!isArray(symbolOffset)) {\r\n symbolOffset = [symbolOffset, symbolOffset];\r\n }\r\n return [\r\n parsePercent(symbolOffset[0], symbolSize[0]) || 0,\r\n parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0\r\n ];\r\n}\r\n", "import { LinearGradientObject } from '../graphic/LinearGradient';\nimport { RadialGradientObject } from '../graphic/RadialGradient';\nimport { GradientObject } from '../graphic/Gradient';\nimport { RectLike } from '../core/BoundingRect';\nimport Path from '../graphic/Path';\n\nfunction isSafeNum(num: number) {\n // NaN\u3001Infinity\u3001undefined\u3001'xx'\n return isFinite(num);\n}\n\nexport function createLinearGradient(\n this: void,\n ctx: CanvasRenderingContext2D,\n obj: LinearGradientObject,\n rect: RectLike\n) {\n let x = obj.x == null ? 0 : obj.x;\n let x2 = obj.x2 == null ? 1 : obj.x2;\n let y = obj.y == null ? 0 : obj.y;\n let y2 = obj.y2 == null ? 0 : obj.y2;\n\n if (!obj.global) {\n x = x * rect.width + rect.x;\n x2 = x2 * rect.width + rect.x;\n y = y * rect.height + rect.y;\n y2 = y2 * rect.height + rect.y;\n }\n\n // Fix NaN when rect is Infinity\n x = isSafeNum(x) ? x : 0;\n x2 = isSafeNum(x2) ? x2 : 1;\n y = isSafeNum(y) ? y : 0;\n y2 = isSafeNum(y2) ? y2 : 0;\n\n const canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n\n return canvasGradient;\n}\n\nexport function createRadialGradient(\n this: void,\n ctx: CanvasRenderingContext2D,\n obj: RadialGradientObject,\n rect: RectLike\n) {\n const width = rect.width;\n const height = rect.height;\n const min = Math.min(width, height);\n\n let x = obj.x == null ? 0.5 : obj.x;\n let y = obj.y == null ? 0.5 : obj.y;\n let r = obj.r == null ? 0.5 : obj.r;\n\n if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n\n x = isSafeNum(x) ? x : 0.5;\n y = isSafeNum(y) ? y : 0.5;\n r = r >= 0 && isSafeNum(r) ? r : 0.5;\n\n const canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n\n return canvasGradient;\n}\n\nexport function getCanvasGradient(this: void, ctx: CanvasRenderingContext2D, obj: GradientObject, rect: RectLike) {\n // TODO Cache?\n const canvasGradient = obj.type === 'radial'\n ? createRadialGradient(ctx, obj as RadialGradientObject, rect)\n : createLinearGradient(ctx, obj as LinearGradientObject, rect);\n\n const colorStops = obj.colorStops;\n for (let i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(\n colorStops[i].offset, colorStops[i].color\n );\n }\n return canvasGradient;\n}\n\nexport function isClipPathChanged(clipPaths: Path[], prevClipPaths: Path[]): boolean {\n // displayable.__clipPaths can only be `null`/`undefined` or an non-empty array.\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\n return false;\n }\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\n return true;\n }\n for (let i = 0; i < clipPaths.length; i++) {\n if (clipPaths[i] !== prevClipPaths[i]) {\n return true;\n }\n }\n return false;\n}\n\nfunction parseInt10(val: string) {\n return parseInt(val, 10);\n}\nexport function getSize(\n root: HTMLElement,\n whIdx: number,\n opts: { width?: number | string, height?: number | string}\n) {\n\n const wh = ['width', 'height'][whIdx] as 'width' | 'height';\n const cwh = ['clientWidth', 'clientHeight'][whIdx] as 'clientWidth' | 'clientHeight';\n const plt = ['paddingLeft', 'paddingTop'][whIdx] as 'paddingLeft' | 'paddingTop';\n const prb = ['paddingRight', 'paddingBottom'][whIdx] as 'paddingRight' | 'paddingBottom';\n\n if (opts[wh] != null && opts[wh] !== 'auto') {\n return parseFloat(opts[wh] as string);\n }\n\n // IE8 does not support getComputedStyle, but it use VML.\n const stl = document.defaultView.getComputedStyle(root);\n\n return (\n (root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\n - (parseInt10(stl[plt]) || 0)\n - (parseInt10(stl[prb]) || 0)\n ) | 0;\n}", "import { isArray, isNumber, map } from '../core/util';\nimport Path from '../graphic/Path';\nimport TSpan from '../graphic/TSpan';\n\nexport function normalizeLineDash(lineType: any, lineWidth?: number): number[] | false {\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\n return null;\n }\n return lineType === 'dashed'\n ? [4 * lineWidth, 2 * lineWidth]\n : lineType === 'dotted'\n ? [lineWidth]\n : isNumber(lineType)\n ? [lineType] : isArray(lineType) ? lineType : null;\n}\nexport function getLineDash(el: Path | TSpan): [number[] | false, number] {\n const style = el.style;\n\n let lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\n let lineDashOffset = style.lineDashOffset;\n\n if (lineDash) {\n const lineScale = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\n if (lineScale && lineScale !== 1) {\n lineDash = map(lineDash, function (rawVal) {\n return rawVal / lineScale;\n });\n lineDashOffset /= lineScale;\n }\n }\n return [lineDash, lineDashOffset];\n}", "import Displayable, { DEFAULT_COMMON_STYLE } from '../graphic/Displayable';\nimport PathProxy from '../core/PathProxy';\nimport { GradientObject } from '../graphic/Gradient';\nimport { ImagePatternObject, InnerImagePatternObject } from '../graphic/Pattern';\nimport { LinearGradientObject } from '../graphic/LinearGradient';\nimport { RadialGradientObject } from '../graphic/RadialGradient';\nimport { ZRCanvasRenderingContext } from '../core/types';\nimport { createOrUpdateImage, isImageReady } from '../graphic/helper/image';\nimport { getCanvasGradient, isClipPathChanged } from './helper';\nimport Path, { PathStyleProps } from '../graphic/Path';\nimport ZRImage, { ImageStyleProps } from '../graphic/Image';\nimport TSpan, {TSpanStyleProps} from '../graphic/TSpan';\nimport { MatrixArray } from '../core/matrix';\nimport { RADIAN_TO_DEGREE } from '../core/util';\nimport { getLineDash } from './dashStyle';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT } from '../graphic/constants';\nimport type IncrementalDisplayable from '../graphic/IncrementalDisplayable';\nimport { DEFAULT_FONT } from '../core/platform';\n\nconst pathProxyForDraw = new PathProxy(true);\n\n// Not use el#hasStroke because style may be different.\nfunction styleHasStroke(style: PathStyleProps) {\n const stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n}\n\n// ignore lineWidth and must be string\n// Expected color but found '[' when color is gradient\nfunction isValidStrokeFillStyle(\n strokeOrFill: PathStyleProps['stroke'] | PathStyleProps['fill']\n): strokeOrFill is string {\n return typeof strokeOrFill === 'string' && strokeOrFill !== 'none';\n}\n\nfunction styleHasFill(style: PathStyleProps) {\n const fill = style.fill;\n return fill != null && fill !== 'none';\n}\nfunction doFillPath(ctx: CanvasRenderingContext2D, style: PathStyleProps) {\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\n const originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n // Set back globalAlpha\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.fill();\n }\n}\n\nfunction doStrokePath(ctx: CanvasRenderingContext2D, style: PathStyleProps) {\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\n const originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n // Set back globalAlpha\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.stroke();\n }\n}\n\nexport function createCanvasPattern(\n this: void,\n ctx: CanvasRenderingContext2D,\n pattern: ImagePatternObject,\n el: {dirty: () => void}\n): CanvasPattern {\n const image = createOrUpdateImage(pattern.image, (pattern as InnerImagePatternObject).__image, el);\n if (isImageReady(image)) {\n const canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\n if (\n typeof DOMMatrix === 'function'\n && canvasPattern // image may be not ready\n && canvasPattern.setTransform // setTransform may not be supported in some old devices.\n ) {\n const matrix = new DOMMatrix();\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE);\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\n canvasPattern.setTransform(matrix);\n }\n return canvasPattern;\n }\n}\n\n// Draw Path Elements\nfunction brushPath(ctx: CanvasRenderingContext2D, el: Path, style: PathStyleProps, inBatch: boolean) {\n let hasStroke = styleHasStroke(style);\n let hasFill = styleHasFill(style);\n\n const strokePercent = style.strokePercent;\n const strokePart = strokePercent < 1;\n\n // TODO Reduce path memory cost.\n const firstDraw = !el.path;\n // Create path for each element when:\n // 1. Element has interactions.\n // 2. Element draw part of the line.\n if ((!el.silent || strokePart) && firstDraw) {\n el.createPathProxy();\n }\n\n const path = el.path || pathProxyForDraw;\n const dirtyFlag = el.__dirty;\n\n if (!inBatch) {\n const fill = style.fill;\n const stroke = style.stroke;\n\n const hasFillGradient = hasFill && !!(fill as GradientObject).colorStops;\n const hasStrokeGradient = hasStroke && !!(stroke as GradientObject).colorStops;\n const hasFillPattern = hasFill && !!(fill as ImagePatternObject).image;\n const hasStrokePattern = hasStroke && !!(stroke as ImagePatternObject).image;\n\n let fillGradient;\n let strokeGradient;\n let fillPattern;\n let strokePattern;\n let rect;\n if (hasFillGradient || hasStrokeGradient) {\n rect = el.getBoundingRect();\n }\n\n // Update gradient because bounding rect may changed\n if (hasFillGradient) {\n fillGradient = dirtyFlag\n ? getCanvasGradient(ctx, fill as (LinearGradientObject | RadialGradientObject), rect)\n : el.__canvasFillGradient;\n // No need to clear cache when fill is not gradient.\n // It will always been updated when fill changed back to gradient.\n el.__canvasFillGradient = fillGradient;\n }\n if (hasStrokeGradient) {\n strokeGradient = dirtyFlag\n ? getCanvasGradient(ctx, stroke as (LinearGradientObject | RadialGradientObject), rect)\n : el.__canvasStrokeGradient;\n el.__canvasStrokeGradient = strokeGradient;\n }\n if (hasFillPattern) {\n // Pattern might be null if image not ready (even created from dataURI)\n fillPattern = (dirtyFlag || !el.__canvasFillPattern)\n ? createCanvasPattern(ctx, fill as ImagePatternObject, el)\n : el.__canvasFillPattern;\n el.__canvasFillPattern = fillPattern;\n }\n if (hasStrokePattern) {\n // Pattern might be null if image not ready (even created from dataURI)\n strokePattern = (dirtyFlag || !el.__canvasStrokePattern)\n ? createCanvasPattern(ctx, stroke as ImagePatternObject, el)\n : el.__canvasStrokePattern;\n el.__canvasStrokePattern = fillPattern;\n }\n // Use the gradient or pattern\n if (hasFillGradient) {\n // PENDING If may have affect the state\n ctx.fillStyle = fillGradient;\n }\n else if (hasFillPattern) {\n if (fillPattern) { // createCanvasPattern may return false if image is not ready.\n ctx.fillStyle = fillPattern;\n }\n else {\n // Don't fill if image is not ready\n hasFill = false;\n }\n }\n if (hasStrokeGradient) {\n ctx.strokeStyle = strokeGradient;\n }\n else if (hasStrokePattern) {\n if (strokePattern) {\n ctx.strokeStyle = strokePattern;\n }\n else {\n // Don't stroke if image is not ready\n hasStroke = false;\n }\n }\n }\n\n // Update path sx, sy\n const scale = el.getGlobalScale();\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\n\n let lineDash;\n let lineDashOffset;\n if (ctx.setLineDash && style.lineDash) {\n [lineDash, lineDashOffset] = getLineDash(el);\n }\n\n let needsRebuild = true;\n\n if (firstDraw || (dirtyFlag & SHAPE_CHANGED_BIT)) {\n path.setDPR((ctx as any).dpr);\n if (strokePart) {\n // Use rebuildPath for percent stroke, so no context.\n path.setContext(null);\n }\n else {\n path.setContext(ctx);\n needsRebuild = false;\n }\n path.reset();\n\n el.buildPath(path, el.shape, inBatch);\n path.toStatic();\n\n // Clear path dirty flag\n el.pathUpdated();\n }\n\n // Not support separate fill and stroke. For the compatibility of SVG\n if (needsRebuild) {\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\n }\n\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n\n if (!inBatch) {\n if (style.strokeFirst) {\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n if (hasFill) {\n doFillPath(ctx, style);\n }\n }\n else {\n if (hasFill) {\n doFillPath(ctx, style);\n }\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n }\n }\n\n if (lineDash) {\n // PENDING\n // Remove lineDash\n ctx.setLineDash([]);\n }\n}\n\n// Draw Image Elements\nfunction brushImage(ctx: CanvasRenderingContext2D, el: ZRImage, style: ImageStyleProps) {\n const image = el.__image = createOrUpdateImage(\n style.image,\n el.__image,\n el,\n el.onload\n );\n\n if (!image || !isImageReady(image)) {\n return;\n }\n\n const x = style.x || 0;\n const y = style.y || 0;\n let width = el.getWidth();\n let height = el.getHeight();\n const aspect = image.width / image.height;\n if (width == null && height != null) {\n // Keep image/height ratio\n width = height * aspect;\n }\n else if (height == null && width != null) {\n height = width / aspect;\n }\n else if (width == null && height == null) {\n width = image.width;\n height = image.height;\n }\n\n if (style.sWidth && style.sHeight) {\n const sx = style.sx || 0;\n const sy = style.sy || 0;\n ctx.drawImage(\n image,\n sx, sy, style.sWidth, style.sHeight,\n x, y, width, height\n );\n }\n else if (style.sx && style.sy) {\n const sx = style.sx;\n const sy = style.sy;\n const sWidth = width - sx;\n const sHeight = height - sy;\n ctx.drawImage(\n image,\n sx, sy, sWidth, sHeight,\n x, y, width, height\n );\n }\n else {\n ctx.drawImage(image, x, y, width, height);\n }\n}\n\n// Draw Text Elements\nfunction brushText(ctx: CanvasRenderingContext2D, el: TSpan, style: TSpanStyleProps) {\n\n let text = style.text;\n // Convert to string\n text != null && (text += '');\n\n if (text) {\n ctx.font = style.font || DEFAULT_FONT;\n ctx.textAlign = style.textAlign;\n ctx.textBaseline = style.textBaseline;\n\n let lineDash;\n let lineDashOffset;\n if (ctx.setLineDash && style.lineDash) {\n [lineDash, lineDashOffset] = getLineDash(el);\n }\n\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n\n if (style.strokeFirst) {\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n }\n else {\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n }\n\n if (lineDash) {\n // Remove lineDash\n ctx.setLineDash([]);\n }\n }\n\n}\n\nconst SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'] as const;\nconst STROKE_PROPS = [\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\n] as const;\n\ntype AllStyleOption = PathStyleProps | TSpanStyleProps | ImageStyleProps;\n// type ShadowPropNames = typeof SHADOW_PROPS[number][0];\n// type StrokePropNames = typeof STROKE_PROPS[number][0];\n// type DrawPropNames = typeof DRAW_PROPS[number][0];\n\nfunction bindCommonProps(\n ctx: CanvasRenderingContext2D,\n style: AllStyleOption,\n prevStyle: AllStyleOption,\n forceSetAll: boolean,\n scope: BrushScope\n): boolean {\n let styleChanged = false;\n\n if (!forceSetAll) {\n prevStyle = prevStyle || {};\n\n // Shared same style.\n if (style === prevStyle) {\n return false;\n }\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n // Ensure opacity is between 0 ~ 1. Invalid opacity will lead to a failure set and use the leaked opacity from the previous.\n const opacity = Math.max(Math.min(style.opacity, 1), 0);\n ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity;\n }\n\n if (forceSetAll || style.blend !== prevStyle.blend) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\n }\n for (let i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\n const propName = SHADOW_NUMBER_PROPS[i];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n // FIXME Invalid property value will cause style leak from previous element.\n ctx[propName] = (ctx as ZRCanvasRenderingContext).dpr * (style[propName] || 0);\n }\n }\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\n }\n return styleChanged;\n}\n\nfunction bindPathAndTextCommonStyle(\n ctx: CanvasRenderingContext2D,\n el: TSpan | Path,\n prevEl: TSpan | Path,\n forceSetAll: boolean,\n scope: BrushScope\n) {\n const style = getStyle(el, scope.inHover);\n const prevStyle = forceSetAll\n ? null\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\n // Shared same style. prevStyle will be null if forceSetAll.\n if (style === prevStyle) {\n return false;\n }\n\n let styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\n\n if (forceSetAll || style.fill !== prevStyle.fill) {\n if (!styleChanged) {\n // Flush before set\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);\n }\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n if (el.hasStroke()) {\n const lineWidth = style.lineWidth;\n const newLineWidth = lineWidth / (\n (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1\n );\n if (ctx.lineWidth !== newLineWidth) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.lineWidth = newLineWidth;\n }\n }\n\n for (let i = 0; i < STROKE_PROPS.length; i++) {\n const prop = STROKE_PROPS[i];\n const propName = prop[0];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n // FIXME Invalid property value will cause style leak from previous element.\n (ctx as any)[propName] = style[propName] || prop[1];\n }\n }\n\n return styleChanged;\n}\n\nfunction bindImageStyle(\n ctx: CanvasRenderingContext2D,\n el: ZRImage,\n prevEl: ZRImage,\n // forceSetAll must be true if prevEl is null\n forceSetAll: boolean,\n scope: BrushScope\n) {\n return bindCommonProps(\n ctx,\n getStyle(el, scope.inHover),\n prevEl && getStyle(prevEl, scope.inHover),\n forceSetAll,\n scope\n );\n}\n\nfunction setContextTransform(ctx: CanvasRenderingContext2D, el: Displayable) {\n const m = el.transform;\n const dpr = (ctx as ZRCanvasRenderingContext).dpr || 1;\n if (m) {\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\n }\n else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n}\n\nfunction updateClipStatus(clipPaths: Path[], ctx: CanvasRenderingContext2D, scope: BrushScope) {\n let allClipped = false;\n for (let i = 0; i < clipPaths.length; i++) {\n const clipPath = clipPaths[i];\n // Ignore draw following elements if clipPath has zero area.\n allClipped = allClipped || clipPath.isZeroArea();\n\n setContextTransform(ctx, clipPath);\n ctx.beginPath();\n clipPath.buildPath(ctx, clipPath.shape);\n ctx.clip();\n }\n scope.allClipped = allClipped;\n}\n\nfunction isTransformChanged(m0: MatrixArray, m1: MatrixArray): boolean {\n if (m0 && m1) {\n return m0[0] !== m1[0]\n || m0[1] !== m1[1]\n || m0[2] !== m1[2]\n || m0[3] !== m1[3]\n || m0[4] !== m1[4]\n || m0[5] !== m1[5];\n }\n else if (!m0 && !m1) { // All identity matrix.\n return false;\n }\n\n return true;\n}\n\nconst DRAW_TYPE_PATH = 1;\nconst DRAW_TYPE_IMAGE = 2;\nconst DRAW_TYPE_TEXT = 3;\nconst DRAW_TYPE_INCREMENTAL = 4;\n\nexport type BrushScope = {\n inHover: boolean\n\n // width / height of viewport\n viewWidth: number\n viewHeight: number\n\n // Status for clipping\n prevElClipPaths?: Path[]\n prevEl?: Displayable\n allClipped?: boolean // If the whole element can be clipped\n\n // Status for batching\n batchFill?: string\n batchStroke?: string\n\n lastDrawType?: number\n}\n\n// If path can be batched\nfunction canPathBatch(style: PathStyleProps) {\n\n const hasFill = styleHasFill(style);\n const hasStroke = styleHasStroke(style);\n\n return !(\n // Line dash is dynamically set in brush function.\n style.lineDash\n // Can't batch if element is both set fill and stroke. Or both not set\n || !(+hasFill ^ +hasStroke)\n // Can't batch if element is drawn with gradient or pattern.\n || (hasFill && typeof style.fill !== 'string')\n || (hasStroke && typeof style.stroke !== 'string')\n // Can't batch if element only stroke part of line.\n || style.strokePercent < 1\n // Has stroke or fill opacity\n || style.strokeOpacity < 1\n || style.fillOpacity < 1\n );\n}\n\nfunction flushPathDrawn(ctx: CanvasRenderingContext2D, scope: BrushScope) {\n // Force flush all after drawn last element\n scope.batchFill && ctx.fill();\n scope.batchStroke && ctx.stroke();\n scope.batchFill = '';\n scope.batchStroke = '';\n}\n\nfunction getStyle(el: Displayable, inHover?: boolean) {\n return inHover ? (el.__hoverStyle || el.style) : el.style;\n}\n\nexport function brushSingle(ctx: CanvasRenderingContext2D, el: Displayable) {\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\n}\n\n// Brush different type of elements.\nexport function brush(\n ctx: CanvasRenderingContext2D,\n el: Displayable,\n scope: BrushScope,\n isLast: boolean\n) {\n const m = el.transform;\n\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\n // Needs to mark el rendered.\n // Or this element will always been rendered in progressive rendering.\n // But other dirty bit should not be cleared, otherwise it cause the shape\n // can not be updated in this case.\n el.__dirty &= ~REDRAW_BIT;\n el.__isRendered = false;\n return;\n }\n\n // HANDLE CLIPPING\n const clipPaths = el.__clipPaths;\n const prevElClipPaths = scope.prevElClipPaths;\n\n let forceSetTransform = false;\n let forceSetStyle = false;\n // Optimize when clipping on group with several elements\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\n // If has previous clipping state, restore from it\n if (prevElClipPaths && prevElClipPaths.length) {\n // Flush restore\n flushPathDrawn(ctx, scope);\n\n ctx.restore();\n // Must set all style and transform because context changed by restore\n forceSetStyle = forceSetTransform = true;\n\n scope.prevElClipPaths = null;\n scope.allClipped = false;\n // Reset prevEl since context has been restored\n scope.prevEl = null;\n }\n // New clipping state\n if (clipPaths && clipPaths.length) {\n // Flush before clip\n flushPathDrawn(ctx, scope);\n\n ctx.save();\n updateClipStatus(clipPaths, ctx, scope);\n // Must set transform because it's changed when clip.\n forceSetTransform = true;\n }\n scope.prevElClipPaths = clipPaths;\n }\n\n // Not rendering elements if it's clipped by a zero area path.\n // Or it may cause bug on some version of IE11 (like 11.0.9600.178**),\n // where exception \"unexpected call to method or property access\"\n // might be thrown when calling ctx.fill or ctx.stroke after a path\n // whose area size is zero is drawn and ctx.clip() is called and\n // shadowBlur is set. See #4572, #3112, #5777.\n // (e.g.,\n // ctx.moveTo(10, 10);\n // ctx.lineTo(20, 10);\n // ctx.closePath();\n // ctx.clip();\n // ctx.shadowBlur = 10;\n // ...\n // ctx.fill();\n // )\n if (scope.allClipped) {\n el.__isRendered = false;\n return;\n }\n\n // START BRUSH\n el.beforeBrush && el.beforeBrush();\n el.innerBeforeBrush();\n\n const prevEl = scope.prevEl;\n // TODO el type changed.\n if (!prevEl) {\n forceSetStyle = forceSetTransform = true;\n }\n\n let canBatchPath = el instanceof Path // Only path supports batch\n && el.autoBatch\n && canPathBatch(el.style);\n\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\n // Flush\n flushPathDrawn(ctx, scope);\n setContextTransform(ctx, el);\n }\n else if (!canBatchPath) {\n // Flush\n flushPathDrawn(ctx, scope);\n }\n\n const style = getStyle(el, scope.inHover);\n if (el instanceof Path) {\n // PENDING do we need to rebind all style if displayable type changed?\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_PATH;\n }\n\n bindPathAndTextCommonStyle(ctx, el as Path, prevEl as Path, forceSetStyle, scope);\n // Begin path at start\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\n ctx.beginPath();\n }\n brushPath(ctx, el as Path, style, canBatchPath);\n\n if (canBatchPath) {\n scope.batchFill = style.fill as string || '';\n scope.batchStroke = style.stroke as string || '';\n }\n }\n else {\n if (el instanceof TSpan) {\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_TEXT;\n }\n\n bindPathAndTextCommonStyle(ctx, el as TSpan, prevEl as TSpan, forceSetStyle, scope);\n brushText(ctx, el as TSpan, style);\n }\n else if (el instanceof ZRImage) {\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_IMAGE;\n }\n\n bindImageStyle(ctx, el as ZRImage, prevEl as ZRImage, forceSetStyle, scope);\n brushImage(ctx, el as ZRImage, style);\n }\n // Assume it's a IncrementalDisplayable\n else if ((el as IncrementalDisplayable).getTemporalDisplayables) {\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\n }\n\n brushIncremental(ctx, el as IncrementalDisplayable, scope);\n }\n\n }\n\n if (canBatchPath && isLast) {\n flushPathDrawn(ctx, scope);\n }\n\n el.innerAfterBrush();\n el.afterBrush && el.afterBrush();\n\n scope.prevEl = el;\n\n // Mark as painted.\n el.__dirty = 0;\n el.__isRendered = true;\n}\n\nfunction brushIncremental(\n ctx: CanvasRenderingContext2D,\n el: IncrementalDisplayable,\n scope: BrushScope\n) {\n let displayables = el.getDisplayables();\n let temporalDisplayables = el.getTemporalDisplayables();\n // Provide an inner scope.\n // Save current context and restore after brushed.\n ctx.save();\n let innerScope: BrushScope = {\n prevElClipPaths: null,\n prevEl: null,\n allClipped: false,\n viewWidth: scope.viewWidth,\n viewHeight: scope.viewHeight,\n inHover: scope.inHover\n };\n let i;\n let len;\n // Render persistant displayables.\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\n const displayable = displayables[i];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i === len - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n // Render temporary displayables.\n for (let i = 0, len = temporalDisplayables.length; i < len; i++) {\n const displayable = temporalDisplayables[i];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i === len - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n el.clearTemporalDisplayables();\n el.notClear = true;\n\n ctx.restore();\n}", "\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport WeakMap from 'zrender/src/core/WeakMap';\r\nimport { ImagePatternObject, PatternObject, SVGPatternObject } from 'zrender/src/graphic/Pattern';\r\nimport LRU from 'zrender/src/core/LRU';\r\nimport {defaults, map, isArray, isString, isNumber} from 'zrender/src/core/util';\r\nimport {getLeastCommonMultiple} from './number';\r\nimport {createSymbol} from './symbol';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport type SVGPainter from 'zrender/src/svg/Painter';\r\nimport { brushSingle } from 'zrender/src/canvas/graphic';\r\nimport {DecalDashArrayX, DecalDashArrayY, InnerDecalObject, DecalObject} from './types';\r\nimport { SVGVNode } from 'zrender/src/svg/core';\r\nimport { platformApi } from 'zrender/src/core/platform';\r\n\r\nconst decalMap = new WeakMap();\r\n\r\nconst decalCache = new LRU(100);\r\n\r\nconst decalKeys = [\r\n 'symbol', 'symbolSize', 'symbolKeepAspect',\r\n 'color', 'backgroundColor',\r\n 'dashArrayX', 'dashArrayY',\r\n 'maxTileWidth', 'maxTileHeight'\r\n];\r\n\r\n/**\r\n * Create or update pattern image from decal options\r\n *\r\n * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal\r\n * @return {Pattern} pattern with generated image, null if no decal\r\n */\r\nexport function createOrUpdatePatternFromDecal(\r\n decalObject: InnerDecalObject | 'none',\r\n api: ExtensionAPI\r\n): PatternObject {\r\n if (decalObject === 'none') {\r\n return null;\r\n }\r\n\r\n const dpr = api.getDevicePixelRatio();\r\n const zr = api.getZr();\r\n const isSVG = zr.painter.type === 'svg';\r\n\r\n if (decalObject.dirty) {\r\n decalMap.delete(decalObject);\r\n }\r\n\r\n const oldPattern = decalMap.get(decalObject);\r\n if (oldPattern) {\r\n return oldPattern;\r\n }\r\n\r\n const decalOpt = defaults(decalObject, {\r\n symbol: 'rect',\r\n symbolSize: 1,\r\n symbolKeepAspect: true,\r\n color: 'rgba(0, 0, 0, 0.2)',\r\n backgroundColor: null,\r\n dashArrayX: 5,\r\n dashArrayY: 5,\r\n rotation: 0,\r\n maxTileWidth: 512,\r\n maxTileHeight: 512\r\n } as DecalObject);\r\n if (decalOpt.backgroundColor === 'none') {\r\n decalOpt.backgroundColor = null;\r\n }\r\n\r\n const pattern: PatternObject = { repeat: 'repeat' } as PatternObject;\r\n setPatternnSource(pattern);\r\n pattern.rotation = decalOpt.rotation;\r\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\r\n\r\n decalMap.set(decalObject, pattern);\r\n\r\n decalObject.dirty = false;\r\n\r\n return pattern;\r\n\r\n function setPatternnSource(pattern: PatternObject) {\r\n const keys = [dpr];\r\n let isValidKey = true;\r\n for (let i = 0; i < decalKeys.length; ++i) {\r\n const value = (decalOpt as any)[decalKeys[i]];\r\n if (value != null\r\n && !isArray(value)\r\n && !isString(value)\r\n && !isNumber(value)\r\n && typeof value !== 'boolean'\r\n ) {\r\n isValidKey = false;\r\n break;\r\n }\r\n keys.push(value);\r\n }\r\n\r\n let cacheKey;\r\n if (isValidKey) {\r\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\r\n const cache = decalCache.get(cacheKey);\r\n if (cache) {\r\n isSVG ? (pattern as SVGPatternObject).svgElement = cache as SVGVNode\r\n : (pattern as ImagePatternObject).image = cache as HTMLCanvasElement;\r\n }\r\n }\r\n\r\n const dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\r\n const dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\r\n const symbolArray = normalizeSymbolArray(decalOpt.symbol);\r\n const lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\r\n const lineBlockLengthY = getLineBlockLengthY(dashArrayY);\r\n\r\n const canvas = !isSVG && platformApi.createCanvas();\r\n const svgRoot: SVGVNode = isSVG && {\r\n tag: 'g',\r\n attrs: {},\r\n key: 'dcl',\r\n children: []\r\n };\r\n const pSize = getPatternSize();\r\n let ctx: CanvasRenderingContext2D;\r\n if (canvas) {\r\n canvas.width = pSize.width * dpr;\r\n canvas.height = pSize.height * dpr;\r\n ctx = canvas.getContext('2d');\r\n }\r\n brushDecal();\r\n\r\n if (isValidKey) {\r\n decalCache.put(cacheKey, canvas || svgRoot);\r\n }\r\n\r\n (pattern as ImagePatternObject).image = canvas;\r\n (pattern as SVGPatternObject).svgElement = svgRoot;\r\n (pattern as SVGPatternObject).svgWidth = pSize.width;\r\n (pattern as SVGPatternObject).svgHeight = pSize.height;\r\n\r\n /**\r\n * Get minimum length that can make a repeatable pattern.\r\n *\r\n * @return {Object} pattern width and height\r\n */\r\n function getPatternSize(): {\r\n width: number,\r\n height: number\r\n } {\r\n /**\r\n * For example, if dash is [[3, 2], [2, 1]] for X, it looks like\r\n * |--- --- --- --- --- ...\r\n * |-- -- -- -- -- -- -- -- ...\r\n * |--- --- --- --- --- ...\r\n * |-- -- -- -- -- -- -- -- ...\r\n * So the minimum length of X is 15,\r\n * which is the least common multiple of `3 + 2` and `2 + 1`\r\n * |--- --- --- |--- --- ...\r\n * |-- -- -- -- -- |-- -- -- ...\r\n */\r\n let width = 1;\r\n for (let i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\r\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\r\n }\r\n\r\n let symbolRepeats = 1;\r\n for (let i = 0, xlen = symbolArray.length; i < xlen; ++i) {\r\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\r\n }\r\n width *= symbolRepeats;\r\n\r\n const height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\r\n\r\n if (__DEV__) {\r\n const warn = (attrName: string) => {\r\n /* eslint-disable-next-line */\r\n console.warn(`Calculated decal size is greater than ${attrName} due to decal option settings so ${attrName} is used for the decal size. Please consider changing the decal option to make a smaller decal or set ${attrName} to be larger to avoid incontinuity.`);\r\n };\r\n if (width > decalOpt.maxTileWidth) {\r\n warn('maxTileWidth');\r\n }\r\n if (height > decalOpt.maxTileHeight) {\r\n warn('maxTileHeight');\r\n }\r\n }\r\n\r\n return {\r\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\r\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\r\n };\r\n }\r\n\r\n function brushDecal() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n if (decalOpt.backgroundColor) {\r\n ctx.fillStyle = decalOpt.backgroundColor;\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n\r\n let ySum = 0;\r\n for (let i = 0; i < dashArrayY.length; ++i) {\r\n ySum += dashArrayY[i];\r\n }\r\n if (ySum <= 0) {\r\n // dashArrayY is 0, draw nothing\r\n return;\r\n }\r\n\r\n let y = -lineBlockLengthY;\r\n let yId = 0;\r\n let yIdTotal = 0;\r\n let xId0 = 0;\r\n while (y < pSize.height) {\r\n if (yId % 2 === 0) {\r\n const symbolYId = (yIdTotal / 2) % symbolArray.length;\r\n let x = 0;\r\n let xId1 = 0;\r\n let xId1Total = 0;\r\n while (x < pSize.width * 2) {\r\n let xSum = 0;\r\n for (let i = 0; i < dashArrayX[xId0].length; ++i) {\r\n xSum += dashArrayX[xId0][i];\r\n }\r\n if (xSum <= 0) {\r\n // Skip empty line\r\n break;\r\n }\r\n\r\n // E.g., [15, 5, 20, 5] draws only for 15 and 20\r\n if (xId1 % 2 === 0) {\r\n const size = (1 - decalOpt.symbolSize) * 0.5;\r\n const left = x + dashArrayX[xId0][xId1] * size;\r\n const top = y + dashArrayY[yId] * size;\r\n const width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\r\n const height = dashArrayY[yId] * decalOpt.symbolSize;\r\n const symbolXId = (xId1Total / 2) % symbolArray[symbolYId].length;\r\n\r\n brushSymbol(left, top, width, height, symbolArray[symbolYId][symbolXId]);\r\n }\r\n\r\n x += dashArrayX[xId0][xId1];\r\n ++xId1Total;\r\n ++xId1;\r\n if (xId1 === dashArrayX[xId0].length) {\r\n xId1 = 0;\r\n }\r\n }\r\n\r\n ++xId0;\r\n if (xId0 === dashArrayX.length) {\r\n xId0 = 0;\r\n }\r\n }\r\n y += dashArrayY[yId];\r\n\r\n ++yIdTotal;\r\n ++yId;\r\n if (yId === dashArrayY.length) {\r\n yId = 0;\r\n }\r\n }\r\n\r\n function brushSymbol(x: number, y: number, width: number, height: number, symbolType: string) {\r\n const scale = isSVG ? 1 : dpr;\r\n const symbol = createSymbol(\r\n symbolType,\r\n x * scale,\r\n y * scale,\r\n width * scale,\r\n height * scale,\r\n decalOpt.color,\r\n decalOpt.symbolKeepAspect\r\n );\r\n if (isSVG) {\r\n const symbolVNode = (zr.painter as SVGPainter).renderOneToVNode(symbol);\r\n if (symbolVNode) {\r\n svgRoot.children.push(symbolVNode);\r\n }\r\n }\r\n else {\r\n // Paint to canvas for all other renderers.\r\n brushSingle(ctx, symbol);\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Convert symbol array into normalized array\r\n *\r\n * @param {string | (string | string[])[]} symbol symbol input\r\n * @return {string[][]} normolized symbol array\r\n */\r\nfunction normalizeSymbolArray(symbol: string | (string | string[])[]): string[][] {\r\n if (!symbol || (symbol as string[]).length === 0) {\r\n return [['rect']];\r\n }\r\n if (isString(symbol)) {\r\n return [[symbol]];\r\n }\r\n\r\n let isAllString = true;\r\n for (let i = 0; i < symbol.length; ++i) {\r\n if (!isString(symbol[i])) {\r\n isAllString = false;\r\n break;\r\n }\r\n }\r\n if (isAllString) {\r\n return normalizeSymbolArray([symbol as string[]]);\r\n }\r\n\r\n const result: string[][] = [];\r\n for (let i = 0; i < symbol.length; ++i) {\r\n if (isString(symbol[i])) {\r\n result.push([symbol[i] as string]);\r\n }\r\n else {\r\n result.push(symbol[i] as string[]);\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Convert dash input into dashArray\r\n *\r\n * @param {DecalDashArrayX} dash dash input\r\n * @return {number[][]} normolized dash array\r\n */\r\nfunction normalizeDashArrayX(dash: DecalDashArrayX): number[][] {\r\n if (!dash || (dash as number[]).length === 0) {\r\n return [[0, 0]];\r\n }\r\n if (isNumber(dash)) {\r\n const dashValue = Math.ceil(dash);\r\n return [[dashValue, dashValue]];\r\n }\r\n\r\n /**\r\n * [20, 5] should be normalized into [[20, 5]],\r\n * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]\r\n */\r\n let isAllNumber = true;\r\n for (let i = 0; i < dash.length; ++i) {\r\n if (!isNumber(dash[i])) {\r\n isAllNumber = false;\r\n break;\r\n }\r\n }\r\n if (isAllNumber) {\r\n return normalizeDashArrayX([dash as number[]]);\r\n }\r\n\r\n const result: number[][] = [];\r\n for (let i = 0; i < dash.length; ++i) {\r\n if (isNumber(dash[i])) {\r\n const dashValue = Math.ceil(dash[i] as number);\r\n result.push([dashValue, dashValue]);\r\n }\r\n else {\r\n const dashValue = map(dash[i] as number[], n => Math.ceil(n));\r\n if (dashValue.length % 2 === 1) {\r\n // [4, 2, 1] means |---- - -- |---- - -- |\r\n // so normalize it to be [4, 2, 1, 4, 2, 1]\r\n result.push(dashValue.concat(dashValue));\r\n }\r\n else {\r\n result.push(dashValue);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Convert dash input into dashArray\r\n *\r\n * @param {DecalDashArrayY} dash dash input\r\n * @return {number[]} normolized dash array\r\n */\r\nfunction normalizeDashArrayY(dash: DecalDashArrayY): number[] {\r\n if (!dash || typeof dash === 'object' && dash.length === 0) {\r\n return [0, 0];\r\n }\r\n if (isNumber(dash)) {\r\n const dashValue = Math.ceil(dash);\r\n return [dashValue, dashValue];\r\n }\r\n\r\n const dashValue = map(dash as number[], n => Math.ceil(n));\r\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\r\n}\r\n\r\n/**\r\n * Get block length of each line. A block is the length of dash line and space.\r\n * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after\r\n * that, so the block length of this line is 5.\r\n *\r\n * @param {number[][]} dash dash array of X or Y\r\n * @return {number[]} block length of each line\r\n */\r\nfunction getLineBlockLengthX(dash: number[][]): number[] {\r\n return map(dash, function (line) {\r\n return getLineBlockLengthY(line);\r\n });\r\n}\r\n\r\nfunction getLineBlockLengthY(dash: number[]): number {\r\n let blockLength = 0;\r\n for (let i = 0; i < dash.length; ++i) {\r\n blockLength += dash[i];\r\n }\r\n if (dash.length % 2 === 1) {\r\n // [4, 2, 1] means |---- - -- |---- - -- |\r\n // So total length is (4 + 2 + 1) * 2\r\n return blockLength * 2;\r\n }\r\n return blockLength;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport GlobalModel from '../model/Global';\r\nimport {createOrUpdatePatternFromDecal} from '../util/decal';\r\n\r\nexport default function decalVisual(ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachRawSeries(seriesModel => {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n\r\n if (data.hasItemVisual()) {\r\n data.each(idx => {\r\n const decal = data.getItemVisual(idx, 'decal');\r\n if (decal) {\r\n const itemStyle = data.ensureUniqueItemVisual(idx, 'style');\r\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n }\r\n const decal = data.getVisual('decal');\r\n if (decal) {\r\n const style = data.getVisual('style');\r\n style.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Eventful, { EventCallback } from 'zrender/src/core/Eventful';\r\nimport SeriesModel from '../model/Series';\r\nimport GlobalModel from '../model/Global';\r\nimport { EChartsType } from './echarts';\r\nimport ExtensionAPI from './ExtensionAPI';\r\nimport { ModelFinderIdQuery, ModelFinderIndexQuery } from '../util/model';\r\nimport { DimensionLoose } from '../util/types';\r\n\r\nexport interface UpdateLifecycleTransitionSeriesFinder {\r\n seriesIndex?: ModelFinderIndexQuery,\r\n seriesId?: ModelFinderIdQuery\r\n dimension: DimensionLoose;\r\n}\r\n\r\nexport interface UpdateLifecycleTransitionItem {\r\n // If `from` not given, it means that do not make series transition mandatorily.\r\n // There might be transition mapping dy default. Sometimes we do not need them,\r\n // which might bring about misleading.\r\n from?: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];\r\n to: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];\r\n};\r\n\r\nexport type UpdateLifecycleTransitionOpt = UpdateLifecycleTransitionItem | UpdateLifecycleTransitionItem[];\r\n\r\nexport interface UpdateLifecycleParams {\r\n updatedSeries?: SeriesModel[]\r\n\r\n /**\r\n * If this update is from setOption and option is changed.\r\n */\r\n optionChanged?: boolean\r\n\r\n // Specify series to transition in this setOption.\r\n seriesTransition?: UpdateLifecycleTransitionOpt\r\n}\r\ninterface LifecycleEvents {\r\n 'afterinit': [EChartsType],\r\n 'series:beforeupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams],\r\n 'series:layoutlabels': [GlobalModel, ExtensionAPI, UpdateLifecycleParams],\r\n 'series:transition': [GlobalModel, ExtensionAPI, UpdateLifecycleParams],\r\n 'series:afterupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams]\r\n // 'series:beforeeachupdate': [GlobalModel, ExtensionAPI, SeriesModel]\r\n // 'series:aftereachupdate': [GlobalModel, ExtensionAPI, SeriesModel]\r\n 'afterupdate': [GlobalModel, ExtensionAPI]\r\n}\r\n\r\nconst lifecycle = new Eventful<{\r\n [key in keyof LifecycleEvents]: EventCallback\r\n}>();\r\n\r\n\r\nexport default lifecycle;\r\n\r\nexport {LifecycleEvents};", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { error } from '../util/log';\r\n\r\n\r\n// Implementation of exported APIs. For example registerMap, getMap.\r\n// The implementations will be registered when installing the component.\r\n// Avoid these code being bundled to the core module.\r\n\r\nconst implsStore: Record = {};\r\n\r\n// TODO Type\r\nexport function registerImpl(name: string, impl: any) {\r\n if (__DEV__) {\r\n if (implsStore[name]) {\r\n error(`Already has an implementation of ${name}.`);\r\n }\r\n }\r\n implsStore[name] = impl;\r\n}\r\n\r\nexport function getImpl(name: string) {\r\n if (__DEV__) {\r\n if (!implsStore[name]) {\r\n error(`Implementation of ${name} doesn't exists.`);\r\n }\r\n }\r\n return implsStore[name];\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport * as zrender from 'zrender/src/zrender';\r\nimport {\r\n assert,\r\n each,\r\n isFunction,\r\n isObject,\r\n indexOf,\r\n bind,\r\n clone,\r\n setAsPrimitive,\r\n extend,\r\n HashMap,\r\n createHashMap,\r\n map,\r\n defaults,\r\n isDom,\r\n isArray,\r\n noop,\r\n isString,\r\n retrieve2\r\n} from 'zrender/src/core/util';\r\nimport env from 'zrender/src/core/env';\r\nimport timsort from 'zrender/src/core/timsort';\r\nimport Eventful, { EventCallbackSingleParam } from 'zrender/src/core/Eventful';\r\nimport Element, { ElementEvent } from 'zrender/src/Element';\r\nimport GlobalModel, {QueryConditionKindA, GlobalModelSetOptionOpts} from '../model/Global';\r\nimport ExtensionAPI from './ExtensionAPI';\r\nimport CoordinateSystemManager from './CoordinateSystem';\r\nimport OptionManager from '../model/OptionManager';\r\nimport backwardCompat from '../preprocessor/backwardCompat';\r\nimport dataStack from '../processor/dataStack';\r\nimport ComponentModel from '../model/Component';\r\nimport SeriesModel from '../model/Series';\r\nimport ComponentView, {ComponentViewConstructor} from '../view/Component';\r\nimport ChartView, {ChartViewConstructor} from '../view/Chart';\r\nimport * as graphic from '../util/graphic';\r\nimport {getECData} from '../util/innerStore';\r\nimport {\r\n isHighDownDispatcher,\r\n HOVER_STATE_EMPHASIS,\r\n HOVER_STATE_BLUR,\r\n blurSeriesFromHighlightPayload,\r\n toggleSelectionFromPayload,\r\n updateSeriesElementSelection,\r\n getAllSelectedIndices,\r\n isSelectChangePayload,\r\n isHighDownPayload,\r\n HIGHLIGHT_ACTION_TYPE,\r\n DOWNPLAY_ACTION_TYPE,\r\n SELECT_ACTION_TYPE,\r\n UNSELECT_ACTION_TYPE,\r\n TOGGLE_SELECT_ACTION_TYPE,\r\n savePathStates,\r\n enterEmphasis,\r\n leaveEmphasis,\r\n leaveBlur,\r\n enterSelect,\r\n leaveSelect,\r\n enterBlur,\r\n allLeaveBlur,\r\n findComponentHighDownDispatchers,\r\n blurComponent,\r\n handleGlobalMouseOverForHighDown,\r\n handleGlobalMouseOutForHighDown\r\n} from '../util/states';\r\nimport * as modelUtil from '../util/model';\r\nimport {throttle} from '../util/throttle';\r\nimport {seriesStyleTask, dataStyleTask, dataColorPaletteTask} from '../visual/style';\r\nimport loadingDefault from '../loading/default';\r\nimport Scheduler from './Scheduler';\r\nimport lightTheme from '../theme/light';\r\nimport darkTheme from '../theme/dark';\r\nimport {CoordinateSystemMaster, CoordinateSystemCreator, CoordinateSystemHostModel} from '../coord/CoordinateSystem';\r\nimport { parseClassType } from '../util/clazz';\r\nimport {ECEventProcessor} from '../util/ECEventProcessor';\r\nimport {\r\n Payload, ECElement, RendererType, ECActionEvent,\r\n ActionHandler, ActionInfo, OptionPreprocessor, PostUpdater,\r\n LoadingEffect, LoadingEffectCreator, StageHandlerInternal,\r\n StageHandlerOverallReset, StageHandler,\r\n ViewRootGroup, DimensionDefinitionLoose, ECEventData, ThemeOption,\r\n ECBasicOption,\r\n ECUnitOption,\r\n ZRColor,\r\n ComponentMainType,\r\n ComponentSubType,\r\n ColorString,\r\n SelectChangedPayload,\r\n ScaleDataValue,\r\n ZRElementEventName,\r\n ECElementEvent,\r\n AnimationOption\r\n} from '../util/types';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport { seriesSymbolTask, dataSymbolTask } from '../visual/symbol';\r\nimport { getVisualFromData, getItemVisualFromData } from '../visual/helper';\r\nimport { deprecateLog, deprecateReplaceLog, error, warn } from '../util/log';\r\nimport { handleLegacySelectEvents } from '../legacy/dataSelectAction';\r\n\r\nimport { registerExternalTransform } from '../data/helper/transform';\r\nimport { createLocaleObject, SYSTEM_LANG, LocaleOption } from './locale';\r\n\r\nimport type {EChartsOption} from '../export/option';\r\nimport { findEventDispatcher } from '../util/event';\r\nimport decal from '../visual/decal';\r\nimport CanvasPainter from 'zrender/src/canvas/Painter';\r\nimport SVGPainter from 'zrender/src/svg/Painter';\r\nimport lifecycle, {\r\n LifecycleEvents,\r\n UpdateLifecycleTransitionItem,\r\n UpdateLifecycleParams,\r\n UpdateLifecycleTransitionOpt\r\n} from './lifecycle';\r\nimport { platformApi, setPlatformAPI } from 'zrender/src/core/platform';\r\nimport { getImpl } from './impl';\r\nimport type geoSourceManager from '../coord/geo/geoSourceManager';\r\n\r\ndeclare let global: any;\r\n\r\ntype ModelFinder = modelUtil.ModelFinder;\r\n\r\nexport const version = '5.5.1';\r\n\r\nexport const dependencies = {\r\n zrender: '5.6.0'\r\n};\r\n\r\nconst TEST_FRAME_REMAIN_TIME = 1;\r\n\r\nconst PRIORITY_PROCESSOR_SERIES_FILTER = 800;\r\n// Some data processors depends on the stack result dimension (to calculate data extent).\r\n// So data stack stage should be in front of data processing stage.\r\nconst PRIORITY_PROCESSOR_DATASTACK = 900;\r\n// \"Data filter\" will block the stream, so it should be\r\n// put at the beginning of data processing.\r\nconst PRIORITY_PROCESSOR_FILTER = 1000;\r\nconst PRIORITY_PROCESSOR_DEFAULT = 2000;\r\nconst PRIORITY_PROCESSOR_STATISTIC = 5000;\r\n\r\nconst PRIORITY_VISUAL_LAYOUT = 1000;\r\nconst PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\r\nconst PRIORITY_VISUAL_GLOBAL = 2000;\r\nconst PRIORITY_VISUAL_CHART = 3000;\r\nconst PRIORITY_VISUAL_COMPONENT = 4000;\r\n// Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to\r\n// overwrite the viusal result of component (like `visualMap`)\r\n// using data item specific setting (like itemStyle.xxx on data item)\r\nconst PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;\r\n// Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on\r\n// visual result like `symbolSize`.\r\nconst PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\r\nconst PRIORITY_VISUAL_BRUSH = 5000;\r\nconst PRIORITY_VISUAL_ARIA = 6000;\r\nconst PRIORITY_VISUAL_DECAL = 7000;\r\n\r\nexport const PRIORITY = {\r\n PROCESSOR: {\r\n FILTER: PRIORITY_PROCESSOR_FILTER,\r\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\r\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\r\n },\r\n VISUAL: {\r\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\r\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\r\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\r\n CHART: PRIORITY_VISUAL_CHART,\r\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\r\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\r\n BRUSH: PRIORITY_VISUAL_BRUSH,\r\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\r\n ARIA: PRIORITY_VISUAL_ARIA,\r\n DECAL: PRIORITY_VISUAL_DECAL\r\n }\r\n};\r\n\r\n// Main process have three entries: `setOption`, `dispatchAction` and `resize`,\r\n// where they must not be invoked nestedly, except the only case: invoke\r\n// dispatchAction with updateMethod \"none\" in main process.\r\n// This flag is used to carry out this rule.\r\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\r\nconst IN_MAIN_PROCESS_KEY = '__flagInMainProcess' as const;\r\nconst PENDING_UPDATE = '__pendingUpdate' as const;\r\nconst STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus' as const;\r\nconst ACTION_REG = /^[a-zA-Z0-9_]+$/;\r\n\r\nconst CONNECT_STATUS_KEY = '__connectUpdateStatus' as const;\r\nconst CONNECT_STATUS_PENDING = 0 as const;\r\nconst CONNECT_STATUS_UPDATING = 1 as const;\r\nconst CONNECT_STATUS_UPDATED = 2 as const;\r\ntype ConnectStatus =\r\n typeof CONNECT_STATUS_PENDING\r\n | typeof CONNECT_STATUS_UPDATING\r\n | typeof CONNECT_STATUS_UPDATED;\r\n\r\nexport type SetOptionTransitionOpt = UpdateLifecycleTransitionOpt;\r\nexport type SetOptionTransitionOptItem = UpdateLifecycleTransitionItem;\r\n\r\nexport interface SetOptionOpts {\r\n notMerge?: boolean;\r\n lazyUpdate?: boolean;\r\n silent?: boolean;\r\n // Rule: only `id` mapped will be merged,\r\n // other components of the certain `mainType` will be removed.\r\n replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];\r\n transition?: SetOptionTransitionOpt\r\n};\r\n\r\nexport interface ResizeOpts {\r\n width?: number | 'auto', // Can be 'auto' (the same as null/undefined)\r\n height?: number | 'auto', // Can be 'auto' (the same as null/undefined)\r\n animation?: AnimationOption\r\n silent?: boolean // by default false.\r\n};\r\n\r\ninterface PostIniter {\r\n (chart: EChartsType): void\r\n}\r\n\r\ntype EventMethodName = 'on' | 'off';\r\nfunction createRegisterEventWithLowercaseECharts(method: EventMethodName) {\r\n return function (this: ECharts, ...args: any): ECharts {\r\n if (this.isDisposed()) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n}\r\nfunction createRegisterEventWithLowercaseMessageCenter(method: EventMethodName) {\r\n return function (this: MessageCenter, ...args: any): MessageCenter {\r\n return toLowercaseNameAndCallEventful(this, method, args);\r\n };\r\n}\r\nfunction toLowercaseNameAndCallEventful(host: T, method: EventMethodName, args: any): T {\r\n // `args[0]` is event name. Event name is all lowercase.\r\n args[0] = args[0] && args[0].toLowerCase();\r\n return Eventful.prototype[method].apply(host, args) as any;\r\n}\r\n\r\n\r\nclass MessageCenter extends Eventful {}\r\nconst messageCenterProto = MessageCenter.prototype;\r\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\r\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');\r\n\r\n// ---------------------------------------\r\n// Internal method names for class ECharts\r\n// ---------------------------------------\r\nlet prepare: (ecIns: ECharts) => void;\r\nlet prepareView: (ecIns: ECharts, isComponent: boolean) => void;\r\nlet updateDirectly: (\r\n ecIns: ECharts, method: string, payload: Payload, mainType: ComponentMainType, subType?: ComponentSubType\r\n) => void;\r\ntype UpdateMethod = (this: ECharts, payload?: Payload, renderParams?: UpdateLifecycleParams) => void;\r\nlet updateMethods: {\r\n prepareAndUpdate: UpdateMethod,\r\n update: UpdateMethod,\r\n updateTransform: UpdateMethod,\r\n updateView: UpdateMethod,\r\n updateVisual: UpdateMethod,\r\n updateLayout: UpdateMethod\r\n};\r\nlet doConvertPixel: (\r\n ecIns: ECharts,\r\n methodName: string,\r\n finder: ModelFinder,\r\n value: (number | number[]) | (ScaleDataValue | ScaleDataValue[])\r\n) => (number | number[]);\r\nlet updateStreamModes: (ecIns: ECharts, ecModel: GlobalModel) => void;\r\nlet doDispatchAction: (this: ECharts, payload: Payload, silent: boolean) => void;\r\nlet flushPendingActions: (this: ECharts, silent: boolean) => void;\r\nlet triggerUpdatedEvent: (this: ECharts, silent: boolean) => void;\r\nlet bindRenderedEvent: (zr: zrender.ZRenderType, ecIns: ECharts) => void;\r\nlet bindMouseEvent: (zr: zrender.ZRenderType, ecIns: ECharts) => void;\r\nlet render: (\r\n ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload, updateParams: UpdateLifecycleParams\r\n) => void;\r\nlet renderComponents: (\r\n ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload,\r\n updateParams: UpdateLifecycleParams, dirtyList?: ComponentView[]\r\n) => void;\r\nlet renderSeries: (\r\n ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload | 'remain',\r\n updateParams: UpdateLifecycleParams,\r\n dirtyMap?: {[uid: string]: any}\r\n) => void;\r\nlet createExtensionAPI: (ecIns: ECharts) => ExtensionAPI;\r\nlet enableConnect: (ecIns: ECharts) => void;\r\n\r\nlet markStatusToUpdate: (ecIns: ECharts) => void;\r\nlet applyChangedStates: (ecIns: ECharts) => void;\r\n\r\ntype RenderedEventParam = { elapsedTime: number };\r\ntype ECEventDefinition = {\r\n [key in ZRElementEventName]: EventCallbackSingleParam\r\n} & {\r\n rendered: EventCallbackSingleParam\r\n finished: () => void | boolean\r\n} & {\r\n // TODO: Use ECActionEvent\r\n [key: string]: (...args: unknown[]) => void | boolean\r\n};\r\nexport type EChartsInitOpts = {\r\n locale?: string | LocaleOption,\r\n renderer?: RendererType,\r\n devicePixelRatio?: number,\r\n useDirtyRect?: boolean,\r\n useCoarsePointer?: boolean,\r\n pointerSize?: number,\r\n ssr?: boolean,\r\n width?: number | string,\r\n height?: number | string\r\n};\r\nclass ECharts extends Eventful {\r\n\r\n /**\r\n * @readonly\r\n */\r\n id: string;\r\n\r\n /**\r\n * Group id\r\n * @readonly\r\n */\r\n group: string;\r\n\r\n private _ssr: boolean;\r\n\r\n private _zr: zrender.ZRenderType;\r\n\r\n private _dom: HTMLElement;\r\n\r\n private _model: GlobalModel;\r\n\r\n private _throttledZrFlush: zrender.ZRenderType extends {flush: infer R} ? R : never;\r\n\r\n private _theme: ThemeOption;\r\n\r\n private _locale: LocaleOption;\r\n\r\n private _chartsViews: ChartView[] = [];\r\n\r\n private _chartsMap: {[viewId: string]: ChartView} = {};\r\n\r\n private _componentsViews: ComponentView[] = [];\r\n\r\n private _componentsMap: {[viewId: string]: ComponentView} = {};\r\n\r\n private _coordSysMgr: CoordinateSystemManager;\r\n\r\n private _api: ExtensionAPI;\r\n\r\n private _scheduler: Scheduler;\r\n\r\n private _messageCenter: MessageCenter;\r\n\r\n // Can't dispatch action during rendering procedure\r\n private _pendingActions: Payload[] = [];\r\n\r\n // We use never here so ECEventProcessor will not been exposed.\r\n // which may include many unexpected types won't be exposed in the types to developers.\r\n protected _$eventProcessor: never;\r\n\r\n private _disposed: boolean;\r\n\r\n private _loadingFX: LoadingEffect;\r\n\r\n\r\n private [PENDING_UPDATE]: {\r\n silent: boolean\r\n updateParams: UpdateLifecycleParams\r\n };\r\n private [IN_MAIN_PROCESS_KEY]: boolean;\r\n private [CONNECT_STATUS_KEY]: ConnectStatus;\r\n private [STATUS_NEEDS_UPDATE_KEY]: boolean;\r\n\r\n constructor(\r\n dom: HTMLElement,\r\n // Theme name or themeOption.\r\n theme?: string | ThemeOption,\r\n opts?: EChartsInitOpts\r\n ) {\r\n super(new ECEventProcessor());\r\n\r\n opts = opts || {};\r\n\r\n // Get theme by name\r\n if (isString(theme)) {\r\n theme = themeStorage[theme] as object;\r\n }\r\n\r\n this._dom = dom;\r\n\r\n let defaultRenderer = 'canvas';\r\n let defaultCoarsePointer: 'auto' | boolean = 'auto';\r\n let defaultUseDirtyRect = false;\r\n\r\n if (__DEV__) {\r\n const root = (\r\n /* eslint-disable-next-line */\r\n env.hasGlobalWindow ? window : global\r\n ) as any;\r\n\r\n if (root) {\r\n defaultRenderer = retrieve2(root.__ECHARTS__DEFAULT__RENDERER__, defaultRenderer);\r\n defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer);\r\n defaultUseDirtyRect = retrieve2(root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__, defaultUseDirtyRect);\r\n }\r\n\r\n }\r\n\r\n if (opts.ssr) {\r\n zrender.registerSSRDataGetter(el => {\r\n const ecData = getECData(el);\r\n const dataIndex = ecData.dataIndex;\r\n if (dataIndex == null) {\r\n return;\r\n }\r\n const hashMap = createHashMap();\r\n hashMap.set('series_index', ecData.seriesIndex);\r\n hashMap.set('data_index', dataIndex);\r\n ecData.ssrType && hashMap.set('ssr_type', ecData.ssrType);\r\n return hashMap;\r\n });\r\n }\r\n\r\n const zr = this._zr = zrender.init(dom, {\r\n renderer: opts.renderer || defaultRenderer,\r\n devicePixelRatio: opts.devicePixelRatio,\r\n width: opts.width,\r\n height: opts.height,\r\n ssr: opts.ssr,\r\n useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect),\r\n useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer),\r\n pointerSize: opts.pointerSize\r\n });\r\n this._ssr = opts.ssr;\r\n\r\n // Expect 60 fps.\r\n this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\r\n\r\n theme = clone(theme);\r\n theme && backwardCompat(theme as ECUnitOption, true);\r\n\r\n this._theme = theme;\r\n\r\n this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\r\n\r\n this._coordSysMgr = new CoordinateSystemManager();\r\n\r\n const api = this._api = createExtensionAPI(this);\r\n\r\n // Sort on demand\r\n function prioritySortFunc(a: StageHandlerInternal, b: StageHandlerInternal): number {\r\n return a.__prio - b.__prio;\r\n }\r\n timsort(visualFuncs, prioritySortFunc);\r\n timsort(dataProcessorFuncs, prioritySortFunc);\r\n\r\n this._scheduler = new Scheduler(this, api, dataProcessorFuncs, visualFuncs);\r\n\r\n this._messageCenter = new MessageCenter();\r\n\r\n // Init mouse events\r\n this._initEvents();\r\n\r\n // In case some people write `window.onresize = chart.resize`\r\n this.resize = bind(this.resize, this);\r\n\r\n zr.animation.on('frame', this._onframe, this);\r\n\r\n bindRenderedEvent(zr, this);\r\n\r\n bindMouseEvent(zr, this);\r\n\r\n // ECharts instance can be used as value.\r\n setAsPrimitive(this);\r\n }\r\n\r\n private _onframe(): void {\r\n if (this._disposed) {\r\n return;\r\n }\r\n\r\n applyChangedStates(this);\r\n\r\n const scheduler = this._scheduler;\r\n\r\n // Lazy update\r\n if (this[PENDING_UPDATE]) {\r\n const silent = (this[PENDING_UPDATE] as any).silent;\r\n\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n\r\n try {\r\n prepare(this);\r\n updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams);\r\n }\r\n catch (e) {\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[PENDING_UPDATE] = null;\r\n throw e;\r\n }\r\n\r\n // At present, in each frame, zrender performs:\r\n // (1) animation step forward.\r\n // (2) trigger('frame') (where this `_onframe` is called)\r\n // (3) zrender flush (render).\r\n // If we do nothing here, since we use `setToFinal: true`, the step (3) above\r\n // will render the final state of the elements before the real animation started.\r\n this._zr.flush();\r\n\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n this[PENDING_UPDATE] = null;\r\n\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n // Avoid do both lazy update and progress in one frame.\r\n else if (scheduler.unfinished) {\r\n // Stream progress.\r\n let remainTime = TEST_FRAME_REMAIN_TIME;\r\n const ecModel = this._model;\r\n const api = this._api;\r\n scheduler.unfinished = false;\r\n do {\r\n const startTime = +new Date();\r\n\r\n scheduler.performSeriesTasks(ecModel);\r\n\r\n // Currently dataProcessorFuncs do not check threshold.\r\n scheduler.performDataProcessorTasks(ecModel);\r\n\r\n updateStreamModes(this, ecModel);\r\n\r\n // Do not update coordinate system here. Because that coord system update in\r\n // each frame is not a good user experience. So we follow the rule that\r\n // the extent of the coordinate system is determined in the first frame (the\r\n // frame is executed immediately after task reset.\r\n // this._coordSysMgr.update(ecModel, api);\r\n\r\n // console.log('--- ec frame visual ---', remainTime);\r\n scheduler.performVisualTasks(ecModel);\r\n\r\n renderSeries(this, this._model, api, 'remain', {});\r\n\r\n remainTime -= (+new Date() - startTime);\r\n }\r\n while (remainTime > 0 && scheduler.unfinished);\r\n\r\n // Call flush explicitly for trigger finished event.\r\n if (!scheduler.unfinished) {\r\n this._zr.flush();\r\n }\r\n // Else, zr flushing be ensue within the same frame,\r\n // because zr flushing is after onframe event.\r\n }\r\n }\r\n\r\n getDom(): HTMLElement {\r\n return this._dom;\r\n }\r\n\r\n getId(): string {\r\n return this.id;\r\n }\r\n\r\n getZr(): zrender.ZRenderType {\r\n return this._zr;\r\n }\r\n\r\n isSSR(): boolean {\r\n return this._ssr;\r\n }\r\n\r\n /**\r\n * Usage:\r\n * chart.setOption(option, notMerge, lazyUpdate);\r\n * chart.setOption(option, {\r\n * notMerge: ...,\r\n * lazyUpdate: ...,\r\n * silent: ...\r\n * });\r\n *\r\n * @param opts opts or notMerge.\r\n * @param opts.notMerge Default `false`.\r\n * @param opts.lazyUpdate Default `false`. Useful when setOption frequently.\r\n * @param opts.silent Default `false`.\r\n * @param opts.replaceMerge Default undefined.\r\n */\r\n // Expose to user full option.\r\n setOption(option: Opt, notMerge?: boolean, lazyUpdate?: boolean): void;\r\n setOption(option: Opt, opts?: SetOptionOpts): void;\r\n /* eslint-disable-next-line */\r\n setOption(option: Opt, notMerge?: boolean | SetOptionOpts, lazyUpdate?: boolean): void {\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n if (__DEV__) {\r\n error('`setOption` should not be called during main process.');\r\n }\r\n return;\r\n }\r\n\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n let silent;\r\n let replaceMerge;\r\n let transitionOpt: SetOptionTransitionOpt;\r\n if (isObject(notMerge)) {\r\n lazyUpdate = notMerge.lazyUpdate;\r\n silent = notMerge.silent;\r\n replaceMerge = notMerge.replaceMerge;\r\n transitionOpt = notMerge.transition;\r\n notMerge = notMerge.notMerge;\r\n }\r\n\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n\r\n if (!this._model || notMerge) {\r\n const optionManager = new OptionManager(this._api);\r\n const theme = this._theme;\r\n const ecModel = this._model = new GlobalModel();\r\n ecModel.scheduler = this._scheduler;\r\n ecModel.ssr = this._ssr;\r\n ecModel.init(null, null, null, theme, this._locale, optionManager);\r\n }\r\n\r\n this._model.setOption(option as ECBasicOption, { replaceMerge }, optionPreprocessorFuncs);\r\n\r\n const updateParams = {\r\n seriesTransition: transitionOpt,\r\n optionChanged: true\r\n } as UpdateLifecycleParams;\r\n\r\n if (lazyUpdate) {\r\n this[PENDING_UPDATE] = {\r\n silent: silent,\r\n updateParams: updateParams\r\n };\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n\r\n // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.\r\n // It should wake it up to make sure zrender start to render at the next frame.\r\n this.getZr().wakeUp();\r\n }\r\n else {\r\n try {\r\n prepare(this);\r\n updateMethods.update.call(this, null, updateParams);\r\n }\r\n catch (e) {\r\n this[PENDING_UPDATE] = null;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n\r\n throw e;\r\n }\r\n\r\n // Ensure zr refresh sychronously, and then pixel in canvas can be\r\n // fetched after `setOption`.\r\n if (!this._ssr) {\r\n // not use flush when using ssr mode.\r\n this._zr.flush();\r\n }\r\n\r\n this[PENDING_UPDATE] = null;\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n\r\n flushPendingActions.call(this, silent);\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n }\r\n\r\n /**\r\n * @deprecated\r\n */\r\n private setTheme(): void {\r\n deprecateLog('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\r\n }\r\n\r\n // We don't want developers to use getModel directly.\r\n private getModel(): GlobalModel {\r\n return this._model;\r\n }\r\n\r\n getOption(): ECBasicOption {\r\n return this._model && this._model.getOption() as ECBasicOption;\r\n }\r\n\r\n getWidth(): number {\r\n return this._zr.getWidth();\r\n }\r\n\r\n getHeight(): number {\r\n return this._zr.getHeight();\r\n }\r\n\r\n getDevicePixelRatio(): number {\r\n return (this._zr.painter as CanvasPainter).dpr\r\n /* eslint-disable-next-line */\r\n || (env.hasGlobalWindow && window.devicePixelRatio) || 1;\r\n }\r\n\r\n /**\r\n * Get canvas which has all thing rendered\r\n * @deprecated Use renderToCanvas instead.\r\n */\r\n getRenderedCanvas(opts?: any): HTMLCanvasElement {\r\n if (__DEV__) {\r\n deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas');\r\n }\r\n return this.renderToCanvas(opts);\r\n }\r\n\r\n renderToCanvas(opts?: {\r\n backgroundColor?: ZRColor\r\n pixelRatio?: number\r\n }): HTMLCanvasElement {\r\n opts = opts || {};\r\n const painter = this._zr.painter;\r\n if (__DEV__) {\r\n if (painter.type !== 'canvas') {\r\n throw new Error('renderToCanvas can only be used in the canvas renderer.');\r\n }\r\n }\r\n return (painter as CanvasPainter).getRenderedCanvas({\r\n backgroundColor: (opts.backgroundColor || this._model.get('backgroundColor')) as ColorString,\r\n pixelRatio: opts.pixelRatio || this.getDevicePixelRatio()\r\n });\r\n }\r\n\r\n renderToSVGString(opts?: {\r\n useViewBox?: boolean\r\n }): string {\r\n opts = opts || {};\r\n const painter = this._zr.painter;\r\n if (__DEV__) {\r\n if (painter.type !== 'svg') {\r\n throw new Error('renderToSVGString can only be used in the svg renderer.');\r\n }\r\n }\r\n return (painter as SVGPainter).renderToString({\r\n useViewBox: opts.useViewBox\r\n });\r\n }\r\n\r\n /**\r\n * Get svg data url\r\n */\r\n getSvgDataURL(): string {\r\n if (!env.svgSupported) {\r\n return;\r\n }\r\n\r\n const zr = this._zr;\r\n const list = zr.storage.getDisplayList();\r\n // Stop animations\r\n each(list, function (el: Element) {\r\n el.stopAnimation(null, true);\r\n });\r\n\r\n return (zr.painter as SVGPainter).toDataURL();\r\n }\r\n\r\n getDataURL(opts?: {\r\n // file type 'png' by default\r\n type?: 'png' | 'jpeg' | 'svg',\r\n pixelRatio?: number,\r\n backgroundColor?: ZRColor,\r\n // component type array\r\n excludeComponents?: ComponentMainType[]\r\n }): string {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n opts = opts || {};\r\n const excludeComponents = opts.excludeComponents;\r\n const ecModel = this._model;\r\n const excludesComponentViews: ComponentView[] = [];\r\n const self = this;\r\n\r\n each(excludeComponents, function (componentType) {\r\n ecModel.eachComponent({\r\n mainType: componentType\r\n }, function (component) {\r\n const view = self._componentsMap[component.__viewId];\r\n if (!view.group.ignore) {\r\n excludesComponentViews.push(view);\r\n view.group.ignore = true;\r\n }\r\n });\r\n });\r\n\r\n const url = this._zr.painter.getType() === 'svg'\r\n ? this.getSvgDataURL()\r\n : this.renderToCanvas(opts).toDataURL(\r\n 'image/' + (opts && opts.type || 'png')\r\n );\r\n\r\n each(excludesComponentViews, function (view) {\r\n view.group.ignore = false;\r\n });\r\n\r\n return url;\r\n }\r\n\r\n getConnectedDataURL(opts?: {\r\n // file type 'png' by default\r\n type?: 'png' | 'jpeg' | 'svg',\r\n pixelRatio?: number,\r\n backgroundColor?: ZRColor,\r\n connectedBackgroundColor?: ZRColor\r\n excludeComponents?: string[]\r\n }): string {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n const isSvg = opts.type === 'svg';\r\n const groupId = this.group;\r\n const mathMin = Math.min;\r\n const mathMax = Math.max;\r\n const MAX_NUMBER = Infinity;\r\n if (connectedGroups[groupId]) {\r\n let left = MAX_NUMBER;\r\n let top = MAX_NUMBER;\r\n let right = -MAX_NUMBER;\r\n let bottom = -MAX_NUMBER;\r\n const canvasList: {dom: HTMLCanvasElement | string, left: number, top: number}[] = [];\r\n const dpr = (opts && opts.pixelRatio) || this.getDevicePixelRatio();\r\n\r\n each(instances, function (chart, id) {\r\n if (chart.group === groupId) {\r\n const canvas = isSvg\r\n ? (chart.getZr().painter as SVGPainter).getSvgDom().innerHTML\r\n : chart.renderToCanvas(clone(opts));\r\n const boundingRect = chart.getDom().getBoundingClientRect();\r\n left = mathMin(boundingRect.left, left);\r\n top = mathMin(boundingRect.top, top);\r\n right = mathMax(boundingRect.right, right);\r\n bottom = mathMax(boundingRect.bottom, bottom);\r\n canvasList.push({\r\n dom: canvas,\r\n left: boundingRect.left,\r\n top: boundingRect.top\r\n });\r\n }\r\n });\r\n\r\n left *= dpr;\r\n top *= dpr;\r\n right *= dpr;\r\n bottom *= dpr;\r\n const width = right - left;\r\n const height = bottom - top;\r\n const targetCanvas = platformApi.createCanvas();\r\n const zr = zrender.init(targetCanvas, {\r\n renderer: isSvg ? 'svg' : 'canvas'\r\n });\r\n zr.resize({\r\n width: width,\r\n height: height\r\n });\r\n\r\n if (isSvg) {\r\n let content = '';\r\n each(canvasList, function (item) {\r\n const x = item.left - left;\r\n const y = item.top - top;\r\n content += '' + item.dom + '';\r\n });\r\n (zr.painter as SVGPainter).getSvgRoot().innerHTML = content;\r\n\r\n if (opts.connectedBackgroundColor) {\r\n (zr.painter as SVGPainter).setBackgroundColor(opts.connectedBackgroundColor as string);\r\n }\r\n\r\n zr.refreshImmediately();\r\n return (zr.painter as SVGPainter).toDataURL();\r\n }\r\n else {\r\n // Background between the charts\r\n if (opts.connectedBackgroundColor) {\r\n zr.add(new graphic.Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height\r\n },\r\n style: {\r\n fill: opts.connectedBackgroundColor\r\n }\r\n }));\r\n }\r\n\r\n each(canvasList, function (item) {\r\n const img = new graphic.Image({\r\n style: {\r\n x: item.left * dpr - left,\r\n y: item.top * dpr - top,\r\n image: item.dom\r\n }\r\n });\r\n zr.add(img);\r\n });\r\n zr.refreshImmediately();\r\n\r\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\r\n }\r\n }\r\n else {\r\n return this.getDataURL(opts);\r\n }\r\n }\r\n\r\n /**\r\n * Convert from logical coordinate system to pixel coordinate system.\r\n * See CoordinateSystem#convertToPixel.\r\n */\r\n convertToPixel(finder: ModelFinder, value: ScaleDataValue): number;\r\n convertToPixel(finder: ModelFinder, value: ScaleDataValue[]): number[];\r\n convertToPixel(finder: ModelFinder, value: ScaleDataValue | ScaleDataValue[]): number | number[] {\r\n return doConvertPixel(this, 'convertToPixel', finder, value);\r\n }\r\n\r\n /**\r\n * Convert from pixel coordinate system to logical coordinate system.\r\n * See CoordinateSystem#convertFromPixel.\r\n */\r\n convertFromPixel(finder: ModelFinder, value: number): number;\r\n convertFromPixel(finder: ModelFinder, value: number[]): number[];\r\n convertFromPixel(finder: ModelFinder, value: number | number[]): number | number[] {\r\n return doConvertPixel(this, 'convertFromPixel', finder, value);\r\n }\r\n\r\n /**\r\n * Is the specified coordinate systems or components contain the given pixel point.\r\n * @param {Array|number} value\r\n * @return {boolean} result\r\n */\r\n containPixel(finder: ModelFinder, value: number[]): boolean {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n const ecModel = this._model;\r\n let result: boolean;\r\n\r\n const findResult = modelUtil.parseFinder(ecModel, finder);\r\n\r\n each(findResult, function (models, key) {\r\n key.indexOf('Models') >= 0 && each(models as ComponentModel[], function (model) {\r\n const coordSys = (model as CoordinateSystemHostModel).coordinateSystem;\r\n if (coordSys && coordSys.containPoint) {\r\n result = result || !!coordSys.containPoint(value);\r\n }\r\n else if (key === 'seriesModels') {\r\n const view = this._chartsMap[model.__viewId];\r\n if (view && view.containPoint) {\r\n result = result || view.containPoint(value, model as SeriesModel);\r\n }\r\n else {\r\n if (__DEV__) {\r\n warn(key + ': ' + (view\r\n ? 'The found component do not support containPoint.'\r\n : 'No view mapping to the found component.'\r\n ));\r\n }\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n warn(key + ': containPoint is not supported');\r\n }\r\n }\r\n }, this);\r\n }, this);\r\n\r\n return !!result;\r\n }\r\n\r\n /**\r\n * Get visual from series or data.\r\n * @param finder\r\n * If string, e.g., 'series', means {seriesIndex: 0}.\r\n * If Object, could contain some of these properties below:\r\n * {\r\n * seriesIndex / seriesId / seriesName,\r\n * dataIndex / dataIndexInside\r\n * }\r\n * If dataIndex is not specified, series visual will be fetched,\r\n * but not data item visual.\r\n * If all of seriesIndex, seriesId, seriesName are not specified,\r\n * visual will be fetched from first series.\r\n * @param visualType 'color', 'symbol', 'symbolSize'\r\n */\r\n getVisual(finder: ModelFinder, visualType: string) {\r\n const ecModel = this._model;\r\n\r\n const parsedFinder = modelUtil.parseFinder(ecModel, finder, {\r\n defaultMainType: 'series'\r\n }) as modelUtil.ParsedModelFinderKnown;\r\n\r\n const seriesModel = parsedFinder.seriesModel;\r\n\r\n if (__DEV__) {\r\n if (!seriesModel) {\r\n warn('There is no specified series model');\r\n }\r\n }\r\n\r\n const data = seriesModel.getData();\r\n\r\n const dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside')\r\n ? parsedFinder.dataIndexInside\r\n : parsedFinder.hasOwnProperty('dataIndex')\r\n ? data.indexOfRawIndex(parsedFinder.dataIndex)\r\n : null;\r\n\r\n return dataIndexInside != null\r\n ? getItemVisualFromData(data, dataIndexInside, visualType)\r\n : getVisualFromData(data, visualType);\r\n }\r\n\r\n /**\r\n * Get view of corresponding component model\r\n */\r\n private getViewOfComponentModel(componentModel: ComponentModel): ComponentView {\r\n return this._componentsMap[componentModel.__viewId];\r\n }\r\n\r\n /**\r\n * Get view of corresponding series model\r\n */\r\n private getViewOfSeriesModel(seriesModel: SeriesModel): ChartView {\r\n return this._chartsMap[seriesModel.__viewId];\r\n }\r\n\r\n\r\n private _initEvents(): void {\r\n each(MOUSE_EVENT_NAMES, (eveName) => {\r\n const handler = (e: ElementEvent) => {\r\n const ecModel = this.getModel();\r\n const el = e.target;\r\n let params: ECElementEvent;\r\n const isGlobalOut = eveName === 'globalout';\r\n // no e.target when 'globalout'.\r\n if (isGlobalOut) {\r\n params = {} as ECElementEvent;\r\n }\r\n else {\r\n el && findEventDispatcher(el, (parent) => {\r\n const ecData = getECData(parent);\r\n if (ecData && ecData.dataIndex != null) {\r\n const dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n params = (\r\n dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {}\r\n ) as ECElementEvent;\r\n return true;\r\n }\r\n // If element has custom eventData of components\r\n else if (ecData.eventData) {\r\n params = extend({}, ecData.eventData) as ECElementEvent;\r\n return true;\r\n }\r\n }, true);\r\n }\r\n\r\n // Contract: if params prepared in mouse event,\r\n // these properties must be specified:\r\n // {\r\n // componentType: string (component main type)\r\n // componentIndex: number\r\n // }\r\n // Otherwise event query can not work.\r\n\r\n if (params) {\r\n let componentType = params.componentType;\r\n let componentIndex = params.componentIndex;\r\n // Special handling for historic reason: when trigger by\r\n // markLine/markPoint/markArea, the componentType is\r\n // 'markLine'/'markPoint'/'markArea', but we should better\r\n // enable them to be queried by seriesIndex, since their\r\n // option is set in each series.\r\n if (componentType === 'markLine'\r\n || componentType === 'markPoint'\r\n || componentType === 'markArea'\r\n ) {\r\n componentType = 'series';\r\n componentIndex = params.seriesIndex;\r\n }\r\n const model = componentType && componentIndex != null\r\n && ecModel.getComponent(componentType, componentIndex);\r\n const view = model && this[\r\n model.mainType === 'series' ? '_chartsMap' : '_componentsMap'\r\n ][model.__viewId];\r\n\r\n if (__DEV__) {\r\n // `event.componentType` and `event[componentTpype + 'Index']` must not\r\n // be missed, otherwise there is no way to distinguish source component.\r\n // See `dataFormat.getDataParams`.\r\n if (!isGlobalOut && !(model && view)) {\r\n warn('model or view can not be found by params');\r\n }\r\n }\r\n\r\n params.event = e;\r\n params.type = eveName;\r\n\r\n (this._$eventProcessor as ECEventProcessor).eventInfo = {\r\n targetEl: el,\r\n packedEvent: params,\r\n model: model,\r\n view: view\r\n };\r\n\r\n this.trigger(eveName, params);\r\n }\r\n };\r\n // Consider that some component (like tooltip, brush, ...)\r\n // register zr event handler, but user event handler might\r\n // do anything, such as call `setOption` or `dispatchAction`,\r\n // which probably update any of the content and probably\r\n // cause problem if it is called previous other inner handlers.\r\n (handler as any).zrEventfulCallAtLast = true;\r\n this._zr.on(eveName, handler, this);\r\n });\r\n\r\n each(eventActionMap, (actionType, eventType) => {\r\n this._messageCenter.on(eventType, function (event: Payload) {\r\n (this as any).trigger(eventType, event);\r\n }, this);\r\n });\r\n\r\n // Extra events\r\n // TODO register?\r\n each(\r\n ['selectchanged'],\r\n (eventType) => {\r\n this._messageCenter.on(eventType, function (event: Payload) {\r\n (this as any).trigger(eventType, event);\r\n }, this);\r\n }\r\n );\r\n\r\n handleLegacySelectEvents(this._messageCenter, this, this._api);\r\n }\r\n\r\n isDisposed(): boolean {\r\n return this._disposed;\r\n }\r\n\r\n clear(): void {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this.setOption({ series: [] } as EChartsOption, true);\r\n }\r\n\r\n dispose(): void {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n this._disposed = true;\r\n\r\n const dom = this.getDom();\r\n if (dom) {\r\n modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\r\n }\r\n\r\n const chart = this;\r\n const api = chart._api;\r\n const ecModel = chart._model;\r\n\r\n each(chart._componentsViews, function (component) {\r\n component.dispose(ecModel, api);\r\n });\r\n each(chart._chartsViews, function (chart) {\r\n chart.dispose(ecModel, api);\r\n });\r\n\r\n // Dispose after all views disposed\r\n chart._zr.dispose();\r\n\r\n // Set properties to null.\r\n // To reduce the memory cost in case the top code still holds this instance unexpectedly.\r\n chart._dom =\r\n chart._model =\r\n chart._chartsMap =\r\n chart._componentsMap =\r\n chart._chartsViews =\r\n chart._componentsViews =\r\n chart._scheduler =\r\n chart._api =\r\n chart._zr =\r\n chart._throttledZrFlush =\r\n chart._theme =\r\n chart._coordSysMgr =\r\n chart._messageCenter = null;\r\n\r\n delete instances[chart.id];\r\n }\r\n\r\n /**\r\n * Resize the chart\r\n */\r\n resize(opts?: ResizeOpts): void {\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n if (__DEV__) {\r\n error('`resize` should not be called during main process.');\r\n }\r\n return;\r\n }\r\n\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n this._zr.resize(opts);\r\n\r\n const ecModel = this._model;\r\n\r\n // Resize loading effect\r\n this._loadingFX && this._loadingFX.resize();\r\n\r\n if (!ecModel) {\r\n return;\r\n }\r\n\r\n let needPrepare = ecModel.resetOption('media');\r\n\r\n let silent = opts && opts.silent;\r\n\r\n // There is some real cases that:\r\n // chart.setOption(option, { lazyUpdate: true });\r\n // chart.resize();\r\n if (this[PENDING_UPDATE]) {\r\n if (silent == null) {\r\n silent = (this[PENDING_UPDATE] as any).silent;\r\n }\r\n needPrepare = true;\r\n this[PENDING_UPDATE] = null;\r\n }\r\n\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n\r\n try {\r\n needPrepare && prepare(this);\r\n updateMethods.update.call(this, {\r\n type: 'resize',\r\n animation: extend({\r\n // Disable animation\r\n duration: 0\r\n }, opts && opts.animation)\r\n });\r\n }\r\n catch (e) {\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n throw e;\r\n }\r\n\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n\r\n flushPendingActions.call(this, silent);\r\n\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n\r\n /**\r\n * Show loading effect\r\n * @param name 'default' by default\r\n * @param cfg cfg of registered loading effect\r\n */\r\n showLoading(cfg?: object): void;\r\n showLoading(name?: string, cfg?: object): void;\r\n showLoading(name?: string | object, cfg?: object): void {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n if (isObject(name)) {\r\n cfg = name as object;\r\n name = '';\r\n }\r\n name = name || 'default';\r\n\r\n this.hideLoading();\r\n if (!loadingEffects[name]) {\r\n if (__DEV__) {\r\n warn('Loading effects ' + name + ' not exists.');\r\n }\r\n return;\r\n }\r\n const el = loadingEffects[name](this._api, cfg);\r\n const zr = this._zr;\r\n this._loadingFX = el;\r\n\r\n zr.add(el);\r\n }\r\n\r\n /**\r\n * Hide loading effect\r\n */\r\n hideLoading(): void {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n this._loadingFX && this._zr.remove(this._loadingFX);\r\n this._loadingFX = null;\r\n }\r\n\r\n makeActionFromEvent(eventObj: ECActionEvent): Payload {\r\n const payload = extend({}, eventObj) as Payload;\r\n payload.type = eventActionMap[eventObj.type];\r\n return payload;\r\n }\r\n\r\n /**\r\n * @param opt If pass boolean, means opt.silent\r\n * @param opt.silent Default `false`. Whether trigger events.\r\n * @param opt.flush Default `undefined`.\r\n * true: Flush immediately, and then pixel in canvas can be fetched\r\n * immediately. Caution: it might affect performance.\r\n * false: Not flush.\r\n * undefined: Auto decide whether perform flush.\r\n */\r\n dispatchAction(\r\n payload: Payload,\r\n opt?: boolean | {\r\n silent?: boolean,\r\n flush?: boolean | undefined\r\n }\r\n ): void {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n if (!isObject(opt)) {\r\n opt = {silent: !!opt};\r\n }\r\n\r\n if (!actions[payload.type]) {\r\n return;\r\n }\r\n\r\n // Avoid dispatch action before setOption. Especially in `connect`.\r\n if (!this._model) {\r\n return;\r\n }\r\n\r\n // May dispatchAction in rendering procedure\r\n if (this[IN_MAIN_PROCESS_KEY]) {\r\n this._pendingActions.push(payload);\r\n return;\r\n }\r\n\r\n const silent = opt.silent;\r\n doDispatchAction.call(this, payload, silent);\r\n\r\n const flush = opt.flush;\r\n if (flush) {\r\n this._zr.flush();\r\n }\r\n else if (flush !== false && env.browser.weChat) {\r\n // In WeChat embedded browser, `requestAnimationFrame` and `setInterval`\r\n // hang when sliding page (on touch event), which cause that zr does not\r\n // refresh until user interaction finished, which is not expected.\r\n // But `dispatchAction` may be called too frequently when pan on touch\r\n // screen, which impacts performance if do not throttle them.\r\n this._throttledZrFlush();\r\n }\r\n\r\n flushPendingActions.call(this, silent);\r\n\r\n triggerUpdatedEvent.call(this, silent);\r\n }\r\n\r\n updateLabelLayout() {\r\n lifecycle.trigger('series:layoutlabels', this._model, this._api, {\r\n // Not adding series labels.\r\n // TODO\r\n updatedSeries: []\r\n });\r\n }\r\n\r\n appendData(params: {\r\n seriesIndex: number,\r\n data: any\r\n }): void {\r\n if (this._disposed) {\r\n disposedWarning(this.id);\r\n return;\r\n }\r\n\r\n const seriesIndex = params.seriesIndex;\r\n const ecModel = this.getModel();\r\n const seriesModel = ecModel.getSeriesByIndex(seriesIndex) as SeriesModel;\r\n\r\n if (__DEV__) {\r\n assert(params.data && seriesModel);\r\n }\r\n\r\n seriesModel.appendData(params);\r\n\r\n // Note: `appendData` does not support that update extent of coordinate\r\n // system, util some scenario require that. In the expected usage of\r\n // `appendData`, the initial extent of coordinate system should better\r\n // be fixed by axis `min`/`max` setting or initial data, otherwise if\r\n // the extent changed while `appendData`, the location of the painted\r\n // graphic elements have to be changed, which make the usage of\r\n // `appendData` meaningless.\r\n\r\n this._scheduler.unfinished = true;\r\n\r\n this.getZr().wakeUp();\r\n }\r\n\r\n\r\n // A work around for no `internal` modifier in ts yet but\r\n // need to strictly hide private methods to JS users.\r\n private static internalField = (function () {\r\n\r\n prepare = function (ecIns: ECharts): void {\r\n const scheduler = ecIns._scheduler;\r\n\r\n scheduler.restorePipelines(ecIns._model);\r\n scheduler.prepareStageTasks();\r\n\r\n prepareView(ecIns, true);\r\n prepareView(ecIns, false);\r\n\r\n scheduler.plan();\r\n };\r\n\r\n /**\r\n * Prepare view instances of charts and components\r\n */\r\n prepareView = function (ecIns: ECharts, isComponent: boolean): void {\r\n const ecModel = ecIns._model;\r\n const scheduler = ecIns._scheduler;\r\n const viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\r\n const viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\r\n const zr = ecIns._zr;\r\n const api = ecIns._api;\r\n\r\n for (let i = 0; i < viewList.length; i++) {\r\n viewList[i].__alive = false;\r\n }\r\n\r\n isComponent\r\n ? ecModel.eachComponent(function (componentType, model) {\r\n componentType !== 'series' && doPrepare(model);\r\n })\r\n : ecModel.eachSeries(doPrepare);\r\n\r\n function doPrepare(model: ComponentModel): void {\r\n // By default view will be reused if possible for the case that `setOption` with \"notMerge\"\r\n // mode and need to enable transition animation. (Usually, when they have the same id, or\r\n // especially no id but have the same type & name & index. See the `model.id` generation\r\n // rule in `makeIdAndName` and `viewId` generation rule here).\r\n // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that\r\n // the new model has nothing to do with the old model.\r\n const requireNewView = model.__requireNewView;\r\n // This command should not work twice.\r\n model.__requireNewView = false;\r\n // Consider: id same and type changed.\r\n const viewId = '_ec_' + model.id + '_' + model.type;\r\n let view = !requireNewView && viewMap[viewId];\r\n if (!view) {\r\n const classType = parseClassType(model.type);\r\n const Clazz = isComponent\r\n ? (ComponentView as ComponentViewConstructor).getClass(classType.main, classType.sub)\r\n : (\r\n // FIXME:TS\r\n // (ChartView as ChartViewConstructor).getClass('series', classType.sub)\r\n // For backward compat, still support a chart type declared as only subType\r\n // like \"liquidfill\", but recommend \"series.liquidfill\"\r\n // But need a base class to make a type series.\r\n (ChartView as ChartViewConstructor).getClass(classType.sub)\r\n );\r\n\r\n if (__DEV__) {\r\n assert(Clazz, classType.sub + ' does not exist.');\r\n }\r\n\r\n view = new Clazz();\r\n view.init(ecModel, api);\r\n viewMap[viewId] = view;\r\n viewList.push(view as any);\r\n zr.add(view.group);\r\n }\r\n\r\n model.__viewId = view.__id = viewId;\r\n view.__alive = true;\r\n view.__model = model;\r\n view.group.__ecComponentInfo = {\r\n mainType: model.mainType,\r\n index: model.componentIndex\r\n };\r\n !isComponent && scheduler.prepareView(\r\n view as ChartView, model as SeriesModel, ecModel, api\r\n );\r\n }\r\n\r\n for (let i = 0; i < viewList.length;) {\r\n const view = viewList[i];\r\n if (!view.__alive) {\r\n !isComponent && (view as ChartView).renderTask.dispose();\r\n zr.remove(view.group);\r\n view.dispose(ecModel, api);\r\n viewList.splice(i, 1);\r\n if (viewMap[view.__id] === view) {\r\n delete viewMap[view.__id];\r\n }\r\n view.__id = view.group.__ecComponentInfo = null;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n };\r\n\r\n updateDirectly = function (\r\n ecIns: ECharts,\r\n method: string,\r\n payload: Payload,\r\n mainType: ComponentMainType,\r\n subType?: ComponentSubType\r\n ): void {\r\n const ecModel = ecIns._model;\r\n\r\n ecModel.setUpdatePayload(payload);\r\n\r\n // broadcast\r\n if (!mainType) {\r\n // FIXME\r\n // Chart will not be update directly here, except set dirty.\r\n // But there is no such scenario now.\r\n each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\r\n return;\r\n }\r\n\r\n const query: QueryConditionKindA['query'] = {};\r\n query[mainType + 'Id'] = payload[mainType + 'Id'];\r\n query[mainType + 'Index'] = payload[mainType + 'Index'];\r\n query[mainType + 'Name'] = payload[mainType + 'Name'];\r\n\r\n const condition = {mainType: mainType, query: query} as QueryConditionKindA;\r\n subType && (condition.subType = subType); // subType may be '' by parseClassType;\r\n\r\n const excludeSeriesId = payload.excludeSeriesId;\r\n let excludeSeriesIdMap: HashMap;\r\n if (excludeSeriesId != null) {\r\n excludeSeriesIdMap = createHashMap();\r\n each(modelUtil.normalizeToArray(excludeSeriesId), id => {\r\n const modelId = modelUtil.convertOptionIdName(id, null);\r\n if (modelId != null) {\r\n excludeSeriesIdMap.set(modelId, true);\r\n }\r\n });\r\n }\r\n\r\n // If dispatchAction before setOption, do nothing.\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\r\n if (isExcluded) {\r\n return;\r\n };\r\n if (isHighDownPayload(payload)) {\r\n if (model instanceof SeriesModel) {\r\n if (\r\n payload.type === HIGHLIGHT_ACTION_TYPE\r\n && !payload.notBlur && !model.get(['emphasis', 'disabled'])\r\n ) {\r\n blurSeriesFromHighlightPayload(model, payload, ecIns._api);\r\n }\r\n }\r\n else {\r\n const { focusSelf, dispatchers } = findComponentHighDownDispatchers(\r\n model.mainType, model.componentIndex, payload.name, ecIns._api\r\n );\r\n if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {\r\n blurComponent(model.mainType, model.componentIndex, ecIns._api);\r\n }\r\n // PENDING:\r\n // Whether to put this \"enter emphasis\" code in `ComponentView`,\r\n // which will be the same as `ChartView` but might be not necessary\r\n // and will be far from this logic.\r\n if (dispatchers) {\r\n each(dispatchers, dispatcher => {\r\n payload.type === HIGHLIGHT_ACTION_TYPE\r\n ? enterEmphasis(dispatcher)\r\n : leaveEmphasis(dispatcher);\r\n });\r\n }\r\n }\r\n }\r\n else if (isSelectChangePayload(payload)) {\r\n // TODO geo\r\n if (model instanceof SeriesModel) {\r\n toggleSelectionFromPayload(model, payload, ecIns._api);\r\n updateSeriesElementSelection(model);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }\r\n }, ecIns);\r\n\r\n ecModel && ecModel.eachComponent(condition, function (model) {\r\n const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\r\n if (isExcluded) {\r\n return;\r\n };\r\n callView(ecIns[\r\n mainType === 'series' ? '_chartsMap' : '_componentsMap'\r\n ][model.__viewId]);\r\n }, ecIns);\r\n\r\n function callView(view: ComponentView | ChartView) {\r\n view && view.__alive && (view as any)[method] && (view as any)[method](\r\n view.__model, ecModel, ecIns._api, payload\r\n );\r\n }\r\n };\r\n\r\n updateMethods = {\r\n\r\n prepareAndUpdate(this: ECharts, payload: Payload): void {\r\n prepare(this);\r\n updateMethods.update.call(this, payload, {\r\n // Needs to mark option changed if newOption is given.\r\n // It's from MagicType.\r\n // TODO If use a separate flag optionChanged in payload?\r\n optionChanged: payload.newOption != null\r\n });\r\n },\r\n\r\n update(this: ECharts, payload: Payload, updateParams: UpdateLifecycleParams): void {\r\n const ecModel = this._model;\r\n const api = this._api;\r\n const zr = this._zr;\r\n const coordSysMgr = this._coordSysMgr;\r\n const scheduler = this._scheduler;\r\n\r\n // update before setOption\r\n if (!ecModel) {\r\n return;\r\n }\r\n\r\n ecModel.setUpdatePayload(payload);\r\n\r\n scheduler.restoreData(ecModel, payload);\r\n\r\n scheduler.performSeriesTasks(ecModel);\r\n\r\n // TODO\r\n // Save total ecModel here for undo/redo (after restoring data and before processing data).\r\n // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\r\n\r\n // Create new coordinate system each update\r\n // In LineView may save the old coordinate system and use it to get the original point.\r\n coordSysMgr.create(ecModel, api);\r\n\r\n scheduler.performDataProcessorTasks(ecModel, payload);\r\n\r\n // Current stream render is not supported in data process. So we can update\r\n // stream modes after data processing, where the filtered data is used to\r\n // determine whether to use progressive rendering.\r\n updateStreamModes(this, ecModel);\r\n\r\n // We update stream modes before coordinate system updated, then the modes info\r\n // can be fetched when coord sys updating (consider the barGrid extent fix). But\r\n // the drawback is the full coord info can not be fetched. Fortunately this full\r\n // coord is not required in stream mode updater currently.\r\n coordSysMgr.update(ecModel, api);\r\n\r\n clearColorPalette(ecModel);\r\n scheduler.performVisualTasks(ecModel, payload);\r\n\r\n render(this, ecModel, api, payload, updateParams);\r\n\r\n // Set background\r\n const backgroundColor = ecModel.get('backgroundColor') || 'transparent';\r\n const darkMode = ecModel.get('darkMode');\r\n\r\n zr.setBackgroundColor(backgroundColor);\r\n\r\n // Force set dark mode.\r\n if (darkMode != null && darkMode !== 'auto') {\r\n zr.setDarkMode(darkMode);\r\n }\r\n\r\n lifecycle.trigger('afterupdate', ecModel, api);\r\n },\r\n\r\n updateTransform(this: ECharts, payload: Payload): void {\r\n const ecModel = this._model;\r\n const api = this._api;\r\n\r\n // update before setOption\r\n if (!ecModel) {\r\n return;\r\n }\r\n\r\n ecModel.setUpdatePayload(payload);\r\n\r\n // ChartView.markUpdateMethod(payload, 'updateTransform');\r\n\r\n const componentDirtyList = [];\r\n ecModel.eachComponent((componentType, componentModel) => {\r\n if (componentType === 'series') {\r\n return;\r\n }\r\n\r\n const componentView = this.getViewOfComponentModel(componentModel);\r\n if (componentView && componentView.__alive) {\r\n if (componentView.updateTransform) {\r\n const result = componentView.updateTransform(componentModel, ecModel, api, payload);\r\n result && result.update && componentDirtyList.push(componentView);\r\n }\r\n else {\r\n componentDirtyList.push(componentView);\r\n }\r\n }\r\n });\r\n\r\n const seriesDirtyMap = createHashMap();\r\n ecModel.eachSeries((seriesModel) => {\r\n const chartView = this._chartsMap[seriesModel.__viewId];\r\n if (chartView.updateTransform) {\r\n const result = chartView.updateTransform(seriesModel, ecModel, api, payload);\r\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n else {\r\n seriesDirtyMap.set(seriesModel.uid, 1);\r\n }\r\n });\r\n\r\n clearColorPalette(ecModel);\r\n // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\r\n // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\r\n this._scheduler.performVisualTasks(\r\n ecModel, payload, {setDirty: true, dirtyMap: seriesDirtyMap}\r\n );\r\n\r\n // Currently, not call render of components. Geo render cost a lot.\r\n // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\r\n renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap);\r\n\r\n lifecycle.trigger('afterupdate', ecModel, api);\r\n },\r\n\r\n updateView(this: ECharts, payload: Payload): void {\r\n const ecModel = this._model;\r\n\r\n // update before setOption\r\n if (!ecModel) {\r\n return;\r\n }\r\n\r\n ecModel.setUpdatePayload(payload);\r\n\r\n ChartView.markUpdateMethod(payload, 'updateView');\r\n\r\n clearColorPalette(ecModel);\r\n\r\n // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\r\n this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true});\r\n\r\n render(this, ecModel, this._api, payload, {});\r\n\r\n lifecycle.trigger('afterupdate', ecModel, this._api);\r\n },\r\n\r\n updateVisual(this: ECharts, payload: Payload): void {\r\n // updateMethods.update.call(this, payload);\r\n\r\n const ecModel = this._model;\r\n\r\n // update before setOption\r\n if (!ecModel) {\r\n return;\r\n }\r\n\r\n ecModel.setUpdatePayload(payload);\r\n\r\n // clear all visual\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.getData().clearAllVisual();\r\n });\r\n\r\n // Perform visual\r\n ChartView.markUpdateMethod(payload, 'updateVisual');\r\n\r\n clearColorPalette(ecModel);\r\n\r\n // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\r\n this._scheduler.performVisualTasks(ecModel, payload, {visualType: 'visual', setDirty: true});\r\n\r\n ecModel.eachComponent((componentType, componentModel) => { // TODO componentType may be series.\r\n if (componentType !== 'series') {\r\n const componentView = this.getViewOfComponentModel(componentModel);\r\n componentView && componentView.__alive\r\n && componentView.updateVisual(componentModel, ecModel, this._api, payload);\r\n }\r\n });\r\n\r\n ecModel.eachSeries((seriesModel) => {\r\n const chartView = this._chartsMap[seriesModel.__viewId];\r\n chartView.updateVisual(seriesModel, ecModel, this._api, payload);\r\n });\r\n\r\n lifecycle.trigger('afterupdate', ecModel, this._api);\r\n },\r\n\r\n updateLayout(this: ECharts, payload: Payload): void {\r\n updateMethods.update.call(this, payload);\r\n }\r\n };\r\n\r\n doConvertPixel = function (\r\n ecIns: ECharts,\r\n methodName: 'convertFromPixel' | 'convertToPixel',\r\n finder: ModelFinder,\r\n value: (number | number[]) | (ScaleDataValue | ScaleDataValue[])\r\n ): (number | number[]) {\r\n if (ecIns._disposed) {\r\n disposedWarning(ecIns.id);\r\n return;\r\n }\r\n const ecModel = ecIns._model;\r\n const coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\r\n let result;\r\n\r\n const parsedFinder = modelUtil.parseFinder(ecModel, finder);\r\n\r\n for (let i = 0; i < coordSysList.length; i++) {\r\n const coordSys = coordSysList[i];\r\n if (coordSys[methodName]\r\n && (result = coordSys[methodName](ecModel, parsedFinder, value as any)) != null\r\n ) {\r\n return result;\r\n }\r\n }\r\n\r\n if (__DEV__) {\r\n warn(\r\n 'No coordinate system that supports ' + methodName + ' found by the given finder.'\r\n );\r\n }\r\n };\r\n\r\n updateStreamModes = function (ecIns: ECharts, ecModel: GlobalModel): void {\r\n const chartsMap = ecIns._chartsMap;\r\n const scheduler = ecIns._scheduler;\r\n ecModel.eachSeries(function (seriesModel) {\r\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\r\n });\r\n };\r\n\r\n doDispatchAction = function (this: ECharts, payload: Payload, silent: boolean): void {\r\n const ecModel = this.getModel();\r\n const payloadType = payload.type;\r\n const escapeConnect = payload.escapeConnect;\r\n const actionWrap = actions[payloadType];\r\n const actionInfo = actionWrap.actionInfo;\r\n\r\n const cptTypeTmp = (actionInfo.update || 'update').split(':');\r\n const updateMethod = cptTypeTmp.pop();\r\n const cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\r\n\r\n this[IN_MAIN_PROCESS_KEY] = true;\r\n\r\n let payloads: Payload[] = [payload];\r\n let batched = false;\r\n // Batch action\r\n if (payload.batch) {\r\n batched = true;\r\n payloads = map(payload.batch, function (item) {\r\n item = defaults(extend({}, item), payload);\r\n item.batch = null;\r\n return item as Payload;\r\n });\r\n }\r\n\r\n const eventObjBatch: ECEventData[] = [];\r\n let eventObj: ECActionEvent;\r\n\r\n const isSelectChange = isSelectChangePayload(payload);\r\n const isHighDown = isHighDownPayload(payload);\r\n\r\n // Only leave blur once if there are multiple batches.\r\n if (isHighDown) {\r\n allLeaveBlur(this._api);\r\n }\r\n\r\n each(payloads, (batchItem) => {\r\n // Action can specify the event by return it.\r\n eventObj = actionWrap.action(batchItem, this._model, this._api) as ECActionEvent;\r\n // Emit event outside\r\n eventObj = eventObj || extend({} as ECActionEvent, batchItem);\r\n // Convert type to eventType\r\n eventObj.type = actionInfo.event || eventObj.type;\r\n eventObjBatch.push(eventObj);\r\n\r\n // light update does not perform data process, layout and visual.\r\n if (isHighDown) {\r\n const { queryOptionMap, mainTypeSpecified } = modelUtil.preParseFinder(payload as ModelFinder);\r\n const componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series';\r\n updateDirectly(this, updateMethod, batchItem as Payload, componentMainType);\r\n markStatusToUpdate(this);\r\n }\r\n else if (isSelectChange) {\r\n // At present `dispatchAction({ type: 'select', ... })` is not supported on components.\r\n // geo still use 'geoselect'.\r\n updateDirectly(this, updateMethod, batchItem as Payload, 'series');\r\n markStatusToUpdate(this);\r\n }\r\n else if (cptType) {\r\n updateDirectly(this, updateMethod, batchItem as Payload, cptType.main, cptType.sub);\r\n }\r\n });\r\n\r\n if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) {\r\n try {\r\n // Still dirty\r\n if (this[PENDING_UPDATE]) {\r\n prepare(this);\r\n updateMethods.update.call(this, payload);\r\n this[PENDING_UPDATE] = null;\r\n }\r\n else {\r\n updateMethods[updateMethod as keyof typeof updateMethods].call(this, payload);\r\n }\r\n }\r\n catch (e) {\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n throw e;\r\n }\r\n }\r\n\r\n // Follow the rule of action batch\r\n if (batched) {\r\n eventObj = {\r\n type: actionInfo.event || payloadType,\r\n escapeConnect: escapeConnect,\r\n batch: eventObjBatch\r\n };\r\n }\r\n else {\r\n eventObj = eventObjBatch[0] as ECActionEvent;\r\n }\r\n\r\n this[IN_MAIN_PROCESS_KEY] = false;\r\n\r\n if (!silent) {\r\n const messageCenter = this._messageCenter;\r\n messageCenter.trigger(eventObj.type, eventObj);\r\n // Extra triggered 'selectchanged' event\r\n if (isSelectChange) {\r\n const newObj: SelectChangedPayload = {\r\n type: 'selectchanged',\r\n escapeConnect: escapeConnect,\r\n selected: getAllSelectedIndices(ecModel),\r\n isFromClick: payload.isFromClick || false,\r\n fromAction: payload.type as 'select' | 'unselect' | 'toggleSelected',\r\n fromActionPayload: payload\r\n };\r\n messageCenter.trigger(newObj.type, newObj);\r\n }\r\n }\r\n };\r\n\r\n flushPendingActions = function (this: ECharts, silent: boolean): void {\r\n const pendingActions = this._pendingActions;\r\n while (pendingActions.length) {\r\n const payload = pendingActions.shift();\r\n doDispatchAction.call(this, payload, silent);\r\n }\r\n };\r\n\r\n triggerUpdatedEvent = function (this: ECharts, silent): void {\r\n !silent && this.trigger('updated');\r\n };\r\n\r\n /**\r\n * Event `rendered` is triggered when zr\r\n * rendered. It is useful for realtime\r\n * snapshot (reflect animation).\r\n *\r\n * Event `finished` is triggered when:\r\n * (1) zrender rendering finished.\r\n * (2) initial animation finished.\r\n * (3) progressive rendering finished.\r\n * (4) no pending action.\r\n * (5) no delayed setOption needs to be processed.\r\n */\r\n bindRenderedEvent = function (zr: zrender.ZRenderType, ecIns: ECharts): void {\r\n zr.on('rendered', function (params: RenderedEventParam) {\r\n\r\n ecIns.trigger('rendered', params);\r\n\r\n // The `finished` event should not be triggered repeatedly,\r\n // so it should only be triggered when rendering indeed happens\r\n // in zrender. (Consider the case that dipatchAction is keep\r\n // triggering when mouse move).\r\n if (\r\n // Although zr is dirty if initial animation is not finished\r\n // and this checking is called on frame, we also check\r\n // animation finished for robustness.\r\n zr.animation.isFinished()\r\n && !ecIns[PENDING_UPDATE]\r\n && !ecIns._scheduler.unfinished\r\n && !ecIns._pendingActions.length\r\n ) {\r\n ecIns.trigger('finished');\r\n }\r\n });\r\n };\r\n\r\n bindMouseEvent = function (zr: zrender.ZRenderType, ecIns: ECharts): void {\r\n zr.on('mouseover', function (e) {\r\n const el = e.target;\r\n const dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('mouseout', function (e) {\r\n const el = e.target;\r\n const dispatcher = findEventDispatcher(el, isHighDownDispatcher);\r\n if (dispatcher) {\r\n handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api);\r\n markStatusToUpdate(ecIns);\r\n }\r\n }).on('click', function (e) {\r\n const el = e.target;\r\n const dispatcher = findEventDispatcher(\r\n el, (target) => getECData(target).dataIndex != null, true\r\n );\r\n if (dispatcher) {\r\n const actionType = (dispatcher as ECElement).selected ? 'unselect' : 'select';\r\n const ecData = getECData(dispatcher);\r\n ecIns._api.dispatchAction({\r\n type: actionType,\r\n dataType: ecData.dataType,\r\n dataIndexInside: ecData.dataIndex,\r\n seriesIndex: ecData.seriesIndex,\r\n isFromClick: true\r\n });\r\n }\r\n });\r\n };\r\n\r\n function clearColorPalette(ecModel: GlobalModel): void {\r\n ecModel.clearColorPalette();\r\n ecModel.eachSeries(function (seriesModel) {\r\n seriesModel.clearColorPalette();\r\n });\r\n };\r\n\r\n // Allocate zlevels for series and components\r\n function allocateZlevels(ecModel: GlobalModel) {\r\n interface ZLevelItem {\r\n z: number,\r\n zlevel: number,\r\n idx: number,\r\n type: string,\r\n key: string\r\n };\r\n const componentZLevels: ZLevelItem[] = [];\r\n const seriesZLevels: ZLevelItem[] = [];\r\n let hasSeparateZLevel = false;\r\n ecModel.eachComponent(function (componentType, componentModel) {\r\n const zlevel = componentModel.get('zlevel') || 0;\r\n const z = componentModel.get('z') || 0;\r\n const zlevelKey = componentModel.getZLevelKey();\r\n hasSeparateZLevel = hasSeparateZLevel || !!zlevelKey;\r\n (componentType === 'series' ? seriesZLevels : componentZLevels).push({\r\n zlevel,\r\n z,\r\n idx: componentModel.componentIndex,\r\n type: componentType,\r\n key: zlevelKey\r\n });\r\n });\r\n\r\n if (hasSeparateZLevel) {\r\n // Series after component\r\n const zLevels: ZLevelItem[] = componentZLevels.concat(seriesZLevels);\r\n let lastSeriesZLevel: number;\r\n let lastSeriesKey: string;\r\n\r\n timsort(zLevels, (a, b) => {\r\n if (a.zlevel === b.zlevel) {\r\n return a.z - b.z;\r\n }\r\n return a.zlevel - b.zlevel;\r\n });\r\n each(zLevels, item => {\r\n const componentModel = ecModel.getComponent(item.type, item.idx);\r\n let zlevel = item.zlevel;\r\n const key = item.key;\r\n if (lastSeriesZLevel != null) {\r\n zlevel = Math.max(lastSeriesZLevel, zlevel);\r\n }\r\n if (key) {\r\n if (zlevel === lastSeriesZLevel && key !== lastSeriesKey) {\r\n zlevel++;\r\n }\r\n lastSeriesKey = key;\r\n }\r\n else if (lastSeriesKey) {\r\n if (zlevel === lastSeriesZLevel) {\r\n zlevel++;\r\n }\r\n lastSeriesKey = '';\r\n }\r\n lastSeriesZLevel = zlevel;\r\n componentModel.setZLevel(zlevel);\r\n });\r\n }\r\n }\r\n\r\n render = (\r\n ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload,\r\n updateParams: UpdateLifecycleParams\r\n ) => {\r\n allocateZlevels(ecModel);\r\n\r\n renderComponents(ecIns, ecModel, api, payload, updateParams);\r\n\r\n each(ecIns._chartsViews, function (chart: ChartView) {\r\n chart.__alive = false;\r\n });\r\n\r\n renderSeries(ecIns, ecModel, api, payload, updateParams);\r\n\r\n // Remove groups of unrendered charts\r\n each(ecIns._chartsViews, function (chart: ChartView) {\r\n if (!chart.__alive) {\r\n chart.remove(ecModel, api);\r\n }\r\n });\r\n };\r\n\r\n renderComponents = (\r\n ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload,\r\n updateParams: UpdateLifecycleParams, dirtyList?: ComponentView[]\r\n ) => {\r\n each(dirtyList || ecIns._componentsViews, function (componentView: ComponentView) {\r\n const componentModel = componentView.__model;\r\n clearStates(componentModel, componentView);\r\n\r\n componentView.render(componentModel, ecModel, api, payload);\r\n\r\n updateZ(componentModel, componentView);\r\n\r\n updateStates(componentModel, componentView);\r\n });\r\n\r\n };\r\n\r\n /**\r\n * Render each chart and component\r\n */\r\n renderSeries = (\r\n ecIns: ECharts,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload | 'remain',\r\n updateParams: UpdateLifecycleParams,\r\n dirtyMap?: {[uid: string]: any}\r\n ) => {\r\n // Render all charts\r\n const scheduler = ecIns._scheduler;\r\n\r\n updateParams = extend(updateParams || {}, {\r\n updatedSeries: ecModel.getSeries()\r\n });\r\n\r\n // TODO progressive?\r\n lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams);\r\n\r\n let unfinished: boolean = false;\r\n ecModel.eachSeries(function (seriesModel) {\r\n const chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n chartView.__alive = true;\r\n\r\n const renderTask = chartView.renderTask;\r\n scheduler.updatePayload(renderTask, payload);\r\n\r\n // TODO states on marker.\r\n clearStates(seriesModel, chartView);\r\n\r\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\r\n renderTask.dirty();\r\n }\r\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\r\n unfinished = true;\r\n }\r\n\r\n chartView.group.silent = !!seriesModel.get('silent');\r\n // Should not call markRedraw on group, because it will disable zrender\r\n // incremental render (always render from the __startIndex each frame)\r\n // chartView.group.markRedraw();\r\n\r\n updateBlend(seriesModel, chartView);\r\n\r\n updateSeriesElementSelection(seriesModel);\r\n });\r\n\r\n scheduler.unfinished = unfinished || scheduler.unfinished;\r\n\r\n lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams);\r\n\r\n // transition after label is layouted.\r\n lifecycle.trigger('series:transition', ecModel, api, updateParams);\r\n\r\n ecModel.eachSeries(function (seriesModel) {\r\n const chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n // Update Z after labels updated. Before applying states.\r\n updateZ(seriesModel, chartView);\r\n\r\n // NOTE: Update states after label is updated.\r\n // label should be in normal status when layouting.\r\n updateStates(seriesModel, chartView);\r\n });\r\n\r\n // If use hover layer\r\n updateHoverLayerStatus(ecIns, ecModel);\r\n\r\n lifecycle.trigger('series:afterupdate', ecModel, api, updateParams);\r\n };\r\n\r\n markStatusToUpdate = function (ecIns: ECharts): void {\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true;\r\n // Wake up zrender if it's sleep. Let it update states in the next frame.\r\n ecIns.getZr().wakeUp();\r\n };\r\n\r\n applyChangedStates = function (ecIns: ECharts): void {\r\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\r\n return;\r\n }\r\n\r\n ecIns.getZr().storage.traverse(function (el: ECElement) {\r\n // Not applied on removed elements, it may still in fading.\r\n if (graphic.isElementRemoved(el)) {\r\n return;\r\n }\r\n applyElementStates(el);\r\n });\r\n\r\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\r\n };\r\n\r\n function applyElementStates(el: ECElement) {\r\n const newStates = [];\r\n\r\n const oldStates = el.currentStates;\r\n // Keep other states.\r\n for (let i = 0; i < oldStates.length; i++) {\r\n const stateName = oldStates[i];\r\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\r\n newStates.push(stateName);\r\n }\r\n }\r\n\r\n // Only use states when it's exists.\r\n if (el.selected && el.states.select) {\r\n newStates.push('select');\r\n }\r\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\r\n newStates.push('emphasis');\r\n }\r\n else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\r\n newStates.push('blur');\r\n }\r\n el.useStates(newStates);\r\n }\r\n\r\n function updateHoverLayerStatus(ecIns: ECharts, ecModel: GlobalModel): void {\r\n const zr = ecIns._zr;\r\n const storage = zr.storage;\r\n let elCount = 0;\r\n\r\n storage.traverse(function (el) {\r\n if (!el.isGroup) {\r\n elCount++;\r\n }\r\n });\r\n\r\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.preventUsingHoverLayer) {\r\n return;\r\n }\r\n const chartView = ecIns._chartsMap[seriesModel.__viewId];\r\n if (chartView.__alive) {\r\n chartView.eachRendered((el: ECElement) => {\r\n if (el.states.emphasis) {\r\n el.states.emphasis.hoverLayer = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Update chart and blend.\r\n */\r\n function updateBlend(seriesModel: SeriesModel, chartView: ChartView): void {\r\n const blendMode = seriesModel.get('blendMode') || null;\r\n chartView.eachRendered((el: Displayable) => {\r\n // FIXME marker and other components\r\n if (!el.isGroup) {\r\n // DON'T mark the element dirty. In case element is incremental and don't want to rerender.\r\n el.style.blend = blendMode;\r\n }\r\n });\r\n };\r\n\r\n function updateZ(model: ComponentModel, view: ComponentView | ChartView): void {\r\n if (model.preventAutoZ) {\r\n return;\r\n }\r\n const z = model.get('z') || 0;\r\n const zlevel = model.get('zlevel') || 0;\r\n // Set z and zlevel\r\n view.eachRendered((el) => {\r\n doUpdateZ(el, z, zlevel, -Infinity);\r\n // Don't traverse the children because it has been traversed in _updateZ.\r\n return true;\r\n });\r\n };\r\n\r\n function doUpdateZ(el: Element, z: number, zlevel: number, maxZ2: number): number {\r\n // Group may also have textContent\r\n const label = el.getTextContent();\r\n const labelLine = el.getTextGuideLine();\r\n const isGroup = el.isGroup;\r\n\r\n if (isGroup) {\r\n // set z & zlevel of children elements of Group\r\n const children = (el as graphic.Group).childrenRef();\r\n for (let i = 0; i < children.length; i++) {\r\n maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2);\r\n }\r\n }\r\n else {\r\n // not Group\r\n (el as Displayable).z = z;\r\n (el as Displayable).zlevel = zlevel;\r\n\r\n maxZ2 = Math.max((el as Displayable).z2, maxZ2);\r\n }\r\n\r\n // always set z and zlevel if label/labelLine exists\r\n if (label) {\r\n label.z = z;\r\n label.zlevel = zlevel;\r\n // lift z2 of text content\r\n // TODO if el.emphasis.z2 is spcefied, what about textContent.\r\n isFinite(maxZ2) && (label.z2 = maxZ2 + 2);\r\n }\r\n if (labelLine) {\r\n const textGuideLineConfig = el.textGuideLineConfig;\r\n labelLine.z = z;\r\n labelLine.zlevel = zlevel;\r\n isFinite(maxZ2)\r\n && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));\r\n }\r\n return maxZ2;\r\n }\r\n\r\n // Clear states without animation.\r\n // TODO States on component.\r\n function clearStates(model: ComponentModel, view: ComponentView | ChartView): void {\r\n view.eachRendered(function (el: Displayable) {\r\n // Not applied on removed elements, it may still in fading.\r\n if (graphic.isElementRemoved(el)) {\r\n return;\r\n }\r\n\r\n const textContent = el.getTextContent();\r\n const textGuide = el.getTextGuideLine();\r\n if (el.stateTransition) {\r\n el.stateTransition = null;\r\n }\r\n if (textContent && textContent.stateTransition) {\r\n textContent.stateTransition = null;\r\n }\r\n if (textGuide && textGuide.stateTransition) {\r\n textGuide.stateTransition = null;\r\n }\r\n\r\n // TODO If el is incremental.\r\n if (el.hasState()) {\r\n el.prevStates = el.currentStates;\r\n el.clearStates();\r\n }\r\n else if (el.prevStates) {\r\n el.prevStates = null;\r\n }\r\n });\r\n }\r\n\r\n function updateStates(model: ComponentModel, view: ComponentView | ChartView): void {\r\n const stateAnimationModel = (model as SeriesModel).getModel('stateAnimation');\r\n const enableAnimation = model.isAnimationEnabled();\r\n const duration = stateAnimationModel.get('duration');\r\n const stateTransition = duration > 0 ? {\r\n duration,\r\n delay: stateAnimationModel.get('delay'),\r\n easing: stateAnimationModel.get('easing')\r\n // additive: stateAnimationModel.get('additive')\r\n } : null;\r\n view.eachRendered(function (el: Displayable) {\r\n if (el.states && el.states.emphasis) {\r\n // Not applied on removed elements, it may still in fading.\r\n if (graphic.isElementRemoved(el)) {\r\n return;\r\n }\r\n\r\n if (el instanceof graphic.Path) {\r\n savePathStates(el);\r\n }\r\n\r\n // Only updated on changed element. In case element is incremental and don't want to rerender.\r\n // TODO, a more proper way?\r\n if (el.__dirty) {\r\n const prevStates = el.prevStates;\r\n // Restore states without animation\r\n if (prevStates) {\r\n el.useStates(prevStates);\r\n }\r\n }\r\n\r\n // Update state transition and enable animation again.\r\n if (enableAnimation) {\r\n el.stateTransition = stateTransition;\r\n const textContent = el.getTextContent();\r\n const textGuide = el.getTextGuideLine();\r\n // TODO Is it necessary to animate label?\r\n if (textContent) {\r\n textContent.stateTransition = stateTransition;\r\n }\r\n if (textGuide) {\r\n textGuide.stateTransition = stateTransition;\r\n }\r\n }\r\n\r\n // Use highlighted and selected flag to toggle states.\r\n if (el.__dirty) {\r\n applyElementStates(el);\r\n }\r\n }\r\n });\r\n };\r\n\r\n createExtensionAPI = function (ecIns: ECharts): ExtensionAPI {\r\n return new (class extends ExtensionAPI {\r\n getCoordinateSystems(): CoordinateSystemMaster[] {\r\n return ecIns._coordSysMgr.getCoordinateSystems();\r\n }\r\n getComponentByElement(el: Element) {\r\n while (el) {\r\n const modelInfo = (el as ViewRootGroup).__ecComponentInfo;\r\n if (modelInfo != null) {\r\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\r\n }\r\n el = el.parent;\r\n }\r\n }\r\n enterEmphasis(el: Element, highlightDigit?: number) {\r\n enterEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n }\r\n leaveEmphasis(el: Element, highlightDigit?: number) {\r\n leaveEmphasis(el, highlightDigit);\r\n markStatusToUpdate(ecIns);\r\n }\r\n enterBlur(el: Element) {\r\n enterBlur(el);\r\n markStatusToUpdate(ecIns);\r\n }\r\n leaveBlur(el: Element) {\r\n leaveBlur(el);\r\n markStatusToUpdate(ecIns);\r\n }\r\n enterSelect(el: Element) {\r\n enterSelect(el);\r\n markStatusToUpdate(ecIns);\r\n }\r\n leaveSelect(el: Element) {\r\n leaveSelect(el);\r\n markStatusToUpdate(ecIns);\r\n }\r\n getModel(): GlobalModel {\r\n return ecIns.getModel();\r\n }\r\n getViewOfComponentModel(componentModel: ComponentModel): ComponentView {\r\n return ecIns.getViewOfComponentModel(componentModel);\r\n }\r\n getViewOfSeriesModel(seriesModel: SeriesModel): ChartView {\r\n return ecIns.getViewOfSeriesModel(seriesModel);\r\n }\r\n })(ecIns);\r\n };\r\n\r\n enableConnect = function (chart: ECharts): void {\r\n\r\n function updateConnectedChartsStatus(charts: ECharts[], status: ConnectStatus) {\r\n for (let i = 0; i < charts.length; i++) {\r\n const otherChart = charts[i];\r\n otherChart[CONNECT_STATUS_KEY] = status;\r\n }\r\n }\r\n\r\n each(eventActionMap, function (actionType, eventType) {\r\n chart._messageCenter.on(eventType, function (event: ECActionEvent) {\r\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\r\n if (event && event.escapeConnect) {\r\n return;\r\n }\r\n\r\n const action = chart.makeActionFromEvent(event);\r\n const otherCharts: ECharts[] = [];\r\n\r\n each(instances, function (otherChart) {\r\n if (otherChart !== chart && otherChart.group === chart.group) {\r\n otherCharts.push(otherChart);\r\n }\r\n });\r\n\r\n updateConnectedChartsStatus(otherCharts, CONNECT_STATUS_PENDING);\r\n each(otherCharts, function (otherChart) {\r\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\r\n otherChart.dispatchAction(action);\r\n }\r\n });\r\n updateConnectedChartsStatus(otherCharts, CONNECT_STATUS_UPDATED);\r\n }\r\n });\r\n });\r\n };\r\n })();\r\n}\r\n\r\nconst echartsProto = ECharts.prototype;\r\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\r\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\r\n/**\r\n * @deprecated\r\n */\r\n// @ts-ignore\r\nechartsProto.one = function (eventName: string, cb: Function, ctx?: any) {\r\n const self = this;\r\n deprecateLog('ECharts#one is deprecated.');\r\n function wrapped(this: unknown, ...args2: any) {\r\n cb && cb.apply && cb.apply(this, args2);\r\n // @ts-ignore\r\n self.off(eventName, wrapped);\r\n };\r\n // @ts-ignore\r\n this.on.call(this, eventName, wrapped, ctx);\r\n};\r\n\r\nconst MOUSE_EVENT_NAMES: ZRElementEventName[] = [\r\n 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',\r\n 'mousedown', 'mouseup', 'globalout', 'contextmenu'\r\n];\r\n\r\nfunction disposedWarning(id: string): void {\r\n if (__DEV__) {\r\n warn('Instance ' + id + ' has been disposed');\r\n }\r\n}\r\n\r\n\r\nconst actions: {\r\n [actionType: string]: {\r\n action: ActionHandler,\r\n actionInfo: ActionInfo\r\n }\r\n} = {};\r\n\r\n/**\r\n * Map eventType to actionType\r\n */\r\nconst eventActionMap: {[eventType: string]: string} = {};\r\n\r\nconst dataProcessorFuncs: StageHandlerInternal[] = [];\r\n\r\nconst optionPreprocessorFuncs: OptionPreprocessor[] = [];\r\n\r\nconst visualFuncs: StageHandlerInternal[] = [];\r\n\r\nconst themeStorage: {[themeName: string]: ThemeOption} = {};\r\n\r\nconst loadingEffects: {[effectName: string]: LoadingEffectCreator} = {};\r\n\r\nconst instances: {[id: string]: ECharts} = {};\r\nconst connectedGroups: {[groupId: string]: boolean} = {};\r\n\r\nlet idBase: number = +(new Date()) - 0;\r\nlet groupIdBase: number = +(new Date()) - 0;\r\nconst DOM_ATTRIBUTE_KEY = '_echarts_instance_';\r\n\r\n\r\n/**\r\n * @param opts.devicePixelRatio Use window.devicePixelRatio by default\r\n * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.\r\n * @param opts.width Use clientWidth of the input `dom` by default.\r\n * Can be 'auto' (the same as null/undefined)\r\n * @param opts.height Use clientHeight of the input `dom` by default.\r\n * Can be 'auto' (the same as null/undefined)\r\n * @param opts.locale Specify the locale.\r\n * @param opts.useDirtyRect Enable dirty rectangle rendering or not.\r\n */\r\nexport function init(\r\n dom?: HTMLElement | null,\r\n theme?: string | object | null,\r\n opts?: EChartsInitOpts\r\n): EChartsType {\r\n const isClient = !(opts && opts.ssr);\r\n if (isClient) {\r\n if (__DEV__) {\r\n if (!dom) {\r\n throw new Error('Initialize failed: invalid dom.');\r\n }\r\n }\r\n\r\n const existInstance = getInstanceByDom(dom);\r\n if (existInstance) {\r\n if (__DEV__) {\r\n warn('There is a chart instance already initialized on the dom.');\r\n }\r\n return existInstance;\r\n }\r\n\r\n if (__DEV__) {\r\n if (isDom(dom)\r\n && dom.nodeName.toUpperCase() !== 'CANVAS'\r\n && (\r\n (!dom.clientWidth && (!opts || opts.width == null))\r\n || (!dom.clientHeight && (!opts || opts.height == null))\r\n )\r\n ) {\r\n warn('Can\\'t get DOM width or height. Please check '\r\n + 'dom.clientWidth and dom.clientHeight. They should not be 0.'\r\n + 'For example, you may need to call this in the callback '\r\n + 'of window.onload.');\r\n }\r\n }\r\n }\r\n\r\n const chart = new ECharts(dom, theme, opts);\r\n chart.id = 'ec_' + idBase++;\r\n instances[chart.id] = chart;\r\n\r\n isClient && modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\r\n\r\n enableConnect(chart);\r\n\r\n lifecycle.trigger('afterinit', chart);\r\n\r\n return chart;\r\n}\r\n\r\n/**\r\n * @usage\r\n * (A)\r\n * ```js\r\n * let chart1 = echarts.init(dom1);\r\n * let chart2 = echarts.init(dom2);\r\n * chart1.group = 'xxx';\r\n * chart2.group = 'xxx';\r\n * echarts.connect('xxx');\r\n * ```\r\n * (B)\r\n * ```js\r\n * let chart1 = echarts.init(dom1);\r\n * let chart2 = echarts.init(dom2);\r\n * echarts.connect('xxx', [chart1, chart2]);\r\n * ```\r\n */\r\nexport function connect(groupId: string | EChartsType[]): string {\r\n // Is array of charts\r\n if (isArray(groupId)) {\r\n const charts = groupId;\r\n groupId = null;\r\n // If any chart has group\r\n each(charts, function (chart) {\r\n if (chart.group != null) {\r\n groupId = chart.group;\r\n }\r\n });\r\n groupId = groupId || ('g_' + groupIdBase++);\r\n each(charts, function (chart) {\r\n chart.group = groupId as string;\r\n });\r\n }\r\n connectedGroups[groupId as string] = true;\r\n return groupId as string;\r\n}\r\n\r\nexport function disconnect(groupId: string): void {\r\n connectedGroups[groupId] = false;\r\n}\r\n\r\n/**\r\n * Alias and backward compatibility\r\n * @deprecated\r\n */\r\nexport const disConnect = disconnect;\r\n\r\n/**\r\n * Dispose a chart instance\r\n */\r\nexport function dispose(chart: EChartsType | HTMLElement | string): void {\r\n if (isString(chart)) {\r\n chart = instances[chart];\r\n }\r\n else if (!(chart instanceof ECharts)) {\r\n // Try to treat as dom\r\n chart = getInstanceByDom(chart);\r\n }\r\n if ((chart instanceof ECharts) && !chart.isDisposed()) {\r\n chart.dispose();\r\n }\r\n}\r\n\r\nexport function getInstanceByDom(dom: HTMLElement): EChartsType | undefined {\r\n return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\r\n}\r\n\r\nexport function getInstanceById(key: string): EChartsType | undefined {\r\n return instances[key];\r\n}\r\n\r\n/**\r\n * Register theme\r\n */\r\nexport function registerTheme(name: string, theme: ThemeOption): void {\r\n themeStorage[name] = theme;\r\n}\r\n\r\n/**\r\n * Register option preprocessor\r\n */\r\nexport function registerPreprocessor(preprocessorFunc: OptionPreprocessor): void {\r\n if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {\r\n optionPreprocessorFuncs.push(preprocessorFunc);\r\n }\r\n}\r\n\r\nexport function registerProcessor(\r\n priority: number | StageHandler | StageHandlerOverallReset,\r\n processor?: StageHandler | StageHandlerOverallReset\r\n): void {\r\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\r\n}\r\n\r\n\r\n/**\r\n * Register postIniter\r\n * @param {Function} postInitFunc\r\n */\r\nexport function registerPostInit(postInitFunc: PostIniter): void {\r\n registerUpdateLifecycle('afterinit', postInitFunc);\r\n}\r\n\r\n/**\r\n * Register postUpdater\r\n * @param {Function} postUpdateFunc\r\n */\r\nexport function registerPostUpdate(postUpdateFunc: PostUpdater): void {\r\n registerUpdateLifecycle('afterupdate', postUpdateFunc);\r\n}\r\n\r\nexport function registerUpdateLifecycle(\r\n name: T, cb: (...args: LifecycleEvents[T]) => void\r\n): void {\r\n (lifecycle as any).on(name, cb);\r\n}\r\n\r\n/**\r\n * @usage\r\n * registerAction('someAction', 'someEvent', function () { ... });\r\n * registerAction('someAction', function () { ... });\r\n * registerAction(\r\n * {type: 'someAction', event: 'someEvent', update: 'updateView'},\r\n * function () { ... }\r\n * );\r\n *\r\n * @param {(string|Object)} actionInfo\r\n * @param {string} actionInfo.type\r\n * @param {string} [actionInfo.event]\r\n * @param {string} [actionInfo.update]\r\n * @param {string} [eventName]\r\n * @param {Function} action\r\n */\r\nexport function registerAction(type: string, eventName: string, action: ActionHandler): void;\r\nexport function registerAction(type: string, action: ActionHandler): void;\r\nexport function registerAction(actionInfo: ActionInfo, action: ActionHandler): void;\r\nexport function registerAction(\r\n actionInfo: string | ActionInfo,\r\n eventName: string | ActionHandler,\r\n action?: ActionHandler\r\n): void {\r\n if (isFunction(eventName)) {\r\n action = eventName;\r\n eventName = '';\r\n }\r\n const actionType = isObject(actionInfo)\r\n ? (actionInfo as ActionInfo).type\r\n : ([actionInfo, actionInfo = {\r\n event: eventName\r\n } as ActionInfo][0]);\r\n\r\n // Event name is all lowercase\r\n (actionInfo as ActionInfo).event = (\r\n (actionInfo as ActionInfo).event || actionType as string\r\n ).toLowerCase();\r\n eventName = (actionInfo as ActionInfo).event;\r\n\r\n if (eventActionMap[eventName as string]) {\r\n // Already registered.\r\n return;\r\n }\r\n\r\n // Validate action type and event name.\r\n assert(ACTION_REG.test(actionType as string) && ACTION_REG.test(eventName));\r\n\r\n if (!actions[actionType as string]) {\r\n actions[actionType as string] = {action: action, actionInfo: actionInfo as ActionInfo};\r\n }\r\n eventActionMap[eventName as string] = actionType as string;\r\n}\r\n\r\nexport function registerCoordinateSystem(\r\n type: string,\r\n coordSysCreator: CoordinateSystemCreator\r\n): void {\r\n CoordinateSystemManager.register(type, coordSysCreator);\r\n}\r\n\r\n/**\r\n * Get dimensions of specified coordinate system.\r\n * @param {string} type\r\n * @return {Array.}\r\n */\r\nexport function getCoordinateSystemDimensions(type: string): DimensionDefinitionLoose[] {\r\n const coordSysCreator = CoordinateSystemManager.get(type);\r\n if (coordSysCreator) {\r\n return coordSysCreator.getDimensionsInfo\r\n ? coordSysCreator.getDimensionsInfo()\r\n : coordSysCreator.dimensions.slice();\r\n }\r\n}\r\n\r\nexport {registerLocale} from './locale';\r\n\r\n/**\r\n * Layout is a special stage of visual encoding\r\n * Most visual encoding like color are common for different chart\r\n * But each chart has it's own layout algorithm\r\n */\r\nfunction registerLayout(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;\r\nfunction registerLayout(layoutTask: StageHandler | StageHandlerOverallReset): void;\r\nfunction registerLayout(\r\n priority: number | StageHandler | StageHandlerOverallReset,\r\n layoutTask?: StageHandler | StageHandlerOverallReset\r\n): void {\r\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\r\n}\r\n\r\nfunction registerVisual(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;\r\nfunction registerVisual(layoutTask: StageHandler | StageHandlerOverallReset): void;\r\nfunction registerVisual(\r\n priority: number | StageHandler | StageHandlerOverallReset,\r\n visualTask?: StageHandler | StageHandlerOverallReset\r\n): void {\r\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\r\n}\r\n\r\nexport {registerLayout, registerVisual};\r\n\r\nconst registeredTasks: (StageHandler | StageHandlerOverallReset)[] = [];\r\n\r\nfunction normalizeRegister(\r\n targetList: StageHandler[],\r\n priority: number | StageHandler | StageHandlerOverallReset,\r\n fn: StageHandler | StageHandlerOverallReset,\r\n defaultPriority: number,\r\n visualType?: StageHandlerInternal['visualType']\r\n): void {\r\n if (isFunction(priority) || isObject(priority)) {\r\n fn = priority as (StageHandler | StageHandlerOverallReset);\r\n priority = defaultPriority;\r\n }\r\n\r\n if (__DEV__) {\r\n if (isNaN(priority) || priority == null) {\r\n throw new Error('Illegal priority');\r\n }\r\n // Check duplicate\r\n each(targetList, function (wrap) {\r\n assert((wrap as StageHandlerInternal).__raw !== fn);\r\n });\r\n }\r\n\r\n // Already registered\r\n if (indexOf(registeredTasks, fn) >= 0) {\r\n return;\r\n }\r\n registeredTasks.push(fn);\r\n\r\n const stageHandler = Scheduler.wrapStageHandler(fn, visualType);\r\n\r\n stageHandler.__prio = priority;\r\n stageHandler.__raw = fn;\r\n targetList.push(stageHandler);\r\n}\r\n\r\nexport function registerLoading(\r\n name: string,\r\n loadingFx: LoadingEffectCreator\r\n): void {\r\n loadingEffects[name] = loadingFx;\r\n}\r\n\r\n/**\r\n * ZRender need a canvas context to do measureText.\r\n * But in node environment canvas may be created by node-canvas.\r\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\r\n *\r\n *\r\n * @deprecated use setPlatformAPI({ createCanvas }) instead.\r\n *\r\n * @example\r\n * let Canvas = require('canvas');\r\n * let echarts = require('echarts');\r\n * echarts.setCanvasCreator(function () {\r\n * // Small size is enough.\r\n * return new Canvas(32, 32);\r\n * });\r\n */\r\nexport function setCanvasCreator(creator: () => HTMLCanvasElement): void {\r\n if (__DEV__) {\r\n deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.');\r\n }\r\n setPlatformAPI({\r\n createCanvas: creator\r\n });\r\n}\r\n\r\ntype RegisterMapParams = Parameters;\r\n/**\r\n * The parameters and usage: see `geoSourceManager.registerMap`.\r\n * Compatible with previous `echarts.registerMap`.\r\n */\r\nexport function registerMap(\r\n mapName: RegisterMapParams[0],\r\n geoJson: RegisterMapParams[1],\r\n specialAreas?: RegisterMapParams[2]\r\n): void {\r\n const registerMap = getImpl('registerMap');\r\n registerMap && registerMap(mapName, geoJson, specialAreas);\r\n}\r\n\r\nexport function getMap(mapName: string) {\r\n const getMap = getImpl('getMap');\r\n return getMap && getMap(mapName);\r\n}\r\n\r\nexport const registerTransform = registerExternalTransform;\r\n\r\n/**\r\n * Globa dispatchAction to a specified chart instance.\r\n */\r\n// export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters[1]) {\r\n// if (!payload || !payload.chartId) {\r\n// // Must have chartId to find chart\r\n// return;\r\n// }\r\n// const chart = instances[payload.chartId];\r\n// if (chart) {\r\n// chart.dispatchAction(payload, opt);\r\n// }\r\n// }\r\n\r\n\r\n\r\n// Builtin global visual\r\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\r\n\r\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\r\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\r\n\r\nregisterVisual(PRIORITY_VISUAL_DECAL, decal);\r\n\r\nregisterPreprocessor(backwardCompat);\r\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\r\nregisterLoading('default', loadingDefault);\r\n\r\n// Default actions\r\n\r\nregisterAction({\r\n type: HIGHLIGHT_ACTION_TYPE,\r\n event: HIGHLIGHT_ACTION_TYPE,\r\n update: HIGHLIGHT_ACTION_TYPE\r\n}, noop);\r\n\r\nregisterAction({\r\n type: DOWNPLAY_ACTION_TYPE,\r\n event: DOWNPLAY_ACTION_TYPE,\r\n update: DOWNPLAY_ACTION_TYPE\r\n}, noop);\r\n\r\nregisterAction({\r\n type: SELECT_ACTION_TYPE,\r\n event: SELECT_ACTION_TYPE,\r\n update: SELECT_ACTION_TYPE\r\n}, noop);\r\n\r\nregisterAction({\r\n type: UNSELECT_ACTION_TYPE,\r\n event: UNSELECT_ACTION_TYPE,\r\n update: UNSELECT_ACTION_TYPE\r\n}, noop);\r\n\r\nregisterAction({\r\n type: TOGGLE_SELECT_ACTION_TYPE,\r\n event: TOGGLE_SELECT_ACTION_TYPE,\r\n update: TOGGLE_SELECT_ACTION_TYPE\r\n}, noop);\r\n\r\n// Default theme\r\nregisterTheme('light', lightTheme);\r\nregisterTheme('dark', darkTheme);\r\n\r\n// For backward compatibility, where the namespace `dataTool` will\r\n// be mounted on `echarts` is the extension `dataTool` is imported.\r\nexport const dataTool = {};\r\n\r\nexport interface EChartsType extends ECharts {}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n registerPreprocessor,\r\n registerProcessor,\r\n registerPostInit,\r\n registerPostUpdate,\r\n registerAction,\r\n registerCoordinateSystem,\r\n registerLayout,\r\n registerVisual,\r\n registerTransform,\r\n registerLoading,\r\n registerMap,\r\n registerUpdateLifecycle,\r\n PRIORITY\r\n} from './core/echarts';\r\nimport ComponentView from './view/Component';\r\nimport ChartView from './view/Chart';\r\nimport ComponentModel from './model/Component';\r\nimport SeriesModel from './model/Series';\r\nimport { isFunction, indexOf, isArray, each } from 'zrender/src/core/util';\r\nimport { Constructor } from './util/clazz';\r\nimport { SubTypeDefaulter } from './util/component';\r\nimport { registerImpl } from './core/impl';\r\nimport { registerPainter } from 'zrender/src/zrender';\r\n\r\nconst extensions: (EChartsExtensionInstaller | EChartsExtension)[] = [];\r\n\r\nconst extensionRegisters = {\r\n registerPreprocessor,\r\n registerProcessor,\r\n registerPostInit,\r\n registerPostUpdate,\r\n registerUpdateLifecycle,\r\n registerAction,\r\n registerCoordinateSystem,\r\n registerLayout,\r\n registerVisual,\r\n registerTransform,\r\n registerLoading,\r\n registerMap,\r\n registerImpl,\r\n\r\n PRIORITY,\r\n\r\n ComponentModel,\r\n ComponentView,\r\n SeriesModel,\r\n ChartView,\r\n // TODO Use ComponentModel and SeriesModel instead of Constructor\r\n registerComponentModel(ComponentModelClass: Constructor) {\r\n ComponentModel.registerClass(ComponentModelClass);\r\n },\r\n registerComponentView(ComponentViewClass: typeof ComponentView) {\r\n ComponentView.registerClass(ComponentViewClass);\r\n },\r\n registerSeriesModel(SeriesModelClass: Constructor) {\r\n SeriesModel.registerClass(SeriesModelClass);\r\n },\r\n registerChartView(ChartViewClass: typeof ChartView) {\r\n ChartView.registerClass(ChartViewClass);\r\n },\r\n registerSubTypeDefaulter(componentType: string, defaulter: SubTypeDefaulter) {\r\n ComponentModel.registerSubTypeDefaulter(componentType, defaulter);\r\n },\r\n registerPainter(painterType: string, PainterCtor: Parameters[1]) {\r\n registerPainter(painterType, PainterCtor);\r\n }\r\n};\r\n\r\nexport type EChartsExtensionInstallRegisters = typeof extensionRegisters;\r\n\r\nexport type EChartsExtensionInstaller = (ec: EChartsExtensionInstallRegisters) => void;\r\nexport interface EChartsExtension {\r\n install: EChartsExtensionInstaller\r\n}\r\n\r\nexport function use(\r\n ext: EChartsExtensionInstaller | EChartsExtension | (EChartsExtensionInstaller | EChartsExtension)[]\r\n) {\r\n if (isArray(ext)) {\r\n // use([ChartLine, ChartBar]);\r\n each(ext, (singleExt) => {\r\n use(singleExt);\r\n });\r\n return;\r\n }\r\n\r\n if (indexOf(extensions, ext) >= 0) {\r\n return;\r\n }\r\n extensions.push(ext);\r\n\r\n if (isFunction(ext)) {\r\n ext = {\r\n install: ext\r\n };\r\n }\r\n ext.install(extensionRegisters);\r\n}\r\n\r\n// A simpler use type for exporting to reduce exported inner modules.\r\nexport type EChartsExtensionInstallerSimple = (registers: any) => void;\r\ntype SimpleEChartsExtensionType = EChartsExtensionInstallerSimple | { install: EChartsExtensionInstallerSimple };\r\nexport declare function useSimple(ext: SimpleEChartsExtensionType | (SimpleEChartsExtensionType)[]): void;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {ArrayLike} from 'zrender/src/core/types';\r\n\r\n// return key.\r\ntype DiffKeyGetter =\r\n (this: DataDiffer, value: unknown, index: number) => string;\r\n\r\ntype DiffCallbackAdd = (newIndex: number) => void;\r\ntype DiffCallbackUpdate = (newIndex: number, oldIndex: number) => void;\r\ntype DiffCallbackRemove = (oldIndex: number) => void;\r\ntype DiffCallbackUpdateManyToOne = (newIndex: number, oldIndex: number[]) => void;\r\ntype DiffCallbackUpdateOneToMany = (newIndex: number[], oldIndex: number) => void;\r\ntype DiffCallbackUpdateManyToMany = (newIndex: number[], oldIndex: number[]) => void;\r\n\r\n/**\r\n * The value of `DataIndexMap` can only be:\r\n * + a number\r\n * + a number[] that length >= 2.\r\n * + null/undefined\r\n */\r\ntype DataIndexMap = {[key: string]: number | number[]};\r\n\r\nfunction dataIndexMapValueLength(\r\n valNumOrArrLengthMoreThan2: number | number[]\r\n): number {\r\n return valNumOrArrLengthMoreThan2 == null\r\n ? 0\r\n : ((valNumOrArrLengthMoreThan2 as number[]).length || 1);\r\n}\r\n\r\nfunction defaultKeyGetter(item: string): string {\r\n return item;\r\n}\r\n\r\nexport type DataDiffMode = 'oneToOne' | 'multiple';\r\n\r\nclass DataDiffer {\r\n\r\n private _old: ArrayLike;\r\n private _new: ArrayLike;\r\n private _oldKeyGetter: DiffKeyGetter;\r\n private _newKeyGetter: DiffKeyGetter;\r\n private _add: DiffCallbackAdd;\r\n private _update: DiffCallbackUpdate;\r\n private _updateManyToOne: DiffCallbackUpdateManyToOne;\r\n private _updateOneToMany: DiffCallbackUpdateOneToMany;\r\n private _updateManyToMany: DiffCallbackUpdateManyToMany;\r\n private _remove: DiffCallbackRemove;\r\n private _diffModeMultiple: boolean;\r\n\r\n readonly context: CTX;\r\n\r\n /**\r\n * @param context Can be visited by this.context in callback.\r\n */\r\n constructor(\r\n oldArr: ArrayLike,\r\n newArr: ArrayLike,\r\n oldKeyGetter?: DiffKeyGetter,\r\n newKeyGetter?: DiffKeyGetter,\r\n context?: CTX,\r\n // By default: 'oneToOne'.\r\n diffMode?: DataDiffMode\r\n ) {\r\n this._old = oldArr;\r\n this._new = newArr;\r\n\r\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\r\n this._newKeyGetter = newKeyGetter || defaultKeyGetter;\r\n\r\n // Visible in callback via `this.context`;\r\n this.context = context;\r\n\r\n this._diffModeMultiple = diffMode === 'multiple';\r\n }\r\n\r\n /**\r\n * Callback function when add a data\r\n */\r\n add(func: DiffCallbackAdd): this {\r\n this._add = func;\r\n return this;\r\n }\r\n\r\n /**\r\n * Callback function when update a data\r\n */\r\n update(func: DiffCallbackUpdate): this {\r\n this._update = func;\r\n return this;\r\n }\r\n\r\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\r\n updateManyToOne(func: DiffCallbackUpdateManyToOne): this {\r\n this._updateManyToOne = func;\r\n return this;\r\n }\r\n\r\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\r\n updateOneToMany(func: DiffCallbackUpdateOneToMany): this {\r\n this._updateOneToMany = func;\r\n return this;\r\n }\r\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\r\n updateManyToMany(func: DiffCallbackUpdateManyToMany): this {\r\n this._updateManyToMany = func;\r\n return this;\r\n }\r\n\r\n /**\r\n * Callback function when remove a data\r\n */\r\n remove(func: DiffCallbackRemove): this {\r\n this._remove = func;\r\n return this;\r\n }\r\n\r\n execute(): void {\r\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\r\n }\r\n\r\n private _executeOneToOne(): void {\r\n const oldArr = this._old;\r\n const newArr = this._new;\r\n const newDataIndexMap: DataIndexMap = {};\r\n const oldDataKeyArr: string[] = new Array(oldArr.length);\r\n const newDataKeyArr: string[] = new Array(newArr.length);\r\n\r\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n\r\n for (let i = 0; i < oldArr.length; i++) {\r\n const oldKey = oldDataKeyArr[i];\r\n const newIdxMapVal = newDataIndexMap[oldKey];\r\n const newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n\r\n // idx can never be empty array here. see 'set null' logic below.\r\n if (newIdxMapValLen > 1) {\r\n // Consider there is duplicate key (for example, use dataItem.name as key).\r\n // We should make sure every item in newArr and oldArr can be visited.\r\n const newIdx = (newIdxMapVal as number[]).shift();\r\n if ((newIdxMapVal as number[]).length === 1) {\r\n newDataIndexMap[oldKey] = (newIdxMapVal as number[])[0];\r\n }\r\n this._update && this._update(newIdx as number, i);\r\n }\r\n else if (newIdxMapValLen === 1) {\r\n newDataIndexMap[oldKey] = null;\r\n this._update && this._update(newIdxMapVal as number, i);\r\n }\r\n else {\r\n this._remove && this._remove(i);\r\n }\r\n }\r\n\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n }\r\n\r\n /**\r\n * For example, consider the case:\r\n * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\r\n * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\r\n * Where:\r\n * o0, o1, n0 has key 'a' (many to one)\r\n * o5, n4, n5, n6 has key 'b' (one to many)\r\n * o2, n1 has key 'c' (one to one)\r\n * n2, n3 has key 'd' (add)\r\n * o3, o4 has key 'e' (remove)\r\n * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\r\n * Then:\r\n * (The order of the following directives are not ensured.)\r\n * this._updateManyToOne(n0, [o0, o1]);\r\n * this._updateOneToMany([n4, n5, n6], o5);\r\n * this._update(n1, o2);\r\n * this._remove(o3);\r\n * this._remove(o4);\r\n * this._remove(o6);\r\n * this._remove(o7);\r\n * this._add(n2);\r\n * this._add(n3);\r\n * this._add(n7);\r\n * this._add(n8);\r\n */\r\n private _executeMultiple(): void {\r\n const oldArr = this._old;\r\n const newArr = this._new;\r\n const oldDataIndexMap: DataIndexMap = {};\r\n const newDataIndexMap: DataIndexMap = {};\r\n const oldDataKeyArr: string[] = [];\r\n const newDataKeyArr: string[] = [];\r\n\r\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\r\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\r\n\r\n for (let i = 0; i < oldDataKeyArr.length; i++) {\r\n const oldKey = oldDataKeyArr[i];\r\n const oldIdxMapVal = oldDataIndexMap[oldKey];\r\n const newIdxMapVal = newDataIndexMap[oldKey];\r\n const oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\r\n const newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n\r\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\r\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal as number, oldIdxMapVal as number[]);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\r\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal as number[], oldIdxMapVal as number);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\r\n this._update && this._update(newIdxMapVal as number, oldIdxMapVal as number);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {\r\n this._updateManyToMany && this._updateManyToMany(newIdxMapVal as number[], oldIdxMapVal as number[]);\r\n newDataIndexMap[oldKey] = null;\r\n }\r\n else if (oldIdxMapValLen > 1) {\r\n for (let i = 0; i < oldIdxMapValLen; i++) {\r\n this._remove && this._remove((oldIdxMapVal as number[])[i]);\r\n }\r\n }\r\n else {\r\n this._remove && this._remove(oldIdxMapVal as number);\r\n }\r\n }\r\n\r\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\r\n }\r\n\r\n private _performRestAdd(newDataKeyArr: string[], newDataIndexMap: DataIndexMap) {\r\n for (let i = 0; i < newDataKeyArr.length; i++) {\r\n const newKey = newDataKeyArr[i];\r\n const newIdxMapVal = newDataIndexMap[newKey];\r\n const idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\r\n if (idxMapValLen > 1) {\r\n for (let j = 0; j < idxMapValLen; j++) {\r\n this._add && this._add((newIdxMapVal as number[])[j]);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n this._add && this._add(newIdxMapVal as number);\r\n }\r\n // Support both `newDataKeyArr` are duplication removed or not removed.\r\n newDataIndexMap[newKey] = null;\r\n }\r\n }\r\n\r\n private _initIndexMap(\r\n arr: ArrayLike,\r\n // Can be null.\r\n map: DataIndexMap,\r\n // In 'byKey', the output `keyArr` is duplication removed.\r\n // In 'byIndex', the output `keyArr` is not duplication removed and\r\n // its indices are accurately corresponding to `arr`.\r\n keyArr: string[],\r\n keyGetterName: '_oldKeyGetter' | '_newKeyGetter'\r\n ): void {\r\n const cbModeMultiple = this._diffModeMultiple;\r\n\r\n for (let i = 0; i < arr.length; i++) {\r\n // Add prefix to avoid conflict with Object.prototype.\r\n const key = '_ec_' + this[keyGetterName](arr[i], i);\r\n if (!cbModeMultiple) {\r\n keyArr[i] = key;\r\n }\r\n if (!map) {\r\n continue;\r\n }\r\n\r\n const idxMapVal = map[key];\r\n const idxMapValLen = dataIndexMapValueLength(idxMapVal);\r\n\r\n if (idxMapValLen === 0) {\r\n // Simple optimize: in most cases, one index has one key,\r\n // do not need array.\r\n map[key] = i;\r\n if (cbModeMultiple) {\r\n keyArr.push(key);\r\n }\r\n }\r\n else if (idxMapValLen === 1) {\r\n map[key] = [idxMapVal as number, i];\r\n }\r\n else {\r\n (idxMapVal as number[]).push(i);\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexport default DataDiffer;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport {each, createHashMap, assert, map} from 'zrender/src/core/util';\r\nimport SeriesData from '../SeriesData';\r\nimport {\r\n DimensionName, VISUAL_DIMENSIONS, DimensionType, DimensionIndex\r\n} from '../../util/types';\r\nimport { DataStoreDimensionType } from '../DataStore';\r\nimport { SeriesDataSchema } from './SeriesDataSchema';\r\n\r\nexport type DimensionSummaryEncode = {\r\n defaultedLabel: DimensionName[],\r\n defaultedTooltip: DimensionName[],\r\n [coordOrVisualDimName: string]:\r\n // index: coordDimIndex, value: dataDimName\r\n DimensionName[]\r\n};\r\nexport type DimensionSummary = {\r\n encode: DimensionSummaryEncode,\r\n // Those details that can be expose to users are put int `userOutput`.\r\n userOutput: DimensionUserOuput,\r\n // All of the data dim names that mapped by coordDim.\r\n dataDimsOnCoord: DimensionName[],\r\n dataDimIndicesOnCoord: DimensionIndex[],\r\n encodeFirstDimNotExtra: {[coordDim: string]: DimensionName},\r\n};\r\n\r\nexport type DimensionUserOuputEncode = {\r\n // index: coordDimIndex, value: dataDimIndex\r\n [coordOrVisualDimName: string]: DimensionIndex[]\r\n};\r\n\r\nclass DimensionUserOuput {\r\n private _encode: DimensionUserOuputEncode;\r\n private _cachedDimNames: DimensionName[];\r\n private _schema?: SeriesDataSchema;\r\n\r\n constructor(\r\n encode: DimensionUserOuputEncode,\r\n dimRequest?: SeriesDataSchema\r\n ) {\r\n this._encode = encode;\r\n this._schema = dimRequest;\r\n }\r\n\r\n get(): {\r\n fullDimensions: DimensionName[];\r\n encode: DimensionUserOuputEncode;\r\n } {\r\n return {\r\n // Do not generate full dimension name until fist used.\r\n fullDimensions: this._getFullDimensionNames(),\r\n encode: this._encode\r\n };\r\n }\r\n\r\n /**\r\n * Get all data store dimension names.\r\n * Theoretically a series data store is defined both by series and used dataset (if any).\r\n * If some dimensions are omitted for performance reason in `this.dimensions`,\r\n * the dimension name may not be auto-generated if user does not specify a dimension name.\r\n * In this case, the dimension name is `null`/`undefined`.\r\n */\r\n private _getFullDimensionNames(): DimensionName[] {\r\n if (!this._cachedDimNames) {\r\n this._cachedDimNames = this._schema\r\n ? this._schema.makeOutputDimensionNames()\r\n : [];\r\n }\r\n return this._cachedDimNames;\r\n }\r\n};\r\n\r\n\r\nexport function summarizeDimensions(\r\n data: SeriesData,\r\n schema?: SeriesDataSchema\r\n): DimensionSummary {\r\n const summary: DimensionSummary = {} as DimensionSummary;\r\n const encode = summary.encode = {} as DimensionSummaryEncode;\r\n const notExtraCoordDimMap = createHashMap<1, DimensionName>();\r\n let defaultedLabel = [] as DimensionName[];\r\n let defaultedTooltip = [] as DimensionName[];\r\n\r\n const userOutputEncode = {} as DimensionUserOuputEncode;\r\n\r\n each(data.dimensions, function (dimName) {\r\n const dimItem = data.getDimensionInfo(dimName);\r\n\r\n const coordDim = dimItem.coordDim;\r\n if (coordDim) {\r\n if (__DEV__) {\r\n assert(VISUAL_DIMENSIONS.get(coordDim as any) == null);\r\n }\r\n\r\n const coordDimIndex = dimItem.coordDimIndex;\r\n getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName;\r\n\r\n if (!dimItem.isExtraCoord) {\r\n notExtraCoordDimMap.set(coordDim, 1);\r\n\r\n // Use the last coord dim (and label friendly) as default label,\r\n // because when dataset is used, it is hard to guess which dimension\r\n // can be value dimension. If both show x, y on label is not look good,\r\n // and conventionally y axis is focused more.\r\n if (mayLabelDimType(dimItem.type)) {\r\n defaultedLabel[0] = dimName;\r\n }\r\n\r\n // User output encode do not contain generated coords.\r\n // And it only has index. User can use index to retrieve value from the raw item array.\r\n getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] =\r\n data.getDimensionIndex(dimItem.name);\r\n }\r\n if (dimItem.defaultTooltip) {\r\n defaultedTooltip.push(dimName);\r\n }\r\n }\r\n\r\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\r\n const encodeArr = getOrCreateEncodeArr(encode, otherDim);\r\n\r\n const dimIndex = dimItem.otherDims[otherDim];\r\n if (dimIndex != null && dimIndex !== false) {\r\n encodeArr[dimIndex] = dimItem.name;\r\n }\r\n });\r\n });\r\n\r\n let dataDimsOnCoord = [] as DimensionName[];\r\n const encodeFirstDimNotExtra = {} as {[coordDim: string]: DimensionName};\r\n\r\n notExtraCoordDimMap.each(function (v, coordDim) {\r\n const dimArr = encode[coordDim];\r\n encodeFirstDimNotExtra[coordDim] = dimArr[0];\r\n // Not necessary to remove duplicate, because a data\r\n // dim canot on more than one coordDim.\r\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\r\n });\r\n\r\n summary.dataDimsOnCoord = dataDimsOnCoord;\r\n summary.dataDimIndicesOnCoord = map(\r\n dataDimsOnCoord, dimName => data.getDimensionInfo(dimName).storeDimIndex\r\n );\r\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\r\n\r\n const encodeLabel = encode.label;\r\n // FIXME `encode.label` is not recommended, because formatter cannot be set\r\n // in this way. Use label.formatter instead. Maybe remove this approach someday.\r\n if (encodeLabel && encodeLabel.length) {\r\n defaultedLabel = encodeLabel.slice();\r\n }\r\n\r\n const encodeTooltip = encode.tooltip;\r\n if (encodeTooltip && encodeTooltip.length) {\r\n defaultedTooltip = encodeTooltip.slice();\r\n }\r\n else if (!defaultedTooltip.length) {\r\n defaultedTooltip = defaultedLabel.slice();\r\n }\r\n\r\n encode.defaultedLabel = defaultedLabel;\r\n encode.defaultedTooltip = defaultedTooltip;\r\n\r\n summary.userOutput = new DimensionUserOuput(userOutputEncode, schema);\r\n\r\n return summary;\r\n}\r\n\r\nfunction getOrCreateEncodeArr(\r\n encode: DimensionSummaryEncode | DimensionUserOuputEncode, dim: DimensionName\r\n): (DimensionIndex | DimensionName)[] {\r\n if (!encode.hasOwnProperty(dim)) {\r\n encode[dim] = [];\r\n }\r\n return encode[dim];\r\n}\r\n\r\n// FIXME:TS should be type `AxisType`\r\nexport function getDimensionTypeByAxis(axisType: string): DataStoreDimensionType {\r\n return axisType === 'category'\r\n ? 'ordinal'\r\n : axisType === 'time'\r\n ? 'time'\r\n : 'float';\r\n}\r\n\r\nfunction mayLabelDimType(dimType: DimensionType): boolean {\r\n // In most cases, ordinal and time do not suitable for label.\r\n // Ordinal info can be displayed on axis. Time is too long.\r\n return !(dimType === 'ordinal' || dimType === 'time');\r\n}\r\n\r\n// function findTheLastDimMayLabel(data) {\r\n// // Get last value dim\r\n// let dimensions = data.dimensions.slice();\r\n// let valueType;\r\n// let valueDim;\r\n// while (dimensions.length && (\r\n// valueDim = dimensions.pop(),\r\n// valueType = data.getDimensionInfo(valueDim).type,\r\n// valueType === 'ordinal' || valueType === 'time'\r\n// )) {} // jshint ignore:line\r\n// return valueDim;\r\n// }\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport OrdinalMeta from './OrdinalMeta';\r\nimport { DataVisualDimensions, DimensionType } from '../util/types';\r\n\r\nclass SeriesDimensionDefine {\r\n\r\n /**\r\n * Dimension type. The enumerable values are the key of\r\n * Optional.\r\n */\r\n type?: DimensionType;\r\n\r\n /**\r\n * Dimension name.\r\n * Mandatory.\r\n */\r\n name: string;\r\n /**\r\n * The origin name in dimsDef, see source helper.\r\n * If displayName given, the tooltip will displayed vertically.\r\n * Optional.\r\n */\r\n displayName?: string;\r\n\r\n // FIXME: check whether it is still used.\r\n // See Series.ts#formatArrayValue\r\n tooltip?: boolean;\r\n\r\n /**\r\n * This dimension maps to the the dimension in dataStore by `storeDimIndex`.\r\n * Notice the facts:\r\n * 1. When there are too many dimensions in data store, seriesData only save the\r\n * used store dimensions.\r\n * 2. We use dimensionIndex but not name to reference store dimension\r\n * becuause the dataset dimension definition might has no name specified by users,\r\n * or names in sereis dimension definition might be different from dataset.\r\n */\r\n storeDimIndex?: number;\r\n\r\n /**\r\n * Which coordSys dimension this dimension mapped to.\r\n * A `coordDim` can be a \"coordSysDim\" that the coordSys required\r\n * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`),\r\n * or an generated \"extra coord name\" if does not mapped to any \"coordSysDim\"\r\n * (That is determined by whether `isExtraCoord` is `true`).\r\n * Mandatory.\r\n */\r\n coordDim?: string;\r\n\r\n /**\r\n * The index of this dimension in `series.encode[coordDim]`.\r\n * Mandatory.\r\n */\r\n coordDimIndex?: number;\r\n /**\r\n * The format of `otherDims` is:\r\n * ```js\r\n * {\r\n * tooltip?: number\r\n * label?: number\r\n * itemName?: number\r\n * seriesName?: number\r\n * }\r\n * ```\r\n *\r\n * A `series.encode` can specified these fields:\r\n * ```js\r\n * encode: {\r\n * // \"3, 1, 5\" is the index of data dimension.\r\n * tooltip: [3, 1, 5],\r\n * label: [0, 3],\r\n * ...\r\n * }\r\n * ```\r\n * `otherDims` is the parse result of the `series.encode` above, like:\r\n * ```js\r\n * // Suppose the index of this data dimension is `3`.\r\n * this.otherDims = {\r\n * // `3` is at the index `0` of the `encode.tooltip`\r\n * tooltip: 0,\r\n * // `3` is at the index `1` of the `encode.label`\r\n * label: 1\r\n * };\r\n * ```\r\n *\r\n * This prop should never be `null`/`undefined` after initialized.\r\n */\r\n otherDims?: DataVisualDimensions = {};\r\n\r\n /**\r\n * Be `true` if this dimension is not mapped to any \"coordSysDim\" that the\r\n * \"coordSys\" required.\r\n * Mandatory.\r\n */\r\n isExtraCoord?: boolean;\r\n /**\r\n * If this dimension if for calculated value like stacking\r\n */\r\n isCalculationCoord?: boolean;\r\n\r\n defaultTooltip?: boolean;\r\n\r\n ordinalMeta?: OrdinalMeta;\r\n\r\n /**\r\n * Whether to create inverted indices.\r\n */\r\n createInvertedIndices?: boolean;\r\n\r\n /**\r\n * @param opt All of the fields will be shallow copied.\r\n */\r\n constructor(opt?: object | SeriesDimensionDefine) {\r\n if (opt != null) {\r\n zrUtil.extend(this, opt);\r\n }\r\n }\r\n\r\n};\r\n\r\nexport default SeriesDimensionDefine;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { createHashMap, HashMap, isObject, retrieve2 } from 'zrender/src/core/util';\r\nimport { makeInner } from '../../util/model';\r\nimport {\r\n DimensionDefinition, DimensionDefinitionLoose, DimensionIndex, DimensionName, DimensionType\r\n} from '../../util/types';\r\nimport { DataStoreDimensionDefine } from '../DataStore';\r\nimport OrdinalMeta from '../OrdinalMeta';\r\nimport SeriesDimensionDefine from '../SeriesDimensionDefine';\r\nimport { shouldRetrieveDataByName, Source } from '../Source';\r\n\r\nconst inner = makeInner<{\r\n dimNameMap: HashMap;\r\n}, Source>();\r\n\r\nconst dimTypeShort = {\r\n float: 'f', int: 'i', ordinal: 'o', number: 'n', time: 't'\r\n} as const;\r\n\r\n/**\r\n * Represents the dimension requirement of a series.\r\n *\r\n * NOTICE:\r\n * When there are too many dimensions in dataset and many series, only the used dimensions\r\n * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.\r\n * But users may query data by other unused dimension names.\r\n * In this case, users can only query data if and only if they have defined dimension names\r\n * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from\r\n * `source` dimensions.\r\n */\r\nexport class SeriesDataSchema {\r\n\r\n /**\r\n * When there are too many dimensions, `dimensionDefineList` might only contain\r\n * used dimensions.\r\n *\r\n * CAUTION:\r\n * Should have been sorted by `storeDimIndex` asc.\r\n *\r\n * PENDING:\r\n * The item can still be modified outsite.\r\n * But MUST NOT add/remove item of this array.\r\n */\r\n readonly dimensions: SeriesDimensionDefine[];\r\n\r\n readonly source: Source;\r\n\r\n private _fullDimCount: number;\r\n private _dimNameMap: ReturnType['dimNameMap'];\r\n private _dimOmitted: boolean;\r\n\r\n constructor(opt: {\r\n source: Source,\r\n dimensions: SeriesDimensionDefine[],\r\n fullDimensionCount: number,\r\n dimensionOmitted: boolean\r\n }) {\r\n this.dimensions = opt.dimensions;\r\n this._dimOmitted = opt.dimensionOmitted;\r\n this.source = opt.source;\r\n this._fullDimCount = opt.fullDimensionCount;\r\n\r\n this._updateDimOmitted(opt.dimensionOmitted);\r\n }\r\n\r\n isDimensionOmitted(): boolean {\r\n return this._dimOmitted;\r\n }\r\n\r\n private _updateDimOmitted(dimensionOmitted: boolean): void {\r\n this._dimOmitted = dimensionOmitted;\r\n if (!dimensionOmitted) {\r\n return;\r\n }\r\n if (!this._dimNameMap) {\r\n this._dimNameMap = ensureSourceDimNameMap(this.source);\r\n }\r\n }\r\n\r\n /**\r\n * @caution Can only be used when `dimensionOmitted: true`.\r\n *\r\n * Get index by user defined dimension name (i.e., not internal generate name).\r\n * That is, get index from `dimensionsDefine`.\r\n * If no `dimensionsDefine`, or no name get, return -1.\r\n */\r\n getSourceDimensionIndex(dimName: DimensionName): DimensionIndex {\r\n return retrieve2(this._dimNameMap.get(dimName), -1);\r\n }\r\n\r\n /**\r\n * @caution Can only be used when `dimensionOmitted: true`.\r\n *\r\n * Notice: may return `null`/`undefined` if user not specify dimension names.\r\n */\r\n getSourceDimension(dimIndex: DimensionIndex): DimensionDefinition {\r\n const dimensionsDefine = this.source.dimensionsDefine;\r\n if (dimensionsDefine) {\r\n return dimensionsDefine[dimIndex];\r\n }\r\n }\r\n\r\n makeStoreSchema(): {\r\n dimensions: DataStoreDimensionDefine[];\r\n hash: string\r\n } {\r\n const dimCount = this._fullDimCount;\r\n const willRetrieveDataByName = shouldRetrieveDataByName(this.source);\r\n const makeHashStrict = !shouldOmitUnusedDimensions(dimCount);\r\n\r\n // If source don't have dimensions or series don't omit unsed dimensions.\r\n // Generate from seriesDimList directly\r\n let dimHash = '';\r\n const dims: DataStoreDimensionDefine[] = [];\r\n\r\n for (let fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) {\r\n let property: string;\r\n let type: DimensionType;\r\n let ordinalMeta: OrdinalMeta;\r\n\r\n const seriesDimDef = this.dimensions[seriesDimIdx];\r\n // The list has been sorted by `storeDimIndex` asc.\r\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\r\n property = willRetrieveDataByName ? seriesDimDef.name : null;\r\n type = seriesDimDef.type;\r\n ordinalMeta = seriesDimDef.ordinalMeta;\r\n\r\n seriesDimIdx++;\r\n }\r\n else {\r\n const sourceDimDef = this.getSourceDimension(fullDimIdx);\r\n if (sourceDimDef) {\r\n property = willRetrieveDataByName ? sourceDimDef.name : null;\r\n type = sourceDimDef.type;\r\n }\r\n }\r\n\r\n dims.push({ property, type, ordinalMeta });\r\n\r\n // If retrieving data by index,\r\n // use to determine whether data can be shared.\r\n // (Because in this case there might be no dimension name defined in dataset, but indices always exists).\r\n // (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash).\r\n // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`),\r\n // use in hash.\r\n if (willRetrieveDataByName\r\n && property != null\r\n // For data stack, we have make sure each series has its own dim on this store.\r\n // So we do not add property to hash to make sure they can share this store.\r\n && (!seriesDimDef || !seriesDimDef.isCalculationCoord)\r\n ) {\r\n dimHash += (makeHashStrict\r\n // Use escape character '`' in case that property name contains '$'.\r\n ? property.replace(/\\`/g, '`1').replace(/\\$/g, '`2')\r\n // For better performance, when there are large dimensions, tolerant this defects that hardly meet.\r\n : property\r\n );\r\n }\r\n dimHash += '$';\r\n dimHash += dimTypeShort[type] || 'f';\r\n\r\n if (ordinalMeta) {\r\n dimHash += ordinalMeta.uid;\r\n }\r\n\r\n dimHash += '$';\r\n }\r\n\r\n // Source from endpoint(usually series) will be read differently\r\n // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different.\r\n // So we use this three props as key.\r\n const source = this.source;\r\n const hash = [\r\n source.seriesLayoutBy,\r\n source.startIndex,\r\n dimHash\r\n ].join('$$');\r\n\r\n return {\r\n dimensions: dims,\r\n hash: hash\r\n };\r\n }\r\n\r\n makeOutputDimensionNames(): DimensionName[] {\r\n const result = [] as DimensionName[];\r\n\r\n for (let fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) {\r\n let name: DimensionName;\r\n const seriesDimDef = this.dimensions[seriesDimIdx];\r\n // The list has been sorted by `storeDimIndex` asc.\r\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\r\n if (!seriesDimDef.isCalculationCoord) {\r\n name = seriesDimDef.name;\r\n }\r\n seriesDimIdx++;\r\n }\r\n else {\r\n const sourceDimDef = this.getSourceDimension(fullDimIdx);\r\n if (sourceDimDef) {\r\n name = sourceDimDef.name;\r\n }\r\n }\r\n result.push(name);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n appendCalculationDimension(dimDef: SeriesDimensionDefine): void {\r\n this.dimensions.push(dimDef);\r\n dimDef.isCalculationCoord = true;\r\n this._fullDimCount++;\r\n // If append dimension on a data store, consider the store\r\n // might be shared by different series, series dimensions not\r\n // really map to store dimensions.\r\n this._updateDimOmitted(true);\r\n }\r\n}\r\n\r\nexport function isSeriesDataSchema(\r\n schema: any\r\n): schema is SeriesDataSchema {\r\n return schema instanceof SeriesDataSchema;\r\n}\r\n\r\n\r\nexport function createDimNameMap(dimsDef: DimensionDefinitionLoose[]): HashMap {\r\n const dataDimNameMap = createHashMap();\r\n for (let i = 0; i < (dimsDef || []).length; i++) {\r\n const dimDefItemRaw = dimsDef[i];\r\n const userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw;\r\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\r\n dataDimNameMap.set(userDimName, i);\r\n }\r\n }\r\n return dataDimNameMap;\r\n}\r\n\r\nexport function ensureSourceDimNameMap(source: Source): HashMap {\r\n const innerSource = inner(source);\r\n return innerSource.dimNameMap || (\r\n innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine)\r\n );\r\n}\r\n\r\nexport function shouldOmitUnusedDimensions(dimCount: number): boolean {\r\n return dimCount > 30;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/* global Int32Array */\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {PathStyleProps} from 'zrender/src/graphic/Path';\r\nimport Model from '../model/Model';\r\nimport DataDiffer from './DataDiffer';\r\nimport {DataProvider, DefaultDataProvider} from './helper/dataProvider';\r\nimport {summarizeDimensions, DimensionSummary} from './helper/dimensionHelper';\r\nimport SeriesDimensionDefine from './SeriesDimensionDefine';\r\nimport {ArrayLike, Dictionary, FunctionPropertyNames} from 'zrender/src/core/types';\r\nimport Element from 'zrender/src/Element';\r\nimport {\r\n DimensionIndex, DimensionName, DimensionLoose, OptionDataItem,\r\n ParsedValue, ParsedValueNumeric,\r\n ModelOption, SeriesDataType, OptionSourceData, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL,\r\n DecalObject,\r\n OrdinalNumber,\r\n OrdinalRawValue\r\n} from '../util/types';\r\nimport {convertOptionIdName, isDataItemOption} from '../util/model';\r\nimport { setCommonECData } from '../util/innerStore';\r\nimport type Graph from './Graph';\r\nimport type Tree from './Tree';\r\nimport type { VisualMeta } from '../component/visualMap/VisualMapModel';\r\nimport {isSourceInstance, Source} from './Source';\r\nimport { LineStyleProps } from '../model/mixin/lineStyle';\r\nimport DataStore, { DataStoreDimensionDefine, DimValueGetter } from './DataStore';\r\nimport { isSeriesDataSchema, SeriesDataSchema } from './helper/SeriesDataSchema';\r\n\r\nconst isObject = zrUtil.isObject;\r\nconst map = zrUtil.map;\r\n\r\nconst CtorInt32Array = typeof Int32Array === 'undefined' ? Array : Int32Array;\r\n\r\n// Use prefix to avoid index to be the same as otherIdList[idx],\r\n// which will cause weird update animation.\r\nconst ID_PREFIX = 'e\\0\\0';\r\n\r\nconst INDEX_NOT_FOUND = -1;\r\n\r\ntype NameRepeatCount = {[name: string]: number};\r\ntype ItrParamDims = DimensionLoose | Array;\r\n// If Ctx not specified, use List as Ctx\r\ntype CtxOrList = unknown extends Ctx ? SeriesData : Ctx;\r\ntype EachCb0 = (this: CtxOrList, idx: number) => void;\r\ntype EachCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => void;\r\ntype EachCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) => void;\r\ntype EachCb = (this: CtxOrList, ...args: any) => void;\r\ntype FilterCb0 = (this: CtxOrList, idx: number) => boolean;\r\ntype FilterCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => boolean;\r\ntype FilterCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) => boolean;\r\ntype FilterCb = (this: CtxOrList, ...args: any) => boolean;\r\ntype MapArrayCb0 = (this: CtxOrList, idx: number) => any;\r\ntype MapArrayCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => any;\r\ntype MapArrayCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) => any;\r\ntype MapArrayCb = (this: CtxOrList, ...args: any) => any;\r\ntype MapCb1 = (this: CtxOrList, x: ParsedValue, idx: number) => ParsedValue | ParsedValue[];\r\ntype MapCb2 = (this: CtxOrList, x: ParsedValue, y: ParsedValue, idx: number) =>\r\n ParsedValue | ParsedValue[];\r\ntype MapCb = (this: CtxOrList, ...args: any) => ParsedValue | ParsedValue[];\r\n\r\ntype SeriesDimensionDefineLoose = string | object | SeriesDimensionDefine;\r\n\r\n// `SeriesDimensionLoose` and `SeriesDimensionName` is the dimension that is used by coordinate\r\n// system or declared in `series.encode`, which will be saved in `SeriesData`. Other dimension\r\n// might not be saved in `SeriesData` for performance consideration. See `createDimension` for\r\n// more details.\r\ntype SeriesDimensionLoose = DimensionLoose;\r\ntype SeriesDimensionName = DimensionName;\r\n// type SeriesDimensionIndex = DimensionIndex;\r\n\r\n\r\nconst TRANSFERABLE_PROPERTIES = [\r\n 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',\r\n '_dimSummary', 'userOutput',\r\n '_rawData', '_dimValueGetter',\r\n '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'\r\n];\r\n\r\nconst CLONE_PROPERTIES = [\r\n '_approximateExtent'\r\n];\r\n\r\nexport interface DefaultDataVisual {\r\n style: PathStyleProps\r\n // Draw type determined which prop should be set with encoded color.\r\n // It's only available on the global visual. Use getVisual('drawType') to access it.\r\n // It will be set in visual/style.ts module in the first priority.\r\n drawType: 'fill' | 'stroke'\r\n\r\n symbol?: string\r\n symbolSize?: number | number[]\r\n symbolRotate?: number\r\n symbolKeepAspect?: boolean\r\n symbolOffset?: string | number | (string | number)[]\r\n\r\n liftZ?: number\r\n // For legend.\r\n legendIcon?: string\r\n legendLineStyle?: LineStyleProps\r\n\r\n // visualMap will inject visualMeta data\r\n visualMeta?: VisualMeta[]\r\n\r\n // If color is encoded from palette\r\n colorFromPalette?: boolean\r\n\r\n decal?: DecalObject\r\n}\r\n\r\nexport interface DataCalculationInfo {\r\n stackedDimension: DimensionName;\r\n stackedByDimension: DimensionName;\r\n isStackedByIndex: boolean;\r\n stackedOverDimension: DimensionName;\r\n stackResultDimension: DimensionName;\r\n stackedOnSeries?: SERIES_MODEL;\r\n}\r\n\r\n// -----------------------------\r\n// Internal method declarations:\r\n// -----------------------------\r\nlet prepareInvertedIndex: (data: SeriesData) => void;\r\nlet getId: (data: SeriesData, rawIndex: number) => string;\r\nlet getIdNameFromStore: (data: SeriesData, dimIdx: number, dataIdx: number) => string;\r\nlet normalizeDimensions: (dimensions: ItrParamDims) => Array;\r\nlet transferProperties: (target: SeriesData, source: SeriesData) => void;\r\nlet cloneListForMapAndSample: (original: SeriesData) => SeriesData;\r\nlet makeIdFromName: (data: SeriesData, idx: number) => void;\r\n\r\nclass SeriesData<\r\n HostModel extends Model = Model,\r\n Visual extends DefaultDataVisual = DefaultDataVisual\r\n> {\r\n\r\n readonly type = 'list';\r\n\r\n /**\r\n * Name of dimensions list of SeriesData.\r\n *\r\n * @caution Carefully use the index of this array.\r\n * Because when DataStore is an extra high dimension(>30) dataset. We will only pick\r\n * the used dimensions from DataStore to avoid performance issue.\r\n */\r\n readonly dimensions: SeriesDimensionName[];\r\n\r\n // Information of each data dimension, like data type.\r\n private _dimInfos: Record;\r\n\r\n private _dimOmitted = false;\r\n private _schema?: SeriesDataSchema;\r\n /**\r\n * @pending\r\n * Actually we do not really need to convert dimensionIndex to dimensionName\r\n * and do not need `_dimIdxToName` if we do everything internally based on dimension\r\n * index rather than dimension name.\r\n */\r\n private _dimIdxToName?: zrUtil.HashMap;\r\n\r\n readonly hostModel: HostModel;\r\n\r\n /**\r\n * @readonly\r\n */\r\n dataType: SeriesDataType;\r\n\r\n /**\r\n * @readonly\r\n * Host graph if List is used to store graph nodes / edges.\r\n */\r\n graph?: Graph;\r\n\r\n /**\r\n * @readonly\r\n * Host tree if List is used to store tree nodes.\r\n */\r\n tree?: Tree;\r\n\r\n private _store: DataStore;\r\n\r\n private _nameList: string[] = [];\r\n private _idList: string[] = [];\r\n\r\n // Models of data option is stored sparse for optimizing memory cost\r\n // Never used yet (not used yet).\r\n // private _optionModels: Model[] = [];\r\n\r\n // Global visual properties after visual coding\r\n private _visual: Dictionary = {};\r\n\r\n // Global layout properties.\r\n private _layout: Dictionary = {};\r\n\r\n // Item visual properties after visual coding\r\n private _itemVisuals: Dictionary[] = [];\r\n\r\n // Item layout properties after layout\r\n private _itemLayouts: any[] = [];\r\n\r\n // Graphic elements\r\n private _graphicEls: Element[] = [];\r\n\r\n // key: dim, value: extent\r\n private _approximateExtent: Record = {};\r\n\r\n private _dimSummary: DimensionSummary;\r\n\r\n private _invertedIndicesMap: Record>;\r\n\r\n private _calculationInfo: DataCalculationInfo = {} as DataCalculationInfo;\r\n\r\n // User output info of this data.\r\n // DO NOT use it in other places!\r\n // When preparing user params for user callbacks, we have\r\n // to clone these inner data structures to prevent users\r\n // from modifying them to effect built-in logic. And for\r\n // performance consideration we make this `userOutput` to\r\n // avoid clone them too many times.\r\n userOutput: DimensionSummary['userOutput'];\r\n\r\n // Having detected that there is data item is non primitive type\r\n // (in type `OptionDataItemObject`).\r\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\r\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\r\n hasItemOption: boolean = false;\r\n\r\n // id or name is used on dynamic data, mapping old and new items.\r\n // When generating id from name, avoid repeat.\r\n private _nameRepeatCount: NameRepeatCount;\r\n private _nameDimIdx: number;\r\n private _idDimIdx: number;\r\n\r\n private __wrappedMethods: string[];\r\n\r\n // Methods that create a new list based on this list should be listed here.\r\n // Notice that those method should `RETURN` the new list.\r\n TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map'] as const;\r\n // Methods that change indices of this list should be listed here.\r\n CHANGABLE_METHODS = ['filterSelf', 'selectRange'] as const;\r\n DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'] as const;\r\n\r\n /**\r\n * @param dimensionsInput.dimensions\r\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\r\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\r\n */\r\n constructor(\r\n dimensionsInput: SeriesDataSchema | SeriesDimensionDefineLoose[],\r\n hostModel: HostModel\r\n ) {\r\n let dimensions: SeriesDimensionDefineLoose[];\r\n let assignStoreDimIdx = false;\r\n if (isSeriesDataSchema(dimensionsInput)) {\r\n dimensions = dimensionsInput.dimensions;\r\n this._dimOmitted = dimensionsInput.isDimensionOmitted();\r\n this._schema = dimensionsInput;\r\n }\r\n else {\r\n assignStoreDimIdx = true;\r\n dimensions = dimensionsInput as SeriesDimensionDefineLoose[];\r\n }\r\n\r\n dimensions = dimensions || ['x', 'y'];\r\n\r\n const dimensionInfos: Dictionary = {};\r\n const dimensionNames = [];\r\n const invertedIndicesMap: Dictionary = {};\r\n let needsHasOwn = false;\r\n const emptyObj = {};\r\n\r\n for (let i = 0; i < dimensions.length; i++) {\r\n // Use the original dimensions[i], where other flag props may exists.\r\n const dimInfoInput = dimensions[i];\r\n\r\n const dimensionInfo: SeriesDimensionDefine =\r\n zrUtil.isString(dimInfoInput)\r\n ? new SeriesDimensionDefine({name: dimInfoInput})\r\n : !(dimInfoInput instanceof SeriesDimensionDefine)\r\n ? new SeriesDimensionDefine(dimInfoInput)\r\n : dimInfoInput;\r\n\r\n const dimensionName = dimensionInfo.name;\r\n dimensionInfo.type = dimensionInfo.type || 'float';\r\n if (!dimensionInfo.coordDim) {\r\n dimensionInfo.coordDim = dimensionName;\r\n dimensionInfo.coordDimIndex = 0;\r\n }\r\n\r\n const otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\r\n dimensionNames.push(dimensionName);\r\n dimensionInfos[dimensionName] = dimensionInfo;\r\n if ((emptyObj as any)[dimensionName] != null) {\r\n needsHasOwn = true;\r\n }\r\n\r\n if (dimensionInfo.createInvertedIndices) {\r\n invertedIndicesMap[dimensionName] = [];\r\n }\r\n if (otherDims.itemName === 0) {\r\n this._nameDimIdx = i;\r\n }\r\n if (otherDims.itemId === 0) {\r\n this._idDimIdx = i;\r\n }\r\n\r\n if (__DEV__) {\r\n zrUtil.assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0);\r\n }\r\n if (assignStoreDimIdx) {\r\n dimensionInfo.storeDimIndex = i;\r\n }\r\n }\r\n\r\n this.dimensions = dimensionNames;\r\n this._dimInfos = dimensionInfos;\r\n this._initGetDimensionInfo(needsHasOwn);\r\n\r\n this.hostModel = hostModel;\r\n\r\n this._invertedIndicesMap = invertedIndicesMap;\r\n\r\n if (this._dimOmitted) {\r\n const dimIdxToName = this._dimIdxToName = zrUtil.createHashMap();\r\n zrUtil.each(dimensionNames, dimName => {\r\n dimIdxToName.set(dimensionInfos[dimName].storeDimIndex, dimName);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * Get concrete dimension name by dimension name or dimension index.\r\n * If input a dimension name, do not validate whether the dimension name exits.\r\n *\r\n * @caution\r\n * @param dim Must make sure the dimension is `SeriesDimensionLoose`.\r\n * Because only those dimensions will have auto-generated dimension names if not\r\n * have a user-specified name, and other dimensions will get a return of null/undefined.\r\n *\r\n * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:\r\n * ```js\r\n * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);\r\n * ```\r\n *\r\n * @return Concrete dim name.\r\n */\r\n getDimension(dim: SeriesDimensionLoose): DimensionName {\r\n let dimIdx = this._recognizeDimIndex(dim);\r\n if (dimIdx == null) {\r\n return dim as DimensionName;\r\n }\r\n dimIdx = dim as DimensionIndex;\r\n\r\n if (!this._dimOmitted) {\r\n return this.dimensions[dimIdx];\r\n }\r\n\r\n // Retrieve from series dimension definition because it probably contains\r\n // generated dimension name (like 'x', 'y').\r\n const dimName = this._dimIdxToName.get(dimIdx);\r\n if (dimName != null) {\r\n return dimName;\r\n }\r\n\r\n const sourceDimDef = this._schema.getSourceDimension(dimIdx);\r\n if (sourceDimDef) {\r\n return sourceDimDef.name;\r\n }\r\n }\r\n\r\n /**\r\n * Get dimension index in data store. Return -1 if not found.\r\n * Can be used to index value from getRawValue.\r\n */\r\n getDimensionIndex(dim: DimensionLoose): DimensionIndex {\r\n const dimIdx = this._recognizeDimIndex(dim);\r\n if (dimIdx != null) {\r\n return dimIdx;\r\n }\r\n\r\n if (dim == null) {\r\n return -1;\r\n }\r\n\r\n const dimInfo = this._getDimInfo(dim as DimensionName);\r\n return dimInfo\r\n ? dimInfo.storeDimIndex\r\n : this._dimOmitted\r\n ? this._schema.getSourceDimensionIndex(dim as DimensionName)\r\n : -1;\r\n }\r\n\r\n /**\r\n * The meanings of the input parameter `dim`:\r\n *\r\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\r\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\r\n * + If dim is a number-like string (e.g., `\"1\"`):\r\n * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,\r\n * it means that concrete name.\r\n * + If not, it will be converted to a number, which means the index of the dimension.\r\n * (why? because of the backward compatibility. We have been tolerating number-like string in\r\n * dimension setting, although now it seems that it is not a good idea.)\r\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\r\n * if no dimension name is defined as `\"1\"`.\r\n * + If dim is a not-number-like string, it means the concrete dim name.\r\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\r\n * or customized in `dimensions` property of option like `\"age\"`.\r\n *\r\n * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).\r\n */\r\n private _recognizeDimIndex(dim: DimensionLoose): DimensionIndex {\r\n if (zrUtil.isNumber(dim)\r\n // If being a number-like string but not being defined as a dimension name.\r\n || (\r\n dim != null\r\n && !isNaN(dim as any)\r\n && !this._getDimInfo(dim)\r\n && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)\r\n )\r\n ) {\r\n return +dim;\r\n }\r\n }\r\n\r\n private _getStoreDimIndex(dim: DimensionLoose): DimensionIndex {\r\n const dimIdx = this.getDimensionIndex(dim);\r\n if (__DEV__) {\r\n if (dimIdx == null) {\r\n throw new Error('Unknown dimension ' + dim);\r\n }\r\n }\r\n return dimIdx;\r\n }\r\n\r\n /**\r\n * Get type and calculation info of particular dimension\r\n * @param dim\r\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\r\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\r\n */\r\n getDimensionInfo(dim: SeriesDimensionLoose): SeriesDimensionDefine {\r\n // Do not clone, because there may be categories in dimInfo.\r\n return this._getDimInfo(this.getDimension(dim));\r\n }\r\n\r\n /**\r\n * If `dimName` if from outside of `SeriesData`,\r\n * use this method other than visit `this._dimInfos` directly.\r\n */\r\n private _getDimInfo: (dimName: SeriesDimensionName) => SeriesDimensionDefine;\r\n\r\n private _initGetDimensionInfo(needsHasOwn: boolean): void {\r\n const dimensionInfos = this._dimInfos;\r\n this._getDimInfo = needsHasOwn\r\n ? dimName => (dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined)\r\n : dimName => dimensionInfos[dimName];\r\n }\r\n\r\n /**\r\n * concrete dimension name list on coord.\r\n */\r\n getDimensionsOnCoord(): SeriesDimensionName[] {\r\n return this._dimSummary.dataDimsOnCoord.slice();\r\n }\r\n\r\n /**\r\n * @param coordDim\r\n * @param idx A coordDim may map to more than one data dim.\r\n * If not specified, return the first dim not extra.\r\n * @return concrete data dim. If not found, return null/undefined\r\n */\r\n mapDimension(coordDim: SeriesDimensionName): SeriesDimensionName;\r\n mapDimension(coordDim: SeriesDimensionName, idx: number): SeriesDimensionName;\r\n mapDimension(coordDim: SeriesDimensionName, idx?: number): SeriesDimensionName {\r\n const dimensionsSummary = this._dimSummary;\r\n\r\n if (idx == null) {\r\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim] as any;\r\n }\r\n\r\n const dims = dimensionsSummary.encode[coordDim];\r\n return dims ? dims[idx as number] as any : null;\r\n }\r\n\r\n mapDimensionsAll(coordDim: SeriesDimensionName): SeriesDimensionName[] {\r\n const dimensionsSummary = this._dimSummary;\r\n const dims = dimensionsSummary.encode[coordDim];\r\n return (dims || []).slice();\r\n }\r\n\r\n getStore() {\r\n return this._store;\r\n }\r\n\r\n /**\r\n * Initialize from data\r\n * @param data source or data or data store.\r\n * @param nameList The name of a datum is used on data diff and\r\n * default label/tooltip.\r\n * A name can be specified in encode.itemName,\r\n * or dataItem.name (only for series option data),\r\n * or provided in nameList from outside.\r\n */\r\n initData(\r\n data: Source | OptionSourceData | DataStore | DataProvider,\r\n nameList?: string[],\r\n dimValueGetter?: DimValueGetter\r\n ): void {\r\n let store: DataStore;\r\n if (data instanceof DataStore) {\r\n store = data;\r\n }\r\n\r\n if (!store) {\r\n const dimensions = this.dimensions;\r\n const provider = (isSourceInstance(data) || zrUtil.isArrayLike(data))\r\n ? new DefaultDataProvider(data as Source | OptionSourceData, dimensions.length)\r\n : data as DataProvider;\r\n store = new DataStore();\r\n const dimensionInfos: DataStoreDimensionDefine[] = map(dimensions, dimName => ({\r\n type: this._dimInfos[dimName].type,\r\n property: dimName\r\n }));\r\n store.initData(provider, dimensionInfos, dimValueGetter);\r\n }\r\n\r\n this._store = store;\r\n\r\n // Reset\r\n this._nameList = (nameList || []).slice();\r\n this._idList = [];\r\n this._nameRepeatCount = {};\r\n\r\n this._doInit(0, store.count());\r\n\r\n // Cache summary info for fast visit. See \"dimensionHelper\".\r\n // Needs to be initialized after store is prepared.\r\n this._dimSummary = summarizeDimensions(this, this._schema);\r\n this.userOutput = this._dimSummary.userOutput;\r\n }\r\n\r\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n */\r\n appendData(data: ArrayLike): void {\r\n const range = this._store.appendData(data);\r\n this._doInit(range[0], range[1]);\r\n }\r\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n * This method does not modify `rawData` (`dataProvider`), but only\r\n * add values to store.\r\n *\r\n * The final count will be increased by `Math.max(values.length, names.length)`.\r\n *\r\n * @param values That is the SourceType: 'arrayRows', like\r\n * [\r\n * [12, 33, 44],\r\n * [NaN, 43, 1],\r\n * ['-', 'asdf', 0]\r\n * ]\r\n * Each item is exactly corresponding to a dimension.\r\n */\r\n appendValues(values: any[][], names?: string[]): void {\r\n const {start, end} = this._store.appendValues(values, names.length);\r\n const shouldMakeIdFromName = this._shouldMakeIdFromName();\r\n\r\n this._updateOrdinalMeta();\r\n\r\n if (names) {\r\n for (let idx = start; idx < end; idx++) {\r\n const sourceIdx = idx - start;\r\n this._nameList[idx] = names[sourceIdx];\r\n if (shouldMakeIdFromName) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _updateOrdinalMeta(): void {\r\n const store = this._store;\r\n const dimensions = this.dimensions;\r\n for (let i = 0; i < dimensions.length; i++) {\r\n const dimInfo = this._dimInfos[dimensions[i]];\r\n if (dimInfo.ordinalMeta) {\r\n store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);\r\n }\r\n }\r\n }\r\n\r\n private _shouldMakeIdFromName(): boolean {\r\n const provider = this._store.getProvider();\r\n return this._idDimIdx == null\r\n && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY\r\n && !provider.fillStorage;\r\n }\r\n\r\n private _doInit(start: number, end: number): void {\r\n if (start >= end) {\r\n return;\r\n }\r\n\r\n const store = this._store;\r\n const provider = store.getProvider();\r\n\r\n this._updateOrdinalMeta();\r\n\r\n const nameList = this._nameList;\r\n const idList = this._idList;\r\n const sourceFormat = provider.getSource().sourceFormat;\r\n const isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n\r\n // Each data item is value\r\n // [1, 2]\r\n // 2\r\n // Bar chart, line chart which uses category axis\r\n // only gives the 'y' value. 'x' value is the indices of category\r\n // Use a tempValue to normalize the value to be a (x, y) value\r\n // If dataItem is {name: ...} or {id: ...}, it has highest priority.\r\n // This kind of ids and names are always stored `_nameList` and `_idList`.\r\n if (isFormatOriginal && !provider.pure) {\r\n const sharedDataItem = [] as OptionDataItem;\r\n for (let idx = start; idx < end; idx++) {\r\n // NOTICE: Try not to write things into dataItem\r\n const dataItem = provider.getItem(idx, sharedDataItem);\r\n if (!this.hasItemOption && isDataItemOption(dataItem)) {\r\n this.hasItemOption = true;\r\n }\r\n if (dataItem) {\r\n const itemName = (dataItem as any).name;\r\n if (nameList[idx] == null && itemName != null) {\r\n nameList[idx] = convertOptionIdName(itemName, null);\r\n }\r\n const itemId = (dataItem as any).id;\r\n if (idList[idx] == null && itemId != null) {\r\n idList[idx] = convertOptionIdName(itemId, null);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (this._shouldMakeIdFromName()) {\r\n for (let idx = start; idx < end; idx++) {\r\n makeIdFromName(this, idx);\r\n }\r\n }\r\n\r\n prepareInvertedIndex(this);\r\n }\r\n\r\n /**\r\n * PENDING: In fact currently this function is only used to short-circuit\r\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\r\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\r\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\r\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\r\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\r\n * be still needed.\r\n *\r\n * Optimize for the scenario that data is filtered by a given extent.\r\n * Consider that if data amount is more than hundreds of thousand,\r\n * extent calculation will cost more than 10ms and the cache will\r\n * be erased because of the filtering.\r\n */\r\n getApproximateExtent(dim: SeriesDimensionLoose): [number, number] {\r\n return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));\r\n }\r\n\r\n /**\r\n * Calculate extent on a filtered data might be time consuming.\r\n * Approximate extent is only used for: calculate extent of filtered data outside.\r\n */\r\n setApproximateExtent(extent: [number, number], dim: SeriesDimensionLoose): void {\r\n dim = this.getDimension(dim);\r\n this._approximateExtent[dim] = extent.slice() as [number, number];\r\n }\r\n\r\n getCalculationInfo>(\r\n key: CALC_INFO_KEY\r\n ): DataCalculationInfo[CALC_INFO_KEY] {\r\n return this._calculationInfo[key];\r\n }\r\n\r\n /**\r\n * @param key or k-v object\r\n */\r\n setCalculationInfo(\r\n key: DataCalculationInfo\r\n ): void;\r\n setCalculationInfo>(\r\n key: CALC_INFO_KEY,\r\n value: DataCalculationInfo[CALC_INFO_KEY]\r\n ): void;\r\n setCalculationInfo(\r\n key: (keyof DataCalculationInfo) | DataCalculationInfo,\r\n value?: DataCalculationInfo[keyof DataCalculationInfo]\r\n ): void {\r\n isObject(key)\r\n ? zrUtil.extend(this._calculationInfo, key as object)\r\n : ((this._calculationInfo as any)[key] = value);\r\n }\r\n\r\n /**\r\n * @return Never be null/undefined. `number` will be converted to string. Because:\r\n * In most cases, name is used in display, where returning a string is more convenient.\r\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\r\n * rule that name `2` equals to name `'2'`.\r\n */\r\n getName(idx: number): string {\r\n const rawIndex = this.getRawIndex(idx);\r\n let name = this._nameList[rawIndex];\r\n if (name == null && this._nameDimIdx != null) {\r\n name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);\r\n }\r\n if (name == null) {\r\n name = '';\r\n }\r\n return name;\r\n }\r\n\r\n private _getCategory(dimIdx: number, idx: number): OrdinalRawValue {\r\n const ordinal = this._store.get(dimIdx, idx);\r\n const ordinalMeta = this._store.getOrdinalMeta(dimIdx);\r\n if (ordinalMeta) {\r\n return ordinalMeta.categories[ordinal as OrdinalNumber];\r\n }\r\n return ordinal;\r\n }\r\n\r\n /**\r\n * @return Never null/undefined. `number` will be converted to string. Because:\r\n * In all cases having encountered at present, id is used in making diff comparison, which\r\n * are usually based on hash map. We can keep the rule that the internal id are always string\r\n * (treat `2` is the same as `'2'`) to make the related logic simple.\r\n */\r\n getId(idx: number): string {\r\n return getId(this, this.getRawIndex(idx));\r\n }\r\n\r\n count(): number {\r\n return this._store.count();\r\n }\r\n\r\n /**\r\n * Get value. Return NaN if idx is out of range.\r\n *\r\n * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.\r\n */\r\n get(dim: SeriesDimensionName, idx: number): ParsedValue {\r\n const store = this._store;\r\n const dimInfo = this._dimInfos[dim];\r\n if (dimInfo) {\r\n return store.get(dimInfo.storeDimIndex, idx);\r\n }\r\n }\r\n\r\n /**\r\n * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.\r\n */\r\n getByRawIndex(dim: SeriesDimensionName, rawIdx: number): ParsedValue {\r\n const store = this._store;\r\n const dimInfo = this._dimInfos[dim];\r\n if (dimInfo) {\r\n return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx);\r\n }\r\n }\r\n\r\n getIndices() {\r\n return this._store.getIndices();\r\n }\r\n\r\n getDataExtent(dim: DimensionLoose): [number, number] {\r\n return this._store.getDataExtent(this._getStoreDimIndex(dim));\r\n }\r\n\r\n getSum(dim: DimensionLoose): number {\r\n return this._store.getSum(this._getStoreDimIndex(dim));\r\n }\r\n\r\n getMedian(dim: DimensionLoose): number {\r\n return this._store.getMedian(this._getStoreDimIndex(dim));\r\n }\r\n /**\r\n * Get value for multi dimensions.\r\n * @param dimensions If ignored, using all dimensions.\r\n */\r\n getValues(idx: number): ParsedValue[];\r\n getValues(dimensions: readonly DimensionName[], idx: number): ParsedValue[];\r\n getValues(dimensions: readonly DimensionName[] | number, idx?: number): ParsedValue[] {\r\n const store = this._store;\r\n return zrUtil.isArray(dimensions)\r\n ? store.getValues(map(dimensions, dim => this._getStoreDimIndex(dim)), idx)\r\n : store.getValues(dimensions as number);\r\n }\r\n\r\n /**\r\n * If value is NaN. Including '-'\r\n * Only check the coord dimensions.\r\n */\r\n hasValue(idx: number): boolean {\r\n const dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;\r\n for (let i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) {\r\n // Ordinal type originally can be string or number.\r\n // But when an ordinal type is used on coord, it can\r\n // not be string but only number. So we can also use isNaN.\r\n if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx) as any)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Retrieve the index with given name\r\n */\r\n indexOfName(name: string): number {\r\n for (let i = 0, len = this._store.count(); i < len; i++) {\r\n if (this.getName(i) === name) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n getRawIndex(idx: number): number {\r\n return this._store.getRawIndex(idx);\r\n }\r\n\r\n indexOfRawIndex(rawIndex: number): number {\r\n return this._store.indexOfRawIndex(rawIndex);\r\n }\r\n\r\n /**\r\n * Only support the dimension which inverted index created.\r\n * Do not support other cases until required.\r\n * @param dim concrete dim\r\n * @param value ordinal index\r\n * @return rawIndex\r\n */\r\n rawIndexOf(dim: SeriesDimensionName, value: OrdinalNumber): number {\r\n const invertedIndices = dim && this._invertedIndicesMap[dim];\r\n if (__DEV__) {\r\n if (!invertedIndices) {\r\n throw new Error('Do not supported yet');\r\n }\r\n }\r\n const rawIndex = invertedIndices[value];\r\n if (rawIndex == null || isNaN(rawIndex)) {\r\n return INDEX_NOT_FOUND;\r\n }\r\n return rawIndex;\r\n }\r\n\r\n /**\r\n * Retrieve the index of nearest value\r\n * @param dim\r\n * @param value\r\n * @param [maxDistance=Infinity]\r\n * @return If and only if multiple indices has\r\n * the same value, they are put to the result.\r\n */\r\n indicesOfNearest(dim: DimensionLoose, value: number, maxDistance?: number): number[] {\r\n return this._store.indicesOfNearest(\r\n this._getStoreDimIndex(dim),\r\n value, maxDistance\r\n );\r\n }\r\n /**\r\n * Data iteration\r\n * @param ctx default this\r\n * @example\r\n * list.each('x', function (x, idx) {});\r\n * list.each(['x', 'y'], function (x, y, idx) {});\r\n * list.each(function (idx) {})\r\n */\r\n each(cb: EachCb0, ctx?: Ctx, ctxCompat?: Ctx): void;\r\n each(dims: DimensionLoose, cb: EachCb1, ctx?: Ctx): void;\r\n each(dims: [DimensionLoose], cb: EachCb1, ctx?: Ctx): void;\r\n each(dims: [DimensionLoose, DimensionLoose], cb: EachCb2, ctx?: Ctx): void;\r\n each(dims: ItrParamDims, cb: EachCb, ctx?: Ctx): void;\r\n each(\r\n dims: ItrParamDims | EachCb,\r\n cb: EachCb | Ctx,\r\n ctx?: Ctx\r\n ): void {\r\n 'use strict';\r\n\r\n if (zrUtil.isFunction(dims)) {\r\n ctx = cb as Ctx;\r\n cb = dims;\r\n dims = [];\r\n }\r\n\r\n // ctxCompat just for compat echarts3\r\n const fCtx = (ctx || this) as CtxOrList;\r\n\r\n const dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\r\n\r\n this._store.each(dimIndices, (fCtx\r\n ? zrUtil.bind(cb as any, fCtx as any)\r\n : cb) as any\r\n );\r\n }\r\n /**\r\n * Data filter\r\n */\r\n filterSelf(cb: FilterCb0, ctx?: Ctx, ctxCompat?: Ctx): this;\r\n filterSelf(dims: DimensionLoose, cb: FilterCb1, ctx?: Ctx): this;\r\n filterSelf(dims: [DimensionLoose], cb: FilterCb1, ctx?: Ctx): this;\r\n filterSelf(dims: [DimensionLoose, DimensionLoose], cb: FilterCb2, ctx?: Ctx): this;\r\n filterSelf(dims: ItrParamDims, cb: FilterCb, ctx?: Ctx): this;\r\n filterSelf(\r\n dims: ItrParamDims | FilterCb,\r\n cb: FilterCb | Ctx,\r\n ctx?: Ctx\r\n ): SeriesData {\r\n 'use strict';\r\n\r\n if (zrUtil.isFunction(dims)) {\r\n ctx = cb as Ctx;\r\n cb = dims;\r\n dims = [];\r\n }\r\n\r\n // ctxCompat just for compat echarts3\r\n const fCtx = (ctx || this) as CtxOrList;\r\n\r\n const dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\r\n\r\n this._store = this._store.filter(dimIndices, (fCtx\r\n ? zrUtil.bind(cb as any, fCtx as any)\r\n : cb) as any\r\n );\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Select data in range. (For optimization of filter)\r\n * (Manually inline code, support 5 million data filtering in data zoom.)\r\n */\r\n selectRange(range: Record): SeriesData {\r\n 'use strict';\r\n\r\n const innerRange: Record = {};\r\n const dims = zrUtil.keys(range);\r\n const dimIndices: number[] = [];\r\n zrUtil.each(dims, (dim) => {\r\n const dimIdx = this._getStoreDimIndex(dim);\r\n innerRange[dimIdx] = range[dim];\r\n dimIndices.push(dimIdx);\r\n });\r\n\r\n this._store = this._store.selectRange(innerRange);\r\n return this;\r\n }\r\n\r\n /**\r\n * Data mapping to a plain array\r\n */\r\n mapArray>(cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[];\r\n /* eslint-disable max-len */\r\n mapArray>(dims: DimensionLoose, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[];\r\n mapArray>(dims: [DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[];\r\n mapArray>(dims: [DimensionLoose, DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[];\r\n mapArray>(dims: ItrParamDims, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType[];\r\n /* eslint-enable max-len */\r\n mapArray(\r\n dims: ItrParamDims | MapArrayCb,\r\n cb: MapArrayCb | Ctx,\r\n ctx?: Ctx\r\n ): unknown[] {\r\n 'use strict';\r\n\r\n if (zrUtil.isFunction(dims)) {\r\n ctx = cb as Ctx;\r\n cb = dims;\r\n dims = [];\r\n }\r\n\r\n // ctxCompat just for compat echarts3\r\n ctx = (ctx || this) as Ctx;\r\n\r\n const result: unknown[] = [];\r\n this.each(dims, function () {\r\n result.push(cb && (cb as MapArrayCb).apply(this, arguments));\r\n }, ctx);\r\n return result;\r\n }\r\n\r\n /**\r\n * Data mapping to a new List with given dimensions\r\n */\r\n map(dims: DimensionLoose, cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): SeriesData;\r\n map(dims: [DimensionLoose], cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): SeriesData;\r\n // eslint-disable-next-line max-len\r\n map(dims: [DimensionLoose, DimensionLoose], cb: MapCb2, ctx?: Ctx, ctxCompat?: Ctx): SeriesData;\r\n map(\r\n dims: ItrParamDims,\r\n cb: MapCb,\r\n ctx?: Ctx,\r\n ctxCompat?: Ctx\r\n ): SeriesData {\r\n 'use strict';\r\n\r\n // ctxCompat just for compat echarts3\r\n const fCtx = (ctx || ctxCompat || this) as CtxOrList;\r\n\r\n const dimIndices = map(\r\n normalizeDimensions(dims), this._getStoreDimIndex, this\r\n );\r\n\r\n const list = cloneListForMapAndSample(this);\r\n list._store = this._store.map(\r\n dimIndices,\r\n fCtx ? zrUtil.bind(cb, fCtx) : cb\r\n );\r\n return list;\r\n }\r\n\r\n /**\r\n * !!Danger: used on stack dimension only.\r\n */\r\n modify(dims: DimensionLoose, cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): void;\r\n modify(dims: [DimensionLoose], cb: MapCb1, ctx?: Ctx, ctxCompat?: Ctx): void;\r\n modify(dims: [DimensionLoose, DimensionLoose], cb: MapCb2, ctx?: Ctx, ctxCompat?: Ctx): void;\r\n modify(\r\n dims: ItrParamDims,\r\n cb: MapCb,\r\n ctx?: Ctx,\r\n ctxCompat?: Ctx\r\n ): void {\r\n // ctxCompat just for compat echarts3\r\n const fCtx = (ctx || ctxCompat || this) as CtxOrList;\r\n\r\n if (__DEV__) {\r\n zrUtil.each(normalizeDimensions(dims), dim => {\r\n const dimInfo = this.getDimensionInfo(dim);\r\n if (!dimInfo.isCalculationCoord) {\r\n console.error('Danger: only stack dimension can be modified');\r\n }\r\n });\r\n }\r\n\r\n const dimIndices = map(\r\n normalizeDimensions(dims), this._getStoreDimIndex, this\r\n );\r\n\r\n // If do shallow clone here, if there are too many stacked series,\r\n // it still cost lots of memory, because `_store.dimensions` are not shared.\r\n // We should consider there probably be shallow clone happen in each series\r\n // in consequent filter/map.\r\n this._store.modify(\r\n dimIndices,\r\n fCtx ? zrUtil.bind(cb, fCtx) : cb\r\n );\r\n }\r\n\r\n /**\r\n * Large data down sampling on given dimension\r\n * @param sampleIndex Sample index for name and id\r\n */\r\n downSample(\r\n dimension: DimensionLoose,\r\n rate: number,\r\n sampleValue: (frameValues: ArrayLike) => ParsedValueNumeric,\r\n sampleIndex: (frameValues: ArrayLike, value: ParsedValueNumeric) => number\r\n ): SeriesData {\r\n const list = cloneListForMapAndSample(this);\r\n list._store = this._store.downSample(\r\n this._getStoreDimIndex(dimension),\r\n rate,\r\n sampleValue,\r\n sampleIndex\r\n );\r\n return list as SeriesData;\r\n }\r\n\r\n /**\r\n * Large data down sampling using largest-triangle-three-buckets\r\n * @param {string} valueDimension\r\n * @param {number} targetCount\r\n */\r\n lttbDownSample(\r\n valueDimension: DimensionLoose,\r\n rate: number\r\n ): SeriesData {\r\n const list = cloneListForMapAndSample(this);\r\n list._store = this._store.lttbDownSample(\r\n this._getStoreDimIndex(valueDimension),\r\n rate\r\n );\r\n return list as SeriesData;\r\n }\r\n\r\n getRawDataItem(idx: number) {\r\n return this._store.getRawDataItem(idx);\r\n }\r\n\r\n /**\r\n * Get model of one data item.\r\n */\r\n // TODO: Type of data item\r\n getItemModel(idx: number): Model\r\n > {\r\n const hostModel = this.hostModel;\r\n const dataItem = this.getRawDataItem(idx) as ModelOption;\r\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\r\n }\r\n\r\n /**\r\n * Create a data differ\r\n */\r\n diff(otherList: SeriesData): DataDiffer {\r\n const thisList = this;\r\n\r\n return new DataDiffer(\r\n otherList ? otherList.getStore().getIndices() : [],\r\n this.getStore().getIndices(),\r\n function (idx: number) {\r\n return getId(otherList, idx);\r\n },\r\n function (idx: number) {\r\n return getId(thisList, idx);\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Get visual property.\r\n */\r\n getVisual(key: K): Visual[K] {\r\n const visual = this._visual as Visual;\r\n return visual && visual[key];\r\n }\r\n\r\n /**\r\n * Set visual property\r\n *\r\n * @example\r\n * setVisual('color', color);\r\n * setVisual({\r\n * 'color': color\r\n * });\r\n */\r\n setVisual(key: K, val: Visual[K]): void;\r\n setVisual(kvObj: Partial): void;\r\n setVisual(kvObj: string | Partial, val?: any): void {\r\n this._visual = this._visual || {};\r\n if (isObject(kvObj)) {\r\n zrUtil.extend(this._visual, kvObj);\r\n }\r\n else {\r\n this._visual[kvObj as string] = val;\r\n }\r\n }\r\n\r\n /**\r\n * Get visual property of single data item\r\n */\r\n // eslint-disable-next-line\r\n getItemVisual(idx: number, key: K): Visual[K] {\r\n const itemVisual = this._itemVisuals[idx] as Visual;\r\n const val = itemVisual && itemVisual[key];\r\n if (val == null) {\r\n // Use global visual property\r\n return this.getVisual(key);\r\n }\r\n return val;\r\n }\r\n\r\n /**\r\n * If exists visual property of single data item\r\n */\r\n hasItemVisual() {\r\n return this._itemVisuals.length > 0;\r\n }\r\n\r\n /**\r\n * Make sure itemVisual property is unique\r\n */\r\n // TODO: use key to save visual to reduce memory.\r\n ensureUniqueItemVisual(idx: number, key: K): Visual[K] {\r\n const itemVisuals = this._itemVisuals;\r\n let itemVisual = itemVisuals[idx] as Visual;\r\n if (!itemVisual) {\r\n itemVisual = itemVisuals[idx] = {} as Visual;\r\n }\r\n let val = itemVisual[key];\r\n if (val == null) {\r\n val = this.getVisual(key);\r\n\r\n // TODO Performance?\r\n if (zrUtil.isArray(val)) {\r\n val = val.slice() as unknown as Visual[K];\r\n }\r\n else if (isObject(val)) {\r\n val = zrUtil.extend({}, val);\r\n }\r\n\r\n itemVisual[key] = val;\r\n }\r\n return val;\r\n }\r\n /**\r\n * Set visual property of single data item\r\n *\r\n * @param {number} idx\r\n * @param {string|Object} key\r\n * @param {*} [value]\r\n *\r\n * @example\r\n * setItemVisual(0, 'color', color);\r\n * setItemVisual(0, {\r\n * 'color': color\r\n * });\r\n */\r\n // eslint-disable-next-line\r\n setItemVisual(idx: number, key: K, value: Visual[K]): void;\r\n setItemVisual(idx: number, kvObject: Partial): void;\r\n // eslint-disable-next-line\r\n setItemVisual(idx: number, key: K | Partial, value?: Visual[K]): void {\r\n const itemVisual = this._itemVisuals[idx] || {};\r\n this._itemVisuals[idx] = itemVisual;\r\n\r\n if (isObject(key)) {\r\n zrUtil.extend(itemVisual, key);\r\n }\r\n else {\r\n itemVisual[key as string] = value;\r\n }\r\n }\r\n\r\n /**\r\n * Clear itemVisuals and list visual.\r\n */\r\n clearAllVisual(): void {\r\n this._visual = {};\r\n this._itemVisuals = [];\r\n }\r\n\r\n /**\r\n * Set layout property.\r\n */\r\n setLayout(key: string, val: any): void;\r\n setLayout(kvObj: Dictionary): void;\r\n setLayout(key: string | Dictionary, val?: any): void {\r\n isObject(key)\r\n ? zrUtil.extend(this._layout, key)\r\n : (this._layout[key] = val);\r\n }\r\n\r\n /**\r\n * Get layout property.\r\n */\r\n getLayout(key: string): any {\r\n return this._layout[key];\r\n }\r\n\r\n /**\r\n * Get layout of single data item\r\n */\r\n getItemLayout(idx: number): any {\r\n return this._itemLayouts[idx];\r\n }\r\n\r\n /**\r\n * Set layout of single data item\r\n */\r\n setItemLayout(\r\n idx: number,\r\n layout: (M extends true ? Dictionary : any),\r\n merge?: M\r\n ): void {\r\n this._itemLayouts[idx] = merge\r\n ? zrUtil.extend(this._itemLayouts[idx] || {}, layout)\r\n : layout;\r\n }\r\n\r\n /**\r\n * Clear all layout of single data item\r\n */\r\n clearItemLayouts(): void {\r\n this._itemLayouts.length = 0;\r\n }\r\n\r\n /**\r\n * Set graphic element relative to data. It can be set as null\r\n */\r\n setItemGraphicEl(idx: number, el: Element): void {\r\n const seriesIndex = this.hostModel && (this.hostModel as any).seriesIndex;\r\n\r\n setCommonECData(seriesIndex, this.dataType, idx, el);\r\n\r\n this._graphicEls[idx] = el;\r\n }\r\n\r\n getItemGraphicEl(idx: number): Element {\r\n return this._graphicEls[idx];\r\n }\r\n\r\n eachItemGraphicEl(\r\n cb: (this: Ctx, el: Element, idx: number) => void,\r\n context?: Ctx\r\n ): void {\r\n zrUtil.each(this._graphicEls, function (el, idx) {\r\n if (el) {\r\n cb && cb.call(context, el, idx);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Shallow clone a new list except visual and layout properties, and graph elements.\r\n * New list only change the indices.\r\n */\r\n cloneShallow(list?: SeriesData): SeriesData {\r\n if (!list) {\r\n list = new SeriesData(\r\n this._schema\r\n ? this._schema\r\n : map(this.dimensions, this._getDimInfo, this),\r\n this.hostModel\r\n );\r\n }\r\n\r\n transferProperties(list, this);\r\n list._store = this._store;\r\n\r\n return list;\r\n }\r\n\r\n /**\r\n * Wrap some method to add more feature\r\n */\r\n wrapMethod(\r\n methodName: FunctionPropertyNames,\r\n injectFunction: (...args: any) => any\r\n ): void {\r\n const originalMethod = this[methodName];\r\n if (!zrUtil.isFunction(originalMethod)) {\r\n return;\r\n }\r\n this.__wrappedMethods = this.__wrappedMethods || [];\r\n this.__wrappedMethods.push(methodName);\r\n this[methodName] = function () {\r\n const res = (originalMethod as any).apply(this, arguments);\r\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\r\n };\r\n }\r\n\r\n\r\n // ----------------------------------------------------------\r\n // A work around for internal method visiting private member.\r\n // ----------------------------------------------------------\r\n private static internalField = (function () {\r\n\r\n prepareInvertedIndex = function (data: SeriesData): void {\r\n const invertedIndicesMap = data._invertedIndicesMap;\r\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\r\n const dimInfo = data._dimInfos[dim];\r\n // Currently, only dimensions that has ordinalMeta can create inverted indices.\r\n const ordinalMeta = dimInfo.ordinalMeta;\r\n const store = data._store;\r\n if (ordinalMeta) {\r\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(\r\n ordinalMeta.categories.length\r\n );\r\n // The default value of TypedArray is 0. To avoid miss\r\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\r\n for (let i = 0; i < invertedIndices.length; i++) {\r\n invertedIndices[i] = INDEX_NOT_FOUND;\r\n }\r\n for (let i = 0; i < store.count(); i++) {\r\n // Only support the case that all values are distinct.\r\n invertedIndices[store.get(dimInfo.storeDimIndex, i) as number] = i;\r\n }\r\n }\r\n });\r\n };\r\n\r\n getIdNameFromStore = function (\r\n data: SeriesData, dimIdx: number, idx: number\r\n ): string {\r\n return convertOptionIdName(data._getCategory(dimIdx, idx), null);\r\n };\r\n\r\n /**\r\n * @see the comment of `List['getId']`.\r\n */\r\n getId = function (data: SeriesData, rawIndex: number): string {\r\n let id = data._idList[rawIndex];\r\n if (id == null && data._idDimIdx != null) {\r\n id = getIdNameFromStore(data, data._idDimIdx, rawIndex);\r\n }\r\n if (id == null) {\r\n id = ID_PREFIX + rawIndex;\r\n }\r\n return id;\r\n };\r\n\r\n normalizeDimensions = function (\r\n dimensions: ItrParamDims\r\n ): Array {\r\n if (!zrUtil.isArray(dimensions)) {\r\n dimensions = dimensions != null ? [dimensions] : [];\r\n }\r\n return dimensions;\r\n };\r\n\r\n /**\r\n * Data in excludeDimensions is copied, otherwise transferred.\r\n */\r\n cloneListForMapAndSample = function (original: SeriesData): SeriesData {\r\n const list = new SeriesData(\r\n original._schema\r\n ? original._schema\r\n : map(original.dimensions, original._getDimInfo, original),\r\n original.hostModel\r\n );\r\n // FIXME If needs stackedOn, value may already been stacked\r\n transferProperties(list, original);\r\n return list;\r\n };\r\n\r\n transferProperties = function (target: SeriesData, source: SeriesData): void {\r\n zrUtil.each(\r\n TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []),\r\n function (propName) {\r\n if (source.hasOwnProperty(propName)) {\r\n (target as any)[propName] = (source as any)[propName];\r\n }\r\n }\r\n );\r\n\r\n target.__wrappedMethods = source.__wrappedMethods;\r\n\r\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\r\n (target as any)[propName] = zrUtil.clone((source as any)[propName]);\r\n });\r\n\r\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\r\n };\r\n makeIdFromName = function (data: SeriesData, idx: number): void {\r\n const nameList = data._nameList;\r\n const idList = data._idList;\r\n const nameDimIdx = data._nameDimIdx;\r\n const idDimIdx = data._idDimIdx;\r\n\r\n let name = nameList[idx];\r\n let id = idList[idx];\r\n\r\n if (name == null && nameDimIdx != null) {\r\n nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);\r\n }\r\n if (id == null && idDimIdx != null) {\r\n idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);\r\n }\r\n if (id == null && name != null) {\r\n const nameRepeatCount = data._nameRepeatCount;\r\n const nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\r\n id = name;\r\n if (nmCnt > 1) {\r\n id += '__ec__' + nmCnt;\r\n }\r\n idList[idx] = id;\r\n }\r\n };\r\n })();\r\n\r\n}\r\n\r\ninterface SeriesData {\r\n getLinkedData(dataType?: SeriesDataType): SeriesData;\r\n getLinkedDataAll(): { data: SeriesData, type?: SeriesDataType }[];\r\n}\r\n\r\nexport default SeriesData;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * This module exposes helper functions for developing extensions.\r\n */\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport createSeriesData from '../../chart/helper/createSeriesData';\r\n// import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge';\r\nimport * as axisHelper from '../../coord/axisHelper';\r\nimport {AxisModelCommonMixin} from '../../coord/axisModelCommonMixin';\r\nimport Model from '../../model/Model';\r\nimport {getLayoutRect} from '../../util/layout';\r\nimport {\r\n enableDataStack,\r\n isDimensionStacked,\r\n getStackedDimension\r\n} from '../../data/helper/dataStackHelper';\r\nimport SeriesModel from '../../model/Series';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { createTextStyle as innerCreateTextStyle } from '../../label/labelStyle';\r\nimport { DisplayState, TextCommonOption } from '../../util/types';\r\n\r\n/**\r\n * Create a multi dimension List structure from seriesModel.\r\n */\r\nexport function createList(seriesModel: SeriesModel) {\r\n return createSeriesData(null, seriesModel);\r\n}\r\n\r\n// export function createGraph(seriesModel) {\r\n// let nodes = seriesModel.get('data');\r\n// let links = seriesModel.get('links');\r\n// return createGraphFromNodeEdge(nodes, links, seriesModel);\r\n// }\r\n\r\nexport {getLayoutRect};\r\n\r\nexport {createDimensions} from '../../data/helper/createDimensions';\r\n\r\nexport const dataStack = {\r\n isDimensionStacked: isDimensionStacked,\r\n enableDataStack: enableDataStack,\r\n getStackedDimension: getStackedDimension\r\n};\r\n\r\n/**\r\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\r\n * @param {string} symbolDesc\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} w\r\n * @param {number} h\r\n * @param {string} color\r\n */\r\nexport {createSymbol} from '../../util/symbol';\r\n\r\n/**\r\n * Create scale\r\n * @param {Array.} dataExtent\r\n * @param {Object|module:echarts/Model} option If `optoin.type`\r\n * is secified, it can only be `'value'` currently.\r\n */\r\nexport function createScale(dataExtent: number[], option: object | AxisBaseModel) {\r\n let axisModel = option;\r\n if (!(option instanceof Model)) {\r\n axisModel = new Model(option);\r\n // FIXME\r\n // Currently AxisModelCommonMixin has nothing to do with the\r\n // the requirements of `axisHelper.createScaleByModel`. For\r\n // example the methods `getCategories` and `getOrdinalMeta`\r\n // are required for `'category'` axis, and ecModel is required\r\n // for `'time'` axis. But occasionally echarts-gl happened\r\n // to only use `'value'` axis.\r\n // zrUtil.mixin(axisModel, AxisModelCommonMixin);\r\n }\r\n\r\n const scale = axisHelper.createScaleByModel(axisModel as AxisBaseModel);\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n\r\n axisHelper.niceScaleExtent(scale, axisModel as AxisBaseModel);\r\n return scale;\r\n}\r\n\r\n/**\r\n * Mixin common methods to axis model,\r\n *\r\n * Include methods\r\n * `getFormattedLabels() => Array.`\r\n * `getCategories() => Array.`\r\n * `getMin(origin: boolean) => number`\r\n * `getMax(origin: boolean) => number`\r\n * `getNeedCrossZero() => boolean`\r\n */\r\nexport function mixinAxisModelCommonMethods(Model: Model) {\r\n zrUtil.mixin(Model, AxisModelCommonMixin);\r\n}\r\n\r\nexport {getECData};\r\n\r\nexport {enableHoverEmphasis} from '../../util/states';\r\n\r\nexport function createTextStyle(\r\n textStyleModel: Model,\r\n opts?: {\r\n // For which state this textStyle is for.\r\n state?: DisplayState\r\n }\r\n) {\r\n opts = opts || {};\r\n return innerCreateTextStyle(textStyleModel, null, null, opts.state !== 'normal');\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n DimensionDefinitionLoose, OptionEncode, OptionEncodeValue,\r\n EncodeDefaulter,\r\n OptionSourceData,\r\n DimensionName,\r\n DimensionDefinition,\r\n DataVisualDimensions,\r\n DimensionIndex,\r\n VISUAL_DIMENSIONS\r\n} from '../../util/types';\r\nimport SeriesDimensionDefine from '../SeriesDimensionDefine';\r\nimport {\r\n createHashMap, defaults, each, extend, HashMap, isObject, isString\r\n} from 'zrender/src/core/util';\r\nimport OrdinalMeta from '../OrdinalMeta';\r\nimport { createSourceFromSeriesDataOption, isSourceInstance, Source } from '../Source';\r\nimport { CtorInt32Array } from '../DataStore';\r\nimport { normalizeToArray } from '../../util/model';\r\nimport { BE_ORDINAL, guessOrdinal } from './sourceHelper';\r\nimport {\r\n createDimNameMap, ensureSourceDimNameMap, SeriesDataSchema, shouldOmitUnusedDimensions\r\n} from './SeriesDataSchema';\r\n\r\n\r\nexport interface CoordDimensionDefinition extends DimensionDefinition {\r\n dimsDef?: (DimensionName | { name: DimensionName, defaultTooltip?: boolean })[];\r\n otherDims?: DataVisualDimensions;\r\n ordinalMeta?: OrdinalMeta;\r\n coordDim?: DimensionName;\r\n coordDimIndex?: DimensionIndex;\r\n}\r\nexport type CoordDimensionDefinitionLoose = CoordDimensionDefinition['name'] | CoordDimensionDefinition;\r\n\r\nexport type PrepareSeriesDataSchemaParams = {\r\n coordDimensions?: CoordDimensionDefinitionLoose[],\r\n /**\r\n * Will use `source.dimensionsDefine` if not given.\r\n */\r\n dimensionsDefine?: DimensionDefinitionLoose[],\r\n /**\r\n * Will use `source.encodeDefine` if not given.\r\n */\r\n encodeDefine?: HashMap | OptionEncode,\r\n dimensionsCount?: number,\r\n /**\r\n * Make default encode if user not specified.\r\n */\r\n encodeDefaulter?: EncodeDefaulter,\r\n generateCoord?: string,\r\n generateCoordCount?: number,\r\n\r\n /**\r\n * If be able to omit unused dimension\r\n * Used to improve the performance on high dimension data.\r\n */\r\n canOmitUnusedDimensions?: boolean\r\n};\r\n\r\n/**\r\n * For outside usage compat (like echarts-gl are using it).\r\n */\r\nexport function createDimensions(\r\n source: Source | OptionSourceData,\r\n opt?: PrepareSeriesDataSchemaParams\r\n): SeriesDimensionDefine[] {\r\n return prepareSeriesDataSchema(source, opt).dimensions;\r\n}\r\n\r\n/**\r\n * This method builds the relationship between:\r\n * + \"what the coord sys or series requires (see `coordDimensions`)\",\r\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)\"\r\n * + \"what the data source provids (see `source`)\".\r\n *\r\n * Some guess strategy will be adapted if user does not define something.\r\n * If no 'value' dimension specified, the first no-named dimension will be\r\n * named as 'value'.\r\n *\r\n * @return The results are always sorted by `storeDimIndex` asc.\r\n */\r\nexport default function prepareSeriesDataSchema(\r\n // TODO: TYPE completeDimensions type\r\n source: Source | OptionSourceData,\r\n opt?: PrepareSeriesDataSchemaParams\r\n): SeriesDataSchema {\r\n if (!isSourceInstance(source)) {\r\n source = createSourceFromSeriesDataOption(source as OptionSourceData);\r\n }\r\n\r\n opt = opt || {};\r\n\r\n const sysDims = opt.coordDimensions || [];\r\n const dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];\r\n const coordDimNameMap = createHashMap();\r\n const resultList: SeriesDimensionDefine[] = [];\r\n const dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount);\r\n\r\n // Try to ignore unused dimensions if sharing a high dimension datastore\r\n // 30 is an experience value.\r\n const omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);\r\n\r\n const isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;\r\n const dataDimNameMap = isUsingSourceDimensionsDef\r\n ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);\r\n\r\n let encodeDef = opt.encodeDefine;\r\n if (!encodeDef && opt.encodeDefaulter) {\r\n encodeDef = opt.encodeDefaulter(source, dimCount);\r\n }\r\n const encodeDefMap = createHashMap(encodeDef as any);\r\n\r\n const indicesMap = new CtorInt32Array(dimCount);\r\n for (let i = 0; i < indicesMap.length; i++) {\r\n indicesMap[i] = -1;\r\n }\r\n\r\n function getResultItem(dimIdx: number) {\r\n const idx = indicesMap[dimIdx];\r\n if (idx < 0) {\r\n const dimDefItemRaw = dimsDef[dimIdx];\r\n const dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : { name: dimDefItemRaw };\r\n const resultItem = new SeriesDimensionDefine();\r\n const userDimName = dimDefItem.name;\r\n if (userDimName != null && dataDimNameMap.get(userDimName) != null) {\r\n // Only if `series.dimensions` is defined in option\r\n // displayName, will be set, and dimension will be displayed vertically in\r\n // tooltip by default.\r\n resultItem.name = resultItem.displayName = userDimName;\r\n }\r\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\r\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\r\n const newIdx = resultList.length;\r\n indicesMap[dimIdx] = newIdx;\r\n resultItem.storeDimIndex = dimIdx;\r\n resultList.push(resultItem);\r\n return resultItem;\r\n }\r\n return resultList[idx];\r\n }\r\n\r\n if (!omitUnusedDimensions) {\r\n for (let i = 0; i < dimCount; i++) {\r\n getResultItem(i);\r\n }\r\n }\r\n\r\n // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\r\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\r\n const dataDims = normalizeToArray(dataDimsRaw as []).slice();\r\n\r\n // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\r\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\r\n // this case.\r\n if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) {\r\n encodeDefMap.set(coordDim, false);\r\n return;\r\n }\r\n\r\n const validDataDims = encodeDefMap.set(coordDim, []) as DimensionIndex[];\r\n each(dataDims, function (resultDimIdxOrName, idx) {\r\n // The input resultDimIdx can be dim name or index.\r\n const resultDimIdx = isString(resultDimIdxOrName)\r\n ? dataDimNameMap.get(resultDimIdxOrName)\r\n : resultDimIdxOrName;\r\n if (resultDimIdx != null && resultDimIdx < dimCount) {\r\n validDataDims[idx] = resultDimIdx;\r\n applyDim(getResultItem(resultDimIdx), coordDim, idx);\r\n }\r\n });\r\n });\r\n\r\n // Apply templates and default order from `sysDims`.\r\n let availDimIdx = 0;\r\n each(sysDims, function (sysDimItemRaw) {\r\n let coordDim: DimensionName;\r\n let sysDimItemDimsDef: CoordDimensionDefinition['dimsDef'];\r\n let sysDimItemOtherDims: CoordDimensionDefinition['otherDims'];\r\n let sysDimItem: CoordDimensionDefinition;\r\n if (isString(sysDimItemRaw)) {\r\n coordDim = sysDimItemRaw;\r\n sysDimItem = {} as CoordDimensionDefinition;\r\n }\r\n else {\r\n sysDimItem = sysDimItemRaw;\r\n coordDim = sysDimItem.name;\r\n const ordinalMeta = sysDimItem.ordinalMeta;\r\n sysDimItem.ordinalMeta = null;\r\n sysDimItem = extend({}, sysDimItem);\r\n sysDimItem.ordinalMeta = ordinalMeta;\r\n // `coordDimIndex` should not be set directly.\r\n sysDimItemDimsDef = sysDimItem.dimsDef;\r\n sysDimItemOtherDims = sysDimItem.otherDims;\r\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =\r\n sysDimItem.dimsDef = sysDimItem.otherDims = null;\r\n }\r\n\r\n let dataDims = encodeDefMap.get(coordDim);\r\n\r\n // negative resultDimIdx means no need to mapping.\r\n if (dataDims === false) {\r\n return;\r\n }\r\n\r\n dataDims = normalizeToArray(dataDims);\r\n\r\n // dimensions provides default dim sequences.\r\n if (!dataDims.length) {\r\n for (let i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\r\n while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) {\r\n availDimIdx++;\r\n }\r\n availDimIdx < dimCount && dataDims.push(availDimIdx++);\r\n }\r\n }\r\n\r\n // Apply templates.\r\n each(dataDims, function (resultDimIdx, coordDimIndex) {\r\n const resultItem = getResultItem(resultDimIdx);\r\n // Coordinate system has a higher priority on dim type than source.\r\n if (isUsingSourceDimensionsDef && sysDimItem.type != null) {\r\n resultItem.type = sysDimItem.type;\r\n }\r\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\r\n if (resultItem.name == null && sysDimItemDimsDef) {\r\n let sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\r\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\r\n name: sysDimItemDimsDefItem\r\n });\r\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\r\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\r\n }\r\n // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\r\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\r\n });\r\n });\r\n\r\n function applyDim(resultItem: SeriesDimensionDefine, coordDim: DimensionName, coordDimIndex: DimensionIndex) {\r\n if (VISUAL_DIMENSIONS.get(coordDim as keyof DataVisualDimensions) != null) {\r\n resultItem.otherDims[coordDim as keyof DataVisualDimensions] = coordDimIndex;\r\n }\r\n else {\r\n resultItem.coordDim = coordDim;\r\n resultItem.coordDimIndex = coordDimIndex;\r\n coordDimNameMap.set(coordDim, true);\r\n }\r\n }\r\n\r\n // Make sure the first extra dim is 'value'.\r\n const generateCoord = opt.generateCoord;\r\n let generateCoordCount = opt.generateCoordCount;\r\n const fromZero = generateCoordCount != null;\r\n generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0;\r\n const extra = generateCoord || 'value';\r\n\r\n function ifNoNameFillWithCoordName(resultItem: SeriesDimensionDefine): void {\r\n if (resultItem.name == null) {\r\n // Duplication will be removed in the next step.\r\n resultItem.name = resultItem.coordDim;\r\n }\r\n }\r\n\r\n // Set dim `name` and other `coordDim` and other props.\r\n if (!omitUnusedDimensions) {\r\n for (let resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\r\n const resultItem = getResultItem(resultDimIdx);\r\n const coordDim = resultItem.coordDim;\r\n\r\n if (coordDim == null) {\r\n // TODO no need to generate coordDim for isExtraCoord?\r\n resultItem.coordDim = genCoordDimName(\r\n extra, coordDimNameMap, fromZero\r\n );\r\n\r\n resultItem.coordDimIndex = 0;\r\n // Series specified generateCoord is using out.\r\n if (!generateCoord || generateCoordCount <= 0) {\r\n resultItem.isExtraCoord = true;\r\n }\r\n generateCoordCount--;\r\n }\r\n\r\n ifNoNameFillWithCoordName(resultItem);\r\n\r\n if (resultItem.type == null\r\n && (\r\n guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must\r\n // Consider the case:\r\n // {\r\n // dataset: {source: [\r\n // ['2001', 123],\r\n // ['2002', 456],\r\n // ...\r\n // ['The others', 987],\r\n // ]},\r\n // series: {type: 'pie'}\r\n // }\r\n // The first column should better be treated as a \"ordinal\" although it\r\n // might not be detected as an \"ordinal\" by `guessOrdinal`.\r\n || (resultItem.isExtraCoord\r\n && (resultItem.otherDims.itemName != null\r\n || resultItem.otherDims.seriesName != null\r\n )\r\n )\r\n )\r\n ) {\r\n resultItem.type = 'ordinal';\r\n }\r\n }\r\n }\r\n else {\r\n each(resultList, resultItem => {\r\n // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?\r\n ifNoNameFillWithCoordName(resultItem);\r\n });\r\n // Sort dimensions: there are some rule that use the last dim as label,\r\n // and for some latter travel process easier.\r\n resultList.sort((item0, item1) => item0.storeDimIndex - item1.storeDimIndex);\r\n }\r\n\r\n removeDuplication(resultList);\r\n\r\n return new SeriesDataSchema({\r\n source,\r\n dimensions: resultList,\r\n fullDimensionCount: dimCount,\r\n dimensionOmitted: omitUnusedDimensions\r\n });\r\n}\r\n\r\nfunction removeDuplication(result: SeriesDimensionDefine[]) {\r\n const duplicationMap = createHashMap();\r\n for (let i = 0; i < result.length; i++) {\r\n const dim = result[i];\r\n const dimOriginalName = dim.name;\r\n let count = duplicationMap.get(dimOriginalName) || 0;\r\n if (count > 0) {\r\n // Starts from 0.\r\n dim.name = dimOriginalName + (count - 1);\r\n }\r\n count++;\r\n duplicationMap.set(dimOriginalName, count);\r\n }\r\n}\r\n\r\n// ??? TODO\r\n// Originally detect dimCount by data[0]. Should we\r\n// optimize it to only by sysDims and dimensions and encode.\r\n// So only necessary dims will be initialized.\r\n// But\r\n// (1) custom series should be considered. where other dims\r\n// may be visited.\r\n// (2) sometimes user need to calculate bubble size or use visualMap\r\n// on other dimensions besides coordSys needed.\r\n// So, dims that is not used by system, should be shared in data store?\r\nfunction getDimCount(\r\n source: Source,\r\n sysDims: CoordDimensionDefinitionLoose[],\r\n dimsDef: DimensionDefinitionLoose[],\r\n optDimCount?: number\r\n): number {\r\n // Note that the result dimCount should not small than columns count\r\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\r\n let dimCount = Math.max(\r\n source.dimensionsDetectedCount || 1,\r\n sysDims.length,\r\n dimsDef.length,\r\n optDimCount || 0\r\n );\r\n each(sysDims, function (sysDimItem) {\r\n let sysDimItemDimsDef;\r\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\r\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\r\n }\r\n });\r\n return dimCount;\r\n}\r\n\r\nfunction genCoordDimName(\r\n name: DimensionName,\r\n map: HashMap,\r\n fromZero: boolean\r\n) {\r\n if (fromZero || map.hasKey(name)) {\r\n let i = 0;\r\n while (map.hasKey(name + i)) {\r\n i++;\r\n }\r\n name += i;\r\n }\r\n map.set(name, true);\r\n return name;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Helper for model references.\r\n * There are many manners to refer axis/coordSys.\r\n */\r\n\r\n// TODO\r\n// merge relevant logic to this file?\r\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\r\n\r\nimport {createHashMap, retrieve, each, HashMap} from 'zrender/src/core/util';\r\nimport SeriesModel from './Series';\r\nimport type PolarModel from '../coord/polar/PolarModel';\r\nimport type { SeriesOption, SeriesOnCartesianOptionMixin } from '../util/types';\r\nimport type { AxisBaseModel } from '../coord/AxisBaseModel';\r\nimport { SINGLE_REFERRING } from '../util/model';\r\nimport { ParallelSeriesOption } from '../chart/parallel/ParallelSeries';\r\nimport ParallelModel from '../coord/parallel/ParallelModel';\r\nimport ParallelAxisModel from '../coord/parallel/AxisModel';\r\n\r\n/**\r\n * @class\r\n * For example:\r\n * {\r\n * coordSysName: 'cartesian2d',\r\n * coordSysDims: ['x', 'y', ...],\r\n * axisMap: HashMap({\r\n * x: xAxisModel,\r\n * y: yAxisModel\r\n * }),\r\n * categoryAxisMap: HashMap({\r\n * x: xAxisModel,\r\n * y: undefined\r\n * }),\r\n * // The index of the first category axis in `coordSysDims`.\r\n * // `null/undefined` means no category axis exists.\r\n * firstCategoryDimIndex: 1,\r\n * // To replace user specified encode.\r\n * }\r\n */\r\n\r\nclass CoordSysInfo {\r\n\r\n coordSysName: string;\r\n\r\n coordSysDims: string[] = [];\r\n\r\n axisMap = createHashMap();\r\n\r\n categoryAxisMap = createHashMap();\r\n\r\n firstCategoryDimIndex: number;\r\n\r\n constructor(coordSysName: string) {\r\n this.coordSysName = coordSysName;\r\n }\r\n}\r\n\r\ntype SupportedCoordSys = 'cartesian2d' | 'polar' | 'singleAxis' | 'geo' | 'parallel';\r\ntype Fetcher = (\r\n seriesModel: SeriesModel,\r\n result: CoordSysInfo,\r\n axisMap: HashMap,\r\n categoryAxisMap: HashMap\r\n) => void;\r\n\r\nexport function getCoordSysInfoBySeries(seriesModel: SeriesModel) {\r\n const coordSysName = seriesModel.get('coordinateSystem') as SupportedCoordSys;\r\n const result = new CoordSysInfo(coordSysName);\r\n const fetch = fetchers[coordSysName];\r\n if (fetch) {\r\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\r\n return result;\r\n }\r\n}\r\n\r\nconst fetchers: Record = {\r\n\r\n cartesian2d: function (\r\n seriesModel: SeriesModel, result, axisMap, categoryAxisMap\r\n ) {\r\n const xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0] as AxisBaseModel;\r\n const yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0] as AxisBaseModel;\r\n\r\n if (__DEV__) {\r\n if (!xAxisModel) {\r\n throw new Error('xAxis \"' + retrieve(\r\n seriesModel.get('xAxisIndex'),\r\n seriesModel.get('xAxisId'),\r\n 0\r\n ) + '\" not found');\r\n }\r\n if (!yAxisModel) {\r\n throw new Error('yAxis \"' + retrieve(\r\n seriesModel.get('xAxisIndex'),\r\n seriesModel.get('yAxisId'),\r\n 0\r\n ) + '\" not found');\r\n }\r\n }\r\n\r\n result.coordSysDims = ['x', 'y'];\r\n axisMap.set('x', xAxisModel);\r\n axisMap.set('y', yAxisModel);\r\n\r\n if (isCategory(xAxisModel)) {\r\n categoryAxisMap.set('x', xAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(yAxisModel)) {\r\n categoryAxisMap.set('y', yAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n\r\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n const singleAxisModel = seriesModel.getReferringComponents(\r\n 'singleAxis', SINGLE_REFERRING\r\n ).models[0] as AxisBaseModel;\r\n\r\n if (__DEV__) {\r\n if (!singleAxisModel) {\r\n throw new Error('singleAxis should be specified.');\r\n }\r\n }\r\n\r\n result.coordSysDims = ['single'];\r\n axisMap.set('single', singleAxisModel);\r\n\r\n if (isCategory(singleAxisModel)) {\r\n categoryAxisMap.set('single', singleAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n },\r\n\r\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n const polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0] as PolarModel;\r\n const radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n const angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n\r\n if (__DEV__) {\r\n if (!angleAxisModel) {\r\n throw new Error('angleAxis option not found');\r\n }\r\n if (!radiusAxisModel) {\r\n throw new Error('radiusAxis option not found');\r\n }\r\n }\r\n\r\n result.coordSysDims = ['radius', 'angle'];\r\n axisMap.set('radius', radiusAxisModel);\r\n axisMap.set('angle', angleAxisModel);\r\n\r\n if (isCategory(radiusAxisModel)) {\r\n categoryAxisMap.set('radius', radiusAxisModel);\r\n result.firstCategoryDimIndex = 0;\r\n }\r\n if (isCategory(angleAxisModel)) {\r\n categoryAxisMap.set('angle', angleAxisModel);\r\n result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);\r\n }\r\n },\r\n\r\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n result.coordSysDims = ['lng', 'lat'];\r\n },\r\n\r\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\r\n const ecModel = seriesModel.ecModel;\r\n const parallelModel = ecModel.getComponent(\r\n 'parallel', (seriesModel as SeriesModel).get('parallelIndex')\r\n ) as ParallelModel;\r\n const coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\r\n\r\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\r\n const axisModel = ecModel.getComponent('parallelAxis', axisIndex) as ParallelAxisModel;\r\n const axisDim = coordSysDims[index];\r\n axisMap.set(axisDim, axisModel);\r\n\r\n if (isCategory(axisModel)) {\r\n categoryAxisMap.set(axisDim, axisModel);\r\n if (result.firstCategoryDimIndex == null) {\r\n result.firstCategoryDimIndex = index;\r\n }\r\n }\r\n });\r\n }\r\n};\r\n\r\nfunction isCategory(axisModel: AxisBaseModel) {\r\n return axisModel.get('type') === 'category';\r\n}\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {each, isString} from 'zrender/src/core/util';\r\nimport SeriesDimensionDefine from '../SeriesDimensionDefine';\r\nimport SeriesModel from '../../model/Series';\r\nimport SeriesData, { DataCalculationInfo } from '../SeriesData';\r\nimport type { SeriesOption, SeriesStackOptionMixin, DimensionName } from '../../util/types';\r\nimport { isSeriesDataSchema, SeriesDataSchema } from './SeriesDataSchema';\r\nimport DataStore from '../DataStore';\r\n\r\ntype EnableDataStackDimensionsInput = {\r\n schema: SeriesDataSchema;\r\n // If given, stack dimension will be ensured on this store.\r\n // Otherwise, stack dimension will be appended at the tail, and should not\r\n // be used on a shared store, but should create a brand new storage later.\r\n store?: DataStore;\r\n};\r\ntype EnableDataStackDimensionsInputLegacy = (SeriesDimensionDefine | string)[];\r\n\r\n/**\r\n * Note that it is too complicated to support 3d stack by value\r\n * (have to create two-dimension inverted index), so in 3d case\r\n * we just support that stacked by index.\r\n *\r\n * @param seriesModel\r\n * @param dimensionsInput The same as the input of .\r\n * The input will be modified.\r\n * @param opt\r\n * @param opt.stackedCoordDimension Specify a coord dimension if needed.\r\n * @param opt.byIndex=false\r\n * @return calculationInfo\r\n * {\r\n * stackedDimension: string\r\n * stackedByDimension: string\r\n * isStackedByIndex: boolean\r\n * stackedOverDimension: string\r\n * stackResultDimension: string\r\n * }\r\n */\r\nexport function enableDataStack(\r\n seriesModel: SeriesModel,\r\n dimensionsInput: EnableDataStackDimensionsInput | EnableDataStackDimensionsInputLegacy,\r\n opt?: {\r\n // Backward compat\r\n stackedCoordDimension?: string\r\n byIndex?: boolean\r\n }\r\n): Pick<\r\n DataCalculationInfo,\r\n 'stackedDimension'\r\n | 'stackedByDimension'\r\n | 'isStackedByIndex'\r\n | 'stackedOverDimension'\r\n | 'stackResultDimension'\r\n> {\r\n opt = opt || {};\r\n let byIndex = opt.byIndex;\r\n const stackedCoordDimension = opt.stackedCoordDimension;\r\n\r\n let dimensionDefineList: EnableDataStackDimensionsInputLegacy;\r\n let schema: SeriesDataSchema;\r\n let store: DataStore;\r\n\r\n if (isLegacyDimensionsInput(dimensionsInput)) {\r\n dimensionDefineList = dimensionsInput;\r\n }\r\n else {\r\n schema = dimensionsInput.schema;\r\n dimensionDefineList = schema.dimensions;\r\n store = dimensionsInput.store;\r\n }\r\n\r\n // Compatibal: when `stack` is set as '', do not stack.\r\n const mayStack = !!(seriesModel && seriesModel.get('stack'));\r\n let stackedByDimInfo: SeriesDimensionDefine;\r\n let stackedDimInfo: SeriesDimensionDefine;\r\n let stackResultDimension: string;\r\n let stackedOverDimension: string;\r\n\r\n each(dimensionDefineList, function (dimensionInfo, index) {\r\n if (isString(dimensionInfo)) {\r\n dimensionDefineList[index] = dimensionInfo = {\r\n name: dimensionInfo as string\r\n } as SeriesDimensionDefine;\r\n }\r\n\r\n if (mayStack && !dimensionInfo.isExtraCoord) {\r\n // Find the first ordinal dimension as the stackedByDimInfo.\r\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\r\n stackedByDimInfo = dimensionInfo;\r\n }\r\n // Find the first stackable dimension as the stackedDimInfo.\r\n if (!stackedDimInfo\r\n && dimensionInfo.type !== 'ordinal'\r\n && dimensionInfo.type !== 'time'\r\n && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)\r\n ) {\r\n stackedDimInfo = dimensionInfo;\r\n }\r\n }\r\n });\r\n\r\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\r\n // Compatible with previous design, value axis (time axis) only stack by index.\r\n // It may make sense if the user provides elaborately constructed data.\r\n byIndex = true;\r\n }\r\n\r\n // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\r\n // That put stack logic in List is for using conveniently in echarts extensions, but it\r\n // might not be a good way.\r\n if (stackedDimInfo) {\r\n // Use a weird name that not duplicated with other names.\r\n // Also need to use seriesModel.id as postfix because different\r\n // series may share same data store. The stack dimension needs to be distinguished.\r\n stackResultDimension = '__\\0ecstackresult_' + seriesModel.id;\r\n stackedOverDimension = '__\\0ecstackedover_' + seriesModel.id;\r\n\r\n // Create inverted index to fast query index by value.\r\n if (stackedByDimInfo) {\r\n stackedByDimInfo.createInvertedIndices = true;\r\n }\r\n\r\n const stackedDimCoordDim = stackedDimInfo.coordDim;\r\n const stackedDimType = stackedDimInfo.type;\r\n let stackedDimCoordIndex = 0;\r\n\r\n each(dimensionDefineList, function (dimensionInfo: SeriesDimensionDefine) {\r\n if (dimensionInfo.coordDim === stackedDimCoordDim) {\r\n stackedDimCoordIndex++;\r\n }\r\n });\r\n\r\n const stackedOverDimensionDefine: SeriesDimensionDefine = {\r\n name: stackResultDimension,\r\n coordDim: stackedDimCoordDim,\r\n coordDimIndex: stackedDimCoordIndex,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true,\r\n storeDimIndex: dimensionDefineList.length\r\n };\r\n\r\n const stackResultDimensionDefine: SeriesDimensionDefine = {\r\n name: stackedOverDimension,\r\n // This dimension contains stack base (generally, 0), so do not set it as\r\n // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\r\n coordDim: stackedOverDimension,\r\n coordDimIndex: stackedDimCoordIndex + 1,\r\n type: stackedDimType,\r\n isExtraCoord: true,\r\n isCalculationCoord: true,\r\n storeDimIndex: dimensionDefineList.length + 1\r\n };\r\n\r\n if (schema) {\r\n if (store) {\r\n stackedOverDimensionDefine.storeDimIndex =\r\n store.ensureCalculationDimension(stackedOverDimension, stackedDimType);\r\n stackResultDimensionDefine.storeDimIndex =\r\n store.ensureCalculationDimension(stackResultDimension, stackedDimType);\r\n }\r\n\r\n schema.appendCalculationDimension(stackedOverDimensionDefine);\r\n schema.appendCalculationDimension(stackResultDimensionDefine);\r\n }\r\n else {\r\n dimensionDefineList.push(stackedOverDimensionDefine);\r\n dimensionDefineList.push(stackResultDimensionDefine);\r\n }\r\n }\r\n\r\n return {\r\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\r\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\r\n isStackedByIndex: byIndex,\r\n stackedOverDimension: stackedOverDimension,\r\n stackResultDimension: stackResultDimension\r\n };\r\n}\r\n\r\nfunction isLegacyDimensionsInput(\r\n dimensionsInput: Parameters[1]\r\n): dimensionsInput is EnableDataStackDimensionsInputLegacy {\r\n return !isSeriesDataSchema((dimensionsInput as EnableDataStackDimensionsInput).schema);\r\n}\r\n\r\nexport function isDimensionStacked(data: SeriesData, stackedDim: string): boolean {\r\n // Each single series only maps to one pair of axis. So we do not need to\r\n // check stackByDim, whatever stacked by a dimension or stacked by index.\r\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\r\n}\r\n\r\nexport function getStackedDimension(data: SeriesData, targetDim: string): DimensionName {\r\n return isDimensionStacked(data, targetDim)\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDim;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions';\r\nimport {getDimensionTypeByAxis} from '../../data/helper/dimensionHelper';\r\nimport {getDataItemValue} from '../../util/model';\r\nimport CoordinateSystem from '../../core/CoordinateSystem';\r\nimport {getCoordSysInfoBySeries} from '../../model/referHelper';\r\nimport { createSourceFromSeriesDataOption, Source } from '../../data/Source';\r\nimport {enableDataStack} from '../../data/helper/dataStackHelper';\r\nimport {makeSeriesEncodeForAxisCoordSys} from '../../data/helper/sourceHelper';\r\nimport {\r\n SOURCE_FORMAT_ORIGINAL,\r\n DimensionDefinitionLoose,\r\n DimensionDefinition,\r\n OptionSourceData,\r\n EncodeDefaulter\r\n} from '../../util/types';\r\nimport SeriesModel from '../../model/Series';\r\nimport DataStore from '../../data/DataStore';\r\nimport SeriesDimensionDefine from '../../data/SeriesDimensionDefine';\r\n\r\nfunction getCoordSysDimDefs(\r\n seriesModel: SeriesModel,\r\n coordSysInfo: ReturnType\r\n) {\r\n const coordSysName = seriesModel.get('coordinateSystem');\r\n const registeredCoordSys = CoordinateSystem.get(coordSysName);\r\n\r\n let coordSysDimDefs: DimensionDefinitionLoose[];\r\n\r\n if (coordSysInfo && coordSysInfo.coordSysDims) {\r\n coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\r\n const dimInfo = {\r\n name: dim\r\n } as DimensionDefinition;\r\n const axisModel = coordSysInfo.axisMap.get(dim);\r\n if (axisModel) {\r\n const axisType = axisModel.get('type');\r\n dimInfo.type = getDimensionTypeByAxis(axisType);\r\n }\r\n return dimInfo;\r\n });\r\n }\r\n\r\n if (!coordSysDimDefs) {\r\n // Get dimensions from registered coordinate system\r\n coordSysDimDefs = (registeredCoordSys && (\r\n registeredCoordSys.getDimensionsInfo\r\n ? registeredCoordSys.getDimensionsInfo()\r\n : registeredCoordSys.dimensions.slice()\r\n )) || ['x', 'y'];\r\n }\r\n\r\n return coordSysDimDefs;\r\n}\r\n\r\nfunction injectOrdinalMeta(\r\n dimInfoList: SeriesDimensionDefine[],\r\n createInvertedIndices: boolean,\r\n coordSysInfo: ReturnType\r\n) {\r\n let firstCategoryDimIndex: number;\r\n let hasNameEncode: boolean;\r\n coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\r\n const coordDim = dimInfo.coordDim;\r\n const categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\r\n if (categoryAxisModel) {\r\n if (firstCategoryDimIndex == null) {\r\n firstCategoryDimIndex = dimIndex;\r\n }\r\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\r\n if (createInvertedIndices) {\r\n dimInfo.createInvertedIndices = true;\r\n }\r\n }\r\n if (dimInfo.otherDims.itemName != null) {\r\n hasNameEncode = true;\r\n }\r\n });\r\n if (!hasNameEncode && firstCategoryDimIndex != null) {\r\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\r\n }\r\n return firstCategoryDimIndex;\r\n}\r\n\r\n/**\r\n * Caution: there are side effects to `sourceManager` in this method.\r\n * Should better only be called in `Series['getInitialData']`.\r\n */\r\nfunction createSeriesData(\r\n sourceRaw: OptionSourceData | null | undefined,\r\n seriesModel: SeriesModel,\r\n opt?: {\r\n generateCoord?: string\r\n useEncodeDefaulter?: boolean | EncodeDefaulter\r\n // By default: auto. If `true`, create inverted indices for all ordinal dimension on coordSys.\r\n createInvertedIndices?: boolean\r\n }\r\n): SeriesData {\r\n opt = opt || {};\r\n\r\n const sourceManager = seriesModel.getSourceManager();\r\n let source;\r\n let isOriginalSource = false;\r\n if (sourceRaw) {\r\n isOriginalSource = true;\r\n source = createSourceFromSeriesDataOption(sourceRaw);\r\n }\r\n else {\r\n source = sourceManager.getSource();\r\n // Is series.data. not dataset.\r\n isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL;\r\n }\r\n const coordSysInfo = getCoordSysInfoBySeries(seriesModel);\r\n const coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo);\r\n const useEncodeDefaulter = opt.useEncodeDefaulter;\r\n\r\n const encodeDefaulter = zrUtil.isFunction(useEncodeDefaulter)\r\n ? useEncodeDefaulter\r\n : useEncodeDefaulter\r\n ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)\r\n : null;\r\n const createDimensionOptions = {\r\n coordDimensions: coordSysDimDefs,\r\n generateCoord: opt.generateCoord,\r\n encodeDefine: seriesModel.getEncode(),\r\n encodeDefaulter: encodeDefaulter,\r\n canOmitUnusedDimensions: !isOriginalSource\r\n };\r\n const schema = prepareSeriesDataSchema(source, createDimensionOptions);\r\n const firstCategoryDimIndex = injectOrdinalMeta(\r\n schema.dimensions, opt.createInvertedIndices, coordSysInfo\r\n );\r\n\r\n const store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null;\r\n\r\n const stackCalculationInfo = enableDataStack(seriesModel, { schema, store });\r\n\r\n const data = new SeriesData(schema, seriesModel);\r\n data.setCalculationInfo(stackCalculationInfo);\r\n\r\n const dimValueGetter =\r\n firstCategoryDimIndex != null\r\n && isNeedCompleteOrdinalData(source)\r\n ? function (this: DataStore, itemOpt: any, dimName: string, dataIndex: number, dimIndex: number) {\r\n // Use dataIndex as ordinal value in categoryAxis\r\n return dimIndex === firstCategoryDimIndex\r\n ? dataIndex\r\n : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\r\n }\r\n : null;\r\n\r\n data.hasItemOption = false;\r\n data.initData(\r\n // Try to reuse the data store in sourceManager if using dataset.\r\n isOriginalSource ? source : store,\r\n null,\r\n dimValueGetter\r\n );\r\n\r\n return data;\r\n}\r\n\r\nfunction isNeedCompleteOrdinalData(source: Source) {\r\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\r\n const sampleItem = firstDataNotNull(source.data as ArrayLike || []);\r\n return !zrUtil.isArray(getDataItemValue(sampleItem));\r\n }\r\n}\r\n\r\nfunction firstDataNotNull(arr: ArrayLike) {\r\n let i = 0;\r\n while (i < arr.length && arr[i] == null) {\r\n i++;\r\n }\r\n return arr[i];\r\n}\r\n\r\nexport default createSeriesData;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as clazzUtil from '../util/clazz';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport SeriesData from '../data/SeriesData';\r\nimport {\r\n DimensionName,\r\n ScaleDataValue,\r\n OptionDataValue,\r\n DimensionLoose,\r\n ScaleTick\r\n} from '../util/types';\r\nimport { ScaleRawExtentInfo } from '../coord/scaleRawExtentInfo';\r\n\r\n\r\nabstract class Scale = Dictionary> {\r\n\r\n type: string;\r\n\r\n private _setting: SETTING;\r\n\r\n protected _extent: [number, number];\r\n\r\n private _isBlank: boolean;\r\n\r\n // Inject\r\n readonly rawExtentInfo: ScaleRawExtentInfo;\r\n\r\n constructor(setting?: SETTING) {\r\n this._setting = setting || {} as SETTING;\r\n this._extent = [Infinity, -Infinity];\r\n }\r\n\r\n getSetting(name: KEY): SETTING[KEY] {\r\n return this._setting[name];\r\n }\r\n\r\n /**\r\n * Parse input val to valid inner number.\r\n * Notice: This would be a trap here, If the implementation\r\n * of this method depends on extent, and this method is used\r\n * before extent set (like in dataZoom), it would be wrong.\r\n * Nevertheless, parse does not depend on extent generally.\r\n */\r\n abstract parse(val: OptionDataValue): number;\r\n\r\n /**\r\n * Whether contain the given value.\r\n */\r\n abstract contain(val: ScaleDataValue): boolean;\r\n\r\n /**\r\n * Normalize value to linear [0, 1], return 0.5 if extent span is 0.\r\n */\r\n abstract normalize(val: ScaleDataValue): number;\r\n\r\n /**\r\n * Scale normalized value to extent.\r\n */\r\n abstract scale(val: number): number;\r\n\r\n /**\r\n * Set extent from data\r\n */\r\n unionExtent(other: [number, number]): void {\r\n const extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n // not setExtent because in log axis it may transformed to power\r\n // this.setExtent(extent[0], extent[1]);\r\n }\r\n\r\n /**\r\n * Set extent from data\r\n */\r\n unionExtentFromData(data: SeriesData, dim: DimensionName | DimensionLoose): void {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n }\r\n\r\n /**\r\n * Get extent\r\n *\r\n * Extent is always in increase order.\r\n */\r\n getExtent(): [number, number] {\r\n return this._extent.slice() as [number, number];\r\n }\r\n\r\n /**\r\n * Set extent\r\n */\r\n setExtent(start: number, end: number): void {\r\n const thisExtent = this._extent;\r\n if (!isNaN(start)) {\r\n thisExtent[0] = start;\r\n }\r\n if (!isNaN(end)) {\r\n thisExtent[1] = end;\r\n }\r\n }\r\n\r\n /**\r\n * If value is in extent range\r\n */\r\n isInExtentRange(value: number): boolean {\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n }\r\n\r\n /**\r\n * When axis extent depends on data and no data exists,\r\n * axis ticks should not be drawn, which is named 'blank'.\r\n */\r\n isBlank(): boolean {\r\n return this._isBlank;\r\n }\r\n\r\n /**\r\n * When axis extent depends on data and no data exists,\r\n * axis ticks should not be drawn, which is named 'blank'.\r\n */\r\n setBlank(isBlank: boolean) {\r\n this._isBlank = isBlank;\r\n }\r\n\r\n /**\r\n * Update interval and extent of intervals for nice ticks\r\n *\r\n * @param splitNumber Approximated tick numbers. Optional.\r\n * The implementation of `niceTicks` should decide tick numbers\r\n * whether `splitNumber` is given.\r\n * @param minInterval Optional.\r\n * @param maxInterval Optional.\r\n */\r\n abstract calcNiceTicks(\r\n // FIXME:TS make them in a \"opt\", the same with `niceExtent`?\r\n splitNumber?: number,\r\n minInterval?: number,\r\n maxInterval?: number\r\n ): void;\r\n\r\n abstract calcNiceExtent(\r\n opt?: {\r\n splitNumber?: number,\r\n fixMin?: boolean,\r\n fixMax?: boolean,\r\n minInterval?: number,\r\n maxInterval?: number\r\n }\r\n ): void;\r\n\r\n /**\r\n * @return label of the tick.\r\n */\r\n abstract getLabel(tick: ScaleTick): string;\r\n\r\n abstract getTicks(): ScaleTick[];\r\n\r\n abstract getMinorTicks(splitNumber: number): number[][];\r\n\r\n static registerClass: clazzUtil.ClassManager['registerClass'];\r\n\r\n static getClass: clazzUtil.ClassManager['getClass'];\r\n}\r\n\r\ntype ScaleConstructor = typeof Scale & clazzUtil.ClassManager;\r\nclazzUtil.enableClassManagement(Scale as ScaleConstructor);\r\n\r\nexport default Scale;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {createHashMap, isObject, map, HashMap, isString} from 'zrender/src/core/util';\r\nimport Model from '../model/Model';\r\nimport { OrdinalNumber, OrdinalRawValue } from '../util/types';\r\n\r\nlet uidBase = 0;\r\n\r\nclass OrdinalMeta {\r\n\r\n readonly categories: OrdinalRawValue[];\r\n\r\n private _needCollect: boolean;\r\n\r\n private _deduplication: boolean;\r\n\r\n private _map: HashMap;\r\n\r\n readonly uid: number;\r\n\r\n\r\n constructor(opt: {\r\n categories?: OrdinalRawValue[],\r\n needCollect?: boolean\r\n deduplication?: boolean\r\n }) {\r\n this.categories = opt.categories || [];\r\n this._needCollect = opt.needCollect;\r\n this._deduplication = opt.deduplication;\r\n this.uid = ++uidBase;\r\n }\r\n\r\n static createByAxisModel(axisModel: Model): OrdinalMeta {\r\n const option = axisModel.option;\r\n const data = option.data;\r\n const categories = data && map(data, getName);\r\n\r\n return new OrdinalMeta({\r\n categories: categories,\r\n needCollect: !categories,\r\n // deduplication is default in axis.\r\n deduplication: option.dedplication !== false\r\n });\r\n };\r\n\r\n getOrdinal(category: OrdinalRawValue): OrdinalNumber {\r\n // @ts-ignore\r\n return this._getOrCreateMap().get(category);\r\n }\r\n\r\n /**\r\n * @return The ordinal. If not found, return NaN.\r\n */\r\n parseAndCollect(category: OrdinalRawValue | OrdinalNumber): OrdinalNumber {\r\n let index;\r\n const needCollect = this._needCollect;\r\n\r\n // The value of category dim can be the index of the given category set.\r\n // This feature is only supported when !needCollect, because we should\r\n // consider a common case: a value is 2017, which is a number but is\r\n // expected to be tread as a category. This case usually happen in dataset,\r\n // where it happent to be no need of the index feature.\r\n if (!isString(category) && !needCollect) {\r\n return category;\r\n }\r\n\r\n // Optimize for the scenario:\r\n // category is ['2012-01-01', '2012-01-02', ...], where the input\r\n // data has been ensured not duplicate and is large data.\r\n // Notice, if a dataset dimension provide categroies, usually echarts\r\n // should remove duplication except user tell echarts dont do that\r\n // (set axis.deduplication = false), because echarts do not know whether\r\n // the values in the category dimension has duplication (consider the\r\n // parallel-aqi example)\r\n if (needCollect && !this._deduplication) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n return index;\r\n }\r\n\r\n const map = this._getOrCreateMap();\r\n // @ts-ignore\r\n index = map.get(category);\r\n\r\n if (index == null) {\r\n if (needCollect) {\r\n index = this.categories.length;\r\n this.categories[index] = category;\r\n // @ts-ignore\r\n map.set(category, index);\r\n }\r\n else {\r\n index = NaN;\r\n }\r\n }\r\n\r\n return index;\r\n }\r\n\r\n // Consider big data, do not create map until needed.\r\n private _getOrCreateMap(): HashMap {\r\n return this._map || (\r\n this._map = createHashMap(this.categories)\r\n );\r\n }\r\n}\r\n\r\nfunction getName(obj: any): string {\r\n if (isObject(obj) && obj.value != null) {\r\n return obj.value;\r\n }\r\n else {\r\n return obj + '';\r\n }\r\n}\r\n\r\nexport default OrdinalMeta;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {getPrecision, round, nice, quantityExponent} from '../util/number';\r\nimport IntervalScale from './Interval';\r\nimport LogScale from './Log';\r\nimport Scale from './Scale';\r\n\r\ntype intervalScaleNiceTicksResult = {\r\n interval: number,\r\n intervalPrecision: number,\r\n niceTickExtent: [number, number]\r\n};\r\n\r\nexport function isValueNice(val: number) {\r\n const exp10 = Math.pow(10, quantityExponent(Math.abs(val)));\r\n const f = Math.abs(val / exp10);\r\n return f === 0\r\n || f === 1\r\n || f === 2\r\n || f === 3\r\n || f === 5;\r\n}\r\n\r\nexport function isIntervalOrLogScale(scale: Scale): scale is LogScale | IntervalScale {\r\n return scale.type === 'interval' || scale.type === 'log';\r\n}\r\n/**\r\n * @param extent Both extent[0] and extent[1] should be valid number.\r\n * Should be extent[0] < extent[1].\r\n * @param splitNumber splitNumber should be >= 1.\r\n */\r\nexport function intervalScaleNiceTicks(\r\n extent: [number, number],\r\n splitNumber: number,\r\n minInterval?: number,\r\n maxInterval?: number\r\n): intervalScaleNiceTicksResult {\r\n\r\n const result = {} as intervalScaleNiceTicksResult;\r\n\r\n const span = extent[1] - extent[0];\r\n let interval = result.interval = nice(span / splitNumber, true);\r\n if (minInterval != null && interval < minInterval) {\r\n interval = result.interval = minInterval;\r\n }\r\n if (maxInterval != null && interval > maxInterval) {\r\n interval = result.interval = maxInterval;\r\n }\r\n // Tow more digital for tick.\r\n const precision = result.intervalPrecision = getIntervalPrecision(interval);\r\n // Niced extent inside original extent\r\n const niceTickExtent = result.niceTickExtent = [\r\n round(Math.ceil(extent[0] / interval) * interval, precision),\r\n round(Math.floor(extent[1] / interval) * interval, precision)\r\n ];\r\n\r\n fixExtent(niceTickExtent, extent);\r\n\r\n return result;\r\n}\r\n\r\nexport function increaseInterval(interval: number) {\r\n const exp10 = Math.pow(10, quantityExponent(interval));\r\n // Increase interval\r\n let f = interval / exp10;\r\n if (!f) {\r\n f = 1;\r\n }\r\n else if (f === 2) {\r\n f = 3;\r\n }\r\n else if (f === 3) {\r\n f = 5;\r\n }\r\n else { // f is 1 or 5\r\n f *= 2;\r\n }\r\n return round(f * exp10);\r\n}\r\n\r\n/**\r\n * @return interval precision\r\n */\r\nexport function getIntervalPrecision(interval: number): number {\r\n // Tow more digital for tick.\r\n return getPrecision(interval) + 2;\r\n}\r\n\r\nfunction clamp(\r\n niceTickExtent: [number, number], idx: number, extent: [number, number]\r\n): void {\r\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\r\n}\r\n\r\n// In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\r\nexport function fixExtent(\r\n niceTickExtent: [number, number], extent: [number, number]\r\n): void {\r\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\r\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\r\n clamp(niceTickExtent, 0, extent);\r\n clamp(niceTickExtent, 1, extent);\r\n if (niceTickExtent[0] > niceTickExtent[1]) {\r\n niceTickExtent[0] = niceTickExtent[1];\r\n }\r\n}\r\n\r\nexport function contain(val: number, extent: [number, number]): boolean {\r\n return val >= extent[0] && val <= extent[1];\r\n}\r\n\r\nexport function normalize(val: number, extent: [number, number]): number {\r\n if (extent[1] === extent[0]) {\r\n return 0.5;\r\n }\r\n return (val - extent[0]) / (extent[1] - extent[0]);\r\n}\r\n\r\nexport function scale(val: number, extent: [number, number]): number {\r\n return val * (extent[1] - extent[0]) + extent[0];\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Linear continuous scale\r\n * http://en.wikipedia.org/wiki/Level_of_measurement\r\n */\r\n\r\n// FIXME only one data\r\n\r\nimport Scale from './Scale';\r\nimport OrdinalMeta from '../data/OrdinalMeta';\r\nimport SeriesData from '../data/SeriesData';\r\nimport * as scaleHelper from './helper';\r\nimport {\r\n OrdinalRawValue,\r\n OrdinalNumber,\r\n DimensionLoose,\r\n OrdinalSortInfo,\r\n OrdinalScaleTick,\r\n ScaleTick\r\n} from '../util/types';\r\nimport { CategoryAxisBaseOption } from '../coord/axisCommonTypes';\r\nimport { isArray, map, isObject, isString } from 'zrender/src/core/util';\r\n\r\ntype OrdinalScaleSetting = {\r\n ordinalMeta?: OrdinalMeta | CategoryAxisBaseOption['data'];\r\n extent?: [number, number];\r\n};\r\n\r\nclass OrdinalScale extends Scale {\r\n\r\n static type = 'ordinal';\r\n readonly type = 'ordinal';\r\n\r\n private _ordinalMeta: OrdinalMeta;\r\n\r\n /**\r\n * For example:\r\n * Given original ordinal data:\r\n * ```js\r\n * option = {\r\n * xAxis: {\r\n * // Their raw ordinal numbers are:\r\n * // 0 1 2 3 4 5\r\n * data: ['a', 'b', 'c', 'd', 'e', 'f']\r\n * },\r\n * yAxis: {}\r\n * series: {\r\n * type: 'bar',\r\n * data: [\r\n * ['d', 110], // ordinalNumber: 3\r\n * ['c', 660], // ordinalNumber: 2\r\n * ['f', 220], // ordinalNumber: 5\r\n * ['e', 550] // ordinalNumber: 4\r\n * ],\r\n * realtimeSort: true\r\n * }\r\n * };\r\n * ```\r\n * After realtime sorted (order by yValue desc):\r\n * ```js\r\n * _ordinalNumbersByTick: [\r\n * 2, // tick: 0, yValue: 660\r\n * 5, // tick: 1, yValue: 220\r\n * 3, // tick: 2, yValue: 110\r\n * 4, // tick: 3, yValue: 550\r\n * 0, // tick: 4, yValue: -\r\n * 1, // tick: 5, yValue: -\r\n * ],\r\n * _ticksByOrdinalNumber: [\r\n * 4, // ordinalNumber: 0, yValue: -\r\n * 5, // ordinalNumber: 1, yValue: -\r\n * 0, // ordinalNumber: 2, yValue: 660\r\n * 2, // ordinalNumber: 3, yValue: 110\r\n * 3, // ordinalNumber: 4, yValue: 550\r\n * 1, // ordinalNumber: 5, yValue: 220\r\n * ]\r\n * ```\r\n * The index of this array is from `0` to `ordinalMeta.categories.length`.\r\n *\r\n * @see `Ordinal['getRawOrdinalNumber']`\r\n * @see `OrdinalSortInfo`\r\n */\r\n private _ordinalNumbersByTick: OrdinalNumber[];\r\n\r\n /**\r\n * This is the inverted map of `_ordinalNumbersByTick`.\r\n * The index of this array is from `0` to `ordinalMeta.categories.length`.\r\n *\r\n * @see `Ordinal['_ordinalNumbersByTick']`\r\n * @see `Ordinal['_getTickNumber']`\r\n * @see `OrdinalSortInfo`\r\n */\r\n private _ticksByOrdinalNumber: number[];\r\n\r\n\r\n constructor(setting?: OrdinalScaleSetting) {\r\n super(setting);\r\n\r\n let ordinalMeta = this.getSetting('ordinalMeta');\r\n // Caution: Should not use instanceof, consider ec-extensions using\r\n // import approach to get OrdinalMeta class.\r\n if (!ordinalMeta) {\r\n ordinalMeta = new OrdinalMeta({});\r\n }\r\n if (isArray(ordinalMeta)) {\r\n ordinalMeta = new OrdinalMeta({\r\n categories: map(ordinalMeta, item => (isObject(item) ? item.value : item))\r\n });\r\n }\r\n this._ordinalMeta = ordinalMeta as OrdinalMeta;\r\n this._extent = this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\r\n }\r\n\r\n parse(val: OrdinalRawValue | OrdinalNumber): OrdinalNumber {\r\n // Caution: Math.round(null) will return `0` rather than `NaN`\r\n if (val == null) {\r\n return NaN;\r\n }\r\n return isString(val)\r\n ? this._ordinalMeta.getOrdinal(val)\r\n // val might be float.\r\n : Math.round(val);\r\n }\r\n\r\n contain(rank: OrdinalRawValue | OrdinalNumber): boolean {\r\n rank = this.parse(rank);\r\n return scaleHelper.contain(rank, this._extent)\r\n && this._ordinalMeta.categories[rank] != null;\r\n }\r\n\r\n /**\r\n * Normalize given rank or name to linear [0, 1]\r\n * @param val raw ordinal number.\r\n * @return normalized value in [0, 1].\r\n */\r\n normalize(val: OrdinalRawValue | OrdinalNumber): number {\r\n val = this._getTickNumber(this.parse(val));\r\n return scaleHelper.normalize(val, this._extent);\r\n }\r\n\r\n /**\r\n * @param val normalized value in [0, 1].\r\n * @return raw ordinal number.\r\n */\r\n scale(val: number): OrdinalNumber {\r\n val = Math.round(scaleHelper.scale(val, this._extent));\r\n return this.getRawOrdinalNumber(val);\r\n }\r\n\r\n getTicks(): OrdinalScaleTick[] {\r\n const ticks = [];\r\n const extent = this._extent;\r\n let rank = extent[0];\r\n\r\n while (rank <= extent[1]) {\r\n ticks.push({\r\n value: rank\r\n });\r\n rank++;\r\n }\r\n\r\n return ticks;\r\n }\r\n\r\n getMinorTicks(splitNumber: number): number[][] {\r\n // Not support.\r\n return;\r\n }\r\n\r\n /**\r\n * @see `Ordinal['_ordinalNumbersByTick']`\r\n */\r\n setSortInfo(info: OrdinalSortInfo): void {\r\n if (info == null) {\r\n this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;\r\n return;\r\n }\r\n\r\n const infoOrdinalNumbers = info.ordinalNumbers;\r\n const ordinalsByTick = this._ordinalNumbersByTick = [] as OrdinalNumber[];\r\n const ticksByOrdinal = this._ticksByOrdinalNumber = [] as number[];\r\n\r\n // Unnecessary support negative tick in `realtimeSort`.\r\n let tickNum = 0;\r\n const allCategoryLen = this._ordinalMeta.categories.length;\r\n for (const len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) {\r\n const ordinalNumber = infoOrdinalNumbers[tickNum];\r\n ordinalsByTick[tickNum] = ordinalNumber;\r\n ticksByOrdinal[ordinalNumber] = tickNum;\r\n }\r\n // Handle that `series.data` only covers part of the `axis.category.data`.\r\n let unusedOrdinal = 0;\r\n for (; tickNum < allCategoryLen; ++tickNum) {\r\n while (ticksByOrdinal[unusedOrdinal] != null) {\r\n unusedOrdinal++;\r\n };\r\n ordinalsByTick.push(unusedOrdinal);\r\n ticksByOrdinal[unusedOrdinal] = tickNum;\r\n }\r\n }\r\n\r\n private _getTickNumber(ordinal: OrdinalNumber): number {\r\n const ticksByOrdinalNumber = this._ticksByOrdinalNumber;\r\n // also support ordinal out of range of `ordinalMeta.categories.length`,\r\n // where ordinal numbers are used as tick value directly.\r\n return (ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length)\r\n ? ticksByOrdinalNumber[ordinal]\r\n : ordinal;\r\n }\r\n\r\n /**\r\n * @usage\r\n * ```js\r\n * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);\r\n *\r\n * // case0\r\n * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];\r\n * // case1\r\n * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];\r\n * // case2\r\n * const coord = axis.dataToCoord(ordinalNumber);\r\n * ```\r\n *\r\n * @param {OrdinalNumber} tickNumber index of display\r\n */\r\n getRawOrdinalNumber(tickNumber: number): OrdinalNumber {\r\n const ordinalNumbersByTick = this._ordinalNumbersByTick;\r\n // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,\r\n // where ordinal numbers are used as tick value directly.\r\n return (ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length)\r\n ? ordinalNumbersByTick[tickNumber]\r\n : tickNumber;\r\n }\r\n\r\n /**\r\n * Get item on tick\r\n */\r\n getLabel(tick: ScaleTick): string {\r\n if (!this.isBlank()) {\r\n const ordinalNumber = this.getRawOrdinalNumber(tick.value);\r\n const cateogry = this._ordinalMeta.categories[ordinalNumber];\r\n // Note that if no data, ordinalMeta.categories is an empty array.\r\n // Return empty if it's not exist.\r\n return cateogry == null ? '' : cateogry + '';\r\n }\r\n }\r\n\r\n count(): number {\r\n return this._extent[1] - this._extent[0] + 1;\r\n }\r\n\r\n unionExtentFromData(data: SeriesData, dim: DimensionLoose) {\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n }\r\n\r\n /**\r\n * @override\r\n * If value is in extent range\r\n */\r\n isInExtentRange(value: OrdinalNumber): boolean {\r\n value = this._getTickNumber(value);\r\n return this._extent[0] <= value && this._extent[1] >= value;\r\n }\r\n\r\n getOrdinalMeta(): OrdinalMeta {\r\n return this._ordinalMeta;\r\n }\r\n\r\n calcNiceTicks() {}\r\n\r\n calcNiceExtent() {}\r\n\r\n}\r\n\r\nScale.registerClass(OrdinalScale);\r\n\r\nexport default OrdinalScale;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as numberUtil from '../util/number';\r\nimport * as formatUtil from '../util/format';\r\nimport Scale from './Scale';\r\nimport * as helper from './helper';\r\nimport {ScaleTick, Dictionary} from '../util/types';\r\n\r\nconst roundNumber = numberUtil.round;\r\n\r\nclass IntervalScale = Dictionary> extends Scale {\r\n\r\n static type = 'interval';\r\n type = 'interval';\r\n\r\n // Step is calculated in adjustExtent.\r\n protected _interval: number = 0;\r\n protected _niceExtent: [number, number];\r\n private _intervalPrecision: number = 2;\r\n\r\n\r\n parse(val: number): number {\r\n return val;\r\n }\r\n\r\n contain(val: number): boolean {\r\n return helper.contain(val, this._extent);\r\n }\r\n\r\n normalize(val: number): number {\r\n return helper.normalize(val, this._extent);\r\n }\r\n\r\n scale(val: number): number {\r\n return helper.scale(val, this._extent);\r\n }\r\n\r\n setExtent(start: number | string, end: number | string): void {\r\n const thisExtent = this._extent;\r\n // start,end may be a Number like '25',so...\r\n if (!isNaN(start as any)) {\r\n thisExtent[0] = parseFloat(start as any);\r\n }\r\n if (!isNaN(end as any)) {\r\n thisExtent[1] = parseFloat(end as any);\r\n }\r\n }\r\n\r\n unionExtent(other: [number, number]): void {\r\n const extent = this._extent;\r\n other[0] < extent[0] && (extent[0] = other[0]);\r\n other[1] > extent[1] && (extent[1] = other[1]);\r\n\r\n // unionExtent may called by it's sub classes\r\n this.setExtent(extent[0], extent[1]);\r\n }\r\n\r\n getInterval(): number {\r\n return this._interval;\r\n }\r\n\r\n setInterval(interval: number): void {\r\n this._interval = interval;\r\n // Dropped auto calculated niceExtent and use user-set extent.\r\n // We assume user wants to set both interval, min, max to get a better result.\r\n this._niceExtent = this._extent.slice() as [number, number];\r\n\r\n this._intervalPrecision = helper.getIntervalPrecision(interval);\r\n }\r\n\r\n /**\r\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\r\n */\r\n getTicks(expandToNicedExtent?: boolean): ScaleTick[] {\r\n const interval = this._interval;\r\n const extent = this._extent;\r\n const niceTickExtent = this._niceExtent;\r\n const intervalPrecision = this._intervalPrecision;\r\n\r\n const ticks = [] as ScaleTick[];\r\n // If interval is 0, return [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n\r\n // Consider this case: using dataZoom toolbox, zoom and zoom.\r\n const safeLimit = 10000;\r\n\r\n if (extent[0] < niceTickExtent[0]) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[0]\r\n });\r\n }\r\n }\r\n let tick = niceTickExtent[0];\r\n\r\n while (tick <= niceTickExtent[1]) {\r\n ticks.push({\r\n value: tick\r\n });\r\n // Avoid rounding error\r\n tick = roundNumber(tick + interval, intervalPrecision);\r\n if (tick === ticks[ticks.length - 1].value) {\r\n // Consider out of safe float point, e.g.,\r\n // -3711126.9907707 + 2e-10 === -3711126.9907707\r\n break;\r\n }\r\n if (ticks.length > safeLimit) {\r\n return [];\r\n }\r\n }\r\n // Consider this case: the last item of ticks is smaller\r\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\r\n const lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\r\n if (extent[1] > lastNiceTick) {\r\n if (expandToNicedExtent) {\r\n ticks.push({\r\n value: roundNumber(lastNiceTick + interval, intervalPrecision)\r\n });\r\n }\r\n else {\r\n ticks.push({\r\n value: extent[1]\r\n });\r\n }\r\n }\r\n\r\n return ticks;\r\n }\r\n\r\n getMinorTicks(splitNumber: number): number[][] {\r\n const ticks = this.getTicks(true);\r\n const minorTicks = [];\r\n const extent = this.getExtent();\r\n\r\n for (let i = 1; i < ticks.length; i++) {\r\n const nextTick = ticks[i];\r\n const prevTick = ticks[i - 1];\r\n let count = 0;\r\n const minorTicksGroup = [];\r\n const interval = nextTick.value - prevTick.value;\r\n const minorInterval = interval / splitNumber;\r\n\r\n while (count < splitNumber - 1) {\r\n const minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval);\r\n\r\n // For the first and last interval. The count may be less than splitNumber.\r\n if (minorTick > extent[0] && minorTick < extent[1]) {\r\n minorTicksGroup.push(minorTick);\r\n }\r\n count++;\r\n }\r\n minorTicks.push(minorTicksGroup);\r\n }\r\n\r\n return minorTicks;\r\n }\r\n\r\n /**\r\n * @param opt.precision If 'auto', use nice presision.\r\n * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\r\n */\r\n getLabel(\r\n data: ScaleTick,\r\n opt?: {\r\n precision?: 'auto' | number,\r\n pad?: boolean\r\n }\r\n ): string {\r\n if (data == null) {\r\n return '';\r\n }\r\n\r\n let precision = opt && opt.precision;\r\n\r\n if (precision == null) {\r\n precision = numberUtil.getPrecision(data.value) || 0;\r\n }\r\n else if (precision === 'auto') {\r\n // Should be more precise then tick.\r\n precision = this._intervalPrecision;\r\n }\r\n\r\n // (1) If `precision` is set, 12.005 should be display as '12.00500'.\r\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\r\n const dataNum = roundNumber(data.value, precision as number, true);\r\n\r\n return formatUtil.addCommas(dataNum);\r\n }\r\n\r\n /**\r\n * @param splitNumber By default `5`.\r\n */\r\n calcNiceTicks(splitNumber?: number, minInterval?: number, maxInterval?: number): void {\r\n splitNumber = splitNumber || 5;\r\n const extent = this._extent;\r\n let span = extent[1] - extent[0];\r\n if (!isFinite(span)) {\r\n return;\r\n }\r\n // User may set axis min 0 and data are all negative\r\n // FIXME If it needs to reverse ?\r\n if (span < 0) {\r\n span = -span;\r\n extent.reverse();\r\n }\r\n\r\n const result = helper.intervalScaleNiceTicks(\r\n extent, splitNumber, minInterval, maxInterval\r\n );\r\n\r\n this._intervalPrecision = result.intervalPrecision;\r\n this._interval = result.interval;\r\n this._niceExtent = result.niceTickExtent;\r\n }\r\n\r\n calcNiceExtent(opt: {\r\n splitNumber: number, // By default 5.\r\n fixMin?: boolean,\r\n fixMax?: boolean,\r\n minInterval?: number,\r\n maxInterval?: number\r\n }): void {\r\n const extent = this._extent;\r\n // If extent start and end are same, expand them\r\n if (extent[0] === extent[1]) {\r\n if (extent[0] !== 0) {\r\n // Expand extent\r\n // Note that extents can be both negative. See #13154\r\n const expandSize = Math.abs(extent[0]);\r\n // In the fowllowing case\r\n // Axis has been fixed max 100\r\n // Plus data are all 100 and axis extent are [100, 100].\r\n // Extend to the both side will cause expanded max is larger than fixed max.\r\n // So only expand to the smaller side.\r\n if (!opt.fixMax) {\r\n extent[1] += expandSize / 2;\r\n extent[0] -= expandSize / 2;\r\n }\r\n else {\r\n extent[0] -= expandSize / 2;\r\n }\r\n }\r\n else {\r\n extent[1] = 1;\r\n }\r\n }\r\n const span = extent[1] - extent[0];\r\n // If there are no data and extent are [Infinity, -Infinity]\r\n if (!isFinite(span)) {\r\n extent[0] = 0;\r\n extent[1] = 1;\r\n }\r\n\r\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n // let extent = this._extent;\r\n const interval = this._interval;\r\n\r\n if (!opt.fixMin) {\r\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\r\n }\r\n if (!opt.fixMax) {\r\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\r\n }\r\n }\r\n\r\n setNiceExtent(min: number, max: number) {\r\n this._niceExtent = [min, max];\r\n }\r\n}\r\n\r\nScale.registerClass(IntervalScale);\r\n\r\nexport default IntervalScale;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { isArray } from 'zrender/src/core/util';\r\n\r\n/* global Float32Array */\r\nconst supportFloat32Array = typeof Float32Array !== 'undefined';\r\n\r\nconst Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\r\n\r\nexport function createFloat32Array(arg: number | number[]): number[] | Float32Array {\r\n if (isArray(arg)) {\r\n // Return self directly if don't support TypedArray.\r\n return supportFloat32Array ? new Float32Array(arg) : arg;\r\n }\r\n // Else is number\r\n return new Float32ArrayCtor(arg);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { each, defaults, keys } from 'zrender/src/core/util';\r\nimport { parsePercent } from '../util/number';\r\nimport { isDimensionStacked } from '../data/helper/dataStackHelper';\r\nimport createRenderPlanner from '../chart/helper/createRenderPlanner';\r\nimport BarSeriesModel from '../chart/bar/BarSeries';\r\nimport Axis2D from '../coord/cartesian/Axis2D';\r\nimport GlobalModel from '../model/Global';\r\nimport type Cartesian2D from '../coord/cartesian/Cartesian2D';\r\nimport { StageHandler, Dictionary } from '../util/types';\r\nimport { createFloat32Array } from '../util/vendor';\r\n\r\nconst STACK_PREFIX = '__ec_stack_';\r\n\r\nfunction getSeriesStackId(seriesModel: BarSeriesModel): string {\r\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\r\n}\r\n\r\nfunction getAxisKey(axis: Axis2D): string {\r\n return axis.dim + axis.index;\r\n}\r\n\r\ninterface LayoutSeriesInfo {\r\n bandWidth: number\r\n barWidth: number\r\n barMaxWidth: number\r\n barMinWidth: number\r\n barGap: number | string\r\n barCategoryGap: number | string\r\n axisKey: string\r\n stackId: string\r\n}\r\n\r\ninterface StackInfo {\r\n width: number\r\n maxWidth: number\r\n minWidth?: number\r\n}\r\n\r\n/**\r\n * {\r\n * [coordSysId]: {\r\n * [stackId]: {bandWidth, offset, width}\r\n * }\r\n * }\r\n */\r\ntype BarWidthAndOffset = Dictionary>;\r\n\r\nexport interface BarGridLayoutOptionForCustomSeries {\r\n count: number\r\n\r\n barWidth?: number | string\r\n barMaxWidth?: number | string\r\n barMinWidth?: number | string\r\n barGap?: number | string\r\n barCategoryGap?: number | string\r\n}\r\ninterface LayoutOption extends BarGridLayoutOptionForCustomSeries {\r\n axis: Axis2D\r\n}\r\n\r\nexport type BarGridLayoutResult = BarWidthAndOffset[string][string][];\r\n/**\r\n * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.\r\n */\r\nexport function getLayoutOnAxis(opt: LayoutOption): BarGridLayoutResult {\r\n const params: LayoutSeriesInfo[] = [];\r\n const baseAxis = opt.axis;\r\n const axisKey = 'axis0';\r\n\r\n if (baseAxis.type !== 'category') {\r\n return;\r\n }\r\n const bandWidth = baseAxis.getBandWidth();\r\n\r\n for (let i = 0; i < opt.count || 0; i++) {\r\n params.push(defaults({\r\n bandWidth: bandWidth,\r\n axisKey: axisKey,\r\n stackId: STACK_PREFIX + i\r\n }, opt) as LayoutSeriesInfo);\r\n }\r\n const widthAndOffsets = doCalBarWidthAndOffset(params);\r\n\r\n const result = [];\r\n for (let i = 0; i < opt.count; i++) {\r\n const item = widthAndOffsets[axisKey][STACK_PREFIX + i];\r\n item.offsetCenter = item.offset + item.width / 2;\r\n result.push(item);\r\n }\r\n\r\n return result;\r\n}\r\n\r\nexport function prepareLayoutBarSeries(seriesType: string, ecModel: GlobalModel): BarSeriesModel[] {\r\n const seriesModels: BarSeriesModel[] = [];\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel: BarSeriesModel) {\r\n // Check series coordinate, do layout for cartesian2d only\r\n if (isOnCartesian(seriesModel)) {\r\n seriesModels.push(seriesModel);\r\n }\r\n });\r\n return seriesModels;\r\n}\r\n\r\n\r\n/**\r\n * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent\r\n * values.\r\n * This works for time axes, value axes, and log axes.\r\n * For a single time axis, return value is in the form like\r\n * {'x_0': [1000000]}.\r\n * The value of 1000000 is in milliseconds.\r\n */\r\nfunction getValueAxesMinGaps(barSeries: BarSeriesModel[]) {\r\n /**\r\n * Map from axis.index to values.\r\n * For a single time axis, axisValues is in the form like\r\n * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.\r\n * Items in axisValues[x], e.g. 1495555200000, are time values of all\r\n * series.\r\n */\r\n const axisValues: Dictionary = {};\r\n each(barSeries, function (seriesModel) {\r\n const cartesian = seriesModel.coordinateSystem as Cartesian2D;\r\n const baseAxis = cartesian.getBaseAxis();\r\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n const key = baseAxis.dim + '_' + baseAxis.index;\r\n const dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\r\n const store = data.getStore();\r\n for (let i = 0, cnt = store.count(); i < cnt; ++i) {\r\n const value = store.get(dimIdx, i) as number;\r\n if (!axisValues[key]) {\r\n // No previous data for the axis\r\n axisValues[key] = [value];\r\n }\r\n else {\r\n // No value in previous series\r\n axisValues[key].push(value);\r\n }\r\n // Ignore duplicated time values in the same axis\r\n }\r\n });\r\n\r\n const axisMinGaps: Dictionary = {};\r\n for (const key in axisValues) {\r\n if (axisValues.hasOwnProperty(key)) {\r\n const valuesInAxis = axisValues[key];\r\n if (valuesInAxis) {\r\n // Sort axis values into ascending order to calculate gaps\r\n valuesInAxis.sort(function (a, b) {\r\n return a - b;\r\n });\r\n\r\n let min = null;\r\n for (let j = 1; j < valuesInAxis.length; ++j) {\r\n const delta = valuesInAxis[j] - valuesInAxis[j - 1];\r\n if (delta > 0) {\r\n // Ignore 0 delta because they are of the same axis value\r\n min = min === null ? delta : Math.min(min, delta);\r\n }\r\n }\r\n // Set to null if only have one data\r\n axisMinGaps[key] = min;\r\n }\r\n }\r\n }\r\n return axisMinGaps;\r\n}\r\n\r\nexport function makeColumnLayout(barSeries: BarSeriesModel[]) {\r\n const axisMinGaps = getValueAxesMinGaps(barSeries);\r\n\r\n const seriesInfoList: LayoutSeriesInfo[] = [];\r\n each(barSeries, function (seriesModel) {\r\n const cartesian = seriesModel.coordinateSystem as Cartesian2D;\r\n const baseAxis = cartesian.getBaseAxis();\r\n const axisExtent = baseAxis.getExtent();\r\n\r\n let bandWidth;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\r\n const key = baseAxis.dim + '_' + baseAxis.index;\r\n const minGap = axisMinGaps[key];\r\n const extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\r\n const scale = baseAxis.scale.getExtent();\r\n const scaleSpan = Math.abs(scale[1] - scale[0]);\r\n bandWidth = minGap\r\n ? extentSpan / scaleSpan * minGap\r\n : extentSpan; // When there is only one data value\r\n }\r\n else {\r\n const data = seriesModel.getData();\r\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\r\n }\r\n\r\n const barWidth = parsePercent(\r\n seriesModel.get('barWidth'), bandWidth\r\n );\r\n const barMaxWidth = parsePercent(\r\n seriesModel.get('barMaxWidth'), bandWidth\r\n );\r\n const barMinWidth = parsePercent(\r\n // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,\r\n // the auto-calculated bar width might be less than 0.5 / 1.\r\n seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth\r\n );\r\n const barGap = seriesModel.get('barGap');\r\n const barCategoryGap = seriesModel.get('barCategoryGap');\r\n\r\n seriesInfoList.push({\r\n bandWidth: bandWidth,\r\n barWidth: barWidth,\r\n barMaxWidth: barMaxWidth,\r\n barMinWidth: barMinWidth,\r\n barGap: barGap,\r\n barCategoryGap: barCategoryGap,\r\n axisKey: getAxisKey(baseAxis),\r\n stackId: getSeriesStackId(seriesModel)\r\n });\r\n });\r\n\r\n return doCalBarWidthAndOffset(seriesInfoList);\r\n}\r\n\r\nfunction doCalBarWidthAndOffset(seriesInfoList: LayoutSeriesInfo[]) {\r\n interface ColumnOnAxisInfo {\r\n bandWidth: number\r\n remainedWidth: number\r\n autoWidthCount: number\r\n categoryGap: number | string\r\n gap: number | string\r\n stacks: Dictionary\r\n }\r\n\r\n // Columns info on each category axis. Key is cartesian name\r\n const columnsMap: Dictionary = {};\r\n\r\n each(seriesInfoList, function (seriesInfo, idx) {\r\n const axisKey = seriesInfo.axisKey;\r\n const bandWidth = seriesInfo.bandWidth;\r\n const columnsOnAxis: ColumnOnAxisInfo = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: null,\r\n gap: '20%',\r\n stacks: {}\r\n };\r\n const stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n\r\n const stackId = seriesInfo.stackId;\r\n\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n\r\n // Caution: In a single coordinate system, these barGrid attributes\r\n // will be shared by series. Consider that they have default values,\r\n // only the attributes set on the last series will work.\r\n // Do not change this fact unless there will be a break change.\r\n\r\n let barWidth = seriesInfo.barWidth;\r\n if (barWidth && !stacks[stackId].width) {\r\n // See #6312, do not restrict width.\r\n stacks[stackId].width = barWidth;\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n\r\n const barMaxWidth = seriesInfo.barMaxWidth;\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n const barMinWidth = seriesInfo.barMinWidth;\r\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\r\n const barGap = seriesInfo.barGap;\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n const barCategoryGap = seriesInfo.barCategoryGap;\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n\r\n const result: BarWidthAndOffset = {};\r\n\r\n each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n\r\n result[coordSysName] = {};\r\n\r\n const stacks = columnsOnAxis.stacks;\r\n const bandWidth = columnsOnAxis.bandWidth;\r\n let categoryGapPercent = columnsOnAxis.categoryGap;\r\n if (categoryGapPercent == null) {\r\n const columnCount = keys(stacks).length;\r\n // More columns in one group\r\n // the spaces between group is smaller. Or the column will be too thin.\r\n categoryGapPercent = Math.max((35 - columnCount * 4), 15) + '%';\r\n }\r\n\r\n const categoryGap = parsePercent(categoryGapPercent, bandWidth);\r\n const barGapPercent = parsePercent(columnsOnAxis.gap, 1);\r\n\r\n let remainedWidth = columnsOnAxis.remainedWidth;\r\n let autoWidthCount = columnsOnAxis.autoWidthCount;\r\n let autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n\r\n // Find if any auto calculated bar exceeded maxBarWidth\r\n each(stacks, function (column) {\r\n const maxWidth = column.maxWidth;\r\n const minWidth = column.minWidth;\r\n\r\n if (!column.width) {\r\n let finalWidth = autoWidth;\r\n if (maxWidth && maxWidth < finalWidth) {\r\n finalWidth = Math.min(maxWidth, remainedWidth);\r\n }\r\n // `minWidth` has higher priority. `minWidth` decide that whether the\r\n // bar is able to be visible. So `minWidth` should not be restricted\r\n // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In\r\n // the extreme cases for `value` axis, bars are allowed to overlap\r\n // with each other if `minWidth` specified.\r\n if (minWidth && minWidth > finalWidth) {\r\n finalWidth = minWidth;\r\n }\r\n if (finalWidth !== autoWidth) {\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n }\r\n else {\r\n // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\r\n // CSS does. Because barWidth can be a percent value, where\r\n // `barMaxWidth` can be used to restrict the final width.\r\n let finalWidth = column.width;\r\n if (maxWidth) {\r\n finalWidth = Math.min(finalWidth, maxWidth);\r\n }\r\n // `minWidth` has higher priority, as described above\r\n if (minWidth) {\r\n finalWidth = Math.max(finalWidth, minWidth);\r\n }\r\n column.width = finalWidth;\r\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n\r\n // Recalculate width again\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n\r\n autoWidth = Math.max(autoWidth, 0);\r\n\r\n\r\n let widthSum = 0;\r\n let lastColumn: StackInfo;\r\n each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n\r\n let offset = -widthSum / 2;\r\n each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n bandWidth: bandWidth,\r\n offset: offset,\r\n width: column.width\r\n } as BarWidthAndOffset[string][string];\r\n\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * @param barWidthAndOffset The result of makeColumnLayout\r\n * @param seriesModel If not provided, return all.\r\n * @return {stackId: {offset, width}} or {offset, width} if seriesModel provided.\r\n */\r\nfunction retrieveColumnLayout(barWidthAndOffset: BarWidthAndOffset, axis: Axis2D): typeof barWidthAndOffset[string];\r\n// eslint-disable-next-line max-len\r\nfunction retrieveColumnLayout(barWidthAndOffset: BarWidthAndOffset, axis: Axis2D, seriesModel: BarSeriesModel): typeof barWidthAndOffset[string][string];\r\nfunction retrieveColumnLayout(\r\n barWidthAndOffset: BarWidthAndOffset,\r\n axis: Axis2D,\r\n seriesModel?: BarSeriesModel\r\n) {\r\n if (barWidthAndOffset && axis) {\r\n const result = barWidthAndOffset[getAxisKey(axis)];\r\n if (result != null && seriesModel != null) {\r\n return result[getSeriesStackId(seriesModel)];\r\n }\r\n return result;\r\n }\r\n}\r\nexport {retrieveColumnLayout};\r\n\r\nexport function layout(seriesType: string, ecModel: GlobalModel) {\r\n\r\n const seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\r\n const barWidthAndOffset = makeColumnLayout(seriesModels);\r\n\r\n each(seriesModels, function (seriesModel) {\r\n\r\n const data = seriesModel.getData();\r\n const cartesian = seriesModel.coordinateSystem as Cartesian2D;\r\n const baseAxis = cartesian.getBaseAxis();\r\n\r\n const stackId = getSeriesStackId(seriesModel);\r\n const columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\r\n const columnOffset = columnLayoutInfo.offset;\r\n const columnWidth = columnLayoutInfo.width;\r\n\r\n data.setLayout({\r\n bandWidth: columnLayoutInfo.bandWidth,\r\n offset: columnOffset,\r\n size: columnWidth\r\n });\r\n });\r\n}\r\n\r\n// TODO: Do not support stack in large mode yet.\r\nexport function createProgressiveLayout(seriesType: string): StageHandler {\r\n return {\r\n seriesType,\r\n\r\n plan: createRenderPlanner(),\r\n\r\n reset: function (seriesModel: BarSeriesModel) {\r\n if (!isOnCartesian(seriesModel)) {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n\r\n const cartesian = seriesModel.coordinateSystem as Cartesian2D;\r\n const baseAxis = cartesian.getBaseAxis();\r\n const valueAxis = cartesian.getOtherAxis(baseAxis);\r\n const valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim));\r\n const baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\r\n const drawBackground = seriesModel.get('showBackground', true);\r\n const valueDim = data.mapDimension(valueAxis.dim);\r\n const stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n const stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries');\r\n const isValueAxisH = valueAxis.isHorizontal();\r\n const valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\r\n const isLarge = isInLargeMode(seriesModel);\r\n const barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n\r\n const stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim);\r\n\r\n // Layout info.\r\n const columnWidth = data.getLayout('size');\r\n const columnOffset = data.getLayout('offset');\r\n\r\n return {\r\n progress: function (params, data) {\r\n const count = params.count;\r\n const largePoints = isLarge && createFloat32Array(count * 3);\r\n const largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3);\r\n const largeDataIndices = isLarge && createFloat32Array(count);\r\n const coordLayout = cartesian.master.getRect();\r\n const bgSize = isValueAxisH ? coordLayout.width : coordLayout.height;\r\n\r\n let dataIndex;\r\n const store = data.getStore();\r\n\r\n let idxOffset = 0;\r\n\r\n while ((dataIndex = params.next()) != null) {\r\n const value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex);\r\n const baseValue = store.get(baseDimIdx, dataIndex) as number;\r\n let baseCoord = valueAxisStart;\r\n let stackStartValue;\r\n\r\n // Because of the barMinHeight, we can not use the value in\r\n // stackResultDimension directly.\r\n if (stacked) {\r\n stackStartValue = +value - (store.get(valueDimIdx, dataIndex) as number);\r\n }\r\n\r\n let x;\r\n let y;\r\n let width;\r\n let height;\r\n\r\n if (isValueAxisH) {\r\n const coord = cartesian.dataToPoint([value, baseValue]);\r\n if (stacked) {\r\n const startCoord = cartesian.dataToPoint([stackStartValue, baseValue]);\r\n baseCoord = startCoord[0];\r\n }\r\n x = baseCoord;\r\n y = coord[1] + columnOffset;\r\n width = coord[0] - baseCoord;\r\n height = columnWidth;\r\n\r\n if (Math.abs(width) < barMinHeight) {\r\n width = (width < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n }\r\n else {\r\n const coord = cartesian.dataToPoint([baseValue, value]);\r\n if (stacked) {\r\n const startCoord = cartesian.dataToPoint([baseValue, stackStartValue]);\r\n baseCoord = startCoord[1];\r\n }\r\n x = coord[0] + columnOffset;\r\n y = baseCoord;\r\n width = columnWidth;\r\n height = coord[1] - baseCoord;\r\n\r\n if (Math.abs(height) < barMinHeight) {\r\n // Include zero to has a positive bar\r\n height = (height <= 0 ? -1 : 1) * barMinHeight;\r\n }\r\n }\r\n\r\n if (!isLarge) {\r\n data.setItemLayout(dataIndex, { x, y, width, height });\r\n }\r\n else {\r\n largePoints[idxOffset] = x;\r\n largePoints[idxOffset + 1] = y;\r\n largePoints[idxOffset + 2] = isValueAxisH ? width : height;\r\n\r\n if (largeBackgroundPoints) {\r\n largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x;\r\n largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y;\r\n largeBackgroundPoints[idxOffset + 2] = bgSize;\r\n }\r\n\r\n largeDataIndices[dataIndex] = dataIndex;\r\n }\r\n\r\n idxOffset += 3;\r\n }\r\n\r\n if (isLarge) {\r\n data.setLayout({\r\n largePoints,\r\n largeDataIndices,\r\n largeBackgroundPoints,\r\n valueAxisHorizontal: isValueAxisH\r\n });\r\n }\r\n }\r\n };\r\n }\r\n };\r\n}\r\n\r\nfunction isOnCartesian(seriesModel: BarSeriesModel) {\r\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\r\n}\r\n\r\nfunction isInLargeMode(seriesModel: BarSeriesModel) {\r\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\r\n}\r\n\r\n// See cases in `test/bar-start.html` and `#7412`, `#8747`.\r\nfunction getValueAxisStart(baseAxis: Axis2D, valueAxis: Axis2D) {\r\n let startValue = valueAxis.model.get('startValue');\r\n if (!startValue) {\r\n startValue = 0;\r\n }\r\n return valueAxis.toGlobalCoord(\r\n valueAxis.dataToCoord(\r\n valueAxis.type === 'log'\r\n ? (startValue > 0 ? startValue : 1)\r\n : startValue));\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\r\n* modifications made for this project.\r\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\r\n\r\n\r\n// [About UTC and local time zone]:\r\n// In most cases, `number.parseDate` will treat input data string as local time\r\n// (except time zone is specified in time string). And `format.formateTime` returns\r\n// local time by default. option.useUTC is false by default. This design has\r\n// considered these common cases:\r\n// (1) Time that is persistent in server is in UTC, but it is needed to be displayed\r\n// in local time by default.\r\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\r\n// as its original time, without any time difference.\r\n\r\nimport * as numberUtil from '../util/number';\r\nimport {\r\n ONE_SECOND,\r\n ONE_MINUTE,\r\n ONE_HOUR,\r\n ONE_DAY,\r\n ONE_YEAR,\r\n format,\r\n leveledFormat,\r\n PrimaryTimeUnit,\r\n TimeUnit,\r\n getUnitValue,\r\n timeUnits,\r\n fullLeveledFormatter,\r\n getPrimaryTimeUnit,\r\n isPrimaryTimeUnit,\r\n getDefaultFormatPrecisionOfInterval,\r\n fullYearGetterName,\r\n monthSetterName,\r\n fullYearSetterName,\r\n dateSetterName,\r\n hoursGetterName,\r\n hoursSetterName,\r\n minutesSetterName,\r\n secondsSetterName,\r\n millisecondsSetterName,\r\n monthGetterName,\r\n dateGetterName,\r\n minutesGetterName,\r\n secondsGetterName,\r\n millisecondsGetterName\r\n} from '../util/time';\r\nimport * as scaleHelper from './helper';\r\nimport IntervalScale from './Interval';\r\nimport Scale from './Scale';\r\nimport {TimeScaleTick, ScaleTick} from '../util/types';\r\nimport {TimeAxisLabelFormatterOption} from '../coord/axisCommonTypes';\r\nimport { warn } from '../util/log';\r\nimport { LocaleOption } from '../core/locale';\r\nimport Model from '../model/Model';\r\nimport { filter, isNumber, map } from 'zrender/src/core/util';\r\n\r\n// FIXME \u516C\u7528\uFF1F\r\nconst bisect = function (\r\n a: [string | number, number][],\r\n x: number,\r\n lo: number,\r\n hi: number\r\n): number {\r\n while (lo < hi) {\r\n const mid = lo + hi >>> 1;\r\n if (a[mid][1] < x) {\r\n lo = mid + 1;\r\n }\r\n else {\r\n hi = mid;\r\n }\r\n }\r\n return lo;\r\n};\r\n\r\ntype TimeScaleSetting = {\r\n locale: Model;\r\n useUTC: boolean;\r\n};\r\n\r\nclass TimeScale extends IntervalScale {\r\n\r\n static type = 'time';\r\n readonly type = 'time';\r\n\r\n _approxInterval: number;\r\n\r\n _minLevelUnit: TimeUnit;\r\n\r\n constructor(settings?: TimeScaleSetting) {\r\n super(settings);\r\n }\r\n\r\n /**\r\n * Get label is mainly for other components like dataZoom, tooltip.\r\n */\r\n getLabel(tick: TimeScaleTick): string {\r\n const useUTC = this.getSetting('useUTC');\r\n return format(\r\n tick.value,\r\n fullLeveledFormatter[\r\n getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))\r\n ] || fullLeveledFormatter.second,\r\n useUTC,\r\n this.getSetting('locale')\r\n );\r\n }\r\n\r\n getFormattedLabel(\r\n tick: TimeScaleTick,\r\n idx: number,\r\n labelFormatter: TimeAxisLabelFormatterOption\r\n ): string {\r\n const isUTC = this.getSetting('useUTC');\r\n const lang = this.getSetting('locale');\r\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getTicks(): TimeScaleTick[] {\r\n const interval = this._interval;\r\n const extent = this._extent;\r\n\r\n let ticks = [] as TimeScaleTick[];\r\n // If interval is 0, return [];\r\n if (!interval) {\r\n return ticks;\r\n }\r\n\r\n ticks.push({\r\n value: extent[0],\r\n level: 0\r\n });\r\n\r\n const useUTC = this.getSetting('useUTC');\r\n\r\n const innerTicks = getIntervalTicks(\r\n this._minLevelUnit,\r\n this._approxInterval,\r\n useUTC,\r\n extent\r\n );\r\n\r\n ticks = ticks.concat(innerTicks);\r\n\r\n ticks.push({\r\n value: extent[1],\r\n level: 0\r\n });\r\n\r\n return ticks;\r\n }\r\n\r\n calcNiceExtent(\r\n opt?: {\r\n splitNumber?: number,\r\n fixMin?: boolean,\r\n fixMax?: boolean,\r\n minInterval?: number,\r\n maxInterval?: number\r\n }\r\n ): void {\r\n const extent = this._extent;\r\n // If extent start and end are same, expand them\r\n if (extent[0] === extent[1]) {\r\n // Expand extent\r\n extent[0] -= ONE_DAY;\r\n extent[1] += ONE_DAY;\r\n }\r\n // If there are no data and extent are [Infinity, -Infinity]\r\n if (extent[1] === -Infinity && extent[0] === Infinity) {\r\n const d = new Date();\r\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\r\n extent[0] = extent[1] - ONE_DAY;\r\n }\r\n\r\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\r\n }\r\n\r\n calcNiceTicks(approxTickNum: number, minInterval: number, maxInterval: number): void {\r\n approxTickNum = approxTickNum || 10;\r\n\r\n const extent = this._extent;\r\n const span = extent[1] - extent[0];\r\n this._approxInterval = span / approxTickNum;\r\n\r\n if (minInterval != null && this._approxInterval < minInterval) {\r\n this._approxInterval = minInterval;\r\n }\r\n if (maxInterval != null && this._approxInterval > maxInterval) {\r\n this._approxInterval = maxInterval;\r\n }\r\n\r\n const scaleIntervalsLen = scaleIntervals.length;\r\n const idx = Math.min(\r\n bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen),\r\n scaleIntervalsLen - 1\r\n );\r\n\r\n // Interval that can be used to calculate ticks\r\n this._interval = scaleIntervals[idx][1];\r\n // Min level used when picking ticks from top down.\r\n // We check one more level to avoid the ticks are to sparse in some case.\r\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\r\n }\r\n\r\n parse(val: number | string | Date): number {\r\n // val might be float.\r\n return isNumber(val) ? val : +numberUtil.parseDate(val);\r\n }\r\n\r\n contain(val: number): boolean {\r\n return scaleHelper.contain(this.parse(val), this._extent);\r\n }\r\n\r\n normalize(val: number): number {\r\n return scaleHelper.normalize(this.parse(val), this._extent);\r\n }\r\n\r\n scale(val: number): number {\r\n return scaleHelper.scale(val, this._extent);\r\n }\r\n\r\n}\r\n\r\n\r\n/**\r\n * This implementation was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\r\nconst scaleIntervals: [TimeUnit, number][] = [\r\n // Format interval\r\n ['second', ONE_SECOND], // 1s\r\n ['minute', ONE_MINUTE], // 1m\r\n ['hour', ONE_HOUR], // 1h\r\n ['quarter-day', ONE_HOUR * 6], // 6h\r\n ['half-day', ONE_HOUR * 12], // 12h\r\n ['day', ONE_DAY * 1.2], // 1d\r\n ['half-week', ONE_DAY * 3.5], // 3.5d\r\n ['week', ONE_DAY * 7], // 7d\r\n ['month', ONE_DAY * 31], // 1M\r\n ['quarter', ONE_DAY * 95], // 3M\r\n ['half-year', ONE_YEAR / 2], // 6M\r\n ['year', ONE_YEAR] // 1Y\r\n];\r\n\r\nfunction isUnitValueSame(\r\n unit: PrimaryTimeUnit,\r\n valueA: number,\r\n valueB: number,\r\n isUTC: boolean\r\n): boolean {\r\n const dateA = numberUtil.parseDate(valueA) as any;\r\n const dateB = numberUtil.parseDate(valueB) as any;\r\n\r\n const isSame = (unit: PrimaryTimeUnit) => {\r\n return getUnitValue(dateA, unit, isUTC)\r\n === getUnitValue(dateB, unit, isUTC);\r\n };\r\n const isSameYear = () => isSame('year');\r\n // const isSameHalfYear = () => isSameYear() && isSame('half-year');\r\n // const isSameQuater = () => isSameYear() && isSame('quarter');\r\n const isSameMonth = () => isSameYear() && isSame('month');\r\n const isSameDay = () => isSameMonth() && isSame('day');\r\n // const isSameHalfDay = () => isSameDay() && isSame('half-day');\r\n const isSameHour = () => isSameDay() && isSame('hour');\r\n const isSameMinute = () => isSameHour() && isSame('minute');\r\n const isSameSecond = () => isSameMinute() && isSame('second');\r\n const isSameMilliSecond = () => isSameSecond() && isSame('millisecond');\r\n\r\n switch (unit) {\r\n case 'year':\r\n return isSameYear();\r\n case 'month':\r\n return isSameMonth();\r\n case 'day':\r\n return isSameDay();\r\n case 'hour':\r\n return isSameHour();\r\n case 'minute':\r\n return isSameMinute();\r\n case 'second':\r\n return isSameSecond();\r\n case 'millisecond':\r\n return isSameMilliSecond();\r\n }\r\n}\r\n\r\n// const primaryUnitGetters = {\r\n// year: fullYearGetterName(),\r\n// month: monthGetterName(),\r\n// day: dateGetterName(),\r\n// hour: hoursGetterName(),\r\n// minute: minutesGetterName(),\r\n// second: secondsGetterName(),\r\n// millisecond: millisecondsGetterName()\r\n// };\r\n\r\n// const primaryUnitUTCGetters = {\r\n// year: fullYearGetterName(true),\r\n// month: monthGetterName(true),\r\n// day: dateGetterName(true),\r\n// hour: hoursGetterName(true),\r\n// minute: minutesGetterName(true),\r\n// second: secondsGetterName(true),\r\n// millisecond: millisecondsGetterName(true)\r\n// };\r\n\r\n// function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {\r\n// step = step || 1;\r\n// switch (getPrimaryTimeUnit(unitName)) {\r\n// case 'year':\r\n// date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);\r\n// break;\r\n// case 'month':\r\n// date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);\r\n// break;\r\n// case 'day':\r\n// date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);\r\n// break;\r\n// case 'hour':\r\n// date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);\r\n// break;\r\n// case 'minute':\r\n// date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);\r\n// break;\r\n// case 'second':\r\n// date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);\r\n// break;\r\n// case 'millisecond':\r\n// date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);\r\n// break;\r\n// }\r\n// return date.getTime();\r\n// }\r\n\r\n// const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];\r\n// const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];\r\n// const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];\r\n\r\nfunction getDateInterval(approxInterval: number, daysInMonth: number) {\r\n approxInterval /= ONE_DAY;\r\n return approxInterval > 16 ? 16\r\n // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick between two months.\r\n : approxInterval > 7.5 ? 7 // TODO week 7 or day 8?\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 1.5 ? 2 : 1;\r\n}\r\n\r\nfunction getMonthInterval(approxInterval: number) {\r\n const APPROX_ONE_MONTH = 30 * ONE_DAY;\r\n approxInterval /= APPROX_ONE_MONTH;\r\n return approxInterval > 6 ? 6\r\n : approxInterval > 3 ? 3\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\n\r\nfunction getHourInterval(approxInterval: number) {\r\n approxInterval /= ONE_HOUR;\r\n return approxInterval > 12 ? 12\r\n : approxInterval > 6 ? 6\r\n : approxInterval > 3.5 ? 4\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\n\r\nfunction getMinutesAndSecondsInterval(approxInterval: number, isMinutes?: boolean) {\r\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\r\n return approxInterval > 30 ? 30\r\n : approxInterval > 20 ? 20\r\n : approxInterval > 15 ? 15\r\n : approxInterval > 10 ? 10\r\n : approxInterval > 5 ? 5\r\n : approxInterval > 2 ? 2 : 1;\r\n}\r\n\r\nfunction getMillisecondsInterval(approxInterval: number) {\r\n return numberUtil.nice(approxInterval, true);\r\n}\r\n\r\nfunction getFirstTimestampOfUnit(date: Date, unitName: TimeUnit, isUTC: boolean) {\r\n const outDate = new Date(date);\r\n switch (getPrimaryTimeUnit(unitName)) {\r\n case 'year':\r\n case 'month':\r\n outDate[monthSetterName(isUTC)](0);\r\n case 'day':\r\n outDate[dateSetterName(isUTC)](1);\r\n case 'hour':\r\n outDate[hoursSetterName(isUTC)](0);\r\n case 'minute':\r\n outDate[minutesSetterName(isUTC)](0);\r\n case 'second':\r\n outDate[secondsSetterName(isUTC)](0);\r\n outDate[millisecondsSetterName(isUTC)](0);\r\n }\r\n return outDate.getTime();\r\n}\r\n\r\nfunction getIntervalTicks(\r\n bottomUnitName: TimeUnit,\r\n approxInterval: number,\r\n isUTC: boolean,\r\n extent: number[]\r\n): TimeScaleTick[] {\r\n const safeLimit = 10000;\r\n const unitNames = timeUnits;\r\n // const bottomPrimaryUnitName = getPrimaryTimeUnit(bottomUnitName);\r\n\r\n interface InnerTimeTick extends TimeScaleTick {\r\n notAdd?: boolean\r\n }\r\n\r\n let iter = 0;\r\n\r\n function addTicksInSpan(\r\n interval: number,\r\n minTimestamp: number, maxTimestamp: number,\r\n getMethodName: string,\r\n setMethodName: string,\r\n isDate: boolean,\r\n out: InnerTimeTick[]\r\n ) {\r\n const date = new Date(minTimestamp) as any;\r\n let dateTime = minTimestamp;\r\n let d = date[getMethodName]();\r\n\r\n // if (isDate) {\r\n // d -= 1; // Starts with 0; PENDING\r\n // }\r\n\r\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\r\n out.push({\r\n value: dateTime\r\n });\r\n\r\n d += interval;\r\n date[setMethodName](d);\r\n dateTime = date.getTime();\r\n }\r\n\r\n // This extra tick is for calcuating ticks of next level. Will not been added to the final result\r\n out.push({\r\n value: dateTime,\r\n notAdd: true\r\n });\r\n }\r\n\r\n function addLevelTicks(\r\n unitName: TimeUnit,\r\n lastLevelTicks: InnerTimeTick[],\r\n levelTicks: InnerTimeTick[]\r\n ) {\r\n const newAddedTicks: ScaleTick[] = [];\r\n const isFirstLevel = !lastLevelTicks.length;\r\n\r\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\r\n return;\r\n }\r\n\r\n if (isFirstLevel) {\r\n lastLevelTicks = [{\r\n // TODO Optimize. Not include so may ticks.\r\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\r\n }, {\r\n value: extent[1]\r\n }];\r\n }\r\n\r\n for (let i = 0; i < lastLevelTicks.length - 1; i++) {\r\n const startTick = lastLevelTicks[i].value;\r\n const endTick = lastLevelTicks[i + 1].value;\r\n if (startTick === endTick) {\r\n continue;\r\n }\r\n\r\n let interval: number;\r\n let getterName;\r\n let setterName;\r\n let isDate = false;\r\n\r\n switch (unitName) {\r\n case 'year':\r\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\r\n getterName = fullYearGetterName(isUTC);\r\n setterName = fullYearSetterName(isUTC);\r\n break;\r\n case 'half-year':\r\n case 'quarter':\r\n case 'month':\r\n interval = getMonthInterval(approxInterval);\r\n getterName = monthGetterName(isUTC);\r\n setterName = monthSetterName(isUTC);\r\n break;\r\n case 'week': // PENDING If week is added. Ignore day.\r\n case 'half-week':\r\n case 'day':\r\n interval = getDateInterval(approxInterval, 31); // Use 32 days and let interval been 16\r\n getterName = dateGetterName(isUTC);\r\n setterName = dateSetterName(isUTC);\r\n isDate = true;\r\n break;\r\n case 'half-day':\r\n case 'quarter-day':\r\n case 'hour':\r\n interval = getHourInterval(approxInterval);\r\n getterName = hoursGetterName(isUTC);\r\n setterName = hoursSetterName(isUTC);\r\n break;\r\n case 'minute':\r\n interval = getMinutesAndSecondsInterval(approxInterval, true);\r\n getterName = minutesGetterName(isUTC);\r\n setterName = minutesSetterName(isUTC);\r\n break;\r\n case 'second':\r\n interval = getMinutesAndSecondsInterval(approxInterval, false);\r\n getterName = secondsGetterName(isUTC);\r\n setterName = secondsSetterName(isUTC);\r\n break;\r\n case 'millisecond':\r\n interval = getMillisecondsInterval(approxInterval);\r\n getterName = millisecondsGetterName(isUTC);\r\n setterName = millisecondsSetterName(isUTC);\r\n break;\r\n }\r\n\r\n addTicksInSpan(\r\n interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks\r\n );\r\n\r\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\r\n // Add nearest years to the left extent.\r\n levelTicks.unshift({\r\n value: levelTicks[0].value - interval\r\n });\r\n }\r\n }\r\n\r\n for (let i = 0; i < newAddedTicks.length; i++) {\r\n levelTicks.push(newAddedTicks[i]);\r\n }\r\n // newAddedTicks.length && console.log(unitName, newAddedTicks);\r\n return newAddedTicks;\r\n }\r\n\r\n const levelsTicks: InnerTimeTick[][] = [];\r\n let currentLevelTicks: InnerTimeTick[] = [];\r\n\r\n let tickCount = 0;\r\n let lastLevelTickCount = 0;\r\n for (let i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\r\n const primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\r\n if (!isPrimaryTimeUnit(unitNames[i])) { // TODO\r\n continue;\r\n }\r\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\r\n\r\n const nextPrimaryTimeUnit: PrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\r\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\r\n if (currentLevelTicks.length) {\r\n lastLevelTickCount = tickCount;\r\n // Remove the duplicate so the tick count can be precisely.\r\n currentLevelTicks.sort((a, b) => a.value - b.value);\r\n const levelTicksRemoveDuplicated = [];\r\n for (let i = 0; i < currentLevelTicks.length; ++i) {\r\n const tickValue = currentLevelTicks[i].value;\r\n if (i === 0 || currentLevelTicks[i - 1].value !== tickValue) {\r\n levelTicksRemoveDuplicated.push(currentLevelTicks[i]);\r\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\r\n tickCount++;\r\n }\r\n }\r\n }\r\n\r\n const targetTickNum = (extent[1] - extent[0]) / approxInterval;\r\n // Added too much in this level and not too less in last level\r\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\r\n break;\r\n }\r\n\r\n // Only treat primary time unit as one level.\r\n levelsTicks.push(levelTicksRemoveDuplicated);\r\n\r\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\r\n break;\r\n }\r\n\r\n }\r\n // Reset if next unitName is primary\r\n currentLevelTicks = [];\r\n }\r\n\r\n }\r\n\r\n if (__DEV__) {\r\n if (iter >= safeLimit) {\r\n warn('Exceed safe limit.');\r\n }\r\n }\r\n\r\n const levelsTicksInExtent = filter(map(levelsTicks, levelTicks => {\r\n return filter(levelTicks, tick => tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd);\r\n }), levelTicks => levelTicks.length > 0);\r\n\r\n const ticks: TimeScaleTick[] = [];\r\n const maxLevel = levelsTicksInExtent.length - 1;\r\n for (let i = 0; i < levelsTicksInExtent.length; ++i) {\r\n const levelTicks = levelsTicksInExtent[i];\r\n for (let k = 0; k < levelTicks.length; ++k) {\r\n ticks.push({\r\n value: levelTicks[k].value,\r\n level: maxLevel - i\r\n });\r\n }\r\n }\r\n\r\n ticks.sort((a, b) => a.value - b.value);\r\n // Remove duplicates\r\n const result: TimeScaleTick[] = [];\r\n for (let i = 0; i < ticks.length; ++i) {\r\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\r\n result.push(ticks[i]);\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n\r\nScale.registerClass(TimeScale);\r\n\r\nexport default TimeScale;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Scale from './Scale';\r\nimport * as numberUtil from '../util/number';\r\nimport * as scaleHelper from './helper';\r\n\r\n// Use some method of IntervalScale\r\nimport IntervalScale from './Interval';\r\nimport SeriesData from '../data/SeriesData';\r\nimport { DimensionName, ScaleTick } from '../util/types';\r\n\r\nconst scaleProto = Scale.prototype;\r\n// FIXME:TS refactor: not good to call it directly with `this`?\r\nconst intervalScaleProto = IntervalScale.prototype;\r\n\r\nconst roundingErrorFix = numberUtil.round;\r\n\r\nconst mathFloor = Math.floor;\r\nconst mathCeil = Math.ceil;\r\nconst mathPow = Math.pow;\r\n\r\nconst mathLog = Math.log;\r\n\r\nclass LogScale extends Scale {\r\n static type = 'log';\r\n readonly type = 'log';\r\n\r\n base = 10;\r\n\r\n private _originalScale: IntervalScale = new IntervalScale();\r\n\r\n private _fixMin: boolean;\r\n private _fixMax: boolean;\r\n\r\n // FIXME:TS actually used by `IntervalScale`\r\n private _interval: number = 0;\r\n // FIXME:TS actually used by `IntervalScale`\r\n private _niceExtent: [number, number];\r\n\r\n\r\n /**\r\n * @param Whether expand the ticks to niced extent.\r\n */\r\n getTicks(expandToNicedExtent?: boolean): ScaleTick[] {\r\n const originalScale = this._originalScale;\r\n const extent = this._extent;\r\n const originalExtent = originalScale.getExtent();\r\n\r\n const ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\r\n\r\n return zrUtil.map(ticks, function (tick) {\r\n const val = tick.value;\r\n let powVal = numberUtil.round(mathPow(this.base, val));\r\n\r\n // Fix #4158\r\n powVal = (val === extent[0] && this._fixMin)\r\n ? fixRoundingError(powVal, originalExtent[0])\r\n : powVal;\r\n powVal = (val === extent[1] && this._fixMax)\r\n ? fixRoundingError(powVal, originalExtent[1])\r\n : powVal;\r\n\r\n return {\r\n value: powVal\r\n };\r\n }, this);\r\n }\r\n\r\n setExtent(start: number, end: number): void {\r\n const base = mathLog(this.base);\r\n // log(-Infinity) is NaN, so safe guard here\r\n start = mathLog(Math.max(0, start)) / base;\r\n end = mathLog(Math.max(0, end)) / base;\r\n intervalScaleProto.setExtent.call(this, start, end);\r\n }\r\n\r\n /**\r\n * @return {number} end\r\n */\r\n getExtent() {\r\n const base = this.base;\r\n const extent = scaleProto.getExtent.call(this);\r\n extent[0] = mathPow(base, extent[0]);\r\n extent[1] = mathPow(base, extent[1]);\r\n\r\n // Fix #4158\r\n const originalScale = this._originalScale;\r\n const originalExtent = originalScale.getExtent();\r\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\r\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\r\n\r\n return extent;\r\n }\r\n\r\n unionExtent(extent: [number, number]): void {\r\n this._originalScale.unionExtent(extent);\r\n\r\n const base = this.base;\r\n extent[0] = mathLog(extent[0]) / mathLog(base);\r\n extent[1] = mathLog(extent[1]) / mathLog(base);\r\n scaleProto.unionExtent.call(this, extent);\r\n }\r\n\r\n unionExtentFromData(data: SeriesData, dim: DimensionName): void {\r\n // TODO\r\n // filter value that <= 0\r\n this.unionExtent(data.getApproximateExtent(dim));\r\n }\r\n\r\n /**\r\n * Update interval and extent of intervals for nice ticks\r\n * @param approxTickNum default 10 Given approx tick number\r\n */\r\n calcNiceTicks(approxTickNum: number): void {\r\n approxTickNum = approxTickNum || 10;\r\n const extent = this._extent;\r\n const span = extent[1] - extent[0];\r\n if (span === Infinity || span <= 0) {\r\n return;\r\n }\r\n\r\n let interval = numberUtil.quantity(span);\r\n const err = approxTickNum / span * interval;\r\n\r\n // Filter ticks to get closer to the desired count.\r\n if (err <= 0.5) {\r\n interval *= 10;\r\n }\r\n\r\n // Interval should be integer\r\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\r\n interval *= 10;\r\n }\r\n\r\n const niceExtent = [\r\n numberUtil.round(mathCeil(extent[0] / interval) * interval),\r\n numberUtil.round(mathFloor(extent[1] / interval) * interval)\r\n ] as [number, number];\r\n\r\n this._interval = interval;\r\n this._niceExtent = niceExtent;\r\n }\r\n\r\n calcNiceExtent(opt: {\r\n splitNumber: number, // By default 5.\r\n fixMin?: boolean,\r\n fixMax?: boolean,\r\n minInterval?: number,\r\n maxInterval?: number\r\n }): void {\r\n intervalScaleProto.calcNiceExtent.call(this, opt);\r\n\r\n this._fixMin = opt.fixMin;\r\n this._fixMax = opt.fixMax;\r\n }\r\n\r\n parse(val: any): number {\r\n return val;\r\n }\r\n\r\n contain(val: number): boolean {\r\n val = mathLog(val) / mathLog(this.base);\r\n return scaleHelper.contain(val, this._extent);\r\n }\r\n\r\n normalize(val: number): number {\r\n val = mathLog(val) / mathLog(this.base);\r\n return scaleHelper.normalize(val, this._extent);\r\n }\r\n\r\n scale(val: number): number {\r\n val = scaleHelper.scale(val, this._extent);\r\n return mathPow(this.base, val);\r\n }\r\n\r\n getMinorTicks: IntervalScale['getMinorTicks'];\r\n getLabel: IntervalScale['getLabel'];\r\n}\r\n\r\nconst proto = LogScale.prototype;\r\nproto.getMinorTicks = intervalScaleProto.getMinorTicks;\r\nproto.getLabel = intervalScaleProto.getLabel;\r\n\r\nfunction fixRoundingError(val: number, originalVal: number): number {\r\n return roundingErrorFix(val, numberUtil.getPrecision(originalVal));\r\n}\r\n\r\n\r\nScale.registerClass(LogScale);\r\n\r\nexport default LogScale;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { assert, isArray, eqNaN, isFunction } from 'zrender/src/core/util';\r\nimport Scale from '../scale/Scale';\r\nimport { AxisBaseModel } from './AxisBaseModel';\r\nimport { parsePercent } from 'zrender/src/contain/text';\r\nimport { AxisBaseOption, CategoryAxisBaseOption } from './axisCommonTypes';\r\nimport { ScaleDataValue } from '../util/types';\r\n\r\n\r\nexport interface ScaleRawExtentResult {\r\n // `min`/`max` defines data available range, determined by\r\n // `dataMin`/`dataMax` and explicit specified min max related option.\r\n // The final extent will be based on the `min`/`max` and may be enlarge\r\n // a little (say, \"nice strategy\", e.g., niceScale, boundaryGap).\r\n // Ensure `min`/`max` be finite number or NaN here.\r\n // (not to be null/undefined) `NaN` means min/max axis is blank.\r\n readonly min: number;\r\n readonly max: number;\r\n // `minFixed`/`maxFixed` marks that `min`/`max` should be used\r\n // in the final extent without other \"nice strategy\".\r\n readonly minFixed: boolean;\r\n readonly maxFixed: boolean;\r\n // Mark that the axis should be blank.\r\n readonly isBlank: boolean;\r\n}\r\n\r\nexport class ScaleRawExtentInfo {\r\n\r\n private _needCrossZero: boolean;\r\n private _isOrdinal: boolean;\r\n private _axisDataLen: number;\r\n private _boundaryGapInner: number[];\r\n\r\n // Accurate raw value get from model.\r\n private _modelMinRaw: AxisBaseOption['min'];\r\n private _modelMaxRaw: AxisBaseOption['max'];\r\n\r\n // Can be `finite number`/`null`/`undefined`/`NaN`\r\n private _modelMinNum: number;\r\n private _modelMaxNum: number;\r\n\r\n // Range union by series data on this axis.\r\n // May be modified if data is filtered.\r\n private _dataMin: number;\r\n private _dataMax: number;\r\n\r\n // Highest priority if specified.\r\n private _determinedMin: number;\r\n private _determinedMax: number;\r\n\r\n // Make that the `rawExtentInfo` can not be modified any more.\r\n readonly frozen: boolean;\r\n\r\n\r\n constructor(\r\n scale: Scale,\r\n model: AxisBaseModel,\r\n // Usually: data extent from all series on this axis.\r\n originalExtent: number[]\r\n ) {\r\n this._prepareParams(scale, model, originalExtent);\r\n }\r\n\r\n /**\r\n * Parameters depending on outside (like model, user callback)\r\n * are prepared and fixed here.\r\n */\r\n private _prepareParams(\r\n scale: Scale,\r\n model: AxisBaseModel,\r\n // Usually: data extent from all series on this axis.\r\n dataExtent: number[]\r\n ) {\r\n if (dataExtent[1] < dataExtent[0]) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n this._dataMin = dataExtent[0];\r\n this._dataMax = dataExtent[1];\r\n\r\n const isOrdinal = this._isOrdinal = scale.type === 'ordinal';\r\n this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero();\r\n\r\n let axisMinValue = model.get('min', true);\r\n if (axisMinValue == null) {\r\n axisMinValue = model.get('startValue', true);\r\n }\r\n const modelMinRaw = this._modelMinRaw = axisMinValue;\r\n if (isFunction(modelMinRaw)) {\r\n // This callback always provides users the full data extent (before data is filtered).\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMinRaw !== 'dataMin') {\r\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\r\n }\r\n\r\n const modelMaxRaw = this._modelMaxRaw = model.get('max', true);\r\n if (isFunction(modelMaxRaw)) {\r\n // This callback always provides users the full data extent (before data is filtered).\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\r\n min: dataExtent[0],\r\n max: dataExtent[1]\r\n }));\r\n }\r\n else if (modelMaxRaw !== 'dataMax') {\r\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\r\n }\r\n\r\n if (isOrdinal) {\r\n // FIXME: there is a flaw here: if there is no \"block\" data processor like `dataZoom`,\r\n // and progressive rendering is using, here the category result might just only contain\r\n // the processed chunk rather than the entire result.\r\n this._axisDataLen = model.getCategories().length;\r\n }\r\n else {\r\n const boundaryGap = (model as AxisBaseModel).get('boundaryGap');\r\n const boundaryGapArr = isArray(boundaryGap)\r\n ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\r\n\r\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\r\n if (__DEV__) {\r\n console.warn('Boolean type for boundaryGap is only '\r\n + 'allowed for ordinal axis. Please use string in '\r\n + 'percentage instead, e.g., \"20%\". Currently, '\r\n + 'boundaryGap is set to be 0.');\r\n }\r\n this._boundaryGapInner = [0, 0];\r\n }\r\n else {\r\n this._boundaryGapInner = [\r\n parsePercent(boundaryGapArr[0], 1),\r\n parsePercent(boundaryGapArr[1], 1)\r\n ];\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Calculate extent by prepared parameters.\r\n * This method has no external dependency and can be called duplicatedly,\r\n * getting the same result.\r\n * If parameters changed, should call this method to recalcuate.\r\n */\r\n calculate(): ScaleRawExtentResult {\r\n // Notice: When min/max is not set (that is, when there are null/undefined,\r\n // which is the most common case), these cases should be ensured:\r\n // (1) For 'ordinal', show all axis.data.\r\n // (2) For others:\r\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\r\n // disabled).\r\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\r\n // be the result that originalExtent enlarged by boundaryGap.\r\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\r\n\r\n const isOrdinal = this._isOrdinal;\r\n const dataMin = this._dataMin;\r\n const dataMax = this._dataMax;\r\n const axisDataLen = this._axisDataLen;\r\n const boundaryGapInner = this._boundaryGapInner;\r\n\r\n const span = !isOrdinal\r\n ? ((dataMax - dataMin) || Math.abs(dataMin))\r\n : null;\r\n\r\n // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax',\r\n // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`.\r\n let min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\r\n let max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum;\r\n\r\n // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed.\r\n let minFixed = min != null;\r\n let maxFixed = max != null;\r\n\r\n if (min == null) {\r\n min = isOrdinal\r\n ? (axisDataLen ? 0 : NaN)\r\n : dataMin - boundaryGapInner[0] * span;\r\n }\r\n if (max == null) {\r\n max = isOrdinal\r\n ? (axisDataLen ? axisDataLen - 1 : NaN)\r\n : dataMax + boundaryGapInner[1] * span;\r\n }\r\n\r\n (min == null || !isFinite(min)) && (min = NaN);\r\n (max == null || !isFinite(max)) && (max = NaN);\r\n\r\n const isBlank = eqNaN(min)\r\n || eqNaN(max)\r\n || (isOrdinal && !axisDataLen);\r\n\r\n // If data extent modified, need to recalculated to ensure cross zero.\r\n if (this._needCrossZero) {\r\n // Axis is over zero and min is not set\r\n if (min > 0 && max > 0 && !minFixed) {\r\n min = 0;\r\n // minFixed = true;\r\n }\r\n // Axis is under zero and max is not set\r\n if (min < 0 && max < 0 && !maxFixed) {\r\n max = 0;\r\n // maxFixed = true;\r\n }\r\n // PENDING:\r\n // When `needCrossZero` and all data is positive/negative, should it be ensured\r\n // that the results processed by boundaryGap are positive/negative?\r\n // If so, here `minFixed`/`maxFixed` need to be set.\r\n }\r\n\r\n const determinedMin = this._determinedMin;\r\n const determinedMax = this._determinedMax;\r\n if (determinedMin != null) {\r\n min = determinedMin;\r\n minFixed = true;\r\n }\r\n if (determinedMax != null) {\r\n max = determinedMax;\r\n maxFixed = true;\r\n }\r\n\r\n // Ensure min/max be finite number or NaN here. (not to be null/undefined)\r\n // `NaN` means min/max axis is blank.\r\n return {\r\n min: min,\r\n max: max,\r\n minFixed: minFixed,\r\n maxFixed: maxFixed,\r\n isBlank: isBlank\r\n };\r\n }\r\n\r\n modifyDataMinMax(minMaxName: 'min' | 'max', val: number): void {\r\n if (__DEV__) {\r\n assert(!this.frozen);\r\n }\r\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\r\n }\r\n\r\n setDeterminedMinMax(minMaxName: 'min' | 'max', val: number): void {\r\n const attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\r\n if (__DEV__) {\r\n assert(\r\n !this.frozen\r\n // Earse them usually means logic flaw.\r\n && (this[attr] == null)\r\n );\r\n }\r\n this[attr] = val;\r\n }\r\n\r\n freeze() {\r\n // @ts-ignore\r\n this.frozen = true;\r\n }\r\n}\r\n\r\nconst DETERMINED_MIN_MAX_ATTR = { min: '_determinedMin', max: '_determinedMax' } as const;\r\nconst DATA_MIN_MAX_ATTR = { min: '_dataMin', max: '_dataMax' } as const;\r\n\r\n/**\r\n * Get scale min max and related info only depends on model settings.\r\n * This method can be called after coordinate system created.\r\n * For example, in data processing stage.\r\n *\r\n * Scale extent info probably be required multiple times during a workflow.\r\n * For example:\r\n * (1) `dataZoom` depends it to get the axis extent in \"100%\" state.\r\n * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.\r\n * (3) `coordSys.update` use it to finally decide the scale extent.\r\n * But the callback of `min`/`max` should not be called multiple times.\r\n * The code below should not be implemented repeatedly either.\r\n * So we cache the result in the scale instance, which will be recreated at the beginning\r\n * of the workflow (because `scale` instance will be recreated each round of the workflow).\r\n */\r\nexport function ensureScaleRawExtentInfo(\r\n scale: Scale,\r\n model: AxisBaseModel,\r\n // Usually: data extent from all series on this axis.\r\n originalExtent: number[]\r\n): ScaleRawExtentInfo {\r\n\r\n // Do not permit to recreate.\r\n let rawExtentInfo = scale.rawExtentInfo;\r\n if (rawExtentInfo) {\r\n return rawExtentInfo;\r\n }\r\n\r\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent);\r\n // @ts-ignore\r\n scale.rawExtentInfo = rawExtentInfo;\r\n\r\n return rawExtentInfo;\r\n}\r\n\r\nexport function parseAxisModelMinMax(scale: Scale, minMax: ScaleDataValue): number {\r\n return minMax == null ? null\r\n : eqNaN(minMax) ? NaN\r\n : scale.parse(minMax);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport OrdinalScale from '../scale/Ordinal';\r\nimport IntervalScale from '../scale/Interval';\r\nimport Scale from '../scale/Scale';\r\nimport {\r\n prepareLayoutBarSeries,\r\n makeColumnLayout,\r\n retrieveColumnLayout\r\n} from '../layout/barGrid';\r\nimport BoundingRect, { RectLike } from 'zrender/src/core/BoundingRect';\r\n\r\nimport TimeScale from '../scale/Time';\r\nimport Model from '../model/Model';\r\nimport { AxisBaseModel } from './AxisBaseModel';\r\nimport LogScale from '../scale/Log';\r\nimport Axis from './Axis';\r\nimport {\r\n AxisBaseOption,\r\n CategoryAxisBaseOption,\r\n LogAxisBaseOption,\r\n TimeAxisLabelFormatterOption,\r\n ValueAxisBaseOption\r\n} from './axisCommonTypes';\r\nimport type CartesianAxisModel from './cartesian/AxisModel';\r\nimport SeriesData from '../data/SeriesData';\r\nimport { getStackedDimension } from '../data/helper/dataStackHelper';\r\nimport { Dictionary, DimensionName, ScaleTick, TimeScaleTick } from '../util/types';\r\nimport { ensureScaleRawExtentInfo } from './scaleRawExtentInfo';\r\n\r\n\r\ntype BarWidthAndOffset = ReturnType;\r\n\r\n/**\r\n * Get axis scale extent before niced.\r\n * Item of returned array can only be number (including Infinity and NaN).\r\n *\r\n * Caution:\r\n * Precondition of calling this method:\r\n * The scale extent has been initialized using series data extent via\r\n * `scale.setExtent` or `scale.unionExtentFromData`;\r\n */\r\nexport function getScaleExtent(scale: Scale, model: AxisBaseModel) {\r\n const scaleType = scale.type;\r\n const rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\r\n\r\n scale.setBlank(rawExtentResult.isBlank);\r\n\r\n let min = rawExtentResult.min;\r\n let max = rawExtentResult.max;\r\n\r\n // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\r\n // is base axis\r\n // FIXME\r\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\r\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\r\n // Should not depend on series type `bar`?\r\n // (3) Fix that might overlap when using dataZoom.\r\n // (4) Consider other chart types using `barGrid`?\r\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\r\n const ecModel = model.ecModel;\r\n if (ecModel && (scaleType === 'time' /* || scaleType === 'interval' */)) {\r\n const barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\r\n let isBaseAxisAndHasBarSeries = false;\r\n\r\n zrUtil.each(barSeriesModels, function (seriesModel) {\r\n isBaseAxisAndHasBarSeries = isBaseAxisAndHasBarSeries || seriesModel.getBaseAxis() === model.axis;\r\n });\r\n\r\n if (isBaseAxisAndHasBarSeries) {\r\n // Calculate placement of bars on axis. TODO should be decoupled\r\n // with barLayout\r\n const barWidthAndOffset = makeColumnLayout(barSeriesModels);\r\n\r\n // Adjust axis min and max to account for overflow\r\n const adjustedScale = adjustScaleForOverflow(min, max, model as CartesianAxisModel, barWidthAndOffset);\r\n min = adjustedScale.min;\r\n max = adjustedScale.max;\r\n }\r\n }\r\n\r\n return {\r\n extent: [min, max],\r\n // \"fix\" means \"fixed\", the value should not be\r\n // changed in the subsequent steps.\r\n fixMin: rawExtentResult.minFixed,\r\n fixMax: rawExtentResult.maxFixed\r\n };\r\n}\r\n\r\nfunction adjustScaleForOverflow(\r\n min: number,\r\n max: number,\r\n model: CartesianAxisModel, // Only support cartesian coord yet.\r\n barWidthAndOffset: BarWidthAndOffset\r\n) {\r\n\r\n // Get Axis Length\r\n const axisExtent = model.axis.getExtent();\r\n const axisLength = Math.abs(axisExtent[1] - axisExtent[0]);\r\n\r\n // Get bars on current base axis and calculate min and max overflow\r\n const barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\r\n if (barsOnCurrentAxis === undefined) {\r\n return {min: min, max: max};\r\n }\r\n\r\n let minOverflow = Infinity;\r\n zrUtil.each(barsOnCurrentAxis, function (item) {\r\n minOverflow = Math.min(item.offset, minOverflow);\r\n });\r\n let maxOverflow = -Infinity;\r\n zrUtil.each(barsOnCurrentAxis, function (item) {\r\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\r\n });\r\n minOverflow = Math.abs(minOverflow);\r\n maxOverflow = Math.abs(maxOverflow);\r\n const totalOverFlow = minOverflow + maxOverflow;\r\n\r\n // Calculate required buffer based on old range and overflow\r\n const oldRange = max - min;\r\n const oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength);\r\n const overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange);\r\n\r\n max += overflowBuffer * (maxOverflow / totalOverFlow);\r\n min -= overflowBuffer * (minOverflow / totalOverFlow);\r\n\r\n return {min: min, max: max};\r\n}\r\n\r\n// Precondition of calling this method:\r\n// The scale extent has been initialized using series data extent via\r\n// `scale.setExtent` or `scale.unionExtentFromData`;\r\nexport function niceScaleExtent(\r\n scale: Scale,\r\n inModel: AxisBaseModel\r\n) {\r\n const model = inModel as AxisBaseModel;\r\n const extentInfo = getScaleExtent(scale, model);\r\n const extent = extentInfo.extent;\r\n const splitNumber = model.get('splitNumber');\r\n\r\n if (scale instanceof LogScale) {\r\n scale.base = model.get('logBase');\r\n }\r\n\r\n const scaleType = scale.type;\r\n const interval = model.get('interval');\r\n const isIntervalOrTime = scaleType === 'interval' || scaleType === 'time';\r\n\r\n scale.setExtent(extent[0], extent[1]);\r\n scale.calcNiceExtent({\r\n splitNumber: splitNumber,\r\n fixMin: extentInfo.fixMin,\r\n fixMax: extentInfo.fixMax,\r\n minInterval: isIntervalOrTime ? model.get('minInterval') : null,\r\n maxInterval: isIntervalOrTime ? model.get('maxInterval') : null\r\n });\r\n\r\n // If some one specified the min, max. And the default calculated interval\r\n // is not good enough. He can specify the interval. It is often appeared\r\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\r\n // to be 60.\r\n // FIXME\r\n if (interval != null) {\r\n (scale as IntervalScale).setInterval && (scale as IntervalScale).setInterval(interval);\r\n }\r\n}\r\n\r\n/**\r\n * @param axisType Default retrieve from model.type\r\n */\r\nexport function createScaleByModel(model: AxisBaseModel, axisType?: string): Scale {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n // Buildin scale\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getOrdinalMeta\r\n ? model.getOrdinalMeta()\r\n : model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n // case 'value'/'interval', 'log', or others.\r\n return new (Scale.getClass(axisType) || IntervalScale)();\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Check if the axis cross 0\r\n */\r\nexport function ifAxisCrossZero(axis: Axis) {\r\n const dataExtent = axis.scale.getExtent();\r\n const min = dataExtent[0];\r\n const max = dataExtent[1];\r\n return !((min > 0 && max > 0) || (min < 0 && max < 0));\r\n}\r\n\r\n/**\r\n * @param axis\r\n * @return Label formatter function.\r\n * param: {number} tickValue,\r\n * param: {number} idx, the index in all ticks.\r\n * If category axis, this param is not required.\r\n * return: {string} label string.\r\n */\r\nexport function makeLabelFormatter(axis: Axis): (tick: ScaleTick, idx?: number) => string {\r\n const labelFormatter = (axis.getLabelModel() as Model)\r\n .get('formatter');\r\n const categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\r\n\r\n if (axis.scale.type === 'time') {\r\n return (function (tpl) {\r\n return function (tick: ScaleTick, idx: number) {\r\n return (axis.scale as TimeScale).getFormattedLabel(tick, idx, tpl);\r\n };\r\n })(labelFormatter as TimeAxisLabelFormatterOption);\r\n }\r\n else if (zrUtil.isString(labelFormatter)) {\r\n return (function (tpl) {\r\n return function (tick: ScaleTick) {\r\n // For category axis, get raw value; for numeric axis,\r\n // get formatted label like '1,333,444'.\r\n const label = axis.scale.getLabel(tick);\r\n const text = tpl.replace('{value}', label != null ? label : '');\r\n\r\n return text;\r\n };\r\n })(labelFormatter);\r\n }\r\n else if (zrUtil.isFunction(labelFormatter)) {\r\n return (function (cb) {\r\n return function (tick: ScaleTick, idx: number) {\r\n // The original intention of `idx` is \"the index of the tick in all ticks\".\r\n // But the previous implementation of category axis do not consider the\r\n // `axisLabel.interval`, which cause that, for example, the `interval` is\r\n // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\r\n // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\r\n // the definition here for back compatibility.\r\n if (categoryTickStart != null) {\r\n idx = tick.value - categoryTickStart;\r\n }\r\n return cb(\r\n getAxisRawValue(axis, tick) as number,\r\n idx,\r\n (tick as TimeScaleTick).level != null ? {\r\n level: (tick as TimeScaleTick).level\r\n } : null\r\n );\r\n };\r\n })(labelFormatter as (...args: any[]) => string);\r\n }\r\n else {\r\n return function (tick: ScaleTick) {\r\n return axis.scale.getLabel(tick);\r\n };\r\n }\r\n}\r\n\r\nexport function getAxisRawValue(axis: Axis, tick: ScaleTick): number | string {\r\n // In category axis with data zoom, tick is not the original\r\n // index of axis.data. So tick should not be exposed to user\r\n // in category axis.\r\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\r\n}\r\n\r\n/**\r\n * @param axis\r\n * @return Be null/undefined if no labels.\r\n */\r\nexport function estimateLabelUnionRect(axis: Axis) {\r\n const axisModel = axis.model;\r\n const scale = axis.scale;\r\n\r\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\r\n return;\r\n }\r\n\r\n let realNumberScaleTicks: ScaleTick[];\r\n let tickCount;\r\n const categoryScaleExtent = scale.getExtent();\r\n\r\n // Optimize for large category data, avoid call `getTicks()`.\r\n if (scale instanceof OrdinalScale) {\r\n tickCount = scale.count();\r\n }\r\n else {\r\n realNumberScaleTicks = scale.getTicks();\r\n tickCount = realNumberScaleTicks.length;\r\n }\r\n\r\n const axisLabelModel = axis.getLabelModel();\r\n const labelFormatter = makeLabelFormatter(axis);\r\n\r\n let rect;\r\n let step = 1;\r\n // Simple optimization for large amount of labels\r\n if (tickCount > 40) {\r\n step = Math.ceil(tickCount / 40);\r\n }\r\n for (let i = 0; i < tickCount; i += step) {\r\n const tick = realNumberScaleTicks\r\n ? realNumberScaleTicks[i]\r\n : {\r\n value: categoryScaleExtent[0] + i\r\n };\r\n const label = labelFormatter(tick, i);\r\n const unrotatedSingleRect = axisLabelModel.getTextRect(label);\r\n const singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\r\n\r\n rect ? rect.union(singleRect) : (rect = singleRect);\r\n }\r\n\r\n return rect;\r\n}\r\n\r\nfunction rotateTextRect(textRect: RectLike, rotate: number) {\r\n const rotateRadians = rotate * Math.PI / 180;\r\n const beforeWidth = textRect.width;\r\n const beforeHeight = textRect.height;\r\n const afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians))\r\n + Math.abs(beforeHeight * Math.sin(rotateRadians));\r\n const afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians))\r\n + Math.abs(beforeHeight * Math.cos(rotateRadians));\r\n const rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\r\n\r\n return rotatedRect;\r\n}\r\n\r\n/**\r\n * @param model axisLabelModel or axisTickModel\r\n * @return {number|String} Can be null|'auto'|number|function\r\n */\r\nexport function getOptionCategoryInterval(model: Model) {\r\n const interval = (model as Model).get('interval');\r\n return interval == null ? 'auto' : interval;\r\n}\r\n\r\n/**\r\n * Set `categoryInterval` as 0 implicitly indicates that\r\n * show all labels regardless of overlap.\r\n * @param {Object} axis axisModel.axis\r\n */\r\nexport function shouldShowAllLabels(axis: Axis): boolean {\r\n return axis.type === 'category'\r\n && getOptionCategoryInterval(axis.getLabelModel()) === 0;\r\n}\r\n\r\nexport function getDataDimensionsOnAxis(data: SeriesData, axisDim: string): DimensionName[] {\r\n // Remove duplicated dat dimensions caused by `getStackedDimension`.\r\n const dataDimMap = {} as Dictionary;\r\n // Currently `mapDimensionsAll` will contain stack result dimension ('__\\0ecstackresult').\r\n // PENDING: is it reasonable? Do we need to remove the original dim from \"coord dim\" since\r\n // there has been stacked result dim?\r\n zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {\r\n // For example, the extent of the original dimension\r\n // is [0.1, 0.5], the extent of the `stackResultDimension`\r\n // is [7, 9], the final extent should NOT include [0.1, 0.5],\r\n // because there is no graphic corresponding to [0.1, 0.5].\r\n // See the case in `test/area-stack.html` `main1`, where area line\r\n // stack needs `yAxis` not start from 0.\r\n dataDimMap[getStackedDimension(data, dataDim)] = true;\r\n });\r\n return zrUtil.keys(dataDimMap);\r\n}\r\n\r\nexport function unionAxisExtentFromData(dataExtent: number[], data: SeriesData, axisDim: string): void {\r\n if (data) {\r\n zrUtil.each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\r\n const seriesExtent = data.getApproximateExtent(dim);\r\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\r\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\r\n });\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Model from '../model/Model';\r\nimport Axis from './Axis';\r\nimport { AxisBaseOption, ValueAxisBaseOption } from './axisCommonTypes';\r\nimport { CoordinateSystemHostModel } from './CoordinateSystem';\r\n\r\n\r\ninterface AxisModelCommonMixin extends Pick, 'option'> {\r\n axis: Axis;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nclass AxisModelCommonMixin {\r\n\r\n getNeedCrossZero(): boolean {\r\n const option = this.option as ValueAxisBaseOption;\r\n return !option.scale;\r\n }\r\n\r\n /**\r\n * Should be implemented by each axis model if necessary.\r\n * @return coordinate system model\r\n */\r\n getCoordSysModel(): CoordinateSystemHostModel {\r\n return;\r\n }\r\n\r\n}\r\n\r\nexport {AxisModelCommonMixin};\r\n", "import windingLine from './windingLine';\nimport { VectorArray } from '../core/vector';\n\nconst EPSILON = 1e-8;\n\nfunction isAroundEqual(a: number, b: number): boolean {\n return Math.abs(a - b) < EPSILON;\n}\n\nexport function contain(points: VectorArray[], x: number, y: number) {\n let w = 0;\n let p = points[0];\n\n if (!p) {\n return false;\n }\n\n for (let i = 1; i < points.length; i++) {\n const p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n }\n\n // Close polygon\n const p0 = points[0];\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n\n return w !== 0;\n}\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport * as polygonContain from 'zrender/src/contain/polygon';\r\nimport { GeoJSON, GeoProjection, GeoSVGGraphicRoot } from './geoTypes';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport Element from 'zrender/src/Element';\r\nimport { each } from 'zrender/src/core/util';\r\n\r\nconst TMP_TRANSFORM = [] as number[];\r\n\r\nfunction transformPoints(points: number[][], transform: matrix.MatrixArray) {\r\n for (let p = 0; p < points.length; p++) {\r\n vec2.applyTransform(points[p], points[p], transform);\r\n }\r\n}\r\nfunction updateBBoxFromPoints(\r\n points: ArrayLike[],\r\n min: vec2.VectorArray,\r\n max: vec2.VectorArray,\r\n projection: GeoProjection\r\n) {\r\n for (let i = 0; i < points.length; i++) {\r\n let p = points[i];\r\n if (projection) {\r\n // projection may return null point.\r\n p = projection.project(p as number[]);\r\n }\r\n if (p && isFinite(p[0]) && isFinite(p[1])) {\r\n vec2.min(min, min, p as vec2.VectorArray);\r\n vec2.max(max, max, p as vec2.VectorArray);\r\n }\r\n }\r\n}\r\n\r\nfunction centroid(points: number[][]) {\r\n let signedArea = 0;\r\n let cx = 0;\r\n let cy = 0;\r\n const len = points.length;\r\n let x0 = points[len - 1][0];\r\n let y0 = points[len - 1][1];\r\n // Polygon should been closed.\r\n for (let i = 0; i < len; i++) {\r\n const x1 = points[i][0];\r\n const y1 = points[i][1];\r\n const a = x0 * y1 - x1 * y0;\r\n signedArea += a;\r\n cx += (x0 + x1) * a;\r\n cy += (y0 + y1) * a;\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n\r\n return signedArea\r\n ? [cx / signedArea / 3, cy / signedArea / 3, signedArea]\r\n : [points[0][0] || 0, points[0][1] || 0];\r\n}\r\nexport abstract class Region {\r\n\r\n readonly name: string;\r\n readonly type: 'geoJSON' | 'geoSVG';\r\n\r\n protected _center: number[];\r\n protected _rect: BoundingRect;\r\n\r\n constructor(\r\n name: string\r\n ) {\r\n this.name = name;\r\n }\r\n\r\n setCenter(center: number[]) {\r\n this._center = center;\r\n }\r\n\r\n /**\r\n * Get center point in data unit. That is,\r\n * for GeoJSONRegion, the unit is lat/lng,\r\n * for GeoSVGRegion, the unit is SVG local coord.\r\n */\r\n getCenter() {\r\n let center = this._center;\r\n if (!center) {\r\n // In most cases there are no need to calculate this center.\r\n // So calculate only when called.\r\n center = this._center = this.calcCenter();\r\n }\r\n return center;\r\n }\r\n\r\n\r\n abstract calcCenter(): number[];\r\n}\r\n\r\nexport class GeoJSONPolygonGeometry {\r\n readonly type = 'polygon';\r\n exterior: number[][];\r\n interiors?: number[][][];\r\n constructor(exterior: number[][], interiors: number[][][]) {\r\n this.exterior = exterior;\r\n this.interiors = interiors;\r\n }\r\n}\r\nexport class GeoJSONLineStringGeometry {\r\n readonly type = 'linestring';\r\n points: number[][][];\r\n constructor(points: number[][][]) {\r\n this.points = points;\r\n }\r\n}\r\nexport class GeoJSONRegion extends Region {\r\n\r\n readonly type = 'geoJSON';\r\n\r\n readonly geometries: (GeoJSONPolygonGeometry | GeoJSONLineStringGeometry)[];\r\n\r\n // Injected outside.\r\n properties: GeoJSON['features'][0]['properties'];\r\n\r\n constructor(\r\n name: string,\r\n geometries: GeoJSONRegion['geometries'],\r\n cp: GeoJSON['features'][0]['properties']['cp']\r\n ) {\r\n super(name);\r\n\r\n this.geometries = geometries;\r\n\r\n this._center = cp && [cp[0], cp[1]];\r\n }\r\n\r\n calcCenter() {\r\n const geometries = this.geometries;\r\n let largestGeo: GeoJSONPolygonGeometry;\r\n let largestGeoSize = 0;\r\n for (let i = 0; i < geometries.length; i++) {\r\n const geo = geometries[i] as GeoJSONPolygonGeometry;\r\n const exterior = geo.exterior;\r\n // Simple trick to use points count instead of polygon area as region size.\r\n // Ignore linestring\r\n const size = exterior && exterior.length;\r\n if (size > largestGeoSize) {\r\n largestGeo = geo;\r\n largestGeoSize = size;\r\n }\r\n }\r\n if (largestGeo) {\r\n return centroid(largestGeo.exterior);\r\n }\r\n\r\n // from bounding rect by default.\r\n const rect = this.getBoundingRect();\r\n return [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n\r\n getBoundingRect(projection?: GeoProjection): BoundingRect {\r\n let rect = this._rect;\r\n // Always recalculate if using projection.\r\n if (rect && !projection) {\r\n return rect;\r\n }\r\n\r\n const min = [Infinity, Infinity];\r\n const max = [-Infinity, -Infinity];\r\n const geometries = this.geometries;\r\n\r\n each(geometries, geo => {\r\n if (geo.type === 'polygon') {\r\n // Doesn't consider hole\r\n updateBBoxFromPoints(geo.exterior, min, max, projection);\r\n }\r\n else {\r\n each(geo.points, (points) => {\r\n updateBBoxFromPoints(points, min, max, projection);\r\n });\r\n }\r\n });\r\n // Normalie invalid bounding.\r\n if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) {\r\n min[0] = min[1] = max[0] = max[1] = 0;\r\n }\r\n rect = new BoundingRect(\r\n min[0], min[1], max[0] - min[0], max[1] - min[1]\r\n );\r\n if (!projection) {\r\n this._rect = rect;\r\n }\r\n\r\n return rect;\r\n }\r\n\r\n contain(coord: number[]): boolean {\r\n const rect = this.getBoundingRect();\r\n const geometries = this.geometries;\r\n if (!rect.contain(coord[0], coord[1])) {\r\n return false;\r\n }\r\n loopGeo: for (let i = 0, len = geometries.length; i < len; i++) {\r\n const geo = geometries[i];\r\n // Only support polygon.\r\n if (geo.type !== 'polygon') {\r\n continue;\r\n }\r\n const exterior = geo.exterior;\r\n const interiors = geo.interiors;\r\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\r\n // Not in the region if point is in the hole.\r\n for (let k = 0; k < (interiors ? interiors.length : 0); k++) {\r\n if (polygonContain.contain(interiors[k], coord[0], coord[1])) {\r\n continue loopGeo;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Transform the raw coords to target bounding.\r\n * @param x\r\n * @param y\r\n * @param width\r\n * @param height\r\n */\r\n transformTo(x: number, y: number, width: number, height: number): void {\r\n let rect = this.getBoundingRect();\r\n const aspect = rect.width / rect.height;\r\n if (!width) {\r\n width = aspect * height;\r\n }\r\n else if (!height) {\r\n height = width / aspect;\r\n }\r\n const target = new BoundingRect(x, y, width, height);\r\n const transform = rect.calculateTransform(target);\r\n const geometries = this.geometries;\r\n for (let i = 0; i < geometries.length; i++) {\r\n const geo = geometries[i];\r\n if (geo.type === 'polygon') {\r\n transformPoints(geo.exterior, transform);\r\n each(geo.interiors, interior => {\r\n transformPoints(interior, transform);\r\n });\r\n }\r\n else {\r\n each(geo.points, points => {\r\n transformPoints(points, transform);\r\n });\r\n }\r\n }\r\n rect = this._rect;\r\n rect.copy(target);\r\n // Update center\r\n this._center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n\r\n cloneShallow(name: string): GeoJSONRegion {\r\n name == null && (name = this.name);\r\n const newRegion = new GeoJSONRegion(name, this.geometries, this._center);\r\n newRegion._rect = this._rect;\r\n newRegion.transformTo = null; // Simply avoid to be called.\r\n return newRegion;\r\n }\r\n}\r\n\r\nexport class GeoSVGRegion extends Region {\r\n\r\n readonly type = 'geoSVG';\r\n\r\n // Can only be used to calculate, but not be modified.\r\n // Because this el may not belong to this view,\r\n // but been displaying on some other view.\r\n private _elOnlyForCalculate: Element;\r\n\r\n constructor(\r\n name: string,\r\n elOnlyForCalculate: Element\r\n ) {\r\n super(name);\r\n this._elOnlyForCalculate = elOnlyForCalculate;\r\n }\r\n\r\n calcCenter(): number[] {\r\n const el = this._elOnlyForCalculate;\r\n const rect = el.getBoundingRect();\r\n const center = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n\r\n const mat = matrix.identity(TMP_TRANSFORM);\r\n\r\n let target = el;\r\n while (target && !(target as GeoSVGGraphicRoot).isGeoSVGGraphicRoot) {\r\n matrix.mul(mat, target.getLocalTransform(), mat);\r\n target = target.parent;\r\n }\r\n\r\n matrix.invert(mat, mat);\r\n\r\n vec2.applyTransform(center, center, mat);\r\n\r\n return center;\r\n }\r\n\r\n}\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Parse and decode geo json\r\n */\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { GeoJSONLineStringGeometry, GeoJSONPolygonGeometry, GeoJSONRegion } from './Region';\r\nimport { GeoJSONCompressed, GeoJSON } from './geoTypes';\r\n\r\n\r\nfunction decode(json: GeoJSONCompressed | GeoJSON): GeoJSON {\r\n if (!(json as GeoJSONCompressed).UTF8Encoding) {\r\n return json as GeoJSON;\r\n }\r\n const jsonCompressed = json as GeoJSONCompressed;\r\n let encodeScale = jsonCompressed.UTF8Scale;\r\n if (encodeScale == null) {\r\n encodeScale = 1024;\r\n }\r\n\r\n const features = jsonCompressed.features;\r\n zrUtil.each(features, feature => {\r\n const geometry = feature.geometry;\r\n const encodeOffsets = geometry.encodeOffsets;\r\n const coordinates = geometry.coordinates;\r\n\r\n // Geometry may be appeded manually in the script after json loaded.\r\n // In this case this geometry is usually not encoded.\r\n if (!encodeOffsets) {\r\n return;\r\n }\r\n\r\n switch (geometry.type) {\r\n case 'LineString':\r\n (geometry as any).coordinates =\r\n decodeRing(coordinates as string, encodeOffsets as number[], encodeScale);\r\n break;\r\n case 'Polygon':\r\n decodeRings(coordinates as string[], encodeOffsets as number[][], encodeScale);\r\n break;\r\n case 'MultiLineString':\r\n decodeRings(coordinates as string[], encodeOffsets as number[][], encodeScale);\r\n break;\r\n case 'MultiPolygon':\r\n zrUtil.each(\r\n coordinates as string[][],\r\n (rings, idx) => decodeRings(rings, (encodeOffsets as number[][][])[idx], encodeScale)\r\n );\r\n }\r\n });\r\n // Has been decoded\r\n jsonCompressed.UTF8Encoding = false;\r\n\r\n return jsonCompressed as unknown as GeoJSON;\r\n}\r\n\r\nfunction decodeRings(\r\n rings: string[],\r\n encodeOffsets: number[][],\r\n encodeScale: number\r\n) {\r\n for (let c = 0; c < rings.length; c++) {\r\n rings[c] = decodeRing(\r\n rings[c],\r\n encodeOffsets[c],\r\n encodeScale\r\n ) as any;\r\n }\r\n}\r\n\r\nfunction decodeRing(\r\n coordinate: string,\r\n encodeOffsets: number[],\r\n encodeScale: number\r\n): number[][] {\r\n const result = [];\r\n let prevX = encodeOffsets[0];\r\n let prevY = encodeOffsets[1];\r\n\r\n for (let i = 0; i < coordinate.length; i += 2) {\r\n let x = coordinate.charCodeAt(i) - 64;\r\n let y = coordinate.charCodeAt(i + 1) - 64;\r\n // ZigZag decoding\r\n x = (x >> 1) ^ (-(x & 1));\r\n y = (y >> 1) ^ (-(y & 1));\r\n // Delta deocding\r\n x += prevX;\r\n y += prevY;\r\n\r\n prevX = x;\r\n prevY = y;\r\n // Dequantize\r\n result.push([x / encodeScale, y / encodeScale]);\r\n }\r\n\r\n return result;\r\n}\r\n\r\nexport default function parseGeoJSON(geoJson: GeoJSON | GeoJSONCompressed, nameProperty: string): GeoJSONRegion[] {\r\n\r\n geoJson = decode(geoJson);\r\n\r\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\r\n // Output of mapshaper may have geometry null\r\n return featureObj.geometry\r\n && featureObj.properties\r\n && featureObj.geometry.coordinates.length > 0;\r\n }), function (featureObj) {\r\n const properties = featureObj.properties;\r\n const geo = featureObj.geometry;\r\n\r\n const geometries = [] as GeoJSONRegion['geometries'];\r\n switch (geo.type) {\r\n case 'Polygon':\r\n const coordinates = geo.coordinates;\r\n // According to the GeoJSON specification.\r\n // First must be exterior, and the rest are all interior(holes).\r\n geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1)));\r\n break;\r\n case 'MultiPolygon':\r\n zrUtil.each(geo.coordinates, function (item) {\r\n if (item[0]) {\r\n geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1)));\r\n }\r\n });\r\n break;\r\n case 'LineString':\r\n geometries.push(new GeoJSONLineStringGeometry([geo.coordinates]));\r\n break;\r\n case 'MultiLineString':\r\n geometries.push(new GeoJSONLineStringGeometry(geo.coordinates));\r\n\r\n }\r\n\r\n const region = new GeoJSONRegion(\r\n properties[nameProperty || 'name'],\r\n geometries,\r\n properties.cp\r\n );\r\n region.properties = properties;\r\n return region;\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nexport {\r\n linearMap,\r\n round,\r\n asc,\r\n getPrecision,\r\n getPrecisionSafe,\r\n getPixelPrecision,\r\n getPercentWithPrecision,\r\n MAX_SAFE_INTEGER,\r\n remRadian,\r\n isRadianAroundZero,\r\n parseDate,\r\n quantity,\r\n quantityExponent,\r\n nice,\r\n quantile,\r\n reformIntervals,\r\n isNumeric,\r\n numericToNumber\r\n} from '../../util/number';", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nexport {parseDate as parse} from '../../util/number';\r\n\r\nexport {format} from '../../util/time';", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nexport {\r\n extendShape, extendPath, makePath, makeImage,\r\n mergePath, resizePath, createIcon,\r\n updateProps, initProps, getTransform,\r\n clipPointsByRect, clipRectByRect,\r\n registerShape, getShapeClass,\r\n Group,\r\n Image,\r\n Text,\r\n Circle,\r\n Ellipse,\r\n Sector,\r\n Ring,\r\n Polygon,\r\n Polyline,\r\n Rect,\r\n Line,\r\n BezierCurve,\r\n Arc,\r\n IncrementalDisplayable,\r\n CompoundPath,\r\n LinearGradient,\r\n RadialGradient,\r\n BoundingRect\r\n} from '../../util/graphic';", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nexport {\r\n addCommas,\r\n toCamelCase,\r\n normalizeCssArray,\r\n encodeHTML,\r\n formatTpl,\r\n getTooltipMarker,\r\n formatTime,\r\n capitalFirst,\r\n truncateText,\r\n getTextRect\r\n} from '../../util/format';", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nexport {\r\n map, each, indexOf, inherits, reduce, filter,\r\n bind, curry, isArray, isString, isObject, isFunction,\r\n extend, defaults, clone, merge\r\n} from 'zrender/src/core/util';", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as textContain from 'zrender/src/contain/text';\r\nimport {makeInner} from '../util/model';\r\nimport {\r\n makeLabelFormatter,\r\n getOptionCategoryInterval,\r\n shouldShowAllLabels\r\n} from './axisHelper';\r\nimport Axis from './Axis';\r\nimport Model from '../model/Model';\r\nimport { AxisBaseOption } from './axisCommonTypes';\r\nimport OrdinalScale from '../scale/Ordinal';\r\nimport { AxisBaseModel } from './AxisBaseModel';\r\nimport type Axis2D from './cartesian/Axis2D';\r\n\r\ntype CacheKey = string | number;\r\n\r\ntype InnerTickLabelCache = {\r\n key: CacheKey\r\n value: T\r\n}[];\r\n\r\ninterface InnerLabelCachedVal {\r\n labels: MakeLabelsResultObj[]\r\n labelCategoryInterval?: number\r\n}\r\ninterface InnerTickCachedVal {\r\n ticks: number[]\r\n tickCategoryInterval?: number\r\n}\r\n\r\ntype InnerStore = {\r\n labels: InnerTickLabelCache\r\n ticks: InnerTickLabelCache\r\n autoInterval: number\r\n lastAutoInterval: number\r\n lastTickCount: number\r\n axisExtent0: number\r\n axisExtent1: number\r\n};\r\n\r\nconst inner = makeInner();\r\n\r\nfunction tickValuesToNumbers(axis: Axis, values: (number | string | Date)[]) {\r\n const nums = zrUtil.map(values, val => axis.scale.parse(val));\r\n if (axis.type === 'time' && nums.length > 0) {\r\n // Time axis needs duplicate first/last tick (see TimeScale.getTicks())\r\n // The first and last tick/label don't get drawn\r\n nums.sort();\r\n nums.unshift(nums[0]);\r\n nums.push(nums[nums.length - 1]);\r\n }\r\n return nums;\r\n}\r\n\r\nexport function createAxisLabels(axis: Axis): {\r\n labels: {\r\n level?: number,\r\n formattedLabel: string,\r\n rawLabel: string,\r\n tickValue: number\r\n }[],\r\n labelCategoryInterval?: number\r\n} {\r\n const custom = axis.getLabelModel().get('customValues');\r\n if (custom) {\r\n const labelFormatter = makeLabelFormatter(axis);\r\n const extent = axis.scale.getExtent();\r\n const tickNumbers = tickValuesToNumbers(axis, custom);\r\n const ticks = zrUtil.filter(tickNumbers, val => val >= extent[0] && val <= extent[1]);\r\n return {\r\n labels: zrUtil.map(ticks, numval => {\r\n const tick = {value: numval};\r\n return {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: numval\r\n };\r\n })\r\n };\r\n }\r\n // Only ordinal scale support tick interval\r\n return axis.type === 'category'\r\n ? makeCategoryLabels(axis)\r\n : makeRealNumberLabels(axis);\r\n}\r\n\r\n/**\r\n * @param {module:echats/coord/Axis} axis\r\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\r\n * @return {Object} {\r\n * ticks: Array.\r\n * tickCategoryInterval: number\r\n * }\r\n */\r\nexport function createAxisTicks(axis: Axis, tickModel: AxisBaseModel): {\r\n ticks: number[],\r\n tickCategoryInterval?: number\r\n} {\r\n const custom = axis.getTickModel().get('customValues');\r\n if (custom) {\r\n const extent = axis.scale.getExtent();\r\n const tickNumbers = tickValuesToNumbers(axis, custom);\r\n return {\r\n ticks: zrUtil.filter(tickNumbers, val => val >= extent[0] && val <= extent[1])\r\n };\r\n }\r\n // Only ordinal scale support tick interval\r\n return axis.type === 'category'\r\n ? makeCategoryTicks(axis, tickModel)\r\n : {ticks: zrUtil.map(axis.scale.getTicks(), tick => tick.value) };\r\n}\r\n\r\nfunction makeCategoryLabels(axis: Axis) {\r\n const labelModel = axis.getLabelModel();\r\n const result = makeCategoryLabelsActually(axis, labelModel);\r\n\r\n return (!labelModel.get('show') || axis.scale.isBlank())\r\n ? {labels: [], labelCategoryInterval: result.labelCategoryInterval}\r\n : result;\r\n}\r\n\r\nfunction makeCategoryLabelsActually(axis: Axis, labelModel: Model) {\r\n const labelsCache = getListCache(axis, 'labels');\r\n const optionLabelInterval = getOptionCategoryInterval(labelModel);\r\n const result = listCacheGet(labelsCache, optionLabelInterval as CacheKey);\r\n\r\n if (result) {\r\n return result;\r\n }\r\n\r\n let labels;\r\n let numericLabelInterval;\r\n\r\n if (zrUtil.isFunction(optionLabelInterval)) {\r\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\r\n }\r\n else {\r\n numericLabelInterval = optionLabelInterval === 'auto'\r\n ? makeAutoCategoryInterval(axis) : optionLabelInterval;\r\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\r\n }\r\n\r\n // Cache to avoid calling interval function repeatedly.\r\n return listCacheSet(labelsCache, optionLabelInterval as CacheKey, {\r\n labels: labels, labelCategoryInterval: numericLabelInterval\r\n });\r\n}\r\n\r\nfunction makeCategoryTicks(axis: Axis, tickModel: AxisBaseModel) {\r\n const ticksCache = getListCache(axis, 'ticks');\r\n const optionTickInterval = getOptionCategoryInterval(tickModel);\r\n const result = listCacheGet(ticksCache, optionTickInterval as CacheKey);\r\n\r\n if (result) {\r\n return result;\r\n }\r\n\r\n let ticks: number[];\r\n let tickCategoryInterval;\r\n\r\n // Optimize for the case that large category data and no label displayed,\r\n // we should not return all ticks.\r\n if (!tickModel.get('show') || axis.scale.isBlank()) {\r\n ticks = [];\r\n }\r\n\r\n if (zrUtil.isFunction(optionTickInterval)) {\r\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\r\n }\r\n // Always use label interval by default despite label show. Consider this\r\n // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\r\n // labels. `splitLine` and `axisTick` should be consistent in this case.\r\n else if (optionTickInterval === 'auto') {\r\n const labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\r\n tickCategoryInterval = labelsResult.labelCategoryInterval;\r\n ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\r\n return labelItem.tickValue;\r\n });\r\n }\r\n else {\r\n tickCategoryInterval = optionTickInterval;\r\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\r\n }\r\n\r\n // Cache to avoid calling interval function repeatedly.\r\n return listCacheSet(ticksCache, optionTickInterval as CacheKey, {\r\n ticks: ticks, tickCategoryInterval: tickCategoryInterval\r\n });\r\n}\r\n\r\nfunction makeRealNumberLabels(axis: Axis) {\r\n const ticks = axis.scale.getTicks();\r\n const labelFormatter = makeLabelFormatter(axis);\r\n return {\r\n labels: zrUtil.map(ticks, function (tick, idx) {\r\n return {\r\n level: tick.level,\r\n formattedLabel: labelFormatter(tick, idx),\r\n rawLabel: axis.scale.getLabel(tick),\r\n tickValue: tick.value\r\n };\r\n })\r\n };\r\n}\r\n\r\n// Large category data calculation is performance sensitive, and ticks and label\r\n// probably will be fetched multiple times. So we cache the result.\r\n// axis is created each time during a ec process, so we do not need to clear cache.\r\nfunction getListCache(axis: Axis, prop: 'ticks'): InnerStore['ticks'];\r\nfunction getListCache(axis: Axis, prop: 'labels'): InnerStore['labels'];\r\nfunction getListCache(axis: Axis, prop: 'ticks' | 'labels') {\r\n // Because key can be a function, and cache size always is small, we use array cache.\r\n return inner(axis)[prop] || (inner(axis)[prop] = []);\r\n}\r\n\r\nfunction listCacheGet(cache: InnerTickLabelCache, key: CacheKey): T {\r\n for (let i = 0; i < cache.length; i++) {\r\n if (cache[i].key === key) {\r\n return cache[i].value;\r\n }\r\n }\r\n}\r\n\r\nfunction listCacheSet(cache: InnerTickLabelCache, key: CacheKey, value: T): T {\r\n cache.push({key: key, value: value});\r\n return value;\r\n}\r\n\r\nfunction makeAutoCategoryInterval(axis: Axis) {\r\n const result = inner(axis).autoInterval;\r\n return result != null\r\n ? result\r\n : (inner(axis).autoInterval = axis.calculateCategoryInterval());\r\n}\r\n\r\n/**\r\n * Calculate interval for category axis ticks and labels.\r\n * To get precise result, at least one of `getRotate` and `isHorizontal`\r\n * should be implemented in axis.\r\n */\r\nexport function calculateCategoryInterval(axis: Axis) {\r\n const params = fetchAutoCategoryIntervalCalculationParams(axis);\r\n const labelFormatter = makeLabelFormatter(axis);\r\n const rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\r\n\r\n const ordinalScale = axis.scale as OrdinalScale;\r\n const ordinalExtent = ordinalScale.getExtent();\r\n // Providing this method is for optimization:\r\n // avoid generating a long array by `getTicks`\r\n // in large category data case.\r\n const tickCount = ordinalScale.count();\r\n\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n\r\n let step = 1;\r\n // Simple optimization. Empirical value: tick count should less than 40.\r\n if (tickCount > 40) {\r\n step = Math.max(1, Math.floor(tickCount / 40));\r\n }\r\n let tickValue = ordinalExtent[0];\r\n const unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n const unitW = Math.abs(unitSpan * Math.cos(rotation));\r\n const unitH = Math.abs(unitSpan * Math.sin(rotation));\r\n\r\n let maxW = 0;\r\n let maxH = 0;\r\n\r\n // Caution: Performance sensitive for large category data.\r\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n let width = 0;\r\n let height = 0;\r\n\r\n // Not precise, do not consider align and vertical align\r\n // and each distance from axis line yet.\r\n const rect = textContain.getBoundingRect(\r\n labelFormatter({ value: tickValue }), params.font, 'center', 'top'\r\n );\r\n // Magic number\r\n width = rect.width * 1.3;\r\n height = rect.height * 1.3;\r\n\r\n // Min size, void long loop.\r\n maxW = Math.max(maxW, width, 7);\r\n maxH = Math.max(maxH, height, 7);\r\n }\r\n\r\n let dw = maxW / unitW;\r\n let dh = maxH / unitH;\r\n // 0/0 is NaN, 1/0 is Infinity.\r\n isNaN(dw) && (dw = Infinity);\r\n isNaN(dh) && (dh = Infinity);\r\n let interval = Math.max(0, Math.floor(Math.min(dw, dh)));\r\n\r\n const cache = inner(axis.model);\r\n const axisExtent = axis.getExtent();\r\n const lastAutoInterval = cache.lastAutoInterval;\r\n const lastTickCount = cache.lastTickCount;\r\n\r\n // Use cache to keep interval stable while moving zoom window,\r\n // otherwise the calculated interval might jitter when the zoom\r\n // window size is close to the interval-changing size.\r\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\r\n // The jitter will cause that sometimes the displayed labels are\r\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n // Always choose the bigger one, otherwise the critical\r\n // point is not the same when zooming in or zooming out.\r\n && lastAutoInterval > interval\r\n // If the axis change is caused by chart resize, the cache should not\r\n // be used. Otherwise some hidden labels might not be shown again.\r\n && cache.axisExtent0 === axisExtent[0]\r\n && cache.axisExtent1 === axisExtent[1]\r\n ) {\r\n interval = lastAutoInterval;\r\n }\r\n // Only update cache if cache not used, otherwise the\r\n // changing of interval is too insensitive.\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n cache.axisExtent0 = axisExtent[0];\r\n cache.axisExtent1 = axisExtent[1];\r\n }\r\n\r\n return interval;\r\n}\r\n\r\nfunction fetchAutoCategoryIntervalCalculationParams(axis: Axis) {\r\n const labelModel = axis.getLabelModel();\r\n return {\r\n axisRotate: axis.getRotate\r\n ? axis.getRotate()\r\n : ((axis as Axis2D).isHorizontal && !(axis as Axis2D).isHorizontal())\r\n ? 90\r\n : 0,\r\n labelRotate: labelModel.get('rotate') || 0,\r\n font: labelModel.getFont()\r\n };\r\n}\r\n\r\ninterface MakeLabelsResultObj {\r\n formattedLabel: string\r\n rawLabel: string\r\n tickValue: number\r\n}\r\n\r\nfunction makeLabelsByNumericCategoryInterval(axis: Axis, categoryInterval: number): MakeLabelsResultObj[];\r\n/* eslint-disable-next-line */\r\nfunction makeLabelsByNumericCategoryInterval(axis: Axis, categoryInterval: number, onlyTick: false): MakeLabelsResultObj[];\r\nfunction makeLabelsByNumericCategoryInterval(axis: Axis, categoryInterval: number, onlyTick: true): number[];\r\nfunction makeLabelsByNumericCategoryInterval(axis: Axis, categoryInterval: number, onlyTick?: boolean) {\r\n const labelFormatter = makeLabelFormatter(axis);\r\n const ordinalScale = axis.scale as OrdinalScale;\r\n const ordinalExtent = ordinalScale.getExtent();\r\n const labelModel = axis.getLabelModel();\r\n const result: (MakeLabelsResultObj | number)[] = [];\r\n\r\n // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\r\n\r\n const step = Math.max((categoryInterval || 0) + 1, 1);\r\n let startTick = ordinalExtent[0];\r\n const tickCount = ordinalScale.count();\r\n\r\n // Calculate start tick based on zero if possible to keep label consistent\r\n // while zooming and moving while interval > 0. Otherwise the selection\r\n // of displayable ticks and symbols probably keep changing.\r\n // 3 is empirical value.\r\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\r\n startTick = Math.round(Math.ceil(startTick / step) * step);\r\n }\r\n\r\n // (1) Only add min max label here but leave overlap checking\r\n // to render stage, which also ensure the returned list\r\n // suitable for splitLine and splitArea rendering.\r\n // (2) Scales except category always contain min max label so\r\n // do not need to perform this process.\r\n const showAllLabel = shouldShowAllLabels(axis);\r\n const includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\r\n const includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\r\n\r\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\r\n addItem(ordinalExtent[0]);\r\n }\r\n\r\n // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\r\n let tickValue = startTick;\r\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\r\n addItem(tickValue);\r\n }\r\n\r\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\r\n addItem(ordinalExtent[1]);\r\n }\r\n\r\n function addItem(tickValue: number) {\r\n const tickObj = { value: tickValue };\r\n result.push(onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tickObj),\r\n rawLabel: ordinalScale.getLabel(tickObj),\r\n tickValue: tickValue\r\n }\r\n );\r\n }\r\n\r\n return result;\r\n}\r\n\r\ntype CategoryIntervalCb = (tickVal: number, rawLabel: string) => boolean;\r\n\r\n// When interval is function, the result `false` means ignore the tick.\r\n// It is time consuming for large category data.\r\n/* eslint-disable-next-line */\r\nfunction makeLabelsByCustomizedCategoryInterval(axis: Axis, categoryInterval: CategoryIntervalCb): MakeLabelsResultObj[];\r\n/* eslint-disable-next-line */\r\nfunction makeLabelsByCustomizedCategoryInterval(axis: Axis, categoryInterval: CategoryIntervalCb, onlyTick: false): MakeLabelsResultObj[];\r\n/* eslint-disable-next-line */\r\nfunction makeLabelsByCustomizedCategoryInterval(axis: Axis, categoryInterval: CategoryIntervalCb, onlyTick: true): number[];\r\nfunction makeLabelsByCustomizedCategoryInterval(axis: Axis, categoryInterval: CategoryIntervalCb, onlyTick?: boolean) {\r\n const ordinalScale = axis.scale;\r\n const labelFormatter = makeLabelFormatter(axis);\r\n const result: (MakeLabelsResultObj | number)[] = [];\r\n\r\n zrUtil.each(ordinalScale.getTicks(), function (tick) {\r\n const rawLabel = ordinalScale.getLabel(tick);\r\n const tickValue = tick.value;\r\n if (categoryInterval(tick.value, rawLabel)) {\r\n result.push(\r\n onlyTick\r\n ? tickValue\r\n : {\r\n formattedLabel: labelFormatter(tick),\r\n rawLabel: rawLabel,\r\n tickValue: tickValue\r\n }\r\n );\r\n }\r\n });\r\n\r\n return result;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {each, map} from 'zrender/src/core/util';\r\nimport {linearMap, getPixelPrecision, round} from '../util/number';\r\nimport {\r\n createAxisTicks,\r\n createAxisLabels,\r\n calculateCategoryInterval\r\n} from './axisTickLabelBuilder';\r\nimport Scale from '../scale/Scale';\r\nimport { DimensionName, ScaleDataValue, ScaleTick } from '../util/types';\r\nimport OrdinalScale from '../scale/Ordinal';\r\nimport Model from '../model/Model';\r\nimport { AxisBaseOption, CategoryAxisBaseOption, OptionAxisType } from './axisCommonTypes';\r\nimport { AxisBaseModel } from './AxisBaseModel';\r\n\r\nconst NORMALIZED_EXTENT = [0, 1] as [number, number];\r\n\r\ninterface TickCoord {\r\n coord: number;\r\n // That is `scaleTick.value`.\r\n tickValue?: ScaleTick['value'];\r\n}\r\n\r\n/**\r\n * Base class of Axis.\r\n */\r\nclass Axis {\r\n\r\n /**\r\n * Axis type\r\n * - 'category'\r\n * - 'value'\r\n * - 'time'\r\n * - 'log'\r\n */\r\n type: OptionAxisType;\r\n\r\n // Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'.\r\n readonly dim: DimensionName;\r\n\r\n // Axis scale\r\n scale: Scale;\r\n\r\n private _extent: [number, number];\r\n\r\n // Injected outside\r\n model: AxisBaseModel;\r\n onBand: CategoryAxisBaseOption['boundaryGap'] = false;\r\n inverse: AxisBaseOption['inverse'] = false;\r\n\r\n\r\n constructor(dim: DimensionName, scale: Scale, extent: [number, number]) {\r\n this.dim = dim;\r\n this.scale = scale;\r\n this._extent = extent || [0, 0];\r\n }\r\n\r\n /**\r\n * If axis extent contain given coord\r\n */\r\n contain(coord: number): boolean {\r\n const extent = this._extent;\r\n const min = Math.min(extent[0], extent[1]);\r\n const max = Math.max(extent[0], extent[1]);\r\n return coord >= min && coord <= max;\r\n }\r\n\r\n /**\r\n * If axis extent contain given data\r\n */\r\n containData(data: ScaleDataValue): boolean {\r\n return this.scale.contain(data);\r\n }\r\n\r\n /**\r\n * Get coord extent.\r\n */\r\n getExtent(): [number, number] {\r\n return this._extent.slice() as [number, number];\r\n }\r\n\r\n /**\r\n * Get precision used for formatting\r\n */\r\n getPixelPrecision(dataExtent?: [number, number]): number {\r\n return getPixelPrecision(\r\n dataExtent || this.scale.getExtent(),\r\n this._extent\r\n );\r\n }\r\n\r\n /**\r\n * Set coord extent\r\n */\r\n setExtent(start: number, end: number): void {\r\n const extent = this._extent;\r\n extent[0] = start;\r\n extent[1] = end;\r\n }\r\n\r\n /**\r\n * Convert data to coord. Data is the rank if it has an ordinal scale\r\n */\r\n dataToCoord(data: ScaleDataValue, clamp?: boolean): number {\r\n let extent = this._extent;\r\n const scale = this.scale;\r\n data = scale.normalize(data);\r\n\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice() as [number, number];\r\n fixExtentWithBands(extent, (scale as OrdinalScale).count());\r\n }\r\n\r\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\r\n }\r\n\r\n /**\r\n * Convert coord to data. Data is the rank if it has an ordinal scale\r\n */\r\n coordToData(coord: number, clamp?: boolean): number {\r\n let extent = this._extent;\r\n const scale = this.scale;\r\n\r\n if (this.onBand && scale.type === 'ordinal') {\r\n extent = extent.slice() as [number, number];\r\n fixExtentWithBands(extent, (scale as OrdinalScale).count());\r\n }\r\n\r\n const t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\r\n\r\n return this.scale.scale(t);\r\n }\r\n\r\n /**\r\n * Convert pixel point to data in axis\r\n */\r\n pointToData(point: number[], clamp?: boolean): number {\r\n // Should be implemented in derived class if necessary.\r\n return;\r\n }\r\n\r\n /**\r\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\r\n * `axis.getTicksCoords` considers `onBand`, which is used by\r\n * `boundaryGap:true` of category axis and splitLine and splitArea.\r\n * @param opt.tickModel default: axis.model.getModel('axisTick')\r\n * @param opt.clamp If `true`, the first and the last\r\n * tick must be at the axis end points. Otherwise, clip ticks\r\n * that outside the axis extent.\r\n */\r\n getTicksCoords(opt?: {\r\n tickModel?: Model,\r\n clamp?: boolean\r\n }): TickCoord[] {\r\n opt = opt || {};\r\n\r\n const tickModel = opt.tickModel || this.getTickModel();\r\n const result = createAxisTicks(this, tickModel as AxisBaseModel);\r\n const ticks = result.ticks;\r\n\r\n const ticksCoords = map(ticks, function (tickVal) {\r\n return {\r\n coord: this.dataToCoord(\r\n this.scale.type === 'ordinal'\r\n ? (this.scale as OrdinalScale).getRawOrdinalNumber(tickVal)\r\n : tickVal\r\n ),\r\n tickValue: tickVal\r\n };\r\n }, this);\r\n\r\n const alignWithLabel = tickModel.get('alignWithLabel');\r\n\r\n fixOnBandTicksCoords(\r\n this, ticksCoords, alignWithLabel, opt.clamp\r\n );\r\n\r\n return ticksCoords;\r\n }\r\n\r\n getMinorTicksCoords(): TickCoord[][] {\r\n if (this.scale.type === 'ordinal') {\r\n // Category axis doesn't support minor ticks\r\n return [];\r\n }\r\n\r\n const minorTickModel = this.model.getModel('minorTick');\r\n let splitNumber = minorTickModel.get('splitNumber');\r\n // Protection.\r\n if (!(splitNumber > 0 && splitNumber < 100)) {\r\n splitNumber = 5;\r\n }\r\n const minorTicks = this.scale.getMinorTicks(splitNumber);\r\n const minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\r\n return map(minorTicksGroup, function (minorTick) {\r\n return {\r\n coord: this.dataToCoord(minorTick),\r\n tickValue: minorTick\r\n };\r\n }, this);\r\n }, this);\r\n return minorTicksCoords;\r\n }\r\n\r\n getViewLabels(): ReturnType['labels'] {\r\n return createAxisLabels(this).labels;\r\n }\r\n\r\n getLabelModel(): Model {\r\n return this.model.getModel('axisLabel');\r\n }\r\n\r\n /**\r\n * Notice here we only get the default tick model. For splitLine\r\n * or splitArea, we should pass the splitLineModel or splitAreaModel\r\n * manually when calling `getTicksCoords`.\r\n * In GL, this method may be overridden to:\r\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\r\n */\r\n getTickModel(): Model {\r\n return this.model.getModel('axisTick');\r\n }\r\n\r\n /**\r\n * Get width of band\r\n */\r\n getBandWidth(): number {\r\n const axisExtent = this._extent;\r\n const dataExtent = this.scale.getExtent();\r\n\r\n let len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);\r\n // Fix #2728, avoid NaN when only one data.\r\n len === 0 && (len = 1);\r\n\r\n const size = Math.abs(axisExtent[1] - axisExtent[0]);\r\n\r\n return Math.abs(size) / len;\r\n }\r\n\r\n /**\r\n * Get axis rotate, by degree.\r\n */\r\n getRotate: () => number;\r\n\r\n /**\r\n * Only be called in category axis.\r\n * Can be overridden, consider other axes like in 3D.\r\n * @return Auto interval for cateogry axis tick and label\r\n */\r\n calculateCategoryInterval(): ReturnType {\r\n return calculateCategoryInterval(this);\r\n }\r\n\r\n}\r\n\r\nfunction fixExtentWithBands(extent: [number, number], nTick: number): void {\r\n const size = extent[1] - extent[0];\r\n const len = nTick;\r\n const margin = size / len / 2;\r\n extent[0] += margin;\r\n extent[1] -= margin;\r\n}\r\n\r\n// If axis has labels [1, 2, 3, 4]. Bands on the axis are\r\n// |---1---|---2---|---3---|---4---|.\r\n// So the displayed ticks and splitLine/splitArea should between\r\n// each data item, otherwise cause misleading (e.g., split tow bars\r\n// of a single data item when there are two bar series).\r\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\r\n// splitLine/spliteArea should layout appropriately corresponding\r\n// to displayed labels. (So we should not use `getBandWidth` in this\r\n// case).\r\nfunction fixOnBandTicksCoords(\r\n axis: Axis, ticksCoords: TickCoord[], alignWithLabel: boolean, clamp: boolean\r\n) {\r\n const ticksLen = ticksCoords.length;\r\n\r\n if (!axis.onBand || alignWithLabel || !ticksLen) {\r\n return;\r\n }\r\n\r\n const axisExtent = axis.getExtent();\r\n let last;\r\n let diffSize;\r\n if (ticksLen === 1) {\r\n ticksCoords[0].coord = axisExtent[0];\r\n last = ticksCoords[1] = {coord: axisExtent[1], tickValue: ticksCoords[0].tickValue};\r\n }\r\n else {\r\n const crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\r\n const shift = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\r\n\r\n each(ticksCoords, function (ticksItem) {\r\n ticksItem.coord -= shift / 2;\r\n });\r\n\r\n const dataExtent = axis.scale.getExtent();\r\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\r\n\r\n last = {coord: ticksCoords[ticksLen - 1].coord + shift * diffSize, tickValue: dataExtent[1] + 1};\r\n\r\n ticksCoords.push(last);\r\n }\r\n\r\n const inverse = axisExtent[0] > axisExtent[1];\r\n\r\n // Handling clamp.\r\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\r\n clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();\r\n }\r\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\r\n ticksCoords.unshift({coord: axisExtent[0]});\r\n }\r\n if (littleThan(axisExtent[1], last.coord)) {\r\n clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();\r\n }\r\n if (clamp && littleThan(last.coord, axisExtent[1])) {\r\n ticksCoords.push({coord: axisExtent[1]});\r\n }\r\n\r\n function littleThan(a: number, b: number): boolean {\r\n // Avoid rounding error cause calculated tick coord different with extent.\r\n // It may cause an extra unnecessary tick added.\r\n a = round(a);\r\n b = round(b);\r\n return inverse ? a > b : a < b;\r\n }\r\n}\r\n\r\nexport default Axis;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// These APIs are for more advanced usages\r\n// For example extend charts and components, creating graphic elements, formatting.\r\nimport ComponentModel, { ComponentModelConstructor } from '../model/Component';\r\nimport ComponentView, { ComponentViewConstructor } from '../view/Component';\r\nimport SeriesModel, { SeriesModelConstructor } from '../model/Series';\r\nimport ChartView, { ChartViewConstructor } from '../view/Chart';\r\n\r\nimport SeriesData from '../data/SeriesData';\r\n\r\n// Provide utilities API in echarts. It will be in echarts namespace.\r\n// Like echarts.util, echarts.graphic\r\nexport * as zrender from 'zrender/src/zrender';\r\n\r\nexport * as matrix from 'zrender/src/core/matrix';\r\nexport * as vector from 'zrender/src/core/vector';\r\nexport * as zrUtil from 'zrender/src/core/util';\r\nexport * as color from 'zrender/src/tool/color';\r\nexport {throttle} from '../util/throttle';\r\nexport * as helper from './api/helper';\r\n\r\nexport {use} from '../extension';\r\n\r\nexport {setPlatformAPI} from 'zrender/src/core/platform';\r\n\r\n// --------------------- Helper Methods ---------------------\r\nexport {default as parseGeoJSON} from '../coord/geo/parseGeoJson';\r\nexport {default as parseGeoJson} from '../coord/geo/parseGeoJson';\r\n\r\nexport * as number from './api/number';\r\nexport * as time from './api/time';\r\nexport * as graphic from './api/graphic';\r\n\r\nexport * as format from './api/format';\r\n\r\nexport * as util from './api/util';\r\n\r\nexport {default as env} from 'zrender/src/core/env';\r\n\r\n// --------------------- Export for Extension Usage ---------------------\r\n// export {SeriesData};\r\nexport {SeriesData as List}; // TODO: Compatitable with exists echarts-gl code\r\nexport {default as Model} from '../model/Model';\r\nexport {default as Axis} from '../coord/Axis';\r\n\r\nexport {\r\n ComponentModel,\r\n ComponentView,\r\n SeriesModel,\r\n ChartView\r\n};\r\n\r\n// Only for GL\r\nexport {brushSingle as innerDrawElementOnCanvas} from 'zrender/src/canvas/graphic';\r\n\r\n\r\n// --------------------- Deprecated Extension Methods ---------------------\r\n\r\n// Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class.\r\n// Then use `registerComponentModel` in `install` parameter when `use` this extension. For example:\r\n// class Bar3DModel extends ComponentModel {}\r\n// export function install(registers) { registers.registerComponentModel(Bar3DModel); }\r\n// echarts.use(install);\r\nexport function extendComponentModel(proto: object): ComponentModel {\r\n const Model = (ComponentModel as ComponentModelConstructor).extend(proto) as any;\r\n ComponentModel.registerClass(Model);\r\n return Model;\r\n}\r\n\r\nexport function extendComponentView(proto: object): ChartView {\r\n const View = (ComponentView as ComponentViewConstructor).extend(proto) as any;\r\n ComponentView.registerClass(View);\r\n return View;\r\n}\r\n\r\nexport function extendSeriesModel(proto: object): SeriesModel {\r\n const Model = (SeriesModel as SeriesModelConstructor).extend(proto) as any;\r\n SeriesModel.registerClass(Model);\r\n return Model;\r\n}\r\n\r\nexport function extendChartView(proto: object): ChartView {\r\n const View = (ChartView as ChartViewConstructor).extend(proto) as any;\r\n ChartView.registerClass(View);\r\n return View;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n Point,\r\n Path,\r\n Polyline\r\n} from '../util/graphic';\r\nimport PathProxy from 'zrender/src/core/PathProxy';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport { normalizeRadian } from 'zrender/src/contain/util';\r\nimport { cubicProjectPoint, quadraticProjectPoint } from 'zrender/src/core/curve';\r\nimport Element from 'zrender/src/Element';\r\nimport { defaults, retrieve2 } from 'zrender/src/core/util';\r\nimport { LabelLineOption, DisplayState, StatesOptionMixin } from '../util/types';\r\nimport Model from '../model/Model';\r\nimport { invert } from 'zrender/src/core/matrix';\r\nimport * as vector from 'zrender/src/core/vector';\r\nimport { DISPLAY_STATES, SPECIAL_STATES } from '../util/states';\r\n\r\nconst PI2 = Math.PI * 2;\r\nconst CMD = PathProxy.CMD;\r\n\r\nconst DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'] as const;\r\n\r\ntype CandidatePosition = typeof DEFAULT_SEARCH_SPACE[number];\r\n\r\nfunction getCandidateAnchor(\r\n pos: CandidatePosition,\r\n distance: number,\r\n rect: RectLike,\r\n outPt: Point,\r\n outDir: Point\r\n) {\r\n const width = rect.width;\r\n const height = rect.height;\r\n switch (pos) {\r\n case 'top':\r\n outPt.set(\r\n rect.x + width / 2,\r\n rect.y - distance\r\n );\r\n outDir.set(0, -1);\r\n break;\r\n case 'bottom':\r\n outPt.set(\r\n rect.x + width / 2,\r\n rect.y + height + distance\r\n );\r\n outDir.set(0, 1);\r\n break;\r\n case 'left':\r\n outPt.set(\r\n rect.x - distance,\r\n rect.y + height / 2\r\n );\r\n outDir.set(-1, 0);\r\n break;\r\n case 'right':\r\n outPt.set(\r\n rect.x + width + distance,\r\n rect.y + height / 2\r\n );\r\n outDir.set(1, 0);\r\n break;\r\n }\r\n}\r\n\r\n\r\nfunction projectPointToArc(\r\n cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise: boolean,\r\n x: number, y: number, out: number[]\r\n): number {\r\n x -= cx;\r\n y -= cy;\r\n const d = Math.sqrt(x * x + y * y);\r\n x /= d;\r\n y /= d;\r\n\r\n // Intersect point.\r\n const ox = x * r + cx;\r\n const oy = y * r + cy;\r\n\r\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\r\n // Is a circle\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n\r\n if (anticlockwise) {\r\n const tmp = startAngle;\r\n startAngle = normalizeRadian(endAngle);\r\n endAngle = normalizeRadian(tmp);\r\n }\r\n else {\r\n startAngle = normalizeRadian(startAngle);\r\n endAngle = normalizeRadian(endAngle);\r\n }\r\n if (startAngle > endAngle) {\r\n endAngle += PI2;\r\n }\r\n\r\n let angle = Math.atan2(y, x);\r\n if (angle < 0) {\r\n angle += PI2;\r\n }\r\n if ((angle >= startAngle && angle <= endAngle)\r\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) {\r\n // Project point is on the arc.\r\n out[0] = ox;\r\n out[1] = oy;\r\n return d - r;\r\n }\r\n\r\n const x1 = r * Math.cos(startAngle) + cx;\r\n const y1 = r * Math.sin(startAngle) + cy;\r\n\r\n const x2 = r * Math.cos(endAngle) + cx;\r\n const y2 = r * Math.sin(endAngle) + cy;\r\n\r\n const d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\r\n const d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\r\n\r\n if (d1 < d2) {\r\n out[0] = x1;\r\n out[1] = y1;\r\n return Math.sqrt(d1);\r\n }\r\n else {\r\n out[0] = x2;\r\n out[1] = y2;\r\n return Math.sqrt(d2);\r\n }\r\n}\r\n\r\nfunction projectPointToLine(\r\n x1: number, y1: number, x2: number, y2: number, x: number, y: number, out: number[], limitToEnds: boolean\r\n) {\r\n const dx = x - x1;\r\n const dy = y - y1;\r\n\r\n let dx1 = x2 - x1;\r\n let dy1 = y2 - y1;\r\n\r\n const lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n dx1 /= lineLen;\r\n dy1 /= lineLen;\r\n\r\n // dot product\r\n const projectedLen = dx * dx1 + dy * dy1;\r\n let t = projectedLen / lineLen;\r\n if (limitToEnds) {\r\n t = Math.min(Math.max(t, 0), 1);\r\n }\r\n t *= lineLen;\r\n const ox = out[0] = x1 + t * dx1;\r\n const oy = out[1] = y1 + t * dy1;\r\n\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n}\r\n\r\nfunction projectPointToRect(\r\n x1: number, y1: number, width: number, height: number, x: number, y: number, out: number[]\r\n): number {\r\n if (width < 0) {\r\n x1 = x1 + width;\r\n width = -width;\r\n }\r\n if (height < 0) {\r\n y1 = y1 + height;\r\n height = -height;\r\n }\r\n const x2 = x1 + width;\r\n const y2 = y1 + height;\r\n\r\n const ox = out[0] = Math.min(Math.max(x, x1), x2);\r\n const oy = out[1] = Math.min(Math.max(y, y1), y2);\r\n\r\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\r\n}\r\n\r\nconst tmpPt: number[] = [];\r\n\r\nfunction nearestPointOnRect(pt: Point, rect: RectLike, out: Point) {\r\n const dist = projectPointToRect(\r\n rect.x, rect.y, rect.width, rect.height,\r\n pt.x, pt.y, tmpPt\r\n );\r\n out.set(tmpPt[0], tmpPt[1]);\r\n return dist;\r\n}\r\n/**\r\n * Calculate min distance corresponding point.\r\n * This method won't evaluate if point is in the path.\r\n */\r\nfunction nearestPointOnPath(pt: Point, path: PathProxy, out: Point) {\r\n let xi = 0;\r\n let yi = 0;\r\n let x0 = 0;\r\n let y0 = 0;\r\n let x1;\r\n let y1;\r\n\r\n let minDist = Infinity;\r\n\r\n const data = path.data;\r\n const x = pt.x;\r\n const y = pt.y;\r\n\r\n for (let i = 0; i < data.length;) {\r\n const cmd = data[i++];\r\n\r\n if (i === 1) {\r\n xi = data[i];\r\n yi = data[i + 1];\r\n x0 = xi;\r\n y0 = yi;\r\n }\r\n\r\n let d = minDist;\r\n\r\n switch (cmd) {\r\n case CMD.M:\r\n // moveTo \u547D\u4EE4\u91CD\u65B0\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684 subpath, \u5E76\u4E14\u66F4\u65B0\u65B0\u7684\u8D77\u70B9\r\n // \u5728 closePath \u7684\u65F6\u5019\u4F7F\u7528\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n case CMD.L:\r\n d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.C:\r\n d = cubicProjectPoint(\r\n xi, yi,\r\n data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1],\r\n x, y, tmpPt\r\n );\r\n\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.Q:\r\n d = quadraticProjectPoint(\r\n xi, yi,\r\n data[i++], data[i++], data[i], data[i + 1],\r\n x, y, tmpPt\r\n );\r\n xi = data[i++];\r\n yi = data[i++];\r\n break;\r\n case CMD.A:\r\n // TODO Arc \u5224\u65AD\u7684\u5F00\u9500\u6BD4\u8F83\u5927\r\n const cx = data[i++];\r\n const cy = data[i++];\r\n const rx = data[i++];\r\n const ry = data[i++];\r\n const theta = data[i++];\r\n const dTheta = data[i++];\r\n // TODO Arc \u65CB\u8F6C\r\n i += 1;\r\n const anticlockwise = !!(1 - data[i++]);\r\n x1 = Math.cos(theta) * rx + cx;\r\n y1 = Math.sin(theta) * ry + cy;\r\n // \u4E0D\u662F\u76F4\u63A5\u4F7F\u7528 arc \u547D\u4EE4\r\n if (i <= 1) {\r\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u8D77\u70B9\u8FD8\u672A\u5B9A\u4E49\r\n x0 = x1;\r\n y0 = y1;\r\n }\r\n // zr \u4F7F\u7528scale\u6765\u6A21\u62DF\u692D\u5706, \u8FD9\u91CC\u4E5F\u5BF9x\u505A\u4E00\u5B9A\u7684\u7F29\u653E\r\n const _x = (x - cx) * ry / rx + cx;\r\n d = projectPointToArc(\r\n cx, cy, ry, theta, theta + dTheta, anticlockwise,\r\n _x, y, tmpPt\r\n );\r\n xi = Math.cos(theta + dTheta) * rx + cx;\r\n yi = Math.sin(theta + dTheta) * ry + cy;\r\n break;\r\n case CMD.R:\r\n x0 = xi = data[i++];\r\n y0 = yi = data[i++];\r\n const width = data[i++];\r\n const height = data[i++];\r\n d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\r\n break;\r\n case CMD.Z:\r\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\r\n\r\n xi = x0;\r\n yi = y0;\r\n break;\r\n }\r\n\r\n if (d < minDist) {\r\n minDist = d;\r\n out.set(tmpPt[0], tmpPt[1]);\r\n }\r\n }\r\n\r\n return minDist;\r\n}\r\n\r\n// Temporal variable for intermediate usage.\r\nconst pt0 = new Point();\r\nconst pt1 = new Point();\r\nconst pt2 = new Point();\r\nconst dir = new Point();\r\nconst dir2 = new Point();\r\n\r\n/**\r\n * Calculate a proper guide line based on the label position and graphic element definition\r\n * @param label\r\n * @param labelRect\r\n * @param target\r\n * @param targetRect\r\n */\r\nexport function updateLabelLinePoints(\r\n target: Element,\r\n labelLineModel: Model\r\n) {\r\n if (!target) {\r\n return;\r\n }\r\n\r\n const labelLine = target.getTextGuideLine();\r\n const label = target.getTextContent();\r\n // Needs to create text guide in each charts.\r\n if (!(label && labelLine)) {\r\n return;\r\n }\r\n\r\n const labelGuideConfig = target.textGuideLineConfig || {};\r\n\r\n const points = [[0, 0], [0, 0], [0, 0]];\r\n\r\n const searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\r\n const labelRect = label.getBoundingRect().clone();\r\n labelRect.applyTransform(label.getComputedTransform());\r\n\r\n let minDist = Infinity;\r\n const anchorPoint = labelGuideConfig.anchor;\r\n const targetTransform = target.getComputedTransform();\r\n const targetInversedTransform = targetTransform && invert([], targetTransform);\r\n const len = labelLineModel.get('length2') || 0;\r\n\r\n if (anchorPoint) {\r\n pt2.copy(anchorPoint);\r\n }\r\n for (let i = 0; i < searchSpace.length; i++) {\r\n const candidate = searchSpace[i];\r\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\r\n Point.scaleAndAdd(pt1, pt0, dir, len);\r\n\r\n // Transform to target coord space.\r\n pt1.transform(targetInversedTransform);\r\n\r\n // Note: getBoundingRect will ensure the `path` being created.\r\n const boundingRect = target.getBoundingRect();\r\n const dist = anchorPoint ? anchorPoint.distance(pt1)\r\n : (target instanceof Path\r\n ? nearestPointOnPath(pt1, target.path, pt2)\r\n : nearestPointOnRect(pt1, boundingRect, pt2));\r\n\r\n // TODO pt2 is in the path\r\n if (dist < minDist) {\r\n minDist = dist;\r\n // Transform back to global space.\r\n pt1.transform(targetTransform);\r\n pt2.transform(targetTransform);\r\n\r\n pt2.toArray(points[0]);\r\n pt1.toArray(points[1]);\r\n pt0.toArray(points[2]);\r\n }\r\n }\r\n\r\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\r\n\r\n labelLine.setShape({ points });\r\n}\r\n\r\n// Temporal variable for the limitTurnAngle function\r\nconst tmpArr: number[] = [];\r\nconst tmpProjPoint = new Point();\r\n/**\r\n * Reduce the line segment attached to the label to limit the turn angle between two segments.\r\n * @param linePoints\r\n * @param minTurnAngle Radian of minimum turn angle. 0 - 180\r\n */\r\nexport function limitTurnAngle(linePoints: number[][], minTurnAngle: number) {\r\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\r\n return;\r\n }\r\n minTurnAngle = minTurnAngle / 180 * Math.PI;\r\n // The line points can be\r\n // /pt1----pt2 (label)\r\n // /\r\n // pt0/\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n\r\n Point.sub(dir, pt0, pt1);\r\n Point.sub(dir2, pt2, pt1);\r\n\r\n const len1 = dir.len();\r\n const len2 = dir2.len();\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n\r\n const angleCos = dir.dot(dir2);\r\n const minTurnAngleCos = Math.cos(minTurnAngle);\r\n if (minTurnAngleCos < angleCos) { // Smaller than minTurnAngle\r\n // Calculate project point of pt0 on pt1-pt2\r\n const d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n // Calculate new projected length with limited minTurnAngle and get the new connect point\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle));\r\n // Limit the new calculated connect point between pt1 and pt2.\r\n const t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n}\r\n\r\n/**\r\n * Limit the angle of line and the surface\r\n * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite\r\n */\r\nexport function limitSurfaceAngle(linePoints: vector.VectorArray[], surfaceNormal: Point, maxSurfaceAngle: number) {\r\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\r\n return;\r\n }\r\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\r\n\r\n pt0.fromArray(linePoints[0]);\r\n pt1.fromArray(linePoints[1]);\r\n pt2.fromArray(linePoints[2]);\r\n\r\n Point.sub(dir, pt1, pt0);\r\n Point.sub(dir2, pt2, pt1);\r\n\r\n const len1 = dir.len();\r\n const len2 = dir2.len();\r\n\r\n if (len1 < 1e-3 || len2 < 1e-3) {\r\n return;\r\n }\r\n\r\n dir.scale(1 / len1);\r\n dir2.scale(1 / len2);\r\n\r\n const angleCos = dir.dot(surfaceNormal);\r\n const maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\r\n\r\n if (angleCos < maxSurfaceAngleCos) {\r\n // Calculate project point of pt0 on pt1-pt2\r\n const d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\r\n tmpProjPoint.fromArray(tmpArr);\r\n\r\n const HALF_PI = Math.PI / 2;\r\n const angle2 = Math.acos(dir2.dot(surfaceNormal));\r\n const newAngle = HALF_PI + angle2 - maxSurfaceAngle;\r\n if (newAngle >= HALF_PI) {\r\n // parallel\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n else {\r\n // Calculate new projected length with limited minTurnAngle and get the new connect point\r\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle));\r\n // Limit the new calculated connect point between pt1 and pt2.\r\n const t = pt2.x !== pt1.x\r\n ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x)\r\n : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\r\n if (isNaN(t)) {\r\n return;\r\n }\r\n\r\n if (t < 0) {\r\n Point.copy(tmpProjPoint, pt1);\r\n }\r\n else if (t > 1) {\r\n Point.copy(tmpProjPoint, pt2);\r\n }\r\n }\r\n\r\n tmpProjPoint.toArray(linePoints[1]);\r\n }\r\n}\r\n\r\n\r\ntype LabelLineModel = Model;\r\n\r\nfunction setLabelLineState(\r\n labelLine: Polyline,\r\n ignore: boolean,\r\n stateName: string,\r\n stateModel: Model\r\n) {\r\n const isNormal = stateName === 'normal';\r\n const stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);\r\n // Make sure display.\r\n stateObj.ignore = ignore;\r\n // Set smooth\r\n let smooth = stateModel.get('smooth');\r\n if (smooth && smooth === true) {\r\n smooth = 0.3;\r\n }\r\n stateObj.shape = stateObj.shape || {};\r\n if (smooth > 0) {\r\n (stateObj.shape as Polyline['shape']).smooth = smooth as number;\r\n }\r\n const styleObj = stateModel.getModel('lineStyle').getLineStyle();\r\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\r\n}\r\n\r\nfunction buildLabelLinePath(path: CanvasRenderingContext2D, shape: Polyline['shape']) {\r\n const smooth = shape.smooth as number;\r\n const points = shape.points;\r\n if (!points) {\r\n return;\r\n }\r\n path.moveTo(points[0][0], points[0][1]);\r\n if (smooth > 0 && points.length >= 3) {\r\n const len1 = vector.dist(points[0], points[1]);\r\n const len2 = vector.dist(points[1], points[2]);\r\n if (!len1 || !len2) {\r\n path.lineTo(points[1][0], points[1][1]);\r\n path.lineTo(points[2][0], points[2][1]);\r\n return;\r\n }\r\n\r\n const moveLen = Math.min(len1, len2) * smooth;\r\n\r\n const midPoint0 = vector.lerp([], points[1], points[0], moveLen / len1);\r\n const midPoint2 = vector.lerp([], points[1], points[2], moveLen / len2);\r\n\r\n const midPoint1 = vector.lerp([], midPoint0, midPoint2, 0.5);\r\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\r\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\r\n }\r\n else {\r\n for (let i = 1; i < points.length; i++) {\r\n path.lineTo(points[i][0], points[i][1]);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Create a label line if necessary and set it's style.\r\n */\r\nexport function setLabelLineStyle(\r\n targetEl: Element,\r\n statesModels: Record,\r\n defaultStyle?: Polyline['style']\r\n) {\r\n let labelLine = targetEl.getTextGuideLine();\r\n const label = targetEl.getTextContent();\r\n if (!label) {\r\n // Not show label line if there is no label.\r\n if (labelLine) {\r\n targetEl.removeTextGuideLine();\r\n }\r\n return;\r\n }\r\n\r\n const normalModel = statesModels.normal;\r\n const showNormal = normalModel.get('show');\r\n const labelIgnoreNormal = label.ignore;\r\n\r\n for (let i = 0; i < DISPLAY_STATES.length; i++) {\r\n const stateName = DISPLAY_STATES[i];\r\n const stateModel = statesModels[stateName];\r\n const isNormal = stateName === 'normal';\r\n if (stateModel) {\r\n const stateShow = stateModel.get('show');\r\n const isLabelIgnored = isNormal\r\n ? labelIgnoreNormal\r\n : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\r\n if (isLabelIgnored // Not show when label is not shown in this state.\r\n || !retrieve2(stateShow, showNormal) // Use normal state by default if not set.\r\n ) {\r\n const stateObj = isNormal ? labelLine : (labelLine && labelLine.states[stateName]);\r\n if (stateObj) {\r\n stateObj.ignore = true;\r\n }\r\n if (!!labelLine) {\r\n setLabelLineState(labelLine, true, stateName, stateModel);\r\n }\r\n continue;\r\n }\r\n // Create labelLine if not exists\r\n if (!labelLine) {\r\n labelLine = new Polyline();\r\n targetEl.setTextGuideLine(labelLine);\r\n // Reset state of normal because it's new created.\r\n // NOTE: NORMAL should always been the first!\r\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\r\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\r\n }\r\n\r\n // Use same state proxy.\r\n if (targetEl.stateProxy) {\r\n labelLine.stateProxy = targetEl.stateProxy;\r\n }\r\n }\r\n\r\n setLabelLineState(labelLine, false, stateName, stateModel);\r\n }\r\n }\r\n\r\n if (labelLine) {\r\n defaults(labelLine.style, defaultStyle);\r\n // Not fill.\r\n labelLine.style.fill = null;\r\n\r\n const showAbove = normalModel.get('showAbove');\r\n\r\n const labelLineConfig = (targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {});\r\n labelLineConfig.showAbove = showAbove || false;\r\n\r\n // Custom the buildPath.\r\n labelLine.buildPath = buildLabelLinePath;\r\n }\r\n}\r\n\r\n\r\nexport function getLabelLineStatesModels(\r\n itemModel: Model & Partial>>,\r\n labelLineName?: LabelName\r\n): Record {\r\n labelLineName = (labelLineName || 'labelLine') as LabelName;\r\n const statesModels = {\r\n normal: itemModel.getModel(labelLineName) as LabelLineModel\r\n } as Record;\r\n for (let i = 0; i < SPECIAL_STATES.length; i++) {\r\n const stateName = SPECIAL_STATES[i];\r\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\r\n }\r\n return statesModels;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ZRText from 'zrender/src/graphic/Text';\r\nimport { LabelLayoutOption } from '../util/types';\r\nimport { BoundingRect, OrientedBoundingRect, Polyline } from '../util/graphic';\r\nimport type Element from 'zrender/src/Element';\r\n\r\ninterface LabelLayoutListPrepareInput {\r\n label: ZRText\r\n labelLine?: Polyline\r\n computedLayoutOption?: LabelLayoutOption\r\n priority: number\r\n defaultAttr: {\r\n ignore: boolean\r\n labelGuideIgnore?: boolean\r\n }\r\n}\r\n\r\nexport interface LabelLayoutInfo {\r\n label: ZRText\r\n labelLine: Polyline\r\n priority: number\r\n rect: BoundingRect // Global rect\r\n localRect: BoundingRect\r\n obb?: OrientedBoundingRect // Only available when axisAligned is true\r\n axisAligned: boolean\r\n layoutOption: LabelLayoutOption\r\n defaultAttr: {\r\n ignore: boolean\r\n labelGuideIgnore?: boolean\r\n }\r\n transform: number[]\r\n}\r\n\r\nexport function prepareLayoutList(input: LabelLayoutListPrepareInput[]): LabelLayoutInfo[] {\r\n const list: LabelLayoutInfo[] = [];\r\n\r\n for (let i = 0; i < input.length; i++) {\r\n const rawItem = input[i];\r\n if (rawItem.defaultAttr.ignore) {\r\n continue;\r\n }\r\n\r\n const label = rawItem.label;\r\n const transform = label.getComputedTransform();\r\n // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el.\r\n const localRect = label.getBoundingRect();\r\n const isAxisAligned = !transform || (transform[1] < 1e-5 && transform[2] < 1e-5);\r\n\r\n const minMargin = label.style.margin || 0;\r\n const globalRect = localRect.clone();\r\n globalRect.applyTransform(transform);\r\n globalRect.x -= minMargin / 2;\r\n globalRect.y -= minMargin / 2;\r\n globalRect.width += minMargin;\r\n globalRect.height += minMargin;\r\n\r\n const obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\r\n\r\n list.push({\r\n label,\r\n labelLine: rawItem.labelLine,\r\n rect: globalRect,\r\n localRect,\r\n obb,\r\n priority: rawItem.priority,\r\n defaultAttr: rawItem.defaultAttr,\r\n layoutOption: rawItem.computedLayoutOption,\r\n axisAligned: isAxisAligned,\r\n transform\r\n });\r\n }\r\n return list;\r\n}\r\n\r\nfunction shiftLayout(\r\n list: Pick[],\r\n xyDim: 'x' | 'y',\r\n sizeDim: 'width' | 'height',\r\n minBound: number,\r\n maxBound: number,\r\n balanceShift: boolean\r\n) {\r\n const len = list.length;\r\n\r\n if (len < 2) {\r\n return;\r\n }\r\n\r\n list.sort(function (a, b) {\r\n return a.rect[xyDim] - b.rect[xyDim];\r\n });\r\n\r\n let lastPos = 0;\r\n let delta;\r\n let adjusted = false;\r\n\r\n const shifts = [];\r\n let totalShifts = 0;\r\n for (let i = 0; i < len; i++) {\r\n const item = list[i];\r\n const rect = item.rect;\r\n delta = rect[xyDim] - lastPos;\r\n if (delta < 0) {\r\n // shiftForward(i, len, -delta);\r\n rect[xyDim] -= delta;\r\n item.label[xyDim] -= delta;\r\n adjusted = true;\r\n }\r\n const shift = Math.max(-delta, 0);\r\n shifts.push(shift);\r\n totalShifts += shift;\r\n\r\n lastPos = rect[xyDim] + rect[sizeDim];\r\n }\r\n if (totalShifts > 0 && balanceShift) {\r\n // Shift back to make the distribution more equally.\r\n shiftList(-totalShifts / len, 0, len);\r\n }\r\n\r\n // TODO bleedMargin?\r\n const first = list[0];\r\n const last = list[len - 1];\r\n let minGap: number;\r\n let maxGap: number;\r\n updateMinMaxGap();\r\n\r\n // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.\r\n minGap < 0 && squeezeGaps(-minGap, 0.8);\r\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\r\n updateMinMaxGap();\r\n takeBoundsGap(minGap, maxGap, 1);\r\n takeBoundsGap(maxGap, minGap, -1);\r\n\r\n // Handle bailout when there is not enough space.\r\n updateMinMaxGap();\r\n\r\n if (minGap < 0) {\r\n squeezeWhenBailout(-minGap);\r\n }\r\n if (maxGap < 0) {\r\n squeezeWhenBailout(maxGap);\r\n }\r\n\r\n function updateMinMaxGap() {\r\n minGap = first.rect[xyDim] - minBound;\r\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\r\n }\r\n\r\n function takeBoundsGap(gapThisBound: number, gapOtherBound: number, moveDir: 1 | -1) {\r\n if (gapThisBound < 0) {\r\n // Move from other gap if can.\r\n const moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\r\n if (moveFromMaxGap > 0) {\r\n shiftList(moveFromMaxGap * moveDir, 0, len);\r\n const remained = moveFromMaxGap + gapThisBound;\r\n if (remained < 0) {\r\n squeezeGaps(-remained * moveDir, 1);\r\n }\r\n }\r\n else {\r\n squeezeGaps(-gapThisBound * moveDir, 1);\r\n }\r\n }\r\n }\r\n\r\n function shiftList(delta: number, start: number, end: number) {\r\n if (delta !== 0) {\r\n adjusted = true;\r\n }\r\n for (let i = start; i < end; i++) {\r\n const item = list[i];\r\n const rect = item.rect;\r\n rect[xyDim] += delta;\r\n item.label[xyDim] += delta;\r\n }\r\n }\r\n\r\n // Squeeze gaps if the labels exceed margin.\r\n function squeezeGaps(delta: number, maxSqeezePercent: number) {\r\n const gaps: number[] = [];\r\n let totalGaps = 0;\r\n for (let i = 1; i < len; i++) {\r\n const prevItemRect = list[i - 1].rect;\r\n const gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\r\n gaps.push(gap);\r\n totalGaps += gap;\r\n }\r\n if (!totalGaps) {\r\n return;\r\n }\r\n\r\n const squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\r\n\r\n if (delta > 0) {\r\n for (let i = 0; i < len - 1; i++) {\r\n // Distribute the shift delta to all gaps.\r\n const movement = gaps[i] * squeezePercent;\r\n // Forward\r\n shiftList(movement, 0, i + 1);\r\n }\r\n }\r\n else {\r\n // Backward\r\n for (let i = len - 1; i > 0; i--) {\r\n // Distribute the shift delta to all gaps.\r\n const movement = gaps[i - 1] * squeezePercent;\r\n shiftList(-movement, i, len);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Squeeze to allow overlap if there is no more space available.\r\n * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.\r\n */\r\n function squeezeWhenBailout(delta: number) {\r\n const dir = delta < 0 ? -1 : 1;\r\n delta = Math.abs(delta);\r\n const moveForEachLabel = Math.ceil(delta / (len - 1));\r\n\r\n for (let i = 0; i < len - 1; i++) {\r\n if (dir > 0) {\r\n // Forward\r\n shiftList(moveForEachLabel, 0, i + 1);\r\n }\r\n else {\r\n // Backward\r\n shiftList(-moveForEachLabel, len - i - 1, len);\r\n }\r\n\r\n delta -= moveForEachLabel;\r\n\r\n if (delta <= 0) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n return adjusted;\r\n}\r\n\r\n/**\r\n * Adjust labels on x direction to avoid overlap.\r\n */\r\nexport function shiftLayoutOnX(\r\n list: Pick[],\r\n leftBound: number,\r\n rightBound: number,\r\n // If average the shifts on all labels and add them to 0\r\n // TODO: Not sure if should enable it.\r\n // Pros: The angle of lines will distribute more equally\r\n // Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\r\n balanceShift?: boolean\r\n): boolean {\r\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\r\n}\r\n\r\n/**\r\n * Adjust labels on y direction to avoid overlap.\r\n */\r\nexport function shiftLayoutOnY(\r\n list: Pick[],\r\n topBound: number,\r\n bottomBound: number,\r\n // If average the shifts on all labels and add them to 0\r\n balanceShift?: boolean\r\n): boolean {\r\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\r\n}\r\n\r\nexport function hideOverlap(labelList: LabelLayoutInfo[]) {\r\n const displayedLabels: LabelLayoutInfo[] = [];\r\n\r\n // TODO, render overflow visible first, put in the displayedLabels.\r\n labelList.sort(function (a, b) {\r\n return b.priority - a.priority;\r\n });\r\n\r\n const globalRect = new BoundingRect(0, 0, 0, 0);\r\n\r\n function hideEl(el: Element) {\r\n if (!el.ignore) {\r\n // Show on emphasis.\r\n const emphasisState = el.ensureState('emphasis');\r\n if (emphasisState.ignore == null) {\r\n emphasisState.ignore = false;\r\n }\r\n }\r\n\r\n el.ignore = true;\r\n }\r\n\r\n for (let i = 0; i < labelList.length; i++) {\r\n const labelItem = labelList[i];\r\n const isAxisAligned = labelItem.axisAligned;\r\n const localRect = labelItem.localRect;\r\n const transform = labelItem.transform;\r\n const label = labelItem.label;\r\n const labelLine = labelItem.labelLine;\r\n globalRect.copy(labelItem.rect);\r\n // Add a threshold because layout may be aligned precisely.\r\n globalRect.width -= 0.1;\r\n globalRect.height -= 0.1;\r\n globalRect.x += 0.05;\r\n globalRect.y += 0.05;\r\n\r\n let obb = labelItem.obb;\r\n let overlapped = false;\r\n for (let j = 0; j < displayedLabels.length; j++) {\r\n const existsTextCfg = displayedLabels[j];\r\n // Fast rejection.\r\n if (!globalRect.intersect(existsTextCfg.rect)) {\r\n continue;\r\n }\r\n\r\n if (isAxisAligned && existsTextCfg.axisAligned) { // Is overlapped\r\n overlapped = true;\r\n break;\r\n }\r\n\r\n if (!existsTextCfg.obb) { // If self is not axis aligned. But other is.\r\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\r\n }\r\n\r\n if (!obb) { // If self is axis aligned. But other is not.\r\n obb = new OrientedBoundingRect(localRect, transform);\r\n }\r\n\r\n if (obb.intersect(existsTextCfg.obb)) {\r\n overlapped = true;\r\n break;\r\n }\r\n }\r\n\r\n // TODO Callback to determine if this overlap should be handled?\r\n if (overlapped) {\r\n hideEl(label);\r\n labelLine && hideEl(labelLine);\r\n }\r\n else {\r\n label.attr('ignore', labelItem.defaultAttr.ignore);\r\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\r\n\r\n displayedLabels.push(labelItem);\r\n }\r\n }\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// TODO: move labels out of viewport.\r\n\r\nimport {\r\n Text as ZRText,\r\n BoundingRect,\r\n Polyline,\r\n updateProps,\r\n initProps,\r\n isElementRemoved\r\n} from '../util/graphic';\r\nimport { getECData } from '../util/innerStore';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport {\r\n ZRTextAlign,\r\n ZRTextVerticalAlign,\r\n LabelLayoutOption,\r\n LabelLayoutOptionCallback,\r\n LabelLayoutOptionCallbackParams,\r\n LabelLineOption,\r\n Dictionary,\r\n ECElement,\r\n SeriesDataType\r\n} from '../util/types';\r\nimport { parsePercent } from '../util/number';\r\nimport ChartView from '../view/Chart';\r\nimport Element, { ElementTextConfig } from 'zrender/src/Element';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport Transformable from 'zrender/src/core/Transformable';\r\nimport { updateLabelLinePoints, setLabelLineStyle, getLabelLineStatesModels } from './labelGuideHelper';\r\nimport SeriesModel from '../model/Series';\r\nimport { makeInner } from '../util/model';\r\nimport { retrieve2, each, keys, isFunction, filter, indexOf } from 'zrender/src/core/util';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport Model from '../model/Model';\r\nimport { prepareLayoutList, hideOverlap, shiftLayoutOnX, shiftLayoutOnY } from './labelLayoutHelper';\r\nimport { labelInner, animateLabelValue } from './labelStyle';\r\nimport { normalizeRadian } from 'zrender/src/contain/util';\r\n\r\ninterface LabelDesc {\r\n label: ZRText\r\n labelLine: Polyline\r\n\r\n seriesModel: SeriesModel\r\n // Can be null if label doesn't represent any data.\r\n dataIndex?: number\r\n // Can be null if label doesn't represent any data.\r\n dataType?: SeriesDataType\r\n\r\n layoutOption: LabelLayoutOptionCallback | LabelLayoutOption\r\n computedLayoutOption: LabelLayoutOption\r\n\r\n hostRect: RectLike\r\n rect: RectLike\r\n\r\n priority: number\r\n\r\n defaultAttr: SavedLabelAttr\r\n}\r\n\r\ninterface SavedLabelAttr {\r\n ignore: boolean\r\n labelGuideIgnore: boolean\r\n\r\n x: number\r\n y: number\r\n scaleX: number\r\n scaleY: number\r\n rotation: number\r\n\r\n style: {\r\n align: ZRTextAlign\r\n verticalAlign: ZRTextVerticalAlign\r\n width: number\r\n height: number\r\n fontSize: number | string\r\n\r\n x: number\r\n y: number\r\n }\r\n\r\n cursor: string\r\n\r\n // Configuration in attached element\r\n attachedPos: ElementTextConfig['position']\r\n attachedRot: ElementTextConfig['rotation']\r\n\r\n}\r\n\r\nfunction cloneArr(points: number[][]) {\r\n if (points) {\r\n const newPoints = [];\r\n for (let i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice());\r\n }\r\n return newPoints;\r\n }\r\n}\r\n\r\nfunction prepareLayoutCallbackParams(labelItem: LabelDesc, hostEl?: Element): LabelLayoutOptionCallbackParams {\r\n const label = labelItem.label;\r\n const labelLine = hostEl && hostEl.getTextGuideLine();\r\n return {\r\n dataIndex: labelItem.dataIndex,\r\n dataType: labelItem.dataType,\r\n seriesIndex: labelItem.seriesModel.seriesIndex,\r\n text: labelItem.label.style.text,\r\n rect: labelItem.hostRect,\r\n labelRect: labelItem.rect,\r\n // x: labelAttr.x,\r\n // y: labelAttr.y,\r\n align: label.style.align,\r\n verticalAlign: label.style.verticalAlign,\r\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\r\n };\r\n}\r\n\r\nconst LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'] as const;\r\n\r\nconst dummyTransformable = new Transformable();\r\n\r\nconst labelLayoutInnerStore = makeInner<{\r\n oldLayout: {\r\n x: number,\r\n y: number,\r\n rotation: number\r\n },\r\n oldLayoutSelect?: {\r\n x?: number,\r\n y?: number,\r\n rotation?: number\r\n },\r\n oldLayoutEmphasis?: {\r\n x?: number,\r\n y?: number,\r\n rotation?: number\r\n },\r\n\r\n needsUpdateLabelLine?: boolean\r\n}, ZRText>();\r\n\r\nconst labelLineAnimationStore = makeInner<{\r\n oldLayout: {\r\n points: number[][]\r\n }\r\n}, Polyline>();\r\n\r\ntype LabelLineOptionMixin = {\r\n labelLine: LabelLineOption,\r\n emphasis: { labelLine: LabelLineOption }\r\n};\r\n\r\nfunction extendWithKeys(target: Dictionary, source: Dictionary, keys: string[]) {\r\n for (let i = 0; i < keys.length; i++) {\r\n const key = keys[i];\r\n if (source[key] != null) {\r\n target[key] = source[key];\r\n }\r\n }\r\n}\r\n\r\nconst LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\r\n\r\nclass LabelManager {\r\n\r\n private _labelList: LabelDesc[] = [];\r\n private _chartViewList: ChartView[] = [];\r\n\r\n constructor() {}\r\n\r\n clearLabels() {\r\n this._labelList = [];\r\n this._chartViewList = [];\r\n }\r\n\r\n /**\r\n * Add label to manager\r\n */\r\n private _addLabel(\r\n dataIndex: number | null | undefined,\r\n dataType: SeriesDataType | null | undefined,\r\n seriesModel: SeriesModel,\r\n label: ZRText,\r\n layoutOption: LabelDesc['layoutOption']\r\n ) {\r\n const labelStyle = label.style;\r\n const hostEl = label.__hostTarget;\r\n const textConfig = hostEl.textConfig || {};\r\n\r\n // TODO: If label is in other state.\r\n const labelTransform = label.getComputedTransform();\r\n const labelRect = label.getBoundingRect().plain();\r\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\r\n\r\n if (labelTransform) {\r\n dummyTransformable.setLocalTransform(labelTransform);\r\n }\r\n else {\r\n // Identity transform.\r\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation =\r\n dummyTransformable.originX = dummyTransformable.originY = 0;\r\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\r\n }\r\n\r\n dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);\r\n\r\n const host = label.__hostTarget;\r\n let hostRect;\r\n if (host) {\r\n hostRect = host.getBoundingRect().plain();\r\n const transform = host.getComputedTransform();\r\n BoundingRect.applyTransform(hostRect, hostRect, transform);\r\n }\r\n\r\n const labelGuide = hostRect && host.getTextGuideLine();\r\n\r\n this._labelList.push({\r\n label,\r\n labelLine: labelGuide,\r\n\r\n seriesModel,\r\n dataIndex,\r\n dataType,\r\n\r\n layoutOption,\r\n computedLayoutOption: null,\r\n\r\n rect: labelRect,\r\n\r\n hostRect,\r\n\r\n // Label with lower priority will be hidden when overlapped\r\n // Use rect size as default priority\r\n priority: hostRect ? hostRect.width * hostRect.height : 0,\r\n\r\n // Save default label attributes.\r\n // For restore if developers want get back to default value in callback.\r\n defaultAttr: {\r\n ignore: label.ignore,\r\n labelGuideIgnore: labelGuide && labelGuide.ignore,\r\n\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n scaleX: dummyTransformable.scaleX,\r\n scaleY: dummyTransformable.scaleY,\r\n rotation: dummyTransformable.rotation,\r\n\r\n style: {\r\n x: labelStyle.x,\r\n y: labelStyle.y,\r\n\r\n align: labelStyle.align,\r\n verticalAlign: labelStyle.verticalAlign,\r\n width: labelStyle.width,\r\n height: labelStyle.height,\r\n\r\n fontSize: labelStyle.fontSize\r\n },\r\n\r\n cursor: label.cursor,\r\n\r\n attachedPos: textConfig.position,\r\n attachedRot: textConfig.rotation\r\n }\r\n });\r\n }\r\n\r\n addLabelsOfSeries(chartView: ChartView) {\r\n this._chartViewList.push(chartView);\r\n\r\n const seriesModel = chartView.__model;\r\n\r\n const layoutOption = seriesModel.get('labelLayout');\r\n\r\n /**\r\n * Ignore layouting if it's not specified anything.\r\n */\r\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\r\n return;\r\n }\r\n\r\n chartView.group.traverse((child) => {\r\n if (child.ignore) {\r\n return true; // Stop traverse descendants.\r\n }\r\n\r\n // Only support label being hosted on graphic elements.\r\n const textEl = child.getTextContent();\r\n const ecData = getECData(child);\r\n // Can only attach the text on the element with dataIndex\r\n if (textEl && !(textEl as ECElement).disableLabelLayout) {\r\n this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\r\n }\r\n });\r\n }\r\n\r\n updateLayoutConfig(api: ExtensionAPI) {\r\n const width = api.getWidth();\r\n const height = api.getHeight();\r\n\r\n function createDragHandler(el: Element, labelLineModel: Model) {\r\n return function () {\r\n updateLabelLinePoints(el, labelLineModel);\r\n };\r\n }\r\n for (let i = 0; i < this._labelList.length; i++) {\r\n const labelItem = this._labelList[i];\r\n const label = labelItem.label;\r\n const hostEl = label.__hostTarget;\r\n const defaultLabelAttr = labelItem.defaultAttr;\r\n let layoutOption;\r\n // TODO A global layout option?\r\n if (isFunction(labelItem.layoutOption)) {\r\n layoutOption = labelItem.layoutOption(\r\n prepareLayoutCallbackParams(labelItem, hostEl)\r\n );\r\n }\r\n else {\r\n layoutOption = labelItem.layoutOption;\r\n }\r\n\r\n layoutOption = layoutOption || {};\r\n labelItem.computedLayoutOption = layoutOption;\r\n\r\n const degreeToRadian = Math.PI / 180;\r\n // TODO hostEl should always exists.\r\n // Or label should not have parent because the x, y is all in global space.\r\n if (hostEl) {\r\n hostEl.setTextConfig({\r\n // Force to set local false.\r\n local: false,\r\n // Ignore position and rotation config on the host el if x or y is changed.\r\n position: (layoutOption.x != null || layoutOption.y != null)\r\n ? null : defaultLabelAttr.attachedPos,\r\n // Ignore rotation config on the host el if rotation is changed.\r\n rotation: layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\r\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\r\n });\r\n }\r\n let needsUpdateLabelLine = false;\r\n if (layoutOption.x != null) {\r\n // TODO width of chart view.\r\n label.x = parsePercent(layoutOption.x, width);\r\n label.setStyle('x', 0); // Ignore movement in style. TODO: origin.\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.x = defaultLabelAttr.x;\r\n label.setStyle('x', defaultLabelAttr.style.x);\r\n }\r\n\r\n if (layoutOption.y != null) {\r\n // TODO height of chart view.\r\n label.y = parsePercent(layoutOption.y, height);\r\n label.setStyle('y', 0); // Ignore movement in style.\r\n needsUpdateLabelLine = true;\r\n }\r\n else {\r\n label.y = defaultLabelAttr.y;\r\n label.setStyle('y', defaultLabelAttr.style.y);\r\n }\r\n\r\n if (layoutOption.labelLinePoints) {\r\n const guideLine = hostEl.getTextGuideLine();\r\n if (guideLine) {\r\n guideLine.setShape({ points: layoutOption.labelLinePoints });\r\n // Not update\r\n needsUpdateLabelLine = false;\r\n }\r\n }\r\n\r\n const labelLayoutStore = labelLayoutInnerStore(label);\r\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\r\n\r\n label.rotation = layoutOption.rotate != null\r\n ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\r\n\r\n label.scaleX = defaultLabelAttr.scaleX;\r\n label.scaleY = defaultLabelAttr.scaleY;\r\n\r\n for (let k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\r\n const key = LABEL_OPTION_TO_STYLE_KEYS[k];\r\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\r\n }\r\n\r\n\r\n if (layoutOption.draggable) {\r\n label.draggable = true;\r\n label.cursor = 'move';\r\n if (hostEl) {\r\n let hostModel: Model =\r\n labelItem.seriesModel as SeriesModel;\r\n if (labelItem.dataIndex != null) {\r\n const data = labelItem.seriesModel.getData(labelItem.dataType);\r\n hostModel = data.getItemModel(labelItem.dataIndex);\r\n }\r\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\r\n }\r\n }\r\n else {\r\n // TODO Other drag functions?\r\n label.off('drag');\r\n label.cursor = defaultLabelAttr.cursor;\r\n }\r\n }\r\n }\r\n\r\n layout(api: ExtensionAPI) {\r\n const width = api.getWidth();\r\n const height = api.getHeight();\r\n\r\n const labelList = prepareLayoutList(this._labelList);\r\n const labelsNeedsAdjustOnX = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftX';\r\n });\r\n const labelsNeedsAdjustOnY = filter(labelList, function (item) {\r\n return item.layoutOption.moveOverlap === 'shiftY';\r\n });\r\n\r\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\r\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\r\n\r\n const labelsNeedsHideOverlap = filter(labelList, function (item) {\r\n return item.layoutOption.hideOverlap;\r\n });\r\n\r\n hideOverlap(labelsNeedsHideOverlap);\r\n }\r\n\r\n /**\r\n * Process all labels. Not only labels with layoutOption.\r\n */\r\n processLabelsOverall() {\r\n each(this._chartViewList, (chartView) => {\r\n const seriesModel = chartView.__model;\r\n const ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\r\n const animationEnabled = seriesModel.isAnimationEnabled();\r\n\r\n chartView.group.traverse((child) => {\r\n if (child.ignore && !(child as ECElement).forceLabelAnimation) {\r\n return true; // Stop traverse descendants.\r\n }\r\n\r\n let needsUpdateLabelLine = !ignoreLabelLineUpdate;\r\n const label = child.getTextContent();\r\n if (!needsUpdateLabelLine && label) {\r\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\r\n }\r\n if (needsUpdateLabelLine) {\r\n this._updateLabelLine(child, seriesModel);\r\n }\r\n\r\n if (animationEnabled) {\r\n this._animateLabels(child, seriesModel);\r\n }\r\n });\r\n });\r\n }\r\n\r\n private _updateLabelLine(el: Element, seriesModel: SeriesModel) {\r\n // Only support label being hosted on graphic elements.\r\n const textEl = el.getTextContent();\r\n // Update label line style.\r\n const ecData = getECData(el);\r\n const dataIndex = ecData.dataIndex;\r\n\r\n // Only support labelLine on the labels represent data.\r\n if (textEl && dataIndex != null) {\r\n const data = seriesModel.getData(ecData.dataType);\r\n const itemModel = data.getItemModel(dataIndex);\r\n\r\n const defaultStyle: PathStyleProps = {};\r\n const visualStyle = data.getItemVisual(dataIndex, 'style');\r\n if (visualStyle) {\r\n const visualType = data.getVisual('drawType');\r\n // Default to be same with main color\r\n defaultStyle.stroke = visualStyle[visualType];\r\n }\r\n const labelLineModel = itemModel.getModel('labelLine');\r\n\r\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\r\n\r\n updateLabelLinePoints(el, labelLineModel);\r\n }\r\n }\r\n\r\n private _animateLabels(el: Element, seriesModel: SeriesModel) {\r\n const textEl = el.getTextContent();\r\n const guideLine = el.getTextGuideLine();\r\n // Animate\r\n if (textEl\r\n // `forceLabelAnimation` has the highest priority\r\n && ((el as ECElement).forceLabelAnimation\r\n || !textEl.ignore\r\n && !textEl.invisible\r\n && !(el as ECElement).disableLabelAnimation\r\n && !isElementRemoved(el)\r\n )\r\n ) {\r\n const layoutStore = labelLayoutInnerStore(textEl);\r\n const oldLayout = layoutStore.oldLayout;\r\n const ecData = getECData(el);\r\n const dataIndex = ecData.dataIndex;\r\n const newProps = {\r\n x: textEl.x,\r\n y: textEl.y,\r\n rotation: textEl.rotation\r\n };\r\n const data = seriesModel.getData(ecData.dataType);\r\n\r\n if (!oldLayout) {\r\n textEl.attr(newProps);\r\n // Disable fade in animation if value animation is enabled.\r\n if (!labelInner(textEl).valueAnimation) {\r\n const oldOpacity = retrieve2(textEl.style.opacity, 1);\r\n // Fade in animation\r\n textEl.style.opacity = 0;\r\n initProps(textEl, {\r\n style: { opacity: oldOpacity }\r\n }, seriesModel, dataIndex);\r\n }\r\n }\r\n else {\r\n textEl.attr(oldLayout);\r\n\r\n // Make sure the animation from is in the right status.\r\n const prevStates = el.prevStates;\r\n if (prevStates) {\r\n if (indexOf(prevStates, 'select') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutSelect);\r\n }\r\n if (indexOf(prevStates, 'emphasis') >= 0) {\r\n textEl.attr(layoutStore.oldLayoutEmphasis);\r\n }\r\n }\r\n updateProps(textEl, newProps, seriesModel, dataIndex);\r\n }\r\n layoutStore.oldLayout = newProps;\r\n\r\n if (textEl.states.select) {\r\n const layoutSelect = layoutStore.oldLayoutSelect = {};\r\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\r\n }\r\n\r\n if (textEl.states.emphasis) {\r\n const layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\r\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\r\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\r\n }\r\n\r\n animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel);\r\n }\r\n\r\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\r\n const layoutStore = labelLineAnimationStore(guideLine);\r\n const oldLayout = layoutStore.oldLayout;\r\n const newLayout = { points: guideLine.shape.points };\r\n if (!oldLayout) {\r\n guideLine.setShape(newLayout);\r\n guideLine.style.strokePercent = 0;\r\n initProps(guideLine, {\r\n style: { strokePercent: 1 }\r\n }, seriesModel);\r\n }\r\n else {\r\n guideLine.attr({ shape: oldLayout });\r\n updateProps(guideLine, {\r\n shape: newLayout\r\n }, seriesModel);\r\n }\r\n\r\n layoutStore.oldLayout = newLayout;\r\n }\r\n }\r\n}\r\n\r\n\r\nexport default LabelManager;\r\n\r\n", "\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../extension';\r\nimport { makeInner } from '../util/model';\r\nimport LabelManager from './LabelManager';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\n\r\nconst getLabelManager = makeInner<{ labelManager: LabelManager }, ExtensionAPI>();\r\nexport function installLabelLayout(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerUpdateLifecycle('series:beforeupdate', (ecModel, api, params) => {\r\n // TODO api provide an namespace that can save stuff per instance\r\n let labelManager = getLabelManager(api).labelManager;\r\n if (!labelManager) {\r\n labelManager = getLabelManager(api).labelManager = new LabelManager();\r\n }\r\n labelManager.clearLabels();\r\n });\r\n\r\n registers.registerUpdateLifecycle('series:layoutlabels', (ecModel, api, params) => {\r\n const labelManager = getLabelManager(api).labelManager;\r\n\r\n params.updatedSeries.forEach(series => {\r\n labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series));\r\n });\r\n labelManager.updateLayoutConfig(api);\r\n labelManager.layout(api);\r\n labelManager.processLabelsOverall();\r\n });\r\n}", "import { PathRebuilder } from '../core/PathProxy';\nimport { isAroundZero } from './helper';\n\nconst mathSin = Math.sin;\nconst mathCos = Math.cos;\nconst PI = Math.PI;\nconst PI2 = Math.PI * 2;\nconst degree = 180 / PI;\n\n\nexport default class SVGPathRebuilder implements PathRebuilder {\n private _d: (string | number)[]\n private _str: string\n private _invalid: boolean\n\n // If is start of subpath\n private _start: boolean\n private _p: number\n\n reset(precision?: number) {\n this._start = true;\n this._d = [];\n this._str = '';\n\n this._p = Math.pow(10, precision || 4);\n }\n moveTo(x: number, y: number) {\n this._add('M', x, y);\n }\n lineTo(x: number, y: number) {\n this._add('L', x, y);\n }\n bezierCurveTo(x: number, y: number, x2: number, y2: number, x3: number, y3: number) {\n this._add('C', x, y, x2, y2, x3, y3);\n }\n quadraticCurveTo(x: number, y: number, x2: number, y2: number) {\n this._add('Q', x, y, x2, y2);\n }\n arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise: boolean) {\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\n }\n ellipse(\n cx: number, cy: number,\n rx: number, ry: number,\n psi: number,\n startAngle: number,\n endAngle: number,\n anticlockwise: boolean\n ) {\n let dTheta = endAngle - startAngle;\n const clockwise = !anticlockwise;\n\n const dThetaPositive = Math.abs(dTheta);\n const isCircle = isAroundZero(dThetaPositive - PI2)\n || (clockwise ? dTheta >= PI2 : -dTheta >= PI2);\n\n // Mapping to 0~2PI\n const unifiedTheta = dTheta > 0 ? dTheta % PI2 : (dTheta % PI2 + PI2);\n\n let large = false;\n if (isCircle) {\n large = true;\n }\n else if (isAroundZero(dThetaPositive)) {\n large = false;\n }\n else {\n large = (unifiedTheta >= PI) === !!clockwise;\n }\n\n const x0 = cx + rx * mathCos(startAngle);\n const y0 = cy + ry * mathSin(startAngle);\n\n if (this._start) {\n // Move to (x0, y0) only when CMD.A comes at the\n // first position of a shape.\n // For instance, when drawing a ring, CMD.A comes\n // after CMD.M, so it's unnecessary to move to\n // (x0, y0).\n this._add('M', x0, y0);\n }\n\n const xRot = Math.round(psi * degree);\n // It will not draw if start point and end point are exactly the same\n // We need to add two arcs\n if (isCircle) {\n const p = 1 / this._p;\n const dTheta = (clockwise ? 1 : -1) * (PI2 - p);\n this._add(\n 'A', rx, ry, xRot, 1, +clockwise,\n cx + rx * mathCos(startAngle + dTheta),\n cy + ry * mathSin(startAngle + dTheta)\n );\n // TODO.\n // Usually we can simply divide the circle into two halfs arcs.\n // But it will cause slightly diff with previous screenshot.\n // We can't tell it but visual regression test can. To avoid too much breaks.\n // We keep the logic on the browser as before.\n // But in SSR mode wich has lower precision. We close the circle by adding another arc.\n if (p > 1e-2) {\n this._add('A', rx, ry, xRot, 0, +clockwise, x0, y0);\n }\n }\n else {\n const x = cx + rx * mathCos(endAngle);\n const y = cy + ry * mathSin(endAngle);\n\n // FIXME Ellipse\n this._add('A', rx, ry, xRot, +large, +clockwise, x, y);\n }\n\n }\n rect(x: number, y: number, w: number, h: number) {\n this._add('M', x, y);\n // Use relative coordinates to reduce the size.\n this._add('l', w, 0);\n this._add('l', 0, h);\n this._add('l', -w, 0);\n // this._add('L', x, y);\n this._add('Z');\n }\n closePath() {\n // Not use Z as first command\n if (this._d.length > 0) {\n this._add('Z');\n }\n }\n\n _add(cmd: string, a?: number, b?: number, c?: number, d?: number, e?: number, f?: number, g?: number, h?: number) {\n const vals = [];\n const p = this._p;\n for (let i = 1; i < arguments.length; i++) {\n const val = arguments[i];\n if (isNaN(val)) {\n this._invalid = true;\n return;\n }\n vals.push(Math.round(val * p) / p);\n }\n this._d.push(cmd + vals.join(' '));\n this._start = cmd === 'Z';\n }\n\n generateStr() {\n this._str = this._invalid ? '' : this._d.join('');\n this._d = [];\n }\n getStr() {\n return this._str;\n }\n}", "\nimport Path, { DEFAULT_PATH_STYLE, PathStyleProps } from '../graphic/Path';\nimport ZRImage, { ImageStyleProps } from '../graphic/Image';\nimport TSpan, { TSpanStyleProps } from '../graphic/TSpan';\nimport { getLineDash } from '../canvas/dashStyle';\nimport { map } from '../core/util';\nimport { normalizeColor } from './helper';\n\ntype AllStyleOption = PathStyleProps | TSpanStyleProps | ImageStyleProps;\n\nconst NONE = 'none';\nconst mathRound = Math.round;\n\nfunction pathHasFill(style: AllStyleOption): style is PathStyleProps {\n const fill = (style as PathStyleProps).fill;\n return fill != null && fill !== NONE;\n}\n\nfunction pathHasStroke(style: AllStyleOption): style is PathStyleProps {\n const stroke = (style as PathStyleProps).stroke;\n return stroke != null && stroke !== NONE;\n}\n\nconst strokeProps = ['lineCap', 'miterLimit', 'lineJoin'] as const;\nconst svgStrokeProps = map(strokeProps, prop => `stroke-${prop.toLowerCase()}`);\n\nexport default function mapStyleToAttrs(\n updateAttr: (key: string, val: string | number) => void,\n style: AllStyleOption,\n el: Path | TSpan | ZRImage,\n /**\n * Will try not to set the attribute if it's using default value if not using forceUpdate.\n * Mainly for reduce the generated size in svg-ssr mode.\n */\n forceUpdate: boolean\n): void {\n const opacity = style.opacity == null ? 1 : style.opacity;\n\n // only set opacity. stroke and fill cannot be applied to svg image\n if (el instanceof ZRImage) {\n updateAttr('opacity', opacity);\n return;\n }\n\n if (pathHasFill(style)) {\n const fill = normalizeColor(style.fill as string);\n updateAttr('fill', fill.color);\n const fillOpacity = style.fillOpacity != null\n ? style.fillOpacity * fill.opacity * opacity\n : fill.opacity * opacity;\n if (forceUpdate || fillOpacity < 1) {\n updateAttr('fill-opacity', fillOpacity);\n }\n }\n else {\n updateAttr('fill', NONE);\n }\n\n if (pathHasStroke(style)) {\n const stroke = normalizeColor(style.stroke as string);\n updateAttr('stroke', stroke.color);\n const strokeScale = style.strokeNoScale\n ? (el as Path).getLineScale()\n : 1;\n const strokeWidth = (strokeScale ? (style.lineWidth || 0) / strokeScale : 0);\n const strokeOpacity = style.strokeOpacity != null\n ? style.strokeOpacity * stroke.opacity * opacity\n : stroke.opacity * opacity;\n const strokeFirst = style.strokeFirst;\n\n if (forceUpdate || strokeWidth !== 1) {\n updateAttr('stroke-width', strokeWidth);\n }\n // stroke then fill for text; fill then stroke for others\n if (forceUpdate || strokeFirst) {\n updateAttr('paint-order', strokeFirst ? 'stroke' : 'fill');\n }\n if (forceUpdate || strokeOpacity < 1) {\n updateAttr('stroke-opacity', strokeOpacity);\n }\n\n if (style.lineDash) {\n let [lineDash, lineDashOffset] = getLineDash(el);\n if (lineDash) {\n lineDashOffset = mathRound(lineDashOffset || 0);\n updateAttr('stroke-dasharray', lineDash.join(','));\n if (lineDashOffset || forceUpdate) {\n updateAttr('stroke-dashoffset', lineDashOffset);\n }\n }\n }\n else if (forceUpdate) {\n // Reset if force update.\n updateAttr('stroke-dasharray', NONE);\n }\n\n // PENDING reset\n for (let i = 0; i < strokeProps.length; i++) {\n const propName = strokeProps[i];\n if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) {\n const val = style[propName] || DEFAULT_PATH_STYLE[propName];\n // TODO reset\n val && updateAttr(svgStrokeProps[i], val);\n }\n }\n }\n else if (forceUpdate) {\n updateAttr('stroke', NONE);\n }\n}\n", "import { keys, map } from '../core/util';\nimport { encodeHTML } from '../core/dom';\n\nexport type CSSSelectorVNode = Record\nexport type CSSAnimationVNode = Record>\n\nexport const SVGNS = 'http://www.w3.org/2000/svg';\nexport const XLINKNS = 'http://www.w3.org/1999/xlink';\nexport const XMLNS = 'http://www.w3.org/2000/xmlns/';\nexport const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';\nexport const META_DATA_PREFIX = 'ecmeta_';\n\nexport function createElement(name: string) {\n return document.createElementNS(SVGNS, name);\n}\n\nexport type SVGVNodeAttrs = Record\nexport interface SVGVNode {\n tag: string,\n attrs: SVGVNodeAttrs,\n children?: SVGVNode[],\n text?: string\n\n // For patching\n elm?: Node\n key: string\n};\nexport function createVNode(\n tag: string,\n key: string,\n attrs?: SVGVNodeAttrs,\n children?: SVGVNode[],\n text?: string\n): SVGVNode {\n return {\n tag,\n attrs: attrs || {},\n children,\n text,\n key\n };\n}\n\nfunction createElementOpen(name: string, attrs?: SVGVNodeAttrs) {\n const attrsStr: string[] = [];\n if (attrs) {\n // eslint-disable-next-line\n for (let key in attrs) {\n const val = attrs[key];\n let part = key;\n // Same with the logic in patch.\n if (val === false) {\n continue;\n }\n else if (val !== true && val != null) {\n part += `=\"${val}\"`;\n }\n attrsStr.push(part);\n }\n }\n return `<${name} ${attrsStr.join(' ')}>`;\n}\n\nfunction createElementClose(name: string) {\n return ``;\n}\n\nexport function vNodeToString(el: SVGVNode, opts?: {\n newline?: boolean\n}) {\n opts = opts || {};\n const S = opts.newline ? '\\n' : '';\n function convertElToString(el: SVGVNode): string {\n const {children, tag, attrs, text} = el;\n return createElementOpen(tag, attrs)\n + (tag !== 'style' ? encodeHTML(text) : text || '')\n + (children ? `${S}${map(children, child => convertElToString(child)).join(S)}${S}` : '')\n + createElementClose(tag);\n }\n return convertElToString(el);\n}\n\nexport function getCssString(\n selectorNodes: Record,\n animationNodes: Record,\n opts?: {\n newline?: boolean\n }\n) {\n opts = opts || {};\n const S = opts.newline ? '\\n' : '';\n const bracketBegin = ` {${S}`;\n const bracketEnd = `${S}}`;\n const selectors = map(keys(selectorNodes), className => {\n return className + bracketBegin + map(keys(selectorNodes[className]), attrName => {\n return `${attrName}:${selectorNodes[className][attrName]};`;\n }).join(S) + bracketEnd;\n }).join(S);\n const animations = map(keys(animationNodes), (animationName) => {\n return `@keyframes ${animationName}${bracketBegin}` + map(keys(animationNodes[animationName]), percent => {\n return percent + bracketBegin + map(keys(animationNodes[animationName][percent]), attrName => {\n let val = animationNodes[animationName][percent][attrName];\n // postprocess\n if (attrName === 'd') {\n val = `path(\"${val}\")`;\n }\n return `${attrName}:${val};`;\n }).join(S) + bracketEnd;\n }).join(S) + bracketEnd;\n }).join(S);\n\n if (!selectors && !animations) {\n return '';\n }\n\n return [''].join(S);\n}\n\n\nexport interface BrushScope {\n zrId: string\n\n shadowCache: Record\n gradientCache: Record\n patternCache: Record\n clipPathCache: Record\n\n defs: Record\n\n cssNodes: Record\n cssAnims: Record>>\n /**\n * Cache for css style string, mapping from style string to class name.\n */\n cssStyleCache: Record\n\n cssAnimIdx: number\n\n shadowIdx: number\n gradientIdx: number\n patternIdx: number\n clipPathIdx: number\n // configs\n /**\n * If create animates nodes.\n */\n animation?: boolean,\n /**\n * If create emphasis styles.\n */\n emphasis?: boolean,\n\n /**\n * If will update. Some optimization for string generation can't be applied.\n */\n willUpdate?: boolean\n\n /**\n * If compress the output string.\n */\n compress?: boolean\n\n ssr?: boolean\n}\n\nexport function createBrushScope(zrId: string): BrushScope {\n return {\n zrId,\n shadowCache: {},\n patternCache: {},\n gradientCache: {},\n clipPathCache: {},\n defs: {},\n\n cssNodes: {},\n cssAnims: {},\n cssStyleCache: {},\n\n cssAnimIdx: 0,\n\n shadowIdx: 0,\n gradientIdx: 0,\n patternIdx: 0,\n clipPathIdx: 0\n };\n}\n\nexport function createSVGVNode(\n width: number | string,\n height: number | string,\n children?: SVGVNode[],\n useViewBox?: boolean\n) {\n return createVNode(\n 'svg',\n 'root',\n {\n 'width': width,\n 'height': height,\n 'xmlns': SVGNS,\n 'xmlns:xlink': XLINKNS,\n 'version': '1.1',\n 'baseProfile': 'full',\n 'viewBox': useViewBox ? `0 0 ${width} ${height}` : false\n },\n children\n );\n}", "let cssClassIdx = 0;\n\nexport function getClassId() {\n return cssClassIdx++;\n}\n", "import Transformable, { copyTransform } from '../core/Transformable';\nimport Displayable from '../graphic/Displayable';\nimport { SVGVNodeAttrs, BrushScope, createBrushScope} from './core';\nimport Path from '../graphic/Path';\nimport SVGPathRebuilder from './SVGPathRebuilder';\nimport PathProxy from '../core/PathProxy';\nimport { getPathPrecision, getSRTTransformString } from './helper';\nimport { each, extend, filter, isNumber, isString, keys } from '../core/util';\nimport Animator from '../animation/Animator';\nimport CompoundPath from '../graphic/CompoundPath';\nimport { AnimationEasing } from '../animation/easing';\nimport { createCubicEasingFunc } from '../animation/cubicEasing';\nimport { getClassId } from './cssClassId';\n\nexport const EASING_MAP: Record = {\n // From https://easings.net/\n cubicIn: '0.32,0,0.67,0',\n cubicOut: '0.33,1,0.68,1',\n cubicInOut: '0.65,0,0.35,1',\n quadraticIn: '0.11,0,0.5,0',\n quadraticOut: '0.5,1,0.89,1',\n quadraticInOut: '0.45,0,0.55,1',\n quarticIn: '0.5,0,0.75,0',\n quarticOut: '0.25,1,0.5,1',\n quarticInOut: '0.76,0,0.24,1',\n quinticIn: '0.64,0,0.78,0',\n quinticOut: '0.22,1,0.36,1',\n quinticInOut: '0.83,0,0.17,1',\n sinusoidalIn: '0.12,0,0.39,0',\n sinusoidalOut: '0.61,1,0.88,1',\n sinusoidalInOut: '0.37,0,0.63,1',\n exponentialIn: '0.7,0,0.84,0',\n exponentialOut: '0.16,1,0.3,1',\n exponentialInOut: '0.87,0,0.13,1',\n circularIn: '0.55,0,1,0.45',\n circularOut: '0,0.55,0.45,1',\n circularInOut: '0.85,0,0.15,1'\n // TODO elastic, bounce\n};\n\nconst transformOriginKey = 'transform-origin';\n\nfunction buildPathString(el: Path, kfShape: Path['shape'], path: PathProxy) {\n const shape = extend({}, el.shape);\n extend(shape, kfShape);\n\n el.buildPath(path, shape);\n const svgPathBuilder = new SVGPathRebuilder();\n svgPathBuilder.reset(getPathPrecision(el));\n path.rebuildPath(svgPathBuilder, 1);\n svgPathBuilder.generateStr();\n // will add path(\"\") when generated to css string in the final step.\n return svgPathBuilder.getStr();\n}\n\nfunction setTransformOrigin(target: Record, transform: Transformable) {\n const {originX, originY} = transform;\n if (originX || originY) {\n target[transformOriginKey] = `${originX}px ${originY}px`;\n }\n}\n\nexport const ANIMATE_STYLE_MAP: Record = {\n fill: 'fill',\n opacity: 'opacity',\n lineWidth: 'stroke-width',\n lineDashOffset: 'stroke-dashoffset'\n // TODO shadow is not supported.\n};\n\ntype CssKF = Record;\n\nfunction addAnimation(cssAnim: Record, scope: BrushScope) {\n const animationName = scope.zrId + '-ani-' + scope.cssAnimIdx++;\n scope.cssAnims[animationName] = cssAnim;\n return animationName;\n}\n\nfunction createCompoundPathCSSAnimation(\n el: CompoundPath,\n attrs: SVGVNodeAttrs,\n scope: BrushScope\n) {\n const paths = el.shape.paths;\n const composedAnim: Record = {};\n let cssAnimationCfg: string;\n let cssAnimationName: string;\n each(paths, path => {\n const subScope = createBrushScope(scope.zrId);\n subScope.animation = true;\n createCSSAnimation(path, {}, subScope, true);\n const cssAnims = subScope.cssAnims;\n const cssNodes = subScope.cssNodes;\n const animNames = keys(cssAnims);\n const len = animNames.length;\n if (!len) {\n return;\n }\n cssAnimationName = animNames[len - 1];\n // Only use last animation because they are conflicted.\n const lastAnim = cssAnims[cssAnimationName];\n // eslint-disable-next-line\n for (let percent in lastAnim) {\n const kf = lastAnim[percent];\n composedAnim[percent] = composedAnim[percent] || { d: '' };\n composedAnim[percent].d += kf.d || '';\n }\n // eslint-disable-next-line\n for (let className in cssNodes) {\n const val = cssNodes[className].animation;\n if (val.indexOf(cssAnimationName) >= 0) {\n // Only pick the animation configuration of last subpath.\n cssAnimationCfg = val;\n }\n }\n });\n\n if (!cssAnimationCfg) {\n return;\n }\n\n // Remove the attrs in the element because it will be set by animation.\n // Reduce the size.\n attrs.d = false;\n const animationName = addAnimation(composedAnim, scope);\n return cssAnimationCfg.replace(cssAnimationName, animationName);\n}\n\nfunction getEasingFunc(easing: AnimationEasing) {\n return isString(easing)\n ? EASING_MAP[easing]\n ? `cubic-bezier(${EASING_MAP[easing]})`\n : createCubicEasingFunc(easing) ? easing : ''\n : '';\n}\n\nexport function createCSSAnimation(\n el: Displayable,\n attrs: SVGVNodeAttrs,\n scope: BrushScope,\n onlyShape?: boolean\n) {\n const animators = el.animators;\n const len = animators.length;\n\n const cssAnimations: string[] = [];\n\n if (el instanceof CompoundPath) {\n const animationCfg = createCompoundPathCSSAnimation(el, attrs, scope);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n else if (!len) {\n return;\n }\n }\n else if (!len) {\n return;\n }\n // Group animators by it's configuration\n const groupAnimators: Record[]]> = {};\n for (let i = 0; i < len; i++) {\n const animator = animators[i];\n const cfgArr: (string | number)[] = [animator.getMaxTime() / 1000 + 's'];\n const easing = getEasingFunc(animator.getClip().easing);\n const delay = animator.getDelay();\n\n if (easing) {\n cfgArr.push(easing);\n }\n else {\n cfgArr.push('linear');\n }\n if (delay) {\n cfgArr.push(delay / 1000 + 's');\n }\n if (animator.getLoop()) {\n cfgArr.push('infinite');\n }\n const cfg = cfgArr.join(' ');\n\n // TODO fill mode\n groupAnimators[cfg] = groupAnimators[cfg] || [cfg, [] as Animator[]];\n groupAnimators[cfg][1].push(animator);\n }\n\n function createSingleCSSAnimation(groupAnimator: [string, Animator[]]) {\n const animators = groupAnimator[1];\n const len = animators.length;\n const transformKfs: Record = {};\n const shapeKfs: Record = {};\n\n const finalKfs: Record = {};\n\n const animationTimingFunctionAttrName = 'animation-timing-function';\n\n function saveAnimatorTrackToCssKfs(\n animator: Animator,\n cssKfs: Record,\n toCssAttrName?: (propName: string) => string\n ) {\n const tracks = animator.getTracks();\n const maxTime = animator.getMaxTime();\n for (let k = 0; k < tracks.length; k++) {\n const track = tracks[k];\n if (track.needsAnimate()) {\n const kfs = track.keyframes;\n let attrName = track.propName;\n toCssAttrName && (attrName = toCssAttrName(attrName));\n if (attrName) {\n for (let i = 0; i < kfs.length; i++) {\n const kf = kfs[i];\n const percent = Math.round(kf.time / maxTime * 100) + '%';\n const kfEasing = getEasingFunc(kf.easing);\n const rawValue = kf.rawValue;\n\n // TODO gradient\n if (isString(rawValue) || isNumber(rawValue)) {\n cssKfs[percent] = cssKfs[percent] || {};\n cssKfs[percent][attrName] = kf.rawValue;\n\n if (kfEasing) {\n // TODO. If different property have different easings.\n cssKfs[percent][animationTimingFunctionAttrName] = kfEasing;\n }\n }\n }\n }\n }\n }\n }\n\n // Find all transform animations.\n // TODO origin, parent\n for (let i = 0; i < len; i++) {\n const animator = animators[i];\n const targetProp = animator.targetName;\n if (!targetProp) {\n !onlyShape && saveAnimatorTrackToCssKfs(animator, transformKfs);\n }\n else if (targetProp === 'shape') {\n saveAnimatorTrackToCssKfs(animator, shapeKfs);\n }\n }\n\n // eslint-disable-next-line\n for (let percent in transformKfs) {\n const transform = {} as Transformable;\n copyTransform(transform, el);\n extend(transform, transformKfs[percent]);\n const str = getSRTTransformString(transform);\n const timingFunction = transformKfs[percent][animationTimingFunctionAttrName];\n finalKfs[percent] = str ? {\n transform: str\n } : {};\n // TODO set transform origin in element?\n setTransformOrigin(finalKfs[percent], transform);\n\n // Save timing function\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n };\n\n\n let path: PathProxy;\n let canAnimateShape = true;\n // eslint-disable-next-line\n for (let percent in shapeKfs) {\n finalKfs[percent] = finalKfs[percent] || {};\n\n const isFirst = !path;\n const timingFunction = shapeKfs[percent][animationTimingFunctionAttrName];\n\n if (isFirst) {\n path = new PathProxy();\n }\n let len = path.len();\n path.reset();\n finalKfs[percent].d = buildPathString(el as Path, shapeKfs[percent], path);\n let newLen = path.len();\n // Path data don't match.\n if (!isFirst && len !== newLen) {\n canAnimateShape = false;\n break;\n }\n\n // Save timing function\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n };\n if (!canAnimateShape) {\n // eslint-disable-next-line\n for (let percent in finalKfs) {\n delete finalKfs[percent].d;\n }\n }\n\n if (!onlyShape) {\n for (let i = 0; i < len; i++) {\n const animator = animators[i];\n const targetProp = animator.targetName;\n if (targetProp === 'style') {\n saveAnimatorTrackToCssKfs(\n animator, finalKfs, (propName) => ANIMATE_STYLE_MAP[propName]\n );\n }\n }\n }\n\n const percents = keys(finalKfs);\n\n // Set transform origin in attribute to reduce the size.\n let allTransformOriginSame = true;\n let transformOrigin;\n for (let i = 1; i < percents.length; i++) {\n const p0 = percents[i - 1];\n const p1 = percents[i];\n if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) {\n allTransformOriginSame = false;\n break;\n }\n transformOrigin = finalKfs[p0][transformOriginKey];\n }\n if (allTransformOriginSame && transformOrigin) {\n for (const percent in finalKfs) {\n if (finalKfs[percent][transformOriginKey]) {\n delete finalKfs[percent][transformOriginKey];\n }\n }\n attrs[transformOriginKey] = transformOrigin;\n }\n\n if (filter(\n percents, (percent) => keys(finalKfs[percent]).length > 0\n ).length) {\n const animationName = addAnimation(finalKfs, scope);\n // eslint-disable-next-line\n // for (const attrName in finalKfs[percents[0]]) {\n // // Remove the attrs in the element because it will be set by animation.\n // // Reduce the size.\n // attrs[attrName] = false;\n // }\n // animationName {duration easing delay loop} fillMode\n return `${animationName} ${groupAnimator[0]} both`;\n }\n }\n\n // eslint-disable-next-line\n for (let key in groupAnimators) {\n const animationCfg = createSingleCSSAnimation(groupAnimators[key]);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n }\n\n if (cssAnimations.length) {\n const className = scope.zrId + '-cls-' + getClassId();\n scope.cssNodes['.' + className] = {\n animation: cssAnimations.join(',')\n };\n // TODO exists class?\n attrs.class = className;\n }\n}", "import Displayable from '../graphic/Displayable';\nimport { liftColor } from '../tool/color';\nimport { BrushScope, SVGVNodeAttrs } from './core';\nimport { getClassId } from './cssClassId';\n\nexport function createCSSEmphasis(\n el: Displayable,\n attrs: SVGVNodeAttrs,\n scope: BrushScope\n) {\n if (!el.ignore) {\n if (el.isSilent()) {\n // If el is silent, it can not be hovered nor selected.\n // So set pointer-events to pass through.\n const style = {\n 'pointer-events': 'none'\n };\n setClassAttribute(style, attrs, scope, true);\n }\n else {\n const emphasisStyle = el.states.emphasis && el.states.emphasis.style\n ? el.states.emphasis.style\n : {};\n let fill = emphasisStyle.fill;\n if (!fill) {\n // No empahsis fill, lift color\n const normalFill = el.style && el.style.fill;\n const selectFill = el.states.select\n && el.states.select.style\n && el.states.select.style.fill;\n const fromFill = el.currentStates.indexOf('select') >= 0\n ? (selectFill || normalFill)\n : normalFill;\n if (fromFill) {\n fill = liftColor(fromFill);\n }\n }\n let lineWidth = emphasisStyle.lineWidth;\n if (lineWidth) {\n // Symbols use transform to set size, so lineWidth\n // should be divided by scaleX\n const scaleX = (!emphasisStyle.strokeNoScale && el.transform)\n ? el.transform[0]\n : 1;\n lineWidth = lineWidth / scaleX;\n }\n const style = {\n cursor: 'pointer', // TODO: Should this be customized?\n } as any;\n if (fill) {\n style.fill = fill;\n }\n if (emphasisStyle.stroke) {\n style.stroke = emphasisStyle.stroke;\n }\n if (lineWidth) {\n style['stroke-width'] = lineWidth;\n }\n setClassAttribute(style, attrs, scope, true);\n }\n }\n}\n\nfunction setClassAttribute(style: object, attrs: SVGVNodeAttrs, scope: BrushScope, withHover: boolean) {\n const styleKey = JSON.stringify(style);\n let className = scope.cssStyleCache[styleKey];\n if (!className) {\n className = scope.zrId + '-cls-' + getClassId();\n scope.cssStyleCache[styleKey] = className;\n scope.cssNodes['.' + className + (withHover ? ':hover' : '')] = style as any;\n }\n attrs.class = attrs.class ? (attrs.class + ' ' + className) : className;\n}\n", "// TODO\n// 1. shadow\n// 2. Image: sx, sy, sw, sh\n\nimport {\n adjustTextY,\n getIdURL,\n getMatrixStr,\n getPathPrecision,\n getShadowKey,\n getSRTTransformString,\n hasShadow,\n isAroundZero,\n isGradient,\n isImagePattern,\n isLinearGradient,\n isPattern,\n isRadialGradient,\n normalizeColor,\n round4,\n TEXT_ALIGN_TO_ANCHOR\n} from './helper';\nimport Path, { PathStyleProps } from '../graphic/Path';\nimport ZRImage, { ImageStyleProps } from '../graphic/Image';\nimport { getLineHeight } from '../contain/text';\nimport TSpan, { TSpanStyleProps } from '../graphic/TSpan';\nimport SVGPathRebuilder from './SVGPathRebuilder';\nimport mapStyleToAttrs from './mapStyleToAttrs';\nimport { SVGVNodeAttrs, createVNode, SVGVNode, vNodeToString, BrushScope, META_DATA_PREFIX } from './core';\nimport { MatrixArray } from '../core/matrix';\nimport Displayable from '../graphic/Displayable';\nimport { assert, clone, isFunction, isString, logError, map, retrieve2 } from '../core/util';\nimport Polyline from '../graphic/shape/Polyline';\nimport Polygon from '../graphic/shape/Polygon';\nimport { GradientObject } from '../graphic/Gradient';\nimport { ImagePatternObject, SVGPatternObject } from '../graphic/Pattern';\nimport { createOrUpdateImage } from '../graphic/helper/image';\nimport { ImageLike } from '../core/types';\nimport { createCSSAnimation } from './cssAnimation';\nimport { hasSeparateFont, parseFontSize } from '../graphic/Text';\nimport { DEFAULT_FONT, DEFAULT_FONT_FAMILY } from '../core/platform';\nimport { createCSSEmphasis } from './cssEmphasis';\nimport { getElementSSRData } from '../zrender';\n\nconst round = Math.round;\n\nfunction isImageLike(val: any): val is HTMLImageElement {\n return val && isString(val.src);\n}\nfunction isCanvasLike(val: any): val is HTMLCanvasElement {\n return val && isFunction(val.toDataURL);\n}\n\n\ntype AllStyleOption = PathStyleProps | TSpanStyleProps | ImageStyleProps;\n\nfunction setStyleAttrs(attrs: SVGVNodeAttrs, style: AllStyleOption, el: Path | TSpan | ZRImage, scope: BrushScope) {\n mapStyleToAttrs((key, val) => {\n const isFillStroke = key === 'fill' || key === 'stroke';\n if (isFillStroke && isGradient(val)) {\n setGradient(style, attrs, key, scope);\n }\n else if (isFillStroke && isPattern(val)) {\n setPattern(el, attrs, key, scope);\n }\n else {\n attrs[key] = val;\n }\n if (isFillStroke && scope.ssr && val === 'none') {\n // When is none, it cannot be interacted when ssr\n // Setting `pointer-events` as `visible` to make it responding\n // See also https://www.w3.org/TR/SVG/interact.html#PointerEventsProperty\n attrs['pointer-events'] = 'visible';\n }\n }, style, el, false);\n\n setShadow(el, attrs, scope);\n}\n\nfunction setMetaData(attrs: SVGVNodeAttrs, el: Path | TSpan | ZRImage) {\n const metaData = getElementSSRData(el);\n if (metaData) {\n metaData.each((val, key) => {\n val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + '');\n });\n if (el.isSilent()) {\n attrs[META_DATA_PREFIX + 'silent'] = 'true';\n }\n }\n}\n\nfunction noRotateScale(m: MatrixArray) {\n return isAroundZero(m[0] - 1)\n && isAroundZero(m[1])\n && isAroundZero(m[2])\n && isAroundZero(m[3] - 1);\n}\n\nfunction noTranslate(m: MatrixArray) {\n return isAroundZero(m[4]) && isAroundZero(m[5]);\n}\n\nfunction setTransform(attrs: SVGVNodeAttrs, m: MatrixArray, compress?: boolean) {\n if (m && !(noTranslate(m) && noRotateScale(m))) {\n const mul = compress ? 10 : 1e4;\n // Use translate possible to reduce the size a bit.\n attrs.transform = noRotateScale(m)\n ? `translate(${round(m[4] * mul) / mul} ${round(m[5] * mul) / mul})` : getMatrixStr(m);\n }\n}\n\ntype ShapeMapDesc = (string | [string, string])[];\ntype ConvertShapeToAttr = (shape: any, attrs: SVGVNodeAttrs, mul?: number) => void;\ntype ShapeValidator = (shape: any) => boolean;\n\nfunction convertPolyShape(shape: Polygon['shape'], attrs: SVGVNodeAttrs, mul: number) {\n const points = shape.points;\n const strArr = [];\n for (let i = 0; i < points.length; i++) {\n strArr.push(round(points[i][0] * mul) / mul);\n strArr.push(round(points[i][1] * mul) / mul);\n }\n attrs.points = strArr.join(' ');\n}\n\nfunction validatePolyShape(shape: Polyline['shape']) {\n return !shape.smooth;\n}\n\nfunction createAttrsConvert(desc: ShapeMapDesc): ConvertShapeToAttr {\n const normalizedDesc: [string, string][] = map(desc, (item) =>\n (typeof item === 'string' ? [item, item] : item)\n );\n\n return function (shape, attrs, mul) {\n for (let i = 0; i < normalizedDesc.length; i++) {\n const item = normalizedDesc[i];\n const val = shape[item[0]];\n if (val != null) {\n attrs[item[1]] = round(val * mul) / mul;\n }\n }\n };\n}\n\nconst builtinShapesDef: Record = {\n circle: [createAttrsConvert(['cx', 'cy', 'r'])],\n polyline: [convertPolyShape, validatePolyShape],\n polygon: [convertPolyShape, validatePolyShape]\n // Ignore line because it will be larger.\n};\n\ninterface PathWithSVGBuildPath extends Path {\n __svgPathVersion: number\n __svgPathBuilder: SVGPathRebuilder\n __svgPathStrokePercent: number\n}\n\nfunction hasShapeAnimation(el: Displayable) {\n const animators = el.animators;\n for (let i = 0; i < animators.length; i++) {\n if (animators[i].targetName === 'shape') {\n return true;\n }\n }\n return false;\n}\n\nexport function brushSVGPath(el: Path, scope: BrushScope) {\n const style = el.style;\n const shape = el.shape;\n const builtinShpDef = builtinShapesDef[el.type];\n const attrs: SVGVNodeAttrs = {};\n const needsAnimate = scope.animation;\n let svgElType = 'path';\n const strokePercent = el.style.strokePercent;\n const precision = (scope.compress && getPathPrecision(el)) || 4;\n // Using SVG builtin shapes if possible\n if (builtinShpDef\n // Force to use path if it will update later.\n // To avoid some animation(like morph) fail\n && !scope.willUpdate\n && !(builtinShpDef[1] && !builtinShpDef[1](shape))\n // use `path` to simplify the animate element creation logic.\n && !(needsAnimate && hasShapeAnimation(el))\n && !(strokePercent < 1)\n ) {\n svgElType = el.type;\n const mul = Math.pow(10, precision);\n builtinShpDef[0](shape, attrs, mul);\n }\n else {\n const needBuildPath = !el.path || el.shapeChanged();\n if (!el.path) {\n el.createPathProxy();\n }\n const path = el.path;\n\n if (needBuildPath) {\n path.beginPath();\n el.buildPath(path, el.shape);\n el.pathUpdated();\n }\n const pathVersion = path.getVersion();\n const elExt = el as PathWithSVGBuildPath;\n\n let svgPathBuilder = elExt.__svgPathBuilder;\n if (elExt.__svgPathVersion !== pathVersion\n || !svgPathBuilder\n || strokePercent !== elExt.__svgPathStrokePercent\n ) {\n if (!svgPathBuilder) {\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\n }\n svgPathBuilder.reset(precision);\n path.rebuildPath(svgPathBuilder, strokePercent);\n svgPathBuilder.generateStr();\n elExt.__svgPathVersion = pathVersion;\n elExt.__svgPathStrokePercent = strokePercent;\n }\n\n attrs.d = svgPathBuilder.getStr();\n }\n\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n setMetaData(attrs, el);\n\n scope.animation && createCSSAnimation(el, attrs, scope);\n scope.emphasis && createCSSEmphasis(el, attrs, scope);\n\n return createVNode(svgElType, el.id + '', attrs);\n}\n\nexport function brushSVGImage(el: ZRImage, scope: BrushScope) {\n const style = el.style;\n let image = style.image;\n\n if (image && !isString(image)) {\n if (isImageLike(image)) {\n image = image.src;\n }\n // heatmap layer in geo may be a canvas\n else if (isCanvasLike(image)) {\n image = image.toDataURL();\n }\n }\n\n if (!image) {\n return;\n }\n\n const x = style.x || 0;\n const y = style.y || 0;\n\n const dw = style.width;\n const dh = style.height;\n\n const attrs: SVGVNodeAttrs = {\n href: image as string,\n width: dw,\n height: dh\n };\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n setMetaData(attrs, el);\n\n scope.animation && createCSSAnimation(el, attrs, scope);\n\n return createVNode('image', el.id + '', attrs);\n};\n\nexport function brushSVGTSpan(el: TSpan, scope: BrushScope) {\n const style = el.style;\n\n let text = style.text;\n // Convert to string\n text != null && (text += '');\n if (!text || isNaN(style.x) || isNaN(style.y)) {\n return;\n }\n\n // style.font has been normalized by `normalizeTextStyle`.\n const font = style.font || DEFAULT_FONT;\n\n // Consider different font display differently in vertical align, we always\n // set verticalAlign as 'middle', and use 'y' to locate text vertically.\n const x = style.x || 0;\n const y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline);\n const textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign as keyof typeof TEXT_ALIGN_TO_ANCHOR]\n || style.textAlign;\n\n const attrs: SVGVNodeAttrs = {\n 'dominant-baseline': 'central',\n 'text-anchor': textAlign\n };\n\n if (hasSeparateFont(style)) {\n // Set separate font attributes if possible. Or some platform like PowerPoint may not support it.\n let separatedFontStr = '';\n const fontStyle = style.fontStyle;\n const fontSize = parseFontSize(style.fontSize);\n if (!parseFloat(fontSize)) { // is 0px\n return;\n }\n\n const fontFamily = style.fontFamily || DEFAULT_FONT_FAMILY;\n const fontWeight = style.fontWeight;\n separatedFontStr += `font-size:${fontSize};font-family:${fontFamily};`;\n\n // TODO reduce the attribute to set. But should it inherit from the container element?\n if (fontStyle && fontStyle !== 'normal') {\n separatedFontStr += `font-style:${fontStyle};`;\n }\n if (fontWeight && fontWeight !== 'normal') {\n separatedFontStr += `font-weight:${fontWeight};`;\n }\n attrs.style = separatedFontStr;\n }\n else {\n // Use set font manually\n attrs.style = `font: ${font}`;\n }\n\n\n if (text.match(/\\s/)) {\n // only enabled when have space in text.\n attrs['xml:space'] = 'preserve';\n }\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n setMetaData(attrs, el);\n\n scope.animation && createCSSAnimation(el, attrs, scope);\n\n return createVNode('text', el.id + '', attrs, undefined, text);\n}\n\nexport function brush(el: Displayable, scope: BrushScope): SVGVNode {\n if (el instanceof Path) {\n return brushSVGPath(el, scope);\n }\n else if (el instanceof ZRImage) {\n return brushSVGImage(el, scope);\n }\n else if (el instanceof TSpan) {\n return brushSVGTSpan(el, scope);\n }\n}\n\nfunction setShadow(\n el: Displayable,\n attrs: SVGVNodeAttrs,\n scope: BrushScope\n) {\n const style = el.style;\n if (hasShadow(style)) {\n const shadowKey = getShadowKey(el);\n const shadowCache = scope.shadowCache;\n let shadowId = shadowCache[shadowKey];\n if (!shadowId) {\n const globalScale = el.getGlobalScale();\n const scaleX = globalScale[0];\n const scaleY = globalScale[1];\n if (!scaleX || !scaleY) {\n return;\n }\n\n const offsetX = style.shadowOffsetX || 0;\n const offsetY = style.shadowOffsetY || 0;\n const blur = style.shadowBlur;\n const {opacity, color} = normalizeColor(style.shadowColor);\n const stdDx = blur / 2 / scaleX;\n const stdDy = blur / 2 / scaleY;\n const stdDeviation = stdDx + ' ' + stdDy;\n // Use a simple prefix to reduce the size\n shadowId = scope.zrId + '-s' + scope.shadowIdx++;\n scope.defs[shadowId] = createVNode(\n 'filter', shadowId,\n {\n 'id': shadowId,\n 'x': '-100%',\n 'y': '-100%',\n 'width': '300%',\n 'height': '300%'\n },\n [\n createVNode('feDropShadow', '', {\n 'dx': offsetX / scaleX,\n 'dy': offsetY / scaleY,\n 'stdDeviation': stdDeviation,\n 'flood-color': color,\n 'flood-opacity': opacity\n })\n ]\n );\n shadowCache[shadowKey] = shadowId;\n }\n attrs.filter = getIdURL(shadowId);\n }\n}\n\nexport function setGradient(\n style: PathStyleProps,\n attrs: SVGVNodeAttrs,\n target: 'fill' | 'stroke',\n scope: BrushScope\n) {\n const val = style[target] as GradientObject;\n let gradientTag;\n let gradientAttrs: SVGVNodeAttrs = {\n 'gradientUnits': val.global\n ? 'userSpaceOnUse' // x1, x2, y1, y2 in range of 0 to canvas width or height\n : 'objectBoundingBox' // x1, x2, y1, y2 in range of 0 to 1]\n };\n if (isLinearGradient(val)) {\n gradientTag = 'linearGradient';\n gradientAttrs.x1 = val.x;\n gradientAttrs.y1 = val.y;\n gradientAttrs.x2 = val.x2;\n gradientAttrs.y2 = val.y2;\n }\n else if (isRadialGradient(val)) {\n gradientTag = 'radialGradient';\n gradientAttrs.cx = retrieve2(val.x, 0.5);\n gradientAttrs.cy = retrieve2(val.y, 0.5);\n gradientAttrs.r = retrieve2(val.r, 0.5);\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logError('Illegal gradient type.');\n }\n return;\n }\n\n const colors = val.colorStops;\n\n const colorStops = [];\n for (let i = 0, len = colors.length; i < len; ++i) {\n const offset = round4(colors[i].offset) * 100 + '%';\n\n const stopColor = colors[i].color;\n // Fix Safari bug that stop-color not recognizing alpha #9014\n const {color, opacity} = normalizeColor(stopColor);\n\n const stopsAttrs: SVGVNodeAttrs = {\n 'offset': offset\n };\n // stop-color cannot be color, since:\n // The opacity value used for the gradient calculation is the\n // *product* of the value of stop-opacity and the opacity of the\n // value of stop-color.\n // See https://www.w3.org/TR/SVG2/pservers.html#StopOpacityProperty\n\n stopsAttrs['stop-color'] = color;\n if (opacity < 1) {\n stopsAttrs['stop-opacity'] = opacity;\n }\n colorStops.push(\n createVNode('stop', i + '', stopsAttrs)\n );\n }\n\n // Use the whole html as cache key.\n const gradientVNode = createVNode(gradientTag, '', gradientAttrs, colorStops);\n const gradientKey = vNodeToString(gradientVNode);\n const gradientCache = scope.gradientCache;\n let gradientId = gradientCache[gradientKey];\n if (!gradientId) {\n gradientId = scope.zrId + '-g' + scope.gradientIdx++;\n gradientCache[gradientKey] = gradientId;\n\n gradientAttrs.id = gradientId;\n scope.defs[gradientId] = createVNode(\n gradientTag, gradientId, gradientAttrs, colorStops\n );\n }\n\n attrs[target] = getIdURL(gradientId);\n}\n\nexport function setPattern(\n el: Displayable,\n attrs: SVGVNodeAttrs,\n target: 'fill' | 'stroke',\n scope: BrushScope\n) {\n const val = el.style[target] as ImagePatternObject | SVGPatternObject;\n const boundingRect = el.getBoundingRect();\n const patternAttrs: SVGVNodeAttrs = {};\n const repeat = (val as ImagePatternObject).repeat;\n const noRepeat = repeat === 'no-repeat';\n const repeatX = repeat === 'repeat-x';\n const repeatY = repeat === 'repeat-y';\n let child: SVGVNode;\n if (isImagePattern(val)) {\n let imageWidth = val.imageWidth;\n let imageHeight = val.imageHeight;\n let imageSrc;\n const patternImage = val.image;\n if (isString(patternImage)) {\n imageSrc = patternImage;\n }\n else if (isImageLike(patternImage)) {\n imageSrc = patternImage.src;\n }\n else if (isCanvasLike(patternImage)) {\n imageSrc = patternImage.toDataURL();\n }\n\n if (typeof Image === 'undefined') {\n const errMsg = 'Image width/height must been given explictly in svg-ssr renderer.';\n assert(imageWidth, errMsg);\n assert(imageHeight, errMsg);\n }\n else if (imageWidth == null || imageHeight == null) {\n // TODO\n const setSizeToVNode = (vNode: SVGVNode, img: ImageLike) => {\n if (vNode) {\n const svgEl = vNode.elm as SVGElement;\n let width = imageWidth || img.width;\n let height = imageHeight || img.height;\n if (vNode.tag === 'pattern') {\n if (repeatX) {\n height = 1;\n width /= boundingRect.width;\n }\n else if (repeatY) {\n width = 1;\n height /= boundingRect.height;\n }\n }\n vNode.attrs.width = width;\n vNode.attrs.height = height;\n if (svgEl) {\n svgEl.setAttribute('width', width as any);\n svgEl.setAttribute('height', height as any);\n }\n }\n };\n const createdImage = createOrUpdateImage(\n imageSrc, null, el, (img) => {\n noRepeat || setSizeToVNode(patternVNode, img);\n setSizeToVNode(child, img);\n }\n );\n if (createdImage && createdImage.width && createdImage.height) {\n // Loaded before\n imageWidth = imageWidth || createdImage.width;\n imageHeight = imageHeight || createdImage.height;\n }\n }\n\n child = createVNode(\n 'image',\n 'img',\n {\n href: imageSrc,\n width: imageWidth,\n height: imageHeight\n }\n );\n patternAttrs.width = imageWidth;\n patternAttrs.height = imageHeight;\n }\n else if (val.svgElement) { // Only string supported in SSR.\n // TODO it's not so good to use textContent as innerHTML\n child = clone(val.svgElement);\n patternAttrs.width = val.svgWidth;\n patternAttrs.height = val.svgHeight;\n }\n if (!child) {\n return;\n }\n\n let patternWidth;\n let patternHeight;\n if (noRepeat) {\n patternWidth = patternHeight = 1;\n }\n else if (repeatX) {\n patternHeight = 1;\n patternWidth = (patternAttrs.width as number) / boundingRect.width;\n }\n else if (repeatY) {\n patternWidth = 1;\n patternHeight = (patternAttrs.height as number) / boundingRect.height;\n }\n else {\n patternAttrs.patternUnits = 'userSpaceOnUse';\n }\n\n if (patternWidth != null && !isNaN(patternWidth)) {\n patternAttrs.width = patternWidth;\n }\n if (patternHeight != null && !isNaN(patternHeight)) {\n patternAttrs.height = patternHeight;\n }\n\n const patternTransform = getSRTTransformString(val);\n patternTransform && (patternAttrs.patternTransform = patternTransform);\n\n // Use the whole html as cache key.\n let patternVNode = createVNode(\n 'pattern',\n '',\n patternAttrs,\n [child]\n );\n const patternKey = vNodeToString(patternVNode);\n const patternCache = scope.patternCache;\n let patternId = patternCache[patternKey];\n if (!patternId) {\n patternId = scope.zrId + '-p' + scope.patternIdx++;\n patternCache[patternKey] = patternId;\n patternAttrs.id = patternId;\n patternVNode = scope.defs[patternId] = createVNode(\n 'pattern',\n patternId,\n patternAttrs,\n [child]\n );\n }\n\n attrs[target] = getIdURL(patternId);\n}\n\nexport function setClipPath(\n clipPath: Path,\n attrs: SVGVNodeAttrs,\n scope: BrushScope\n) {\n const {clipPathCache, defs} = scope;\n let clipPathId = clipPathCache[clipPath.id];\n if (!clipPathId) {\n clipPathId = scope.zrId + '-c' + scope.clipPathIdx++;\n const clipPathAttrs: SVGVNodeAttrs = {\n id: clipPathId\n };\n\n clipPathCache[clipPath.id] = clipPathId;\n defs[clipPathId] = createVNode(\n 'clipPath', clipPathId, clipPathAttrs,\n [brushSVGPath(clipPath, scope)]\n );\n }\n attrs['clip-path'] = getIdURL(clipPathId);\n}\n", "export function createTextNode(text: string): Text {\n return document.createTextNode(text);\n}\n\nexport function createComment(text: string): Comment {\n return document.createComment(text);\n}\n\nexport function insertBefore(\n parentNode: Node,\n newNode: Node,\n referenceNode: Node | null\n): void {\n parentNode.insertBefore(newNode, referenceNode);\n}\n\nexport function removeChild(node: Node, child: Node): void {\n node.removeChild(child);\n}\n\nexport function appendChild(node: Node, child: Node): void {\n node.appendChild(child);\n}\n\nexport function parentNode(node: Node): Node | null {\n return node.parentNode;\n}\n\nexport function nextSibling(node: Node): Node | null {\n return node.nextSibling;\n}\n\nexport function tagName(elm: Element): string {\n return elm.tagName;\n}\n\nexport function setTextContent(node: Node, text: string | null): void {\n node.textContent = text;\n}\n\nexport function getTextContent(node: Node): string | null {\n return node.textContent;\n}\n\nexport function isElement(node: Node): node is Element {\n return node.nodeType === 1;\n}\n\nexport function isText(node: Node): node is Text {\n return node.nodeType === 3;\n}\n\nexport function isComment(node: Node): node is Comment {\n return node.nodeType === 8;\n}\n", "/**\n * Virtual DOM patching\n * Modified from snabbdom https://github.com/snabbdom/snabbdom/blob/master/src/init.ts\n *\n * The design has been simplified to focus on the purpose in SVG rendering in SVG.\n *\n * Licensed under the MIT License\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n */\n\nimport { isArray, isObject } from '../core/util';\nimport { createElement, createVNode, SVGVNode, XMLNS, XML_NAMESPACE, XLINKNS } from './core';\nimport * as api from './domapi';\n\nconst colonChar = 58;\nconst xChar = 120;\nconst emptyNode = createVNode('', '');\n\ntype NonUndefined = T extends undefined ? never : T;\n\nfunction isUndef(s: any): boolean {\n return s === undefined;\n}\n\nfunction isDef(s: A): s is NonUndefined {\n return s !== undefined;\n}\n\nfunction createKeyToOldIdx(\n children: SVGVNode[],\n beginIdx: number,\n endIdx: number\n): KeyToIndexMap {\n const map: KeyToIndexMap = {};\n for (let i = beginIdx; i <= endIdx; ++i) {\n const key = children[i].key;\n if (key !== undefined) {\n if (process.env.NODE_ENV !== 'production') {\n if (map[key] != null) {\n console.error(`Duplicate key ${key}`);\n }\n }\n map[key] = i;\n }\n }\n return map;\n}\n\nfunction sameVnode(vnode1: SVGVNode, vnode2: SVGVNode): boolean {\n const isSameKey = vnode1.key === vnode2.key;\n const isSameTag = vnode1.tag === vnode2.tag;\n\n return isSameTag && isSameKey;\n}\n\ntype KeyToIndexMap = { [key: string]: number };\n\nfunction createElm(vnode: SVGVNode): Node {\n let i: any;\n const children = vnode.children;\n const tag = vnode.tag;\n // if (tag === '!') {\n // if (isUndef(vnode.text)) {\n // vnode.text = '';\n // }\n // vnode.elm = api.createComment(vnode.text!);\n // }\n // else\n if (isDef(tag)) {\n const elm = (vnode.elm = createElement(tag));\n\n updateAttrs(emptyNode, vnode);\n\n if (isArray(children)) {\n for (i = 0; i < children.length; ++i) {\n const ch = children[i];\n if (ch != null) {\n api.appendChild(elm, createElm(ch));\n }\n }\n }\n else if (isDef(vnode.text) && !isObject(vnode.text)) {\n api.appendChild(elm, api.createTextNode(vnode.text));\n }\n }\n else {\n vnode.elm = api.createTextNode(vnode.text!);\n }\n return vnode.elm;\n}\n\nfunction addVnodes(\n parentElm: Node,\n before: Node | null,\n vnodes: SVGVNode[],\n startIdx: number,\n endIdx: number\n) {\n for (; startIdx <= endIdx; ++startIdx) {\n const ch = vnodes[startIdx];\n if (ch != null) {\n api.insertBefore(parentElm, createElm(ch), before);\n }\n }\n}\n\nfunction removeVnodes(parentElm: Node, vnodes: SVGVNode[], startIdx: number, endIdx: number): void {\n for (; startIdx <= endIdx; ++startIdx) {\n const ch = vnodes[startIdx];\n if (ch != null) {\n if (isDef(ch.tag)) {\n const parent = api.parentNode(ch.elm);\n api.removeChild(parent, ch.elm);\n }\n else {\n // Text node\n api.removeChild(parentElm, ch.elm!);\n }\n }\n }\n}\n\nexport function updateAttrs(oldVnode: SVGVNode, vnode: SVGVNode): void {\n let key: string;\n const elm = vnode.elm as SVGElement;\n const oldAttrs = oldVnode && oldVnode.attrs || {};\n const attrs = vnode.attrs || {};\n\n if (oldAttrs === attrs) {\n return;\n }\n\n // update modified attributes, add new attributes\n // eslint-disable-next-line\n for (key in attrs) {\n const cur = attrs[key];\n const old = oldAttrs[key];\n if (old !== cur) {\n if (cur === true) {\n elm.setAttribute(key, '');\n }\n else if (cur === false) {\n elm.removeAttribute(key);\n }\n else {\n if (key === 'style') {\n elm.style.cssText = cur as string;\n }\n else if (key.charCodeAt(0) !== xChar) {\n elm.setAttribute(key, cur as any);\n }\n // TODO\n else if (key === 'xmlns:xlink' || key === 'xmlns') {\n elm.setAttributeNS(XMLNS, key, cur as any);\n }\n else if (key.charCodeAt(3) === colonChar) {\n // Assume xml namespace\n elm.setAttributeNS(XML_NAMESPACE, key, cur as any);\n }\n else if (key.charCodeAt(5) === colonChar) {\n // Assume xlink namespace\n elm.setAttributeNS(XLINKNS, key, cur as any);\n }\n else {\n elm.setAttribute(key, cur as any);\n }\n }\n }\n }\n\n // remove removed attributes\n // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value)\n // the other option is to remove all attributes with value == undefined\n for (key in oldAttrs) {\n if (!(key in attrs)) {\n elm.removeAttribute(key);\n }\n }\n}\n\n\nfunction updateChildren(parentElm: Node, oldCh: SVGVNode[], newCh: SVGVNode[]) {\n let oldStartIdx = 0;\n let newStartIdx = 0;\n let oldEndIdx = oldCh.length - 1;\n let oldStartVnode = oldCh[0];\n let oldEndVnode = oldCh[oldEndIdx];\n let newEndIdx = newCh.length - 1;\n let newStartVnode = newCh[0];\n let newEndVnode = newCh[newEndIdx];\n let oldKeyToIdx: KeyToIndexMap | undefined;\n let idxInOld: number;\n let elmToMove: SVGVNode;\n let before: any;\n\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left\n }\n else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n }\n else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n }\n else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newStartVnode)) {\n patchVnode(oldStartVnode, newStartVnode);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else if (sameVnode(oldEndVnode, newEndVnode)) {\n patchVnode(oldEndVnode, newEndVnode);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newEndVnode)) {\n // Vnode moved right\n patchVnode(oldStartVnode, newEndVnode);\n api.insertBefore(parentElm, oldStartVnode.elm!, api.nextSibling(oldEndVnode.elm!));\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldEndVnode, newStartVnode)) {\n // Vnode moved left\n patchVnode(oldEndVnode, newStartVnode);\n api.insertBefore(parentElm, oldEndVnode.elm!, oldStartVnode.elm!);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else {\n if (isUndef(oldKeyToIdx)) {\n oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\n }\n idxInOld = oldKeyToIdx[newStartVnode.key];\n if (isUndef(idxInOld)) {\n // New element\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm!);\n }\n else {\n elmToMove = oldCh[idxInOld];\n if (elmToMove.tag !== newStartVnode.tag) {\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm!);\n }\n else {\n patchVnode(elmToMove, newStartVnode);\n oldCh[idxInOld] = undefined;\n api.insertBefore(parentElm, elmToMove.elm!, oldStartVnode.elm!);\n }\n }\n newStartVnode = newCh[++newStartIdx];\n }\n }\n if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {\n if (oldStartIdx > oldEndIdx) {\n before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;\n addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);\n }\n else {\n removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n }\n }\n}\n\nfunction patchVnode(oldVnode: SVGVNode, vnode: SVGVNode) {\n const elm = (vnode.elm = oldVnode.elm)!;\n const oldCh = oldVnode.children;\n const ch = vnode.children;\n if (oldVnode === vnode) {\n return;\n }\n\n updateAttrs(oldVnode, vnode);\n\n if (isUndef(vnode.text)) {\n if (isDef(oldCh) && isDef(ch)) {\n if (oldCh !== ch) {\n updateChildren(elm, oldCh, ch);\n }\n }\n else if (isDef(ch)) {\n if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n addVnodes(elm, null, ch, 0, ch.length - 1);\n }\n else if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n else if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n }\n else if (oldVnode.text !== vnode.text) {\n if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n api.setTextContent(elm, vnode.text!);\n }\n}\n\nexport default function patch(oldVnode: SVGVNode, vnode: SVGVNode): SVGVNode {\n if (sameVnode(oldVnode, vnode)) {\n patchVnode(oldVnode, vnode);\n }\n else {\n const elm = oldVnode.elm!;\n const parent = api.parentNode(elm);\n\n createElm(vnode);\n\n if (parent !== null) {\n api.insertBefore(parent, vnode.elm!, api.nextSibling(elm));\n removeVnodes(parent, [oldVnode], 0, 0);\n }\n }\n\n return vnode;\n}\n", "/**\n * SVG Painter\n */\n\nimport {\n brush,\n setClipPath,\n setGradient,\n setPattern\n} from './graphic';\nimport Displayable from '../graphic/Displayable';\nimport Storage from '../Storage';\nimport { PainterBase } from '../PainterBase';\nimport {\n createElement,\n createVNode,\n vNodeToString,\n SVGVNodeAttrs,\n SVGVNode,\n getCssString,\n BrushScope,\n createBrushScope,\n createSVGVNode\n} from './core';\nimport { normalizeColor, encodeBase64, isGradient, isPattern } from './helper';\nimport { extend, keys, logError, map, noop, retrieve2 } from '../core/util';\nimport Path from '../graphic/Path';\nimport patch, { updateAttrs } from './patch';\nimport { getSize } from '../canvas/helper';\nimport { GradientObject } from '../graphic/Gradient';\nimport { PatternObject } from '../graphic/Pattern';\n\nlet svgId = 0;\n\ninterface SVGPainterOption {\n width?: number\n height?: number\n ssr?: boolean\n}\n\ntype SVGPainterBackgroundColor = string | GradientObject | PatternObject;\n\nclass SVGPainter implements PainterBase {\n\n type = 'svg'\n\n storage: Storage\n\n root: HTMLElement\n\n private _svgDom: SVGElement\n private _viewport: HTMLElement\n\n private _opts: SVGPainterOption\n\n private _oldVNode: SVGVNode\n private _bgVNode: SVGVNode\n private _mainVNode: SVGVNode\n\n private _width: number\n private _height: number\n\n private _backgroundColor: SVGPainterBackgroundColor\n\n private _id: string\n\n constructor(root: HTMLElement, storage: Storage, opts: SVGPainterOption) {\n this.storage = storage;\n this._opts = opts = extend({}, opts);\n\n this.root = root;\n // A unique id for generating svg ids.\n this._id = 'zr' + svgId++;\n\n this._oldVNode = createSVGVNode(opts.width, opts.height);\n\n if (root && !opts.ssr) {\n const viewport = this._viewport = document.createElement('div');\n viewport.style.cssText = 'position:relative;overflow:hidden';\n const svgDom = this._svgDom = this._oldVNode.elm = createElement('svg');\n updateAttrs(null, this._oldVNode);\n viewport.appendChild(svgDom);\n root.appendChild(viewport);\n }\n\n this.resize(opts.width, opts.height);\n }\n\n getType() {\n return this.type;\n }\n\n getViewportRoot() {\n return this._viewport;\n }\n getViewportRootOffset() {\n const viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n }\n\n getSvgDom() {\n return this._svgDom;\n }\n\n refresh() {\n if (this.root) {\n const vnode = this.renderToVNode({\n willUpdate: true\n });\n // Disable user selection.\n vnode.attrs.style = 'position:absolute;left:0;top:0;user-select:none';\n patch(this._oldVNode, vnode);\n this._oldVNode = vnode;\n }\n }\n\n renderOneToVNode(el: Displayable) {\n return brush(el, createBrushScope(this._id));\n }\n\n renderToVNode(opts?: {\n animation?: boolean,\n willUpdate?: boolean,\n compress?: boolean,\n useViewBox?: boolean,\n emphasis?: boolean\n }) {\n\n opts = opts || {};\n\n const list = this.storage.getDisplayList(true);\n const width = this._width;\n const height = this._height;\n\n const scope = createBrushScope(this._id);\n scope.animation = opts.animation;\n scope.willUpdate = opts.willUpdate;\n scope.compress = opts.compress;\n scope.emphasis = opts.emphasis;\n scope.ssr = this._opts.ssr;\n\n const children: SVGVNode[] = [];\n\n const bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope);\n bgVNode && children.push(bgVNode);\n\n // Ignore the root g if wan't the output to be more tight.\n const mainVNode = !opts.compress\n ? (this._mainVNode = createVNode('g', 'main', {}, [])) : null;\n this._paintList(list, scope, mainVNode ? mainVNode.children : children);\n mainVNode && children.push(mainVNode);\n\n const defs = map(keys(scope.defs), (id) => scope.defs[id]);\n if (defs.length) {\n children.push(createVNode('defs', 'defs', {}, defs));\n }\n\n if (opts.animation) {\n const animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, { newline: true });\n if (animationCssStr) {\n const styleNode = createVNode('style', 'stl', {}, [], animationCssStr);\n children.push(styleNode);\n }\n }\n\n return createSVGVNode(width, height, children, opts.useViewBox);\n }\n\n renderToString(opts?: {\n /**\n * If add css animation.\n * @default true\n */\n cssAnimation?: boolean,\n /**\n * If add css emphasis.\n * @default true\n */\n cssEmphasis?: boolean,\n /**\n * If use viewBox\n * @default true\n */\n useViewBox?: boolean\n }) {\n opts = opts || {};\n return vNodeToString(this.renderToVNode({\n animation: retrieve2(opts.cssAnimation, true),\n emphasis: retrieve2(opts.cssEmphasis, true),\n willUpdate: false,\n compress: true,\n useViewBox: retrieve2(opts.useViewBox, true)\n }), { newline: true });\n }\n\n setBackgroundColor(backgroundColor: SVGPainterBackgroundColor) {\n this._backgroundColor = backgroundColor;\n }\n\n getSvgRoot() {\n return this._mainVNode && this._mainVNode.elm as SVGElement;\n }\n\n _paintList(list: Displayable[], scope: BrushScope, out?: SVGVNode[]) {\n const listLen = list.length;\n\n const clipPathsGroupsStack: SVGVNode[] = [];\n let clipPathsGroupsStackDepth = 0;\n let currentClipPathGroup;\n let prevClipPaths: Path[];\n let clipGroupNodeIdx = 0;\n for (let i = 0; i < listLen; i++) {\n const displayable = list[i];\n if (!displayable.invisible) {\n const clipPaths = displayable.__clipPaths;\n const len = clipPaths && clipPaths.length || 0;\n const prevLen = prevClipPaths && prevClipPaths.length || 0;\n let lca;\n // Find the lowest common ancestor\n for (lca = Math.max(len - 1, prevLen - 1); lca >= 0; lca--) {\n if (clipPaths && prevClipPaths\n && clipPaths[lca] === prevClipPaths[lca]\n ) {\n break;\n }\n }\n // pop the stack\n for (let i = prevLen - 1; i > lca; i--) {\n clipPathsGroupsStackDepth--;\n // svgEls.push(closeGroup);\n currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1];\n }\n // Pop clip path group for clipPaths not match the previous.\n for (let i = lca + 1; i < len; i++) {\n const groupAttrs: SVGVNodeAttrs = {};\n setClipPath(\n clipPaths[i],\n groupAttrs,\n scope\n );\n const g = createVNode(\n 'g',\n 'clip-g-' + clipGroupNodeIdx++,\n groupAttrs,\n []\n );\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(g);\n clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g;\n currentClipPathGroup = g;\n }\n prevClipPaths = clipPaths;\n\n const ret = brush(displayable, scope);\n if (ret) {\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(ret);\n }\n }\n }\n }\n\n resize(width: number, height: number) {\n // Save input w/h\n const opts = this._opts;\n const root = this.root;\n const viewport = this._viewport;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n\n if (root && viewport) {\n // FIXME Why ?\n viewport.style.display = 'none';\n\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n\n viewport.style.display = '';\n }\n\n if (this._width !== width || this._height !== height) {\n this._width = width;\n this._height = height;\n\n if (viewport) {\n const viewportStyle = viewport.style;\n viewportStyle.width = width + 'px';\n viewportStyle.height = height + 'px';\n }\n\n if (!isPattern(this._backgroundColor)) {\n const svgDom = this._svgDom;\n if (svgDom) {\n // Set width by 'svgRoot.width = width' is invalid\n svgDom.setAttribute('width', width as any);\n svgDom.setAttribute('height', height as any);\n }\n\n const bgEl = this._bgVNode && this._bgVNode.elm as SVGElement;\n if (bgEl) {\n bgEl.setAttribute('width', width as any);\n bgEl.setAttribute('height', height as any);\n }\n }\n else {\n // pattern backgroundColor requires a full refresh\n this.refresh();\n }\n }\n }\n\n /**\n * \u83B7\u53D6\u7ED8\u56FE\u533A\u57DF\u5BBD\u5EA6\n */\n getWidth() {\n return this._width;\n }\n\n /**\n * \u83B7\u53D6\u7ED8\u56FE\u533A\u57DF\u9AD8\u5EA6\n */\n getHeight() {\n return this._height;\n }\n\n dispose() {\n if (this.root) {\n this.root.innerHTML = '';\n }\n\n this._svgDom =\n this._viewport =\n this.storage =\n this._oldVNode =\n this._bgVNode =\n this._mainVNode = null;\n }\n clear() {\n if (this._svgDom) {\n this._svgDom.innerHTML = null;\n }\n this._oldVNode = null;\n }\n toDataURL(base64?: boolean) {\n let str = this.renderToString();\n const prefix = 'data:image/svg+xml;';\n if (base64) {\n str = encodeBase64(str);\n return str && prefix + 'base64,' + str;\n }\n return prefix + 'charset=UTF-8,' + encodeURIComponent(str);\n }\n\n refreshHover = createMethodNotSupport('refreshHover') as PainterBase['refreshHover'];\n configLayer = createMethodNotSupport('configLayer') as PainterBase['configLayer'];\n}\n\n\n// Not supported methods\nfunction createMethodNotSupport(method: string): any {\n return function () {\n if (process.env.NODE_ENV !== 'production') {\n logError('In SVG mode painter not support method \"' + method + '\"');\n }\n };\n}\n\nfunction createBackgroundVNode(\n width: number,\n height: number,\n backgroundColor: SVGPainterBackgroundColor,\n scope: BrushScope\n) {\n let bgVNode;\n if (backgroundColor && backgroundColor !== 'none') {\n bgVNode = createVNode(\n 'rect',\n 'bg',\n {\n width,\n height,\n x: '0',\n y: '0'\n }\n );\n if (isGradient(backgroundColor)) {\n setGradient({ fill: backgroundColor as any }, bgVNode.attrs, 'fill', scope);\n }\n else if (isPattern(backgroundColor)) {\n setPattern({\n style: {\n fill: backgroundColor\n },\n dirty: noop,\n getBoundingRect: () => ({ width, height })\n } as any, bgVNode.attrs, 'fill', scope);\n }\n else {\n const { color, opacity } = normalizeColor(backgroundColor);\n bgVNode.attrs.fill = color;\n opacity < 1 && (bgVNode.attrs['fill-opacity'] = opacity);\n }\n }\n return bgVNode;\n}\n\nexport default SVGPainter;\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../extension';\r\nimport SVGPainter from 'zrender/src/svg/Painter';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerPainter('svg', SVGPainter);\r\n}", "import * as util from '../core/util';\nimport {devicePixelRatio} from '../config';\nimport { ImagePatternObject } from '../graphic/Pattern';\nimport CanvasPainter from './Painter';\nimport { GradientObject, InnerGradientObject } from '../graphic/Gradient';\nimport { ZRCanvasRenderingContext } from '../core/types';\nimport Eventful from '../core/Eventful';\nimport { ElementEventCallback } from '../Element';\nimport { getCanvasGradient } from './helper';\nimport { createCanvasPattern } from './graphic';\nimport Displayable from '../graphic/Displayable';\nimport BoundingRect from '../core/BoundingRect';\nimport { REDRAW_BIT } from '../graphic/constants';\nimport { platformApi } from '../core/platform';\n\nfunction createDom(id: string, painter: CanvasPainter, dpr: number) {\n const newDom = platformApi.createCanvas();\n const width = painter.getWidth();\n const height = painter.getHeight();\n\n const newDomStyle = newDom.style;\n if (newDomStyle) { // In node or some other non-browser environment\n newDomStyle.position = 'absolute';\n newDomStyle.left = '0';\n newDomStyle.top = '0';\n newDomStyle.width = width + 'px';\n newDomStyle.height = height + 'px';\n\n newDom.setAttribute('data-zr-dom-id', id);\n }\n\n newDom.width = width * dpr;\n newDom.height = height * dpr;\n\n return newDom;\n}\n\nexport interface LayerConfig {\n // \u6BCF\u6B21\u6E05\u7A7A\u753B\u5E03\u7684\u989C\u8272\n clearColor?: string | GradientObject | ImagePatternObject\n // \u662F\u5426\u5F00\u542F\u52A8\u6001\u6A21\u7CCA\n motionBlur?: boolean\n // \u5728\u5F00\u542F\u52A8\u6001\u6A21\u7CCA\u7684\u65F6\u5019\u4F7F\u7528\uFF0C\u4E0E\u4E0A\u4E00\u5E27\u6DF7\u5408\u7684alpha\u503C\uFF0C\u503C\u8D8A\u5927\u5C3E\u8FF9\u8D8A\u660E\u663E\n lastFrameAlpha?: number\n};\n\nexport default class Layer extends Eventful {\n\n id: string\n\n dom: HTMLCanvasElement\n domBack: HTMLCanvasElement\n\n ctx: CanvasRenderingContext2D\n ctxBack: CanvasRenderingContext2D\n\n painter: CanvasPainter\n\n // Configs\n /**\n * \u6BCF\u6B21\u6E05\u7A7A\u753B\u5E03\u7684\u989C\u8272\n */\n clearColor: string | GradientObject | ImagePatternObject\n /**\n * \u662F\u5426\u5F00\u542F\u52A8\u6001\u6A21\u7CCA\n */\n motionBlur = false\n /**\n * \u5728\u5F00\u542F\u52A8\u6001\u6A21\u7CCA\u7684\u65F6\u5019\u4F7F\u7528\uFF0C\u4E0E\u4E0A\u4E00\u5E27\u6DF7\u5408\u7684alpha\u503C\uFF0C\u503C\u8D8A\u5927\u5C3E\u8FF9\u8D8A\u660E\u663E\n */\n lastFrameAlpha = 0.7\n /**\n * Layer dpr\n */\n dpr = 1\n\n /**\n * Virtual layer will not be inserted into dom.\n */\n virtual = false\n\n config = {}\n\n incremental = false\n\n zlevel = 0\n\n maxRepaintRectCount = 5\n\n private _paintRects: BoundingRect[]\n\n __dirty = true\n __firstTimePaint = true\n\n __used = false\n\n __drawIndex = 0\n __startIndex = 0\n __endIndex = 0\n\n // indices in the previous frame\n __prevStartIndex: number = null\n __prevEndIndex: number = null\n\n __builtin__: boolean\n\n constructor(id: string | HTMLCanvasElement, painter: CanvasPainter, dpr?: number) {\n super();\n\n let dom;\n dpr = dpr || devicePixelRatio;\n if (typeof id === 'string') {\n dom = createDom(id, painter, dpr);\n }\n // Not using isDom because in node it will return false\n else if (util.isObject(id)) {\n dom = id;\n id = dom.id;\n }\n this.id = id as string;\n this.dom = dom;\n\n const domStyle = dom.style;\n if (domStyle) { // Not in node\n util.disableUserSelect(dom);\n dom.onselectstart = () => false;\n domStyle.padding = '0';\n domStyle.margin = '0';\n domStyle.borderWidth = '0';\n }\n\n this.painter = painter;\n\n this.dpr = dpr;\n }\n\n getElementCount() {\n return this.__endIndex - this.__startIndex;\n }\n\n afterBrush() {\n this.__prevStartIndex = this.__startIndex;\n this.__prevEndIndex = this.__endIndex;\n }\n\n initContext() {\n this.ctx = this.dom.getContext('2d');\n (this.ctx as ZRCanvasRenderingContext).dpr = this.dpr;\n }\n\n setUnpainted() {\n this.__firstTimePaint = true;\n }\n\n createBackBuffer() {\n const dpr = this.dpr;\n\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\n this.ctxBack = this.domBack.getContext('2d');\n\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n }\n\n /**\n * Create repaint list when using dirty rect rendering.\n *\n * @param displayList current rendering list\n * @param prevList last frame rendering list\n * @return repaint rects. null for the first frame, [] for no element dirty\n */\n createRepaintRects(\n displayList: Displayable[],\n prevList: Displayable[],\n viewWidth: number,\n viewHeight: number\n ) {\n if (this.__firstTimePaint) {\n this.__firstTimePaint = false;\n return null;\n }\n\n const mergedRepaintRects: BoundingRect[] = [];\n const maxRepaintRectCount = this.maxRepaintRectCount;\n let full = false;\n const pendingRect = new BoundingRect(0, 0, 0, 0);\n\n function addRectToMergePool(rect: BoundingRect) {\n if (!rect.isFinite() || rect.isZero()) {\n return;\n }\n\n if (mergedRepaintRects.length === 0) {\n // First rect, create new merged rect\n const boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n else {\n let isMerged = false;\n let minDeltaArea = Infinity;\n let bestRectToMergeIdx = 0;\n for (let i = 0; i < mergedRepaintRects.length; ++i) {\n const mergedRect = mergedRepaintRects[i];\n\n // Merge if has intersection\n if (mergedRect.intersect(rect)) {\n const pendingRect = new BoundingRect(0, 0, 0, 0);\n pendingRect.copy(mergedRect);\n pendingRect.union(rect);\n mergedRepaintRects[i] = pendingRect;\n isMerged = true;\n break;\n }\n else if (full) {\n // Merged to exists rectangles if full\n pendingRect.copy(rect);\n pendingRect.union(mergedRect);\n const aArea = rect.width * rect.height;\n const bArea = mergedRect.width * mergedRect.height;\n const pendingArea = pendingRect.width * pendingRect.height;\n const deltaArea = pendingArea - aArea - bArea;\n if (deltaArea < minDeltaArea) {\n minDeltaArea = deltaArea;\n bestRectToMergeIdx = i;\n }\n }\n }\n\n if (full) {\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\n isMerged = true;\n }\n\n if (!isMerged) {\n // Create new merged rect if cannot merge with current\n const boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n if (!full) {\n full = mergedRepaintRects.length >= maxRepaintRectCount;\n }\n }\n }\n\n /**\n * Loop the paint list of this frame and get the dirty rects of elements\n * in this frame.\n */\n for (let i = this.__startIndex; i < this.__endIndex; ++i) {\n const el = displayList[i];\n if (el) {\n /**\n * `shouldPaint` is true only when the element is not ignored or\n * invisible and all its ancestors are not ignored.\n * `shouldPaint` being true means it will be brushed this frame.\n *\n * `__isRendered` being true means the element is currently on\n * the canvas.\n *\n * `__dirty` being true means the element should be brushed this\n * frame.\n *\n * We only need to repaint the element's previous painting rect\n * if it's currently on the canvas and needs repaint this frame\n * or not painted this frame.\n */\n const shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n const prevRect = el.__isRendered && ((el.__dirty & REDRAW_BIT) || !shouldPaint)\n ? el.getPrevPaintRect()\n : null;\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n\n /**\n * On the other hand, we only need to paint the current rect\n * if the element should be brushed this frame and either being\n * dirty or not rendered before.\n */\n const curRect = shouldPaint && ((el.__dirty & REDRAW_BIT) || !el.__isRendered)\n ? el.getPaintRect()\n : null;\n if (curRect) {\n addRectToMergePool(curRect);\n }\n }\n }\n\n /**\n * The above loop calculates the dirty rects of elements that are in the\n * paint list this frame, which does not include those elements removed\n * in this frame. So we loop the `prevList` to get the removed elements.\n */\n for (let i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\n const el = prevList[i];\n /**\n * Consider the elements whose ancestors are invisible, they should\n * not be painted and their previous painting rects should be\n * cleared if they are rendered on the canvas (`__isRendered` being\n * true). `!shouldPaint` means the element is not brushed in this\n * frame.\n *\n * `!el.__zr` means it's removed from the storage.\n *\n * In conclusion, an element needs to repaint the previous painting\n * rect if and only if it's not painted this frame and was\n * previously painted on the canvas.\n */\n const shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true);\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\n // el was removed\n const prevRect = el.getPrevPaintRect();\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n }\n }\n\n // Merge intersected rects in the result\n let hasIntersections;\n do {\n hasIntersections = false;\n for (let i = 0; i < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].isZero()) {\n mergedRepaintRects.splice(i, 1);\n continue;\n }\n for (let j = i + 1; j < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\n hasIntersections = true;\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\n mergedRepaintRects.splice(j, 1);\n }\n else {\n j++;\n }\n }\n i++;\n }\n } while (hasIntersections);\n\n this._paintRects = mergedRepaintRects;\n\n return mergedRepaintRects;\n }\n\n /**\n * Get paint rects for debug usage.\n */\n debugGetPaintRects() {\n return (this._paintRects || []).slice();\n }\n\n resize(width: number, height: number) {\n const dpr = this.dpr;\n\n const dom = this.dom;\n const domStyle = dom.style;\n const domBack = this.domBack;\n\n if (domStyle) {\n domStyle.width = width + 'px';\n domStyle.height = height + 'px';\n }\n\n dom.width = width * dpr;\n dom.height = height * dpr;\n\n if (domBack) {\n domBack.width = width * dpr;\n domBack.height = height * dpr;\n\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n }\n }\n\n /**\n * \u6E05\u7A7A\u8BE5\u5C42\u753B\u5E03\n */\n clear(\n clearAll?: boolean,\n clearColor?: string | GradientObject | ImagePatternObject,\n repaintRects?: BoundingRect[]\n ) {\n const dom = this.dom;\n const ctx = this.ctx;\n const width = dom.width;\n const height = dom.height;\n\n clearColor = clearColor || this.clearColor;\n const haveMotionBLur = this.motionBlur && !clearAll;\n const lastFrameAlpha = this.lastFrameAlpha;\n\n const dpr = this.dpr;\n const self = this;\n\n if (haveMotionBLur) {\n if (!this.domBack) {\n this.createBackBuffer();\n }\n\n this.ctxBack.globalCompositeOperation = 'copy';\n this.ctxBack.drawImage(\n dom, 0, 0,\n width / dpr,\n height / dpr\n );\n }\n\n const domBack = this.domBack;\n\n function doClear(x: number, y: number, width: number, height: number) {\n ctx.clearRect(x, y, width, height);\n if (clearColor && clearColor !== 'transparent') {\n let clearColorGradientOrPattern;\n // Gradient\n if (util.isGradientObject(clearColor)) {\n // shouldn't cache when clearColor is not global and size changed\n const shouldCache = clearColor.global || (\n (clearColor as InnerGradientObject).__width === width\n && (clearColor as InnerGradientObject).__height === height\n );\n // Cache canvas gradient\n clearColorGradientOrPattern = shouldCache\n && (clearColor as InnerGradientObject).__canvasGradient\n || getCanvasGradient(ctx, clearColor, {\n x: 0,\n y: 0,\n width: width,\n height: height\n });\n\n (clearColor as InnerGradientObject).__canvasGradient = clearColorGradientOrPattern;\n (clearColor as InnerGradientObject).__width = width;\n (clearColor as InnerGradientObject).__height = height;\n }\n // Pattern\n else if (util.isImagePatternObject(clearColor)) {\n // scale pattern by dpr\n clearColor.scaleX = clearColor.scaleX || dpr;\n clearColor.scaleY = clearColor.scaleY || dpr;\n clearColorGradientOrPattern = createCanvasPattern(\n ctx, clearColor, {\n dirty() {\n self.setUnpainted();\n self.painter.refresh();\n }\n }\n );\n }\n ctx.save();\n ctx.fillStyle = clearColorGradientOrPattern || (clearColor as string);\n ctx.fillRect(x, y, width, height);\n ctx.restore();\n }\n\n if (haveMotionBLur) {\n ctx.save();\n ctx.globalAlpha = lastFrameAlpha;\n ctx.drawImage(domBack, x, y, width, height);\n ctx.restore();\n }\n };\n\n if (!repaintRects || haveMotionBLur) {\n // Clear the full canvas\n doClear(0, 0, width, height);\n }\n else if (repaintRects.length) {\n // Clear the repaint areas\n util.each(repaintRects, rect => {\n doClear(\n rect.x * dpr,\n rect.y * dpr,\n rect.width * dpr,\n rect.height * dpr\n );\n });\n }\n }\n\n // Interface of refresh\n refresh: (clearColor?: string | GradientObject | ImagePatternObject) => void\n\n // Interface of renderToCanvas in getRenderedCanvas\n renderToCanvas: (ctx: CanvasRenderingContext2D) => void\n\n // Events\n onclick: ElementEventCallback\n ondblclick: ElementEventCallback\n onmouseover: ElementEventCallback\n onmouseout: ElementEventCallback\n onmousemove: ElementEventCallback\n onmousewheel: ElementEventCallback\n onmousedown: ElementEventCallback\n onmouseup: ElementEventCallback\n oncontextmenu: ElementEventCallback\n\n ondrag: ElementEventCallback\n ondragstart: ElementEventCallback\n ondragend: ElementEventCallback\n ondragenter: ElementEventCallback\n ondragleave: ElementEventCallback\n ondragover: ElementEventCallback\n ondrop: ElementEventCallback\n}\n", "import {devicePixelRatio} from '../config';\nimport * as util from '../core/util';\nimport Layer, { LayerConfig } from './Layer';\nimport requestAnimationFrame from '../animation/requestAnimationFrame';\nimport env from '../core/env';\nimport Displayable from '../graphic/Displayable';\nimport { WXCanvasRenderingContext } from '../core/types';\nimport { GradientObject } from '../graphic/Gradient';\nimport { ImagePatternObject } from '../graphic/Pattern';\nimport Storage from '../Storage';\nimport { brush, BrushScope, brushSingle } from './graphic';\nimport { PainterBase } from '../PainterBase';\nimport BoundingRect from '../core/BoundingRect';\nimport { REDRAW_BIT } from '../graphic/constants';\nimport { getSize } from './helper';\nimport type IncrementalDisplayable from '../graphic/IncrementalDisplayable';\n\nconst HOVER_LAYER_ZLEVEL = 1e5;\nconst CANVAS_ZLEVEL = 314159;\n\nconst EL_AFTER_INCREMENTAL_INC = 0.01;\nconst INCREMENTAL_INC = 0.001;\n\n\nfunction isLayerValid(layer: Layer) {\n if (!layer) {\n return false;\n }\n\n if (layer.__builtin__) {\n return true;\n }\n\n if (typeof (layer.resize) !== 'function'\n || typeof (layer.refresh) !== 'function'\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction createRoot(width: number, height: number) {\n const domRoot = document.createElement('div');\n\n // domRoot.onselectstart = returnFalse; // Avoid page selected\n domRoot.style.cssText = [\n 'position:relative',\n // IOS13 safari probably has a compositing bug (z order of the canvas and the consequent\n // dom does not act as expected) when some of the parent dom has\n // `-webkit-overflow-scrolling: touch;` and the webpage is longer than one screen and\n // the canvas is not at the top part of the page.\n // Check `https://bugs.webkit.org/show_bug.cgi?id=203681` for more details. We remove\n // this `overflow:hidden` to avoid the bug.\n // 'overflow:hidden',\n 'width:' + width + 'px',\n 'height:' + height + 'px',\n 'padding:0',\n 'margin:0',\n 'border-width:0'\n ].join(';') + ';';\n\n return domRoot;\n}\n\ninterface CanvasPainterOption {\n devicePixelRatio?: number\n width?: number | string // Can be 10 / 10px / auto\n height?: number | string,\n useDirtyRect?: boolean\n}\n\nexport default class CanvasPainter implements PainterBase {\n\n type = 'canvas'\n\n root: HTMLElement\n\n dpr: number\n\n storage: Storage\n\n private _singleCanvas: boolean\n\n private _opts: CanvasPainterOption\n\n private _zlevelList: number[] = []\n\n private _prevDisplayList: Displayable[] = []\n\n private _layers: {[key: number]: Layer} = {} // key is zlevel\n\n private _layerConfig: {[key: number]: LayerConfig} = {} // key is zlevel\n\n /**\n * zrender will do compositing when root is a canvas and have multiple zlevels.\n */\n private _needsManuallyCompositing = false\n\n private _width: number\n private _height: number\n\n private _domRoot: HTMLElement\n\n private _hoverlayer: Layer\n\n private _redrawId: number\n\n private _backgroundColor: string | GradientObject | ImagePatternObject\n\n\n constructor(root: HTMLElement, storage: Storage, opts: CanvasPainterOption, id: number) {\n\n this.type = 'canvas';\n\n // In node environment using node-canvas\n const singleCanvas = !root.nodeName // In node ?\n || root.nodeName.toUpperCase() === 'CANVAS';\n\n this._opts = opts = util.extend({}, opts || {}) as CanvasPainterOption;\n\n /**\n * @type {number}\n */\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\n /**\n * @type {boolean}\n * @private\n */\n this._singleCanvas = singleCanvas;\n /**\n * \u7ED8\u56FE\u5BB9\u5668\n * @type {HTMLElement}\n */\n this.root = root;\n\n const rootStyle = root.style;\n\n if (rootStyle) {\n // @ts-ignore\n util.disableUserSelect(root);\n root.innerHTML = '';\n }\n\n /**\n * @type {module:zrender/Storage}\n */\n this.storage = storage;\n\n const zlevelList: number[] = this._zlevelList;\n\n this._prevDisplayList = [];\n\n const layers = this._layers;\n\n if (!singleCanvas) {\n this._width = getSize(root, 0, opts);\n this._height = getSize(root, 1, opts);\n\n const domRoot = this._domRoot = createRoot(\n this._width, this._height\n );\n root.appendChild(domRoot);\n }\n else {\n const rootCanvas = root as HTMLCanvasElement;\n let width = rootCanvas.width;\n let height = rootCanvas.height;\n\n if (opts.width != null) {\n // TODO sting?\n width = opts.width as number;\n }\n if (opts.height != null) {\n // TODO sting?\n height = opts.height as number;\n }\n this.dpr = opts.devicePixelRatio || 1;\n\n // Use canvas width and height directly\n rootCanvas.width = width * this.dpr;\n rootCanvas.height = height * this.dpr;\n\n this._width = width;\n this._height = height;\n\n // Create layer if only one given canvas\n // Device can be specified to create a high dpi image.\n const mainLayer = new Layer(rootCanvas, this, this.dpr);\n mainLayer.__builtin__ = true;\n mainLayer.initContext();\n // FIXME Use canvas width and height\n // mainLayer.resize(width, height);\n layers[CANVAS_ZLEVEL] = mainLayer;\n mainLayer.zlevel = CANVAS_ZLEVEL;\n // Not use common zlevel.\n zlevelList.push(CANVAS_ZLEVEL);\n\n this._domRoot = root;\n }\n }\n\n\n getType() {\n return 'canvas';\n }\n\n /**\n * If painter use a single canvas\n */\n isSingleCanvas() {\n return this._singleCanvas;\n }\n\n getViewportRoot() {\n return this._domRoot;\n }\n\n getViewportRootOffset() {\n const viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n }\n\n /**\n * \u5237\u65B0\n * @param paintAll \u5F3A\u5236\u7ED8\u5236\u6240\u6709displayable\n */\n refresh(paintAll?: boolean) {\n const list = this.storage.getDisplayList(true);\n const prevList = this._prevDisplayList;\n\n const zlevelList = this._zlevelList;\n\n this._redrawId = Math.random();\n\n this._paintList(list, prevList, paintAll, this._redrawId);\n\n // Paint custum layers\n for (let i = 0; i < zlevelList.length; i++) {\n const z = zlevelList[i];\n const layer = this._layers[z];\n if (!layer.__builtin__ && layer.refresh) {\n const clearColor = i === 0 ? this._backgroundColor : null;\n layer.refresh(clearColor);\n }\n }\n\n if (this._opts.useDirtyRect) {\n this._prevDisplayList = list.slice();\n }\n\n return this;\n }\n\n\n refreshHover() {\n this._paintHoverList(this.storage.getDisplayList(false));\n }\n\n private _paintHoverList(list: Displayable[]) {\n let len = list.length;\n let hoverLayer = this._hoverlayer;\n hoverLayer && hoverLayer.clear();\n\n if (!len) {\n return;\n }\n\n const scope: BrushScope = {\n inHover: true,\n viewWidth: this._width,\n viewHeight: this._height\n };\n\n let ctx;\n for (let i = 0; i < len; i++) {\n const el = list[i];\n if (el.__inHover) {\n // Use a extream large zlevel\n // FIXME?\n if (!hoverLayer) {\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\n }\n\n if (!ctx) {\n ctx = hoverLayer.ctx;\n ctx.save();\n }\n\n brush(ctx, el, scope, i === len - 1);\n }\n }\n if (ctx) {\n ctx.restore();\n }\n }\n\n getHoverLayer() {\n return this.getLayer(HOVER_LAYER_ZLEVEL);\n }\n\n paintOne(ctx: CanvasRenderingContext2D, el: Displayable) {\n brushSingle(ctx, el);\n }\n\n private _paintList(list: Displayable[], prevList: Displayable[], paintAll: boolean, redrawId?: number) {\n if (this._redrawId !== redrawId) {\n return;\n }\n\n paintAll = paintAll || false;\n\n this._updateLayerStatus(list);\n\n const {finished, needsRefreshHover} = this._doPaintList(list, prevList, paintAll);\n\n if (this._needsManuallyCompositing) {\n this._compositeManually();\n }\n\n if (needsRefreshHover) {\n this._paintHoverList(list);\n }\n\n if (!finished) {\n const self = this;\n requestAnimationFrame(function () {\n self._paintList(list, prevList, paintAll, redrawId);\n });\n }\n else {\n this.eachLayer(layer => {\n layer.afterBrush && layer.afterBrush();\n });\n }\n }\n\n private _compositeManually() {\n const ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\n const width = (this._domRoot as HTMLCanvasElement).width;\n const height = (this._domRoot as HTMLCanvasElement).height;\n ctx.clearRect(0, 0, width, height);\n // PENDING, If only builtin layer?\n this.eachBuiltinLayer(function (layer) {\n if (layer.virtual) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n }\n });\n }\n\n private _doPaintList(\n list: Displayable[],\n prevList: Displayable[],\n paintAll?: boolean\n ): {\n finished: boolean\n needsRefreshHover: boolean\n } {\n const layerList = [];\n const useDirtyRect = this._opts.useDirtyRect;\n for (let zi = 0; zi < this._zlevelList.length; zi++) {\n const zlevel = this._zlevelList[zi];\n const layer = this._layers[zlevel];\n if (layer.__builtin__\n && layer !== this._hoverlayer\n && (layer.__dirty || paintAll)\n // Layer with hover elements can't be redrawn.\n // && !layer.__hasHoverLayerELement\n ) {\n layerList.push(layer);\n }\n }\n\n let finished = true;\n let needsRefreshHover = false;\n\n for (let k = 0; k < layerList.length; k++) {\n const layer = layerList[k];\n const ctx = layer.ctx;\n\n const repaintRects = useDirtyRect\n && layer.createRepaintRects(list, prevList, this._width, this._height);\n\n let start = paintAll ? layer.__startIndex : layer.__drawIndex;\n\n const useTimer = !paintAll && layer.incremental && Date.now;\n const startTime = useTimer && Date.now();\n\n const clearColor = layer.zlevel === this._zlevelList[0]\n ? this._backgroundColor : null;\n\n // All elements in this layer are removed.\n if (layer.__startIndex === layer.__endIndex) {\n layer.clear(false, clearColor, repaintRects);\n }\n else if (start === layer.__startIndex) {\n const firstEl = list[start];\n if (!firstEl.incremental || !(firstEl as IncrementalDisplayable).notClear || paintAll) {\n layer.clear(false, clearColor, repaintRects);\n }\n }\n if (start === -1) {\n console.error('For some unknown reason. drawIndex is -1');\n start = layer.__startIndex;\n }\n let i: number;\n /* eslint-disable-next-line */\n const repaint = (repaintRect?: BoundingRect) => {\n const scope: BrushScope = {\n inHover: false,\n allClipped: false,\n prevEl: null,\n viewWidth: this._width,\n viewHeight: this._height\n };\n\n for (i = start; i < layer.__endIndex; i++) {\n const el = list[i];\n\n if (el.__inHover) {\n needsRefreshHover = true;\n }\n\n this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\n\n if (useTimer) {\n // Date.now can be executed in 13,025,305 ops/second.\n const dTime = Date.now() - startTime;\n // Give 15 millisecond to draw.\n // The rest elements will be drawn in the next frame.\n if (dTime > 15) {\n break;\n }\n }\n }\n\n if (scope.prevElClipPaths) {\n // Needs restore the state. If last drawn element is in the clipping area.\n ctx.restore();\n }\n };\n\n if (repaintRects) {\n if (repaintRects.length === 0) {\n // Nothing to repaint, mark as finished\n i = layer.__endIndex;\n }\n else {\n const dpr = this.dpr;\n // Set repaintRect as clipPath\n for (var r = 0; r < repaintRects.length; ++r) {\n const rect = repaintRects[r];\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(\n rect.x * dpr,\n rect.y * dpr,\n rect.width * dpr,\n rect.height * dpr\n );\n ctx.clip();\n\n repaint(rect);\n ctx.restore();\n }\n }\n }\n else {\n // Paint all once\n ctx.save();\n repaint();\n ctx.restore();\n }\n\n layer.__drawIndex = i;\n\n if (layer.__drawIndex < layer.__endIndex) {\n finished = false;\n }\n }\n\n if (env.wxa) {\n // Flush for weixin application\n util.each(this._layers, function (layer) {\n if (layer && layer.ctx && (layer.ctx as WXCanvasRenderingContext).draw) {\n (layer.ctx as WXCanvasRenderingContext).draw();\n }\n });\n }\n\n return {\n finished,\n needsRefreshHover\n };\n }\n\n private _doPaintEl(\n el: Displayable,\n currentLayer: Layer,\n useDirtyRect: boolean,\n repaintRect: BoundingRect,\n scope: BrushScope,\n isLast: boolean\n ) {\n const ctx = currentLayer.ctx;\n if (useDirtyRect) {\n const paintRect = el.getPaintRect();\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\n brush(ctx, el, scope, isLast);\n el.setPrevPaintRect(paintRect);\n }\n }\n else {\n brush(ctx, el, scope, isLast);\n }\n }\n\n /**\n * \u83B7\u53D6 zlevel \u6240\u5728\u5C42\uFF0C\u5982\u679C\u4E0D\u5B58\u5728\u5219\u4F1A\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5C42\n * @param zlevel\n * @param virtual Virtual layer will not be inserted into dom.\n */\n getLayer(zlevel: number, virtual?: boolean) {\n if (this._singleCanvas && !this._needsManuallyCompositing) {\n zlevel = CANVAS_ZLEVEL;\n }\n let layer = this._layers[zlevel];\n if (!layer) {\n // Create a new layer\n layer = new Layer('zr_' + zlevel, this, this.dpr);\n layer.zlevel = zlevel;\n layer.__builtin__ = true;\n\n if (this._layerConfig[zlevel]) {\n util.merge(layer, this._layerConfig[zlevel], true);\n }\n // TODO Remove EL_AFTER_INCREMENTAL_INC magic number\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\n util.merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\n }\n\n if (virtual) {\n layer.virtual = virtual;\n }\n\n this.insertLayer(zlevel, layer);\n\n // Context is created after dom inserted to document\n // Or excanvas will get 0px clientWidth and clientHeight\n layer.initContext();\n }\n\n return layer;\n }\n\n insertLayer(zlevel: number, layer: Layer) {\n\n const layersMap = this._layers;\n const zlevelList = this._zlevelList;\n const len = zlevelList.length;\n const domRoot = this._domRoot;\n let prevLayer = null;\n let i = -1;\n\n if (layersMap[zlevel]) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('ZLevel ' + zlevel + ' has been used already');\n }\n return;\n }\n // Check if is a valid layer\n if (!isLayerValid(layer)) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('Layer of zlevel ' + zlevel + ' is not valid');\n }\n return;\n }\n\n if (len > 0 && zlevel > zlevelList[0]) {\n for (i = 0; i < len - 1; i++) {\n if (\n zlevelList[i] < zlevel\n && zlevelList[i + 1] > zlevel\n ) {\n break;\n }\n }\n prevLayer = layersMap[zlevelList[i]];\n }\n zlevelList.splice(i + 1, 0, zlevel);\n\n layersMap[zlevel] = layer;\n\n // Virtual layer will not directly show on the screen.\n // (It can be a WebGL layer and assigned to a ZRImage element)\n // But it still under management of zrender.\n if (!layer.virtual) {\n if (prevLayer) {\n const prevDom = prevLayer.dom;\n if (prevDom.nextSibling) {\n domRoot.insertBefore(\n layer.dom,\n prevDom.nextSibling\n );\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n else {\n if (domRoot.firstChild) {\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n }\n\n layer.painter || (layer.painter = this);\n }\n\n // Iterate each layer\n eachLayer(cb: (this: T, layer: Layer, z: number) => void, context?: T) {\n const zlevelList = this._zlevelList;\n for (let i = 0; i < zlevelList.length; i++) {\n const z = zlevelList[i];\n cb.call(context, this._layers[z], z);\n }\n }\n\n // Iterate each buildin layer\n eachBuiltinLayer(cb: (this: T, layer: Layer, z: number) => void, context?: T) {\n const zlevelList = this._zlevelList;\n for (let i = 0; i < zlevelList.length; i++) {\n const z = zlevelList[i];\n const layer = this._layers[z];\n if (layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n }\n\n // Iterate each other layer except buildin layer\n eachOtherLayer(cb: (this: T, layer: Layer, z: number) => void, context?: T) {\n const zlevelList = this._zlevelList;\n for (let i = 0; i < zlevelList.length; i++) {\n const z = zlevelList[i];\n const layer = this._layers[z];\n if (!layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n }\n\n /**\n * \u83B7\u53D6\u6240\u6709\u5DF2\u521B\u5EFA\u7684\u5C42\n * @param prevLayer\n */\n getLayers() {\n return this._layers;\n }\n\n _updateLayerStatus(list: Displayable[]) {\n\n this.eachBuiltinLayer(function (layer, z) {\n layer.__dirty = layer.__used = false;\n });\n\n function updatePrevLayer(idx: number) {\n if (prevLayer) {\n if (prevLayer.__endIndex !== idx) {\n prevLayer.__dirty = true;\n }\n prevLayer.__endIndex = idx;\n }\n }\n\n if (this._singleCanvas) {\n for (let i = 1; i < list.length; i++) {\n const el = list[i];\n if (el.zlevel !== list[i - 1].zlevel || el.incremental) {\n this._needsManuallyCompositing = true;\n break;\n }\n }\n }\n\n let prevLayer: Layer = null;\n let incrementalLayerCount = 0;\n let prevZlevel;\n let i;\n\n for (i = 0; i < list.length; i++) {\n const el = list[i];\n const zlevel = el.zlevel;\n let layer;\n\n if (prevZlevel !== zlevel) {\n prevZlevel = zlevel;\n incrementalLayerCount = 0;\n }\n\n // TODO Not use magic number on zlevel.\n\n // Each layer with increment element can be separated to 3 layers.\n // (Other Element drawn after incremental element)\n // -----------------zlevel + EL_AFTER_INCREMENTAL_INC--------------------\n // (Incremental element)\n // ----------------------zlevel + INCREMENTAL_INC------------------------\n // (Element drawn before incremental element)\n // --------------------------------zlevel--------------------------------\n if (el.incremental) {\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\n layer.incremental = true;\n incrementalLayerCount = 1;\n }\n else {\n layer = this.getLayer(\n zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0),\n this._needsManuallyCompositing\n );\n }\n\n if (!layer.__builtin__) {\n util.logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\n }\n\n if (layer !== prevLayer) {\n layer.__used = true;\n if (layer.__startIndex !== i) {\n layer.__dirty = true;\n }\n layer.__startIndex = i;\n if (!layer.incremental) {\n layer.__drawIndex = i;\n }\n else {\n // Mark layer draw index needs to update.\n layer.__drawIndex = -1;\n }\n updatePrevLayer(i);\n prevLayer = layer;\n }\n if ((el.__dirty & REDRAW_BIT) && !el.__inHover) { // Ignore dirty elements in hover layer.\n layer.__dirty = true;\n if (layer.incremental && layer.__drawIndex < 0) {\n // Start draw from the first dirty element.\n layer.__drawIndex = i;\n }\n }\n }\n\n updatePrevLayer(i);\n\n this.eachBuiltinLayer(function (layer, z) {\n // Used in last frame but not in this frame. Needs clear\n if (!layer.__used && layer.getElementCount() > 0) {\n layer.__dirty = true;\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\n }\n // For incremental layer. In case start index changed and no elements are dirty.\n if (layer.__dirty && layer.__drawIndex < 0) {\n layer.__drawIndex = layer.__startIndex;\n }\n });\n }\n\n /**\n * \u6E05\u9664hover\u5C42\u5916\u6240\u6709\u5185\u5BB9\n */\n clear() {\n this.eachBuiltinLayer(this._clearLayer);\n return this;\n }\n\n _clearLayer(layer: Layer) {\n layer.clear();\n }\n\n setBackgroundColor(backgroundColor: string | GradientObject | ImagePatternObject) {\n this._backgroundColor = backgroundColor;\n\n util.each(this._layers, layer => {\n layer.setUnpainted();\n });\n }\n\n /**\n * \u4FEE\u6539\u6307\u5B9Azlevel\u7684\u7ED8\u5236\u53C2\u6570\n */\n configLayer(zlevel: number, config: LayerConfig) {\n if (config) {\n const layerConfig = this._layerConfig;\n if (!layerConfig[zlevel]) {\n layerConfig[zlevel] = config;\n }\n else {\n util.merge(layerConfig[zlevel], config, true);\n }\n\n for (let i = 0; i < this._zlevelList.length; i++) {\n const _zlevel = this._zlevelList[i];\n // TODO Remove EL_AFTER_INCREMENTAL_INC magic number\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\n const layer = this._layers[_zlevel];\n util.merge(layer, layerConfig[zlevel], true);\n }\n }\n }\n }\n\n /**\n * \u5220\u9664\u6307\u5B9A\u5C42\n * @param zlevel \u5C42\u6240\u5728\u7684zlevel\n */\n delLayer(zlevel: number) {\n const layers = this._layers;\n const zlevelList = this._zlevelList;\n const layer = layers[zlevel];\n if (!layer) {\n return;\n }\n layer.dom.parentNode.removeChild(layer.dom);\n delete layers[zlevel];\n\n zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);\n }\n\n /**\n * \u533A\u57DF\u5927\u5C0F\u53D8\u5316\u540E\u91CD\u7ED8\n */\n resize(\n width?: number | string,\n height?: number | string\n ) {\n if (!this._domRoot.style) { // Maybe in node or worker\n if (width == null || height == null) {\n return;\n }\n // TODO width / height may be string\n this._width = width as number;\n this._height = height as number;\n\n this.getLayer(CANVAS_ZLEVEL).resize(width as number, height as number);\n }\n else {\n const domRoot = this._domRoot;\n // FIXME Why ?\n domRoot.style.display = 'none';\n\n // Save input w/h\n const opts = this._opts;\n const root = this.root;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n\n domRoot.style.display = '';\n\n // \u4F18\u5316\u6CA1\u6709\u5B9E\u9645\u6539\u53D8\u7684resize\n if (this._width !== width || height !== this._height) {\n domRoot.style.width = width + 'px';\n domRoot.style.height = height + 'px';\n\n for (let id in this._layers) {\n if (this._layers.hasOwnProperty(id)) {\n this._layers[id].resize(width, height);\n }\n }\n\n this.refresh(true);\n }\n\n this._width = width;\n this._height = height;\n\n }\n return this;\n }\n\n /**\n * \u6E05\u9664\u5355\u72EC\u7684\u4E00\u4E2A\u5C42\n * @param {number} zlevel\n */\n clearLayer(zlevel: number) {\n const layer = this._layers[zlevel];\n if (layer) {\n layer.clear();\n }\n }\n\n /**\n * \u91CA\u653E\n */\n dispose() {\n this.root.innerHTML = '';\n\n this.root =\n this.storage =\n\n this._domRoot =\n this._layers = null;\n }\n\n /**\n * Get canvas which has all thing rendered\n */\n getRenderedCanvas(opts?: {\n backgroundColor?: string | GradientObject | ImagePatternObject\n pixelRatio?: number\n }) {\n opts = opts || {};\n if (this._singleCanvas && !this._compositeManually) {\n return this._layers[CANVAS_ZLEVEL].dom;\n }\n\n const imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\n imageLayer.initContext();\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\n\n const ctx = imageLayer.ctx;\n\n if (opts.pixelRatio <= this.dpr) {\n this.refresh();\n\n const width = imageLayer.dom.width;\n const height = imageLayer.dom.height;\n this.eachLayer(function (layer) {\n if (layer.__builtin__) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n }\n else if (layer.renderToCanvas) {\n ctx.save();\n layer.renderToCanvas(ctx);\n ctx.restore();\n }\n });\n }\n else {\n // PENDING, echarts-gl and incremental rendering.\n const scope = {\n inHover: false,\n viewWidth: this._width,\n viewHeight: this._height\n };\n const displayList = this.storage.getDisplayList(true);\n for (let i = 0, len = displayList.length; i < len; i++) {\n const el = displayList[i];\n brush(ctx, el, scope, i === len - 1);\n }\n }\n\n return imageLayer.dom;\n }\n /**\n * \u83B7\u53D6\u7ED8\u56FE\u533A\u57DF\u5BBD\u5EA6\n */\n getWidth() {\n return this._width;\n }\n\n /**\n * \u83B7\u53D6\u7ED8\u56FE\u533A\u57DF\u9AD8\u5EA6\n */\n getHeight() {\n return this._height;\n }\n};", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../extension';\r\nimport CanvasPainter from 'zrender/src/canvas/Painter';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerPainter('canvas', CanvasPainter);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOption,\r\n SeriesOnPolarOptionMixin,\r\n SeriesStackOptionMixin,\r\n SeriesLabelOption,\r\n LineStyleOption,\r\n ItemStyleOption,\r\n AreaStyleOption,\r\n OptionDataValue,\r\n SymbolOptionMixin,\r\n SeriesSamplingOptionMixin,\r\n StatesOptionMixin,\r\n SeriesEncodeOptionMixin,\r\n CallbackDataParams,\r\n DefaultEmphasisFocus\r\n} from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport type Polar from '../../coord/polar/Polar';\r\nimport {createSymbol, ECSymbol} from '../../util/symbol';\r\nimport {Group} from '../../util/graphic';\r\nimport {LegendIconParams} from '../../component/legend/LegendModel';\r\n\r\ntype LineDataValue = OptionDataValue | OptionDataValue[];\r\n\r\ninterface LineStateOptionMixin {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus\r\n scale?: boolean | number\r\n }\r\n}\r\n\r\nexport interface LineStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n endLabel?: LineEndLabelOption\r\n}\r\n\r\nexport interface LineDataItemOption extends SymbolOptionMixin,\r\n LineStateOption, StatesOptionMixin {\r\n name?: string\r\n\r\n value?: LineDataValue\r\n}\r\n\r\nexport interface LineEndLabelOption extends SeriesLabelOption {\r\n valueAnimation?: boolean\r\n}\r\n\r\n\r\nexport interface LineSeriesOption extends SeriesOption, LineStateOptionMixin & {\r\n emphasis?: {\r\n lineStyle?: Omit & {\r\n width?: LineStyleOption['width'] | 'bolder'\r\n }\r\n areaStyle?: AreaStyleOption\r\n }\r\n blur?: {\r\n lineStyle?: LineStyleOption\r\n areaStyle?: AreaStyleOption\r\n }\r\n}>, LineStateOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnPolarOptionMixin,\r\n SeriesStackOptionMixin,\r\n SeriesSamplingOptionMixin,\r\n SymbolOptionMixin,\r\n SeriesEncodeOptionMixin {\r\n type?: 'line'\r\n\r\n coordinateSystem?: 'cartesian2d' | 'polar'\r\n\r\n // If clip the overflow value\r\n clip?: boolean\r\n\r\n label?: SeriesLabelOption\r\n endLabel?: LineEndLabelOption\r\n\r\n lineStyle?: LineStyleOption\r\n\r\n areaStyle?: AreaStyleOption & {\r\n origin?: 'auto' | 'start' | 'end' | number\r\n }\r\n\r\n step?: false | 'start' | 'end' | 'middle'\r\n\r\n smooth?: boolean | number\r\n\r\n smoothMonotone?: 'x' | 'y' | 'none'\r\n\r\n connectNulls?: boolean\r\n\r\n showSymbol?: boolean\r\n // false | 'auto': follow the label interval strategy.\r\n // true: show all symbols.\r\n showAllSymbol?: 'auto' | boolean\r\n\r\n data?: (LineDataValue | LineDataItemOption)[]\r\n\r\n triggerLineEvent?: boolean\r\n}\r\n\r\nclass LineSeriesModel extends SeriesModel {\r\n static readonly type = 'series.line';\r\n type = LineSeriesModel.type;\r\n\r\n static readonly dependencies = ['grid', 'polar'];\r\n\r\n coordinateSystem: Cartesian2D | Polar;\r\n\r\n hasSymbolVisual = true;\r\n\r\n getInitialData(option: LineSeriesOption): SeriesData {\r\n if (__DEV__) {\r\n const coordSys = option.coordinateSystem;\r\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\r\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\r\n }\r\n }\r\n return createSeriesData(null, this, {\r\n useEncodeDefaulter: true\r\n });\r\n }\r\n\r\n static defaultOption: LineSeriesOption = {\r\n // zlevel: 0,\r\n z: 3,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n\r\n clip: true,\r\n\r\n label: {\r\n position: 'top'\r\n },\r\n\r\n // itemStyle: {\r\n // },\r\n\r\n endLabel: {\r\n show: false,\r\n valueAnimation: true,\r\n distance: 8\r\n },\r\n\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid'\r\n },\r\n\r\n emphasis: {\r\n scale: true\r\n },\r\n // areaStyle: {\r\n // origin of areaStyle. Valid values:\r\n // `'auto'/null/undefined`: from axisLine to data\r\n // `'start'`: from min to data\r\n // `'end'`: from data to max\r\n // origin: 'auto'\r\n // },\r\n // false, 'start', 'end', 'middle'\r\n step: false,\r\n\r\n // Disabled if step is true\r\n smooth: false,\r\n smoothMonotone: null,\r\n symbol: 'emptyCircle',\r\n symbolSize: 4,\r\n symbolRotate: null,\r\n\r\n showSymbol: true,\r\n // `false`: follow the label interval strategy.\r\n // `true`: show all symbols.\r\n // `'auto'`: If possible, show all symbols, otherwise\r\n // follow the label interval strategy.\r\n showAllSymbol: 'auto',\r\n\r\n // Whether to connect break point.\r\n connectNulls: false,\r\n\r\n // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.\r\n sampling: 'none',\r\n\r\n animationEasing: 'linear',\r\n\r\n // Disable progressive\r\n progressive: 0,\r\n hoverLayerThreshold: Infinity,\r\n\r\n universalTransition: {\r\n divideShape: 'clone'\r\n },\r\n\r\n triggerLineEvent: false\r\n };\r\n\r\n getLegendIcon(opt: LegendIconParams): ECSymbol | Group {\r\n const group = new Group();\r\n\r\n const line = createSymbol(\r\n 'line',\r\n 0,\r\n opt.itemHeight / 2,\r\n opt.itemWidth,\r\n 0,\r\n opt.lineStyle.stroke,\r\n false\r\n );\r\n group.add(line);\r\n line.setStyle(opt.lineStyle);\r\n\r\n const visualType = this.getData().getVisual('symbol');\r\n const visualRotate = this.getData().getVisual('symbolRotate');\r\n const symbolType = visualType === 'none' ? 'circle' : visualType;\r\n\r\n // Symbol size is 80% when there is a line\r\n const size = opt.itemHeight * 0.8;\r\n const symbol = createSymbol(\r\n symbolType,\r\n (opt.itemWidth - size) / 2,\r\n (opt.itemHeight - size) / 2,\r\n size,\r\n size,\r\n opt.itemStyle.fill\r\n );\r\n group.add(symbol);\r\n\r\n symbol.setStyle(opt.itemStyle);\r\n\r\n const symbolRotate = opt.iconRotate === 'inherit'\r\n ? visualRotate\r\n : (opt.iconRotate || 0);\r\n symbol.rotation = symbolRotate * Math.PI / 180;\r\n symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\r\n\r\n if (symbolType.indexOf('empty') > -1) {\r\n symbol.style.stroke = symbol.style.fill;\r\n symbol.style.fill = '#fff';\r\n symbol.style.lineWidth = 2;\r\n }\r\n\r\n return group;\r\n }\r\n}\r\n\r\nexport default LineSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport {retrieveRawValue} from '../../data/helper/dataProvider';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { InterpolatableValue } from '../../util/types';\r\nimport { isArray } from 'zrender/src/core/util';\r\n\r\n/**\r\n * @return label string. Not null/undefined\r\n */\r\nexport function getDefaultLabel(\r\n data: SeriesData,\r\n dataIndex: number\r\n): string {\r\n const labelDims = data.mapDimensionsAll('defaultedLabel');\r\n const len = labelDims.length;\r\n\r\n // Simple optimization (in lots of cases, label dims length is 1)\r\n if (len === 1) {\r\n const rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);\r\n return rawVal != null ? rawVal + '' : null;\r\n }\r\n else if (len) {\r\n const vals = [];\r\n for (let i = 0; i < labelDims.length; i++) {\r\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\r\n }\r\n return vals.join(' ');\r\n }\r\n}\r\n\r\nexport function getDefaultInterpolatedLabel(\r\n data: SeriesData,\r\n interpolatedValue: InterpolatableValue\r\n): string {\r\n const labelDims = data.mapDimensionsAll('defaultedLabel');\r\n if (!isArray(interpolatedValue)) {\r\n return interpolatedValue + '';\r\n }\r\n\r\n const vals = [];\r\n for (let i = 0; i < labelDims.length; i++) {\r\n const dimIndex = data.getDimensionIndex(labelDims[i]);\r\n if (dimIndex >= 0) {\r\n vals.push(interpolatedValue[dimIndex]);\r\n }\r\n }\r\n return vals.join(' ');\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {createSymbol, normalizeSymbolOffset, normalizeSymbolSize} from '../../util/symbol';\r\nimport * as graphic from '../../util/graphic';\r\nimport {getECData} from '../../util/innerStore';\r\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states';\r\nimport {getDefaultLabel} from './labelHelper';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { ColorString, BlurScope, AnimationOption, ZRColor, AnimationOptionMixin } from '../../util/types';\r\nimport SeriesModel from '../../model/Series';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport { SymbolDrawSeriesScope, SymbolDrawItemModelOption } from './SymbolDraw';\r\nimport { extend } from 'zrender/src/core/util';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport ZRImage from 'zrender/src/graphic/Image';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\nimport Model from '../../model/Model';\r\n\r\ntype ECSymbol = ReturnType;\r\n\r\ninterface SymbolOpts {\r\n disableAnimation?: boolean\r\n\r\n useNameLabel?: boolean\r\n symbolInnerColor?: ZRColor\r\n}\r\n\r\nclass Symbol extends graphic.Group {\r\n\r\n private _symbolType: string;\r\n\r\n /**\r\n * Original scale\r\n */\r\n private _sizeX: number;\r\n private _sizeY: number;\r\n\r\n private _z2: number;\r\n\r\n constructor(data: SeriesData, idx: number, seriesScope?: SymbolDrawSeriesScope, opts?: SymbolOpts) {\r\n super();\r\n this.updateData(data, idx, seriesScope, opts);\r\n }\r\n\r\n _createSymbol(\r\n symbolType: string,\r\n data: SeriesData,\r\n idx: number,\r\n symbolSize: number[],\r\n keepAspect: boolean\r\n ) {\r\n // Remove paths created before\r\n this.removeAll();\r\n\r\n // let symbolPath = createSymbol(\r\n // symbolType, -0.5, -0.5, 1, 1, color\r\n // );\r\n // If width/height are set too small (e.g., set to 1) on ios10\r\n // and macOS Sierra, a circle stroke become a rect, no matter what\r\n // the scale is set. So we set width/height as 2. See #4150.\r\n const symbolPath = createSymbol(\r\n symbolType, -1, -1, 2, 2, null, keepAspect\r\n );\r\n\r\n symbolPath.attr({\r\n z2: 100,\r\n culling: true,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n });\r\n // Rewrite drift method\r\n symbolPath.drift = driftSymbol;\r\n\r\n this._symbolType = symbolType;\r\n\r\n this.add(symbolPath);\r\n }\r\n\r\n /**\r\n * Stop animation\r\n * @param {boolean} toLastFrame\r\n */\r\n stopSymbolAnimation(toLastFrame: boolean) {\r\n this.childAt(0).stopAnimation(null, toLastFrame);\r\n }\r\n\r\n getSymbolType() {\r\n return this._symbolType;\r\n }\r\n /**\r\n * FIXME:\r\n * Caution: This method breaks the encapsulation of this module,\r\n * but it indeed brings convenience. So do not use the method\r\n * unless you detailedly know all the implements of `Symbol`,\r\n * especially animation.\r\n *\r\n * Get symbol path element.\r\n */\r\n getSymbolPath() {\r\n return this.childAt(0) as ECSymbol;\r\n }\r\n\r\n /**\r\n * Highlight symbol\r\n */\r\n highlight() {\r\n enterEmphasis(this.childAt(0));\r\n }\r\n\r\n /**\r\n * Downplay symbol\r\n */\r\n downplay() {\r\n leaveEmphasis(this.childAt(0));\r\n }\r\n\r\n /**\r\n * @param {number} zlevel\r\n * @param {number} z\r\n */\r\n setZ(zlevel: number, z: number) {\r\n const symbolPath = this.childAt(0) as ECSymbol;\r\n symbolPath.zlevel = zlevel;\r\n symbolPath.z = z;\r\n }\r\n\r\n setDraggable(draggable: boolean, hasCursorOption?: boolean) {\r\n const symbolPath = this.childAt(0) as ECSymbol;\r\n symbolPath.draggable = draggable;\r\n symbolPath.cursor = !hasCursorOption && draggable ? 'move' : symbolPath.cursor;\r\n }\r\n\r\n /**\r\n * Update symbol properties\r\n */\r\n updateData(data: SeriesData, idx: number, seriesScope?: SymbolDrawSeriesScope, opts?: SymbolOpts) {\r\n this.silent = false;\r\n\r\n const symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\r\n const seriesModel = data.hostModel as SeriesModel;\r\n const symbolSize = Symbol.getSymbolSize(data, idx);\r\n const isInit = symbolType !== this._symbolType;\r\n const disableAnimation = opts && opts.disableAnimation;\r\n\r\n if (isInit) {\r\n const keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\r\n this._createSymbol(symbolType as string, data, idx, symbolSize, keepAspect);\r\n }\r\n else {\r\n const symbolPath = this.childAt(0) as ECSymbol;\r\n symbolPath.silent = false;\r\n const target = {\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2\r\n };\r\n disableAnimation ? symbolPath.attr(target)\r\n : graphic.updateProps(symbolPath, target, seriesModel, idx);\r\n\r\n saveOldStyle(symbolPath);\r\n }\r\n\r\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\r\n\r\n if (isInit) {\r\n const symbolPath = this.childAt(0) as ECSymbol;\r\n\r\n if (!disableAnimation) {\r\n const target: PathProps = {\r\n scaleX: this._sizeX,\r\n scaleY: this._sizeY,\r\n style: {\r\n // Always fadeIn. Because it has fadeOut animation when symbol is removed..\r\n opacity: symbolPath.style.opacity\r\n }\r\n };\r\n symbolPath.scaleX = symbolPath.scaleY = 0;\r\n symbolPath.style.opacity = 0;\r\n graphic.initProps(symbolPath, target, seriesModel, idx);\r\n }\r\n }\r\n\r\n if (disableAnimation) {\r\n // Must stop leave transition manually if don't call initProps or updateProps.\r\n this.childAt(0).stopAnimation('leave');\r\n }\r\n }\r\n\r\n _updateCommon(\r\n data: SeriesData,\r\n idx: number,\r\n symbolSize: number[],\r\n seriesScope?: SymbolDrawSeriesScope,\r\n opts?: SymbolOpts\r\n ) {\r\n const symbolPath = this.childAt(0) as ECSymbol;\r\n const seriesModel = data.hostModel as SeriesModel;\r\n\r\n let emphasisItemStyle;\r\n let blurItemStyle;\r\n let selectItemStyle;\r\n let focus;\r\n let blurScope: BlurScope;\r\n let emphasisDisabled: boolean;\r\n\r\n let labelStatesModels;\r\n\r\n let hoverScale: SymbolDrawSeriesScope['hoverScale'];\r\n let cursorStyle: SymbolDrawSeriesScope['cursorStyle'];\r\n\r\n if (seriesScope) {\r\n emphasisItemStyle = seriesScope.emphasisItemStyle;\r\n blurItemStyle = seriesScope.blurItemStyle;\r\n selectItemStyle = seriesScope.selectItemStyle;\r\n focus = seriesScope.focus;\r\n blurScope = seriesScope.blurScope;\r\n\r\n labelStatesModels = seriesScope.labelStatesModels;\r\n\r\n hoverScale = seriesScope.hoverScale;\r\n cursorStyle = seriesScope.cursorStyle;\r\n emphasisDisabled = seriesScope.emphasisDisabled;\r\n }\r\n\r\n if (!seriesScope || data.hasItemOption) {\r\n const itemModel = (seriesScope && seriesScope.itemModel)\r\n ? seriesScope.itemModel : data.getItemModel(idx);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n\r\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n emphasisDisabled = emphasisModel.get('disabled');\r\n\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n\r\n hoverScale = emphasisModel.getShallow('scale');\r\n cursorStyle = itemModel.getShallow('cursor');\r\n }\r\n\r\n const symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\r\n\r\n const symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\r\n if (symbolOffset) {\r\n symbolPath.x = symbolOffset[0];\r\n symbolPath.y = symbolOffset[1];\r\n }\r\n\r\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\r\n\r\n const symbolStyle = data.getItemVisual(idx, 'style');\r\n const visualColor = symbolStyle.fill;\r\n\r\n if (symbolPath instanceof ZRImage) {\r\n const pathStyle = symbolPath.style;\r\n symbolPath.useStyle(extend({\r\n // TODO other properties like x, y ?\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n if (symbolPath.__isEmptyBrush) {\r\n // fill and stroke will be swapped if it's empty.\r\n // So we cloned a new style to avoid it affecting the original style in visual storage.\r\n // TODO Better implementation. No empty logic!\r\n symbolPath.useStyle(extend({}, symbolStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(symbolStyle);\r\n }\r\n // Disable decal because symbol scale will been applied on the decal.\r\n symbolPath.style.decal = null;\r\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\r\n symbolPath.style.strokeNoScale = true;\r\n\r\n }\r\n const liftZ = data.getItemVisual(idx, 'liftZ');\r\n const z2Origin = this._z2;\r\n if (liftZ != null) {\r\n if (z2Origin == null) {\r\n this._z2 = symbolPath.z2;\r\n symbolPath.z2 += liftZ;\r\n }\r\n }\r\n else if (z2Origin != null) {\r\n symbolPath.z2 = z2Origin;\r\n this._z2 = null;\r\n }\r\n\r\n const useNameLabel = opts && opts.useNameLabel;\r\n\r\n setLabelStyle(\r\n symbolPath, labelStatesModels,\r\n {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultText: getLabelDefaultText,\r\n inheritColor: visualColor as ColorString,\r\n defaultOpacity: symbolStyle.opacity\r\n }\r\n );\r\n\r\n // Do not execute util needed.\r\n function getLabelDefaultText(idx: number) {\r\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\r\n }\r\n\r\n this._sizeX = symbolSize[0] / 2;\r\n this._sizeY = symbolSize[1] / 2;\r\n\r\n const emphasisState = symbolPath.ensureState('emphasis');\r\n\r\n emphasisState.style = emphasisItemStyle;\r\n symbolPath.ensureState('select').style = selectItemStyle;\r\n symbolPath.ensureState('blur').style = blurItemStyle;\r\n\r\n // null / undefined / true means to use default strategy.\r\n // 0 / false / negative number / NaN / Infinity means no scale.\r\n const scaleRatio =\r\n hoverScale == null || hoverScale === true\r\n ? Math.max(1.1, 3 / this._sizeY)\r\n // PENDING: restrict hoverScale > 1? It seems unreasonable to scale down\r\n : isFinite(hoverScale as number) && hoverScale > 0\r\n ? +hoverScale\r\n : 1;\r\n // always set scale to allow resetting\r\n emphasisState.scaleX = this._sizeX * scaleRatio;\r\n emphasisState.scaleY = this._sizeY * scaleRatio;\r\n\r\n this.setSymbolScale(1);\r\n\r\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\r\n }\r\n\r\n setSymbolScale(scale: number) {\r\n this.scaleX = this.scaleY = scale;\r\n }\r\n\r\n fadeOut(cb: () => void, seriesModel: Model, opt?: {\r\n fadeLabel: boolean,\r\n animation?: AnimationOption\r\n }) {\r\n const symbolPath = this.childAt(0) as ECSymbol;\r\n const dataIndex = getECData(this).dataIndex;\r\n const animationOpt = opt && opt.animation;\r\n // Avoid mistaken hover when fading out\r\n this.silent = symbolPath.silent = true;\r\n // Not show text when animating\r\n if (opt && opt.fadeLabel) {\r\n const textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n graphic.removeElement(textContent, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n dataIndex,\r\n removeOpt: animationOpt,\r\n cb() {\r\n symbolPath.removeTextContent();\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n symbolPath.removeTextContent();\r\n }\r\n\r\n graphic.removeElement(\r\n symbolPath,\r\n {\r\n style: {\r\n opacity: 0\r\n },\r\n scaleX: 0,\r\n scaleY: 0\r\n },\r\n seriesModel,\r\n { dataIndex, cb, removeOpt: animationOpt}\r\n );\r\n }\r\n\r\n static getSymbolSize(data: SeriesData, idx: number) {\r\n return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\r\n }\r\n}\r\n\r\n\r\nfunction driftSymbol(this: ECSymbol, dx: number, dy: number) {\r\n this.parent.drift(dx, dy);\r\n}\r\n\r\nexport default Symbol;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport SymbolClz from './Symbol';\r\nimport { isObject } from 'zrender/src/core/util';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport type Displayable from 'zrender/src/graphic/Displayable';\r\nimport {\r\n StageHandlerProgressParams,\r\n LabelOption,\r\n SymbolOptionMixin,\r\n ItemStyleOption,\r\n ZRColor,\r\n AnimationOptionMixin,\r\n ZRStyleProps,\r\n StatesOptionMixin,\r\n BlurScope,\r\n DisplayState,\r\n DefaultEmphasisFocus\r\n} from '../../util/types';\r\nimport { CoordinateSystemClipArea } from '../../coord/CoordinateSystem';\r\nimport Model from '../../model/Model';\r\nimport { ScatterSeriesOption } from '../scatter/ScatterSeries';\r\nimport { getLabelStatesModels } from '../../label/labelStyle';\r\nimport Element from 'zrender/src/Element';\r\nimport SeriesModel from '../../model/Series';\r\n\r\ninterface UpdateOpt {\r\n isIgnore?(idx: number): boolean\r\n clipShape?: CoordinateSystemClipArea,\r\n getSymbolPoint?(idx: number): number[]\r\n\r\n disableAnimation?: boolean\r\n}\r\n\r\ninterface SymbolLike extends graphic.Group {\r\n updateData(data: SeriesData, idx: number, scope?: SymbolDrawSeriesScope, opt?: UpdateOpt): void\r\n fadeOut?(cb: () => void, seriesModel: SeriesModel): void\r\n}\r\n\r\ninterface SymbolLikeCtor {\r\n new(data: SeriesData, idx: number, scope?: SymbolDrawSeriesScope, opt?: UpdateOpt): SymbolLike\r\n}\r\n\r\nfunction symbolNeedsDraw(data: SeriesData, point: number[], idx: number, opt: UpdateOpt) {\r\n return point && !isNaN(point[0]) && !isNaN(point[1])\r\n && !(opt.isIgnore && opt.isIgnore(idx))\r\n // We do not set clipShape on group, because it will cut part of\r\n // the symbol element shape. We use the same clip shape here as\r\n // the line clip.\r\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))\r\n && data.getItemVisual(idx, 'symbol') !== 'none';\r\n}\r\n\r\nfunction normalizeUpdateOpt(opt: UpdateOpt) {\r\n if (opt != null && !isObject(opt)) {\r\n opt = {isIgnore: opt};\r\n }\r\n return opt || {};\r\n}\r\n\r\ninterface RippleEffectOption {\r\n period?: number\r\n /**\r\n * Scale of ripple\r\n */\r\n scale?: number\r\n\r\n brushType?: 'fill' | 'stroke'\r\n\r\n color?: ZRColor,\r\n\r\n /**\r\n * ripple number\r\n */\r\n number?: number\r\n}\r\n\r\ninterface SymbolDrawStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: LabelOption\r\n}\r\n\r\n// TODO Separate series and item?\r\nexport interface SymbolDrawItemModelOption extends SymbolOptionMixin,\r\n StatesOptionMixin,\r\n SymbolDrawStateOption {\r\n\r\n cursor?: string\r\n\r\n // If has ripple effect\r\n rippleEffect?: RippleEffectOption\r\n}\r\n\r\nexport interface SymbolDrawSeriesScope {\r\n emphasisItemStyle?: ZRStyleProps\r\n blurItemStyle?: ZRStyleProps\r\n selectItemStyle?: ZRStyleProps\r\n\r\n focus?: DefaultEmphasisFocus\r\n blurScope?: BlurScope\r\n emphasisDisabled?: boolean\r\n\r\n labelStatesModels: Record>\r\n\r\n itemModel?: Model\r\n\r\n hoverScale?: boolean | number\r\n\r\n cursorStyle?: string\r\n fadeIn?: boolean\r\n}\r\n\r\nfunction makeSeriesScope(data: SeriesData): SymbolDrawSeriesScope {\r\n const seriesModel = data.hostModel as Model;\r\n const emphasisModel = seriesModel.getModel('emphasis');\r\n return {\r\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\r\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\r\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\r\n\r\n focus: emphasisModel.get('focus'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n emphasisDisabled: emphasisModel.get('disabled'),\r\n\r\n hoverScale: emphasisModel.get('scale'),\r\n\r\n labelStatesModels: getLabelStatesModels(seriesModel),\r\n\r\n cursorStyle: seriesModel.get('cursor')\r\n };\r\n}\r\n\r\nexport type ListForSymbolDraw = SeriesData>;\r\n\r\nclass SymbolDraw {\r\n group = new graphic.Group();\r\n\r\n private _data: ListForSymbolDraw;\r\n\r\n private _SymbolCtor: SymbolLikeCtor;\r\n\r\n private _seriesScope: SymbolDrawSeriesScope;\r\n\r\n private _getSymbolPoint: UpdateOpt['getSymbolPoint'];\r\n\r\n private _progressiveEls: SymbolLike[];\r\n\r\n constructor(SymbolCtor?: SymbolLikeCtor) {\r\n this._SymbolCtor = SymbolCtor || SymbolClz as SymbolLikeCtor;\r\n }\r\n\r\n /**\r\n * Update symbols draw by new data\r\n */\r\n updateData(data: ListForSymbolDraw, opt?: UpdateOpt) {\r\n // Remove progressive els.\r\n this._progressiveEls = null;\r\n\r\n opt = normalizeUpdateOpt(opt);\r\n\r\n const group = this.group;\r\n const seriesModel = data.hostModel;\r\n const oldData = this._data;\r\n const SymbolCtor = this._SymbolCtor;\r\n const disableAnimation = opt.disableAnimation;\r\n\r\n const seriesScope = makeSeriesScope(data);\r\n\r\n const symbolUpdateOpt = { disableAnimation };\r\n\r\n const getSymbolPoint = opt.getSymbolPoint || function (idx: number) {\r\n return data.getItemLayout(idx);\r\n };\r\n\r\n\r\n // There is no oldLineData only when first rendering or switching from\r\n // stream mode to normal mode, where previous elements should be removed.\r\n if (!oldData) {\r\n group.removeAll();\r\n }\r\n\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n const point = getSymbolPoint(newIdx);\r\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\r\n const symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n let symbolEl = oldData.getItemGraphicEl(oldIdx) as SymbolLike;\r\n\r\n const point = getSymbolPoint(newIdx) as number[];\r\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n const newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle';\r\n const oldSymbolType = symbolEl\r\n && (symbolEl as SymbolClz).getSymbolType\r\n && (symbolEl as SymbolClz).getSymbolType();\r\n\r\n if (!symbolEl\r\n // Create a new if symbol type changed.\r\n || (oldSymbolType && oldSymbolType !== newSymbolType)\r\n ) {\r\n group.remove(symbolEl);\r\n symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\r\n symbolEl.setPosition(point);\r\n }\r\n else {\r\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\r\n const target = {\r\n x: point[0],\r\n y: point[1]\r\n };\r\n disableAnimation\r\n ? symbolEl.attr(target)\r\n : graphic.updateProps(symbolEl, target, seriesModel);\r\n }\r\n\r\n // Add back\r\n group.add(symbolEl);\r\n\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n const el = oldData.getItemGraphicEl(oldIdx) as SymbolLike;\r\n el && el.fadeOut(function () {\r\n group.remove(el);\r\n }, seriesModel as SeriesModel);\r\n })\r\n .execute();\r\n\r\n this._getSymbolPoint = getSymbolPoint;\r\n this._data = data;\r\n };\r\n\r\n updateLayout() {\r\n const data = this._data;\r\n if (data) {\r\n // Not use animation\r\n data.eachItemGraphicEl((el, idx) => {\r\n const point = this._getSymbolPoint(idx);\r\n el.setPosition(point);\r\n el.markRedraw();\r\n });\r\n }\r\n };\r\n\r\n incrementalPrepareUpdate(data: ListForSymbolDraw) {\r\n this._seriesScope = makeSeriesScope(data);\r\n this._data = null;\r\n this.group.removeAll();\r\n };\r\n\r\n /**\r\n * Update symbols draw by new data\r\n */\r\n incrementalUpdate(taskParams: StageHandlerProgressParams, data: ListForSymbolDraw, opt?: UpdateOpt) {\r\n\r\n // Clear\r\n this._progressiveEls = [];\r\n\r\n opt = normalizeUpdateOpt(opt);\r\n\r\n function updateIncrementalAndHover(el: Displayable) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (let idx = taskParams.start; idx < taskParams.end; idx++) {\r\n const point = data.getItemLayout(idx) as number[];\r\n if (symbolNeedsDraw(data, point, idx, opt)) {\r\n const el = new this._SymbolCtor(data, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n el.setPosition(point);\r\n this.group.add(el);\r\n data.setItemGraphicEl(idx, el);\r\n this._progressiveEls.push(el);\r\n }\r\n }\r\n };\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n graphic.traverseElements(this._progressiveEls || this.group, cb);\r\n }\r\n\r\n remove(enableAnimation?: boolean) {\r\n const group = this.group;\r\n const data = this._data;\r\n // Incremental model do not have this._data.\r\n if (data && enableAnimation) {\r\n data.eachItemGraphicEl(function (el: SymbolLike) {\r\n el.fadeOut(function () {\r\n group.remove(el);\r\n }, data.hostModel as SeriesModel);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n };\r\n\r\n}\r\n\r\nexport default SymbolDraw;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {isDimensionStacked} from '../../data/helper/dataStackHelper';\r\nimport {isNumber, map} from 'zrender/src/core/util';\r\nimport type Polar from '../../coord/polar/Polar';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Axis from '../../coord/Axis';\r\nimport type { LineSeriesOption } from './LineSeries';\r\n\r\ninterface CoordInfo {\r\n dataDimsForPoint: string[]\r\n valueStart: number\r\n valueAxisDim: string\r\n baseAxisDim: string\r\n stacked: boolean\r\n valueDim: string\r\n baseDim: string\r\n baseDataOffset: number\r\n stackedOverDimension: string\r\n}\r\n\r\nexport function prepareDataCoordInfo(\r\n coordSys: Cartesian2D | Polar,\r\n data: SeriesData,\r\n valueOrigin?: LineSeriesOption['areaStyle']['origin']\r\n): CoordInfo {\r\n const baseAxis = coordSys.getBaseAxis();\r\n const valueAxis = coordSys.getOtherAxis(baseAxis as any);\r\n const valueStart = getValueStart(valueAxis, valueOrigin);\r\n\r\n const baseAxisDim = baseAxis.dim;\r\n const valueAxisDim = valueAxis.dim;\r\n const valueDim = data.mapDimension(valueAxisDim);\r\n const baseDim = data.mapDimension(baseAxisDim);\r\n const baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n\r\n const dims = map(coordSys.dimensions, function (coordDim) {\r\n return data.mapDimension(coordDim);\r\n });\r\n\r\n let stacked = false;\r\n const stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0] /* , dims[1] */)) { // jshint ignore:line\r\n stacked = true;\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1] /* , dims[0] */)) { // jshint ignore:line\r\n stacked = true;\r\n dims[1] = stackResultDim;\r\n }\r\n\r\n return {\r\n dataDimsForPoint: dims,\r\n valueStart: valueStart,\r\n valueAxisDim: valueAxisDim,\r\n baseAxisDim: baseAxisDim,\r\n stacked: !!stacked,\r\n valueDim: valueDim,\r\n baseDim: baseDim,\r\n baseDataOffset: baseDataOffset,\r\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\r\n };\r\n}\r\n\r\nfunction getValueStart(valueAxis: Axis, valueOrigin: LineSeriesOption['areaStyle']['origin']) {\r\n let valueStart = 0;\r\n const extent = valueAxis.scale.getExtent();\r\n\r\n if (valueOrigin === 'start') {\r\n valueStart = extent[0];\r\n }\r\n else if (valueOrigin === 'end') {\r\n valueStart = extent[1];\r\n }\r\n // If origin is specified as a number, use it as\r\n // valueStart directly\r\n else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) {\r\n valueStart = valueOrigin;\r\n }\r\n // auto\r\n else {\r\n // Both positive\r\n if (extent[0] > 0) {\r\n valueStart = extent[0];\r\n }\r\n // Both negative\r\n else if (extent[1] < 0) {\r\n valueStart = extent[1];\r\n }\r\n // If is one positive, and one negative, onZero shall be true\r\n }\r\n\r\n return valueStart;\r\n}\r\n\r\nexport function getStackedOnPoint(\r\n dataCoordInfo: CoordInfo,\r\n coordSys: Cartesian2D | Polar,\r\n data: SeriesData,\r\n idx: number\r\n) {\r\n let value = NaN;\r\n if (dataCoordInfo.stacked) {\r\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx) as number;\r\n }\r\n if (isNaN(value)) {\r\n value = dataCoordInfo.valueStart;\r\n }\r\n\r\n const baseDataOffset = dataCoordInfo.baseDataOffset;\r\n const stackedData = [];\r\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\r\n stackedData[1 - baseDataOffset] = value;\r\n\r\n return coordSys.dataToPoint(stackedData);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {prepareDataCoordInfo, getStackedOnPoint} from './helper';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport type Polar from '../../coord/polar/Polar';\r\nimport { LineSeriesOption } from './LineSeries';\r\nimport { createFloat32Array } from '../../util/vendor';\r\n\r\ninterface DiffItem {\r\n cmd: '+' | '=' | '-'\r\n idx: number\r\n idx1?: number\r\n}\r\n\r\nfunction diffData(oldData: SeriesData, newData: SeriesData) {\r\n const diffResult: DiffItem[] = [];\r\n\r\n newData.diff(oldData)\r\n .add(function (idx) {\r\n diffResult.push({cmd: '+', idx: idx});\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n diffResult.push({cmd: '=', idx: oldIdx, idx1: newIdx});\r\n })\r\n .remove(function (idx) {\r\n diffResult.push({cmd: '-', idx: idx});\r\n })\r\n .execute();\r\n\r\n return diffResult;\r\n}\r\n\r\nexport default function lineAnimationDiff(\r\n oldData: SeriesData, newData: SeriesData,\r\n oldStackedOnPoints: ArrayLike, newStackedOnPoints: ArrayLike,\r\n oldCoordSys: Cartesian2D | Polar, newCoordSys: Cartesian2D | Polar,\r\n oldValueOrigin: LineSeriesOption['areaStyle']['origin'],\r\n newValueOrigin: LineSeriesOption['areaStyle']['origin']\r\n) {\r\n const diff = diffData(oldData, newData);\r\n\r\n // let newIdList = newData.mapArray(newData.getId);\r\n // let oldIdList = oldData.mapArray(oldData.getId);\r\n\r\n // convertToIntId(newIdList, oldIdList);\r\n\r\n // // FIXME One data ?\r\n // diff = arrayDiff(oldIdList, newIdList);\r\n\r\n const currPoints: number[] = [];\r\n const nextPoints: number[] = [];\r\n // Points for stacking base line\r\n const currStackedPoints: number[] = [];\r\n const nextStackedPoints: number[] = [];\r\n\r\n const status = [];\r\n const sortedIndices: number[] = [];\r\n const rawIndices: number[] = [];\r\n\r\n const newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\r\n // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\r\n\r\n const oldPoints = oldData.getLayout('points') as number[] || [];\r\n const newPoints = newData.getLayout('points') as number[] || [];\r\n\r\n for (let i = 0; i < diff.length; i++) {\r\n const diffItem = diff[i];\r\n let pointAdded = true;\r\n\r\n let oldIdx2: number;\r\n let newIdx2: number;\r\n\r\n // FIXME, animation is not so perfect when dataZoom window moves fast\r\n // Which is in case remvoing or add more than one data in the tail or head\r\n switch (diffItem.cmd) {\r\n case '=':\r\n oldIdx2 = diffItem.idx * 2;\r\n newIdx2 = diffItem.idx1 * 2;\r\n let currentX = oldPoints[oldIdx2];\r\n let currentY = oldPoints[oldIdx2 + 1];\r\n const nextX = newPoints[newIdx2];\r\n const nextY = newPoints[newIdx2 + 1];\r\n\r\n // If previous data is NaN, use next point directly\r\n if (isNaN(currentX) || isNaN(currentY)) {\r\n currentX = nextX;\r\n currentY = nextY;\r\n }\r\n currPoints.push(currentX, currentY);\r\n nextPoints.push(nextX, nextY);\r\n\r\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n\r\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\r\n break;\r\n case '+':\r\n const newIdx = diffItem.idx;\r\n const newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\r\n const oldPt = oldCoordSys.dataToPoint([\r\n newData.get(newDataDimsForPoint[0], newIdx),\r\n newData.get(newDataDimsForPoint[1], newIdx)\r\n ]);\r\n newIdx2 = newIdx * 2;\r\n currPoints.push(oldPt[0], oldPt[1]);\r\n\r\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\r\n\r\n const stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\r\n\r\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\r\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\r\n\r\n rawIndices.push(newData.getRawIndex(newIdx));\r\n break;\r\n case '-':\r\n pointAdded = false;\r\n }\r\n\r\n // Original indices\r\n if (pointAdded) {\r\n status.push(diffItem);\r\n sortedIndices.push(sortedIndices.length);\r\n }\r\n }\r\n\r\n // Diff result may be crossed if all items are changed\r\n // Sort by data index\r\n sortedIndices.sort(function (a, b) {\r\n return rawIndices[a] - rawIndices[b];\r\n });\r\n\r\n const len = currPoints.length;\r\n const sortedCurrPoints = createFloat32Array(len);\r\n const sortedNextPoints = createFloat32Array(len);\r\n\r\n const sortedCurrStackedPoints = createFloat32Array(len);\r\n const sortedNextStackedPoints = createFloat32Array(len);\r\n\r\n const sortedStatus = [];\r\n for (let i = 0; i < sortedIndices.length; i++) {\r\n const idx = sortedIndices[i];\r\n const i2 = i * 2;\r\n const idx2 = idx * 2;\r\n sortedCurrPoints[i2] = currPoints[idx2];\r\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\r\n sortedNextPoints[i2] = nextPoints[idx2];\r\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\r\n\r\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\r\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\r\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\r\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\r\n\r\n sortedStatus[i] = status[idx];\r\n }\r\n\r\n return {\r\n current: sortedCurrPoints,\r\n next: sortedNextPoints,\r\n\r\n stackedOnCurrent: sortedCurrStackedPoints,\r\n stackedOnNext: sortedNextStackedPoints,\r\n\r\n status: sortedStatus\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Poly path support NaN point\r\n\r\nimport Path, { PathProps } from 'zrender/src/graphic/Path';\r\nimport PathProxy from 'zrender/src/core/PathProxy';\r\nimport { cubicRootAt, cubicAt } from 'zrender/src/core/curve';\r\n\r\nconst mathMin = Math.min;\r\nconst mathMax = Math.max;\r\n\r\nfunction isPointNull(x: number, y: number) {\r\n return isNaN(x) || isNaN(y);\r\n}\r\n\r\n/**\r\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\r\n * situations. This should be used when points are non-monotone neither in x or\r\n * y dimension.\r\n */\r\nfunction drawSegment(\r\n ctx: PathProxy,\r\n points: ArrayLike,\r\n start: number,\r\n segLen: number,\r\n allLen: number,\r\n dir: number,\r\n smooth: number,\r\n smoothMonotone: 'x' | 'y' | 'none',\r\n connectNulls: boolean\r\n) {\r\n let prevX: number;\r\n let prevY: number;\r\n let cpx0: number;\r\n let cpy0: number;\r\n let cpx1: number;\r\n let cpy1: number;\r\n let idx = start;\r\n let k = 0;\r\n for (; k < segLen; k++) {\r\n\r\n let x = points[idx * 2];\r\n let y = points[idx * 2 + 1];\r\n\r\n if (idx >= allLen || idx < 0) {\r\n break;\r\n }\r\n if (isPointNull(x, y)) {\r\n if (connectNulls) {\r\n idx += dir;\r\n continue;\r\n }\r\n break;\r\n }\r\n\r\n if (idx === start) {\r\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\r\n cpx0 = x;\r\n cpy0 = y;\r\n }\r\n else {\r\n let dx = x - prevX;\r\n let dy = y - prevY;\r\n\r\n // Ignore tiny segment.\r\n if ((dx * dx + dy * dy) < 0.5) {\r\n idx += dir;\r\n continue;\r\n }\r\n\r\n if (smooth > 0) {\r\n let nextIdx = idx + dir;\r\n let nextX = points[nextIdx * 2];\r\n let nextY = points[nextIdx * 2 + 1];\r\n // Ignore duplicate point\r\n while (nextX === x && nextY === y && k < segLen) {\r\n k++;\r\n nextIdx += dir;\r\n idx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n x = points[idx * 2];\r\n y = points[idx * 2 + 1];\r\n dx = x - prevX;\r\n dy = y - prevY;\r\n }\r\n\r\n let tmpK = k + 1;\r\n if (connectNulls) {\r\n // Find next point not null\r\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\r\n tmpK++;\r\n nextIdx += dir;\r\n nextX = points[nextIdx * 2];\r\n nextY = points[nextIdx * 2 + 1];\r\n }\r\n }\r\n\r\n let ratioNextSeg = 0.5;\r\n let vx: number = 0;\r\n let vy: number = 0;\r\n let nextCpx0;\r\n let nextCpy0;\r\n // Is last point\r\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\r\n cpx1 = x;\r\n cpy1 = y;\r\n }\r\n else {\r\n vx = nextX - prevX;\r\n vy = nextY - prevY;\r\n\r\n const dx0 = x - prevX;\r\n const dx1 = nextX - x;\r\n const dy0 = y - prevY;\r\n const dy1 = nextY - y;\r\n let lenPrevSeg;\r\n let lenNextSeg;\r\n if (smoothMonotone === 'x') {\r\n lenPrevSeg = Math.abs(dx0);\r\n lenNextSeg = Math.abs(dx1);\r\n const dir = vx > 0 ? 1 : -1;\r\n cpx1 = x - dir * lenPrevSeg * smooth;\r\n cpy1 = y;\r\n nextCpx0 = x + dir * lenNextSeg * smooth;\r\n nextCpy0 = y;\r\n }\r\n else if (smoothMonotone === 'y') {\r\n lenPrevSeg = Math.abs(dy0);\r\n lenNextSeg = Math.abs(dy1);\r\n const dir = vy > 0 ? 1 : -1;\r\n cpx1 = x;\r\n cpy1 = y - dir * lenPrevSeg * smooth;\r\n nextCpx0 = x;\r\n nextCpy0 = y + dir * lenNextSeg * smooth;\r\n }\r\n else {\r\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\r\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);\r\n\r\n // Use ratio of seg length\r\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\r\n\r\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\r\n cpy1 = y - vy * smooth * (1 - ratioNextSeg);\r\n\r\n // cp0 of next segment\r\n nextCpx0 = x + vx * smooth * ratioNextSeg;\r\n nextCpy0 = y + vy * smooth * ratioNextSeg;\r\n\r\n // Smooth constraint between point and next point.\r\n // Avoid exceeding extreme after smoothing.\r\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\r\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\r\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\r\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y));\r\n // Reclaculate cp1 based on the adjusted cp0 of next seg.\r\n vx = nextCpx0 - x;\r\n vy = nextCpy0 - y;\r\n\r\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\r\n cpy1 = y - vy * lenPrevSeg / lenNextSeg;\r\n\r\n // Smooth constraint between point and prev point.\r\n // Avoid exceeding extreme after smoothing.\r\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\r\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\r\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\r\n cpy1 = mathMax(cpy1, mathMin(prevY, y));\r\n\r\n // Adjust next cp0 again.\r\n vx = x - cpx1;\r\n vy = y - cpy1;\r\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\r\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\r\n }\r\n }\r\n\r\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\r\n\r\n cpx0 = nextCpx0;\r\n cpy0 = nextCpy0;\r\n }\r\n else {\r\n ctx.lineTo(x, y);\r\n }\r\n }\r\n\r\n prevX = x;\r\n prevY = y;\r\n idx += dir;\r\n }\r\n\r\n return k;\r\n}\r\n\r\nclass ECPolylineShape {\r\n points: ArrayLike;\r\n smooth = 0;\r\n smoothConstraint = true;\r\n smoothMonotone: 'x' | 'y' | 'none';\r\n connectNulls: boolean;\r\n}\r\n\r\ninterface ECPolylineProps extends PathProps {\r\n shape?: Partial\r\n}\r\n\r\nexport class ECPolyline extends Path {\r\n\r\n readonly type = 'ec-polyline';\r\n\r\n shape: ECPolylineShape;\r\n\r\n constructor(opts?: ECPolylineProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultStyle() {\r\n return {\r\n stroke: '#000',\r\n fill: null as string\r\n };\r\n }\r\n\r\n getDefaultShape() {\r\n return new ECPolylineShape();\r\n }\r\n\r\n buildPath(ctx: PathProxy, shape: ECPolylineShape) {\r\n const points = shape.points;\r\n\r\n let i = 0;\r\n let len = points.length / 2;\r\n\r\n // const result = getBoundingBox(points, shape.smoothConstraint);\r\n\r\n if (shape.connectNulls) {\r\n // Must remove first and last null values avoid draw error in polygon\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n i += drawSegment(\r\n ctx, points, i, len, len,\r\n 1,\r\n shape.smooth,\r\n shape.smoothMonotone, shape.connectNulls\r\n ) + 1;\r\n }\r\n }\r\n\r\n getPointOn(xOrY: number, dim: 'x' | 'y'): number[] {\r\n if (!this.path) {\r\n this.createPathProxy();\r\n this.buildPath(this.path, this.shape);\r\n }\r\n const path = this.path;\r\n const data = path.data;\r\n const CMD = PathProxy.CMD;\r\n\r\n let x0;\r\n let y0;\r\n\r\n const isDimX = dim === 'x';\r\n const roots: number[] = [];\r\n\r\n for (let i = 0; i < data.length;) {\r\n const cmd = data[i++];\r\n let x;\r\n let y;\r\n let x2;\r\n let y2;\r\n let x3;\r\n let y3;\r\n let t;\r\n switch (cmd) {\r\n case CMD.M:\r\n x0 = data[i++];\r\n y0 = data[i++];\r\n break;\r\n case CMD.L:\r\n x = data[i++];\r\n y = data[i++];\r\n t = isDimX ? (xOrY - x0) / (x - x0)\r\n : (xOrY - y0) / (y - y0);\r\n if (t <= 1 && t >= 0) {\r\n const val = isDimX ? (y - y0) * t + y0\r\n : (x - x0) * t + x0;\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n x0 = x;\r\n y0 = y;\r\n break;\r\n case CMD.C:\r\n x = data[i++];\r\n y = data[i++];\r\n x2 = data[i++];\r\n y2 = data[i++];\r\n x3 = data[i++];\r\n y3 = data[i++];\r\n\r\n const nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots)\r\n : cubicRootAt(y0, y, y2, y3, xOrY, roots);\r\n if (nRoot > 0) {\r\n for (let i = 0; i < nRoot; i++) {\r\n const t = roots[i];\r\n if (t <= 1 && t >= 0) {\r\n const val = isDimX ? cubicAt(y0, y, y2, y3, t)\r\n : cubicAt(x0, x, x2, x3, t);\r\n return isDimX ? [xOrY, val] : [val, xOrY];\r\n }\r\n }\r\n }\r\n\r\n x0 = x3;\r\n y0 = y3;\r\n break;\r\n }\r\n }\r\n }\r\n}\r\nclass ECPolygonShape extends ECPolylineShape {\r\n // Offset between stacked base points and points\r\n stackedOnPoints: ArrayLike;\r\n stackedOnSmooth: number;\r\n}\r\n\r\ninterface ECPolygonProps extends PathProps {\r\n shape?: Partial\r\n}\r\nexport class ECPolygon extends Path {\r\n\r\n readonly type = 'ec-polygon';\r\n\r\n shape: ECPolygonShape;\r\n\r\n constructor(opts?: ECPolygonProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new ECPolygonShape();\r\n }\r\n\r\n buildPath(ctx: PathProxy, shape: ECPolygonShape) {\r\n const points = shape.points;\r\n const stackedOnPoints = shape.stackedOnPoints;\r\n\r\n let i = 0;\r\n let len = points.length / 2;\r\n const smoothMonotone = shape.smoothMonotone;\r\n\r\n if (shape.connectNulls) {\r\n // Must remove first and last null values avoid draw error in polygon\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n for (; i < len; i++) {\r\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\r\n break;\r\n }\r\n }\r\n }\r\n while (i < len) {\r\n const k = drawSegment(\r\n ctx, points, i, len, len,\r\n 1,\r\n shape.smooth,\r\n smoothMonotone, shape.connectNulls\r\n );\r\n drawSegment(\r\n ctx, stackedOnPoints, i + k - 1, k, len,\r\n -1,\r\n shape.stackedOnSmooth,\r\n smoothMonotone, shape.connectNulls\r\n );\r\n i += k + 1;\r\n\r\n ctx.closePath();\r\n }\r\n }\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport {round} from '../../util/number';\r\nimport SeriesModel from '../../model/Series';\r\nimport { SeriesOption } from '../../util/types';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport type Polar from '../../coord/polar/Polar';\r\nimport { CoordinateSystem } from '../../coord/CoordinateSystem';\r\nimport { isFunction } from 'zrender/src/core/util';\r\n\r\ntype SeriesModelWithLineWidth = SeriesModel;\r\nfunction createGridClipPath(\r\n cartesian: Cartesian2D,\r\n hasAnimation: boolean,\r\n seriesModel: SeriesModelWithLineWidth,\r\n done?: () => void,\r\n during?: (percent: number, clipRect: graphic.Rect) => void\r\n) {\r\n const rect = cartesian.getArea();\r\n\r\n let x = rect.x;\r\n let y = rect.y;\r\n let width = rect.width;\r\n let height = rect.height;\r\n\r\n const lineWidth = seriesModel.get(['lineStyle', 'width']) || 0;\r\n // Expand the clip path a bit to avoid the border is clipped and looks thinner\r\n x -= lineWidth / 2;\r\n y -= lineWidth / 2;\r\n width += lineWidth;\r\n height += lineWidth;\r\n\r\n // fix: https://github.com/apache/incubator-echarts/issues/11369\r\n width = Math.ceil(width);\r\n if (x !== Math.floor(x)) {\r\n x = Math.floor(x);\r\n // if no extra 1px on `width`, it will still be clipped since `x` is floored\r\n width++;\r\n }\r\n\r\n const clipPath = new graphic.Rect({\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n }\r\n });\r\n\r\n if (hasAnimation) {\r\n const baseAxis = cartesian.getBaseAxis();\r\n const isHorizontal = baseAxis.isHorizontal();\r\n const isAxisInversed = baseAxis.inverse;\r\n\r\n if (isHorizontal) {\r\n if (isAxisInversed) {\r\n clipPath.shape.x += width;\r\n }\r\n clipPath.shape.width = 0;\r\n }\r\n else {\r\n if (!isAxisInversed) {\r\n clipPath.shape.y += height;\r\n }\r\n clipPath.shape.height = 0;\r\n }\r\n\r\n const duringCb = isFunction(during)\r\n ? (percent: number) => {\r\n during(percent, clipPath);\r\n }\r\n : null;\r\n\r\n graphic.initProps(clipPath, {\r\n shape: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n }, seriesModel, null, done, duringCb);\r\n }\r\n\r\n return clipPath;\r\n}\r\n\r\nfunction createPolarClipPath(\r\n polar: Polar,\r\n hasAnimation: boolean,\r\n seriesModel: SeriesModelWithLineWidth\r\n) {\r\n const sectorArea = polar.getArea();\r\n // Avoid float number rounding error for symbol on the edge of axis extent.\r\n\r\n const r0 = round(sectorArea.r0, 1);\r\n const r = round(sectorArea.r, 1);\r\n const clipPath = new graphic.Sector({\r\n shape: {\r\n cx: round(polar.cx, 1),\r\n cy: round(polar.cy, 1),\r\n r0: r0,\r\n r: r,\r\n startAngle: sectorArea.startAngle,\r\n endAngle: sectorArea.endAngle,\r\n clockwise: sectorArea.clockwise\r\n }\r\n });\r\n\r\n if (hasAnimation) {\r\n const isRadial = polar.getBaseAxis().dim === 'angle';\r\n\r\n if (isRadial) {\r\n clipPath.shape.endAngle = sectorArea.startAngle;\r\n }\r\n else {\r\n clipPath.shape.r = r0;\r\n }\r\n\r\n graphic.initProps(clipPath, {\r\n shape: {\r\n endAngle: sectorArea.endAngle,\r\n r: r\r\n }\r\n }, seriesModel);\r\n }\r\n return clipPath;\r\n}\r\n\r\nfunction createClipPath(\r\n coordSys: CoordinateSystem,\r\n hasAnimation: boolean,\r\n seriesModel: SeriesModelWithLineWidth,\r\n done?: () => void,\r\n during?: (percent: number) => void\r\n) {\r\n if (!coordSys) {\r\n return null;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n return createPolarClipPath(coordSys as Polar, hasAnimation, seriesModel);\r\n }\r\n else if (coordSys.type === 'cartesian2d') {\r\n return createGridClipPath(coordSys as Cartesian2D, hasAnimation, seriesModel, done, during);\r\n }\r\n return null;\r\n}\r\n\r\nexport {\r\n createGridClipPath,\r\n createPolarClipPath,\r\n createClipPath\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../model/Global';\r\nimport {ParsedModelFinder} from '../util/model';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport { DimensionDefinitionLoose, ScaleDataValue, DimensionName } from '../util/types';\r\nimport Axis from './Axis';\r\nimport { BoundingRect } from '../util/graphic';\r\nimport { MatrixArray } from 'zrender/src/core/matrix';\r\nimport ComponentModel from '../model/Component';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport type { PrepareCustomInfo } from '../chart/custom/CustomSeries';\r\n\r\n\r\nexport interface CoordinateSystemCreator {\r\n\r\n create: (ecModel: GlobalModel, api: ExtensionAPI) => CoordinateSystemMaster[];\r\n\r\n // FIXME current dimensions must be string[].\r\n // check and unify the definition.\r\n // FIXME:TS check where used (seams only HeatmapSeries used?)\r\n // Some coordinate system do not have static dimensions (like parallel)\r\n dimensions?: DimensionName[];\r\n\r\n // dimensionsInfo like [{name: ..., type: ...}, 'xxx', ...]\r\n getDimensionsInfo?: () => DimensionDefinitionLoose[];\r\n}\r\n\r\n/**\r\n * The instance get from `CoordinateSystemManger` is `CoordinateSystemMaster`.\r\n */\r\nexport interface CoordinateSystemMaster {\r\n\r\n // FIXME current dimensions must be string[].\r\n // check and unify the definition.\r\n // Should be the same as its coordinateSystemCreator.\r\n dimensions: DimensionName[];\r\n\r\n model?: ComponentModel;\r\n\r\n update?: (ecModel: GlobalModel, api: ExtensionAPI) => void;\r\n\r\n // This methods is also responsible for determining whether this\r\n // coordinate system is applicable to the given `finder`.\r\n // Each coordinate system will be tried, until one returns non-\r\n // null/undefined value.\r\n convertToPixel?(\r\n ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]\r\n ): number | number[];\r\n\r\n // This methods is also responsible for determining whether this\r\n // coordinate system is applicable to the given `finder`.\r\n // Each coordinate system will be tried, until one returns non-\r\n // null/undefined value.\r\n convertFromPixel?(\r\n ecModel: GlobalModel, finder: ParsedModelFinder, pixelValue: number | number[]\r\n ): number | number[];\r\n\r\n // @param point Point in global pixel coordinate system.\r\n // The signature of this method should be the same as `CoordinateSystemExecutive`\r\n containPoint(point: number[]): boolean;\r\n\r\n // Must be implemented when `axisPointerEnabled` is `true`.\r\n getAxes?: () => Axis[];\r\n\r\n axisPointerEnabled?: boolean;\r\n\r\n getTooltipAxes?: (dim: DimensionName | 'auto') => {baseAxes: Axis[], otherAxes: Axis[]};\r\n\r\n /**\r\n * Get layout rect or coordinate system\r\n */\r\n getRect?: () => RectLike\r\n\r\n}\r\n\r\n/**\r\n * For example: cartesian is CoordinateSystem.\r\n * series.coordinateSystem is CoordinateSystem.\r\n */\r\nexport interface CoordinateSystem {\r\n\r\n type: string\r\n\r\n /**\r\n * Master of coordinate system. For example:\r\n * Grid is master of cartesian.\r\n */\r\n master?: CoordinateSystemMaster\r\n\r\n // Should be the same as its coordinateSystemCreator.\r\n dimensions: DimensionName[];\r\n\r\n model?: ComponentModel;\r\n\r\n /**\r\n * @param data\r\n * @param reserved Defined by the coordinate system itself\r\n * @param out\r\n * @return {Array.} point Point in global pixel coordinate system.\r\n */\r\n dataToPoint(\r\n data: ScaleDataValue | ScaleDataValue[],\r\n reserved?: any,\r\n out?: number[]\r\n ): number[];\r\n\r\n /**\r\n * Some coord sys (like Parallel) might do not have `pointToData`,\r\n * or the meaning of this kind of features is not clear yet.\r\n * @param point point Point in global pixel coordinate system.\r\n * @param clamp Clamp range\r\n * @return data\r\n */\r\n pointToData?(\r\n point: number[],\r\n clamp?: boolean\r\n ): number | number[];\r\n\r\n // @param point Point in global pixel coordinate system.\r\n containPoint(point: number[]): boolean;\r\n\r\n getAxes?: () => Axis[];\r\n\r\n getAxis?: (dim?: DimensionName) => Axis;\r\n\r\n getBaseAxis?: () => Axis;\r\n\r\n getOtherAxis?: (baseAxis: Axis) => Axis;\r\n\r\n clampData?: (data: ScaleDataValue[], out?: number[]) => number[];\r\n\r\n getRoamTransform?: () => MatrixArray;\r\n\r\n getArea?: (tolerance?: number) => CoordinateSystemClipArea\r\n\r\n // Only `coord/View.js` implements `getBoundingRect`.\r\n // But if other coord sys implement it, should follow this signature.\r\n getBoundingRect?: () => BoundingRect;\r\n\r\n // Currently only Cartesian2D implements it.\r\n // But if other coordinate systems implement it, should follow this signature.\r\n getAxesByScale?: (scaleType: string) => Axis[];\r\n\r\n prepareCustoms?: PrepareCustomInfo;\r\n}\r\n\r\n/**\r\n * Like GridModel, PolarModel, ...\r\n */\r\nexport interface CoordinateSystemHostModel extends ComponentModel {\r\n coordinateSystem?: CoordinateSystemMaster\r\n}\r\n\r\n/**\r\n * Clip area will be returned by getArea of CoordinateSystem.\r\n * It is used to clip the graphic elements with the contain methods.\r\n */\r\nexport interface CoordinateSystemClipArea {\r\n contain(x: number, y: number): boolean\r\n}\r\n\r\nexport function isCoordinateSystemType(\r\n coordSys: CoordinateSystem, type: S\r\n): coordSys is T {\r\n return (coordSys.type as unknown as S) === type;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// FIXME step not support polar\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SymbolDraw from '../helper/SymbolDraw';\r\nimport SymbolClz from '../helper/Symbol';\r\nimport lineAnimationDiff from './lineAnimationDiff';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as modelUtil from '../../util/model';\r\nimport { ECPolyline, ECPolygon } from './poly';\r\nimport ChartView from '../../view/Chart';\r\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper';\r\nimport { createGridClipPath, createPolarClipPath } from '../helper/createClipPathFromCoordSys';\r\nimport LineSeriesModel, { LineSeriesOption } from './LineSeries';\r\nimport type GlobalModel from '../../model/Global';\r\nimport type ExtensionAPI from '../../core/ExtensionAPI';\r\n// TODO\r\nimport Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport Polar from '../../coord/polar/Polar';\r\nimport type SeriesData from '../../data/SeriesData';\r\nimport type {\r\n Payload,\r\n Dictionary,\r\n ColorString,\r\n ECElement,\r\n DisplayState,\r\n LabelOption,\r\n ParsedValue\r\n} from '../../util/types';\r\nimport type OrdinalScale from '../../scale/Ordinal';\r\nimport type Axis2D from '../../coord/cartesian/Axis2D';\r\nimport { CoordinateSystemClipArea, isCoordinateSystemType } from '../../coord/CoordinateSystem';\r\nimport { setStatesStylesFromModel, setStatesFlag, toggleHoverEmphasis, SPECIAL_STATES } from '../../util/states';\r\nimport Model from '../../model/Model';\r\nimport { setLabelStyle, getLabelStatesModels, labelInner } from '../../label/labelStyle';\r\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper';\r\n\r\nimport { getECData } from '../../util/innerStore';\r\nimport { createFloat32Array } from '../../util/vendor';\r\nimport { convertToColorString } from '../../util/format';\r\nimport { lerp } from 'zrender/src/tool/color';\r\nimport Element from 'zrender/src/Element';\r\n\r\n\r\ntype PolarArea = ReturnType;\r\ntype Cartesian2DArea = ReturnType;\r\ninterface SymbolExtended extends SymbolClz {\r\n __temp: boolean\r\n}\r\n\r\ninterface ColorStop {\r\n offset: number\r\n coord?: number\r\n color: ColorString\r\n}\r\n\r\nfunction isPointsSame(points1: ArrayLike, points2: ArrayLike) {\r\n if (points1.length !== points2.length) {\r\n return;\r\n }\r\n for (let i = 0; i < points1.length; i++) {\r\n if (points1[i] !== points2[i]) {\r\n return;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nfunction bboxFromPoints(points: ArrayLike) {\r\n let minX = Infinity;\r\n let minY = Infinity;\r\n let maxX = -Infinity;\r\n let maxY = -Infinity;\r\n\r\n for (let i = 0; i < points.length;) {\r\n const x = points[i++];\r\n const y = points[i++];\r\n if (!isNaN(x)) {\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n }\r\n if (!isNaN(y)) {\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n }\r\n return [\r\n [minX, minY],\r\n [maxX, maxY]\r\n ];\r\n}\r\n\r\nfunction getBoundingDiff(points1: ArrayLike, points2: ArrayLike): number {\r\n\r\n const [min1, max1] = bboxFromPoints(points1);\r\n const [min2, max2] = bboxFromPoints(points2);\r\n\r\n // Get a max value from each corner of two boundings.\r\n return Math.max(\r\n Math.abs(min1[0] - min2[0]),\r\n Math.abs(min1[1] - min2[1]),\r\n\r\n Math.abs(max1[0] - max2[0]),\r\n Math.abs(max1[1] - max2[1])\r\n );\r\n}\r\n\r\nfunction getSmooth(smooth: number | boolean) {\r\n return zrUtil.isNumber(smooth) ? smooth : (smooth ? 0.5 : 0);\r\n}\r\n\r\nfunction getStackedOnPoints(\r\n coordSys: Cartesian2D | Polar,\r\n data: SeriesData,\r\n dataCoordInfo: ReturnType\r\n) {\r\n if (!dataCoordInfo.valueDim) {\r\n return [];\r\n }\r\n\r\n const len = data.count();\r\n const points = createFloat32Array(len * 2);\r\n for (let idx = 0; idx < len; idx++) {\r\n const pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\r\n points[idx * 2] = pt[0];\r\n points[idx * 2 + 1] = pt[1];\r\n }\r\n\r\n return points;\r\n}\r\n\r\nfunction turnPointsIntoStep(\r\n points: ArrayLike,\r\n coordSys: Cartesian2D | Polar,\r\n stepTurnAt: 'start' | 'end' | 'middle',\r\n connectNulls: boolean\r\n): number[] {\r\n const baseAxis = coordSys.getBaseAxis();\r\n const baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\r\n\r\n const stepPoints: number[] = [];\r\n let i = 0;\r\n const stepPt: number[] = [];\r\n const pt: number[] = [];\r\n const nextPt: number[] = [];\r\n const filteredPoints = [];\r\n if (connectNulls) {\r\n for (i = 0; i < points.length; i += 2) {\r\n if (!isNaN(points[i]) && !isNaN(points[i + 1])) {\r\n filteredPoints.push(points[i], points[i + 1]);\r\n }\r\n }\r\n points = filteredPoints;\r\n }\r\n for (i = 0; i < points.length - 2; i += 2) {\r\n nextPt[0] = points[i + 2];\r\n nextPt[1] = points[i + 3];\r\n pt[0] = points[i];\r\n pt[1] = points[i + 1];\r\n stepPoints.push(pt[0], pt[1]);\r\n\r\n switch (stepTurnAt) {\r\n case 'end':\r\n stepPt[baseIndex] = nextPt[baseIndex];\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n break;\r\n case 'middle':\r\n const middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\r\n const stepPt2 = [];\r\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\r\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\r\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n stepPoints.push(stepPt2[0], stepPt2[1]);\r\n break;\r\n default:\r\n // default is start\r\n stepPt[baseIndex] = pt[baseIndex];\r\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\r\n stepPoints.push(stepPt[0], stepPt[1]);\r\n }\r\n }\r\n // Last points\r\n stepPoints.push(points[i++], points[i++]);\r\n return stepPoints;\r\n}\r\n\r\n/**\r\n * Clip color stops to edge. Avoid creating too large gradients.\r\n * Which may lead to blurry when GPU acceleration is enabled. See #15680\r\n *\r\n * The stops has been sorted from small to large.\r\n */\r\nfunction clipColorStops(colorStops: ColorStop[], maxSize: number): ColorStop[] {\r\n const newColorStops: ColorStop[] = [];\r\n const len = colorStops.length;\r\n // coord will always < 0 in prevOutOfRangeColorStop.\r\n let prevOutOfRangeColorStop: ColorStop;\r\n let prevInRangeColorStop: ColorStop;\r\n\r\n function lerpStop(stop0: ColorStop, stop1: ColorStop, clippedCoord: number) {\r\n const coord0 = stop0.coord;\r\n const p = (clippedCoord - coord0) / (stop1.coord - coord0);\r\n const color = lerp(p, [stop0.color, stop1.color]) as string;\r\n return { coord: clippedCoord, color } as ColorStop;\r\n }\r\n\r\n for (let i = 0; i < len; i++) {\r\n const stop = colorStops[i];\r\n const coord = stop.coord;\r\n if (coord < 0) {\r\n prevOutOfRangeColorStop = stop;\r\n }\r\n else if (coord > maxSize) {\r\n if (prevInRangeColorStop) {\r\n newColorStops.push(lerpStop(prevInRangeColorStop, stop, maxSize));\r\n }\r\n else if (prevOutOfRangeColorStop) { // If there are two stops and coord range is between these two stops\r\n newColorStops.push(\r\n lerpStop(prevOutOfRangeColorStop, stop, 0),\r\n lerpStop(prevOutOfRangeColorStop, stop, maxSize)\r\n );\r\n }\r\n // All following stop will be out of range. So just ignore them.\r\n break;\r\n }\r\n else {\r\n if (prevOutOfRangeColorStop) {\r\n newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop, 0));\r\n // Reset\r\n prevOutOfRangeColorStop = null;\r\n }\r\n newColorStops.push(stop);\r\n prevInRangeColorStop = stop;\r\n }\r\n }\r\n return newColorStops;\r\n}\r\n\r\nfunction getVisualGradient(\r\n data: SeriesData,\r\n coordSys: Cartesian2D | Polar,\r\n api: ExtensionAPI\r\n) {\r\n const visualMetaList = data.getVisual('visualMeta');\r\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\r\n // When data.count() is 0, gradient range can not be calculated.\r\n return;\r\n }\r\n\r\n if (coordSys.type !== 'cartesian2d') {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style is only supported on cartesian2d.');\r\n }\r\n return;\r\n }\r\n\r\n let coordDim: 'x' | 'y';\r\n let visualMeta;\r\n\r\n for (let i = visualMetaList.length - 1; i >= 0; i--) {\r\n const dimInfo = data.getDimensionInfo(visualMetaList[i].dimension);\r\n coordDim = (dimInfo && dimInfo.coordDim) as 'x' | 'y';\r\n // Can only be x or y\r\n if (coordDim === 'x' || coordDim === 'y') {\r\n visualMeta = visualMetaList[i];\r\n break;\r\n }\r\n }\r\n\r\n if (!visualMeta) {\r\n if (__DEV__) {\r\n console.warn('Visual map on line style only support x or y dimension.');\r\n }\r\n return;\r\n }\r\n\r\n // If the area to be rendered is bigger than area defined by LinearGradient,\r\n // the canvas spec prescribes that the color of the first stop and the last\r\n // stop should be used. But if two stops are added at offset 0, in effect\r\n // browsers use the color of the second stop to render area outside\r\n // LinearGradient. So we can only infinitesimally extend area defined in\r\n // LinearGradient to render `outerColors`.\r\n\r\n const axis = coordSys.getAxis(coordDim);\r\n\r\n // dataToCoord mapping may not be linear, but must be monotonic.\r\n const colorStops: ColorStop[] = zrUtil.map(visualMeta.stops, function (stop) {\r\n // offset will be calculated later.\r\n return {\r\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\r\n color: stop.color\r\n } as ColorStop;\r\n });\r\n const stopLen = colorStops.length;\r\n const outerColors = visualMeta.outerColors.slice();\r\n\r\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\r\n colorStops.reverse();\r\n outerColors.reverse();\r\n }\r\n const colorStopsInRange = clipColorStops(\r\n colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight()\r\n );\r\n const inRangeStopLen = colorStopsInRange.length;\r\n if (!inRangeStopLen && stopLen) {\r\n // All stops are out of range. All will be the same color.\r\n return colorStops[0].coord < 0\r\n ? (outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color)\r\n : (outerColors[0] ? outerColors[0] : colorStops[0].color);\r\n }\r\n\r\n const tinyExtent = 10; // Arbitrary value: 10px\r\n const minCoord = colorStopsInRange[0].coord - tinyExtent;\r\n const maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent;\r\n const coordSpan = maxCoord - minCoord;\r\n\r\n if (coordSpan < 1e-3) {\r\n return 'transparent';\r\n }\r\n\r\n zrUtil.each(colorStopsInRange, function (stop) {\r\n stop.offset = (stop.coord - minCoord) / coordSpan;\r\n });\r\n colorStopsInRange.push({\r\n // NOTE: inRangeStopLen may still be 0 if stoplen is zero.\r\n offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5,\r\n color: outerColors[1] || 'transparent'\r\n });\r\n colorStopsInRange.unshift({ // notice newColorStops.length have been changed.\r\n offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5,\r\n color: outerColors[0] || 'transparent'\r\n });\r\n\r\n const gradient = new graphic.LinearGradient(0, 0, 0, 0, colorStopsInRange, true);\r\n gradient[coordDim] = minCoord;\r\n gradient[coordDim + '2' as 'x2' | 'y2'] = maxCoord;\r\n\r\n return gradient;\r\n}\r\n\r\nfunction getIsIgnoreFunc(\r\n seriesModel: LineSeriesModel,\r\n data: SeriesData,\r\n coordSys: Cartesian2D\r\n) {\r\n const showAllSymbol = seriesModel.get('showAllSymbol');\r\n const isAuto = showAllSymbol === 'auto';\r\n\r\n if (showAllSymbol && !isAuto) {\r\n return;\r\n }\r\n\r\n const categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (!categoryAxis) {\r\n return;\r\n }\r\n\r\n // Note that category label interval strategy might bring some weird effect\r\n // in some scenario: users may wonder why some of the symbols are not\r\n // displayed. So we show all symbols as possible as we can.\r\n if (isAuto\r\n // Simplify the logic, do not determine label overlap here.\r\n && canShowAllSymbolForCategory(categoryAxis, data)\r\n ) {\r\n return;\r\n }\r\n\r\n // Otherwise follow the label interval strategy on category axis.\r\n const categoryDataDim = data.mapDimension(categoryAxis.dim);\r\n const labelMap: Dictionary<1> = {};\r\n\r\n zrUtil.each(categoryAxis.getViewLabels(), function (labelItem) {\r\n const ordinalNumber = (categoryAxis.scale as OrdinalScale)\r\n .getRawOrdinalNumber(labelItem.tickValue);\r\n labelMap[ordinalNumber] = 1;\r\n });\r\n\r\n return function (dataIndex: number) {\r\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\r\n };\r\n}\r\n\r\nfunction canShowAllSymbolForCategory(\r\n categoryAxis: Axis2D,\r\n data: SeriesData\r\n) {\r\n // In most cases, line is monotonous on category axis, and the label size\r\n // is close with each other. So we check the symbol size and some of the\r\n // label size alone with the category axis to estimate whether all symbol\r\n // can be shown without overlap.\r\n const axisExtent = categoryAxis.getExtent();\r\n let availSize = Math.abs(axisExtent[1] - axisExtent[0]) / (categoryAxis.scale as OrdinalScale).count();\r\n isNaN(availSize) && (availSize = 0); // 0/0 is NaN.\r\n\r\n // Sampling some points, max 5.\r\n const dataLen = data.count();\r\n const step = Math.max(1, Math.round(dataLen / 5));\r\n for (let dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\r\n if (SymbolClz.getSymbolSize(\r\n data, dataIndex\r\n // Only for cartesian, where `isHorizontal` exists.\r\n )[categoryAxis.isHorizontal() ? 1 : 0]\r\n // Empirical number\r\n * 1.5 > availSize\r\n ) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}\r\n\r\n\r\nfunction isPointNull(x: number, y: number) {\r\n return isNaN(x) || isNaN(y);\r\n}\r\n\r\nfunction getLastIndexNotNull(points: ArrayLike) {\r\n let len = points.length / 2;\r\n for (; len > 0; len--) {\r\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\r\n break;\r\n }\r\n }\r\n\r\n return len - 1;\r\n}\r\n\r\nfunction getPointAtIndex(points: ArrayLike, idx: number) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n}\r\n\r\nfunction getIndexRange(points: ArrayLike, xOrY: number, dim: 'x' | 'y') {\r\n const len = points.length / 2;\r\n\r\n const dimIdx = dim === 'x' ? 0 : 1;\r\n let a;\r\n let b;\r\n let prevIndex = 0;\r\n let nextIndex = -1;\r\n for (let i = 0; i < len; i++) {\r\n b = points[i * 2 + dimIdx];\r\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\r\n continue;\r\n }\r\n if (i === 0) {\r\n a = b;\r\n continue;\r\n }\r\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\r\n nextIndex = i;\r\n break;\r\n }\r\n\r\n prevIndex = i;\r\n a = b;\r\n }\r\n\r\n return {\r\n range: [prevIndex, nextIndex],\r\n t: (xOrY - a) / (b - a)\r\n };\r\n}\r\n\r\nfunction anyStateShowEndLabel(\r\n seriesModel: LineSeriesModel\r\n) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n return true;\r\n }\r\n for (let i = 0; i < SPECIAL_STATES.length; i++) {\r\n if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n\r\ninterface EndLabelAnimationRecord {\r\n lastFrameIndex: number\r\n originalX?: number\r\n originalY?: number\r\n}\r\n\r\nfunction createLineClipPath(\r\n lineView: LineView,\r\n coordSys: Cartesian2D | Polar,\r\n hasAnimation: boolean,\r\n seriesModel: LineSeriesModel\r\n) {\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n const endLabelModel = seriesModel.getModel('endLabel');\r\n const valueAnimation = endLabelModel.get('valueAnimation');\r\n const data = seriesModel.getData();\r\n\r\n const labelAnimationRecord: EndLabelAnimationRecord = { lastFrameIndex: 0 };\r\n\r\n const during = anyStateShowEndLabel(seriesModel)\r\n ? (percent: number, clipRect: graphic.Rect) => {\r\n lineView._endLabelOnDuring(\r\n percent,\r\n clipRect,\r\n data,\r\n labelAnimationRecord,\r\n valueAnimation,\r\n endLabelModel,\r\n coordSys\r\n );\r\n }\r\n : null;\r\n\r\n const isHorizontal = coordSys.getBaseAxis().isHorizontal();\r\n const clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, () => {\r\n const endLabel = lineView._endLabel;\r\n if (endLabel && hasAnimation) {\r\n if (labelAnimationRecord.originalX != null) {\r\n endLabel.attr({\r\n x: labelAnimationRecord.originalX,\r\n y: labelAnimationRecord.originalY\r\n });\r\n }\r\n }\r\n }, during);\r\n // Expand clip shape to avoid clipping when line value exceeds axis\r\n if (!seriesModel.get('clip', true)) {\r\n const rectShape = clipPath.shape;\r\n const expandSize = Math.max(rectShape.width, rectShape.height);\r\n if (isHorizontal) {\r\n rectShape.y -= expandSize;\r\n rectShape.height += expandSize * 2;\r\n }\r\n else {\r\n rectShape.x -= expandSize;\r\n rectShape.width += expandSize * 2;\r\n }\r\n }\r\n\r\n // Set to the final frame. To make sure label layout is right.\r\n if (during) {\r\n during(1, clipPath);\r\n }\r\n return clipPath;\r\n }\r\n else {\r\n if (__DEV__) {\r\n if (seriesModel.get(['endLabel', 'show'])) {\r\n console.warn('endLabel is not supported for lines in polar systems.');\r\n }\r\n }\r\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\r\n }\r\n\r\n}\r\n\r\nfunction getEndLabelStateSpecified(endLabelModel: Model, coordSys: Cartesian2D) {\r\n const baseAxis = coordSys.getBaseAxis();\r\n const isHorizontal = baseAxis.isHorizontal();\r\n const isBaseInversed = baseAxis.inverse;\r\n const align = isHorizontal\r\n ? (isBaseInversed ? 'right' : 'left')\r\n : 'center';\r\n const verticalAlign = isHorizontal\r\n ? 'middle'\r\n : (isBaseInversed ? 'top' : 'bottom');\r\n\r\n return {\r\n normal: {\r\n align: endLabelModel.get('align') || align,\r\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign\r\n }\r\n };\r\n}\r\n\r\nclass LineView extends ChartView {\r\n\r\n static readonly type = 'line';\r\n\r\n _symbolDraw: SymbolDraw;\r\n\r\n _lineGroup: graphic.Group;\r\n _coordSys: Cartesian2D | Polar;\r\n\r\n _endLabel: graphic.Text;\r\n\r\n _polyline: ECPolyline;\r\n _polygon: ECPolygon;\r\n\r\n _stackedOnPoints: ArrayLike;\r\n _points: ArrayLike;\r\n\r\n _step: LineSeriesOption['step'];\r\n _valueOrigin: LineSeriesOption['areaStyle']['origin'];\r\n\r\n _clipShapeForSymbol: CoordinateSystemClipArea;\r\n\r\n _data: SeriesData;\r\n\r\n init() {\r\n const lineGroup = new graphic.Group();\r\n\r\n const symbolDraw = new SymbolDraw();\r\n this.group.add(symbolDraw.group);\r\n\r\n this._symbolDraw = symbolDraw;\r\n this._lineGroup = lineGroup;\r\n\r\n this._changePolyState = zrUtil.bind(this._changePolyState, this);\r\n }\r\n\r\n render(seriesModel: LineSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const group = this.group;\r\n const data = seriesModel.getData();\r\n const lineStyleModel = seriesModel.getModel('lineStyle');\r\n const areaStyleModel = seriesModel.getModel('areaStyle');\r\n\r\n let points = data.getLayout('points') as number[] || [];\r\n\r\n const isCoordSysPolar = coordSys.type === 'polar';\r\n const prevCoordSys = this._coordSys;\r\n\r\n const symbolDraw = this._symbolDraw;\r\n let polyline = this._polyline;\r\n let polygon = this._polygon;\r\n\r\n const lineGroup = this._lineGroup;\r\n\r\n const hasAnimation = !ecModel.ssr && seriesModel.get('animation');\r\n\r\n const isAreaChart = !areaStyleModel.isEmpty();\r\n\r\n const valueOrigin = areaStyleModel.get('origin');\r\n const dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\r\n\r\n let stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\r\n\r\n const showSymbol = seriesModel.get('showSymbol');\r\n\r\n const connectNulls = seriesModel.get('connectNulls');\r\n\r\n const isIgnoreFunc = showSymbol && !isCoordSysPolar\r\n && getIsIgnoreFunc(seriesModel, data, coordSys as Cartesian2D);\r\n\r\n // Remove temporary symbols\r\n const oldData = this._data;\r\n oldData && oldData.eachItemGraphicEl(function (el: SymbolExtended, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n\r\n // Remove previous created symbols if showSymbol changed to false\r\n if (!showSymbol) {\r\n symbolDraw.remove();\r\n }\r\n\r\n group.add(lineGroup);\r\n\r\n // FIXME step not support polar\r\n const step = !isCoordSysPolar ? seriesModel.get('step') : false;\r\n let clipShapeForSymbol: PolarArea | Cartesian2DArea;\r\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\r\n clipShapeForSymbol = coordSys.getArea();\r\n // Avoid float number rounding error for symbol on the edge of axis extent.\r\n // See #7913 and `test/dataZoom-clip.html`.\r\n if ((clipShapeForSymbol as Cartesian2DArea).width != null) {\r\n (clipShapeForSymbol as Cartesian2DArea).x -= 0.1;\r\n (clipShapeForSymbol as Cartesian2DArea).y -= 0.1;\r\n (clipShapeForSymbol as Cartesian2DArea).width += 0.2;\r\n (clipShapeForSymbol as Cartesian2DArea).height += 0.2;\r\n }\r\n else if ((clipShapeForSymbol as PolarArea).r0) {\r\n (clipShapeForSymbol as PolarArea).r0 -= 0.5;\r\n (clipShapeForSymbol as PolarArea).r += 0.5;\r\n }\r\n }\r\n this._clipShapeForSymbol = clipShapeForSymbol;\r\n const visualColor = getVisualGradient(data, coordSys, api)\r\n || data.getVisual('style')[data.getVisual('drawType')];\r\n // Initialization animation or coordinate system changed\r\n if (\r\n !(polyline && prevCoordSys.type === coordSys.type && step === this._step)\r\n ) {\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint(idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n\r\n hasAnimation && this._initSymbolLabelAnimation(\r\n data,\r\n coordSys,\r\n clipShapeForSymbol\r\n );\r\n\r\n if (step) {\r\n // TODO If stacked series is not step\r\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\r\n\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\r\n }\r\n }\r\n\r\n polyline = this._newPolyline(points);\r\n if (isAreaChart) {\r\n polygon = this._newPolygon(\r\n points, stackedOnPoints\r\n );\r\n }// If areaStyle is removed\r\n else if (polygon) {\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n\r\n // NOTE: Must update _endLabel before setClipPath.\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys as Cartesian2D, convertToColorString(visualColor));\r\n }\r\n\r\n lineGroup.setClipPath(\r\n createLineClipPath(this, coordSys, true, seriesModel)\r\n );\r\n }\r\n else {\r\n if (isAreaChart && !polygon) {\r\n // If areaStyle is added\r\n polygon = this._newPolygon(\r\n points, stackedOnPoints\r\n );\r\n }\r\n else if (polygon && !isAreaChart) {\r\n // If areaStyle is removed\r\n lineGroup.remove(polygon);\r\n polygon = this._polygon = null;\r\n }\r\n\r\n // NOTE: Must update _endLabel before setClipPath.\r\n if (!isCoordSysPolar) {\r\n this._initOrUpdateEndLabel(seriesModel, coordSys as Cartesian2D, convertToColorString(visualColor));\r\n }\r\n\r\n // Update clipPath\r\n const oldClipPath = lineGroup.getClipPath();\r\n if (oldClipPath) {\r\n const newClipPath = createLineClipPath(this, coordSys, false, seriesModel);\r\n graphic.initProps(oldClipPath, {\r\n shape: newClipPath.shape\r\n }, seriesModel);\r\n }\r\n else {\r\n lineGroup.setClipPath(\r\n createLineClipPath(this, coordSys, true, seriesModel)\r\n );\r\n }\r\n\r\n // Always update, or it is wrong in the case turning on legend\r\n // because points are not changed.\r\n showSymbol && symbolDraw.updateData(data, {\r\n isIgnore: isIgnoreFunc,\r\n clipShape: clipShapeForSymbol,\r\n disableAnimation: true,\r\n getSymbolPoint(idx) {\r\n return [points[idx * 2], points[idx * 2 + 1]];\r\n }\r\n });\r\n\r\n // In the case data zoom triggered refreshing frequently\r\n // Data may not change if line has a category axis. So it should animate nothing.\r\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)\r\n || !isPointsSame(this._points, points)\r\n ) {\r\n if (hasAnimation) {\r\n this._doUpdateAnimation(\r\n data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls\r\n );\r\n }\r\n else {\r\n // Not do it in update with animation\r\n if (step) {\r\n // TODO If stacked series is not step\r\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\r\n if (stackedOnPoints) {\r\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\r\n }\r\n }\r\n\r\n polyline.setShape({\r\n points: points\r\n });\r\n polygon && polygon.setShape({\r\n points: points,\r\n stackedOnPoints: stackedOnPoints\r\n });\r\n }\r\n }\r\n }\r\n\r\n const emphasisModel = seriesModel.getModel('emphasis');\r\n const focus = emphasisModel.get('focus');\r\n const blurScope = emphasisModel.get('blurScope');\r\n const emphasisDisabled = emphasisModel.get('disabled');\r\n\r\n polyline.useStyle(zrUtil.defaults(\r\n // Use color in lineStyle first\r\n lineStyleModel.getLineStyle(),\r\n {\r\n fill: 'none',\r\n stroke: visualColor,\r\n lineJoin: 'bevel' as CanvasLineJoin\r\n }\r\n ));\r\n\r\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\r\n\r\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\r\n const emphasisLineStyle = polyline.getState('emphasis').style;\r\n emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1;\r\n }\r\n\r\n // Needs seriesIndex for focus\r\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\r\n toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled);\r\n\r\n const smooth = getSmooth(seriesModel.get('smooth'));\r\n const smoothMonotone = seriesModel.get('smoothMonotone');\r\n\r\n polyline.setShape({\r\n smooth,\r\n smoothMonotone,\r\n connectNulls\r\n });\r\n\r\n if (polygon) {\r\n const stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\r\n let stackedOnSmooth = 0;\r\n\r\n polygon.useStyle(zrUtil.defaults(\r\n areaStyleModel.getAreaStyle(),\r\n {\r\n fill: visualColor,\r\n opacity: 0.7,\r\n lineJoin: 'bevel' as CanvasLineJoin,\r\n decal: data.getVisual('style').decal\r\n }\r\n ));\r\n\r\n if (stackedOnSeries) {\r\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\r\n }\r\n\r\n polygon.setShape({\r\n smooth,\r\n stackedOnSmooth,\r\n smoothMonotone,\r\n connectNulls\r\n });\r\n\r\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle');\r\n // Needs seriesIndex for focus\r\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\r\n toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled);\r\n }\r\n\r\n const changePolyState = this._changePolyState;\r\n\r\n data.eachItemGraphicEl(function (el) {\r\n // Switch polyline / polygon state if element changed its state.\r\n el && ((el as ECElement).onHoverStateChange = changePolyState);\r\n });\r\n\r\n (this._polyline as ECElement).onHoverStateChange = changePolyState;\r\n\r\n this._data = data;\r\n // Save the coordinate system for transition animation when data changed\r\n this._coordSys = coordSys;\r\n this._stackedOnPoints = stackedOnPoints;\r\n this._points = points;\r\n this._step = step;\r\n this._valueOrigin = valueOrigin;\r\n\r\n if (seriesModel.get('triggerLineEvent')) {\r\n this.packEventData(seriesModel, polyline);\r\n polygon && this.packEventData(seriesModel, polygon);\r\n }\r\n }\r\n\r\n private packEventData(seriesModel: LineSeriesModel, el: Element) {\r\n getECData(el).eventData = {\r\n componentType: 'series',\r\n componentSubType: 'line',\r\n componentIndex: seriesModel.componentIndex,\r\n seriesIndex: seriesModel.seriesIndex,\r\n seriesName: seriesModel.name,\r\n seriesType: 'line'\r\n };\r\n }\r\n\r\n highlight(\r\n seriesModel: LineSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ) {\r\n const data = seriesModel.getData();\r\n const dataIndex = modelUtil.queryDataIndex(data, payload);\r\n\r\n this._changePolyState('emphasis');\r\n\r\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\r\n const points = data.getLayout('points');\r\n let symbol = data.getItemGraphicEl(dataIndex) as SymbolClz;\r\n if (!symbol) {\r\n // Create a temporary symbol if it is not exists\r\n const x = points[dataIndex * 2];\r\n const y = points[dataIndex * 2 + 1];\r\n if (isNaN(x) || isNaN(y)) {\r\n // Null data\r\n return;\r\n }\r\n // fix #11360: shouldn't draw symbol outside clipShapeForSymbol\r\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\r\n return;\r\n }\r\n const zlevel = seriesModel.get('zlevel') || 0;\r\n const z = seriesModel.get('z') || 0;\r\n symbol = new SymbolClz(data, dataIndex);\r\n symbol.x = x;\r\n symbol.y = y;\r\n symbol.setZ(zlevel, z);\r\n\r\n // ensure label text of the temporary symbol is in front of line and area polygon\r\n const symbolLabel = symbol.getSymbolPath().getTextContent();\r\n if (symbolLabel) {\r\n symbolLabel.zlevel = zlevel;\r\n symbolLabel.z = z;\r\n symbolLabel.z2 = this._polyline.z2 + 1;\r\n }\r\n\r\n (symbol as SymbolExtended).__temp = true;\r\n data.setItemGraphicEl(dataIndex, symbol);\r\n\r\n // Stop scale animation\r\n symbol.stopSymbolAnimation(true);\r\n\r\n this.group.add(symbol);\r\n }\r\n symbol.highlight();\r\n }\r\n else {\r\n // Highlight whole series\r\n ChartView.prototype.highlight.call(\r\n this, seriesModel, ecModel, api, payload\r\n );\r\n }\r\n }\r\n\r\n downplay(\r\n seriesModel: LineSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ) {\r\n const data = seriesModel.getData();\r\n const dataIndex = modelUtil.queryDataIndex(data, payload) as number;\r\n\r\n this._changePolyState('normal');\r\n\r\n if (dataIndex != null && dataIndex >= 0) {\r\n const symbol = data.getItemGraphicEl(dataIndex) as SymbolExtended;\r\n if (symbol) {\r\n if (symbol.__temp) {\r\n data.setItemGraphicEl(dataIndex, null);\r\n this.group.remove(symbol);\r\n }\r\n else {\r\n symbol.downplay();\r\n }\r\n }\r\n }\r\n else {\r\n // FIXME\r\n // can not downplay completely.\r\n // Downplay whole series\r\n ChartView.prototype.downplay.call(\r\n this, seriesModel, ecModel, api, payload\r\n );\r\n }\r\n }\r\n\r\n _changePolyState(toState: DisplayState) {\r\n const polygon = this._polygon;\r\n setStatesFlag(this._polyline, toState);\r\n polygon && setStatesFlag(polygon, toState);\r\n }\r\n\r\n _newPolyline(points: ArrayLike) {\r\n let polyline = this._polyline;\r\n // Remove previous created polyline\r\n if (polyline) {\r\n this._lineGroup.remove(polyline);\r\n }\r\n\r\n polyline = new ECPolyline({\r\n shape: {\r\n points\r\n },\r\n segmentIgnoreThreshold: 2,\r\n z2: 10\r\n });\r\n\r\n this._lineGroup.add(polyline);\r\n\r\n this._polyline = polyline;\r\n\r\n return polyline;\r\n }\r\n\r\n _newPolygon(points: ArrayLike, stackedOnPoints: ArrayLike) {\r\n let polygon = this._polygon;\r\n // Remove previous created polygon\r\n if (polygon) {\r\n this._lineGroup.remove(polygon);\r\n }\r\n\r\n polygon = new ECPolygon({\r\n shape: {\r\n points,\r\n stackedOnPoints: stackedOnPoints\r\n },\r\n segmentIgnoreThreshold: 2\r\n });\r\n\r\n this._lineGroup.add(polygon);\r\n\r\n this._polygon = polygon;\r\n return polygon;\r\n }\r\n\r\n _initSymbolLabelAnimation(\r\n data: SeriesData,\r\n coordSys: Polar | Cartesian2D,\r\n clipShape: PolarArea | Cartesian2DArea\r\n ) {\r\n let isHorizontalOrRadial: boolean;\r\n let isCoordSysPolar: boolean;\r\n const baseAxis = coordSys.getBaseAxis();\r\n const isAxisInverse = baseAxis.inverse;\r\n if (coordSys.type === 'cartesian2d') {\r\n isHorizontalOrRadial = (baseAxis as Axis2D).isHorizontal();\r\n isCoordSysPolar = false;\r\n }\r\n else if (coordSys.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n isCoordSysPolar = true;\r\n }\r\n\r\n const seriesModel = data.hostModel;\r\n let seriesDuration = seriesModel.get('animationDuration');\r\n if (zrUtil.isFunction(seriesDuration)) {\r\n seriesDuration = seriesDuration(null);\r\n }\r\n const seriesDelay = seriesModel.get('animationDelay') || 0;\r\n const seriesDelayValue = zrUtil.isFunction(seriesDelay)\r\n ? seriesDelay(null)\r\n : seriesDelay;\r\n\r\n data.eachItemGraphicEl(function (symbol: SymbolExtended, idx) {\r\n const el = symbol;\r\n if (el) {\r\n const point = [symbol.x, symbol.y];\r\n let start;\r\n let end;\r\n let current;\r\n if (clipShape) {\r\n if (isCoordSysPolar) {\r\n const polarClip = clipShape as PolarArea;\r\n const coord = (coordSys as Polar).pointToCoord(point);\r\n if (isHorizontalOrRadial) {\r\n start = polarClip.startAngle;\r\n end = polarClip.endAngle;\r\n current = -coord[1] / 180 * Math.PI;\r\n }\r\n else {\r\n start = polarClip.r0;\r\n end = polarClip.r;\r\n current = coord[0];\r\n }\r\n }\r\n else {\r\n const gridClip = clipShape as Cartesian2DArea;\r\n if (isHorizontalOrRadial) {\r\n start = gridClip.x;\r\n end = gridClip.x + gridClip.width;\r\n current = symbol.x;\r\n }\r\n else {\r\n start = gridClip.y + gridClip.height;\r\n end = gridClip.y;\r\n current = symbol.y;\r\n }\r\n }\r\n }\r\n let ratio = end === start ? 0 : (current - start) / (end - start);\r\n if (isAxisInverse) {\r\n ratio = 1 - ratio;\r\n }\r\n\r\n const delay = zrUtil.isFunction(seriesDelay) ? seriesDelay(idx)\r\n : (seriesDuration * ratio) + seriesDelayValue;\r\n\r\n const symbolPath = el.getSymbolPath();\r\n const text = symbolPath.getTextContent();\r\n\r\n el.attr({ scaleX: 0, scaleY: 0 });\r\n el.animateTo({\r\n scaleX: 1,\r\n scaleY: 1\r\n }, {\r\n duration: 200,\r\n setToFinal: true,\r\n delay: delay\r\n });\r\n\r\n if (text) {\r\n text.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, {\r\n duration: 300,\r\n delay: delay\r\n });\r\n }\r\n\r\n (symbolPath as ECElement).disableLabelAnimation = true;\r\n }\r\n });\r\n }\r\n\r\n _initOrUpdateEndLabel(\r\n seriesModel: LineSeriesModel,\r\n coordSys: Cartesian2D,\r\n inheritColor: string\r\n ) {\r\n const endLabelModel = seriesModel.getModel('endLabel');\r\n\r\n if (anyStateShowEndLabel(seriesModel)) {\r\n const data = seriesModel.getData();\r\n const polyline = this._polyline;\r\n // series may be filtered.\r\n const points = data.getLayout('points');\r\n if (!points) {\r\n polyline.removeTextContent();\r\n this._endLabel = null;\r\n return;\r\n }\r\n let endLabel = this._endLabel;\r\n if (!endLabel) {\r\n endLabel = this._endLabel = new graphic.Text({\r\n z2: 200 // should be higher than item symbol\r\n });\r\n endLabel.ignoreClip = true;\r\n polyline.setTextContent(this._endLabel);\r\n (polyline as ECElement).disableLabelAnimation = true;\r\n }\r\n\r\n // Find last non-NaN data to display data\r\n const dataIndex = getLastIndexNotNull(points);\r\n if (dataIndex >= 0) {\r\n setLabelStyle(\r\n polyline,\r\n getLabelStatesModels(seriesModel, 'endLabel'),\r\n {\r\n inheritColor,\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText(dataIndex, opt, interpolatedValue) {\r\n return interpolatedValue != null\r\n ? getDefaultInterpolatedLabel(data, interpolatedValue)\r\n : getDefaultLabel(data, dataIndex);\r\n },\r\n enableTextSetter: true\r\n },\r\n getEndLabelStateSpecified(endLabelModel, coordSys)\r\n );\r\n polyline.textConfig.position = null;\r\n }\r\n }\r\n else if (this._endLabel) {\r\n this._polyline.removeTextContent();\r\n this._endLabel = null;\r\n }\r\n }\r\n\r\n _endLabelOnDuring(\r\n percent: number,\r\n clipRect: graphic.Rect,\r\n data: SeriesData,\r\n animationRecord: EndLabelAnimationRecord,\r\n valueAnimation: boolean,\r\n endLabelModel: Model,\r\n coordSys: Cartesian2D\r\n ) {\r\n const endLabel = this._endLabel;\r\n const polyline = this._polyline;\r\n\r\n if (endLabel) {\r\n // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.\r\n // The label is not prepared at this time.\r\n if (percent < 1 && animationRecord.originalX == null) {\r\n animationRecord.originalX = endLabel.x;\r\n animationRecord.originalY = endLabel.y;\r\n }\r\n\r\n const points = data.getLayout('points');\r\n\r\n const seriesModel = data.hostModel as LineSeriesModel;\r\n const connectNulls = seriesModel.get('connectNulls');\r\n const precision = endLabelModel.get('precision');\r\n const distance = endLabelModel.get('distance') || 0;\r\n\r\n const baseAxis = coordSys.getBaseAxis();\r\n const isHorizontal = baseAxis.isHorizontal();\r\n const isBaseInversed = baseAxis.inverse;\r\n const clipShape = clipRect.shape;\r\n\r\n const xOrY = isBaseInversed\r\n ? isHorizontal ? clipShape.x : (clipShape.y + clipShape.height)\r\n : isHorizontal ? (clipShape.x + clipShape.width) : clipShape.y;\r\n const distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1);\r\n const distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1);\r\n const dim = isHorizontal ? 'x' : 'y';\r\n\r\n const dataIndexRange = getIndexRange(points, xOrY, dim);\r\n const indices = dataIndexRange.range;\r\n\r\n const diff = indices[1] - indices[0];\r\n let value: ParsedValue;\r\n if (diff >= 1) {\r\n // diff > 1 && connectNulls, which is on the null data.\r\n if (diff > 1 && !connectNulls) {\r\n const pt = getPointAtIndex(points, indices[0]);\r\n endLabel.attr({\r\n x: pt[0] + distanceX,\r\n y: pt[1] + distanceY\r\n });\r\n valueAnimation && (value = seriesModel.getRawValue(indices[0]) as ParsedValue);\r\n }\r\n else {\r\n const pt = polyline.getPointOn(xOrY, dim);\r\n pt && endLabel.attr({\r\n x: pt[0] + distanceX,\r\n y: pt[1] + distanceY\r\n });\r\n\r\n const startValue = seriesModel.getRawValue(indices[0]) as ParsedValue;\r\n const endValue = seriesModel.getRawValue(indices[1]) as ParsedValue;\r\n valueAnimation && (value = modelUtil.interpolateRawValues(\r\n data, precision, startValue, endValue, dataIndexRange.t\r\n ) as ParsedValue);\r\n }\r\n animationRecord.lastFrameIndex = indices[0];\r\n }\r\n else {\r\n // If diff <= 0, which is the range is not found(Include NaN)\r\n // Choose the first point or last point.\r\n const idx = (percent === 1 || animationRecord.lastFrameIndex > 0) ? indices[0] : 0;\r\n const pt = getPointAtIndex(points, idx);\r\n valueAnimation && (value = seriesModel.getRawValue(idx) as ParsedValue);\r\n endLabel.attr({\r\n x: pt[0] + distanceX,\r\n y: pt[1] + distanceY\r\n });\r\n }\r\n if (valueAnimation) {\r\n const inner = labelInner(endLabel);\r\n if (typeof inner.setLabelText === 'function') {\r\n inner.setLabelText(value);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n // FIXME Two value axis\r\n _doUpdateAnimation(\r\n data: SeriesData,\r\n stackedOnPoints: ArrayLike,\r\n coordSys: Cartesian2D | Polar,\r\n api: ExtensionAPI,\r\n step: LineSeriesOption['step'],\r\n valueOrigin: LineSeriesOption['areaStyle']['origin'],\r\n connectNulls: boolean\r\n ) {\r\n const polyline = this._polyline;\r\n const polygon = this._polygon;\r\n const seriesModel = data.hostModel;\r\n\r\n const diff = lineAnimationDiff(\r\n this._data, data,\r\n this._stackedOnPoints, stackedOnPoints,\r\n this._coordSys, coordSys,\r\n this._valueOrigin, valueOrigin\r\n );\r\n\r\n let current = diff.current;\r\n let stackedOnCurrent = diff.stackedOnCurrent;\r\n let next = diff.next;\r\n let stackedOnNext = diff.stackedOnNext;\r\n if (step) {\r\n // TODO If stacked series is not step\r\n current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls);\r\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls);\r\n next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls);\r\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls);\r\n }\r\n // Don't apply animation if diff is large.\r\n // For better result and avoid memory explosion problems like\r\n // https://github.com/apache/incubator-echarts/issues/12229\r\n if (getBoundingDiff(current, next) > 3000\r\n || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)\r\n ) {\r\n polyline.stopAnimation();\r\n polyline.setShape({\r\n points: next\r\n });\r\n if (polygon) {\r\n polygon.stopAnimation();\r\n polygon.setShape({\r\n points: next,\r\n stackedOnPoints: stackedOnNext\r\n });\r\n }\r\n return;\r\n }\r\n\r\n (polyline.shape as any).__points = diff.current;\r\n polyline.shape.points = current;\r\n\r\n const target = {\r\n shape: {\r\n points: next\r\n }\r\n };\r\n // Also animate the original points.\r\n // If points reference is changed when turning into step line.\r\n if (diff.current !== current) {\r\n (target.shape as any).__points = diff.next;\r\n }\r\n\r\n // Stop previous animation.\r\n polyline.stopAnimation();\r\n graphic.updateProps(polyline, target, seriesModel);\r\n\r\n if (polygon) {\r\n polygon.setShape({\r\n // Reuse the points with polyline.\r\n points: current,\r\n stackedOnPoints: stackedOnCurrent\r\n });\r\n polygon.stopAnimation();\r\n graphic.updateProps(polygon, {\r\n shape: {\r\n stackedOnPoints: stackedOnNext\r\n }\r\n }, seriesModel);\r\n // If use attr directly in updateProps.\r\n if (polyline.shape.points !== polygon.shape.points) {\r\n polygon.shape.points = polyline.shape.points;\r\n }\r\n }\r\n\r\n const updatedDataInfo: {\r\n el: SymbolExtended,\r\n ptIdx: number\r\n }[] = [];\r\n const diffStatus = diff.status;\r\n\r\n for (let i = 0; i < diffStatus.length; i++) {\r\n const cmd = diffStatus[i].cmd;\r\n if (cmd === '=') {\r\n const el = data.getItemGraphicEl(diffStatus[i].idx1) as SymbolExtended;\r\n if (el) {\r\n updatedDataInfo.push({\r\n el: el,\r\n ptIdx: i // Index of points\r\n });\r\n }\r\n }\r\n }\r\n if (polyline.animators && polyline.animators.length) {\r\n polyline.animators[0].during(function () {\r\n polygon && polygon.dirtyShape();\r\n const points = (polyline.shape as any).__points;\r\n for (let i = 0; i < updatedDataInfo.length; i++) {\r\n const el = updatedDataInfo[i].el;\r\n const offset = updatedDataInfo[i].ptIdx * 2;\r\n el.x = points[offset];\r\n el.y = points[offset + 1];\r\n el.markRedraw();\r\n }\r\n });\r\n }\r\n }\r\n\r\n remove(ecModel: GlobalModel) {\r\n const group = this.group;\r\n const oldData = this._data;\r\n this._lineGroup.removeAll();\r\n this._symbolDraw.remove(true);\r\n // Remove temporary created elements when highlighting\r\n oldData && oldData.eachItemGraphicEl(function (el: SymbolExtended, idx) {\r\n if (el.__temp) {\r\n group.remove(el);\r\n oldData.setItemGraphicEl(idx, null);\r\n }\r\n });\r\n\r\n this._polyline =\r\n this._polygon =\r\n this._coordSys =\r\n this._points =\r\n this._stackedOnPoints =\r\n this._endLabel =\r\n this._data = null;\r\n }\r\n}\r\n\r\nexport default LineView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport {map} from 'zrender/src/core/util';\r\nimport createRenderPlanner from '../chart/helper/createRenderPlanner';\r\nimport {isDimensionStacked} from '../data/helper/dataStackHelper';\r\nimport SeriesModel from '../model/Series';\r\nimport { StageHandler, ParsedValueNumeric } from '../util/types';\r\nimport { createFloat32Array } from '../util/vendor';\r\n\r\n\r\nexport default function pointsLayout(seriesType: string, forceStoreInTypedArray?: boolean): StageHandler {\r\n return {\r\n seriesType: seriesType,\r\n\r\n plan: createRenderPlanner(),\r\n\r\n reset: function (seriesModel: SeriesModel) {\r\n const data = seriesModel.getData();\r\n const coordSys = seriesModel.coordinateSystem;\r\n const pipelineContext = seriesModel.pipelineContext;\r\n const useTypedArray = forceStoreInTypedArray || pipelineContext.large;\r\n\r\n if (!coordSys) {\r\n return;\r\n }\r\n\r\n const dims = map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }).slice(0, 2);\r\n const dimLen = dims.length;\r\n\r\n const stackResultDim = data.getCalculationInfo('stackResultDimension');\r\n if (isDimensionStacked(data, dims[0])) {\r\n dims[0] = stackResultDim;\r\n }\r\n if (isDimensionStacked(data, dims[1])) {\r\n dims[1] = stackResultDim;\r\n }\r\n\r\n const store = data.getStore();\r\n const dimIdx0 = data.getDimensionIndex(dims[0]);\r\n const dimIdx1 = data.getDimensionIndex(dims[1]);\r\n\r\n return dimLen && {\r\n progress(params, data) {\r\n const segCount = params.end - params.start;\r\n const points = useTypedArray && createFloat32Array(segCount * dimLen);\r\n\r\n const tmpIn: ParsedValueNumeric[] = [];\r\n const tmpOut: number[] = [];\r\n\r\n for (let i = params.start, offset = 0; i < params.end; i++) {\r\n let point;\r\n\r\n if (dimLen === 1) {\r\n const x = store.get(dimIdx0, i) as ParsedValueNumeric;\r\n // NOTE: Make sure the second parameter is null to use default strategy.\r\n point = coordSys.dataToPoint(x, null, tmpOut);\r\n }\r\n else {\r\n tmpIn[0] = store.get(dimIdx0, i) as ParsedValueNumeric;\r\n tmpIn[1] = store.get(dimIdx1, i) as ParsedValueNumeric;\r\n // Let coordinate system to handle the NaN data.\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n }\r\n\r\n if (useTypedArray) {\r\n points[offset++] = point[0];\r\n points[offset++] = point[1];\r\n }\r\n else {\r\n data.setItemLayout(i, point.slice());\r\n }\r\n }\r\n\r\n useTypedArray && data.setLayout('points', points);\r\n }\r\n };\r\n }\r\n };\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { StageHandler, SeriesOption, SeriesSamplingOptionMixin } from '../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport SeriesModel from '../model/Series';\r\nimport { isFunction, isString } from 'zrender/src/core/util';\r\n\r\n\r\ntype Sampler = (frame: ArrayLike) => number;\r\nconst samplers: Dictionary = {\r\n average: function (frame) {\r\n let sum = 0;\r\n let count = 0;\r\n for (let i = 0; i < frame.length; i++) {\r\n if (!isNaN(frame[i])) {\r\n sum += frame[i];\r\n count++;\r\n }\r\n }\r\n // Return NaN if count is 0\r\n return count === 0 ? NaN : sum / count;\r\n },\r\n sum: function (frame) {\r\n let sum = 0;\r\n for (let i = 0; i < frame.length; i++) {\r\n // Ignore NaN\r\n sum += frame[i] || 0;\r\n }\r\n return sum;\r\n },\r\n max: function (frame) {\r\n let max = -Infinity;\r\n for (let i = 0; i < frame.length; i++) {\r\n frame[i] > max && (max = frame[i]);\r\n }\r\n // NaN will cause illegal axis extent.\r\n return isFinite(max) ? max : NaN;\r\n },\r\n min: function (frame) {\r\n let min = Infinity;\r\n for (let i = 0; i < frame.length; i++) {\r\n frame[i] < min && (min = frame[i]);\r\n }\r\n // NaN will cause illegal axis extent.\r\n return isFinite(min) ? min : NaN;\r\n },\r\n minmax: function (frame) {\r\n let turningPointAbsoluteValue = -Infinity;\r\n let turningPointOriginalValue = -Infinity;\r\n\r\n for (let i = 0; i < frame.length; i++) {\r\n const originalValue = frame[i];\r\n const absoluteValue = Math.abs(originalValue);\r\n\r\n if (absoluteValue > turningPointAbsoluteValue) {\r\n turningPointAbsoluteValue = absoluteValue;\r\n turningPointOriginalValue = originalValue;\r\n }\r\n }\r\n\r\n return isFinite(turningPointOriginalValue) ? turningPointOriginalValue : NaN;\r\n },\r\n // TODO\r\n // Median\r\n nearest: function (frame) {\r\n return frame[0];\r\n }\r\n};\r\n\r\nconst indexSampler = function (frame: ArrayLike) {\r\n return Math.round(frame.length / 2);\r\n};\r\n\r\nexport default function dataSample(seriesType: string): StageHandler {\r\n return {\r\n\r\n seriesType: seriesType,\r\n\r\n // FIXME:TS never used, so comment it\r\n // modifyOutputEnd: true,\r\n\r\n reset: function (seriesModel: SeriesModel, ecModel, api) {\r\n const data = seriesModel.getData();\r\n const sampling = seriesModel.get('sampling');\r\n const coordSys = seriesModel.coordinateSystem;\r\n const count = data.count();\r\n // Only cartesian2d support down sampling. Disable it when there is few data.\r\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\r\n const baseAxis = coordSys.getBaseAxis();\r\n const valueAxis = coordSys.getOtherAxis(baseAxis);\r\n const extent = baseAxis.getExtent();\r\n const dpr = api.getDevicePixelRatio();\r\n // Coordinste system has been resized\r\n const size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\r\n const rate = Math.round(count / size);\r\n\r\n if (isFinite(rate) && rate > 1) {\r\n if (sampling === 'lttb') {\r\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\r\n }\r\n let sampler;\r\n if (isString(sampling)) {\r\n sampler = samplers[sampling];\r\n }\r\n else if (isFunction(sampling)) {\r\n sampler = sampling;\r\n }\r\n if (sampler) {\r\n // Only support sample the first dim mapped from value axis.\r\n seriesModel.setData(data.downSample(\r\n data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler\r\n ));\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport LineSeries from './LineSeries';\r\nimport LineView from './LineView';\r\n\r\n// In case developer forget to include grid component\r\n\r\nimport layoutPoints from '../../layout/points';\r\nimport dataSample from '../../processor/dataSample';\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerChartView(LineView);\r\n registers.registerSeriesModel(LineSeries);\r\n\r\n registers.registerLayout(layoutPoints('line', true));\r\n\r\n registers.registerVisual({\r\n seriesType: 'line',\r\n reset: function (seriesModel: LineSeries) {\r\n const data = seriesModel.getData();\r\n // Visual coding for legend\r\n const lineStyle = seriesModel.getModel('lineStyle').getLineStyle();\r\n if (lineStyle && !lineStyle.stroke) {\r\n // Fill in visual should be palette color if\r\n // has color callback\r\n lineStyle.stroke = data.getVisual('style').fill;\r\n }\r\n data.setVisual('legendLineStyle', lineStyle);\r\n }\r\n });\r\n\r\n // Down sample after filter\r\n registers.registerProcessor(\r\n registers.PRIORITY.PROCESSOR.STATISTIC,\r\n dataSample('line')\r\n );\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport {\r\n SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnPolarOptionMixin,\r\n ScaleDataValue,\r\n DefaultStatesMixin,\r\n StatesMixinBase\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport {dimPermutations} from '../../component/marker/MarkAreaView';\r\nimport { each } from 'zrender/src/core/util';\r\nimport type Axis2D from '../../coord/cartesian/Axis2D';\r\n\r\n\r\nexport interface BaseBarSeriesOption\r\n extends SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnPolarOptionMixin {\r\n\r\n /**\r\n * Min height of bar\r\n */\r\n barMinHeight?: number\r\n /**\r\n * Min angle of bar. Available on polar coordinate system.\r\n */\r\n barMinAngle?: number\r\n\r\n /**\r\n * Max width of bar. Defaults to 1 on cartesian coordinate system. Otherwise it's null.\r\n */\r\n barMaxWidth?: number | string\r\n\r\n barMinWidth?: number | string\r\n\r\n /**\r\n * Bar width. Will be calculated automatically.\r\n * Can be pixel width or percent string.\r\n */\r\n barWidth?: number | string\r\n\r\n /**\r\n * Gap between each bar inside category. Default to be 30%. Can be an aboslute pixel value\r\n */\r\n barGap?: string | number\r\n\r\n /**\r\n * Gap between each category. Default to be 20%. can be an absolute pixel value.\r\n */\r\n barCategoryGap?: string | number\r\n\r\n large?: boolean\r\n largeThreshold?: number\r\n}\r\n\r\nclass BaseBarSeriesModel = BaseBarSeriesOption>\r\n extends SeriesModel {\r\n\r\n static type = 'series.__base_bar__';\r\n type = BaseBarSeriesModel.type;\r\n\r\n getInitialData(option: Opts, ecModel: GlobalModel): SeriesData {\r\n return createSeriesData(null, this, {useEncodeDefaulter: true});\r\n }\r\n\r\n getMarkerPosition(\r\n value: ScaleDataValue[],\r\n dims?: typeof dimPermutations[number],\r\n startingAtTick?: boolean\r\n ) {\r\n const coordSys = this.coordinateSystem;\r\n if (coordSys && coordSys.clampData) {\r\n // PENDING if clamp ?\r\n const clampData = coordSys.clampData(value);\r\n const pt = coordSys.dataToPoint(clampData);\r\n if (startingAtTick) {\r\n each(coordSys.getAxes(), function (axis: Axis2D, idx: number) {\r\n // If axis type is category, use tick coords instead\r\n if (axis.type === 'category' && dims != null) {\r\n const tickCoords = axis.getTicksCoords();\r\n const alignTicksWithLabel = axis.getTickModel().get('alignWithLabel');\r\n\r\n let targetTickId = clampData[idx];\r\n // The index of rightmost tick of markArea is 1 larger than x1/y1 index\r\n const isEnd = dims[idx] === 'x1' || dims[idx] === 'y1';\r\n if (isEnd && !alignTicksWithLabel) {\r\n targetTickId += 1;\r\n }\r\n\r\n // The only contains one tick, tickCoords is\r\n // like [{coord: 0, tickValue: 0}, {coord: 0}]\r\n // to the length should always be larger than 1\r\n if (tickCoords.length < 2) {\r\n return;\r\n }\r\n else if (tickCoords.length === 2) {\r\n // The left value and right value of the axis are\r\n // the same. coord is 0 in both items. Use the max\r\n // value of the axis as the coord\r\n pt[idx] = axis.toGlobalCoord(\r\n axis.getExtent()[isEnd ? 1 : 0]\r\n );\r\n return;\r\n }\r\n\r\n let leftCoord;\r\n let coord;\r\n let stepTickValue = 1;\r\n for (let i = 0; i < tickCoords.length; i++) {\r\n const tickCoord = tickCoords[i].coord;\r\n // The last item of tickCoords doesn't contain\r\n // tickValue\r\n const tickValue = i === tickCoords.length - 1\r\n ? tickCoords[i - 1].tickValue + stepTickValue\r\n : tickCoords[i].tickValue;\r\n if (tickValue === targetTickId) {\r\n coord = tickCoord;\r\n break;\r\n }\r\n else if (tickValue < targetTickId) {\r\n leftCoord = tickCoord;\r\n }\r\n else if (leftCoord != null && tickValue > targetTickId) {\r\n coord = (tickCoord + leftCoord) / 2;\r\n break;\r\n }\r\n if (i === 1) {\r\n // Here we assume the step of category axes is\r\n // the same\r\n stepTickValue = tickValue - tickCoords[0].tickValue;\r\n }\r\n }\r\n if (coord == null) {\r\n if (!leftCoord) {\r\n // targetTickId is smaller than all tick ids in the\r\n // visible area, use the leftmost tick coord\r\n coord = tickCoords[0].coord;\r\n }\r\n else if (leftCoord) {\r\n // targetTickId is larger than all tick ids in the\r\n // visible area, use the rightmost tick coord\r\n coord = tickCoords[tickCoords.length - 1].coord;\r\n }\r\n }\r\n pt[idx] = axis.toGlobalCoord(coord);\r\n }\r\n });\r\n }\r\n else {\r\n const data = this.getData();\r\n const offset = data.getLayout('offset');\r\n const size = data.getLayout('size');\r\n const offsetIndex = (coordSys as Cartesian2D).getBaseAxis().isHorizontal() ? 0 : 1;\r\n pt[offsetIndex] += offset + size / 2;\r\n }\r\n return pt;\r\n }\r\n return [NaN, NaN];\r\n }\r\n\r\n static defaultOption: BaseBarSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n // stack: null\r\n\r\n // Cartesian coordinate system\r\n // xAxisIndex: 0,\r\n // yAxisIndex: 0,\r\n\r\n barMinHeight: 0,\r\n barMinAngle: 0,\r\n // cursor: null,\r\n\r\n large: false,\r\n largeThreshold: 400,\r\n progressive: 3e3,\r\n progressiveChunkMode: 'mod'\r\n };\r\n}\r\n\r\nSeriesModel.registerClass(BaseBarSeriesModel);\r\n\r\nexport default BaseBarSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport BaseBarSeriesModel, {BaseBarSeriesOption} from './BaseBarSeries';\r\nimport {\r\n ItemStyleOption,\r\n OptionDataValue,\r\n SeriesStackOptionMixin,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n SeriesSamplingOptionMixin,\r\n SeriesLabelOption,\r\n SeriesEncodeOptionMixin,\r\n DefaultStatesMixinEmphasis,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport type Polar from '../../coord/polar/Polar';\r\nimport { inheritDefaultOption } from '../../util/component';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { BrushCommonSelectorsForSeries } from '../../component/brush/selector';\r\n\r\nexport type PolarBarLabelPosition = SeriesLabelOption['position']\r\n | 'start' | 'insideStart' | 'middle' | 'end' | 'insideEnd';\r\n\r\nexport type BarSeriesLabelOption = Omit\r\n & {position?: PolarBarLabelPosition | 'outside'};\r\n\r\nexport interface BarStateOption {\r\n itemStyle?: BarItemStyleOption\r\n label?: BarSeriesLabelOption\r\n}\r\n\r\ninterface BarStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\n\r\nexport interface BarItemStyleOption extends ItemStyleOption {\r\n // for polar bars, this is used for sector's cornerRadius\r\n borderRadius?: (number | string)[] | number | string\r\n}\r\nexport interface BarDataItemOption extends BarStateOption,\r\n StatesOptionMixin,\r\n OptionDataItemObject {\r\n cursor?: string\r\n}\r\n\r\nexport interface BarSeriesOption\r\n extends BaseBarSeriesOption, BarStatesMixin>,\r\n BarStateOption,\r\n SeriesStackOptionMixin, SeriesSamplingOptionMixin, SeriesEncodeOptionMixin {\r\n\r\n type?: 'bar'\r\n\r\n coordinateSystem?: 'cartesian2d' | 'polar'\r\n\r\n clip?: boolean\r\n\r\n /**\r\n * If use caps on two sides of bars\r\n * Only available on tangential polar bar\r\n */\r\n roundCap?: boolean\r\n\r\n showBackground?: boolean\r\n\r\n startValue?: number\r\n\r\n backgroundStyle?: ItemStyleOption & {\r\n borderRadius?: number | number[]\r\n }\r\n\r\n data?: (BarDataItemOption | OptionDataValue | OptionDataValue[])[]\r\n\r\n realtimeSort?: boolean\r\n}\r\n\r\nclass BarSeriesModel extends BaseBarSeriesModel {\r\n static type = 'series.bar';\r\n type = BarSeriesModel.type;\r\n\r\n static dependencies = ['grid', 'polar'];\r\n\r\n coordinateSystem: Cartesian2D | Polar;\r\n\r\n getInitialData(): SeriesData {\r\n return createSeriesData(null, this, {\r\n useEncodeDefaulter: true,\r\n createInvertedIndices: !!this.get('realtimeSort', true) || null\r\n });\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getProgressive() {\r\n // Do not support progressive in normal mode.\r\n return this.get('large')\r\n ? this.get('progressive')\r\n : false;\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getProgressiveThreshold() {\r\n // Do not support progressive in normal mode.\r\n let progressiveThreshold = this.get('progressiveThreshold');\r\n const largeThreshold = this.get('largeThreshold');\r\n if (largeThreshold > progressiveThreshold) {\r\n progressiveThreshold = largeThreshold;\r\n }\r\n return progressiveThreshold;\r\n }\r\n\r\n brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries): boolean {\r\n return selectors.rect(data.getItemLayout(dataIndex));\r\n }\r\n\r\n static defaultOption: BarSeriesOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n // If clipped\r\n // Only available on cartesian2d\r\n clip: true,\r\n\r\n roundCap: false,\r\n\r\n showBackground: false,\r\n backgroundStyle: {\r\n color: 'rgba(180, 180, 180, 0.2)',\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderType: 'solid',\r\n borderRadius: 0,\r\n shadowBlur: 0,\r\n shadowColor: null,\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n\r\n realtimeSort: false\r\n } as BarSeriesOption);\r\n\r\n}\r\n\r\nexport default BarSeriesModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {Path} from '../graphic';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\n\r\n/**\r\n * Sausage: similar to sector, but have half circle on both sides\r\n */\r\n\r\nclass SausageShape {\r\n cx = 0;\r\n cy = 0;\r\n r0 = 0;\r\n r = 0;\r\n startAngle = 0;\r\n endAngle = Math.PI * 2;\r\n clockwise = true;\r\n}\r\n\r\ninterface SausagePathProps extends PathProps {\r\n shape?: SausageShape\r\n}\r\n\r\nclass SausagePath extends Path {\r\n\r\n type = 'sausage';\r\n\r\n constructor(opts?: SausagePathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new SausageShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: SausageShape) {\r\n const cx = shape.cx;\r\n const cy = shape.cy;\r\n const r0 = Math.max(shape.r0 || 0, 0);\r\n const r = Math.max(shape.r, 0);\r\n const dr = (r - r0) * 0.5;\r\n const rCenter = r0 + dr;\r\n let startAngle = shape.startAngle;\r\n const endAngle = shape.endAngle;\r\n const clockwise = shape.clockwise;\r\n\r\n const PI2 = Math.PI * 2;\r\n const lessThanCircle = clockwise\r\n ? endAngle - startAngle < PI2\r\n : startAngle - endAngle < PI2;\r\n\r\n if (!lessThanCircle) {\r\n // Normalize angles\r\n startAngle = endAngle - (clockwise ? PI2 : -PI2);\r\n }\r\n\r\n const unitStartX = Math.cos(startAngle);\r\n const unitStartY = Math.sin(startAngle);\r\n const unitEndX = Math.cos(endAngle);\r\n const unitEndY = Math.sin(endAngle);\r\n\r\n if (lessThanCircle) {\r\n ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy);\r\n ctx.arc(\r\n unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr,\r\n -Math.PI + startAngle, startAngle, !clockwise\r\n );\r\n }\r\n else {\r\n ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy);\r\n }\r\n\r\n ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise);\r\n\r\n ctx.arc(\r\n unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr,\r\n endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise\r\n );\r\n\r\n if (r0 !== 0) {\r\n ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise);\r\n }\r\n\r\n // ctx.closePath();\r\n }\r\n}\r\n\r\nexport default SausagePath;", "\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {calculateTextPosition, TextPositionCalculationResult} from 'zrender/src/contain/text';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport {BuiltinTextPosition, TextAlign, TextVerticalAlign} from 'zrender/src/core/types';\r\nimport {isArray, isNumber} from 'zrender/src/core/util';\r\nimport {ElementCalculateTextPosition, ElementTextConfig} from 'zrender/src/Element';\r\nimport { Sector } from '../util/graphic';\r\n\r\nexport type SectorTextPosition = BuiltinTextPosition\r\n | 'startAngle' | 'insideStartAngle'\r\n | 'endAngle' | 'insideEndAngle'\r\n | 'middle'\r\n | 'startArc' | 'insideStartArc'\r\n | 'endArc' | 'insideEndArc'\r\n | (number | string)[];\r\n\r\nexport type SectorLike = {\r\n cx: number\r\n cy: number\r\n r0: number\r\n r: number\r\n startAngle: number\r\n endAngle: number\r\n clockwise: boolean\r\n};\r\n\r\nexport function createSectorCalculateTextPosition(\r\n positionMapping: (seriesLabelPosition: T) => SectorTextPosition,\r\n opts?: {\r\n /**\r\n * If has round cap on two ends. If so, label should have an extra offset\r\n */\r\n isRoundCap?: boolean\r\n }\r\n): ElementCalculateTextPosition {\r\n\r\n opts = opts || {};\r\n const isRoundCap = opts.isRoundCap;\r\n\r\n return function (\r\n this: Sector,\r\n out: TextPositionCalculationResult,\r\n opts: {\r\n position?: SectorTextPosition\r\n distance?: number\r\n global?: boolean\r\n },\r\n boundingRect: RectLike\r\n ) {\r\n const textPosition = opts.position;\r\n\r\n if (!textPosition || textPosition instanceof Array) {\r\n return calculateTextPosition(\r\n out,\r\n opts as ElementTextConfig,\r\n boundingRect\r\n );\r\n }\r\n\r\n const mappedSectorPosition = positionMapping(textPosition as T);\r\n const distance = opts.distance != null ? opts.distance : 5;\r\n const sector = this.shape;\r\n const cx = sector.cx;\r\n const cy = sector.cy;\r\n const r = sector.r;\r\n const r0 = sector.r0;\r\n const middleR = (r + r0) / 2;\r\n const startAngle = sector.startAngle;\r\n const endAngle = sector.endAngle;\r\n const middleAngle = (startAngle + endAngle) / 2;\r\n const extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0;\r\n\r\n const mathCos = Math.cos;\r\n const mathSin = Math.sin;\r\n\r\n // base position: top-left\r\n let x = cx + r * mathCos(startAngle);\r\n let y = cy + r * mathSin(startAngle);\r\n\r\n let textAlign: TextAlign = 'left';\r\n let textVerticalAlign: TextVerticalAlign = 'top';\r\n\r\n switch (mappedSectorPosition) {\r\n case 'startArc':\r\n x = cx + (r0 - distance) * mathCos(middleAngle);\r\n y = cy + (r0 - distance) * mathSin(middleAngle);\r\n textAlign = 'center';\r\n textVerticalAlign = 'top';\r\n break;\r\n\r\n case 'insideStartArc':\r\n x = cx + (r0 + distance) * mathCos(middleAngle);\r\n y = cy + (r0 + distance) * mathSin(middleAngle);\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n\r\n case 'startAngle':\r\n x = cx + middleR * mathCos(startAngle)\r\n + adjustAngleDistanceX(startAngle, distance + extraDist, false);\r\n y = cy + middleR * mathSin(startAngle)\r\n + adjustAngleDistanceY(startAngle, distance + extraDist, false);\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n\r\n case 'insideStartAngle':\r\n x = cx + middleR * mathCos(startAngle)\r\n + adjustAngleDistanceX(startAngle, -distance + extraDist, false);\r\n y = cy + middleR * mathSin(startAngle)\r\n + adjustAngleDistanceY(startAngle, -distance + extraDist, false);\r\n textAlign = 'left';\r\n textVerticalAlign = 'middle';\r\n break;\r\n\r\n case 'middle':\r\n x = cx + middleR * mathCos(middleAngle);\r\n y = cy + middleR * mathSin(middleAngle);\r\n textAlign = 'center';\r\n textVerticalAlign = 'middle';\r\n break;\r\n\r\n case 'endArc':\r\n x = cx + (r + distance) * mathCos(middleAngle);\r\n y = cy + (r + distance) * mathSin(middleAngle);\r\n textAlign = 'center';\r\n textVerticalAlign = 'bottom';\r\n break;\r\n\r\n case 'insideEndArc':\r\n x = cx + (r - distance) * mathCos(middleAngle);\r\n y = cy + (r - distance) * mathSin(middleAngle);\r\n textAlign = 'center';\r\n textVerticalAlign = 'top';\r\n break;\r\n\r\n case 'endAngle':\r\n x = cx + middleR * mathCos(endAngle)\r\n + adjustAngleDistanceX(endAngle, distance + extraDist, true);\r\n y = cy + middleR * mathSin(endAngle)\r\n + adjustAngleDistanceY(endAngle, distance + extraDist, true);\r\n textAlign = 'left';\r\n textVerticalAlign = 'middle';\r\n break;\r\n\r\n case 'insideEndAngle':\r\n x = cx + middleR * mathCos(endAngle)\r\n + adjustAngleDistanceX(endAngle, -distance + extraDist, true);\r\n y = cy + middleR * mathSin(endAngle)\r\n + adjustAngleDistanceY(endAngle, -distance + extraDist, true);\r\n textAlign = 'right';\r\n textVerticalAlign = 'middle';\r\n break;\r\n\r\n default:\r\n return calculateTextPosition(\r\n out,\r\n opts as ElementTextConfig,\r\n boundingRect\r\n );\r\n }\r\n\r\n out = out || {} as TextPositionCalculationResult;\r\n out.x = x;\r\n out.y = y;\r\n out.align = textAlign;\r\n out.verticalAlign = textVerticalAlign;\r\n\r\n return out;\r\n };\r\n}\r\n\r\nexport function setSectorTextRotation(\r\n sector: Sector,\r\n textPosition: T,\r\n positionMapping: (seriesLabelPosition: T) => SectorTextPosition,\r\n rotateType: number | 'auto'\r\n) {\r\n if (isNumber(rotateType)) {\r\n // user-set rotation\r\n sector.setTextConfig({\r\n rotation: rotateType\r\n });\r\n return;\r\n }\r\n else if (isArray(textPosition)) {\r\n // user-set position, use 0 as auto rotation\r\n sector.setTextConfig({\r\n rotation: 0\r\n });\r\n return;\r\n }\r\n\r\n const shape = sector.shape;\r\n const startAngle = shape.clockwise ? shape.startAngle : shape.endAngle;\r\n const endAngle = shape.clockwise ? shape.endAngle : shape.startAngle;\r\n const middleAngle = (startAngle + endAngle) / 2;\r\n\r\n let anchorAngle;\r\n const mappedSectorPosition = positionMapping(textPosition);\r\n switch (mappedSectorPosition) {\r\n case 'startArc':\r\n case 'insideStartArc':\r\n case 'middle':\r\n case 'insideEndArc':\r\n case 'endArc':\r\n anchorAngle = middleAngle;\r\n break;\r\n\r\n case 'startAngle':\r\n case 'insideStartAngle':\r\n anchorAngle = startAngle;\r\n break;\r\n\r\n case 'endAngle':\r\n case 'insideEndAngle':\r\n anchorAngle = endAngle;\r\n break;\r\n\r\n default:\r\n sector.setTextConfig({\r\n rotation: 0\r\n });\r\n return;\r\n }\r\n\r\n let rotate = Math.PI * 1.5 - anchorAngle;\r\n /**\r\n * TODO: labels with rotate > Math.PI / 2 should be rotate another\r\n * half round flipped to increase readability. However, only middle\r\n * position supports this for now, because in other positions, the\r\n * anchor point is not at the center of the text, so the positions\r\n * after rotating is not as expected.\r\n */\r\n if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) {\r\n rotate -= Math.PI;\r\n }\r\n\r\n sector.setTextConfig({\r\n rotation: rotate\r\n });\r\n}\r\n\r\nfunction adjustAngleDistanceX(angle: number, distance: number, isEnd: boolean) {\r\n return distance * Math.sin(angle) * (isEnd ? -1 : 1);\r\n}\r\n\r\nfunction adjustAngleDistanceY(angle: number, distance: number, isEnd: boolean) {\r\n return distance * Math.cos(angle) * (isEnd ? 1 : -1);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport type Model from '../../model/Model';\r\nimport type Sector from 'zrender/src/graphic/shape/Sector';\r\nimport { isArray, map } from 'zrender/src/core/util';\r\nimport { parsePercent } from 'zrender/src/contain/text';\r\n\r\nexport function getSectorCornerRadius(\r\n model: Model<{ borderRadius?: string | number | (string | number)[] }>,\r\n shape: Pick,\r\n zeroIfNull?: boolean\r\n) {\r\n let cornerRadius = model.get('borderRadius');\r\n if (cornerRadius == null) {\r\n return zeroIfNull ? { cornerRadius: 0 } : null;\r\n }\r\n if (!isArray(cornerRadius)) {\r\n cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius];\r\n }\r\n const dr = Math.abs(shape.r || 0 - shape.r0 || 0);\r\n return {\r\n cornerRadius: map(cornerRadius, cr => parsePercent(cr, dr))\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Path, {PathProps} from 'zrender/src/graphic/Path';\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport {extend, each, map} from 'zrender/src/core/util';\r\nimport {BuiltinTextPosition} from 'zrender/src/core/types';\r\nimport {SectorProps} from 'zrender/src/graphic/shape/Sector';\r\nimport {RectProps} from 'zrender/src/graphic/shape/Rect';\r\nimport {\r\n Rect,\r\n Sector,\r\n updateProps,\r\n initProps,\r\n removeElementWithFadeOut,\r\n traverseElements\r\n} from '../../util/graphic';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport { setLabelStyle, getLabelStatesModels, setLabelValueAnimation, labelInner } from '../../label/labelStyle';\r\nimport {throttle} from '../../util/throttle';\r\nimport {createClipPath} from '../helper/createClipPathFromCoordSys';\r\nimport Sausage from '../../util/shape/sausage';\r\nimport ChartView from '../../view/Chart';\r\nimport SeriesData, {DefaultDataVisual} from '../../data/SeriesData';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport {\r\n StageHandlerProgressParams,\r\n ZRElementEvent,\r\n ColorString,\r\n OrdinalSortInfo,\r\n Payload,\r\n OrdinalNumber,\r\n ParsedValue,\r\n ECElement\r\n} from '../../util/types';\r\nimport BarSeriesModel, {BarDataItemOption, PolarBarLabelPosition} from './BarSeries';\r\nimport type Axis2D from '../../coord/cartesian/Axis2D';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport type Polar from '../../coord/polar/Polar';\r\nimport type Model from '../../model/Model';\r\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem';\r\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\nimport SeriesModel from '../../model/Series';\r\nimport {AngleAxisModel, RadiusAxisModel} from '../../coord/polar/AxisModel';\r\nimport CartesianAxisModel from '../../coord/cartesian/AxisModel';\r\nimport {LayoutRect} from '../../util/layout';\r\nimport {EventCallback} from 'zrender/src/core/Eventful';\r\nimport { warn } from '../../util/log';\r\nimport {createSectorCalculateTextPosition, SectorTextPosition, setSectorTextRotation} from '../../label/sectorLabel';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\nimport Element from 'zrender/src/Element';\r\nimport { getSectorCornerRadius } from '../helper/sectorHelper';\r\n\r\nconst mathMax = Math.max;\r\nconst mathMin = Math.min;\r\n\r\ntype CoordSysOfBar = BarSeriesModel['coordinateSystem'];\r\ntype RectShape = Rect['shape'];\r\ntype SectorShape = Sector['shape'];\r\n\r\ntype SectorLayout = SectorShape;\r\ntype RectLayout = RectShape;\r\n\r\ntype BarPossiblePath = Sector | Rect | Sausage;\r\n\r\ntype CartesianCoordArea = ReturnType;\r\ntype PolarCoordArea = ReturnType;\r\n\r\ntype RealtimeSortConfig = {\r\n baseAxis: Axis2D;\r\n otherAxis: Axis2D;\r\n};\r\n// Return a number, based on which the ordinal sorted.\r\ntype OrderMapping = (dataIndex: number) => number;\r\n\r\nfunction getClipArea(coord: CoordSysOfBar, data: SeriesData) {\r\n const coordSysClipArea = coord.getArea && coord.getArea();\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n const baseAxis = coord.getBaseAxis();\r\n // When boundaryGap is false or using time axis. bar may exceed the grid.\r\n // We should not clip this part.\r\n // See test/bar2.html\r\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\r\n const expandWidth = data.getLayout('bandWidth');\r\n if (baseAxis.isHorizontal()) {\r\n (coordSysClipArea as CartesianCoordArea).x -= expandWidth;\r\n (coordSysClipArea as CartesianCoordArea).width += expandWidth * 2;\r\n }\r\n else {\r\n (coordSysClipArea as CartesianCoordArea).y -= expandWidth;\r\n (coordSysClipArea as CartesianCoordArea).height += expandWidth * 2;\r\n }\r\n }\r\n }\r\n\r\n return coordSysClipArea as PolarCoordArea | CartesianCoordArea;\r\n}\r\n\r\nclass BarView extends ChartView {\r\n static type = 'bar' as const;\r\n type = BarView.type;\r\n\r\n private _data: SeriesData;\r\n\r\n private _isLargeDraw: boolean;\r\n\r\n private _isFirstFrame: boolean; // First frame after series added\r\n private _onRendered: EventCallback;\r\n\r\n private _backgroundGroup: Group;\r\n\r\n private _backgroundEls: (Rect | Sector)[];\r\n\r\n private _model: BarSeriesModel;\r\n\r\n private _progressiveEls: Element[];\r\n\r\n constructor() {\r\n super();\r\n this._isFirstFrame = true;\r\n }\r\n\r\n render(seriesModel: BarSeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n this._model = seriesModel;\r\n\r\n this._removeOnRenderedListener(api);\r\n\r\n this._updateDrawMode(seriesModel);\r\n\r\n const coordinateSystemType = seriesModel.get('coordinateSystem');\r\n\r\n if (coordinateSystemType === 'cartesian2d'\r\n || coordinateSystemType === 'polar'\r\n ) {\r\n // Clear previously rendered progressive elements.\r\n this._progressiveEls = null;\r\n\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel, ecModel, api)\r\n : this._renderNormal(seriesModel, ecModel, api, payload);\r\n }\r\n else if (__DEV__) {\r\n warn('Only cartesian2d and polar supported for bar.');\r\n }\r\n }\r\n\r\n incrementalPrepareRender(seriesModel: BarSeriesModel): void {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n // incremental also need to clip, otherwise might be overlow.\r\n // But must not set clip in each frame, otherwise all of the children will be marked redraw.\r\n this._updateLargeClip(seriesModel);\r\n }\r\n\r\n incrementalRender(params: StageHandlerProgressParams, seriesModel: BarSeriesModel): void {\r\n // Reset\r\n this._progressiveEls = [];\r\n // Do not support progressive in normal mode.\r\n this._incrementalRenderLarge(params, seriesModel);\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n traverseElements(this._progressiveEls || this.group, cb);\r\n }\r\n\r\n private _updateDrawMode(seriesModel: BarSeriesModel): void {\r\n const isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n }\r\n\r\n private _renderNormal(\r\n seriesModel: BarSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void {\r\n const group = this.group;\r\n const data = seriesModel.getData();\r\n const oldData = this._data;\r\n\r\n const coord = seriesModel.coordinateSystem;\r\n const baseAxis = coord.getBaseAxis();\r\n let isHorizontalOrRadial: boolean;\r\n\r\n if (coord.type === 'cartesian2d') {\r\n isHorizontalOrRadial = (baseAxis as Axis2D).isHorizontal();\r\n }\r\n else if (coord.type === 'polar') {\r\n isHorizontalOrRadial = baseAxis.dim === 'angle';\r\n }\r\n\r\n const animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\r\n\r\n const realtimeSortCfg = shouldRealtimeSort(seriesModel, coord);\r\n\r\n if (realtimeSortCfg) {\r\n this._enableRealtimeSort(realtimeSortCfg, data, api);\r\n }\r\n\r\n const needsClip = seriesModel.get('clip', true) || realtimeSortCfg;\r\n const coordSysClipArea = getClipArea(coord, data);\r\n // If there is clipPath created in large mode. Remove it.\r\n group.removeClipPath();\r\n // We don't use clipPath in normal mode because we needs a perfect animation\r\n // And don't want the label are clipped.\r\n\r\n const roundCap = seriesModel.get('roundCap', true);\r\n\r\n const drawBackground = seriesModel.get('showBackground', true);\r\n const backgroundModel = seriesModel.getModel('backgroundStyle');\r\n const barBorderRadius = backgroundModel.get('borderRadius') || 0;\r\n\r\n const bgEls: BarView['_backgroundEls'] = [];\r\n const oldBgEls = this._backgroundEls;\r\n\r\n const isInitSort = payload && payload.isInitSort;\r\n const isChangeOrder = payload && payload.type === 'changeAxisOrder';\r\n\r\n function createBackground(dataIndex: number) {\r\n const bgLayout = getLayout[coord.type](data, dataIndex);\r\n const bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n // Only cartesian2d support borderRadius.\r\n if (coord.type === 'cartesian2d') {\r\n (bgEl as Rect).setShape('r', barBorderRadius);\r\n }\r\n else {\r\n (bgEl as Sector).setShape('cornerRadius', barBorderRadius);\r\n }\r\n bgEls[dataIndex] = bgEl;\r\n return bgEl;\r\n };\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n const itemModel = data.getItemModel(dataIndex);\r\n const layout = getLayout[coord.type](data, dataIndex, itemModel);\r\n\r\n if (drawBackground) {\r\n createBackground(dataIndex);\r\n }\r\n\r\n // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in \"axisProxy\".\r\n if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) {\r\n return;\r\n }\r\n\r\n let isClipped = false;\r\n if (needsClip) {\r\n // Clip will modify the layout params.\r\n // And return a boolean to determine if the shape are fully clipped.\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n }\r\n\r\n const el = elementCreator[coord.type](\r\n seriesModel,\r\n data,\r\n dataIndex,\r\n layout,\r\n isHorizontalOrRadial,\r\n animationModel,\r\n baseAxis.model,\r\n false,\r\n roundCap\r\n );\r\n if (realtimeSortCfg) {\r\n /**\r\n * Force label animation because even if the element is\r\n * ignored because it's clipped, it may not be clipped after\r\n * changing order. Then, if not using forceLabelAnimation,\r\n * the label animation was never started, in which case,\r\n * the label will be the final value and doesn't have label\r\n * animation.\r\n */\r\n (el as ECElement).forceLabelAnimation = true;\r\n }\r\n\r\n updateStyle(\r\n el, data, dataIndex, itemModel, layout,\r\n seriesModel, isHorizontalOrRadial, coord.type === 'polar'\r\n );\r\n if (isInitSort) {\r\n (el as Rect).attr({ shape: layout });\r\n }\r\n else if (realtimeSortCfg) {\r\n updateRealtimeAnimation(\r\n realtimeSortCfg,\r\n animationModel,\r\n el as Rect,\r\n layout as LayoutRect,\r\n dataIndex,\r\n isHorizontalOrRadial,\r\n false,\r\n false\r\n );\r\n }\r\n else {\r\n initProps(el, {shape: layout} as any, seriesModel, dataIndex);\r\n }\r\n\r\n data.setItemGraphicEl(dataIndex, el);\r\n\r\n group.add(el);\r\n el.ignore = isClipped;\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n const itemModel = data.getItemModel(newIndex);\r\n const layout = getLayout[coord.type](data, newIndex, itemModel);\r\n\r\n if (drawBackground) {\r\n let bgEl: Rect | Sector;\r\n if (oldBgEls.length === 0) {\r\n bgEl = createBackground(oldIndex);\r\n }\r\n else {\r\n bgEl = oldBgEls[oldIndex];\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n // Only cartesian2d support borderRadius.\r\n if (coord.type === 'cartesian2d') {\r\n (bgEl as Rect).setShape('r', barBorderRadius);\r\n }\r\n else {\r\n (bgEl as Sector).setShape('cornerRadius', barBorderRadius);\r\n }\r\n bgEls[newIndex] = bgEl;\r\n }\r\n const bgLayout = getLayout[coord.type](data, newIndex);\r\n const shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\r\n updateProps(bgEl, { shape }, animationModel, newIndex);\r\n }\r\n\r\n let el = oldData.getItemGraphicEl(oldIndex) as BarPossiblePath;\r\n if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) {\r\n group.remove(el);\r\n return;\r\n }\r\n\r\n let isClipped = false;\r\n if (needsClip) {\r\n isClipped = clip[coord.type](coordSysClipArea, layout);\r\n if (isClipped) {\r\n group.remove(el);\r\n }\r\n }\r\n\r\n if (!el) {\r\n el = elementCreator[coord.type](\r\n seriesModel,\r\n data,\r\n newIndex,\r\n layout,\r\n isHorizontalOrRadial,\r\n animationModel,\r\n baseAxis.model,\r\n !!el,\r\n roundCap\r\n );\r\n }\r\n else {\r\n saveOldStyle(el);\r\n }\r\n\r\n if (realtimeSortCfg) {\r\n (el as ECElement).forceLabelAnimation = true;\r\n }\r\n\r\n if (isChangeOrder) {\r\n const textEl = el.getTextContent();\r\n if (textEl) {\r\n const labelInnerStore = labelInner(textEl);\r\n if (labelInnerStore.prevValue != null) {\r\n /**\r\n * Set preValue to be value so that no new label\r\n * should be started, otherwise, it will take a full\r\n * `animationDurationUpdate` time to finish the\r\n * animation, which is not expected.\r\n */\r\n labelInnerStore.prevValue = labelInnerStore.value;\r\n }\r\n }\r\n }\r\n // Not change anything if only order changed.\r\n // Especially not change label.\r\n else {\r\n updateStyle(\r\n el, data, newIndex, itemModel, layout,\r\n seriesModel, isHorizontalOrRadial, coord.type === 'polar'\r\n );\r\n }\r\n\r\n if (isInitSort) {\r\n (el as Rect).attr({ shape: layout });\r\n }\r\n else if (realtimeSortCfg) {\r\n updateRealtimeAnimation(\r\n realtimeSortCfg,\r\n animationModel,\r\n el as Rect,\r\n layout as LayoutRect,\r\n newIndex,\r\n isHorizontalOrRadial,\r\n true,\r\n isChangeOrder\r\n );\r\n }\r\n else {\r\n updateProps(el, {\r\n shape: layout\r\n } as any, seriesModel, newIndex, null);\r\n }\r\n\r\n data.setItemGraphicEl(newIndex, el);\r\n el.ignore = isClipped;\r\n group.add(el);\r\n })\r\n .remove(function (dataIndex) {\r\n const el = oldData.getItemGraphicEl(dataIndex) as Path;\r\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\r\n })\r\n .execute();\r\n\r\n const bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\r\n bgGroup.removeAll();\r\n\r\n for (let i = 0; i < bgEls.length; ++i) {\r\n bgGroup.add(bgEls[i]);\r\n }\r\n group.add(bgGroup);\r\n this._backgroundEls = bgEls;\r\n\r\n this._data = data;\r\n }\r\n\r\n private _renderLarge(seriesModel: BarSeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void {\r\n this._clear();\r\n createLarge(seriesModel, this.group);\r\n this._updateLargeClip(seriesModel);\r\n }\r\n\r\n private _incrementalRenderLarge(params: StageHandlerProgressParams, seriesModel: BarSeriesModel): void {\r\n this._removeBackground();\r\n createLarge(seriesModel, this.group, this._progressiveEls, true);\r\n }\r\n\r\n private _updateLargeClip(seriesModel: BarSeriesModel): void {\r\n // Use clipPath in large mode.\r\n const clipPath = seriesModel.get('clip', true)\r\n && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\r\n const group = this.group;\r\n if (clipPath) {\r\n group.setClipPath(clipPath);\r\n }\r\n else {\r\n group.removeClipPath();\r\n }\r\n }\r\n\r\n private _enableRealtimeSort(\r\n realtimeSortCfg: RealtimeSortConfig,\r\n data: ReturnType,\r\n api: ExtensionAPI\r\n ): void {\r\n // If no data in the first frame, wait for data to initSort\r\n if (!data.count()) {\r\n return;\r\n }\r\n\r\n const baseAxis = realtimeSortCfg.baseAxis;\r\n\r\n if (this._isFirstFrame) {\r\n this._dispatchInitSort(data, realtimeSortCfg, api);\r\n this._isFirstFrame = false;\r\n }\r\n else {\r\n const orderMapping = (idx: number) => {\r\n const el = (data.getItemGraphicEl(idx) as Rect);\r\n const shape = el && el.shape;\r\n return (shape && (\r\n // The result should be consistent with the initial sort by data value.\r\n // Do not support the case that both positive and negative exist.\r\n Math.abs(\r\n baseAxis.isHorizontal()\r\n ? shape.height\r\n : shape.width\r\n )\r\n // If data is NaN, shape.xxx may be NaN, so use || 0 here in case\r\n )) || 0;\r\n };\r\n this._onRendered = () => {\r\n this._updateSortWithinSameData(data, orderMapping, baseAxis, api);\r\n };\r\n api.getZr().on('rendered', this._onRendered);\r\n }\r\n }\r\n\r\n private _dataSort(\r\n data: SeriesData,\r\n baseAxis: Axis2D,\r\n orderMapping: OrderMapping\r\n ): OrdinalSortInfo {\r\n type SortValueInfo = {\r\n dataIndex: number,\r\n mappedValue: number,\r\n ordinalNumber: OrdinalNumber\r\n };\r\n const info: SortValueInfo[] = [];\r\n data.each(data.mapDimension(baseAxis.dim), (ordinalNumber: OrdinalNumber, dataIdx: number) => {\r\n let mappedValue = orderMapping(dataIdx);\r\n mappedValue = mappedValue == null ? NaN : mappedValue;\r\n info.push({\r\n dataIndex: dataIdx,\r\n mappedValue,\r\n ordinalNumber\r\n });\r\n });\r\n\r\n info.sort((a, b) => {\r\n // If NaN, it will be treated as min val.\r\n return b.mappedValue - a.mappedValue;\r\n });\r\n\r\n return {\r\n ordinalNumbers: map(info, item => item.ordinalNumber)\r\n };\r\n }\r\n\r\n private _isOrderChangedWithinSameData(\r\n data: SeriesData,\r\n orderMapping: OrderMapping,\r\n baseAxis: Axis2D\r\n ): boolean {\r\n const scale = baseAxis.scale as OrdinalScale;\r\n const ordinalDataDim = data.mapDimension(baseAxis.dim);\r\n\r\n let lastValue = Number.MAX_VALUE;\r\n for (let tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) {\r\n const rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum));\r\n const value = rawIdx < 0\r\n // If some tick have no bar, the tick will be treated as min.\r\n ? Number.MIN_VALUE\r\n // PENDING: if dataZoom on baseAxis exits, is it a performance issue?\r\n : orderMapping(data.indexOfRawIndex(rawIdx));\r\n if (value > lastValue) {\r\n return true;\r\n }\r\n lastValue = value;\r\n }\r\n return false;\r\n }\r\n\r\n /*\r\n * Consider the case when A and B changed order, whose representing\r\n * bars are both out of sight, we don't wish to trigger reorder action\r\n * as long as the order in the view doesn't change.\r\n */\r\n private _isOrderDifferentInView(\r\n orderInfo: OrdinalSortInfo,\r\n baseAxis: Axis2D\r\n ): boolean {\r\n const scale = baseAxis.scale as OrdinalScale;\r\n const extent = scale.getExtent();\r\n\r\n let tickNum = Math.max(0, extent[0]);\r\n const tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1);\r\n for (;tickNum <= tickMax; ++tickNum) {\r\n if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n private _updateSortWithinSameData(\r\n data: SeriesData,\r\n orderMapping: OrderMapping,\r\n baseAxis: Axis2D,\r\n api: ExtensionAPI\r\n ) {\r\n if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) {\r\n return;\r\n }\r\n\r\n const sortInfo = this._dataSort(data, baseAxis, orderMapping);\r\n\r\n if (this._isOrderDifferentInView(sortInfo, baseAxis)) {\r\n this._removeOnRenderedListener(api);\r\n api.dispatchAction({\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n axisId: baseAxis.index,\r\n sortInfo: sortInfo\r\n });\r\n }\r\n }\r\n\r\n private _dispatchInitSort(\r\n data: SeriesData,\r\n realtimeSortCfg: RealtimeSortConfig,\r\n api: ExtensionAPI\r\n ) {\r\n const baseAxis = realtimeSortCfg.baseAxis;\r\n const sortResult = this._dataSort(\r\n data,\r\n baseAxis,\r\n dataIdx => data.get(\r\n data.mapDimension(realtimeSortCfg.otherAxis.dim),\r\n dataIdx\r\n ) as number\r\n );\r\n api.dispatchAction({\r\n type: 'changeAxisOrder',\r\n componentType: baseAxis.dim + 'Axis',\r\n isInitSort: true,\r\n axisId: baseAxis.index,\r\n sortInfo: sortResult\r\n });\r\n }\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._clear(this._model);\r\n this._removeOnRenderedListener(api);\r\n }\r\n\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._removeOnRenderedListener(api);\r\n }\r\n\r\n private _removeOnRenderedListener(api: ExtensionAPI) {\r\n if (this._onRendered) {\r\n api.getZr().off('rendered', this._onRendered);\r\n this._onRendered = null;\r\n }\r\n }\r\n\r\n private _clear(model?: SeriesModel): void {\r\n const group = this.group;\r\n const data = this._data;\r\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\r\n this._removeBackground();\r\n this._backgroundEls = [];\r\n\r\n data.eachItemGraphicEl(function (el: Path) {\r\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\r\n });\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n this._data = null;\r\n this._isFirstFrame = true;\r\n }\r\n\r\n private _removeBackground(): void {\r\n this.group.remove(this._backgroundGroup);\r\n this._backgroundGroup = null;\r\n }\r\n}\r\n\r\ninterface Clipper {\r\n (coordSysBoundingRect: PolarCoordArea | CartesianCoordArea, layout: RectLayout | SectorLayout): boolean\r\n}\r\nconst clip: {\r\n [key in 'cartesian2d' | 'polar']: Clipper\r\n} = {\r\n cartesian2d(coordSysBoundingRect: CartesianCoordArea, layout: Rect['shape']) {\r\n const signWidth = layout.width < 0 ? -1 : 1;\r\n const signHeight = layout.height < 0 ? -1 : 1;\r\n // Needs positive width and height\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n\r\n const coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width;\r\n const coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height;\r\n const x = mathMax(layout.x, coordSysBoundingRect.x);\r\n const x2 = mathMin(layout.x + layout.width, coordSysX2);\r\n const y = mathMax(layout.y, coordSysBoundingRect.y);\r\n const y2 = mathMin(layout.y + layout.height, coordSysY2);\r\n\r\n const xClipped = x2 < x;\r\n const yClipped = y2 < y;\r\n\r\n // When xClipped or yClipped, the element will be marked as `ignore`.\r\n // But we should also place the element at the edge of the coord sys bounding rect.\r\n // Because if data changed and the bar shows again, its transition animation\r\n // will begin at this place.\r\n layout.x = (xClipped && x > coordSysX2) ? x2 : x;\r\n layout.y = (yClipped && y > coordSysY2) ? y2 : y;\r\n layout.width = xClipped ? 0 : x2 - x;\r\n layout.height = yClipped ? 0 : y2 - y;\r\n\r\n // Reverse back\r\n if (signWidth < 0) {\r\n layout.x += layout.width;\r\n layout.width = -layout.width;\r\n }\r\n if (signHeight < 0) {\r\n layout.y += layout.height;\r\n layout.height = -layout.height;\r\n }\r\n\r\n return xClipped || yClipped;\r\n },\r\n\r\n polar(coordSysClipArea: PolarCoordArea, layout: Sector['shape']) {\r\n const signR = layout.r0 <= layout.r ? 1 : -1;\r\n // Make sure r is larger than r0\r\n if (signR < 0) {\r\n const tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n\r\n const r = mathMin(layout.r, coordSysClipArea.r);\r\n const r0 = mathMax(layout.r0, coordSysClipArea.r0);\r\n\r\n layout.r = r;\r\n layout.r0 = r0;\r\n\r\n const clipped = r - r0 < 0;\r\n\r\n // Reverse back\r\n if (signR < 0) {\r\n const tmp = layout.r;\r\n layout.r = layout.r0;\r\n layout.r0 = tmp;\r\n }\r\n\r\n return clipped;\r\n }\r\n};\r\n\r\ninterface ElementCreator {\r\n (\r\n seriesModel: BarSeriesModel, data: SeriesData, newIndex: number,\r\n layout: RectLayout | SectorLayout, isHorizontalOrRadial: boolean,\r\n animationModel: BarSeriesModel,\r\n axisModel: CartesianAxisModel | AngleAxisModel | RadiusAxisModel,\r\n isUpdate: boolean,\r\n roundCap?: boolean\r\n ): BarPossiblePath\r\n}\r\n\r\nconst elementCreator: {\r\n [key in 'polar' | 'cartesian2d']: ElementCreator\r\n} = {\r\n\r\n cartesian2d(\r\n seriesModel, data, newIndex, layout: RectLayout, isHorizontal,\r\n animationModel, axisModel, isUpdate, roundCap\r\n ) {\r\n const rect = new Rect({\r\n shape: extend({}, layout),\r\n z2: 1\r\n });\r\n (rect as any).__dataIndex = newIndex;\r\n\r\n rect.name = 'item';\r\n\r\n if (animationModel) {\r\n const rectShape = rect.shape;\r\n const animateProperty = isHorizontal ? 'height' : 'width' as 'width' | 'height';\r\n rectShape[animateProperty] = 0;\r\n }\r\n return rect;\r\n },\r\n\r\n polar(\r\n seriesModel, data, newIndex, layout: SectorLayout, isRadial: boolean,\r\n animationModel, axisModel, isUpdate, roundCap\r\n ) {\r\n const ShapeClass = (!isRadial && roundCap) ? Sausage : Sector;\r\n const sector = new ShapeClass({\r\n shape: layout,\r\n z2: 1\r\n });\r\n\r\n sector.name = 'item';\r\n\r\n const positionMap = createPolarPositionMapping(isRadial);\r\n sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, {\r\n isRoundCap: ShapeClass === Sausage\r\n });\r\n\r\n // Animation\r\n if (animationModel) {\r\n const sectorShape = sector.shape;\r\n const animateProperty = isRadial ? 'r' : 'endAngle' as 'r' | 'endAngle';\r\n const animateTarget = {} as SectorShape;\r\n sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle;\r\n animateTarget[animateProperty] = layout[animateProperty];\r\n (isUpdate ? updateProps : initProps)(sector, {\r\n shape: animateTarget\r\n // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue\r\n }, animationModel);\r\n }\r\n\r\n return sector;\r\n }\r\n};\r\n\r\nfunction shouldRealtimeSort(\r\n seriesModel: BarSeriesModel,\r\n coordSys: Cartesian2D | Polar\r\n): RealtimeSortConfig {\r\n const realtimeSortOption = seriesModel.get('realtimeSort', true);\r\n const baseAxis = coordSys.getBaseAxis() as Axis2D;\r\n if (__DEV__) {\r\n if (realtimeSortOption) {\r\n if (baseAxis.type !== 'category') {\r\n warn('`realtimeSort` will not work because this bar series is not based on a category axis.');\r\n }\r\n if (coordSys.type !== 'cartesian2d') {\r\n warn('`realtimeSort` will not work because this bar series is not on cartesian2d.');\r\n }\r\n }\r\n }\r\n if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') {\r\n return {\r\n baseAxis: baseAxis as Axis2D,\r\n otherAxis: coordSys.getOtherAxis(baseAxis)\r\n };\r\n }\r\n}\r\n\r\nfunction updateRealtimeAnimation(\r\n realtimeSortCfg: RealtimeSortConfig,\r\n seriesAnimationModel: BarSeriesModel,\r\n el: Rect,\r\n layout: LayoutRect,\r\n newIndex: number,\r\n isHorizontal: boolean,\r\n isUpdate: boolean,\r\n isChangeOrder: boolean\r\n) {\r\n let seriesTarget;\r\n let axisTarget;\r\n if (isHorizontal) {\r\n axisTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n seriesTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n }\r\n else {\r\n axisTarget = {\r\n y: layout.y,\r\n height: layout.height\r\n };\r\n seriesTarget = {\r\n x: layout.x,\r\n width: layout.width\r\n };\r\n }\r\n\r\n if (!isChangeOrder) {\r\n // Keep the original growth animation if only axis order changed.\r\n // Not start a new animation.\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: seriesTarget\r\n }, seriesAnimationModel, newIndex, null);\r\n }\r\n\r\n const axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null;\r\n (isUpdate ? updateProps : initProps)(el, {\r\n shape: axisTarget\r\n }, axisAnimationModel, newIndex);\r\n}\r\n\r\nfunction checkPropertiesNotValid>(obj: T, props: readonly (keyof T)[]) {\r\n for (let i = 0; i < props.length; i++) {\r\n if (!isFinite(obj[props[i]])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n\r\nconst rectPropties = ['x', 'y', 'width', 'height'] as const;\r\nconst polarPropties = ['cx', 'cy', 'r', 'startAngle', 'endAngle'] as const;\r\nconst isValidLayout: Record<'cartesian2d' | 'polar', (layout: RectLayout | SectorLayout) => boolean> = {\r\n cartesian2d(layout: RectLayout) {\r\n return !checkPropertiesNotValid(layout, rectPropties);\r\n },\r\n\r\n polar(layout: SectorLayout) {\r\n return !checkPropertiesNotValid(layout, polarPropties);\r\n }\r\n} as const;\r\n\r\ninterface GetLayout {\r\n (data: SeriesData, dataIndex: number, itemModel?: Model): RectLayout | SectorLayout\r\n}\r\nconst getLayout: {\r\n [key in 'cartesian2d' | 'polar']: GetLayout\r\n} = {\r\n // itemModel is only used to get borderWidth, which is not needed\r\n // when calculating bar background layout.\r\n cartesian2d(data, dataIndex, itemModel?): RectLayout {\r\n const layout = data.getItemLayout(dataIndex) as RectLayout;\r\n const fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;\r\n\r\n // fix layout with lineWidth\r\n const signX = layout.width > 0 ? 1 : -1;\r\n const signY = layout.height > 0 ? 1 : -1;\r\n return {\r\n x: layout.x + signX * fixedLineWidth / 2,\r\n y: layout.y + signY * fixedLineWidth / 2,\r\n width: layout.width - signX * fixedLineWidth,\r\n height: layout.height - signY * fixedLineWidth\r\n };\r\n },\r\n\r\n polar(data, dataIndex, itemModel?): SectorLayout {\r\n const layout = data.getItemLayout(dataIndex);\r\n return {\r\n cx: layout.cx,\r\n cy: layout.cy,\r\n r0: layout.r0,\r\n r: layout.r,\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle,\r\n clockwise: layout.clockwise\r\n } as SectorLayout;\r\n }\r\n};\r\n\r\nfunction isZeroOnPolar(layout: SectorLayout) {\r\n return layout.startAngle != null\r\n && layout.endAngle != null\r\n && layout.startAngle === layout.endAngle;\r\n}\r\n\r\nfunction createPolarPositionMapping(isRadial: boolean)\r\n : (position: PolarBarLabelPosition) => SectorTextPosition {\r\n return ((isRadial: boolean) => {\r\n const arcOrAngle = isRadial ? 'Arc' : 'Angle';\r\n return (position: PolarBarLabelPosition) => {\r\n switch (position) {\r\n case 'start':\r\n case 'insideStart':\r\n case 'end':\r\n case 'insideEnd':\r\n return position + arcOrAngle as SectorTextPosition;\r\n default:\r\n return position;\r\n }\r\n };\r\n })(isRadial);\r\n}\r\n\r\nfunction updateStyle(\r\n el: BarPossiblePath,\r\n data: SeriesData,\r\n dataIndex: number,\r\n itemModel: Model,\r\n layout: RectLayout | SectorLayout,\r\n seriesModel: BarSeriesModel,\r\n isHorizontalOrRadial: boolean,\r\n isPolar: boolean\r\n) {\r\n const style = data.getItemVisual(dataIndex, 'style');\r\n\r\n if (!isPolar) {\r\n const borderRadius = itemModel\r\n .get(['itemStyle', 'borderRadius']) as number | number[] || 0;\r\n (el as Rect).setShape('r', borderRadius);\r\n }\r\n else if (!seriesModel.get('roundCap')) {\r\n const sectorShape = (el as Sector).shape;\r\n const cornerRadius = getSectorCornerRadius(\r\n itemModel.getModel('itemStyle'),\r\n sectorShape,\r\n true\r\n );\r\n extend(sectorShape, cornerRadius);\r\n (el as Sector).setShape(sectorShape);\r\n }\r\n\r\n el.useStyle(style);\r\n\r\n const cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && (el as Path).attr('cursor', cursorStyle);\r\n\r\n const labelPositionOutside = isPolar\r\n ? (isHorizontalOrRadial\r\n ? ((layout as SectorLayout).r >= (layout as SectorLayout).r0 ? 'endArc' : 'startArc')\r\n : ((layout as SectorLayout).endAngle >= (layout as SectorLayout).startAngle\r\n ? 'endAngle'\r\n : 'startAngle'\r\n )\r\n )\r\n : (isHorizontalOrRadial\r\n ? ((layout as RectLayout).height >= 0 ? 'bottom' : 'top')\r\n : ((layout as RectLayout).width >= 0 ? 'right' : 'left'));\r\n\r\n const labelStatesModels = getLabelStatesModels(itemModel);\r\n\r\n setLabelStyle(\r\n el, labelStatesModels,\r\n {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\r\n inheritColor: style.fill as ColorString,\r\n defaultOpacity: style.opacity,\r\n defaultOutsidePosition: labelPositionOutside as BuiltinTextPosition\r\n }\r\n );\r\n\r\n const label = el.getTextContent();\r\n if (isPolar && label) {\r\n const position = itemModel.get(['label', 'position']);\r\n el.textConfig.inside = position === 'middle' ? true : null;\r\n setSectorTextRotation(\r\n el as Sector,\r\n position === 'outside' ? labelPositionOutside : position,\r\n createPolarPositionMapping(isHorizontalOrRadial),\r\n itemModel.get(['label', 'rotate'])\r\n );\r\n }\r\n\r\n setLabelValueAnimation(\r\n label,\r\n labelStatesModels,\r\n seriesModel.getRawValue(dataIndex) as ParsedValue,\r\n (value: number) => getDefaultInterpolatedLabel(data, value)\r\n );\r\n\r\n const emphasisModel = itemModel.getModel(['emphasis']);\r\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\r\n setStatesStylesFromModel(el, itemModel);\r\n\r\n if (isZeroOnPolar(layout as SectorLayout)) {\r\n el.style.fill = 'none';\r\n el.style.stroke = 'none';\r\n each(el.states, (state) => {\r\n if (state.style) {\r\n state.style.fill = state.style.stroke = 'none';\r\n }\r\n });\r\n }\r\n}\r\n\r\n// In case width or height are too small.\r\nfunction getLineWidth(\r\n itemModel: Model,\r\n rawLayout: RectLayout\r\n) {\r\n // Has no border.\r\n const borderColor = itemModel.get(['itemStyle', 'borderColor']);\r\n if (!borderColor || borderColor === 'none') {\r\n return 0;\r\n }\r\n const lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0;\r\n // width or height may be NaN for empty data\r\n const width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\r\n const height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\r\n return Math.min(lineWidth, width, height);\r\n}\r\n\r\nclass LagePathShape {\r\n points: ArrayLike;\r\n}\r\ninterface LargePathProps extends PathProps {\r\n shape?: LagePathShape\r\n}\r\nclass LargePath extends Path {\r\n type = 'largeBar';\r\n\r\n shape: LagePathShape;\r\n\r\n baseDimIdx: number;\r\n largeDataIndices: ArrayLike;\r\n barWidth: number;\r\n\r\n constructor(opts?: LargePathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new LagePathShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: LagePathShape) {\r\n // Drawing lines is more efficient than drawing\r\n // a whole line or drawing rects.\r\n const points = shape.points;\r\n const baseDimIdx = this.baseDimIdx;\r\n const valueDimIdx = 1 - this.baseDimIdx;\r\n const startPoint = [];\r\n const size = [];\r\n const barWidth = this.barWidth;\r\n\r\n for (let i = 0; i < points.length; i += 3) {\r\n size[baseDimIdx] = barWidth;\r\n size[valueDimIdx] = points[i + 2];\r\n startPoint[baseDimIdx] = points[i + baseDimIdx];\r\n startPoint[valueDimIdx] = points[i + valueDimIdx];\r\n ctx.rect(startPoint[0], startPoint[1], size[0], size[1]);\r\n }\r\n }\r\n}\r\n\r\nfunction createLarge(\r\n seriesModel: BarSeriesModel,\r\n group: Group,\r\n progressiveEls?: Element[],\r\n incremental?: boolean\r\n) {\r\n // TODO support polar\r\n const data = seriesModel.getData();\r\n const baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\r\n\r\n const largeDataIndices = data.getLayout('largeDataIndices');\r\n const barWidth = data.getLayout('size');\r\n\r\n const backgroundModel = seriesModel.getModel('backgroundStyle');\r\n const bgPoints = data.getLayout('largeBackgroundPoints');\r\n\r\n if (bgPoints) {\r\n const bgEl = new LargePath({\r\n shape: {\r\n points: bgPoints\r\n },\r\n incremental: !!incremental,\r\n silent: true,\r\n z2: 0\r\n });\r\n bgEl.baseDimIdx = baseDimIdx;\r\n bgEl.largeDataIndices = largeDataIndices;\r\n bgEl.barWidth = barWidth;\r\n bgEl.useStyle(backgroundModel.getItemStyle());\r\n group.add(bgEl);\r\n\r\n progressiveEls && progressiveEls.push(bgEl);\r\n }\r\n\r\n const el = new LargePath({\r\n shape: {points: data.getLayout('largePoints')},\r\n incremental: !!incremental,\r\n ignoreCoarsePointer: true,\r\n z2: 1\r\n });\r\n el.baseDimIdx = baseDimIdx;\r\n el.largeDataIndices = largeDataIndices;\r\n el.barWidth = barWidth;\r\n group.add(el);\r\n el.useStyle(data.getVisual('style'));\r\n\r\n // Enable tooltip and user mouse/touch event handlers.\r\n getECData(el).seriesIndex = seriesModel.seriesIndex;\r\n\r\n if (!seriesModel.get('silent')) {\r\n el.on('mousedown', largePathUpdateDataIndex);\r\n el.on('mousemove', largePathUpdateDataIndex);\r\n }\r\n progressiveEls && progressiveEls.push(el);\r\n}\r\n\r\n// Use throttle to avoid frequently traverse to find dataIndex.\r\nconst largePathUpdateDataIndex = throttle(function (this: LargePath, event: ZRElementEvent) {\r\n const largePath = this;\r\n const dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\r\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\r\n}, 30, false);\r\n\r\nfunction largePathFindDataIndex(largePath: LargePath, x: number, y: number) {\r\n const baseDimIdx = largePath.baseDimIdx;\r\n const valueDimIdx = 1 - baseDimIdx;\r\n const points = largePath.shape.points;\r\n const largeDataIndices = largePath.largeDataIndices;\r\n const startPoint = [];\r\n const size = [];\r\n const barWidth = largePath.barWidth;\r\n\r\n for (let i = 0, len = points.length / 3; i < len; i++) {\r\n const ii = i * 3;\r\n size[baseDimIdx] = barWidth;\r\n size[valueDimIdx] = points[ii + 2];\r\n startPoint[baseDimIdx] = points[ii + baseDimIdx];\r\n startPoint[valueDimIdx] = points[ii + valueDimIdx];\r\n if (size[valueDimIdx] < 0) {\r\n startPoint[valueDimIdx] += size[valueDimIdx];\r\n size[valueDimIdx] = -size[valueDimIdx];\r\n }\r\n\r\n if (x >= startPoint[0] && x <= startPoint[0] + size[0]\r\n && y >= startPoint[1] && y <= startPoint[1] + size[1]\r\n ) {\r\n return largeDataIndices[i];\r\n }\r\n }\r\n\r\n return -1;\r\n}\r\n\r\nfunction createBackgroundShape(\r\n isHorizontalOrRadial: boolean,\r\n layout: SectorLayout | RectLayout,\r\n coord: CoordSysOfBar\r\n): SectorShape | RectShape {\r\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\r\n const rectShape = layout as RectShape;\r\n const coordLayout = coord.getArea();\r\n return {\r\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\r\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\r\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\r\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\r\n } as RectShape;\r\n }\r\n else {\r\n const coordLayout = coord.getArea();\r\n const sectorShape = layout as SectorShape;\r\n return {\r\n cx: coordLayout.cx,\r\n cy: coordLayout.cy,\r\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\r\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\r\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\r\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\r\n } as SectorShape;\r\n }\r\n}\r\n\r\nfunction createBackgroundEl(\r\n coord: CoordSysOfBar,\r\n isHorizontalOrRadial: boolean,\r\n layout: SectorLayout | RectLayout\r\n): Rect | Sector {\r\n const ElementClz = coord.type === 'polar' ? Sector : Rect;\r\n return new ElementClz({\r\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord) as any,\r\n silent: true,\r\n z2: 0\r\n });\r\n}\r\n\r\nexport default BarView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {layout, createProgressiveLayout} from '../../layout/barGrid';\r\nimport dataSample from '../../processor/dataSample';\r\n\r\nimport BarSeries from './BarSeries';\r\nimport BarView from './BarView';\r\nimport CartesianAxisModel from '../../coord/cartesian/AxisModel';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerChartView(BarView);\r\n registers.registerSeriesModel(BarSeries);\r\n\r\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar'));\r\n // Do layout after other overall layout, which can prepare some information.\r\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar'));\r\n\r\n // Down sample after filter\r\n registers.registerProcessor(\r\n registers.PRIORITY.PROCESSOR.STATISTIC,\r\n dataSample('bar')\r\n );\r\n\r\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\r\n registers.registerAction({\r\n type: 'changeAxisOrder',\r\n event: 'changeAxisOrder',\r\n update: 'update'\r\n }, function (payload, ecModel) {\r\n const componentType = payload.componentType || 'series';\r\n\r\n ecModel.eachComponent(\r\n { mainType: componentType, query: payload },\r\n function (componentModel) {\r\n if (payload.sortInfo) {\r\n (componentModel as CartesianAxisModel).axis.setCategorySortInfo(payload.sortInfo);\r\n }\r\n }\r\n );\r\n });\r\n\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { parsePercent, linearMap } from '../../util/number';\r\nimport * as layout from '../../util/layout';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport PieSeriesModel from './PieSeries';\r\nimport { SectorShape } from 'zrender/src/graphic/shape/Sector';\r\nimport { normalizeArcAngles } from 'zrender/src/core/PathProxy';\r\nimport { makeInner } from '../../util/model';\r\n\r\nconst PI2 = Math.PI * 2;\r\nconst RADIAN = Math.PI / 180;\r\n\r\nfunction getViewRect(seriesModel: PieSeriesModel, api: ExtensionAPI) {\r\n return layout.getLayoutRect(\r\n seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }\r\n );\r\n}\r\n\r\nexport function getBasicPieLayout(seriesModel: PieSeriesModel, api: ExtensionAPI):\r\n Pick {\r\n const viewRect = getViewRect(seriesModel, api);\r\n\r\n // center can be string or number when coordinateSystem is specified\r\n let center = seriesModel.get('center');\r\n let radius = seriesModel.get('radius');\r\n\r\n if (!zrUtil.isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n const width = parsePercent(viewRect.width, api.getWidth());\r\n const height = parsePercent(viewRect.height, api.getHeight());\r\n const size = Math.min(width, height);\r\n const r0 = parsePercent(radius[0], size / 2);\r\n const r = parsePercent(radius[1], size / 2);\r\n\r\n let cx: number;\r\n let cy: number;\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys) {\r\n // percentage is not allowed when coordinate system is specified\r\n const point = coordSys.dataToPoint(center);\r\n cx = point[0] || 0;\r\n cy = point[1] || 0;\r\n }\r\n else {\r\n if (!zrUtil.isArray(center)) {\r\n center = [center, center];\r\n }\r\n cx = parsePercent(center[0], width) + viewRect.x;\r\n cy = parsePercent(center[1], height) + viewRect.y;\r\n }\r\n\r\n return {\r\n cx,\r\n cy,\r\n r0,\r\n r\r\n };\r\n}\r\n\r\nexport default function pieLayout(\r\n seriesType: 'pie',\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel: PieSeriesModel) {\r\n const data = seriesModel.getData();\r\n const valueDim = data.mapDimension('value');\r\n const viewRect = getViewRect(seriesModel, api);\r\n\r\n const { cx, cy, r, r0 } = getBasicPieLayout(seriesModel, api);\r\n\r\n let startAngle = -seriesModel.get('startAngle') * RADIAN;\r\n let endAngle = seriesModel.get('endAngle');\r\n const padAngle = seriesModel.get('padAngle') * RADIAN;\r\n\r\n endAngle = endAngle === 'auto' ? startAngle - PI2 : -endAngle * RADIAN;\r\n\r\n const minAngle = seriesModel.get('minAngle') * RADIAN;\r\n\r\n const minAndPadAngle = minAngle + padAngle;\r\n\r\n let validDataCount = 0;\r\n data.each(valueDim, function (value: number) {\r\n !isNaN(value) && validDataCount++;\r\n });\r\n\r\n const sum = data.getSum(valueDim);\r\n // Sum may be 0\r\n let unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n\r\n const clockwise = seriesModel.get('clockwise');\r\n\r\n const roseType = seriesModel.get('roseType');\r\n const stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n\r\n // [0...max]\r\n const extent = data.getDataExtent(valueDim);\r\n extent[0] = 0;\r\n\r\n const dir = clockwise ? 1 : -1;\r\n const angles = [startAngle, endAngle];\r\n const halfPadAngle = dir * padAngle / 2;\r\n normalizeArcAngles(angles, !clockwise);\r\n\r\n [startAngle, endAngle] = angles;\r\n\r\n const layoutData = getSeriesLayoutData(seriesModel);\r\n layoutData.startAngle = startAngle;\r\n layoutData.endAngle = endAngle;\r\n layoutData.clockwise = clockwise;\r\n\r\n const angleRange = Math.abs(endAngle - startAngle);\r\n\r\n // In the case some sector angle is smaller than minAngle\r\n let restAngle = angleRange;\r\n let valueSumLargerThanMinAngle = 0;\r\n\r\n let currentAngle = startAngle;\r\n\r\n data.setLayout({ viewRect, r });\r\n\r\n data.each(valueDim, function (value: number, idx: number) {\r\n let angle;\r\n if (isNaN(value)) {\r\n data.setItemLayout(idx, {\r\n angle: NaN,\r\n startAngle: NaN,\r\n endAngle: NaN,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? NaN\r\n : r\r\n });\r\n return;\r\n }\r\n\r\n // FIXME \u517C\u5BB9 2.0 \u4F46\u662F roseType \u662F area \u7684\u65F6\u5019\u624D\u662F\u8FD9\u6837\uFF1F\r\n if (roseType !== 'area') {\r\n angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n }\r\n else {\r\n angle = angleRange / validDataCount;\r\n }\r\n\r\n\r\n if (angle < minAndPadAngle) {\r\n angle = minAndPadAngle;\r\n restAngle -= minAndPadAngle;\r\n }\r\n else {\r\n valueSumLargerThanMinAngle += value;\r\n }\r\n\r\n const endAngle = currentAngle + dir * angle;\r\n\r\n // calculate display angle\r\n let actualStartAngle = 0;\r\n let actualEndAngle = 0;\r\n\r\n if (padAngle > angle) {\r\n actualStartAngle = currentAngle + dir * angle / 2;\r\n actualEndAngle = actualStartAngle;\r\n }\r\n else {\r\n actualStartAngle = currentAngle + halfPadAngle;\r\n actualEndAngle = endAngle - halfPadAngle;\r\n }\r\n\r\n data.setItemLayout(idx, {\r\n angle: angle,\r\n startAngle: actualStartAngle,\r\n endAngle: actualEndAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: roseType\r\n ? linearMap(value, extent, [r0, r])\r\n : r\r\n });\r\n\r\n currentAngle = endAngle;\r\n });\r\n\r\n // Some sector is constrained by minAngle and padAngle\r\n // Rest sectors needs recalculate angle\r\n if (restAngle < PI2 && validDataCount) {\r\n // Average the angle if rest angle is not enough after all angles is\r\n // Constrained by minAngle and padAngle\r\n if (restAngle <= 1e-3) {\r\n const angle = angleRange / validDataCount;\r\n data.each(valueDim, function (value: number, idx: number) {\r\n if (!isNaN(value)) {\r\n const layout = data.getItemLayout(idx);\r\n layout.angle = angle;\r\n\r\n let actualStartAngle = 0;\r\n let actualEndAngle = 0;\r\n\r\n if (angle < padAngle) {\r\n actualStartAngle = startAngle + dir * (idx + 1 / 2) * angle;\r\n actualEndAngle = actualStartAngle;\r\n }\r\n else {\r\n actualStartAngle = startAngle + dir * idx * angle + halfPadAngle;\r\n actualEndAngle = startAngle + dir * (idx + 1) * angle - halfPadAngle;\r\n }\r\n\r\n layout.startAngle = actualStartAngle;\r\n layout.endAngle = actualEndAngle;\r\n }\r\n });\r\n }\r\n else {\r\n unitRadian = restAngle / valueSumLargerThanMinAngle;\r\n currentAngle = startAngle;\r\n data.each(valueDim, function (value: number, idx: number) {\r\n if (!isNaN(value)) {\r\n const layout = data.getItemLayout(idx);\r\n const angle = layout.angle === minAndPadAngle\r\n ? minAndPadAngle : value * unitRadian;\r\n\r\n let actualStartAngle = 0;\r\n let actualEndAngle = 0;\r\n\r\n if (angle < padAngle) {\r\n actualStartAngle = currentAngle + dir * angle / 2;\r\n actualEndAngle = actualStartAngle;\r\n }\r\n else {\r\n actualStartAngle = currentAngle + halfPadAngle;\r\n actualEndAngle = currentAngle + dir * angle - halfPadAngle;\r\n }\r\n\r\n layout.startAngle = actualStartAngle;\r\n layout.endAngle = actualEndAngle;\r\n currentAngle += dir * angle;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n}\r\n\r\nexport const getSeriesLayoutData = makeInner<{\r\n startAngle: number\r\n endAngle: number\r\n clockwise: boolean\r\n}, PieSeriesModel>();\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { StageHandler } from '../util/types';\r\n\r\nexport default function dataFilter(seriesType: string): StageHandler {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n const legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n });\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n const data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n const name = data.getName(idx);\r\n // If in any legend component the status is not selected.\r\n for (let i = 0; i < legendModels.length; i++) {\r\n // @ts-ignore FIXME: LegendModel\r\n if (!legendModels[i].isSelected(name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// FIXME emphasis label position is not same with normal label position\r\nimport {parsePercent} from '../../util/number';\r\nimport PieSeriesModel, { PieSeriesOption, PieDataItemOption } from './PieSeries';\r\nimport { VectorArray } from 'zrender/src/core/vector';\r\nimport { HorizontalAlign, ZRTextAlign } from '../../util/types';\r\nimport { Sector, Polyline, Point } from '../../util/graphic';\r\nimport ZRText from 'zrender/src/graphic/Text';\r\nimport BoundingRect, {RectLike} from 'zrender/src/core/BoundingRect';\r\nimport { each, isNumber } from 'zrender/src/core/util';\r\nimport { limitTurnAngle, limitSurfaceAngle } from '../../label/labelGuideHelper';\r\nimport { shiftLayoutOnY } from '../../label/labelLayoutHelper';\r\n\r\nconst RADIAN = Math.PI / 180;\r\n\r\ninterface LabelLayout {\r\n label: ZRText\r\n labelLine: Polyline\r\n position: PieSeriesOption['label']['position']\r\n len: number\r\n len2: number\r\n minTurnAngle: number\r\n maxSurfaceAngle: number\r\n surfaceNormal: Point\r\n linePoints: VectorArray[]\r\n textAlign: HorizontalAlign\r\n labelDistance: number\r\n labelAlignTo: PieSeriesOption['label']['alignTo']\r\n edgeDistance: number\r\n bleedMargin: PieSeriesOption['label']['bleedMargin']\r\n rect: BoundingRect\r\n /**\r\n * user-set style.width.\r\n * This is useful because label.style.width might be changed\r\n * by constrainTextWidth.\r\n */\r\n labelStyleWidth: number\r\n unconstrainedWidth: number\r\n targetTextWidth?: number\r\n}\r\n\r\nfunction adjustSingleSide(\r\n list: LabelLayout[],\r\n cx: number,\r\n cy: number,\r\n r: number,\r\n dir: -1 | 1,\r\n viewWidth: number,\r\n viewHeight: number,\r\n viewLeft: number,\r\n viewTop: number,\r\n farthestX: number\r\n) {\r\n if (list.length < 2) {\r\n return;\r\n }\r\n\r\n interface SemiInfo {\r\n list: LabelLayout[]\r\n rB: number\r\n maxY: number\r\n };\r\n\r\n function recalculateXOnSemiToAlignOnEllipseCurve(semi: SemiInfo) {\r\n const rB = semi.rB;\r\n const rB2 = rB * rB;\r\n for (let i = 0; i < semi.list.length; i++) {\r\n const item = semi.list[i];\r\n const dy = Math.abs(item.label.y - cy);\r\n // horizontal r is always same with original r because x is not changed.\r\n const rA = r + item.len;\r\n const rA2 = rA * rA;\r\n // Use ellipse implicit function to calculate x\r\n const dx = Math.sqrt(Math.abs((1 - dy * dy / rB2) * rA2));\r\n const newX = cx + (dx + item.len2) * dir;\r\n const deltaX = newX - item.label.x;\r\n const newTargetWidth = item.targetTextWidth - deltaX * dir;\r\n // text x is changed, so need to recalculate width.\r\n constrainTextWidth(item, newTargetWidth, true);\r\n item.label.x = newX;\r\n }\r\n }\r\n\r\n // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.\r\n function recalculateX(items: LabelLayout[]) {\r\n // Extremes of\r\n const topSemi = { list: [], maxY: 0} as SemiInfo;\r\n const bottomSemi = { list: [], maxY: 0 } as SemiInfo;\r\n\r\n for (let i = 0; i < items.length; i++) {\r\n if (items[i].labelAlignTo !== 'none') {\r\n continue;\r\n }\r\n const item = items[i];\r\n const semi = item.label.y > cy ? bottomSemi : topSemi;\r\n const dy = Math.abs(item.label.y - cy);\r\n if (dy >= semi.maxY) {\r\n const dx = item.label.x - cx - item.len2 * dir;\r\n // horizontal r is always same with original r because x is not changed.\r\n const rA = r + item.len;\r\n // Canculate rB based on the topest / bottemest label.\r\n const rB = Math.abs(dx) < rA\r\n ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))\r\n : rA;\r\n semi.rB = rB;\r\n semi.maxY = dy;\r\n }\r\n semi.list.push(item);\r\n }\r\n\r\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\r\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\r\n }\r\n\r\n const len = list.length;\r\n for (let i = 0; i < len; i++) {\r\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\r\n const dx = list[i].label.x - farthestX;\r\n list[i].linePoints[1][0] += dx;\r\n list[i].label.x = farthestX;\r\n }\r\n }\r\n\r\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\r\n recalculateX(list);\r\n }\r\n}\r\n\r\nfunction avoidOverlap(\r\n labelLayoutList: LabelLayout[],\r\n cx: number,\r\n cy: number,\r\n r: number,\r\n viewWidth: number,\r\n viewHeight: number,\r\n viewLeft: number,\r\n viewTop: number\r\n) {\r\n const leftList = [];\r\n const rightList = [];\r\n let leftmostX = Number.MAX_VALUE;\r\n let rightmostX = -Number.MAX_VALUE;\r\n for (let i = 0; i < labelLayoutList.length; i++) {\r\n const label = labelLayoutList[i].label;\r\n if (isPositionCenter(labelLayoutList[i])) {\r\n continue;\r\n }\r\n if (label.x < cx) {\r\n leftmostX = Math.min(leftmostX, label.x);\r\n leftList.push(labelLayoutList[i]);\r\n }\r\n else {\r\n rightmostX = Math.max(rightmostX, label.x);\r\n rightList.push(labelLayoutList[i]);\r\n }\r\n }\r\n\r\n for (let i = 0; i < labelLayoutList.length; i++) {\r\n const layout = labelLayoutList[i];\r\n if (!isPositionCenter(layout) && layout.linePoints) {\r\n if (layout.labelStyleWidth != null) {\r\n continue;\r\n }\r\n\r\n const label = layout.label;\r\n const linePoints = layout.linePoints;\r\n\r\n let targetTextWidth;\r\n if (layout.labelAlignTo === 'edge') {\r\n if (label.x < cx) {\r\n targetTextWidth = linePoints[2][0] - layout.labelDistance\r\n - viewLeft - layout.edgeDistance;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance\r\n - linePoints[2][0] - layout.labelDistance;\r\n }\r\n }\r\n else if (layout.labelAlignTo === 'labelLine') {\r\n if (label.x < cx) {\r\n targetTextWidth = leftmostX - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\r\n }\r\n else {\r\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\r\n }\r\n }\r\n layout.targetTextWidth = targetTextWidth;\r\n\r\n constrainTextWidth(layout, targetTextWidth);\r\n }\r\n }\r\n\r\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\r\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\r\n\r\n for (let i = 0; i < labelLayoutList.length; i++) {\r\n const layout = labelLayoutList[i];\r\n if (!isPositionCenter(layout) && layout.linePoints) {\r\n const label = layout.label;\r\n const linePoints = layout.linePoints;\r\n const isAlignToEdge = layout.labelAlignTo === 'edge';\r\n const padding = label.style.padding as number[];\r\n const paddingH = padding ? padding[1] + padding[3] : 0;\r\n // textRect.width already contains paddingH if bgColor is set\r\n const extraPaddingH = label.style.backgroundColor ? 0 : paddingH;\r\n const realTextWidth = layout.rect.width + extraPaddingH;\r\n const dist = linePoints[1][0] - linePoints[2][0];\r\n if (isAlignToEdge) {\r\n if (label.x < cx) {\r\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance\r\n - realTextWidth - layout.labelDistance;\r\n }\r\n }\r\n else {\r\n if (label.x < cx) {\r\n linePoints[2][0] = label.x + layout.labelDistance;\r\n }\r\n else {\r\n linePoints[2][0] = label.x - layout.labelDistance;\r\n }\r\n linePoints[1][0] = linePoints[2][0] + dist;\r\n }\r\n linePoints[1][1] = linePoints[2][1] = label.y;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Set max width of each label, and then wrap each label to the max width.\r\n *\r\n * @param layout label layout\r\n * @param availableWidth max width for the label to display\r\n * @param forceRecalculate recaculate the text layout even if the current width\r\n * is smaller than `availableWidth`. This is useful when the text was previously\r\n * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in\r\n * which case, previous wrapping should be redo.\r\n */\r\nfunction constrainTextWidth(\r\n layout: LabelLayout,\r\n availableWidth: number,\r\n forceRecalculate: boolean = false\r\n) {\r\n if (layout.labelStyleWidth != null) {\r\n // User-defined style.width has the highest priority.\r\n return;\r\n }\r\n\r\n const label = layout.label;\r\n const style = label.style;\r\n const textRect = layout.rect;\r\n const bgColor = style.backgroundColor;\r\n const padding = style.padding as number[];\r\n const paddingH = padding ? padding[1] + padding[3] : 0;\r\n const overflow = style.overflow;\r\n\r\n // textRect.width already contains paddingH if bgColor is set\r\n const oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH);\r\n if (availableWidth < oldOuterWidth || forceRecalculate) {\r\n const oldHeight = textRect.height;\r\n if (overflow && overflow.match('break')) {\r\n // Temporarily set background to be null to calculate\r\n // the bounding box without background.\r\n label.setStyle('backgroundColor', null);\r\n // Set constraining width\r\n label.setStyle('width', availableWidth - paddingH);\r\n\r\n // This is the real bounding box of the text without padding.\r\n const innerRect = label.getBoundingRect();\r\n\r\n label.setStyle('width', Math.ceil(innerRect.width));\r\n label.setStyle('backgroundColor', bgColor);\r\n }\r\n else {\r\n const availableInnerWidth = availableWidth - paddingH;\r\n const newWidth = availableWidth < oldOuterWidth\r\n // Current text is too wide, use `availableWidth` as max width.\r\n ? availableInnerWidth\r\n : (\r\n // Current available width is enough, but the text may have\r\n // already been wrapped with a smaller available width.\r\n forceRecalculate\r\n ? (availableInnerWidth > layout.unconstrainedWidth\r\n // Current available is larger than text width,\r\n // so don't constrain width (otherwise it may have\r\n // empty space in the background).\r\n ? null\r\n // Current available is smaller than text width, so\r\n // use the current available width as constraining\r\n // width.\r\n : availableInnerWidth\r\n )\r\n // Current available width is enough, so no need to\r\n // constrain.\r\n : null\r\n );\r\n label.setStyle('width', newWidth);\r\n }\r\n\r\n const newRect = label.getBoundingRect();\r\n textRect.width = newRect.width;\r\n const margin = (label.style.margin || 0) + 2.1;\r\n textRect.height = newRect.height + margin;\r\n textRect.y -= (textRect.height - oldHeight) / 2;\r\n }\r\n}\r\n\r\nfunction isPositionCenter(sectorShape: LabelLayout) {\r\n // Not change x for center label\r\n return sectorShape.position === 'center';\r\n}\r\n\r\nexport default function pieLabelLayout(\r\n seriesModel: PieSeriesModel\r\n) {\r\n const data = seriesModel.getData();\r\n const labelLayoutList: LabelLayout[] = [];\r\n let cx;\r\n let cy;\r\n let hasLabelRotate = false;\r\n const minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\r\n\r\n const viewRect = data.getLayout('viewRect') as RectLike;\r\n const r = data.getLayout('r') as number;\r\n const viewWidth = viewRect.width;\r\n const viewLeft = viewRect.x;\r\n const viewTop = viewRect.y;\r\n const viewHeight = viewRect.height;\r\n\r\n function setNotShow(el: {ignore: boolean}) {\r\n el.ignore = true;\r\n }\r\n\r\n function isLabelShown(label: ZRText) {\r\n if (!label.ignore) {\r\n return true;\r\n }\r\n for (const key in label.states) {\r\n if (label.states[key].ignore === false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n data.each(function (idx) {\r\n const sector = data.getItemGraphicEl(idx) as Sector;\r\n const sectorShape = sector.shape;\r\n const label = sector.getTextContent();\r\n const labelLine = sector.getTextGuideLine();\r\n\r\n const itemModel = data.getItemModel(idx);\r\n const labelModel = itemModel.getModel('label');\r\n // Use position in normal or emphasis\r\n const labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\r\n const labelDistance = labelModel.get('distanceToLabelLine');\r\n const labelAlignTo = labelModel.get('alignTo');\r\n const edgeDistance = parsePercent(labelModel.get('edgeDistance'), viewWidth);\r\n const bleedMargin = labelModel.get('bleedMargin');\r\n\r\n const labelLineModel = itemModel.getModel('labelLine');\r\n let labelLineLen = labelLineModel.get('length');\r\n labelLineLen = parsePercent(labelLineLen, viewWidth);\r\n let labelLineLen2 = labelLineModel.get('length2');\r\n labelLineLen2 = parsePercent(labelLineLen2, viewWidth);\r\n\r\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n if (labelLine) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n return;\r\n }\r\n\r\n if (!isLabelShown(label)) {\r\n return;\r\n }\r\n\r\n const midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\r\n const nx = Math.cos(midAngle);\r\n const ny = Math.sin(midAngle);\r\n\r\n let textX;\r\n let textY;\r\n let linePoints;\r\n let textAlign: ZRTextAlign;\r\n\r\n cx = sectorShape.cx;\r\n cy = sectorShape.cy;\r\n\r\n\r\n const isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\r\n if (labelPosition === 'center') {\r\n textX = sectorShape.cx;\r\n textY = sectorShape.cy;\r\n textAlign = 'center';\r\n }\r\n else {\r\n const x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\r\n const y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\r\n\r\n textX = x1 + nx * 3;\r\n textY = y1 + ny * 3;\r\n\r\n if (!isLabelInside) {\r\n // For roseType\r\n const x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\r\n const y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\r\n const x3 = x2 + ((nx < 0 ? -1 : 1) * labelLineLen2);\r\n const y3 = y2;\r\n\r\n if (labelAlignTo === 'edge') {\r\n // Adjust textX because text align of edge is opposite\r\n textX = nx < 0\r\n ? viewLeft + edgeDistance\r\n : viewLeft + viewWidth - edgeDistance;\r\n }\r\n else {\r\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\r\n }\r\n textY = y3;\r\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\r\n }\r\n\r\n textAlign = isLabelInside\r\n ? 'center'\r\n : (labelAlignTo === 'edge'\r\n ? (nx > 0 ? 'right' : 'left')\r\n : (nx > 0 ? 'left' : 'right'));\r\n }\r\n\r\n const PI = Math.PI;\r\n let labelRotate = 0;\r\n const rotate = labelModel.get('rotate');\r\n if (isNumber(rotate)) {\r\n labelRotate = rotate * (PI / 180);\r\n }\r\n else if (labelPosition === 'center') {\r\n labelRotate = 0;\r\n }\r\n else if (rotate === 'radial' || rotate === true) {\r\n const radialAngle = nx < 0 ? -midAngle + PI : -midAngle;\r\n labelRotate = radialAngle;\r\n }\r\n else if (rotate === 'tangential'\r\n && labelPosition !== 'outside' && labelPosition !== 'outer'\r\n ) {\r\n let rad = Math.atan2(nx, ny);\r\n if (rad < 0) {\r\n rad = PI * 2 + rad;\r\n }\r\n const isDown = ny > 0;\r\n if (isDown) {\r\n rad = PI + rad;\r\n }\r\n labelRotate = rad - PI;\r\n }\r\n\r\n hasLabelRotate = !!labelRotate;\r\n\r\n label.x = textX;\r\n label.y = textY;\r\n label.rotation = labelRotate;\r\n\r\n label.setStyle({\r\n verticalAlign: 'middle'\r\n });\r\n\r\n // Not sectorShape the inside label\r\n if (!isLabelInside) {\r\n const textRect = label.getBoundingRect().clone();\r\n textRect.applyTransform(label.getComputedTransform());\r\n // Text has a default 1px stroke. Exclude this.\r\n const margin = (label.style.margin || 0) + 2.1;\r\n textRect.y -= margin / 2;\r\n textRect.height += margin;\r\n\r\n labelLayoutList.push({\r\n label,\r\n labelLine,\r\n position: labelPosition,\r\n len: labelLineLen,\r\n len2: labelLineLen2,\r\n minTurnAngle: labelLineModel.get('minTurnAngle'),\r\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\r\n surfaceNormal: new Point(nx, ny),\r\n linePoints: linePoints,\r\n textAlign: textAlign,\r\n labelDistance: labelDistance,\r\n labelAlignTo: labelAlignTo,\r\n edgeDistance: edgeDistance,\r\n bleedMargin: bleedMargin,\r\n rect: textRect,\r\n unconstrainedWidth: textRect.width,\r\n labelStyleWidth: label.style.width\r\n });\r\n }\r\n else {\r\n label.setStyle({\r\n align: textAlign\r\n });\r\n const selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n sector.setTextConfig({\r\n inside: isLabelInside\r\n });\r\n });\r\n\r\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\r\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\r\n }\r\n\r\n for (let i = 0; i < labelLayoutList.length; i++) {\r\n const layout = labelLayoutList[i];\r\n const label = layout.label;\r\n const labelLine = layout.labelLine;\r\n const notShowLabel = isNaN(label.x) || isNaN(label.y);\r\n if (label) {\r\n label.setStyle({\r\n align: layout.textAlign\r\n });\r\n if (notShowLabel) {\r\n each(label.states, setNotShow);\r\n label.ignore = true;\r\n }\r\n const selectState = label.states.select;\r\n if (selectState) {\r\n selectState.x += label.x;\r\n selectState.y += label.y;\r\n }\r\n }\r\n if (labelLine) {\r\n const linePoints = layout.linePoints;\r\n if (notShowLabel || !linePoints) {\r\n each(labelLine.states, setNotShow);\r\n labelLine.ignore = true;\r\n }\r\n else {\r\n limitTurnAngle(linePoints, layout.minTurnAngle);\r\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\r\n\r\n labelLine.setShape({ points: linePoints });\r\n\r\n // Set the anchor to the midpoint of sector\r\n label.__hostTarget.textGuideLineConfig = {\r\n anchor: new Point(linePoints[0][0], linePoints[0][1])\r\n };\r\n }\r\n }\r\n }\r\n}\r\n", "\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport { extend, retrieve3 } from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport ChartView from '../../view/Chart';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Payload, ColorString } from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport PieSeriesModel, {PieDataItemOption} from './PieSeries';\r\nimport labelLayout from './labelLayout';\r\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport { getSectorCornerRadius } from '../helper/sectorHelper';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\nimport { getBasicPieLayout, getSeriesLayoutData } from './pieLayout';\r\n\r\n/**\r\n * Piece of pie including Sector, Label, LabelLine\r\n */\r\nclass PiePiece extends graphic.Sector {\r\n\r\n constructor(data: SeriesData, idx: number, startAngle: number) {\r\n super();\r\n\r\n this.z2 = 2;\r\n\r\n const text = new graphic.Text();\r\n\r\n this.setTextContent(text);\r\n\r\n this.updateData(data, idx, startAngle, true);\r\n }\r\n\r\n updateData(data: SeriesData, idx: number, startAngle?: number, firstCreate?: boolean): void {\r\n const sector = this;\r\n\r\n const seriesModel = data.hostModel as PieSeriesModel;\r\n const itemModel = data.getItemModel(idx);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n const layout = data.getItemLayout(idx) as graphic.Sector['shape'];\r\n // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified.\r\n // see `setItemLayout` in `pieLayout.ts`.\r\n const sectorShape = extend(\r\n getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true),\r\n layout\r\n );\r\n\r\n // Ignore NaN data.\r\n if (isNaN(sectorShape.startAngle)) {\r\n // Use NaN shape to avoid drawing shape.\r\n sector.setShape(sectorShape);\r\n return;\r\n }\r\n\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n\r\n const animationType = seriesModel.getShallow('animationType');\r\n if (seriesModel.ecModel.ssr) {\r\n // Use scale animation in SSR mode(opacity?)\r\n // Because CSS SVG animation doesn't support very customized shape animation.\r\n graphic.initProps(sector, {\r\n scaleX: 0,\r\n scaleY: 0\r\n }, seriesModel, { dataIndex: idx, isFrom: true});\r\n sector.originX = sectorShape.cx;\r\n sector.originY = sectorShape.cy;\r\n }\r\n else if (animationType === 'scale') {\r\n sector.shape.r = layout.r0;\r\n graphic.initProps(sector, {\r\n shape: {\r\n r: layout.r\r\n }\r\n }, seriesModel, idx);\r\n }\r\n // Expansion\r\n else {\r\n if (startAngle != null) {\r\n sector.setShape({ startAngle, endAngle: startAngle });\r\n graphic.initProps(sector, {\r\n shape: {\r\n startAngle: layout.startAngle,\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n sector.shape.endAngle = layout.startAngle;\r\n graphic.updateProps(sector, {\r\n shape: {\r\n endAngle: layout.endAngle\r\n }\r\n }, seriesModel, idx);\r\n }\r\n }\r\n }\r\n else {\r\n saveOldStyle(sector);\r\n // Transition animation from the old shape\r\n graphic.updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel, idx);\r\n }\r\n\r\n sector.useStyle(data.getItemVisual(idx, 'style'));\r\n\r\n setStatesStylesFromModel(sector, itemModel);\r\n\r\n const midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n const offset = seriesModel.get('selectedOffset');\r\n const dx = Math.cos(midAngle) * offset;\r\n const dy = Math.sin(midAngle) * offset;\r\n\r\n const cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n\r\n this._updateLabel(seriesModel, data, idx);\r\n\r\n sector.ensureState('emphasis').shape = extend({\r\n r: layout.r + (emphasisModel.get('scale')\r\n ? (emphasisModel.get('scaleSize') || 0) : 0)\r\n }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\r\n extend(sector.ensureState('select'), {\r\n x: dx,\r\n y: dy,\r\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\r\n });\r\n extend(sector.ensureState('blur'), {\r\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\r\n });\r\n\r\n const labelLine = sector.getTextGuideLine();\r\n const labelText = sector.getTextContent();\r\n\r\n labelLine && extend(labelLine.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n // TODO: needs dx, dy in zrender?\r\n extend(labelText.ensureState('select'), {\r\n x: dx,\r\n y: dy\r\n });\r\n\r\n toggleHoverEmphasis(\r\n this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')\r\n );\r\n }\r\n\r\n private _updateLabel(seriesModel: PieSeriesModel, data: SeriesData, idx: number): void {\r\n const sector = this;\r\n const itemModel = data.getItemModel(idx);\r\n const labelLineModel = itemModel.getModel('labelLine');\r\n\r\n const style = data.getItemVisual(idx, 'style');\r\n const visualColor = style && style.fill as ColorString;\r\n const visualOpacity = style && style.opacity;\r\n\r\n setLabelStyle(\r\n sector,\r\n getLabelStatesModels(itemModel),\r\n {\r\n labelFetcher: data.hostModel as PieSeriesModel,\r\n labelDataIndex: idx,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n defaultText: seriesModel.getFormattedLabel(idx, 'normal')\r\n || data.getName(idx)\r\n }\r\n );\r\n const labelText = sector.getTextContent();\r\n\r\n // Set textConfig on sector.\r\n sector.setTextConfig({\r\n // reset position, rotation\r\n position: null,\r\n rotation: null\r\n });\r\n\r\n // Make sure update style on labelText after setLabelStyle.\r\n // Because setLabelStyle will replace a new style on it.\r\n labelText.attr({\r\n z2: 10\r\n });\r\n\r\n const labelPosition = seriesModel.get(['label', 'position']);\r\n if (labelPosition !== 'outside' && labelPosition !== 'outer') {\r\n sector.removeTextGuideLine();\r\n }\r\n else {\r\n let polyline = this.getTextGuideLine();\r\n if (!polyline) {\r\n polyline = new graphic.Polyline();\r\n this.setTextGuideLine(polyline);\r\n }\r\n\r\n // Default use item visual color\r\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\r\n stroke: visualColor,\r\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\r\n });\r\n }\r\n }\r\n}\r\n\r\n\r\n// Pie view\r\nclass PieView extends ChartView {\r\n\r\n static type = 'pie';\r\n\r\n ignoreLabelLineUpdate = true;\r\n\r\n private _data: SeriesData;\r\n private _emptyCircleSector: graphic.Sector;\r\n\r\n render(seriesModel: PieSeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n const data = seriesModel.getData();\r\n\r\n const oldData = this._data;\r\n const group = this.group;\r\n\r\n let startAngle: number;\r\n // First render\r\n if (!oldData && data.count() > 0) {\r\n let shape = data.getItemLayout(0) as graphic.Sector['shape'];\r\n for (let s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\r\n shape = data.getItemLayout(s);\r\n }\r\n if (shape) {\r\n startAngle = shape.startAngle;\r\n }\r\n }\r\n\r\n // remove empty-circle if it exists\r\n if (this._emptyCircleSector) {\r\n group.remove(this._emptyCircleSector);\r\n }\r\n // when all data are filtered, show lightgray empty circle\r\n if (data.count() === 0 && seriesModel.get('showEmptyCircle')) {\r\n const layoutData = getSeriesLayoutData(seriesModel);\r\n const sector = new graphic.Sector({\r\n shape: extend(getBasicPieLayout(seriesModel, api), layoutData)\r\n });\r\n sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle());\r\n this._emptyCircleSector = sector;\r\n group.add(sector);\r\n }\r\n\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n const piePiece = new PiePiece(data, idx, startAngle);\r\n\r\n data.setItemGraphicEl(idx, piePiece);\r\n\r\n group.add(piePiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n const piePiece = oldData.getItemGraphicEl(oldIdx) as PiePiece;\r\n\r\n piePiece.updateData(data, newIdx, startAngle);\r\n\r\n piePiece.off('click');\r\n\r\n group.add(piePiece);\r\n data.setItemGraphicEl(newIdx, piePiece);\r\n })\r\n .remove(function (idx) {\r\n const piePiece = oldData.getItemGraphicEl(idx);\r\n graphic.removeElementWithFadeOut(piePiece, seriesModel, idx);\r\n })\r\n .execute();\r\n\r\n labelLayout(seriesModel);\r\n\r\n // Always use initial animation.\r\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\r\n this._data = data;\r\n }\r\n }\r\n\r\n dispose() {}\r\n\r\n containPoint(point: number[], seriesModel: PieSeriesModel): boolean {\r\n const data = seriesModel.getData();\r\n const itemLayout = data.getItemLayout(0);\r\n if (itemLayout) {\r\n const dx = point[0] - itemLayout.cx;\r\n const dy = point[1] - itemLayout.cy;\r\n const radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n }\r\n}\r\n\r\nexport default PieView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport prepareSeriesDataSchema, {PrepareSeriesDataSchemaParams} from '../../data/helper/createDimensions';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport {extend, isArray} from 'zrender/src/core/util';\r\nimport SeriesModel from '../../model/Series';\r\n\r\n/**\r\n * [Usage]:\r\n * (1)\r\n * createListSimply(seriesModel, ['value']);\r\n * (2)\r\n * createListSimply(seriesModel, {\r\n * coordDimensions: ['value'],\r\n * dimensionsCount: 5\r\n * });\r\n */\r\nexport default function createSeriesDataSimply(\r\n seriesModel: SeriesModel,\r\n opt: PrepareSeriesDataSchemaParams | PrepareSeriesDataSchemaParams['coordDimensions'],\r\n nameList?: string[]\r\n): SeriesData {\r\n opt = isArray(opt) && {\r\n coordDimensions: opt\r\n } || extend({\r\n encodeDefine: seriesModel.getEncode()\r\n }, opt);\r\n\r\n const source = seriesModel.getSource();\r\n\r\n const { dimensions } = prepareSeriesDataSchema(source, opt as PrepareSeriesDataSchemaParams);\r\n\r\n const list = new SeriesData(dimensions, seriesModel);\r\n list.initData(source, nameList);\r\n\r\n return list;\r\n}\r\n", "import SeriesData from '../data/SeriesData';\r\n\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * LegendVisualProvider is an bridge that pick encoded color from data and\r\n * provide to the legend component.\r\n */\r\nclass LegendVisualProvider {\r\n\r\n private _getDataWithEncodedVisual: () => SeriesData;\r\n private _getRawData: () => SeriesData;\r\n\r\n constructor(\r\n // Function to get data after filtered. It stores all the encoding info\r\n getDataWithEncodedVisual: () => SeriesData,\r\n // Function to get raw data before filtered.\r\n getRawData: () => SeriesData\r\n ) {\r\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\r\n this._getRawData = getRawData;\r\n }\r\n\r\n getAllNames(): string[] {\r\n const rawData = this._getRawData();\r\n // We find the name from the raw data. In case it's filtered by the legend component.\r\n // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\r\n return rawData.mapArray(rawData.getName);\r\n }\r\n\r\n containName(name: string): boolean {\r\n const rawData = this._getRawData();\r\n return rawData.indexOfName(name) >= 0;\r\n }\r\n\r\n indexOfName(name: string): number {\r\n // Only get data when necessary.\r\n // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\r\n // Invoking Series#getData immediately will throw an error.\r\n const dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.indexOfName(name);\r\n }\r\n\r\n getItemVisual(dataIndex: number, key: string): any {\r\n // Get encoded visual properties from final filtered data.\r\n const dataWithEncodedVisual = this._getDataWithEncodedVisual();\r\n return dataWithEncodedVisual.getItemVisual(dataIndex, key as any);\r\n }\r\n}\r\n\r\nexport default LegendVisualProvider;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as modelUtil from '../../util/model';\r\nimport { getPercentSeats } from '../../util/number';\r\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper';\r\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n SeriesOption,\r\n CallbackDataParams,\r\n CircleLayoutOptionMixin,\r\n LabelLineOption,\r\n ItemStyleOption,\r\n BoxLayoutOptionMixin,\r\n OptionDataValueNumeric,\r\n SeriesEncodeOptionMixin,\r\n OptionDataItemObject,\r\n StatesOptionMixin,\r\n SeriesLabelOption,\r\n DefaultEmphasisFocus\r\n} from '../../util/types';\r\nimport type SeriesData from '../../data/SeriesData';\r\n\r\ninterface PieItemStyleOption extends ItemStyleOption {\r\n // can be 10\r\n // which means that both innerCornerRadius and outerCornerRadius are 10\r\n // can also be an array [20, 10]\r\n // which means that innerCornerRadius is 20\r\n // and outerCornerRadius is 10\r\n // can also be a string or string array, such as ['20%', '50%']\r\n // which means that innerCornerRadius is 20% of the innerRadius\r\n // and outerCornerRadius is half of outerRadius.\r\n borderRadius?: (number | string)[] | number | string\r\n}\r\n\r\nexport interface PieCallbackDataParams extends CallbackDataParams {\r\n percent: number\r\n}\r\n\r\nexport interface PieStateOption {\r\n // TODO: TYPE Color Callback\r\n itemStyle?: PieItemStyleOption\r\n label?: PieLabelOption\r\n labelLine?: PieLabelLineOption\r\n}\r\ninterface PieLabelOption extends Omit {\r\n rotate?: number | boolean | 'radial' | 'tangential'\r\n alignTo?: 'none' | 'labelLine' | 'edge'\r\n edgeDistance?: string | number\r\n /**\r\n * @deprecated Use `edgeDistance` instead\r\n */\r\n margin?: string | number\r\n bleedMargin?: number\r\n distanceToLabelLine?: number\r\n\r\n position?: SeriesLabelOption['position'] | 'outer' | 'inner' | 'center' | 'outside'\r\n}\r\n\r\ninterface PieLabelLineOption extends LabelLineOption {\r\n /**\r\n * Max angle between labelLine and surface normal.\r\n * 0 - 180\r\n */\r\n maxSurfaceAngle?: number\r\n}\r\n\r\ninterface ExtraStateOption {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus\r\n scale?: boolean\r\n scaleSize?: number\r\n }\r\n}\r\n\r\nexport interface PieDataItemOption extends\r\n OptionDataItemObject,\r\n PieStateOption, StatesOptionMixin {\r\n cursor?: string\r\n}\r\nexport interface PieSeriesOption extends\r\n Omit, ExtraStateOption>, 'labelLine'>,\r\n PieStateOption,\r\n Omit,\r\n BoxLayoutOptionMixin,\r\n SeriesEncodeOptionMixin {\r\n\r\n type?: 'pie'\r\n\r\n roseType?: 'radius' | 'area'\r\n\r\n center?: string | number | (string | number)[]\r\n\r\n clockwise?: boolean\r\n startAngle?: number\r\n endAngle?: number | 'auto'\r\n padAngle?: number;\r\n\r\n minAngle?: number\r\n minShowLabelAngle?: number\r\n\r\n selectedOffset?: number\r\n\r\n avoidLabelOverlap?: boolean\r\n percentPrecision?: number\r\n\r\n stillShowZeroSum?: boolean\r\n\r\n animationType?: 'expansion' | 'scale'\r\n animationTypeUpdate?: 'transition' | 'expansion'\r\n\r\n showEmptyCircle?: boolean;\r\n emptyCircleStyle?: PieItemStyleOption;\r\n\r\n data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | PieDataItemOption)[]\r\n}\r\n\r\nconst innerData = modelUtil.makeInner<{\r\n seats?: number[]\r\n}, SeriesData>();\r\n\r\nclass PieSeriesModel extends SeriesModel {\r\n\r\n static type = 'series.pie' as const;\r\n\r\n /**\r\n * @overwrite\r\n */\r\n init(option: PieSeriesOption): void {\r\n super.init.apply(this, arguments as any);\r\n\r\n // Enable legend selection for each data item\r\n // Use a function instead of direct access because data reference may changed\r\n this.legendVisualProvider = new LegendVisualProvider(\r\n zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)\r\n );\r\n\r\n this._defaultLabelLine(option);\r\n }\r\n\r\n /**\r\n * @overwrite\r\n */\r\n mergeOption(): void {\r\n super.mergeOption.apply(this, arguments as any);\r\n }\r\n\r\n /**\r\n * @overwrite\r\n */\r\n getInitialData(this: PieSeriesModel): SeriesData {\r\n return createSeriesDataSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n }\r\n\r\n /**\r\n * @overwrite\r\n */\r\n getDataParams(dataIndex: number): PieCallbackDataParams {\r\n const data = this.getData();\r\n // update seats when data is changed\r\n const dataInner = innerData(data);\r\n let seats = dataInner.seats;\r\n if (!seats) {\r\n const valueList: number[] = [];\r\n data.each(data.mapDimension('value'), function (value: number) {\r\n valueList.push(value);\r\n });\r\n seats = dataInner.seats = getPercentSeats(valueList, data.hostModel.get('percentPrecision'));\r\n }\r\n const params = super.getDataParams(dataIndex) as PieCallbackDataParams;\r\n // seats may be empty when sum is 0\r\n params.percent = seats[dataIndex] || 0;\r\n params.$vars.push('percent');\r\n return params;\r\n }\r\n\r\n private _defaultLabelLine(option: PieSeriesOption): void {\r\n // Extend labelLine emphasis\r\n modelUtil.defaultEmphasis(option, 'labelLine', ['show']);\r\n\r\n const labelLineNormalOpt = option.labelLine;\r\n const labelLineEmphasisOpt = option.emphasis.labelLine;\r\n // Not show label line if `label.normal.show = false`\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n }\r\n\r\n static defaultOption: Omit = {\r\n // zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n colorBy: 'data',\r\n // \u9ED8\u8BA4\u5168\u5C40\u5C45\u4E2D\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n // \u9ED8\u8BA4\u987A\u65F6\u9488\r\n clockwise: true,\r\n startAngle: 90,\r\n endAngle: 'auto',\r\n padAngle: 0,\r\n // \u6700\u5C0F\u89D2\u5EA6\u6539\u4E3A0\r\n minAngle: 0,\r\n\r\n // If the angle of a sector less than `minShowLabelAngle`,\r\n // the label will not be displayed.\r\n minShowLabelAngle: 0,\r\n\r\n // \u9009\u4E2D\u65F6\u6247\u533A\u504F\u79FB\u91CF\r\n selectedOffset: 10,\r\n\r\n // \u9009\u62E9\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u5173\u95ED\uFF0C\u53EF\u9009single\uFF0Cmultiple\r\n // selectedMode: false,\r\n // \u5357\u4E01\u683C\u5C14\u73AB\u7470\u56FE\u6A21\u5F0F\uFF0C'radius'\uFF08\u534A\u5F84\uFF09 | 'area'\uFF08\u9762\u79EF\uFF09\r\n // roseType: null,\r\n\r\n percentPrecision: 2,\r\n\r\n // If still show when all data zero.\r\n stillShowZeroSum: true,\r\n\r\n // cursor: null,\r\n\r\n left: 0,\r\n top: 0,\r\n right: 0,\r\n bottom: 0,\r\n width: null,\r\n height: null,\r\n\r\n label: {\r\n // color: 'inherit',\r\n // If rotate around circle\r\n rotate: 0,\r\n show: true,\r\n overflow: 'truncate',\r\n // 'outer', 'inside', 'center'\r\n position: 'outer',\r\n // 'none', 'labelLine', 'edge'. Works only when position is 'outer'\r\n alignTo: 'none',\r\n // Closest distance between label and chart edge.\r\n // Works only position is 'outer' and alignTo is 'edge'.\r\n edgeDistance: '25%',\r\n // Works only position is 'outer' and alignTo is not 'edge'.\r\n bleedMargin: 10,\r\n // Distance between text and label line.\r\n distanceToLabelLine: 5\r\n // formatter: \u6807\u7B7E\u6587\u672C\u683C\u5F0F\u5668\uFF0C\u540C tooltip.formatter\uFF0C\u4E0D\u652F\u6301\u5F02\u6B65\u56DE\u8C03\r\n // \u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1 textStyle\r\n // distance: \u5F53position\u4E3Ainner\u65F6\u6709\u6548\uFF0C\u4E3Alabel\u4F4D\u7F6E\u5230\u5706\u5FC3\u7684\u8DDD\u79BB\u4E0E\u5706\u534A\u5F84(\u73AF\u72B6\u56FE\u4E3A\u5185\u5916\u534A\u5F84\u548C)\u7684\u6BD4\u4F8B\u7CFB\u6570\r\n },\r\n // Enabled when label.normal.position is 'outer'\r\n labelLine: {\r\n show: true,\r\n // \u5F15\u5BFC\u7EBF\u4E24\u6BB5\u4E2D\u7684\u7B2C\u4E00\u6BB5\u957F\u5EA6\r\n length: 15,\r\n // \u5F15\u5BFC\u7EBF\u4E24\u6BB5\u4E2D\u7684\u7B2C\u4E8C\u6BB5\u957F\u5EA6\r\n length2: 15,\r\n smooth: false,\r\n minTurnAngle: 90,\r\n maxSurfaceAngle: 90,\r\n lineStyle: {\r\n // color: \u5404\u5F02,\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n itemStyle: {\r\n borderWidth: 1,\r\n borderJoin: 'round'\r\n },\r\n\r\n showEmptyCircle: true,\r\n emptyCircleStyle: {\r\n color: 'lightgray',\r\n opacity: 1\r\n },\r\n\r\n labelLayout: {\r\n // Hide the overlapped label.\r\n hideOverlap: true\r\n },\r\n\r\n emphasis: {\r\n scale: true,\r\n scaleSize: 5\r\n },\r\n\r\n // If use strategy to avoid label overlapping\r\n avoidLabelOverlap: true,\r\n\r\n // Animation type. Valid values: expansion, scale\r\n animationType: 'expansion',\r\n\r\n animationDuration: 1000,\r\n\r\n // Animation type when update. Valid values: transition, expansion\r\n animationTypeUpdate: 'transition',\r\n\r\n animationEasingUpdate: 'cubicInOut',\r\n animationDurationUpdate: 500,\r\n animationEasing: 'cubicInOut'\r\n };\r\n\r\n}\r\n\r\nexport default PieSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { isNumber } from 'zrender/src/core/util';\r\nimport { StageHandler } from '../util/types';\r\n\r\nexport default function negativeDataFilter(seriesType: string): StageHandler {\r\n return {\r\n seriesType: seriesType,\r\n reset: function (seriesModel, ecModel) {\r\n const data = seriesModel.getData();\r\n data.filterSelf(function (idx) {\r\n // handle negative value condition\r\n const valueDim = data.mapDimension('value');\r\n const curValue = data.get(valueDim, idx);\r\n if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) {\r\n return false;\r\n }\r\n return true;\r\n });\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\nimport {createLegacyDataSelectAction} from '../../legacy/dataSelectAction';\r\nimport pieLayout from '../pie/pieLayout';\r\nimport dataFilter from '../../processor/dataFilter';\r\nimport { curry } from 'zrender/src/core/util';\r\nimport PieView from './PieView';\r\nimport PieSeriesModel from './PieSeries';\r\nimport negativeDataFilter from '../../processor/negativeDataFilter';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(PieView);\r\n registers.registerSeriesModel(PieSeriesModel);\r\n\r\n createLegacyDataSelectAction('pie', registers.registerAction);\r\n\r\n registers.registerLayout(curry(pieLayout, 'pie'));\r\n registers.registerProcessor(dataFilter('pie'));\r\n registers.registerProcessor(negativeDataFilter('pie'));\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnPolarOptionMixin,\r\n SeriesOnCalendarOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n SeriesOnSingleOptionMixin,\r\n OptionDataValue,\r\n ItemStyleOption,\r\n SeriesLabelOption,\r\n SeriesLargeOptionMixin,\r\n SeriesStackOptionMixin,\r\n SymbolOptionMixin,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n SeriesEncodeOptionMixin,\r\n CallbackDataParams,\r\n DefaultEmphasisFocus\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { BrushCommonSelectorsForSeries } from '../../component/brush/selector';\r\n\r\ninterface ScatterStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\n\r\ninterface ScatterStatesOptionMixin {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus\r\n scale?: boolean | number\r\n }\r\n}\r\n\r\nexport interface ScatterDataItemOption extends SymbolOptionMixin,\r\n ScatterStateOption, StatesOptionMixin,\r\n OptionDataItemObject {\r\n}\r\n\r\nexport interface ScatterSeriesOption\r\n extends SeriesOption, ScatterStatesOptionMixin>,\r\n ScatterStateOption,\r\n SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin,\r\n SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin,\r\n SeriesLargeOptionMixin, SeriesStackOptionMixin,\r\n SymbolOptionMixin, SeriesEncodeOptionMixin {\r\n type?: 'scatter'\r\n\r\n coordinateSystem?: string\r\n\r\n cursor?: string\r\n clip?: boolean\r\n\r\n data?: (ScatterDataItemOption | OptionDataValue | OptionDataValue[])[]\r\n | ArrayLike // Can be a flattern array\r\n}\r\n\r\n\r\nclass ScatterSeriesModel extends SeriesModel {\r\n static readonly type = 'series.scatter';\r\n type = ScatterSeriesModel.type;\r\n\r\n static readonly dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n\r\n hasSymbolVisual = true;\r\n\r\n getInitialData(option: ScatterSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesData(null, this, {\r\n useEncodeDefaulter: true\r\n });\r\n }\r\n\r\n\r\n getProgressive() {\r\n const progressive = this.option.progressive;\r\n if (progressive == null) {\r\n // PENDING\r\n return this.option.large ? 5e3 : this.get('progressive');\r\n }\r\n return progressive;\r\n }\r\n\r\n getProgressiveThreshold() {\r\n const progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n // PENDING\r\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n }\r\n\r\n brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries): boolean {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n }\r\n\r\n getZLevelKey() {\r\n // Each progressive series has individual key.\r\n return this.getData().count() > this.getProgressiveThreshold()\r\n ? this.id : '';\r\n }\r\n\r\n\r\n static defaultOption: ScatterSeriesOption = {\r\n coordinateSystem: 'cartesian2d',\r\n // zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n\r\n symbolSize: 10, // \u56FE\u5F62\u5927\u5C0F\uFF0C\u534A\u5BBD\uFF08\u534A\u5F84\uFF09\u53C2\u6570\uFF0C\u5F53\u56FE\u5F62\u4E3A\u65B9\u5411\u6216\u83F1\u5F62\u5219\u603B\u5BBD\u5EA6\u4E3AsymbolSize * 2\r\n // symbolRotate: null, // \u56FE\u5F62\u65CB\u8F6C\u63A7\u5236\r\n\r\n large: false,\r\n // Available when large is true\r\n largeThreshold: 2000,\r\n // cursor: null,\r\n\r\n itemStyle: {\r\n opacity: 0.8\r\n // color: \u5404\u5F02\r\n },\r\n\r\n emphasis: {\r\n scale: true\r\n },\r\n\r\n // If clip the overflow graphics\r\n // Works on cartesian / polar series\r\n clip: true,\r\n\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n\r\n universalTransition: {\r\n divideShape: 'clone'\r\n }\r\n // progressive: null\r\n };\r\n\r\n}\r\n\r\nexport default ScatterSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/* global Float32Array */\r\n\r\n// TODO Batch by color\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport {createSymbol} from '../../util/symbol';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport PathProxy from 'zrender/src/core/PathProxy';\r\nimport SeriesModel from '../../model/Series';\r\nimport { StageHandlerProgressParams } from '../../util/types';\r\nimport { CoordinateSystemClipArea } from '../../coord/CoordinateSystem';\r\nimport { getECData } from '../../util/innerStore';\r\nimport Element from 'zrender/src/Element';\r\n\r\nconst BOOST_SIZE_THRESHOLD = 4;\r\n\r\nclass LargeSymbolPathShape {\r\n points: ArrayLike;\r\n size: number[];\r\n}\r\n\r\ntype LargeSymbolPathProps = PathProps & {\r\n shape?: Partial\r\n startIndex?: number\r\n endIndex?: number\r\n};\r\n\r\ntype ECSymbol = ReturnType;\r\n\r\nclass LargeSymbolPath extends graphic.Path {\r\n\r\n shape: LargeSymbolPathShape;\r\n\r\n symbolProxy: ECSymbol;\r\n\r\n softClipShape: CoordinateSystemClipArea;\r\n\r\n startIndex: number;\r\n endIndex: number;\r\n\r\n private _ctx: CanvasRenderingContext2D;\r\n private _off: number = 0;\r\n\r\n hoverDataIdx: number = -1;\r\n\r\n notClear: boolean;\r\n\r\n constructor(opts?: LargeSymbolPathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new LargeSymbolPathShape();\r\n }\r\n\r\n setColor: ECSymbol['setColor'];\r\n\r\n reset() {\r\n this.notClear = false;\r\n this._off = 0;\r\n }\r\n\r\n buildPath(path: PathProxy | CanvasRenderingContext2D, shape: LargeSymbolPathShape) {\r\n const points = shape.points;\r\n const size = shape.size;\r\n\r\n const symbolProxy = this.symbolProxy;\r\n const symbolProxyShape = symbolProxy.shape;\r\n const ctx = (path as PathProxy).getContext\r\n ? (path as PathProxy).getContext()\r\n : path as CanvasRenderingContext2D;\r\n const canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\r\n const softClipShape = this.softClipShape;\r\n let i;\r\n\r\n // Do draw in afterBrush.\r\n if (canBoost) {\r\n this._ctx = ctx;\r\n return;\r\n }\r\n\r\n this._ctx = null;\r\n\r\n for (i = this._off; i < points.length;) {\r\n const x = points[i++];\r\n const y = points[i++];\r\n\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (softClipShape && !softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n\r\n symbolProxyShape.x = x - size[0] / 2;\r\n symbolProxyShape.y = y - size[1] / 2;\r\n symbolProxyShape.width = size[0];\r\n symbolProxyShape.height = size[1];\r\n\r\n symbolProxy.buildPath(path, symbolProxyShape, true);\r\n }\r\n if (this.incremental) {\r\n this._off = i;\r\n this.notClear = true;\r\n }\r\n }\r\n\r\n afterBrush() {\r\n const shape = this.shape;\r\n const points = shape.points;\r\n const size = shape.size;\r\n const ctx = this._ctx;\r\n const softClipShape = this.softClipShape;\r\n let i;\r\n\r\n if (!ctx) {\r\n return;\r\n }\r\n\r\n // PENDING If style or other canvas status changed?\r\n for (i = this._off; i < points.length;) {\r\n const x = points[i++];\r\n const y = points[i++];\r\n if (isNaN(x) || isNaN(y)) {\r\n continue;\r\n }\r\n if (softClipShape && !softClipShape.contain(x, y)) {\r\n continue;\r\n }\r\n // fillRect is faster than building a rect path and draw.\r\n // And it support light globalCompositeOperation.\r\n ctx.fillRect(\r\n x - size[0] / 2, y - size[1] / 2,\r\n size[0], size[1]\r\n );\r\n }\r\n if (this.incremental) {\r\n this._off = i;\r\n this.notClear = true;\r\n }\r\n }\r\n\r\n findDataIndex(x: number, y: number) {\r\n // TODO ???\r\n // Consider transform\r\n\r\n const shape = this.shape;\r\n const points = shape.points;\r\n const size = shape.size;\r\n\r\n const w = Math.max(size[0], 4);\r\n const h = Math.max(size[1], 4);\r\n\r\n // Not consider transform\r\n // Treat each element as a rect\r\n // top down traverse\r\n for (let idx = points.length / 2 - 1; idx >= 0; idx--) {\r\n const i = idx * 2;\r\n const x0 = points[i] - w / 2;\r\n const y0 = points[i + 1] - h / 2;\r\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\r\n return idx;\r\n }\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n contain(x: number, y: number): boolean {\r\n const localPos = this.transformCoordToLocal(x, y);\r\n const rect = this.getBoundingRect();\r\n x = localPos[0];\r\n y = localPos[1];\r\n\r\n if (rect.contain(x, y)) {\r\n // Cache found data index.\r\n const dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\r\n return dataIdx >= 0;\r\n }\r\n this.hoverDataIdx = -1;\r\n return false;\r\n }\r\n\r\n getBoundingRect() {\r\n // Ignore stroke for large symbol draw.\r\n let rect = this._rect;\r\n if (!rect) {\r\n const shape = this.shape;\r\n const points = shape.points;\r\n const size = shape.size;\r\n const w = size[0];\r\n const h = size[1];\r\n let minX = Infinity;\r\n let minY = Infinity;\r\n let maxX = -Infinity;\r\n let maxY = -Infinity;\r\n for (let i = 0; i < points.length;) {\r\n const x = points[i++];\r\n const y = points[i++];\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n\r\n rect = this._rect = new graphic.BoundingRect(\r\n minX - w / 2,\r\n minY - h / 2,\r\n maxX - minX + w,\r\n maxY - minY + h\r\n );\r\n }\r\n return rect;\r\n }\r\n}\r\n\r\ninterface UpdateOpt {\r\n clipShape?: CoordinateSystemClipArea\r\n}\r\n\r\nclass LargeSymbolDraw {\r\n\r\n group = new graphic.Group();\r\n\r\n // New add element in this frame of progressive render.\r\n private _newAdded: LargeSymbolPath[];\r\n\r\n /**\r\n * Update symbols draw by new data\r\n */\r\n updateData(data: SeriesData, opt?: UpdateOpt) {\r\n this._clear();\r\n\r\n const symbolEl = this._create();\r\n symbolEl.setShape({\r\n points: data.getLayout('points')\r\n });\r\n this._setCommon(symbolEl, data, opt);\r\n }\r\n\r\n updateLayout(data: SeriesData) {\r\n let points = data.getLayout('points');\r\n this.group.eachChild(function (child: LargeSymbolPath) {\r\n if (child.startIndex != null) {\r\n const len = (child.endIndex - child.startIndex) * 2;\r\n const byteOffset = child.startIndex * 4 * 2;\r\n points = new Float32Array(points.buffer, byteOffset, len);\r\n }\r\n child.setShape('points', points);\r\n // Reset draw cursor.\r\n child.reset();\r\n });\r\n }\r\n\r\n incrementalPrepareUpdate(data: SeriesData) {\r\n this._clear();\r\n }\r\n\r\n incrementalUpdate(taskParams: StageHandlerProgressParams, data: SeriesData, opt: UpdateOpt) {\r\n const lastAdded = this._newAdded[0];\r\n const points = data.getLayout('points');\r\n const oldPoints = lastAdded && lastAdded.shape.points;\r\n // Merging the exists. Each element has 1e4 points.\r\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\r\n if (oldPoints && oldPoints.length < 2e4) {\r\n const oldLen = oldPoints.length;\r\n const newPoints = new Float32Array(oldLen + points.length);\r\n // Concat two array\r\n newPoints.set(oldPoints);\r\n newPoints.set(points, oldLen);\r\n // Update endIndex\r\n lastAdded.endIndex = taskParams.end;\r\n lastAdded.setShape({ points: newPoints });\r\n }\r\n else {\r\n // Clear\r\n this._newAdded = [];\r\n\r\n const symbolEl = this._create();\r\n symbolEl.startIndex = taskParams.start;\r\n symbolEl.endIndex = taskParams.end;\r\n symbolEl.incremental = true;\r\n symbolEl.setShape({\r\n points\r\n });\r\n this._setCommon(symbolEl, data, opt);\r\n }\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n this._newAdded[0] && cb(this._newAdded[0]);\r\n }\r\n\r\n private _create() {\r\n const symbolEl = new LargeSymbolPath({\r\n cursor: 'default'\r\n });\r\n symbolEl.ignoreCoarsePointer = true;\r\n this.group.add(symbolEl);\r\n this._newAdded.push(symbolEl);\r\n return symbolEl;\r\n }\r\n\r\n private _setCommon(\r\n symbolEl: LargeSymbolPath,\r\n data: SeriesData,\r\n opt: UpdateOpt\r\n ) {\r\n const hostModel = data.hostModel;\r\n\r\n opt = opt || {};\r\n\r\n const size = data.getVisual('symbolSize');\r\n symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]);\r\n\r\n symbolEl.softClipShape = opt.clipShape || null;\r\n // Create symbolProxy to build path for each data\r\n symbolEl.symbolProxy = createSymbol(\r\n data.getVisual('symbol'), 0, 0, 0, 0\r\n );\r\n // Use symbolProxy setColor method\r\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\r\n\r\n const extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\r\n symbolEl.useStyle(\r\n // Draw shadow when doing fillRect is extremely slow.\r\n hostModel.getModel('itemStyle').getItemStyle(\r\n extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']\r\n )\r\n );\r\n\r\n const globalStyle = data.getVisual('style');\r\n const visualColor = globalStyle && globalStyle.fill;\r\n if (visualColor) {\r\n symbolEl.setColor(visualColor);\r\n }\r\n\r\n const ecData = getECData(symbolEl);\r\n // Enable tooltip\r\n // PENDING May have performance issue when path is extremely large\r\n ecData.seriesIndex = (hostModel as SeriesModel).seriesIndex;\r\n symbolEl.on('mousemove', function (e) {\r\n ecData.dataIndex = null;\r\n const dataIndex = symbolEl.hoverDataIdx;\r\n if (dataIndex >= 0) {\r\n // Provide dataIndex for tooltip\r\n ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0);\r\n }\r\n });\r\n }\r\n\r\n remove() {\r\n this._clear();\r\n }\r\n\r\n private _clear() {\r\n this._newAdded = [];\r\n this.group.removeAll();\r\n }\r\n}\r\n\r\n\r\nexport default LargeSymbolDraw;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SymbolDraw from '../helper/SymbolDraw';\r\nimport LargeSymbolDraw from '../helper/LargeSymbolDraw';\r\n\r\nimport pointsLayout from '../../layout/points';\r\nimport ChartView from '../../view/Chart';\r\nimport ScatterSeriesModel from './ScatterSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { TaskProgressParams } from '../../core/task';\r\nimport type { StageHandlerProgressExecutor } from '../../util/types';\r\nimport Element from 'zrender/src/Element';\r\n\r\nclass ScatterView extends ChartView {\r\n static readonly type = 'scatter';\r\n type = ScatterView.type;\r\n\r\n _finished: boolean;\r\n\r\n _isLargeDraw: boolean;\r\n\r\n _symbolDraw: SymbolDraw | LargeSymbolDraw;\r\n\r\n render(seriesModel: ScatterSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n\r\n const symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n\r\n symbolDraw.updateData(data, {\r\n // TODO\r\n // If this parameter should be a shape or a bounding volume\r\n // shape will be more general.\r\n // But bounding volume like bounding rect will be much faster in the contain calculation\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n\r\n this._finished = true;\r\n }\r\n\r\n incrementalPrepareRender(seriesModel: ScatterSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n const symbolDraw = this._updateSymbolDraw(data, seriesModel);\r\n\r\n symbolDraw.incrementalPrepareUpdate(data);\r\n\r\n this._finished = false;\r\n }\r\n\r\n incrementalRender(taskParams: TaskProgressParams, seriesModel: ScatterSeriesModel, ecModel: GlobalModel) {\r\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\r\n clipShape: this._getClipShape(seriesModel)\r\n });\r\n\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n }\r\n\r\n updateTransform(seriesModel: ScatterSeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void | { update: true } {\r\n const data = seriesModel.getData();\r\n // Must mark group dirty and make sure the incremental layer will be cleared\r\n // PENDING\r\n this.group.dirty();\r\n\r\n if (!this._finished || data.count() > 1e4) {\r\n return {\r\n update: true\r\n };\r\n }\r\n else {\r\n const res = pointsLayout('').reset(seriesModel, ecModel, api) as StageHandlerProgressExecutor;\r\n if (res.progress) {\r\n res.progress({ start: 0, end: data.count(), count: data.count() }, data);\r\n }\r\n\r\n this._symbolDraw.updateLayout(data);\r\n }\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n this._symbolDraw && this._symbolDraw.eachRendered(cb);\r\n }\r\n\r\n _getClipShape(seriesModel: ScatterSeriesModel) {\r\n if (!seriesModel.get('clip', true)) {\r\n return;\r\n }\r\n const coordSys = seriesModel.coordinateSystem;\r\n // PENDING make `0.1` configurable, for example, `clipTolerance`?\r\n return coordSys && coordSys.getArea && coordSys.getArea(.1);\r\n }\r\n\r\n _updateSymbolDraw(data: SeriesData, seriesModel: ScatterSeriesModel) {\r\n let symbolDraw = this._symbolDraw;\r\n const pipelineContext = seriesModel.pipelineContext;\r\n const isLargeDraw = pipelineContext.large;\r\n\r\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\r\n symbolDraw && symbolDraw.remove();\r\n symbolDraw = this._symbolDraw = isLargeDraw\r\n ? new LargeSymbolDraw()\r\n : new SymbolDraw();\r\n this._isLargeDraw = isLargeDraw;\r\n this.group.removeAll();\r\n }\r\n\r\n this.group.add(symbolDraw.group);\r\n\r\n return symbolDraw;\r\n }\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n this._symbolDraw = null;\r\n }\r\n\r\n dispose() {}\r\n}\r\n\r\nexport default ScatterView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport ComponentModel from '../../model/Component';\r\nimport { ComponentOption, BoxLayoutOptionMixin, ZRColor, ShadowOptionMixin } from '../../util/types';\r\nimport Grid from './Grid';\r\nimport { CoordinateSystemHostModel } from '../CoordinateSystem';\r\n\r\nexport interface GridOption extends ComponentOption, BoxLayoutOptionMixin, ShadowOptionMixin {\r\n mainType?: 'grid';\r\n\r\n show?: boolean;\r\n\r\n // Whether grid size contain label.\r\n containLabel?: boolean;\r\n\r\n backgroundColor?: ZRColor;\r\n borderWidth?: number;\r\n borderColor?: ZRColor;\r\n\r\n tooltip?: any; // FIXME:TS add this tooltip type\r\n}\r\n\r\nclass GridModel extends ComponentModel implements CoordinateSystemHostModel {\r\n\r\n static type = 'grid';\r\n\r\n static dependencies = ['xAxis', 'yAxis'];\r\n\r\n static layoutMode = 'box' as const;\r\n\r\n coordinateSystem: Grid;\r\n\r\n static defaultOption: GridOption = {\r\n show: false,\r\n // zlevel: 0,\r\n z: 0,\r\n left: '10%',\r\n top: 60,\r\n right: '10%',\r\n bottom: 70,\r\n // If grid size contain label\r\n containLabel: false,\r\n // width: {totalWidth} - left - right,\r\n // height: {totalHeight} - top - bottom,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n };\r\n}\r\n\r\nexport default GridModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ComponentModel from '../../model/Component';\r\nimport { AxisModelExtendedInCreator } from '../axisModelCreator';\r\nimport {AxisModelCommonMixin} from '../axisModelCommonMixin';\r\nimport Axis2D from './Axis2D';\r\nimport { AxisBaseOption } from '../axisCommonTypes';\r\nimport GridModel from './GridModel';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport {OrdinalSortInfo} from '../../util/types';\r\nimport { SINGLE_REFERRING } from '../../util/model';\r\n\r\nexport type CartesianAxisPosition = 'top' | 'bottom' | 'left' | 'right';\r\n\r\nexport type CartesianAxisOption = AxisBaseOption & {\r\n gridIndex?: number;\r\n gridId?: string;\r\n position?: CartesianAxisPosition;\r\n // Offset is for multiple axis on the same position.\r\n offset?: number;\r\n categorySortInfo?: OrdinalSortInfo;\r\n};\r\n\r\nexport type XAXisOption = CartesianAxisOption & {\r\n mainType?: 'xAxis'\r\n};\r\nexport type YAXisOption = CartesianAxisOption & {\r\n mainType?: 'yAxis'\r\n};\r\n\r\nexport class CartesianAxisModel extends ComponentModel\r\n implements AxisBaseModel {\r\n\r\n static type = 'cartesian2dAxis';\r\n\r\n axis: Axis2D;\r\n\r\n getCoordSysModel(): GridModel {\r\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0] as GridModel;\r\n }\r\n\r\n}\r\n\r\nexport interface CartesianAxisModel extends AxisModelCommonMixin,\r\n AxisModelExtendedInCreator {}\r\n\r\nzrUtil.mixin(CartesianAxisModel, AxisModelCommonMixin);\r\n\r\nexport default CartesianAxisModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { AxisBaseOption } from './axisCommonTypes';\r\n\r\n\r\nconst defaultOption: AxisBaseOption = {\r\n show: true,\r\n // zlevel: 0,\r\n z: 0,\r\n // Inverse the axis.\r\n inverse: false,\r\n\r\n // Axis name displayed.\r\n name: '',\r\n // 'start' | 'middle' | 'end'\r\n nameLocation: 'end',\r\n // By degree. By default auto rotate by nameLocation.\r\n nameRotate: null,\r\n nameTruncate: {\r\n maxWidth: null,\r\n ellipsis: '...',\r\n placeholder: '.'\r\n },\r\n // Use global text style by default.\r\n nameTextStyle: {},\r\n // The gap between axisName and axisLine.\r\n nameGap: 15,\r\n\r\n // Default `false` to support tooltip.\r\n silent: false,\r\n // Default `false` to avoid legacy user event listener fail.\r\n triggerEvent: false,\r\n\r\n tooltip: {\r\n show: false\r\n },\r\n\r\n axisPointer: {},\r\n\r\n axisLine: {\r\n show: true,\r\n onZero: true,\r\n onZeroAxisIndex: null,\r\n lineStyle: {\r\n color: '#6E7079',\r\n width: 1,\r\n type: 'solid'\r\n },\r\n // The arrow at both ends the the axis.\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 15]\r\n },\r\n axisTick: {\r\n show: true,\r\n // Whether axisTick is inside the grid or outside the grid.\r\n inside: false,\r\n // The length of axisTick.\r\n length: 5,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n // Whether axisLabel is inside the grid or outside the grid.\r\n inside: false,\r\n rotate: 0,\r\n // true | false | null/undefined (auto)\r\n showMinLabel: null,\r\n // true | false | null/undefined (auto)\r\n showMaxLabel: null,\r\n margin: 8,\r\n // formatter: null,\r\n fontSize: 12\r\n },\r\n splitLine: {\r\n show: true,\r\n showMinLine: true,\r\n showMaxLine: true,\r\n lineStyle: {\r\n color: ['#E0E6F1'],\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n splitArea: {\r\n show: false,\r\n areaStyle: {\r\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\r\n }\r\n }\r\n};\r\n\r\n\r\nconst categoryAxis: AxisBaseOption = zrUtil.merge({\r\n // The gap at both ends of the axis. For categoryAxis, boolean.\r\n boundaryGap: true,\r\n // Set false to faster category collection.\r\n deduplication: null,\r\n // splitArea: {\r\n // show: false\r\n // },\r\n splitLine: {\r\n show: false\r\n },\r\n axisTick: {\r\n // If tick is align with label when boundaryGap is true\r\n alignWithLabel: false,\r\n interval: 'auto'\r\n },\r\n axisLabel: {\r\n interval: 'auto'\r\n }\r\n}, defaultOption);\r\n\r\nconst valueAxis: AxisBaseOption = zrUtil.merge({\r\n boundaryGap: [0, 0],\r\n\r\n axisLine: {\r\n // Not shown when other axis is categoryAxis in cartesian\r\n show: 'auto'\r\n },\r\n axisTick: {\r\n // Not shown when other axis is categoryAxis in cartesian\r\n show: 'auto'\r\n },\r\n\r\n // TODO\r\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\r\n\r\n splitNumber: 5,\r\n\r\n minorTick: {\r\n // Minor tick, not available for cateogry axis.\r\n show: false,\r\n // Split number of minor ticks. The value should be in range of (0, 100)\r\n splitNumber: 5,\r\n // Length of minor tick\r\n length: 3,\r\n\r\n // Line style\r\n lineStyle: {\r\n // Default to be same with axisTick\r\n }\r\n },\r\n\r\n minorSplitLine: {\r\n show: false,\r\n\r\n lineStyle: {\r\n color: '#F4F7FD',\r\n width: 1\r\n }\r\n }\r\n}, defaultOption);\r\n\r\nconst timeAxis: AxisBaseOption = zrUtil.merge({\r\n splitNumber: 6,\r\n axisLabel: {\r\n // To eliminate labels that are not nice\r\n showMinLabel: false,\r\n showMaxLabel: false,\r\n rich: {\r\n primary: {\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n splitLine: {\r\n show: false\r\n }\r\n}, valueAxis);\r\n\r\nconst logAxis: AxisBaseOption = zrUtil.defaults({\r\n logBase: 10\r\n}, valueAxis);\r\n\r\n\r\nexport default {\r\n category: categoryAxis,\r\n value: valueAxis,\r\n time: timeAxis,\r\n log: logAxis\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { TextAlign, TextVerticalAlign } from 'zrender/src/core/types';\r\nimport {\r\n TextCommonOption, LineStyleOption, OrdinalRawValue, ZRColor,\r\n AreaStyleOption, ComponentOption, ColorString,\r\n AnimationOptionMixin, Dictionary, ScaleDataValue, CommonAxisPointerOption\r\n} from '../util/types';\r\nimport { TextStyleProps } from 'zrender/src/graphic/Text';\r\n\r\n\r\nexport const AXIS_TYPES = {value: 1, category: 1, time: 1, log: 1} as const;\r\nexport type OptionAxisType = keyof typeof AXIS_TYPES;\r\n\r\nexport interface AxisBaseOptionCommon extends ComponentOption,\r\n AnimationOptionMixin {\r\n type?: OptionAxisType;\r\n show?: boolean;\r\n // Inverse the axis.\r\n inverse?: boolean;\r\n // Axis name displayed.\r\n name?: string;\r\n nameLocation?: 'start' | 'middle' | 'end';\r\n // By degree.\r\n nameRotate?: number;\r\n nameTruncate?: {\r\n maxWidth?: number;\r\n ellipsis?: string;\r\n placeholder?: string;\r\n };\r\n nameTextStyle?: AxisNameTextStyleOption;\r\n // The gap between axisName and axisLine.\r\n nameGap?: number;\r\n\r\n silent?: boolean;\r\n triggerEvent?: boolean;\r\n\r\n tooltip?: {\r\n show?: boolean;\r\n };\r\n\r\n axisLabel?: AxisLabelBaseOption;\r\n\r\n axisPointer?: CommonAxisPointerOption;\r\n axisLine?: AxisLineOption;\r\n axisTick?: AxisTickOption;\r\n minorTick?: MinorTickOption;\r\n splitLine?: SplitLineOption;\r\n minorSplitLine?: MinorSplitLineOption;\r\n splitArea?: SplitAreaOption;\r\n\r\n /**\r\n * Min value of the axis. can be:\r\n * + ScaleDataValue\r\n * + 'dataMin': use the min value in data.\r\n * + null/undefined: auto decide min value (consider pretty look and boundaryGap).\r\n */\r\n min?: ScaleDataValue | 'dataMin' | ((extent: {min: number, max: number}) => ScaleDataValue);\r\n /**\r\n * Max value of the axis. can be:\r\n * + ScaleDataValue\r\n * + 'dataMax': use the max value in data.\r\n * + null/undefined: auto decide max value (consider pretty look and boundaryGap).\r\n */\r\n max?: ScaleDataValue | 'dataMax' | ((extent: {min: number, max: number}) => ScaleDataValue);\r\n startValue?: number;\r\n\r\n}\r\n\r\nexport interface NumericAxisBaseOptionCommon extends AxisBaseOptionCommon {\r\n /*\r\n * The gap at both ends of the axis.\r\n * [GAP, GAP], where\r\n * `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`)\r\n */\r\n boundaryGap?: [number | string, number | string]\r\n\r\n /**\r\n * AxisTick and axisLabel and splitLine are calculated based on splitNumber.\r\n */\r\n splitNumber?: number;\r\n /**\r\n * Interval specifies the span of the ticks is mandatorily.\r\n */\r\n interval?: number;\r\n /**\r\n * Specify min interval when auto calculate tick interval.\r\n */\r\n minInterval?: number;\r\n /**\r\n * Specify max interval when auto calculate tick interval.\r\n */\r\n maxInterval?: number;\r\n\r\n /**\r\n * If align ticks to the first axis that is not use alignTicks\r\n * If all axes has alignTicks: true. The first one will be applied.\r\n *\r\n * Will be ignored if interval is set.\r\n */\r\n alignTicks?: boolean\r\n}\r\n\r\nexport interface CategoryAxisBaseOption extends AxisBaseOptionCommon {\r\n type?: 'category';\r\n boundaryGap?: boolean\r\n axisLabel?: AxisLabelOption<'category'> & {\r\n interval?: 'auto' | number | ((index: number, value: string) => boolean)\r\n };\r\n data?: (OrdinalRawValue | {\r\n value: OrdinalRawValue;\r\n textStyle?: TextCommonOption;\r\n })[];\r\n /*\r\n * Set false to faster category collection.\r\n * Only useful in the case like: category is\r\n * ['2012-01-01', '2012-01-02', ...], where the input\r\n * data has been ensured not duplicate and is large data.\r\n * null means \"auto\":\r\n * if axis.data provided, do not deduplication,\r\n * else do deduplication.\r\n */\r\n deduplication?: boolean;\r\n\r\n axisTick?: AxisBaseOptionCommon['axisTick'] & {\r\n // If tick is align with label when boundaryGap is true\r\n alignWithLabel?: boolean,\r\n interval?: 'auto' | number | ((index: number, value: string) => boolean)\r\n }\r\n}\r\nexport interface ValueAxisBaseOption extends NumericAxisBaseOptionCommon {\r\n type?: 'value';\r\n axisLabel?: AxisLabelOption<'value'>;\r\n\r\n /**\r\n * Optional value can be:\r\n * + `false`: always include value 0.\r\n * + `true`: the axis may not contain zero position.\r\n */\r\n scale?: boolean;\r\n}\r\nexport interface LogAxisBaseOption extends NumericAxisBaseOptionCommon {\r\n type?: 'log';\r\n axisLabel?: AxisLabelOption<'log'>;\r\n logBase?: number;\r\n}\r\nexport interface TimeAxisBaseOption extends NumericAxisBaseOptionCommon {\r\n type?: 'time';\r\n axisLabel?: AxisLabelOption<'time'>;\r\n}\r\ninterface AxisNameTextStyleOption extends TextCommonOption {\r\n rich?: Dictionary\r\n}\r\n\r\ninterface AxisLineOption {\r\n show?: boolean | 'auto',\r\n onZero?: boolean,\r\n onZeroAxisIndex?: number,\r\n // The arrow at both ends the the axis.\r\n symbol?: string | [string, string],\r\n symbolSize?: number[],\r\n symbolOffset?: string | number | (string | number)[],\r\n lineStyle?: LineStyleOption,\r\n}\r\n\r\ninterface AxisTickOption {\r\n show?: boolean | 'auto',\r\n // Whether axisTick is inside the grid or outside the grid.\r\n inside?: boolean,\r\n // The length of axisTick.\r\n length?: number,\r\n lineStyle?: LineStyleOption,\r\n customValues?: (number | string | Date)[]\r\n}\r\n\r\ntype AxisLabelValueFormatter = (value: number, index: number) => string;\r\ntype AxisLabelCategoryFormatter = (value: string, index: number) => string;\r\n\r\n// export type AxisLabelFormatterOption = string | ((value: OrdinalRawValue | number, index: number) => string);\r\ntype TimeAxisLabelUnitFormatter = AxisLabelValueFormatter | string[] | string;\r\n\r\nexport type TimeAxisLabelFormatterOption = string\r\n | ((value: number, index: number, extra: {level: number}) => string)\r\n | {\r\n year?: TimeAxisLabelUnitFormatter,\r\n month?: TimeAxisLabelUnitFormatter,\r\n week?: TimeAxisLabelUnitFormatter,\r\n day?: TimeAxisLabelUnitFormatter,\r\n hour?: TimeAxisLabelUnitFormatter,\r\n minute?: TimeAxisLabelUnitFormatter,\r\n second?: TimeAxisLabelUnitFormatter,\r\n millisecond?: TimeAxisLabelUnitFormatter,\r\n inherit?: boolean\r\n };\r\n\r\ntype LabelFormatters = {\r\n value: AxisLabelValueFormatter | string\r\n log: AxisLabelValueFormatter | string\r\n category: AxisLabelCategoryFormatter | string\r\n time: TimeAxisLabelFormatterOption\r\n};\r\n\r\ninterface AxisLabelBaseOption extends Omit {\r\n show?: boolean,\r\n // Whether axisLabel is inside the grid or outside the grid.\r\n inside?: boolean,\r\n rotate?: number,\r\n // true | false | null/undefined (auto)\r\n showMinLabel?: boolean,\r\n // true | false | null/undefined (auto)\r\n showMaxLabel?: boolean,\r\n // 'left' | 'center' | 'right' | null/undefined (auto)\r\n alignMinLabel?: TextAlign,\r\n // 'left' | 'center' | 'right' | null/undefined (auto)\r\n alignMaxLabel?: TextAlign,\r\n // 'top' | 'middle' | 'bottom' | null/undefined (auto)\r\n verticalAlignMinLabel?: TextVerticalAlign,\r\n // 'top' | 'middle' | 'bottom' | null/undefined (auto)\r\n verticalAlignMaxLabel?: TextVerticalAlign,\r\n margin?: number,\r\n rich?: Dictionary\r\n /**\r\n * If hide overlapping labels.\r\n */\r\n hideOverlap?: boolean,\r\n customValues?: (number | string | Date)[],\r\n // Color can be callback\r\n color?: ColorString | ((value?: string | number, index?: number) => ColorString),\r\n overflow?: TextStyleProps['overflow']\r\n}\r\ninterface AxisLabelOption extends AxisLabelBaseOption {\r\n formatter?: LabelFormatters[TType]\r\n}\r\n\r\ninterface MinorTickOption {\r\n show?: boolean,\r\n splitNumber?: number,\r\n length?: number,\r\n lineStyle?: LineStyleOption\r\n}\r\n\r\ninterface SplitLineOption {\r\n show?: boolean,\r\n interval?: 'auto' | number | ((index:number, value: string) => boolean),\r\n // true | false\r\n showMinLine?: boolean,\r\n // true | false\r\n showMaxLine?: boolean,\r\n // colors will display in turn\r\n lineStyle?: LineStyleOption\r\n}\r\n\r\ninterface MinorSplitLineOption {\r\n show?: boolean,\r\n lineStyle?: LineStyleOption\r\n}\r\n\r\ninterface SplitAreaOption {\r\n show?: boolean,\r\n interval?: 'auto' | number | ((index:number, value: string) => boolean)\r\n // colors will display in turn\r\n areaStyle?: AreaStyleOption\r\n}\r\n\r\nexport type AxisBaseOption = ValueAxisBaseOption | LogAxisBaseOption\r\n | CategoryAxisBaseOption | TimeAxisBaseOption | AxisBaseOptionCommon;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport axisDefault from './axisDefault';\r\nimport ComponentModel from '../model/Component';\r\nimport {\r\n getLayoutParams,\r\n mergeLayoutParam,\r\n fetchLayoutMode\r\n} from '../util/layout';\r\nimport OrdinalMeta from '../data/OrdinalMeta';\r\nimport { DimensionName, BoxLayoutOptionMixin, OrdinalRawValue } from '../util/types';\r\nimport { AxisBaseOption, AXIS_TYPES, CategoryAxisBaseOption } from './axisCommonTypes';\r\nimport GlobalModel from '../model/Global';\r\nimport { each, merge } from 'zrender/src/core/util';\r\nimport { EChartsExtensionInstallRegisters } from '../extension';\r\n\r\n\r\ntype Constructor = new (...args: any[]) => T;\r\n\r\nexport interface AxisModelExtendedInCreator {\r\n getCategories(rawData?: boolean): OrdinalRawValue[] | CategoryAxisBaseOption['data']\r\n getOrdinalMeta(): OrdinalMeta\r\n}\r\n\r\n/**\r\n * Generate sub axis model class\r\n * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...\r\n */\r\nexport default function axisModelCreator<\r\n AxisOptionT extends AxisBaseOption,\r\n AxisModelCtor extends Constructor>\r\n>(\r\n registers: EChartsExtensionInstallRegisters,\r\n axisName: DimensionName,\r\n BaseAxisModelClass: AxisModelCtor,\r\n extraDefaultOption?: AxisOptionT\r\n) {\r\n\r\n each(AXIS_TYPES, function (v, axisType) {\r\n\r\n const defaultOption = merge(\r\n merge({}, axisDefault[axisType], true),\r\n extraDefaultOption, true\r\n );\r\n\r\n class AxisModel extends BaseAxisModelClass implements AxisModelExtendedInCreator {\r\n\r\n static type = axisName + 'Axis.' + axisType;\r\n type = axisName + 'Axis.' + axisType;\r\n\r\n static defaultOption = defaultOption;\r\n\r\n private __ordinalMeta: OrdinalMeta;\r\n\r\n\r\n mergeDefaultAndTheme(option: AxisOptionT, ecModel: GlobalModel): void {\r\n const layoutMode = fetchLayoutMode(this);\r\n const inputPositionParams = layoutMode\r\n ? getLayoutParams(option as BoxLayoutOptionMixin) : {};\r\n\r\n const themeModel = ecModel.getTheme();\r\n merge(option, themeModel.get(axisType + 'Axis'));\r\n merge(option, this.getDefaultOption());\r\n\r\n option.type = getAxisType(option);\r\n\r\n if (layoutMode) {\r\n mergeLayoutParam(option as BoxLayoutOptionMixin, inputPositionParams, layoutMode);\r\n }\r\n }\r\n\r\n optionUpdated(): void {\r\n const thisOption = this.option;\r\n if (thisOption.type === 'category') {\r\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\r\n }\r\n }\r\n\r\n /**\r\n * Should not be called before all of 'getInitailData' finished.\r\n * Because categories are collected during initializing data.\r\n */\r\n getCategories(rawData?: boolean): OrdinalRawValue[] | CategoryAxisBaseOption['data'] {\r\n const option = this.option;\r\n // FIXME\r\n // warning if called before all of 'getInitailData' finished.\r\n if (option.type === 'category') {\r\n if (rawData) {\r\n return (option as CategoryAxisBaseOption).data;\r\n }\r\n return this.__ordinalMeta.categories;\r\n }\r\n }\r\n\r\n getOrdinalMeta(): OrdinalMeta {\r\n return this.__ordinalMeta;\r\n }\r\n }\r\n\r\n registers.registerComponentModel(AxisModel);\r\n });\r\n\r\n registers.registerSubTypeDefaulter(\r\n axisName + 'Axis',\r\n getAxisType\r\n );\r\n}\r\n\r\nfunction getAxisType(option: AxisBaseOption) {\r\n // Default axis with data is category axis\r\n return option.type || ((option as CategoryAxisBaseOption).data ? 'category' : 'value');\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { DimensionName } from '../../util/types';\r\nimport Axis from '../Axis';\r\n\r\n\r\nclass Cartesian {\r\n\r\n readonly type: string = 'cartesian';\r\n\r\n readonly name: string;\r\n\r\n private _dimList: DimensionName[] = [];\r\n\r\n private _axes: {[dimName: string]: AxisT} = {};\r\n\r\n\r\n constructor(name: string) {\r\n this.name = name || '';\r\n }\r\n\r\n getAxis(dim: DimensionName): AxisT {\r\n return this._axes[dim];\r\n }\r\n\r\n getAxes(): AxisT[] {\r\n return zrUtil.map(this._dimList, function (dim: DimensionName) {\r\n return this._axes[dim];\r\n }, this);\r\n }\r\n\r\n getAxesByScale(scaleType: string): AxisT[] {\r\n scaleType = scaleType.toLowerCase();\r\n return zrUtil.filter(\r\n this.getAxes(),\r\n function (axis) {\r\n return axis.scale.type === scaleType;\r\n }\r\n );\r\n }\r\n\r\n addAxis(axis: AxisT): void {\r\n const dim = axis.dim;\r\n\r\n this._axes[dim] = axis;\r\n\r\n this._dimList.push(dim);\r\n }\r\n\r\n\r\n // FIXME:TS Never used. So comment `dataToCoord` and `coordToData`.\r\n // /**\r\n // * Convert data to coord in nd space\r\n // * @param {Array.|Object.} val\r\n // * @return {Array.|Object.}\r\n // */\r\n // dataToCoord(val) {\r\n // return this._dataCoordConvert(val, 'dataToCoord');\r\n // }\r\n\r\n // /**\r\n // * Convert coord in nd space to data\r\n // * @param {Array.|Object.} val\r\n // * @return {Array.|Object.}\r\n // */\r\n // coordToData(val) {\r\n // return this._dataCoordConvert(val, 'coordToData');\r\n // }\r\n\r\n // _dataCoordConvert(input, method) {\r\n // let dimList = this._dimList;\r\n\r\n // let output = input instanceof Array ? [] : {};\r\n\r\n // for (let i = 0; i < dimList.length; i++) {\r\n // let dim = dimList[i];\r\n // let axis = this._axes[dim];\r\n\r\n // output[dim] = axis[method](input[dim]);\r\n // }\r\n\r\n // return output;\r\n // }\r\n};\r\n\r\nexport default Cartesian;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport Cartesian from './Cartesian';\r\nimport { ScaleDataValue } from '../../util/types';\r\nimport Axis2D from './Axis2D';\r\nimport { CoordinateSystem } from '../CoordinateSystem';\r\nimport GridModel from './GridModel';\r\nimport Grid from './Grid';\r\nimport Scale from '../../scale/Scale';\r\nimport { invert } from 'zrender/src/core/matrix';\r\nimport { applyTransform } from 'zrender/src/core/vector';\r\n\r\nexport const cartesian2DDimensions = ['x', 'y'];\r\n\r\nfunction canCalculateAffineTransform(scale: Scale) {\r\n return scale.type === 'interval' || scale.type === 'time';\r\n}\r\n\r\nclass Cartesian2D extends Cartesian implements CoordinateSystem {\r\n\r\n readonly type = 'cartesian2d';\r\n\r\n readonly dimensions = cartesian2DDimensions;\r\n\r\n model: GridModel;\r\n\r\n master: Grid;\r\n\r\n private _transform: number[];\r\n private _invTransform: number[];\r\n\r\n /**\r\n * Calculate an affine transform matrix if two axes are time or value.\r\n * It's mainly for accelartion on the large time series data.\r\n */\r\n calcAffineTransform() {\r\n this._transform = this._invTransform = null;\r\n\r\n const xAxisScale = this.getAxis('x').scale;\r\n const yAxisScale = this.getAxis('y').scale;\r\n\r\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\r\n return;\r\n }\r\n\r\n const xScaleExtent = xAxisScale.getExtent();\r\n const yScaleExtent = yAxisScale.getExtent();\r\n\r\n const start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\r\n const end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\r\n\r\n const xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\r\n const yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\r\n\r\n if (!xScaleSpan || !yScaleSpan) {\r\n return;\r\n }\r\n // Accelerate data to point calculation on the special large time series data.\r\n const scaleX = (end[0] - start[0]) / xScaleSpan;\r\n const scaleY = (end[1] - start[1]) / yScaleSpan;\r\n const translateX = start[0] - xScaleExtent[0] * scaleX;\r\n const translateY = start[1] - yScaleExtent[0] * scaleY;\r\n\r\n const m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\r\n this._invTransform = invert([], m);\r\n }\r\n\r\n /**\r\n * Base axis will be used on stacking.\r\n */\r\n getBaseAxis(): Axis2D {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAxis('x');\r\n }\r\n\r\n containPoint(point: number[]): boolean {\r\n const axisX = this.getAxis('x');\r\n const axisY = this.getAxis('y');\r\n return axisX.contain(axisX.toLocalCoord(point[0]))\r\n && axisY.contain(axisY.toLocalCoord(point[1]));\r\n }\r\n\r\n containData(data: ScaleDataValue[]): boolean {\r\n return this.getAxis('x').containData(data[0])\r\n && this.getAxis('y').containData(data[1]);\r\n }\r\n\r\n containZone(data1: ScaleDataValue[], data2: ScaleDataValue[]): boolean {\r\n const zoneDiag1 = this.dataToPoint(data1);\r\n const zoneDiag2 = this.dataToPoint(data2);\r\n const area = this.getArea();\r\n const zone = new BoundingRect(\r\n zoneDiag1[0],\r\n zoneDiag1[1],\r\n zoneDiag2[0] - zoneDiag1[0],\r\n zoneDiag2[1] - zoneDiag1[1]);\r\n return area.intersect(zone);\r\n }\r\n\r\n dataToPoint(data: ScaleDataValue[], clamp?: boolean, out?: number[]): number[] {\r\n out = out || [];\r\n const xVal = data[0];\r\n const yVal = data[1];\r\n // Fast path\r\n if (this._transform\r\n // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated.\r\n && xVal != null\r\n && isFinite(xVal as number)\r\n && yVal != null\r\n && isFinite(yVal as number)\r\n ) {\r\n return applyTransform(out, data as number[], this._transform);\r\n }\r\n const xAxis = this.getAxis('x');\r\n const yAxis = this.getAxis('y');\r\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp));\r\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp));\r\n return out;\r\n }\r\n\r\n clampData(data: ScaleDataValue[], out?: number[]): number[] {\r\n const xScale = this.getAxis('x').scale;\r\n const yScale = this.getAxis('y').scale;\r\n const xAxisExtent = xScale.getExtent();\r\n const yAxisExtent = yScale.getExtent();\r\n const x = xScale.parse(data[0]);\r\n const y = yScale.parse(data[1]);\r\n out = out || [];\r\n out[0] = Math.min(\r\n Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x),\r\n Math.max(xAxisExtent[0], xAxisExtent[1])\r\n );\r\n out[1] = Math.min(\r\n Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y),\r\n Math.max(yAxisExtent[0], yAxisExtent[1])\r\n );\r\n\r\n return out;\r\n }\r\n\r\n pointToData(point: number[], clamp?: boolean): number[] {\r\n const out: number[] = [];\r\n if (this._invTransform) {\r\n return applyTransform(out, point, this._invTransform);\r\n }\r\n const xAxis = this.getAxis('x');\r\n const yAxis = this.getAxis('y');\r\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp);\r\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp);\r\n return out;\r\n }\r\n\r\n getOtherAxis(axis: Axis2D): Axis2D {\r\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\r\n }\r\n\r\n /**\r\n * Get rect area of cartesian.\r\n * Area will have a contain function to determine if a point is in the coordinate system.\r\n */\r\n getArea(tolerance?: number): Cartesian2DArea {\r\n tolerance = tolerance || 0;\r\n\r\n const xExtent = this.getAxis('x').getGlobalExtent();\r\n const yExtent = this.getAxis('y').getGlobalExtent();\r\n const x = Math.min(xExtent[0], xExtent[1]) - tolerance;\r\n const y = Math.min(yExtent[0], yExtent[1]) - tolerance;\r\n const width = Math.max(xExtent[0], xExtent[1]) - x + tolerance;\r\n const height = Math.max(yExtent[0], yExtent[1]) - y + tolerance;\r\n\r\n return new BoundingRect(x, y, width, height);\r\n }\r\n\r\n};\r\n\r\ninterface Cartesian2DArea extends BoundingRect {}\r\n\r\nexport default Cartesian2D;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Axis from '../Axis';\r\nimport { DimensionName, OrdinalSortInfo } from '../../util/types';\r\nimport Scale from '../../scale/Scale';\r\nimport CartesianAxisModel, { CartesianAxisPosition } from './AxisModel';\r\nimport Grid from './Grid';\r\nimport { OptionAxisType } from '../axisCommonTypes';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\n\r\n\r\ninterface Axis2D {\r\n /**\r\n * Transform global coord to local coord,\r\n * i.e. let localCoord = axis.toLocalCoord(80);\r\n */\r\n toLocalCoord(coord: number): number;\r\n\r\n /**\r\n * Transform global coord to local coord,\r\n * i.e. let globalCoord = axis.toLocalCoord(40);\r\n */\r\n toGlobalCoord(coord: number): number;\r\n}\r\nclass Axis2D extends Axis {\r\n\r\n /**\r\n * Axis position\r\n * - 'top'\r\n * - 'bottom'\r\n * - 'left'\r\n * - 'right'\r\n */\r\n readonly position: CartesianAxisPosition;\r\n\r\n /**\r\n * Index of axis, can be used as key\r\n * Injected outside.\r\n */\r\n index: number = 0;\r\n\r\n /**\r\n * Axis model. Injected outside\r\n */\r\n model: CartesianAxisModel;\r\n\r\n /**\r\n * Injected outside.\r\n */\r\n grid: Grid;\r\n\r\n\r\n constructor(\r\n dim: DimensionName,\r\n scale: Scale,\r\n coordExtent: [number, number],\r\n axisType?: OptionAxisType,\r\n position?: CartesianAxisPosition\r\n ) {\r\n super(dim, scale, coordExtent);\r\n this.type = axisType || 'value';\r\n this.position = position || 'bottom';\r\n }\r\n\r\n /**\r\n * Implemented in .\r\n * @return If not on zero of other axis, return null/undefined.\r\n * If no axes, return an empty array.\r\n */\r\n getAxesOnZeroOf: () => Axis2D[];\r\n\r\n isHorizontal(): boolean {\r\n const position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n }\r\n\r\n /**\r\n * Each item cooresponds to this.getExtent(), which\r\n * means globalExtent[0] may greater than globalExtent[1],\r\n * unless `asc` is input.\r\n *\r\n * @param {boolean} [asc]\r\n * @return {Array.}\r\n */\r\n getGlobalExtent(asc?: boolean): [number, number] {\r\n const ret = this.getExtent();\r\n ret[0] = this.toGlobalCoord(ret[0]);\r\n ret[1] = this.toGlobalCoord(ret[1]);\r\n asc && ret[0] > ret[1] && ret.reverse();\r\n return ret;\r\n }\r\n\r\n pointToData(point: number[], clamp?: boolean): number {\r\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\r\n }\r\n\r\n /**\r\n * Set ordinalSortInfo\r\n * @param info new OrdinalSortInfo\r\n */\r\n setCategorySortInfo(info: OrdinalSortInfo): boolean {\r\n if (this.type !== 'category') {\r\n return false;\r\n }\r\n\r\n this.model.option.categorySortInfo = info;\r\n (this.scale as OrdinalScale).setSortInfo(info);\r\n }\r\n\r\n}\r\n\r\nexport default Axis2D;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GridModel from './GridModel';\r\nimport CartesianAxisModel from './AxisModel';\r\nimport SeriesModel from '../../model/Series';\r\nimport { SINGLE_REFERRING } from '../../util/model';\r\n\r\ninterface CartesianAxisLayout {\r\n position: [number, number];\r\n rotation: number;\r\n labelOffset: number;\r\n labelDirection: -1 | 1;\r\n tickDirection: -1 | 1;\r\n nameDirection: -1 | 1;\r\n labelRotate: number;\r\n z2: number;\r\n}\r\n\r\n/**\r\n * Can only be called after coordinate system creation stage.\r\n * (Can be called before coordinate system update stage).\r\n */\r\nexport function layout(\r\n gridModel: GridModel, axisModel: CartesianAxisModel, opt?: {labelInside?: boolean}\r\n): CartesianAxisLayout {\r\n opt = opt || {};\r\n const grid = gridModel.coordinateSystem;\r\n const axis = axisModel.axis;\r\n const layout = {} as CartesianAxisLayout;\r\n const otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\r\n\r\n const rawAxisPosition = axis.position;\r\n const axisPosition: 'onZero' | typeof axis.position = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\r\n const axisDim = axis.dim;\r\n\r\n const rect = grid.getRect();\r\n const rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n const idx = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2};\r\n const axisOffset = axisModel.get('offset') || 0;\r\n\r\n const posBound = axisDim === 'x'\r\n ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]\r\n : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\r\n\r\n if (otherAxisOnZeroOf) {\r\n const onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\r\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\r\n }\r\n\r\n // Axis position\r\n layout.position = [\r\n axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],\r\n axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]\r\n ];\r\n\r\n // Axis rotation\r\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1);\r\n\r\n // Tick and label direction, x y is axisDim\r\n const dirMap = {top: -1, bottom: 1, left: -1, right: 1} as const;\r\n\r\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\r\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\r\n\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection as 1 | -1;\r\n }\r\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection as 1 | -1;\r\n }\r\n\r\n // Special label rotation\r\n const labelRotate = axisModel.get(['axisLabel', 'rotate']);\r\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;\r\n\r\n // Over splitLine and splitArea\r\n layout.z2 = 1;\r\n\r\n return layout;\r\n}\r\n\r\nexport function isCartesian2DSeries(seriesModel: SeriesModel): boolean {\r\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\r\n}\r\n\r\nexport function findAxisModels(seriesModel: SeriesModel): {\r\n xAxisModel: CartesianAxisModel;\r\n yAxisModel: CartesianAxisModel;\r\n} {\r\n const axisModelMap = {\r\n xAxisModel: null,\r\n yAxisModel: null\r\n } as ReturnType;\r\n zrUtil.each(axisModelMap, function (v, key) {\r\n const axisType = key.replace(/Model$/, '');\r\n const axisModel = seriesModel.getReferringComponents(\r\n axisType, SINGLE_REFERRING\r\n ).models[0] as CartesianAxisModel;\r\n\r\n if (__DEV__) {\r\n if (!axisModel) {\r\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(\r\n seriesModel.get(axisType + 'Index' as any),\r\n seriesModel.get(axisType + 'Id' as any),\r\n 0\r\n ) + '\" not found');\r\n }\r\n }\r\n\r\n axisModelMap[key] = axisModel;\r\n });\r\n\r\n return axisModelMap;\r\n}\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { NumericAxisBaseOptionCommon } from './axisCommonTypes';\r\nimport { getPrecisionSafe, round } from '../util/number';\r\nimport IntervalScale from '../scale/Interval';\r\nimport { getScaleExtent } from './axisHelper';\r\nimport { AxisBaseModel } from './AxisBaseModel';\r\nimport LogScale from '../scale/Log';\r\nimport { warn } from '../util/log';\r\nimport { increaseInterval, isValueNice } from '../scale/helper';\r\n\r\nconst mathLog = Math.log;\r\n\r\n\r\nexport function alignScaleTicks(\r\n scale: IntervalScale | LogScale,\r\n axisModel: AxisBaseModel>,\r\n alignToScale: IntervalScale | LogScale\r\n) {\r\n\r\n const intervalScaleProto = IntervalScale.prototype;\r\n\r\n // NOTE: There is a precondition for log scale here:\r\n // In log scale we store _interval and _extent of exponent value.\r\n // So if we use the method of InternalScale to set/get these data.\r\n // It process the exponent value, which is linear and what we want here.\r\n const alignToTicks = intervalScaleProto.getTicks.call(alignToScale);\r\n const alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true);\r\n const alignToSplitNumber = alignToTicks.length - 1;\r\n const alignToInterval = intervalScaleProto.getInterval.call(alignToScale);\r\n\r\n const scaleExtent = getScaleExtent(scale, axisModel);\r\n let rawExtent = scaleExtent.extent;\r\n const isMinFixed = scaleExtent.fixMin;\r\n const isMaxFixed = scaleExtent.fixMax;\r\n\r\n if (scale.type === 'log') {\r\n const logBase = mathLog((scale as LogScale).base);\r\n rawExtent = [mathLog(rawExtent[0]) / logBase, mathLog(rawExtent[1]) / logBase];\r\n }\r\n\r\n scale.setExtent(rawExtent[0], rawExtent[1]);\r\n scale.calcNiceExtent({\r\n splitNumber: alignToSplitNumber,\r\n fixMin: isMinFixed,\r\n fixMax: isMaxFixed\r\n });\r\n const extent = intervalScaleProto.getExtent.call(scale);\r\n\r\n // Need to update the rawExtent.\r\n // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax'\r\n if (isMinFixed) {\r\n rawExtent[0] = extent[0];\r\n }\r\n if (isMaxFixed) {\r\n rawExtent[1] = extent[1];\r\n }\r\n\r\n let interval = intervalScaleProto.getInterval.call(scale);\r\n let min: number = rawExtent[0];\r\n let max: number = rawExtent[1];\r\n\r\n if (isMinFixed && isMaxFixed) {\r\n // User set min, max, divide to get new interval\r\n interval = (max - min) / alignToSplitNumber;\r\n }\r\n else if (isMinFixed) {\r\n max = rawExtent[0] + interval * alignToSplitNumber;\r\n // User set min, expand extent on the other side\r\n while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) {\r\n interval = increaseInterval(interval);\r\n max = rawExtent[0] + interval * alignToSplitNumber;\r\n }\r\n }\r\n else if (isMaxFixed) {\r\n // User set max, expand extent on the other side\r\n min = rawExtent[1] - interval * alignToSplitNumber;\r\n while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) {\r\n interval = increaseInterval(interval);\r\n min = rawExtent[1] - interval * alignToSplitNumber;\r\n }\r\n }\r\n else {\r\n const nicedSplitNumber = scale.getTicks().length - 1;\r\n if (nicedSplitNumber > alignToSplitNumber) {\r\n interval = increaseInterval(interval);\r\n }\r\n\r\n const range = interval * alignToSplitNumber;\r\n max = Math.ceil(rawExtent[1] / interval) * interval;\r\n min = round(max - range);\r\n // Not change the result that crossing zero.\r\n if (min < 0 && rawExtent[0] >= 0) {\r\n min = 0;\r\n max = round(range);\r\n }\r\n else if (max > 0 && rawExtent[1] <= 0) {\r\n max = 0;\r\n min = -round(range);\r\n }\r\n\r\n }\r\n\r\n // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale\r\n const t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;\r\n const t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval;\r\n\r\n // NOTE: Must in setExtent -> setInterval -> setNiceExtent order.\r\n intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1);\r\n intervalScaleProto.setInterval.call(scale, interval);\r\n if (t0 || t1) {\r\n intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval);\r\n }\r\n\r\n if (__DEV__) {\r\n const ticks = intervalScaleProto.getTicks.call(scale);\r\n if (ticks[1]\r\n && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) {\r\n warn(\r\n // eslint-disable-next-line\r\n `The ticks may be not readable when set min: ${axisModel.get('min')}, max: ${axisModel.get('max')} and alignTicks: true`\r\n );\r\n }\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Grid is a region which contains at most 4 cartesian systems\r\n *\r\n * TODO Default cartesian\r\n */\r\n\r\nimport {isObject, each, indexOf, retrieve3, keys} from 'zrender/src/core/util';\r\nimport {getLayoutRect, LayoutRect} from '../../util/layout';\r\nimport {\r\n createScaleByModel,\r\n ifAxisCrossZero,\r\n niceScaleExtent,\r\n estimateLabelUnionRect,\r\n getDataDimensionsOnAxis\r\n} from '../../coord/axisHelper';\r\nimport Cartesian2D, {cartesian2DDimensions} from './Cartesian2D';\r\nimport Axis2D from './Axis2D';\r\nimport {ParsedModelFinder, ParsedModelFinderKnown, SINGLE_REFERRING} from '../../util/model';\r\n\r\n// Depends on GridModel, AxisModel, which performs preprocess.\r\nimport GridModel from './GridModel';\r\nimport CartesianAxisModel from './AxisModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport {CoordinateSystemMaster} from '../CoordinateSystem';\r\nimport { ScaleDataValue } from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\nimport { isCartesian2DSeries, findAxisModels } from './cartesianAxisHelper';\r\nimport { CategoryAxisBaseOption, NumericAxisBaseOptionCommon } from '../axisCommonTypes';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport { isIntervalOrLogScale } from '../../scale/helper';\r\nimport { alignScaleTicks } from '../axisAlignTicks';\r\nimport IntervalScale from '../../scale/Interval';\r\nimport LogScale from '../../scale/Log';\r\n\r\n\r\ntype Cartesian2DDimensionName = 'x' | 'y';\r\n\r\ntype FinderAxisIndex = {xAxisIndex?: number, yAxisIndex?: number};\r\ntype AxesMap = {\r\n x: Axis2D[],\r\n y: Axis2D[]\r\n};\r\n\r\nclass Grid implements CoordinateSystemMaster {\r\n\r\n // FIXME:TS where used (different from registered type 'cartesian2d')?\r\n readonly type: string = 'grid';\r\n\r\n private _coordsMap: Dictionary = {};\r\n private _coordsList: Cartesian2D[] = [];\r\n private _axesMap: AxesMap = {} as AxesMap;\r\n private _axesList: Axis2D[] = [];\r\n private _rect: LayoutRect;\r\n\r\n readonly model: GridModel;\r\n readonly axisPointerEnabled = true;\r\n\r\n // Injected:\r\n name: string;\r\n\r\n // For deciding which dimensions to use when creating list data\r\n static dimensions = cartesian2DDimensions;\r\n readonly dimensions = cartesian2DDimensions;\r\n\r\n constructor(gridModel: GridModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._initCartesian(gridModel, ecModel, api);\r\n this.model = gridModel;\r\n }\r\n\r\n getRect(): LayoutRect {\r\n return this._rect;\r\n }\r\n\r\n update(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n\r\n const axesMap = this._axesMap;\r\n\r\n this._updateScale(ecModel, this.model);\r\n\r\n function updateAxisTicks(axes: Record) {\r\n let alignTo: Axis2D;\r\n // Axis is added in order of axisIndex.\r\n const axesIndices = keys(axes);\r\n const len = axesIndices.length;\r\n if (!len) {\r\n return;\r\n }\r\n const axisNeedsAlign: Axis2D[] = [];\r\n // Process once and calculate the ticks for those don't use alignTicks.\r\n for (let i = len - 1; i >= 0; i--) {\r\n const idx = +axesIndices[i]; // Convert to number.\r\n const axis = axes[idx];\r\n const model = axis.model as AxisBaseModel;\r\n const scale = axis.scale;\r\n if (// Only value and log axis without interval support alignTicks.\r\n isIntervalOrLogScale(scale)\r\n && model.get('alignTicks')\r\n && model.get('interval') == null\r\n ) {\r\n axisNeedsAlign.push(axis);\r\n }\r\n else {\r\n niceScaleExtent(scale, model);\r\n if (isIntervalOrLogScale(scale)) { // Can only align to interval or log axis.\r\n alignTo = axis;\r\n }\r\n }\r\n };\r\n // All axes has set alignTicks. Pick the first one.\r\n // PENDING. Should we find the axis that both set interval, min, max and align to this one?\r\n if (axisNeedsAlign.length) {\r\n if (!alignTo) {\r\n alignTo = axisNeedsAlign.pop();\r\n niceScaleExtent(alignTo.scale, alignTo.model);\r\n }\r\n\r\n each(axisNeedsAlign, axis => {\r\n alignScaleTicks(\r\n axis.scale as IntervalScale | LogScale,\r\n axis.model,\r\n alignTo.scale as IntervalScale | LogScale\r\n );\r\n });\r\n }\r\n }\r\n\r\n updateAxisTicks(axesMap.x);\r\n updateAxisTicks(axesMap.y);\r\n\r\n // Key: axisDim_axisIndex, value: boolean, whether onZero target.\r\n const onZeroRecords = {} as Dictionary;\r\n\r\n each(axesMap.x, function (xAxis) {\r\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\r\n });\r\n each(axesMap.y, function (yAxis) {\r\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\r\n });\r\n\r\n // Resize again if containLabel is enabled\r\n // FIXME It may cause getting wrong grid size in data processing stage\r\n this.resize(this.model, api);\r\n }\r\n\r\n /**\r\n * Resize the grid\r\n */\r\n resize(gridModel: GridModel, api: ExtensionAPI, ignoreContainLabel?: boolean): void {\r\n\r\n const boxLayoutParams = gridModel.getBoxLayoutParams();\r\n const isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\r\n\r\n const gridRect = getLayoutRect(\r\n boxLayoutParams, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n\r\n this._rect = gridRect;\r\n\r\n const axesList = this._axesList;\r\n\r\n adjustAxes();\r\n\r\n // Minus label size\r\n if (isContainLabel) {\r\n each(axesList, function (axis) {\r\n if (!axis.model.get(['axisLabel', 'inside'])) {\r\n const labelUnionRect = estimateLabelUnionRect(axis);\r\n if (labelUnionRect) {\r\n const dim: 'height' | 'width' = axis.isHorizontal() ? 'height' : 'width';\r\n const margin = axis.model.get(['axisLabel', 'margin']);\r\n gridRect[dim] -= labelUnionRect[dim] + margin;\r\n if (axis.position === 'top') {\r\n gridRect.y += labelUnionRect.height + margin;\r\n }\r\n else if (axis.position === 'left') {\r\n gridRect.x += labelUnionRect.width + margin;\r\n }\r\n }\r\n }\r\n });\r\n\r\n adjustAxes();\r\n }\r\n\r\n each(this._coordsList, function (coord) {\r\n // Calculate affine matrix to accelerate the data to point transform.\r\n // If all the axes scales are time or value.\r\n coord.calcAffineTransform();\r\n });\r\n\r\n function adjustAxes() {\r\n each(axesList, function (axis) {\r\n const isHorizontal = axis.isHorizontal();\r\n const extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\r\n const idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\r\n });\r\n }\r\n }\r\n\r\n getAxis(dim: Cartesian2DDimensionName, axisIndex?: number): Axis2D {\r\n const axesMapOnDim = this._axesMap[dim];\r\n if (axesMapOnDim != null) {\r\n return axesMapOnDim[axisIndex || 0];\r\n }\r\n }\r\n\r\n getAxes(): Axis2D[] {\r\n return this._axesList.slice();\r\n }\r\n\r\n /**\r\n * Usage:\r\n * grid.getCartesian(xAxisIndex, yAxisIndex);\r\n * grid.getCartesian(xAxisIndex);\r\n * grid.getCartesian(null, yAxisIndex);\r\n * grid.getCartesian({xAxisIndex: ..., yAxisIndex: ...});\r\n *\r\n * When only xAxisIndex or yAxisIndex given, find its first cartesian.\r\n */\r\n getCartesian(finder: FinderAxisIndex): Cartesian2D;\r\n getCartesian(xAxisIndex?: number, yAxisIndex?: number): Cartesian2D;\r\n getCartesian(xAxisIndex?: number | FinderAxisIndex, yAxisIndex?: number) {\r\n if (xAxisIndex != null && yAxisIndex != null) {\r\n const key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n return this._coordsMap[key];\r\n }\r\n\r\n if (isObject(xAxisIndex)) {\r\n yAxisIndex = (xAxisIndex as FinderAxisIndex).yAxisIndex;\r\n xAxisIndex = (xAxisIndex as FinderAxisIndex).xAxisIndex;\r\n }\r\n for (let i = 0, coordList = this._coordsList; i < coordList.length; i++) {\r\n if (coordList[i].getAxis('x').index === xAxisIndex\r\n || coordList[i].getAxis('y').index === yAxisIndex\r\n ) {\r\n return coordList[i];\r\n }\r\n }\r\n }\r\n\r\n getCartesians(): Cartesian2D[] {\r\n return this._coordsList.slice();\r\n }\r\n\r\n /**\r\n * @implements\r\n */\r\n convertToPixel(\r\n ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]\r\n ): number | number[] {\r\n const target = this._findConvertTarget(finder);\r\n\r\n return target.cartesian\r\n ? target.cartesian.dataToPoint(value as ScaleDataValue[])\r\n : target.axis\r\n ? target.axis.toGlobalCoord(target.axis.dataToCoord(value as ScaleDataValue))\r\n : null;\r\n }\r\n\r\n /**\r\n * @implements\r\n */\r\n convertFromPixel(\r\n ecModel: GlobalModel, finder: ParsedModelFinder, value: number | number[]\r\n ): number | number[] {\r\n const target = this._findConvertTarget(finder);\r\n\r\n return target.cartesian\r\n ? target.cartesian.pointToData(value as number[])\r\n : target.axis\r\n ? target.axis.coordToData(target.axis.toLocalCoord(value as number))\r\n : null;\r\n }\r\n\r\n private _findConvertTarget(finder: ParsedModelFinderKnown): {\r\n cartesian: Cartesian2D,\r\n axis: Axis2D\r\n } {\r\n const seriesModel = finder.seriesModel;\r\n const xAxisModel = finder.xAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]);\r\n const yAxisModel = finder.yAxisModel\r\n || (seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]);\r\n const gridModel = finder.gridModel;\r\n const coordsList = this._coordsList;\r\n let cartesian: Cartesian2D;\r\n let axis;\r\n\r\n if (seriesModel) {\r\n cartesian = seriesModel.coordinateSystem as Cartesian2D;\r\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\r\n }\r\n else if (xAxisModel && yAxisModel) {\r\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\r\n }\r\n else if (xAxisModel) {\r\n axis = this.getAxis('x', xAxisModel.componentIndex);\r\n }\r\n else if (yAxisModel) {\r\n axis = this.getAxis('y', yAxisModel.componentIndex);\r\n }\r\n // Lowest priority.\r\n else if (gridModel) {\r\n const grid = gridModel.coordinateSystem;\r\n if (grid === this) {\r\n cartesian = this._coordsList[0];\r\n }\r\n }\r\n\r\n return {cartesian: cartesian, axis: axis};\r\n }\r\n\r\n /**\r\n * @implements\r\n */\r\n containPoint(point: number[]): boolean {\r\n const coord = this._coordsList[0];\r\n if (coord) {\r\n return coord.containPoint(point);\r\n }\r\n }\r\n\r\n /**\r\n * Initialize cartesian coordinate systems\r\n */\r\n private _initCartesian(\r\n gridModel: GridModel, ecModel: GlobalModel, api: ExtensionAPI\r\n ): void {\r\n const grid = this;\r\n const axisPositionUsed = {\r\n left: false,\r\n right: false,\r\n top: false,\r\n bottom: false\r\n };\r\n\r\n const axesMap = {\r\n x: {},\r\n y: {}\r\n } as AxesMap;\r\n const axesCount = {\r\n x: 0,\r\n y: 0\r\n };\r\n\r\n // Create axis\r\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\r\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\r\n\r\n if (!axesCount.x || !axesCount.y) {\r\n // Roll back when there no either x or y axis\r\n this._axesMap = {} as AxesMap;\r\n this._axesList = [];\r\n return;\r\n }\r\n\r\n this._axesMap = axesMap;\r\n\r\n // Create cartesian2d\r\n each(axesMap.x, (xAxis, xAxisIndex) => {\r\n each(axesMap.y, (yAxis, yAxisIndex) => {\r\n const key = 'x' + xAxisIndex + 'y' + yAxisIndex;\r\n const cartesian = new Cartesian2D(key);\r\n\r\n cartesian.master = this;\r\n cartesian.model = gridModel;\r\n\r\n this._coordsMap[key] = cartesian;\r\n this._coordsList.push(cartesian);\r\n\r\n cartesian.addAxis(xAxis);\r\n cartesian.addAxis(yAxis);\r\n });\r\n });\r\n\r\n function createAxisCreator(dimName: Cartesian2DDimensionName) {\r\n return function (axisModel: CartesianAxisModel, idx: number): void {\r\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\r\n return;\r\n }\r\n\r\n let axisPosition = axisModel.get('position');\r\n if (dimName === 'x') {\r\n // Fix position\r\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\r\n // Default bottom of X\r\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\r\n }\r\n }\r\n else {\r\n // Fix position\r\n if (axisPosition !== 'left' && axisPosition !== 'right') {\r\n // Default left of Y\r\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\r\n }\r\n }\r\n axisPositionUsed[axisPosition] = true;\r\n\r\n const axis = new Axis2D(\r\n dimName,\r\n createScaleByModel(axisModel),\r\n [0, 0],\r\n axisModel.get('type'),\r\n axisPosition\r\n );\r\n\r\n const isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && (axisModel as AxisBaseModel).get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n\r\n // Inject axis into axisModel\r\n axisModel.axis = axis;\r\n\r\n // Inject axisModel into axis\r\n axis.model = axisModel;\r\n\r\n // Inject grid info axis\r\n axis.grid = grid;\r\n\r\n // Index of axis, can be used as key\r\n axis.index = idx;\r\n\r\n grid._axesList.push(axis);\r\n\r\n axesMap[dimName][idx] = axis;\r\n axesCount[dimName]++;\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Update cartesian properties from series.\r\n */\r\n private _updateScale(ecModel: GlobalModel, gridModel: GridModel): void {\r\n // Reset scale\r\n each(this._axesList, function (axis) {\r\n axis.scale.setExtent(Infinity, -Infinity);\r\n if (axis.type === 'category') {\r\n const categorySortInfo = axis.model.get('categorySortInfo');\r\n (axis.scale as OrdinalScale).setSortInfo(categorySortInfo);\r\n }\r\n });\r\n\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (isCartesian2DSeries(seriesModel)) {\r\n const axesModelMap = findAxisModels(seriesModel);\r\n const xAxisModel = axesModelMap.xAxisModel;\r\n const yAxisModel = axesModelMap.yAxisModel;\r\n\r\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel)\r\n || !isAxisUsedInTheGrid(yAxisModel, gridModel)\r\n ) {\r\n return;\r\n }\r\n\r\n const cartesian = this.getCartesian(\r\n xAxisModel.componentIndex, yAxisModel.componentIndex\r\n );\r\n const data = seriesModel.getData();\r\n const xAxis = cartesian.getAxis('x');\r\n const yAxis = cartesian.getAxis('y');\r\n\r\n unionExtent(data, xAxis);\r\n unionExtent(data, yAxis);\r\n }\r\n }, this);\r\n\r\n function unionExtent(data: SeriesData, axis: Axis2D): void {\r\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\r\n axis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * @param dim 'x' or 'y' or 'auto' or null/undefined\r\n */\r\n getTooltipAxes(dim: Cartesian2DDimensionName | 'auto'): {\r\n baseAxes: Axis2D[], otherAxes: Axis2D[]\r\n } {\r\n const baseAxes = [] as Axis2D[];\r\n const otherAxes = [] as Axis2D[];\r\n\r\n each(this.getCartesians(), function (cartesian) {\r\n const baseAxis = (dim != null && dim !== 'auto')\r\n ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\r\n const otherAxis = cartesian.getOtherAxis(baseAxis);\r\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\r\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\r\n });\r\n\r\n return {baseAxes: baseAxes, otherAxes: otherAxes};\r\n }\r\n\r\n\r\n static create(ecModel: GlobalModel, api: ExtensionAPI): Grid[] {\r\n const grids = [] as Grid[];\r\n ecModel.eachComponent('grid', function (gridModel: GridModel, idx) {\r\n const grid = new Grid(gridModel, ecModel, api);\r\n grid.name = 'grid_' + idx;\r\n // dataSampling requires axis extent, so resize\r\n // should be performed in create stage.\r\n grid.resize(gridModel, api, true);\r\n\r\n gridModel.coordinateSystem = grid;\r\n\r\n grids.push(grid);\r\n });\r\n\r\n // Inject the coordinateSystems into seriesModel\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (!isCartesian2DSeries(seriesModel)) {\r\n return;\r\n }\r\n\r\n const axesModelMap = findAxisModels(seriesModel);\r\n const xAxisModel = axesModelMap.xAxisModel;\r\n const yAxisModel = axesModelMap.yAxisModel;\r\n\r\n const gridModel = xAxisModel.getCoordSysModel();\r\n\r\n if (__DEV__) {\r\n if (!gridModel) {\r\n throw new Error(\r\n 'Grid \"' + retrieve3(\r\n xAxisModel.get('gridIndex'),\r\n xAxisModel.get('gridId'),\r\n 0\r\n ) + '\" not found'\r\n );\r\n }\r\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\r\n throw new Error('xAxis and yAxis must use the same grid');\r\n }\r\n }\r\n\r\n const grid = gridModel.coordinateSystem as Grid;\r\n\r\n seriesModel.coordinateSystem = grid.getCartesian(\r\n xAxisModel.componentIndex, yAxisModel.componentIndex\r\n );\r\n });\r\n\r\n return grids;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Check if the axis is used in the specified grid.\r\n */\r\nfunction isAxisUsedInTheGrid(axisModel: CartesianAxisModel, gridModel: GridModel): boolean {\r\n return axisModel.getCoordSysModel() === gridModel;\r\n}\r\n\r\nfunction fixAxisOnZero(\r\n axesMap: AxesMap,\r\n otherAxisDim: Cartesian2DDimensionName,\r\n axis: Axis2D,\r\n // Key: see `getOnZeroRecordKey`\r\n onZeroRecords: Dictionary\r\n): void {\r\n\r\n axis.getAxesOnZeroOf = function () {\r\n // TODO: onZero of multiple axes.\r\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\r\n };\r\n\r\n // onZero can not be enabled in these two situations:\r\n // 1. When any other axis is a category axis.\r\n // 2. When no axis is cross 0 point.\r\n const otherAxes = axesMap[otherAxisDim];\r\n\r\n let otherAxisOnZeroOf: Axis2D;\r\n const axisModel = axis.model;\r\n const onZero = axisModel.get(['axisLine', 'onZero']);\r\n const onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\r\n\r\n if (!onZero) {\r\n return;\r\n }\r\n\r\n // If target axis is specified.\r\n if (onZeroAxisIndex != null) {\r\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\r\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\r\n }\r\n }\r\n else {\r\n // Find the first available other axis.\r\n for (const idx in otherAxes) {\r\n if (otherAxes.hasOwnProperty(idx)\r\n && canOnZeroToAxis(otherAxes[idx])\r\n // Consider that two Y axes on one value axis,\r\n // if both onZero, the two Y axes overlap.\r\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]\r\n ) {\r\n otherAxisOnZeroOf = otherAxes[idx];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (otherAxisOnZeroOf) {\r\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\r\n }\r\n\r\n function getOnZeroRecordKey(axis: Axis2D) {\r\n return axis.dim + '_' + axis.index;\r\n }\r\n}\r\n\r\nfunction canOnZeroToAxis(axis: Axis2D): boolean {\r\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\r\n}\r\n\r\nfunction updateAxisTransform(axis: Axis2D, coordBase: number) {\r\n const axisExtent = axis.getExtent();\r\n const axisExtentSum = axisExtent[0] + axisExtent[1];\r\n\r\n // Fast transform\r\n axis.toGlobalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n axis.toLocalCoord = axis.dim === 'x'\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return axisExtentSum - coord + coordBase;\r\n };\r\n}\r\n\r\nexport default Grid;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n retrieve, defaults, extend, each, isObject, map, isString, isNumber, isFunction, retrieve2\r\n} from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport {getECData} from '../../util/innerStore';\r\nimport {createTextStyle} from '../../label/labelStyle';\r\nimport Model from '../../model/Model';\r\nimport {isRadianAroundZero, remRadian} from '../../util/number';\r\nimport {createSymbol, normalizeSymbolOffset} from '../../util/symbol';\r\nimport * as matrixUtil from 'zrender/src/core/matrix';\r\nimport {applyTransform as v2ApplyTransform} from 'zrender/src/core/vector';\r\nimport {shouldShowAllLabels} from '../../coord/axisHelper';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport { ZRTextVerticalAlign, ZRTextAlign, ECElement, ColorString } from '../../util/types';\r\nimport { AxisBaseOption } from '../../coord/axisCommonTypes';\r\nimport Element from 'zrender/src/Element';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\nimport { prepareLayoutList, hideOverlap } from '../../label/labelLayoutHelper';\r\n\r\nconst PI = Math.PI;\r\n\r\ntype AxisIndexKey = 'xAxisIndex' | 'yAxisIndex' | 'radiusAxisIndex'\r\n | 'angleAxisIndex' | 'singleAxisIndex';\r\n\r\ntype AxisEventData = {\r\n componentType: string\r\n componentIndex: number\r\n targetType: 'axisName' | 'axisLabel'\r\n name?: string\r\n value?: string | number\r\n dataIndex?: number\r\n tickIndex?: number\r\n} & {\r\n [key in AxisIndexKey]?: number\r\n};\r\n\r\ntype AxisLabelText = graphic.Text & {\r\n __fullText: string\r\n __truncatedText: string\r\n} & ECElement;\r\n\r\nexport interface AxisBuilderCfg {\r\n position?: number[]\r\n rotation?: number\r\n /**\r\n * Used when nameLocation is 'middle' or 'center'.\r\n * 1 | -1\r\n */\r\n nameDirection?: number\r\n tickDirection?: number\r\n labelDirection?: number\r\n /**\r\n * Useful when onZero.\r\n */\r\n labelOffset?: number\r\n /**\r\n * default get from axisModel.\r\n */\r\n axisLabelShow?: boolean\r\n /**\r\n * default get from axisModel.\r\n */\r\n axisName?: string\r\n\r\n axisNameAvailableWidth?: number\r\n /**\r\n * by degree, default get from axisModel.\r\n */\r\n labelRotate?: number\r\n\r\n strokeContainThreshold?: number\r\n\r\n nameTruncateMaxWidth?: number\r\n\r\n silent?: boolean\r\n\r\n handleAutoShown?(elementType: 'axisLine' | 'axisTick'): boolean\r\n}\r\n\r\ninterface TickCoord {\r\n coord: number\r\n tickValue?: number\r\n}\r\n\r\n/**\r\n * A final axis is translated and rotated from a \"standard axis\".\r\n * So opt.position and opt.rotation is required.\r\n *\r\n * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],\r\n * for example: (0, 0) ------------> (0, 50)\r\n *\r\n * nameDirection or tickDirection or labelDirection is 1 means tick\r\n * or label is below the standard axis, whereas is -1 means above\r\n * the standard axis. labelOffset means offset between label and axis,\r\n * which is useful when 'onZero', where axisLabel is in the grid and\r\n * label in outside grid.\r\n *\r\n * Tips: like always,\r\n * positive rotation represents anticlockwise, and negative rotation\r\n * represents clockwise.\r\n * The direction of position coordinate is the same as the direction\r\n * of screen coordinate.\r\n *\r\n * Do not need to consider axis 'inverse', which is auto processed by\r\n * axis extent.\r\n */\r\nclass AxisBuilder {\r\n\r\n axisModel: AxisBaseModel;\r\n\r\n opt: AxisBuilderCfg;\r\n\r\n readonly group = new graphic.Group();\r\n\r\n private _transformGroup: graphic.Group;\r\n\r\n constructor(axisModel: AxisBaseModel, opt?: AxisBuilderCfg) {\r\n\r\n this.opt = opt;\r\n\r\n this.axisModel = axisModel;\r\n\r\n // Default value\r\n defaults(\r\n opt,\r\n {\r\n labelOffset: 0,\r\n nameDirection: 1,\r\n tickDirection: 1,\r\n labelDirection: 1,\r\n silent: true,\r\n handleAutoShown: () => true\r\n } as AxisBuilderCfg\r\n );\r\n\r\n\r\n // FIXME Not use a separate text group?\r\n const transformGroup = new graphic.Group({\r\n x: opt.position[0],\r\n y: opt.position[1],\r\n rotation: opt.rotation\r\n });\r\n\r\n // this.group.add(transformGroup);\r\n // this._transformGroup = transformGroup;\r\n\r\n transformGroup.updateTransform();\r\n\r\n this._transformGroup = transformGroup;\r\n }\r\n\r\n hasBuilder(name: keyof typeof builders) {\r\n return !!builders[name];\r\n }\r\n\r\n add(name: keyof typeof builders) {\r\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\r\n }\r\n\r\n getGroup() {\r\n return this.group;\r\n }\r\n\r\n static innerTextLayout(axisRotation: number, textRotation: number, direction: number) {\r\n const rotationDiff = remRadian(textRotation - axisRotation);\r\n let textAlign;\r\n let textVerticalAlign;\r\n\r\n if (isRadianAroundZero(rotationDiff)) { // Label is parallel with axis line.\r\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI)) { // Label is inverse parallel with axis line.\r\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n\r\n if (rotationDiff > 0 && rotationDiff < PI) {\r\n textAlign = direction > 0 ? 'right' : 'left';\r\n }\r\n else {\r\n textAlign = direction > 0 ? 'left' : 'right';\r\n }\r\n }\r\n\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign as ZRTextAlign,\r\n textVerticalAlign: textVerticalAlign as ZRTextVerticalAlign\r\n };\r\n }\r\n\r\n static makeAxisEventDataBase(axisModel: AxisBaseModel) {\r\n const eventData = {\r\n componentType: axisModel.mainType,\r\n componentIndex: axisModel.componentIndex\r\n } as AxisEventData;\r\n eventData[axisModel.mainType + 'Index' as AxisIndexKey] = axisModel.componentIndex;\r\n return eventData;\r\n }\r\n\r\n static isLabelSilent(axisModel: AxisBaseModel): boolean {\r\n const tooltipOpt = axisModel.get('tooltip');\r\n return axisModel.get('silent')\r\n // Consider mouse cursor, add these restrictions.\r\n || !(\r\n axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show)\r\n );\r\n }\r\n};\r\n\r\ninterface AxisElementsBuilder {\r\n (\r\n opt: AxisBuilderCfg,\r\n axisModel: AxisBaseModel,\r\n group: graphic.Group,\r\n transformGroup: graphic.Group\r\n ):void\r\n}\r\n\r\nconst builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBuilder> = {\r\n\r\n axisLine(opt, axisModel, group, transformGroup) {\r\n\r\n let shown = axisModel.get(['axisLine', 'show']);\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisLine');\r\n }\r\n if (!shown) {\r\n return;\r\n }\r\n\r\n const extent = axisModel.axis.getExtent();\r\n\r\n const matrix = transformGroup.transform;\r\n const pt1 = [extent[0], 0];\r\n const pt2 = [extent[1], 0];\r\n const inverse = pt1[0] > pt2[0];\r\n if (matrix) {\r\n v2ApplyTransform(pt1, pt1, matrix);\r\n v2ApplyTransform(pt2, pt2, matrix);\r\n }\r\n\r\n const lineStyle = extend(\r\n {\r\n lineCap: 'round'\r\n },\r\n axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle()\r\n );\r\n\r\n const line = new graphic.Line({\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: lineStyle,\r\n strokeContainThreshold: opt.strokeContainThreshold || 5,\r\n silent: true,\r\n z2: 1\r\n });\r\n graphic.subPixelOptimizeLine(line.shape, line.style.lineWidth);\r\n line.anid = 'line';\r\n group.add(line);\r\n\r\n let arrows = axisModel.get(['axisLine', 'symbol']);\r\n\r\n if (arrows != null) {\r\n let arrowSize = axisModel.get(['axisLine', 'symbolSize']);\r\n\r\n if (isString(arrows)) {\r\n // Use the same arrow for start and end point\r\n arrows = [arrows, arrows];\r\n }\r\n if (isString(arrowSize) || isNumber(arrowSize)) {\r\n // Use the same size for width and height\r\n arrowSize = [arrowSize as number, arrowSize as number];\r\n }\r\n\r\n const arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize);\r\n\r\n const symbolWidth = arrowSize[0];\r\n const symbolHeight = arrowSize[1];\r\n\r\n each([{\r\n rotate: opt.rotation + Math.PI / 2,\r\n offset: arrowOffset[0],\r\n r: 0\r\n }, {\r\n rotate: opt.rotation - Math.PI / 2,\r\n offset: arrowOffset[1],\r\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0])\r\n + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\r\n }], function (point, index) {\r\n if (arrows[index] !== 'none' && arrows[index] != null) {\r\n const symbol = createSymbol(\r\n arrows[index],\r\n -symbolWidth / 2,\r\n -symbolHeight / 2,\r\n symbolWidth,\r\n symbolHeight,\r\n lineStyle.stroke,\r\n true\r\n );\r\n\r\n // Calculate arrow position with offset\r\n const r = point.r + point.offset;\r\n\r\n const pt = inverse ? pt2 : pt1;\r\n symbol.attr({\r\n rotation: point.rotate,\r\n x: pt[0] + r * Math.cos(opt.rotation),\r\n y: pt[1] - r * Math.sin(opt.rotation),\r\n silent: true,\r\n z2: 11\r\n });\r\n group.add(symbol);\r\n }\r\n });\r\n }\r\n },\r\n\r\n axisTickLabel(opt, axisModel, group, transformGroup) {\r\n const ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\r\n const labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\r\n\r\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\r\n\r\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);\r\n\r\n // This bit fixes the label overlap issue for the time chart.\r\n // See https://github.com/apache/echarts/issues/14266 for more.\r\n if (axisModel.get(['axisLabel', 'hideOverlap'])) {\r\n const labelList = prepareLayoutList(map(labelEls, label => ({\r\n label,\r\n priority: label.z2,\r\n defaultAttr: {\r\n ignore: label.ignore\r\n }\r\n })));\r\n\r\n hideOverlap(labelList);\r\n }\r\n },\r\n\r\n axisName(opt, axisModel, group, transformGroup) {\r\n const name = retrieve(opt.axisName, axisModel.get('name'));\r\n\r\n if (!name) {\r\n return;\r\n }\r\n\r\n const nameLocation = axisModel.get('nameLocation');\r\n const nameDirection = opt.nameDirection;\r\n const textStyleModel = axisModel.getModel('nameTextStyle');\r\n const gap = axisModel.get('nameGap') || 0;\r\n\r\n const extent = axisModel.axis.getExtent();\r\n const gapSignal = extent[0] > extent[1] ? -1 : 1;\r\n const pos = [\r\n nameLocation === 'start'\r\n ? extent[0] - gapSignal * gap\r\n : nameLocation === 'end'\r\n ? extent[1] + gapSignal * gap\r\n : (extent[0] + extent[1]) / 2, // 'middle'\r\n // Reuse labelOffset.\r\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0\r\n ];\r\n\r\n let labelLayout;\r\n\r\n let nameRotation = axisModel.get('nameRotate');\r\n if (nameRotation != null) {\r\n nameRotation = nameRotation * PI / 180; // To radian.\r\n }\r\n\r\n let axisNameAvailableWidth;\r\n\r\n if (isNameLocationCenter(nameLocation)) {\r\n labelLayout = AxisBuilder.innerTextLayout(\r\n opt.rotation,\r\n nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis.\r\n nameDirection\r\n );\r\n }\r\n else {\r\n labelLayout = endTextLayout(\r\n opt.rotation, nameLocation, nameRotation || 0, extent\r\n );\r\n\r\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\r\n if (axisNameAvailableWidth != null) {\r\n axisNameAvailableWidth = Math.abs(\r\n axisNameAvailableWidth / Math.sin(labelLayout.rotation)\r\n );\r\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\r\n }\r\n }\r\n\r\n const textFont = textStyleModel.getFont();\r\n\r\n const truncateOpt = axisModel.get('nameTruncate', true) || {};\r\n const ellipsis = truncateOpt.ellipsis;\r\n const maxWidth = retrieve(\r\n opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth\r\n );\r\n\r\n const textEl = new graphic.Text({\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: labelLayout.rotation,\r\n silent: AxisBuilder.isLabelSilent(axisModel),\r\n style: createTextStyle(textStyleModel, {\r\n text: name,\r\n font: textFont,\r\n overflow: 'truncate',\r\n width: maxWidth,\r\n ellipsis,\r\n fill: textStyleModel.getTextColor()\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']) as ColorString,\r\n align: textStyleModel.get('align')\r\n || labelLayout.textAlign,\r\n verticalAlign: textStyleModel.get('verticalAlign')\r\n || labelLayout.textVerticalAlign\r\n }),\r\n z2: 1\r\n }) as AxisLabelText;\r\n\r\n graphic.setTooltipConfig({\r\n el: textEl,\r\n componentModel: axisModel,\r\n itemName: name\r\n });\r\n\r\n textEl.__fullText = name;\r\n // Id for animation\r\n textEl.anid = 'name';\r\n\r\n if (axisModel.get('triggerEvent')) {\r\n const eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisName';\r\n eventData.name = name;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n\r\n // FIXME\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n\r\n group.add(textEl);\r\n\r\n textEl.decomposeTransform();\r\n }\r\n\r\n};\r\n\r\nfunction endTextLayout(\r\n rotation: number, textPosition: 'start' | 'middle' | 'end', textRotate: number, extent: number[]\r\n) {\r\n const rotationDiff = remRadian(textRotate - rotation);\r\n let textAlign: ZRTextAlign;\r\n let textVerticalAlign: ZRTextVerticalAlign;\r\n const inverse = extent[0] > extent[1];\r\n const onLeft = (textPosition === 'start' && !inverse)\r\n || (textPosition !== 'start' && inverse);\r\n\r\n if (isRadianAroundZero(rotationDiff - PI / 2)) {\r\n textVerticalAlign = onLeft ? 'bottom' : 'top';\r\n textAlign = 'center';\r\n }\r\n else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {\r\n textVerticalAlign = onLeft ? 'top' : 'bottom';\r\n textAlign = 'center';\r\n }\r\n else {\r\n textVerticalAlign = 'middle';\r\n if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {\r\n textAlign = onLeft ? 'left' : 'right';\r\n }\r\n else {\r\n textAlign = onLeft ? 'right' : 'left';\r\n }\r\n }\r\n\r\n return {\r\n rotation: rotationDiff,\r\n textAlign: textAlign,\r\n textVerticalAlign: textVerticalAlign\r\n };\r\n}\r\n\r\nfunction fixMinMaxLabelShow(\r\n axisModel: AxisBaseModel,\r\n labelEls: graphic.Text[],\r\n tickEls: graphic.Line[]\r\n) {\r\n if (shouldShowAllLabels(axisModel.axis)) {\r\n return;\r\n }\r\n\r\n // If min or max are user set, we need to check\r\n // If the tick on min(max) are overlap on their neighbour tick\r\n // If they are overlapped, we need to hide the min(max) tick label\r\n const showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\r\n const showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']);\r\n\r\n // FIXME\r\n // Have not consider onBand yet, where tick els is more than label els.\r\n\r\n labelEls = labelEls || [];\r\n tickEls = tickEls || [];\r\n\r\n const firstLabel = labelEls[0];\r\n const nextLabel = labelEls[1];\r\n const lastLabel = labelEls[labelEls.length - 1];\r\n const prevLabel = labelEls[labelEls.length - 2];\r\n\r\n const firstTick = tickEls[0];\r\n const nextTick = tickEls[1];\r\n const lastTick = tickEls[tickEls.length - 1];\r\n const prevTick = tickEls[tickEls.length - 2];\r\n\r\n if (showMinLabel === false) {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\r\n if (showMinLabel) {\r\n ignoreEl(nextLabel);\r\n ignoreEl(nextTick);\r\n }\r\n else {\r\n ignoreEl(firstLabel);\r\n ignoreEl(firstTick);\r\n }\r\n }\r\n\r\n if (showMaxLabel === false) {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\r\n if (showMaxLabel) {\r\n ignoreEl(prevLabel);\r\n ignoreEl(prevTick);\r\n }\r\n else {\r\n ignoreEl(lastLabel);\r\n ignoreEl(lastTick);\r\n }\r\n }\r\n}\r\n\r\nfunction ignoreEl(el: Element) {\r\n el && (el.ignore = true);\r\n}\r\n\r\nfunction isTwoLabelOverlapped(\r\n current: graphic.Text,\r\n next: graphic.Text\r\n) {\r\n // current and next has the same rotation.\r\n const firstRect = current && current.getBoundingRect().clone();\r\n const nextRect = next && next.getBoundingRect().clone();\r\n\r\n if (!firstRect || !nextRect) {\r\n return;\r\n }\r\n\r\n // When checking intersect of two rotated labels, we use mRotationBack\r\n // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.\r\n const mRotationBack = matrixUtil.identity([]);\r\n matrixUtil.rotate(mRotationBack, mRotationBack, -current.rotation);\r\n\r\n firstRect.applyTransform(matrixUtil.mul([], mRotationBack, current.getLocalTransform()));\r\n nextRect.applyTransform(matrixUtil.mul([], mRotationBack, next.getLocalTransform()));\r\n\r\n return firstRect.intersect(nextRect);\r\n}\r\n\r\nfunction isNameLocationCenter(nameLocation: string) {\r\n return nameLocation === 'middle' || nameLocation === 'center';\r\n}\r\n\r\n\r\nfunction createTicks(\r\n ticksCoords: TickCoord[],\r\n tickTransform: matrixUtil.MatrixArray,\r\n tickEndCoord: number,\r\n tickLineStyle: PathStyleProps,\r\n anidPrefix: string\r\n) {\r\n const tickEls = [];\r\n const pt1: number[] = [];\r\n const pt2: number[] = [];\r\n for (let i = 0; i < ticksCoords.length; i++) {\r\n const tickCoord = ticksCoords[i].coord;\r\n\r\n pt1[0] = tickCoord;\r\n pt1[1] = 0;\r\n pt2[0] = tickCoord;\r\n pt2[1] = tickEndCoord;\r\n\r\n if (tickTransform) {\r\n v2ApplyTransform(pt1, pt1, tickTransform);\r\n v2ApplyTransform(pt2, pt2, tickTransform);\r\n }\r\n // Tick line, Not use group transform to have better line draw\r\n const tickEl = new graphic.Line({\r\n shape: {\r\n x1: pt1[0],\r\n y1: pt1[1],\r\n x2: pt2[0],\r\n y2: pt2[1]\r\n },\r\n style: tickLineStyle,\r\n z2: 2,\r\n autoBatch: true,\r\n silent: true\r\n });\r\n graphic.subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);\r\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\r\n tickEls.push(tickEl);\r\n }\r\n return tickEls;\r\n}\r\n\r\nfunction buildAxisMajorTicks(\r\n group: graphic.Group,\r\n transformGroup: graphic.Group,\r\n axisModel: AxisBaseModel,\r\n opt: AxisBuilderCfg\r\n) {\r\n const axis = axisModel.axis;\r\n\r\n const tickModel = axisModel.getModel('axisTick');\r\n\r\n let shown = tickModel.get('show');\r\n if (shown === 'auto' && opt.handleAutoShown) {\r\n shown = opt.handleAutoShown('axisTick');\r\n }\r\n if (!shown || axis.scale.isBlank()) {\r\n return;\r\n }\r\n\r\n const lineStyleModel = tickModel.getModel('lineStyle');\r\n const tickEndCoord = opt.tickDirection * tickModel.get('length');\r\n\r\n const ticksCoords = axis.getTicksCoords();\r\n\r\n const ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(\r\n lineStyleModel.getLineStyle(),\r\n {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }\r\n ), 'ticks');\r\n\r\n for (let i = 0; i < ticksEls.length; i++) {\r\n group.add(ticksEls[i]);\r\n }\r\n\r\n return ticksEls;\r\n}\r\n\r\nfunction buildAxisMinorTicks(\r\n group: graphic.Group,\r\n transformGroup: graphic.Group,\r\n axisModel: AxisBaseModel,\r\n tickDirection: number\r\n) {\r\n const axis = axisModel.axis;\r\n\r\n const minorTickModel = axisModel.getModel('minorTick');\r\n\r\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\r\n return;\r\n }\r\n\r\n const minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n\r\n const lineStyleModel = minorTickModel.getModel('lineStyle');\r\n const tickEndCoord = tickDirection * minorTickModel.get('length');\r\n\r\n const minorTickLineStyle = defaults(\r\n lineStyleModel.getLineStyle(),\r\n defaults(\r\n axisModel.getModel('axisTick').getLineStyle(),\r\n {\r\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }\r\n )\r\n );\r\n\r\n for (let i = 0; i < minorTicksCoords.length; i++) {\r\n const minorTicksEls = createTicks(\r\n minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i\r\n );\r\n for (let k = 0; k < minorTicksEls.length; k++) {\r\n group.add(minorTicksEls[k]);\r\n }\r\n }\r\n}\r\n\r\nfunction buildAxisLabel(\r\n group: graphic.Group,\r\n transformGroup: graphic.Group,\r\n axisModel: AxisBaseModel,\r\n opt: AxisBuilderCfg\r\n) {\r\n const axis = axisModel.axis;\r\n const show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\r\n\r\n if (!show || axis.scale.isBlank()) {\r\n return;\r\n }\r\n\r\n const labelModel = axisModel.getModel('axisLabel');\r\n const labelMargin = labelModel.get('margin');\r\n const labels = axis.getViewLabels();\r\n\r\n // Special label rotate.\r\n const labelRotation = (\r\n retrieve(opt.labelRotate, labelModel.get('rotate')) || 0\r\n ) * PI / 180;\r\n\r\n const labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\r\n const rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\r\n\r\n const labelEls: graphic.Text[] = [];\r\n const silent = AxisBuilder.isLabelSilent(axisModel);\r\n const triggerEvent = axisModel.get('triggerEvent');\r\n\r\n each(labels, function (labelItem, index) {\r\n const tickValue = axis.scale.type === 'ordinal'\r\n ? (axis.scale as OrdinalScale).getRawOrdinalNumber(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n const formattedLabel = labelItem.formattedLabel;\r\n const rawLabel = labelItem.rawLabel;\r\n\r\n let itemLabelModel = labelModel;\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n const rawCategoryItem = rawCategoryData[tickValue];\r\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n itemLabelModel = new Model(\r\n rawCategoryItem.textStyle, labelModel, axisModel.ecModel\r\n );\r\n }\r\n }\r\n\r\n const textColor = itemLabelModel.getTextColor() as AxisBaseOption['axisLabel']['color']\r\n || axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n\r\n const tickCoord = axis.dataToCoord(tickValue);\r\n\r\n const align = itemLabelModel.getShallow('align', true)\r\n || labelLayout.textAlign;\r\n const alignMin = retrieve2(\r\n itemLabelModel.getShallow('alignMinLabel', true),\r\n align\r\n );\r\n const alignMax = retrieve2(\r\n itemLabelModel.getShallow('alignMaxLabel', true),\r\n align\r\n );\r\n\r\n const verticalAlign = itemLabelModel.getShallow('verticalAlign', true)\r\n || itemLabelModel.getShallow('baseline', true)\r\n || labelLayout.textVerticalAlign;\r\n const verticalAlignMin = retrieve2(\r\n itemLabelModel.getShallow('verticalAlignMinLabel', true),\r\n verticalAlign\r\n );\r\n const verticalAlignMax = retrieve2(\r\n itemLabelModel.getShallow('verticalAlignMaxLabel', true),\r\n verticalAlign\r\n );\r\n\r\n const textEl = new graphic.Text({\r\n x: tickCoord,\r\n y: opt.labelOffset + opt.labelDirection * labelMargin,\r\n rotation: labelLayout.rotation,\r\n silent: silent,\r\n z2: 10 + (labelItem.level || 0),\r\n style: createTextStyle(itemLabelModel, {\r\n text: formattedLabel,\r\n align: index === 0\r\n ? alignMin\r\n : index === labels.length - 1 ? alignMax : align,\r\n verticalAlign: index === 0\r\n ? verticalAlignMin\r\n : index === labels.length - 1 ? verticalAlignMax : verticalAlign,\r\n fill: isFunction(textColor)\r\n ? textColor(\r\n // (1) In category axis with data zoom, tick is not the original\r\n // index of axis.data. So tick should not be exposed to user\r\n // in category axis.\r\n // (2) Compatible with previous version, which always use formatted label as\r\n // input. But in interval scale the formatted label is like '223,445', which\r\n // maked user replace ','. So we modify it to return original val but remain\r\n // it as 'string' to avoid error in replacing.\r\n axis.type === 'category'\r\n ? rawLabel\r\n : axis.type === 'value'\r\n ? tickValue + ''\r\n : tickValue,\r\n index\r\n )\r\n : textColor as string\r\n })\r\n });\r\n textEl.anid = 'label_' + tickValue;\r\n\r\n\r\n // Pack data for mouse event\r\n if (triggerEvent) {\r\n const eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = rawLabel;\r\n eventData.tickIndex = index;\r\n if (axis.type === 'category') {\r\n eventData.dataIndex = tickValue;\r\n }\r\n\r\n getECData(textEl).eventData = eventData;\r\n }\r\n\r\n // FIXME\r\n transformGroup.add(textEl);\r\n textEl.updateTransform();\r\n\r\n labelEls.push(textEl);\r\n group.add(textEl);\r\n\r\n textEl.decomposeTransform();\r\n\r\n });\r\n\r\n return labelEls;\r\n}\r\n\r\n\r\nexport default AxisBuilder;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Model from '../../model/Model';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { each, curry, clone, defaults, isArray, indexOf } from 'zrender/src/core/util';\r\nimport AxisPointerModel, { AxisPointerOption } from './AxisPointerModel';\r\nimport Axis from '../../coord/Axis';\r\nimport { TooltipOption } from '../tooltip/TooltipModel';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n SeriesOption,\r\n SeriesTooltipOption,\r\n CommonAxisPointerOption,\r\n Dictionary,\r\n ComponentOption\r\n} from '../../util/types';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport ComponentModel from '../../model/Component';\r\nimport { CoordinateSystemMaster } from '../../coord/CoordinateSystem';\r\n\r\ninterface LinkGroup {\r\n mapper: AxisPointerOption['link'][number]['mapper']\r\n /**\r\n * { [axisKey]: AxisInfo }\r\n */\r\n axesInfo: Dictionary\r\n}\r\ninterface AxisInfo {\r\n axis: Axis\r\n key: string\r\n coordSys: CoordinateSystemMaster\r\n axisPointerModel: Model\r\n triggerTooltip: boolean\r\n triggerEmphasis: boolean\r\n involveSeries: boolean\r\n snap: boolean\r\n useHandle: boolean\r\n seriesModels: SeriesModel[]\r\n\r\n linkGroup?: LinkGroup\r\n seriesDataCount?: number\r\n}\r\n\r\ninterface CollectionResult {\r\n /**\r\n * { [coordSysKey]: { [axisKey]: AxisInfo } }\r\n */\r\n coordSysAxesInfo: Dictionary>\r\n\r\n /**\r\n * { [axisKey]: AxisInfo }\r\n */\r\n axesInfo: Dictionary\r\n /**\r\n * { [coordSysKey]: { CoordinateSystemMaster } }\r\n */\r\n coordSysMap: Dictionary\r\n\r\n seriesInvolved: boolean\r\n}\r\n\r\n// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\r\n// allAxesInfo should be updated when setOption performed.\r\nexport function collect(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const result: CollectionResult = {\r\n /**\r\n * key: makeKey(axis.model)\r\n * value: {\r\n * axis,\r\n * coordSys,\r\n * axisPointerModel,\r\n * triggerTooltip,\r\n * triggerEmphasis,\r\n * involveSeries,\r\n * snap,\r\n * seriesModels,\r\n * seriesDataCount\r\n * }\r\n */\r\n axesInfo: {},\r\n seriesInvolved: false,\r\n /**\r\n * key: makeKey(coordSys.model)\r\n * value: Object: key makeKey(axis.model), value: axisInfo\r\n */\r\n coordSysAxesInfo: {},\r\n coordSysMap: {}\r\n };\r\n\r\n collectAxesInfo(result, ecModel, api);\r\n\r\n // Check seriesInvolved for performance, in case too many series in some chart.\r\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\r\n\r\n return result;\r\n}\r\n\r\nfunction collectAxesInfo(result: CollectionResult, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const globalTooltipModel = ecModel.getComponent('tooltip');\r\n const globalAxisPointerModel = ecModel.getComponent('axisPointer') as AxisPointerModel;\r\n // links can only be set on global.\r\n const linksOption = globalAxisPointerModel.get('link', true) || [];\r\n const linkGroups: LinkGroup[] = [];\r\n\r\n // Collect axes info.\r\n each(api.getCoordinateSystems(), function (coordSys) {\r\n // Some coordinate system do not support axes, like geo.\r\n if (!coordSys.axisPointerEnabled) {\r\n return;\r\n }\r\n\r\n const coordSysKey = makeKey(coordSys.model);\r\n const axesInfoInCoordSys: CollectionResult['coordSysAxesInfo'][string] =\r\n result.coordSysAxesInfo[coordSysKey] = {};\r\n result.coordSysMap[coordSysKey] = coordSys;\r\n\r\n // Set tooltip (like 'cross') is a convenient way to show axisPointer\r\n // for user. So we enable setting tooltip on coordSys model.\r\n const coordSysModel = coordSys.model as ComponentModel;\r\n const baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\r\n\r\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));\r\n\r\n // If axis tooltip used, choose tooltip axis for each coordSys.\r\n // Notice this case: coordSys is `grid` but not `cartesian2D` here.\r\n if (coordSys.getTooltipAxes\r\n && globalTooltipModel\r\n // If tooltip.showContent is set as false, tooltip will not\r\n // show but axisPointer will show as normal.\r\n && baseTooltipModel.get('show')\r\n ) {\r\n // Compatible with previous logic. But series.tooltip.trigger: 'axis'\r\n // or series.data[n].tooltip.trigger: 'axis' are not support any more.\r\n const triggerAxis = baseTooltipModel.get('trigger') === 'axis';\r\n const cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\r\n const tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\r\n if (triggerAxis || cross) {\r\n each(tooltipAxes.baseAxes, curry(\r\n saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis\r\n ));\r\n }\r\n if (cross) {\r\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\r\n }\r\n }\r\n\r\n // fromTooltip: true | false | 'cross'\r\n // triggerTooltip: true | false | null\r\n function saveTooltipAxisInfo(\r\n fromTooltip: boolean | 'cross',\r\n triggerTooltip: boolean,\r\n axis: Axis\r\n ) {\r\n let axisPointerModel = axis.model.getModel(\r\n 'axisPointer', globalAxisPointerModel\r\n ) as Model;\r\n\r\n const axisPointerShow = axisPointerModel.get('show');\r\n if (!axisPointerShow || (\r\n axisPointerShow === 'auto'\r\n && !fromTooltip\r\n && !isHandleTrigger(axisPointerModel)\r\n )) {\r\n return;\r\n }\r\n\r\n if (triggerTooltip == null) {\r\n triggerTooltip = axisPointerModel.get('triggerTooltip');\r\n }\r\n\r\n axisPointerModel = fromTooltip\r\n ? makeAxisPointerModel(\r\n axis, baseTooltipModel, globalAxisPointerModel, ecModel,\r\n fromTooltip, triggerTooltip\r\n )\r\n : axisPointerModel;\r\n\r\n const snap = axisPointerModel.get('snap');\r\n const triggerEmphasis = axisPointerModel.get('triggerEmphasis');\r\n const axisKey = makeKey(axis.model);\r\n const involveSeries = triggerTooltip || snap || axis.type === 'category';\r\n\r\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\r\n const axisInfo: AxisInfo = result.axesInfo[axisKey] = {\r\n key: axisKey,\r\n axis: axis,\r\n coordSys: coordSys,\r\n axisPointerModel: axisPointerModel,\r\n triggerTooltip: triggerTooltip,\r\n triggerEmphasis: triggerEmphasis,\r\n involveSeries: involveSeries,\r\n snap: snap,\r\n useHandle: isHandleTrigger(axisPointerModel),\r\n seriesModels: [],\r\n\r\n linkGroup: null\r\n };\r\n axesInfoInCoordSys[axisKey] = axisInfo;\r\n result.seriesInvolved = result.seriesInvolved || involveSeries;\r\n\r\n const groupIndex = getLinkGroupIndex(linksOption, axis);\r\n if (groupIndex != null) {\r\n const linkGroup: LinkGroup = linkGroups[groupIndex]\r\n || (linkGroups[groupIndex] = {axesInfo: {}} as LinkGroup);\r\n linkGroup.axesInfo[axisKey] = axisInfo;\r\n linkGroup.mapper = linksOption[groupIndex].mapper;\r\n axisInfo.linkGroup = linkGroup;\r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction makeAxisPointerModel(\r\n axis: Axis,\r\n baseTooltipModel: Model,\r\n globalAxisPointerModel: AxisPointerModel,\r\n ecModel: GlobalModel,\r\n fromTooltip: boolean | 'cross',\r\n triggerTooltip: boolean\r\n) {\r\n const tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\r\n const fields = [\r\n 'type', 'snap', 'lineStyle', 'shadowStyle', 'label',\r\n 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'\r\n ] as const;\r\n const volatileOption = {} as Pick;\r\n\r\n each(fields, function (field) {\r\n (volatileOption as any)[field] = clone(tooltipAxisPointerModel.get(field));\r\n });\r\n\r\n // category axis do not auto snap, otherwise some tick that do not\r\n // has value can not be hovered. value/time/log axis default snap if\r\n // triggered from tooltip and trigger tooltip.\r\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip;\r\n\r\n // Compatible with previous behavior, tooltip axis does not show label by default.\r\n // Only these properties can be overridden from tooltip to axisPointer.\r\n if (tooltipAxisPointerModel.get('type') === 'cross') {\r\n volatileOption.type = 'line';\r\n }\r\n const labelOption = volatileOption.label || (volatileOption.label = {});\r\n // Follow the convention, do not show label when triggered by tooltip by default.\r\n labelOption.show == null && (labelOption.show = false);\r\n\r\n if (fromTooltip === 'cross') {\r\n // When 'cross', both axes show labels.\r\n const tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\r\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;\r\n // If triggerTooltip, this is a base axis, which should better not use cross style\r\n // (cross style is dashed by default)\r\n if (!triggerTooltip) {\r\n const crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\r\n crossStyle && defaults(labelOption, crossStyle.textStyle);\r\n }\r\n }\r\n\r\n return axis.model.getModel(\r\n 'axisPointer',\r\n new Model(volatileOption, globalAxisPointerModel, ecModel)\r\n );\r\n}\r\n\r\nfunction collectSeriesInfo(result: CollectionResult, ecModel: GlobalModel) {\r\n // Prepare data for axis trigger\r\n ecModel.eachSeries(function (seriesModel: SeriesModel) {\r\n\r\n // Notice this case: this coordSys is `cartesian2D` but not `grid`.\r\n const coordSys = seriesModel.coordinateSystem;\r\n const seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\r\n const seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\r\n if (!coordSys\r\n || seriesTooltipTrigger === 'none'\r\n || seriesTooltipTrigger === false\r\n || seriesTooltipTrigger === 'item'\r\n || seriesTooltipShow === false\r\n || seriesModel.get(['axisPointer', 'show'], true) === false\r\n ) {\r\n return;\r\n }\r\n\r\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\r\n const axis = axisInfo.axis;\r\n if (coordSys.getAxis(axis.dim) === axis) {\r\n axisInfo.seriesModels.push(seriesModel);\r\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\r\n axisInfo.seriesDataCount += seriesModel.getData().count();\r\n }\r\n });\r\n\r\n });\r\n}\r\n\r\n/**\r\n * For example:\r\n * {\r\n * axisPointer: {\r\n * links: [{\r\n * xAxisIndex: [2, 4],\r\n * yAxisIndex: 'all'\r\n * }, {\r\n * xAxisId: ['a5', 'a7'],\r\n * xAxisName: 'xxx'\r\n * }]\r\n * }\r\n * }\r\n */\r\nfunction getLinkGroupIndex(linksOption: AxisPointerOption['link'], axis: Axis): number {\r\n const axisModel = axis.model;\r\n const dim = axis.dim;\r\n for (let i = 0; i < linksOption.length; i++) {\r\n const linkOption = linksOption[i] || {};\r\n if (checkPropInLink(linkOption[dim + 'AxisId' as 'xAxisId'], axisModel.id)\r\n || checkPropInLink(linkOption[dim + 'AxisIndex' as 'xAxisIndex'], axisModel.componentIndex)\r\n || checkPropInLink(linkOption[dim + 'AxisName' as 'xAxisName'], axisModel.name)\r\n ) {\r\n return i;\r\n }\r\n }\r\n}\r\n\r\nfunction checkPropInLink(linkPropValue: number[] | number | string | string[] | 'all', axisPropValue: number | string) {\r\n return linkPropValue === 'all'\r\n || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0)\r\n || linkPropValue === axisPropValue;\r\n}\r\n\r\nexport function fixValue(axisModel: AxisBaseModel) {\r\n const axisInfo = getAxisInfo(axisModel);\r\n if (!axisInfo) {\r\n return;\r\n }\r\n\r\n const axisPointerModel = axisInfo.axisPointerModel;\r\n const scale = axisInfo.axis.scale;\r\n const option = axisPointerModel.option;\r\n const status = axisPointerModel.get('status');\r\n let value = axisPointerModel.get('value');\r\n\r\n // Parse init value for category and time axis.\r\n if (value != null) {\r\n value = scale.parse(value);\r\n }\r\n\r\n const useHandle = isHandleTrigger(axisPointerModel);\r\n // If `handle` used, `axisPointer` will always be displayed, so value\r\n // and status should be initialized.\r\n if (status == null) {\r\n option.status = useHandle ? 'show' : 'hide';\r\n }\r\n\r\n const extent = scale.getExtent().slice();\r\n extent[0] > extent[1] && extent.reverse();\r\n\r\n if (// Pick a value on axis when initializing.\r\n value == null\r\n // If both `handle` and `dataZoom` are used, value may be out of axis extent,\r\n // where we should re-pick a value to keep `handle` displaying normally.\r\n || value > extent[1]\r\n ) {\r\n // Make handle displayed on the end of the axis when init, which looks better.\r\n value = extent[1];\r\n }\r\n if (value < extent[0]) {\r\n value = extent[0];\r\n }\r\n\r\n option.value = value;\r\n\r\n if (useHandle) {\r\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\r\n }\r\n}\r\n\r\nexport function getAxisInfo(axisModel: AxisBaseModel) {\r\n const coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') as AxisPointerModel || {})\r\n .coordSysAxesInfo as CollectionResult;\r\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\r\n}\r\n\r\nexport function getAxisPointerModel(axisModel: AxisBaseModel) {\r\n const axisInfo = getAxisInfo(axisModel);\r\n return axisInfo && axisInfo.axisPointerModel;\r\n}\r\n\r\nfunction isHandleTrigger(axisPointerModel: Model) {\r\n return !!axisPointerModel.get(['handle', 'show']);\r\n}\r\n\r\n/**\r\n * @param {module:echarts/model/Model} model\r\n * @return {string} unique key\r\n */\r\nexport function makeKey(model: ComponentModel) {\r\n return model.type + '||' + model.id;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as axisPointerModelHelper from '../axisPointer/modelHelper';\r\nimport ComponentView from '../../view/Component';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Payload, Dictionary } from '../../util/types';\r\nimport type BaseAxisPointer from '../axisPointer/BaseAxisPointer';\r\n\r\nconst axisPointerClazz: Dictionary = {};\r\n\r\ninterface AxisPointerConstructor {\r\n new(): BaseAxisPointer\r\n}\r\n/**\r\n * Base class of AxisView.\r\n */\r\nclass AxisView extends ComponentView {\r\n\r\n static type = 'axis';\r\n type = AxisView.type;\r\n\r\n /**\r\n * @private\r\n */\r\n private _axisPointer: BaseAxisPointer;\r\n\r\n /**\r\n * @protected\r\n */\r\n axisPointerClass: string;\r\n\r\n /**\r\n * @override\r\n */\r\n render(axisModel: AxisBaseModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n // FIXME\r\n // This process should proformed after coordinate systems updated\r\n // (axis scale updated), and should be performed each time update.\r\n // So put it here temporarily, although it is not appropriate to\r\n // put a model-writing procedure in `view`.\r\n this.axisPointerClass && axisPointerModelHelper.fixValue(axisModel);\r\n\r\n super.render.apply(this, arguments as any);\r\n\r\n this._doUpdateAxisPointerClass(axisModel, api, true);\r\n }\r\n\r\n /**\r\n * Action handler.\r\n */\r\n updateAxisPointer(\r\n axisModel: AxisBaseModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ) {\r\n this._doUpdateAxisPointerClass(axisModel, api, false);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const axisPointer = this._axisPointer;\r\n axisPointer && axisPointer.remove(api);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._disposeAxisPointer(api);\r\n super.dispose.apply(this, arguments as any);\r\n }\r\n\r\n private _doUpdateAxisPointerClass(axisModel: AxisBaseModel, api: ExtensionAPI, forceRender?: boolean) {\r\n const Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\r\n if (!Clazz) {\r\n return;\r\n }\r\n const axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel);\r\n axisPointerModel\r\n ? (this._axisPointer || (this._axisPointer = new Clazz()))\r\n .render(axisModel, axisPointerModel, api, forceRender)\r\n : this._disposeAxisPointer(api);\r\n }\r\n\r\n private _disposeAxisPointer(api: ExtensionAPI) {\r\n this._axisPointer && this._axisPointer.dispose(api);\r\n this._axisPointer = null;\r\n }\r\n\r\n static registerAxisPointerClass(type: string, clazz: AxisPointerConstructor) {\r\n if (__DEV__) {\r\n if (axisPointerClazz[type]) {\r\n throw new Error('axisPointer ' + type + ' exists');\r\n }\r\n }\r\n axisPointerClazz[type] = clazz;\r\n };\r\n\r\n static getAxisPointerClass(type: string) {\r\n return type && axisPointerClazz[type];\r\n };\r\n\r\n}\r\n\r\nexport default AxisView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport { makeInner } from '../../util/model';\r\nimport GridModel from '../../coord/cartesian/GridModel';\r\nimport type SingleAxisView from './SingleAxisView';\r\nimport type CartesianAxisView from './CartesianAxisView';\r\nimport type SingleAxisModel from '../../coord/single/AxisModel';\r\nimport type CartesianAxisModel from '../../coord/cartesian/AxisModel';\r\nimport AxisView from './AxisView';\r\n\r\nconst inner = makeInner<{\r\n // Hash map of color index\r\n splitAreaColors: zrUtil.HashMap\r\n}, AxisView>();\r\n\r\nexport function rectCoordAxisBuildSplitArea(\r\n axisView: SingleAxisView | CartesianAxisView,\r\n axisGroup: graphic.Group,\r\n axisModel: SingleAxisModel | CartesianAxisModel,\r\n gridModel: GridModel | SingleAxisModel\r\n) {\r\n const axis = axisModel.axis;\r\n\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n\r\n // TODO: TYPE\r\n const splitAreaModel = (axisModel as CartesianAxisModel).getModel('splitArea');\r\n const areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n let areaColors = areaStyleModel.get('color');\r\n\r\n const gridRect = gridModel.coordinateSystem.getRect();\r\n\r\n const ticksCoords = axis.getTicksCoords({\r\n tickModel: splitAreaModel,\r\n clamp: true\r\n });\r\n\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n\r\n // For Making appropriate splitArea animation, the color and anid\r\n // should be corresponding to previous one if possible.\r\n const areaColorsLen = areaColors.length;\r\n const lastSplitAreaColors = inner(axisView).splitAreaColors;\r\n const newSplitAreaColors = zrUtil.createHashMap();\r\n let colorIndex = 0;\r\n if (lastSplitAreaColors) {\r\n for (let i = 0; i < ticksCoords.length; i++) {\r\n const cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\r\n if (cIndex != null) {\r\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n let prev = axis.toGlobalCoord(ticksCoords[0].coord);\r\n\r\n const areaStyle = areaStyleModel.getAreaStyle();\r\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\r\n\r\n for (let i = 1; i < ticksCoords.length; i++) {\r\n const tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n\r\n let x;\r\n let y;\r\n let width;\r\n let height;\r\n if (axis.isHorizontal()) {\r\n x = prev;\r\n y = gridRect.y;\r\n width = tickCoord - x;\r\n height = gridRect.height;\r\n prev = x + width;\r\n }\r\n else {\r\n x = gridRect.x;\r\n y = prev;\r\n width = gridRect.width;\r\n height = tickCoord - y;\r\n prev = y + height;\r\n }\r\n\r\n const tickValue = ticksCoords[i - 1].tickValue;\r\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\r\n\r\n axisGroup.add(new graphic.Rect({\r\n anid: tickValue != null ? 'area_' + tickValue : null,\r\n shape: {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height\r\n },\r\n style: zrUtil.defaults({\r\n fill: areaColors[colorIndex]\r\n }, areaStyle),\r\n autoBatch: true,\r\n silent: true\r\n }));\r\n\r\n colorIndex = (colorIndex + 1) % areaColorsLen;\r\n }\r\n\r\n inner(axisView).splitAreaColors = newSplitAreaColors;\r\n}\r\n\r\nexport function rectCoordAxisHandleRemove(axisView: SingleAxisView | CartesianAxisView) {\r\n inner(axisView).splitAreaColors = null;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport AxisBuilder, {AxisBuilderCfg} from './AxisBuilder';\r\nimport AxisView from './AxisView';\r\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper';\r\nimport {rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove} from './axisSplitHelper';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport CartesianAxisModel from '../../coord/cartesian/AxisModel';\r\nimport GridModel from '../../coord/cartesian/GridModel';\r\nimport { Payload } from '../../util/types';\r\nimport { isIntervalOrLogScale } from '../../scale/helper';\r\n\r\nconst axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n] as const;\r\nconst selfBuilderAttrs = [\r\n 'splitArea', 'splitLine', 'minorSplitLine'\r\n] as const;\r\n\r\nclass CartesianAxisView extends AxisView {\r\n\r\n static type = 'cartesianAxis';\r\n type = CartesianAxisView.type;\r\n\r\n axisPointerClass = 'CartesianAxisPointer';\r\n\r\n private _axisGroup: graphic.Group;\r\n\r\n /**\r\n * @override\r\n */\r\n render(axisModel: CartesianAxisModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n\r\n this.group.removeAll();\r\n\r\n const oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new graphic.Group();\r\n\r\n this.group.add(this._axisGroup);\r\n\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n\r\n const gridModel = axisModel.getCoordSysModel();\r\n\r\n const layout = cartesianAxisHelper.layout(gridModel, axisModel);\r\n\r\n const axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({\r\n handleAutoShown(elementType) {\r\n const cartesians = gridModel.coordinateSystem.getCartesians();\r\n for (let i = 0; i < cartesians.length; i++) {\r\n if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {\r\n // Still show axis tick or axisLine if other axis is value / log\r\n return true;\r\n }\r\n }\r\n // Not show axisTick or axisLine if other axis is category / time\r\n return false;\r\n }\r\n } as AxisBuilderCfg, layout));\r\n\r\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n\r\n zrUtil.each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this);\r\n\r\n // THIS is a special case for bar racing chart.\r\n // Update the axis label from the natural initial layout to\r\n // sorted layout should has no animation.\r\n const isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort;\r\n\r\n if (!isInitialSortFromBarRacing) {\r\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n }\r\n\r\n super.render(axisModel, ecModel, api, payload);\r\n }\r\n\r\n remove() {\r\n rectCoordAxisHandleRemove(this);\r\n }\r\n}\r\n\r\ninterface AxisElementBuilder {\r\n (axisView: CartesianAxisView, axisGroup: graphic.Group, axisModel: CartesianAxisModel, gridModel: GridModel): void\r\n}\r\n\r\nconst axisElementBuilders: Record = {\r\n\r\n splitLine(axisView, axisGroup, axisModel, gridModel) {\r\n const axis = axisModel.axis;\r\n\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n\r\n const splitLineModel = axisModel.getModel('splitLine');\r\n const lineStyleModel = splitLineModel.getModel('lineStyle');\r\n let lineColors = lineStyleModel.get('color');\r\n const showMinLine = splitLineModel.get('showMinLine') !== false;\r\n const showMaxLine = splitLineModel.get('showMaxLine') !== false;\r\n\r\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\r\n\r\n const gridRect = gridModel.coordinateSystem.getRect();\r\n const isHorizontal = axis.isHorizontal();\r\n\r\n let lineCount = 0;\r\n\r\n const ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n\r\n const p1 = [];\r\n const p2 = [];\r\n\r\n const lineStyle = lineStyleModel.getLineStyle();\r\n for (let i = 0; i < ticksCoords.length; i++) {\r\n const tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n\r\n if ((i === 0 && !showMinLine) || (i === ticksCoords.length - 1 && !showMaxLine)) {\r\n continue;\r\n }\r\n\r\n const tickValue = ticksCoords[i].tickValue;\r\n\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n\r\n const colorIndex = (lineCount++) % lineColors.length;\r\n const line = new graphic.Line({\r\n anid: tickValue != null ? 'line_' + tickValue : null,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: zrUtil.defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n });\r\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\r\n axisGroup.add(line);\r\n }\r\n },\r\n\r\n minorSplitLine(axisView, axisGroup, axisModel, gridModel) {\r\n const axis = axisModel.axis;\r\n\r\n const minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n const lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n\r\n const gridRect = gridModel.coordinateSystem.getRect();\r\n const isHorizontal = axis.isHorizontal();\r\n\r\n const minorTicksCoords = axis.getMinorTicksCoords();\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n const p1 = [];\r\n const p2 = [];\r\n\r\n const lineStyle = lineStyleModel.getLineStyle();\r\n\r\n for (let i = 0; i < minorTicksCoords.length; i++) {\r\n for (let k = 0; k < minorTicksCoords[i].length; k++) {\r\n const tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n\r\n const line = new graphic.Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n });\r\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\r\n axisGroup.add(line);\r\n }\r\n }\r\n },\r\n\r\n splitArea(axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n};\r\n\r\nexport class CartesianXAxisView extends CartesianAxisView {\r\n static type = 'xAxis';\r\n type = CartesianXAxisView.type;\r\n}\r\nexport class CartesianYAxisView extends CartesianAxisView {\r\n static type = 'yAxis';\r\n type = CartesianXAxisView.type;\r\n}\r\n\r\nexport default CartesianAxisView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport ComponentView from '../../view/Component';\r\nimport GridModel from '../../coord/cartesian/GridModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport { Rect } from '../../util/graphic';\r\nimport { defaults } from 'zrender/src/core/util';\r\nimport {CartesianAxisOption, CartesianAxisModel} from '../../coord/cartesian/AxisModel';\r\nimport axisModelCreator from '../../coord/axisModelCreator';\r\nimport Grid from '../../coord/cartesian/Grid';\r\nimport {CartesianXAxisView, CartesianYAxisView} from '../axis/CartesianAxisView';\r\n\r\n// Grid view\r\nclass GridView extends ComponentView {\r\n static readonly type = 'grid';\r\n readonly type = 'grid';\r\n\r\n render(gridModel: GridModel, ecModel: GlobalModel) {\r\n this.group.removeAll();\r\n if (gridModel.get('show')) {\r\n this.group.add(new Rect({\r\n shape: gridModel.coordinateSystem.getRect(),\r\n style: defaults({\r\n fill: gridModel.get('backgroundColor')\r\n }, gridModel.getItemStyle()),\r\n silent: true,\r\n z2: -1\r\n }));\r\n }\r\n }\r\n\r\n}\r\nconst extraOption: CartesianAxisOption = {\r\n // gridIndex: 0,\r\n // gridId: '',\r\n offset: 0\r\n};\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentView(GridView);\r\n registers.registerComponentModel(GridModel);\r\n registers.registerCoordinateSystem('cartesian2d', Grid);\r\n\r\n axisModelCreator(\r\n registers, 'x', CartesianAxisModel, extraOption\r\n );\r\n axisModelCreator(\r\n registers, 'y', CartesianAxisModel, extraOption\r\n );\r\n\r\n registers.registerComponentView(CartesianXAxisView);\r\n registers.registerComponentView(CartesianYAxisView);\r\n\r\n registers.registerPreprocessor(function (option) {\r\n // Only create grid when need\r\n if (option.xAxis && option.yAxis && !option.grid) {\r\n option.grid = {};\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport ScatterSeriesModel from './ScatterSeries';\r\nimport ScatterView from './ScatterView';\r\nimport {install as installGridSimple} from '../../component/grid/installSimple';\r\nimport layoutPoints from '../../layout/points';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n // In case developer forget to include grid component\r\n use(installGridSimple);\r\n\r\n registers.registerSeriesModel(ScatterSeriesModel);\r\n registers.registerChartView(ScatterView);\r\n registers.registerLayout(layoutPoints('scatter'));\r\n\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport RadarSeriesModel from './RadarSeries';\r\nimport Radar from '../../coord/radar/Radar';\r\n\r\ntype Point = number[];\r\nexport default function radarLayout(ecModel: GlobalModel) {\r\n ecModel.eachSeriesByType('radar', function (seriesModel: RadarSeriesModel) {\r\n const data = seriesModel.getData();\r\n const points: Point[][] = [];\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (!coordSys) {\r\n return;\r\n }\r\n\r\n const axes = coordSys.getIndicatorAxes();\r\n\r\n zrUtil.each(axes, function (axis, axisIndex) {\r\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\r\n points[dataIndex] = points[dataIndex] || [];\r\n const point = coordSys.dataToPoint(val, axisIndex);\r\n points[dataIndex][axisIndex] = isValidPoint(point)\r\n ? point : getValueMissingPoint(coordSys);\r\n });\r\n });\r\n\r\n // Close polygon\r\n data.each(function (idx) {\r\n // TODO\r\n // Is it appropriate to connect to the next data when some data is missing?\r\n // Or, should trade it like `connectNull` in line chart?\r\n const firstPoint = zrUtil.find(points[idx], function (point) {\r\n return isValidPoint(point);\r\n }) || getValueMissingPoint(coordSys);\r\n\r\n // Copy the first actual point to the end of the array\r\n points[idx].push(firstPoint.slice());\r\n data.setItemLayout(idx, points[idx]);\r\n });\r\n });\r\n}\r\n\r\nfunction isValidPoint(point: Point) {\r\n return !isNaN(point[0]) && !isNaN(point[1]);\r\n}\r\n\r\nfunction getValueMissingPoint(coordSys: Radar): Point {\r\n // It is error-prone to input [NaN, NaN] into polygon, polygon.\r\n // (probably cause problem when refreshing or animating)\r\n return [coordSys.cx, coordSys.cy];\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// @ts-nocheck\r\n\r\n// Backward compat for radar chart in 2\r\nimport * as zrUtil from 'zrender/src/core/util';\r\n\r\nexport default function radarBackwardCompat(option) {\r\n let polarOptArr = option.polar;\r\n if (polarOptArr) {\r\n if (!zrUtil.isArray(polarOptArr)) {\r\n polarOptArr = [polarOptArr];\r\n }\r\n const polarNotRadar = [];\r\n zrUtil.each(polarOptArr, function (polarOpt, idx) {\r\n if (polarOpt.indicator) {\r\n if (polarOpt.type && !polarOpt.shape) {\r\n polarOpt.shape = polarOpt.type;\r\n }\r\n option.radar = option.radar || [];\r\n if (!zrUtil.isArray(option.radar)) {\r\n option.radar = [option.radar];\r\n }\r\n option.radar.push(polarOpt);\r\n }\r\n else {\r\n polarNotRadar.push(polarOpt);\r\n }\r\n });\r\n option.polar = polarNotRadar;\r\n }\r\n zrUtil.each(option.series, function (seriesOpt) {\r\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\r\n seriesOpt.radarIndex = seriesOpt.polarIndex;\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as symbolUtil from '../../util/symbol';\r\nimport ChartView from '../../view/Chart';\r\nimport RadarSeriesModel, { RadarSeriesDataItemOption } from './RadarSeries';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { ColorString } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport { VectorArray } from 'zrender/src/core/vector';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport ZRImage from 'zrender/src/graphic/Image';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\n\r\ntype RadarSymbol = ReturnType & {\r\n __dimIdx: number\r\n};\r\n\r\nclass RadarView extends ChartView {\r\n static type = 'radar';\r\n type = RadarView.type;\r\n\r\n private _data: SeriesData;\r\n\r\n render(seriesModel: RadarSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const polar = seriesModel.coordinateSystem;\r\n const group = this.group;\r\n\r\n const data = seriesModel.getData();\r\n const oldData = this._data;\r\n\r\n function createSymbol(data: SeriesData, idx: number) {\r\n const symbolType = data.getItemVisual(idx, 'symbol') as string || 'circle';\r\n if (symbolType === 'none') {\r\n return;\r\n }\r\n const symbolSize = symbolUtil.normalizeSymbolSize(\r\n data.getItemVisual(idx, 'symbolSize')\r\n );\r\n const symbolPath = symbolUtil.createSymbol(\r\n symbolType, -1, -1, 2, 2\r\n );\r\n const symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\r\n symbolPath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 100,\r\n scaleX: symbolSize[0] / 2,\r\n scaleY: symbolSize[1] / 2,\r\n rotation: symbolRotate * Math.PI / 180 || 0\r\n });\r\n return symbolPath as RadarSymbol;\r\n }\r\n\r\n function updateSymbols(\r\n oldPoints: VectorArray[],\r\n newPoints: VectorArray[],\r\n symbolGroup: graphic.Group,\r\n data: SeriesData,\r\n idx: number,\r\n isInit?: boolean\r\n ) {\r\n // Simply rerender all\r\n symbolGroup.removeAll();\r\n for (let i = 0; i < newPoints.length - 1; i++) {\r\n const symbolPath = createSymbol(data, idx);\r\n if (symbolPath) {\r\n symbolPath.__dimIdx = i;\r\n if (oldPoints[i]) {\r\n symbolPath.setPosition(oldPoints[i]);\r\n graphic[isInit ? 'initProps' : 'updateProps'](\r\n symbolPath, {\r\n x: newPoints[i][0],\r\n y: newPoints[i][1]\r\n }, seriesModel, idx\r\n );\r\n }\r\n else {\r\n symbolPath.setPosition(newPoints[i]);\r\n }\r\n symbolGroup.add(symbolPath);\r\n }\r\n }\r\n }\r\n\r\n function getInitialPoints(points: number[][]) {\r\n return zrUtil.map(points, function (pt) {\r\n return [polar.cx, polar.cy];\r\n });\r\n }\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n const points = data.getItemLayout(idx);\r\n if (!points) {\r\n return;\r\n }\r\n const polygon = new graphic.Polygon();\r\n const polyline = new graphic.Polyline();\r\n const target = {\r\n shape: {\r\n points: points\r\n }\r\n };\r\n\r\n polygon.shape.points = getInitialPoints(points);\r\n polyline.shape.points = getInitialPoints(points);\r\n graphic.initProps(polygon, target, seriesModel, idx);\r\n graphic.initProps(polyline, target, seriesModel, idx);\r\n\r\n const itemGroup = new graphic.Group();\r\n const symbolGroup = new graphic.Group();\r\n itemGroup.add(polyline);\r\n itemGroup.add(polygon);\r\n itemGroup.add(symbolGroup);\r\n\r\n updateSymbols(\r\n polyline.shape.points, points, symbolGroup, data, idx, true\r\n );\r\n\r\n data.setItemGraphicEl(idx, itemGroup);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n const itemGroup = oldData.getItemGraphicEl(oldIdx) as graphic.Group;\r\n\r\n const polyline = itemGroup.childAt(0) as graphic.Polyline;\r\n const polygon = itemGroup.childAt(1) as graphic.Polygon;\r\n const symbolGroup = itemGroup.childAt(2) as graphic.Group;\r\n const target = {\r\n shape: {\r\n points: data.getItemLayout(newIdx)\r\n }\r\n };\r\n\r\n if (!target.shape.points) {\r\n return;\r\n }\r\n updateSymbols(\r\n polyline.shape.points,\r\n target.shape.points,\r\n symbolGroup,\r\n data,\r\n newIdx,\r\n false\r\n );\r\n\r\n saveOldStyle(polygon);\r\n saveOldStyle(polyline);\r\n\r\n graphic.updateProps(polyline, target, seriesModel);\r\n graphic.updateProps(polygon, target, seriesModel);\r\n\r\n data.setItemGraphicEl(newIdx, itemGroup);\r\n })\r\n .remove(function (idx) {\r\n group.remove(oldData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n\r\n data.eachItemGraphicEl(function (itemGroup: graphic.Group, idx) {\r\n const itemModel = data.getItemModel(idx);\r\n const polyline = itemGroup.childAt(0) as graphic.Polyline;\r\n const polygon = itemGroup.childAt(1) as graphic.Polygon;\r\n const symbolGroup = itemGroup.childAt(2) as graphic.Group;\r\n // Radar uses the visual encoded from itemStyle.\r\n const itemStyle = data.getItemVisual(idx, 'style');\r\n const color = itemStyle.fill;\r\n\r\n group.add(itemGroup);\r\n\r\n polyline.useStyle(\r\n zrUtil.defaults(\r\n itemModel.getModel('lineStyle').getLineStyle(),\r\n {\r\n fill: 'none',\r\n stroke: color\r\n }\r\n )\r\n );\r\n\r\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\r\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\r\n\r\n const areaStyleModel = itemModel.getModel('areaStyle');\r\n const polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\r\n\r\n polygon.ignore = polygonIgnore;\r\n\r\n zrUtil.each(['emphasis', 'select', 'blur'] as const, function (stateName) {\r\n const stateModel = itemModel.getModel([stateName, 'areaStyle']);\r\n const stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();\r\n // Won't be ignore if normal state is not ignore.\r\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\r\n });\r\n\r\n polygon.useStyle(\r\n zrUtil.defaults(\r\n areaStyleModel.getAreaStyle(),\r\n {\r\n fill: color,\r\n opacity: 0.7,\r\n decal: itemStyle.decal\r\n }\r\n )\r\n );\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n const itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n symbolGroup.eachChild(function (symbolPath: RadarSymbol) {\r\n if (symbolPath instanceof ZRImage) {\r\n const pathStyle = symbolPath.style;\r\n symbolPath.useStyle(zrUtil.extend({\r\n // TODO other properties like x, y ?\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, itemStyle));\r\n }\r\n else {\r\n symbolPath.useStyle(itemStyle);\r\n symbolPath.setColor(color);\r\n symbolPath.style.strokeNoScale = true;\r\n }\r\n\r\n const pathEmphasisState = symbolPath.ensureState('emphasis');\r\n pathEmphasisState.style = zrUtil.clone(itemHoverStyle);\r\n let defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);\r\n (defaultText == null || isNaN(defaultText as number)) && (defaultText = '');\r\n\r\n setLabelStyle(\r\n symbolPath, getLabelStatesModels(itemModel),\r\n {\r\n labelFetcher: data.hostModel,\r\n labelDataIndex: idx,\r\n labelDimIndex: symbolPath.__dimIdx,\r\n defaultText: defaultText as string,\r\n inheritColor: color as ColorString,\r\n defaultOpacity: itemStyle.opacity\r\n }\r\n );\r\n });\r\n\r\n toggleHoverEmphasis(\r\n itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')\r\n );\r\n });\r\n\r\n this._data = data;\r\n }\r\n\r\n remove() {\r\n this.group.removeAll();\r\n this._data = null;\r\n }\r\n}\r\n\r\nexport default RadarView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\r\nimport {\r\n SeriesOption,\r\n LineStyleOption,\r\n SeriesLabelOption,\r\n SymbolOptionMixin,\r\n ItemStyleOption,\r\n AreaStyleOption,\r\n OptionDataValue,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n SeriesEncodeOptionMixin,\r\n CallbackDataParams,\r\n DefaultStatesMixinEmphasis\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Radar from '../../coord/radar/Radar';\r\nimport {\r\n createTooltipMarkup, retrieveVisualColorForTooltipMarker\r\n} from '../../component/tooltip/tooltipMarkup';\r\n\r\ntype RadarSeriesDataValue = OptionDataValue[];\r\n\r\ninterface RadarStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\nexport interface RadarSeriesStateOption {\r\n lineStyle?: LineStyleOption\r\n areaStyle?: AreaStyleOption\r\n label?: SeriesLabelOption\r\n itemStyle?: ItemStyleOption\r\n}\r\nexport interface RadarSeriesDataItemOption extends SymbolOptionMixin,\r\n RadarSeriesStateOption,\r\n StatesOptionMixin, RadarStatesMixin>,\r\n OptionDataItemObject {\r\n}\r\n\r\nexport interface RadarSeriesOption\r\n extends SeriesOption,\r\n RadarSeriesStateOption,\r\n SymbolOptionMixin, SeriesEncodeOptionMixin {\r\n type?: 'radar'\r\n coordinateSystem?: 'radar'\r\n\r\n radarIndex?: number\r\n radarId?: string\r\n\r\n data?: (RadarSeriesDataItemOption | RadarSeriesDataValue)[]\r\n}\r\n\r\nclass RadarSeriesModel extends SeriesModel {\r\n\r\n static readonly type = 'series.radar';\r\n readonly type = RadarSeriesModel.type;\r\n\r\n static dependencies = ['radar'];\r\n\r\n coordinateSystem: Radar;\r\n\r\n hasSymbolVisual = true;\r\n\r\n // Overwrite\r\n init(option: RadarSeriesOption) {\r\n super.init.apply(this, arguments as any);\r\n\r\n // Enable legend selection for each data item\r\n // Use a function instead of direct access because data reference may changed\r\n this.legendVisualProvider = new LegendVisualProvider(\r\n zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)\r\n );\r\n\r\n }\r\n\r\n getInitialData(option: RadarSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesDataSimply(this, {\r\n generateCoord: 'indicator_',\r\n generateCoordCount: Infinity\r\n });\r\n }\r\n\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries?: boolean,\r\n dataType?: string\r\n ) {\r\n const data = this.getData();\r\n const coordSys = this.coordinateSystem;\r\n const indicatorAxes = coordSys.getIndicatorAxes();\r\n const name = this.getData().getName(dataIndex);\r\n const nameToDisplay = name === '' ? this.name : name;\r\n const markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\r\n\r\n return createTooltipMarkup('section', {\r\n header: nameToDisplay,\r\n sortBlocks: true,\r\n blocks: zrUtil.map(indicatorAxes, axis => {\r\n const val = data.get(data.mapDimension(axis.dim), dataIndex);\r\n return createTooltipMarkup('nameValue', {\r\n markerType: 'subItem',\r\n markerColor: markerColor,\r\n name: axis.name,\r\n value: val,\r\n sortParam: val\r\n });\r\n })\r\n });\r\n }\r\n\r\n getTooltipPosition(dataIndex: number) {\r\n if (dataIndex != null) {\r\n const data = this.getData();\r\n const coordSys = this.coordinateSystem;\r\n const values = data.getValues(\r\n zrUtil.map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex\r\n );\r\n\r\n for (let i = 0, len = values.length; i < len; i++) {\r\n if (!isNaN(values[i] as number)) {\r\n const indicatorAxes = coordSys.getIndicatorAxes();\r\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\r\n }\r\n }\r\n }\r\n }\r\n\r\n static defaultOption: RadarSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n colorBy: 'data',\r\n coordinateSystem: 'radar',\r\n legendHoverLink: true,\r\n radarIndex: 0,\r\n lineStyle: {\r\n width: 2,\r\n type: 'solid',\r\n join: 'round'\r\n },\r\n label: {\r\n position: 'top'\r\n },\r\n // areaStyle: {\r\n // },\r\n // itemStyle: {}\r\n symbolSize: 8\r\n // symbolRotate: null\r\n };\r\n}\r\n\r\nexport default RadarSeriesModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport axisDefault from '../axisDefault';\r\nimport Model from '../../model/Model';\r\nimport {AxisModelCommonMixin} from '../axisModelCommonMixin';\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n ComponentOption,\r\n CircleLayoutOptionMixin,\r\n LabelOption,\r\n ColorString\r\n} from '../../util/types';\r\nimport { AxisBaseOption, CategoryAxisBaseOption, ValueAxisBaseOption } from '../axisCommonTypes';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport Radar from './Radar';\r\nimport {CoordinateSystemHostModel} from '../../coord/CoordinateSystem';\r\n\r\nconst valueAxisDefault = axisDefault.value;\r\n\r\nfunction defaultsShow(opt: object, show: boolean) {\r\n return zrUtil.defaults({\r\n show: show\r\n }, opt);\r\n}\r\n\r\nexport interface RadarIndicatorOption {\r\n name?: string\r\n /**\r\n * @deprecated Use `name` instead.\r\n */\r\n text?: string\r\n min?: number\r\n max?: number\r\n color?: ColorString\r\n\r\n axisType?: 'value' | 'log'\r\n}\r\n\r\nexport interface RadarOption extends ComponentOption, CircleLayoutOptionMixin {\r\n mainType?: 'radar'\r\n\r\n startAngle?: number\r\n\r\n shape?: 'polygon' | 'circle'\r\n\r\n // TODO. axisType seems to have issue.\r\n // axisType?: 'value' | 'log'\r\n\r\n axisLine?: AxisBaseOption['axisLine']\r\n axisTick?: AxisBaseOption['axisTick']\r\n axisLabel?: AxisBaseOption['axisLabel']\r\n splitLine?: AxisBaseOption['splitLine']\r\n splitArea?: AxisBaseOption['splitArea']\r\n\r\n // TODO Use axisName?\r\n axisName?: {\r\n show?: boolean\r\n formatter?: string | ((name?: string, indicatorOpt?: InnerIndicatorAxisOption) => string)\r\n } & LabelOption\r\n axisNameGap?: number\r\n\r\n triggerEvent?: boolean\r\n\r\n scale?: boolean\r\n splitNumber?: number\r\n\r\n boundaryGap?: CategoryAxisBaseOption['boundaryGap']\r\n | ValueAxisBaseOption['boundaryGap']\r\n\r\n indicator?: RadarIndicatorOption[]\r\n}\r\n\r\nexport type InnerIndicatorAxisOption = AxisBaseOption & {\r\n // TODO Use type?\r\n // axisType?: 'value' | 'log'\r\n showName?: boolean\r\n};\r\n\r\nclass RadarModel extends ComponentModel implements CoordinateSystemHostModel {\r\n static readonly type = 'radar';\r\n readonly type = RadarModel.type;\r\n\r\n coordinateSystem: Radar;\r\n\r\n private _indicatorModels: AxisBaseModel[];\r\n\r\n optionUpdated() {\r\n const boundaryGap = this.get('boundaryGap');\r\n const splitNumber = this.get('splitNumber');\r\n const scale = this.get('scale');\r\n const axisLine = this.get('axisLine');\r\n const axisTick = this.get('axisTick');\r\n // let axisType = this.get('axisType');\r\n const axisLabel = this.get('axisLabel');\r\n const nameTextStyle = this.get('axisName');\r\n const showName = this.get(['axisName', 'show']);\r\n const nameFormatter = this.get(['axisName', 'formatter']);\r\n const nameGap = this.get('axisNameGap');\r\n const triggerEvent = this.get('triggerEvent');\r\n\r\n const indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {\r\n // PENDING\r\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\r\n indicatorOpt.min = 0;\r\n }\r\n else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\r\n indicatorOpt.max = 0;\r\n }\r\n let iNameTextStyle = nameTextStyle;\r\n if (indicatorOpt.color != null) {\r\n iNameTextStyle = zrUtil.defaults({\r\n color: indicatorOpt.color\r\n }, nameTextStyle);\r\n }\r\n // Use same configuration\r\n const innerIndicatorOpt: InnerIndicatorAxisOption = zrUtil.merge(zrUtil.clone(indicatorOpt), {\r\n boundaryGap: boundaryGap,\r\n splitNumber: splitNumber,\r\n scale: scale,\r\n axisLine: axisLine,\r\n axisTick: axisTick,\r\n // axisType: axisType,\r\n axisLabel: axisLabel,\r\n // Compatible with 2 and use text\r\n name: indicatorOpt.text,\r\n showName: showName,\r\n nameLocation: 'end',\r\n nameGap: nameGap,\r\n // min: 0,\r\n nameTextStyle: iNameTextStyle,\r\n triggerEvent: triggerEvent\r\n } as InnerIndicatorAxisOption, false);\r\n if (zrUtil.isString(nameFormatter)) {\r\n const indName = innerIndicatorOpt.name;\r\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\r\n }\r\n else if (zrUtil.isFunction(nameFormatter)) {\r\n innerIndicatorOpt.name = nameFormatter(\r\n innerIndicatorOpt.name, innerIndicatorOpt\r\n );\r\n }\r\n\r\n const model = new Model(innerIndicatorOpt, null, this.ecModel) as AxisBaseModel;\r\n zrUtil.mixin(model, AxisModelCommonMixin.prototype);\r\n // For triggerEvent.\r\n model.mainType = 'radar';\r\n model.componentIndex = this.componentIndex;\r\n\r\n return model;\r\n }, this);\r\n\r\n this._indicatorModels = indicatorModels;\r\n }\r\n\r\n getIndicatorModels() {\r\n return this._indicatorModels;\r\n }\r\n\r\n static defaultOption: RadarOption = {\r\n\r\n // zlevel: 0,\r\n\r\n z: 0,\r\n\r\n center: ['50%', '50%'],\r\n\r\n radius: '75%',\r\n\r\n startAngle: 90,\r\n\r\n axisName: {\r\n show: true\r\n // formatter: null\r\n // textStyle: {}\r\n },\r\n\r\n boundaryGap: [0, 0],\r\n\r\n splitNumber: 5,\r\n\r\n axisNameGap: 15,\r\n\r\n scale: false,\r\n\r\n // Polygon or circle\r\n shape: 'polygon',\r\n\r\n axisLine: zrUtil.merge(\r\n {\r\n lineStyle: {\r\n color: '#bbb'\r\n }\r\n },\r\n valueAxisDefault.axisLine\r\n ),\r\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\r\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\r\n // axisType: 'value',\r\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\r\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\r\n\r\n // {text, min, max}\r\n indicator: []\r\n };\r\n}\r\n\r\nexport default RadarModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport AxisBuilder from '../axis/AxisBuilder';\r\nimport * as graphic from '../../util/graphic';\r\nimport ComponentView from '../../view/Component';\r\nimport RadarModel from '../../coord/radar/RadarModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { ZRColor } from '../../util/types';\r\n\r\nconst axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n] as const;\r\n\r\nclass RadarView extends ComponentView {\r\n\r\n static type = 'radar';\r\n type = RadarView.type;\r\n\r\n render(radarModel: RadarModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const group = this.group;\r\n group.removeAll();\r\n\r\n this._buildAxes(radarModel);\r\n this._buildSplitLineAndArea(radarModel);\r\n }\r\n\r\n _buildAxes(radarModel: RadarModel) {\r\n const radar = radarModel.coordinateSystem;\r\n const indicatorAxes = radar.getIndicatorAxes();\r\n const axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {\r\n const axisName = indicatorAxis.model.get('showName')\r\n ? indicatorAxis.name\r\n : ''; // hide name\r\n const axisBuilder = new AxisBuilder(indicatorAxis.model, {\r\n axisName: axisName,\r\n position: [radar.cx, radar.cy],\r\n rotation: indicatorAxis.angle,\r\n labelDirection: -1,\r\n tickDirection: -1,\r\n nameDirection: 1\r\n });\r\n return axisBuilder;\r\n });\r\n\r\n zrUtil.each(axisBuilders, function (axisBuilder) {\r\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n this.group.add(axisBuilder.getGroup());\r\n }, this);\r\n }\r\n\r\n _buildSplitLineAndArea(radarModel: RadarModel) {\r\n const radar = radarModel.coordinateSystem;\r\n const indicatorAxes = radar.getIndicatorAxes();\r\n if (!indicatorAxes.length) {\r\n return;\r\n }\r\n const shape = radarModel.get('shape');\r\n const splitLineModel = radarModel.getModel('splitLine');\r\n const splitAreaModel = radarModel.getModel('splitArea');\r\n const lineStyleModel = splitLineModel.getModel('lineStyle');\r\n const areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n\r\n const showSplitLine = splitLineModel.get('show');\r\n const showSplitArea = splitAreaModel.get('show');\r\n const splitLineColors = lineStyleModel.get('color');\r\n const splitAreaColors = areaStyleModel.get('color');\r\n\r\n const splitLineColorsArr = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors];\r\n const splitAreaColorsArr = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\r\n\r\n const splitLines: (graphic.Circle | graphic.Polyline)[][] = [];\r\n const splitAreas: (graphic.Ring | graphic.Polygon)[][] = [];\r\n\r\n function getColorIndex(\r\n areaOrLine: any[][],\r\n areaOrLineColorList: ZRColor[],\r\n idx: number\r\n ) {\r\n const colorIndex = idx % areaOrLineColorList.length;\r\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\r\n return colorIndex;\r\n }\r\n\r\n if (shape === 'circle') {\r\n const ticksRadius = indicatorAxes[0].getTicksCoords();\r\n const cx = radar.cx;\r\n const cy = radar.cy;\r\n for (let i = 0; i < ticksRadius.length; i++) {\r\n if (showSplitLine) {\r\n const colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new graphic.Circle({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r: ticksRadius[i].coord\r\n }\r\n }));\r\n }\r\n if (showSplitArea && i < ticksRadius.length - 1) {\r\n const colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\r\n splitAreas[colorIndex].push(new graphic.Ring({\r\n shape: {\r\n cx: cx,\r\n cy: cy,\r\n r0: ticksRadius[i].coord,\r\n r: ticksRadius[i + 1].coord\r\n }\r\n }));\r\n }\r\n }\r\n }\r\n // Polyyon\r\n else {\r\n let realSplitNumber: number;\r\n const axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) {\r\n const ticksCoords = indicatorAxis.getTicksCoords();\r\n realSplitNumber = realSplitNumber == null\r\n ? ticksCoords.length - 1\r\n : Math.min(ticksCoords.length - 1, realSplitNumber);\r\n return zrUtil.map(ticksCoords, function (tickCoord) {\r\n return radar.coordToPoint(tickCoord.coord, idx);\r\n });\r\n });\r\n\r\n let prevPoints: number[][] = [];\r\n for (let i = 0; i <= realSplitNumber; i++) {\r\n const points: number[][] = [];\r\n for (let j = 0; j < indicatorAxes.length; j++) {\r\n points.push(axesTicksPoints[j][i]);\r\n }\r\n // Close\r\n if (points[0]) {\r\n points.push(points[0].slice());\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.error('Can\\'t draw value axis ' + i);\r\n }\r\n }\r\n\r\n if (showSplitLine) {\r\n const colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\r\n splitLines[colorIndex].push(new graphic.Polyline({\r\n shape: {\r\n points: points\r\n }\r\n }));\r\n }\r\n if (showSplitArea && prevPoints) {\r\n const colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\r\n splitAreas[colorIndex].push(new graphic.Polygon({\r\n shape: {\r\n points: points.concat(prevPoints)\r\n }\r\n }));\r\n }\r\n prevPoints = points.slice().reverse();\r\n }\r\n }\r\n\r\n const lineStyle = lineStyleModel.getLineStyle();\r\n const areaStyle = areaStyleModel.getAreaStyle();\r\n // Add splitArea before splitLine\r\n zrUtil.each(splitAreas, function (splitAreas, idx) {\r\n this.group.add(graphic.mergePath(\r\n splitAreas, {\r\n style: zrUtil.defaults({\r\n stroke: 'none',\r\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\r\n }, areaStyle),\r\n silent: true\r\n }\r\n ));\r\n }, this);\r\n\r\n zrUtil.each(splitLines, function (splitLines, idx) {\r\n this.group.add(graphic.mergePath(\r\n splitLines, {\r\n style: zrUtil.defaults({\r\n fill: 'none',\r\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\r\n }, lineStyle),\r\n silent: true\r\n }\r\n ));\r\n }, this);\r\n\r\n }\r\n}\r\n\r\nexport default RadarView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Axis from '../Axis';\r\nimport Scale from '../../scale/Scale';\r\nimport { OptionAxisType } from '../axisCommonTypes';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport { InnerIndicatorAxisOption } from './RadarModel';\r\n\r\nclass IndicatorAxis extends Axis {\r\n\r\n type: OptionAxisType = 'value';\r\n\r\n angle = 0;\r\n\r\n name = '';\r\n\r\n model: AxisBaseModel;\r\n\r\n constructor(dim: string, scale: Scale, radiusExtent?: [number, number]) {\r\n super(dim, scale, radiusExtent);\r\n }\r\n}\r\n\r\nexport default IndicatorAxis;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// TODO clockwise\r\n\r\nimport IndicatorAxis from './IndicatorAxis';\r\nimport IntervalScale from '../../scale/Interval';\r\nimport * as numberUtil from '../../util/number';\r\nimport { CoordinateSystemMaster, CoordinateSystem } from '../CoordinateSystem';\r\nimport RadarModel from './RadarModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { ScaleDataValue } from '../../util/types';\r\nimport { ParsedModelFinder } from '../../util/model';\r\nimport { map, each, isString, isNumber } from 'zrender/src/core/util';\r\nimport { alignScaleTicks } from '../axisAlignTicks';\r\n\r\n\r\nclass Radar implements CoordinateSystem, CoordinateSystemMaster {\r\n\r\n readonly type: 'radar';\r\n /**\r\n *\r\n * Radar dimensions\r\n */\r\n readonly dimensions: string[] = [];\r\n\r\n cx: number;\r\n\r\n cy: number;\r\n\r\n r: number;\r\n\r\n r0: number;\r\n\r\n startAngle: number;\r\n\r\n private _model: RadarModel;\r\n\r\n private _indicatorAxes: IndicatorAxis[];\r\n\r\n constructor(radarModel: RadarModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._model = radarModel;\r\n\r\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\r\n const dim = 'indicator_' + idx;\r\n const indicatorAxis = new IndicatorAxis(dim,\r\n new IntervalScale()\r\n // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()\r\n );\r\n indicatorAxis.name = indicatorModel.get('name');\r\n // Inject model and axis\r\n indicatorAxis.model = indicatorModel;\r\n indicatorModel.axis = indicatorAxis;\r\n this.dimensions.push(dim);\r\n return indicatorAxis;\r\n }, this);\r\n\r\n this.resize(radarModel, api);\r\n }\r\n\r\n getIndicatorAxes() {\r\n return this._indicatorAxes;\r\n }\r\n\r\n dataToPoint(value: ScaleDataValue, indicatorIndex: number) {\r\n const indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n\r\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\r\n }\r\n\r\n // TODO: API should be coordToPoint([coord, indicatorIndex])\r\n coordToPoint(coord: number, indicatorIndex: number) {\r\n const indicatorAxis = this._indicatorAxes[indicatorIndex];\r\n const angle = indicatorAxis.angle;\r\n const x = this.cx + coord * Math.cos(angle);\r\n const y = this.cy - coord * Math.sin(angle);\r\n return [x, y];\r\n }\r\n\r\n pointToData(pt: number[]) {\r\n let dx = pt[0] - this.cx;\r\n let dy = pt[1] - this.cy;\r\n const radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n\r\n const radian = Math.atan2(-dy, dx);\r\n\r\n // Find the closest angle\r\n // FIXME index can calculated directly\r\n let minRadianDiff = Infinity;\r\n let closestAxis;\r\n let closestAxisIdx = -1;\r\n for (let i = 0; i < this._indicatorAxes.length; i++) {\r\n const indicatorAxis = this._indicatorAxes[i];\r\n const diff = Math.abs(radian - indicatorAxis.angle);\r\n if (diff < minRadianDiff) {\r\n closestAxis = indicatorAxis;\r\n closestAxisIdx = i;\r\n minRadianDiff = diff;\r\n }\r\n }\r\n\r\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\r\n }\r\n\r\n resize(radarModel: RadarModel, api: ExtensionAPI) {\r\n const center = radarModel.get('center');\r\n const viewWidth = api.getWidth();\r\n const viewHeight = api.getHeight();\r\n const viewSize = Math.min(viewWidth, viewHeight) / 2;\r\n this.cx = numberUtil.parsePercent(center[0], viewWidth);\r\n this.cy = numberUtil.parsePercent(center[1], viewHeight);\r\n\r\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180;\r\n\r\n // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`\r\n let radius = radarModel.get('radius');\r\n if (isString(radius) || isNumber(radius)) {\r\n radius = [0, radius];\r\n }\r\n this.r0 = numberUtil.parsePercent(radius[0], viewSize);\r\n this.r = numberUtil.parsePercent(radius[1], viewSize);\r\n\r\n each(this._indicatorAxes, function (indicatorAxis, idx) {\r\n indicatorAxis.setExtent(this.r0, this.r);\r\n let angle = (this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length);\r\n // Normalize to [-PI, PI]\r\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\r\n indicatorAxis.angle = angle;\r\n }, this);\r\n }\r\n\r\n update(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const indicatorAxes = this._indicatorAxes;\r\n const radarModel = this._model;\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\r\n if (radarSeries.get('coordinateSystem') !== 'radar'\r\n // @ts-ignore\r\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel\r\n ) {\r\n return;\r\n }\r\n const data = radarSeries.getData();\r\n each(indicatorAxes, function (indicatorAxis) {\r\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\r\n });\r\n }, this);\r\n\r\n const splitNumber = radarModel.get('splitNumber');\r\n const dummyScale = new IntervalScale();\r\n dummyScale.setExtent(0, splitNumber);\r\n dummyScale.setInterval(1);\r\n // Force all the axis fixing the maxSplitNumber.\r\n each(indicatorAxes, function (indicatorAxis, idx) {\r\n alignScaleTicks(\r\n indicatorAxis.scale as IntervalScale,\r\n indicatorAxis.model,\r\n dummyScale\r\n );\r\n });\r\n }\r\n\r\n convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue[]): never {\r\n console.warn('Not implemented.');\r\n return null as never;\r\n }\r\n convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, pixel: number[]): never {\r\n console.warn('Not implemented.');\r\n return null as never;\r\n }\r\n containPoint(point: number[]): boolean {\r\n console.warn('Not implemented.');\r\n return false;\r\n }\r\n /**\r\n * Radar dimensions is based on the data\r\n */\r\n static dimensions: string[] = [];\r\n\r\n static create(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const radarList: Radar[] = [];\r\n ecModel.eachComponent('radar', function (radarModel: RadarModel) {\r\n const radar = new Radar(radarModel, ecModel, api);\r\n radarList.push(radar);\r\n radarModel.coordinateSystem = radar;\r\n });\r\n ecModel.eachSeriesByType('radar', function (radarSeries) {\r\n if (radarSeries.get('coordinateSystem') === 'radar') {\r\n // Inject coordinate system\r\n // @ts-ignore\r\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\r\n }\r\n });\r\n return radarList;\r\n }\r\n}\r\n\r\n\r\nexport default Radar;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport RadarModel from '../../coord/radar/RadarModel';\r\nimport RadarView from './RadarView';\r\nimport Radar from '../../coord/radar/Radar';\r\nimport RadarSeriesModel from '../../chart/radar/RadarSeries';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerCoordinateSystem('radar', Radar);\r\n registers.registerComponentModel(RadarModel);\r\n registers.registerComponentView(RadarView);\r\n\r\n registers.registerVisual({\r\n seriesType: 'radar',\r\n reset: function (seriesModel: RadarSeriesModel) {\r\n const data = seriesModel.getData();\r\n // itemVisual symbol is for selected data\r\n data.each(function (idx) {\r\n data.setItemVisual(idx, 'legendIcon', 'roundRect');\r\n });\r\n // visual is for unselected data\r\n data.setVisual('legendIcon', 'roundRect');\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport radarLayout from '../radar/radarLayout';\r\nimport dataFilter from '../../processor/dataFilter';\r\nimport backwardCompat from '../radar/backwardCompat';\r\nimport RadarView from './RadarView';\r\nimport RadarSeriesModel from './RadarSeries';\r\nimport { install as installRadarComponent } from '../../component/radar/install';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installRadarComponent);\r\n\r\n registers.registerChartView(RadarView);\r\n registers.registerSeriesModel(RadarSeriesModel);\r\n\r\n registers.registerLayout(radarLayout);\r\n registers.registerProcessor(dataFilter('radar'));\r\n registers.registerPreprocessor(backwardCompat);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// @ts-nocheck\r\nimport * as echarts from '../../core/echarts';\r\nimport { noop } from 'zrender/src/core/util';\r\n\r\nconst ATTR = '\\0_ec_interaction_mutex';\r\n\r\nexport function take(zr, resourceKey, userKey) {\r\n const store = getStore(zr);\r\n store[resourceKey] = userKey;\r\n}\r\n\r\nexport function release(zr, resourceKey, userKey) {\r\n const store = getStore(zr);\r\n const uKey = store[resourceKey];\r\n\r\n if (uKey === userKey) {\r\n store[resourceKey] = null;\r\n }\r\n}\r\n\r\nexport function isTaken(zr, resourceKey) {\r\n return !!getStore(zr)[resourceKey];\r\n}\r\n\r\nfunction getStore(zr) {\r\n return zr[ATTR] || (zr[ATTR] = {});\r\n}\r\n\r\n/**\r\n * payload: {\r\n * type: 'takeGlobalCursor',\r\n * key: 'dataZoomSelect', or 'brush', or ...,\r\n * If no userKey, release global cursor.\r\n * }\r\n */\r\n// TODO: SELF REGISTERED.\r\necharts.registerAction(\r\n {type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update'},\r\n noop\r\n);\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Eventful from 'zrender/src/core/Eventful';\r\nimport * as eventTool from 'zrender/src/core/event';\r\nimport * as interactionMutex from './interactionMutex';\r\nimport { ZRenderType } from 'zrender/src/zrender';\r\nimport { ZRElementEvent, RoamOptionMixin } from '../../util/types';\r\nimport { Bind3, isString, bind, defaults, clone } from 'zrender/src/core/util';\r\nimport Group from 'zrender/src/graphic/Group';\r\n\r\n// Can be null/undefined or true/false\r\n// or 'pan/move' or 'zoom'/'scale'\r\nexport type RoamType = RoamOptionMixin['roam'];\r\n\r\ninterface RoamOption {\r\n zoomOnMouseWheel?: boolean | 'ctrl' | 'shift' | 'alt'\r\n moveOnMouseMove?: boolean | 'ctrl' | 'shift' | 'alt'\r\n moveOnMouseWheel?: boolean | 'ctrl' | 'shift' | 'alt'\r\n /**\r\n * If fixed the page when pan\r\n */\r\n preventDefaultMouseMove?: boolean\r\n}\r\n\r\ntype RoamEventType = keyof RoamEventParams;\r\n\r\ntype RoamBehavior = 'zoomOnMouseWheel' | 'moveOnMouseMove' | 'moveOnMouseWheel';\r\n\r\nexport interface RoamEventParams {\r\n 'zoom': {\r\n scale: number\r\n originX: number\r\n originY: number\r\n\r\n isAvailableBehavior: Bind3\r\n }\r\n 'scrollMove': {\r\n scrollDelta: number\r\n originX: number\r\n originY: number\r\n\r\n isAvailableBehavior: Bind3\r\n }\r\n 'pan': {\r\n dx: number\r\n dy: number\r\n oldX: number\r\n oldY: number\r\n newX: number\r\n newY: number\r\n\r\n isAvailableBehavior: Bind3\r\n }\r\n};\r\n\r\nexport interface RoamControllerHost {\r\n target: Group\r\n zoom: number\r\n zoomLimit: {\r\n min?: number\r\n max?: number\r\n }\r\n}\r\n\r\nclass RoamController extends Eventful<{\r\n [key in keyof RoamEventParams]: (params: RoamEventParams[key]) => void | undefined\r\n}> {\r\n\r\n pointerChecker: (e: ZRElementEvent, x: number, y: number) => boolean;\r\n\r\n private _zr: ZRenderType;\r\n\r\n private _opt: Required;\r\n\r\n private _dragging: boolean;\r\n\r\n private _pinching: boolean;\r\n\r\n private _x: number;\r\n\r\n private _y: number;\r\n\r\n readonly enable: (this: this, controlType?: RoamType, opt?: RoamOption) => void;\r\n\r\n readonly disable: () => void;\r\n\r\n\r\n constructor(zr: ZRenderType) {\r\n super();\r\n\r\n this._zr = zr;\r\n\r\n // Avoid two roamController bind the same handler\r\n const mousedownHandler = bind(this._mousedownHandler, this);\r\n const mousemoveHandler = bind(this._mousemoveHandler, this);\r\n const mouseupHandler = bind(this._mouseupHandler, this);\r\n const mousewheelHandler = bind(this._mousewheelHandler, this);\r\n const pinchHandler = bind(this._pinchHandler, this);\r\n\r\n /**\r\n * Notice: only enable needed types. For example, if 'zoom'\r\n * is not needed, 'zoom' should not be enabled, otherwise\r\n * default mousewheel behaviour (scroll page) will be disabled.\r\n */\r\n this.enable = function (controlType, opt) {\r\n\r\n // Disable previous first\r\n this.disable();\r\n\r\n this._opt = defaults(clone(opt) || {}, {\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n // By default, wheel do not trigger move.\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n\r\n if (controlType == null) {\r\n controlType = true;\r\n }\r\n\r\n if (controlType === true || (controlType === 'move' || controlType === 'pan')) {\r\n zr.on('mousedown', mousedownHandler);\r\n zr.on('mousemove', mousemoveHandler);\r\n zr.on('mouseup', mouseupHandler);\r\n }\r\n if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {\r\n zr.on('mousewheel', mousewheelHandler);\r\n zr.on('pinch', pinchHandler);\r\n }\r\n };\r\n\r\n this.disable = function () {\r\n zr.off('mousedown', mousedownHandler);\r\n zr.off('mousemove', mousemoveHandler);\r\n zr.off('mouseup', mouseupHandler);\r\n zr.off('mousewheel', mousewheelHandler);\r\n zr.off('pinch', pinchHandler);\r\n };\r\n }\r\n\r\n isDragging() {\r\n return this._dragging;\r\n }\r\n\r\n isPinching() {\r\n return this._pinching;\r\n }\r\n\r\n setPointerChecker(pointerChecker: RoamController['pointerChecker']) {\r\n this.pointerChecker = pointerChecker;\r\n }\r\n\r\n dispose() {\r\n this.disable();\r\n }\r\n\r\n private _mousedownHandler(e: ZRElementEvent) {\r\n if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n return;\r\n }\r\n\r\n let el = e.target;\r\n while (el) {\r\n if (el.draggable) {\r\n return;\r\n }\r\n // check if host is draggable\r\n el = el.__hostTarget || el.parent;\r\n }\r\n\r\n const x = e.offsetX;\r\n const y = e.offsetY;\r\n\r\n // Only check on mosedown, but not mousemove.\r\n // Mouse can be out of target when mouse moving.\r\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\r\n this._x = x;\r\n this._y = y;\r\n this._dragging = true;\r\n }\r\n }\r\n\r\n private _mousemoveHandler(e: ZRElementEvent) {\r\n if (!this._dragging\r\n || !isAvailableBehavior('moveOnMouseMove', e, this._opt)\r\n || e.gestureEvent === 'pinch'\r\n || interactionMutex.isTaken(this._zr, 'globalPan')\r\n ) {\r\n return;\r\n }\r\n\r\n const x = e.offsetX;\r\n const y = e.offsetY;\r\n\r\n const oldX = this._x;\r\n const oldY = this._y;\r\n\r\n const dx = x - oldX;\r\n const dy = y - oldY;\r\n\r\n this._x = x;\r\n this._y = y;\r\n\r\n this._opt.preventDefaultMouseMove && eventTool.stop(e.event);\r\n\r\n trigger(this, 'pan', 'moveOnMouseMove', e, {\r\n dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y, isAvailableBehavior: null\r\n });\r\n }\r\n\r\n private _mouseupHandler(e: ZRElementEvent) {\r\n if (!eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\r\n this._dragging = false;\r\n }\r\n }\r\n\r\n private _mousewheelHandler(e: ZRElementEvent) {\r\n const shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\r\n const shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\r\n const wheelDelta = e.wheelDelta;\r\n const absWheelDeltaDelta = Math.abs(wheelDelta);\r\n const originX = e.offsetX;\r\n const originY = e.offsetY;\r\n\r\n // wheelDelta maybe -0 in chrome mac.\r\n if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) {\r\n return;\r\n }\r\n\r\n // If both `shouldZoom` and `shouldMove` is true, trigger\r\n // their event both, and the final behavior is determined\r\n // by event listener themselves.\r\n\r\n if (shouldZoom) {\r\n // Convenience:\r\n // Mac and VM Windows on Mac: scroll up: zoom out.\r\n // Windows: scroll up: zoom in.\r\n\r\n // FIXME: Should do more test in different environment.\r\n // wheelDelta is too complicated in difference nvironment\r\n // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\r\n // although it has been normallized by zrender.\r\n // wheelDelta of mouse wheel is bigger than touch pad.\r\n const factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\r\n const scale = wheelDelta > 0 ? factor : 1 / factor;\r\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\r\n scale: scale, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n\r\n if (shouldMove) {\r\n // FIXME: Should do more test in different environment.\r\n const absDelta = Math.abs(wheelDelta);\r\n // wheelDelta of mouse wheel is bigger than touch pad.\r\n const scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\r\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\r\n scrollDelta: scrollDelta, originX: originX, originY: originY, isAvailableBehavior: null\r\n });\r\n }\r\n }\r\n\r\n private _pinchHandler(e: ZRElementEvent) {\r\n if (interactionMutex.isTaken(this._zr, 'globalPan')) {\r\n return;\r\n }\r\n const scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\r\n checkPointerAndTrigger(this, 'zoom', null, e, {\r\n scale: scale, originX: e.pinchX, originY: e.pinchY, isAvailableBehavior: null\r\n });\r\n }\r\n}\r\n\r\n\r\nfunction checkPointerAndTrigger(\r\n controller: RoamController,\r\n eventName: T,\r\n behaviorToCheck: RoamBehavior,\r\n e: ZRElementEvent,\r\n contollerEvent: RoamEventParams[T]\r\n) {\r\n if (controller.pointerChecker\r\n && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)\r\n ) {\r\n // When mouse is out of roamController rect,\r\n // default befavoius should not be be disabled, otherwise\r\n // page sliding is disabled, contrary to expectation.\r\n eventTool.stop(e.event);\r\n\r\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\r\n }\r\n}\r\n\r\nfunction trigger(\r\n controller: RoamController,\r\n eventName: T,\r\n behaviorToCheck: RoamBehavior,\r\n e: ZRElementEvent,\r\n contollerEvent: RoamEventParams[T]\r\n) {\r\n // Also provide behavior checker for event listener, for some case that\r\n // multiple components share one listener.\r\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);\r\n // TODO should not have type issue.\r\n (controller as any).trigger(eventName, contollerEvent);\r\n}\r\n\r\n// settings: {\r\n// zoomOnMouseWheel\r\n// moveOnMouseMove\r\n// moveOnMouseWheel\r\n// }\r\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\r\nfunction isAvailableBehavior(\r\n behaviorToCheck: RoamBehavior,\r\n e: ZRElementEvent,\r\n settings: Pick\r\n) {\r\n const setting = settings[behaviorToCheck];\r\n return !behaviorToCheck || (\r\n setting && (!isString(setting) || e.event[setting + 'Key' as 'shiftKey' | 'ctrlKey' | 'altKey'])\r\n );\r\n}\r\n\r\nexport default RoamController;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Element from 'zrender/src/Element';\r\n\r\ninterface ControllerHost {\r\n target: Element,\r\n zoom?: number\r\n zoomLimit?: {min?: number, max?: number}\r\n}\r\n\r\n/**\r\n * For geo and graph.\r\n */\r\nexport function updateViewOnPan(controllerHost: ControllerHost, dx: number, dy: number) {\r\n const target = controllerHost.target;\r\n target.x += dx;\r\n target.y += dy;\r\n target.dirty();\r\n}\r\n\r\n/**\r\n * For geo and graph.\r\n */\r\nexport function updateViewOnZoom(controllerHost: ControllerHost, zoomDelta: number, zoomX: number, zoomY: number) {\r\n const target = controllerHost.target;\r\n const zoomLimit = controllerHost.zoomLimit;\r\n\r\n let newZoom = controllerHost.zoom = controllerHost.zoom || 1;\r\n newZoom *= zoomDelta;\r\n if (zoomLimit) {\r\n const zoomMin = zoomLimit.min || 0;\r\n const zoomMax = zoomLimit.max || Infinity;\r\n newZoom = Math.max(\r\n Math.min(zoomMax, newZoom),\r\n zoomMin\r\n );\r\n }\r\n const zoomScale = newZoom / controllerHost.zoom;\r\n controllerHost.zoom = newZoom;\r\n // Keep the mouse center when scaling\r\n target.x -= (zoomX - target.x) * (zoomScale - 1);\r\n target.y -= (zoomY - target.y) * (zoomScale - 1);\r\n target.scaleX *= zoomScale;\r\n target.scaleY *= zoomScale;\r\n\r\n target.dirty();\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport { ElementEvent } from 'zrender/src/Element';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesModel from '../../model/Series';\r\nimport { CoordinateSystem } from '../../coord/CoordinateSystem';\r\n\r\nconst IRRELEVANT_EXCLUDES = {'axisPointer': 1, 'tooltip': 1, 'brush': 1};\r\n\r\n/**\r\n * Avoid that: mouse click on a elements that is over geo or graph,\r\n * but roam is triggered.\r\n */\r\nexport function onIrrelevantElement(\r\n e: ElementEvent, api: ExtensionAPI, targetCoordSysModel: CoordinateSystem['model']\r\n): boolean {\r\n const model = api.getComponentByElement(e.topTarget);\r\n // If model is axisModel, it works only if it is injected with coordinateSystem.\r\n const coordSys = model && (model as SeriesModel).coordinateSystem;\r\n return model\r\n && model !== targetCoordSysModel\r\n && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType)\r\n && (coordSys && coordSys.model !== targetCoordSysModel);\r\n}\r\n", "import { isString } from '../core/util';\n\n/**\n * For big svg string, this method might be time consuming.\n */\nexport function parseXML(svg: Document | string | SVGElement): SVGElement {\n if (isString(svg)) {\n const parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n }\n let svgNode: Node = svg;\n // Document node. If using $.get, doc node may be input.\n if (svgNode.nodeType === 9) {\n svgNode = svgNode.firstChild;\n }\n // nodeName of is also 'svg'.\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\n svgNode = svgNode.nextSibling;\n }\n\n return svgNode as SVGElement;\n}\n", "import Group from '../graphic/Group';\nimport ZRImage from '../graphic/Image';\nimport Circle from '../graphic/shape/Circle';\nimport Rect from '../graphic/shape/Rect';\nimport Ellipse from '../graphic/shape/Ellipse';\nimport Line from '../graphic/shape/Line';\nimport Polygon from '../graphic/shape/Polygon';\nimport Polyline from '../graphic/shape/Polyline';\nimport * as matrix from '../core/matrix';\nimport { createFromString } from './path';\nimport { defaults, trim, each, map, keys, hasOwn } from '../core/util';\nimport Displayable from '../graphic/Displayable';\nimport Element from '../Element';\nimport { RectLike } from '../core/BoundingRect';\nimport { Dictionary } from '../core/types';\nimport { PatternObject } from '../graphic/Pattern';\nimport LinearGradient, { LinearGradientObject } from '../graphic/LinearGradient';\nimport RadialGradient, { RadialGradientObject } from '../graphic/RadialGradient';\nimport Gradient, { GradientObject } from '../graphic/Gradient';\nimport TSpan, { TSpanStyleProps } from '../graphic/TSpan';\nimport { parseXML } from './parseXML';\n\n\ninterface SVGParserOption {\n // Default width if svg width not specified or is a percent value.\n width?: number;\n // Default height if svg height not specified or is a percent value.\n height?: number;\n ignoreViewBox?: boolean;\n ignoreRootClip?: boolean;\n}\n\nexport interface SVGParserResult {\n // Group, The root of the the result tree of zrender shapes\n root: Group;\n // number, the viewport width of the SVG\n width: number;\n // number, the viewport height of the SVG\n height: number;\n // {x, y, width, height}, the declared viewBox rect of the SVG, if exists\n viewBoxRect: RectLike;\n // the {scale, position} calculated by viewBox and viewport, is exists\n viewBoxTransform: {\n x: number;\n y: number;\n scale: number;\n };\n named: SVGParserResultNamedItem[];\n}\nexport interface SVGParserResultNamedItem {\n name: string;\n // If a tag has no name attribute but its ancester is named,\n // `namedFrom` is set to the named item of the ancester .\n // Otherwise null/undefined\n namedFrom: SVGParserResultNamedItem;\n svgNodeTagLower: SVGNodeTagLower;\n el: Element;\n};\n\nexport type SVGNodeTagLower =\n 'g' | 'rect' | 'circle' | 'line' | 'ellipse' | 'polygon'\n | 'polyline' | 'image' | 'text' | 'tspan' | 'path' | 'defs' | 'switch';\n\n\ntype DefsId = string;\ntype DefsMap = { [id in DefsId]: LinearGradientObject | RadialGradientObject | PatternObject };\ntype DefsUsePending = [Displayable, 'fill' | 'stroke', DefsId][];\n\ntype ElementExtended = Element & {\n __inheritedStyle?: InheritedStyleByZRKey;\n __selfStyle?: SelfStyleByZRKey;\n}\ntype DisplayableExtended = Displayable & {\n __inheritedStyle?: InheritedStyleByZRKey;\n __selfStyle?: SelfStyleByZRKey;\n}\n\ntype TextStyleOptionExtended = TSpanStyleProps & {\n fontSize: number;\n fontFamily: string;\n fontWeight: string;\n fontStyle: string;\n}\nlet nodeParsers: {[name in SVGNodeTagLower]?: (\n this: SVGParser, xmlNode: SVGElement, parentGroup: Group\n) => Element};\n\ntype InheritedStyleByZRKey = {[name in InheritableStyleZRKey]?: string};\ntype InheritableStyleZRKey =\n typeof INHERITABLE_STYLE_ATTRIBUTES_MAP[keyof typeof INHERITABLE_STYLE_ATTRIBUTES_MAP];\nconst INHERITABLE_STYLE_ATTRIBUTES_MAP = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-anchor': 'textAlign',\n 'visibility': 'visibility',\n 'display': 'display'\n} as const;\nconst INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP);\n\ntype SelfStyleByZRKey = {[name in SelfStyleZRKey]?: string};\ntype SelfStyleZRKey =\n typeof SELF_STYLE_ATTRIBUTES_MAP[keyof typeof SELF_STYLE_ATTRIBUTES_MAP];\nconst SELF_STYLE_ATTRIBUTES_MAP = {\n 'alignment-baseline': 'textBaseline',\n 'stop-color': 'stopColor'\n};\nconst SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP);\n\n\nclass SVGParser {\n\n private _defs: DefsMap = {};\n // The use of can be in front of declared.\n // So save them temporarily in `_defsUsePending`.\n private _defsUsePending: DefsUsePending;\n private _root: Group = null;\n\n private _textX: number;\n private _textY: number;\n\n parse(xml: string | Document | SVGElement, opt: SVGParserOption): SVGParserResult {\n opt = opt || {};\n\n const svg = parseXML(xml);\n\n if (process.env.NODE_ENV !== 'production') {\n if (!svg) {\n throw new Error('Illegal svg');\n }\n }\n\n this._defsUsePending = [];\n let root = new Group();\n this._root = root;\n const named: SVGParserResult['named'] = [];\n // parse view port\n const viewBox = svg.getAttribute('viewBox') || '';\n\n // If width/height not specified, means \"100%\" of `opt.width/height`.\n // TODO: Other percent value not supported yet.\n let width = parseFloat((svg.getAttribute('width') || opt.width) as string);\n let height = parseFloat((svg.getAttribute('height') || opt.height) as string);\n // If width/height not specified, set as null for output.\n isNaN(width) && (width = null);\n isNaN(height) && (height = null);\n\n // Apply inline style on svg element.\n parseAttributes(svg, root, null, true, false);\n\n let child = svg.firstChild as SVGElement;\n while (child) {\n this._parseNode(child, root, named, null, false, false);\n child = child.nextSibling as SVGElement;\n }\n\n applyDefs(this._defs, this._defsUsePending);\n this._defsUsePending = [];\n\n let viewBoxRect;\n let viewBoxTransform;\n\n if (viewBox) {\n const viewBoxArr = splitNumberSequence(viewBox);\n // Some invalid case like viewBox: 'none'.\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat((viewBoxArr[0] || 0) as string),\n y: parseFloat((viewBoxArr[1] || 0) as string),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width: width, height: height });\n\n if (!opt.ignoreViewBox) {\n // If set transform on the output group, it probably bring trouble when\n // some users only intend to show the clipped content inside the viewBox,\n // but not intend to transform the output group. So we keep the output\n // group no transform. If the user intend to use the viewBox as a\n // camera, just set `opt.ignoreViewBox` as `true` and set transfrom\n // manually according to the viewBox info in the output of this method.\n const elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\n elRoot.x = viewBoxTransform.x;\n elRoot.y = viewBoxTransform.y;\n }\n }\n\n // Some shapes might be overflow the viewport, which should be\n // clipped despite whether the viewBox is used, as the SVG does.\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: {x: 0, y: 0, width: width, height: height}\n }));\n }\n\n // Set width/height on group just for output the viewport size.\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform,\n named: named\n };\n }\n\n private _parseNode(\n xmlNode: SVGElement,\n parentGroup: Group,\n named: SVGParserResultNamedItem[],\n namedFrom: SVGParserResultNamedItem['namedFrom'],\n isInDefs: boolean,\n isInText: boolean\n ): void {\n\n const nodeName = xmlNode.nodeName.toLowerCase() as SVGNodeTagLower;\n\n // TODO:\n // support in svg, where nodeName is 'style',\n // CSS classes is defined globally wherever the style tags are declared.\n\n let el;\n let namedFromForSub = namedFrom;\n\n if (nodeName === 'defs') {\n isInDefs = true;\n }\n if (nodeName === 'text') {\n isInText = true;\n }\n\n if (nodeName === 'defs' || nodeName === 'switch') {\n // Just make displayable. Do not support\n // the full feature of it.\n el = parentGroup;\n }\n else {\n // In , elments will not be rendered.\n // TODO:\n // do not support elements in yet, until requirement come.\n // other graphic elements can also be in and referenced by\n // \n // multiple times\n if (!isInDefs) {\n const parser = nodeParsers[nodeName];\n if (parser && hasOwn(nodeParsers, nodeName)) {\n\n el = parser.call(this, xmlNode, parentGroup);\n\n // Do not support empty string;\n const nameAttr = xmlNode.getAttribute('name');\n if (nameAttr) {\n const newNamed: SVGParserResultNamedItem = {\n name: nameAttr,\n namedFrom: null,\n svgNodeTagLower: nodeName,\n el: el\n };\n named.push(newNamed);\n if (nodeName === 'g') {\n namedFromForSub = newNamed;\n }\n }\n else if (namedFrom) {\n named.push({\n name: namedFrom.name,\n namedFrom: namedFrom,\n svgNodeTagLower: nodeName,\n el: el\n });\n }\n\n parentGroup.add(el);\n }\n }\n\n // Whether gradients/patterns are declared in or not,\n // they all work.\n const parser = paintServerParsers[nodeName];\n if (parser && hasOwn(paintServerParsers, nodeName)) {\n const def = parser.call(this, xmlNode);\n const id = xmlNode.getAttribute('id');\n if (id) {\n this._defs[id] = def;\n }\n }\n }\n\n // If xmlNode is , , , , ,\n // el will be a group, and traverse the children.\n if (el && el.isGroup) {\n let child = xmlNode.firstChild as SVGElement;\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el as Group, named, namedFromForSub, isInDefs, isInText);\n }\n // Is plain text rather than a tagged node.\n else if (child.nodeType === 3 && isInText) {\n this._parseText(child, el as Group);\n }\n child = child.nextSibling as SVGElement;\n }\n }\n\n }\n\n private _parseText(xmlNode: SVGElement, parentGroup: Group): TSpan {\n const text = new TSpan({\n style: {\n text: xmlNode.textContent\n },\n silent: true,\n x: this._textX || 0,\n y: this._textY || 0\n });\n\n inheritStyle(parentGroup, text);\n\n parseAttributes(xmlNode, text, this._defsUsePending, false, false);\n\n applyTextAlignment(text, parentGroup);\n\n const textStyle = text.style as TextStyleOptionExtended;\n const fontSize = textStyle.fontSize;\n if (fontSize && fontSize < 9) {\n // PENDING\n textStyle.fontSize = 9;\n text.scaleX *= fontSize / 9;\n text.scaleY *= fontSize / 9;\n }\n\n const font = (textStyle.fontSize || textStyle.fontFamily) && [\n textStyle.fontStyle,\n textStyle.fontWeight,\n (textStyle.fontSize || 12) + 'px',\n // If font properties are defined, `fontFamily` should not be ignored.\n textStyle.fontFamily || 'sans-serif'\n ].join(' ');\n // Make font\n textStyle.font = font;\n\n const rect = text.getBoundingRect();\n this._textX += rect.width;\n\n parentGroup.add(text);\n\n return text;\n }\n\n static internalField = (function () {\n\n nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n const g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, false);\n\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n const rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defsUsePending, false, false);\n\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\n height: parseFloat(xmlNode.getAttribute('height') || '0')\n });\n\n rect.silent = true;\n\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n const circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defsUsePending, false, false);\n\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n r: parseFloat(xmlNode.getAttribute('r') || '0')\n });\n\n circle.silent = true;\n\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n const line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defsUsePending, false, false);\n\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\n });\n\n line.silent = true;\n\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n const ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);\n\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\n });\n\n ellipse.silent = true;\n\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n const pointsStr = xmlNode.getAttribute('points');\n let pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n const polygon = new Polygon({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);\n\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n const pointsStr = xmlNode.getAttribute('points');\n let pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n const polyline = new Polyline({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n\n inheritStyle(parentGroup, polyline);\n parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);\n\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n const img = new ZRImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defsUsePending, false, false);\n\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href') || xmlNode.getAttribute('href'),\n x: +xmlNode.getAttribute('x'),\n y: +xmlNode.getAttribute('y'),\n width: +xmlNode.getAttribute('width'),\n height: +xmlNode.getAttribute('height')\n });\n img.silent = true;\n\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n const x = xmlNode.getAttribute('x') || '0';\n const y = xmlNode.getAttribute('y') || '0';\n const dx = xmlNode.getAttribute('dx') || '0';\n const dy = xmlNode.getAttribute('dy') || '0';\n\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n\n const g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n const x = xmlNode.getAttribute('x');\n const y = xmlNode.getAttribute('y');\n if (x != null) {\n // new offset x\n this._textX = parseFloat(x);\n }\n if (y != null) {\n // new offset y\n this._textY = parseFloat(y);\n }\n const dx = xmlNode.getAttribute('dx') || '0';\n const dy = xmlNode.getAttribute('dy') || '0';\n\n const g = new Group();\n\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n // TODO svg fill rule\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule\n // path.style.globalCompositeOperation = 'xor';\n const d = xmlNode.getAttribute('d') || '';\n\n // Performance sensitive.\n\n const path = createFromString(d);\n\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defsUsePending, false, false);\n\n path.silent = true;\n\n return path;\n }\n };\n\n\n })();\n}\n\nconst paintServerParsers: Dictionary<(xmlNode: SVGElement) => any> = {\n\n 'lineargradient': function (xmlNode: SVGElement) {\n // TODO:\n // Support that x1,y1,x2,y2 are not declared lineargradient but in node.\n const x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\n const y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\n const x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\n const y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\n\n const gradient = new LinearGradient(x1, y1, x2, y2);\n\n parsePaintServerUnit(xmlNode, gradient);\n\n parseGradientColorStops(xmlNode, gradient);\n\n return gradient;\n },\n\n 'radialgradient': function (xmlNode) {\n // TODO:\n // Support that x1,y1,x2,y2 are not declared radialgradient but in node.\n // TODO:\n // Support fx, fy, fr.\n const cx = parseInt(xmlNode.getAttribute('cx') || '0', 10);\n const cy = parseInt(xmlNode.getAttribute('cy') || '0', 10);\n const r = parseInt(xmlNode.getAttribute('r') || '0', 10);\n\n const gradient = new RadialGradient(cx, cy, r);\n\n parsePaintServerUnit(xmlNode, gradient);\n\n parseGradientColorStops(xmlNode, gradient);\n\n return gradient;\n }\n\n // TODO\n // 'pattern': function (xmlNode: SVGElement) {\n // }\n};\n\nfunction parsePaintServerUnit(xmlNode: SVGElement, gradient: Gradient) {\n const gradientUnits = xmlNode.getAttribute('gradientUnits');\n if (gradientUnits === 'userSpaceOnUse') {\n gradient.global = true;\n }\n}\n\nfunction parseGradientColorStops(xmlNode: SVGElement, gradient: GradientObject): void {\n\n let stop = xmlNode.firstChild as SVGStopElement;\n\n while (stop) {\n if (stop.nodeType === 1\n // there might be some other irrelevant tags used by editor.\n && stop.nodeName.toLocaleLowerCase() === 'stop'\n ) {\n const offsetStr = stop.getAttribute('offset');\n let offset: number;\n if (offsetStr && offsetStr.indexOf('%') > 0) { // percentage\n offset = parseInt(offsetStr, 10) / 100;\n }\n else if (offsetStr) { // number from 0 to 1\n offset = parseFloat(offsetStr);\n }\n else {\n offset = 0;\n }\n\n // has higher priority than\n // \n const styleVals = {} as Dictionary;\n parseInlineStyle(stop, styleVals, styleVals);\n const stopColor = styleVals.stopColor\n || stop.getAttribute('stop-color')\n || '#000000';\n\n gradient.colorStops.push({\n offset: offset,\n color: stopColor\n });\n }\n stop = stop.nextSibling as SVGStopElement;\n }\n}\n\nfunction inheritStyle(parent: Element, child: Element): void {\n if (parent && (parent as ElementExtended).__inheritedStyle) {\n if (!(child as ElementExtended).__inheritedStyle) {\n (child as ElementExtended).__inheritedStyle = {};\n }\n defaults((child as ElementExtended).__inheritedStyle, (parent as ElementExtended).__inheritedStyle);\n }\n}\n\nfunction parsePoints(pointsString: string): number[][] {\n const list = splitNumberSequence(pointsString);\n const points = [];\n\n for (let i = 0; i < list.length; i += 2) {\n const x = parseFloat(list[i]);\n const y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n return points;\n}\n\nfunction parseAttributes(\n xmlNode: SVGElement,\n el: Element,\n defsUsePending: DefsUsePending,\n onlyInlineStyle: boolean,\n isTextGroup: boolean\n): void {\n const disp = el as DisplayableExtended;\n const inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};\n const selfStyle: SelfStyleByZRKey = {};\n\n // TODO Shadow\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n\n parseInlineStyle(xmlNode, inheritedStyle, selfStyle);\n\n if (!onlyInlineStyle) {\n parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);\n }\n }\n\n disp.style = disp.style || {};\n\n if (inheritedStyle.fill != null) {\n disp.style.fill = getFillStrokeStyle(disp, 'fill', inheritedStyle.fill, defsUsePending);\n }\n if (inheritedStyle.stroke != null) {\n disp.style.stroke = getFillStrokeStyle(disp, 'stroke', inheritedStyle.stroke, defsUsePending);\n }\n\n each([\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\n ] as const, function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = parseFloat(inheritedStyle[propName]);\n }\n });\n\n each([\n 'lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign'\n ] as const, function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = inheritedStyle[propName];\n }\n });\n\n // Because selfStyle only support textBaseline, so only text group need it.\n // in other cases selfStyle can be released.\n if (isTextGroup) {\n disp.__selfStyle = selfStyle;\n }\n\n if (inheritedStyle.lineDash) {\n disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) {\n return parseFloat(str);\n });\n }\n\n if (inheritedStyle.visibility === 'hidden' || inheritedStyle.visibility === 'collapse') {\n disp.invisible = true;\n }\n\n if (inheritedStyle.display === 'none') {\n disp.ignore = true;\n }\n}\n\nfunction applyTextAlignment(\n text: TSpan,\n parentGroup: Group\n): void {\n const parentSelfStyle = (parentGroup as ElementExtended).__selfStyle;\n if (parentSelfStyle) {\n const textBaseline = parentSelfStyle.textBaseline;\n let zrTextBaseline = textBaseline as CanvasTextBaseline;\n if (!textBaseline || textBaseline === 'auto') {\n // FIXME: 'auto' means the value is the dominant-baseline of the script to\n // which the character belongs - i.e., use the dominant-baseline of the parent.\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'baseline') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'before-edge' || textBaseline === 'text-before-edge') {\n zrTextBaseline = 'top';\n }\n else if (textBaseline === 'after-edge' || textBaseline === 'text-after-edge') {\n zrTextBaseline = 'bottom';\n }\n else if (textBaseline === 'central' || textBaseline === 'mathematical') {\n zrTextBaseline = 'middle';\n }\n text.style.textBaseline = zrTextBaseline;\n }\n\n const parentInheritedStyle = (parentGroup as ElementExtended).__inheritedStyle;\n if (parentInheritedStyle) {\n // PENDING:\n // canvas `direction` is an experimental attribute.\n // so we do not support SVG direction \"rtl\" for text-anchor yet.\n const textAlign = parentInheritedStyle.textAlign;\n let zrTextAlign = textAlign as CanvasTextAlign;\n if (textAlign) {\n if (textAlign === 'middle') {\n zrTextAlign = 'center';\n }\n text.style.textAlign = zrTextAlign;\n }\n }\n}\n\n// Support `fill:url(#someId)`.\nconst urlRegex = /^url\\(\\s*#(.*?)\\)/;\nfunction getFillStrokeStyle(\n el: Displayable,\n method: 'fill' | 'stroke',\n str: string,\n defsUsePending: DefsUsePending\n): string {\n const urlMatch = str && str.match(urlRegex);\n if (urlMatch) {\n const url = trim(urlMatch[1]);\n defsUsePending.push([el, method, url]);\n return;\n }\n // SVG fill and stroke can be 'none'.\n if (str === 'none') {\n str = null;\n }\n return str;\n}\n\nfunction applyDefs(\n defs: DefsMap,\n defsUsePending: DefsUsePending\n): void {\n for (let i = 0; i < defsUsePending.length; i++) {\n const item = defsUsePending[i];\n item[0].style[item[1]] = defs[item[2]];\n }\n}\n\n// value can be like:\n// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983',\n// 'l-.5E1,54', '121-23-44-11' (no delimiter)\n// PENDING: here continuous commas are treat as one comma, but the\n// browser SVG parser treats this by printing error.\nconst numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction splitNumberSequence(rawStr: string): string[] {\n return rawStr.match(numberReg) || [];\n}\n// Most of the values can be separated by comma and/or white space.\n// const DILIMITER_REG = /[\\s,]+/;\n\n\nconst transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.eE,]*)\\)/g;\nconst DEGREE_TO_ANGLE = Math.PI / 180;\n\nfunction parseTransformAttribute(xmlNode: SVGElement, node: Element): void {\n let transform = xmlNode.getAttribute('transform');\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n const transformOps: string[] = [];\n let mt = null;\n transform.replace(transformRegex, function (str: string, type: string, value: string) {\n transformOps.push(type, value);\n return '';\n });\n\n for (let i = transformOps.length - 1; i > 0; i -= 2) {\n const value = transformOps[i];\n const type = transformOps[i - 1];\n const valueArr: string[] = splitNumberSequence(value);\n mt = mt || matrix.create();\n switch (type) {\n case 'translate':\n matrix.translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\n break;\n case 'scale':\n matrix.scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\n break;\n case 'rotate':\n // TODO: zrender use different hand in coordinate system.\n matrix.rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [\n parseFloat(valueArr[1] || '0'),\n parseFloat(valueArr[2] || '0')\n ]);\n break;\n case 'skewX':\n const sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, 0, sx, 1, 0, 0], mt);\n break;\n case 'skewY':\n const sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, sy, 0, 1, 0, 0], mt);\n break;\n case 'matrix':\n mt[0] = parseFloat(valueArr[0]);\n mt[1] = parseFloat(valueArr[1]);\n mt[2] = parseFloat(valueArr[2]);\n mt[3] = parseFloat(valueArr[3]);\n mt[4] = parseFloat(valueArr[4]);\n mt[5] = parseFloat(valueArr[5]);\n break;\n }\n }\n node.setLocalTransform(mt);\n }\n}\n\n// Value may contain space.\nconst styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\nfunction parseInlineStyle(\n xmlNode: SVGElement,\n inheritableStyleResult: Dictionary,\n selfStyleResult: Dictionary\n): void {\n const style = xmlNode.getAttribute('style');\n\n if (!style) {\n return;\n }\n\n styleRegex.lastIndex = 0;\n let styleRegResult;\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n const svgStlAttr = styleRegResult[1];\n\n const zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr as keyof typeof INHERITABLE_STYLE_ATTRIBUTES_MAP]\n : null;\n if (zrInheritableStlAttr) {\n inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];\n }\n\n const zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr as keyof typeof SELF_STYLE_ATTRIBUTES_MAP]\n : null;\n if (zrSelfStlAttr) {\n selfStyleResult[zrSelfStlAttr] = styleRegResult[2];\n }\n }\n}\n\nfunction parseAttributeStyle(\n xmlNode: SVGElement,\n inheritableStyleResult: Dictionary,\n selfStyleResult: Dictionary\n): void {\n for (let i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n const svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];\n const attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n for (let i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n const svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];\n const attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n}\n\nexport function makeViewBoxTransform(viewBoxRect: RectLike, boundingRect: RectLike): {\n scale: number;\n x: number;\n y: number;\n} {\n const scaleX = boundingRect.width / viewBoxRect.width;\n const scaleY = boundingRect.height / viewBoxRect.height;\n const scale = Math.min(scaleX, scaleY);\n // preserveAspectRatio 'xMidYMid'\n\n return {\n scale,\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2)\n };\n}\n\nexport function parseSVG(xml: string | Document | SVGElement, opt: SVGParserOption): SVGParserResult {\n const parser = new SVGParser();\n return parser.parse(xml, opt);\n}\n\n\n// Also export parseXML to avoid breaking change.\nexport {parseXML};\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { parseSVG, makeViewBoxTransform, SVGNodeTagLower, SVGParserResultNamedItem } from 'zrender/src/tool/parseSVG';\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport Rect from 'zrender/src/graphic/shape/Rect';\r\nimport {assert, createHashMap, each, HashMap} from 'zrender/src/core/util';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport { GeoResource, GeoSVGGraphicRoot, GeoSVGSourceInput } from './geoTypes';\r\nimport { parseXML } from 'zrender/src/tool/parseXML';\r\nimport { GeoSVGRegion } from './Region';\r\nimport Element from 'zrender/src/Element';\r\n\r\nexport interface GeoSVGGraphicRecord {\r\n root: Group;\r\n boundingRect: BoundingRect;\r\n named: SVGParserResultNamedItem[];\r\n}\r\n\r\n/**\r\n * \"region available\" means that: enable users to set attribute `name=\"xxx\"` on those tags\r\n * to make it be a region.\r\n * 1. region styles and its label styles can be defined in echarts opton:\r\n * ```js\r\n * geo: {\r\n * regions: [{\r\n * name: 'xxx',\r\n * itemStyle: { ... },\r\n * label: { ... }\r\n * }, {\r\n * ...\r\n * },\r\n * ...]\r\n * };\r\n * ```\r\n * 2. name can be duplicated in different SVG tag. All of the tags with the same name share\r\n * a region option. For exampel if there are two representing two lung lobes. They have\r\n * no common parents but both of them need to display label \"lung\" inside.\r\n */\r\nconst REGION_AVAILABLE_SVG_TAG_MAP = createHashMap([\r\n 'rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path',\r\n // are also enabled because some SVG might paint text itself,\r\n // but still need to trigger events or tooltip.\r\n 'text', 'tspan',\r\n // is also enabled because this case: if multiple tags share one name\r\n // and need label displayed, every tags will display the name, which is not\r\n // expected. So we can put them into a . Thereby only one label\r\n // displayed and located based on the bounding rect of the .\r\n 'g'\r\n]);\r\n\r\nexport class GeoSVGResource implements GeoResource {\r\n\r\n readonly type = 'geoSVG';\r\n private _mapName: string;\r\n private _parsedXML: SVGElement;\r\n\r\n private _firstGraphic: GeoSVGGraphicRecord;\r\n private _boundingRect: BoundingRect;\r\n private _regions: GeoSVGRegion[];\r\n // Key: region.name\r\n private _regionsMap: HashMap;\r\n\r\n // All used graphics. key: hostKey, value: root\r\n private _usedGraphicMap: HashMap = createHashMap();\r\n // All unused graphics.\r\n private _freedGraphics: GeoSVGGraphicRecord[] = [];\r\n\r\n constructor(\r\n mapName: string,\r\n svg: GeoSVGSourceInput\r\n ) {\r\n this._mapName = mapName;\r\n\r\n // Only perform parse to XML object here, which might be time\r\n // consiming for large SVG.\r\n // Although convert XML to zrender element is also time consiming,\r\n // if we do it here, the clone of zrender elements has to be\r\n // required. So we do it once for each geo instance, util real\r\n // performance issues call for optimizing it.\r\n this._parsedXML = parseXML(svg);\r\n }\r\n\r\n load(/* nameMap: NameMap */) {\r\n // In the \"load\" stage, graphic need to be built to\r\n // get boundingRect for geo coordinate system.\r\n let firstGraphic = this._firstGraphic;\r\n\r\n // Create the return data structure only when first graphic created.\r\n // Because they will be used in geo coordinate system update stage,\r\n // and `regions` will be mounted at `geo` coordinate system,\r\n // in which there is no \"view\" info, so that it should better not to\r\n // make references to graphic elements.\r\n if (!firstGraphic) {\r\n firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);\r\n\r\n this._freedGraphics.push(firstGraphic);\r\n\r\n this._boundingRect = this._firstGraphic.boundingRect.clone();\r\n\r\n // PENDING: `nameMap` will not be supported until some real requirement come.\r\n // if (nameMap) {\r\n // named = applyNameMap(named, nameMap);\r\n // }\r\n\r\n const { regions, regionsMap } = createRegions(firstGraphic.named);\r\n this._regions = regions;\r\n this._regionsMap = regionsMap;\r\n }\r\n\r\n return {\r\n boundingRect: this._boundingRect,\r\n regions: this._regions,\r\n regionsMap: this._regionsMap\r\n };\r\n }\r\n\r\n private _buildGraphic(\r\n svgXML: SVGElement\r\n ): GeoSVGGraphicRecord {\r\n let result;\r\n let rootFromParse;\r\n\r\n try {\r\n result = svgXML && parseSVG(svgXML, {\r\n ignoreViewBox: true,\r\n ignoreRootClip: true\r\n }) || {};\r\n rootFromParse = result.root;\r\n assert(rootFromParse != null);\r\n }\r\n catch (e) {\r\n throw new Error('Invalid svg format\\n' + e.message);\r\n }\r\n\r\n // Note: we keep the covenant that the root has no transform. So always add an extra root.\r\n const root = new Group();\r\n root.add(rootFromParse);\r\n (root as GeoSVGGraphicRoot).isGeoSVGGraphicRoot = true;\r\n\r\n // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]\r\n //\r\n // Consider: ``\r\n // - the `width/height` we call it `svgWidth/svgHeight` for short.\r\n // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,\r\n // \"viewport boundingRect\", or `boundingRect` for short.\r\n // - `viewBox` defines the transform from the real content ot the viewport.\r\n // `viewBox` has the same unit as the content of SVG.\r\n // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become\r\n // different from the content of SVG. Otherwise, they are the same.\r\n //\r\n // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:\r\n // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).\r\n // 1. Make a transform from `viewBox` to `boundingRect`.\r\n // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve\r\n // the aspect ratio.\r\n // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])\r\n // (`Geo`/`View` will do this job).\r\n // Note: this transform might not preserve aspect radio, which depending on how users specify\r\n // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,\r\n // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).\r\n //\r\n // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG\r\n // layout look good.\r\n //\r\n // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect\r\n // of the SVG content and use them to make SVG layout look good.\r\n\r\n const svgWidth = result.width;\r\n const svgHeight = result.height;\r\n const viewBoxRect = result.viewBoxRect;\r\n\r\n let boundingRect = this._boundingRect;\r\n if (!boundingRect) {\r\n let bRectX;\r\n let bRectY;\r\n let bRectWidth;\r\n let bRectHeight;\r\n\r\n if (svgWidth != null) {\r\n bRectX = 0;\r\n bRectWidth = svgWidth;\r\n }\r\n else if (viewBoxRect) {\r\n bRectX = viewBoxRect.x;\r\n bRectWidth = viewBoxRect.width;\r\n }\r\n\r\n if (svgHeight != null) {\r\n bRectY = 0;\r\n bRectHeight = svgHeight;\r\n }\r\n else if (viewBoxRect) {\r\n bRectY = viewBoxRect.y;\r\n bRectHeight = viewBoxRect.height;\r\n }\r\n\r\n // If both viewBox and svgWidth/svgHeight not specified,\r\n // we have to determine how to layout those element to make them look good.\r\n if (bRectX == null || bRectY == null) {\r\n const calculatedBoundingRect = rootFromParse.getBoundingRect();\r\n if (bRectX == null) {\r\n bRectX = calculatedBoundingRect.x;\r\n bRectWidth = calculatedBoundingRect.width;\r\n }\r\n if (bRectY == null) {\r\n bRectY = calculatedBoundingRect.y;\r\n bRectHeight = calculatedBoundingRect.height;\r\n }\r\n }\r\n\r\n boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);\r\n }\r\n\r\n if (viewBoxRect) {\r\n const viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect);\r\n // Only support `preserveAspectRatio 'xMidYMid'`\r\n rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;\r\n rootFromParse.x = viewBoxTransform.x;\r\n rootFromParse.y = viewBoxTransform.y;\r\n }\r\n\r\n // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.\r\n // They do not strictly confine all of the content inside a display rect, but deliberately\r\n // use a `viewBox` to define a displayable rect.\r\n // PENDING:\r\n // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the\r\n // edge might also be clipped, because region labels are put as `textContent` of the SVG path.\r\n root.setClipPath(new Rect({\r\n shape: boundingRect.plain()\r\n }));\r\n\r\n const named = [] as GeoSVGGraphicRecord['named'];\r\n each(result.named, namedItem => {\r\n if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {\r\n named.push(namedItem);\r\n setSilent(namedItem.el);\r\n }\r\n });\r\n\r\n return { root, boundingRect, named };\r\n }\r\n\r\n /**\r\n * Consider:\r\n * (1) One graphic element can not be shared by different `geoView` running simultaneously.\r\n * Notice, also need to consider multiple echarts instances share a `mapRecord`.\r\n * (2) Converting SVG to graphic elements is time consuming.\r\n * (3) In the current architecture, `load` should be called frequently to get boundingRect,\r\n * and it is called without view info.\r\n * So we maintain graphic elements in this module, and enables `view` to use/return these\r\n * graphics from/to the pool with it's uid.\r\n */\r\n useGraphic(hostKey: string /* , nameMap: NameMap */): GeoSVGGraphicRecord {\r\n const usedRootMap = this._usedGraphicMap;\r\n\r\n let svgGraphic = usedRootMap.get(hostKey);\r\n if (svgGraphic) {\r\n return svgGraphic;\r\n }\r\n\r\n svgGraphic = this._freedGraphics.pop()\r\n // use the first boundingRect to avoid duplicated boundingRect calculation.\r\n || this._buildGraphic(this._parsedXML);\r\n\r\n usedRootMap.set(hostKey, svgGraphic);\r\n\r\n // PENDING: `nameMap` will not be supported until some real requirement come.\r\n // `nameMap` can only be obtained from echarts option.\r\n // The original `named` must not be modified.\r\n // if (nameMap) {\r\n // svgGraphic = extend({}, svgGraphic);\r\n // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap);\r\n // }\r\n\r\n return svgGraphic;\r\n }\r\n\r\n freeGraphic(hostKey: string): void {\r\n const usedRootMap = this._usedGraphicMap;\r\n\r\n const svgGraphic = usedRootMap.get(hostKey);\r\n if (svgGraphic) {\r\n usedRootMap.removeKey(hostKey);\r\n this._freedGraphics.push(svgGraphic);\r\n }\r\n }\r\n\r\n}\r\n\r\n\r\nfunction setSilent(el: Element): void {\r\n // Only named element has silent: false, other elements should\r\n // act as background and has no user interaction.\r\n el.silent = false;\r\n // text|tspan will be converted to group.\r\n if (el.isGroup) {\r\n el.traverse(child => {\r\n child.silent = false;\r\n });\r\n }\r\n}\r\n\r\nfunction createRegions(\r\n named: SVGParserResultNamedItem[]\r\n): {\r\n regions: GeoSVGRegion[];\r\n regionsMap: HashMap;\r\n} {\r\n\r\n const regions: GeoSVGRegion[] = [];\r\n const regionsMap = createHashMap();\r\n\r\n // Create resions only for the first graphic.\r\n each(named, namedItem => {\r\n // Region has feature to calculate center for tooltip or other features.\r\n // If there is a , the center should be the center of the\r\n // bounding rect of the g.\r\n if (namedItem.namedFrom != null) {\r\n return;\r\n }\r\n\r\n const region = new GeoSVGRegion(namedItem.name, namedItem.el);\r\n // PENDING: if `nameMap` supported, this region can not be mounted on\r\n // `this`, but can only be created each time `load()` called.\r\n regions.push(region);\r\n // PENDING: if multiple tag named with the same name, only one will be\r\n // found by `_regionsMap`. `_regionsMap` is used to find a coordinate\r\n // by name. We use `region.getCenter()` as the coordinate.\r\n regionsMap.set(namedItem.name, region);\r\n });\r\n\r\n return { regions, regionsMap };\r\n}\r\n\r\n\r\n// PENDING: `nameMap` will not be supported until some real requirement come.\r\n// /**\r\n// * Use the alias in geoNameMap.\r\n// * The input `named` must not be modified.\r\n// */\r\n// function applyNameMap(\r\n// named: GeoSVGGraphicRecord['named'],\r\n// nameMap: NameMap\r\n// ): GeoSVGGraphicRecord['named'] {\r\n// const result = [] as GeoSVGGraphicRecord['named'];\r\n// for (let i = 0; i < named.length; i++) {\r\n// let regionGraphic = named[i];\r\n// const name = regionGraphic.name;\r\n// if (nameMap && nameMap.hasOwnProperty(name)) {\r\n// regionGraphic = extend({}, regionGraphic);\r\n// regionGraphic.name = name;\r\n// }\r\n// result.push(regionGraphic);\r\n// }\r\n// return result;\r\n// }\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Fix for \u5357\u6D77\u8BF8\u5C9B\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { GeoJSONRegion } from '../Region';\r\n\r\nconst geoCoord = [126, 25];\r\nconst nanhaiName = '\u5357\u6D77\u8BF8\u5C9B';\r\n\r\nconst points = [\r\n [[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7],\r\n [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]],\r\n [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]],\r\n [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]],\r\n [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]],\r\n [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]],\r\n [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]],\r\n [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]],\r\n [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]],\r\n [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]],\r\n [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]],\r\n [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]],\r\n [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4],\r\n [1, 92.4], [1, 3.5], [0, 3.5]]\r\n];\r\n\r\nfor (let i = 0; i < points.length; i++) {\r\n for (let k = 0; k < points[i].length; k++) {\r\n points[i][k][0] /= 10.5;\r\n points[i][k][1] /= -10.5 / 0.75;\r\n\r\n points[i][k][0] += geoCoord[0];\r\n points[i][k][1] += geoCoord[1];\r\n }\r\n}\r\n\r\nexport default function fixNanhai(mapType: string, regions: GeoJSONRegion[]) {\r\n if (mapType === 'china') {\r\n for (let i = 0; i < regions.length; i++) {\r\n // Already exists.\r\n if (regions[i].name === nanhaiName) {\r\n return;\r\n }\r\n }\r\n\r\n regions.push(new GeoJSONRegion(\r\n nanhaiName,\r\n zrUtil.map(points, function (exterior) {\r\n return {\r\n type: 'polygon',\r\n exterior: exterior\r\n };\r\n }), geoCoord\r\n ));\r\n }\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { GeoJSONRegion } from '../Region';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\n\r\nconst coordsOffsetMap = {\r\n '\u5357\u6D77\u8BF8\u5C9B': [32, 80],\r\n // \u5168\u56FD\r\n '\u5E7F\u4E1C': [0, -10],\r\n '\u9999\u6E2F': [10, 5],\r\n '\u6FB3\u95E8': [-10, 10],\r\n // '\u5317\u4EAC': [-10, 0],\r\n '\u5929\u6D25': [5, 5]\r\n} as Dictionary;\r\n\r\nexport default function fixTextCoords(mapType: string, region: GeoJSONRegion) {\r\n if (mapType === 'china') {\r\n const coordFix = coordsOffsetMap[region.name];\r\n if (coordFix) {\r\n const cp = region.getCenter();\r\n cp[0] += coordFix[0] / 10.5;\r\n cp[1] += -coordFix[1] / (10.5 / 0.75);\r\n region.setCenter(cp);\r\n }\r\n }\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { GeoJSONRegion } from '../Region';\r\n\r\n// Fix for \u9493\u9C7C\u5C9B\r\n\r\n// let Region = require('../Region');\r\n// let zrUtil = require('zrender/src/core/util');\r\n\r\n// let geoCoord = [126, 25];\r\n\r\nconst points = [\r\n [\r\n [123.45165252685547, 25.73527164402261],\r\n [123.49731445312499, 25.73527164402261],\r\n [123.49731445312499, 25.750734064600884],\r\n [123.45165252685547, 25.750734064600884],\r\n [123.45165252685547, 25.73527164402261]\r\n ]\r\n];\r\n\r\nexport default function fixDiaoyuIsland(mapType: string, region: GeoJSONRegion) {\r\n if (mapType === 'china' && region.name === '\u53F0\u6E7E') {\r\n region.geometries.push({\r\n type: 'polygon',\r\n exterior: points[0]\r\n });\r\n }\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport { each, isString, createHashMap, hasOwn } from 'zrender/src/core/util';\r\nimport parseGeoJson from './parseGeoJson';\r\n// Built-in GEO fixer.\r\nimport fixNanhai from './fix/nanhai';\r\nimport fixTextCoord from './fix/textCoord';\r\nimport fixDiaoyuIsland from './fix/diaoyuIsland';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport { GeoJSONRegion } from './Region';\r\nimport { GeoJSON, GeoJSONCompressed, GeoJSONSourceInput, GeoResource, GeoSpecialAreas, NameMap } from './geoTypes';\r\n\r\n\r\nconst DEFAULT_NAME_PROPERTY = 'name' as const;\r\n\r\nexport class GeoJSONResource implements GeoResource {\r\n\r\n readonly type = 'geoJSON';\r\n private _geoJSON: GeoJSON | GeoJSONCompressed;\r\n private _specialAreas: GeoSpecialAreas;\r\n private _mapName: string;\r\n\r\n private _parsedMap = createHashMap<{\r\n regions: GeoJSONRegion[];\r\n boundingRect: BoundingRect;\r\n }, string>();\r\n\r\n constructor(\r\n mapName: string,\r\n geoJSON: GeoJSONSourceInput,\r\n specialAreas: GeoSpecialAreas\r\n ) {\r\n this._mapName = mapName;\r\n this._specialAreas = specialAreas;\r\n\r\n // PENDING: delay the parse to the first usage to rapid up the FMP?\r\n this._geoJSON = parseInput(geoJSON);\r\n }\r\n\r\n /**\r\n * @param nameMap can be null/undefined\r\n * @param nameProperty can be null/undefined\r\n */\r\n load(nameMap: NameMap, nameProperty: string) {\r\n\r\n nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;\r\n\r\n let parsed = this._parsedMap.get(nameProperty);\r\n if (!parsed) {\r\n const rawRegions = this._parseToRegions(nameProperty);\r\n parsed = this._parsedMap.set(nameProperty, {\r\n regions: rawRegions,\r\n boundingRect: calculateBoundingRect(rawRegions)\r\n });\r\n }\r\n\r\n const regionsMap = createHashMap();\r\n\r\n const finalRegions: GeoJSONRegion[] = [];\r\n each(parsed.regions, function (region) {\r\n let regionName = region.name;\r\n\r\n // Try use the alias in geoNameMap\r\n if (nameMap && hasOwn(nameMap, regionName)) {\r\n region = region.cloneShallow(regionName = nameMap[regionName]);\r\n }\r\n\r\n finalRegions.push(region);\r\n regionsMap.set(regionName, region);\r\n });\r\n\r\n return {\r\n regions: finalRegions,\r\n boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),\r\n regionsMap: regionsMap\r\n };\r\n }\r\n\r\n private _parseToRegions(nameProperty: string): GeoJSONRegion[] {\r\n const mapName = this._mapName;\r\n const geoJSON = this._geoJSON;\r\n let rawRegions;\r\n\r\n // https://jsperf.com/try-catch-performance-overhead\r\n try {\r\n rawRegions = geoJSON ? parseGeoJson(geoJSON, nameProperty) : [];\r\n }\r\n catch (e) {\r\n throw new Error('Invalid geoJson format\\n' + e.message);\r\n }\r\n\r\n fixNanhai(mapName, rawRegions);\r\n\r\n each(rawRegions, function (region) {\r\n const regionName = region.name;\r\n\r\n fixTextCoord(mapName, region);\r\n fixDiaoyuIsland(mapName, region);\r\n\r\n // Some area like Alaska in USA map needs to be tansformed\r\n // to look better\r\n const specialArea = this._specialAreas && this._specialAreas[regionName];\r\n if (specialArea) {\r\n region.transformTo(\r\n specialArea.left, specialArea.top, specialArea.width, specialArea.height\r\n );\r\n }\r\n }, this);\r\n\r\n return rawRegions;\r\n }\r\n\r\n /**\r\n * Only for exporting to users.\r\n * **MUST NOT** used internally.\r\n */\r\n getMapForUser(): {\r\n // backward compat.\r\n geoJson: GeoJSON | GeoJSONCompressed;\r\n geoJSON: GeoJSON | GeoJSONCompressed;\r\n specialAreas: GeoSpecialAreas;\r\n } {\r\n return {\r\n // For backward compatibility, use geoJson\r\n // PENDING: it has been returning them without clone.\r\n // do we need to avoid outsite modification?\r\n geoJson: this._geoJSON,\r\n geoJSON: this._geoJSON,\r\n specialAreas: this._specialAreas\r\n };\r\n }\r\n\r\n}\r\n\r\nfunction calculateBoundingRect(regions: GeoJSONRegion[]): BoundingRect {\r\n let rect;\r\n for (let i = 0; i < regions.length; i++) {\r\n const regionRect = regions[i].getBoundingRect();\r\n rect = rect || regionRect.clone();\r\n rect.union(regionRect);\r\n }\r\n return rect;\r\n}\r\n\r\nfunction parseInput(source: GeoJSONSourceInput): GeoJSON | GeoJSONCompressed {\r\n return !isString(source)\r\n ? source\r\n : (typeof JSON !== 'undefined' && JSON.parse)\r\n ? JSON.parse(source)\r\n : (new Function('return (' + source + ');'))();\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { createHashMap } from 'zrender/src/core/util';\r\nimport { GeoSVGResource } from './GeoSVGResource';\r\nimport {\r\n GeoJSON,\r\n GeoJSONSourceInput,\r\n GeoResource,\r\n GeoSpecialAreas,\r\n NameMap,\r\n GeoSVGSourceInput\r\n} from './geoTypes';\r\nimport { GeoJSONResource } from './GeoJSONResource';\r\n\r\n\r\ntype MapInput = GeoJSONMapInput | SVGMapInput;\r\ninterface GeoJSONMapInput {\r\n geoJSON: GeoJSONSourceInput;\r\n specialAreas: GeoSpecialAreas;\r\n}\r\ninterface GeoJSONMapInputCompat extends GeoJSONMapInput {\r\n geoJson: GeoJSONSourceInput;\r\n}\r\ninterface SVGMapInput {\r\n svg: GeoSVGSourceInput;\r\n}\r\n\r\n\r\nconst storage = createHashMap();\r\n\r\n\r\nexport default {\r\n\r\n /**\r\n * Compatible with previous `echarts.registerMap`.\r\n *\r\n * @usage\r\n * ```js\r\n *\r\n * echarts.registerMap('USA', geoJson, specialAreas);\r\n *\r\n * echarts.registerMap('USA', {\r\n * geoJson: geoJson,\r\n * specialAreas: {...}\r\n * });\r\n * echarts.registerMap('USA', {\r\n * geoJSON: geoJson,\r\n * specialAreas: {...}\r\n * });\r\n *\r\n * echarts.registerMap('airport', {\r\n * svg: svg\r\n * }\r\n * ```\r\n *\r\n * Note:\r\n * Do not support that register multiple geoJSON or SVG\r\n * one map name. Because different geoJSON and SVG have\r\n * different unit. It's not easy to make sure how those\r\n * units are mapping/normalize.\r\n * If intending to use multiple geoJSON or SVG, we can\r\n * use multiple geo coordinate system.\r\n */\r\n registerMap: function (\r\n mapName: string,\r\n rawDef: MapInput | GeoJSONSourceInput,\r\n rawSpecialAreas?: GeoSpecialAreas\r\n ): void {\r\n\r\n if ((rawDef as SVGMapInput).svg) {\r\n const resource = new GeoSVGResource(\r\n mapName,\r\n (rawDef as SVGMapInput).svg\r\n );\r\n\r\n storage.set(mapName, resource);\r\n }\r\n else {\r\n // Recommend:\r\n // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });\r\n // Backward compatibility:\r\n // echarts.registerMap('eu', geoJSON, specialAreas);\r\n // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });\r\n let geoJSON = (rawDef as GeoJSONMapInputCompat).geoJson\r\n || (rawDef as GeoJSONMapInput).geoJSON;\r\n if (geoJSON && !(rawDef as GeoJSON).features) {\r\n rawSpecialAreas = (rawDef as GeoJSONMapInput).specialAreas;\r\n }\r\n else {\r\n geoJSON = rawDef as GeoJSONSourceInput;\r\n }\r\n const resource = new GeoJSONResource(\r\n mapName,\r\n geoJSON,\r\n rawSpecialAreas\r\n );\r\n\r\n storage.set(mapName, resource);\r\n }\r\n },\r\n\r\n getGeoResource(mapName: string): GeoResource {\r\n return storage.get(mapName);\r\n },\r\n\r\n /**\r\n * Only for exporting to users.\r\n * **MUST NOT** used internally.\r\n */\r\n getMapForUser: function (mapName: string): ReturnType {\r\n const resource = storage.get(mapName);\r\n // Do not support return SVG until some real requirement come.\r\n return resource && resource.type === 'geoJSON'\r\n && (resource as GeoJSONResource).getMapForUser();\r\n },\r\n\r\n load: function (mapName: string, nameMap: NameMap, nameProperty: string): ReturnType {\r\n const resource = storage.get(mapName);\r\n\r\n if (!resource) {\r\n if (__DEV__) {\r\n console.error(\r\n 'Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.'\r\n );\r\n }\r\n return;\r\n }\r\n\r\n return resource.load(nameMap, nameProperty);\r\n }\r\n\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport RoamController from './RoamController';\r\nimport * as roamHelper from '../../component/helper/roamHelper';\r\nimport {onIrrelevantElement} from '../../component/helper/cursorHelper';\r\nimport * as graphic from '../../util/graphic';\r\nimport {\r\n toggleHoverEmphasis,\r\n enableComponentHighDownFeatures,\r\n setDefaultStateProxy\r\n} from '../../util/states';\r\nimport geoSourceManager from '../../coord/geo/geoSourceManager';\r\nimport {getUID} from '../../util/component';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GeoModel, { GeoCommonOptionMixin, GeoItemStyleOption, RegoinOption } from '../../coord/geo/GeoModel';\r\nimport MapSeries, { MapDataItemOption } from '../../chart/map/MapSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport { Payload, ECElement, LineStyleOption, InnerFocus, DisplayState } from '../../util/types';\r\nimport GeoView from '../geo/GeoView';\r\nimport MapView from '../../chart/map/MapView';\r\nimport Geo from '../../coord/geo/Geo';\r\nimport Model from '../../model/Model';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { createOrUpdatePatternFromDecal } from '../../util/decal';\r\nimport ZRText, {TextStyleProps} from 'zrender/src/graphic/Text';\r\nimport { ViewCoordSysTransformInfoPart } from '../../coord/View';\r\nimport { GeoSVGGraphicRecord, GeoSVGResource } from '../../coord/geo/GeoSVGResource';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport Element from 'zrender/src/Element';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { GeoJSONRegion } from '../../coord/geo/Region';\r\nimport { SVGNodeTagLower } from 'zrender/src/tool/parseSVG';\r\nimport { makeInner } from '../../util/model';\r\nimport { GeoProjection, ProjectionStream } from '../../coord/geo/geoTypes';\r\n\r\ninterface RegionsGroup extends graphic.Group {\r\n}\r\n\r\ntype RegionModel = ReturnType | ReturnType;\r\n\r\ntype MapOrGeoModel = GeoModel | MapSeries;\r\n\r\ninterface ViewBuildContext {\r\n api: ExtensionAPI;\r\n geo: Geo;\r\n mapOrGeoModel: GeoModel | MapSeries;\r\n data: SeriesData;\r\n isVisualEncodedByVisualMap: boolean;\r\n isGeo: boolean;\r\n transformInfoRaw: ViewCoordSysTransformInfoPart;\r\n}\r\n\r\ninterface GeoStyleableOption {\r\n itemStyle?: GeoItemStyleOption;\r\n lineStyle?: LineStyleOption;\r\n}\r\ntype RegionName = string;\r\n\r\n/**\r\n * Only these tags enable use `itemStyle` if they are named in SVG.\r\n * Other tags like might not suitable for `itemStyle`.\r\n * They will not be considered to be styled until some requirements come.\r\n */\r\nconst OPTION_STYLE_ENABLED_TAGS: SVGNodeTagLower[] = [\r\n 'rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path'\r\n];\r\nconst OPTION_STYLE_ENABLED_TAG_MAP = zrUtil.createHashMap(\r\n OPTION_STYLE_ENABLED_TAGS\r\n);\r\nconst STATE_TRIGGER_TAG_MAP = zrUtil.createHashMap(\r\n OPTION_STYLE_ENABLED_TAGS.concat(['g']) as SVGNodeTagLower[]\r\n);\r\nconst LABEL_HOST_MAP = zrUtil.createHashMap(\r\n OPTION_STYLE_ENABLED_TAGS.concat(['g']) as SVGNodeTagLower[]\r\n);\r\nconst mapLabelRaw = makeInner<{\r\n ignore: boolean\r\n}, ZRText>();\r\n\r\n\r\nfunction getFixedItemStyle(model: Model) {\r\n const itemStyle = model.getItemStyle();\r\n const areaColor = model.get('areaColor');\r\n\r\n // If user want the color not to be changed when hover,\r\n // they should both set areaColor and color to be null.\r\n if (areaColor != null) {\r\n itemStyle.fill = areaColor;\r\n }\r\n\r\n return itemStyle;\r\n}\r\n// Only stroke can be used for line.\r\n// Using fill in style if stroke not exits.\r\n// TODO Not sure yet. Perhaps a separate `lineStyle`?\r\nfunction fixLineStyle(styleHost: { style: graphic.Path['style'] }) {\r\n const style = styleHost.style;\r\n if (style) {\r\n style.stroke = (style.stroke || style.fill);\r\n style.fill = null;\r\n }\r\n}\r\n\r\nclass MapDraw {\r\n\r\n private uid: string;\r\n\r\n private _controller: RoamController;\r\n\r\n private _controllerHost: {\r\n target: graphic.Group;\r\n zoom?: number;\r\n zoomLimit?: GeoCommonOptionMixin['scaleLimit'];\r\n };\r\n\r\n readonly group: graphic.Group;\r\n\r\n\r\n /**\r\n * This flag is used to make sure that only one among\r\n * `pan`, `zoom`, `click` can occurs, otherwise 'selected'\r\n * action may be triggered when `pan`, which is unexpected.\r\n */\r\n private _mouseDownFlag: boolean;\r\n\r\n private _regionsGroup: RegionsGroup;\r\n\r\n private _regionsGroupByName: zrUtil.HashMap;\r\n\r\n private _svgMapName: string;\r\n\r\n private _svgGroup: graphic.Group;\r\n\r\n private _svgGraphicRecord: GeoSVGGraphicRecord;\r\n\r\n // A name may correspond to multiple graphics.\r\n // Used as event dispatcher.\r\n private _svgDispatcherMap: zrUtil.HashMap;\r\n\r\n\r\n constructor(api: ExtensionAPI) {\r\n const group = new graphic.Group();\r\n this.uid = getUID('ec_map_draw');\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = { target: group };\r\n this.group = group;\r\n\r\n group.add(this._regionsGroup = new graphic.Group() as RegionsGroup);\r\n group.add(this._svgGroup = new graphic.Group());\r\n }\r\n\r\n draw(\r\n mapOrGeoModel: GeoModel | MapSeries,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n fromView: MapView | GeoView,\r\n payload: Payload\r\n ): void {\r\n\r\n const isGeo = mapOrGeoModel.mainType === 'geo';\r\n\r\n // Map series has data. GEO model that controlled by map series\r\n // will be assigned with map data. Other GEO model has no data.\r\n let data = (mapOrGeoModel as MapSeries).getData && (mapOrGeoModel as MapSeries).getData();\r\n isGeo && ecModel.eachComponent({mainType: 'series', subType: 'map'}, function (mapSeries: MapSeries) {\r\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\r\n data = mapSeries.getData();\r\n }\r\n });\r\n\r\n const geo = mapOrGeoModel.coordinateSystem;\r\n\r\n const regionsGroup = this._regionsGroup;\r\n const group = this.group;\r\n\r\n const transformInfo = geo.getTransformInfo();\r\n const transformInfoRaw = transformInfo.raw;\r\n const transformInfoRoam = transformInfo.roam;\r\n\r\n // No animation when first draw or in action\r\n const isFirstDraw = !regionsGroup.childAt(0) || payload;\r\n\r\n if (isFirstDraw) {\r\n group.x = transformInfoRoam.x;\r\n group.y = transformInfoRoam.y;\r\n group.scaleX = transformInfoRoam.scaleX;\r\n group.scaleY = transformInfoRoam.scaleY;\r\n group.dirty();\r\n }\r\n else {\r\n graphic.updateProps(group, transformInfoRoam, mapOrGeoModel);\r\n }\r\n\r\n const isVisualEncodedByVisualMap = data\r\n && data.getVisual('visualMeta')\r\n && data.getVisual('visualMeta').length > 0;\r\n\r\n const viewBuildCtx = {\r\n api,\r\n geo,\r\n mapOrGeoModel,\r\n data,\r\n isVisualEncodedByVisualMap,\r\n isGeo,\r\n transformInfoRaw\r\n };\r\n\r\n if (geo.resourceType === 'geoJSON') {\r\n this._buildGeoJSON(viewBuildCtx);\r\n }\r\n else if (geo.resourceType === 'geoSVG') {\r\n this._buildSVG(viewBuildCtx);\r\n }\r\n\r\n this._updateController(mapOrGeoModel, ecModel, api);\r\n\r\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\r\n }\r\n\r\n private _buildGeoJSON(viewBuildCtx: ViewBuildContext): void {\r\n const regionsGroupByName = this._regionsGroupByName = zrUtil.createHashMap();\r\n const regionsInfoByName = zrUtil.createHashMap<{\r\n dataIdx: number;\r\n regionModel: Model | Model;\r\n }, string>();\r\n const regionsGroup = this._regionsGroup;\r\n const transformInfoRaw = viewBuildCtx.transformInfoRaw;\r\n const mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\r\n const data = viewBuildCtx.data;\r\n const projection = viewBuildCtx.geo.projection;\r\n const projectionStream = projection && projection.stream;\r\n\r\n function transformPoint(point: number[], project: GeoProjection['project']): number[] {\r\n if (project) {\r\n // projection may return null point.\r\n point = project(point);\r\n }\r\n return point && [\r\n point[0] * transformInfoRaw.scaleX + transformInfoRaw.x,\r\n point[1] * transformInfoRaw.scaleY + transformInfoRaw.y\r\n ];\r\n };\r\n\r\n function transformPolygonPoints(inPoints: number[][]): number[][] {\r\n const outPoints = [];\r\n // If projectionStream is provided. Use it instead of single point project.\r\n const project = !projectionStream && projection && projection.project;\r\n for (let i = 0; i < inPoints.length; ++i) {\r\n const newPt = transformPoint(inPoints[i], project);\r\n newPt && outPoints.push(newPt);\r\n }\r\n return outPoints;\r\n }\r\n\r\n function getPolyShape(points: number[][]) {\r\n return {\r\n shape: {\r\n points: transformPolygonPoints(points)\r\n }\r\n };\r\n }\r\n\r\n regionsGroup.removeAll();\r\n\r\n // Only when the resource is GeoJSON, there is `geo.regions`.\r\n zrUtil.each(viewBuildCtx.geo.regions, function (region: GeoJSONRegion) {\r\n const regionName = region.name;\r\n\r\n // Consider in GeoJson properties.name may be duplicated, for example,\r\n // there is multiple region named \"United Kindom\" or \"France\" (so many\r\n // colonies). And it is not appropriate to merge them in geo, which\r\n // will make them share the same label and bring trouble in label\r\n // location calculation.\r\n let regionGroup = regionsGroupByName.get(regionName);\r\n let { dataIdx, regionModel } = regionsInfoByName.get(regionName) || {};\r\n\r\n if (!regionGroup) {\r\n regionGroup = regionsGroupByName.set(regionName, new graphic.Group() as RegionsGroup);\r\n regionsGroup.add(regionGroup);\r\n\r\n dataIdx = data ? data.indexOfName(regionName) : null;\r\n regionModel = viewBuildCtx.isGeo\r\n ? mapOrGeoModel.getRegionModel(regionName)\r\n : (data ? data.getItemModel(dataIdx) as Model : null);\r\n\r\n regionsInfoByName.set(regionName, { dataIdx, regionModel });\r\n }\r\n\r\n const polygonSubpaths: graphic.Polygon[] = [];\r\n const polylineSubpaths: graphic.Polyline[] = [];\r\n\r\n zrUtil.each(region.geometries, function (geometry) {\r\n // Polygon and MultiPolygon\r\n if (geometry.type === 'polygon') {\r\n let polys = [geometry.exterior].concat(geometry.interiors || []);\r\n if (projectionStream) {\r\n polys = projectPolys(polys, projectionStream);\r\n }\r\n zrUtil.each(polys, (poly) => {\r\n polygonSubpaths.push(new graphic.Polygon(getPolyShape(poly)));\r\n });\r\n }\r\n // LineString and MultiLineString\r\n else {\r\n let points = geometry.points;\r\n if (projectionStream) {\r\n points = projectPolys(points, projectionStream, true);\r\n }\r\n zrUtil.each(points, points => {\r\n polylineSubpaths.push(new graphic.Polyline(getPolyShape(points)));\r\n });\r\n }\r\n });\r\n\r\n const centerPt = transformPoint(region.getCenter(), projection && projection.project);\r\n\r\n function createCompoundPath(subpaths: graphic.Path[], isLine?: boolean) {\r\n if (!subpaths.length) {\r\n return;\r\n }\r\n const compoundPath = new graphic.CompoundPath({\r\n culling: true,\r\n segmentIgnoreThreshold: 1,\r\n shape: {\r\n paths: subpaths\r\n }\r\n });\r\n regionGroup.add(compoundPath);\r\n applyOptionStyleForRegion(\r\n viewBuildCtx, compoundPath, dataIdx, regionModel\r\n );\r\n resetLabelForRegion(\r\n viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt\r\n );\r\n\r\n if (isLine) {\r\n fixLineStyle(compoundPath);\r\n zrUtil.each(compoundPath.states, fixLineStyle);\r\n }\r\n }\r\n\r\n createCompoundPath(polygonSubpaths);\r\n createCompoundPath(polylineSubpaths, true);\r\n });\r\n\r\n // Ensure children have been added to `regionGroup` before calling them.\r\n regionsGroupByName.each(function (regionGroup, regionName) {\r\n const { dataIdx, regionModel } = regionsInfoByName.get(regionName);\r\n\r\n resetEventTriggerForRegion(\r\n viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx\r\n );\r\n resetTooltipForRegion(\r\n viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel\r\n );\r\n resetStateTriggerForRegion(\r\n viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel\r\n );\r\n\r\n }, this);\r\n }\r\n\r\n private _buildSVG(viewBuildCtx: ViewBuildContext): void {\r\n const mapName = viewBuildCtx.geo.map;\r\n const transformInfoRaw = viewBuildCtx.transformInfoRaw;\r\n\r\n this._svgGroup.x = transformInfoRaw.x;\r\n this._svgGroup.y = transformInfoRaw.y;\r\n this._svgGroup.scaleX = transformInfoRaw.scaleX;\r\n this._svgGroup.scaleY = transformInfoRaw.scaleY;\r\n\r\n if (this._svgResourceChanged(mapName)) {\r\n this._freeSVG();\r\n this._useSVG(mapName);\r\n }\r\n\r\n const svgDispatcherMap = this._svgDispatcherMap = zrUtil.createHashMap();\r\n\r\n let focusSelf = false;\r\n zrUtil.each(this._svgGraphicRecord.named, function (namedItem) {\r\n // Note that we also allow different elements have the same name.\r\n // For example, a glyph of a city and the label of the city have\r\n // the same name and their tooltip info can be defined in a single\r\n // region option.\r\n\r\n const regionName = namedItem.name;\r\n const mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\r\n const data = viewBuildCtx.data;\r\n const svgNodeTagLower = namedItem.svgNodeTagLower;\r\n const el = namedItem.el;\r\n\r\n const dataIdx = data ? data.indexOfName(regionName) : null;\r\n const regionModel = mapOrGeoModel.getRegionModel(regionName);\r\n\r\n if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null\r\n && (el instanceof Displayable)\r\n ) {\r\n applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);\r\n }\r\n\r\n if (el instanceof Displayable) {\r\n el.culling = true;\r\n }\r\n\r\n // We do not know how the SVG like so we'd better not to change z2.\r\n // Otherwise it might bring some unexpected result. For example,\r\n // an area hovered that make some inner city can not be clicked.\r\n (el as ECElement).z2EmphasisLift = 0;\r\n\r\n // If self named:\r\n if (!namedItem.namedFrom) {\r\n // label should batter to be displayed based on the center of \r\n // if it is named rather than displayed on each child.\r\n if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {\r\n resetLabelForRegion(\r\n viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null\r\n );\r\n }\r\n\r\n resetEventTriggerForRegion(\r\n viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx\r\n );\r\n\r\n resetTooltipForRegion(\r\n viewBuildCtx, el, regionName, regionModel, mapOrGeoModel\r\n );\r\n\r\n if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {\r\n const focus = resetStateTriggerForRegion(\r\n viewBuildCtx, el, regionName, regionModel, mapOrGeoModel\r\n );\r\n if (focus === 'self') {\r\n focusSelf = true;\r\n }\r\n const els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);\r\n els.push(el);\r\n }\r\n }\r\n\r\n }, this);\r\n\r\n this._enableBlurEntireSVG(focusSelf, viewBuildCtx);\r\n }\r\n\r\n private _enableBlurEntireSVG(\r\n focusSelf: boolean,\r\n viewBuildCtx: ViewBuildContext\r\n ): void {\r\n // It's a little complicated to support blurring the entire geoSVG in series-map.\r\n // So do not support it until some requirements come.\r\n // At present, in series-map, only regions can be blurred.\r\n if (focusSelf && viewBuildCtx.isGeo) {\r\n const blurStyle = (viewBuildCtx.mapOrGeoModel as GeoModel).getModel(['blur', 'itemStyle']).getItemStyle();\r\n // Only support `opacity` here. Because not sure that other props are suitable for\r\n // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).\r\n const opacity = blurStyle.opacity;\r\n this._svgGraphicRecord.root.traverse(el => {\r\n if (!el.isGroup) {\r\n // PENDING: clear those settings to SVG elements when `_freeSVG`.\r\n // (Currently it happen not to be needed.)\r\n setDefaultStateProxy(el as Displayable);\r\n const style = (el as Displayable).ensureState('blur').style || {};\r\n // Do not overwrite the region style that already set from region option.\r\n if (style.opacity == null && opacity != null) {\r\n style.opacity = opacity;\r\n }\r\n // If `ensureState('blur').style = {}`, there will be default opacity.\r\n\r\n // Enable `stateTransition` (animation).\r\n (el as Displayable).ensureState('emphasis');\r\n }\r\n });\r\n }\r\n }\r\n\r\n remove(): void {\r\n this._regionsGroup.removeAll();\r\n this._regionsGroupByName = null;\r\n this._svgGroup.removeAll();\r\n this._freeSVG();\r\n this._controller.dispose();\r\n this._controllerHost = null;\r\n }\r\n\r\n findHighDownDispatchers(name: string, geoModel: GeoModel): Element[] {\r\n if (name == null) {\r\n return [];\r\n }\r\n\r\n const geo = geoModel.coordinateSystem;\r\n\r\n if (geo.resourceType === 'geoJSON') {\r\n const regionsGroupByName = this._regionsGroupByName;\r\n if (regionsGroupByName) {\r\n const regionGroup = regionsGroupByName.get(name);\r\n return regionGroup ? [regionGroup] : [];\r\n }\r\n }\r\n else if (geo.resourceType === 'geoSVG') {\r\n return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];\r\n }\r\n }\r\n\r\n private _svgResourceChanged(mapName: string): boolean {\r\n return this._svgMapName !== mapName;\r\n }\r\n\r\n private _useSVG(mapName: string): void {\r\n const resource = geoSourceManager.getGeoResource(mapName);\r\n if (resource && resource.type === 'geoSVG') {\r\n const svgGraphic = (resource as GeoSVGResource).useGraphic(this.uid);\r\n this._svgGroup.add(svgGraphic.root);\r\n this._svgGraphicRecord = svgGraphic;\r\n this._svgMapName = mapName;\r\n }\r\n }\r\n\r\n private _freeSVG(): void {\r\n const mapName = this._svgMapName;\r\n if (mapName == null) {\r\n return;\r\n }\r\n\r\n const resource = geoSourceManager.getGeoResource(mapName);\r\n if (resource && resource.type === 'geoSVG') {\r\n (resource as GeoSVGResource).freeGraphic(this.uid);\r\n }\r\n this._svgGraphicRecord = null;\r\n this._svgDispatcherMap = null;\r\n this._svgGroup.removeAll();\r\n this._svgMapName = null;\r\n }\r\n\r\n private _updateController(\r\n this: MapDraw, mapOrGeoModel: GeoModel | MapSeries, ecModel: GlobalModel, api: ExtensionAPI\r\n ): void {\r\n const geo = mapOrGeoModel.coordinateSystem;\r\n const controller = this._controller;\r\n const controllerHost = this._controllerHost;\r\n\r\n // @ts-ignore FIXME:TS\r\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\r\n controllerHost.zoom = geo.getZoom();\r\n\r\n // roamType is will be set default true if it is null\r\n // @ts-ignore FIXME:TS\r\n controller.enable(mapOrGeoModel.get('roam') || false);\r\n const mainType = mapOrGeoModel.mainType;\r\n\r\n function makeActionBase(): Payload {\r\n const action = {\r\n type: 'geoRoam',\r\n componentType: mainType\r\n } as Payload;\r\n action[mainType + 'Id'] = mapOrGeoModel.id;\r\n return action;\r\n }\r\n\r\n controller.off('pan').on('pan', function (e) {\r\n this._mouseDownFlag = false;\r\n\r\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\r\n\r\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\r\n dx: e.dx,\r\n dy: e.dy,\r\n animation: {\r\n duration: 0\r\n }\r\n }));\r\n }, this);\r\n\r\n controller.off('zoom').on('zoom', function (e) {\r\n this._mouseDownFlag = false;\r\n\r\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n\r\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\r\n totalZoom: controllerHost.zoom,\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY,\r\n animation: {\r\n duration: 0\r\n }\r\n }));\r\n\r\n }, this);\r\n\r\n controller.setPointerChecker(function (e, x, y) {\r\n return geo.containPoint([x, y])\r\n && !onIrrelevantElement(e, api, mapOrGeoModel);\r\n });\r\n }\r\n\r\n /**\r\n * FIXME: this is a temporarily workaround.\r\n * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like\r\n * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`\r\n * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified\r\n * props will have no chance to be restored.\r\n * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in\r\n * `renderSeries` will cache the modified `ignore` to `el._normalState`.\r\n * TODO:\r\n * Use clone/immutable in `LabelManager`?\r\n */\r\n resetForLabelLayout() {\r\n this.group.traverse(el => {\r\n const label = el.getTextContent();\r\n if (label) {\r\n label.ignore = mapLabelRaw(label).ignore;\r\n }\r\n });\r\n }\r\n\r\n private _updateMapSelectHandler(\r\n mapOrGeoModel: GeoModel | MapSeries,\r\n regionsGroup: RegionsGroup,\r\n api: ExtensionAPI,\r\n fromView: MapView | GeoView\r\n ): void {\r\n const mapDraw = this;\r\n\r\n regionsGroup.off('mousedown');\r\n regionsGroup.off('click');\r\n\r\n // @ts-ignore FIXME:TS resolve type conflict\r\n if (mapOrGeoModel.get('selectedMode')) {\r\n\r\n regionsGroup.on('mousedown', function () {\r\n mapDraw._mouseDownFlag = true;\r\n });\r\n\r\n regionsGroup.on('click', function (e) {\r\n if (!mapDraw._mouseDownFlag) {\r\n return;\r\n }\r\n mapDraw._mouseDownFlag = false;\r\n });\r\n }\r\n }\r\n\r\n};\r\n\r\nfunction applyOptionStyleForRegion(\r\n viewBuildCtx: ViewBuildContext,\r\n el: Displayable,\r\n dataIndex: number,\r\n regionModel: Model<\r\n GeoStyleableOption & {\r\n emphasis?: GeoStyleableOption;\r\n select?: GeoStyleableOption;\r\n blur?: GeoStyleableOption;\r\n }\r\n >\r\n): void {\r\n // All of the path are using `itemStyle`, because\r\n // (1) Some SVG also use fill on polyline (The different between\r\n // polyline and polygon is \"open\" or \"close\" but not fill or not).\r\n // (2) For the common props like opacity, if some use itemStyle\r\n // and some use `lineStyle`, it might confuse users.\r\n // (3) Most SVG use , where can not detect whether to draw a \"line\"\r\n // or a filled shape, so use `itemStyle` for .\r\n\r\n const normalStyleModel = regionModel.getModel('itemStyle');\r\n const emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']);\r\n const blurStyleModel = regionModel.getModel(['blur', 'itemStyle']);\r\n const selectStyleModel = regionModel.getModel(['select', 'itemStyle']);\r\n\r\n // NOTE: DON'T use 'style' in visual when drawing map.\r\n // This component is used for drawing underlying map for both geo component and map series.\r\n const normalStyle = getFixedItemStyle(normalStyleModel);\r\n const emphasisStyle = getFixedItemStyle(emphasisStyleModel);\r\n const selectStyle = getFixedItemStyle(selectStyleModel);\r\n const blurStyle = getFixedItemStyle(blurStyleModel);\r\n\r\n // Update the itemStyle if has data visual\r\n const data = viewBuildCtx.data;\r\n if (data) {\r\n // Only visual color of each item will be used. It can be encoded by visualMap\r\n // But visual color of series is used in symbol drawing\r\n\r\n // Visual color for each series is for the symbol draw\r\n const style = data.getItemVisual(dataIndex, 'style');\r\n const decal = data.getItemVisual(dataIndex, 'decal');\r\n if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {\r\n normalStyle.fill = style.fill;\r\n }\r\n if (decal) {\r\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);\r\n }\r\n }\r\n\r\n // SVG text, tspan and image can be named but not supporeted\r\n // to be styled by region option yet.\r\n el.setStyle(normalStyle);\r\n el.style.strokeNoScale = true;\r\n el.ensureState('emphasis').style = emphasisStyle;\r\n el.ensureState('select').style = selectStyle;\r\n el.ensureState('blur').style = blurStyle;\r\n\r\n // Enable blur\r\n setDefaultStateProxy(el);\r\n}\r\n\r\nfunction resetLabelForRegion(\r\n viewBuildCtx: ViewBuildContext,\r\n el: Element,\r\n regionName: string,\r\n regionModel: RegionModel,\r\n mapOrGeoModel: MapOrGeoModel,\r\n // Exist only if `viewBuildCtx.data` exists.\r\n dataIdx: number,\r\n // If labelXY not provided, use `textConfig.position: 'inside'`\r\n labelXY: number[]\r\n): void {\r\n const data = viewBuildCtx.data;\r\n const isGeo = viewBuildCtx.isGeo;\r\n\r\n const isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx) as number);\r\n const itemLayout = data && data.getItemLayout(dataIdx);\r\n\r\n // In the following cases label will be drawn\r\n // 1. In map series and data value is NaN\r\n // 2. In geo component\r\n // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout\r\n if (\r\n ((isGeo || isDataNaN))\r\n || (itemLayout && itemLayout.showLabel)\r\n ) {\r\n\r\n const query = !isGeo ? dataIdx : regionName;\r\n let labelFetcher;\r\n\r\n // Consider dataIdx not found.\r\n if (!data || dataIdx >= 0) {\r\n labelFetcher = mapOrGeoModel;\r\n }\r\n\r\n const specifiedTextOpt: Partial> = labelXY ? {\r\n normal: {\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }\r\n } : null;\r\n\r\n // Caveat: must be called after `setDefaultStateProxy(el);` called.\r\n // because textContent will be assign with `el.stateProxy` inside.\r\n setLabelStyle(\r\n el,\r\n getLabelStatesModels(regionModel),\r\n {\r\n labelFetcher,\r\n labelDataIndex: query,\r\n defaultText: regionName\r\n },\r\n specifiedTextOpt\r\n );\r\n\r\n const textEl = el.getTextContent();\r\n if (textEl) {\r\n mapLabelRaw(textEl).ignore = textEl.ignore;\r\n\r\n if (el.textConfig && labelXY) {\r\n // Compute a relative offset based on the el bounding rect.\r\n const rect = el.getBoundingRect().clone();\r\n // Need to make sure the percent position base on the same rect in normal and\r\n // emphasis state. Otherwise if using boundingRect of el, but the emphasis state\r\n // has borderWidth (even 0.5px), the text position will be changed obviously\r\n // if the position is very big like ['1234%', '1345%'].\r\n el.textConfig.layoutRect = rect;\r\n el.textConfig.position = [\r\n ((labelXY[0] - rect.x) / rect.width * 100) + '%',\r\n ((labelXY[1] - rect.y) / rect.height * 100) + '%'\r\n ];\r\n }\r\n }\r\n\r\n // PENDING:\r\n // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified.\r\n // But el.dataIndex is also used to determine whether user event should be triggered,\r\n // where el.seriesIndex or el.dataModel must be specified. At present for a single el\r\n // there is not case that \"only label layout enabled but user event disabled\", so here\r\n // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`.\r\n\r\n (el as ECElement).disableLabelAnimation = true;\r\n }\r\n else {\r\n el.removeTextContent();\r\n el.removeTextConfig();\r\n (el as ECElement).disableLabelAnimation = null;\r\n }\r\n}\r\n\r\nfunction resetEventTriggerForRegion(\r\n viewBuildCtx: ViewBuildContext,\r\n eventTrigger: Element,\r\n regionName: string,\r\n regionModel: RegionModel,\r\n mapOrGeoModel: MapOrGeoModel,\r\n // Exist only if `viewBuildCtx.data` exists.\r\n dataIdx: number\r\n): void {\r\n // setItemGraphicEl, setHoverStyle after all polygons and labels\r\n // are added to the regionGroup\r\n if (viewBuildCtx.data) {\r\n // FIXME: when series-map use a SVG map, and there are duplicated name specified\r\n // on different SVG elements, after `data.setItemGraphicEl(...)`:\r\n // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip\r\n // can be triggered only mouse hover. That's correct.\r\n // (2) only the last element will be kept in `data`, so that if trigger tooltip\r\n // by `dispatchAction`, only the last one can be found and triggered. That might be\r\n // not correct. We will fix it in future if anyone demanding that.\r\n viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);\r\n }\r\n // series-map will not trigger \"geoselectchange\" no matter it is\r\n // based on a declared geo component. Because series-map will\r\n // trigger \"selectchange\". If it trigger both the two events,\r\n // If users call `chart.dispatchAction({type: 'toggleSelect'})`,\r\n // it not easy to also fire event \"geoselectchanged\".\r\n else {\r\n // Package custom mouse event for geo component\r\n getECData(eventTrigger).eventData = {\r\n componentType: 'geo',\r\n componentIndex: mapOrGeoModel.componentIndex,\r\n geoIndex: mapOrGeoModel.componentIndex,\r\n name: regionName,\r\n region: (regionModel && regionModel.option) || {}\r\n };\r\n }\r\n}\r\n\r\nfunction resetTooltipForRegion(\r\n viewBuildCtx: ViewBuildContext,\r\n el: Element,\r\n regionName: string,\r\n regionModel: RegionModel,\r\n mapOrGeoModel: MapOrGeoModel\r\n): void {\r\n if (!viewBuildCtx.data) {\r\n graphic.setTooltipConfig({\r\n el: el,\r\n componentModel: mapOrGeoModel,\r\n itemName: regionName,\r\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\r\n itemTooltipOption: regionModel.get('tooltip')\r\n });\r\n }\r\n}\r\n\r\nfunction resetStateTriggerForRegion(\r\n viewBuildCtx: ViewBuildContext,\r\n el: Element,\r\n regionName: string,\r\n regionModel: RegionModel,\r\n mapOrGeoModel: MapOrGeoModel\r\n): InnerFocus {\r\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\r\n el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode');\r\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\r\n const emphasisModel = regionModel.getModel('emphasis');\r\n const focus = emphasisModel.get('focus');\r\n toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\r\n if (viewBuildCtx.isGeo) {\r\n enableComponentHighDownFeatures(el, mapOrGeoModel as GeoModel, regionName);\r\n }\r\n\r\n return focus;\r\n}\r\n\r\nfunction projectPolys(\r\n rings: number[][][], // Polygons include exterior and interiors. Or polylines.\r\n createStream: (outStream: ProjectionStream) => ProjectionStream,\r\n isLine?: boolean\r\n) {\r\n const polygons: number[][][] = [];\r\n let curPoly: number[][];\r\n\r\n function startPolygon() {\r\n curPoly = [];\r\n }\r\n function endPolygon() {\r\n if (curPoly.length) {\r\n polygons.push(curPoly);\r\n curPoly = [];\r\n }\r\n }\r\n const stream = createStream({\r\n polygonStart: startPolygon,\r\n polygonEnd: endPolygon,\r\n lineStart: startPolygon,\r\n lineEnd: endPolygon,\r\n point(x, y) {\r\n // May have NaN values from stream.\r\n if (isFinite(x) && isFinite(y)) {\r\n curPoly.push([x, y]);\r\n }\r\n },\r\n sphere() {}\r\n });\r\n !isLine && stream.polygonStart();\r\n zrUtil.each(rings, ring => {\r\n stream.lineStart();\r\n for (let i = 0; i < ring.length; i++) {\r\n stream.point(ring[i][0], ring[i][1]);\r\n }\r\n stream.lineEnd();\r\n });\r\n !isLine && stream.polygonEnd();\r\n return polygons;\r\n}\r\n\r\nexport default MapDraw;\r\n\r\n\r\n// @ts-ignore FIXME:TS fix the \"compatible with each other\"?\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport MapDraw from '../../component/helper/MapDraw';\r\nimport ChartView from '../../view/Chart';\r\nimport MapSeries, { MapDataItemOption } from './MapSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Payload, DisplayState, ECElement } from '../../util/types';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport { setStatesFlag, Z2_EMPHASIS_LIFT } from '../../util/states';\r\n\r\n\r\nclass MapView extends ChartView {\r\n\r\n static type = 'map' as const;\r\n readonly type = MapView.type;\r\n\r\n private _mapDraw: MapDraw;\r\n\r\n render(\r\n mapModel: MapSeries,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void {\r\n // Not render if it is an toggleSelect action from self\r\n if (payload && payload.type === 'mapToggleSelect'\r\n && payload.from === this.uid\r\n ) {\r\n return;\r\n }\r\n\r\n const group = this.group;\r\n group.removeAll();\r\n\r\n if (mapModel.getHostGeoModel()) {\r\n return;\r\n }\r\n\r\n if (this._mapDraw && payload && payload.type === 'geoRoam') {\r\n this._mapDraw.resetForLabelLayout();\r\n }\r\n\r\n // Not update map if it is an roam action from self\r\n if (!(payload && payload.type === 'geoRoam'\r\n && payload.componentType === 'series'\r\n && payload.seriesId === mapModel.id\r\n )\r\n ) {\r\n if (mapModel.needsDrawMap) {\r\n const mapDraw = this._mapDraw || new MapDraw(api);\r\n group.add(mapDraw.group);\r\n\r\n mapDraw.draw(mapModel, ecModel, api, this, payload);\r\n\r\n this._mapDraw = mapDraw;\r\n }\r\n else {\r\n // Remove drawn map\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n }\r\n }\r\n else {\r\n const mapDraw = this._mapDraw;\r\n mapDraw && group.add(mapDraw.group);\r\n }\r\n\r\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')\r\n && this._renderSymbols(mapModel, ecModel, api);\r\n }\r\n\r\n remove(): void {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n this.group.removeAll();\r\n }\r\n\r\n dispose(): void {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n }\r\n\r\n private _renderSymbols(mapModel: MapSeries, ecModel: GlobalModel, api: ExtensionAPI): void {\r\n const originalData = mapModel.originalData;\r\n const group = this.group;\r\n\r\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\r\n if (isNaN(value as number)) {\r\n return;\r\n }\r\n\r\n const layout = originalData.getItemLayout(originalDataIndex);\r\n\r\n if (!layout || !layout.point) {\r\n // Not exists in map\r\n return;\r\n }\r\n\r\n const point = layout.point;\r\n const offset = layout.offset;\r\n\r\n const circle = new graphic.Circle({\r\n style: {\r\n // Because the special of map draw.\r\n // Which needs statistic of multiple series and draw on one map.\r\n // And each series also need a symbol with legend color\r\n //\r\n // Layout and visual are put one the different data\r\n // TODO\r\n fill: mapModel.getData().getVisual('style').fill\r\n },\r\n shape: {\r\n cx: point[0] + offset * 9,\r\n cy: point[1],\r\n r: 3\r\n },\r\n silent: true,\r\n // Do not overlap the first series, on which labels are displayed.\r\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\r\n });\r\n\r\n // Only the series that has the first value on the same region is in charge of rendering the label.\r\n // But consider the case:\r\n // series: [\r\n // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},\r\n // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}\r\n // ]\r\n // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.\r\n // For backward compatibility, we follow the rule that render label `A` by the\r\n // settings on series `X` but render label `C` by the settings on series `Y`.\r\n if (!offset) {\r\n\r\n const fullData = mapModel.mainSeries.getData();\r\n const name = originalData.getName(originalDataIndex);\r\n\r\n const fullIndex = fullData.indexOfName(name);\r\n\r\n const itemModel = originalData.getItemModel(originalDataIndex);\r\n const labelModel = itemModel.getModel('label');\r\n\r\n const regionGroup = fullData.getItemGraphicEl(fullIndex);\r\n\r\n // `getFormattedLabel` needs to use `getData` inside. Here\r\n // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.\r\n // FIXME\r\n // If this is not the `mainSeries`, the item model (like label formatter)\r\n // set on original data item will never get. But it has been working\r\n // like that from the beginning, and this scenario is rarely encountered.\r\n // So it won't be fixed until we have to.\r\n\r\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\r\n labelFetcher: {\r\n getFormattedLabel(idx: number, state: DisplayState) {\r\n return mapModel.getFormattedLabel(fullIndex, state);\r\n }\r\n },\r\n defaultText: name\r\n });\r\n (circle as ECElement).disableLabelAnimation = true;\r\n if (!labelModel.get('position')) {\r\n circle.setTextConfig({\r\n position: 'bottom'\r\n });\r\n }\r\n\r\n (regionGroup as ECElement).onHoverStateChange = function (toState) {\r\n setStatesFlag(circle, toState);\r\n };\r\n }\r\n\r\n group.add(circle);\r\n });\r\n }\r\n}\r\n\r\nexport default MapView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply';\r\nimport SeriesModel from '../../model/Series';\r\nimport geoSourceManager from '../../coord/geo/geoSourceManager';\r\nimport {makeSeriesEncodeForNameBased} from '../../data/helper/sourceHelper';\r\nimport {\r\n SeriesOption,\r\n BoxLayoutOptionMixin,\r\n SeriesEncodeOptionMixin,\r\n OptionDataItemObject,\r\n OptionDataValueNumeric,\r\n ParsedValue,\r\n SeriesOnGeoOptionMixin,\r\n StatesOptionMixin,\r\n SeriesLabelOption,\r\n StatesMixinBase,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport GeoModel, { GeoCommonOptionMixin, GeoItemStyleOption } from '../../coord/geo/GeoModel';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Model from '../../model/Model';\r\nimport Geo from '../../coord/geo/Geo';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\r\nimport {createSymbol, ECSymbol} from '../../util/symbol';\r\nimport {LegendIconParams} from '../../component/legend/LegendModel';\r\nimport {Group} from '../../util/graphic';\r\n\r\nexport interface MapStateOption {\r\n itemStyle?: GeoItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\nexport interface MapDataItemOption extends MapStateOption,\r\n StatesOptionMixin,\r\n OptionDataItemObject {\r\n cursor?: string\r\n}\r\n\r\nexport type MapValueCalculationType = 'sum' | 'average' | 'min' | 'max';\r\n\r\nexport interface MapSeriesOption extends\r\n SeriesOption, StatesMixinBase>,\r\n MapStateOption,\r\n GeoCommonOptionMixin,\r\n // If `geoIndex` is not specified, a exclusive geo will be\r\n // created. Otherwise use the specified geo component, and\r\n // `map` and `mapType` are ignored.\r\n SeriesOnGeoOptionMixin,\r\n BoxLayoutOptionMixin,\r\n SeriesEncodeOptionMixin {\r\n type?: 'map'\r\n\r\n coordinateSystem?: string;\r\n silent?: boolean;\r\n\r\n // FIXME:TS add marker types\r\n markLine?: any;\r\n markPoint?: any;\r\n markArea?: any;\r\n\r\n mapValueCalculation?: MapValueCalculationType;\r\n\r\n showLegendSymbol?: boolean;\r\n\r\n // @deprecated. Only for echarts2 backward compat.\r\n geoCoord?: Dictionary;\r\n\r\n data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | MapDataItemOption)[]\r\n\r\n\r\n nameProperty?: string;\r\n}\r\n\r\nclass MapSeries extends SeriesModel {\r\n\r\n static type = 'series.map' as const;\r\n type = MapSeries.type;\r\n\r\n static dependencies = ['geo'];\r\n\r\n static layoutMode = 'box' as const;\r\n\r\n coordinateSystem: Geo;\r\n\r\n // -----------------\r\n // Injected outside\r\n originalData: SeriesData;\r\n mainSeries: MapSeries;\r\n // Only first map series of same mapType will drawMap.\r\n needsDrawMap: boolean = false;\r\n // Group of all map series with same mapType\r\n seriesGroup: MapSeries[] = [];\r\n\r\n\r\n getInitialData(this: MapSeries, option: MapSeriesOption): SeriesData {\r\n const data = createSeriesDataSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n const dataNameMap = zrUtil.createHashMap();\r\n const toAppendNames = [] as string[];\r\n\r\n for (let i = 0, len = data.count(); i < len; i++) {\r\n const name = data.getName(i);\r\n dataNameMap.set(name, true);\r\n }\r\n\r\n const geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\r\n zrUtil.each(geoSource.regions, function (region) {\r\n const name = region.name;\r\n if (!dataNameMap.get(name)) {\r\n toAppendNames.push(name);\r\n }\r\n });\r\n\r\n // Complete data with missing regions. The consequent processes (like visual\r\n // map and render) can not be performed without a \"full data\". For example,\r\n // find `dataIndex` by name.\r\n data.appendValues([], toAppendNames);\r\n\r\n return data;\r\n }\r\n\r\n /**\r\n * If no host geo model, return null, which means using a\r\n * inner exclusive geo model.\r\n */\r\n getHostGeoModel(): GeoModel {\r\n const geoIndex = this.option.geoIndex;\r\n return geoIndex != null\r\n ? this.ecModel.getComponent('geo', geoIndex) as GeoModel\r\n : null;\r\n }\r\n\r\n getMapType(): string {\r\n return (this.getHostGeoModel() || this).option.map;\r\n }\r\n\r\n // _fillOption(option, mapName) {\r\n // Shallow clone\r\n // option = zrUtil.extend({}, option);\r\n\r\n // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);\r\n\r\n // return option;\r\n // }\r\n\r\n getRawValue(dataIndex: number): ParsedValue {\r\n // Use value stored in data instead because it is calculated from multiple series\r\n // FIXME Provide all value of multiple series ?\r\n const data = this.getData();\r\n return data.get(data.mapDimension('value'), dataIndex);\r\n }\r\n\r\n /**\r\n * Get model of region\r\n */\r\n getRegionModel(regionName: string): Model {\r\n const data = this.getData();\r\n return data.getItemModel(data.indexOfName(regionName));\r\n }\r\n\r\n /**\r\n * Map tooltip formatter\r\n */\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: string\r\n ) {\r\n // FIXME orignalData and data is a bit confusing\r\n const data = this.getData();\r\n const value = this.getRawValue(dataIndex);\r\n const name = data.getName(dataIndex);\r\n\r\n const seriesGroup = this.seriesGroup;\r\n const seriesNames = [];\r\n for (let i = 0; i < seriesGroup.length; i++) {\r\n const otherIndex = seriesGroup[i].originalData.indexOfName(name);\r\n const valueDim = data.mapDimension('value');\r\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex) as number)) {\r\n seriesNames.push(seriesGroup[i].name);\r\n }\r\n }\r\n\r\n return createTooltipMarkup('section', {\r\n header: seriesNames.join(', '),\r\n noHeader: !seriesNames.length,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: name, value: value\r\n })]\r\n });\r\n }\r\n\r\n getTooltipPosition = function (this: MapSeries, dataIndex: number): number[] {\r\n if (dataIndex != null) {\r\n const name = this.getData().getName(dataIndex);\r\n const geo = this.coordinateSystem;\r\n const region = geo.getRegion(name);\r\n\r\n return region && geo.dataToPoint(region.getCenter());\r\n }\r\n };\r\n\r\n setZoom(zoom: number): void {\r\n this.option.zoom = zoom;\r\n }\r\n\r\n setCenter(center: number[]): void {\r\n this.option.center = center;\r\n }\r\n\r\n getLegendIcon(opt: LegendIconParams): ECSymbol | Group {\r\n const iconType = opt.icon || 'roundRect';\r\n const icon = createSymbol(\r\n iconType,\r\n 0,\r\n 0,\r\n opt.itemWidth,\r\n opt.itemHeight,\r\n opt.itemStyle.fill\r\n );\r\n\r\n icon.setStyle(opt.itemStyle);\r\n // Map do not use itemStyle.borderWidth as border width\r\n icon.style.stroke = 'none';\r\n // No rotation because no series visual symbol for map\r\n\r\n if (iconType.indexOf('empty') > -1) {\r\n icon.style.stroke = icon.style.fill;\r\n icon.style.fill = '#fff';\r\n icon.style.lineWidth = 2;\r\n }\r\n return icon;\r\n }\r\n\r\n static defaultOption: MapSeriesOption = {\r\n // \u4E00\u7EA7\u5C42\u53E0\r\n // zlevel: 0,\r\n // \u4E8C\u7EA7\u5C42\u53E0\r\n z: 2,\r\n\r\n coordinateSystem: 'geo',\r\n\r\n // map should be explicitly specified since ec3.\r\n map: '',\r\n\r\n // If `geoIndex` is not specified, a exclusive geo will be\r\n // created. Otherwise use the specified geo component, and\r\n // `map` and `mapType` are ignored.\r\n // geoIndex: 0,\r\n\r\n // 'center' | 'left' | 'right' | 'x%' | {number}\r\n left: 'center',\r\n // 'center' | 'top' | 'bottom' | 'x%' | {number}\r\n top: 'center',\r\n // right\r\n // bottom\r\n // width:\r\n // height\r\n\r\n // Aspect is width / height. Inited to be geoJson bbox aspect\r\n // This parameter is used for scale this aspect\r\n // Default value:\r\n // for geoSVG source: 1,\r\n // for geoJSON source: 0.75.\r\n aspectScale: null,\r\n\r\n // Layout with center and size\r\n // If you want to put map in a fixed size box with right aspect ratio\r\n // This two properties may be more convenient.\r\n // layoutCenter: [50%, 50%]\r\n // layoutSize: 100\r\n\r\n showLegendSymbol: true,\r\n\r\n // Define left-top, right-bottom coords to control view\r\n // For example, [ [180, 90], [-180, -90] ],\r\n // higher priority than center and zoom\r\n boundingCoords: null,\r\n\r\n // Default on center of map\r\n center: null,\r\n\r\n zoom: 1,\r\n\r\n scaleLimit: null,\r\n\r\n selectedMode: true,\r\n\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n // scaleLimit: null,\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444',\r\n areaColor: '#eee'\r\n },\r\n\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n areaColor: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n\r\n nameProperty: 'name'\r\n };\r\n\r\n}\r\n\r\nexport default MapSeries;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport MapSeries, { MapValueCalculationType } from './MapSeries';\r\nimport GlobalModel from '../../model/Global';\r\n\r\n// FIXME \u516C\u7528\uFF1F\r\nfunction dataStatistics(datas: SeriesData[], statisticType: MapValueCalculationType): SeriesData {\r\n const dataNameMap = {} as {[mapKey: string]: number[]};\r\n\r\n zrUtil.each(datas, function (data) {\r\n data.each(data.mapDimension('value'), function (value: number, idx) {\r\n // Add prefix to avoid conflict with Object.prototype.\r\n const mapKey = 'ec-' + data.getName(idx);\r\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\r\n if (!isNaN(value)) {\r\n dataNameMap[mapKey].push(value);\r\n }\r\n });\r\n });\r\n\r\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\r\n const mapKey = 'ec-' + datas[0].getName(idx);\r\n let sum = 0;\r\n let min = Infinity;\r\n let max = -Infinity;\r\n const len = dataNameMap[mapKey].length;\r\n for (let i = 0; i < len; i++) {\r\n min = Math.min(min, dataNameMap[mapKey][i]);\r\n max = Math.max(max, dataNameMap[mapKey][i]);\r\n sum += dataNameMap[mapKey][i];\r\n }\r\n let result;\r\n if (statisticType === 'min') {\r\n result = min;\r\n }\r\n else if (statisticType === 'max') {\r\n result = max;\r\n }\r\n else if (statisticType === 'average') {\r\n result = sum / len;\r\n }\r\n else {\r\n result = sum;\r\n }\r\n return len === 0 ? NaN : result;\r\n });\r\n}\r\n\r\nexport default function mapDataStatistic(ecModel: GlobalModel): void {\r\n const seriesGroups = {} as {[key: string]: MapSeries[]};\r\n ecModel.eachSeriesByType('map', function (seriesModel: MapSeries) {\r\n const hostGeoModel = seriesModel.getHostGeoModel();\r\n const key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\r\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\r\n });\r\n\r\n zrUtil.each(seriesGroups, function (seriesList, key) {\r\n const data = dataStatistics(\r\n zrUtil.map(seriesList, function (seriesModel) {\r\n return seriesModel.getData();\r\n }),\r\n seriesList[0].get('mapValueCalculation')\r\n );\r\n\r\n for (let i = 0; i < seriesList.length; i++) {\r\n seriesList[i].originalData = seriesList[i].getData();\r\n }\r\n\r\n // FIXME Put where?\r\n for (let i = 0; i < seriesList.length; i++) {\r\n seriesList[i].seriesGroup = seriesList;\r\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\r\n\r\n seriesList[i].setData(data.cloneShallow());\r\n seriesList[i].mainSeries = seriesList[0];\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport MapSeries from './MapSeries';\r\nimport { Dictionary } from '../../util/types';\r\n\r\nexport default function mapSymbolLayout(ecModel: GlobalModel) {\r\n\r\n const processedMapType = {} as {[mapType: string]: boolean};\r\n\r\n ecModel.eachSeriesByType('map', function (mapSeries: MapSeries) {\r\n const mapType = mapSeries.getMapType();\r\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\r\n return;\r\n }\r\n\r\n const mapSymbolOffsets = {} as Dictionary;\r\n\r\n zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {\r\n const geo = subMapSeries.coordinateSystem;\r\n const data = subMapSeries.originalData;\r\n\r\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\r\n data.each(data.mapDimension('value'), function (value, idx) {\r\n const name = data.getName(idx);\r\n const region = geo.getRegion(name);\r\n\r\n // If input series.data is [11, 22, '-'/null/undefined, 44],\r\n // it will be filled with NaN: [11, 22, NaN, 44] and NaN will\r\n // not be drawn. So here must validate if value is NaN.\r\n if (!region || isNaN(value as number)) {\r\n return;\r\n }\r\n\r\n const offset = mapSymbolOffsets[name] || 0;\r\n\r\n const point = geo.dataToPoint(region.getCenter());\r\n\r\n mapSymbolOffsets[name] = offset + 1;\r\n\r\n data.setItemLayout(idx, {\r\n point: point,\r\n offset: offset\r\n });\r\n });\r\n }\r\n });\r\n\r\n // Show label of those region not has legendIcon (which is offset 0)\r\n const data = mapSeries.getData();\r\n data.each(function (idx) {\r\n const name = data.getName(idx);\r\n const layout = data.getItemLayout(idx) || {};\r\n layout.showLabel = !mapSymbolOffsets[name];\r\n data.setItemLayout(idx, layout);\r\n });\r\n\r\n processedMapType[mapType] = true;\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Simple view coordinate system\r\n * Mapping given x, y to transformd view x, y\r\n */\r\n\r\nimport * as vector from 'zrender/src/core/vector';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport Transformable from 'zrender/src/core/Transformable';\r\nimport { CoordinateSystemMaster, CoordinateSystem } from './CoordinateSystem';\r\nimport GlobalModel from '../model/Global';\r\nimport { ParsedModelFinder, ParsedModelFinderKnown } from '../util/model';\r\nimport { parsePercent } from '../util/number';\r\nimport type ExtensionAPI from '../core/ExtensionAPI';\r\n\r\nconst v2ApplyTransform = vector.applyTransform;\r\n\r\nexport type ViewCoordSysTransformInfoPart = Pick;\r\n\r\nclass View extends Transformable implements CoordinateSystemMaster, CoordinateSystem {\r\n\r\n readonly type: string = 'view';\r\n\r\n static dimensions = ['x', 'y'];\r\n readonly dimensions = ['x', 'y'];\r\n\r\n readonly name: string;\r\n\r\n zoomLimit: {\r\n max?: number;\r\n min?: number;\r\n };\r\n\r\n /**\r\n * Represents the transform brought by roam/zoom.\r\n * If `View['_viewRect']` applies roam transform,\r\n * we can get the final displayed rect.\r\n */\r\n private _roamTransformable = new Transformable();\r\n /**\r\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\r\n */\r\n protected _rawTransformable = new Transformable();\r\n private _rawTransform: matrix.MatrixArray;\r\n\r\n /**\r\n * This is a user specified point on the source, which will be\r\n * located to the center of the `View['_viewRect']`.\r\n * The unit this the same as `View['_rect']`.\r\n */\r\n private _center: number[];\r\n private _zoom: number;\r\n\r\n /**\r\n * The rect of the source, where the measure is used by \"data\" and \"center\".\r\n * Has nothing to do with roam/zoom.\r\n * The unit is defined by the source. For example,\r\n * for geo source the unit is lat/lng,\r\n * for SVG source the unit is the same as the width/height defined in SVG.\r\n */\r\n private _rect: BoundingRect;\r\n /**\r\n * The visible rect on the canvas. Has nothing to do with roam/zoom.\r\n * The unit of `View['_viewRect']` is pixel of the canvas.\r\n */\r\n private _viewRect: BoundingRect;\r\n\r\n constructor(name?: string) {\r\n super();\r\n this.name = name;\r\n }\r\n\r\n setBoundingRect(x: number, y: number, width: number, height: number): BoundingRect {\r\n this._rect = new BoundingRect(x, y, width, height);\r\n return this._rect;\r\n }\r\n\r\n /**\r\n * @return {module:zrender/core/BoundingRect}\r\n */\r\n getBoundingRect(): BoundingRect {\r\n return this._rect;\r\n }\r\n\r\n setViewRect(x: number, y: number, width: number, height: number): void {\r\n this._transformTo(x, y, width, height);\r\n this._viewRect = new BoundingRect(x, y, width, height);\r\n }\r\n\r\n /**\r\n * Transformed to particular position and size\r\n */\r\n protected _transformTo(x: number, y: number, width: number, height: number): void {\r\n const rect = this.getBoundingRect();\r\n const rawTransform = this._rawTransformable;\r\n\r\n rawTransform.transform = rect.calculateTransform(\r\n new BoundingRect(x, y, width, height)\r\n );\r\n\r\n const rawParent = rawTransform.parent;\r\n rawTransform.parent = null;\r\n rawTransform.decomposeTransform();\r\n rawTransform.parent = rawParent;\r\n\r\n this._updateTransform();\r\n }\r\n\r\n /**\r\n * Set center of view\r\n */\r\n setCenter(centerCoord: (number | string)[], api: ExtensionAPI): void {\r\n if (!centerCoord) {\r\n return;\r\n }\r\n this._center = [\r\n parsePercent(centerCoord[0], api.getWidth()),\r\n parsePercent(centerCoord[1], api.getHeight())\r\n ];\r\n this._updateCenterAndZoom();\r\n }\r\n\r\n setZoom(zoom: number): void {\r\n zoom = zoom || 1;\r\n\r\n const zoomLimit = this.zoomLimit;\r\n if (zoomLimit) {\r\n if (zoomLimit.max != null) {\r\n zoom = Math.min(zoomLimit.max, zoom);\r\n }\r\n if (zoomLimit.min != null) {\r\n zoom = Math.max(zoomLimit.min, zoom);\r\n }\r\n }\r\n this._zoom = zoom;\r\n\r\n this._updateCenterAndZoom();\r\n }\r\n\r\n /**\r\n * Get default center without roam\r\n */\r\n getDefaultCenter(): number[] {\r\n // Rect before any transform\r\n const rawRect = this.getBoundingRect();\r\n const cx = rawRect.x + rawRect.width / 2;\r\n const cy = rawRect.y + rawRect.height / 2;\r\n\r\n return [cx, cy];\r\n }\r\n\r\n getCenter(): number[] {\r\n return this._center || this.getDefaultCenter();\r\n }\r\n\r\n getZoom(): number {\r\n return this._zoom || 1;\r\n }\r\n\r\n getRoamTransform(): matrix.MatrixArray {\r\n return this._roamTransformable.getLocalTransform();\r\n }\r\n\r\n /**\r\n * Remove roam\r\n */\r\n private _updateCenterAndZoom(): void {\r\n // Must update after view transform updated\r\n const rawTransformMatrix = this._rawTransformable.getLocalTransform();\r\n const roamTransform = this._roamTransformable;\r\n let defaultCenter = this.getDefaultCenter();\r\n let center = this.getCenter();\r\n const zoom = this.getZoom();\r\n\r\n center = vector.applyTransform([], center, rawTransformMatrix);\r\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\r\n\r\n roamTransform.originX = center[0];\r\n roamTransform.originY = center[1];\r\n roamTransform.x = defaultCenter[0] - center[0];\r\n roamTransform.y = defaultCenter[1] - center[1];\r\n roamTransform.scaleX = roamTransform.scaleY = zoom;\r\n\r\n this._updateTransform();\r\n }\r\n\r\n /**\r\n * Update transform props on `this` based on the current\r\n * `this._roamTransformable` and `this._rawTransformable`.\r\n */\r\n protected _updateTransform(): void {\r\n const roamTransformable = this._roamTransformable;\r\n const rawTransformable = this._rawTransformable;\r\n\r\n rawTransformable.parent = roamTransformable;\r\n roamTransformable.updateTransform();\r\n rawTransformable.updateTransform();\r\n\r\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\r\n\r\n this._rawTransform = rawTransformable.getLocalTransform();\r\n\r\n this.invTransform = this.invTransform || [];\r\n matrix.invert(this.invTransform, this.transform);\r\n\r\n this.decomposeTransform();\r\n }\r\n\r\n getTransformInfo(): {\r\n roam: ViewCoordSysTransformInfoPart\r\n raw: ViewCoordSysTransformInfoPart\r\n } {\r\n const rawTransformable = this._rawTransformable;\r\n\r\n const roamTransformable = this._roamTransformable;\r\n // Because roamTransformabel has `originX/originY` modified,\r\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\r\n // so need to recalculate them.\r\n const dummyTransformable = new Transformable();\r\n dummyTransformable.transform = roamTransformable.transform;\r\n dummyTransformable.decomposeTransform();\r\n\r\n return {\r\n roam: {\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n scaleX: dummyTransformable.scaleX,\r\n scaleY: dummyTransformable.scaleY\r\n },\r\n raw: {\r\n x: rawTransformable.x,\r\n y: rawTransformable.y,\r\n scaleX: rawTransformable.scaleX,\r\n scaleY: rawTransformable.scaleY\r\n }\r\n };\r\n }\r\n\r\n getViewRect(): BoundingRect {\r\n return this._viewRect;\r\n }\r\n\r\n /**\r\n * Get view rect after roam transform\r\n */\r\n getViewRectAfterRoam(): BoundingRect {\r\n const rect = this.getBoundingRect().clone();\r\n rect.applyTransform(this.transform);\r\n return rect;\r\n }\r\n\r\n /**\r\n * Convert a single (lon, lat) data item to (x, y) point.\r\n */\r\n dataToPoint(data: number[], noRoam?: boolean, out?: number[]): number[] {\r\n const transform = noRoam ? this._rawTransform : this.transform;\r\n out = out || [];\r\n return transform\r\n ? v2ApplyTransform(out, data, transform)\r\n : vector.copy(out, data);\r\n }\r\n\r\n /**\r\n * Convert a (x, y) point to (lon, lat) data\r\n */\r\n pointToData(point: number[]): number[] {\r\n const invTransform = this.invTransform;\r\n return invTransform\r\n ? v2ApplyTransform([], point, invTransform)\r\n : [point[0], point[1]];\r\n }\r\n\r\n convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: number[]): number[] {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n }\r\n\r\n convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, pixel: number[]): number[] {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n }\r\n\r\n /**\r\n * @implements\r\n */\r\n containPoint(point: number[]): boolean {\r\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n // getScalarScale() {\r\n // // Use determinant square root of transform to multiply scalar\r\n // let m = this.transform;\r\n // let det = Math.sqrt(Math.abs(m[0] * m[3] - m[2] * m[1]));\r\n // return det;\r\n // }\r\n}\r\n\r\nfunction getCoordSys(finder: ParsedModelFinderKnown): View {\r\n const seriesModel = finder.seriesModel;\r\n return seriesModel ? seriesModel.coordinateSystem as View : null; // e.g., graph.\r\n}\r\n\r\nexport default View;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport View from '../View';\r\nimport geoSourceManager from './geoSourceManager';\r\nimport { GeoJSONRegion, Region } from './Region';\r\nimport { GeoProjection, GeoResource, NameMap } from './geoTypes';\r\nimport GlobalModel from '../../model/Global';\r\nimport { ParsedModelFinder, ParsedModelFinderKnown, SINGLE_REFERRING } from '../../util/model';\r\nimport GeoModel from './GeoModel';\r\nimport { resizeGeoType } from './geoCreator';\r\nimport { warn } from '../../util/log';\r\n\r\nconst GEO_DEFAULT_PARAMS: {\r\n [type in GeoResource['type']]: {\r\n aspectScale: number;\r\n invertLongitute: boolean;\r\n }\r\n} = {\r\n 'geoJSON': {\r\n aspectScale: 0.75,\r\n invertLongitute: true\r\n },\r\n 'geoSVG': {\r\n aspectScale: 1,\r\n invertLongitute: false\r\n }\r\n} as const;\r\n\r\nexport const geo2DDimensions = ['lng', 'lat'];\r\n\r\n\r\nclass Geo extends View {\r\n\r\n dimensions = geo2DDimensions;\r\n\r\n type = 'geo';\r\n\r\n // map type\r\n readonly map: string;\r\n readonly resourceType: GeoResource['type'];\r\n\r\n // Only store specified name coord via `addGeoCoord`.\r\n private _nameCoordMap: zrUtil.HashMap = zrUtil.createHashMap();\r\n private _regionsMap: zrUtil.HashMap;\r\n private _invertLongitute: boolean;\r\n readonly regions: Region[];\r\n readonly aspectScale: number;\r\n\r\n projection: GeoProjection;\r\n // Injected outside\r\n model: GeoModel;\r\n resize: resizeGeoType;\r\n\r\n constructor(\r\n name: string,\r\n map: string,\r\n opt: {\r\n projection?: GeoProjection;\r\n // Specify name alias\r\n nameMap?: NameMap;\r\n nameProperty?: string;\r\n aspectScale?: number;\r\n }\r\n ) {\r\n super(name);\r\n\r\n this.map = map;\r\n\r\n let projection = opt.projection;\r\n const source = geoSourceManager.load(\r\n map,\r\n opt.nameMap,\r\n opt.nameProperty\r\n );\r\n const resource = geoSourceManager.getGeoResource(map);\r\n const resourceType = this.resourceType = resource ? resource.type : null;\r\n const regions = this.regions = source.regions;\r\n\r\n const defaultParams = GEO_DEFAULT_PARAMS[resource.type];\r\n\r\n this._regionsMap = source.regionsMap;\r\n this.regions = source.regions;\r\n\r\n if (__DEV__ && projection) {\r\n // Do some check\r\n if (resourceType === 'geoSVG') {\r\n if (__DEV__) {\r\n warn(`Map ${map} with SVG source can't use projection. Only GeoJSON source supports projection.`);\r\n }\r\n projection = null;\r\n }\r\n if (!(projection.project && projection.unproject)) {\r\n if (__DEV__) {\r\n warn('project and unproject must be both provided in the projeciton.');\r\n }\r\n projection = null;\r\n }\r\n }\r\n this.projection = projection;\r\n\r\n let boundingRect;\r\n if (projection) {\r\n // Can't reuse the raw bounding rect\r\n for (let i = 0; i < regions.length; i++) {\r\n const regionRect = (regions[i] as GeoJSONRegion).getBoundingRect(projection);\r\n boundingRect = boundingRect || regionRect.clone();\r\n boundingRect.union(regionRect);\r\n }\r\n }\r\n else {\r\n boundingRect = source.boundingRect;\r\n }\r\n this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);\r\n\r\n\r\n // aspectScale and invertLongitute actually is the parameters default raw projection.\r\n // So we ignore them if projection is given.\r\n\r\n // Ignore default aspect scale if projection exits.\r\n this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale);\r\n // Not invert longitude if projection exits.\r\n this._invertLongitute = projection ? false : defaultParams.invertLongitute;\r\n }\r\n\r\n protected _transformTo(x: number, y: number, width: number, height: number): void {\r\n let rect = this.getBoundingRect();\r\n const invertLongitute = this._invertLongitute;\r\n\r\n rect = rect.clone();\r\n\r\n if (invertLongitute) {\r\n // Longitude is inverted.\r\n rect.y = -rect.y - rect.height;\r\n }\r\n\r\n const rawTransformable = this._rawTransformable;\r\n\r\n rawTransformable.transform = rect.calculateTransform(\r\n new BoundingRect(x, y, width, height)\r\n );\r\n\r\n const rawParent = rawTransformable.parent;\r\n rawTransformable.parent = null;\r\n rawTransformable.decomposeTransform();\r\n rawTransformable.parent = rawParent;\r\n\r\n if (invertLongitute) {\r\n rawTransformable.scaleY = -rawTransformable.scaleY;\r\n }\r\n\r\n this._updateTransform();\r\n }\r\n\r\n getRegion(name: string): Region {\r\n return this._regionsMap.get(name);\r\n }\r\n\r\n getRegionByCoord(coord: number[]): Region {\r\n const regions = this.regions;\r\n for (let i = 0; i < regions.length; i++) {\r\n const region = regions[i];\r\n if (region.type === 'geoJSON' && (region as GeoJSONRegion).contain(coord)) {\r\n return regions[i];\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Add geoCoord for indexing by name\r\n */\r\n addGeoCoord(name: string, geoCoord: number[]): void {\r\n this._nameCoordMap.set(name, geoCoord);\r\n }\r\n\r\n /**\r\n * Get geoCoord by name\r\n */\r\n getGeoCoord(name: string): number[] {\r\n const region = this._regionsMap.get(name);\r\n // Calculate center only on demand.\r\n return this._nameCoordMap.get(name) || (region && region.getCenter());\r\n }\r\n\r\n dataToPoint(data: number[] | string, noRoam?: boolean, out?: number[]): number[] {\r\n if (zrUtil.isString(data)) {\r\n // Map area name to geoCoord\r\n data = this.getGeoCoord(data);\r\n }\r\n if (data) {\r\n const projection = this.projection;\r\n if (projection) {\r\n // projection may return null point.\r\n data = projection.project(data);\r\n }\r\n return data && this.projectedToPoint(data, noRoam, out);\r\n }\r\n }\r\n\r\n pointToData(point: number[]) {\r\n const projection = this.projection;\r\n if (projection) {\r\n // projection may return null point.\r\n point = projection.unproject(point);\r\n }\r\n return point && this.pointToProjected(point);\r\n }\r\n\r\n /**\r\n * Point to projected data. Same with pointToData when projection is used.\r\n */\r\n pointToProjected(point: number[]) {\r\n return super.pointToData(point);\r\n }\r\n\r\n projectedToPoint(projected: number[], noRoam?: boolean, out?: number[]) {\r\n return super.dataToPoint(projected, noRoam, out);\r\n }\r\n\r\n convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: number[]): number[] {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n }\r\n\r\n convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, pixel: number[]): number[] {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n }\r\n};\r\n\r\nzrUtil.mixin(Geo, View);\r\n\r\nfunction getCoordSys(finder: ParsedModelFinderKnown): Geo {\r\n const geoModel = finder.geoModel as GeoModel;\r\n const seriesModel = finder.seriesModel;\r\n return geoModel\r\n ? geoModel.coordinateSystem\r\n : seriesModel\r\n ? (\r\n seriesModel.coordinateSystem as Geo // For map series.\r\n || (\r\n (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}\r\n ) as GeoModel).coordinateSystem\r\n )\r\n : null;\r\n}\r\n\r\nexport default Geo;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Geo, { geo2DDimensions } from './Geo';\r\nimport * as layout from '../../util/layout';\r\nimport * as numberUtil from '../../util/number';\r\nimport geoSourceManager from './geoSourceManager';\r\nimport GeoModel, { GeoCommonOptionMixin, GeoOption, RegoinOption } from './GeoModel';\r\nimport MapSeries, { MapSeriesOption } from '../../chart/map/MapSeries';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { CoordinateSystemCreator } from '../CoordinateSystem';\r\nimport { NameMap } from './geoTypes';\r\nimport { SeriesOption, SeriesOnGeoOptionMixin } from '../../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport type Model from '../../model/Model';\r\nimport type GlobalModel from '../../model/Global';\r\nimport type SeriesModel from '../../model/Series';\r\nimport type ComponentModel from '../../model/Component';\r\nimport * as vector from 'zrender/src/core/vector';\r\n\r\nexport type resizeGeoType = typeof resizeGeo;\r\n\r\n/**\r\n * Resize method bound to the geo\r\n */\r\nfunction resizeGeo(this: Geo, geoModel: ComponentModel, api: ExtensionAPI): void {\r\n\r\n const boundingCoords = geoModel.get('boundingCoords');\r\n if (boundingCoords != null) {\r\n let leftTop = boundingCoords[0];\r\n let rightBottom = boundingCoords[1];\r\n if (!(\r\n isFinite(leftTop[0]) && isFinite(leftTop[1])\r\n && isFinite(rightBottom[0]) && isFinite(rightBottom[1])\r\n )) {\r\n if (__DEV__) {\r\n console.error('Invalid boundingCoords');\r\n }\r\n }\r\n else {\r\n // Sample around the lng/lat rect and use projection to calculate actual bounding rect.\r\n const projection = this.projection;\r\n if (projection) {\r\n const xMin = leftTop[0];\r\n const yMin = leftTop[1];\r\n const xMax = rightBottom[0];\r\n const yMax = rightBottom[1];\r\n leftTop = [Infinity, Infinity];\r\n rightBottom = [-Infinity, -Infinity];\r\n\r\n // TODO better way?\r\n const sampleLine = (x0: number, y0: number, x1: number, y1: number) => {\r\n const dx = x1 - x0;\r\n const dy = y1 - y0;\r\n for (let i = 0; i <= 100; i++) {\r\n const p = i / 100;\r\n const pt = projection.project([x0 + dx * p, y0 + dy * p]);\r\n vector.min(leftTop, leftTop, pt);\r\n vector.max(rightBottom, rightBottom, pt);\r\n }\r\n };\r\n // Top\r\n sampleLine(xMin, yMin, xMax, yMin);\r\n // Right\r\n sampleLine(xMax, yMin, xMax, yMax);\r\n // Bottom\r\n sampleLine(xMax, yMax, xMin, yMax);\r\n // Left\r\n sampleLine(xMin, yMax, xMax, yMin);\r\n }\r\n\r\n this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]);\r\n }\r\n }\r\n\r\n const rect = this.getBoundingRect();\r\n\r\n const centerOption = geoModel.get('layoutCenter');\r\n const sizeOption = geoModel.get('layoutSize');\r\n\r\n const viewWidth = api.getWidth();\r\n const viewHeight = api.getHeight();\r\n\r\n const aspect = rect.width / rect.height * this.aspectScale;\r\n\r\n let useCenterAndSize = false;\r\n let center: number[];\r\n let size: number;\r\n\r\n if (centerOption && sizeOption) {\r\n center = [\r\n numberUtil.parsePercent(centerOption[0], viewWidth),\r\n numberUtil.parsePercent(centerOption[1], viewHeight)\r\n ];\r\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\r\n\r\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\r\n useCenterAndSize = true;\r\n }\r\n else {\r\n if (__DEV__) {\r\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\r\n }\r\n }\r\n }\r\n\r\n let viewRect: layout.LayoutRect;\r\n if (useCenterAndSize) {\r\n viewRect = {} as layout.LayoutRect;\r\n if (aspect > 1) {\r\n // Width is same with size\r\n viewRect.width = size;\r\n viewRect.height = size / aspect;\r\n }\r\n else {\r\n viewRect.height = size;\r\n viewRect.width = size * aspect;\r\n }\r\n viewRect.y = center[1] - viewRect.height / 2;\r\n viewRect.x = center[0] - viewRect.width / 2;\r\n }\r\n else {\r\n // Use left/top/width/height\r\n const boxLayoutOption = geoModel.getBoxLayoutParams() as Parameters[0];\r\n\r\n boxLayoutOption.aspect = aspect;\r\n\r\n viewRect = layout.getLayoutRect(boxLayoutOption, {\r\n width: viewWidth,\r\n height: viewHeight\r\n });\r\n }\r\n\r\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\r\n\r\n this.setCenter(geoModel.get('center'), api);\r\n this.setZoom(geoModel.get('zoom'));\r\n}\r\n\r\n// Back compat for ECharts2, where the coord map is set on map series:\r\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\r\nfunction setGeoCoords(geo: Geo, model: MapSeries) {\r\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\r\n geo.addGeoCoord(name, geoCoord);\r\n });\r\n}\r\n\r\nclass GeoCreator implements CoordinateSystemCreator {\r\n\r\n // For deciding which dimensions to use when creating list data\r\n dimensions = geo2DDimensions;\r\n\r\n create(ecModel: GlobalModel, api: ExtensionAPI): Geo[] {\r\n const geoList = [] as Geo[];\r\n\r\n function getCommonGeoProperties(model: Model) {\r\n return {\r\n nameProperty: model.get('nameProperty'),\r\n aspectScale: model.get('aspectScale'),\r\n projection: model.get('projection')\r\n };\r\n }\r\n\r\n // FIXME Create each time may be slow\r\n ecModel.eachComponent('geo', function (geoModel: GeoModel, idx) {\r\n const mapName = geoModel.get('map');\r\n\r\n const geo = new Geo(mapName + idx, mapName, zrUtil.extend({\r\n nameMap: geoModel.get('nameMap')\r\n }, getCommonGeoProperties(geoModel)));\r\n\r\n geo.zoomLimit = geoModel.get('scaleLimit');\r\n geoList.push(geo);\r\n\r\n // setGeoCoords(geo, geoModel);\r\n\r\n geoModel.coordinateSystem = geo;\r\n geo.model = geoModel;\r\n\r\n // Inject resize method\r\n geo.resize = resizeGeo;\r\n\r\n geo.resize(geoModel, api);\r\n });\r\n\r\n ecModel.eachSeries(function (seriesModel) {\r\n const coordSys = seriesModel.get('coordinateSystem');\r\n if (coordSys === 'geo') {\r\n const geoIndex = (\r\n seriesModel as SeriesModel\r\n ).get('geoIndex') || 0;\r\n seriesModel.coordinateSystem = geoList[geoIndex];\r\n }\r\n });\r\n\r\n // If has map series\r\n const mapModelGroupBySeries = {} as Dictionary;\r\n\r\n ecModel.eachSeriesByType('map', function (seriesModel: MapSeries) {\r\n if (!seriesModel.getHostGeoModel()) {\r\n const mapType = seriesModel.getMapType();\r\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\r\n mapModelGroupBySeries[mapType].push(seriesModel);\r\n }\r\n });\r\n\r\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\r\n const nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('nameMap');\r\n });\r\n\r\n const geo = new Geo(mapType, mapType, zrUtil.extend({\r\n nameMap: zrUtil.mergeAll(nameMapList)\r\n }, getCommonGeoProperties(mapSeries[0])));\r\n\r\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\r\n return singleMapSeries.get('scaleLimit');\r\n }));\r\n geoList.push(geo);\r\n\r\n // Inject resize method\r\n geo.resize = resizeGeo;\r\n\r\n geo.resize(mapSeries[0], api);\r\n\r\n zrUtil.each(mapSeries, function (singleMapSeries) {\r\n singleMapSeries.coordinateSystem = geo;\r\n\r\n setGeoCoords(geo, singleMapSeries);\r\n });\r\n });\r\n\r\n return geoList;\r\n }\r\n\r\n /**\r\n * Fill given regions array\r\n */\r\n getFilledRegions(\r\n originRegionArr: RegoinOption[],\r\n mapName: string,\r\n nameMap: NameMap,\r\n nameProperty: string\r\n ): RegoinOption[] {\r\n // Not use the original\r\n const regionsArr = (originRegionArr || []).slice();\r\n\r\n const dataNameMap = zrUtil.createHashMap();\r\n for (let i = 0; i < regionsArr.length; i++) {\r\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\r\n }\r\n\r\n const source = geoSourceManager.load(mapName, nameMap, nameProperty);\r\n zrUtil.each(source.regions, function (region) {\r\n const name = region.name;\r\n !dataNameMap.get(name) && regionsArr.push({name: name});\r\n });\r\n\r\n return regionsArr;\r\n }\r\n}\r\n\r\n\r\nconst geoCreator = new GeoCreator();\r\n\r\nexport default geoCreator;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as modelUtil from '../../util/model';\r\nimport ComponentModel from '../../model/Component';\r\nimport Model from '../../model/Model';\r\nimport geoCreator from './geoCreator';\r\nimport Geo from './Geo';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n ItemStyleOption,\r\n ZRColor,\r\n LabelOption,\r\n DisplayState,\r\n RoamOptionMixin,\r\n AnimationOptionMixin,\r\n StatesOptionMixin,\r\n Dictionary,\r\n CommonTooltipOption,\r\n StatesMixinBase\r\n} from '../../util/types';\r\nimport { GeoProjection, NameMap } from './geoTypes';\r\nimport GlobalModel from '../../model/Global';\r\nimport geoSourceManager from './geoSourceManager';\r\n\r\n\r\nexport interface GeoItemStyleOption extends ItemStyleOption {\r\n areaColor?: ZRColor;\r\n};\r\ninterface GeoLabelOption extends LabelOption {\r\n formatter?: string | ((params: GeoLabelFormatterDataParams) => string);\r\n}\r\nexport interface GeoStateOption {\r\n itemStyle?: GeoItemStyleOption\r\n // FIXME:TS formatter?\r\n label?: GeoLabelOption\r\n}\r\ninterface GeoLabelFormatterDataParams {\r\n name: string;\r\n status: DisplayState;\r\n}\r\n\r\nexport interface RegoinOption extends GeoStateOption, StatesOptionMixin {\r\n name?: string\r\n selected?: boolean\r\n tooltip?: CommonTooltipOption\r\n}\r\n\r\nexport interface GeoTooltipFormatterParams {\r\n componentType: 'geo'\r\n geoIndex: number\r\n name: string\r\n $vars: ['name']\r\n}\r\n\r\n\r\nexport interface GeoCommonOptionMixin extends RoamOptionMixin {\r\n // Map name\r\n map: string;\r\n\r\n // Aspect is width / height. Inited to be geoJson bbox aspect\r\n // This parameter is used for scale this aspect\r\n aspectScale?: number;\r\n\r\n // Layout with center and size\r\n // If you want to put map in a fixed size box with right aspect ratio\r\n // This two properties may be more convenient\r\n // Like: `40` or `'50%'`.\r\n layoutCenter?: (number | string)[];\r\n // Like: `40` or `'50%'`.\r\n layoutSize?: number | string;\r\n\r\n // Define left-top, right-bottom lng/lat coords to control view\r\n // For example, [ [180, 90], [-180, -90] ]\r\n // higher priority than center and zoom\r\n boundingCoords?: number[][];\r\n\r\n nameMap?: NameMap;\r\n nameProperty?: string;\r\n\r\n /**\r\n * Use raw projection by default\r\n * Only available for GeoJSON source.\r\n *\r\n * NOTE: `center` needs to be the projected coord if projection is used.\r\n */\r\n projection?: GeoProjection;\r\n}\r\n\r\nexport interface GeoOption extends\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n // For lens animation on geo.\r\n AnimationOptionMixin,\r\n GeoCommonOptionMixin,\r\n StatesOptionMixin, GeoStateOption {\r\n mainType?: 'geo';\r\n\r\n show?: boolean;\r\n silent?: boolean;\r\n\r\n regions?: RegoinOption[];\r\n\r\n stateAnimation?: AnimationOptionMixin\r\n\r\n selectedMode?: 'single' | 'multiple' | boolean\r\n selectedMap?: Dictionary\r\n\r\n tooltip?: CommonTooltipOption\r\n}\r\n\r\nclass GeoModel extends ComponentModel {\r\n\r\n static type = 'geo';\r\n readonly type = GeoModel.type;\r\n\r\n coordinateSystem: Geo;\r\n\r\n static layoutMode = 'box' as const;\r\n\r\n private _optionModelMap: zrUtil.HashMap>;\r\n\r\n static defaultOption: GeoOption = {\r\n\r\n // zlevel: 0,\r\n\r\n z: 0,\r\n\r\n show: true,\r\n\r\n left: 'center',\r\n\r\n top: 'center',\r\n\r\n // Default value:\r\n // for geoSVG source: 1,\r\n // for geoJSON source: 0.75.\r\n aspectScale: null,\r\n\r\n // /// Layout with center and size\r\n // If you want to put map in a fixed size box with right aspect ratio\r\n // This two properties may be more convenient\r\n // layoutCenter: [50%, 50%]\r\n // layoutSize: 100\r\n\r\n silent: false,\r\n\r\n // Map type\r\n map: '',\r\n\r\n // Define left-top, right-bottom coords to control view\r\n // For example, [ [180, 90], [-180, -90] ]\r\n boundingCoords: null,\r\n\r\n // Default on center of map\r\n center: null,\r\n\r\n zoom: 1,\r\n\r\n scaleLimit: null,\r\n\r\n // selectedMode: false\r\n\r\n label: {\r\n show: false,\r\n color: '#000'\r\n },\r\n\r\n itemStyle: {\r\n borderWidth: 0.5,\r\n borderColor: '#444'\r\n // Default color:\r\n // + geoJSON: #eee\r\n // + geoSVG: null (use SVG original `fill`)\r\n // color: '#eee'\r\n },\r\n\r\n emphasis: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n\r\n select: {\r\n label: {\r\n show: true,\r\n color: 'rgb(100,0,0)'\r\n },\r\n itemStyle: {\r\n color: 'rgba(255,215,0,0.8)'\r\n }\r\n },\r\n\r\n regions: []\r\n\r\n // tooltip: {\r\n // show: false\r\n // }\r\n };\r\n\r\n init(option: GeoOption, parentModel: Model, ecModel: GlobalModel): void {\r\n const source = geoSourceManager.getGeoResource(option.map);\r\n if (source && source.type === 'geoJSON') {\r\n const itemStyle = option.itemStyle = option.itemStyle || {};\r\n if (!('color' in itemStyle)) {\r\n itemStyle.color = '#eee';\r\n }\r\n }\r\n\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n\r\n // Default label emphasis `show`\r\n modelUtil.defaultEmphasis(option, 'label', ['show']);\r\n }\r\n\r\n optionUpdated(): void {\r\n const option = this.option;\r\n\r\n option.regions = geoCreator.getFilledRegions(\r\n option.regions, option.map, option.nameMap, option.nameProperty\r\n );\r\n\r\n const selectedMap: Dictionary = {};\r\n this._optionModelMap = zrUtil.reduce(option.regions || [], (optionModelMap, regionOpt) => {\r\n const regionName = regionOpt.name;\r\n if (regionName) {\r\n optionModelMap.set(regionName, new Model(regionOpt, this, this.ecModel));\r\n if (regionOpt.selected) {\r\n selectedMap[regionName] = true;\r\n }\r\n }\r\n return optionModelMap;\r\n }, zrUtil.createHashMap());\r\n\r\n if (!option.selectedMap) {\r\n option.selectedMap = selectedMap;\r\n }\r\n }\r\n\r\n /**\r\n * Get model of region.\r\n */\r\n getRegionModel(name: string): Model {\r\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\r\n }\r\n\r\n /**\r\n * Format label\r\n * @param name Region name\r\n */\r\n getFormattedLabel(name: string, status?: DisplayState) {\r\n const regionModel = this.getRegionModel(name);\r\n const formatter = status === 'normal'\r\n ? regionModel.get(['label', 'formatter'])\r\n : regionModel.get(['emphasis', 'label', 'formatter']);\r\n const params = {\r\n name: name\r\n } as GeoLabelFormatterDataParams;\r\n if (zrUtil.isFunction(formatter)) {\r\n params.status = status;\r\n return formatter(params);\r\n }\r\n else if (zrUtil.isString(formatter)) {\r\n return formatter.replace('{a}', name != null ? name : '');\r\n }\r\n }\r\n\r\n setZoom(zoom: number): void {\r\n this.option.zoom = zoom;\r\n }\r\n\r\n setCenter(center: number[]): void {\r\n this.option.center = center;\r\n }\r\n\r\n // PENGING If selectedMode is null ?\r\n select(name?: string): void {\r\n const option = this.option;\r\n const selectedMode = option.selectedMode;\r\n if (!selectedMode) {\r\n return;\r\n }\r\n if (selectedMode !== 'multiple') {\r\n option.selectedMap = null;\r\n }\r\n\r\n const selectedMap = option.selectedMap || (option.selectedMap = {});\r\n selectedMap[name] = true;\r\n }\r\n\r\n unSelect(name?: string): void {\r\n const selectedMap = this.option.selectedMap;\r\n if (selectedMap) {\r\n selectedMap[name] = false;\r\n }\r\n }\r\n\r\n toggleSelected(name?: string): void {\r\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\r\n }\r\n\r\n isSelected(name?: string): boolean {\r\n const selectedMap = this.option.selectedMap;\r\n return !!(selectedMap && selectedMap[name]);\r\n }\r\n\r\n}\r\n\r\nexport default GeoModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport type Geo from '../coord/geo/Geo';\r\nimport type View from '../coord/View';\r\nimport type ExtensionAPI from '../core/ExtensionAPI';\r\nimport type { Payload } from '../util/types';\r\n\r\nexport interface RoamPayload extends Payload {\r\n dx: number\r\n dy: number\r\n zoom: number\r\n originX: number\r\n originY: number\r\n}\r\n\r\nfunction getCenterCoord(view: View, point: number[]) {\r\n // Use projected coord as center because it's linear.\r\n return (view as Geo).pointToProjected\r\n ? (view as Geo).pointToProjected(point)\r\n : view.pointToData(point);\r\n}\r\n\r\nexport function updateCenterAndZoom(\r\n view: View,\r\n payload: RoamPayload,\r\n zoomLimit?: {\r\n min?: number,\r\n max?: number\r\n },\r\n api?: ExtensionAPI\r\n) {\r\n const previousZoom = view.getZoom();\r\n const center = view.getCenter();\r\n let zoom = payload.zoom;\r\n\r\n const point = (view as Geo).projectedToPoint\r\n ? (view as Geo).projectedToPoint(center)\r\n : view.dataToPoint(center);\r\n\r\n if (payload.dx != null && payload.dy != null) {\r\n point[0] -= payload.dx;\r\n point[1] -= payload.dy;\r\n\r\n view.setCenter(getCenterCoord(view, point), api);\r\n }\r\n if (zoom != null) {\r\n if (zoomLimit) {\r\n const zoomMin = zoomLimit.min || 0;\r\n const zoomMax = zoomLimit.max || Infinity;\r\n zoom = Math.max(\r\n Math.min(previousZoom * zoom, zoomMax),\r\n zoomMin\r\n ) / previousZoom;\r\n }\r\n\r\n // Zoom on given point(originX, originY)\r\n view.scaleX *= zoom;\r\n view.scaleY *= zoom;\r\n const fixX = (payload.originX - view.x) * (zoom - 1);\r\n const fixY = (payload.originY - view.y) * (zoom - 1);\r\n\r\n view.x -= fixX;\r\n view.y -= fixY;\r\n\r\n view.updateTransform();\r\n // Get the new center\r\n view.setCenter(getCenterCoord(view, point), api);\r\n view.setZoom(zoom * previousZoom);\r\n }\r\n\r\n return {\r\n center: view.getCenter(),\r\n zoom: view.getZoom()\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport MapDraw from '../helper/MapDraw';\r\nimport ComponentView from '../../view/Component';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GeoModel from '../../coord/geo/GeoModel';\r\nimport { Payload, ZRElementEvent, ECEventData } from '../../util/types';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { findEventDispatcher } from '../../util/event';\r\nimport Element from 'zrender/src/Element';\r\n\r\nclass GeoView extends ComponentView {\r\n\r\n static type = 'geo' as const;\r\n readonly type = GeoView.type;\r\n\r\n private _mapDraw: MapDraw;\r\n\r\n private _api: ExtensionAPI;\r\n\r\n private _model: GeoModel;\r\n\r\n focusBlurEnabled = true;\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._api = api;\r\n }\r\n\r\n render(\r\n geoModel: GeoModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload\r\n ): void {\r\n this._model = geoModel;\r\n\r\n if (!geoModel.get('show')) {\r\n this._mapDraw && this._mapDraw.remove();\r\n this._mapDraw = null;\r\n return;\r\n }\r\n\r\n if (!this._mapDraw) {\r\n this._mapDraw = new MapDraw(api);\r\n }\r\n const mapDraw = this._mapDraw;\r\n mapDraw.draw(geoModel, ecModel, api, this, payload);\r\n mapDraw.group.on('click', this._handleRegionClick, this);\r\n mapDraw.group.silent = geoModel.get('silent');\r\n this.group.add(mapDraw.group);\r\n this.updateSelectStatus(geoModel, ecModel, api);\r\n }\r\n\r\n private _handleRegionClick(e: ZRElementEvent) {\r\n let eventData: ECEventData;\r\n\r\n findEventDispatcher(e.target, current => {\r\n return (eventData = getECData(current).eventData) != null;\r\n }, true);\r\n\r\n if (eventData) {\r\n this._api.dispatchAction({\r\n type: 'geoToggleSelect',\r\n geoId: this._model.id,\r\n name: eventData.name\r\n });\r\n }\r\n }\r\n\r\n updateSelectStatus(model: GeoModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._mapDraw.group.traverse((node) => {\r\n const eventData = getECData(node).eventData;\r\n if (eventData) {\r\n this._model.isSelected(eventData.name)\r\n ? api.enterSelect(node) : api.leaveSelect(node);\r\n // No need to traverse children.\r\n return true;\r\n }\r\n });\r\n }\r\n\r\n findHighDownDispatchers(name: string): Element[] {\r\n return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);\r\n }\r\n\r\n dispose(): void {\r\n this._mapDraw && this._mapDraw.remove();\r\n }\r\n\r\n}\r\n\r\nexport default GeoView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport GeoModel from '../../coord/geo/GeoModel';\r\nimport geoCreator from '../../coord/geo/geoCreator';\r\nimport { ActionInfo } from '../../util/types';\r\nimport { each } from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport { updateCenterAndZoom, RoamPayload } from '../../action/roamHelper';\r\nimport MapSeries from '../../chart/map/MapSeries';\r\nimport GeoView from './GeoView';\r\nimport geoSourceManager from '../../coord/geo/geoSourceManager';\r\nimport type ExtensionAPI from '../../core/ExtensionAPI';\r\n\r\ntype RegisterMapParams = Parameters;\r\nfunction registerMap(\r\n mapName: RegisterMapParams[0],\r\n geoJson: RegisterMapParams[1],\r\n specialAreas?: RegisterMapParams[2]\r\n) {\r\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\r\n}\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerCoordinateSystem('geo', geoCreator);\r\n\r\n registers.registerComponentModel(GeoModel);\r\n registers.registerComponentView(GeoView);\r\n\r\n registers.registerImpl('registerMap', registerMap);\r\n registers.registerImpl('getMap', (mapName: string) => geoSourceManager.getMapForUser(mapName));\r\n\r\n\r\n function makeAction(\r\n method: 'toggleSelected' | 'select' | 'unSelect',\r\n actionInfo: ActionInfo\r\n ): void {\r\n actionInfo.update = 'geo:updateSelectStatus';\r\n registers.registerAction(actionInfo, function (payload, ecModel) {\r\n const selected = {} as {[regionName: string]: boolean};\r\n const allSelected = [] as ({ name: string[], geoIndex: number })[];\r\n\r\n ecModel.eachComponent(\r\n { mainType: 'geo', query: payload},\r\n function (geoModel: GeoModel) {\r\n geoModel[method](payload.name);\r\n const geo = geoModel.coordinateSystem;\r\n\r\n each(geo.regions, function (region) {\r\n selected[region.name] = geoModel.isSelected(region.name) || false;\r\n });\r\n\r\n // Notice: there might be duplicated name in different regions.\r\n const names = [] as string[];\r\n each(selected, function (v, name) {\r\n selected[name] && names.push(name);\r\n });\r\n allSelected.push({\r\n geoIndex: geoModel.componentIndex,\r\n // Use singular, the same naming convention as the event `selectchanged`.\r\n name: names\r\n });\r\n }\r\n );\r\n\r\n return {\r\n selected: selected,\r\n allSelected: allSelected,\r\n name: payload.name\r\n };\r\n });\r\n }\r\n\r\n makeAction('toggleSelected', {\r\n type: 'geoToggleSelect',\r\n event: 'geoselectchanged'\r\n });\r\n makeAction('select', {\r\n type: 'geoSelect',\r\n event: 'geoselected'\r\n });\r\n makeAction('unSelect', {\r\n type: 'geoUnSelect',\r\n event: 'geounselected'\r\n });\r\n\r\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\r\n registers.registerAction({\r\n type: 'geoRoam',\r\n event: 'geoRoam',\r\n update: 'updateTransform'\r\n }, function (payload: RoamPayload, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const componentType = payload.componentType || 'series';\r\n\r\n ecModel.eachComponent(\r\n { mainType: componentType, query: payload },\r\n function (componentModel: GeoModel | MapSeries) {\r\n const geo = componentModel.coordinateSystem;\r\n if (geo.type !== 'geo') {\r\n return;\r\n }\r\n\r\n const res = updateCenterAndZoom(\r\n geo, payload, (componentModel as GeoModel).get('scaleLimit'), api\r\n );\r\n\r\n componentModel.setCenter\r\n && componentModel.setCenter(res.center);\r\n\r\n componentModel.setZoom\r\n && componentModel.setZoom(res.zoom);\r\n\r\n // All map series with same `map` use the same geo coordinate system\r\n // So the center and zoom must be in sync. Include the series not selected by legend\r\n if (componentType === 'series') {\r\n each((componentModel as MapSeries).seriesGroup, function (seriesModel) {\r\n seriesModel.setCenter(res.center);\r\n seriesModel.setZoom(res.zoom);\r\n });\r\n }\r\n }\r\n );\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport MapView from './MapView';\r\nimport MapSeries from './MapSeries';\r\nimport mapDataStatistic from './mapDataStatistic';\r\nimport mapSymbolLayout from './mapSymbolLayout';\r\nimport {createLegacyDataSelectAction} from '../../legacy/dataSelectAction';\r\nimport {install as installGeo} from '../../component/geo/install';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installGeo);\r\n\r\n registers.registerChartView(MapView);\r\n registers.registerSeriesModel(MapSeries);\r\n\r\n registers.registerLayout(mapSymbolLayout);\r\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\r\n\r\n createLegacyDataSelectAction('map', registers.registerAction);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The tree layoutHelper implementation was originally copied from\r\n* \"d3.js\"(https://github.com/d3/d3-hierarchy) with\r\n* some modifications made for this project.\r\n* (see more details in the comment of the specific method below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the licence of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\r\n\r\n/**\r\n * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing\r\n * the tree.\r\n */\r\n\r\nimport * as layout from '../../util/layout';\r\nimport { TreeNode } from '../../data/Tree';\r\nimport TreeSeriesModel from './TreeSeries';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\n\r\ninterface HierNode {\r\n defaultAncestor: TreeLayoutNode,\r\n ancestor: TreeLayoutNode,\r\n prelim: number,\r\n modifier: number,\r\n change: number,\r\n shift: number,\r\n i: number,\r\n thread: TreeLayoutNode\r\n}\r\n\r\nexport interface TreeLayoutNode extends TreeNode {\r\n parentNode: TreeLayoutNode\r\n hierNode: HierNode\r\n children: TreeLayoutNode[]\r\n}\r\n/**\r\n * Initialize all computational message for following algorithm.\r\n */\r\nexport function init(inRoot: TreeNode) {\r\n const root = inRoot as TreeLayoutNode;\r\n root.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: root,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: 0,\r\n thread: null\r\n };\r\n\r\n const nodes = [root];\r\n let node;\r\n let children;\r\n\r\n while (node = nodes.pop()) { // jshint ignore:line\r\n children = node.children;\r\n if (node.isExpand && children.length) {\r\n const n = children.length;\r\n for (let i = n - 1; i >= 0; i--) {\r\n const child = children[i];\r\n child.hierNode = {\r\n defaultAncestor: null,\r\n ancestor: child,\r\n prelim: 0,\r\n modifier: 0,\r\n change: 0,\r\n shift: 0,\r\n i: i,\r\n thread: null\r\n };\r\n nodes.push(child);\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Computes a preliminary x coordinate for node. Before that, this function is\r\n * applied recursively to the children of node, as well as the function\r\n * apportion(). After spacing out the children by calling executeShifts(), the\r\n * node is placed to the midpoint of its outermost children.\r\n */\r\nexport function firstWalk(node: TreeLayoutNode, separation: SeparationFunc) {\r\n const children = node.isExpand ? node.children : [];\r\n const siblings = node.parentNode.children;\r\n const subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\r\n if (children.length) {\r\n executeShifts(node);\r\n const midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\r\n if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\r\n }\r\n else {\r\n node.hierNode.prelim = midPoint;\r\n }\r\n }\r\n else if (subtreeW) {\r\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\r\n }\r\n node.parentNode.hierNode.defaultAncestor = apportion(\r\n node,\r\n subtreeW,\r\n node.parentNode.hierNode.defaultAncestor || siblings[0],\r\n separation\r\n );\r\n}\r\n\r\n\r\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Computes all real x-coordinates by summing up the modifiers recursively.\r\n */\r\nexport function secondWalk(node: TreeLayoutNode) {\r\n const nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\r\n node.setLayout({x: nodeX}, true);\r\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\r\n}\r\n\r\n\r\nexport function separation(cb?: SeparationFunc) {\r\n return arguments.length ? cb : defaultSeparation;\r\n}\r\n\r\n/**\r\n * Transform the common coordinate to radial coordinate.\r\n */\r\nexport function radialCoordinate(rad: number, r: number) {\r\n rad -= Math.PI / 2;\r\n return {\r\n x: r * Math.cos(rad),\r\n y: r * Math.sin(rad)\r\n };\r\n}\r\n\r\n/**\r\n * Get the layout position of the whole view.\r\n */\r\nexport function getViewRect(seriesModel: TreeSeriesModel, api: ExtensionAPI) {\r\n return layout.getLayoutRect(\r\n seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }\r\n );\r\n}\r\n\r\n/**\r\n * All other shifts, applied to the smaller subtrees between w- and w+, are\r\n * performed by this function.\r\n *\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\r\nfunction executeShifts(node: TreeLayoutNode) {\r\n const children = node.children;\r\n let n = children.length;\r\n let shift = 0;\r\n let change = 0;\r\n while (--n >= 0) {\r\n const child = children[n];\r\n child.hierNode.prelim += shift;\r\n child.hierNode.modifier += shift;\r\n change += child.hierNode.change;\r\n shift += child.hierNode.shift + change;\r\n }\r\n}\r\n\r\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * The core of the algorithm. Here, a new subtree is combined with the\r\n * previous subtrees. Threads are used to traverse the inside and outside\r\n * contours of the left and right subtree up to the highest common level.\r\n * Whenever two nodes of the inside contours conflict, we compute the left\r\n * one of the greatest uncommon ancestors using the function nextAncestor()\r\n * and call moveSubtree() to shift the subtree and prepare the shifts of\r\n * smaller subtrees. Finally, we add a new thread (if necessary).\r\n */\r\nfunction apportion(\r\n subtreeV: TreeLayoutNode,\r\n subtreeW: TreeLayoutNode,\r\n ancestor: TreeLayoutNode,\r\n separation: SeparationFunc\r\n): TreeLayoutNode {\r\n\r\n if (subtreeW) {\r\n let nodeOutRight = subtreeV;\r\n let nodeInRight = subtreeV;\r\n let nodeOutLeft = nodeInRight.parentNode.children[0];\r\n let nodeInLeft = subtreeW;\r\n\r\n let sumOutRight = nodeOutRight.hierNode.modifier;\r\n let sumInRight = nodeInRight.hierNode.modifier;\r\n let sumOutLeft = nodeOutLeft.hierNode.modifier;\r\n let sumInLeft = nodeInLeft.hierNode.modifier;\r\n\r\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\r\n nodeOutRight = nextRight(nodeOutRight);\r\n nodeOutLeft = nextLeft(nodeOutLeft);\r\n nodeOutRight.hierNode.ancestor = subtreeV;\r\n const shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim\r\n - sumInRight + separation(nodeInLeft, nodeInRight);\r\n if (shift > 0) {\r\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\r\n sumInRight += shift;\r\n sumOutRight += shift;\r\n }\r\n sumInLeft += nodeInLeft.hierNode.modifier;\r\n sumInRight += nodeInRight.hierNode.modifier;\r\n sumOutRight += nodeOutRight.hierNode.modifier;\r\n sumOutLeft += nodeOutLeft.hierNode.modifier;\r\n }\r\n if (nodeInLeft && !nextRight(nodeOutRight)) {\r\n nodeOutRight.hierNode.thread = nodeInLeft;\r\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\r\n\r\n }\r\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\r\n nodeOutLeft.hierNode.thread = nodeInRight;\r\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\r\n ancestor = subtreeV;\r\n }\r\n }\r\n return ancestor;\r\n}\r\n\r\n/**\r\n * This function is used to traverse the right contour of a subtree.\r\n * It returns the rightmost child of node or the thread of node. The function\r\n * returns null if and only if node is on the highest depth of its subtree.\r\n */\r\nfunction nextRight(node: TreeLayoutNode): TreeLayoutNode {\r\n const children = node.children;\r\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\r\n}\r\n\r\n/**\r\n * This function is used to traverse the left contour of a subtree (or a subforest).\r\n * It returns the leftmost child of node or the thread of node. The function\r\n * returns null if and only if node is on the highest depth of its subtree.\r\n */\r\nfunction nextLeft(node: TreeLayoutNode) {\r\n const children = node.children;\r\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\r\n}\r\n\r\n/**\r\n * If nodeInLeft\u2019s ancestor is a sibling of node, returns nodeInLeft\u2019s ancestor.\r\n * Otherwise, returns the specified ancestor.\r\n */\r\nfunction nextAncestor(\r\n nodeInLeft: TreeLayoutNode,\r\n node: TreeLayoutNode,\r\n ancestor: TreeLayoutNode\r\n): TreeLayoutNode {\r\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode\r\n ? nodeInLeft.hierNode.ancestor : ancestor;\r\n}\r\n\r\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Shifts the current subtree rooted at wr.\r\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\r\n */\r\nfunction moveSubtree(\r\n wl: TreeLayoutNode,\r\n wr: TreeLayoutNode,\r\n shift: number\r\n) {\r\n const change = shift / (wr.hierNode.i - wl.hierNode.i);\r\n wr.hierNode.change -= change;\r\n wr.hierNode.shift += shift;\r\n wr.hierNode.modifier += shift;\r\n wr.hierNode.prelim += shift;\r\n wl.hierNode.change += change;\r\n}\r\n\r\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\r\nfunction defaultSeparation(node1: TreeLayoutNode, node2: TreeLayoutNode): number {\r\n return node1.parentNode === node2.parentNode ? 1 : 2;\r\n}\r\n\r\ninterface SeparationFunc {\r\n (node1: TreeLayoutNode, node2: TreeLayoutNode): number\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport {getECData} from '../../util/innerStore';\r\nimport SymbolClz from '../helper/Symbol';\r\nimport {radialCoordinate} from './layoutHelper';\r\nimport * as bbox from 'zrender/src/core/bbox';\r\nimport View from '../../coord/View';\r\nimport * as roamHelper from '../../component/helper/roamHelper';\r\nimport RoamController, { RoamControllerHost } from '../../component/helper/RoamController';\r\nimport {onIrrelevantElement} from '../../component/helper/cursorHelper';\r\nimport {parsePercent} from '../../util/number';\r\nimport ChartView from '../../view/Chart';\r\nimport TreeSeriesModel, { TreeSeriesOption, TreeSeriesNodeItemOption } from './TreeSeries';\r\nimport Path, { PathProps, PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { TreeNode } from '../../data/Tree';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { setStatesStylesFromModel, setStatesFlag, setDefaultStateProxy, HOVER_STATE_BLUR } from '../../util/states';\r\nimport { AnimationOption, ECElement } from '../../util/types';\r\n\r\ntype TreeSymbol = SymbolClz & {\r\n __edge: graphic.BezierCurve | TreePath\r\n\r\n __radialOldRawX: number\r\n __radialOldRawY: number\r\n __radialRawX: number\r\n __radialRawY: number\r\n\r\n __oldX: number\r\n __oldY: number\r\n};\r\n\r\nclass TreeEdgeShape {\r\n parentPoint: number[] = [];\r\n childPoints: number[][] = [];\r\n orient: TreeSeriesOption['orient'];\r\n forkPosition: TreeSeriesOption['edgeForkPosition'];\r\n}\r\n\r\ninterface TreeEdgePathProps extends PathProps {\r\n shape?: Partial\r\n}\r\n\r\ninterface TreeNodeLayout {\r\n x: number\r\n y: number\r\n rawX: number\r\n rawY: number\r\n}\r\n\r\nclass TreePath extends Path {\r\n shape: TreeEdgeShape;\r\n constructor(opts?: TreeEdgePathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultStyle() {\r\n return {\r\n stroke: '#000',\r\n fill: null as string\r\n };\r\n }\r\n\r\n getDefaultShape() {\r\n return new TreeEdgeShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: TreeEdgeShape) {\r\n const childPoints = shape.childPoints;\r\n const childLen = childPoints.length;\r\n const parentPoint = shape.parentPoint;\r\n const firstChildPos = childPoints[0];\r\n const lastChildPos = childPoints[childLen - 1];\r\n\r\n if (childLen === 1) {\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\r\n return;\r\n }\r\n\r\n const orient = shape.orient;\r\n const forkDim = (orient === 'TB' || orient === 'BT') ? 0 : 1;\r\n const otherDim = 1 - forkDim;\r\n const forkPosition = parsePercent(shape.forkPosition, 1);\r\n const tmpPoint = [];\r\n tmpPoint[forkDim] = parentPoint[forkDim];\r\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\r\n\r\n ctx.moveTo(parentPoint[0], parentPoint[1]);\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\r\n tmpPoint[forkDim] = firstChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n tmpPoint[forkDim] = lastChildPos[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\r\n\r\n for (let i = 1; i < childLen - 1; i++) {\r\n const point = childPoints[i];\r\n ctx.moveTo(point[0], point[1]);\r\n tmpPoint[forkDim] = point[forkDim];\r\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\r\n }\r\n }\r\n}\r\n\r\nclass TreeView extends ChartView {\r\n\r\n static readonly type = 'tree';\r\n readonly type = TreeView.type;\r\n\r\n private _mainGroup = new graphic.Group();\r\n\r\n private _controller: RoamController;\r\n private _controllerHost: RoamControllerHost;\r\n\r\n private _data: SeriesData;\r\n\r\n private _nodeScaleRatio: number;\r\n private _min: number[];\r\n private _max: number[];\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._controller = new RoamController(api.getZr());\r\n\r\n this._controllerHost = {\r\n target: this.group\r\n } as RoamControllerHost;\r\n\r\n this.group.add(this._mainGroup);\r\n }\r\n\r\n render(\r\n seriesModel: TreeSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const data = seriesModel.getData();\r\n\r\n const layoutInfo = seriesModel.layoutInfo;\r\n\r\n const group = this._mainGroup;\r\n\r\n const layout = seriesModel.get('layout');\r\n\r\n if (layout === 'radial') {\r\n group.x = layoutInfo.x + layoutInfo.width / 2;\r\n group.y = layoutInfo.y + layoutInfo.height / 2;\r\n }\r\n else {\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n }\r\n\r\n this._updateViewCoordSys(seriesModel, api);\r\n this._updateController(seriesModel, ecModel, api);\r\n\r\n const oldData = this._data;\r\n\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (symbolNeedsDraw(data, newIdx)) {\r\n // Create node and edge\r\n updateNode(data, newIdx, null, group, seriesModel);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n const symbolEl = oldData.getItemGraphicEl(oldIdx) as TreeSymbol;\r\n if (!symbolNeedsDraw(data, newIdx)) {\r\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n return;\r\n }\r\n // Update node and edge\r\n updateNode(data, newIdx, symbolEl, group, seriesModel);\r\n })\r\n .remove(function (oldIdx) {\r\n const symbolEl = oldData.getItemGraphicEl(oldIdx) as TreeSymbol;\r\n // When remove a collapsed node of subtree, since the collapsed\r\n // node haven't been initialized with a symbol element,\r\n // you can't found it's symbol element through index.\r\n // so if we want to remove the symbol element we should insure\r\n // that the symbol element is not null.\r\n if (symbolEl) {\r\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\r\n }\r\n })\r\n .execute();\r\n\r\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\r\n\r\n this._updateNodeAndLinkScale(seriesModel);\r\n\r\n if (seriesModel.get('expandAndCollapse') === true) {\r\n data.eachItemGraphicEl(function (el, dataIndex) {\r\n el.off('click').on('click', function () {\r\n api.dispatchAction({\r\n type: 'treeExpandAndCollapse',\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndex\r\n });\r\n });\r\n });\r\n }\r\n this._data = data;\r\n }\r\n\r\n _updateViewCoordSys(seriesModel: TreeSeriesModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n const points: number[][] = [];\r\n data.each(function (idx) {\r\n const layout = data.getItemLayout(idx);\r\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\r\n points.push([+layout.x, +layout.y]);\r\n }\r\n });\r\n const min: number[] = [];\r\n const max: number[] = [];\r\n bbox.fromPoints(points, min, max);\r\n\r\n // If don't Store min max when collapse the root node after roam,\r\n // the root node will disappear.\r\n const oldMin = this._min;\r\n const oldMax = this._max;\r\n\r\n // If width or height is 0\r\n if (max[0] - min[0] === 0) {\r\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\r\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\r\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\r\n }\r\n\r\n const viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n\r\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\r\n\r\n viewCoordSys.setCenter(seriesModel.get('center'), api);\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n\r\n // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group\r\n this.group.attr({\r\n x: viewCoordSys.x,\r\n y: viewCoordSys.y,\r\n scaleX: viewCoordSys.scaleX,\r\n scaleY: viewCoordSys.scaleY\r\n });\r\n\r\n this._min = min;\r\n this._max = max;\r\n }\r\n\r\n _updateController(\r\n seriesModel: TreeSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const controller = this._controller;\r\n const controllerHost = this._controllerHost;\r\n const group = this.group;\r\n controller.setPointerChecker(function (e, x, y) {\r\n const rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', (e) => {\r\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', (e) => {\r\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'treeRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n this._updateNodeAndLinkScale(seriesModel);\r\n // Only update label layout on zoom\r\n api.updateLabelLayout();\r\n });\r\n }\r\n\r\n _updateNodeAndLinkScale(seriesModel: TreeSeriesModel) {\r\n const data = seriesModel.getData();\r\n\r\n const nodeScale = this._getNodeGlobalScale(seriesModel);\r\n\r\n data.eachItemGraphicEl(function (el: SymbolClz, idx) {\r\n el.setSymbolScale(nodeScale);\r\n });\r\n }\r\n\r\n _getNodeGlobalScale(seriesModel: TreeSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n\r\n const nodeScaleRatio = this._nodeScaleRatio;\r\n\r\n const groupZoom = coordSys.scaleX || 1;\r\n // Scale node when zoom changes\r\n const roamZoom = coordSys.getZoom();\r\n const nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n\r\n return nodeScale / groupZoom;\r\n }\r\n\r\n dispose() {\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n }\r\n\r\n remove() {\r\n this._mainGroup.removeAll();\r\n this._data = null;\r\n }\r\n\r\n}\r\n\r\nfunction symbolNeedsDraw(data: SeriesData, dataIndex: number) {\r\n const layout = data.getItemLayout(dataIndex);\r\n\r\n return layout\r\n && !isNaN(layout.x) && !isNaN(layout.y);\r\n}\r\n\r\n\r\nfunction updateNode(\r\n data: SeriesData,\r\n dataIndex: number,\r\n symbolEl: TreeSymbol,\r\n group: graphic.Group,\r\n seriesModel: TreeSeriesModel\r\n) {\r\n const isInit = !symbolEl;\r\n const node = data.tree.getNodeByDataIndex(dataIndex);\r\n const itemModel = node.getModel();\r\n const visualColor = (node.getVisual('style') as PathStyleProps).fill;\r\n const symbolInnerColor = node.isExpand === false && node.children.length !== 0\r\n ? visualColor : '#fff';\r\n\r\n const virtualRoot = data.tree.root;\r\n\r\n const source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n const sourceSymbolEl = data.getItemGraphicEl(source.dataIndex) as TreeSymbol;\r\n const sourceLayout = source.getLayout() as TreeNodeLayout;\r\n const sourceOldLayout = sourceSymbolEl\r\n ? {\r\n x: sourceSymbolEl.__oldX,\r\n y: sourceSymbolEl.__oldY,\r\n rawX: sourceSymbolEl.__radialOldRawX,\r\n rawY: sourceSymbolEl.__radialOldRawY\r\n }\r\n : sourceLayout;\r\n const targetLayout = node.getLayout();\r\n\r\n if (isInit) {\r\n symbolEl = new SymbolClz(data, dataIndex, null, {\r\n symbolInnerColor,\r\n useNameLabel: true\r\n }) as TreeSymbol;\r\n symbolEl.x = sourceOldLayout.x;\r\n symbolEl.y = sourceOldLayout.y;\r\n }\r\n else {\r\n symbolEl.updateData(data, dataIndex, null, {\r\n symbolInnerColor,\r\n useNameLabel: true\r\n });\r\n }\r\n\r\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\r\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\r\n symbolEl.__radialRawX = targetLayout.rawX;\r\n symbolEl.__radialRawY = targetLayout.rawY;\r\n\r\n group.add(symbolEl);\r\n data.setItemGraphicEl(dataIndex, symbolEl);\r\n\r\n symbolEl.__oldX = symbolEl.x;\r\n symbolEl.__oldY = symbolEl.y;\r\n\r\n graphic.updateProps(symbolEl, {\r\n x: targetLayout.x,\r\n y: targetLayout.y\r\n }, seriesModel);\r\n\r\n const symbolPath = symbolEl.getSymbolPath();\r\n\r\n if (seriesModel.get('layout') === 'radial') {\r\n const realRoot = virtualRoot.children[0];\r\n const rootLayout = realRoot.getLayout();\r\n const length = realRoot.children.length;\r\n let rad;\r\n let isLeft;\r\n\r\n if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) {\r\n const center = {\r\n x: (realRoot.children[0].getLayout().x + realRoot.children[length - 1].getLayout().x) / 2,\r\n y: (realRoot.children[0].getLayout().y + realRoot.children[length - 1].getLayout().y) / 2\r\n };\r\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n isLeft = center.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) {\r\n isLeft = targetLayout.x < rootLayout.x;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n else {\r\n isLeft = targetLayout.x > rootLayout.x;\r\n if (!isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n }\r\n }\r\n\r\n const textPosition = isLeft ? 'left' as const : 'right' as const;\r\n const normalLabelModel = itemModel.getModel('label');\r\n const rotate = normalLabelModel.get('rotate');\r\n const labelRotateRadian = rotate * (Math.PI / 180);\r\n\r\n const textContent = symbolPath.getTextContent();\r\n if (textContent) {\r\n symbolPath.setTextConfig({\r\n position: normalLabelModel.get('position') || textPosition,\r\n rotation: rotate == null ? -rad : labelRotateRadian,\r\n origin: 'center'\r\n });\r\n textContent.setStyle('verticalAlign', 'middle');\r\n }\r\n\r\n }\r\n\r\n // Handle status\r\n const focus = itemModel.get(['emphasis', 'focus']);\r\n const focusDataIndices: number[] = focus === 'relative'\r\n ? zrUtil.concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) as number[]\r\n : focus === 'ancestor'\r\n ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices() : null;\r\n\r\n if (focusDataIndices) {\r\n // Modify the focus to data indices.\r\n getECData(symbolEl).focus = focusDataIndices;\r\n }\r\n\r\n drawEdge(\r\n seriesModel, node, virtualRoot, symbolEl, sourceOldLayout,\r\n sourceLayout, targetLayout, group\r\n );\r\n\r\n if (symbolEl.__edge) {\r\n (symbolEl as ECElement).onHoverStateChange = function (toState) {\r\n if (toState !== 'blur') {\r\n // NOTE: Ensure the parent elements will been blurred firstly.\r\n // According to the return of getAncestorsIndices and getDescendantIndices\r\n // TODO: A bit tricky.\r\n const parentEl = node.parentNode\r\n && data.getItemGraphicEl(node.parentNode.dataIndex);\r\n if (!(parentEl && (parentEl as ECElement).hoverState === HOVER_STATE_BLUR)) {\r\n setStatesFlag(symbolEl.__edge, toState);\r\n }\r\n }\r\n };\r\n }\r\n}\r\n\r\nfunction drawEdge(\r\n seriesModel: TreeSeriesModel,\r\n node: TreeNode,\r\n virtualRoot: TreeNode,\r\n symbolEl: TreeSymbol,\r\n sourceOldLayout: TreeNodeLayout,\r\n sourceLayout: TreeNodeLayout,\r\n targetLayout: TreeNodeLayout,\r\n group: graphic.Group\r\n) {\r\n const itemModel = node.getModel();\r\n const edgeShape = seriesModel.get('edgeShape');\r\n const layout = seriesModel.get('layout');\r\n const orient = seriesModel.getOrient();\r\n const curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n const edgeForkPosition = seriesModel.get('edgeForkPosition');\r\n const lineStyle = itemModel.getModel('lineStyle').getLineStyle();\r\n let edge = symbolEl.__edge;\r\n // curve edge from node -> parent\r\n // polyline edge from node -> children\r\n if (edgeShape === 'curve') {\r\n if (node.parentNode && node.parentNode !== virtualRoot) {\r\n if (!edge) {\r\n edge = symbolEl.__edge = new graphic.BezierCurve({\r\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\r\n });\r\n }\r\n\r\n graphic.updateProps(edge as Path, {\r\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\r\n }, seriesModel);\r\n }\r\n }\r\n else if (edgeShape === 'polyline') {\r\n if (layout === 'orthogonal') {\r\n if (node !== virtualRoot && node.children && (node.children.length !== 0) && (node.isExpand === true)) {\r\n const children = node.children;\r\n const childPoints = [];\r\n for (let i = 0; i < children.length; i++) {\r\n const childLayout = children[i].getLayout();\r\n childPoints.push([childLayout.x, childLayout.y]);\r\n }\r\n\r\n if (!edge) {\r\n edge = symbolEl.__edge = new TreePath({\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: [[targetLayout.x, targetLayout.y]],\r\n orient: orient,\r\n forkPosition: edgeForkPosition\r\n }\r\n });\r\n }\r\n graphic.updateProps(edge as Path, {\r\n shape: {\r\n parentPoint: [targetLayout.x, targetLayout.y],\r\n childPoints: childPoints\r\n }\r\n }, seriesModel);\r\n }\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\r\n }\r\n }\r\n }\r\n\r\n // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'\r\n if (edge && !(edgeShape === 'polyline' && !node.isExpand)) {\r\n edge.useStyle(zrUtil.defaults({\r\n strokeNoScale: true, fill: null\r\n }, lineStyle));\r\n\r\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\r\n setDefaultStateProxy(edge);\r\n\r\n group.add(edge);\r\n }\r\n}\r\n\r\nfunction removeNodeEdge(\r\n node: TreeNode,\r\n data: SeriesData,\r\n group: graphic.Group,\r\n seriesModel: TreeSeriesModel,\r\n removeAnimationOpt: AnimationOption\r\n) {\r\n const virtualRoot = data.tree.root;\r\n const { source, sourceLayout } = getSourceNode(virtualRoot, node);\r\n\r\n const symbolEl: TreeSymbol = data.getItemGraphicEl(node.dataIndex) as TreeSymbol;\r\n\r\n if (!symbolEl) {\r\n return;\r\n }\r\n\r\n const sourceSymbolEl = data.getItemGraphicEl(source.dataIndex) as TreeSymbol;\r\n const sourceEdge = sourceSymbolEl.__edge;\r\n\r\n // 1. when expand the sub tree, delete the children node should delete the edge of\r\n // the source at the same time. because the polyline edge shape is only owned by the source.\r\n // 2.when the node is the only children of the source, delete the node should delete the edge of\r\n // the source at the same time. the same reason as above.\r\n const edge = symbolEl.__edge\r\n || ((source.isExpand === false || source.children.length === 1) ? sourceEdge : undefined);\r\n\r\n const edgeShape = seriesModel.get('edgeShape');\r\n const layoutOpt = seriesModel.get('layout');\r\n const orient = seriesModel.get('orient');\r\n const curvature = seriesModel.get(['lineStyle', 'curveness']);\r\n\r\n if (edge) {\r\n if (edgeShape === 'curve') {\r\n graphic.removeElement(edge as Path, {\r\n shape: getEdgeShape(\r\n layoutOpt,\r\n orient,\r\n curvature,\r\n sourceLayout,\r\n sourceLayout\r\n ),\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb() {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\r\n graphic.removeElement(edge as Path, {\r\n shape: {\r\n parentPoint: [sourceLayout.x, sourceLayout.y],\r\n childPoints: [[sourceLayout.x, sourceLayout.y]]\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }, seriesModel, {\r\n cb() {\r\n group.remove(edge);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n }\r\n }\r\n}\r\n\r\nfunction getSourceNode(virtualRoot: TreeNode, node: TreeNode): { source: TreeNode, sourceLayout: TreeNodeLayout } {\r\n let source = node.parentNode === virtualRoot ? node : node.parentNode || node;\r\n let sourceLayout;\r\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\r\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\r\n }\r\n return {\r\n source,\r\n sourceLayout\r\n };\r\n}\r\n\r\nfunction removeNode(\r\n data: SeriesData,\r\n dataIndex: number,\r\n symbolEl: TreeSymbol,\r\n group: graphic.Group,\r\n seriesModel: TreeSeriesModel\r\n) {\r\n const node = data.tree.getNodeByDataIndex(dataIndex);\r\n const virtualRoot = data.tree.root;\r\n\r\n const { sourceLayout } = getSourceNode(virtualRoot, node);\r\n\r\n // Use same duration and easing with update to have more consistent animation.\r\n const removeAnimationOpt = {\r\n duration: seriesModel.get('animationDurationUpdate') as number,\r\n easing: seriesModel.get('animationEasingUpdate')\r\n };\r\n\r\n graphic.removeElement(symbolEl, {\r\n x: sourceLayout.x + 1,\r\n y: sourceLayout.y + 1\r\n }, seriesModel, {\r\n cb() {\r\n group.remove(symbolEl);\r\n data.setItemGraphicEl(dataIndex, null);\r\n },\r\n removeOpt: removeAnimationOpt\r\n });\r\n\r\n symbolEl.fadeOut(null, data.hostModel as TreeSeriesModel, {\r\n fadeLabel: true,\r\n animation: removeAnimationOpt\r\n });\r\n\r\n // remove edge as parent node\r\n node.children.forEach(childNode => {\r\n removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt);\r\n });\r\n // remove edge as child node\r\n removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt);\r\n}\r\n\r\nfunction getEdgeShape(\r\n layoutOpt: TreeSeriesOption['layout'],\r\n orient: TreeSeriesOption['orient'],\r\n curvature: number,\r\n sourceLayout: TreeNodeLayout,\r\n targetLayout: TreeNodeLayout\r\n) {\r\n let cpx1: number;\r\n let cpy1: number;\r\n let cpx2: number;\r\n let cpy2: number;\r\n let x1: number;\r\n let x2: number;\r\n let y1: number;\r\n let y2: number;\r\n\r\n if (layoutOpt === 'radial') {\r\n x1 = sourceLayout.rawX;\r\n y1 = sourceLayout.rawY;\r\n x2 = targetLayout.rawX;\r\n y2 = targetLayout.rawY;\r\n\r\n const radialCoor1 = radialCoordinate(x1, y1);\r\n const radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\r\n const radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\r\n const radialCoor4 = radialCoordinate(x2, y2);\r\n\r\n return {\r\n x1: radialCoor1.x || 0,\r\n y1: radialCoor1.y || 0,\r\n x2: radialCoor4.x || 0,\r\n y2: radialCoor4.y || 0,\r\n cpx1: radialCoor2.x || 0,\r\n cpy1: radialCoor2.y || 0,\r\n cpx2: radialCoor3.x || 0,\r\n cpy2: radialCoor3.y || 0\r\n };\r\n }\r\n else {\r\n x1 = sourceLayout.x;\r\n y1 = sourceLayout.y;\r\n x2 = targetLayout.x;\r\n y2 = targetLayout.y;\r\n\r\n if (orient === 'LR' || orient === 'RL') {\r\n cpx1 = x1 + (x2 - x1) * curvature;\r\n cpy1 = y1;\r\n cpx2 = x2 + (x1 - x2) * curvature;\r\n cpy2 = y2;\r\n }\r\n if (orient === 'TB' || orient === 'BT') {\r\n cpx1 = x1;\r\n cpy1 = y1 + (y2 - y1) * curvature;\r\n cpx2 = x2;\r\n cpy2 = y2 + (y1 - y2) * curvature;\r\n }\r\n }\r\n\r\n return {\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n };\r\n}\r\n\r\nexport default TreeView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * Link lists and struct (graph or tree)\r\n */\r\n\r\nimport { curry, each, assert, extend, map, keys } from 'zrender/src/core/util';\r\nimport SeriesData from '../SeriesData';\r\nimport { makeInner } from '../../util/model';\r\nimport { SeriesDataType } from '../../util/types';\r\n\r\n// That is: { dataType: data },\r\n// like: { node: nodeList, edge: edgeList }.\r\n// Should contain mainData.\r\ntype Datas = { [key in SeriesDataType]?: SeriesData };\r\ntype StructReferDataAttr = 'data' | 'edgeData';\r\ntype StructAttr = 'tree' | 'graph';\r\n\r\nconst inner = makeInner<{\r\n datas: Datas;\r\n mainData: SeriesData;\r\n}, SeriesData>();\r\n\r\n\r\n// Caution:\r\n// In most case, either seriesData or its shallow clones (see seriesData.cloneShallow)\r\n// is active in echarts process. So considering heap memory consumption,\r\n// we do not clone tree or graph, but share them among seriesData and its shallow clones.\r\n// But in some rare case, we have to keep old seriesData (like do animation in chart). So\r\n// please take care that both the old seriesData and the new seriesData share the same tree/graph.\r\n\r\ntype LinkSeriesDataOpt = {\r\n mainData: SeriesData;\r\n // For example, instance of Graph or Tree.\r\n struct: {\r\n update: () => void;\r\n } & {\r\n [key in StructReferDataAttr]?: SeriesData\r\n };\r\n // Will designate: `mainData[structAttr] = struct;`\r\n structAttr: StructAttr;\r\n datas?: Datas;\r\n // { dataType: attr },\r\n // Will designate: `struct[datasAttr[dataType]] = list;`\r\n datasAttr?: { [key in SeriesDataType]?: StructReferDataAttr };\r\n};\r\n\r\nfunction linkSeriesData(opt: LinkSeriesDataOpt): void {\r\n const mainData = opt.mainData;\r\n let datas = opt.datas;\r\n\r\n if (!datas) {\r\n datas = { main: mainData };\r\n opt.datasAttr = { main: 'data' };\r\n }\r\n opt.datas = opt.mainData = null;\r\n\r\n linkAll(mainData, datas, opt);\r\n\r\n // Porxy data original methods.\r\n each(datas, function (data: SeriesData) {\r\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\r\n data.wrapMethod(methodName, curry(transferInjection, opt));\r\n });\r\n });\r\n\r\n // Beyond transfer, additional features should be added to `cloneShallow`.\r\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt));\r\n\r\n // Only mainData trigger change, because struct.update may trigger\r\n // another changable methods, which may bring about dead lock.\r\n each(mainData.CHANGABLE_METHODS, function (methodName) {\r\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\r\n });\r\n\r\n // Make sure datas contains mainData.\r\n assert(datas[mainData.dataType] === mainData);\r\n}\r\n\r\nfunction transferInjection(this: SeriesData, opt: LinkSeriesDataOpt, res: SeriesData): unknown {\r\n if (isMainData(this)) {\r\n // Transfer datas to new main data.\r\n const datas = extend({}, inner(this).datas);\r\n datas[this.dataType] = res;\r\n linkAll(res, datas, opt);\r\n }\r\n else {\r\n // Modify the reference in main data to point newData.\r\n linkSingle(res, this.dataType, inner(this).mainData, opt);\r\n }\r\n return res;\r\n}\r\n\r\nfunction changeInjection(opt: LinkSeriesDataOpt, res: unknown): unknown {\r\n opt.struct && opt.struct.update();\r\n return res;\r\n}\r\n\r\nfunction cloneShallowInjection(opt: LinkSeriesDataOpt, res: SeriesData): SeriesData {\r\n // cloneShallow, which brings about some fragilities, may be inappropriate\r\n // to be exposed as an API. So for implementation simplicity we can make\r\n // the restriction that cloneShallow of not-mainData should not be invoked\r\n // outside, but only be invoked here.\r\n each(inner(res).datas, function (data: SeriesData, dataType) {\r\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\r\n });\r\n return res;\r\n}\r\n\r\n/**\r\n * Supplement method to List.\r\n *\r\n * @public\r\n * @param [dataType] If not specified, return mainData.\r\n */\r\nfunction getLinkedData(this: SeriesData, dataType?: SeriesDataType): SeriesData {\r\n const mainData = inner(this).mainData;\r\n return (dataType == null || mainData == null)\r\n ? mainData\r\n : inner(mainData).datas[dataType];\r\n}\r\n\r\n/**\r\n * Get list of all linked data\r\n */\r\nfunction getLinkedDataAll(this: SeriesData): {\r\n data: SeriesData,\r\n type?: SeriesDataType\r\n}[] {\r\n const mainData = inner(this).mainData;\r\n return (mainData == null)\r\n ? [{ data: mainData }]\r\n : map(keys(inner(mainData).datas), function (type) {\r\n return {\r\n type,\r\n data: inner(mainData).datas[type]\r\n };\r\n });\r\n}\r\n\r\nfunction isMainData(data: SeriesData): boolean {\r\n return inner(data).mainData === data;\r\n}\r\n\r\nfunction linkAll(mainData: SeriesData, datas: Datas, opt: LinkSeriesDataOpt): void {\r\n inner(mainData).datas = {};\r\n each(datas, function (data: SeriesData, dataType) {\r\n linkSingle(data, dataType, mainData, opt);\r\n });\r\n}\r\n\r\nfunction linkSingle(data: SeriesData, dataType: SeriesDataType, mainData: SeriesData, opt: LinkSeriesDataOpt): void {\r\n inner(mainData).datas[dataType] = data;\r\n inner(data).mainData = mainData;\r\n\r\n data.dataType = dataType;\r\n\r\n if (opt.struct) {\r\n data[opt.structAttr] = opt.struct as any;\r\n opt.struct[opt.datasAttr[dataType]] = data;\r\n }\r\n\r\n // Supplement method.\r\n data.getLinkedData = getLinkedData;\r\n data.getLinkedDataAll = getLinkedDataAll;\r\n}\r\n\r\nexport default linkSeriesData;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Tree data structure\r\n */\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Model from '../model/Model';\r\nimport linkSeriesData from './helper/linkSeriesData';\r\nimport SeriesData from './SeriesData';\r\nimport prepareSeriesDataSchema from './helper/createDimensions';\r\nimport {\r\n DimensionLoose, ParsedValue, OptionDataValue,\r\n OptionDataItemObject\r\n} from '../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { convertOptionIdName } from '../util/model';\r\n\r\ntype TreeTraverseOrder = 'preorder' | 'postorder';\r\ntype TreeTraverseCallback = (this: Ctx, node: TreeNode) => boolean | void;\r\ntype TreeTraverseOption = {\r\n order?: TreeTraverseOrder\r\n attr?: 'children' | 'viewChildren'\r\n};\r\n\r\ninterface TreeNodeOption extends Pick, 'name' | 'value'> {\r\n children?: TreeNodeOption[];\r\n}\r\n\r\nexport class TreeNode {\r\n name: string;\r\n\r\n depth: number = 0;\r\n\r\n height: number = 0;\r\n\r\n parentNode: TreeNode;\r\n /**\r\n * Reference to list item.\r\n * Do not persistent dataIndex outside,\r\n * besause it may be changed by list.\r\n * If dataIndex -1,\r\n * this node is logical deleted (filtered) in list.\r\n */\r\n dataIndex: number = -1;\r\n\r\n children: TreeNode[] = [];\r\n\r\n viewChildren: TreeNode[] = [];\r\n\r\n isExpand: boolean = false;\r\n\r\n readonly hostTree: Tree;\r\n\r\n constructor(name: string, hostTree: Tree) {\r\n this.name = name || '';\r\n\r\n this.hostTree = hostTree;\r\n }\r\n /**\r\n * The node is removed.\r\n */\r\n isRemoved(): boolean {\r\n return this.dataIndex < 0;\r\n }\r\n\r\n /**\r\n * Travel this subtree (include this node).\r\n * Usage:\r\n * node.eachNode(function () { ... }); // preorder\r\n * node.eachNode('preorder', function () { ... }); // preorder\r\n * node.eachNode('postorder', function () { ... }); // postorder\r\n * node.eachNode(\r\n * {order: 'postorder', attr: 'viewChildren'},\r\n * function () { ... }\r\n * ); // postorder\r\n *\r\n * @param options If string, means order.\r\n * @param options.order 'preorder' or 'postorder'\r\n * @param options.attr 'children' or 'viewChildren'\r\n * @param cb If in preorder and return false,\r\n * its subtree will not be visited.\r\n */\r\n eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void;\r\n eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void;\r\n eachNode(cb: TreeTraverseCallback, context?: Ctx): void;\r\n eachNode(\r\n options: TreeTraverseOrder | TreeTraverseOption | TreeTraverseCallback,\r\n cb?: TreeTraverseCallback | Ctx,\r\n context?: Ctx\r\n ) {\r\n if (zrUtil.isFunction(options)) {\r\n context = cb as Ctx;\r\n cb = options;\r\n options = null;\r\n }\r\n\r\n options = options || {};\r\n if (zrUtil.isString(options)) {\r\n options = {order: options};\r\n }\r\n\r\n const order = (options as TreeTraverseOption).order || 'preorder';\r\n const children = this[(options as TreeTraverseOption).attr || 'children'];\r\n\r\n let suppressVisitSub;\r\n order === 'preorder' && (suppressVisitSub = (cb as TreeTraverseCallback).call(context as Ctx, this));\r\n\r\n for (let i = 0; !suppressVisitSub && i < children.length; i++) {\r\n children[i].eachNode(\r\n options as TreeTraverseOption,\r\n cb as TreeTraverseCallback,\r\n context\r\n );\r\n }\r\n\r\n order === 'postorder' && (cb as TreeTraverseCallback).call(context, this);\r\n }\r\n\r\n /**\r\n * Update depth and height of this subtree.\r\n */\r\n updateDepthAndHeight(depth: number) {\r\n let height = 0;\r\n this.depth = depth;\r\n for (let i = 0; i < this.children.length; i++) {\r\n const child = this.children[i];\r\n child.updateDepthAndHeight(depth + 1);\r\n if (child.height > height) {\r\n height = child.height;\r\n }\r\n }\r\n this.height = height + 1;\r\n }\r\n\r\n getNodeById(id: string): TreeNode {\r\n if (this.getId() === id) {\r\n return this;\r\n }\r\n for (let i = 0, children = this.children, len = children.length; i < len; i++) {\r\n const res = children[i].getNodeById(id);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n\r\n contains(node: TreeNode): boolean {\r\n if (node === this) {\r\n return true;\r\n }\r\n for (let i = 0, children = this.children, len = children.length; i < len; i++) {\r\n const res = children[i].contains(node);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @param includeSelf Default false.\r\n * @return order: [root, child, grandchild, ...]\r\n */\r\n getAncestors(includeSelf?: boolean): TreeNode[] {\r\n const ancestors = [];\r\n let node = includeSelf ? this : this.parentNode;\r\n while (node) {\r\n ancestors.push(node);\r\n node = node.parentNode;\r\n }\r\n ancestors.reverse();\r\n return ancestors;\r\n }\r\n\r\n getAncestorsIndices(): number[] {\r\n const indices: number[] = [];\r\n let currNode = this as TreeNode;\r\n while (currNode) {\r\n indices.push(currNode.dataIndex);\r\n currNode = currNode.parentNode;\r\n }\r\n indices.reverse();\r\n return indices;\r\n }\r\n\r\n getDescendantIndices(): number[] {\r\n const indices: number[] = [];\r\n this.eachNode(childNode => {\r\n indices.push(childNode.dataIndex);\r\n });\r\n return indices;\r\n }\r\n\r\n getValue(dimension?: DimensionLoose): ParsedValue {\r\n const data = this.hostTree.data;\r\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\r\n }\r\n\r\n setLayout(layout: any, merge?: boolean) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\r\n }\r\n\r\n /**\r\n * @return {Object} layout\r\n */\r\n getLayout(): any {\r\n return this.hostTree.data.getItemLayout(this.dataIndex);\r\n }\r\n\r\n getModel(): Model;\r\n // @depcrecated\r\n // getModel(path: S): Model\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n getModel(path?: string): Model {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n const hostTree = this.hostTree;\r\n const itemModel = hostTree.data.getItemModel(this.dataIndex);\r\n return itemModel.getModel(path as any);\r\n }\r\n\r\n // TODO: TYPE More specific model\r\n getLevelModel(): Model {\r\n return (this.hostTree.levelModels || [])[this.depth];\r\n }\r\n\r\n /**\r\n * @example\r\n * setItemVisual('color', color);\r\n * setItemVisual({\r\n * 'color': color\r\n * });\r\n */\r\n // TODO: TYPE\r\n setVisual(key: string, value: any): void;\r\n setVisual(obj: Dictionary): void;\r\n setVisual(key: string | Dictionary, value?: any) {\r\n this.dataIndex >= 0\r\n && this.hostTree.data.setItemVisual(this.dataIndex, key as any, value);\r\n }\r\n\r\n /**\r\n * Get item visual\r\n * FIXME: make return type better\r\n */\r\n getVisual(key: string): unknown {\r\n return this.hostTree.data.getItemVisual(this.dataIndex, key as any);\r\n }\r\n\r\n getRawIndex(): number {\r\n return this.hostTree.data.getRawIndex(this.dataIndex);\r\n }\r\n\r\n getId(): string {\r\n return this.hostTree.data.getId(this.dataIndex);\r\n }\r\n\r\n /**\r\n * index in parent's children\r\n */\r\n getChildIndex(): number {\r\n if (this.parentNode) {\r\n const children = this.parentNode.children;\r\n for (let i = 0; i < children.length; ++i) {\r\n if (children[i] === this) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n }\r\n return -1;\r\n }\r\n\r\n /**\r\n * if this is an ancestor of another node\r\n *\r\n * @param node another node\r\n * @return if is ancestor\r\n */\r\n isAncestorOf(node: TreeNode): boolean {\r\n let parent = node.parentNode;\r\n while (parent) {\r\n if (parent === this) {\r\n return true;\r\n }\r\n parent = parent.parentNode;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * if this is an descendant of another node\r\n *\r\n * @param node another node\r\n * @return if is descendant\r\n */\r\n isDescendantOf(node: TreeNode): boolean {\r\n return node !== this && node.isAncestorOf(this);\r\n }\r\n};\r\n\r\nclass Tree {\r\n\r\n type: 'tree' = 'tree';\r\n\r\n root: TreeNode;\r\n\r\n data: SeriesData;\r\n\r\n hostModel: HostModel;\r\n\r\n levelModels: Model[];\r\n\r\n private _nodes: TreeNode[] = [];\r\n\r\n constructor(hostModel: HostModel) {\r\n\r\n this.hostModel = hostModel;\r\n }\r\n /**\r\n * Travel this subtree (include this node).\r\n * Usage:\r\n * node.eachNode(function () { ... }); // preorder\r\n * node.eachNode('preorder', function () { ... }); // preorder\r\n * node.eachNode('postorder', function () { ... }); // postorder\r\n * node.eachNode(\r\n * {order: 'postorder', attr: 'viewChildren'},\r\n * function () { ... }\r\n * ); // postorder\r\n *\r\n * @param options If string, means order.\r\n * @param options.order 'preorder' or 'postorder'\r\n * @param options.attr 'children' or 'viewChildren'\r\n * @param cb\r\n * @param context\r\n */\r\n eachNode(options: TreeTraverseOrder, cb: TreeTraverseCallback, context?: Ctx): void;\r\n eachNode(options: TreeTraverseOption, cb: TreeTraverseCallback, context?: Ctx): void;\r\n eachNode(cb: TreeTraverseCallback, context?: Ctx): void;\r\n eachNode(\r\n options: TreeTraverseOrder | TreeTraverseOption | TreeTraverseCallback,\r\n cb?: TreeTraverseCallback | Ctx,\r\n context?: Ctx\r\n ) {\r\n this.root.eachNode(options as TreeTraverseOption, cb as TreeTraverseCallback, context);\r\n }\r\n\r\n getNodeByDataIndex(dataIndex: number): TreeNode {\r\n const rawIndex = this.data.getRawIndex(dataIndex);\r\n return this._nodes[rawIndex];\r\n }\r\n\r\n getNodeById(name: string): TreeNode {\r\n return this.root.getNodeById(name);\r\n }\r\n\r\n /**\r\n * Update item available by list,\r\n * when list has been performed options like 'filterSelf' or 'map'.\r\n */\r\n update() {\r\n const data = this.data;\r\n const nodes = this._nodes;\r\n\r\n for (let i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n\r\n for (let i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n }\r\n\r\n /**\r\n * Clear all layouts\r\n */\r\n clearLayouts() {\r\n this.data.clearItemLayouts();\r\n }\r\n\r\n\r\n /**\r\n * data node format:\r\n * {\r\n * name: ...\r\n * value: ...\r\n * children: [\r\n * {\r\n * name: ...\r\n * value: ...\r\n * children: ...\r\n * },\r\n * ...\r\n * ]\r\n * }\r\n */\r\n static createTree(\r\n dataRoot: T,\r\n hostModel: HostModel,\r\n beforeLink?: (data: SeriesData) => void\r\n ) {\r\n\r\n const tree = new Tree(hostModel);\r\n const listData: TreeNodeOption[] = [];\r\n let dimMax = 1;\r\n\r\n buildHierarchy(dataRoot);\r\n\r\n function buildHierarchy(dataNode: TreeNodeOption, parentNode?: TreeNode) {\r\n const value = dataNode.value;\r\n dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1);\r\n\r\n listData.push(dataNode);\r\n\r\n const node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\r\n parentNode\r\n ? addChild(node, parentNode)\r\n : (tree.root = node);\r\n\r\n tree._nodes.push(node);\r\n\r\n const children = dataNode.children;\r\n if (children) {\r\n for (let i = 0; i < children.length; i++) {\r\n buildHierarchy(children[i], node);\r\n }\r\n }\r\n }\r\n\r\n tree.root.updateDepthAndHeight(0);\r\n\r\n const { dimensions } = prepareSeriesDataSchema(listData, {\r\n coordDimensions: ['value'],\r\n dimensionsCount: dimMax\r\n });\r\n\r\n const list = new SeriesData(dimensions, hostModel);\r\n list.initData(listData);\r\n\r\n beforeLink && beforeLink(list);\r\n\r\n linkSeriesData({\r\n mainData: list,\r\n struct: tree,\r\n structAttr: 'tree'\r\n });\r\n\r\n tree.update();\r\n\r\n return tree;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,\r\n * so this function is not ready and not necessary to be public.\r\n */\r\nfunction addChild(child: TreeNode, node: TreeNode) {\r\n const children = node.children;\r\n if (child.parentNode === node) {\r\n return;\r\n }\r\n\r\n children.push(child);\r\n child.parentNode = node;\r\n}\r\n\r\nexport default Tree;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SeriesModel from '../../model/Series';\r\nimport {TreeNode} from '../../data/Tree';\r\n\r\nexport function retrieveTargetInfo(\r\n payload: {\r\n type?: string,\r\n targetNode?: string | TreeNode\r\n targetNodeId?: string\r\n },\r\n validPayloadTypes: string[],\r\n seriesModel: SeriesModel\r\n) {\r\n if (payload && zrUtil.indexOf(validPayloadTypes, payload.type) >= 0) {\r\n const root = seriesModel.getData().tree.root;\r\n let targetNode = payload.targetNode;\r\n\r\n if (zrUtil.isString(targetNode)) {\r\n targetNode = root.getNodeById(targetNode);\r\n }\r\n\r\n if (targetNode && root.contains(targetNode)) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n\r\n const targetNodeId = payload.targetNodeId;\r\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\r\n return {\r\n node: targetNode\r\n };\r\n }\r\n }\r\n}\r\n\r\n// Not includes the given node at the last item.\r\nexport function getPathToRoot(node: TreeNode): TreeNode[] {\r\n const path = [];\r\n while (node) {\r\n node = node.parentNode;\r\n node && path.push(node);\r\n }\r\n return path.reverse();\r\n}\r\n\r\nexport function aboveViewRoot(viewRoot: TreeNode, node: TreeNode) {\r\n const viewPath = getPathToRoot(viewRoot);\r\n return zrUtil.indexOf(viewPath, node) >= 0;\r\n}\r\n\r\n\r\n// From root to the input node (the input node will be included).\r\nexport function wrapTreePathInfo(node: TreeNode, seriesModel: SeriesModel) {\r\n const treePathInfo = [];\r\n\r\n while (node) {\r\n const nodeDataIndex = node.dataIndex;\r\n treePathInfo.push({\r\n name: node.name,\r\n dataIndex: nodeDataIndex,\r\n value: seriesModel.getRawValue(nodeDataIndex) as T\r\n });\r\n node = node.parentNode;\r\n }\r\n\r\n treePathInfo.reverse();\r\n\r\n return treePathInfo;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport Tree from '../../data/Tree';\r\nimport {\r\n SeriesOption,\r\n SymbolOptionMixin,\r\n BoxLayoutOptionMixin,\r\n RoamOptionMixin,\r\n LineStyleOption,\r\n ItemStyleOption,\r\n SeriesLabelOption,\r\n OptionDataValue,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n CallbackDataParams,\r\n DefaultEmphasisFocus\r\n} from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport View from '../../coord/View';\r\nimport { LayoutRect } from '../../util/layout';\r\nimport Model from '../../model/Model';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\r\nimport { wrapTreePathInfo } from '../helper/treeHelper';\r\n\r\ninterface CurveLineStyleOption extends LineStyleOption{\r\n curveness?: number\r\n}\r\n\r\nexport interface TreeSeriesStateOption {\r\n itemStyle?: ItemStyleOption\r\n /**\r\n * Line style of the edge between node and it's parent.\r\n */\r\n lineStyle?: CurveLineStyleOption\r\n label?: SeriesLabelOption\r\n}\r\n\r\ninterface TreeStatesMixin {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus | 'ancestor' | 'descendant' | 'relative'\r\n scale?: boolean\r\n }\r\n}\r\n\r\nexport interface TreeSeriesNodeItemOption extends SymbolOptionMixin,\r\n TreeSeriesStateOption,\r\n StatesOptionMixin, TreeStatesMixin>,\r\n OptionDataItemObject {\r\n\r\n children?: TreeSeriesNodeItemOption[]\r\n\r\n collapsed?: boolean\r\n\r\n link?: string\r\n target?: string\r\n}\r\n\r\n/**\r\n * Configuration of leaves nodes.\r\n */\r\nexport interface TreeSeriesLeavesOption\r\n extends TreeSeriesStateOption, StatesOptionMixin {\r\n}\r\n\r\nexport interface TreeSeriesOption extends\r\n SeriesOption, TreeSeriesStateOption,\r\n SymbolOptionMixin, BoxLayoutOptionMixin, RoamOptionMixin {\r\n type?: 'tree'\r\n\r\n layout?: 'orthogonal' | 'radial'\r\n\r\n edgeShape?: 'polyline' | 'curve'\r\n\r\n /**\r\n * Available when edgeShape is polyline\r\n */\r\n edgeForkPosition?: string | number\r\n\r\n nodeScaleRatio?: number\r\n\r\n /**\r\n * The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'.\r\n * and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'.\r\n */\r\n orient?: 'LR' | 'TB' | 'RL' | 'BT' | 'horizontal' | 'vertical'\r\n\r\n expandAndCollapse?: boolean\r\n\r\n /**\r\n * The initial expanded depth of tree\r\n */\r\n initialTreeDepth?: number\r\n\r\n leaves?: TreeSeriesLeavesOption\r\n\r\n data?: TreeSeriesNodeItemOption[]\r\n}\r\n\r\nexport interface TreeAncestors {\r\n name: string\r\n dataIndex: number\r\n value: number\r\n}\r\n\r\nexport interface TreeSeriesCallbackDataParams extends CallbackDataParams {\r\n collapsed: boolean;\r\n treeAncestors?: TreeAncestors[]\r\n}\r\n\r\nclass TreeSeriesModel extends SeriesModel {\r\n static readonly type = 'series.tree';\r\n\r\n // can support the position parameters 'left', 'top','right','bottom', 'width',\r\n // 'height' in the setOption() with 'merge' mode normal.\r\n static readonly layoutMode = 'box';\r\n\r\n coordinateSystem: View;\r\n\r\n layoutInfo: LayoutRect;\r\n\r\n hasSymbolVisual = true;\r\n\r\n // Do it self.\r\n ignoreStyleOnData = true;\r\n\r\n /**\r\n * Init a tree data structure from data in option series\r\n */\r\n getInitialData(option: TreeSeriesOption): SeriesData {\r\n\r\n // create a virtual root\r\n const root: TreeSeriesNodeItemOption = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n\r\n const leaves = option.leaves || {};\r\n const leavesModel = new Model(leaves, this, this.ecModel);\r\n\r\n const tree = Tree.createTree(root, this, beforeLink);\r\n\r\n function beforeLink(nodeData: SeriesData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n const node = tree.getNodeByDataIndex(idx);\r\n if (!(node && node.children.length && node.isExpand)) {\r\n model.parentModel = leavesModel;\r\n }\r\n return model;\r\n });\r\n }\r\n\r\n let treeDepth = 0;\r\n\r\n tree.eachNode('preorder', function (node) {\r\n if (node.depth > treeDepth) {\r\n treeDepth = node.depth;\r\n }\r\n });\r\n\r\n const expandAndCollapse = option.expandAndCollapse;\r\n const expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0)\r\n ? option.initialTreeDepth : treeDepth;\r\n\r\n tree.root.eachNode('preorder', function (node) {\r\n const item = node.hostTree.data.getRawDataItem(node.dataIndex) as TreeSeriesNodeItemOption;\r\n // Add item.collapsed != null, because users can collapse node original in the series.data.\r\n node.isExpand = (item && item.collapsed != null)\r\n ? !item.collapsed\r\n : node.depth <= expandTreeDepth;\r\n });\r\n\r\n return tree.data;\r\n }\r\n\r\n /**\r\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\r\n * @returns {string} orient\r\n */\r\n getOrient() {\r\n let orient = this.get('orient');\r\n if (orient === 'horizontal') {\r\n orient = 'LR';\r\n }\r\n else if (orient === 'vertical') {\r\n orient = 'TB';\r\n }\r\n return orient;\r\n }\r\n\r\n setZoom(zoom: number) {\r\n this.option.zoom = zoom;\r\n }\r\n\r\n setCenter(center: number[]) {\r\n this.option.center = center;\r\n }\r\n\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: string\r\n ) {\r\n const tree = this.getData().tree;\r\n const realRoot = tree.root.children[0];\r\n let node = tree.getNodeByDataIndex(dataIndex);\r\n const value = node.getValue();\r\n let name = node.name;\r\n while (node && (node !== realRoot)) {\r\n name = node.parentNode.name + '.' + name;\r\n node = node.parentNode;\r\n }\r\n\r\n return createTooltipMarkup('nameValue', {\r\n name: name,\r\n value: value,\r\n noValue: isNaN(value as number) || value == null\r\n });\r\n }\r\n\r\n // Add tree path to tooltip param\r\n getDataParams(dataIndex: number) {\r\n const params = super.getDataParams.apply(this, arguments as any) as TreeSeriesCallbackDataParams;\r\n\r\n const node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treeAncestors = wrapTreePathInfo(node, this);\r\n params.collapsed = !node.isExpand;\r\n\r\n return params;\r\n }\r\n\r\n static defaultOption: TreeSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'view',\r\n\r\n // the position of the whole view\r\n left: '12%',\r\n top: '12%',\r\n right: '12%',\r\n bottom: '12%',\r\n\r\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\r\n layout: 'orthogonal',\r\n\r\n // value can be 'polyline'\r\n edgeShape: 'curve',\r\n\r\n edgeForkPosition: '50%',\r\n\r\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\r\n roam: false,\r\n\r\n // Symbol size scale ratio in roam\r\n nodeScaleRatio: 0.4,\r\n\r\n // Default on center of graph\r\n center: null,\r\n\r\n zoom: 1,\r\n\r\n orient: 'LR',\r\n\r\n symbol: 'emptyCircle',\r\n\r\n symbolSize: 7,\r\n\r\n expandAndCollapse: true,\r\n\r\n initialTreeDepth: 2,\r\n\r\n lineStyle: {\r\n color: '#ccc',\r\n width: 1.5,\r\n curveness: 0.5\r\n },\r\n\r\n itemStyle: {\r\n color: 'lightsteelblue',\r\n // borderColor: '#c23531',\r\n borderWidth: 1.5\r\n },\r\n\r\n label: {\r\n show: true\r\n },\r\n\r\n animationEasing: 'linear',\r\n\r\n animationDuration: 700,\r\n\r\n animationDurationUpdate: 500\r\n };\r\n}\r\n\r\nexport default TreeSeriesModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { TreeNode } from '../../data/Tree';\r\n\r\n/**\r\n * Traverse the tree from bottom to top and do something\r\n */\r\nfunction eachAfter(\r\n root: TreeNode,\r\n callback: (node: TreeNode, separation: T) => void,\r\n separation: T\r\n) {\r\n const nodes = [root];\r\n const next = [];\r\n let node;\r\n\r\n while (node = nodes.pop()) { // jshint ignore:line\r\n next.push(node);\r\n if (node.isExpand) {\r\n const children = node.children;\r\n if (children.length) {\r\n for (let i = 0; i < children.length; i++) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n while (node = next.pop()) { // jshint ignore:line\r\n callback(node, separation);\r\n }\r\n}\r\n\r\n/**\r\n * Traverse the tree from top to bottom and do something\r\n */\r\nfunction eachBefore(root: TreeNode, callback: (node: TreeNode) => void) {\r\n const nodes = [root];\r\n let node;\r\n while (node = nodes.pop()) { // jshint ignore:line\r\n callback(node);\r\n if (node.isExpand) {\r\n const children = node.children;\r\n if (children.length) {\r\n for (let i = children.length - 1; i >= 0; i--) {\r\n nodes.push(children[i]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport { eachAfter, eachBefore };", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n eachAfter,\r\n eachBefore\r\n} from './traversalHelper';\r\nimport {\r\n init,\r\n firstWalk,\r\n secondWalk,\r\n separation as sep,\r\n radialCoordinate,\r\n getViewRect,\r\n TreeLayoutNode\r\n} from './layoutHelper';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport TreeSeriesModel from './TreeSeries';\r\n\r\nexport default function treeLayout(ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachSeriesByType('tree', function (seriesModel: TreeSeriesModel) {\r\n commonLayout(seriesModel, api);\r\n });\r\n}\r\n\r\nfunction commonLayout(seriesModel: TreeSeriesModel, api: ExtensionAPI) {\r\n const layoutInfo = getViewRect(seriesModel, api);\r\n seriesModel.layoutInfo = layoutInfo;\r\n const layout = seriesModel.get('layout');\r\n let width = 0;\r\n let height = 0;\r\n let separation = null;\r\n\r\n if (layout === 'radial') {\r\n width = 2 * Math.PI;\r\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\r\n separation = sep(function (node1, node2) {\r\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\r\n });\r\n }\r\n else {\r\n width = layoutInfo.width;\r\n height = layoutInfo.height;\r\n separation = sep();\r\n }\r\n\r\n const virtualRoot = seriesModel.getData().tree.root as TreeLayoutNode;\r\n const realRoot = virtualRoot.children[0];\r\n\r\n if (realRoot) {\r\n init(virtualRoot);\r\n eachAfter(realRoot, firstWalk, separation);\r\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\r\n eachBefore(realRoot, secondWalk);\r\n\r\n let left = realRoot;\r\n let right = realRoot;\r\n let bottom = realRoot;\r\n eachBefore(realRoot, function (node: TreeLayoutNode) {\r\n const x = node.getLayout().x;\r\n if (x < left.getLayout().x) {\r\n left = node;\r\n }\r\n if (x > right.getLayout().x) {\r\n right = node;\r\n }\r\n if (node.depth > bottom.depth) {\r\n bottom = node;\r\n }\r\n });\r\n\r\n const delta = left === right ? 1 : separation(left, right) / 2;\r\n const tx = delta - left.getLayout().x;\r\n let kx = 0;\r\n let ky = 0;\r\n let coorX = 0;\r\n let coorY = 0;\r\n if (layout === 'radial') {\r\n kx = width / (right.getLayout().x + delta + tx);\r\n // here we use (node.depth - 1), bucause the real root's depth is 1\r\n ky = height / ((bottom.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX = (node.getLayout().x + tx) * kx;\r\n coorY = (node.depth - 1) * ky;\r\n const finalCoor = radialCoordinate(coorX, coorY);\r\n node.setLayout({x: finalCoor.x, y: finalCoor.y, rawX: coorX, rawY: coorY}, true);\r\n });\r\n }\r\n else {\r\n const orient = seriesModel.getOrient();\r\n if (orient === 'RL' || orient === 'LR') {\r\n ky = height / (right.getLayout().x + delta + tx);\r\n kx = width / ((bottom.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorY = (node.getLayout().x + tx) * ky;\r\n coorX = orient === 'LR'\r\n ? (node.depth - 1) * kx\r\n : width - (node.depth - 1) * kx;\r\n node.setLayout({x: coorX, y: coorY}, true);\r\n });\r\n }\r\n else if (orient === 'TB' || orient === 'BT') {\r\n kx = width / (right.getLayout().x + delta + tx);\r\n ky = height / ((bottom.depth - 1) || 1);\r\n eachBefore(realRoot, function (node) {\r\n coorX = (node.getLayout().x + tx) * kx;\r\n coorY = orient === 'TB'\r\n ? (node.depth - 1) * ky\r\n : height - (node.depth - 1) * ky;\r\n node.setLayout({x: coorX, y: coorY}, true);\r\n });\r\n }\r\n }\r\n }\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../../model/Global';\r\nimport TreeSeriesModel, { TreeSeriesNodeItemOption } from './TreeSeries';\r\nimport { extend } from 'zrender/src/core/util';\r\n\r\nexport default function treeVisual(ecModel: GlobalModel) {\r\n\r\n ecModel.eachSeriesByType('tree', function (seriesModel: TreeSeriesModel) {\r\n const data = seriesModel.getData();\r\n const tree = data.tree;\r\n tree.eachNode(function (node) {\r\n const model = node.getModel();\r\n // TODO Optimize\r\n const style = model.getModel('itemStyle').getItemStyle();\r\n const existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {updateCenterAndZoom, RoamPayload} from '../../action/roamHelper';\r\nimport { Payload } from '../../util/types';\r\nimport TreeSeriesModel from './TreeSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport type ExtensionAPI from '../../core/ExtensionAPI';\r\n\r\nexport interface TreeExpandAndCollapsePayload extends Payload {\r\n dataIndex: number\r\n}\r\n\r\nexport function installTreeAction(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerAction({\r\n type: 'treeExpandAndCollapse',\r\n event: 'treeExpandAndCollapse',\r\n update: 'update'\r\n }, function (payload: TreeExpandAndCollapsePayload, ecModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel: TreeSeriesModel) {\r\n const dataIndex = payload.dataIndex;\r\n const tree = seriesModel.getData().tree;\r\n const node = tree.getNodeByDataIndex(dataIndex);\r\n node.isExpand = !node.isExpand;\r\n });\r\n });\r\n\r\n registers.registerAction({\r\n type: 'treeRoam',\r\n event: 'treeRoam',\r\n // Here we set 'none' instead of 'update', because roam action\r\n // just need to update the transform matrix without having to recalculate\r\n // the layout. So don't need to go through the whole update process, such\r\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\r\n update: 'none'\r\n }, function (payload: RoamPayload, ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachComponent({\r\n mainType: 'series', subType: 'tree', query: payload\r\n }, function (seriesModel: TreeSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const res = updateCenterAndZoom(coordSys, payload, undefined, api);\r\n\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n });\r\n\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport TreeView from './TreeView';\r\nimport TreeSeriesModel from './TreeSeries';\r\nimport treeLayout from './treeLayout';\r\nimport treeVisual from './treeVisual';\r\nimport {installTreeAction} from './treeAction';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(TreeView);\r\n registers.registerSeriesModel(TreeSeriesModel);\r\n registers.registerLayout(treeLayout);\r\n registers.registerVisual(treeVisual);\r\n\r\n installTreeAction(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as helper from '../helper/treeHelper';\r\nimport { Payload } from '../../util/types';\r\nimport TreemapSeriesModel from './TreemapSeries';\r\nimport { TreeNode } from '../../data/Tree';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport { noop } from 'zrender/src/core/util';\r\n\r\nconst actionTypes = [\r\n 'treemapZoomToNode',\r\n 'treemapRender',\r\n 'treemapMove'\r\n];\r\n\r\nexport interface TreemapZoomToNodePayload extends Payload {\r\n type: 'treemapZoomToNode'\r\n}\r\nexport interface TreemapRenderPayload extends Payload {\r\n type: 'treemapRender',\r\n rootRect?: RectLike\r\n}\r\nexport interface TreemapMovePayload extends Payload {\r\n type: 'treemapMove',\r\n rootRect?: RectLike\r\n}\r\nexport interface TreemapRootToNodePayload extends Payload {\r\n type: 'treemapRootToNode'\r\n targetNode?: TreeNode | string\r\n targetNodeId?: string\r\n\r\n direction?: 'rollUp' | 'drillDown'\r\n}\r\n\r\nexport function installTreemapAction(registers: EChartsExtensionInstallRegisters) {\r\n for (let i = 0; i < actionTypes.length; i++) {\r\n registers.registerAction({\r\n type: actionTypes[i],\r\n update: 'updateView'\r\n }, noop);\r\n }\r\n\r\n registers.registerAction(\r\n {type: 'treemapRootToNode', update: 'updateView'},\r\n function (payload, ecModel) {\r\n\r\n ecModel.eachComponent(\r\n {mainType: 'series', subType: 'treemap', query: payload},\r\n handleRootToNode\r\n );\r\n\r\n function handleRootToNode(model: TreemapSeriesModel, index: number) {\r\n const types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n const targetInfo = helper.retrieveTargetInfo(payload, types, model);\r\n\r\n if (targetInfo) {\r\n const originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n }\r\n );\r\n\r\n}\r\n", "\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport {Dictionary, DecalObject} from '../../util/types';\r\nimport { getDecalFromPalette } from '../../model/mixin/palette';\r\n\r\nexport default function enableAriaDecalForTree(seriesModel: SeriesModel) {\r\n const data = seriesModel.getData();\r\n const tree = data.tree;\r\n const decalPaletteScope: Dictionary = {};\r\n\r\n tree.eachNode(node => {\r\n // Use decal of level 1 node\r\n let current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n\r\n const decal = getDecalFromPalette(\r\n seriesModel.ecModel,\r\n current.name || current.dataIndex + '',\r\n decalPaletteScope\r\n );\r\n node.setVisual('decal', decal);\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SeriesModel from '../../model/Series';\r\nimport Tree, { TreeNode } from '../../data/Tree';\r\nimport Model from '../../model/Model';\r\nimport {wrapTreePathInfo} from '../helper/treeHelper';\r\nimport {\r\n SeriesOption,\r\n BoxLayoutOptionMixin,\r\n ItemStyleOption,\r\n LabelOption,\r\n RoamOptionMixin,\r\n CallbackDataParams,\r\n ColorString,\r\n StatesOptionMixin,\r\n OptionId,\r\n OptionName,\r\n DecalObject,\r\n SeriesLabelOption,\r\n DefaultEmphasisFocus,\r\n AriaOptionMixin,\r\n BlurScope\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport { LayoutRect } from '../../util/layout';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { normalizeToArray } from '../../util/model';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\r\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree';\r\n\r\n// Only support numeric value.\r\ntype TreemapSeriesDataValue = number | number[];\r\n\r\ninterface BreadcrumbItemStyleOption extends ItemStyleOption {\r\n // TODO: textStyle should be in breadcrumb.label\r\n textStyle?: LabelOption\r\n}\r\n\r\ninterface TreemapSeriesLabelOption extends SeriesLabelOption {\r\n formatter?: string | ((params: CallbackDataParams) => string)\r\n}\r\n\r\ninterface TreemapSeriesItemStyleOption extends ItemStyleOption {\r\n borderRadius?: number | number[]\r\n\r\n colorAlpha?: number\r\n colorSaturation?: number\r\n\r\n borderColorSaturation?: number\r\n\r\n gapWidth?: number\r\n}\r\n\r\ninterface TreePathInfo {\r\n name: string\r\n dataIndex: number\r\n value: TreemapSeriesDataValue\r\n}\r\n\r\ninterface TreemapSeriesCallbackDataParams extends CallbackDataParams {\r\n /**\r\n * @deprecated\r\n */\r\n treePathInfo?: TreePathInfo[]\r\n\r\n treeAncestors?: TreePathInfo[]\r\n}\r\n\r\ninterface ExtraStateOption {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor'\r\n }\r\n}\r\n\r\nexport interface TreemapStateOption {\r\n itemStyle?: TreemapSeriesItemStyleOption\r\n label?: TreemapSeriesLabelOption\r\n upperLabel?: TreemapSeriesLabelOption\r\n}\r\n\r\nexport interface TreemapSeriesVisualOption {\r\n /**\r\n * Which dimension will be applied with the visual properties.\r\n */\r\n visualDimension?: number | string\r\n\r\n /**\r\n * @deprecated Use colorBy instead\r\n */\r\n colorMappingBy?: 'value' | 'index' | 'id'\r\n\r\n visualMin?: number\r\n visualMax?: number\r\n\r\n colorAlpha?: number[] | 'none'\r\n colorSaturation?: number[] | 'none'\r\n // A color list for a level. Each node in the level will obtain a color from the color list.\r\n // Only support ColorString for interpolation.\r\n // color?: ColorString[]\r\n\r\n /**\r\n * A node will not be shown when its area size is smaller than this value (unit: px square).\r\n */\r\n visibleMin?: number\r\n /**\r\n * Children will not be shown when area size of a node is smaller than this value (unit: px square).\r\n */\r\n childrenVisibleMin?: number\r\n}\r\n\r\nexport interface TreemapSeriesLevelOption extends TreemapSeriesVisualOption,\r\n TreemapStateOption, StatesOptionMixin {\r\n\r\n color?: ColorString[] | 'none',\r\n decal?: DecalObject[] | 'none'\r\n}\r\n\r\nexport interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption,\r\n TreemapStateOption, StatesOptionMixin {\r\n id?: OptionId\r\n name?: OptionName\r\n\r\n value?: TreemapSeriesDataValue\r\n\r\n children?: TreemapSeriesNodeItemOption[]\r\n\r\n color?: ColorString[] | 'none'\r\n\r\n decal?: DecalObject[] | 'none',\r\n\r\n cursor?: string\r\n}\r\n\r\nexport interface TreemapSeriesOption\r\n extends SeriesOption, ExtraStateOption>,\r\n TreemapStateOption,\r\n BoxLayoutOptionMixin,\r\n RoamOptionMixin,\r\n TreemapSeriesVisualOption {\r\n\r\n type?: 'treemap'\r\n\r\n /**\r\n * configuration in echarts2\r\n * @deprecated\r\n */\r\n size?: (number | string)[]\r\n\r\n /**\r\n * If sort in desc order.\r\n * Default to be desc. asc has strange effect\r\n */\r\n sort?: boolean | 'asc' | 'desc'\r\n\r\n /**\r\n * Size of clipped window when zooming. 'origin' or 'fullscreen'\r\n */\r\n clipWindow?: 'origin' | 'fullscreen'\r\n\r\n squareRatio?: number\r\n /**\r\n * Nodes on depth from root are regarded as leaves.\r\n * Count from zero (zero represents only view root).\r\n */\r\n leafDepth?: number\r\n\r\n drillDownIcon?: string\r\n\r\n /**\r\n * Be effective when using zoomToNode. Specify the proportion of the\r\n * target node area in the view area.\r\n */\r\n zoomToNodeRatio?: number\r\n /**\r\n * Leaf node click behaviour: 'zoomToNode', 'link', false.\r\n * If leafDepth is set and clicking a node which has children but\r\n * be on left depth, the behaviour would be changing root. Otherwise\r\n * use behaviour defined above.\r\n */\r\n nodeClick?: 'zoomToNode' | 'link' | false\r\n\r\n breadcrumb?: BoxLayoutOptionMixin & {\r\n show?: boolean\r\n height?: number\r\n\r\n emptyItemWidth?: number // With of empty width\r\n itemStyle?: BreadcrumbItemStyleOption\r\n\r\n emphasis?: {\r\n disabled?: boolean\r\n focus?: DefaultEmphasisFocus\r\n blurScope?: BlurScope\r\n itemStyle?: BreadcrumbItemStyleOption\r\n }\r\n }\r\n\r\n levels?: TreemapSeriesLevelOption[]\r\n\r\n data?: TreemapSeriesNodeItemOption[]\r\n}\r\n\r\nclass TreemapSeriesModel extends SeriesModel {\r\n\r\n static type = 'series.treemap';\r\n type = TreemapSeriesModel.type;\r\n\r\n static layoutMode = 'box' as const;\r\n\r\n preventUsingHoverLayer = true;\r\n\r\n layoutInfo: LayoutRect;\r\n\r\n designatedVisualItemStyle: TreemapSeriesItemStyleOption;\r\n\r\n private _viewRoot: TreeNode;\r\n private _idIndexMap: zrUtil.HashMap;\r\n private _idIndexMapCount: number;\r\n\r\n zoom: number;\r\n zoomLimit: {\r\n max?: number;\r\n min?: number;\r\n };\r\n\r\n static defaultOption: TreemapSeriesOption = {\r\n // Disable progressive rendering\r\n progressive: 0,\r\n // size: ['80%', '80%'], // deprecated, compatible with ec2.\r\n left: 'center',\r\n top: 'middle',\r\n width: '80%',\r\n height: '80%',\r\n sort: true,\r\n\r\n clipWindow: 'origin',\r\n squareRatio: 0.5 * (1 + Math.sqrt(5)), // golden ratio\r\n leafDepth: null,\r\n\r\n drillDownIcon: '\u25B6', // Use html character temporarily because it is complicated\r\n // to align specialized icon. \u25B7\u25B6\u2752\u2750\u25BC\u271A\r\n\r\n zoomToNodeRatio: 0.32 * 0.32,\r\n\r\n scaleLimit: null,\r\n\r\n roam: true,\r\n nodeClick: 'zoomToNode',\r\n animation: true,\r\n animationDurationUpdate: 900,\r\n animationEasing: 'quinticInOut',\r\n breadcrumb: {\r\n show: true,\r\n height: 22,\r\n left: 'center',\r\n top: 'bottom',\r\n // right\r\n // bottom\r\n emptyItemWidth: 25, // Width of empty node.\r\n itemStyle: {\r\n color: 'rgba(0,0,0,0.7)', // '#5793f3',\r\n textStyle: {\r\n color: '#fff'\r\n }\r\n },\r\n emphasis: {\r\n itemStyle: {\r\n color: 'rgba(0,0,0,0.9)' // '#5793f3',\r\n }\r\n }\r\n },\r\n label: {\r\n show: true,\r\n // Do not use textDistance, for ellipsis rect just the same as treemap node rect.\r\n distance: 0,\r\n padding: 5,\r\n position: 'inside', // Can be [5, '5%'] or position string like 'insideTopLeft', ...\r\n // formatter: null,\r\n color: '#fff',\r\n overflow: 'truncate'\r\n // align\r\n // verticalAlign\r\n },\r\n upperLabel: { // Label when node is parent.\r\n show: false,\r\n position: [0, '50%'],\r\n height: 20,\r\n // formatter: null,\r\n // color: '#fff',\r\n overflow: 'truncate',\r\n // align: null,\r\n verticalAlign: 'middle'\r\n },\r\n itemStyle: {\r\n color: null, // Can be 'none' if not necessary.\r\n colorAlpha: null, // Can be 'none' if not necessary.\r\n colorSaturation: null, // Can be 'none' if not necessary.\r\n borderWidth: 0,\r\n gapWidth: 0,\r\n borderColor: '#fff',\r\n borderColorSaturation: null // If specified, borderColor will be ineffective, and the\r\n // border color is evaluated by color of current node and\r\n // borderColorSaturation.\r\n },\r\n emphasis: {\r\n upperLabel: {\r\n show: true,\r\n position: [0, '50%'],\r\n overflow: 'truncate',\r\n verticalAlign: 'middle'\r\n }\r\n },\r\n\r\n visualDimension: 0, // Can be 0, 1, 2, 3.\r\n visualMin: null,\r\n visualMax: null,\r\n\r\n color: [], // + treemapSeries.color should not be modified. Please only modified\r\n // level[n].color (if necessary).\r\n // + Specify color list of each level. level[0].color would be global\r\n // color list if not specified. (see method `setDefault`).\r\n // + But set as a empty array to forbid fetch color from global palette\r\n // when using nodeModel.get('color'), otherwise nodes on deep level\r\n // will always has color palette set and are not able to inherit color\r\n // from parent node.\r\n // + TreemapSeries.color can not be set as 'none', otherwise effect\r\n // legend color fetching (see seriesColor.js).\r\n colorAlpha: null, // Array. Specify color alpha range of each level, like [0.2, 0.8]\r\n colorSaturation: null, // Array. Specify color saturation of each level, like [0.2, 0.5]\r\n colorMappingBy: 'index', // 'value' or 'index' or 'id'.\r\n visibleMin: 10, // If area less than this threshold (unit: pixel^2), node will not\r\n // be rendered. Only works when sort is 'asc' or 'desc'.\r\n childrenVisibleMin: null, // If area of a node less than this threshold (unit: pixel^2),\r\n // grandchildren will not show.\r\n // Why grandchildren? If not grandchildren but children,\r\n // some siblings show children and some not,\r\n // the appearance may be mess and not consistent,\r\n levels: [] // Each item: {\r\n // visibleMin, itemStyle, visualDimension, label\r\n // }\r\n };\r\n\r\n /**\r\n * @override\r\n */\r\n getInitialData(option: TreemapSeriesOption, ecModel: GlobalModel) {\r\n // Create a virtual root.\r\n const root: TreemapSeriesNodeItemOption = {\r\n name: option.name,\r\n children: option.data\r\n };\r\n\r\n completeTreeValue(root);\r\n\r\n let levels = option.levels || [];\r\n\r\n // Used in \"visual priority\" in `treemapVisual.js`.\r\n // This way is a little tricky, must satisfy the precondition:\r\n // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.\r\n // 2. The `Model.prototype.getModel()` will not use any clone-like way.\r\n const designatedVisualItemStyle = this.designatedVisualItemStyle = {};\r\n const designatedVisualModel = new Model({itemStyle: designatedVisualItemStyle}, this, ecModel);\r\n\r\n levels = option.levels = setDefault(levels, ecModel);\r\n const levelModels = zrUtil.map(levels || [], function (levelDefine) {\r\n return new Model(levelDefine, designatedVisualModel, ecModel);\r\n }, this);\r\n\r\n // Make sure always a new tree is created when setOption,\r\n // in TreemapView, we check whether oldTree === newTree\r\n // to choose mappings approach among old shapes and new shapes.\r\n const tree = Tree.createTree(root, this, beforeLink);\r\n\r\n function beforeLink(nodeData: SeriesData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n const node = tree.getNodeByDataIndex(idx);\r\n const levelModel = node ? levelModels[node.depth] : null;\r\n // If no levelModel, we also need `designatedVisualModel`.\r\n model.parentModel = levelModel || designatedVisualModel;\r\n return model;\r\n });\r\n }\r\n\r\n return tree.data;\r\n }\r\n\r\n optionUpdated() {\r\n this.resetViewRoot();\r\n }\r\n\r\n /**\r\n * @override\r\n * @param {number} dataIndex\r\n * @param {boolean} [mutipleSeries=false]\r\n */\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: string\r\n ) {\r\n const data = this.getData();\r\n const value = this.getRawValue(dataIndex) as TreemapSeriesDataValue;\r\n const name = data.getName(dataIndex);\r\n\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n }\r\n\r\n /**\r\n * Add tree path to tooltip param\r\n *\r\n * @override\r\n * @param {number} dataIndex\r\n * @return {Object}\r\n */\r\n getDataParams(dataIndex: number) {\r\n const params = super.getDataParams.apply(this, arguments as any) as TreemapSeriesCallbackDataParams;\r\n\r\n const node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treeAncestors = wrapTreePathInfo(node, this);\r\n // compatitable the previous code.\r\n params.treePathInfo = params.treeAncestors;\r\n\r\n return params;\r\n }\r\n\r\n /**\r\n * @public\r\n * @param {Object} layoutInfo {\r\n * x: containerGroup x\r\n * y: containerGroup y\r\n * width: containerGroup width\r\n * height: containerGroup height\r\n * }\r\n */\r\n setLayoutInfo(layoutInfo: LayoutRect) {\r\n /**\r\n * @readOnly\r\n * @type {Object}\r\n */\r\n this.layoutInfo = this.layoutInfo || {} as LayoutRect;\r\n zrUtil.extend(this.layoutInfo, layoutInfo);\r\n }\r\n\r\n /**\r\n * @param {string} id\r\n * @return {number} index\r\n */\r\n mapIdToIndex(id: string): number {\r\n // A feature is implemented:\r\n // index is monotone increasing with the sequence of\r\n // input id at the first time.\r\n // This feature can make sure that each data item and its\r\n // mapped color have the same index between data list and\r\n // color list at the beginning, which is useful for user\r\n // to adjust data-color mapping.\r\n\r\n /**\r\n * @private\r\n * @type {Object}\r\n */\r\n let idIndexMap = this._idIndexMap;\r\n\r\n if (!idIndexMap) {\r\n idIndexMap = this._idIndexMap = zrUtil.createHashMap();\r\n /**\r\n * @private\r\n * @type {number}\r\n */\r\n this._idIndexMapCount = 0;\r\n }\r\n\r\n let index = idIndexMap.get(id);\r\n if (index == null) {\r\n idIndexMap.set(id, index = this._idIndexMapCount++);\r\n }\r\n\r\n return index;\r\n }\r\n\r\n getViewRoot() {\r\n return this._viewRoot;\r\n }\r\n\r\n resetViewRoot(viewRoot?: TreeNode) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n\r\n const root = this.getRawData().tree.root;\r\n\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))\r\n ) {\r\n this._viewRoot = root;\r\n }\r\n }\r\n\r\n enableAriaDecal() {\r\n enableAriaDecalForTree(this);\r\n }\r\n}\r\n\r\n/**\r\n * @param {Object} dataNode\r\n */\r\nfunction completeTreeValue(dataNode: TreemapSeriesNodeItemOption) {\r\n // Postorder travel tree.\r\n // If value of none-leaf node is not set,\r\n // calculate it by suming up the value of all children.\r\n let sum = 0;\r\n\r\n zrUtil.each(dataNode.children, function (child) {\r\n\r\n completeTreeValue(child);\r\n\r\n let childValue = child.value;\r\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\r\n\r\n sum += childValue;\r\n });\r\n\r\n let thisValue = dataNode.value;\r\n if (zrUtil.isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n // Value should not less than 0.\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n\r\n zrUtil.isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n}\r\n\r\n/**\r\n * set default to level configuration\r\n */\r\nfunction setDefault(levels: TreemapSeriesLevelOption[], ecModel: GlobalModel) {\r\n const globalColorList = normalizeToArray(ecModel.get('color')) as ColorString[];\r\n const globalDecalList = normalizeToArray(\r\n (ecModel as Model).get(['aria', 'decal', 'decals'])\r\n ) as DecalObject[];\r\n\r\n if (!globalColorList) {\r\n return;\r\n }\r\n\r\n levels = levels || [];\r\n let hasColorDefine;\r\n let hasDecalDefine;\r\n zrUtil.each(levels, function (levelDefine) {\r\n const model = new Model(levelDefine);\r\n const modelColor = model.get('color');\r\n const modelDecal = model.get('decal');\r\n\r\n if (model.get(['itemStyle', 'color'])\r\n || (modelColor && modelColor !== 'none')\r\n ) {\r\n hasColorDefine = true;\r\n }\r\n if (model.get(['itemStyle', 'decal'])\r\n || (modelDecal && modelDecal !== 'none')\r\n ) {\r\n hasDecalDefine = true;\r\n }\r\n });\r\n\r\n const level0 = levels[0] || (levels[0] = {});\r\n if (!hasColorDefine) {\r\n level0.color = globalColorList.slice();\r\n }\r\n if (!hasDecalDefine && globalDecalList) {\r\n level0.decal = globalDecalList.slice();\r\n }\r\n\r\n return levels;\r\n}\r\n\r\nexport default TreemapSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport {getECData} from '../../util/innerStore';\r\nimport * as layout from '../../util/layout';\r\nimport {wrapTreePathInfo} from '../helper/treeHelper';\r\nimport TreemapSeriesModel, { TreemapSeriesNodeItemOption, TreemapSeriesOption } from './TreemapSeries';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { TreeNode } from '../../data/Tree';\r\nimport { curry, defaults } from 'zrender/src/core/util';\r\nimport { ZRElementEvent, BoxLayoutOptionMixin, ECElement } from '../../util/types';\r\nimport Element from 'zrender/src/Element';\r\nimport Model from '../../model/Model';\r\nimport { convertOptionIdName } from '../../util/model';\r\nimport { toggleHoverEmphasis, Z2_EMPHASIS_LIFT } from '../../util/states';\r\nimport { createTextStyle } from '../../label/labelStyle';\r\n\r\nconst TEXT_PADDING = 8;\r\nconst ITEM_GAP = 8;\r\nconst ARRAY_LENGTH = 5;\r\n\r\ninterface OnSelectCallback {\r\n (node: TreeNode, e: ZRElementEvent): void\r\n}\r\n\r\ninterface LayoutParam {\r\n pos: BoxLayoutOptionMixin\r\n box: {\r\n width: number,\r\n height: number\r\n }\r\n emptyItemWidth: number\r\n totalWidth: number\r\n renderList: {\r\n node: TreeNode,\r\n text: string\r\n width: number\r\n }[]\r\n}\r\n\r\ntype BreadcrumbItemStyleModel = Model;\r\ntype BreadcrumbEmphasisItemStyleModel = Model;\r\ntype BreadcrumbTextStyleModel = Model;\r\n\r\nclass Breadcrumb {\r\n\r\n group = new graphic.Group();\r\n\r\n constructor(containerGroup: graphic.Group) {\r\n containerGroup.add(this.group);\r\n }\r\n\r\n render(\r\n seriesModel: TreemapSeriesModel,\r\n api: ExtensionAPI,\r\n targetNode: TreeNode,\r\n onSelect: OnSelectCallback\r\n ) {\r\n const model = seriesModel.getModel('breadcrumb');\r\n const thisGroup = this.group;\r\n\r\n thisGroup.removeAll();\r\n\r\n if (!model.get('show') || !targetNode) {\r\n return;\r\n }\r\n\r\n const normalStyleModel = model.getModel('itemStyle');\r\n const emphasisModel = model.getModel('emphasis');\r\n const textStyleModel = normalStyleModel.getModel('textStyle');\r\n const emphasisTextStyleModel = emphasisModel.getModel(['itemStyle', 'textStyle']);\r\n\r\n const layoutParam: LayoutParam = {\r\n pos: {\r\n left: model.get('left'),\r\n right: model.get('right'),\r\n top: model.get('top'),\r\n bottom: model.get('bottom')\r\n },\r\n box: {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n },\r\n emptyItemWidth: model.get('emptyItemWidth'),\r\n totalWidth: 0,\r\n renderList: []\r\n };\r\n\r\n this._prepare(targetNode, layoutParam, textStyleModel);\r\n this._renderContent(\r\n seriesModel, layoutParam, normalStyleModel,\r\n emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect\r\n );\r\n\r\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\r\n }\r\n\r\n /**\r\n * Prepare render list and total width\r\n * @private\r\n */\r\n _prepare(targetNode: TreeNode, layoutParam: LayoutParam, textStyleModel: BreadcrumbTextStyleModel) {\r\n for (let node = targetNode; node; node = node.parentNode) {\r\n const text = convertOptionIdName(node.getModel().get('name'), '');\r\n const textRect = textStyleModel.getTextRect(text);\r\n const itemWidth = Math.max(\r\n textRect.width + TEXT_PADDING * 2,\r\n layoutParam.emptyItemWidth\r\n );\r\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\r\n layoutParam.renderList.push({\r\n node: node,\r\n text: text,\r\n width: itemWidth\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n _renderContent(\r\n seriesModel: TreemapSeriesModel,\r\n layoutParam: LayoutParam,\r\n normalStyleModel: BreadcrumbItemStyleModel,\r\n emphasisModel: BreadcrumbEmphasisItemStyleModel,\r\n textStyleModel: BreadcrumbTextStyleModel,\r\n emphasisTextStyleModel: BreadcrumbTextStyleModel,\r\n onSelect: OnSelectCallback\r\n ) {\r\n // Start rendering.\r\n let lastX = 0;\r\n const emptyItemWidth = layoutParam.emptyItemWidth;\r\n const height = seriesModel.get(['breadcrumb', 'height']);\r\n const availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\r\n let totalWidth = layoutParam.totalWidth;\r\n const renderList = layoutParam.renderList;\r\n const emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n\r\n for (let i = renderList.length - 1; i >= 0; i--) {\r\n const item = renderList[i];\r\n const itemNode = item.node;\r\n let itemWidth = item.width;\r\n let text = item.text;\r\n\r\n // Hdie text and shorten width if necessary.\r\n if (totalWidth > availableSize.width) {\r\n totalWidth -= itemWidth - emptyItemWidth;\r\n itemWidth = emptyItemWidth;\r\n text = null;\r\n }\r\n\r\n const el = new graphic.Polygon({\r\n shape: {\r\n points: makeItemPoints(\r\n lastX, 0, itemWidth, height,\r\n i === renderList.length - 1, i === 0\r\n )\r\n },\r\n style: defaults(\r\n normalStyleModel.getItemStyle(),\r\n {\r\n lineJoin: 'bevel'\r\n }\r\n ),\r\n textContent: new graphic.Text({\r\n style: createTextStyle(textStyleModel, { text })\r\n }),\r\n textConfig: {\r\n position: 'inside'\r\n },\r\n z2: Z2_EMPHASIS_LIFT * 1e4, // A very large z2\r\n onclick: curry(onSelect, itemNode)\r\n });\r\n (el as ECElement).disableLabelAnimation = true;\r\n el.getTextContent().ensureState('emphasis').style = createTextStyle(emphasisTextStyleModel, { text });\r\n el.ensureState('emphasis').style = emphasisItemStyle;\r\n toggleHoverEmphasis(\r\n el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')\r\n );\r\n this.group.add(el);\r\n\r\n packEventData(el, seriesModel, itemNode);\r\n\r\n lastX += itemWidth + ITEM_GAP;\r\n }\r\n }\r\n\r\n remove() {\r\n this.group.removeAll();\r\n }\r\n}\r\n\r\nfunction makeItemPoints(x: number, y: number, itemWidth: number, itemHeight: number, head: boolean, tail: boolean) {\r\n const points = [\r\n [head ? x : x - ARRAY_LENGTH, y],\r\n [x + itemWidth, y],\r\n [x + itemWidth, y + itemHeight],\r\n [head ? x : x - ARRAY_LENGTH, y + itemHeight]\r\n ];\r\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\r\n !head && points.push([x, y + itemHeight / 2]);\r\n return points;\r\n}\r\n\r\n// Package custom mouse event.\r\nfunction packEventData(el: Element, seriesModel: TreemapSeriesModel, itemNode: TreeNode) {\r\n getECData(el).eventData = {\r\n componentType: 'series',\r\n componentSubType: 'treemap',\r\n componentIndex: seriesModel.componentIndex,\r\n seriesIndex: seriesModel.seriesIndex,\r\n seriesName: seriesModel.name,\r\n seriesType: 'treemap',\r\n selfType: 'breadcrumb', // Distinguish with click event on treemap node.\r\n nodeData: {\r\n dataIndex: itemNode && itemNode.dataIndex,\r\n name: itemNode && itemNode.name\r\n },\r\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\r\n };\r\n}\r\n\r\nexport default Breadcrumb;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport Element, { ElementProps } from 'zrender/src/Element';\r\nimport { ZREasing } from './types';\r\nimport { AnimationEasing } from 'zrender/src/animation/easing';\r\n\r\ninterface AnimationWrapStorage {\r\n el: Element;\r\n target: ElementProps;\r\n duration: number;\r\n delay: number;\r\n easing: AnimationEasing\r\n}\r\ntype AnimationWrapDoneCallback = () => void;\r\n\r\n/**\r\n * Animate multiple elements with a single done-callback.\r\n *\r\n * @example\r\n * animation\r\n * .createWrap()\r\n * .add(el1, {x: 10, y: 10})\r\n * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)\r\n * .done(function () { // done })\r\n * .start('cubicOut');\r\n */\r\nclass AnimationWrap {\r\n\r\n private _storage = [] as AnimationWrapStorage[];\r\n private _elExistsMap: { [elId: string]: boolean } = {};\r\n private _finishedCallback: AnimationWrapDoneCallback;\r\n\r\n /**\r\n * Caution: a el can only be added once, otherwise 'done'\r\n * might not be called. This method checks this (by el.id),\r\n * suppresses adding and returns false when existing el found.\r\n *\r\n * @return Whether adding succeeded.\r\n */\r\n add(\r\n el: Element,\r\n target: ElementProps,\r\n duration?: number,\r\n delay?: number,\r\n easing?: ZREasing\r\n ): boolean {\r\n if (this._elExistsMap[el.id]) {\r\n return false;\r\n }\r\n this._elExistsMap[el.id] = true;\r\n\r\n this._storage.push({\r\n el: el,\r\n target: target,\r\n duration: duration,\r\n delay: delay,\r\n easing: easing\r\n });\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Only execute when animation done/aborted.\r\n */\r\n finished(callback: AnimationWrapDoneCallback): AnimationWrap {\r\n this._finishedCallback = callback;\r\n return this;\r\n }\r\n\r\n /**\r\n * Will stop exist animation firstly.\r\n */\r\n start(): AnimationWrap {\r\n let count = this._storage.length;\r\n\r\n const checkTerminate = () => {\r\n count--;\r\n if (count <= 0) { // Guard.\r\n this._storage.length = 0;\r\n this._elExistsMap = {};\r\n this._finishedCallback && this._finishedCallback();\r\n }\r\n };\r\n\r\n for (let i = 0, len = this._storage.length; i < len; i++) {\r\n const item = this._storage[i];\r\n item.el.animateTo(item.target, {\r\n duration: item.duration,\r\n delay: item.delay,\r\n easing: item.easing,\r\n setToFinal: true,\r\n done: checkTerminate,\r\n aborted: checkTerminate\r\n });\r\n }\r\n\r\n return this;\r\n }\r\n}\r\n\r\nexport function createWrap(): AnimationWrap {\r\n return new AnimationWrap();\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {bind, each, indexOf, curry, extend, normalizeCssArray, isFunction} from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport {getECData} from '../../util/innerStore';\r\nimport {\r\n isHighDownDispatcher,\r\n setAsHighDownDispatcher,\r\n setDefaultStateProxy,\r\n enableHoverFocus,\r\n Z2_EMPHASIS_LIFT\r\n} from '../../util/states';\r\nimport DataDiffer from '../../data/DataDiffer';\r\nimport * as helper from '../helper/treeHelper';\r\nimport Breadcrumb from './Breadcrumb';\r\nimport RoamController, { RoamEventParams, RoamControllerHost } from '../../component/helper/RoamController';\r\nimport BoundingRect, { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport * as animationUtil from '../../util/animation';\r\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper';\r\nimport ChartView from '../../view/Chart';\r\nimport Tree, { TreeNode } from '../../data/Tree';\r\nimport TreemapSeriesModel, { TreemapSeriesNodeItemOption } from './TreemapSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport Model from '../../model/Model';\r\nimport { LayoutRect } from '../../util/layout';\r\nimport { TreemapLayoutNode } from './treemapLayout';\r\nimport Element from 'zrender/src/Element';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport { makeInner, convertOptionIdName } from '../../util/model';\r\nimport { PathStyleProps, PathProps } from 'zrender/src/graphic/Path';\r\nimport { TreeSeriesNodeItemOption } from '../tree/TreeSeries';\r\nimport {\r\n TreemapRootToNodePayload,\r\n TreemapMovePayload,\r\n TreemapRenderPayload,\r\n TreemapZoomToNodePayload\r\n} from './treemapAction';\r\nimport { ColorString, ECElement } from '../../util/types';\r\nimport { windowOpen } from '../../util/format';\r\nimport { TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\n\r\nconst Group = graphic.Group;\r\nconst Rect = graphic.Rect;\r\n\r\nconst DRAG_THRESHOLD = 3;\r\nconst PATH_LABEL_NOAMAL = 'label';\r\nconst PATH_UPPERLABEL_NORMAL = 'upperLabel';\r\n// Should larger than emphasis states lift z\r\nconst Z2_BASE = Z2_EMPHASIS_LIFT * 10; // Should bigger than every z2.\r\nconst Z2_BG = Z2_EMPHASIS_LIFT * 2;\r\nconst Z2_CONTENT = Z2_EMPHASIS_LIFT * 3;\r\n\r\nconst getStateItemStyle = makeStyleMapper([\r\n ['fill', 'color'],\r\n // `borderColor` and `borderWidth` has been occupied,\r\n // so use `stroke` to indicate the stroke of the rect.\r\n ['stroke', 'strokeColor'],\r\n ['lineWidth', 'strokeWidth'],\r\n ['shadowBlur'],\r\n ['shadowOffsetX'],\r\n ['shadowOffsetY'],\r\n ['shadowColor']\r\n // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\r\n // So do not transfer decal directly.\r\n]);\r\nconst getItemStyleNormal = function (model: Model): PathStyleProps {\r\n // Normal style props should include emphasis style props.\r\n const itemStyle = getStateItemStyle(model) as PathStyleProps;\r\n // Clear styles set by emphasis.\r\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\r\n return itemStyle;\r\n};\r\n\r\ninterface RenderElementStorage {\r\n nodeGroup: graphic.Group[]\r\n background: graphic.Rect[]\r\n content: graphic.Rect[]\r\n}\r\n\r\ntype LastCfgStorage = {\r\n [key in keyof RenderElementStorage]: LastCfg[]\r\n // nodeGroup: {\r\n // old: Pick[]\r\n // fadein: boolean\r\n // }[]\r\n // background: {\r\n // old: Pick\r\n // fadein: boolean\r\n // }[]\r\n // content: {\r\n // old: Pick\r\n // fadein: boolean\r\n // }[]\r\n};\r\n\r\ninterface FoundTargetInfo {\r\n node: TreeNode\r\n\r\n offsetX?: number\r\n offsetY?: number\r\n}\r\n\r\ninterface RenderResult {\r\n lastsForAnimation: LastCfgStorage\r\n willInvisibleEls?: graphic.Rect[]\r\n willDeleteEls: RenderElementStorage\r\n renderFinally: () => void\r\n}\r\n\r\ninterface ReRoot {\r\n rootNodeGroup: graphic.Group\r\n direction: 'drillDown' | 'rollUp'\r\n}\r\n\r\ninterface LastCfg {\r\n oldX?: number\r\n oldY?: number\r\n oldShape?: graphic.Rect['shape']\r\n fadein: boolean\r\n}\r\n\r\nconst inner = makeInner<{\r\n nodeWidth: number\r\n nodeHeight: number\r\n willDelete: boolean\r\n}, Element>();\r\n\r\nclass TreemapView extends ChartView {\r\n\r\n static type = 'treemap';\r\n type = TreemapView.type;\r\n\r\n private _containerGroup: graphic.Group;\r\n private _breadcrumb: Breadcrumb;\r\n private _controller: RoamController;\r\n private _controllerHost: RoamControllerHost;\r\n\r\n private _oldTree: Tree;\r\n\r\n private _state: 'ready' | 'animating' = 'ready';\r\n\r\n private _storage = createStorage() as RenderElementStorage;\r\n\r\n seriesModel: TreemapSeriesModel;\r\n api: ExtensionAPI;\r\n ecModel: GlobalModel;\r\n\r\n /**\r\n * @override\r\n */\r\n render(\r\n seriesModel: TreemapSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: TreemapZoomToNodePayload | TreemapRenderPayload | TreemapMovePayload | TreemapRootToNodePayload\r\n ) {\r\n\r\n const models = ecModel.findComponents({\r\n mainType: 'series', subType: 'treemap', query: payload\r\n });\r\n if (indexOf(models, seriesModel) < 0) {\r\n return;\r\n }\r\n\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n\r\n const types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n const targetInfo = helper\r\n .retrieveTargetInfo(payload, types, seriesModel);\r\n const payloadType = payload && payload.type;\r\n const layoutInfo = seriesModel.layoutInfo;\r\n const isInit = !this._oldTree;\r\n const thisStorage = this._storage;\r\n\r\n // Mark new root when action is treemapRootToNode.\r\n const reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage)\r\n ? {\r\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\r\n direction: (payload as TreemapRootToNodePayload).direction\r\n }\r\n : null;\r\n\r\n const containerGroup = this._giveContainerGroup(layoutInfo);\r\n const hasAnimation = seriesModel.get('animation');\r\n\r\n const renderResult = this._doRender(containerGroup, seriesModel, reRoot);\r\n (\r\n hasAnimation && !isInit && (\r\n !payloadType\r\n || payloadType === 'treemapZoomToNode'\r\n || payloadType === 'treemapRootToNode'\r\n )\r\n )\r\n ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot)\r\n : renderResult.renderFinally();\r\n\r\n this._resetController(api);\r\n\r\n this._renderBreadcrumb(seriesModel, api, targetInfo);\r\n }\r\n\r\n private _giveContainerGroup(layoutInfo: LayoutRect) {\r\n let containerGroup = this._containerGroup;\r\n if (!containerGroup) {\r\n // FIXME\r\n // \u52A0\u4E00\u5C42containerGroup\u662F\u4E3A\u4E86clip\uFF0C\u4F46\u662F\u73B0\u5728clip\u529F\u80FD\u5E76\u6CA1\u6709\u5B9E\u73B0\u3002\r\n containerGroup = this._containerGroup = new Group();\r\n this._initEvents(containerGroup);\r\n this.group.add(containerGroup);\r\n }\r\n containerGroup.x = layoutInfo.x;\r\n containerGroup.y = layoutInfo.y;\r\n\r\n return containerGroup;\r\n }\r\n\r\n private _doRender(containerGroup: graphic.Group, seriesModel: TreemapSeriesModel, reRoot: ReRoot): RenderResult {\r\n const thisTree = seriesModel.getData().tree;\r\n const oldTree = this._oldTree;\r\n\r\n // Clear last shape records.\r\n const lastsForAnimation = createStorage() as LastCfgStorage;\r\n const thisStorage = createStorage() as RenderElementStorage;\r\n const oldStorage = this._storage;\r\n const willInvisibleEls: RenderResult['willInvisibleEls'] = [];\r\n\r\n function doRenderNode(thisNode: TreeNode, oldNode: TreeNode, parentGroup: graphic.Group, depth: number) {\r\n return renderNode(\r\n seriesModel,\r\n thisStorage, oldStorage, reRoot,\r\n lastsForAnimation, willInvisibleEls,\r\n thisNode, oldNode, parentGroup, depth\r\n );\r\n }\r\n\r\n // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow),\r\n // the oldTree is actually losted, so we cannot find all of the old graphic\r\n // elements from tree. So we use this strategy: make element storage, move\r\n // from old storage to new storage, clear old storage.\r\n\r\n dualTravel(\r\n thisTree.root ? [thisTree.root] : [],\r\n (oldTree && oldTree.root) ? [oldTree.root] : [],\r\n containerGroup,\r\n thisTree === oldTree || !oldTree,\r\n 0\r\n );\r\n\r\n // Process all removing.\r\n const willDeleteEls = clearStorage(oldStorage) as RenderElementStorage;\r\n\r\n this._oldTree = thisTree;\r\n this._storage = thisStorage;\r\n\r\n if (this._controllerHost) {\r\n const _oldRootLayout = this.seriesModel.layoutInfo;\r\n const rootLayout = thisTree.root.getLayout();\r\n if (rootLayout.width === _oldRootLayout.width && rootLayout.height === _oldRootLayout.height) {\r\n this._controllerHost.zoom = 1;\r\n }\r\n }\r\n\r\n return {\r\n lastsForAnimation,\r\n willDeleteEls,\r\n renderFinally\r\n };\r\n\r\n function dualTravel(\r\n thisViewChildren: TreemapLayoutNode[],\r\n oldViewChildren: TreemapLayoutNode[],\r\n parentGroup: graphic.Group,\r\n sameTree: boolean,\r\n depth: number\r\n ) {\r\n // When 'render' is triggered by action,\r\n // 'this' and 'old' may be the same tree,\r\n // we use rawIndex in that case.\r\n if (sameTree) {\r\n oldViewChildren = thisViewChildren;\r\n each(thisViewChildren, function (child, index) {\r\n !child.isRemoved() && processNode(index, index);\r\n });\r\n }\r\n // Diff hierarchically (diff only in each subtree, but not whole).\r\n // because, consistency of view is important.\r\n else {\r\n (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey))\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(curry(processNode, null))\r\n .execute();\r\n }\r\n\r\n function getKey(node: TreeNode) {\r\n // Identify by name or raw index.\r\n return node.getId();\r\n }\r\n\r\n function processNode(newIndex: number, oldIndex?: number) {\r\n const thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\r\n const oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\r\n\r\n const group = doRenderNode(thisNode, oldNode, parentGroup, depth);\r\n\r\n group && dualTravel(\r\n thisNode && thisNode.viewChildren || [],\r\n oldNode && oldNode.viewChildren || [],\r\n group,\r\n sameTree,\r\n depth + 1\r\n );\r\n }\r\n }\r\n\r\n function clearStorage(storage: RenderElementStorage) {\r\n const willDeleteEls = createStorage() as RenderElementStorage;\r\n storage && each(storage, function (store, storageName) {\r\n const delEls = willDeleteEls[storageName];\r\n each(store, function (el) {\r\n el && (delEls.push(el as any), inner(el).willDelete = true);\r\n });\r\n });\r\n return willDeleteEls;\r\n }\r\n\r\n function renderFinally() {\r\n each(willDeleteEls, function (els) {\r\n each(els, function (el) {\r\n el.parent && el.parent.remove(el);\r\n });\r\n });\r\n each(willInvisibleEls, function (el) {\r\n el.invisible = true;\r\n // Setting invisible is for optimizing, so no need to set dirty,\r\n // just mark as invisible.\r\n el.dirty();\r\n });\r\n }\r\n }\r\n\r\n private _doAnimation(\r\n containerGroup: graphic.Group,\r\n renderResult: RenderResult,\r\n seriesModel: TreemapSeriesModel,\r\n reRoot: ReRoot\r\n ) {\r\n const durationOption = seriesModel.get('animationDurationUpdate');\r\n const easingOption = seriesModel.get('animationEasing');\r\n // TODO: do not support function until necessary.\r\n const duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\r\n const easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\r\n const animationWrap = animationUtil.createWrap();\r\n\r\n // Make delete animations.\r\n each(renderResult.willDeleteEls, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n if ((el as Displayable).invisible) {\r\n return;\r\n }\r\n\r\n const parent = el.parent; // Always has parent, and parent is nodeGroup.\r\n let target: PathProps;\r\n const innerStore = inner(parent);\r\n\r\n if (reRoot && reRoot.direction === 'drillDown') {\r\n target = parent === reRoot.rootNodeGroup\r\n // This is the content element of view root.\r\n // Only `content` will enter this branch, because\r\n // `background` and `nodeGroup` will not be deleted.\r\n ? {\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: innerStore.nodeWidth,\r\n height: innerStore.nodeHeight\r\n },\r\n style: {\r\n opacity: 0\r\n }\r\n }\r\n // Others.\r\n : {style: {opacity: 0}};\r\n }\r\n else {\r\n let targetX = 0;\r\n let targetY = 0;\r\n\r\n if (!innerStore.willDelete) {\r\n // Let node animate to right-bottom corner, cooperating with fadeout,\r\n // which is appropriate for user understanding.\r\n // Divided by 2 for reRoot rolling up effect.\r\n targetX = innerStore.nodeWidth / 2;\r\n targetY = innerStore.nodeHeight / 2;\r\n }\r\n\r\n target = storageName === 'nodeGroup'\r\n ? {x: targetX, y: targetY, style: {opacity: 0}}\r\n : {\r\n shape: {x: targetX, y: targetY, width: 0, height: 0},\r\n style: {opacity: 0}\r\n };\r\n }\r\n\r\n // TODO: do not support delay until necessary.\r\n target && animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n });\r\n\r\n // Make other animations\r\n each(this._storage, function (store, storageName) {\r\n each(store, function (el, rawIndex) {\r\n const last = renderResult.lastsForAnimation[storageName][rawIndex];\r\n const target: PathProps = {};\r\n\r\n if (!last) {\r\n return;\r\n }\r\n\r\n if (el instanceof graphic.Group) {\r\n if (last.oldX != null) {\r\n target.x = el.x;\r\n target.y = el.y;\r\n el.x = last.oldX;\r\n el.y = last.oldY;\r\n }\r\n }\r\n else {\r\n if (last.oldShape) {\r\n target.shape = extend({}, el.shape);\r\n el.setShape(last.oldShape);\r\n }\r\n\r\n if (last.fadein) {\r\n el.setStyle('opacity', 0);\r\n target.style = {opacity: 1};\r\n }\r\n // When animation is stopped for succedent animation starting,\r\n // el.style.opacity might not be 1\r\n else if (el.style.opacity !== 1) {\r\n target.style = {opacity: 1};\r\n }\r\n }\r\n\r\n animationWrap.add(el, target, duration, 0, easing);\r\n });\r\n }, this);\r\n\r\n this._state = 'animating';\r\n\r\n animationWrap\r\n .finished(bind(function () {\r\n this._state = 'ready';\r\n renderResult.renderFinally();\r\n }, this))\r\n .start();\r\n }\r\n\r\n private _resetController(api: ExtensionAPI) {\r\n let controller = this._controller;\r\n let controllerHost = this._controllerHost;\r\n\r\n if (!controllerHost) {\r\n this._controllerHost = {\r\n target: this.group\r\n } as RoamControllerHost;\r\n controllerHost = this._controllerHost;\r\n }\r\n\r\n // Init controller.\r\n if (!controller) {\r\n controller = this._controller = new RoamController(api.getZr());\r\n controller.enable(this.seriesModel.get('roam'));\r\n controllerHost.zoomLimit = this.seriesModel.get('scaleLimit');\r\n controllerHost.zoom = this.seriesModel.get('zoom');\r\n controller.on('pan', bind(this._onPan, this));\r\n controller.on('zoom', bind(this._onZoom, this));\r\n }\r\n\r\n const rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\r\n controller.setPointerChecker(function (e, x, y) {\r\n return rect.contain(x, y);\r\n });\r\n }\r\n\r\n private _clearController() {\r\n let controller = this._controller;\r\n this._controllerHost = null;\r\n if (controller) {\r\n controller.dispose();\r\n controller = null;\r\n }\r\n }\r\n\r\n private _onPan(e: RoamEventParams['pan']) {\r\n if (this._state !== 'animating'\r\n && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)\r\n ) {\r\n // These param must not be cached.\r\n const root = this.seriesModel.getData().tree.root;\r\n\r\n if (!root) {\r\n return;\r\n }\r\n\r\n const rootLayout = root.getLayout();\r\n\r\n if (!rootLayout) {\r\n return;\r\n }\r\n\r\n this.api.dispatchAction({\r\n type: 'treemapMove',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rootLayout.x + e.dx, y: rootLayout.y + e.dy,\r\n width: rootLayout.width, height: rootLayout.height\r\n }\r\n } as TreemapMovePayload);\r\n }\r\n }\r\n\r\n private _onZoom(e: RoamEventParams['zoom']) {\r\n let mouseX = e.originX;\r\n let mouseY = e.originY;\r\n const zoomDelta = e.scale;\r\n\r\n if (this._state !== 'animating') {\r\n // These param must not be cached.\r\n const root = this.seriesModel.getData().tree.root;\r\n\r\n if (!root) {\r\n return;\r\n }\r\n\r\n const rootLayout = root.getLayout();\r\n\r\n if (!rootLayout) {\r\n return;\r\n }\r\n\r\n const rect = new BoundingRect(\r\n rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height\r\n );\r\n\r\n // scaleLimit\r\n let zoomLimit = null;\r\n const _controllerHost = this._controllerHost;\r\n zoomLimit = _controllerHost.zoomLimit;\r\n\r\n let newZoom = _controllerHost.zoom = _controllerHost.zoom || 1;\r\n newZoom *= zoomDelta;\r\n if (zoomLimit) {\r\n const zoomMin = zoomLimit.min || 0;\r\n const zoomMax = zoomLimit.max || Infinity;\r\n newZoom = Math.max(\r\n Math.min(zoomMax, newZoom),\r\n zoomMin\r\n );\r\n }\r\n const zoomScale = newZoom / _controllerHost.zoom;\r\n _controllerHost.zoom = newZoom;\r\n const layoutInfo = this.seriesModel.layoutInfo;\r\n\r\n // Transform mouse coord from global to containerGroup.\r\n mouseX -= layoutInfo.x;\r\n mouseY -= layoutInfo.y;\r\n\r\n // Scale root bounding rect.\r\n const m = matrix.create();\r\n matrix.translate(m, m, [-mouseX, -mouseY]);\r\n matrix.scale(m, m, [zoomScale, zoomScale]);\r\n matrix.translate(m, m, [mouseX, mouseY]);\r\n\r\n rect.applyTransform(m);\r\n\r\n this.api.dispatchAction({\r\n type: 'treemapRender',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n rootRect: {\r\n x: rect.x, y: rect.y,\r\n width: rect.width, height: rect.height\r\n }\r\n } as TreemapRenderPayload);\r\n }\r\n }\r\n\r\n private _initEvents(containerGroup: graphic.Group) {\r\n containerGroup.on('click', (e) => {\r\n if (this._state !== 'ready') {\r\n return;\r\n }\r\n\r\n const nodeClick = this.seriesModel.get('nodeClick', true);\r\n\r\n if (!nodeClick) {\r\n return;\r\n }\r\n\r\n const targetInfo = this.findTarget(e.offsetX, e.offsetY);\r\n\r\n if (!targetInfo) {\r\n return;\r\n }\r\n\r\n const node = targetInfo.node;\r\n if (node.getLayout().isLeafRoot) {\r\n this._rootToNode(targetInfo);\r\n }\r\n else {\r\n if (nodeClick === 'zoomToNode') {\r\n this._zoomToNode(targetInfo);\r\n }\r\n else if (nodeClick === 'link') {\r\n const itemModel = node.hostTree.data.getItemModel(node.dataIndex);\r\n const link = itemModel.get('link', true);\r\n const linkTarget = itemModel.get('target', true) || 'blank';\r\n link && windowOpen(link, linkTarget);\r\n }\r\n }\r\n\r\n }, this);\r\n }\r\n\r\n private _renderBreadcrumb(seriesModel: TreemapSeriesModel, api: ExtensionAPI, targetInfo: FoundTargetInfo) {\r\n if (!targetInfo) {\r\n targetInfo = seriesModel.get('leafDepth', true) != null\r\n ? {node: seriesModel.getViewRoot()}\r\n // FIXME\r\n // better way?\r\n // Find breadcrumb tail on center of containerGroup.\r\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\r\n\r\n if (!targetInfo) {\r\n targetInfo = {node: seriesModel.getData().tree.root};\r\n }\r\n }\r\n\r\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group)))\r\n .render(seriesModel, api, targetInfo.node, (node) => {\r\n if (this._state !== 'animating') {\r\n helper.aboveViewRoot(seriesModel.getViewRoot(), node)\r\n ? this._rootToNode({node: node})\r\n : this._zoomToNode({node: node});\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n remove() {\r\n this._clearController();\r\n this._containerGroup && this._containerGroup.removeAll();\r\n this._storage = createStorage() as RenderElementStorage;\r\n this._state = 'ready';\r\n this._breadcrumb && this._breadcrumb.remove();\r\n }\r\n\r\n dispose() {\r\n this._clearController();\r\n }\r\n\r\n private _zoomToNode(targetInfo: FoundTargetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapZoomToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n }\r\n\r\n private _rootToNode(targetInfo: FoundTargetInfo) {\r\n this.api.dispatchAction({\r\n type: 'treemapRootToNode',\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: targetInfo.node\r\n });\r\n }\r\n\r\n /**\r\n * @public\r\n * @param {number} x Global coord x.\r\n * @param {number} y Global coord y.\r\n * @return {Object} info If not found, return undefined;\r\n * @return {number} info.node Target node.\r\n * @return {number} info.offsetX x refer to target node.\r\n * @return {number} info.offsetY y refer to target node.\r\n */\r\n findTarget(x: number, y: number): FoundTargetInfo {\r\n let targetInfo;\r\n const viewRoot = this.seriesModel.getViewRoot();\r\n\r\n viewRoot.eachNode({attr: 'viewChildren', order: 'preorder'}, function (node) {\r\n const bgEl = this._storage.background[node.getRawIndex()];\r\n // If invisible, there might be no element.\r\n if (bgEl) {\r\n const point = bgEl.transformCoordToLocal(x, y);\r\n const shape = bgEl.shape;\r\n\r\n // For performance consideration, don't use 'getBoundingRect'.\r\n if (shape.x <= point[0]\r\n && point[0] <= shape.x + shape.width\r\n && shape.y <= point[1]\r\n && point[1] <= shape.y + shape.height\r\n ) {\r\n targetInfo = {\r\n node: node,\r\n offsetX: point[0],\r\n offsetY: point[1]\r\n };\r\n }\r\n else {\r\n return false; // Suppress visit subtree.\r\n }\r\n }\r\n }, this);\r\n\r\n return targetInfo;\r\n }\r\n}\r\n\r\n/**\r\n * @inner\r\n */\r\nfunction createStorage(): RenderElementStorage | LastCfgStorage {\r\n return {\r\n nodeGroup: [],\r\n background: [],\r\n content: []\r\n };\r\n}\r\n\r\n/**\r\n * @inner\r\n * @return Return undefined means do not travel further.\r\n */\r\nfunction renderNode(\r\n seriesModel: TreemapSeriesModel,\r\n thisStorage: RenderElementStorage,\r\n oldStorage: RenderElementStorage,\r\n reRoot: ReRoot,\r\n lastsForAnimation: RenderResult['lastsForAnimation'],\r\n willInvisibleEls: RenderResult['willInvisibleEls'],\r\n thisNode: TreeNode,\r\n oldNode: TreeNode,\r\n parentGroup: graphic.Group,\r\n depth: number\r\n) {\r\n // Whether under viewRoot.\r\n if (!thisNode) {\r\n // Deleting nodes will be performed finally. This method just find\r\n // element from old storage, or create new element, set them to new\r\n // storage, and set styles.\r\n return;\r\n }\r\n\r\n // -------------------------------------------------------------------\r\n // Start of closure variables available in \"Procedures in renderNode\".\r\n\r\n const thisLayout = thisNode.getLayout();\r\n const data = seriesModel.getData();\r\n const nodeModel = thisNode.getModel();\r\n\r\n // Only for enabling highlight/downplay. Clear firstly.\r\n // Because some node will not be rendered.\r\n data.setItemGraphicEl(thisNode.dataIndex, null);\r\n\r\n if (!thisLayout || !thisLayout.isInView) {\r\n return;\r\n }\r\n\r\n const thisWidth = thisLayout.width;\r\n const thisHeight = thisLayout.height;\r\n const borderWidth = thisLayout.borderWidth;\r\n const thisInvisible = thisLayout.invisible;\r\n\r\n const thisRawIndex = thisNode.getRawIndex();\r\n const oldRawIndex = oldNode && oldNode.getRawIndex();\r\n\r\n const thisViewChildren = thisNode.viewChildren;\r\n const upperHeight = thisLayout.upperHeight;\r\n const isParent = thisViewChildren && thisViewChildren.length;\r\n const itemStyleNormalModel = nodeModel.getModel('itemStyle');\r\n const itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\r\n const itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\r\n const itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\r\n const borderRadius = itemStyleNormalModel.get('borderRadius') || 0;\r\n\r\n // End of closure ariables available in \"Procedures in renderNode\".\r\n // -----------------------------------------------------------------\r\n\r\n // Node group\r\n const group = giveGraphic('nodeGroup', Group);\r\n\r\n if (!group) {\r\n return;\r\n }\r\n\r\n parentGroup.add(group);\r\n // x,y are not set when el is above view root.\r\n group.x = thisLayout.x || 0;\r\n group.y = thisLayout.y || 0;\r\n group.markRedraw();\r\n inner(group).nodeWidth = thisWidth;\r\n inner(group).nodeHeight = thisHeight;\r\n\r\n if (thisLayout.isAboveViewRoot) {\r\n return group;\r\n }\r\n\r\n // Background\r\n const bg = giveGraphic('background', Rect, depth, Z2_BG);\r\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\r\n\r\n const emphasisModel = nodeModel.getModel('emphasis');\r\n const focus = emphasisModel.get('focus');\r\n const blurScope = emphasisModel.get('blurScope');\r\n const isDisabled = emphasisModel.get('disabled');\r\n\r\n const focusOrIndices =\r\n focus === 'ancestor' ? thisNode.getAncestorsIndices()\r\n : focus === 'descendant' ? thisNode.getDescendantIndices()\r\n : focus;\r\n\r\n // No children, render content.\r\n if (isParent) {\r\n // Because of the implementation about \"traverse\" in graphic hover style, we\r\n // can not set hover listener on the \"group\" of non-leaf node. Otherwise the\r\n // hover event from the descendents will be listenered.\r\n if (isHighDownDispatcher(group)) {\r\n setAsHighDownDispatcher(group, false);\r\n }\r\n if (bg) {\r\n setAsHighDownDispatcher(bg, !isDisabled);\r\n // Only for enabling highlight/downplay.\r\n data.setItemGraphicEl(thisNode.dataIndex, bg);\r\n\r\n enableHoverFocus(bg, focusOrIndices, blurScope);\r\n }\r\n }\r\n else {\r\n const content = giveGraphic('content', Rect, depth, Z2_CONTENT);\r\n content && renderContent(group, content);\r\n\r\n (bg as ECElement).disableMorphing = true;\r\n\r\n if (bg && isHighDownDispatcher(bg)) {\r\n setAsHighDownDispatcher(bg, false);\r\n }\r\n setAsHighDownDispatcher(group, !isDisabled);\r\n // Only for enabling highlight/downplay.\r\n data.setItemGraphicEl(thisNode.dataIndex, group);\r\n\r\n const cursorStyle = nodeModel.getShallow('cursor');\r\n cursorStyle && content.attr('cursor', cursorStyle);\r\n\r\n enableHoverFocus(group, focusOrIndices, blurScope);\r\n }\r\n\r\n return group;\r\n\r\n // ----------------------------\r\n // | Procedures in renderNode |\r\n // ----------------------------\r\n\r\n function renderBackground(group: graphic.Group, bg: graphic.Rect, useUpperLabel: boolean) {\r\n const ecData = getECData(bg);\r\n // For tooltip.\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n\r\n bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight, r: borderRadius});\r\n\r\n if (thisInvisible) {\r\n // If invisible, do not set visual, otherwise the element will\r\n // change immediately before animation. We think it is OK to\r\n // remain its origin color when moving out of the view window.\r\n processInvisible(bg);\r\n }\r\n else {\r\n bg.invisible = false;\r\n const style = thisNode.getVisual('style') as PathStyleProps;\r\n const visualBorderColor = style.stroke;\r\n const normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualBorderColor;\r\n const emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\r\n const blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\r\n const selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\r\n\r\n if (useUpperLabel) {\r\n const upperLabelWidth = thisWidth - 2 * borderWidth;\r\n\r\n prepareText(\r\n // PENDING: convert ZRColor to ColorString for text.\r\n bg, visualBorderColor as ColorString, style.opacity,\r\n {x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight}\r\n );\r\n }\r\n // For old bg.\r\n else {\r\n bg.removeTextContent();\r\n }\r\n\r\n bg.setStyle(normalStyle);\r\n\r\n bg.ensureState('emphasis').style = emphasisStyle;\r\n bg.ensureState('blur').style = blurStyle;\r\n bg.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(bg);\r\n }\r\n\r\n group.add(bg);\r\n }\r\n\r\n function renderContent(group: graphic.Group, content: graphic.Rect) {\r\n const ecData = getECData(content);\r\n // For tooltip.\r\n ecData.dataIndex = thisNode.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n\r\n const contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\r\n const contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\r\n\r\n content.culling = true;\r\n content.setShape({\r\n x: borderWidth,\r\n y: borderWidth,\r\n width: contentWidth,\r\n height: contentHeight,\r\n r: borderRadius\r\n });\r\n\r\n if (thisInvisible) {\r\n // If invisible, do not set visual, otherwise the element will\r\n // change immediately before animation. We think it is OK to\r\n // remain its origin color when moving out of the view window.\r\n processInvisible(content);\r\n }\r\n else {\r\n content.invisible = false;\r\n const nodeStyle = thisNode.getVisual('style') as PathStyleProps;\r\n const visualColor = nodeStyle.fill;\r\n const normalStyle = getItemStyleNormal(itemStyleNormalModel);\r\n normalStyle.fill = visualColor;\r\n normalStyle.decal = nodeStyle.decal;\r\n const emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\r\n const blurStyle = getStateItemStyle(itemStyleBlurModel);\r\n const selectStyle = getStateItemStyle(itemStyleSelectModel);\r\n\r\n // PENDING: convert ZRColor to ColorString for text.\r\n prepareText(content, visualColor as ColorString, nodeStyle.opacity, null);\r\n\r\n content.setStyle(normalStyle);\r\n content.ensureState('emphasis').style = emphasisStyle;\r\n content.ensureState('blur').style = blurStyle;\r\n content.ensureState('select').style = selectStyle;\r\n setDefaultStateProxy(content);\r\n }\r\n\r\n group.add(content);\r\n }\r\n\r\n function processInvisible(element: graphic.Rect) {\r\n // Delay invisible setting utill animation finished,\r\n // avoid element vanish suddenly before animation.\r\n !element.invisible && willInvisibleEls.push(element);\r\n }\r\n\r\n function prepareText(\r\n rectEl: graphic.Rect,\r\n visualColor: ColorString,\r\n visualOpacity: number,\r\n // Can be null/undefined\r\n upperLabelRect: RectLike\r\n ) {\r\n const normalLabelModel = nodeModel.getModel(\r\n upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL\r\n );\r\n\r\n const defaultText = convertOptionIdName(nodeModel.get('name'), null);\r\n\r\n const isShow = normalLabelModel.getShallow('show');\r\n\r\n setLabelStyle(\r\n rectEl,\r\n getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL),\r\n {\r\n defaultText: isShow ? defaultText : null,\r\n inheritColor: visualColor,\r\n defaultOpacity: visualOpacity,\r\n labelFetcher: seriesModel,\r\n labelDataIndex: thisNode.dataIndex\r\n }\r\n );\r\n\r\n const textEl = rectEl.getTextContent();\r\n if (!textEl) {\r\n return;\r\n }\r\n const textStyle = textEl.style;\r\n const textPadding = normalizeCssArray(textStyle.padding || 0);\r\n\r\n if (upperLabelRect) {\r\n rectEl.setTextConfig({\r\n layoutRect: upperLabelRect\r\n });\r\n (textEl as ECElement).disableLabelLayout = true;\r\n }\r\n textEl.beforeUpdate = function () {\r\n const width = Math.max(\r\n (upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0\r\n );\r\n const height = Math.max(\r\n (upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0\r\n );\r\n if (textStyle.width !== width || textStyle.height !== height) {\r\n textEl.setStyle({\r\n width,\r\n height\r\n });\r\n }\r\n };\r\n\r\n textStyle.truncateMinChar = 2;\r\n textStyle.lineOverflow = 'truncate';\r\n\r\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\r\n const textEmphasisState = textEl.getState('emphasis');\r\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\r\n }\r\n\r\n function addDrillDownIcon(style: TextStyleProps, upperLabelRect: RectLike, thisLayout: any) {\r\n const text = style ? style.text : null;\r\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\r\n const iconChar = seriesModel.get('drillDownIcon', true);\r\n style.text = iconChar ? iconChar + ' ' + text : text;\r\n }\r\n }\r\n\r\n function giveGraphic(\r\n storageName: keyof RenderElementStorage,\r\n Ctor: {new(): T},\r\n depth?: number,\r\n z?: number\r\n ): T {\r\n let element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\r\n const lasts = lastsForAnimation[storageName];\r\n\r\n if (element) {\r\n // Remove from oldStorage\r\n oldStorage[storageName][oldRawIndex] = null;\r\n prepareAnimationWhenHasOld(lasts, element);\r\n }\r\n // If invisible and no old element, do not create new element (for optimizing).\r\n else if (!thisInvisible) {\r\n element = new Ctor();\r\n if (element instanceof Displayable) {\r\n element.z2 = calculateZ2(depth, z);\r\n }\r\n prepareAnimationWhenNoOld(lasts, element);\r\n }\r\n\r\n // Set to thisStorage\r\n return (thisStorage[storageName][thisRawIndex] = element) as T;\r\n }\r\n\r\n function prepareAnimationWhenHasOld(lasts: LastCfg[], element: graphic.Group | graphic.Rect) {\r\n const lastCfg = lasts[thisRawIndex] = {} as LastCfg;\r\n if (element instanceof Group) {\r\n lastCfg.oldX = element.x;\r\n lastCfg.oldY = element.y;\r\n }\r\n else {\r\n lastCfg.oldShape = extend({}, element.shape);\r\n }\r\n }\r\n\r\n // If a element is new, we need to find the animation start point carefully,\r\n // otherwise it will looks strange when 'zoomToNode'.\r\n function prepareAnimationWhenNoOld(lasts: LastCfg[], element: graphic.Group | graphic.Rect) {\r\n const lastCfg = lasts[thisRawIndex] = {} as LastCfg;\r\n const parentNode = thisNode.parentNode;\r\n const isGroup = element instanceof graphic.Group;\r\n\r\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\r\n let parentOldX = 0;\r\n let parentOldY = 0;\r\n\r\n // New nodes appear from right-bottom corner in 'zoomToNode' animation.\r\n // For convenience, get old bounding rect from background.\r\n const parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\r\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\r\n parentOldX = parentOldBg.oldShape.width;\r\n parentOldY = parentOldBg.oldShape.height;\r\n }\r\n\r\n // When no parent old shape found, its parent is new too,\r\n // so we can just use {x:0, y:0}.\r\n if (isGroup) {\r\n lastCfg.oldX = 0;\r\n lastCfg.oldY = parentOldY;\r\n }\r\n else {\r\n lastCfg.oldShape = {x: parentOldX, y: parentOldY, width: 0, height: 0};\r\n }\r\n }\r\n\r\n // Fade in, user can be aware that these nodes are new.\r\n lastCfg.fadein = !isGroup;\r\n }\r\n\r\n}\r\n\r\n// We cannot set all background with the same z, because the behaviour of\r\n// drill down and roll up differ background creation sequence from tree\r\n// hierarchy sequence, which cause lower background elements to overlap\r\n// upper ones. So we calculate z based on depth.\r\n// Moreover, we try to shrink down z interval to [0, 1] to avoid that\r\n// treemap with large z overlaps other components.\r\nfunction calculateZ2(depth: number, z2InLevel: number) {\r\n return depth * Z2_BASE + z2InLevel;\r\n}\r\n\r\nexport default TreemapView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as zrColor from 'zrender/src/tool/color';\r\nimport {linearMap} from '../util/number';\r\nimport { AllPropTypes, Dictionary } from 'zrender/src/core/types';\r\nimport {\r\n ColorString,\r\n BuiltinVisualProperty,\r\n VisualOptionPiecewise,\r\n VisualOptionUnit,\r\n ParsedValue\r\n} from '../util/types';\r\nimport { warn } from '../util/log';\r\n\r\nconst each = zrUtil.each;\r\nconst isObject = zrUtil.isObject;\r\n\r\nconst CATEGORY_DEFAULT_VISUAL_INDEX = -1;\r\n\r\n// Type of raw value\r\ntype RawValue = ParsedValue;\r\n// Type of mapping visual value\r\ntype VisualValue = AllPropTypes;\r\n// Type of value after normalized. 0 - 1\r\ntype NormalizedValue = number;\r\n\r\ntype MappingMethod = 'linear' | 'piecewise' | 'category' | 'fixed';\r\n\r\n// May include liftZ. which is not provided to developers.\r\n\r\ninterface Normalizer {\r\n (this: VisualMapping, value?: RawValue): NormalizedValue\r\n}\r\ninterface ColorMapper {\r\n (this: VisualMapping, value: RawValue | NormalizedValue, isNormalized?: boolean, out?: number[])\r\n : ColorString | number[]\r\n}\r\ninterface DoMap {\r\n (this: VisualMapping, normalzied?: NormalizedValue, value?: RawValue): VisualValue\r\n}\r\ninterface VisualValueGetter {\r\n (key: string): VisualValue\r\n}\r\ninterface VisualValueSetter {\r\n (key: string, value: VisualValue): void\r\n}\r\ninterface VisualHandler {\r\n applyVisual(\r\n this: VisualMapping,\r\n value: RawValue,\r\n getter: VisualValueGetter,\r\n setter: VisualValueSetter\r\n ): void\r\n\r\n _normalizedToVisual: {\r\n linear(this: VisualMapping, normalized: NormalizedValue): VisualValue\r\n category(this: VisualMapping, normalized: NormalizedValue): VisualValue\r\n piecewise(this: VisualMapping, normalzied: NormalizedValue, value: RawValue): VisualValue\r\n fixed(this: VisualMapping): VisualValue\r\n }\r\n /**\r\n * Get color mapping for the outside usage.\r\n * Currently only used in `color` visual.\r\n *\r\n * The last parameter out is cached color array.\r\n */\r\n getColorMapper?: (this: VisualMapping) => ColorMapper\r\n}\r\n\r\ninterface VisualMappingPiece {\r\n index?: number\r\n\r\n value?: number | string\r\n interval?: [number, number]\r\n close?: [0 | 1, 0 | 1]\r\n\r\n text?: string\r\n\r\n visual?: VisualOptionPiecewise\r\n}\r\n\r\nexport interface VisualMappingOption {\r\n type?: BuiltinVisualProperty\r\n\r\n mappingMethod?: MappingMethod\r\n\r\n /**\r\n * required when mappingMethod is 'linear'\r\n */\r\n dataExtent?: [number, number]\r\n /**\r\n * required when mappingMethod is 'piecewise'.\r\n * Visual for only each piece can be specified\r\n * [\r\n * {value: someValue},\r\n * {interval: [min1, max1], visual: {...}},\r\n * {interval: [min2, max2]}\r\n * ],.\r\n */\r\n pieceList?: VisualMappingPiece[]\r\n /**\r\n * required when mappingMethod is 'category'. If no option.categories, categories is set as [0, 1, 2, ...].\r\n */\r\n categories?: (string | number)[]\r\n /**\r\n * Whether loop mapping when mappingMethod is 'category'.\r\n * @default false\r\n */\r\n loop?: boolean\r\n /**\r\n * Visual data\r\n * when mappingMethod is 'category', visual data can be array or object\r\n * (like: {cate1: '#222', none: '#fff'})\r\n * or primary types (which represents default category visual), otherwise visual\r\n * can be array or primary (which will be normalized to array).\r\n */\r\n visual?: VisualValue[] | Dictionary | VisualValue\r\n}\r\n\r\ninterface VisualMappingInnerPiece extends VisualMappingPiece {\r\n originIndex: number\r\n}\r\ninterface VisualMappingInnerOption extends VisualMappingOption {\r\n hasSpecialVisual: boolean\r\n pieceList: VisualMappingInnerPiece[]\r\n /**\r\n * Map to get category index\r\n */\r\n categoryMap: Dictionary\r\n /**\r\n * Cached parsed rgba array from string to avoid parse every time.\r\n */\r\n parsedVisual: number[][]\r\n\r\n // Have converted primary value to array.\r\n visual?: VisualValue[] | Dictionary\r\n}\r\n\r\nclass VisualMapping {\r\n\r\n option: VisualMappingInnerOption;\r\n\r\n type: BuiltinVisualProperty;\r\n\r\n mappingMethod: MappingMethod;\r\n\r\n applyVisual: VisualHandler['applyVisual'];\r\n\r\n getColorMapper: VisualHandler['getColorMapper'];\r\n\r\n _normalizeData: Normalizer;\r\n\r\n _normalizedToVisual: DoMap;\r\n\r\n constructor(option: VisualMappingOption) {\r\n const mappingMethod = option.mappingMethod;\r\n const visualType = option.type;\r\n\r\n const thisOption: VisualMappingInnerOption = this.option = zrUtil.clone(option) as VisualMappingInnerOption;\r\n\r\n this.type = visualType;\r\n this.mappingMethod = mappingMethod;\r\n\r\n this._normalizeData = normalizers[mappingMethod];\r\n const visualHandler = VisualMapping.visualHandlers[visualType];\r\n\r\n this.applyVisual = visualHandler.applyVisual;\r\n\r\n this.getColorMapper = visualHandler.getColorMapper;\r\n\r\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\r\n\r\n if (mappingMethod === 'piecewise') {\r\n normalizeVisualRange(thisOption);\r\n preprocessForPiecewise(thisOption);\r\n }\r\n else if (mappingMethod === 'category') {\r\n thisOption.categories\r\n ? preprocessForSpecifiedCategory(thisOption)\r\n // categories is ordinal when thisOption.categories not specified,\r\n // which need no more preprocess except normalize visual.\r\n : normalizeVisualRange(thisOption, true);\r\n }\r\n else { // mappingMethod === 'linear' or 'fixed'\r\n zrUtil.assert(mappingMethod !== 'linear' || thisOption.dataExtent);\r\n normalizeVisualRange(thisOption);\r\n }\r\n }\r\n\r\n mapValueToVisual(value: RawValue): VisualValue {\r\n const normalized = this._normalizeData(value);\r\n return this._normalizedToVisual(normalized, value);\r\n }\r\n\r\n getNormalizer() {\r\n return zrUtil.bind(this._normalizeData, this);\r\n }\r\n\r\n static visualHandlers: {[key in BuiltinVisualProperty]: VisualHandler} = {\r\n color: {\r\n applyVisual: makeApplyVisual('color'),\r\n getColorMapper: function () {\r\n const thisOption = this.option;\r\n\r\n return zrUtil.bind(\r\n thisOption.mappingMethod === 'category'\r\n ? function (\r\n this: VisualMapping,\r\n value: NormalizedValue | RawValue,\r\n isNormalized?: boolean\r\n ): ColorString {\r\n !isNormalized && (value = this._normalizeData(value));\r\n return doMapCategory.call(this, value) as ColorString;\r\n }\r\n : function (\r\n this: VisualMapping,\r\n value: NormalizedValue | RawValue,\r\n isNormalized?: boolean,\r\n out?: number[]\r\n ): number[] | string {\r\n // If output rgb array\r\n // which will be much faster and useful in pixel manipulation\r\n const returnRGBArray = !!out;\r\n !isNormalized && (value = this._normalizeData(value));\r\n out = zrColor.fastLerp(value as NormalizedValue, thisOption.parsedVisual, out);\r\n return returnRGBArray ? out : zrColor.stringify(out, 'rgba');\r\n },\r\n this\r\n );\r\n },\r\n\r\n _normalizedToVisual: {\r\n linear: function (normalized) {\r\n return zrColor.stringify(\r\n zrColor.fastLerp(normalized, this.option.parsedVisual),\r\n 'rgba'\r\n );\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n let result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = zrColor.stringify(\r\n zrColor.fastLerp(normalized, this.option.parsedVisual),\r\n 'rgba'\r\n );\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n\r\n colorHue: makePartialColorVisualHandler(function (color: ColorString, value: number) {\r\n return zrColor.modifyHSL(color, value);\r\n }),\r\n\r\n colorSaturation: makePartialColorVisualHandler(function (color: ColorString, value: number) {\r\n return zrColor.modifyHSL(color, null, value);\r\n }),\r\n\r\n colorLightness: makePartialColorVisualHandler(function (color: ColorString, value: number) {\r\n return zrColor.modifyHSL(color, null, null, value);\r\n }),\r\n\r\n colorAlpha: makePartialColorVisualHandler(function (color: ColorString, value: number) {\r\n return zrColor.modifyAlpha(color, value);\r\n }),\r\n\r\n decal: {\r\n applyVisual: makeApplyVisual('decal'),\r\n _normalizedToVisual: {\r\n linear: null,\r\n category: doMapCategory,\r\n piecewise: null,\r\n fixed: null\r\n }\r\n },\r\n\r\n opacity: {\r\n applyVisual: makeApplyVisual('opacity'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n },\r\n\r\n liftZ: {\r\n applyVisual: makeApplyVisual('liftZ'),\r\n _normalizedToVisual: {\r\n linear: doMapFixed,\r\n category: doMapFixed,\r\n piecewise: doMapFixed,\r\n fixed: doMapFixed\r\n }\r\n },\r\n\r\n symbol: {\r\n applyVisual: function (value, getter, setter) {\r\n const symbolCfg = this.mapValueToVisual(value);\r\n setter('symbol', symbolCfg as string);\r\n },\r\n _normalizedToVisual: {\r\n linear: doMapToArray,\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n let result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = doMapToArray.call(this, normalized);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n }\r\n },\r\n\r\n symbolSize: {\r\n applyVisual: makeApplyVisual('symbolSize'),\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n }\r\n };\r\n\r\n\r\n /**\r\n * List available visual types.\r\n *\r\n * @public\r\n * @return {Array.}\r\n */\r\n static listVisualTypes() {\r\n return zrUtil.keys(VisualMapping.visualHandlers);\r\n }\r\n\r\n // /**\r\n // * @public\r\n // */\r\n // static addVisualHandler(name, handler) {\r\n // visualHandlers[name] = handler;\r\n // }\r\n\r\n /**\r\n * @public\r\n */\r\n static isValidType(visualType: string): boolean {\r\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\r\n }\r\n\r\n /**\r\n * Convenient method.\r\n * Visual can be Object or Array or primary type.\r\n */\r\n static eachVisual(\r\n visual: T | T[] | Dictionary,\r\n callback: (visual: T, key?: string | number) => void,\r\n context?: Ctx\r\n ) {\r\n if (zrUtil.isObject(visual)) {\r\n zrUtil.each(visual as Dictionary, callback, context);\r\n }\r\n else {\r\n callback.call(context, visual);\r\n }\r\n }\r\n\r\n static mapVisual(visual: T, callback: (visual: T, key?: string | number) => T, context?: Ctx): T;\r\n static mapVisual(visual: T[], callback: (visual: T, key?: string | number) => T[], context?: Ctx): T[];\r\n static mapVisual(\r\n visual: Dictionary,\r\n callback: (visual: T, key?: string | number) => Dictionary,\r\n context?: Ctx\r\n ): Dictionary;\r\n static mapVisual(\r\n visual: T | T[] | Dictionary,\r\n callback: (visual: T, key?: string | number) => T | T[] | Dictionary,\r\n context?: Ctx\r\n ) {\r\n let isPrimary: boolean;\r\n let newVisual: T | T[] | Dictionary = zrUtil.isArray(visual)\r\n ? []\r\n : zrUtil.isObject(visual)\r\n ? {}\r\n : (isPrimary = true, null);\r\n\r\n VisualMapping.eachVisual(visual, function (v, key) {\r\n const newVal = callback.call(context, v, key);\r\n isPrimary ? (newVisual = newVal) : ((newVisual as Dictionary)[key as string] = newVal as T);\r\n });\r\n return newVisual;\r\n }\r\n\r\n /**\r\n * Retrieve visual properties from given object.\r\n */\r\n static retrieveVisuals(obj: Dictionary): VisualOptionPiecewise {\r\n const ret: VisualOptionPiecewise = {};\r\n let hasVisual: boolean;\r\n\r\n obj && each(VisualMapping.visualHandlers, function (h, visualType: BuiltinVisualProperty) {\r\n if (obj.hasOwnProperty(visualType)) {\r\n (ret as any)[visualType] = obj[visualType];\r\n hasVisual = true;\r\n }\r\n });\r\n\r\n return hasVisual ? ret : null;\r\n }\r\n\r\n /**\r\n * Give order to visual types, considering colorSaturation, colorAlpha depends on color.\r\n *\r\n * @public\r\n * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}\r\n * IF Array, like: ['color', 'symbol', 'colorSaturation']\r\n * @return {Array.} Sorted visual types.\r\n */\r\n static prepareVisualTypes(\r\n visualTypes: {[key in BuiltinVisualProperty]?: any} | BuiltinVisualProperty[]\r\n ) {\r\n if (zrUtil.isArray(visualTypes)) {\r\n visualTypes = visualTypes.slice();\r\n }\r\n else if (isObject(visualTypes)) {\r\n const types: BuiltinVisualProperty[] = [];\r\n each(visualTypes, function (item: unknown, type: BuiltinVisualProperty) {\r\n types.push(type);\r\n });\r\n visualTypes = types;\r\n }\r\n else {\r\n return [];\r\n }\r\n\r\n visualTypes.sort(function (type1: BuiltinVisualProperty, type2: BuiltinVisualProperty) {\r\n // color should be front of colorSaturation, colorAlpha, ...\r\n // symbol and symbolSize do not matter.\r\n return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0)\r\n ? 1 : -1;\r\n });\r\n\r\n return visualTypes;\r\n }\r\n\r\n /**\r\n * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.\r\n * Other visuals are only depends on themself.\r\n */\r\n static dependsOn(visualType1: BuiltinVisualProperty, visualType2: BuiltinVisualProperty) {\r\n return visualType2 === 'color'\r\n ? !!(visualType1 && visualType1.indexOf(visualType2) === 0)\r\n : visualType1 === visualType2;\r\n }\r\n\r\n /**\r\n * @param value\r\n * @param pieceList [{value: ..., interval: [min, max]}, ...]\r\n * Always from small to big.\r\n * @param findClosestWhenOutside Default to be false\r\n * @return index\r\n */\r\n static findPieceIndex(value: number, pieceList: VisualMappingPiece[], findClosestWhenOutside?: boolean): number {\r\n let possibleI: number;\r\n let abs = Infinity;\r\n\r\n // value has the higher priority.\r\n for (let i = 0, len = pieceList.length; i < len; i++) {\r\n const pieceValue = pieceList[i].value;\r\n if (pieceValue != null) {\r\n if (pieceValue === value\r\n // FIXME\r\n // It is supposed to compare value according to value type of dimension,\r\n // but currently value type can exactly be string or number.\r\n // Compromise for numeric-like string (like '12'), especially\r\n // in the case that visualMap.categories is ['22', '33'].\r\n || (zrUtil.isString(pieceValue) && pieceValue === value + '')\r\n ) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(pieceValue as number, i);\r\n }\r\n }\r\n\r\n for (let i = 0, len = pieceList.length; i < len; i++) {\r\n const piece = pieceList[i];\r\n const interval = piece.interval;\r\n const close = piece.close;\r\n\r\n if (interval) {\r\n if (interval[0] === -Infinity) {\r\n if (littleThan(close[1], value, interval[1])) {\r\n return i;\r\n }\r\n }\r\n else if (interval[1] === Infinity) {\r\n if (littleThan(close[0], interval[0], value)) {\r\n return i;\r\n }\r\n }\r\n else if (\r\n littleThan(close[0], interval[0], value)\r\n && littleThan(close[1], value, interval[1])\r\n ) {\r\n return i;\r\n }\r\n findClosestWhenOutside && updatePossible(interval[0], i);\r\n findClosestWhenOutside && updatePossible(interval[1], i);\r\n }\r\n }\r\n\r\n if (findClosestWhenOutside) {\r\n return value === Infinity\r\n ? pieceList.length - 1\r\n : value === -Infinity\r\n ? 0\r\n : possibleI;\r\n }\r\n\r\n function updatePossible(val: number, index: number) {\r\n const newAbs = Math.abs(val - value);\r\n if (newAbs < abs) {\r\n abs = newAbs;\r\n possibleI = index;\r\n }\r\n }\r\n\r\n }\r\n}\r\n\r\nfunction preprocessForPiecewise(thisOption: VisualMappingInnerOption) {\r\n const pieceList = thisOption.pieceList;\r\n thisOption.hasSpecialVisual = false;\r\n\r\n zrUtil.each(pieceList, function (piece, index) {\r\n piece.originIndex = index;\r\n // piece.visual is \"result visual value\" but not\r\n // a visual range, so it does not need to be normalized.\r\n if (piece.visual != null) {\r\n thisOption.hasSpecialVisual = true;\r\n }\r\n });\r\n}\r\n\r\nfunction preprocessForSpecifiedCategory(thisOption: VisualMappingInnerOption) {\r\n // Hash categories.\r\n const categories = thisOption.categories;\r\n const categoryMap: VisualMappingInnerOption['categoryMap'] = thisOption.categoryMap = {};\r\n\r\n let visual = thisOption.visual;\r\n each(categories, function (cate, index) {\r\n categoryMap[cate] = index;\r\n });\r\n\r\n // Process visual map input.\r\n if (!zrUtil.isArray(visual)) {\r\n const visualArr: VisualValue[] = [];\r\n\r\n if (zrUtil.isObject(visual)) {\r\n each(visual, function (v, cate) {\r\n const index = categoryMap[cate];\r\n visualArr[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\r\n });\r\n }\r\n else { // Is primary type, represents default visual.\r\n visualArr[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\r\n }\r\n\r\n visual = setVisualToOption(thisOption, visualArr);\r\n }\r\n\r\n // Remove categories that has no visual,\r\n // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.\r\n for (let i = categories.length - 1; i >= 0; i--) {\r\n if (visual[i] == null) {\r\n delete categoryMap[categories[i]];\r\n categories.pop();\r\n }\r\n }\r\n}\r\n\r\nfunction normalizeVisualRange(thisOption: VisualMappingInnerOption, isCategory?: boolean) {\r\n const visual = thisOption.visual;\r\n const visualArr: VisualValue[] = [];\r\n\r\n if (zrUtil.isObject(visual)) {\r\n each(visual, function (v) {\r\n visualArr.push(v);\r\n });\r\n }\r\n else if (visual != null) {\r\n visualArr.push(visual);\r\n }\r\n\r\n const doNotNeedPair = {color: 1, symbol: 1};\r\n\r\n if (!isCategory\r\n && visualArr.length === 1\r\n && !doNotNeedPair.hasOwnProperty(thisOption.type)\r\n ) {\r\n // Do not care visualArr.length === 0, which is illegal.\r\n visualArr[1] = visualArr[0];\r\n }\r\n\r\n setVisualToOption(thisOption, visualArr);\r\n}\r\n\r\nfunction makePartialColorVisualHandler(\r\n applyValue: (prop: VisualValue, value: NormalizedValue) => VisualValue\r\n): VisualHandler {\r\n return {\r\n applyVisual: function (value, getter, setter) {\r\n // Only used in HSL\r\n const colorChannel = this.mapValueToVisual(value);\r\n // Must not be array value\r\n setter('color', applyValue(getter('color'), colorChannel as number));\r\n },\r\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\r\n };\r\n}\r\n\r\nfunction doMapToArray(this: VisualMapping, normalized: NormalizedValue): VisualValue {\r\n const visual = this.option.visual as VisualValue[];\r\n return visual[\r\n Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))\r\n ] || {} as any; // TODO {}?\r\n}\r\n\r\nfunction makeApplyVisual(visualType: string): VisualHandler['applyVisual'] {\r\n return function (value, getter, setter) {\r\n setter(visualType, this.mapValueToVisual(value));\r\n };\r\n}\r\n\r\nfunction doMapCategory(this: VisualMapping, normalized: NormalizedValue): VisualValue {\r\n const visual = this.option.visual as Dictionary;\r\n return visual[\r\n (this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX)\r\n ? normalized % visual.length\r\n : normalized\r\n ];\r\n}\r\n\r\nfunction doMapFixed(this: VisualMapping): VisualValue {\r\n // visual will be convert to array.\r\n return (this.option.visual as VisualValue[])[0];\r\n}\r\n\r\n/**\r\n * Create mapped to numeric visual\r\n */\r\nfunction createNormalizedToNumericVisual(sourceExtent: [number, number]): VisualHandler['_normalizedToVisual'] {\r\n return {\r\n linear: function (normalized) {\r\n return linearMap(normalized, sourceExtent, this.option.visual as [number, number], true);\r\n },\r\n category: doMapCategory,\r\n piecewise: function (normalized, value) {\r\n let result = getSpecifiedVisual.call(this, value);\r\n if (result == null) {\r\n result = linearMap(normalized, sourceExtent, this.option.visual as [number, number], true);\r\n }\r\n return result;\r\n },\r\n fixed: doMapFixed\r\n };\r\n}\r\n\r\nfunction getSpecifiedVisual(this: VisualMapping, value: number) {\r\n const thisOption = this.option;\r\n const pieceList = thisOption.pieceList;\r\n if (thisOption.hasSpecialVisual) {\r\n const pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\r\n const piece = pieceList[pieceIndex];\r\n if (piece && piece.visual) {\r\n return piece.visual[this.type];\r\n }\r\n }\r\n}\r\n\r\nfunction setVisualToOption(thisOption: VisualMappingInnerOption, visualArr: VisualValue[]) {\r\n thisOption.visual = visualArr;\r\n if (thisOption.type === 'color') {\r\n thisOption.parsedVisual = zrUtil.map(visualArr, function (item: string) {\r\n const color = zrColor.parse(item);\r\n if (!color && __DEV__) {\r\n warn(`'${item}' is an illegal color, fallback to '#000000'`, true);\r\n }\r\n return color || [0, 0, 0, 1];\r\n });\r\n }\r\n return visualArr;\r\n}\r\n\r\n\r\n/**\r\n * Normalizers by mapping methods.\r\n */\r\nconst normalizers: { [key in MappingMethod]: Normalizer } = {\r\n linear: function (value: RawValue): NormalizedValue {\r\n return linearMap(value as number, this.option.dataExtent, [0, 1], true);\r\n },\r\n\r\n piecewise: function (value: RawValue): NormalizedValue {\r\n const pieceList = this.option.pieceList;\r\n const pieceIndex = VisualMapping.findPieceIndex(value as number, pieceList, true);\r\n if (pieceIndex != null) {\r\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\r\n }\r\n },\r\n\r\n category: function (value: RawValue): NormalizedValue {\r\n const index: number = this.option.categories\r\n ? this.option.categoryMap[value]\r\n : value as number; // ordinal value\r\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\r\n },\r\n\r\n fixed: zrUtil.noop as Normalizer\r\n};\r\n\r\n\r\nfunction littleThan(close: boolean | 0 | 1, a: number, b: number): boolean {\r\n return close ? a <= b : a < b;\r\n}\r\n\r\nexport default VisualMapping;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport VisualMapping, { VisualMappingOption } from '../../visual/VisualMapping';\r\nimport { each, extend, isArray } from 'zrender/src/core/util';\r\nimport TreemapSeriesModel, { TreemapSeriesNodeItemOption, TreemapSeriesOption } from './TreemapSeries';\r\nimport { TreemapLayoutNode, TreemapItemLayout } from './treemapLayout';\r\nimport Model from '../../model/Model';\r\nimport { ColorString, ZRColor } from '../../util/types';\r\nimport { modifyHSL, modifyAlpha } from 'zrender/src/tool/color';\r\nimport { makeInner } from '../../util/model';\r\n\r\ntype NodeModel = Model;\r\ntype NodeItemStyleModel = Model;\r\n\r\nconst ITEM_STYLE_NORMAL = 'itemStyle';\r\n\r\nconst inner = makeInner<{\r\n drColorMappingBy: TreemapSeriesNodeItemOption['colorMappingBy']\r\n}, VisualMapping>();\r\n\r\ninterface TreemapVisual {\r\n color?: ZRColor\r\n colorAlpha?: number\r\n colorSaturation?: number\r\n}\r\n\r\ntype TreemapLevelItemStyleOption = TreemapSeriesOption['levels'][number]['itemStyle'];\r\n\r\nexport default {\r\n seriesType: 'treemap',\r\n reset(seriesModel: TreemapSeriesModel) {\r\n const tree = seriesModel.getData().tree;\r\n const root = tree.root;\r\n\r\n if (root.isRemoved()) {\r\n return;\r\n }\r\n\r\n travelTree(\r\n root, // Visual should calculate from tree root but not view root.\r\n {},\r\n seriesModel.getViewRoot().getAncestors(),\r\n seriesModel\r\n );\r\n }\r\n};\r\n\r\nfunction travelTree(\r\n node: TreemapLayoutNode,\r\n designatedVisual: TreemapVisual,\r\n viewRootAncestors: TreemapLayoutNode[],\r\n seriesModel: TreemapSeriesModel\r\n) {\r\n const nodeModel = node.getModel();\r\n const nodeLayout = node.getLayout();\r\n const data = node.hostTree.data;\r\n\r\n // Optimize\r\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\r\n return;\r\n }\r\n const nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\r\n const visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\r\n\r\n const existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n // calculate border color\r\n let borderColor = nodeItemStyleModel.get('borderColor');\r\n const borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\r\n let thisNodeColor;\r\n if (borderColorSaturation != null) {\r\n // For performance, do not always execute 'calculateColor'.\r\n thisNodeColor = calculateColor(visuals);\r\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\r\n }\r\n existsStyle.stroke = borderColor;\r\n\r\n const viewChildren = node.viewChildren;\r\n if (!viewChildren || !viewChildren.length) {\r\n thisNodeColor = calculateColor(visuals);\r\n // Apply visual to this node.\r\n existsStyle.fill = thisNodeColor;\r\n }\r\n else {\r\n const mapping = buildVisualMapping(\r\n node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren\r\n );\r\n\r\n // Designate visual to children.\r\n each(viewChildren, function (child, index) {\r\n // If higher than viewRoot, only ancestors of viewRoot is needed to visit.\r\n if (child.depth >= viewRootAncestors.length\r\n || child === viewRootAncestors[child.depth]\r\n ) {\r\n const childVisual = mapVisual(\r\n nodeModel, visuals, child, index, mapping, seriesModel\r\n );\r\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction buildVisuals(\r\n nodeItemStyleModel: Model,\r\n designatedVisual: TreemapVisual,\r\n seriesModel: TreemapSeriesModel\r\n) {\r\n const visuals = extend({}, designatedVisual);\r\n const designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\r\n\r\n each(['color', 'colorAlpha', 'colorSaturation'] as const, function (visualName) {\r\n // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel\r\n (designatedVisualItemStyle as any)[visualName] = designatedVisual[visualName];\r\n const val = nodeItemStyleModel.get(visualName);\r\n designatedVisualItemStyle[visualName] = null;\r\n\r\n val != null && ((visuals as any)[visualName] = val);\r\n });\r\n\r\n return visuals;\r\n}\r\n\r\nfunction calculateColor(visuals: TreemapVisual) {\r\n let color = getValueVisualDefine(visuals, 'color') as ColorString;\r\n\r\n if (color) {\r\n const colorAlpha = getValueVisualDefine(visuals, 'colorAlpha') as number;\r\n const colorSaturation = getValueVisualDefine(visuals, 'colorSaturation') as number;\r\n if (colorSaturation) {\r\n color = modifyHSL(color, null, null, colorSaturation);\r\n }\r\n if (colorAlpha) {\r\n color = modifyAlpha(color, colorAlpha);\r\n }\r\n\r\n return color;\r\n }\r\n}\r\n\r\nfunction calculateBorderColor(\r\n borderColorSaturation: number,\r\n thisNodeColor: ColorString\r\n) {\r\n return thisNodeColor != null\r\n // Can only be string\r\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation)\r\n : null;\r\n}\r\n\r\nfunction getValueVisualDefine(visuals: TreemapVisual, name: keyof TreemapVisual) {\r\n const value = visuals[name];\r\n if (value != null && value !== 'none') {\r\n return value;\r\n }\r\n}\r\n\r\nfunction buildVisualMapping(\r\n node: TreemapLayoutNode,\r\n nodeModel: NodeModel,\r\n nodeLayout: TreemapItemLayout,\r\n nodeItemStyleModel: NodeItemStyleModel,\r\n visuals: TreemapVisual,\r\n viewChildren: TreemapLayoutNode[]\r\n) {\r\n if (!viewChildren || !viewChildren.length) {\r\n return;\r\n }\r\n\r\n const rangeVisual = getRangeVisual(nodeModel, 'color')\r\n || (\r\n visuals.color != null\r\n && visuals.color !== 'none'\r\n && (\r\n getRangeVisual(nodeModel, 'colorAlpha')\r\n || getRangeVisual(nodeModel, 'colorSaturation')\r\n )\r\n );\r\n\r\n if (!rangeVisual) {\r\n return;\r\n }\r\n\r\n const visualMin = nodeModel.get('visualMin');\r\n const visualMax = nodeModel.get('visualMax');\r\n const dataExtent = nodeLayout.dataExtent.slice() as [number, number];\r\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\r\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\r\n\r\n const colorMappingBy = nodeModel.get('colorMappingBy');\r\n const opt: VisualMappingOption = {\r\n type: rangeVisual.name,\r\n dataExtent: dataExtent,\r\n visual: rangeVisual.range\r\n };\r\n if (opt.type === 'color'\r\n && (colorMappingBy === 'index' || colorMappingBy === 'id')\r\n ) {\r\n opt.mappingMethod = 'category';\r\n opt.loop = true;\r\n // categories is ordinal, so do not set opt.categories.\r\n }\r\n else {\r\n opt.mappingMethod = 'linear';\r\n }\r\n\r\n const mapping = new VisualMapping(opt);\r\n inner(mapping).drColorMappingBy = colorMappingBy;\r\n\r\n return mapping;\r\n}\r\n\r\n// Notice: If we don't have the attribute 'colorRange', but only use\r\n// attribute 'color' to represent both concepts of 'colorRange' and 'color',\r\n// (It means 'colorRange' when 'color' is Array, means 'color' when not array),\r\n// this problem will be encountered:\r\n// If a level-1 node doesn't have children, and its siblings have children,\r\n// and colorRange is set on level-1, then the node cannot be colored.\r\n// So we separate 'colorRange' and 'color' to different attributes.\r\nfunction getRangeVisual(nodeModel: NodeModel, name: keyof TreemapVisual) {\r\n // 'colorRange', 'colorARange', 'colorSRange'.\r\n // If not exists on this node, fetch from levels and series.\r\n const range = nodeModel.get(name);\r\n return (isArray(range) && range.length) ? {\r\n name: name,\r\n range: range\r\n } : null;\r\n}\r\n\r\nfunction mapVisual(\r\n nodeModel: NodeModel,\r\n visuals: TreemapVisual,\r\n child: TreemapLayoutNode,\r\n index: number,\r\n mapping: VisualMapping,\r\n seriesModel: TreemapSeriesModel\r\n) {\r\n const childVisuals = extend({}, visuals);\r\n\r\n if (mapping) {\r\n // Only support color, colorAlpha, colorSaturation.\r\n const mappingType = mapping.type as keyof TreemapVisual;\r\n const colorMappingBy = mappingType === 'color' && inner(mapping).drColorMappingBy;\r\n const value = colorMappingBy === 'index'\r\n ? index\r\n : colorMappingBy === 'id'\r\n ? seriesModel.mapIdToIndex(child.getId())\r\n : child.getValue(nodeModel.get('visualDimension'));\r\n\r\n (childVisuals as any)[mappingType] = mapping.mapValueToVisual(value);\r\n }\r\n\r\n return childVisuals;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The treemap layout implementation was originally copied from\r\n* \"d3.js\" with some modifications made for this project.\r\n* (See more details in the comment of the method \"squarify\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport BoundingRect, { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport {parsePercent, MAX_SAFE_INTEGER} from '../../util/number';\r\nimport * as layout from '../../util/layout';\r\nimport * as helper from '../helper/treeHelper';\r\nimport TreemapSeriesModel, { TreemapSeriesNodeItemOption } from './TreemapSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { TreeNode } from '../../data/Tree';\r\nimport Model from '../../model/Model';\r\nimport { TreemapRenderPayload, TreemapMovePayload, TreemapZoomToNodePayload } from './treemapAction';\r\n\r\nconst mathMax = Math.max;\r\nconst mathMin = Math.min;\r\nconst retrieveValue = zrUtil.retrieve;\r\nconst each = zrUtil.each;\r\n\r\nconst PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'] as const;\r\nconst PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'] as const;\r\nconst PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'] as const;\r\nconst PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'] as const;\r\n\r\nexport interface TreemapLayoutNode extends TreeNode {\r\n parentNode: TreemapLayoutNode\r\n children: TreemapLayoutNode[]\r\n viewChildren: TreemapLayoutNode[]\r\n}\r\n\r\nexport interface TreemapItemLayout extends RectLike {\r\n area: number\r\n isLeafRoot: boolean\r\n dataExtent: [number, number]\r\n\r\n borderWidth: number\r\n upperHeight: number\r\n upperLabelHeight: number\r\n\r\n isInView: boolean\r\n invisible: boolean\r\n\r\n isAboveViewRoot: boolean\r\n};\r\n\r\ntype NodeModel = Model;\r\n\r\ntype OrderBy = 'asc' | 'desc' | boolean;\r\n\r\ntype LayoutRow = TreemapLayoutNode[] & {\r\n area: number\r\n};\r\n/**\r\n * @public\r\n */\r\nexport default {\r\n seriesType: 'treemap',\r\n reset: function (\r\n seriesModel: TreemapSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload?: TreemapZoomToNodePayload | TreemapRenderPayload | TreemapMovePayload\r\n ) {\r\n // Layout result in each node:\r\n // {x, y, width, height, area, borderWidth}\r\n const ecWidth = api.getWidth();\r\n const ecHeight = api.getHeight();\r\n const seriesOption = seriesModel.option;\r\n\r\n const layoutInfo = layout.getLayoutRect(\r\n seriesModel.getBoxLayoutParams(),\r\n {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }\r\n );\r\n\r\n const size = seriesOption.size || []; // Compatible with ec2.\r\n const containerWidth = parsePercent(\r\n retrieveValue(layoutInfo.width, size[0]),\r\n ecWidth\r\n );\r\n const containerHeight = parsePercent(\r\n retrieveValue(layoutInfo.height, size[1]),\r\n ecHeight\r\n );\r\n\r\n // Fetch payload info.\r\n const payloadType = payload && payload.type;\r\n const types = ['treemapZoomToNode', 'treemapRootToNode'];\r\n const targetInfo = helper\r\n .retrieveTargetInfo(payload, types, seriesModel);\r\n const rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove')\r\n ? payload.rootRect : null;\r\n const viewRoot = seriesModel.getViewRoot();\r\n const viewAbovePath = helper.getPathToRoot(viewRoot) as TreemapLayoutNode[];\r\n\r\n if (payloadType !== 'treemapMove') {\r\n const rootSize = payloadType === 'treemapZoomToNode'\r\n ? estimateRootSize(\r\n seriesModel, targetInfo, viewRoot, containerWidth, containerHeight\r\n )\r\n : rootRect\r\n ? [rootRect.width, rootRect.height]\r\n : [containerWidth, containerHeight];\r\n\r\n let sort = seriesOption.sort;\r\n if (sort && sort !== 'asc' && sort !== 'desc') {\r\n // Default to be desc order.\r\n sort = 'desc';\r\n }\r\n const options = {\r\n squareRatio: seriesOption.squareRatio,\r\n sort: sort,\r\n leafDepth: seriesOption.leafDepth\r\n };\r\n\r\n // layout should be cleared because using updateView but not update.\r\n viewRoot.hostTree.clearLayouts();\r\n\r\n // TODO\r\n // optimize: if out of view clip, do not layout.\r\n // But take care that if do not render node out of view clip,\r\n // how to calculate start po\r\n\r\n let viewRootLayout = {\r\n x: 0,\r\n y: 0,\r\n width: rootSize[0],\r\n height: rootSize[1],\r\n area: rootSize[0] * rootSize[1]\r\n };\r\n viewRoot.setLayout(viewRootLayout);\r\n\r\n squarify(viewRoot, options, false, 0);\r\n // Supplement layout.\r\n viewRootLayout = viewRoot.getLayout();\r\n each(viewAbovePath, function (node, index) {\r\n const childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\r\n node.setLayout(zrUtil.extend(\r\n {\r\n dataExtent: [childValue, childValue],\r\n borderWidth: 0,\r\n upperHeight: 0\r\n },\r\n viewRootLayout\r\n ));\r\n });\r\n }\r\n\r\n const treeRoot = seriesModel.getData().tree.root;\r\n\r\n treeRoot.setLayout(\r\n calculateRootPosition(layoutInfo, rootRect, targetInfo),\r\n true\r\n );\r\n\r\n seriesModel.setLayoutInfo(layoutInfo);\r\n\r\n // FIXME\r\n // \u73B0\u5728\u6CA1\u6709clip\u529F\u80FD\uFF0C\u6682\u65F6\u53D6ec\u9AD8\u5BBD\u3002\r\n prunning(\r\n treeRoot,\r\n // Transform to base element coordinate system.\r\n new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight),\r\n viewAbovePath,\r\n viewRoot,\r\n 0\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Layout treemap with squarify algorithm.\r\n * The original presentation of this algorithm\r\n * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk\r\n * .\r\n * The implementation of this algorithm was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * @protected\r\n * @param {module:echarts/data/Tree~TreeNode} node\r\n * @param {Object} options\r\n * @param {string} options.sort 'asc' or 'desc'\r\n * @param {number} options.squareRatio\r\n * @param {boolean} hideChildren\r\n * @param {number} depth\r\n */\r\nfunction squarify(\r\n node: TreemapLayoutNode,\r\n options: {\r\n sort?: OrderBy\r\n squareRatio?: number\r\n leafDepth?: number\r\n },\r\n hideChildren: boolean,\r\n depth: number\r\n) {\r\n let width;\r\n let height;\r\n\r\n if (node.isRemoved()) {\r\n return;\r\n }\r\n\r\n const thisLayout = node.getLayout();\r\n width = thisLayout.width;\r\n height = thisLayout.height;\r\n\r\n // Considering border and gap\r\n const nodeModel = node.getModel();\r\n const borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\r\n const halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\r\n const upperLabelHeight = getUpperLabelHeight(nodeModel);\r\n const upperHeight = Math.max(borderWidth, upperLabelHeight);\r\n const layoutOffset = borderWidth - halfGapWidth;\r\n const layoutOffsetUpper = upperHeight - halfGapWidth;\r\n\r\n node.setLayout({\r\n borderWidth: borderWidth,\r\n upperHeight: upperHeight,\r\n upperLabelHeight: upperLabelHeight\r\n }, true);\r\n\r\n width = mathMax(width - 2 * layoutOffset, 0);\r\n height = mathMax(height - layoutOffset - layoutOffsetUpper, 0);\r\n\r\n const totalArea = width * height;\r\n const viewChildren = initChildren(\r\n node, nodeModel, totalArea, options, hideChildren, depth\r\n );\r\n\r\n if (!viewChildren.length) {\r\n return;\r\n }\r\n\r\n const rect = {x: layoutOffset, y: layoutOffsetUpper, width: width, height: height};\r\n let rowFixedLength = mathMin(width, height);\r\n let best = Infinity; // the best row score so far\r\n const row = [] as LayoutRow;\r\n row.area = 0;\r\n\r\n for (let i = 0, len = viewChildren.length; i < len;) {\r\n const child = viewChildren[i];\r\n\r\n row.push(child);\r\n row.area += child.getLayout().area;\r\n const score = worst(row, rowFixedLength, options.squareRatio);\r\n\r\n // continue with this orientation\r\n if (score <= best) {\r\n i++;\r\n best = score;\r\n }\r\n // abort, and try a different orientation\r\n else {\r\n row.area -= row.pop().getLayout().area;\r\n position(row, rowFixedLength, rect, halfGapWidth, false);\r\n rowFixedLength = mathMin(rect.width, rect.height);\r\n row.length = row.area = 0;\r\n best = Infinity;\r\n }\r\n }\r\n\r\n if (row.length) {\r\n position(row, rowFixedLength, rect, halfGapWidth, true);\r\n }\r\n\r\n if (!hideChildren) {\r\n const childrenVisibleMin = nodeModel.get('childrenVisibleMin');\r\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\r\n hideChildren = true;\r\n }\r\n }\r\n\r\n for (let i = 0, len = viewChildren.length; i < len; i++) {\r\n squarify(viewChildren[i], options, hideChildren, depth + 1);\r\n }\r\n}\r\n\r\n/**\r\n * Set area to each child, and calculate data extent for visual coding.\r\n */\r\nfunction initChildren(\r\n node: TreemapLayoutNode,\r\n nodeModel: NodeModel,\r\n totalArea: number,\r\n options: {\r\n sort?: OrderBy\r\n leafDepth?: number\r\n },\r\n hideChildren: boolean,\r\n depth: number\r\n) {\r\n let viewChildren = node.children || [];\r\n let orderBy = options.sort;\r\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\r\n\r\n const overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;\r\n\r\n // leafDepth has higher priority.\r\n if (hideChildren && !overLeafDepth) {\r\n return (node.viewChildren = []);\r\n }\r\n\r\n // Sort children, order by desc.\r\n viewChildren = zrUtil.filter(viewChildren, function (child) {\r\n return !child.isRemoved();\r\n });\r\n\r\n sort(viewChildren, orderBy);\r\n\r\n const info = statistic(nodeModel, viewChildren, orderBy);\r\n\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n\r\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\r\n\r\n if (info.sum === 0) {\r\n return (node.viewChildren = []);\r\n }\r\n\r\n // Set area to each child.\r\n for (let i = 0, len = viewChildren.length; i < len; i++) {\r\n const area = viewChildren[i].getValue() as number / info.sum * totalArea;\r\n // Do not use setLayout({...}, true), because it is needed to clear last layout.\r\n viewChildren[i].setLayout({\r\n area: area\r\n });\r\n }\r\n\r\n if (overLeafDepth) {\r\n viewChildren.length && node.setLayout({\r\n isLeafRoot: true\r\n }, true);\r\n viewChildren.length = 0;\r\n }\r\n\r\n node.viewChildren = viewChildren;\r\n node.setLayout({\r\n dataExtent: info.dataExtent\r\n }, true);\r\n\r\n return viewChildren;\r\n}\r\n\r\n/**\r\n * Consider 'visibleMin'. Modify viewChildren and get new sum.\r\n */\r\nfunction filterByThreshold(\r\n nodeModel: NodeModel,\r\n totalArea: number,\r\n sum: number,\r\n orderBy: OrderBy,\r\n orderedChildren: TreemapLayoutNode[]\r\n) {\r\n\r\n // visibleMin is not supported yet when no option.sort.\r\n if (!orderBy) {\r\n return sum;\r\n }\r\n\r\n const visibleMin = nodeModel.get('visibleMin');\r\n const len = orderedChildren.length;\r\n let deletePoint = len;\r\n\r\n // Always travel from little value to big value.\r\n for (let i = len - 1; i >= 0; i--) {\r\n const value = orderedChildren[\r\n orderBy === 'asc' ? len - i - 1 : i\r\n ].getValue() as number;\r\n\r\n if (value / sum * totalArea < visibleMin) {\r\n deletePoint = i;\r\n sum -= value;\r\n }\r\n }\r\n\r\n orderBy === 'asc'\r\n ? orderedChildren.splice(0, len - deletePoint)\r\n : orderedChildren.splice(deletePoint, len - deletePoint);\r\n\r\n return sum;\r\n}\r\n\r\n/**\r\n * Sort\r\n */\r\nfunction sort(\r\n viewChildren: TreemapLayoutNode[],\r\n orderBy: OrderBy\r\n) {\r\n if (orderBy) {\r\n viewChildren.sort(function (a, b) {\r\n const diff = orderBy === 'asc'\r\n ? a.getValue() as number - (b.getValue() as number)\r\n : b.getValue() as number - (a.getValue() as number);\r\n return diff === 0\r\n ? (orderBy === 'asc'\r\n ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex\r\n )\r\n : diff;\r\n });\r\n }\r\n return viewChildren;\r\n}\r\n\r\n/**\r\n * Statistic\r\n */\r\nfunction statistic(\r\n nodeModel: NodeModel,\r\n children: TreemapLayoutNode[],\r\n orderBy: OrderBy\r\n) {\r\n // Calculate sum.\r\n let sum = 0;\r\n for (let i = 0, len = children.length; i < len; i++) {\r\n sum += children[i].getValue() as number;\r\n }\r\n\r\n // Statistic data extent for latter visual coding.\r\n // Notice: data extent should be calculate based on raw children\r\n // but not filtered view children, otherwise visual mapping will not\r\n // be stable when zoom (where children is filtered by visibleMin).\r\n\r\n const dimension = nodeModel.get('visualDimension');\r\n let dataExtent: number[];\r\n\r\n // The same as area dimension.\r\n if (!children || !children.length) {\r\n dataExtent = [NaN, NaN];\r\n }\r\n else if (dimension === 'value' && orderBy) {\r\n dataExtent = [\r\n children[children.length - 1].getValue() as number,\r\n children[0].getValue() as number\r\n ];\r\n orderBy === 'asc' && dataExtent.reverse();\r\n }\r\n // Other dimension.\r\n else {\r\n dataExtent = [Infinity, -Infinity];\r\n each(children, function (child) {\r\n const value = child.getValue(dimension) as number;\r\n value < dataExtent[0] && (dataExtent[0] = value);\r\n value > dataExtent[1] && (dataExtent[1] = value);\r\n });\r\n }\r\n\r\n return {sum: sum, dataExtent: dataExtent};\r\n}\r\n\r\n/**\r\n * Computes the score for the specified row,\r\n * as the worst aspect ratio.\r\n */\r\nfunction worst(row: LayoutRow, rowFixedLength: number, ratio: number) {\r\n let areaMax = 0;\r\n let areaMin = Infinity;\r\n\r\n for (let i = 0, area, len = row.length; i < len; i++) {\r\n area = row[i].getLayout().area;\r\n if (area) {\r\n area < areaMin && (areaMin = area);\r\n area > areaMax && (areaMax = area);\r\n }\r\n }\r\n\r\n const squareArea = row.area * row.area;\r\n const f = rowFixedLength * rowFixedLength * ratio;\r\n\r\n return squareArea\r\n ? mathMax(\r\n (f * areaMax) / squareArea,\r\n squareArea / (f * areaMin)\r\n )\r\n : Infinity;\r\n}\r\n\r\n/**\r\n * Positions the specified row of nodes. Modifies `rect`.\r\n */\r\nfunction position(\r\n row: LayoutRow,\r\n rowFixedLength: number,\r\n rect: RectLike,\r\n halfGapWidth: number,\r\n flush?: boolean\r\n) {\r\n // When rowFixedLength === rect.width,\r\n // it is horizontal subdivision,\r\n // rowFixedLength is the width of the subdivision,\r\n // rowOtherLength is the height of the subdivision,\r\n // and nodes will be positioned from left to right.\r\n\r\n // wh[idx0WhenH] means: when horizontal,\r\n // wh[idx0WhenH] => wh[0] => 'width'.\r\n // xy[idx1WhenH] => xy[1] => 'y'.\r\n const idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\r\n const idx1WhenH = 1 - idx0WhenH;\r\n const xy = ['x', 'y'] as const;\r\n const wh = ['width', 'height'] as const;\r\n\r\n let last = rect[xy[idx0WhenH]];\r\n let rowOtherLength = rowFixedLength\r\n ? row.area / rowFixedLength : 0;\r\n\r\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\r\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\r\n }\r\n for (let i = 0, rowLen = row.length; i < rowLen; i++) {\r\n const node = row[i];\r\n const nodeLayout = {} as TreemapItemLayout;\r\n const step = rowOtherLength\r\n ? node.getLayout().area / rowOtherLength : 0;\r\n\r\n const wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0);\r\n\r\n // We use Math.max/min to avoid negative width/height when considering gap width.\r\n const remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\r\n const modWH = (i === rowLen - 1 || remain < step) ? remain : step;\r\n const wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);\r\n\r\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);\r\n nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);\r\n\r\n last += modWH;\r\n node.setLayout(nodeLayout, true);\r\n }\r\n\r\n rect[xy[idx1WhenH]] += rowOtherLength;\r\n rect[wh[idx1WhenH]] -= rowOtherLength;\r\n}\r\n\r\n// Return [containerWidth, containerHeight] as default.\r\nfunction estimateRootSize(\r\n seriesModel: TreemapSeriesModel,\r\n targetInfo: { node: TreemapLayoutNode },\r\n viewRoot: TreemapLayoutNode,\r\n containerWidth: number,\r\n containerHeight: number\r\n) {\r\n // If targetInfo.node exists, we zoom to the node,\r\n // so estimate whole width and height by target node.\r\n let currNode = (targetInfo || {}).node;\r\n const defaultSize = [containerWidth, containerHeight];\r\n\r\n if (!currNode || currNode === viewRoot) {\r\n return defaultSize;\r\n }\r\n\r\n let parent;\r\n const viewArea = containerWidth * containerHeight;\r\n let area = viewArea * seriesModel.option.zoomToNodeRatio;\r\n\r\n while (parent = currNode.parentNode) { // jshint ignore:line\r\n let sum = 0;\r\n const siblings = parent.children;\r\n\r\n for (let i = 0, len = siblings.length; i < len; i++) {\r\n sum += siblings[i].getValue() as number;\r\n }\r\n const currNodeValue = currNode.getValue() as number;\r\n if (currNodeValue === 0) {\r\n return defaultSize;\r\n }\r\n area *= sum / currNodeValue;\r\n\r\n // Considering border, suppose aspect ratio is 1.\r\n const parentModel = parent.getModel();\r\n const borderWidth = parentModel.get(PATH_BORDER_WIDTH);\r\n const upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\r\n area += 4 * borderWidth * borderWidth\r\n + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\r\n\r\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\r\n\r\n currNode = parent;\r\n }\r\n\r\n area < viewArea && (area = viewArea);\r\n const scale = Math.pow(area / viewArea, 0.5);\r\n\r\n return [containerWidth * scale, containerHeight * scale];\r\n}\r\n\r\n// Root position based on coord of containerGroup\r\nfunction calculateRootPosition(\r\n layoutInfo: layout.LayoutRect,\r\n rootRect: RectLike,\r\n targetInfo: { node: TreemapLayoutNode }\r\n) {\r\n if (rootRect) {\r\n return {x: rootRect.x, y: rootRect.y};\r\n }\r\n\r\n const defaultPosition = {x: 0, y: 0};\r\n if (!targetInfo) {\r\n return defaultPosition;\r\n }\r\n\r\n // If targetInfo is fetched by 'retrieveTargetInfo',\r\n // old tree and new tree are the same tree,\r\n // so the node still exists and we can visit it.\r\n\r\n const targetNode = targetInfo.node;\r\n const layout = targetNode.getLayout();\r\n\r\n if (!layout) {\r\n return defaultPosition;\r\n }\r\n\r\n // Transform coord from local to container.\r\n const targetCenter = [layout.width / 2, layout.height / 2];\r\n let node = targetNode;\r\n while (node) {\r\n const nodeLayout = node.getLayout();\r\n targetCenter[0] += nodeLayout.x;\r\n targetCenter[1] += nodeLayout.y;\r\n node = node.parentNode;\r\n }\r\n\r\n return {\r\n x: layoutInfo.width / 2 - targetCenter[0],\r\n y: layoutInfo.height / 2 - targetCenter[1]\r\n };\r\n}\r\n\r\n// Mark nodes visible for prunning when visual coding and rendering.\r\n// Prunning depends on layout and root position, so we have to do it after layout.\r\nfunction prunning(\r\n node: TreemapLayoutNode,\r\n clipRect: BoundingRect,\r\n viewAbovePath: TreemapLayoutNode[],\r\n viewRoot: TreemapLayoutNode,\r\n depth: number\r\n) {\r\n const nodeLayout = node.getLayout();\r\n const nodeInViewAbovePath = viewAbovePath[depth];\r\n const isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\r\n\r\n if (\r\n (nodeInViewAbovePath && !isAboveViewRoot)\r\n || (depth === viewAbovePath.length && node !== viewRoot)\r\n ) {\r\n return;\r\n }\r\n\r\n node.setLayout({\r\n // isInView means: viewRoot sub tree + viewAbovePath\r\n isInView: true,\r\n // invisible only means: outside view clip so that the node can not\r\n // see but still layout for animation preparation but not render.\r\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\r\n isAboveViewRoot\r\n }, true);\r\n\r\n // Transform to child coordinate.\r\n const childClipRect = new BoundingRect(\r\n clipRect.x - nodeLayout.x,\r\n clipRect.y - nodeLayout.y,\r\n clipRect.width,\r\n clipRect.height\r\n );\r\n\r\n each(node.viewChildren || [], function (child) {\r\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\r\n });\r\n}\r\n\r\nfunction getUpperLabelHeight(model: NodeModel): number {\r\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport { installTreemapAction } from './treemapAction';\r\nimport TreemapSeriesModel from './TreemapSeries';\r\nimport TreemapView from './TreemapView';\r\nimport treemapVisual from './treemapVisual';\r\nimport treemapLayout from './treemapLayout';\r\n\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerSeriesModel(TreemapSeriesModel);\r\n registers.registerChartView(TreemapView);\r\n registers.registerVisual(treemapVisual);\r\n registers.registerLayout(treemapLayout);\r\n\r\n installTreemapAction(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../../model/Global';\r\nimport GraphSeriesModel, { GraphNodeItemOption } from './GraphSeries';\r\nimport type LegendModel from '../../component/legend/LegendModel';\r\nimport { isNumber } from 'zrender/src/core/util';\r\n\r\nexport default function categoryFilter(ecModel: GlobalModel) {\r\n const legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n }) as LegendModel[];\r\n if (!legendModels || !legendModels.length) {\r\n return;\r\n }\r\n ecModel.eachSeriesByType('graph', function (graphSeries: GraphSeriesModel) {\r\n const categoriesData = graphSeries.getCategoriesData();\r\n const graph = graphSeries.getGraph();\r\n const data = graph.data;\r\n\r\n const categoryNames = categoriesData.mapArray(categoriesData.getName);\r\n\r\n data.filterSelf(function (idx) {\r\n const model = data.getItemModel(idx);\r\n let category = model.getShallow('category');\r\n if (category != null) {\r\n if (isNumber(category)) {\r\n category = categoryNames[category];\r\n }\r\n // If in any legend component the status is not selected.\r\n for (let i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(category)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../../model/Global';\r\nimport GraphSeriesModel, { GraphNodeItemOption } from './GraphSeries';\r\nimport { Dictionary, ColorString } from '../../util/types';\r\nimport { extend, isString } from 'zrender/src/core/util';\r\n\r\nexport default function categoryVisual(ecModel: GlobalModel) {\r\n\r\n const paletteScope: Dictionary = {};\r\n ecModel.eachSeriesByType('graph', function (seriesModel: GraphSeriesModel) {\r\n const categoriesData = seriesModel.getCategoriesData();\r\n const data = seriesModel.getData();\r\n\r\n const categoryNameIdxMap: Dictionary = {};\r\n\r\n categoriesData.each(function (idx) {\r\n const name = categoriesData.getName(idx);\r\n // Add prefix to avoid conflict with Object.prototype.\r\n categoryNameIdxMap['ec-' + name] = idx;\r\n const itemModel = categoriesData.getItemModel(idx);\r\n\r\n const style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (!style.fill) {\r\n // Get color from palette.\r\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\r\n }\r\n categoriesData.setItemVisual(idx, 'style', style);\r\n\r\n const symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'] as const;\r\n\r\n for (let i = 0; i < symbolVisualList.length; i++) {\r\n const symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\r\n if (symbolVisual != null) {\r\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\r\n }\r\n }\r\n });\r\n\r\n // Assign category color to visual\r\n if (categoriesData.count()) {\r\n data.each(function (idx) {\r\n const model = data.getItemModel(idx);\r\n let categoryIdx = model.getShallow('category');\r\n if (categoryIdx != null) {\r\n if (isString(categoryIdx)) {\r\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\r\n }\r\n\r\n const categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\r\n const style = data.ensureUniqueItemVisual(idx, 'style');\r\n extend(style, categoryStyle);\r\n\r\n const visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'] as const;\r\n\r\n for (let i = 0; i < visualList.length; i++) {\r\n data.setItemVisual(\r\n idx, visualList[i],\r\n categoriesData.getItemVisual(categoryIdx, visualList[i])\r\n );\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../../model/Global';\r\nimport GraphSeriesModel, { GraphEdgeItemOption } from './GraphSeries';\r\nimport { extend } from 'zrender/src/core/util';\r\n\r\nfunction normalize(a: string | string[]): string[];\r\nfunction normalize(a: number | number[]): number[];\r\nfunction normalize(a: string | number | (string | number)[]): (string | number)[] {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n}\r\n\r\nexport default function graphEdgeVisual(ecModel: GlobalModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel: GraphSeriesModel) {\r\n const graph = seriesModel.getGraph();\r\n const edgeData = seriesModel.getEdgeData();\r\n const symbolType = normalize(seriesModel.get('edgeSymbol'));\r\n const symbolSize = normalize(seriesModel.get('edgeSymbolSize'));\r\n\r\n // const colorQuery = ['lineStyle', 'color'] as const;\r\n // const opacityQuery = ['lineStyle', 'opacity'] as const;\r\n\r\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\r\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n\r\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\r\n\r\n edgeData.each(function (idx) {\r\n const itemModel = edgeData.getItemModel(idx);\r\n const edge = graph.getEdgeByIndex(idx);\r\n const symbolType = normalize(itemModel.getShallow('symbol', true));\r\n const symbolSize = normalize(itemModel.getShallow('symbolSize', true));\r\n // Edge visual must after node visual\r\n const style = itemModel.getModel('lineStyle').getLineStyle();\r\n\r\n const existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\r\n extend(existsStyle, style);\r\n\r\n switch (existsStyle.stroke) {\r\n case 'source': {\r\n const nodeStyle = edge.node1.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n case 'target': {\r\n const nodeStyle = edge.node2.getVisual('style');\r\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\r\n break;\r\n }\r\n }\r\n\r\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\r\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\r\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\r\n });\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// @ts-nocheck\r\nimport * as zrUtil from 'zrender/src/core/util';\r\n\r\nconst KEY_DELIMITER = '-->';\r\n/**\r\n * params handler\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @returns {*}\r\n */\r\nconst getAutoCurvenessParams = function (seriesModel) {\r\n return seriesModel.get('autoCurveness') || null;\r\n};\r\n\r\n/**\r\n * Generate a list of edge curvatures, 20 is the default\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param {number} appendLength\r\n * @return 20 => [0, -0.2, 0.2, -0.4, 0.4, -0.6, 0.6, -0.8, 0.8, -1, 1, -1.2, 1.2, -1.4, 1.4, -1.6, 1.6, -1.8, 1.8, -2]\r\n */\r\nconst createCurveness = function (seriesModel, appendLength) {\r\n const autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\r\n let length = 20;\r\n let curvenessList = [];\r\n\r\n // handler the function set\r\n if (zrUtil.isNumber(autoCurvenessParmas)) {\r\n length = autoCurvenessParmas;\r\n }\r\n else if (zrUtil.isArray(autoCurvenessParmas)) {\r\n seriesModel.__curvenessList = autoCurvenessParmas;\r\n return;\r\n }\r\n\r\n // append length\r\n if (appendLength > length) {\r\n length = appendLength;\r\n }\r\n\r\n // make sure the length is even\r\n const len = length % 2 ? length + 2 : length + 3;\r\n curvenessList = [];\r\n\r\n for (let i = 0; i < len; i++) {\r\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\r\n }\r\n seriesModel.__curvenessList = curvenessList;\r\n};\r\n\r\n/**\r\n * Create different cache key data in the positive and negative directions, in order to set the curvature later\r\n * @param {number|string|module:echarts/data/Graph.Node} n1\r\n * @param {number|string|module:echarts/data/Graph.Node} n2\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @returns {string} key\r\n */\r\nconst getKeyOfEdges = function (n1, n2, seriesModel) {\r\n const source = [n1.id, n1.dataIndex].join('.');\r\n const target = [n2.id, n2.dataIndex].join('.');\r\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\r\n};\r\n\r\n/**\r\n * get opposite key\r\n * @param {string} key\r\n * @returns {string}\r\n */\r\nconst getOppositeKey = function (key) {\r\n const keys = key.split(KEY_DELIMITER);\r\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\r\n};\r\n\r\n/**\r\n * get edgeMap with key\r\n * @param edge\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n */\r\nconst getEdgeFromMap = function (edge, seriesModel) {\r\n const key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n return seriesModel.__edgeMap[key];\r\n};\r\n\r\n/**\r\n * calculate all cases total length\r\n * @param edge\r\n * @param seriesModel\r\n * @returns {number}\r\n */\r\nconst getTotalLengthBetweenNodes = function (edge, seriesModel) {\r\n const len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\r\n const lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\r\n\r\n return len + lenV;\r\n};\r\n\r\n/**\r\n *\r\n * @param key\r\n */\r\nconst getEdgeMapLengthWithKey = function (key, seriesModel) {\r\n const edgeMap = seriesModel.__edgeMap;\r\n return edgeMap[key] ? edgeMap[key].length : 0;\r\n};\r\n\r\n/**\r\n * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge\r\n * @see /graph/GraphSeries.js@getInitialData\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n */\r\nexport function initCurvenessList(seriesModel) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n\r\n seriesModel.__curvenessList = [];\r\n seriesModel.__edgeMap = {};\r\n // calc the array of curveness List\r\n createCurveness(seriesModel);\r\n}\r\n\r\n/**\r\n * set edgeMap with key\r\n * @param {number|string|module:echarts/data/Graph.Node} n1\r\n * @param {number|string|module:echarts/data/Graph.Node} n2\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param {number} index\r\n */\r\nexport function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\r\n if (!getAutoCurvenessParams(seriesModel)) {\r\n return;\r\n }\r\n\r\n const key = getKeyOfEdges(n1, n2, seriesModel);\r\n const edgeMap = seriesModel.__edgeMap;\r\n const oppositeEdges = edgeMap[getOppositeKey(key)];\r\n // set direction\r\n if (edgeMap[key] && !oppositeEdges) {\r\n edgeMap[key].isForward = true;\r\n }\r\n else if (oppositeEdges && edgeMap[key]) {\r\n oppositeEdges.isForward = true;\r\n edgeMap[key].isForward = false;\r\n }\r\n\r\n edgeMap[key] = edgeMap[key] || [];\r\n edgeMap[key].push(index);\r\n}\r\n\r\n/**\r\n * get curvature for edge\r\n * @param edge\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param index\r\n */\r\nexport function getCurvenessForEdge(edge, seriesModel, index, needReverse?: boolean) {\r\n const autoCurvenessParams = getAutoCurvenessParams(seriesModel);\r\n const isArrayParam = zrUtil.isArray(autoCurvenessParams);\r\n if (!autoCurvenessParams) {\r\n return null;\r\n }\r\n\r\n const edgeArray = getEdgeFromMap(edge, seriesModel);\r\n if (!edgeArray) {\r\n return null;\r\n }\r\n\r\n let edgeIndex = -1;\r\n for (let i = 0; i < edgeArray.length; i++) {\r\n if (edgeArray[i] === index) {\r\n edgeIndex = i;\r\n break;\r\n }\r\n }\r\n // if totalLen is Longer createCurveness\r\n const totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\r\n createCurveness(seriesModel, totalLen);\r\n\r\n edge.lineStyle = edge.lineStyle || {};\r\n // if is opposite edge, must set curvenss to opposite number\r\n const curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\r\n const curvenessList = seriesModel.__curvenessList;\r\n // if pass array no need parity\r\n const parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\r\n\r\n if (!edgeArray.isForward) {\r\n // the opposite edge show outside\r\n const oppositeKey = getOppositeKey(curKey);\r\n const len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\r\n const resValue = curvenessList[edgeIndex + len + parityCorrection];\r\n // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite\r\n if (needReverse) {\r\n // set as array may make the parity handle with the len of opposite\r\n if (isArrayParam) {\r\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n else {\r\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return (len + parityCorrection) % 2 ? resValue : -resValue;\r\n }\r\n }\r\n else {\r\n return curvenessList[edgeIndex + len + parityCorrection];\r\n }\r\n }\r\n else {\r\n return curvenessList[parityCorrection + edgeIndex];\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport GraphSeriesModel, { GraphNodeItemOption, GraphEdgeItemOption } from './GraphSeries';\r\nimport Graph from '../../data/Graph';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {getCurvenessForEdge} from '../helper/multipleGraphEdgeHelper';\r\n\r\n\r\nexport function simpleLayout(seriesModel: GraphSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n const graph = seriesModel.getGraph();\r\n\r\n graph.eachNode(function (node) {\r\n const model = node.getModel();\r\n node.setLayout([+model.get('x'), +model.get('y')]);\r\n });\r\n\r\n simpleLayoutEdge(graph, seriesModel);\r\n}\r\n\r\nexport function simpleLayoutEdge(graph: Graph, seriesModel: GraphSeriesModel) {\r\n graph.eachEdge(function (edge, index) {\r\n const curveness = zrUtil.retrieve3(\r\n edge.getModel().get(['lineStyle', 'curveness']),\r\n -getCurvenessForEdge(edge, seriesModel, index, true),\r\n 0\r\n );\r\n const p1 = vec2.clone(edge.node1.getLayout());\r\n const p2 = vec2.clone(edge.node2.getLayout());\r\n const points = [p1, p2];\r\n if (+curveness) {\r\n points.push([\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness\r\n ]);\r\n }\r\n edge.setLayout(points);\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {each} from 'zrender/src/core/util';\r\nimport {simpleLayout, simpleLayoutEdge} from './simpleLayoutHelper';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GraphSeriesModel from './GraphSeries';\r\n\r\nexport default function graphSimpleLayout(ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel: GraphSeriesModel) {\r\n const layout = seriesModel.get('layout');\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n const data = seriesModel.getData();\r\n\r\n let dimensions: string[] = [];\r\n each(coordSys.dimensions, function (coordDim) {\r\n dimensions = dimensions.concat(data.mapDimensionsAll(coordDim));\r\n });\r\n\r\n for (let dataIndex = 0; dataIndex < data.count(); dataIndex++) {\r\n const value = [];\r\n let hasValue = false;\r\n for (let i = 0; i < dimensions.length; i++) {\r\n const val = data.get(dimensions[i], dataIndex) as number;\r\n if (!isNaN(val)) {\r\n hasValue = true;\r\n }\r\n value.push(val);\r\n }\r\n if (hasValue) {\r\n data.setItemLayout(dataIndex, coordSys.dataToPoint(value));\r\n }\r\n else {\r\n // Also {Array.}, not undefined to avoid if...else... statement\r\n data.setItemLayout(dataIndex, [NaN, NaN]);\r\n }\r\n }\r\n\r\n simpleLayoutEdge(data.graph, seriesModel);\r\n }\r\n else if (!layout || layout === 'none') {\r\n simpleLayout(seriesModel);\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GraphSeriesModel from './GraphSeries';\r\nimport View from '../../coord/View';\r\nimport { GraphNode } from '../../data/Graph';\r\n\r\nexport function getNodeGlobalScale(seriesModel: GraphSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem as View;\r\n if (coordSys.type !== 'view') {\r\n return 1;\r\n }\r\n\r\n const nodeScaleRatio = seriesModel.option.nodeScaleRatio;\r\n\r\n const groupZoom = coordSys.scaleX;\r\n // Scale node when zoom changes\r\n const roamZoom = coordSys.getZoom();\r\n const nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\r\n\r\n return nodeScale / groupZoom;\r\n}\r\n\r\nexport function getSymbolSize(node: GraphNode) {\r\n let symbolSize = node.getVisual('symbolSize');\r\n if (symbolSize instanceof Array) {\r\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\r\n }\r\n return +symbolSize;\r\n}\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport {getSymbolSize, getNodeGlobalScale} from './graphHelper';\r\nimport GraphSeriesModel, { GraphEdgeItemOption, GraphNodeItemOption } from './GraphSeries';\r\nimport Graph, { GraphNode } from '../../data/Graph';\r\nimport Symbol from '../helper/Symbol';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {getCurvenessForEdge} from '../helper/multipleGraphEdgeHelper';\r\n\r\nconst PI = Math.PI;\r\n\r\nconst _symbolRadiansHalf: number[] = [];\r\n\r\n/**\r\n * `basedOn` can be:\r\n * 'value':\r\n * This layout is not accurate and have same bad case. For example,\r\n * if the min value is very smaller than the max value, the nodes\r\n * with the min value probably overlap even though there is enough\r\n * space to layout them. So we only use this approach in the as the\r\n * init layout of the force layout.\r\n * FIXME\r\n * Probably we do not need this method any more but use\r\n * `basedOn: 'symbolSize'` in force layout if\r\n * delay its init operations to GraphView.\r\n * 'symbolSize':\r\n * This approach work only if all of the symbol size calculated.\r\n * That is, the progressive rendering is not applied to graph.\r\n * FIXME\r\n * If progressive rendering is applied to graph some day,\r\n * probably we have to use `basedOn: 'value'`.\r\n */\r\nexport function circularLayout(\r\n seriesModel: GraphSeriesModel,\r\n basedOn: 'value' | 'symbolSize',\r\n draggingNode?: GraphNode,\r\n pointer?: [number, number]\r\n) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n\r\n const rect = coordSys.getBoundingRect();\r\n\r\n const nodeData = seriesModel.getData();\r\n const graph = nodeData.graph;\r\n\r\n const cx = rect.width / 2 + rect.x;\r\n const cy = rect.height / 2 + rect.y;\r\n const r = Math.min(rect.width, rect.height) / 2;\r\n const count = nodeData.count();\r\n\r\n nodeData.setLayout({\r\n cx: cx,\r\n cy: cy\r\n });\r\n\r\n if (!count) {\r\n return;\r\n }\r\n\r\n if (draggingNode) {\r\n const [tempX, tempY] = coordSys.pointToData(pointer) as [number, number];\r\n const v = [tempX - cx, tempY - cy];\r\n vec2.normalize(v, v);\r\n vec2.scale(v, v, r);\r\n draggingNode.setLayout([cx + v[0], cy + v[1]], true);\r\n\r\n const circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']);\r\n rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy);\r\n }\r\n\r\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\r\n\r\n graph.eachEdge(function (edge, index) {\r\n let curveness = zrUtil.retrieve3(\r\n edge.getModel().get(['lineStyle', 'curveness']),\r\n getCurvenessForEdge(edge, seriesModel, index),\r\n 0\r\n );\r\n const p1 = vec2.clone(edge.node1.getLayout());\r\n const p2 = vec2.clone(edge.node2.getLayout());\r\n let cp1;\r\n const x12 = (p1[0] + p2[0]) / 2;\r\n const y12 = (p1[1] + p2[1]) / 2;\r\n if (+curveness) {\r\n curveness *= 3;\r\n cp1 = [\r\n cx * curveness + x12 * (1 - curveness),\r\n cy * curveness + y12 * (1 - curveness)\r\n ];\r\n }\r\n edge.setLayout([p1, p2, cp1]);\r\n });\r\n}\r\n\r\ninterface LayoutNode {\r\n (\r\n seriesModel: GraphSeriesModel,\r\n graph: Graph,\r\n nodeData: SeriesData,\r\n r: number,\r\n cx: number,\r\n cy: number,\r\n count: number\r\n ): void\r\n}\r\n\r\nconst _layoutNodesBasedOn: Record<'value' | 'symbolSize', LayoutNode> = {\r\n\r\n value(seriesModel, graph, nodeData, r, cx, cy, count) {\r\n let angle = 0;\r\n const sum = nodeData.getSum('value');\r\n const unitAngle = Math.PI * 2 / (sum || count);\r\n\r\n graph.eachNode(function (node) {\r\n const value = node.getValue('value') as number;\r\n const radianHalf = unitAngle * (sum ? value : 1) / 2;\r\n\r\n angle += radianHalf;\r\n node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n },\r\n\r\n symbolSize(seriesModel, graph, nodeData, r, cx, cy, count) {\r\n let sumRadian = 0;\r\n _symbolRadiansHalf.length = count;\r\n\r\n const nodeScale = getNodeGlobalScale(seriesModel);\r\n\r\n graph.eachNode(function (node) {\r\n let symbolSize = getSymbolSize(node);\r\n\r\n // Normally this case will not happen, but we still add\r\n // some the defensive code (2px is an arbitrary value).\r\n isNaN(symbolSize) && (symbolSize = 2);\r\n symbolSize < 0 && (symbolSize = 0);\r\n\r\n symbolSize *= nodeScale;\r\n\r\n let symbolRadianHalf = Math.asin(symbolSize / 2 / r);\r\n // when `symbolSize / 2` is bigger than `r`.\r\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\r\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\r\n sumRadian += symbolRadianHalf * 2;\r\n });\r\n\r\n const halfRemainRadian = (2 * PI - sumRadian) / count / 2;\r\n\r\n let angle = 0;\r\n graph.eachNode(function (node) {\r\n const radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\r\n\r\n angle += radianHalf;\r\n // init circular layout for\r\n // 1. layout undefined node\r\n // 2. not fixed node\r\n (!node.getLayout() || !node.getLayout().fixed)\r\n && node.setLayout([\r\n r * Math.cos(angle) + cx,\r\n r * Math.sin(angle) + cy\r\n ]);\r\n angle += radianHalf;\r\n });\r\n }\r\n};\r\n\r\nexport function rotateNodeLabel(\r\n node: GraphNode,\r\n circularRotateLabel: boolean,\r\n cx: number,\r\n cy: number\r\n) {\r\n const el = node.getGraphicEl() as Symbol;\r\n // need to check if el exists. '-' value may not create node element.\r\n if (!el) {\r\n return;\r\n }\r\n const nodeModel = node.getModel();\r\n let labelRotate = nodeModel.get(['label', 'rotate']) || 0;\r\n const symbolPath = el.getSymbolPath();\r\n if (circularRotateLabel) {\r\n const pos = node.getLayout();\r\n let rad = Math.atan2(pos[1] - cy, pos[0] - cx);\r\n if (rad < 0) {\r\n rad = Math.PI * 2 + rad;\r\n }\r\n const isLeft = pos[0] < cx;\r\n if (isLeft) {\r\n rad = rad - Math.PI;\r\n }\r\n const textPosition = isLeft ? 'left' as const : 'right' as const;\r\n\r\n symbolPath.setTextConfig({\r\n rotation: -rad,\r\n position: textPosition,\r\n origin: 'center'\r\n });\r\n const emphasisState = symbolPath.ensureState('emphasis');\r\n zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\r\n position: textPosition\r\n });\r\n }\r\n else {\r\n symbolPath.setTextConfig({\r\n rotation: labelRotate *= Math.PI / 180\r\n });\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {circularLayout} from './circularLayoutHelper';\r\nimport GlobalModel from '../../model/Global';\r\nimport GraphSeriesModel from './GraphSeries';\r\n\r\nexport default function graphCircularLayout(ecModel: GlobalModel) {\r\n ecModel.eachSeriesByType('graph', function (seriesModel: GraphSeriesModel) {\r\n if (seriesModel.get('layout') === 'circular') {\r\n circularLayout(seriesModel, 'symbolSize');\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* Some formulas were originally copied from \"d3.js\" with some\r\n* modifications made for this project.\r\n* (See more details in the comment of the method \"step\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\r\n\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\n\r\nconst scaleAndAdd = vec2.scaleAndAdd;\r\n\r\ninterface InputNode {\r\n p?: vec2.VectorArray\r\n fixed?: boolean\r\n /**\r\n * Weight\r\n */\r\n w: number\r\n /**\r\n * Repulsion\r\n */\r\n rep: number\r\n}\r\ninterface LayoutNode extends InputNode {\r\n pp?: vec2.VectorArray\r\n edges?: LayoutEdge[]\r\n}\r\ninterface InputEdge {\r\n ignoreForceLayout?: boolean\r\n n1: InputNode\r\n n2: InputNode\r\n\r\n /**\r\n * Distance\r\n */\r\n d: number\r\n}\r\ninterface LayoutEdge extends InputEdge {\r\n n1: LayoutNode\r\n n2: LayoutNode\r\n}\r\ninterface LayoutCfg {\r\n gravity?: number\r\n friction?: number\r\n rect?: RectLike\r\n}\r\n// function adjacentNode(n, e) {\r\n// return e.n1 === n ? e.n2 : e.n1;\r\n// }\r\n\r\nexport function forceLayout(\r\n inNodes: N[],\r\n inEdges: E[],\r\n opts: LayoutCfg\r\n) {\r\n const nodes = inNodes as LayoutNode[];\r\n const edges = inEdges as LayoutEdge[];\r\n const rect = opts.rect;\r\n const width = rect.width;\r\n const height = rect.height;\r\n const center = [rect.x + width / 2, rect.y + height / 2];\r\n // let scale = opts.scale || 1;\r\n const gravity = opts.gravity == null ? 0.1 : opts.gravity;\r\n\r\n // for (let i = 0; i < edges.length; i++) {\r\n // let e = edges[i];\r\n // let n1 = e.n1;\r\n // let n2 = e.n2;\r\n // n1.edges = n1.edges || [];\r\n // n2.edges = n2.edges || [];\r\n // n1.edges.push(e);\r\n // n2.edges.push(e);\r\n // }\r\n // Init position\r\n for (let i = 0; i < nodes.length; i++) {\r\n const n = nodes[i] as LayoutNode;\r\n if (!n.p) {\r\n n.p = vec2.create(\r\n width * (Math.random() - 0.5) + center[0],\r\n height * (Math.random() - 0.5) + center[1]\r\n );\r\n }\r\n n.pp = vec2.clone(n.p);\r\n n.edges = null;\r\n }\r\n\r\n // Formula in 'Graph Drawing by Force-directed Placement'\r\n // let k = scale * Math.sqrt(width * height / nodes.length);\r\n // let k2 = k * k;\r\n\r\n const initialFriction = opts.friction == null ? 0.6 : opts.friction;\r\n let friction = initialFriction;\r\n\r\n let beforeStepCallback: (nodes: N[], edges: E[]) => void;\r\n let afterStepCallback: (nodes: N[], edges: E[], finished: boolean) => void;\r\n\r\n return {\r\n warmUp: function () {\r\n friction = initialFriction * 0.8;\r\n },\r\n\r\n setFixed: function (idx: number) {\r\n nodes[idx].fixed = true;\r\n },\r\n\r\n setUnfixed: function (idx: number) {\r\n nodes[idx].fixed = false;\r\n },\r\n\r\n /**\r\n * Before step hook\r\n */\r\n beforeStep: function (cb: typeof beforeStepCallback) {\r\n beforeStepCallback = cb;\r\n },\r\n /**\r\n * After step hook\r\n */\r\n afterStep: function (cb: typeof afterStepCallback) {\r\n afterStepCallback = cb;\r\n },\r\n\r\n /**\r\n * Some formulas were originally copied from \"d3.js\"\r\n * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js\r\n * with some modifications made for this project.\r\n * See the license statement at the head of this file.\r\n */\r\n step: function (cb?: (finished: boolean) => void) {\r\n beforeStepCallback && beforeStepCallback(nodes as N[], edges as E[]);\r\n\r\n const v12: number[] = [];\r\n const nLen = nodes.length;\r\n for (let i = 0; i < edges.length; i++) {\r\n const e = edges[i];\r\n if (e.ignoreForceLayout) {\r\n continue;\r\n }\r\n const n1 = e.n1;\r\n const n2 = e.n2;\r\n\r\n vec2.sub(v12, n2.p, n1.p);\r\n const d = vec2.len(v12) - e.d;\r\n let w = n2.w / (n1.w + n2.w);\r\n\r\n if (isNaN(w)) {\r\n w = 0;\r\n }\r\n\r\n vec2.normalize(v12, v12);\r\n\r\n !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);\r\n !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);\r\n }\r\n // Gravity\r\n for (let i = 0; i < nLen; i++) {\r\n const n = nodes[i];\r\n if (!n.fixed) {\r\n vec2.sub(v12, center, n.p);\r\n // let d = vec2.len(v12);\r\n // vec2.scale(v12, v12, 1 / d);\r\n // let gravityFactor = gravity;\r\n scaleAndAdd(n.p, n.p, v12, gravity * friction);\r\n }\r\n }\r\n\r\n // Repulsive\r\n // PENDING\r\n for (let i = 0; i < nLen; i++) {\r\n const n1 = nodes[i];\r\n for (let j = i + 1; j < nLen; j++) {\r\n const n2 = nodes[j];\r\n vec2.sub(v12, n2.p, n1.p);\r\n let d = vec2.len(v12);\r\n if (d === 0) {\r\n // Random repulse\r\n vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);\r\n d = 1;\r\n }\r\n const repFact = (n1.rep + n2.rep) / d / d;\r\n !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);\r\n !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);\r\n }\r\n }\r\n const v: number[] = [];\r\n for (let i = 0; i < nLen; i++) {\r\n const n = nodes[i];\r\n if (!n.fixed) {\r\n vec2.sub(v, n.p, n.pp);\r\n scaleAndAdd(n.p, n.p, v, friction);\r\n vec2.copy(n.pp, n.p);\r\n }\r\n }\r\n\r\n friction = friction * 0.992;\r\n\r\n const finished = friction < 0.01;\r\n\r\n afterStepCallback && afterStepCallback(nodes as N[], edges as E[], finished);\r\n\r\n cb && cb(finished);\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {forceLayout} from './forceHelper';\r\nimport {simpleLayout} from './simpleLayoutHelper';\r\nimport {circularLayout} from './circularLayoutHelper';\r\nimport {linearMap} from '../../util/number';\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport GraphSeriesModel, { GraphNodeItemOption, GraphEdgeItemOption } from './GraphSeries';\r\nimport {getCurvenessForEdge} from '../helper/multipleGraphEdgeHelper';\r\n\r\nexport interface ForceLayoutInstance {\r\n step(cb: (stopped: boolean) => void): void\r\n warmUp(): void\r\n setFixed(idx: number): void\r\n setUnfixed(idx: number): void\r\n}\r\n\r\n\r\nexport default function graphForceLayout(ecModel: GlobalModel) {\r\n ecModel.eachSeriesByType('graph', function (graphSeries: GraphSeriesModel) {\r\n const coordSys = graphSeries.coordinateSystem;\r\n if (coordSys && coordSys.type !== 'view') {\r\n return;\r\n }\r\n if (graphSeries.get('layout') === 'force') {\r\n const preservedPoints = graphSeries.preservedPoints || {};\r\n const graph = graphSeries.getGraph();\r\n const nodeData = graph.data;\r\n const edgeData = graph.edgeData;\r\n const forceModel = graphSeries.getModel('force');\r\n const initLayout = forceModel.get('initLayout');\r\n if (graphSeries.preservedPoints) {\r\n nodeData.each(function (idx) {\r\n const id = nodeData.getId(idx);\r\n nodeData.setItemLayout(idx, preservedPoints[id] || [NaN, NaN]);\r\n });\r\n }\r\n else if (!initLayout || initLayout === 'none') {\r\n simpleLayout(graphSeries);\r\n }\r\n else if (initLayout === 'circular') {\r\n circularLayout(graphSeries, 'value');\r\n }\r\n\r\n const nodeDataExtent = nodeData.getDataExtent('value');\r\n const edgeDataExtent = edgeData.getDataExtent('value');\r\n // let edgeDataExtent = edgeData.getDataExtent('value');\r\n const repulsion = forceModel.get('repulsion');\r\n const edgeLength = forceModel.get('edgeLength');\r\n const repulsionArr = zrUtil.isArray(repulsion)\r\n ? repulsion : [repulsion, repulsion];\r\n let edgeLengthArr = zrUtil.isArray(edgeLength)\r\n ? edgeLength : [edgeLength, edgeLength];\r\n\r\n // Larger value has smaller length\r\n edgeLengthArr = [edgeLengthArr[1], edgeLengthArr[0]];\r\n\r\n const nodes = nodeData.mapArray('value', function (value: number, idx) {\r\n const point = nodeData.getItemLayout(idx) as number[];\r\n let rep = linearMap(value, nodeDataExtent, repulsionArr);\r\n if (isNaN(rep)) {\r\n rep = (repulsionArr[0] + repulsionArr[1]) / 2;\r\n }\r\n return {\r\n w: rep,\r\n rep: rep,\r\n fixed: nodeData.getItemModel(idx).get('fixed'),\r\n p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point\r\n };\r\n });\r\n const edges = edgeData.mapArray('value', function (value: number, idx) {\r\n const edge = graph.getEdgeByIndex(idx);\r\n let d = linearMap(value, edgeDataExtent, edgeLengthArr);\r\n if (isNaN(d)) {\r\n d = (edgeLengthArr[0] + edgeLengthArr[1]) / 2;\r\n }\r\n const edgeModel = edge.getModel();\r\n const curveness = zrUtil.retrieve3(\r\n edge.getModel().get(['lineStyle', 'curveness']),\r\n -getCurvenessForEdge(edge, graphSeries, idx, true),\r\n 0\r\n );\r\n return {\r\n n1: nodes[edge.node1.dataIndex],\r\n n2: nodes[edge.node2.dataIndex],\r\n d: d,\r\n curveness,\r\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\r\n };\r\n });\r\n\r\n // let coordSys = graphSeries.coordinateSystem;\r\n const rect = coordSys.getBoundingRect();\r\n const forceInstance = forceLayout(nodes, edges, {\r\n rect: rect,\r\n gravity: forceModel.get('gravity'),\r\n friction: forceModel.get('friction')\r\n });\r\n forceInstance.beforeStep(function (nodes, edges) {\r\n for (let i = 0, l = nodes.length; i < l; i++) {\r\n if (nodes[i].fixed) {\r\n // Write back to layout instance\r\n vec2.copy(\r\n nodes[i].p,\r\n graph.getNodeByIndex(i).getLayout() as number[]\r\n );\r\n }\r\n }\r\n });\r\n forceInstance.afterStep(function (nodes, edges, stopped) {\r\n for (let i = 0, l = nodes.length; i < l; i++) {\r\n if (!nodes[i].fixed) {\r\n graph.getNodeByIndex(i).setLayout(nodes[i].p);\r\n }\r\n preservedPoints[nodeData.getId(i)] = nodes[i].p;\r\n }\r\n for (let i = 0, l = edges.length; i < l; i++) {\r\n const e = edges[i];\r\n const edge = graph.getEdgeByIndex(i);\r\n const p1 = e.n1.p;\r\n const p2 = e.n2.p;\r\n let points = edge.getLayout() as number[][];\r\n points = points ? points.slice() : [];\r\n points[0] = points[0] || [];\r\n points[1] = points[1] || [];\r\n vec2.copy(points[0], p1);\r\n vec2.copy(points[1], p2);\r\n if (+e.curveness) {\r\n points[2] = [\r\n (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness,\r\n (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness\r\n ];\r\n }\r\n edge.setLayout(points);\r\n }\r\n });\r\n graphSeries.forceLayout = forceInstance;\r\n graphSeries.preservedPoints = preservedPoints;\r\n\r\n // Step to get the layout\r\n forceInstance.step();\r\n }\r\n else {\r\n // Remove prev injected forceLayout instance\r\n graphSeries.forceLayout = null;\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// FIXME Where to create the simple view coordinate system\r\nimport View from '../../coord/View';\r\nimport {getLayoutRect} from '../../util/layout';\r\nimport * as bbox from 'zrender/src/core/bbox';\r\nimport GraphSeriesModel, { GraphNodeItemOption } from './GraphSeries';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GlobalModel from '../../model/Global';\r\nimport { extend } from 'zrender/src/core/util';\r\n\r\nfunction getViewRect(seriesModel: GraphSeriesModel, api: ExtensionAPI, aspect: number) {\r\n const option = extend(seriesModel.getBoxLayoutParams(), {\r\n aspect: aspect\r\n });\r\n return getLayoutRect(option, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n });\r\n}\r\n\r\nexport default function createViewCoordSys(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const viewList: View[] = [];\r\n ecModel.eachSeriesByType('graph', function (seriesModel: GraphSeriesModel) {\r\n const coordSysType = seriesModel.get('coordinateSystem');\r\n if (!coordSysType || coordSysType === 'view') {\r\n\r\n const data = seriesModel.getData();\r\n const positions = data.mapArray(function (idx) {\r\n const itemModel = data.getItemModel(idx);\r\n return [+itemModel.get('x'), +itemModel.get('y')];\r\n });\r\n\r\n let min: number[] = [];\r\n let max: number[] = [];\r\n\r\n bbox.fromPoints(positions, min, max);\r\n\r\n // If width or height is 0\r\n if (max[0] - min[0] === 0) {\r\n max[0] += 1;\r\n min[0] -= 1;\r\n }\r\n if (max[1] - min[1] === 0) {\r\n max[1] += 1;\r\n min[1] -= 1;\r\n }\r\n const aspect = (max[0] - min[0]) / (max[1] - min[1]);\r\n // FIXME If get view rect after data processed?\r\n const viewRect = getViewRect(seriesModel, api, aspect);\r\n // Position may be NaN, use view rect instead\r\n if (isNaN(aspect)) {\r\n min = [viewRect.x, viewRect.y];\r\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\r\n }\r\n\r\n const bbWidth = max[0] - min[0];\r\n const bbHeight = max[1] - min[1];\r\n\r\n const viewWidth = viewRect.width;\r\n const viewHeight = viewRect.height;\r\n\r\n const viewCoordSys = seriesModel.coordinateSystem = new View();\r\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\r\n\r\n viewCoordSys.setBoundingRect(\r\n min[0], min[1], bbWidth, bbHeight\r\n );\r\n viewCoordSys.setViewRect(\r\n viewRect.x, viewRect.y, viewWidth, viewHeight\r\n );\r\n\r\n // Update roam info\r\n viewCoordSys.setCenter(seriesModel.get('center'), api);\r\n viewCoordSys.setZoom(seriesModel.get('zoom'));\r\n\r\n viewList.push(viewCoordSys);\r\n }\r\n });\r\n\r\n return viewList;\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Line path for bezier and straight line draw\r\n */\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport { ColorString } from '../../util/types';\r\n\r\nconst straightLineProto = graphic.Line.prototype;\r\nconst bezierCurveProto = graphic.BezierCurve.prototype;\r\n\r\nclass StraightLineShape {\r\n // Start point\r\n x1 = 0;\r\n y1 = 0;\r\n // End point\r\n x2 = 0;\r\n y2 = 0;\r\n\r\n percent = 1;\r\n}\r\n\r\nclass CurveShape extends StraightLineShape {\r\n cpx1: number;\r\n cpy1: number;\r\n}\r\n\r\ninterface ECLineProps extends PathProps {\r\n shape?: Partial\r\n}\r\nfunction isStraightLine(shape: StraightLineShape | CurveShape): shape is StraightLineShape {\r\n return isNaN(+(shape as CurveShape).cpx1) || isNaN(+(shape as CurveShape).cpy1);\r\n}\r\n\r\nclass ECLinePath extends graphic.Path {\r\n\r\n type = 'ec-line';\r\n\r\n shape: StraightLineShape | CurveShape;\r\n\r\n constructor(opts?: ECLineProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultStyle() {\r\n return {\r\n stroke: '#000',\r\n fill: null as ColorString\r\n };\r\n }\r\n\r\n getDefaultShape() {\r\n return new StraightLineShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: StraightLineShape | CurveShape) {\r\n if (isStraightLine(shape)) {\r\n straightLineProto.buildPath.call(this, ctx, shape);\r\n }\r\n else {\r\n bezierCurveProto.buildPath.call(this, ctx, shape);\r\n }\r\n }\r\n\r\n pointAt(t: number) {\r\n if (isStraightLine(this.shape)) {\r\n return straightLineProto.pointAt.call(this, t);\r\n }\r\n else {\r\n return bezierCurveProto.pointAt.call(this, t);\r\n }\r\n }\r\n\r\n tangentAt(t: number) {\r\n const shape = this.shape;\r\n const p = isStraightLine(shape)\r\n ? [shape.x2 - shape.x1, shape.y2 - shape.y1]\r\n : bezierCurveProto.tangentAt.call(this, t);\r\n return vec2.normalize(p, p);\r\n }\r\n\r\n}\r\n\r\nexport default ECLinePath;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { isArray, each } from 'zrender/src/core/util';\r\nimport * as vector from 'zrender/src/core/vector';\r\nimport * as symbolUtil from '../../util/symbol';\r\nimport ECLinePath from './LinePath';\r\nimport * as graphic from '../../util/graphic';\r\nimport { toggleHoverEmphasis, enterEmphasis, leaveEmphasis, SPECIAL_STATES } from '../../util/states';\r\nimport {getLabelStatesModels, setLabelStyle} from '../../label/labelStyle';\r\nimport {round} from '../../util/number';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport {\r\n ZRTextAlign,\r\n ZRTextVerticalAlign,\r\n LineLabelOption,\r\n ColorString,\r\n DefaultEmphasisFocus,\r\n BlurScope\r\n} from '../../util/types';\r\nimport SeriesModel from '../../model/Series';\r\nimport type { LineDrawSeriesScope, LineDrawModelOption } from './LineDraw';\r\nimport { TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport { LineDataVisual } from '../../visual/commonVisualTypes';\r\nimport Model from '../../model/Model';\r\n\r\nconst SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'] as const;\r\n\r\ntype ECSymbol = ReturnType;\r\n\r\ntype LineECSymbol = ECSymbol & {\r\n __specifiedRotation: number\r\n};\r\n\r\ntype LineList = SeriesData;\r\n\r\nexport interface LineLabel extends graphic.Text {\r\n lineLabelOriginalOpacity: number\r\n}\r\n\r\ninterface InnerLineLabel extends LineLabel {\r\n __align: TextStyleProps['align']\r\n __verticalAlign: TextStyleProps['verticalAlign']\r\n __position: LineLabelOption['position']\r\n __labelDistance: number[]\r\n}\r\n\r\nfunction makeSymbolTypeKey(symbolCategory: 'fromSymbol' | 'toSymbol') {\r\n return '_' + symbolCategory + 'Type' as '_fromSymbolType' | '_toSymbolType';\r\n}\r\nfunction makeSymbolTypeValue(name: 'fromSymbol' | 'toSymbol', lineData: LineList, idx: number) {\r\n const symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return symbolType;\r\n }\r\n const symbolSize = lineData.getItemVisual(idx, name + 'Size' as 'fromSymbolSize' | 'toSymbolSize');\r\n const symbolRotate = lineData.getItemVisual(idx, name + 'Rotate' as 'fromSymbolRotate' | 'toSymbolRotate');\r\n const symbolOffset = lineData.getItemVisual(idx, name + 'Offset' as 'fromSymbolOffset' | 'toSymbolOffset');\r\n const symbolKeepAspect = lineData.getItemVisual(idx,\r\n name + 'KeepAspect' as 'fromSymbolKeepAspect' | 'toSymbolKeepAspect');\r\n const symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\r\n\r\n const symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\r\n\r\n return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || '') + (symbolKeepAspect || '');\r\n}\r\n\r\n/**\r\n * @inner\r\n */\r\nfunction createSymbol(name: 'fromSymbol' | 'toSymbol', lineData: LineList, idx: number) {\r\n const symbolType = lineData.getItemVisual(idx, name);\r\n if (!symbolType || symbolType === 'none') {\r\n return;\r\n }\r\n\r\n const symbolSize = lineData.getItemVisual(idx, name + 'Size' as 'fromSymbolSize' | 'toSymbolSize');\r\n const symbolRotate = lineData.getItemVisual(idx, name + 'Rotate' as 'fromSymbolRotate' | 'toSymbolRotate');\r\n const symbolOffset = lineData.getItemVisual(idx, name + 'Offset' as 'fromSymbolOffset' | 'toSymbolOffset');\r\n const symbolKeepAspect = lineData.getItemVisual(idx,\r\n name + 'KeepAspect' as 'fromSymbolKeepAspect' | 'toSymbolKeepAspect');\r\n\r\n const symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\r\n\r\n const symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\r\n\r\n const symbolPath = symbolUtil.createSymbol(\r\n symbolType,\r\n -symbolSizeArr[0] / 2 + (symbolOffsetArr as number[])[0],\r\n -symbolSizeArr[1] / 2 + (symbolOffsetArr as number[])[1],\r\n symbolSizeArr[0],\r\n symbolSizeArr[1],\r\n null,\r\n symbolKeepAspect\r\n );\r\n\r\n (symbolPath as LineECSymbol).__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)\r\n ? void 0\r\n : +symbolRotate * Math.PI / 180 || 0;\r\n\r\n symbolPath.name = name;\r\n\r\n return symbolPath;\r\n}\r\n\r\nfunction createLine(points: number[][]) {\r\n const line = new ECLinePath({\r\n name: 'line',\r\n subPixelOptimize: true\r\n });\r\n setLinePoints(line.shape, points);\r\n return line;\r\n}\r\n\r\nfunction setLinePoints(targetShape: ECLinePath['shape'], points: number[][]) {\r\n type CurveShape = ECLinePath['shape'] & {\r\n cpx1: number\r\n cpy1: number\r\n };\r\n\r\n targetShape.x1 = points[0][0];\r\n targetShape.y1 = points[0][1];\r\n targetShape.x2 = points[1][0];\r\n targetShape.y2 = points[1][1];\r\n targetShape.percent = 1;\r\n\r\n const cp1 = points[2];\r\n if (cp1) {\r\n (targetShape as CurveShape).cpx1 = cp1[0];\r\n (targetShape as CurveShape).cpy1 = cp1[1];\r\n }\r\n else {\r\n (targetShape as CurveShape).cpx1 = NaN;\r\n (targetShape as CurveShape).cpy1 = NaN;\r\n }\r\n}\r\n\r\nclass Line extends graphic.Group {\r\n\r\n private _fromSymbolType: string;\r\n private _toSymbolType: string;\r\n\r\n constructor(lineData: SeriesData, idx: number, seriesScope?: LineDrawSeriesScope) {\r\n super();\r\n this._createLine(lineData as LineList, idx, seriesScope);\r\n }\r\n\r\n _createLine(lineData: LineList, idx: number, seriesScope?: LineDrawSeriesScope) {\r\n const seriesModel = lineData.hostModel;\r\n const linePoints = lineData.getItemLayout(idx);\r\n const line = createLine(linePoints);\r\n line.shape.percent = 0;\r\n graphic.initProps(line, {\r\n shape: {\r\n percent: 1\r\n }\r\n }, seriesModel, idx);\r\n\r\n this.add(line);\r\n\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n const symbol = createSymbol(symbolCategory, lineData, idx);\r\n // symbols must added after line to make sure\r\n // it will be updated after line#update.\r\n // Or symbol position and rotation update in line#beforeUpdate will be one frame slow\r\n this.add(symbol);\r\n this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx);\r\n }, this);\r\n\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n }\r\n\r\n // TODO More strict on the List type in parameters?\r\n updateData(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n const seriesModel = lineData.hostModel;\r\n\r\n const line = this.childOfName('line') as ECLinePath;\r\n const linePoints = lineData.getItemLayout(idx);\r\n const target = {\r\n shape: {} as ECLinePath['shape']\r\n };\r\n\r\n setLinePoints(target.shape, linePoints);\r\n graphic.updateProps(line, target, seriesModel, idx);\r\n\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n const symbolType = makeSymbolTypeValue(symbolCategory, lineData as LineList, idx);\r\n const key = makeSymbolTypeKey(symbolCategory);\r\n // Symbol changed\r\n if (this[key] !== symbolType) {\r\n this.remove(this.childOfName(symbolCategory));\r\n const symbol = createSymbol(symbolCategory, lineData as LineList, idx);\r\n this.add(symbol);\r\n }\r\n this[key] = symbolType;\r\n }, this);\r\n\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n\r\n getLinePath() {\r\n return this.childAt(0) as graphic.Line;\r\n }\r\n\r\n _updateCommonStl(lineData: SeriesData, idx: number, seriesScope?: LineDrawSeriesScope) {\r\n const seriesModel = lineData.hostModel as SeriesModel;\r\n\r\n const line = this.childOfName('line') as ECLinePath;\r\n\r\n let emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n let blurLineStyle = seriesScope && seriesScope.blurLineStyle;\r\n let selectLineStyle = seriesScope && seriesScope.selectLineStyle;\r\n\r\n let labelStatesModels = seriesScope && seriesScope.labelStatesModels;\r\n\r\n let emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\r\n let focus = (seriesScope && seriesScope.focus) as DefaultEmphasisFocus;\r\n let blurScope = (seriesScope && seriesScope.blurScope) as BlurScope;\r\n\r\n // Optimization for large dataset\r\n if (!seriesScope || lineData.hasItemOption) {\r\n const itemModel = lineData.getItemModel(idx);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n\r\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\r\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\r\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\r\n emphasisDisabled = emphasisModel.get('disabled');\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n\r\n const lineStyle = lineData.getItemVisual(idx, 'style');\r\n const visualColor = lineStyle.stroke;\r\n\r\n line.useStyle(lineStyle);\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n\r\n line.ensureState('emphasis').style = emphasisLineStyle;\r\n line.ensureState('blur').style = blurLineStyle;\r\n line.ensureState('select').style = selectLineStyle;\r\n\r\n // Update symbol\r\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\r\n const symbol = this.childOfName(symbolCategory) as ECSymbol;\r\n if (symbol) {\r\n // Share opacity and color with line.\r\n symbol.setColor(visualColor);\r\n symbol.style.opacity = lineStyle.opacity;\r\n\r\n for (let i = 0; i < SPECIAL_STATES.length; i++) {\r\n const stateName = SPECIAL_STATES[i];\r\n const lineState = line.getState(stateName);\r\n if (lineState) {\r\n const lineStateStyle = lineState.style || {};\r\n const state = symbol.ensureState(stateName);\r\n const stateStyle = state.style || (state.style = {});\r\n if (lineStateStyle.stroke != null) {\r\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\r\n }\r\n if (lineStateStyle.opacity != null) {\r\n stateStyle.opacity = lineStateStyle.opacity;\r\n }\r\n }\r\n }\r\n\r\n symbol.markRedraw();\r\n }\r\n }, this);\r\n\r\n const rawVal = seriesModel.getRawValue(idx) as number;\r\n setLabelStyle(this, labelStatesModels, {\r\n labelDataIndex: idx,\r\n labelFetcher: {\r\n getFormattedLabel(dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\r\n }\r\n },\r\n inheritColor: visualColor as ColorString || '#000',\r\n defaultOpacity: lineStyle.opacity,\r\n defaultText: (rawVal == null\r\n ? lineData.getName(idx)\r\n : isFinite(rawVal)\r\n ? round(rawVal)\r\n : rawVal) + ''\r\n });\r\n const label = this.getTextContent() as InnerLineLabel;\r\n\r\n // Always set `textStyle` even if `normalStyle.text` is null, because default\r\n // values have to be set on `normalStyle`.\r\n if (label) {\r\n const labelNormalModel = labelStatesModels.normal as unknown as Model;\r\n label.__align = label.style.align;\r\n label.__verticalAlign = label.style.verticalAlign;\r\n // 'start', 'middle', 'end'\r\n label.__position = labelNormalModel.get('position') || 'middle';\r\n\r\n let distance = labelNormalModel.get('distance');\r\n if (!isArray(distance)) {\r\n distance = [distance, distance];\r\n }\r\n label.__labelDistance = distance;\r\n }\r\n\r\n this.setTextConfig({\r\n position: null,\r\n local: true,\r\n inside: false // Can't be inside for stroke element.\r\n });\r\n\r\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\r\n }\r\n\r\n highlight() {\r\n enterEmphasis(this);\r\n }\r\n\r\n downplay() {\r\n leaveEmphasis(this);\r\n }\r\n\r\n updateLayout(lineData: SeriesData, idx: number) {\r\n this.setLinePoints(lineData.getItemLayout(idx));\r\n }\r\n\r\n setLinePoints(points: number[][]) {\r\n const linePath = this.childOfName('line') as ECLinePath;\r\n setLinePoints(linePath.shape, points);\r\n linePath.dirty();\r\n }\r\n\r\n beforeUpdate() {\r\n const lineGroup = this;\r\n const symbolFrom = lineGroup.childOfName('fromSymbol') as ECSymbol;\r\n const symbolTo = lineGroup.childOfName('toSymbol') as ECSymbol;\r\n const label = lineGroup.getTextContent() as InnerLineLabel;\r\n // Quick reject\r\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\r\n return;\r\n }\r\n\r\n let invScale = 1;\r\n let parentNode = this.parent;\r\n while (parentNode) {\r\n if (parentNode.scaleX) {\r\n invScale /= parentNode.scaleX;\r\n }\r\n parentNode = parentNode.parent;\r\n }\r\n\r\n const line = lineGroup.childOfName('line') as ECLinePath;\r\n // If line not changed\r\n // FIXME Parent scale changed\r\n if (!this.__dirty && !line.__dirty) {\r\n return;\r\n }\r\n\r\n const percent = line.shape.percent;\r\n const fromPos = line.pointAt(0);\r\n const toPos = line.pointAt(percent);\r\n\r\n const d = vector.sub([], toPos, fromPos);\r\n vector.normalize(d, d);\r\n\r\n function setSymbolRotation(symbol: ECSymbol, percent: 0 | 1) {\r\n // Fix #12388\r\n // when symbol is set to be 'arrow' in markLine,\r\n // symbolRotate value will be ignored, and compulsively use tangent angle.\r\n // rotate by default if symbol rotation is not specified\r\n const specifiedRotation = (symbol as LineECSymbol).__specifiedRotation;\r\n if (specifiedRotation == null) {\r\n const tangent = line.tangentAt(percent);\r\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(\r\n tangent[1], tangent[0]\r\n ));\r\n }\r\n else {\r\n symbol.attr('rotation', specifiedRotation);\r\n }\r\n }\r\n\r\n if (symbolFrom) {\r\n symbolFrom.setPosition(fromPos);\r\n setSymbolRotation(symbolFrom, 0);\r\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\r\n symbolFrom.markRedraw();\r\n }\r\n if (symbolTo) {\r\n symbolTo.setPosition(toPos);\r\n setSymbolRotation(symbolTo, 1);\r\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\r\n symbolTo.markRedraw();\r\n }\r\n\r\n if (label && !label.ignore) {\r\n label.x = label.y = 0;\r\n label.originX = label.originY = 0;\r\n\r\n let textAlign: ZRTextAlign;\r\n let textVerticalAlign: ZRTextVerticalAlign;\r\n\r\n const distance = label.__labelDistance;\r\n const distanceX = distance[0] * invScale;\r\n const distanceY = distance[1] * invScale;\r\n const halfPercent = percent / 2;\r\n const tangent = line.tangentAt(halfPercent);\r\n const n = [tangent[1], -tangent[0]];\r\n const cp = line.pointAt(halfPercent);\r\n if (n[1] > 0) {\r\n n[0] = -n[0];\r\n n[1] = -n[1];\r\n }\r\n const dir = tangent[0] < 0 ? -1 : 1;\r\n\r\n if (label.__position !== 'start' && label.__position !== 'end') {\r\n let rotation = -Math.atan2(tangent[1], tangent[0]);\r\n if (toPos[0] < fromPos[0]) {\r\n rotation = Math.PI + rotation;\r\n }\r\n label.rotation = rotation;\r\n }\r\n\r\n let dy;\r\n switch (label.__position) {\r\n case 'insideStartTop':\r\n case 'insideMiddleTop':\r\n case 'insideEndTop':\r\n case 'middle':\r\n dy = -distanceY;\r\n textVerticalAlign = 'bottom';\r\n break;\r\n\r\n case 'insideStartBottom':\r\n case 'insideMiddleBottom':\r\n case 'insideEndBottom':\r\n dy = distanceY;\r\n textVerticalAlign = 'top';\r\n break;\r\n\r\n default:\r\n dy = 0;\r\n textVerticalAlign = 'middle';\r\n }\r\n\r\n switch (label.__position) {\r\n case 'end':\r\n label.x = d[0] * distanceX + toPos[0];\r\n label.y = d[1] * distanceY + toPos[1];\r\n textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');\r\n break;\r\n\r\n case 'start':\r\n label.x = -d[0] * distanceX + fromPos[0];\r\n label.y = -d[1] * distanceY + fromPos[1];\r\n textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');\r\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');\r\n break;\r\n\r\n case 'insideStartTop':\r\n case 'insideStart':\r\n case 'insideStartBottom':\r\n label.x = distanceX * dir + fromPos[0];\r\n label.y = fromPos[1] + dy;\r\n textAlign = tangent[0] < 0 ? 'right' : 'left';\r\n label.originX = -distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n\r\n case 'insideMiddleTop':\r\n case 'insideMiddle':\r\n case 'insideMiddleBottom':\r\n case 'middle':\r\n label.x = cp[0];\r\n label.y = cp[1] + dy;\r\n textAlign = 'center';\r\n label.originY = -dy;\r\n break;\r\n\r\n case 'insideEndTop':\r\n case 'insideEnd':\r\n case 'insideEndBottom':\r\n label.x = -distanceX * dir + toPos[0];\r\n label.y = toPos[1] + dy;\r\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\r\n label.originX = distanceX * dir;\r\n label.originY = -dy;\r\n break;\r\n }\r\n\r\n label.scaleX = label.scaleY = invScale;\r\n label.setStyle({\r\n // Use the user specified text align and baseline first\r\n verticalAlign: label.__verticalAlign || textVerticalAlign,\r\n align: label.__align || textAlign\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport default Line;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport LineGroup from './Line';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport {\r\n StageHandlerProgressParams,\r\n LineStyleOption,\r\n LineLabelOption,\r\n ColorString,\r\n AnimationOptionMixin,\r\n ZRStyleProps,\r\n StatesOptionMixin,\r\n DisplayState,\r\n LabelOption,\r\n DefaultEmphasisFocus,\r\n BlurScope\r\n} from '../../util/types';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport Model from '../../model/Model';\r\nimport { getLabelStatesModels } from '../../label/labelStyle';\r\nimport Element from 'zrender/src/Element';\r\n\r\ninterface LineLike extends graphic.Group {\r\n updateData(data: SeriesData, idx: number, scope?: LineDrawSeriesScope): void\r\n updateLayout(data: SeriesData, idx: number): void\r\n fadeOut?(cb: () => void): void\r\n}\r\n\r\ninterface LineLikeCtor {\r\n new(data: SeriesData, idx: number, scope?: LineDrawSeriesScope): LineLike\r\n}\r\n\r\ninterface LineDrawStateOption {\r\n lineStyle?: LineStyleOption\r\n label?: LineLabelOption\r\n}\r\n\r\nexport interface LineDrawModelOption extends LineDrawStateOption,\r\n StatesOptionMixin {\r\n // If has effect\r\n effect?: {\r\n show?: boolean\r\n period?: number\r\n delay?: number | ((idx: number) => number)\r\n /**\r\n * If move with constant speed px/sec\r\n * period will be ignored if this property is > 0,\r\n */\r\n constantSpeed?: number\r\n\r\n symbol?: string\r\n symbolSize?: number | number[]\r\n loop?: boolean\r\n roundTrip?: boolean\r\n /**\r\n * Length of trail, 0 - 1\r\n */\r\n trailLength?: number\r\n /**\r\n * Default to be same with lineStyle.color\r\n */\r\n color?: ColorString\r\n }\r\n}\r\n\r\ntype ListForLineDraw = SeriesData>;\r\n\r\nexport interface LineDrawSeriesScope {\r\n lineStyle?: ZRStyleProps\r\n emphasisLineStyle?: ZRStyleProps\r\n blurLineStyle?: ZRStyleProps\r\n selectLineStyle?: ZRStyleProps\r\n\r\n labelStatesModels: Record>\r\n\r\n focus?: DefaultEmphasisFocus\r\n blurScope?: BlurScope\r\n emphasisDisabled?: boolean;\r\n}\r\n\r\nclass LineDraw {\r\n group = new graphic.Group();\r\n\r\n private _LineCtor: LineLikeCtor;\r\n\r\n private _lineData: ListForLineDraw;\r\n\r\n private _seriesScope: LineDrawSeriesScope;\r\n\r\n private _progressiveEls: LineLike[];\r\n\r\n constructor(LineCtor?: LineLikeCtor) {\r\n this._LineCtor = LineCtor || LineGroup;\r\n }\r\n\r\n updateData(lineData: ListForLineDraw) {\r\n // Remove progressive els.\r\n this._progressiveEls = null;\r\n\r\n const lineDraw = this;\r\n const group = lineDraw.group;\r\n\r\n const oldLineData = lineDraw._lineData;\r\n lineDraw._lineData = lineData;\r\n\r\n // There is no oldLineData only when first rendering or switching from\r\n // stream mode to normal mode, where previous elements should be removed.\r\n if (!oldLineData) {\r\n group.removeAll();\r\n }\r\n\r\n const seriesScope = makeSeriesScope(lineData);\r\n\r\n lineData.diff(oldLineData)\r\n .add((idx) => {\r\n this._doAdd(lineData, idx, seriesScope);\r\n })\r\n .update((newIdx, oldIdx) => {\r\n this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\r\n })\r\n .remove((idx) => {\r\n group.remove(oldLineData.getItemGraphicEl(idx));\r\n })\r\n .execute();\r\n };\r\n\r\n updateLayout() {\r\n const lineData = this._lineData;\r\n\r\n // Do not support update layout in incremental mode.\r\n if (!lineData) {\r\n return;\r\n }\r\n\r\n lineData.eachItemGraphicEl(function (el: LineLike, idx) {\r\n el.updateLayout(lineData, idx);\r\n }, this);\r\n };\r\n\r\n incrementalPrepareUpdate(lineData: ListForLineDraw) {\r\n this._seriesScope = makeSeriesScope(lineData);\r\n this._lineData = null;\r\n this.group.removeAll();\r\n };\r\n\r\n incrementalUpdate(taskParams: StageHandlerProgressParams, lineData: ListForLineDraw) {\r\n\r\n this._progressiveEls = [];\r\n\r\n function updateIncrementalAndHover(el: Displayable) {\r\n if (!el.isGroup && !isEffectObject(el)) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n\r\n for (let idx = taskParams.start; idx < taskParams.end; idx++) {\r\n const itemLayout = lineData.getItemLayout(idx);\r\n\r\n if (lineNeedsDraw(itemLayout)) {\r\n const el = new this._LineCtor(lineData, idx, this._seriesScope);\r\n el.traverse(updateIncrementalAndHover);\r\n\r\n this.group.add(el);\r\n lineData.setItemGraphicEl(idx, el);\r\n\r\n this._progressiveEls.push(el);\r\n }\r\n }\r\n };\r\n\r\n remove() {\r\n this.group.removeAll();\r\n };\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n graphic.traverseElements(this._progressiveEls || this.group, cb);\r\n }\r\n\r\n private _doAdd(\r\n lineData: ListForLineDraw,\r\n idx: number,\r\n seriesScope: LineDrawSeriesScope\r\n ) {\r\n const itemLayout = lineData.getItemLayout(idx);\r\n\r\n if (!lineNeedsDraw(itemLayout)) {\r\n return;\r\n }\r\n\r\n const el = new this._LineCtor(lineData, idx, seriesScope);\r\n lineData.setItemGraphicEl(idx, el);\r\n this.group.add(el);\r\n }\r\n private _doUpdate(\r\n oldLineData: ListForLineDraw,\r\n newLineData: ListForLineDraw,\r\n oldIdx: number,\r\n newIdx: number,\r\n seriesScope: LineDrawSeriesScope\r\n ) {\r\n let itemEl = oldLineData.getItemGraphicEl(oldIdx) as LineLike;\r\n\r\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\r\n this.group.remove(itemEl);\r\n return;\r\n }\r\n\r\n if (!itemEl) {\r\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\r\n }\r\n else {\r\n itemEl.updateData(newLineData, newIdx, seriesScope);\r\n }\r\n\r\n newLineData.setItemGraphicEl(newIdx, itemEl);\r\n\r\n this.group.add(itemEl);\r\n }\r\n}\r\n\r\nfunction isEffectObject(el: Displayable) {\r\n return el.animators && el.animators.length > 0;\r\n}\r\n\r\nfunction makeSeriesScope(lineData: ListForLineDraw): LineDrawSeriesScope {\r\n const hostModel = lineData.hostModel;\r\n const emphasisModel = hostModel.getModel('emphasis');\r\n return {\r\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\r\n emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(),\r\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\r\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\r\n\r\n emphasisDisabled: emphasisModel.get('disabled'),\r\n blurScope: emphasisModel.get('blurScope'),\r\n focus: emphasisModel.get('focus'),\r\n\r\n labelStatesModels: getLabelStatesModels(hostModel)\r\n };\r\n}\r\n\r\nfunction isPointNaN(pt: number[]) {\r\n return isNaN(pt[0]) || isNaN(pt[1]);\r\n}\r\n\r\nfunction lineNeedsDraw(pts: number[][]) {\r\n return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\r\n}\r\n\r\n\r\nexport default LineDraw;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as curveTool from 'zrender/src/core/curve';\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport {getSymbolSize} from './graphHelper';\r\nimport Graph from '../../data/Graph';\r\n\r\nconst v1: number[] = [];\r\nconst v2: number[] = [];\r\nconst v3: number[] = [];\r\nconst quadraticAt = curveTool.quadraticAt;\r\nconst v2DistSquare = vec2.distSquare;\r\nconst mathAbs = Math.abs;\r\nfunction intersectCurveCircle(\r\n curvePoints: number[][],\r\n center: number[],\r\n radius: number\r\n) {\r\n const p0 = curvePoints[0];\r\n const p1 = curvePoints[1];\r\n const p2 = curvePoints[2];\r\n\r\n let d = Infinity;\r\n let t;\r\n const radiusSquare = radius * radius;\r\n let interval = 0.1;\r\n\r\n for (let _t = 0.1; _t <= 0.9; _t += 0.1) {\r\n v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t);\r\n v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t);\r\n const diff = mathAbs(v2DistSquare(v1, center) - radiusSquare);\r\n if (diff < d) {\r\n d = diff;\r\n t = _t;\r\n }\r\n }\r\n\r\n // Assume the segment is monotone\uFF0CFind root through Bisection method\r\n // At most 32 iteration\r\n for (let i = 0; i < 32; i++) {\r\n // let prev = t - interval;\r\n const next = t + interval;\r\n // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);\r\n // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);\r\n v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);\r\n v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);\r\n v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);\r\n v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);\r\n\r\n const diff = v2DistSquare(v2, center) - radiusSquare;\r\n if (mathAbs(diff) < 1e-2) {\r\n break;\r\n }\r\n\r\n // let prevDiff = v2DistSquare(v1, center) - radiusSquare;\r\n const nextDiff = v2DistSquare(v3, center) - radiusSquare;\r\n\r\n interval /= 2;\r\n if (diff < 0) {\r\n if (nextDiff >= 0) {\r\n t = t + interval;\r\n }\r\n else {\r\n t = t - interval;\r\n }\r\n }\r\n else {\r\n if (nextDiff >= 0) {\r\n t = t - interval;\r\n }\r\n else {\r\n t = t + interval;\r\n }\r\n }\r\n }\r\n\r\n return t;\r\n}\r\n\r\n// Adjust edge to avoid\r\nexport default function adjustEdge(graph: Graph, scale: number) {\r\n const tmp0: number[] = [];\r\n const quadraticSubdivide = curveTool.quadraticSubdivide;\r\n const pts: number[][] = [[], [], []];\r\n const pts2: number[][] = [[], []];\r\n const v: number[] = [];\r\n scale /= 2;\r\n\r\n graph.eachEdge(function (edge, idx) {\r\n const linePoints = edge.getLayout();\r\n const fromSymbol = edge.getVisual('fromSymbol');\r\n const toSymbol = edge.getVisual('toSymbol');\r\n\r\n if (!linePoints.__original) {\r\n linePoints.__original = [\r\n vec2.clone(linePoints[0]),\r\n vec2.clone(linePoints[1])\r\n ];\r\n if (linePoints[2]) {\r\n linePoints.__original.push(vec2.clone(linePoints[2]));\r\n }\r\n }\r\n const originalPoints = linePoints.__original;\r\n // Quadratic curve\r\n if (linePoints[2] != null) {\r\n vec2.copy(pts[0], originalPoints[0]);\r\n vec2.copy(pts[1], originalPoints[2]);\r\n vec2.copy(pts[2], originalPoints[1]);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n const symbolSize = getSymbolSize(edge.node1);\r\n\r\n const t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale);\r\n // Subdivide and get the second\r\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[0][0] = tmp0[3];\r\n pts[1][0] = tmp0[4];\r\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[0][1] = tmp0[3];\r\n pts[1][1] = tmp0[4];\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n const symbolSize = getSymbolSize(edge.node2);\r\n\r\n const t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale);\r\n // Subdivide and get the first\r\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\r\n pts[1][0] = tmp0[1];\r\n pts[2][0] = tmp0[2];\r\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\r\n pts[1][1] = tmp0[1];\r\n pts[2][1] = tmp0[2];\r\n }\r\n // Copy back to layout\r\n vec2.copy(linePoints[0], pts[0]);\r\n vec2.copy(linePoints[1], pts[2]);\r\n vec2.copy(linePoints[2], pts[1]);\r\n }\r\n // Line\r\n else {\r\n vec2.copy(pts2[0], originalPoints[0]);\r\n vec2.copy(pts2[1], originalPoints[1]);\r\n\r\n vec2.sub(v, pts2[1], pts2[0]);\r\n vec2.normalize(v, v);\r\n if (fromSymbol && fromSymbol !== 'none') {\r\n\r\n const symbolSize = getSymbolSize(edge.node1);\r\n\r\n vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\r\n }\r\n if (toSymbol && toSymbol !== 'none') {\r\n const symbolSize = getSymbolSize(edge.node2);\r\n\r\n vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\r\n }\r\n vec2.copy(linePoints[0], pts2[0]);\r\n vec2.copy(linePoints[1], pts2[1]);\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SymbolDraw, { ListForSymbolDraw } from '../helper/SymbolDraw';\r\nimport LineDraw from '../helper/LineDraw';\r\nimport RoamController, { RoamControllerHost } from '../../component/helper/RoamController';\r\nimport * as roamHelper from '../../component/helper/roamHelper';\r\nimport {onIrrelevantElement} from '../../component/helper/cursorHelper';\r\nimport * as graphic from '../../util/graphic';\r\nimport adjustEdge from './adjustEdge';\r\nimport {getNodeGlobalScale} from './graphHelper';\r\nimport ChartView from '../../view/Chart';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GraphSeriesModel, { GraphNodeItemOption, GraphEdgeItemOption } from './GraphSeries';\r\nimport { CoordinateSystem } from '../../coord/CoordinateSystem';\r\nimport View from '../../coord/View';\r\nimport Symbol from '../helper/Symbol';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Line from '../helper/Line';\r\nimport { getECData } from '../../util/innerStore';\r\n\r\nimport { simpleLayoutEdge } from './simpleLayoutHelper';\r\nimport { circularLayout, rotateNodeLabel } from './circularLayoutHelper';\r\n\r\nfunction isViewCoordSys(coordSys: CoordinateSystem): coordSys is View {\r\n return coordSys.type === 'view';\r\n}\r\n\r\nclass GraphView extends ChartView {\r\n\r\n static readonly type = 'graph';\r\n readonly type = GraphView.type;\r\n\r\n private _symbolDraw: SymbolDraw;\r\n private _lineDraw: LineDraw;\r\n\r\n private _controller: RoamController;\r\n private _controllerHost: RoamControllerHost;\r\n\r\n private _firstRender: boolean;\r\n\r\n private _model: GraphSeriesModel;\r\n\r\n private _layoutTimeout: number;\r\n\r\n private _layouting: boolean;\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const symbolDraw = new SymbolDraw();\r\n const lineDraw = new LineDraw();\r\n const group = this.group;\r\n\r\n this._controller = new RoamController(api.getZr());\r\n this._controllerHost = {\r\n target: group\r\n } as RoamControllerHost;\r\n\r\n group.add(symbolDraw.group);\r\n group.add(lineDraw.group);\r\n\r\n this._symbolDraw = symbolDraw;\r\n this._lineDraw = lineDraw;\r\n\r\n this._firstRender = true;\r\n }\r\n\r\n render(seriesModel: GraphSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n\r\n this._model = seriesModel;\r\n\r\n const symbolDraw = this._symbolDraw;\r\n const lineDraw = this._lineDraw;\r\n\r\n const group = this.group;\r\n\r\n if (isViewCoordSys(coordSys)) {\r\n const groupNewProp = {\r\n x: coordSys.x, y: coordSys.y,\r\n scaleX: coordSys.scaleX, scaleY: coordSys.scaleY\r\n };\r\n if (this._firstRender) {\r\n group.attr(groupNewProp);\r\n }\r\n else {\r\n graphic.updateProps(group, groupNewProp, seriesModel);\r\n }\r\n }\r\n // Fix edge contact point with node\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n\r\n const data = seriesModel.getData();\r\n symbolDraw.updateData(data as ListForSymbolDraw);\r\n\r\n const edgeData = seriesModel.getEdgeData();\r\n // TODO: TYPE\r\n lineDraw.updateData(edgeData as SeriesData);\r\n\r\n this._updateNodeAndLinkScale();\r\n\r\n this._updateController(seriesModel, ecModel, api);\r\n\r\n clearTimeout(this._layoutTimeout);\r\n const forceLayout = seriesModel.forceLayout;\r\n const layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\r\n if (forceLayout) {\r\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n }\r\n\r\n const layout = seriesModel.get('layout');\r\n\r\n data.graph.eachNode((node) => {\r\n const idx = node.dataIndex;\r\n const el = node.getGraphicEl() as Symbol;\r\n const itemModel = node.getModel();\r\n\r\n if (!el) {\r\n return;\r\n }\r\n\r\n // Update draggable\r\n el.off('drag').off('dragend');\r\n const draggable = itemModel.get('draggable');\r\n if (draggable) {\r\n el.on('drag', (e) => {\r\n switch (layout) {\r\n case 'force':\r\n forceLayout.warmUp();\r\n !this._layouting\r\n && this._startForceLayoutIteration(forceLayout, layoutAnimation);\r\n forceLayout.setFixed(idx);\r\n // Write position back to layout\r\n data.setItemLayout(idx, [el.x, el.y]);\r\n break;\r\n case 'circular':\r\n data.setItemLayout(idx, [el.x, el.y]);\r\n // mark node fixed\r\n node.setLayout({ fixed: true }, true);\r\n // recalculate circular layout\r\n circularLayout(seriesModel, 'symbolSize', node, [e.offsetX, e.offsetY]);\r\n this.updateLayout(seriesModel);\r\n break;\r\n case 'none':\r\n default:\r\n data.setItemLayout(idx, [el.x, el.y]);\r\n // update edge\r\n simpleLayoutEdge(seriesModel.getGraph(), seriesModel);\r\n this.updateLayout(seriesModel);\r\n break;\r\n }\r\n }).on('dragend', () => {\r\n if (forceLayout) {\r\n forceLayout.setUnfixed(idx);\r\n }\r\n });\r\n }\r\n el.setDraggable(draggable, !!itemModel.get('cursor'));\r\n\r\n const focus = itemModel.get(['emphasis', 'focus']);\r\n\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = node.getAdjacentDataIndices();\r\n }\r\n });\r\n\r\n data.graph.eachEdge(function (edge) {\r\n const el = edge.getGraphicEl() as Line;\r\n const focus = edge.getModel().get(['emphasis', 'focus']);\r\n\r\n if (!el) {\r\n return;\r\n }\r\n\r\n if (focus === 'adjacency') {\r\n getECData(el).focus = {\r\n edge: [edge.dataIndex],\r\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\r\n };\r\n }\r\n });\r\n\r\n const circularRotateLabel = seriesModel.get('layout') === 'circular'\r\n && seriesModel.get(['circular', 'rotateLabel']);\r\n const cx = data.getLayout('cx');\r\n const cy = data.getLayout('cy');\r\n data.graph.eachNode((node) => {\r\n rotateNodeLabel(node, circularRotateLabel, cx, cy);\r\n });\r\n\r\n this._firstRender = false;\r\n }\r\n\r\n dispose() {\r\n this.remove();\r\n\r\n this._controller && this._controller.dispose();\r\n this._controllerHost = null;\r\n }\r\n\r\n _startForceLayoutIteration(\r\n forceLayout: GraphSeriesModel['forceLayout'],\r\n layoutAnimation?: boolean\r\n ) {\r\n const self = this;\r\n (function step() {\r\n forceLayout.step(function (stopped) {\r\n self.updateLayout(self._model);\r\n (self._layouting = !stopped) && (\r\n layoutAnimation\r\n ? (self._layoutTimeout = setTimeout(step, 16) as any)\r\n : step()\r\n );\r\n });\r\n })();\r\n }\r\n\r\n _updateController(\r\n seriesModel: GraphSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const controller = this._controller;\r\n const controllerHost = this._controllerHost;\r\n const group = this.group;\r\n\r\n controller.setPointerChecker(function (e, x, y) {\r\n const rect = group.getBoundingRect();\r\n rect.applyTransform(group.transform);\r\n return rect.contain(x, y)\r\n && !onIrrelevantElement(e, api, seriesModel);\r\n });\r\n\r\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\r\n controller.disable();\r\n return;\r\n }\r\n controller.enable(seriesModel.get('roam'));\r\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\r\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\r\n\r\n controller\r\n .off('pan')\r\n .off('zoom')\r\n .on('pan', (e) => {\r\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n dx: e.dx,\r\n dy: e.dy\r\n });\r\n })\r\n .on('zoom', (e) => {\r\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\r\n api.dispatchAction({\r\n seriesId: seriesModel.id,\r\n type: 'graphRoam',\r\n zoom: e.scale,\r\n originX: e.originX,\r\n originY: e.originY\r\n });\r\n this._updateNodeAndLinkScale();\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n this._lineDraw.updateLayout();\r\n // Only update label layout on zoom\r\n api.updateLabelLayout();\r\n });\r\n }\r\n\r\n _updateNodeAndLinkScale() {\r\n const seriesModel = this._model;\r\n const data = seriesModel.getData();\r\n\r\n const nodeScale = getNodeGlobalScale(seriesModel);\r\n\r\n data.eachItemGraphicEl(function (el: Symbol, idx) {\r\n el && el.setSymbolScale(nodeScale);\r\n });\r\n }\r\n\r\n updateLayout(seriesModel: GraphSeriesModel) {\r\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\r\n\r\n this._symbolDraw.updateLayout();\r\n this._lineDraw.updateLayout();\r\n }\r\n\r\n remove() {\r\n clearTimeout(this._layoutTimeout);\r\n this._layouting = false;\r\n this._layoutTimeout = null;\r\n\r\n this._symbolDraw && this._symbolDraw.remove();\r\n this._lineDraw && this._lineDraw.remove();\r\n }\r\n}\r\n\r\nexport default GraphView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport SeriesData from './SeriesData';\r\nimport Model from '../model/Model';\r\nimport Element from 'zrender/src/Element';\r\nimport { DimensionLoose, ParsedValue } from '../util/types';\r\n\r\n// id may be function name of Object, add a prefix to avoid this problem.\r\nfunction generateNodeKey(id: string): string {\r\n return '_EC_' + id;\r\n}\r\n\r\nclass Graph {\r\n type: 'graph' = 'graph';\r\n\r\n readonly nodes: GraphNode[] = [];\r\n\r\n readonly edges: GraphEdge[] = [];\r\n\r\n data: SeriesData;\r\n\r\n edgeData: SeriesData;\r\n\r\n /**\r\n * Whether directed graph.\r\n */\r\n private _directed: boolean;\r\n\r\n private _nodesMap: Dictionary = {};\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n private _edgesMap: Dictionary = {};\r\n\r\n\r\n constructor(directed?: boolean) {\r\n this._directed = directed || false;\r\n }\r\n\r\n /**\r\n * If is directed graph\r\n */\r\n isDirected(): boolean {\r\n return this._directed;\r\n };\r\n\r\n /**\r\n * Add a new node\r\n */\r\n addNode(id: string | number, dataIndex?: number): GraphNode {\r\n id = id == null ? ('' + dataIndex) : ('' + id);\r\n\r\n const nodesMap = this._nodesMap;\r\n\r\n if (nodesMap[generateNodeKey(id)]) {\r\n if (__DEV__) {\r\n console.error('Graph nodes have duplicate name or id');\r\n }\r\n return;\r\n }\r\n\r\n const node = new GraphNode(id, dataIndex);\r\n node.hostGraph = this;\r\n\r\n this.nodes.push(node);\r\n\r\n nodesMap[generateNodeKey(id)] = node;\r\n return node;\r\n };\r\n\r\n /**\r\n * Get node by data index\r\n */\r\n getNodeByIndex(dataIndex: number): GraphNode {\r\n const rawIdx = this.data.getRawIndex(dataIndex);\r\n return this.nodes[rawIdx];\r\n };\r\n /**\r\n * Get node by id\r\n */\r\n getNodeById(id: string): GraphNode {\r\n return this._nodesMap[generateNodeKey(id)];\r\n };\r\n\r\n /**\r\n * Add a new edge\r\n */\r\n addEdge(n1: GraphNode | number | string, n2: GraphNode | number | string, dataIndex?: number) {\r\n const nodesMap = this._nodesMap;\r\n const edgesMap = this._edgesMap;\r\n\r\n // PENDING\r\n if (zrUtil.isNumber(n1)) {\r\n n1 = this.nodes[n1];\r\n }\r\n if (zrUtil.isNumber(n2)) {\r\n n2 = this.nodes[n2];\r\n }\r\n\r\n if (!(n1 instanceof GraphNode)) {\r\n n1 = nodesMap[generateNodeKey(n1)];\r\n }\r\n if (!(n2 instanceof GraphNode)) {\r\n n2 = nodesMap[generateNodeKey(n2)];\r\n }\r\n if (!n1 || !n2) {\r\n return;\r\n }\r\n\r\n const key = n1.id + '-' + n2.id;\r\n\r\n const edge = new GraphEdge(n1, n2, dataIndex);\r\n edge.hostGraph = this;\r\n\r\n if (this._directed) {\r\n n1.outEdges.push(edge);\r\n n2.inEdges.push(edge);\r\n }\r\n n1.edges.push(edge);\r\n if (n1 !== n2) {\r\n n2.edges.push(edge);\r\n }\r\n\r\n this.edges.push(edge);\r\n edgesMap[key] = edge;\r\n\r\n return edge;\r\n };\r\n\r\n /**\r\n * Get edge by data index\r\n */\r\n getEdgeByIndex(dataIndex: number): GraphEdge {\r\n const rawIdx = this.edgeData.getRawIndex(dataIndex);\r\n return this.edges[rawIdx];\r\n };\r\n /**\r\n * Get edge by two linked nodes\r\n */\r\n getEdge(n1: string | GraphNode, n2: string | GraphNode): GraphEdge {\r\n if (n1 instanceof GraphNode) {\r\n n1 = n1.id;\r\n }\r\n if (n2 instanceof GraphNode) {\r\n n2 = n2.id;\r\n }\r\n\r\n const edgesMap = this._edgesMap;\r\n\r\n if (this._directed) {\r\n return edgesMap[n1 + '-' + n2];\r\n }\r\n else {\r\n return edgesMap[n1 + '-' + n2]\r\n || edgesMap[n2 + '-' + n1];\r\n }\r\n };\r\n\r\n /**\r\n * Iterate all nodes\r\n */\r\n eachNode(\r\n cb: (this: Ctx, node: GraphNode, idx: number) => void,\r\n context?: Ctx\r\n ) {\r\n const nodes = this.nodes;\r\n const len = nodes.length;\r\n for (let i = 0; i < len; i++) {\r\n if (nodes[i].dataIndex >= 0) {\r\n cb.call(context, nodes[i], i);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Iterate all edges\r\n */\r\n eachEdge(\r\n cb: (this: Ctx, edge: GraphEdge, idx: number) => void,\r\n context?: Ctx\r\n ) {\r\n const edges = this.edges;\r\n const len = edges.length;\r\n for (let i = 0; i < len; i++) {\r\n if (edges[i].dataIndex >= 0\r\n && edges[i].node1.dataIndex >= 0\r\n && edges[i].node2.dataIndex >= 0\r\n ) {\r\n cb.call(context, edges[i], i);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Breadth first traverse\r\n * Return true to stop traversing\r\n */\r\n breadthFirstTraverse(\r\n cb: (this: Ctx, node: GraphNode, fromNode: GraphNode) => boolean | void,\r\n startNode: GraphNode | string,\r\n direction: 'none' | 'in' | 'out',\r\n context?: Ctx\r\n ) {\r\n if (!(startNode instanceof GraphNode)) {\r\n startNode = this._nodesMap[generateNodeKey(startNode)];\r\n }\r\n if (!startNode) {\r\n return;\r\n }\r\n\r\n const edgeType: 'inEdges' | 'outEdges' | 'edges' = direction === 'out'\r\n ? 'outEdges' : (direction === 'in' ? 'inEdges' : 'edges');\r\n\r\n for (let i = 0; i < this.nodes.length; i++) {\r\n this.nodes[i].__visited = false;\r\n }\r\n\r\n if (cb.call(context, startNode, null)) {\r\n return;\r\n }\r\n\r\n const queue = [startNode];\r\n while (queue.length) {\r\n const currentNode = queue.shift();\r\n const edges = currentNode[edgeType];\r\n\r\n for (let i = 0; i < edges.length; i++) {\r\n const e = edges[i];\r\n const otherNode = e.node1 === currentNode\r\n ? e.node2 : e.node1;\r\n if (!otherNode.__visited) {\r\n if (cb.call(context, otherNode, currentNode)) {\r\n // Stop traversing\r\n return;\r\n }\r\n queue.push(otherNode);\r\n otherNode.__visited = true;\r\n }\r\n }\r\n }\r\n };\r\n\r\n // TODO\r\n // depthFirstTraverse(\r\n // cb, startNode, direction, context\r\n // ) {\r\n\r\n // };\r\n\r\n // Filter update\r\n update() {\r\n const data = this.data;\r\n const edgeData = this.edgeData;\r\n const nodes = this.nodes;\r\n const edges = this.edges;\r\n\r\n for (let i = 0, len = nodes.length; i < len; i++) {\r\n nodes[i].dataIndex = -1;\r\n }\r\n for (let i = 0, len = data.count(); i < len; i++) {\r\n nodes[data.getRawIndex(i)].dataIndex = i;\r\n }\r\n\r\n edgeData.filterSelf(function (idx) {\r\n const edge = edges[edgeData.getRawIndex(idx)];\r\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\r\n });\r\n\r\n // Update edge\r\n for (let i = 0, len = edges.length; i < len; i++) {\r\n edges[i].dataIndex = -1;\r\n }\r\n for (let i = 0, len = edgeData.count(); i < len; i++) {\r\n edges[edgeData.getRawIndex(i)].dataIndex = i;\r\n }\r\n };\r\n\r\n /**\r\n * @return {module:echarts/data/Graph}\r\n */\r\n clone() {\r\n const graph = new Graph(this._directed);\r\n const nodes = this.nodes;\r\n const edges = this.edges;\r\n for (let i = 0; i < nodes.length; i++) {\r\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\r\n }\r\n for (let i = 0; i < edges.length; i++) {\r\n const e = edges[i];\r\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\r\n }\r\n return graph;\r\n };\r\n\r\n\r\n}\r\n\r\n\r\nclass GraphNode {\r\n\r\n id: string;\r\n\r\n inEdges: GraphEdge[] = [];\r\n\r\n outEdges: GraphEdge[] = [];\r\n\r\n edges: GraphEdge[] = [];\r\n\r\n hostGraph: Graph;\r\n\r\n dataIndex: number = -1;\r\n\r\n // Used in traverse of Graph\r\n __visited: boolean;\r\n\r\n constructor(id?: string, dataIndex?: number) {\r\n this.id = id == null ? '' : id;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n degree() {\r\n return this.edges.length;\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n inDegree() {\r\n return this.inEdges.length;\r\n }\r\n\r\n /**\r\n * @return {number}\r\n */\r\n outDegree() {\r\n return this.outEdges.length;\r\n }\r\n\r\n // TODO: TYPE Same type with Model#getModel\r\n getModel(): Model;\r\n getModel(path: S): Model;\r\n getModel(path?: string): Model {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n const graph = this.hostGraph;\r\n const itemModel = graph.data.getItemModel(this.dataIndex);\r\n\r\n return itemModel.getModel(path as any);\r\n }\r\n\r\n getAdjacentDataIndices(): {node: number[], edge: number[]} {\r\n const dataIndices = {\r\n edge: [] as number[],\r\n node: [] as number[]\r\n };\r\n for (let i = 0; i < this.edges.length; i++) {\r\n const adjacentEdge = this.edges[i];\r\n if (adjacentEdge.dataIndex < 0) {\r\n continue;\r\n }\r\n dataIndices.edge.push(adjacentEdge.dataIndex);\r\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\r\n }\r\n return dataIndices;\r\n }\r\n\r\n getTrajectoryDataIndices(): {node: number[], edge: number[]} {\r\n const connectedEdgesMap = zrUtil.createHashMap();\r\n const connectedNodesMap = zrUtil.createHashMap();\r\n\r\n for (let i = 0; i < this.edges.length; i++) {\r\n const adjacentEdge = this.edges[i];\r\n if (adjacentEdge.dataIndex < 0) {\r\n continue;\r\n }\r\n\r\n connectedEdgesMap.set(adjacentEdge.dataIndex, true);\r\n\r\n const sourceNodesQueue = [adjacentEdge.node1];\r\n const targetNodesQueue = [adjacentEdge.node2];\r\n\r\n let nodeIteratorIndex = 0;\r\n while (nodeIteratorIndex < sourceNodesQueue.length) {\r\n const sourceNode = sourceNodesQueue[nodeIteratorIndex];\r\n nodeIteratorIndex++;\r\n connectedNodesMap.set(sourceNode.dataIndex, true);\r\n\r\n for (let j = 0; j < sourceNode.inEdges.length; j++) {\r\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\r\n sourceNodesQueue.push(sourceNode.inEdges[j].node1);\r\n }\r\n }\r\n\r\n nodeIteratorIndex = 0;\r\n while (nodeIteratorIndex < targetNodesQueue.length) {\r\n const targetNode = targetNodesQueue[nodeIteratorIndex];\r\n nodeIteratorIndex++;\r\n connectedNodesMap.set(targetNode.dataIndex, true);\r\n for (let j = 0; j < targetNode.outEdges.length; j++) {\r\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\r\n targetNodesQueue.push(targetNode.outEdges[j].node2);\r\n }\r\n }\r\n }\r\n\r\n return {\r\n edge: connectedEdgesMap.keys(),\r\n node: connectedNodesMap.keys()\r\n };\r\n }\r\n}\r\n\r\n\r\nclass GraphEdge {\r\n /**\r\n * The first node. If directed graph, it represents the source node.\r\n */\r\n node1: GraphNode;\r\n /**\r\n * The second node. If directed graph, it represents the target node.\r\n */\r\n node2: GraphNode;\r\n\r\n dataIndex: number = -1;\r\n\r\n hostGraph: Graph;\r\n\r\n constructor(n1: GraphNode, n2: GraphNode, dataIndex?: number) {\r\n this.node1 = n1;\r\n this.node2 = n2;\r\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\r\n }\r\n\r\n getModel(): Model;\r\n getModel(path: S): Model;\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n getModel(path?: string): Model {\r\n if (this.dataIndex < 0) {\r\n return;\r\n }\r\n const graph = this.hostGraph;\r\n const itemModel = graph.edgeData.getItemModel(this.dataIndex);\r\n\r\n return itemModel.getModel(path as any);\r\n }\r\n\r\n getAdjacentDataIndices(): {node: number[], edge: number[]} {\r\n return {\r\n edge: [this.dataIndex],\r\n node: [this.node1.dataIndex, this.node2.dataIndex]\r\n };\r\n }\r\n\r\n getTrajectoryDataIndices(): {node: number[], edge: number[]} {\r\n const connectedEdgesMap = zrUtil.createHashMap();\r\n const connectedNodesMap = zrUtil.createHashMap();\r\n\r\n connectedEdgesMap.set(this.dataIndex, true);\r\n\r\n const sourceNodes = [this.node1];\r\n const targetNodes = [this.node2];\r\n\r\n let nodeIteratorIndex = 0;\r\n while (nodeIteratorIndex < sourceNodes.length) {\r\n const sourceNode = sourceNodes[nodeIteratorIndex];\r\n nodeIteratorIndex++;\r\n\r\n connectedNodesMap.set(sourceNode.dataIndex, true);\r\n\r\n for (let j = 0; j < sourceNode.inEdges.length; j++) {\r\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\r\n sourceNodes.push(sourceNode.inEdges[j].node1);\r\n }\r\n }\r\n\r\n nodeIteratorIndex = 0;\r\n while (nodeIteratorIndex < targetNodes.length) {\r\n const targetNode = targetNodes[nodeIteratorIndex];\r\n nodeIteratorIndex++;\r\n\r\n connectedNodesMap.set(targetNode.dataIndex, true);\r\n\r\n for (let j = 0; j < targetNode.outEdges.length; j++) {\r\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\r\n targetNodes.push(targetNode.outEdges[j].node2);\r\n }\r\n }\r\n\r\n return {\r\n edge: connectedEdgesMap.keys(),\r\n node: connectedNodesMap.keys()\r\n };\r\n }\r\n}\r\n\r\ntype GetDataName = Host extends GraphEdge ? 'edgeData' : 'data';\r\n\r\ninterface GraphDataProxyMixin {\r\n getValue(dimension?: DimensionLoose): ParsedValue;\r\n // TODO: TYPE stricter type.\r\n setVisual(key: string | Dictionary, value?: any): void;\r\n\r\n getVisual(key: string): any,\r\n\r\n setLayout(layout: any, merge?: boolean): void;\r\n\r\n getLayout(): any\r\n\r\n getGraphicEl(): Element\r\n\r\n getRawIndex(): number\r\n}\r\n\r\nfunction createGraphDataProxyMixin(\r\n hostName: 'hostGraph',\r\n dataName: GetDataName\r\n): GraphDataProxyMixin {\r\n return {\r\n /**\r\n * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\r\n */\r\n getValue(this: Host, dimension?: DimensionLoose): ParsedValue {\r\n const data = this[hostName][dataName];\r\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\r\n },\r\n // TODO: TYPE stricter type.\r\n setVisual(this: Host, key: string | Dictionary, value?: any) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemVisual(this.dataIndex, key as any, value);\r\n },\r\n\r\n getVisual(this: Host, key: string) {\r\n return this[hostName][dataName].getItemVisual(this.dataIndex, key as any);\r\n },\r\n\r\n setLayout(this: Host, layout: any, merge?: boolean) {\r\n this.dataIndex >= 0\r\n && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\r\n },\r\n\r\n getLayout(this: Host) {\r\n return this[hostName][dataName].getItemLayout(this.dataIndex);\r\n },\r\n\r\n getGraphicEl(this: Host): Element {\r\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\r\n },\r\n\r\n getRawIndex(this: Host) {\r\n return this[hostName][dataName].getRawIndex(this.dataIndex);\r\n }\r\n };\r\n};\r\n\r\n\r\ninterface GraphEdge extends GraphDataProxyMixin {};\r\ninterface GraphNode extends GraphDataProxyMixin {};\r\n\r\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\r\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\r\n\r\nexport default Graph;\r\n\r\nexport {GraphNode, GraphEdge};", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Graph from '../../data/Graph';\r\nimport linkSeriesData from '../../data/helper/linkSeriesData';\r\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions';\r\nimport CoordinateSystem from '../../core/CoordinateSystem';\r\nimport createSeriesData from './createSeriesData';\r\nimport {\r\n OptionSourceDataOriginal, GraphEdgeItemObject, OptionDataValue,\r\n OptionDataItemObject\r\n} from '../../util/types';\r\nimport SeriesModel from '../../model/Series';\r\nimport { convertOptionIdName } from '../../util/model';\r\n\r\nexport default function createGraphFromNodeEdge(\r\n nodes: OptionSourceDataOriginal>,\r\n edges: OptionSourceDataOriginal>,\r\n seriesModel: SeriesModel,\r\n directed: boolean,\r\n beforeLink: (nodeData: SeriesData, edgeData: SeriesData) => void\r\n): Graph {\r\n // ??? TODO\r\n // support dataset?\r\n const graph = new Graph(directed);\r\n for (let i = 0; i < nodes.length; i++) {\r\n graph.addNode(zrUtil.retrieve(\r\n // Id, name, dataIndex\r\n nodes[i].id, nodes[i].name, i\r\n ), i);\r\n }\r\n\r\n const linkNameList = [];\r\n const validEdges = [];\r\n let linkCount = 0;\r\n for (let i = 0; i < edges.length; i++) {\r\n const link = edges[i];\r\n const source = link.source;\r\n const target = link.target;\r\n // addEdge may fail when source or target not exists\r\n if (graph.addEdge(source, target, linkCount)) {\r\n validEdges.push(link);\r\n linkNameList.push(zrUtil.retrieve(\r\n convertOptionIdName(link.id, null),\r\n source + ' > ' + target\r\n ));\r\n linkCount++;\r\n }\r\n }\r\n\r\n const coordSys = seriesModel.get('coordinateSystem');\r\n let nodeData;\r\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\r\n nodeData = createSeriesData(nodes, seriesModel);\r\n }\r\n else {\r\n const coordSysCtor = CoordinateSystem.get(coordSys);\r\n const coordDimensions = coordSysCtor\r\n ? (coordSysCtor.dimensions || []) : [];\r\n // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\r\n // `value` dimension, but graph need `value` dimension. It's better to\r\n // uniform this behavior.\r\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\r\n coordDimensions.concat(['value']);\r\n }\r\n\r\n const { dimensions } = prepareSeriesDataSchema(nodes, {\r\n coordDimensions: coordDimensions,\r\n encodeDefine: seriesModel.getEncode()\r\n });\r\n nodeData = new SeriesData(dimensions, seriesModel);\r\n nodeData.initData(nodes);\r\n }\r\n\r\n const edgeData = new SeriesData(['value'], seriesModel);\r\n edgeData.initData(validEdges, linkNameList);\r\n\r\n beforeLink && beforeLink(nodeData, edgeData);\r\n\r\n linkSeriesData({\r\n mainData: nodeData,\r\n struct: graph,\r\n structAttr: 'graph',\r\n datas: {node: nodeData, edge: edgeData},\r\n datasAttr: {node: 'data', edge: 'edgeData'}\r\n });\r\n\r\n // Update dataIndex of nodes and edges because invalid edge may be removed\r\n graph.update();\r\n\r\n return graph;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesData from '../../data/SeriesData';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {defaultEmphasis} from '../../util/model';\r\nimport Model from '../../model/Model';\r\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge';\r\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\r\nimport {\r\n SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnPolarOptionMixin,\r\n SeriesOnCalendarOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n SeriesOnSingleOptionMixin,\r\n OptionDataValue,\r\n RoamOptionMixin,\r\n SeriesLabelOption,\r\n ItemStyleOption,\r\n LineStyleOption,\r\n SymbolOptionMixin,\r\n BoxLayoutOptionMixin,\r\n Dictionary,\r\n SeriesLineLabelOption,\r\n StatesOptionMixin,\r\n GraphEdgeItemObject,\r\n OptionDataValueNumeric,\r\n CallbackDataParams,\r\n DefaultEmphasisFocus\r\n} from '../../util/types';\r\nimport SeriesModel from '../../model/Series';\r\nimport Graph from '../../data/Graph';\r\nimport GlobalModel from '../../model/Global';\r\nimport { VectorArray } from 'zrender/src/core/vector';\r\nimport { ForceLayoutInstance } from './forceLayout';\r\nimport { LineDataVisual } from '../../visual/commonVisualTypes';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\r\nimport { defaultSeriesFormatTooltip } from '../../component/tooltip/seriesFormatTooltip';\r\nimport {initCurvenessList, createEdgeMapForCurveness} from '../helper/multipleGraphEdgeHelper';\r\n\r\n\r\ntype GraphDataValue = OptionDataValue | OptionDataValue[];\r\n\r\ninterface GraphEdgeLineStyleOption extends LineStyleOption {\r\n curveness?: number\r\n}\r\n\r\nexport interface GraphNodeStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\n\r\n\r\ninterface ExtraEmphasisState {\r\n focus?: DefaultEmphasisFocus | 'adjacency'\r\n}\r\ninterface GraphNodeStatesMixin {\r\n emphasis?: ExtraEmphasisState\r\n}\r\n\r\ninterface GraphEdgeStatesMixin {\r\n emphasis?: ExtraEmphasisState\r\n}\r\n\r\nexport interface GraphNodeItemOption extends SymbolOptionMixin, GraphNodeStateOption,\r\n StatesOptionMixin {\r\n\r\n id?: string\r\n name?: string\r\n value?: GraphDataValue\r\n\r\n /**\r\n * Fixed x position\r\n */\r\n x?: number\r\n /**\r\n * Fixed y position\r\n */\r\n y?: number\r\n\r\n /**\r\n * If this node is fixed during force layout.\r\n */\r\n fixed?: boolean\r\n\r\n /**\r\n * Index or name of category\r\n */\r\n category?: number | string\r\n\r\n draggable?: boolean\r\n cursor?: string\r\n}\r\n\r\nexport interface GraphEdgeStateOption {\r\n lineStyle?: GraphEdgeLineStyleOption\r\n label?: SeriesLineLabelOption\r\n}\r\nexport interface GraphEdgeItemOption extends\r\n GraphEdgeStateOption,\r\n StatesOptionMixin,\r\n GraphEdgeItemObject {\r\n\r\n value?: number\r\n\r\n /**\r\n * Symbol of both line ends\r\n */\r\n symbol?: string | string[]\r\n\r\n symbolSize?: number | number[]\r\n\r\n ignoreForceLayout?: boolean\r\n}\r\n\r\nexport interface GraphCategoryItemOption extends SymbolOptionMixin,\r\n GraphNodeStateOption, StatesOptionMixin {\r\n name?: string\r\n\r\n value?: OptionDataValue\r\n}\r\n\r\nexport interface GraphSeriesOption\r\n extends SeriesOption, GraphNodeStatesMixin>,\r\n SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin,\r\n SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin,\r\n SymbolOptionMixin,\r\n RoamOptionMixin,\r\n BoxLayoutOptionMixin {\r\n\r\n type?: 'graph'\r\n\r\n coordinateSystem?: string\r\n\r\n legendHoverLink?: boolean\r\n\r\n layout?: 'none' | 'force' | 'circular'\r\n\r\n data?: (GraphNodeItemOption | GraphDataValue)[]\r\n nodes?: (GraphNodeItemOption | GraphDataValue)[]\r\n\r\n edges?: GraphEdgeItemOption[]\r\n links?: GraphEdgeItemOption[]\r\n\r\n categories?: GraphCategoryItemOption[]\r\n\r\n /**\r\n * @deprecated\r\n */\r\n focusNodeAdjacency?: boolean\r\n\r\n /**\r\n * Symbol size scale ratio in roam\r\n */\r\n nodeScaleRatio?: 0.6,\r\n\r\n draggable?: boolean\r\n\r\n edgeSymbol?: string | string[]\r\n edgeSymbolSize?: number | number[]\r\n\r\n edgeLabel?: SeriesLineLabelOption\r\n label?: SeriesLabelOption\r\n\r\n itemStyle?: ItemStyleOption\r\n lineStyle?: GraphEdgeLineStyleOption\r\n\r\n emphasis?: {\r\n focus?: Exclude['focus']\r\n scale?: boolean | number\r\n label?: SeriesLabelOption\r\n edgeLabel?: SeriesLabelOption\r\n itemStyle?: ItemStyleOption\r\n lineStyle?: LineStyleOption\r\n }\r\n\r\n blur?: {\r\n label?: SeriesLabelOption\r\n edgeLabel?: SeriesLabelOption\r\n itemStyle?: ItemStyleOption\r\n lineStyle?: LineStyleOption\r\n }\r\n\r\n select?: {\r\n label?: SeriesLabelOption\r\n edgeLabel?: SeriesLabelOption\r\n itemStyle?: ItemStyleOption\r\n lineStyle?: LineStyleOption\r\n }\r\n\r\n // Configuration of circular layout\r\n circular?: {\r\n rotateLabel?: boolean\r\n }\r\n\r\n // Configuration of force directed layout\r\n force?: {\r\n initLayout?: 'circular' | 'none'\r\n // Node repulsion. Can be an array to represent range.\r\n repulsion?: number | number[]\r\n gravity?: number\r\n // Initial friction\r\n friction?: number\r\n\r\n // Edge length. Can be an array to represent range.\r\n edgeLength?: number | number[]\r\n\r\n layoutAnimation?: boolean\r\n }\r\n\r\n /**\r\n * auto curveness for multiple edge, invalid when `lineStyle.curveness` is set\r\n */\r\n autoCurveness?: boolean | number | number[]\r\n}\r\n\r\nclass GraphSeriesModel extends SeriesModel {\r\n static readonly type = 'series.graph';\r\n readonly type = GraphSeriesModel.type;\r\n\r\n static readonly dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n\r\n private _categoriesData: SeriesData;\r\n private _categoriesModels: Model[];\r\n\r\n /**\r\n * Preserved points during layouting\r\n */\r\n preservedPoints?: Dictionary;\r\n\r\n forceLayout?: ForceLayoutInstance;\r\n\r\n hasSymbolVisual = true;\r\n\r\n init(option: GraphSeriesOption) {\r\n super.init.apply(this, arguments as any);\r\n\r\n const self = this;\r\n function getCategoriesData() {\r\n return self._categoriesData;\r\n }\r\n // Provide data for legend select\r\n this.legendVisualProvider = new LegendVisualProvider(\r\n getCategoriesData, getCategoriesData\r\n );\r\n\r\n this.fillDataTextStyle(option.edges || option.links);\r\n\r\n this._updateCategoriesData();\r\n }\r\n\r\n mergeOption(option: GraphSeriesOption) {\r\n super.mergeOption.apply(this, arguments as any);\r\n\r\n this.fillDataTextStyle(option.edges || option.links);\r\n\r\n this._updateCategoriesData();\r\n }\r\n\r\n mergeDefaultAndTheme(option: GraphSeriesOption) {\r\n super.mergeDefaultAndTheme.apply(this, arguments as any);\r\n defaultEmphasis(option, 'edgeLabel', ['show']);\r\n }\r\n\r\n getInitialData(option: GraphSeriesOption, ecModel: GlobalModel): SeriesData {\r\n const edges = option.edges || option.links || [];\r\n const nodes = option.data || option.nodes || [];\r\n const self = this;\r\n\r\n if (nodes && edges) {\r\n // auto curveness\r\n initCurvenessList(this);\r\n const graph = createGraphFromNodeEdge(nodes as GraphNodeItemOption[], edges, this, true, beforeLink);\r\n zrUtil.each(graph.edges, function (edge) {\r\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\r\n }, this);\r\n return graph.data;\r\n }\r\n\r\n function beforeLink(nodeData: SeriesData, edgeData: SeriesData) {\r\n // Overwrite nodeData.getItemModel to\r\n nodeData.wrapMethod('getItemModel', function (model) {\r\n const categoriesModels = self._categoriesModels;\r\n const categoryIdx = model.getShallow('category');\r\n const categoryModel = categoriesModels[categoryIdx];\r\n if (categoryModel) {\r\n categoryModel.parentModel = model.parentModel;\r\n model.parentModel = categoryModel;\r\n }\r\n return model;\r\n });\r\n\r\n // TODO Inherit resolveParentPath by default in Model#getModel?\r\n const oldGetModel = Model.prototype.getModel;\r\n function newGetModel(this: Model, path: any, parentModel?: Model) {\r\n const model = oldGetModel.call(this, path, parentModel);\r\n model.resolveParentPath = resolveParentPath;\r\n return model;\r\n }\r\n\r\n edgeData.wrapMethod('getItemModel', function (model: Model) {\r\n model.resolveParentPath = resolveParentPath;\r\n model.getModel = newGetModel;\r\n return model;\r\n });\r\n\r\n function resolveParentPath(this: Model, pathArr: readonly string[]): string[] {\r\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\r\n const newPathArr = pathArr.slice();\r\n if (pathArr[0] === 'label') {\r\n newPathArr[0] = 'edgeLabel';\r\n }\r\n else if (pathArr[1] === 'label') {\r\n newPathArr[1] = 'edgeLabel';\r\n }\r\n return newPathArr;\r\n }\r\n return pathArr as string[];\r\n }\r\n }\r\n }\r\n\r\n getGraph(): Graph {\r\n return this.getData().graph;\r\n }\r\n\r\n getEdgeData() {\r\n return this.getGraph().edgeData as SeriesData;\r\n }\r\n\r\n getCategoriesData(): SeriesData {\r\n return this._categoriesData;\r\n }\r\n\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: string\r\n ) {\r\n if (dataType === 'edge') {\r\n const nodeData = this.getData();\r\n const params = this.getDataParams(dataIndex, dataType);\r\n const edge = nodeData.graph.getEdgeByIndex(dataIndex);\r\n const sourceName = nodeData.getName(edge.node1.dataIndex);\r\n const targetName = nodeData.getName(edge.node2.dataIndex);\r\n\r\n const nameArr = [];\r\n sourceName != null && nameArr.push(sourceName);\r\n targetName != null && nameArr.push(targetName);\r\n\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > '),\r\n value: params.value,\r\n noValue: params.value == null\r\n });\r\n }\r\n // dataType === 'node' or empty\r\n const nodeMarkup = defaultSeriesFormatTooltip({\r\n series: this,\r\n dataIndex: dataIndex,\r\n multipleSeries: multipleSeries\r\n });\r\n return nodeMarkup;\r\n }\r\n\r\n _updateCategoriesData() {\r\n const categories = zrUtil.map(this.option.categories || [], function (category) {\r\n // Data must has value\r\n return category.value != null ? category : zrUtil.extend({\r\n value: 0\r\n }, category);\r\n });\r\n const categoriesData = new SeriesData(['value'], this);\r\n categoriesData.initData(categories);\r\n\r\n this._categoriesData = categoriesData;\r\n\r\n this._categoriesModels = categoriesData.mapArray(function (idx) {\r\n return categoriesData.getItemModel(idx);\r\n });\r\n }\r\n\r\n setZoom(zoom: number) {\r\n this.option.zoom = zoom;\r\n }\r\n\r\n setCenter(center: number[]) {\r\n this.option.center = center;\r\n }\r\n\r\n isAnimationEnabled() {\r\n return super.isAnimationEnabled()\r\n // Not enable animation when do force layout\r\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\r\n }\r\n\r\n static defaultOption: GraphSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n\r\n coordinateSystem: 'view',\r\n\r\n // Default option for all coordinate systems\r\n // xAxisIndex: 0,\r\n // yAxisIndex: 0,\r\n // polarIndex: 0,\r\n // geoIndex: 0,\r\n\r\n legendHoverLink: true,\r\n\r\n layout: null,\r\n\r\n // Configuration of circular layout\r\n circular: {\r\n rotateLabel: false\r\n },\r\n // Configuration of force directed layout\r\n force: {\r\n initLayout: null,\r\n // Node repulsion. Can be an array to represent range.\r\n repulsion: [0, 50],\r\n gravity: 0.1,\r\n // Initial friction\r\n friction: 0.6,\r\n\r\n // Edge length. Can be an array to represent range.\r\n edgeLength: 30,\r\n\r\n layoutAnimation: true\r\n },\r\n\r\n left: 'center',\r\n top: 'center',\r\n // right: null,\r\n // bottom: null,\r\n // width: '80%',\r\n // height: '80%',\r\n\r\n symbol: 'circle',\r\n symbolSize: 10,\r\n\r\n edgeSymbol: ['none', 'none'],\r\n edgeSymbolSize: 10,\r\n edgeLabel: {\r\n position: 'middle',\r\n distance: 5\r\n },\r\n\r\n draggable: false,\r\n\r\n roam: false,\r\n\r\n // Default on center of graph\r\n center: null,\r\n\r\n zoom: 1,\r\n // Symbol size scale ratio in roam\r\n nodeScaleRatio: 0.6,\r\n\r\n // cursor: null,\r\n\r\n // categories: [],\r\n\r\n // data: []\r\n // Or\r\n // nodes: []\r\n //\r\n // links: []\r\n // Or\r\n // edges: []\r\n\r\n label: {\r\n show: false,\r\n formatter: '{b}'\r\n },\r\n\r\n itemStyle: {},\r\n\r\n lineStyle: {\r\n color: '#aaa',\r\n width: 1,\r\n opacity: 0.5\r\n },\r\n emphasis: {\r\n scale: true,\r\n label: {\r\n show: true\r\n }\r\n },\r\n\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport default GraphSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\nimport categoryFilter from './categoryFilter';\r\nimport categoryVisual from './categoryVisual';\r\nimport edgeVisual from './edgeVisual';\r\nimport simpleLayout from './simpleLayout';\r\nimport circularLayout from './circularLayout';\r\nimport forceLayout from './forceLayout';\r\nimport createView from './createView';\r\nimport View from '../../coord/View';\r\nimport GraphView from './GraphView';\r\nimport GraphSeriesModel from './GraphSeries';\r\nimport { RoamPayload, updateCenterAndZoom } from '../../action/roamHelper';\r\nimport GlobalModel from '../../model/Global';\r\nimport { noop } from 'zrender/src/core/util';\r\nimport type ExtensionAPI from '../../core/ExtensionAPI';\r\n\r\nconst actionInfo = {\r\n type: 'graphRoam',\r\n event: 'graphRoam',\r\n update: 'none'\r\n};\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerChartView(GraphView);\r\n registers.registerSeriesModel(GraphSeriesModel);\r\n\r\n registers.registerProcessor(categoryFilter);\r\n\r\n registers.registerVisual(categoryVisual);\r\n registers.registerVisual(edgeVisual);\r\n\r\n registers.registerLayout(simpleLayout);\r\n registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout);\r\n registers.registerLayout(forceLayout);\r\n\r\n registers.registerCoordinateSystem('graphView', {\r\n dimensions: View.dimensions,\r\n create: createView\r\n });\r\n\r\n // Register legacy focus actions\r\n registers.registerAction({\r\n type: 'focusNodeAdjacency',\r\n event: 'focusNodeAdjacency',\r\n update: 'series:focusNodeAdjacency'\r\n }, noop);\r\n\r\n registers.registerAction({\r\n type: 'unfocusNodeAdjacency',\r\n event: 'unfocusNodeAdjacency',\r\n update: 'series:unfocusNodeAdjacency'\r\n }, noop);\r\n\r\n // Register roam action.\r\n registers.registerAction(actionInfo, function (payload: RoamPayload, ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachComponent({\r\n mainType: 'series', query: payload\r\n }, function (seriesModel: GraphSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem as View;\r\n\r\n const res = updateCenterAndZoom(coordSys, payload, undefined, api);\r\n\r\n seriesModel.setCenter\r\n && seriesModel.setCenter(res.center);\r\n\r\n seriesModel.setZoom\r\n && seriesModel.setZoom(res.zoom);\r\n });\r\n });\r\n\r\n\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Path, { PathProps } from 'zrender/src/graphic/Path';\r\n\r\nclass PointerShape {\r\n angle = 0;\r\n width = 10;\r\n r = 10;\r\n x = 0;\r\n y = 0;\r\n}\r\n\r\ninterface PointerPathProps extends PathProps {\r\n shape?: Partial\r\n}\r\n\r\nexport default class PointerPath extends Path {\r\n\r\n readonly type = 'pointer';\r\n\r\n shape: PointerShape;\r\n\r\n constructor(opts?: PointerPathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new PointerShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: PointerShape) {\r\n const mathCos = Math.cos;\r\n const mathSin = Math.sin;\r\n\r\n const r = shape.r;\r\n const width = shape.width;\r\n let angle = shape.angle;\r\n const x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\r\n const y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\r\n\r\n angle = shape.angle - Math.PI / 2;\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(\r\n shape.x + mathCos(angle) * width,\r\n shape.y + mathSin(angle) * width\r\n );\r\n ctx.lineTo(\r\n shape.x + mathCos(shape.angle) * r,\r\n shape.y + mathSin(shape.angle) * r\r\n );\r\n ctx.lineTo(\r\n shape.x - mathCos(angle) * width,\r\n shape.y - mathSin(angle) * width\r\n );\r\n ctx.lineTo(x, y);\r\n }\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport PointerPath from './PointerPath';\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport {createTextStyle, setLabelValueAnimation, animateLabelValue} from '../../label/labelStyle';\r\nimport ChartView from '../../view/Chart';\r\nimport {parsePercent, round, linearMap} from '../../util/number';\r\nimport GaugeSeriesModel, { GaugeDataItemOption } from './GaugeSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { ColorString, ECElement } from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Sausage from '../../util/shape/sausage';\r\nimport {createSymbol} from '../../util/symbol';\r\nimport ZRImage from 'zrender/src/graphic/Image';\r\nimport { extend, isFunction, isString, isNumber, each } from 'zrender/src/core/util';\r\nimport {setCommonECData} from '../../util/innerStore';\r\nimport { normalizeArcAngles } from 'zrender/src/core/PathProxy';\r\n\r\ntype ECSymbol = ReturnType;\r\n\r\ninterface PosInfo {\r\n cx: number\r\n cy: number\r\n r: number\r\n}\r\n\r\nfunction parsePosition(seriesModel: GaugeSeriesModel, api: ExtensionAPI): PosInfo {\r\n const center = seriesModel.get('center');\r\n const width = api.getWidth();\r\n const height = api.getHeight();\r\n const size = Math.min(width, height);\r\n const cx = parsePercent(center[0], api.getWidth());\r\n const cy = parsePercent(center[1], api.getHeight());\r\n const r = parsePercent(seriesModel.get('radius'), size / 2);\r\n\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r: r\r\n };\r\n}\r\n\r\nfunction formatLabel(value: number, labelFormatter: string | ((value: number) => string)): string {\r\n let label = value == null ? '' : (value + '');\r\n if (labelFormatter) {\r\n if (isString(labelFormatter)) {\r\n label = labelFormatter.replace('{value}', label);\r\n }\r\n else if (isFunction(labelFormatter)) {\r\n label = labelFormatter(value);\r\n }\r\n }\r\n\r\n return label;\r\n}\r\n\r\nclass GaugeView extends ChartView {\r\n static type = 'gauge' as const;\r\n type = GaugeView.type;\r\n\r\n private _data: SeriesData;\r\n private _progressEls: graphic.Path[];\r\n\r\n private _titleEls: graphic.Text[];\r\n private _detailEls: graphic.Text[];\r\n\r\n render(seriesModel: GaugeSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n this.group.removeAll();\r\n\r\n const colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\r\n const posInfo = parsePosition(seriesModel, api);\r\n\r\n this._renderMain(\r\n seriesModel, ecModel, api, colorList, posInfo\r\n );\r\n\r\n this._data = seriesModel.getData();\r\n }\r\n\r\n dispose() {}\r\n\r\n _renderMain(\r\n seriesModel: GaugeSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n colorList: [number, ColorString][],\r\n posInfo: PosInfo\r\n ) {\r\n const group = this.group;\r\n const clockwise = seriesModel.get('clockwise');\r\n let startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\r\n let endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\r\n const axisLineModel = seriesModel.getModel('axisLine');\r\n\r\n const roundCap = axisLineModel.get('roundCap');\r\n const MainPath = roundCap ? Sausage : graphic.Sector;\r\n\r\n const showAxis = axisLineModel.get('show');\r\n const lineStyleModel = axisLineModel.getModel('lineStyle');\r\n const axisLineWidth = lineStyleModel.get('width');\r\n\r\n const angles = [startAngle, endAngle];\r\n normalizeArcAngles(angles, !clockwise);\r\n startAngle = angles[0];\r\n endAngle = angles[1];\r\n const angleRangeSpan = endAngle - startAngle;\r\n\r\n let prevEndAngle = startAngle;\r\n\r\n const sectors: (Sausage | graphic.Sector)[] = [];\r\n for (let i = 0; showAxis && i < colorList.length; i++) {\r\n // Clamp\r\n const percent = Math.min(Math.max(colorList[i][0], 0), 1);\r\n endAngle = startAngle + angleRangeSpan * percent;\r\n const sector = new MainPath({\r\n shape: {\r\n startAngle: prevEndAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: posInfo.r - axisLineWidth,\r\n r: posInfo.r\r\n },\r\n silent: true\r\n });\r\n\r\n sector.setStyle({\r\n fill: colorList[i][1]\r\n });\r\n\r\n sector.setStyle(lineStyleModel.getLineStyle(\r\n // Because we use sector to simulate arc\r\n // so the properties for stroking are useless\r\n ['color', 'width']\r\n ));\r\n\r\n sectors.push(sector);\r\n\r\n prevEndAngle = endAngle;\r\n }\r\n\r\n sectors.reverse();\r\n each(sectors, sector => group.add(sector));\r\n\r\n const getColor = function (percent: number) {\r\n // Less than 0\r\n if (percent <= 0) {\r\n return colorList[0][1];\r\n }\r\n let i;\r\n for (i = 0; i < colorList.length; i++) {\r\n if (colorList[i][0] >= percent\r\n && (i === 0 ? 0 : colorList[i - 1][0]) < percent\r\n ) {\r\n return colorList[i][1];\r\n }\r\n }\r\n // More than 1\r\n return colorList[i - 1][1];\r\n };\r\n\r\n this._renderTicks(\r\n seriesModel, ecModel, api, getColor, posInfo,\r\n startAngle, endAngle, clockwise, axisLineWidth\r\n );\r\n\r\n this._renderTitleAndDetail(\r\n seriesModel, ecModel, api, getColor, posInfo\r\n );\r\n\r\n this._renderAnchor(seriesModel, posInfo);\r\n\r\n this._renderPointer(\r\n seriesModel, ecModel, api, getColor, posInfo,\r\n startAngle, endAngle, clockwise, axisLineWidth\r\n );\r\n }\r\n\r\n _renderTicks(\r\n seriesModel: GaugeSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n getColor: (percent: number) => ColorString,\r\n posInfo: PosInfo,\r\n startAngle: number,\r\n endAngle: number,\r\n clockwise: boolean,\r\n axisLineWidth: number\r\n ) {\r\n const group = this.group;\r\n const cx = posInfo.cx;\r\n const cy = posInfo.cy;\r\n const r = posInfo.r;\r\n\r\n const minVal = +seriesModel.get('min');\r\n const maxVal = +seriesModel.get('max');\r\n\r\n const splitLineModel = seriesModel.getModel('splitLine');\r\n const tickModel = seriesModel.getModel('axisTick');\r\n const labelModel = seriesModel.getModel('axisLabel');\r\n\r\n const splitNumber = seriesModel.get('splitNumber');\r\n const subSplitNumber = tickModel.get('splitNumber');\r\n\r\n const splitLineLen = parsePercent(\r\n splitLineModel.get('length'), r\r\n );\r\n const tickLen = parsePercent(\r\n tickModel.get('length'), r\r\n );\r\n\r\n let angle = startAngle;\r\n const step = (endAngle - startAngle) / splitNumber;\r\n const subStep = step / subSplitNumber;\r\n\r\n const splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\r\n const tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\r\n\r\n const splitLineDistance = splitLineModel.get('distance');\r\n\r\n let unitX;\r\n let unitY;\r\n\r\n for (let i = 0; i <= splitNumber; i++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n // Split line\r\n if (splitLineModel.get('show')) {\r\n const distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\r\n const splitLine = new graphic.Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - splitLineLen - distance) + cx,\r\n y2: unitY * (r - splitLineLen - distance) + cy\r\n },\r\n style: splitLineStyle,\r\n silent: true\r\n });\r\n if (splitLineStyle.stroke === 'auto') {\r\n splitLine.setStyle({\r\n stroke: getColor(i / splitNumber)\r\n });\r\n }\r\n\r\n group.add(splitLine);\r\n }\r\n\r\n // Label\r\n if (labelModel.get('show')) {\r\n const distance = labelModel.get('distance') + splitLineDistance;\r\n\r\n const label = formatLabel(\r\n round(i / splitNumber * (maxVal - minVal) + minVal),\r\n labelModel.get('formatter')\r\n );\r\n const autoColor = getColor(i / splitNumber);\r\n const textStyleX = unitX * (r - splitLineLen - distance) + cx;\r\n const textStyleY = unitY * (r - splitLineLen - distance) + cy;\r\n\r\n const rotateType = labelModel.get('rotate');\r\n let rotate = 0;\r\n if (rotateType === 'radial') {\r\n rotate = -angle + 2 * Math.PI;\r\n if (rotate > Math.PI / 2) {\r\n rotate += Math.PI;\r\n }\r\n }\r\n else if (rotateType === 'tangential') {\r\n rotate = -angle - Math.PI / 2;\r\n }\r\n else if (isNumber(rotateType)) {\r\n rotate = rotateType * Math.PI / 180;\r\n }\r\n\r\n if (rotate === 0) {\r\n group.add(new graphic.Text({\r\n style: createTextStyle(labelModel, {\r\n text: label,\r\n x: textStyleX,\r\n y: textStyleY,\r\n verticalAlign: unitY < -0.8 ? 'top' : (unitY > 0.8 ? 'bottom' : 'middle'),\r\n align: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center')\r\n }, {\r\n inheritColor: autoColor\r\n }),\r\n silent: true\r\n }));\r\n }\r\n else {\r\n group.add(new graphic.Text({\r\n style: createTextStyle(labelModel, {\r\n text: label,\r\n x: textStyleX,\r\n y: textStyleY,\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n }, {\r\n inheritColor: autoColor\r\n }),\r\n silent: true,\r\n originX: textStyleX,\r\n originY: textStyleY,\r\n rotation: rotate\r\n }));\r\n }\r\n }\r\n\r\n // Axis tick\r\n if (tickModel.get('show') && i !== splitNumber) {\r\n let distance = tickModel.get('distance');\r\n distance = distance ? distance + axisLineWidth : axisLineWidth;\r\n\r\n for (let j = 0; j <= subSplitNumber; j++) {\r\n unitX = Math.cos(angle);\r\n unitY = Math.sin(angle);\r\n const tickLine = new graphic.Line({\r\n shape: {\r\n x1: unitX * (r - distance) + cx,\r\n y1: unitY * (r - distance) + cy,\r\n x2: unitX * (r - tickLen - distance) + cx,\r\n y2: unitY * (r - tickLen - distance) + cy\r\n },\r\n silent: true,\r\n style: tickLineStyle\r\n });\r\n\r\n if (tickLineStyle.stroke === 'auto') {\r\n tickLine.setStyle({\r\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\r\n });\r\n }\r\n\r\n group.add(tickLine);\r\n angle += subStep;\r\n }\r\n angle -= subStep;\r\n }\r\n else {\r\n angle += step;\r\n }\r\n }\r\n }\r\n\r\n _renderPointer(\r\n seriesModel: GaugeSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n getColor: (percent: number) => ColorString,\r\n posInfo: PosInfo,\r\n startAngle: number,\r\n endAngle: number,\r\n clockwise: boolean,\r\n axisLineWidth: number\r\n ) {\r\n\r\n const group = this.group;\r\n const oldData = this._data;\r\n const oldProgressData = this._progressEls;\r\n const progressList = [] as graphic.Path[];\r\n\r\n const showPointer = seriesModel.get(['pointer', 'show']);\r\n const progressModel = seriesModel.getModel('progress');\r\n const showProgress = progressModel.get('show');\r\n\r\n const data = seriesModel.getData();\r\n const valueDim = data.mapDimension('value');\r\n const minVal = +seriesModel.get('min');\r\n const maxVal = +seriesModel.get('max');\r\n const valueExtent = [minVal, maxVal];\r\n const angleExtent = [startAngle, endAngle];\r\n\r\n function createPointer(idx: number, angle: number) {\r\n const itemModel = data.getItemModel(idx);\r\n const pointerModel = itemModel.getModel('pointer');\r\n const pointerWidth = parsePercent(pointerModel.get('width'), posInfo.r);\r\n const pointerLength = parsePercent(pointerModel.get('length'), posInfo.r);\r\n const pointerStr = seriesModel.get(['pointer', 'icon']);\r\n const pointerOffset = pointerModel.get('offsetCenter');\r\n const pointerOffsetX = parsePercent(pointerOffset[0], posInfo.r);\r\n const pointerOffsetY = parsePercent(pointerOffset[1], posInfo.r);\r\n const pointerKeepAspect = pointerModel.get('keepAspect');\r\n\r\n let pointer;\r\n // not exist icon type will be set 'rect'\r\n if (pointerStr) {\r\n pointer = createSymbol(\r\n pointerStr,\r\n pointerOffsetX - pointerWidth / 2,\r\n pointerOffsetY - pointerLength,\r\n pointerWidth,\r\n pointerLength,\r\n null,\r\n pointerKeepAspect\r\n ) as graphic.Path;\r\n }\r\n else {\r\n pointer = new PointerPath({\r\n shape: {\r\n angle: -Math.PI / 2,\r\n width: pointerWidth,\r\n r: pointerLength,\r\n x: pointerOffsetX,\r\n y: pointerOffsetY\r\n }\r\n });\r\n }\r\n pointer.rotation = -(angle + Math.PI / 2);\r\n pointer.x = posInfo.cx;\r\n pointer.y = posInfo.cy;\r\n return pointer;\r\n }\r\n\r\n function createProgress(idx: number, endAngle: number) {\r\n const roundCap = progressModel.get('roundCap');\r\n const ProgressPath = roundCap ? Sausage : graphic.Sector;\r\n\r\n const isOverlap = progressModel.get('overlap');\r\n const progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\r\n const r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\r\n const r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\r\n const progress = new ProgressPath({\r\n shape: {\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n cx: posInfo.cx,\r\n cy: posInfo.cy,\r\n clockwise: clockwise,\r\n r0: r0,\r\n r: r\r\n }\r\n });\r\n isOverlap && (progress.z2 = linearMap(data.get(valueDim, idx) as number, [minVal, maxVal], [100, 0], true));\r\n return progress;\r\n }\r\n\r\n if (showProgress || showPointer) {\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n const val = data.get(valueDim, idx) as number;\r\n if (showPointer) {\r\n const pointer = createPointer(idx, startAngle);\r\n // TODO hide pointer on NaN value?\r\n graphic.initProps(pointer, {\r\n rotation: -(\r\n (isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true))\r\n + Math.PI / 2\r\n )\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(idx, pointer);\r\n }\r\n\r\n if (showProgress) {\r\n const progress = createProgress(idx, startAngle) as graphic.Sector;\r\n const isClip = progressModel.get('clip');\r\n graphic.initProps(progress, {\r\n shape: {\r\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n // Add data index and series index for indexing the data by element\r\n // Useful in tooltip\r\n setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress);\r\n progressList[idx] = progress;\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n const val = data.get(valueDim, newIdx) as number;\r\n if (showPointer) {\r\n const previousPointer = oldData.getItemGraphicEl(oldIdx) as PointerPath;\r\n const previousRotate = previousPointer ? previousPointer.rotation : startAngle;\r\n const pointer = createPointer(newIdx, previousRotate);\r\n pointer.rotation = previousRotate;\r\n graphic.updateProps(pointer, {\r\n rotation: -(\r\n (isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true))\r\n + Math.PI / 2\r\n )\r\n }, seriesModel);\r\n group.add(pointer);\r\n data.setItemGraphicEl(newIdx, pointer);\r\n }\r\n\r\n if (showProgress) {\r\n const previousProgress = oldProgressData[oldIdx];\r\n const previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\r\n const progress = createProgress(newIdx, previousEndAngle) as graphic.Sector;\r\n const isClip = progressModel.get('clip');\r\n graphic.updateProps(progress, {\r\n shape: {\r\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\r\n }\r\n }, seriesModel);\r\n group.add(progress);\r\n // Add data index and series index for indexing the data by element\r\n // Useful in tooltip\r\n setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress);\r\n progressList[newIdx] = progress;\r\n }\r\n })\r\n .execute();\r\n\r\n data.each(function (idx) {\r\n const itemModel = data.getItemModel(idx);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n const focus = emphasisModel.get('focus');\r\n const blurScope = emphasisModel.get('blurScope');\r\n const emphasisDisabled = emphasisModel.get('disabled');\r\n if (showPointer) {\r\n const pointer = data.getItemGraphicEl(idx) as ECSymbol;\r\n const symbolStyle = data.getItemVisual(idx, 'style');\r\n const visualColor = symbolStyle.fill;\r\n if (pointer instanceof ZRImage) {\r\n const pathStyle = pointer.style;\r\n pointer.useStyle(extend({\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolStyle));\r\n }\r\n else {\r\n pointer.useStyle(symbolStyle);\r\n pointer.type !== 'pointer' && pointer.setColor(visualColor);\r\n }\r\n\r\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\r\n\r\n\r\n if (pointer.style.fill === 'auto') {\r\n pointer.setStyle('fill', getColor(\r\n linearMap(data.get(valueDim, idx) as number, valueExtent, [0, 1], true)\r\n ));\r\n }\r\n\r\n (pointer as ECElement).z2EmphasisLift = 0;\r\n setStatesStylesFromModel(pointer, itemModel);\r\n toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled);\r\n }\r\n\r\n if (showProgress) {\r\n const progress = progressList[idx];\r\n progress.useStyle(data.getItemVisual(idx, 'style'));\r\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\r\n (progress as ECElement).z2EmphasisLift = 0;\r\n setStatesStylesFromModel(progress, itemModel);\r\n toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled);\r\n }\r\n });\r\n\r\n this._progressEls = progressList;\r\n }\r\n }\r\n\r\n _renderAnchor(\r\n seriesModel: GaugeSeriesModel,\r\n posInfo: PosInfo\r\n ) {\r\n const anchorModel = seriesModel.getModel('anchor');\r\n const showAnchor = anchorModel.get('show');\r\n if (showAnchor) {\r\n const anchorSize = anchorModel.get('size');\r\n const anchorType = anchorModel.get('icon');\r\n const offsetCenter = anchorModel.get('offsetCenter');\r\n const anchorKeepAspect = anchorModel.get('keepAspect');\r\n const anchor = createSymbol(\r\n anchorType,\r\n posInfo.cx - anchorSize / 2 + parsePercent(offsetCenter[0], posInfo.r),\r\n posInfo.cy - anchorSize / 2 + parsePercent(offsetCenter[1], posInfo.r),\r\n anchorSize,\r\n anchorSize,\r\n null,\r\n anchorKeepAspect\r\n ) as graphic.Path;\r\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\r\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\r\n this.group.add(anchor);\r\n }\r\n }\r\n\r\n _renderTitleAndDetail(\r\n seriesModel: GaugeSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n getColor: (percent: number) => ColorString,\r\n posInfo: PosInfo\r\n ) {\r\n const data = seriesModel.getData();\r\n const valueDim = data.mapDimension('value');\r\n const minVal = +seriesModel.get('min');\r\n const maxVal = +seriesModel.get('max');\r\n\r\n const contentGroup = new graphic.Group();\r\n\r\n const newTitleEls: graphic.Text[] = [];\r\n const newDetailEls: graphic.Text[] = [];\r\n const hasAnimation = seriesModel.isAnimationEnabled();\r\n\r\n const showPointerAbove = seriesModel.get(['pointer', 'showAbove']);\r\n\r\n data.diff(this._data)\r\n .add((idx) => {\r\n newTitleEls[idx] = new graphic.Text({\r\n silent: true\r\n });\r\n newDetailEls[idx] = new graphic.Text({\r\n silent: true\r\n });\r\n })\r\n .update((idx, oldIdx) => {\r\n newTitleEls[idx] = this._titleEls[oldIdx];\r\n newDetailEls[idx] = this._detailEls[oldIdx];\r\n })\r\n .execute();\r\n\r\n data.each(function (idx) {\r\n const itemModel = data.getItemModel(idx);\r\n const value = data.get(valueDim, idx) as number;\r\n const itemGroup = new graphic.Group();\r\n const autoColor = getColor(\r\n linearMap(value, [minVal, maxVal], [0, 1], true)\r\n );\r\n\r\n const itemTitleModel = itemModel.getModel('title');\r\n if (itemTitleModel.get('show')) {\r\n const titleOffsetCenter = itemTitleModel.get('offsetCenter');\r\n const titleX = posInfo.cx + parsePercent(titleOffsetCenter[0], posInfo.r);\r\n const titleY = posInfo.cy + parsePercent(titleOffsetCenter[1], posInfo.r);\r\n const labelEl = newTitleEls[idx];\r\n labelEl.attr({\r\n z2: showPointerAbove ? 0 : 2,\r\n style: createTextStyle(itemTitleModel, {\r\n x: titleX,\r\n y: titleY,\r\n text: data.getName(idx),\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, {inheritColor: autoColor})\r\n });\r\n\r\n itemGroup.add(labelEl);\r\n }\r\n\r\n const itemDetailModel = itemModel.getModel('detail');\r\n if (itemDetailModel.get('show')) {\r\n const detailOffsetCenter = itemDetailModel.get('offsetCenter');\r\n const detailX = posInfo.cx + parsePercent(detailOffsetCenter[0], posInfo.r);\r\n const detailY = posInfo.cy + parsePercent(detailOffsetCenter[1], posInfo.r);\r\n const width = parsePercent(itemDetailModel.get('width'), posInfo.r);\r\n const height = parsePercent(itemDetailModel.get('height'), posInfo.r);\r\n const detailColor = (\r\n seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor\r\n ) as string;\r\n const labelEl = newDetailEls[idx];\r\n const formatter = itemDetailModel.get('formatter');\r\n labelEl.attr({\r\n z2: showPointerAbove ? 0 : 2,\r\n style: createTextStyle(itemDetailModel, {\r\n x: detailX,\r\n y: detailY,\r\n text: formatLabel(value, formatter),\r\n width: isNaN(width) ? null : width,\r\n height: isNaN(height) ? null : height,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n }, {inheritColor: detailColor})\r\n });\r\n setLabelValueAnimation(\r\n labelEl,\r\n {normal: itemDetailModel},\r\n value,\r\n (value: number) => formatLabel(value, formatter)\r\n );\r\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, {\r\n getFormattedLabel(\r\n labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams\r\n ) {\r\n return formatLabel(\r\n extendParams\r\n ? extendParams.interpolatedValue as typeof value\r\n : value,\r\n formatter\r\n );\r\n }\r\n });\r\n\r\n itemGroup.add(labelEl);\r\n }\r\n\r\n contentGroup.add(itemGroup);\r\n });\r\n this.group.add(contentGroup);\r\n\r\n this._titleEls = newTitleEls;\r\n this._detailEls = newDetailEls;\r\n }\r\n\r\n}\r\n\r\nexport default GaugeView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n SeriesOption,\r\n CircleLayoutOptionMixin,\r\n LineStyleOption,\r\n ColorString,\r\n LabelOption,\r\n ItemStyleOption,\r\n OptionDataValueNumeric,\r\n StatesOptionMixin,\r\n SeriesEncodeOptionMixin,\r\n DefaultStatesMixinEmphasis,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\n\r\n// [percent, color]\r\ntype GaugeColorStop = [number, ColorString];\r\n\r\ninterface LabelFormatter {\r\n (value: number): string\r\n}\r\n\r\ninterface PointerOption {\r\n icon?: string\r\n show?: boolean\r\n /**\r\n * If pointer shows above title and detail\r\n */\r\n showAbove?: boolean,\r\n keepAspect?: boolean\r\n itemStyle?: ItemStyleOption\r\n /**\r\n * Can be percent\r\n */\r\n offsetCenter?: (number | string)[]\r\n length?: number | string\r\n width?: number\r\n}\r\n\r\ninterface AnchorOption {\r\n show?: boolean\r\n showAbove?: boolean\r\n size?: number\r\n icon?: string\r\n offsetCenter?: (number | string)[]\r\n keepAspect?: boolean\r\n itemStyle?: ItemStyleOption\r\n}\r\n\r\ninterface ProgressOption {\r\n show?: boolean\r\n overlap?: boolean\r\n width?: number\r\n roundCap?: boolean\r\n clip?: boolean\r\n itemStyle?: ItemStyleOption\r\n}\r\n\r\ninterface TitleOption extends LabelOption {\r\n /**\r\n * [x, y] offset\r\n */\r\n offsetCenter?: (number | string)[]\r\n formatter?: LabelFormatter | string\r\n\r\n /**\r\n * If do value animtion.\r\n */\r\n valueAnimation?: boolean\r\n}\r\n\r\ninterface DetailOption extends LabelOption {\r\n /**\r\n * [x, y] offset\r\n */\r\n offsetCenter?: (number | string)[]\r\n formatter?: LabelFormatter | string\r\n\r\n /**\r\n * If do value animtion.\r\n */\r\n valueAnimation?: boolean\r\n}\r\n\r\ninterface GaugeStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\nexport interface GaugeStateOption {\r\n itemStyle?: ItemStyleOption\r\n}\r\n\r\nexport interface GaugeDataItemOption extends GaugeStateOption,\r\n StatesOptionMixin, GaugeStatesMixin> {\r\n name?: string\r\n value?: OptionDataValueNumeric\r\n pointer?: PointerOption\r\n progress?: ProgressOption\r\n title?: TitleOption\r\n detail?: DetailOption\r\n}\r\nexport interface GaugeSeriesOption extends SeriesOption,\r\n GaugeStateOption,\r\n CircleLayoutOptionMixin, SeriesEncodeOptionMixin {\r\n type?: 'gauge'\r\n\r\n // override radius\r\n radius?: number | string\r\n\r\n startAngle?: number\r\n endAngle?: number\r\n clockwise?: boolean\r\n\r\n min?: number\r\n max?: number\r\n\r\n splitNumber?: number\r\n\r\n itemStyle?: ItemStyleOption\r\n\r\n axisLine?: {\r\n show?: boolean\r\n roundCap?: boolean\r\n lineStyle?: Omit & {\r\n color?: GaugeColorStop[]\r\n }\r\n },\r\n\r\n progress?: ProgressOption\r\n\r\n splitLine?: {\r\n show?: boolean\r\n /**\r\n * Can be percent\r\n */\r\n length?: number\r\n distance?: number\r\n lineStyle?: LineStyleOption\r\n }\r\n\r\n axisTick?: {\r\n show?: boolean\r\n splitNumber?: number\r\n /**\r\n * Can be percent\r\n */\r\n length?: number | string\r\n distance?: number\r\n lineStyle?: LineStyleOption\r\n }\r\n\r\n axisLabel?: Omit & {\r\n formatter?: LabelFormatter | string\r\n rotate?: 'tangential' | 'radial' | number\r\n }\r\n\r\n pointer?: PointerOption\r\n anchor?: AnchorOption\r\n\r\n title?: TitleOption\r\n detail?: DetailOption\r\n\r\n data?: (OptionDataValueNumeric | GaugeDataItemOption)[]\r\n}\r\n\r\nclass GaugeSeriesModel extends SeriesModel {\r\n\r\n static type = 'series.gauge' as const;\r\n type = GaugeSeriesModel.type;\r\n\r\n visualStyleAccessPath = 'itemStyle';\r\n\r\n getInitialData(option: GaugeSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesDataSimply(this, ['value']);\r\n }\r\n\r\n static defaultOption: GaugeSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n colorBy: 'data',\r\n // \u9ED8\u8BA4\u5168\u5C40\u5C45\u4E2D\r\n center: ['50%', '50%'],\r\n legendHoverLink: true,\r\n radius: '75%',\r\n startAngle: 225,\r\n endAngle: -45,\r\n clockwise: true,\r\n // \u6700\u5C0F\u503C\r\n min: 0,\r\n // \u6700\u5927\u503C\r\n max: 100,\r\n // \u5206\u5272\u6BB5\u6570\uFF0C\u9ED8\u8BA4\u4E3A10\r\n splitNumber: 10,\r\n // \u5750\u6807\u8F74\u7EBF\r\n axisLine: {\r\n // \u9ED8\u8BA4\u663E\u793A\uFF0C\u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\r\n show: true,\r\n roundCap: false,\r\n lineStyle: { // \u5C5E\u6027lineStyle\u63A7\u5236\u7EBF\u6761\u6837\u5F0F\r\n color: [[1, '#E6EBF8']],\r\n width: 10\r\n }\r\n },\r\n // \u5750\u6807\u8F74\u7EBF\r\n progress: {\r\n // \u9ED8\u8BA4\u663E\u793A\uFF0C\u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\r\n show: false,\r\n overlap: true,\r\n width: 10,\r\n roundCap: false,\r\n clip: true\r\n },\r\n // \u5206\u9694\u7EBF\r\n splitLine: {\r\n // \u9ED8\u8BA4\u663E\u793A\uFF0C\u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\r\n show: true,\r\n // \u5C5E\u6027length\u63A7\u5236\u7EBF\u957F\r\n length: 10,\r\n distance: 10,\r\n // \u5C5E\u6027lineStyle\uFF08\u8BE6\u89C1lineStyle\uFF09\u63A7\u5236\u7EBF\u6761\u6837\u5F0F\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 3,\r\n type: 'solid'\r\n }\r\n },\r\n // \u5750\u6807\u8F74\u5C0F\u6807\u8BB0\r\n axisTick: {\r\n // \u5C5E\u6027show\u63A7\u5236\u663E\u793A\u4E0E\u5426\uFF0C\u9ED8\u8BA4\u4E0D\u663E\u793A\r\n show: true,\r\n // \u6BCF\u4EFDsplit\u7EC6\u5206\u591A\u5C11\u6BB5\r\n splitNumber: 5,\r\n // \u5C5E\u6027length\u63A7\u5236\u7EBF\u957F\r\n length: 6,\r\n distance: 10,\r\n // \u5C5E\u6027lineStyle\u63A7\u5236\u7EBF\u6761\u6837\u5F0F\r\n lineStyle: {\r\n color: '#63677A',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n axisLabel: {\r\n show: true,\r\n distance: 15,\r\n // formatter: null,\r\n color: '#464646',\r\n fontSize: 12,\r\n rotate: 0\r\n },\r\n pointer: {\r\n icon: null,\r\n offsetCenter: [0, 0],\r\n show: true,\r\n showAbove: true,\r\n length: '60%',\r\n width: 6,\r\n keepAspect: false\r\n },\r\n anchor: {\r\n show: false,\r\n showAbove: false,\r\n size: 6,\r\n icon: 'circle',\r\n offsetCenter: [0, 0],\r\n keepAspect: false,\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 0,\r\n borderColor: '#5470c6'\r\n }\r\n },\r\n\r\n title: {\r\n show: true,\r\n // x, y\uFF0C\u5355\u4F4Dpx\r\n offsetCenter: [0, '20%'],\r\n // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\r\n color: '#464646',\r\n fontSize: 16,\r\n valueAnimation: false\r\n },\r\n detail: {\r\n show: true,\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderWidth: 0,\r\n borderColor: '#ccc',\r\n width: 100,\r\n height: null, // self-adaption\r\n padding: [5, 10],\r\n // x, y\uFF0C\u5355\u4F4Dpx\r\n offsetCenter: [0, '40%'],\r\n // formatter: null,\r\n // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\r\n color: '#464646',\r\n fontSize: 30,\r\n fontWeight: 'bold',\r\n lineHeight: 30,\r\n valueAnimation: false\r\n }\r\n };\r\n}\r\n\r\n\r\nexport default GaugeSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport GaugeView from './GaugeView';\r\nimport GaugeSeriesModel from './GaugeSeries';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(GaugeView);\r\n registers.registerSeriesModel(GaugeSeriesModel);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport ChartView from '../../view/Chart';\r\nimport FunnelSeriesModel, {FunnelDataItemOption} from './FunnelSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { ColorString } from '../../util/types';\r\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\n\r\nconst opacityAccessPath = ['itemStyle', 'opacity'] as const;\r\n\r\n/**\r\n * Piece of pie including Sector, Label, LabelLine\r\n */\r\nclass FunnelPiece extends graphic.Polygon {\r\n\r\n constructor(data: SeriesData, idx: number) {\r\n super();\r\n\r\n const polygon = this;\r\n const labelLine = new graphic.Polyline();\r\n const text = new graphic.Text();\r\n polygon.setTextContent(text);\r\n this.setTextGuideLine(labelLine);\r\n\r\n this.updateData(data, idx, true);\r\n }\r\n\r\n updateData(data: SeriesData, idx: number, firstCreate?: boolean) {\r\n\r\n const polygon = this;\r\n\r\n const seriesModel = data.hostModel;\r\n const itemModel = data.getItemModel(idx);\r\n const layout = data.getItemLayout(idx);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n let opacity = itemModel.get(opacityAccessPath);\r\n opacity = opacity == null ? 1 : opacity;\r\n\r\n if (!firstCreate) {\r\n saveOldStyle(polygon);\r\n }\r\n // Update common style\r\n polygon.useStyle(data.getItemVisual(idx, 'style'));\r\n polygon.style.lineJoin = 'round';\r\n\r\n if (firstCreate) {\r\n polygon.setShape({\r\n points: layout.points\r\n });\r\n polygon.style.opacity = 0;\r\n graphic.initProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n }\r\n }, seriesModel, idx);\r\n }\r\n else {\r\n graphic.updateProps(polygon, {\r\n style: {\r\n opacity: opacity\r\n },\r\n shape: {\r\n points: layout.points\r\n }\r\n }, seriesModel, idx);\r\n }\r\n\r\n setStatesStylesFromModel(polygon, itemModel);\r\n\r\n this._updateLabel(data, idx);\r\n\r\n toggleHoverEmphasis(\r\n this,\r\n emphasisModel.get('focus'),\r\n emphasisModel.get('blurScope'),\r\n emphasisModel.get('disabled')\r\n );\r\n }\r\n\r\n _updateLabel(data: SeriesData, idx: number) {\r\n const polygon = this;\r\n const labelLine = this.getTextGuideLine();\r\n const labelText = polygon.getTextContent();\r\n\r\n const seriesModel = data.hostModel;\r\n const itemModel = data.getItemModel(idx);\r\n const layout = data.getItemLayout(idx);\r\n const labelLayout = layout.label;\r\n const style = data.getItemVisual(idx, 'style');\r\n const visualColor = style.fill as ColorString;\r\n\r\n setLabelStyle(\r\n // position will not be used in setLabelStyle\r\n labelText,\r\n getLabelStatesModels(itemModel),\r\n {\r\n labelFetcher: data.hostModel as FunnelSeriesModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: data.getName(idx)\r\n },\r\n { normal: {\r\n align: labelLayout.textAlign,\r\n verticalAlign: labelLayout.verticalAlign\r\n } }\r\n );\r\n\r\n polygon.setTextConfig({\r\n local: true,\r\n inside: !!labelLayout.inside,\r\n insideStroke: visualColor,\r\n // insideFill: 'auto',\r\n outsideFill: visualColor\r\n });\r\n\r\n const linePoints = labelLayout.linePoints;\r\n\r\n labelLine.setShape({\r\n points: linePoints\r\n });\r\n\r\n polygon.textGuideLineConfig = {\r\n anchor: linePoints ? new graphic.Point(linePoints[0][0], linePoints[0][1]) : null\r\n };\r\n\r\n // Make sure update style on labelText after setLabelStyle.\r\n // Because setLabelStyle will replace a new style on it.\r\n graphic.updateProps(labelText, {\r\n style: {\r\n x: labelLayout.x,\r\n y: labelLayout.y\r\n }\r\n }, seriesModel, idx);\r\n\r\n labelText.attr({\r\n rotation: labelLayout.rotation,\r\n originX: labelLayout.x,\r\n originY: labelLayout.y,\r\n z2: 10\r\n });\r\n\r\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\r\n // Default use item visual color\r\n stroke: visualColor\r\n });\r\n }\r\n}\r\n\r\nclass FunnelView extends ChartView {\r\n static type = 'funnel' as const;\r\n type = FunnelView.type;\r\n\r\n private _data: SeriesData;\r\n\r\n ignoreLabelLineUpdate = true;\r\n\r\n render(seriesModel: FunnelSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n const oldData = this._data;\r\n\r\n const group = this.group;\r\n\r\n data.diff(oldData)\r\n .add(function (idx) {\r\n const funnelPiece = new FunnelPiece(data, idx);\r\n\r\n data.setItemGraphicEl(idx, funnelPiece);\r\n\r\n group.add(funnelPiece);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n const piece = oldData.getItemGraphicEl(oldIdx) as FunnelPiece;\r\n\r\n piece.updateData(data, newIdx);\r\n\r\n group.add(piece);\r\n data.setItemGraphicEl(newIdx, piece);\r\n })\r\n .remove(function (idx) {\r\n const piece = oldData.getItemGraphicEl(idx);\r\n graphic.removeElementWithFadeOut(piece, seriesModel, idx);\r\n })\r\n .execute();\r\n\r\n this._data = data;\r\n }\r\n\r\n remove() {\r\n this.group.removeAll();\r\n this._data = null;\r\n }\r\n\r\n dispose() {}\r\n}\r\n\r\n\r\nexport default FunnelView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply';\r\nimport {defaultEmphasis} from '../../util/model';\r\nimport {makeSeriesEncodeForNameBased} from '../../data/helper/sourceHelper';\r\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n SeriesOption,\r\n BoxLayoutOptionMixin,\r\n HorizontalAlign,\r\n LabelOption,\r\n LabelLineOption,\r\n ItemStyleOption,\r\n OptionDataValueNumeric,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n LayoutOrient,\r\n VerticalAlign,\r\n SeriesLabelOption,\r\n SeriesEncodeOptionMixin,\r\n DefaultStatesMixinEmphasis,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\n\r\ntype FunnelLabelOption = Omit & {\r\n position?: LabelOption['position']\r\n | 'outer' | 'inner' | 'center' | 'rightTop' | 'rightBottom' | 'leftTop' | 'leftBottom'\r\n};\r\n\r\ninterface FunnelStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\n\r\nexport interface FunnelCallbackDataParams extends CallbackDataParams {\r\n percent: number\r\n}\r\nexport interface FunnelStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: FunnelLabelOption\r\n labelLine?: LabelLineOption\r\n}\r\n\r\nexport interface FunnelDataItemOption\r\n extends FunnelStateOption, StatesOptionMixin,\r\n OptionDataItemObject {\r\n\r\n itemStyle?: ItemStyleOption & {\r\n width?: number | string\r\n height?: number | string\r\n }\r\n}\r\n\r\nexport interface FunnelSeriesOption\r\n extends SeriesOption, FunnelStatesMixin>,\r\n FunnelStateOption,\r\n BoxLayoutOptionMixin, SeriesEncodeOptionMixin {\r\n type?: 'funnel'\r\n\r\n min?: number\r\n max?: number\r\n\r\n /**\r\n * Absolute number or percent string\r\n */\r\n minSize?: number | string\r\n maxSize?: number | string\r\n\r\n sort?: 'ascending' | 'descending' | 'none'\r\n\r\n orient?: LayoutOrient\r\n\r\n gap?: number\r\n\r\n funnelAlign?: HorizontalAlign | VerticalAlign\r\n\r\n data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | FunnelDataItemOption)[]\r\n}\r\n\r\nclass FunnelSeriesModel extends SeriesModel {\r\n static type = 'series.funnel' as const;\r\n type = FunnelSeriesModel.type;\r\n\r\n init(option: FunnelSeriesOption) {\r\n super.init.apply(this, arguments as any);\r\n\r\n // Enable legend selection for each data item\r\n // Use a function instead of direct access because data reference may changed\r\n this.legendVisualProvider = new LegendVisualProvider(\r\n zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)\r\n );\r\n // Extend labelLine emphasis\r\n this._defaultLabelLine(option);\r\n }\r\n\r\n getInitialData(this: FunnelSeriesModel, option: FunnelSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesDataSimply(this, {\r\n coordDimensions: ['value'],\r\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\r\n });\r\n }\r\n\r\n _defaultLabelLine(option: FunnelSeriesOption) {\r\n // Extend labelLine emphasis\r\n defaultEmphasis(option, 'labelLine', ['show']);\r\n\r\n const labelLineNormalOpt = option.labelLine;\r\n const labelLineEmphasisOpt = option.emphasis.labelLine;\r\n // Not show label line if `label.normal.show = false`\r\n labelLineNormalOpt.show = labelLineNormalOpt.show\r\n && option.label.show;\r\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show\r\n && option.emphasis.label.show;\r\n }\r\n\r\n // Overwrite\r\n getDataParams(dataIndex: number): FunnelCallbackDataParams {\r\n const data = this.getData();\r\n const params = super.getDataParams(dataIndex) as FunnelCallbackDataParams;\r\n const valueDim = data.mapDimension('value');\r\n const sum = data.getSum(valueDim);\r\n // Percent is 0 if sum is 0\r\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) as number / sum * 100).toFixed(2);\r\n\r\n params.$vars.push('percent');\r\n return params;\r\n }\r\n\r\n static defaultOption: FunnelSeriesOption = {\r\n // zlevel: 0, // \u4E00\u7EA7\u5C42\u53E0\r\n z: 2, // \u4E8C\u7EA7\u5C42\u53E0\r\n legendHoverLink: true,\r\n colorBy: 'data',\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n // width: {totalWidth} - left - right,\r\n // height: {totalHeight} - top - bottom,\r\n\r\n // \u9ED8\u8BA4\u53D6\u6570\u636E\u6700\u5C0F\u6700\u5927\u503C\r\n // min: 0,\r\n // max: 100,\r\n minSize: '0%',\r\n maxSize: '100%',\r\n sort: 'descending', // 'ascending', 'descending'\r\n orient: 'vertical',\r\n gap: 0,\r\n funnelAlign: 'center',\r\n label: {\r\n show: true,\r\n position: 'outer'\r\n // formatter: \u6807\u7B7E\u6587\u672C\u683C\u5F0F\u5668\uFF0C\u540CTooltip.formatter\uFF0C\u4E0D\u652F\u6301\u5F02\u6B65\u56DE\u8C03\r\n },\r\n labelLine: {\r\n show: true,\r\n length: 20,\r\n lineStyle: {\r\n // color: \u5404\u5F02,\r\n width: 1\r\n }\r\n },\r\n itemStyle: {\r\n // color: \u5404\u5F02,\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n },\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n\r\n}\r\n\r\nexport default FunnelSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as layout from '../../util/layout';\r\nimport {parsePercent, linearMap} from '../../util/number';\r\nimport FunnelSeriesModel, { FunnelSeriesOption, FunnelDataItemOption } from './FunnelSeries';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport GlobalModel from '../../model/Global';\r\nimport { isFunction } from 'zrender/src/core/util';\r\n\r\nfunction getViewRect(seriesModel: FunnelSeriesModel, api: ExtensionAPI) {\r\n return layout.getLayoutRect(\r\n seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }\r\n );\r\n}\r\n\r\nfunction getSortedIndices(data: SeriesData, sort: FunnelSeriesOption['sort']) {\r\n const valueDim = data.mapDimension('value');\r\n const valueArr = data.mapArray(valueDim, function (val: number) {\r\n return val;\r\n });\r\n const indices: number[] = [];\r\n const isAscending = sort === 'ascending';\r\n for (let i = 0, len = data.count(); i < len; i++) {\r\n indices[i] = i;\r\n }\r\n\r\n // Add custom sortable function & none sortable opetion by \"options.sort\"\r\n if (isFunction(sort)) {\r\n indices.sort(sort as any);\r\n }\r\n else if (sort !== 'none') {\r\n indices.sort(function (a, b) {\r\n return isAscending\r\n ? valueArr[a] - valueArr[b]\r\n : valueArr[b] - valueArr[a];\r\n });\r\n }\r\n return indices;\r\n}\r\n\r\nfunction labelLayout(data: SeriesData) {\r\n const seriesModel = data.hostModel;\r\n const orient = seriesModel.get('orient');\r\n data.each(function (idx) {\r\n const itemModel = data.getItemModel(idx);\r\n const labelModel = itemModel.getModel('label');\r\n let labelPosition = labelModel.get('position');\r\n\r\n const labelLineModel = itemModel.getModel('labelLine');\r\n\r\n const layout = data.getItemLayout(idx);\r\n const points = layout.points;\r\n\r\n const isLabelInside = labelPosition === 'inner'\r\n || labelPosition === 'inside' || labelPosition === 'center'\r\n || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\r\n\r\n let textAlign;\r\n let textX;\r\n let textY;\r\n let linePoints;\r\n\r\n if (isLabelInside) {\r\n if (labelPosition === 'insideLeft') {\r\n textX = (points[0][0] + points[3][0]) / 2 + 5;\r\n textY = (points[0][1] + points[3][1]) / 2;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'insideRight') {\r\n textX = (points[1][0] + points[2][0]) / 2 - 5;\r\n textY = (points[1][1] + points[2][1]) / 2;\r\n textAlign = 'right';\r\n }\r\n else {\r\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\r\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\r\n textAlign = 'center';\r\n }\r\n linePoints = [\r\n [textX, textY], [textX, textY]\r\n ];\r\n }\r\n else {\r\n let x1;\r\n let y1;\r\n let x2;\r\n let y2;\r\n const labelLineLen = labelLineModel.get('length');\r\n if (__DEV__) {\r\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition as string) > -1) {\r\n labelPosition = 'left';\r\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\r\n }\r\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition as string) > -1) {\r\n labelPosition = 'bottom';\r\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\r\n }\r\n }\r\n if (labelPosition === 'left') {\r\n // Left side\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n else if (labelPosition === 'right') {\r\n // Right side\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n else if (labelPosition === 'top') {\r\n // Top side\r\n x1 = (points[3][0] + points[0][0]) / 2;\r\n y1 = (points[3][1] + points[0][1]) / 2;\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'bottom') {\r\n // Bottom side\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else if (labelPosition === 'rightTop') {\r\n // RightTop side\r\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\r\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'top';\r\n }\r\n }\r\n else if (labelPosition === 'rightBottom') {\r\n // RightBottom side\r\n x1 = points[2][0];\r\n y1 = points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'bottom';\r\n }\r\n }\r\n else if (labelPosition === 'leftTop') {\r\n // LeftTop side\r\n x1 = points[0][0];\r\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 - labelLineLen;\r\n textY = y2 - 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else if (labelPosition === 'leftBottom') {\r\n // LeftBottom side\r\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\r\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 - labelLineLen;\r\n textX = x2 - 5;\r\n textAlign = 'right';\r\n }\r\n }\r\n else {\r\n // Right side or Bottom side\r\n x1 = (points[1][0] + points[2][0]) / 2;\r\n y1 = (points[1][1] + points[2][1]) / 2;\r\n if (orient === 'horizontal') {\r\n y2 = y1 + labelLineLen;\r\n textY = y2 + 5;\r\n textAlign = 'center';\r\n }\r\n else {\r\n x2 = x1 + labelLineLen;\r\n textX = x2 + 5;\r\n textAlign = 'left';\r\n }\r\n }\r\n if (orient === 'horizontal') {\r\n x2 = x1;\r\n textX = x2;\r\n }\r\n else {\r\n y2 = y1;\r\n textY = y2;\r\n }\r\n linePoints = [[x1, y1], [x2, y2]];\r\n }\r\n\r\n layout.label = {\r\n linePoints: linePoints,\r\n x: textX,\r\n y: textY,\r\n verticalAlign: 'middle',\r\n textAlign: textAlign,\r\n inside: isLabelInside\r\n };\r\n });\r\n}\r\n\r\nexport default function funnelLayout(ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachSeriesByType('funnel', function (seriesModel: FunnelSeriesModel) {\r\n const data = seriesModel.getData();\r\n const valueDim = data.mapDimension('value');\r\n const sort = seriesModel.get('sort');\r\n const viewRect = getViewRect(seriesModel, api);\r\n const orient = seriesModel.get('orient');\r\n const viewWidth = viewRect.width;\r\n const viewHeight = viewRect.height;\r\n let indices = getSortedIndices(data, sort);\r\n let x = viewRect.x;\r\n let y = viewRect.y;\r\n\r\n const sizeExtent = orient === 'horizontal' ? [\r\n parsePercent(seriesModel.get('minSize'), viewHeight),\r\n parsePercent(seriesModel.get('maxSize'), viewHeight)\r\n ] : [\r\n parsePercent(seriesModel.get('minSize'), viewWidth),\r\n parsePercent(seriesModel.get('maxSize'), viewWidth)\r\n ];\r\n const dataExtent = data.getDataExtent(valueDim);\r\n let min = seriesModel.get('min');\r\n let max = seriesModel.get('max');\r\n if (min == null) {\r\n min = Math.min(dataExtent[0], 0);\r\n }\r\n if (max == null) {\r\n max = dataExtent[1];\r\n }\r\n\r\n const funnelAlign = seriesModel.get('funnelAlign');\r\n let gap = seriesModel.get('gap');\r\n const viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\r\n let itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\r\n\r\n const getLinePoints = function (idx: number, offset: number) {\r\n // End point index is data.count() and we assign it 0\r\n if (orient === 'horizontal') {\r\n const val = data.get(valueDim, idx) as number || 0;\r\n const itemHeight = linearMap(val, [min, max], sizeExtent, true);\r\n let y0;\r\n switch (funnelAlign) {\r\n case 'top':\r\n y0 = y;\r\n break;\r\n case 'center':\r\n y0 = y + (viewHeight - itemHeight) / 2;\r\n break;\r\n case 'bottom':\r\n y0 = y + (viewHeight - itemHeight);\r\n break;\r\n }\r\n\r\n return [\r\n [offset, y0],\r\n [offset, y0 + itemHeight]\r\n ];\r\n }\r\n const val = data.get(valueDim, idx) as number || 0;\r\n const itemWidth = linearMap(val, [min, max], sizeExtent, true);\r\n let x0;\r\n switch (funnelAlign) {\r\n case 'left':\r\n x0 = x;\r\n break;\r\n case 'center':\r\n x0 = x + (viewWidth - itemWidth) / 2;\r\n break;\r\n case 'right':\r\n x0 = x + viewWidth - itemWidth;\r\n break;\r\n }\r\n return [\r\n [x0, offset],\r\n [x0 + itemWidth, offset]\r\n ];\r\n };\r\n\r\n if (sort === 'ascending') {\r\n // From bottom to top\r\n itemSize = -itemSize;\r\n gap = -gap;\r\n if (orient === 'horizontal') {\r\n x += viewWidth;\r\n }\r\n else {\r\n y += viewHeight;\r\n }\r\n indices = indices.reverse();\r\n }\r\n\r\n for (let i = 0; i < indices.length; i++) {\r\n const idx = indices[i];\r\n const nextIdx = indices[i + 1];\r\n const itemModel = data.getItemModel(idx);\r\n\r\n if (orient === 'horizontal') {\r\n let width = itemModel.get(['itemStyle', 'width']);\r\n if (width == null) {\r\n width = itemSize;\r\n }\r\n else {\r\n width = parsePercent(width, viewWidth);\r\n if (sort === 'ascending') {\r\n width = -width;\r\n }\r\n }\r\n\r\n const start = getLinePoints(idx, x);\r\n const end = getLinePoints(nextIdx, x + width);\r\n\r\n x += width + gap;\r\n\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n else {\r\n let height = itemModel.get(['itemStyle', 'height']);\r\n if (height == null) {\r\n height = itemSize;\r\n }\r\n else {\r\n height = parsePercent(height, viewHeight);\r\n if (sort === 'ascending') {\r\n height = -height;\r\n }\r\n }\r\n\r\n const start = getLinePoints(idx, y);\r\n const end = getLinePoints(nextIdx, y + height);\r\n\r\n y += height + gap;\r\n\r\n data.setItemLayout(idx, {\r\n points: start.concat(end.slice().reverse())\r\n });\r\n }\r\n }\r\n\r\n labelLayout(data);\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport FunnelView from './FunnelView';\r\nimport FunnelSeriesModel from './FunnelSeries';\r\nimport funnelLayout from './funnelLayout';\r\nimport dataFilter from '../../processor/dataFilter';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(FunnelView);\r\n registers.registerSeriesModel(FunnelSeriesModel);\r\n registers.registerLayout(funnelLayout);\r\n registers.registerProcessor(dataFilter('funnel'));\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport ChartView from '../../view/Chart';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport ParallelSeriesModel, { ParallelSeriesDataItemOption } from './ParallelSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { StageHandlerProgressParams, ParsedValue, Payload } from '../../util/types';\r\nimport Parallel from '../../coord/parallel/Parallel';\r\nimport { OptionAxisType } from '../../coord/axisCommonTypes';\r\nimport { numericToNumber } from '../../util/number';\r\nimport { eqNaN } from 'zrender/src/core/util';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\nimport Element from 'zrender/src/Element';\r\n\r\nconst DEFAULT_SMOOTH = 0.3;\r\n\r\ninterface ParallelDrawSeriesScope {\r\n smooth: number\r\n}\r\nclass ParallelView extends ChartView {\r\n static type = 'parallel';\r\n type = ParallelView.type;\r\n\r\n private _dataGroup = new graphic.Group();\r\n\r\n private _data: SeriesData;\r\n\r\n private _initialized = false;\r\n\r\n private _progressiveEls: Element[];\r\n\r\n init() {\r\n this.group.add(this._dataGroup);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n render(\r\n seriesModel: ParallelSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ) {\r\n\r\n // Clear previously rendered progressive elements.\r\n this._progressiveEls = null;\r\n\r\n const dataGroup = this._dataGroup;\r\n const data = seriesModel.getData();\r\n const oldData = this._data;\r\n const coordSys = seriesModel.coordinateSystem;\r\n const dimensions = coordSys.dimensions;\r\n const seriesScope = makeSeriesScope(seriesModel);\r\n\r\n data.diff(oldData)\r\n .add(add)\r\n .update(update)\r\n .remove(remove)\r\n .execute();\r\n\r\n function add(newDataIndex: number) {\r\n const line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n\r\n function update(newDataIndex: number, oldDataIndex: number) {\r\n const line = oldData.getItemGraphicEl(oldDataIndex) as graphic.Polyline;\r\n\r\n const points = createLinePoints(data, newDataIndex, dimensions, coordSys);\r\n data.setItemGraphicEl(newDataIndex, line);\r\n\r\n graphic.updateProps(line, {shape: {points: points}}, seriesModel, newDataIndex);\r\n\r\n saveOldStyle(line);\r\n\r\n updateElCommon(line, data, newDataIndex, seriesScope);\r\n }\r\n\r\n function remove(oldDataIndex: number) {\r\n const line = oldData.getItemGraphicEl(oldDataIndex);\r\n dataGroup.remove(line);\r\n }\r\n\r\n // First create\r\n if (!this._initialized) {\r\n this._initialized = true;\r\n const clipPath = createGridClipShape(\r\n coordSys, seriesModel, function () {\r\n // Callback will be invoked immediately if there is no animation\r\n setTimeout(function () {\r\n dataGroup.removeClipPath();\r\n });\r\n }\r\n );\r\n dataGroup.setClipPath(clipPath);\r\n }\r\n\r\n this._data = data;\r\n }\r\n\r\n incrementalPrepareRender(seriesModel: ParallelSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._initialized = true;\r\n this._data = null;\r\n this._dataGroup.removeAll();\r\n }\r\n\r\n incrementalRender(taskParams: StageHandlerProgressParams, seriesModel: ParallelSeriesModel, ecModel: GlobalModel) {\r\n const data = seriesModel.getData();\r\n const coordSys = seriesModel.coordinateSystem;\r\n const dimensions = coordSys.dimensions;\r\n const seriesScope = makeSeriesScope(seriesModel);\r\n const progressiveEls: Element[] = this._progressiveEls = [];\r\n\r\n for (let dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\r\n const line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\r\n line.incremental = true;\r\n updateElCommon(line, data, dataIndex, seriesScope);\r\n progressiveEls.push(line);\r\n }\r\n }\r\n\r\n remove() {\r\n this._dataGroup && this._dataGroup.removeAll();\r\n this._data = null;\r\n }\r\n}\r\n\r\nfunction createGridClipShape(coordSys: Parallel, seriesModel: ParallelSeriesModel, cb: () => void) {\r\n const parallelModel = coordSys.model;\r\n const rect = coordSys.getRect();\r\n const rectEl = new graphic.Rect({\r\n shape: {\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n });\r\n\r\n const dim = parallelModel.get('layout') === 'horizontal' ? 'width' as const : 'height' as const;\r\n rectEl.setShape(dim, 0);\r\n graphic.initProps(rectEl, {\r\n shape: {\r\n width: rect.width,\r\n height: rect.height\r\n }\r\n }, seriesModel, cb);\r\n return rectEl;\r\n}\r\n\r\nfunction createLinePoints(data: SeriesData, dataIndex: number, dimensions: string[], coordSys: Parallel) {\r\n const points = [];\r\n for (let i = 0; i < dimensions.length; i++) {\r\n const dimName = dimensions[i];\r\n const value = data.get(data.mapDimension(dimName), dataIndex);\r\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\r\n points.push(coordSys.dataToPoint(value, dimName));\r\n }\r\n }\r\n return points;\r\n}\r\n\r\nfunction addEl(\r\n data: SeriesData, dataGroup: graphic.Group, dataIndex: number, dimensions: string[], coordSys: Parallel\r\n) {\r\n const points = createLinePoints(data, dataIndex, dimensions, coordSys);\r\n const line = new graphic.Polyline({\r\n shape: {points: points},\r\n // silent: true,\r\n z2: 10\r\n });\r\n dataGroup.add(line);\r\n data.setItemGraphicEl(dataIndex, line);\r\n return line;\r\n}\r\n\r\nfunction makeSeriesScope(seriesModel: ParallelSeriesModel): ParallelDrawSeriesScope {\r\n let smooth = seriesModel.get('smooth', true);\r\n smooth === true && (smooth = DEFAULT_SMOOTH);\r\n smooth = numericToNumber(smooth);\r\n eqNaN(smooth) && (smooth = 0);\r\n\r\n return { smooth };\r\n}\r\n\r\nfunction updateElCommon(\r\n el: graphic.Polyline,\r\n data: SeriesData,\r\n dataIndex: number,\r\n seriesScope: ParallelDrawSeriesScope\r\n) {\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.fill = null;\r\n el.setShape('smooth', seriesScope.smooth);\r\n\r\n const itemModel = data.getItemModel(dataIndex);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\r\n\r\n toggleHoverEmphasis(\r\n el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')\r\n );\r\n}\r\n\r\n// function simpleDiff(oldData, newData, dimensions) {\r\n// let oldLen;\r\n// if (!oldData\r\n// || !oldData.__plProgressive\r\n// || (oldLen = oldData.count()) !== newData.count()\r\n// ) {\r\n// return true;\r\n// }\r\n\r\n// let dimLen = dimensions.length;\r\n// for (let i = 0; i < oldLen; i++) {\r\n// for (let j = 0; j < dimLen; j++) {\r\n// if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {\r\n// return true;\r\n// }\r\n// }\r\n// }\r\n\r\n// return false;\r\n// }\r\n\r\n// FIXME put in common util?\r\nfunction isEmptyValue(val: ParsedValue, axisType: OptionAxisType) {\r\n return axisType === 'category'\r\n ? val == null\r\n : (val == null || isNaN(val as number)); // axisType === 'value'\r\n}\r\n\r\nexport default ParallelView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport {each, bind} from 'zrender/src/core/util';\r\nimport SeriesModel from '../../model/Series';\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport {\r\n SeriesOption,\r\n SeriesEncodeOptionMixin,\r\n LineStyleOption,\r\n SeriesLabelOption,\r\n SeriesTooltipOption,\r\n DimensionName,\r\n OptionDataValue,\r\n StatesOptionMixin,\r\n OptionEncodeValue,\r\n Dictionary,\r\n OptionEncode,\r\n DefaultStatesMixinEmphasis,\r\n ZRColor,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { ParallelActiveState, ParallelAxisOption } from '../../coord/parallel/AxisModel';\r\nimport Parallel from '../../coord/parallel/Parallel';\r\nimport ParallelModel from '../../coord/parallel/ParallelModel';\r\n\r\ntype ParallelSeriesDataValue = OptionDataValue[];\r\n\r\ninterface ParallelStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\nexport interface ParallelStateOption {\r\n lineStyle?: LineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>\r\n label?: SeriesLabelOption\r\n}\r\n\r\nexport interface ParallelSeriesDataItemOption extends ParallelStateOption,\r\n StatesOptionMixin {\r\n value?: ParallelSeriesDataValue\r\n}\r\nexport interface ParallelSeriesOption extends\r\n SeriesOption, ParallelStatesMixin>,\r\n ParallelStateOption,\r\n SeriesEncodeOptionMixin {\r\n\r\n type?: 'parallel';\r\n\r\n coordinateSystem?: string;\r\n parallelIndex?: number;\r\n parallelId?: string;\r\n\r\n inactiveOpacity?: number;\r\n activeOpacity?: number;\r\n\r\n smooth?: boolean | number;\r\n realtime?: boolean;\r\n tooltip?: SeriesTooltipOption;\r\n\r\n parallelAxisDefault?: ParallelAxisOption;\r\n\r\n\r\n data?: (ParallelSeriesDataValue | ParallelSeriesDataItemOption)[]\r\n}\r\n\r\n\r\nclass ParallelSeriesModel extends SeriesModel {\r\n\r\n static type = 'series.parallel';\r\n readonly type = ParallelSeriesModel.type;\r\n\r\n static dependencies = ['parallel'];\r\n\r\n visualStyleAccessPath = 'lineStyle';\r\n visualDrawType = 'stroke' as const;\r\n\r\n coordinateSystem: Parallel;\r\n\r\n\r\n getInitialData(this: ParallelSeriesModel, option: ParallelSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesData(null, this, {\r\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\r\n });\r\n }\r\n\r\n /**\r\n * User can get data raw indices on 'axisAreaSelected' event received.\r\n *\r\n * @return Raw indices\r\n */\r\n getRawIndicesByActiveState(activeState: ParallelActiveState): number[] {\r\n const coordSys = this.coordinateSystem;\r\n const data = this.getData();\r\n const indices = [] as number[];\r\n\r\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\r\n if (activeState === theActiveState) {\r\n indices.push(data.getRawIndex(dataIndex));\r\n }\r\n });\r\n\r\n return indices;\r\n }\r\n\r\n static defaultOption: ParallelSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n\r\n coordinateSystem: 'parallel',\r\n parallelIndex: 0,\r\n\r\n label: {\r\n show: false\r\n },\r\n\r\n inactiveOpacity: 0.05,\r\n activeOpacity: 1,\r\n\r\n lineStyle: {\r\n width: 1,\r\n opacity: 0.45,\r\n type: 'solid'\r\n },\r\n emphasis: {\r\n label: {\r\n show: false\r\n }\r\n },\r\n\r\n progressive: 500,\r\n smooth: false, // true | false | number\r\n\r\n animationEasing: 'linear'\r\n };\r\n\r\n}\r\n\r\nfunction makeDefaultEncode(seriesModel: ParallelSeriesModel): OptionEncode {\r\n // The mapping of parallelAxis dimension to data dimension can\r\n // be specified in parallelAxis.option.dim. For example, if\r\n // parallelAxis.option.dim is 'dim3', it mapping to the third\r\n // dimension of data. But `data.encode` has higher priority.\r\n // Moreover, parallelModel.dimension should not be regarded as data\r\n // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];\r\n\r\n const parallelModel = seriesModel.ecModel.getComponent(\r\n 'parallel', seriesModel.get('parallelIndex')\r\n ) as ParallelModel;\r\n if (!parallelModel) {\r\n return;\r\n }\r\n\r\n const encodeDefine: Dictionary = {};\r\n each(parallelModel.dimensions, function (axisDim) {\r\n const dataDimIndex = convertDimNameToNumber(axisDim);\r\n encodeDefine[axisDim] = dataDimIndex;\r\n });\r\n\r\n return encodeDefine;\r\n}\r\n\r\nfunction convertDimNameToNumber(dimName: DimensionName): number {\r\n return +dimName.replace('dim', '');\r\n}\r\n\r\nexport default ParallelSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport ParallelSeriesModel, { ParallelSeriesOption } from './ParallelSeries';\r\nimport { StageHandler } from '../../util/types';\r\n\r\n\r\nconst opacityAccessPath = ['lineStyle', 'opacity'] as const;\r\n\r\nconst parallelVisual: StageHandler = {\r\n\r\n seriesType: 'parallel',\r\n\r\n reset: function (seriesModel: ParallelSeriesModel, ecModel) {\r\n\r\n const coordSys = seriesModel.coordinateSystem;\r\n\r\n const opacityMap = {\r\n normal: seriesModel.get(['lineStyle', 'opacity']),\r\n active: seriesModel.get('activeOpacity'),\r\n inactive: seriesModel.get('inactiveOpacity')\r\n };\r\n\r\n return {\r\n progress(params, data) {\r\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\r\n let opacity = opacityMap[activeState];\r\n if (activeState === 'normal' && data.hasItemOption) {\r\n const itemOpacity = data.getItemModel(dataIndex).get(\r\n opacityAccessPath, true\r\n );\r\n itemOpacity != null && (opacity = itemOpacity);\r\n }\r\n const existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n existsStyle.opacity = opacity;\r\n }, params.start, params.end);\r\n }\r\n };\r\n }\r\n};\r\n\r\nexport default parallelVisual;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as modelUtil from '../../util/model';\r\nimport { ECUnitOption, SeriesOption } from '../../util/types';\r\nimport { ParallelAxisOption } from './AxisModel';\r\nimport { ParallelSeriesOption } from '../../chart/parallel/ParallelSeries';\r\n\r\nexport default function parallelPreprocessor(option: ECUnitOption): void {\r\n createParallelIfNeeded(option);\r\n mergeAxisOptionFromParallel(option);\r\n}\r\n\r\n/**\r\n * Create a parallel coordinate if not exists.\r\n * @inner\r\n */\r\nfunction createParallelIfNeeded(option: ECUnitOption): void {\r\n if (option.parallel) {\r\n return;\r\n }\r\n\r\n let hasParallelSeries = false;\r\n\r\n zrUtil.each(option.series, function (seriesOpt: SeriesOption) {\r\n if (seriesOpt && seriesOpt.type === 'parallel') {\r\n hasParallelSeries = true;\r\n }\r\n });\r\n\r\n if (hasParallelSeries) {\r\n option.parallel = [{}];\r\n }\r\n}\r\n\r\n/**\r\n * Merge aixs definition from parallel option (if exists) to axis option.\r\n * @inner\r\n */\r\nfunction mergeAxisOptionFromParallel(option: ECUnitOption): void {\r\n const axes = modelUtil.normalizeToArray(option.parallelAxis) as ParallelAxisOption[];\r\n\r\n zrUtil.each(axes, function (axisOption) {\r\n if (!zrUtil.isObject(axisOption)) {\r\n return;\r\n }\r\n\r\n const parallelIndex = axisOption.parallelIndex || 0;\r\n const parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex] as ParallelSeriesOption;\r\n\r\n if (parallelOption && parallelOption.parallelAxisDefault) {\r\n zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../../model/Global';\r\nimport ParallelModel, { ParallelCoordinateSystemOption } from '../../coord/parallel/ParallelModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport ComponentView from '../../view/Component';\r\nimport { ElementEventName } from 'zrender/src/core/types';\r\nimport { ElementEvent } from 'zrender/src/Element';\r\nimport { ParallelAxisExpandPayload } from '../axis/parallelAxisAction';\r\nimport { each, bind, extend } from 'zrender/src/core/util';\r\nimport { ThrottleController, createOrUpdate, clear } from '../../util/throttle';\r\n\r\nconst CLICK_THRESHOLD = 5; // > 4\r\n\r\nclass ParallelView extends ComponentView {\r\n static type = 'parallel';\r\n readonly type = ParallelView.type;\r\n // @internal\r\n _model: ParallelModel;\r\n private _api: ExtensionAPI;\r\n // @internal\r\n _mouseDownPoint: number[];\r\n private _handlers: Partial>;\r\n render(parallelModel: ParallelModel, ecModel: GlobalModel, api: ExtensionAPI): void {\r\n this._model = parallelModel;\r\n this._api = api;\r\n if (!this._handlers) {\r\n this._handlers = {};\r\n each(handlers, function (handler: ElementEventHandler, eventName) {\r\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this) as ElementEventHandler);\r\n }, this);\r\n }\r\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\r\n }\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n clear(this, '_throttledDispatchExpand');\r\n each(this._handlers, function (handler: ElementEventHandler, eventName) {\r\n api.getZr().off(eventName, handler);\r\n });\r\n this._handlers = null;\r\n }\r\n /**\r\n * @internal\r\n * @param {Object} [opt] If null, cancel the last action triggering for debounce.\r\n */\r\n _throttledDispatchExpand(this: ParallelView, opt: Omit): void {\r\n this._dispatchExpand(opt);\r\n }\r\n /**\r\n * @internal\r\n */\r\n _dispatchExpand(opt: Omit) {\r\n opt && this._api.dispatchAction(extend({ type: 'parallelAxisExpand' }, opt));\r\n }\r\n}\r\ntype ElementEventHandler = (this: ParallelView, e: ElementEvent) => void;\r\nconst handlers: Partial> = {\r\n mousedown: function (e) {\r\n if (checkTrigger(this, 'click')) {\r\n this._mouseDownPoint = [e.offsetX, e.offsetY];\r\n }\r\n },\r\n mouseup: function (e) {\r\n const mouseDownPoint = this._mouseDownPoint;\r\n if (checkTrigger(this, 'click') && mouseDownPoint) {\r\n const point = [e.offsetX, e.offsetY];\r\n const dist = Math.pow(mouseDownPoint[0] - point[0], 2)\r\n + Math.pow(mouseDownPoint[1] - point[1], 2);\r\n if (dist > CLICK_THRESHOLD) {\r\n return;\r\n }\r\n const result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n result.behavior !== 'none' && this._dispatchExpand({\r\n axisExpandWindow: result.axisExpandWindow\r\n });\r\n }\r\n this._mouseDownPoint = null;\r\n },\r\n mousemove: function (e) {\r\n // Should do nothing when brushing.\r\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\r\n return;\r\n }\r\n const model = this._model;\r\n const result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\r\n const behavior = result.behavior;\r\n behavior === 'jump'\r\n && (this._throttledDispatchExpand as ParallelView['_throttledDispatchExpand'] & ThrottleController)\r\n .debounceNextCall(model.get('axisExpandDebounce'));\r\n this._throttledDispatchExpand(behavior === 'none'\r\n ? null // Cancel the last trigger, in case that mouse slide out of the area quickly.\r\n : {\r\n axisExpandWindow: result.axisExpandWindow,\r\n // Jumping uses animation, and sliding suppresses animation.\r\n animation: behavior === 'jump' ? null : {\r\n duration: 0 // Disable animation.\r\n }\r\n });\r\n }\r\n};\r\nfunction checkTrigger(view: ParallelView, triggerOn: ParallelCoordinateSystemOption['axisExpandTriggerOn']): boolean {\r\n const model = view._model;\r\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\r\n}\r\n\r\nexport default ParallelView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ComponentModel from '../../model/Component';\r\nimport Parallel from './Parallel';\r\nimport { DimensionName, ComponentOption, BoxLayoutOptionMixin } from '../../util/types';\r\nimport ParallelAxisModel, { ParallelAxisOption } from './AxisModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ParallelSeriesModel from '../../chart/parallel/ParallelSeries';\r\nimport SeriesModel from '../../model/Series';\r\n\r\n\r\nexport type ParallelLayoutDirection = 'horizontal' | 'vertical';\r\n\r\nexport interface ParallelCoordinateSystemOption extends ComponentOption, BoxLayoutOptionMixin {\r\n mainType?: 'parallel';\r\n\r\n layout?: ParallelLayoutDirection;\r\n\r\n axisExpandable?: boolean;\r\n axisExpandCenter?: number;\r\n axisExpandCount?: number;\r\n axisExpandWidth?: number; // TODO '10%' ?\r\n axisExpandTriggerOn?: 'click' | 'mousemove';\r\n\r\n // Not ready to expose to users yet.\r\n axisExpandRate?: number;\r\n // Not ready to expose to users yet.\r\n axisExpandDebounce?: number;\r\n // Not ready to expose to users yet.\r\n // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\r\n // Do not doc to user until necessary.\r\n axisExpandSlideTriggerArea?: [number, number, number];\r\n // Not ready to expose to users yet.\r\n axisExpandWindow?: number[];\r\n\r\n parallelAxisDefault?: ParallelAxisOption\r\n}\r\n\r\nclass ParallelModel extends ComponentModel {\r\n\r\n static type = 'parallel';\r\n readonly type = ParallelModel.type;\r\n\r\n static dependencies = ['parallelAxis'];\r\n\r\n coordinateSystem: Parallel;\r\n\r\n /**\r\n * Each item like: 'dim0', 'dim1', 'dim2', ...\r\n */\r\n dimensions: DimensionName[];\r\n\r\n /**\r\n * Corresponding to dimensions.\r\n */\r\n parallelAxisIndex: number[];\r\n\r\n static layoutMode = 'box' as const;\r\n\r\n static defaultOption: ParallelCoordinateSystemOption = {\r\n // zlevel: 0,\r\n z: 0,\r\n left: 80,\r\n top: 60,\r\n right: 80,\r\n bottom: 60,\r\n // width: {totalWidth} - left - right,\r\n // height: {totalHeight} - top - bottom,\r\n\r\n layout: 'horizontal', // 'horizontal' or 'vertical'\r\n\r\n // FIXME\r\n // naming?\r\n axisExpandable: false,\r\n axisExpandCenter: null,\r\n axisExpandCount: 0,\r\n axisExpandWidth: 50, // FIXME '10%' ?\r\n axisExpandRate: 17,\r\n axisExpandDebounce: 50,\r\n // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\r\n // Do not doc to user until necessary.\r\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\r\n axisExpandTriggerOn: 'click', // 'mousemove' or 'click'\r\n\r\n parallelAxisDefault: null\r\n };\r\n\r\n init() {\r\n super.init.apply(this, arguments as any);\r\n this.mergeOption({});\r\n }\r\n\r\n mergeOption(newOption: ParallelCoordinateSystemOption) {\r\n const thisOption = this.option;\r\n\r\n newOption && zrUtil.merge(thisOption, newOption, true);\r\n\r\n this._initDimensions();\r\n }\r\n\r\n /**\r\n * Whether series or axis is in this coordinate system.\r\n */\r\n contains(model: SeriesModel | ParallelAxisModel, ecModel: GlobalModel): boolean {\r\n const parallelIndex = (model as ParallelSeriesModel).get('parallelIndex');\r\n return parallelIndex != null\r\n && ecModel.getComponent('parallel', parallelIndex) === this;\r\n }\r\n\r\n setAxisExpand(opt: {\r\n axisExpandable?: boolean,\r\n axisExpandCenter?: number,\r\n axisExpandCount?: number,\r\n axisExpandWidth?: number,\r\n axisExpandWindow?: number[]\r\n }): void {\r\n zrUtil.each(\r\n [\r\n 'axisExpandable',\r\n 'axisExpandCenter',\r\n 'axisExpandCount',\r\n 'axisExpandWidth',\r\n 'axisExpandWindow'\r\n ] as const,\r\n function (name) {\r\n if (opt.hasOwnProperty(name)) {\r\n // @ts-ignore FIXME: why \"never\" inferred in this.option[name]?\r\n this.option[name] = opt[name];\r\n }\r\n },\r\n this\r\n );\r\n }\r\n\r\n private _initDimensions(): void {\r\n const dimensions = this.dimensions = [] as DimensionName[];\r\n const parallelAxisIndex = this.parallelAxisIndex = [] as number[];\r\n\r\n const axisModels = zrUtil.filter(\r\n this.ecModel.queryComponents({ mainType: 'parallelAxis' }),\r\n function (axisModel: ParallelAxisModel) {\r\n // Can not use this.contains here, because\r\n // initialization has not been completed yet.\r\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\r\n },\r\n this\r\n );\r\n\r\n zrUtil.each(axisModels, function (axisModel: ParallelAxisModel) {\r\n dimensions.push('dim' + axisModel.get('dim'));\r\n parallelAxisIndex.push(axisModel.componentIndex);\r\n });\r\n }\r\n\r\n}\r\n\r\nexport default ParallelModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport Axis from '../Axis';\r\nimport Scale from '../../scale/Scale';\r\nimport { DimensionName } from '../../util/types';\r\nimport { OptionAxisType } from '../axisCommonTypes';\r\nimport AxisModel from './AxisModel';\r\nimport Parallel from './Parallel';\r\n\r\n\r\nclass ParallelAxis extends Axis {\r\n\r\n readonly axisIndex: number;\r\n\r\n // Inject\r\n model: AxisModel;\r\n coordinateSystem: Parallel;\r\n\r\n constructor(\r\n dim: DimensionName,\r\n scale: Scale,\r\n coordExtent: [number, number],\r\n axisType: OptionAxisType,\r\n axisIndex: number\r\n ) {\r\n super(dim, scale, coordExtent);\r\n\r\n this.type = axisType || 'value';\r\n this.axisIndex = axisIndex;\r\n }\r\n\r\n isHorizontal(): boolean {\r\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\r\n }\r\n\r\n}\r\n\r\nexport default ParallelAxis;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Calculate slider move result.\r\n * Usage:\r\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\r\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\r\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\r\n *\r\n * @param delta Move length.\r\n * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].\r\n * handleEnds will be modified in this method.\r\n * @param extent handleEnds is restricted by extent.\r\n * extent[0] should less or equals than extent[1].\r\n * @param handleIndex Can be 'all', means that both move the two handleEnds.\r\n * @param minSpan The range of dataZoom can not be smaller than that.\r\n * If not set, handle0 and cross handle1. If set as a non-negative\r\n * number (including `0`), handles will push each other when reaching\r\n * the minSpan.\r\n * @param maxSpan The range of dataZoom can not be larger than that.\r\n * @return The input handleEnds.\r\n */\r\nexport default function sliderMove(\r\n delta: number,\r\n handleEnds: number[],\r\n extent: number[],\r\n handleIndex: 'all' | 0 | 1,\r\n minSpan?: number,\r\n maxSpan?: number\r\n): number[] {\r\n\r\n delta = delta || 0;\r\n\r\n const extentSpan = extent[1] - extent[0];\r\n\r\n // Notice maxSpan and minSpan can be null/undefined.\r\n if (minSpan != null) {\r\n minSpan = restrict(minSpan, [0, extentSpan]);\r\n }\r\n if (maxSpan != null) {\r\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\r\n }\r\n if (handleIndex === 'all') {\r\n let handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\r\n handleSpan = restrict(handleSpan, [0, extentSpan]);\r\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\r\n handleIndex = 0;\r\n }\r\n\r\n handleEnds[0] = restrict(handleEnds[0], extent);\r\n handleEnds[1] = restrict(handleEnds[1], extent);\r\n\r\n const originalDistSign = getSpanSign(handleEnds, handleIndex);\r\n\r\n handleEnds[handleIndex] += delta;\r\n\r\n // Restrict in extent.\r\n const extentMinSpan = minSpan || 0;\r\n const realExtent = extent.slice();\r\n originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan);\r\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);\r\n\r\n // Expand span.\r\n let currDistSign;\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (minSpan != null && (\r\n currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan\r\n )) {\r\n // If minSpan exists, 'cross' is forbidden.\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\r\n }\r\n\r\n // Shrink span.\r\n currDistSign = getSpanSign(handleEnds, handleIndex);\r\n if (maxSpan != null && currDistSign.span > maxSpan) {\r\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\r\n }\r\n\r\n return handleEnds;\r\n}\r\n\r\nfunction getSpanSign(handleEnds: number[], handleIndex: 0 | 1) {\r\n const dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];\r\n // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\r\n // is at left of handleEnds[1] for non-cross case.\r\n return {span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1};\r\n}\r\n\r\nfunction restrict(value: number, extend: number[]) {\r\n return Math.min(\r\n extend[1] != null ? extend[1] : Infinity,\r\n Math.max(extend[0] != null ? extend[0] : -Infinity, value)\r\n );\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * Parallel Coordinates\r\n * \r\n */\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport * as layoutUtil from '../../util/layout';\r\nimport * as axisHelper from '../../coord/axisHelper';\r\nimport ParallelAxis from './ParallelAxis';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as numberUtil from '../../util/number';\r\nimport sliderMove from '../../component/helper/sliderMove';\r\nimport ParallelModel, { ParallelLayoutDirection } from './ParallelModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Dictionary, DimensionName, ScaleDataValue } from '../../util/types';\r\nimport { CoordinateSystem, CoordinateSystemMaster } from '../CoordinateSystem';\r\nimport ParallelAxisModel, { ParallelActiveState } from './AxisModel';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport { CategoryAxisBaseOption } from '../axisCommonTypes';\r\n\r\nconst each = zrUtil.each;\r\nconst mathMin = Math.min;\r\nconst mathMax = Math.max;\r\nconst mathFloor = Math.floor;\r\nconst mathCeil = Math.ceil;\r\nconst round = numberUtil.round;\r\nconst PI = Math.PI;\r\n\r\ninterface ParallelCoordinateSystemLayoutInfo {\r\n layout: ParallelLayoutDirection;\r\n pixelDimIndex: number;\r\n layoutBase: number;\r\n layoutLength: number;\r\n axisBase: number;\r\n axisLength: number;\r\n axisExpandable: boolean;\r\n axisExpandWidth: number;\r\n axisCollapseWidth: number;\r\n axisExpandWindow: number[];\r\n axisCount: number;\r\n winInnerIndices: number[];\r\n axisExpandWindow0Pos: number;\r\n}\r\n\r\nexport interface ParallelAxisLayoutInfo {\r\n position: number[];\r\n rotation: number;\r\n transform: matrix.MatrixArray;\r\n axisNameAvailableWidth: number;\r\n axisLabelShow: boolean;\r\n nameTruncateMaxWidth: number;\r\n tickDirection: -1 | 1;\r\n labelDirection: -1 | 1;\r\n}\r\n\r\ntype SlidedAxisExpandBehavior = 'none' | 'slide' | 'jump';\r\n\r\nclass Parallel implements CoordinateSystemMaster, CoordinateSystem {\r\n\r\n readonly type = 'parallel';\r\n\r\n /**\r\n * key: dimension\r\n */\r\n private _axesMap = zrUtil.createHashMap();\r\n\r\n /**\r\n * key: dimension\r\n * value: {position: [], rotation, }\r\n */\r\n private _axesLayout: Dictionary = {};\r\n\r\n /**\r\n * Always follow axis order.\r\n */\r\n readonly dimensions: ParallelModel['dimensions'];\r\n\r\n private _rect: graphic.BoundingRect;\r\n\r\n private _model: ParallelModel;\r\n\r\n // Inject\r\n name: string;\r\n model: ParallelModel;\r\n\r\n\r\n constructor(parallelModel: ParallelModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.dimensions = parallelModel.dimensions;\r\n this._model = parallelModel;\r\n\r\n this._init(parallelModel, ecModel, api);\r\n }\r\n\r\n private _init(parallelModel: ParallelModel, ecModel: GlobalModel, api: ExtensionAPI): void {\r\n\r\n const dimensions = parallelModel.dimensions;\r\n const parallelAxisIndex = parallelModel.parallelAxisIndex;\r\n\r\n each(dimensions, function (dim, idx) {\r\n\r\n const axisIndex = parallelAxisIndex[idx];\r\n const axisModel = ecModel.getComponent('parallelAxis', axisIndex) as ParallelAxisModel;\r\n\r\n const axis = this._axesMap.set(dim, new ParallelAxis(\r\n dim,\r\n axisHelper.createScaleByModel(axisModel),\r\n [0, 0],\r\n axisModel.get('type'),\r\n axisIndex\r\n ));\r\n\r\n const isCategory = axis.type === 'category';\r\n axis.onBand = isCategory\r\n && (axisModel as AxisBaseModel).get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n\r\n // Injection\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = axisModel.coordinateSystem = this;\r\n\r\n }, this);\r\n }\r\n\r\n /**\r\n * Update axis scale after data processed\r\n */\r\n update(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n this._updateAxesFromSeries(this._model, ecModel);\r\n }\r\n\r\n containPoint(point: number[]): boolean {\r\n const layoutInfo = this._makeLayoutInfo();\r\n const axisBase = layoutInfo.axisBase;\r\n const layoutBase = layoutInfo.layoutBase;\r\n const pixelDimIndex = layoutInfo.pixelDimIndex;\r\n const pAxis = point[1 - pixelDimIndex];\r\n const pLayout = point[pixelDimIndex];\r\n\r\n return pAxis >= axisBase\r\n && pAxis <= axisBase + layoutInfo.axisLength\r\n && pLayout >= layoutBase\r\n && pLayout <= layoutBase + layoutInfo.layoutLength;\r\n }\r\n\r\n getModel(): ParallelModel {\r\n return this._model;\r\n }\r\n\r\n /**\r\n * Update properties from series\r\n */\r\n private _updateAxesFromSeries(parallelModel: ParallelModel, ecModel: GlobalModel): void {\r\n ecModel.eachSeries(function (seriesModel) {\r\n\r\n if (!parallelModel.contains(seriesModel, ecModel)) {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n\r\n each(this.dimensions, function (dim) {\r\n const axis = this._axesMap.get(dim);\r\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\r\n axisHelper.niceScaleExtent(axis.scale, axis.model);\r\n }, this);\r\n }, this);\r\n }\r\n\r\n /**\r\n * Resize the parallel coordinate system.\r\n */\r\n resize(parallelModel: ParallelModel, api: ExtensionAPI): void {\r\n this._rect = layoutUtil.getLayoutRect(\r\n parallelModel.getBoxLayoutParams(),\r\n {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }\r\n );\r\n\r\n this._layoutAxes();\r\n }\r\n\r\n getRect(): graphic.BoundingRect {\r\n return this._rect;\r\n }\r\n\r\n private _makeLayoutInfo(): ParallelCoordinateSystemLayoutInfo {\r\n const parallelModel = this._model;\r\n const rect = this._rect;\r\n const xy = ['x', 'y'] as const;\r\n const wh = ['width', 'height'] as const;\r\n const layout = parallelModel.get('layout');\r\n const pixelDimIndex = layout === 'horizontal' ? 0 : 1;\r\n const layoutLength = rect[wh[pixelDimIndex]];\r\n const layoutExtent = [0, layoutLength];\r\n const axisCount = this.dimensions.length;\r\n\r\n const axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent);\r\n const axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\r\n const axisExpandable = parallelModel.get('axisExpandable')\r\n && axisCount > 3\r\n && axisCount > axisExpandCount\r\n && axisExpandCount > 1\r\n && axisExpandWidth > 0\r\n && layoutLength > 0;\r\n\r\n // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength],\r\n // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow),\r\n // where collapsed axes should be overlapped.\r\n let axisExpandWindow = parallelModel.get('axisExpandWindow');\r\n let winSize;\r\n if (!axisExpandWindow) {\r\n winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\r\n const axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor(axisCount / 2);\r\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n else {\r\n winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\r\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\r\n }\r\n\r\n let axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);\r\n // Avoid axisCollapseWidth is too small.\r\n axisCollapseWidth < 3 && (axisCollapseWidth = 0);\r\n\r\n // Find the first and last indices > ewin[0] and < ewin[1].\r\n const winInnerIndices = [\r\n mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1,\r\n mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1\r\n ];\r\n\r\n // Pos in ec coordinates.\r\n const axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\r\n\r\n return {\r\n layout: layout,\r\n pixelDimIndex: pixelDimIndex,\r\n layoutBase: rect[xy[pixelDimIndex]],\r\n layoutLength: layoutLength,\r\n axisBase: rect[xy[1 - pixelDimIndex]],\r\n axisLength: rect[wh[1 - pixelDimIndex]],\r\n axisExpandable: axisExpandable,\r\n axisExpandWidth: axisExpandWidth,\r\n axisCollapseWidth: axisCollapseWidth,\r\n axisExpandWindow: axisExpandWindow,\r\n axisCount: axisCount,\r\n winInnerIndices: winInnerIndices,\r\n axisExpandWindow0Pos: axisExpandWindow0Pos\r\n };\r\n }\r\n\r\n private _layoutAxes(): void {\r\n const rect = this._rect;\r\n const axes = this._axesMap;\r\n const dimensions = this.dimensions;\r\n const layoutInfo = this._makeLayoutInfo();\r\n const layout = layoutInfo.layout;\r\n\r\n axes.each(function (axis) {\r\n const axisExtent = [0, layoutInfo.axisLength];\r\n const idx = axis.inverse ? 1 : 0;\r\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\r\n });\r\n\r\n each(dimensions, function (dim, idx) {\r\n const posInfo = (layoutInfo.axisExpandable\r\n ? layoutAxisWithExpand : layoutAxisWithoutExpand\r\n )(idx, layoutInfo);\r\n\r\n const positionTable = {\r\n horizontal: {\r\n x: posInfo.position,\r\n y: layoutInfo.axisLength\r\n },\r\n vertical: {\r\n x: 0,\r\n y: posInfo.position\r\n }\r\n };\r\n const rotationTable = {\r\n horizontal: PI / 2,\r\n vertical: 0\r\n };\r\n\r\n const position = [\r\n positionTable[layout].x + rect.x,\r\n positionTable[layout].y + rect.y\r\n ];\r\n\r\n const rotation = rotationTable[layout];\r\n const transform = matrix.create();\r\n matrix.rotate(transform, transform, rotation);\r\n matrix.translate(transform, transform, position);\r\n\r\n // TODO\r\n // tick layout info\r\n\r\n // TODO\r\n // update dimensions info based on axis order.\r\n\r\n this._axesLayout[dim] = {\r\n position: position,\r\n rotation: rotation,\r\n transform: transform,\r\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\r\n axisLabelShow: posInfo.axisLabelShow,\r\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\r\n tickDirection: 1,\r\n labelDirection: 1\r\n };\r\n }, this);\r\n }\r\n\r\n /**\r\n * Get axis by dim.\r\n */\r\n getAxis(dim: DimensionName): ParallelAxis {\r\n return this._axesMap.get(dim);\r\n }\r\n\r\n /**\r\n * Convert a dim value of a single item of series data to Point.\r\n */\r\n dataToPoint(value: ScaleDataValue, dim: DimensionName): number[] {\r\n return this.axisCoordToPoint(\r\n this._axesMap.get(dim).dataToCoord(value),\r\n dim\r\n );\r\n }\r\n\r\n /**\r\n * Travel data for one time, get activeState of each data item.\r\n * @param start the start dataIndex that travel from.\r\n * @param end the next dataIndex of the last dataIndex will be travel.\r\n */\r\n eachActiveState(\r\n data: SeriesData,\r\n callback: (activeState: ParallelActiveState, dataIndex: number) => void,\r\n start?: number,\r\n end?: number\r\n ): void {\r\n start == null && (start = 0);\r\n end == null && (end = data.count());\r\n\r\n const axesMap = this._axesMap;\r\n const dimensions = this.dimensions;\r\n const dataDimensions = [] as DimensionName[];\r\n const axisModels = [] as ParallelAxisModel[];\r\n\r\n zrUtil.each(dimensions, function (axisDim) {\r\n dataDimensions.push(data.mapDimension(axisDim));\r\n axisModels.push(axesMap.get(axisDim).model);\r\n });\r\n\r\n const hasActiveSet = this.hasAxisBrushed();\r\n\r\n for (let dataIndex = start; dataIndex < end; dataIndex++) {\r\n let activeState: ParallelActiveState;\r\n\r\n if (!hasActiveSet) {\r\n activeState = 'normal';\r\n }\r\n else {\r\n activeState = 'active';\r\n const values = data.getValues(dataDimensions, dataIndex);\r\n for (let j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n const state = axisModels[j].getActiveState(values[j]);\r\n\r\n if (state === 'inactive') {\r\n activeState = 'inactive';\r\n break;\r\n }\r\n }\r\n }\r\n\r\n callback(activeState, dataIndex);\r\n }\r\n }\r\n\r\n /**\r\n * Whether has any activeSet.\r\n */\r\n hasAxisBrushed(): boolean {\r\n const dimensions = this.dimensions;\r\n const axesMap = this._axesMap;\r\n let hasActiveSet = false;\r\n\r\n for (let j = 0, lenj = dimensions.length; j < lenj; j++) {\r\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\r\n hasActiveSet = true;\r\n }\r\n }\r\n\r\n return hasActiveSet;\r\n }\r\n\r\n /**\r\n * Convert coords of each axis to Point.\r\n * Return point. For example: [10, 20]\r\n */\r\n axisCoordToPoint(coord: number, dim: DimensionName): number[] {\r\n const axisLayout = this._axesLayout[dim];\r\n return graphic.applyTransform([coord, 0], axisLayout.transform);\r\n }\r\n\r\n /**\r\n * Get axis layout.\r\n */\r\n getAxisLayout(dim: DimensionName): ParallelAxisLayoutInfo {\r\n return zrUtil.clone(this._axesLayout[dim]);\r\n }\r\n\r\n /**\r\n * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.\r\n */\r\n getSlidedAxisExpandWindow(point: number[]): {\r\n axisExpandWindow: number[],\r\n behavior: SlidedAxisExpandBehavior\r\n } {\r\n const layoutInfo = this._makeLayoutInfo();\r\n const pixelDimIndex = layoutInfo.pixelDimIndex;\r\n let axisExpandWindow = layoutInfo.axisExpandWindow.slice();\r\n const winSize = axisExpandWindow[1] - axisExpandWindow[0];\r\n const extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];\r\n\r\n // Out of the area of coordinate system.\r\n if (!this.containPoint(point)) {\r\n return {behavior: 'none', axisExpandWindow: axisExpandWindow};\r\n }\r\n\r\n // Convert the point from global to expand coordinates.\r\n const pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;\r\n\r\n // For dragging operation convenience, the window should not be\r\n // slided when mouse is the center area of the window.\r\n let delta;\r\n let behavior: SlidedAxisExpandBehavior = 'slide';\r\n const axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n const triggerArea = this._model.get('axisExpandSlideTriggerArea');\r\n // But consider touch device, jump is necessary.\r\n const useJump = triggerArea[0] != null;\r\n\r\n if (axisCollapseWidth) {\r\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * triggerArea[2];\r\n }\r\n else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\r\n behavior = 'jump';\r\n delta = pointCoord - winSize * (1 - triggerArea[2]);\r\n }\r\n else {\r\n (delta = pointCoord - winSize * triggerArea[1]) >= 0\r\n && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0\r\n && (delta = 0);\r\n }\r\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\r\n delta\r\n ? sliderMove(delta, axisExpandWindow, extent, 'all')\r\n // Avoid nonsense triger on mousemove.\r\n : (behavior = 'none');\r\n }\r\n // When screen is too narrow, make it visible and slidable, although it is hard to interact.\r\n else {\r\n const winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\r\n const pos = extent[1] * pointCoord / winSize2;\r\n axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];\r\n axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);\r\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\r\n }\r\n\r\n return {\r\n axisExpandWindow: axisExpandWindow,\r\n behavior: behavior\r\n };\r\n }\r\n\r\n // TODO\r\n // convertToPixel\r\n // convertFromPixel\r\n // Note:\r\n // (1) Consider Parallel, the return type of `convertToPixel` could be number[][] (Point[]).\r\n // (2) In parallel coord sys, how to make `convertFromPixel` make sense?\r\n // Perhaps convert a point based on \"a rensent most axis\" is more meaningful rather than based on all axes?\r\n}\r\n\r\n\r\nfunction restrict(len: number, extent: number[]): number {\r\n return mathMin(mathMax(len, extent[0]), extent[1]);\r\n}\r\n\r\ninterface ParallelAxisLayoutPositionInfo {\r\n position: number;\r\n axisNameAvailableWidth: number;\r\n axisLabelShow: boolean;\r\n nameTruncateMaxWidth?: number;\r\n}\r\n\r\nfunction layoutAxisWithoutExpand(\r\n axisIndex: number,\r\n layoutInfo: ParallelCoordinateSystemLayoutInfo\r\n): ParallelAxisLayoutPositionInfo {\r\n const step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\r\n return {\r\n position: step * axisIndex,\r\n axisNameAvailableWidth: step,\r\n axisLabelShow: true\r\n };\r\n}\r\n\r\nfunction layoutAxisWithExpand(\r\n axisIndex: number,\r\n layoutInfo: ParallelCoordinateSystemLayoutInfo\r\n): ParallelAxisLayoutPositionInfo {\r\n const layoutLength = layoutInfo.layoutLength;\r\n const axisExpandWidth = layoutInfo.axisExpandWidth;\r\n const axisCount = layoutInfo.axisCount;\r\n const axisCollapseWidth = layoutInfo.axisCollapseWidth;\r\n const winInnerIndices = layoutInfo.winInnerIndices;\r\n\r\n let position;\r\n let axisNameAvailableWidth = axisCollapseWidth;\r\n let axisLabelShow = false;\r\n let nameTruncateMaxWidth;\r\n\r\n if (axisIndex < winInnerIndices[0]) {\r\n position = axisIndex * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n else if (axisIndex <= winInnerIndices[1]) {\r\n position = layoutInfo.axisExpandWindow0Pos\r\n + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\r\n axisNameAvailableWidth = axisExpandWidth;\r\n axisLabelShow = true;\r\n }\r\n else {\r\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\r\n nameTruncateMaxWidth = axisCollapseWidth;\r\n }\r\n\r\n return {\r\n position: position,\r\n axisNameAvailableWidth: axisNameAvailableWidth,\r\n axisLabelShow: axisLabelShow,\r\n nameTruncateMaxWidth: nameTruncateMaxWidth\r\n };\r\n}\r\n\r\nexport default Parallel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * Parallel coordinate system creater.\r\n */\r\n\r\nimport Parallel from './Parallel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport ParallelModel from './ParallelModel';\r\nimport { CoordinateSystemMaster } from '../CoordinateSystem';\r\nimport ParallelSeriesModel from '../../chart/parallel/ParallelSeries';\r\nimport { SINGLE_REFERRING } from '../../util/model';\r\n\r\nfunction createParallelCoordSys(ecModel: GlobalModel, api: ExtensionAPI): CoordinateSystemMaster[] {\r\n const coordSysList: CoordinateSystemMaster[] = [];\r\n\r\n ecModel.eachComponent('parallel', function (parallelModel: ParallelModel, idx: number) {\r\n const coordSys = new Parallel(parallelModel, ecModel, api);\r\n\r\n coordSys.name = 'parallel_' + idx;\r\n coordSys.resize(parallelModel, api);\r\n\r\n parallelModel.coordinateSystem = coordSys;\r\n coordSys.model = parallelModel;\r\n\r\n coordSysList.push(coordSys);\r\n });\r\n\r\n // Inject the coordinateSystems into seriesModel\r\n ecModel.eachSeries(function (seriesModel) {\r\n if ((seriesModel as ParallelSeriesModel).get('coordinateSystem') === 'parallel') {\r\n const parallelModel = seriesModel.getReferringComponents(\r\n 'parallel', SINGLE_REFERRING\r\n ).models[0] as ParallelModel;\r\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\r\n }\r\n });\r\n\r\n return coordSysList;\r\n}\r\nconst parallelCoordSysCreator = {\r\n create: createParallelCoordSys\r\n};\r\n\r\nexport default parallelCoordSysCreator;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ComponentModel from '../../model/Component';\r\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper';\r\nimport { AxisModelExtendedInCreator } from '../axisModelCreator';\r\nimport * as numberUtil from '../../util/number';\r\nimport {AxisModelCommonMixin} from '../axisModelCommonMixin';\r\nimport ParallelAxis from './ParallelAxis';\r\nimport { ZRColor, ParsedValue } from '../../util/types';\r\nimport { AxisBaseOption } from '../axisCommonTypes';\r\nimport Parallel from './Parallel';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\n\r\n\r\n// 'normal' means there is no \"active intervals\" existing.\r\nexport type ParallelActiveState = 'normal' | 'active' | 'inactive';\r\nexport type ParallelAxisInterval = number[];\r\ntype ParallelAreaSelectStyleKey = 'fill' | 'lineWidth' | 'stroke' | 'opacity';\r\nexport type ParallelAreaSelectStyleProps = Pick & {\r\n // Selected area width.\r\n width: number;\r\n};\r\n\r\nexport type ParallelAxisOption = AxisBaseOption & {\r\n /**\r\n * 0, 1, 2, ...\r\n */\r\n dim?: number | number[];\r\n parallelIndex?: number;\r\n areaSelectStyle?: {\r\n width?: number;\r\n borderWidth?: number;\r\n borderColor?: ZRColor;\r\n color?: ZRColor;\r\n opacity?: number;\r\n };\r\n // Whether realtime update view when select.\r\n realtime?: boolean;\r\n};\r\n\r\nclass ParallelAxisModel extends ComponentModel {\r\n\r\n static type: 'baseParallelAxis';\r\n readonly type = ParallelAxisModel.type;\r\n\r\n axis: ParallelAxis;\r\n\r\n // Inject\r\n coordinateSystem: Parallel;\r\n\r\n /**\r\n * @readOnly\r\n */\r\n activeIntervals: ParallelAxisInterval[] = [];\r\n\r\n getAreaSelectStyle(): ParallelAreaSelectStyleProps {\r\n return makeStyleMapper(\r\n [\r\n ['fill', 'color'],\r\n ['lineWidth', 'borderWidth'],\r\n ['stroke', 'borderColor'],\r\n ['width', 'width'],\r\n ['opacity', 'opacity']\r\n // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\r\n // So do not transfer decal directly.\r\n ]\r\n )(this.getModel('areaSelectStyle')) as ParallelAreaSelectStyleProps;\r\n }\r\n\r\n /**\r\n * The code of this feature is put on AxisModel but not ParallelAxis,\r\n * because axisModel can be alive after echarts updating but instance of\r\n * ParallelAxis having been disposed. this._activeInterval should be kept\r\n * when action dispatched (i.e. legend click).\r\n *\r\n * @param intervals `interval.length === 0` means set all active.\r\n */\r\n setActiveIntervals(intervals: ParallelAxisInterval[]): void {\r\n const activeIntervals = this.activeIntervals = zrUtil.clone(intervals);\r\n\r\n // Normalize\r\n if (activeIntervals) {\r\n for (let i = activeIntervals.length - 1; i >= 0; i--) {\r\n numberUtil.asc(activeIntervals[i]);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @param value When only attempting detect whether 'no activeIntervals set',\r\n * `value` is not needed to be input.\r\n */\r\n getActiveState(value?: ParsedValue): ParallelActiveState {\r\n const activeIntervals = this.activeIntervals;\r\n\r\n if (!activeIntervals.length) {\r\n return 'normal';\r\n }\r\n\r\n if (value == null || isNaN(+value)) {\r\n return 'inactive';\r\n }\r\n\r\n // Simple optimization\r\n if (activeIntervals.length === 1) {\r\n const interval = activeIntervals[0];\r\n if (interval[0] <= value && value <= interval[1]) {\r\n return 'active';\r\n }\r\n }\r\n else {\r\n for (let i = 0, len = activeIntervals.length; i < len; i++) {\r\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\r\n return 'active';\r\n }\r\n }\r\n }\r\n\r\n return 'inactive';\r\n }\r\n\r\n}\r\ninterface ParallelAxisModel extends AxisModelCommonMixin,\r\n AxisModelExtendedInCreator {}\r\n\r\nzrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);\r\n\r\nexport default ParallelAxisModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport {curry, each, map, bind, merge, clone, defaults, assert} from 'zrender/src/core/util';\r\nimport Eventful from 'zrender/src/core/Eventful';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as interactionMutex from './interactionMutex';\r\nimport DataDiffer from '../../data/DataDiffer';\r\nimport { Dictionary } from '../../util/types';\r\nimport { ZRenderType } from 'zrender/src/zrender';\r\nimport { ElementEvent } from 'zrender/src/Element';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\n\r\n\r\n/**\r\n * BrushController is not only used in \"brush component\",\r\n * but is also used in \"tooltip DataZoom\", and other possible\r\n * further brush behavior related scenarios.\r\n * So `BrushController` should not depend on \"brush component model\".\r\n */\r\n\r\n\r\nexport type BrushType = 'polygon' | 'rect' | 'lineX' | 'lineY';\r\n/**\r\n * Only for drawing (after enabledBrush).\r\n * 'line', 'rect', 'polygon' or false\r\n * If passing false/null/undefined, disable brush.\r\n * If passing 'auto', determined by panel.defaultBrushType\r\n */\r\nexport type BrushTypeUncertain = BrushType | false | 'auto';\r\n\r\nexport type BrushMode = 'single' | 'multiple';\r\n// MinMax: Range of linear brush.\r\n// MinMax[]: Range of multi-dimension like rect/polygon, which is a MinMax\r\n// list for each dimension of the coord sys. For example:\r\n// cartesian: [[xMin, xMax], [yMin, yMax]]\r\n// geo: [[lngMin, lngMin], [latMin, latMax]]\r\nexport type BrushDimensionMinMax = number[];\r\nexport type BrushAreaRange = BrushDimensionMinMax | BrushDimensionMinMax[];\r\n\r\nexport interface BrushCoverConfig {\r\n // Mandatory. determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y')\r\n brushType: BrushType;\r\n // Can be specified by user to map covers in `updateCovers`\r\n // in `dispatchAction({type: 'brush', areas: [{id: ...}, ...]})`\r\n id?: string;\r\n // Range in global coordinate (pixel).\r\n range?: BrushAreaRange;\r\n // When create a new area by `updateCovers`, panelId should be specified.\r\n // If not null/undefined, means global panel.\r\n // Also see `BrushAreaParam['panelId']`.\r\n panelId?: string;\r\n\r\n brushMode?: BrushMode;\r\n // `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default.\r\n brushStyle?: Pick;\r\n transformable?: boolean;\r\n removeOnClick?: boolean;\r\n z?: number;\r\n}\r\n\r\n/**\r\n * `BrushAreaCreatorOption` input to brushModel via `setBrushOption`,\r\n * merge and convert to `BrushCoverCreatorConfig`.\r\n */\r\nexport interface BrushCoverCreatorConfig extends Pick<\r\n BrushCoverConfig,\r\n 'brushMode' | 'transformable' | 'removeOnClick' | 'brushStyle' | 'z'\r\n> {\r\n brushType: BrushTypeUncertain;\r\n}\r\n\r\ntype BrushStyleKey =\r\n 'fill'\r\n | 'stroke'\r\n | 'lineWidth'\r\n | 'opacity'\r\n | 'shadowBlur'\r\n | 'shadowOffsetX'\r\n | 'shadowOffsetY'\r\n | 'shadowColor';\r\n\r\n\r\nconst BRUSH_PANEL_GLOBAL = true as const;\r\n\r\nexport interface BrushPanelConfig {\r\n // mandatory.\r\n panelId: string;\r\n // mandatory.\r\n clipPath(localPoints: number[][], transform: matrix.MatrixArray): number[][];\r\n // mandatory.\r\n isTargetByCursor(e: ElementEvent, localCursorPoint: number[], transform: matrix.MatrixArray): boolean;\r\n // optional, only used when brushType is 'auto'.\r\n defaultBrushType?: BrushType;\r\n // optional.\r\n getLinearBrushOtherExtent?(xyIndex: number): number[];\r\n}\r\n// `true` represents global panel;\r\ntype BrushPanelConfigOrGlobal = BrushPanelConfig | typeof BRUSH_PANEL_GLOBAL;\r\n\r\n\r\ninterface BrushCover extends graphic.Group {\r\n __brushOption: BrushCoverConfig;\r\n}\r\n\r\ntype Point = number[];\r\n\r\nconst mathMin = Math.min;\r\nconst mathMax = Math.max;\r\nconst mathPow = Math.pow;\r\n\r\nconst COVER_Z = 10000;\r\nconst UNSELECT_THRESHOLD = 6;\r\nconst MIN_RESIZE_LINE_WIDTH = 6;\r\nconst MUTEX_RESOURCE_KEY = 'globalPan';\r\n\r\ntype DirectionName = 'w' | 'e' | 'n' | 's';\r\ntype DirectionNameSequence = DirectionName[];\r\n\r\nconst DIRECTION_MAP = {\r\n w: [0, 0],\r\n e: [0, 1],\r\n n: [1, 0],\r\n s: [1, 1]\r\n} as const;\r\nconst CURSOR_MAP = {\r\n w: 'ew',\r\n e: 'ew',\r\n n: 'ns',\r\n s: 'ns',\r\n ne: 'nesw',\r\n sw: 'nesw',\r\n nw: 'nwse',\r\n se: 'nwse'\r\n} as const;\r\nconst DEFAULT_BRUSH_OPT = {\r\n brushStyle: {\r\n lineWidth: 2,\r\n stroke: 'rgba(210,219,238,0.3)',\r\n fill: '#D2DBEE'\r\n },\r\n transformable: true,\r\n brushMode: 'single',\r\n removeOnClick: false\r\n};\r\n\r\nlet baseUID = 0;\r\n\r\nexport interface BrushControllerEvents {\r\n brush: {\r\n areas: {\r\n brushType: BrushType;\r\n panelId: string;\r\n range: BrushAreaRange;\r\n }[];\r\n isEnd: boolean;\r\n removeOnClick: boolean;\r\n }\r\n}\r\n\r\n/**\r\n * params:\r\n * areas: Array., coord relates to container group,\r\n * If no container specified, to global.\r\n * opt {\r\n * isEnd: boolean,\r\n * removeOnClick: boolean\r\n * }\r\n */\r\nclass BrushController extends Eventful<{\r\n [key in keyof BrushControllerEvents]: (params: BrushControllerEvents[key]) => void | undefined\r\n}> {\r\n\r\n readonly group: graphic.Group;\r\n\r\n /**\r\n * @internal\r\n */\r\n _zr: ZRenderType;\r\n\r\n /**\r\n * @internal\r\n */\r\n _brushType: BrushTypeUncertain;\r\n\r\n /**\r\n * @internal\r\n * Only for drawing (after enabledBrush).\r\n */\r\n _brushOption: BrushCoverCreatorConfig;\r\n\r\n /**\r\n * @internal\r\n * Key: panelId\r\n */\r\n _panels: Dictionary;\r\n\r\n /**\r\n * @internal\r\n */\r\n _track: number[][] = [];\r\n\r\n /**\r\n * @internal\r\n */\r\n _dragging: boolean;\r\n\r\n /**\r\n * @internal\r\n */\r\n _covers: BrushCover[] = [];\r\n\r\n /**\r\n * @internal\r\n */\r\n _creatingCover: BrushCover;\r\n\r\n /**\r\n * @internal\r\n */\r\n _creatingPanel: BrushPanelConfigOrGlobal;\r\n\r\n private _enableGlobalPan: boolean;\r\n\r\n private _mounted: boolean;\r\n\r\n /**\r\n * @internal\r\n */\r\n _transform: matrix.MatrixArray;\r\n\r\n private _uid: string;\r\n\r\n private _handlers: {\r\n [eventName: string]: (this: BrushController, e: ElementEvent) => void\r\n } = {};\r\n\r\n\r\n constructor(zr: ZRenderType) {\r\n super();\r\n\r\n if (__DEV__) {\r\n assert(zr);\r\n }\r\n\r\n this._zr = zr;\r\n\r\n this.group = new graphic.Group();\r\n\r\n this._uid = 'brushController_' + baseUID++;\r\n\r\n each(pointerHandlers, function (this: BrushController, handler, eventName) {\r\n this._handlers[eventName] = bind(handler, this);\r\n }, this);\r\n }\r\n\r\n /**\r\n * If set to `false`, select disabled.\r\n */\r\n enableBrush(brushOption: Partial | false): BrushController {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n\r\n this._brushType && this._doDisableBrush();\r\n (brushOption as Partial).brushType && this._doEnableBrush(\r\n brushOption as Partial\r\n );\r\n\r\n return this;\r\n }\r\n\r\n private _doEnableBrush(brushOption: Partial): void {\r\n const zr = this._zr;\r\n\r\n // Consider roam, which takes globalPan too.\r\n if (!this._enableGlobalPan) {\r\n interactionMutex.take(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n }\r\n\r\n each(this._handlers, function (handler, eventName) {\r\n zr.on(eventName, handler);\r\n });\r\n\r\n this._brushType = brushOption.brushType;\r\n this._brushOption = merge(\r\n clone(DEFAULT_BRUSH_OPT), brushOption, true\r\n ) as BrushCoverCreatorConfig;\r\n }\r\n\r\n private _doDisableBrush(): void {\r\n const zr = this._zr;\r\n\r\n interactionMutex.release(zr, MUTEX_RESOURCE_KEY, this._uid);\r\n\r\n each(this._handlers, function (handler, eventName) {\r\n zr.off(eventName, handler);\r\n });\r\n\r\n this._brushType = this._brushOption = null;\r\n }\r\n\r\n /**\r\n * @param panelOpts If not pass, it is global brush.\r\n */\r\n setPanels(panelOpts?: BrushPanelConfig[]): BrushController {\r\n if (panelOpts && panelOpts.length) {\r\n const panels = this._panels = {} as Dictionary;\r\n each(panelOpts, function (panelOpts) {\r\n panels[panelOpts.panelId] = clone(panelOpts);\r\n });\r\n }\r\n else {\r\n this._panels = null;\r\n }\r\n return this;\r\n }\r\n\r\n mount(opt?: {\r\n enableGlobalPan?: boolean;\r\n x?: number;\r\n y?: number;\r\n rotation?: number;\r\n scaleX?: number;\r\n scaleY?: number\r\n }): BrushController {\r\n opt = opt || {};\r\n\r\n if (__DEV__) {\r\n this._mounted = true; // should be at first.\r\n }\r\n\r\n this._enableGlobalPan = opt.enableGlobalPan;\r\n\r\n const thisGroup = this.group;\r\n this._zr.add(thisGroup);\r\n\r\n thisGroup.attr({\r\n x: opt.x || 0,\r\n y: opt.y || 0,\r\n rotation: opt.rotation || 0,\r\n scaleX: opt.scaleX || 1,\r\n scaleY: opt.scaleY || 1\r\n });\r\n this._transform = thisGroup.getLocalTransform();\r\n\r\n return this;\r\n }\r\n\r\n // eachCover(cb, context): void {\r\n // each(this._covers, cb, context);\r\n // }\r\n\r\n /**\r\n * Update covers.\r\n * @param coverConfigList\r\n * If coverConfigList is null/undefined, all covers removed.\r\n */\r\n updateCovers(coverConfigList: BrushCoverConfig[]) {\r\n if (__DEV__) {\r\n assert(this._mounted);\r\n }\r\n\r\n coverConfigList = map(coverConfigList, function (coverConfig) {\r\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\r\n }) as BrushCoverConfig[];\r\n\r\n const tmpIdPrefix = '\\0-brush-index-';\r\n const oldCovers = this._covers;\r\n const newCovers = this._covers = [] as BrushCover[];\r\n const controller = this;\r\n const creatingCover = this._creatingCover;\r\n\r\n (new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey))\r\n .add(addOrUpdate)\r\n .update(addOrUpdate)\r\n .remove(remove)\r\n .execute();\r\n\r\n return this;\r\n\r\n function getKey(brushOption: BrushCoverConfig, index: number): string {\r\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index)\r\n + '-' + brushOption.brushType;\r\n }\r\n\r\n function oldGetKey(cover: BrushCover, index: number): string {\r\n return getKey(cover.__brushOption, index);\r\n }\r\n\r\n function addOrUpdate(newIndex: number, oldIndex?: number): void {\r\n const newBrushInternal = coverConfigList[newIndex];\r\n // Consider setOption in event listener of brushSelect,\r\n // where updating cover when creating should be forbidden.\r\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\r\n newCovers[newIndex] = oldCovers[oldIndex];\r\n }\r\n else {\r\n const cover = newCovers[newIndex] = oldIndex != null\r\n ? (\r\n oldCovers[oldIndex].__brushOption = newBrushInternal,\r\n oldCovers[oldIndex]\r\n )\r\n : endCreating(controller, createCover(controller, newBrushInternal));\r\n updateCoverAfterCreation(controller, cover);\r\n }\r\n }\r\n\r\n function remove(oldIndex: number) {\r\n if (oldCovers[oldIndex] !== creatingCover) {\r\n controller.group.remove(oldCovers[oldIndex]);\r\n }\r\n }\r\n }\r\n\r\n unmount() {\r\n if (__DEV__) {\r\n if (!this._mounted) {\r\n return;\r\n }\r\n }\r\n\r\n this.enableBrush(false);\r\n\r\n // container may 'removeAll' outside.\r\n clearCovers(this);\r\n this._zr.remove(this.group);\r\n\r\n if (__DEV__) {\r\n this._mounted = false; // should be at last.\r\n }\r\n\r\n return this;\r\n }\r\n\r\n dispose() {\r\n this.unmount();\r\n this.off();\r\n }\r\n}\r\n\r\n\r\nfunction createCover(controller: BrushController, brushOption: BrushCoverConfig): BrushCover {\r\n const cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\r\n cover.__brushOption = brushOption;\r\n updateZ(cover, brushOption);\r\n controller.group.add(cover);\r\n return cover;\r\n}\r\n\r\nfunction endCreating(controller: BrushController, creatingCover: BrushCover): BrushCover {\r\n const coverRenderer = getCoverRenderer(creatingCover);\r\n if (coverRenderer.endCreating) {\r\n coverRenderer.endCreating(controller, creatingCover);\r\n updateZ(creatingCover, creatingCover.__brushOption);\r\n }\r\n return creatingCover;\r\n}\r\n\r\nfunction updateCoverShape(controller: BrushController, cover: BrushCover): void {\r\n const brushOption = cover.__brushOption;\r\n getCoverRenderer(cover).updateCoverShape(\r\n controller, cover, brushOption.range, brushOption\r\n );\r\n}\r\n\r\nfunction updateZ(cover: BrushCover, brushOption: BrushCoverConfig): void {\r\n let z = brushOption.z;\r\n z == null && (z = COVER_Z);\r\n cover.traverse(function (el: Displayable) {\r\n el.z = z;\r\n el.z2 = z; // Consider in given container.\r\n });\r\n}\r\n\r\nfunction updateCoverAfterCreation(controller: BrushController, cover: BrushCover): void {\r\n getCoverRenderer(cover).updateCommon(controller, cover);\r\n updateCoverShape(controller, cover);\r\n}\r\n\r\nfunction getCoverRenderer(cover: BrushCover): CoverRenderer {\r\n return coverRenderers[cover.__brushOption.brushType];\r\n}\r\n\r\n// return target panel or `true` (means global panel)\r\nfunction getPanelByPoint(\r\n controller: BrushController,\r\n e: ElementEvent,\r\n localCursorPoint: Point\r\n): BrushPanelConfigOrGlobal {\r\n const panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL; // Global panel\r\n }\r\n let panel;\r\n const transform = controller._transform;\r\n each(panels, function (pn) {\r\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\r\n });\r\n return panel;\r\n}\r\n\r\n// Return a panel or true\r\nfunction getPanelByCover(controller: BrushController, cover: BrushCover): BrushPanelConfigOrGlobal {\r\n const panels = controller._panels;\r\n if (!panels) {\r\n return BRUSH_PANEL_GLOBAL; // Global panel\r\n }\r\n const panelId = cover.__brushOption.panelId;\r\n // User may give cover without coord sys info,\r\n // which is then treated as global panel.\r\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\r\n}\r\n\r\nfunction clearCovers(controller: BrushController): boolean {\r\n const covers = controller._covers;\r\n const originalLength = covers.length;\r\n each(covers, function (cover) {\r\n controller.group.remove(cover);\r\n }, controller);\r\n covers.length = 0;\r\n\r\n return !!originalLength;\r\n}\r\n\r\nfunction trigger(\r\n controller: BrushController,\r\n opt: {isEnd?: boolean, removeOnClick?: boolean}\r\n): void {\r\n const areas = map(controller._covers, function (cover) {\r\n const brushOption = cover.__brushOption;\r\n const range = clone(brushOption.range);\r\n return {\r\n brushType: brushOption.brushType,\r\n panelId: brushOption.panelId,\r\n range: range\r\n };\r\n });\r\n\r\n controller.trigger('brush', {\r\n areas: areas,\r\n isEnd: !!opt.isEnd,\r\n removeOnClick: !!opt.removeOnClick\r\n });\r\n}\r\n\r\nfunction shouldShowCover(controller: BrushController): boolean {\r\n const track = controller._track;\r\n\r\n if (!track.length) {\r\n return false;\r\n }\r\n\r\n const p2 = track[track.length - 1];\r\n const p1 = track[0];\r\n const dx = p2[0] - p1[0];\r\n const dy = p2[1] - p1[1];\r\n const dist = mathPow(dx * dx + dy * dy, 0.5);\r\n\r\n return dist > UNSELECT_THRESHOLD;\r\n}\r\n\r\nfunction getTrackEnds(track: Point[]): Point[] {\r\n let tail = track.length - 1;\r\n tail < 0 && (tail = 0);\r\n return [track[0], track[tail]];\r\n}\r\n\r\ninterface RectRangeConverter {\r\n toRectRange: (range: BrushAreaRange) => BrushDimensionMinMax[];\r\n fromRectRange: (areaRange: BrushDimensionMinMax[]) => BrushAreaRange;\r\n};\r\nfunction createBaseRectCover(\r\n rectRangeConverter: RectRangeConverter,\r\n controller: BrushController,\r\n brushOption: BrushCoverConfig,\r\n edgeNameSequences: DirectionNameSequence[]\r\n): BrushCover {\r\n const cover = new graphic.Group() as BrushCover;\r\n\r\n cover.add(new graphic.Rect({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true,\r\n draggable: true,\r\n cursor: 'move',\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\r\n ondragend: curry(trigger, controller, {isEnd: true})\r\n }));\r\n\r\n each(\r\n edgeNameSequences,\r\n function (nameSequence) {\r\n cover.add(new graphic.Rect({\r\n name: nameSequence.join(''),\r\n style: {opacity: 0},\r\n draggable: true,\r\n silent: true,\r\n invisible: true,\r\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\r\n ondragend: curry(trigger, controller, {isEnd: true})\r\n }));\r\n }\r\n );\r\n\r\n return cover;\r\n}\r\n\r\nfunction updateBaseRect(\r\n controller: BrushController,\r\n cover: BrushCover,\r\n localRange: BrushDimensionMinMax[],\r\n brushOption: BrushCoverConfig\r\n): void {\r\n const lineWidth = brushOption.brushStyle.lineWidth || 0;\r\n const handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);\r\n const x = localRange[0][0];\r\n const y = localRange[1][0];\r\n const xa = x - lineWidth / 2;\r\n const ya = y - lineWidth / 2;\r\n const x2 = localRange[0][1];\r\n const y2 = localRange[1][1];\r\n const x2a = x2 - handleSize + lineWidth / 2;\r\n const y2a = y2 - handleSize + lineWidth / 2;\r\n const width = x2 - x;\r\n const height = y2 - y;\r\n const widtha = width + lineWidth;\r\n const heighta = height + lineWidth;\r\n\r\n updateRectShape(controller, cover, 'main', x, y, width, height);\r\n\r\n if (brushOption.transformable) {\r\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\r\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\r\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\r\n\r\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\r\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\r\n }\r\n}\r\n\r\nfunction updateCommon(controller: BrushController, cover: BrushCover): void {\r\n const brushOption = cover.__brushOption;\r\n const transformable = brushOption.transformable;\r\n\r\n const mainEl = cover.childAt(0) as Displayable;\r\n mainEl.useStyle(makeStyle(brushOption));\r\n mainEl.attr({\r\n silent: !transformable,\r\n cursor: transformable ? 'move' : 'default'\r\n });\r\n\r\n each(\r\n [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']],\r\n function (nameSequence: DirectionNameSequence) {\r\n const el = cover.childOfName(nameSequence.join('')) as Displayable;\r\n const globalDir = nameSequence.length === 1\r\n ? getGlobalDirection1(controller, nameSequence[0])\r\n : getGlobalDirection2(controller, nameSequence);\r\n\r\n el && el.attr({\r\n silent: !transformable,\r\n invisible: !transformable,\r\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\r\n });\r\n }\r\n );\r\n}\r\n\r\nfunction updateRectShape(\r\n controller: BrushController,\r\n cover: BrushCover,\r\n name: string,\r\n x: number, y: number, w: number, h: number\r\n): void {\r\n const el = cover.childOfName(name) as graphic.Rect;\r\n el && el.setShape(pointsToRect(\r\n clipByPanel(controller, cover, [[x, y], [x + w, y + h]])\r\n ));\r\n}\r\n\r\nfunction makeStyle(brushOption: BrushCoverConfig) {\r\n return defaults({strokeNoScale: true}, brushOption.brushStyle);\r\n}\r\n\r\nfunction formatRectRange(x: number, y: number, x2: number, y2: number): BrushDimensionMinMax[] {\r\n const min = [mathMin(x, x2), mathMin(y, y2)];\r\n const max = [mathMax(x, x2), mathMax(y, y2)];\r\n\r\n return [\r\n [min[0], max[0]], // x range\r\n [min[1], max[1]] // y range\r\n ];\r\n}\r\n\r\nfunction getTransform(controller: BrushController): matrix.MatrixArray {\r\n return graphic.getTransform(controller.group);\r\n}\r\n\r\nfunction getGlobalDirection1(\r\n controller: BrushController, localDirName: DirectionName\r\n): keyof typeof CURSOR_MAP {\r\n const map = {w: 'left', e: 'right', n: 'top', s: 'bottom'} as const;\r\n const inverseMap = {left: 'w', right: 'e', top: 'n', bottom: 's'} as const;\r\n const dir = graphic.transformDirection(\r\n map[localDirName], getTransform(controller)\r\n );\r\n return inverseMap[dir];\r\n}\r\nfunction getGlobalDirection2(\r\n controller: BrushController, localDirNameSeq: DirectionNameSequence\r\n): keyof typeof CURSOR_MAP {\r\n const globalDir = [\r\n getGlobalDirection1(controller, localDirNameSeq[0]),\r\n getGlobalDirection1(controller, localDirNameSeq[1])\r\n ];\r\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\r\n return globalDir.join('') as keyof typeof CURSOR_MAP;\r\n}\r\n\r\nfunction driftRect(\r\n rectRangeConverter: RectRangeConverter,\r\n controller: BrushController,\r\n cover: BrushCover,\r\n dirNameSequence: DirectionNameSequence,\r\n dx: number,\r\n dy: number\r\n): void {\r\n const brushOption = cover.__brushOption;\r\n const rectRange = rectRangeConverter.toRectRange(brushOption.range);\r\n const localDelta = toLocalDelta(controller, dx, dy);\r\n\r\n each(dirNameSequence, function (dirName) {\r\n const ind = DIRECTION_MAP[dirName];\r\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\r\n });\r\n\r\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(\r\n rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]\r\n ));\r\n\r\n updateCoverAfterCreation(controller, cover);\r\n trigger(controller, {isEnd: false});\r\n}\r\n\r\nfunction driftPolygon(\r\n controller: BrushController,\r\n cover: BrushCover,\r\n dx: number,\r\n dy: number\r\n): void {\r\n const range = cover.__brushOption.range as BrushDimensionMinMax[];\r\n const localDelta = toLocalDelta(controller, dx, dy);\r\n\r\n each(range, function (point) {\r\n point[0] += localDelta[0];\r\n point[1] += localDelta[1];\r\n });\r\n\r\n updateCoverAfterCreation(controller, cover);\r\n trigger(controller, {isEnd: false});\r\n}\r\n\r\nfunction toLocalDelta(\r\n controller: BrushController, dx: number, dy: number\r\n): BrushDimensionMinMax {\r\n const thisGroup = controller.group;\r\n const localD = thisGroup.transformCoordToLocal(dx, dy);\r\n const localZero = thisGroup.transformCoordToLocal(0, 0);\r\n\r\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\r\n}\r\n\r\nfunction clipByPanel(controller: BrushController, cover: BrushCover, data: Point[]): Point[] {\r\n const panel = getPanelByCover(controller, cover);\r\n\r\n return (panel && panel !== BRUSH_PANEL_GLOBAL)\r\n ? panel.clipPath(data, controller._transform)\r\n : clone(data);\r\n}\r\n\r\nfunction pointsToRect(points: Point[]): graphic.Rect['shape'] {\r\n const xmin = mathMin(points[0][0], points[1][0]);\r\n const ymin = mathMin(points[0][1], points[1][1]);\r\n const xmax = mathMax(points[0][0], points[1][0]);\r\n const ymax = mathMax(points[0][1], points[1][1]);\r\n\r\n return {\r\n x: xmin,\r\n y: ymin,\r\n width: xmax - xmin,\r\n height: ymax - ymin\r\n };\r\n}\r\n\r\nfunction resetCursor(\r\n controller: BrushController, e: ElementEvent, localCursorPoint: Point\r\n): void {\r\n if (\r\n // Check active\r\n !controller._brushType\r\n // resetCursor should be always called when mouse is in zr area,\r\n // but not called when mouse is out of zr area to avoid bad influence\r\n // if `mousemove`, `mouseup` are triggered from `document` event.\r\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)\r\n ) {\r\n return;\r\n }\r\n\r\n const zr = controller._zr;\r\n const covers = controller._covers;\r\n const currPanel = getPanelByPoint(controller, e, localCursorPoint);\r\n\r\n // Check whether in covers.\r\n if (!controller._dragging) {\r\n for (let i = 0; i < covers.length; i++) {\r\n const brushOption = covers[i].__brushOption;\r\n if (currPanel\r\n && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId)\r\n && coverRenderers[brushOption.brushType].contain(\r\n covers[i], localCursorPoint[0], localCursorPoint[1]\r\n )\r\n ) {\r\n // Use cursor style set on cover.\r\n return;\r\n }\r\n }\r\n }\r\n\r\n currPanel && zr.setCursorStyle('crosshair');\r\n}\r\n\r\nfunction preventDefault(e: ElementEvent): void {\r\n const rawE = e.event;\r\n rawE.preventDefault && rawE.preventDefault();\r\n}\r\n\r\nfunction mainShapeContain(cover: BrushCover, x: number, y: number): boolean {\r\n return (cover.childOfName('main') as Displayable).contain(x, y);\r\n}\r\n\r\nfunction updateCoverByMouse(\r\n controller: BrushController,\r\n e: ElementEvent,\r\n localCursorPoint: Point,\r\n isEnd: boolean\r\n): {\r\n isEnd: boolean,\r\n removeOnClick?: boolean\r\n} {\r\n let creatingCover = controller._creatingCover;\r\n const panel = controller._creatingPanel;\r\n const thisBrushOption = controller._brushOption;\r\n let eventParams;\r\n\r\n controller._track.push(localCursorPoint.slice());\r\n\r\n if (shouldShowCover(controller) || creatingCover) {\r\n\r\n if (panel && !creatingCover) {\r\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\r\n const brushOption = clone(thisBrushOption) as BrushCoverConfig;\r\n brushOption.brushType = determineBrushType(brushOption.brushType, panel as BrushPanelConfig);\r\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\r\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\r\n controller._covers.push(creatingCover);\r\n }\r\n\r\n if (creatingCover) {\r\n const coverRenderer = coverRenderers[\r\n determineBrushType(controller._brushType, panel as BrushPanelConfig)\r\n ];\r\n const coverBrushOption = creatingCover.__brushOption;\r\n\r\n coverBrushOption.range = coverRenderer.getCreatingRange(\r\n clipByPanel(controller, creatingCover, controller._track)\r\n );\r\n\r\n if (isEnd) {\r\n endCreating(controller, creatingCover);\r\n coverRenderer.updateCommon(controller, creatingCover);\r\n }\r\n\r\n updateCoverShape(controller, creatingCover);\r\n\r\n eventParams = {isEnd: isEnd};\r\n }\r\n }\r\n else if (\r\n isEnd\r\n && thisBrushOption.brushMode === 'single'\r\n && thisBrushOption.removeOnClick\r\n ) {\r\n // Help user to remove covers easily, only by a tiny drag, in 'single' mode.\r\n // But a single click do not clear covers, because user may have casual\r\n // clicks (for example, click on other component and do not expect covers\r\n // disappear).\r\n // Only some cover removed, trigger action, but not every click trigger action.\r\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\r\n eventParams = {isEnd: isEnd, removeOnClick: true};\r\n }\r\n }\r\n\r\n return eventParams;\r\n}\r\n\r\nfunction determineBrushType(brushType: BrushTypeUncertain, panel: BrushPanelConfig): BrushType {\r\n if (brushType === 'auto') {\r\n if (__DEV__) {\r\n assert(\r\n panel && panel.defaultBrushType,\r\n 'MUST have defaultBrushType when brushType is \"atuo\"'\r\n );\r\n }\r\n return panel.defaultBrushType;\r\n }\r\n return brushType as BrushType;\r\n}\r\n\r\nconst pointerHandlers: Dictionary<(this: BrushController, e: ElementEvent) => void> = {\r\n\r\n mousedown: function (e) {\r\n if (this._dragging) {\r\n // In case some browser do not support globalOut,\r\n // and release mouse out side the browser.\r\n handleDragEnd(this, e);\r\n }\r\n else if (!e.target || !e.target.draggable) {\r\n\r\n preventDefault(e);\r\n\r\n const localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\r\n\r\n this._creatingCover = null;\r\n const panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\r\n\r\n if (panel) {\r\n this._dragging = true;\r\n this._track = [localCursorPoint.slice()];\r\n }\r\n }\r\n },\r\n\r\n mousemove: function (e) {\r\n const x = e.offsetX;\r\n const y = e.offsetY;\r\n\r\n const localCursorPoint = this.group.transformCoordToLocal(x, y);\r\n\r\n resetCursor(this, e, localCursorPoint);\r\n\r\n if (this._dragging) {\r\n preventDefault(e);\r\n const eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\r\n eventParams && trigger(this, eventParams);\r\n }\r\n },\r\n\r\n mouseup: function (e) {\r\n handleDragEnd(this, e);\r\n }\r\n};\r\n\r\n\r\nfunction handleDragEnd(controller: BrushController, e: ElementEvent) {\r\n if (controller._dragging) {\r\n preventDefault(e);\r\n\r\n const x = e.offsetX;\r\n const y = e.offsetY;\r\n\r\n const localCursorPoint = controller.group.transformCoordToLocal(x, y);\r\n const eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\r\n\r\n controller._dragging = false;\r\n controller._track = [];\r\n controller._creatingCover = null;\r\n\r\n // trigger event should be at final, after procedure will be nested.\r\n eventParams && trigger(controller, eventParams);\r\n }\r\n}\r\n\r\nfunction isOutsideZrArea(controller: BrushController, x: number, y: number): boolean {\r\n const zr = controller._zr;\r\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\r\n}\r\n\r\n\r\ninterface CoverRenderer {\r\n createCover(controller: BrushController, brushOption: BrushCoverConfig): BrushCover;\r\n getCreatingRange(localTrack: Point[]): BrushAreaRange;\r\n updateCoverShape(\r\n controller: BrushController, cover: BrushCover, localRange: BrushAreaRange, brushOption: BrushCoverConfig\r\n ): void;\r\n updateCommon(controller: BrushController, cover: BrushCover): void;\r\n contain(cover: BrushCover, x: number, y: number): boolean;\r\n endCreating?(controller: BrushController, creatingCover: BrushCover): void;\r\n}\r\n\r\n/**\r\n * key: brushType\r\n */\r\nconst coverRenderers: Record = {\r\n\r\n lineX: getLineRenderer(0),\r\n\r\n lineY: getLineRenderer(1),\r\n\r\n rect: {\r\n createCover: function (controller, brushOption) {\r\n function returnInput(range: BrushDimensionMinMax[]): BrushDimensionMinMax[] {\r\n return range;\r\n }\r\n return createBaseRectCover(\r\n {\r\n toRectRange: returnInput,\r\n fromRectRange: returnInput\r\n },\r\n controller,\r\n brushOption,\r\n [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]\r\n );\r\n },\r\n getCreatingRange: function (localTrack) {\r\n const ends = getTrackEnds(localTrack);\r\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\r\n },\r\n updateCoverShape: function (controller, cover, localRange: BrushDimensionMinMax[], brushOption) {\r\n updateBaseRect(controller, cover, localRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n },\r\n\r\n polygon: {\r\n createCover: function (controller, brushOption) {\r\n const cover = new graphic.Group();\r\n\r\n // Do not use graphic.Polygon because graphic.Polyline do not close the\r\n // border of the shape when drawing, which is a better experience for user.\r\n cover.add(new graphic.Polyline({\r\n name: 'main',\r\n style: makeStyle(brushOption),\r\n silent: true\r\n }));\r\n\r\n return cover as BrushCover;\r\n },\r\n getCreatingRange: function (localTrack) {\r\n return localTrack;\r\n },\r\n endCreating: function (controller, cover) {\r\n cover.remove(cover.childAt(0));\r\n // Use graphic.Polygon close the shape.\r\n cover.add(new graphic.Polygon({\r\n name: 'main',\r\n draggable: true,\r\n drift: curry(driftPolygon, controller, cover),\r\n ondragend: curry(trigger, controller, {isEnd: true})\r\n }));\r\n },\r\n updateCoverShape: function (controller, cover, localRange: BrushDimensionMinMax[], brushOption) {\r\n (cover.childAt(0) as graphic.Polygon).setShape({\r\n points: clipByPanel(controller, cover, localRange)\r\n });\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n }\r\n};\r\n\r\nfunction getLineRenderer(xyIndex: 0 | 1) {\r\n return {\r\n createCover: function (controller: BrushController, brushOption: BrushCoverConfig): BrushCover {\r\n return createBaseRectCover(\r\n {\r\n toRectRange: function (range: BrushDimensionMinMax): BrushDimensionMinMax[] {\r\n const rectRange = [range, [0, 100]];\r\n xyIndex && rectRange.reverse();\r\n return rectRange;\r\n },\r\n fromRectRange: function (rectRange: BrushDimensionMinMax[]): BrushDimensionMinMax {\r\n return rectRange[xyIndex];\r\n }\r\n },\r\n controller,\r\n brushOption,\r\n ([[['w'], ['e']], [['n'], ['s']]] as DirectionNameSequence[][])[xyIndex]\r\n );\r\n },\r\n getCreatingRange: function (localTrack: Point[]): BrushDimensionMinMax {\r\n const ends = getTrackEnds(localTrack);\r\n const min = mathMin(ends[0][xyIndex], ends[1][xyIndex]);\r\n const max = mathMax(ends[0][xyIndex], ends[1][xyIndex]);\r\n\r\n return [min, max];\r\n },\r\n updateCoverShape: function (\r\n controller: BrushController,\r\n cover: BrushCover,\r\n localRange: BrushDimensionMinMax,\r\n brushOption: BrushCoverConfig\r\n ): void {\r\n let otherExtent;\r\n // If brushWidth not specified, fit the panel.\r\n const panel = getPanelByCover(controller, cover);\r\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\r\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\r\n }\r\n else {\r\n const zr = controller._zr;\r\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\r\n }\r\n const rectRange = [localRange, otherExtent];\r\n xyIndex && rectRange.reverse();\r\n\r\n updateBaseRect(controller, cover, rectRange, brushOption);\r\n },\r\n updateCommon: updateCommon,\r\n contain: mainShapeContain\r\n };\r\n}\r\n\r\nexport default BrushController;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport BoundingRect, { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport {onIrrelevantElement} from './cursorHelper';\r\nimport * as graphicUtil from '../../util/graphic';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { ElementEvent } from 'zrender/src/Element';\r\nimport ComponentModel from '../../model/Component';\r\n\r\nexport function makeRectPanelClipPath(rect: RectLike) {\r\n rect = normalizeRect(rect);\r\n return function (localPoints: number[][]) {\r\n return graphicUtil.clipPointsByRect(localPoints, rect);\r\n };\r\n}\r\n\r\nexport function makeLinearBrushOtherExtent(rect: RectLike, specifiedXYIndex?: 0 | 1) {\r\n rect = normalizeRect(rect);\r\n return function (xyIndex: 0 | 1) {\r\n const idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\r\n const brushWidth = idx ? rect.width : rect.height;\r\n const base = idx ? rect.x : rect.y;\r\n return [base, base + (brushWidth || 0)];\r\n };\r\n}\r\n\r\nexport function makeRectIsTargetByCursor(rect: RectLike, api: ExtensionAPI, targetModel: ComponentModel) {\r\n const boundingRect = normalizeRect(rect);\r\n return function (e: ElementEvent, localCursorPoint: number[]) {\r\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1])\r\n && !onIrrelevantElement(e, api, targetModel);\r\n };\r\n}\r\n\r\n// Consider width/height is negative.\r\nfunction normalizeRect(rect: RectLike): BoundingRect {\r\n return BoundingRect.create(rect);\r\n}\r\n\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport AxisBuilder from './AxisBuilder';\r\nimport BrushController, {\r\n BrushCoverConfig, BrushControllerEvents, BrushDimensionMinMax\r\n} from '../helper/BrushController';\r\nimport * as brushHelper from '../helper/brushHelper';\r\nimport * as graphic from '../../util/graphic';\r\nimport ComponentView from '../../view/Component';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GlobalModel from '../../model/Global';\r\nimport ParallelAxisModel, { ParallelAreaSelectStyleProps } from '../../coord/parallel/AxisModel';\r\nimport { Payload } from '../../util/types';\r\nimport ParallelModel from '../../coord/parallel/ParallelModel';\r\nimport { ParallelAxisLayoutInfo } from '../../coord/parallel/Parallel';\r\n\r\n\r\nconst elementList = ['axisLine', 'axisTickLabel', 'axisName'];\r\n\r\nclass ParallelAxisView extends ComponentView {\r\n\r\n static type = 'parallelAxis';\r\n readonly type = ParallelAxisView.type;\r\n\r\n private _brushController: BrushController;\r\n private _axisGroup: graphic.Group;\r\n\r\n axisModel: ParallelAxisModel;\r\n api: ExtensionAPI;\r\n\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n super.init.apply(this, arguments as any);\r\n\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', zrUtil.bind(this._onBrush, this));\r\n }\r\n\r\n render(\r\n axisModel: ParallelAxisModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void {\r\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\r\n return;\r\n }\r\n\r\n this.axisModel = axisModel;\r\n this.api = api;\r\n\r\n this.group.removeAll();\r\n\r\n const oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new graphic.Group();\r\n this.group.add(this._axisGroup);\r\n\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n\r\n const coordSysModel = getCoordSysModel(axisModel, ecModel);\r\n const coordSys = coordSysModel.coordinateSystem;\r\n\r\n const areaSelectStyle = axisModel.getAreaSelectStyle();\r\n const areaWidth = areaSelectStyle.width;\r\n\r\n const dim = axisModel.axis.dim;\r\n const axisLayout = coordSys.getAxisLayout(dim);\r\n\r\n const builderOpt = zrUtil.extend(\r\n {strokeContainThreshold: areaWidth},\r\n axisLayout\r\n );\r\n\r\n const axisBuilder = new AxisBuilder(axisModel, builderOpt);\r\n\r\n zrUtil.each(elementList, axisBuilder.add, axisBuilder);\r\n\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n\r\n this._refreshBrushController(\r\n builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api\r\n );\r\n\r\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n }\r\n\r\n // /**\r\n // * @override\r\n // */\r\n // updateVisual(axisModel, ecModel, api, payload) {\r\n // this._brushController && this._brushController\r\n // .updateCovers(getCoverInfoList(axisModel));\r\n // }\r\n\r\n _refreshBrushController(\r\n builderOpt: Pick,\r\n areaSelectStyle: ParallelAreaSelectStyleProps,\r\n axisModel: ParallelAxisModel,\r\n coordSysModel: ParallelModel,\r\n areaWidth: ParallelAreaSelectStyleProps['width'],\r\n api: ExtensionAPI\r\n ): void {\r\n // After filtering, axis may change, select area needs to be update.\r\n const extent = axisModel.axis.getExtent();\r\n const extentLen = extent[1] - extent[0];\r\n const extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value.\r\n\r\n // width/height might be negative, which will be\r\n // normalized in BoundingRect.\r\n const rect = graphic.BoundingRect.create({\r\n x: extent[0],\r\n y: -areaWidth / 2,\r\n width: extentLen,\r\n height: areaWidth\r\n });\r\n rect.x -= extra;\r\n rect.width += 2 * extra;\r\n\r\n this._brushController\r\n .mount({\r\n enableGlobalPan: true,\r\n rotation: builderOpt.rotation,\r\n x: builderOpt.position[0],\r\n y: builderOpt.position[1]\r\n })\r\n .setPanels([{\r\n panelId: 'pl',\r\n clipPath: brushHelper.makeRectPanelClipPath(rect),\r\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, coordSysModel),\r\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect, 0)\r\n }])\r\n .enableBrush({\r\n brushType: 'lineX',\r\n brushStyle: areaSelectStyle,\r\n removeOnClick: true\r\n })\r\n .updateCovers(getCoverInfoList(axisModel));\r\n }\r\n\r\n _onBrush(eventParam: BrushControllerEvents['brush']): void {\r\n const coverInfoList = eventParam.areas;\r\n // Do not cache these object, because the mey be changed.\r\n const axisModel = this.axisModel;\r\n const axis = axisModel.axis;\r\n const intervals = zrUtil.map(coverInfoList, function (coverInfo) {\r\n return [\r\n axis.coordToData((coverInfo.range as BrushDimensionMinMax)[0], true),\r\n axis.coordToData((coverInfo.range as BrushDimensionMinMax)[1], true)\r\n ];\r\n });\r\n\r\n // If realtime is true, action is not dispatched on drag end, because\r\n // the drag end emits the same params with the last drag move event,\r\n // and may have some delay when using touch pad.\r\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) { // jshint ignore:line\r\n this.api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n parallelAxisId: axisModel.id,\r\n intervals: intervals\r\n });\r\n }\r\n }\r\n\r\n dispose(): void {\r\n this._brushController.dispose();\r\n }\r\n}\r\n\r\nfunction fromAxisAreaSelect(\r\n axisModel: ParallelAxisModel, ecModel: GlobalModel, payload: Payload\r\n): boolean {\r\n return payload\r\n && payload.type === 'axisAreaSelect'\r\n && ecModel.findComponents(\r\n {mainType: 'parallelAxis', query: payload}\r\n )[0] === axisModel;\r\n}\r\n\r\nfunction getCoverInfoList(axisModel: ParallelAxisModel): BrushCoverConfig[] {\r\n const axis = axisModel.axis;\r\n return zrUtil.map(axisModel.activeIntervals, function (interval) {\r\n return {\r\n brushType: 'lineX',\r\n panelId: 'pl',\r\n range: [\r\n axis.dataToCoord(interval[0], true),\r\n axis.dataToCoord(interval[1], true)\r\n ]\r\n };\r\n });\r\n}\r\n\r\nfunction getCoordSysModel(axisModel: ParallelAxisModel, ecModel: GlobalModel): ParallelModel {\r\n return ecModel.getComponent(\r\n 'parallel', axisModel.get('parallelIndex')\r\n ) as ParallelModel;\r\n}\r\n\r\nexport default ParallelAxisView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport { Payload } from '../../util/types';\r\nimport ParallelAxisModel, { ParallelAxisInterval } from '../../coord/parallel/AxisModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ParallelModel from '../../coord/parallel/ParallelModel';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\ninterface ParallelAxisAreaSelectPayload extends Payload {\r\n parallelAxisId: string;\r\n intervals: ParallelAxisInterval[]\r\n}\r\n\r\nconst actionInfo = {\r\n type: 'axisAreaSelect',\r\n event: 'axisAreaSelected'\r\n // update: 'updateVisual'\r\n};\r\n\r\nexport interface ParallelAxisExpandPayload extends Payload {\r\n axisExpandWindow?: number[];\r\n}\r\n\r\nexport function installParallelActions(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerAction(actionInfo, function (payload: ParallelAxisAreaSelectPayload, ecModel: GlobalModel) {\r\n ecModel.eachComponent(\r\n {mainType: 'parallelAxis', query: payload},\r\n function (parallelAxisModel: ParallelAxisModel) {\r\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\r\n }\r\n );\r\n });\r\n\r\n /**\r\n * @payload\r\n */\r\n registers.registerAction('parallelAxisExpand', function (payload: ParallelAxisExpandPayload, ecModel) {\r\n ecModel.eachComponent(\r\n {mainType: 'parallel', query: payload},\r\n function (parallelModel: ParallelModel) {\r\n parallelModel.setAxisExpand(payload);\r\n }\r\n );\r\n });\r\n\r\n\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport parallelPreprocessor from '../../coord/parallel/parallelPreprocessor';\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport ParallelView from './ParallelView';\r\nimport ParallelModel from '../../coord/parallel/ParallelModel';\r\nimport parallelCoordSysCreator from '../../coord/parallel/parallelCreator';\r\nimport axisModelCreator from '../../coord/axisModelCreator';\r\nimport ParallelAxisModel, {ParallelAxisOption} from '../../coord/parallel/AxisModel';\r\nimport ParallelAxisView from '../axis/ParallelAxisView';\r\nimport { installParallelActions } from '../axis/parallelAxisAction';\r\n\r\nconst defaultAxisOption: ParallelAxisOption = {\r\n type: 'value',\r\n areaSelectStyle: {\r\n width: 20,\r\n borderWidth: 1,\r\n borderColor: 'rgba(160,197,232)',\r\n color: 'rgba(160,197,232)',\r\n opacity: 0.3\r\n },\r\n realtime: true,\r\n z: 10\r\n};\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentView(ParallelView);\r\n registers.registerComponentModel(ParallelModel);\r\n\r\n registers.registerCoordinateSystem('parallel', parallelCoordSysCreator);\r\n registers.registerPreprocessor(parallelPreprocessor);\r\n\r\n registers.registerComponentModel(ParallelAxisModel);\r\n registers.registerComponentView(ParallelAxisView);\r\n\r\n axisModelCreator(\r\n registers, 'parallel', ParallelAxisModel, defaultAxisOption\r\n );\r\n\r\n installParallelActions(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport ParallelView from './ParallelView';\r\nimport ParallelSeriesModel from './ParallelSeries';\r\nimport parallelVisual from './parallelVisual';\r\nimport {install as installParallelComponent} from '../../component/parallel/install';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n use(installParallelComponent);\r\n\r\n registers.registerChartView(ParallelView);\r\n registers.registerSeriesModel(ParallelSeriesModel);\r\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states';\r\nimport { LayoutOrient, ECElement } from '../../util/types';\r\nimport type { PathProps, PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport SankeySeriesModel, { SankeyEdgeItemOption, SankeyNodeItemOption } from './SankeySeries';\r\nimport ChartView from '../../view/Chart';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { isString, retrieve3 } from 'zrender/src/core/util';\r\nimport type { GraphEdge } from '../../data/Graph';\r\n\r\nclass SankeyPathShape {\r\n x1 = 0;\r\n y1 = 0;\r\n\r\n x2 = 0;\r\n y2 = 0;\r\n\r\n cpx1 = 0;\r\n cpy1 = 0;\r\n\r\n cpx2 = 0;\r\n cpy2 = 0;\r\n\r\n extent = 0;\r\n orient: LayoutOrient;\r\n}\r\n\r\ninterface SankeyPathProps extends PathProps {\r\n shape?: Partial\r\n}\r\n\r\nclass SankeyPath extends graphic.Path {\r\n shape: SankeyPathShape;\r\n\r\n constructor(opts?: SankeyPathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new SankeyPathShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: SankeyPathShape) {\r\n const extent = shape.extent;\r\n ctx.moveTo(shape.x1, shape.y1);\r\n ctx.bezierCurveTo(\r\n shape.cpx1, shape.cpy1,\r\n shape.cpx2, shape.cpy2,\r\n shape.x2, shape.y2\r\n );\r\n if (shape.orient === 'vertical') {\r\n ctx.lineTo(shape.x2 + extent, shape.y2);\r\n ctx.bezierCurveTo(\r\n shape.cpx2 + extent, shape.cpy2,\r\n shape.cpx1 + extent, shape.cpy1,\r\n shape.x1 + extent, shape.y1\r\n );\r\n }\r\n else {\r\n ctx.lineTo(shape.x2, shape.y2 + extent);\r\n ctx.bezierCurveTo(\r\n shape.cpx2, shape.cpy2 + extent,\r\n shape.cpx1, shape.cpy1 + extent,\r\n shape.x1, shape.y1 + extent\r\n );\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n highlight() {\r\n enterEmphasis(this);\r\n }\r\n\r\n downplay() {\r\n leaveEmphasis(this);\r\n }\r\n}\r\n\r\nclass SankeyView extends ChartView {\r\n\r\n static readonly type = 'sankey';\r\n readonly type = SankeyView.type;\r\n\r\n private _model: SankeySeriesModel;\r\n\r\n private _focusAdjacencyDisabled = false;\r\n\r\n private _data: SeriesData;\r\n\r\n render(seriesModel: SankeySeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const sankeyView = this;\r\n const graph = seriesModel.getGraph();\r\n const group = this.group;\r\n const layoutInfo = seriesModel.layoutInfo;\r\n // view width\r\n const width = layoutInfo.width;\r\n // view height\r\n const height = layoutInfo.height;\r\n const nodeData = seriesModel.getData();\r\n const edgeData = seriesModel.getData('edge');\r\n const orient = seriesModel.get('orient');\r\n\r\n this._model = seriesModel;\r\n\r\n group.removeAll();\r\n\r\n group.x = layoutInfo.x;\r\n group.y = layoutInfo.y;\r\n\r\n // generate a bezire Curve for each edge\r\n graph.eachEdge(function (edge) {\r\n const curve = new SankeyPath();\r\n const ecData = getECData(curve);\r\n ecData.dataIndex = edge.dataIndex;\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n ecData.dataType = 'edge';\r\n const edgeModel = edge.getModel();\r\n const lineStyleModel = edgeModel.getModel('lineStyle');\r\n const curvature = lineStyleModel.get('curveness');\r\n const n1Layout = edge.node1.getLayout();\r\n const node1Model = edge.node1.getModel();\r\n const dragX1 = node1Model.get('localX');\r\n const dragY1 = node1Model.get('localY');\r\n const n2Layout = edge.node2.getLayout();\r\n const node2Model = edge.node2.getModel();\r\n const dragX2 = node2Model.get('localX');\r\n const dragY2 = node2Model.get('localY');\r\n const edgeLayout = edge.getLayout();\r\n let x1: number;\r\n let y1: number;\r\n let x2: number;\r\n let y2: number;\r\n let cpx1: number;\r\n let cpy1: number;\r\n let cpx2: number;\r\n let cpy2: number;\r\n\r\n curve.shape.extent = Math.max(1, edgeLayout.dy);\r\n curve.shape.orient = orient;\r\n\r\n if (orient === 'vertical') {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\r\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\r\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\r\n cpx1 = x1;\r\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\r\n cpx2 = x2;\r\n cpy2 = y1 * curvature + y2 * (1 - curvature);\r\n }\r\n else {\r\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\r\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\r\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\r\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\r\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\r\n cpy1 = y1;\r\n cpx2 = x1 * curvature + x2 * (1 - curvature);\r\n cpy2 = y2;\r\n }\r\n\r\n curve.setShape({\r\n x1: x1,\r\n y1: y1,\r\n x2: x2,\r\n y2: y2,\r\n cpx1: cpx1,\r\n cpy1: cpy1,\r\n cpx2: cpx2,\r\n cpy2: cpy2\r\n });\r\n\r\n curve.useStyle(lineStyleModel.getItemStyle());\r\n // Special color, use source node color or target node color\r\n applyCurveStyle(curve.style, orient, edge);\r\n\r\n\r\n const defaultEdgeLabelText = `${edgeModel.get('value')}`;\r\n const edgeLabelStateModels = getLabelStatesModels(edgeModel, 'edgeLabel');\r\n\r\n setLabelStyle(\r\n curve, edgeLabelStateModels,\r\n {\r\n labelFetcher: {\r\n getFormattedLabel(dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) {\r\n return seriesModel.getFormattedLabel(\r\n dataIndex, stateName, 'edge',\r\n labelDimIndex,\r\n // ensure edgeLabel formatter is provided\r\n // to prevent the inheritance from `label.formatter` of the series\r\n retrieve3(\r\n formatter,\r\n edgeLabelStateModels.normal && edgeLabelStateModels.normal.get('formatter'),\r\n defaultEdgeLabelText\r\n ),\r\n extendParams\r\n );\r\n }\r\n },\r\n labelDataIndex: edge.dataIndex,\r\n defaultText: defaultEdgeLabelText\r\n }\r\n );\r\n curve.setTextConfig({ position: 'inside' });\r\n\r\n const emphasisModel = edgeModel.getModel('emphasis');\r\n\r\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', (model) => {\r\n const style = model.getItemStyle();\r\n\r\n applyCurveStyle(style, orient, edge);\r\n\r\n return style;\r\n });\r\n\r\n group.add(curve);\r\n\r\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\r\n\r\n const focus = emphasisModel.get('focus');\r\n toggleHoverEmphasis(\r\n curve,\r\n focus === 'adjacency' ? edge.getAdjacentDataIndices()\r\n : focus === 'trajectory' ? edge.getTrajectoryDataIndices()\r\n : focus,\r\n emphasisModel.get('blurScope'),\r\n emphasisModel.get('disabled')\r\n );\r\n });\r\n\r\n // Generate a rect for each node\r\n graph.eachNode(function (node) {\r\n const layout = node.getLayout();\r\n const itemModel = node.getModel();\r\n const dragX = itemModel.get('localX');\r\n const dragY = itemModel.get('localY');\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n const borderRadius = itemModel.get(['itemStyle', 'borderRadius']) as number | number[] || 0;\r\n\r\n const rect = new graphic.Rect({\r\n shape: {\r\n x: dragX != null ? dragX * width : layout.x,\r\n y: dragY != null ? dragY * height : layout.y,\r\n width: layout.dx,\r\n height: layout.dy,\r\n r: borderRadius\r\n },\r\n style: itemModel.getModel('itemStyle').getItemStyle(),\r\n z2: 10\r\n });\r\n\r\n setLabelStyle(\r\n rect, getLabelStatesModels(itemModel),\r\n {\r\n labelFetcher: {\r\n getFormattedLabel(dataIndex, stateName) {\r\n return seriesModel.getFormattedLabel(dataIndex, stateName, 'node');\r\n }\r\n },\r\n labelDataIndex: node.dataIndex,\r\n defaultText: node.id\r\n }\r\n );\r\n\r\n (rect as ECElement).disableLabelAnimation = true;\r\n\r\n rect.setStyle('fill', node.getVisual('color'));\r\n rect.setStyle('decal', node.getVisual('style').decal);\r\n\r\n setStatesStylesFromModel(rect, itemModel);\r\n\r\n group.add(rect);\r\n\r\n nodeData.setItemGraphicEl(node.dataIndex, rect);\r\n\r\n getECData(rect).dataType = 'node';\r\n\r\n const focus = emphasisModel.get('focus');\r\n toggleHoverEmphasis(\r\n rect,\r\n focus === 'adjacency'\r\n ? node.getAdjacentDataIndices()\r\n : focus === 'trajectory'\r\n ? node.getTrajectoryDataIndices()\r\n : focus,\r\n emphasisModel.get('blurScope'),\r\n emphasisModel.get('disabled')\r\n );\r\n });\r\n\r\n nodeData.eachItemGraphicEl(function (el: graphic.Rect, dataIndex: number) {\r\n const itemModel = nodeData.getItemModel(dataIndex);\r\n if (itemModel.get('draggable')) {\r\n el.drift = function (this: typeof el, dx, dy) {\r\n sankeyView._focusAdjacencyDisabled = true;\r\n this.shape.x += dx;\r\n this.shape.y += dy;\r\n this.dirty();\r\n api.dispatchAction({\r\n type: 'dragNode',\r\n seriesId: seriesModel.id,\r\n dataIndex: nodeData.getRawIndex(dataIndex),\r\n localX: this.shape.x / width,\r\n localY: this.shape.y / height\r\n });\r\n };\r\n el.ondragend = function () {\r\n sankeyView._focusAdjacencyDisabled = false;\r\n };\r\n el.draggable = true;\r\n el.cursor = 'move';\r\n }\r\n });\r\n\r\n if (!this._data && seriesModel.isAnimationEnabled()) {\r\n group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {\r\n group.removeClipPath();\r\n }));\r\n }\r\n\r\n this._data = seriesModel.getData();\r\n }\r\n\r\n dispose() {\r\n }\r\n}\r\n\r\n/**\r\n * Special color, use source node color or target node color\r\n * @param curveProps curve's style to parse\r\n * @param orient direction\r\n * @param edge current curve data\r\n */\r\nfunction applyCurveStyle(curveProps: PathStyleProps, orient: 'horizontal' | 'vertical', edge: GraphEdge) {\r\n switch (curveProps.fill) {\r\n case 'source':\r\n curveProps.fill = edge.node1.getVisual('color');\r\n curveProps.decal = edge.node1.getVisual('style').decal;\r\n break;\r\n case 'target':\r\n curveProps.fill = edge.node2.getVisual('color');\r\n curveProps.decal = edge.node2.getVisual('style').decal;\r\n break;\r\n case 'gradient':\r\n const sourceColor = edge.node1.getVisual('color');\r\n const targetColor = edge.node2.getVisual('color');\r\n if (isString(sourceColor) && isString(targetColor)) {\r\n curveProps.fill = new graphic.LinearGradient(\r\n 0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{\r\n color: sourceColor,\r\n offset: 0\r\n }, {\r\n color: targetColor,\r\n offset: 1\r\n }]\r\n );\r\n }\r\n }\r\n}\r\n\r\n// Add animation to the view\r\nfunction createGridClipShape(rect: RectLike, seriesModel: SankeySeriesModel, cb: () => void) {\r\n const rectEl = new graphic.Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20,\r\n }\r\n });\r\n graphic.initProps(rectEl, {\r\n shape: {\r\n width: rect.width + 20\r\n }\r\n }, seriesModel, cb);\r\n\r\n return rectEl;\r\n}\r\n\r\nexport default SankeyView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge';\r\nimport Model from '../../model/Model';\r\nimport {\r\n SeriesOption,\r\n BoxLayoutOptionMixin,\r\n OptionDataValue,\r\n SeriesLabelOption,\r\n ItemStyleOption,\r\n LineStyleOption,\r\n LayoutOrient,\r\n ColorString,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n GraphEdgeItemObject,\r\n OptionDataValueNumeric,\r\n DefaultEmphasisFocus,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { LayoutRect } from '../../util/layout';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\r\n\r\n\r\ntype FocusNodeAdjacency = boolean | 'inEdges' | 'outEdges' | 'allEdges';\r\n\r\nexport interface SankeyNodeStateOption {\r\n label?: SeriesLabelOption\r\n itemStyle?: ItemStyleOption\r\n}\r\n\r\nexport interface SankeyEdgeStateOption {\r\n lineStyle?: SankeyEdgeStyleOption\r\n}\r\n\r\ninterface SankeyBothStateOption extends SankeyNodeStateOption, SankeyEdgeStateOption {}\r\n\r\ninterface SankeyEdgeStyleOption extends LineStyleOption {\r\n curveness?: number\r\n}\r\n\r\ninterface ExtraStateOption {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus | 'adjacency' | 'trajectory'\r\n }\r\n}\r\n\r\nexport interface SankeyNodeItemOption extends SankeyNodeStateOption,\r\n StatesOptionMixin,\r\n OptionDataItemObject {\r\n id?: string\r\n\r\n localX?: number\r\n localY?: number\r\n\r\n depth?: number\r\n\r\n draggable?: boolean\r\n\r\n focusNodeAdjacency?: FocusNodeAdjacency\r\n}\r\n\r\nexport interface SankeyEdgeItemOption extends\r\n SankeyEdgeStateOption,\r\n StatesOptionMixin,\r\n GraphEdgeItemObject {\r\n focusNodeAdjacency?: FocusNodeAdjacency\r\n edgeLabel?: SeriesLabelOption\r\n}\r\n\r\nexport interface SankeyLevelOption extends SankeyNodeStateOption, SankeyEdgeStateOption {\r\n depth: number\r\n}\r\n\r\nexport interface SankeySeriesOption\r\n extends SeriesOption, ExtraStateOption>,\r\n SankeyBothStateOption,\r\n BoxLayoutOptionMixin {\r\n type?: 'sankey'\r\n\r\n /**\r\n * color will be linear mapped.\r\n */\r\n color?: ColorString[]\r\n\r\n coordinateSystem?: 'view'\r\n\r\n orient?: LayoutOrient\r\n /**\r\n * The width of the node\r\n */\r\n nodeWidth?: number\r\n /**\r\n * The vertical distance between two nodes\r\n */\r\n nodeGap?: number\r\n\r\n /**\r\n * Control if the node can move or not\r\n */\r\n draggable?: boolean\r\n /**\r\n * Will be allEdges if true.\r\n * @deprecated\r\n */\r\n focusNodeAdjacency?: FocusNodeAdjacency\r\n /**\r\n * The number of iterations to change the position of the node\r\n */\r\n layoutIterations?: number\r\n\r\n nodeAlign?: 'justify' | 'left' | 'right' // TODO justify should be auto\r\n\r\n data?: SankeyNodeItemOption[]\r\n nodes?: SankeyNodeItemOption[]\r\n\r\n edges?: SankeyEdgeItemOption[]\r\n links?: SankeyEdgeItemOption[]\r\n\r\n levels?: SankeyLevelOption[]\r\n\r\n edgeLabel?: SeriesLabelOption & {\r\n position?: 'inside'\r\n }\r\n}\r\n\r\nclass SankeySeriesModel extends SeriesModel {\r\n static readonly type = 'series.sankey';\r\n readonly type = SankeySeriesModel.type;\r\n\r\n levelModels: Model[];\r\n\r\n layoutInfo: LayoutRect;\r\n\r\n /**\r\n * Init a graph data structure from data in option series\r\n */\r\n getInitialData(option: SankeySeriesOption, ecModel: GlobalModel) {\r\n const links = option.edges || option.links || [];\r\n const nodes = option.data || option.nodes || [];\r\n const levels = option.levels || [];\r\n this.levelModels = [];\r\n const levelModels = this.levelModels;\r\n\r\n for (let i = 0; i < levels.length; i++) {\r\n if (levels[i].depth != null && levels[i].depth >= 0) {\r\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\r\n }\r\n else {\r\n if (__DEV__) {\r\n throw new Error('levels[i].depth is mandatory and should be natural number');\r\n }\r\n }\r\n }\r\n\r\n const graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\r\n return graph.data;\r\n\r\n function beforeLink(nodeData: SeriesData, edgeData: SeriesData) {\r\n nodeData.wrapMethod('getItemModel', function (model: Model, idx: number) {\r\n const seriesModel = model.parentModel as SankeySeriesModel;\r\n const layout = seriesModel.getData().getItemLayout(idx);\r\n if (layout) {\r\n const nodeDepth = layout.depth;\r\n const levelModel = seriesModel.levelModels[nodeDepth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n\r\n edgeData.wrapMethod('getItemModel', function (model: Model, idx: number) {\r\n const seriesModel = model.parentModel as SankeySeriesModel;\r\n const edge = seriesModel.getGraph().getEdgeByIndex(idx);\r\n const layout = edge.node1.getLayout();\r\n if (layout) {\r\n const depth = layout.depth;\r\n const levelModel = seriesModel.levelModels[depth];\r\n if (levelModel) {\r\n model.parentModel = levelModel;\r\n }\r\n }\r\n return model;\r\n });\r\n }\r\n }\r\n\r\n setNodePosition(dataIndex: number, localPosition: number[]) {\r\n const nodes = this.option.data || this.option.nodes;\r\n const dataItem = nodes[dataIndex];\r\n dataItem.localX = localPosition[0];\r\n dataItem.localY = localPosition[1];\r\n }\r\n\r\n /**\r\n * Return the graphic data structure\r\n *\r\n * @return graphic data structure\r\n */\r\n getGraph() {\r\n return this.getData().graph;\r\n }\r\n\r\n /**\r\n * Get edge data of graphic data structure\r\n *\r\n * @return data structure of list\r\n */\r\n getEdgeData() {\r\n return this.getGraph().edgeData;\r\n }\r\n\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: 'node' | 'edge'\r\n ) {\r\n function noValue(val: unknown): boolean {\r\n return isNaN(val as number) || val == null;\r\n }\r\n // dataType === 'node' or empty do not show tooltip by default\r\n if (dataType === 'edge') {\r\n const params = this.getDataParams(dataIndex, dataType);\r\n const rawDataOpt = params.data as SankeyEdgeItemOption;\r\n const edgeValue = params.value;\r\n const edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\r\n return createTooltipMarkup('nameValue', {\r\n name: edgeName,\r\n value: edgeValue,\r\n noValue: noValue(edgeValue)\r\n });\r\n }\r\n // dataType === 'node'\r\n else {\r\n const node = this.getGraph().getNodeByIndex(dataIndex);\r\n const value = node.getLayout().value;\r\n const name = (this.getDataParams(dataIndex, dataType).data as SankeyNodeItemOption).name;\r\n return createTooltipMarkup('nameValue', {\r\n name: name != null ? name + '' : null,\r\n value: value,\r\n noValue: noValue(value)\r\n });\r\n }\r\n }\r\n\r\n optionUpdated() {}\r\n\r\n // Override Series.getDataParams()\r\n getDataParams(dataIndex: number, dataType: 'node' | 'edge') {\r\n const params = super.getDataParams(dataIndex, dataType);\r\n if (params.value == null && dataType === 'node') {\r\n const node = this.getGraph().getNodeByIndex(dataIndex);\r\n const nodeValue = node.getLayout().value;\r\n params.value = nodeValue;\r\n }\r\n return params;\r\n }\r\n\r\n static defaultOption: SankeySeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n\r\n coordinateSystem: 'view',\r\n\r\n left: '5%',\r\n top: '5%',\r\n right: '20%',\r\n bottom: '5%',\r\n\r\n orient: 'horizontal',\r\n\r\n nodeWidth: 20,\r\n\r\n nodeGap: 8,\r\n draggable: true,\r\n\r\n layoutIterations: 32,\r\n\r\n label: {\r\n show: true,\r\n position: 'right',\r\n fontSize: 12\r\n },\r\n\r\n edgeLabel: {\r\n show: false,\r\n fontSize: 12\r\n },\r\n\r\n levels: [],\r\n\r\n nodeAlign: 'justify',\r\n\r\n lineStyle: {\r\n color: '#314656',\r\n opacity: 0.2,\r\n curveness: 0.5\r\n },\r\n\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n },\r\n\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n },\r\n\r\n animationEasing: 'linear',\r\n\r\n animationDuration: 1000\r\n };\r\n}\r\n\r\nexport default SankeySeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as layout from '../../util/layout';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {groupData} from '../../util/model';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SankeySeriesModel, { SankeySeriesOption, SankeyNodeItemOption } from './SankeySeries';\r\nimport { GraphNode, GraphEdge } from '../../data/Graph';\r\nimport { LayoutOrient } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\n\r\nexport default function sankeyLayout(ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n ecModel.eachSeriesByType('sankey', function (seriesModel: SankeySeriesModel) {\r\n\r\n const nodeWidth = seriesModel.get('nodeWidth');\r\n const nodeGap = seriesModel.get('nodeGap');\r\n\r\n const layoutInfo = getViewRect(seriesModel, api);\r\n\r\n seriesModel.layoutInfo = layoutInfo;\r\n\r\n const width = layoutInfo.width;\r\n const height = layoutInfo.height;\r\n\r\n const graph = seriesModel.getGraph();\r\n\r\n const nodes = graph.nodes;\r\n const edges = graph.edges;\r\n\r\n computeNodeValues(nodes);\r\n\r\n const filteredNodes = zrUtil.filter(nodes, function (node) {\r\n return node.getLayout().value === 0;\r\n });\r\n\r\n const iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\r\n\r\n const orient = seriesModel.get('orient');\r\n\r\n const nodeAlign = seriesModel.get('nodeAlign');\r\n\r\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\r\n });\r\n}\r\n\r\n/**\r\n * Get the layout position of the whole view\r\n */\r\nfunction getViewRect(seriesModel: SankeySeriesModel, api: ExtensionAPI) {\r\n return layout.getLayoutRect(\r\n seriesModel.getBoxLayoutParams(), {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }\r\n );\r\n}\r\n\r\nfunction layoutSankey(\r\n nodes: GraphNode[],\r\n edges: GraphEdge[],\r\n nodeWidth: number,\r\n nodeGap: number,\r\n width: number,\r\n height: number,\r\n iterations: number,\r\n orient: LayoutOrient,\r\n nodeAlign: SankeySeriesOption['nodeAlign']\r\n) {\r\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\r\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\r\n computeEdgeDepths(nodes, orient);\r\n}\r\n\r\n/**\r\n * Compute the value of each node by summing the associated edge's value\r\n */\r\nfunction computeNodeValues(nodes: GraphNode[]) {\r\n zrUtil.each(nodes, function (node) {\r\n const value1 = sum(node.outEdges, getEdgeValue);\r\n const value2 = sum(node.inEdges, getEdgeValue);\r\n const nodeRawValue = node.getValue() as number || 0;\r\n const value = Math.max(value1, value2, nodeRawValue);\r\n node.setLayout({value: value}, true);\r\n });\r\n}\r\n\r\n/**\r\n * Compute the x-position for each node.\r\n *\r\n * Here we use Kahn algorithm to detect cycle when we traverse\r\n * the node to computer the initial x position.\r\n */\r\nfunction computeNodeBreadths(\r\n nodes: GraphNode[],\r\n edges: GraphEdge[],\r\n nodeWidth: number,\r\n width: number,\r\n height: number,\r\n orient: LayoutOrient,\r\n nodeAlign: SankeySeriesOption['nodeAlign']\r\n) {\r\n // Used to mark whether the edge is deleted. if it is deleted,\r\n // the value is 0, otherwise it is 1.\r\n const remainEdges = [];\r\n // Storage each node's indegree.\r\n const indegreeArr = [];\r\n // Used to storage the node with indegree is equal to 0.\r\n let zeroIndegrees: GraphNode[] = [];\r\n let nextTargetNode: GraphNode[] = [];\r\n let x = 0;\r\n // let kx = 0;\r\n\r\n for (let i = 0; i < edges.length; i++) {\r\n remainEdges[i] = 1;\r\n }\r\n for (let i = 0; i < nodes.length; i++) {\r\n indegreeArr[i] = nodes[i].inEdges.length;\r\n if (indegreeArr[i] === 0) {\r\n zeroIndegrees.push(nodes[i]);\r\n }\r\n }\r\n let maxNodeDepth = -1;\r\n // Traversing nodes using topological sorting to calculate the\r\n // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\r\n // position of the nodes.\r\n while (zeroIndegrees.length) {\r\n for (let idx = 0; idx < zeroIndegrees.length; idx++) {\r\n const node = zeroIndegrees[idx];\r\n const item = node.hostGraph.data.getRawDataItem(node.dataIndex) as SankeyNodeItemOption;\r\n const isItemDepth = item.depth != null && item.depth >= 0;\r\n if (isItemDepth && item.depth > maxNodeDepth) {\r\n maxNodeDepth = item.depth;\r\n }\r\n node.setLayout({depth: isItemDepth ? item.depth : x}, true);\r\n orient === 'vertical'\r\n ? node.setLayout({dy: nodeWidth}, true)\r\n : node.setLayout({dx: nodeWidth}, true);\r\n\r\n for (let edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\r\n const edge = node.outEdges[edgeIdx];\r\n const indexEdge = edges.indexOf(edge);\r\n remainEdges[indexEdge] = 0;\r\n const targetNode = edge.node2;\r\n const nodeIndex = nodes.indexOf(targetNode);\r\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\r\n nextTargetNode.push(targetNode);\r\n }\r\n }\r\n }\r\n ++x;\r\n zeroIndegrees = nextTargetNode;\r\n nextTargetNode = [];\r\n }\r\n\r\n for (let i = 0; i < remainEdges.length; i++) {\r\n if (remainEdges[i] === 1) {\r\n throw new Error('Sankey is a DAG, the original data has cycle!');\r\n }\r\n }\r\n\r\n const maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\r\n if (nodeAlign && nodeAlign !== 'left') {\r\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\r\n }\r\n const kx = orient === 'vertical'\r\n ? (height - nodeWidth) / maxDepth\r\n : (width - nodeWidth) / maxDepth;\r\n\r\n scaleNodeBreadths(nodes, kx, orient);\r\n}\r\n\r\nfunction isNodeDepth(node: GraphNode) {\r\n const item = node.hostGraph.data.getRawDataItem(node.dataIndex) as SankeyNodeItemOption;\r\n return item.depth != null && item.depth >= 0;\r\n}\r\n\r\nfunction adjustNodeWithNodeAlign(\r\n nodes: GraphNode[],\r\n nodeAlign: SankeySeriesOption['nodeAlign'],\r\n orient: LayoutOrient,\r\n maxDepth: number\r\n) {\r\n if (nodeAlign === 'right') {\r\n let nextSourceNode: GraphNode[] = [];\r\n let remainNodes = nodes;\r\n let nodeHeight = 0;\r\n while (remainNodes.length) {\r\n for (let i = 0; i < remainNodes.length; i++) {\r\n const node = remainNodes[i];\r\n node.setLayout({skNodeHeight: nodeHeight}, true);\r\n for (let j = 0; j < node.inEdges.length; j++) {\r\n const edge = node.inEdges[j];\r\n if (nextSourceNode.indexOf(edge.node1) < 0) {\r\n nextSourceNode.push(edge.node1);\r\n }\r\n }\r\n }\r\n remainNodes = nextSourceNode;\r\n nextSourceNode = [];\r\n ++nodeHeight;\r\n }\r\n\r\n zrUtil.each(nodes, function (node) {\r\n if (!isNodeDepth(node)) {\r\n node.setLayout({depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)}, true);\r\n }\r\n });\r\n }\r\n else if (nodeAlign === 'justify') {\r\n moveSinksRight(nodes, maxDepth);\r\n }\r\n}\r\n\r\n/**\r\n * All the node without outEgdes are assigned maximum x-position and\r\n * be aligned in the last column.\r\n *\r\n * @param nodes. node of sankey view.\r\n * @param maxDepth. use to assign to node without outEdges as x-position.\r\n */\r\nfunction moveSinksRight(nodes: GraphNode[], maxDepth: number) {\r\n zrUtil.each(nodes, function (node) {\r\n if (!isNodeDepth(node) && !node.outEdges.length) {\r\n node.setLayout({depth: maxDepth}, true);\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Scale node x-position to the width\r\n *\r\n * @param nodes node of sankey view\r\n * @param kx multiple used to scale nodes\r\n */\r\nfunction scaleNodeBreadths(nodes: GraphNode[], kx: number, orient: LayoutOrient) {\r\n zrUtil.each(nodes, function (node) {\r\n const nodeDepth = node.getLayout().depth * kx;\r\n orient === 'vertical'\r\n ? node.setLayout({y: nodeDepth}, true)\r\n : node.setLayout({x: nodeDepth}, true);\r\n });\r\n}\r\n\r\n/**\r\n * Using Gauss-Seidel iterations method to compute the node depth(y-position)\r\n *\r\n * @param nodes node of sankey view\r\n * @param edges edge of sankey view\r\n * @param height the whole height of the area to draw the view\r\n * @param nodeGap the vertical distance between two nodes\r\n * in the same column.\r\n * @param iterations the number of iterations for the algorithm\r\n */\r\nfunction computeNodeDepths(\r\n nodes: GraphNode[],\r\n edges: GraphEdge[],\r\n height: number,\r\n width: number,\r\n nodeGap: number,\r\n iterations: number,\r\n orient: LayoutOrient\r\n) {\r\n const nodesByBreadth = prepareNodesByBreadth(nodes, orient);\r\n\r\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n\r\n for (let alpha = 1; iterations > 0; iterations--) {\r\n // 0.99 is a experience parameter, ensure that each iterations of\r\n // changes as small as possible.\r\n alpha *= 0.99;\r\n relaxRightToLeft(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n relaxLeftToRight(nodesByBreadth, alpha, orient);\r\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\r\n }\r\n}\r\n\r\nfunction prepareNodesByBreadth(nodes: GraphNode[], orient: LayoutOrient) {\r\n const nodesByBreadth: GraphNode[][] = [];\r\n const keyAttr = orient === 'vertical' ? 'y' : 'x';\r\n\r\n const groupResult = groupData(nodes, function (node) {\r\n return node.getLayout()[keyAttr] as number;\r\n });\r\n groupResult.keys.sort(function (a, b) {\r\n return a - b;\r\n });\r\n zrUtil.each(groupResult.keys, function (key) {\r\n nodesByBreadth.push(groupResult.buckets.get(key));\r\n });\r\n\r\n return nodesByBreadth;\r\n}\r\n\r\n/**\r\n * Compute the original y-position for each node\r\n */\r\nfunction initializeNodeDepth(\r\n nodesByBreadth: GraphNode[][],\r\n edges: GraphEdge[],\r\n height: number,\r\n width: number,\r\n nodeGap: number,\r\n orient: LayoutOrient\r\n) {\r\n let minKy = Infinity;\r\n zrUtil.each(nodesByBreadth, function (nodes) {\r\n const n = nodes.length;\r\n let sum = 0;\r\n zrUtil.each(nodes, function (node) {\r\n sum += node.getLayout().value;\r\n });\r\n const ky = orient === 'vertical'\r\n ? (width - (n - 1) * nodeGap) / sum\r\n : (height - (n - 1) * nodeGap) / sum;\r\n\r\n if (ky < minKy) {\r\n minKy = ky;\r\n }\r\n });\r\n\r\n zrUtil.each(nodesByBreadth, function (nodes) {\r\n zrUtil.each(nodes, function (node, i) {\r\n const nodeDy = node.getLayout().value * minKy;\r\n if (orient === 'vertical') {\r\n node.setLayout({x: i}, true);\r\n node.setLayout({dx: nodeDy}, true);\r\n }\r\n else {\r\n node.setLayout({y: i}, true);\r\n node.setLayout({dy: nodeDy}, true);\r\n }\r\n });\r\n });\r\n\r\n zrUtil.each(edges, function (edge) {\r\n const edgeDy = +edge.getValue() * minKy;\r\n edge.setLayout({dy: edgeDy}, true);\r\n });\r\n}\r\n\r\n/**\r\n * Resolve the collision of initialized depth (y-position)\r\n */\r\nfunction resolveCollisions(\r\n nodesByBreadth: GraphNode[][],\r\n nodeGap: number,\r\n height: number,\r\n width: number,\r\n orient: LayoutOrient\r\n) {\r\n const keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n zrUtil.each(nodesByBreadth, function (nodes) {\r\n nodes.sort(function (a, b) {\r\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\r\n });\r\n let nodeX;\r\n let node;\r\n let dy;\r\n let y0 = 0;\r\n const n = nodes.length;\r\n const nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\r\n for (let i = 0; i < n; i++) {\r\n node = nodes[i];\r\n dy = y0 - node.getLayout()[keyAttr];\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] + dy;\r\n orient === 'vertical'\r\n ? node.setLayout({x: nodeX}, true)\r\n : node.setLayout({y: nodeX}, true);\r\n }\r\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\r\n }\r\n const viewWidth = orient === 'vertical' ? width : height;\r\n // If the bottommost node goes outside the bounds, push it back up\r\n dy = y0 - nodeGap - viewWidth;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({x: nodeX}, true)\r\n : node.setLayout({y: nodeX}, true);\r\n\r\n y0 = nodeX;\r\n for (let i = n - 2; i >= 0; --i) {\r\n node = nodes[i];\r\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\r\n if (dy > 0) {\r\n nodeX = node.getLayout()[keyAttr] - dy;\r\n orient === 'vertical'\r\n ? node.setLayout({x: nodeX}, true)\r\n : node.setLayout({y: nodeX}, true);\r\n }\r\n y0 = node.getLayout()[keyAttr];\r\n }\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Change the y-position of the nodes, except most the right side nodes\r\n * @param nodesByBreadth\r\n * @param alpha parameter used to adjust the nodes y-position\r\n */\r\nfunction relaxRightToLeft(\r\n nodesByBreadth: GraphNode[][],\r\n alpha: number,\r\n orient: LayoutOrient\r\n) {\r\n zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {\r\n zrUtil.each(nodes, function (node) {\r\n if (node.outEdges.length) {\r\n let y = sum(node.outEdges, weightedTarget, orient)\r\n / sum(node.outEdges, getEdgeValue);\r\n\r\n if (isNaN(y)) {\r\n const len = node.outEdges.length;\r\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\r\n }\r\n\r\n if (orient === 'vertical') {\r\n const nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\r\n node.setLayout({x: nodeX}, true);\r\n }\r\n else {\r\n const nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\r\n node.setLayout({y: nodeY}, true);\r\n }\r\n }\r\n });\r\n });\r\n}\r\n\r\nfunction weightedTarget(edge: GraphEdge, orient: LayoutOrient) {\r\n return center(edge.node2, orient) * (edge.getValue() as number);\r\n}\r\nfunction centerTarget(edge: GraphEdge, orient: LayoutOrient) {\r\n return center(edge.node2, orient);\r\n}\r\n\r\nfunction weightedSource(edge: GraphEdge, orient: LayoutOrient) {\r\n return center(edge.node1, orient) * (edge.getValue() as number);\r\n}\r\nfunction centerSource(edge: GraphEdge, orient: LayoutOrient) {\r\n return center(edge.node1, orient);\r\n}\r\n\r\nfunction center(node: GraphNode, orient: LayoutOrient) {\r\n return orient === 'vertical'\r\n ? node.getLayout().x + node.getLayout().dx / 2\r\n : node.getLayout().y + node.getLayout().dy / 2;\r\n}\r\n\r\nfunction getEdgeValue(edge: GraphEdge) {\r\n return edge.getValue() as number;\r\n}\r\n\r\nfunction sum(array: T[], cb: (item: T, orient?: LayoutOrient) => number, orient?: LayoutOrient) {\r\n let sum = 0;\r\n const len = array.length;\r\n let i = -1;\r\n while (++i < len) {\r\n const value = +cb(array[i], orient);\r\n if (!isNaN(value)) {\r\n sum += value;\r\n }\r\n }\r\n return sum;\r\n}\r\n\r\n/**\r\n * Change the y-position of the nodes, except most the left side nodes\r\n */\r\nfunction relaxLeftToRight(nodesByBreadth: GraphNode[][], alpha: number, orient: LayoutOrient) {\r\n zrUtil.each(nodesByBreadth, function (nodes) {\r\n zrUtil.each(nodes, function (node) {\r\n if (node.inEdges.length) {\r\n let y = sum(node.inEdges, weightedSource, orient)\r\n / sum(node.inEdges, getEdgeValue);\r\n\r\n if (isNaN(y)) {\r\n const len = node.inEdges.length;\r\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\r\n }\r\n\r\n if (orient === 'vertical') {\r\n const nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\r\n node.setLayout({x: nodeX}, true);\r\n }\r\n else {\r\n const nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\r\n node.setLayout({y: nodeY}, true);\r\n }\r\n }\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Compute the depth(y-position) of each edge\r\n */\r\nfunction computeEdgeDepths(nodes: GraphNode[], orient: LayoutOrient) {\r\n const keyAttr = orient === 'vertical' ? 'x' : 'y';\r\n zrUtil.each(nodes, function (node) {\r\n node.outEdges.sort(function (a, b) {\r\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\r\n });\r\n node.inEdges.sort(function (a, b) {\r\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\r\n });\r\n });\r\n zrUtil.each(nodes, function (node) {\r\n let sy = 0;\r\n let ty = 0;\r\n zrUtil.each(node.outEdges, function (edge) {\r\n edge.setLayout({sy: sy}, true);\r\n sy += edge.getLayout().dy;\r\n });\r\n zrUtil.each(node.inEdges, function (edge) {\r\n edge.setLayout({ty: ty}, true);\r\n ty += edge.getLayout().dy;\r\n });\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport VisualMapping from '../../visual/VisualMapping';\r\nimport GlobalModel from '../../model/Global';\r\nimport SankeySeriesModel, { SankeyEdgeItemOption, SankeyNodeItemOption } from './SankeySeries';\r\n\r\nexport default function sankeyVisual(ecModel: GlobalModel) {\r\n ecModel.eachSeriesByType('sankey', function (seriesModel: SankeySeriesModel) {\r\n const graph = seriesModel.getGraph();\r\n const nodes = graph.nodes;\r\n const edges = graph.edges;\r\n if (nodes.length) {\r\n let minValue = Infinity;\r\n let maxValue = -Infinity;\r\n zrUtil.each(nodes, function (node) {\r\n const nodeValue = node.getLayout().value;\r\n if (nodeValue < minValue) {\r\n minValue = nodeValue;\r\n }\r\n if (nodeValue > maxValue) {\r\n maxValue = nodeValue;\r\n }\r\n });\r\n\r\n zrUtil.each(nodes, function (node) {\r\n const mapping = new VisualMapping({\r\n type: 'color',\r\n mappingMethod: 'linear',\r\n dataExtent: [minValue, maxValue],\r\n visual: seriesModel.get('color')\r\n });\r\n\r\n const mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\r\n const customColor = node.getModel().get(['itemStyle', 'color']);\r\n if (customColor != null) {\r\n node.setVisual('color', customColor);\r\n node.setVisual('style', {fill: customColor});\r\n }\r\n else {\r\n node.setVisual('color', mapValueToColor);\r\n node.setVisual('style', {fill: mapValueToColor});\r\n }\r\n });\r\n }\r\n if (edges.length) {\r\n zrUtil.each(edges, function (edge) {\r\n const edgeStyle = edge.getModel().get('lineStyle');\r\n edge.setVisual('style', edgeStyle);\r\n });\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport SankeyView from './SankeyView';\r\nimport SankeySeriesModel from './SankeySeries';\r\n\r\nimport sankeyLayout from './sankeyLayout';\r\nimport sankeyVisual from './sankeyVisual';\r\nimport { Payload } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\n\r\ninterface SankeyDragNodePayload extends Payload {\r\n localX: number\r\n localY: number\r\n}\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(SankeyView);\r\n registers.registerSeriesModel(SankeySeriesModel);\r\n\r\n registers.registerLayout(sankeyLayout);\r\n registers.registerVisual(sankeyVisual);\r\n\r\n registers.registerAction({\r\n type: 'dragNode',\r\n event: 'dragnode',\r\n // here can only use 'update' now, other value is not support in echarts.\r\n update: 'update'\r\n }, function (payload: SankeyDragNodePayload, ecModel: GlobalModel) {\r\n ecModel.eachComponent({\r\n mainType: 'series',\r\n subType: 'sankey',\r\n query: payload\r\n }, function (seriesModel: SankeySeriesModel) {\r\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\r\n });\r\n });\r\n\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport createSeriesDataSimply from './createSeriesDataSimply';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {getDimensionTypeByAxis} from '../../data/helper/dimensionHelper';\r\nimport {makeSeriesEncodeForAxisCoordSys} from '../../data/helper/sourceHelper';\r\nimport type { SeriesOption, SeriesOnCartesianOptionMixin, LayoutOrient } from '../../util/types';\r\nimport type GlobalModel from '../../model/Global';\r\nimport type SeriesModel from '../../model/Series';\r\nimport type CartesianAxisModel from '../../coord/cartesian/AxisModel';\r\nimport type SeriesData from '../../data/SeriesData';\r\nimport type Axis2D from '../../coord/cartesian/Axis2D';\r\nimport { CoordDimensionDefinition } from '../../data/helper/createDimensions';\r\n\r\ninterface CommonOption extends SeriesOption, SeriesOnCartesianOptionMixin {\r\n layout?: LayoutOrient\r\n\r\n // data?: (DataItemOption | number[])[]\r\n}\r\n\r\ntype WhiskerBoxCommonData = (DataItemOption | number[])[];\r\n\r\ninterface DataItemOption {\r\n value?: number[]\r\n}\r\n\r\ninterface WhiskerBoxCommonMixin extends SeriesModel{}\r\nclass WhiskerBoxCommonMixin {\r\n\r\n /**\r\n * @private\r\n * @type {string}\r\n */\r\n _baseAxisDim: string;\r\n\r\n defaultValueDimensions: CoordDimensionDefinition['dimsDef'];\r\n\r\n /**\r\n * @private\r\n */\r\n _hasEncodeRule(key: string) {\r\n const encodeRules = this.getEncode();\r\n if (encodeRules && encodeRules.data && encodeRules.data.has(key)) {\r\n return encodeRules.data.get(key) != null;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getInitialData(option: Opts, ecModel: GlobalModel): SeriesData {\r\n // When both types of xAxis and yAxis are 'value', layout is\r\n // needed to be specified by user. Otherwise, layout can be\r\n // judged by which axis is category.\r\n\r\n let ordinalMeta;\r\n\r\n const xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex')) as CartesianAxisModel;\r\n const yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex')) as CartesianAxisModel;\r\n const xAxisType = xAxisModel.get('type');\r\n const yAxisType = yAxisModel.get('type');\r\n let addOrdinal;\r\n\r\n // FIXME\r\n // Consider time axis.\r\n\r\n if (xAxisType === 'category') {\r\n option.layout = 'horizontal';\r\n ordinalMeta = xAxisModel.getOrdinalMeta();\r\n addOrdinal = !this._hasEncodeRule('x');\r\n }\r\n else if (yAxisType === 'category') {\r\n option.layout = 'vertical';\r\n ordinalMeta = yAxisModel.getOrdinalMeta();\r\n addOrdinal = !this._hasEncodeRule('y');\r\n }\r\n else {\r\n option.layout = option.layout || 'horizontal';\r\n }\r\n\r\n const coordDims = ['x', 'y'];\r\n const baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\r\n const baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\r\n const otherAxisDim = coordDims[1 - baseAxisDimIndex];\r\n const axisModels = [xAxisModel, yAxisModel];\r\n const baseAxisType = axisModels[baseAxisDimIndex].get('type');\r\n const otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\r\n const data = option.data as WhiskerBoxCommonData;\r\n\r\n // Clone a new data for next setOption({}) usage.\r\n // Avoid modifying current data will affect further update.\r\n if (data && addOrdinal) {\r\n const newOptionData: WhiskerBoxCommonData = [];\r\n zrUtil.each(data, function (item, index) {\r\n let newItem;\r\n if (zrUtil.isArray(item)) {\r\n newItem = item.slice();\r\n // Modify current using data.\r\n item.unshift(index);\r\n }\r\n else if (zrUtil.isArray(item.value)) {\r\n newItem = zrUtil.extend({}, item);\r\n newItem.value = newItem.value.slice();\r\n // Modify current using data.\r\n item.value.unshift(index);\r\n }\r\n else {\r\n newItem = item;\r\n }\r\n newOptionData.push(newItem);\r\n });\r\n option.data = newOptionData;\r\n }\r\n\r\n const defaultValueDimensions = this.defaultValueDimensions;\r\n const coordDimensions: CoordDimensionDefinition[] = [{\r\n name: baseAxisDim,\r\n type: getDimensionTypeByAxis(baseAxisType),\r\n ordinalMeta: ordinalMeta,\r\n otherDims: {\r\n tooltip: false,\r\n itemName: 0\r\n },\r\n dimsDef: ['base']\r\n }, {\r\n name: otherAxisDim,\r\n type: getDimensionTypeByAxis(otherAxisType),\r\n dimsDef: defaultValueDimensions.slice()\r\n }];\r\n\r\n return createSeriesDataSimply(\r\n this,\r\n {\r\n coordDimensions: coordDimensions,\r\n dimensionsCount: defaultValueDimensions.length + 1,\r\n encodeDefaulter: zrUtil.curry(\r\n makeSeriesEncodeForAxisCoordSys, coordDimensions, this as any\r\n )\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * If horizontal, base axis is x, otherwise y.\r\n * @override\r\n */\r\n getBaseAxis(): Axis2D {\r\n const dim = this._baseAxisDim;\r\n return (this.ecModel.getComponent(\r\n dim + 'Axis', this.get(dim + 'AxisIndex' as 'xAxisIndex' | 'yAxisIndex')\r\n ) as CartesianAxisModel).axis;\r\n }\r\n\r\n};\r\n\r\n\r\nexport {WhiskerBoxCommonMixin};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport {WhiskerBoxCommonMixin} from '../helper/whiskerBoxCommon';\r\nimport {\r\n SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n LayoutOrient,\r\n ItemStyleOption,\r\n SeriesLabelOption,\r\n OptionDataValueNumeric,\r\n StatesOptionMixin,\r\n SeriesEncodeOptionMixin,\r\n DefaultEmphasisFocus,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport type Axis2D from '../../coord/cartesian/Axis2D';\r\nimport Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport { mixin } from 'zrender/src/core/util';\r\n\r\n// [min, Q1, median (or Q2), Q3, max]\r\ntype BoxplotDataValue = OptionDataValueNumeric[];\r\n\r\nexport interface BoxplotStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\n\r\nexport interface BoxplotDataItemOption\r\n extends BoxplotStateOption, StatesOptionMixin {\r\n value: BoxplotDataValue\r\n}\r\n\r\ninterface ExtraStateOption {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus\r\n scale?: boolean\r\n }\r\n}\r\n\r\nexport interface BoxplotSeriesOption\r\n extends SeriesOption, ExtraStateOption>,\r\n BoxplotStateOption,\r\n SeriesOnCartesianOptionMixin, SeriesEncodeOptionMixin {\r\n type?: 'boxplot'\r\n\r\n coordinateSystem?: 'cartesian2d'\r\n\r\n layout?: LayoutOrient\r\n /**\r\n * [min, max] can be percent of band width.\r\n */\r\n boxWidth?: (string | number)[]\r\n\r\n data?: (BoxplotDataValue | BoxplotDataItemOption)[]\r\n}\r\n\r\nclass BoxplotSeriesModel extends SeriesModel {\r\n\r\n static readonly type = 'series.boxplot';\r\n readonly type = BoxplotSeriesModel.type;\r\n\r\n static readonly dependencies = ['xAxis', 'yAxis', 'grid'];\r\n\r\n coordinateSystem: Cartesian2D;\r\n // TODO\r\n // box width represents group size, so dimension should have 'size'.\r\n\r\n /**\r\n * @see \r\n * The meanings of 'min' and 'max' depend on user,\r\n * and echarts do not need to know it.\r\n * @readOnly\r\n */\r\n defaultValueDimensions = [\r\n {name: 'min', defaultTooltip: true},\r\n {name: 'Q1', defaultTooltip: true},\r\n {name: 'median', defaultTooltip: true},\r\n {name: 'Q3', defaultTooltip: true},\r\n {name: 'max', defaultTooltip: true}\r\n ];\r\n\r\n dimensions: string[];\r\n\r\n visualDrawType = 'stroke' as const;\r\n\r\n static defaultOption: BoxplotSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n\r\n layout: null,\r\n boxWidth: [7, 50],\r\n\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1\r\n },\r\n\r\n emphasis: {\r\n scale: true,\r\n\r\n itemStyle: {\r\n borderWidth: 2,\r\n shadowBlur: 5,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n },\r\n\r\n animationDuration: 800\r\n };\r\n}\r\n\r\ninterface BoxplotSeriesModel extends WhiskerBoxCommonMixin {\r\n getBaseAxis(): Axis2D\r\n}\r\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\r\n\r\nexport default BoxplotSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ChartView from '../../view/Chart';\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport Path, { PathProps } from 'zrender/src/graphic/Path';\r\nimport BoxplotSeriesModel, { BoxplotDataItemOption } from './BoxplotSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { BoxplotItemLayout } from './boxplotLayout';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\n\r\nclass BoxplotView extends ChartView {\r\n static type = 'boxplot';\r\n type = BoxplotView.type;\r\n\r\n private _data: SeriesData;\r\n\r\n render(seriesModel: BoxplotSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n const group = this.group;\r\n const oldData = this._data;\r\n\r\n // There is no old data only when first rendering or switching from\r\n // stream mode to normal mode, where previous elements should be removed.\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n\r\n const constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\r\n\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n const itemLayout = data.getItemLayout(newIdx) as BoxplotItemLayout;\r\n const symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n group.add(symbolEl);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n let symbolEl = oldData.getItemGraphicEl(oldIdx) as BoxPath;\r\n\r\n // Empty data\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(symbolEl);\r\n return;\r\n }\r\n\r\n const itemLayout = data.getItemLayout(newIdx) as BoxplotItemLayout;\r\n if (!symbolEl) {\r\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\r\n }\r\n else {\r\n saveOldStyle(symbolEl);\r\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\r\n }\r\n\r\n group.add(symbolEl);\r\n\r\n data.setItemGraphicEl(newIdx, symbolEl);\r\n })\r\n .remove(function (oldIdx) {\r\n const el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n\r\n this._data = data;\r\n }\r\n\r\n remove(ecModel: GlobalModel) {\r\n const group = this.group;\r\n const data = this._data;\r\n this._data = null;\r\n data && data.eachItemGraphicEl(function (el) {\r\n el && group.remove(el);\r\n });\r\n }\r\n}\r\n\r\nclass BoxPathShape {\r\n points: number[][];\r\n}\r\n\r\ninterface BoxPathProps extends PathProps {\r\n shape?: Partial\r\n}\r\n\r\nclass BoxPath extends Path {\r\n\r\n readonly type = 'boxplotBoxPath';\r\n shape: BoxPathShape;\r\n\r\n constructor(opts?: BoxPathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new BoxPathShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: BoxPathShape) {\r\n const ends = shape.points;\r\n\r\n let i = 0;\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n for (; i < 4; i++) {\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n ctx.closePath();\r\n\r\n for (; i < ends.length; i++) {\r\n ctx.moveTo(ends[i][0], ends[i][1]);\r\n i++;\r\n ctx.lineTo(ends[i][0], ends[i][1]);\r\n }\r\n }\r\n\r\n}\r\n\r\nfunction createNormalBox(\r\n itemLayout: BoxplotItemLayout,\r\n data: SeriesData,\r\n dataIndex: number,\r\n constDim: number,\r\n isInit?: boolean\r\n) {\r\n const ends = itemLayout.ends;\r\n\r\n const el = new BoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit(ends, constDim, itemLayout)\r\n : ends\r\n }\r\n });\r\n\r\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\r\n\r\n return el;\r\n}\r\n\r\nfunction updateNormalBoxData(\r\n itemLayout: BoxplotItemLayout,\r\n el: BoxPath,\r\n data: SeriesData,\r\n dataIndex: number,\r\n isInit?: boolean\r\n) {\r\n const seriesModel = data.hostModel;\r\n const updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\r\n\r\n updateMethod(\r\n el,\r\n {shape: {points: itemLayout.ends}},\r\n seriesModel,\r\n dataIndex\r\n );\r\n\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n\r\n el.z2 = 100;\r\n\r\n const itemModel = data.getItemModel(dataIndex);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n\r\n setStatesStylesFromModel(el, itemModel);\r\n\r\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\r\n}\r\n\r\nfunction transInit(points: number[][], dim: number, itemLayout: BoxplotItemLayout) {\r\n return zrUtil.map(points, function (point) {\r\n point = point.slice();\r\n point[dim] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n}\r\n\r\nexport default BoxplotView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {parsePercent} from '../../util/number';\r\nimport type GlobalModel from '../../model/Global';\r\nimport BoxplotSeriesModel from './BoxplotSeries';\r\nimport Axis2D from '../../coord/cartesian/Axis2D';\r\n\r\nconst each = zrUtil.each;\r\n\r\ninterface GroupItem {\r\n seriesModels: BoxplotSeriesModel[]\r\n axis: Axis2D\r\n boxOffsetList: number[]\r\n boxWidthList: number[]\r\n}\r\n\r\nexport interface BoxplotItemLayout {\r\n ends: number[][]\r\n initBaseline: number\r\n}\r\n\r\nexport default function boxplotLayout(ecModel: GlobalModel) {\r\n\r\n const groupResult = groupSeriesByAxis(ecModel);\r\n\r\n each(groupResult, function (groupItem) {\r\n const seriesModels = groupItem.seriesModels;\r\n\r\n if (!seriesModels.length) {\r\n return;\r\n }\r\n\r\n calculateBase(groupItem);\r\n\r\n each(seriesModels, function (seriesModel, idx) {\r\n layoutSingleSeries(\r\n seriesModel,\r\n groupItem.boxOffsetList[idx],\r\n groupItem.boxWidthList[idx]\r\n );\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Group series by axis.\r\n */\r\nfunction groupSeriesByAxis(ecModel: GlobalModel) {\r\n const result: GroupItem[] = [];\r\n const axisList: Axis2D[] = [];\r\n\r\n ecModel.eachSeriesByType('boxplot', function (seriesModel: BoxplotSeriesModel) {\r\n const baseAxis = seriesModel.getBaseAxis();\r\n let idx = zrUtil.indexOf(axisList, baseAxis);\r\n\r\n if (idx < 0) {\r\n idx = axisList.length;\r\n axisList[idx] = baseAxis;\r\n result[idx] = {\r\n axis: baseAxis,\r\n seriesModels: []\r\n } as GroupItem;\r\n }\r\n\r\n result[idx].seriesModels.push(seriesModel);\r\n });\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Calculate offset and box width for each series.\r\n */\r\nfunction calculateBase(groupItem: GroupItem) {\r\n const baseAxis = groupItem.axis;\r\n const seriesModels = groupItem.seriesModels;\r\n const seriesCount = seriesModels.length;\r\n\r\n const boxWidthList: number[] = groupItem.boxWidthList = [];\r\n const boxOffsetList: number[] = groupItem.boxOffsetList = [];\r\n const boundList: number[][] = [];\r\n\r\n let bandWidth: number;\r\n if (baseAxis.type === 'category') {\r\n bandWidth = baseAxis.getBandWidth();\r\n }\r\n else {\r\n let maxDataCount = 0;\r\n each(seriesModels, function (seriesModel) {\r\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\r\n });\r\n const extent = baseAxis.getExtent();\r\n bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount;\r\n }\r\n\r\n each(seriesModels, function (seriesModel) {\r\n let boxWidthBound = seriesModel.get('boxWidth');\r\n if (!zrUtil.isArray(boxWidthBound)) {\r\n boxWidthBound = [boxWidthBound, boxWidthBound];\r\n }\r\n boundList.push([\r\n parsePercent(boxWidthBound[0], bandWidth) || 0,\r\n parsePercent(boxWidthBound[1], bandWidth) || 0\r\n ]);\r\n });\r\n\r\n const availableWidth = bandWidth * 0.8 - 2;\r\n const boxGap = availableWidth / seriesCount * 0.3;\r\n const boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\r\n let base = boxWidth / 2 - availableWidth / 2;\r\n\r\n each(seriesModels, function (seriesModel, idx) {\r\n boxOffsetList.push(base);\r\n base += boxGap + boxWidth;\r\n\r\n boxWidthList.push(\r\n Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Calculate points location for each series.\r\n */\r\nfunction layoutSingleSeries(seriesModel: BoxplotSeriesModel, offset: number, boxWidth: number) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const data = seriesModel.getData();\r\n const halfWidth = boxWidth / 2;\r\n const cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\r\n const vDimIdx = 1 - cDimIdx;\r\n const coordDims = ['x', 'y'];\r\n const cDim = data.mapDimension(coordDims[cDimIdx]);\r\n const vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\r\n\r\n if (cDim == null || vDims.length < 5) {\r\n return;\r\n }\r\n\r\n for (let dataIndex = 0; dataIndex < data.count(); dataIndex++) {\r\n const axisDimVal = data.get(cDim, dataIndex) as number;\r\n\r\n const median = getPoint(axisDimVal, vDims[2], dataIndex);\r\n const end1 = getPoint(axisDimVal, vDims[0], dataIndex);\r\n const end2 = getPoint(axisDimVal, vDims[1], dataIndex);\r\n const end4 = getPoint(axisDimVal, vDims[3], dataIndex);\r\n const end5 = getPoint(axisDimVal, vDims[4], dataIndex);\r\n\r\n const ends: number[][] = [];\r\n addBodyEnd(ends, end2, false);\r\n addBodyEnd(ends, end4, true);\r\n\r\n ends.push(end1, end2, end5, end4);\r\n layEndLine(ends, end1);\r\n layEndLine(ends, end5);\r\n layEndLine(ends, median);\r\n\r\n data.setItemLayout(dataIndex, {\r\n initBaseline: median[vDimIdx],\r\n ends: ends\r\n } as BoxplotItemLayout);\r\n }\r\n\r\n function getPoint(axisDimVal: number, dim: string, dataIndex: number) {\r\n const val = data.get(dim, dataIndex) as number;\r\n const p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n let point;\r\n if (isNaN(axisDimVal) || isNaN(val)) {\r\n point = [NaN, NaN];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(p);\r\n point[cDimIdx] += offset;\r\n }\r\n return point;\r\n }\r\n\r\n function addBodyEnd(ends: number[][], point: number[], start?: boolean) {\r\n const point1 = point.slice();\r\n const point2 = point.slice();\r\n point1[cDimIdx] += halfWidth;\r\n point2[cDimIdx] -= halfWidth;\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n\r\n function layEndLine(ends: number[][], endCenter: number[]) {\r\n const from = endCenter.slice();\r\n const to = endCenter.slice();\r\n from[cDimIdx] -= halfWidth;\r\n to[cDimIdx] += halfWidth;\r\n ends.push(from, to);\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { quantile, asc } from '../../util/number';\r\nimport { isFunction, isString } from 'zrender/src/core/util';\r\n\r\nexport interface PrepareBoxplotDataOpt {\r\n boundIQR?: number | 'none';\r\n // Like \"expriment{value}\" produce: \"expriment0\", \"expriment1\", ...\r\n itemNameFormatter?: string | ((params: { value: number }) => string);\r\n}\r\n\r\n\r\n/**\r\n * See:\r\n * \r\n * \r\n *\r\n * Helper method for preparing data.\r\n *\r\n * @param rawData like\r\n * [\r\n * [12,232,443], (raw data set for the first box)\r\n * [3843,5545,1232], (raw data set for the second box)\r\n * ...\r\n * ]\r\n * @param opt.boundIQR=1.5 Data less than min bound is outlier.\r\n * default 1.5, means Q1 - 1.5 * (Q3 - Q1).\r\n * If 'none'/0 passed, min bound will not be used.\r\n */\r\nexport default function prepareBoxplotData(\r\n rawData: number[][],\r\n opt: PrepareBoxplotDataOpt\r\n): {\r\n boxData: (number | string)[][];\r\n outliers: (number | string)[][];\r\n} {\r\n opt = opt || {};\r\n const boxData = [];\r\n const outliers = [];\r\n const boundIQR = opt.boundIQR;\r\n const useExtreme = boundIQR === 'none' || boundIQR === 0;\r\n\r\n for (let i = 0; i < rawData.length; i++) {\r\n const ascList = asc(rawData[i].slice());\r\n\r\n const Q1 = quantile(ascList, 0.25);\r\n const Q2 = quantile(ascList, 0.5);\r\n const Q3 = quantile(ascList, 0.75);\r\n const min = ascList[0];\r\n const max = ascList[ascList.length - 1];\r\n\r\n const bound = (boundIQR == null ? 1.5 : boundIQR as number) * (Q3 - Q1);\r\n\r\n const low = useExtreme\r\n ? min\r\n : Math.max(min, Q1 - bound);\r\n const high = useExtreme\r\n ? max\r\n : Math.min(max, Q3 + bound);\r\n\r\n const itemNameFormatter = opt.itemNameFormatter;\r\n const itemName = isFunction(itemNameFormatter)\r\n ? itemNameFormatter({ value: i })\r\n : isString(itemNameFormatter)\r\n ? itemNameFormatter.replace('{value}', i + '')\r\n : i + '';\r\n\r\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\r\n\r\n for (let j = 0; j < ascList.length; j++) {\r\n const dataItem = ascList[j];\r\n if (dataItem < low || dataItem > high) {\r\n const outlier = [itemName, dataItem];\r\n outliers.push(outlier);\r\n }\r\n }\r\n }\r\n return {\r\n boxData: boxData,\r\n outliers: outliers\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { DataTransformOption, ExternalDataTransform } from '../../data/helper/transform';\r\nimport prepareBoxplotData, { PrepareBoxplotDataOpt } from './prepareBoxplotData';\r\nimport { throwError, makePrintable } from '../../util/log';\r\nimport { SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types';\r\n\r\n\r\nexport interface BoxplotTransformOption extends DataTransformOption {\r\n type: 'boxplot';\r\n config: PrepareBoxplotDataOpt;\r\n}\r\n\r\nexport const boxplotTransform: ExternalDataTransform = {\r\n\r\n type: 'echarts:boxplot',\r\n\r\n transform: function transform(params) {\r\n const upstream = params.upstream;\r\n\r\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'source data is not applicable for this boxplot transform. Expect number[][].'\r\n );\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n const result = prepareBoxplotData(\r\n upstream.getRawData() as number[][],\r\n params.config\r\n );\r\n\r\n return [{\r\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\r\n data: result.boxData\r\n }, {\r\n data: result.outliers\r\n }];\r\n }\r\n};\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport BoxplotSeriesModel from './BoxplotSeries';\r\nimport BoxplotView from './BoxplotView';\r\nimport boxplotLayout from './boxplotLayout';\r\nimport { boxplotTransform } from './boxplotTransform';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerSeriesModel(BoxplotSeriesModel);\r\n registers.registerChartView(BoxplotView);\r\n registers.registerLayout(boxplotLayout);\r\n registers.registerTransform(boxplotTransform);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport createRenderPlanner from '../helper/createRenderPlanner';\r\nimport { StageHandler } from '../../util/types';\r\nimport CandlestickSeriesModel, { CandlestickDataItemOption } from './CandlestickSeries';\r\nimport Model from '../../model/Model';\r\nimport { extend } from 'zrender/src/core/util';\r\n\r\nconst positiveBorderColorQuery = ['itemStyle', 'borderColor'] as const;\r\nconst negativeBorderColorQuery = ['itemStyle', 'borderColor0'] as const;\r\nconst dojiBorderColorQuery = ['itemStyle', 'borderColorDoji'] as const;\r\nconst positiveColorQuery = ['itemStyle', 'color'] as const;\r\nconst negativeColorQuery = ['itemStyle', 'color0'] as const;\r\n\r\nexport function getColor(sign: number, model: Model>) {\r\n return model.get(\r\n sign > 0 ? positiveColorQuery : negativeColorQuery\r\n );\r\n}\r\n\r\nexport function getBorderColor(sign: number, model: Model>) {\r\n return model.get(\r\n sign === 0 ? dojiBorderColorQuery\r\n : sign > 0\r\n ? positiveBorderColorQuery\r\n : negativeBorderColorQuery\r\n );\r\n}\r\n\r\nconst candlestickVisual: StageHandler = {\r\n\r\n seriesType: 'candlestick',\r\n\r\n plan: createRenderPlanner(),\r\n\r\n // For legend.\r\n performRawSeries: true,\r\n\r\n reset: function (seriesModel: CandlestickSeriesModel, ecModel) {\r\n // Only visible series has each data be visual encoded\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n\r\n const isLargeRender = seriesModel.pipelineContext.large;\r\n return !isLargeRender && {\r\n progress(params, data) {\r\n let dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n const itemModel = data.getItemModel(dataIndex);\r\n const sign = data.getItemLayout(dataIndex).sign;\r\n\r\n const style = itemModel.getItemStyle();\r\n style.fill = getColor(sign, itemModel);\r\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\r\n\r\n const existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\r\n extend(existsStyle, style);\r\n }\r\n }\r\n };\r\n\r\n\r\n }\r\n\r\n};\r\n\r\nexport default candlestickVisual;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ChartView from '../../view/Chart';\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport Path, { PathProps } from 'zrender/src/graphic/Path';\r\nimport {createClipPath} from '../helper/createClipPathFromCoordSys';\r\nimport CandlestickSeriesModel, { CandlestickDataItemOption } from './CandlestickSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { StageHandlerProgressParams } from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport {CandlestickItemLayout} from './candlestickLayout';\r\nimport { CoordinateSystemClipArea } from '../../coord/CoordinateSystem';\r\nimport Model from '../../model/Model';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\nimport Element from 'zrender/src/Element';\r\nimport { getBorderColor, getColor } from './candlestickVisual';\r\n\r\nconst SKIP_PROPS = ['color', 'borderColor'] as const;\r\n\r\nclass CandlestickView extends ChartView {\r\n\r\n static readonly type = 'candlestick';\r\n readonly type = CandlestickView.type;\r\n\r\n private _isLargeDraw: boolean;\r\n\r\n private _data: SeriesData;\r\n\r\n private _progressiveEls: Element[];\r\n\r\n render(seriesModel: CandlestickSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n // If there is clipPath created in large mode. Remove it.\r\n this.group.removeClipPath();\r\n // Clear previously rendered progressive elements.\r\n this._progressiveEls = null;\r\n\r\n this._updateDrawMode(seriesModel);\r\n\r\n this._isLargeDraw\r\n ? this._renderLarge(seriesModel)\r\n : this._renderNormal(seriesModel);\r\n }\r\n\r\n incrementalPrepareRender(seriesModel: CandlestickSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._clear();\r\n this._updateDrawMode(seriesModel);\r\n }\r\n\r\n incrementalRender(\r\n params: StageHandlerProgressParams,\r\n seriesModel: CandlestickSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n this._progressiveEls = [];\r\n this._isLargeDraw\r\n ? this._incrementalRenderLarge(params, seriesModel)\r\n : this._incrementalRenderNormal(params, seriesModel);\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n graphic.traverseElements(this._progressiveEls || this.group, cb);\r\n }\r\n\r\n _updateDrawMode(seriesModel: CandlestickSeriesModel) {\r\n const isLargeDraw = seriesModel.pipelineContext.large;\r\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\r\n this._isLargeDraw = isLargeDraw;\r\n this._clear();\r\n }\r\n }\r\n\r\n _renderNormal(seriesModel: CandlestickSeriesModel) {\r\n const data = seriesModel.getData();\r\n const oldData = this._data;\r\n const group = this.group;\r\n const isSimpleBox = data.getLayout('isSimpleBox');\r\n\r\n const needsClip = seriesModel.get('clip', true);\r\n const coord = seriesModel.coordinateSystem;\r\n const clipArea = coord.getArea && coord.getArea();\r\n\r\n // There is no old data only when first rendering or switching from\r\n // stream mode to normal mode, where previous elements should be removed.\r\n if (!this._data) {\r\n group.removeAll();\r\n }\r\n\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n if (data.hasValue(newIdx)) {\r\n const itemLayout = data.getItemLayout(newIdx) as CandlestickItemLayout;\r\n\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n return;\r\n }\r\n\r\n const el = createNormalBox(itemLayout, newIdx, true);\r\n graphic.initProps(el, {shape: {points: itemLayout.ends}}, seriesModel, newIdx);\r\n\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n\r\n group.add(el);\r\n\r\n data.setItemGraphicEl(newIdx, el);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n let el = oldData.getItemGraphicEl(oldIdx) as NormalBoxPath;\r\n\r\n // Empty data\r\n if (!data.hasValue(newIdx)) {\r\n group.remove(el);\r\n return;\r\n }\r\n\r\n const itemLayout = data.getItemLayout(newIdx) as CandlestickItemLayout;\r\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\r\n group.remove(el);\r\n return;\r\n }\r\n\r\n if (!el) {\r\n el = createNormalBox(itemLayout, newIdx);\r\n }\r\n else {\r\n graphic.updateProps(el, {\r\n shape: {\r\n points: itemLayout.ends\r\n }\r\n }, seriesModel, newIdx);\r\n\r\n saveOldStyle(el);\r\n }\r\n\r\n setBoxCommon(el, data, newIdx, isSimpleBox);\r\n\r\n group.add(el);\r\n data.setItemGraphicEl(newIdx, el);\r\n })\r\n .remove(function (oldIdx) {\r\n const el = oldData.getItemGraphicEl(oldIdx);\r\n el && group.remove(el);\r\n })\r\n .execute();\r\n\r\n this._data = data;\r\n }\r\n\r\n _renderLarge(seriesModel: CandlestickSeriesModel) {\r\n this._clear();\r\n\r\n createLarge(seriesModel, this.group);\r\n\r\n const clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n\r\n }\r\n\r\n _incrementalRenderNormal(params: StageHandlerProgressParams, seriesModel: CandlestickSeriesModel) {\r\n const data = seriesModel.getData();\r\n const isSimpleBox = data.getLayout('isSimpleBox');\r\n\r\n let dataIndex;\r\n while ((dataIndex = params.next()) != null) {\r\n const itemLayout = data.getItemLayout(dataIndex) as CandlestickItemLayout;\r\n const el = createNormalBox(itemLayout, dataIndex);\r\n setBoxCommon(el, data, dataIndex, isSimpleBox);\r\n\r\n el.incremental = true;\r\n this.group.add(el);\r\n\r\n this._progressiveEls.push(el);\r\n }\r\n }\r\n\r\n _incrementalRenderLarge(params: StageHandlerProgressParams, seriesModel: CandlestickSeriesModel) {\r\n createLarge(seriesModel, this.group, this._progressiveEls, true);\r\n }\r\n\r\n remove(ecModel: GlobalModel) {\r\n this._clear();\r\n }\r\n\r\n _clear() {\r\n this.group.removeAll();\r\n this._data = null;\r\n }\r\n}\r\n\r\nclass NormalBoxPathShape {\r\n points: number[][];\r\n}\r\n\r\ninterface NormalBoxPathProps extends PathProps {\r\n shape?: Partial\r\n}\r\n\r\nclass NormalBoxPath extends Path {\r\n\r\n readonly type = 'normalCandlestickBox';\r\n\r\n shape: NormalBoxPathShape;\r\n\r\n __simpleBox: boolean;\r\n\r\n constructor(opts?: NormalBoxPathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new NormalBoxPathShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: NormalBoxPathShape) {\r\n const ends = shape.points;\r\n\r\n if (this.__simpleBox) {\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[6][0], ends[6][1]);\r\n }\r\n else {\r\n ctx.moveTo(ends[0][0], ends[0][1]);\r\n ctx.lineTo(ends[1][0], ends[1][1]);\r\n ctx.lineTo(ends[2][0], ends[2][1]);\r\n ctx.lineTo(ends[3][0], ends[3][1]);\r\n ctx.closePath();\r\n\r\n ctx.moveTo(ends[4][0], ends[4][1]);\r\n ctx.lineTo(ends[5][0], ends[5][1]);\r\n ctx.moveTo(ends[6][0], ends[6][1]);\r\n ctx.lineTo(ends[7][0], ends[7][1]);\r\n }\r\n }\r\n}\r\n\r\n\r\nfunction createNormalBox(itemLayout: CandlestickItemLayout, dataIndex: number, isInit?: boolean) {\r\n const ends = itemLayout.ends;\r\n return new NormalBoxPath({\r\n shape: {\r\n points: isInit\r\n ? transInit(ends, itemLayout)\r\n : ends\r\n },\r\n z2: 100\r\n });\r\n}\r\n\r\nfunction isNormalBoxClipped(clipArea: CoordinateSystemClipArea, itemLayout: CandlestickItemLayout) {\r\n let clipped = true;\r\n for (let i = 0; i < itemLayout.ends.length; i++) {\r\n // If any point are in the region.\r\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\r\n clipped = false;\r\n break;\r\n }\r\n }\r\n return clipped;\r\n}\r\n\r\nfunction setBoxCommon(el: NormalBoxPath, data: SeriesData, dataIndex: number, isSimpleBox?: boolean) {\r\n const itemModel = data.getItemModel(dataIndex) as Model;\r\n\r\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\r\n el.style.strokeNoScale = true;\r\n\r\n el.__simpleBox = isSimpleBox;\r\n\r\n setStatesStylesFromModel(el, itemModel);\r\n\r\n const sign = data.getItemLayout(dataIndex).sign;\r\n zrUtil.each(el.states, (state, stateName) => {\r\n const stateModel = itemModel.getModel(stateName as any);\r\n const color = getColor(sign, stateModel);\r\n const borderColor = getBorderColor(sign, stateModel) || color;\r\n const stateStyle = state.style || (state.style = {});\r\n color && (stateStyle.fill = color);\r\n borderColor && (stateStyle.stroke = borderColor);\r\n });\r\n\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\r\n}\r\n\r\nfunction transInit(points: number[][], itemLayout: CandlestickItemLayout) {\r\n return zrUtil.map(points, function (point) {\r\n point = point.slice();\r\n point[1] = itemLayout.initBaseline;\r\n return point;\r\n });\r\n}\r\n\r\n\r\n\r\nclass LargeBoxPathShape {\r\n points: ArrayLike;\r\n}\r\n\r\ninterface LargeBoxPathProps extends PathProps {\r\n shape?: Partial\r\n __sign?: number\r\n}\r\n\r\nclass LargeBoxPath extends Path {\r\n readonly type = 'largeCandlestickBox';\r\n\r\n shape: LargeBoxPathShape;\r\n\r\n __sign: number;\r\n\r\n constructor(opts?: LargeBoxPathProps) {\r\n super(opts);\r\n }\r\n\r\n getDefaultShape() {\r\n return new LargeBoxPathShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: LargeBoxPathShape) {\r\n // Drawing lines is more efficient than drawing\r\n // a whole line or drawing rects.\r\n const points = shape.points;\r\n for (let i = 0; i < points.length;) {\r\n if (this.__sign === points[i++]) {\r\n const x = points[i++];\r\n ctx.moveTo(x, points[i++]);\r\n ctx.lineTo(x, points[i++]);\r\n }\r\n else {\r\n i += 3;\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction createLarge(\r\n seriesModel: CandlestickSeriesModel,\r\n group: graphic.Group,\r\n progressiveEls?: Element[],\r\n incremental?: boolean\r\n) {\r\n const data = seriesModel.getData();\r\n const largePoints = data.getLayout('largePoints');\r\n\r\n const elP = new LargeBoxPath({\r\n shape: {points: largePoints},\r\n __sign: 1,\r\n ignoreCoarsePointer: true\r\n });\r\n group.add(elP);\r\n const elN = new LargeBoxPath({\r\n shape: {points: largePoints},\r\n __sign: -1,\r\n ignoreCoarsePointer: true\r\n });\r\n group.add(elN);\r\n const elDoji = new LargeBoxPath({\r\n shape: {points: largePoints},\r\n __sign: 0,\r\n ignoreCoarsePointer: true\r\n });\r\n group.add(elDoji);\r\n\r\n setLargeStyle(1, elP, seriesModel, data);\r\n setLargeStyle(-1, elN, seriesModel, data);\r\n setLargeStyle(0, elDoji, seriesModel, data);\r\n\r\n if (incremental) {\r\n elP.incremental = true;\r\n elN.incremental = true;\r\n }\r\n\r\n if (progressiveEls) {\r\n progressiveEls.push(elP, elN);\r\n }\r\n}\r\n\r\nfunction setLargeStyle(sign: number, el: LargeBoxPath, seriesModel: CandlestickSeriesModel, data: SeriesData) {\r\n // TODO put in visual?\r\n const borderColor = getBorderColor(sign, seriesModel)\r\n // Use color for border color by default.\r\n || getColor(sign, seriesModel);\r\n\r\n // Color must be excluded.\r\n // Because symbol provide setColor individually to set fill and stroke\r\n const itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\r\n\r\n el.useStyle(itemStyle);\r\n el.style.fill = null;\r\n el.style.stroke = borderColor;\r\n}\r\n\r\n\r\n\r\nexport default CandlestickView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport {WhiskerBoxCommonMixin} from '../helper/whiskerBoxCommon';\r\nimport {\r\n SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n LayoutOrient,\r\n ItemStyleOption,\r\n ZRColor,\r\n ColorString,\r\n SeriesLabelOption,\r\n SeriesLargeOptionMixin,\r\n StatesOptionMixin,\r\n SeriesEncodeOptionMixin,\r\n DefaultEmphasisFocus,\r\n OptionDataValue\r\n} from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport { BrushCommonSelectorsForSeries } from '../../component/brush/selector';\r\nimport { mixin } from 'zrender/src/core/util';\r\n\r\ntype CandlestickDataValue = OptionDataValue[];\r\n\r\ninterface CandlestickItemStyleOption extends ItemStyleOption {\r\n color0?: ZRColor\r\n borderColor0?: ColorString\r\n borderColorDoji?: ZRColor\r\n}\r\nexport interface CandlestickStateOption {\r\n itemStyle?: CandlestickItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\nexport interface CandlestickDataItemOption\r\n extends CandlestickStateOption, StatesOptionMixin {\r\n value: CandlestickDataValue\r\n}\r\n\r\ninterface ExtraStateOption {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus\r\n scale?: boolean\r\n }\r\n}\r\n\r\nexport interface CandlestickSeriesOption\r\n extends SeriesOption, CandlestickStateOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesLargeOptionMixin,\r\n SeriesEncodeOptionMixin {\r\n\r\n type?: 'candlestick'\r\n\r\n coordinateSystem?: 'cartesian2d'\r\n\r\n layout?: LayoutOrient\r\n clip?: boolean\r\n\r\n barMaxWidth?: number | string\r\n barMinWidth?: number | string\r\n barWidth?: number | string\r\n\r\n data?: (CandlestickDataValue | CandlestickDataItemOption)[]\r\n}\r\n\r\nclass CandlestickSeriesModel extends SeriesModel {\r\n\r\n static readonly type = 'series.candlestick';\r\n readonly type = CandlestickSeriesModel.type;\r\n\r\n static readonly dependencies = ['xAxis', 'yAxis', 'grid'];\r\n\r\n coordinateSystem: Cartesian2D;\r\n\r\n dimensions: string[];\r\n\r\n defaultValueDimensions = [\r\n {name: 'open', defaultTooltip: true},\r\n {name: 'close', defaultTooltip: true},\r\n {name: 'lowest', defaultTooltip: true},\r\n {name: 'highest', defaultTooltip: true}\r\n ];\r\n\r\n static defaultOption: CandlestickSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n coordinateSystem: 'cartesian2d',\r\n legendHoverLink: true,\r\n\r\n // xAxisIndex: 0,\r\n // yAxisIndex: 0,\r\n\r\n layout: null, // 'horizontal' or 'vertical'\r\n\r\n clip: true,\r\n\r\n itemStyle: {\r\n color: '#eb5454', // positive\r\n color0: '#47b262', // negative\r\n borderColor: '#eb5454',\r\n borderColor0: '#47b262',\r\n borderColorDoji: null, // when close === open\r\n // borderColor: '#d24040',\r\n // borderColor0: '#398f4f',\r\n borderWidth: 1\r\n },\r\n\r\n emphasis: {\r\n itemStyle: {\r\n borderWidth: 2\r\n }\r\n },\r\n\r\n barMaxWidth: null,\r\n barMinWidth: null,\r\n barWidth: null,\r\n\r\n large: true,\r\n largeThreshold: 600,\r\n\r\n progressive: 3e3,\r\n progressiveThreshold: 1e4,\r\n progressiveChunkMode: 'mod',\r\n\r\n animationEasing: 'linear',\r\n animationDuration: 300\r\n };\r\n\r\n /**\r\n * Get dimension for shadow in dataZoom\r\n * @return dimension name\r\n */\r\n getShadowDim() {\r\n return 'open';\r\n }\r\n\r\n brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries): boolean {\r\n const itemLayout = data.getItemLayout(dataIndex);\r\n return itemLayout && selectors.rect(itemLayout.brushRect);\r\n }\r\n}\r\n\r\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\r\n\r\nexport default CandlestickSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { ECUnitOption } from '../../util/types';\r\n\r\nexport default function candlestickPreprocessor(option: ECUnitOption) {\r\n if (!option || !zrUtil.isArray(option.series)) {\r\n return;\r\n }\r\n\r\n // Translate 'k' to 'candlestick'.\r\n zrUtil.each(option.series, function (seriesItem) {\r\n if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {\r\n seriesItem.type = 'candlestick';\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {subPixelOptimize} from '../../util/graphic';\r\nimport createRenderPlanner from '../helper/createRenderPlanner';\r\nimport {parsePercent} from '../../util/number';\r\nimport {map, retrieve2} from 'zrender/src/core/util';\r\nimport { DimensionIndex, StageHandler, StageHandlerProgressParams } from '../../util/types';\r\nimport CandlestickSeriesModel, { CandlestickDataItemOption } from './CandlestickSeries';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport DataStore from '../../data/DataStore';\r\nimport { createFloat32Array } from '../../util/vendor';\r\n\r\nexport interface CandlestickItemLayout {\r\n sign: number\r\n initBaseline: number\r\n ends: number[][]\r\n brushRect: RectLike\r\n}\r\n\r\nexport interface CandlestickLayoutMeta {\r\n candleWidth: number\r\n isSimpleBox: boolean\r\n}\r\n\r\nconst candlestickLayout: StageHandler = {\r\n\r\n seriesType: 'candlestick',\r\n\r\n plan: createRenderPlanner(),\r\n\r\n reset: function (seriesModel: CandlestickSeriesModel) {\r\n\r\n const coordSys = seriesModel.coordinateSystem;\r\n const data = seriesModel.getData();\r\n const candleWidth = calculateCandleWidth(seriesModel, data);\r\n const cDimIdx = 0;\r\n const vDimIdx = 1;\r\n const coordDims = ['x', 'y'];\r\n const cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx]));\r\n const vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data);\r\n const openDimI = vDimsI[0];\r\n const closeDimI = vDimsI[1];\r\n const lowestDimI = vDimsI[2];\r\n const highestDimI = vDimsI[3];\r\n\r\n data.setLayout({\r\n candleWidth: candleWidth,\r\n // The value is experimented visually.\r\n isSimpleBox: candleWidth <= 1.3\r\n } as CandlestickLayoutMeta);\r\n\r\n if (cDimI < 0 || vDimsI.length < 4) {\r\n return;\r\n }\r\n\r\n return {\r\n progress: seriesModel.pipelineContext.large\r\n ? largeProgress : normalProgress\r\n };\r\n\r\n function normalProgress(params: StageHandlerProgressParams, data: SeriesData) {\r\n let dataIndex;\r\n const store = data.getStore();\r\n while ((dataIndex = params.next()) != null) {\r\n\r\n const axisDimVal = store.get(cDimI, dataIndex) as number;\r\n const openVal = store.get(openDimI, dataIndex) as number;\r\n const closeVal = store.get(closeDimI, dataIndex) as number;\r\n const lowestVal = store.get(lowestDimI, dataIndex) as number;\r\n const highestVal = store.get(highestDimI, dataIndex) as number;\r\n\r\n const ocLow = Math.min(openVal, closeVal);\r\n const ocHigh = Math.max(openVal, closeVal);\r\n\r\n const ocLowPoint = getPoint(ocLow, axisDimVal);\r\n const ocHighPoint = getPoint(ocHigh, axisDimVal);\r\n const lowestPoint = getPoint(lowestVal, axisDimVal);\r\n const highestPoint = getPoint(highestVal, axisDimVal);\r\n\r\n const ends: number[][] = [];\r\n addBodyEnd(ends, ocHighPoint, 0);\r\n addBodyEnd(ends, ocLowPoint, 1);\r\n\r\n ends.push(\r\n subPixelOptimizePoint(highestPoint),\r\n subPixelOptimizePoint(ocHighPoint),\r\n subPixelOptimizePoint(lowestPoint),\r\n subPixelOptimizePoint(ocLowPoint)\r\n );\r\n\r\n const itemModel = data.getItemModel(dataIndex);\r\n const hasDojiColor = !!itemModel.get(['itemStyle', 'borderColorDoji']);\r\n data.setItemLayout(dataIndex, {\r\n sign: getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor),\r\n initBaseline: openVal > closeVal\r\n ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx], // open point.\r\n ends: ends,\r\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\r\n } as CandlestickItemLayout);\r\n }\r\n\r\n function getPoint(val: number, axisDimVal: number) {\r\n const p = [];\r\n p[cDimIdx] = axisDimVal;\r\n p[vDimIdx] = val;\r\n return (isNaN(axisDimVal) || isNaN(val))\r\n ? [NaN, NaN]\r\n : coordSys.dataToPoint(p);\r\n }\r\n\r\n function addBodyEnd(ends: number[][], point: number[], start: number) {\r\n const point1 = point.slice();\r\n const point2 = point.slice();\r\n\r\n point1[cDimIdx] = subPixelOptimize(\r\n point1[cDimIdx] + candleWidth / 2, 1, false\r\n );\r\n point2[cDimIdx] = subPixelOptimize(\r\n point2[cDimIdx] - candleWidth / 2, 1, true\r\n );\r\n\r\n start\r\n ? ends.push(point1, point2)\r\n : ends.push(point2, point1);\r\n }\r\n\r\n function makeBrushRect(lowestVal: number, highestVal: number, axisDimVal: number) {\r\n const pmin = getPoint(lowestVal, axisDimVal);\r\n const pmax = getPoint(highestVal, axisDimVal);\r\n\r\n pmin[cDimIdx] -= candleWidth / 2;\r\n pmax[cDimIdx] -= candleWidth / 2;\r\n\r\n return {\r\n x: pmin[0],\r\n y: pmin[1],\r\n width: vDimIdx ? candleWidth : pmax[0] - pmin[0],\r\n height: vDimIdx ? pmax[1] - pmin[1] : candleWidth\r\n };\r\n }\r\n\r\n function subPixelOptimizePoint(point: number[]) {\r\n point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);\r\n return point;\r\n }\r\n }\r\n\r\n function largeProgress(params: StageHandlerProgressParams, data: SeriesData) {\r\n // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]\r\n const points = createFloat32Array(params.count * 4);\r\n let offset = 0;\r\n let point;\r\n const tmpIn: number[] = [];\r\n const tmpOut: number[] = [];\r\n let dataIndex;\r\n const store = data.getStore();\r\n const hasDojiColor = !!seriesModel.get(['itemStyle', 'borderColorDoji']);\r\n\r\n while ((dataIndex = params.next()) != null) {\r\n const axisDimVal = store.get(cDimI, dataIndex) as number;\r\n const openVal = store.get(openDimI, dataIndex) as number;\r\n const closeVal = store.get(closeDimI, dataIndex) as number;\r\n const lowestVal = store.get(lowestDimI, dataIndex) as number;\r\n const highestVal = store.get(highestDimI, dataIndex) as number;\r\n\r\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\r\n points[offset++] = NaN;\r\n offset += 3;\r\n continue;\r\n }\r\n\r\n points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor);\r\n\r\n tmpIn[cDimIdx] = axisDimVal;\r\n\r\n tmpIn[vDimIdx] = lowestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[0] : NaN;\r\n points[offset++] = point ? point[1] : NaN;\r\n tmpIn[vDimIdx] = highestVal;\r\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\r\n points[offset++] = point ? point[1] : NaN;\r\n }\r\n\r\n data.setLayout('largePoints', points);\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Get the sign of a single data.\r\n *\r\n * @returns 0 for doji with hasDojiColor: true,\r\n * 1 for positive,\r\n * -1 for negative.\r\n */\r\nfunction getSign(\r\n store: DataStore, dataIndex: number, openVal: number, closeVal: number, closeDimI: DimensionIndex,\r\n hasDojiColor: boolean\r\n): -1 | 1 | 0 {\r\n let sign: -1 | 1 | 0;\r\n if (openVal > closeVal) {\r\n sign = -1;\r\n }\r\n else if (openVal < closeVal) {\r\n sign = 1;\r\n }\r\n else {\r\n sign = hasDojiColor\r\n // When doji color is set, use it instead of color/color0.\r\n ? 0\r\n : (dataIndex > 0\r\n // If close === open, compare with close of last record\r\n ? (store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1)\r\n // No record of previous, set to be positive\r\n : 1\r\n );\r\n }\r\n\r\n return sign;\r\n}\r\n\r\nfunction calculateCandleWidth(seriesModel: CandlestickSeriesModel, data: SeriesData) {\r\n const baseAxis = seriesModel.getBaseAxis();\r\n let extent;\r\n\r\n const bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (\r\n extent = baseAxis.getExtent(),\r\n Math.abs(extent[1] - extent[0]) / data.count()\r\n );\r\n\r\n const barMaxWidth = parsePercent(\r\n retrieve2(seriesModel.get('barMaxWidth'), bandWidth),\r\n bandWidth\r\n );\r\n const barMinWidth = parsePercent(\r\n retrieve2(seriesModel.get('barMinWidth'), 1),\r\n bandWidth\r\n );\r\n const barWidth = seriesModel.get('barWidth');\r\n\r\n return barWidth != null\r\n ? parsePercent(barWidth, bandWidth)\r\n // Put max outer to ensure bar visible in spite of overlap.\r\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\r\n}\r\n\r\nexport default candlestickLayout;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport CandlestickView from './CandlestickView';\r\nimport CandlestickSeriesModel from './CandlestickSeries';\r\nimport preprocessor from './preprocessor';\r\n\r\nimport candlestickVisual from './candlestickVisual';\r\nimport candlestickLayout from './candlestickLayout';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(CandlestickView);\r\n registers.registerSeriesModel(CandlestickSeriesModel);\r\n registers.registerPreprocessor(preprocessor);\r\n registers.registerVisual(candlestickVisual);\r\n registers.registerLayout(candlestickLayout);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {createSymbol, normalizeSymbolOffset, normalizeSymbolSize} from '../../util/symbol';\r\nimport {Group, Path} from '../../util/graphic';\r\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states';\r\nimport SymbolClz from './Symbol';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport type { ZRColor, ECElement } from '../../util/types';\r\nimport type Displayable from 'zrender/src/graphic/Displayable';\r\nimport { SymbolDrawItemModelOption } from './SymbolDraw';\r\n\r\ninterface RippleEffectCfg {\r\n showEffectOn?: 'emphasis' | 'render'\r\n rippleScale?: number\r\n brushType?: 'fill' | 'stroke'\r\n period?: number\r\n effectOffset?: number\r\n z?: number\r\n zlevel?: number\r\n symbolType?: string\r\n color?: ZRColor\r\n rippleEffectColor?: ZRColor,\r\n rippleNumber?: number\r\n}\r\n\r\nfunction updateRipplePath(rippleGroup: Group, effectCfg: RippleEffectCfg) {\r\n const color = effectCfg.rippleEffectColor || effectCfg.color;\r\n rippleGroup.eachChild(function (ripplePath: Displayable) {\r\n ripplePath.attr({\r\n z: effectCfg.z,\r\n zlevel: effectCfg.zlevel,\r\n style: {\r\n stroke: effectCfg.brushType === 'stroke' ? color : null,\r\n fill: effectCfg.brushType === 'fill' ? color : null\r\n }\r\n });\r\n });\r\n}\r\n\r\nclass EffectSymbol extends Group {\r\n\r\n private _effectCfg: RippleEffectCfg;\r\n\r\n constructor(data: SeriesData, idx: number) {\r\n super();\r\n\r\n const symbol = new SymbolClz(data, idx);\r\n const rippleGroup = new Group();\r\n this.add(symbol);\r\n this.add(rippleGroup);\r\n\r\n this.updateData(data, idx);\r\n }\r\n\r\n\r\n stopEffectAnimation() {\r\n (this.childAt(1) as Group).removeAll();\r\n }\r\n\r\n startEffectAnimation(effectCfg: RippleEffectCfg) {\r\n const symbolType = effectCfg.symbolType;\r\n const color = effectCfg.color;\r\n const rippleNumber = effectCfg.rippleNumber;\r\n const rippleGroup = this.childAt(1) as Group;\r\n\r\n for (let i = 0; i < rippleNumber; i++) {\r\n // If width/height are set too small (e.g., set to 1) on ios10\r\n // and macOS Sierra, a circle stroke become a rect, no matter what\r\n // the scale is set. So we set width/height as 2. See #4136.\r\n const ripplePath = createSymbol(\r\n symbolType, -1, -1, 2, 2, color\r\n );\r\n ripplePath.attr({\r\n style: {\r\n strokeNoScale: true\r\n },\r\n z2: 99,\r\n silent: true,\r\n scaleX: 0.5,\r\n scaleY: 0.5\r\n });\r\n\r\n const delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset;\r\n ripplePath.animate('', true)\r\n .when(effectCfg.period, {\r\n scaleX: effectCfg.rippleScale / 2,\r\n scaleY: effectCfg.rippleScale / 2\r\n })\r\n .delay(delay)\r\n .start();\r\n ripplePath.animateStyle(true)\r\n .when(effectCfg.period, {\r\n opacity: 0\r\n })\r\n .delay(delay)\r\n .start();\r\n\r\n rippleGroup.add(ripplePath);\r\n }\r\n\r\n updateRipplePath(rippleGroup, effectCfg);\r\n }\r\n\r\n /**\r\n * Update effect symbol\r\n */\r\n updateEffectAnimation(effectCfg: RippleEffectCfg) {\r\n const oldEffectCfg = this._effectCfg;\r\n const rippleGroup = this.childAt(1) as Group;\r\n\r\n // Must reinitialize effect if following configuration changed\r\n const DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber'] as const;\r\n for (let i = 0; i < DIFFICULT_PROPS.length; i++) {\r\n const propName = DIFFICULT_PROPS[i];\r\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\r\n this.stopEffectAnimation();\r\n this.startEffectAnimation(effectCfg);\r\n return;\r\n }\r\n }\r\n\r\n updateRipplePath(rippleGroup, effectCfg);\r\n }\r\n\r\n /**\r\n * Highlight symbol\r\n */\r\n highlight() {\r\n enterEmphasis(this);\r\n }\r\n\r\n /**\r\n * Downplay symbol\r\n */\r\n downplay() {\r\n leaveEmphasis(this);\r\n }\r\n\r\n getSymbolType() {\r\n const symbol = this.childAt(0) as SymbolClz;\r\n return symbol && symbol.getSymbolType();\r\n }\r\n\r\n /**\r\n * Update symbol properties\r\n */\r\n updateData(data: SeriesData, idx: number) {\r\n const seriesModel = data.hostModel;\r\n\r\n (this.childAt(0) as SymbolClz).updateData(data, idx);\r\n\r\n const rippleGroup = this.childAt(1);\r\n const itemModel = data.getItemModel(idx);\r\n const symbolType = data.getItemVisual(idx, 'symbol');\r\n const symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\r\n\r\n const symbolStyle = data.getItemVisual(idx, 'style');\r\n const color = symbolStyle && symbolStyle.fill;\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n\r\n rippleGroup.setScale(symbolSize);\r\n\r\n rippleGroup.traverse(function (ripplePath: Path) {\r\n ripplePath.setStyle('fill', color);\r\n });\r\n\r\n const symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\r\n if (symbolOffset) {\r\n rippleGroup.x = symbolOffset[0];\r\n rippleGroup.y = symbolOffset[1];\r\n }\r\n\r\n const symbolRotate = data.getItemVisual(idx, 'symbolRotate');\r\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n\r\n const effectCfg: RippleEffectCfg = {};\r\n\r\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\r\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\r\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\r\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\r\n effectCfg.effectOffset = idx / data.count();\r\n effectCfg.z = seriesModel.getShallow('z') || 0;\r\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\r\n effectCfg.symbolType = symbolType;\r\n effectCfg.color = color;\r\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\r\n effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']);\r\n\r\n if (effectCfg.showEffectOn === 'render') {\r\n this._effectCfg\r\n ? this.updateEffectAnimation(effectCfg)\r\n : this.startEffectAnimation(effectCfg);\r\n\r\n this._effectCfg = effectCfg;\r\n }\r\n else {\r\n // Not keep old effect config\r\n this._effectCfg = null;\r\n\r\n this.stopEffectAnimation();\r\n\r\n (this as ECElement).onHoverStateChange = (toState) => {\r\n if (toState === 'emphasis') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n this.startEffectAnimation(effectCfg);\r\n }\r\n }\r\n else if (toState === 'normal') {\r\n if (effectCfg.showEffectOn !== 'render') {\r\n this.stopEffectAnimation();\r\n }\r\n }\r\n };\r\n }\r\n\r\n this._effectCfg = effectCfg;\r\n\r\n toggleHoverEmphasis(\r\n this,\r\n emphasisModel.get('focus'),\r\n emphasisModel.get('blurScope'),\r\n emphasisModel.get('disabled')\r\n );\r\n };\r\n\r\n fadeOut(cb: () => void) {\r\n cb && cb();\r\n };\r\n\r\n}\r\n\r\nexport default EffectSymbol;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SymbolDraw from '../helper/SymbolDraw';\r\nimport EffectSymbol from '../helper/EffectSymbol';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\n\r\nimport pointsLayout from '../../layout/points';\r\nimport ChartView from '../../view/Chart';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport EffectScatterSeriesModel from './EffectScatterSeries';\r\nimport { StageHandlerProgressExecutor } from '../../util/types';\r\n\r\nclass EffectScatterView extends ChartView {\r\n static readonly type = 'effectScatter';\r\n readonly type = EffectScatterView.type;\r\n\r\n private _symbolDraw: SymbolDraw;\r\n\r\n init() {\r\n this._symbolDraw = new SymbolDraw(EffectSymbol);\r\n }\r\n\r\n render(seriesModel: EffectScatterSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n const effectSymbolDraw = this._symbolDraw;\r\n effectSymbolDraw.updateData(data, {clipShape: this._getClipShape(seriesModel)});\r\n this.group.add(effectSymbolDraw.group);\r\n }\r\n\r\n _getClipShape(seriesModel: EffectScatterSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const clipArea = coordSys && coordSys.getArea && coordSys.getArea();\r\n return seriesModel.get('clip', true) ? clipArea : null;\r\n }\r\n\r\n updateTransform(seriesModel: EffectScatterSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n\r\n this.group.dirty();\r\n\r\n const res = pointsLayout('').reset(seriesModel, ecModel, api) as StageHandlerProgressExecutor;\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n\r\n this._symbolDraw.updateLayout();\r\n }\r\n\r\n _updateGroupTransform(seriesModel: EffectScatterSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.getRoamTransform) {\r\n this.group.transform = matrix.clone(coordSys.getRoamTransform());\r\n this.group.decomposeTransform();\r\n }\r\n }\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._symbolDraw && this._symbolDraw.remove(true);\r\n }\r\n\r\n}\r\nexport default EffectScatterView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n SeriesOption,\r\n SeriesOnPolarOptionMixin,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnCalendarOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n SeriesOnSingleOptionMixin,\r\n SymbolOptionMixin,\r\n OptionDataValue,\r\n ItemStyleOption,\r\n SeriesLabelOption,\r\n StatesOptionMixin,\r\n SeriesEncodeOptionMixin,\r\n CallbackDataParams,\r\n DefaultEmphasisFocus\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport type { SymbolDrawItemModelOption } from '../helper/SymbolDraw';\r\nimport { BrushCommonSelectorsForSeries } from '../../component/brush/selector';\r\n\r\ntype ScatterDataValue = OptionDataValue | OptionDataValue[];\r\n\r\ninterface EffectScatterStatesOptionMixin {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus\r\n scale?: boolean | number\r\n }\r\n}\r\nexport interface EffectScatterStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\n\r\nexport interface EffectScatterDataItemOption extends SymbolOptionMixin,\r\n EffectScatterStateOption,\r\n StatesOptionMixin {\r\n name?: string\r\n\r\n value?: ScatterDataValue\r\n\r\n rippleEffect?: SymbolDrawItemModelOption['rippleEffect']\r\n}\r\n\r\nexport interface EffectScatterSeriesOption\r\n extends SeriesOption, EffectScatterStatesOptionMixin>,\r\n EffectScatterStateOption,\r\n SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin,\r\n SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin,\r\n SeriesEncodeOptionMixin {\r\n\r\n type?: 'effectScatter'\r\n\r\n coordinateSystem?: string\r\n\r\n effectType?: 'ripple'\r\n\r\n /**\r\n * When to show the effect\r\n */\r\n showEffectOn?: 'render' | 'emphasis'\r\n clip?: boolean\r\n\r\n /**\r\n * Ripple effect config\r\n */\r\n rippleEffect?: SymbolDrawItemModelOption['rippleEffect']\r\n\r\n data?: (EffectScatterDataItemOption | ScatterDataValue)[]\r\n}\r\nclass EffectScatterSeriesModel extends SeriesModel {\r\n static readonly type = 'series.effectScatter';\r\n type = EffectScatterSeriesModel.type;\r\n\r\n static readonly dependencies = ['grid', 'polar'];\r\n\r\n hasSymbolVisual = true;\r\n\r\n getInitialData(option: EffectScatterSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesData(null, this, {useEncodeDefaulter: true});\r\n }\r\n\r\n brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries): boolean {\r\n return selectors.point(data.getItemLayout(dataIndex));\r\n }\r\n\r\n static defaultOption: EffectScatterSeriesOption = {\r\n coordinateSystem: 'cartesian2d',\r\n // zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n\r\n effectType: 'ripple',\r\n\r\n progressive: 0,\r\n\r\n // When to show the effect, option: 'render'|'emphasis'\r\n showEffectOn: 'render',\r\n clip: true,\r\n\r\n // Ripple effect config\r\n rippleEffect: {\r\n period: 4,\r\n // Scale of ripple\r\n scale: 2.5,\r\n // Brush type can be fill or stroke\r\n brushType: 'fill',\r\n // Ripple number\r\n number: 3\r\n },\r\n\r\n universalTransition: {\r\n divideShape: 'clone'\r\n },\r\n // Cartesian coordinate system\r\n // xAxisIndex: 0,\r\n // yAxisIndex: 0,\r\n\r\n // Polar coordinate system\r\n // polarIndex: 0,\r\n\r\n // Geo coordinate system\r\n // geoIndex: 0,\r\n\r\n // symbol: null, // \u56FE\u5F62\u7C7B\u578B\r\n symbolSize: 10 // \u56FE\u5F62\u5927\u5C0F\uFF0C\u534A\u5BBD\uFF08\u534A\u5F84\uFF09\u53C2\u6570\uFF0C\u5F53\u56FE\u5F62\u4E3A\u65B9\u5411\u6216\u83F1\u5F62\u5219\u603B\u5BBD\u5EA6\u4E3AsymbolSize * 2\r\n // symbolRotate: null, // \u56FE\u5F62\u65CB\u8F6C\u63A7\u5236\r\n\r\n // itemStyle: {\r\n // opacity: 1\r\n // }\r\n };\r\n}\r\n\r\nexport default EffectScatterSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport EffectScatterView from './EffectScatterView';\r\nimport EffectScatterSeriesModel from './EffectScatterSeries';\r\n\r\nimport layoutPoints from '../../layout/points';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(EffectScatterView);\r\n registers.registerSeriesModel(EffectScatterSeriesModel);\r\n registers.registerLayout(layoutPoints('effectScatter'));\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Provide effect for line\r\n */\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport Line from './Line';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {createSymbol} from '../../util/symbol';\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport * as curveUtil from 'zrender/src/core/curve';\r\nimport type SeriesData from '../../data/SeriesData';\r\nimport { LineDrawSeriesScope, LineDrawModelOption } from './LineDraw';\r\nimport Model from '../../model/Model';\r\nimport { ColorString } from '../../util/types';\r\n\r\nexport type ECSymbolOnEffectLine = ReturnType & {\r\n __t: number\r\n __lastT: number\r\n __p1: number[]\r\n __p2: number[]\r\n __cp1: number[]\r\n};\r\nclass EffectLine extends graphic.Group {\r\n\r\n private _symbolType: string;\r\n\r\n private _period: number;\r\n\r\n private _loop: boolean;\r\n\r\n private _roundTrip: boolean;\r\n\r\n private _symbolScale: number[];\r\n\r\n constructor(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n super();\r\n this.add(this.createLine(lineData, idx, seriesScope));\r\n\r\n this._updateEffectSymbol(lineData, idx);\r\n }\r\n\r\n createLine(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope): graphic.Group {\r\n return new Line(lineData, idx, seriesScope);\r\n }\r\n\r\n private _updateEffectSymbol(lineData: SeriesData, idx: number) {\r\n const itemModel = lineData.getItemModel(idx);\r\n const effectModel = itemModel.getModel('effect');\r\n let size = effectModel.get('symbolSize');\r\n const symbolType = effectModel.get('symbol');\r\n if (!zrUtil.isArray(size)) {\r\n size = [size, size];\r\n }\r\n\r\n const lineStyle = lineData.getItemVisual(idx, 'style');\r\n const color = effectModel.get('color') || (lineStyle && lineStyle.stroke);\r\n let symbol = this.childAt(1) as ECSymbolOnEffectLine;\r\n\r\n if (this._symbolType !== symbolType) {\r\n // Remove previous\r\n this.remove(symbol);\r\n\r\n symbol = createSymbol(\r\n symbolType, -0.5, -0.5, 1, 1, color\r\n ) as ECSymbolOnEffectLine;\r\n symbol.z2 = 100;\r\n symbol.culling = true;\r\n\r\n this.add(symbol);\r\n }\r\n\r\n // Symbol may be removed if loop is false\r\n if (!symbol) {\r\n return;\r\n }\r\n\r\n // Shadow color is same with color in default\r\n symbol.setStyle('shadowColor', color as ColorString);\r\n symbol.setStyle(effectModel.getItemStyle(['color']));\r\n\r\n symbol.scaleX = size[0];\r\n symbol.scaleY = size[1];\r\n\r\n symbol.setColor(color);\r\n\r\n this._symbolType = symbolType;\r\n this._symbolScale = size;\r\n\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n }\r\n\r\n private _updateEffectAnimation(\r\n lineData: SeriesData,\r\n effectModel: Model,\r\n idx: number\r\n ) {\r\n\r\n const symbol = this.childAt(1) as ECSymbolOnEffectLine;\r\n if (!symbol) {\r\n return;\r\n }\r\n\r\n const points = lineData.getItemLayout(idx);\r\n\r\n let period = effectModel.get('period') * 1000;\r\n const loop = effectModel.get('loop');\r\n const roundTrip = effectModel.get('roundTrip');\r\n const constantSpeed = effectModel.get('constantSpeed');\r\n const delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\r\n return idx / lineData.count() * period / 3;\r\n });\r\n\r\n // Ignore when updating\r\n symbol.ignore = true;\r\n\r\n this._updateAnimationPoints(symbol, points);\r\n\r\n if (constantSpeed > 0) {\r\n period = this._getLineLength(symbol) / constantSpeed * 1000;\r\n }\r\n\r\n if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) {\r\n symbol.stopAnimation();\r\n let delayNum: number;\r\n if (zrUtil.isFunction(delayExpr)) {\r\n delayNum = delayExpr(idx);\r\n }\r\n else {\r\n delayNum = delayExpr;\r\n }\r\n if (symbol.__t > 0) {\r\n delayNum = -period * symbol.__t;\r\n }\r\n\r\n this._animateSymbol(\r\n symbol, period, delayNum, loop, roundTrip\r\n );\r\n }\r\n\r\n this._period = period;\r\n this._loop = loop;\r\n this._roundTrip = roundTrip;\r\n }\r\n\r\n private _animateSymbol(\r\n symbol: ECSymbolOnEffectLine, period: number, delayNum: number, loop: boolean, roundTrip: boolean) {\r\n if (period > 0) {\r\n symbol.__t = 0;\r\n const self = this;\r\n const animator = symbol.animate('', loop)\r\n .when(roundTrip ? period * 2 : period, {\r\n __t: roundTrip ? 2 : 1\r\n })\r\n .delay(delayNum)\r\n .during(function () {\r\n self._updateSymbolPosition(symbol);\r\n });\r\n if (!loop) {\r\n animator.done(function () {\r\n self.remove(symbol);\r\n });\r\n }\r\n animator.start();\r\n }\r\n }\r\n\r\n protected _getLineLength(symbol: ECSymbolOnEffectLine) {\r\n // Not so accurate\r\n return (vec2.dist(symbol.__p1, symbol.__cp1)\r\n + vec2.dist(symbol.__cp1, symbol.__p2));\r\n }\r\n\r\n protected _updateAnimationPoints(symbol: ECSymbolOnEffectLine, points: number[][]) {\r\n symbol.__p1 = points[0];\r\n symbol.__p2 = points[1];\r\n symbol.__cp1 = points[2] || [\r\n (points[0][0] + points[1][0]) / 2,\r\n (points[0][1] + points[1][1]) / 2\r\n ];\r\n }\r\n\r\n updateData(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n (this.childAt(0) as Line).updateData(lineData, idx, seriesScope);\r\n this._updateEffectSymbol(lineData, idx);\r\n }\r\n\r\n protected _updateSymbolPosition(symbol: ECSymbolOnEffectLine) {\r\n const p1 = symbol.__p1;\r\n const p2 = symbol.__p2;\r\n const cp1 = symbol.__cp1;\r\n const t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\r\n const pos = [symbol.x, symbol.y];\r\n const lastPos = pos.slice();\r\n const quadraticAt = curveUtil.quadraticAt;\r\n const quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\r\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\r\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t);\r\n\r\n // Tangent\r\n const tx = symbol.__t < 1 ? quadraticDerivativeAt(p1[0], cp1[0], p2[0], t)\r\n : quadraticDerivativeAt(p2[0], cp1[0], p1[0], 1 - t);\r\n const ty = symbol.__t < 1 ? quadraticDerivativeAt(p1[1], cp1[1], p2[1], t)\r\n : quadraticDerivativeAt(p2[1], cp1[1], p1[1], 1 - t);\r\n\r\n\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\r\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\r\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\r\n symbol.scaleY = vec2.dist(lastPos, pos) * 1.05;\r\n // make sure the last segment render within endPoint\r\n if (t === 1) {\r\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\r\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\r\n }\r\n }\r\n else if (symbol.__lastT === 1) {\r\n // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\r\n symbol.scaleY = 2 * vec2.dist(p1, pos);\r\n }\r\n else {\r\n symbol.scaleY = this._symbolScale[1];\r\n }\r\n }\r\n symbol.__lastT = symbol.__t;\r\n symbol.ignore = false;\r\n symbol.x = pos[0];\r\n symbol.y = pos[1];\r\n }\r\n\r\n\r\n updateLayout(lineData: SeriesData, idx: number) {\r\n (this.childAt(0) as Line).updateLayout(lineData, idx);\r\n\r\n const effectModel = lineData.getItemModel(idx).getModel('effect');\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n }\r\n}\r\nexport default EffectLine;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport { toggleHoverEmphasis } from '../../util/states';\r\nimport type { LineDrawSeriesScope, LineDrawModelOption } from './LineDraw';\r\nimport type SeriesData from '../../data/SeriesData';\r\nimport { BlurScope, DefaultEmphasisFocus } from '../../util/types';\r\n\r\nclass Polyline extends graphic.Group {\r\n constructor(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n super();\r\n this._createPolyline(lineData, idx, seriesScope);\r\n }\r\n\r\n private _createPolyline(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n // let seriesModel = lineData.hostModel;\r\n const points = lineData.getItemLayout(idx);\r\n\r\n const line = new graphic.Polyline({\r\n shape: {\r\n points: points\r\n }\r\n });\r\n\r\n this.add(line);\r\n\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n\r\n updateData(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n const seriesModel = lineData.hostModel;\r\n\r\n const line = this.childAt(0) as graphic.Polyline;\r\n const target = {\r\n shape: {\r\n points: lineData.getItemLayout(idx) as number[][]\r\n }\r\n };\r\n graphic.updateProps(line, target, seriesModel, idx);\r\n\r\n this._updateCommonStl(lineData, idx, seriesScope);\r\n };\r\n\r\n _updateCommonStl(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n const line = this.childAt(0) as graphic.Polyline;\r\n const itemModel = lineData.getItemModel(idx);\r\n\r\n\r\n let emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\r\n let focus = (seriesScope && seriesScope.focus) as DefaultEmphasisFocus;\r\n let blurScope = (seriesScope && seriesScope.blurScope) as BlurScope;\r\n let emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\r\n\r\n\r\n if (!seriesScope || lineData.hasItemOption) {\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\r\n emphasisDisabled = emphasisModel.get('disabled');\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n }\r\n line.useStyle(lineData.getItemVisual(idx, 'style'));\r\n line.style.fill = null;\r\n line.style.strokeNoScale = true;\r\n\r\n const lineEmphasisState = line.ensureState('emphasis');\r\n lineEmphasisState.style = emphasisLineStyle;\r\n\r\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\r\n };\r\n\r\n updateLayout(lineData: SeriesData, idx: number) {\r\n const polyline = this.childAt(0) as graphic.Polyline;\r\n polyline.setShape('points', lineData.getItemLayout(idx));\r\n };\r\n\r\n}\r\n\r\nexport default Polyline;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Polyline from './Polyline';\r\nimport EffectLine, {ECSymbolOnEffectLine} from './EffectLine';\r\nimport * as vec2 from 'zrender/src/core/vector';\r\nimport { LineDrawSeriesScope } from './LineDraw';\r\nimport SeriesData from '../../data/SeriesData';\r\n\r\n\r\nclass EffectPolyline extends EffectLine {\r\n private _lastFrame = 0;\r\n private _lastFramePercent = 0;\r\n private _length: number;\r\n\r\n private _points: number[][];\r\n private _offsets: number[];\r\n\r\n // Override\r\n createLine(lineData: SeriesData, idx: number, seriesScope: LineDrawSeriesScope) {\r\n return new Polyline(lineData, idx, seriesScope);\r\n };\r\n\r\n // Override\r\n protected _updateAnimationPoints(symbol: ECSymbolOnEffectLine, points: number[][]) {\r\n this._points = points;\r\n const accLenArr = [0];\r\n let len = 0;\r\n for (let i = 1; i < points.length; i++) {\r\n const p1 = points[i - 1];\r\n const p2 = points[i];\r\n len += vec2.dist(p1, p2);\r\n accLenArr.push(len);\r\n }\r\n if (len === 0) {\r\n this._length = 0;\r\n return;\r\n }\r\n\r\n for (let i = 0; i < accLenArr.length; i++) {\r\n accLenArr[i] /= len;\r\n }\r\n this._offsets = accLenArr;\r\n this._length = len;\r\n };\r\n\r\n // Override\r\n protected _getLineLength() {\r\n return this._length;\r\n };\r\n\r\n // Override\r\n protected _updateSymbolPosition(symbol: ECSymbolOnEffectLine) {\r\n const t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\r\n const points = this._points;\r\n const offsets = this._offsets;\r\n const len = points.length;\r\n\r\n if (!offsets) {\r\n // Has length 0\r\n return;\r\n }\r\n\r\n const lastFrame = this._lastFrame;\r\n let frame: number;\r\n\r\n if (t < this._lastFramePercent) {\r\n // Start from the next frame\r\n // PENDING start from lastFrame ?\r\n const start = Math.min(lastFrame + 1, len - 1);\r\n for (frame = start; frame >= 0; frame--) {\r\n if (offsets[frame] <= t) {\r\n break;\r\n }\r\n }\r\n // PENDING really need to do this ?\r\n frame = Math.min(frame, len - 2);\r\n }\r\n else {\r\n for (frame = lastFrame; frame < len; frame++) {\r\n if (offsets[frame] > t) {\r\n break;\r\n }\r\n }\r\n frame = Math.min(frame - 1, len - 2);\r\n }\r\n\r\n const p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\r\n const p0 = points[frame];\r\n const p1 = points[frame + 1];\r\n symbol.x = p0[0] * (1 - p) + p * p1[0];\r\n symbol.y = p0[1] * (1 - p) + p * p1[1];\r\n\r\n const tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0];\r\n const ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1];\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\r\n\r\n this._lastFrame = frame;\r\n this._lastFramePercent = t;\r\n\r\n symbol.ignore = false;\r\n };\r\n\r\n}\r\n\r\nexport default EffectPolyline;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// TODO Batch by color\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport * as lineContain from 'zrender/src/contain/line';\r\nimport * as quadraticContain from 'zrender/src/contain/quadratic';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { StageHandlerProgressParams, LineStyleOption, ColorString } from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport { getECData } from '../../util/innerStore';\r\nimport Element from 'zrender/src/Element';\r\n\r\nclass LargeLinesPathShape {\r\n polyline = false;\r\n curveness = 0;\r\n segs: ArrayLike = [];\r\n}\r\n\r\ninterface LargeLinesPathProps extends PathProps {\r\n shape?: Partial\r\n}\r\n\r\ninterface LargeLinesCommonOption {\r\n polyline?: boolean\r\n lineStyle?: LineStyleOption & {\r\n curveness?: number\r\n }\r\n}\r\n\r\n/**\r\n * Data which can support large lines.\r\n */\r\ntype LargeLinesData = SeriesData & {\r\n seriesIndex?: number\r\n}>;\r\n\r\nclass LargeLinesPath extends graphic.Path {\r\n shape: LargeLinesPathShape;\r\n\r\n __startIndex: number;\r\n private _off: number = 0;\r\n\r\n hoverDataIdx: number = -1;\r\n\r\n notClear: boolean;\r\n\r\n constructor(opts?: LargeLinesPathProps) {\r\n super(opts);\r\n }\r\n\r\n reset() {\r\n this.notClear = false;\r\n this._off = 0;\r\n }\r\n\r\n getDefaultStyle() {\r\n return {\r\n stroke: '#000',\r\n fill: null as ColorString\r\n };\r\n }\r\n\r\n getDefaultShape() {\r\n return new LargeLinesPathShape();\r\n }\r\n\r\n buildPath(ctx: CanvasRenderingContext2D, shape: LargeLinesPathShape) {\r\n const segs = shape.segs;\r\n const curveness = shape.curveness;\r\n let i;\r\n\r\n if (shape.polyline) {\r\n for (i = this._off; i < segs.length;) {\r\n const count = segs[i++];\r\n if (count > 0) {\r\n ctx.moveTo(segs[i++], segs[i++]);\r\n for (let k = 1; k < count; k++) {\r\n ctx.lineTo(segs[i++], segs[i++]);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n for (i = this._off; i < segs.length;) {\r\n const x0 = segs[i++];\r\n const y0 = segs[i++];\r\n const x1 = segs[i++];\r\n const y1 = segs[i++];\r\n ctx.moveTo(x0, y0);\r\n if (curveness > 0) {\r\n const x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n const y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n ctx.quadraticCurveTo(x2, y2, x1, y1);\r\n }\r\n else {\r\n ctx.lineTo(x1, y1);\r\n }\r\n }\r\n }\r\n if (this.incremental) {\r\n this._off = i;\r\n this.notClear = true;\r\n }\r\n }\r\n\r\n findDataIndex(x: number, y: number) {\r\n\r\n const shape = this.shape;\r\n const segs = shape.segs;\r\n const curveness = shape.curveness;\r\n const lineWidth = this.style.lineWidth;\r\n\r\n if (shape.polyline) {\r\n let dataIndex = 0;\r\n for (let i = 0; i < segs.length;) {\r\n const count = segs[i++];\r\n if (count > 0) {\r\n const x0 = segs[i++];\r\n const y0 = segs[i++];\r\n for (let k = 1; k < count; k++) {\r\n const x1 = segs[i++];\r\n const y1 = segs[i++];\r\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\r\n return dataIndex;\r\n }\r\n }\r\n }\r\n\r\n dataIndex++;\r\n }\r\n }\r\n else {\r\n let dataIndex = 0;\r\n for (let i = 0; i < segs.length;) {\r\n const x0 = segs[i++];\r\n const y0 = segs[i++];\r\n const x1 = segs[i++];\r\n const y1 = segs[i++];\r\n if (curveness > 0) {\r\n const x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\r\n const y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\r\n\r\n if (quadraticContain.containStroke(\r\n x0, y0, x2, y2, x1, y1, lineWidth, x, y\r\n )) {\r\n return dataIndex;\r\n }\r\n }\r\n else {\r\n if (lineContain.containStroke(\r\n x0, y0, x1, y1, lineWidth, x, y\r\n )) {\r\n return dataIndex;\r\n }\r\n }\r\n\r\n dataIndex++;\r\n }\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n contain(x: number, y: number): boolean {\r\n const localPos = this.transformCoordToLocal(x, y);\r\n const rect = this.getBoundingRect();\r\n x = localPos[0];\r\n y = localPos[1];\r\n\r\n if (rect.contain(x, y)) {\r\n // Cache found data index.\r\n const dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\r\n return dataIdx >= 0;\r\n }\r\n this.hoverDataIdx = -1;\r\n return false;\r\n }\r\n\r\n getBoundingRect() {\r\n // Ignore stroke for large symbol draw.\r\n let rect = this._rect;\r\n if (!rect) {\r\n const shape = this.shape;\r\n const points = shape.segs;\r\n let minX = Infinity;\r\n let minY = Infinity;\r\n let maxX = -Infinity;\r\n let maxY = -Infinity;\r\n for (let i = 0; i < points.length;) {\r\n const x = points[i++];\r\n const y = points[i++];\r\n minX = Math.min(x, minX);\r\n maxX = Math.max(x, maxX);\r\n minY = Math.min(y, minY);\r\n maxY = Math.max(y, maxY);\r\n }\r\n\r\n rect = this._rect = new graphic.BoundingRect(minX, minY, maxX, maxY);\r\n }\r\n return rect;\r\n }\r\n}\r\n\r\nclass LargeLineDraw {\r\n group = new graphic.Group();\r\n private _newAdded: LargeLinesPath[];\r\n /**\r\n * Update symbols draw by new data\r\n */\r\n updateData(data: LargeLinesData) {\r\n this._clear();\r\n\r\n const lineEl = this._create();\r\n lineEl.setShape({\r\n segs: data.getLayout('linesPoints')\r\n });\r\n\r\n this._setCommon(lineEl, data);\r\n };\r\n\r\n /**\r\n * @override\r\n */\r\n incrementalPrepareUpdate(data: LargeLinesData) {\r\n this.group.removeAll();\r\n this._clear();\r\n };\r\n\r\n /**\r\n * @override\r\n */\r\n incrementalUpdate(taskParams: StageHandlerProgressParams, data: LargeLinesData) {\r\n const lastAdded = this._newAdded[0];\r\n const linePoints = data.getLayout('linesPoints');\r\n\r\n const oldSegs = lastAdded && lastAdded.shape.segs;\r\n\r\n // Merging the exists. Each element has 1e4 points.\r\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\r\n if (oldSegs && oldSegs.length < 2e4) {\r\n const oldLen = oldSegs.length;\r\n const newSegs = new Float32Array(oldLen + linePoints.length);\r\n // Concat two array\r\n newSegs.set(oldSegs);\r\n newSegs.set(linePoints, oldLen);\r\n lastAdded.setShape({\r\n segs: newSegs\r\n });\r\n }\r\n else {\r\n // Clear\r\n this._newAdded = [];\r\n\r\n const lineEl = this._create();\r\n lineEl.incremental = true;\r\n lineEl.setShape({\r\n segs: linePoints\r\n });\r\n this._setCommon(lineEl, data);\r\n lineEl.__startIndex = taskParams.start;\r\n }\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n remove() {\r\n this._clear();\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n this._newAdded[0] && cb(this._newAdded[0]);\r\n }\r\n\r\n private _create() {\r\n const lineEl = new LargeLinesPath({\r\n cursor: 'default',\r\n ignoreCoarsePointer: true\r\n });\r\n this._newAdded.push(lineEl);\r\n this.group.add(lineEl);\r\n return lineEl;\r\n }\r\n\r\n\r\n private _setCommon(lineEl: LargeLinesPath, data: LargeLinesData, isIncremental?: boolean) {\r\n const hostModel = data.hostModel;\r\n\r\n lineEl.setShape({\r\n polyline: hostModel.get('polyline'),\r\n curveness: hostModel.get(['lineStyle', 'curveness'])\r\n });\r\n\r\n lineEl.useStyle(\r\n hostModel.getModel('lineStyle').getLineStyle()\r\n );\r\n lineEl.style.strokeNoScale = true;\r\n\r\n const style = data.getVisual('style');\r\n if (style && style.stroke) {\r\n lineEl.setStyle('stroke', style.stroke);\r\n }\r\n lineEl.setStyle('fill', null);\r\n\r\n const ecData = getECData(lineEl);\r\n // Enable tooltip\r\n // PENDING May have performance issue when path is extremely large\r\n ecData.seriesIndex = hostModel.seriesIndex;\r\n lineEl.on('mousemove', function (e) {\r\n ecData.dataIndex = null;\r\n const dataIndex = lineEl.hoverDataIdx;\r\n if (dataIndex > 0) {\r\n // Provide dataIndex for tooltip\r\n ecData.dataIndex = dataIndex + lineEl.__startIndex;\r\n }\r\n });\r\n };\r\n\r\n private _clear() {\r\n this._newAdded = [];\r\n this.group.removeAll();\r\n };\r\n\r\n\r\n}\r\n\r\nexport default LargeLineDraw;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/* global Float32Array */\r\n\r\nimport createRenderPlanner from '../helper/createRenderPlanner';\r\nimport { StageHandler } from '../../util/types';\r\nimport LinesSeriesModel, {LinesDataItemOption} from './LinesSeries';\r\nimport { error } from '../../util/log';\r\n\r\nconst linesLayout: StageHandler = {\r\n seriesType: 'lines',\r\n\r\n plan: createRenderPlanner(),\r\n\r\n reset: function (seriesModel: LinesSeriesModel) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (!coordSys) {\r\n if (__DEV__) {\r\n error('The lines series must have a coordinate system.');\r\n }\r\n return;\r\n }\r\n const isPolyline = seriesModel.get('polyline');\r\n const isLarge = seriesModel.pipelineContext.large;\r\n return {\r\n progress(params, lineData) {\r\n const lineCoords: number[][] = [];\r\n if (isLarge) {\r\n let points;\r\n const segCount = params.end - params.start;\r\n if (isPolyline) {\r\n let totalCoordsCount = 0;\r\n for (let i = params.start; i < params.end; i++) {\r\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\r\n }\r\n points = new Float32Array(segCount + totalCoordsCount * 2);\r\n }\r\n else {\r\n points = new Float32Array(segCount * 4);\r\n }\r\n\r\n let offset = 0;\r\n let pt: number[] = [];\r\n for (let i = params.start; i < params.end; i++) {\r\n const len = seriesModel.getLineCoords(i, lineCoords);\r\n if (isPolyline) {\r\n points[offset++] = len;\r\n }\r\n for (let k = 0; k < len; k++) {\r\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\r\n points[offset++] = pt[0];\r\n points[offset++] = pt[1];\r\n }\r\n }\r\n\r\n lineData.setLayout('linesPoints', points);\r\n }\r\n else {\r\n for (let i = params.start; i < params.end; i++) {\r\n const itemModel = lineData.getItemModel(i);\r\n const len = seriesModel.getLineCoords(i, lineCoords);\r\n\r\n const pts = [];\r\n if (isPolyline) {\r\n for (let j = 0; j < len; j++) {\r\n pts.push(coordSys.dataToPoint(lineCoords[j]));\r\n }\r\n }\r\n else {\r\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\r\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\r\n\r\n const curveness = itemModel.get(['lineStyle', 'curveness']);\r\n if (+curveness) {\r\n pts[2] = [\r\n (pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness,\r\n (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness\r\n ];\r\n }\r\n }\r\n lineData.setItemLayout(i, pts);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n};\r\n\r\nexport default linesLayout;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport LineDraw from '../helper/LineDraw';\r\nimport EffectLine from '../helper/EffectLine';\r\nimport Line from '../helper/Line';\r\nimport Polyline from '../helper/Polyline';\r\nimport EffectPolyline from '../helper/EffectPolyline';\r\nimport LargeLineDraw from '../helper/LargeLineDraw';\r\nimport linesLayout from './linesLayout';\r\nimport {createClipPath} from '../helper/createClipPathFromCoordSys';\r\nimport ChartView from '../../view/Chart';\r\nimport LinesSeriesModel from './LinesSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport CanvasPainter from 'zrender/src/canvas/Painter';\r\nimport { StageHandlerProgressParams, StageHandlerProgressExecutor } from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport type Polar from '../../coord/polar/Polar';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport Element from 'zrender/src/Element';\r\n\r\nclass LinesView extends ChartView {\r\n\r\n static readonly type = 'lines';\r\n readonly type = LinesView.type;\r\n\r\n private _lastZlevel: number;\r\n private _finished: boolean;\r\n\r\n private _lineDraw: LineDraw | LargeLineDraw;\r\n\r\n private _hasEffet: boolean;\r\n private _isPolyline: boolean;\r\n private _isLargeDraw: boolean;\r\n\r\n render(seriesModel: LinesSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n\r\n const lineDraw = this._updateLineDraw(data, seriesModel);\r\n\r\n const zlevel = seriesModel.get('zlevel');\r\n const trailLength = seriesModel.get(['effect', 'trailLength']);\r\n\r\n const zr = api.getZr();\r\n // Avoid the drag cause ghost shadow\r\n // FIXME Better way ?\r\n // SVG doesn't support\r\n const isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg) {\r\n (zr.painter as CanvasPainter).getLayer(zlevel).clear(true);\r\n }\r\n // Config layer with motion blur\r\n if (this._lastZlevel != null && !isSvg) {\r\n zr.configLayer(this._lastZlevel, {\r\n motionBlur: false\r\n });\r\n }\r\n if (this._showEffect(seriesModel) && trailLength > 0) {\r\n if (!isSvg) {\r\n zr.configLayer(zlevel, {\r\n motionBlur: true,\r\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\r\n });\r\n }\r\n else if (__DEV__) {\r\n console.warn('SVG render mode doesn\\'t support lines with trail effect');\r\n }\r\n }\r\n\r\n lineDraw.updateData(data as SeriesData);\r\n\r\n const clipPath = seriesModel.get('clip', true) && createClipPath(\r\n (seriesModel.coordinateSystem as Polar | Cartesian2D), false, seriesModel\r\n );\r\n if (clipPath) {\r\n this.group.setClipPath(clipPath);\r\n }\r\n else {\r\n this.group.removeClipPath();\r\n }\r\n\r\n this._lastZlevel = zlevel;\r\n\r\n this._finished = true;\r\n }\r\n\r\n incrementalPrepareRender(seriesModel: LinesSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n\r\n const lineDraw = this._updateLineDraw(data, seriesModel);\r\n\r\n lineDraw.incrementalPrepareUpdate(data as any);\r\n\r\n this._clearLayer(api);\r\n\r\n this._finished = false;\r\n }\r\n\r\n incrementalRender(\r\n taskParams: StageHandlerProgressParams,\r\n seriesModel: LinesSeriesModel,\r\n ecModel: GlobalModel\r\n ) {\r\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData() as any);\r\n\r\n this._finished = taskParams.end === seriesModel.getData().count();\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n this._lineDraw && this._lineDraw.eachRendered(cb);\r\n }\r\n\r\n updateTransform(seriesModel: LinesSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n const pipelineContext = seriesModel.pipelineContext;\r\n\r\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\r\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\r\n return {\r\n update: true\r\n } as const;\r\n }\r\n else {\r\n // TODO Use same logic with ScatterView.\r\n // Manually update layout\r\n const res = linesLayout.reset(seriesModel, ecModel, api) as StageHandlerProgressExecutor;\r\n if (res.progress) {\r\n res.progress({\r\n start: 0,\r\n end: data.count(),\r\n count: data.count()\r\n }, data);\r\n }\r\n // Not in large mode\r\n (this._lineDraw as LineDraw).updateLayout();\r\n this._clearLayer(api);\r\n }\r\n }\r\n\r\n _updateLineDraw(data: SeriesData, seriesModel: LinesSeriesModel) {\r\n let lineDraw = this._lineDraw;\r\n const hasEffect = this._showEffect(seriesModel);\r\n const isPolyline = !!seriesModel.get('polyline');\r\n const pipelineContext = seriesModel.pipelineContext;\r\n const isLargeDraw = pipelineContext.large;\r\n\r\n if (__DEV__) {\r\n if (hasEffect && isLargeDraw) {\r\n console.warn('Large lines not support effect');\r\n }\r\n }\r\n if (!lineDraw\r\n || hasEffect !== this._hasEffet\r\n || isPolyline !== this._isPolyline\r\n || isLargeDraw !== this._isLargeDraw\r\n ) {\r\n if (lineDraw) {\r\n lineDraw.remove();\r\n }\r\n lineDraw = this._lineDraw = isLargeDraw\r\n ? new LargeLineDraw()\r\n : new LineDraw(\r\n isPolyline\r\n ? (hasEffect ? EffectPolyline : Polyline)\r\n : (hasEffect ? EffectLine : Line)\r\n );\r\n this._hasEffet = hasEffect;\r\n this._isPolyline = isPolyline;\r\n this._isLargeDraw = isLargeDraw;\r\n }\r\n\r\n this.group.add(lineDraw.group);\r\n\r\n return lineDraw;\r\n }\r\n\r\n private _showEffect(seriesModel: LinesSeriesModel) {\r\n return !!seriesModel.get(['effect', 'show']);\r\n }\r\n\r\n _clearLayer(api: ExtensionAPI) {\r\n // Not use motion when dragging or zooming\r\n const zr = api.getZr();\r\n const isSvg = zr.painter.getType() === 'svg';\r\n if (!isSvg && this._lastZlevel != null) {\r\n (zr.painter as CanvasPainter).getLayer(this._lastZlevel).clear(true);\r\n }\r\n }\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._lineDraw && this._lineDraw.remove();\r\n this._lineDraw = null;\r\n // Clear motion when lineDraw is removed\r\n this._clearLayer(api);\r\n }\r\n\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.remove(ecModel, api);\r\n }\r\n\r\n}\r\n\r\nexport default LinesView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/* global Uint32Array, Float64Array, Float32Array */\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { concatArray, mergeAll, map, isNumber } from 'zrender/src/core/util';\r\nimport CoordinateSystem from '../../core/CoordinateSystem';\r\nimport {\r\n SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n SeriesOnPolarOptionMixin,\r\n SeriesOnCalendarOptionMixin,\r\n SeriesLargeOptionMixin,\r\n LineStyleOption,\r\n OptionDataValue,\r\n StatesOptionMixin,\r\n SeriesLineLabelOption,\r\n DimensionDefinitionLoose,\r\n DefaultStatesMixinEmphasis,\r\n ZRColor,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport type { LineDrawModelOption } from '../helper/LineDraw';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\r\n\r\nconst Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\r\nconst Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\r\n\r\nfunction compatEc2(seriesOpt: LinesSeriesOption) {\r\n const data = seriesOpt.data;\r\n if (data && data[0] && (data as LegacyDataItemOption[][])[0][0] && (data as LegacyDataItemOption[][])[0][0].coord) {\r\n if (__DEV__) {\r\n console.warn('Lines data configuration has been changed to'\r\n + ' { coords:[[1,2],[2,3]] }');\r\n }\r\n seriesOpt.data = map(data as LegacyDataItemOption[][], function (itemOpt) {\r\n const coords = [\r\n itemOpt[0].coord, itemOpt[1].coord\r\n ];\r\n const target: LinesDataItemOption = {\r\n coords: coords\r\n };\r\n if (itemOpt[0].name) {\r\n target.fromName = itemOpt[0].name;\r\n }\r\n if (itemOpt[1].name) {\r\n target.toName = itemOpt[1].name;\r\n }\r\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\r\n });\r\n }\r\n}\r\n\r\ntype LinesCoords = number[][];\r\n\r\ntype LinesValue = OptionDataValue | OptionDataValue[];\r\n\r\ninterface LinesLineStyleOption extends LineStyleOption {\r\n curveness?: number\r\n}\r\n\r\n// @deprecated\r\ninterface LegacyDataItemOption {\r\n coord: number[]\r\n name: string\r\n}\r\n\r\ninterface LinesStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\nexport interface LinesStateOption {\r\n lineStyle?: LinesLineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>\r\n label?: SeriesLineLabelOption\r\n}\r\n\r\nexport interface LinesDataItemOption extends LinesStateOption,\r\n StatesOptionMixin {\r\n name?: string\r\n\r\n fromName?: string\r\n toName?: string\r\n\r\n symbol?: string[] | string\r\n symbolSize?: number[] | number\r\n\r\n coords?: LinesCoords\r\n\r\n value?: LinesValue\r\n\r\n effect?: LineDrawModelOption['effect']\r\n}\r\n\r\nexport interface LinesSeriesOption\r\n extends SeriesOption, LinesStateOption,\r\n SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnPolarOptionMixin,\r\n SeriesOnCalendarOptionMixin, SeriesLargeOptionMixin {\r\n\r\n type?: 'lines'\r\n\r\n coordinateSystem?: string\r\n\r\n symbol?: string[] | string\r\n symbolSize?: number[] | number\r\n\r\n effect?: LineDrawModelOption['effect']\r\n\r\n /**\r\n * If lines are polyline\r\n * polyline not support curveness, label, animation\r\n */\r\n polyline?: boolean\r\n /**\r\n * If clip the overflow.\r\n * Available when coordinateSystem is cartesian or polar.\r\n */\r\n clip?: boolean\r\n\r\n data?: LinesDataItemOption[]\r\n // Stored as a flat array. In format\r\n // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |\r\n | ArrayLike\r\n\r\n dimensions?: DimensionDefinitionLoose | DimensionDefinitionLoose[]\r\n}\r\n\r\nclass LinesSeriesModel extends SeriesModel {\r\n\r\n static readonly type = 'series.lines';\r\n readonly type = LinesSeriesModel.type;\r\n\r\n static readonly dependencies = ['grid', 'polar', 'geo', 'calendar'];\r\n\r\n visualStyleAccessPath = 'lineStyle';\r\n visualDrawType = 'stroke' as const;\r\n\r\n private _flatCoords: ArrayLike;\r\n private _flatCoordsOffset: ArrayLike;\r\n\r\n init(option: LinesSeriesOption) {\r\n // The input data may be null/undefined.\r\n option.data = option.data || [];\r\n\r\n // Not using preprocessor because mergeOption may not have series.type\r\n compatEc2(option);\r\n\r\n const result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n\r\n super.init.apply(this, arguments as any);\r\n }\r\n\r\n mergeOption(option: LinesSeriesOption) {\r\n compatEc2(option);\r\n\r\n if (option.data) {\r\n // Only update when have option data to merge.\r\n const result = this._processFlatCoordsArray(option.data);\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n if (result.flatCoords) {\r\n option.data = new Float32Array(result.count);\r\n }\r\n }\r\n\r\n super.mergeOption.apply(this, arguments as any);\r\n }\r\n\r\n appendData(params: Pick) {\r\n const result = this._processFlatCoordsArray(params.data);\r\n if (result.flatCoords) {\r\n if (!this._flatCoords) {\r\n this._flatCoords = result.flatCoords;\r\n this._flatCoordsOffset = result.flatCoordsOffset;\r\n }\r\n else {\r\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\r\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\r\n }\r\n params.data = new Float32Array(result.count);\r\n }\r\n\r\n this.getRawData().appendData(params.data);\r\n }\r\n\r\n _getCoordsFromItemModel(idx: number) {\r\n const itemModel = this.getData().getItemModel(idx);\r\n const coords = (itemModel.option instanceof Array)\r\n ? itemModel.option : itemModel.getShallow('coords');\r\n\r\n if (__DEV__) {\r\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\r\n throw new Error(\r\n 'Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'\r\n );\r\n }\r\n }\r\n return coords;\r\n }\r\n\r\n getLineCoordsCount(idx: number) {\r\n if (this._flatCoordsOffset) {\r\n return this._flatCoordsOffset[idx * 2 + 1];\r\n }\r\n else {\r\n return this._getCoordsFromItemModel(idx).length;\r\n }\r\n }\r\n\r\n getLineCoords(idx: number, out: number[][]) {\r\n if (this._flatCoordsOffset) {\r\n const offset = this._flatCoordsOffset[idx * 2];\r\n const len = this._flatCoordsOffset[idx * 2 + 1];\r\n for (let i = 0; i < len; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = this._flatCoords[offset + i * 2];\r\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\r\n }\r\n return len;\r\n }\r\n else {\r\n const coords = this._getCoordsFromItemModel(idx);\r\n for (let i = 0; i < coords.length; i++) {\r\n out[i] = out[i] || [];\r\n out[i][0] = coords[i][0];\r\n out[i][1] = coords[i][1];\r\n }\r\n return coords.length;\r\n }\r\n }\r\n\r\n _processFlatCoordsArray(data: LinesSeriesOption['data']) {\r\n let startOffset = 0;\r\n if (this._flatCoords) {\r\n startOffset = this._flatCoords.length;\r\n }\r\n // Stored as a typed array. In format\r\n // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |\r\n if (isNumber(data[0])) {\r\n const len = data.length;\r\n // Store offset and len of each segment\r\n const coordsOffsetAndLenStorage = new Uint32Arr(len) as Uint32Array;\r\n const coordsStorage = new Float64Arr(len) as Float64Array;\r\n let coordsCursor = 0;\r\n let offsetCursor = 0;\r\n let dataCount = 0;\r\n for (let i = 0; i < len;) {\r\n dataCount++;\r\n const count = data[i++] as number;\r\n // Offset\r\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;\r\n // Len\r\n coordsOffsetAndLenStorage[offsetCursor++] = count;\r\n for (let k = 0; k < count; k++) {\r\n const x = data[i++] as number;\r\n const y = data[i++] as number;\r\n coordsStorage[coordsCursor++] = x;\r\n coordsStorage[coordsCursor++] = y;\r\n\r\n if (i > len) {\r\n if (__DEV__) {\r\n throw new Error('Invalid data format.');\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {\r\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\r\n flatCoords: coordsStorage,\r\n count: dataCount\r\n };\r\n }\r\n\r\n return {\r\n flatCoordsOffset: null,\r\n flatCoords: null,\r\n count: data.length\r\n };\r\n }\r\n\r\n getInitialData(option: LinesSeriesOption, ecModel: GlobalModel) {\r\n if (__DEV__) {\r\n const CoordSys = CoordinateSystem.get(option.coordinateSystem);\r\n if (!CoordSys) {\r\n throw new Error('Unknown coordinate system ' + option.coordinateSystem);\r\n }\r\n }\r\n\r\n const lineData = new SeriesData(['value'], this);\r\n lineData.hasItemOption = false;\r\n\r\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\r\n // dataItem is simply coords\r\n if (dataItem instanceof Array) {\r\n return NaN;\r\n }\r\n else {\r\n lineData.hasItemOption = true;\r\n const value = dataItem.value;\r\n if (value != null) {\r\n return value instanceof Array ? value[dimIndex] : value;\r\n }\r\n }\r\n });\r\n\r\n return lineData;\r\n }\r\n\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: string\r\n ) {\r\n const data = this.getData();\r\n const itemModel = data.getItemModel(dataIndex);\r\n const name = itemModel.get('name');\r\n if (name) {\r\n return name;\r\n }\r\n const fromName = itemModel.get('fromName');\r\n const toName = itemModel.get('toName');\r\n const nameArr = [];\r\n fromName != null && nameArr.push(fromName);\r\n toName != null && nameArr.push(toName);\r\n\r\n return createTooltipMarkup('nameValue', {\r\n name: nameArr.join(' > ')\r\n });\r\n }\r\n\r\n preventIncremental() {\r\n return !!this.get(['effect', 'show']);\r\n }\r\n\r\n getProgressive() {\r\n const progressive = this.option.progressive;\r\n if (progressive == null) {\r\n return this.option.large ? 1e4 : this.get('progressive');\r\n }\r\n return progressive;\r\n }\r\n\r\n getProgressiveThreshold() {\r\n const progressiveThreshold = this.option.progressiveThreshold;\r\n if (progressiveThreshold == null) {\r\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\r\n }\r\n return progressiveThreshold;\r\n }\r\n\r\n getZLevelKey() {\r\n const effectModel = this.getModel('effect');\r\n const trailLength = effectModel.get('trailLength');\r\n return this.getData().count() > this.getProgressiveThreshold()\r\n // Each progressive series has individual key.\r\n ? this.id\r\n : (effectModel.get('show') && trailLength > 0 ? trailLength + '' : '');\r\n }\r\n\r\n static defaultOption: LinesSeriesOption = {\r\n coordinateSystem: 'geo',\r\n // zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n\r\n // Cartesian coordinate system\r\n xAxisIndex: 0,\r\n yAxisIndex: 0,\r\n\r\n symbol: ['none', 'none'],\r\n symbolSize: [10, 10],\r\n // Geo coordinate system\r\n geoIndex: 0,\r\n\r\n effect: {\r\n show: false,\r\n period: 4,\r\n constantSpeed: 0,\r\n symbol: 'circle',\r\n symbolSize: 3,\r\n loop: true,\r\n trailLength: 0.2\r\n },\r\n\r\n large: false,\r\n // Available when large is true\r\n largeThreshold: 2000,\r\n\r\n polyline: false,\r\n\r\n clip: true,\r\n\r\n label: {\r\n show: false,\r\n position: 'end'\r\n // distance: 5,\r\n // formatter: \u6807\u7B7E\u6587\u672C\u683C\u5F0F\u5668\uFF0C\u540CTooltip.formatter\uFF0C\u4E0D\u652F\u6301\u5F02\u6B65\u56DE\u8C03\r\n },\r\n\r\n lineStyle: {\r\n opacity: 0.5\r\n }\r\n };\r\n}\r\n\r\nexport default LinesSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { StageHandler } from '../../util/types';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport LinesSeriesModel, { LinesDataItemOption } from './LinesSeries';\r\nimport Model from '../../model/Model';\r\nimport { LineDataVisual } from '../../visual/commonVisualTypes';\r\n\r\nfunction normalize(a: string | string[]): string[];\r\nfunction normalize(a: number | number[]): number[];\r\nfunction normalize(a: string | number | (string | number)[]): (string | number)[] {\r\n if (!(a instanceof Array)) {\r\n a = [a, a];\r\n }\r\n return a;\r\n}\r\n\r\nconst linesVisual: StageHandler = {\r\n seriesType: 'lines',\r\n reset(seriesModel: LinesSeriesModel) {\r\n const symbolType = normalize(seriesModel.get('symbol'));\r\n const symbolSize = normalize(seriesModel.get('symbolSize'));\r\n const data = seriesModel.getData() as SeriesData;\r\n\r\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\r\n data.setVisual('toSymbol', symbolType && symbolType[1]);\r\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\r\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\r\n\r\n function dataEach(\r\n data: SeriesData,\r\n idx: number\r\n ): void {\r\n const itemModel = data.getItemModel(idx) as Model;\r\n const symbolType = normalize(itemModel.getShallow('symbol', true));\r\n const symbolSize = normalize(itemModel.getShallow('symbolSize', true));\r\n\r\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\r\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\r\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\r\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\r\n }\r\n\r\n return {\r\n dataEach: data.hasItemOption ? dataEach : null\r\n };\r\n }\r\n};\r\n\r\nexport default linesVisual;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport LinesView from './LinesView';\r\nimport LinesSeriesModel from './LinesSeries';\r\nimport linesLayout from './linesLayout';\r\nimport linesVisual from './linesVisual';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(LinesView);\r\n registers.registerSeriesModel(LinesSeriesModel);\r\n registers.registerLayout(linesLayout);\r\n registers.registerVisual(linesVisual);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/* global Uint8ClampedArray */\r\n\r\nimport { platformApi } from 'zrender/src/core/platform';\r\n\r\nconst GRADIENT_LEVELS = 256;\r\n\r\ntype ColorFunc = (grad: number, fastMode: boolean, output: number[]) => void;\r\n\r\ntype ColorState = 'inRange' | 'outOfRange';\r\n\r\nclass HeatmapLayer {\r\n canvas: HTMLCanvasElement;\r\n blurSize = 30;\r\n pointSize = 20;\r\n\r\n maxOpacity = 1;\r\n minOpacity = 0;\r\n\r\n private _brushCanvas: HTMLCanvasElement;\r\n\r\n private _gradientPixels: Record = {\r\n inRange: null,\r\n outOfRange: null\r\n };\r\n\r\n constructor() {\r\n const canvas = platformApi.createCanvas();\r\n this.canvas = canvas;\r\n }\r\n\r\n /**\r\n * Renders Heatmap and returns the rendered canvas\r\n * @param data array of data, each has x, y, value\r\n * @param width canvas width\r\n * @param height canvas height\r\n */\r\n update(\r\n data: number[][],\r\n width: number,\r\n height: number,\r\n normalize: (value: number) => number,\r\n colorFunc: Record,\r\n isInRange?: (grad?: number) => boolean\r\n ) {\r\n const brush = this._getBrush();\r\n const gradientInRange = this._getGradient(colorFunc, 'inRange');\r\n const gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\r\n const r = this.pointSize + this.blurSize;\r\n\r\n const canvas = this.canvas;\r\n const ctx = canvas.getContext('2d');\r\n const len = data.length;\r\n canvas.width = width;\r\n canvas.height = height;\r\n for (let i = 0; i < len; ++i) {\r\n const p = data[i];\r\n const x = p[0];\r\n const y = p[1];\r\n const value = p[2];\r\n\r\n // calculate alpha using value\r\n const alpha = normalize(value);\r\n\r\n // draw with the circle brush with alpha\r\n ctx.globalAlpha = alpha;\r\n ctx.drawImage(brush, x - r, y - r);\r\n }\r\n\r\n if (!canvas.width || !canvas.height) {\r\n // Avoid \"Uncaught DOMException: Failed to execute 'getImageData' on\r\n // 'CanvasRenderingContext2D': The source height is 0.\"\r\n return canvas;\r\n }\r\n\r\n // colorize the canvas using alpha value and set with gradient\r\n const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\r\n\r\n const pixels = imageData.data;\r\n let offset = 0;\r\n const pixelLen = pixels.length;\r\n const minOpacity = this.minOpacity;\r\n const maxOpacity = this.maxOpacity;\r\n const diffOpacity = maxOpacity - minOpacity;\r\n\r\n while (offset < pixelLen) {\r\n let alpha = pixels[offset + 3] / 256;\r\n const gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;\r\n // Simple optimize to ignore the empty data\r\n if (alpha > 0) {\r\n const gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;\r\n // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]\r\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\r\n pixels[offset++] = gradient[gradientOffset];\r\n pixels[offset++] = gradient[gradientOffset + 1];\r\n pixels[offset++] = gradient[gradientOffset + 2];\r\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\r\n }\r\n else {\r\n offset += 4;\r\n }\r\n }\r\n ctx.putImageData(imageData, 0, 0);\r\n\r\n return canvas;\r\n }\r\n\r\n /**\r\n * get canvas of a black circle brush used for canvas to draw later\r\n */\r\n _getBrush() {\r\n const brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas());\r\n // set brush size\r\n const r = this.pointSize + this.blurSize;\r\n const d = r * 2;\r\n brushCanvas.width = d;\r\n brushCanvas.height = d;\r\n\r\n const ctx = brushCanvas.getContext('2d');\r\n ctx.clearRect(0, 0, d, d);\r\n\r\n // in order to render shadow without the distinct circle,\r\n // draw the distinct circle in an invisible place,\r\n // and use shadowOffset to draw shadow in the center of the canvas\r\n ctx.shadowOffsetX = d;\r\n ctx.shadowBlur = this.blurSize;\r\n // draw the shadow in black, and use alpha and shadow blur to generate\r\n // color in color map\r\n ctx.shadowColor = '#000';\r\n\r\n // draw circle in the left to the canvas\r\n ctx.beginPath();\r\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n return brushCanvas;\r\n }\r\n\r\n /**\r\n * get gradient color map\r\n * @private\r\n */\r\n _getGradient(colorFunc: Record, state: ColorState) {\r\n const gradientPixels = this._gradientPixels;\r\n const pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\r\n const color = [0, 0, 0, 0];\r\n let off = 0;\r\n for (let i = 0; i < 256; i++) {\r\n colorFunc[state](i / 255, true, color);\r\n pixelsSingleState[off++] = color[0];\r\n pixelsSingleState[off++] = color[1];\r\n pixelsSingleState[off++] = color[2];\r\n pixelsSingleState[off++] = color[3];\r\n }\r\n return pixelsSingleState;\r\n }\r\n}\r\n\r\nexport default HeatmapLayer;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as graphic from '../../util/graphic';\r\nimport { toggleHoverEmphasis } from '../../util/states';\r\nimport HeatmapLayer from './HeatmapLayer';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ChartView from '../../view/Chart';\r\nimport HeatmapSeriesModel, { HeatmapDataItemOption } from './HeatmapSeries';\r\nimport type GlobalModel from '../../model/Global';\r\nimport type ExtensionAPI from '../../core/ExtensionAPI';\r\nimport type VisualMapModel from '../../component/visualMap/VisualMapModel';\r\nimport type PiecewiseModel from '../../component/visualMap/PiecewiseModel';\r\nimport type ContinuousModel from '../../component/visualMap/ContinuousModel';\r\nimport { CoordinateSystem, isCoordinateSystemType } from '../../coord/CoordinateSystem';\r\nimport { StageHandlerProgressParams, Dictionary, OptionDataValue } from '../../util/types';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport type Calendar from '../../coord/calendar/Calendar';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport type Element from 'zrender/src/Element';\r\n\r\n// Coord can be 'geo' 'bmap' 'amap' 'leaflet'...\r\ninterface GeoLikeCoordSys extends CoordinateSystem {\r\n dimensions: ['lng', 'lat']\r\n getViewRect(): graphic.BoundingRect\r\n}\r\n\r\nfunction getIsInPiecewiseRange(\r\n dataExtent: number[],\r\n pieceList: ReturnType,\r\n selected: Dictionary\r\n) {\r\n const dataSpan = dataExtent[1] - dataExtent[0];\r\n pieceList = zrUtil.map(pieceList, function (piece) {\r\n return {\r\n interval: [\r\n (piece.interval[0] - dataExtent[0]) / dataSpan,\r\n (piece.interval[1] - dataExtent[0]) / dataSpan\r\n ]\r\n };\r\n });\r\n const len = pieceList.length;\r\n let lastIndex = 0;\r\n\r\n return function (val: number) {\r\n let i;\r\n // Try to find in the location of the last found\r\n for (i = lastIndex; i < len; i++) {\r\n const interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n if (i === len) { // Not found, back interation\r\n for (i = lastIndex - 1; i >= 0; i--) {\r\n const interval = pieceList[i].interval;\r\n if (interval[0] <= val && val <= interval[1]) {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n return i >= 0 && i < len && selected[i];\r\n };\r\n}\r\n\r\nfunction getIsInContinuousRange(dataExtent: number[], range: number[]) {\r\n const dataSpan = dataExtent[1] - dataExtent[0];\r\n range = [\r\n (range[0] - dataExtent[0]) / dataSpan,\r\n (range[1] - dataExtent[0]) / dataSpan\r\n ];\r\n return function (val: number) {\r\n return val >= range[0] && val <= range[1];\r\n };\r\n}\r\n\r\nfunction isGeoCoordSys(coordSys: CoordinateSystem): coordSys is GeoLikeCoordSys {\r\n const dimensions = coordSys.dimensions;\r\n // Not use coordSys.type === 'geo' because coordSys maybe extended\r\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\r\n}\r\n\r\nclass HeatmapView extends ChartView {\r\n\r\n static readonly type = 'heatmap';\r\n readonly type = HeatmapView.type;\r\n\r\n private _hmLayer: HeatmapLayer;\r\n\r\n private _progressiveEls: Element[];\r\n\r\n render(seriesModel: HeatmapSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n let visualMapOfThisSeries;\r\n ecModel.eachComponent('visualMap', function (visualMap: VisualMapModel) {\r\n visualMap.eachTargetSeries(function (targetSeries) {\r\n if (targetSeries === seriesModel) {\r\n visualMapOfThisSeries = visualMap;\r\n }\r\n });\r\n });\r\n\r\n if (__DEV__) {\r\n if (!visualMapOfThisSeries) {\r\n throw new Error('Heatmap must use with visualMap');\r\n }\r\n }\r\n\r\n // Clear previously rendered progressive elements.\r\n this._progressiveEls = null;\r\n\r\n this.group.removeAll();\r\n\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\r\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\r\n }\r\n else if (isGeoCoordSys(coordSys)) {\r\n this._renderOnGeo(\r\n coordSys, seriesModel, visualMapOfThisSeries, api\r\n );\r\n }\r\n }\r\n\r\n incrementalPrepareRender(seriesModel: HeatmapSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.group.removeAll();\r\n }\r\n\r\n incrementalRender(\r\n params: StageHandlerProgressParams,\r\n seriesModel: HeatmapSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys) {\r\n // geo does not support incremental rendering?\r\n if (isGeoCoordSys(coordSys)) {\r\n this.render(seriesModel, ecModel, api);\r\n }\r\n else {\r\n this._progressiveEls = [];\r\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\r\n }\r\n }\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n graphic.traverseElements(this._progressiveEls || this.group, cb);\r\n }\r\n\r\n _renderOnCartesianAndCalendar(\r\n seriesModel: HeatmapSeriesModel,\r\n api: ExtensionAPI,\r\n start: number,\r\n end: number,\r\n incremental?: boolean\r\n ) {\r\n\r\n const coordSys = seriesModel.coordinateSystem as Cartesian2D | Calendar;\r\n const isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d');\r\n let width;\r\n let height;\r\n let xAxisExtent;\r\n let yAxisExtent;\r\n\r\n if (isCartesian2d) {\r\n const xAxis = coordSys.getAxis('x');\r\n const yAxis = coordSys.getAxis('y');\r\n\r\n if (__DEV__) {\r\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\r\n throw new Error('Heatmap on cartesian must have two category axes');\r\n }\r\n if (!(xAxis.onBand && yAxis.onBand)) {\r\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\r\n }\r\n }\r\n\r\n // add 0.5px to avoid the gaps\r\n width = xAxis.getBandWidth() + .5;\r\n height = yAxis.getBandWidth() + .5;\r\n xAxisExtent = xAxis.scale.getExtent();\r\n yAxisExtent = yAxis.scale.getExtent();\r\n }\r\n\r\n const group = this.group;\r\n const data = seriesModel.getData();\r\n\r\n let emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\r\n let blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n let selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n let borderRadius = seriesModel.get(['itemStyle', 'borderRadius']);\r\n let labelStatesModels = getLabelStatesModels(seriesModel);\r\n const emphasisModel = seriesModel.getModel('emphasis');\r\n let focus = emphasisModel.get('focus');\r\n let blurScope = emphasisModel.get('blurScope');\r\n let emphasisDisabled = emphasisModel.get('disabled');\r\n\r\n const dataDims = isCartesian2d\r\n ? [\r\n data.mapDimension('x'),\r\n data.mapDimension('y'),\r\n data.mapDimension('value')\r\n ]\r\n : [\r\n data.mapDimension('time'),\r\n data.mapDimension('value')\r\n ];\r\n\r\n for (let idx = start; idx < end; idx++) {\r\n let rect;\r\n const style = data.getItemVisual(idx, 'style');\r\n\r\n if (isCartesian2d) {\r\n const dataDimX = data.get(dataDims[0], idx);\r\n const dataDimY = data.get(dataDims[1], idx);\r\n\r\n // Ignore empty data and out of extent data\r\n if (isNaN(data.get(dataDims[2], idx) as number)\r\n || isNaN(dataDimX as number)\r\n || isNaN(dataDimY as number)\r\n || dataDimX < xAxisExtent[0]\r\n || dataDimX > xAxisExtent[1]\r\n || dataDimY < yAxisExtent[0]\r\n || dataDimY > yAxisExtent[1]\r\n ) {\r\n continue;\r\n }\r\n\r\n const point = coordSys.dataToPoint([\r\n dataDimX,\r\n dataDimY\r\n ]);\r\n\r\n rect = new graphic.Rect({\r\n shape: {\r\n x: point[0] - width / 2,\r\n y: point[1] - height / 2,\r\n width,\r\n height\r\n },\r\n style\r\n });\r\n }\r\n else {\r\n // Ignore empty data\r\n if (isNaN(data.get(dataDims[1], idx) as number)) {\r\n continue;\r\n }\r\n\r\n rect = new graphic.Rect({\r\n z2: 1,\r\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\r\n style\r\n });\r\n }\r\n\r\n // Optimization for large dataset\r\n if (data.hasItemOption) {\r\n const itemModel = data.getItemModel(idx);\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n\r\n // Each item value struct in the data would be firstly\r\n // {\r\n // itemStyle: { borderRadius: [30, 30] },\r\n // value: [2022, 02, 22]\r\n // }\r\n borderRadius = itemModel.get(['itemStyle', 'borderRadius']);\r\n\r\n focus = emphasisModel.get('focus');\r\n blurScope = emphasisModel.get('blurScope');\r\n emphasisDisabled = emphasisModel.get('disabled');\r\n\r\n labelStatesModels = getLabelStatesModels(itemModel);\r\n }\r\n\r\n rect.shape.r = borderRadius;\r\n\r\n const rawValue = seriesModel.getRawValue(idx) as OptionDataValue[];\r\n let defaultText = '-';\r\n if (rawValue && rawValue[2] != null) {\r\n defaultText = rawValue[2] + '';\r\n }\r\n\r\n setLabelStyle(\r\n rect, labelStatesModels,\r\n {\r\n labelFetcher: seriesModel,\r\n labelDataIndex: idx,\r\n defaultOpacity: style.opacity,\r\n defaultText: defaultText\r\n }\r\n );\r\n\r\n rect.ensureState('emphasis').style = emphasisStyle;\r\n rect.ensureState('blur').style = blurStyle;\r\n rect.ensureState('select').style = selectStyle;\r\n\r\n toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled);\r\n\r\n rect.incremental = incremental;\r\n // PENDING\r\n if (incremental) {\r\n // Rect must use hover layer if it's incremental.\r\n rect.states.emphasis.hoverLayer = true;\r\n }\r\n\r\n group.add(rect);\r\n data.setItemGraphicEl(idx, rect);\r\n\r\n if (this._progressiveEls) {\r\n this._progressiveEls.push(rect);\r\n }\r\n }\r\n }\r\n\r\n _renderOnGeo(\r\n geo: GeoLikeCoordSys,\r\n seriesModel: HeatmapSeriesModel,\r\n visualMapModel: VisualMapModel,\r\n api: ExtensionAPI\r\n ) {\r\n const inRangeVisuals = visualMapModel.targetVisuals.inRange;\r\n const outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;\r\n // if (!visualMapping) {\r\n // throw new Error('Data range must have color visuals');\r\n // }\r\n\r\n const data = seriesModel.getData();\r\n const hmLayer = this._hmLayer || (this._hmLayer || new HeatmapLayer());\r\n hmLayer.blurSize = seriesModel.get('blurSize');\r\n hmLayer.pointSize = seriesModel.get('pointSize');\r\n hmLayer.minOpacity = seriesModel.get('minOpacity');\r\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\r\n\r\n const rect = geo.getViewRect().clone();\r\n const roamTransform = geo.getRoamTransform();\r\n rect.applyTransform(roamTransform);\r\n\r\n // Clamp on viewport\r\n const x = Math.max(rect.x, 0);\r\n const y = Math.max(rect.y, 0);\r\n const x2 = Math.min(rect.width + rect.x, api.getWidth());\r\n const y2 = Math.min(rect.height + rect.y, api.getHeight());\r\n const width = x2 - x;\r\n const height = y2 - y;\r\n\r\n const dims = [\r\n data.mapDimension('lng'),\r\n data.mapDimension('lat'),\r\n data.mapDimension('value')\r\n ];\r\n\r\n const points = data.mapArray(dims, function (lng: number, lat: number, value: number) {\r\n const pt = geo.dataToPoint([lng, lat]);\r\n pt[0] -= x;\r\n pt[1] -= y;\r\n pt.push(value);\r\n return pt;\r\n });\r\n\r\n const dataExtent = visualMapModel.getExtent();\r\n const isInRange = visualMapModel.type === 'visualMap.continuous'\r\n ? getIsInContinuousRange(dataExtent, (visualMapModel as ContinuousModel).option.range)\r\n : getIsInPiecewiseRange(\r\n dataExtent,\r\n (visualMapModel as PiecewiseModel).getPieceList(),\r\n (visualMapModel as PiecewiseModel).option.selected\r\n );\r\n\r\n hmLayer.update(\r\n points, width, height,\r\n inRangeVisuals.color.getNormalizer(),\r\n {\r\n inRange: inRangeVisuals.color.getColorMapper(),\r\n outOfRange: outOfRangeVisuals.color.getColorMapper()\r\n },\r\n isInRange\r\n );\r\n const img = new graphic.Image({\r\n style: {\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y,\r\n image: hmLayer.canvas\r\n },\r\n silent: true\r\n });\r\n this.group.add(img);\r\n }\r\n}\r\n\r\nexport default HeatmapView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport CoordinateSystem from '../../core/CoordinateSystem';\r\nimport {\r\n SeriesOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n ItemStyleOption,\r\n SeriesLabelOption,\r\n OptionDataValue,\r\n StatesOptionMixin,\r\n SeriesEncodeOptionMixin,\r\n SeriesOnCalendarOptionMixin,\r\n DefaultStatesMixinEmphasis,\r\n CallbackDataParams\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport type Geo from '../../coord/geo/Geo';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport type Calendar from '../../coord/calendar/Calendar';\r\n\r\ntype HeatmapDataValue = OptionDataValue[];\r\n\r\nexport interface HeatmapStateOption {\r\n // Available on cartesian2d coordinate system\r\n itemStyle?: ItemStyleOption & {\r\n borderRadius?: number | number[]\r\n }\r\n label?: SeriesLabelOption\r\n}\r\n\r\ninterface FunnelStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\nexport interface HeatmapDataItemOption extends HeatmapStateOption,\r\n StatesOptionMixin {\r\n value: HeatmapDataValue\r\n}\r\n\r\nexport interface HeatmapSeriesOption\r\n extends SeriesOption, FunnelStatesMixin>,\r\n HeatmapStateOption,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n SeriesOnCalendarOptionMixin,\r\n SeriesEncodeOptionMixin {\r\n\r\n type?: 'heatmap'\r\n\r\n coordinateSystem?: 'cartesian2d' | 'geo' | 'calendar'\r\n\r\n // Available on geo coordinate system\r\n blurSize?: number\r\n pointSize?: number\r\n maxOpacity?: number\r\n minOpacity?: number\r\n\r\n data?: (HeatmapDataItemOption | HeatmapDataValue)[]\r\n}\r\n\r\n\r\n\r\nclass HeatmapSeriesModel extends SeriesModel {\r\n static readonly type = 'series.heatmap';\r\n readonly type = HeatmapSeriesModel.type;\r\n\r\n static readonly dependencies = ['grid', 'geo', 'calendar'];\r\n // @ts-ignore\r\n coordinateSystem: Cartesian2D | Geo | Calendar;\r\n\r\n getInitialData(option: HeatmapSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesData(null, this, {\r\n generateCoord: 'value'\r\n });\r\n }\r\n\r\n preventIncremental() {\r\n const coordSysCreator = CoordinateSystem.get(this.get('coordinateSystem'));\r\n if (coordSysCreator && coordSysCreator.dimensions) {\r\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\r\n }\r\n }\r\n\r\n static defaultOption: HeatmapSeriesOption = {\r\n\r\n coordinateSystem: 'cartesian2d',\r\n\r\n // zlevel: 0,\r\n\r\n z: 2,\r\n\r\n // Cartesian coordinate system\r\n // xAxisIndex: 0,\r\n // yAxisIndex: 0,\r\n\r\n // Geo coordinate system\r\n geoIndex: 0,\r\n\r\n blurSize: 30,\r\n\r\n pointSize: 20,\r\n\r\n maxOpacity: 1,\r\n\r\n minOpacity: 0,\r\n\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport default HeatmapSeriesModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport HeatmapView from './HeatmapView';\r\nimport HeatmapSeriesModel from './HeatmapSeries';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(HeatmapView);\r\n registers.registerSeriesModel(HeatmapSeriesModel);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport { toggleHoverEmphasis } from '../../util/states';\r\nimport {createSymbol, normalizeSymbolOffset} from '../../util/symbol';\r\nimport {parsePercent, isNumeric} from '../../util/number';\r\nimport ChartView from '../../view/Chart';\r\nimport PictorialBarSeriesModel, {PictorialBarDataItemOption} from './PictorialBarSeries';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport GlobalModel from '../../model/Global';\r\nimport Model from '../../model/Model';\r\nimport { ColorString, AnimationOptionMixin, ECElement } from '../../util/types';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport type Displayable from 'zrender/src/graphic/Displayable';\r\nimport type Axis2D from '../../coord/cartesian/Axis2D';\r\nimport type Element from 'zrender/src/Element';\r\nimport { getDefaultLabel } from '../helper/labelHelper';\r\nimport { PathProps, PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport ZRImage from 'zrender/src/graphic/Image';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { createClipPath } from '../helper/createClipPathFromCoordSys';\r\n\r\nconst BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth'] as const;\r\n\r\n// index: +isHorizontal\r\nconst LAYOUT_ATTRS = [\r\n {xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right']},\r\n {xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom']}\r\n] as const;\r\n\r\nconst pathForLineWidth = new graphic.Circle();\r\n\r\ntype ItemModel = Model & {\r\n getAnimationDelayParams(path: any): {index: number, count: number}\r\n isAnimationEnabled(): boolean\r\n};\r\ntype RectShape = graphic.Rect['shape'];\r\ntype RectLayout = RectShape;\r\n\r\ntype PictorialSymbol = ReturnType & {\r\n __pictorialAnimationIndex: number\r\n __pictorialRepeatTimes: number\r\n};\r\n\r\ninterface SymbolMeta {\r\n dataIndex: number\r\n\r\n symbolPatternSize: number\r\n symbolType: string\r\n symbolMargin: number\r\n symbolSize: number[]\r\n symbolScale: number[]\r\n symbolRepeat: PictorialBarDataItemOption['symbolRepeat']\r\n symbolClip: PictorialBarDataItemOption['symbolClip']\r\n symbolRepeatDirection: PictorialBarDataItemOption['symbolRepeatDirection']\r\n\r\n layout: RectLayout\r\n\r\n repeatTimes: number\r\n\r\n rotation: number\r\n\r\n pathPosition: number[]\r\n bundlePosition: number[]\r\n\r\n pxSign: number\r\n\r\n barRectShape: RectShape\r\n clipShape: RectShape\r\n\r\n boundingLength: number\r\n repeatCutLength: number\r\n\r\n valueLineWidth: number\r\n\r\n opacity: number\r\n style: PathStyleProps\r\n z2: number\r\n\r\n itemModel: ItemModel\r\n\r\n animationModel?: ItemModel\r\n\r\n hoverScale: boolean\r\n}\r\n\r\ninterface CreateOpts {\r\n ecSize: { width: number, height: number }\r\n seriesModel: PictorialBarSeriesModel\r\n coordSys: Cartesian2D\r\n coordSysExtent: number[][]\r\n isHorizontal: boolean\r\n valueDim: typeof LAYOUT_ATTRS[number]\r\n categoryDim: typeof LAYOUT_ATTRS[number]\r\n}\r\n\r\ninterface PictorialBarElement extends graphic.Group {\r\n __pictorialBundle: graphic.Group\r\n __pictorialShapeStr: string\r\n __pictorialSymbolMeta: SymbolMeta\r\n\r\n __pictorialMainPath: PictorialSymbol\r\n\r\n __pictorialBarRect: graphic.Rect\r\n\r\n __pictorialClipPath: graphic.Rect\r\n}\r\n\r\nclass PictorialBarView extends ChartView {\r\n static type = 'pictorialBar';\r\n readonly type = PictorialBarView.type;\r\n\r\n private _data: SeriesData;\r\n\r\n render(\r\n seriesModel: PictorialBarSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const group = this.group;\r\n const data = seriesModel.getData();\r\n const oldData = this._data;\r\n\r\n const cartesian = seriesModel.coordinateSystem;\r\n const baseAxis = cartesian.getBaseAxis();\r\n const isHorizontal = baseAxis.isHorizontal();\r\n const coordSysRect = cartesian.master.getRect();\r\n\r\n const opt: CreateOpts = {\r\n ecSize: {width: api.getWidth(), height: api.getHeight()},\r\n seriesModel: seriesModel,\r\n coordSys: cartesian,\r\n coordSysExtent: [\r\n [coordSysRect.x, coordSysRect.x + coordSysRect.width],\r\n [coordSysRect.y, coordSysRect.y + coordSysRect.height]\r\n ],\r\n isHorizontal: isHorizontal,\r\n valueDim: LAYOUT_ATTRS[+isHorizontal],\r\n categoryDim: LAYOUT_ATTRS[1 - (+isHorizontal)]\r\n };\r\n\r\n data.diff(oldData)\r\n .add(function (dataIndex) {\r\n if (!data.hasValue(dataIndex)) {\r\n return;\r\n }\r\n\r\n const itemModel = getItemModel(data, dataIndex);\r\n const symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\r\n\r\n const bar = createBar(data, opt, symbolMeta);\r\n\r\n data.setItemGraphicEl(dataIndex, bar);\r\n group.add(bar);\r\n\r\n updateCommon(bar, opt, symbolMeta);\r\n })\r\n .update(function (newIndex, oldIndex) {\r\n let bar = oldData.getItemGraphicEl(oldIndex) as PictorialBarElement;\r\n\r\n if (!data.hasValue(newIndex)) {\r\n group.remove(bar);\r\n return;\r\n }\r\n\r\n const itemModel = getItemModel(data, newIndex);\r\n const symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\r\n\r\n const pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\r\n group.remove(bar);\r\n data.setItemGraphicEl(newIndex, null);\r\n bar = null;\r\n }\r\n\r\n if (bar) {\r\n updateBar(bar, opt, symbolMeta);\r\n }\r\n else {\r\n bar = createBar(data, opt, symbolMeta, true);\r\n }\r\n\r\n data.setItemGraphicEl(newIndex, bar);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n // Add back\r\n group.add(bar);\r\n\r\n updateCommon(bar, opt, symbolMeta);\r\n })\r\n .remove(function (dataIndex) {\r\n const bar = oldData.getItemGraphicEl(dataIndex) as PictorialBarElement;\r\n bar && removeBar(\r\n oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar\r\n );\r\n })\r\n .execute();\r\n\r\n // Do clipping\r\n const clipPath = seriesModel.get('clip', true)\r\n ? createClipPath(seriesModel.coordinateSystem, false, seriesModel)\r\n : null;\r\n if (clipPath) {\r\n group.setClipPath(clipPath);\r\n }\r\n else {\r\n group.removeClipPath();\r\n }\r\n\r\n this._data = data;\r\n\r\n return this.group;\r\n }\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const group = this.group;\r\n const data = this._data;\r\n if (ecModel.get('animation')) {\r\n if (data) {\r\n data.eachItemGraphicEl(function (bar: PictorialBarElement) {\r\n removeBar(data, getECData(bar).dataIndex, ecModel as Model, bar);\r\n });\r\n }\r\n }\r\n else {\r\n group.removeAll();\r\n }\r\n }\r\n}\r\n\r\n// Set or calculate default value about symbol, and calculate layout info.\r\nfunction getSymbolMeta(\r\n data: SeriesData,\r\n dataIndex: number,\r\n itemModel: ItemModel,\r\n opt: CreateOpts\r\n): SymbolMeta {\r\n const layout = data.getItemLayout(dataIndex) as RectLayout;\r\n const symbolRepeat = itemModel.get('symbolRepeat');\r\n const symbolClip = itemModel.get('symbolClip');\r\n const symbolPosition = itemModel.get('symbolPosition') || 'start';\r\n const symbolRotate = itemModel.get('symbolRotate');\r\n const rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n const symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\r\n const isAnimationEnabled = itemModel.isAnimationEnabled();\r\n\r\n const symbolMeta: SymbolMeta = {\r\n dataIndex: dataIndex,\r\n layout: layout,\r\n itemModel: itemModel,\r\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\r\n style: data.getItemVisual(dataIndex, 'style'),\r\n symbolClip: symbolClip,\r\n symbolRepeat: symbolRepeat,\r\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\r\n symbolPatternSize: symbolPatternSize,\r\n rotation: rotation,\r\n animationModel: isAnimationEnabled ? itemModel : null,\r\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\r\n z2: itemModel.getShallow('z', true) || 0\r\n } as SymbolMeta;\r\n\r\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\r\n\r\n prepareSymbolSize(\r\n data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength,\r\n symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta\r\n );\r\n\r\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\r\n\r\n const symbolSize = symbolMeta.symbolSize;\r\n const symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize);\r\n\r\n prepareLayoutInfo(\r\n itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset as number[],\r\n symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength,\r\n opt, symbolMeta\r\n );\r\n\r\n return symbolMeta;\r\n}\r\n\r\n// bar length can be negative.\r\nfunction prepareBarLength(\r\n itemModel: ItemModel,\r\n symbolRepeat: PictorialBarDataItemOption['symbolRepeat'],\r\n layout: RectLayout,\r\n opt: CreateOpts,\r\n outputSymbolMeta: SymbolMeta\r\n) {\r\n const valueDim = opt.valueDim;\r\n const symbolBoundingData = itemModel.get('symbolBoundingData');\r\n const valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\r\n const zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\r\n const pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\r\n let boundingLength;\r\n\r\n if (zrUtil.isArray(symbolBoundingData)) {\r\n const symbolBoundingExtent = [\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,\r\n convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx\r\n ];\r\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());\r\n boundingLength = symbolBoundingExtent[pxSignIdx];\r\n }\r\n else if (symbolBoundingData != null) {\r\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\r\n }\r\n else if (symbolRepeat) {\r\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\r\n }\r\n else {\r\n boundingLength = layout[valueDim.wh];\r\n }\r\n\r\n outputSymbolMeta.boundingLength = boundingLength;\r\n\r\n if (symbolRepeat) {\r\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\r\n }\r\n\r\n // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero\r\n // and when borderWidth be settled, the actual linewidth will be NaN\r\n outputSymbolMeta.pxSign = boundingLength >= 0 ? 1 : -1;\r\n}\r\n\r\nfunction convertToCoordOnAxis(axis: Axis2D, value: number) {\r\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\r\n}\r\n\r\n// Support ['100%', '100%']\r\nfunction prepareSymbolSize(\r\n data: SeriesData,\r\n dataIndex: number,\r\n layout: RectLayout,\r\n symbolRepeat: PictorialBarDataItemOption['symbolRepeat'],\r\n symbolClip: unknown,\r\n boundingLength: number,\r\n pxSign: number,\r\n symbolPatternSize: number,\r\n opt: CreateOpts,\r\n outputSymbolMeta: SymbolMeta\r\n) {\r\n const valueDim = opt.valueDim;\r\n const categoryDim = opt.categoryDim;\r\n const categorySize = Math.abs(layout[categoryDim.wh]);\r\n\r\n const symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\r\n let parsedSymbolSize: number[];\r\n if (zrUtil.isArray(symbolSize)) {\r\n parsedSymbolSize = symbolSize.slice();\r\n }\r\n else {\r\n if (symbolSize == null) {\r\n // will parse to number below\r\n parsedSymbolSize = ['100%', '100%'] as unknown as number[];\r\n }\r\n else {\r\n parsedSymbolSize = [symbolSize, symbolSize];\r\n }\r\n }\r\n\r\n // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is\r\n // to complicated to calculate real percent value if considering scaled lineWidth.\r\n // So the actual size will bigger than layout size if lineWidth is bigger than zero,\r\n // which can be tolerated in pictorial chart.\r\n\r\n parsedSymbolSize[categoryDim.index] = parsePercent(\r\n parsedSymbolSize[categoryDim.index],\r\n categorySize\r\n );\r\n parsedSymbolSize[valueDim.index] = parsePercent(\r\n parsedSymbolSize[valueDim.index],\r\n symbolRepeat ? categorySize : Math.abs(boundingLength)\r\n );\r\n\r\n outputSymbolMeta.symbolSize = parsedSymbolSize;\r\n\r\n // If x or y is less than zero, show reversed shape.\r\n const symbolScale = outputSymbolMeta.symbolScale = [\r\n parsedSymbolSize[0] / symbolPatternSize,\r\n parsedSymbolSize[1] / symbolPatternSize\r\n ];\r\n // Follow convention, 'right' and 'top' is the normal scale.\r\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\r\n}\r\n\r\nfunction prepareLineWidth(\r\n itemModel: ItemModel,\r\n symbolScale: number[],\r\n rotation: number,\r\n opt: CreateOpts,\r\n outputSymbolMeta: SymbolMeta\r\n) {\r\n // In symbols are drawn with scale, so do not need to care about the case that width\r\n // or height are too small. But symbol use strokeNoScale, where acture lineWidth should\r\n // be calculated.\r\n let valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\r\n\r\n if (valueLineWidth) {\r\n pathForLineWidth.attr({\r\n scaleX: symbolScale[0],\r\n scaleY: symbolScale[1],\r\n rotation: rotation\r\n });\r\n pathForLineWidth.updateTransform();\r\n valueLineWidth /= pathForLineWidth.getLineScale();\r\n valueLineWidth *= symbolScale[opt.valueDim.index];\r\n }\r\n\r\n outputSymbolMeta.valueLineWidth = valueLineWidth || 0;\r\n}\r\n\r\nfunction prepareLayoutInfo(\r\n itemModel: ItemModel,\r\n symbolSize: number[],\r\n layout: RectLayout,\r\n symbolRepeat: PictorialBarDataItemOption['symbolRepeat'],\r\n symbolClip: PictorialBarDataItemOption['symbolClip'],\r\n symbolOffset: number[],\r\n symbolPosition: PictorialBarDataItemOption['symbolPosition'],\r\n valueLineWidth: number,\r\n boundingLength: number,\r\n repeatCutLength: number,\r\n opt: CreateOpts,\r\n outputSymbolMeta: SymbolMeta\r\n) {\r\n const categoryDim = opt.categoryDim;\r\n const valueDim = opt.valueDim;\r\n const pxSign = outputSymbolMeta.pxSign;\r\n\r\n const unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\r\n let pathLen = unitLength;\r\n\r\n // Note: rotation will not effect the layout of symbols, because user may\r\n // want symbols to rotate on its center, which should not be translated\r\n // when rotating.\r\n\r\n if (symbolRepeat) {\r\n const absBoundingLength = Math.abs(boundingLength);\r\n\r\n let symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + '';\r\n let hasEndGap = false;\r\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\r\n hasEndGap = true;\r\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\r\n }\r\n let symbolMarginNumeric = parsePercent(symbolMargin, symbolSize[valueDim.index]);\r\n\r\n let uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);\r\n\r\n // When symbol margin is less than 0, margin at both ends will be subtracted\r\n // to ensure that all of the symbols will not be overflow the given area.\r\n let endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n\r\n // Both final repeatTimes and final symbolMarginNumeric area calculated based on\r\n // boundingLength.\r\n const repeatSpecified = isNumeric(symbolRepeat);\r\n let repeatTimes = repeatSpecified\r\n ? symbolRepeat as number\r\n : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);\r\n\r\n // Adjust calculate margin, to ensure each symbol is displayed\r\n // entirely in the given layout area.\r\n const mDiff = absBoundingLength - repeatTimes * unitLength;\r\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1));\r\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\r\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;\r\n\r\n // Update repeatTimes when not all symbol will be shown.\r\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\r\n repeatTimes = repeatCutLength\r\n ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin)\r\n : 0;\r\n }\r\n\r\n pathLen = repeatTimes * uLenWithMargin - endFix;\r\n outputSymbolMeta.repeatTimes = repeatTimes;\r\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\r\n }\r\n\r\n const sizeFix = pxSign * (pathLen / 2);\r\n const pathPosition = outputSymbolMeta.pathPosition = [] as number[];\r\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\r\n pathPosition[valueDim.index] = symbolPosition === 'start'\r\n ? sizeFix\r\n : symbolPosition === 'end'\r\n ? boundingLength - sizeFix\r\n : boundingLength / 2; // 'center'\r\n if (symbolOffset) {\r\n pathPosition[0] += symbolOffset[0];\r\n pathPosition[1] += symbolOffset[1];\r\n }\r\n\r\n const bundlePosition = outputSymbolMeta.bundlePosition = [] as number[];\r\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\r\n bundlePosition[valueDim.index] = layout[valueDim.xy];\r\n\r\n const barRectShape = outputSymbolMeta.barRectShape = zrUtil.extend({}, layout);\r\n barRectShape[valueDim.wh] = pxSign * Math.max(\r\n Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix)\r\n );\r\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\r\n\r\n const clipShape = outputSymbolMeta.clipShape = {} as RectShape;\r\n // Consider that symbol may be overflow layout rect.\r\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\r\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\r\n clipShape[valueDim.xy] = 0;\r\n clipShape[valueDim.wh] = layout[valueDim.wh];\r\n}\r\n\r\nfunction createPath(symbolMeta: SymbolMeta) {\r\n const symbolPatternSize = symbolMeta.symbolPatternSize;\r\n const path = createSymbol(\r\n // Consider texture img, make a big size.\r\n symbolMeta.symbolType,\r\n -symbolPatternSize / 2,\r\n -symbolPatternSize / 2,\r\n symbolPatternSize,\r\n symbolPatternSize\r\n );\r\n (path as Displayable).attr({\r\n culling: true\r\n });\r\n path.type !== 'image' && path.setStyle({\r\n strokeNoScale: true\r\n });\r\n\r\n return path as PictorialSymbol;\r\n}\r\n\r\nfunction createOrUpdateRepeatSymbols(\r\n bar: PictorialBarElement, opt: CreateOpts, symbolMeta: SymbolMeta, isUpdate?: boolean\r\n) {\r\n const bundle = bar.__pictorialBundle;\r\n const symbolSize = symbolMeta.symbolSize;\r\n const valueLineWidth = symbolMeta.valueLineWidth;\r\n const pathPosition = symbolMeta.pathPosition;\r\n const valueDim = opt.valueDim;\r\n const repeatTimes = symbolMeta.repeatTimes || 0;\r\n\r\n let index = 0;\r\n const unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\r\n\r\n eachPath(bar, function (path) {\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n if (index < repeatTimes) {\r\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\r\n }\r\n else {\r\n updateAttr(path, null, { scaleX: 0, scaleY: 0 }, symbolMeta, isUpdate, function () {\r\n bundle.remove(path);\r\n });\r\n }\r\n\r\n // updateHoverAnimation(path, symbolMeta);\r\n\r\n index++;\r\n });\r\n\r\n for (; index < repeatTimes; index++) {\r\n const path = createPath(symbolMeta);\r\n path.__pictorialAnimationIndex = index;\r\n path.__pictorialRepeatTimes = repeatTimes;\r\n bundle.add(path);\r\n\r\n const target = makeTarget(index);\r\n\r\n updateAttr(\r\n path,\r\n {\r\n x: target.x,\r\n y: target.y,\r\n scaleX: 0,\r\n scaleY: 0\r\n },\r\n {\r\n scaleX: target.scaleX,\r\n scaleY: target.scaleY,\r\n rotation: target.rotation\r\n },\r\n symbolMeta,\r\n isUpdate\r\n );\r\n }\r\n\r\n function makeTarget(index: number) {\r\n const position = pathPosition.slice();\r\n // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index\r\n // Otherwise: i = index;\r\n const pxSign = symbolMeta.pxSign;\r\n let i = index;\r\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\r\n i = repeatTimes - 1 - index;\r\n }\r\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\r\n\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n };\r\n }\r\n}\r\n\r\nfunction createOrUpdateSingleSymbol(\r\n bar: PictorialBarElement,\r\n opt: CreateOpts,\r\n symbolMeta: SymbolMeta,\r\n isUpdate?: boolean\r\n) {\r\n const bundle = bar.__pictorialBundle;\r\n let mainPath = bar.__pictorialMainPath;\r\n\r\n if (!mainPath) {\r\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\r\n bundle.add(mainPath);\r\n\r\n updateAttr(\r\n mainPath,\r\n {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: 0,\r\n scaleY: 0,\r\n rotation: symbolMeta.rotation\r\n },\r\n {\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1]\r\n },\r\n symbolMeta,\r\n isUpdate\r\n );\r\n }\r\n else {\r\n updateAttr(\r\n mainPath,\r\n null,\r\n {\r\n x: symbolMeta.pathPosition[0],\r\n y: symbolMeta.pathPosition[1],\r\n scaleX: symbolMeta.symbolScale[0],\r\n scaleY: symbolMeta.symbolScale[1],\r\n rotation: symbolMeta.rotation\r\n },\r\n symbolMeta,\r\n isUpdate\r\n );\r\n }\r\n}\r\n\r\n// bar rect is used for label.\r\nfunction createOrUpdateBarRect(\r\n bar: PictorialBarElement,\r\n symbolMeta: SymbolMeta,\r\n isUpdate?: boolean\r\n) {\r\n const rectShape = zrUtil.extend({}, symbolMeta.barRectShape);\r\n\r\n let barRect = bar.__pictorialBarRect;\r\n if (!barRect) {\r\n barRect = bar.__pictorialBarRect = new graphic.Rect({\r\n z2: 2,\r\n shape: rectShape,\r\n silent: true,\r\n style: {\r\n stroke: 'transparent',\r\n fill: 'transparent',\r\n lineWidth: 0\r\n }\r\n });\r\n (barRect as ECElement).disableMorphing = true;\r\n\r\n bar.add(barRect);\r\n }\r\n else {\r\n updateAttr(barRect, null, {shape: rectShape}, symbolMeta, isUpdate);\r\n }\r\n}\r\n\r\nfunction createOrUpdateClip(\r\n bar: PictorialBarElement,\r\n opt: CreateOpts,\r\n symbolMeta: SymbolMeta,\r\n isUpdate?: boolean\r\n) {\r\n // If not clip, symbol will be remove and rebuilt.\r\n if (symbolMeta.symbolClip) {\r\n let clipPath = bar.__pictorialClipPath;\r\n const clipShape = zrUtil.extend({}, symbolMeta.clipShape);\r\n const valueDim = opt.valueDim;\r\n const animationModel = symbolMeta.animationModel;\r\n const dataIndex = symbolMeta.dataIndex;\r\n\r\n if (clipPath) {\r\n graphic.updateProps(\r\n clipPath, {shape: clipShape}, animationModel, dataIndex\r\n );\r\n }\r\n else {\r\n clipShape[valueDim.wh] = 0;\r\n clipPath = new graphic.Rect({shape: clipShape});\r\n bar.__pictorialBundle.setClipPath(clipPath);\r\n bar.__pictorialClipPath = clipPath;\r\n\r\n const target = {} as RectShape;\r\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\r\n\r\n graphic[isUpdate ? 'updateProps' : 'initProps'](\r\n clipPath, {shape: target}, animationModel, dataIndex\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction getItemModel(data: SeriesData, dataIndex: number) {\r\n const itemModel = data.getItemModel(dataIndex) as ItemModel;\r\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\r\n itemModel.isAnimationEnabled = isAnimationEnabled;\r\n return itemModel;\r\n}\r\n\r\nfunction getAnimationDelayParams(this: ItemModel, path: PictorialSymbol) {\r\n // The order is the same as the z-order, see `symbolRepeatDiretion`.\r\n return {\r\n index: path.__pictorialAnimationIndex,\r\n count: path.__pictorialRepeatTimes\r\n };\r\n}\r\n\r\nfunction isAnimationEnabled(this: ItemModel) {\r\n // `animation` prop can be set on itemModel in pictorial bar chart.\r\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\r\n}\r\n\r\nfunction createBar(data: SeriesData, opt: CreateOpts, symbolMeta: SymbolMeta, isUpdate?: boolean) {\r\n // bar is the main element for each data.\r\n const bar = new graphic.Group() as PictorialBarElement;\r\n // bundle is used for location and clip.\r\n const bundle = new graphic.Group();\r\n bar.add(bundle);\r\n bar.__pictorialBundle = bundle;\r\n\r\n bundle.x = symbolMeta.bundlePosition[0];\r\n bundle.y = symbolMeta.bundlePosition[1];\r\n\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\r\n }\r\n\r\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\r\n\r\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\r\n\r\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\r\n bar.__pictorialSymbolMeta = symbolMeta;\r\n return bar;\r\n}\r\n\r\nfunction updateBar(bar: PictorialBarElement, opt: CreateOpts, symbolMeta: SymbolMeta) {\r\n const animationModel = symbolMeta.animationModel;\r\n const dataIndex = symbolMeta.dataIndex;\r\n const bundle = bar.__pictorialBundle;\r\n\r\n graphic.updateProps(\r\n bundle, {\r\n x: symbolMeta.bundlePosition[0],\r\n y: symbolMeta.bundlePosition[1]\r\n }, animationModel, dataIndex\r\n );\r\n\r\n if (symbolMeta.symbolRepeat) {\r\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\r\n }\r\n else {\r\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\r\n }\r\n\r\n createOrUpdateBarRect(bar, symbolMeta, true);\r\n\r\n createOrUpdateClip(bar, opt, symbolMeta, true);\r\n}\r\n\r\nfunction removeBar(\r\n data: SeriesData, dataIndex: number, animationModel: Model, bar: PictorialBarElement\r\n) {\r\n // Not show text when animating\r\n const labelRect = bar.__pictorialBarRect;\r\n labelRect && (labelRect.removeTextContent());\r\n\r\n const paths = [];\r\n eachPath(bar, function (path) {\r\n paths.push(path);\r\n });\r\n bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath);\r\n\r\n // I do not find proper remove animation for clip yet.\r\n bar.__pictorialClipPath && (animationModel = null);\r\n\r\n zrUtil.each(paths, function (path) {\r\n graphic.removeElement(\r\n path, { scaleX: 0, scaleY: 0 }, animationModel, dataIndex,\r\n function () {\r\n bar.parent && bar.parent.remove(bar);\r\n }\r\n );\r\n });\r\n\r\n data.setItemGraphicEl(dataIndex, null);\r\n}\r\n\r\nfunction getShapeStr(data: SeriesData, symbolMeta: SymbolMeta) {\r\n return [\r\n data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none',\r\n !!symbolMeta.symbolRepeat,\r\n !!symbolMeta.symbolClip\r\n ].join(':');\r\n}\r\n\r\nfunction eachPath(\r\n bar: PictorialBarElement,\r\n cb: (this: Ctx, el: PictorialSymbol) => void,\r\n context?: Ctx\r\n) {\r\n // Do not use Group#eachChild, because it do not support remove.\r\n zrUtil.each(bar.__pictorialBundle.children(), function (el) {\r\n el !== bar.__pictorialBarRect && cb.call(context, el);\r\n });\r\n}\r\n\r\nfunction updateAttr(\r\n el: T,\r\n immediateAttrs: PathProps,\r\n animationAttrs: PathProps,\r\n symbolMeta: SymbolMeta,\r\n isUpdate?: boolean,\r\n cb?: () => void\r\n) {\r\n immediateAttrs && el.attr(immediateAttrs);\r\n // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.\r\n if (symbolMeta.symbolClip && !isUpdate) {\r\n animationAttrs && el.attr(animationAttrs);\r\n }\r\n else {\r\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](\r\n el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb\r\n );\r\n }\r\n}\r\n\r\nfunction updateCommon(\r\n bar: PictorialBarElement,\r\n opt: CreateOpts,\r\n symbolMeta: SymbolMeta\r\n) {\r\n const dataIndex = symbolMeta.dataIndex;\r\n const itemModel = symbolMeta.itemModel;\r\n // Color must be excluded.\r\n // Because symbol provide setColor individually to set fill and stroke\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n const emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\r\n const blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\r\n const selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\r\n const cursorStyle = itemModel.getShallow('cursor');\r\n\r\n const focus = emphasisModel.get('focus');\r\n const blurScope = emphasisModel.get('blurScope');\r\n const hoverScale = emphasisModel.get('scale');\r\n\r\n eachPath(bar, function (path) {\r\n if (path instanceof ZRImage) {\r\n const pathStyle = path.style;\r\n path.useStyle(zrUtil.extend({\r\n // TODO other properties like dx, dy ?\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, symbolMeta.style));\r\n }\r\n else {\r\n path.useStyle(symbolMeta.style);\r\n }\r\n\r\n const emphasisState = path.ensureState('emphasis');\r\n emphasisState.style = emphasisStyle;\r\n\r\n if (hoverScale) {\r\n // NOTE: Must after scale is set after updateAttr\r\n emphasisState.scaleX = path.scaleX * 1.1;\r\n emphasisState.scaleY = path.scaleY * 1.1;\r\n }\r\n\r\n path.ensureState('blur').style = blurStyle;\r\n path.ensureState('select').style = selectStyle;\r\n\r\n cursorStyle && (path.cursor = cursorStyle);\r\n path.z2 = symbolMeta.z2;\r\n });\r\n\r\n const barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\r\n const barRect = bar.__pictorialBarRect;\r\n barRect.ignoreClip = true;\r\n\r\n setLabelStyle(\r\n barRect, getLabelStatesModels(itemModel),\r\n {\r\n labelFetcher: opt.seriesModel,\r\n labelDataIndex: dataIndex,\r\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\r\n inheritColor: symbolMeta.style.fill as ColorString,\r\n defaultOpacity: symbolMeta.style.opacity,\r\n defaultOutsidePosition: barPositionOutside\r\n }\r\n );\r\n\r\n toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled'));\r\n}\r\n\r\nfunction toIntTimes(times: number) {\r\n const roundedTimes = Math.round(times);\r\n // Escapse accurate error\r\n return Math.abs(times - roundedTimes) < 1e-4\r\n ? roundedTimes\r\n : Math.ceil(times);\r\n}\r\n\r\nexport default PictorialBarView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport BaseBarSeriesModel, { BaseBarSeriesOption } from './BaseBarSeries';\r\nimport {\r\n OptionDataValue,\r\n ItemStyleOption,\r\n SeriesLabelOption,\r\n AnimationOptionMixin,\r\n SeriesStackOptionMixin,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n DefaultEmphasisFocus,\r\n SeriesEncodeOptionMixin\r\n} from '../../util/types';\r\nimport type Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport { inheritDefaultOption } from '../../util/component';\r\n\r\nexport interface PictorialBarStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\n\r\ninterface PictorialBarSeriesSymbolOption {\r\n /**\r\n * Customized bar shape\r\n */\r\n symbol?: string\r\n /**\r\n * Can be ['100%', '100%'], null means auto.\r\n * The percent will be relative to category width. If no repeat.\r\n * Will be relative to symbolBoundingData.\r\n */\r\n symbolSize?: (number | string)[] | number | string\r\n\r\n symbolRotate?: number\r\n\r\n /**\r\n * Default to be auto\r\n */\r\n symbolPosition?: 'start' | 'end' | 'center'\r\n\r\n /**\r\n * Can be percent offset relative to the symbolSize\r\n */\r\n symbolOffset?: (number | string)[] | number | string\r\n /**\r\n * start margin and end margin. Can be a number or a percent string relative to symbolSize.\r\n * Auto margin by default.\r\n */\r\n symbolMargin?: (number | string)[] | number | string\r\n\r\n /**\r\n * true: means auto calculate repeat times and cut by data.\r\n * a number: specifies repeat times, and do not cut by data.\r\n * 'fixed': means auto calculate repeat times but do not cut by data.\r\n *\r\n * Otherwise means no repeat\r\n */\r\n symbolRepeat?: boolean | number | 'fixed'\r\n\r\n /**\r\n * From start to end or end to start.\r\n */\r\n symbolRepeatDirection?: 'start' | 'end'\r\n\r\n symbolClip?: boolean\r\n\r\n /**\r\n * It will define the size of graphic elements.\r\n */\r\n symbolBoundingData?: number | number[]\r\n\r\n symbolPatternSize?: number\r\n}\r\n\r\n\r\ninterface ExtraStateOption {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus\r\n scale?: boolean\r\n }\r\n}\r\n\r\nexport interface PictorialBarDataItemOption extends PictorialBarSeriesSymbolOption,\r\n // Pictorial bar support configure animation in each data item.\r\n AnimationOptionMixin,\r\n PictorialBarStateOption, StatesOptionMixin,\r\n OptionDataItemObject {\r\n\r\n z?: number\r\n\r\n cursor?: string\r\n}\r\n\r\nexport interface PictorialBarSeriesOption\r\n extends BaseBarSeriesOption, PictorialBarStateOption,\r\n PictorialBarSeriesSymbolOption,\r\n SeriesStackOptionMixin, SeriesEncodeOptionMixin {\r\n\r\n type?: 'pictorialBar'\r\n\r\n coordinateSystem?: 'cartesian2d'\r\n\r\n data?: (PictorialBarDataItemOption | OptionDataValue | OptionDataValue[])[]\r\n\r\n clip?: boolean\r\n}\r\n\r\nclass PictorialBarSeriesModel extends BaseBarSeriesModel {\r\n static type = 'series.pictorialBar';\r\n type = PictorialBarSeriesModel.type;\r\n\r\n static dependencies = ['grid'];\r\n\r\n coordinateSystem: Cartesian2D;\r\n\r\n hasSymbolVisual = true;\r\n defaultSymbol = 'roundRect';\r\n\r\n static defaultOption: PictorialBarSeriesOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\r\n\r\n symbol: 'circle', // Customized bar shape\r\n symbolSize: null, //\r\n symbolRotate: null,\r\n\r\n symbolPosition: null, // 'start' or 'end' or 'center', null means auto.\r\n symbolOffset: null,\r\n symbolMargin: null,\r\n symbolRepeat: false,\r\n symbolRepeatDirection: 'end', // 'end' means from 'start' to 'end'.\r\n\r\n symbolClip: false,\r\n symbolBoundingData: null, // Can be 60 or -40 or [-40, 60]\r\n symbolPatternSize: 400, // 400 * 400 px\r\n\r\n barGap: '-100%', // In most case, overlap is needed.\r\n\r\n // Pictorial bar do not clip by default because in many cases\r\n // xAxis and yAxis are not displayed and it's expected not to clip\r\n clip: false,\r\n\r\n // z can be set in data item, which is z2 actually.\r\n\r\n // Disable progressive\r\n progressive: 0,\r\n\r\n emphasis: {\r\n // By default pictorialBar do not hover scale. Hover scale is not suitable\r\n // for the case that both has foreground and background.\r\n scale: false\r\n },\r\n\r\n select: {\r\n itemStyle: {\r\n borderColor: '#212121'\r\n }\r\n }\r\n });\r\n\r\n getInitialData(option: PictorialBarSeriesOption) {\r\n // Disable stack.\r\n (option as any).stack = null;\r\n return super.getInitialData.apply(this, arguments as any);\r\n }\r\n}\r\n\r\nexport default PictorialBarSeriesModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport PictorialBarView from './PictorialBarView';\r\nimport PictorialBarSeriesModel from './PictorialBarSeries';\r\nimport { createProgressiveLayout, layout } from '../../layout/barGrid';\r\nimport { curry } from 'zrender/src/core/util';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(PictorialBarView);\r\n registers.registerSeriesModel(PictorialBarSeriesModel);\r\n\r\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar'));\r\n // Do layout after other overall layout, which can prepare some information.\r\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar'));\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {ECPolygon} from '../line/poly';\r\nimport * as graphic from '../../util/graphic';\r\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states';\r\nimport {setLabelStyle, getLabelStatesModels} from '../../label/labelStyle';\r\nimport {bind} from 'zrender/src/core/util';\r\nimport DataDiffer from '../../data/DataDiffer';\r\nimport ChartView from '../../view/Chart';\r\nimport ThemeRiverSeriesModel from './ThemeRiverSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport { ColorString } from '../../util/types';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\n\r\ntype LayerSeries = ReturnType;\r\n\r\nclass ThemeRiverView extends ChartView {\r\n\r\n static readonly type = 'themeRiver';\r\n readonly type = ThemeRiverView.type;\r\n\r\n private _layersSeries: LayerSeries;\r\n private _layers: graphic.Group[] = [];\r\n\r\n render(seriesModel: ThemeRiverSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const data = seriesModel.getData();\r\n const self = this;\r\n\r\n const group = this.group;\r\n\r\n const layersSeries = seriesModel.getLayerSeries();\r\n\r\n const layoutInfo = data.getLayout('layoutInfo');\r\n const rect = layoutInfo.rect;\r\n const boundaryGap = layoutInfo.boundaryGap;\r\n\r\n group.x = 0;\r\n group.y = rect.y + boundaryGap[0];\r\n\r\n function keyGetter(item: LayerSeries[number]) {\r\n return item.name;\r\n }\r\n const dataDiffer = new DataDiffer(\r\n this._layersSeries || [], layersSeries,\r\n keyGetter, keyGetter\r\n );\r\n\r\n const newLayersGroups: graphic.Group[] = [];\r\n\r\n dataDiffer\r\n .add(bind(process, this, 'add'))\r\n .update(bind(process, this, 'update'))\r\n .remove(bind(process, this, 'remove'))\r\n .execute();\r\n\r\n function process(status: 'add' | 'update' | 'remove', idx: number, oldIdx?: number) {\r\n const oldLayersGroups = self._layers;\r\n if (status === 'remove') {\r\n group.remove(oldLayersGroups[idx]);\r\n return;\r\n }\r\n const points0: number[] = [];\r\n const points1: number[] = [];\r\n let style;\r\n const indices = layersSeries[idx].indices;\r\n let j = 0;\r\n for (; j < indices.length; j++) {\r\n const layout = data.getItemLayout(indices[j]);\r\n const x = layout.x;\r\n const y0 = layout.y0;\r\n const y = layout.y;\r\n\r\n points0.push(x, y0);\r\n points1.push(x, y0 + y);\r\n\r\n style = data.getItemVisual(indices[j], 'style');\r\n }\r\n\r\n let polygon: ECPolygon;\r\n const textLayout = data.getItemLayout(indices[0]);\r\n const labelModel = seriesModel.getModel('label');\r\n const margin = labelModel.get('margin');\r\n const emphasisModel = seriesModel.getModel('emphasis');\r\n\r\n if (status === 'add') {\r\n const layerGroup = newLayersGroups[idx] = new graphic.Group();\r\n polygon = new ECPolygon({\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1,\r\n smooth: 0.4,\r\n stackedOnSmooth: 0.4,\r\n smoothConstraint: false\r\n },\r\n z2: 0\r\n });\r\n layerGroup.add(polygon);\r\n group.add(layerGroup);\r\n\r\n if (seriesModel.isAnimationEnabled()) {\r\n polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function () {\r\n polygon.removeClipPath();\r\n }));\r\n }\r\n }\r\n else {\r\n const layerGroup = oldLayersGroups[oldIdx];\r\n polygon = layerGroup.childAt(0) as ECPolygon;\r\n group.add(layerGroup);\r\n\r\n newLayersGroups[idx] = layerGroup;\r\n\r\n graphic.updateProps(polygon, {\r\n shape: {\r\n points: points0,\r\n stackedOnPoints: points1\r\n }\r\n }, seriesModel);\r\n\r\n saveOldStyle(polygon);\r\n }\r\n\r\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\r\n labelDataIndex: indices[j - 1],\r\n defaultText: data.getName(indices[j - 1]),\r\n inheritColor: style.fill as ColorString\r\n }, {\r\n normal: {\r\n verticalAlign: 'middle'\r\n // align: 'right'\r\n }\r\n });\r\n polygon.setTextConfig({\r\n position: null,\r\n local: true\r\n });\r\n\r\n const labelEl = polygon.getTextContent();\r\n // TODO More label position options.\r\n if (labelEl) {\r\n labelEl.x = textLayout.x - margin;\r\n labelEl.y = textLayout.y0 + textLayout.y / 2;\r\n }\r\n\r\n polygon.useStyle(style);\r\n\r\n data.setItemGraphicEl(idx, polygon);\r\n\r\n setStatesStylesFromModel(polygon, seriesModel);\r\n toggleHoverEmphasis(\r\n polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')\r\n );\r\n }\r\n\r\n this._layersSeries = layersSeries;\r\n this._layers = newLayersGroups;\r\n }\r\n};\r\n\r\n// add animation to the view\r\nfunction createGridClipShape(rect: RectLike, seriesModel: ThemeRiverSeriesModel, cb: () => void) {\r\n const rectEl = new graphic.Rect({\r\n shape: {\r\n x: rect.x - 10,\r\n y: rect.y - 10,\r\n width: 0,\r\n height: rect.height + 20\r\n }\r\n });\r\n graphic.initProps(rectEl, {\r\n shape: {\r\n x: rect.x - 50,\r\n width: rect.width + 100,\r\n height: rect.height + 20\r\n }\r\n }, seriesModel, cb);\r\n\r\n return rectEl;\r\n}\r\n\r\nexport default ThemeRiverView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesModel from '../../model/Series';\r\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions';\r\nimport {getDimensionTypeByAxis} from '../../data/helper/dimensionHelper';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {groupData, SINGLE_REFERRING} from '../../util/model';\r\nimport LegendVisualProvider from '../../visual/LegendVisualProvider';\r\nimport {\r\n SeriesOption,\r\n SeriesOnSingleOptionMixin,\r\n OptionDataValueDate,\r\n OptionDataValueNumeric,\r\n ItemStyleOption,\r\n BoxLayoutOptionMixin,\r\n ZRColor,\r\n Dictionary,\r\n SeriesLabelOption,\r\n CallbackDataParams,\r\n DefaultStatesMixinEmphasis\r\n} from '../../util/types';\r\nimport SingleAxis from '../../coord/single/SingleAxis';\r\nimport GlobalModel from '../../model/Global';\r\nimport Single from '../../coord/single/Single';\r\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup';\r\n\r\nconst DATA_NAME_INDEX = 2;\r\n\r\ninterface ThemeRiverSeriesLabelOption extends SeriesLabelOption {\r\n margin?: number\r\n}\r\n\r\ntype ThemerRiverDataItem = [OptionDataValueDate, OptionDataValueNumeric, string];\r\n\r\ninterface ThemeRiverStatesMixin {\r\n emphasis?: DefaultStatesMixinEmphasis\r\n}\r\nexport interface ThemeRiverStateOption {\r\n label?: ThemeRiverSeriesLabelOption\r\n itemStyle?: ItemStyleOption\r\n}\r\n\r\nexport interface ThemeRiverSeriesOption\r\n extends SeriesOption, ThemeRiverStatesMixin>,\r\n ThemeRiverStateOption,\r\n SeriesOnSingleOptionMixin, BoxLayoutOptionMixin {\r\n type?: 'themeRiver'\r\n\r\n color?: ZRColor[]\r\n\r\n coordinateSystem?: 'singleAxis'\r\n\r\n /**\r\n * gap in axis's orthogonal orientation\r\n */\r\n boundaryGap?: (string | number)[]\r\n /**\r\n * [date, value, name]\r\n */\r\n data?: ThemerRiverDataItem[]\r\n}\r\n\r\nclass ThemeRiverSeriesModel extends SeriesModel {\r\n static readonly type = 'series.themeRiver';\r\n readonly type = ThemeRiverSeriesModel.type;\r\n\r\n static readonly dependencies = ['singleAxis'];\r\n\r\n nameMap: zrUtil.HashMap;\r\n\r\n coordinateSystem: Single;\r\n\r\n /**\r\n * @override\r\n */\r\n init(option: ThemeRiverSeriesOption) {\r\n // eslint-disable-next-line\r\n super.init.apply(this, arguments as any);\r\n\r\n // Put this function here is for the sake of consistency of code style.\r\n // Enable legend selection for each data item\r\n // Use a function instead of direct access because data reference may changed\r\n this.legendVisualProvider = new LegendVisualProvider(\r\n zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)\r\n );\r\n }\r\n\r\n /**\r\n * If there is no value of a certain point in the time for some event,set it value to 0.\r\n *\r\n * @param {Array} data initial data in the option\r\n * @return {Array}\r\n */\r\n fixData(data: ThemeRiverSeriesOption['data']) {\r\n let rawDataLength = data.length;\r\n /**\r\n * Make sure every layer data get the same keys.\r\n * The value index tells which layer has visited.\r\n * {\r\n * 2014/01/01: -1\r\n * }\r\n */\r\n const timeValueKeys: Dictionary = {};\r\n\r\n // grouped data by name\r\n const groupResult = groupData(data, (item: ThemerRiverDataItem) => {\r\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\r\n timeValueKeys[item[0] + ''] = -1;\r\n }\r\n return item[2];\r\n });\r\n const layerData: {name: string, dataList: ThemerRiverDataItem[]}[] = [];\r\n groupResult.buckets.each(function (items, key) {\r\n layerData.push({\r\n name: key, dataList: items\r\n });\r\n });\r\n const layerNum = layerData.length;\r\n\r\n for (let k = 0; k < layerNum; ++k) {\r\n const name = layerData[k].name;\r\n for (let j = 0; j < layerData[k].dataList.length; ++j) {\r\n const timeValue = layerData[k].dataList[j][0] + '';\r\n timeValueKeys[timeValue] = k;\r\n }\r\n\r\n for (const timeValue in timeValueKeys) {\r\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\r\n timeValueKeys[timeValue] = k;\r\n data[rawDataLength] = [timeValue, 0, name];\r\n rawDataLength++;\r\n }\r\n }\r\n\r\n }\r\n return data;\r\n }\r\n\r\n /**\r\n * @override\r\n * @param option the initial option that user gave\r\n * @param ecModel the model object for themeRiver option\r\n */\r\n getInitialData(option: ThemeRiverSeriesOption, ecModel: GlobalModel): SeriesData {\r\n\r\n const singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\r\n\r\n const axisType = singleAxisModel.get('type');\r\n\r\n // filter the data item with the value of label is undefined\r\n const filterData = zrUtil.filter(option.data, function (dataItem) {\r\n return dataItem[2] !== undefined;\r\n });\r\n\r\n // ??? TODO design a stage to transfer data for themeRiver and lines?\r\n const data = this.fixData(filterData || []);\r\n const nameList = [];\r\n const nameMap = this.nameMap = zrUtil.createHashMap();\r\n let count = 0;\r\n\r\n for (let i = 0; i < data.length; ++i) {\r\n nameList.push(data[i][DATA_NAME_INDEX]);\r\n if (!nameMap.get(data[i][DATA_NAME_INDEX] as string)) {\r\n nameMap.set(data[i][DATA_NAME_INDEX] as string, count);\r\n count++;\r\n }\r\n }\r\n\r\n const { dimensions } = prepareSeriesDataSchema(data, {\r\n coordDimensions: ['single'],\r\n dimensionsDefine: [\r\n {\r\n name: 'time',\r\n type: getDimensionTypeByAxis(axisType)\r\n },\r\n {\r\n name: 'value',\r\n type: 'float'\r\n },\r\n {\r\n name: 'name',\r\n type: 'ordinal'\r\n }\r\n ],\r\n encodeDefine: {\r\n single: 0,\r\n value: 1,\r\n itemName: 2\r\n }\r\n });\r\n\r\n const list = new SeriesData(dimensions, this);\r\n list.initData(data);\r\n\r\n return list;\r\n }\r\n\r\n /**\r\n * The raw data is divided into multiple layers and each layer\r\n * has same name.\r\n */\r\n getLayerSeries() {\r\n const data = this.getData();\r\n const lenCount = data.count();\r\n const indexArr = [];\r\n\r\n for (let i = 0; i < lenCount; ++i) {\r\n indexArr[i] = i;\r\n }\r\n\r\n const timeDim = data.mapDimension('single');\r\n\r\n // data group by name\r\n const groupResult = groupData(indexArr, function (index) {\r\n return data.get('name', index) as string;\r\n });\r\n const layerSeries: {\r\n name: string\r\n indices: number[]\r\n }[] = [];\r\n groupResult.buckets.each(function (items: number[], key: string) {\r\n items.sort(function (index1: number, index2: number) {\r\n return data.get(timeDim, index1) as number - (data.get(timeDim, index2) as number);\r\n });\r\n layerSeries.push({\r\n name: key,\r\n indices: items\r\n });\r\n });\r\n\r\n return layerSeries;\r\n }\r\n\r\n /**\r\n * Get data indices for show tooltip content\r\n */\r\n getAxisTooltipData(dim: string | string[], value: number, baseAxis: SingleAxis) {\r\n if (!zrUtil.isArray(dim)) {\r\n dim = dim ? [dim] : [];\r\n }\r\n\r\n const data = this.getData();\r\n const layerSeries = this.getLayerSeries();\r\n const indices = [];\r\n const layerNum = layerSeries.length;\r\n let nestestValue;\r\n\r\n for (let i = 0; i < layerNum; ++i) {\r\n let minDist = Number.MAX_VALUE;\r\n let nearestIdx = -1;\r\n const pointNum = layerSeries[i].indices.length;\r\n for (let j = 0; j < pointNum; ++j) {\r\n const theValue = data.get(dim[0], layerSeries[i].indices[j]) as number;\r\n const dist = Math.abs(theValue - value);\r\n if (dist <= minDist) {\r\n nestestValue = theValue;\r\n minDist = dist;\r\n nearestIdx = layerSeries[i].indices[j];\r\n }\r\n }\r\n indices.push(nearestIdx);\r\n }\r\n\r\n return {dataIndices: indices, nestestValue: nestestValue};\r\n }\r\n\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: string\r\n ) {\r\n const data = this.getData();\r\n const name = data.getName(dataIndex);\r\n const value = data.get(data.mapDimension('value'), dataIndex);\r\n\r\n return createTooltipMarkup('nameValue', { name: name, value: value });\r\n }\r\n\r\n static defaultOption: ThemeRiverSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n\r\n colorBy: 'data',\r\n coordinateSystem: 'singleAxis',\r\n\r\n // gap in axis's orthogonal orientation\r\n boundaryGap: ['10%', '10%'],\r\n\r\n // legendHoverLink: true,\r\n\r\n singleAxisIndex: 0,\r\n\r\n animationEasing: 'linear',\r\n\r\n label: {\r\n margin: 4,\r\n show: true,\r\n position: 'left',\r\n fontSize: 11\r\n },\r\n\r\n emphasis: {\r\n\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport default ThemeRiverSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as numberUtil from '../../util/number';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport ThemeRiverSeriesModel, { ThemeRiverSeriesOption } from './ThemeRiverSeries';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport SeriesData from '../../data/SeriesData';\r\n\r\nexport interface ThemeRiverLayoutInfo {\r\n rect: RectLike\r\n boundaryGap: ThemeRiverSeriesOption['boundaryGap']\r\n}\r\n\r\nexport default function themeRiverLayout(ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n ecModel.eachSeriesByType('themeRiver', function (seriesModel: ThemeRiverSeriesModel) {\r\n\r\n const data = seriesModel.getData();\r\n\r\n const single = seriesModel.coordinateSystem;\r\n\r\n const layoutInfo = {} as ThemeRiverLayoutInfo;\r\n\r\n // use the axis boundingRect for view\r\n const rect = single.getRect();\r\n\r\n layoutInfo.rect = rect;\r\n\r\n const boundaryGap = seriesModel.get('boundaryGap');\r\n\r\n const axis = single.getAxis();\r\n\r\n layoutInfo.boundaryGap = boundaryGap;\r\n\r\n if (axis.orient === 'horizontal') {\r\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);\r\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);\r\n const height = rect.height - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, height);\r\n }\r\n else {\r\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);\r\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);\r\n const width = rect.width - boundaryGap[0] - boundaryGap[1];\r\n doThemeRiverLayout(data, seriesModel, width);\r\n }\r\n\r\n data.setLayout('layoutInfo', layoutInfo);\r\n });\r\n}\r\n\r\n/**\r\n * The layout information about themeriver\r\n *\r\n * @param data data in the series\r\n * @param seriesModel the model object of themeRiver series\r\n * @param height value used to compute every series height\r\n */\r\nfunction doThemeRiverLayout(\r\n data: SeriesData,\r\n seriesModel: ThemeRiverSeriesModel,\r\n height: number\r\n) {\r\n if (!data.count()) {\r\n return;\r\n }\r\n const coordSys = seriesModel.coordinateSystem;\r\n // the data in each layer are organized into a series.\r\n const layerSeries = seriesModel.getLayerSeries();\r\n\r\n // the points in each layer.\r\n const timeDim = data.mapDimension('single');\r\n const valueDim = data.mapDimension('value');\r\n const layerPoints = zrUtil.map(layerSeries, function (singleLayer) {\r\n return zrUtil.map(singleLayer.indices, function (idx) {\r\n const pt = coordSys.dataToPoint(data.get(timeDim, idx));\r\n pt[1] = data.get(valueDim, idx) as number;\r\n return pt;\r\n });\r\n });\r\n\r\n const base = computeBaseline(layerPoints);\r\n const baseLine = base.y0;\r\n const ky = height / base.max;\r\n\r\n // set layout information for each item.\r\n const n = layerSeries.length;\r\n const m = layerSeries[0].indices.length;\r\n let baseY0;\r\n for (let j = 0; j < m; ++j) {\r\n baseY0 = baseLine[j] * ky;\r\n data.setItemLayout(layerSeries[0].indices[j], {\r\n layerIndex: 0,\r\n x: layerPoints[0][j][0],\r\n y0: baseY0,\r\n y: layerPoints[0][j][1] * ky\r\n });\r\n for (let i = 1; i < n; ++i) {\r\n baseY0 += layerPoints[i - 1][j][1] * ky;\r\n data.setItemLayout(layerSeries[i].indices[j], {\r\n layerIndex: i,\r\n x: layerPoints[i][j][0],\r\n y0: baseY0,\r\n y: layerPoints[i][j][1] * ky\r\n });\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Compute the baseLine of the rawdata\r\n * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics\r\n *\r\n * @param data the points in each layer\r\n */\r\nfunction computeBaseline(data: number[][][]) {\r\n const layerNum = data.length;\r\n const pointNum = data[0].length;\r\n const sums = [];\r\n const y0 = [];\r\n let max = 0;\r\n\r\n for (let i = 0; i < pointNum; ++i) {\r\n let temp = 0;\r\n for (let j = 0; j < layerNum; ++j) {\r\n temp += data[j][i][1];\r\n }\r\n if (temp > max) {\r\n max = temp;\r\n }\r\n sums.push(temp);\r\n }\r\n\r\n for (let k = 0; k < pointNum; ++k) {\r\n y0[k] = (max - sums[k]) / 2;\r\n }\r\n max = 0;\r\n\r\n for (let l = 0; l < pointNum; ++l) {\r\n const sum = sums[l] + y0[l];\r\n if (sum > max) {\r\n max = sum;\r\n }\r\n }\r\n\r\n return {\r\n y0,\r\n max\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport ThemeRiverView from './ThemeRiverView';\r\nimport ThemeRiverSeriesModel from './ThemeRiverSeries';\r\nimport themeRiverLayout from './themeRiverLayout';\r\nimport dataFilter from '../../processor/dataFilter';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(ThemeRiverView);\r\n registers.registerSeriesModel(ThemeRiverSeriesModel);\r\n\r\n registers.registerLayout(themeRiverLayout);\r\n registers.registerProcessor(dataFilter('themeRiver'));\r\n\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport { toggleHoverEmphasis, SPECIAL_STATES, DISPLAY_STATES } from '../../util/states';\r\nimport { createTextStyle } from '../../label/labelStyle';\r\nimport { TreeNode } from '../../data/Tree';\r\nimport SunburstSeriesModel, { SunburstSeriesNodeItemOption, SunburstSeriesOption } from './SunburstSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { ColorString } from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { getSectorCornerRadius } from '../helper/sectorHelper';\r\nimport { createOrUpdatePatternFromDecal } from '../../util/decal';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { saveOldStyle } from '../../animation/basicTransition';\r\nimport { normalizeRadian } from 'zrender/src/contain/util';\r\nimport { isRadianAroundZero } from '../../util/number';\r\n\r\nconst DEFAULT_SECTOR_Z = 2;\r\nconst DEFAULT_TEXT_Z = 4;\r\ninterface DrawTreeNode extends TreeNode {\r\n piece: SunburstPiece\r\n}\r\n/**\r\n * Sunburstce of Sunburst including Sector, Label, LabelLine\r\n */\r\nclass SunburstPiece extends graphic.Sector {\r\n\r\n node: TreeNode;\r\n\r\n private _seriesModel: SunburstSeriesModel;\r\n private _ecModel: GlobalModel;\r\n\r\n constructor(node: TreeNode, seriesModel: SunburstSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n super();\r\n\r\n this.z2 = DEFAULT_SECTOR_Z;\r\n this.textConfig = {\r\n inside: true\r\n };\r\n\r\n getECData(this).seriesIndex = seriesModel.seriesIndex;\r\n\r\n const text = new graphic.Text({\r\n z2: DEFAULT_TEXT_Z,\r\n silent: node.getModel().get(['label', 'silent'])\r\n });\r\n this.setTextContent(text);\r\n\r\n this.updateData(true, node, seriesModel, ecModel, api);\r\n }\r\n\r\n updateData(\r\n firstCreate: boolean,\r\n node: TreeNode,\r\n // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',\r\n seriesModel: SunburstSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n this.node = node;\r\n (node as DrawTreeNode).piece = this;\r\n\r\n seriesModel = seriesModel || this._seriesModel;\r\n ecModel = ecModel || this._ecModel;\r\n\r\n const sector = this;\r\n getECData(sector).dataIndex = node.dataIndex;\r\n\r\n const itemModel = node.getModel();\r\n const emphasisModel = itemModel.getModel('emphasis');\r\n const layout = node.getLayout();\r\n\r\n const sectorShape = zrUtil.extend({}, layout);\r\n sectorShape.label = null;\r\n\r\n const normalStyle = node.getVisual('style') as PathStyleProps;\r\n normalStyle.lineJoin = 'bevel';\r\n\r\n const decal = node.getVisual('decal');\r\n if (decal) {\r\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\r\n }\r\n\r\n const cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\r\n zrUtil.extend(sectorShape, cornerRadius);\r\n\r\n zrUtil.each(SPECIAL_STATES, function (stateName) {\r\n const state = sector.ensureState(stateName);\r\n const itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\r\n state.style = itemStyleModel.getItemStyle();\r\n // border radius\r\n const cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\r\n if (cornerRadius) {\r\n state.shape = cornerRadius;\r\n }\r\n });\r\n\r\n if (firstCreate) {\r\n sector.setShape(sectorShape);\r\n sector.shape.r = layout.r0;\r\n graphic.initProps(\r\n sector,\r\n {\r\n shape: {\r\n r: layout.r\r\n }\r\n },\r\n seriesModel,\r\n node.dataIndex\r\n );\r\n }\r\n else {\r\n // Disable animation for gradient since no interpolation method\r\n // is supported for gradient\r\n graphic.updateProps(sector, {\r\n shape: sectorShape\r\n }, seriesModel);\r\n\r\n saveOldStyle(sector);\r\n }\r\n\r\n sector.useStyle(normalStyle);\r\n\r\n this._updateLabel(seriesModel);\r\n\r\n const cursorStyle = itemModel.getShallow('cursor');\r\n cursorStyle && sector.attr('cursor', cursorStyle);\r\n\r\n this._seriesModel = seriesModel || this._seriesModel;\r\n this._ecModel = ecModel || this._ecModel;\r\n\r\n const focus = emphasisModel.get('focus');\r\n\r\n const focusOrIndices = focus === 'relative'\r\n ? zrUtil.concatArray(node.getAncestorsIndices(), node.getDescendantIndices())\r\n : focus === 'ancestor' ? node.getAncestorsIndices()\r\n : focus === 'descendant' ? node.getDescendantIndices()\r\n : focus;\r\n\r\n toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\r\n }\r\n\r\n _updateLabel(\r\n seriesModel: SunburstSeriesModel\r\n ) {\r\n const itemModel = this.node.getModel();\r\n const normalLabelModel = itemModel.getModel('label');\r\n\r\n const layout = this.node.getLayout();\r\n const angle = layout.endAngle - layout.startAngle;\r\n\r\n const midAngle = (layout.startAngle + layout.endAngle) / 2;\r\n const dx = Math.cos(midAngle);\r\n const dy = Math.sin(midAngle);\r\n\r\n const sector = this;\r\n const label = sector.getTextContent();\r\n const dataIndex = this.node.dataIndex;\r\n const labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\r\n const isNormalShown = normalLabelModel.get('show')\r\n && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\r\n label.ignore = !isNormalShown;\r\n\r\n // TODO use setLabelStyle\r\n zrUtil.each(DISPLAY_STATES, (stateName) => {\r\n\r\n const labelStateModel = stateName === 'normal' ? itemModel.getModel('label')\r\n : itemModel.getModel([stateName, 'label']);\r\n const isNormal = stateName === 'normal';\r\n\r\n const state = isNormal ? label : label.ensureState(stateName);\r\n let text = seriesModel.getFormattedLabel(dataIndex, stateName);\r\n if (isNormal) {\r\n text = text || this.node.name;\r\n }\r\n\r\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\r\n if (text) {\r\n state.style.text = text;\r\n }\r\n // Not displaying text when angle is too small\r\n const isShown = labelStateModel.get('show');\r\n if (isShown != null && !isNormal) {\r\n state.ignore = !isShown;\r\n }\r\n\r\n const labelPosition = getLabelAttr(labelStateModel, 'position');\r\n\r\n const sectorState = isNormal ? sector : sector.states[stateName];\r\n const labelColor = sectorState.style.fill as ColorString;\r\n sectorState.textConfig = {\r\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\r\n inside: labelPosition !== 'outside'\r\n };\r\n\r\n let r;\r\n const labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\r\n let textAlign = getLabelAttr(labelStateModel, 'align');\r\n const rotateType = getLabelAttr(labelStateModel, 'rotate');\r\n const flipStartAngle = Math.PI * 0.5;\r\n const flipEndAngle = Math.PI * 1.5;\r\n const midAngleNormal = normalizeRadian(rotateType === 'tangential' ? Math.PI / 2 - midAngle : midAngle);\r\n\r\n // For text that is up-side down, rotate 180 degrees to make sure\r\n // it's readable\r\n const needsFlip = midAngleNormal > flipStartAngle\r\n && !isRadianAroundZero(midAngleNormal - flipStartAngle)\r\n && midAngleNormal < flipEndAngle;\r\n\r\n if (labelPosition === 'outside') {\r\n r = layout.r + labelPadding;\r\n textAlign = needsFlip ? 'right' : 'left';\r\n }\r\n else {\r\n if (!textAlign || textAlign === 'center') {\r\n // Put label in the center if it's a circle\r\n if (angle === 2 * Math.PI && layout.r0 === 0) {\r\n r = 0;\r\n }\r\n else {\r\n r = (layout.r + layout.r0) / 2;\r\n }\r\n textAlign = 'center';\r\n }\r\n else if (textAlign === 'left') {\r\n r = layout.r0 + labelPadding;\r\n textAlign = needsFlip ? 'right' : 'left';\r\n }\r\n else if (textAlign === 'right') {\r\n r = layout.r - labelPadding;\r\n textAlign = needsFlip ? 'left' : 'right';\r\n }\r\n }\r\n\r\n state.style.align = textAlign;\r\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\r\n\r\n state.x = r * dx + layout.cx;\r\n state.y = r * dy + layout.cy;\r\n\r\n let rotate = 0;\r\n if (rotateType === 'radial') {\r\n rotate = normalizeRadian(-midAngle)\r\n + (needsFlip ? Math.PI : 0);\r\n }\r\n else if (rotateType === 'tangential') {\r\n rotate = normalizeRadian(Math.PI / 2 - midAngle)\r\n + (needsFlip ? Math.PI : 0);\r\n }\r\n else if (zrUtil.isNumber(rotateType)) {\r\n rotate = rotateType * Math.PI / 180;\r\n }\r\n\r\n state.rotation = normalizeRadian(rotate);\r\n });\r\n\r\n\r\n type LabelOpt = SunburstSeriesOption['label'];\r\n function getLabelAttr(model: Model, name: T): LabelOpt[T] {\r\n const stateAttr = model.get(name);\r\n if (stateAttr == null) {\r\n return normalLabelModel.get(name) as LabelOpt[T];\r\n }\r\n return stateAttr;\r\n }\r\n\r\n label.dirtyStyle();\r\n }\r\n}\r\n\r\n\r\nexport default SunburstPiece;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * @file Sunburst action\r\n */\r\n\r\nimport SunburstSeriesModel from './SunburstSeries';\r\nimport { Payload } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { extend } from 'zrender/src/core/util';\r\nimport { deprecateReplaceLog } from '../../util/log';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport { retrieveTargetInfo, aboveViewRoot } from '../helper/treeHelper';\r\n\r\nexport const ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\r\n\r\ninterface SunburstRootToNodePayload extends Payload {}\r\n\r\n\r\nconst HIGHLIGHT_ACTION = 'sunburstHighlight';\r\n\r\ninterface SunburstHighlightPayload extends Payload {}\r\n\r\n\r\nconst UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\r\n\r\ninterface SunburstUnhighlightPayload extends Payload {}\r\n\r\nexport function installSunburstAction(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerAction(\r\n {type: ROOT_TO_NODE_ACTION, update: 'updateView'},\r\n function (payload: SunburstRootToNodePayload, ecModel: GlobalModel) {\r\n\r\n ecModel.eachComponent(\r\n {mainType: 'series', subType: 'sunburst', query: payload},\r\n handleRootToNode\r\n );\r\n\r\n function handleRootToNode(model: SunburstSeriesModel, index: number) {\r\n const targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\r\n\r\n if (targetInfo) {\r\n const originViewRoot = model.getViewRoot();\r\n if (originViewRoot) {\r\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node)\r\n ? 'rollUp' : 'drillDown';\r\n }\r\n model.resetViewRoot(targetInfo.node);\r\n }\r\n }\r\n }\r\n );\r\n\r\n registers.registerAction(\r\n {type: HIGHLIGHT_ACTION, update: 'none'},\r\n function (payload: SunburstHighlightPayload, ecModel: GlobalModel, api: ExtensionAPI) {\r\n // Clone\r\n payload = extend({}, payload);\r\n ecModel.eachComponent(\r\n {mainType: 'series', subType: 'sunburst', query: payload},\r\n handleHighlight\r\n );\r\n\r\n function handleHighlight(model: SunburstSeriesModel) {\r\n const targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\r\n if (targetInfo) {\r\n payload.dataIndex = targetInfo.node.dataIndex;\r\n }\r\n }\r\n\r\n if (__DEV__) {\r\n deprecateReplaceLog('sunburstHighlight', 'highlight');\r\n }\r\n\r\n // Fast forward action\r\n api.dispatchAction(extend(payload, {\r\n type: 'highlight'\r\n }));\r\n }\r\n );\r\n\r\n registers.registerAction(\r\n {type: UNHIGHLIGHT_ACTION, update: 'updateView'},\r\n function (payload: SunburstUnhighlightPayload, ecModel: GlobalModel, api: ExtensionAPI) {\r\n payload = extend({}, payload);\r\n\r\n if (__DEV__) {\r\n deprecateReplaceLog('sunburstUnhighlight', 'downplay');\r\n }\r\n\r\n api.dispatchAction(extend(payload, {\r\n type: 'downplay'\r\n }));\r\n }\r\n );\r\n\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ChartView from '../../view/Chart';\r\nimport SunburstPiece from './SunburstPiece';\r\nimport DataDiffer from '../../data/DataDiffer';\r\nimport SunburstSeriesModel, { SunburstSeriesNodeItemOption } from './SunburstSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { TreeNode } from '../../data/Tree';\r\nimport { ROOT_TO_NODE_ACTION } from './sunburstAction';\r\nimport { windowOpen } from '../../util/format';\r\n\r\ninterface DrawTreeNode extends TreeNode {\r\n parentNode: DrawTreeNode\r\n piece: SunburstPiece\r\n children: DrawTreeNode[]\r\n}\r\nclass SunburstView extends ChartView {\r\n\r\n static readonly type = 'sunburst';\r\n readonly type = SunburstView.type;\r\n\r\n seriesModel: SunburstSeriesModel;\r\n api: ExtensionAPI;\r\n ecModel: GlobalModel;\r\n\r\n virtualPiece: SunburstPiece;\r\n\r\n private _oldChildren: DrawTreeNode[];\r\n\r\n render(\r\n seriesModel: SunburstSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n // @ts-ignore\r\n payload\r\n ) {\r\n const self = this;\r\n\r\n this.seriesModel = seriesModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n\r\n const data = seriesModel.getData();\r\n const virtualRoot = data.tree.root as DrawTreeNode;\r\n\r\n const newRoot = seriesModel.getViewRoot() as DrawTreeNode;\r\n\r\n const group = this.group;\r\n\r\n const renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\r\n\r\n const newChildren: DrawTreeNode[] = [];\r\n newRoot.eachNode(function (node: DrawTreeNode) {\r\n newChildren.push(node);\r\n });\r\n const oldChildren = this._oldChildren || [];\r\n\r\n dualTravel(newChildren, oldChildren);\r\n\r\n renderRollUp(virtualRoot, newRoot);\r\n\r\n this._initEvents();\r\n\r\n this._oldChildren = newChildren;\r\n\r\n function dualTravel(newChildren: DrawTreeNode[], oldChildren: DrawTreeNode[]) {\r\n if (newChildren.length === 0 && oldChildren.length === 0) {\r\n return;\r\n }\r\n\r\n new DataDiffer(oldChildren, newChildren, getKey, getKey)\r\n .add(processNode)\r\n .update(processNode)\r\n .remove(zrUtil.curry(processNode, null))\r\n .execute();\r\n\r\n function getKey(node: DrawTreeNode) {\r\n return node.getId();\r\n }\r\n\r\n function processNode(newIdx: number, oldIdx?: number) {\r\n const newNode = newIdx == null ? null : newChildren[newIdx];\r\n const oldNode = oldIdx == null ? null : oldChildren[oldIdx];\r\n\r\n doRenderNode(newNode, oldNode);\r\n }\r\n }\r\n\r\n function doRenderNode(newNode: DrawTreeNode, oldNode: DrawTreeNode) {\r\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\r\n // Not render data with value 0\r\n newNode = null;\r\n }\r\n\r\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\r\n if (oldNode && oldNode.piece) {\r\n if (newNode) {\r\n // Update\r\n oldNode.piece.updateData(\r\n false, newNode, seriesModel, ecModel, api\r\n );\r\n\r\n // For tooltip\r\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\r\n }\r\n else {\r\n // Remove\r\n removeNode(oldNode);\r\n }\r\n }\r\n else if (newNode) {\r\n // Add\r\n const piece = new SunburstPiece(\r\n newNode,\r\n seriesModel,\r\n ecModel,\r\n api\r\n );\r\n group.add(piece);\r\n\r\n // For tooltip\r\n data.setItemGraphicEl(newNode.dataIndex, piece);\r\n }\r\n }\r\n }\r\n\r\n function removeNode(node: DrawTreeNode) {\r\n if (!node) {\r\n return;\r\n }\r\n\r\n if (node.piece) {\r\n group.remove(node.piece);\r\n node.piece = null;\r\n }\r\n }\r\n\r\n function renderRollUp(virtualRoot: DrawTreeNode, viewRoot: DrawTreeNode) {\r\n if (viewRoot.depth > 0) {\r\n // Render\r\n if (self.virtualPiece) {\r\n // Update\r\n self.virtualPiece.updateData(\r\n false, virtualRoot, seriesModel, ecModel, api\r\n );\r\n }\r\n else {\r\n // Add\r\n self.virtualPiece = new SunburstPiece(\r\n virtualRoot,\r\n seriesModel,\r\n ecModel,\r\n api\r\n );\r\n group.add(self.virtualPiece);\r\n }\r\n\r\n // TODO event scope\r\n viewRoot.piece.off('click');\r\n self.virtualPiece.on('click', function (e) {\r\n self._rootToNode(viewRoot.parentNode);\r\n });\r\n }\r\n else if (self.virtualPiece) {\r\n // Remove\r\n group.remove(self.virtualPiece);\r\n self.virtualPiece = null;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n _initEvents() {\r\n this.group.off('click');\r\n this.group.on('click', (e) => {\r\n let targetFound = false;\r\n const viewRoot = this.seriesModel.getViewRoot();\r\n viewRoot.eachNode((node: DrawTreeNode) => {\r\n if (!targetFound\r\n && node.piece && node.piece === e.target\r\n ) {\r\n const nodeClick = node.getModel().get('nodeClick');\r\n if (nodeClick === 'rootToNode') {\r\n this._rootToNode(node);\r\n }\r\n else if (nodeClick === 'link') {\r\n const itemModel = node.getModel();\r\n const link = itemModel.get('link');\r\n if (link) {\r\n const linkTarget = itemModel.get('target', true)\r\n || '_blank';\r\n windowOpen(link, linkTarget);\r\n }\r\n }\r\n targetFound = true;\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n _rootToNode(node: DrawTreeNode) {\r\n if (node !== this.seriesModel.getViewRoot()) {\r\n this.api.dispatchAction({\r\n type: ROOT_TO_NODE_ACTION,\r\n from: this.uid,\r\n seriesId: this.seriesModel.id,\r\n targetNode: node\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * @implement\r\n */\r\n containPoint(point: number[], seriesModel: SunburstSeriesModel) {\r\n const treeRoot = seriesModel.getData();\r\n const itemLayout = treeRoot.getItemLayout(0);\r\n if (itemLayout) {\r\n const dx = point[0] - itemLayout.cx;\r\n const dy = point[1] - itemLayout.cy;\r\n const radius = Math.sqrt(dx * dx + dy * dy);\r\n return radius <= itemLayout.r && radius >= itemLayout.r0;\r\n }\r\n }\r\n\r\n}\r\n\r\nexport default SunburstView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SeriesModel from '../../model/Series';\r\nimport Tree, { TreeNode } from '../../data/Tree';\r\nimport {wrapTreePathInfo} from '../helper/treeHelper';\r\nimport {\r\n SeriesOption,\r\n CircleLayoutOptionMixin,\r\n SeriesLabelOption,\r\n ItemStyleOption,\r\n OptionDataValue,\r\n CallbackDataParams,\r\n StatesOptionMixin,\r\n OptionDataItemObject,\r\n DefaultEmphasisFocus,\r\n SunburstColorByMixin\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport Model from '../../model/Model';\r\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree';\r\n\r\ninterface SunburstItemStyleOption extends ItemStyleOption {\r\n // can be 10\r\n // which means that both innerCornerRadius and outerCornerRadius are 10\r\n // can also be an array [20, 10]\r\n // which means that innerCornerRadius is 20\r\n // and outerCornerRadius is 10\r\n // can also be a string or string array, such as ['20%', '50%']\r\n // which means that innerCornerRadius is 20% of the innerRadius\r\n // and outerCornerRadius is half of outerRadius.\r\n borderRadius?: (number | string)[] | number | string\r\n}\r\n\r\ninterface SunburstLabelOption extends Omit, 'rotate' | 'position'> {\r\n rotate?: 'radial' | 'tangential' | number\r\n minAngle?: number\r\n silent?: boolean\r\n position?: SeriesLabelOption['position'] | 'outside'\r\n}\r\n\r\ninterface SunburstDataParams extends CallbackDataParams {\r\n treePathInfo: {\r\n name: string,\r\n dataIndex: number\r\n value: SunburstSeriesNodeItemOption['value']\r\n }[]\r\n}\r\n\r\ninterface SunburstStatesMixin {\r\n emphasis?: {\r\n focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor' | 'relative'\r\n }\r\n}\r\n\r\nexport interface SunburstStateOption {\r\n itemStyle?: SunburstItemStyleOption\r\n label?: SunburstLabelOption\r\n}\r\n\r\nexport interface SunburstSeriesNodeItemOption extends\r\n SunburstStateOption,\r\n StatesOptionMixin, SunburstStatesMixin>,\r\n OptionDataItemObject\r\n{\r\n nodeClick?: 'rootToNode' | 'link' | false\r\n // Available when nodeClick is link\r\n link?: string\r\n target?: string\r\n\r\n children?: SunburstSeriesNodeItemOption[]\r\n\r\n collapsed?: boolean\r\n\r\n cursor?: string\r\n}\r\nexport interface SunburstSeriesLevelOption extends\r\n SunburstStateOption,\r\n StatesOptionMixin, SunburstStatesMixin> {\r\n\r\n radius?: (number | string)[]\r\n /**\r\n * @deprecated use radius instead\r\n */\r\n r?: number | string\r\n /**\r\n * @deprecated use radius instead\r\n */\r\n r0?: number | string\r\n\r\n highlight?: {\r\n itemStyle?: SunburstItemStyleOption\r\n label?: SunburstLabelOption\r\n }\r\n}\r\n\r\ninterface SortParam {\r\n dataIndex: number\r\n depth: number\r\n height: number\r\n getValue(): number\r\n}\r\nexport interface SunburstSeriesOption extends\r\n SeriesOption, SunburstStatesMixin>,\r\n SunburstStateOption,\r\n SunburstColorByMixin,\r\n CircleLayoutOptionMixin {\r\n\r\n type?: 'sunburst'\r\n\r\n clockwise?: boolean\r\n startAngle?: number\r\n minAngle?: number\r\n /**\r\n * If still show when all data zero.\r\n */\r\n stillShowZeroSum?: boolean\r\n /**\r\n * Policy of highlighting pieces when hover on one\r\n * Valid values: 'none' (for not downplay others), 'descendant',\r\n * 'ancestor', 'self'\r\n */\r\n // highlightPolicy?: 'descendant' | 'ancestor' | 'self'\r\n\r\n nodeClick?: 'rootToNode' | 'link' | false\r\n\r\n renderLabelForZeroData?: boolean\r\n\r\n data?: SunburstSeriesNodeItemOption[]\r\n\r\n levels?: SunburstSeriesLevelOption[]\r\n\r\n animationType?: 'expansion' | 'scale'\r\n\r\n sort?: 'desc' | 'asc' | ((a: SortParam, b: SortParam) => number)\r\n}\r\n\r\ninterface SunburstSeriesModel {\r\n getFormattedLabel(\r\n dataIndex: number,\r\n state?: 'emphasis' | 'normal' | 'highlight' | 'blur' | 'select'\r\n ): string\r\n}\r\nclass SunburstSeriesModel extends SeriesModel {\r\n\r\n static readonly type = 'series.sunburst';\r\n readonly type = SunburstSeriesModel.type;\r\n\r\n ignoreStyleOnData = true;\r\n\r\n private _viewRoot: TreeNode;\r\n private _levelModels: Model[];\r\n\r\n getInitialData(option: SunburstSeriesOption, ecModel: GlobalModel) {\r\n // Create a virtual root.\r\n const root = { name: option.name, children: option.data } as SunburstSeriesNodeItemOption;\r\n\r\n completeTreeValue(root);\r\n\r\n const levelModels = this._levelModels =\r\n zrUtil.map(option.levels || [], function (levelDefine) {\r\n return new Model(levelDefine, this, ecModel);\r\n }, this);\r\n\r\n // Make sure always a new tree is created when setOption,\r\n // in TreemapView, we check whether oldTree === newTree\r\n // to choose mappings approach among old shapes and new shapes.\r\n const tree = Tree.createTree(root, this, beforeLink);\r\n\r\n function beforeLink(nodeData: SeriesData) {\r\n nodeData.wrapMethod('getItemModel', function (model, idx) {\r\n const node = tree.getNodeByDataIndex(idx);\r\n const levelModel = levelModels[node.depth];\r\n levelModel && (model.parentModel = levelModel);\r\n return model;\r\n });\r\n }\r\n return tree.data;\r\n }\r\n\r\n optionUpdated() {\r\n this.resetViewRoot();\r\n }\r\n\r\n /*\r\n * @override\r\n */\r\n getDataParams(dataIndex: number) {\r\n const params = super.getDataParams.apply(this, arguments as any) as SunburstDataParams;\r\n\r\n const node = this.getData().tree.getNodeByDataIndex(dataIndex);\r\n params.treePathInfo = wrapTreePathInfo(node, this);\r\n\r\n return params;\r\n }\r\n\r\n getLevelModel(node: TreeNode) {\r\n return this._levelModels && this._levelModels[node.depth];\r\n }\r\n\r\n static defaultOption: SunburstSeriesOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n\r\n // \u9ED8\u8BA4\u5168\u5C40\u5C45\u4E2D\r\n center: ['50%', '50%'],\r\n radius: [0, '75%'],\r\n // \u9ED8\u8BA4\u987A\u65F6\u9488\r\n clockwise: true,\r\n startAngle: 90,\r\n // \u6700\u5C0F\u89D2\u5EA6\u6539\u4E3A0\r\n minAngle: 0,\r\n\r\n // If still show when all data zero.\r\n stillShowZeroSum: true,\r\n\r\n // 'rootToNode', 'link', or false\r\n nodeClick: 'rootToNode',\r\n\r\n renderLabelForZeroData: false,\r\n\r\n label: {\r\n // could be: 'radial', 'tangential', or 'none'\r\n rotate: 'radial',\r\n show: true,\r\n opacity: 1,\r\n // 'left' is for inner side of inside, and 'right' is for outer\r\n // side for inside\r\n align: 'center',\r\n position: 'inside',\r\n distance: 5,\r\n silent: true\r\n },\r\n itemStyle: {\r\n borderWidth: 1,\r\n borderColor: 'white',\r\n borderType: 'solid',\r\n shadowBlur: 0,\r\n shadowColor: 'rgba(0, 0, 0, 0.2)',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 0,\r\n opacity: 1\r\n },\r\n\r\n emphasis: {\r\n focus: 'descendant'\r\n },\r\n\r\n blur: {\r\n itemStyle: {\r\n opacity: 0.2\r\n },\r\n label: {\r\n opacity: 0.1\r\n }\r\n },\r\n\r\n // Animation type can be expansion, scale.\r\n animationType: 'expansion',\r\n animationDuration: 1000,\r\n animationDurationUpdate: 500,\r\n\r\n data: [],\r\n\r\n /**\r\n * Sort order.\r\n *\r\n * Valid values: 'desc', 'asc', null, or callback function.\r\n * 'desc' and 'asc' for descend and ascendant order;\r\n * null for not sorting;\r\n * example of callback function:\r\n * function(nodeA, nodeB) {\r\n * return nodeA.getValue() - nodeB.getValue();\r\n * }\r\n */\r\n sort: 'desc'\r\n };\r\n\r\n getViewRoot() {\r\n return this._viewRoot;\r\n }\r\n\r\n resetViewRoot(viewRoot?: TreeNode) {\r\n viewRoot\r\n ? (this._viewRoot = viewRoot)\r\n : (viewRoot = this._viewRoot);\r\n\r\n const root = this.getRawData().tree.root;\r\n\r\n if (!viewRoot\r\n || (viewRoot !== root && !root.contains(viewRoot))\r\n ) {\r\n this._viewRoot = root;\r\n }\r\n }\r\n\r\n enableAriaDecal() {\r\n enableAriaDecalForTree(this);\r\n }\r\n}\r\n\r\n\r\n\r\nfunction completeTreeValue(dataNode: SunburstSeriesNodeItemOption) {\r\n // Postorder travel tree.\r\n // If value of none-leaf node is not set,\r\n // calculate it by suming up the value of all children.\r\n let sum = 0;\r\n\r\n zrUtil.each(dataNode.children, function (child) {\r\n\r\n completeTreeValue(child);\r\n\r\n let childValue = child.value;\r\n // TODO First value of array must be a number\r\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\r\n sum += childValue as number;\r\n });\r\n\r\n let thisValue = dataNode.value as number;\r\n if (zrUtil.isArray(thisValue)) {\r\n thisValue = thisValue[0];\r\n }\r\n\r\n if (thisValue == null || isNaN(thisValue)) {\r\n thisValue = sum;\r\n }\r\n // Value should not less than 0.\r\n if (thisValue < 0) {\r\n thisValue = 0;\r\n }\r\n\r\n zrUtil.isArray(dataNode.value)\r\n ? (dataNode.value[0] = thisValue)\r\n : (dataNode.value = thisValue);\r\n}\r\n\r\n\r\nexport default SunburstSeriesModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { parsePercent } from '../../util/number';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SunburstSeriesModel, { SunburstSeriesOption } from './SunburstSeries';\r\nimport { TreeNode } from '../../data/Tree';\r\n\r\n// let PI2 = Math.PI * 2;\r\nconst RADIAN = Math.PI / 180;\r\n\r\nexport default function sunburstLayout(\r\n seriesType: 'sunburst',\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n) {\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel: SunburstSeriesModel) {\r\n let center = seriesModel.get('center');\r\n let radius = seriesModel.get('radius');\r\n\r\n if (!zrUtil.isArray(radius)) {\r\n radius = [0, radius];\r\n }\r\n if (!zrUtil.isArray(center)) {\r\n center = [center, center];\r\n }\r\n\r\n const width = api.getWidth();\r\n const height = api.getHeight();\r\n const size = Math.min(width, height);\r\n const cx = parsePercent(center[0], width);\r\n const cy = parsePercent(center[1], height);\r\n const r0 = parsePercent(radius[0], size / 2);\r\n const r = parsePercent(radius[1], size / 2);\r\n\r\n const startAngle = -seriesModel.get('startAngle') * RADIAN;\r\n const minAngle = seriesModel.get('minAngle') * RADIAN;\r\n\r\n const virtualRoot = seriesModel.getData().tree.root;\r\n const treeRoot = seriesModel.getViewRoot();\r\n const rootDepth = treeRoot.depth;\r\n\r\n const sort = seriesModel.get('sort');\r\n if (sort != null) {\r\n initChildren(treeRoot, sort);\r\n }\r\n\r\n let validDataCount = 0;\r\n zrUtil.each(treeRoot.children, function (child) {\r\n !isNaN(child.getValue() as number) && validDataCount++;\r\n });\r\n\r\n const sum = treeRoot.getValue() as number;\r\n // Sum may be 0\r\n const unitRadian = Math.PI / (sum || validDataCount) * 2;\r\n\r\n const renderRollupNode = treeRoot.depth > 0;\r\n const levels = treeRoot.height - (renderRollupNode ? -1 : 1);\r\n const rPerLevel = (r - r0) / (levels || 1);\r\n\r\n const clockwise = seriesModel.get('clockwise');\r\n\r\n const stillShowZeroSum = seriesModel.get('stillShowZeroSum');\r\n\r\n // In the case some sector angle is smaller than minAngle\r\n // let restAngle = PI2;\r\n // let valueSumLargerThanMinAngle = 0;\r\n\r\n const dir = clockwise ? 1 : -1;\r\n\r\n /**\r\n * Render a tree\r\n * @return increased angle\r\n */\r\n const renderNode = function (node: TreeNode, startAngle: number) {\r\n if (!node) {\r\n return;\r\n }\r\n\r\n let endAngle = startAngle;\r\n\r\n // Render self\r\n if (node !== virtualRoot) {\r\n // Tree node is virtual, so it doesn't need to be drawn\r\n const value = node.getValue() as number;\r\n\r\n let angle = (sum === 0 && stillShowZeroSum)\r\n ? unitRadian : (value * unitRadian);\r\n if (angle < minAngle) {\r\n angle = minAngle;\r\n // restAngle -= minAngle;\r\n }\r\n // else {\r\n // valueSumLargerThanMinAngle += value;\r\n // }\r\n\r\n endAngle = startAngle + dir * angle;\r\n\r\n const depth = node.depth - rootDepth\r\n - (renderRollupNode ? -1 : 1);\r\n let rStart = r0 + rPerLevel * depth;\r\n let rEnd = r0 + rPerLevel * (depth + 1);\r\n\r\n const levelModel = seriesModel.getLevelModel(node);\r\n if (levelModel) {\r\n let r0 = levelModel.get('r0', true);\r\n let r = levelModel.get('r', true);\r\n const radius = levelModel.get('radius', true);\r\n\r\n if (radius != null) {\r\n r0 = radius[0];\r\n r = radius[1];\r\n }\r\n\r\n (r0 != null) && (rStart = parsePercent(r0, size / 2));\r\n (r != null) && (rEnd = parsePercent(r, size / 2));\r\n }\r\n\r\n node.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n\r\n // Render children\r\n if (node.children && node.children.length) {\r\n // currentAngle = startAngle;\r\n let siblingAngle = 0;\r\n zrUtil.each(node.children, function (node) {\r\n siblingAngle += renderNode(node, startAngle + siblingAngle);\r\n });\r\n }\r\n\r\n return endAngle - startAngle;\r\n };\r\n\r\n // Virtual root node for roll up\r\n if (renderRollupNode) {\r\n const rStart = r0;\r\n const rEnd = r0 + rPerLevel;\r\n\r\n const angle = Math.PI * 2;\r\n virtualRoot.setLayout({\r\n angle: angle,\r\n startAngle: startAngle,\r\n endAngle: startAngle + angle,\r\n clockwise: clockwise,\r\n cx: cx,\r\n cy: cy,\r\n r0: rStart,\r\n r: rEnd\r\n });\r\n }\r\n\r\n renderNode(treeRoot, startAngle);\r\n });\r\n}\r\n\r\n/**\r\n * Init node children by order and update visual\r\n */\r\nfunction initChildren(node: TreeNode, sortOrder?: SunburstSeriesOption['sort']) {\r\n const children = node.children || [];\r\n\r\n node.children = sort(children, sortOrder);\r\n\r\n // Init children recursively\r\n if (children.length) {\r\n zrUtil.each(node.children, function (child) {\r\n initChildren(child, sortOrder);\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Sort children nodes\r\n *\r\n * @param {TreeNode[]} children children of node to be sorted\r\n * @param {string | function | null} sort sort method\r\n * See SunburstSeries.js for details.\r\n */\r\nfunction sort(children: TreeNode[], sortOrder: SunburstSeriesOption['sort']) {\r\n if (zrUtil.isFunction(sortOrder)) {\r\n const sortTargets = zrUtil.map(children, (child, idx) => {\r\n const value = child.getValue() as number;\r\n return {\r\n params: {\r\n depth: child.depth,\r\n height: child.height,\r\n dataIndex: child.dataIndex,\r\n getValue: () => value\r\n },\r\n index: idx\r\n };\r\n });\r\n sortTargets.sort((a, b) => {\r\n return sortOrder(a.params, b.params);\r\n });\r\n\r\n return zrUtil.map(sortTargets, (target) => {\r\n return children[target.index];\r\n });\r\n }\r\n else {\r\n const isAsc = sortOrder === 'asc';\r\n return children.sort(function (a, b) {\r\n const diff = ((a.getValue() as number) - (b.getValue() as number)) * (isAsc ? 1 : -1);\r\n return diff === 0\r\n ? (a.dataIndex - b.dataIndex) * (isAsc ? -1 : 1)\r\n : diff;\r\n });\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { lift } from 'zrender/src/tool/color';\r\nimport { extend, isString } from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport SunburstSeriesModel, { SunburstSeriesNodeItemOption } from './SunburstSeries';\r\nimport { Dictionary, ColorString } from '../../util/types';\r\nimport { TreeNode } from '../../data/Tree';\r\n\r\nexport default function sunburstVisual(ecModel: GlobalModel) {\r\n\r\n const paletteScope: Dictionary = {};\r\n\r\n // Default color strategy\r\n function pickColor(node: TreeNode, seriesModel: SunburstSeriesModel, treeHeight: number) {\r\n // Choose color from palette based on the first level.\r\n let current = node;\r\n while (current && current.depth > 1) {\r\n current = current.parentNode;\r\n }\r\n let color = seriesModel.getColorFromPalette((current.name || current.dataIndex + ''), paletteScope);\r\n if (node.depth > 1 && isString(color)) {\r\n // Lighter on the deeper level.\r\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\r\n }\r\n return color;\r\n }\r\n\r\n ecModel.eachSeriesByType('sunburst', function (seriesModel: SunburstSeriesModel) {\r\n const data = seriesModel.getData();\r\n const tree = data.tree;\r\n\r\n tree.eachNode(function (node) {\r\n const model = node.getModel();\r\n const style = model.getModel('itemStyle').getItemStyle();\r\n\r\n if (!style.fill) {\r\n style.fill = pickColor(node, seriesModel, tree.root.height);\r\n }\r\n\r\n const existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\r\n extend(existsStyle, style);\r\n });\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport SunburstView from './SunburstView';\r\nimport SunburstSeriesModel from './SunburstSeries';\r\nimport sunburstLayout from './sunburstLayout';\r\nimport sunburstVisual from './sunburstVisual';\r\nimport dataFilter from '../../processor/dataFilter';\r\nimport { curry } from 'zrender/src/core/util';\r\nimport { installSunburstAction } from './sunburstAction';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(SunburstView);\r\n registers.registerSeriesModel(SunburstSeriesModel);\r\n registers.registerLayout(curry(sunburstLayout, 'sunburst'));\r\n registers.registerProcessor(curry(dataFilter, 'sunburst'));\r\n registers.registerVisual(sunburstVisual);\r\n installSunburstAction(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport { ImageProps, ImageStyleProps } from 'zrender/src/graphic/Image';\r\nimport { PathProps, PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { ZRenderType } from 'zrender/src/zrender';\r\nimport { BarGridLayoutOptionForCustomSeries, BarGridLayoutResult } from '../../layout/barGrid';\r\nimport {\r\n AnimationOption,\r\n BlurScope,\r\n CallbackDataParams,\r\n Dictionary,\r\n DimensionLoose,\r\n ItemStyleOption,\r\n LabelOption,\r\n OptionDataValue,\r\n OrdinalRawValue,\r\n ParsedValue,\r\n SeriesDataType,\r\n SeriesEncodeOptionMixin,\r\n SeriesOnCalendarOptionMixin,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n SeriesOnPolarOptionMixin,\r\n SeriesOnSingleOptionMixin,\r\n SeriesOption,\r\n TextCommonOption,\r\n ZRStyleProps\r\n} from '../../util/types';\r\nimport Element from 'zrender/src/Element';\r\nimport SeriesData, { DefaultDataVisual } from '../../data/SeriesData';\r\nimport GlobalModel from '../../model/Global';\r\nimport createSeriesData from '../helper/createSeriesData';\r\nimport { makeInner } from '../../util/model';\r\nimport { CoordinateSystem } from '../../coord/CoordinateSystem';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n Arc,\r\n BezierCurve,\r\n Circle,\r\n CompoundPath,\r\n Ellipse,\r\n Line,\r\n Polygon,\r\n Polyline,\r\n Rect,\r\n Ring,\r\n Sector\r\n} from '../../util/graphic';\r\nimport { TextProps, TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport { GroupProps } from 'zrender/src/graphic/Group';\r\nimport {\r\n TransitionOptionMixin,\r\n TransitionBaseDuringAPI,\r\n TransitionDuringAPI\r\n} from '../../animation/customGraphicTransition';\r\nimport { TransformProp } from 'zrender/src/core/Transformable';\r\nimport { ElementKeyframeAnimationOption } from '../../animation/customGraphicKeyframeAnimation';\r\n\r\nexport type CustomExtraElementInfo = Dictionary;\r\n\r\n// Also compat with ec4, where\r\n// `visual('color') visual('borderColor')` is supported.\r\nexport const STYLE_VISUAL_TYPE = {\r\n color: 'fill',\r\n borderColor: 'stroke'\r\n} as const;\r\nexport type StyleVisualProps = keyof typeof STYLE_VISUAL_TYPE;\r\n\r\nexport const NON_STYLE_VISUAL_PROPS = {\r\n symbol: 1,\r\n symbolSize: 1,\r\n symbolKeepAspect: 1,\r\n legendIcon: 1,\r\n visualMeta: 1,\r\n liftZ: 1,\r\n decal: 1\r\n} as const;\r\nexport type NonStyleVisualProps = keyof typeof NON_STYLE_VISUAL_PROPS;\r\n\r\n// Do not declare \"Dictionary\" in ElementTransitionOptions to restrict the type check.\r\ntype ShapeMorphingOption = {\r\n /**\r\n * If do shape morphing animation when type is changed.\r\n * Only available on path.\r\n */\r\n morph?: boolean\r\n};\r\n\r\nexport interface CustomBaseElementOption extends Partial> {\r\n // element type, required.\r\n type: string;\r\n id?: string;\r\n // For animation diff.\r\n name?: string;\r\n info?: CustomExtraElementInfo;\r\n // `false` means remove the textContent.\r\n textContent?: CustomTextOption | false;\r\n // `false` means remove the clipPath\r\n clipPath?: CustomBaseZRPathOption | false;\r\n // `extra` can be set in any el option for custom prop for annimation duration.\r\n extra?: Dictionary & TransitionOptionMixin;\r\n // updateDuringAnimation\r\n during?(params: TransitionBaseDuringAPI): void;\r\n\r\n enterAnimation?: AnimationOption\r\n updateAnimation?: AnimationOption\r\n leaveAnimation?: AnimationOption\r\n};\r\n\r\nexport interface CustomDisplayableOption extends CustomBaseElementOption, Partial> {\r\n style?: ZRStyleProps;\r\n during?(params: TransitionDuringAPI): void;\r\n /**\r\n * @deprecated\r\n */\r\n // `false` means remove emphasis trigger.\r\n styleEmphasis?: ZRStyleProps | false;\r\n emphasis?: CustomDisplayableOptionOnState;\r\n blur?: CustomDisplayableOptionOnState;\r\n select?: CustomDisplayableOptionOnState;\r\n}\r\nexport interface CustomDisplayableOptionOnState extends Partial> {\r\n // `false` means remove emphasis trigger.\r\n style?: ZRStyleProps | false;\r\n}\r\nexport interface CustomGroupOption extends CustomBaseElementOption, TransitionOptionMixin{\r\n type: 'group';\r\n width?: number;\r\n height?: number;\r\n // @deprecated\r\n diffChildrenByName?: boolean;\r\n children: CustomElementOption[];\r\n $mergeChildren?: false | 'byName' | 'byIndex';\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]\r\n}\r\nexport interface CustomBaseZRPathOption\r\n extends CustomDisplayableOption, ShapeMorphingOption, TransitionOptionMixin {\r\n autoBatch?: boolean;\r\n shape?: T & TransitionOptionMixin;\r\n style?: PathProps['style'] & TransitionOptionMixin\r\n during?(params: TransitionDuringAPI): void;\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption\r\n | ElementKeyframeAnimationOption[]\r\n}\r\n\r\ninterface BuiltinShapes {\r\n circle: Partial\r\n rect: Partial\r\n sector: Partial\r\n polygon: Partial\r\n polyline: Partial\r\n line: Partial\r\n arc: Partial\r\n bezierCurve: Partial\r\n ring: Partial\r\n ellipse: Partial\r\n compoundPath: Partial\r\n}\r\n\r\ninterface CustomSVGPathShapeOption {\r\n // SVG Path, like 'M0,0 L0,-20 L70,-1 L70,0 Z'\r\n pathData?: string;\r\n // \"d\" is the alias of `pathData` follows the SVG convention.\r\n d?: string;\r\n layout?: 'center' | 'cover';\r\n x?: number;\r\n y?: number;\r\n width?: number;\r\n height?: number;\r\n}\r\nexport interface CustomSVGPathOption extends CustomBaseZRPathOption {\r\n type: 'path';\r\n}\r\n\r\ninterface CustomBuitinPathOption\r\n extends CustomBaseZRPathOption {\r\n type: T\r\n}\r\ntype CreateCustomBuitinPathOption = T extends any\r\n ? CustomBuitinPathOption : never;\r\n\r\nexport type CustomPathOption = CreateCustomBuitinPathOption\r\n | CustomSVGPathOption;\r\n\r\nexport interface CustomImageOptionOnState extends CustomDisplayableOptionOnState {\r\n style?: ImageStyleProps;\r\n}\r\nexport interface CustomImageOption extends CustomDisplayableOption, TransitionOptionMixin {\r\n type: 'image';\r\n style?: ImageStyleProps & TransitionOptionMixin;\r\n emphasis?: CustomImageOptionOnState;\r\n blur?: CustomImageOptionOnState;\r\n select?: CustomImageOptionOnState;\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]\r\n}\r\n\r\nexport interface CustomTextOptionOnState extends CustomDisplayableOptionOnState {\r\n style?: TextStyleProps;\r\n}\r\nexport interface CustomTextOption extends CustomDisplayableOption, TransitionOptionMixin {\r\n type: 'text';\r\n style?: TextStyleProps & TransitionOptionMixin;\r\n emphasis?: CustomTextOptionOnState;\r\n blur?: CustomTextOptionOnState;\r\n select?: CustomTextOptionOnState;\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]\r\n}\r\n\r\nexport type CustomElementOption = CustomPathOption\r\n | CustomImageOption\r\n | CustomTextOption\r\n | CustomGroupOption;\r\n\r\n// Can only set focus, blur on the root element.\r\nexport type CustomRootElementOption = CustomElementOption & {\r\n focus?: 'none' | 'self' | 'series' | ArrayLike\r\n blurScope?: BlurScope\r\n\r\n emphasisDisabled?: boolean\r\n};\r\n\r\nexport type CustomElementOptionOnState = CustomDisplayableOptionOnState\r\n | CustomImageOptionOnState;\r\n\r\nexport interface CustomSeriesRenderItemAPI extends\r\n CustomSeriesRenderItemCoordinateSystemAPI {\r\n\r\n // Methods from ExtensionAPI.\r\n // NOTE: Not using Pick here because we don't want to bundle ExtensionAPI into the d.ts\r\n getWidth(): number\r\n getHeight(): number\r\n getZr(): ZRenderType\r\n getDevicePixelRatio(): number\r\n\r\n value(dim: DimensionLoose, dataIndexInside?: number): ParsedValue;\r\n ordinalRawValue(dim: DimensionLoose, dataIndexInside?: number): ParsedValue | OrdinalRawValue;\r\n /**\r\n * @deprecated\r\n */\r\n style(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;\r\n /**\r\n * @deprecated\r\n */\r\n styleEmphasis(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;\r\n visual(\r\n visualType: VT,\r\n dataIndexInside?: number\r\n ): VT extends NonStyleVisualProps ? DefaultDataVisual[VT]\r\n : VT extends StyleVisualProps ? PathStyleProps[typeof STYLE_VISUAL_TYPE[VT]]\r\n : void;\r\n barLayout(opt: BarGridLayoutOptionForCustomSeries): BarGridLayoutResult;\r\n currentSeriesIndices(): number[];\r\n font(opt: Pick): string;\r\n}\r\nexport interface CustomSeriesRenderItemParamsCoordSys {\r\n type: string;\r\n // And extra params for each coordinate systems.\r\n}\r\nexport interface CustomSeriesRenderItemCoordinateSystemAPI {\r\n coord(\r\n data: OptionDataValue | OptionDataValue[],\r\n clamp?: boolean\r\n ): number[];\r\n size?(\r\n dataSize: OptionDataValue | OptionDataValue[],\r\n dataItem?: OptionDataValue | OptionDataValue[]\r\n ): number | number[];\r\n}\r\n\r\nexport type WrapEncodeDefRet = Dictionary;\r\n\r\nexport interface CustomSeriesRenderItemParams {\r\n context: Dictionary;\r\n dataIndex: number;\r\n seriesId: string;\r\n seriesName: string;\r\n seriesIndex: number;\r\n coordSys: CustomSeriesRenderItemParamsCoordSys;\r\n encode: WrapEncodeDefRet;\r\n\r\n dataIndexInside: number;\r\n dataInsideLength: number;\r\n\r\n actionType?: string;\r\n}\r\n\r\nexport type CustomSeriesRenderItemReturn = CustomRootElementOption | undefined | null;\r\n\r\nexport type CustomSeriesRenderItem = (\r\n params: CustomSeriesRenderItemParams,\r\n api: CustomSeriesRenderItemAPI\r\n) => CustomSeriesRenderItemReturn;\r\n\r\nexport interface CustomSeriesOption extends\r\n SeriesOption, // don't support StateOption in custom series.\r\n SeriesEncodeOptionMixin,\r\n SeriesOnCartesianOptionMixin,\r\n SeriesOnPolarOptionMixin,\r\n SeriesOnSingleOptionMixin,\r\n SeriesOnGeoOptionMixin,\r\n SeriesOnCalendarOptionMixin {\r\n\r\n type?: 'custom'\r\n\r\n // If set as 'none', do not depends on coord sys.\r\n coordinateSystem?: string | 'none';\r\n\r\n renderItem?: CustomSeriesRenderItem;\r\n\r\n /**\r\n * @deprecated\r\n */\r\n itemStyle?: ItemStyleOption;\r\n /**\r\n * @deprecated\r\n */\r\n label?: LabelOption;\r\n\r\n /**\r\n * @deprecated\r\n */\r\n emphasis?: {\r\n /**\r\n * @deprecated\r\n */\r\n itemStyle?: ItemStyleOption;\r\n /**\r\n * @deprecated\r\n */\r\n label?: LabelOption;\r\n }\r\n\r\n // Only works on polar and cartesian2d coordinate system.\r\n clip?: boolean;\r\n}\r\n\r\nexport const customInnerStore = makeInner<{\r\n info: CustomExtraElementInfo;\r\n customPathData: string;\r\n customGraphicType: string;\r\n customImagePath: CustomImageOption['style']['image'];\r\n // customText: string;\r\n txConZ2Set: number;\r\n option: CustomElementOption;\r\n}, Element>();\r\n\r\nexport default class CustomSeriesModel extends SeriesModel {\r\n\r\n static type = 'series.custom';\r\n readonly type = CustomSeriesModel.type;\r\n\r\n static dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\r\n\r\n // preventAutoZ = true;\r\n\r\n currentZLevel: number;\r\n currentZ: number;\r\n\r\n static defaultOption: CustomSeriesOption = {\r\n coordinateSystem: 'cartesian2d', // Can be set as 'none'\r\n // zlevel: 0,\r\n z: 2,\r\n legendHoverLink: true,\r\n\r\n // Custom series will not clip by default.\r\n // Some case will use custom series to draw label\r\n // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight\r\n clip: false\r\n\r\n // Cartesian coordinate system\r\n // xAxisIndex: 0,\r\n // yAxisIndex: 0,\r\n\r\n // Polar coordinate system\r\n // polarIndex: 0,\r\n\r\n // Geo coordinate system\r\n // geoIndex: 0,\r\n };\r\n\r\n optionUpdated() {\r\n this.currentZLevel = this.get('zlevel', true);\r\n this.currentZ = this.get('z', true);\r\n }\r\n\r\n getInitialData(option: CustomSeriesOption, ecModel: GlobalModel): SeriesData {\r\n return createSeriesData(null, this);\r\n }\r\n\r\n getDataParams(dataIndex: number, dataType?: SeriesDataType, el?: Element): CallbackDataParams & {\r\n info: CustomExtraElementInfo\r\n } {\r\n const params = super.getDataParams(dataIndex, dataType) as ReturnType;\r\n el && (params.info = customInnerStore(el).info);\r\n return params;\r\n }\r\n}\r\n\r\nexport type PrepareCustomInfo = (coordSys: CoordinateSystem) => {\r\n coordSys: CustomSeriesRenderItemParamsCoordSys;\r\n api: CustomSeriesRenderItemCoordinateSystemAPI\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Cartesian2D from './Cartesian2D';\r\n\r\nfunction dataToCoordSize(this: Cartesian2D, dataSize: number[], dataItem: number[]): number[] {\r\n // dataItem is necessary in log axis.\r\n dataItem = dataItem || [0, 0];\r\n return zrUtil.map(['x', 'y'], function (dim, dimIdx) {\r\n const axis = this.getAxis(dim);\r\n const val = dataItem[dimIdx];\r\n const halfSize = dataSize[dimIdx] / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n }, this);\r\n}\r\n\r\nexport default function cartesianPrepareCustom(coordSys: Cartesian2D) {\r\n const rect = coordSys.master.getRect();\r\n return {\r\n coordSys: {\r\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\r\n type: 'cartesian2d',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (data: number[]) {\r\n // do not provide \"out\" param\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: zrUtil.bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Geo from './Geo';\r\n\r\nfunction dataToCoordSize(this: Geo, dataSize: number[], dataItem: number[]): number[] {\r\n dataItem = dataItem || [0, 0];\r\n return zrUtil.map([0, 1], function (dimIdx) {\r\n const val = dataItem[dimIdx];\r\n const halfSize = dataSize[dimIdx] / 2;\r\n const p1 = [];\r\n const p2 = [];\r\n p1[dimIdx] = val - halfSize;\r\n p2[dimIdx] = val + halfSize;\r\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\r\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\r\n }, this);\r\n}\r\n\r\nexport default function geoPrepareCustom(coordSys: Geo) {\r\n const rect = coordSys.getBoundingRect();\r\n return {\r\n coordSys: {\r\n type: 'geo',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n zoom: coordSys.getZoom()\r\n },\r\n api: {\r\n coord: function (data: number[]): number[] {\r\n // do not provide \"out\" and noRoam param,\r\n // Compatible with this usage:\r\n // echarts.util.map(item.points, api.coord)\r\n return coordSys.dataToPoint(data);\r\n },\r\n size: zrUtil.bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Single from './Single';\r\nimport { bind } from 'zrender/src/core/util';\r\n\r\nfunction dataToCoordSize(this: Single, dataSize: number | number[], dataItem: number | number[]) {\r\n // dataItem is necessary in log axis.\r\n const axis = this.getAxis();\r\n const val = dataItem instanceof Array ? dataItem[0] : dataItem;\r\n const halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\r\n return axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n}\r\n\r\nexport default function singlePrepareCustom(coordSys: Single) {\r\n const rect = coordSys.getRect();\r\n\r\n return {\r\n coordSys: {\r\n type: 'singleAxis',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height\r\n },\r\n api: {\r\n coord: function (val: number) {\r\n // do not provide \"out\" param\r\n return coordSys.dataToPoint(val);\r\n },\r\n size: bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Polar from './Polar';\r\nimport RadiusAxis from './RadiusAxis';\r\n// import AngleAxis from './AngleAxis';\r\n\r\nfunction dataToCoordSize(this: Polar, dataSize: number[], dataItem: number[]) {\r\n // dataItem is necessary in log axis.\r\n dataItem = dataItem || [0, 0];\r\n return zrUtil.map(['Radius', 'Angle'], function (dim, dimIdx) {\r\n const getterName = 'get' + dim + 'Axis' as 'getAngleAxis'| 'getRadiusAxis';\r\n // TODO: TYPE Check Angle Axis\r\n const axis = this[getterName]() as RadiusAxis;\r\n const val = dataItem[dimIdx];\r\n const halfSize = dataSize[dimIdx] / 2;\r\n\r\n let result = axis.type === 'category'\r\n ? axis.getBandWidth()\r\n : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\r\n\r\n if (dim === 'Angle') {\r\n result = result * Math.PI / 180;\r\n }\r\n\r\n return result;\r\n\r\n }, this);\r\n}\r\n\r\nexport default function polarPrepareCustom(coordSys: Polar) {\r\n const radiusAxis = coordSys.getRadiusAxis();\r\n const angleAxis = coordSys.getAngleAxis();\r\n const radius = radiusAxis.getExtent();\r\n radius[0] > radius[1] && radius.reverse();\r\n\r\n return {\r\n coordSys: {\r\n type: 'polar',\r\n cx: coordSys.cx,\r\n cy: coordSys.cy,\r\n r: radius[1],\r\n r0: radius[0]\r\n },\r\n api: {\r\n coord: function (data: number[]) {\r\n const radius = radiusAxis.dataToRadius(data[0]);\r\n const angle = angleAxis.dataToAngle(data[1]);\r\n const coord = coordSys.coordToPoint([radius, angle]);\r\n coord.push(radius, angle * Math.PI / 180);\r\n return coord;\r\n },\r\n size: zrUtil.bind(dataToCoordSize, coordSys)\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Calendar from './Calendar';\r\nimport { OptionDataValueDate } from '../../util/types';\r\n\r\nexport default function calendarPrepareCustom(coordSys: Calendar) {\r\n const rect = coordSys.getRect();\r\n const rangeInfo = coordSys.getRangeInfo();\r\n\r\n return {\r\n coordSys: {\r\n type: 'calendar',\r\n x: rect.x,\r\n y: rect.y,\r\n width: rect.width,\r\n height: rect.height,\r\n cellWidth: coordSys.getCellWidth(),\r\n cellHeight: coordSys.getCellHeight(),\r\n rangeInfo: {\r\n start: rangeInfo.start,\r\n end: rangeInfo.end,\r\n weeks: rangeInfo.weeks,\r\n dayCount: rangeInfo.allDay\r\n }\r\n },\r\n api: {\r\n coord: function (data: OptionDataValueDate, clamp?: boolean) {\r\n return coordSys.dataToPoint(data, clamp);\r\n }\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { Dictionary, ZRStyleProps } from './types';\r\nimport { ElementTextConfig } from 'zrender/src/Element';\r\nimport { TextStyleProps, TextStylePropsPart, TextProps } from 'zrender/src/graphic/Text';\r\nimport { each, hasOwn } from 'zrender/src/core/util';\r\nimport { ItemStyleProps } from '../model/mixin/itemStyle';\r\n\r\nexport interface LegacyStyleProps {\r\n legacy?: boolean\r\n}\r\n\r\nconst deprecatedLogs = {} as Dictionary;\r\n\r\n/**\r\n * Whether need to call `convertEC4CompatibleStyle`.\r\n */\r\nexport function isEC4CompatibleStyle(\r\n style: ZRStyleProps & LegacyStyleProps,\r\n elType: string,\r\n hasOwnTextContentOption: boolean,\r\n hasOwnTextConfig: boolean\r\n): boolean {\r\n // Since echarts5, `RectText` is separated from its host element and style.text\r\n // does not exist any more. The compat work brings some extra burden on performance.\r\n // So we provide:\r\n // `legacy: true` force make compat.\r\n // `legacy: false`, force do not compat.\r\n // `legacy` not set: auto detect whether legacy.\r\n // But in this case we do not compat (difficult to detect and rare case):\r\n // Becuse custom series and graphic component support \"merge\", users may firstly\r\n // only set `textStrokeWidth` style or secondly only set `text`.\r\n return style && (\r\n style.legacy\r\n || (\r\n style.legacy !== false\r\n && !hasOwnTextContentOption\r\n && !hasOwnTextConfig\r\n && elType !== 'tspan'\r\n // Difficult to detect whether legacy for a \"text\" el.\r\n && (elType === 'text' || hasOwn(style, 'text'))\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.\r\n * @param hostStyle The properties might be modified.\r\n * @return If be text el, `textContentStyle` and `textConfig` will not be returned.\r\n * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area\r\n * retried from the `hostStyle`.\r\n */\r\nexport function convertFromEC4CompatibleStyle(hostStyle: ZRStyleProps, elType: string, isNormal: boolean): {\r\n textContent: TextProps & {type: string},\r\n textConfig: ElementTextConfig\r\n} {\r\n const srcStyle = hostStyle as Dictionary;\r\n let textConfig: ElementTextConfig;\r\n let textContent: TextProps & {type: string};\r\n\r\n let textContentStyle: TextStyleProps;\r\n if (elType === 'text') {\r\n textContentStyle = srcStyle;\r\n }\r\n else {\r\n textContentStyle = {};\r\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\r\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\r\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\r\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\r\n hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily);\r\n hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize);\r\n hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle);\r\n hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight);\r\n\r\n textContent = {\r\n type: 'text',\r\n style: textContentStyle,\r\n // ec4 does not support rectText trigger.\r\n // And when text position is different in normal and emphasis\r\n // => hover text trigger emphasis;\r\n // => text position changed, leave mouse pointer immediately;\r\n // That might cause incorrect state.\r\n silent: true\r\n };\r\n textConfig = {};\r\n const hasOwnPos = hasOwn(srcStyle, 'textPosition');\r\n if (isNormal) {\r\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\r\n }\r\n else {\r\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\r\n }\r\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\r\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\r\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\r\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\r\n }\r\n\r\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\r\n\r\n each(textContentStyle.rich, function (richItem) {\r\n convertEC4CompatibleRichItem(richItem as TextStyleProps, richItem);\r\n });\r\n\r\n return {\r\n textConfig: textConfig,\r\n textContent: textContent\r\n };\r\n}\r\n\r\n/**\r\n * The result will be set to `out`.\r\n */\r\nfunction convertEC4CompatibleRichItem(out: TextStylePropsPart, richItem: Dictionary): void {\r\n if (!richItem) {\r\n return;\r\n }\r\n // (1) For simplicity, make textXXX properties (deprecated since ec5) has\r\n // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`\r\n // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached\r\n // richText in ec5.\r\n // (2) `out === richItem` if and only if `out` is text el or rich item.\r\n // So we can overwrite existing props in `out` since textXXX has higher priority.\r\n richItem.font = richItem.textFont || richItem.font;\r\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\r\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\r\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\r\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\r\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\r\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\r\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\r\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\r\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\r\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\r\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\r\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\r\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\r\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\r\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\r\n}\r\n\r\n/**\r\n * Convert to pure echarts4 format style.\r\n * `itemStyle` will be modified, added with ec4 style properties from\r\n * `textStyle` and `textConfig`.\r\n *\r\n * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where\r\n * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.\r\n */\r\nexport function convertToEC4StyleForCustomSerise(\r\n itemStl: ItemStyleProps,\r\n txStl: TextStyleProps,\r\n txCfg: ElementTextConfig\r\n): ZRStyleProps {\r\n\r\n const out = itemStl as Dictionary;\r\n\r\n // See `custom.ts`, a trick to set extra `textPosition` firstly.\r\n out.textPosition = out.textPosition || txCfg.position || 'inside';\r\n txCfg.offset != null && (out.textOffset = txCfg.offset);\r\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\r\n txCfg.distance != null && (out.textDistance = txCfg.distance);\r\n\r\n const isInside = (out.textPosition as string).indexOf('inside') >= 0;\r\n const hostFill = itemStl.fill || '#000';\r\n\r\n convertToEC4RichItem(out, txStl);\r\n\r\n const textFillNotSet = out.textFill == null;\r\n if (isInside) {\r\n if (textFillNotSet) {\r\n out.textFill = txCfg.insideFill || '#fff';\r\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\r\n !out.textStroke && (out.textStroke = hostFill);\r\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\r\n }\r\n }\r\n else {\r\n if (textFillNotSet) {\r\n out.textFill = itemStl.fill || txCfg.outsideFill || '#000';\r\n }\r\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\r\n }\r\n\r\n out.text = txStl.text;\r\n out.rich = txStl.rich;\r\n\r\n each(txStl.rich, function (richItem) {\r\n convertToEC4RichItem(richItem as Dictionary, richItem);\r\n });\r\n\r\n return out;\r\n}\r\n\r\nfunction convertToEC4RichItem(out: Dictionary, richItem: TextStylePropsPart) {\r\n if (!richItem) {\r\n return;\r\n }\r\n\r\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\r\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\r\n\r\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\r\n hasOwn(richItem, 'font') && (out.font = richItem.font);\r\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\r\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\r\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\r\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\r\n\r\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\r\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\r\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\r\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\r\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\r\n\r\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\r\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\r\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\r\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\r\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\r\n\r\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\r\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\r\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\r\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\r\n\r\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\r\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\r\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\r\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\r\n}\r\n\r\nexport function warnDeprecated(deprecated: string, insteadApproach: string): void {\r\n if (__DEV__) {\r\n const key = deprecated + '^_^' + insteadApproach;\r\n if (!deprecatedLogs[key]) {\r\n console.warn(`[ECharts] DEPRECATED: \"${deprecated}\" has been deprecated. ${insteadApproach}`);\r\n deprecatedLogs[key] = true;\r\n }\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Helpers for creating transitions in custom series and graphic components.\r\nimport Element, { ElementAnimateConfig, ElementProps } from 'zrender/src/Element';\r\n\r\nimport { makeInner, normalizeToArray } from '../util/model';\r\nimport { assert, bind, each, eqNaN, extend, hasOwn, indexOf, isArrayLike, keys, reduce } from 'zrender/src/core/util';\r\nimport { cloneValue } from 'zrender/src/animation/Animator';\r\nimport Displayable, { DisplayableProps } from 'zrender/src/graphic/Displayable';\r\nimport Model from '../model/Model';\r\nimport { getAnimationConfig } from './basicTransition';\r\nimport { Path } from '../util/graphic';\r\nimport { warn } from '../util/log';\r\nimport { AnimationOption, AnimationOptionMixin, ZRStyleProps } from '../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { TRANSFORMABLE_PROPS, TransformProp } from 'zrender/src/core/Transformable';\r\n\r\nconst LEGACY_TRANSFORM_PROPS_MAP = {\r\n position: ['x', 'y'],\r\n scale: ['scaleX', 'scaleY'],\r\n origin: ['originX', 'originY']\r\n} as const;\r\nconst LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP);\r\n\r\nconst TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, (obj, key) => {\r\n obj[key] = 1;\r\n return obj;\r\n}, {} as Record);\r\nconst transformPropNamesStr = TRANSFORMABLE_PROPS.join(', ');\r\n\r\n// '' means root\r\nexport const ELEMENT_ANIMATABLE_PROPS = ['', 'style', 'shape', 'extra'] as const;\r\n\r\nexport type TransitionProps = string | string[];\r\nexport type ElementRootTransitionProp = TransformProp | 'shape' | 'extra' | 'style';\r\n\r\nexport interface TransitionOptionMixin> {\r\n transition?: (keyof T & string) | ((keyof T & string)[]) | 'all'\r\n\r\n enterFrom?: T;\r\n leaveTo?: T;\r\n\r\n enterAnimation?: AnimationOption\r\n updateAnimation?: AnimationOption\r\n leaveAnimation?: AnimationOption\r\n};\r\n\r\ninterface LooseElementProps extends ElementProps {\r\n style?: ZRStyleProps;\r\n shape?: Dictionary;\r\n}\r\n\r\ntype TransitionElementOption = Partial> & {\r\n shape?: Dictionary & TransitionOptionMixin\r\n style?: PathStyleProps & TransitionOptionMixin\r\n extra?: Dictionary & TransitionOptionMixin\r\n invisible?: boolean\r\n silent?: boolean\r\n autoBatch?: boolean\r\n ignore?: boolean\r\n\r\n during?: (params: TransitionDuringAPI) => void\r\n} & TransitionOptionMixin;\r\n\r\nconst transitionInnerStore = makeInner<{\r\n leaveToProps: ElementProps;\r\n userDuring: (params: TransitionDuringAPI) => void;\r\n}, Element>();\r\n\r\nexport interface TransitionBaseDuringAPI {\r\n // Usually other props do not need to be changed in animation during.\r\n setTransform(key: TransformProp, val: number): this\r\n getTransform(key: TransformProp): number;\r\n setExtra(key: string, val: unknown): this\r\n getExtra(key: string): unknown\r\n}\r\nexport interface TransitionDuringAPI<\r\n StyleOpt extends any = any,\r\n ShapeOpt extends any = any\r\n> extends TransitionBaseDuringAPI {\r\n setShape(key: T, val: ShapeOpt[T]): this;\r\n getShape(key: T): ShapeOpt[T];\r\n setStyle(key: T, val: StyleOpt[T]): this\r\n getStyle(key: T): StyleOpt[T];\r\n};\r\n\r\nfunction getElementAnimationConfig(\r\n animationType: 'enter' | 'update' | 'leave',\r\n el: Element,\r\n elOption: TransitionElementOption,\r\n parentModel: Model,\r\n dataIndex?: number\r\n) {\r\n const animationProp = `${animationType}Animation` as const;\r\n const config: ElementAnimateConfig = getAnimationConfig(animationType, parentModel, dataIndex) || {};\r\n\r\n const userDuring = transitionInnerStore(el).userDuring;\r\n // Only set when duration is > 0 and it's need to be animated.\r\n if (config.duration > 0) {\r\n // For simplicity, if during not specified, the previous during will not work any more.\r\n config.during = userDuring ? bind(duringCall, { el: el, userDuring: userDuring }) : null;\r\n config.setToFinal = true;\r\n config.scope = animationType;\r\n }\r\n\r\n extend(config, elOption[animationProp]);\r\n return config;\r\n}\r\n\r\n\r\nexport function applyUpdateTransition(\r\n el: Element,\r\n elOption: TransitionElementOption,\r\n animatableModel?: Model,\r\n opts?: {\r\n dataIndex?: number,\r\n isInit?: boolean,\r\n clearStyle?: boolean\r\n }\r\n) {\r\n opts = opts || {};\r\n const {dataIndex, isInit, clearStyle} = opts;\r\n\r\n const hasAnimation = animatableModel.isAnimationEnabled();\r\n // Save the meta info for further morphing. Like apply on the sub morphing elements.\r\n const store = transitionInnerStore(el);\r\n const styleOpt = elOption.style;\r\n store.userDuring = elOption.during;\r\n\r\n const transFromProps = {} as ElementProps;\r\n const propsToSet = {} as ElementProps;\r\n\r\n prepareTransformAllPropsFinal(el, elOption, propsToSet);\r\n prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet);\r\n prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet);\r\n\r\n if (!isInit && hasAnimation) {\r\n prepareTransformTransitionFrom(el, elOption, transFromProps);\r\n prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps);\r\n prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps);\r\n prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);\r\n }\r\n\r\n (propsToSet as DisplayableProps).style = styleOpt;\r\n\r\n applyPropsDirectly(el, propsToSet, clearStyle);\r\n applyMiscProps(el, elOption);\r\n\r\n if (hasAnimation) {\r\n if (isInit) {\r\n const enterFromProps: ElementProps = {};\r\n each(ELEMENT_ANIMATABLE_PROPS, propName => {\r\n const prop: TransitionOptionMixin = propName ? elOption[propName] : elOption;\r\n if (prop && prop.enterFrom) {\r\n if (propName) {\r\n (enterFromProps as any)[propName] = (enterFromProps as any)[propName] || {};\r\n }\r\n extend(propName ? (enterFromProps as any)[propName] : enterFromProps, prop.enterFrom);\r\n }\r\n });\r\n const config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex);\r\n if (config.duration > 0) {\r\n el.animateFrom(enterFromProps, config);\r\n }\r\n }\r\n else {\r\n applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);\r\n }\r\n }\r\n // Store leave to be used in leave transition.\r\n updateLeaveTo(el, elOption);\r\n\r\n styleOpt ? el.dirty() : el.markRedraw();\r\n}\r\n\r\nexport function updateLeaveTo(el: Element, elOption: TransitionElementOption) {\r\n // Try merge to previous set leaveTo\r\n let leaveToProps: ElementProps = transitionInnerStore(el).leaveToProps;\r\n for (let i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) {\r\n const propName = ELEMENT_ANIMATABLE_PROPS[i];\r\n const prop: TransitionOptionMixin = propName ? elOption[propName] : elOption;\r\n if (prop && prop.leaveTo) {\r\n if (!leaveToProps) {\r\n leaveToProps = transitionInnerStore(el).leaveToProps = {};\r\n }\r\n if (propName) {\r\n (leaveToProps as any)[propName] = (leaveToProps as any)[propName] || {};\r\n }\r\n extend(propName ? (leaveToProps as any)[propName] : leaveToProps, prop.leaveTo);\r\n }\r\n }\r\n}\r\n\r\nexport function applyLeaveTransition(\r\n el: Element,\r\n elOption: TransitionElementOption,\r\n animatableModel: Model,\r\n onRemove?: () => void\r\n): void {\r\n if (el) {\r\n const parent = el.parent;\r\n const leaveToProps = transitionInnerStore(el).leaveToProps;\r\n if (leaveToProps) {\r\n // TODO TODO use leave after leaveAnimation in series is introduced\r\n // TODO Data index?\r\n const config = getElementAnimationConfig('update', el, elOption, animatableModel, 0);\r\n config.done = () => {\r\n parent.remove(el);\r\n onRemove && onRemove();\r\n };\r\n el.animateTo(leaveToProps, config);\r\n }\r\n else {\r\n parent.remove(el);\r\n onRemove && onRemove();\r\n }\r\n }\r\n}\r\n\r\nexport function isTransitionAll(transition: TransitionProps): transition is 'all' {\r\n return transition === 'all';\r\n}\r\n\r\n\r\nfunction applyPropsDirectly(\r\n el: Element,\r\n // Can be null/undefined\r\n allPropsFinal: ElementProps,\r\n clearStyle: boolean\r\n) {\r\n const styleOpt = (allPropsFinal as Displayable).style;\r\n if (!el.isGroup && styleOpt) {\r\n if (clearStyle) {\r\n (el as Displayable).useStyle({});\r\n\r\n // When style object changed, how to trade the existing animation?\r\n // It is probably complicated and not needed to cover all the cases.\r\n // But still need consider the case:\r\n // (1) When using init animation on `style.opacity`, and before the animation\r\n // ended users triggers an update by mousewhel. At that time the init\r\n // animation should better be continued rather than terminated.\r\n // So after `useStyle` called, we should change the animation target manually\r\n // to continue the effect of the init animation.\r\n // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need\r\n // to update the value to `val2` and no animation declared, should be terminate\r\n // the previous animation or just modify the target of the animation?\r\n // Therotically That will happen not only on `style` but also on `shape` and\r\n // `transfrom` props. But we haven't handle this case at present yet.\r\n // (3) PENDING: Is it proper to visit `animators` and `targetName`?\r\n const animators = el.animators;\r\n for (let i = 0; i < animators.length; i++) {\r\n const animator = animators[i];\r\n // targetName is the \"topKey\".\r\n if (animator.targetName === 'style') {\r\n animator.changeTarget((el as Displayable).style);\r\n }\r\n }\r\n }\r\n (el as Displayable).setStyle(styleOpt);\r\n }\r\n\r\n if (allPropsFinal) {\r\n // Not set style here.\r\n (allPropsFinal as DisplayableProps).style = null;\r\n // Set el to the final state firstly.\r\n allPropsFinal && el.attr(allPropsFinal);\r\n (allPropsFinal as DisplayableProps).style = styleOpt;\r\n }\r\n}\r\n\r\nfunction applyPropsTransition(\r\n el: Element,\r\n elOption: TransitionElementOption,\r\n dataIndex: number,\r\n model: Model,\r\n // Can be null/undefined\r\n transFromProps: ElementProps\r\n): void {\r\n if (transFromProps) {\r\n const config = getElementAnimationConfig('update', el, elOption, model, dataIndex);\r\n if (config.duration > 0) {\r\n el.animateFrom(transFromProps, config);\r\n }\r\n }\r\n}\r\n\r\n\r\nfunction applyMiscProps(\r\n el: Element,\r\n elOption: TransitionElementOption\r\n) {\r\n // Merge by default.\r\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\r\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\r\n if (el instanceof Displayable) {\r\n hasOwn(elOption, 'invisible') && ((el as Path).invisible = elOption.invisible);\r\n }\r\n if (el instanceof Path) {\r\n hasOwn(elOption, 'autoBatch') && ((el as Path).autoBatch = elOption.autoBatch);\r\n }\r\n}\r\n\r\n// Use it to avoid it be exposed to user.\r\nconst tmpDuringScope = {} as {\r\n el: Element;\r\n};\r\nconst transitionDuringAPI: TransitionDuringAPI = {\r\n // Usually other props do not need to be changed in animation during.\r\n setTransform(key: TransformProp, val: unknown) {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\r\n }\r\n tmpDuringScope.el[key] = val as number;\r\n return this;\r\n },\r\n getTransform(key: TransformProp): number {\r\n if (__DEV__) {\r\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\r\n }\r\n return tmpDuringScope.el[key];\r\n },\r\n setShape(key: any, val: unknown) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n const el = tmpDuringScope.el as Path;\r\n const shape = el.shape || (el.shape = {});\r\n shape[key] = val;\r\n el.dirtyShape && el.dirtyShape();\r\n return this;\r\n },\r\n getShape(key: any): any {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n const shape = (tmpDuringScope.el as Path).shape;\r\n if (shape) {\r\n return shape[key];\r\n }\r\n },\r\n setStyle(key: any, val: unknown) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n const el = tmpDuringScope.el as Displayable;\r\n const style = el.style;\r\n if (style) {\r\n if (__DEV__) {\r\n if (eqNaN(val)) {\r\n warn('style.' + key + ' must not be assigned with NaN.');\r\n }\r\n }\r\n style[key] = val;\r\n el.dirtyStyle && el.dirtyStyle();\r\n }\r\n return this;\r\n },\r\n getStyle(key: any): any {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n const style = (tmpDuringScope.el as Displayable).style;\r\n if (style) {\r\n return style[key];\r\n }\r\n },\r\n setExtra(key: any, val: unknown) {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n const extra = (tmpDuringScope.el as LooseElementProps).extra\r\n || ((tmpDuringScope.el as LooseElementProps).extra = {});\r\n extra[key] = val;\r\n return this;\r\n },\r\n getExtra(key: string): unknown {\r\n if (__DEV__) {\r\n assertNotReserved(key);\r\n }\r\n const extra = (tmpDuringScope.el as LooseElementProps).extra;\r\n if (extra) {\r\n return extra[key];\r\n }\r\n }\r\n};\r\n\r\nfunction assertNotReserved(key: string) {\r\n if (__DEV__) {\r\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\r\n throw new Error('key must not be \"' + key + '\"');\r\n }\r\n }\r\n}\r\n\r\nfunction duringCall(\r\n this: {\r\n el: Element;\r\n userDuring: (params: TransitionDuringAPI) => void;\r\n }\r\n): void {\r\n // Do not provide \"percent\" until some requirements come.\r\n // Because consider thies case:\r\n // enterFrom: {x: 100, y: 30}, transition: 'x'.\r\n // And enter duration is different from update duration.\r\n // Thus it might be confused about the meaning of \"percent\" in during callback.\r\n const scope = this;\r\n const el = scope.el;\r\n if (!el) {\r\n return;\r\n }\r\n // If el is remove from zr by reason like legend, during still need to called,\r\n // because el will be added back to zr and the prop value should not be incorrect.\r\n\r\n const latestUserDuring = transitionInnerStore(el).userDuring;\r\n const scopeUserDuring = scope.userDuring;\r\n // Ensured a during is only called once in each animation frame.\r\n // If a during is called multiple times in one frame, maybe some users' calculation logic\r\n // might be wrong (not sure whether this usage exists).\r\n // The case of a during might be called twice can be: by default there is a animator for\r\n // 'x', 'y' when init. Before the init animation finished, call `setOption` to start\r\n // another animators for 'style'/'shape'/'extra'.\r\n if (latestUserDuring !== scopeUserDuring) {\r\n // release\r\n scope.el = scope.userDuring = null;\r\n return;\r\n }\r\n\r\n tmpDuringScope.el = el;\r\n\r\n // Give no `this` to user in \"during\" calling.\r\n scopeUserDuring(transitionDuringAPI);\r\n\r\n // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`,\r\n // consider the issue that the prop might be incorrect when return to \"normal\" state.\r\n}\r\n\r\nfunction prepareShapeOrExtraTransitionFrom(\r\n mainAttr: 'shape' | 'extra',\r\n fromEl: Element,\r\n elOption: TransitionOptionMixin,\r\n transFromProps: LooseElementProps\r\n): void {\r\n\r\n const attrOpt: Dictionary & TransitionOptionMixin = (elOption as any)[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n\r\n const elPropsInAttr = (fromEl as LooseElementProps)[mainAttr];\r\n let transFromPropsInAttr: Dictionary;\r\n\r\n if (elPropsInAttr) {\r\n const transition = elOption.transition;\r\n const attrTransition = attrOpt.transition;\r\n if (attrTransition) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n if (isTransitionAll(attrTransition)) {\r\n extend(transFromPropsInAttr, elPropsInAttr);\r\n }\r\n else {\r\n const transitionKeys = normalizeToArray(attrTransition);\r\n for (let i = 0; i < transitionKeys.length; i++) {\r\n const key = transitionKeys[i];\r\n const elVal = elPropsInAttr[key];\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n }\r\n else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {\r\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\r\n const elPropsInAttrKeys = keys(elPropsInAttr);\r\n for (let i = 0; i < elPropsInAttrKeys.length; i++) {\r\n const key = elPropsInAttrKeys[i];\r\n const elVal = elPropsInAttr[key];\r\n if (isNonStyleTransitionEnabled((attrOpt as any)[key], elVal)) {\r\n transFromPropsInAttr[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction prepareShapeOrExtraAllPropsFinal(\r\n mainAttr: 'shape' | 'extra',\r\n elOption: TransitionElementOption,\r\n allProps: LooseElementProps\r\n): void {\r\n const attrOpt: Dictionary = (elOption as any)[mainAttr];\r\n if (!attrOpt) {\r\n return;\r\n }\r\n const allPropsInAttr = allProps[mainAttr] = {} as Dictionary;\r\n const keysInAttr = keys(attrOpt);\r\n for (let i = 0; i < keysInAttr.length; i++) {\r\n const key = keysInAttr[i];\r\n // To avoid share one object with different element, and\r\n // to avoid user modify the object inexpectedly, have to clone.\r\n allPropsInAttr[key] = cloneValue((attrOpt as any)[key]);\r\n }\r\n}\r\n\r\nfunction prepareTransformTransitionFrom(\r\n el: Element,\r\n elOption: TransitionElementOption,\r\n transFromProps: ElementProps\r\n): void {\r\n const transition = elOption.transition;\r\n const transitionKeys = isTransitionAll(transition)\r\n ? TRANSFORMABLE_PROPS\r\n : normalizeToArray(transition || []);\r\n for (let i = 0; i < transitionKeys.length; i++) {\r\n const key = transitionKeys[i];\r\n if (key === 'style' || key === 'shape' || key === 'extra') {\r\n continue;\r\n }\r\n const elVal = (el as any)[key];\r\n if (__DEV__) {\r\n checkTransformPropRefer(key, 'el.transition');\r\n }\r\n // Do not clone, animator will perform that clone.\r\n (transFromProps as any)[key] = elVal;\r\n }\r\n}\r\n\r\nfunction prepareTransformAllPropsFinal(\r\n el: Element,\r\n elOption: TransitionElementOption,\r\n allProps: ElementProps\r\n): void {\r\n for (let i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) {\r\n const legacyName = LEGACY_TRANSFORM_PROPS[i];\r\n const xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];\r\n const legacyArr = (elOption as any)[legacyName];\r\n if (legacyArr) {\r\n allProps[xyName[0]] = legacyArr[0];\r\n allProps[xyName[1]] = legacyArr[1];\r\n }\r\n }\r\n\r\n for (let i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\r\n const key = TRANSFORMABLE_PROPS[i];\r\n if (elOption[key] != null) {\r\n allProps[key] = elOption[key];\r\n }\r\n }\r\n}\r\n\r\nfunction prepareStyleTransitionFrom(\r\n fromEl: Element,\r\n elOption: TransitionElementOption,\r\n styleOpt: TransitionElementOption['style'],\r\n transFromProps: LooseElementProps\r\n): void {\r\n if (!styleOpt) {\r\n return;\r\n }\r\n\r\n const fromElStyle = (fromEl as LooseElementProps).style as LooseElementProps['style'];\r\n let transFromStyleProps: LooseElementProps['style'];\r\n\r\n if (fromElStyle) {\r\n const styleTransition = styleOpt.transition;\r\n const elTransition = elOption.transition;\r\n if (styleTransition && !isTransitionAll(styleTransition)) {\r\n const transitionKeys = normalizeToArray(styleTransition);\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n for (let i = 0; i < transitionKeys.length; i++) {\r\n const key = transitionKeys[i];\r\n const elVal = (fromElStyle as any)[key];\r\n // Do not clone, see `checkNonStyleTansitionRefer`.\r\n (transFromStyleProps as any)[key] = elVal;\r\n }\r\n }\r\n else if (\r\n (fromEl as Displayable).getAnimationStyleProps\r\n && (\r\n isTransitionAll(elTransition)\r\n || isTransitionAll(styleTransition)\r\n || indexOf(elTransition, 'style') >= 0\r\n )\r\n ) {\r\n const animationProps = (fromEl as Displayable).getAnimationStyleProps();\r\n const animationStyleProps = animationProps ? animationProps.style : null;\r\n if (animationStyleProps) {\r\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\r\n const styleKeys = keys(styleOpt);\r\n for (let i = 0; i < styleKeys.length; i++) {\r\n const key = styleKeys[i];\r\n if ((animationStyleProps as Dictionary)[key]) {\r\n const elVal = (fromElStyle as any)[key];\r\n (transFromStyleProps as any)[key] = elVal;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction isNonStyleTransitionEnabled(optVal: unknown, elVal: unknown): boolean {\r\n // The same as `checkNonStyleTansitionRefer`.\r\n return !isArrayLike(optVal)\r\n ? (optVal != null && isFinite(optVal as number))\r\n : optVal !== elVal;\r\n}\r\n\r\nlet checkTransformPropRefer: (key: string, usedIn: string) => void;\r\nif (__DEV__) {\r\n checkTransformPropRefer = function (key: string, usedIn: string): void {\r\n if (!hasOwn(TRANSFORM_PROPS_MAP, key)) {\r\n warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. '\r\n + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.');\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { AnimationEasing } from 'zrender/src/animation/easing';\r\nimport Element from 'zrender/src/Element';\r\nimport { keys, filter, each, isArray, indexOf } from 'zrender/src/core/util';\r\nimport { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition';\r\nimport { AnimationOption, AnimationOptionMixin, Dictionary } from '../util/types';\r\nimport type Model from '../model/Model';\r\nimport { getAnimationConfig } from './basicTransition';\r\nimport { warn } from '../util/log';\r\nimport { makeInner } from '../util/model';\r\n\r\n// Helpers for creating keyframe based animations in custom series and graphic components.\r\n\r\ntype AnimationKeyframe> = T & {\r\n easing?: AnimationEasing\r\n percent?: number // 0 - 1\r\n};\r\n\r\ntype StateToRestore = Dictionary;\r\nconst getStateToRestore = makeInner();\r\n\r\nconst KEYFRAME_EXCLUDE_KEYS = ['percent', 'easing', 'shape', 'style', 'extra'] as const;\r\n\r\nexport interface ElementKeyframeAnimationOption> extends AnimationOption {\r\n // Animation configuration for keyframe based animation.\r\n loop?: boolean\r\n keyframes?: AnimationKeyframe[]\r\n}\r\n\r\n/**\r\n * Stop previous keyframe animation and restore the attributes.\r\n * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.\r\n */\r\nexport function stopPreviousKeyframeAnimationAndRestore(el: Element) {\r\n // Stop previous keyframe animation.\r\n el.stopAnimation('keyframe');\r\n // Restore\r\n el.attr(getStateToRestore(el));\r\n}\r\n\r\nexport function applyKeyframeAnimation>(\r\n el: Element,\r\n animationOpts: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[],\r\n animatableModel: Model\r\n) {\r\n if (!animatableModel.isAnimationEnabled() || !animationOpts) {\r\n return;\r\n }\r\n\r\n if (isArray(animationOpts)) {\r\n each(animationOpts, singleAnimationOpts => {\r\n applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);\r\n });\r\n return;\r\n }\r\n\r\n const keyframes = animationOpts.keyframes;\r\n let duration = animationOpts.duration;\r\n\r\n if (animatableModel && duration == null) {\r\n // Default to use duration of config.\r\n // NOTE: animation config from payload will be ignored because they are mainly for transitions.\r\n const config = getAnimationConfig('enter', animatableModel, 0);\r\n duration = config && config.duration;\r\n }\r\n\r\n if (!keyframes || !duration) {\r\n return;\r\n }\r\n\r\n const stateToRestore: StateToRestore = getStateToRestore(el);\r\n\r\n each(ELEMENT_ANIMATABLE_PROPS, (targetPropName) => {\r\n if (targetPropName && !(el as any)[targetPropName]) {\r\n return;\r\n }\r\n\r\n let animator: ReturnType;\r\n let endFrameIsSet = false;\r\n\r\n // Sort keyframes by percent.\r\n keyframes.sort((a, b) => a.percent - b.percent);\r\n\r\n each(keyframes, kf => {\r\n // Stop current animation.\r\n const animators = el.animators;\r\n const kfValues = targetPropName ? kf[targetPropName] : kf;\r\n\r\n if (__DEV__) {\r\n if (kf.percent >= 1) {\r\n endFrameIsSet = true;\r\n }\r\n }\r\n\r\n if (!kfValues) {\r\n return;\r\n }\r\n\r\n let propKeys = keys(kfValues);\r\n if (!targetPropName) {\r\n // PENDING performance?\r\n propKeys = filter(propKeys, key => indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0);\r\n }\r\n if (!propKeys.length) {\r\n return;\r\n }\r\n\r\n if (!animator) {\r\n animator = el.animate(targetPropName, animationOpts.loop, true);\r\n animator.scope = 'keyframe';\r\n }\r\n for (let i = 0; i < animators.length; i++) {\r\n // Stop all other animation that is not keyframe.\r\n if (animators[i] !== animator && animators[i].targetName === animator.targetName) {\r\n animators[i].stopTracks(propKeys);\r\n }\r\n }\r\n\r\n targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});\r\n\r\n const savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;\r\n each(propKeys, key => {\r\n // Save original value.\r\n savedTarget[key] = ((targetPropName ? (el as any)[targetPropName] : el) || {})[key];\r\n });\r\n\r\n animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing);\r\n });\r\n if (!animator) {\r\n return;\r\n }\r\n\r\n if (__DEV__) {\r\n if (!endFrameIsSet) {\r\n warn('End frame with percent: 1 is missing in the keyframeAnimation.', true);\r\n }\r\n }\r\n\r\n animator\r\n .delay(animationOpts.delay || 0)\r\n .duration(duration)\r\n .start(animationOpts.easing);\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, indexOf\r\n} from 'zrender/src/core/util';\r\nimport * as graphicUtil from '../../util/graphic';\r\nimport { setDefaultStateProxy, toggleHoverEmphasis } from '../../util/states';\r\nimport * as labelStyleHelper from '../../label/labelStyle';\r\nimport {getDefaultLabel} from '../helper/labelHelper';\r\nimport {getLayoutOnAxis} from '../../layout/barGrid';\r\nimport DataDiffer from '../../data/DataDiffer';\r\nimport Model from '../../model/Model';\r\nimport ChartView from '../../view/Chart';\r\nimport {createClipPath} from '../helper/createClipPathFromCoordSys';\r\nimport {\r\n EventQueryItem, ECActionEvent,\r\n DimensionLoose,\r\n ParsedValue,\r\n Dictionary,\r\n Payload,\r\n StageHandlerProgressParams,\r\n ViewRootGroup,\r\n ZRStyleProps,\r\n DisplayState,\r\n ECElement,\r\n DisplayStateNonNormal,\r\n OrdinalRawValue,\r\n InnerDecalObject\r\n} from '../../util/types';\r\nimport Element, { ElementTextConfig } from 'zrender/src/Element';\r\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom';\r\nimport prepareGeo from '../../coord/geo/prepareCustom';\r\nimport prepareSingleAxis from '../../coord/single/prepareCustom';\r\nimport preparePolar from '../../coord/polar/prepareCustom';\r\nimport prepareCalendar from '../../coord/calendar/prepareCustom';\r\nimport SeriesData, { DefaultDataVisual } from '../../data/SeriesData';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport Axis2D from '../../coord/cartesian/Axis2D';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport {\r\n convertToEC4StyleForCustomSerise,\r\n isEC4CompatibleStyle,\r\n convertFromEC4CompatibleStyle,\r\n LegacyStyleProps,\r\n warnDeprecated\r\n} from '../../util/styleCompat';\r\nimport { ItemStyleProps } from '../../model/mixin/itemStyle';\r\nimport { throwError } from '../../util/log';\r\nimport { createOrUpdatePatternFromDecal } from '../../util/decal';\r\nimport CustomSeriesModel, {\r\n CustomImageOption,\r\n CustomElementOption,\r\n CustomElementOptionOnState,\r\n CustomSVGPathOption,\r\n CustomBaseZRPathOption,\r\n CustomDisplayableOption,\r\n CustomSeriesRenderItemAPI,\r\n CustomSeriesRenderItemParams,\r\n CustomGroupOption,\r\n WrapEncodeDefRet,\r\n NonStyleVisualProps,\r\n StyleVisualProps,\r\n STYLE_VISUAL_TYPE,\r\n NON_STYLE_VISUAL_PROPS,\r\n customInnerStore,\r\n PrepareCustomInfo,\r\n CustomPathOption,\r\n CustomRootElementOption,\r\n CustomSeriesOption\r\n} from './CustomSeries';\r\nimport { PatternObject } from 'zrender/src/graphic/Pattern';\r\nimport {\r\n applyLeaveTransition,\r\n applyUpdateTransition,\r\n ElementRootTransitionProp\r\n} from '../../animation/customGraphicTransition';\r\nimport {\r\n applyKeyframeAnimation,\r\n stopPreviousKeyframeAnimationAndRestore\r\n} from '../../animation/customGraphicKeyframeAnimation';\r\nimport type SeriesModel from '../../model/Series';\r\n\r\nconst EMPHASIS = 'emphasis' as const;\r\nconst NORMAL = 'normal' as const;\r\nconst BLUR = 'blur' as const;\r\nconst SELECT = 'select' as const;\r\nconst STATES = [NORMAL, EMPHASIS, BLUR, SELECT] as const;\r\nconst PATH_ITEM_STYLE = {\r\n normal: ['itemStyle'],\r\n emphasis: [EMPHASIS, 'itemStyle'],\r\n blur: [BLUR, 'itemStyle'],\r\n select: [SELECT, 'itemStyle']\r\n} as const;\r\nconst PATH_LABEL = {\r\n normal: ['label'],\r\n emphasis: [EMPHASIS, 'label'],\r\n blur: [BLUR, 'label'],\r\n select: [SELECT, 'label']\r\n} as const;\r\nconst DEFAULT_TRANSITION: ElementRootTransitionProp[] = ['x', 'y'];\r\n// Use prefix to avoid index to be the same as el.name,\r\n// which will cause weird update animation.\r\nconst GROUP_DIFF_PREFIX = 'e\\0\\0';\r\n\r\ntype AttachedTxInfo = {\r\n isLegacy: boolean;\r\n normal: {\r\n cfg: ElementTextConfig;\r\n conOpt: CustomElementOption | false;\r\n };\r\n emphasis: {\r\n cfg: ElementTextConfig;\r\n conOpt: CustomElementOptionOnState;\r\n };\r\n blur: {\r\n cfg: ElementTextConfig;\r\n conOpt: CustomElementOptionOnState;\r\n };\r\n select: {\r\n cfg: ElementTextConfig;\r\n conOpt: CustomElementOptionOnState;\r\n };\r\n};\r\nconst attachedTxInfoTmp = {\r\n normal: {},\r\n emphasis: {},\r\n blur: {},\r\n select: {}\r\n} as AttachedTxInfo;\r\n\r\n\r\n/**\r\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\r\n * of each coordinate systems are not required by each coordinate systems directly, but\r\n * required by the module `custom`.\r\n *\r\n * prepareInfoForCustomSeries {Function}: optional\r\n * @return {Object} {coordSys: {...}, api: {\r\n * coord: function (data, clamp) {}, // return point in global.\r\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\r\n * }}\r\n */\r\nconst prepareCustoms: Dictionary = {\r\n cartesian2d: prepareCartesian2d,\r\n geo: prepareGeo,\r\n single: prepareSingleAxis,\r\n polar: preparePolar,\r\n calendar: prepareCalendar\r\n};\r\n\r\n\r\nfunction isPath(el: Element): el is graphicUtil.Path {\r\n return el instanceof graphicUtil.Path;\r\n}\r\nfunction isDisplayable(el: Element) : el is Displayable {\r\n return el instanceof Displayable;\r\n}\r\nfunction copyElement(sourceEl: Element, targetEl: Element) {\r\n targetEl.copyTransform(sourceEl);\r\n if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {\r\n targetEl.setStyle(sourceEl.style);\r\n targetEl.z = sourceEl.z;\r\n targetEl.z2 = sourceEl.z2;\r\n targetEl.zlevel = sourceEl.zlevel;\r\n targetEl.invisible = sourceEl.invisible;\r\n targetEl.ignore = sourceEl.ignore;\r\n\r\n if (isPath(targetEl) && isPath(sourceEl)) {\r\n targetEl.setShape(sourceEl.shape);\r\n }\r\n }\r\n}\r\nexport default class CustomChartView extends ChartView {\r\n\r\n static type = 'custom';\r\n readonly type = CustomChartView.type;\r\n\r\n private _data: SeriesData;\r\n private _progressiveEls: Element[];\r\n\r\n render(\r\n customSeries: CustomSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void {\r\n\r\n // Clear previously rendered progressive elements.\r\n this._progressiveEls = null;\r\n\r\n const oldData = this._data;\r\n const data = customSeries.getData();\r\n const group = this.group;\r\n const renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n\r\n if (!oldData) {\r\n // Previous render is incremental render or first render.\r\n // Needs remove the incremental rendered elements.\r\n group.removeAll();\r\n }\r\n\r\n data.diff(oldData)\r\n .add(function (newIdx) {\r\n createOrUpdateItem(\r\n api, null, newIdx, renderItem(newIdx, payload), customSeries, group,\r\n data\r\n );\r\n })\r\n .remove(function (oldIdx) {\r\n const el = oldData.getItemGraphicEl(oldIdx);\r\n el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n const oldEl = oldData.getItemGraphicEl(oldIdx);\r\n\r\n createOrUpdateItem(\r\n api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group,\r\n data\r\n );\r\n })\r\n .execute();\r\n\r\n // Do clipping\r\n const clipPath = customSeries.get('clip', true)\r\n ? createClipPath(customSeries.coordinateSystem, false, customSeries)\r\n : null;\r\n if (clipPath) {\r\n group.setClipPath(clipPath);\r\n }\r\n else {\r\n group.removeClipPath();\r\n }\r\n\r\n this._data = data;\r\n }\r\n\r\n incrementalPrepareRender(\r\n customSeries: CustomSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ): void {\r\n this.group.removeAll();\r\n this._data = null;\r\n }\r\n\r\n incrementalRender(\r\n params: StageHandlerProgressParams,\r\n customSeries: CustomSeriesModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ): void {\r\n const data = customSeries.getData();\r\n const renderItem = makeRenderItem(customSeries, data, ecModel, api);\r\n const progressiveEls: Element[] = this._progressiveEls = [];\r\n\r\n function setIncrementalAndHoverLayer(el: Displayable) {\r\n if (!el.isGroup) {\r\n el.incremental = true;\r\n el.ensureState('emphasis').hoverLayer = true;\r\n }\r\n }\r\n for (let idx = params.start; idx < params.end; idx++) {\r\n const el = createOrUpdateItem(\r\n null, null, idx, renderItem(idx, payload), customSeries, this.group, data\r\n );\r\n if (el) {\r\n el.traverse(setIncrementalAndHoverLayer);\r\n progressiveEls.push(el);\r\n }\r\n }\r\n }\r\n\r\n eachRendered(cb: (el: Element) => boolean | void) {\r\n graphicUtil.traverseElements(this._progressiveEls || this.group, cb);\r\n }\r\n\r\n filterForExposedEvent(\r\n eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent\r\n ): boolean {\r\n const elementName = query.element;\r\n if (elementName == null || targetEl.name === elementName) {\r\n return true;\r\n }\r\n\r\n // Enable to give a name on a group made by `renderItem`, and listen\r\n // events that are triggered by its descendents.\r\n while ((targetEl = (targetEl.__hostTarget || targetEl.parent)) && targetEl !== this.group) {\r\n if (targetEl.name === elementName) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n\r\n\r\nfunction createEl(elOption: CustomElementOption): Element {\r\n const graphicType = elOption.type;\r\n let el;\r\n\r\n // Those graphic elements are not shapes. They should not be\r\n // overwritten by users, so do them first.\r\n if (graphicType === 'path') {\r\n const shape = (elOption as CustomSVGPathOption).shape;\r\n // Using pathRect brings convenience to users sacle svg path.\r\n const pathRect = (shape.width != null && shape.height != null)\r\n ? {\r\n x: shape.x || 0,\r\n y: shape.y || 0,\r\n width: shape.width,\r\n height: shape.height\r\n } as RectLike\r\n : null;\r\n const pathData = getPathData(shape);\r\n // Path is also used for icon, so layout 'center' by default.\r\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\r\n customInnerStore(el).customPathData = pathData;\r\n }\r\n else if (graphicType === 'image') {\r\n el = new graphicUtil.Image({});\r\n customInnerStore(el).customImagePath = (elOption as CustomImageOption).style.image;\r\n }\r\n else if (graphicType === 'text') {\r\n el = new graphicUtil.Text({});\r\n // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;\r\n }\r\n else if (graphicType === 'group') {\r\n el = new graphicUtil.Group();\r\n }\r\n else if (graphicType === 'compoundPath') {\r\n throw new Error('\"compoundPath\" is not supported yet.');\r\n }\r\n else {\r\n const Clz = graphicUtil.getShapeClass(graphicType);\r\n if (!Clz) {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\r\n }\r\n throwError(errMsg);\r\n }\r\n el = new Clz();\r\n }\r\n\r\n customInnerStore(el).customGraphicType = graphicType;\r\n el.name = elOption.name;\r\n\r\n // Compat ec4: the default z2 lift is 1. If changing the number,\r\n // some cases probably be broken: hierarchy layout along z, like circle packing,\r\n // where emphasis only intending to modify color/border rather than lift z2.\r\n (el as ECElement).z2EmphasisLift = 1;\r\n (el as ECElement).z2SelectLift = 1;\r\n\r\n return el;\r\n}\r\n\r\n\r\n/**\r\n * ----------------------------------------------------------\r\n * [STRATEGY_MERGE] Merge properties or erase all properties:\r\n *\r\n * Based on the fact that the existing zr element probably is reused, we now consider whether\r\n * merge or erase all properties to the existing elements.\r\n * That is, if a certain props is not specified in the latest return of `renderItem`:\r\n * + \"Merge\" means that do not modify the value on the existing element.\r\n * + \"Erase all\" means that use a default value to the existing element.\r\n *\r\n * \"Merge\" might bring some unexpected state retaining for users and \"erase all\" seems to be\r\n * more safe. \"erase all\" forces users to specify all of the props each time, which is recommended\r\n * in most cases.\r\n * But \"erase all\" theoretically disables the chance of performance optimization (e.g., just\r\n * generete shape and style at the first time rather than always do that).\r\n * So we still use \"merge\" rather than \"erase all\". If users need \"erase all\", they can\r\n * simply always set all of the props each time.\r\n * Some \"object-like\" config like `textConfig`, `textContent`, `style` which are not needed for\r\n * every element, so we replace them only when users specify them. And that is a total replace.\r\n *\r\n * TODO: There is no hint of 'isFirst' to users. So the performance enhancement cannot be\r\n * performed yet. Consider the case:\r\n * (1) setOption to \"mergeChildren\" with a smaller children count\r\n * (2) Use dataZoom to make an item disappear.\r\n * (3) User dataZoom to make the item display again. At that time, renderItem need to return the\r\n * full option rather than partial option to recreate the element.\r\n *\r\n * ----------------------------------------------\r\n * [STRATEGY_NULL] `hasOwnProperty` or `== null`:\r\n *\r\n * Ditinguishing \"own property\" probably bring little trouble to user when make el options.\r\n * So we trade a {xx: null} or {xx: undefined} as \"not specified\" if possible rather than\r\n * \"set them to null/undefined\". In most cases, props can not be cleared. Some typicall\r\n * clearable props like `style`/`textConfig`/`textContent` we enable `false` to means\r\n * \"clear\". In some other special cases that the prop is able to set as null/undefined,\r\n * but not suitable to use `false`, `hasOwnProperty` is checked.\r\n *\r\n * ---------------------------------------------\r\n * [STRATEGY_TRANSITION] The rule of transition:\r\n * + For props on the root level of a element:\r\n * If there is no `transition` specified, tansform props will be transitioned by default,\r\n * which is the same as the previous setting in echarts4 and suitable for the scenario\r\n * of dataZoom change.\r\n * If `transition` specified, only the specified props will be transitioned.\r\n * + For props in `shape` and `style`:\r\n * Only props specified in `transition` will be transitioned.\r\n * + Break:\r\n * Since ec5, do not make transition to shape by default, because it might result in\r\n * performance issue (especially `points` of polygon) and do not necessary in most cases.\r\n *\r\n * @return if `isMorphTo`, return `allPropsFinal`.\r\n */\r\n\r\ninterface InnerCustomZRPathOptionStyle extends PathStyleProps {\r\n __decalPattern: PatternObject\r\n}\r\n\r\nfunction updateElNormal(\r\n // Can be null/undefined\r\n api: ExtensionAPI,\r\n el: Element,\r\n dataIndex: number,\r\n elOption: CustomElementOption,\r\n attachedTxInfo: AttachedTxInfo,\r\n seriesModel: CustomSeriesModel,\r\n isInit: boolean\r\n): void {\r\n\r\n // Stop and restore before update any other attributes.\r\n stopPreviousKeyframeAnimationAndRestore(el);\r\n\r\n const txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\r\n if (txCfgOpt) {\r\n // PENDING: whether use user object directly rather than clone?\r\n // TODO:5.0 textConfig transition animation?\r\n el.setTextConfig(txCfgOpt);\r\n }\r\n\r\n // Default transition ['x', 'y']\r\n if (elOption && elOption.transition == null) {\r\n elOption.transition = DEFAULT_TRANSITION;\r\n }\r\n\r\n // Do some normalization on style.\r\n const styleOpt = elOption && (elOption as CustomDisplayableOption).style;\r\n\r\n if (styleOpt) {\r\n if (el.type === 'text') {\r\n const textOptionStyle = styleOpt as TextStyleProps;\r\n // Compatible with ec4: if `textFill` or `textStroke` exists use them.\r\n hasOwn(textOptionStyle, 'textFill') && (\r\n textOptionStyle.fill = (textOptionStyle as any).textFill\r\n );\r\n hasOwn(textOptionStyle, 'textStroke') && (\r\n textOptionStyle.stroke = (textOptionStyle as any).textStroke\r\n );\r\n }\r\n\r\n let decalPattern;\r\n const decalObj = isPath(el) ? (styleOpt as CustomBaseZRPathOption['style']).decal : null;\r\n if (api && decalObj) {\r\n (decalObj as InnerDecalObject).dirty = true;\r\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\r\n }\r\n // Always overwrite in case user specify this prop.\r\n (styleOpt as InnerCustomZRPathOptionStyle).__decalPattern = decalPattern;\r\n }\r\n\r\n if (isDisplayable(el)) {\r\n if (styleOpt) {\r\n const decalPattern = (styleOpt as InnerCustomZRPathOptionStyle).__decalPattern;\r\n if (decalPattern) {\r\n (styleOpt as PathStyleProps).decal = decalPattern;\r\n }\r\n }\r\n }\r\n\r\n applyUpdateTransition(el, elOption, seriesModel, {\r\n dataIndex,\r\n isInit,\r\n clearStyle: true\r\n });\r\n\r\n applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);\r\n}\r\n\r\nfunction updateElOnState(\r\n state: DisplayStateNonNormal,\r\n el: Element,\r\n elStateOpt: CustomElementOptionOnState,\r\n styleOpt: CustomElementOptionOnState['style'],\r\n attachedTxInfo: AttachedTxInfo\r\n): void {\r\n const elDisplayable = el.isGroup ? null : el as Displayable;\r\n const txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;\r\n\r\n // PENDING:5.0 support customize scale change and transition animation?\r\n\r\n if (elDisplayable) {\r\n // By default support auto lift color when hover whether `emphasis` specified.\r\n const stateObj = elDisplayable.ensureState(state);\r\n if (styleOpt === false) {\r\n const existingEmphasisState = elDisplayable.getState(state);\r\n if (existingEmphasisState) {\r\n existingEmphasisState.style = null;\r\n }\r\n }\r\n else {\r\n // style is needed to enable default emphasis.\r\n stateObj.style = styleOpt || null;\r\n }\r\n // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\r\n // remove hover style.\r\n // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\r\n // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\r\n if (txCfgOpt) {\r\n stateObj.textConfig = txCfgOpt;\r\n }\r\n\r\n setDefaultStateProxy(elDisplayable);\r\n }\r\n}\r\n\r\nfunction updateZ(\r\n el: Element,\r\n elOption: CustomElementOption,\r\n seriesModel: CustomSeriesModel\r\n): void {\r\n // Group not support textContent and not support z yet.\r\n if (el.isGroup) {\r\n return;\r\n }\r\n\r\n const elDisplayable = el as Displayable;\r\n const currentZ = seriesModel.currentZ;\r\n const currentZLevel = seriesModel.currentZLevel;\r\n // Always erase.\r\n elDisplayable.z = currentZ;\r\n elDisplayable.zlevel = currentZLevel;\r\n // z2 must not be null/undefined, otherwise sort error may occur.\r\n const optZ2 = (elOption as CustomDisplayableOption).z2;\r\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\r\n\r\n for (let i = 0; i < STATES.length; i++) {\r\n updateZForEachState(elDisplayable, elOption, STATES[i]);\r\n }\r\n}\r\n\r\nfunction updateZForEachState(\r\n elDisplayable: Displayable,\r\n elOption: CustomDisplayableOption,\r\n state: DisplayState\r\n): void {\r\n const isNormal = state === NORMAL;\r\n const elStateOpt = isNormal ? elOption : retrieveStateOption(\r\n elOption as CustomElementOption,\r\n state as DisplayStateNonNormal\r\n );\r\n const optZ2 = elStateOpt ? elStateOpt.z2 : null;\r\n let stateObj;\r\n if (optZ2 != null) {\r\n // Do not `ensureState` until required.\r\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\r\n stateObj.z2 = optZ2 || 0;\r\n }\r\n}\r\n\r\nfunction makeRenderItem(\r\n customSeries: CustomSeriesModel,\r\n data: SeriesData,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n) {\r\n const renderItem = customSeries.get('renderItem');\r\n const coordSys = customSeries.coordinateSystem;\r\n let prepareResult = {} as ReturnType;\r\n\r\n if (coordSys) {\r\n if (__DEV__) {\r\n assert(renderItem, 'series.render is required.');\r\n assert(\r\n coordSys.prepareCustoms || prepareCustoms[coordSys.type],\r\n 'This coordSys does not support custom series.'\r\n );\r\n }\r\n\r\n // `coordSys.prepareCustoms` is used for external coord sys like bmap.\r\n prepareResult = coordSys.prepareCustoms\r\n ? coordSys.prepareCustoms(coordSys)\r\n : prepareCustoms[coordSys.type](coordSys);\r\n }\r\n\r\n const userAPI = defaults({\r\n getWidth: api.getWidth,\r\n getHeight: api.getHeight,\r\n getZr: api.getZr,\r\n getDevicePixelRatio: api.getDevicePixelRatio,\r\n value: value,\r\n style: style,\r\n ordinalRawValue: ordinalRawValue,\r\n styleEmphasis: styleEmphasis,\r\n visual: visual,\r\n barLayout: barLayout,\r\n currentSeriesIndices: currentSeriesIndices,\r\n font: font\r\n }, prepareResult.api || {}) as CustomSeriesRenderItemAPI;\r\n\r\n const userParams: CustomSeriesRenderItemParams = {\r\n // The life cycle of context: current round of rendering.\r\n // The global life cycle is probably not necessary, because\r\n // user can store global status by themselves.\r\n context: {},\r\n seriesId: customSeries.id,\r\n seriesName: customSeries.name,\r\n seriesIndex: customSeries.seriesIndex,\r\n coordSys: prepareResult.coordSys,\r\n dataInsideLength: data.count(),\r\n encode: wrapEncodeDef(customSeries.getData())\r\n } as CustomSeriesRenderItemParams;\r\n\r\n // If someday intending to refactor them to a class, should consider do not\r\n // break change: currently these attribute member are encapsulated in a closure\r\n // so that do not need to force user to call these method with a scope.\r\n\r\n // Do not support call `api` asynchronously without dataIndexInside input.\r\n let currDataIndexInside: number;\r\n let currItemModel: Model;\r\n let currItemStyleModels: Partial>> = {};\r\n let currLabelModels: Partial>> = {};\r\n\r\n const seriesItemStyleModels = {} as Record>;\r\n\r\n const seriesLabelModels = {} as Record>;\r\n\r\n for (let i = 0; i < STATES.length; i++) {\r\n const stateName = STATES[i];\r\n seriesItemStyleModels[stateName] = (customSeries as Model)\r\n .getModel(PATH_ITEM_STYLE[stateName]);\r\n seriesLabelModels[stateName] = (customSeries as Model)\r\n .getModel(PATH_LABEL[stateName]);\r\n }\r\n\r\n function getItemModel(dataIndexInside: number): Model {\r\n return dataIndexInside === currDataIndexInside\r\n ? (currItemModel || (currItemModel = data.getItemModel(dataIndexInside)))\r\n : data.getItemModel(dataIndexInside);\r\n }\r\n function getItemStyleModel(dataIndexInside: number, state: DisplayState) {\r\n return !data.hasItemOption\r\n ? seriesItemStyleModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currItemStyleModels[state] || (\r\n currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])\r\n ))\r\n : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\r\n }\r\n function getLabelModel(dataIndexInside: number, state: DisplayState) {\r\n return !data.hasItemOption\r\n ? seriesLabelModels[state]\r\n : dataIndexInside === currDataIndexInside\r\n ? (currLabelModels[state] || (\r\n currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])\r\n ))\r\n : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\r\n }\r\n\r\n return function (dataIndexInside: number, payload: Payload): CustomElementOption {\r\n currDataIndexInside = dataIndexInside;\r\n currItemModel = null;\r\n currItemStyleModels = {};\r\n currLabelModels = {};\r\n\r\n return renderItem && renderItem(\r\n defaults({\r\n dataIndexInside: dataIndexInside,\r\n dataIndex: data.getRawIndex(dataIndexInside),\r\n // Can be used for optimization when zoom or roam.\r\n actionType: payload ? payload.type : null\r\n } as CustomSeriesRenderItemParams, userParams),\r\n userAPI\r\n );\r\n };\r\n\r\n /**\r\n * @public\r\n * @param dim by default 0.\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\r\n function value(dim?: DimensionLoose, dataIndexInside?: number): ParsedValue {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);\r\n }\r\n\r\n /**\r\n * @public\r\n * @param dim by default 0.\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\r\n function ordinalRawValue(dim?: DimensionLoose, dataIndexInside?: number): ParsedValue | OrdinalRawValue {\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n dim = dim || 0;\r\n const dimInfo = data.getDimensionInfo(dim);\r\n if (!dimInfo) {\r\n const dimIndex = data.getDimensionIndex(dim);\r\n return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined;\r\n }\r\n const val = data.get(dimInfo.name, dataIndexInside);\r\n const ordinalMeta = dimInfo && dimInfo.ordinalMeta;\r\n return ordinalMeta\r\n ? ordinalMeta.categories[val as number]\r\n : val;\r\n }\r\n\r\n /**\r\n * @deprecated The original intention of `api.style` is enable to set itemStyle\r\n * like other series. But it is not necessary and not easy to give a strict definition\r\n * of what it returns. And since echarts5 it needs to be make compat work. So\r\n * deprecates it since echarts5.\r\n *\r\n * By default, `visual` is applied to style (to support visualMap).\r\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\r\n * it can be implemented as:\r\n * `api.style({stroke: api.visual('color'), fill: null})`;\r\n *\r\n * [Compat]: since ec5, RectText has been separated from its hosts el.\r\n * so `api.style()` will only return the style from `itemStyle` but not handle `label`\r\n * any more. But `series.label` config is never published in doc.\r\n * We still compat it in `api.style()`. But not encourage to use it and will still not\r\n * to pulish it to doc.\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\r\n function style(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps {\r\n if (__DEV__) {\r\n warnDeprecated('api.style', 'Please write literal style directly instead.');\r\n }\r\n\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n\r\n const style = data.getItemVisual(dataIndexInside, 'style');\r\n const visualColor = style && style.fill;\r\n const opacity = style && style.opacity;\r\n\r\n let itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\r\n visualColor != null && (itemStyle.fill = visualColor);\r\n opacity != null && (itemStyle.opacity = opacity);\r\n\r\n const opt = {inheritColor: isString(visualColor) ? visualColor : '#000'};\r\n const labelModel = getLabelModel(dataIndexInside, NORMAL);\r\n // Now that the feature of \"auto adjust text fill/stroke\" has been migrated to zrender\r\n // since ec5, we should set `isAttached` as `false` here and make compat in\r\n // `convertToEC4StyleForCustomSerise`.\r\n const textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve2(\r\n customSeries.getFormattedLabel(dataIndexInside, NORMAL),\r\n getDefaultLabel(data, dataIndexInside)\r\n )\r\n : null;\r\n const textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\r\n\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n (itemStyle as LegacyStyleProps).legacy = true;\r\n\r\n return itemStyle;\r\n }\r\n\r\n /**\r\n * @deprecated The reason see `api.style()`\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\r\n function styleEmphasis(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps {\r\n if (__DEV__) {\r\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\r\n }\r\n\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n\r\n let itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\r\n const labelModel = getLabelModel(dataIndexInside, EMPHASIS);\r\n const textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\r\n textStyle.text = labelModel.getShallow('show')\r\n ? retrieve3(\r\n customSeries.getFormattedLabel(dataIndexInside, EMPHASIS),\r\n customSeries.getFormattedLabel(dataIndexInside, NORMAL),\r\n getDefaultLabel(data, dataIndexInside)\r\n )\r\n : null;\r\n const textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\r\n\r\n preFetchFromExtra(userProps, itemStyle);\r\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\r\n\r\n userProps && applyUserPropsAfter(itemStyle, userProps);\r\n (itemStyle as LegacyStyleProps).legacy = true;\r\n\r\n return itemStyle;\r\n }\r\n\r\n function applyUserPropsAfter(itemStyle: ZRStyleProps, extra: ZRStyleProps): void {\r\n for (const key in extra) {\r\n if (hasOwn(extra, key)) {\r\n (itemStyle as any)[key] = (extra as any)[key];\r\n }\r\n }\r\n }\r\n\r\n function preFetchFromExtra(extra: ZRStyleProps, itemStyle: ItemStyleProps): void {\r\n // A trick to retrieve those props firstly, which are used to\r\n // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\r\n // (It's not reasonable but only for a degree of compat)\r\n if (extra) {\r\n (extra as any).textFill && ((itemStyle as any).textFill = (extra as any).textFill);\r\n (extra as any).textPosition && ((itemStyle as any).textPosition = (extra as any).textPosition);\r\n }\r\n }\r\n\r\n /**\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\r\n function visual(\r\n visualType: VT,\r\n dataIndexInside?: number\r\n ): VT extends NonStyleVisualProps ? DefaultDataVisual[VT]\r\n : VT extends StyleVisualProps ? PathStyleProps[typeof STYLE_VISUAL_TYPE[VT]]\r\n : never {\r\n\r\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\r\n\r\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\r\n const style = data.getItemVisual(dataIndexInside, 'style');\r\n return style\r\n ? style[STYLE_VISUAL_TYPE[visualType as StyleVisualProps]] as any\r\n : null;\r\n }\r\n // Only support these visuals. Other visual might be inner tricky\r\n // for performance (like `style`), do not expose to users.\r\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\r\n return data.getItemVisual(dataIndexInside, visualType as NonStyleVisualProps) as any;\r\n }\r\n }\r\n\r\n /**\r\n * @public\r\n * @return If not support, return undefined.\r\n */\r\n function barLayout(\r\n opt: Omit[0], 'axis'>\r\n ): ReturnType {\r\n if (coordSys.type === 'cartesian2d') {\r\n const baseAxis = coordSys.getBaseAxis() as Axis2D;\r\n return getLayoutOnAxis(defaults({axis: baseAxis}, opt));\r\n }\r\n }\r\n\r\n /**\r\n * @public\r\n */\r\n function currentSeriesIndices(): ReturnType {\r\n return ecModel.getCurrentSeriesIndices();\r\n }\r\n\r\n /**\r\n * @public\r\n * @return font string\r\n */\r\n function font(\r\n opt: Parameters[0]\r\n ): ReturnType {\r\n return labelStyleHelper.getFont(opt, ecModel);\r\n }\r\n}\r\n\r\nfunction wrapEncodeDef(data: SeriesData): WrapEncodeDefRet {\r\n const encodeDef = {} as WrapEncodeDefRet;\r\n each(data.dimensions, function (dimName) {\r\n const dimInfo = data.getDimensionInfo(dimName);\r\n if (!dimInfo.isExtraCoord) {\r\n const coordDim = dimInfo.coordDim;\r\n const dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\r\n dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);\r\n }\r\n });\r\n return encodeDef;\r\n}\r\n\r\nfunction createOrUpdateItem(\r\n api: ExtensionAPI,\r\n existsEl: Element,\r\n dataIndex: number,\r\n elOption: CustomRootElementOption,\r\n seriesModel: CustomSeriesModel,\r\n group: ViewRootGroup,\r\n data: SeriesData\r\n): Element {\r\n // [Rule]\r\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\r\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\r\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\r\n // most cases.)\r\n // The rule or \"merge\" see [STRATEGY_MERGE].\r\n\r\n // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\r\n if (!elOption) {\r\n group.remove(existsEl);\r\n return;\r\n }\r\n const el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group);\r\n el && data.setItemGraphicEl(dataIndex, el);\r\n\r\n el && toggleHoverEmphasis(\r\n el,\r\n elOption.focus,\r\n elOption.blurScope,\r\n elOption.emphasisDisabled\r\n );\r\n\r\n return el;\r\n}\r\n\r\nfunction doCreateOrUpdateEl(\r\n api: ExtensionAPI,\r\n existsEl: Element,\r\n dataIndex: number,\r\n elOption: CustomElementOption,\r\n seriesModel: CustomSeriesModel,\r\n group: ViewRootGroup\r\n): Element {\r\n\r\n if (__DEV__) {\r\n assert(elOption, 'should not have an null/undefined element setting');\r\n }\r\n\r\n let toBeReplacedIdx = -1;\r\n const oldEl = existsEl;\r\n if (\r\n existsEl && (\r\n doesElNeedRecreate(existsEl, elOption, seriesModel)\r\n // || (\r\n // // PENDING: even in one-to-one mapping case, if el is marked as morph,\r\n // // do not sure whether the el will be mapped to another el with different\r\n // // hierarchy in Group tree. So always recreate el rather than reuse the el.\r\n // morphHelper && morphHelper.isOneToOneFrom(el)\r\n // )\r\n )\r\n ) {\r\n // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\r\n toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);\r\n existsEl = null;\r\n }\r\n\r\n const isInit = !existsEl;\r\n let el = existsEl;\r\n\r\n if (!el) {\r\n el = createEl(elOption);\r\n if (oldEl) {\r\n copyElement(oldEl, el);\r\n }\r\n }\r\n else {\r\n // FIMXE:NEXT unified clearState?\r\n // If in some case the performance issue arised, consider\r\n // do not clearState but update cached normal state directly.\r\n el.clearStates();\r\n }\r\n\r\n // Need to set morph: false explictly to disable automatically morphing.\r\n if ((elOption as CustomBaseZRPathOption).morph === false) {\r\n (el as ECElement).disableMorphing = true;\r\n }\r\n else if ((el as ECElement).disableMorphing) {\r\n (el as ECElement).disableMorphing = false;\r\n }\r\n\r\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt =\r\n attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt =\r\n attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt =\r\n attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\r\n\r\n attachedTxInfoTmp.isLegacy = false;\r\n\r\n doCreateOrUpdateAttachedTx(\r\n el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp\r\n );\r\n\r\n doCreateOrUpdateClipPath(\r\n el, dataIndex, elOption, seriesModel, isInit\r\n );\r\n\r\n updateElNormal(\r\n api,\r\n el,\r\n dataIndex,\r\n elOption,\r\n attachedTxInfoTmp,\r\n seriesModel,\r\n isInit\r\n );\r\n // `elOption.info` enables user to mount some info on\r\n // elements and use them in event handlers.\r\n // Update them only when user specified, otherwise, remain.\r\n hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info);\r\n\r\n for (let i = 0; i < STATES.length; i++) {\r\n const stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n const otherStateOpt = retrieveStateOption(elOption, stateName);\r\n const otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\r\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\r\n }\r\n }\r\n\r\n updateZ(el, elOption, seriesModel);\r\n\r\n if (elOption.type === 'group') {\r\n mergeChildren(\r\n api, el as graphicUtil.Group, dataIndex, elOption as CustomGroupOption, seriesModel\r\n );\r\n }\r\n\r\n if (toBeReplacedIdx >= 0) {\r\n group.replaceAt(el, toBeReplacedIdx);\r\n }\r\n else {\r\n group.add(el);\r\n }\r\n\r\n return el;\r\n}\r\n\r\n// `el` must not be null/undefined.\r\nfunction doesElNeedRecreate(el: Element, elOption: CustomElementOption, seriesModel: CustomSeriesModel): boolean {\r\n const elInner = customInnerStore(el);\r\n const elOptionType = elOption.type;\r\n const elOptionShape = (elOption as CustomBaseZRPathOption).shape;\r\n const elOptionStyle = (elOption as CustomDisplayableOption).style;\r\n return (\r\n // Always create new if universal transition is enabled.\r\n // Because we do transition after render. It needs to know what old element is. Replacement will loose it.\r\n seriesModel.isUniversalTransitionEnabled()\r\n // If `elOptionType` is `null`, follow the merge principle.\r\n || (elOptionType != null\r\n && elOptionType !== elInner.customGraphicType\r\n )\r\n || (elOptionType === 'path'\r\n && hasOwnPathData(elOptionShape as CustomSVGPathOption['shape'])\r\n && getPathData(elOptionShape as CustomSVGPathOption['shape']) !== elInner.customPathData\r\n )\r\n || (elOptionType === 'image'\r\n && hasOwn(elOptionStyle, 'image')\r\n && (elOptionStyle as CustomImageOption['style']).image !== elInner.customImagePath\r\n )\r\n // // FIXME test and remove this restriction?\r\n // || (elOptionType === 'text'\r\n // && hasOwn(elOptionStyle, 'text')\r\n // && (elOptionStyle as TextStyleProps).text !== elInner.customText\r\n // )\r\n );\r\n}\r\n\r\nfunction doCreateOrUpdateClipPath(\r\n el: Element,\r\n dataIndex: number,\r\n elOption: CustomElementOption,\r\n seriesModel: CustomSeriesModel,\r\n isInit: boolean\r\n): void {\r\n // Based on the \"merge\" principle, if no clipPath provided,\r\n // do nothing. The exists clip will be totally removed only if\r\n // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\r\n const clipPathOpt = elOption.clipPath as CustomPathOption | false;\r\n if (clipPathOpt === false) {\r\n if (el && el.getClipPath()) {\r\n el.removeClipPath();\r\n }\r\n }\r\n else if (clipPathOpt) {\r\n let clipPath = el.getClipPath();\r\n if (clipPath && doesElNeedRecreate(\r\n clipPath,\r\n clipPathOpt,\r\n seriesModel\r\n )) {\r\n clipPath = null;\r\n }\r\n if (!clipPath) {\r\n clipPath = createEl(clipPathOpt) as graphicUtil.Path;\r\n if (__DEV__) {\r\n assert(\r\n isPath(clipPath),\r\n 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.'\r\n );\r\n }\r\n el.setClipPath(clipPath);\r\n }\r\n updateElNormal(\r\n null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit\r\n );\r\n }\r\n // If not define `clipPath` in option, do nothing unnecessary.\r\n}\r\n\r\nfunction doCreateOrUpdateAttachedTx(\r\n el: Element,\r\n dataIndex: number,\r\n elOption: CustomElementOption,\r\n seriesModel: CustomSeriesModel,\r\n isInit: boolean,\r\n attachedTxInfo: AttachedTxInfo\r\n): void {\r\n // Group does not support textContent temporarily until necessary.\r\n if (el.isGroup) {\r\n return;\r\n }\r\n\r\n // Normal must be called before emphasis, for `isLegacy` detection.\r\n processTxInfo(elOption, null, attachedTxInfo);\r\n processTxInfo(elOption, EMPHASIS, attachedTxInfo);\r\n\r\n // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.\r\n // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\r\n // trade them as set to null to el.\r\n // Especially:\r\n // `elOption.textContent: false` means remove textContent.\r\n // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\r\n let txConOptNormal = attachedTxInfo.normal.conOpt as CustomElementOption | false;\r\n const txConOptEmphasis = attachedTxInfo.emphasis.conOpt as CustomElementOptionOnState;\r\n const txConOptBlur = attachedTxInfo.blur.conOpt as CustomElementOptionOnState;\r\n const txConOptSelect = attachedTxInfo.select.conOpt as CustomElementOptionOnState;\r\n\r\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\r\n let textContent = el.getTextContent();\r\n if (txConOptNormal === false) {\r\n textContent && el.removeTextContent();\r\n }\r\n else {\r\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {type: 'text'};\r\n if (!textContent) {\r\n textContent = createEl(txConOptNormal) as graphicUtil.Text;\r\n el.setTextContent(textContent);\r\n }\r\n else {\r\n // If in some case the performance issue arised, consider\r\n // do not clearState but update cached normal state directly.\r\n textContent.clearStates();\r\n }\r\n\r\n updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);\r\n const txConStlOptNormal = txConOptNormal && (txConOptNormal as CustomDisplayableOption).style;\r\n for (let i = 0; i < STATES.length; i++) {\r\n const stateName = STATES[i];\r\n if (stateName !== NORMAL) {\r\n const txConOptOtherState = attachedTxInfo[stateName].conOpt as CustomElementOptionOnState;\r\n updateElOnState(\r\n stateName,\r\n textContent,\r\n txConOptOtherState,\r\n retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName),\r\n null\r\n );\r\n }\r\n }\r\n\r\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\r\n }\r\n }\r\n}\r\n\r\nfunction processTxInfo(\r\n elOption: CustomElementOption,\r\n state: DisplayStateNonNormal,\r\n attachedTxInfo: AttachedTxInfo\r\n): void {\r\n const stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\r\n const styleOpt = !state\r\n ? (elOption as CustomDisplayableOption).style\r\n : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\r\n\r\n const elType = elOption.type;\r\n let txCfg = stateOpt ? stateOpt.textConfig : null;\r\n const txConOptNormal = elOption.textContent;\r\n let txConOpt: CustomElementOption | CustomElementOptionOnState =\r\n !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\r\n\r\n if (styleOpt && (\r\n // Because emphasis style has little info to detect legacy,\r\n // if normal is legacy, emphasis is trade as legacy.\r\n attachedTxInfo.isLegacy\r\n || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt)\r\n )) {\r\n attachedTxInfo.isLegacy = true;\r\n const convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);\r\n // Explicitly specified `textConfig` and `textContent` has higher priority than\r\n // the ones generated by legacy style. Otherwise if users use them and `api.style`\r\n // at the same time, they not both work and hardly to known why.\r\n if (!txCfg && convertResult.textConfig) {\r\n txCfg = convertResult.textConfig;\r\n }\r\n if (!txConOpt && convertResult.textContent) {\r\n txConOpt = convertResult.textContent;\r\n }\r\n }\r\n\r\n if (!state && txConOpt) {\r\n const txConOptNormal = txConOpt as CustomElementOption;\r\n // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\r\n !txConOptNormal.type && (txConOptNormal.type = 'text');\r\n if (__DEV__) {\r\n // Do not tolerate incorrcet type for forward compat.\r\n assert(\r\n txConOptNormal.type === 'text',\r\n 'textContent.type must be \"text\"'\r\n );\r\n }\r\n }\r\n\r\n const info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\r\n info.cfg = txCfg;\r\n info.conOpt = txConOpt;\r\n}\r\n\r\nfunction retrieveStateOption(\r\n elOption: CustomElementOption, state: DisplayStateNonNormal\r\n): CustomElementOptionOnState {\r\n return !state ? elOption : elOption ? (elOption as CustomDisplayableOption)[state] : null;\r\n}\r\n\r\nfunction retrieveStyleOptionOnState(\r\n stateOptionNormal: CustomElementOption,\r\n stateOption: CustomElementOptionOnState,\r\n state: DisplayStateNonNormal\r\n): CustomElementOptionOnState['style'] {\r\n let style = stateOption && stateOption.style;\r\n if (style == null && state === EMPHASIS && stateOptionNormal) {\r\n style = (stateOptionNormal as CustomDisplayableOption).styleEmphasis;\r\n }\r\n return style;\r\n}\r\n\r\n\r\n// Usage:\r\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates\r\n// that the existing children will not be removed, and enables the feature\r\n// that update some of the props of some of the children simply by construct\r\n// the returned children of `renderItem` like:\r\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\r\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\r\n// by child.name. But that might be lower performance.\r\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\r\n// replaced totally.\r\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will\r\n// happen.\r\n// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the\r\n// `el` is a group, and if any of the new child is null, it means to remove\r\n// the element at the same index, if exists. On the other hand, if the new\r\n// child is and empty object `{}`, it means to keep the element not changed.\r\n//\r\n// For implementation simpleness, do not provide a direct way to remove single\r\n// child (otherwise the total indices of the children array have to be modified).\r\n// User can remove a single child by setting its `ignore` to `true`.\r\nfunction mergeChildren(\r\n api: ExtensionAPI,\r\n el: graphicUtil.Group,\r\n dataIndex: number,\r\n elOption: CustomGroupOption,\r\n seriesModel: CustomSeriesModel\r\n): void {\r\n\r\n const newChildren = elOption.children;\r\n const newLen = newChildren ? newChildren.length : 0;\r\n const mergeChildren = elOption.$mergeChildren;\r\n // `diffChildrenByName` has been deprecated.\r\n const byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\r\n const notMerge = mergeChildren === false;\r\n\r\n // For better performance on roam update, only enter if necessary.\r\n if (!newLen && !byName && !notMerge) {\r\n return;\r\n }\r\n\r\n if (byName) {\r\n diffGroupChildren({\r\n api: api,\r\n oldChildren: el.children() || [],\r\n newChildren: newChildren as CustomElementOption[] || [],\r\n dataIndex: dataIndex,\r\n seriesModel: seriesModel,\r\n group: el\r\n });\r\n return;\r\n }\r\n\r\n notMerge && el.removeAll();\r\n\r\n // Mapping children of a group simply by index, which\r\n // might be better performance.\r\n let index = 0;\r\n for (; index < newLen; index++) {\r\n const newChild = newChildren[index];\r\n const oldChild = el.childAt(index);\r\n if (newChild) {\r\n if (newChild.ignore == null) {\r\n // The old child is set to be ignored if null (see comments\r\n // below). So we need to set ignore to be false back.\r\n newChild.ignore = false;\r\n }\r\n doCreateOrUpdateEl(\r\n api,\r\n oldChild,\r\n dataIndex,\r\n newChild as CustomElementOption,\r\n seriesModel,\r\n el\r\n );\r\n }\r\n else {\r\n if (__DEV__) {\r\n assert(\r\n oldChild,\r\n 'renderItem should not return a group containing elements'\r\n + ' as null/undefined/{} if they do not exist before.'\r\n );\r\n }\r\n // If the new element option is null, it means to remove the old\r\n // element. But we cannot really remove the element from the group\r\n // directly, because the element order may not be stable when this\r\n // element is added back. So we set the element to be ignored.\r\n oldChild.ignore = true;\r\n }\r\n }\r\n for (let i = el.childCount() - 1; i >= index; i--) {\r\n const child = el.childAt(i);\r\n removeChildFromGroup(el, child, seriesModel);\r\n }\r\n}\r\n\r\nfunction removeChildFromGroup(\r\n group: graphicUtil.Group,\r\n child: Element,\r\n seriesModel: SeriesModel\r\n) {\r\n // Do not support leave elements that are not mentioned in the latest\r\n // `renderItem` return. Otherwise users may not have a clear and simple\r\n // concept that how to control all of the elements.\r\n child && applyLeaveTransition(\r\n child,\r\n customInnerStore(group).option,\r\n seriesModel\r\n );\r\n}\r\n\r\ntype DiffGroupContext = {\r\n api: ExtensionAPI;\r\n oldChildren: Element[];\r\n newChildren: CustomElementOption[];\r\n dataIndex: number;\r\n seriesModel: CustomSeriesModel;\r\n group: graphicUtil.Group;\r\n};\r\nfunction diffGroupChildren(context: DiffGroupContext) {\r\n (new DataDiffer(\r\n context.oldChildren,\r\n context.newChildren,\r\n getKey,\r\n getKey,\r\n context\r\n ))\r\n .add(processAddUpdate)\r\n .update(processAddUpdate)\r\n .remove(processRemove)\r\n .execute();\r\n}\r\n\r\nfunction getKey(item: Element, idx: number): string {\r\n const name = item && item.name;\r\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\r\n}\r\n\r\nfunction processAddUpdate(\r\n this: DataDiffer,\r\n newIndex: number,\r\n oldIndex?: number\r\n): void {\r\n const context = this.context;\r\n const childOption = newIndex != null ? context.newChildren[newIndex] : null;\r\n const child = oldIndex != null ? context.oldChildren[oldIndex] : null;\r\n\r\n doCreateOrUpdateEl(\r\n context.api,\r\n child,\r\n context.dataIndex,\r\n childOption,\r\n context.seriesModel,\r\n context.group\r\n );\r\n}\r\n\r\nfunction processRemove(this: DataDiffer, oldIndex: number): void {\r\n const context = this.context;\r\n const child = context.oldChildren[oldIndex];\r\n child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);\r\n}\r\n\r\n/**\r\n * @return SVG Path data.\r\n */\r\nfunction getPathData(shape: CustomSVGPathOption['shape']): string {\r\n // \"d\" follows the SVG convention.\r\n return shape && (shape.pathData || shape.d);\r\n}\r\n\r\nfunction hasOwnPathData(shape: CustomSVGPathOption['shape']): boolean {\r\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport CustomSeriesModel from './CustomSeries';\r\nimport CustomChartView from './CustomView';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerChartView(CustomChartView);\r\n registers.registerSeriesModel(CustomSeriesModel);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as modelUtil from '../../util/model';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n Dictionary,\r\n ZRStyleProps,\r\n OptionId,\r\n CommonTooltipOption,\r\n AnimationOptionMixin,\r\n AnimationOption\r\n} from '../../util/types';\r\nimport ComponentModel from '../../model/Component';\r\nimport Element, { ElementTextConfig } from 'zrender/src/Element';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport { PathProps, PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { ImageStyleProps, ImageProps } from 'zrender/src/graphic/Image';\r\nimport { TextStyleProps, TextProps } from 'zrender/src/graphic/Text';\r\nimport GlobalModel from '../../model/Global';\r\nimport { copyLayoutParams, mergeLayoutParam } from '../../util/layout';\r\nimport { TransitionOptionMixin } from '../../animation/customGraphicTransition';\r\nimport { ElementKeyframeAnimationOption } from '../../animation/customGraphicKeyframeAnimation';\r\nimport { GroupProps } from 'zrender/src/graphic/Group';\r\nimport { TransformProp } from 'zrender/src/core/Transformable';\r\nimport { ElementEventNameWithOn } from 'zrender/src/core/types';\r\n\r\ninterface GraphicComponentBaseElementOption extends\r\n Partial>,\r\n /**\r\n * left/right/top/bottom: (like 12, '22%', 'center', default undefined)\r\n * If left/right is set, shape.x/shape.cx/position will not be used.\r\n * If top/bottom is set, shape.y/shape.cy/position will not be used.\r\n * This mechanism is useful when you want to position a group/element\r\n * against the right side or the center of this container.\r\n */\r\n Partial> {\r\n\r\n /**\r\n * element type, mandatory.\r\n * Only can be omit if call setOption not at the first time and perform merge.\r\n */\r\n type?: string;\r\n\r\n id?: OptionId;\r\n name?: string;\r\n\r\n // Only internal usage. Use specified value does NOT make sense.\r\n parentId?: OptionId;\r\n parentOption?: GraphicComponentElementOption;\r\n children?: GraphicComponentElementOption[];\r\n hv?: [boolean, boolean];\r\n\r\n /**\r\n * bounding: (enum: 'all' (default) | 'raw')\r\n * Specify how to calculate boundingRect when locating.\r\n * 'all': Get uioned and transformed boundingRect\r\n * from both itself and its descendants.\r\n * This mode simplies confining a group of elements in the bounding\r\n * of their ancester container (e.g., using 'right: 0').\r\n * 'raw': Only use the boundingRect of itself and before transformed.\r\n * This mode is similar to css behavior, which is useful when you\r\n * want an element to be able to overflow its container. (Consider\r\n * a rotated circle needs to be located in a corner.)\r\n */\r\n bounding?: 'raw' | 'all';\r\n\r\n /**\r\n * info: custom info. enables user to mount some info on elements and use them\r\n * in event handlers. Update them only when user specified, otherwise, remain.\r\n */\r\n info?: GraphicExtraElementInfo;\r\n\r\n\r\n // `false` means remove the clipPath\r\n clipPath?: Omit | false;\r\n\r\n textContent?: Omit;\r\n textConfig?: ElementTextConfig;\r\n\r\n $action?: 'merge' | 'replace' | 'remove';\r\n\r\n tooltip?: CommonTooltipOption;\r\n\r\n enterAnimation?: AnimationOption\r\n updateAnimation?: AnimationOption\r\n leaveAnimation?: AnimationOption\r\n};\r\n\r\n\r\nexport interface GraphicComponentDisplayableOption extends\r\n GraphicComponentBaseElementOption,\r\n Partial> {\r\n\r\n style?: ZRStyleProps\r\n z2?: number\r\n}\r\n// TODO: states?\r\n// interface GraphicComponentDisplayableOptionOnState extends Partial> {\r\n// style?: ZRStyleProps;\r\n// }\r\nexport interface GraphicComponentGroupOption\r\n extends GraphicComponentBaseElementOption, TransitionOptionMixin {\r\n type?: 'group';\r\n\r\n /**\r\n * width/height: (can only be pixel value, default 0)\r\n * Is only used to specify container (group) size, if needed. And\r\n * cannot be a percentage value (like '33%'). See the reason in the\r\n * layout algorithm below.\r\n */\r\n width?: number;\r\n height?: number;\r\n\r\n // TODO: Can only set focus, blur on the root element.\r\n // children: Omit[];\r\n children: GraphicComponentElementOption[];\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[]\r\n};\r\nexport interface GraphicComponentZRPathOption\r\n extends GraphicComponentDisplayableOption, TransitionOptionMixin {\r\n shape?: PathProps['shape'] & TransitionOptionMixin;\r\n style?: PathStyleProps & TransitionOptionMixin\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[];\r\n}\r\nexport interface GraphicComponentImageOption\r\n extends GraphicComponentDisplayableOption, TransitionOptionMixin {\r\n type?: 'image';\r\n style?: ImageStyleProps & TransitionOptionMixin;\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[];\r\n}\r\n// TODO: states?\r\n// interface GraphicComponentImageOptionOnState extends GraphicComponentDisplayableOptionOnState {\r\n// style?: ImageStyleProps;\r\n// }\r\nexport interface GraphicComponentTextOption\r\n extends Omit, TransitionOptionMixin {\r\n type?: 'text';\r\n style?: TextStyleProps & TransitionOptionMixin;\r\n\r\n keyframeAnimation?: ElementKeyframeAnimationOption | ElementKeyframeAnimationOption[];\r\n}\r\nexport type GraphicComponentElementOption =\r\n GraphicComponentGroupOption |\r\n GraphicComponentZRPathOption |\r\n GraphicComponentImageOption |\r\n GraphicComponentTextOption;\r\n// type GraphicComponentElementOptionOnState =\r\n// GraphicComponentDisplayableOptionOnState\r\n// | GraphicComponentImageOptionOnState;\r\ntype GraphicExtraElementInfo = Dictionary;\r\nexport type ElementMap = zrUtil.HashMap;\r\n\r\n\r\nexport type GraphicComponentLooseOption = (GraphicComponentOption | GraphicComponentElementOption) & {\r\n mainType?: 'graphic';\r\n};\r\n\r\nexport interface GraphicComponentOption extends ComponentOption, AnimationOptionMixin {\r\n // Note: elements is always behind its ancestors in this elements array.\r\n elements?: GraphicComponentElementOption[];\r\n};\r\n\r\nexport function setKeyInfoToNewElOption(\r\n resultItem: ReturnType[number],\r\n newElOption: GraphicComponentElementOption\r\n): void {\r\n const existElOption = resultItem.existing as GraphicComponentElementOption;\r\n\r\n // Set id and type after id assigned.\r\n newElOption.id = resultItem.keyInfo.id;\r\n !newElOption.type && existElOption && (newElOption.type = existElOption.type);\r\n\r\n // Set parent id if not specified\r\n if (newElOption.parentId == null) {\r\n const newElParentOption = newElOption.parentOption;\r\n if (newElParentOption) {\r\n newElOption.parentId = newElParentOption.id;\r\n }\r\n else if (existElOption) {\r\n newElOption.parentId = existElOption.parentId;\r\n }\r\n }\r\n\r\n // Clear\r\n newElOption.parentOption = null;\r\n}\r\n\r\nfunction isSetLoc(\r\n obj: GraphicComponentElementOption,\r\n props: ('left' | 'right' | 'top' | 'bottom')[]\r\n): boolean {\r\n let isSet;\r\n zrUtil.each(props, function (prop) {\r\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\r\n });\r\n return isSet;\r\n}\r\nfunction mergeNewElOptionToExist(\r\n existList: GraphicComponentElementOption[],\r\n index: number,\r\n newElOption: GraphicComponentElementOption\r\n): void {\r\n // Update existing options, for `getOption` feature.\r\n const newElOptCopy = zrUtil.extend({}, newElOption);\r\n const existElOption = existList[index];\r\n\r\n const $action = newElOption.$action || 'merge';\r\n if ($action === 'merge') {\r\n if (existElOption) {\r\n if (__DEV__) {\r\n const newType = newElOption.type;\r\n zrUtil.assert(\r\n !newType || existElOption.type === newType,\r\n 'Please set $action: \"replace\" to change `type`'\r\n );\r\n }\r\n\r\n // We can ensure that newElOptCopy and existElOption are not\r\n // the same object, so `merge` will not change newElOptCopy.\r\n zrUtil.merge(existElOption, newElOptCopy, true);\r\n // Rigid body, use ignoreSize.\r\n mergeLayoutParam(existElOption, newElOptCopy, { ignoreSize: true });\r\n // Will be used in render.\r\n copyLayoutParams(newElOption, existElOption);\r\n\r\n // Copy transition info to new option so it can be used in the transition.\r\n // DO IT AFTER merge\r\n copyTransitionInfo(newElOption, existElOption);\r\n copyTransitionInfo(newElOption, existElOption, 'shape');\r\n copyTransitionInfo(newElOption, existElOption, 'style');\r\n copyTransitionInfo(newElOption, existElOption, 'extra');\r\n\r\n // Copy clipPath\r\n newElOption.clipPath = existElOption.clipPath;\r\n }\r\n else {\r\n existList[index] = newElOptCopy;\r\n }\r\n }\r\n else if ($action === 'replace') {\r\n existList[index] = newElOptCopy;\r\n }\r\n else if ($action === 'remove') {\r\n // null will be cleaned later.\r\n existElOption && (existList[index] = null);\r\n }\r\n}\r\n\r\nconst TRANSITION_PROPS_TO_COPY = ['transition', 'enterFrom', 'leaveTo'];\r\nconst ROOT_TRANSITION_PROPS_TO_COPY =\r\n TRANSITION_PROPS_TO_COPY.concat(['enterAnimation', 'updateAnimation', 'leaveAnimation']);\r\nfunction copyTransitionInfo(\r\n target: GraphicComponentElementOption,\r\n source: GraphicComponentElementOption,\r\n targetProp?: string\r\n) {\r\n if (targetProp) {\r\n if (!(target as any)[targetProp]\r\n && (source as any)[targetProp]\r\n ) {\r\n // TODO avoid creating this empty object when there is no transition configuration.\r\n (target as any)[targetProp] = {};\r\n }\r\n target = (target as any)[targetProp];\r\n source = (source as any)[targetProp];\r\n }\r\n if (!target || !source) {\r\n return;\r\n }\r\n\r\n const props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;\r\n for (let i = 0; i < props.length; i++) {\r\n const prop = props[i];\r\n if ((target as any)[prop] == null && (source as any)[prop] != null) {\r\n (target as any)[prop] = (source as any)[prop];\r\n }\r\n }\r\n}\r\n\r\nfunction setLayoutInfoToExist(\r\n existItem: GraphicComponentElementOption,\r\n newElOption: GraphicComponentElementOption\r\n) {\r\n if (!existItem) {\r\n return;\r\n }\r\n existItem.hv = newElOption.hv = [\r\n // Rigid body, don't care about `width`.\r\n isSetLoc(newElOption, ['left', 'right']),\r\n // Rigid body, don't care about `height`.\r\n isSetLoc(newElOption, ['top', 'bottom'])\r\n ];\r\n // Give default group size. Otherwise layout error may occur.\r\n if (existItem.type === 'group') {\r\n const existingGroupOpt = existItem as GraphicComponentGroupOption;\r\n const newGroupOpt = newElOption as GraphicComponentGroupOption;\r\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\r\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\r\n }\r\n}\r\n\r\nexport class GraphicComponentModel extends ComponentModel {\r\n\r\n static type = 'graphic';\r\n type = GraphicComponentModel.type;\r\n\r\n preventAutoZ = true;\r\n\r\n static defaultOption: GraphicComponentOption = {\r\n elements: []\r\n // parentId: null\r\n };\r\n\r\n /**\r\n * Save el options for the sake of the performance (only update modified graphics).\r\n * The order is the same as those in option. (ancesters -> descendants)\r\n */\r\n private _elOptionsToUpdate: GraphicComponentElementOption[];\r\n\r\n mergeOption(option: GraphicComponentOption, ecModel: GlobalModel): void {\r\n // Prevent default merge to elements\r\n const elements = this.option.elements;\r\n this.option.elements = null;\r\n\r\n super.mergeOption(option, ecModel);\r\n\r\n this.option.elements = elements;\r\n }\r\n\r\n optionUpdated(newOption: GraphicComponentOption, isInit: boolean): void {\r\n const thisOption = this.option;\r\n const newList = (isInit ? thisOption : newOption).elements;\r\n const existList = thisOption.elements = isInit ? [] : thisOption.elements;\r\n\r\n const flattenedList = [] as GraphicComponentElementOption[];\r\n this._flatten(newList, flattenedList, null);\r\n\r\n const mappingResult = modelUtil.mappingToExists(existList, flattenedList, 'normalMerge');\r\n\r\n // Clear elOptionsToUpdate\r\n const elOptionsToUpdate = this._elOptionsToUpdate = [] as GraphicComponentElementOption[];\r\n\r\n zrUtil.each(mappingResult, function (resultItem, index) {\r\n const newElOption = resultItem.newOption as GraphicComponentElementOption;\r\n\r\n if (__DEV__) {\r\n zrUtil.assert(\r\n zrUtil.isObject(newElOption) || resultItem.existing,\r\n 'Empty graphic option definition'\r\n );\r\n }\r\n\r\n if (!newElOption) {\r\n return;\r\n }\r\n\r\n elOptionsToUpdate.push(newElOption);\r\n\r\n setKeyInfoToNewElOption(resultItem, newElOption);\r\n\r\n mergeNewElOptionToExist(existList, index, newElOption);\r\n\r\n setLayoutInfoToExist(existList[index], newElOption);\r\n\r\n }, this);\r\n\r\n // Clean\r\n thisOption.elements = zrUtil.filter(existList, (item) => {\r\n // $action should be volatile, otherwise option gotten from\r\n // `getOption` will contain unexpected $action.\r\n item && delete item.$action;\r\n return item != null;\r\n });\r\n }\r\n\r\n /**\r\n * Convert\r\n * [{\r\n * type: 'group',\r\n * id: 'xx',\r\n * children: [{type: 'circle'}, {type: 'polygon'}]\r\n * }]\r\n * to\r\n * [\r\n * {type: 'group', id: 'xx'},\r\n * {type: 'circle', parentId: 'xx'},\r\n * {type: 'polygon', parentId: 'xx'}\r\n * ]\r\n */\r\n private _flatten(\r\n optionList: GraphicComponentElementOption[],\r\n result: GraphicComponentElementOption[],\r\n parentOption: GraphicComponentElementOption\r\n ): void {\r\n zrUtil.each(optionList, function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n\r\n if (parentOption) {\r\n option.parentOption = parentOption;\r\n }\r\n\r\n result.push(option);\r\n\r\n const children = option.children;\r\n // here we don't judge if option.type is `group`\r\n // when new option doesn't provide `type`, it will cause that the children can't be updated.\r\n if (children && children.length) {\r\n this._flatten(children, result, option);\r\n }\r\n // Deleting for JSON output, and for not affecting group creation.\r\n delete option.children;\r\n }, this);\r\n }\r\n\r\n // FIXME\r\n // Pass to view using payload? setOption has a payload?\r\n useElOptionsToUpdate(): GraphicComponentElementOption[] {\r\n const els = this._elOptionsToUpdate;\r\n // Clear to avoid render duplicately when zooming.\r\n this._elOptionsToUpdate = null;\r\n return els;\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as axisPointerModelHelper from './modelHelper';\r\nimport * as eventTool from 'zrender/src/core/event';\r\nimport * as throttleUtil from '../../util/throttle';\r\nimport {makeInner} from '../../util/model';\r\nimport { AxisPointer } from './AxisPointer';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport Displayable, { DisplayableProps } from 'zrender/src/graphic/Displayable';\r\nimport Element from 'zrender/src/Element';\r\nimport { VerticalAlign, HorizontalAlign, CommonAxisPointerOption } from '../../util/types';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport Model from '../../model/Model';\r\nimport { TextProps } from 'zrender/src/graphic/Text';\r\n\r\nconst inner = makeInner<{\r\n lastProp?: DisplayableProps\r\n labelEl?: graphic.Text\r\n pointerEl?: Displayable\r\n}, Element>();\r\nconst clone = zrUtil.clone;\r\nconst bind = zrUtil.bind;\r\n\r\ntype Icon = ReturnType;\r\ninterface Transform {\r\n x: number,\r\n y: number,\r\n rotation: number\r\n}\r\n\r\ntype AxisValue = CommonAxisPointerOption['value'];\r\n\r\n// Not use top level axisPointer model\r\ntype AxisPointerModel = Model;\r\n\r\ninterface BaseAxisPointer {\r\n\r\n /**\r\n * Should be implemenented by sub-class if support `handle`.\r\n */\r\n getHandleTransform(value: AxisValue, axisModel: AxisBaseModel, axisPointerModel: AxisPointerModel): Transform\r\n\r\n /**\r\n * * Should be implemenented by sub-class if support `handle`.\r\n */\r\n updateHandleTransform(\r\n transform: Transform,\r\n delta: number[],\r\n axisModel: AxisBaseModel,\r\n axisPointerModel: AxisPointerModel\r\n ): Transform & {\r\n cursorPoint: number[]\r\n tooltipOption?: {\r\n verticalAlign?: VerticalAlign\r\n align?: HorizontalAlign\r\n }\r\n }\r\n\r\n}\r\n\r\nexport interface AxisPointerElementOptions {\r\n graphicKey: string\r\n\r\n pointer: PathProps & {\r\n type: 'Line' | 'Rect' | 'Circle' | 'Sector'\r\n }\r\n\r\n label: TextProps\r\n}\r\n/**\r\n * Base axis pointer class in 2D.\r\n */\r\nclass BaseAxisPointer implements AxisPointer {\r\n\r\n private _group: graphic.Group;\r\n\r\n private _lastGraphicKey: string;\r\n\r\n private _handle: Icon;\r\n\r\n private _dragging = false;\r\n\r\n private _lastValue: AxisValue;\r\n\r\n private _lastStatus: CommonAxisPointerOption['status'];\r\n\r\n private _payloadInfo: ReturnType;\r\n\r\n /**\r\n * If have transition animation\r\n */\r\n private _moveAnimation: boolean;\r\n\r\n private _axisModel: AxisBaseModel;\r\n private _axisPointerModel: AxisPointerModel;\r\n private _api: ExtensionAPI;\r\n\r\n /**\r\n * In px, arbitrary value. Do not set too small,\r\n * no animation is ok for most cases.\r\n */\r\n protected animationThreshold = 15;\r\n\r\n /**\r\n * @implement\r\n */\r\n render(axisModel: AxisBaseModel, axisPointerModel: AxisPointerModel, api: ExtensionAPI, forceRender?: boolean) {\r\n const value = axisPointerModel.get('value');\r\n const status = axisPointerModel.get('status');\r\n\r\n // Bind them to `this`, not in closure, otherwise they will not\r\n // be replaced when user calling setOption in not merge mode.\r\n this._axisModel = axisModel;\r\n this._axisPointerModel = axisPointerModel;\r\n this._api = api;\r\n\r\n // Optimize: `render` will be called repeatedly during mouse move.\r\n // So it is power consuming if performing `render` each time,\r\n // especially on mobile device.\r\n if (!forceRender\r\n && this._lastValue === value\r\n && this._lastStatus === status\r\n ) {\r\n return;\r\n }\r\n this._lastValue = value;\r\n this._lastStatus = status;\r\n\r\n let group = this._group;\r\n const handle = this._handle;\r\n\r\n if (!status || status === 'hide') {\r\n // Do not clear here, for animation better.\r\n group && group.hide();\r\n handle && handle.hide();\r\n return;\r\n }\r\n group && group.show();\r\n handle && handle.show();\r\n\r\n // Otherwise status is 'show'\r\n const elOption = {} as AxisPointerElementOptions;\r\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api);\r\n\r\n // Enable change axis pointer type.\r\n const graphicKey = elOption.graphicKey;\r\n if (graphicKey !== this._lastGraphicKey) {\r\n this.clear(api);\r\n }\r\n this._lastGraphicKey = graphicKey;\r\n\r\n const moveAnimation = this._moveAnimation =\r\n this.determineAnimation(axisModel, axisPointerModel);\r\n\r\n if (!group) {\r\n group = this._group = new graphic.Group();\r\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\r\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\r\n api.getZr().add(group);\r\n }\r\n else {\r\n const doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\r\n this.updatePointerEl(group, elOption, doUpdateProps);\r\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\r\n }\r\n\r\n updateMandatoryProps(group, axisPointerModel, true);\r\n\r\n this._renderHandle(value);\r\n }\r\n\r\n /**\r\n * @implement\r\n */\r\n remove(api: ExtensionAPI) {\r\n this.clear(api);\r\n }\r\n\r\n /**\r\n * @implement\r\n */\r\n dispose(api: ExtensionAPI) {\r\n this.clear(api);\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n determineAnimation(axisModel: AxisBaseModel, axisPointerModel: AxisPointerModel): boolean {\r\n const animation = axisPointerModel.get('animation');\r\n const axis = axisModel.axis;\r\n const isCategoryAxis = axis.type === 'category';\r\n const useSnap = axisPointerModel.get('snap');\r\n\r\n // Value axis without snap always do not snap.\r\n if (!useSnap && !isCategoryAxis) {\r\n return false;\r\n }\r\n\r\n if (animation === 'auto' || animation == null) {\r\n const animationThreshold = this.animationThreshold;\r\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\r\n return true;\r\n }\r\n\r\n // It is important to auto animation when snap used. Consider if there is\r\n // a dataZoom, animation will be disabled when too many points exist, while\r\n // it will be enabled for better visual effect when little points exist.\r\n if (useSnap) {\r\n const seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\r\n const axisExtent = axis.getExtent();\r\n // Approximate band width\r\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return animation === true;\r\n }\r\n\r\n /**\r\n * add {pointer, label, graphicKey} to elOption\r\n * @protected\r\n */\r\n makeElOption(\r\n elOption: AxisPointerElementOptions,\r\n value: AxisValue,\r\n axisModel: AxisBaseModel,\r\n axisPointerModel: AxisPointerModel,\r\n api: ExtensionAPI\r\n ) {\r\n // Should be implemenented by sub-class.\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n createPointerEl(\r\n group: graphic.Group,\r\n elOption: AxisPointerElementOptions,\r\n axisModel: AxisBaseModel,\r\n axisPointerModel: AxisPointerModel\r\n ) {\r\n const pointerOption = elOption.pointer;\r\n if (pointerOption) {\r\n const pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](\r\n clone(elOption.pointer)\r\n );\r\n group.add(pointerEl);\r\n }\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n createLabelEl(\r\n group: graphic.Group,\r\n elOption: AxisPointerElementOptions,\r\n axisModel: AxisBaseModel,\r\n axisPointerModel: AxisPointerModel\r\n ) {\r\n if (elOption.label) {\r\n const labelEl = inner(group).labelEl = new graphic.Text(\r\n clone(elOption.label)\r\n );\r\n\r\n group.add(labelEl);\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n updatePointerEl(\r\n group: graphic.Group,\r\n elOption: AxisPointerElementOptions,\r\n updateProps: (el: Element, props: PathProps) => void\r\n ) {\r\n const pointerEl = inner(group).pointerEl;\r\n if (pointerEl && elOption.pointer) {\r\n pointerEl.setStyle(elOption.pointer.style);\r\n updateProps(pointerEl, {shape: elOption.pointer.shape});\r\n }\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n updateLabelEl(\r\n group: graphic.Group,\r\n elOption: AxisPointerElementOptions,\r\n updateProps: (el: Element, props: PathProps) => void,\r\n axisPointerModel: AxisPointerModel\r\n ) {\r\n const labelEl = inner(group).labelEl;\r\n if (labelEl) {\r\n labelEl.setStyle(elOption.label.style);\r\n updateProps(labelEl, {\r\n // Consider text length change in vertical axis, animation should\r\n // be used on shape, otherwise the effect will be weird.\r\n // TODOTODO\r\n // shape: elOption.label.shape,\r\n x: elOption.label.x,\r\n y: elOption.label.y\r\n });\r\n\r\n updateLabelShowHide(labelEl, axisPointerModel);\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n _renderHandle(value: AxisValue) {\r\n if (this._dragging || !this.updateHandleTransform) {\r\n return;\r\n }\r\n\r\n const axisPointerModel = this._axisPointerModel;\r\n const zr = this._api.getZr();\r\n let handle = this._handle;\r\n const handleModel = axisPointerModel.getModel('handle');\r\n\r\n const status = axisPointerModel.get('status');\r\n if (!handleModel.get('show') || !status || status === 'hide') {\r\n handle && zr.remove(handle);\r\n this._handle = null;\r\n return;\r\n }\r\n\r\n let isInit;\r\n if (!this._handle) {\r\n isInit = true;\r\n handle = this._handle = graphic.createIcon(\r\n handleModel.get('icon'),\r\n {\r\n cursor: 'move',\r\n draggable: true,\r\n onmousemove(e) {\r\n // For mobile device, prevent screen slider on the button.\r\n eventTool.stop(e.event);\r\n },\r\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\r\n drift: bind(this._onHandleDragMove, this),\r\n ondragend: bind(this._onHandleDragEnd, this)\r\n }\r\n );\r\n zr.add(handle);\r\n }\r\n\r\n updateMandatoryProps(handle, axisPointerModel, false);\r\n\r\n // update style\r\n (handle as graphic.Path).setStyle(handleModel.getItemStyle(null, [\r\n 'color', 'borderColor', 'borderWidth', 'opacity',\r\n 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ]));\r\n\r\n // update position\r\n let handleSize = handleModel.get('size');\r\n if (!zrUtil.isArray(handleSize)) {\r\n handleSize = [handleSize, handleSize];\r\n }\r\n handle.scaleX = handleSize[0] / 2;\r\n handle.scaleY = handleSize[1] / 2;\r\n\r\n throttleUtil.createOrUpdate(\r\n this,\r\n '_doDispatchAxisPointer',\r\n handleModel.get('throttle') || 0,\r\n 'fixRate'\r\n );\r\n\r\n this._moveHandleToValue(value, isInit);\r\n }\r\n\r\n private _moveHandleToValue(value: AxisValue, isInit?: boolean) {\r\n updateProps(\r\n this._axisPointerModel,\r\n !isInit && this._moveAnimation,\r\n this._handle,\r\n getHandleTransProps(this.getHandleTransform(\r\n value, this._axisModel, this._axisPointerModel\r\n ))\r\n );\r\n }\r\n\r\n private _onHandleDragMove(dx: number, dy: number) {\r\n const handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n\r\n this._dragging = true;\r\n\r\n // Persistent for throttle.\r\n const trans = this.updateHandleTransform(\r\n getHandleTransProps(handle),\r\n [dx, dy],\r\n this._axisModel,\r\n this._axisPointerModel\r\n );\r\n this._payloadInfo = trans;\r\n\r\n handle.stopAnimation();\r\n (handle as graphic.Path).attr(getHandleTransProps(trans));\r\n inner(handle).lastProp = null;\r\n\r\n this._doDispatchAxisPointer();\r\n }\r\n\r\n /**\r\n * Throttled method.\r\n */\r\n _doDispatchAxisPointer() {\r\n const handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n\r\n const payloadInfo = this._payloadInfo;\r\n const axisModel = this._axisModel;\r\n this._api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payloadInfo.cursorPoint[0],\r\n y: payloadInfo.cursorPoint[1],\r\n tooltipOption: payloadInfo.tooltipOption,\r\n axesInfo: [{\r\n axisDim: axisModel.axis.dim,\r\n axisIndex: axisModel.componentIndex\r\n }]\r\n });\r\n }\r\n\r\n private _onHandleDragEnd() {\r\n this._dragging = false;\r\n const handle = this._handle;\r\n if (!handle) {\r\n return;\r\n }\r\n\r\n const value = this._axisPointerModel.get('value');\r\n // Consider snap or categroy axis, handle may be not consistent with\r\n // axisPointer. So move handle to align the exact value position when\r\n // drag ended.\r\n this._moveHandleToValue(value);\r\n\r\n // For the effect: tooltip will be shown when finger holding on handle\r\n // button, and will be hidden after finger left handle button.\r\n this._api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n clear(api: ExtensionAPI) {\r\n this._lastValue = null;\r\n this._lastStatus = null;\r\n\r\n const zr = api.getZr();\r\n const group = this._group;\r\n const handle = this._handle;\r\n if (zr && group) {\r\n this._lastGraphicKey = null;\r\n group && zr.remove(group);\r\n handle && zr.remove(handle);\r\n this._group = null;\r\n this._handle = null;\r\n this._payloadInfo = null;\r\n }\r\n\r\n throttleUtil.clear(this, '_doDispatchAxisPointer');\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n doClear() {\r\n // Implemented by sub-class if necessary.\r\n }\r\n\r\n buildLabel(xy: number[], wh: number[], xDimIndex: 0 | 1) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n }\r\n}\r\n\r\n\r\nfunction updateProps(\r\n animationModel: AxisPointerModel,\r\n moveAnimation: boolean,\r\n el: Element,\r\n props: DisplayableProps\r\n) {\r\n // Animation optimize.\r\n if (!propsEqual(inner(el).lastProp, props)) {\r\n inner(el).lastProp = props;\r\n moveAnimation\r\n ? graphic.updateProps(el, props, animationModel as Model<\r\n // Ignore animation property\r\n Pick\r\n >)\r\n : (el.stopAnimation(), el.attr(props));\r\n }\r\n}\r\n\r\nfunction propsEqual(lastProps: any, newProps: any) {\r\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\r\n let equals = true;\r\n zrUtil.each(newProps, function (item, key) {\r\n equals = equals && propsEqual(lastProps[key], item);\r\n });\r\n return !!equals;\r\n }\r\n else {\r\n return lastProps === newProps;\r\n }\r\n}\r\n\r\nfunction updateLabelShowHide(labelEl: Element, axisPointerModel: AxisPointerModel) {\r\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\r\n}\r\n\r\nfunction getHandleTransProps(trans: Transform): Transform {\r\n return {\r\n x: trans.x || 0,\r\n y: trans.y || 0,\r\n rotation: trans.rotation || 0\r\n };\r\n}\r\n\r\nfunction updateMandatoryProps(\r\n group: Element,\r\n axisPointerModel: AxisPointerModel,\r\n silent?: boolean\r\n) {\r\n const z = axisPointerModel.get('z');\r\n const zlevel = axisPointerModel.get('zlevel');\r\n\r\n group && group.traverse(function (el: Displayable) {\r\n if (el.type !== 'group') {\r\n z != null && (el.z = z);\r\n zlevel != null && (el.zlevel = zlevel);\r\n el.silent = silent;\r\n }\r\n });\r\n}\r\n\r\nexport default BaseAxisPointer;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as textContain from 'zrender/src/contain/text';\r\nimport * as formatUtil from '../../util/format';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport * as axisHelper from '../../coord/axisHelper';\r\nimport AxisBuilder from '../axis/AxisBuilder';\r\nimport Axis from '../../coord/Axis';\r\nimport {\r\n ScaleDataValue, CallbackDataParams, ZRTextAlign, ZRTextVerticalAlign, ZRColor, CommonAxisPointerOption, ColorString\r\n} from '../../util/types';\r\nimport { VectorArray } from 'zrender/src/core/vector';\r\nimport GlobalModel from '../../model/Global';\r\nimport IntervalScale from '../../scale/Interval';\r\nimport Axis2D from '../../coord/cartesian/Axis2D';\r\nimport { AxisPointerElementOptions } from './BaseAxisPointer';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport CartesianAxisModel from '../../coord/cartesian/AxisModel';\r\nimport Model from '../../model/Model';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { createTextStyle } from '../../label/labelStyle';\r\n\r\ninterface LayoutInfo {\r\n position: VectorArray\r\n rotation: number\r\n labelOffset?: number\r\n /**\r\n * 1 | -1\r\n */\r\n labelDirection?: number\r\n labelMargin?: number\r\n}\r\n\r\n// Not use top level axisPointer model\r\ntype AxisPointerModel = Model;\r\n\r\nexport function buildElStyle(axisPointerModel: AxisPointerModel) {\r\n const axisPointerType = axisPointerModel.get('type');\r\n const styleModel = axisPointerModel.getModel(axisPointerType + 'Style' as 'lineStyle' | 'shadowStyle');\r\n let style: PathStyleProps;\r\n if (axisPointerType === 'line') {\r\n style = styleModel.getLineStyle();\r\n style.fill = null;\r\n }\r\n else if (axisPointerType === 'shadow') {\r\n style = styleModel.getAreaStyle();\r\n style.stroke = null;\r\n }\r\n return style;\r\n}\r\n\r\n/**\r\n * @param {Function} labelPos {align, verticalAlign, position}\r\n */\r\nexport function buildLabelElOption(\r\n elOption: AxisPointerElementOptions,\r\n axisModel: AxisBaseModel,\r\n axisPointerModel: AxisPointerModel,\r\n api: ExtensionAPI,\r\n labelPos: {\r\n align?: ZRTextAlign\r\n verticalAlign?: ZRTextVerticalAlign\r\n position: number[]\r\n }\r\n) {\r\n const value = axisPointerModel.get('value');\r\n const text = getValueLabel(\r\n value, axisModel.axis, axisModel.ecModel,\r\n axisPointerModel.get('seriesDataIndices'),\r\n {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n }\r\n );\r\n const labelModel = axisPointerModel.getModel('label');\r\n const paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);\r\n\r\n const font = labelModel.getFont();\r\n const textRect = textContain.getBoundingRect(text, font);\r\n\r\n const position = labelPos.position;\r\n const width = textRect.width + paddings[1] + paddings[3];\r\n const height = textRect.height + paddings[0] + paddings[2];\r\n\r\n // Adjust by align.\r\n const align = labelPos.align;\r\n align === 'right' && (position[0] -= width);\r\n align === 'center' && (position[0] -= width / 2);\r\n const verticalAlign = labelPos.verticalAlign;\r\n verticalAlign === 'bottom' && (position[1] -= height);\r\n verticalAlign === 'middle' && (position[1] -= height / 2);\r\n\r\n // Not overflow ec container\r\n confineInContainer(position, width, height, api);\r\n\r\n let bgColor = labelModel.get('backgroundColor') as ZRColor;\r\n if (!bgColor || bgColor === 'auto') {\r\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\r\n }\r\n\r\n elOption.label = {\r\n // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},\r\n x: position[0],\r\n y: position[1],\r\n style: createTextStyle(labelModel, {\r\n text: text,\r\n font: font,\r\n fill: labelModel.getTextColor(),\r\n padding: paddings,\r\n backgroundColor: bgColor as ColorString\r\n }),\r\n // Label should be over axisPointer.\r\n z2: 10\r\n };\r\n}\r\n\r\n// Do not overflow ec container\r\nfunction confineInContainer(position: number[], width: number, height: number, api: ExtensionAPI) {\r\n const viewWidth = api.getWidth();\r\n const viewHeight = api.getHeight();\r\n position[0] = Math.min(position[0] + width, viewWidth) - width;\r\n position[1] = Math.min(position[1] + height, viewHeight) - height;\r\n position[0] = Math.max(position[0], 0);\r\n position[1] = Math.max(position[1], 0);\r\n}\r\n\r\nexport function getValueLabel(\r\n value: ScaleDataValue,\r\n axis: Axis,\r\n ecModel: GlobalModel,\r\n seriesDataIndices: CommonAxisPointerOption['seriesDataIndices'],\r\n opt?: {\r\n precision?: number | 'auto'\r\n formatter?: CommonAxisPointerOption['label']['formatter']\r\n }\r\n): string {\r\n value = axis.scale.parse(value);\r\n let text = (axis.scale as IntervalScale).getLabel(\r\n {\r\n value\r\n }, {\r\n // If `precision` is set, width can be fixed (like '12.00500'), which\r\n // helps to debounce when when moving label.\r\n precision: opt.precision\r\n }\r\n );\r\n const formatter = opt.formatter;\r\n\r\n if (formatter) {\r\n const params = {\r\n value: axisHelper.getAxisRawValue(axis, {value}),\r\n axisDimension: axis.dim,\r\n axisIndex: (axis as Axis2D).index, // Only Carteian Axis has index\r\n seriesData: [] as CallbackDataParams[]\r\n };\r\n zrUtil.each(seriesDataIndices, function (idxItem) {\r\n const series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n const dataIndex = idxItem.dataIndexInside;\r\n const dataParams = series && series.getDataParams(dataIndex);\r\n dataParams && params.seriesData.push(dataParams);\r\n });\r\n\r\n if (zrUtil.isString(formatter)) {\r\n text = formatter.replace('{value}', text);\r\n }\r\n else if (zrUtil.isFunction(formatter)) {\r\n text = formatter(params);\r\n }\r\n }\r\n\r\n return text;\r\n}\r\n\r\nexport function getTransformedPosition(\r\n axis: Axis,\r\n value: ScaleDataValue,\r\n layoutInfo: LayoutInfo\r\n): number[] {\r\n const transform = matrix.create();\r\n matrix.rotate(transform, transform, layoutInfo.rotation);\r\n matrix.translate(transform, transform, layoutInfo.position);\r\n\r\n return graphic.applyTransform([\r\n axis.dataToCoord(value),\r\n (layoutInfo.labelOffset || 0)\r\n + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)\r\n ], transform);\r\n}\r\n\r\nexport function buildCartesianSingleLabelElOption(\r\n value: ScaleDataValue,\r\n elOption: AxisPointerElementOptions,\r\n layoutInfo: LayoutInfo,\r\n axisModel: CartesianAxisModel,\r\n axisPointerModel: AxisPointerModel,\r\n api: ExtensionAPI\r\n) {\r\n // @ts-ignore\r\n const textLayout = AxisBuilder.innerTextLayout(\r\n layoutInfo.rotation, 0, layoutInfo.labelDirection\r\n );\r\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\r\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\r\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\r\n align: textLayout.textAlign,\r\n verticalAlign: textLayout.textVerticalAlign\r\n });\r\n}\r\n\r\nexport function makeLineShape(p1: number[], p2: number[], xDimIndex?: number) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x1: p1[xDimIndex],\r\n y1: p1[1 - xDimIndex],\r\n x2: p2[xDimIndex],\r\n y2: p2[1 - xDimIndex]\r\n };\r\n}\r\n\r\nexport function makeRectShape(xy: number[], wh: number[], xDimIndex?: number) {\r\n xDimIndex = xDimIndex || 0;\r\n return {\r\n x: xy[xDimIndex],\r\n y: xy[1 - xDimIndex],\r\n width: wh[xDimIndex],\r\n height: wh[1 - xDimIndex]\r\n };\r\n}\r\n\r\nexport function makeSectorShape(\r\n cx: number,\r\n cy: number,\r\n r0: number,\r\n r: number,\r\n startAngle: number,\r\n endAngle: number\r\n) {\r\n return {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n startAngle: startAngle,\r\n endAngle: endAngle,\r\n clockwise: true\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport BaseAxisPointer, {AxisPointerElementOptions} from './BaseAxisPointer';\r\nimport * as viewHelper from './viewHelper';\r\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper';\r\nimport CartesianAxisModel from '../../coord/cartesian/AxisModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { ScaleDataValue, VerticalAlign, HorizontalAlign, CommonAxisPointerOption } from '../../util/types';\r\nimport Grid from '../../coord/cartesian/Grid';\r\nimport Axis2D from '../../coord/cartesian/Axis2D';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport Model from '../../model/Model';\r\n\r\n// Not use top level axisPointer model\r\ntype AxisPointerModel = Model;\r\n\r\nclass CartesianAxisPointer extends BaseAxisPointer {\r\n\r\n /**\r\n * @override\r\n */\r\n makeElOption(\r\n elOption: AxisPointerElementOptions,\r\n value: ScaleDataValue,\r\n axisModel: CartesianAxisModel,\r\n axisPointerModel: AxisPointerModel,\r\n api: ExtensionAPI\r\n ) {\r\n const axis = axisModel.axis;\r\n const grid = axis.grid;\r\n const axisPointerType = axisPointerModel.get('type');\r\n const otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n const pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\r\n\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n const elStyle = viewHelper.buildElStyle(axisPointerModel);\r\n const pointerOption = pointerShapeBuilder[axisPointerType](\r\n axis, pixelValue, otherExtent\r\n );\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n\r\n const layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\r\n viewHelper.buildCartesianSingleLabelElOption(\r\n // @ts-ignore\r\n value, elOption, layoutInfo, axisModel, axisPointerModel, api\r\n );\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getHandleTransform(\r\n value: ScaleDataValue,\r\n axisModel: CartesianAxisModel,\r\n axisPointerModel: AxisPointerModel\r\n ) {\r\n const layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\r\n labelInside: false\r\n });\r\n // @ts-ignore\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n const pos = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: pos[0],\r\n y: pos[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n updateHandleTransform(\r\n transform: {\r\n x: number, y: number,\r\n rotation: number\r\n },\r\n delta: number[],\r\n axisModel: CartesianAxisModel,\r\n axisPointerModel: AxisPointerModel\r\n ) {\r\n const axis = axisModel.axis;\r\n const grid = axis.grid;\r\n const axisExtent = axis.getGlobalExtent(true);\r\n const otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\r\n const dimIndex = axis.dim === 'x' ? 0 : 1;\r\n\r\n const currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n\r\n const cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n const cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n\r\n // Make tooltip do not overlap axisPointer and in the middle of the grid.\r\n const tooltipOptions: {\r\n verticalAlign?: VerticalAlign\r\n align?: HorizontalAlign\r\n }[] = [\r\n {verticalAlign: 'middle'},\r\n {align: 'center'}\r\n ];\r\n\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: tooltipOptions[dimIndex]\r\n };\r\n }\r\n}\r\n\r\nfunction getCartesian(grid: Grid, axis: Axis2D) {\r\n const opt = {} as {\r\n xAxisIndex?: number\r\n yAxisIndex?: number\r\n };\r\n opt[axis.dim + 'AxisIndex' as 'xAxisIndex' | 'yAxisIndex'] = axis.index;\r\n return grid.getCartesian(opt);\r\n}\r\n\r\nconst pointerShapeBuilder = {\r\n\r\n line: function (axis: Axis2D, pixelValue: number, otherExtent: number[]): PathProps & { type: 'Line'} {\r\n const targetShape = viewHelper.makeLineShape(\r\n [pixelValue, otherExtent[0]],\r\n [pixelValue, otherExtent[1]],\r\n getAxisDimIndex(axis)\r\n );\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n\r\n shadow: function (axis: Axis2D, pixelValue: number, otherExtent: number[]): PathProps & { type: 'Rect'} {\r\n const bandWidth = Math.max(1, axis.getBandWidth());\r\n const span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: viewHelper.makeRectShape(\r\n [pixelValue - bandWidth / 2, otherExtent[0]],\r\n [bandWidth, span],\r\n getAxisDimIndex(axis)\r\n )\r\n };\r\n }\r\n};\r\n\r\nfunction getAxisDimIndex(axis: Axis2D) {\r\n return axis.dim === 'x' ? 0 : 1;\r\n}\r\n\r\nexport default CartesianAxisPointer;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n ComponentOption,\r\n ScaleDataValue,\r\n CommonAxisPointerOption\r\n} from '../../util/types';\r\n\r\ninterface MapperParamAxisInfo {\r\n axisIndex: number\r\n axisName: string\r\n axisId: string\r\n axisDim: string\r\n}\r\n\r\ninterface AxisPointerLink {\r\n xAxisIndex?: number[] | 'all'\r\n yAxisIndex?: number[] | 'all'\r\n xAxisId?: string[]\r\n yAxisId?: string[]\r\n xAxisName?: string[] | string\r\n yAxisName?: string[] | string\r\n\r\n radiusAxisIndex?: number[] | 'all'\r\n angleAxisIndex?: number[] | 'all'\r\n radiusAxisId?: string[]\r\n angleAxisId?: string[]\r\n radiusAxisName?: string[] | string\r\n angleAxisName?: string[] | string\r\n\r\n singleAxisIndex?: number[] | 'all'\r\n singleAxisId?: string[]\r\n singleAxisName?: string[] | string\r\n\r\n mapper?(\r\n sourceVal: ScaleDataValue,\r\n sourceAxisInfo: MapperParamAxisInfo,\r\n targetAxisInfo: MapperParamAxisInfo\r\n ): CommonAxisPointerOption['value'] // TODO: TYPE Should return numeric value or category value?\r\n}\r\n\r\n// TODO: TYPE AxisPointerOption for each axis\r\nexport interface AxisPointerOption extends ComponentOption, Omit {\r\n mainType?: 'axisPointer'\r\n\r\n type?: 'line' | 'shadow' | 'cross' | 'none'\r\n\r\n link?: AxisPointerLink[]\r\n}\r\n\r\n\r\nclass AxisPointerModel extends ComponentModel {\r\n\r\n static type = 'axisPointer' as const;\r\n type = AxisPointerModel.type;\r\n\r\n // Will be injected and read in modelHelper and axisTrigger\r\n // No need to care about it.\r\n coordSysAxesInfo: unknown;\r\n\r\n static defaultOption: AxisPointerOption = {\r\n // 'auto' means that show when triggered by tooltip or handle.\r\n show: 'auto',\r\n\r\n // zlevel: 0,\r\n z: 50,\r\n\r\n type: 'line', // 'line' 'shadow' 'cross' 'none'.\r\n // axispointer triggered by tootip determine snap automatically,\r\n // see `modelHelper`.\r\n snap: false,\r\n triggerTooltip: true,\r\n triggerEmphasis: true,\r\n\r\n value: null,\r\n status: null, // Init value depends on whether handle is used.\r\n\r\n link: [],\r\n\r\n // Do not set 'auto' here, otherwise global animation: false\r\n // will not effect at this axispointer.\r\n animation: null,\r\n animationDurationUpdate: 200,\r\n\r\n lineStyle: {\r\n color: '#B9BEC9',\r\n width: 1,\r\n type: 'dashed'\r\n },\r\n\r\n shadowStyle: {\r\n color: 'rgba(210,219,238,0.2)'\r\n },\r\n\r\n label: {\r\n show: true,\r\n formatter: null, // string | Function\r\n precision: 'auto', // Or a number like 0, 1, 2 ...\r\n margin: 3,\r\n color: '#fff',\r\n padding: [5, 7, 5, 7],\r\n backgroundColor: 'auto', // default: axis line color\r\n borderColor: null,\r\n borderWidth: 0,\r\n borderRadius: 3\r\n },\r\n\r\n handle: {\r\n show: false,\r\n // eslint-disable-next-line\r\n icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line\r\n size: 45,\r\n // handle margin is from symbol center to axis, which is stable when circular move.\r\n margin: 50,\r\n // color: '#1b8bbd'\r\n // color: '#2f4554'\r\n color: '#333',\r\n shadowBlur: 3,\r\n shadowColor: '#aaa',\r\n shadowOffsetX: 0,\r\n shadowOffsetY: 2,\r\n\r\n // For mobile performance\r\n throttle: 40\r\n }\r\n };\r\n}\r\n\r\nexport default AxisPointerModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport env from 'zrender/src/core/env';\r\nimport {makeInner} from '../../util/model';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { ZRenderType } from 'zrender/src/zrender';\r\nimport { ZRElementEvent } from '../../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\n\r\ntype DispatchActionMethod = ExtensionAPI['dispatchAction'];\r\n\r\ntype Handler = (\r\n currTrigger: 'click' | 'mousemove' | 'leave',\r\n event: ZRElementEvent,\r\n dispatchAction: DispatchActionMethod\r\n) => void;\r\n\r\ninterface Record {\r\n handler: Handler\r\n}\r\n\r\ninterface InnerStore {\r\n initialized: boolean\r\n records: Dictionary\r\n}\r\n\r\ninterface ShowTipPayload {\r\n type: 'showTip'\r\n dispatchAction: DispatchActionMethod\r\n}\r\n\r\ninterface HideTipPayload {\r\n type: 'hideTip'\r\n dispatchAction: DispatchActionMethod\r\n}\r\ninterface Pendings {\r\n showTip: ShowTipPayload[]\r\n hideTip: HideTipPayload[]\r\n}\r\n\r\nconst inner = makeInner();\r\nconst each = zrUtil.each;\r\n\r\n/**\r\n * @param {string} key\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Function} handler\r\n * param: {string} currTrigger\r\n * param: {Array.} point\r\n */\r\nexport function register(key: string, api: ExtensionAPI, handler?: Handler) {\r\n if (env.node) {\r\n return;\r\n }\r\n\r\n const zr = api.getZr();\r\n inner(zr).records || (inner(zr).records = {});\r\n\r\n initGlobalListeners(zr, api);\r\n\r\n const record = inner(zr).records[key] || (inner(zr).records[key] = {} as Record);\r\n record.handler = handler;\r\n}\r\n\r\nfunction initGlobalListeners(zr: ZRenderType, api?: ExtensionAPI) {\r\n if (inner(zr).initialized) {\r\n return;\r\n }\r\n\r\n inner(zr).initialized = true;\r\n\r\n useHandler('click', zrUtil.curry(doEnter, 'click'));\r\n useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove'));\r\n // useHandler('mouseout', onLeave);\r\n useHandler('globalout', onLeave);\r\n\r\n function useHandler(\r\n eventType: string,\r\n cb: (record: Record, e: ZRElementEvent, dispatchAction: DispatchActionMethod) => void\r\n ) {\r\n zr.on(eventType, function (e: ZRElementEvent) {\r\n const dis = makeDispatchAction(api);\r\n\r\n each(inner(zr).records, function (record) {\r\n record && cb(record, e, dis.dispatchAction);\r\n });\r\n\r\n dispatchTooltipFinally(dis.pendings, api);\r\n });\r\n }\r\n}\r\n\r\nfunction dispatchTooltipFinally(pendings: Pendings, api: ExtensionAPI) {\r\n const showLen = pendings.showTip.length;\r\n const hideLen = pendings.hideTip.length;\r\n\r\n let actuallyPayload;\r\n if (showLen) {\r\n actuallyPayload = pendings.showTip[showLen - 1];\r\n }\r\n else if (hideLen) {\r\n actuallyPayload = pendings.hideTip[hideLen - 1];\r\n }\r\n if (actuallyPayload) {\r\n actuallyPayload.dispatchAction = null;\r\n api.dispatchAction(actuallyPayload);\r\n }\r\n}\r\n\r\nfunction onLeave(\r\n record: Record,\r\n e: ZRElementEvent,\r\n dispatchAction: DispatchActionMethod\r\n) {\r\n record.handler('leave', null, dispatchAction);\r\n}\r\n\r\nfunction doEnter(\r\n currTrigger: 'click' | 'mousemove' | 'leave',\r\n record: Record,\r\n e: ZRElementEvent,\r\n dispatchAction: DispatchActionMethod\r\n) {\r\n record.handler(currTrigger, e, dispatchAction);\r\n}\r\n\r\nfunction makeDispatchAction(api: ExtensionAPI) {\r\n const pendings: Pendings = {\r\n showTip: [],\r\n hideTip: []\r\n };\r\n // FIXME\r\n // better approach?\r\n // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\r\n // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\r\n // So we have to add \"final stage\" to merge those dispatched actions.\r\n const dispatchAction = function (payload: ShowTipPayload | HideTipPayload) {\r\n const pendingList = pendings[payload.type];\r\n if (pendingList) {\r\n (pendingList as ShowTipPayload[]).push(payload as ShowTipPayload);\r\n }\r\n else {\r\n payload.dispatchAction = dispatchAction;\r\n api.dispatchAction(payload);\r\n }\r\n };\r\n\r\n return {\r\n dispatchAction: dispatchAction,\r\n pendings: pendings\r\n };\r\n}\r\n\r\nexport function unregister(key: string, api: ExtensionAPI) {\r\n if (env.node) {\r\n return;\r\n }\r\n const zr = api.getZr();\r\n const record = (inner(zr).records || {})[key];\r\n if (record) {\r\n inner(zr).records[key] = null;\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as globalListener from './globalListener';\r\nimport ComponentView from '../../view/Component';\r\nimport AxisPointerModel from './AxisPointerModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport TooltipModel from '../tooltip/TooltipModel';\r\n\r\nclass AxisPointerView extends ComponentView {\r\n static type = 'axisPointer' as const;\r\n type = AxisPointerView.type;\r\n\r\n render(globalAxisPointerModel: AxisPointerModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const globalTooltipModel = ecModel.getComponent('tooltip') as TooltipModel;\r\n const triggerOn = globalAxisPointerModel.get('triggerOn')\r\n || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click');\r\n\r\n // Register global listener in AxisPointerView to enable\r\n // AxisPointerView to be independent to Tooltip.\r\n globalListener.register(\r\n 'axisPointer',\r\n api,\r\n function (currTrigger, e, dispatchAction) {\r\n // If 'none', it is not controlled by mouse totally.\r\n if (triggerOn !== 'none'\r\n && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)\r\n ) {\r\n dispatchAction({\r\n type: 'updateAxisPointer',\r\n currTrigger: currTrigger,\r\n x: e && e.offsetX,\r\n y: e && e.offsetY\r\n });\r\n }\r\n }\r\n );\r\n }\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n globalListener.unregister('axisPointer', api);\r\n }\r\n\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI) {\r\n globalListener.unregister('axisPointer', api);\r\n }\r\n}\r\n\r\nexport default AxisPointerView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as modelUtil from '../../util/model';\r\nimport GlobalModel from '../../model/Global';\r\nimport Element from 'zrender/src/Element';\r\nimport { Payload } from '../../util/types';\r\n\r\n/**\r\n * @param finder contains {seriesIndex, dataIndex, dataIndexInside}\r\n * @param ecModel\r\n * @return {point: [x, y], el: ...} point Will not be null.\r\n */\r\nexport default function findPointFromSeries(finder: {\r\n seriesIndex?: number\r\n dataIndex?: number | number[]\r\n dataIndexInside?: number | number[]\r\n name?: string | string[]\r\n isStacked?: boolean\r\n}, ecModel: GlobalModel): {\r\n point: number[]\r\n el?: Element\r\n} {\r\n let point: number[] = [];\r\n const seriesIndex = finder.seriesIndex;\r\n let seriesModel;\r\n if (seriesIndex == null || !(\r\n seriesModel = ecModel.getSeriesByIndex(seriesIndex)\r\n )) {\r\n return {\r\n point: []\r\n };\r\n }\r\n\r\n const data = seriesModel.getData();\r\n const dataIndex = modelUtil.queryDataIndex(data, finder as Payload);\r\n if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\r\n return {point: []};\r\n }\r\n\r\n const el = data.getItemGraphicEl(dataIndex);\r\n const coordSys = seriesModel.coordinateSystem;\r\n\r\n if (seriesModel.getTooltipPosition) {\r\n point = seriesModel.getTooltipPosition(dataIndex) || [];\r\n }\r\n else if (coordSys && coordSys.dataToPoint) {\r\n if (finder.isStacked) {\r\n const baseAxis = coordSys.getBaseAxis();\r\n const valueAxis = coordSys.getOtherAxis(baseAxis as any);\r\n const valueAxisDim = valueAxis.dim;\r\n const baseAxisDim = baseAxis.dim;\r\n const baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\r\n const baseDim = data.mapDimension(baseAxisDim);\r\n const stackedData = [];\r\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\r\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\r\n point = coordSys.dataToPoint(stackedData) || [];\r\n }\r\n else {\r\n point = coordSys.dataToPoint(\r\n data.getValues(\r\n zrUtil.map(coordSys.dimensions, function (dim) {\r\n return data.mapDimension(dim);\r\n }), dataIndex\r\n )\r\n ) || [];\r\n }\r\n }\r\n else if (el) {\r\n // Use graphic bounding rect\r\n const rect = el.getBoundingRect().clone();\r\n rect.applyTransform(el.transform);\r\n point = [\r\n rect.x + rect.width / 2,\r\n rect.y + rect.height / 2\r\n ];\r\n }\r\n\r\n return {point: point, el: el};\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {makeInner, ModelFinderObject} from '../../util/model';\r\nimport * as modelHelper from './modelHelper';\r\nimport findPointFromSeries from './findPointFromSeries';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Dictionary, Payload, CommonAxisPointerOption, HighlightPayload, DownplayPayload } from '../../util/types';\r\nimport AxisPointerModel, { AxisPointerOption } from './AxisPointerModel';\r\nimport { each, curry, bind, extend, Curry1 } from 'zrender/src/core/util';\r\nimport { ZRenderType } from 'zrender/src/zrender';\r\n\r\nconst inner = makeInner<{\r\n axisPointerLastHighlights: Dictionary\r\n}, ZRenderType>();\r\n\r\ntype AxisValue = CommonAxisPointerOption['value'];\r\n\r\ninterface DataIndex {\r\n seriesIndex: number\r\n dataIndex: number\r\n dataIndexInside: number\r\n}\r\n\r\ntype BatchItem = DataIndex;\r\n\r\nexport interface DataByAxis {\r\n // TODO: TYPE Value type\r\n value: string | number\r\n axisIndex: number\r\n axisDim: string\r\n axisType: string\r\n axisId: string\r\n\r\n seriesDataIndices: DataIndex[]\r\n\r\n valueLabelOpt: {\r\n precision: AxisPointerOption['label']['precision']\r\n formatter: AxisPointerOption['label']['formatter']\r\n }\r\n}\r\nexport interface DataByCoordSys {\r\n coordSysId: string\r\n coordSysIndex: number\r\n coordSysType: string\r\n coordSysMainType: string\r\n dataByAxis: DataByAxis[]\r\n}\r\ninterface DataByCoordSysCollection {\r\n list: DataByCoordSys[]\r\n map: Dictionary\r\n}\r\n\r\ntype CollectedCoordInfo = ReturnType;\r\ntype CollectedAxisInfo = CollectedCoordInfo['axesInfo'][string];\r\n\r\ninterface AxisTriggerPayload extends Payload {\r\n currTrigger?: 'click' | 'mousemove' | 'leave'\r\n /**\r\n * x and y, which are mandatory, specify a point to trigger axisPointer and tooltip.\r\n */\r\n x?: number\r\n /**\r\n * x and y, which are mandatory, specify a point to trigger axisPointer and tooltip.\r\n */\r\n y?: number\r\n /**\r\n * finder, optional, restrict target axes.\r\n */\r\n seriesIndex?: number\r\n dataIndex: number\r\n\r\n axesInfo?: {\r\n // 'x'|'y'|'angle'\r\n axisDim?: string\r\n axisIndex?: number\r\n value?: AxisValue\r\n }[]\r\n\r\n dispatchAction: ExtensionAPI['dispatchAction']\r\n}\r\n\r\ntype ShowValueMap = Dictionary<{\r\n value: AxisValue\r\n payloadBatch: BatchItem[]\r\n}>;\r\n\r\n/**\r\n * Basic logic: check all axis, if they do not demand show/highlight,\r\n * then hide/downplay them.\r\n *\r\n * @return content of event obj for echarts.connect.\r\n */\r\nexport default function axisTrigger(\r\n payload: AxisTriggerPayload,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n) {\r\n const currTrigger = payload.currTrigger;\r\n let point = [payload.x, payload.y];\r\n const finder = payload;\r\n const dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\r\n const coordSysAxesInfo = (ecModel.getComponent('axisPointer') as AxisPointerModel)\r\n .coordSysAxesInfo as CollectedCoordInfo;\r\n\r\n // Pending\r\n // See #6121. But we are not able to reproduce it yet.\r\n if (!coordSysAxesInfo) {\r\n return;\r\n }\r\n\r\n if (illegalPoint(point)) {\r\n // Used in the default behavior of `connection`: use the sample seriesIndex\r\n // and dataIndex. And also used in the tooltipView trigger.\r\n point = findPointFromSeries({\r\n seriesIndex: finder.seriesIndex,\r\n // Do not use dataIndexInside from other ec instance.\r\n // FIXME: auto detect it?\r\n dataIndex: finder.dataIndex\r\n }, ecModel).point;\r\n }\r\n const isIllegalPoint = illegalPoint(point);\r\n\r\n // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\r\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\r\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\r\n // and dataIndex.\r\n const inputAxesInfo = finder.axesInfo;\r\n\r\n const axesInfo = coordSysAxesInfo.axesInfo;\r\n const shouldHide = currTrigger === 'leave' || illegalPoint(point);\r\n const outputPayload = {} as AxisTriggerPayload;\r\n\r\n const showValueMap: ShowValueMap = {};\r\n const dataByCoordSys: DataByCoordSysCollection = {\r\n list: [],\r\n map: {}\r\n };\r\n const updaters = {\r\n showPointer: curry(showPointer, showValueMap),\r\n showTooltip: curry(showTooltip, dataByCoordSys)\r\n };\r\n\r\n // Process for triggered axes.\r\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\r\n // If a point given, it must be contained by the coordinate system.\r\n const coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\r\n\r\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\r\n const axis = axisInfo.axis;\r\n const inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);\r\n // If no inputAxesInfo, no axis is restricted.\r\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\r\n let val = inputAxisInfo && inputAxisInfo.value;\r\n if (val == null && !isIllegalPoint) {\r\n val = axis.pointToData(point);\r\n }\r\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\r\n }\r\n });\r\n });\r\n\r\n // Process for linked axes.\r\n const linkTriggers: Dictionary = {};\r\n each(axesInfo, function (tarAxisInfo, tarKey) {\r\n const linkGroup = tarAxisInfo.linkGroup;\r\n\r\n // If axis has been triggered in the previous stage, it should not be triggered by link.\r\n if (linkGroup && !showValueMap[tarKey]) {\r\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\r\n const srcValItem = showValueMap[srcKey];\r\n // If srcValItem exist, source axis is triggered, so link to target axis.\r\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\r\n let val = srcValItem.value;\r\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(\r\n val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo)\r\n )));\r\n linkTriggers[tarAxisInfo.key] = val;\r\n }\r\n });\r\n }\r\n });\r\n each(linkTriggers, function (val, tarKey) {\r\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\r\n });\r\n\r\n updateModelActually(showValueMap, axesInfo, outputPayload);\r\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\r\n dispatchHighDownActually(axesInfo, dispatchAction, api);\r\n\r\n return outputPayload;\r\n}\r\n\r\nfunction processOnAxis(\r\n axisInfo: CollectedCoordInfo['axesInfo'][string],\r\n newValue: AxisValue,\r\n updaters: {\r\n showPointer: Curry1\r\n showTooltip: Curry1\r\n },\r\n noSnap: boolean,\r\n outputFinder: ModelFinderObject\r\n) {\r\n const axis = axisInfo.axis;\r\n\r\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\r\n return;\r\n }\r\n\r\n if (!axisInfo.involveSeries) {\r\n updaters.showPointer(axisInfo, newValue);\r\n return;\r\n }\r\n\r\n // Heavy calculation. So put it after axis.containData checking.\r\n const payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\r\n const payloadBatch = payloadInfo.payloadBatch;\r\n const snapToValue = payloadInfo.snapToValue;\r\n\r\n // Fill content of event obj for echarts.connect.\r\n // By default use the first involved series data as a sample to connect.\r\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\r\n extend(outputFinder, payloadBatch[0]);\r\n }\r\n\r\n // If no linkSource input, this process is for collecting link\r\n // target, where snap should not be accepted.\r\n if (!noSnap && axisInfo.snap) {\r\n if (axis.containData(snapToValue) && snapToValue != null) {\r\n newValue = snapToValue;\r\n }\r\n }\r\n\r\n updaters.showPointer(axisInfo, newValue, payloadBatch);\r\n // Tooltip should always be snapToValue, otherwise there will be\r\n // incorrect \"axis value ~ series value\" mapping displayed in tooltip.\r\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\r\n}\r\n\r\nfunction buildPayloadsBySeries(value: AxisValue, axisInfo: CollectedAxisInfo) {\r\n const axis = axisInfo.axis;\r\n const dim = axis.dim;\r\n let snapToValue = value;\r\n const payloadBatch: BatchItem[] = [];\r\n let minDist = Number.MAX_VALUE;\r\n let minDiff = -1;\r\n\r\n each(axisInfo.seriesModels, function (series, idx) {\r\n const dataDim = series.getData().mapDimensionsAll(dim);\r\n let seriesNestestValue;\r\n let dataIndices;\r\n\r\n if (series.getAxisTooltipData) {\r\n const result = series.getAxisTooltipData(dataDim, value, axis);\r\n dataIndices = result.dataIndices;\r\n seriesNestestValue = result.nestestValue;\r\n }\r\n else {\r\n dataIndices = series.getData().indicesOfNearest(\r\n dataDim[0],\r\n value as number,\r\n // Add a threshold to avoid find the wrong dataIndex\r\n // when data length is not same.\r\n // false,\r\n axis.type === 'category' ? 0.5 : null\r\n );\r\n if (!dataIndices.length) {\r\n return;\r\n }\r\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\r\n }\r\n\r\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\r\n return;\r\n }\r\n\r\n const diff = value as number - seriesNestestValue;\r\n const dist = Math.abs(diff);\r\n // Consider category case\r\n if (dist <= minDist) {\r\n if (dist < minDist || (diff >= 0 && minDiff < 0)) {\r\n minDist = dist;\r\n minDiff = diff;\r\n snapToValue = seriesNestestValue;\r\n payloadBatch.length = 0;\r\n }\r\n each(dataIndices, function (dataIndex) {\r\n payloadBatch.push({\r\n seriesIndex: series.seriesIndex,\r\n dataIndexInside: dataIndex,\r\n dataIndex: series.getData().getRawIndex(dataIndex)\r\n });\r\n });\r\n }\r\n });\r\n\r\n return {\r\n payloadBatch: payloadBatch,\r\n snapToValue: snapToValue\r\n };\r\n}\r\n\r\nfunction showPointer(\r\n showValueMap: ShowValueMap,\r\n axisInfo: CollectedAxisInfo,\r\n value: AxisValue,\r\n payloadBatch?: BatchItem[]\r\n) {\r\n showValueMap[axisInfo.key] = {\r\n value: value,\r\n payloadBatch: payloadBatch\r\n };\r\n}\r\n\r\nfunction showTooltip(\r\n dataByCoordSys: DataByCoordSysCollection,\r\n axisInfo: CollectedCoordInfo['axesInfo'][string],\r\n payloadInfo: { payloadBatch: BatchItem[] },\r\n value: AxisValue\r\n) {\r\n const payloadBatch = payloadInfo.payloadBatch;\r\n const axis = axisInfo.axis;\r\n const axisModel = axis.model;\r\n const axisPointerModel = axisInfo.axisPointerModel;\r\n\r\n // If no data, do not create anything in dataByCoordSys,\r\n // whose length will be used to judge whether dispatch action.\r\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\r\n return;\r\n }\r\n\r\n const coordSysModel = axisInfo.coordSys.model;\r\n const coordSysKey = modelHelper.makeKey(coordSysModel);\r\n let coordSysItem = dataByCoordSys.map[coordSysKey];\r\n if (!coordSysItem) {\r\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\r\n coordSysId: coordSysModel.id,\r\n coordSysIndex: coordSysModel.componentIndex,\r\n coordSysType: coordSysModel.type,\r\n coordSysMainType: coordSysModel.mainType,\r\n dataByAxis: []\r\n };\r\n dataByCoordSys.list.push(coordSysItem);\r\n }\r\n\r\n coordSysItem.dataByAxis.push({\r\n axisDim: axis.dim,\r\n axisIndex: axisModel.componentIndex,\r\n axisType: axisModel.type,\r\n axisId: axisModel.id,\r\n value: value as number,\r\n // Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\r\n // depends that all models have been updated. So it should not be performed\r\n // here. Considering axisPointerModel used here is volatile, which is hard\r\n // to be retrieve in TooltipView, we prepare parameters here.\r\n valueLabelOpt: {\r\n precision: axisPointerModel.get(['label', 'precision']),\r\n formatter: axisPointerModel.get(['label', 'formatter'])\r\n },\r\n seriesDataIndices: payloadBatch.slice()\r\n });\r\n}\r\n\r\nfunction updateModelActually(\r\n showValueMap: ShowValueMap,\r\n axesInfo: Dictionary,\r\n outputPayload: AxisTriggerPayload\r\n) {\r\n const outputAxesInfo: AxisTriggerPayload['axesInfo'] = outputPayload.axesInfo = [];\r\n // Basic logic: If no 'show' required, 'hide' this axisPointer.\r\n each(axesInfo, function (axisInfo, key) {\r\n const option = axisInfo.axisPointerModel.option;\r\n const valItem = showValueMap[key];\r\n\r\n if (valItem) {\r\n !axisInfo.useHandle && (option.status = 'show');\r\n option.value = valItem.value;\r\n // For label formatter param and highlight.\r\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\r\n }\r\n // When always show (e.g., handle used), remain\r\n // original value and status.\r\n else {\r\n // If hide, value still need to be set, consider\r\n // click legend to toggle axis blank.\r\n !axisInfo.useHandle && (option.status = 'hide');\r\n }\r\n\r\n // If status is 'hide', should be no info in payload.\r\n option.status === 'show' && outputAxesInfo.push({\r\n axisDim: axisInfo.axis.dim,\r\n axisIndex: axisInfo.axis.model.componentIndex,\r\n value: option.value\r\n });\r\n });\r\n}\r\n\r\nfunction dispatchTooltipActually(\r\n dataByCoordSys: DataByCoordSysCollection,\r\n point: number[],\r\n payload: AxisTriggerPayload,\r\n dispatchAction: ExtensionAPI['dispatchAction']\r\n) {\r\n // Basic logic: If no showTip required, hideTip will be dispatched.\r\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\r\n dispatchAction({type: 'hideTip'});\r\n return;\r\n }\r\n\r\n // In most case only one axis (or event one series is used). It is\r\n // convenient to fetch payload.seriesIndex and payload.dataIndex\r\n // directly. So put the first seriesIndex and dataIndex of the first\r\n // axis on the payload.\r\n const sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {} as DataIndex;\r\n\r\n dispatchAction({\r\n type: 'showTip',\r\n escapeConnect: true,\r\n x: point[0],\r\n y: point[1],\r\n tooltipOption: payload.tooltipOption,\r\n position: payload.position,\r\n dataIndexInside: sampleItem.dataIndexInside,\r\n dataIndex: sampleItem.dataIndex,\r\n seriesIndex: sampleItem.seriesIndex,\r\n dataByCoordSys: dataByCoordSys.list\r\n });\r\n}\r\n\r\nfunction dispatchHighDownActually(\r\n axesInfo: Dictionary,\r\n dispatchAction: ExtensionAPI['dispatchAction'],\r\n api: ExtensionAPI\r\n) {\r\n // FIXME\r\n // highlight status modification should be a stage of main process?\r\n // (Consider confilct (e.g., legend and axisPointer) and setOption)\r\n\r\n const zr = api.getZr();\r\n const highDownKey = 'axisPointerLastHighlights' as const;\r\n const lastHighlights = inner(zr)[highDownKey] || {};\r\n const newHighlights: Dictionary = inner(zr)[highDownKey] = {};\r\n\r\n // Update highlight/downplay status according to axisPointer model.\r\n // Build hash map and remove duplicate incidentally.\r\n each(axesInfo, function (axisInfo, key) {\r\n const option = axisInfo.axisPointerModel.option;\r\n option.status === 'show' && axisInfo.triggerEmphasis && each(option.seriesDataIndices, function (batchItem) {\r\n const key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\r\n newHighlights[key] = batchItem;\r\n });\r\n });\r\n\r\n // Diff.\r\n const toHighlight: BatchItem[] = [];\r\n const toDownplay: BatchItem[] = [];\r\n each(lastHighlights, function (batchItem, key) {\r\n !newHighlights[key] && toDownplay.push(batchItem);\r\n });\r\n each(newHighlights, function (batchItem, key) {\r\n !lastHighlights[key] && toHighlight.push(batchItem);\r\n });\r\n\r\n toDownplay.length && api.dispatchAction({\r\n type: 'downplay',\r\n escapeConnect: true,\r\n // Not blur others when highlight in axisPointer.\r\n notBlur: true,\r\n batch: toDownplay\r\n } as DownplayPayload);\r\n toHighlight.length && api.dispatchAction({\r\n type: 'highlight',\r\n escapeConnect: true,\r\n // Not blur others when highlight in axisPointer.\r\n notBlur: true,\r\n batch: toHighlight\r\n } as HighlightPayload);\r\n}\r\n\r\nfunction findInputAxisInfo(\r\n inputAxesInfo: AxisTriggerPayload['axesInfo'],\r\n axisInfo: CollectedAxisInfo\r\n) {\r\n for (let i = 0; i < (inputAxesInfo || []).length; i++) {\r\n const inputAxisInfo = inputAxesInfo[i];\r\n if (axisInfo.axis.dim === inputAxisInfo.axisDim\r\n && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex\r\n ) {\r\n return inputAxisInfo;\r\n }\r\n }\r\n}\r\n\r\nfunction makeMapperParam(axisInfo: CollectedAxisInfo) {\r\n const axisModel = axisInfo.axis.model;\r\n const item = {} as {\r\n axisDim: string\r\n axisIndex: number\r\n axisId: string\r\n axisName: string\r\n // TODO `dim`AxisIndex, `dim`AxisName, `dim`AxisId?\r\n };\r\n const dim = item.axisDim = axisInfo.axis.dim;\r\n item.axisIndex = (item as any)[dim + 'AxisIndex'] = axisModel.componentIndex;\r\n item.axisName = (item as any)[dim + 'AxisName'] = axisModel.name;\r\n item.axisId = (item as any)[dim + 'AxisId'] = axisModel.id;\r\n return item;\r\n}\r\n\r\nfunction illegalPoint(point?: number[]) {\r\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport AxisView from '../axis/AxisView';\r\nimport CartesianAxisPointer from './CartesianAxisPointer';\r\nimport AxisPointerModel from './AxisPointerModel';\r\nimport AxisPointerView from './AxisPointerView';\r\nimport { isArray } from 'zrender/src/core/util';\r\nimport { collect } from './modelHelper';\r\nimport axisTrigger from './axisTrigger';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n // CartesianAxisPointer is not supposed to be required here. But consider\r\n // echarts.simple.js and online build tooltip, which only require gridSimple,\r\n // CartesianAxisPointer should be able to required somewhere.\r\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\r\n\r\n registers.registerComponentModel(AxisPointerModel);\r\n registers.registerComponentView(AxisPointerView);\r\n\r\n registers.registerPreprocessor(function (option) {\r\n // Always has a global axisPointerModel for default setting.\r\n if (option) {\r\n (!option.axisPointer || (option.axisPointer as []).length === 0)\r\n && (option.axisPointer = {});\r\n\r\n const link = (option.axisPointer as any).link;\r\n // Normalize to array to avoid object mergin. But if link\r\n // is not set, remain null/undefined, otherwise it will\r\n // override existent link setting.\r\n if (link && !isArray(link)) {\r\n (option.axisPointer as any).link = [link];\r\n }\r\n }\r\n });\r\n\r\n // This process should proformed after coordinate systems created\r\n // and series data processed. So put it on statistic processing stage.\r\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\r\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\r\n // allAxesInfo should be updated when setOption performed.\r\n (ecModel.getComponent('axisPointer') as AxisPointerModel).coordSysAxesInfo =\r\n collect(ecModel, api);\r\n });\r\n\r\n // Broadcast to all views.\r\n registers.registerAction({\r\n type: 'updateAxisPointer',\r\n event: 'updateAxisPointer',\r\n update: ':updateAxisPointer'\r\n }, axisTrigger);\r\n\r\n\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {install as installSimple} from './installSimple';\r\nimport {install as installAxisPointer} from '../axisPointer/install';\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installSimple);\r\n use(installAxisPointer);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport BaseAxisPointer, { AxisPointerElementOptions } from './BaseAxisPointer';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as viewHelper from './viewHelper';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport AxisBuilder from '../axis/AxisBuilder';\r\nimport {\r\n OptionDataValue,\r\n ScaleDataValue,\r\n CommonAxisPointerOption,\r\n ZRTextAlign,\r\n ZRTextVerticalAlign\r\n} from '../../util/types';\r\nimport { PolarAxisModel } from '../../coord/polar/AxisModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport Polar from '../../coord/polar/Polar';\r\nimport AngleAxis from '../../coord/polar/AngleAxis';\r\nimport RadiusAxis from '../../coord/polar/RadiusAxis';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport Model from '../../model/Model';\r\n\r\n// Not use top level axisPointer model\r\ntype AxisPointerModel = Model;\r\n\r\nclass PolarAxisPointer extends BaseAxisPointer {\r\n\r\n /**\r\n * @override\r\n */\r\n makeElOption(\r\n elOption: AxisPointerElementOptions,\r\n value: OptionDataValue,\r\n axisModel: PolarAxisModel,\r\n axisPointerModel: Model,\r\n api: ExtensionAPI\r\n ) {\r\n const axis = axisModel.axis;\r\n\r\n if (axis.dim === 'angle') {\r\n this.animationThreshold = Math.PI / 18;\r\n }\r\n\r\n const polar = axis.polar;\r\n const otherAxis = polar.getOtherAxis(axis);\r\n const otherExtent = otherAxis.getExtent();\r\n\r\n const coordValue = axis.dataToCoord(value);\r\n\r\n const axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n const elStyle = viewHelper.buildElStyle(axisPointerModel);\r\n const pointerOption = pointerShapeBuilder[axisPointerType](\r\n axis, polar, coordValue, otherExtent\r\n );\r\n pointerOption.style = elStyle;\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n\r\n const labelMargin = axisPointerModel.get(['label', 'margin']);\r\n const labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\r\n viewHelper.buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\r\n }\r\n\r\n // Do not support handle, utill any user requires it.\r\n\r\n};\r\n\r\nfunction getLabelPosition(\r\n value: ScaleDataValue,\r\n axisModel: PolarAxisModel,\r\n axisPointerModel: AxisPointerModel,\r\n polar: Polar,\r\n labelMargin: number\r\n) {\r\n const axis = axisModel.axis;\r\n const coord = axis.dataToCoord(value);\r\n let axisAngle = polar.getAngleAxis().getExtent()[0];\r\n axisAngle = axisAngle / 180 * Math.PI;\r\n const radiusExtent = polar.getRadiusAxis().getExtent();\r\n let position;\r\n let align: ZRTextAlign;\r\n let verticalAlign: ZRTextVerticalAlign;\r\n\r\n if (axis.dim === 'radius') {\r\n const transform = matrix.create();\r\n matrix.rotate(transform, transform, axisAngle);\r\n matrix.translate(transform, transform, [polar.cx, polar.cy]);\r\n position = graphic.applyTransform([coord, -labelMargin], transform);\r\n\r\n const labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\r\n // @ts-ignore\r\n const labelLayout = AxisBuilder.innerTextLayout(\r\n axisAngle, labelRotation * Math.PI / 180, -1\r\n );\r\n align = labelLayout.textAlign;\r\n verticalAlign = labelLayout.textVerticalAlign;\r\n }\r\n else { // angle axis\r\n const r = radiusExtent[1];\r\n position = polar.coordToPoint([r + labelMargin, coord]);\r\n const cx = polar.cx;\r\n const cy = polar.cy;\r\n align = Math.abs(position[0] - cx) / r < 0.3\r\n ? 'center' : (position[0] > cx ? 'left' : 'right');\r\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3\r\n ? 'middle' : (position[1] > cy ? 'top' : 'bottom');\r\n }\r\n\r\n return {\r\n position: position,\r\n align: align,\r\n verticalAlign: verticalAlign\r\n };\r\n}\r\n\r\n\r\nconst pointerShapeBuilder = {\r\n\r\n line: function (\r\n axis: AngleAxis | RadiusAxis,\r\n polar: Polar,\r\n coordValue: number,\r\n otherExtent: number[]\r\n ): PathProps & { type: 'Line' | 'Circle' } {\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Line',\r\n shape: viewHelper.makeLineShape(\r\n polar.coordToPoint([otherExtent[0], coordValue]),\r\n polar.coordToPoint([otherExtent[1], coordValue])\r\n )\r\n }\r\n : {\r\n type: 'Circle',\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: coordValue\r\n }\r\n };\r\n },\r\n\r\n shadow: function (\r\n axis: AngleAxis | RadiusAxis,\r\n polar: Polar,\r\n coordValue: number,\r\n otherExtent: number[]\r\n ): PathProps & { type: 'Sector' } {\r\n const bandWidth = Math.max(1, axis.getBandWidth());\r\n const radian = Math.PI / 180;\r\n\r\n return axis.dim === 'angle'\r\n ? {\r\n type: 'Sector',\r\n shape: viewHelper.makeSectorShape(\r\n polar.cx, polar.cy,\r\n otherExtent[0], otherExtent[1],\r\n // In ECharts y is negative if angle is positive\r\n (-coordValue - bandWidth / 2) * radian,\r\n (-coordValue + bandWidth / 2) * radian\r\n )\r\n }\r\n : {\r\n type: 'Sector',\r\n shape: viewHelper.makeSectorShape(\r\n polar.cx, polar.cy,\r\n coordValue - bandWidth / 2,\r\n coordValue + bandWidth / 2,\r\n 0, Math.PI * 2\r\n )\r\n };\r\n }\r\n};\r\n\r\nexport default PolarAxisPointer;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { ComponentOption, CircleLayoutOptionMixin } from '../../util/types';\r\nimport ComponentModel from '../../model/Component';\r\nimport Polar from './Polar';\r\nimport { AngleAxisModel, RadiusAxisModel } from './AxisModel';\r\n\r\nexport interface PolarOption extends ComponentOption, CircleLayoutOptionMixin {\r\n mainType?: 'polar';\r\n}\r\n\r\nclass PolarModel extends ComponentModel {\r\n static type = 'polar' as const;\r\n type = PolarModel.type;\r\n\r\n static dependencies = ['radiusAxis', 'angleAxis'];\r\n\r\n coordinateSystem: Polar;\r\n\r\n findAxisModel(axisType: 'angleAxis'): AngleAxisModel\r\n findAxisModel(axisType: 'radiusAxis'): RadiusAxisModel\r\n findAxisModel(axisType: 'angleAxis' | 'radiusAxis'): AngleAxisModel | RadiusAxisModel {\r\n let foundAxisModel;\r\n const ecModel = this.ecModel;\r\n\r\n ecModel.eachComponent(axisType, function (this: PolarModel, axisModel: AngleAxisModel | RadiusAxisModel) {\r\n if (axisModel.getCoordSysModel() === this) {\r\n foundAxisModel = axisModel;\r\n }\r\n }, this);\r\n return foundAxisModel;\r\n }\r\n\r\n static defaultOption: PolarOption = {\r\n\r\n // zlevel: 0,\r\n\r\n z: 0,\r\n\r\n center: ['50%', '50%'],\r\n\r\n radius: '80%'\r\n };\r\n}\r\n\r\nexport default PolarModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ComponentModel from '../../model/Component';\r\nimport { AxisModelExtendedInCreator } from '../axisModelCreator';\r\nimport {AxisModelCommonMixin} from '../axisModelCommonMixin';\r\nimport { AxisBaseOption } from '../axisCommonTypes';\r\nimport AngleAxis from './AngleAxis';\r\nimport RadiusAxis from './RadiusAxis';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport { SINGLE_REFERRING } from '../../util/model';\r\n\r\nexport type AngleAxisOption = AxisBaseOption & {\r\n mainType?: 'angleAxis';\r\n /**\r\n * Index of host polar component\r\n */\r\n polarIndex?: number;\r\n /**\r\n * Id of host polar component\r\n */\r\n polarId?: string;\r\n\r\n startAngle?: number;\r\n endAngle?: number;\r\n clockwise?: boolean;\r\n\r\n axisLabel?: AxisBaseOption['axisLabel']\r\n};\r\n\r\nexport type RadiusAxisOption = AxisBaseOption & {\r\n mainType?: 'radiusAxis';\r\n /**\r\n * Index of host polar component\r\n */\r\n polarIndex?: number;\r\n /**\r\n * Id of host polar component\r\n */\r\n polarId?: string;\r\n};\r\n\r\ntype PolarAxisOption = AngleAxisOption | RadiusAxisOption;\r\n\r\nclass PolarAxisModel extends ComponentModel\r\n implements AxisBaseModel {\r\n static type = 'polarAxis';\r\n\r\n axis: AngleAxis | RadiusAxis;\r\n\r\n getCoordSysModel(): ComponentModel {\r\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\r\n }\r\n}\r\n\r\ninterface PolarAxisModel\r\n extends AxisModelCommonMixin, AxisModelExtendedInCreator {}\r\n\r\nzrUtil.mixin(PolarAxisModel, AxisModelCommonMixin);\r\n\r\nexport {PolarAxisModel};\r\n\r\nexport class AngleAxisModel extends PolarAxisModel {\r\n static type = 'angleAxis';\r\n type = AngleAxisModel.type;\r\n axis: AngleAxis;\r\n}\r\nexport class RadiusAxisModel extends PolarAxisModel {\r\n static type = 'radiusAxis';\r\n type = RadiusAxisModel.type;\r\n axis: RadiusAxis;\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Axis from '../Axis';\r\nimport Scale from '../../scale/Scale';\r\nimport Polar from './Polar';\r\nimport { RadiusAxisModel } from './AxisModel';\r\n\r\ninterface RadiusAxis {\r\n dataToRadius: Axis['dataToCoord']\r\n radiusToData: Axis['coordToData']\r\n}\r\n\r\nclass RadiusAxis extends Axis {\r\n\r\n polar: Polar;\r\n\r\n model: RadiusAxisModel;\r\n\r\n constructor(scale?: Scale, radiusExtent?: [number, number]) {\r\n super('radius', scale, radiusExtent);\r\n }\r\n\r\n pointToData(point: number[], clamp?: boolean) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n }\r\n}\r\n\r\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\r\n\r\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\r\n\r\nexport default RadiusAxis;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as textContain from 'zrender/src/contain/text';\r\nimport Axis from '../Axis';\r\nimport {makeInner} from '../../util/model';\r\nimport Scale from '../../scale/Scale';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\nimport Polar from './Polar';\r\nimport { AngleAxisModel } from './AxisModel';\r\n\r\nconst inner = makeInner<{\r\n lastAutoInterval: number\r\n lastTickCount: number\r\n}, AngleAxisModel>();\r\n\r\ninterface AngleAxis {\r\n dataToAngle: Axis['dataToCoord']\r\n angleToData: Axis['coordToData']\r\n}\r\nclass AngleAxis extends Axis {\r\n\r\n polar: Polar;\r\n\r\n model: AngleAxisModel;\r\n\r\n constructor(scale?: Scale, angleExtent?: [number, number]) {\r\n super('angle', scale, angleExtent || [0, 360]);\r\n }\r\n\r\n pointToData(point: number[], clamp?: boolean) {\r\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\r\n }\r\n\r\n /**\r\n * Only be called in category axis.\r\n * Angle axis uses text height to decide interval\r\n *\r\n * @override\r\n * @return {number} Auto interval for cateogry axis tick and label\r\n */\r\n calculateCategoryInterval() {\r\n const axis = this;\r\n const labelModel = axis.getLabelModel();\r\n\r\n const ordinalScale = axis.scale as OrdinalScale;\r\n const ordinalExtent = ordinalScale.getExtent();\r\n // Providing this method is for optimization:\r\n // avoid generating a long array by `getTicks`\r\n // in large category data case.\r\n const tickCount = ordinalScale.count();\r\n\r\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\r\n return 0;\r\n }\r\n\r\n const tickValue = ordinalExtent[0];\r\n const unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\r\n const unitH = Math.abs(unitSpan);\r\n\r\n // Not precise, just use height as text width\r\n // and each distance from axis line yet.\r\n const rect = textContain.getBoundingRect(\r\n tickValue == null ? '' : tickValue + '',\r\n labelModel.getFont(),\r\n 'center',\r\n 'top'\r\n );\r\n const maxH = Math.max(rect.height, 7);\r\n\r\n let dh = maxH / unitH;\r\n // 0/0 is NaN, 1/0 is Infinity.\r\n isNaN(dh) && (dh = Infinity);\r\n let interval = Math.max(0, Math.floor(dh));\r\n\r\n const cache = inner(axis.model);\r\n const lastAutoInterval = cache.lastAutoInterval;\r\n const lastTickCount = cache.lastTickCount;\r\n\r\n // Use cache to keep interval stable while moving zoom window,\r\n // otherwise the calculated interval might jitter when the zoom\r\n // window size is close to the interval-changing size.\r\n if (lastAutoInterval != null\r\n && lastTickCount != null\r\n && Math.abs(lastAutoInterval - interval) <= 1\r\n && Math.abs(lastTickCount - tickCount) <= 1\r\n // Always choose the bigger one, otherwise the critical\r\n // point is not the same when zooming in or zooming out.\r\n && lastAutoInterval > interval\r\n ) {\r\n interval = lastAutoInterval;\r\n }\r\n // Only update cache if cache not used, otherwise the\r\n // changing of interval is too insensitive.\r\n else {\r\n cache.lastTickCount = tickCount;\r\n cache.lastAutoInterval = interval;\r\n }\r\n\r\n return interval;\r\n }\r\n}\r\n\r\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\r\n\r\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\r\n\r\n\r\nexport default AngleAxis;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport RadiusAxis from './RadiusAxis';\r\nimport AngleAxis from './AngleAxis';\r\nimport PolarModel from './PolarModel';\r\nimport { CoordinateSystem, CoordinateSystemMaster, CoordinateSystemClipArea } from '../CoordinateSystem';\r\nimport GlobalModel from '../../model/Global';\r\nimport { ParsedModelFinder, ParsedModelFinderKnown } from '../../util/model';\r\nimport { ScaleDataValue } from '../../util/types';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\n\r\nexport const polarDimensions = ['radius', 'angle'];\r\n\r\ninterface Polar {\r\n update(ecModel: GlobalModel, api: ExtensionAPI): void\r\n}\r\nclass Polar implements CoordinateSystem, CoordinateSystemMaster {\r\n\r\n readonly name: string;\r\n\r\n readonly dimensions = polarDimensions;\r\n\r\n readonly type = 'polar';\r\n\r\n /**\r\n * x of polar center\r\n */\r\n cx = 0;\r\n\r\n /**\r\n * y of polar center\r\n */\r\n cy = 0;\r\n\r\n private _radiusAxis = new RadiusAxis();\r\n\r\n private _angleAxis = new AngleAxis();\r\n\r\n axisPointerEnabled = true;\r\n\r\n model: PolarModel;\r\n\r\n constructor(name: string) {\r\n this.name = name || '';\r\n\r\n this._radiusAxis.polar = this._angleAxis.polar = this;\r\n }\r\n\r\n /**\r\n * If contain coord\r\n */\r\n containPoint(point: number[]) {\r\n const coord = this.pointToCoord(point);\r\n return this._radiusAxis.contain(coord[0])\r\n && this._angleAxis.contain(coord[1]);\r\n }\r\n\r\n /**\r\n * If contain data\r\n */\r\n containData(data: number[]) {\r\n return this._radiusAxis.containData(data[0])\r\n && this._angleAxis.containData(data[1]);\r\n }\r\n\r\n getAxis(dim: 'radius' | 'angle') {\r\n const key = ('_' + dim + 'Axis') as '_radiusAxis' | '_angleAxis';\r\n return this[key];\r\n }\r\n\r\n getAxes() {\r\n return [this._radiusAxis, this._angleAxis];\r\n }\r\n\r\n /**\r\n * Get axes by type of scale\r\n */\r\n getAxesByScale(scaleType: 'ordinal' | 'interval' | 'time' | 'log') {\r\n const axes = [];\r\n const angleAxis = this._angleAxis;\r\n const radiusAxis = this._radiusAxis;\r\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\r\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\r\n\r\n return axes;\r\n }\r\n\r\n getAngleAxis() {\r\n return this._angleAxis;\r\n }\r\n\r\n getRadiusAxis() {\r\n return this._radiusAxis;\r\n }\r\n\r\n getOtherAxis(axis: AngleAxis | RadiusAxis): AngleAxis | RadiusAxis {\r\n const angleAxis = this._angleAxis;\r\n return axis === angleAxis ? this._radiusAxis : angleAxis;\r\n }\r\n\r\n /**\r\n * Base axis will be used on stacking.\r\n *\r\n */\r\n getBaseAxis() {\r\n return this.getAxesByScale('ordinal')[0]\r\n || this.getAxesByScale('time')[0]\r\n || this.getAngleAxis();\r\n }\r\n\r\n getTooltipAxes(dim: 'radius' | 'angle' | 'auto') {\r\n const baseAxis = (dim != null && dim !== 'auto')\r\n ? this.getAxis(dim) : this.getBaseAxis();\r\n return {\r\n baseAxes: [baseAxis],\r\n otherAxes: [this.getOtherAxis(baseAxis)]\r\n };\r\n }\r\n\r\n /**\r\n * Convert a single data item to (x, y) point.\r\n * Parameter data is an array which the first element is radius and the second is angle\r\n */\r\n dataToPoint(data: ScaleDataValue[], clamp?: boolean) {\r\n return this.coordToPoint([\r\n this._radiusAxis.dataToRadius(data[0], clamp),\r\n this._angleAxis.dataToAngle(data[1], clamp)\r\n ]);\r\n }\r\n\r\n /**\r\n * Convert a (x, y) point to data\r\n */\r\n pointToData(point: number[], clamp?: boolean) {\r\n const coord = this.pointToCoord(point);\r\n return [\r\n this._radiusAxis.radiusToData(coord[0], clamp),\r\n this._angleAxis.angleToData(coord[1], clamp)\r\n ];\r\n }\r\n\r\n /**\r\n * Convert a (x, y) point to (radius, angle) coord\r\n */\r\n pointToCoord(point: number[]) {\r\n let dx = point[0] - this.cx;\r\n let dy = point[1] - this.cy;\r\n const angleAxis = this.getAngleAxis();\r\n const extent = angleAxis.getExtent();\r\n let minAngle = Math.min(extent[0], extent[1]);\r\n let maxAngle = Math.max(extent[0], extent[1]);\r\n // Fix fixed extent in polarCreator\r\n // FIXME\r\n angleAxis.inverse\r\n ? (minAngle = maxAngle - 360)\r\n : (maxAngle = minAngle + 360);\r\n\r\n const radius = Math.sqrt(dx * dx + dy * dy);\r\n dx /= radius;\r\n dy /= radius;\r\n\r\n let radian = Math.atan2(-dy, dx) / Math.PI * 180;\r\n\r\n // move to angleExtent\r\n const dir = radian < minAngle ? 1 : -1;\r\n while (radian < minAngle || radian > maxAngle) {\r\n radian += dir * 360;\r\n }\r\n\r\n return [radius, radian];\r\n }\r\n\r\n /**\r\n * Convert a (radius, angle) coord to (x, y) point\r\n */\r\n coordToPoint(coord: number[]) {\r\n const radius = coord[0];\r\n const radian = coord[1] / 180 * Math.PI;\r\n const x = Math.cos(radian) * radius + this.cx;\r\n // Inverse the y\r\n const y = -Math.sin(radian) * radius + this.cy;\r\n\r\n return [x, y];\r\n }\r\n\r\n /**\r\n * Get ring area of cartesian.\r\n * Area will have a contain function to determine if a point is in the coordinate system.\r\n */\r\n getArea(): PolarArea {\r\n\r\n const angleAxis = this.getAngleAxis();\r\n const radiusAxis = this.getRadiusAxis();\r\n\r\n const radiusExtent = radiusAxis.getExtent().slice();\r\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\r\n const angleExtent = angleAxis.getExtent();\r\n\r\n const RADIAN = Math.PI / 180;\r\n const EPSILON = 1e-4;\r\n return {\r\n cx: this.cx,\r\n cy: this.cy,\r\n r0: radiusExtent[0],\r\n r: radiusExtent[1],\r\n startAngle: -angleExtent[0] * RADIAN,\r\n endAngle: -angleExtent[1] * RADIAN,\r\n clockwise: angleAxis.inverse,\r\n contain(x: number, y: number) {\r\n // It's a ring shape.\r\n // Start angle and end angle don't matter\r\n const dx = x - this.cx;\r\n const dy = y - this.cy;\r\n const d2 = dx * dx + dy * dy;\r\n const r = this.r;\r\n const r0 = this.r0;\r\n\r\n // minus a tiny value 1e-4 in double side to avoid being clipped unexpectedly\r\n // r == r0 contain nothing\r\n return r !== r0 && (d2 - EPSILON) <= r * r && (d2 + EPSILON) >= r0 * r0;\r\n }\r\n };\r\n }\r\n\r\n convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue[]) {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n }\r\n\r\n convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, pixel: number[]) {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n }\r\n}\r\n\r\nfunction getCoordSys(finder: ParsedModelFinderKnown) {\r\n const seriesModel = finder.seriesModel;\r\n const polarModel = finder.polarModel as PolarModel;\r\n return polarModel && polarModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem as Polar;\r\n}\r\n\r\ninterface PolarArea extends CoordinateSystemClipArea {\r\n cx: number\r\n cy: number\r\n r0: number\r\n r: number\r\n startAngle: number\r\n endAngle: number\r\n clockwise: boolean\r\n}\r\n\r\nexport default Polar;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// TODO Axis scale\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Polar, { polarDimensions } from './Polar';\r\nimport {parsePercent} from '../../util/number';\r\nimport {\r\n createScaleByModel,\r\n niceScaleExtent,\r\n getDataDimensionsOnAxis\r\n} from '../../coord/axisHelper';\r\n\r\nimport PolarModel from './PolarModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GlobalModel from '../../model/Global';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\nimport RadiusAxis from './RadiusAxis';\r\nimport AngleAxis from './AngleAxis';\r\nimport { PolarAxisModel, AngleAxisModel, RadiusAxisModel } from './AxisModel';\r\nimport SeriesModel from '../../model/Series';\r\nimport { SeriesOption } from '../../util/types';\r\nimport { SINGLE_REFERRING } from '../../util/model';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport { CategoryAxisBaseOption } from '../axisCommonTypes';\r\n\r\n/**\r\n * Resize method bound to the polar\r\n */\r\nfunction resizePolar(polar: Polar, polarModel: PolarModel, api: ExtensionAPI) {\r\n const center = polarModel.get('center');\r\n const width = api.getWidth();\r\n const height = api.getHeight();\r\n\r\n polar.cx = parsePercent(center[0], width);\r\n polar.cy = parsePercent(center[1], height);\r\n\r\n const radiusAxis = polar.getRadiusAxis();\r\n const size = Math.min(width, height) / 2;\r\n\r\n let radius = polarModel.get('radius');\r\n if (radius == null) {\r\n radius = [0, '100%'];\r\n }\r\n else if (!zrUtil.isArray(radius)) {\r\n // r0 = 0\r\n radius = [0, radius];\r\n }\r\n const parsedRadius = [\r\n parsePercent(radius[0], size),\r\n parsePercent(radius[1], size)\r\n ];\r\n\r\n radiusAxis.inverse\r\n ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0])\r\n : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\r\n}\r\n\r\n/**\r\n * Update polar\r\n */\r\nfunction updatePolarScale(this: Polar, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const polar = this;\r\n const angleAxis = polar.getAngleAxis();\r\n const radiusAxis = polar.getRadiusAxis();\r\n // Reset scale\r\n angleAxis.scale.setExtent(Infinity, -Infinity);\r\n radiusAxis.scale.setExtent(Infinity, -Infinity);\r\n\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === polar) {\r\n const data = seriesModel.getData();\r\n zrUtil.each(getDataDimensionsOnAxis(data, 'radius'), function (dim) {\r\n radiusAxis.scale.unionExtentFromData(data, dim);\r\n });\r\n zrUtil.each(getDataDimensionsOnAxis(data, 'angle'), function (dim) {\r\n angleAxis.scale.unionExtentFromData(data, dim);\r\n });\r\n }\r\n });\r\n\r\n niceScaleExtent(angleAxis.scale, angleAxis.model);\r\n niceScaleExtent(radiusAxis.scale, radiusAxis.model);\r\n\r\n // Fix extent of category angle axis\r\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\r\n const extent = angleAxis.getExtent();\r\n const diff = 360 / (angleAxis.scale as OrdinalScale).count();\r\n angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff);\r\n angleAxis.setExtent(extent[0], extent[1]);\r\n }\r\n}\r\n\r\nfunction isAngleAxisModel(axisModel: AngleAxisModel | PolarAxisModel): axisModel is AngleAxisModel {\r\n return axisModel.mainType === 'angleAxis';\r\n}\r\n/**\r\n * Set common axis properties\r\n */\r\nfunction setAxis(axis: RadiusAxis | AngleAxis, axisModel: PolarAxisModel) {\r\n axis.type = axisModel.get('type');\r\n axis.scale = createScaleByModel(axisModel);\r\n axis.onBand = (axisModel as AxisBaseModel).get('boundaryGap')\r\n && axis.type === 'category';\r\n axis.inverse = axisModel.get('inverse');\r\n\r\n if (isAngleAxisModel(axisModel)) {\r\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\r\n const startAngle = axisModel.get('startAngle');\r\n const endAngle = axisModel.get('endAngle') ?? (startAngle + (axis.inverse ? -360 : 360));\r\n axis.setExtent(startAngle, endAngle);\r\n }\r\n\r\n // Inject axis instance\r\n axisModel.axis = axis;\r\n axis.model = axisModel as AngleAxisModel | RadiusAxisModel;\r\n}\r\n\r\n\r\nconst polarCreator = {\r\n\r\n dimensions: polarDimensions,\r\n\r\n create: function (ecModel: GlobalModel, api: ExtensionAPI) {\r\n const polarList: Polar[] = [];\r\n ecModel.eachComponent('polar', function (polarModel: PolarModel, idx: number) {\r\n const polar = new Polar(idx + '');\r\n // Inject resize and update method\r\n polar.update = updatePolarScale;\r\n\r\n const radiusAxis = polar.getRadiusAxis();\r\n const angleAxis = polar.getAngleAxis();\r\n\r\n const radiusAxisModel = polarModel.findAxisModel('radiusAxis');\r\n const angleAxisModel = polarModel.findAxisModel('angleAxis');\r\n\r\n setAxis(radiusAxis, radiusAxisModel);\r\n setAxis(angleAxis, angleAxisModel);\r\n\r\n resizePolar(polar, polarModel, api);\r\n\r\n polarList.push(polar);\r\n\r\n polarModel.coordinateSystem = polar;\r\n polar.model = polarModel;\r\n });\r\n // Inject coordinateSystem to series\r\n ecModel.eachSeries(function (seriesModel: SeriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'polar') {\r\n const polarModel = seriesModel.getReferringComponents(\r\n 'polar', SINGLE_REFERRING\r\n ).models[0] as PolarModel;\r\n\r\n if (__DEV__) {\r\n if (!polarModel) {\r\n throw new Error(\r\n 'Polar \"' + zrUtil.retrieve(\r\n seriesModel.get('polarIndex'),\r\n seriesModel.get('polarId'),\r\n 0\r\n ) + '\" not found'\r\n );\r\n }\r\n }\r\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\r\n }\r\n });\r\n\r\n return polarList;\r\n }\r\n};\r\n\r\nexport default polarCreator;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport {createTextStyle} from '../../label/labelStyle';\r\nimport Model from '../../model/Model';\r\nimport AxisView from './AxisView';\r\nimport AxisBuilder from './AxisBuilder';\r\nimport { AngleAxisModel } from '../../coord/polar/AxisModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport Polar from '../../coord/polar/Polar';\r\nimport AngleAxis from '../../coord/polar/AngleAxis';\r\nimport { ZRTextAlign, ZRTextVerticalAlign, ColorString } from '../../util/types';\r\nimport { getECData } from '../../util/innerStore';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\n\r\nconst elementList = [\r\n 'axisLine',\r\n 'axisLabel',\r\n 'axisTick',\r\n 'minorTick',\r\n 'splitLine',\r\n 'minorSplitLine',\r\n 'splitArea'\r\n] as const;\r\n\r\nfunction getAxisLineShape(polar: Polar, rExtent: number[], angle: number) {\r\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\r\n const start = polar.coordToPoint([rExtent[0], angle]);\r\n const end = polar.coordToPoint([rExtent[1], angle]);\r\n\r\n return {\r\n x1: start[0],\r\n y1: start[1],\r\n x2: end[0],\r\n y2: end[1]\r\n };\r\n}\r\n\r\nfunction getRadiusIdx(polar: Polar) {\r\n const radiusAxis = polar.getRadiusAxis();\r\n return radiusAxis.inverse ? 0 : 1;\r\n}\r\n\r\n// Remove the last tick which will overlap the first tick\r\nfunction fixAngleOverlap(list: TickCoord[]) {\r\n const firstItem = list[0];\r\n const lastItem = list[list.length - 1];\r\n if (firstItem\r\n && lastItem\r\n && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4\r\n ) {\r\n list.pop();\r\n }\r\n}\r\n\r\ntype TickCoord = ReturnType[number];\r\ntype TickLabel = ReturnType[number] & {\r\n coord: number\r\n};\r\n\r\nclass AngleAxisView extends AxisView {\r\n\r\n static readonly type = 'angleAxis';\r\n readonly type = AngleAxisView.type;\r\n\r\n axisPointerClass = 'PolarAxisPointer';\r\n\r\n render(angleAxisModel: AngleAxisModel, ecModel: GlobalModel) {\r\n this.group.removeAll();\r\n if (!angleAxisModel.get('show')) {\r\n return;\r\n }\r\n\r\n const angleAxis = angleAxisModel.axis;\r\n const polar = angleAxis.polar;\r\n const radiusExtent = polar.getRadiusAxis().getExtent();\r\n\r\n const ticksAngles = angleAxis.getTicksCoords();\r\n const minorTickAngles = angleAxis.getMinorTicksCoords();\r\n\r\n const labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem: TickLabel) {\r\n labelItem = zrUtil.clone(labelItem);\r\n const scale = angleAxis.scale;\r\n const tickValue = scale.type === 'ordinal'\r\n ? (scale as OrdinalScale).getRawOrdinalNumber(labelItem.tickValue)\r\n : labelItem.tickValue;\r\n labelItem.coord = angleAxis.dataToCoord(tickValue);\r\n return labelItem;\r\n });\r\n\r\n fixAngleOverlap(labels);\r\n fixAngleOverlap(ticksAngles);\r\n\r\n zrUtil.each(elementList, function (name) {\r\n if (angleAxisModel.get([name, 'show'])\r\n && (!angleAxis.scale.isBlank() || name === 'axisLine')\r\n ) {\r\n angelAxisElementsBuilders[name](\r\n this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels\r\n );\r\n }\r\n }, this);\r\n }\r\n\r\n}\r\n\r\ninterface AngleAxisElementBuilder {\r\n (\r\n group: graphic.Group,\r\n angleAxisModel: AngleAxisModel,\r\n polar: Polar,\r\n ticksAngles: TickCoord[],\r\n minorTickAngles: TickCoord[][],\r\n radiusExtent: number[],\r\n labels?: TickLabel[]\r\n ): void\r\n}\r\n\r\nconst angelAxisElementsBuilders: Record = {\r\n\r\n axisLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n const lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']);\r\n const angleAxis = polar.getAngleAxis();\r\n const RADIAN = Math.PI / 180;\r\n const angleExtent = angleAxis.getExtent();\r\n\r\n // extent id of the axis radius (r0 and r)\r\n const rId = getRadiusIdx(polar);\r\n const r0Id = rId ? 0 : 1;\r\n let shape;\r\n const shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';\r\n\r\n if (radiusExtent[r0Id] === 0) {\r\n shape = new graphic[shapeType]({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId],\r\n startAngle: -angleExtent[0] * RADIAN,\r\n endAngle: -angleExtent[1] * RADIAN,\r\n clockwise: angleAxis.inverse\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n else {\r\n shape = new graphic.Ring({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: radiusExtent[rId],\r\n r0: radiusExtent[r0Id]\r\n },\r\n style: lineStyleModel.getLineStyle(),\r\n z2: 1,\r\n silent: true\r\n });\r\n }\r\n shape.style.fill = null;\r\n group.add(shape);\r\n },\r\n\r\n axisTick(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n const tickModel = angleAxisModel.getModel('axisTick');\r\n\r\n const tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\r\n const radius = radiusExtent[getRadiusIdx(polar)];\r\n\r\n const lines = zrUtil.map(ticksAngles, function (tickAngleItem) {\r\n return new graphic.Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\r\n });\r\n });\r\n group.add(graphic.mergePath(\r\n lines, {\r\n style: zrUtil.defaults(\r\n tickModel.getModel('lineStyle').getLineStyle(),\r\n {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }\r\n )\r\n }\r\n ));\r\n },\r\n\r\n minorTick(group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n\r\n const tickModel = angleAxisModel.getModel('axisTick');\r\n const minorTickModel = angleAxisModel.getModel('minorTick');\r\n\r\n const tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\r\n const radius = radiusExtent[getRadiusIdx(polar)];\r\n\r\n const lines = [];\r\n\r\n for (let i = 0; i < minorTickAngles.length; i++) {\r\n for (let k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new graphic.Line({\r\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n\r\n group.add(graphic.mergePath(\r\n lines, {\r\n style: zrUtil.defaults(\r\n minorTickModel.getModel('lineStyle').getLineStyle(),\r\n zrUtil.defaults(\r\n tickModel.getLineStyle(), {\r\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\r\n }\r\n )\r\n )\r\n }\r\n ));\r\n },\r\n\r\n axisLabel(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\r\n const rawCategoryData = angleAxisModel.getCategories(true);\r\n\r\n const commonLabelModel = angleAxisModel.getModel('axisLabel');\r\n\r\n const labelMargin = commonLabelModel.get('margin');\r\n const triggerEvent = angleAxisModel.get('triggerEvent');\r\n\r\n // Use length of ticksAngles because it may remove the last tick to avoid overlapping\r\n zrUtil.each(labels, function (labelItem, idx) {\r\n let labelModel = commonLabelModel;\r\n const tickValue = labelItem.tickValue;\r\n\r\n const r = radiusExtent[getRadiusIdx(polar)];\r\n const p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\r\n const cx = polar.cx;\r\n const cy = polar.cy;\r\n\r\n const labelTextAlign: ZRTextAlign = Math.abs(p[0] - cx) / r < 0.3\r\n ? 'center' : (p[0] > cx ? 'left' : 'right');\r\n const labelTextVerticalAlign: ZRTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3\r\n ? 'middle' : (p[1] > cy ? 'top' : 'bottom');\r\n\r\n if (rawCategoryData && rawCategoryData[tickValue]) {\r\n const rawCategoryItem = rawCategoryData[tickValue];\r\n if (zrUtil.isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\r\n labelModel = new Model(\r\n rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel\r\n );\r\n }\r\n }\r\n\r\n const textEl = new graphic.Text({\r\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\r\n style: createTextStyle(labelModel, {\r\n x: p[0],\r\n y: p[1],\r\n fill: labelModel.getTextColor()\r\n || angleAxisModel.get(['axisLine', 'lineStyle', 'color']) as ColorString,\r\n text: labelItem.formattedLabel,\r\n align: labelTextAlign,\r\n verticalAlign: labelTextVerticalAlign\r\n })\r\n });\r\n group.add(textEl);\r\n\r\n // Pack data for mouse event\r\n if (triggerEvent) {\r\n const eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\r\n eventData.targetType = 'axisLabel';\r\n eventData.value = labelItem.rawLabel;\r\n getECData(textEl).eventData = eventData;\r\n }\r\n\r\n }, this);\r\n },\r\n\r\n splitLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n const splitLineModel = angleAxisModel.getModel('splitLine');\r\n const lineStyleModel = splitLineModel.getModel('lineStyle');\r\n let lineColors = lineStyleModel.get('color');\r\n let lineCount = 0;\r\n\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n\r\n const splitLines: graphic.Line[][] = [];\r\n\r\n for (let i = 0; i < ticksAngles.length; i++) {\r\n const colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new graphic.Line({\r\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\r\n }));\r\n }\r\n\r\n // Simple optimization\r\n // Batching the lines if color are the same\r\n for (let i = 0; i < splitLines.length; i++) {\r\n group.add(graphic.mergePath(splitLines[i], {\r\n style: zrUtil.defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n }\r\n },\r\n\r\n minorSplitLine(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!minorTickAngles.length) {\r\n return;\r\n }\r\n\r\n const minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\r\n const lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n\r\n const lines = [];\r\n\r\n for (let i = 0; i < minorTickAngles.length; i++) {\r\n for (let k = 0; k < minorTickAngles[i].length; k++) {\r\n lines.push(new graphic.Line({\r\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\r\n }));\r\n }\r\n }\r\n\r\n group.add(graphic.mergePath(lines, {\r\n style: lineStyleModel.getLineStyle(),\r\n silent: true,\r\n z: angleAxisModel.get('z')\r\n }));\r\n },\r\n\r\n splitArea(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\r\n if (!ticksAngles.length) {\r\n return;\r\n }\r\n\r\n const splitAreaModel = angleAxisModel.getModel('splitArea');\r\n const areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n let areaColors = areaStyleModel.get('color');\r\n let lineCount = 0;\r\n\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n\r\n const splitAreas: graphic.Sector[][] = [];\r\n\r\n const RADIAN = Math.PI / 180;\r\n let prevAngle = -ticksAngles[0].coord * RADIAN;\r\n const r0 = Math.min(radiusExtent[0], radiusExtent[1]);\r\n const r1 = Math.max(radiusExtent[0], radiusExtent[1]);\r\n\r\n const clockwise = angleAxisModel.get('clockwise');\r\n\r\n for (let i = 1, len = ticksAngles.length; i <= len; i++) {\r\n const coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\r\n const colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new graphic.Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: r0,\r\n r: r1,\r\n startAngle: prevAngle,\r\n endAngle: -coord * RADIAN,\r\n clockwise: clockwise\r\n },\r\n silent: true\r\n }));\r\n prevAngle = -coord * RADIAN;\r\n }\r\n\r\n // Simple optimization\r\n // Batching the lines if color are the same\r\n for (let i = 0; i < splitAreas.length; i++) {\r\n group.add(graphic.mergePath(splitAreas[i], {\r\n style: zrUtil.defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n};\r\n\r\nexport default AngleAxisView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport AxisBuilder from './AxisBuilder';\r\nimport AxisView from './AxisView';\r\nimport { RadiusAxisModel } from '../../coord/polar/AxisModel';\r\nimport Polar from '../../coord/polar/Polar';\r\nimport RadiusAxis from '../../coord/polar/RadiusAxis';\r\nimport GlobalModel from '../../model/Global';\r\n\r\nconst axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n] as const;\r\nconst selfBuilderAttrs = [\r\n 'splitLine', 'splitArea', 'minorSplitLine'\r\n] as const;\r\n\r\ntype TickCoord = ReturnType[number];\r\n\r\nclass RadiusAxisView extends AxisView {\r\n\r\n static readonly type = 'radiusAxis';\r\n readonly type = RadiusAxisView.type;\r\n\r\n axisPointerClass = 'PolarAxisPointer';\r\n\r\n private _axisGroup: graphic.Group;\r\n\r\n render(radiusAxisModel: RadiusAxisModel, ecModel: GlobalModel) {\r\n this.group.removeAll();\r\n if (!radiusAxisModel.get('show')) {\r\n return;\r\n }\r\n\r\n const oldAxisGroup = this._axisGroup;\r\n const newAxisGroup = this._axisGroup = new graphic.Group();\r\n this.group.add(newAxisGroup);\r\n\r\n const radiusAxis = radiusAxisModel.axis;\r\n const polar = radiusAxis.polar;\r\n const angleAxis = polar.getAngleAxis();\r\n const ticksCoords = radiusAxis.getTicksCoords();\r\n const minorTicksCoords = radiusAxis.getMinorTicksCoords();\r\n const axisAngle = angleAxis.getExtent()[0];\r\n const radiusExtent = radiusAxis.getExtent();\r\n\r\n const layout = layoutAxis(polar, radiusAxisModel, axisAngle);\r\n const axisBuilder = new AxisBuilder(radiusAxisModel, layout);\r\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n newAxisGroup.add(axisBuilder.getGroup());\r\n\r\n graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\r\n\r\n zrUtil.each(selfBuilderAttrs, function (name) {\r\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\r\n axisElementBuilders[name](\r\n this.group,\r\n radiusAxisModel,\r\n polar,\r\n axisAngle,\r\n radiusExtent,\r\n ticksCoords,\r\n minorTicksCoords\r\n );\r\n }\r\n }, this);\r\n }\r\n}\r\n\r\ninterface AxisElementBuilder {\r\n (\r\n group: graphic.Group,\r\n axisModel: RadiusAxisModel,\r\n polar: Polar,\r\n axisAngle: number,\r\n radiusExtent: number[],\r\n ticksCoords: TickCoord[],\r\n minorTicksCoords?: TickCoord[][]\r\n ): void\r\n}\r\n\r\nconst axisElementBuilders: Record = {\r\n\r\n splitLine(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n const splitLineModel = radiusAxisModel.getModel('splitLine');\r\n const lineStyleModel = splitLineModel.getModel('lineStyle');\r\n let lineColors = lineStyleModel.get('color');\r\n let lineCount = 0;\r\n\r\n const angleAxis = polar.getAngleAxis();\r\n const RADIAN = Math.PI / 180;\r\n const angleExtent = angleAxis.getExtent();\r\n const shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';\r\n\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n\r\n const splitLines: graphic.Circle[][] = [];\r\n\r\n for (let i = 0; i < ticksCoords.length; i++) {\r\n const colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(new graphic[shapeType]({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n // ensure circle radius >= 0\r\n r: Math.max(ticksCoords[i].coord, 0),\r\n startAngle: -angleExtent[0] * RADIAN,\r\n endAngle: -angleExtent[1] * RADIAN,\r\n clockwise: angleAxis.inverse\r\n }\r\n }));\r\n }\r\n\r\n // Simple optimization\r\n // Batching the lines if color are the same\r\n for (let i = 0; i < splitLines.length; i++) {\r\n group.add(graphic.mergePath(splitLines[i], {\r\n style: zrUtil.defaults({\r\n stroke: lineColors[i % lineColors.length],\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n }\r\n },\r\n\r\n minorSplitLine(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n\r\n const minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\r\n const lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n\r\n const lines: graphic.Circle[] = [];\r\n\r\n for (let i = 0; i < minorTicksCoords.length; i++) {\r\n for (let k = 0; k < minorTicksCoords[i].length; k++) {\r\n lines.push(new graphic.Circle({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r: minorTicksCoords[i][k].coord\r\n }\r\n }));\r\n }\r\n }\r\n\r\n group.add(graphic.mergePath(lines, {\r\n style: zrUtil.defaults({\r\n fill: null\r\n }, lineStyleModel.getLineStyle()),\r\n silent: true\r\n }));\r\n },\r\n\r\n splitArea(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\r\n if (!ticksCoords.length) {\r\n return;\r\n }\r\n\r\n const splitAreaModel = radiusAxisModel.getModel('splitArea');\r\n const areaStyleModel = splitAreaModel.getModel('areaStyle');\r\n let areaColors = areaStyleModel.get('color');\r\n let lineCount = 0;\r\n\r\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\r\n\r\n const splitAreas: graphic.Sector[][] = [];\r\n\r\n let prevRadius = ticksCoords[0].coord;\r\n for (let i = 1; i < ticksCoords.length; i++) {\r\n const colorIndex = (lineCount++) % areaColors.length;\r\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\r\n splitAreas[colorIndex].push(new graphic.Sector({\r\n shape: {\r\n cx: polar.cx,\r\n cy: polar.cy,\r\n r0: prevRadius,\r\n r: ticksCoords[i].coord,\r\n startAngle: 0,\r\n endAngle: Math.PI * 2\r\n },\r\n silent: true\r\n }));\r\n prevRadius = ticksCoords[i].coord;\r\n }\r\n\r\n // Simple optimization\r\n // Batching the lines if color are the same\r\n for (let i = 0; i < splitAreas.length; i++) {\r\n group.add(graphic.mergePath(splitAreas[i], {\r\n style: zrUtil.defaults({\r\n fill: areaColors[i % areaColors.length]\r\n }, areaStyleModel.getAreaStyle()),\r\n silent: true\r\n }));\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * @inner\r\n */\r\nfunction layoutAxis(polar: Polar, radiusAxisModel: RadiusAxisModel, axisAngle: number) {\r\n return {\r\n position: [polar.cx, polar.cy],\r\n rotation: axisAngle / 180 * Math.PI,\r\n labelDirection: -1 as const,\r\n tickDirection: -1 as const,\r\n nameDirection: 1 as const,\r\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\r\n // Over splitLine and splitArea\r\n z2: 1\r\n };\r\n}\r\n\r\nexport default RadiusAxisView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {parsePercent} from '../util/number';\r\nimport {isDimensionStacked} from '../data/helper/dataStackHelper';\r\nimport type BarSeriesModel from '../chart/bar/BarSeries';\r\nimport type Polar from '../coord/polar/Polar';\r\nimport AngleAxis from '../coord/polar/AngleAxis';\r\nimport RadiusAxis from '../coord/polar/RadiusAxis';\r\nimport GlobalModel from '../model/Global';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport { Dictionary } from '../util/types';\r\nimport { PolarAxisModel } from '../coord/polar/AxisModel';\r\n\r\ntype PolarAxis = AngleAxis | RadiusAxis;\r\n\r\ninterface StackInfo {\r\n width: number\r\n maxWidth: number\r\n}\r\ninterface LayoutColumnInfo {\r\n autoWidthCount: number\r\n bandWidth: number\r\n remainedWidth: number\r\n categoryGap: string | number\r\n gap: string | number\r\n stacks: Dictionary\r\n}\r\n\r\ninterface BarWidthAndOffset {\r\n width: number\r\n offset: number\r\n}\r\n\r\nfunction getSeriesStackId(seriesModel: BarSeriesModel) {\r\n return seriesModel.get('stack')\r\n || '__ec_stack_' + seriesModel.seriesIndex;\r\n}\r\n\r\nfunction getAxisKey(polar: Polar, axis: PolarAxis) {\r\n return axis.dim + polar.model.componentIndex;\r\n}\r\n\r\nfunction barLayoutPolar(seriesType: string, ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n const lastStackCoords: Dictionary<{p: number, n: number}[]> = {};\r\n\r\n const barWidthAndOffset = calRadialBar(\r\n zrUtil.filter(\r\n ecModel.getSeriesByType(seriesType) as BarSeriesModel[],\r\n function (seriesModel) {\r\n return !ecModel.isSeriesFiltered(seriesModel)\r\n && seriesModel.coordinateSystem\r\n && seriesModel.coordinateSystem.type === 'polar';\r\n }\r\n )\r\n );\r\n\r\n ecModel.eachSeriesByType(seriesType, function (seriesModel: BarSeriesModel) {\r\n\r\n // Check series coordinate, do layout for polar only\r\n if (seriesModel.coordinateSystem.type !== 'polar') {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n const polar = seriesModel.coordinateSystem as Polar;\r\n const baseAxis = polar.getBaseAxis();\r\n const axisKey = getAxisKey(polar, baseAxis);\r\n\r\n const stackId = getSeriesStackId(seriesModel);\r\n const columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\r\n const columnOffset = columnLayoutInfo.offset;\r\n const columnWidth = columnLayoutInfo.width;\r\n const valueAxis = polar.getOtherAxis(baseAxis);\r\n\r\n const cx = seriesModel.coordinateSystem.cx;\r\n const cy = seriesModel.coordinateSystem.cy;\r\n\r\n const barMinHeight = seriesModel.get('barMinHeight') || 0;\r\n const barMinAngle = seriesModel.get('barMinAngle') || 0;\r\n\r\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\r\n\r\n const valueDim = data.mapDimension(valueAxis.dim);\r\n const baseDim = data.mapDimension(baseAxis.dim);\r\n const stacked = isDimensionStacked(data, valueDim /* , baseDim */);\r\n const clampLayout = baseAxis.dim !== 'radius'\r\n || !seriesModel.get('roundCap', true);\r\n\r\n const valueAxisModel = valueAxis.model as PolarAxisModel;\r\n const startValue = valueAxisModel.get('startValue');\r\n const valueAxisStart = valueAxis.dataToCoord(startValue || 0);\r\n\r\n for (let idx = 0, len = data.count(); idx < len; idx++) {\r\n const value = data.get(valueDim, idx) as number;\r\n const baseValue = data.get(baseDim, idx) as number;\r\n\r\n const sign = value >= 0 ? 'p' : 'n' as 'p' | 'n';\r\n let baseCoord = valueAxisStart;\r\n\r\n // Because of the barMinHeight, we can not use the value in\r\n // stackResultDimension directly.\r\n // Only ordinal axis can be stacked.\r\n if (stacked) {\r\n\r\n if (!lastStackCoords[stackId][baseValue]) {\r\n lastStackCoords[stackId][baseValue] = {\r\n p: valueAxisStart, // Positive stack\r\n n: valueAxisStart // Negative stack\r\n };\r\n }\r\n // Should also consider #4243\r\n baseCoord = lastStackCoords[stackId][baseValue][sign];\r\n }\r\n\r\n let r0;\r\n let r;\r\n let startAngle;\r\n let endAngle;\r\n\r\n // radial sector\r\n if (valueAxis.dim === 'radius') {\r\n let radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\r\n const angle = baseAxis.dataToCoord(baseValue);\r\n\r\n if (Math.abs(radiusSpan) < barMinHeight) {\r\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\r\n }\r\n\r\n r0 = baseCoord;\r\n r = baseCoord + radiusSpan;\r\n startAngle = angle - columnOffset;\r\n endAngle = startAngle - columnWidth;\r\n\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\r\n }\r\n // tangential sector\r\n else {\r\n let angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\r\n const radius = baseAxis.dataToCoord(baseValue);\r\n\r\n if (Math.abs(angleSpan) < barMinAngle) {\r\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\r\n }\r\n\r\n r0 = radius + columnOffset;\r\n r = r0 + columnWidth;\r\n startAngle = baseCoord;\r\n endAngle = baseCoord + angleSpan;\r\n\r\n // if the previous stack is at the end of the ring,\r\n // add a round to differentiate it from origin\r\n // let extent = angleAxis.getExtent();\r\n // let stackCoord = angle;\r\n // if (stackCoord === extent[0] && value > 0) {\r\n // stackCoord = extent[1];\r\n // }\r\n // else if (stackCoord === extent[1] && value < 0) {\r\n // stackCoord = extent[0];\r\n // }\r\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\r\n }\r\n\r\n data.setItemLayout(idx, {\r\n cx: cx,\r\n cy: cy,\r\n r0: r0,\r\n r: r,\r\n // Consider that positive angle is anti-clockwise,\r\n // while positive radian of sector is clockwise\r\n startAngle: -startAngle * Math.PI / 180,\r\n endAngle: -endAngle * Math.PI / 180,\r\n\r\n /**\r\n * Keep the same logic with bar in catesion: use end value to\r\n * control direction. Notice that if clockwise is true (by\r\n * default), the sector will always draw clockwisely, no matter\r\n * whether endAngle is greater or less than startAngle.\r\n */\r\n clockwise: startAngle >= endAngle\r\n });\r\n\r\n }\r\n\r\n });\r\n\r\n}\r\n\r\n/**\r\n * Calculate bar width and offset for radial bar charts\r\n */\r\nfunction calRadialBar(barSeries: BarSeriesModel[]) {\r\n // Columns info on each category axis. Key is polar name\r\n const columnsMap: Dictionary = {};\r\n\r\n zrUtil.each(barSeries, function (seriesModel, idx) {\r\n const data = seriesModel.getData();\r\n const polar = seriesModel.coordinateSystem as Polar;\r\n\r\n const baseAxis = polar.getBaseAxis();\r\n const axisKey = getAxisKey(polar, baseAxis);\r\n\r\n const axisExtent = baseAxis.getExtent();\r\n const bandWidth = baseAxis.type === 'category'\r\n ? baseAxis.getBandWidth()\r\n : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count());\r\n\r\n const columnsOnAxis = columnsMap[axisKey] || {\r\n bandWidth: bandWidth,\r\n remainedWidth: bandWidth,\r\n autoWidthCount: 0,\r\n categoryGap: '20%',\r\n gap: '30%',\r\n stacks: {}\r\n };\r\n const stacks = columnsOnAxis.stacks;\r\n columnsMap[axisKey] = columnsOnAxis;\r\n\r\n const stackId = getSeriesStackId(seriesModel);\r\n\r\n if (!stacks[stackId]) {\r\n columnsOnAxis.autoWidthCount++;\r\n }\r\n stacks[stackId] = stacks[stackId] || {\r\n width: 0,\r\n maxWidth: 0\r\n };\r\n\r\n let barWidth = parsePercent(\r\n seriesModel.get('barWidth'),\r\n bandWidth\r\n );\r\n const barMaxWidth = parsePercent(\r\n seriesModel.get('barMaxWidth'),\r\n bandWidth\r\n );\r\n const barGap = seriesModel.get('barGap');\r\n const barCategoryGap = seriesModel.get('barCategoryGap');\r\n\r\n if (barWidth && !stacks[stackId].width) {\r\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\r\n stacks[stackId].width = barWidth;\r\n columnsOnAxis.remainedWidth -= barWidth;\r\n }\r\n\r\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\r\n (barGap != null) && (columnsOnAxis.gap = barGap);\r\n (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);\r\n });\r\n\r\n\r\n const result: Dictionary> = {};\r\n\r\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\r\n\r\n result[coordSysName] = {};\r\n\r\n const stacks = columnsOnAxis.stacks;\r\n const bandWidth = columnsOnAxis.bandWidth;\r\n const categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\r\n const barGapPercent = parsePercent(columnsOnAxis.gap, 1);\r\n\r\n let remainedWidth = columnsOnAxis.remainedWidth;\r\n let autoWidthCount = columnsOnAxis.autoWidthCount;\r\n let autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n\r\n // Find if any auto calculated bar exceeded maxBarWidth\r\n zrUtil.each(stacks, function (column, stack) {\r\n let maxWidth = column.maxWidth;\r\n if (maxWidth && maxWidth < autoWidth) {\r\n maxWidth = Math.min(maxWidth, remainedWidth);\r\n if (column.width) {\r\n maxWidth = Math.min(maxWidth, column.width);\r\n }\r\n remainedWidth -= maxWidth;\r\n column.width = maxWidth;\r\n autoWidthCount--;\r\n }\r\n });\r\n\r\n // Recalculate width again\r\n autoWidth = (remainedWidth - categoryGap)\r\n / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\r\n autoWidth = Math.max(autoWidth, 0);\r\n\r\n let widthSum = 0;\r\n let lastColumn: StackInfo;\r\n zrUtil.each(stacks, function (column, idx) {\r\n if (!column.width) {\r\n column.width = autoWidth;\r\n }\r\n lastColumn = column;\r\n widthSum += column.width * (1 + barGapPercent);\r\n });\r\n if (lastColumn) {\r\n widthSum -= lastColumn.width * barGapPercent;\r\n }\r\n\r\n let offset = -widthSum / 2;\r\n zrUtil.each(stacks, function (column, stackId) {\r\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\r\n offset: offset,\r\n width: column.width\r\n } as BarWidthAndOffset;\r\n\r\n offset += column.width * (1 + barGapPercent);\r\n });\r\n });\r\n\r\n return result;\r\n}\r\n\r\nexport default barLayoutPolar;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport AxisView from '../axis/AxisView';\r\nimport PolarAxisPointer from '../axisPointer/PolarAxisPointer';\r\nimport {install as installAxisPointer} from '../axisPointer/install';\r\nimport PolarModel from '../../coord/polar/PolarModel';\r\nimport axisModelCreator from '../../coord/axisModelCreator';\r\nimport {\r\n AngleAxisOption,\r\n RadiusAxisOption,\r\n AngleAxisModel,\r\n RadiusAxisModel\r\n} from '../../coord/polar/AxisModel';\r\nimport polarCreator from '../../coord/polar/polarCreator';\r\nimport AngleAxisView from '../axis/AngleAxisView';\r\nimport RadiusAxisView from '../axis/RadiusAxisView';\r\nimport ComponentView from '../../view/Component';\r\nimport { curry } from 'zrender/src/core/util';\r\nimport barLayoutPolar from '../../layout/barPolar';\r\n\r\n\r\nconst angleAxisExtraOption: AngleAxisOption = {\r\n startAngle: 90,\r\n\r\n clockwise: true,\r\n\r\n splitNumber: 12,\r\n\r\n axisLabel: {\r\n rotate: 0\r\n }\r\n};\r\n\r\nconst radiusAxisExtraOption: RadiusAxisOption = {\r\n splitNumber: 5\r\n};\r\n\r\nclass PolarView extends ComponentView {\r\n static type = 'polar';\r\n type = PolarView.type;\r\n}\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n use(installAxisPointer);\r\n\r\n AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\r\n\r\n registers.registerCoordinateSystem('polar', polarCreator);\r\n\r\n registers.registerComponentModel(PolarModel);\r\n registers.registerComponentView(PolarView);\r\n\r\n // Model and view for angleAxis and radiusAxis\r\n axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption);\r\n axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption);\r\n\r\n registers.registerComponentView(AngleAxisView);\r\n registers.registerComponentView(RadiusAxisView);\r\n\r\n registers.registerLayout(curry(barLayoutPolar, 'bar'));\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport SingleAxisModel from './AxisModel';\r\n\r\ninterface LayoutResult {\r\n position: [number, number],\r\n rotation: number\r\n labelRotation: number\r\n labelDirection: number // 1 | -1\r\n tickDirection: number\r\n nameDirection: number\r\n z2: number\r\n}\r\n\r\nexport function layout(axisModel: SingleAxisModel, opt?: {\r\n labelInside?: boolean\r\n rotate?: number\r\n}) {\r\n opt = opt || {};\r\n const single = axisModel.coordinateSystem;\r\n const axis = axisModel.axis;\r\n const layout = {} as LayoutResult;\r\n\r\n const axisPosition = axis.position;\r\n const orient = axis.orient;\r\n\r\n const rect = single.getRect();\r\n const rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\r\n\r\n const positionMap = {\r\n horizontal: {top: rectBound[2], bottom: rectBound[3]},\r\n vertical: {left: rectBound[0], right: rectBound[1]}\r\n } as const;\r\n\r\n layout.position = [\r\n orient === 'vertical'\r\n ? positionMap.vertical[axisPosition as 'left' | 'right']\r\n : rectBound[0],\r\n orient === 'horizontal'\r\n ? positionMap.horizontal[axisPosition as 'top' | 'bottom']\r\n : rectBound[3]\r\n ] as [number, number];\r\n\r\n const r = {horizontal: 0, vertical: 1};\r\n layout.rotation = Math.PI / 2 * r[orient];\r\n\r\n const directionMap = {top: -1, bottom: 1, right: 1, left: -1} as const;\r\n\r\n layout.labelDirection = layout.tickDirection =\r\n layout.nameDirection = directionMap[axisPosition];\r\n\r\n if (axisModel.get(['axisTick', 'inside'])) {\r\n layout.tickDirection = -layout.tickDirection;\r\n }\r\n\r\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\r\n layout.labelDirection = -layout.labelDirection;\r\n }\r\n\r\n let labelRotation = opt.rotate;\r\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\r\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\r\n\r\n layout.z2 = 1;\r\n\r\n return layout;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport AxisBuilder from './AxisBuilder';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper';\r\nimport AxisView from './AxisView';\r\nimport {rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove} from './axisSplitHelper';\r\nimport SingleAxisModel from '../../coord/single/AxisModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Payload } from '../../util/types';\r\n\r\nconst axisBuilderAttrs = [\r\n 'axisLine', 'axisTickLabel', 'axisName'\r\n] as const;\r\n\r\nconst selfBuilderAttrs = ['splitArea', 'splitLine'] as const;\r\n\r\nclass SingleAxisView extends AxisView {\r\n\r\n static readonly type = 'singleAxis';\r\n readonly type = SingleAxisView.type;\r\n\r\n private _axisGroup: graphic.Group;\r\n\r\n axisPointerClass = 'SingleAxisPointer';\r\n\r\n render(axisModel: SingleAxisModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n\r\n const group = this.group;\r\n\r\n group.removeAll();\r\n\r\n const oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new graphic.Group();\r\n\r\n const layout = singleAxisHelper.layout(axisModel);\r\n\r\n const axisBuilder = new AxisBuilder(axisModel, layout);\r\n\r\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n\r\n group.add(this._axisGroup);\r\n group.add(axisBuilder.getGroup());\r\n\r\n zrUtil.each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this.group, this._axisGroup, axisModel);\r\n }\r\n }, this);\r\n\r\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n\r\n super.render(axisModel, ecModel, api, payload);\r\n }\r\n\r\n remove() {\r\n rectCoordAxisHandleRemove(this);\r\n }\r\n}\r\n\r\ninterface AxisElementBuilder {\r\n (axisView: SingleAxisView, group: graphic.Group, axisGroup: graphic.Group, axisModel: SingleAxisModel): void\r\n}\r\n\r\nconst axisElementBuilders: Record = {\r\n\r\n splitLine(axisView, group, axisGroup, axisModel) {\r\n const axis = axisModel.axis;\r\n\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n\r\n const splitLineModel = axisModel.getModel('splitLine');\r\n const lineStyleModel = splitLineModel.getModel('lineStyle');\r\n let lineColors = lineStyleModel.get('color');\r\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\r\n const lineWidth = lineStyleModel.get('width');\r\n\r\n const gridRect = axisModel.coordinateSystem.getRect();\r\n const isHorizontal = axis.isHorizontal();\r\n\r\n const splitLines: graphic.Line[][] = [];\r\n let lineCount = 0;\r\n\r\n const ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n\r\n const p1 = [];\r\n const p2 = [];\r\n\r\n for (let i = 0; i < ticksCoords.length; ++i) {\r\n const tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n }\r\n else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n\r\n const line = new graphic.Line({\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n silent: true\r\n });\r\n graphic.subPixelOptimizeLine(line.shape, lineWidth);\r\n\r\n const colorIndex = (lineCount++) % lineColors.length;\r\n splitLines[colorIndex] = splitLines[colorIndex] || [];\r\n splitLines[colorIndex].push(line);\r\n }\r\n\r\n const lineStyle = lineStyleModel.getLineStyle(['color']);\r\n for (let i = 0; i < splitLines.length; ++i) {\r\n group.add(graphic.mergePath(splitLines[i], {\r\n style: zrUtil.defaults({\r\n stroke: lineColors[i % lineColors.length]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n\r\n splitArea(axisView, group, axisGroup, axisModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\r\n }\r\n};\r\n\r\nexport default SingleAxisView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ComponentModel from '../../model/Component';\r\nimport { AxisModelExtendedInCreator } from '../axisModelCreator';\r\nimport {AxisModelCommonMixin} from '../axisModelCommonMixin';\r\nimport Single from './Single';\r\nimport SingleAxis from './SingleAxis';\r\nimport { AxisBaseOption } from '../axisCommonTypes';\r\nimport { BoxLayoutOptionMixin, LayoutOrient } from '../../util/types';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport { mixin } from 'zrender/src/core/util';\r\n\r\nexport type SingleAxisPosition = 'top' | 'bottom' | 'left' | 'right';\r\n\r\nexport type SingleAxisOption = AxisBaseOption & BoxLayoutOptionMixin & {\r\n mainType?: 'singleAxis'\r\n position?: SingleAxisPosition\r\n orient?: LayoutOrient\r\n};\r\n\r\nclass SingleAxisModel extends ComponentModel\r\n implements AxisBaseModel {\r\n static type = 'singleAxis';\r\n type = SingleAxisModel.type;\r\n\r\n static readonly layoutMode = 'box';\r\n\r\n axis: SingleAxis;\r\n\r\n coordinateSystem: Single;\r\n\r\n getCoordSysModel() {\r\n return this;\r\n }\r\n\r\n static defaultOption: SingleAxisOption = {\r\n\r\n left: '5%',\r\n top: '5%',\r\n right: '5%',\r\n bottom: '5%',\r\n\r\n type: 'value',\r\n\r\n position: 'bottom',\r\n\r\n orient: 'horizontal',\r\n\r\n axisLine: {\r\n show: true,\r\n lineStyle: {\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n\r\n // Single coordinate system and single axis is the,\r\n // which is used as the parent tooltip model.\r\n // same model, so we set default tooltip show as true.\r\n tooltip: {\r\n show: true\r\n },\r\n\r\n axisTick: {\r\n show: true,\r\n length: 6,\r\n lineStyle: {\r\n width: 1\r\n }\r\n },\r\n\r\n axisLabel: {\r\n show: true,\r\n interval: 'auto'\r\n },\r\n\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n type: 'dashed',\r\n opacity: 0.2\r\n }\r\n }\r\n };\r\n}\r\n\r\ninterface SingleAxisModel extends AxisModelCommonMixin,\r\n AxisModelExtendedInCreator {}\r\n\r\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\r\n\r\nexport default SingleAxisModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Axis from '../Axis';\r\nimport Scale from '../../scale/Scale';\r\nimport { OptionAxisType } from '../axisCommonTypes';\r\nimport SingleAxisModel, { SingleAxisPosition } from './AxisModel';\r\nimport { LayoutOrient } from '../../util/types';\r\nimport Single from './Single';\r\n\r\ninterface SingleAxis {\r\n /**\r\n * Transform global coord to local coord,\r\n * i.e. let localCoord = axis.toLocalCoord(80);\r\n */\r\n toLocalCoord(coord: number): number;\r\n\r\n /**\r\n * Transform global coord to local coord,\r\n * i.e. let globalCoord = axis.toLocalCoord(40);\r\n */\r\n toGlobalCoord(coord: number): number;\r\n}\r\nclass SingleAxis extends Axis {\r\n\r\n position: SingleAxisPosition;\r\n\r\n orient: LayoutOrient;\r\n\r\n coordinateSystem: Single;\r\n\r\n model: SingleAxisModel;\r\n\r\n constructor(\r\n dim: string,\r\n scale: Scale,\r\n coordExtent: [number, number],\r\n axisType?: OptionAxisType,\r\n position?: SingleAxisPosition\r\n ) {\r\n super(dim, scale, coordExtent);\r\n\r\n this.type = axisType || 'value';\r\n this.position = position || 'bottom';\r\n }\r\n\r\n /**\r\n * Judge the orient of the axis.\r\n */\r\n isHorizontal() {\r\n const position = this.position;\r\n return position === 'top' || position === 'bottom';\r\n }\r\n\r\n pointToData(point: number[], clamp?: boolean) { // TODO: clamp is not used.\r\n return this.coordinateSystem.pointToData(point)[0];\r\n }\r\n}\r\nexport default SingleAxis;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Single coordinates system.\r\n */\r\n\r\nimport SingleAxis from './SingleAxis';\r\nimport * as axisHelper from '../axisHelper';\r\nimport {getLayoutRect} from '../../util/layout';\r\nimport {each} from 'zrender/src/core/util';\r\nimport { CoordinateSystem, CoordinateSystemMaster } from '../CoordinateSystem';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport SingleAxisModel from './AxisModel';\r\nimport { ParsedModelFinder, ParsedModelFinderKnown } from '../../util/model';\r\nimport { ScaleDataValue } from '../../util/types';\r\nimport { AxisBaseModel } from '../AxisBaseModel';\r\nimport { CategoryAxisBaseOption } from '../axisCommonTypes';\r\n\r\nexport const singleDimensions = ['single'];\r\n/**\r\n * Create a single coordinates system.\r\n */\r\nclass Single implements CoordinateSystem, CoordinateSystemMaster {\r\n\r\n readonly type = 'single';\r\n\r\n readonly dimension = 'single';\r\n /**\r\n * Add it just for draw tooltip.\r\n */\r\n readonly dimensions = singleDimensions;\r\n\r\n name: string;\r\n\r\n axisPointerEnabled: boolean = true;\r\n\r\n model: SingleAxisModel;\r\n\r\n private _axis: SingleAxis;\r\n\r\n private _rect: BoundingRect;\r\n\r\n constructor(axisModel: SingleAxisModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n this.model = axisModel;\r\n\r\n this._init(axisModel, ecModel, api);\r\n }\r\n\r\n /**\r\n * Initialize single coordinate system.\r\n */\r\n _init(axisModel: SingleAxisModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n const dim = this.dimension;\r\n\r\n const axis = new SingleAxis(\r\n dim,\r\n axisHelper.createScaleByModel(axisModel),\r\n [0, 0],\r\n axisModel.get('type'),\r\n axisModel.get('position')\r\n );\r\n\r\n const isCategory = axis.type === 'category';\r\n axis.onBand = isCategory && (axisModel as AxisBaseModel).get('boundaryGap');\r\n axis.inverse = axisModel.get('inverse');\r\n axis.orient = axisModel.get('orient');\r\n\r\n axisModel.axis = axis;\r\n axis.model = axisModel;\r\n axis.coordinateSystem = this;\r\n this._axis = axis;\r\n }\r\n\r\n /**\r\n * Update axis scale after data processed\r\n */\r\n update(ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n if (seriesModel.coordinateSystem === this) {\r\n const data = seriesModel.getData();\r\n each(data.mapDimensionsAll(this.dimension), function (dim) {\r\n this._axis.scale.unionExtentFromData(data, dim);\r\n }, this);\r\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\r\n }\r\n }, this);\r\n }\r\n\r\n /**\r\n * Resize the single coordinate system.\r\n */\r\n resize(axisModel: SingleAxisModel, api: ExtensionAPI) {\r\n this._rect = getLayoutRect(\r\n {\r\n left: axisModel.get('left'),\r\n top: axisModel.get('top'),\r\n right: axisModel.get('right'),\r\n bottom: axisModel.get('bottom'),\r\n width: axisModel.get('width'),\r\n height: axisModel.get('height')\r\n },\r\n {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }\r\n );\r\n\r\n this._adjustAxis();\r\n }\r\n\r\n getRect() {\r\n return this._rect;\r\n }\r\n\r\n private _adjustAxis() {\r\n\r\n const rect = this._rect;\r\n const axis = this._axis;\r\n\r\n const isHorizontal = axis.isHorizontal();\r\n const extent = isHorizontal ? [0, rect.width] : [0, rect.height];\r\n const idx = axis.inverse ? 1 : 0;\r\n\r\n axis.setExtent(extent[idx], extent[1 - idx]);\r\n\r\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\r\n\r\n }\r\n\r\n\r\n private _updateAxisTransform(axis: SingleAxis, coordBase: number) {\r\n\r\n const axisExtent = axis.getExtent();\r\n const extentSum = axisExtent[0] + axisExtent[1];\r\n const isHorizontal = axis.isHorizontal();\r\n\r\n axis.toGlobalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord + coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n\r\n axis.toLocalCoord = isHorizontal\r\n ? function (coord) {\r\n return coord - coordBase;\r\n }\r\n : function (coord) {\r\n return extentSum - coord + coordBase;\r\n };\r\n }\r\n\r\n /**\r\n * Get axis.\r\n */\r\n getAxis() {\r\n return this._axis;\r\n }\r\n\r\n /**\r\n * Get axis, add it just for draw tooltip.\r\n */\r\n getBaseAxis() {\r\n return this._axis;\r\n }\r\n\r\n getAxes() {\r\n return [this._axis];\r\n }\r\n\r\n getTooltipAxes() {\r\n return {\r\n baseAxes: [this.getAxis()],\r\n // Empty otherAxes\r\n otherAxes: [] as SingleAxis[]\r\n };\r\n }\r\n\r\n /**\r\n * If contain point.\r\n */\r\n containPoint(point: number[]) {\r\n const rect = this.getRect();\r\n const axis = this.getAxis();\r\n const orient = axis.orient;\r\n if (orient === 'horizontal') {\r\n return axis.contain(axis.toLocalCoord(point[0]))\r\n && (point[1] >= rect.y && point[1] <= (rect.y + rect.height));\r\n }\r\n else {\r\n return axis.contain(axis.toLocalCoord(point[1]))\r\n && (point[0] >= rect.y && point[0] <= (rect.y + rect.height));\r\n }\r\n }\r\n\r\n pointToData(point: number[]) {\r\n const axis = this.getAxis();\r\n return [axis.coordToData(axis.toLocalCoord(\r\n point[axis.orient === 'horizontal' ? 0 : 1]\r\n ))];\r\n }\r\n\r\n /**\r\n * Convert the series data to concrete point.\r\n * Can be [val] | val\r\n */\r\n dataToPoint(val: ScaleDataValue | ScaleDataValue[]) {\r\n const axis = this.getAxis();\r\n const rect = this.getRect();\r\n const pt = [];\r\n const idx = axis.orient === 'horizontal' ? 0 : 1;\r\n\r\n if (val instanceof Array) {\r\n val = val[0];\r\n }\r\n\r\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\r\n pt[1 - idx] = idx === 0 ? (rect.y + rect.height / 2) : (rect.x + rect.width / 2);\r\n return pt;\r\n }\r\n\r\n convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue[]) {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? this.dataToPoint(value) : null;\r\n }\r\n\r\n convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, pixel: number[]) {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? this.pointToData(pixel) : null;\r\n }\r\n}\r\n\r\nfunction getCoordSys(finder: ParsedModelFinderKnown): Single {\r\n const seriesModel = finder.seriesModel;\r\n const singleModel = finder.singleAxisModel as SingleAxisModel;\r\n return singleModel && singleModel.coordinateSystem\r\n || seriesModel && seriesModel.coordinateSystem as Single;\r\n}\r\n\r\nexport default Single;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Single coordinate system creator.\r\n */\r\n\r\nimport Single, { singleDimensions } from './Single';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SingleAxisModel from './AxisModel';\r\nimport SeriesModel from '../../model/Series';\r\nimport { SeriesOption } from '../../util/types';\r\nimport { SINGLE_REFERRING } from '../../util/model';\r\n\r\n/**\r\n * Create single coordinate system and inject it into seriesModel.\r\n */\r\nfunction create(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const singles: Single[] = [];\r\n\r\n ecModel.eachComponent('singleAxis', function (axisModel: SingleAxisModel, idx: number) {\r\n\r\n const single = new Single(axisModel, ecModel, api);\r\n single.name = 'single_' + idx;\r\n single.resize(axisModel, api);\r\n axisModel.coordinateSystem = single;\r\n singles.push(single);\r\n\r\n });\r\n\r\n ecModel.eachSeries(function (seriesModel: SeriesModel) {\r\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\r\n const singleAxisModel = seriesModel.getReferringComponents(\r\n 'singleAxis', SINGLE_REFERRING\r\n ).models[0] as SingleAxisModel;\r\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\r\n }\r\n });\r\n\r\n return singles;\r\n}\r\n\r\nconst singleCreator = {\r\n create: create,\r\n dimensions: singleDimensions\r\n};\r\n\r\nexport default singleCreator;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport BaseAxisPointer, { AxisPointerElementOptions } from './BaseAxisPointer';\r\nimport * as viewHelper from './viewHelper';\r\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper';\r\nimport SingleAxis from '../../coord/single/SingleAxis';\r\nimport Single from '../../coord/single/Single';\r\nimport { PathProps } from 'zrender/src/graphic/Path';\r\nimport { ScaleDataValue, VerticalAlign, CommonAxisPointerOption } from '../../util/types';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport SingleAxisModel from '../../coord/single/AxisModel';\r\nimport Model from '../../model/Model';\r\n\r\nconst XY = ['x', 'y'] as const;\r\nconst WH = ['width', 'height'] as const;\r\n\r\n// Not use top level axisPointer model\r\ntype AxisPointerModel = Model;\r\n\r\nclass SingleAxisPointer extends BaseAxisPointer {\r\n\r\n /**\r\n * @override\r\n */\r\n makeElOption(\r\n elOption: AxisPointerElementOptions,\r\n value: ScaleDataValue,\r\n axisModel: SingleAxisModel,\r\n axisPointerModel: AxisPointerModel,\r\n api: ExtensionAPI\r\n ) {\r\n const axis = axisModel.axis;\r\n const coordSys = axis.coordinateSystem;\r\n const otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\r\n const pixelValue = coordSys.dataToPoint(value)[0];\r\n\r\n const axisPointerType = axisPointerModel.get('type');\r\n if (axisPointerType && axisPointerType !== 'none') {\r\n const elStyle = viewHelper.buildElStyle(axisPointerModel);\r\n const pointerOption = pointerShapeBuilder[axisPointerType](\r\n axis, pixelValue, otherExtent\r\n );\r\n pointerOption.style = elStyle;\r\n\r\n elOption.graphicKey = pointerOption.type;\r\n elOption.pointer = pointerOption;\r\n }\r\n\r\n const layoutInfo = singleAxisHelper.layout(axisModel);\r\n viewHelper.buildCartesianSingleLabelElOption(\r\n // @ts-ignore\r\n value, elOption, layoutInfo, axisModel, axisPointerModel, api\r\n );\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getHandleTransform(\r\n value: ScaleDataValue,\r\n axisModel: SingleAxisModel,\r\n axisPointerModel: AxisPointerModel\r\n ) {\r\n const layoutInfo = singleAxisHelper.layout(axisModel, {labelInside: false});\r\n // @ts-ignore\r\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\r\n const position = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\r\n return {\r\n x: position[0],\r\n y: position[1],\r\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\r\n };\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n updateHandleTransform(\r\n transform: {\r\n x: number,\r\n y: number,\r\n rotation: number\r\n },\r\n delta: number[],\r\n axisModel: SingleAxisModel,\r\n axisPointerModel: AxisPointerModel\r\n ) {\r\n const axis = axisModel.axis;\r\n const coordSys = axis.coordinateSystem;\r\n const dimIndex = getPointDimIndex(axis);\r\n const axisExtent = getGlobalExtent(coordSys, dimIndex);\r\n const currPosition = [transform.x, transform.y];\r\n currPosition[dimIndex] += delta[dimIndex];\r\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\r\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\r\n const otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\r\n const cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\r\n const cursorPoint = [cursorOtherValue, cursorOtherValue];\r\n cursorPoint[dimIndex] = currPosition[dimIndex];\r\n\r\n return {\r\n x: currPosition[0],\r\n y: currPosition[1],\r\n rotation: transform.rotation,\r\n cursorPoint: cursorPoint,\r\n tooltipOption: {\r\n verticalAlign: 'middle' as VerticalAlign\r\n }\r\n };\r\n }\r\n}\r\n\r\nconst pointerShapeBuilder = {\r\n\r\n line: function (axis: SingleAxis, pixelValue: number, otherExtent: number[]): PathProps & {\r\n type: 'Line'\r\n } {\r\n const targetShape = viewHelper.makeLineShape(\r\n [pixelValue, otherExtent[0]],\r\n [pixelValue, otherExtent[1]],\r\n getPointDimIndex(axis)\r\n );\r\n return {\r\n type: 'Line',\r\n subPixelOptimize: true,\r\n shape: targetShape\r\n };\r\n },\r\n\r\n shadow: function (axis: SingleAxis, pixelValue: number, otherExtent: number[]): PathProps & {\r\n type: 'Rect'\r\n } {\r\n const bandWidth = axis.getBandWidth();\r\n const span = otherExtent[1] - otherExtent[0];\r\n return {\r\n type: 'Rect',\r\n shape: viewHelper.makeRectShape(\r\n [pixelValue - bandWidth / 2, otherExtent[0]],\r\n [bandWidth, span],\r\n getPointDimIndex(axis)\r\n )\r\n };\r\n }\r\n};\r\n\r\nfunction getPointDimIndex(axis: SingleAxis): number {\r\n return axis.isHorizontal() ? 0 : 1;\r\n}\r\n\r\nfunction getGlobalExtent(coordSys: Single, dimIndex: number) {\r\n const rect = coordSys.getRect();\r\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\r\n}\r\n\r\nexport default SingleAxisPointer;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport ComponentView from '../../view/Component';\r\nimport SingleAxisView from '../axis/SingleAxisView';\r\nimport axisModelCreator from '../../coord/axisModelCreator';\r\nimport SingleAxisModel from '../../coord/single/AxisModel';\r\nimport singleCreator from '../../coord/single/singleCreator';\r\nimport {install as installAxisPointer} from '../axisPointer/install';\r\nimport AxisView from '../axis/AxisView';\r\nimport SingleAxisPointer from '../axisPointer/SingleAxisPointer';\r\n\r\nclass SingleView extends ComponentView {\r\n static type = 'single';\r\n type = SingleView.type;\r\n}\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installAxisPointer);\r\n\r\n AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\r\n\r\n registers.registerComponentView(SingleView);\r\n\r\n // Axis\r\n registers.registerComponentView(SingleAxisView);\r\n registers.registerComponentModel(SingleAxisModel);\r\n\r\n axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption);\r\n\r\n registers.registerCoordinateSystem('single', singleCreator);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n getLayoutParams,\r\n sizeCalculable,\r\n mergeLayoutParam\r\n} from '../../util/layout';\r\nimport Calendar from './Calendar';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n LayoutOrient,\r\n LineStyleOption,\r\n ItemStyleOption,\r\n LabelOption,\r\n OptionDataValueDate\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport Model from '../../model/Model';\r\n\r\nexport interface CalendarMonthLabelFormatterCallbackParams {\r\n nameMap: string\r\n yyyy: string\r\n yy: string\r\n /**\r\n * Month string. With 0 prefix.\r\n */\r\n MM: string\r\n /**\r\n * Month number\r\n */\r\n M: number\r\n}\r\n\r\nexport interface CalendarYearLabelFormatterCallbackParams {\r\n nameMap: string\r\n /**\r\n * Start year\r\n */\r\n start: string\r\n /**\r\n * End year\r\n */\r\n end: string\r\n}\r\n\r\nexport interface CalendarOption extends ComponentOption, BoxLayoutOptionMixin {\r\n mainType?: 'calendar'\r\n\r\n cellSize?: number | 'auto' | (number | 'auto')[]\r\n orient?: LayoutOrient\r\n\r\n splitLine?: {\r\n show?: boolean\r\n lineStyle?: LineStyleOption\r\n }\r\n\r\n itemStyle?: ItemStyleOption\r\n /**\r\n * // one year\r\n * range: 2017\r\n * // one month\r\n * range: '2017-02'\r\n * // a range\r\n * range: ['2017-01-02', '2017-02-23']\r\n * // note: they will be identified as ['2017-01-01', '2017-02-01']\r\n * range: ['2017-01', '2017-02']\r\n */\r\n range?: OptionDataValueDate | (OptionDataValueDate)[]\r\n\r\n dayLabel?: Omit & {\r\n /**\r\n * First day of week.\r\n */\r\n firstDay?: number\r\n\r\n /**\r\n * Margin between day label and axis line.\r\n * Can be percent string of cell size.\r\n */\r\n margin?: number | string\r\n\r\n /**\r\n * Position of week, at the beginning or end of the range.\r\n */\r\n position?: 'start' | 'end'\r\n\r\n /**\r\n * Week text content\r\n *\r\n * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.\r\n * It supports any registered locale name (case-sensitive) or customized array.\r\n * index 0 always means Sunday.\r\n */\r\n nameMap?: string | string[]\r\n }\r\n\r\n monthLabel?: Omit & {\r\n /**\r\n * Margin between month label and axis line.\r\n */\r\n margin?: number\r\n\r\n /**\r\n * Position of month label, at the beginning or end of the range.\r\n */\r\n position?: 'start' | 'end'\r\n\r\n /**\r\n * Month text content\r\n *\r\n * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.\r\n * It supports any registered locale name (case-sensitive) or customized array.\r\n * index 0 always means Jan.\r\n */\r\n nameMap?: string | string[]\r\n\r\n formatter?: string | ((params: CalendarMonthLabelFormatterCallbackParams) => string)\r\n }\r\n\r\n yearLabel?: Omit & {\r\n /**\r\n * Margin between year label and axis line.\r\n */\r\n margin?: number\r\n\r\n /**\r\n * Position of year label, at the beginning or end of the range.\r\n */\r\n position?: 'top' | 'bottom' | 'left' | 'right'\r\n\r\n formatter?: string | ((params: CalendarYearLabelFormatterCallbackParams) => string)\r\n }\r\n}\r\n\r\nclass CalendarModel extends ComponentModel {\r\n static type = 'calendar';\r\n type = CalendarModel.type;\r\n\r\n coordinateSystem: Calendar;\r\n\r\n /**\r\n * @override\r\n */\r\n init(option: CalendarOption, parentModel: Model, ecModel: GlobalModel) {\r\n const inputPositionParams = getLayoutParams(option);\r\n\r\n super.init.apply(this, arguments as any);\r\n\r\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n mergeOption(option: CalendarOption) {\r\n super.mergeOption.apply(this, arguments as any);\r\n\r\n mergeAndNormalizeLayoutParams(this.option, option);\r\n }\r\n\r\n getCellSize() {\r\n // Has been normalized\r\n return this.option.cellSize as (number | 'auto')[];\r\n }\r\n\r\n static defaultOption: CalendarOption = {\r\n // zlevel: 0,\r\n z: 2,\r\n left: 80,\r\n top: 60,\r\n\r\n cellSize: 20,\r\n\r\n // horizontal vertical\r\n orient: 'horizontal',\r\n\r\n // month separate line style\r\n splitLine: {\r\n show: true,\r\n lineStyle: {\r\n color: '#000',\r\n width: 1,\r\n type: 'solid'\r\n }\r\n },\r\n\r\n // rect style temporarily unused emphasis\r\n itemStyle: {\r\n color: '#fff',\r\n borderWidth: 1,\r\n borderColor: '#ccc'\r\n },\r\n\r\n // week text style\r\n dayLabel: {\r\n show: true,\r\n\r\n firstDay: 0,\r\n\r\n // start end\r\n position: 'start',\r\n margin: '50%', // 50% of cellSize\r\n color: '#000'\r\n },\r\n\r\n // month text style\r\n monthLabel: {\r\n show: true,\r\n\r\n // start end\r\n position: 'start',\r\n margin: 5,\r\n\r\n // center or left\r\n align: 'center',\r\n\r\n formatter: null,\r\n color: '#000'\r\n },\r\n\r\n // year text style\r\n yearLabel: {\r\n show: true,\r\n\r\n // top bottom left right\r\n position: null,\r\n margin: 30,\r\n formatter: null,\r\n color: '#ccc',\r\n fontFamily: 'sans-serif',\r\n fontWeight: 'bolder',\r\n fontSize: 20\r\n }\r\n };\r\n}\r\n\r\n\r\nfunction mergeAndNormalizeLayoutParams(target: CalendarOption, raw: BoxLayoutOptionMixin) {\r\n // Normalize cellSize\r\n const cellSize = target.cellSize;\r\n let cellSizeArr: (number | 'auto')[];\r\n\r\n if (!zrUtil.isArray(cellSize)) {\r\n cellSizeArr = target.cellSize = [cellSize, cellSize];\r\n }\r\n else {\r\n cellSizeArr = cellSize;\r\n }\r\n\r\n if (cellSizeArr.length === 1) {\r\n cellSizeArr[1] = cellSizeArr[0];\r\n }\r\n\r\n const ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\r\n // If user have set `width` or both `left` and `right`, cellSizeArr\r\n // will be automatically set to 'auto', otherwise the default\r\n // setting of cellSizeArr will make `width` setting not work.\r\n if (sizeCalculable(raw, hvIdx)) {\r\n cellSizeArr[hvIdx] = 'auto';\r\n }\r\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\r\n });\r\n\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: ignoreSize\r\n });\r\n}\r\n\r\nexport default CalendarModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { isString, extend, map, isFunction } from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport {createTextStyle} from '../../label/labelStyle';\r\nimport { formatTplSimple } from '../../util/format';\r\nimport { parsePercent } from '../../util/number';\r\nimport type CalendarModel from '../../coord/calendar/CalendarModel';\r\nimport {CalendarParsedDateRangeInfo, CalendarParsedDateInfo} from '../../coord/calendar/Calendar';\r\nimport type GlobalModel from '../../model/Global';\r\nimport type ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { LayoutOrient, OptionDataValueDate, ZRTextAlign, ZRTextVerticalAlign } from '../../util/types';\r\nimport ComponentView from '../../view/Component';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { TextStyleProps, TextProps } from 'zrender/src/graphic/Text';\r\nimport { LocaleOption, getLocaleModel } from '../../core/locale';\r\nimport type Model from '../../model/Model';\r\n\r\nclass CalendarView extends ComponentView {\r\n\r\n static type = 'calendar';\r\n type = CalendarView.type;\r\n\r\n /**\r\n * top/left line points\r\n */\r\n private _tlpoints: number[][];\r\n\r\n /**\r\n * bottom/right line points\r\n */\r\n private _blpoints: number[][];\r\n\r\n /**\r\n * first day of month\r\n */\r\n private _firstDayOfMonth: CalendarParsedDateInfo[];\r\n\r\n /**\r\n * first day point of month\r\n */\r\n private _firstDayPoints: number[][];\r\n\r\n render(calendarModel: CalendarModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n const group = this.group;\r\n\r\n group.removeAll();\r\n\r\n const coordSys = calendarModel.coordinateSystem;\r\n\r\n // range info\r\n const rangeData = coordSys.getRangeInfo();\r\n const orient = coordSys.getOrient();\r\n\r\n // locale\r\n const localeModel = ecModel.getLocaleModel();\r\n\r\n this._renderDayRect(calendarModel, rangeData, group);\r\n\r\n // _renderLines must be called prior to following function\r\n this._renderLines(calendarModel, rangeData, orient, group);\r\n\r\n this._renderYearText(calendarModel, rangeData, orient, group);\r\n\r\n this._renderMonthText(calendarModel, localeModel, orient, group);\r\n\r\n this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);\r\n }\r\n\r\n // render day rect\r\n _renderDayRect(calendarModel: CalendarModel, rangeData: CalendarParsedDateRangeInfo, group: graphic.Group) {\r\n const coordSys = calendarModel.coordinateSystem;\r\n const itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\r\n const sw = coordSys.getCellWidth();\r\n const sh = coordSys.getCellHeight();\r\n\r\n for (let i = rangeData.start.time;\r\n i <= rangeData.end.time;\r\n i = coordSys.getNextNDay(i, 1).time\r\n ) {\r\n\r\n const point = coordSys.dataToRect([i], false).tl;\r\n\r\n // every rect\r\n const rect = new graphic.Rect({\r\n shape: {\r\n x: point[0],\r\n y: point[1],\r\n width: sw,\r\n height: sh\r\n },\r\n cursor: 'default',\r\n style: itemRectStyleModel\r\n });\r\n\r\n group.add(rect);\r\n }\r\n\r\n }\r\n\r\n // render separate line\r\n _renderLines(\r\n calendarModel: CalendarModel,\r\n rangeData: CalendarParsedDateRangeInfo,\r\n orient: LayoutOrient,\r\n group: graphic.Group\r\n ) {\r\n\r\n const self = this;\r\n\r\n const coordSys = calendarModel.coordinateSystem;\r\n\r\n const lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\r\n const show = calendarModel.get(['splitLine', 'show']);\r\n\r\n const lineWidth = lineStyleModel.lineWidth;\r\n\r\n this._tlpoints = [];\r\n this._blpoints = [];\r\n this._firstDayOfMonth = [];\r\n this._firstDayPoints = [];\r\n\r\n\r\n let firstDay = rangeData.start;\r\n\r\n for (let i = 0; firstDay.time <= rangeData.end.time; i++) {\r\n addPoints(firstDay.formatedDate);\r\n\r\n if (i === 0) {\r\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\r\n }\r\n\r\n const date = firstDay.date;\r\n date.setMonth(date.getMonth() + 1);\r\n firstDay = coordSys.getDateInfo(date);\r\n }\r\n\r\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\r\n\r\n function addPoints(date: OptionDataValueDate) {\r\n\r\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\r\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\r\n\r\n const points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\r\n\r\n self._tlpoints.push(points[0]);\r\n self._blpoints.push(points[points.length - 1]);\r\n\r\n show && self._drawSplitline(points, lineStyleModel, group);\r\n }\r\n\r\n\r\n // render top/left line\r\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);\r\n\r\n // render bottom/right line\r\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\r\n\r\n }\r\n\r\n // get points at both ends\r\n _getEdgesPoints(points: number[][], lineWidth: number, orient: LayoutOrient) {\r\n const rs = [points[0].slice(), points[points.length - 1].slice()];\r\n const idx = orient === 'horizontal' ? 0 : 1;\r\n\r\n // both ends of the line are extend half lineWidth\r\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\r\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\r\n\r\n return rs;\r\n }\r\n\r\n // render split line\r\n _drawSplitline(points: number[][], lineStyle: PathStyleProps, group: graphic.Group) {\r\n\r\n const poyline = new graphic.Polyline({\r\n z2: 20,\r\n shape: {\r\n points: points\r\n },\r\n style: lineStyle\r\n });\r\n\r\n group.add(poyline);\r\n }\r\n\r\n // render month line of one week points\r\n _getLinePointsOfOneWeek(calendarModel: CalendarModel, date: OptionDataValueDate, orient: LayoutOrient) {\r\n\r\n const coordSys = calendarModel.coordinateSystem;\r\n const parsedDate = coordSys.getDateInfo(date);\r\n\r\n const points = [];\r\n\r\n for (let i = 0; i < 7; i++) {\r\n\r\n const tmpD = coordSys.getNextNDay(parsedDate.time, i);\r\n const point = coordSys.dataToRect([tmpD.time], false);\r\n\r\n points[2 * tmpD.day] = point.tl;\r\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\r\n }\r\n\r\n return points;\r\n\r\n }\r\n\r\n _formatterLabel(\r\n formatter: string | ((params: T) => string),\r\n params: T\r\n ) {\r\n\r\n if (isString(formatter) && formatter) {\r\n return formatTplSimple(formatter, params);\r\n }\r\n\r\n if (isFunction(formatter)) {\r\n return formatter(params);\r\n }\r\n\r\n return params.nameMap;\r\n\r\n }\r\n\r\n _yearTextPositionControl(\r\n textEl: graphic.Text,\r\n point: number[],\r\n orient: LayoutOrient,\r\n position: 'left' | 'right' | 'top' | 'bottom',\r\n margin: number\r\n ): TextProps {\r\n\r\n let x = point[0];\r\n let y = point[1];\r\n let aligns: [ZRTextAlign, ZRTextVerticalAlign] = ['center', 'bottom'];\r\n\r\n if (position === 'bottom') {\r\n y += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else if (position === 'left') {\r\n x -= margin;\r\n }\r\n else if (position === 'right') {\r\n x += margin;\r\n aligns = ['center', 'top'];\r\n }\r\n else { // top\r\n y -= margin;\r\n }\r\n\r\n let rotate = 0;\r\n if (position === 'left' || position === 'right') {\r\n rotate = Math.PI / 2;\r\n }\r\n\r\n return {\r\n rotation: rotate,\r\n x,\r\n y,\r\n style: {\r\n align: aligns[0],\r\n verticalAlign: aligns[1]\r\n }\r\n };\r\n }\r\n\r\n // render year\r\n _renderYearText(\r\n calendarModel: CalendarModel,\r\n rangeData: CalendarParsedDateRangeInfo,\r\n orient: LayoutOrient,\r\n group: graphic.Group\r\n ) {\r\n const yearLabel = calendarModel.getModel('yearLabel');\r\n\r\n if (!yearLabel.get('show')) {\r\n return;\r\n }\r\n\r\n const margin = yearLabel.get('margin');\r\n let pos = yearLabel.get('position');\r\n\r\n if (!pos) {\r\n pos = orient !== 'horizontal' ? 'top' : 'left';\r\n }\r\n\r\n const points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\r\n const xc = (points[0][0] + points[1][0]) / 2;\r\n const yc = (points[0][1] + points[1][1]) / 2;\r\n\r\n const idx = orient === 'horizontal' ? 0 : 1;\r\n\r\n const posPoints = {\r\n top: [xc, points[idx][1]],\r\n bottom: [xc, points[1 - idx][1]],\r\n left: [points[1 - idx][0], yc],\r\n right: [points[idx][0], yc]\r\n };\r\n\r\n let name = rangeData.start.y;\r\n\r\n if (+rangeData.end.y > +rangeData.start.y) {\r\n name = name + '-' + rangeData.end.y;\r\n }\r\n\r\n const formatter = yearLabel.get('formatter');\r\n\r\n const params = {\r\n start: rangeData.start.y,\r\n end: rangeData.end.y,\r\n nameMap: name\r\n };\r\n\r\n const content = this._formatterLabel(formatter, params);\r\n\r\n const yearText = new graphic.Text({\r\n z2: 30,\r\n style: createTextStyle(yearLabel, {\r\n text: content\r\n })\r\n });\r\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\r\n\r\n group.add(yearText);\r\n }\r\n\r\n _monthTextPositionControl(\r\n point: number[],\r\n isCenter: boolean,\r\n orient: LayoutOrient,\r\n position: 'start' | 'end',\r\n margin: number\r\n ): TextStyleProps {\r\n let align: ZRTextAlign = 'left';\r\n let vAlign: ZRTextVerticalAlign = 'top';\r\n let x = point[0];\r\n let y = point[1];\r\n\r\n if (orient === 'horizontal') {\r\n y = y + margin;\r\n\r\n if (isCenter) {\r\n align = 'center';\r\n }\r\n\r\n if (position === 'start') {\r\n vAlign = 'bottom';\r\n }\r\n }\r\n else {\r\n x = x + margin;\r\n\r\n if (isCenter) {\r\n vAlign = 'middle';\r\n }\r\n\r\n if (position === 'start') {\r\n align = 'right';\r\n }\r\n }\r\n\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n }\r\n\r\n // render month and year text\r\n _renderMonthText(\r\n calendarModel: CalendarModel,\r\n localeModel: Model,\r\n orient: LayoutOrient,\r\n group: graphic.Group\r\n ) {\r\n const monthLabel = calendarModel.getModel('monthLabel');\r\n\r\n if (!monthLabel.get('show')) {\r\n return;\r\n }\r\n\r\n let nameMap = monthLabel.get('nameMap');\r\n let margin = monthLabel.get('margin');\r\n const pos = monthLabel.get('position');\r\n const align = monthLabel.get('align');\r\n\r\n const termPoints = [this._tlpoints, this._blpoints];\r\n\r\n if (!nameMap || isString(nameMap)) {\r\n if (nameMap) {\r\n // case-sensitive\r\n localeModel = getLocaleModel(nameMap as string) || localeModel;\r\n }\r\n // PENDING\r\n // for ZH locale, original form is `\u4E00\u6708` but current form is `1\u6708`\r\n nameMap = localeModel.get(['time', 'monthAbbr']) || [];\r\n }\r\n\r\n const idx = pos === 'start' ? 0 : 1;\r\n const axis = orient === 'horizontal' ? 0 : 1;\r\n margin = pos === 'start' ? -margin : margin;\r\n const isCenter = (align === 'center');\r\n\r\n for (let i = 0; i < termPoints[idx].length - 1; i++) {\r\n\r\n const tmp = termPoints[idx][i].slice();\r\n const firstDay = this._firstDayOfMonth[i];\r\n\r\n if (isCenter) {\r\n const firstDayPoints = this._firstDayPoints[i];\r\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\r\n }\r\n\r\n const formatter = monthLabel.get('formatter');\r\n const name = nameMap[+firstDay.m - 1];\r\n const params = {\r\n yyyy: firstDay.y,\r\n yy: (firstDay.y + '').slice(2),\r\n MM: firstDay.m,\r\n M: +firstDay.m,\r\n nameMap: name\r\n };\r\n\r\n const content = this._formatterLabel(formatter, params);\r\n\r\n const monthText = new graphic.Text({\r\n z2: 30,\r\n style: extend(\r\n createTextStyle(monthLabel, {text: content}),\r\n this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)\r\n )\r\n });\r\n\r\n group.add(monthText);\r\n }\r\n }\r\n\r\n _weekTextPositionControl(\r\n point: number[],\r\n orient: LayoutOrient,\r\n position: 'start' | 'end',\r\n margin: number,\r\n cellSize: number[]\r\n ): TextStyleProps {\r\n let align: ZRTextAlign = 'center';\r\n let vAlign: ZRTextVerticalAlign = 'middle';\r\n let x = point[0];\r\n let y = point[1];\r\n const isStart = position === 'start';\r\n\r\n if (orient === 'horizontal') {\r\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\r\n align = isStart ? 'right' : 'left';\r\n }\r\n else {\r\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\r\n vAlign = isStart ? 'bottom' : 'top';\r\n }\r\n\r\n return {\r\n x: x,\r\n y: y,\r\n align: align,\r\n verticalAlign: vAlign\r\n };\r\n }\r\n\r\n // render weeks\r\n _renderWeekText(\r\n calendarModel: CalendarModel,\r\n localeModel: Model,\r\n rangeData: CalendarParsedDateRangeInfo,\r\n orient: LayoutOrient,\r\n group: graphic.Group\r\n ) {\r\n const dayLabel = calendarModel.getModel('dayLabel');\r\n\r\n if (!dayLabel.get('show')) {\r\n return;\r\n }\r\n\r\n const coordSys = calendarModel.coordinateSystem;\r\n const pos = dayLabel.get('position');\r\n let nameMap = dayLabel.get('nameMap');\r\n let margin = dayLabel.get('margin');\r\n const firstDayOfWeek = coordSys.getFirstDayOfWeek();\r\n\r\n if (!nameMap || isString(nameMap)) {\r\n if (nameMap) {\r\n // case-sensitive\r\n localeModel = getLocaleModel(nameMap as string) || localeModel;\r\n }\r\n // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file\r\n const dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort' as any]);\r\n nameMap = dayOfWeekShort || map(\r\n localeModel.get(['time', 'dayOfWeekAbbr']),\r\n val => val[0]\r\n );\r\n }\r\n\r\n let start = coordSys.getNextNDay(\r\n rangeData.end.time, (7 - rangeData.lweek)\r\n ).time;\r\n\r\n const cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\r\n margin = parsePercent(margin, Math.min(cellSize[1], cellSize[0]));\r\n\r\n if (pos === 'start') {\r\n start = coordSys.getNextNDay(\r\n rangeData.start.time, -(7 + rangeData.fweek)\r\n ).time;\r\n margin = -margin;\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n\r\n const tmpD = coordSys.getNextNDay(start, i);\r\n const point = coordSys.dataToRect([tmpD.time], false).center;\r\n let day = i;\r\n day = Math.abs((i + firstDayOfWeek) % 7);\r\n const weekText = new graphic.Text({\r\n z2: 30,\r\n style: extend(\r\n createTextStyle(dayLabel, {text: nameMap[day]}),\r\n this._weekTextPositionControl(point, orient, pos, margin, cellSize)\r\n )\r\n });\r\n\r\n group.add(weekText);\r\n }\r\n }\r\n}\r\n\r\nexport default CalendarView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as layout from '../../util/layout';\r\nimport * as numberUtil from '../../util/number';\r\nimport BoundingRect, {RectLike} from 'zrender/src/core/BoundingRect';\r\nimport CalendarModel from './CalendarModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport {\r\n LayoutOrient,\r\n ScaleDataValue,\r\n OptionDataValueDate,\r\n SeriesOption,\r\n SeriesOnCalendarOptionMixin\r\n} from '../../util/types';\r\nimport { ParsedModelFinder, ParsedModelFinderKnown } from '../../util/model';\r\nimport { CoordinateSystem, CoordinateSystemMaster } from '../CoordinateSystem';\r\nimport SeriesModel from '../../model/Series';\r\n\r\n// (24*60*60*1000)\r\nconst PROXIMATE_ONE_DAY = 86400000;\r\n\r\n\r\nexport interface CalendarParsedDateRangeInfo {\r\n range: [string, string],\r\n start: CalendarParsedDateInfo\r\n end: CalendarParsedDateInfo\r\n allDay: number\r\n weeks: number\r\n nthWeek: number\r\n fweek: number\r\n lweek: number\r\n}\r\n\r\nexport interface CalendarParsedDateInfo {\r\n /**\r\n * local full year, eg., '1940'\r\n */\r\n y: string\r\n /**\r\n * local month, from '01' ot '12',\r\n */\r\n m: string\r\n /**\r\n * local date, from '01' to '31' (if exists),\r\n */\r\n d: string\r\n /**\r\n * It is not date.getDay(). It is the location of the cell in a week, from 0 to 6,\r\n */\r\n day: number\r\n /**\r\n * Timestamp\r\n */\r\n time: number\r\n /**\r\n * yyyy-MM-dd\r\n */\r\n formatedDate: string\r\n /**\r\n * The original date object\r\n */\r\n date: Date\r\n}\r\n\r\nexport interface CalendarCellRect {\r\n contentShape: RectLike\r\n center: number[]\r\n tl: number[]\r\n tr: number[]\r\n br: number[]\r\n bl: number[]\r\n}\r\n\r\nclass Calendar implements CoordinateSystem, CoordinateSystemMaster {\r\n\r\n static readonly dimensions = ['time', 'value'];\r\n static getDimensionsInfo() {\r\n return [{\r\n name: 'time', type: 'time' as const\r\n }, 'value'];\r\n }\r\n\r\n readonly type = 'calendar';\r\n\r\n readonly dimensions = Calendar.dimensions;\r\n\r\n private _model: CalendarModel;\r\n\r\n private _rect: BoundingRect;\r\n\r\n private _sw: number;\r\n private _sh: number;\r\n private _orient: LayoutOrient;\r\n\r\n private _firstDayOfWeek: number;\r\n\r\n private _rangeInfo: CalendarParsedDateRangeInfo;\r\n\r\n private _lineWidth: number;\r\n\r\n constructor(calendarModel: CalendarModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._model = calendarModel;\r\n }\r\n // Required in createListFromData\r\n getDimensionsInfo = Calendar.getDimensionsInfo;\r\n\r\n getRangeInfo() {\r\n return this._rangeInfo;\r\n }\r\n\r\n getModel() {\r\n return this._model;\r\n }\r\n\r\n getRect() {\r\n return this._rect;\r\n }\r\n\r\n getCellWidth() {\r\n return this._sw;\r\n }\r\n\r\n getCellHeight() {\r\n return this._sh;\r\n }\r\n\r\n getOrient() {\r\n return this._orient;\r\n }\r\n\r\n /**\r\n * getFirstDayOfWeek\r\n *\r\n * @example\r\n * 0 : start at Sunday\r\n * 1 : start at Monday\r\n *\r\n * @return {number}\r\n */\r\n getFirstDayOfWeek() {\r\n return this._firstDayOfWeek;\r\n }\r\n\r\n /**\r\n * get date info\r\n * }\r\n */\r\n getDateInfo(date: OptionDataValueDate): CalendarParsedDateInfo {\r\n\r\n date = numberUtil.parseDate(date);\r\n\r\n const y = date.getFullYear();\r\n\r\n const m = date.getMonth() + 1;\r\n const mStr = m < 10 ? '0' + m : '' + m;\r\n\r\n const d = date.getDate();\r\n const dStr = d < 10 ? '0' + d : '' + d;\r\n\r\n let day = date.getDay();\r\n\r\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\r\n\r\n return {\r\n y: y + '',\r\n m: mStr,\r\n d: dStr,\r\n day: day,\r\n time: date.getTime(),\r\n formatedDate: y + '-' + mStr + '-' + dStr,\r\n date: date\r\n };\r\n }\r\n\r\n getNextNDay(date: OptionDataValueDate, n: number) {\r\n n = n || 0;\r\n if (n === 0) {\r\n return this.getDateInfo(date);\r\n }\r\n\r\n date = new Date(this.getDateInfo(date).time);\r\n date.setDate(date.getDate() + n);\r\n\r\n return this.getDateInfo(date);\r\n }\r\n\r\n update(ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\r\n this._orient = this._model.get('orient');\r\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\r\n\r\n\r\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\r\n const weeks = this._rangeInfo.weeks || 1;\r\n const whNames = ['width', 'height'] as const;\r\n const cellSize = this._model.getCellSize().slice();\r\n const layoutParams = this._model.getBoxLayoutParams();\r\n const cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\r\n\r\n zrUtil.each([0, 1] as const, function (idx) {\r\n if (cellSizeSpecified(cellSize, idx)) {\r\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\r\n }\r\n });\r\n\r\n const whGlobal = {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n };\r\n const calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal);\r\n\r\n zrUtil.each([0, 1], function (idx) {\r\n if (!cellSizeSpecified(cellSize, idx)) {\r\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\r\n }\r\n });\r\n\r\n function cellSizeSpecified(cellSize: (number | 'auto')[], idx: number): cellSize is number[] {\r\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\r\n }\r\n\r\n // Has been calculated out number.\r\n this._sw = cellSize[0] as number;\r\n this._sh = cellSize[1] as number;\r\n }\r\n\r\n\r\n /**\r\n * Convert a time data(time, value) item to (x, y) point.\r\n */\r\n // TODO Clamp of calendar is not same with cartesian coordinate systems.\r\n // It will return NaN if data exceeds.\r\n dataToPoint(data: OptionDataValueDate | OptionDataValueDate[], clamp?: boolean) {\r\n zrUtil.isArray(data) && (data = data[0]);\r\n clamp == null && (clamp = true);\r\n\r\n const dayInfo = this.getDateInfo(data);\r\n const range = this._rangeInfo;\r\n const date = dayInfo.formatedDate;\r\n\r\n // if not in range return [NaN, NaN]\r\n if (clamp && !(\r\n dayInfo.time >= range.start.time\r\n && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY\r\n )) {\r\n return [NaN, NaN];\r\n }\r\n\r\n const week = dayInfo.day;\r\n const nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\r\n\r\n if (this._orient === 'vertical') {\r\n return [\r\n this._rect.x + week * this._sw + this._sw / 2,\r\n this._rect.y + nthWeek * this._sh + this._sh / 2\r\n ];\r\n\r\n }\r\n\r\n return [\r\n this._rect.x + nthWeek * this._sw + this._sw / 2,\r\n this._rect.y + week * this._sh + this._sh / 2\r\n ];\r\n\r\n }\r\n\r\n /**\r\n * Convert a (x, y) point to time data\r\n */\r\n pointToData(point: number[]): number {\r\n\r\n const date = this.pointToDate(point);\r\n\r\n return date && date.time;\r\n }\r\n\r\n /**\r\n * Convert a time date item to (x, y) four point.\r\n */\r\n dataToRect(data: OptionDataValueDate | OptionDataValueDate[], clamp?: boolean): CalendarCellRect {\r\n const point = this.dataToPoint(data, clamp);\r\n\r\n return {\r\n contentShape: {\r\n x: point[0] - (this._sw - this._lineWidth) / 2,\r\n y: point[1] - (this._sh - this._lineWidth) / 2,\r\n width: this._sw - this._lineWidth,\r\n height: this._sh - this._lineWidth\r\n },\r\n\r\n center: point,\r\n\r\n tl: [\r\n point[0] - this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n\r\n tr: [\r\n point[0] + this._sw / 2,\r\n point[1] - this._sh / 2\r\n ],\r\n\r\n br: [\r\n point[0] + this._sw / 2,\r\n point[1] + this._sh / 2\r\n ],\r\n\r\n bl: [\r\n point[0] - this._sw / 2,\r\n point[1] + this._sh / 2\r\n ]\r\n\r\n };\r\n }\r\n\r\n /**\r\n * Convert a (x, y) point to time date\r\n *\r\n * @param {Array} point point\r\n * @return {Object} date\r\n */\r\n pointToDate(point: number[]): CalendarParsedDateInfo {\r\n const nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\r\n const nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\r\n const range = this._rangeInfo.range;\r\n\r\n if (this._orient === 'vertical') {\r\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\r\n }\r\n\r\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\r\n }\r\n\r\n convertToPixel(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]) {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n }\r\n\r\n convertFromPixel(ecModel: GlobalModel, finder: ParsedModelFinder, pixel: number[]) {\r\n const coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n }\r\n\r\n containPoint(point: number[]): boolean {\r\n console.warn('Not implemented.');\r\n return false;\r\n }\r\n\r\n /**\r\n * initRange\r\n * Normalize to an [start, end] array\r\n */\r\n private _initRangeOption(): OptionDataValueDate[] {\r\n let range = this._model.get('range');\r\n let normalizedRange: OptionDataValueDate[];\r\n\r\n // Convert [1990] to 1990\r\n if (zrUtil.isArray(range) && range.length === 1) {\r\n range = range[0];\r\n }\r\n\r\n if (!zrUtil.isArray(range)) {\r\n const rangeStr = range.toString();\r\n // One year.\r\n if (/^\\d{4}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\r\n }\r\n // One month\r\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n\r\n const start = this.getDateInfo(rangeStr);\r\n const firstDay = start.date;\r\n firstDay.setMonth(firstDay.getMonth() + 1);\r\n\r\n const end = this.getNextNDay(firstDay, -1);\r\n normalizedRange = [start.formatedDate, end.formatedDate];\r\n }\r\n // One day\r\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\r\n normalizedRange = [rangeStr, rangeStr];\r\n }\r\n }\r\n else {\r\n normalizedRange = range;\r\n }\r\n\r\n if (!normalizedRange) {\r\n if (__DEV__) {\r\n zrUtil.logError('Invalid date range.');\r\n }\r\n // Not handling it.\r\n return range as OptionDataValueDate[];\r\n }\r\n\r\n const tmp = this._getRangeInfo(normalizedRange);\r\n\r\n if (tmp.start.time > tmp.end.time) {\r\n normalizedRange.reverse();\r\n }\r\n\r\n return normalizedRange;\r\n }\r\n\r\n /**\r\n * range info\r\n *\r\n * @private\r\n * @param {Array} range range ['2017-01-01', '2017-07-08']\r\n * If range[0] > range[1], they will not be reversed.\r\n * @return {Object} obj\r\n */\r\n _getRangeInfo(range: OptionDataValueDate[]): CalendarParsedDateRangeInfo {\r\n const parsedRange = [\r\n this.getDateInfo(range[0]),\r\n this.getDateInfo(range[1])\r\n ];\r\n\r\n let reversed;\r\n if (parsedRange[0].time > parsedRange[1].time) {\r\n reversed = true;\r\n parsedRange.reverse();\r\n }\r\n\r\n let allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY)\r\n - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;\r\n\r\n // Consider case1 (#11677 #10430):\r\n // Set the system timezone as \"UK\", set the range to `['2016-07-01', '2016-12-31']`\r\n\r\n // Consider case2:\r\n // Firstly set system timezone as \"Time Zone: America/Toronto\",\r\n // ```\r\n // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);\r\n // let second = new Date(1478412000000);\r\n // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;\r\n // ```\r\n // will get wrong result because of DST. So we should fix it.\r\n const date = new Date(parsedRange[0].time);\r\n const startDateNum = date.getDate();\r\n const endDateNum = parsedRange[1].date.getDate();\r\n date.setDate(startDateNum + allDay - 1);\r\n // The bias can not over a month, so just compare date.\r\n let dateNum = date.getDate();\r\n if (dateNum !== endDateNum) {\r\n const sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\r\n while (\r\n (dateNum = date.getDate()) !== endDateNum\r\n && (date.getTime() - parsedRange[1].time) * sign > 0\r\n ) {\r\n allDay -= sign;\r\n date.setDate(dateNum - sign);\r\n }\r\n }\r\n\r\n const weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\r\n const nthWeek = reversed ? -weeks + 1 : weeks - 1;\r\n\r\n reversed && parsedRange.reverse();\r\n\r\n return {\r\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\r\n start: parsedRange[0],\r\n end: parsedRange[1],\r\n allDay: allDay,\r\n weeks: weeks,\r\n // From 0.\r\n nthWeek: nthWeek,\r\n fweek: parsedRange[0].day,\r\n lweek: parsedRange[1].day\r\n };\r\n }\r\n\r\n /**\r\n * get date by nthWeeks and week day in range\r\n *\r\n * @private\r\n * @param {number} nthWeek the week\r\n * @param {number} day the week day\r\n * @param {Array} range [d1, d2]\r\n * @return {Object}\r\n */\r\n private _getDateByWeeksAndDay(nthWeek: number, day: number, range: OptionDataValueDate[]): CalendarParsedDateInfo {\r\n const rangeInfo = this._getRangeInfo(range);\r\n\r\n if (nthWeek > rangeInfo.weeks\r\n || (nthWeek === 0 && day < rangeInfo.fweek)\r\n || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)\r\n ) {\r\n return null;\r\n }\r\n\r\n const nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\r\n const date = new Date(rangeInfo.start.time);\r\n date.setDate(+rangeInfo.start.d + nthDay);\r\n\r\n return this.getDateInfo(date);\r\n }\r\n\r\n static create(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const calendarList: Calendar[] = [];\r\n\r\n ecModel.eachComponent('calendar', function (calendarModel: CalendarModel) {\r\n const calendar = new Calendar(calendarModel, ecModel, api);\r\n calendarList.push(calendar);\r\n calendarModel.coordinateSystem = calendar;\r\n });\r\n\r\n ecModel.eachSeries(function (calendarSeries: SeriesModel) {\r\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\r\n // Inject coordinate system\r\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\r\n }\r\n });\r\n return calendarList;\r\n }\r\n}\r\n\r\nfunction getCoordSys(finder: ParsedModelFinderKnown): Calendar {\r\n const calendarModel = finder.calendarModel as CalendarModel;\r\n const seriesModel = finder.seriesModel;\r\n\r\n const coordSys = calendarModel\r\n ? calendarModel.coordinateSystem\r\n : seriesModel\r\n ? seriesModel.coordinateSystem\r\n : null;\r\n\r\n return coordSys as Calendar;\r\n}\r\n\r\nexport default Calendar;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport CalendarModel from '../../coord/calendar/CalendarModel';\r\nimport CalendarView from './CalendarView';\r\nimport Calendar from '../../coord/calendar/Calendar';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(CalendarModel);\r\n registers.registerComponentView(CalendarView);\r\n registers.registerCoordinateSystem('calendar', Calendar);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport Element from 'zrender/src/Element';\r\nimport * as modelUtil from '../../util/model';\r\nimport * as graphicUtil from '../../util/graphic';\r\nimport * as layoutUtil from '../../util/layout';\r\nimport { parsePercent } from '../../util/number';\r\nimport GlobalModel from '../../model/Global';\r\nimport ComponentView from '../../view/Component';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { isEC4CompatibleStyle, convertFromEC4CompatibleStyle } from '../../util/styleCompat';\r\nimport {\r\n ElementMap,\r\n GraphicComponentModel,\r\n GraphicComponentDisplayableOption,\r\n GraphicComponentZRPathOption,\r\n GraphicComponentGroupOption,\r\n GraphicComponentElementOption\r\n} from './GraphicModel';\r\nimport {\r\n applyLeaveTransition,\r\n applyUpdateTransition,\r\n isTransitionAll,\r\n updateLeaveTo\r\n} from '../../animation/customGraphicTransition';\r\nimport { updateProps } from '../../animation/basicTransition';\r\nimport {\r\n applyKeyframeAnimation,\r\n stopPreviousKeyframeAnimationAndRestore\r\n} from '../../animation/customGraphicKeyframeAnimation';\r\n\r\nconst nonShapeGraphicElements = {\r\n // Reserved but not supported in graphic component.\r\n path: null as unknown,\r\n compoundPath: null as unknown,\r\n\r\n // Supported in graphic component.\r\n group: graphicUtil.Group,\r\n image: graphicUtil.Image,\r\n text: graphicUtil.Text\r\n} as const;\r\ntype NonShapeGraphicElementType = keyof typeof nonShapeGraphicElements;\r\n\r\nexport const inner = modelUtil.makeInner<{\r\n width: number;\r\n height: number;\r\n isNew: boolean;\r\n id: string;\r\n type: string;\r\n option: GraphicComponentElementOption\r\n}, Element>();\r\n// ------------------------\r\n// View\r\n// ------------------------\r\nexport class GraphicComponentView extends ComponentView {\r\n\r\n static type = 'graphic';\r\n type = GraphicComponentView.type;\r\n\r\n private _elMap: ElementMap;\r\n private _lastGraphicModel: GraphicComponentModel;\r\n\r\n init() {\r\n this._elMap = zrUtil.createHashMap();\r\n }\r\n\r\n render(graphicModel: GraphicComponentModel, ecModel: GlobalModel, api: ExtensionAPI): void {\r\n // Having leveraged between use cases and algorithm complexity, a very\r\n // simple layout mechanism is used:\r\n // The size(width/height) can be determined by itself or its parent (not\r\n // implemented yet), but can not by its children. (Top-down travel)\r\n // The location(x/y) can be determined by the bounding rect of itself\r\n // (can including its descendants or not) and the size of its parent.\r\n // (Bottom-up travel)\r\n\r\n // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\r\n // view will be reused.\r\n if (graphicModel !== this._lastGraphicModel) {\r\n this._clear();\r\n }\r\n this._lastGraphicModel = graphicModel;\r\n\r\n this._updateElements(graphicModel);\r\n this._relocate(graphicModel, api);\r\n }\r\n\r\n /**\r\n * Update graphic elements.\r\n */\r\n private _updateElements(graphicModel: GraphicComponentModel): void {\r\n const elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\r\n\r\n if (!elOptionsToUpdate) {\r\n return;\r\n }\r\n\r\n const elMap = this._elMap;\r\n const rootGroup = this.group;\r\n\r\n const globalZ = graphicModel.get('z');\r\n const globalZLevel = graphicModel.get('zlevel');\r\n\r\n // Top-down tranverse to assign graphic settings to each elements.\r\n zrUtil.each(elOptionsToUpdate, function (elOption) {\r\n const id = modelUtil.convertOptionIdName(elOption.id, null);\r\n const elExisting = id != null ? elMap.get(id) : null;\r\n const parentId = modelUtil.convertOptionIdName(elOption.parentId, null);\r\n const targetElParent = (parentId != null ? elMap.get(parentId) : rootGroup) as graphicUtil.Group;\r\n\r\n const elType = elOption.type;\r\n const elOptionStyle = (elOption as GraphicComponentDisplayableOption).style;\r\n if (elType === 'text' && elOptionStyle) {\r\n // In top/bottom mode, textVerticalAlign should not be used, which cause\r\n // inaccurately locating.\r\n if (elOption.hv && elOption.hv[1]) {\r\n (elOptionStyle as any).textVerticalAlign =\r\n (elOptionStyle as any).textBaseline =\r\n (elOptionStyle as TextStyleProps).verticalAlign =\r\n (elOptionStyle as TextStyleProps).align = null;\r\n }\r\n }\r\n\r\n let textContentOption = (elOption as GraphicComponentZRPathOption).textContent;\r\n let textConfig = (elOption as GraphicComponentZRPathOption).textConfig;\r\n if (elOptionStyle\r\n && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\r\n const convertResult =\r\n convertFromEC4CompatibleStyle(elOptionStyle, elType, true) as GraphicComponentZRPathOption;\r\n if (!textConfig && convertResult.textConfig) {\r\n textConfig = (elOption as GraphicComponentZRPathOption).textConfig = convertResult.textConfig;\r\n }\r\n if (!textContentOption && convertResult.textContent) {\r\n textContentOption = convertResult.textContent;\r\n }\r\n }\r\n\r\n // Remove unnecessary props to avoid potential problems.\r\n const elOptionCleaned = getCleanedElOption(elOption);\r\n\r\n\r\n // For simple, do not support parent change, otherwise reorder is needed.\r\n if (__DEV__) {\r\n elExisting && zrUtil.assert(\r\n targetElParent === elExisting.parent,\r\n 'Changing parent is not supported.'\r\n );\r\n }\r\n\r\n const $action = elOption.$action || 'merge';\r\n const isMerge = $action === 'merge';\r\n const isReplace = $action === 'replace';\r\n if (isMerge) {\r\n const isInit = !elExisting;\r\n let el = elExisting;\r\n if (isInit) {\r\n el = createEl(id, targetElParent, elOption.type, elMap);\r\n }\r\n else {\r\n el && (inner(el).isNew = false);\r\n // Stop and restore before update any other attributes.\r\n stopPreviousKeyframeAnimationAndRestore(el);\r\n }\r\n if (el) {\r\n applyUpdateTransition(\r\n el,\r\n elOptionCleaned,\r\n graphicModel,\r\n { isInit }\r\n );\r\n updateCommonAttrs(el, elOption, globalZ, globalZLevel);\r\n }\r\n }\r\n else if (isReplace) {\r\n removeEl(elExisting, elOption, elMap, graphicModel);\r\n const el = createEl(id, targetElParent, elOption.type, elMap);\r\n if (el) {\r\n applyUpdateTransition(\r\n el,\r\n elOptionCleaned,\r\n graphicModel,\r\n { isInit: true}\r\n );\r\n updateCommonAttrs(el, elOption, globalZ, globalZLevel);\r\n }\r\n }\r\n else if ($action === 'remove') {\r\n updateLeaveTo(elExisting, elOption);\r\n removeEl(elExisting, elOption, elMap, graphicModel);\r\n }\r\n\r\n const el = elMap.get(id);\r\n\r\n if (el && textContentOption) {\r\n if (isMerge) {\r\n const textContentExisting = el.getTextContent();\r\n textContentExisting\r\n ? textContentExisting.attr(textContentOption)\r\n : el.setTextContent(new graphicUtil.Text(textContentOption));\r\n }\r\n else if (isReplace) {\r\n el.setTextContent(new graphicUtil.Text(textContentOption));\r\n }\r\n }\r\n\r\n if (el) {\r\n const clipPathOption = elOption.clipPath;\r\n if (clipPathOption) {\r\n const clipPathType = clipPathOption.type;\r\n let clipPath: graphicUtil.Path;\r\n let isInit = false;\r\n if (isMerge) {\r\n const oldClipPath = el.getClipPath();\r\n isInit = !oldClipPath\r\n || inner(oldClipPath).type !== clipPathType;\r\n clipPath = isInit ? newEl(clipPathType) as graphicUtil.Path : oldClipPath;\r\n }\r\n else if (isReplace) {\r\n isInit = true;\r\n clipPath = newEl(clipPathType) as graphicUtil.Path;\r\n }\r\n\r\n el.setClipPath(clipPath);\r\n\r\n applyUpdateTransition(\r\n clipPath,\r\n clipPathOption,\r\n graphicModel,\r\n { isInit}\r\n );\r\n applyKeyframeAnimation(\r\n clipPath,\r\n clipPathOption.keyframeAnimation,\r\n graphicModel\r\n );\r\n }\r\n\r\n const elInner = inner(el);\r\n\r\n el.setTextConfig(textConfig);\r\n\r\n elInner.option = elOption;\r\n setEventData(el, graphicModel, elOption);\r\n\r\n graphicUtil.setTooltipConfig({\r\n el: el,\r\n componentModel: graphicModel,\r\n itemName: el.name,\r\n itemTooltipOption: elOption.tooltip\r\n });\r\n\r\n applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Locate graphic elements.\r\n */\r\n private _relocate(graphicModel: GraphicComponentModel, api: ExtensionAPI): void {\r\n const elOptions = graphicModel.option.elements;\r\n const rootGroup = this.group;\r\n const elMap = this._elMap;\r\n const apiWidth = api.getWidth();\r\n const apiHeight = api.getHeight();\r\n\r\n const xy = ['x', 'y'] as const;\r\n\r\n // Top-down to calculate percentage width/height of group\r\n for (let i = 0; i < elOptions.length; i++) {\r\n const elOption = elOptions[i];\r\n const id = modelUtil.convertOptionIdName(elOption.id, null);\r\n const el = id != null ? elMap.get(id) : null;\r\n\r\n if (!el || !el.isGroup) {\r\n continue;\r\n }\r\n const parentEl = el.parent;\r\n const isParentRoot = parentEl === rootGroup;\r\n // Like 'position:absolut' in css, default 0.\r\n const elInner = inner(el);\r\n const parentElInner = inner(parentEl);\r\n elInner.width = parsePercent(\r\n (elInner.option as GraphicComponentGroupOption).width,\r\n isParentRoot ? apiWidth : parentElInner.width\r\n ) || 0;\r\n elInner.height = parsePercent(\r\n (elInner.option as GraphicComponentGroupOption).height,\r\n isParentRoot ? apiHeight : parentElInner.height\r\n ) || 0;\r\n }\r\n\r\n // Bottom-up tranvese all elements (consider ec resize) to locate elements.\r\n for (let i = elOptions.length - 1; i >= 0; i--) {\r\n const elOption = elOptions[i];\r\n const id = modelUtil.convertOptionIdName(elOption.id, null);\r\n const el = id != null ? elMap.get(id) : null;\r\n\r\n if (!el) {\r\n continue;\r\n }\r\n\r\n const parentEl = el.parent;\r\n const parentElInner = inner(parentEl);\r\n const containerInfo = parentEl === rootGroup\r\n ? {\r\n width: apiWidth,\r\n height: apiHeight\r\n }\r\n : {\r\n width: parentElInner.width,\r\n height: parentElInner.height\r\n };\r\n\r\n // PENDING\r\n // Currently, when `bounding: 'all'`, the union bounding rect of the group\r\n // does not include the rect of [0, 0, group.width, group.height], which\r\n // is probably weird for users. Should we make a break change for it?\r\n const layoutPos = {} as Record<'x' | 'y', number>;\r\n const layouted = layoutUtil.positionElement(\r\n el, elOption, containerInfo, null,\r\n { hv: elOption.hv, boundingMode: elOption.bounding },\r\n layoutPos\r\n );\r\n\r\n if (!inner(el).isNew && layouted) {\r\n const transition = elOption.transition;\r\n const animatePos = {} as Record<'x' | 'y', number>;\r\n for (let k = 0; k < xy.length; k++) {\r\n const key = xy[k];\r\n const val = layoutPos[key];\r\n if (transition && (isTransitionAll(transition) || zrUtil.indexOf(transition, key) >= 0)) {\r\n animatePos[key] = val;\r\n }\r\n else {\r\n el[key] = val;\r\n }\r\n }\r\n updateProps(el, animatePos, graphicModel, 0);\r\n }\r\n else {\r\n el.attr(layoutPos);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear all elements.\r\n */\r\n private _clear(): void {\r\n const elMap = this._elMap;\r\n elMap.each((el) => {\r\n removeEl(el, inner(el).option, elMap, this._lastGraphicModel);\r\n });\r\n this._elMap = zrUtil.createHashMap();\r\n }\r\n\r\n dispose(): void {\r\n this._clear();\r\n }\r\n}\r\n\r\nfunction newEl(graphicType: string) {\r\n if (__DEV__) {\r\n zrUtil.assert(graphicType, 'graphic type MUST be set');\r\n }\r\n\r\n const Clz = (\r\n zrUtil.hasOwn(nonShapeGraphicElements, graphicType)\r\n // Those graphic elements are not shapes. They should not be\r\n // overwritten by users, so do them first.\r\n ? nonShapeGraphicElements[graphicType as NonShapeGraphicElementType]\r\n : graphicUtil.getShapeClass(graphicType)\r\n ) as { new(opt: GraphicComponentElementOption): Element; };\r\n\r\n if (__DEV__) {\r\n zrUtil.assert(Clz, `graphic type ${graphicType} can not be found`);\r\n }\r\n\r\n const el = new Clz({});\r\n inner(el).type = graphicType;\r\n return el;\r\n}\r\nfunction createEl(\r\n id: string,\r\n targetElParent: graphicUtil.Group,\r\n graphicType: string,\r\n elMap: ElementMap\r\n): Element {\r\n\r\n const el = newEl(graphicType);\r\n\r\n targetElParent.add(el);\r\n elMap.set(id, el);\r\n inner(el).id = id;\r\n inner(el).isNew = true;\r\n\r\n return el;\r\n}\r\nfunction removeEl(\r\n elExisting: Element,\r\n elOption: GraphicComponentElementOption,\r\n elMap: ElementMap,\r\n graphicModel: GraphicComponentModel\r\n): void {\r\n const existElParent = elExisting && elExisting.parent;\r\n if (existElParent) {\r\n elExisting.type === 'group' && elExisting.traverse(function (el) {\r\n removeEl(el, elOption, elMap, graphicModel);\r\n });\r\n applyLeaveTransition(elExisting, elOption, graphicModel);\r\n elMap.removeKey(inner(elExisting).id);\r\n }\r\n}\r\n\r\nfunction updateCommonAttrs(\r\n el: Element,\r\n elOption: GraphicComponentElementOption,\r\n defaultZ: number,\r\n defaultZlevel: number\r\n) {\r\n if (!el.isGroup) {\r\n zrUtil.each([\r\n ['cursor', Displayable.prototype.cursor],\r\n // We should not support configure z and zlevel in the element level.\r\n // But seems we didn't limit it previously. So here still use it to avoid breaking.\r\n ['zlevel', defaultZlevel || 0],\r\n ['z', defaultZ || 0],\r\n // z2 must not be null/undefined, otherwise sort error may occur.\r\n ['z2', 0]\r\n ], item => {\r\n const prop = item[0] as any;\r\n if (zrUtil.hasOwn(elOption, prop)) {\r\n (el as any)[prop] = zrUtil.retrieve2(\r\n (elOption as any)[prop],\r\n item[1]\r\n );\r\n }\r\n else if ((el as any)[prop] == null) {\r\n (el as any)[prop] = item[1];\r\n }\r\n });\r\n }\r\n\r\n zrUtil.each(zrUtil.keys(elOption), key => {\r\n // Assign event handlers.\r\n // PENDING: should enumerate all event names or use pattern matching?\r\n if (key.indexOf('on') === 0) {\r\n const val = (elOption as any)[key];\r\n (el as any)[key] = zrUtil.isFunction(val) ? val : null;\r\n }\r\n });\r\n if (zrUtil.hasOwn(elOption, 'draggable')) {\r\n el.draggable = elOption.draggable;\r\n }\r\n\r\n // Other attributes\r\n elOption.name != null && (el.name = elOption.name);\r\n elOption.id != null && ((el as any).id = elOption.id);\r\n}\r\n// Remove unnecessary props to avoid potential problems.\r\nfunction getCleanedElOption(\r\n elOption: GraphicComponentElementOption\r\n): Omit {\r\n elOption = zrUtil.extend({}, elOption);\r\n zrUtil.each(\r\n ['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(layoutUtil.LOCATION_PARAMS),\r\n function (name) {\r\n delete (elOption as any)[name];\r\n }\r\n );\r\n return elOption;\r\n}\r\n\r\nfunction setEventData(\r\n el: Element,\r\n graphicModel: GraphicComponentModel,\r\n elOption: GraphicComponentElementOption\r\n): void {\r\n let eventData = getECData(el).eventData;\r\n // Simple optimize for large amount of elements that no need event.\r\n if (!el.silent && !el.ignore && !eventData) {\r\n eventData = getECData(el).eventData = {\r\n componentType: 'graphic',\r\n componentIndex: graphicModel.componentIndex,\r\n name: el.name\r\n };\r\n }\r\n\r\n // `elOption.info` enables user to mount some info on\r\n // elements and use them in event handlers.\r\n if (eventData) {\r\n eventData.info = elOption.info;\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n\r\nimport { isArray } from 'zrender/src/core/util';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport { GraphicComponentModel, GraphicComponentOption } from './GraphicModel';\r\nimport { GraphicComponentView } from './GraphicView';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerComponentModel(GraphicComponentModel);\r\n registers.registerComponentView(GraphicComponentView);\r\n\r\n registers.registerPreprocessor(function (option) {\r\n const graphicOption = option.graphic as GraphicComponentOption | GraphicComponentOption[];\r\n\r\n // Convert\r\n // {graphic: [{left: 10, type: 'circle'}, ...]}\r\n // or\r\n // {graphic: {left: 10, type: 'circle'}}\r\n // to\r\n // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\r\n if (isArray(graphicOption)) {\r\n if (!graphicOption[0] || !graphicOption[0].elements) {\r\n option.graphic = [{ elements: graphicOption }];\r\n }\r\n else {\r\n // Only one graphic instance can be instantiated. (We don't\r\n // want that too many views are created in echarts._viewMap.)\r\n option.graphic = [(option.graphic as any)[0]];\r\n }\r\n }\r\n else if (graphicOption && !graphicOption.elements) {\r\n option.graphic = [{ elements: [graphicOption] }];\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { Payload } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport DataZoomModel from './DataZoomModel';\r\nimport { indexOf, createHashMap, assert, HashMap } from 'zrender/src/core/util';\r\nimport SeriesModel from '../../model/Series';\r\nimport { CoordinateSystemHostModel } from '../../coord/CoordinateSystem';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\n\r\n\r\nexport interface DataZoomPayloadBatchItem {\r\n dataZoomId: string;\r\n start?: number;\r\n end?: number;\r\n startValue?: number;\r\n endValue?: number;\r\n}\r\n\r\nexport interface DataZoomReferCoordSysInfo {\r\n model: CoordinateSystemHostModel;\r\n // Notice: if two dataZooms refer the same coordinamte system model,\r\n // (1) The axis they refered may different\r\n // (2) The sequence the axisModels matters, may different in\r\n // different dataZooms.\r\n axisModels: AxisBaseModel[];\r\n}\r\n\r\nexport const DATA_ZOOM_AXIS_DIMENSIONS = [\r\n 'x', 'y', 'radius', 'angle', 'single'\r\n] as const;\r\nexport type DataZoomAxisDimension =\r\n 'x' | 'y' | 'radius' | 'angle' | 'single';\r\ntype DataZoomAxisMainType =\r\n 'xAxis' | 'yAxis' | 'radiusAxis' | 'angleAxis' | 'singleAxis';\r\ntype DataZoomAxisIndexPropName =\r\n 'xAxisIndex' | 'yAxisIndex' | 'radiusAxisIndex' | 'angleAxisIndex' | 'singleAxisIndex';\r\ntype DataZoomAxisIdPropName =\r\n 'xAxisId' | 'yAxisId' | 'radiusAxisId' | 'angleAxisId' | 'singleAxisId';\r\nexport type DataZoomCoordSysMainType = 'polar' | 'grid' | 'singleAxis';\r\n\r\n// Supported coords.\r\n// FIXME: polar has been broken (but rarely used).\r\nconst SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'] as const;\r\n\r\nexport function isCoordSupported(seriesModel: SeriesModel): boolean {\r\n const coordType = seriesModel.get('coordinateSystem');\r\n return indexOf(SERIES_COORDS, coordType) >= 0;\r\n}\r\n\r\nexport function getAxisMainType(axisDim: DataZoomAxisDimension): DataZoomAxisMainType {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'Axis' as DataZoomAxisMainType;\r\n}\r\n\r\nexport function getAxisIndexPropName(axisDim: DataZoomAxisDimension): DataZoomAxisIndexPropName {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'AxisIndex' as DataZoomAxisIndexPropName;\r\n}\r\n\r\nexport function getAxisIdPropName(axisDim: DataZoomAxisDimension): DataZoomAxisIdPropName {\r\n if (__DEV__) {\r\n assert(axisDim);\r\n }\r\n return axisDim + 'AxisId' as DataZoomAxisIdPropName;\r\n}\r\n\r\n/**\r\n * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.\r\n * This function finds all linked dataZoomModels start from the given payload.\r\n */\r\nexport function findEffectedDataZooms(ecModel: GlobalModel, payload: Payload): DataZoomModel[] {\r\n\r\n // Key: `DataZoomAxisDimension`\r\n const axisRecords = createHashMap();\r\n const effectedModels: DataZoomModel[] = [];\r\n // Key: uid of dataZoomModel\r\n const effectedModelMap = createHashMap();\r\n\r\n // Find the dataZooms specified by payload.\r\n ecModel.eachComponent(\r\n { mainType: 'dataZoom', query: payload },\r\n function (dataZoomModel: DataZoomModel) {\r\n if (!effectedModelMap.get(dataZoomModel.uid)) {\r\n addToEffected(dataZoomModel);\r\n }\r\n }\r\n );\r\n\r\n // Start from the given dataZoomModels, travel the graph to find\r\n // all of the linked dataZoom models.\r\n let foundNewLink;\r\n do {\r\n foundNewLink = false;\r\n ecModel.eachComponent('dataZoom', processSingle);\r\n }\r\n while (foundNewLink);\r\n\r\n function processSingle(dataZoomModel: DataZoomModel): void {\r\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\r\n addToEffected(dataZoomModel);\r\n foundNewLink = true;\r\n }\r\n }\r\n\r\n function addToEffected(dataZoom: DataZoomModel): void {\r\n effectedModelMap.set(dataZoom.uid, true);\r\n effectedModels.push(dataZoom);\r\n markAxisControlled(dataZoom);\r\n }\r\n\r\n function isLinked(dataZoomModel: DataZoomModel): boolean {\r\n let isLink = false;\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n const axisIdxArr = axisRecords.get(axisDim);\r\n if (axisIdxArr && axisIdxArr[axisIndex]) {\r\n isLink = true;\r\n }\r\n });\r\n return isLink;\r\n }\r\n\r\n function markAxisControlled(dataZoomModel: DataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n (\r\n axisRecords.get(axisDim) || axisRecords.set(axisDim, [])\r\n )[axisIndex] = true;\r\n });\r\n }\r\n\r\n return effectedModels;\r\n}\r\n\r\n/**\r\n * Find the first target coordinate system.\r\n * Available after model built.\r\n *\r\n * @return Like {\r\n * grid: [\r\n * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\r\n * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\r\n * ...\r\n * ], // cartesians must not be null/undefined.\r\n * polar: [\r\n * {model: coord0, axisModels: [axis4], coordIndex: 0},\r\n * ...\r\n * ], // polars must not be null/undefined.\r\n * singleAxis: [\r\n * {model: coord0, axisModels: [], coordIndex: 0}\r\n * ]\r\n * }\r\n */\r\nexport function collectReferCoordSysModelInfo(dataZoomModel: DataZoomModel): {\r\n infoList: DataZoomReferCoordSysInfo[];\r\n // Key: coordSysModel.uid\r\n infoMap: HashMap;\r\n} {\r\n const ecModel = dataZoomModel.ecModel;\r\n const coordSysInfoWrap = {\r\n infoList: [] as DataZoomReferCoordSysInfo[],\r\n infoMap: createHashMap()\r\n };\r\n\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n const axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex) as AxisBaseModel;\r\n if (!axisModel) {\r\n return;\r\n }\r\n const coordSysModel = axisModel.getCoordSysModel();\r\n if (!coordSysModel) {\r\n return;\r\n }\r\n\r\n const coordSysUid = coordSysModel.uid;\r\n let coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\r\n if (!coordSysInfo) {\r\n coordSysInfo = { model: coordSysModel, axisModels: [] };\r\n coordSysInfoWrap.infoList.push(coordSysInfo);\r\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\r\n }\r\n\r\n coordSysInfo.axisModels.push(axisModel);\r\n });\r\n\r\n return coordSysInfoWrap;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { each, createHashMap, merge, HashMap, assert } from 'zrender/src/core/util';\r\nimport AxisProxy from './AxisProxy';\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n LayoutOrient,\r\n ComponentOption,\r\n LabelOption\r\n} from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport GlobalModel from '../../model/Global';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport {\r\n getAxisMainType, DATA_ZOOM_AXIS_DIMENSIONS, DataZoomAxisDimension\r\n} from './helper';\r\nimport SingleAxisModel from '../../coord/single/AxisModel';\r\nimport { MULTIPLE_REFERRING, SINGLE_REFERRING } from '../../util/model';\r\n\r\n\r\nexport interface DataZoomOption extends ComponentOption {\r\n\r\n mainType?: 'dataZoom'\r\n\r\n /**\r\n * Default auto by axisIndex\r\n */\r\n orient?: LayoutOrient\r\n\r\n /**\r\n * Default the first horizontal category axis.\r\n */\r\n xAxisIndex?: number | number[]\r\n xAxisId?: string | string[]\r\n\r\n /**\r\n * Default the first vertical category axis.\r\n */\r\n yAxisIndex?: number | number[]\r\n yAxisId?: string | string[]\r\n\r\n radiusAxisIndex?: number | number[]\r\n radiusAxisId?: string | string[]\r\n angleAxisIndex?: number | number[]\r\n angleAxisId?: string | string[]\r\n\r\n singleAxisIndex?: number | number[]\r\n singleAxisId?: string | string[]\r\n\r\n /**\r\n * Possible values: 'filter' or 'empty' or 'weakFilter'.\r\n * 'filter': data items which are out of window will be removed. This option is\r\n * applicable when filtering outliers. For each data item, it will be\r\n * filtered if one of the relevant dimensions is out of the window.\r\n * 'weakFilter': data items which are out of window will be removed. This option\r\n * is applicable when filtering outliers. For each data item, it will be\r\n * filtered only if all of the relevant dimensions are out of the same\r\n * side of the window.\r\n * 'empty': data items which are out of window will be set to empty.\r\n * This option is applicable when user should not neglect\r\n * that there are some data items out of window.\r\n * 'none': Do not filter.\r\n * Taking line chart as an example, line will be broken in\r\n * the filtered points when filterModel is set to 'empty', but\r\n * be connected when set to 'filter'.\r\n */\r\n filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none'\r\n\r\n /**\r\n * Dispatch action by the fixed rate, avoid frequency.\r\n * default 100. Do not throttle when use null/undefined.\r\n * If animation === true and animationDurationUpdate > 0,\r\n * default value is 100, otherwise 20.\r\n */\r\n throttle?: number | null | undefined\r\n /**\r\n * Start percent. 0 ~ 100\r\n */\r\n start?: number\r\n /**\r\n * End percent. 0 ~ 100\r\n */\r\n end?: number\r\n /**\r\n * Start value. If startValue specified, start is ignored\r\n */\r\n startValue?: number | string | Date\r\n /**\r\n * End value. If endValue specified, end is ignored.\r\n */\r\n endValue?: number | string | Date\r\n /**\r\n * Min span percent, 0 - 100\r\n * The range of dataZoom can not be smaller than that.\r\n */\r\n minSpan?: number\r\n /**\r\n * Max span percent, 0 - 100\r\n * The range of dataZoom can not be larger than that.\r\n */\r\n maxSpan?: number\r\n\r\n minValueSpan?: number\r\n\r\n maxValueSpan?: number\r\n\r\n rangeMode?: ['value' | 'percent', 'value' | 'percent']\r\n\r\n realtime?: boolean\r\n\r\n // Available when type is slider\r\n textStyle?: LabelOption\r\n}\r\n\r\ntype RangeOption = Pick;\r\n\r\nexport type DataZoomExtendedAxisBaseModel = AxisBaseModel & {\r\n __dzAxisProxy: AxisProxy\r\n};\r\n\r\nclass DataZoomAxisInfo {\r\n indexList: number[] = [];\r\n indexMap: boolean[] = [];\r\n\r\n add(axisCmptIdx: number) {\r\n // Remove duplication.\r\n if (!this.indexMap[axisCmptIdx]) {\r\n this.indexList.push(axisCmptIdx);\r\n this.indexMap[axisCmptIdx] = true;\r\n }\r\n }\r\n}\r\nexport type DataZoomTargetAxisInfoMap = HashMap;\r\n\r\nclass DataZoomModel extends ComponentModel {\r\n static type = 'dataZoom';\r\n type = DataZoomModel.type;\r\n\r\n static dependencies = [\r\n 'xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'\r\n ];\r\n\r\n\r\n static defaultOption: DataZoomOption = {\r\n // zlevel: 0,\r\n z: 4, // Higher than normal component (z: 2).\r\n\r\n filterMode: 'filter',\r\n\r\n start: 0,\r\n end: 100\r\n };\r\n\r\n private _autoThrottle = true;\r\n\r\n private _orient: LayoutOrient;\r\n\r\n private _targetAxisInfoMap: DataZoomTargetAxisInfoMap;\r\n\r\n private _noTarget: boolean = true;\r\n\r\n /**\r\n * It is `[rangeModeForMin, rangeModeForMax]`.\r\n * The optional values for `rangeMode`:\r\n * + `'value'` mode: the axis extent will always be determined by\r\n * `dataZoom.startValue` and `dataZoom.endValue`, despite\r\n * how data like and how `axis.min` and `axis.max` are.\r\n * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\r\n * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\r\n * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\r\n * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\r\n *\r\n * For example, when users are using dynamic data (update data periodically via `setOption`),\r\n * if in `'value`' mode, the window will be kept in a fixed value range despite how\r\n * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\r\n * the appended data (suppose `axis.min` and `axis.max` are not specified).\r\n */\r\n private _rangePropMode: DataZoomOption['rangeMode'] = ['percent', 'percent'];\r\n\r\n /**\r\n * @readonly\r\n */\r\n settledOption: Opts;\r\n\r\n init(option: Opts, parentModel: Model, ecModel: GlobalModel): void {\r\n\r\n const inputRawOption = retrieveRawOption(option);\r\n\r\n /**\r\n * Suppose a \"main process\" start at the point that model prepared (that is,\r\n * model initialized or merged or method called in `action`).\r\n * We should keep the `main process` idempotent, that is, given a set of values\r\n * on `option`, we get the same result.\r\n *\r\n * But sometimes, values on `option` will be updated for providing users\r\n * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\r\n * should not be the base/input of the `main process`.\r\n *\r\n * So in that case we should save and keep the input of the `main process`\r\n * separately, called `settledOption`.\r\n *\r\n * For example, consider the case:\r\n * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\r\n * where the original input `option.startValue`, `option.endValue` are earsed by\r\n * calculated value.\r\n * (Step)2) click the legend to hide and show a series,\r\n * where the new range is calculated by the earsed `startValue` and `endValue`,\r\n * which brings incorrect result.\r\n */\r\n this.settledOption = inputRawOption;\r\n\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n\r\n this._doInit(inputRawOption);\r\n }\r\n\r\n mergeOption(newOption: Opts): void {\r\n const inputRawOption = retrieveRawOption(newOption);\r\n\r\n // FIX #2591\r\n merge(this.option, newOption, true);\r\n merge(this.settledOption, inputRawOption, true);\r\n\r\n this._doInit(inputRawOption);\r\n }\r\n\r\n private _doInit(inputRawOption: Opts): void {\r\n const thisOption = this.option;\r\n\r\n this._setDefaultThrottle(inputRawOption);\r\n\r\n this._updateRangeUse(inputRawOption);\r\n\r\n const settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']] as const, function (names, index) {\r\n // start/end has higher priority over startValue/endValue if they\r\n // both set, but we should make chart.setOption({endValue: 1000})\r\n // effective, rather than chart.setOption({endValue: 1000, end: null}).\r\n if (this._rangePropMode[index] === 'value') {\r\n thisOption[names[0]] = settledOption[names[0]] = null;\r\n }\r\n // Otherwise do nothing and use the merge result.\r\n }, this);\r\n\r\n this._resetTarget();\r\n }\r\n\r\n private _resetTarget() {\r\n const optionOrient = this.get('orient', true);\r\n const targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\r\n\r\n const hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\r\n\r\n if (hasAxisSpecified) {\r\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\r\n }\r\n else {\r\n this._orient = optionOrient || 'horizontal';\r\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\r\n }\r\n\r\n this._noTarget = true;\r\n targetAxisIndexMap.each(function (axisInfo) {\r\n if (axisInfo.indexList.length) {\r\n this._noTarget = false;\r\n }\r\n }, this);\r\n }\r\n\r\n private _fillSpecifiedTargetAxis(targetAxisIndexMap: DataZoomTargetAxisInfoMap): boolean {\r\n let hasAxisSpecified = false;\r\n\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n const refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);\r\n // When user set axisIndex as a empty array, we think that user specify axisIndex\r\n // but do not want use auto mode. Because empty array may be encountered when\r\n // some error occurred.\r\n if (!refering.specified) {\r\n return;\r\n }\r\n hasAxisSpecified = true;\r\n const axisInfo = new DataZoomAxisInfo();\r\n each(refering.models, function (axisModel) {\r\n axisInfo.add(axisModel.componentIndex);\r\n });\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n }, this);\r\n\r\n return hasAxisSpecified;\r\n }\r\n\r\n private _fillAutoTargetAxisByOrient(targetAxisIndexMap: DataZoomTargetAxisInfoMap, orient: LayoutOrient): void {\r\n const ecModel = this.ecModel;\r\n let needAuto = true;\r\n\r\n // Find axis that parallel to dataZoom as default.\r\n if (needAuto) {\r\n const axisDim = orient === 'vertical' ? 'y' : 'x';\r\n const axisModels = ecModel.findComponents({ mainType: axisDim + 'Axis' });\r\n setParallelAxis(axisModels, axisDim);\r\n }\r\n // Find axis that parallel to dataZoom as default.\r\n if (needAuto) {\r\n const axisModels = ecModel.findComponents({\r\n mainType: 'singleAxis',\r\n filter: (axisModel: SingleAxisModel) => axisModel.get('orient', true) === orient\r\n });\r\n setParallelAxis(axisModels, 'single');\r\n }\r\n\r\n function setParallelAxis(axisModels: ComponentModel[], axisDim: DataZoomAxisDimension): void {\r\n // At least use the first parallel axis as the target axis.\r\n const axisModel = axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n\r\n const axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModel.componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n\r\n // Find parallel axes in the same grid.\r\n if (axisDim === 'x' || axisDim === 'y') {\r\n const gridModel = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\r\n gridModel && each(axisModels, function (axModel) {\r\n if (axisModel.componentIndex !== axModel.componentIndex\r\n && gridModel === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]\r\n ) {\r\n axisInfo.add(axModel.componentIndex);\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (needAuto) {\r\n // If no parallel axis, find the first category axis as default. (Also consider polar).\r\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\r\n if (!needAuto) {\r\n return;\r\n }\r\n const axisModels = ecModel.findComponents({\r\n mainType: getAxisMainType(axisDim),\r\n filter: (axisModel: SingleAxisModel) => axisModel.get('type', true) === 'category'\r\n });\r\n if (axisModels[0]) {\r\n const axisInfo = new DataZoomAxisInfo();\r\n axisInfo.add(axisModels[0].componentIndex);\r\n targetAxisIndexMap.set(axisDim, axisInfo);\r\n needAuto = false;\r\n }\r\n }, this);\r\n }\r\n }\r\n\r\n private _makeAutoOrientByTargetAxis(): LayoutOrient {\r\n let dim: string;\r\n\r\n // Find the first axis\r\n this.eachTargetAxis(function (axisDim) {\r\n !dim && (dim = axisDim);\r\n }, this);\r\n\r\n return dim === 'y' ? 'vertical' : 'horizontal';\r\n }\r\n\r\n private _setDefaultThrottle(inputRawOption: DataZoomOption): void {\r\n // When first time user set throttle, auto throttle ends.\r\n if (inputRawOption.hasOwnProperty('throttle')) {\r\n this._autoThrottle = false;\r\n }\r\n if (this._autoThrottle) {\r\n const globalOption = this.ecModel.option;\r\n this.option.throttle = (\r\n globalOption.animation && globalOption.animationDurationUpdate > 0\r\n ) ? 100 : 20;\r\n }\r\n }\r\n\r\n private _updateRangeUse(inputRawOption: RangeOption): void {\r\n const rangePropMode = this._rangePropMode;\r\n const rangeModeInOption = this.get('rangeMode');\r\n\r\n each([['start', 'startValue'], ['end', 'endValue']] as const, function (names, index) {\r\n const percentSpecified = inputRawOption[names[0]] != null;\r\n const valueSpecified = inputRawOption[names[1]] != null;\r\n if (percentSpecified && !valueSpecified) {\r\n rangePropMode[index] = 'percent';\r\n }\r\n else if (!percentSpecified && valueSpecified) {\r\n rangePropMode[index] = 'value';\r\n }\r\n else if (rangeModeInOption) {\r\n rangePropMode[index] = rangeModeInOption[index];\r\n }\r\n else if (percentSpecified) { // percentSpecified && valueSpecified\r\n rangePropMode[index] = 'percent';\r\n }\r\n // else remain its original setting.\r\n });\r\n }\r\n\r\n noTarget(): boolean {\r\n return this._noTarget;\r\n }\r\n\r\n getFirstTargetAxisModel(): AxisBaseModel {\r\n let firstAxisModel: AxisBaseModel;\r\n this.eachTargetAxis(function (axisDim, axisIndex) {\r\n if (firstAxisModel == null) {\r\n firstAxisModel = this.ecModel.getComponent(\r\n getAxisMainType(axisDim), axisIndex\r\n ) as AxisBaseModel;\r\n }\r\n }, this);\r\n\r\n return firstAxisModel;\r\n }\r\n\r\n /**\r\n * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\r\n */\r\n eachTargetAxis(\r\n callback: (\r\n this: Ctx,\r\n axisDim: DataZoomAxisDimension,\r\n axisIndex: number\r\n ) => void,\r\n context?: Ctx\r\n ): void {\r\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\r\n each(axisInfo.indexList, function (axisIndex) {\r\n callback.call(context, axisDim, axisIndex);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * @return If not found, return null/undefined.\r\n */\r\n getAxisProxy(axisDim: DataZoomAxisDimension, axisIndex: number): AxisProxy {\r\n const axisModel = this.getAxisModel(axisDim, axisIndex);\r\n if (axisModel) {\r\n return (axisModel as DataZoomExtendedAxisBaseModel).__dzAxisProxy;\r\n }\r\n }\r\n\r\n /**\r\n * @return If not found, return null/undefined.\r\n */\r\n getAxisModel(axisDim: DataZoomAxisDimension, axisIndex: number): AxisBaseModel {\r\n if (__DEV__) {\r\n assert(axisDim && axisIndex != null);\r\n }\r\n const axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\r\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex) as AxisBaseModel;\r\n }\r\n }\r\n\r\n /**\r\n * If not specified, set to undefined.\r\n */\r\n setRawRange(opt: RangeOption): void {\r\n const thisOption = this.option;\r\n const settledOption = this.settledOption;\r\n each([['start', 'startValue'], ['end', 'endValue']] as const, function (names) {\r\n // Consider the pair :\r\n // If one has value and the other one is `null/undefined`, we both set them\r\n // to `settledOption`. This strategy enables the feature to clear the original\r\n // value in `settledOption` to `null/undefined`.\r\n // But if both of them are `null/undefined`, we do not set them to `settledOption`\r\n // and keep `settledOption` with the original value. This strategy enables users to\r\n // only set but not set when calling\r\n // `dispatchAction`.\r\n // The pair is treated in the same way.\r\n if (opt[names[0]] != null || opt[names[1]] != null) {\r\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\r\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\r\n }\r\n }, this);\r\n\r\n this._updateRangeUse(opt);\r\n }\r\n\r\n setCalculatedRange(opt: RangeOption): void {\r\n const option = this.option;\r\n each(['start', 'startValue', 'end', 'endValue'] as const, function (name) {\r\n (option as any)[name] = opt[name];\r\n });\r\n }\r\n\r\n getPercentRange(): number[] {\r\n const axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataPercentWindow();\r\n }\r\n }\r\n\r\n /**\r\n * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\r\n *\r\n * @return [startValue, endValue] value can only be '-' or finite number.\r\n */\r\n getValueRange(axisDim: DataZoomAxisDimension, axisIndex: number): number[] {\r\n if (axisDim == null && axisIndex == null) {\r\n const axisProxy = this.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n return axisProxy.getDataValueWindow();\r\n }\r\n }\r\n else {\r\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\r\n }\r\n }\r\n\r\n /**\r\n * @param axisModel If axisModel given, find axisProxy\r\n * corresponding to the axisModel\r\n */\r\n findRepresentativeAxisProxy(axisModel?: AxisBaseModel): AxisProxy {\r\n if (axisModel) {\r\n return (axisModel as DataZoomExtendedAxisBaseModel).__dzAxisProxy;\r\n }\r\n\r\n // Find the first hosted axisProxy\r\n let firstProxy;\r\n const axisDimList = this._targetAxisInfoMap.keys();\r\n for (let i = 0; i < axisDimList.length; i++) {\r\n const axisDim = axisDimList[i];\r\n const axisInfo = this._targetAxisInfoMap.get(axisDim);\r\n for (let j = 0; j < axisInfo.indexList.length; j++) {\r\n const proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\r\n if (proxy.hostedBy(this)) {\r\n return proxy;\r\n }\r\n if (!firstProxy) {\r\n firstProxy = proxy;\r\n }\r\n }\r\n }\r\n\r\n // If no hosted proxy found, still need to return a proxy.\r\n // This case always happens in toolbox dataZoom, where axes are all hosted by\r\n // other dataZooms.\r\n return firstProxy;\r\n }\r\n\r\n getRangePropMode(): DataZoomModel['_rangePropMode'] {\r\n return this._rangePropMode.slice() as DataZoomModel['_rangePropMode'];\r\n }\r\n\r\n getOrient(): LayoutOrient {\r\n if (__DEV__) {\r\n // Should not be called before initialized.\r\n assert(this._orient);\r\n }\r\n return this._orient;\r\n }\r\n\r\n}\r\n/**\r\n * Retrieve those raw params from option, which will be cached separately,\r\n * because they will be overwritten by normalized/calculated values in the main\r\n * process.\r\n */\r\nfunction retrieveRawOption(option: T) {\r\n const ret = {} as T;\r\n each(\r\n ['start', 'end', 'startValue', 'endValue', 'throttle'] as const,\r\n function (name) {\r\n option.hasOwnProperty(name) && ((ret as any)[name] = option[name]);\r\n }\r\n );\r\n return ret;\r\n}\r\n\r\nexport default DataZoomModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport DataZoomModel from './DataZoomModel';\r\n\r\nclass SelectDataZoomModel extends DataZoomModel {\r\n static type = 'dataZoom.select';\r\n type = SelectDataZoomModel.type;\r\n}\r\n\r\nexport default SelectDataZoomModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ComponentView from '../../view/Component';\r\nimport DataZoomModel from './DataZoomModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\n\r\n\r\nclass DataZoomView extends ComponentView {\r\n static type = 'dataZoom';\r\n type = DataZoomView.type;\r\n\r\n dataZoomModel: DataZoomModel;\r\n ecModel: GlobalModel;\r\n api: ExtensionAPI;\r\n\r\n render(dataZoomModel: DataZoomModel, ecModel: GlobalModel, api: ExtensionAPI, payload: any) {\r\n this.dataZoomModel = dataZoomModel;\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n }\r\n\r\n}\r\n\r\nexport default DataZoomView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport DataZoomView from './DataZoomView';\r\n\r\nclass SelectDataZoomView extends DataZoomView {\r\n static type = 'dataZoom.select';\r\n type = SelectDataZoomView.type;\r\n}\r\n\r\nexport default SelectDataZoomView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as numberUtil from '../../util/number';\r\nimport sliderMove from '../helper/sliderMove';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesModel from '../../model/Series';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Dictionary } from '../../util/types';\r\n// TODO Polar?\r\nimport DataZoomModel from './DataZoomModel';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport { unionAxisExtentFromData } from '../../coord/axisHelper';\r\nimport { ensureScaleRawExtentInfo } from '../../coord/scaleRawExtentInfo';\r\nimport { getAxisMainType, isCoordSupported, DataZoomAxisDimension } from './helper';\r\nimport { SINGLE_REFERRING } from '../../util/model';\r\n\r\nconst each = zrUtil.each;\r\nconst asc = numberUtil.asc;\r\n\r\ninterface MinMaxSpan {\r\n minSpan: number\r\n maxSpan: number\r\n minValueSpan: number\r\n maxValueSpan: number\r\n}\r\n\r\ntype SupportedAxis = 'xAxis' | 'yAxis' | 'angleAxis' | 'radiusAxis' | 'singleAxis';\r\n\r\n/**\r\n * Operate single axis.\r\n * One axis can only operated by one axis operator.\r\n * Different dataZoomModels may be defined to operate the same axis.\r\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\r\n * So dataZoomModels share one axisProxy in that case.\r\n */\r\nclass AxisProxy {\r\n\r\n ecModel: GlobalModel;\r\n\r\n private _dimName: DataZoomAxisDimension;\r\n private _axisIndex: number;\r\n\r\n private _valueWindow: [number, number];\r\n private _percentWindow: [number, number];\r\n\r\n private _dataExtent: [number, number];\r\n\r\n private _minMaxSpan: MinMaxSpan;\r\n\r\n private _dataZoomModel: DataZoomModel;\r\n\r\n constructor(\r\n dimName: DataZoomAxisDimension,\r\n axisIndex: number,\r\n dataZoomModel: DataZoomModel,\r\n ecModel: GlobalModel\r\n ) {\r\n this._dimName = dimName;\r\n\r\n this._axisIndex = axisIndex;\r\n\r\n this.ecModel = ecModel;\r\n\r\n this._dataZoomModel = dataZoomModel;\r\n\r\n // /**\r\n // * @readOnly\r\n // * @private\r\n // */\r\n // this.hasSeriesStacked;\r\n }\r\n\r\n /**\r\n * Whether the axisProxy is hosted by dataZoomModel.\r\n */\r\n hostedBy(dataZoomModel: DataZoomModel): boolean {\r\n return this._dataZoomModel === dataZoomModel;\r\n }\r\n\r\n /**\r\n * @return Value can only be NaN or finite value.\r\n */\r\n getDataValueWindow() {\r\n return this._valueWindow.slice() as [number, number];\r\n }\r\n\r\n /**\r\n * @return {Array.}\r\n */\r\n getDataPercentWindow() {\r\n return this._percentWindow.slice() as [number, number];\r\n }\r\n\r\n getTargetSeriesModels() {\r\n const seriesModels: SeriesModel[] = [];\r\n\r\n this.ecModel.eachSeries(function (seriesModel) {\r\n if (isCoordSupported(seriesModel)) {\r\n const axisMainType = getAxisMainType(this._dimName);\r\n const axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\r\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\r\n seriesModels.push(seriesModel);\r\n }\r\n }\r\n }, this);\r\n\r\n return seriesModels;\r\n }\r\n\r\n getAxisModel(): AxisBaseModel {\r\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex) as AxisBaseModel;\r\n }\r\n\r\n getMinMaxSpan() {\r\n return zrUtil.clone(this._minMaxSpan);\r\n }\r\n\r\n /**\r\n * Only calculate by given range and this._dataExtent, do not change anything.\r\n */\r\n calculateDataWindow(opt?: {\r\n start?: number\r\n end?: number\r\n startValue?: number | string | Date\r\n endValue?: number | string | Date\r\n }) {\r\n const dataExtent = this._dataExtent;\r\n const axisModel = this.getAxisModel();\r\n const scale = axisModel.axis.scale;\r\n const rangePropMode = this._dataZoomModel.getRangePropMode();\r\n const percentExtent = [0, 100];\r\n const percentWindow = [] as unknown as [number, number];\r\n const valueWindow = [] as unknown as [number, number];\r\n let hasPropModeValue;\r\n\r\n each(['start', 'end'] as const, function (prop, idx) {\r\n let boundPercent = opt[prop];\r\n let boundValue = opt[prop + 'Value' as 'startValue' | 'endValue'];\r\n\r\n // Notice: dataZoom is based either on `percentProp` ('start', 'end') or\r\n // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\r\n // but not min/max of axis, which will be calculated by data window then).\r\n // The former one is suitable for cases that a dataZoom component controls multiple\r\n // axes with different unit or extent, and the latter one is suitable for accurate\r\n // zoom by pixel (e.g., in dataZoomSelect).\r\n // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\r\n // only when setOption or dispatchAction, otherwise it remains its original value.\r\n // (Why not only record `percentProp` and always map to `valueProp`? Because\r\n // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\r\n // `valueProp`. consider two axes constrolled by one dataZoom. They have different\r\n // data extent. All of values that are overflow the `dataExtent` will be calculated\r\n // to percent '100%').\r\n\r\n if (rangePropMode[idx] === 'percent') {\r\n boundPercent == null && (boundPercent = percentExtent[idx]);\r\n // Use scale.parse to math round for category or time axis.\r\n boundValue = scale.parse(numberUtil.linearMap(\r\n boundPercent, percentExtent, dataExtent\r\n ));\r\n }\r\n else {\r\n hasPropModeValue = true;\r\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);\r\n // Calculating `percent` from `value` may be not accurate, because\r\n // This calculation can not be inversed, because all of values that\r\n // are overflow the `dataExtent` will be calculated to percent '100%'\r\n boundPercent = numberUtil.linearMap(\r\n boundValue, dataExtent, percentExtent\r\n );\r\n }\r\n\r\n // valueWindow[idx] = round(boundValue);\r\n // percentWindow[idx] = round(boundPercent);\r\n // fallback to extent start/end when parsed value or percent is invalid\r\n valueWindow[idx] = boundValue == null || isNaN(boundValue)\r\n ? dataExtent[idx]\r\n : boundValue;\r\n percentWindow[idx] = boundPercent == null || isNaN(boundPercent)\r\n ? percentExtent[idx]\r\n : boundPercent;\r\n });\r\n\r\n asc(valueWindow);\r\n asc(percentWindow);\r\n\r\n // The windows from user calling of `dispatchAction` might be out of the extent,\r\n // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window\r\n // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\r\n // where API is able to initialize/modify the window size even though `zoomLock`\r\n // specified.\r\n const spans = this._minMaxSpan;\r\n hasPropModeValue\r\n ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false)\r\n : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\r\n\r\n function restrictSet(\r\n fromWindow: number[],\r\n toWindow: number[],\r\n fromExtent: number[],\r\n toExtent: number[],\r\n toValue: boolean\r\n ) {\r\n const suffix = toValue ? 'Span' : 'ValueSpan';\r\n sliderMove(\r\n 0, fromWindow, fromExtent, 'all',\r\n spans['min' + suffix as 'minSpan' | 'minValueSpan'],\r\n spans['max' + suffix as 'maxSpan' | 'maxValueSpan']\r\n );\r\n for (let i = 0; i < 2; i++) {\r\n toWindow[i] = numberUtil.linearMap(fromWindow[i], fromExtent, toExtent, true);\r\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\r\n }\r\n }\r\n\r\n return {\r\n valueWindow: valueWindow,\r\n percentWindow: percentWindow\r\n };\r\n }\r\n\r\n /**\r\n * Notice: reset should not be called before series.restoreData() is called,\r\n * so it is recommended to be called in \"process stage\" but not \"model init\r\n * stage\".\r\n */\r\n reset(dataZoomModel: DataZoomModel) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n\r\n const targetSeries = this.getTargetSeriesModels();\r\n // Culculate data window and data extent, and record them.\r\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);\r\n\r\n // `calculateDataWindow` uses min/maxSpan.\r\n this._updateMinMaxSpan();\r\n\r\n const dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\r\n\r\n this._valueWindow = dataWindow.valueWindow;\r\n this._percentWindow = dataWindow.percentWindow;\r\n\r\n // Update axis setting then.\r\n this._setAxisModel();\r\n }\r\n\r\n filterData(dataZoomModel: DataZoomModel, api: ExtensionAPI) {\r\n if (dataZoomModel !== this._dataZoomModel) {\r\n return;\r\n }\r\n\r\n const axisDim = this._dimName;\r\n const seriesModels = this.getTargetSeriesModels();\r\n const filterMode = dataZoomModel.get('filterMode');\r\n const valueWindow = this._valueWindow;\r\n\r\n if (filterMode === 'none') {\r\n return;\r\n }\r\n\r\n // FIXME\r\n // Toolbox may has dataZoom injected. And if there are stacked bar chart\r\n // with NaN data, NaN will be filtered and stack will be wrong.\r\n // So we need to force the mode to be set empty.\r\n // In fect, it is not a big deal that do not support filterMode-'filter'\r\n // when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\r\n // selection\" some day, which might need \"adapt to data extent on the\r\n // otherAxis\", which is disabled by filterMode-'empty'.\r\n // But currently, stack has been fixed to based on value but not index,\r\n // so this is not an issue any more.\r\n // let otherAxisModel = this.getOtherAxisModel();\r\n // if (dataZoomModel.get('$fromToolbox')\r\n // && otherAxisModel\r\n // && otherAxisModel.hasSeriesStacked\r\n // ) {\r\n // filterMode = 'empty';\r\n // }\r\n\r\n // TODO\r\n // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\r\n\r\n each(seriesModels, function (seriesModel) {\r\n let seriesData = seriesModel.getData();\r\n const dataDims = seriesData.mapDimensionsAll(axisDim);\r\n\r\n if (!dataDims.length) {\r\n return;\r\n }\r\n\r\n if (filterMode === 'weakFilter') {\r\n const store = seriesData.getStore();\r\n const dataDimIndices = zrUtil.map(dataDims, dim => seriesData.getDimensionIndex(dim), seriesData);\r\n seriesData.filterSelf(function (dataIndex) {\r\n let leftOut;\r\n let rightOut;\r\n let hasValue;\r\n for (let i = 0; i < dataDims.length; i++) {\r\n const value = store.get(dataDimIndices[i], dataIndex) as number;\r\n const thisHasValue = !isNaN(value);\r\n const thisLeftOut = value < valueWindow[0];\r\n const thisRightOut = value > valueWindow[1];\r\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\r\n return true;\r\n }\r\n thisHasValue && (hasValue = true);\r\n thisLeftOut && (leftOut = true);\r\n thisRightOut && (rightOut = true);\r\n }\r\n // If both left out and right out, do not filter.\r\n return hasValue && leftOut && rightOut;\r\n });\r\n }\r\n else {\r\n each(dataDims, function (dim) {\r\n if (filterMode === 'empty') {\r\n seriesModel.setData(\r\n seriesData = seriesData.map(dim, function (value: number) {\r\n return !isInWindow(value) ? NaN : value;\r\n })\r\n );\r\n }\r\n else {\r\n const range: Dictionary<[number, number]> = {};\r\n range[dim] = valueWindow;\r\n\r\n // console.time('select');\r\n seriesData.selectRange(range);\r\n // console.timeEnd('select');\r\n }\r\n });\r\n }\r\n\r\n each(dataDims, function (dim) {\r\n seriesData.setApproximateExtent(valueWindow, dim);\r\n });\r\n });\r\n\r\n function isInWindow(value: number) {\r\n return value >= valueWindow[0] && value <= valueWindow[1];\r\n }\r\n }\r\n\r\n private _updateMinMaxSpan() {\r\n const minMaxSpan = this._minMaxSpan = {} as MinMaxSpan;\r\n const dataZoomModel = this._dataZoomModel;\r\n const dataExtent = this._dataExtent;\r\n\r\n each(['min', 'max'], function (minMax) {\r\n let percentSpan = dataZoomModel.get(minMax + 'Span' as 'minSpan' | 'maxSpan');\r\n let valueSpan = dataZoomModel.get(minMax + 'ValueSpan' as 'minValueSpan' | 'maxValueSpan');\r\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));\r\n\r\n // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\r\n if (valueSpan != null) {\r\n percentSpan = numberUtil.linearMap(\r\n dataExtent[0] + valueSpan, dataExtent, [0, 100], true\r\n );\r\n }\r\n else if (percentSpan != null) {\r\n valueSpan = numberUtil.linearMap(\r\n percentSpan, [0, 100], dataExtent, true\r\n ) - dataExtent[0];\r\n }\r\n\r\n minMaxSpan[minMax + 'Span' as 'minSpan' | 'maxSpan'] = percentSpan;\r\n minMaxSpan[minMax + 'ValueSpan' as 'minValueSpan' | 'maxValueSpan'] = valueSpan;\r\n }, this);\r\n }\r\n\r\n private _setAxisModel() {\r\n\r\n const axisModel = this.getAxisModel();\r\n\r\n const percentWindow = this._percentWindow;\r\n const valueWindow = this._valueWindow;\r\n\r\n if (!percentWindow) {\r\n return;\r\n }\r\n\r\n // [0, 500]: arbitrary value, guess axis extent.\r\n let precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);\r\n precision = Math.min(precision, 20);\r\n\r\n // For value axis, if min/max/scale are not set, we just use the extent obtained\r\n // by series data, which may be a little different from the extent calculated by\r\n // `axisHelper.getScaleExtent`. But the different just affects the experience a\r\n // little when zooming. So it will not be fixed until some users require it strongly.\r\n const rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\r\n if (percentWindow[0] !== 0) {\r\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\r\n }\r\n if (percentWindow[1] !== 100) {\r\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\r\n }\r\n rawExtentInfo.freeze();\r\n }\r\n}\r\n\r\nfunction calculateDataExtent(axisProxy: AxisProxy, axisDim: string, seriesModels: SeriesModel[]) {\r\n const dataExtent = [Infinity, -Infinity];\r\n\r\n each(seriesModels, function (seriesModel) {\r\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\r\n });\r\n\r\n // It is important to get \"consistent\" extent when more then one axes is\r\n // controlled by a `dataZoom`, otherwise those axes will not be synchronized\r\n // when zooming. But it is difficult to know what is \"consistent\", considering\r\n // axes have different type or even different meanings (For example, two\r\n // time axes are used to compare data of the same date in different years).\r\n // So basically dataZoom just obtains extent by series.data (in category axis\r\n // extent can be obtained from axis.data).\r\n // Nevertheless, user can set min/max/scale on axes to make extent of axes\r\n // consistent.\r\n const axisModel = axisProxy.getAxisModel();\r\n const rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\r\n\r\n return [rawExtentResult.min, rawExtentResult.max] as [number, number];\r\n}\r\n\r\nexport default AxisProxy;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {createHashMap, each} from 'zrender/src/core/util';\r\nimport SeriesModel from '../../model/Series';\r\nimport DataZoomModel, { DataZoomExtendedAxisBaseModel } from './DataZoomModel';\r\nimport { getAxisMainType, DataZoomAxisDimension } from './helper';\r\nimport AxisProxy from './AxisProxy';\r\nimport { StageHandler } from '../../util/types';\r\n\r\nconst dataZoomProcessor: StageHandler = {\r\n\r\n // `dataZoomProcessor` will only be performed in needed series. Consider if\r\n // there is a line series and a pie series, it is better not to update the\r\n // line series if only pie series is needed to be updated.\r\n getTargetSeries(ecModel) {\r\n\r\n function eachAxisModel(\r\n cb: (\r\n axisDim: DataZoomAxisDimension,\r\n axisIndex: number,\r\n axisModel: DataZoomExtendedAxisBaseModel,\r\n dataZoomModel: DataZoomModel\r\n ) => void\r\n ) {\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel: DataZoomModel) {\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n const axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\r\n cb(axisDim, axisIndex, axisModel as DataZoomExtendedAxisBaseModel, dataZoomModel);\r\n });\r\n });\r\n }\r\n // FIXME: it brings side-effect to `getTargetSeries`.\r\n // Prepare axis proxies.\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n // dispose all last axis proxy, in case that some axis are deleted.\r\n axisModel.__dzAxisProxy = null;\r\n });\r\n const proxyList: AxisProxy[] = [];\r\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\r\n // Different dataZooms may constrol the same axis. In that case,\r\n // an axisProxy serves both of them.\r\n if (!axisModel.__dzAxisProxy) {\r\n // Use the first dataZoomModel as the main model of axisProxy.\r\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\r\n proxyList.push(axisModel.__dzAxisProxy);\r\n }\r\n });\r\n\r\n const seriesModelMap = createHashMap();\r\n each(proxyList, function (axisProxy) {\r\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\r\n seriesModelMap.set(seriesModel.uid, seriesModel);\r\n });\r\n });\r\n\r\n return seriesModelMap;\r\n },\r\n\r\n // Consider appendData, where filter should be performed. Because data process is\r\n // in block mode currently, it is not need to worry about that the overallProgress\r\n // execute every frame.\r\n overallReset(ecModel, api) {\r\n\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel: DataZoomModel) {\r\n // We calculate window and reset axis here but not in model\r\n // init stage and not after action dispatch handler, because\r\n // reset should be called after seriesData.restoreData.\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\r\n });\r\n\r\n // Caution: data zoom filtering is order sensitive when using\r\n // percent range and no min/max/scale set on axis.\r\n // For example, we have dataZoom definition:\r\n // [\r\n // {xAxisIndex: 0, start: 30, end: 70},\r\n // {yAxisIndex: 0, start: 20, end: 80}\r\n // ]\r\n // In this case, [20, 80] of y-dataZoom should be based on data\r\n // that have filtered by x-dataZoom using range of [30, 70],\r\n // but should not be based on full raw data. Thus sliding\r\n // x-dataZoom will change both ranges of xAxis and yAxis,\r\n // while sliding y-dataZoom will only change the range of yAxis.\r\n // So we should filter x-axis after reset x-axis immediately,\r\n // and then reset y-axis and filter y-axis.\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\r\n });\r\n });\r\n\r\n ecModel.eachComponent('dataZoom', function (dataZoomModel: DataZoomModel) {\r\n // Fullfill all of the range props so that user\r\n // is able to get them from chart.getOption().\r\n const axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n if (axisProxy) {\r\n const percentRange = axisProxy.getDataPercentWindow();\r\n const valueRange = axisProxy.getDataValueWindow();\r\n\r\n dataZoomModel.setCalculatedRange({\r\n start: percentRange[0],\r\n end: percentRange[1],\r\n startValue: valueRange[0],\r\n endValue: valueRange[1]\r\n });\r\n }\r\n });\r\n }\r\n};\r\n\r\nexport default dataZoomProcessor;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../../model/Global';\r\nimport { findEffectedDataZooms } from './helper';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport { each } from 'zrender/src/core/util';\r\n\r\n\r\nexport default function installDataZoomAction(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerAction('dataZoom', function (payload, ecModel: GlobalModel) {\r\n\r\n const effectedModels = findEffectedDataZooms(ecModel, payload);\r\n\r\n each(effectedModels, function (dataZoomModel) {\r\n dataZoomModel.setRawRange({\r\n start: payload.start,\r\n end: payload.end,\r\n startValue: payload.startValue,\r\n endValue: payload.endValue\r\n });\r\n });\r\n\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport dataZoomProcessor from './dataZoomProcessor';\r\nimport installDataZoomAction from './dataZoomAction';\r\n\r\nlet installed = false;\r\nexport default function installCommon(registers: EChartsExtensionInstallRegisters) {\r\n if (installed) {\r\n return;\r\n }\r\n installed = true;\r\n\r\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor);\r\n\r\n installDataZoomAction(registers);\r\n\r\n registers.registerSubTypeDefaulter('dataZoom', function () {\r\n // Default 'slider' when no type specified.\r\n return 'slider';\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport SelectZoomModel from './SelectZoomModel';\r\nimport SelectZoomView from './SelectZoomView';\r\nimport installCommon from './installCommon';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerComponentModel(SelectZoomModel);\r\n registers.registerComponentView(SelectZoomView);\r\n\r\n installCommon(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport { Dictionary, DisplayState, ZRElementEvent, ItemStyleOption, LabelOption } from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\n// import * as graphic from '../../util/graphic';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\n\r\n// type IconPath = ReturnType;\r\n\r\ntype IconStyle = ItemStyleOption & {\r\n // TODO Move to a individual textStyle option\r\n textFill?: LabelOption['color']\r\n textBackgroundColor?: LabelOption['backgroundColor']\r\n textPosition?: LabelOption['position']\r\n textAlign?: LabelOption['align']\r\n textBorderRadius?: LabelOption['borderRadius']\r\n textPadding?: LabelOption['padding']\r\n textFontFamily?: LabelOption['fontFamily']\r\n textFontSize?: LabelOption['fontSize']\r\n textFontWeight?: LabelOption['fontWeight']\r\n textFontStyle?: LabelOption['fontStyle']\r\n};\r\nexport interface ToolboxFeatureOption {\r\n\r\n show?: boolean\r\n\r\n title?: string | Partial>\r\n\r\n icon?: string | Partial>\r\n\r\n iconStyle?: IconStyle\r\n emphasis?: {\r\n iconStyle?: IconStyle\r\n }\r\n\r\n iconStatus?: Partial>\r\n\r\n onclick?: () => void\r\n}\r\n\r\nexport interface ToolboxFeatureModel extends Model {\r\n\r\n /**\r\n * Collection of icon paths.\r\n * Will be injected during rendering in the view.\r\n */\r\n iconPaths: Partial>\r\n\r\n setIconStatus(iconName: string, status: DisplayState): void\r\n}\r\n\r\ninterface ToolboxFeature {\r\n getIcons?(): Dictionary\r\n\r\n onclick(ecModel: GlobalModel, api: ExtensionAPI, type: string, event: ZRElementEvent): void\r\n\r\n dispose?(ecModel: GlobalModel, api: ExtensionAPI): void\r\n remove?(ecModel: GlobalModel, api: ExtensionAPI): void\r\n\r\n render(featureModel: ToolboxFeatureModel, model: GlobalModel, api: ExtensionAPI, payload: unknown): void\r\n updateView?(featureModel: ToolboxFeatureModel, model: GlobalModel, api: ExtensionAPI, payload: unknown): void\r\n}\r\nabstract class ToolboxFeature {\r\n uid: string;\r\n\r\n model: ToolboxFeatureModel;\r\n ecModel: GlobalModel;\r\n api: ExtensionAPI;\r\n\r\n /**\r\n * If toolbox feature can't be used on some platform.\r\n */\r\n unusable?: boolean;\r\n}\r\n\r\nexport {ToolboxFeature};\r\n\r\nexport interface UserDefinedToolboxFeature {\r\n uid: string\r\n\r\n model: ToolboxFeatureModel\r\n ecModel: GlobalModel\r\n api: ExtensionAPI\r\n\r\n featureName?: string\r\n\r\n onclick(): void\r\n}\r\n\r\ntype ToolboxFeatureCtor = {\r\n new(): ToolboxFeature\r\n /**\r\n * Static defaultOption property\r\n */\r\n defaultOption?: ToolboxFeatureOption\r\n getDefaultOption?: (ecModel: GlobalModel) => ToolboxFeatureOption\r\n};\r\n\r\nconst features: Dictionary = {};\r\n\r\nexport function registerFeature(name: string, ctor: ToolboxFeatureCtor) {\r\n features[name] = ctor;\r\n}\r\n\r\nexport function getFeature(name: string) {\r\n return features[name];\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as featureManager from './featureManager';\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n LayoutOrient,\r\n ZRColor,\r\n BorderOptionMixin,\r\n ItemStyleOption,\r\n LabelOption,\r\n CommonTooltipOption,\r\n Dictionary\r\n} from '../../util/types';\r\n\r\n\r\nexport interface ToolboxTooltipFormatterParams {\r\n componentType: 'toolbox'\r\n name: string\r\n title: string\r\n $vars: ['name', 'title']\r\n}\r\nexport interface ToolboxOption extends ComponentOption,\r\n BoxLayoutOptionMixin,\r\n BorderOptionMixin {\r\n mainType?: 'toolbox'\r\n\r\n show?: boolean\r\n\r\n orient?: LayoutOrient\r\n\r\n backgroundColor?: ZRColor\r\n\r\n borderRadius?: number | number[]\r\n\r\n padding?: number | number[]\r\n\r\n itemSize?: number\r\n\r\n itemGap?: number\r\n\r\n showTitle?: boolean\r\n\r\n iconStyle?: ItemStyleOption\r\n\r\n emphasis?: {\r\n iconStyle?: ItemStyleOption\r\n }\r\n\r\n textStyle?: LabelOption\r\n\r\n tooltip?: CommonTooltipOption\r\n\r\n /**\r\n * Write all supported features in the final export option.\r\n */\r\n feature?: Partial>\r\n}\r\n\r\nclass ToolboxModel extends ComponentModel {\r\n\r\n static type = 'toolbox' as const;\r\n type = ToolboxModel.type;\r\n\r\n static layoutMode = {\r\n type: 'box',\r\n ignoreSize: true\r\n } as const;\r\n\r\n optionUpdated() {\r\n super.optionUpdated.apply(this, arguments as any);\r\n const {ecModel} = this;\r\n\r\n zrUtil.each(this.option.feature, function (featureOpt, featureName) {\r\n const Feature = featureManager.getFeature(featureName);\r\n if (Feature) {\r\n if (Feature.getDefaultOption) {\r\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\r\n }\r\n zrUtil.merge(featureOpt, Feature.defaultOption);\r\n }\r\n });\r\n }\r\n\r\n static defaultOption: ToolboxOption = {\r\n\r\n show: true,\r\n\r\n z: 6,\r\n\r\n // zlevel: 0,\r\n\r\n orient: 'horizontal',\r\n\r\n left: 'right',\r\n\r\n top: 'top',\r\n\r\n // right\r\n // bottom\r\n\r\n backgroundColor: 'transparent',\r\n\r\n borderColor: '#ccc',\r\n\r\n borderRadius: 0,\r\n\r\n borderWidth: 0,\r\n\r\n padding: 5,\r\n\r\n itemSize: 15,\r\n\r\n itemGap: 8,\r\n\r\n showTitle: true,\r\n\r\n iconStyle: {\r\n borderColor: '#666',\r\n color: 'none'\r\n },\r\n emphasis: {\r\n iconStyle: {\r\n borderColor: '#3E98C5'\r\n }\r\n },\r\n // textStyle: {},\r\n\r\n // feature\r\n\r\n tooltip: {\r\n show: false,\r\n position: 'bottom'\r\n }\r\n };\r\n}\r\n\r\nexport default ToolboxModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// @ts-nocheck\r\n\r\nimport {\r\n getLayoutRect,\r\n box as layoutBox,\r\n positionElement\r\n} from '../../util/layout';\r\nimport * as formatUtil from '../../util/format';\r\nimport * as graphic from '../../util/graphic';\r\n\r\n/**\r\n * Layout list like component.\r\n * It will box layout each items in group of component and then position the whole group in the viewport\r\n * @param {module:zrender/group/Group} group\r\n * @param {module:echarts/model/Component} componentModel\r\n * @param {module:echarts/ExtensionAPI}\r\n */\r\nexport function layout(group, componentModel, api) {\r\n const boxLayoutParams = componentModel.getBoxLayoutParams();\r\n const padding = componentModel.get('padding');\r\n const viewportSize = {width: api.getWidth(), height: api.getHeight()};\r\n\r\n const rect = getLayoutRect(\r\n boxLayoutParams,\r\n viewportSize,\r\n padding\r\n );\r\n\r\n layoutBox(\r\n componentModel.get('orient'),\r\n group,\r\n componentModel.get('itemGap'),\r\n rect.width,\r\n rect.height\r\n );\r\n\r\n positionElement(\r\n group,\r\n boxLayoutParams,\r\n viewportSize,\r\n padding\r\n );\r\n}\r\n\r\nexport function makeBackground(rect, componentModel) {\r\n const padding = formatUtil.normalizeCssArray(\r\n componentModel.get('padding')\r\n );\r\n const style = componentModel.getItemStyle(['color', 'opacity']);\r\n style.fill = componentModel.get('backgroundColor');\r\n rect = new graphic.Rect({\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[1] + padding[3],\r\n height: rect.height + padding[0] + padding[2],\r\n r: componentModel.get('borderRadius')\r\n },\r\n style: style,\r\n silent: true,\r\n z2: -1\r\n });\r\n // FIXME\r\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\r\n // and background rect when setting like `left: 0`, `top: 0`.\r\n // graphic.subPixelOptimizeRect(rect);\r\n\r\n return rect;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as textContain from 'zrender/src/contain/text';\r\nimport * as graphic from '../../util/graphic';\r\nimport { enterEmphasis, leaveEmphasis } from '../../util/states';\r\nimport Model from '../../model/Model';\r\nimport DataDiffer from '../../data/DataDiffer';\r\nimport * as listComponentHelper from '../helper/listComponent';\r\nimport ComponentView from '../../view/Component';\r\nimport ToolboxModel from './ToolboxModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { DisplayState, Dictionary, Payload } from '../../util/types';\r\nimport {\r\n ToolboxFeature,\r\n getFeature,\r\n ToolboxFeatureModel,\r\n ToolboxFeatureOption,\r\n UserDefinedToolboxFeature\r\n} from './featureManager';\r\nimport { getUID } from '../../util/component';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport ZRText from 'zrender/src/graphic/Text';\r\nimport { getFont } from '../../label/labelStyle';\r\n\r\ntype IconPath = ToolboxFeatureModel['iconPaths'][string];\r\n\r\ntype ExtendedPath = IconPath & {\r\n __title: string\r\n};\r\n\r\nclass ToolboxView extends ComponentView {\r\n static type = 'toolbox' as const;\r\n\r\n _features: Dictionary;\r\n\r\n _featureNames: string[];\r\n\r\n render(\r\n toolboxModel: ToolboxModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload & {\r\n newTitle?: ToolboxFeatureOption['title']\r\n }\r\n ) {\r\n const group = this.group;\r\n group.removeAll();\r\n\r\n if (!toolboxModel.get('show')) {\r\n return;\r\n }\r\n\r\n const itemSize = +toolboxModel.get('itemSize');\r\n const isVertical = toolboxModel.get('orient') === 'vertical';\r\n const featureOpts = toolboxModel.get('feature') || {};\r\n const features = this._features || (this._features = {});\r\n\r\n const featureNames: string[] = [];\r\n zrUtil.each(featureOpts, function (opt, name) {\r\n featureNames.push(name);\r\n });\r\n\r\n (new DataDiffer(this._featureNames || [], featureNames))\r\n .add(processFeature)\r\n .update(processFeature)\r\n .remove(zrUtil.curry(processFeature, null))\r\n .execute();\r\n\r\n // Keep for diff.\r\n this._featureNames = featureNames;\r\n\r\n function processFeature(newIndex: number, oldIndex?: number) {\r\n const featureName = featureNames[newIndex];\r\n const oldName = featureNames[oldIndex];\r\n const featureOpt = featureOpts[featureName];\r\n const featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel) as ToolboxFeatureModel;\r\n let feature: ToolboxFeature | UserDefinedToolboxFeature;\r\n\r\n // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\r\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\r\n featureOpt.title = payload.newTitle;\r\n }\r\n\r\n if (featureName && !oldName) { // Create\r\n if (isUserFeatureName(featureName)) {\r\n feature = {\r\n onclick: featureModel.option.onclick,\r\n featureName: featureName\r\n } as UserDefinedToolboxFeature;\r\n }\r\n else {\r\n const Feature = getFeature(featureName);\r\n if (!Feature) {\r\n return;\r\n }\r\n feature = new Feature();\r\n }\r\n features[featureName] = feature;\r\n }\r\n else {\r\n feature = features[oldName];\r\n // If feature does not exist.\r\n if (!feature) {\r\n return;\r\n }\r\n }\r\n feature.uid = getUID('toolbox-feature');\r\n feature.model = featureModel;\r\n feature.ecModel = ecModel;\r\n feature.api = api;\r\n\r\n const isToolboxFeature = feature instanceof ToolboxFeature;\r\n if (!featureName && oldName) {\r\n isToolboxFeature\r\n && (feature as ToolboxFeature).dispose\r\n && (feature as ToolboxFeature).dispose(ecModel, api);\r\n return;\r\n }\r\n\r\n if (!featureModel.get('show') || (isToolboxFeature && (feature as ToolboxFeature).unusable)) {\r\n isToolboxFeature\r\n && (feature as ToolboxFeature).remove\r\n && (feature as ToolboxFeature).remove(ecModel, api);\r\n return;\r\n }\r\n\r\n createIconPaths(featureModel, feature, featureName);\r\n\r\n featureModel.setIconStatus = function (this: ToolboxFeatureModel, iconName: string, status: DisplayState) {\r\n const option = this.option;\r\n const iconPaths = this.iconPaths;\r\n option.iconStatus = option.iconStatus || {};\r\n option.iconStatus[iconName] = status;\r\n if (iconPaths[iconName]) {\r\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\r\n }\r\n };\r\n\r\n if (feature instanceof ToolboxFeature) {\r\n if (feature.render) {\r\n feature.render(featureModel, ecModel, api, payload);\r\n }\r\n }\r\n }\r\n\r\n function createIconPaths(\r\n featureModel: ToolboxFeatureModel,\r\n feature: ToolboxFeature | UserDefinedToolboxFeature,\r\n featureName: string\r\n ) {\r\n const iconStyleModel = featureModel.getModel('iconStyle');\r\n const iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']);\r\n\r\n // If one feature has multiple icons, they are organized as\r\n // {\r\n // icon: {\r\n // foo: '',\r\n // bar: ''\r\n // },\r\n // title: {\r\n // foo: '',\r\n // bar: ''\r\n // }\r\n // }\r\n const icons = (feature instanceof ToolboxFeature && feature.getIcons)\r\n ? feature.getIcons() : featureModel.get('icon');\r\n const titles = featureModel.get('title') || {};\r\n let iconsMap: Dictionary;\r\n let titlesMap: Dictionary;\r\n if (zrUtil.isString(icons)) {\r\n iconsMap = {};\r\n iconsMap[featureName] = icons;\r\n }\r\n else {\r\n iconsMap = icons;\r\n }\r\n if (zrUtil.isString(titles)) {\r\n titlesMap = {};\r\n titlesMap[featureName] = titles as string;\r\n }\r\n else {\r\n titlesMap = titles;\r\n }\r\n const iconPaths: ToolboxFeatureModel['iconPaths'] = featureModel.iconPaths = {};\r\n zrUtil.each(iconsMap, function (iconStr, iconName) {\r\n const path = graphic.createIcon(\r\n iconStr,\r\n {},\r\n {\r\n x: -itemSize / 2,\r\n y: -itemSize / 2,\r\n width: itemSize,\r\n height: itemSize\r\n }\r\n ) as Displayable; // TODO handling image\r\n path.setStyle(iconStyleModel.getItemStyle());\r\n\r\n const pathEmphasisState = path.ensureState('emphasis');\r\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();\r\n\r\n // Text position calculation\r\n // TODO: extract `textStyle` from `iconStyle` and use `createTextStyle`\r\n const textContent = new ZRText({\r\n style: {\r\n text: titlesMap[iconName],\r\n align: iconStyleEmphasisModel.get('textAlign'),\r\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\r\n padding: iconStyleEmphasisModel.get('textPadding'),\r\n fill: null,\r\n font: getFont({\r\n fontStyle: iconStyleEmphasisModel.get('textFontStyle'),\r\n fontFamily: iconStyleEmphasisModel.get('textFontFamily'),\r\n fontSize: iconStyleEmphasisModel.get('textFontSize'),\r\n fontWeight: iconStyleEmphasisModel.get('textFontWeight')\r\n }, ecModel)\r\n },\r\n ignore: true\r\n });\r\n path.setTextContent(textContent);\r\n\r\n graphic.setTooltipConfig({\r\n el: path,\r\n componentModel: toolboxModel,\r\n itemName: iconName,\r\n formatterParamsExtra: {\r\n title: titlesMap[iconName]\r\n }\r\n });\r\n\r\n (path as ExtendedPath).__title = titlesMap[iconName];\r\n (path as graphic.Path).on('mouseover', function () {\r\n // Should not reuse above hoverStyle, which might be modified.\r\n const hoverStyle = iconStyleEmphasisModel.getItemStyle();\r\n const defaultTextPosition = isVertical\r\n ? (\r\n toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right'\r\n ? 'right' as const\r\n : 'left' as const\r\n )\r\n : (\r\n toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom'\r\n ? 'bottom' as const\r\n : 'top' as const\r\n );\r\n textContent.setStyle({\r\n fill: (iconStyleEmphasisModel.get('textFill')\r\n || hoverStyle.fill || hoverStyle.stroke || '#000') as string,\r\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\r\n });\r\n path.setTextConfig({\r\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\r\n });\r\n textContent.ignore = !toolboxModel.get('showTitle');\r\n\r\n // Use enterEmphasis and leaveEmphasis provide by ec.\r\n // There are flags managed by the echarts.\r\n api.enterEmphasis(this);\r\n })\r\n .on('mouseout', function () {\r\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\r\n api.leaveEmphasis(this);\r\n }\r\n textContent.hide();\r\n });\r\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\r\n\r\n group.add(path);\r\n (path as graphic.Path).on('click', zrUtil.bind(\r\n feature.onclick, feature, ecModel, api, iconName\r\n ));\r\n\r\n iconPaths[iconName] = path;\r\n });\r\n }\r\n\r\n listComponentHelper.layout(group, toolboxModel, api);\r\n // Render background after group is layout\r\n // FIXME\r\n group.add(listComponentHelper.makeBackground(group.getBoundingRect(), toolboxModel));\r\n\r\n // Adjust icon title positions to avoid them out of screen\r\n isVertical || group.eachChild(function (icon: IconPath) {\r\n const titleText = (icon as ExtendedPath).__title;\r\n // const hoverStyle = icon.hoverStyle;\r\n\r\n // TODO simplify code?\r\n const emphasisState = icon.ensureState('emphasis');\r\n const emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\r\n const textContent = icon.getTextContent();\r\n const emphasisTextState = textContent && textContent.ensureState('emphasis');\r\n // May be background element\r\n if (emphasisTextState && !zrUtil.isFunction(emphasisTextState) && titleText) {\r\n const emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\r\n const rect = textContain.getBoundingRect(\r\n titleText, ZRText.makeFont(emphasisTextStyle)\r\n );\r\n const offsetX = icon.x + group.x;\r\n const offsetY = icon.y + group.y + itemSize;\r\n\r\n let needPutOnTop = false;\r\n if (offsetY + rect.height > api.getHeight()) {\r\n emphasisTextConfig.position = 'top';\r\n needPutOnTop = true;\r\n }\r\n const topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 10);\r\n if (offsetX + rect.width / 2 > api.getWidth()) {\r\n emphasisTextConfig.position = ['100%', topOffset];\r\n emphasisTextStyle.align = 'right';\r\n }\r\n else if (offsetX - rect.width / 2 < 0) {\r\n emphasisTextConfig.position = [0, topOffset];\r\n emphasisTextStyle.align = 'left';\r\n }\r\n }\r\n });\r\n }\r\n\r\n updateView(\r\n toolboxModel: ToolboxModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: unknown\r\n ) {\r\n zrUtil.each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\r\n });\r\n }\r\n\r\n // updateLayout(toolboxModel, ecModel, api, payload) {\r\n // zrUtil.each(this._features, function (feature) {\r\n // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\r\n // });\r\n // },\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n zrUtil.each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.remove && feature.remove(ecModel, api);\r\n });\r\n this.group.removeAll();\r\n }\r\n\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI) {\r\n zrUtil.each(this._features, function (feature) {\r\n feature instanceof ToolboxFeature\r\n && feature.dispose && feature.dispose(ecModel, api);\r\n });\r\n }\r\n}\r\n\r\n\r\nfunction isUserFeatureName(featureName: string): boolean {\r\n return featureName.indexOf('my') === 0;\r\n}\r\nexport default ToolboxView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/* global window, Uint8Array, document */\r\n\r\nimport env from 'zrender/src/core/env';\r\nimport { ToolboxFeature, ToolboxFeatureOption } from '../featureManager';\r\nimport { ZRColor } from '../../../util/types';\r\nimport GlobalModel from '../../../model/Global';\r\nimport ExtensionAPI from '../../../core/ExtensionAPI';\r\n\r\nexport interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption {\r\n icon?: string\r\n title?: string\r\n type?: 'png' | 'jpeg'\r\n\r\n backgroundColor?: ZRColor\r\n connectedBackgroundColor?: ZRColor\r\n\r\n name?: string\r\n excludeComponents?: string[]\r\n\r\n pixelRatio?: number\r\n\r\n lang?: string[]\r\n}\r\n\r\nclass SaveAsImage extends ToolboxFeature {\r\n\r\n onclick(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const model = this.model;\r\n const title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\r\n const isSvg = api.getZr().painter.getType() === 'svg';\r\n const type = isSvg ? 'svg' : model.get('type', true) || 'png';\r\n const url = api.getConnectedDataURL({\r\n type: type,\r\n backgroundColor: model.get('backgroundColor', true)\r\n || ecModel.get('backgroundColor') || '#fff',\r\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\r\n excludeComponents: model.get('excludeComponents'),\r\n pixelRatio: model.get('pixelRatio')\r\n });\r\n const browser = env.browser;\r\n // Chrome, Firefox, New Edge\r\n if (typeof MouseEvent === 'function' && (browser.newEdge || (!browser.ie && !browser.edge))) {\r\n const $a = document.createElement('a');\r\n $a.download = title + '.' + type;\r\n $a.target = '_blank';\r\n $a.href = url;\r\n const evt = new MouseEvent('click', {\r\n // some micro front-end framework\uFF0C window maybe is a Proxy\r\n view: document.defaultView,\r\n bubbles: true,\r\n cancelable: false\r\n });\r\n $a.dispatchEvent(evt);\r\n }\r\n // IE or old Edge\r\n else {\r\n // @ts-ignore\r\n if (window.navigator.msSaveOrOpenBlob || isSvg) {\r\n const parts = url.split(',');\r\n // data:[][;charset=][;base64],\r\n const base64Encoded = parts[0].indexOf('base64') > -1;\r\n let bstr = isSvg\r\n // should decode the svg data uri first\r\n ? decodeURIComponent(parts[1])\r\n : parts[1];\r\n // only `atob` when the data uri is encoded with base64\r\n // otherwise, like `svg` data uri exported by zrender,\r\n // there will be an error, for it's not encoded with base64.\r\n // (just a url-encoded string through `encodeURIComponent`)\r\n base64Encoded && (bstr = window.atob(bstr));\r\n const filename = title + '.' + type;\r\n // @ts-ignore\r\n if (window.navigator.msSaveOrOpenBlob) {\r\n let n = bstr.length;\r\n const u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n const blob = new Blob([u8arr]);// @ts-ignore\r\n window.navigator.msSaveOrOpenBlob(blob, filename);\r\n }\r\n else {\r\n const frame = document.createElement('iframe');\r\n document.body.appendChild(frame);\r\n const cw = frame.contentWindow;\r\n const doc = cw.document;\r\n doc.open('image/svg+xml', 'replace');\r\n doc.write(bstr);\r\n doc.close();\r\n cw.focus();\r\n doc.execCommand('SaveAs', true, filename);\r\n document.body.removeChild(frame);\r\n }\r\n }\r\n else {\r\n const lang = model.get('lang');\r\n const html = ''\r\n + ''\r\n + ''\r\n + '';\r\n const tab = window.open();\r\n tab.document.write(html);\r\n tab.document.title = title as string;\r\n }\r\n }\r\n }\r\n\r\n static getDefaultOption(ecModel: GlobalModel) {\r\n const defaultOption: ToolboxSaveAsImageFeatureOption = {\r\n show: true,\r\n icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',\r\n title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']),\r\n type: 'png',\r\n // Default use option.backgroundColor\r\n // backgroundColor: '#fff',\r\n connectedBackgroundColor: '#fff',\r\n name: '',\r\n excludeComponents: ['toolbox'],\r\n // use current pixel ratio of device by default\r\n // pixelRatio: 1,\r\n lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang'])\r\n };\r\n\r\n return defaultOption;\r\n }\r\n}\r\n\r\nexport default SaveAsImage;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as echarts from '../../../core/echarts';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {ToolboxFeature, ToolboxFeatureOption, ToolboxFeatureModel} from '../featureManager';\r\nimport { SeriesOption, ECUnitOption } from '../../../util/types';\r\nimport GlobalModel from '../../../model/Global';\r\nimport ExtensionAPI from '../../../core/ExtensionAPI';\r\nimport SeriesModel from '../../../model/Series';\r\nimport { SINGLE_REFERRING } from '../../../util/model';\r\n\r\nconst INNER_STACK_KEYWORD = '__ec_magicType_stack__' as const;\r\n\r\nconst ICON_TYPES = ['line', 'bar', 'stack'] as const;\r\n// stack and tiled appears in pair for the title\r\nconst TITLE_TYPES = ['line', 'bar', 'stack', 'tiled'] as const;\r\n\r\nconst radioTypes = [\r\n ['line', 'bar'],\r\n ['stack']\r\n] as const;\r\n\r\ntype IconType = typeof ICON_TYPES[number];\r\ntype TitleType = typeof TITLE_TYPES[number];\r\n\r\nexport interface ToolboxMagicTypeFeatureOption extends ToolboxFeatureOption {\r\n type?: IconType[]\r\n /**\r\n * Icon group\r\n */\r\n icon?: {[key in IconType]?: string}\r\n title?: {[key in TitleType]?: string}\r\n\r\n // TODO LineSeriesOption, BarSeriesOption\r\n option?: {[key in IconType]?: SeriesOption}\r\n\r\n /**\r\n * Map of seriesType: seriesIndex\r\n */\r\n seriesIndex?: {\r\n line?: number\r\n bar?: number\r\n }\r\n}\r\n\r\n\r\nclass MagicType extends ToolboxFeature {\r\n\r\n getIcons() {\r\n const model = this.model;\r\n const availableIcons = model.get('icon');\r\n const icons: ToolboxMagicTypeFeatureOption['icon'] = {};\r\n zrUtil.each(model.get('type'), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n }\r\n\r\n static getDefaultOption(ecModel: GlobalModel) {\r\n const defaultOption: ToolboxMagicTypeFeatureOption = {\r\n show: true,\r\n type: [],\r\n // Icon group\r\n icon: {\r\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\r\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\r\n // eslint-disable-next-line\r\n stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z' // jshint ignore:line\r\n },\r\n // `line`, `bar`, `stack`, `tiled`\r\n title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']),\r\n option: {},\r\n seriesIndex: {}\r\n };\r\n\r\n return defaultOption;\r\n }\r\n\r\n onclick(ecModel: GlobalModel, api: ExtensionAPI, type: IconType) {\r\n const model = this.model;\r\n const seriesIndex = model.get(['seriesIndex', type as 'line' | 'bar']);\r\n // Not supported magicType\r\n if (!seriesOptGenreator[type]) {\r\n return;\r\n }\r\n const newOption: ECUnitOption = {\r\n series: []\r\n };\r\n const generateNewSeriesTypes = function (seriesModel: SeriesModel) {\r\n const seriesType = seriesModel.subType;\r\n const seriesId = seriesModel.id;\r\n const newSeriesOpt = seriesOptGenreator[type](\r\n seriesType, seriesId, seriesModel, model\r\n );\r\n if (newSeriesOpt) {\r\n // PENDING If merge original option?\r\n zrUtil.defaults(newSeriesOpt, seriesModel.option);\r\n (newOption.series as SeriesOption[]).push(newSeriesOpt);\r\n }\r\n // Modify boundaryGap\r\n const coordSys = seriesModel.coordinateSystem;\r\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\r\n const categoryAxis = coordSys.getAxesByScale('ordinal')[0];\r\n if (categoryAxis) {\r\n const axisDim = categoryAxis.dim;\r\n const axisType = axisDim + 'Axis';\r\n const axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\r\n const axisIndex = axisModel.componentIndex;\r\n\r\n newOption[axisType] = newOption[axisType] || [];\r\n for (let i = 0; i <= axisIndex; i++) {\r\n (newOption[axisType] as any)[axisIndex] = (newOption[axisType] as any)[axisIndex] || {};\r\n }\r\n (newOption[axisType] as any)[axisIndex].boundaryGap = type === 'bar';\r\n }\r\n }\r\n };\r\n\r\n zrUtil.each(radioTypes, function (radio) {\r\n if (zrUtil.indexOf(radio, type) >= 0) {\r\n zrUtil.each(radio, function (item) {\r\n model.setIconStatus(item, 'normal');\r\n });\r\n }\r\n });\r\n\r\n model.setIconStatus(type, 'emphasis');\r\n\r\n ecModel.eachComponent(\r\n {\r\n mainType: 'series',\r\n query: seriesIndex == null ? null : {\r\n seriesIndex: seriesIndex\r\n }\r\n }, generateNewSeriesTypes\r\n );\r\n\r\n let newTitle;\r\n let currentType = type as TitleType;\r\n // Change title of stack\r\n if (type === 'stack') {\r\n // use titles in model instead of ecModel\r\n // as stack and tiled appears in pair, just flip them\r\n // no need of checking stack state\r\n newTitle = zrUtil.merge({\r\n stack: model.option.title.tiled,\r\n tiled: model.option.title.stack\r\n }, model.option.title);\r\n\r\n if (model.get(['iconStatus', type]) !== 'emphasis') {\r\n currentType = 'tiled';\r\n }\r\n }\r\n\r\n api.dispatchAction({\r\n type: 'changeMagicType',\r\n currentType: currentType,\r\n newOption: newOption,\r\n newTitle: newTitle,\r\n featureName: 'magicType'\r\n });\r\n }\r\n}\r\n\r\ntype MegicTypeSeriesOption = SeriesOption & {\r\n // TODO: TYPE More specified series option\r\n stack?: boolean | string\r\n data?: unknown[]\r\n markPoint?: unknown\r\n markLine?: unknown\r\n};\r\n\r\ntype SeriesOptGenreator = (\r\n seriesType: string,\r\n seriesId: string,\r\n seriesModel: SeriesModel,\r\n model: ToolboxFeatureModel\r\n) => SeriesOption;\r\n\r\nconst seriesOptGenreator: Record = {\r\n 'line': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'bar') {\r\n return zrUtil.merge({\r\n id: seriesId,\r\n type: 'line',\r\n // Preserve data related option\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'line']) || {}, true);\r\n }\r\n },\r\n 'bar': function (seriesType, seriesId, seriesModel, model) {\r\n if (seriesType === 'line') {\r\n return zrUtil.merge({\r\n id: seriesId,\r\n type: 'bar',\r\n // Preserve data related option\r\n data: seriesModel.get('data'),\r\n stack: seriesModel.get('stack'),\r\n markPoint: seriesModel.get('markPoint'),\r\n markLine: seriesModel.get('markLine')\r\n }, model.get(['option', 'bar']) || {}, true);\r\n }\r\n },\r\n 'stack': function (seriesType, seriesId, seriesModel, model) {\r\n const isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\r\n if (seriesType === 'line' || seriesType === 'bar') {\r\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\r\n return zrUtil.merge({\r\n id: seriesId,\r\n stack: isStack ? '' : INNER_STACK_KEYWORD\r\n }, model.get(['option', 'stack']) || {}, true);\r\n }\r\n }\r\n};\r\n\r\n\r\n// TODO: SELF REGISTERED.\r\necharts.registerAction({\r\n type: 'changeMagicType',\r\n event: 'magicTypeChanged',\r\n update: 'prepareAndUpdate'\r\n}, function (payload, ecModel) {\r\n ecModel.mergeOption(payload.newOption);\r\n});\r\n\r\nexport default MagicType;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/* global document */\r\n\r\nimport * as echarts from '../../../core/echarts';\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GlobalModel from '../../../model/Global';\r\nimport SeriesModel from '../../../model/Series';\r\nimport { ToolboxFeature, ToolboxFeatureOption } from '../featureManager';\r\nimport { ColorString, ECUnitOption, SeriesOption, Payload, Dictionary } from '../../../util/types';\r\nimport ExtensionAPI from '../../../core/ExtensionAPI';\r\nimport { addEventListener } from 'zrender/src/core/event';\r\nimport Axis from '../../../coord/Axis';\r\nimport Cartesian2D from '../../../coord/cartesian/Cartesian2D';\r\nimport { warn } from '../../../util/log';\r\n\r\n/* global document */\r\n\r\nconst BLOCK_SPLITER = new Array(60).join('-');\r\nconst ITEM_SPLITER = '\\t';\r\n\r\ntype DataItem = {\r\n name: string\r\n value: number[] | number\r\n};\r\n\r\ntype DataList = (DataItem | number | number[])[];\r\n\r\ninterface ChangeDataViewPayload extends Payload {\r\n newOption: {\r\n series: SeriesOption[]\r\n }\r\n}\r\n\r\ninterface SeriesGroupMeta {\r\n axisDim: string\r\n axisIndex: number\r\n}\r\n\r\ninterface SeriesGroup {\r\n series: SeriesModel[]\r\n categoryAxis: Axis\r\n valueAxis: Axis\r\n}\r\n\r\n/**\r\n * Group series into two types\r\n * 1. on category axis, like line, bar\r\n * 2. others, like scatter, pie\r\n */\r\nfunction groupSeries(ecModel: GlobalModel) {\r\n const seriesGroupByCategoryAxis: Dictionary = {};\r\n const otherSeries: SeriesModel[] = [];\r\n const meta: SeriesGroupMeta[] = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n\r\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\r\n // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.\r\n const baseAxis = (coordSys as Cartesian2D).getBaseAxis();\r\n if (baseAxis.type === 'category') {\r\n const key = baseAxis.dim + '_' + baseAxis.index;\r\n if (!seriesGroupByCategoryAxis[key]) {\r\n seriesGroupByCategoryAxis[key] = {\r\n categoryAxis: baseAxis,\r\n valueAxis: coordSys.getOtherAxis(baseAxis),\r\n series: []\r\n };\r\n meta.push({\r\n axisDim: baseAxis.dim,\r\n axisIndex: baseAxis.index\r\n });\r\n }\r\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n }\r\n else {\r\n otherSeries.push(seriesModel);\r\n }\r\n });\r\n\r\n return {\r\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\r\n other: otherSeries,\r\n meta: meta\r\n };\r\n}\r\n\r\n/**\r\n * Assemble content of series on cateogory axis\r\n * @inner\r\n */\r\nfunction assembleSeriesWithCategoryAxis(groups: Dictionary): string {\r\n const tables: string[] = [];\r\n zrUtil.each(groups, function (group, key) {\r\n const categoryAxis = group.categoryAxis;\r\n const valueAxis = group.valueAxis;\r\n const valueAxisDim = valueAxis.dim;\r\n\r\n const headers = [' '].concat(zrUtil.map(group.series, function (series) {\r\n return series.name;\r\n }));\r\n // @ts-ignore TODO Polar\r\n const columns = [categoryAxis.model.getCategories()];\r\n zrUtil.each(group.series, function (series) {\r\n const rawData = series.getRawData();\r\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\r\n return val;\r\n }));\r\n });\r\n // Assemble table content\r\n const lines = [headers.join(ITEM_SPLITER)];\r\n for (let i = 0; i < columns[0].length; i++) {\r\n const items = [];\r\n for (let j = 0; j < columns.length; j++) {\r\n items.push(columns[j][i]);\r\n }\r\n lines.push(items.join(ITEM_SPLITER));\r\n }\r\n tables.push(lines.join('\\n'));\r\n });\r\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n}\r\n\r\n/**\r\n * Assemble content of other series\r\n */\r\nfunction assembleOtherSeries(series: SeriesModel[]) {\r\n return zrUtil.map(series, function (series) {\r\n const data = series.getRawData();\r\n const lines = [series.name];\r\n const vals: string[] = [];\r\n data.each(data.dimensions, function () {\r\n const argLen = arguments.length;\r\n const dataIndex = arguments[argLen - 1];\r\n const name = data.getName(dataIndex);\r\n for (let i = 0; i < argLen - 1; i++) {\r\n vals[i] = arguments[i];\r\n }\r\n lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));\r\n });\r\n return lines.join('\\n');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\r\n}\r\n\r\nfunction getContentFromModel(ecModel: GlobalModel) {\r\n\r\n const result = groupSeries(ecModel);\r\n\r\n return {\r\n value: zrUtil.filter([\r\n assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),\r\n assembleOtherSeries(result.other)\r\n ], function (str) {\r\n return !!str.replace(/[\\n\\t\\s]/g, '');\r\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\r\n\r\n meta: result.meta\r\n };\r\n}\r\n\r\n\r\nfunction trim(str: string) {\r\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n}\r\n/**\r\n * If a block is tsv format\r\n */\r\nfunction isTSVFormat(block: string): boolean {\r\n // Simple method to find out if a block is tsv format\r\n const firstLine = block.slice(0, block.indexOf('\\n'));\r\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\r\n return true;\r\n }\r\n}\r\n\r\nconst itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\r\n/**\r\n * @param {string} tsv\r\n * @return {Object}\r\n */\r\nfunction parseTSVContents(tsv: string) {\r\n const tsvLines = tsv.split(/\\n+/g);\r\n const headers = trim(tsvLines.shift()).split(itemSplitRegex);\r\n\r\n const categories: string[] = [];\r\n const series: {name: string, data: string[]}[] = zrUtil.map(headers, function (header) {\r\n return {\r\n name: header,\r\n data: []\r\n };\r\n });\r\n for (let i = 0; i < tsvLines.length; i++) {\r\n const items = trim(tsvLines[i]).split(itemSplitRegex);\r\n categories.push(items.shift());\r\n for (let j = 0; j < items.length; j++) {\r\n series[j] && (series[j].data[i] = items[j]);\r\n }\r\n }\r\n return {\r\n series: series,\r\n categories: categories\r\n };\r\n}\r\n\r\nfunction parseListContents(str: string) {\r\n const lines = str.split(/\\n+/g);\r\n const seriesName = trim(lines.shift());\r\n\r\n const data: DataList = [];\r\n for (let i = 0; i < lines.length; i++) {\r\n // if line is empty, ignore it.\r\n // there is a case that a user forgot to delete `\\n`.\r\n const line = trim(lines[i]);\r\n if (!line) {\r\n continue;\r\n }\r\n let items = line.split(itemSplitRegex);\r\n\r\n let name = '';\r\n let value: number[];\r\n let hasName = false;\r\n if (isNaN(items[0] as unknown as number)) { // First item is name\r\n hasName = true;\r\n name = items[0];\r\n items = items.slice(1);\r\n data[i] = {\r\n name: name,\r\n value: []\r\n };\r\n value = (data[i] as DataItem).value as number[];\r\n }\r\n else {\r\n value = data[i] = [];\r\n }\r\n for (let j = 0; j < items.length; j++) {\r\n value.push(+items[j]);\r\n }\r\n if (value.length === 1) {\r\n hasName ? ((data[i] as DataItem).value = value[0]) : (data[i] = value[0]);\r\n }\r\n }\r\n\r\n return {\r\n name: seriesName,\r\n data: data\r\n };\r\n}\r\n\r\nfunction parseContents(str: string, blockMetaList: SeriesGroupMeta[]) {\r\n const blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\r\n const newOption: ECUnitOption = {\r\n series: []\r\n };\r\n zrUtil.each(blocks, function (block, idx) {\r\n if (isTSVFormat(block)) {\r\n const result = parseTSVContents(block);\r\n const blockMeta = blockMetaList[idx];\r\n const axisKey = blockMeta.axisDim + 'Axis';\r\n\r\n if (blockMeta) {\r\n newOption[axisKey] = newOption[axisKey] || [];\r\n (newOption[axisKey] as any)[blockMeta.axisIndex] = {\r\n data: result.categories\r\n };\r\n newOption.series = (newOption.series as SeriesOption[]).concat(result.series);\r\n }\r\n }\r\n else {\r\n const result = parseListContents(block);\r\n (newOption.series as SeriesOption[]).push(result);\r\n }\r\n });\r\n return newOption;\r\n}\r\n\r\nexport interface ToolboxDataViewFeatureOption extends ToolboxFeatureOption {\r\n readOnly?: boolean\r\n\r\n optionToContent?: (option: ECUnitOption) => string | HTMLElement\r\n contentToOption?: (viewMain: HTMLDivElement, oldOption: ECUnitOption) => ECUnitOption\r\n\r\n icon?: string\r\n title?: string\r\n lang?: string[]\r\n\r\n backgroundColor?: ColorString\r\n\r\n textColor?: ColorString\r\n textareaColor?: ColorString\r\n textareaBorderColor?: ColorString\r\n\r\n buttonColor?: ColorString\r\n buttonTextColor?: ColorString\r\n}\r\n\r\nclass DataView extends ToolboxFeature {\r\n\r\n private _dom: HTMLDivElement;\r\n\r\n onclick(ecModel: GlobalModel, api: ExtensionAPI) {\r\n // FIXME: better way?\r\n setTimeout(() => {\r\n api.dispatchAction({\r\n type: 'hideTip'\r\n });\r\n });\r\n\r\n const container = api.getDom();\r\n const model = this.model;\r\n if (this._dom) {\r\n container.removeChild(this._dom);\r\n }\r\n const root = document.createElement('div');\r\n // use padding to avoid 5px whitespace\r\n root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px';\r\n root.style.backgroundColor = model.get('backgroundColor') || '#fff';\r\n\r\n // Create elements\r\n const header = document.createElement('h4');\r\n const lang = model.get('lang') || [];\r\n header.innerHTML = lang[0] || model.get('title');\r\n header.style.cssText = 'margin:10px 20px';\r\n header.style.color = model.get('textColor');\r\n\r\n const viewMain = document.createElement('div');\r\n const textarea = document.createElement('textarea');\r\n viewMain.style.cssText = 'overflow:auto';\r\n\r\n const optionToContent = model.get('optionToContent');\r\n const contentToOption = model.get('contentToOption');\r\n const result = getContentFromModel(ecModel);\r\n if (zrUtil.isFunction(optionToContent)) {\r\n const htmlOrDom = optionToContent(api.getOption());\r\n if (zrUtil.isString(htmlOrDom)) {\r\n viewMain.innerHTML = htmlOrDom;\r\n }\r\n else if (zrUtil.isDom(htmlOrDom)) {\r\n viewMain.appendChild(htmlOrDom);\r\n }\r\n }\r\n else {\r\n // Use default textarea\r\n textarea.readOnly = model.get('readOnly');\r\n const style = textarea.style;\r\n // eslint-disable-next-line max-len\r\n style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none';\r\n style.color = model.get('textColor');\r\n style.borderColor = model.get('textareaBorderColor');\r\n style.backgroundColor = model.get('textareaColor');\r\n textarea.value = result.value;\r\n viewMain.appendChild(textarea);\r\n }\r\n\r\n const blockMetaList = result.meta;\r\n\r\n const buttonContainer = document.createElement('div');\r\n buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0';\r\n\r\n // eslint-disable-next-line max-len\r\n let buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\r\n const closeButton = document.createElement('div');\r\n const refreshButton = document.createElement('div');\r\n\r\n buttonStyle += ';background-color:' + model.get('buttonColor');\r\n buttonStyle += ';color:' + model.get('buttonTextColor');\r\n\r\n const self = this;\r\n\r\n function close() {\r\n container.removeChild(root);\r\n self._dom = null;\r\n }\r\n addEventListener(closeButton, 'click', close);\r\n\r\n addEventListener(refreshButton, 'click', function () {\r\n if ((contentToOption == null && optionToContent != null)\r\n || (contentToOption != null && optionToContent == null)) {\r\n if (__DEV__) {\r\n // eslint-disable-next-line\r\n warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.')\r\n }\r\n close();\r\n return;\r\n }\r\n\r\n let newOption;\r\n try {\r\n if (zrUtil.isFunction(contentToOption)) {\r\n newOption = contentToOption(viewMain, api.getOption());\r\n }\r\n else {\r\n newOption = parseContents(textarea.value, blockMetaList);\r\n }\r\n }\r\n catch (e) {\r\n close();\r\n throw new Error('Data view format error ' + e);\r\n }\r\n if (newOption) {\r\n api.dispatchAction({\r\n type: 'changeDataView',\r\n newOption: newOption\r\n });\r\n }\r\n\r\n close();\r\n });\r\n\r\n closeButton.innerHTML = lang[1];\r\n refreshButton.innerHTML = lang[2];\r\n refreshButton.style.cssText =\r\n closeButton.style.cssText = buttonStyle;\r\n\r\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\r\n buttonContainer.appendChild(closeButton);\r\n\r\n root.appendChild(header);\r\n root.appendChild(viewMain);\r\n root.appendChild(buttonContainer);\r\n\r\n viewMain.style.height = (container.clientHeight - 80) + 'px';\r\n\r\n container.appendChild(root);\r\n this._dom = root;\r\n }\r\n\r\n remove(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this._dom && api.getDom().removeChild(this._dom);\r\n }\r\n\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.remove(ecModel, api);\r\n }\r\n\r\n static getDefaultOption(ecModel: GlobalModel) {\r\n const defaultOption: ToolboxDataViewFeatureOption = {\r\n show: true,\r\n readOnly: false,\r\n optionToContent: null,\r\n contentToOption: null,\r\n\r\n // eslint-disable-next-line\r\n icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',\r\n title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']),\r\n lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']),\r\n backgroundColor: '#fff',\r\n textColor: '#000',\r\n textareaColor: '#fff',\r\n textareaBorderColor: '#333',\r\n buttonColor: '#c23531',\r\n buttonTextColor: '#fff'\r\n };\r\n\r\n return defaultOption;\r\n }\r\n}\r\n\r\n/**\r\n * @inner\r\n */\r\nfunction tryMergeDataOption(newData: DataList, originalData: DataList) {\r\n return zrUtil.map(newData, function (newVal, idx) {\r\n const original = originalData && originalData[idx];\r\n if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {\r\n const newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);\r\n if (!newValIsObject) {\r\n newVal = {\r\n value: newVal\r\n } as DataItem;\r\n }\r\n // original data has name but new data has no name\r\n const shouldDeleteName = original.name != null && (newVal as DataItem).name == null;\r\n // Original data has option\r\n newVal = zrUtil.defaults((newVal as DataItem), original);\r\n shouldDeleteName && (delete (newVal as DataItem).name);\r\n return newVal;\r\n }\r\n else {\r\n return newVal;\r\n }\r\n });\r\n}\r\n\r\n\r\n// TODO: SELF REGISTERED.\r\necharts.registerAction({\r\n type: 'changeDataView',\r\n event: 'dataViewChanged',\r\n update: 'prepareAndUpdate'\r\n}, function (payload: ChangeDataViewPayload, ecModel: GlobalModel) {\r\n const newSeriesOptList: SeriesOption[] = [];\r\n zrUtil.each(payload.newOption.series, function (seriesOpt) {\r\n const seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\r\n if (!seriesModel) {\r\n // New created series\r\n // Geuss the series type\r\n newSeriesOptList.push(zrUtil.extend({\r\n // Default is scatter\r\n type: 'scatter'\r\n }, seriesOpt));\r\n }\r\n else {\r\n const originalData = seriesModel.get('data');\r\n newSeriesOptList.push({\r\n name: seriesOpt.name,\r\n data: tryMergeDataOption(seriesOpt.data as DataList, originalData as DataList)\r\n });\r\n }\r\n });\r\n\r\n ecModel.mergeOption(zrUtil.defaults({\r\n series: newSeriesOptList\r\n }, payload.newOption));\r\n});\r\n\r\nexport default DataView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport GlobalModel from '../../model/Global';\r\nimport { Dictionary } from '../../util/types';\r\nimport DataZoomModel from './DataZoomModel';\r\nimport { makeInner } from '../../util/model';\r\nimport { DataZoomPayloadBatchItem } from './helper';\r\n\r\nconst each = zrUtil.each;\r\n\r\nexport type DataZoomStoreSnapshot = Dictionary;\r\n\r\ntype Store = {\r\n snapshots: DataZoomStoreSnapshot[]\r\n};\r\n\r\nconst inner = makeInner();\r\n\r\n/**\r\n * @param ecModel\r\n * @param newSnapshot key is dataZoomId\r\n */\r\nexport function push(ecModel: GlobalModel, newSnapshot: DataZoomStoreSnapshot) {\r\n const storedSnapshots = getStoreSnapshots(ecModel);\r\n\r\n // If previous dataZoom can not be found,\r\n // complete an range with current range.\r\n each(newSnapshot, function (batchItem, dataZoomId) {\r\n let i = storedSnapshots.length - 1;\r\n for (; i >= 0; i--) {\r\n const snapshot = storedSnapshots[i];\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n if (i < 0) {\r\n // No origin range set, create one by current range.\r\n const dataZoomModel = ecModel.queryComponents(\r\n {mainType: 'dataZoom', subType: 'select', id: dataZoomId}\r\n )[0] as DataZoomModel;\r\n if (dataZoomModel) {\r\n const percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n\r\n storedSnapshots.push(newSnapshot);\r\n}\r\n\r\nexport function pop(ecModel: GlobalModel) {\r\n const storedSnapshots = getStoreSnapshots(ecModel);\r\n const head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop();\r\n\r\n // Find top for all dataZoom.\r\n const snapshot: DataZoomStoreSnapshot = {};\r\n each(head, function (batchItem, dataZoomId) {\r\n for (let i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n\r\n return snapshot;\r\n}\r\n\r\nexport function clear(ecModel: GlobalModel) {\r\n inner(ecModel).snapshots = null;\r\n}\r\n\r\nexport function count(ecModel: GlobalModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n}\r\n\r\n/**\r\n * History length of each dataZoom may be different.\r\n * this._history[0] is used to store origin range.\r\n */\r\nfunction getStoreSnapshots(ecModel: GlobalModel) {\r\n const store = inner(ecModel);\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n return store.snapshots;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as echarts from '../../../core/echarts';\r\nimport * as history from '../../dataZoom/history';\r\nimport { ToolboxFeatureOption, ToolboxFeature } from '../featureManager';\r\nimport ExtensionAPI from '../../../core/ExtensionAPI';\r\nimport GlobalModel from '../../../model/Global';\r\n\r\nexport interface ToolboxRestoreFeatureOption extends ToolboxFeatureOption {\r\n icon?: string\r\n title?: string\r\n}\r\n\r\nclass RestoreOption extends ToolboxFeature {\r\n\r\n onclick(ecModel: GlobalModel, api: ExtensionAPI) {\r\n history.clear(ecModel);\r\n\r\n api.dispatchAction({\r\n type: 'restore',\r\n from: this.uid\r\n });\r\n }\r\n\r\n static getDefaultOption(ecModel: GlobalModel) {\r\n const defaultOption: ToolboxRestoreFeatureOption = {\r\n show: true,\r\n // eslint-disable-next-line\r\n icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',\r\n title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title'])\r\n };\r\n\r\n return defaultOption;\r\n }\r\n}\r\n\r\n// TODO: SELF REGISTERED.\r\necharts.registerAction(\r\n {type: 'restore', event: 'restore', update: 'prepareAndUpdate'},\r\n function (payload, ecModel) {\r\n ecModel.resetOption('recreate');\r\n }\r\n);\r\n\r\n\r\nexport default RestoreOption;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport { each, indexOf, curry, assert, map, createHashMap } from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as brushHelper from './brushHelper';\r\nimport {\r\n BrushPanelConfig, BrushControllerEvents, BrushType,\r\n BrushAreaRange, BrushDimensionMinMax\r\n} from './BrushController';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GridModel from '../../coord/cartesian/GridModel';\r\nimport GeoModel from '../../coord/geo/GeoModel';\r\nimport { CoordinateSystemMaster } from '../../coord/CoordinateSystem';\r\nimport Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport Geo from '../../coord/geo/Geo';\r\nimport GlobalModel from '../../model/Global';\r\nimport { BrushAreaParam, BrushAreaParamInternal } from '../brush/BrushModel';\r\nimport SeriesModel from '../../model/Series';\r\nimport { Dictionary } from '../../util/types';\r\nimport {\r\n ModelFinderObject, ModelFinder,\r\n parseFinder as modelUtilParseFinder,\r\n ParsedModelFinderKnown\r\n} from '../../util/model';\r\n\r\ntype COORD_CONVERTS_INDEX = 0 | 1;\r\n\r\n// FIXME\r\n// how to genarialize to more coordinate systems.\r\nconst INCLUDE_FINDER_MAIN_TYPES = [\r\n 'grid', 'xAxis', 'yAxis', 'geo', 'graph',\r\n 'polar', 'radiusAxis', 'angleAxis', 'bmap'\r\n];\r\n\r\ntype BrushableCoordinateSystem = Cartesian2D | Geo;\r\ntype BrushTargetBuilderKey = 'grid' | 'geo';\r\n\r\n/**\r\n * There can be multiple axes in a single targetInfo. Consider the case\r\n * of `grid` component, a targetInfo represents a grid which contains one or more\r\n * cartesian and one or more axes. And consider the case of parallel system,\r\n * which has multiple axes in a coordinate system.\r\n */\r\ninterface BrushTargetInfo {\r\n panelId: string;\r\n coordSysModel: CoordinateSystemMaster['model'];\r\n // Use the first one as the representitive coordSys.\r\n // A representitive cartesian in grid (first cartesian by default).\r\n coordSys: BrushableCoordinateSystem;\r\n // All cartesians.\r\n coordSyses: BrushableCoordinateSystem[];\r\n getPanelRect: GetPanelRect,\r\n}\r\nexport interface BrushTargetInfoCartesian2D extends BrushTargetInfo {\r\n gridModel: GridModel;\r\n coordSys: Cartesian2D;\r\n coordSyses: Cartesian2D[];\r\n xAxisDeclared: boolean;\r\n yAxisDeclared: boolean;\r\n}\r\nexport interface BrushTargetInfoGeo extends BrushTargetInfo {\r\n geoModel: GeoModel,\r\n coordSysModel: GeoModel,\r\n coordSys: Geo,\r\n coordSyses: Geo[],\r\n}\r\ntype GetPanelRect = () => graphic.BoundingRect;\r\n\r\n\r\nclass BrushTargetManager {\r\n\r\n private _targetInfoList: BrushTargetInfo[] = [];\r\n\r\n /**\r\n * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid\r\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\r\n * @param opt.include include coordinate system types.\r\n */\r\n constructor(\r\n finder: ModelFinderObject,\r\n ecModel: GlobalModel,\r\n opt?: {include?: BrushTargetBuilderKey[]}\r\n ) {\r\n const foundCpts = parseFinder(ecModel, finder);\r\n\r\n each(targetInfoBuilders, (builder, type) => {\r\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\r\n builder(foundCpts, this._targetInfoList);\r\n }\r\n });\r\n }\r\n\r\n setOutputRanges(\r\n areas: BrushControllerEvents['brush']['areas'],\r\n ecModel: GlobalModel\r\n ): BrushAreaParam[] {\r\n this.matchOutputRanges(areas, ecModel, function (\r\n area: BrushAreaParam,\r\n coordRange: ReturnType['values'],\r\n coordSys: BrushableCoordinateSystem\r\n ) {\r\n (area.coordRanges || (area.coordRanges = [])).push(coordRange);\r\n // area.coordRange is the first of area.coordRanges\r\n if (!area.coordRange) {\r\n area.coordRange = coordRange;\r\n // In 'category' axis, coord to pixel is not reversible, so we can not\r\n // rebuild range by coordRange accrately, which may bring trouble when\r\n // brushing only one item. So we use __rangeOffset to rebuilding range\r\n // by coordRange. And this it only used in brush component so it is no\r\n // need to be adapted to coordRanges.\r\n const result = coordConvert[area.brushType](0, coordSys, coordRange);\r\n area.__rangeOffset = {\r\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\r\n xyMinMax: result.xyMinMax\r\n };\r\n }\r\n });\r\n return areas;\r\n }\r\n\r\n matchOutputRanges[0] & {\r\n brushType: BrushType;\r\n range: BrushAreaRange;\r\n }\r\n )>(\r\n areas: T[],\r\n ecModel: GlobalModel,\r\n cb: (\r\n area: T,\r\n coordRange: ReturnType['values'],\r\n coordSys: BrushableCoordinateSystem,\r\n ecModel: GlobalModel\r\n ) => void\r\n ) {\r\n each(areas, function (area) {\r\n const targetInfo = this.findTargetInfo(area, ecModel);\r\n\r\n if (targetInfo && targetInfo !== true) {\r\n each(\r\n targetInfo.coordSyses,\r\n function (coordSys) {\r\n const result = coordConvert[area.brushType](1, coordSys, area.range, true);\r\n cb(area, result.values, coordSys, ecModel);\r\n }\r\n );\r\n }\r\n }, this);\r\n }\r\n\r\n /**\r\n * the `areas` is `BrushModel.areas`.\r\n * Called in layout stage.\r\n * convert `area.coordRange` to global range and set panelId to `area.range`.\r\n */\r\n setInputRanges(\r\n areas: BrushAreaParamInternal[],\r\n ecModel: GlobalModel\r\n ): void {\r\n each(areas, function (area) {\r\n const targetInfo = this.findTargetInfo(area, ecModel);\r\n\r\n if (__DEV__) {\r\n assert(\r\n !targetInfo || targetInfo === true || area.coordRange,\r\n 'coordRange must be specified when coord index specified.'\r\n );\r\n assert(\r\n !targetInfo || targetInfo !== true || area.range,\r\n 'range must be specified in global brush.'\r\n );\r\n }\r\n\r\n area.range = area.range || [];\r\n\r\n // convert coordRange to global range and set panelId.\r\n if (targetInfo && targetInfo !== true) {\r\n area.panelId = targetInfo.panelId;\r\n // (1) area.range should always be calculate from coordRange but does\r\n // not keep its original value, for the sake of the dataZoom scenario,\r\n // where area.coordRange remains unchanged but area.range may be changed.\r\n // (2) Only support converting one coordRange to pixel range in brush\r\n // component. So do not consider `coordRanges`.\r\n // (3) About __rangeOffset, see comment above.\r\n const result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\r\n const rangeOffset = area.__rangeOffset;\r\n area.range = rangeOffset\r\n ? diffProcessor[area.brushType](\r\n result.values,\r\n rangeOffset.offset,\r\n getScales(result.xyMinMax, rangeOffset.xyMinMax)\r\n )\r\n : result.values;\r\n }\r\n }, this);\r\n }\r\n\r\n makePanelOpts(\r\n api: ExtensionAPI,\r\n getDefaultBrushType?: (targetInfo: BrushTargetInfo) => BrushType\r\n ): BrushPanelConfig[] {\r\n return map(this._targetInfoList, function (targetInfo) {\r\n const rect = targetInfo.getPanelRect();\r\n return {\r\n panelId: targetInfo.panelId,\r\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\r\n clipPath: brushHelper.makeRectPanelClipPath(rect),\r\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(\r\n rect, api, targetInfo.coordSysModel\r\n ),\r\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\r\n };\r\n });\r\n }\r\n\r\n controlSeries(area: BrushAreaParamInternal, seriesModel: SeriesModel, ecModel: GlobalModel): boolean {\r\n // Check whether area is bound in coord, and series do not belong to that coord.\r\n // If do not do this check, some brush (like lineX) will controll all axes.\r\n const targetInfo = this.findTargetInfo(area, ecModel);\r\n return targetInfo === true || (\r\n targetInfo && indexOf(\r\n targetInfo.coordSyses, seriesModel.coordinateSystem as BrushableCoordinateSystem\r\n ) >= 0\r\n );\r\n }\r\n\r\n /**\r\n * If return Object, a coord found.\r\n * If return true, global found.\r\n * Otherwise nothing found.\r\n */\r\n findTargetInfo(\r\n area: ModelFinderObject & {\r\n panelId?: string\r\n },\r\n ecModel: GlobalModel\r\n ): BrushTargetInfo | true {\r\n const targetInfoList = this._targetInfoList;\r\n const foundCpts = parseFinder(ecModel, area);\r\n\r\n for (let i = 0; i < targetInfoList.length; i++) {\r\n const targetInfo = targetInfoList[i];\r\n const areaPanelId = area.panelId;\r\n if (areaPanelId) {\r\n if (targetInfo.panelId === areaPanelId) {\r\n return targetInfo;\r\n }\r\n }\r\n else {\r\n for (let j = 0; j < targetInfoMatchers.length; j++) {\r\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\r\n return targetInfo;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n}\r\n\r\nfunction formatMinMax(minMax: BrushDimensionMinMax): BrushDimensionMinMax {\r\n minMax[0] > minMax[1] && minMax.reverse();\r\n return minMax;\r\n}\r\n\r\nfunction parseFinder(\r\n ecModel: GlobalModel, finder: ModelFinder\r\n): ParsedModelFinderKnown {\r\n return modelUtilParseFinder(\r\n ecModel, finder, {includeMainTypes: INCLUDE_FINDER_MAIN_TYPES}\r\n );\r\n}\r\n\r\ntype TargetInfoBuilder = (\r\n foundCpts: ParsedModelFinderKnown, targetInfoList: BrushTargetInfo[]\r\n) => void;\r\nconst targetInfoBuilders: Record = {\r\n\r\n grid: function (foundCpts, targetInfoList) {\r\n const xAxisModels = foundCpts.xAxisModels;\r\n const yAxisModels = foundCpts.yAxisModels;\r\n const gridModels = foundCpts.gridModels;\r\n // Remove duplicated.\r\n const gridModelMap = createHashMap();\r\n const xAxesHas = {} as Dictionary;\r\n const yAxesHas = {} as Dictionary;\r\n\r\n if (!xAxisModels && !yAxisModels && !gridModels) {\r\n return;\r\n }\r\n\r\n each(xAxisModels, function (axisModel) {\r\n const gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n });\r\n each(yAxisModels, function (axisModel) {\r\n const gridModel = axisModel.axis.grid.model;\r\n gridModelMap.set(gridModel.id, gridModel);\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n each(gridModels, function (gridModel) {\r\n gridModelMap.set(gridModel.id, gridModel);\r\n xAxesHas[gridModel.id] = true;\r\n yAxesHas[gridModel.id] = true;\r\n });\r\n\r\n gridModelMap.each(function (gridModel) {\r\n const grid = gridModel.coordinateSystem;\r\n const cartesians = [] as Cartesian2D[];\r\n\r\n each(grid.getCartesians(), function (cartesian, index) {\r\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0\r\n || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0\r\n ) {\r\n cartesians.push(cartesian);\r\n }\r\n });\r\n targetInfoList.push({\r\n panelId: 'grid--' + gridModel.id,\r\n gridModel: gridModel,\r\n coordSysModel: gridModel,\r\n // Use the first one as the representitive coordSys.\r\n coordSys: cartesians[0],\r\n coordSyses: cartesians,\r\n getPanelRect: panelRectBuilders.grid,\r\n xAxisDeclared: xAxesHas[gridModel.id],\r\n yAxisDeclared: yAxesHas[gridModel.id]\r\n } as BrushTargetInfoCartesian2D);\r\n });\r\n },\r\n\r\n geo: function (foundCpts, targetInfoList) {\r\n each(foundCpts.geoModels, function (geoModel: GeoModel) {\r\n const coordSys = geoModel.coordinateSystem;\r\n targetInfoList.push({\r\n panelId: 'geo--' + geoModel.id,\r\n geoModel: geoModel,\r\n coordSysModel: geoModel,\r\n coordSys: coordSys,\r\n coordSyses: [coordSys],\r\n getPanelRect: panelRectBuilders.geo\r\n } as BrushTargetInfoGeo);\r\n });\r\n }\r\n};\r\n\r\ntype TargetInfoMatcher = (\r\n foundCpts: ParsedModelFinderKnown, targetInfo: BrushTargetInfo\r\n) => boolean;\r\nconst targetInfoMatchers: TargetInfoMatcher[] = [\r\n\r\n // grid\r\n function (foundCpts, targetInfo) {\r\n const xAxisModel = foundCpts.xAxisModel;\r\n const yAxisModel = foundCpts.yAxisModel;\r\n let gridModel = foundCpts.gridModel;\r\n\r\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\r\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\r\n\r\n return gridModel && gridModel === (targetInfo as BrushTargetInfoCartesian2D).gridModel;\r\n },\r\n\r\n // geo\r\n function (foundCpts, targetInfo) {\r\n const geoModel = foundCpts.geoModel;\r\n return geoModel && geoModel === (targetInfo as BrushTargetInfoGeo).geoModel;\r\n }\r\n];\r\n\r\ntype PanelRectBuilder = (this: BrushTargetInfo) => graphic.BoundingRect;\r\nconst panelRectBuilders: Record = {\r\n\r\n grid: function (this: BrushTargetInfoCartesian2D) {\r\n // grid is not Transformable.\r\n return this.coordSys.master.getRect().clone();\r\n },\r\n\r\n geo: function (this: BrushTargetInfoGeo) {\r\n const coordSys = this.coordSys;\r\n const rect = coordSys.getBoundingRect().clone();\r\n // geo roam and zoom transform\r\n rect.applyTransform(graphic.getTransform(coordSys));\r\n return rect;\r\n }\r\n};\r\n\r\ntype ConvertCoord = (\r\n to: COORD_CONVERTS_INDEX,\r\n coordSys: BrushableCoordinateSystem,\r\n rangeOrCoordRange: BrushAreaRange,\r\n clamp?: boolean\r\n) => {\r\n values: BrushAreaRange,\r\n xyMinMax: BrushDimensionMinMax[]\r\n};\r\nconst coordConvert: Record = {\r\n\r\n lineX: curry(axisConvert, 0),\r\n\r\n lineY: curry(axisConvert, 1),\r\n\r\n rect: function (to, coordSys, rangeOrCoordRange: BrushDimensionMinMax[], clamp): {\r\n values: BrushDimensionMinMax[],\r\n xyMinMax: BrushDimensionMinMax[]\r\n } {\r\n const xminymin = to\r\n ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp)\r\n : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp);\r\n const xmaxymax = to\r\n ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp)\r\n : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp);\r\n const values = [\r\n formatMinMax([xminymin[0], xmaxymax[0]]),\r\n formatMinMax([xminymin[1], xmaxymax[1]])\r\n ];\r\n return {values: values, xyMinMax: values};\r\n },\r\n\r\n polygon: function (to, coordSys, rangeOrCoordRange: BrushDimensionMinMax[], clamp): {\r\n values: BrushDimensionMinMax[],\r\n xyMinMax: BrushDimensionMinMax[]\r\n } {\r\n const xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n const values = map(rangeOrCoordRange, function (item) {\r\n const p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp);\r\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\r\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\r\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\r\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\r\n return p;\r\n });\r\n return {values: values, xyMinMax: xyMinMax};\r\n }\r\n};\r\n\r\nfunction axisConvert(\r\n axisNameIndex: 0 | 1,\r\n to: COORD_CONVERTS_INDEX,\r\n coordSys: Cartesian2D,\r\n rangeOrCoordRange: BrushDimensionMinMax\r\n): {\r\n values: BrushDimensionMinMax,\r\n xyMinMax: BrushDimensionMinMax[]\r\n} {\r\n if (__DEV__) {\r\n assert(\r\n coordSys.type === 'cartesian2d',\r\n 'lineX/lineY brush is available only in cartesian2d.'\r\n );\r\n }\r\n\r\n const axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\r\n const values = formatMinMax(map([0, 1], function (i) {\r\n return to\r\n ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true)\r\n : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\r\n }));\r\n const xyMinMax = [];\r\n xyMinMax[axisNameIndex] = values;\r\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\r\n\r\n return {values: values, xyMinMax: xyMinMax};\r\n}\r\n\r\n\r\ntype DiffProcess = (\r\n values: BrushDimensionMinMax | BrushDimensionMinMax[],\r\n refer: BrushDimensionMinMax | BrushDimensionMinMax[],\r\n scales: ReturnType\r\n) => BrushDimensionMinMax | BrushDimensionMinMax[];\r\n\r\nconst diffProcessor: Record = {\r\n\r\n lineX: curry(axisDiffProcessor, 0),\r\n\r\n lineY: curry(axisDiffProcessor, 1),\r\n\r\n rect: function (\r\n values: BrushDimensionMinMax[], refer: BrushDimensionMinMax[], scales: ReturnType\r\n ): BrushDimensionMinMax[] {\r\n return [\r\n [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]],\r\n [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]\r\n ];\r\n },\r\n\r\n polygon: function (\r\n values: BrushDimensionMinMax[], refer: BrushDimensionMinMax[], scales: ReturnType\r\n ): BrushDimensionMinMax[] {\r\n return map(values, function (item, idx) {\r\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\r\n });\r\n }\r\n};\r\n\r\nfunction axisDiffProcessor(\r\n axisNameIndex: 0 | 1,\r\n values: BrushDimensionMinMax,\r\n refer: BrushDimensionMinMax,\r\n scales: ReturnType\r\n): BrushDimensionMinMax {\r\n return [\r\n values[0] - scales[axisNameIndex] * refer[0],\r\n values[1] - scales[axisNameIndex] * refer[1]\r\n ];\r\n}\r\n\r\n// We have to process scale caused by dataZoom manually,\r\n// although it might be not accurate.\r\n// Return [0~1, 0~1]\r\nfunction getScales(xyMinMaxCurr: BrushDimensionMinMax[], xyMinMaxOrigin: BrushDimensionMinMax[]): number[] {\r\n const sizeCurr = getSize(xyMinMaxCurr);\r\n const sizeOrigin = getSize(xyMinMaxOrigin);\r\n const scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\r\n isNaN(scales[0]) && (scales[0] = 1);\r\n isNaN(scales[1]) && (scales[1] = 1);\r\n return scales;\r\n}\r\n\r\nfunction getSize(xyMinMax: BrushDimensionMinMax[]): number[] {\r\n return xyMinMax\r\n ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]]\r\n : [NaN, NaN];\r\n}\r\n\r\nexport default BrushTargetManager;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n// TODO depends on DataZoom and Brush\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport BrushController, { BrushControllerEvents, BrushDimensionMinMax } from '../../helper/BrushController';\r\nimport BrushTargetManager, { BrushTargetInfoCartesian2D } from '../../helper/BrushTargetManager';\r\nimport * as history from '../../dataZoom/history';\r\nimport sliderMove from '../../helper/sliderMove';\r\nimport {\r\n ToolboxFeature,\r\n ToolboxFeatureModel,\r\n ToolboxFeatureOption\r\n} from '../featureManager';\r\nimport GlobalModel from '../../../model/Global';\r\nimport ExtensionAPI from '../../../core/ExtensionAPI';\r\nimport { Payload, Dictionary, ComponentOption, ItemStyleOption } from '../../../util/types';\r\nimport Cartesian2D from '../../../coord/cartesian/Cartesian2D';\r\nimport CartesianAxisModel from '../../../coord/cartesian/AxisModel';\r\nimport DataZoomModel from '../../dataZoom/DataZoomModel';\r\nimport {\r\n DataZoomPayloadBatchItem, DataZoomAxisDimension\r\n} from '../../dataZoom/helper';\r\nimport {\r\n ModelFinderObject, ModelFinderIndexQuery, makeInternalComponentId,\r\n ModelFinderIdQuery, parseFinder, ParsedModelFinderKnown\r\n} from '../../../util/model';\r\nimport ToolboxModel from '../ToolboxModel';\r\nimport { registerInternalOptionCreator } from '../../../model/internalComponentCreator';\r\nimport ComponentModel from '../../../model/Component';\r\n\r\n\r\nconst each = zrUtil.each;\r\n\r\nconst DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\r\n\r\nconst ICON_TYPES = ['zoom', 'back'] as const;\r\ntype IconType = typeof ICON_TYPES[number];\r\n\r\nexport interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption {\r\n type?: IconType[]\r\n icon?: {[key in IconType]?: string}\r\n title?: {[key in IconType]?: string}\r\n // TODO: TYPE Use type in dataZoom\r\n filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none'\r\n // Backward compat: false means 'none'\r\n xAxisIndex?: ModelFinderIndexQuery\r\n yAxisIndex?: ModelFinderIndexQuery\r\n xAxisId?: ModelFinderIdQuery\r\n yAxisId?: ModelFinderIdQuery,\r\n\r\n brushStyle?: ItemStyleOption\r\n}\r\n\r\ntype ToolboxDataZoomFeatureModel = ToolboxFeatureModel;\r\n\r\nclass DataZoomFeature extends ToolboxFeature {\r\n\r\n _brushController: BrushController;\r\n\r\n _isZoomActive: boolean;\r\n\r\n render(\r\n featureModel: ToolboxDataZoomFeatureModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload\r\n ) {\r\n if (!this._brushController) {\r\n this._brushController = new BrushController(api.getZr());\r\n this._brushController.on('brush', zrUtil.bind(this._onBrush, this))\r\n .mount();\r\n }\r\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\r\n updateBackBtnStatus(featureModel, ecModel);\r\n }\r\n\r\n onclick(\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n type: IconType\r\n ) {\r\n handlers[type].call(this);\r\n }\r\n\r\n remove(\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n this._brushController && this._brushController.unmount();\r\n }\r\n\r\n dispose(\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n this._brushController && this._brushController.dispose();\r\n }\r\n\r\n private _onBrush(eventParam: BrushControllerEvents['brush']): void {\r\n const areas = eventParam.areas;\r\n if (!eventParam.isEnd || !areas.length) {\r\n return;\r\n }\r\n const snapshot: history.DataZoomStoreSnapshot = {};\r\n const ecModel = this.ecModel;\r\n\r\n this._brushController.updateCovers([]); // remove cover\r\n\r\n const brushTargetManager = new BrushTargetManager(\r\n makeAxisFinder(this.model),\r\n ecModel,\r\n {include: ['grid']}\r\n );\r\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys: Cartesian2D) {\r\n if (coordSys.type !== 'cartesian2d') {\r\n return;\r\n }\r\n\r\n const brushType = area.brushType;\r\n if (brushType === 'rect') {\r\n setBatch('x', coordSys, (coordRange as BrushDimensionMinMax[])[0]);\r\n setBatch('y', coordSys, (coordRange as BrushDimensionMinMax[])[1]);\r\n }\r\n else {\r\n setBatch(\r\n ({lineX: 'x', lineY: 'y'} as const)[brushType as 'lineX' | 'lineY'],\r\n coordSys,\r\n coordRange as BrushDimensionMinMax\r\n );\r\n }\r\n });\r\n\r\n history.push(ecModel, snapshot);\r\n\r\n this._dispatchZoomAction(snapshot);\r\n\r\n function setBatch(dimName: DataZoomAxisDimension, coordSys: Cartesian2D, minMax: number[]) {\r\n const axis = coordSys.getAxis(dimName);\r\n const axisModel = axis.model;\r\n const dataZoomModel = findDataZoom(dimName, axisModel, ecModel);\r\n\r\n // Restrict range.\r\n const minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\r\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\r\n minMax = sliderMove(\r\n 0, minMax.slice(), axis.scale.getExtent(), 0,\r\n minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan\r\n );\r\n }\r\n\r\n dataZoomModel && (snapshot[dataZoomModel.id] = {\r\n dataZoomId: dataZoomModel.id,\r\n startValue: minMax[0],\r\n endValue: minMax[1]\r\n });\r\n }\r\n\r\n function findDataZoom(\r\n dimName: DataZoomAxisDimension, axisModel: CartesianAxisModel, ecModel: GlobalModel\r\n ): DataZoomModel {\r\n let found;\r\n ecModel.eachComponent({mainType: 'dataZoom', subType: 'select'}, function (dzModel: DataZoomModel) {\r\n const has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\r\n has && (found = dzModel);\r\n });\r\n return found;\r\n }\r\n };\r\n\r\n _dispatchZoomAction(snapshot: history.DataZoomStoreSnapshot): void {\r\n const batch: DataZoomPayloadBatchItem[] = [];\r\n\r\n // Convert from hash map to array.\r\n each(snapshot, function (batchItem, dataZoomId) {\r\n batch.push(zrUtil.clone(batchItem));\r\n });\r\n\r\n batch.length && this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n batch: batch\r\n });\r\n }\r\n\r\n static getDefaultOption(ecModel: GlobalModel) {\r\n const defaultOption: ToolboxDataZoomFeatureOption = {\r\n show: true,\r\n filterMode: 'filter',\r\n // Icon group\r\n icon: {\r\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\r\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\r\n },\r\n // `zoom`, `back`\r\n title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']),\r\n brushStyle: {\r\n borderWidth: 0,\r\n color: 'rgba(210,219,238,0.2)'\r\n }\r\n };\r\n\r\n return defaultOption;\r\n }\r\n}\r\n\r\nconst handlers: { [key in IconType]: (this: DataZoomFeature) => void } = {\r\n zoom: function () {\r\n const nextActive = !this._isZoomActive;\r\n\r\n this.api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'dataZoomSelect',\r\n dataZoomSelectActive: nextActive\r\n });\r\n },\r\n\r\n back: function () {\r\n this._dispatchZoomAction(history.pop(this.ecModel));\r\n }\r\n};\r\n\r\n\r\nfunction makeAxisFinder(dzFeatureModel: ToolboxDataZoomFeatureModel): ModelFinderObject {\r\n const setting = {\r\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\r\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\r\n xAxisId: dzFeatureModel.get('xAxisId', true),\r\n yAxisId: dzFeatureModel.get('yAxisId', true)\r\n } as ModelFinderObject;\r\n\r\n // If both `xAxisIndex` `xAxisId` not set, it means 'all'.\r\n // If both `yAxisIndex` `yAxisId` not set, it means 'all'.\r\n // Some old cases set like this below to close yAxis control but leave xAxis control:\r\n // `{ feature: { dataZoom: { yAxisIndex: false } }`.\r\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\r\n setting.xAxisIndex = 'all';\r\n }\r\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\r\n setting.yAxisIndex = 'all';\r\n }\r\n\r\n return setting;\r\n}\r\n\r\nfunction updateBackBtnStatus(\r\n featureModel: ToolboxDataZoomFeatureModel,\r\n ecModel: GlobalModel\r\n) {\r\n featureModel.setIconStatus(\r\n 'back',\r\n history.count(ecModel) > 1 ? 'emphasis' : 'normal'\r\n );\r\n}\r\n\r\nfunction updateZoomBtnStatus(\r\n featureModel: ToolboxDataZoomFeatureModel,\r\n ecModel: GlobalModel,\r\n view: DataZoomFeature,\r\n payload: Payload,\r\n api: ExtensionAPI\r\n) {\r\n let zoomActive = view._isZoomActive;\r\n\r\n if (payload && payload.type === 'takeGlobalCursor') {\r\n zoomActive = payload.key === 'dataZoomSelect'\r\n ? payload.dataZoomSelectActive : false;\r\n }\r\n\r\n view._isZoomActive = zoomActive;\r\n\r\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\r\n\r\n const brushTargetManager = new BrushTargetManager(\r\n makeAxisFinder(featureModel),\r\n ecModel,\r\n {include: ['grid']}\r\n );\r\n\r\n const panels = brushTargetManager.makePanelOpts(api, function (targetInfo: BrushTargetInfoCartesian2D) {\r\n return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared)\r\n ? 'lineX'\r\n : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared)\r\n ? 'lineY'\r\n : 'rect';\r\n });\r\n\r\n view._brushController\r\n .setPanels(panels)\r\n .enableBrush(\r\n (zoomActive && panels.length)\r\n ? {\r\n brushType: 'auto',\r\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\r\n }\r\n : false\r\n );\r\n}\r\n\r\nregisterInternalOptionCreator('dataZoom', function (ecModel: GlobalModel): ComponentOption[] {\r\n const toolboxModel = ecModel.getComponent('toolbox', 0) as ToolboxModel;\r\n const featureDataZoomPath = ['feature', 'dataZoom'] as const;\r\n if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {\r\n return;\r\n }\r\n const dzFeatureModel = toolboxModel.getModel(featureDataZoomPath as any) as ToolboxDataZoomFeatureModel;\r\n const dzOptions = [] as ComponentOption[];\r\n\r\n const finder = makeAxisFinder(dzFeatureModel);\r\n const finderResult = parseFinder(ecModel, finder) as ParsedModelFinderKnown;\r\n\r\n each(finderResult.xAxisModels, axisModel => buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'));\r\n each(finderResult.yAxisModels, axisModel => buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'));\r\n\r\n function buildInternalOptions(\r\n axisModel: ComponentModel,\r\n axisMainType: 'xAxis' | 'yAxis',\r\n axisIndexPropName: 'xAxisIndex' | 'yAxisIndex'\r\n ) {\r\n const axisIndex = axisModel.componentIndex;\r\n const newOpt = {\r\n type: 'select',\r\n $fromToolbox: true,\r\n // Default to be filter\r\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\r\n // Id for merge mapping.\r\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\r\n } as Dictionary;\r\n newOpt[axisIndexPropName] = axisIndex;\r\n\r\n dzOptions.push(newOpt);\r\n }\r\n\r\n return dzOptions;\r\n});\r\n\r\n\r\nexport default DataZoomFeature;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport { install as installDataZoomSelect } from '../../component/dataZoom/installDataZoomSelect';\r\nimport ToolboxModel from './ToolboxModel';\r\nimport ToolboxView from './ToolboxView';\r\n\r\n// TODOD: REGISTER IN INSTALL\r\nimport { registerFeature } from './featureManager';\r\nimport SaveAsImage from './feature/SaveAsImage';\r\nimport MagicType from './feature/MagicType';\r\nimport DataView from './feature/DataView';\r\nimport Restore from './feature/Restore';\r\nimport DataZoom from './feature/DataZoom';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(ToolboxModel);\r\n registers.registerComponentView(ToolboxView);\r\n\r\n registerFeature('saveAsImage', SaveAsImage);\r\n registerFeature('magicType', MagicType);\r\n registerFeature('dataView', DataView);\r\n registerFeature('dataZoom', DataZoom);\r\n registerFeature('restore', Restore);\r\n\r\n use(installDataZoomSelect);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n ComponentOption,\r\n LabelOption,\r\n LineStyleOption,\r\n CommonTooltipOption,\r\n TooltipRenderMode,\r\n CallbackDataParams,\r\n TooltipOrderMode\r\n} from '../../util/types';\r\nimport {AxisPointerOption} from '../axisPointer/AxisPointerModel';\r\n\r\n\r\nexport type TopLevelFormatterParams = CallbackDataParams | CallbackDataParams[];\r\n\r\nexport interface TooltipOption extends CommonTooltipOption, ComponentOption {\r\n mainType?: 'tooltip'\r\n\r\n axisPointer?: AxisPointerOption & {\r\n axis?: 'auto' | 'x' | 'y' | 'angle' | 'radius'\r\n crossStyle?: LineStyleOption & {\r\n // TODO\r\n textStyle?: LabelOption\r\n }\r\n }\r\n /**\r\n * If show popup content\r\n */\r\n showContent?: boolean\r\n /**\r\n * Trigger only works on coordinate system.\r\n */\r\n trigger?: 'item' | 'axis' | 'none'\r\n\r\n displayMode?: 'single' | 'multipleByCoordSys';\r\n\r\n /**\r\n * 'auto': use html by default, and use non-html if `document` is not defined\r\n * 'html': use html for tooltip\r\n * 'richText': use canvas, svg, and etc. for tooltip\r\n */\r\n renderMode?: 'auto' | TooltipRenderMode // TODO richText renamed canvas?\r\n\r\n /**\r\n * @deprecated\r\n * use appendTo: 'body' instead\r\n */\r\n appendToBody?: boolean\r\n\r\n /**\r\n * If append the tooltip element to another DOM element.\r\n * Only available when renderMode is html\r\n */\r\n appendTo?: ((chartContainer: HTMLElement) => HTMLElement | undefined | null) | string | HTMLElement\r\n\r\n /**\r\n * Specify the class name of tooltip element\r\n * Only available when renderMode is html\r\n */\r\n className?: string\r\n\r\n order?: TooltipOrderMode\r\n}\r\n\r\nclass TooltipModel extends ComponentModel {\r\n static type = 'tooltip' as const;\r\n type = TooltipModel.type;\r\n\r\n static dependencies = ['axisPointer'];\r\n\r\n static defaultOption: TooltipOption = {\r\n // zlevel: 0,\r\n\r\n z: 60,\r\n\r\n show: true,\r\n\r\n // tooltip main content\r\n showContent: true,\r\n\r\n // 'trigger' only works on coordinate system.\r\n // 'item' | 'axis' | 'none'\r\n trigger: 'item',\r\n\r\n // 'click' | 'mousemove' | 'none'\r\n triggerOn: 'mousemove|click',\r\n\r\n alwaysShowContent: false,\r\n\r\n displayMode: 'single', // 'single' | 'multipleByCoordSys'\r\n\r\n renderMode: 'auto', // 'auto' | 'html' | 'richText'\r\n\r\n // whether restraint content inside viewRect.\r\n // If renderMode: 'richText', default true.\r\n // If renderMode: 'html', defaut false (for backward compat).\r\n confine: null,\r\n\r\n showDelay: 0,\r\n\r\n hideDelay: 100,\r\n\r\n // Animation transition time, unit is second\r\n transitionDuration: 0.4,\r\n\r\n enterable: false,\r\n\r\n backgroundColor: '#fff',\r\n\r\n // box shadow\r\n shadowBlur: 10,\r\n shadowColor: 'rgba(0, 0, 0, .2)',\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 2,\r\n\r\n // tooltip border radius, unit is px, default is 4\r\n borderRadius: 4,\r\n\r\n // tooltip border width, unit is px, default is 0 (no border)\r\n borderWidth: 1,\r\n\r\n // Tooltip inside padding, default is 5 for all direction\r\n // Array is allowed to set up, right, bottom, left, same with css\r\n // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.\r\n padding: null,\r\n\r\n // Extra css text\r\n extraCssText: '',\r\n\r\n // axis indicator, trigger by axis\r\n axisPointer: {\r\n // default is line\r\n // legal values: 'line' | 'shadow' | 'cross'\r\n type: 'line',\r\n\r\n // Valid when type is line, appoint tooltip line locate on which line. Optional\r\n // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'\r\n // default is 'auto', chose the axis which type is category.\r\n // for multiply y axis, cartesian coord chose x axis, polar chose angle axis\r\n axis: 'auto',\r\n\r\n animation: 'auto',\r\n animationDurationUpdate: 200,\r\n animationEasingUpdate: 'exponentialOut',\r\n\r\n crossStyle: {\r\n color: '#999',\r\n width: 1,\r\n type: 'dashed',\r\n\r\n // TODO formatter\r\n textStyle: {}\r\n }\r\n\r\n // lineStyle and shadowStyle should not be specified here,\r\n // otherwise it will always override those styles on option.axisPointer.\r\n },\r\n textStyle: {\r\n color: '#666',\r\n fontSize: 14\r\n }\r\n };\r\n}\r\n\r\nexport default TooltipModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { TooltipOption } from './TooltipModel';\r\nimport Model from '../../model/Model';\r\nimport { toCamelCase } from '../../util/format';\r\nimport env from 'zrender/src/core/env';\r\n\r\n/* global document */\r\n\r\nexport function shouldTooltipConfine(tooltipModel: Model): boolean {\r\n const confineOption = tooltipModel.get('confine');\r\n return confineOption != null\r\n ? !!confineOption\r\n // In richText mode, the outside part can not be visible.\r\n : tooltipModel.get('renderMode') === 'richText';\r\n}\r\n\r\nfunction testStyle(styleProps: string[]): string | undefined {\r\n if (!env.domSupported) {\r\n return;\r\n }\r\n const style = document.documentElement.style;\r\n for (let i = 0, len = styleProps.length; i < len; i++) {\r\n if (styleProps[i] in style) {\r\n return styleProps[i];\r\n }\r\n }\r\n}\r\n\r\nexport const TRANSFORM_VENDOR = testStyle(\r\n ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']\r\n);\r\n\r\nexport const TRANSITION_VENDOR = testStyle(\r\n ['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']\r\n);\r\n\r\nexport function toCSSVendorPrefix(styleVendor: string, styleProp: string) {\r\n if (!styleVendor) {\r\n return styleProp;\r\n }\r\n styleProp = toCamelCase(styleProp, true);\r\n const idx = styleVendor.indexOf(styleProp);\r\n styleVendor = idx === -1\r\n ? styleProp\r\n : `-${styleVendor.slice(0, idx)}-${styleProp}`;\r\n return styleVendor.toLowerCase();\r\n}\r\n\r\nexport function getComputedStyle(el: HTMLElement, style?: string) {\r\n const stl = (el as any).currentStyle\r\n || (document.defaultView && document.defaultView.getComputedStyle(el));\r\n return stl\r\n ? style ? stl[style] : stl\r\n : null;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { isString, indexOf, each, bind, isFunction, isArray, isDom } from 'zrender/src/core/util';\r\nimport { normalizeEvent } from 'zrender/src/core/event';\r\nimport { transformLocalCoord } from 'zrender/src/core/dom';\r\nimport env from 'zrender/src/core/env';\r\nimport { convertToColorString, toCamelCase, normalizeCssArray } from '../../util/format';\r\nimport type ExtensionAPI from '../../core/ExtensionAPI';\r\nimport type { ZRenderType } from 'zrender/src/zrender';\r\nimport type { TooltipOption } from './TooltipModel';\r\nimport Model from '../../model/Model';\r\nimport type { ZRRawEvent } from 'zrender/src/core/types';\r\nimport type { ZRColor } from '../../util/types';\r\nimport type CanvasPainter from 'zrender/src/canvas/Painter';\r\nimport type SVGPainter from 'zrender/src/svg/Painter';\r\nimport {\r\n shouldTooltipConfine,\r\n toCSSVendorPrefix,\r\n getComputedStyle,\r\n TRANSFORM_VENDOR,\r\n TRANSITION_VENDOR\r\n} from './helper';\r\nimport { getPaddingFromTooltipModel } from './tooltipMarkup';\r\n\r\n/* global document, window */\r\n\r\nconst CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition');\r\nconst CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform');\r\n\r\n// eslint-disable-next-line\r\nconst gCssText = `position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;${env.transform3dSupported ? 'will-change:transform;' : ''}`;\r\n\r\nfunction mirrorPos(pos: string): string {\r\n pos = pos === 'left'\r\n ? 'right'\r\n : pos === 'right'\r\n ? 'left'\r\n : pos === 'top'\r\n ? 'bottom'\r\n : 'top';\r\n return pos;\r\n}\r\n\r\nfunction assembleArrow(\r\n tooltipModel: Model,\r\n borderColor: ZRColor,\r\n arrowPosition: TooltipOption['position']\r\n) {\r\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\r\n return '';\r\n }\r\n\r\n const backgroundColor = tooltipModel.get('backgroundColor');\r\n const borderWidth = tooltipModel.get('borderWidth');\r\n\r\n borderColor = convertToColorString(borderColor);\r\n const arrowPos = mirrorPos(arrowPosition);\r\n const arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);\r\n let positionStyle = '';\r\n let transformStyle = CSS_TRANSFORM_VENDOR + ':';\r\n let rotateDeg;\r\n if (indexOf(['left', 'right'], arrowPos) > -1) {\r\n positionStyle += 'top:50%';\r\n transformStyle += `translateY(-50%) rotate(${rotateDeg = arrowPos === 'left' ? -225 : -45}deg)`;\r\n }\r\n else {\r\n positionStyle += 'left:50%';\r\n transformStyle += `translateX(-50%) rotate(${rotateDeg = arrowPos === 'top' ? 225 : 45}deg)`;\r\n }\r\n const rotateRadian = rotateDeg * Math.PI / 180;\r\n const arrowWH = arrowSize + borderWidth;\r\n const rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));\r\n const arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2\r\n + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;\r\n positionStyle += `;${arrowPos}:-${arrowOffset}px`;\r\n\r\n const borderStyle = `${borderColor} solid ${borderWidth}px;`;\r\n const styleCss = [\r\n `position:absolute;width:${arrowSize}px;height:${arrowSize}px;z-index:-1;`,\r\n `${positionStyle};${transformStyle};`,\r\n `border-bottom:${borderStyle}`,\r\n `border-right:${borderStyle}`,\r\n `background-color:${backgroundColor};`\r\n ];\r\n\r\n return `
`;\r\n}\r\n\r\nfunction assembleTransition(duration: number, onlyFade?: boolean): string {\r\n const transitionCurve = 'cubic-bezier(0.23,1,0.32,1)';\r\n let transitionOption = ` ${duration / 2}s ${transitionCurve}`;\r\n let transitionText = `opacity${transitionOption},visibility${transitionOption}`;\r\n if (!onlyFade) {\r\n transitionOption = ` ${duration}s ${transitionCurve}`;\r\n transitionText += env.transformSupported\r\n ? `,${CSS_TRANSFORM_VENDOR}${transitionOption}`\r\n : `,left${transitionOption},top${transitionOption}`;\r\n }\r\n\r\n return CSS_TRANSITION_VENDOR + ':' + transitionText;\r\n}\r\n\r\nfunction assembleTransform(x: number, y: number, toString?: boolean) {\r\n // If using float on style, the final width of the dom might\r\n // keep changing slightly while mouse move. So `toFixed(0)` them.\r\n const x0 = x.toFixed(0) + 'px';\r\n const y0 = y.toFixed(0) + 'px';\r\n // not support transform, use `left` and `top` instead.\r\n if (!env.transformSupported) {\r\n return toString\r\n ? `top:${y0};left:${x0};`\r\n : [['top', y0], ['left', x0]];\r\n }\r\n // support transform\r\n const is3d = env.transform3dSupported;\r\n const translate = `translate${is3d ? '3d' : ''}(${x0},${y0}${is3d ? ',0' : ''})`;\r\n return toString\r\n ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';'\r\n : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]];\r\n}\r\n\r\n/**\r\n * @param {Object} textStyle\r\n * @return {string}\r\n * @inner\r\n */\r\nfunction assembleFont(textStyleModel: Model): string {\r\n const cssText = [];\r\n\r\n const fontSize = textStyleModel.get('fontSize');\r\n const color = textStyleModel.getTextColor();\r\n\r\n color && cssText.push('color:' + color);\r\n\r\n cssText.push('font:' + textStyleModel.getFont());\r\n\r\n fontSize\r\n // @ts-ignore, leave it to the tooltip refactor.\r\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\r\n\r\n const shadowColor = textStyleModel.get('textShadowColor');\r\n const shadowBlur = textStyleModel.get('textShadowBlur') || 0;\r\n const shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\r\n const shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\r\n shadowColor && shadowBlur\r\n && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '\r\n + shadowBlur + 'px ' + shadowColor);\r\n\r\n each(['decoration', 'align'] as const, function (name) {\r\n const val = textStyleModel.get(name);\r\n val && cssText.push('text-' + name + ':' + val);\r\n });\r\n\r\n return cssText.join(';');\r\n}\r\n\r\nfunction assembleCssText(tooltipModel: Model, enableTransition?: boolean, onlyFade?: boolean) {\r\n const cssText: string[] = [];\r\n const transitionDuration = tooltipModel.get('transitionDuration');\r\n const backgroundColor = tooltipModel.get('backgroundColor');\r\n const shadowBlur = tooltipModel.get('shadowBlur');\r\n const shadowColor = tooltipModel.get('shadowColor');\r\n const shadowOffsetX = tooltipModel.get('shadowOffsetX');\r\n const shadowOffsetY = tooltipModel.get('shadowOffsetY');\r\n const textStyleModel = tooltipModel.getModel('textStyle');\r\n const padding = getPaddingFromTooltipModel(tooltipModel, 'html');\r\n const boxShadow = `${shadowOffsetX}px ${shadowOffsetY}px ${shadowBlur}px ${shadowColor}`;\r\n\r\n cssText.push('box-shadow:' + boxShadow);\r\n // Animation transition. Do not animate when transitionDuration is 0.\r\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\r\n\r\n if (backgroundColor) {\r\n cssText.push('background-color:' + backgroundColor);\r\n }\r\n\r\n // Border style\r\n each(['width', 'color', 'radius'] as const, function (name) {\r\n const borderName = 'border-' + name;\r\n const camelCase = toCamelCase(borderName) as 'borderWidth' | 'borderColor' | 'borderRadius';\r\n const val = tooltipModel.get(camelCase);\r\n val != null\r\n && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\r\n });\r\n\r\n // Text style\r\n cssText.push(assembleFont(textStyleModel));\r\n\r\n // Padding\r\n if (padding != null) {\r\n cssText.push('padding:' + normalizeCssArray(padding).join('px ') + 'px');\r\n }\r\n\r\n return cssText.join(';') + ';';\r\n}\r\n\r\n// If not able to make, do not modify the input `out`.\r\nfunction makeStyleCoord(\r\n out: number[],\r\n zr: ZRenderType,\r\n container: HTMLElement | null | undefined,\r\n zrX: number,\r\n zrY: number\r\n) {\r\n const zrPainter = zr && zr.painter;\r\n\r\n if (container) {\r\n const zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\r\n if (zrViewportRoot) {\r\n // Some APPs might use scale on body, so we support CSS transform here.\r\n transformLocalCoord(out, zrViewportRoot, container, zrX, zrY);\r\n }\r\n }\r\n else {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n // xy should be based on canvas root. But tooltipContent is\r\n // the sibling of canvas root. So padding of ec container\r\n // should be considered here.\r\n const viewportRootOffset = zrPainter && (zrPainter as CanvasPainter | SVGPainter).getViewportRootOffset();\r\n if (viewportRootOffset) {\r\n out[0] += viewportRootOffset.offsetLeft;\r\n out[1] += viewportRootOffset.offsetTop;\r\n }\r\n }\r\n\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n}\r\n\r\ninterface TooltipContentOption {\r\n /**\r\n * Specify target container of the tooltip element.\r\n * Can either be an HTMLElement, CSS selector string, or a function that returns an HTMLElement.\r\n */\r\n appendTo: ((chartContainer: HTMLElement) => HTMLElement | undefined | null) | HTMLElement | string\r\n}\r\n\r\nclass TooltipHTMLContent {\r\n\r\n el: HTMLDivElement;\r\n\r\n private _api: ExtensionAPI;\r\n private _container: HTMLElement | undefined | null;\r\n\r\n private _show: boolean = false;\r\n\r\n private _styleCoord: [number, number, number, number] = [0, 0, 0, 0];\r\n\r\n private _enterable = true;\r\n private _zr: ZRenderType;\r\n\r\n private _alwaysShowContent: boolean = false;\r\n private _hideTimeout: number;\r\n /**\r\n * Hide delay time\r\n */\r\n private _hideDelay: number;\r\n\r\n private _inContent: boolean;\r\n private _firstShow = true;\r\n private _longHide = true;\r\n /**\r\n * Record long-time hide\r\n */\r\n private _longHideTimeout: number;\r\n\r\n constructor(\r\n api: ExtensionAPI,\r\n opt: TooltipContentOption\r\n ) {\r\n if (env.wxa) {\r\n return null;\r\n }\r\n\r\n const el = document.createElement('div');\r\n // TODO: TYPE\r\n (el as any).domBelongToZr = true;\r\n this.el = el;\r\n const zr = this._zr = api.getZr();\r\n\r\n const appendTo = opt.appendTo;\r\n const container: HTMLElement | null | undefined = appendTo && (\r\n isString(appendTo)\r\n ? document.querySelector(appendTo)\r\n : isDom(appendTo)\r\n ? appendTo\r\n : isFunction(appendTo) && appendTo(api.getDom())\r\n );\r\n\r\n makeStyleCoord(this._styleCoord, zr, container, api.getWidth() / 2, api.getHeight() / 2);\r\n\r\n (container || api.getDom()).appendChild(el);\r\n\r\n this._api = api;\r\n this._container = container;\r\n\r\n // FIXME\r\n // Is it needed to trigger zr event manually if\r\n // the browser do not support `pointer-events: none`.\r\n\r\n const self = this;\r\n el.onmouseenter = function () {\r\n // clear the timeout in hideLater and keep showing tooltip\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n };\r\n el.onmousemove = function (e) {\r\n e = e || (window as any).event;\r\n if (!self._enterable) {\r\n // `pointer-events: none` is set to tooltip content div\r\n // if `enterable` is set as `false`, and `el.onmousemove`\r\n // can not be triggered. But in browser that do not\r\n // support `pointer-events`, we need to do this:\r\n // Try trigger zrender event to avoid mouse\r\n // in and out shape too frequently\r\n const handler = zr.handler;\r\n const zrViewportRoot = zr.painter.getViewportRoot();\r\n normalizeEvent(zrViewportRoot, e as ZRRawEvent, true);\r\n handler.dispatch('mousemove', e);\r\n }\r\n };\r\n el.onmouseleave = function () {\r\n // set `_inContent` to `false` before `hideLater`\r\n self._inContent = false;\r\n\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Update when tooltip is rendered\r\n */\r\n update(tooltipModel: Model) {\r\n // FIXME\r\n // Move this logic to ec main?\r\n if (!this._container) {\r\n const container = this._api.getDom();\r\n const position = getComputedStyle(container, 'position');\r\n const domStyle = container.style;\r\n if (domStyle.position !== 'absolute' && position !== 'absolute') {\r\n domStyle.position = 'relative';\r\n }\r\n }\r\n\r\n // move tooltip if chart resized\r\n const alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n\r\n // update alwaysShowContent\r\n this._alwaysShowContent = alwaysShowContent;\r\n\r\n // update className\r\n this.el.className = tooltipModel.get('className') || '';\r\n\r\n // Hide the tooltip\r\n // PENDING\r\n // this.hide();\r\n }\r\n\r\n show(tooltipModel: Model, nearPointColor: ZRColor) {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n const el = this.el;\r\n const style = el.style;\r\n const styleCoord = this._styleCoord;\r\n if (!el.innerHTML) {\r\n style.display = 'none';\r\n }\r\n else {\r\n style.cssText = gCssText\r\n + assembleCssText(tooltipModel, !this._firstShow, this._longHide)\r\n // initial transform\r\n + assembleTransform(styleCoord[0], styleCoord[1], true)\r\n + `border-color:${convertToColorString(nearPointColor)};`\r\n + (tooltipModel.get('extraCssText') || '')\r\n // If mouse occasionally move over the tooltip, a mouseout event will be\r\n // triggered by canvas, and cause some unexpectable result like dragging\r\n // stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\r\n // it. Although it is not supported by IE8~IE10, fortunately it is a rare\r\n // scenario.\r\n + `;pointer-events:${this._enterable ? 'auto' : 'none'}`;\r\n }\r\n\r\n this._show = true;\r\n this._firstShow = false;\r\n this._longHide = false;\r\n }\r\n\r\n setContent(\r\n content: string | HTMLElement | HTMLElement[],\r\n markers: unknown,\r\n tooltipModel: Model,\r\n borderColor?: ZRColor,\r\n arrowPosition?: TooltipOption['position']\r\n ) {\r\n const el = this.el;\r\n\r\n if (content == null) {\r\n el.innerHTML = '';\r\n return;\r\n }\r\n\r\n let arrow = '';\r\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'\r\n && !shouldTooltipConfine(tooltipModel)) {\r\n arrow = assembleArrow(tooltipModel, borderColor, arrowPosition);\r\n }\r\n if (isString(content)) {\r\n el.innerHTML = content + arrow;\r\n }\r\n else if (content) {\r\n // Clear previous\r\n el.innerHTML = '';\r\n if (!isArray(content)) {\r\n content = [content];\r\n }\r\n for (let i = 0; i < content.length; i++) {\r\n if (isDom(content[i]) && content[i].parentNode !== el) {\r\n el.appendChild(content[i]);\r\n }\r\n }\r\n // no arrow if empty\r\n if (arrow && el.childNodes.length) {\r\n // no need to create a new parent element, but it's not supported by IE 10 and older.\r\n // const arrowEl = document.createRange().createContextualFragment(arrow);\r\n const arrowEl = document.createElement('div');\r\n arrowEl.innerHTML = arrow;\r\n el.appendChild(arrowEl);\r\n }\r\n }\r\n }\r\n\r\n setEnterable(enterable: boolean) {\r\n this._enterable = enterable;\r\n }\r\n\r\n getSize() {\r\n const el = this.el;\r\n return el ? [el.offsetWidth, el.offsetHeight] : [0, 0];\r\n }\r\n\r\n moveTo(zrX: number, zrY: number) {\r\n if (!this.el) {\r\n return;\r\n }\r\n const styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY);\r\n\r\n if (styleCoord[0] != null && styleCoord[1] != null) {\r\n const style = this.el.style;\r\n const transforms = assembleTransform(styleCoord[0], styleCoord[1]) as string[][];\r\n each(transforms, (transform) => {\r\n style[transform[0] as any] = transform[1];\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * when `alwaysShowContent` is true,\r\n * move the tooltip after chart resized\r\n */\r\n _moveIfResized() {\r\n // The ratio of left to width\r\n const ratioX = this._styleCoord[2];\r\n // The ratio of top to height\r\n const ratioY = this._styleCoord[3];\r\n this.moveTo(\r\n ratioX * this._zr.getWidth(),\r\n ratioY * this._zr.getHeight()\r\n );\r\n }\r\n\r\n hide() {\r\n const style = this.el.style;\r\n style.visibility = 'hidden';\r\n style.opacity = '0';\r\n env.transform3dSupported && (style.willChange = '');\r\n this._show = false;\r\n this._longHideTimeout = setTimeout(() => this._longHide = true, 500) as any;\r\n }\r\n\r\n hideLater(time?: number) {\r\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\r\n if (time) {\r\n this._hideDelay = time;\r\n // Set show false to avoid invoke hideLater multiple times\r\n this._show = false;\r\n this._hideTimeout = setTimeout(bind(this.hide, this), time) as any;\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n }\r\n\r\n isShow() {\r\n return this._show;\r\n }\r\n\r\n dispose() {\r\n clearTimeout(this._hideTimeout);\r\n clearTimeout(this._longHideTimeout);\r\n\r\n const parentNode = this.el.parentNode;\r\n parentNode && parentNode.removeChild(this.el);\r\n this.el = this._container = null;\r\n }\r\n\r\n}\r\n\r\nexport default TooltipHTMLContent;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { ZRenderType } from 'zrender/src/zrender';\r\nimport { TooltipOption } from './TooltipModel';\r\nimport { ZRColor } from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport ZRText, { TextStyleProps } from 'zrender/src/graphic/Text';\r\nimport { TooltipMarkupStyleCreator, getPaddingFromTooltipModel } from './tooltipMarkup';\r\nimport { throwError } from '../../util/log';\r\n\r\nclass TooltipRichContent {\r\n\r\n private _zr: ZRenderType;\r\n\r\n private _show = false;\r\n\r\n private _styleCoord: [number, number, number, number] = [0, 0, 0, 0];\r\n\r\n private _hideTimeout: number;\r\n\r\n private _alwaysShowContent: boolean = false;\r\n\r\n private _enterable = true;\r\n\r\n private _inContent: boolean;\r\n\r\n private _hideDelay: number;\r\n\r\n el: ZRText;\r\n\r\n constructor(api: ExtensionAPI) {\r\n this._zr = api.getZr();\r\n makeStyleCoord(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\r\n }\r\n\r\n /**\r\n * Update when tooltip is rendered\r\n */\r\n update(tooltipModel: Model) {\r\n const alwaysShowContent = tooltipModel.get('alwaysShowContent');\r\n alwaysShowContent && this._moveIfResized();\r\n\r\n // update alwaysShowContent\r\n this._alwaysShowContent = alwaysShowContent;\r\n }\r\n\r\n show() {\r\n if (this._hideTimeout) {\r\n clearTimeout(this._hideTimeout);\r\n }\r\n\r\n this.el.show();\r\n this._show = true;\r\n }\r\n\r\n /**\r\n * Set tooltip content\r\n */\r\n setContent(\r\n content: string | HTMLElement | HTMLElement[],\r\n markupStyleCreator: TooltipMarkupStyleCreator,\r\n tooltipModel: Model,\r\n borderColor: ZRColor,\r\n arrowPosition: TooltipOption['position']\r\n ) {\r\n if (zrUtil.isObject(content)) {\r\n throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\r\n }\r\n if (this.el) {\r\n this._zr.remove(this.el);\r\n }\r\n\r\n const textStyleModel = tooltipModel.getModel('textStyle');\r\n\r\n this.el = new ZRText({\r\n style: {\r\n rich: markupStyleCreator.richTextStyles,\r\n text: content as string,\r\n lineHeight: 22,\r\n borderWidth: 1,\r\n borderColor: borderColor as string,\r\n textShadowColor: textStyleModel.get('textShadowColor'),\r\n fill: tooltipModel.get(['textStyle', 'color']),\r\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\r\n verticalAlign: 'top',\r\n align: 'left'\r\n },\r\n z: tooltipModel.get('z')\r\n });\r\n zrUtil.each([\r\n 'backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'\r\n ] as const, propName => {\r\n (this.el.style as any)[propName] = tooltipModel.get(propName);\r\n });\r\n zrUtil.each([\r\n 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'\r\n ] as const, propName => {\r\n this.el.style[propName] = textStyleModel.get(propName) || 0;\r\n });\r\n\r\n this._zr.add(this.el);\r\n\r\n const self = this;\r\n this.el.on('mouseover', function () {\r\n // clear the timeout in hideLater and keep showing tooltip\r\n if (self._enterable) {\r\n clearTimeout(self._hideTimeout);\r\n self._show = true;\r\n }\r\n self._inContent = true;\r\n });\r\n this.el.on('mouseout', function () {\r\n if (self._enterable) {\r\n if (self._show) {\r\n self.hideLater(self._hideDelay);\r\n }\r\n }\r\n self._inContent = false;\r\n });\r\n }\r\n\r\n setEnterable(enterable?: boolean) {\r\n this._enterable = enterable;\r\n }\r\n\r\n getSize() {\r\n const el = this.el;\r\n const bounding = this.el.getBoundingRect();\r\n // bounding rect does not include shadow. For renderMode richText,\r\n // if overflow, it will be cut. So calculate them accurately.\r\n const shadowOuterSize = calcShadowOuterSize(el.style);\r\n return [\r\n bounding.width + shadowOuterSize.left + shadowOuterSize.right,\r\n bounding.height + shadowOuterSize.top + shadowOuterSize.bottom\r\n ];\r\n }\r\n\r\n moveTo(x: number, y: number) {\r\n const el = this.el;\r\n if (el) {\r\n const styleCoord = this._styleCoord;\r\n makeStyleCoord(styleCoord, this._zr, x, y);\r\n x = styleCoord[0];\r\n y = styleCoord[1];\r\n const style = el.style;\r\n const borderWidth = mathMaxWith0(style.borderWidth || 0);\r\n const shadowOuterSize = calcShadowOuterSize(style);\r\n // rich text x, y do not include border.\r\n el.x = x + borderWidth + shadowOuterSize.left;\r\n el.y = y + borderWidth + shadowOuterSize.top;\r\n el.markRedraw();\r\n }\r\n }\r\n\r\n\r\n /**\r\n * when `alwaysShowContent` is true,\r\n * move the tooltip after chart resized\r\n */\r\n _moveIfResized() {\r\n // The ratio of left to width\r\n const ratioX = this._styleCoord[2];\r\n // The ratio of top to height\r\n const ratioY = this._styleCoord[3];\r\n this.moveTo(\r\n ratioX * this._zr.getWidth(),\r\n ratioY * this._zr.getHeight()\r\n );\r\n }\r\n\r\n hide() {\r\n if (this.el) {\r\n this.el.hide();\r\n }\r\n this._show = false;\r\n }\r\n\r\n hideLater(time?: number) {\r\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\r\n if (time) {\r\n this._hideDelay = time;\r\n // Set show false to avoid invoke hideLater multiple times\r\n this._show = false;\r\n this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time) as any;\r\n }\r\n else {\r\n this.hide();\r\n }\r\n }\r\n }\r\n\r\n isShow() {\r\n return this._show;\r\n }\r\n\r\n dispose() {\r\n this._zr.remove(this.el);\r\n }\r\n}\r\n\r\nfunction mathMaxWith0(val: number): number {\r\n return Math.max(0, val);\r\n}\r\n\r\nfunction calcShadowOuterSize(style: TextStyleProps) {\r\n const shadowBlur = mathMaxWith0(style.shadowBlur || 0);\r\n const shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\r\n const shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\r\n return {\r\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\r\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\r\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\r\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\r\n };\r\n}\r\n\r\nfunction makeStyleCoord(out: number[], zr: ZRenderType, zrX: number, zrY: number) {\r\n out[0] = zrX;\r\n out[1] = zrY;\r\n out[2] = out[0] / zr.getWidth();\r\n out[3] = out[1] / zr.getHeight();\r\n}\r\n\r\nexport default TooltipRichContent;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport { bind, each, clone, trim, isString, isFunction, isArray, isObject, extend } from 'zrender/src/core/util';\r\nimport env from 'zrender/src/core/env';\r\nimport TooltipHTMLContent from './TooltipHTMLContent';\r\nimport TooltipRichContent from './TooltipRichContent';\r\nimport { convertToColorString, encodeHTML, formatTpl, TooltipMarker } from '../../util/format';\r\nimport { parsePercent } from '../../util/number';\r\nimport { Rect } from '../../util/graphic';\r\nimport findPointFromSeries from '../axisPointer/findPointFromSeries';\r\nimport { getLayoutRect } from '../../util/layout';\r\nimport Model from '../../model/Model';\r\nimport * as globalListener from '../axisPointer/globalListener';\r\nimport * as axisHelper from '../../coord/axisHelper';\r\nimport * as axisPointerViewHelper from '../axisPointer/viewHelper';\r\nimport { getTooltipRenderMode, preParseFinder, queryReferringComponents } from '../../util/model';\r\nimport ComponentView from '../../view/Component';\r\nimport { format as timeFormat } from '../../util/time';\r\nimport {\r\n HorizontalAlign,\r\n VerticalAlign,\r\n ZRRectLike,\r\n BoxLayoutOptionMixin,\r\n CallbackDataParams,\r\n TooltipRenderMode,\r\n ECElement,\r\n CommonTooltipOption,\r\n ZRColor,\r\n ComponentMainType,\r\n ComponentItemTooltipOption\r\n} from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport TooltipModel, { TooltipOption } from './TooltipModel';\r\nimport Element from 'zrender/src/Element';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport { ECData, getECData } from '../../util/innerStore';\r\nimport { shouldTooltipConfine } from './helper';\r\nimport { DataByCoordSys, DataByAxis } from '../axisPointer/axisTrigger';\r\nimport { normalizeTooltipFormatResult } from '../../model/mixin/dataFormat';\r\nimport { createTooltipMarkup, buildTooltipMarkup, TooltipMarkupStyleCreator } from './tooltipMarkup';\r\nimport { findEventDispatcher } from '../../util/event';\r\nimport { clear, createOrUpdate } from '../../util/throttle';\r\n\r\nconst proxyRect = new Rect({\r\n shape: { x: -1, y: -1, width: 2, height: 2 }\r\n});\r\n\r\ninterface DataIndex {\r\n seriesIndex: number\r\n dataIndex: number\r\n\r\n dataIndexInside: number\r\n}\r\n\r\ninterface ShowTipPayload {\r\n type?: 'showTip'\r\n from?: string\r\n\r\n // Type 1\r\n tooltip?: ECData['tooltipConfig']['option']\r\n\r\n // Type 2\r\n dataByCoordSys?: DataByCoordSys[]\r\n tooltipOption?: CommonTooltipOption\r\n\r\n // Type 3\r\n seriesIndex?: number\r\n dataIndex?: number\r\n\r\n // Type 4\r\n name?: string // target item name that enable tooltip.\r\n // legendIndex: 0,\r\n // toolboxId: 'some_id',\r\n // geoName: 'some_name',\r\n\r\n x?: number\r\n y?: number\r\n position?: TooltipOption['position']\r\n\r\n dispatchAction?: ExtensionAPI['dispatchAction']\r\n}\r\n\r\ninterface HideTipPayload {\r\n type?: 'hideTip'\r\n from?: string\r\n\r\n dispatchAction?: ExtensionAPI['dispatchAction']\r\n}\r\n\r\ninterface TryShowParams {\r\n target?: ECElement,\r\n\r\n offsetX?: number\r\n offsetY?: number\r\n\r\n /**\r\n * Used for axis trigger.\r\n */\r\n dataByCoordSys?: DataByCoordSys[]\r\n\r\n tooltipOption?: ComponentItemTooltipOption\r\n\r\n position?: TooltipOption['position']\r\n /**\r\n * If `position` is not set in payload nor option, use it.\r\n */\r\n positionDefault?: TooltipOption['position']\r\n}\r\n\r\ntype TooltipCallbackDataParams = CallbackDataParams & {\r\n axisDim?: string\r\n axisIndex?: number\r\n axisType?: string\r\n axisId?: string\r\n // TODO: TYPE Value type\r\n axisValue?: string | number\r\n axisValueLabel?: string\r\n marker?: TooltipMarker\r\n};\r\n\r\nclass TooltipView extends ComponentView {\r\n static type = 'tooltip' as const;\r\n type = TooltipView.type;\r\n\r\n private _renderMode: TooltipRenderMode;\r\n\r\n private _tooltipModel: TooltipModel;\r\n\r\n private _ecModel: GlobalModel;\r\n\r\n private _api: ExtensionAPI;\r\n\r\n private _tooltipContent: TooltipHTMLContent | TooltipRichContent;\r\n\r\n private _refreshUpdateTimeout: number;\r\n\r\n private _lastX: number;\r\n private _lastY: number;\r\n\r\n private _ticket: string;\r\n\r\n private _showTimout: number;\r\n\r\n private _lastDataByCoordSys: DataByCoordSys[];\r\n private _cbParamsList: TooltipCallbackDataParams[];\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n if (env.node || !api.getDom()) {\r\n return;\r\n }\r\n\r\n const tooltipModel = ecModel.getComponent('tooltip') as TooltipModel;\r\n const renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode'));\r\n\r\n this._tooltipContent = renderMode === 'richText'\r\n ? new TooltipRichContent(api)\r\n : new TooltipHTMLContent(api, {\r\n appendTo: tooltipModel.get('appendToBody', true) ? 'body' : tooltipModel.get('appendTo', true)\r\n });\r\n }\r\n\r\n render(\r\n tooltipModel: TooltipModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n if (env.node || !api.getDom()) {\r\n return;\r\n }\r\n\r\n // Reset\r\n this.group.removeAll();\r\n\r\n this._tooltipModel = tooltipModel;\r\n\r\n this._ecModel = ecModel;\r\n\r\n this._api = api;\r\n\r\n const tooltipContent = this._tooltipContent;\r\n tooltipContent.update(tooltipModel);\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n\r\n this._initGlobalListener();\r\n\r\n this._keepShow();\r\n\r\n // PENDING\r\n // `mousemove` event will be triggered very frequently when the mouse moves fast,\r\n // which causes that the `updatePosition` function was also called frequently.\r\n // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101\r\n // To avoid frequent triggering,\r\n // consider throttling it in 50ms when transition is enabled\r\n if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) {\r\n createOrUpdate(this, '_updatePosition', 50, 'fixRate');\r\n }\r\n else {\r\n clear(this, '_updatePosition');\r\n }\r\n }\r\n\r\n private _initGlobalListener() {\r\n const tooltipModel = this._tooltipModel;\r\n const triggerOn = tooltipModel.get('triggerOn');\r\n\r\n globalListener.register(\r\n 'itemTooltip',\r\n this._api,\r\n bind(function (currTrigger, e, dispatchAction) {\r\n // If 'none', it is not controlled by mouse totally.\r\n if (triggerOn !== 'none') {\r\n if (triggerOn.indexOf(currTrigger) >= 0) {\r\n this._tryShow(e, dispatchAction);\r\n }\r\n else if (currTrigger === 'leave') {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n }, this)\r\n );\r\n }\r\n\r\n private _keepShow() {\r\n const tooltipModel = this._tooltipModel;\r\n const ecModel = this._ecModel;\r\n const api = this._api;\r\n const triggerOn = tooltipModel.get('triggerOn');\r\n\r\n // Try to keep the tooltip show when refreshing\r\n if (this._lastX != null\r\n && this._lastY != null\r\n // When user is willing to control tooltip totally using API,\r\n // self.manuallyShowTip({x, y}) might cause tooltip hide,\r\n // which is not expected.\r\n && triggerOn !== 'none'\r\n && triggerOn !== 'click'\r\n ) {\r\n const self = this;\r\n clearTimeout(this._refreshUpdateTimeout);\r\n this._refreshUpdateTimeout = setTimeout(function () {\r\n // Show tip next tick after other charts are rendered\r\n // In case highlight action has wrong result\r\n // FIXME\r\n !api.isDisposed() && self.manuallyShowTip(tooltipModel, ecModel, api, {\r\n x: self._lastX,\r\n y: self._lastY,\r\n dataByCoordSys: self._lastDataByCoordSys\r\n });\r\n }) as any;\r\n }\r\n }\r\n\r\n /**\r\n * Show tip manually by\r\n * dispatchAction({\r\n * type: 'showTip',\r\n * x: 10,\r\n * y: 10\r\n * });\r\n * Or\r\n * dispatchAction({\r\n * type: 'showTip',\r\n * seriesIndex: 0,\r\n * dataIndex or dataIndexInside or name\r\n * });\r\n *\r\n * TODO Batch\r\n */\r\n manuallyShowTip(\r\n tooltipModel: TooltipModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: ShowTipPayload\r\n ) {\r\n if (payload.from === this.uid || env.node || !api.getDom()) {\r\n return;\r\n }\r\n\r\n const dispatchAction = makeDispatchAction(payload, api);\r\n\r\n // Reset ticket\r\n this._ticket = '';\r\n\r\n // When triggered from axisPointer.\r\n const dataByCoordSys = payload.dataByCoordSys;\r\n\r\n const cmptRef = findComponentReference(payload, ecModel, api);\r\n\r\n if (cmptRef) {\r\n const rect = cmptRef.el.getBoundingRect().clone();\r\n rect.applyTransform(cmptRef.el.transform);\r\n this._tryShow({\r\n offsetX: rect.x + rect.width / 2,\r\n offsetY: rect.y + rect.height / 2,\r\n target: cmptRef.el,\r\n position: payload.position,\r\n // When manully trigger, the mouse is not on the el, so we'd better to\r\n // position tooltip on the bottom of the el and display arrow is possible.\r\n positionDefault: 'bottom'\r\n }, dispatchAction);\r\n }\r\n else if (payload.tooltip && payload.x != null && payload.y != null) {\r\n const el = proxyRect as unknown as ECElement;\r\n el.x = payload.x;\r\n el.y = payload.y;\r\n el.update();\r\n getECData(el).tooltipConfig = {\r\n name: null,\r\n option: payload.tooltip\r\n };\r\n // Manually show tooltip while view is not using zrender elements.\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n target: el\r\n }, dispatchAction);\r\n }\r\n else if (dataByCoordSys) {\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n dataByCoordSys: dataByCoordSys,\r\n tooltipOption: payload.tooltipOption\r\n }, dispatchAction);\r\n }\r\n else if (payload.seriesIndex != null) {\r\n\r\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\r\n return;\r\n }\r\n\r\n const pointInfo = findPointFromSeries(payload, ecModel);\r\n const cx = pointInfo.point[0];\r\n const cy = pointInfo.point[1];\r\n if (cx != null && cy != null) {\r\n this._tryShow({\r\n offsetX: cx,\r\n offsetY: cy,\r\n target: pointInfo.el,\r\n position: payload.position,\r\n // When manully trigger, the mouse is not on the el, so we'd better to\r\n // position tooltip on the bottom of the el and display arrow is possible.\r\n positionDefault: 'bottom'\r\n }, dispatchAction);\r\n }\r\n }\r\n else if (payload.x != null && payload.y != null) {\r\n // FIXME\r\n // should wrap dispatchAction like `axisPointer/globalListener` ?\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n x: payload.x,\r\n y: payload.y\r\n });\r\n\r\n this._tryShow({\r\n offsetX: payload.x,\r\n offsetY: payload.y,\r\n position: payload.position,\r\n target: api.getZr().findHover(payload.x, payload.y).target\r\n }, dispatchAction);\r\n }\r\n }\r\n\r\n manuallyHideTip(\r\n tooltipModel: TooltipModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: HideTipPayload\r\n ) {\r\n const tooltipContent = this._tooltipContent;\r\n\r\n if (this._tooltipModel) {\r\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\r\n }\r\n\r\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\r\n\r\n if (payload.from !== this.uid) {\r\n this._hide(makeDispatchAction(payload, api));\r\n }\r\n }\r\n\r\n // Be compatible with previous design, that is, when tooltip.type is 'axis' and\r\n // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\r\n // and tooltip.\r\n private _manuallyAxisShowTip(\r\n tooltipModel: TooltipModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: ShowTipPayload\r\n ) {\r\n const seriesIndex = payload.seriesIndex;\r\n const dataIndex = payload.dataIndex;\r\n // @ts-ignore\r\n const coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\r\n\r\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\r\n return;\r\n }\r\n\r\n const seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n if (!seriesModel) {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n const tooltipCascadedModel = buildTooltipModel([\r\n data.getItemModel(dataIndex),\r\n seriesModel as Model,\r\n (seriesModel.coordinateSystem || {}).model as Model\r\n ], this._tooltipModel);\r\n\r\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\r\n return;\r\n }\r\n\r\n api.dispatchAction({\r\n type: 'updateAxisPointer',\r\n seriesIndex: seriesIndex,\r\n dataIndex: dataIndex,\r\n position: payload.position\r\n });\r\n\r\n return true;\r\n }\r\n\r\n private _tryShow(\r\n e: TryShowParams,\r\n dispatchAction: ExtensionAPI['dispatchAction']\r\n ) {\r\n const el = e.target;\r\n const tooltipModel = this._tooltipModel;\r\n\r\n if (!tooltipModel) {\r\n return;\r\n }\r\n\r\n // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\r\n this._lastX = e.offsetX;\r\n this._lastY = e.offsetY;\r\n\r\n const dataByCoordSys = e.dataByCoordSys;\r\n if (dataByCoordSys && dataByCoordSys.length) {\r\n this._showAxisTooltip(dataByCoordSys, e);\r\n }\r\n else if (el) {\r\n const ecData = getECData(el);\r\n if (ecData.ssrType === 'legend') {\r\n // Don't trigger tooltip for legend tooltip item\r\n return;\r\n }\r\n this._lastDataByCoordSys = null;\r\n\r\n let seriesDispatcher: Element;\r\n let cmptDispatcher: Element;\r\n findEventDispatcher(el, (target) => {\r\n // Always show item tooltip if mouse is on the element with dataIndex\r\n if (getECData(target).dataIndex != null) {\r\n seriesDispatcher = target;\r\n return true;\r\n }\r\n // Tooltip provided directly. Like legend.\r\n if (getECData(target).tooltipConfig != null) {\r\n cmptDispatcher = target;\r\n return true;\r\n }\r\n }, true);\r\n\r\n if (seriesDispatcher) {\r\n this._showSeriesItemTooltip(e, seriesDispatcher, dispatchAction);\r\n }\r\n else if (cmptDispatcher) {\r\n this._showComponentItemTooltip(e, cmptDispatcher, dispatchAction);\r\n }\r\n else {\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n else {\r\n this._lastDataByCoordSys = null;\r\n this._hide(dispatchAction);\r\n }\r\n }\r\n\r\n private _showOrMove(\r\n tooltipModel: Model,\r\n cb: () => void\r\n ) {\r\n // showDelay is used in this case: tooltip.enterable is set\r\n // as true. User intent to move mouse into tooltip and click\r\n // something. `showDelay` makes it easier to enter the content\r\n // but tooltip do not move immediately.\r\n const delay = tooltipModel.get('showDelay');\r\n cb = bind(cb, this);\r\n clearTimeout(this._showTimout);\r\n delay > 0\r\n ? (this._showTimout = setTimeout(cb, delay) as any)\r\n : cb();\r\n }\r\n\r\n private _showAxisTooltip(\r\n dataByCoordSys: DataByCoordSys[],\r\n e: TryShowParams\r\n ) {\r\n const ecModel = this._ecModel;\r\n const globalTooltipModel = this._tooltipModel;\r\n const point = [e.offsetX, e.offsetY];\r\n const singleTooltipModel = buildTooltipModel(\r\n [e.tooltipOption],\r\n globalTooltipModel\r\n );\r\n const renderMode = this._renderMode;\r\n const cbParamsList: TooltipCallbackDataParams[] = [];\r\n const articleMarkup = createTooltipMarkup('section', {\r\n blocks: [],\r\n noHeader: true\r\n });\r\n // Only for legacy: `Serise['formatTooltip']` returns a string.\r\n const markupTextArrLegacy: string[] = [];\r\n const markupStyleCreator = new TooltipMarkupStyleCreator();\r\n\r\n each(dataByCoordSys, function (itemCoordSys) {\r\n each(itemCoordSys.dataByAxis, function (axisItem) {\r\n const axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex) as AxisBaseModel;\r\n const axisValue = axisItem.value;\r\n if (!axisModel || axisValue == null) {\r\n return;\r\n }\r\n const axisValueLabel = axisPointerViewHelper.getValueLabel(\r\n axisValue, axisModel.axis, ecModel,\r\n axisItem.seriesDataIndices,\r\n axisItem.valueLabelOpt\r\n );\r\n const axisSectionMarkup = createTooltipMarkup('section', {\r\n header: axisValueLabel,\r\n noHeader: !trim(axisValueLabel),\r\n sortBlocks: true,\r\n blocks: []\r\n });\r\n articleMarkup.blocks.push(axisSectionMarkup);\r\n\r\n each(axisItem.seriesDataIndices, function (idxItem) {\r\n const series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\r\n const dataIndex = idxItem.dataIndexInside;\r\n const cbParams = series.getDataParams(dataIndex) as TooltipCallbackDataParams;\r\n // Can't find data.\r\n if (cbParams.dataIndex < 0) {\r\n return;\r\n }\r\n\r\n cbParams.axisDim = axisItem.axisDim;\r\n cbParams.axisIndex = axisItem.axisIndex;\r\n cbParams.axisType = axisItem.axisType;\r\n cbParams.axisId = axisItem.axisId;\r\n cbParams.axisValue = axisHelper.getAxisRawValue(\r\n axisModel.axis, { value: axisValue as number }\r\n );\r\n cbParams.axisValueLabel = axisValueLabel;\r\n // Pre-create marker style for makers. Users can assemble richText\r\n // text in `formatter` callback and use those markers style.\r\n cbParams.marker = markupStyleCreator.makeTooltipMarker(\r\n 'item', convertToColorString(cbParams.color), renderMode\r\n );\r\n\r\n const seriesTooltipResult = normalizeTooltipFormatResult(\r\n series.formatTooltip(dataIndex, true, null)\r\n );\r\n const frag = seriesTooltipResult.frag;\r\n if (frag) {\r\n const valueFormatter = buildTooltipModel(\r\n [series as Model],\r\n globalTooltipModel\r\n ).get('valueFormatter');\r\n axisSectionMarkup.blocks.push(valueFormatter ? extend({ valueFormatter }, frag) : frag);\r\n }\r\n if (seriesTooltipResult.text) {\r\n markupTextArrLegacy.push(seriesTooltipResult.text);\r\n }\r\n cbParamsList.push(cbParams);\r\n });\r\n });\r\n });\r\n\r\n // In most cases, the second axis is displays upper on the first one.\r\n // So we reverse it to look better.\r\n articleMarkup.blocks.reverse();\r\n markupTextArrLegacy.reverse();\r\n\r\n const positionExpr = e.position;\r\n const orderMode = singleTooltipModel.get('order');\r\n\r\n const builtMarkupText = buildTooltipMarkup(\r\n articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'),\r\n singleTooltipModel.get('textStyle')\r\n );\r\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\r\n const blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\r\n const allMarkupText = markupTextArrLegacy.join(blockBreak);\r\n\r\n this._showOrMove(singleTooltipModel, function (this: TooltipView) {\r\n if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {\r\n this._updatePosition(\r\n singleTooltipModel,\r\n positionExpr,\r\n point[0], point[1],\r\n this._tooltipContent,\r\n cbParamsList\r\n );\r\n }\r\n else {\r\n this._showTooltipContent(\r\n singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '',\r\n point[0], point[1], positionExpr, null, markupStyleCreator\r\n );\r\n }\r\n });\r\n\r\n // Do not trigger events here, because this branch only be entered\r\n // from dispatchAction.\r\n }\r\n\r\n private _showSeriesItemTooltip(\r\n e: TryShowParams,\r\n dispatcher: ECElement,\r\n dispatchAction: ExtensionAPI['dispatchAction']\r\n ) {\r\n const ecModel = this._ecModel;\r\n const ecData = getECData(dispatcher);\r\n // Use dataModel in element if possible\r\n // Used when mouseover on a element like markPoint or edge\r\n // In which case, the data is not main data in series.\r\n const seriesIndex = ecData.seriesIndex;\r\n const seriesModel = ecModel.getSeriesByIndex(seriesIndex);\r\n\r\n // For example, graph link.\r\n const dataModel = ecData.dataModel || seriesModel;\r\n const dataIndex = ecData.dataIndex;\r\n const dataType = ecData.dataType;\r\n const data = dataModel.getData(dataType);\r\n const renderMode = this._renderMode;\r\n\r\n const positionDefault = e.positionDefault;\r\n const tooltipModel = buildTooltipModel(\r\n [\r\n data.getItemModel(dataIndex),\r\n dataModel,\r\n seriesModel && (seriesModel.coordinateSystem || {}).model as Model\r\n ],\r\n this._tooltipModel,\r\n positionDefault ? { position: positionDefault } : null\r\n );\r\n\r\n const tooltipTrigger = tooltipModel.get('trigger');\r\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\r\n return;\r\n }\r\n\r\n const params = dataModel.getDataParams(dataIndex, dataType);\r\n const markupStyleCreator = new TooltipMarkupStyleCreator();\r\n // Pre-create marker style for makers. Users can assemble richText\r\n // text in `formatter` callback and use those markers style.\r\n params.marker = markupStyleCreator.makeTooltipMarker(\r\n 'item', convertToColorString(params.color), renderMode\r\n );\r\n\r\n const seriesTooltipResult = normalizeTooltipFormatResult(\r\n dataModel.formatTooltip(dataIndex, false, dataType)\r\n );\r\n const orderMode = tooltipModel.get('order');\r\n const valueFormatter = tooltipModel.get('valueFormatter');\r\n const frag = seriesTooltipResult.frag;\r\n const markupText = frag ? buildTooltipMarkup(\r\n valueFormatter ? extend({ valueFormatter }, frag) : frag,\r\n markupStyleCreator,\r\n renderMode,\r\n orderMode,\r\n ecModel.get('useUTC'),\r\n tooltipModel.get('textStyle')\r\n )\r\n : seriesTooltipResult.text;\r\n\r\n const asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\r\n\r\n this._showOrMove(tooltipModel, function (this: TooltipView) {\r\n this._showTooltipContent(\r\n tooltipModel, markupText, params, asyncTicket,\r\n e.offsetX, e.offsetY, e.position, e.target,\r\n markupStyleCreator\r\n );\r\n });\r\n\r\n // FIXME\r\n // duplicated showtip if manuallyShowTip is called from dispatchAction.\r\n dispatchAction({\r\n type: 'showTip',\r\n dataIndexInside: dataIndex,\r\n dataIndex: data.getRawIndex(dataIndex),\r\n seriesIndex: seriesIndex,\r\n from: this.uid\r\n });\r\n }\r\n\r\n private _showComponentItemTooltip(\r\n e: TryShowParams,\r\n el: ECElement,\r\n dispatchAction: ExtensionAPI['dispatchAction']\r\n ) {\r\n const isHTMLRenderMode = this._renderMode === 'html';\r\n const ecData = getECData(el);\r\n const tooltipConfig = ecData.tooltipConfig;\r\n let tooltipOpt = tooltipConfig.option || {};\r\n let encodeHTMLContent = tooltipOpt.encodeHTMLContent;\r\n if (isString(tooltipOpt)) {\r\n const content = tooltipOpt;\r\n tooltipOpt = {\r\n content: content,\r\n // Fixed formatter\r\n formatter: content\r\n };\r\n // when `tooltipConfig.option` is a string rather than an object,\r\n // we can't know if the content needs to be encoded\r\n // for the sake of security, encode it by default.\r\n encodeHTMLContent = true;\r\n }\r\n\r\n if (encodeHTMLContent && isHTMLRenderMode && tooltipOpt.content) {\r\n // clone might be unnecessary?\r\n tooltipOpt = clone(tooltipOpt);\r\n tooltipOpt.content = encodeHTML(tooltipOpt.content);\r\n }\r\n\r\n const tooltipModelCascade = [tooltipOpt] as TooltipModelOptionCascade[];\r\n const cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);\r\n if (cmpt) {\r\n tooltipModelCascade.push(cmpt as Model);\r\n }\r\n // In most cases, component tooltip formatter has different params with series tooltip formatter,\r\n // so that they cannot share the same formatter. Since the global tooltip formatter is used for series\r\n // by convention, we do not use it as the default formatter for component.\r\n tooltipModelCascade.push({ formatter: tooltipOpt.content });\r\n\r\n const positionDefault = e.positionDefault;\r\n const subTooltipModel = buildTooltipModel(\r\n tooltipModelCascade,\r\n this._tooltipModel,\r\n positionDefault ? { position: positionDefault } : null\r\n );\r\n\r\n const defaultHtml = subTooltipModel.get('content');\r\n const asyncTicket = Math.random() + '';\r\n // PENDING: this case do not support richText style yet.\r\n const markupStyleCreator = new TooltipMarkupStyleCreator();\r\n\r\n // Do not check whether `trigger` is 'none' here, because `trigger`\r\n // only works on coordinate system. In fact, we have not found case\r\n // that requires setting `trigger` nothing on component yet.\r\n\r\n this._showOrMove(subTooltipModel, function (this: TooltipView) {\r\n // Use formatterParams from element defined in component\r\n // Avoid users modify it.\r\n const formatterParams = clone(subTooltipModel.get('formatterParams') as any || {});\r\n this._showTooltipContent(\r\n subTooltipModel, defaultHtml, formatterParams,\r\n asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator\r\n );\r\n });\r\n\r\n // If not dispatch showTip, tip may be hide triggered by axis.\r\n dispatchAction({\r\n type: 'showTip',\r\n from: this.uid\r\n });\r\n }\r\n\r\n private _showTooltipContent(\r\n // Use Model insteadof TooltipModel because this model may be from series or other options.\r\n // Instead of top level tooltip.\r\n tooltipModel: Model,\r\n defaultHtml: string,\r\n params: TooltipCallbackDataParams | TooltipCallbackDataParams[],\r\n asyncTicket: string,\r\n x: number,\r\n y: number,\r\n positionExpr: TooltipOption['position'],\r\n el: ECElement,\r\n markupStyleCreator: TooltipMarkupStyleCreator\r\n ) {\r\n // Reset ticket\r\n this._ticket = '';\r\n\r\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\r\n return;\r\n }\r\n\r\n const tooltipContent = this._tooltipContent;\r\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\r\n\r\n const formatter = tooltipModel.get('formatter');\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n let html: string | HTMLElement | HTMLElement[] = defaultHtml;\r\n const nearPoint = this._getNearestPoint(\r\n [x, y],\r\n params,\r\n tooltipModel.get('trigger'),\r\n tooltipModel.get('borderColor')\r\n );\r\n const nearPointColor = nearPoint.color;\r\n\r\n if (formatter) {\r\n if (isString(formatter)) {\r\n const useUTC = tooltipModel.ecModel.get('useUTC');\r\n const params0 = isArray(params) ? params[0] : params;\r\n const isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\r\n html = formatter;\r\n if (isTimeAxis) {\r\n html = timeFormat(params0.axisValue, html, useUTC);\r\n }\r\n html = formatTpl(html, params, true);\r\n }\r\n else if (isFunction(formatter)) {\r\n const callback = bind(function (cbTicket: string, html: string | HTMLElement | HTMLElement[]) {\r\n if (cbTicket === this._ticket) {\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\r\n this._updatePosition(\r\n tooltipModel, positionExpr, x, y, tooltipContent, params, el\r\n );\r\n }\r\n }, this);\r\n this._ticket = asyncTicket;\r\n html = formatter(params, asyncTicket, callback);\r\n }\r\n else {\r\n html = formatter;\r\n }\r\n }\r\n\r\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\r\n tooltipContent.show(tooltipModel, nearPointColor);\r\n this._updatePosition(\r\n tooltipModel, positionExpr, x, y, tooltipContent, params, el\r\n );\r\n\r\n }\r\n\r\n private _getNearestPoint(\r\n point: number[],\r\n tooltipDataParams: TooltipCallbackDataParams | TooltipCallbackDataParams[],\r\n trigger: TooltipOption['trigger'],\r\n borderColor: ZRColor\r\n ): {\r\n color: ZRColor;\r\n } {\r\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\r\n return {\r\n color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none')\r\n };\r\n }\r\n\r\n if (!isArray(tooltipDataParams)) {\r\n return {\r\n color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor\r\n };\r\n }\r\n }\r\n\r\n _updatePosition(\r\n tooltipModel: Model,\r\n positionExpr: TooltipOption['position'],\r\n x: number, // Mouse x\r\n y: number, // Mouse y\r\n content: TooltipHTMLContent | TooltipRichContent,\r\n params: TooltipCallbackDataParams | TooltipCallbackDataParams[],\r\n el?: Element\r\n ) {\r\n const viewWidth = this._api.getWidth();\r\n const viewHeight = this._api.getHeight();\r\n\r\n positionExpr = positionExpr || tooltipModel.get('position');\r\n\r\n const contentSize = content.getSize();\r\n let align = tooltipModel.get('align');\r\n let vAlign = tooltipModel.get('verticalAlign');\r\n const rect = el && el.getBoundingRect().clone();\r\n el && rect.applyTransform(el.transform);\r\n\r\n if (isFunction(positionExpr)) {\r\n // Callback of position can be an array or a string specify the position\r\n positionExpr = positionExpr([x, y], params, content.el, rect, {\r\n viewSize: [viewWidth, viewHeight],\r\n contentSize: contentSize.slice() as [number, number]\r\n });\r\n }\r\n\r\n if (isArray(positionExpr)) {\r\n x = parsePercent(positionExpr[0], viewWidth);\r\n y = parsePercent(positionExpr[1], viewHeight);\r\n }\r\n else if (isObject(positionExpr)) {\r\n const boxLayoutPosition = positionExpr as BoxLayoutOptionMixin;\r\n boxLayoutPosition.width = contentSize[0];\r\n boxLayoutPosition.height = contentSize[1];\r\n const layoutRect = getLayoutRect(\r\n boxLayoutPosition, { width: viewWidth, height: viewHeight }\r\n );\r\n x = layoutRect.x;\r\n y = layoutRect.y;\r\n align = null;\r\n // When positionExpr is left/top/right/bottom,\r\n // align and verticalAlign will not work.\r\n vAlign = null;\r\n }\r\n // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\r\n else if (isString(positionExpr) && el) {\r\n const pos = calcTooltipPosition(\r\n positionExpr, rect, contentSize, tooltipModel.get('borderWidth')\r\n );\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n else {\r\n const pos = refixTooltipPosition(\r\n x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20\r\n );\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n\r\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\r\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\r\n\r\n if (shouldTooltipConfine(tooltipModel)) {\r\n const pos = confineTooltipPosition(\r\n x, y, content, viewWidth, viewHeight\r\n );\r\n x = pos[0];\r\n y = pos[1];\r\n }\r\n\r\n content.moveTo(x, y);\r\n }\r\n\r\n // FIXME\r\n // Should we remove this but leave this to user?\r\n private _updateContentNotChangedOnAxis(\r\n dataByCoordSys: DataByCoordSys[],\r\n cbParamsList: TooltipCallbackDataParams[]\r\n ) {\r\n const lastCoordSys = this._lastDataByCoordSys;\r\n const lastCbParamsList = this._cbParamsList;\r\n let contentNotChanged = !!lastCoordSys\r\n && lastCoordSys.length === dataByCoordSys.length;\r\n\r\n contentNotChanged && each(lastCoordSys, (lastItemCoordSys, indexCoordSys) => {\r\n const lastDataByAxis = lastItemCoordSys.dataByAxis || [] as DataByAxis[];\r\n const thisItemCoordSys = dataByCoordSys[indexCoordSys] || {} as DataByCoordSys;\r\n const thisDataByAxis = thisItemCoordSys.dataByAxis || [] as DataByAxis[];\r\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\r\n\r\n contentNotChanged && each(lastDataByAxis, (lastItem, indexAxis) => {\r\n const thisItem = thisDataByAxis[indexAxis] || {} as DataByAxis;\r\n const lastIndices = lastItem.seriesDataIndices || [] as DataIndex[];\r\n const newIndices = thisItem.seriesDataIndices || [] as DataIndex[];\r\n\r\n contentNotChanged = contentNotChanged\r\n && lastItem.value === thisItem.value\r\n && lastItem.axisType === thisItem.axisType\r\n && lastItem.axisId === thisItem.axisId\r\n && lastIndices.length === newIndices.length;\r\n\r\n contentNotChanged && each(lastIndices, (lastIdxItem, j) => {\r\n const newIdxItem = newIndices[j];\r\n contentNotChanged = contentNotChanged\r\n && lastIdxItem.seriesIndex === newIdxItem.seriesIndex\r\n && lastIdxItem.dataIndex === newIdxItem.dataIndex;\r\n });\r\n\r\n // check is cbParams data value changed\r\n lastCbParamsList && each(lastItem.seriesDataIndices, (idxItem) => {\r\n const seriesIdx = idxItem.seriesIndex;\r\n const cbParams = cbParamsList[seriesIdx];\r\n const lastCbParams = lastCbParamsList[seriesIdx];\r\n if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {\r\n contentNotChanged = false;\r\n }\r\n });\r\n });\r\n });\r\n\r\n this._lastDataByCoordSys = dataByCoordSys;\r\n this._cbParamsList = cbParamsList;\r\n\r\n return !!contentNotChanged;\r\n }\r\n\r\n private _hide(dispatchAction: ExtensionAPI['dispatchAction']) {\r\n // Do not directly hideLater here, because this behavior may be prevented\r\n // in dispatchAction when showTip is dispatched.\r\n\r\n // FIXME\r\n // duplicated hideTip if manuallyHideTip is called from dispatchAction.\r\n this._lastDataByCoordSys = null;\r\n dispatchAction({\r\n type: 'hideTip',\r\n from: this.uid\r\n });\r\n }\r\n\r\n dispose(ecModel: GlobalModel, api: ExtensionAPI) {\r\n if (env.node || !api.getDom()) {\r\n return;\r\n }\r\n clear(this, '_updatePosition');\r\n this._tooltipContent.dispose();\r\n globalListener.unregister('itemTooltip', api);\r\n }\r\n}\r\n\r\ntype TooltipableOption = {\r\n tooltip?: CommonTooltipOption;\r\n};\r\ntype TooltipModelOptionCascade =\r\n Model | CommonTooltipOption | string;\r\n/**\r\n * From top to bottom. (the last one should be globalTooltipModel);\r\n */\r\nfunction buildTooltipModel(\r\n modelCascade: TooltipModelOptionCascade[],\r\n globalTooltipModel: TooltipModel,\r\n defaultTooltipOption?: CommonTooltipOption\r\n): Model> {\r\n // Last is always tooltip model.\r\n const ecModel = globalTooltipModel.ecModel;\r\n let resultModel: Model>;\r\n\r\n if (defaultTooltipOption) {\r\n resultModel = new Model(defaultTooltipOption, ecModel, ecModel);\r\n resultModel = new Model(globalTooltipModel.option, resultModel, ecModel);\r\n }\r\n else {\r\n resultModel = globalTooltipModel as Model>;\r\n }\r\n\r\n for (let i = modelCascade.length - 1; i >= 0; i--) {\r\n let tooltipOpt = modelCascade[i];\r\n if (tooltipOpt) {\r\n if (tooltipOpt instanceof Model) {\r\n tooltipOpt = (tooltipOpt as Model).get('tooltip', true);\r\n }\r\n // In each data item tooltip can be simply write:\r\n // {\r\n // value: 10,\r\n // tooltip: 'Something you need to know'\r\n // }\r\n if (isString(tooltipOpt)) {\r\n tooltipOpt = {\r\n formatter: tooltipOpt\r\n };\r\n }\r\n if (tooltipOpt) {\r\n resultModel = new Model(tooltipOpt, resultModel, ecModel);\r\n }\r\n }\r\n }\r\n\r\n return resultModel as Model>;\r\n}\r\n\r\nfunction makeDispatchAction(payload: ShowTipPayload | HideTipPayload, api: ExtensionAPI) {\r\n return payload.dispatchAction || bind(api.dispatchAction, api);\r\n}\r\n\r\nfunction refixTooltipPosition(\r\n x: number, y: number,\r\n content: TooltipHTMLContent | TooltipRichContent,\r\n viewWidth: number, viewHeight: number,\r\n gapH: number, gapV: number\r\n) {\r\n const size = content.getSize();\r\n const width = size[0];\r\n const height = size[1];\r\n\r\n if (gapH != null) {\r\n // Add extra 2 pixels for this case:\r\n // At present the \"values\" in default tooltip are using CSS `float: right`.\r\n // When the right edge of the tooltip box is on the right side of the\r\n // viewport, the `float` layout might push the \"values\" to the second line.\r\n if (x + width + gapH + 2 > viewWidth) {\r\n x -= width + gapH;\r\n }\r\n else {\r\n x += gapH;\r\n }\r\n }\r\n if (gapV != null) {\r\n if (y + height + gapV > viewHeight) {\r\n y -= height + gapV;\r\n }\r\n else {\r\n y += gapV;\r\n }\r\n }\r\n return [x, y];\r\n}\r\n\r\nfunction confineTooltipPosition(\r\n x: number, y: number,\r\n content: TooltipHTMLContent | TooltipRichContent,\r\n viewWidth: number,\r\n viewHeight: number\r\n): [number, number] {\r\n const size = content.getSize();\r\n const width = size[0];\r\n const height = size[1];\r\n\r\n x = Math.min(x + width, viewWidth) - width;\r\n y = Math.min(y + height, viewHeight) - height;\r\n x = Math.max(x, 0);\r\n y = Math.max(y, 0);\r\n\r\n return [x, y];\r\n}\r\n\r\nfunction calcTooltipPosition(\r\n position: TooltipOption['position'],\r\n rect: ZRRectLike,\r\n contentSize: number[],\r\n borderWidth: number\r\n): [number, number] {\r\n const domWidth = contentSize[0];\r\n const domHeight = contentSize[1];\r\n const offset = Math.ceil(Math.SQRT2 * borderWidth) + 8;\r\n let x = 0;\r\n let y = 0;\r\n const rectWidth = rect.width;\r\n const rectHeight = rect.height;\r\n switch (position) {\r\n case 'inside':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'top':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y - domHeight - offset;\r\n break;\r\n case 'bottom':\r\n x = rect.x + rectWidth / 2 - domWidth / 2;\r\n y = rect.y + rectHeight + offset;\r\n break;\r\n case 'left':\r\n x = rect.x - domWidth - offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n break;\r\n case 'right':\r\n x = rect.x + rectWidth + offset;\r\n y = rect.y + rectHeight / 2 - domHeight / 2;\r\n }\r\n return [x, y];\r\n}\r\n\r\nfunction isCenterAlign(align: HorizontalAlign | VerticalAlign) {\r\n return align === 'center' || align === 'middle';\r\n}\r\n\r\n/**\r\n * Find target component by payload like:\r\n * ```js\r\n * { legendId: 'some_id', name: 'xxx' }\r\n * { toolboxIndex: 1, name: 'xxx' }\r\n * { geoName: 'some_name', name: 'xxx' }\r\n * ```\r\n * PENDING: at present only\r\n *\r\n * If not found, return null/undefined.\r\n */\r\nfunction findComponentReference(\r\n payload: ShowTipPayload,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n): {\r\n componentMainType: ComponentMainType;\r\n componentIndex: number;\r\n el: ECElement;\r\n} {\r\n const { queryOptionMap } = preParseFinder(payload);\r\n const componentMainType = queryOptionMap.keys()[0];\r\n if (!componentMainType || componentMainType === 'series') {\r\n return;\r\n }\r\n\r\n const queryResult = queryReferringComponents(\r\n ecModel,\r\n componentMainType,\r\n queryOptionMap.get(componentMainType),\r\n { useDefault: false, enableAll: false, enableNone: false }\r\n );\r\n const model = queryResult.models[0];\r\n if (!model) {\r\n return;\r\n }\r\n\r\n const view = api.getViewOfComponentModel(model);\r\n let el: ECElement;\r\n view.group.traverse((subEl: ECElement) => {\r\n const tooltipConfig = getECData(subEl).tooltipConfig;\r\n if (tooltipConfig && tooltipConfig.name === payload.name) {\r\n el = subEl;\r\n return true; // stop\r\n }\r\n });\r\n\r\n if (el) {\r\n return {\r\n componentMainType,\r\n componentIndex: model.componentIndex,\r\n el\r\n };\r\n }\r\n}\r\n\r\nexport default TooltipView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { install as installAxisPointer } from '../axisPointer/install';\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport TooltipModel from './TooltipModel';\r\nimport TooltipView from './TooltipView';\r\nimport { noop } from 'zrender/src/core/util';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installAxisPointer);\r\n\r\n registers.registerComponentModel(TooltipModel);\r\n registers.registerComponentView(TooltipView);\r\n /**\r\n * @action\r\n * @property {string} type\r\n * @property {number} seriesIndex\r\n * @property {number} dataIndex\r\n * @property {number} [x]\r\n * @property {number} [y]\r\n */\r\n registers.registerAction(\r\n {\r\n type: 'showTip',\r\n event: 'showTip',\r\n update: 'tooltip:manuallyShowTip'\r\n },\r\n noop\r\n );\r\n\r\n registers.registerAction(\r\n {\r\n type: 'hideTip',\r\n event: 'hideTip',\r\n update: 'tooltip:manuallyHideTip'\r\n },\r\n noop\r\n );\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { ECUnitOption, Dictionary } from '../../util/types';\r\nimport { BrushOption, BrushToolboxIconType } from './BrushModel';\r\nimport { ToolboxOption } from '../toolbox/ToolboxModel';\r\nimport { ToolboxBrushFeatureOption } from '../toolbox/feature/Brush';\r\nimport { normalizeToArray } from '../../util/model';\r\n\r\nconst DEFAULT_TOOLBOX_BTNS: BrushToolboxIconType[] = ['rect', 'polygon', 'keep', 'clear'];\r\n\r\nexport default function brushPreprocessor(option: ECUnitOption, isNew: boolean): void {\r\n const brushComponents = normalizeToArray(option ? option.brush : []);\r\n\r\n if (!brushComponents.length) {\r\n return;\r\n }\r\n\r\n let brushComponentSpecifiedBtns = [] as string[];\r\n\r\n zrUtil.each(brushComponents, function (brushOpt: BrushOption) {\r\n const tbs = brushOpt.hasOwnProperty('toolbox')\r\n ? brushOpt.toolbox : [];\r\n\r\n if (tbs instanceof Array) {\r\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\r\n }\r\n });\r\n\r\n let toolbox: ToolboxOption = option && option.toolbox;\r\n\r\n if (zrUtil.isArray(toolbox)) {\r\n toolbox = toolbox[0];\r\n }\r\n if (!toolbox) {\r\n toolbox = {feature: {}};\r\n option.toolbox = [toolbox];\r\n }\r\n\r\n const toolboxFeature = (toolbox.feature || (toolbox.feature = {}));\r\n const toolboxBrush = (toolboxFeature.brush || (toolboxFeature.brush = {})) as ToolboxBrushFeatureOption;\r\n const brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\r\n\r\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\r\n\r\n removeDuplicate(brushTypes);\r\n\r\n if (isNew && !brushTypes.length) {\r\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\r\n }\r\n}\r\n\r\nfunction removeDuplicate(arr: string[]): void {\r\n const map = {} as Dictionary;\r\n zrUtil.each(arr, function (val) {\r\n map[val] = 1;\r\n });\r\n arr.length = 0;\r\n zrUtil.each(map, function (flag, val) {\r\n arr.push(val);\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * @file Visual solution, for consistent option specification.\r\n */\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport VisualMapping, { VisualMappingOption } from './VisualMapping';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport {\r\n BuiltinVisualProperty,\r\n ParsedValue,\r\n DimensionLoose,\r\n StageHandlerProgressExecutor,\r\n DimensionIndex\r\n} from '../util/types';\r\nimport SeriesData from '../data/SeriesData';\r\nimport { getItemVisualFromData, setItemVisualFromData } from './helper';\r\n\r\nconst each = zrUtil.each;\r\n\r\ntype VisualMappingCollection\r\n = {\r\n [key in VisualState]?: {\r\n [key in BuiltinVisualProperty]?: VisualMapping\r\n } & {\r\n __alphaForOpacity?: VisualMapping\r\n }\r\n };\r\n\r\nfunction hasKeys(obj: Dictionary) {\r\n if (obj) {\r\n for (const name in obj) {\r\n if (obj.hasOwnProperty(name)) {\r\n return true;\r\n }\r\n }\r\n }\r\n}\r\n\r\ntype VisualOption = {[key in BuiltinVisualProperty]?: any};\r\n\r\n\r\nexport function createVisualMappings(\r\n option: Partial>,\r\n stateList: readonly VisualState[],\r\n supplementVisualOption: (mappingOption: VisualMappingOption, state: string) => void\r\n) {\r\n const visualMappings: VisualMappingCollection = {};\r\n\r\n each(stateList, function (state) {\r\n const mappings = visualMappings[state] = createMappings();\r\n\r\n each(option[state], function (visualData: VisualOption, visualType: BuiltinVisualProperty) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n let mappingOption = {\r\n type: visualType,\r\n visual: visualData\r\n };\r\n supplementVisualOption && supplementVisualOption(mappingOption, state);\r\n mappings[visualType] = new VisualMapping(mappingOption);\r\n\r\n // Prepare a alpha for opacity, for some case that opacity\r\n // is not supported, such as rendering using gradient color.\r\n if (visualType === 'opacity') {\r\n mappingOption = zrUtil.clone(mappingOption);\r\n mappingOption.type = 'colorAlpha';\r\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\r\n }\r\n });\r\n });\r\n\r\n return visualMappings;\r\n\r\n function createMappings() {\r\n const Creater = function () {};\r\n // Make sure hidden fields will not be visited by\r\n // object iteration (with hasOwnProperty checking).\r\n Creater.prototype.__hidden = Creater.prototype;\r\n const obj = new (Creater as any)();\r\n return obj;\r\n }\r\n}\r\n\r\nexport function replaceVisualOption(\r\n thisOption: Partial>, newOption: Partial>, keys: readonly T[]\r\n) {\r\n // Visual attributes merge is not supported, otherwise it\r\n // brings overcomplicated merge logic. See #2853. So if\r\n // newOption has anyone of these keys, all of these keys\r\n // will be reset. Otherwise, all keys remain.\r\n let has;\r\n zrUtil.each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n has = true;\r\n }\r\n });\r\n has && zrUtil.each(keys, function (key) {\r\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\r\n thisOption[key] = zrUtil.clone(newOption[key]);\r\n }\r\n else {\r\n delete thisOption[key];\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * @param stateList\r\n * @param visualMappings\r\n * @param list\r\n * @param getValueState param: valueOrIndex, return: state.\r\n * @param scope Scope for getValueState\r\n * @param dimension Concrete dimension, if used.\r\n */\r\n// ???! handle brush?\r\nexport function applyVisual(\r\n stateList: readonly VisualState[],\r\n visualMappings: VisualMappingCollection,\r\n data: SeriesData,\r\n getValueState: (this: Scope, valueOrIndex: ParsedValue | number) => VisualState,\r\n scope?: Scope,\r\n dimension?: DimensionLoose\r\n) {\r\n const visualTypesMap: Partial> = {};\r\n zrUtil.each(stateList, function (state) {\r\n const visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n\r\n let dataIndex: number;\r\n\r\n function getVisual(key: string) {\r\n return getItemVisualFromData(data, dataIndex, key) as string | number;\r\n }\r\n\r\n function setVisual(key: string, value: any) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n\r\n if (dimension == null) {\r\n data.each(eachItem);\r\n }\r\n else {\r\n data.each([dimension], eachItem);\r\n }\r\n\r\n function eachItem(valueOrIndex: ParsedValue | number, index?: number) {\r\n dataIndex = dimension == null\r\n ? valueOrIndex as number // First argument is index\r\n : index;\r\n\r\n const rawDataItem = data.getRawDataItem(dataIndex);\r\n // Consider performance\r\n // @ts-ignore\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n return;\r\n }\r\n\r\n const valueState = getValueState.call(scope, valueOrIndex);\r\n const mappings = visualMappings[valueState];\r\n const visualTypes = visualTypesMap[valueState];\r\n\r\n for (let i = 0, len = visualTypes.length; i < len; i++) {\r\n const type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(\r\n valueOrIndex, getVisual, setVisual\r\n );\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @param data\r\n * @param stateList\r\n * @param visualMappings >\r\n * @param getValueState param: valueOrIndex, return: state.\r\n * @param dim dimension or dimension index.\r\n */\r\nexport function incrementalApplyVisual(\r\n stateList: readonly VisualState[],\r\n visualMappings: VisualMappingCollection,\r\n getValueState: (valueOrIndex: ParsedValue | number) => VisualState,\r\n dim?: DimensionLoose\r\n): StageHandlerProgressExecutor {\r\n const visualTypesMap: Partial> = {};\r\n zrUtil.each(stateList, function (state) {\r\n const visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\r\n visualTypesMap[state] = visualTypes;\r\n });\r\n\r\n return {\r\n progress: function progress(params, data) {\r\n let dimIndex: DimensionIndex;\r\n if (dim != null) {\r\n dimIndex = data.getDimensionIndex(dim);\r\n }\r\n\r\n function getVisual(key: string) {\r\n return getItemVisualFromData(data, dataIndex, key) as string | number;\r\n }\r\n\r\n function setVisual(key: string, value: any) {\r\n setItemVisualFromData(data, dataIndex, key, value);\r\n }\r\n\r\n let dataIndex: number;\r\n const store = data.getStore();\r\n while ((dataIndex = params.next()) != null) {\r\n const rawDataItem = data.getRawDataItem(dataIndex);\r\n\r\n // Consider performance\r\n // @ts-ignore\r\n if (rawDataItem && rawDataItem.visualMap === false) {\r\n continue;\r\n }\r\n\r\n const value = dim != null\r\n ? store.get(dimIndex, dataIndex)\r\n : dataIndex;\r\n\r\n const valueState = getValueState(value);\r\n const mappings = visualMappings[valueState];\r\n const visualTypes = visualTypesMap[valueState];\r\n\r\n for (let i = 0, len = visualTypes.length; i < len; i++) {\r\n const type = visualTypes[i];\r\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\r\n }\r\n }\r\n }\r\n };\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as polygonContain from 'zrender/src/contain/polygon';\r\nimport BoundingRect, { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport {linePolygonIntersect} from '../../util/graphic';\r\nimport { BrushType, BrushDimensionMinMax } from '../helper/BrushController';\r\nimport { BrushAreaParamInternal } from './BrushModel';\r\n\r\n\r\nexport interface BrushSelectableArea extends BrushAreaParamInternal {\r\n boundingRect: BoundingRect;\r\n selectors: BrushCommonSelectorsForSeries\r\n}\r\n\r\n/**\r\n * Key of the first level is brushType: `line`, `rect`, `polygon`.\r\n * See moudule:echarts/component/helper/BrushController\r\n * function param:\r\n * {Object} itemLayout fetch from data.getItemLayout(dataIndex)\r\n * {Object} selectors {point: selector, rect: selector, ...}\r\n * {Object} area {range: [[], [], ..], boudingRect}\r\n * function return:\r\n * {boolean} Whether in the given brush.\r\n */\r\ninterface BrushSelectorOnBrushType {\r\n // For chart element type \"point\"\r\n point(\r\n // fetch from data.getItemLayout(dataIndex)\r\n itemLayout: number[],\r\n selectors: BrushCommonSelectorsForSeries,\r\n area: BrushSelectableArea\r\n ): boolean;\r\n // For chart element type \"rect\"\r\n rect(\r\n // fetch from data.getItemLayout(dataIndex)\r\n itemLayout: RectLike,\r\n selectors: BrushCommonSelectorsForSeries,\r\n area: BrushSelectableArea\r\n ): boolean;\r\n}\r\n\r\n/**\r\n * This methods are corresponding to `BrushSelectorOnBrushType`,\r\n * but `area: BrushSelectableArea` is binded to each method.\r\n */\r\nexport interface BrushCommonSelectorsForSeries {\r\n // For chart element type \"point\"\r\n point(itemLayout: number[]): boolean;\r\n // For chart element type \"rect\"\r\n rect(itemLayout: RectLike): boolean;\r\n}\r\n\r\nexport function makeBrushCommonSelectorForSeries(\r\n area: BrushSelectableArea\r\n): BrushCommonSelectorsForSeries {\r\n const brushType = area.brushType;\r\n // Do not use function binding or curry for performance.\r\n const selectors: BrushCommonSelectorsForSeries = {\r\n point(itemLayout: number[]) {\r\n return selector[brushType].point(itemLayout, selectors, area);\r\n },\r\n rect(itemLayout: RectLike) {\r\n return selector[brushType].rect(itemLayout, selectors, area);\r\n }\r\n };\r\n return selectors;\r\n}\r\n\r\nconst selector: Record = {\r\n lineX: getLineSelectors(0),\r\n lineY: getLineSelectors(1),\r\n rect: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n return itemLayout && area.boundingRect.intersect(itemLayout);\r\n }\r\n },\r\n polygon: {\r\n point: function (itemLayout, selectors, area) {\r\n return itemLayout\r\n && area.boundingRect.contain(\r\n itemLayout[0], itemLayout[1]\r\n )\r\n && polygonContain.contain(\r\n area.range as BrushDimensionMinMax[], itemLayout[0], itemLayout[1]\r\n );\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n const points = area.range as BrushDimensionMinMax[];\r\n\r\n if (!itemLayout || points.length <= 1) {\r\n return false;\r\n }\r\n\r\n const x = itemLayout.x;\r\n const y = itemLayout.y;\r\n const width = itemLayout.width;\r\n const height = itemLayout.height;\r\n const p = points[0];\r\n\r\n if (polygonContain.contain(points, x, y)\r\n || polygonContain.contain(points, x + width, y)\r\n || polygonContain.contain(points, x, y + height)\r\n || polygonContain.contain(points, x + width, y + height)\r\n || BoundingRect.create(itemLayout).contain(p[0], p[1])\r\n || linePolygonIntersect(x, y, x + width, y, points)\r\n || linePolygonIntersect(x, y, x, y + height, points)\r\n || linePolygonIntersect(x + width, y, x + width, y + height, points)\r\n || linePolygonIntersect(x, y + height, x + width, y + height, points)\r\n ) {\r\n return true;\r\n }\r\n }\r\n }\r\n};\r\n\r\nfunction getLineSelectors(xyIndex: 0 | 1): BrushSelectorOnBrushType {\r\n const xy = ['x', 'y'] as const;\r\n const wh = ['width', 'height'] as const;\r\n\r\n return {\r\n point: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n const range = area.range as BrushDimensionMinMax;\r\n const p = itemLayout[xyIndex];\r\n return inLineRange(p, range);\r\n }\r\n },\r\n rect: function (itemLayout, selectors, area) {\r\n if (itemLayout) {\r\n const range = area.range as BrushDimensionMinMax;\r\n const layoutRange = [\r\n itemLayout[xy[xyIndex]],\r\n itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]\r\n ];\r\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\r\n return inLineRange(layoutRange[0], range)\r\n || inLineRange(layoutRange[1], range)\r\n || inLineRange(range[0], layoutRange)\r\n || inLineRange(range[1], layoutRange);\r\n }\r\n }\r\n };\r\n}\r\n\r\nfunction inLineRange(p: number, range: BrushDimensionMinMax): boolean {\r\n return range[0] <= p && p <= range[1];\r\n}\r\n\r\nexport default selector;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport BoundingRect from 'zrender/src/core/BoundingRect';\r\nimport * as visualSolution from '../../visual/visualSolution';\r\nimport { BrushSelectableArea, makeBrushCommonSelectorForSeries } from './selector';\r\nimport * as throttleUtil from '../../util/throttle';\r\nimport BrushTargetManager from '../helper/BrushTargetManager';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Payload } from '../../util/types';\r\nimport BrushModel, { BrushAreaParamInternal } from './BrushModel';\r\nimport SeriesModel from '../../model/Series';\r\nimport ParallelSeriesModel from '../../chart/parallel/ParallelSeries';\r\nimport { ZRenderType } from 'zrender/src/zrender';\r\nimport { BrushType, BrushDimensionMinMax } from '../helper/BrushController';\r\n\r\ntype BrushVisualState = 'inBrush' | 'outOfBrush';\r\n\r\nconst STATE_LIST = ['inBrush', 'outOfBrush'] as const;\r\nconst DISPATCH_METHOD = '__ecBrushSelect' as const;\r\nconst DISPATCH_FLAG = '__ecInBrushSelectEvent' as const;\r\n\r\ninterface BrushGlobalDispatcher extends ZRenderType {\r\n [DISPATCH_FLAG]: boolean;\r\n [DISPATCH_METHOD]: typeof doDispatch;\r\n}\r\n\r\ninterface BrushSelectedItem {\r\n brushId: string;\r\n brushIndex: number;\r\n brushName: string;\r\n areas: BrushAreaParamInternal[];\r\n selected: {\r\n seriesId: string;\r\n seriesIndex: number;\r\n seriesName: string;\r\n dataIndex: number[];\r\n }[]\r\n};\r\n\r\nexport function layoutCovers(ecModel: GlobalModel): void {\r\n ecModel.eachComponent({mainType: 'brush'}, function (brushModel: BrushModel) {\r\n const brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\r\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\r\n });\r\n}\r\n\r\n/**\r\n * Register the visual encoding if this modules required.\r\n */\r\nexport default function brushVisual(ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n\r\n const brushSelected: BrushSelectedItem[] = [];\r\n let throttleType;\r\n let throttleDelay;\r\n\r\n ecModel.eachComponent({mainType: 'brush'}, function (brushModel: BrushModel) {\r\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(\r\n payload.key === 'brush' ? payload.brushOption : {brushType: false}\r\n );\r\n });\r\n\r\n layoutCovers(ecModel);\r\n\r\n\r\n ecModel.eachComponent({mainType: 'brush'}, function (brushModel: BrushModel, brushIndex) {\r\n\r\n const thisBrushSelected: BrushSelectedItem = {\r\n brushId: brushModel.id,\r\n brushIndex: brushIndex,\r\n brushName: brushModel.name,\r\n areas: zrUtil.clone(brushModel.areas),\r\n selected: []\r\n };\r\n // Every brush component exists in event params, convenient\r\n // for user to find by index.\r\n brushSelected.push(thisBrushSelected);\r\n\r\n const brushOption = brushModel.option;\r\n const brushLink = brushOption.brushLink;\r\n const linkedSeriesMap: {[seriesIndex: number]: 0 | 1} = [];\r\n const selectedDataIndexForLink: {[dataIndex: number]: 0 | 1} = [];\r\n const rangeInfoBySeries: {[seriesIndex: number]: BrushSelectableArea[]} = [];\r\n let hasBrushExists = false;\r\n\r\n if (!brushIndex) { // Only the first throttle setting works.\r\n throttleType = brushOption.throttleType;\r\n throttleDelay = brushOption.throttleDelay;\r\n }\r\n\r\n // Add boundingRect and selectors to range.\r\n const areas: BrushSelectableArea[] = zrUtil.map(brushModel.areas, function (area) {\r\n const builder = boundingRectBuilders[area.brushType];\r\n const selectableArea = zrUtil.defaults(\r\n {boundingRect: builder ? builder(area) : void 0},\r\n area\r\n ) as BrushSelectableArea;\r\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\r\n return selectableArea;\r\n });\r\n\r\n const visualMappings = visualSolution.createVisualMappings(\r\n brushModel.option, STATE_LIST, function (mappingOption) {\r\n mappingOption.mappingMethod = 'fixed';\r\n }\r\n );\r\n\r\n zrUtil.isArray(brushLink) && zrUtil.each(brushLink, function (seriesIndex) {\r\n linkedSeriesMap[seriesIndex] = 1;\r\n });\r\n\r\n function linkOthers(seriesIndex: number): boolean {\r\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\r\n }\r\n\r\n // If no supported brush or no brush on the series,\r\n // all visuals should be in original state.\r\n function brushed(rangeInfoList: BrushSelectableArea[]): boolean {\r\n return !!rangeInfoList.length;\r\n }\r\n\r\n /**\r\n * Logic for each series: (If the logic has to be modified one day, do it carefully!)\r\n *\r\n * ( brushed \u252C && \u252ChasBrushExist \u252C && linkOthers ) => StepA: \u252Crecord, \u252C StepB: \u252CvisualByRecord.\r\n * !brushed\u2518 \u251ChasBrushExist \u2524 \u2514nothing,\u2518 \u251CvisualByRecord.\r\n * \u2514!hasBrushExist\u2518 \u2514nothing.\r\n * ( !brushed && \u252ChasBrushExist \u252C && linkOthers ) => StepA: nothing, StepB: \u252CvisualByRecord.\r\n * \u2514!hasBrushExist\u2518 \u2514nothing.\r\n * ( brushed \u252C && !linkOthers ) => StepA: nothing, StepB: \u252CvisualByCheck.\r\n * !brushed\u2518 \u2514nothing.\r\n * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing.\r\n */\r\n\r\n // Step A\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n const rangeInfoList: BrushSelectableArea[] = rangeInfoBySeries[seriesIndex] = [];\r\n\r\n seriesModel.subType === 'parallel'\r\n ? stepAParallel(seriesModel as ParallelSeriesModel, seriesIndex)\r\n : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\r\n });\r\n\r\n function stepAParallel(seriesModel: ParallelSeriesModel, seriesIndex: number): void {\r\n const coordSys = seriesModel.coordinateSystem;\r\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\r\n\r\n linkOthers(seriesIndex) && coordSys.eachActiveState(\r\n seriesModel.getData(),\r\n function (activeState, dataIndex) {\r\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\r\n }\r\n );\r\n }\r\n\r\n function stepAOthers(\r\n seriesModel: SeriesModel, seriesIndex: number, rangeInfoList: BrushSelectableArea[]\r\n ): void {\r\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\r\n return;\r\n }\r\n\r\n zrUtil.each(areas, function (area) {\r\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\r\n rangeInfoList.push(area);\r\n }\r\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\r\n });\r\n\r\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\r\n const data = seriesModel.getData();\r\n data.each(function (dataIndex) {\r\n if (checkInRange(seriesModel, rangeInfoList, data, dataIndex)) {\r\n selectedDataIndexForLink[dataIndex] = 1;\r\n }\r\n });\r\n }\r\n }\r\n\r\n // Step B\r\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\r\n const seriesBrushSelected: BrushSelectedItem['selected'][0] = {\r\n seriesId: seriesModel.id,\r\n seriesIndex: seriesIndex,\r\n seriesName: seriesModel.name,\r\n dataIndex: []\r\n };\r\n // Every series exists in event params, convenient\r\n // for user to find series by seriesIndex.\r\n thisBrushSelected.selected.push(seriesBrushSelected);\r\n\r\n const rangeInfoList = rangeInfoBySeries[seriesIndex];\r\n\r\n const data = seriesModel.getData();\r\n const getValueState = linkOthers(seriesIndex)\r\n ? function (dataIndex: number): BrushVisualState {\r\n return selectedDataIndexForLink[dataIndex]\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n }\r\n : function (dataIndex: number): BrushVisualState {\r\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex)\r\n ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush')\r\n : 'outOfBrush';\r\n };\r\n\r\n // If no supported brush or no brush, all visuals are in original state.\r\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList))\r\n && visualSolution.applyVisual(\r\n STATE_LIST, visualMappings, data, getValueState\r\n );\r\n });\r\n\r\n });\r\n\r\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\r\n};\r\n\r\nfunction dispatchAction(\r\n api: ExtensionAPI,\r\n throttleType: throttleUtil.ThrottleType,\r\n throttleDelay: number,\r\n brushSelected: BrushSelectedItem[],\r\n payload: Payload\r\n): void {\r\n // This event will not be triggered when `setOpion`, otherwise dead lock may\r\n // triggered when do `setOption` in event listener, which we do not find\r\n // satisfactory way to solve yet. Some considered resolutions:\r\n // (a) Diff with prevoius selected data ant only trigger event when changed.\r\n // But store previous data and diff precisely (i.e., not only by dataIndex, but\r\n // also detect value changes in selected data) might bring complexity or fragility.\r\n // (b) Use spectial param like `silent` to suppress event triggering.\r\n // But such kind of volatile param may be weird in `setOption`.\r\n if (!payload) {\r\n return;\r\n }\r\n\r\n const zr = api.getZr() as BrushGlobalDispatcher;\r\n if (zr[DISPATCH_FLAG]) {\r\n return;\r\n }\r\n\r\n if (!zr[DISPATCH_METHOD]) {\r\n zr[DISPATCH_METHOD] = doDispatch;\r\n }\r\n\r\n const fn = throttleUtil.createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\r\n\r\n fn(api, brushSelected);\r\n}\r\n\r\nfunction doDispatch(api: ExtensionAPI, brushSelected: BrushSelectedItem[]): void {\r\n if (!api.isDisposed()) {\r\n const zr = api.getZr() as BrushGlobalDispatcher;\r\n zr[DISPATCH_FLAG] = true;\r\n api.dispatchAction({\r\n type: 'brushSelect',\r\n batch: brushSelected\r\n });\r\n zr[DISPATCH_FLAG] = false;\r\n }\r\n}\r\n\r\nfunction checkInRange(\r\n seriesModel: SeriesModel,\r\n rangeInfoList: BrushSelectableArea[],\r\n data: ReturnType,\r\n dataIndex: number\r\n) {\r\n for (let i = 0, len = rangeInfoList.length; i < len; i++) {\r\n const area = rangeInfoList[i];\r\n if (seriesModel.brushSelector(\r\n dataIndex, data, area.selectors, area\r\n )) {\r\n return true;\r\n }\r\n }\r\n}\r\n\r\nfunction brushModelNotControll(brushModel: BrushModel, seriesIndex: number): boolean {\r\n const seriesIndices = brushModel.option.seriesIndex;\r\n return seriesIndices != null\r\n && seriesIndices !== 'all'\r\n && (\r\n zrUtil.isArray(seriesIndices)\r\n ? zrUtil.indexOf(seriesIndices, seriesIndex) < 0\r\n : seriesIndex !== seriesIndices\r\n );\r\n}\r\n\r\ntype AreaBoundingRectBuilder = (area: BrushAreaParamInternal) => BoundingRect;\r\nconst boundingRectBuilders: Partial> = {\r\n\r\n rect: function (area) {\r\n return getBoundingRectFromMinMax(area.range as BrushDimensionMinMax[]);\r\n },\r\n\r\n polygon: function (area) {\r\n let minMax;\r\n const range = area.range as BrushDimensionMinMax[];\r\n\r\n for (let i = 0, len = range.length; i < len; i++) {\r\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\r\n const rg = range[i];\r\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\r\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\r\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\r\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\r\n }\r\n\r\n return minMax && getBoundingRectFromMinMax(minMax);\r\n }\r\n};\r\n\r\n\r\nfunction getBoundingRectFromMinMax(minMax: BrushDimensionMinMax[]): BoundingRect {\r\n return new BoundingRect(\r\n minMax[0][0],\r\n minMax[1][0],\r\n minMax[0][1] - minMax[0][0],\r\n minMax[1][1] - minMax[1][0]\r\n );\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport BrushController, { BrushControllerEvents, BrushCoverConfig } from '../helper/BrushController';\r\nimport {layoutCovers} from './visualEncoding';\r\nimport BrushModel from './BrushModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Payload } from '../../util/types';\r\nimport ComponentView from '../../view/Component';\r\n\r\n\r\nclass BrushView extends ComponentView {\r\n\r\n static type = 'brush';\r\n readonly type = BrushView.type;\r\n\r\n ecModel: GlobalModel;\r\n api: ExtensionAPI;\r\n model: BrushModel;\r\n private _brushController: BrushController;\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI): void {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n this.model;\r\n\r\n (this._brushController = new BrushController(api.getZr()))\r\n .on('brush', zrUtil.bind(this._onBrush, this))\r\n .mount();\r\n }\r\n\r\n render(brushModel: BrushModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void {\r\n this.model = brushModel;\r\n this._updateController(brushModel, ecModel, api, payload);\r\n }\r\n\r\n updateTransform(brushModel: BrushModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n // PENDING: `updateTransform` is a little tricky, whose layout need\r\n // to be calculate mandatorily and other stages will not be performed.\r\n // Take care the correctness of the logic. See #11754 .\r\n layoutCovers(ecModel);\r\n this._updateController(brushModel, ecModel, api, payload);\r\n }\r\n\r\n updateVisual(brushModel: BrushModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n this.updateTransform(brushModel, ecModel, api, payload);\r\n }\r\n\r\n updateView(brushModel: BrushModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n this._updateController(brushModel, ecModel, api, payload);\r\n }\r\n\r\n private _updateController(brushModel: BrushModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) {\r\n // Do not update controller when drawing.\r\n (!payload || payload.$from !== brushModel.id) && this._brushController\r\n .setPanels(brushModel.brushTargetManager.makePanelOpts(api))\r\n .enableBrush(brushModel.brushOption)\r\n .updateCovers(brushModel.areas.slice() as BrushCoverConfig[]);\r\n }\r\n\r\n // updateLayout: updateController,\r\n\r\n // updateVisual: updateController,\r\n\r\n dispose() {\r\n this._brushController.dispose();\r\n }\r\n\r\n private _onBrush(eventParam: BrushControllerEvents['brush']): void {\r\n const modelId = this.model.id;\r\n\r\n const areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);\r\n\r\n // Action is not dispatched on drag end, because the drag end\r\n // emits the same params with the last drag move event, and\r\n // may have some delay when using touch pad, which makes\r\n // animation not smooth (when using debounce).\r\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\r\n type: 'brush',\r\n brushId: modelId,\r\n areas: zrUtil.clone(areas),\r\n $from: modelId\r\n });\r\n eventParam.isEnd && this.api.dispatchAction({\r\n type: 'brushEnd',\r\n brushId: modelId,\r\n areas: zrUtil.clone(areas),\r\n $from: modelId\r\n });\r\n }\r\n\r\n}\r\n\r\nexport default BrushView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as visualSolution from '../../visual/visualSolution';\r\nimport Model from '../../model/Model';\r\nimport { ComponentOption, ZRColor, VisualOptionFixed } from '../../util/types';\r\nimport ComponentModel from '../../model/Component';\r\nimport BrushTargetManager from '../helper/BrushTargetManager';\r\nimport {\r\n BrushCoverCreatorConfig, BrushMode, BrushCoverConfig, BrushDimensionMinMax,\r\n BrushAreaRange, BrushTypeUncertain, BrushType\r\n} from '../helper/BrushController';\r\nimport { ModelFinderObject } from '../../util/model';\r\n\r\nconst DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\r\n\r\n/**\r\n * The input to define brush areas.\r\n * (1) Can be created by user when calling dispatchAction.\r\n * (2) Can be created by `BrushController`\r\n * for brush behavior. area params are picked from `cover.__brushOptoin`.\r\n * In `BrushController`, \"covers\" are create or updated for each \"area\".\r\n */\r\nexport interface BrushAreaParam extends ModelFinderObject {\r\n brushType: BrushCoverConfig['brushType'];\r\n id?: BrushCoverConfig['id'];\r\n range?: BrushCoverConfig['range'];\r\n\r\n // `ModelFinderObject` and `panelId` are used to match \"coord sys target\"\r\n // for this area. See `BrushTargetManager['setInputRanges']`.\r\n // If panelId specified, use it to match panel firstly.\r\n // If not specified, use `ModelFinderObject` to match panel,\r\n // and then assign the panelId to the area.\r\n // If finally no panel matched, panelId keep null/undefined,\r\n // means global area.\r\n // PENDING: this feature should better belong to BrushController\r\n // rather than brush component?\r\n panelId?: BrushCoverConfig['panelId'];\r\n\r\n // Range in local coordinates of certain coordinate system.\r\n // When dispatchAction, if the area is the global area,\r\n // `range` is the input. if the area is not the global area,\r\n // `coordRange` is the input, and then convert to `range`.\r\n coordRange?: BrushAreaRange;\r\n // coord ranges, used in multiple cartesian in one grid.\r\n // Only for output to users.\r\n coordRanges?: BrushAreaRange[];\r\n\r\n __rangeOffset?: {\r\n offset: BrushDimensionMinMax[] | BrushDimensionMinMax,\r\n xyMinMax: BrushDimensionMinMax[]\r\n }\r\n}\r\n\r\n/**\r\n * Generated by `brushModel.setAreas`, which merges\r\n * `area: BrushAreaParam` and `brushModel.option: BrushOption`.\r\n * See `generateBrushOption`.\r\n */\r\nexport interface BrushAreaParamInternal extends BrushAreaParam {\r\n brushMode: BrushMode;\r\n brushStyle: BrushCoverConfig['brushStyle'];\r\n transformable: BrushCoverConfig['transformable'];\r\n removeOnClick: BrushCoverConfig['removeOnClick'];\r\n z: BrushCoverConfig['z'];\r\n\r\n __rangeOffset?: {\r\n offset: BrushDimensionMinMax | BrushDimensionMinMax[];\r\n xyMinMax: BrushDimensionMinMax[]\r\n };\r\n}\r\n\r\nexport type BrushToolboxIconType = BrushType | 'keep' | 'clear';\r\n\r\nexport interface BrushOption extends ComponentOption, ModelFinderObject {\r\n mainType?: 'brush';\r\n\r\n // Default value see preprocessor.\r\n toolbox?: BrushToolboxIconType[];\r\n\r\n // Series indices array, broadcast using dataIndex.\r\n // or 'all', which means all series. 'none'/null/undefined means no series.\r\n brushLink?: number[] | 'all' | 'none';\r\n\r\n // Throttle in brushSelected event. 'fixRate' or 'debounce'.\r\n // If null, no throttle. Valid only in the first brush component\r\n throttleType?: 'fixRate' | 'debounce';\r\n // Unit: ms, 0 means every event will be triggered.\r\n throttleDelay?: number;\r\n\r\n inBrush?: VisualOptionFixed;\r\n outOfBrush?: VisualOptionFixed;\r\n\r\n // --- Current painting brush options ---\r\n // Default type of brush\r\n brushType?: BrushTypeUncertain;\r\n brushStyle?: {\r\n borderWidth?: number;\r\n color?: ZRColor;\r\n borderColor?: ZRColor;\r\n };\r\n transformable?: boolean;\r\n brushMode?: BrushMode;\r\n removeOnClick?: boolean;\r\n}\r\n\r\nclass BrushModel extends ComponentModel {\r\n\r\n static type = 'brush' as const;\r\n type = BrushModel.type;\r\n\r\n static dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\r\n\r\n static defaultOption: BrushOption = {\r\n seriesIndex: 'all',\r\n brushType: 'rect',\r\n brushMode: 'single',\r\n transformable: true,\r\n brushStyle: {\r\n borderWidth: 1,\r\n color: 'rgba(210,219,238,0.3)',\r\n borderColor: '#D2DBEE'\r\n },\r\n throttleType: 'fixRate',\r\n throttleDelay: 0,\r\n removeOnClick: true,\r\n z: 10000\r\n };\r\n\r\n /**\r\n * @readOnly\r\n */\r\n areas: BrushAreaParamInternal[] = [];\r\n\r\n /**\r\n * Current activated brush type.\r\n * If null, brush is inactived.\r\n * see module:echarts/component/helper/BrushController\r\n * @readOnly\r\n */\r\n brushType: BrushTypeUncertain;\r\n\r\n /**\r\n * Current brush painting area settings.\r\n * @readOnly\r\n */\r\n brushOption: BrushCoverCreatorConfig = {} as BrushCoverCreatorConfig;\r\n\r\n // Inject\r\n brushTargetManager: BrushTargetManager;\r\n\r\n\r\n optionUpdated(newOption: BrushOption, isInit: boolean): void {\r\n const thisOption = this.option;\r\n\r\n !isInit && visualSolution.replaceVisualOption(\r\n thisOption, newOption, ['inBrush', 'outOfBrush']\r\n );\r\n\r\n const inBrush = thisOption.inBrush = thisOption.inBrush || {};\r\n // Always give default visual, consider setOption at the second time.\r\n thisOption.outOfBrush = thisOption.outOfBrush || {color: DEFAULT_OUT_OF_BRUSH_COLOR};\r\n\r\n if (!inBrush.hasOwnProperty('liftZ')) {\r\n // Bigger than the highlight z lift, otherwise it will\r\n // be effected by the highlight z when brush.\r\n inBrush.liftZ = 5;\r\n }\r\n }\r\n\r\n /**\r\n * If `areas` is null/undefined, range state remain.\r\n */\r\n setAreas(areas?: BrushAreaParam[]): void {\r\n if (__DEV__) {\r\n zrUtil.assert(zrUtil.isArray(areas));\r\n zrUtil.each(areas, function (area) {\r\n zrUtil.assert(area.brushType, 'Illegal areas');\r\n });\r\n }\r\n\r\n // If areas is null/undefined, range state remain.\r\n // This helps user to dispatchAction({type: 'brush'}) with no areas\r\n // set but just want to get the current brush select info from a `brush` event.\r\n if (!areas) {\r\n return;\r\n }\r\n\r\n this.areas = zrUtil.map(areas, function (area) {\r\n return generateBrushOption(this.option, area);\r\n }, this);\r\n }\r\n\r\n /**\r\n * Set the current painting brush option.\r\n */\r\n setBrushOption(brushOption: BrushCoverCreatorConfig): void {\r\n this.brushOption = generateBrushOption(this.option, brushOption);\r\n this.brushType = this.brushOption.brushType;\r\n }\r\n\r\n}\r\n\r\n\r\nfunction generateBrushOption(\r\n option: BrushOption, brushOption: BrushAreaParam\r\n): BrushAreaParamInternal;\r\nfunction generateBrushOption(\r\n option: BrushOption, brushOption: BrushCoverCreatorConfig\r\n): BrushCoverCreatorConfig;\r\nfunction generateBrushOption(\r\n option: BrushOption, brushOption: BrushAreaParam | BrushCoverCreatorConfig\r\n): BrushAreaParamInternal | BrushCoverCreatorConfig {\r\n return zrUtil.merge(\r\n {\r\n brushType: option.brushType,\r\n brushMode: option.brushMode,\r\n transformable: option.transformable,\r\n brushStyle: new Model(option.brushStyle).getItemStyle(),\r\n removeOnClick: option.removeOnClick,\r\n z: option.z\r\n },\r\n brushOption,\r\n true\r\n );\r\n}\r\n\r\nexport default BrushModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {\r\n ToolboxFeatureModel,\r\n ToolboxFeatureOption,\r\n ToolboxFeature\r\n} from '../featureManager';\r\nimport GlobalModel from '../../../model/Global';\r\nimport ExtensionAPI from '../../../core/ExtensionAPI';\r\nimport BrushModel from '../../brush/BrushModel';\r\nimport { BrushTypeUncertain } from '../../helper/BrushController';\r\n\r\nconst ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'] as const;\r\n\r\ntype IconType = typeof ICON_TYPES[number];\r\n\r\nexport interface ToolboxBrushFeatureOption extends ToolboxFeatureOption {\r\n type?: IconType[]\r\n icon?: {[key in IconType]?: string}\r\n title?: {[key in IconType]?: string}\r\n}\r\n\r\nclass BrushFeature extends ToolboxFeature {\r\n\r\n private _brushType: BrushTypeUncertain;\r\n private _brushMode: string;\r\n\r\n render(\r\n featureModel: ToolboxFeatureModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n let brushType: BrushTypeUncertain;\r\n let brushMode: string;\r\n let isBrushed: boolean;\r\n\r\n ecModel.eachComponent({mainType: 'brush'}, function (brushModel: BrushModel) {\r\n brushType = brushModel.brushType;\r\n brushMode = brushModel.brushOption.brushMode || 'single';\r\n isBrushed = isBrushed || !!brushModel.areas.length;\r\n });\r\n this._brushType = brushType;\r\n this._brushMode = brushMode;\r\n\r\n zrUtil.each(featureModel.get('type', true), function (type) {\r\n featureModel.setIconStatus(\r\n type,\r\n (\r\n type === 'keep'\r\n ? brushMode === 'multiple'\r\n : type === 'clear'\r\n ? isBrushed\r\n : type === brushType\r\n ) ? 'emphasis' : 'normal'\r\n );\r\n });\r\n }\r\n\r\n updateView(\r\n featureModel: ToolboxFeatureModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n this.render(featureModel, ecModel, api);\r\n }\r\n\r\n getIcons() {\r\n const model = this.model;\r\n const availableIcons = model.get('icon', true);\r\n const icons: ToolboxBrushFeatureOption['icon'] = {};\r\n zrUtil.each(model.get('type', true), function (type) {\r\n if (availableIcons[type]) {\r\n icons[type] = availableIcons[type];\r\n }\r\n });\r\n return icons;\r\n };\r\n\r\n onclick(ecModel: GlobalModel, api: ExtensionAPI, type: IconType) {\r\n const brushType = this._brushType;\r\n const brushMode = this._brushMode;\r\n\r\n if (type === 'clear') {\r\n // Trigger parallel action firstly\r\n api.dispatchAction({\r\n type: 'axisAreaSelect',\r\n intervals: []\r\n });\r\n\r\n api.dispatchAction({\r\n type: 'brush',\r\n command: 'clear',\r\n // Clear all areas of all brush components.\r\n areas: []\r\n });\r\n }\r\n else {\r\n api.dispatchAction({\r\n type: 'takeGlobalCursor',\r\n key: 'brush',\r\n brushOption: {\r\n brushType: type === 'keep'\r\n ? brushType\r\n : (brushType === type ? false : type),\r\n brushMode: type === 'keep'\r\n ? (brushMode === 'multiple' ? 'single' : 'multiple')\r\n : brushMode\r\n }\r\n });\r\n }\r\n };\r\n\r\n static getDefaultOption(ecModel: GlobalModel) {\r\n const defaultOption: ToolboxBrushFeatureOption = {\r\n show: true,\r\n type: ICON_TYPES.slice(),\r\n icon: {\r\n /* eslint-disable */\r\n 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\r\n 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\r\n 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\r\n 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\r\n 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\r\n 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\r\n /* eslint-enable */\r\n },\r\n // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`\r\n title: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title'])\r\n };\r\n\r\n return defaultOption;\r\n }\r\n}\r\n\r\nexport default BrushFeature;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport brushPreprocessor from './preprocessor';\r\nimport BrushView from './BrushView';\r\nimport BrushModel, { BrushAreaParam } from './BrushModel';\r\nimport brushVisual from './visualEncoding';\r\nimport { Payload } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\n\r\n// TODO\r\nimport BrushFeature from '../toolbox/feature/Brush';\r\nimport { registerFeature } from '../toolbox/featureManager';\r\n\r\nimport { noop } from 'zrender/src/core/util';\r\n\r\ninterface BrushPayload extends Payload {\r\n // If \"areas\" is empty, all of the select-boxes will be deleted\r\n areas?: BrushAreaParam[];\r\n}\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerComponentView(BrushView);\r\n registers.registerComponentModel(BrushModel);\r\n\r\n registers.registerPreprocessor(brushPreprocessor);\r\n\r\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);\r\n\r\n registers.registerAction(\r\n {type: 'brush', event: 'brush', update: 'updateVisual' },\r\n function (payload: BrushPayload, ecModel: GlobalModel) {\r\n ecModel.eachComponent(\r\n {mainType: 'brush', query: payload},\r\n function (brushModel: BrushModel) {\r\n brushModel.setAreas(payload.areas);\r\n }\r\n );\r\n }\r\n );\r\n\r\n /**\r\n * payload: {\r\n * brushComponents: [\r\n * {\r\n * brushId,\r\n * brushIndex,\r\n * brushName,\r\n * series: [\r\n * {\r\n * seriesId,\r\n * seriesIndex,\r\n * seriesName,\r\n * rawIndices: [21, 34, ...]\r\n * },\r\n * ...\r\n * ]\r\n * },\r\n * ...\r\n * ]\r\n * }\r\n */\r\n registers.registerAction(\r\n {type: 'brushSelect', event: 'brushSelected', update: 'none'},\r\n noop\r\n );\r\n\r\n registers.registerAction(\r\n {type: 'brushEnd', event: 'brushEnd', update: 'none'},\r\n noop\r\n );\r\n\r\n registerFeature('brush', BrushFeature);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport {getECData} from '../../util/innerStore';\r\nimport {createTextStyle} from '../../label/labelStyle';\r\nimport {getLayoutRect} from '../../util/layout';\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n ZRTextAlign,\r\n ZRTextVerticalAlign,\r\n ZRColor,\r\n BorderOptionMixin,\r\n LabelOption\r\n} from '../../util/types';\r\nimport ComponentView from '../../view/Component';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport {windowOpen} from '../../util/format';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\n\r\nexport interface TitleOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {\r\n\r\n mainType?: 'title'\r\n\r\n show?: boolean\r\n\r\n text?: string\r\n /**\r\n * Link to url\r\n */\r\n link?: string\r\n target?: 'self' | 'blank'\r\n\r\n subtext?: string\r\n sublink?: string\r\n subtarget?: 'self' | 'blank'\r\n\r\n textAlign?: ZRTextAlign\r\n textVerticalAlign?: ZRTextVerticalAlign\r\n\r\n /**\r\n * @deprecated Use textVerticalAlign instead\r\n */\r\n textBaseline?: ZRTextVerticalAlign\r\n\r\n backgroundColor?: ZRColor\r\n /**\r\n * Padding between text and border.\r\n * Support to be a single number or an array.\r\n */\r\n padding?: number | number[]\r\n /**\r\n * Gap between text and subtext\r\n */\r\n itemGap?: number\r\n\r\n textStyle?: LabelOption\r\n\r\n subtextStyle?: LabelOption\r\n\r\n /**\r\n * If trigger mouse or touch event\r\n */\r\n triggerEvent?: boolean\r\n\r\n /**\r\n * Radius of background border.\r\n */\r\n borderRadius?: number | number[]\r\n}\r\nclass TitleModel extends ComponentModel {\r\n static type = 'title' as const;\r\n type = TitleModel.type;\r\n\r\n readonly layoutMode = {type: 'box', ignoreSize: true} as const;\r\n\r\n static defaultOption: TitleOption = {\r\n // zlevel: 0,\r\n z: 6,\r\n show: true,\r\n\r\n text: '',\r\n target: 'blank',\r\n subtext: '',\r\n\r\n subtarget: 'blank',\r\n\r\n left: 0,\r\n top: 0,\r\n\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n\r\n borderColor: '#ccc',\r\n\r\n borderWidth: 0,\r\n\r\n padding: 5,\r\n\r\n itemGap: 10,\r\n textStyle: {\r\n fontSize: 18,\r\n fontWeight: 'bold',\r\n color: '#464646'\r\n },\r\n subtextStyle: {\r\n fontSize: 12,\r\n color: '#6E7079'\r\n }\r\n };\r\n}\r\n\r\n\r\n// View\r\nclass TitleView extends ComponentView {\r\n\r\n static type = 'title' as const;\r\n type = TitleView.type;\r\n\r\n\r\n render(titleModel: TitleModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.group.removeAll();\r\n\r\n if (!titleModel.get('show')) {\r\n return;\r\n }\r\n\r\n const group = this.group;\r\n\r\n const textStyleModel = titleModel.getModel('textStyle');\r\n const subtextStyleModel = titleModel.getModel('subtextStyle');\r\n\r\n let textAlign = titleModel.get('textAlign');\r\n let textVerticalAlign = zrUtil.retrieve2(\r\n titleModel.get('textBaseline'), titleModel.get('textVerticalAlign')\r\n );\r\n\r\n const textEl = new graphic.Text({\r\n style: createTextStyle(textStyleModel, {\r\n text: titleModel.get('text'),\r\n fill: textStyleModel.getTextColor()\r\n }, {disableBox: true}),\r\n z2: 10\r\n });\r\n\r\n const textRect = textEl.getBoundingRect();\r\n\r\n const subText = titleModel.get('subtext');\r\n const subTextEl = new graphic.Text({\r\n style: createTextStyle(subtextStyleModel, {\r\n text: subText,\r\n fill: subtextStyleModel.getTextColor(),\r\n y: textRect.height + titleModel.get('itemGap'),\r\n verticalAlign: 'top'\r\n }, {disableBox: true}),\r\n z2: 10\r\n });\r\n\r\n const link = titleModel.get('link');\r\n const sublink = titleModel.get('sublink');\r\n const triggerEvent = titleModel.get('triggerEvent', true);\r\n\r\n textEl.silent = !link && !triggerEvent;\r\n subTextEl.silent = !sublink && !triggerEvent;\r\n\r\n if (link) {\r\n textEl.on('click', function () {\r\n windowOpen(link, '_' + titleModel.get('target'));\r\n });\r\n }\r\n if (sublink) {\r\n subTextEl.on('click', function () {\r\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\r\n });\r\n }\r\n\r\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent\r\n ? {\r\n componentType: 'title',\r\n componentIndex: titleModel.componentIndex\r\n }\r\n : null;\r\n\r\n group.add(textEl);\r\n subText && group.add(subTextEl);\r\n // If no subText, but add subTextEl, there will be an empty line.\r\n\r\n let groupRect = group.getBoundingRect();\r\n const layoutOption = titleModel.getBoxLayoutParams();\r\n layoutOption.width = groupRect.width;\r\n layoutOption.height = groupRect.height;\r\n const layoutRect = getLayoutRect(\r\n layoutOption, {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n }, titleModel.get('padding')\r\n );\r\n // Adjust text align based on position\r\n if (!textAlign) {\r\n // Align left if title is on the left. center and right is same\r\n textAlign = (titleModel.get('left') || titleModel.get('right')) as ZRTextAlign;\r\n // @ts-ignore\r\n if (textAlign === 'middle') {\r\n textAlign = 'center';\r\n }\r\n // Adjust layout by text align\r\n if (textAlign === 'right') {\r\n layoutRect.x += layoutRect.width;\r\n }\r\n else if (textAlign === 'center') {\r\n layoutRect.x += layoutRect.width / 2;\r\n }\r\n }\r\n if (!textVerticalAlign) {\r\n textVerticalAlign = (titleModel.get('top') || titleModel.get('bottom')) as ZRTextVerticalAlign;\r\n // @ts-ignore\r\n if (textVerticalAlign === 'center') {\r\n textVerticalAlign = 'middle';\r\n }\r\n if (textVerticalAlign === 'bottom') {\r\n layoutRect.y += layoutRect.height;\r\n }\r\n else if (textVerticalAlign === 'middle') {\r\n layoutRect.y += layoutRect.height / 2;\r\n }\r\n\r\n textVerticalAlign = textVerticalAlign || 'top';\r\n }\r\n\r\n group.x = layoutRect.x;\r\n group.y = layoutRect.y;\r\n group.markRedraw();\r\n const alignStyle = {\r\n align: textAlign,\r\n verticalAlign: textVerticalAlign\r\n };\r\n textEl.setStyle(alignStyle);\r\n subTextEl.setStyle(alignStyle);\r\n\r\n // Render background\r\n // Get groupRect again because textAlign has been changed\r\n groupRect = group.getBoundingRect();\r\n const padding = layoutRect.margin;\r\n const style = titleModel.getItemStyle(['color', 'opacity']);\r\n style.fill = titleModel.get('backgroundColor');\r\n const rect = new graphic.Rect({\r\n shape: {\r\n x: groupRect.x - padding[3],\r\n y: groupRect.y - padding[0],\r\n width: groupRect.width + padding[1] + padding[3],\r\n height: groupRect.height + padding[0] + padding[2],\r\n r: titleModel.get('borderRadius')\r\n },\r\n style: style,\r\n subPixelOptimize: true,\r\n silent: true\r\n });\r\n\r\n group.add(rect);\r\n }\r\n}\r\n\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(TitleModel);\r\n registers.registerComponentView(TitleView);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ComponentModel from '../../model/Component';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n LayoutOrient,\r\n SymbolOptionMixin,\r\n LineStyleOption,\r\n ItemStyleOption,\r\n LabelOption,\r\n OptionDataValue,\r\n ZRColor,\r\n ColorString,\r\n CommonTooltipOption,\r\n CallbackDataParams,\r\n ZREasing\r\n} from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport GlobalModel, { GlobalModelSetOptionOpts } from '../../model/Global';\r\nimport { each, isObject, clone } from 'zrender/src/core/util';\r\nimport { convertOptionIdName, getDataItemValue } from '../../util/model';\r\n\r\n\r\nexport interface TimelineControlStyle extends ItemStyleOption {\r\n show?: boolean\r\n showPlayBtn?: boolean\r\n showPrevBtn?: boolean\r\n showNextBtn?: boolean\r\n itemSize?: number\r\n itemGap?: number\r\n position?: 'left' | 'right' | 'top' | 'bottom'\r\n playIcon?: string\r\n stopIcon?: string\r\n prevIcon?: string\r\n nextIcon?: string\r\n\r\n // Can be a percent value relative to itemSize\r\n playBtnSize?: number | string\r\n stopBtnSize?: number | string\r\n nextBtnSize?: number | string\r\n prevBtnSize?: number | string\r\n}\r\n\r\nexport interface TimelineCheckpointStyle extends ItemStyleOption,\r\n SymbolOptionMixin {\r\n animation?: boolean\r\n animationDuration?: number\r\n animationEasing?: ZREasing\r\n}\r\n\r\ninterface TimelineLineStyleOption extends LineStyleOption {\r\n show?: boolean\r\n}\r\n\r\ninterface TimelineLabelOption extends Omit {\r\n show?: boolean\r\n // number can be distance to the timeline axis. sign will determine the side.\r\n position?: 'auto' | 'left' | 'right' | 'top' | 'bottom' | number\r\n interval?: 'auto' | number\r\n formatter?: string | ((value: string | number, index: number) => string)\r\n}\r\n\r\nexport interface TimelineDataItemOption extends SymbolOptionMixin {\r\n value?: OptionDataValue\r\n itemStyle?: ItemStyleOption\r\n label?: TimelineLabelOption\r\n checkpointStyle?: TimelineCheckpointStyle\r\n\r\n emphasis?: {\r\n itemStyle?: ItemStyleOption\r\n label?: TimelineLabelOption\r\n checkpointStyle?: TimelineCheckpointStyle\r\n }\r\n\r\n // Style in progress\r\n progress?: {\r\n lineStyle?: TimelineLineStyleOption\r\n itemStyle?: ItemStyleOption\r\n label?: TimelineLabelOption\r\n }\r\n\r\n tooltip?: boolean\r\n}\r\n\r\nexport interface TimelineOption extends ComponentOption, BoxLayoutOptionMixin, SymbolOptionMixin {\r\n mainType?: 'timeline'\r\n\r\n backgroundColor?: ZRColor\r\n borderColor?: ColorString\r\n borderWidth?: number\r\n\r\n tooltip?: CommonTooltipOption & {\r\n trigger?: 'item'\r\n }\r\n\r\n show?: boolean\r\n\r\n axisType?: 'category' | 'time' | 'value'\r\n\r\n currentIndex?: number\r\n\r\n autoPlay?: boolean\r\n\r\n rewind?: boolean\r\n\r\n loop?: boolean\r\n\r\n playInterval?: number\r\n\r\n realtime?: boolean\r\n\r\n controlPosition?: 'left' | 'right' | 'top' | 'bottom'\r\n\r\n padding?: number | number[]\r\n\r\n orient?: LayoutOrient\r\n\r\n inverse?: boolean\r\n\r\n // If not specified, options will be changed by \"normalMerge\".\r\n // If specified, options will be changed by \"replaceMerge\".\r\n replaceMerge?: GlobalModelSetOptionOpts['replaceMerge']\r\n\r\n lineStyle?: TimelineLineStyleOption\r\n itemStyle?: ItemStyleOption\r\n checkpointStyle?: TimelineCheckpointStyle\r\n controlStyle?: TimelineControlStyle\r\n label?: TimelineLabelOption\r\n\r\n emphasis?: {\r\n lineStyle?: TimelineLineStyleOption\r\n itemStyle?: ItemStyleOption\r\n checkpointStyle?: TimelineCheckpointStyle\r\n controlStyle?: TimelineControlStyle\r\n label?: TimelineLabelOption\r\n }\r\n\r\n\r\n // Style in progress\r\n progress?: {\r\n lineStyle?: TimelineLineStyleOption\r\n itemStyle?: ItemStyleOption\r\n label?: TimelineLabelOption\r\n }\r\n\r\n data?: (OptionDataValue | TimelineDataItemOption)[]\r\n}\r\nclass TimelineModel extends ComponentModel {\r\n\r\n static type = 'timeline';\r\n type = TimelineModel.type;\r\n\r\n layoutMode = 'box';\r\n\r\n private _data: SeriesData;\r\n\r\n private _names: string[];\r\n\r\n /**\r\n * @override\r\n */\r\n init(option: TimelineOption, parentModel: Model, ecModel: GlobalModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._initData();\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n mergeOption(option: TimelineOption) {\r\n super.mergeOption.apply(this, arguments as any);\r\n this._initData();\r\n }\r\n\r\n setCurrentIndex(currentIndex: number) {\r\n if (currentIndex == null) {\r\n currentIndex = this.option.currentIndex;\r\n }\r\n const count = this._data.count();\r\n\r\n if (this.option.loop) {\r\n currentIndex = (currentIndex % count + count) % count;\r\n }\r\n else {\r\n currentIndex >= count && (currentIndex = count - 1);\r\n currentIndex < 0 && (currentIndex = 0);\r\n }\r\n\r\n this.option.currentIndex = currentIndex;\r\n }\r\n\r\n /**\r\n * @return {number} currentIndex\r\n */\r\n getCurrentIndex() {\r\n return this.option.currentIndex;\r\n }\r\n\r\n /**\r\n * @return {boolean}\r\n */\r\n isIndexMax() {\r\n return this.getCurrentIndex() >= this._data.count() - 1;\r\n }\r\n\r\n /**\r\n * @param {boolean} state true: play, false: stop\r\n */\r\n setPlayState(state: boolean) {\r\n this.option.autoPlay = !!state;\r\n }\r\n\r\n /**\r\n * @return {boolean} true: play, false: stop\r\n */\r\n getPlayState() {\r\n return !!this.option.autoPlay;\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n _initData() {\r\n const thisOption = this.option;\r\n const dataArr = thisOption.data || [];\r\n const axisType = thisOption.axisType;\r\n const names: string[] = this._names = [];\r\n\r\n let processedDataArr: TimelineOption['data'];\r\n if (axisType === 'category') {\r\n processedDataArr = [];\r\n each(dataArr, function (item, index) {\r\n const value = convertOptionIdName(getDataItemValue(item), '');\r\n let newItem;\r\n\r\n if (isObject(item)) {\r\n newItem = clone(item);\r\n (newItem as TimelineDataItemOption).value = index;\r\n }\r\n else {\r\n newItem = index;\r\n }\r\n\r\n processedDataArr.push(newItem);\r\n\r\n names.push(value);\r\n });\r\n }\r\n else {\r\n processedDataArr = dataArr;\r\n }\r\n\r\n const dimType = ({\r\n category: 'ordinal',\r\n time: 'time',\r\n value: 'number'\r\n })[axisType] || 'number';\r\n\r\n const data = this._data = new SeriesData([{\r\n name: 'value', type: dimType\r\n }], this);\r\n\r\n data.initData(processedDataArr, names);\r\n }\r\n\r\n getData() {\r\n return this._data;\r\n }\r\n\r\n /**\r\n * @public\r\n * @return {Array.} categoreis\r\n */\r\n getCategories() {\r\n if (this.get('axisType') === 'category') {\r\n return this._names.slice();\r\n }\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n static defaultOption: TimelineOption = {\r\n\r\n // zlevel: 0, // \u4E00\u7EA7\u5C42\u53E0\r\n z: 4, // \u4E8C\u7EA7\u5C42\u53E0\r\n show: true,\r\n\r\n axisType: 'time', // \u6A21\u5F0F\u662F\u65F6\u95F4\u7C7B\u578B\uFF0C\u652F\u6301 value, category\r\n\r\n realtime: true,\r\n\r\n left: '20%',\r\n top: null,\r\n right: '20%',\r\n bottom: 0,\r\n width: null,\r\n height: 40,\r\n padding: 5,\r\n\r\n controlPosition: 'left', // 'left' 'right' 'top' 'bottom' 'none'\r\n autoPlay: false,\r\n rewind: false, // \u53CD\u5411\u64AD\u653E\r\n loop: true,\r\n playInterval: 2000, // \u64AD\u653E\u65F6\u95F4\u95F4\u9694\uFF0C\u5355\u4F4Dms\r\n\r\n currentIndex: 0,\r\n\r\n itemStyle: {},\r\n label: {\r\n color: '#000'\r\n },\r\n\r\n data: []\r\n };\r\n\r\n}\r\n\r\nexport default TimelineModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport TimelineModel, { TimelineOption } from './TimelineModel';\r\nimport { DataFormatMixin } from '../../model/mixin/dataFormat';\r\nimport { mixin } from 'zrender/src/core/util';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { inheritDefaultOption } from '../../util/component';\r\n\r\nexport interface SliderTimelineOption extends TimelineOption {\r\n}\r\n\r\nclass SliderTimelineModel extends TimelineModel {\r\n\r\n static type = 'timeline.slider';\r\n type = SliderTimelineModel.type;\r\n\r\n /**\r\n * @protected\r\n */\r\n static defaultOption: SliderTimelineOption = inheritDefaultOption(TimelineModel.defaultOption, {\r\n\r\n backgroundColor: 'rgba(0,0,0,0)', // \u65F6\u95F4\u8F74\u80CC\u666F\u989C\u8272\r\n borderColor: '#ccc', // \u65F6\u95F4\u8F74\u8FB9\u6846\u989C\u8272\r\n borderWidth: 0, // \u65F6\u95F4\u8F74\u8FB9\u6846\u7EBF\u5BBD\uFF0C\u5355\u4F4Dpx\uFF0C\u9ED8\u8BA4\u4E3A0\uFF08\u65E0\u8FB9\u6846\uFF09\r\n\r\n orient: 'horizontal', // 'vertical'\r\n inverse: false,\r\n\r\n tooltip: { // boolean or Object\r\n trigger: 'item' // data item may also have tootip attr.\r\n },\r\n\r\n symbol: 'circle',\r\n symbolSize: 12,\r\n\r\n lineStyle: {\r\n show: true,\r\n width: 2,\r\n color: '#DAE1F5'\r\n },\r\n label: { // \u6587\u672C\u6807\u7B7E\r\n position: 'auto', // auto left right top bottom\r\n // When using number, label position is not\r\n // restricted by viewRect.\r\n // positive: right/bottom, negative: left/top\r\n show: true,\r\n interval: 'auto',\r\n rotate: 0,\r\n // formatter: null,\r\n // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\r\n color: '#A4B1D7'\r\n },\r\n itemStyle: {\r\n color: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n\r\n checkpointStyle: {\r\n symbol: 'circle',\r\n symbolSize: 15,\r\n color: '#316bf3',\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0, 0, 0, 0.3)',\r\n // borderColor: 'rgba(194,53,49, 0.5)',\r\n animation: true,\r\n animationDuration: 300,\r\n animationEasing: 'quinticInOut'\r\n },\r\n\r\n controlStyle: {\r\n show: true,\r\n showPlayBtn: true,\r\n showPrevBtn: true,\r\n showNextBtn: true,\r\n\r\n itemSize: 24,\r\n itemGap: 12,\r\n\r\n position: 'left', // 'left' 'right' 'top' 'bottom'\r\n\r\n playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', // jshint ignore:line\r\n stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', // jshint ignore:line\r\n // eslint-disable-next-line max-len\r\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z', // jshint ignore:line\r\n // eslint-disable-next-line max-len\r\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z', // jshint ignore:line\r\n\r\n prevBtnSize: 18,\r\n nextBtnSize: 18,\r\n\r\n color: '#A4B1D7',\r\n borderColor: '#A4B1D7',\r\n borderWidth: 1\r\n },\r\n emphasis: {\r\n label: {\r\n show: true,\r\n // \u5176\u4F59\u5C5E\u6027\u9ED8\u8BA4\u4F7F\u7528\u5168\u5C40\u6587\u672C\u6837\u5F0F\uFF0C\u8BE6\u89C1TEXTSTYLE\r\n color: '#6f778d'\r\n },\r\n\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n\r\n controlStyle: {\r\n color: '#316BF3',\r\n borderColor: '#316BF3',\r\n borderWidth: 2\r\n }\r\n },\r\n\r\n progress: {\r\n lineStyle: {\r\n color: '#316BF3'\r\n },\r\n itemStyle: {\r\n color: '#316BF3'\r\n },\r\n label: {\r\n color: '#6f778d'\r\n }\r\n },\r\n\r\n data: []\r\n });\r\n\r\n}\r\n\r\ninterface SliderTimelineModel extends DataFormatMixin {\r\n getData(): SeriesData\r\n}\r\n\r\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\r\n\r\nexport default SliderTimelineModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ComponentView from '../../view/Component';\r\n\r\nclass TimelineView extends ComponentView {\r\n static type = 'timeline';\r\n type = TimelineView.type;\r\n}\r\n\r\nexport default TimelineView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport Axis from '../../coord/Axis';\r\nimport Scale from '../../scale/Scale';\r\nimport TimelineModel from './TimelineModel';\r\nimport { LabelOption } from '../../util/types';\r\nimport Model from '../../model/Model';\r\n\r\n/**\r\n * Extend axis 2d\r\n */\r\nclass TimelineAxis extends Axis {\r\n\r\n type: 'category' | 'time' | 'value';\r\n\r\n // @ts-ignore\r\n model: TimelineModel;\r\n\r\n constructor(\r\n dim: string,\r\n scale: Scale,\r\n coordExtent: [number, number],\r\n axisType: 'category' | 'time' | 'value'\r\n ) {\r\n super(dim, scale, coordExtent);\r\n this.type = axisType || 'value';\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getLabelModel() {\r\n // Force override\r\n return this.model.getModel('label') as Model;\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n isHorizontal() {\r\n return this.model.get('orient') === 'horizontal';\r\n }\r\n}\r\n\r\nexport default TimelineAxis;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport BoundingRect, { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport * as matrix from 'zrender/src/core/matrix';\r\nimport * as graphic from '../../util/graphic';\r\nimport { createTextStyle } from '../../label/labelStyle';\r\nimport * as layout from '../../util/layout';\r\nimport TimelineView from './TimelineView';\r\nimport TimelineAxis from './TimelineAxis';\r\nimport {createSymbol, normalizeSymbolOffset, normalizeSymbolSize} from '../../util/symbol';\r\nimport * as numberUtil from '../../util/number';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { merge, each, extend, isString, bind, defaults, retrieve2 } from 'zrender/src/core/util';\r\nimport SliderTimelineModel from './SliderTimelineModel';\r\nimport { LayoutOrient, ZRTextAlign, ZRTextVerticalAlign, ZRElementEvent, ScaleTick } from '../../util/types';\r\nimport TimelineModel, { TimelineDataItemOption, TimelineCheckpointStyle } from './TimelineModel';\r\nimport { TimelineChangePayload, TimelinePlayChangePayload } from './timelineAction';\r\nimport Model from '../../model/Model';\r\nimport { PathProps, PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport Scale from '../../scale/Scale';\r\nimport OrdinalScale from '../../scale/Ordinal';\r\nimport TimeScale from '../../scale/Time';\r\nimport IntervalScale from '../../scale/Interval';\r\nimport { VectorArray } from 'zrender/src/core/vector';\r\nimport { parsePercent } from 'zrender/src/contain/text';\r\nimport { makeInner } from '../../util/model';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { enableHoverEmphasis } from '../../util/states';\r\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\n\r\nconst PI = Math.PI;\r\n\r\ntype TimelineSymbol = ReturnType;\r\n\r\ntype RenderMethodName = '_renderAxisLine' | '_renderAxisTick' | '_renderControl' | '_renderCurrentPointer';\r\n\r\ntype ControlName = 'play' | 'stop' | 'next' | 'prev';\r\ntype ControlIconName = 'playIcon' | 'stopIcon' | 'nextIcon' | 'prevIcon';\r\n\r\nconst labelDataIndexStore = makeInner<{\r\n dataIndex: number\r\n}, graphic.Text>();\r\n\r\ninterface LayoutInfo {\r\n viewRect: BoundingRect\r\n mainLength: number\r\n orient: LayoutOrient\r\n\r\n rotation: number\r\n labelRotation: number\r\n labelPosOpt: number | '+' | '-'\r\n labelAlign: ZRTextAlign\r\n labelBaseline: ZRTextVerticalAlign\r\n\r\n playPosition: number[]\r\n prevBtnPosition: number[]\r\n nextBtnPosition: number[]\r\n axisExtent: number[]\r\n\r\n controlSize: number\r\n controlGap: number\r\n}\r\n\r\nclass SliderTimelineView extends TimelineView {\r\n\r\n static type = 'timeline.slider';\r\n type = SliderTimelineView.type;\r\n\r\n api: ExtensionAPI;\r\n model: SliderTimelineModel;\r\n ecModel: GlobalModel;\r\n\r\n private _axis: TimelineAxis;\r\n\r\n private _viewRect: BoundingRect;\r\n\r\n private _timer: number;\r\n\r\n private _currentPointer: TimelineSymbol;\r\n\r\n private _progressLine: graphic.Line;\r\n\r\n private _mainGroup: graphic.Group;\r\n\r\n private _labelGroup: graphic.Group;\r\n\r\n private _tickSymbols: graphic.Path[];\r\n private _tickLabels: graphic.Text[];\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.api = api;\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n render(timelineModel: SliderTimelineModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.model = timelineModel;\r\n this.api = api;\r\n this.ecModel = ecModel;\r\n\r\n this.group.removeAll();\r\n\r\n if (timelineModel.get('show', true)) {\r\n\r\n const layoutInfo = this._layout(timelineModel, api);\r\n const mainGroup = this._createGroup('_mainGroup');\r\n const labelGroup = this._createGroup('_labelGroup');\r\n\r\n const axis = this._axis = this._createAxis(layoutInfo, timelineModel);\r\n\r\n timelineModel.formatTooltip = function (dataIndex: number) {\r\n const name = axis.scale.getLabel({value: dataIndex});\r\n return createTooltipMarkup('nameValue', { noName: true, value: name });\r\n };\r\n\r\n each(\r\n ['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'] as const,\r\n function (name) {\r\n this['_render' + name as RenderMethodName](layoutInfo, mainGroup, axis, timelineModel);\r\n },\r\n this\r\n );\r\n\r\n this._renderAxisLabel(layoutInfo, labelGroup, axis, timelineModel);\r\n this._position(layoutInfo, timelineModel);\r\n }\r\n\r\n this._doPlayStop();\r\n\r\n this._updateTicksStatus();\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n remove() {\r\n this._clearTimer();\r\n this.group.removeAll();\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n dispose() {\r\n this._clearTimer();\r\n }\r\n\r\n private _layout(timelineModel: SliderTimelineModel, api: ExtensionAPI): LayoutInfo {\r\n const labelPosOpt = timelineModel.get(['label', 'position']);\r\n const orient = timelineModel.get('orient');\r\n const viewRect = getViewRect(timelineModel, api);\r\n let parsedLabelPos: number | '+' | '-';\r\n // Auto label offset.\r\n if (labelPosOpt == null || labelPosOpt === 'auto') {\r\n parsedLabelPos = orient === 'horizontal'\r\n ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+')\r\n : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-');\r\n }\r\n else if (isString(labelPosOpt)) {\r\n parsedLabelPos = ({\r\n horizontal: {top: '-', bottom: '+'},\r\n vertical: {left: '-', right: '+'}\r\n } as const)[orient][labelPosOpt];\r\n }\r\n else {\r\n // is number\r\n parsedLabelPos = labelPosOpt;\r\n }\r\n\r\n const labelAlignMap = {\r\n horizontal: 'center',\r\n vertical: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'left' : 'right'\r\n };\r\n\r\n const labelBaselineMap = {\r\n horizontal: (parsedLabelPos >= 0 || parsedLabelPos === '+') ? 'top' : 'bottom',\r\n vertical: 'middle'\r\n };\r\n const rotationMap = {\r\n horizontal: 0,\r\n vertical: PI / 2\r\n };\r\n\r\n // Position\r\n const mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\r\n\r\n const controlModel = timelineModel.getModel('controlStyle');\r\n const showControl = controlModel.get('show', true);\r\n const controlSize = showControl ? controlModel.get('itemSize') : 0;\r\n const controlGap = showControl ? controlModel.get('itemGap') : 0;\r\n const sizePlusGap = controlSize + controlGap;\r\n\r\n // Special label rotate.\r\n let labelRotation = timelineModel.get(['label', 'rotate']) || 0;\r\n labelRotation = labelRotation * PI / 180; // To radian.\r\n\r\n let playPosition: number[];\r\n let prevBtnPosition: number[];\r\n let nextBtnPosition: number[];\r\n const controlPosition = controlModel.get('position', true);\r\n const showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\r\n const showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\r\n const showNextBtn = showControl && controlModel.get('showNextBtn', true);\r\n let xLeft = 0;\r\n let xRight = mainLength;\r\n\r\n // position[0] means left, position[1] means middle.\r\n if (controlPosition === 'left' || controlPosition === 'bottom') {\r\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n else { // 'top' 'right'\r\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\r\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\r\n }\r\n const axisExtent = [xLeft, xRight];\r\n\r\n if (timelineModel.get('inverse')) {\r\n axisExtent.reverse();\r\n }\r\n\r\n return {\r\n viewRect: viewRect,\r\n mainLength: mainLength,\r\n orient: orient,\r\n\r\n rotation: rotationMap[orient],\r\n labelRotation: labelRotation,\r\n labelPosOpt: parsedLabelPos,\r\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient] as ZRTextAlign,\r\n labelBaseline: timelineModel.get(['label', 'verticalAlign'])\r\n || timelineModel.get(['label', 'baseline'])\r\n || labelBaselineMap[orient] as ZRTextVerticalAlign,\r\n\r\n // Based on mainGroup.\r\n playPosition: playPosition,\r\n prevBtnPosition: prevBtnPosition,\r\n nextBtnPosition: nextBtnPosition,\r\n axisExtent: axisExtent,\r\n\r\n controlSize: controlSize,\r\n controlGap: controlGap\r\n };\r\n }\r\n\r\n private _position(layoutInfo: LayoutInfo, timelineModel: SliderTimelineModel) {\r\n // Position is be called finally, because bounding rect is needed for\r\n // adapt content to fill viewRect (auto adapt offset).\r\n\r\n // Timeline may be not all in the viewRect when 'offset' is specified\r\n // as a number, because it is more appropriate that label aligns at\r\n // 'offset' but not the other edge defined by viewRect.\r\n\r\n const mainGroup = this._mainGroup;\r\n const labelGroup = this._labelGroup;\r\n\r\n let viewRect = layoutInfo.viewRect;\r\n if (layoutInfo.orient === 'vertical') {\r\n // transform to horizontal, inverse rotate by left-top point.\r\n const m = matrix.create();\r\n const rotateOriginX = viewRect.x;\r\n const rotateOriginY = viewRect.y + viewRect.height;\r\n matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]);\r\n matrix.rotate(m, m, -PI / 2);\r\n matrix.translate(m, m, [rotateOriginX, rotateOriginY]);\r\n viewRect = viewRect.clone();\r\n viewRect.applyTransform(m);\r\n }\r\n\r\n const viewBound = getBound(viewRect);\r\n const mainBound = getBound(mainGroup.getBoundingRect());\r\n const labelBound = getBound(labelGroup.getBoundingRect());\r\n\r\n const mainPosition = [mainGroup.x, mainGroup.y];\r\n const labelsPosition = [labelGroup.x, labelGroup.y];\r\n\r\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\r\n\r\n const labelPosOpt = layoutInfo.labelPosOpt;\r\n\r\n if (labelPosOpt == null || isString(labelPosOpt)) { // '+' or '-'\r\n const mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\r\n }\r\n else {\r\n const mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\r\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\r\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\r\n }\r\n\r\n mainGroup.setPosition(mainPosition);\r\n labelGroup.setPosition(labelsPosition);\r\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\r\n\r\n setOrigin(mainGroup);\r\n setOrigin(labelGroup);\r\n\r\n function setOrigin(targetGroup: graphic.Group) {\r\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\r\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\r\n }\r\n\r\n function getBound(rect: RectLike) {\r\n // [[xmin, xmax], [ymin, ymax]]\r\n return [\r\n [rect.x, rect.x + rect.width],\r\n [rect.y, rect.y + rect.height]\r\n ];\r\n }\r\n\r\n function toBound(fromPos: VectorArray, from: number[][], to: number[][], dimIdx: number, boundIdx: number) {\r\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\r\n }\r\n }\r\n\r\n private _createAxis(layoutInfo: LayoutInfo, timelineModel: SliderTimelineModel) {\r\n const data = timelineModel.getData();\r\n const axisType = timelineModel.get('axisType');\r\n\r\n const scale = createScaleByModel(timelineModel, axisType);\r\n\r\n // Customize scale. The `tickValue` is `dataIndex`.\r\n scale.getTicks = function () {\r\n return data.mapArray(['value'], function (value: number) {\r\n return {value};\r\n });\r\n };\r\n\r\n const dataExtent = data.getDataExtent('value');\r\n scale.setExtent(dataExtent[0], dataExtent[1]);\r\n scale.calcNiceTicks();\r\n\r\n const axis = new TimelineAxis('value', scale, layoutInfo.axisExtent as [number, number], axisType);\r\n axis.model = timelineModel;\r\n\r\n return axis;\r\n }\r\n\r\n private _createGroup(key: '_mainGroup' | '_labelGroup') {\r\n const newGroup = this[key] = new graphic.Group();\r\n this.group.add(newGroup);\r\n return newGroup;\r\n }\r\n\r\n private _renderAxisLine(\r\n layoutInfo: LayoutInfo,\r\n group: graphic.Group,\r\n axis: TimelineAxis,\r\n timelineModel: SliderTimelineModel\r\n ) {\r\n const axisExtent = axis.getExtent();\r\n\r\n if (!timelineModel.get(['lineStyle', 'show'])) {\r\n return;\r\n }\r\n\r\n const line = new graphic.Line({\r\n shape: {\r\n x1: axisExtent[0], y1: 0,\r\n x2: axisExtent[1], y2: 0\r\n },\r\n style: extend(\r\n {lineCap: 'round'},\r\n timelineModel.getModel('lineStyle').getLineStyle()\r\n ),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(line);\r\n\r\n const progressLine = this._progressLine = new graphic.Line({\r\n shape: {\r\n x1: axisExtent[0],\r\n x2: this._currentPointer\r\n ? this._currentPointer.x : axisExtent[0],\r\n y1: 0, y2: 0\r\n },\r\n style: defaults(\r\n { lineCap: 'round', lineWidth: line.style.lineWidth } as PathStyleProps,\r\n timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()\r\n ),\r\n silent: true,\r\n z2: 1\r\n });\r\n group.add(progressLine);\r\n }\r\n\r\n private _renderAxisTick(\r\n layoutInfo: LayoutInfo,\r\n group: graphic.Group,\r\n axis: TimelineAxis,\r\n timelineModel: SliderTimelineModel\r\n ) {\r\n const data = timelineModel.getData();\r\n // Show all ticks, despite ignoring strategy.\r\n const ticks = axis.scale.getTicks();\r\n\r\n this._tickSymbols = [];\r\n\r\n // The value is dataIndex, see the customized scale.\r\n each(ticks, (tick: ScaleTick) => {\r\n const tickCoord = axis.dataToCoord(tick.value);\r\n const itemModel = data.getItemModel(tick.value);\r\n const itemStyleModel = itemModel.getModel('itemStyle');\r\n const hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\r\n const progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\r\n\r\n const symbolOpt = {\r\n x: tickCoord,\r\n y: 0,\r\n onclick: bind(this._changeTimeline, this, tick.value)\r\n };\r\n const el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\r\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\r\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\r\n\r\n enableHoverEmphasis(el);\r\n\r\n const ecData = getECData(el);\r\n if (itemModel.get('tooltip')) {\r\n ecData.dataIndex = tick.value;\r\n ecData.dataModel = timelineModel;\r\n }\r\n else {\r\n ecData.dataIndex = ecData.dataModel = null;\r\n }\r\n\r\n this._tickSymbols.push(el);\r\n });\r\n }\r\n\r\n private _renderAxisLabel(\r\n layoutInfo: LayoutInfo,\r\n group: graphic.Group,\r\n axis: TimelineAxis,\r\n timelineModel: SliderTimelineModel\r\n ) {\r\n const labelModel = axis.getLabelModel();\r\n\r\n if (!labelModel.get('show')) {\r\n return;\r\n }\r\n\r\n const data = timelineModel.getData();\r\n const labels = axis.getViewLabels();\r\n\r\n this._tickLabels = [];\r\n\r\n each(labels, (labelItem) => {\r\n // The tickValue is dataIndex, see the customized scale.\r\n const dataIndex = labelItem.tickValue;\r\n\r\n const itemModel = data.getItemModel(dataIndex);\r\n const normalLabelModel = itemModel.getModel('label');\r\n const hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\r\n const progressLabelModel = itemModel.getModel(['progress', 'label']);\r\n\r\n const tickCoord = axis.dataToCoord(labelItem.tickValue);\r\n const textEl = new graphic.Text({\r\n x: tickCoord,\r\n y: 0,\r\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\r\n onclick: bind(this._changeTimeline, this, dataIndex),\r\n silent: false,\r\n style: createTextStyle(normalLabelModel, {\r\n text: labelItem.formattedLabel,\r\n align: layoutInfo.labelAlign,\r\n verticalAlign: layoutInfo.labelBaseline\r\n })\r\n });\r\n\r\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\r\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\r\n\r\n group.add(textEl);\r\n enableHoverEmphasis(textEl);\r\n\r\n labelDataIndexStore(textEl).dataIndex = dataIndex;\r\n\r\n this._tickLabels.push(textEl);\r\n\r\n });\r\n }\r\n\r\n private _renderControl(\r\n layoutInfo: LayoutInfo,\r\n group: graphic.Group,\r\n axis: TimelineAxis,\r\n timelineModel: SliderTimelineModel\r\n ) {\r\n const controlSize = layoutInfo.controlSize;\r\n const rotation = layoutInfo.rotation;\r\n\r\n const itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\r\n const hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\r\n const playState = timelineModel.getPlayState();\r\n const inverse = timelineModel.get('inverse', true);\r\n\r\n makeBtn(\r\n layoutInfo.nextBtnPosition,\r\n 'next',\r\n bind(this._changeTimeline, this, inverse ? '-' : '+')\r\n );\r\n makeBtn(\r\n layoutInfo.prevBtnPosition,\r\n 'prev',\r\n bind(this._changeTimeline, this, inverse ? '+' : '-')\r\n );\r\n makeBtn(\r\n layoutInfo.playPosition,\r\n (playState ? 'stop' : 'play'),\r\n bind(this._handlePlayClick, this, !playState),\r\n true\r\n );\r\n\r\n function makeBtn(\r\n position: number[],\r\n iconName: ControlName,\r\n onclick: () => void,\r\n willRotate?: boolean\r\n ) {\r\n if (!position) {\r\n return;\r\n }\r\n const iconSize = parsePercent(\r\n retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize' as any]), controlSize),\r\n controlSize\r\n );\r\n const rect = [0, -iconSize / 2, iconSize, iconSize];\r\n const btn = makeControlIcon(timelineModel, iconName + 'Icon' as ControlIconName, rect, {\r\n x: position[0],\r\n y: position[1],\r\n originX: controlSize / 2,\r\n originY: 0,\r\n rotation: willRotate ? -rotation : 0,\r\n rectHover: true,\r\n style: itemStyle,\r\n onclick: onclick\r\n });\r\n btn.ensureState('emphasis').style = hoverStyle;\r\n group.add(btn);\r\n enableHoverEmphasis(btn);\r\n }\r\n }\r\n\r\n private _renderCurrentPointer(\r\n layoutInfo: LayoutInfo,\r\n group: graphic.Group,\r\n axis: TimelineAxis,\r\n timelineModel: SliderTimelineModel\r\n ) {\r\n const data = timelineModel.getData();\r\n const currentIndex = timelineModel.getCurrentIndex();\r\n const pointerModel = data.getItemModel(currentIndex)\r\n .getModel('checkpointStyle');\r\n const me = this;\r\n\r\n const callback = {\r\n onCreate(pointer: TimelineSymbol) {\r\n pointer.draggable = true;\r\n pointer.drift = bind(me._handlePointerDrag, me);\r\n pointer.ondragend = bind(me._handlePointerDragend, me);\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\r\n },\r\n onUpdate(pointer: TimelineSymbol) {\r\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\r\n }\r\n };\r\n\r\n // Reuse when exists, for animation and drag.\r\n this._currentPointer = giveSymbol(\r\n pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback\r\n );\r\n }\r\n\r\n private _handlePlayClick(nextState: boolean) {\r\n this._clearTimer();\r\n this.api.dispatchAction({\r\n type: 'timelinePlayChange',\r\n playState: nextState,\r\n from: this.uid\r\n } as TimelinePlayChangePayload);\r\n }\r\n\r\n private _handlePointerDrag(dx: number, dy: number, e: ZRElementEvent) {\r\n this._clearTimer();\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\r\n }\r\n\r\n private _handlePointerDragend(e: ZRElementEvent) {\r\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\r\n }\r\n\r\n private _pointerChangeTimeline(mousePos: number[], trigger?: boolean) {\r\n let toCoord = this._toAxisCoord(mousePos)[0];\r\n\r\n const axis = this._axis;\r\n const axisExtent = numberUtil.asc(axis.getExtent().slice());\r\n\r\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\r\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\r\n\r\n this._currentPointer.x = toCoord;\r\n this._currentPointer.markRedraw();\r\n\r\n const progressLine = this._progressLine;\r\n if (progressLine) {\r\n progressLine.shape.x2 = toCoord;\r\n progressLine.dirty();\r\n }\r\n\r\n const targetDataIndex = this._findNearestTick(toCoord);\r\n const timelineModel = this.model;\r\n\r\n if (trigger || (\r\n targetDataIndex !== timelineModel.getCurrentIndex()\r\n && timelineModel.get('realtime')\r\n )) {\r\n this._changeTimeline(targetDataIndex);\r\n }\r\n }\r\n\r\n private _doPlayStop() {\r\n this._clearTimer();\r\n\r\n if (this.model.getPlayState()) {\r\n this._timer = setTimeout(\r\n () => {\r\n // Do not cache\r\n const timelineModel = this.model;\r\n this._changeTimeline(\r\n timelineModel.getCurrentIndex()\r\n + (timelineModel.get('rewind', true) ? -1 : 1)\r\n );\r\n },\r\n this.model.get('playInterval')\r\n ) as any;\r\n }\r\n }\r\n\r\n private _toAxisCoord(vertex: number[]) {\r\n const trans = this._mainGroup.getLocalTransform();\r\n return graphic.applyTransform(vertex, trans, true);\r\n }\r\n\r\n private _findNearestTick(axisCoord: number) {\r\n const data = this.model.getData();\r\n let dist = Infinity;\r\n let targetDataIndex;\r\n const axis = this._axis;\r\n\r\n data.each(['value'], function (value, dataIndex) {\r\n const coord = axis.dataToCoord(value);\r\n const d = Math.abs(coord - axisCoord);\r\n if (d < dist) {\r\n dist = d;\r\n targetDataIndex = dataIndex;\r\n }\r\n });\r\n\r\n return targetDataIndex;\r\n }\r\n\r\n private _clearTimer() {\r\n if (this._timer) {\r\n clearTimeout(this._timer);\r\n this._timer = null;\r\n }\r\n }\r\n\r\n private _changeTimeline(nextIndex: number | '+' | '-') {\r\n const currentIndex = this.model.getCurrentIndex();\r\n\r\n if (nextIndex === '+') {\r\n nextIndex = currentIndex + 1;\r\n }\r\n else if (nextIndex === '-') {\r\n nextIndex = currentIndex - 1;\r\n }\r\n\r\n this.api.dispatchAction({\r\n type: 'timelineChange',\r\n currentIndex: nextIndex,\r\n from: this.uid\r\n } as TimelineChangePayload);\r\n }\r\n\r\n private _updateTicksStatus() {\r\n const currentIndex = this.model.getCurrentIndex();\r\n const tickSymbols = this._tickSymbols;\r\n const tickLabels = this._tickLabels;\r\n\r\n if (tickSymbols) {\r\n for (let i = 0; i < tickSymbols.length; i++) {\r\n tickSymbols && tickSymbols[i]\r\n && tickSymbols[i].toggleState('progress', i < currentIndex);\r\n }\r\n }\r\n if (tickLabels) {\r\n for (let i = 0; i < tickLabels.length; i++) {\r\n tickLabels && tickLabels[i]\r\n && tickLabels[i].toggleState(\r\n 'progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex\r\n );\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction createScaleByModel(model: SliderTimelineModel, axisType?: string): Scale {\r\n axisType = axisType || model.get('type');\r\n if (axisType) {\r\n switch (axisType) {\r\n // Buildin scale\r\n case 'category':\r\n return new OrdinalScale({\r\n ordinalMeta: model.getCategories(),\r\n extent: [Infinity, -Infinity]\r\n });\r\n case 'time':\r\n return new TimeScale({\r\n locale: model.ecModel.getLocaleModel(),\r\n useUTC: model.ecModel.get('useUTC')\r\n });\r\n default:\r\n // default to be value\r\n return new IntervalScale();\r\n }\r\n }\r\n}\r\n\r\n\r\nfunction getViewRect(model: SliderTimelineModel, api: ExtensionAPI) {\r\n return layout.getLayoutRect(\r\n model.getBoxLayoutParams(),\r\n {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n },\r\n model.get('padding')\r\n );\r\n}\r\n\r\nfunction makeControlIcon(\r\n timelineModel: TimelineModel,\r\n objPath: ControlIconName,\r\n rect: number[],\r\n opts: PathProps\r\n) {\r\n const style = opts.style;\r\n\r\n const icon = graphic.createIcon(\r\n timelineModel.get(['controlStyle', objPath]),\r\n opts || {},\r\n new BoundingRect(rect[0], rect[1], rect[2], rect[3])\r\n );\r\n\r\n // TODO createIcon won't use style in opt.\r\n if (style) {\r\n (icon as Displayable).setStyle(style);\r\n }\r\n\r\n return icon;\r\n}\r\n\r\n/**\r\n * Create symbol or update symbol\r\n * opt: basic position and event handlers\r\n */\r\nfunction giveSymbol(\r\n hostModel: Model,\r\n itemStyleModel: Model,\r\n group: graphic.Group,\r\n opt: PathProps,\r\n symbol?: TimelineSymbol,\r\n callback?: {\r\n onCreate?: (symbol: TimelineSymbol) => void\r\n onUpdate?: (symbol: TimelineSymbol) => void\r\n }\r\n) {\r\n const color = itemStyleModel.get('color');\r\n\r\n if (!symbol) {\r\n const symbolType = hostModel.get('symbol');\r\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\r\n symbol.setStyle('strokeNoScale', true);\r\n group.add(symbol);\r\n callback && callback.onCreate(symbol);\r\n }\r\n else {\r\n symbol.setColor(color);\r\n group.add(symbol); // Group may be new, also need to add.\r\n callback && callback.onUpdate(symbol);\r\n }\r\n\r\n // Style\r\n const itemStyle = itemStyleModel.getItemStyle(['color']);\r\n symbol.setStyle(itemStyle);\r\n\r\n // Transform and events.\r\n opt = merge({\r\n rectHover: true,\r\n z2: 100\r\n }, opt, true);\r\n\r\n const symbolSize = normalizeSymbolSize(hostModel.get('symbolSize'));\r\n\r\n opt.scaleX = symbolSize[0] / 2;\r\n opt.scaleY = symbolSize[1] / 2;\r\n\r\n const symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize);\r\n if (symbolOffset) {\r\n opt.x = (opt.x || 0) + symbolOffset[0];\r\n opt.y = (opt.y || 0) + symbolOffset[1];\r\n }\r\n\r\n const symbolRotate = hostModel.get('symbolRotate');\r\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\r\n\r\n symbol.attr(opt);\r\n\r\n // FIXME\r\n // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\r\n // getBoundingRect will return wrong result.\r\n // (This is supposed to be resolved in zrender, but it is a little difficult to\r\n // leverage performance and auto updateTransform)\r\n // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\r\n symbol.updateTransform();\r\n\r\n return symbol;\r\n}\r\n\r\nfunction pointerMoveTo(\r\n pointer: TimelineSymbol,\r\n progressLine: graphic.Line,\r\n dataIndex: number,\r\n axis: TimelineAxis,\r\n timelineModel: SliderTimelineModel,\r\n noAnimation?: boolean\r\n) {\r\n if (pointer.dragging) {\r\n return;\r\n }\r\n\r\n const pointerModel = timelineModel.getModel('checkpointStyle');\r\n const toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\r\n\r\n if (noAnimation || !pointerModel.get('animation', true)) {\r\n pointer.attr({\r\n x: toCoord,\r\n y: 0\r\n });\r\n progressLine && progressLine.attr({\r\n shape: { x2: toCoord }\r\n });\r\n }\r\n else {\r\n const animationCfg = {\r\n duration: pointerModel.get('animationDuration', true),\r\n easing: pointerModel.get('animationEasing', true)\r\n };\r\n pointer.stopAnimation(null, true);\r\n pointer.animateTo({\r\n x: toCoord,\r\n y: 0\r\n }, animationCfg);\r\n progressLine && progressLine.animateTo({\r\n shape: { x2: toCoord }\r\n }, animationCfg);\r\n }\r\n}\r\n\r\nexport default SliderTimelineView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport GlobalModel from '../../model/Global';\r\nimport TimelineModel from './TimelineModel';\r\nimport { defaults } from 'zrender/src/core/util';\r\nimport { Payload } from '../../util/types';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\n\r\nexport interface TimelineChangePayload extends Payload {\r\n type: 'timelineChange'\r\n currentIndex: number\r\n}\r\nexport interface TimelinePlayChangePayload extends Payload {\r\n type: 'timelinePlayChange'\r\n playState: boolean\r\n}\r\n\r\n\r\nexport function installTimelineAction(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerAction(\r\n\r\n {type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate'},\r\n\r\n function (payload: TimelineChangePayload, ecModel: GlobalModel, api: ExtensionAPI) {\r\n\r\n const timelineModel = ecModel.getComponent('timeline') as TimelineModel;\r\n if (timelineModel && payload.currentIndex != null) {\r\n timelineModel.setCurrentIndex(payload.currentIndex);\r\n\r\n if (\r\n !timelineModel.get('loop', true)\r\n && timelineModel.isIndexMax()\r\n && timelineModel.getPlayState()\r\n ) {\r\n timelineModel.setPlayState(false);\r\n\r\n // The timeline has played to the end, trigger event\r\n api.dispatchAction({\r\n type: 'timelinePlayChange',\r\n playState: false,\r\n from: payload.from\r\n });\r\n }\r\n }\r\n\r\n // Set normalized currentIndex to payload.\r\n ecModel.resetOption('timeline', { replaceMerge: timelineModel.get('replaceMerge', true) });\r\n\r\n return defaults({\r\n currentIndex: timelineModel.option.currentIndex\r\n }, payload);\r\n }\r\n );\r\n\r\n registers.registerAction(\r\n\r\n {type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update'},\r\n\r\n function (payload: TimelinePlayChangePayload, ecModel: GlobalModel) {\r\n const timelineModel = ecModel.getComponent('timeline') as TimelineModel;\r\n if (timelineModel && payload.playState != null) {\r\n timelineModel.setPlayState(payload.playState);\r\n }\r\n }\r\n );\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// @ts-nocheck\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\n\r\nexport default function timelinePreprocessor(option) {\r\n let timelineOpt = option && option.timeline;\r\n\r\n if (!zrUtil.isArray(timelineOpt)) {\r\n timelineOpt = timelineOpt ? [timelineOpt] : [];\r\n }\r\n\r\n zrUtil.each(timelineOpt, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n\r\n compatibleEC2(opt);\r\n });\r\n}\r\n\r\nfunction compatibleEC2(opt) {\r\n const type = opt.type;\r\n\r\n const ec2Types = {'number': 'value', 'time': 'time'};\r\n\r\n // Compatible with ec2\r\n if (ec2Types[type]) {\r\n opt.axisType = ec2Types[type];\r\n delete opt.type;\r\n }\r\n\r\n transferItem(opt);\r\n\r\n if (has(opt, 'controlPosition')) {\r\n const controlStyle = opt.controlStyle || (opt.controlStyle = {});\r\n if (!has(controlStyle, 'position')) {\r\n controlStyle.position = opt.controlPosition;\r\n }\r\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\r\n controlStyle.show = false;\r\n delete controlStyle.position;\r\n }\r\n delete opt.controlPosition;\r\n }\r\n\r\n zrUtil.each(opt.data || [], function (dataItem) {\r\n if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {\r\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\r\n // In ec2, using name as value.\r\n dataItem.value = dataItem.name;\r\n }\r\n transferItem(dataItem);\r\n }\r\n });\r\n}\r\n\r\nfunction transferItem(opt) {\r\n const itemStyle = opt.itemStyle || (opt.itemStyle = {});\r\n\r\n const itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});\r\n\r\n // Transfer label out\r\n const label = opt.label || (opt.label || {});\r\n const labelNormal = label.normal || (label.normal = {});\r\n const excludeLabelAttr = {normal: 1, emphasis: 1};\r\n\r\n zrUtil.each(label, function (value, name) {\r\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\r\n labelNormal[name] = value;\r\n }\r\n });\r\n\r\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\r\n label.emphasis = itemStyleEmphasis.label;\r\n delete itemStyleEmphasis.label;\r\n }\r\n}\r\n\r\nfunction has(obj, attr) {\r\n return obj.hasOwnProperty(attr);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport SliderTimelineModel from './SliderTimelineModel';\r\nimport SliderTimelineView from './SliderTimelineView';\r\nimport { installTimelineAction } from './timelineAction';\r\nimport preprocessor from './preprocessor';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(SliderTimelineModel);\r\n registers.registerComponentView(SliderTimelineView);\r\n\r\n registers.registerSubTypeDefaulter('timeline', function () {\r\n // Only slider now.\r\n return 'slider';\r\n });\r\n\r\n installTimelineAction(registers);\r\n\r\n registers.registerPreprocessor(preprocessor);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { isArray } from 'zrender/src/core/util';\r\nimport { SeriesOption } from '../../util/types';\r\n\r\ntype MarkerTypes = 'markPoint' | 'markLine' | 'markArea';\r\n\r\ntype SeriesWithMarkerOption = SeriesOption & Partial>;\r\n\r\nexport default function checkMarkerInSeries(\r\n seriesOpts: SeriesOption | SeriesOption[], markerType: MarkerTypes\r\n): boolean {\r\n if (!seriesOpts) {\r\n return false;\r\n }\r\n const seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];\r\n for (let idx = 0; idx < seriesOptArr.length; idx++) {\r\n if (seriesOptArr[idx] && (seriesOptArr[idx] as SeriesWithMarkerOption)[markerType]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport env from 'zrender/src/core/env';\r\nimport { DataFormatMixin } from '../../model/mixin/dataFormat';\r\nimport ComponentModel from '../../model/Component';\r\nimport SeriesModel from '../../model/Series';\r\nimport {\r\n DisplayStateHostOption,\r\n ComponentOption,\r\n AnimationOptionMixin,\r\n Dictionary,\r\n CommonTooltipOption,\r\n ScaleDataValue,\r\n CallbackDataParams,\r\n SeriesDataType\r\n} from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { makeInner, defaultEmphasis } from '../../util/model';\r\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup';\r\n\r\nfunction fillLabel(opt: DisplayStateHostOption) {\r\n defaultEmphasis(opt, 'label', ['show']);\r\n}\r\n\r\nexport type MarkerStatisticType = 'average' | 'min' | 'max' | 'median';\r\n\r\n/**\r\n * Option to specify where to put the marker.\r\n */\r\nexport interface MarkerPositionOption {\r\n // Priority: x/y > coord(xAxis, yAxis) > type\r\n\r\n // Absolute position, px or percent string\r\n x?: number | string\r\n y?: number | string\r\n\r\n /**\r\n * Coord on any coordinate system\r\n */\r\n coord?: (ScaleDataValue | MarkerStatisticType)[]\r\n\r\n // On cartesian coordinate system\r\n xAxis?: ScaleDataValue\r\n yAxis?: ScaleDataValue\r\n\r\n // On polar coordinate system\r\n radiusAxis?: ScaleDataValue\r\n angleAxis?: ScaleDataValue\r\n\r\n // Use statistic method\r\n type?: MarkerStatisticType\r\n /**\r\n * When using statistic method with type.\r\n * valueIndex and valueDim can be specify which dim the statistic is used on.\r\n */\r\n valueIndex?: number\r\n valueDim?: string\r\n\r\n\r\n /**\r\n * Value to be displayed as label. Totally optional\r\n */\r\n value?: string | number\r\n}\r\n\r\nexport interface MarkerOption extends ComponentOption, AnimationOptionMixin {\r\n\r\n silent?: boolean\r\n\r\n data?: unknown[]\r\n\r\n tooltip?: CommonTooltipOption & {\r\n trigger?: 'item' | 'axis' | boolean | 'none'\r\n }\r\n}\r\n\r\n// { [componentType]: MarkerModel }\r\nconst inner = makeInner, SeriesModel>();\r\n\r\nabstract class MarkerModel extends ComponentModel {\r\n\r\n static type = 'marker';\r\n type = MarkerModel.type;\r\n\r\n /**\r\n * If marker model is created by self from series\r\n */\r\n createdBySelf = false;\r\n\r\n static readonly dependencies = ['series', 'grid', 'polar', 'geo'];\r\n\r\n __hostSeries: SeriesModel;\r\n\r\n private _data: SeriesData;\r\n\r\n /**\r\n * @overrite\r\n */\r\n init(option: Opts, parentModel: Model, ecModel: GlobalModel) {\r\n\r\n if (__DEV__) {\r\n if (this.type === 'marker') {\r\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\r\n }\r\n }\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n this._mergeOption(option, ecModel, false, true);\r\n }\r\n\r\n isAnimationEnabled(): boolean {\r\n if (env.node) {\r\n return false;\r\n }\r\n\r\n const hostSeries = this.__hostSeries;\r\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\r\n }\r\n\r\n /**\r\n * @overrite\r\n */\r\n mergeOption(newOpt: Opts, ecModel: GlobalModel) {\r\n this._mergeOption(newOpt, ecModel, false, false);\r\n }\r\n\r\n _mergeOption(newOpt: Opts, ecModel: GlobalModel, createdBySelf?: boolean, isInit?: boolean) {\r\n const componentType = this.mainType;\r\n if (!createdBySelf) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n\r\n // mainType can be markPoint, markLine, markArea\r\n const markerOpt = seriesModel.get(\r\n this.mainType as any, true\r\n ) as Opts;\r\n\r\n let markerModel = inner(seriesModel)[componentType];\r\n if (!markerOpt || !markerOpt.data) {\r\n inner(seriesModel)[componentType] = null;\r\n return;\r\n }\r\n if (!markerModel) {\r\n if (isInit) {\r\n // Default label emphasis `position` and `show`\r\n fillLabel(markerOpt);\r\n }\r\n zrUtil.each(markerOpt.data, function (item) {\r\n // FIXME Overwrite fillLabel method ?\r\n if (item instanceof Array) {\r\n fillLabel(item[0]);\r\n fillLabel(item[1]);\r\n }\r\n else {\r\n fillLabel(item);\r\n }\r\n });\r\n\r\n markerModel = this.createMarkerModelFromSeries(\r\n markerOpt, this, ecModel\r\n );\r\n // markerModel = new ImplementedMarkerModel(\r\n // markerOpt, this, ecModel\r\n // );\r\n\r\n zrUtil.extend(markerModel, {\r\n mainType: this.mainType,\r\n // Use the same series index and name\r\n seriesIndex: seriesModel.seriesIndex,\r\n name: seriesModel.name,\r\n createdBySelf: true\r\n });\r\n\r\n markerModel.__hostSeries = seriesModel;\r\n }\r\n else {\r\n markerModel._mergeOption(markerOpt, ecModel, true);\r\n }\r\n inner(seriesModel)[componentType] = markerModel;\r\n }, this);\r\n }\r\n }\r\n\r\n formatTooltip(\r\n dataIndex: number,\r\n multipleSeries: boolean,\r\n dataType: string\r\n ) {\r\n const data = this.getData();\r\n const value = this.getRawValue(dataIndex);\r\n const itemName = data.getName(dataIndex);\r\n\r\n return createTooltipMarkup('section', {\r\n header: this.name,\r\n blocks: [createTooltipMarkup('nameValue', {\r\n name: itemName,\r\n value: value,\r\n noName: !itemName,\r\n noValue: value == null\r\n })]\r\n });\r\n }\r\n\r\n getData(): SeriesData {\r\n return this._data as SeriesData;\r\n }\r\n\r\n setData(data: SeriesData) {\r\n this._data = data;\r\n }\r\n\r\n getDataParams(\r\n dataIndex: number,\r\n dataType?: SeriesDataType\r\n ): CallbackDataParams {\r\n const params = DataFormatMixin.prototype.getDataParams.call(this, dataIndex, dataType);\r\n const hostSeries = this.__hostSeries;\r\n if (hostSeries) {\r\n params.seriesId = hostSeries.id;\r\n params.seriesName = hostSeries.name;\r\n params.seriesType = hostSeries.subType;\r\n }\r\n return params;\r\n }\r\n\r\n /**\r\n * Create slave marker model from series.\r\n */\r\n abstract createMarkerModelFromSeries(\r\n markerOpt: Opts,\r\n masterMarkerModel: MarkerModel,\r\n ecModel: GlobalModel\r\n ): MarkerModel;\r\n\r\n static getMarkerModelFromSeries(\r\n seriesModel: SeriesModel,\r\n // Support three types of markers. Strict check.\r\n componentType: 'markLine' | 'markPoint' | 'markArea'\r\n ) {\r\n return inner(seriesModel)[componentType];\r\n }\r\n}\r\n\r\ninterface MarkerModel extends DataFormatMixin {}\r\nzrUtil.mixin(MarkerModel, DataFormatMixin.prototype);\r\n\r\nexport default MarkerModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport MarkerModel, { MarkerOption, MarkerPositionOption } from './MarkerModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport {\r\n SymbolOptionMixin,\r\n ItemStyleOption,\r\n SeriesLabelOption,\r\n CallbackDataParams,\r\n StatesOptionMixin,\r\n StatesMixinBase\r\n} from '../../util/types';\r\n\r\n// interface MarkPointCallbackDataParams extends CallbackDataParams {\r\n// componentType: 'markPoint'\r\n// componentSubType: never\r\n// }\r\n\r\ninterface MarkPointStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\nexport interface MarkPointDataItemOption extends\r\n MarkPointStateOption, StatesOptionMixin,\r\n // TODO should not support callback in data\r\n SymbolOptionMixin,\r\n MarkerPositionOption {\r\n name: string\r\n}\r\n\r\nexport interface MarkPointOption extends MarkerOption,\r\n SymbolOptionMixin,\r\n StatesOptionMixin, MarkPointStateOption {\r\n mainType?: 'markPoint'\r\n\r\n precision?: number\r\n\r\n data?: MarkPointDataItemOption[]\r\n}\r\n\r\nclass MarkPointModel extends MarkerModel {\r\n\r\n static type = 'markPoint';\r\n type = MarkPointModel.type;\r\n\r\n createMarkerModelFromSeries(\r\n markerOpt: MarkPointOption,\r\n masterMarkerModel: MarkPointModel,\r\n ecModel: GlobalModel\r\n ) {\r\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\r\n }\r\n\r\n static defaultOption: MarkPointOption = {\r\n // zlevel: 0,\r\n z: 5,\r\n symbol: 'pin',\r\n symbolSize: 50,\r\n // symbolRotate: 0,\r\n // symbolOffset: [0, 0]\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'inside'\r\n },\r\n itemStyle: {\r\n borderWidth: 2\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport default MarkPointModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as numberUtil from '../../util/number';\r\nimport {isDimensionStacked} from '../../data/helper/dataStackHelper';\r\nimport SeriesModel from '../../model/Series';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport { MarkerStatisticType, MarkerPositionOption } from './MarkerModel';\r\nimport { indexOf, curry, clone, isArray } from 'zrender/src/core/util';\r\nimport Axis from '../../coord/Axis';\r\nimport { CoordinateSystem } from '../../coord/CoordinateSystem';\r\nimport { ScaleDataValue, ParsedValue, DimensionLoose, DimensionName } from '../../util/types';\r\nimport { parseDataValue } from '../../data/helper/dataValueHelper';\r\nimport SeriesDimensionDefine from '../../data/SeriesDimensionDefine';\r\n\r\ninterface MarkerAxisInfo {\r\n valueDataDim: DimensionName\r\n valueAxis: Axis\r\n baseAxis: Axis\r\n baseDataDim: DimensionName\r\n}\r\n\r\nexport type MarkerDimValueGetter = (\r\n item: TMarkerItemOption,\r\n dimName: string,\r\n dataIndex: number,\r\n dimIndex: number\r\n) => ParsedValue;\r\n\r\nfunction hasXOrY(item: MarkerPositionOption) {\r\n return !(isNaN(parseFloat(item.x as string)) && isNaN(parseFloat(item.y as string)));\r\n}\r\n\r\nfunction hasXAndY(item: MarkerPositionOption) {\r\n return !isNaN(parseFloat(item.x as string)) && !isNaN(parseFloat(item.y as string));\r\n}\r\n\r\nfunction markerTypeCalculatorWithExtent(\r\n markerType: MarkerStatisticType,\r\n data: SeriesData,\r\n otherDataDim: string,\r\n targetDataDim: string,\r\n otherCoordIndex: number,\r\n targetCoordIndex: number\r\n): [ParsedValue[], ParsedValue] {\r\n const coordArr: ParsedValue[] = [];\r\n\r\n const stacked = isDimensionStacked(data, targetDataDim /* , otherDataDim */);\r\n const calcDataDim = stacked\r\n ? data.getCalculationInfo('stackResultDimension')\r\n : targetDataDim;\r\n\r\n const value = numCalculate(data, calcDataDim, markerType);\r\n\r\n const dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\r\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\r\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\r\n const coordArrValue = data.get(targetDataDim, dataIndex);\r\n // Make it simple, do not visit all stacked value to count precision.\r\n let precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));\r\n precision = Math.min(precision, 20);\r\n if (precision >= 0) {\r\n coordArr[targetCoordIndex] = +(coordArr[targetCoordIndex] as number).toFixed(precision);\r\n }\r\n\r\n return [coordArr, coordArrValue];\r\n}\r\n\r\n// TODO Specified percent\r\nconst markerTypeCalculator = {\r\n min: curry(markerTypeCalculatorWithExtent, 'min'),\r\n max: curry(markerTypeCalculatorWithExtent, 'max'),\r\n average: curry(markerTypeCalculatorWithExtent, 'average'),\r\n median: curry(markerTypeCalculatorWithExtent, 'median')\r\n};\r\n\r\n/**\r\n * Transform markPoint data item to format used in List by do the following\r\n * 1. Calculate statistic like `max`, `min`, `average`\r\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\r\n */\r\nexport function dataTransform(\r\n seriesModel: SeriesModel,\r\n item: MarkerPositionOption\r\n) {\r\n if (!item) {\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n const coordSys = seriesModel.coordinateSystem;\r\n const dims = coordSys && coordSys.dimensions;\r\n\r\n // 1. If not specify the position with pixel directly\r\n // 2. If `coord` is not a data array. Which uses `xAxis`,\r\n // `yAxis` to specify the coord on each dimension\r\n\r\n // parseFloat first because item.x and item.y can be percent string like '20%'\r\n if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) {\r\n const axisInfo = getAxisInfo(item, data, coordSys, seriesModel);\r\n\r\n // Clone the option\r\n // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\r\n item = clone(item);\r\n\r\n if (item.type\r\n && markerTypeCalculator[item.type]\r\n && axisInfo.baseAxis && axisInfo.valueAxis\r\n ) {\r\n const otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\r\n const targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\r\n\r\n const coordInfo = markerTypeCalculator[item.type](\r\n data, axisInfo.baseDataDim, axisInfo.valueDataDim,\r\n otherCoordIndex, targetCoordIndex\r\n );\r\n item.coord = coordInfo[0];\r\n // Force to use the value of calculated value.\r\n // let item use the value without stack.\r\n item.value = coordInfo[1];\r\n }\r\n else {\r\n // FIXME Only has one of xAxis and yAxis.\r\n item.coord = [\r\n item.xAxis != null ? item.xAxis : item.radiusAxis,\r\n item.yAxis != null ? item.yAxis : item.angleAxis\r\n ];\r\n }\r\n }\r\n // x y is provided\r\n if (item.coord == null || !isArray(dims)) {\r\n item.coord = [];\r\n }\r\n else {\r\n // Each coord support max, min, average\r\n const coord = item.coord;\r\n for (let i = 0; i < 2; i++) {\r\n if (markerTypeCalculator[coord[i] as MarkerStatisticType]) {\r\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i] as MarkerStatisticType);\r\n }\r\n }\r\n }\r\n return item;\r\n}\r\n\r\nexport function getAxisInfo(\r\n item: MarkerPositionOption,\r\n data: SeriesData,\r\n coordSys: CoordinateSystem,\r\n seriesModel: SeriesModel\r\n) {\r\n const ret = {} as MarkerAxisInfo;\r\n\r\n if (item.valueIndex != null || item.valueDim != null) {\r\n ret.valueDataDim = item.valueIndex != null\r\n ? data.getDimension(item.valueIndex) : item.valueDim;\r\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\r\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n }\r\n else {\r\n ret.baseAxis = seriesModel.getBaseAxis();\r\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\r\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\r\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\r\n }\r\n\r\n return ret;\r\n}\r\n\r\nfunction dataDimToCoordDim(seriesModel: SeriesModel, dataDim: DimensionLoose): DimensionName {\r\n const dimItem = seriesModel.getData().getDimensionInfo(dataDim);\r\n return dimItem && dimItem.coordDim;\r\n}\r\n\r\n/**\r\n * Filter data which is out of coordinateSystem range\r\n * [dataFilter description]\r\n */\r\nexport function dataFilter(\r\n // Currently only polar and cartesian has containData.\r\n coordSys: CoordinateSystem & {\r\n containData?(data: ScaleDataValue[]): boolean\r\n },\r\n item: MarkerPositionOption\r\n) {\r\n // Always return true if there is no coordSys\r\n return (coordSys && coordSys.containData && item.coord && !hasXOrY(item))\r\n ? coordSys.containData(item.coord) : true;\r\n}\r\n\r\nexport function zoneFilter(\r\n // Currently only polar and cartesian has containData.\r\n coordSys: CoordinateSystem & {\r\n containZone?(data1: ScaleDataValue[], data2: ScaleDataValue[]): boolean\r\n },\r\n item1: MarkerPositionOption,\r\n item2: MarkerPositionOption\r\n) {\r\n // Always return true if there is no coordSys\r\n return (coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2))\r\n ? coordSys.containZone(item1.coord, item2.coord) : true;\r\n}\r\n\r\nexport function createMarkerDimValueGetter(\r\n inCoordSys: boolean,\r\n dims: SeriesDimensionDefine[]\r\n): MarkerDimValueGetter {\r\n return inCoordSys\r\n ? function (item, dimName, dataIndex, dimIndex) {\r\n const rawVal = dimIndex < 2\r\n // x, y, radius, angle\r\n ? (item.coord && item.coord[dimIndex])\r\n : item.value;\r\n return parseDataValue(rawVal, dims[dimIndex]);\r\n }\r\n : function (item, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(item.value, dims[dimIndex]);\r\n };\r\n}\r\n\r\nexport function numCalculate(\r\n data: SeriesData,\r\n valueDataDim: string,\r\n type: MarkerStatisticType\r\n) {\r\n if (type === 'average') {\r\n let sum = 0;\r\n let count = 0;\r\n data.each(valueDataDim, function (val: number, idx) {\r\n if (!isNaN(val)) {\r\n sum += val;\r\n count++;\r\n }\r\n });\r\n return sum / count;\r\n }\r\n else if (type === 'median') {\r\n return data.getMedian(valueDataDim);\r\n }\r\n else {\r\n // max & min\r\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ComponentView from '../../view/Component';\r\nimport { HashMap, createHashMap, each } from 'zrender/src/core/util';\r\nimport MarkerModel from './MarkerModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { makeInner } from '../../util/model';\r\nimport SeriesModel from '../../model/Series';\r\nimport Group from 'zrender/src/graphic/Group';\r\nimport { enterBlur, leaveBlur } from '../../util/states';\r\n\r\nconst inner = makeInner<{\r\n keep: boolean\r\n}, MarkerDraw>();\r\n\r\ninterface MarkerDraw {\r\n group: Group\r\n}\r\nabstract class MarkerView extends ComponentView {\r\n\r\n static type = 'marker';\r\n type = MarkerView.type;\r\n\r\n /**\r\n * Markline grouped by series\r\n */\r\n markerGroupMap: HashMap;\r\n\r\n init() {\r\n this.markerGroupMap = createHashMap();\r\n }\r\n\r\n render(markerModel: MarkerModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n const markerGroupMap = this.markerGroupMap;\r\n markerGroupMap.each(function (item) {\r\n inner(item).keep = false;\r\n });\r\n\r\n ecModel.eachSeries(seriesModel => {\r\n const markerModel = MarkerModel.getMarkerModelFromSeries(\r\n seriesModel,\r\n this.type as 'markPoint' | 'markLine' | 'markArea'\r\n );\r\n markerModel && this.renderSeries(seriesModel, markerModel, ecModel, api);\r\n });\r\n\r\n markerGroupMap.each(item => {\r\n !inner(item).keep && this.group.remove(item.group);\r\n });\r\n }\r\n\r\n markKeep(drawGroup: MarkerDraw) {\r\n inner(drawGroup).keep = true;\r\n }\r\n\r\n toggleBlurSeries(seriesModelList: SeriesModel[], isBlur: boolean) {\r\n each(seriesModelList, seriesModel => {\r\n const markerModel = MarkerModel.getMarkerModelFromSeries(\r\n seriesModel,\r\n this.type as 'markPoint' | 'markLine' | 'markArea'\r\n );\r\n if (markerModel) {\r\n const data = markerModel.getData();\r\n data.eachItemGraphicEl(function (el) {\r\n if (el) {\r\n isBlur ? enterBlur(el) : leaveBlur(el);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n abstract renderSeries(\r\n seriesModel: SeriesModel,\r\n markerModel: MarkerModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ): void;\r\n}\r\n\r\nexport default MarkerView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\nimport SymbolDraw from '../../chart/helper/SymbolDraw';\r\nimport * as numberUtil from '../../util/number';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport * as markerHelper from './markerHelper';\r\nimport MarkerView from './MarkerView';\r\nimport { CoordinateSystem } from '../../coord/CoordinateSystem';\r\nimport SeriesModel from '../../model/Series';\r\nimport MarkPointModel, {MarkPointDataItemOption} from './MarkPointModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport MarkerModel from './MarkerModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { HashMap, isFunction, map, filter, curry, extend } from 'zrender/src/core/util';\r\nimport { getECData } from '../../util/innerStore';\r\nimport { getVisualFromData } from '../../visual/helper';\r\nimport { ZRColor } from '../../util/types';\r\nimport SeriesDimensionDefine from '../../data/SeriesDimensionDefine';\r\n\r\nfunction updateMarkerLayout(\r\n mpData: SeriesData,\r\n seriesModel: SeriesModel,\r\n api: ExtensionAPI\r\n) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n mpData.each(function (idx: number) {\r\n const itemModel = mpData.getItemModel(idx);\r\n let point;\r\n const xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\r\n const yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n // Chart like bar may have there own marker positioning logic\r\n else if (seriesModel.getMarkerPosition) {\r\n // Use the getMarkerPosition\r\n point = seriesModel.getMarkerPosition(\r\n mpData.getValues(mpData.dimensions, idx)\r\n );\r\n }\r\n else if (coordSys) {\r\n const x = mpData.get(coordSys.dimensions[0], idx);\r\n const y = mpData.get(coordSys.dimensions[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n\r\n // Use x, y if has any\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n\r\n mpData.setItemLayout(idx, point);\r\n });\r\n}\r\n\r\nclass MarkPointView extends MarkerView {\r\n\r\n static type = 'markPoint';\r\n type = MarkPointView.type;\r\n\r\n markerGroupMap: HashMap;\r\n\r\n updateTransform(markPointModel: MarkPointModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n const mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint') as MarkPointModel;\r\n if (mpModel) {\r\n updateMarkerLayout(\r\n mpModel.getData(),\r\n seriesModel, api\r\n );\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n }\r\n }, this);\r\n }\r\n\r\n renderSeries(\r\n seriesModel: SeriesModel,\r\n mpModel: MarkPointModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const seriesId = seriesModel.id;\r\n const seriesData = seriesModel.getData();\r\n\r\n const symbolDrawMap = this.markerGroupMap;\r\n const symbolDraw = symbolDrawMap.get(seriesId)\r\n || symbolDrawMap.set(seriesId, new SymbolDraw());\r\n\r\n const mpData = createData(coordSys, seriesModel, mpModel);\r\n\r\n // FIXME\r\n mpModel.setData(mpData);\r\n\r\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\r\n\r\n mpData.each(function (idx) {\r\n const itemModel = mpData.getItemModel(idx);\r\n let symbol = itemModel.getShallow('symbol');\r\n let symbolSize = itemModel.getShallow('symbolSize');\r\n let symbolRotate = itemModel.getShallow('symbolRotate');\r\n let symbolOffset = itemModel.getShallow('symbolOffset');\r\n const symbolKeepAspect = itemModel.getShallow('symbolKeepAspect');\r\n\r\n // TODO: refactor needed: single data item should not support callback function\r\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {\r\n const rawIdx = mpModel.getRawValue(idx);\r\n const dataParams = mpModel.getDataParams(idx);\r\n if (isFunction(symbol)) {\r\n symbol = symbol(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolSize)) {\r\n // FIXME \u8FD9\u91CC\u4E0D\u517C\u5BB9 ECharts 2.x\uFF0C2.x \u8C8C\u4F3C\u53C2\u6570\u662F\u6574\u4E2A\u6570\u636E\uFF1F\r\n symbolSize = symbolSize(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolRotate)) {\r\n symbolRotate = symbolRotate(rawIdx, dataParams);\r\n }\r\n if (isFunction(symbolOffset)) {\r\n symbolOffset = symbolOffset(rawIdx, dataParams);\r\n }\r\n }\r\n\r\n const style = itemModel.getModel('itemStyle').getItemStyle();\r\n const color = getVisualFromData(seriesData, 'color') as ZRColor;\r\n if (!style.fill) {\r\n style.fill = color;\r\n }\r\n\r\n mpData.setItemVisual(idx, {\r\n symbol: symbol,\r\n symbolSize: symbolSize,\r\n symbolRotate: symbolRotate,\r\n symbolOffset: symbolOffset,\r\n symbolKeepAspect: symbolKeepAspect,\r\n style\r\n });\r\n });\r\n\r\n // TODO Text are wrong\r\n symbolDraw.updateData(mpData);\r\n this.group.add(symbolDraw.group);\r\n\r\n // Set host model for tooltip\r\n // FIXME\r\n mpData.eachItemGraphicEl(function (el) {\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mpModel;\r\n });\r\n });\r\n\r\n this.markKeep(symbolDraw);\r\n\r\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\r\n }\r\n}\r\n\r\nfunction createData(\r\n coordSys: CoordinateSystem,\r\n seriesModel: SeriesModel,\r\n mpModel: MarkPointModel\r\n) {\r\n let coordDimsInfos: SeriesDimensionDefine[];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n const info = seriesModel.getData().getDimensionInfo(\r\n seriesModel.getData().mapDimension(coordDim)\r\n ) || {};\r\n // In map series data don't have lng and lat dimension. Fallback to same with coordSys\r\n return extend(extend({}, info), {\r\n name: coordDim,\r\n // DON'T use ordinalMeta to parse and collect ordinal.\r\n ordinalMeta: null\r\n });\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n\r\n const mpData = new SeriesData(coordDimsInfos, mpModel);\r\n let dataOpt = map(mpModel.get('data'), curry(\r\n markerHelper.dataTransform, seriesModel\r\n ));\r\n if (coordSys) {\r\n dataOpt = filter(\r\n dataOpt, curry(markerHelper.dataFilter, coordSys)\r\n );\r\n }\r\n\r\n const dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\r\n mpData.initData(dataOpt, null, dimValueGetter);\r\n\r\n return mpData;\r\n}\r\n\r\nexport default MarkPointView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport checkMarkerInSeries from './checkMarkerInSeries';\r\nimport MarkPointModel from './MarkPointModel';\r\nimport MarkPointView from './MarkPointView';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(MarkPointModel);\r\n registers.registerComponentView(MarkPointView);\r\n\r\n registers.registerPreprocessor(function (opt) {\r\n if (checkMarkerInSeries(opt.series, 'markPoint')) {\r\n // Make sure markPoint component is enabled\r\n opt.markPoint = opt.markPoint || {};\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport MarkerModel, { MarkerOption, MarkerStatisticType, MarkerPositionOption } from './MarkerModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport {\r\n LineStyleOption,\r\n SeriesLineLabelOption,\r\n SymbolOptionMixin,\r\n ItemStyleOption,\r\n StatesOptionMixin,\r\n StatesMixinBase\r\n} from '../../util/types';\r\n\r\ninterface MarkLineStateOption {\r\n lineStyle?: LineStyleOption\r\n /**\r\n * itemStyle for symbol\r\n */\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLineLabelOption\r\n}\r\ninterface MarkLineDataItemOptionBase extends MarkLineStateOption,\r\n StatesOptionMixin {\r\n name?: string\r\n}\r\n\r\n// 1D markLine for horizontal or vertical\r\nexport interface MarkLine1DDataItemOption extends MarkLineDataItemOptionBase {\r\n\r\n // On cartesian coordinate system\r\n xAxis?: number | string\r\n yAxis?: number | string\r\n\r\n // Use statistic method\r\n type?: MarkerStatisticType\r\n /**\r\n * When using statistic method with type.\r\n * valueIndex and valueDim can be specify which dim the statistic is used on.\r\n */\r\n valueIndex?: number\r\n valueDim?: string\r\n\r\n /**\r\n * Symbol for both two ends\r\n */\r\n symbol?: string[] | string\r\n symbolSize?: number[] | number\r\n symbolRotate?: number[] | number\r\n symbolOffset?: number | string | (number | string)[]\r\n}\r\n\r\n// 2D markLine on any direction\r\ninterface MarkLine2DDataItemDimOption extends\r\n MarkLineDataItemOptionBase,\r\n SymbolOptionMixin,\r\n MarkerPositionOption {\r\n}\r\n\r\nexport type MarkLine2DDataItemOption = [\r\n // Start point\r\n MarkLine2DDataItemDimOption,\r\n // End point\r\n MarkLine2DDataItemDimOption\r\n];\r\n\r\nexport interface MarkLineOption extends MarkerOption,\r\n MarkLineStateOption,\r\n StatesOptionMixin {\r\n mainType?: 'markLine'\r\n\r\n symbol?: string[] | string\r\n symbolSize?: number[] | number\r\n symbolRotate?: number[] | number\r\n symbolOffset?: number | string | (number | string)[]\r\n\r\n /**\r\n * Precision used on statistic method\r\n */\r\n precision?: number\r\n\r\n data?: (MarkLine1DDataItemOption | MarkLine2DDataItemOption)[]\r\n}\r\n\r\nclass MarkLineModel extends MarkerModel {\r\n\r\n static type = 'markLine';\r\n type = MarkLineModel.type;\r\n\r\n createMarkerModelFromSeries(\r\n markerOpt: MarkLineOption,\r\n masterMarkerModel: MarkLineModel,\r\n ecModel: GlobalModel\r\n ) {\r\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\r\n }\r\n\r\n static defaultOption: MarkLineOption = {\r\n // zlevel: 0,\r\n z: 5,\r\n\r\n symbol: ['circle', 'arrow'],\r\n symbolSize: [8, 16],\r\n\r\n // symbolRotate: 0,\r\n symbolOffset: 0,\r\n\r\n precision: 2,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n label: {\r\n show: true,\r\n position: 'end',\r\n distance: 5\r\n },\r\n lineStyle: {\r\n type: 'dashed'\r\n },\r\n emphasis: {\r\n label: {\r\n show: true\r\n },\r\n lineStyle: {\r\n width: 3\r\n }\r\n },\r\n animationEasing: 'linear'\r\n };\r\n}\r\n\r\nexport default MarkLineModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport SeriesData from '../../data/SeriesData';\r\nimport * as numberUtil from '../../util/number';\r\nimport * as markerHelper from './markerHelper';\r\nimport LineDraw from '../../chart/helper/LineDraw';\r\nimport MarkerView from './MarkerView';\r\nimport {getStackedDimension} from '../../data/helper/dataStackHelper';\r\nimport { CoordinateSystem, isCoordinateSystemType } from '../../coord/CoordinateSystem';\r\nimport MarkLineModel, { MarkLine2DDataItemOption, MarkLineOption } from './MarkLineModel';\r\nimport { ScaleDataValue, ColorString } from '../../util/types';\r\nimport SeriesModel from '../../model/Series';\r\nimport { getECData } from '../../util/innerStore';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport GlobalModel from '../../model/Global';\r\nimport MarkerModel from './MarkerModel';\r\nimport {\r\n isArray,\r\n retrieve,\r\n retrieve2,\r\n clone,\r\n extend,\r\n logError,\r\n merge,\r\n map,\r\n curry,\r\n filter,\r\n HashMap,\r\n isNumber\r\n} from 'zrender/src/core/util';\r\nimport { makeInner } from '../../util/model';\r\nimport { LineDataVisual } from '../../visual/commonVisualTypes';\r\nimport { getVisualFromData } from '../../visual/helper';\r\nimport Axis2D from '../../coord/cartesian/Axis2D';\r\nimport SeriesDimensionDefine from '../../data/SeriesDimensionDefine';\r\n\r\n// Item option for configuring line and each end of symbol.\r\n// Line option. be merged from configuration of two ends.\r\ntype MarkLineMergedItemOption = MarkLine2DDataItemOption[number];\r\n\r\nconst inner = makeInner<{\r\n // from data\r\n from: SeriesData\r\n // to data\r\n to: SeriesData\r\n}, MarkLineModel>();\r\n\r\nconst markLineTransform = function (\r\n seriesModel: SeriesModel,\r\n coordSys: CoordinateSystem,\r\n mlModel: MarkLineModel,\r\n item: MarkLineOption['data'][number]\r\n) {\r\n const data = seriesModel.getData();\r\n\r\n let itemArray: MarkLineMergedItemOption[];\r\n if (!isArray(item)) {\r\n // Special type markLine like 'min', 'max', 'average', 'median'\r\n const mlType = item.type;\r\n if (\r\n mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'\r\n // In case\r\n // data: [{\r\n // yAxis: 10\r\n // }]\r\n || (item.xAxis != null || item.yAxis != null)\r\n ) {\r\n\r\n let valueAxis;\r\n let value;\r\n\r\n if (item.yAxis != null || item.xAxis != null) {\r\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\r\n value = retrieve(item.yAxis, item.xAxis);\r\n }\r\n else {\r\n const axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);\r\n valueAxis = axisInfo.valueAxis;\r\n const valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\r\n value = markerHelper.numCalculate(data, valueDataDim, mlType);\r\n }\r\n const valueIndex = valueAxis.dim === 'x' ? 0 : 1;\r\n const baseIndex = 1 - valueIndex;\r\n\r\n // Normized to 2d data with start and end point\r\n const mlFrom = clone(item) as MarkLine2DDataItemOption[number];\r\n const mlTo = {\r\n coord: []\r\n } as MarkLine2DDataItemOption[number];\r\n\r\n mlFrom.type = null;\r\n\r\n mlFrom.coord = [];\r\n mlFrom.coord[baseIndex] = -Infinity;\r\n mlTo.coord[baseIndex] = Infinity;\r\n\r\n const precision = mlModel.get('precision');\r\n if (precision >= 0 && isNumber(value)) {\r\n value = +value.toFixed(Math.min(precision, 20));\r\n }\r\n\r\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\r\n\r\n itemArray = [mlFrom, mlTo, { // Extra option for tooltip and label\r\n type: mlType,\r\n valueIndex: item.valueIndex,\r\n // Force to use the value of calculated value.\r\n value: value\r\n }];\r\n }\r\n else {\r\n // Invalid data\r\n if (__DEV__) {\r\n logError('Invalid markLine data.');\r\n }\r\n itemArray = [];\r\n }\r\n }\r\n else {\r\n itemArray = item;\r\n }\r\n\r\n const normalizedItem = [\r\n markerHelper.dataTransform(seriesModel, itemArray[0]),\r\n markerHelper.dataTransform(seriesModel, itemArray[1]),\r\n extend({}, itemArray[2])\r\n ];\r\n\r\n // Avoid line data type is extended by from(to) data type\r\n normalizedItem[2].type = normalizedItem[2].type || null;\r\n\r\n // Merge from option and to option into line option\r\n merge(normalizedItem[2], normalizedItem[0]);\r\n merge(normalizedItem[2], normalizedItem[1]);\r\n\r\n return normalizedItem;\r\n};\r\n\r\nfunction isInfinity(val: ScaleDataValue) {\r\n return !isNaN(val as number) && !isFinite(val as number);\r\n}\r\n\r\n// If a markLine has one dim\r\nfunction ifMarkLineHasOnlyDim(\r\n dimIndex: number,\r\n fromCoord: ScaleDataValue[],\r\n toCoord: ScaleDataValue[],\r\n coordSys: CoordinateSystem\r\n) {\r\n const otherDimIndex = 1 - dimIndex;\r\n const dimName = coordSys.dimensions[dimIndex];\r\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex])\r\n && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\r\n}\r\n\r\nfunction markLineFilter(\r\n coordSys: CoordinateSystem,\r\n item: MarkLine2DDataItemOption\r\n) {\r\n if (coordSys.type === 'cartesian2d') {\r\n const fromCoord = item[0].coord;\r\n const toCoord = item[1].coord;\r\n // In case\r\n // {\r\n // markLine: {\r\n // data: [{ yAxis: 2 }]\r\n // }\r\n // }\r\n if (\r\n fromCoord && toCoord\r\n && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))\r\n ) {\r\n return true;\r\n }\r\n }\r\n return markerHelper.dataFilter(coordSys, item[0])\r\n && markerHelper.dataFilter(coordSys, item[1]);\r\n}\r\n\r\nfunction updateSingleMarkerEndLayout(\r\n data: SeriesData,\r\n idx: number,\r\n isFrom: boolean,\r\n seriesModel: SeriesModel,\r\n api: ExtensionAPI\r\n) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const itemModel = data.getItemModel(idx);\r\n\r\n let point;\r\n const xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\r\n const yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n // Chart like bar may have there own marker positioning logic\r\n if (seriesModel.getMarkerPosition) {\r\n // Use the getMarkerPosition\r\n point = seriesModel.getMarkerPosition(\r\n data.getValues(data.dimensions, idx)\r\n );\r\n }\r\n else {\r\n const dims = coordSys.dimensions;\r\n const x = data.get(dims[0], idx);\r\n const y = data.get(dims[1], idx);\r\n point = coordSys.dataToPoint([x, y]);\r\n }\r\n // Expand line to the edge of grid if value on one axis is Inifnity\r\n // In case\r\n // markLine: {\r\n // data: [{\r\n // yAxis: 2\r\n // // or\r\n // type: 'average'\r\n // }]\r\n // }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\r\n const xAxis = coordSys.getAxis('x') as Axis2D;\r\n const yAxis = coordSys.getAxis('y') as Axis2D;\r\n const dims = coordSys.dimensions;\r\n if (isInfinity(data.get(dims[0], idx))) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n else if (isInfinity(data.get(dims[1], idx))) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\r\n }\r\n }\r\n\r\n // Use x, y if has any\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n\r\n data.setItemLayout(idx, point);\r\n}\r\n\r\nclass MarkLineView extends MarkerView {\r\n\r\n static type = 'markLine';\r\n type = MarkLineView.type;\r\n\r\n markerGroupMap: HashMap;\r\n\r\n updateTransform(markLineModel: MarkLineModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n const mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine') as MarkLineModel;\r\n if (mlModel) {\r\n const mlData = mlModel.getData();\r\n const fromData = inner(mlModel).from;\r\n const toData = inner(mlModel).to;\r\n // Update visual and layout of from symbol and to symbol\r\n fromData.each(function (idx) {\r\n updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api);\r\n updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api);\r\n });\r\n // Update layout of line\r\n mlData.each(function (idx) {\r\n mlData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n });\r\n\r\n this.markerGroupMap.get(seriesModel.id).updateLayout();\r\n\r\n }\r\n }, this);\r\n }\r\n\r\n renderSeries(\r\n seriesModel: SeriesModel,\r\n mlModel: MarkLineModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const seriesId = seriesModel.id;\r\n const seriesData = seriesModel.getData();\r\n\r\n const lineDrawMap = this.markerGroupMap;\r\n const lineDraw = lineDrawMap.get(seriesId)\r\n || lineDrawMap.set(seriesId, new LineDraw());\r\n this.group.add(lineDraw.group);\r\n\r\n const mlData = createList(coordSys, seriesModel, mlModel);\r\n\r\n const fromData = mlData.from;\r\n const toData = mlData.to;\r\n const lineData = mlData.line as SeriesData;\r\n\r\n inner(mlModel).from = fromData;\r\n inner(mlModel).to = toData;\r\n // Line data for tooltip and formatter\r\n mlModel.setData(lineData);\r\n\r\n // TODO\r\n // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.\r\n // But the related logic and type definition are not finished yet.\r\n // Finish it if required\r\n let symbolType = mlModel.get('symbol');\r\n let symbolSize = mlModel.get('symbolSize');\r\n let symbolRotate = mlModel.get('symbolRotate');\r\n let symbolOffset = mlModel.get('symbolOffset');\r\n // TODO: support callback function like markPoint\r\n if (!isArray(symbolType)) {\r\n symbolType = [symbolType, symbolType];\r\n }\r\n if (!isArray(symbolSize)) {\r\n symbolSize = [symbolSize, symbolSize];\r\n }\r\n if (!isArray(symbolRotate)) {\r\n symbolRotate = [symbolRotate, symbolRotate];\r\n }\r\n if (!isArray(symbolOffset)) {\r\n symbolOffset = [symbolOffset, symbolOffset];\r\n }\r\n\r\n // Update visual and layout of from symbol and to symbol\r\n mlData.from.each(function (idx) {\r\n updateDataVisualAndLayout(fromData, idx, true);\r\n updateDataVisualAndLayout(toData, idx, false);\r\n });\r\n\r\n // Update visual and layout of line\r\n lineData.each(function (idx) {\r\n const lineStyle = lineData.getItemModel(idx)\r\n .getModel('lineStyle').getLineStyle();\r\n // lineData.setItemVisual(idx, {\r\n // color: lineColor || fromData.getItemVisual(idx, 'color')\r\n // });\r\n lineData.setItemLayout(idx, [\r\n fromData.getItemLayout(idx),\r\n toData.getItemLayout(idx)\r\n ]);\r\n\r\n if (lineStyle.stroke == null) {\r\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\r\n }\r\n\r\n lineData.setItemVisual(idx, {\r\n fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'),\r\n fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'),\r\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\r\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize') as number,\r\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\r\n toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'),\r\n toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'),\r\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\r\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize') as number,\r\n toSymbol: toData.getItemVisual(idx, 'symbol'),\r\n style: lineStyle\r\n });\r\n });\r\n\r\n lineDraw.updateData(lineData);\r\n\r\n // Set host model for tooltip\r\n // FIXME\r\n mlData.line.eachItemGraphicEl(function (el) {\r\n getECData(el).dataModel = mlModel;\r\n\r\n el.traverse(function (child) {\r\n getECData(child).dataModel = mlModel;\r\n });\r\n });\r\n\r\n function updateDataVisualAndLayout(\r\n data: SeriesData,\r\n idx: number,\r\n isFrom: boolean\r\n ) {\r\n const itemModel = data.getItemModel(idx);\r\n\r\n updateSingleMarkerEndLayout(\r\n data, idx, isFrom, seriesModel, api\r\n );\r\n\r\n const style = itemModel.getModel('itemStyle').getItemStyle();\r\n if (style.fill == null) {\r\n style.fill = getVisualFromData(seriesData, 'color') as ColorString;\r\n }\r\n\r\n data.setItemVisual(idx, {\r\n symbolKeepAspect: itemModel.get('symbolKeepAspect'),\r\n // `0` should be considered as a valid value, so use `retrieve2` instead of `||`\r\n symbolOffset: retrieve2(\r\n itemModel.get('symbolOffset', true),\r\n (symbolOffset as (string | number)[])[isFrom ? 0 : 1]\r\n ),\r\n symbolRotate: retrieve2(\r\n itemModel.get('symbolRotate', true),\r\n (symbolRotate as number[])[isFrom ? 0 : 1]\r\n ),\r\n // TODO: when 2d array is supported, it should ignore parent\r\n symbolSize: retrieve2(\r\n itemModel.get('symbolSize'),\r\n (symbolSize as number[])[isFrom ? 0 : 1]\r\n ),\r\n symbol: retrieve2(\r\n itemModel.get('symbol', true),\r\n (symbolType as string[])[isFrom ? 0 : 1]\r\n ),\r\n style\r\n });\r\n }\r\n\r\n this.markKeep(lineDraw);\r\n\r\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\r\n }\r\n}\r\n\r\nfunction createList(coordSys: CoordinateSystem, seriesModel: SeriesModel, mlModel: MarkLineModel) {\r\n\r\n let coordDimsInfos: SeriesDimensionDefine[];\r\n if (coordSys) {\r\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n const info = seriesModel.getData().getDimensionInfo(\r\n seriesModel.getData().mapDimension(coordDim)\r\n ) || {};\r\n // In map series data don't have lng and lat dimension. Fallback to same with coordSys\r\n return extend(extend({}, info), {\r\n name: coordDim,\r\n // DON'T use ordinalMeta to parse and collect ordinal.\r\n ordinalMeta: null\r\n });\r\n });\r\n }\r\n else {\r\n coordDimsInfos = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n }\r\n\r\n const fromData = new SeriesData(coordDimsInfos, mlModel);\r\n const toData = new SeriesData(coordDimsInfos, mlModel);\r\n // No dimensions\r\n const lineData = new SeriesData([], mlModel);\r\n\r\n let optData = map(mlModel.get('data'), curry(\r\n markLineTransform, seriesModel, coordSys, mlModel\r\n ));\r\n if (coordSys) {\r\n optData = filter(\r\n optData, curry(markLineFilter, coordSys)\r\n );\r\n }\r\n\r\n const dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\r\n\r\n fromData.initData(\r\n map(optData, function (item) {\r\n return item[0];\r\n }),\r\n null,\r\n dimValueGetter\r\n );\r\n toData.initData(\r\n map(optData, function (item) {\r\n return item[1];\r\n }),\r\n null,\r\n dimValueGetter\r\n );\r\n lineData.initData(\r\n map(optData, function (item) {\r\n return item[2];\r\n })\r\n );\r\n lineData.hasItemOption = true;\r\n\r\n return {\r\n from: fromData,\r\n to: toData,\r\n line: lineData\r\n };\r\n}\r\n\r\nexport default MarkLineView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport checkMarkerInSeries from './checkMarkerInSeries';\r\nimport MarkLineModel from './MarkLineModel';\r\nimport MarkLineView from './MarkLineView';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(MarkLineModel);\r\n registers.registerComponentView(MarkLineView);\r\n\r\n registers.registerPreprocessor(function (opt) {\r\n if (checkMarkerInSeries(opt.series, 'markLine')) {\r\n // Make sure markLine component is enabled\r\n opt.markLine = opt.markLine || {};\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport MarkerModel, { MarkerOption, MarkerStatisticType, MarkerPositionOption } from './MarkerModel';\r\nimport { SeriesLabelOption, ItemStyleOption, StatesOptionMixin, StatesMixinBase } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\n\r\n\r\ninterface MarkAreaStateOption {\r\n itemStyle?: ItemStyleOption\r\n label?: SeriesLabelOption\r\n}\r\n\r\ninterface MarkAreaDataItemOptionBase extends MarkAreaStateOption,\r\n StatesOptionMixin {\r\n name?: string\r\n}\r\n\r\n// 1D markArea for horizontal or vertical. Similar to markLine\r\nexport interface MarkArea1DDataItemOption extends MarkAreaDataItemOptionBase {\r\n\r\n xAxis?: number\r\n yAxis?: number\r\n\r\n type?: MarkerStatisticType\r\n\r\n valueIndex?: number\r\n valueDim?: string\r\n}\r\n\r\n// 2D markArea on any direction. Similar to markLine\r\ninterface MarkArea2DDataItemDimOption extends MarkAreaDataItemOptionBase, MarkerPositionOption {\r\n}\r\n\r\n\r\nexport type MarkArea2DDataItemOption = [\r\n // Start point\r\n MarkArea2DDataItemDimOption,\r\n // End point\r\n MarkArea2DDataItemDimOption\r\n];\r\n\r\nexport interface MarkAreaOption extends MarkerOption, MarkAreaStateOption,\r\n StatesOptionMixin {\r\n mainType?: 'markArea'\r\n\r\n precision?: number\r\n\r\n data?: (MarkArea1DDataItemOption | MarkArea2DDataItemOption)[]\r\n}\r\n\r\nclass MarkAreaModel extends MarkerModel {\r\n\r\n static type = 'markArea';\r\n type = MarkAreaModel.type;\r\n\r\n createMarkerModelFromSeries(\r\n markerOpt: MarkAreaOption,\r\n masterMarkerModel: MarkAreaModel,\r\n ecModel: GlobalModel\r\n ) {\r\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\r\n }\r\n\r\n static defaultOption: MarkAreaOption = {\r\n // zlevel: 0,\r\n // PENDING\r\n z: 1,\r\n tooltip: {\r\n trigger: 'item'\r\n },\r\n // markArea should fixed on the coordinate system\r\n animation: false,\r\n label: {\r\n show: true,\r\n position: 'top'\r\n },\r\n itemStyle: {\r\n // color and borderColor default to use color from series\r\n // color: 'auto'\r\n // borderColor: 'auto'\r\n borderWidth: 0\r\n },\r\n\r\n emphasis: {\r\n label: {\r\n show: true,\r\n position: 'top'\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport default MarkAreaModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// TODO Optimize on polar\r\n\r\nimport * as colorUtil from 'zrender/src/tool/color';\r\nimport SeriesData from '../../data/SeriesData';\r\nimport * as numberUtil from '../../util/number';\r\nimport * as graphic from '../../util/graphic';\r\nimport { toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states';\r\nimport * as markerHelper from './markerHelper';\r\nimport MarkerView from './MarkerView';\r\nimport { retrieve, mergeAll, map, curry, filter, HashMap, extend, isString } from 'zrender/src/core/util';\r\nimport { ScaleDataValue, ZRColor } from '../../util/types';\r\nimport { CoordinateSystem, isCoordinateSystemType } from '../../coord/CoordinateSystem';\r\nimport MarkAreaModel, { MarkArea2DDataItemOption } from './MarkAreaModel';\r\nimport SeriesModel from '../../model/Series';\r\nimport Cartesian2D from '../../coord/cartesian/Cartesian2D';\r\nimport SeriesDimensionDefine from '../../data/SeriesDimensionDefine';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport MarkerModel from './MarkerModel';\r\nimport { makeInner } from '../../util/model';\r\nimport { getVisualFromData } from '../../visual/helper';\r\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';\r\nimport { getECData } from '../../util/innerStore';\r\nimport Axis2D from '../../coord/cartesian/Axis2D';\r\nimport { parseDataValue } from '../../data/helper/dataValueHelper';\r\n\r\ninterface MarkAreaDrawGroup {\r\n group: graphic.Group\r\n}\r\n\r\nconst inner = makeInner<{\r\n data: SeriesData\r\n}, MarkAreaDrawGroup>();\r\n\r\n// Merge two ends option into one.\r\ntype MarkAreaMergedItemOption = Omit & {\r\n coord: MarkArea2DDataItemOption[number]['coord'][]\r\n x0: number | string\r\n y0: number | string\r\n x1: number | string\r\n y1: number | string\r\n};\r\n\r\nconst markAreaTransform = function (\r\n seriesModel: SeriesModel,\r\n coordSys: CoordinateSystem,\r\n maModel: MarkAreaModel,\r\n item: MarkArea2DDataItemOption\r\n): MarkAreaMergedItemOption {\r\n // item may be null\r\n const item0 = item[0];\r\n const item1 = item[1];\r\n if (!item0 || !item1) {\r\n return;\r\n }\r\n\r\n const lt = markerHelper.dataTransform(seriesModel, item0);\r\n const rb = markerHelper.dataTransform(seriesModel, item1);\r\n\r\n // FIXME make sure lt is less than rb\r\n const ltCoord = lt.coord;\r\n const rbCoord = rb.coord;\r\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\r\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\r\n\r\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\r\n rbCoord[1] = retrieve(rbCoord[1], Infinity);\r\n\r\n // Merge option into one\r\n const result: MarkAreaMergedItemOption = mergeAll([{}, lt, rb]);\r\n\r\n result.coord = [\r\n lt.coord, rb.coord\r\n ];\r\n result.x0 = lt.x;\r\n result.y0 = lt.y;\r\n result.x1 = rb.x;\r\n result.y1 = rb.y;\r\n return result;\r\n};\r\n\r\nfunction isInfinity(val: ScaleDataValue) {\r\n return !isNaN(val as number) && !isFinite(val as number);\r\n}\r\n\r\n// If a markArea has one dim\r\nfunction ifMarkAreaHasOnlyDim(\r\n dimIndex: number,\r\n fromCoord: ScaleDataValue[],\r\n toCoord: ScaleDataValue[],\r\n coordSys: CoordinateSystem\r\n) {\r\n const otherDimIndex = 1 - dimIndex;\r\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]);\r\n}\r\n\r\nfunction markAreaFilter(coordSys: CoordinateSystem, item: MarkAreaMergedItemOption) {\r\n const fromCoord = item.coord[0];\r\n const toCoord = item.coord[1];\r\n const item0 = {\r\n coord: fromCoord,\r\n x: item.x0,\r\n y: item.y0\r\n };\r\n const item1 = {\r\n coord: toCoord,\r\n x: item.x1,\r\n y: item.y1\r\n };\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n // In case\r\n // {\r\n // markArea: {\r\n // data: [{ yAxis: 2 }]\r\n // }\r\n // }\r\n if (\r\n fromCoord && toCoord\r\n && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys)\r\n || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))\r\n ) {\r\n return true;\r\n }\r\n // Directly returning true may also do the work,\r\n // because markArea will not be shown automatically\r\n // when it's not included in coordinate system.\r\n // But filtering ahead can avoid keeping rendering markArea\r\n // when there are too many of them.\r\n return markerHelper.zoneFilter(coordSys, item0, item1);\r\n }\r\n return markerHelper.dataFilter(coordSys, item0)\r\n || markerHelper.dataFilter(coordSys, item1);\r\n}\r\n\r\n// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\r\nfunction getSingleMarkerEndPoint(\r\n data: SeriesData,\r\n idx: number,\r\n dims: typeof dimPermutations[number],\r\n seriesModel: SeriesModel,\r\n api: ExtensionAPI\r\n) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const itemModel = data.getItemModel(idx);\r\n\r\n let point;\r\n const xPx = numberUtil.parsePercent(itemModel.get(dims[0]), api.getWidth());\r\n const yPx = numberUtil.parsePercent(itemModel.get(dims[1]), api.getHeight());\r\n if (!isNaN(xPx) && !isNaN(yPx)) {\r\n point = [xPx, yPx];\r\n }\r\n else {\r\n // Chart like bar may have there own marker positioning logic\r\n if (seriesModel.getMarkerPosition) {\r\n // Consider the case that user input the right-bottom point first\r\n // Pick the larger x and y as 'x1' and 'y1'\r\n const pointValue0 = data.getValues(['x0', 'y0'], idx);\r\n const pointValue1 = data.getValues(['x1', 'y1'], idx);\r\n const clampPointValue0 = coordSys.clampData(pointValue0);\r\n const clampPointValue1 = coordSys.clampData(pointValue1);\r\n const pointValue = [];\r\n if (dims[0] === 'x0') {\r\n pointValue[0] = (clampPointValue0[0] > clampPointValue1[0]) ? pointValue1[0] : pointValue0[0];\r\n }\r\n else {\r\n pointValue[0] = (clampPointValue0[0] > clampPointValue1[0]) ? pointValue0[0] : pointValue1[0];\r\n }\r\n if (dims[1] === 'y0') {\r\n pointValue[1] = (clampPointValue0[1] > clampPointValue1[1]) ? pointValue1[1] : pointValue0[1];\r\n }\r\n else {\r\n pointValue[1] = (clampPointValue0[1] > clampPointValue1[1]) ? pointValue0[1] : pointValue1[1];\r\n }\r\n // Use the getMarkerPosition\r\n point = seriesModel.getMarkerPosition(\r\n pointValue, dims, true\r\n );\r\n }\r\n else {\r\n const x = data.get(dims[0], idx) as number;\r\n const y = data.get(dims[1], idx) as number;\r\n const pt = [x, y];\r\n coordSys.clampData && coordSys.clampData(pt, pt);\r\n point = coordSys.dataToPoint(pt, true);\r\n }\r\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\r\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\r\n const xAxis = coordSys.getAxis('x') as Axis2D;\r\n const yAxis = coordSys.getAxis('y') as Axis2D;\r\n const x = data.get(dims[0], idx) as number;\r\n const y = data.get(dims[1], idx) as number;\r\n if (isInfinity(x)) {\r\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\r\n }\r\n else if (isInfinity(y)) {\r\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\r\n }\r\n }\r\n\r\n // Use x, y if has any\r\n if (!isNaN(xPx)) {\r\n point[0] = xPx;\r\n }\r\n if (!isNaN(yPx)) {\r\n point[1] = yPx;\r\n }\r\n }\r\n\r\n return point;\r\n}\r\n\r\nexport const dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']] as const;\r\n\r\nclass MarkAreaView extends MarkerView {\r\n\r\n static type = 'markArea';\r\n type = MarkAreaView.type;\r\n\r\n markerGroupMap: HashMap;\r\n\r\n updateTransform(markAreaModel: MarkAreaModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n ecModel.eachSeries(function (seriesModel) {\r\n const maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea') as MarkAreaModel;\r\n if (maModel) {\r\n const areaData = maModel.getData();\r\n areaData.each(function (idx) {\r\n const points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n // Layout\r\n areaData.setItemLayout(idx, points);\r\n const el = areaData.getItemGraphicEl(idx) as graphic.Polygon;\r\n el.setShape('points', points);\r\n });\r\n }\r\n }, this);\r\n }\r\n\r\n renderSeries(\r\n seriesModel: SeriesModel,\r\n maModel: MarkAreaModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const coordSys = seriesModel.coordinateSystem;\r\n const seriesId = seriesModel.id;\r\n const seriesData = seriesModel.getData();\r\n\r\n const areaGroupMap = this.markerGroupMap;\r\n const polygonGroup = areaGroupMap.get(seriesId)\r\n || areaGroupMap.set(seriesId, {group: new graphic.Group()});\r\n\r\n this.group.add(polygonGroup.group);\r\n this.markKeep(polygonGroup);\r\n\r\n const areaData = createList(coordSys, seriesModel, maModel);\r\n\r\n // Line data for tooltip and formatter\r\n maModel.setData(areaData);\r\n\r\n // Update visual and layout of line\r\n areaData.each(function (idx) {\r\n // Layout\r\n const points = map(dimPermutations, function (dim) {\r\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\r\n });\r\n const xAxisScale = coordSys.getAxis('x').scale;\r\n const yAxisScale = coordSys.getAxis('y').scale;\r\n const xAxisExtent = xAxisScale.getExtent();\r\n const yAxisExtent = yAxisScale.getExtent();\r\n const xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))];\r\n const yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))];\r\n numberUtil.asc(xPointExtent);\r\n numberUtil.asc(yPointExtent);\r\n const overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0]\r\n || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]);\r\n // If none of the area is inside coordSys, allClipped is set to be true\r\n // in layout so that label will not be displayed. See #12591\r\n const allClipped = !overlapped;\r\n areaData.setItemLayout(idx, {\r\n points: points,\r\n allClipped: allClipped\r\n });\r\n\r\n\r\n const style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\r\n const color = getVisualFromData(seriesData, 'color') as ZRColor;\r\n if (!style.fill) {\r\n style.fill = color;\r\n if (isString(style.fill)) {\r\n style.fill = colorUtil.modifyAlpha(style.fill, 0.4);\r\n }\r\n }\r\n if (!style.stroke) {\r\n style.stroke = color;\r\n }\r\n // Visual\r\n areaData.setItemVisual(idx, 'style', style);\r\n });\r\n\r\n\r\n areaData.diff(inner(polygonGroup).data)\r\n .add(function (idx) {\r\n const layout = areaData.getItemLayout(idx);\r\n if (!layout.allClipped) {\r\n const polygon = new graphic.Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n areaData.setItemGraphicEl(idx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n })\r\n .update(function (newIdx, oldIdx) {\r\n let polygon = inner(polygonGroup).data.getItemGraphicEl(oldIdx) as graphic.Polygon;\r\n const layout = areaData.getItemLayout(newIdx);\r\n if (!layout.allClipped) {\r\n if (polygon) {\r\n graphic.updateProps(polygon, {\r\n shape: {\r\n points: layout.points\r\n }\r\n }, maModel, newIdx);\r\n }\r\n else {\r\n polygon = new graphic.Polygon({\r\n shape: {\r\n points: layout.points\r\n }\r\n });\r\n }\r\n areaData.setItemGraphicEl(newIdx, polygon);\r\n polygonGroup.group.add(polygon);\r\n }\r\n else if (polygon) {\r\n polygonGroup.group.remove(polygon);\r\n }\r\n })\r\n .remove(function (idx) {\r\n const polygon = inner(polygonGroup).data.getItemGraphicEl(idx);\r\n polygonGroup.group.remove(polygon);\r\n })\r\n .execute();\r\n\r\n areaData.eachItemGraphicEl(function (polygon: graphic.Polygon, idx) {\r\n const itemModel = areaData.getItemModel(idx);\r\n const style = areaData.getItemVisual(idx, 'style');\r\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\r\n\r\n setLabelStyle(\r\n polygon, getLabelStatesModels(itemModel),\r\n {\r\n labelFetcher: maModel,\r\n labelDataIndex: idx,\r\n defaultText: areaData.getName(idx) || '',\r\n inheritColor: isString(style.fill)\r\n ? colorUtil.modifyAlpha(style.fill, 1) : '#000'\r\n }\r\n );\r\n\r\n setStatesStylesFromModel(polygon, itemModel);\r\n\r\n toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled']));\r\n\r\n getECData(polygon).dataModel = maModel;\r\n });\r\n\r\n inner(polygonGroup).data = areaData;\r\n\r\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\r\n }\r\n}\r\n\r\nfunction createList(\r\n coordSys: CoordinateSystem,\r\n seriesModel: SeriesModel,\r\n maModel: MarkAreaModel\r\n) {\r\n\r\n let areaData: SeriesData;\r\n let dataDims: SeriesDimensionDefine[];\r\n const dims = ['x0', 'y0', 'x1', 'y1'];\r\n if (coordSys) {\r\n const coordDimsInfos: SeriesDimensionDefine[] = map(coordSys && coordSys.dimensions, function (coordDim) {\r\n const data = seriesModel.getData();\r\n const info = data.getDimensionInfo(\r\n data.mapDimension(coordDim)\r\n ) || {};\r\n // In map series data don't have lng and lat dimension. Fallback to same with coordSys\r\n return extend(extend({}, info), {\r\n name: coordDim,\r\n // DON'T use ordinalMeta to parse and collect ordinal.\r\n ordinalMeta: null\r\n });\r\n });\r\n dataDims = map(dims, (dim, idx) => ({\r\n name: dim,\r\n type: coordDimsInfos[idx % 2].type\r\n }));\r\n areaData = new SeriesData(dataDims, maModel);\r\n }\r\n else {\r\n dataDims = [{\r\n name: 'value',\r\n type: 'float'\r\n }];\r\n areaData = new SeriesData(dataDims, maModel);\r\n }\r\n\r\n let optData = map(maModel.get('data'), curry(\r\n markAreaTransform, seriesModel, coordSys, maModel\r\n ));\r\n if (coordSys) {\r\n optData = filter(\r\n optData, curry(markAreaFilter, coordSys)\r\n );\r\n }\r\n\r\n const dimValueGetter: markerHelper.MarkerDimValueGetter = coordSys\r\n ? function (item, dimName, dataIndex, dimIndex) {\r\n // TODO should convert to ParsedValue?\r\n const rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\r\n return parseDataValue(rawVal, dataDims[dimIndex]);\r\n }\r\n : function (item, dimName, dataIndex, dimIndex) {\r\n return parseDataValue(item.value, dataDims[dimIndex]);\r\n };\r\n areaData.initData(optData, null, dimValueGetter);\r\n areaData.hasItemOption = true;\r\n return areaData;\r\n}\r\n\r\nexport default MarkAreaView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport checkMarkerInSeries from './checkMarkerInSeries';\r\nimport MarkAreaModel from './MarkAreaModel';\r\nimport MarkAreaView from './MarkAreaView';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(MarkAreaModel);\r\n registers.registerComponentView(MarkAreaView);\r\n\r\n registers.registerPreprocessor(function (opt) {\r\n if (checkMarkerInSeries(opt.series, 'markArea')) {\r\n // Make sure markArea component is enabled\r\n opt.markArea = opt.markArea || {};\r\n }\r\n });\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport Model from '../../model/Model';\r\nimport {isNameSpecified} from '../../util/model';\r\nimport ComponentModel from '../../model/Component';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n BorderOptionMixin,\r\n ColorString,\r\n LabelOption,\r\n LayoutOrient,\r\n CommonTooltipOption,\r\n ItemStyleOption,\r\n LineStyleOption\r\n} from '../../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport GlobalModel from '../../model/Global';\r\nimport { ItemStyleProps } from '../../model/mixin/itemStyle';\r\nimport { LineStyleProps } from './../../model/mixin/lineStyle';\r\nimport {PathStyleProps} from 'zrender/src/graphic/Path';\r\n\r\ntype LegendDefaultSelectorOptionsProps = {\r\n type: string;\r\n title: string;\r\n};\r\nconst getDefaultSelectorOptions = function (ecModel: GlobalModel, type: string): LegendDefaultSelectorOptionsProps {\r\n if (type === 'all') {\r\n return {\r\n type: 'all',\r\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'all'])\r\n };\r\n }\r\n else if (type === 'inverse') {\r\n return {\r\n type: 'inverse',\r\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse'])\r\n };\r\n }\r\n};\r\n\r\ntype SelectorType = 'all' | 'inverse';\r\nexport interface LegendSelectorButtonOption {\r\n type?: SelectorType\r\n title?: string\r\n}\r\n\r\n/**\r\n * T: the type to be extended\r\n * ET: extended type for keys of T\r\n * ST: special type for T to be extended\r\n */\r\ntype ExtendPropertyType = {\r\n [key in keyof T]: key extends keyof ST ? T[key] | ET | ST[key] : T[key] | ET\r\n};\r\n\r\nexport interface LegendItemStyleOption extends ExtendPropertyType {}\r\n\r\nexport interface LegendLineStyleOption extends ExtendPropertyType {\r\n inactiveColor?: ColorString\r\n inactiveWidth?: number\r\n}\r\n\r\nexport interface LegendStyleOption {\r\n /**\r\n * Icon of the legend items.\r\n * @default 'roundRect'\r\n */\r\n icon?: string\r\n\r\n /**\r\n * Color when legend item is not selected\r\n */\r\n inactiveColor?: ColorString\r\n /**\r\n * Border color when legend item is not selected\r\n */\r\n inactiveBorderColor?: ColorString\r\n /**\r\n * Border color when legend item is not selected\r\n */\r\n inactiveBorderWidth?: number | 'auto'\r\n\r\n /**\r\n * Legend label formatter\r\n */\r\n formatter?: string | ((name: string) => string)\r\n\r\n itemStyle?: LegendItemStyleOption\r\n\r\n lineStyle?: LegendLineStyleOption\r\n\r\n textStyle?: LabelOption\r\n\r\n symbolRotate?: number | 'inherit'\r\n\r\n /**\r\n * @deprecated\r\n */\r\n symbolKeepAspect?: boolean\r\n}\r\n\r\ninterface DataItem extends LegendStyleOption {\r\n name?: string\r\n icon?: string\r\n textStyle?: LabelOption\r\n\r\n // TODO: TYPE tooltip\r\n tooltip?: unknown\r\n}\r\n\r\nexport interface LegendTooltipFormatterParams {\r\n componentType: 'legend'\r\n legendIndex: number\r\n name: string\r\n $vars: ['name']\r\n}\r\n\r\nexport interface LegendIconParams {\r\n itemWidth: number\r\n itemHeight: number\r\n /**\r\n * symbolType is from legend.icon, legend.data.icon, or series visual\r\n */\r\n icon: string\r\n iconRotate: number | 'inherit'\r\n symbolKeepAspect: boolean\r\n itemStyle: PathStyleProps\r\n lineStyle: LineStyleProps\r\n}\r\n\r\nexport interface LegendSymbolStyleOption {\r\n itemStyle?: ItemStyleProps\r\n lineStyle?: LineStyleProps\r\n}\r\n\r\nexport interface LegendOption extends ComponentOption, LegendStyleOption,\r\n BoxLayoutOptionMixin, BorderOptionMixin\r\n{\r\n\r\n mainType?: 'legend'\r\n\r\n show?: boolean\r\n\r\n orient?: LayoutOrient\r\n\r\n align?: 'auto' | 'left' | 'right'\r\n\r\n backgroundColor?: ColorString\r\n /**\r\n * Border radius of background rect\r\n * @default 0\r\n */\r\n borderRadius?: number | number[]\r\n\r\n /**\r\n * Padding between legend item and border.\r\n * Support to be a single number or an array.\r\n * @default 5\r\n */\r\n padding?: number | number[]\r\n /**\r\n * Gap between each legend item.\r\n * @default 10\r\n */\r\n itemGap?: number\r\n /**\r\n * Width of legend symbol\r\n */\r\n itemWidth?: number\r\n /**\r\n * Height of legend symbol\r\n */\r\n itemHeight?: number\r\n\r\n selectedMode?: boolean | 'single' | 'multiple'\r\n /**\r\n * selected map of each item. Default to be selected if item is not in the map\r\n */\r\n selected?: Dictionary\r\n\r\n /**\r\n * Buttons for all select or inverse select.\r\n * @example\r\n * selector: [{type: 'all or inverse', title: xxx}]\r\n * selector: true\r\n * selector: ['all', 'inverse']\r\n */\r\n selector?: (LegendSelectorButtonOption | SelectorType)[] | boolean\r\n\r\n selectorLabel?: LabelOption\r\n\r\n emphasis?: {\r\n selectorLabel?: LabelOption\r\n }\r\n\r\n /**\r\n * Position of selector buttons.\r\n */\r\n selectorPosition?: 'auto' | 'start' | 'end'\r\n /**\r\n * Gap between each selector button\r\n */\r\n selectorItemGap?: number\r\n /**\r\n * Gap between selector buttons group and legend main items.\r\n */\r\n selectorButtonGap?: number\r\n\r\n data?: (string | DataItem)[]\r\n\r\n /**\r\n * Tooltip option\r\n */\r\n tooltip?: CommonTooltipOption\r\n\r\n}\r\n\r\nclass LegendModel extends ComponentModel {\r\n static type = 'legend.plain';\r\n type = LegendModel.type;\r\n\r\n static readonly dependencies = ['series'];\r\n\r\n readonly layoutMode = {\r\n type: 'box',\r\n // legend.width/height are maxWidth/maxHeight actually,\r\n // whereas real width/height is calculated by its content.\r\n // (Setting {left: 10, right: 10} does not make sense).\r\n // So consider the case:\r\n // `setOption({legend: {left: 10});`\r\n // then `setOption({legend: {right: 10});`\r\n // The previous `left` should be cleared by setting `ignoreSize`.\r\n ignoreSize: true\r\n } as const;\r\n\r\n\r\n private _data: Model[];\r\n private _availableNames: string[];\r\n\r\n init(option: Ops, parentModel: Model, ecModel: GlobalModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n\r\n option.selected = option.selected || {};\r\n this._updateSelector(option);\r\n }\r\n\r\n mergeOption(option: Ops, ecModel: GlobalModel) {\r\n super.mergeOption(option, ecModel);\r\n this._updateSelector(option);\r\n }\r\n\r\n _updateSelector(option: Ops) {\r\n let selector = option.selector;\r\n const {ecModel} = this;\r\n if (selector === true) {\r\n selector = option.selector = ['all', 'inverse'];\r\n }\r\n if (zrUtil.isArray(selector)) {\r\n zrUtil.each(selector, function (item, index) {\r\n zrUtil.isString(item) && (item = {type: item});\r\n (selector as LegendSelectorButtonOption[])[index] = zrUtil.merge(\r\n item, getDefaultSelectorOptions(ecModel, item.type)\r\n );\r\n });\r\n }\r\n }\r\n\r\n optionUpdated() {\r\n this._updateData(this.ecModel);\r\n\r\n const legendData = this._data;\r\n\r\n // If selectedMode is single, try to select one\r\n if (legendData[0] && this.get('selectedMode') === 'single') {\r\n let hasSelected = false;\r\n // If has any selected in option.selected\r\n for (let i = 0; i < legendData.length; i++) {\r\n const name = legendData[i].get('name');\r\n if (this.isSelected(name)) {\r\n // Force to unselect others\r\n this.select(name);\r\n hasSelected = true;\r\n break;\r\n }\r\n }\r\n // Try select the first if selectedMode is single\r\n !hasSelected && this.select(legendData[0].get('name'));\r\n }\r\n }\r\n\r\n _updateData(ecModel: GlobalModel) {\r\n let potentialData: string[] = [];\r\n let availableNames: string[] = [];\r\n\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n const seriesName = seriesModel.name;\r\n availableNames.push(seriesName);\r\n let isPotential;\r\n\r\n if (seriesModel.legendVisualProvider) {\r\n const provider = seriesModel.legendVisualProvider;\r\n const names = provider.getAllNames();\r\n\r\n if (!ecModel.isSeriesFiltered(seriesModel)) {\r\n availableNames = availableNames.concat(names);\r\n }\r\n\r\n if (names.length) {\r\n potentialData = potentialData.concat(names);\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n }\r\n else {\r\n isPotential = true;\r\n }\r\n\r\n if (isPotential && isNameSpecified(seriesModel)) {\r\n potentialData.push(seriesModel.name);\r\n }\r\n });\r\n\r\n /**\r\n * @type {Array.}\r\n * @private\r\n */\r\n this._availableNames = availableNames;\r\n\r\n // If legend.data is not specified in option, use availableNames as data,\r\n // which is convenient for user preparing option.\r\n const rawData = this.get('data') || potentialData;\r\n\r\n const legendNameMap = zrUtil.createHashMap();\r\n const legendData = zrUtil.map(rawData, function (dataItem) {\r\n // Can be string or number\r\n if (zrUtil.isString(dataItem) || zrUtil.isNumber(dataItem)) {\r\n dataItem = {\r\n name: dataItem as string\r\n };\r\n }\r\n if (legendNameMap.get(dataItem.name)) {\r\n // remove legend name duplicate\r\n return null;\r\n }\r\n legendNameMap.set(dataItem.name, true);\r\n return new Model(dataItem, this, this.ecModel);\r\n }, this);\r\n\r\n /**\r\n * @type {Array.}\r\n * @private\r\n */\r\n this._data = zrUtil.filter(legendData, item => !!item);\r\n }\r\n\r\n getData() {\r\n return this._data;\r\n }\r\n\r\n select(name: string) {\r\n const selected = this.option.selected;\r\n const selectedMode = this.get('selectedMode');\r\n if (selectedMode === 'single') {\r\n const data = this._data;\r\n zrUtil.each(data, function (dataItem) {\r\n selected[dataItem.get('name')] = false;\r\n });\r\n }\r\n selected[name] = true;\r\n }\r\n\r\n unSelect(name: string) {\r\n if (this.get('selectedMode') !== 'single') {\r\n this.option.selected[name] = false;\r\n }\r\n }\r\n\r\n toggleSelected(name: string) {\r\n const selected = this.option.selected;\r\n // Default is true\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n this[selected[name] ? 'unSelect' : 'select'](name);\r\n }\r\n\r\n allSelect() {\r\n const data = this._data;\r\n const selected = this.option.selected;\r\n zrUtil.each(data, function (dataItem) {\r\n selected[dataItem.get('name', true)] = true;\r\n });\r\n }\r\n\r\n inverseSelect() {\r\n const data = this._data;\r\n const selected = this.option.selected;\r\n zrUtil.each(data, function (dataItem) {\r\n const name = dataItem.get('name', true);\r\n // Initially, default value is true\r\n if (!selected.hasOwnProperty(name)) {\r\n selected[name] = true;\r\n }\r\n selected[name] = !selected[name];\r\n });\r\n }\r\n\r\n isSelected(name: string) {\r\n const selected = this.option.selected;\r\n return !(selected.hasOwnProperty(name) && !selected[name])\r\n && zrUtil.indexOf(this._availableNames, name) >= 0;\r\n }\r\n\r\n getOrient(): {index: 0, name: 'horizontal'}\r\n getOrient(): {index: 1, name: 'vertical'}\r\n getOrient() {\r\n return this.get('orient') === 'vertical'\r\n ? {index: 1, name: 'vertical'}\r\n : {index: 0, name: 'horizontal'};\r\n }\r\n\r\n static defaultOption: LegendOption = {\r\n // zlevel: 0,\r\n z: 4,\r\n show: true,\r\n\r\n orient: 'horizontal',\r\n\r\n left: 'center',\r\n // right: 'center',\r\n top: 0,\r\n // bottom: null,\r\n\r\n align: 'auto',\r\n\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc',\r\n borderRadius: 0,\r\n borderWidth: 0,\r\n padding: 5,\r\n itemGap: 10,\r\n itemWidth: 25,\r\n itemHeight: 14,\r\n symbolRotate: 'inherit',\r\n symbolKeepAspect: true,\r\n\r\n inactiveColor: '#ccc',\r\n inactiveBorderColor: '#ccc',\r\n inactiveBorderWidth: 'auto',\r\n\r\n itemStyle: {\r\n color: 'inherit',\r\n opacity: 'inherit',\r\n borderColor: 'inherit',\r\n borderWidth: 'auto',\r\n borderCap: 'inherit',\r\n borderJoin: 'inherit',\r\n borderDashOffset: 'inherit',\r\n borderMiterLimit: 'inherit'\r\n },\r\n\r\n lineStyle: {\r\n width: 'auto',\r\n color: 'inherit',\r\n inactiveColor: '#ccc',\r\n inactiveWidth: 2,\r\n opacity: 'inherit',\r\n type: 'inherit',\r\n cap: 'inherit',\r\n join: 'inherit',\r\n dashOffset: 'inherit',\r\n miterLimit: 'inherit'\r\n },\r\n\r\n textStyle: {\r\n color: '#333'\r\n },\r\n selectedMode: true,\r\n\r\n selector: false,\r\n\r\n selectorLabel: {\r\n show: true,\r\n borderRadius: 10,\r\n padding: [3, 5, 3, 5],\r\n fontSize: 12,\r\n fontFamily: 'sans-serif',\r\n color: '#666',\r\n borderWidth: 1,\r\n borderColor: '#666'\r\n },\r\n\r\n emphasis: {\r\n selectorLabel: {\r\n show: true,\r\n color: '#eee',\r\n backgroundColor: '#666'\r\n }\r\n },\r\n\r\n selectorPosition: 'auto',\r\n\r\n selectorItemGap: 7,\r\n\r\n selectorButtonGap: 10,\r\n\r\n tooltip: {\r\n show: false\r\n }\r\n };\r\n}\r\n\r\nexport default LegendModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { DisplayableState } from 'zrender/src/graphic/Displayable';\r\nimport { PathStyleProps } from 'zrender/src/graphic/Path';\r\nimport { parse, stringify } from 'zrender/src/tool/color';\r\nimport * as graphic from '../../util/graphic';\r\nimport { enableHoverEmphasis } from '../../util/states';\r\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle';\r\nimport { makeBackground } from '../helper/listComponent';\r\nimport * as layoutUtil from '../../util/layout';\r\nimport ComponentView from '../../view/Component';\r\nimport LegendModel, {\r\n LegendItemStyleOption,\r\n LegendLineStyleOption,\r\n LegendOption,\r\n LegendSelectorButtonOption,\r\n LegendIconParams,\r\n LegendTooltipFormatterParams\r\n} from './LegendModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport {\r\n ZRTextAlign,\r\n ZRRectLike,\r\n CommonTooltipOption,\r\n ColorString,\r\n SeriesOption,\r\n SymbolOptionMixin\r\n} from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport { LineStyleProps } from '../../model/mixin/lineStyle';\r\nimport { createSymbol, ECSymbol } from '../../util/symbol';\r\nimport SeriesModel from '../../model/Series';\r\nimport { createOrUpdatePatternFromDecal } from '../../util/decal';\r\nimport { getECData } from '../../util/innerStore';\r\n\r\nconst curry = zrUtil.curry;\r\nconst each = zrUtil.each;\r\nconst Group = graphic.Group;\r\n\r\nclass LegendView extends ComponentView {\r\n static type = 'legend.plain';\r\n type = LegendView.type;\r\n\r\n newlineDisabled = false;\r\n\r\n private _contentGroup: graphic.Group;\r\n\r\n private _backgroundEl: graphic.Rect;\r\n\r\n private _selectorGroup: graphic.Group;\r\n\r\n /**\r\n * If first rendering, `contentGroup.position` is [0, 0], which\r\n * does not make sense and may cause unexpected animation if adopted.\r\n */\r\n private _isFirstRender: boolean;\r\n\r\n init() {\r\n\r\n this.group.add(this._contentGroup = new Group());\r\n this.group.add(this._selectorGroup = new Group());\r\n\r\n this._isFirstRender = true;\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n getContentGroup() {\r\n return this._contentGroup;\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n getSelectorGroup() {\r\n return this._selectorGroup;\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n render(\r\n legendModel: LegendModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI\r\n ) {\r\n const isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n\r\n this.resetInner();\r\n\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n\r\n let itemAlign = legendModel.get('align');\r\n const orient = legendModel.get('orient');\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = (\r\n legendModel.get('left') === 'right'\r\n && orient === 'vertical'\r\n ) ? 'right' : 'left';\r\n }\r\n\r\n // selector has been normalized to an array in model\r\n const selector = legendModel.get('selector', true) as LegendSelectorButtonOption[];\r\n let selectorPosition = legendModel.get('selectorPosition', true);\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n\r\n // Perform layout.\r\n const positionInfo = legendModel.getBoxLayoutParams();\r\n const viewportSize = { width: api.getWidth(), height: api.getHeight() };\r\n const padding = legendModel.get('padding');\r\n\r\n const maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\r\n\r\n const mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition);\r\n\r\n // Place mainGroup, based on the calculated `mainRect`.\r\n const layoutRect = layoutUtil.getLayoutRect(\r\n zrUtil.defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo),\r\n viewportSize,\r\n padding\r\n );\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw();\r\n\r\n // Render background after group is layout.\r\n this.group.add(\r\n this._backgroundEl = makeBackground(mainRect, legendModel)\r\n );\r\n }\r\n\r\n protected resetInner() {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n }\r\n\r\n protected renderInner(\r\n itemAlign: LegendOption['align'],\r\n legendModel: LegendModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n selector: LegendSelectorButtonOption[],\r\n orient: LegendOption['orient'],\r\n selectorPosition: LegendOption['selectorPosition']\r\n ) {\r\n const contentGroup = this.getContentGroup();\r\n const legendDrawnMap = zrUtil.createHashMap();\r\n const selectMode = legendModel.get('selectedMode');\r\n\r\n const excludeSeriesId: string[] = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n\r\n each(legendModel.getData(), function (legendItemModel, dataIndex) {\r\n const name = legendItemModel.get('name');\r\n\r\n // Use empty string or \\n as a newline string\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n const g = new Group();\r\n // @ts-ignore\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n }\r\n\r\n // Representitive series.\r\n const seriesModel = ecModel.getSeriesByName(name)[0] as\r\n SeriesModel;\r\n\r\n if (legendDrawnMap.get(name)) {\r\n // Have been drawn\r\n return;\r\n }\r\n\r\n // Legend to control series.\r\n if (seriesModel) {\r\n const data = seriesModel.getData();\r\n const lineVisualStyle = data.getVisual('legendLineStyle') || {};\r\n const legendIcon = data.getVisual('legendIcon');\r\n\r\n /**\r\n * `data.getVisual('style')` may be the color from the register\r\n * in series. For example, for line series,\r\n */\r\n const style = data.getVisual('style');\r\n\r\n const itemGroup = this._createItem(\r\n seriesModel, name, dataIndex,\r\n legendItemModel, legendModel, itemAlign,\r\n lineVisualStyle, style, legendIcon, selectMode, api\r\n );\r\n\r\n itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId))\r\n .on('legendmouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))\r\n .on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n\r\n if (ecModel.ssr) {\r\n itemGroup.eachChild(child => {\r\n const ecData = getECData(child);\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n ecData.dataIndex = dataIndex;\r\n ecData.ssrType = 'legend';\r\n });\r\n }\r\n\r\n legendDrawnMap.set(name, true);\r\n }\r\n else {\r\n // Legend to control data. In pie and funnel.\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n\r\n // In case multiple series has same data name\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n\r\n if (seriesModel.legendVisualProvider) {\r\n const provider = seriesModel.legendVisualProvider;\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n\r\n const idx = provider.indexOfName(name);\r\n\r\n let style = provider.getItemVisual(idx, 'style') as PathStyleProps;\r\n const legendIcon = provider.getItemVisual(idx, 'legendIcon');\r\n\r\n const colorArr = parse(style.fill as ColorString);\r\n // Color may be set to transparent in visualMap when data is out of range.\r\n // Do not show nothing.\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2;\r\n // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\r\n style = zrUtil.extend(zrUtil.extend({}, style), { fill: stringify(colorArr, 'rgba') });\r\n }\r\n\r\n const itemGroup = this._createItem(\r\n seriesModel, name, dataIndex,\r\n legendItemModel, legendModel, itemAlign,\r\n {}, style, legendIcon, selectMode, api\r\n );\r\n\r\n // FIXME: consider different series has items with the same name.\r\n itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId))\r\n // Should not specify the series name, consider legend controls\r\n // more than one pie series.\r\n .on('legendmouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId))\r\n .on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n\r\n\r\n if (ecModel.ssr) {\r\n itemGroup.eachChild(child => {\r\n const ecData = getECData(child);\r\n ecData.seriesIndex = seriesModel.seriesIndex;\r\n ecData.dataIndex = dataIndex;\r\n ecData.ssrType = 'legend';\r\n });\r\n }\r\n\r\n legendDrawnMap.set(name, true);\r\n }\r\n\r\n }, this);\r\n }\r\n\r\n if (__DEV__) {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(\r\n name + ' series not exists. Legend data should be same with series name or data name.'\r\n );\r\n }\r\n }\r\n }, this);\r\n\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n }\r\n\r\n private _createSelector(\r\n selector: LegendSelectorButtonOption[],\r\n legendModel: LegendModel,\r\n api: ExtensionAPI,\r\n orient: LegendOption['orient'],\r\n selectorPosition: LegendOption['selectorPosition']\r\n ) {\r\n const selectorGroup = this.getSelectorGroup();\r\n\r\n each(selector, function createSelectorButton(selectorItem) {\r\n const type = selectorItem.type;\r\n\r\n const labelText = new graphic.Text({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick() {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect',\r\n legendId: legendModel.id\r\n });\r\n }\r\n });\r\n\r\n selectorGroup.add(labelText);\r\n\r\n const labelModel = legendModel.getModel('selectorLabel');\r\n const emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n\r\n setLabelStyle(\r\n labelText, { normal: labelModel, emphasis: emphasisLabelModel },\r\n {\r\n defaultText: selectorItem.title\r\n }\r\n );\r\n enableHoverEmphasis(labelText);\r\n });\r\n }\r\n\r\n private _createItem(\r\n seriesModel: SeriesModel,\r\n name: string,\r\n dataIndex: number,\r\n legendItemModel: LegendModel['_data'][number],\r\n legendModel: LegendModel,\r\n itemAlign: LegendOption['align'],\r\n lineVisualStyle: LineStyleProps,\r\n itemVisualStyle: PathStyleProps,\r\n legendIcon: string,\r\n selectMode: LegendOption['selectedMode'],\r\n api: ExtensionAPI\r\n ) {\r\n const drawType = seriesModel.visualDrawType;\r\n const itemWidth = legendModel.get('itemWidth');\r\n const itemHeight = legendModel.get('itemHeight');\r\n const isSelected = legendModel.isSelected(name);\r\n\r\n const iconRotate = legendItemModel.get('symbolRotate');\r\n const symbolKeepAspect = legendItemModel.get('symbolKeepAspect');\r\n\r\n const legendIconType = legendItemModel.get('icon');\r\n legendIcon = legendIconType || legendIcon || 'roundRect';\r\n\r\n const style = getLegendStyle(\r\n legendIcon,\r\n legendItemModel,\r\n lineVisualStyle,\r\n itemVisualStyle,\r\n drawType,\r\n isSelected,\r\n api\r\n );\r\n\r\n const itemGroup = new Group();\r\n\r\n const textStyleModel = legendItemModel.getModel('textStyle');\r\n\r\n if (zrUtil.isFunction(seriesModel.getLegendIcon)\r\n && (!legendIconType || legendIconType === 'inherit')\r\n ) {\r\n // Series has specific way to define legend icon\r\n itemGroup.add(seriesModel.getLegendIcon({\r\n itemWidth,\r\n itemHeight,\r\n icon: legendIcon,\r\n iconRotate: iconRotate,\r\n itemStyle: style.itemStyle,\r\n lineStyle: style.lineStyle,\r\n symbolKeepAspect\r\n }));\r\n }\r\n else {\r\n // Use default legend icon policy for most series\r\n const rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol')\r\n ? (iconRotate === 'inherit'\r\n ? seriesModel.getData().getVisual('symbolRotate')\r\n : iconRotate\r\n )\r\n : 0; // No rotation for no icon\r\n itemGroup.add(getDefaultLegendIcon({\r\n itemWidth,\r\n itemHeight,\r\n icon: legendIcon,\r\n iconRotate: rotate,\r\n itemStyle: style.itemStyle,\r\n lineStyle: style.lineStyle,\r\n symbolKeepAspect\r\n }));\r\n }\r\n\r\n const textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n const textAlign = itemAlign as ZRTextAlign;\r\n\r\n const formatter = legendModel.get('formatter');\r\n let content = name;\r\n if (zrUtil.isString(formatter) && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n }\r\n else if (zrUtil.isFunction(formatter)) {\r\n content = formatter(name);\r\n }\r\n\r\n const textColor = isSelected\r\n ? textStyleModel.getTextColor() : legendItemModel.get('inactiveColor');\r\n\r\n itemGroup.add(new graphic.Text({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: textColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n }, { inheritColor: textColor })\r\n }));\r\n\r\n // Add a invisible rect to increase the area of mouse hover\r\n const hitRect = new graphic.Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n style: {\r\n // Cannot use 'invisible' because SVG SSR will miss the node\r\n fill: 'transparent'\r\n }\r\n });\r\n\r\n const tooltipModel =\r\n legendItemModel.getModel('tooltip') as Model>;\r\n if (tooltipModel.get('show')) {\r\n graphic.setTooltipConfig({\r\n el: hitRect,\r\n componentModel: legendModel,\r\n itemName: name,\r\n itemTooltipOption: tooltipModel.option\r\n });\r\n }\r\n itemGroup.add(hitRect);\r\n\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n\r\n hitRect.silent = !selectMode;\r\n\r\n this.getContentGroup().add(itemGroup);\r\n\r\n enableHoverEmphasis(itemGroup);\r\n\r\n // @ts-ignore\r\n itemGroup.__legendDataIndex = dataIndex;\r\n\r\n return itemGroup;\r\n }\r\n\r\n protected layoutInner(\r\n legendModel: LegendModel,\r\n itemAlign: LegendOption['align'],\r\n maxSize: { width: number, height: number },\r\n isFirstRender: boolean,\r\n selector: LegendOption['selector'],\r\n selectorPosition: LegendOption['selectorPosition']\r\n ): ZRRectLike {\r\n const contentGroup = this.getContentGroup();\r\n const selectorGroup = this.getSelectorGroup();\r\n\r\n // Place items in contentGroup.\r\n layoutUtil.box(\r\n legendModel.get('orient'),\r\n contentGroup,\r\n legendModel.get('itemGap'),\r\n maxSize.width,\r\n maxSize.height\r\n );\r\n\r\n const contentRect = contentGroup.getBoundingRect();\r\n const contentPos = [-contentRect.x, -contentRect.y];\r\n\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n\r\n if (selector) {\r\n // Place buttons in selectorGroup\r\n layoutUtil.box(\r\n // Buttons in selectorGroup always layout horizontally\r\n 'horizontal',\r\n selectorGroup,\r\n legendModel.get('selectorItemGap', true)\r\n );\r\n\r\n const selectorRect = selectorGroup.getBoundingRect();\r\n const selectorPos = [-selectorRect.x, -selectorRect.y];\r\n const selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n\r\n const orientIdx = legendModel.getOrient().index;\r\n const wh: 'width' | 'height' = orientIdx === 0 ? 'width' : 'height';\r\n const hw: 'width' | 'height' = orientIdx === 0 ? 'height' : 'width';\r\n const yx: 'x' | 'y' = orientIdx === 0 ? 'y' : 'x';\r\n\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n }\r\n\r\n // Always align selector to content as 'middle'\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n\r\n const mainRect = { x: 0, y: 0 } as ZRRectLike;\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n }\r\n else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n remove() {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n }\r\n\r\n}\r\n\r\nfunction getLegendStyle(\r\n iconType: string,\r\n legendItemModel: LegendModel['_data'][number],\r\n lineVisualStyle: PathStyleProps,\r\n itemVisualStyle: PathStyleProps,\r\n drawType: 'fill' | 'stroke',\r\n isSelected: boolean,\r\n api: ExtensionAPI\r\n) {\r\n /**\r\n * Use series style if is inherit;\r\n * elsewise, use legend style\r\n */\r\n function handleCommonProps(style: PathStyleProps, visualStyle: PathStyleProps) {\r\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\r\n if ((style.lineWidth as any) === 'auto') {\r\n style.lineWidth = (visualStyle.lineWidth > 0) ? 2 : 0;\r\n }\r\n\r\n each(style, (propVal, propName) => {\r\n style[propName] === 'inherit' && ((style as any)[propName] = visualStyle[propName]);\r\n });\r\n }\r\n\r\n // itemStyle\r\n const itemStyleModel = legendItemModel.getModel('itemStyle') as Model;\r\n const itemStyle = itemStyleModel.getItemStyle();\r\n const iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke';\r\n const decalStyle = itemStyleModel.getShallow('decal');\r\n itemStyle.decal = (!decalStyle || decalStyle === 'inherit')\r\n ? itemVisualStyle.decal\r\n : createOrUpdatePatternFromDecal(decalStyle, api);\r\n\r\n if (itemStyle.fill === 'inherit') {\r\n /**\r\n * Series with visualDrawType as 'stroke' should have\r\n * series stroke as legend fill\r\n */\r\n itemStyle.fill = itemVisualStyle[drawType];\r\n }\r\n if (itemStyle.stroke === 'inherit') {\r\n /**\r\n * icon type with \"emptyXXX\" should use fill color\r\n * in visual style\r\n */\r\n itemStyle.stroke = itemVisualStyle[iconBrushType];\r\n }\r\n if ((itemStyle.opacity as any) === 'inherit') {\r\n /**\r\n * Use lineStyle.opacity if drawType is stroke\r\n */\r\n itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\r\n }\r\n handleCommonProps(itemStyle, itemVisualStyle);\r\n\r\n // lineStyle\r\n const legendLineModel = legendItemModel.getModel('lineStyle') as Model;\r\n const lineStyle: LineStyleProps = legendLineModel.getLineStyle();\r\n handleCommonProps(lineStyle, lineVisualStyle);\r\n\r\n // Fix auto color to real color\r\n (itemStyle.fill === 'auto') && (itemStyle.fill = itemVisualStyle.fill);\r\n (itemStyle.stroke === 'auto') && (itemStyle.stroke = itemVisualStyle.fill);\r\n (lineStyle.stroke === 'auto') && (lineStyle.stroke = itemVisualStyle.fill);\r\n\r\n if (!isSelected) {\r\n const borderWidth = legendItemModel.get('inactiveBorderWidth');\r\n /**\r\n * Since stroke is set to be inactiveBorderColor, it may occur that\r\n * there is no border in series but border in legend, so we need to\r\n * use border only when series has border if is set to be auto\r\n */\r\n const visualHasBorder = itemStyle[iconBrushType];\r\n itemStyle.lineWidth = borderWidth === 'auto'\r\n ? (itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0)\r\n : itemStyle.lineWidth;\r\n itemStyle.fill = legendItemModel.get('inactiveColor');\r\n itemStyle.stroke = legendItemModel.get('inactiveBorderColor');\r\n lineStyle.stroke = legendLineModel.get('inactiveColor');\r\n lineStyle.lineWidth = legendLineModel.get('inactiveWidth');\r\n }\r\n return { itemStyle, lineStyle };\r\n}\r\n\r\nfunction getDefaultLegendIcon(opt: LegendIconParams): ECSymbol {\r\n const symboType = opt.icon || 'roundRect';\r\n const icon = createSymbol(\r\n symboType,\r\n 0,\r\n 0,\r\n opt.itemWidth,\r\n opt.itemHeight,\r\n opt.itemStyle.fill,\r\n opt.symbolKeepAspect\r\n );\r\n\r\n icon.setStyle(opt.itemStyle);\r\n\r\n icon.rotation = (opt.iconRotate as number || 0) * Math.PI / 180;\r\n icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\r\n\r\n if (symboType.indexOf('empty') > -1) {\r\n icon.style.stroke = icon.style.fill;\r\n icon.style.fill = '#fff';\r\n icon.style.lineWidth = 2;\r\n }\r\n\r\n return icon;\r\n}\r\n\r\nfunction dispatchSelectAction(\r\n seriesName: string,\r\n dataName: string,\r\n api: ExtensionAPI,\r\n excludeSeriesId: string[]\r\n) {\r\n // downplay before unselect\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n });\r\n // highlight after select\r\n // TODO highlight immediately may cause animation loss.\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n}\r\n\r\nfunction isUseHoverLayer(api: ExtensionAPI) {\r\n const list = api.getZr().storage.getDisplayList();\r\n let emphasisState: DisplayableState;\r\n let i = 0;\r\n const len = list.length;\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n return emphasisState && emphasisState.hoverLayer;\r\n}\r\n\r\nfunction dispatchHighlightAction(\r\n seriesName: string,\r\n dataName: string,\r\n api: ExtensionAPI,\r\n excludeSeriesId: string[]\r\n) {\r\n // If element hover will move to a hoverLayer.\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\n\r\nfunction dispatchDownplayAction(\r\n seriesName: string,\r\n dataName: string,\r\n api: ExtensionAPI,\r\n excludeSeriesId: string[]\r\n) {\r\n // If element hover will move to a hoverLayer.\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\n\r\nexport default LegendView;\r\n", "import SeriesModel from '../../model/Series';\r\nimport GlobalModel from '../../model/Global';\r\nimport LegendModel from './LegendModel';\r\n\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nexport default function legendFilter(ecModel: GlobalModel) {\r\n\r\n const legendModels = ecModel.findComponents({\r\n mainType: 'legend'\r\n }) as LegendModel[];\r\n if (legendModels && legendModels.length) {\r\n ecModel.filterSeries(function (series: SeriesModel) {\r\n // If in any legend component the status is not selected.\r\n // Because in legend series is assumed selected when it is not in the legend data.\r\n for (let i = 0; i < legendModels.length; i++) {\r\n if (!legendModels[i].isSelected(series.name)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {curry, each, hasOwn} from 'zrender/src/core/util';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport { Payload } from '../../util/types';\r\nimport type GlobalModel from '../../model/Global';\r\nimport type LegendModel from './LegendModel';\r\n\r\ntype LegendSelectMethodNames = 'select' | 'unSelect' | 'toggleSelected' | 'allSelect' | 'inverseSelect';\r\n\r\nfunction legendSelectActionHandler(methodName: LegendSelectMethodNames, payload: Payload, ecModel: GlobalModel) {\r\n const isAllSelect = methodName === 'allSelect' || methodName === 'inverseSelect';\r\n const selectedMap: Record = {};\r\n\r\n const actionLegendIndices: number[] = [];\r\n ecModel.eachComponent({ mainType: 'legend', query: payload }, function (legendModel: LegendModel) {\r\n if (isAllSelect) {\r\n legendModel[methodName]();\r\n }\r\n else {\r\n legendModel[methodName](payload.name);\r\n }\r\n\r\n makeSelectedMap(legendModel, selectedMap);\r\n\r\n actionLegendIndices.push(legendModel.componentIndex);\r\n });\r\n\r\n const allSelectedMap: Record = {};\r\n\r\n // make selectedMap from all legend components\r\n ecModel.eachComponent('legend', function (legendModel: LegendModel) {\r\n each(selectedMap, function (isSelected, name) {\r\n // Force other legend has same selected status\r\n // Or the first is toggled to true and other are toggled to false\r\n // In the case one legend has some item unSelected in option. And if other legend\r\n // doesn't has the item, they will assume it is selected.\r\n legendModel[isSelected ? 'select' : 'unSelect'](name);\r\n });\r\n\r\n makeSelectedMap(legendModel, allSelectedMap);\r\n });\r\n\r\n // Return the event explicitly\r\n return isAllSelect\r\n ? {\r\n selected: allSelectedMap,\r\n // return legendIndex array to tell the developers which legends are allSelect / inverseSelect\r\n legendIndex: actionLegendIndices\r\n }\r\n : {\r\n name: payload.name,\r\n selected: allSelectedMap\r\n };\r\n}\r\n\r\nfunction makeSelectedMap(legendModel: LegendModel, out?: Record) {\r\n const selectedMap: Record = out || {};\r\n each(legendModel.getData(), function (model) {\r\n const name = model.get('name');\r\n // Wrap element\r\n if (name === '\\n' || name === '') {\r\n return;\r\n }\r\n const isItemSelected = legendModel.isSelected(name);\r\n if (hasOwn(selectedMap, name)) {\r\n // Unselected if any legend is unselected\r\n selectedMap[name] = selectedMap[name] && isItemSelected;\r\n }\r\n else {\r\n selectedMap[name] = isItemSelected;\r\n }\r\n });\r\n return selectedMap;\r\n}\r\n\r\nexport function installLegendAction(registers: EChartsExtensionInstallRegisters) {\r\n /**\r\n * @event legendToggleSelect\r\n * @type {Object}\r\n * @property {string} type 'legendToggleSelect'\r\n * @property {string} [from]\r\n * @property {string} name Series name or data item name\r\n */\r\n registers.registerAction(\r\n 'legendToggleSelect', 'legendselectchanged',\r\n curry(legendSelectActionHandler, 'toggleSelected')\r\n );\r\n\r\n registers.registerAction(\r\n 'legendAllSelect', 'legendselectall',\r\n curry(legendSelectActionHandler, 'allSelect')\r\n );\r\n\r\n registers.registerAction(\r\n 'legendInverseSelect', 'legendinverseselect',\r\n curry(legendSelectActionHandler, 'inverseSelect')\r\n );\r\n\r\n /**\r\n * @event legendSelect\r\n * @type {Object}\r\n * @property {string} type 'legendSelect'\r\n * @property {string} name Series name or data item name\r\n */\r\n registers.registerAction(\r\n 'legendSelect', 'legendselected',\r\n curry(legendSelectActionHandler, 'select')\r\n );\r\n\r\n /**\r\n * @event legendUnSelect\r\n * @type {Object}\r\n * @property {string} type 'legendUnSelect'\r\n * @property {string} name Series name or data item name\r\n */\r\n registers.registerAction(\r\n 'legendUnSelect', 'legendunselected',\r\n curry(legendSelectActionHandler, 'unSelect')\r\n );\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport LegendModel from './LegendModel';\r\nimport LegendView from './LegendView';\r\nimport legendFilter from './legendFilter';\r\nimport { installLegendAction } from './legendAction';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(LegendModel);\r\n registers.registerComponentView(LegendView);\r\n\r\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\r\n registers.registerSubTypeDefaulter('legend', function () {\r\n return 'plain';\r\n });\r\n\r\n installLegendAction(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport LegendModel, {LegendOption} from './LegendModel';\r\nimport {\r\n mergeLayoutParam,\r\n getLayoutParams\r\n} from '../../util/layout';\r\nimport { ZRColor, LabelOption } from '../../util/types';\r\nimport Model from '../../model/Model';\r\nimport GlobalModel from '../../model/Global';\r\nimport { inheritDefaultOption } from '../../util/component';\r\n\r\nexport interface ScrollableLegendOption extends LegendOption {\r\n scrollDataIndex?: number\r\n /**\r\n * Gap between each page button\r\n */\r\n pageButtonItemGap?: number\r\n /**\r\n * Gap between page buttons group and legend items.\r\n */\r\n pageButtonGap?: number\r\n pageButtonPosition?: 'start' | 'end'\r\n\r\n pageFormatter?: string | ((param: {current: number, total: number}) => string)\r\n pageIcons?: {\r\n horizontal?: string[]\r\n vertical?: string[]\r\n }\r\n pageIconColor?: ZRColor\r\n pageIconInactiveColor?: ZRColor\r\n pageIconSize?: number\r\n pageTextStyle?: LabelOption\r\n\r\n animationDurationUpdate?: number\r\n}\r\n\r\nclass ScrollableLegendModel extends LegendModel {\r\n\r\n static type = 'legend.scroll' as const;\r\n type = ScrollableLegendModel.type;\r\n\r\n /**\r\n * @param {number} scrollDataIndex\r\n */\r\n setScrollDataIndex(scrollDataIndex: number) {\r\n this.option.scrollDataIndex = scrollDataIndex;\r\n }\r\n\r\n init(\r\n option: ScrollableLegendOption,\r\n parentModel: Model,\r\n ecModel: GlobalModel\r\n ) {\r\n const inputPositionParams = getLayoutParams(option);\r\n\r\n super.init(option, parentModel, ecModel);\r\n\r\n mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n mergeOption(option: ScrollableLegendOption, ecModel: GlobalModel) {\r\n super.mergeOption(option, ecModel);\r\n\r\n mergeAndNormalizeLayoutParams(this, this.option, option);\r\n }\r\n\r\n static defaultOption: ScrollableLegendOption = inheritDefaultOption(LegendModel.defaultOption, {\r\n scrollDataIndex: 0,\r\n pageButtonItemGap: 5,\r\n pageButtonGap: null,\r\n pageButtonPosition: 'end', // 'start' or 'end'\r\n pageFormatter: '{current}/{total}', // If null/undefined, do not show page.\r\n pageIcons: {\r\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\r\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\r\n },\r\n pageIconColor: '#2f4554',\r\n pageIconInactiveColor: '#aaa',\r\n pageIconSize: 15, // Can be [10, 3], which represents [width, height]\r\n pageTextStyle: {\r\n color: '#333'\r\n },\r\n\r\n animationDurationUpdate: 800\r\n });\r\n};\r\n\r\n// Do not `ignoreSize` to enable setting {left: 10, right: 10}.\r\nfunction mergeAndNormalizeLayoutParams(\r\n legendModel: ScrollableLegendModel,\r\n target: ScrollableLegendOption,\r\n raw: ScrollableLegendOption\r\n) {\r\n const orient = legendModel.getOrient();\r\n const ignoreSize = [1, 1];\r\n ignoreSize[orient.index] = 0;\r\n mergeLayoutParam(target, raw, {\r\n type: 'box', ignoreSize: !!ignoreSize\r\n });\r\n}\r\n\r\nexport default ScrollableLegendModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * Separate legend and scrollable legend to reduce package size.\r\n */\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as layoutUtil from '../../util/layout';\r\nimport LegendView from './LegendView';\r\nimport { LegendSelectorButtonOption } from './LegendModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport GlobalModel from '../../model/Global';\r\nimport ScrollableLegendModel, {ScrollableLegendOption} from './ScrollableLegendModel';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport Element from 'zrender/src/Element';\r\nimport { ZRRectLike } from '../../util/types';\r\n\r\nconst Group = graphic.Group;\r\n\r\nconst WH = ['width', 'height'] as const;\r\nconst XY = ['x', 'y'] as const;\r\n\r\ninterface PageInfo {\r\n contentPosition: number[]\r\n pageCount: number\r\n pageIndex: number\r\n pagePrevDataIndex: number\r\n pageNextDataIndex: number\r\n}\r\n\r\ninterface ItemInfo {\r\n /**\r\n * Start\r\n */\r\n s: number\r\n /**\r\n * End\r\n */\r\n e: number\r\n /**\r\n * Index\r\n */\r\n i: number\r\n}\r\n\r\ntype LegendGroup = graphic.Group & {\r\n __rectSize: number\r\n};\r\n\r\ntype LegendItemElement = Element & {\r\n __legendDataIndex: number\r\n};\r\n\r\nclass ScrollableLegendView extends LegendView {\r\n\r\n static type = 'legend.scroll' as const;\r\n type = ScrollableLegendView.type;\r\n\r\n newlineDisabled = true;\r\n\r\n private _containerGroup: LegendGroup;\r\n private _controllerGroup: graphic.Group;\r\n\r\n private _currentIndex: number = 0;\r\n\r\n private _showController: boolean;\r\n\r\n init() {\r\n\r\n super.init();\r\n\r\n this.group.add(this._containerGroup = new Group() as LegendGroup);\r\n this._containerGroup.add(this.getContentGroup());\r\n\r\n this.group.add(this._controllerGroup = new Group());\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n resetInner() {\r\n super.resetInner();\r\n\r\n this._controllerGroup.removeAll();\r\n this._containerGroup.removeClipPath();\r\n this._containerGroup.__rectSize = null;\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n renderInner(\r\n itemAlign: ScrollableLegendOption['align'],\r\n legendModel: ScrollableLegendModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n selector: LegendSelectorButtonOption[],\r\n orient: ScrollableLegendOption['orient'],\r\n selectorPosition: ScrollableLegendOption['selectorPosition']\r\n ) {\r\n const self = this;\r\n\r\n // Render content items.\r\n super.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\r\n\r\n const controllerGroup = this._controllerGroup;\r\n\r\n // FIXME: support be 'auto' adapt to size number text length,\r\n // e.g., '3/12345' should not overlap with the control arrow button.\r\n const pageIconSize = legendModel.get('pageIconSize', true);\r\n const pageIconSizeArr: number[] = zrUtil.isArray(pageIconSize)\r\n ? pageIconSize : [pageIconSize, pageIconSize];\r\n\r\n createPageButton('pagePrev', 0);\r\n\r\n const pageTextStyleModel = legendModel.getModel('pageTextStyle');\r\n controllerGroup.add(new graphic.Text({\r\n name: 'pageText',\r\n style: {\r\n // Placeholder to calculate a proper layout.\r\n text: 'xx/xx',\r\n fill: pageTextStyleModel.getTextColor(),\r\n font: pageTextStyleModel.getFont(),\r\n verticalAlign: 'middle',\r\n align: 'center'\r\n },\r\n silent: true\r\n }));\r\n\r\n createPageButton('pageNext', 1);\r\n\r\n function createPageButton(name: string, iconIdx: number) {\r\n const pageDataIndexName = (name + 'DataIndex') as 'pagePrevDataIndex' | 'pageNextDataIndex';\r\n const icon = graphic.createIcon(\r\n legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx],\r\n {\r\n // Buttons will be created in each render, so we do not need\r\n // to worry about avoiding using legendModel kept in scope.\r\n onclick: zrUtil.bind(\r\n self._pageGo, self, pageDataIndexName, legendModel, api\r\n )\r\n },\r\n {\r\n x: -pageIconSizeArr[0] / 2,\r\n y: -pageIconSizeArr[1] / 2,\r\n width: pageIconSizeArr[0],\r\n height: pageIconSizeArr[1]\r\n }\r\n );\r\n icon.name = name;\r\n controllerGroup.add(icon);\r\n }\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n layoutInner(\r\n legendModel: ScrollableLegendModel,\r\n itemAlign: ScrollableLegendOption['align'],\r\n maxSize: { width: number, height: number },\r\n isFirstRender: boolean,\r\n selector: LegendSelectorButtonOption[],\r\n selectorPosition: ScrollableLegendOption['selectorPosition']\r\n ) {\r\n const selectorGroup = this.getSelectorGroup();\r\n\r\n const orientIdx = legendModel.getOrient().index;\r\n const wh = WH[orientIdx];\r\n const xy = XY[orientIdx];\r\n const hw = WH[1 - orientIdx];\r\n const yx = XY[1 - orientIdx];\r\n\r\n selector && layoutUtil.box(\r\n // Buttons in selectorGroup always layout horizontally\r\n 'horizontal',\r\n selectorGroup,\r\n legendModel.get('selectorItemGap', true)\r\n );\r\n\r\n const selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n const selectorRect = selectorGroup.getBoundingRect();\r\n const selectorPos = [-selectorRect.x, -selectorRect.y];\r\n\r\n const processMaxSize = zrUtil.clone(maxSize);\r\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\r\n\r\n const mainRect = this._layoutContentAndController(legendModel, isFirstRender,\r\n processMaxSize, orientIdx, wh, hw, yx, xy\r\n );\r\n\r\n if (selector) {\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\r\n }\r\n else {\r\n const offset = selectorRect[wh] + selectorButtonGap;\r\n selectorPos[orientIdx] -= offset;\r\n mainRect[xy] -= offset;\r\n }\r\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\r\n\r\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\r\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n selectorGroup.markRedraw();\r\n }\r\n\r\n return mainRect;\r\n }\r\n\r\n _layoutContentAndController(\r\n legendModel: ScrollableLegendModel,\r\n isFirstRender: boolean,\r\n maxSize: { width: number, height: number },\r\n orientIdx: 0 | 1,\r\n wh: 'width' | 'height',\r\n hw: 'width' | 'height',\r\n yx: 'x' | 'y',\r\n xy: 'y' | 'x'\r\n ) {\r\n const contentGroup = this.getContentGroup();\r\n const containerGroup = this._containerGroup;\r\n const controllerGroup = this._controllerGroup;\r\n\r\n // Place items in contentGroup.\r\n layoutUtil.box(\r\n legendModel.get('orient'),\r\n contentGroup,\r\n legendModel.get('itemGap'),\r\n !orientIdx ? null : maxSize.width,\r\n orientIdx ? null : maxSize.height\r\n );\r\n\r\n layoutUtil.box(\r\n // Buttons in controller are layout always horizontally.\r\n 'horizontal',\r\n controllerGroup,\r\n legendModel.get('pageButtonItemGap', true)\r\n );\r\n\r\n const contentRect = contentGroup.getBoundingRect();\r\n const controllerRect = controllerGroup.getBoundingRect();\r\n const showController = this._showController = contentRect[wh] > maxSize[wh];\r\n\r\n // In case that the inner elements of contentGroup layout do not based on [0, 0]\r\n const contentPos = [-contentRect.x, -contentRect.y];\r\n // Remain contentPos when scroll animation perfroming.\r\n // If first rendering, `contentGroup.position` is [0, 0], which\r\n // does not make sense and may cause unexepcted animation if adopted.\r\n if (!isFirstRender) {\r\n contentPos[orientIdx] = contentGroup[xy];\r\n }\r\n\r\n // Layout container group based on 0.\r\n const containerPos = [0, 0];\r\n const controllerPos = [-controllerRect.x, -controllerRect.y];\r\n const pageButtonGap = zrUtil.retrieve2(\r\n legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true)\r\n );\r\n\r\n // Place containerGroup and controllerGroup and contentGroup.\r\n if (showController) {\r\n const pageButtonPosition = legendModel.get('pageButtonPosition', true);\r\n // controller is on the right / bottom.\r\n if (pageButtonPosition === 'end') {\r\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\r\n }\r\n // controller is on the left / top.\r\n else {\r\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\r\n }\r\n }\r\n\r\n // Always align controller to content as 'middle'.\r\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\r\n\r\n contentGroup.setPosition(contentPos);\r\n containerGroup.setPosition(containerPos);\r\n controllerGroup.setPosition(controllerPos);\r\n\r\n // Calculate `mainRect` and set `clipPath`.\r\n // mainRect should not be calculated by `this.group.getBoundingRect()`\r\n // for sake of the overflow.\r\n const mainRect = {x: 0, y: 0} as ZRRectLike;\r\n\r\n // Consider content may be overflow (should be clipped).\r\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);\r\n\r\n // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\r\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\r\n\r\n containerGroup.__rectSize = maxSize[wh];\r\n if (showController) {\r\n const clipShape = {x: 0, y: 0} as graphic.Rect['shape'];\r\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\r\n clipShape[hw] = mainRect[hw];\r\n containerGroup.setClipPath(new graphic.Rect({shape: clipShape}));\r\n // Consider content may be larger than container, container rect\r\n // can not be obtained from `containerGroup.getBoundingRect()`.\r\n containerGroup.__rectSize = clipShape[wh];\r\n }\r\n else {\r\n // Do not remove or ignore controller. Keep them set as placeholders.\r\n controllerGroup.eachChild(function (child: Displayable) {\r\n child.attr({\r\n invisible: true,\r\n silent: true\r\n });\r\n });\r\n }\r\n\r\n // Content translate animation.\r\n const pageInfo = this._getPageInfo(legendModel);\r\n pageInfo.pageIndex != null && graphic.updateProps(\r\n contentGroup,\r\n { x: pageInfo.contentPosition[0], y: pageInfo.contentPosition[1] },\r\n // When switch from \"show controller\" to \"not show controller\", view should be\r\n // updated immediately without animation, otherwise causes weird effect.\r\n showController ? legendModel : null\r\n );\r\n\r\n this._updatePageInfoView(legendModel, pageInfo);\r\n\r\n return mainRect;\r\n }\r\n\r\n _pageGo(\r\n to: 'pagePrevDataIndex' | 'pageNextDataIndex',\r\n legendModel: ScrollableLegendModel,\r\n api: ExtensionAPI\r\n ) {\r\n const scrollDataIndex = this._getPageInfo(legendModel)[to];\r\n\r\n scrollDataIndex != null && api.dispatchAction({\r\n type: 'legendScroll',\r\n scrollDataIndex: scrollDataIndex,\r\n legendId: legendModel.id\r\n });\r\n }\r\n\r\n _updatePageInfoView(\r\n legendModel: ScrollableLegendModel,\r\n pageInfo: PageInfo\r\n ) {\r\n const controllerGroup = this._controllerGroup;\r\n\r\n zrUtil.each(['pagePrev', 'pageNext'], function (name) {\r\n const key = (name + 'DataIndex') as'pagePrevDataIndex' | 'pageNextDataIndex';\r\n const canJump = pageInfo[key] != null;\r\n const icon = controllerGroup.childOfName(name) as graphic.Path;\r\n if (icon) {\r\n icon.setStyle(\r\n 'fill',\r\n canJump\r\n ? legendModel.get('pageIconColor', true)\r\n : legendModel.get('pageIconInactiveColor', true)\r\n );\r\n icon.cursor = canJump ? 'pointer' : 'default';\r\n }\r\n });\r\n\r\n const pageText = controllerGroup.childOfName('pageText') as graphic.Text;\r\n const pageFormatter = legendModel.get('pageFormatter');\r\n const pageIndex = pageInfo.pageIndex;\r\n const current = pageIndex != null ? pageIndex + 1 : 0;\r\n const total = pageInfo.pageCount;\r\n\r\n pageText && pageFormatter && pageText.setStyle(\r\n 'text',\r\n zrUtil.isString(pageFormatter)\r\n ? pageFormatter.replace('{current}', current == null ? '' : current + '')\r\n .replace('{total}', total == null ? '' : total + '')\r\n : pageFormatter({current: current, total: total})\r\n );\r\n }\r\n\r\n /**\r\n * contentPosition: Array., null when data item not found.\r\n * pageIndex: number, null when data item not found.\r\n * pageCount: number, always be a number, can be 0.\r\n * pagePrevDataIndex: number, null when no previous page.\r\n * pageNextDataIndex: number, null when no next page.\r\n * }\r\n */\r\n _getPageInfo(legendModel: ScrollableLegendModel): PageInfo {\r\n const scrollDataIndex = legendModel.get('scrollDataIndex', true);\r\n const contentGroup = this.getContentGroup();\r\n const containerRectSize = this._containerGroup.__rectSize;\r\n const orientIdx = legendModel.getOrient().index;\r\n const wh = WH[orientIdx];\r\n const xy = XY[orientIdx];\r\n\r\n const targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\r\n const children = contentGroup.children();\r\n const targetItem = children[targetItemIndex];\r\n const itemCount = children.length;\r\n const pCount = !itemCount ? 0 : 1;\r\n\r\n const result: PageInfo = {\r\n contentPosition: [contentGroup.x, contentGroup.y],\r\n pageCount: pCount,\r\n pageIndex: pCount - 1,\r\n pagePrevDataIndex: null,\r\n pageNextDataIndex: null\r\n };\r\n\r\n if (!targetItem) {\r\n return result;\r\n }\r\n\r\n const targetItemInfo = getItemInfo(targetItem);\r\n result.contentPosition[orientIdx] = -targetItemInfo.s;\r\n\r\n // Strategy:\r\n // (1) Always align based on the left/top most item.\r\n // (2) It is user-friendly that the last item shown in the\r\n // current window is shown at the begining of next window.\r\n // Otherwise if half of the last item is cut by the window,\r\n // it will have no chance to display entirely.\r\n // (3) Consider that item size probably be different, we\r\n // have calculate pageIndex by size rather than item index,\r\n // and we can not get page index directly by division.\r\n // (4) The window is to narrow to contain more than\r\n // one item, we should make sure that the page can be fliped.\r\n\r\n for (let i = targetItemIndex + 1,\r\n winStartItemInfo = targetItemInfo,\r\n winEndItemInfo = targetItemInfo,\r\n currItemInfo = null;\r\n i <= itemCount;\r\n ++i\r\n ) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if (\r\n // Half of the last item is out of the window.\r\n (!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize)\r\n // If the current item does not intersect with the window, the new page\r\n // can be started at the current item or the last item.\r\n || (currItemInfo && !intersect(currItemInfo, winStartItemInfo.s))\r\n ) {\r\n if (winEndItemInfo.i > winStartItemInfo.i) {\r\n winStartItemInfo = winEndItemInfo;\r\n }\r\n else { // e.g., when page size is smaller than item size.\r\n winStartItemInfo = currItemInfo;\r\n }\r\n if (winStartItemInfo) {\r\n if (result.pageNextDataIndex == null) {\r\n result.pageNextDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n }\r\n }\r\n winEndItemInfo = currItemInfo;\r\n }\r\n\r\n for (let i = targetItemIndex - 1,\r\n winStartItemInfo = targetItemInfo,\r\n winEndItemInfo = targetItemInfo,\r\n currItemInfo = null;\r\n i >= -1;\r\n --i\r\n ) {\r\n currItemInfo = getItemInfo(children[i]);\r\n if (\r\n // If the the end item does not intersect with the window started\r\n // from the current item, a page can be settled.\r\n (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s))\r\n // e.g., when page size is smaller than item size.\r\n && winStartItemInfo.i < winEndItemInfo.i\r\n ) {\r\n winEndItemInfo = winStartItemInfo;\r\n if (result.pagePrevDataIndex == null) {\r\n result.pagePrevDataIndex = winStartItemInfo.i;\r\n }\r\n ++result.pageCount;\r\n ++result.pageIndex;\r\n }\r\n winStartItemInfo = currItemInfo;\r\n }\r\n\r\n return result;\r\n\r\n function getItemInfo(el: Element): ItemInfo {\r\n if (el) {\r\n const itemRect = el.getBoundingRect();\r\n const start = itemRect[xy] + el[xy];\r\n return {\r\n s: start,\r\n e: start + itemRect[wh],\r\n i: (el as LegendItemElement).__legendDataIndex\r\n };\r\n }\r\n }\r\n\r\n function intersect(itemInfo: ItemInfo, winStart: number) {\r\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\r\n }\r\n }\r\n\r\n _findTargetItemIndex(targetDataIndex: number) {\r\n if (!this._showController) {\r\n return 0;\r\n }\r\n\r\n let index;\r\n const contentGroup = this.getContentGroup();\r\n let defaultIndex: number;\r\n\r\n contentGroup.eachChild(function (child, idx) {\r\n const legendDataIdx = (child as LegendItemElement).__legendDataIndex;\r\n // FIXME\r\n // If the given targetDataIndex (from model) is illegal,\r\n // we use defaultIndex. But the index on the legend model and\r\n // action payload is still illegal. That case will not be\r\n // changed until some scenario requires.\r\n if (defaultIndex == null && legendDataIdx != null) {\r\n defaultIndex = idx;\r\n }\r\n if (legendDataIdx === targetDataIndex) {\r\n index = idx;\r\n }\r\n });\r\n\r\n return index != null ? index : defaultIndex;\r\n }\r\n}\r\n\r\nexport default ScrollableLegendView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport ScrollableLegendModel from './ScrollableLegendModel';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\nexport default function installScrollableLegendAction(registers: EChartsExtensionInstallRegisters) {\r\n /**\r\n * @event legendScroll\r\n * @type {Object}\r\n * @property {string} type 'legendScroll'\r\n * @property {string} scrollDataIndex\r\n */\r\n registers.registerAction(\r\n 'legendScroll', 'legendscroll',\r\n function (payload, ecModel) {\r\n const scrollDataIndex = payload.scrollDataIndex;\r\n\r\n scrollDataIndex != null && ecModel.eachComponent(\r\n {mainType: 'legend', subType: 'scroll', query: payload},\r\n function (legendModel: ScrollableLegendModel) {\r\n legendModel.setScrollDataIndex(scrollDataIndex);\r\n }\r\n );\r\n }\r\n );\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport {install as installLegendPlain} from './installLegendPlain';\r\nimport ScrollableLegendModel from './ScrollableLegendModel';\r\nimport ScrollableLegendView from './ScrollableLegendView';\r\nimport installScrollableLegendAction from './scrollableLegendAction';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installLegendPlain);\r\n\r\n registers.registerComponentModel(ScrollableLegendModel);\r\n registers.registerComponentView(ScrollableLegendView);\r\n\r\n installScrollableLegendAction(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport {install as installLegendPlain} from './installLegendPlain';\r\nimport {install as installLegendScroll} from './installLegendScroll';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installLegendPlain);\r\n use(installLegendScroll);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport DataZoomModel, {DataZoomOption} from './DataZoomModel';\r\nimport { inheritDefaultOption } from '../../util/component';\r\n\r\nexport interface InsideDataZoomOption extends DataZoomOption {\r\n\r\n /**\r\n * Whether disable this inside zoom.\r\n */\r\n disabled?: boolean\r\n\r\n /**\r\n * Whether disable zoom but only pan.\r\n */\r\n zoomLock?: boolean\r\n\r\n zoomOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt'\r\n\r\n moveOnMouseMove?: boolean | 'shift' | 'ctrl' | 'alt'\r\n\r\n moveOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt'\r\n\r\n preventDefaultMouseMove?: boolean\r\n\r\n /**\r\n * Inside dataZoom don't support textStyle\r\n */\r\n textStyle?: never\r\n}\r\n\r\n\r\nclass InsideZoomModel extends DataZoomModel {\r\n static readonly type = 'dataZoom.inside';\r\n type = InsideZoomModel.type;\r\n\r\n static defaultOption: InsideDataZoomOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n disabled: false,\r\n zoomLock: false,\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: false,\r\n preventDefaultMouseMove: true\r\n });\r\n}\r\n\r\nexport default InsideZoomModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Only create one roam controller for each coordinate system.\r\n// one roam controller might be refered by two inside data zoom\r\n// components (for example, one for x and one for y). When user\r\n// pan or zoom, only dispatch one action for those data zoom\r\n// components.\r\n\r\nimport RoamController, { RoamType } from '../../component/helper/RoamController';\r\nimport * as throttleUtil from '../../util/throttle';\r\nimport { makeInner } from '../../util/model';\r\nimport { Dictionary, ZRElementEvent } from '../../util/types';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport InsideZoomModel from './InsideZoomModel';\r\nimport { each, curry, Curry1, HashMap, createHashMap } from 'zrender/src/core/util';\r\nimport {\r\n DataZoomPayloadBatchItem, collectReferCoordSysModelInfo,\r\n DataZoomCoordSysMainType, DataZoomReferCoordSysInfo\r\n} from './helper';\r\nimport GlobalModel from '../../model/Global';\r\nimport { CoordinateSystemHostModel } from '../../coord/CoordinateSystem';\r\nimport { DataZoomGetRangeHandlers } from './InsideZoomView';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\n\r\ninterface DataZoomInfo {\r\n getRange: DataZoomGetRangeHandlers;\r\n model: InsideZoomModel;\r\n dzReferCoordSysInfo: DataZoomReferCoordSysInfo\r\n}\r\n\r\ninterface CoordSysRecord {\r\n // key: dataZoom.uid\r\n dataZoomInfoMap: HashMap;\r\n model: CoordinateSystemHostModel,\r\n // count: number\r\n // coordId: string\r\n controller: RoamController;\r\n containsPoint: (e: ZRElementEvent, x: number, y: number) => boolean;\r\n dispatchAction: Curry1;\r\n}\r\n\r\n\r\nconst inner = makeInner<{\r\n // key: coordSysModel.uid\r\n coordSysRecordMap: HashMap;\r\n}, ExtensionAPI>();\r\n\r\nexport function setViewInfoToCoordSysRecord(\r\n api: ExtensionAPI,\r\n dataZoomModel: InsideZoomModel,\r\n getRange: DataZoomGetRangeHandlers\r\n): void {\r\n inner(api).coordSysRecordMap.each(function (coordSysRecord) {\r\n const dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\r\n if (dzInfo) {\r\n dzInfo.getRange = getRange;\r\n }\r\n });\r\n}\r\n\r\nexport function disposeCoordSysRecordIfNeeded(api: ExtensionAPI, dataZoomModel: InsideZoomModel) {\r\n const coordSysRecordMap = inner(api).coordSysRecordMap;\r\n const coordSysKeyArr = coordSysRecordMap.keys();\r\n for (let i = 0; i < coordSysKeyArr.length; i++) {\r\n const coordSysKey = coordSysKeyArr[i];\r\n const coordSysRecord = coordSysRecordMap.get(coordSysKey);\r\n const dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n if (dataZoomInfoMap) {\r\n const dzUid = dataZoomModel.uid;\r\n const dzInfo = dataZoomInfoMap.get(dzUid);\r\n if (dzInfo) {\r\n dataZoomInfoMap.removeKey(dzUid);\r\n if (!dataZoomInfoMap.keys().length) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction disposeCoordSysRecord(\r\n coordSysRecordMap: HashMap,\r\n coordSysRecord: CoordSysRecord\r\n): void {\r\n if (coordSysRecord) {\r\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\r\n const controller = coordSysRecord.controller;\r\n controller && controller.dispose();\r\n }\r\n}\r\n\r\nfunction createCoordSysRecord(api: ExtensionAPI, coordSysModel: CoordinateSystemHostModel): CoordSysRecord {\r\n // These init props will never change after record created.\r\n const coordSysRecord: CoordSysRecord = {\r\n model: coordSysModel,\r\n containsPoint: curry(containsPoint, coordSysModel),\r\n dispatchAction: curry(dispatchAction, api),\r\n dataZoomInfoMap: null,\r\n controller: null\r\n };\r\n\r\n // Must not do anything depends on coordSysRecord outside the event handler here,\r\n // because coordSysRecord not completed yet.\r\n const controller = coordSysRecord.controller = new RoamController(api.getZr());\r\n\r\n each(['pan', 'zoom', 'scrollMove'] as const, function (eventName) {\r\n controller.on(eventName, function (event) {\r\n const batch: DataZoomPayloadBatchItem[] = [];\r\n\r\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\r\n // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\r\n // moveOnMouseWheel, ...) enabled.\r\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\r\n return;\r\n }\r\n\r\n const method = (dzInfo.getRange || {} as DataZoomGetRangeHandlers)[eventName];\r\n const range = method && method(\r\n dzInfo.dzReferCoordSysInfo,\r\n coordSysRecord.model.mainType as DataZoomCoordSysMainType,\r\n coordSysRecord.controller,\r\n event as any\r\n );\r\n\r\n !dzInfo.model.get('disabled', true) && range && batch.push({\r\n dataZoomId: dzInfo.model.id,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n });\r\n\r\n batch.length && coordSysRecord.dispatchAction(batch);\r\n });\r\n });\r\n\r\n return coordSysRecord;\r\n}\r\n\r\n/**\r\n * This action will be throttled.\r\n */\r\nfunction dispatchAction(api: ExtensionAPI, batch: DataZoomPayloadBatchItem[]) {\r\n if (!api.isDisposed()) {\r\n api.dispatchAction({\r\n type: 'dataZoom',\r\n animation: {\r\n easing: 'cubicOut',\r\n duration: 100\r\n },\r\n batch: batch\r\n });\r\n }\r\n}\r\n\r\nfunction containsPoint(\r\n coordSysModel: CoordinateSystemHostModel, e: ZRElementEvent, x: number, y: number\r\n): boolean {\r\n return coordSysModel.coordinateSystem.containPoint([x, y]);\r\n}\r\n\r\n/**\r\n * Merge roamController settings when multiple dataZooms share one roamController.\r\n */\r\nfunction mergeControllerParams(dataZoomInfoMap: HashMap<{ model: InsideZoomModel }>) {\r\n let controlType: RoamType;\r\n // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\r\n // as string, it is probably revert to reserved word by compress tool. See #7411.\r\n const prefix = 'type_';\r\n const typePriority: Dictionary = {\r\n 'type_true': 2,\r\n 'type_move': 1,\r\n 'type_false': 0,\r\n 'type_undefined': -1\r\n };\r\n let preventDefaultMouseMove = true;\r\n\r\n dataZoomInfoMap.each(function (dataZoomInfo) {\r\n const dataZoomModel = dataZoomInfo.model;\r\n const oneType = dataZoomModel.get('disabled', true)\r\n ? false\r\n : dataZoomModel.get('zoomLock', true)\r\n ? 'move' as const\r\n : true;\r\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\r\n controlType = oneType;\r\n }\r\n\r\n // Prevent default move event by default. If one false, do not prevent. Otherwise\r\n // users may be confused why it does not work when multiple insideZooms exist.\r\n preventDefaultMouseMove = preventDefaultMouseMove\r\n && dataZoomModel.get('preventDefaultMouseMove', true);\r\n });\r\n\r\n return {\r\n controlType: controlType,\r\n opt: {\r\n // RoamController will enable all of these functionalities,\r\n // and the final behavior is determined by its event listener\r\n // provided by each inside zoom.\r\n zoomOnMouseWheel: true,\r\n moveOnMouseMove: true,\r\n moveOnMouseWheel: true,\r\n preventDefaultMouseMove: !!preventDefaultMouseMove\r\n }\r\n };\r\n}\r\n\r\nexport function installDataZoomRoamProcessor(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerProcessor(\r\n registers.PRIORITY.PROCESSOR.FILTER,\r\n function (ecModel: GlobalModel, api: ExtensionAPI): void {\r\n const apiInner = inner(api);\r\n const coordSysRecordMap = apiInner.coordSysRecordMap\r\n || (apiInner.coordSysRecordMap = createHashMap());\r\n\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should\r\n // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.\r\n coordSysRecord.dataZoomInfoMap = null;\r\n });\r\n\r\n ecModel.eachComponent(\r\n { mainType: 'dataZoom', subType: 'inside' },\r\n function (dataZoomModel: InsideZoomModel) {\r\n const dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\r\n\r\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\r\n\r\n const coordSysUid = dzCoordSysInfo.model.uid;\r\n const coordSysRecord = coordSysRecordMap.get(coordSysUid)\r\n || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\r\n\r\n const dataZoomInfoMap = coordSysRecord.dataZoomInfoMap\r\n || (coordSysRecord.dataZoomInfoMap = createHashMap());\r\n // Notice these props might be changed each time for a single dataZoomModel.\r\n dataZoomInfoMap.set(dataZoomModel.uid, {\r\n dzReferCoordSysInfo: dzCoordSysInfo,\r\n model: dataZoomModel,\r\n getRange: null\r\n });\r\n });\r\n }\r\n );\r\n\r\n // (1) Merge dataZoom settings for each coord sys and set to the roam controller.\r\n // (2) Clear coord sys if not refered by any dataZoom.\r\n coordSysRecordMap.each(function (coordSysRecord) {\r\n const controller = coordSysRecord.controller;\r\n let firstDzInfo: DataZoomInfo;\r\n const dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\r\n\r\n if (dataZoomInfoMap) {\r\n const firstDzKey = dataZoomInfoMap.keys()[0];\r\n if (firstDzKey != null) {\r\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\r\n }\r\n }\r\n\r\n if (!firstDzInfo) {\r\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\r\n return;\r\n }\r\n\r\n const controllerParams = mergeControllerParams(dataZoomInfoMap);\r\n controller.enable(controllerParams.controlType, controllerParams.opt);\r\n\r\n controller.setPointerChecker(coordSysRecord.containsPoint);\r\n\r\n throttleUtil.createOrUpdate(\r\n coordSysRecord,\r\n 'dispatchAction',\r\n firstDzInfo.model.get('throttle', true),\r\n 'fixRate'\r\n );\r\n });\r\n });\r\n\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport DataZoomView from './DataZoomView';\r\nimport sliderMove from '../helper/sliderMove';\r\nimport * as roams from './roams';\r\nimport InsideZoomModel from './InsideZoomModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { bind } from 'zrender/src/core/util';\r\nimport RoamController, {RoamEventParams} from '../helper/RoamController';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport Polar from '../../coord/polar/Polar';\r\nimport SingleAxis from '../../coord/single/SingleAxis';\r\nimport { DataZoomCoordSysMainType, DataZoomReferCoordSysInfo } from './helper';\r\n\r\n\r\nclass InsideZoomView extends DataZoomView {\r\n static type = 'dataZoom.inside';\r\n type = 'dataZoom.inside';\r\n\r\n /**\r\n * 'throttle' is used in this.dispatchAction, so we save range\r\n * to avoid missing some 'pan' info.\r\n */\r\n range: number[];\r\n\r\n render(dataZoomModel: InsideZoomModel, ecModel: GlobalModel, api: ExtensionAPI) {\r\n super.render.apply(this, arguments as any);\r\n\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n return;\r\n }\r\n\r\n // Hence the `throttle` util ensures to preserve command order,\r\n // here simply updating range all the time will not cause missing\r\n // any of the the roam change.\r\n this.range = dataZoomModel.getPercentRange();\r\n\r\n // Reset controllers.\r\n roams.setViewInfoToCoordSysRecord(\r\n api,\r\n dataZoomModel,\r\n {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n }\r\n );\r\n }\r\n\r\n dispose() {\r\n this._clear();\r\n super.dispose.apply(this, arguments as any);\r\n }\r\n\r\n private _clear() {\r\n roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel as InsideZoomModel);\r\n this.range = null;\r\n }\r\n}\r\n\r\ninterface DataZoomGetRangeHandler<\r\n T extends RoamEventParams['zoom'] | RoamEventParams['scrollMove'] | RoamEventParams['pan']\r\n> {\r\n (\r\n coordSysInfo: DataZoomReferCoordSysInfo,\r\n coordSysMainType: DataZoomCoordSysMainType,\r\n controller: RoamController,\r\n e: T\r\n ): [number, number]\r\n}\r\n\r\nconst getRangeHandlers: {\r\n pan: DataZoomGetRangeHandler\r\n zoom: DataZoomGetRangeHandler\r\n scrollMove: DataZoomGetRangeHandler\r\n} & ThisType = {\r\n\r\n zoom(coordSysInfo, coordSysMainType, controller, e: RoamEventParams['zoom']) {\r\n const lastRange = this.range;\r\n const range = lastRange.slice() as [number, number];\r\n\r\n // Calculate transform by the first axis.\r\n const axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n\r\n const directionInfo = getDirectionInfo[coordSysMainType](\r\n null, [e.originX, e.originY], axisModel, controller, coordSysInfo\r\n );\r\n const percentPoint = (\r\n directionInfo.signal > 0\r\n ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)\r\n : (directionInfo.pixel - directionInfo.pixelStart)\r\n ) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n\r\n const scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint;\r\n\r\n // Restrict range.\r\n const minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n\r\n this.range = range;\r\n\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e: RoamEventParams['pan']) {\r\n const directionInfo = getDirectionInfo[coordSysMainType](\r\n [e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo\r\n );\r\n\r\n return directionInfo.signal\r\n * (range[1] - range[0])\r\n * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n\r\n scrollMove: makeMover(\r\n function (range, axisModel, coordSysInfo, coordSysMainType, controller, e: RoamEventParams['scrollMove']\r\n ) {\r\n const directionInfo = getDirectionInfo[coordSysMainType](\r\n [0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo\r\n );\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n};\r\n\r\nexport type DataZoomGetRangeHandlers = typeof getRangeHandlers;\r\n\r\nfunction makeMover(\r\n getPercentDelta: (\r\n range: [number, number],\r\n axisModel: AxisBaseModel,\r\n coordSysInfo: DataZoomReferCoordSysInfo,\r\n coordSysMainType: DataZoomCoordSysMainType,\r\n controller: RoamController,\r\n e: RoamEventParams['scrollMove']| RoamEventParams['pan']\r\n ) => number\r\n) {\r\n return function (\r\n this: InsideZoomView,\r\n coordSysInfo: DataZoomReferCoordSysInfo,\r\n coordSysMainType: DataZoomCoordSysMainType,\r\n controller: RoamController,\r\n e: RoamEventParams['scrollMove']| RoamEventParams['pan']\r\n ): [number, number] {\r\n const lastRange = this.range;\r\n const range = lastRange.slice() as [number, number];\r\n\r\n // Calculate transform by the first axis.\r\n const axisModel = coordSysInfo.axisModels[0];\r\n if (!axisModel) {\r\n return;\r\n }\r\n\r\n const percentDelta = getPercentDelta(\r\n range, axisModel, coordSysInfo, coordSysMainType, controller, e\r\n );\r\n\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n\r\n this.range = range;\r\n\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n}\r\n\r\ninterface DirectionInfo {\r\n pixel: number\r\n pixelLength: number\r\n pixelStart: number\r\n signal: -1 | 1\r\n}\r\ninterface GetDirectionInfo {\r\n (\r\n oldPoint: number[],\r\n newPoint: number[],\r\n axisModel: AxisBaseModel,\r\n controller: RoamController,\r\n coordSysInfo: DataZoomReferCoordSysInfo\r\n ): DirectionInfo\r\n}\r\n\r\nconst getDirectionInfo: Record<'grid' | 'polar' | 'singleAxis', GetDirectionInfo> = {\r\n\r\n grid(oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n const axis = axisModel.axis;\r\n const ret = {} as DirectionInfo;\r\n const rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else { // axis.dim === 'y'\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n\r\n return ret;\r\n },\r\n\r\n polar(oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n const axis = axisModel.axis;\r\n const ret = {} as DirectionInfo;\r\n const polar = coordSysInfo.model.coordinateSystem as Polar;\r\n const radiusExtent = polar.getRadiusAxis().getExtent();\r\n const angleExtent = polar.getAngleAxis().getExtent();\r\n\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\r\n // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else { // 'angleAxis'\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\r\n // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n\r\n return ret;\r\n },\r\n\r\n singleAxis(oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n const axis = axisModel.axis as SingleAxis;\r\n const rect = coordSysInfo.model.coordinateSystem.getRect();\r\n const ret = {} as DirectionInfo;\r\n\r\n oldPoint = oldPoint || [0, 0];\r\n\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n }\r\n else { // 'vertical'\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n\r\n return ret;\r\n }\r\n};\r\n\r\nexport default InsideZoomView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport InsideZoomModel from './InsideZoomModel';\r\nimport InsideZoomView from './InsideZoomView';\r\nimport {installDataZoomRoamProcessor} from './roams';\r\nimport installCommon from './installCommon';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n installCommon(registers);\r\n\r\n registers.registerComponentModel(InsideZoomModel);\r\n registers.registerComponentView(InsideZoomView);\r\n\r\n installDataZoomRoamProcessor(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport DataZoomModel, {DataZoomOption} from './DataZoomModel';\r\nimport {\r\n BoxLayoutOptionMixin,\r\n ZRColor,\r\n LineStyleOption,\r\n AreaStyleOption,\r\n ItemStyleOption,\r\n LabelOption\r\n} from '../../util/types';\r\nimport { inheritDefaultOption } from '../../util/component';\r\n\r\nexport interface SliderDataZoomOption extends DataZoomOption, BoxLayoutOptionMixin {\r\n\r\n show?: boolean\r\n /**\r\n * Slider dataZoom don't support textStyle\r\n */\r\n\r\n /**\r\n * Background of slider zoom component\r\n */\r\n backgroundColor?: ZRColor\r\n\r\n /**\r\n * @deprecated Use borderColor instead\r\n */\r\n // dataBackgroundColor?: ZRColor\r\n\r\n /**\r\n * border color of the box. For compatibility,\r\n * if dataBackgroundColor is set, borderColor\r\n * is ignored.\r\n */\r\n borderColor?: ZRColor\r\n\r\n /**\r\n * Border radius of the box.\r\n */\r\n borderRadius?: number | number[]\r\n\r\n dataBackground?: {\r\n lineStyle?: LineStyleOption\r\n areaStyle?: AreaStyleOption\r\n }\r\n\r\n selectedDataBackground?: {\r\n lineStyle?: LineStyleOption\r\n areaStyle?: AreaStyleOption\r\n }\r\n\r\n /**\r\n * Color of selected area.\r\n */\r\n fillerColor?: ZRColor\r\n\r\n /**\r\n * @deprecated Use handleStyle instead\r\n */\r\n // handleColor?: ZRColor\r\n\r\n handleIcon?: string\r\n\r\n /**\r\n * number: height of icon. width will be calculated according to the aspect of icon.\r\n * string: percent of the slider height. width will be calculated according to the aspect of icon.\r\n */\r\n handleSize?: string | number\r\n\r\n handleStyle?: ItemStyleOption\r\n\r\n /**\r\n * Icon to indicate it is a draggable panel.\r\n */\r\n moveHandleIcon?: string\r\n moveHandleStyle?: ItemStyleOption\r\n /**\r\n * Height of handle rect. Can be a percent string relative to the slider height.\r\n */\r\n moveHandleSize?: number\r\n\r\n labelPrecision?: number | 'auto'\r\n\r\n labelFormatter?: string | ((value: number, valueStr: string) => string)\r\n\r\n showDetail?: boolean\r\n\r\n showDataShadow?: 'auto' | boolean\r\n\r\n zoomLock?: boolean\r\n\r\n textStyle?: LabelOption\r\n\r\n /**\r\n * If eable select by brushing\r\n */\r\n brushSelect?: boolean\r\n\r\n brushStyle?: ItemStyleOption\r\n\r\n emphasis?: {\r\n handleStyle?: ItemStyleOption\r\n moveHandleStyle?: ItemStyleOption\r\n }\r\n}\r\n\r\n\r\nclass SliderZoomModel extends DataZoomModel {\r\n static readonly type = 'dataZoom.slider';\r\n type = SliderZoomModel.type;\r\n\r\n static readonly layoutMode = 'box';\r\n\r\n static defaultOption: SliderDataZoomOption = inheritDefaultOption(DataZoomModel.defaultOption, {\r\n show: true,\r\n\r\n // deault value can only be drived in view stage.\r\n right: 'ph', // Default align to grid rect.\r\n top: 'ph', // Default align to grid rect.\r\n width: 'ph', // Default align to grid rect.\r\n height: 'ph', // Default align to grid rect.\r\n left: null, // Default align to grid rect.\r\n bottom: null, // Default align to grid rect.\r\n\r\n borderColor: '#d2dbee',\r\n borderRadius: 3,\r\n\r\n backgroundColor: 'rgba(47,69,84,0)', // Background of slider zoom component.\r\n\r\n // dataBackgroundColor: '#ddd',\r\n dataBackground: {\r\n lineStyle: {\r\n color: '#d2dbee',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#d2dbee',\r\n opacity: 0.2\r\n }\r\n },\r\n\r\n selectedDataBackground: {\r\n lineStyle: {\r\n color: '#8fb0f7',\r\n width: 0.5\r\n },\r\n areaStyle: {\r\n color: '#8fb0f7',\r\n opacity: 0.2\r\n }\r\n },\r\n\r\n // Color of selected window.\r\n fillerColor: 'rgba(135,175,274,0.2)',\r\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\r\n // Percent of the slider height\r\n handleSize: '100%',\r\n\r\n handleStyle: {\r\n color: '#fff',\r\n borderColor: '#ACB8D1'\r\n },\r\n\r\n moveHandleSize: 7,\r\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\r\n moveHandleStyle: {\r\n color: '#D2DBEE',\r\n opacity: 0.7\r\n },\r\n\r\n showDetail: true,\r\n showDataShadow: 'auto', // Default auto decision.\r\n realtime: true,\r\n zoomLock: false, // Whether disable zoom.\r\n\r\n textStyle: {\r\n color: '#6E7079'\r\n },\r\n\r\n brushSelect: true,\r\n brushStyle: {\r\n color: 'rgba(135,175,274,0.15)'\r\n },\r\n\r\n emphasis: {\r\n handleStyle: {\r\n borderColor: '#8FB0F7'\r\n },\r\n moveHandleStyle: {\r\n color: '#8FB0F7'\r\n }\r\n }\r\n } as SliderDataZoomOption);\r\n}\r\n\r\nexport default SliderZoomModel;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {bind, each, isFunction, isString, indexOf} from 'zrender/src/core/util';\r\nimport * as eventTool from 'zrender/src/core/event';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as throttle from '../../util/throttle';\r\nimport DataZoomView from './DataZoomView';\r\nimport {linearMap, asc, parsePercent} from '../../util/number';\r\nimport * as layout from '../../util/layout';\r\nimport sliderMove from '../helper/sliderMove';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport {\r\n LayoutOrient, Payload, ZRTextVerticalAlign, ZRTextAlign, ZRElementEvent, ParsedValue\r\n} from '../../util/types';\r\nimport SliderZoomModel from './SliderZoomModel';\r\nimport { RectLike } from 'zrender/src/core/BoundingRect';\r\nimport Axis from '../../coord/Axis';\r\nimport SeriesModel from '../../model/Series';\r\nimport { AxisBaseModel } from '../../coord/AxisBaseModel';\r\nimport { getAxisMainType, collectReferCoordSysModelInfo } from './helper';\r\nimport { enableHoverEmphasis } from '../../util/states';\r\nimport { createSymbol, symbolBuildProxies } from '../../util/symbol';\r\nimport { deprecateLog } from '../../util/log';\r\nimport { PointLike } from 'zrender/src/core/Point';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\nimport {createTextStyle} from '../../label/labelStyle';\r\nimport SeriesData from '../../data/SeriesData';\r\n\r\nconst Rect = graphic.Rect;\r\n\r\n// Constants\r\nconst DEFAULT_LOCATION_EDGE_GAP = 7;\r\nconst DEFAULT_FRAME_BORDER_WIDTH = 1;\r\nconst DEFAULT_FILLER_SIZE = 30;\r\nconst DEFAULT_MOVE_HANDLE_SIZE = 7;\r\nconst HORIZONTAL = 'horizontal';\r\nconst VERTICAL = 'vertical';\r\nconst LABEL_GAP = 5;\r\nconst SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\r\n\r\nconst REALTIME_ANIMATION_CONFIG = {\r\n easing: 'cubicOut',\r\n duration: 100,\r\n delay: 0\r\n} as const;\r\n\r\n// const NORMAL_ANIMATION_CONFIG = {\r\n// easing: 'cubicInOut',\r\n// duration: 200\r\n// } as const;\r\n\r\n\r\ninterface Displayables {\r\n sliderGroup: graphic.Group;\r\n handles: [graphic.Path, graphic.Path];\r\n handleLabels: [graphic.Text, graphic.Text];\r\n dataShadowSegs: graphic.Group[];\r\n filler: graphic.Rect;\r\n\r\n brushRect: graphic.Rect;\r\n\r\n moveHandle: graphic.Rect;\r\n moveHandleIcon: graphic.Path;\r\n // invisible move zone.\r\n moveZone: graphic.Rect;\r\n}\r\nclass SliderZoomView extends DataZoomView {\r\n static type = 'dataZoom.slider';\r\n type = SliderZoomView.type;\r\n\r\n dataZoomModel: SliderZoomModel;\r\n\r\n private _displayables = {} as Displayables;\r\n\r\n private _orient: LayoutOrient;\r\n\r\n private _range: number[];\r\n\r\n /**\r\n * [coord of the first handle, coord of the second handle]\r\n */\r\n private _handleEnds: number[];\r\n\r\n /**\r\n * [length, thick]\r\n */\r\n private _size: number[];\r\n\r\n private _handleWidth: number;\r\n\r\n private _handleHeight: number;\r\n\r\n private _location: PointLike;\r\n\r\n private _brushStart: PointLike;\r\n private _brushStartTime: number;\r\n\r\n private _dragging: boolean;\r\n\r\n private _brushing: boolean;\r\n\r\n private _dataShadowInfo: {\r\n thisAxis: Axis\r\n series: SeriesModel\r\n thisDim: string\r\n otherDim: string\r\n otherAxisInverse: boolean\r\n };\r\n\r\n // Cached raw data. Avoid rendering data shadow multiple times.\r\n private _shadowData: SeriesData;\r\n private _shadowDim: string;\r\n private _shadowSize: number[];\r\n private _shadowPolygonPts: number[][];\r\n private _shadowPolylinePts: number[][];\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.api = api;\r\n\r\n // A unique handler for each dataZoom component\r\n this._onBrush = bind(this._onBrush, this);\r\n this._onBrushEnd = bind(this._onBrushEnd, this);\r\n }\r\n\r\n render(\r\n dataZoomModel: SliderZoomModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: Payload & {\r\n from: string\r\n type: string\r\n }\r\n ) {\r\n super.render.apply(this, arguments as any);\r\n\r\n throttle.createOrUpdate(\r\n this,\r\n '_dispatchZoomAction',\r\n dataZoomModel.get('throttle'),\r\n 'fixRate'\r\n );\r\n\r\n this._orient = dataZoomModel.getOrient();\r\n\r\n if (dataZoomModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n this.group.removeAll();\r\n return;\r\n }\r\n\r\n // Notice: this._resetInterval() should not be executed when payload.type\r\n // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\r\n // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\r\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n\r\n this._updateView();\r\n }\r\n\r\n dispose() {\r\n this._clear();\r\n super.dispose.apply(this, arguments as any);\r\n }\r\n\r\n private _clear() {\r\n throttle.clear(this, '_dispatchZoomAction');\r\n\r\n const zr = this.api.getZr();\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n\r\n private _buildView() {\r\n const thisGroup = this.group;\r\n\r\n thisGroup.removeAll();\r\n\r\n this._brushing = false;\r\n this._displayables.brushRect = null;\r\n\r\n this._resetLocation();\r\n this._resetInterval();\r\n\r\n const barGroup = this._displayables.sliderGroup = new graphic.Group();\r\n\r\n this._renderBackground();\r\n\r\n this._renderHandle();\r\n\r\n this._renderDataShadow();\r\n\r\n thisGroup.add(barGroup);\r\n\r\n this._positionGroup();\r\n }\r\n\r\n private _resetLocation() {\r\n const dataZoomModel = this.dataZoomModel;\r\n const api = this.api;\r\n const showMoveHandle = dataZoomModel.get('brushSelect');\r\n const moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;\r\n\r\n // If some of x/y/width/height are not specified,\r\n // auto-adapt according to target grid.\r\n const coordRect = this._findCoordRect();\r\n const ecSize = {width: api.getWidth(), height: api.getHeight()};\r\n // Default align by coordinate system rect.\r\n const positionInfo = this._orient === HORIZONTAL\r\n ? {\r\n // Why using 'right', because right should be used in vertical,\r\n // and it is better to be consistent for dealing with position param merge.\r\n right: ecSize.width - coordRect.x - coordRect.width,\r\n top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize),\r\n width: coordRect.width,\r\n height: DEFAULT_FILLER_SIZE\r\n }\r\n : { // vertical\r\n right: DEFAULT_LOCATION_EDGE_GAP,\r\n top: coordRect.y,\r\n width: DEFAULT_FILLER_SIZE,\r\n height: coordRect.height\r\n };\r\n\r\n // Do not write back to option and replace value 'ph', because\r\n // the 'ph' value should be recalculated when resize.\r\n const layoutParams = layout.getLayoutParams(dataZoomModel.option);\r\n\r\n // Replace the placeholder value.\r\n each(['right', 'top', 'width', 'height'] as const, function (name) {\r\n if (layoutParams[name] === 'ph') {\r\n layoutParams[name] = positionInfo[name];\r\n }\r\n });\r\n\r\n const layoutRect = layout.getLayoutRect(\r\n layoutParams,\r\n ecSize\r\n );\r\n\r\n this._location = {x: layoutRect.x, y: layoutRect.y};\r\n this._size = [layoutRect.width, layoutRect.height];\r\n this._orient === VERTICAL && this._size.reverse();\r\n }\r\n\r\n private _positionGroup() {\r\n const thisGroup = this.group;\r\n const location = this._location;\r\n const orient = this._orient;\r\n\r\n // Just use the first axis to determine mapping.\r\n const targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\r\n const inverse = targetAxisModel && targetAxisModel.get('inverse');\r\n\r\n const sliderGroup = this._displayables.sliderGroup;\r\n const otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;\r\n\r\n // Transform barGroup.\r\n sliderGroup.attr(\r\n (orient === HORIZONTAL && !inverse)\r\n ? {scaleY: otherAxisInverse ? 1 : -1, scaleX: 1 }\r\n : (orient === HORIZONTAL && inverse)\r\n ? {scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 }\r\n : (orient === VERTICAL && !inverse)\r\n ? {scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2}\r\n // Don't use Math.PI, considering shadow direction.\r\n : {scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2}\r\n );\r\n\r\n // Position barGroup\r\n const rect = thisGroup.getBoundingRect([sliderGroup]);\r\n thisGroup.x = location.x - rect.x;\r\n thisGroup.y = location.y - rect.y;\r\n thisGroup.markRedraw();\r\n }\r\n\r\n private _getViewExtent() {\r\n return [0, this._size[0]];\r\n }\r\n\r\n private _renderBackground() {\r\n const dataZoomModel = this.dataZoomModel;\r\n const size = this._size;\r\n const barGroup = this._displayables.sliderGroup;\r\n const brushSelect = dataZoomModel.get('brushSelect');\r\n\r\n barGroup.add(new Rect({\r\n silent: true,\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: dataZoomModel.get('backgroundColor')\r\n },\r\n z2: -40\r\n }));\r\n\r\n // Click panel, over shadow, below handles.\r\n const clickPanel = new Rect({\r\n shape: {\r\n x: 0, y: 0, width: size[0], height: size[1]\r\n },\r\n style: {\r\n fill: 'transparent'\r\n },\r\n z2: 0,\r\n onclick: bind(this._onClickPanel, this)\r\n });\r\n\r\n const zr = this.api.getZr();\r\n if (brushSelect) {\r\n clickPanel.on('mousedown', this._onBrushStart, this);\r\n clickPanel.cursor = 'crosshair';\r\n\r\n zr.on('mousemove', this._onBrush);\r\n zr.on('mouseup', this._onBrushEnd);\r\n }\r\n else {\r\n zr.off('mousemove', this._onBrush);\r\n zr.off('mouseup', this._onBrushEnd);\r\n }\r\n\r\n barGroup.add(clickPanel);\r\n }\r\n\r\n private _renderDataShadow() {\r\n const info = this._dataShadowInfo = this._prepareDataShadowInfo();\r\n\r\n this._displayables.dataShadowSegs = [];\r\n\r\n if (!info) {\r\n return;\r\n }\r\n\r\n const size = this._size;\r\n const oldSize = this._shadowSize || [];\r\n const seriesModel = info.series;\r\n const data = seriesModel.getRawData();\r\n const candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim();\r\n const otherDim: string = candlestickDim && data.getDimensionInfo(candlestickDim)\r\n ? seriesModel.getShadowDim() // @see candlestick\r\n : info.otherDim;\r\n\r\n if (otherDim == null) {\r\n return;\r\n }\r\n\r\n let polygonPts = this._shadowPolygonPts;\r\n let polylinePts = this._shadowPolylinePts;\r\n // Not re-render if data doesn't change.\r\n if (\r\n data !== this._shadowData || otherDim !== this._shadowDim\r\n || size[0] !== oldSize[0] || size[1] !== oldSize[1]\r\n ) {\r\n let otherDataExtent = data.getDataExtent(otherDim);\r\n // Nice extent.\r\n const otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;\r\n otherDataExtent = [\r\n otherDataExtent[0] - otherOffset,\r\n otherDataExtent[1] + otherOffset\r\n ];\r\n const otherShadowExtent = [0, size[1]];\r\n const thisShadowExtent = [0, size[0]];\r\n\r\n const areaPoints = [[size[0], 0], [0, 0]];\r\n const linePoints: number[][] = [];\r\n const step = thisShadowExtent[1] / (data.count() - 1);\r\n let thisCoord = 0;\r\n\r\n // Optimize for large data shadow\r\n const stride = Math.round(data.count() / size[0]);\r\n let lastIsEmpty: boolean;\r\n data.each([otherDim], function (value: ParsedValue, index) {\r\n if (stride > 0 && (index % stride)) {\r\n thisCoord += step;\r\n return;\r\n }\r\n\r\n // FIXME\r\n // Should consider axis.min/axis.max when drawing dataShadow.\r\n\r\n // FIXME\r\n // \u5E94\u8BE5\u4F7F\u7528\u7EDF\u4E00\u7684\u7A7A\u5224\u65AD\uFF1F\u8FD8\u662F\u5728list\u91CC\u8FDB\u884C\u7A7A\u5224\u65AD\uFF1F\r\n const isEmpty = value == null || isNaN(value as number) || value === '';\r\n // See #4235.\r\n const otherCoord = isEmpty\r\n ? 0 : linearMap(value as number, otherDataExtent, otherShadowExtent, true);\r\n\r\n // Attempt to draw data shadow precisely when there are empty value.\r\n if (isEmpty && !lastIsEmpty && index) {\r\n areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]);\r\n linePoints.push([linePoints[linePoints.length - 1][0], 0]);\r\n }\r\n else if (!isEmpty && lastIsEmpty) {\r\n areaPoints.push([thisCoord, 0]);\r\n linePoints.push([thisCoord, 0]);\r\n }\r\n\r\n areaPoints.push([thisCoord, otherCoord]);\r\n linePoints.push([thisCoord, otherCoord]);\r\n\r\n thisCoord += step;\r\n lastIsEmpty = isEmpty;\r\n });\r\n\r\n polygonPts = this._shadowPolygonPts = areaPoints;\r\n polylinePts = this._shadowPolylinePts = linePoints;\r\n\r\n }\r\n this._shadowData = data;\r\n this._shadowDim = otherDim;\r\n this._shadowSize = [size[0], size[1]];\r\n\r\n const dataZoomModel = this.dataZoomModel;\r\n\r\n function createDataShadowGroup(isSelectedArea?: boolean) {\r\n const model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\r\n const group = new graphic.Group();\r\n const polygon = new graphic.Polygon({\r\n shape: {points: polygonPts},\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('areaStyle').getAreaStyle(),\r\n silent: true,\r\n z2: -20\r\n });\r\n const polyline = new graphic.Polyline({\r\n shape: {points: polylinePts},\r\n segmentIgnoreThreshold: 1,\r\n style: model.getModel('lineStyle').getLineStyle(),\r\n silent: true,\r\n z2: -19\r\n });\r\n group.add(polygon);\r\n group.add(polyline);\r\n return group;\r\n }\r\n\r\n // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');\r\n for (let i = 0; i < 3; i++) {\r\n const group = createDataShadowGroup(i === 1);\r\n this._displayables.sliderGroup.add(group);\r\n this._displayables.dataShadowSegs.push(group);\r\n }\r\n }\r\n\r\n private _prepareDataShadowInfo() {\r\n const dataZoomModel = this.dataZoomModel;\r\n const showDataShadow = dataZoomModel.get('showDataShadow');\r\n\r\n if (showDataShadow === false) {\r\n return;\r\n }\r\n\r\n // Find a representative series.\r\n let result: SliderZoomView['_dataShadowInfo'];\r\n const ecModel = this.ecModel;\r\n\r\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\r\n const seriesModels = dataZoomModel\r\n .getAxisProxy(axisDim, axisIndex)\r\n .getTargetSeriesModels();\r\n\r\n each(seriesModels, function (seriesModel) {\r\n if (result) {\r\n return;\r\n }\r\n\r\n if (showDataShadow !== true && indexOf(\r\n SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')\r\n ) < 0\r\n ) {\r\n return;\r\n }\r\n\r\n const thisAxis = (\r\n ecModel.getComponent(getAxisMainType(axisDim), axisIndex) as AxisBaseModel\r\n ).axis;\r\n let otherDim = getOtherDim(axisDim);\r\n let otherAxisInverse;\r\n const coordSys = seriesModel.coordinateSystem;\r\n\r\n if (otherDim != null && coordSys.getOtherAxis) {\r\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\r\n }\r\n\r\n otherDim = seriesModel.getData().mapDimension(otherDim);\r\n\r\n result = {\r\n thisAxis: thisAxis,\r\n series: seriesModel,\r\n thisDim: axisDim,\r\n otherDim: otherDim,\r\n otherAxisInverse: otherAxisInverse\r\n };\r\n\r\n }, this);\r\n\r\n }, this);\r\n\r\n return result;\r\n }\r\n\r\n private _renderHandle() {\r\n const thisGroup = this.group;\r\n const displayables = this._displayables;\r\n const handles: [graphic.Path, graphic.Path] = displayables.handles = [null, null];\r\n const handleLabels: [graphic.Text, graphic.Text] = displayables.handleLabels = [null, null];\r\n const sliderGroup = this._displayables.sliderGroup;\r\n const size = this._size;\r\n const dataZoomModel = this.dataZoomModel;\r\n const api = this.api;\r\n\r\n const borderRadius = dataZoomModel.get('borderRadius') || 0;\r\n\r\n const brushSelect = dataZoomModel.get('brushSelect');\r\n\r\n const filler = displayables.filler = new Rect({\r\n silent: brushSelect,\r\n style: {\r\n fill: dataZoomModel.get('fillerColor')\r\n },\r\n textConfig: {\r\n position: 'inside'\r\n }\r\n });\r\n\r\n sliderGroup.add(filler);\r\n\r\n // Frame border.\r\n sliderGroup.add(new Rect({\r\n silent: true,\r\n subPixelOptimize: true,\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: size[0],\r\n height: size[1],\r\n r: borderRadius\r\n },\r\n style: {\r\n // deprecated option\r\n stroke: dataZoomModel.get('dataBackgroundColor' as any)\r\n || dataZoomModel.get('borderColor'),\r\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\r\n fill: 'rgba(0,0,0,0)'\r\n }\r\n }));\r\n\r\n // Left and right handle to resize\r\n each([0, 1] as const, function (handleIndex) {\r\n let iconStr = dataZoomModel.get('handleIcon');\r\n if (\r\n !symbolBuildProxies[iconStr]\r\n && iconStr.indexOf('path://') < 0\r\n && iconStr.indexOf('image://') < 0\r\n ) {\r\n // Compatitable with the old icon parsers. Which can use a path string without path://\r\n iconStr = 'path://' + iconStr;\r\n if (__DEV__) {\r\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\r\n }\r\n }\r\n const path = createSymbol(\r\n iconStr,\r\n -1, 0, 2, 2, null, true\r\n ) as graphic.Path;\r\n path.attr({\r\n cursor: getCursor(this._orient),\r\n draggable: true,\r\n drift: bind(this._onDragMove, this, handleIndex),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false),\r\n z2: 5\r\n });\r\n\r\n const bRect = path.getBoundingRect();\r\n const handleSize = dataZoomModel.get('handleSize');\r\n\r\n this._handleHeight = parsePercent(handleSize, this._size[1]);\r\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\r\n\r\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\r\n path.style.strokeNoScale = true;\r\n path.rectHover = true;\r\n\r\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n enableHoverEmphasis(path);\r\n\r\n const handleColor = dataZoomModel.get('handleColor' as any); // deprecated option\r\n // Compatitable with previous version\r\n if (handleColor != null) {\r\n path.style.fill = handleColor;\r\n }\r\n\r\n sliderGroup.add(handles[handleIndex] = path);\r\n\r\n const textStyleModel = dataZoomModel.getModel('textStyle');\r\n\r\n thisGroup.add(\r\n handleLabels[handleIndex] = new graphic.Text({\r\n silent: true,\r\n invisible: true,\r\n style: createTextStyle(textStyleModel, {\r\n x: 0, y: 0, text: '',\r\n verticalAlign: 'middle',\r\n align: 'center',\r\n fill: textStyleModel.getTextColor(),\r\n font: textStyleModel.getFont()\r\n }),\r\n z2: 10\r\n }));\r\n\r\n }, this);\r\n\r\n // Handle to move. Only visible when brushSelect is set true.\r\n let actualMoveZone: Displayable = filler;\r\n if (brushSelect) {\r\n const moveHandleHeight = parsePercent(dataZoomModel.get('moveHandleSize'), size[1]);\r\n const moveHandle = displayables.moveHandle = new graphic.Rect({\r\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\r\n silent: true,\r\n shape: {\r\n r: [0, 0, 2, 2],\r\n y: size[1] - 0.5,\r\n height: moveHandleHeight\r\n }\r\n });\r\n const iconSize = moveHandleHeight * 0.8;\r\n const moveHandleIcon = displayables.moveHandleIcon = createSymbol(\r\n dataZoomModel.get('moveHandleIcon'),\r\n -iconSize / 2, -iconSize / 2, iconSize, iconSize,\r\n '#fff',\r\n true\r\n );\r\n moveHandleIcon.silent = true;\r\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\r\n\r\n moveHandle.ensureState('emphasis').style = dataZoomModel.getModel(\r\n ['emphasis', 'moveHandleStyle']\r\n ).getItemStyle();\r\n\r\n const moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\r\n actualMoveZone = displayables.moveZone = new graphic.Rect({\r\n invisible: true,\r\n shape: {\r\n y: size[1] - moveZoneExpandSize,\r\n height: moveHandleHeight + moveZoneExpandSize\r\n }\r\n });\r\n\r\n actualMoveZone.on('mouseover', () => {\r\n api.enterEmphasis(moveHandle);\r\n })\r\n .on('mouseout', () => {\r\n api.leaveEmphasis(moveHandle);\r\n });\r\n\r\n sliderGroup.add(moveHandle);\r\n sliderGroup.add(moveHandleIcon);\r\n sliderGroup.add(actualMoveZone);\r\n }\r\n\r\n actualMoveZone.attr({\r\n draggable: true,\r\n cursor: getCursor(this._orient),\r\n drift: bind(this._onDragMove, this, 'all'),\r\n ondragstart: bind(this._showDataInfo, this, true),\r\n ondragend: bind(this._onDragEnd, this),\r\n onmouseover: bind(this._showDataInfo, this, true),\r\n onmouseout: bind(this._showDataInfo, this, false)\r\n });\r\n }\r\n\r\n private _resetInterval() {\r\n const range = this._range = this.dataZoomModel.getPercentRange();\r\n const viewExtent = this._getViewExtent();\r\n\r\n this._handleEnds = [\r\n linearMap(range[0], [0, 100], viewExtent, true),\r\n linearMap(range[1], [0, 100], viewExtent, true)\r\n ];\r\n }\r\n\r\n private _updateInterval(handleIndex: 0 | 1 | 'all', delta: number): boolean {\r\n const dataZoomModel = this.dataZoomModel;\r\n const handleEnds = this._handleEnds;\r\n const viewExtend = this._getViewExtent();\r\n const minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n const percentExtent = [0, 100];\r\n\r\n sliderMove(\r\n delta,\r\n handleEnds,\r\n viewExtend,\r\n dataZoomModel.get('zoomLock') ? 'all' : handleIndex,\r\n minMaxSpan.minSpan != null\r\n ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null,\r\n minMaxSpan.maxSpan != null\r\n ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null\r\n );\r\n\r\n const lastRange = this._range;\r\n const range = this._range = asc([\r\n linearMap(handleEnds[0], viewExtend, percentExtent, true),\r\n linearMap(handleEnds[1], viewExtend, percentExtent, true)\r\n ]);\r\n\r\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\r\n }\r\n\r\n private _updateView(nonRealtime?: boolean) {\r\n const displaybles = this._displayables;\r\n const handleEnds = this._handleEnds;\r\n const handleInterval = asc(handleEnds.slice());\r\n const size = this._size;\r\n\r\n each([0, 1] as const, function (handleIndex) {\r\n // Handles\r\n const handle = displaybles.handles[handleIndex];\r\n const handleHeight = this._handleHeight;\r\n (handle as graphic.Path).attr({\r\n scaleX: handleHeight / 2,\r\n scaleY: handleHeight / 2,\r\n // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.\r\n // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.\r\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\r\n y: size[1] / 2 - handleHeight / 2\r\n });\r\n }, this);\r\n\r\n // Filler\r\n displaybles.filler.setShape({\r\n x: handleInterval[0],\r\n y: 0,\r\n width: handleInterval[1] - handleInterval[0],\r\n height: size[1]\r\n });\r\n\r\n const viewExtent = {\r\n x: handleInterval[0],\r\n width: handleInterval[1] - handleInterval[0]\r\n };\r\n // Move handle\r\n if (displaybles.moveHandle) {\r\n displaybles.moveHandle.setShape(viewExtent);\r\n displaybles.moveZone.setShape(viewExtent);\r\n // Force update path on the invisible object\r\n displaybles.moveZone.getBoundingRect();\r\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\r\n }\r\n\r\n // update clip path of shadow.\r\n const dataShadowSegs = displaybles.dataShadowSegs;\r\n const segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\r\n\r\n for (let i = 0; i < dataShadowSegs.length; i++) {\r\n const segGroup = dataShadowSegs[i];\r\n let clipPath = segGroup.getClipPath();\r\n if (!clipPath) {\r\n clipPath = new graphic.Rect();\r\n segGroup.setClipPath(clipPath);\r\n }\r\n clipPath.setShape({\r\n x: segIntervals[i],\r\n y: 0,\r\n width: segIntervals[i + 1] - segIntervals[i],\r\n height: size[1]\r\n });\r\n }\r\n\r\n this._updateDataInfo(nonRealtime);\r\n }\r\n\r\n private _updateDataInfo(nonRealtime?: boolean) {\r\n const dataZoomModel = this.dataZoomModel;\r\n const displaybles = this._displayables;\r\n const handleLabels = displaybles.handleLabels;\r\n const orient = this._orient;\r\n let labelTexts = ['', ''];\r\n\r\n // FIXME\r\n // date\u578B\uFF0C\u652F\u6301formatter\uFF0Cautoformatter\uFF08ec2 date.getAutoFormatter\uFF09\r\n if (dataZoomModel.get('showDetail')) {\r\n const axisProxy = dataZoomModel.findRepresentativeAxisProxy();\r\n\r\n if (axisProxy) {\r\n const axis = axisProxy.getAxisModel().axis;\r\n const range = this._range;\r\n\r\n const dataInterval = nonRealtime\r\n // See #4434, data and axis are not processed and reset yet in non-realtime mode.\r\n ? axisProxy.calculateDataWindow({\r\n start: range[0], end: range[1]\r\n }).valueWindow\r\n : axisProxy.getDataValueWindow();\r\n\r\n labelTexts = [\r\n this._formatLabel(dataInterval[0], axis),\r\n this._formatLabel(dataInterval[1], axis)\r\n ];\r\n }\r\n }\r\n\r\n const orderedHandleEnds = asc(this._handleEnds.slice());\r\n\r\n setLabel.call(this, 0);\r\n setLabel.call(this, 1);\r\n\r\n function setLabel(this: SliderZoomView, handleIndex: 0 | 1) {\r\n // Label\r\n // Text should not transform by barGroup.\r\n // Ignore handlers transform\r\n const barTransform = graphic.getTransform(\r\n displaybles.handles[handleIndex].parent, this.group\r\n );\r\n const direction = graphic.transformDirection(\r\n handleIndex === 0 ? 'right' : 'left', barTransform\r\n );\r\n const offset = this._handleWidth / 2 + LABEL_GAP;\r\n const textPoint = graphic.applyTransform(\r\n [\r\n orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),\r\n this._size[1] / 2\r\n ],\r\n barTransform\r\n );\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction as ZRTextVerticalAlign,\r\n align: orient === HORIZONTAL ? direction as ZRTextAlign : 'center',\r\n text: labelTexts[handleIndex]\r\n });\r\n }\r\n }\r\n\r\n private _formatLabel(value: ParsedValue, axis: Axis) {\r\n const dataZoomModel = this.dataZoomModel;\r\n const labelFormatter = dataZoomModel.get('labelFormatter');\r\n\r\n let labelPrecision = dataZoomModel.get('labelPrecision');\r\n if (labelPrecision == null || labelPrecision === 'auto') {\r\n labelPrecision = axis.getPixelPrecision();\r\n }\r\n\r\n const valueStr = (value == null || isNaN(value as number))\r\n ? ''\r\n // FIXME Glue code\r\n : (axis.type === 'category' || axis.type === 'time')\r\n ? axis.scale.getLabel({\r\n value: Math.round(value as number)\r\n })\r\n // param of toFixed should less then 20.\r\n : (value as number).toFixed(Math.min(labelPrecision as number, 20));\r\n\r\n return isFunction(labelFormatter)\r\n ? labelFormatter(value as number, valueStr)\r\n : isString(labelFormatter)\r\n ? labelFormatter.replace('{value}', valueStr)\r\n : valueStr;\r\n }\r\n\r\n /**\r\n * @param showOrHide true: show, false: hide\r\n */\r\n private _showDataInfo(showOrHide?: boolean) {\r\n // Always show when drgging.\r\n showOrHide = this._dragging || showOrHide;\r\n const displayables = this._displayables;\r\n const handleLabels = displayables.handleLabels;\r\n handleLabels[0].attr('invisible', !showOrHide);\r\n handleLabels[1].attr('invisible', !showOrHide);\r\n\r\n // Highlight move handle\r\n displayables.moveHandle\r\n && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\r\n }\r\n\r\n private _onDragMove(handleIndex: 0 | 1 | 'all', dx: number, dy: number, event: ZRElementEvent) {\r\n this._dragging = true;\r\n\r\n // For mobile device, prevent screen slider on the button.\r\n eventTool.stop(event.event);\r\n\r\n // Transform dx, dy to bar coordination.\r\n const barTransform = this._displayables.sliderGroup.getLocalTransform();\r\n const vertex = graphic.applyTransform([dx, dy], barTransform, true);\r\n\r\n const changed = this._updateInterval(handleIndex, vertex[0]);\r\n\r\n const realtime = this.dataZoomModel.get('realtime');\r\n\r\n this._updateView(!realtime);\r\n\r\n // Avoid dispatch dataZoom repeatly but range not changed,\r\n // which cause bad visual effect when progressive enabled.\r\n changed && realtime && this._dispatchZoomAction(true);\r\n }\r\n\r\n private _onDragEnd() {\r\n this._dragging = false;\r\n this._showDataInfo(false);\r\n\r\n // While in realtime mode and stream mode, dispatch action when\r\n // drag end will cause the whole view rerender, which is unnecessary.\r\n const realtime = this.dataZoomModel.get('realtime');\r\n !realtime && this._dispatchZoomAction(false);\r\n }\r\n\r\n private _onClickPanel(e: ZRElementEvent) {\r\n const size = this._size;\r\n const localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\r\n\r\n if (localPoint[0] < 0 || localPoint[0] > size[0]\r\n || localPoint[1] < 0 || localPoint[1] > size[1]\r\n ) {\r\n return;\r\n }\r\n\r\n const handleEnds = this._handleEnds;\r\n const center = (handleEnds[0] + handleEnds[1]) / 2;\r\n\r\n const changed = this._updateInterval('all', localPoint[0] - center);\r\n this._updateView();\r\n changed && this._dispatchZoomAction(false);\r\n }\r\n\r\n private _onBrushStart(e: ZRElementEvent) {\r\n const x = e.offsetX;\r\n const y = e.offsetY;\r\n this._brushStart = new graphic.Point(x, y);\r\n\r\n this._brushing = true;\r\n\r\n this._brushStartTime = +new Date();\r\n // this._updateBrushRect(x, y);\r\n }\r\n\r\n private _onBrushEnd(e: ZRElementEvent) {\r\n if (!this._brushing) {\r\n return;\r\n }\r\n\r\n const brushRect = this._displayables.brushRect;\r\n this._brushing = false;\r\n\r\n if (!brushRect) {\r\n return;\r\n }\r\n\r\n brushRect.attr('ignore', true);\r\n\r\n const brushShape = brushRect.shape;\r\n\r\n const brushEndTime = +new Date();\r\n // console.log(brushEndTime - this._brushStartTime);\r\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\r\n // Will treat it as a click\r\n return;\r\n }\r\n\r\n const viewExtend = this._getViewExtent();\r\n const percentExtent = [0, 100];\r\n\r\n this._range = asc([\r\n linearMap(brushShape.x, viewExtend, percentExtent, true),\r\n linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)\r\n ]);\r\n\r\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\r\n\r\n this._updateView();\r\n\r\n this._dispatchZoomAction(false);\r\n }\r\n\r\n private _onBrush(e: ZRElementEvent) {\r\n if (this._brushing) {\r\n // For mobile device, prevent screen slider on the button.\r\n eventTool.stop(e.event);\r\n\r\n this._updateBrushRect(e.offsetX, e.offsetY);\r\n }\r\n }\r\n\r\n private _updateBrushRect(mouseX: number, mouseY: number) {\r\n const displayables = this._displayables;\r\n const dataZoomModel = this.dataZoomModel;\r\n let brushRect = displayables.brushRect;\r\n if (!brushRect) {\r\n brushRect = displayables.brushRect = new Rect({\r\n silent: true,\r\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\r\n });\r\n displayables.sliderGroup.add(brushRect);\r\n }\r\n\r\n brushRect.attr('ignore', false);\r\n\r\n const brushStart = this._brushStart;\r\n\r\n const sliderGroup = this._displayables.sliderGroup;\r\n\r\n const endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\r\n const startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\r\n\r\n const size = this._size;\r\n\r\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\r\n\r\n brushRect.setShape({\r\n x: startPoint[0], y: 0,\r\n width: endPoint[0] - startPoint[0], height: size[1]\r\n });\r\n }\r\n\r\n /**\r\n * This action will be throttled.\r\n */\r\n _dispatchZoomAction(realtime: boolean) {\r\n const range = this._range;\r\n\r\n this.api.dispatchAction({\r\n type: 'dataZoom',\r\n from: this.uid,\r\n dataZoomId: this.dataZoomModel.id,\r\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\r\n start: range[0],\r\n end: range[1]\r\n });\r\n }\r\n\r\n private _findCoordRect() {\r\n // Find the grid corresponding to the first axis referred by dataZoom.\r\n let rect: RectLike;\r\n const coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\r\n\r\n if (!rect && coordSysInfoList.length) {\r\n const coordSys = coordSysInfoList[0].model.coordinateSystem;\r\n rect = coordSys.getRect && coordSys.getRect();\r\n }\r\n\r\n if (!rect) {\r\n const width = this.api.getWidth();\r\n const height = this.api.getHeight();\r\n rect = {\r\n x: width * 0.2,\r\n y: height * 0.2,\r\n width: width * 0.6,\r\n height: height * 0.6\r\n };\r\n }\r\n\r\n return rect;\r\n }\r\n\r\n}\r\n\r\nfunction getOtherDim(thisDim: 'x' | 'y' | 'radius' | 'angle' | 'single' | 'z') {\r\n // FIXME\r\n // \u8FD9\u4E2A\u903B\u8F91\u548CgetOtherAxis\u91CC\u4E00\u81F4\uFF0C\u4F46\u662F\u5199\u5728\u8FD9\u91CC\u662F\u5426\u4E0D\u597D\r\n const map = {x: 'y', y: 'x', radius: 'angle', angle: 'radius'};\r\n return map[thisDim as 'x' | 'y' | 'radius' | 'angle'];\r\n}\r\n\r\nfunction getCursor(orient: LayoutOrient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n}\r\n\r\nexport default SliderZoomView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport SliderZoomModel from './SliderZoomModel';\r\nimport SliderZoomView from './SliderZoomView';\r\nimport installCommon from './installCommon';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerComponentModel(SliderZoomModel);\r\n registers.registerComponentView(SliderZoomView);\r\n\r\n installCommon(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport {install as installDataZoomInside} from './installDataZoomInside';\r\nimport {install as installDataZoomSlider} from './installDataZoomSlider';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installDataZoomInside);\r\n use(installDataZoomSlider);\r\n\r\n // Do not install './dataZoomSelect',\r\n // since it only work for toolbox dataZoom.\r\n\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * @file Visual mapping.\r\n */\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\n\r\nconst visualDefault = {\r\n /**\r\n * @public\r\n */\r\n get: function (visualType: string, key: 'active' | 'inactive', isCategory?: boolean) {\r\n const value = zrUtil.clone(\r\n (defaultOption[visualType] || {})[key]\r\n );\r\n\r\n return isCategory\r\n ? (zrUtil.isArray(value) ? value[value.length - 1] : value)\r\n : value;\r\n }\r\n};\r\n\r\nconst defaultOption: {[key: string]: {\r\n active: string[] | number[]\r\n inactive: string[] | number[]\r\n}} = {\r\n\r\n color: {\r\n active: ['#006edd', '#e0ffff'],\r\n inactive: ['rgba(0,0,0,0)']\r\n },\r\n\r\n colorHue: {\r\n active: [0, 360],\r\n inactive: [0, 0]\r\n },\r\n\r\n colorSaturation: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n\r\n colorLightness: {\r\n active: [0.9, 0.5],\r\n inactive: [0, 0]\r\n },\r\n\r\n colorAlpha: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n\r\n opacity: {\r\n active: [0.3, 1],\r\n inactive: [0, 0]\r\n },\r\n\r\n symbol: {\r\n active: ['circle', 'roundRect', 'diamond'],\r\n inactive: ['none']\r\n },\r\n\r\n symbolSize: {\r\n active: [10, 50],\r\n inactive: [0, 0]\r\n }\r\n};\r\n\r\nexport default visualDefault;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport visualDefault from '../../visual/visualDefault';\r\nimport VisualMapping, { VisualMappingOption } from '../../visual/VisualMapping';\r\nimport * as visualSolution from '../../visual/visualSolution';\r\nimport * as modelUtil from '../../util/model';\r\nimport * as numberUtil from '../../util/number';\r\nimport {\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n LabelOption,\r\n ColorString,\r\n ZRColor,\r\n BorderOptionMixin,\r\n OptionDataValue,\r\n BuiltinVisualProperty,\r\n DimensionIndex\r\n} from '../../util/types';\r\nimport ComponentModel from '../../model/Component';\r\nimport Model from '../../model/Model';\r\nimport GlobalModel from '../../model/Global';\r\nimport SeriesModel from '../../model/Series';\r\nimport SeriesData from '../../data/SeriesData';\r\n\r\nconst mapVisual = VisualMapping.mapVisual;\r\nconst eachVisual = VisualMapping.eachVisual;\r\nconst isArray = zrUtil.isArray;\r\nconst each = zrUtil.each;\r\nconst asc = numberUtil.asc;\r\nconst linearMap = numberUtil.linearMap;\r\n\r\ntype VisualOptionBase = {[key in BuiltinVisualProperty]?: any};\r\n\r\ntype LabelFormatter = (min: OptionDataValue, max?: OptionDataValue) => string;\r\n\r\ntype VisualState = VisualMapModel['stateList'][number];\r\nexport interface VisualMapOption extends\r\n ComponentOption,\r\n BoxLayoutOptionMixin,\r\n BorderOptionMixin {\r\n\r\n mainType?: 'visualMap'\r\n\r\n show?: boolean\r\n\r\n align?: string\r\n\r\n realtime?: boolean\r\n /**\r\n * 'all' or null/undefined: all series.\r\n * A number or an array of number: the specified series.\r\n * set min: 0, max: 200, only for campatible with ec2.\r\n * In fact min max should not have default value.\r\n */\r\n seriesIndex?: 'all' | number[] | number\r\n\r\n /**\r\n * min value, must specified if pieces is not specified.\r\n */\r\n min?: number\r\n\r\n /**\r\n * max value, must specified if pieces is not specified.\r\n */\r\n max?: number\r\n /**\r\n * Dimension to be encoded\r\n */\r\n dimension?: number\r\n\r\n /**\r\n * Visual configuration for the data in selection\r\n */\r\n inRange?: T\r\n /**\r\n * Visual configuration for the out of selection\r\n */\r\n outOfRange?: T\r\n\r\n controller?: {\r\n inRange?: T\r\n outOfRange?: T\r\n }\r\n target?: {\r\n inRange?: T\r\n outOfRange?: T\r\n }\r\n\r\n /**\r\n * Width of the display item\r\n */\r\n itemWidth?: number\r\n /**\r\n * Height of the display item\r\n */\r\n itemHeight?: number\r\n\r\n inverse?: boolean\r\n\r\n orient?: 'horizontal' | 'vertical'\r\n\r\n backgroundColor?: ZRColor\r\n contentColor?: ZRColor\r\n\r\n inactiveColor?: ZRColor\r\n\r\n /**\r\n * Padding of the component. Can be an array similar to CSS\r\n */\r\n padding?: number[] | number\r\n /**\r\n * Gap between text and item\r\n */\r\n textGap?: number\r\n\r\n precision?: number\r\n\r\n /**\r\n * @deprecated\r\n * Option from version 2\r\n */\r\n color?: ColorString[]\r\n\r\n formatter?: string | LabelFormatter\r\n\r\n /**\r\n * Text on the both end. Such as ['High', 'Low']\r\n */\r\n text?: string[]\r\n\r\n textStyle?: LabelOption\r\n\r\n\r\n categories?: unknown\r\n}\r\n\r\nexport interface VisualMeta {\r\n stops: { value: number, color: ColorString}[]\r\n outerColors: ColorString[]\r\n\r\n dimension?: DimensionIndex\r\n}\r\n\r\nclass VisualMapModel extends ComponentModel {\r\n\r\n static type = 'visualMap';\r\n type = VisualMapModel.type;\r\n\r\n static readonly dependencies = ['series'];\r\n\r\n readonly stateList = ['inRange', 'outOfRange'] as const;\r\n\r\n readonly replacableOptionKeys = [\r\n 'inRange', 'outOfRange', 'target', 'controller', 'color'\r\n ] as const;\r\n\r\n readonly layoutMode = {\r\n type: 'box', ignoreSize: true\r\n } as const;\r\n\r\n /**\r\n * [lowerBound, upperBound]\r\n */\r\n dataBound = [-Infinity, Infinity];\r\n\r\n protected _dataExtent: [number, number];\r\n\r\n targetVisuals = {} as ReturnType;\r\n\r\n controllerVisuals = {} as ReturnType;\r\n\r\n textStyleModel: Model;\r\n\r\n itemSize: number[];\r\n\r\n init(option: Opts, parentModel: Model, ecModel: GlobalModel) {\r\n this.mergeDefaultAndTheme(option, ecModel);\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n optionUpdated(newOption: Opts, isInit?: boolean) {\r\n const thisOption = this.option;\r\n\r\n !isInit && visualSolution.replaceVisualOption(\r\n thisOption, newOption, this.replacableOptionKeys\r\n );\r\n\r\n this.textStyleModel = this.getModel('textStyle');\r\n\r\n this.resetItemSize();\r\n\r\n this.completeVisualOption();\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n resetVisual(\r\n supplementVisualOption: (this: this, mappingOption: VisualMappingOption, state: string) => void\r\n ) {\r\n const stateList = this.stateList;\r\n supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\r\n\r\n this.controllerVisuals = visualSolution.createVisualMappings(\r\n this.option.controller, stateList, supplementVisualOption\r\n );\r\n this.targetVisuals = visualSolution.createVisualMappings(\r\n this.option.target, stateList, supplementVisualOption\r\n );\r\n }\r\n\r\n /**\r\n * @public\r\n */\r\n getItemSymbol(): string {\r\n return null;\r\n }\r\n\r\n /**\r\n * @protected\r\n * @return {Array.} An array of series indices.\r\n */\r\n getTargetSeriesIndices() {\r\n const optionSeriesIndex = this.option.seriesIndex;\r\n let seriesIndices: number[] = [];\r\n\r\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\r\n this.ecModel.eachSeries(function (seriesModel, index) {\r\n seriesIndices.push(index);\r\n });\r\n }\r\n else {\r\n seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);\r\n }\r\n\r\n return seriesIndices;\r\n }\r\n\r\n /**\r\n * @public\r\n */\r\n eachTargetSeries(\r\n callback: (this: Ctx, series: SeriesModel) => void,\r\n context?: Ctx\r\n ) {\r\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\r\n const seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\r\n if (seriesModel) {\r\n callback.call(context, seriesModel);\r\n }\r\n }, this);\r\n }\r\n\r\n /**\r\n * @pubilc\r\n */\r\n isTargetSeries(seriesModel: SeriesModel) {\r\n let is = false;\r\n this.eachTargetSeries(function (model) {\r\n model === seriesModel && (is = true);\r\n });\r\n return is;\r\n }\r\n\r\n /**\r\n * @example\r\n * this.formatValueText(someVal); // format single numeric value to text.\r\n * this.formatValueText(someVal, true); // format single category value to text.\r\n * this.formatValueText([min, max]); // format numeric min-max to text.\r\n * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\r\n * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\r\n *\r\n * @param value Real value, or this.dataBound[0 or 1].\r\n * @param isCategory Only available when value is number.\r\n * @param edgeSymbols Open-close symbol when value is interval.\r\n * @protected\r\n */\r\n formatValueText(\r\n value: number | string | number[],\r\n isCategory?: boolean,\r\n edgeSymbols?: string[]\r\n ): string {\r\n const option = this.option;\r\n const precision = option.precision;\r\n const dataBound = this.dataBound;\r\n const formatter = option.formatter;\r\n let isMinMax: boolean;\r\n edgeSymbols = edgeSymbols || ['<', '>'] as [string, string];\r\n\r\n if (zrUtil.isArray(value)) {\r\n value = value.slice();\r\n isMinMax = true;\r\n }\r\n\r\n const textValue = isCategory\r\n ? value as string // Value is string when isCategory\r\n : (isMinMax\r\n ? [toFixed((value as number[])[0]), toFixed((value as number[])[1])]\r\n : toFixed(value as number)\r\n );\r\n\r\n if (zrUtil.isString(formatter)) {\r\n return formatter\r\n .replace('{value}', isMinMax ? (textValue as string[])[0] : textValue as string)\r\n .replace('{value2}', isMinMax ? (textValue as string[])[1] : textValue as string);\r\n }\r\n else if (zrUtil.isFunction(formatter)) {\r\n return isMinMax\r\n ? formatter((value as number[])[0], (value as number[])[1])\r\n : formatter(value as number);\r\n }\r\n\r\n if (isMinMax) {\r\n if ((value as number[])[0] === dataBound[0]) {\r\n return edgeSymbols[0] + ' ' + textValue[1];\r\n }\r\n else if ((value as number[])[1] === dataBound[1]) {\r\n return edgeSymbols[1] + ' ' + textValue[0];\r\n }\r\n else {\r\n return textValue[0] + ' - ' + textValue[1];\r\n }\r\n }\r\n else { // Format single value (includes category case).\r\n return textValue as string;\r\n }\r\n\r\n function toFixed(val: number) {\r\n return val === dataBound[0]\r\n ? 'min'\r\n : val === dataBound[1]\r\n ? 'max'\r\n : (+val).toFixed(Math.min(precision, 20));\r\n }\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n resetExtent() {\r\n const thisOption = this.option;\r\n\r\n // Can not calculate data extent by data here.\r\n // Because series and data may be modified in processing stage.\r\n // So we do not support the feature \"auto min/max\".\r\n\r\n const extent = asc([thisOption.min, thisOption.max] as [number, number]);\r\n\r\n this._dataExtent = extent;\r\n }\r\n\r\n /**\r\n * PENDING:\r\n * delete this method if no outer usage.\r\n *\r\n * Return Concrete dimension. If null/undefined is returned, no dimension is used.\r\n */\r\n // getDataDimension(data: SeriesData) {\r\n // const optDim = this.option.dimension;\r\n\r\n // if (optDim != null) {\r\n // return data.getDimension(optDim);\r\n // }\r\n\r\n // const dimNames = data.dimensions;\r\n // for (let i = dimNames.length - 1; i >= 0; i--) {\r\n // const dimName = dimNames[i];\r\n // const dimInfo = data.getDimensionInfo(dimName);\r\n // if (!dimInfo.isCalculationCoord) {\r\n // return dimName;\r\n // }\r\n // }\r\n // }\r\n\r\n getDataDimensionIndex(data: SeriesData): DimensionIndex {\r\n const optDim = this.option.dimension;\r\n\r\n if (optDim != null) {\r\n return data.getDimensionIndex(optDim);\r\n }\r\n\r\n const dimNames = data.dimensions;\r\n for (let i = dimNames.length - 1; i >= 0; i--) {\r\n const dimName = dimNames[i];\r\n const dimInfo = data.getDimensionInfo(dimName);\r\n if (!dimInfo.isCalculationCoord) {\r\n return dimInfo.storeDimIndex;\r\n }\r\n }\r\n }\r\n\r\n getExtent() {\r\n return this._dataExtent.slice() as [number, number];\r\n }\r\n\r\n completeVisualOption() {\r\n\r\n const ecModel = this.ecModel;\r\n const thisOption = this.option;\r\n const base = {\r\n inRange: thisOption.inRange,\r\n outOfRange: thisOption.outOfRange\r\n };\r\n\r\n const target = thisOption.target || (thisOption.target = {});\r\n const controller = thisOption.controller || (thisOption.controller = {});\r\n\r\n zrUtil.merge(target, base); // Do not override\r\n zrUtil.merge(controller, base); // Do not override\r\n\r\n const isCategory = this.isCategory();\r\n\r\n completeSingle.call(this, target);\r\n completeSingle.call(this, controller);\r\n completeInactive.call(this, target, 'inRange', 'outOfRange');\r\n // completeInactive.call(this, target, 'outOfRange', 'inRange');\r\n completeController.call(this, controller);\r\n\r\n function completeSingle(this: VisualMapModel, base: VisualMapOption['target']) {\r\n // Compatible with ec2 dataRange.color.\r\n // The mapping order of dataRange.color is: [high value, ..., low value]\r\n // whereas inRange.color and outOfRange.color is [low value, ..., high value]\r\n // Notice: ec2 has no inverse.\r\n if (isArray(thisOption.color)\r\n // If there has been inRange: {symbol: ...}, adding color is a mistake.\r\n // So adding color only when no inRange defined.\r\n && !base.inRange\r\n ) {\r\n base.inRange = {color: thisOption.color.slice().reverse()};\r\n }\r\n\r\n // Compatible with previous logic, always give a default color, otherwise\r\n // simple config with no inRange and outOfRange will not work.\r\n // Originally we use visualMap.color as the default color, but setOption at\r\n // the second time the default color will be erased. So we change to use\r\n // constant DEFAULT_COLOR.\r\n // If user do not want the default color, set inRange: {color: null}.\r\n base.inRange = base.inRange || {color: ecModel.get('gradientColor')};\r\n }\r\n\r\n function completeInactive(\r\n this: VisualMapModel,\r\n base: VisualMapOption['target'],\r\n stateExist: VisualState,\r\n stateAbsent: VisualState\r\n ) {\r\n const optExist = base[stateExist];\r\n let optAbsent = base[stateAbsent];\r\n\r\n if (optExist && !optAbsent) {\r\n optAbsent = base[stateAbsent] = {};\r\n each(optExist, function (visualData, visualType: BuiltinVisualProperty) {\r\n if (!VisualMapping.isValidType(visualType)) {\r\n return;\r\n }\r\n\r\n const defa = visualDefault.get(visualType, 'inactive', isCategory);\r\n\r\n if (defa != null) {\r\n optAbsent[visualType] = defa;\r\n\r\n // Compatibable with ec2:\r\n // Only inactive color to rgba(0,0,0,0) can not\r\n // make label transparent, so use opacity also.\r\n if (visualType === 'color'\r\n && !optAbsent.hasOwnProperty('opacity')\r\n && !optAbsent.hasOwnProperty('colorAlpha')\r\n ) {\r\n optAbsent.opacity = [0, 0];\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n function completeController(this: VisualMapModel, controller?: VisualMapOption['controller']) {\r\n const symbolExists = (controller.inRange || {}).symbol\r\n || (controller.outOfRange || {}).symbol;\r\n const symbolSizeExists = (controller.inRange || {}).symbolSize\r\n || (controller.outOfRange || {}).symbolSize;\r\n const inactiveColor = this.get('inactiveColor');\r\n const itemSymbol = this.getItemSymbol();\r\n const defaultSymbol = itemSymbol || 'roundRect';\r\n\r\n each(this.stateList, function (state: VisualState) {\r\n\r\n const itemSize = this.itemSize;\r\n let visuals = controller[state];\r\n\r\n // Set inactive color for controller if no other color\r\n // attr (like colorAlpha) specified.\r\n if (!visuals) {\r\n visuals = controller[state] = {\r\n color: isCategory ? inactiveColor : [inactiveColor]\r\n };\r\n }\r\n\r\n // Consistent symbol and symbolSize if not specified.\r\n if (visuals.symbol == null) {\r\n visuals.symbol = symbolExists\r\n && zrUtil.clone(symbolExists)\r\n || (isCategory ? defaultSymbol : [defaultSymbol]);\r\n }\r\n if (visuals.symbolSize == null) {\r\n visuals.symbolSize = symbolSizeExists\r\n && zrUtil.clone(symbolSizeExists)\r\n || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\r\n }\r\n\r\n // Filter none\r\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\r\n return symbol === 'none' ? defaultSymbol : symbol;\r\n });\r\n\r\n // Normalize symbolSize\r\n const symbolSize = visuals.symbolSize;\r\n\r\n if (symbolSize != null) {\r\n let max = -Infinity;\r\n // symbolSize can be object when categories defined.\r\n eachVisual(symbolSize, function (value) {\r\n value > max && (max = value);\r\n });\r\n visuals.symbolSize = mapVisual(symbolSize, function (value) {\r\n return linearMap(value, [0, max], [0, itemSize[0]], true);\r\n });\r\n }\r\n\r\n }, this);\r\n }\r\n }\r\n\r\n resetItemSize() {\r\n this.itemSize = [\r\n parseFloat(this.get('itemWidth') as unknown as string),\r\n parseFloat(this.get('itemHeight') as unknown as string)\r\n ];\r\n }\r\n\r\n isCategory() {\r\n return !!this.option.categories;\r\n }\r\n\r\n /**\r\n * @public\r\n * @abstract\r\n */\r\n setSelected(selected?: any) {}\r\n\r\n getSelected(): any {\r\n return null;\r\n }\r\n\r\n /**\r\n * @public\r\n * @abstract\r\n */\r\n getValueState(value: any): VisualMapModel['stateList'][number] {\r\n return null;\r\n }\r\n\r\n /**\r\n * FIXME\r\n * Do not publish to thirt-part-dev temporarily\r\n * util the interface is stable. (Should it return\r\n * a function but not visual meta?)\r\n *\r\n * @pubilc\r\n * @abstract\r\n * @param getColorVisual\r\n * params: value, valueState\r\n * return: color\r\n * @return {Object} visualMeta\r\n * should includes {stops, outerColors}\r\n * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\r\n */\r\n getVisualMeta(getColorVisual: (value: number, valueState: VisualState) => string): VisualMeta {\r\n return null;\r\n }\r\n\r\n\r\n static defaultOption: VisualMapOption = {\r\n show: true,\r\n\r\n // zlevel: 0,\r\n z: 4,\r\n\r\n seriesIndex: 'all',\r\n\r\n min: 0,\r\n max: 200,\r\n\r\n left: 0,\r\n right: null,\r\n top: null,\r\n bottom: 0,\r\n\r\n itemWidth: null,\r\n itemHeight: null,\r\n inverse: false,\r\n orient: 'vertical', // 'horizontal' \u00A6 'vertical'\r\n\r\n backgroundColor: 'rgba(0,0,0,0)',\r\n borderColor: '#ccc', // \u503C\u57DF\u8FB9\u6846\u989C\u8272\r\n contentColor: '#5793f3',\r\n inactiveColor: '#aaa',\r\n borderWidth: 0,\r\n padding: 5,\r\n // \u63A5\u53D7\u6570\u7EC4\u5206\u522B\u8BBE\u5B9A\u4E0A\u53F3\u4E0B\u5DE6\u8FB9\u8DDD\uFF0C\u540Ccss\r\n textGap: 10, //\r\n precision: 0, // \u5C0F\u6570\u7CBE\u5EA6\uFF0C\u9ED8\u8BA4\u4E3A0\uFF0C\u65E0\u5C0F\u6570\u70B9\r\n\r\n textStyle: {\r\n color: '#333' // \u503C\u57DF\u6587\u5B57\u989C\u8272\r\n }\r\n };\r\n}\r\n\r\nexport default VisualMapModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport VisualMapModel, { VisualMapOption, VisualMeta } from './VisualMapModel';\r\nimport * as numberUtil from '../../util/number';\r\nimport { VisualMappingOption } from '../../visual/VisualMapping';\r\nimport { inheritDefaultOption } from '../../util/component';\r\nimport { ItemStyleOption } from '../../util/types';\r\n\r\n// Constant\r\nconst DEFAULT_BAR_BOUND = [20, 140];\r\n\r\ntype RangeWithAuto = {\r\n auto?: 0 | 1\r\n};\r\n\r\ntype VisualState = VisualMapModel['stateList'][number];\r\n\r\nexport interface ContinousVisualMapOption extends VisualMapOption {\r\n\r\n align?: 'auto' | 'left' | 'right' | 'top' | 'bottom'\r\n\r\n /**\r\n * This prop effect default component type determine\r\n * @see echarts/component/visualMap/typeDefaulter.\r\n */\r\n calculable?: boolean\r\n\r\n /**\r\n * selected range. In default case `range` is [min, max]\r\n * and can auto change along with modification of min max,\r\n * until user specified a range.\r\n */\r\n range?: number[]\r\n /**\r\n * Whether to enable hover highlight.\r\n */\r\n hoverLink?: boolean\r\n\r\n /**\r\n * The extent of hovered data.\r\n */\r\n hoverLinkDataSize?: number\r\n /**\r\n * Whether trigger hoverLink when hover handle.\r\n * If not specified, follow the value of `realtime`.\r\n */\r\n hoverLinkOnHandle?: boolean,\r\n\r\n handleIcon?: string,\r\n // Percent of the item width\r\n handleSize?: string | number,\r\n handleStyle?: ItemStyleOption\r\n\r\n indicatorIcon?: string,\r\n // Percent of the item width\r\n indicatorSize?: string | number,\r\n indicatorStyle?: ItemStyleOption\r\n\r\n emphasis?: {\r\n handleStyle?: ItemStyleOption\r\n }\r\n}\r\n\r\nclass ContinuousModel extends VisualMapModel {\r\n\r\n static type = 'visualMap.continuous' as const;\r\n type = ContinuousModel.type;\r\n\r\n /**\r\n * @override\r\n */\r\n optionUpdated(newOption: ContinousVisualMapOption, isInit: boolean) {\r\n super.optionUpdated.apply(this, arguments as any);\r\n\r\n this.resetExtent();\r\n\r\n this.resetVisual(function (mappingOption?: VisualMappingOption) {\r\n mappingOption.mappingMethod = 'linear';\r\n mappingOption.dataExtent = this.getExtent();\r\n });\r\n\r\n this._resetRange();\r\n }\r\n\r\n /**\r\n * @protected\r\n * @override\r\n */\r\n resetItemSize() {\r\n super.resetItemSize.apply(this, arguments as any);\r\n\r\n const itemSize = this.itemSize;\r\n\r\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\r\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n _resetRange() {\r\n const dataExtent = this.getExtent();\r\n const range = this.option.range;\r\n\r\n if (!range || (range as RangeWithAuto).auto) {\r\n // `range` should always be array (so we don't use other\r\n // value like 'auto') for user-friend. (consider getOption).\r\n (dataExtent as RangeWithAuto).auto = 1;\r\n this.option.range = dataExtent;\r\n }\r\n else if (zrUtil.isArray(range)) {\r\n if (range[0] > range[1]) {\r\n range.reverse();\r\n }\r\n range[0] = Math.max(range[0], dataExtent[0]);\r\n range[1] = Math.min(range[1], dataExtent[1]);\r\n }\r\n }\r\n\r\n /**\r\n * @protected\r\n * @override\r\n */\r\n completeVisualOption() {\r\n super.completeVisualOption.apply(this, arguments as any);\r\n\r\n zrUtil.each(this.stateList, function (state: VisualState) {\r\n const symbolSize = this.option.controller[state].symbolSize;\r\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\r\n symbolSize[0] = symbolSize[1] / 3; // For good looking.\r\n }\r\n }, this);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n setSelected(selected: number[]) {\r\n this.option.range = selected.slice();\r\n this._resetRange();\r\n }\r\n\r\n /**\r\n * @public\r\n */\r\n getSelected(): [number, number] {\r\n const dataExtent = this.getExtent();\r\n\r\n const dataInterval = numberUtil.asc(\r\n (this.get('range') || []).slice()\r\n ) as [number, number];\r\n\r\n // Clamp\r\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\r\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\r\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\r\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\r\n\r\n return dataInterval;\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getValueState(value: number): VisualState {\r\n const range = this.option.range;\r\n const dataExtent = this.getExtent();\r\n\r\n // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.\r\n // range[1] is processed likewise.\r\n return (\r\n (range[0] <= dataExtent[0] || range[0] <= value)\r\n && (range[1] >= dataExtent[1] || value <= range[1])\r\n ) ? 'inRange' : 'outOfRange';\r\n }\r\n\r\n findTargetDataIndices(range: number[]) {\r\n type DataIndices = {\r\n seriesId: string\r\n dataIndex: number[]\r\n };\r\n const result: DataIndices[] = [];\r\n\r\n this.eachTargetSeries(function (seriesModel) {\r\n const dataIndices: number[] = [];\r\n const data = seriesModel.getData();\r\n\r\n data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\r\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\r\n }, this);\r\n\r\n result.push({\r\n seriesId: seriesModel.id,\r\n dataIndex: dataIndices\r\n });\r\n }, this);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * @implement\r\n */\r\n getVisualMeta(\r\n getColorVisual: (value: number, valueState: VisualState) => string\r\n ) {\r\n type ColorStop = VisualMeta['stops'][number];\r\n const oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\r\n const iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\r\n const stops: ColorStop[] = [];\r\n\r\n function setStop(value: number, valueState: VisualState) {\r\n stops.push({\r\n value: value,\r\n color: getColorVisual(value, valueState)\r\n });\r\n }\r\n\r\n // Format to: outOfRange -- inRange -- outOfRange.\r\n let iIdx = 0;\r\n let oIdx = 0;\r\n const iLen = iVals.length;\r\n const oLen = oVals.length;\r\n\r\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\r\n // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.\r\n if (oVals[oIdx] < iVals[iIdx]) {\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n for (let first = 1; iIdx < iLen; iIdx++, first = 0) {\r\n // If range is full, value beyond min, max will be clamped.\r\n // make a singularity\r\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\r\n setStop(iVals[iIdx], 'inRange');\r\n }\r\n for (let first = 1; oIdx < oLen; oIdx++) {\r\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\r\n // make a singularity\r\n if (first) {\r\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\r\n first = 0;\r\n }\r\n setStop(oVals[oIdx], 'outOfRange');\r\n }\r\n }\r\n\r\n const stopsLen = stops.length;\r\n\r\n return {\r\n stops: stops,\r\n outerColors: [\r\n stopsLen ? stops[0].color : 'transparent',\r\n stopsLen ? stops[stopsLen - 1].color : 'transparent'\r\n ] as VisualMeta['outerColors']\r\n };\r\n }\r\n\r\n static defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n align: 'auto', // 'auto', 'left', 'right', 'top', 'bottom'\r\n calculable: false,\r\n hoverLink: true,\r\n realtime: true,\r\n\r\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\r\n handleSize: '120%',\r\n\r\n handleStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 1\r\n },\r\n\r\n indicatorIcon: 'circle',\r\n indicatorSize: '50%',\r\n indicatorStyle: {\r\n borderColor: '#fff',\r\n borderWidth: 2,\r\n shadowBlur: 2,\r\n shadowOffsetX: 1,\r\n shadowOffsetY: 1,\r\n shadowColor: 'rgba(0,0,0,0.2)'\r\n }\r\n // emphasis: {\r\n // handleStyle: {\r\n // shadowBlur: 3,\r\n // shadowOffsetX: 1,\r\n // shadowOffsetY: 1,\r\n // shadowColor: 'rgba(0,0,0,0.2)'\r\n // }\r\n // }\r\n }) as ContinousVisualMapOption;\r\n}\r\n\r\n\r\nfunction getColorStopValues(\r\n visualMapModel: ContinuousModel,\r\n valueState: VisualState,\r\n dataExtent: number[]\r\n) {\r\n if (dataExtent[0] === dataExtent[1]) {\r\n return dataExtent.slice();\r\n }\r\n\r\n // When using colorHue mapping, it is not linear color any more.\r\n // Moreover, canvas gradient seems not to be accurate linear.\r\n // FIXME\r\n // Should be arbitrary value 100? or based on pixel size?\r\n const count = 200;\r\n const step = (dataExtent[1] - dataExtent[0]) / count;\r\n\r\n let value = dataExtent[0];\r\n const stopValues = [];\r\n for (let i = 0; i <= count && value < dataExtent[1]; i++) {\r\n stopValues.push(value);\r\n value += step;\r\n }\r\n stopValues.push(dataExtent[1]);\r\n\r\n return stopValues;\r\n}\r\n\r\nexport default ContinuousModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {Group, Rect} from '../../util/graphic';\r\nimport * as formatUtil from '../../util/format';\r\nimport * as layout from '../../util/layout';\r\nimport VisualMapping from '../../visual/VisualMapping';\r\nimport ComponentView from '../../view/Component';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport VisualMapModel from './VisualMapModel';\r\nimport { VisualOptionUnit, ColorString } from '../../util/types';\r\n\r\ntype VisualState = VisualMapModel['stateList'][number];\r\n\r\nclass VisualMapView extends ComponentView {\r\n static type = 'visualMap';\r\n type = VisualMapView.type;\r\n\r\n autoPositionValues = {left: 1, right: 1, top: 1, bottom: 1} as const;\r\n\r\n ecModel: GlobalModel;\r\n\r\n api: ExtensionAPI;\r\n\r\n visualMapModel: VisualMapModel;\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n this.ecModel = ecModel;\r\n this.api = api;\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n render(\r\n visualMapModel: VisualMapModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: unknown // TODO: TYPE\r\n ) {\r\n this.visualMapModel = visualMapModel;\r\n\r\n if (visualMapModel.get('show') === false) {\r\n this.group.removeAll();\r\n return;\r\n }\r\n\r\n this.doRender(visualMapModel, ecModel, api, payload);\r\n }\r\n\r\n /**\r\n * @protected\r\n */\r\n renderBackground(group: Group) {\r\n const visualMapModel = this.visualMapModel;\r\n const padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\r\n const rect = group.getBoundingRect();\r\n\r\n group.add(new Rect({\r\n z2: -1, // Lay background rect on the lowest layer.\r\n silent: true,\r\n shape: {\r\n x: rect.x - padding[3],\r\n y: rect.y - padding[0],\r\n width: rect.width + padding[3] + padding[1],\r\n height: rect.height + padding[0] + padding[2]\r\n },\r\n style: {\r\n fill: visualMapModel.get('backgroundColor'),\r\n stroke: visualMapModel.get('borderColor'),\r\n lineWidth: visualMapModel.get('borderWidth')\r\n }\r\n }));\r\n }\r\n\r\n /**\r\n * @protected\r\n * @param targetValue can be Infinity or -Infinity\r\n * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\r\n * @param opts\r\n * @param opts.forceState Specify state, instead of using getValueState method.\r\n * @param opts.convertOpacityToAlpha For color gradient in controller widget.\r\n * @return {*} Visual value.\r\n */\r\n protected getControllerVisual(\r\n targetValue: number,\r\n visualCluster: 'color' | 'opacity' | 'symbol' | 'symbolSize',\r\n opts?: {\r\n forceState?: VisualState\r\n convertOpacityToAlpha?: boolean\r\n }\r\n ) {\r\n\r\n opts = opts || {};\r\n\r\n const forceState = opts.forceState;\r\n const visualMapModel = this.visualMapModel;\r\n const visualObj: {[key in typeof visualCluster]?: VisualOptionUnit[key]} = {};\r\n\r\n // Default values.\r\n if (visualCluster === 'color') {\r\n const defaultColor = visualMapModel.get('contentColor');\r\n visualObj.color = defaultColor as ColorString;\r\n }\r\n\r\n function getter(key: typeof visualCluster) {\r\n return visualObj[key];\r\n }\r\n\r\n function setter(key: typeof visualCluster, value: any) {\r\n (visualObj as any)[key] = value;\r\n }\r\n\r\n const mappings = visualMapModel.controllerVisuals[\r\n forceState || visualMapModel.getValueState(targetValue)\r\n ];\r\n const visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n\r\n zrUtil.each(visualTypes, function (type) {\r\n let visualMapping = mappings[type];\r\n if (opts.convertOpacityToAlpha && type === 'opacity') {\r\n type = 'colorAlpha';\r\n visualMapping = mappings.__alphaForOpacity;\r\n }\r\n if (VisualMapping.dependsOn(type, visualCluster)) {\r\n visualMapping && visualMapping.applyVisual(\r\n targetValue, getter, setter\r\n );\r\n }\r\n });\r\n\r\n return visualObj[visualCluster];\r\n }\r\n\r\n protected positionGroup(group: Group) {\r\n const model = this.visualMapModel;\r\n const api = this.api;\r\n\r\n layout.positionElement(\r\n group,\r\n model.getBoxLayoutParams(),\r\n {width: api.getWidth(), height: api.getHeight()}\r\n );\r\n }\r\n\r\n protected doRender(\r\n visualMapModel: VisualMapModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: unknown\r\n ) {}\r\n}\r\n\r\nexport default VisualMapView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport {getLayoutRect} from '../../util/layout';\r\nimport VisualMapModel from './VisualMapModel';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport { Payload } from '../../util/types';\r\n\r\nconst paramsSet = [\r\n ['left', 'right', 'width'],\r\n ['top', 'bottom', 'height']\r\n] as const;\r\nexport type ItemHorizontalAlign = typeof paramsSet[0][number];\r\nexport type ItemVerticalAlign = typeof paramsSet[1][number];\r\nexport type ItemAlign = ItemVerticalAlign | ItemHorizontalAlign;\r\n\r\n/**\r\n * @param visualMapModel\r\n * @param api\r\n * @param itemSize always [short, long]\r\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\r\n */\r\nexport function getItemAlign(\r\n visualMapModel: VisualMapModel,\r\n api: ExtensionAPI,\r\n itemSize: number[]\r\n): ItemAlign {\r\n const modelOption = visualMapModel.option;\r\n const itemAlign = modelOption.align;\r\n\r\n if (itemAlign != null && itemAlign !== 'auto') {\r\n return itemAlign as ItemAlign;\r\n }\r\n\r\n // Auto decision align.\r\n const ecSize = {width: api.getWidth(), height: api.getHeight()};\r\n const realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\r\n\r\n const reals = paramsSet[realIndex];\r\n const fakeValue = [0, null, 10];\r\n\r\n const layoutInput = {} as Record;\r\n for (let i = 0; i < 3; i++) {\r\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\r\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\r\n }\r\n\r\n const rParam = ([['x', 'width', 3], ['y', 'height', 0]] as const)[realIndex];\r\n const rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\r\n\r\n return reals[\r\n (rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5\r\n < ecSize[rParam[1]] * 0.5 ? 0 : 1\r\n ];\r\n}\r\n\r\n/**\r\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\r\n * dataIndexInside means filtered index.\r\n */\r\n\r\n // TODO: TYPE more specified payload types.\r\nexport function makeHighDownBatch(batch: Payload['batch'], visualMapModel: VisualMapModel): Payload['batch'] {\r\n zrUtil.each(batch || [], function (batchItem) {\r\n if (batchItem.dataIndex != null) {\r\n batchItem.dataIndexInside = batchItem.dataIndex;\r\n batchItem.dataIndex = null;\r\n }\r\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\r\n });\r\n return batch;\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport LinearGradient, { LinearGradientObject } from 'zrender/src/graphic/LinearGradient';\r\nimport * as eventTool from 'zrender/src/core/event';\r\nimport VisualMapView from './VisualMapView';\r\nimport * as graphic from '../../util/graphic';\r\nimport * as numberUtil from '../../util/number';\r\nimport sliderMove from '../helper/sliderMove';\r\nimport * as helper from './helper';\r\nimport * as modelUtil from '../../util/model';\r\nimport VisualMapModel from './VisualMapModel';\r\nimport ContinuousModel from './ContinuousModel';\r\nimport GlobalModel from '../../model/Global';\r\nimport ExtensionAPI from '../../core/ExtensionAPI';\r\nimport Element, { ElementEvent } from 'zrender/src/Element';\r\nimport { TextVerticalAlign, TextAlign } from 'zrender/src/core/types';\r\nimport { ColorString, Payload, VerticalAlign } from '../../util/types';\r\nimport { parsePercent } from 'zrender/src/contain/text';\r\nimport { setAsHighDownDispatcher } from '../../util/states';\r\nimport { createSymbol } from '../../util/symbol';\r\nimport ZRImage from 'zrender/src/graphic/Image';\r\nimport { ECData, getECData } from '../../util/innerStore';\r\nimport { createTextStyle } from '../../label/labelStyle';\r\nimport { findEventDispatcher } from '../../util/event';\r\n\r\nconst linearMap = numberUtil.linearMap;\r\nconst each = zrUtil.each;\r\nconst mathMin = Math.min;\r\nconst mathMax = Math.max;\r\n\r\n// Arbitrary value\r\nconst HOVER_LINK_SIZE = 12;\r\nconst HOVER_LINK_OUT = 6;\r\n\r\ntype Orient = VisualMapModel['option']['orient'];\r\n\r\ntype ShapeStorage = {\r\n handleThumbs: graphic.Path[]\r\n handleLabelPoints: number[][]\r\n handleLabels: graphic.Text[]\r\n\r\n inRange: graphic.Polygon\r\n outOfRange: graphic.Polygon\r\n\r\n mainGroup: graphic.Group\r\n\r\n indicator: graphic.Path\r\n indicatorLabel: graphic.Text\r\n indicatorLabelPoint: number[]\r\n};\r\n\r\ntype TargetDataIndices = ReturnType;\r\n\r\ntype BarVisual = {\r\n barColor: LinearGradient,\r\n barPoints: number[][]\r\n handlesColor: ColorString[]\r\n};\r\n\r\ntype Direction = 'left' | 'right' | 'top' | 'bottom';\r\n// Notice:\r\n// Any \"interval\" should be by the order of [low, high].\r\n// \"handle0\" (handleIndex === 0) maps to\r\n// low data value: this._dataInterval[0] and has low coord.\r\n// \"handle1\" (handleIndex === 1) maps to\r\n// high data value: this._dataInterval[1] and has high coord.\r\n// The logic of transform is implemented in this._createBarGroup.\r\n\r\nclass ContinuousView extends VisualMapView {\r\n static type = 'visualMap.continuous';\r\n type = ContinuousView.type;\r\n\r\n visualMapModel: ContinuousModel;\r\n\r\n private _shapes = {} as ShapeStorage;\r\n\r\n private _dataInterval: number[] = [];\r\n\r\n private _handleEnds: number[] = [];\r\n\r\n private _orient: Orient;\r\n\r\n private _useHandle: boolean;\r\n\r\n private _hoverLinkDataIndices: TargetDataIndices = [];\r\n\r\n private _dragging: boolean;\r\n\r\n private _hovering: boolean;\r\n\r\n private _firstShowIndicator: boolean;\r\n\r\n init(ecModel: GlobalModel, api: ExtensionAPI) {\r\n super.init(ecModel, api);\r\n\r\n this._hoverLinkFromSeriesMouseOver = zrUtil.bind(this._hoverLinkFromSeriesMouseOver, this);\r\n this._hideIndicator = zrUtil.bind(this._hideIndicator, this);\r\n }\r\n\r\n doRender(\r\n visualMapModel: ContinuousModel,\r\n ecModel: GlobalModel,\r\n api: ExtensionAPI,\r\n payload: {type: string, from: string}\r\n ) {\r\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\r\n this._buildView();\r\n }\r\n }\r\n\r\n private _buildView() {\r\n this.group.removeAll();\r\n\r\n const visualMapModel = this.visualMapModel;\r\n const thisGroup = this.group;\r\n\r\n this._orient = visualMapModel.get('orient');\r\n this._useHandle = visualMapModel.get('calculable');\r\n\r\n this._resetInterval();\r\n\r\n this._renderBar(thisGroup);\r\n\r\n const dataRangeText = visualMapModel.get('text');\r\n this._renderEndsText(thisGroup, dataRangeText, 0);\r\n this._renderEndsText(thisGroup, dataRangeText, 1);\r\n\r\n // Do this for background size calculation.\r\n this._updateView(true);\r\n\r\n // After updating view, inner shapes is built completely,\r\n // and then background can be rendered.\r\n this.renderBackground(thisGroup);\r\n\r\n // Real update view\r\n this._updateView();\r\n\r\n this._enableHoverLinkToSeries();\r\n this._enableHoverLinkFromSeries();\r\n\r\n this.positionGroup(thisGroup);\r\n }\r\n\r\n private _renderEndsText(group: graphic.Group, dataRangeText: string[], endsIndex?: 0 | 1) {\r\n if (!dataRangeText) {\r\n return;\r\n }\r\n\r\n // Compatible with ec2, text[0] map to high value, text[1] map low value.\r\n let text = dataRangeText[1 - endsIndex];\r\n text = text != null ? text + '' : '';\r\n\r\n const visualMapModel = this.visualMapModel;\r\n const textGap = visualMapModel.get('textGap');\r\n const itemSize = visualMapModel.itemSize;\r\n\r\n const barGroup = this._shapes.mainGroup;\r\n const position = this._applyTransform(\r\n [\r\n itemSize[0] / 2,\r\n endsIndex === 0 ? -textGap : itemSize[1] + textGap\r\n ],\r\n barGroup\r\n ) as number[];\r\n const align = this._applyTransform(\r\n endsIndex === 0 ? 'bottom' : 'top',\r\n barGroup\r\n );\r\n const orient = this._orient;\r\n const textStyleModel = this.visualMapModel.textStyleModel;\r\n\r\n this.group.add(new graphic.Text({\r\n style: createTextStyle(textStyleModel, {\r\n x: position[0],\r\n y: position[1],\r\n verticalAlign: orient === 'horizontal' ? 'middle' : align as TextVerticalAlign,\r\n align: orient === 'horizontal' ? align as TextAlign : 'center',\r\n text\r\n })\r\n }));\r\n }\r\n\r\n private _renderBar(targetGroup: graphic.Group) {\r\n const visualMapModel = this.visualMapModel;\r\n const shapes = this._shapes;\r\n const itemSize = visualMapModel.itemSize;\r\n const orient = this._orient;\r\n const useHandle = this._useHandle;\r\n const itemAlign = helper.getItemAlign(visualMapModel, this.api, itemSize);\r\n const mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\r\n\r\n const gradientBarGroup = new graphic.Group();\r\n mainGroup.add(gradientBarGroup);\r\n\r\n // Bar\r\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\r\n gradientBarGroup.add(shapes.inRange = createPolygon(\r\n null,\r\n useHandle ? getCursor(this._orient) : null,\r\n zrUtil.bind(this._dragHandle, this, 'all', false),\r\n zrUtil.bind(this._dragHandle, this, 'all', true)\r\n ));\r\n\r\n // A border radius clip.\r\n gradientBarGroup.setClipPath(new graphic.Rect({\r\n shape: {\r\n x: 0,\r\n y: 0,\r\n width: itemSize[0],\r\n height: itemSize[1],\r\n r: 3\r\n }\r\n }));\r\n\r\n const textRect = visualMapModel.textStyleModel.getTextRect('\u56FD');\r\n const textSize = mathMax(textRect.width, textRect.height);\r\n\r\n // Handle\r\n if (useHandle) {\r\n shapes.handleThumbs = [];\r\n shapes.handleLabels = [];\r\n shapes.handleLabelPoints = [];\r\n\r\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\r\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\r\n }\r\n\r\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\r\n\r\n targetGroup.add(mainGroup);\r\n }\r\n\r\n private _createHandle(\r\n visualMapModel: ContinuousModel,\r\n mainGroup: graphic.Group,\r\n handleIndex: 0 | 1,\r\n itemSize: number[],\r\n textSize: number,\r\n orient: Orient\r\n ) {\r\n const onDrift = zrUtil.bind(this._dragHandle, this, handleIndex, false);\r\n const onDragEnd = zrUtil.bind(this._dragHandle, this, handleIndex, true);\r\n const handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\r\n const handleThumb = createSymbol(\r\n visualMapModel.get('handleIcon'),\r\n -handleSize / 2, -handleSize / 2, handleSize, handleSize,\r\n null, true\r\n );\r\n const cursor = getCursor(this._orient);\r\n handleThumb.attr({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n ondragend: onDragEnd,\r\n onmousemove(e) {\r\n eventTool.stop(e.event);\r\n }\r\n });\r\n handleThumb.x = itemSize[0] / 2;\r\n\r\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\r\n (handleThumb as graphic.Path).setStyle({\r\n strokeNoScale: true,\r\n strokeFirst: true\r\n });\r\n (handleThumb as graphic.Path).style.lineWidth *= 2;\r\n\r\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\r\n setAsHighDownDispatcher(handleThumb, true);\r\n\r\n mainGroup.add(handleThumb);\r\n\r\n // Text is always horizontal layout but should not be effected by\r\n // transform (orient/inverse). So label is built separately but not\r\n // use zrender/graphic/helper/RectText, and is located based on view\r\n // group (according to handleLabelPoint) but not barGroup.\r\n const textStyleModel = this.visualMapModel.textStyleModel;\r\n const handleLabel = new graphic.Text({\r\n cursor: cursor,\r\n draggable: true,\r\n drift: onDrift,\r\n onmousemove(e) {\r\n // For mobile device, prevent screen slider on the button.\r\n eventTool.stop(e.event);\r\n },\r\n ondragend: onDragEnd,\r\n style: createTextStyle(textStyleModel, {\r\n x: 0,\r\n y: 0,\r\n text: ''\r\n })\r\n });\r\n handleLabel.ensureState('blur').style = {\r\n opacity: 0.1\r\n };\r\n handleLabel.stateTransition = { duration: 200 };\r\n\r\n this.group.add(handleLabel);\r\n\r\n const handleLabelPoint = [handleSize, 0];\r\n\r\n const shapes = this._shapes;\r\n shapes.handleThumbs[handleIndex] = handleThumb;\r\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\r\n shapes.handleLabels[handleIndex] = handleLabel;\r\n }\r\n\r\n private _createIndicator(\r\n visualMapModel: ContinuousModel,\r\n mainGroup: graphic.Group,\r\n itemSize: number[],\r\n textSize: number,\r\n orient: Orient\r\n ) {\r\n const scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\r\n const indicator = createSymbol(\r\n visualMapModel.get('indicatorIcon'),\r\n -scale / 2, -scale / 2, scale, scale,\r\n null, true\r\n );\r\n indicator.attr({\r\n cursor: 'move',\r\n invisible: true,\r\n silent: true,\r\n x: itemSize[0] / 2\r\n });\r\n const indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\r\n if (indicator instanceof ZRImage) {\r\n const pathStyle = indicator.style;\r\n indicator.useStyle(zrUtil.extend({\r\n // TODO other properties like x, y ?\r\n image: pathStyle.image,\r\n x: pathStyle.x, y: pathStyle.y,\r\n width: pathStyle.width, height: pathStyle.height\r\n }, indicatorStyle));\r\n }\r\n else {\r\n indicator.useStyle(indicatorStyle);\r\n }\r\n\r\n mainGroup.add(indicator);\r\n\r\n const textStyleModel = this.visualMapModel.textStyleModel;\r\n const indicatorLabel = new graphic.Text({\r\n silent: true,\r\n invisible: true,\r\n style: createTextStyle(textStyleModel, {\r\n x: 0,\r\n y: 0,\r\n text: ''\r\n })\r\n });\r\n this.group.add(indicatorLabel);\r\n\r\n const indicatorLabelPoint = [\r\n (orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2,\r\n 0\r\n ];\r\n\r\n const shapes = this._shapes;\r\n shapes.indicator = indicator;\r\n shapes.indicatorLabel = indicatorLabel;\r\n shapes.indicatorLabelPoint = indicatorLabelPoint;\r\n\r\n this._firstShowIndicator = true;\r\n }\r\n\r\n private _dragHandle(\r\n handleIndex: 0 | 1 | 'all',\r\n isEnd?: boolean,\r\n // dx is event from ondragend if isEnd is true. It's not used\r\n dx?: number | ElementEvent,\r\n dy?: number\r\n ) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n\r\n this._dragging = !isEnd;\r\n\r\n if (!isEnd) {\r\n // Transform dx, dy to bar coordination.\r\n const vertex = this._applyTransform([dx as number, dy], this._shapes.mainGroup, true) as number[];\r\n this._updateInterval(handleIndex, vertex[1]);\r\n\r\n this._hideIndicator();\r\n // Considering realtime, update view should be executed\r\n // before dispatch action.\r\n this._updateView();\r\n }\r\n\r\n // dragEnd do not dispatch action when realtime.\r\n if (isEnd === !this.visualMapModel.get('realtime')) { // jshint ignore:line\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: this._dataInterval.slice()\r\n });\r\n }\r\n\r\n if (isEnd) {\r\n !this._hovering && this._clearHoverLinkToSeries();\r\n }\r\n else if (useHoverLinkOnHandle(this.visualMapModel)) {\r\n this._doHoverLinkToSeries(this._handleEnds[handleIndex as 0 | 1], false);\r\n }\r\n }\r\n\r\n private _resetInterval() {\r\n const visualMapModel = this.visualMapModel;\r\n\r\n const dataInterval = this._dataInterval = visualMapModel.getSelected();\r\n const dataExtent = visualMapModel.getExtent();\r\n const sizeExtent = [0, visualMapModel.itemSize[1]];\r\n\r\n this._handleEnds = [\r\n linearMap(dataInterval[0], dataExtent, sizeExtent, true),\r\n linearMap(dataInterval[1], dataExtent, sizeExtent, true)\r\n ];\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {(number|string)} handleIndex 0 or 1 or 'all'\r\n * @param {number} dx\r\n * @param {number} dy\r\n */\r\n private _updateInterval(handleIndex: 0 | 1 | 'all', delta: number) {\r\n delta = delta || 0;\r\n const visualMapModel = this.visualMapModel;\r\n const handleEnds = this._handleEnds;\r\n const sizeExtent = [0, visualMapModel.itemSize[1]];\r\n\r\n sliderMove(\r\n delta,\r\n handleEnds,\r\n sizeExtent,\r\n handleIndex,\r\n // cross is forbidden\r\n 0\r\n );\r\n\r\n const dataExtent = visualMapModel.getExtent();\r\n // Update data interval.\r\n this._dataInterval = [\r\n linearMap(handleEnds[0], sizeExtent, dataExtent, true),\r\n linearMap(handleEnds[1], sizeExtent, dataExtent, true)\r\n ];\r\n }\r\n\r\n private _updateView(forSketch?: boolean) {\r\n const visualMapModel = this.visualMapModel;\r\n const dataExtent = visualMapModel.getExtent();\r\n const shapes = this._shapes;\r\n\r\n const outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\r\n const inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\r\n\r\n const visualInRange = this._createBarVisual(\r\n this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange'\r\n );\r\n const visualOutOfRange = this._createBarVisual(\r\n dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange'\r\n );\r\n\r\n shapes.inRange\r\n .setStyle({\r\n fill: visualInRange.barColor\r\n // opacity: visualInRange.opacity\r\n })\r\n .setShape('points', visualInRange.barPoints);\r\n shapes.outOfRange\r\n .setStyle({\r\n fill: visualOutOfRange.barColor\r\n // opacity: visualOutOfRange.opacity\r\n })\r\n .setShape('points', visualOutOfRange.barPoints);\r\n\r\n this._updateHandle(inRangeHandleEnds, visualInRange);\r\n }\r\n\r\n private _createBarVisual(\r\n dataInterval: number[],\r\n dataExtent: number[],\r\n handleEnds: number[],\r\n forceState: ContinuousModel['stateList'][number]\r\n ): BarVisual {\r\n const opts = {\r\n forceState: forceState,\r\n convertOpacityToAlpha: true\r\n };\r\n const colorStops = this._makeColorGradient(dataInterval, opts);\r\n\r\n const symbolSizes = [\r\n this.getControllerVisual(dataInterval[0], 'symbolSize', opts) as number,\r\n this.getControllerVisual(dataInterval[1], 'symbolSize', opts) as number\r\n ];\r\n const barPoints = this._createBarPoints(handleEnds, symbolSizes);\r\n\r\n return {\r\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\r\n barPoints: barPoints,\r\n handlesColor: [\r\n colorStops[0].color,\r\n colorStops[colorStops.length - 1].color\r\n ]\r\n };\r\n }\r\n\r\n private _makeColorGradient(\r\n dataInterval: number[],\r\n opts: {\r\n forceState?: ContinuousModel['stateList'][number]\r\n convertOpacityToAlpha?: boolean\r\n }\r\n ) {\r\n // Considering colorHue, which is not linear, so we have to sample\r\n // to calculate gradient color stops, but not only calculate head\r\n // and tail.\r\n const sampleNumber = 100; // Arbitrary value.\r\n const colorStops: LinearGradientObject['colorStops'] = [];\r\n const step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\r\n\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[0], 'color', opts) as ColorString,\r\n offset: 0\r\n });\r\n\r\n for (let i = 1; i < sampleNumber; i++) {\r\n const currValue = dataInterval[0] + step * i;\r\n if (currValue > dataInterval[1]) {\r\n break;\r\n }\r\n colorStops.push({\r\n color: this.getControllerVisual(currValue, 'color', opts) as ColorString,\r\n offset: i / sampleNumber\r\n });\r\n }\r\n\r\n colorStops.push({\r\n color: this.getControllerVisual(dataInterval[1], 'color', opts) as ColorString,\r\n offset: 1\r\n });\r\n\r\n return colorStops;\r\n }\r\n\r\n private _createBarPoints(handleEnds: number[], symbolSizes: number[]) {\r\n const itemSize = this.visualMapModel.itemSize;\r\n\r\n return [\r\n [itemSize[0] - symbolSizes[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[0]],\r\n [itemSize[0], handleEnds[1]],\r\n [itemSize[0] - symbolSizes[1], handleEnds[1]]\r\n ];\r\n }\r\n\r\n private _createBarGroup(itemAlign: helper.ItemAlign) {\r\n const orient = this._orient;\r\n const inverse = this.visualMapModel.get('inverse');\r\n\r\n return new graphic.Group(\r\n (orient === 'horizontal' && !inverse)\r\n ? {scaleX: itemAlign === 'bottom' ? 1 : -1, rotation: Math.PI / 2}\r\n : (orient === 'horizontal' && inverse)\r\n ? {scaleX: itemAlign === 'bottom' ? -1 : 1, rotation: -Math.PI / 2}\r\n : (orient === 'vertical' && !inverse)\r\n ? {scaleX: itemAlign === 'left' ? 1 : -1, scaleY: -1}\r\n : {scaleX: itemAlign === 'left' ? 1 : -1}\r\n );\r\n }\r\n\r\n private _updateHandle(handleEnds: number[], visualInRange: BarVisual) {\r\n if (!this._useHandle) {\r\n return;\r\n }\r\n\r\n const shapes = this._shapes;\r\n const visualMapModel = this.visualMapModel;\r\n const handleThumbs = shapes.handleThumbs;\r\n const handleLabels = shapes.handleLabels;\r\n const itemSize = visualMapModel.itemSize;\r\n const dataExtent = visualMapModel.getExtent();\r\n const align = this._applyTransform('left', shapes.mainGroup);\r\n\r\n each([0, 1], function (handleIndex) {\r\n const handleThumb = handleThumbs[handleIndex];\r\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\r\n handleThumb.y = handleEnds[handleIndex];\r\n\r\n const val = linearMap(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\r\n const symbolSize = this.getControllerVisual(val, 'symbolSize') as number;\r\n\r\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\r\n handleThumb.x = itemSize[0] - symbolSize / 2;\r\n\r\n // Update handle label position.\r\n const textPoint = graphic.applyTransform(\r\n shapes.handleLabelPoints[handleIndex],\r\n graphic.getTransform(handleThumb, this.group)\r\n );\r\n\r\n if (this._orient === 'horizontal') {\r\n // If visualMap controls symbol size, an additional offset needs to be added to labels to avoid collision at minimum size.\r\n // Offset reaches value of 0 at \"maximum\" position, so maximum position is not altered at all.\r\n const minimumOffset = align === 'left' || align === 'top'\r\n ? (itemSize[0] - symbolSize) / 2\r\n : (itemSize[0] - symbolSize) / -2;\r\n\r\n textPoint[1] += minimumOffset;\r\n }\r\n\r\n handleLabels[handleIndex].setStyle({\r\n x: textPoint[0],\r\n y: textPoint[1],\r\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\r\n verticalAlign: 'middle',\r\n align: this._orient === 'vertical' ? this._applyTransform(\r\n 'left',\r\n shapes.mainGroup\r\n ) as TextAlign : 'center'\r\n });\r\n }, this);\r\n }\r\n\r\n private _showIndicator(\r\n cursorValue: number,\r\n textValue: number,\r\n rangeSymbol?: string,\r\n halfHoverLinkSize?: number\r\n ) {\r\n const visualMapModel = this.visualMapModel;\r\n const dataExtent = visualMapModel.getExtent();\r\n const itemSize = visualMapModel.itemSize;\r\n const sizeExtent = [0, itemSize[1]];\r\n\r\n const shapes = this._shapes;\r\n const indicator = shapes.indicator;\r\n if (!indicator) {\r\n return;\r\n }\r\n\r\n indicator.attr('invisible', false);\r\n\r\n const opts = {convertOpacityToAlpha: true};\r\n const color = this.getControllerVisual(cursorValue, 'color', opts) as ColorString;\r\n const symbolSize = this.getControllerVisual(cursorValue, 'symbolSize') as number;\r\n const y = linearMap(cursorValue, dataExtent, sizeExtent, true);\r\n const x = itemSize[0] - symbolSize / 2;\r\n\r\n const oldIndicatorPos = { x: indicator.x, y: indicator.y };\r\n // Update handle label position.\r\n indicator.y = y;\r\n indicator.x = x;\r\n const textPoint = graphic.applyTransform(\r\n shapes.indicatorLabelPoint,\r\n graphic.getTransform(indicator, this.group)\r\n );\r\n\r\n const indicatorLabel = shapes.indicatorLabel;\r\n indicatorLabel.attr('invisible', false);\r\n const align = this._applyTransform('left', shapes.mainGroup);\r\n const orient = this._orient;\r\n const isHorizontal = orient === 'horizontal';\r\n indicatorLabel.setStyle({\r\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\r\n verticalAlign: isHorizontal ? align as TextVerticalAlign : 'middle',\r\n align: isHorizontal ? 'center' : align as TextAlign\r\n });\r\n\r\n const indicatorNewProps = {\r\n x: x,\r\n y: y,\r\n style: {\r\n fill: color\r\n }\r\n };\r\n const labelNewProps = {\r\n style: {\r\n x: textPoint[0],\r\n y: textPoint[1]\r\n }\r\n };\r\n\r\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\r\n const animationCfg = {\r\n duration: 100,\r\n easing: 'cubicInOut',\r\n additive: true\r\n } as const;\r\n indicator.x = oldIndicatorPos.x;\r\n indicator.y = oldIndicatorPos.y;\r\n indicator.animateTo(indicatorNewProps, animationCfg);\r\n indicatorLabel.animateTo(labelNewProps, animationCfg);\r\n }\r\n else {\r\n indicator.attr(indicatorNewProps);\r\n indicatorLabel.attr(labelNewProps);\r\n }\r\n\r\n this._firstShowIndicator = false;\r\n\r\n const handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (let i = 0; i < handleLabels.length; i++) {\r\n // Fade out handle labels.\r\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\r\n this.api.enterBlur(handleLabels[i]);\r\n }\r\n }\r\n }\r\n\r\n private _enableHoverLinkToSeries() {\r\n const self = this;\r\n this._shapes.mainGroup\r\n\r\n .on('mousemove', function (e) {\r\n self._hovering = true;\r\n\r\n if (!self._dragging) {\r\n const itemSize = self.visualMapModel.itemSize;\r\n const pos = self._applyTransform(\r\n [e.offsetX, e.offsetY], self._shapes.mainGroup, true, true\r\n );\r\n // For hover link show when hover handle, which might be\r\n // below or upper than sizeExtent.\r\n pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);\r\n self._doHoverLinkToSeries(\r\n pos[1],\r\n 0 <= pos[0] && pos[0] <= itemSize[0]\r\n );\r\n }\r\n })\r\n\r\n .on('mouseout', function () {\r\n // When mouse is out of handle, hoverLink still need\r\n // to be displayed when realtime is set as false.\r\n self._hovering = false;\r\n !self._dragging && self._clearHoverLinkToSeries();\r\n });\r\n }\r\n\r\n private _enableHoverLinkFromSeries() {\r\n const zr = this.api.getZr();\r\n\r\n if (this.visualMapModel.option.hoverLink) {\r\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\r\n zr.on('mouseout', this._hideIndicator, this);\r\n }\r\n else {\r\n this._clearHoverLinkFromSeries();\r\n }\r\n }\r\n\r\n private _doHoverLinkToSeries(cursorPos: number, hoverOnBar?: boolean) {\r\n const visualMapModel = this.visualMapModel;\r\n const itemSize = visualMapModel.itemSize;\r\n\r\n if (!visualMapModel.option.hoverLink) {\r\n return;\r\n }\r\n\r\n const sizeExtent = [0, itemSize[1]];\r\n const dataExtent = visualMapModel.getExtent();\r\n\r\n // For hover link show when hover handle, which might be below or upper than sizeExtent.\r\n cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);\r\n\r\n const halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\r\n const hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\r\n const cursorValue = linearMap(cursorPos, sizeExtent, dataExtent, true);\r\n const valueRange = [\r\n linearMap(hoverRange[0], sizeExtent, dataExtent, true),\r\n linearMap(hoverRange[1], sizeExtent, dataExtent, true)\r\n ];\r\n // Consider data range is out of visualMap range, see test/visualMap-continuous.html,\r\n // where china and india has very large population.\r\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\r\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);\r\n\r\n // Do not show indicator when mouse is over handle,\r\n // otherwise labels overlap, especially when dragging.\r\n if (hoverOnBar) {\r\n if (valueRange[0] === -Infinity) {\r\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\r\n }\r\n else if (valueRange[1] === Infinity) {\r\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\r\n }\r\n else {\r\n this._showIndicator(cursorValue, cursorValue, '\u2248 ', halfHoverLinkSize);\r\n }\r\n }\r\n\r\n // When realtime is set as false, handles, which are in barGroup,\r\n // also trigger hoverLink, which help user to realize where they\r\n // focus on when dragging. (see test/heatmap-large.html)\r\n // When realtime is set as true, highlight will not show when hover\r\n // handle, because the label on handle, which displays a exact value\r\n // but not range, might mislead users.\r\n const oldBatch = this._hoverLinkDataIndices;\r\n let newBatch: TargetDataIndices = [];\r\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\r\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\r\n }\r\n\r\n const resultBatches = modelUtil.compressBatches(oldBatch, newBatch);\r\n\r\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(resultBatches[0], visualMapModel));\r\n this._dispatchHighDown('highlight', helper.makeHighDownBatch(resultBatches[1], visualMapModel));\r\n }\r\n\r\n private _hoverLinkFromSeriesMouseOver(e: ElementEvent) {\r\n let ecData: ECData;\r\n\r\n findEventDispatcher(e.target, target => {\r\n const currECData = getECData(target);\r\n if (currECData.dataIndex != null) {\r\n ecData = currECData;\r\n return true;\r\n }\r\n }, true);\r\n\r\n if (!ecData) {\r\n return;\r\n }\r\n\r\n const dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\r\n\r\n const visualMapModel = this.visualMapModel;\r\n if (!visualMapModel.isTargetSeries(dataModel)) {\r\n return;\r\n }\r\n\r\n const data = dataModel.getData(ecData.dataType);\r\n const value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex) as number;\r\n\r\n if (!isNaN(value)) {\r\n this._showIndicator(value, value);\r\n }\r\n }\r\n\r\n private _hideIndicator() {\r\n const shapes = this._shapes;\r\n shapes.indicator && shapes.indicator.attr('invisible', true);\r\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\r\n\r\n const handleLabels = this._shapes.handleLabels;\r\n if (handleLabels) {\r\n for (let i = 0; i < handleLabels.length; i++) {\r\n // Fade out handle labels.\r\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\r\n this.api.leaveBlur(handleLabels[i]);\r\n }\r\n }\r\n }\r\n\r\n private _clearHoverLinkToSeries() {\r\n this._hideIndicator();\r\n\r\n const indices = this._hoverLinkDataIndices;\r\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(indices, this.visualMapModel));\r\n\r\n indices.length = 0;\r\n }\r\n\r\n private _clearHoverLinkFromSeries() {\r\n this._hideIndicator();\r\n\r\n const zr = this.api.getZr();\r\n\r\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\r\n zr.off('mouseout', this._hideIndicator);\r\n }\r\n private _applyTransform(vertex: number[], element: Element, inverse?: boolean, global?: boolean): number[]\r\n private _applyTransform(vertex: Direction, element: Element, inverse?: boolean, global?: boolean): Direction\r\n private _applyTransform(\r\n vertex: number[] | Direction,\r\n element: Element,\r\n inverse?: boolean,\r\n global?: boolean\r\n ) {\r\n const transform = graphic.getTransform(element, global ? null : this.group);\r\n\r\n return zrUtil.isArray(vertex)\r\n ? graphic.applyTransform(vertex, transform, inverse)\r\n : graphic.transformDirection(vertex, transform, inverse);\r\n }\r\n\r\n // TODO: TYPE more specified payload types.\r\n private _dispatchHighDown(type: 'highlight' | 'downplay', batch: Payload['batch']) {\r\n batch && batch.length && this.api.dispatchAction({\r\n type: type,\r\n batch: batch\r\n });\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n dispose() {\r\n this._clearHoverLinkFromSeries();\r\n this._clearHoverLinkToSeries();\r\n }\r\n\r\n}\r\n\r\nfunction createPolygon(\r\n points?: number[][],\r\n cursor?: string,\r\n onDrift?: (x: number, y: number) => void,\r\n onDragEnd?: () => void\r\n) {\r\n return new graphic.Polygon({\r\n shape: {points: points},\r\n draggable: !!onDrift,\r\n cursor: cursor,\r\n drift: onDrift,\r\n onmousemove(e) {\r\n // For mobile device, prevent screen slider on the button.\r\n eventTool.stop(e.event);\r\n },\r\n ondragend: onDragEnd\r\n });\r\n}\r\n\r\nfunction getHalfHoverLinkSize(visualMapModel: ContinuousModel, dataExtent: number[], sizeExtent: number[]) {\r\n let halfHoverLinkSize = HOVER_LINK_SIZE / 2;\r\n const hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\r\n if (hoverLinkDataSize) {\r\n halfHoverLinkSize = linearMap(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\r\n }\r\n return halfHoverLinkSize;\r\n}\r\n\r\nfunction useHoverLinkOnHandle(visualMapModel: ContinuousModel) {\r\n const hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\r\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\r\n}\r\n\r\nfunction getCursor(orient: Orient) {\r\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\r\n}\r\n\r\nexport default ContinuousView;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport VisualMapModel from './VisualMapModel';\r\nimport { Payload } from '../../util/types';\r\nimport GlobalModel from '../../model/Global';\r\n\r\nexport const visualMapActionInfo = {\r\n type: 'selectDataRange',\r\n event: 'dataRangeSelected',\r\n // FIXME use updateView appears wrong\r\n update: 'update'\r\n};\r\n\r\nexport const visualMapActionHander = function (payload: Payload, ecModel: GlobalModel) {\r\n ecModel.eachComponent({mainType: 'visualMap', query: payload}, function (model) {\r\n (model as VisualMapModel).setSelected(payload.selected);\r\n });\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport * as visualSolution from '../../visual/visualSolution';\r\nimport VisualMapping from '../../visual/VisualMapping';\r\nimport VisualMapModel, { VisualMeta } from './VisualMapModel';\r\nimport { StageHandlerProgressExecutor, BuiltinVisualProperty, ParsedValue, StageHandler } from '../../util/types';\r\nimport SeriesModel from '../../model/Series';\r\nimport { getVisualFromData } from '../../visual/helper';\r\n\r\nexport const visualMapEncodingHandlers: StageHandler[] = [\r\n {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n const resetDefines: StageHandlerProgressExecutor[] = [];\r\n ecModel.eachComponent('visualMap', function (visualMapModel: VisualMapModel) {\r\n const pipelineContext = seriesModel.pipelineContext;\r\n if (!visualMapModel.isTargetSeries(seriesModel)\r\n || (pipelineContext && pipelineContext.large)\r\n ) {\r\n return;\r\n }\r\n\r\n resetDefines.push(visualSolution.incrementalApplyVisual(\r\n visualMapModel.stateList,\r\n visualMapModel.targetVisuals,\r\n zrUtil.bind(visualMapModel.getValueState, visualMapModel),\r\n visualMapModel.getDataDimensionIndex(seriesModel.getData())\r\n ));\r\n });\r\n\r\n return resetDefines;\r\n }\r\n },\r\n // Only support color.\r\n {\r\n createOnAllSeries: true,\r\n reset: function (seriesModel, ecModel) {\r\n const data = seriesModel.getData();\r\n const visualMetaList: VisualMeta[] = [];\r\n\r\n ecModel.eachComponent('visualMap', function (visualMapModel: VisualMapModel) {\r\n if (visualMapModel.isTargetSeries(seriesModel)) {\r\n const visualMeta = visualMapModel.getVisualMeta(\r\n zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)\r\n ) || {\r\n stops: [],\r\n outerColors: []\r\n } as VisualMeta;\r\n\r\n const dimIdx = visualMapModel.getDataDimensionIndex(data);\r\n if (dimIdx >= 0) {\r\n // visualMeta.dimension should be dimension index, but not concrete dimension.\r\n visualMeta.dimension = dimIdx;\r\n visualMetaList.push(visualMeta);\r\n }\r\n }\r\n });\r\n\r\n // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\r\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\r\n }\r\n }\r\n];\r\n\r\n// FIXME\r\n// performance and export for heatmap?\r\n// value can be Infinity or -Infinity\r\nfunction getColorVisual(\r\n seriesModel: SeriesModel,\r\n visualMapModel: VisualMapModel,\r\n value: ParsedValue,\r\n valueState: VisualMapModel['stateList'][number]\r\n) {\r\n const mappings = visualMapModel.targetVisuals[valueState];\r\n const visualTypes = VisualMapping.prepareVisualTypes(mappings);\r\n const resultVisual: Partial> = {\r\n color: getVisualFromData(seriesModel.getData(), 'color') // default color.\r\n };\r\n\r\n for (let i = 0, len = visualTypes.length; i < len; i++) {\r\n const type = visualTypes[i];\r\n const mapping = mappings[\r\n (type === 'opacity' ? '__alphaForOpacity' : type) as BuiltinVisualProperty\r\n ];\r\n mapping && mapping.applyVisual(value, getVisual, setVisual);\r\n }\r\n\r\n return resultVisual.color;\r\n\r\n function getVisual(key: BuiltinVisualProperty) {\r\n return resultVisual[key];\r\n }\r\n\r\n function setVisual(key: BuiltinVisualProperty, value: any) {\r\n resultVisual[key] = value;\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// @ts-nocheck\r\nimport * as zrUtil from 'zrender/src/core/util';\r\n\r\nconst each = zrUtil.each;\r\n\r\nexport default function visualMapPreprocessor(option) {\r\n let visualMap = option && option.visualMap;\r\n\r\n if (!zrUtil.isArray(visualMap)) {\r\n visualMap = visualMap ? [visualMap] : [];\r\n }\r\n\r\n each(visualMap, function (opt) {\r\n if (!opt) {\r\n return;\r\n }\r\n\r\n // rename splitList to pieces\r\n if (has(opt, 'splitList') && !has(opt, 'pieces')) {\r\n opt.pieces = opt.splitList;\r\n delete opt.splitList;\r\n }\r\n\r\n const pieces = opt.pieces;\r\n if (pieces && zrUtil.isArray(pieces)) {\r\n each(pieces, function (piece) {\r\n if (zrUtil.isObject(piece)) {\r\n if (has(piece, 'start') && !has(piece, 'min')) {\r\n piece.min = piece.start;\r\n }\r\n if (has(piece, 'end') && !has(piece, 'max')) {\r\n piece.max = piece.end;\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}\r\n\r\nfunction has(obj: object, name: string) {\r\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport { VisualMapOption } from './VisualMapModel';\r\nimport { PiecewiseVisualMapOption } from './PiecewiseModel';\r\nimport { ContinousVisualMapOption } from './ContinuousModel';\r\nimport { visualMapActionInfo, visualMapActionHander } from './visualMapAction';\r\nimport { visualMapEncodingHandlers } from './visualEncoding';\r\nimport { each } from 'zrender/src/core/util';\r\nimport preprocessor from './preprocessor';\r\n\r\nlet installed = false;\r\nexport default function installCommon(registers: EChartsExtensionInstallRegisters) {\r\n if (installed) {\r\n return;\r\n }\r\n installed = true;\r\n\r\n registers.registerSubTypeDefaulter(\r\n 'visualMap', function (option: VisualMapOption) {\r\n // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\r\n return (\r\n !option.categories\r\n && (\r\n !(\r\n (option as PiecewiseVisualMapOption).pieces\r\n ? ((option as PiecewiseVisualMapOption)).pieces.length > 0\r\n : ((option as PiecewiseVisualMapOption)).splitNumber > 0\r\n )\r\n || (option as ContinousVisualMapOption).calculable\r\n )\r\n )\r\n ? 'continuous' : 'piecewise';\r\n });\r\n\r\n registers.registerAction(visualMapActionInfo, visualMapActionHander);\r\n\r\n each(visualMapEncodingHandlers, (handler) => {\r\n registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);\r\n });\r\n registers.registerPreprocessor(preprocessor);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport ContinuousModel from './ContinuousModel';\r\nimport ContinuousView from './ContinuousView';\r\nimport installCommon from './installCommon';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(ContinuousModel);\r\n registers.registerComponentView(ContinuousView);\r\n\r\n installCommon(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport VisualMapModel, { VisualMapOption, VisualMeta } from './VisualMapModel';\r\nimport VisualMapping, { VisualMappingOption } from '../../visual/VisualMapping';\r\nimport visualDefault from '../../visual/visualDefault';\r\nimport {reformIntervals} from '../../util/number';\r\nimport { VisualOptionPiecewise, BuiltinVisualProperty } from '../../util/types';\r\nimport { Dictionary } from 'zrender/src/core/types';\r\nimport { inheritDefaultOption } from '../../util/component';\r\n\r\n\r\n// TODO: use `relationExpression.ts` instead\r\ninterface VisualPiece extends VisualOptionPiecewise {\r\n min?: number\r\n max?: number\r\n lt?: number\r\n gt?: number\r\n lte?: number\r\n gte?: number\r\n value?: number\r\n\r\n label?: string\r\n}\r\n\r\ntype VisualState = VisualMapModel['stateList'][number];\r\n\r\ntype InnerVisualPiece = VisualMappingOption['pieceList'][number];\r\n\r\ntype GetPieceValueType\r\n = T extends { interval: InnerVisualPiece['interval'] } ? number : string;\r\n\r\n/**\r\n * Order Rule:\r\n *\r\n * option.categories / option.pieces / option.text / option.selected:\r\n * If !option.inverse,\r\n * Order when vertical: ['top', ..., 'bottom'].\r\n * Order when horizontal: ['left', ..., 'right'].\r\n * If option.inverse, the meaning of\r\n * the order should be reversed.\r\n *\r\n * this._pieceList:\r\n * The order is always [low, ..., high].\r\n *\r\n * Mapping from location to low-high:\r\n * If !option.inverse\r\n * When vertical, top is high.\r\n * When horizontal, right is high.\r\n * If option.inverse, reverse.\r\n */\r\n\r\nexport interface PiecewiseVisualMapOption extends VisualMapOption {\r\n align?: 'auto' | 'left' | 'right'\r\n\r\n minOpen?: boolean\r\n maxOpen?: boolean\r\n\r\n /**\r\n * When put the controller vertically, it is the length of\r\n * horizontal side of each item. Otherwise, vertical side.\r\n * When put the controller vertically, it is the length of\r\n * vertical side of each item. Otherwise, horizontal side.\r\n */\r\n itemWidth?: number\r\n itemHeight?: number\r\n\r\n itemSymbol?: string\r\n pieces?: VisualPiece[]\r\n\r\n /**\r\n * category names, like: ['some1', 'some2', 'some3'].\r\n * Attr min/max are ignored when categories set. See \"Order Rule\"\r\n */\r\n categories?: string[]\r\n\r\n /**\r\n * If set to 5, auto split five pieces equally.\r\n * If set to 0 and component type not set, component type will be\r\n * determined as \"continuous\". (It is less reasonable but for ec2\r\n * compatibility, see echarts/component/visualMap/typeDefaulter)\r\n */\r\n splitNumber?: number\r\n\r\n /**\r\n * Object. If not specified, means selected. When pieces and splitNumber: {'0': true, '5': true}\r\n * When categories: {'cate1': false, 'cate3': true} When selected === false, means all unselected.\r\n */\r\n selected?: Dictionary\r\n selectedMode?: 'multiple' | 'single' | boolean\r\n\r\n /**\r\n * By default, when text is used, label will hide (the logic\r\n * is remained for compatibility reason)\r\n */\r\n showLabel?: boolean\r\n\r\n itemGap?: number\r\n\r\n hoverLink?: boolean\r\n}\r\n\r\nclass PiecewiseModel extends VisualMapModel {\r\n\r\n static type = 'visualMap.piecewise' as const;\r\n type = PiecewiseModel.type;\r\n\r\n /**\r\n * The order is always [low, ..., high].\r\n * [{text: string, interval: Array.}, ...]\r\n */\r\n private _pieceList: InnerVisualPiece[] = [];\r\n\r\n private _mode: 'pieces' | 'categories' | 'splitNumber';\r\n\r\n optionUpdated(newOption: PiecewiseVisualMapOption, isInit?: boolean) {\r\n super.optionUpdated.apply(this, arguments as any);\r\n\r\n this.resetExtent();\r\n\r\n const mode = this._mode = this._determineMode();\r\n\r\n this._pieceList = [];\r\n resetMethods[this._mode].call(this, this._pieceList);\r\n\r\n this._resetSelected(newOption, isInit);\r\n\r\n const categories = this.option.categories;\r\n\r\n this.resetVisual(function (mappingOption, state) {\r\n if (mode === 'categories') {\r\n mappingOption.mappingMethod = 'category';\r\n mappingOption.categories = zrUtil.clone(categories);\r\n }\r\n else {\r\n mappingOption.dataExtent = this.getExtent();\r\n mappingOption.mappingMethod = 'piecewise';\r\n mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {\r\n piece = zrUtil.clone(piece);\r\n if (state !== 'inRange') {\r\n // FIXME\r\n // outOfRange do not support special visual in pieces.\r\n piece.visual = null;\r\n }\r\n return piece;\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @protected\r\n * @override\r\n */\r\n completeVisualOption() {\r\n // Consider this case:\r\n // visualMap: {\r\n // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]\r\n // }\r\n // where no inRange/outOfRange set but only pieces. So we should make\r\n // default inRange/outOfRange for this case, otherwise visuals that only\r\n // appear in `pieces` will not be taken into account in visual encoding.\r\n\r\n const option = this.option;\r\n const visualTypesInPieces: {[key in BuiltinVisualProperty]?: 0 | 1} = {};\r\n const visualTypes = VisualMapping.listVisualTypes();\r\n const isCategory = this.isCategory();\r\n\r\n zrUtil.each(option.pieces, function (piece) {\r\n zrUtil.each(visualTypes, function (visualType: BuiltinVisualProperty) {\r\n if (piece.hasOwnProperty(visualType)) {\r\n visualTypesInPieces[visualType] = 1;\r\n }\r\n });\r\n });\r\n\r\n zrUtil.each(visualTypesInPieces, function (v, visualType: BuiltinVisualProperty) {\r\n let exists = false;\r\n zrUtil.each(this.stateList, function (state: VisualState) {\r\n exists = exists || has(option, state, visualType)\r\n || has(option.target, state, visualType);\r\n }, this);\r\n\r\n !exists && zrUtil.each(this.stateList, function (state: VisualState) {\r\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(\r\n visualType, state === 'inRange' ? 'active' : 'inactive', isCategory\r\n );\r\n });\r\n }, this);\r\n\r\n function has(obj: PiecewiseVisualMapOption['target'], state: VisualState, visualType: BuiltinVisualProperty) {\r\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\r\n }\r\n\r\n super.completeVisualOption.apply(this, arguments as any);\r\n }\r\n\r\n private _resetSelected(newOption: PiecewiseVisualMapOption, isInit?: boolean) {\r\n const thisOption = this.option;\r\n const pieceList = this._pieceList;\r\n\r\n // Selected do not merge but all override.\r\n const selected = (isInit ? thisOption : newOption).selected || {};\r\n thisOption.selected = selected;\r\n\r\n // Consider 'not specified' means true.\r\n zrUtil.each(pieceList, function (piece, index) {\r\n const key = this.getSelectedMapKey(piece);\r\n if (!selected.hasOwnProperty(key)) {\r\n selected[key] = true;\r\n }\r\n }, this);\r\n\r\n if (thisOption.selectedMode === 'single') {\r\n // Ensure there is only one selected.\r\n let hasSel = false;\r\n\r\n zrUtil.each(pieceList, function (piece, index) {\r\n const key = this.getSelectedMapKey(piece);\r\n if (selected[key]) {\r\n hasSel\r\n ? (selected[key] = false)\r\n : (hasSel = true);\r\n }\r\n }, this);\r\n }\r\n // thisOption.selectedMode === 'multiple', default: all selected.\r\n }\r\n\r\n /**\r\n * @public\r\n */\r\n getItemSymbol(): string {\r\n return this.get('itemSymbol');\r\n }\r\n\r\n /**\r\n * @public\r\n */\r\n getSelectedMapKey(piece: InnerVisualPiece) {\r\n return this._mode === 'categories'\r\n ? piece.value + '' : piece.index + '';\r\n }\r\n\r\n /**\r\n * @public\r\n */\r\n getPieceList(): InnerVisualPiece[] {\r\n return this._pieceList;\r\n }\r\n\r\n /**\r\n * @return {string}\r\n */\r\n private _determineMode() {\r\n const option = this.option;\r\n\r\n return option.pieces && option.pieces.length > 0\r\n ? 'pieces'\r\n : this.option.categories\r\n ? 'categories'\r\n : 'splitNumber';\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n setSelected(selected: this['option']['selected']) {\r\n this.option.selected = zrUtil.clone(selected);\r\n }\r\n\r\n /**\r\n * @override\r\n */\r\n getValueState(value: number): VisualState {\r\n const index = VisualMapping.findPieceIndex(value, this._pieceList);\r\n\r\n return index != null\r\n ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])]\r\n ? 'inRange' : 'outOfRange'\r\n )\r\n : 'outOfRange';\r\n }\r\n\r\n /**\r\n * @public\r\n * @param pieceIndex piece index in visualMapModel.getPieceList()\r\n */\r\n findTargetDataIndices(pieceIndex: number) {\r\n type DataIndices = {\r\n seriesId: string\r\n dataIndex: number[]\r\n };\r\n\r\n const result: DataIndices[] = [];\r\n const pieceList = this._pieceList;\r\n\r\n this.eachTargetSeries(function (seriesModel) {\r\n const dataIndices: number[] = [];\r\n const data = seriesModel.getData();\r\n\r\n data.each(this.getDataDimensionIndex(data), function (value: number, dataIndex: number) {\r\n // Should always base on model pieceList, because it is order sensitive.\r\n const pIdx = VisualMapping.findPieceIndex(value, pieceList);\r\n pIdx === pieceIndex && dataIndices.push(dataIndex);\r\n }, this);\r\n\r\n result.push({seriesId: seriesModel.id, dataIndex: dataIndices});\r\n }, this);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param piece piece.value or piece.interval is required.\r\n * @return Can be Infinity or -Infinity\r\n */\r\n getRepresentValue(piece: InnerVisualPiece) {\r\n let representValue;\r\n if (this.isCategory()) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n if (piece.value != null) {\r\n representValue = piece.value;\r\n }\r\n else {\r\n const pieceInterval = piece.interval || [];\r\n representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity)\r\n ? 0\r\n : (pieceInterval[0] + pieceInterval[1]) / 2;\r\n }\r\n }\r\n\r\n return representValue;\r\n }\r\n\r\n getVisualMeta(\r\n getColorVisual: (value: number, valueState: VisualState) => string\r\n ): VisualMeta {\r\n // Do not support category. (category axis is ordinal, numerical)\r\n if (this.isCategory()) {\r\n return;\r\n }\r\n\r\n const stops: VisualMeta['stops'] = [];\r\n const outerColors: VisualMeta['outerColors'] = ['', ''];\r\n const visualMapModel = this;\r\n\r\n function setStop(interval: [number, number], valueState?: VisualState) {\r\n const representValue = visualMapModel.getRepresentValue({\r\n interval: interval\r\n }) as number;// Not category\r\n if (!valueState) {\r\n valueState = visualMapModel.getValueState(representValue);\r\n }\r\n const color = getColorVisual(representValue, valueState);\r\n if (interval[0] === -Infinity) {\r\n outerColors[0] = color;\r\n }\r\n else if (interval[1] === Infinity) {\r\n outerColors[1] = color;\r\n }\r\n else {\r\n stops.push(\r\n {value: interval[0], color: color},\r\n {value: interval[1], color: color}\r\n );\r\n }\r\n }\r\n\r\n // Suplement\r\n const pieceList = this._pieceList.slice();\r\n if (!pieceList.length) {\r\n pieceList.push({interval: [-Infinity, Infinity]});\r\n }\r\n else {\r\n let edge = pieceList[0].interval[0];\r\n edge !== -Infinity && pieceList.unshift({interval: [-Infinity, edge]});\r\n edge = pieceList[pieceList.length - 1].interval[1];\r\n edge !== Infinity && pieceList.push({interval: [edge, Infinity]});\r\n }\r\n\r\n let curr = -Infinity;\r\n zrUtil.each(pieceList, function (piece) {\r\n const interval = piece.interval;\r\n if (interval) {\r\n // Fulfill gap.\r\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\r\n setStop(interval.slice() as [number, number]);\r\n curr = interval[1];\r\n }\r\n }, this);\r\n\r\n return {stops: stops, outerColors: outerColors};\r\n }\r\n\r\n\r\n static defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\r\n selected: null,\r\n minOpen: false, // Whether include values that smaller than `min`.\r\n maxOpen: false, // Whether include values that bigger than `max`.\r\n\r\n align: 'auto', // 'auto', 'left', 'right'\r\n itemWidth: 20,\r\n\r\n itemHeight: 14,\r\n\r\n itemSymbol: 'roundRect',\r\n pieces: null,\r\n categories: null,\r\n splitNumber: 5,\r\n selectedMode: 'multiple', // Can be 'multiple' or 'single'.\r\n itemGap: 10, // The gap between two items, in px.\r\n hoverLink: true // Enable hover highlight.\r\n }) as PiecewiseVisualMapOption;\r\n\r\n};\r\n\r\ntype ResetMethod = (outPieceList: InnerVisualPiece[]) => void;\r\n/**\r\n * Key is this._mode\r\n * @type {Object}\r\n * @this {module:echarts/component/viusalMap/PiecewiseMode}\r\n */\r\nconst resetMethods: Dictionary & ThisType = {\r\n\r\n splitNumber(outPieceList) {\r\n const thisOption = this.option;\r\n let precision = Math.min(thisOption.precision, 20);\r\n const dataExtent = this.getExtent();\r\n let splitNumber = thisOption.splitNumber;\r\n splitNumber = Math.max(parseInt(splitNumber as unknown as string, 10), 1);\r\n thisOption.splitNumber = splitNumber;\r\n\r\n let splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;\r\n // Precision auto-adaption\r\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\r\n precision++;\r\n }\r\n thisOption.precision = precision;\r\n splitStep = +splitStep.toFixed(precision);\r\n\r\n if (thisOption.minOpen) {\r\n outPieceList.push({\r\n interval: [-Infinity, dataExtent[0]],\r\n close: [0, 0]\r\n });\r\n }\r\n\r\n for (\r\n let index = 0, curr = dataExtent[0];\r\n index < splitNumber;\r\n curr += splitStep, index++\r\n ) {\r\n const max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);\r\n\r\n outPieceList.push({\r\n interval: [curr, max],\r\n close: [1, 1]\r\n });\r\n }\r\n\r\n if (thisOption.maxOpen) {\r\n outPieceList.push({\r\n interval: [dataExtent[1], Infinity],\r\n close: [0, 0]\r\n });\r\n }\r\n\r\n reformIntervals(outPieceList as Required[]);\r\n\r\n zrUtil.each(outPieceList, function (piece, index) {\r\n piece.index = index;\r\n piece.text = this.formatValueText(piece.interval);\r\n }, this);\r\n },\r\n\r\n categories(outPieceList) {\r\n const thisOption = this.option;\r\n zrUtil.each(thisOption.categories, function (cate) {\r\n // FIXME category\u6A21\u5F0F\u4E5F\u4F7F\u7528pieceList\uFF0C\u4F46\u5728visualMapping\u4E2D\u4E0D\u662F\u4F7F\u7528pieceList\u3002\r\n // \u662F\u5426\u6539\u4E00\u81F4\u3002\r\n outPieceList.push({\r\n text: this.formatValueText(cate, true),\r\n value: cate\r\n });\r\n }, this);\r\n\r\n // See \"Order Rule\".\r\n normalizeReverse(thisOption, outPieceList);\r\n },\r\n\r\n pieces(outPieceList) {\r\n const thisOption = this.option;\r\n\r\n zrUtil.each(thisOption.pieces, function (pieceListItem, index) {\r\n\r\n if (!zrUtil.isObject(pieceListItem)) {\r\n pieceListItem = {value: pieceListItem};\r\n }\r\n\r\n const item: InnerVisualPiece = {text: '', index: index};\r\n\r\n if (pieceListItem.label != null) {\r\n item.text = pieceListItem.label;\r\n }\r\n\r\n if (pieceListItem.hasOwnProperty('value')) {\r\n const value = item.value = pieceListItem.value;\r\n item.interval = [value, value];\r\n item.close = [1, 1];\r\n }\r\n else {\r\n // `min` `max` is legacy option.\r\n // `lt` `gt` `lte` `gte` is recommended.\r\n const interval = item.interval = [] as unknown as [number, number];\r\n const close: typeof item.close = item.close = [0, 0];\r\n\r\n const closeList = [1, 0, 1] as const;\r\n const infinityList = [-Infinity, Infinity];\r\n\r\n const useMinMax = [];\r\n for (let lg = 0; lg < 2; lg++) {\r\n const names = ([['gte', 'gt', 'min'], ['lte', 'lt', 'max']] as const)[lg];\r\n for (let i = 0; i < 3 && interval[lg] == null; i++) {\r\n interval[lg] = pieceListItem[names[i]];\r\n close[lg] = closeList[i];\r\n useMinMax[lg] = i === 2;\r\n }\r\n interval[lg] == null && (interval[lg] = infinityList[lg]);\r\n }\r\n useMinMax[0] && interval[1] === Infinity && (close[0] = 0);\r\n useMinMax[1] && interval[0] === -Infinity && (close[1] = 0);\r\n\r\n if (__DEV__) {\r\n if (interval[0] > interval[1]) {\r\n console.warn(\r\n 'Piece ' + index + 'is illegal: ' + interval\r\n + ' lower bound should not greater then uppper bound.'\r\n );\r\n }\r\n }\r\n\r\n if (interval[0] === interval[1] && close[0] && close[1]) {\r\n // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],\r\n // we use value to lift the priority when min === max\r\n item.value = interval[0];\r\n }\r\n }\r\n\r\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\r\n\r\n outPieceList.push(item);\r\n\r\n }, this);\r\n\r\n // See \"Order Rule\".\r\n normalizeReverse(thisOption, outPieceList);\r\n // Only pieces\r\n reformIntervals(outPieceList as Required[]);\r\n\r\n zrUtil.each(outPieceList, function (piece) {\r\n const close = piece.close;\r\n const edgeSymbols = [['<', '\u2264'][close[1]], ['>', '\u2265'][close[0]]];\r\n piece.text = piece.text || this.formatValueText(\r\n piece.value != null ? piece.value : piece.interval,\r\n false,\r\n edgeSymbols\r\n );\r\n }, this);\r\n }\r\n};\r\n\r\nfunction normalizeReverse(thisOption: PiecewiseVisualMapOption, pieceList: InnerVisualPiece[]) {\r\n const inverse = thisOption.inverse;\r\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\r\n pieceList.reverse();\r\n }\r\n}\r\n\r\nexport default PiecewiseModel;\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport VisualMapView from './VisualMapView';\r\nimport * as graphic from '../../util/graphic';\r\nimport {createSymbol} from '../../util/symbol';\r\nimport * as layout from '../../util/layout';\r\nimport * as helper from './helper';\r\nimport PiecewiseModel from './PiecewiseModel';\r\nimport { TextAlign } from 'zrender/src/core/types';\r\nimport { VisualMappingOption } from '../../visual/VisualMapping';\r\nimport { createTextStyle } from '../../label/labelStyle';\r\n\r\nclass PiecewiseVisualMapView extends VisualMapView {\r\n\r\n static type = 'visualMap.piecewise' as const;\r\n\r\n type = PiecewiseVisualMapView.type;\r\n\r\n visualMapModel: PiecewiseModel;\r\n\r\n protected doRender() {\r\n const thisGroup = this.group;\r\n\r\n thisGroup.removeAll();\r\n\r\n const visualMapModel = this.visualMapModel;\r\n const textGap = visualMapModel.get('textGap');\r\n const textStyleModel = visualMapModel.textStyleModel;\r\n const textFont = textStyleModel.getFont();\r\n const textFill = textStyleModel.getTextColor();\r\n const itemAlign = this._getItemAlign();\r\n const itemSize = visualMapModel.itemSize;\r\n const viewData = this._getViewData();\r\n const endsText = viewData.endsText;\r\n const showLabel = zrUtil.retrieve(visualMapModel.get('showLabel', true), !endsText);\r\n\r\n endsText && this._renderEndsText(\r\n thisGroup, endsText[0], itemSize, showLabel, itemAlign\r\n );\r\n\r\n zrUtil.each(viewData.viewPieceList, function (item: typeof viewData.viewPieceList[number]) {\r\n const piece = item.piece;\r\n\r\n const itemGroup = new graphic.Group();\r\n itemGroup.onclick = zrUtil.bind(this._onItemClick, this, piece);\r\n\r\n this._enableHoverLink(itemGroup, item.indexInModelPieceList);\r\n\r\n // TODO Category\r\n const representValue = visualMapModel.getRepresentValue(piece) as number;\r\n\r\n this._createItemSymbol(\r\n itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]\r\n );\r\n\r\n if (showLabel) {\r\n const visualState = this.visualMapModel.getValueState(representValue);\r\n\r\n itemGroup.add(new graphic.Text({\r\n style: {\r\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\r\n y: itemSize[1] / 2,\r\n text: piece.text,\r\n verticalAlign: 'middle',\r\n align: itemAlign as TextAlign,\r\n font: textFont,\r\n fill: textFill,\r\n opacity: visualState === 'outOfRange' ? 0.5 : 1\r\n }\r\n }));\r\n }\r\n\r\n thisGroup.add(itemGroup);\r\n }, this);\r\n\r\n endsText && this._renderEndsText(\r\n thisGroup, endsText[1], itemSize, showLabel, itemAlign\r\n );\r\n\r\n layout.box(\r\n visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap')\r\n );\r\n\r\n this.renderBackground(thisGroup);\r\n\r\n this.positionGroup(thisGroup);\r\n }\r\n\r\n private _enableHoverLink(itemGroup: graphic.Group, pieceIndex: number) {\r\n itemGroup\r\n .on('mouseover', () => onHoverLink('highlight'))\r\n .on('mouseout', () => onHoverLink('downplay'));\r\n\r\n const onHoverLink = (method?: 'highlight' | 'downplay') => {\r\n const visualMapModel = this.visualMapModel;\r\n\r\n // TODO: TYPE More detailed action types\r\n visualMapModel.option.hoverLink && this.api.dispatchAction({\r\n type: method,\r\n batch: helper.makeHighDownBatch(\r\n visualMapModel.findTargetDataIndices(pieceIndex),\r\n visualMapModel\r\n )\r\n });\r\n };\r\n }\r\n\r\n private _getItemAlign(): helper.ItemAlign {\r\n const visualMapModel = this.visualMapModel;\r\n const modelOption = visualMapModel.option;\r\n\r\n if (modelOption.orient === 'vertical') {\r\n return helper.getItemAlign(\r\n visualMapModel, this.api, visualMapModel.itemSize\r\n );\r\n }\r\n else { // horizontal, most case left unless specifying right.\r\n let align = modelOption.align;\r\n if (!align || align === 'auto') {\r\n align = 'left';\r\n }\r\n return align;\r\n }\r\n }\r\n\r\n private _renderEndsText(\r\n group: graphic.Group,\r\n text: string,\r\n itemSize: number[],\r\n showLabel: boolean,\r\n itemAlign: helper.ItemAlign\r\n ) {\r\n if (!text) {\r\n return;\r\n }\r\n\r\n const itemGroup = new graphic.Group();\r\n const textStyleModel = this.visualMapModel.textStyleModel;\r\n\r\n itemGroup.add(new graphic.Text({\r\n style: createTextStyle(textStyleModel, {\r\n x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2,\r\n y: itemSize[1] / 2,\r\n verticalAlign: 'middle',\r\n align: showLabel ? (itemAlign as TextAlign) : 'center',\r\n text\r\n })\r\n }));\r\n\r\n group.add(itemGroup);\r\n }\r\n\r\n /**\r\n * @private\r\n * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.\r\n */\r\n private _getViewData() {\r\n const visualMapModel = this.visualMapModel;\r\n\r\n const viewPieceList = zrUtil.map(visualMapModel.getPieceList(), function (piece, index) {\r\n return {piece: piece, indexInModelPieceList: index};\r\n });\r\n let endsText = visualMapModel.get('text');\r\n\r\n // Consider orient and inverse.\r\n const orient = visualMapModel.get('orient');\r\n const inverse = visualMapModel.get('inverse');\r\n\r\n // Order of model pieceList is always [low, ..., high]\r\n if (orient === 'horizontal' ? inverse : !inverse) {\r\n viewPieceList.reverse();\r\n }\r\n // Origin order of endsText is [high, low]\r\n else if (endsText) {\r\n endsText = endsText.slice().reverse();\r\n }\r\n\r\n return {viewPieceList: viewPieceList, endsText: endsText};\r\n }\r\n\r\n private _createItemSymbol(\r\n group: graphic.Group,\r\n representValue: number,\r\n shapeParam: number[]\r\n ) {\r\n group.add(createSymbol(\r\n // symbol will be string\r\n this.getControllerVisual(representValue, 'symbol') as string,\r\n shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3],\r\n // color will be string\r\n this.getControllerVisual(representValue, 'color') as string\r\n ));\r\n }\r\n\r\n private _onItemClick(\r\n piece: VisualMappingOption['pieceList'][number]\r\n ) {\r\n const visualMapModel = this.visualMapModel;\r\n const option = visualMapModel.option;\r\n const selectedMode = option.selectedMode;\r\n if (!selectedMode) {\r\n return;\r\n }\r\n const selected = zrUtil.clone(option.selected);\r\n const newKey = visualMapModel.getSelectedMapKey(piece);\r\n\r\n if (selectedMode === 'single' || selectedMode === true) {\r\n selected[newKey] = true;\r\n zrUtil.each(selected, function (o, key) {\r\n selected[key] = key === newKey;\r\n });\r\n }\r\n else {\r\n selected[newKey] = !selected[newKey];\r\n }\r\n\r\n this.api.dispatchAction({\r\n type: 'selectDataRange',\r\n from: this.uid,\r\n visualMapId: this.visualMapModel.id,\r\n selected: selected\r\n });\r\n }\r\n}\r\n\r\nexport default PiecewiseVisualMapView;", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport PiecewiseModel from './PiecewiseModel';\r\nimport PiecewiseView from './PiecewiseView';\r\nimport installCommon from './installCommon';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(PiecewiseModel);\r\n registers.registerComponentView(PiecewiseView);\r\n\r\n installCommon(registers);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters, use } from '../../extension';\r\nimport {install as installVisualMapContinuous} from './installVisualMapContinuous';\r\nimport {install as installVisualMapPiecewise} from './installVisualMapPiecewise';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n use(installVisualMapContinuous);\r\n use(installVisualMapPiecewise);\r\n\r\n // Do not install './dataZoomSelect',\r\n // since it only work for toolbox dataZoom.\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport GlobalModel from '../model/Global';\r\nimport Model from '../model/Model';\r\nimport SeriesModel from '../model/Series';\r\nimport {makeInner} from '../util/model';\r\nimport {Dictionary, DecalObject, InnerDecalObject, AriaOption} from '../util/types';\r\nimport {LocaleOption} from '../core/locale';\r\nimport { getDecalFromPalette } from '../model/mixin/palette';\r\nimport type {TitleOption} from '../component/title/install';\r\n\r\nconst DEFAULT_OPTION: AriaOption = {\r\n label: {\r\n enabled: true\r\n },\r\n decal: {\r\n show: false\r\n }\r\n};\r\n\r\nconst inner = makeInner<{scope: object}, SeriesModel>();\r\n\r\nconst decalPaletteScope: Dictionary = {};\r\n\r\ntype SeriesTypes = keyof LocaleOption['series']['typeNames'];\r\n\r\nexport default function ariaVisual(ecModel: GlobalModel, api: ExtensionAPI) {\r\n const ariaModel: Model = ecModel.getModel('aria');\r\n\r\n // See \"area enabled\" detection code in `GlobalModel.ts`.\r\n if (!ariaModel.get('enabled')) {\r\n return;\r\n }\r\n\r\n const defaultOption = zrUtil.clone(DEFAULT_OPTION);\r\n zrUtil.merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\r\n zrUtil.merge(ariaModel.option, defaultOption, false);\r\n\r\n setDecal();\r\n setLabel();\r\n\r\n function setDecal() {\r\n const decalModel = ariaModel.getModel('decal');\r\n\r\n const useDecal = decalModel.get('show');\r\n if (useDecal) {\r\n // Each type of series use one scope.\r\n // Pie and funnel are using different scopes.\r\n const paletteScopeGroupByType = zrUtil.createHashMap();\r\n ecModel.eachSeries((seriesModel: SeriesModel) => {\r\n if (seriesModel.isColorBySeries()) {\r\n return;\r\n }\r\n let decalScope = paletteScopeGroupByType.get(seriesModel.type);\r\n if (!decalScope) {\r\n decalScope = {};\r\n paletteScopeGroupByType.set(seriesModel.type, decalScope);\r\n }\r\n inner(seriesModel).scope = decalScope;\r\n });\r\n\r\n ecModel.eachRawSeries((seriesModel: SeriesModel) => {\r\n if (ecModel.isSeriesFiltered(seriesModel)) {\r\n return;\r\n }\r\n if (zrUtil.isFunction(seriesModel.enableAriaDecal)) {\r\n // Let series define how to use decal palette on data\r\n seriesModel.enableAriaDecal();\r\n return;\r\n }\r\n\r\n const data = seriesModel.getData();\r\n\r\n if (!seriesModel.isColorBySeries()) {\r\n const dataAll = seriesModel.getRawData();\r\n const idxMap: Dictionary = {};\r\n const decalScope = inner(seriesModel).scope;\r\n\r\n data.each(function (idx) {\r\n const rawIdx = data.getRawIndex(idx);\r\n idxMap[rawIdx] = idx;\r\n });\r\n\r\n const dataCount = dataAll.count();\r\n dataAll.each(rawIdx => {\r\n const idx = idxMap[rawIdx];\r\n const name = dataAll.getName(rawIdx) || (rawIdx + '');\r\n const paletteDecal = getDecalFromPalette(\r\n seriesModel.ecModel,\r\n name,\r\n decalScope,\r\n dataCount\r\n );\r\n const specifiedDecal = data.getItemVisual(idx, 'decal');\r\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\r\n });\r\n }\r\n else {\r\n const paletteDecal = getDecalFromPalette(\r\n seriesModel.ecModel,\r\n seriesModel.name,\r\n decalPaletteScope,\r\n ecModel.getSeriesCount()\r\n );\r\n const specifiedDecal = data.getVisual('decal');\r\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\r\n }\r\n\r\n function mergeDecal(specifiedDecal: DecalObject, paletteDecal: DecalObject): DecalObject {\r\n // Merge decal from palette to decal from itemStyle.\r\n // User do not need to specify all of the decal props.\r\n const resultDecal = specifiedDecal\r\n ? zrUtil.extend(zrUtil.extend({}, paletteDecal), specifiedDecal)\r\n : paletteDecal;\r\n (resultDecal as InnerDecalObject).dirty = true;\r\n return resultDecal;\r\n }\r\n });\r\n }\r\n }\r\n\r\n function setLabel() {\r\n const dom = api.getZr().dom;\r\n // TODO: support for SSR\r\n if (!dom) {\r\n return;\r\n }\r\n\r\n const labelLocale = ecModel.getLocaleModel().get('aria');\r\n const labelModel = ariaModel.getModel('label');\r\n labelModel.option = zrUtil.defaults(labelModel.option, labelLocale);\r\n\r\n if (!labelModel.get('enabled')) {\r\n return;\r\n }\r\n\r\n dom.setAttribute('role', 'img');\r\n\r\n if (labelModel.get('description')) {\r\n dom.setAttribute('aria-label', labelModel.get('description'));\r\n return;\r\n }\r\n\r\n const seriesCnt = ecModel.getSeriesCount();\r\n const maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\r\n const maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\r\n const displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\r\n\r\n let ariaLabel;\r\n if (seriesCnt < 1) {\r\n // No series, no aria label\r\n return;\r\n }\r\n else {\r\n const title = getTitle();\r\n if (title) {\r\n const withTitle = labelModel.get(['general', 'withTitle']);\r\n ariaLabel = replace(withTitle, {\r\n title: title\r\n });\r\n }\r\n else {\r\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\r\n }\r\n\r\n const seriesLabels: string[] = [];\r\n const prefix = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', 'prefix'])\r\n : labelModel.get(['series', 'single', 'prefix']);\r\n ariaLabel += replace(prefix, { seriesCount: seriesCnt });\r\n\r\n ecModel.eachSeries(function (seriesModel, idx) {\r\n if (idx < displaySeriesCnt) {\r\n let seriesLabel;\r\n\r\n const seriesName = seriesModel.get('name');\r\n const withName = seriesName ? 'withName' : 'withoutName';\r\n seriesLabel = seriesCnt > 1\r\n ? labelModel.get(['series', 'multiple', withName])\r\n : labelModel.get(['series', 'single', withName]);\r\n\r\n seriesLabel = replace(seriesLabel, {\r\n seriesId: seriesModel.seriesIndex,\r\n seriesName: seriesModel.get('name'),\r\n seriesType: getSeriesTypeName(seriesModel.subType as SeriesTypes)\r\n });\r\n\r\n const data = seriesModel.getData();\r\n if (data.count() > maxDataCnt) {\r\n // Show part of data\r\n const partialLabel = labelModel.get(['data', 'partialData']);\r\n seriesLabel += replace(partialLabel, {\r\n displayCnt: maxDataCnt\r\n });\r\n }\r\n else {\r\n seriesLabel += labelModel.get(['data', 'allData']);\r\n }\r\n\r\n const middleSeparator = labelModel.get(['data', 'separator', 'middle']);\r\n const endSeparator = labelModel.get(['data', 'separator', 'end']);\r\n const excludeDimensionId = labelModel.get(['data', 'excludeDimensionId']);\r\n const dataLabels = [];\r\n for (let i = 0; i < data.count(); i++) {\r\n if (i < maxDataCnt) {\r\n const name = data.getName(i);\r\n const value = !excludeDimensionId ? data.getValues(i)\r\n : zrUtil.filter(data.getValues(i), (v, j) =>\r\n zrUtil.indexOf(excludeDimensionId, j) === -1);\r\n const dataLabel = labelModel.get(['data', name ? 'withName' : 'withoutName']);\r\n dataLabels.push(\r\n replace(dataLabel, {\r\n name: name,\r\n value: value.join(middleSeparator)\r\n })\r\n );\r\n }\r\n }\r\n seriesLabel += dataLabels.join(middleSeparator) + endSeparator;\r\n\r\n seriesLabels.push(seriesLabel);\r\n }\r\n });\r\n\r\n const separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\r\n const middleSeparator = separatorModel.get('middle');\r\n const endSeparator = separatorModel.get('end');\r\n ariaLabel += seriesLabels.join(middleSeparator) + endSeparator;\r\n\r\n dom.setAttribute('aria-label', ariaLabel);\r\n }\r\n }\r\n\r\n function replace(str: string, keyValues: object) {\r\n if (!zrUtil.isString(str)) {\r\n return str;\r\n }\r\n\r\n let result = str;\r\n zrUtil.each(keyValues, function (value: string, key: string) {\r\n result = result.replace(\r\n new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'),\r\n value\r\n );\r\n });\r\n return result;\r\n }\r\n\r\n function getTitle() {\r\n let title = ecModel.get('title') as TitleOption | TitleOption[];\r\n if (title && (title as TitleOption[]).length) {\r\n title = (title as TitleOption[])[0];\r\n }\r\n return title && (title as TitleOption).text;\r\n }\r\n\r\n function getSeriesTypeName(type: SeriesTypes) {\r\n const typeNames = ecModel.getLocaleModel().get(['series', 'typeNames']);\r\n return typeNames[type] || typeNames.chart;\r\n }\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport * as zrUtil from 'zrender/src/core/util';\r\nimport { ECUnitOption, AriaOptionMixin } from '../../util/types';\r\n\r\nexport default function ariaPreprocessor(option: ECUnitOption & AriaOptionMixin) {\r\n if (!option || !option.aria) {\r\n return;\r\n }\r\n\r\n const aria = option.aria;\r\n // aria.show is deprecated and should use aria.enabled instead\r\n if ((aria as any).show != null) {\r\n aria.enabled = (aria as any).show;\r\n }\r\n\r\n aria.label = aria.label || {};\r\n // move description, general, series, data to be under aria.label\r\n zrUtil.each(['description', 'general', 'series', 'data'], name => {\r\n if ((aria as any)[name] != null) {\r\n (aria.label as any)[name] = (aria as any)[name];\r\n }\r\n });\r\n}\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport ariaVisual from '../../visual/aria';\r\nimport ariaPreprocessor from './preprocessor';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerPreprocessor(ariaPreprocessor);\r\n registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { OptionDataValue, DimensionLoose, Dictionary } from './types';\r\nimport {\r\n keys, isArray, map, isObject, isString, HashMap, isRegExp, isArrayLike, hasOwn, isNumber\r\n} from 'zrender/src/core/util';\r\nimport { throwError, makePrintable } from './log';\r\nimport {\r\n RawValueParserType, getRawValueParser,\r\n RelationalOperator, FilterComparator, createFilterComparator\r\n} from '../data/helper/dataValueHelper';\r\n\r\n\r\n// PENDING:\r\n// (1) Support more parser like: `parser: 'trim'`, `parser: 'lowerCase'`, `parser: 'year'`, `parser: 'dayOfWeek'`?\r\n// (2) Support piped parser?\r\n// (3) Support callback parser or callback condition?\r\n// (4) At present do not support string expression yet but only structured expression.\r\n\r\n\r\n/**\r\n * The structured expression considered:\r\n * (1) Literal simplicity\r\n * (2) Semantic displayed clearly\r\n *\r\n * Semantic supports:\r\n * (1) relational expression\r\n * (2) logical expression\r\n *\r\n * For example:\r\n * ```js\r\n * {\r\n * and: [{\r\n * or: [{\r\n * dimension: 'Year', gt: 2012, lt: 2019\r\n * }, {\r\n * dimension: 'Year', '>': 2002, '<=': 2009\r\n * }]\r\n * }, {\r\n * dimension: 'Product', eq: 'Tofu'\r\n * }]\r\n * }\r\n *\r\n * { dimension: 'Product', eq: 'Tofu' }\r\n *\r\n * {\r\n * or: [\r\n * { dimension: 'Product', value: 'Tofu' },\r\n * { dimension: 'Product', value: 'Biscuit' }\r\n * ]\r\n * }\r\n *\r\n * {\r\n * and: [true]\r\n * }\r\n * ```\r\n *\r\n * [PARSER]\r\n * In an relation expression object, we can specify some built-in parsers:\r\n * ```js\r\n * // Trim if string\r\n * {\r\n * parser: 'trim',\r\n * eq: 'Flowers'\r\n * }\r\n * // Parse as time and enable arithmetic relation comparison.\r\n * {\r\n * parser: 'time',\r\n * lt: '2012-12-12'\r\n * }\r\n * // Normalize number-like string and make '-' to Null.\r\n * {\r\n * parser: 'time',\r\n * lt: '2012-12-12'\r\n * }\r\n * // Normalize to number:\r\n * // + number-like string (like ' 123 ') can be converted to a number.\r\n * // + where null/undefined or other string will be converted to NaN.\r\n * {\r\n * parser: 'number',\r\n * eq: 2011\r\n * }\r\n * // RegExp, include the feature in SQL: `like '%xxx%'`.\r\n * {\r\n * reg: /^asdf$/\r\n * }\r\n * {\r\n * reg: '^asdf$' // Serializable reg exp, will be `new RegExp(...)`\r\n * }\r\n * ```\r\n *\r\n *\r\n * [EMPTY_RULE]\r\n * (1) If a relational expression set value as `null`/`undefined` like:\r\n * `{ dimension: 'Product', lt: undefined }`,\r\n * The result will be `false` rather than `true`.\r\n * Consider the case like \"filter condition\", return all result when null/undefined\r\n * is probably not expected and even dangours.\r\n * (2) If a relational expression has no operator like:\r\n * `{ dimension: 'Product' }`,\r\n * An error will be thrown. Because it is probably a mistake.\r\n * (3) If a logical expression has no children like\r\n * `{ and: undefined }` or `{ and: [] }`,\r\n * An error will be thrown. Because it is probably an mistake.\r\n * (4) If intending have a condition that always `true` or always `false`,\r\n * Use `true` or `flase`.\r\n * The entire condition can be `true`/`false`,\r\n * or also can be `{ and: [true] }`, `{ or: [false] }`\r\n */\r\n\r\n\r\n// --------------------------------------------------\r\n// --- Relational Expression --------------------------\r\n// --------------------------------------------------\r\n\r\n/**\r\n * Date string and ordinal string can be accepted.\r\n */\r\ninterface RelationalExpressionOptionByOp extends Record {\r\n reg?: RegExp | string; // RegExp\r\n};\r\nconst RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\r\n value: 'eq',\r\n\r\n // PENDING: not good for literal semantic?\r\n '<': 'lt',\r\n '<=': 'lte',\r\n '>': 'gt',\r\n '>=': 'gte',\r\n '=': 'eq',\r\n '!=': 'ne',\r\n '<>': 'ne'\r\n\r\n // Might be misleading for sake of the difference between '==' and '===',\r\n // so don't support them.\r\n // '==': 'eq',\r\n // '===': 'seq',\r\n // '!==': 'sne'\r\n\r\n // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\r\n // ge: 'gte',\r\n // le: 'lte',\r\n // neq: 'ne',\r\n} as const;\r\ntype RelationalExpressionOptionByOpAlias = Record;\r\n\r\ninterface RelationalExpressionOption extends\r\n RelationalExpressionOptionByOp, RelationalExpressionOptionByOpAlias {\r\n dimension?: DimensionLoose;\r\n parser?: RawValueParserType;\r\n}\r\n\r\n// type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;\r\n\r\n\r\nclass RegExpEvaluator implements FilterComparator {\r\n private _condVal: RegExp;\r\n\r\n constructor(rVal: unknown) {\r\n // Support condVal: RegExp | string\r\n const condValue = this._condVal = isString(rVal) ? new RegExp(rVal)\r\n : isRegExp(rVal) ? rVal as RegExp\r\n : null;\r\n if (condValue == null) {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\r\n }\r\n throwError(errMsg);\r\n }\r\n }\r\n\r\n evaluate(lVal: unknown): boolean {\r\n const type = typeof lVal;\r\n return isString(type) ? this._condVal.test(lVal as string)\r\n : isNumber(type) ? this._condVal.test(lVal + '')\r\n : false;\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n// --------------------------------------------------\r\n// --- Logical Expression ---------------------------\r\n// --------------------------------------------------\r\n\r\n\r\ninterface LogicalExpressionOption {\r\n and?: LogicalExpressionSubOption[];\r\n or?: LogicalExpressionSubOption[];\r\n not?: LogicalExpressionSubOption;\r\n}\r\ntype LogicalExpressionSubOption =\r\n LogicalExpressionOption | RelationalExpressionOption | TrueFalseExpressionOption;\r\n\r\n\r\n\r\n// -----------------------------------------------------\r\n// --- Conditional Expression --------------------------\r\n// -----------------------------------------------------\r\n\r\n\r\nexport type TrueExpressionOption = true;\r\nexport type FalseExpressionOption = false;\r\nexport type TrueFalseExpressionOption = TrueExpressionOption | FalseExpressionOption;\r\n\r\nexport type ConditionalExpressionOption =\r\n LogicalExpressionOption\r\n | RelationalExpressionOption\r\n | TrueFalseExpressionOption;\r\n\r\ntype ValueGetterParam = Dictionary;\r\nexport interface ConditionalExpressionValueGetterParamGetter {\r\n (relExpOption: RelationalExpressionOption): VGP\r\n}\r\nexport interface ConditionalExpressionValueGetter {\r\n (param: VGP): OptionDataValue\r\n}\r\n\r\ninterface ParsedConditionInternal {\r\n evaluate(): boolean;\r\n}\r\nclass ConstConditionInternal implements ParsedConditionInternal {\r\n value: boolean;\r\n evaluate(): boolean {\r\n return this.value;\r\n }\r\n}\r\nclass AndConditionInternal implements ParsedConditionInternal {\r\n children: ParsedConditionInternal[];\r\n evaluate() {\r\n const children = this.children;\r\n for (let i = 0; i < children.length; i++) {\r\n if (!children[i].evaluate()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\nclass OrConditionInternal implements ParsedConditionInternal {\r\n children: ParsedConditionInternal[];\r\n evaluate() {\r\n const children = this.children;\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].evaluate()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nclass NotConditionInternal implements ParsedConditionInternal {\r\n child: ParsedConditionInternal;\r\n evaluate() {\r\n return !this.child.evaluate();\r\n }\r\n}\r\nclass RelationalConditionInternal implements ParsedConditionInternal {\r\n valueGetterParam: ValueGetterParam;\r\n valueParser: ReturnType;\r\n // If no parser, be null/undefined.\r\n getValue: ConditionalExpressionValueGetter;\r\n subCondList: FilterComparator[];\r\n\r\n evaluate() {\r\n const needParse = !!this.valueParser;\r\n // Call getValue with no `this`.\r\n const getValue = this.getValue;\r\n const tarValRaw = getValue(this.valueGetterParam);\r\n const tarValParsed = needParse ? this.valueParser(tarValRaw) : null;\r\n\r\n // Relational cond follow \"and\" logic internally.\r\n for (let i = 0; i < this.subCondList.length; i++) {\r\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nfunction parseOption(\r\n exprOption: ConditionalExpressionOption,\r\n getters: ConditionalGetters\r\n): ParsedConditionInternal {\r\n if (exprOption === true || exprOption === false) {\r\n const cond = new ConstConditionInternal();\r\n cond.value = exprOption as boolean;\r\n return cond;\r\n }\r\n\r\n let errMsg = '';\r\n if (!isObjectNotArray(exprOption)) {\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'Illegal config. Expect a plain object but actually', exprOption\r\n );\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n if ((exprOption as LogicalExpressionOption).and) {\r\n return parseAndOrOption('and', exprOption as LogicalExpressionOption, getters);\r\n }\r\n else if ((exprOption as LogicalExpressionOption).or) {\r\n return parseAndOrOption('or', exprOption as LogicalExpressionOption, getters);\r\n }\r\n else if ((exprOption as LogicalExpressionOption).not) {\r\n return parseNotOption(exprOption as LogicalExpressionOption, getters);\r\n }\r\n\r\n return parseRelationalOption(exprOption as RelationalExpressionOption, getters);\r\n}\r\n\r\nfunction parseAndOrOption(\r\n op: 'and' | 'or',\r\n exprOption: LogicalExpressionOption,\r\n getters: ConditionalGetters\r\n): ParsedConditionInternal {\r\n const subOptionArr = exprOption[op] as ConditionalExpressionOption[];\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n '\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.',\r\n 'Illegal condition:', exprOption\r\n );\r\n }\r\n if (!isArray(subOptionArr)) {\r\n throwError(errMsg);\r\n }\r\n if (!(subOptionArr as []).length) {\r\n throwError(errMsg);\r\n }\r\n const cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\r\n cond.children = map(subOptionArr, subOption => parseOption(subOption, getters));\r\n if (!cond.children.length) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n}\r\n\r\nfunction parseNotOption(\r\n exprOption: LogicalExpressionOption,\r\n getters: ConditionalGetters\r\n): ParsedConditionInternal {\r\n const subOption = exprOption.not as ConditionalExpressionOption;\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n '\"not\" condition should only be `not: {}`.',\r\n 'Illegal condition:', exprOption\r\n );\r\n }\r\n if (!isObjectNotArray(subOption)) {\r\n throwError(errMsg);\r\n }\r\n const cond = new NotConditionInternal();\r\n cond.child = parseOption(subOption, getters);\r\n if (!cond.child) {\r\n throwError(errMsg);\r\n }\r\n return cond;\r\n}\r\n\r\nfunction parseRelationalOption(\r\n exprOption: RelationalExpressionOption,\r\n getters: ConditionalGetters\r\n): ParsedConditionInternal {\r\n let errMsg = '';\r\n\r\n const valueGetterParam = getters.prepareGetValue(exprOption);\r\n\r\n const subCondList = [] as RelationalConditionInternal['subCondList'];\r\n const exprKeys = keys(exprOption);\r\n\r\n const parserName = exprOption.parser;\r\n const valueParser = parserName ? getRawValueParser(parserName) : null;\r\n\r\n for (let i = 0; i < exprKeys.length; i++) {\r\n const keyRaw = exprKeys[i];\r\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\r\n continue;\r\n }\r\n\r\n const op: keyof RelationalExpressionOptionByOp = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw)\r\n ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw as keyof RelationalExpressionOptionByOpAlias]\r\n : (keyRaw as keyof RelationalExpressionOptionByOp);\r\n const condValueRaw = exprOption[keyRaw];\r\n const condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\r\n const evaluator = createFilterComparator(op, condValueParsed)\r\n || (op === 'reg' && new RegExpEvaluator(condValueParsed));\r\n\r\n if (!evaluator) {\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption\r\n );\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n subCondList.push(evaluator);\r\n }\r\n\r\n if (!subCondList.length) {\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'Relational condition must have at least one operator.',\r\n 'Illegal condition:', exprOption\r\n );\r\n }\r\n // No relational operator always disabled in case of dangers result.\r\n throwError(errMsg);\r\n }\r\n\r\n const cond = new RelationalConditionInternal();\r\n cond.valueGetterParam = valueGetterParam;\r\n cond.valueParser = valueParser;\r\n cond.getValue = getters.getValue;\r\n cond.subCondList = subCondList;\r\n\r\n return cond;\r\n}\r\n\r\nfunction isObjectNotArray(val: unknown): boolean {\r\n return isObject(val) && !isArrayLike(val);\r\n}\r\n\r\n\r\nclass ConditionalExpressionParsed {\r\n\r\n private _cond: ParsedConditionInternal;\r\n\r\n constructor(\r\n exprOption: ConditionalExpressionOption,\r\n getters: ConditionalGetters\r\n ) {\r\n this._cond = parseOption(exprOption, getters);\r\n }\r\n\r\n evaluate(): boolean {\r\n return this._cond.evaluate();\r\n }\r\n};\r\n\r\ninterface ConditionalGetters {\r\n prepareGetValue: ConditionalExpressionValueGetterParamGetter;\r\n getValue: ConditionalExpressionValueGetter;\r\n valueGetterAttrMap: HashMap;\r\n}\r\n\r\nexport function parseConditionalExpression(\r\n exprOption: ConditionalExpressionOption,\r\n getters: ConditionalGetters\r\n): ConditionalExpressionParsed {\r\n return new ConditionalExpressionParsed(exprOption, getters);\r\n}\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n DataTransformOption, ExternalDataTransform, DataTransformDataItem, ExternalDataTransformResultItem\r\n} from '../../data/helper/transform';\r\nimport { DimensionIndex } from '../../util/types';\r\nimport { parseConditionalExpression, ConditionalExpressionOption } from '../../util/conditionalExpression';\r\nimport { hasOwn, createHashMap } from 'zrender/src/core/util';\r\nimport { makePrintable, throwError } from '../../util/log';\r\n\r\n\r\nexport interface FilterTransformOption extends DataTransformOption {\r\n type: 'filter';\r\n config: ConditionalExpressionOption;\r\n}\r\n\r\nexport const filterTransform: ExternalDataTransform = {\r\n\r\n type: 'echarts:filter',\r\n\r\n // PENDING: enhance to filter by index rather than create new data\r\n transform: function (params) {\r\n // [Caveat] Fail-Fast:\r\n // Do not return the whole dataset unless user config indicates it explicitly.\r\n // For example, if no condition is specified by mistake, returning an empty result\r\n // is better than returning the entire raw source for the user to find the mistake.\r\n\r\n const upstream = params.upstream;\r\n let rawItem: DataTransformDataItem;\r\n\r\n const condition = parseConditionalExpression<{ dimIdx: DimensionIndex }>(params.config, {\r\n\r\n valueGetterAttrMap: createHashMap({ dimension: true }),\r\n\r\n prepareGetValue: function (exprOption) {\r\n let errMsg = '';\r\n const dimLoose = exprOption.dimension;\r\n if (!hasOwn(exprOption, 'dimension')) {\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'Relation condition must has prop \"dimension\" specified.',\r\n 'Illegal condition:', exprOption\r\n );\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n const dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'Can not find dimension info via: ' + dimLoose + '.\\n',\r\n 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n',\r\n 'Illegal condition:', exprOption, '.\\n'\r\n );\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n return { dimIdx: dimInfo.index };\r\n },\r\n\r\n getValue: function (param) {\r\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\r\n }\r\n });\r\n\r\n const resultData = [];\r\n for (let i = 0, len = upstream.count(); i < len; i++) {\r\n rawItem = upstream.getRawDataItem(i);\r\n if (condition.evaluate()) {\r\n resultData.push(rawItem as any);\r\n }\r\n }\r\n\r\n return {\r\n data: resultData as ExternalDataTransformResultItem['data']\r\n };\r\n }\r\n};\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n DataTransformOption, ExternalDataTransform, ExternalDataTransformResultItem\r\n} from '../../data/helper/transform';\r\nimport {\r\n DimensionLoose, DimensionIndex, OptionDataValue, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS\r\n} from '../../util/types';\r\nimport { makePrintable, throwError } from '../../util/log';\r\nimport { each } from 'zrender/src/core/util';\r\nimport { normalizeToArray } from '../../util/model';\r\nimport {\r\n RawValueParserType, getRawValueParser, SortOrderComparator\r\n} from '../../data/helper/dataValueHelper';\r\n\r\n/**\r\n * @usage\r\n *\r\n * ```js\r\n * transform: {\r\n * type: 'sort',\r\n * config: { dimension: 'score', order: 'asc' }\r\n * }\r\n * transform: {\r\n * type: 'sort',\r\n * config: [\r\n * { dimension: 1, order: 'asc' },\r\n * { dimension: 'age', order: 'desc' }\r\n * ]\r\n * }\r\n * ```\r\n */\r\n\r\nexport interface SortTransformOption extends DataTransformOption {\r\n type: 'sort';\r\n config: OrderExpression | OrderExpression[];\r\n}\r\n\r\n// PENDING: whether support { dimension: 'score', order: 'asc' } ?\r\ntype OrderExpression = {\r\n dimension: DimensionLoose;\r\n order: 'asc' | 'desc';\r\n parser?: RawValueParserType;\r\n // The meansing of \"incomparable\": see [SORT_COMPARISON_RULE]\r\n // in `data/helper/dataValueHelper.ts`\r\n incomparable?: 'min' | 'max';\r\n};\r\n\r\n\r\nlet sampleLog = '';\r\nif (__DEV__) {\r\n sampleLog = [\r\n 'Valid config is like:',\r\n '{ dimension: \"age\", order: \"asc\" }',\r\n 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'\r\n ].join(' ');\r\n}\r\n\r\n\r\nexport const sortTransform: ExternalDataTransform = {\r\n\r\n type: 'echarts:sort',\r\n\r\n transform: function (params) {\r\n const upstream = params.upstream;\r\n const config = params.config;\r\n let errMsg = '';\r\n\r\n // Normalize\r\n // const orderExprList: OrderExpression[] = isArray(config[0])\r\n // ? config as OrderExpression[]\r\n // : [config as OrderExpression];\r\n const orderExprList: OrderExpression[] = normalizeToArray(config);\r\n\r\n if (!orderExprList.length) {\r\n if (__DEV__) {\r\n errMsg = 'Empty `config` in sort transform.';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n const orderDefList: {\r\n dimIdx: DimensionIndex;\r\n parser: ReturnType;\r\n comparator: SortOrderComparator\r\n }[] = [];\r\n each(orderExprList, function (orderExpr) {\r\n const dimLoose = orderExpr.dimension;\r\n const order = orderExpr.order;\r\n const parserName = orderExpr.parser;\r\n const incomparable = orderExpr.incomparable;\r\n\r\n if (dimLoose == null) {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n if (order !== 'asc' && order !== 'desc') {\r\n if (__DEV__) {\r\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n if (incomparable && (incomparable !== 'min' && incomparable !== 'max')) {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n if (order !== 'asc' && order !== 'desc') {\r\n let errMsg = '';\r\n if (__DEV__) {\r\n errMsg = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n const dimInfo = upstream.getDimensionInfo(dimLoose);\r\n if (!dimInfo) {\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'Can not find dimension info via: ' + dimLoose + '.\\n',\r\n 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n',\r\n 'Illegal config:', orderExpr, '.\\n'\r\n );\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n const parser = parserName ? getRawValueParser(parserName) : null;\r\n if (parserName && !parser) {\r\n if (__DEV__) {\r\n errMsg = makePrintable(\r\n 'Invalid parser name ' + parserName + '.\\n',\r\n 'Illegal config:', orderExpr, '.\\n'\r\n );\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n orderDefList.push({\r\n dimIdx: dimInfo.index,\r\n parser: parser,\r\n comparator: new SortOrderComparator(order, incomparable)\r\n });\r\n });\r\n\r\n // TODO: support it?\r\n const sourceFormat = upstream.sourceFormat;\r\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS\r\n && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS\r\n ) {\r\n if (__DEV__) {\r\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\r\n }\r\n throwError(errMsg);\r\n }\r\n\r\n // Other upstream format are all array.\r\n const resultData = [];\r\n for (let i = 0, len = upstream.count(); i < len; i++) {\r\n resultData.push(upstream.getRawDataItem(i));\r\n }\r\n\r\n resultData.sort(function (item0, item1) {\r\n for (let i = 0; i < orderDefList.length; i++) {\r\n const orderDef = orderDefList[i];\r\n let val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\r\n let val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\r\n if (orderDef.parser) {\r\n val0 = orderDef.parser(val0) as OptionDataValue;\r\n val1 = orderDef.parser(val1) as OptionDataValue;\r\n }\r\n const result = orderDef.comparator.evaluate(val0, val1);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n }\r\n return 0;\r\n });\r\n\r\n return {\r\n data: resultData as ExternalDataTransformResultItem['data']\r\n };\r\n }\r\n};\r\n\r\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\nimport {filterTransform} from './filterTransform';\r\nimport {sortTransform} from './sortTransform';\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerTransform(filterTransform);\r\n registers.registerTransform(sortTransform);\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n/**\r\n * This module is imported by echarts directly.\r\n *\r\n * Notice:\r\n * Always keep this file exists for backward compatibility.\r\n * Because before 4.1.0, dataset is an optional component,\r\n * some users may import this module manually.\r\n */\r\n\r\nimport ComponentModel from '../../model/Component';\r\nimport ComponentView from '../../view/Component';\r\nimport {\r\n SERIES_LAYOUT_BY_COLUMN, ComponentOption, SeriesEncodeOptionMixin,\r\n OptionSourceData, SeriesLayoutBy, OptionSourceHeader\r\n} from '../../util/types';\r\nimport { DataTransformOption, PipedDataTransformOption } from '../../data/helper/transform';\r\nimport GlobalModel from '../../model/Global';\r\nimport Model from '../../model/Model';\r\nimport { disableTransformOptionMerge, SourceManager } from '../../data/helper/sourceManager';\r\nimport { EChartsExtensionInstallRegisters } from '../../extension';\r\n\r\n\r\nexport interface DatasetOption extends\r\n Pick,\r\n Pick {\r\n mainType?: 'dataset';\r\n\r\n seriesLayoutBy?: SeriesLayoutBy;\r\n sourceHeader?: OptionSourceHeader;\r\n source?: OptionSourceData;\r\n\r\n fromDatasetIndex?: number;\r\n fromDatasetId?: string;\r\n transform?: DataTransformOption | PipedDataTransformOption;\r\n // When a transform result more than on results, the results can be referenced only by:\r\n // Using `fromDatasetIndex`/`fromDatasetId` and `transfromResultIndex` to retrieve\r\n // the results from other dataset.\r\n fromTransformResult?: number;\r\n}\r\n\r\nexport class DatasetModel extends ComponentModel {\r\n\r\n type = 'dataset';\r\n static type = 'dataset';\r\n\r\n static defaultOption: DatasetOption = {\r\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\r\n };\r\n\r\n private _sourceManager: SourceManager;\r\n\r\n init(option: Opts, parentModel: Model, ecModel: GlobalModel): void {\r\n super.init(option, parentModel, ecModel);\r\n this._sourceManager = new SourceManager(this);\r\n disableTransformOptionMerge(this);\r\n }\r\n\r\n mergeOption(newOption: Opts, ecModel: GlobalModel): void {\r\n super.mergeOption(newOption, ecModel);\r\n disableTransformOptionMerge(this);\r\n }\r\n\r\n optionUpdated() {\r\n this._sourceManager.dirty();\r\n }\r\n\r\n getSourceManager() {\r\n return this._sourceManager;\r\n }\r\n}\r\n\r\nclass DatasetView extends ComponentView {\r\n static type = 'dataset';\r\n type = 'dataset';\r\n}\r\n\r\nexport function install(registers: EChartsExtensionInstallRegisters) {\r\n registers.registerComponentModel(DatasetModel);\r\n registers.registerComponentView(DatasetView);\r\n}", "import { cubicSubdivide } from '../core/curve';\nimport PathProxy from '../core/PathProxy';\n\nconst CMD = PathProxy.CMD;\n\nfunction aroundEqual(a: number, b: number) {\n return Math.abs(a - b) < 1e-5;\n}\n\nexport function pathToBezierCurves(path: PathProxy) {\n\n const data = path.data;\n const len = path.len();\n\n const bezierArrayGroups: number[][] = [];\n let currentSubpath: number[];\n\n let xi = 0;\n let yi = 0;\n let x0 = 0;\n let y0 = 0;\n\n function createNewSubpath(x: number, y: number) {\n // More than one M command\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n currentSubpath = [x, y];\n }\n\n function addLine(x0: number, y0: number, x1: number, y1: number) {\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\n }\n }\n\n function addArc(startAngle: number, endAngle: number, cx: number, cy: number, rx: number, ry: number) {\n // https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%C3%A9zier-curves\n const delta = Math.abs(endAngle - startAngle);\n const len = Math.tan(delta / 4) * 4 / 3;\n const dir = endAngle < startAngle ? -1 : 1;\n\n const c1 = Math.cos(startAngle);\n const s1 = Math.sin(startAngle);\n const c2 = Math.cos(endAngle);\n const s2 = Math.sin(endAngle);\n\n const x1 = c1 * rx + cx;\n const y1 = s1 * ry + cy;\n\n const x4 = c2 * rx + cx;\n const y4 = s2 * ry + cy;\n\n const hx = rx * len * dir;\n const hy = ry * len * dir;\n currentSubpath.push(\n // Move control points on tangent.\n x1 - hx * s1, y1 + hy * c1,\n x4 + hx * s2, y4 - hy * c2,\n x4, y4\n );\n }\n\n let x1;\n let y1;\n let x2;\n let y2;\n\n for (let i = 0; i < len;) {\n const cmd = data[i++];\n const isFirst = i === 1;\n\n if (isFirst) {\n // \u5982\u679C\u7B2C\u4E00\u4E2A\u547D\u4EE4\u662F L, C, Q\n // \u5219 previous point \u540C\u7ED8\u5236\u547D\u4EE4\u7684\u7B2C\u4E00\u4E2A point\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u4E3A Arc \u7684\u60C5\u51B5\u4E0B\u4F1A\u5728\u540E\u9762\u7279\u6B8A\u5904\u7406\n xi = data[i];\n yi = data[i + 1];\n\n x0 = xi;\n y0 = yi;\n\n if (cmd === CMD.L || cmd === CMD.C || cmd === CMD.Q) {\n // Start point\n currentSubpath = [x0, y0];\n }\n }\n\n switch (cmd) {\n case CMD.M:\n // moveTo \u547D\u4EE4\u91CD\u65B0\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684 subpath, \u5E76\u4E14\u66F4\u65B0\u65B0\u7684\u8D77\u70B9\n // \u5728 closePath \u7684\u65F6\u5019\u4F7F\u7528\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n\n createNewSubpath(x0, y0);\n break;\n case CMD.L:\n x1 = data[i++];\n y1 = data[i++];\n addLine(xi, yi, x1, y1);\n xi = x1;\n yi = y1;\n break;\n case CMD.C:\n currentSubpath.push(\n data[i++], data[i++], data[i++], data[i++],\n xi = data[i++], yi = data[i++]\n );\n break;\n case CMD.Q:\n x1 = data[i++];\n y1 = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n currentSubpath.push(\n // Convert quadratic to cubic\n xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi),\n x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2),\n x2, y2\n );\n xi = x2;\n yi = y2;\n break;\n case CMD.A:\n const cx = data[i++];\n const cy = data[i++];\n const rx = data[i++];\n const ry = data[i++];\n const startAngle = data[i++];\n const endAngle = data[i++] + startAngle;\n\n // TODO Arc rotation\n i += 1;\n const anticlockwise = !data[i++];\n\n x1 = Math.cos(startAngle) * rx + cx;\n y1 = Math.sin(startAngle) * ry + cy;\n if (isFirst) {\n // \u76F4\u63A5\u4F7F\u7528 arc \u547D\u4EE4\n // \u7B2C\u4E00\u4E2A\u547D\u4EE4\u8D77\u70B9\u8FD8\u672A\u5B9A\u4E49\n x0 = x1;\n y0 = y1;\n createNewSubpath(x0, y0);\n }\n else {\n // Connect a line between current point to arc start point.\n addLine(xi, yi, x1, y1);\n }\n\n xi = Math.cos(endAngle) * rx + cx;\n yi = Math.sin(endAngle) * ry + cy;\n\n const step = (anticlockwise ? -1 : 1) * Math.PI / 2;\n\n for (let angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\n const nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\n : Math.min(angle + step, endAngle);\n addArc(angle, nextAngle, cx, cy, rx, ry);\n }\n\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n x1 = x0 + data[i++];\n y1 = y0 + data[i++];\n\n // rect is an individual path.\n createNewSubpath(x1, y0);\n addLine(x1, y0, x1, y1);\n addLine(x1, y1, x0, y1);\n addLine(x0, y1, x0, y0);\n addLine(x0, y0, x1, y0);\n break;\n case CMD.Z:\n currentSubpath && addLine(xi, yi, x0, y0);\n xi = x0;\n yi = y0;\n break;\n }\n }\n\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n\n return bezierArrayGroups;\n}\n\nfunction adpativeBezier(\n x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number,\n out: number[], scale: number\n) {\n // This bezier is used to simulates a line when converting path to beziers.\n if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) {\n out.push(x3, y3);\n return;\n }\n\n const PIXEL_DISTANCE = 2 / scale;\n const PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE;\n\n // Determine if curve is straight enough\n let dx = x3 - x0;\n let dy = y3 - y0;\n const d = Math.sqrt(dx * dx + dy * dy);\n dx /= d;\n dy /= d;\n\n const dx1 = x1 - x0;\n const dy1 = y1 - y0;\n const dx2 = x2 - x3;\n const dy2 = y2 - y3;\n\n const cp1LenSqr = dx1 * dx1 + dy1 * dy1;\n const cp2LenSqr = dx2 * dx2 + dy2 * dy2;\n\n if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) {\n // Add small segment\n out.push(x3, y3);\n return;\n }\n\n // Project length of cp1\n const projLen1 = dx * dx1 + dy * dy1;\n // Project length of cp2\n const projLen2 = -dx * dx2 - dy * dy2;\n\n // Distance from cp1 to start-end line.\n const d1Sqr = cp1LenSqr - projLen1 * projLen1;\n // Distance from cp2 to start-end line.\n const d2Sqr = cp2LenSqr - projLen2 * projLen2;\n\n // IF the cp1 and cp2 is near to the start-line enough\n // We treat it straight enough\n if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0\n && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0\n ) {\n out.push(x3, y3);\n return;\n }\n\n\n const tmpSegX: number[] = [];\n const tmpSegY: number[] = [];\n // Subdivide\n cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY);\n\n adpativeBezier(\n tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3],\n out, scale\n );\n adpativeBezier(\n tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7],\n out, scale\n );\n}\n\nexport function pathToPolygons(path: PathProxy, scale?: number) {\n // TODO Optimize simple case like path is polygon and rect?\n const bezierArrayGroups = pathToBezierCurves(path);\n\n const polygons: number[][] = [];\n\n scale = scale || 1;\n\n for (let i = 0; i < bezierArrayGroups.length; i++) {\n const beziers = bezierArrayGroups[i];\n const polygon: number[] = [];\n let x0 = beziers[0];\n let y0 = beziers[1];\n\n polygon.push(x0, y0);\n\n for (let k = 2; k < beziers.length;) {\n\n const x1 = beziers[k++];\n const y1 = beziers[k++];\n const x2 = beziers[k++];\n const y2 = beziers[k++];\n const x3 = beziers[k++];\n const y3 = beziers[k++];\n\n adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale);\n\n x0 = x3;\n y0 = y3;\n }\n\n polygons.push(polygon);\n }\n return polygons;\n}\n", "import { fromPoints } from '../core/bbox';\nimport BoundingRect from '../core/BoundingRect';\nimport Point from '../core/Point';\nimport { map } from '../core/util';\nimport Path from '../graphic/Path';\nimport Polygon from '../graphic/shape/Polygon';\nimport Rect from '../graphic/shape/Rect';\nimport Sector from '../graphic/shape/Sector';\nimport { pathToPolygons } from './convertPath';\nimport { clonePath } from './path';\n\n// Default shape dividers\n// TODO divide polygon by grids.\ninterface BinaryDivide {\n (shape: Path['shape']): Path['shape'][]\n}\n\n/**\n * Calculating a grid to divide the shape.\n */\nfunction getDividingGrids(dimSize: number[], rowDim: number, count: number) {\n const rowSize = dimSize[rowDim];\n const columnSize = dimSize[1 - rowDim];\n\n const ratio = Math.abs(rowSize / columnSize);\n let rowCount = Math.ceil(Math.sqrt(ratio * count));\n let columnCount = Math.floor(count / rowCount);\n if (columnCount === 0) {\n columnCount = 1;\n rowCount = count;\n }\n\n const grids: number[] = [];\n for (let i = 0; i < rowCount; i++) {\n grids.push(columnCount);\n }\n const currentCount = rowCount * columnCount;\n // Distribute the remaind grid evenly on each row.\n const remained = count - currentCount;\n if (remained > 0) {\n // const stride = Math.max(Math.floor(rowCount / remained), 1);\n for (let i = 0; i < remained; i++) {\n grids[i % rowCount] += 1;\n }\n }\n return grids;\n}\n\n\n// TODO cornerRadius\nfunction divideSector(sectorShape: Sector['shape'], count: number, outShapes: Sector['shape'][]) {\n const r0 = sectorShape.r0;\n const r = sectorShape.r;\n const startAngle = sectorShape.startAngle;\n const endAngle = sectorShape.endAngle;\n const angle = Math.abs(endAngle - startAngle);\n const arcLen = angle * r;\n const deltaR = r - r0;\n\n const isAngleRow = arcLen > Math.abs(deltaR);\n const grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count);\n\n const rowSize = (isAngleRow ? angle : deltaR) / grids.length;\n\n for (let row = 0; row < grids.length; row++) {\n const columnSize = (isAngleRow ? deltaR : angle) / grids[row];\n for (let column = 0; column < grids[row]; column++) {\n const newShape = {} as Sector['shape'];\n\n if (isAngleRow) {\n newShape.startAngle = startAngle + rowSize * row;\n newShape.endAngle = startAngle + rowSize * (row + 1);\n newShape.r0 = r0 + columnSize * column;\n newShape.r = r0 + columnSize * (column + 1);\n }\n else {\n newShape.startAngle = startAngle + columnSize * column;\n newShape.endAngle = startAngle + columnSize * (column + 1);\n newShape.r0 = r0 + rowSize * row;\n newShape.r = r0 + rowSize * (row + 1);\n }\n\n newShape.clockwise = sectorShape.clockwise;\n newShape.cx = sectorShape.cx;\n newShape.cy = sectorShape.cy;\n\n outShapes.push(newShape);\n }\n }\n}\n\nfunction divideRect(rectShape: Rect['shape'], count: number, outShapes: Rect['shape'][]) {\n const width = rectShape.width;\n const height = rectShape.height;\n\n const isHorizontalRow = width > height;\n const grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count);\n const rowSizeDim = isHorizontalRow ? 'width' : 'height';\n const columnSizeDim = isHorizontalRow ? 'height' : 'width';\n const rowDim = isHorizontalRow ? 'x' : 'y';\n const columnDim = isHorizontalRow ? 'y' : 'x';\n const rowSize = rectShape[rowSizeDim] / grids.length;\n\n for (let row = 0; row < grids.length; row++) {\n const columnSize = rectShape[columnSizeDim] / grids[row];\n for (let column = 0; column < grids[row]; column++) {\n const newShape = {} as Rect['shape'];\n newShape[rowDim] = row * rowSize;\n newShape[columnDim] = column * columnSize;\n newShape[rowSizeDim] = rowSize;\n newShape[columnSizeDim] = columnSize;\n\n newShape.x += rectShape.x;\n newShape.y += rectShape.y;\n\n outShapes.push(newShape);\n }\n }\n}\n\nfunction crossProduct2d(x1: number, y1: number, x2: number, y2: number) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction lineLineIntersect(\n a1x: number, a1y: number, a2x: number, a2y: number, // p1\n b1x: number, b1y: number, b2x: number, b2y: number // p2\n): Point {\n const mx = a2x - a1x;\n const my = a2y - a1y;\n const nx = b2x - b1x;\n const ny = b2y - b1y;\n\n const nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n if (Math.abs(nmCrossProduct) < 1e-6) {\n return null;\n }\n\n const b1a1x = a1x - b1x;\n const b1a1y = a1y - b1y;\n\n const p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n if (p < 0 || p > 1) {\n return null;\n }\n // p2 is an infinite line\n return new Point(\n p * mx + a1x,\n p * my + a1y\n );\n}\n\nfunction projPtOnLine(pt: Point, lineA: Point, lineB: Point): number {\n const dir = new Point();\n Point.sub(dir, lineB, lineA);\n dir.normalize();\n const dir2 = new Point();\n Point.sub(dir2, pt, lineA);\n const len = dir2.dot(dir);\n return len;\n}\n\nfunction addToPoly(poly: number[][], pt: number[]) {\n const last = poly[poly.length - 1];\n if (last && last[0] === pt[0] && last[1] === pt[1]) {\n return;\n }\n poly.push(pt);\n}\n\nfunction splitPolygonByLine(points: number[][], lineA: Point, lineB: Point) {\n const len = points.length;\n const intersections: {\n projPt: number,\n pt: Point\n idx: number\n }[] = [];\n for (let i = 0; i < len; i++) {\n const p0 = points[i];\n const p1 = points[(i + 1) % len];\n const intersectionPt = lineLineIntersect(\n p0[0], p0[1], p1[0], p1[1],\n lineA.x, lineA.y, lineB.x, lineB.y\n );\n if (intersectionPt) {\n intersections.push({\n projPt: projPtOnLine(intersectionPt, lineA, lineB),\n pt: intersectionPt,\n idx: i\n });\n }\n }\n\n // TODO No intersection?\n if (intersections.length < 2) {\n // Do clone\n return [ { points}, {points} ];\n }\n\n // Find two farthest points.\n intersections.sort((a, b) => {\n return a.projPt - b.projPt;\n });\n let splitPt0 = intersections[0];\n let splitPt1 = intersections[intersections.length - 1];\n if (splitPt1.idx < splitPt0.idx) {\n const tmp = splitPt0;\n splitPt0 = splitPt1;\n splitPt1 = tmp;\n }\n\n const splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y];\n const splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y];\n\n const newPolyA: number[][] = [splitPt0Arr];\n const newPolyB: number[][] = [splitPt1Arr];\n\n for (let i = splitPt0.idx + 1; i <= splitPt1.idx; i++) {\n addToPoly(newPolyA, points[i].slice());\n }\n addToPoly(newPolyA, splitPt1Arr);\n // Close the path\n addToPoly(newPolyA, splitPt0Arr);\n\n for (let i = splitPt1.idx + 1; i <= splitPt0.idx + len; i++) {\n addToPoly(newPolyB, points[i % len].slice());\n }\n addToPoly(newPolyB, splitPt0Arr);\n // Close the path\n addToPoly(newPolyB, splitPt1Arr);\n\n return [{\n points: newPolyA\n }, {\n points: newPolyB\n }];\n}\n\nfunction binaryDividePolygon(\n polygonShape: Pick\n) {\n const points = polygonShape.points;\n const min: number[] = [];\n const max: number[] = [];\n fromPoints(points, min, max);\n const boundingRect = new BoundingRect(\n min[0], min[1], max[0] - min[0], max[1] - min[1]\n );\n\n const width = boundingRect.width;\n const height = boundingRect.height;\n const x = boundingRect.x;\n const y = boundingRect.y;\n\n const pt0 = new Point();\n const pt1 = new Point();\n if (width > height) {\n pt0.x = pt1.x = x + width / 2;\n pt0.y = y;\n pt1.y = y + height;\n }\n else {\n pt0.y = pt1.y = y + height / 2;\n pt0.x = x;\n pt1.x = x + width;\n }\n return splitPolygonByLine(points, pt0, pt1);\n}\n\n\nfunction binaryDivideRecursive(\n divider: BinaryDivide, shape: T, count: number, out: T[]\n): T[] {\n if (count === 1) {\n out.push(shape);\n }\n else {\n const mid = Math.floor(count / 2);\n const sub = divider(shape);\n binaryDivideRecursive(divider, sub[0], mid, out);\n binaryDivideRecursive(divider, sub[1], count - mid, out);\n }\n\n return out;\n}\n\nexport function clone(path: Path, count: number) {\n const paths = [];\n for (let i = 0; i < count; i++) {\n paths.push(clonePath(path));\n }\n return paths;\n}\n\nfunction copyPathProps(source: Path, target: Path) {\n target.setStyle(source.style);\n target.z = source.z;\n target.z2 = source.z2;\n target.zlevel = source.zlevel;\n}\n\nfunction polygonConvert(points: number[]): number[][] {\n const out = [];\n for (let i = 0; i < points.length;) {\n out.push([points[i++], points[i++]]);\n }\n return out;\n}\n\nexport function split(\n path: Path, count: number\n) {\n const outShapes: Path['shape'][] = [];\n const shape = path.shape;\n let OutShapeCtor: new() => Path;\n // TODO Use clone when shape size is small\n switch (path.type) {\n case 'rect':\n divideRect(shape as Rect['shape'], count, outShapes as Rect['shape'][]);\n OutShapeCtor = Rect;\n break;\n case 'sector':\n divideSector(shape as Sector['shape'], count, outShapes as Sector['shape'][]);\n OutShapeCtor = Sector;\n break;\n case 'circle':\n divideSector({\n r0: 0, r: shape.r, startAngle: 0, endAngle: Math.PI * 2,\n cx: shape.cx, cy: shape.cy\n } as Sector['shape'], count, outShapes as Sector['shape'][]);\n OutShapeCtor = Sector;\n break;\n default:\n const m = path.getComputedTransform();\n const scale = m ? Math.sqrt(Math.max(m[0] * m[0] + m[1] * m[1], m[2] * m[2] + m[3] * m[3])) : 1;\n const polygons = map(\n pathToPolygons(path.getUpdatedPathProxy(), scale),\n poly => polygonConvert(poly)\n );\n const polygonCount = polygons.length;\n if (polygonCount === 0) {\n binaryDivideRecursive(binaryDividePolygon, {\n points: polygons[0]\n }, count, outShapes);\n }\n else if (polygonCount === count) { // In case we only split batched paths to non-batched paths. No need to split.\n for (let i = 0; i < polygonCount; i++) {\n outShapes.push({\n points: polygons[i]\n } as Polygon['shape']);\n }\n }\n else {\n // Most complex case. Assign multiple subpath to each polygon based on it's area.\n let totalArea = 0;\n const items = map(polygons, poly => {\n const min: number[] = [];\n const max: number[] = [];\n fromPoints(poly, min, max);\n // TODO: polygon area?\n const area = (max[1] - min[1]) * (max[0] - min[0]);\n totalArea += area;\n return { poly, area };\n });\n items.sort((a, b) => b.area - a.area);\n\n let left = count;\n for (let i = 0; i < polygonCount; i++) {\n const item = items[i];\n if (left <= 0) {\n break;\n }\n\n const selfCount = i === polygonCount - 1\n ? left // Use the last piece directly\n : Math.ceil(item.area / totalArea * count);\n\n if (selfCount < 0) {\n continue;\n }\n\n binaryDivideRecursive(binaryDividePolygon, {\n points: item.poly\n }, selfCount, outShapes);\n left -= selfCount;\n };\n }\n OutShapeCtor = Polygon;\n break;\n }\n\n if (!OutShapeCtor) {\n // Unkown split algorithm. Use clone instead\n return clone(path, count);\n }\n const out: Path[] = [];\n\n for (let i = 0; i < outShapes.length; i++) {\n const subPath = new OutShapeCtor();\n subPath.setShape(outShapes[i]);\n copyPathProps(path, subPath);\n out.push(subPath);\n }\n\n return out;\n}", "import PathProxy from '../core/PathProxy';\nimport { cubicSubdivide } from '../core/curve';\nimport Path from '../graphic/Path';\nimport Element, { ElementAnimateConfig } from '../Element';\nimport { defaults, map } from '../core/util';\nimport { lerp } from '../core/vector';\nimport Group, { GroupLike } from '../graphic/Group';\nimport { clonePath } from './path';\nimport { MatrixArray } from '../core/matrix';\nimport Transformable from '../core/Transformable';\nimport { ZRenderType } from '../zrender';\nimport { split } from './dividePath';\nimport { pathToBezierCurves } from './convertPath';\n\nfunction alignSubpath(subpath1: number[], subpath2: number[]): [number[], number[]] {\n const len1 = subpath1.length;\n const len2 = subpath2.length;\n if (len1 === len2) {\n return [subpath1, subpath2];\n }\n const tmpSegX: number[] = [];\n const tmpSegY: number[] = [];\n\n const shorterPath = len1 < len2 ? subpath1 : subpath2;\n const shorterLen = Math.min(len1, len2);\n // Should divide excatly\n const diff = Math.abs(len2 - len1) / 6;\n const shorterBezierCount = (shorterLen - 2) / 6;\n // Add `diff` number of beziers\n const eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\n\n const newSubpath = [shorterPath[0], shorterPath[1]];\n let remained = diff;\n\n for (let i = 2; i < shorterLen;) {\n let x0 = shorterPath[i - 2];\n let y0 = shorterPath[i - 1];\n let x1 = shorterPath[i++];\n let y1 = shorterPath[i++];\n let x2 = shorterPath[i++];\n let y2 = shorterPath[i++];\n let x3 = shorterPath[i++];\n let y3 = shorterPath[i++];\n\n if (remained <= 0) {\n newSubpath.push(x1, y1, x2, y2, x3, y3);\n continue;\n }\n\n let actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\n for (let k = 1; k <= actualSubDivCount; k++) {\n const p = k / actualSubDivCount;\n\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\n\n // tmpSegX[3] === tmpSegX[4]\n x0 = tmpSegX[3];\n y0 = tmpSegY[3];\n\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\n x1 = tmpSegX[5];\n y1 = tmpSegY[5];\n x2 = tmpSegX[6];\n y2 = tmpSegY[6];\n // The last point (x3, y3) is still the same.\n }\n remained -= actualSubDivCount - 1;\n }\n\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\n}\n\nfunction createSubpath(lastSubpathSubpath: number[], otherSubpath: number[]) {\n const len = lastSubpathSubpath.length;\n const lastX = lastSubpathSubpath[len - 2];\n const lastY = lastSubpathSubpath[len - 1];\n\n const newSubpath: number[] = [];\n for (let i = 0; i < otherSubpath.length;) {\n newSubpath[i++] = lastX;\n newSubpath[i++] = lastY;\n }\n return newSubpath;\n}\n\n/**\n * Make two bezier arrays aligns on structure. To have better animation.\n *\n * It will:\n * Make two bezier arrays have same number of subpaths.\n * Make each subpath has equal number of bezier curves.\n *\n * array is the convert result of pathToBezierCurves.\n */\nexport function alignBezierCurves(array1: number[][], array2: number[][]) {\n\n let lastSubpath1;\n let lastSubpath2;\n\n let newArray1 = [];\n let newArray2 = [];\n\n for (let i = 0; i < Math.max(array1.length, array2.length); i++) {\n const subpath1 = array1[i];\n const subpath2 = array2[i];\n\n let newSubpath1;\n let newSubpath2;\n\n if (!subpath1) {\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\n newSubpath2 = subpath2;\n }\n else if (!subpath2) {\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\n newSubpath1 = subpath1;\n }\n else {\n [newSubpath1, newSubpath2] = alignSubpath(subpath1, subpath2);\n lastSubpath1 = newSubpath1;\n lastSubpath2 = newSubpath2;\n }\n\n newArray1.push(newSubpath1);\n newArray2.push(newSubpath2);\n }\n\n return [newArray1, newArray2];\n}\n\ninterface MorphingPath extends Path {\n __morphT: number;\n}\n\nexport interface CombineMorphingPath extends Path {\n childrenRef(): (CombineMorphingPath | Path)[]\n __isCombineMorphing: boolean;\n}\n\nexport function centroid(array: number[]) {\n // https://en.wikipedia.org/wiki/Centroid#Of_a_polygon\n let signedArea = 0;\n let cx = 0;\n let cy = 0;\n const len = array.length;\n // Polygon should been closed.\n for (let i = 0, j = len - 2; i < len; j = i, i += 2) {\n const x0 = array[j];\n const y0 = array[j + 1];\n const x1 = array[i];\n const y1 = array[i + 1];\n const a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n }\n\n if (signedArea === 0) {\n return [array[0] || 0, array[1] || 0];\n }\n\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\n}\n\n/**\n * Offset the points to find the nearest morphing distance.\n * Return beziers count needs to be offset.\n */\nfunction findBestRingOffset(\n fromSubBeziers: number[],\n toSubBeziers: number[],\n fromCp: number[],\n toCp: number[]\n) {\n const bezierCount = (fromSubBeziers.length - 2) / 6;\n let bestScore = Infinity;\n let bestOffset = 0;\n\n const len = fromSubBeziers.length;\n const len2 = len - 2;\n for (let offset = 0; offset < bezierCount; offset++) {\n const cursorOffset = offset * 6;\n let score = 0;\n\n for (let k = 0; k < len; k += 2) {\n let idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\n\n const x0 = fromSubBeziers[idx] - fromCp[0];\n const y0 = fromSubBeziers[idx + 1] - fromCp[1];\n const x1 = toSubBeziers[k] - toCp[0];\n const y1 = toSubBeziers[k + 1] - toCp[1];\n\n const dx = x1 - x0;\n const dy = y1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestOffset = offset;\n }\n }\n\n return bestOffset;\n}\n\nfunction reverse(array: number[]) {\n const newArr: number[] = [];\n const len = array.length;\n for (let i = 0; i < len; i += 2) {\n newArr[i] = array[len - i - 2];\n newArr[i + 1] = array[len - i - 1];\n }\n return newArr;\n}\n\ntype MorphingData = {\n from: number[];\n to: number[];\n fromCp: number[];\n toCp: number[];\n rotation: number;\n}[];\n\n/**\n * If we interpolating between two bezier curve arrays.\n * It will have many broken effects during the transition.\n * So we try to apply an extra rotation which can make each bezier curve morph as small as possible.\n */\nfunction findBestMorphingRotation(\n fromArr: number[][],\n toArr: number[][],\n searchAngleIteration: number,\n searchAngleRange: number\n): MorphingData {\n const result = [];\n\n let fromNeedsReverse: boolean;\n\n for (let i = 0; i < fromArr.length; i++) {\n let fromSubpathBezier = fromArr[i];\n const toSubpathBezier = toArr[i];\n\n const fromCp = centroid(fromSubpathBezier);\n const toCp = centroid(toSubpathBezier);\n\n if (fromNeedsReverse == null) {\n // Reverse from array if two have different directions.\n // Determine the clockwise based on the first subpath.\n // Reverse all subpaths or not. Avoid winding rule changed.\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\n }\n\n const newFromSubpathBezier: number[] = [];\n const newToSubpathBezier: number[] = [];\n let bestAngle = 0;\n let bestScore = Infinity;\n let tmpArr: number[] = [];\n\n const len = fromSubpathBezier.length;\n if (fromNeedsReverse) {\n // Make sure clockwise\n fromSubpathBezier = reverse(fromSubpathBezier);\n }\n const offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\n\n const len2 = len - 2;\n for (let k = 0; k < len2; k += 2) {\n // Not include the start point.\n const idx = (offset + k) % len2 + 2;\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\n }\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\n\n if (searchAngleIteration > 0) {\n const step = searchAngleRange / searchAngleIteration;\n for (let angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\n const sa = Math.sin(angle);\n const ca = Math.cos(angle);\n let score = 0;\n\n for (let k = 0; k < fromSubpathBezier.length; k += 2) {\n const x0 = newFromSubpathBezier[k];\n const y0 = newFromSubpathBezier[k + 1];\n const x1 = toSubpathBezier[k] - toCp[0];\n const y1 = toSubpathBezier[k + 1] - toCp[1];\n\n // Apply rotation on the target point.\n const newX1 = x1 * ca - y1 * sa;\n const newY1 = x1 * sa + y1 * ca;\n\n tmpArr[k] = newX1;\n tmpArr[k + 1] = newY1;\n\n const dx = newX1 - x0;\n const dy = newY1 - y0;\n\n // Use dot product to have min direction change.\n // const d = Math.sqrt(x0 * x0 + y0 * y0);\n // score += x0 * dx / d + y0 * dy / d;\n score += dx * dx + dy * dy;\n }\n\n if (score < bestScore) {\n bestScore = score;\n bestAngle = angle;\n // Copy.\n for (let m = 0; m < tmpArr.length; m++) {\n newToSubpathBezier[m] = tmpArr[m];\n }\n }\n }\n }\n else {\n for (let i = 0; i < len; i += 2) {\n newToSubpathBezier[i] = toSubpathBezier[i] - toCp[0];\n newToSubpathBezier[i + 1] = toSubpathBezier[i + 1] - toCp[1];\n }\n }\n\n result.push({\n from: newFromSubpathBezier,\n to: newToSubpathBezier,\n fromCp,\n toCp,\n rotation: -bestAngle\n });\n }\n return result;\n}\n\nexport function isCombineMorphing(path: Element): path is CombineMorphingPath {\n return (path as CombineMorphingPath).__isCombineMorphing;\n}\n\nexport function isMorphing(el: Element) {\n return (el as MorphingPath).__morphT >= 0;\n}\n\nconst SAVED_METHOD_PREFIX = '__mOriginal_';\nfunction saveAndModifyMethod(\n obj: T,\n methodName: M,\n modifiers: { replace?: T[M], after?: T[M], before?: T[M] }\n) {\n const savedMethodName = SAVED_METHOD_PREFIX + methodName;\n const originalMethod = (obj as any)[savedMethodName] || obj[methodName];\n if (!(obj as any)[savedMethodName]) {\n (obj as any)[savedMethodName] = obj[methodName];\n }\n const replace = modifiers.replace;\n const after = modifiers.after;\n const before = modifiers.before;\n\n (obj as any)[methodName] = function () {\n const args = arguments;\n let res;\n before && (before as unknown as Function).apply(this, args);\n // Still call the original method if not replacement.\n if (replace) {\n res = (replace as unknown as Function).apply(this, args);\n }\n else {\n res = originalMethod.apply(this, args);\n }\n after && (after as unknown as Function).apply(this, args);\n return res;\n };\n}\nfunction restoreMethod(\n obj: T,\n methodName: keyof T\n) {\n const savedMethodName = SAVED_METHOD_PREFIX + methodName;\n if ((obj as any)[savedMethodName]) {\n obj[methodName] = (obj as any)[savedMethodName];\n (obj as any)[savedMethodName] = null;\n }\n}\n\nfunction applyTransformOnBeziers(bezierCurves: number[][], mm: MatrixArray) {\n for (let i = 0; i < bezierCurves.length; i++) {\n const subBeziers = bezierCurves[i];\n for (let k = 0; k < subBeziers.length;) {\n const x = subBeziers[k];\n const y = subBeziers[k + 1];\n\n subBeziers[k++] = mm[0] * x + mm[2] * y + mm[4];\n subBeziers[k++] = mm[1] * x + mm[3] * y + mm[5];\n }\n }\n}\n\nfunction prepareMorphPath(\n fromPath: Path,\n toPath: Path\n) {\n const fromPathProxy = fromPath.getUpdatedPathProxy();\n const toPathProxy = toPath.getUpdatedPathProxy();\n\n const [fromBezierCurves, toBezierCurves] =\n alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy));\n\n const fromPathTransform = fromPath.getComputedTransform();\n const toPathTransform = toPath.getComputedTransform();\n function updateIdentityTransform(this: Transformable) {\n this.transform = null;\n }\n fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform);\n toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform);\n // Just ignore transform\n saveAndModifyMethod(toPath, 'updateTransform', { replace: updateIdentityTransform });\n toPath.transform = null;\n\n const morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\n\n const tmpArr: number[] = [];\n\n saveAndModifyMethod(toPath, 'buildPath', { replace(path: PathProxy) {\n const t = (toPath as MorphingPath).__morphT;\n const onet = 1 - t;\n\n const newCp: number[] = [];\n\n for (let i = 0; i < morphingData.length; i++) {\n const item = morphingData[i];\n const from = item.from;\n const to = item.to;\n const angle = item.rotation * t;\n const fromCp = item.fromCp;\n const toCp = item.toCp;\n const sa = Math.sin(angle);\n const ca = Math.cos(angle);\n\n lerp(newCp, fromCp, toCp, t);\n\n for (let m = 0; m < from.length; m += 2) {\n const x0 = from[m];\n const y0 = from[m + 1];\n const x1 = to[m];\n const y1 = to[m + 1];\n\n const x = x0 * onet + x1 * t;\n const y = y0 * onet + y1 * t;\n\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\n }\n\n let x0 = tmpArr[0];\n let y0 = tmpArr[1];\n\n path.moveTo(x0, y0);\n\n for (let m = 2; m < from.length;) {\n const x1 = tmpArr[m++];\n const y1 = tmpArr[m++];\n const x2 = tmpArr[m++];\n const y2 = tmpArr[m++];\n const x3 = tmpArr[m++];\n const y3 = tmpArr[m++];\n\n // Is a line.\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n }\n else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n } });\n}\n\n/**\n * Morphing from old path to new path.\n */\nexport function morphPath(\n fromPath: Path,\n toPath: Path,\n animationOpts: ElementAnimateConfig\n): Path {\n if (!fromPath || !toPath) {\n return toPath;\n }\n\n const oldDone = animationOpts.done;\n // const oldAborted = animationOpts.aborted;\n const oldDuring = animationOpts.during;\n\n prepareMorphPath(fromPath, toPath);\n\n (toPath as MorphingPath).__morphT = 0;\n\n function restoreToPath() {\n restoreMethod(toPath, 'buildPath');\n restoreMethod(toPath, 'updateTransform');\n // Mark as not in morphing\n (toPath as MorphingPath).__morphT = -1;\n // Cleanup.\n toPath.createPathProxy();\n toPath.dirtyShape();\n }\n\n toPath.animateTo({\n __morphT: 1\n } as any, defaults({\n during(p) {\n toPath.dirtyShape();\n oldDuring && oldDuring(p);\n },\n done() {\n restoreToPath();\n oldDone && oldDone();\n }\n // NOTE: Don't do restore if aborted.\n // Because all status was just set when animation started.\n // aborted() {\n // oldAborted && oldAborted();\n // }\n } as ElementAnimateConfig, animationOpts));\n\n return toPath;\n}\n\n// https://github.com/mapbox/earcut/blob/master/src/earcut.js#L437\n// https://jsfiddle.net/pissang/2jk7x145/\n// function zOrder(x: number, y: number, minX: number, minY: number, maxX: number, maxY: number) {\n// // Normalize coords to 0 - 1\n// // The transformed into non-negative 15-bit integer range\n// x = (maxX === minX) ? 0 : Math.round(32767 * (x - minX) / (maxX - minX));\n// y = (maxY === minY) ? 0 : Math.round(32767 * (y - minY) / (maxY - minY));\n\n// x = (x | (x << 8)) & 0x00FF00FF;\n// x = (x | (x << 4)) & 0x0F0F0F0F;\n// x = (x | (x << 2)) & 0x33333333;\n// x = (x | (x << 1)) & 0x55555555;\n\n// y = (y | (y << 8)) & 0x00FF00FF;\n// y = (y | (y << 4)) & 0x0F0F0F0F;\n// y = (y | (y << 2)) & 0x33333333;\n// y = (y | (y << 1)) & 0x55555555;\n\n// return x | (y << 1);\n// }\n\n// https://github.com/w8r/hilbert/blob/master/hilbert.js#L30\n// https://jsfiddle.net/pissang/xdnbzg6v/\nfunction hilbert(x: number, y: number, minX: number, minY: number, maxX: number, maxY: number) {\n const bits = 16;\n x = (maxX === minX) ? 0 : Math.round(32767 * (x - minX) / (maxX - minX));\n y = (maxY === minY) ? 0 : Math.round(32767 * (y - minY) / (maxY - minY));\n\n let d = 0;\n let tmp: number;\n for (let s = (1 << bits) / 2; s > 0; s /= 2) {\n let rx = 0;\n let ry = 0;\n\n if ((x & s) > 0) {\n rx = 1;\n }\n if ((y & s) > 0) {\n ry = 1;\n }\n\n d += s * s * ((3 * rx) ^ ry);\n\n if (ry === 0) {\n if (rx === 1) {\n x = s - 1 - x;\n y = s - 1 - y;\n }\n tmp = x;\n x = y;\n y = tmp;\n }\n }\n return d;\n}\n\n// Sort paths on hilbert. Not using z-order because it may still have large cross.\n// So the left most source can animate to the left most target, not right most target.\n// Hope in this way. We can make sure each element is animated to the proper target. Not the farthest.\nfunction sortPaths(pathList: Path[]): Path[] {\n let xMin = Infinity;\n let yMin = Infinity;\n let xMax = -Infinity;\n let yMax = -Infinity;\n const cps = map(pathList, path => {\n const rect = path.getBoundingRect();\n const m = path.getComputedTransform();\n const x = rect.x + rect.width / 2 + (m ? m[4] : 0);\n const y = rect.y + rect.height / 2 + (m ? m[5] : 0);\n xMin = Math.min(x, xMin);\n yMin = Math.min(y, yMin);\n xMax = Math.max(x, xMax);\n yMax = Math.max(y, yMax);\n return [x, y];\n });\n\n const items = map(cps, (cp, idx) => {\n return {\n cp,\n z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax),\n path: pathList[idx]\n };\n });\n\n return items.sort((a, b) => a.z - b.z).map(item => item.path);\n}\n\nexport interface DividePathParams {\n path: Path,\n count: number\n};\nexport interface DividePath {\n (params: DividePathParams): Path[]\n}\n\nexport interface IndividualDelay {\n (index: number, count: number, fromPath: Path, toPath: Path): number\n}\n\nfunction defaultDividePath(param: DividePathParams) {\n return split(param.path, param.count);\n}\nexport interface CombineConfig extends ElementAnimateConfig {\n /**\n * Transform of returned will be ignored.\n */\n dividePath?: DividePath\n /**\n * delay of each individual.\n * Because individual are sorted on z-order. The index is also sorted top-left / right-down.\n */\n individualDelay?: IndividualDelay\n /**\n * If sort splitted paths so the movement between them can be more natural\n */\n // sort?: boolean\n}\n\nfunction createEmptyReturn() {\n return {\n fromIndividuals: [] as Path[],\n toIndividuals: [] as Path[],\n count: 0\n };\n}\n/**\n * Make combine morphing from many paths to one.\n * Will return a group to replace the original path.\n */\nexport function combineMorph(\n fromList: (CombineMorphingPath | Path)[],\n toPath: Path,\n animationOpts: CombineConfig\n) {\n let fromPathList: Path[] = [];\n\n function addFromPath(fromList: Element[]) {\n for (let i = 0; i < fromList.length; i++) {\n const from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath((from as GroupLike).childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n addFromPath(fromList);\n\n const separateCount = fromPathList.length;\n\n // fromPathList.length is 0.\n if (!separateCount) {\n return createEmptyReturn();\n }\n\n const dividePath = animationOpts.dividePath || defaultDividePath;\n\n let toSubPathList = dividePath({\n path: toPath, count: separateCount\n });\n if (toSubPathList.length !== separateCount) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n\n fromPathList = sortPaths(fromPathList);\n toSubPathList = sortPaths(toSubPathList);\n\n const oldDone = animationOpts.done;\n // const oldAborted = animationOpts.aborted;\n const oldDuring = animationOpts.during;\n const individualDelay = animationOpts.individualDelay;\n\n const identityTransform = new Transformable();\n\n for (let i = 0; i < separateCount; i++) {\n const from = fromPathList[i];\n const to = toSubPathList[i];\n\n to.parent = toPath as unknown as Group;\n\n // Ignore transform in each subpath.\n to.copyTransform(identityTransform);\n\n // Will do morphPath for each individual if individualDelay is set.\n if (!individualDelay) {\n prepareMorphPath(from, to);\n }\n }\n\n (toPath as CombineMorphingPath).__isCombineMorphing = true;\n (toPath as CombineMorphingPath).childrenRef = function () {\n return toSubPathList;\n };\n\n function addToSubPathListToZr(zr: ZRenderType) {\n for (let i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].addSelfToZr(zr);\n }\n }\n saveAndModifyMethod(toPath, 'addSelfToZr', {\n after(zr) {\n addToSubPathListToZr(zr);\n }\n });\n saveAndModifyMethod(toPath, 'removeSelfFromZr', {\n after(zr) {\n for (let i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].removeSelfFromZr(zr);\n }\n }\n });\n\n function restoreToPath() {\n (toPath as CombineMorphingPath).__isCombineMorphing = false;\n // Mark as not in morphing\n (toPath as MorphingPath).__morphT = -1;\n (toPath as CombineMorphingPath).childrenRef = null;\n\n restoreMethod(toPath, 'addSelfToZr');\n restoreMethod(toPath, 'removeSelfFromZr');\n }\n\n const toLen = toSubPathList.length;\n\n if (individualDelay) {\n let animating = toLen;\n const eachDone = () => {\n animating--;\n if (animating === 0) {\n restoreToPath();\n oldDone && oldDone();\n }\n };\n // Animate each element individually.\n for (let i = 0; i < toLen; i++) {\n // TODO only call during once?\n const indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toSubPathList[i]),\n done: eachDone\n } as ElementAnimateConfig, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toSubPathList[i], indivdualAnimationOpts);\n }\n }\n else {\n (toPath as MorphingPath).__morphT = 0;\n toPath.animateTo({\n __morphT: 1\n } as any, defaults({\n during(p) {\n for (let i = 0; i < toLen; i++) {\n const child = toSubPathList[i] as MorphingPath;\n child.__morphT = (toPath as MorphingPath).__morphT;\n child.dirtyShape();\n }\n oldDuring && oldDuring(p);\n },\n done() {\n restoreToPath();\n for (let i = 0; i < fromList.length; i++) {\n restoreMethod(fromList[i], 'updateTransform');\n }\n oldDone && oldDone();\n }\n } as ElementAnimateConfig, animationOpts));\n }\n\n if (toPath.__zr) {\n addToSubPathListToZr(toPath.__zr);\n }\n\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toSubPathList,\n count: toLen\n };\n}\nexport interface SeparateConfig extends ElementAnimateConfig {\n dividePath?: DividePath\n individualDelay?: IndividualDelay\n /**\n * If sort splitted paths so the movement between them can be more natural\n */\n // sort?: boolean\n // // If the from path of separate animation is doing combine animation.\n // // And the paths number is not same with toPathList. We need to do enter/leave animation\n // // on the missing/spare paths.\n // enter?: (el: Path) => void\n // leave?: (el: Path) => void\n}\n\n/**\n * Make separate morphing from one path to many paths.\n * Make the MorphingKind of `toPath` become `'ONE_ONE'`.\n */\nexport function separateMorph(\n fromPath: Path,\n toPathList: Path[],\n animationOpts: SeparateConfig\n) {\n const toLen = toPathList.length;\n let fromPathList: Path[] = [];\n\n const dividePath = animationOpts.dividePath || defaultDividePath;\n\n function addFromPath(fromList: Element[]) {\n for (let i = 0; i < fromList.length; i++) {\n const from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath((from as GroupLike).childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n // This case most happen when a combining path is called to reverse the animation\n // to its original separated state.\n if (isCombineMorphing(fromPath)) {\n addFromPath(fromPath.childrenRef());\n\n const fromLen = fromPathList.length;\n if (fromLen < toLen) {\n let k = 0;\n for (let i = fromLen; i < toLen; i++) {\n // Create a clone\n fromPathList.push(clonePath(fromPathList[k++ % fromLen]));\n }\n }\n // Else simply remove if fromLen > toLen\n fromPathList.length = toLen;\n }\n else {\n fromPathList = dividePath({ path: fromPath, count: toLen });\n const fromPathTransform = fromPath.getComputedTransform();\n for (let i = 0; i < fromPathList.length; i++) {\n // Force use transform of source path.\n fromPathList[i].setLocalTransform(fromPathTransform);\n }\n if (fromPathList.length !== toLen) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n }\n\n fromPathList = sortPaths(fromPathList);\n toPathList = sortPaths(toPathList);\n\n const individualDelay = animationOpts.individualDelay;\n for (let i = 0; i < toLen; i++) {\n const indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toPathList[i])\n } as ElementAnimateConfig, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toPathList[i], indivdualAnimationOpts);\n }\n\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toPathList,\n count: toPathList.length\n };\n}\n\nexport { split as defaultDividePath };\n", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\nimport {\r\n separateMorph,\r\n combineMorph,\r\n morphPath,\r\n DividePath,\r\n isCombineMorphing,\r\n SeparateConfig\r\n} from 'zrender/src/tool/morphPath';\r\nimport { Path } from '../util/graphic';\r\nimport SeriesModel from '../model/Series';\r\nimport Element, { ElementAnimateConfig } from 'zrender/src/Element';\r\nimport { defaults, isArray} from 'zrender/src/core/util';\r\nimport { getAnimationConfig } from './basicTransition';\r\nimport { ECElement, UniversalTransitionOption } from '../util/types';\r\nimport { clonePath } from 'zrender/src/tool/path';\r\nimport Model from '../model/Model';\r\n\r\n\r\ntype DescendentElements = Element[];\r\ntype DescendentPaths = Path[];\r\n\r\nfunction isMultiple(elements: DescendentElements | DescendentElements[]): elements is DescendentElements[] {\r\n return isArray(elements[0]);\r\n}\r\n\r\ninterface MorphingBatch {\r\n one: Path;\r\n many: Path[];\r\n}\r\n\r\nfunction prepareMorphBatches(one: DescendentPaths, many: DescendentPaths[]) {\r\n const batches: MorphingBatch[] = [];\r\n const batchCount = one.length;\r\n for (let i = 0; i < batchCount; i++) {\r\n batches.push({\r\n one: one[i],\r\n many: []\r\n });\r\n }\r\n\r\n for (let i = 0; i < many.length; i++) {\r\n const len = many[i].length;\r\n let k;\r\n for (k = 0; k < len; k++) {\r\n batches[k % batchCount].many.push(many[i][k]);\r\n }\r\n }\r\n\r\n let off = 0;\r\n // If one has more paths than each one of many. average them.\r\n for (let i = batchCount - 1; i >= 0; i--) {\r\n if (!batches[i].many.length) {\r\n const moveFrom = batches[off].many;\r\n if (moveFrom.length <= 1) { // Not enough\r\n // Start from the first one.\r\n if (off) {\r\n off = 0;\r\n }\r\n else {\r\n return batches;\r\n }\r\n }\r\n const len = moveFrom.length;\r\n const mid = Math.ceil(len / 2);\r\n batches[i].many = moveFrom.slice(mid, len);\r\n batches[off].many = moveFrom.slice(0, mid);\r\n\r\n off++;\r\n }\r\n }\r\n\r\n return batches;\r\n}\r\n\r\nconst pathDividers: Record = {\r\n clone(params) {\r\n const ret: Path[] = [];\r\n // Fitting the alpha\r\n const approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);\r\n for (let i = 0; i < params.count; i++) {\r\n const cloned = clonePath(params.path);\r\n cloned.setStyle('opacity', approxOpacity);\r\n ret.push(cloned);\r\n }\r\n return ret;\r\n },\r\n // Use the default divider\r\n split: null\r\n};\r\n\r\nexport function applyMorphAnimation(\r\n from: DescendentPaths | DescendentPaths[],\r\n to: DescendentPaths | DescendentPaths[],\r\n divideShape: UniversalTransitionOption['divideShape'],\r\n seriesModel: SeriesModel,\r\n dataIndex: number,\r\n animateOtherProps: (\r\n fromIndividual: Path,\r\n toIndividual: Path,\r\n rawFrom: Path,\r\n rawTo: Path,\r\n animationCfg: ElementAnimateConfig\r\n ) => void\r\n) {\r\n if (!from.length || !to.length) {\r\n return;\r\n }\r\n\r\n const updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex);\r\n if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {\r\n return;\r\n }\r\n const animationDelay = (seriesModel.getModel('universalTransition') as Model)\r\n .get('delay');\r\n\r\n\r\n const animationCfg = Object.assign({\r\n // Need to setToFinal so the further calculation based on the style can be correct.\r\n // Like emphasis color.\r\n setToFinal: true\r\n } as SeparateConfig, updateAnimationCfg);\r\n\r\n\r\n let many: DescendentPaths[];\r\n let one: DescendentPaths;\r\n if (isMultiple(from)) { // manyToOne\r\n many = from;\r\n one = to as DescendentPaths;\r\n }\r\n if (isMultiple(to)) { // oneToMany\r\n many = to;\r\n one = from as DescendentPaths;\r\n }\r\n\r\n function morphOneBatch(\r\n batch: MorphingBatch,\r\n fromIsMany: boolean,\r\n animateIndex: number,\r\n animateCount: number,\r\n forceManyOne?: boolean\r\n ) {\r\n const batchMany = batch.many;\r\n const batchOne = batch.one;\r\n if (batchMany.length === 1 && !forceManyOne) {\r\n // Is one to one\r\n const batchFrom: Path = fromIsMany ? batchMany[0] : batchOne;\r\n const batchTo: Path = fromIsMany ? batchOne : batchMany[0];\r\n\r\n if (isCombineMorphing(batchFrom as Path)) {\r\n // Keep doing combine animation.\r\n morphOneBatch({\r\n many: [batchFrom as Path],\r\n one: batchTo as Path\r\n }, true, animateIndex, animateCount, true);\r\n }\r\n else {\r\n const individualAnimationCfg = animationDelay ? defaults({\r\n delay: animationDelay(animateIndex, animateCount)\r\n } as ElementAnimateConfig, animationCfg) : animationCfg;\r\n morphPath(batchFrom, batchTo, individualAnimationCfg);\r\n animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);\r\n }\r\n }\r\n else {\r\n const separateAnimationCfg = defaults({\r\n dividePath: pathDividers[divideShape],\r\n individualDelay: animationDelay && function (idx, count, fromPath, toPath) {\r\n return animationDelay(idx + animateIndex, animateCount);\r\n }\r\n } as SeparateConfig, animationCfg);\r\n\r\n const {\r\n fromIndividuals,\r\n toIndividuals\r\n } = fromIsMany\r\n ? combineMorph(batchMany, batchOne, separateAnimationCfg)\r\n : separateMorph(batchOne, batchMany, separateAnimationCfg);\r\n\r\n const count = fromIndividuals.length;\r\n for (let k = 0; k < count; k++) {\r\n const individualAnimationCfg = animationDelay ? defaults({\r\n delay: animationDelay(k, count)\r\n } as ElementAnimateConfig, animationCfg) : animationCfg;\r\n animateOtherProps(\r\n fromIndividuals[k],\r\n toIndividuals[k],\r\n fromIsMany ? batchMany[k] : batch.one,\r\n fromIsMany ? batch.one : batchMany[k],\r\n individualAnimationCfg\r\n );\r\n }\r\n }\r\n }\r\n\r\n const fromIsMany = many\r\n ? many === from\r\n // Is one to one. If the path number not match. also needs do merge and separate morphing.\r\n : from.length > to.length;\r\n\r\n const morphBatches = many\r\n ? prepareMorphBatches(one, many)\r\n : prepareMorphBatches(\r\n (fromIsMany ? to : from) as DescendentPaths,\r\n [(fromIsMany ? from : to) as DescendentPaths]\r\n );\r\n let animateCount = 0;\r\n for (let i = 0; i < morphBatches.length; i++) {\r\n animateCount += morphBatches[i].many.length;\r\n }\r\n let animateIndex = 0;\r\n for (let i = 0; i < morphBatches.length; i++) {\r\n morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount);\r\n animateIndex += morphBatches[i].many.length;\r\n }\r\n}\r\n\r\nexport function getPathList(\r\n elements: Element\r\n): DescendentPaths;\r\nexport function getPathList(\r\n elements: Element[]\r\n): DescendentPaths[];\r\nexport function getPathList(\r\n elements: Element | Element[]\r\n): DescendentPaths | DescendentPaths[] {\r\n if (!elements) {\r\n return [];\r\n }\r\n\r\n if (isArray(elements)) {\r\n const pathList = [];\r\n for (let i = 0; i < elements.length; i++) {\r\n pathList.push(getPathList(elements[i]));\r\n }\r\n return pathList as DescendentPaths[];\r\n }\r\n\r\n const pathList: DescendentPaths = [];\r\n\r\n elements.traverse(el => {\r\n if ((el instanceof Path) && !(el as ECElement).disableMorphing && !el.invisible && !el.ignore) {\r\n pathList.push(el);\r\n }\r\n });\r\n return pathList;\r\n}", "/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n// Universal transitions that can animate between any shapes(series) and any properties in any amounts.\r\n\r\nimport SeriesModel, { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series';\r\nimport {createHashMap, each, map, filter, isArray, extend} from 'zrender/src/core/util';\r\nimport Element, { ElementAnimateConfig } from 'zrender/src/Element';\r\nimport { applyMorphAnimation, getPathList } from './morphTransitionHelper';\r\nimport Path from 'zrender/src/graphic/Path';\r\nimport { EChartsExtensionInstallRegisters } from '../extension';\r\nimport { initProps } from '../util/graphic';\r\nimport DataDiffer from '../data/DataDiffer';\r\nimport SeriesData from '../data/SeriesData';\r\nimport {\r\n Dictionary,\r\n DimensionLoose,\r\n DimensionName,\r\n DataVisualDimensions,\r\n OptionDataItemObject,\r\n UniversalTransitionOption\r\n} from '../util/types';\r\nimport {\r\n UpdateLifecycleParams,\r\n UpdateLifecycleTransitionItem,\r\n UpdateLifecycleTransitionSeriesFinder\r\n} from '../core/lifecycle';\r\nimport { makeInner, normalizeToArray } from '../util/model';\r\nimport { warn } from '../util/log';\r\nimport ExtensionAPI from '../core/ExtensionAPI';\r\nimport { getAnimationConfig, getOldStyle } from './basicTransition';\r\nimport Model from '../model/Model';\r\nimport Displayable from 'zrender/src/graphic/Displayable';\r\n\r\nconst DATA_COUNT_THRESHOLD = 1e4;\r\nconst TRANSITION_NONE = 0;\r\nconst TRANSITION_P2C = 1;\r\nconst TRANSITION_C2P = 2;\r\n\r\ninterface GlobalStore { oldSeries: SeriesModel[], oldDataGroupIds: string[], oldData: SeriesData[] };\r\nconst getUniversalTransitionGlobalStore = makeInner();\r\n\r\ninterface DiffItem {\r\n data: SeriesData\r\n groupId: string\r\n childGroupId: string\r\n divide: UniversalTransitionOption['divideShape']\r\n dataIndex: number\r\n}\r\ninterface TransitionSeries {\r\n dataGroupId: string\r\n data: SeriesData\r\n divide: UniversalTransitionOption['divideShape']\r\n groupIdDim?: DimensionLoose\r\n}\r\n\r\nfunction getDimension(data: SeriesData, visualDimension: string) {\r\n const dimensions = data.dimensions;\r\n for (let i = 0; i < dimensions.length; i++) {\r\n const dimInfo = data.getDimensionInfo(dimensions[i]);\r\n if (dimInfo && dimInfo.otherDims[visualDimension as keyof DataVisualDimensions] === 0) {\r\n return dimensions[i];\r\n }\r\n }\r\n}\r\n\r\n// get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string)\r\nfunction getValueByDimension(data: SeriesData, dataIndex: number, dimension: DimensionName) {\r\n const dimInfo = data.getDimensionInfo(dimension);\r\n const dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\r\n if (dimInfo) {\r\n const value = data.get(dimInfo.name, dataIndex);\r\n if (dimOrdinalMeta) {\r\n return (dimOrdinalMeta.categories[value as number] as string) || value + '';\r\n }\r\n return value + '';\r\n }\r\n}\r\n\r\nfunction getGroupId(data: SeriesData, dataIndex: number, dataGroupId: string, isChild: boolean) {\r\n // try to get groupId from encode\r\n const visualDimension = isChild ? 'itemChildGroupId' : 'itemGroupId';\r\n const groupIdDim = getDimension(data, visualDimension);\r\n if (groupIdDim) {\r\n const groupId = getValueByDimension(data, dataIndex, groupIdDim);\r\n return groupId;\r\n }\r\n // try to get groupId from raw data item\r\n const rawDataItem = data.getRawDataItem(dataIndex) as OptionDataItemObject;\r\n const property = isChild ? 'childGroupId' : 'groupId';\r\n if (rawDataItem && rawDataItem[property]) {\r\n return rawDataItem[property] + '';\r\n }\r\n // fallback\r\n if (isChild) {\r\n return;\r\n }\r\n // try to use series.dataGroupId as groupId, otherwise use dataItem's id as groupId\r\n return (dataGroupId || data.getId(dataIndex));\r\n}\r\n\r\n// flatten all data items from different serieses into one arrary\r\nfunction flattenDataDiffItems(list: TransitionSeries[]) {\r\n const items: DiffItem[] = [];\r\n\r\n each(list, seriesInfo => {\r\n const data = seriesInfo.data;\r\n const dataGroupId = seriesInfo.dataGroupId;\r\n if (data.count() > DATA_COUNT_THRESHOLD) {\r\n if (__DEV__) {\r\n warn('Universal transition is disabled on large data > 10k.');\r\n }\r\n return;\r\n }\r\n const indices = data.getIndices();\r\n for (let dataIndex = 0; dataIndex < indices.length; dataIndex++) {\r\n items.push({\r\n data,\r\n groupId: getGroupId(data, dataIndex, dataGroupId, false), // either of groupId or childGroupId will be used as diffItem's key,\r\n childGroupId: getGroupId(data, dataIndex, dataGroupId, true), // depending on the transition direction (see below)\r\n divide: seriesInfo.divide,\r\n dataIndex\r\n });\r\n }\r\n });\r\n\r\n return items;\r\n}\r\n\r\n\r\nfunction fadeInElement(newEl: Element, newSeries: SeriesModel, newIndex: number) {\r\n newEl.traverse(el => {\r\n if (el instanceof Path) {\r\n // TODO use fade in animation for target element.\r\n initProps(el, {\r\n style: {\r\n opacity: 0\r\n }\r\n }, newSeries, {\r\n dataIndex: newIndex,\r\n isFrom: true\r\n });\r\n }\r\n });\r\n}\r\nfunction removeEl(el: Element) {\r\n if (el.parent) {\r\n // Bake parent transform to element.\r\n // So it can still have proper transform to transition after it's removed.\r\n const computedTransform = el.getComputedTransform();\r\n el.setLocalTransform(computedTransform);\r\n el.parent.remove(el);\r\n }\r\n}\r\nfunction stopAnimation(el: Element) {\r\n el.stopAnimation();\r\n if (el.isGroup) {\r\n el.traverse(child => {\r\n child.stopAnimation();\r\n });\r\n }\r\n}\r\nfunction animateElementStyles(el: Element, dataIndex: number, seriesModel: SeriesModel) {\r\n const animationConfig = getAnimationConfig('update', seriesModel, dataIndex);\r\n animationConfig && el.traverse(child => {\r\n if (child instanceof Displayable) {\r\n const oldStyle = getOldStyle(child);\r\n if (oldStyle) {\r\n child.animateFrom({\r\n style: oldStyle\r\n }, animationConfig);\r\n }\r\n }\r\n });\r\n}\r\n\r\n\r\nfunction isAllIdSame(oldDiffItems: DiffItem[], newDiffItems: DiffItem[]) {\r\n const len = oldDiffItems.length;\r\n if (len !== newDiffItems.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < len; i++) {\r\n const oldItem = oldDiffItems[i];\r\n const newItem = newDiffItems[i];\r\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nfunction transitionBetween(\r\n oldList: TransitionSeries[],\r\n newList: TransitionSeries[],\r\n api: ExtensionAPI\r\n) {\r\n\r\n const oldDiffItems = flattenDataDiffItems(oldList);\r\n const newDiffItems = flattenDataDiffItems(newList);\r\n\r\n function updateMorphingPathProps(\r\n from: Path, to: Path,\r\n rawFrom: Path, rawTo: Path,\r\n animationCfg: ElementAnimateConfig\r\n ) {\r\n if (rawFrom || from) {\r\n to.animateFrom({\r\n style: (rawFrom && rawFrom !== from)\r\n // dividingMethod like clone may override the style(opacity)\r\n // So extend it to raw style.\r\n ? extend(extend({}, rawFrom.style), from.style)\r\n : from.style\r\n }, animationCfg);\r\n }\r\n }\r\n\r\n let hasMorphAnimation = false;\r\n\r\n /**\r\n * With groupId and childGroupId, we can build parent-child relationships between dataItems.\r\n * However, we should mind the parent-child \"direction\" between old and new options.\r\n *\r\n * For example, suppose we have two dataItems from two series.data:\r\n *\r\n * dataA: [ dataB: [\r\n * { {\r\n * value: 5, value: 3,\r\n * groupId: 'creatures', groupId: 'animals',\r\n * childGroupId: 'animals' childGroupId: 'dogs'\r\n * }, },\r\n * ... ...\r\n * ] ]\r\n *\r\n * where dataA is belong to optionA and dataB is belong to optionB.\r\n *\r\n * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of\r\n * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition\r\n * will work. This derection is \"parent -> child\".\r\n *\r\n * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId\r\n * of dataItemA as keys and universalTransition will work. This derection is \"child -> parent\".\r\n *\r\n * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no\r\n * parent-child relationship exists. This direction is \"none\".\r\n *\r\n * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter\r\n * functions. Thus, we need to decide the direction first.\r\n *\r\n * The rule is:\r\n *\r\n * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) {\r\n * direction = 'parent -> child';\r\n * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) {\r\n * direction = 'child -> parent';\r\n * } else {\r\n * direction = 'none';\r\n * }\r\n */\r\n let direction = TRANSITION_NONE;\r\n\r\n // find all groupIds and childGroupIds from oldDiffItems\r\n const oldGroupIds = createHashMap();\r\n const oldChildGroupIds = createHashMap();\r\n oldDiffItems.forEach((item) => {\r\n item.groupId && oldGroupIds.set(item.groupId, true);\r\n item.childGroupId && oldChildGroupIds.set(item.childGroupId, true);\r\n\r\n });\r\n // traverse newDiffItems and decide the direction according to the rule\r\n for (let i = 0; i < newDiffItems.length; i++) {\r\n const newGroupId = newDiffItems[i].groupId;\r\n if (oldChildGroupIds.get(newGroupId)) {\r\n direction = TRANSITION_P2C;\r\n break;\r\n }\r\n const newChildGroupId = newDiffItems[i].childGroupId;\r\n if (newChildGroupId && oldGroupIds.get(newChildGroupId)) {\r\n direction = TRANSITION_C2P;\r\n break;\r\n }\r\n }\r\n\r\n function createKeyGetter(isOld: boolean, onlyGetId: boolean) {\r\n return function (diffItem: DiffItem): string {\r\n const data = diffItem.data;\r\n const dataIndex = diffItem.dataIndex;\r\n // TODO if specified dim\r\n if (onlyGetId) {\r\n return data.getId(dataIndex);\r\n }\r\n if (isOld) {\r\n return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId;\r\n }\r\n else {\r\n return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId;\r\n }\r\n };\r\n }\r\n\r\n // Use id if it's very likely to be an one to one animation\r\n // It's more robust than groupId\r\n // TODO Check if key dimension is specified.\r\n const useId = isAllIdSame(oldDiffItems, newDiffItems);\r\n const isElementStillInChart: Dictionary = {};\r\n\r\n if (!useId) {\r\n // We may have different diff strategy with basicTransition if we use other dimension as key.\r\n // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.\r\n // We can't use the elements that already being morphed. Let it keep it's original basic transition.\r\n for (let i = 0; i < newDiffItems.length; i++) {\r\n const newItem = newDiffItems[i];\r\n const el = newItem.data.getItemGraphicEl(newItem.dataIndex);\r\n if (el) {\r\n isElementStillInChart[el.id] = true;\r\n }\r\n }\r\n }\r\n\r\n function updateOneToOne(newIndex: number, oldIndex: number) {\r\n\r\n const oldItem = oldDiffItems[oldIndex];\r\n const newItem = newDiffItems[newIndex];\r\n\r\n const newSeries = newItem.data.hostModel as SeriesModel;\r\n\r\n // TODO Mark this elements is morphed and don't morph them anymore\r\n const oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\r\n const newEl = newItem.data.getItemGraphicEl(newItem.dataIndex);\r\n\r\n // Can't handle same elements.\r\n if (oldEl === newEl) {\r\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\r\n return;\r\n }\r\n\r\n if (\r\n // We can't use the elements that already being morphed\r\n (oldEl && isElementStillInChart[oldEl.id])\r\n ) {\r\n return;\r\n }\r\n\r\n if (newEl) {\r\n // TODO: If keep animating the group in case\r\n // some of the elements don't want to be morphed.\r\n // TODO Label?\r\n stopAnimation(newEl);\r\n\r\n if (oldEl) {\r\n stopAnimation(oldEl);\r\n\r\n // If old element is doing leaving animation. stop it and remove it immediately.\r\n removeEl(oldEl);\r\n\r\n hasMorphAnimation = true;\r\n applyMorphAnimation(\r\n getPathList(oldEl),\r\n getPathList(newEl),\r\n newItem.divide,\r\n newSeries,\r\n newIndex,\r\n updateMorphingPathProps\r\n );\r\n }\r\n else {\r\n fadeInElement(newEl, newSeries, newIndex);\r\n }\r\n }\r\n // else keep oldEl leaving animation.\r\n }\r\n\r\n (new DataDiffer(\r\n oldDiffItems,\r\n newDiffItems,\r\n createKeyGetter(true, useId),\r\n createKeyGetter(false, useId),\r\n null,\r\n 'multiple'\r\n ))\r\n .update(updateOneToOne)\r\n .updateManyToOne(function (newIndex, oldIndices) {\r\n const newItem = newDiffItems[newIndex];\r\n const newData = newItem.data;\r\n const newSeries = newData.hostModel as SeriesModel;\r\n const newEl = newData.getItemGraphicEl(newItem.dataIndex);\r\n const oldElsList = filter(\r\n map(oldIndices, idx =>\r\n oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex)\r\n ),\r\n oldEl => oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id]\r\n );\r\n\r\n if (newEl) {\r\n stopAnimation(newEl);\r\n if (oldElsList.length) {\r\n // If old element is doing leaving animation. stop it and remove it immediately.\r\n each(oldElsList, oldEl => {\r\n stopAnimation(oldEl);\r\n removeEl(oldEl);\r\n });\r\n\r\n hasMorphAnimation = true;\r\n applyMorphAnimation(\r\n getPathList(oldElsList),\r\n getPathList(newEl),\r\n newItem.divide,\r\n newSeries,\r\n newIndex,\r\n updateMorphingPathProps\r\n );\r\n\r\n }\r\n else {\r\n fadeInElement(newEl, newSeries, newItem.dataIndex);\r\n }\r\n }\r\n // else keep oldEl leaving animation.\r\n })\r\n .updateOneToMany(function (newIndices, oldIndex) {\r\n const oldItem = oldDiffItems[oldIndex];\r\n const oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\r\n\r\n // We can't use the elements that already being morphed\r\n if (oldEl && isElementStillInChart[oldEl.id]) {\r\n return;\r\n }\r\n\r\n const newElsList = filter(\r\n map(newIndices, idx =>\r\n newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex)\r\n ),\r\n el => el && el !== oldEl\r\n );\r\n const newSeris = newDiffItems[newIndices[0]].data.hostModel as SeriesModel;\r\n\r\n if (newElsList.length) {\r\n each(newElsList, newEl => stopAnimation(newEl));\r\n if (oldEl) {\r\n stopAnimation(oldEl);\r\n // If old element is doing leaving animation. stop it and remove it immediately.\r\n removeEl(oldEl);\r\n\r\n hasMorphAnimation = true;\r\n applyMorphAnimation(\r\n getPathList(oldEl),\r\n getPathList(newElsList),\r\n oldItem.divide, // Use divide on old.\r\n newSeris,\r\n newIndices[0],\r\n updateMorphingPathProps\r\n );\r\n }\r\n else {\r\n each(newElsList, newEl => fadeInElement(newEl, newSeris, newIndices[0]));\r\n }\r\n }\r\n\r\n // else keep oldEl leaving animation.\r\n })\r\n .updateManyToMany(function (newIndices, oldIndices) {\r\n // If two data are same and both have groupId.\r\n // Normally they should be diff by id.\r\n new DataDiffer(\r\n oldIndices,\r\n newIndices,\r\n (rawIdx: number) => oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex),\r\n (rawIdx: number) => newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex)\r\n ).update((newIndex, oldIndex) => {\r\n // Use the original index\r\n updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);\r\n }).execute();\r\n })\r\n .execute();\r\n\r\n if (hasMorphAnimation) {\r\n each(newList, ({ data }) => {\r\n const seriesModel = data.hostModel as SeriesModel;\r\n const view = seriesModel && api.getViewOfSeriesModel(seriesModel as SeriesModel);\r\n const animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index.\r\n if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {\r\n view.group.traverse(el => {\r\n if (el instanceof Path && !el.animators.length) {\r\n // We can't accept there still exists element that has no animation\r\n // if universalTransition is enabled\r\n el.animateFrom({\r\n style: {\r\n opacity: 0\r\n }\r\n }, animationCfg);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction getSeriesTransitionKey(series: SeriesModel) {\r\n const seriesKey = (series.getModel('universalTransition') as Model)\r\n .get('seriesKey');\r\n if (!seriesKey) {\r\n // Use series id by default.\r\n return series.id;\r\n }\r\n return seriesKey;\r\n}\r\n\r\nfunction convertArraySeriesKeyToString(seriesKey: string[] | string) {\r\n if (isArray(seriesKey)) {\r\n // Order independent.\r\n return seriesKey.sort().join(',');\r\n }\r\n return seriesKey;\r\n}\r\n\r\ninterface SeriesTransitionBatch {\r\n oldSeries: TransitionSeries[]\r\n newSeries: TransitionSeries[]\r\n}\r\n\r\nfunction getDivideShapeFromData(data: SeriesData) {\r\n if (data.hostModel) {\r\n return ((data.hostModel as SeriesModel)\r\n .getModel('universalTransition') as Model)\r\n .get('divideShape');\r\n }\r\n}\r\n\r\nfunction findTransitionSeriesBatches(\r\n globalStore: GlobalStore,\r\n params: UpdateLifecycleParams\r\n) {\r\n const updateBatches = createHashMap();\r\n\r\n const oldDataMap = createHashMap<{\r\n dataGroupId: string,\r\n data: SeriesData\r\n }>();\r\n // Map that only store key in array seriesKey.\r\n // Which is used to query the old data when transition from one to multiple series.\r\n const oldDataMapForSplit = createHashMap<{\r\n key: string,\r\n dataGroupId: string,\r\n data: SeriesData\r\n }>();\r\n\r\n each(globalStore.oldSeries, (series, idx) => {\r\n const oldDataGroupId = globalStore.oldDataGroupIds[idx] as string;\r\n const oldData = globalStore.oldData[idx];\r\n const transitionKey = getSeriesTransitionKey(series);\r\n const transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\r\n oldDataMap.set(transitionKeyStr, {\r\n dataGroupId: oldDataGroupId,\r\n data: oldData\r\n });\r\n\r\n if (isArray(transitionKey)) {\r\n // Same key can't in different array seriesKey.\r\n each(transitionKey, key => {\r\n oldDataMapForSplit.set(key, {\r\n key: transitionKeyStr,\r\n dataGroupId: oldDataGroupId,\r\n data: oldData\r\n });\r\n });\r\n }\r\n });\r\n\r\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr: string) {\r\n if (updateBatches.get(transitionKeyStr)) {\r\n warn(`Duplicated seriesKey in universalTransition ${transitionKeyStr}`);\r\n }\r\n }\r\n each(params.updatedSeries, series => {\r\n if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {\r\n const newDataGroupId = series.get('dataGroupId') as string;\r\n const newData = series.getData();\r\n const transitionKey = getSeriesTransitionKey(series);\r\n const transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\r\n // Only transition between series with same id.\r\n const oldData = oldDataMap.get(transitionKeyStr);\r\n // string transition key is the best match.\r\n if (oldData) {\r\n if (__DEV__) {\r\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\r\n }\r\n // TODO check if data is same?\r\n updateBatches.set(transitionKeyStr, {\r\n oldSeries: [{\r\n dataGroupId: oldData.dataGroupId,\r\n divide: getDivideShapeFromData(oldData.data),\r\n data: oldData.data\r\n }],\r\n newSeries: [{\r\n dataGroupId: newDataGroupId,\r\n divide: getDivideShapeFromData(newData),\r\n data: newData\r\n }]\r\n });\r\n }\r\n else {\r\n // Transition from multiple series.\r\n // e.g. 'female', 'male' -> ['female', 'male']\r\n if (isArray(transitionKey)) {\r\n if (__DEV__) {\r\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\r\n }\r\n const oldSeries: TransitionSeries[] = [];\r\n each(transitionKey, key => {\r\n const oldData = oldDataMap.get(key);\r\n if (oldData.data) {\r\n oldSeries.push({\r\n dataGroupId: oldData.dataGroupId,\r\n divide: getDivideShapeFromData(oldData.data),\r\n data: oldData.data\r\n });\r\n }\r\n });\r\n if (oldSeries.length) {\r\n updateBatches.set(transitionKeyStr, {\r\n oldSeries,\r\n newSeries: [{\r\n dataGroupId: newDataGroupId,\r\n data: newData,\r\n divide: getDivideShapeFromData(newData)\r\n }]\r\n });\r\n }\r\n }\r\n else {\r\n // Try transition to multiple series.\r\n // e.g. ['female', 'male'] -> 'female', 'male'\r\n const oldData = oldDataMapForSplit.get(transitionKey);\r\n if (oldData) {\r\n let batch = updateBatches.get(oldData.key);\r\n if (!batch) {\r\n batch = {\r\n oldSeries: [{\r\n dataGroupId: oldData.dataGroupId,\r\n data: oldData.data,\r\n divide: getDivideShapeFromData(oldData.data)\r\n }],\r\n newSeries: []\r\n };\r\n updateBatches.set(oldData.key, batch);\r\n }\r\n batch.newSeries.push({\r\n dataGroupId: newDataGroupId,\r\n data: newData,\r\n divide: getDivideShapeFromData(newData)\r\n });\r\n }\r\n }\r\n }\r\n }\r\n });\r\n\r\n return updateBatches;\r\n}\r\n\r\nfunction querySeries(series: SeriesModel[], finder: UpdateLifecycleTransitionSeriesFinder) {\r\n for (let i = 0; i < series.length; i++) {\r\n const found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex\r\n || finder.seriesId != null && finder.seriesId === series[i].id;\r\n if (found) {\r\n return i;\r\n }\r\n }\r\n}\r\n\r\nfunction transitionSeriesFromOpt(\r\n transitionOpt: UpdateLifecycleTransitionItem,\r\n globalStore: GlobalStore,\r\n params: UpdateLifecycleParams,\r\n api: ExtensionAPI\r\n) {\r\n const from: TransitionSeries[] = [];\r\n const to: TransitionSeries[] = [];\r\n each(normalizeToArray(transitionOpt.from), finder => {\r\n const idx = querySeries(globalStore.oldSeries, finder);\r\n if (idx >= 0) {\r\n from.push({\r\n dataGroupId: globalStore.oldDataGroupIds[idx],\r\n data: globalStore.oldData[idx],\r\n // TODO can specify divideShape in transition.\r\n divide: getDivideShapeFromData(globalStore.oldData[idx]),\r\n groupIdDim: finder.dimension\r\n });\r\n }\r\n });\r\n each(normalizeToArray(transitionOpt.to), finder => {\r\n const idx = querySeries(params.updatedSeries, finder);\r\n if (idx >= 0) {\r\n const data = params.updatedSeries[idx].getData();\r\n to.push({\r\n dataGroupId: globalStore.oldDataGroupIds[idx],\r\n data,\r\n divide: getDivideShapeFromData(data),\r\n groupIdDim: finder.dimension\r\n });\r\n }\r\n });\r\n if (from.length > 0 && to.length > 0) {\r\n transitionBetween(from, to, api);\r\n }\r\n}\r\n\r\nexport function installUniversalTransition(registers: EChartsExtensionInstallRegisters) {\r\n\r\n registers.registerUpdateLifecycle('series:beforeupdate', (ecMOdel, api, params) => {\r\n each(normalizeToArray(params.seriesTransition), transOpt => {\r\n each(normalizeToArray(transOpt.to), (finder) => {\r\n const series = params.updatedSeries;\r\n for (let i = 0; i < series.length; i++) {\r\n if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex\r\n || finder.seriesId != null && finder.seriesId === series[i].id) {\r\n series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true;\r\n }\r\n }\r\n });\r\n });\r\n });\r\n registers.registerUpdateLifecycle('series:transition', (ecModel, api, params) => {\r\n // TODO api provide an namespace that can save stuff per instance\r\n const globalStore = getUniversalTransitionGlobalStore(api);\r\n\r\n // TODO multiple to multiple series.\r\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\r\n // TODO transitionOpt was used in an old implementation and can be removed now\r\n // Use give transition config if its' give;\r\n const transitionOpt = params.seriesTransition;\r\n if (transitionOpt) {\r\n each(normalizeToArray(transitionOpt), opt => {\r\n transitionSeriesFromOpt(opt, globalStore, params, api);\r\n });\r\n }\r\n else { // Else guess from series based on transition series key.\r\n const updateBatches = findTransitionSeriesBatches(globalStore, params);\r\n each(updateBatches.keys(), key => {\r\n const batch = updateBatches.get(key);\r\n transitionBetween(batch.oldSeries, batch.newSeries, api);\r\n });\r\n }\r\n\r\n // Reset\r\n each(params.updatedSeries, series => {\r\n // Reset;\r\n if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {\r\n series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;\r\n }\r\n });\r\n }\r\n\r\n // Save all series of current update. Not only the updated one.\r\n const allSeries = ecModel.getSeries();\r\n const savedSeries: SeriesModel[] = globalStore.oldSeries = [];\r\n const savedDataGroupIds: string[] = globalStore.oldDataGroupIds = [];\r\n const savedData: SeriesData[] = globalStore.oldData = [];\r\n for (let i = 0; i < allSeries.length; i++) {\r\n const data = allSeries[i].getData();\r\n // Only save the data that can have transition.\r\n // Avoid large data costing too much extra memory\r\n if (data.count() < DATA_COUNT_THRESHOLD) {\r\n savedSeries.push(allSeries[i]);\r\n savedDataGroupIds.push(allSeries[i].get('dataGroupId') as string);\r\n savedData.push(data);\r\n }\r\n }\r\n });\r\n}\r\n"], + "m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ApiBvqB/B,IAAI,CAAC;AAGL,IAAI,CAAC;AAcL,IAAI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAqBJ,IAAI;AAWJ,IAAI;AASJ,IAAI;AAQJ,IAAI;AAUJ,IAAI;AASJ,IAAI;AAcJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AAUJ,IAAI;AAUJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AAGJ,IAAI;AAOJ,IAAI;AAMJ,IAAI;AAGJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AAMJ,IAAI;AASJ,IAAI;AAEJ,IAAI;AAQJ,IAAI;AAQJ,IAAI;", + "names": [] +} diff --git a/i18n/langFA-obj.js b/i18n/langFA-obj.js new file mode 100644 index 0000000000..9dda3e9394 --- /dev/null +++ b/i18n/langFA-obj.js @@ -0,0 +1,175 @@ + + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['exports'], factory); + } else if ( + typeof exports === 'object' && + typeof exports.nodeName !== 'string' + ) { + // CommonJS + factory(exports); + } else { + // Browser globals + factory({}); + } +})(this, function(exports) { + + +/** + * Language: Persian. + */ + +var localeObj = { + time: { + month: [ + 'بهمن', 'اسفند', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', + 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی' + ], + monthAbbr: [ + 'بهمن', 'اسفند', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', + 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی' + ], + dayOfWeek: [ + 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' + ], + dayOfWeekAbbr: [ + 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' + ] + }, + legend: { + selector: { + all: 'همه', + inverse: 'معکوس' + } + }, + toolbox: { + brush: { + title: { + rect: 'چهار ضلعی', + polygon: 'چند ضلعی', + lineX: 'افقی', + lineY: 'عمودی', + keep: 'قفل کردن', + clear: 'پاک کردن' + } + }, + dataView: { + title: 'نمایش داده‌ها', + lang: ['نمایش داده‌ها', 'خروج', 'بارگذاری مجدد'] + }, + dataZoom: { + title: { + zoom: 'بزرگنمایی', + back: 'خروج از بزرگنمایی' + } + }, + magicType: { + title: { + line: 'نمودار خطی', + bar: 'نمودار میله‌ای', + stack: 'پشته', + tiled: 'کاشی' + } + }, + restore: { + title: 'بازگردانی' + }, + saveAsImage: { + title: 'ذخیره تصویر', + lang: ['راست کلیک برای ذخیره تصویر'] + } + }, + series: { + typeNames: { + pie: 'نمودار دایره‌ای', + bar: 'نمودار میله‌ای', + line: 'نمودار خطی', + scatter: 'طرح پراکنده', + effectScatter: 'طرح پراکنده موج دار', + radar: 'نمودار راداری', + tree: 'درخت', + treemap: 'نقشه درختی', + boxplot: 'طرح جعبه‌', + candlestick: 'شمعی', + k: 'نمودار خطی k', + heatmap: 'نقشه گرمایی', + map: 'نقشه', + parallel: 'نقشه مختصات موازی', + lines: 'گراف خطی', + graph: 'گراف ارتباط', + sankey: 'دیاگرام سنکی', + funnel: 'نمودار قیفی', + gauge: 'اندازه گیر', + pictorialBar: 'نوار تصویری', + themeRiver: 'نقشه رودخانه رنگی', + sunburst: 'آفتاب زدگی', + custom: 'نمودار سفارشی', + chart: 'نمودار' + } + }, + aria: { + general: { + withTitle: 'نمودار مربوط به "{title}"', + withoutTitle: 'این یک نمودار است' + }, + series: { + single: { + prefix: '', + withName: 'با نوع {seriesType} و نام {seriesName}.', + withoutName: 'با نوع {seriesType}.' + }, + multiple: { + prefix: '. تشکیل شده از {seriesCount} سری.', + withName: '{seriesId} سری نوعی از {seriesType} به نام {seriesName} است.', + withoutName: 'سری {seriesId} نوعی از {seriesType} است.', + separator: { + middle: '', + end: '' + } + } + }, + data: { + allData: 'دیتای نمونه: ', + partialData: 'اولین عنصر از {displayCnt}:', + withName: 'مقدار {name}, {value} است', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' + } + } + } +}; + + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } + +}); \ No newline at end of file diff --git a/i18n/langFA.js b/i18n/langFA.js new file mode 100644 index 0000000000..81f9a7e719 --- /dev/null +++ b/i18n/langFA.js @@ -0,0 +1,171 @@ + + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['exports', 'echarts'], factory); + } else if ( + typeof exports === 'object' && + typeof exports.nodeName !== 'string' + ) { + // CommonJS + factory(exports, require('echarts/lib/echarts')); + } else { + // Browser globals + factory({}, root.echarts); + } +})(this, function(exports, echarts) { + + +/** + * Language: Persian. + */ + +var localeObj = { + time: { + month: [ + 'بهمن', 'اسفند', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', + 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی' + ], + monthAbbr: [ + 'بهمن', 'اسفند', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', + 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی' + ], + dayOfWeek: [ + 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' + ], + dayOfWeekAbbr: [ + 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' + ] + }, + legend: { + selector: { + all: 'همه', + inverse: 'معکوس' + } + }, + toolbox: { + brush: { + title: { + rect: 'چهار ضلعی', + polygon: 'چند ضلعی', + lineX: 'افقی', + lineY: 'عمودی', + keep: 'قفل کردن', + clear: 'پاک کردن' + } + }, + dataView: { + title: 'نمایش داده‌ها', + lang: ['نمایش داده‌ها', 'خروج', 'بارگذاری مجدد'] + }, + dataZoom: { + title: { + zoom: 'بزرگنمایی', + back: 'خروج از بزرگنمایی' + } + }, + magicType: { + title: { + line: 'نمودار خطی', + bar: 'نمودار میله‌ای', + stack: 'پشته', + tiled: 'کاشی' + } + }, + restore: { + title: 'بازگردانی' + }, + saveAsImage: { + title: 'ذخیره تصویر', + lang: ['راست کلیک برای ذخیره تصویر'] + } + }, + series: { + typeNames: { + pie: 'نمودار دایره‌ای', + bar: 'نمودار میله‌ای', + line: 'نمودار خطی', + scatter: 'طرح پراکنده', + effectScatter: 'طرح پراکنده موج دار', + radar: 'نمودار راداری', + tree: 'درخت', + treemap: 'نقشه درختی', + boxplot: 'طرح جعبه‌', + candlestick: 'شمعی', + k: 'نمودار خطی k', + heatmap: 'نقشه گرمایی', + map: 'نقشه', + parallel: 'نقشه مختصات موازی', + lines: 'گراف خطی', + graph: 'گراف ارتباط', + sankey: 'دیاگرام سنکی', + funnel: 'نمودار قیفی', + gauge: 'اندازه گیر', + pictorialBar: 'نوار تصویری', + themeRiver: 'نقشه رودخانه رنگی', + sunburst: 'آفتاب زدگی', + custom: 'نمودار سفارشی', + chart: 'نمودار' + } + }, + aria: { + general: { + withTitle: 'نمودار مربوط به "{title}"', + withoutTitle: 'این یک نمودار است' + }, + series: { + single: { + prefix: '', + withName: 'با نوع {seriesType} و نام {seriesName}.', + withoutName: 'با نوع {seriesType}.' + }, + multiple: { + prefix: '. تشکیل شده از {seriesCount} سری.', + withName: '{seriesId} سری نوعی از {seriesType} به نام {seriesName} است.', + withoutName: 'سری {seriesId} نوعی از {seriesType} است.', + separator: { + middle: '', + end: '' + } + } + }, + data: { + allData: 'دیتای نمونه: ', + partialData: 'اولین عنصر از {displayCnt}:', + withName: 'مقدار {name}, {value} است', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' + } + } + } +}; + + echarts.registerLocale('FA', localeObj); + +}); \ No newline at end of file diff --git a/i18n/langPT-br-obj.js b/i18n/langPT-br-obj.js index 002322e9a8..775366eef0 100644 --- a/i18n/langPT-br-obj.js +++ b/i18n/langPT-br-obj.js @@ -65,7 +65,7 @@ var localeObj = { legend: { selector: { all: 'Todas', - inverse: 'Inv' + inverse: 'Inverter' } }, toolbox: { @@ -98,7 +98,7 @@ var localeObj = { } }, restore: { - title: 'Restore' + title: 'Restaurar' }, saveAsImage: { title: 'Salvar como imagem', @@ -113,22 +113,22 @@ var localeObj = { scatter: 'Gráfico de dispersão', effectScatter: 'Gráfico de dispersão ondulado', radar: 'Gráfico radar', - tree: 'Árvore', - treemap: 'Treemap', - boxplot: 'Boxplot', - candlestick: 'Candlestick', - k: 'Gráfico K line', + tree: 'Gráfico de árvore', + treemap: 'Mapa de árvore', + boxplot: 'Gráfico de caixa', + candlestick: 'Gráfico de vela', + k: 'Gráfico de linha K', heatmap: 'Mapa de calor', map: 'Mapa', parallel: 'Coordenadas paralelas', lines: 'Gráfico de linhas', - graph: 'Relationship graph', + graph: 'Grafo', sankey: 'Gráfico Sankey', funnel: 'Gráfico de funil', - gauge: 'Gauge', - pictorialBar: 'Pictorial bar', - themeRiver: 'Theme River Map', - sunburst: 'Sunburst', + gauge: 'Gráfico de medidor', + pictorialBar: 'Barra pictórica', + themeRiver: 'Gráfico de rio de tema', + sunburst: 'Gráfico de explosão solar', custom: 'Gráfico personalizado', chart: 'Gráfico' } diff --git a/i18n/langPT-br.js b/i18n/langPT-br.js index fefc5017c5..c57e93725e 100644 --- a/i18n/langPT-br.js +++ b/i18n/langPT-br.js @@ -65,7 +65,7 @@ var localeObj = { legend: { selector: { all: 'Todas', - inverse: 'Inv' + inverse: 'Inverter' } }, toolbox: { @@ -98,7 +98,7 @@ var localeObj = { } }, restore: { - title: 'Restore' + title: 'Restaurar' }, saveAsImage: { title: 'Salvar como imagem', @@ -113,22 +113,22 @@ var localeObj = { scatter: 'Gráfico de dispersão', effectScatter: 'Gráfico de dispersão ondulado', radar: 'Gráfico radar', - tree: 'Árvore', - treemap: 'Treemap', - boxplot: 'Boxplot', - candlestick: 'Candlestick', - k: 'Gráfico K line', + tree: 'Gráfico de árvore', + treemap: 'Mapa de árvore', + boxplot: 'Gráfico de caixa', + candlestick: 'Gráfico de vela', + k: 'Gráfico de linha K', heatmap: 'Mapa de calor', map: 'Mapa', parallel: 'Coordenadas paralelas', lines: 'Gráfico de linhas', - graph: 'Relationship graph', + graph: 'Grafo', sankey: 'Gráfico Sankey', funnel: 'Gráfico de funil', - gauge: 'Gauge', - pictorialBar: 'Pictorial bar', - themeRiver: 'Theme River Map', - sunburst: 'Sunburst', + gauge: 'Gráfico de medidor', + pictorialBar: 'Barra pictórica', + themeRiver: 'Gráfico de rio de tema', + sunburst: 'Gráfico de explosão solar', custom: 'Gráfico personalizado', chart: 'Gráfico' } diff --git a/i18n/langSV-obj.js b/i18n/langSV-obj.js new file mode 100644 index 0000000000..a321b33e25 --- /dev/null +++ b/i18n/langSV-obj.js @@ -0,0 +1,174 @@ + + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['exports'], factory); + } else if ( + typeof exports === 'object' && + typeof exports.nodeName !== 'string' + ) { + // CommonJS + factory(exports); + } else { + // Browser globals + factory({}); + } +})(this, function(exports) { + + +/** + * Language: Swedish. + */ + +var localeObj = { + time: { + month: [ + 'januari', 'februari', 'mars', 'april', 'maj', 'juni', + 'juli', 'augusti', 'september', 'oktober', 'november', 'december', + ], + monthAbbr: [ + 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', + 'jul', 'aug', 'sep', 'okt', 'nov', 'dec', + ], + dayOfWeek: [ + 'söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag', + ], + dayOfWeekAbbr: [ + 'sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör', + ], + }, + legend: { + selector: { + all: 'Alla', + inverse: 'Omvänd', + }, + }, + toolbox: { + brush: { + title: { + rect: 'Rektangelurval', + polygon: 'Lassomarkering', + lineX: 'Vågrätt urval', + lineY: 'Lodrätt urval', + keep: 'Behåll urval', + clear: 'Rensa urval', + }, + }, + dataView: { + title: 'Datavy', + lang: ['Datavy', 'Stäng', 'Uppdatera'], + }, + dataZoom: { + title: { + zoom: 'Zooma', + back: 'Återställ zoom', + }, + }, + magicType: { + title: { + line: 'Byt till linjediagram', + bar: 'Byt till stapeldiagram', + stack: 'Stapla', + tiled: 'Sida vid sida', + }, + }, + restore: { + title: 'Återställ', + }, + saveAsImage: { + title: 'Spara som bild', + lang: ['Högerklicka för att spara bild'], + }, + }, + series: { + typeNames: { + pie: 'Cirkeldiagram', + bar: 'Stapeldiagram', + line: 'Linjediagram', + scatter: 'Punktdiagram', + effectScatter: 'Punktdiagram med rippeleffekt', + radar: 'Radardiagram', + tree: 'Träd', + treemap: 'Trädkarta', + boxplot: 'Lådagram', + candlestick: 'Candlestick', + k: 'K-linjediagram', + heatmap: 'Värmekarta', + map: 'Karta', + parallel: 'Parallella koordinater', + lines: 'Linjediagram', + graph: 'Relationsgraf', + sankey: 'Sankeydiagram', + funnel: 'Trattdiagram', + gauge: 'Mätare', + pictorialBar: 'Bildstapel', + themeRiver: 'Tematisk flod', + sunburst: 'Solburstdiagram', + custom: 'Anpassat', + chart: 'Diagram', + }, + }, + aria: { + general: { + withTitle: 'Detta är ett diagram om "{title}"', + withoutTitle: 'Detta är ett diagram', + }, + series: { + single: { + prefix: '', + withName: ' med typnamn {name}.', + withoutName: ' med typ {seriesType}.', + }, + multiple: { + prefix: '. Det består av {seriesCount} serier.', + withName: ' Serien {seriesId} är en {seriesType} som representerar {seriesName}.', + withoutName: ' Serien {seriesId} är en {seriesType}.', + separator: { + middle: '', + end: '', + }, + }, + }, + data: { + allData: 'Data är som följer: ', + partialData: 'De första {displayCnt} objekten är: ', + withName: 'datavärdet för {name} är {value}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ', + }, + }, + }, + }; + for (var key in localeObj) { + if (localeObj.hasOwnProperty(key)) { + exports[key] = localeObj[key]; + } + } + +}); \ No newline at end of file diff --git a/i18n/langSV.js b/i18n/langSV.js new file mode 100644 index 0000000000..16933ebbc8 --- /dev/null +++ b/i18n/langSV.js @@ -0,0 +1,170 @@ + + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +/** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['exports', 'echarts'], factory); + } else if ( + typeof exports === 'object' && + typeof exports.nodeName !== 'string' + ) { + // CommonJS + factory(exports, require('echarts/lib/echarts')); + } else { + // Browser globals + factory({}, root.echarts); + } +})(this, function(exports, echarts) { + + +/** + * Language: Swedish. + */ + +var localeObj = { + time: { + month: [ + 'januari', 'februari', 'mars', 'april', 'maj', 'juni', + 'juli', 'augusti', 'september', 'oktober', 'november', 'december', + ], + monthAbbr: [ + 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', + 'jul', 'aug', 'sep', 'okt', 'nov', 'dec', + ], + dayOfWeek: [ + 'söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag', + ], + dayOfWeekAbbr: [ + 'sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör', + ], + }, + legend: { + selector: { + all: 'Alla', + inverse: 'Omvänd', + }, + }, + toolbox: { + brush: { + title: { + rect: 'Rektangelurval', + polygon: 'Lassomarkering', + lineX: 'Vågrätt urval', + lineY: 'Lodrätt urval', + keep: 'Behåll urval', + clear: 'Rensa urval', + }, + }, + dataView: { + title: 'Datavy', + lang: ['Datavy', 'Stäng', 'Uppdatera'], + }, + dataZoom: { + title: { + zoom: 'Zooma', + back: 'Återställ zoom', + }, + }, + magicType: { + title: { + line: 'Byt till linjediagram', + bar: 'Byt till stapeldiagram', + stack: 'Stapla', + tiled: 'Sida vid sida', + }, + }, + restore: { + title: 'Återställ', + }, + saveAsImage: { + title: 'Spara som bild', + lang: ['Högerklicka för att spara bild'], + }, + }, + series: { + typeNames: { + pie: 'Cirkeldiagram', + bar: 'Stapeldiagram', + line: 'Linjediagram', + scatter: 'Punktdiagram', + effectScatter: 'Punktdiagram med rippeleffekt', + radar: 'Radardiagram', + tree: 'Träd', + treemap: 'Trädkarta', + boxplot: 'Lådagram', + candlestick: 'Candlestick', + k: 'K-linjediagram', + heatmap: 'Värmekarta', + map: 'Karta', + parallel: 'Parallella koordinater', + lines: 'Linjediagram', + graph: 'Relationsgraf', + sankey: 'Sankeydiagram', + funnel: 'Trattdiagram', + gauge: 'Mätare', + pictorialBar: 'Bildstapel', + themeRiver: 'Tematisk flod', + sunburst: 'Solburstdiagram', + custom: 'Anpassat', + chart: 'Diagram', + }, + }, + aria: { + general: { + withTitle: 'Detta är ett diagram om "{title}"', + withoutTitle: 'Detta är ett diagram', + }, + series: { + single: { + prefix: '', + withName: ' med typnamn {name}.', + withoutName: ' med typ {seriesType}.', + }, + multiple: { + prefix: '. Det består av {seriesCount} serier.', + withName: ' Serien {seriesId} är en {seriesType} som representerar {seriesName}.', + withoutName: ' Serien {seriesId} är en {seriesType}.', + separator: { + middle: '', + end: '', + }, + }, + }, + data: { + allData: 'Data är som följer: ', + partialData: 'De första {displayCnt} objekten är: ', + withName: 'datavärdet för {name} är {value}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ', + }, + }, + }, + }; + echarts.registerLocale('SV', localeObj); + +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ae4cddd643..9238063e06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "tslib": "2.3.0", - "zrender": "5.6.0" + "zrender": "npm:zrender-nightly@^5.6.1-dev.20241025" }, "devDependencies": { "@babel/code-frame": "7.10.4", @@ -11297,9 +11297,10 @@ "optional": true }, "node_modules/zrender": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.0.tgz", - "integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==", + "name": "zrender-nightly", + "version": "5.6.1-dev.20241025", + "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.6.1-dev.20241025.tgz", + "integrity": "sha512-CY7dSzSKK9uuIBPb/sh6zk3MmnNMgo/JCeZCIK9nsE6aZmqEitGADaDNMR+WXTW2ptXyE4je3HXAZiLJJ1Pmrw==", "dependencies": { "tslib": "2.3.0" } @@ -20322,9 +20323,9 @@ } }, "zrender": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.0.tgz", - "integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==", + "version": "npm:zrender-nightly@5.6.1-dev.20241025", + "resolved": "https://registry.npmjs.org/zrender-nightly/-/zrender-nightly-5.6.1-dev.20241025.tgz", + "integrity": "sha512-CY7dSzSKK9uuIBPb/sh6zk3MmnNMgo/JCeZCIK9nsE6aZmqEitGADaDNMR+WXTW2ptXyE4je3HXAZiLJJ1Pmrw==", "requires": { "tslib": "2.3.0" } diff --git a/package.json b/package.json index 3f0d0a3428..c01d460ca2 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ }, "dependencies": { "tslib": "2.3.0", - "zrender": "5.6.0" + "zrender": "npm:zrender-nightly@^5.6.1-dev.20241025" }, "devDependencies": { "@babel/code-frame": "7.10.4", diff --git a/src/component/legend/LegendView.ts b/src/component/legend/LegendView.ts index 9016468240..b114f10f8a 100644 --- a/src/component/legend/LegendView.ts +++ b/src/component/legend/LegendView.ts @@ -23,8 +23,8 @@ import { PathStyleProps } from 'zrender/src/graphic/Path'; import { parse, stringify } from 'zrender/src/tool/color'; import * as graphic from '../../util/graphic'; import { enableHoverEmphasis } from '../../util/states'; -import {setLabelStyle, createTextStyle} from '../../label/labelStyle'; -import {makeBackground} from '../helper/listComponent'; +import { setLabelStyle, createTextStyle } from '../../label/labelStyle'; +import { makeBackground } from '../helper/listComponent'; import * as layoutUtil from '../../util/layout'; import ComponentView from '../../view/Component'; import LegendModel, { @@ -46,8 +46,8 @@ import { SymbolOptionMixin } from '../../util/types'; import Model from '../../model/Model'; -import {LineStyleProps} from '../../model/mixin/lineStyle'; -import {createSymbol, ECSymbol} from '../../util/symbol'; +import { LineStyleProps } from '../../model/mixin/lineStyle'; +import { createSymbol, ECSymbol } from '../../util/symbol'; import SeriesModel from '../../model/Series'; import { createOrUpdatePatternFromDecal } from '../../util/decal'; import { getECData } from '../../util/innerStore'; @@ -133,7 +133,7 @@ class LegendView extends ComponentView { // Perform layout. const positionInfo = legendModel.getBoxLayoutParams(); - const viewportSize = {width: api.getWidth(), height: api.getHeight()}; + const viewportSize = { width: api.getWidth(), height: api.getHeight() }; const padding = legendModel.get('padding'); const maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding); @@ -223,7 +223,7 @@ class LegendView extends ComponentView { ); itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)) - .on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)) + .on('legendmouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)) .on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId)); if (ecModel.ssr) { @@ -276,9 +276,10 @@ class LegendView extends ComponentView { itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls // more than one pie series. - .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)) + .on('legendmouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)) .on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId)); + if (ecModel.ssr) { itemGroup.eachChild(child => { const ecData = getECData(child); @@ -444,7 +445,7 @@ class LegendView extends ComponentView { fill: textColor, align: textAlign, verticalAlign: 'middle' - }, {inheritColor: textColor}) + }, { inheritColor: textColor }) })); // Add a invisible rect to increase the area of mouse hover @@ -542,7 +543,7 @@ class LegendView extends ComponentView { contentGroup.x = contentPos[0]; contentGroup.y = contentPos[1]; - const mainRect = {x: 0, y: 0} as ZRRectLike; + const mainRect = { x: 0, y: 0 } as ZRRectLike; mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh]; mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]); mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]); @@ -595,8 +596,8 @@ function getLegendStyle( const iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke'; const decalStyle = itemStyleModel.getShallow('decal'); itemStyle.decal = (!decalStyle || decalStyle === 'inherit') - ? itemVisualStyle.decal - : createOrUpdatePatternFromDecal(decalStyle, api); + ? itemVisualStyle.decal + : createOrUpdatePatternFromDecal(decalStyle, api); if (itemStyle.fill === 'inherit') { /** diff --git a/test/legend-event.html b/test/legend-event.html new file mode 100644 index 0000000000..c58a42a3ef --- /dev/null +++ b/test/legend-event.html @@ -0,0 +1,45 @@ + + + + + + + ECharts legendmouseover Event Test + + + + + + +
+ + + + \ No newline at end of file diff --git a/test/legend-style.html b/test/legend-style.html index 803dac2ee0..b201a235b7 100644 --- a/test/legend-style.html +++ b/test/legend-style.html @@ -18,37 +18,39 @@ - - - - - - - - - - - - - + + + + + + + + + + + -
-
-
+ + - + return data; + } + - + - + - - + + + \ No newline at end of file